main_2020_show.js 2.5 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162
  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)), (this.top = E(i)), (this.width = E(n)), (this.height = E(e)), (this.right = this.left + this.width), (this.bottom = this.top + this.height)
  39. }
  40. function h(t, i, n, e) {
  41. ;(this.visible = t || 0), (this.viewport = i || 0), (this.possible = n || 0), (this.rects = (e && T({}, e)) || null)
  42. }
  43. function l(t, i) {
  44. ;(this.els = t), (this.viewport = i)
  45. }
  46. function c(t, i, n) {
  47. var e
  48. return g.inArray(n, q) >= 0 ? (e = s.ofElement(t)) : g.inArray(n, S) >= 0 && (e = h.of(t, i)), e ? e[n] : 0
  49. }
  50. function u(t, i) {
  51. return t.val - i.val
  52. }
  53. function a(t, i) {
  54. return i.val - t.val
  55. }
  56. function f(t) {
  57. var i = s.ofContent(t, !0),
  58. n = s.ofViewport(t, !0),
  59. e = i.width - n.width,
  60. o = i.height - n.height
  61. ;(this.content = i),
  62. (this.viewport = n),
  63. (this.width = 0 >= e ? null : n.left / e),
  64. (this.height = 0 >= o ? null : n.top / o),
  65. (this.left = n.left),
  66. (this.top = n.top),
  67. (this.right = i.right - n.right),
  68. (this.bottom = i.bottom - n.bottom)
  69. }
  70. function p(t) {
  71. this.el = t || window
  72. }
  73. function d(t, i) {
  74. ;(this.context = t), (this.viewport = i), this.init()
  75. }
  76. function v(t, i, n, e) {
  77. ;(this.context = new l(t, i)), (this.property = n), (this.descending = e), this.init()
  78. }
  79. function w(t) {
  80. t && t !== window && t !== document ? ((this.context = t), (this.$autoTarget = g(t))) : (this.context = window), this.init()
  81. }
  82. var g = jQuery,
  83. m = g(window),
  84. b = g(document),
  85. T = g.extend,
  86. y = g.isFunction,
  87. k = Math.max,
  88. V = Math.min,
  89. E = Math.round,
  90. x = (function () {
  91. var t = {},
  92. i = 1
  93. return function (n) {
  94. return n ? (t[n] || ((t[n] = i), (i += 1)), t[n]) : 0
  95. }
  96. })()
  97. T(s.prototype, {
  98. equals: function (t) {
  99. return r(this, t, ['left', 'top', 'width', 'height'])
  100. },
  101. area: function () {
  102. return this.width * this.height
  103. },
  104. relativeTo: function (t) {
  105. return new s(this.left - t.left, this.top - t.top, this.width, this.height)
  106. },
  107. intersection: function (t) {
  108. if (!i(t, s)) return null
  109. var n = k(this.left, t.left),
  110. e = V(this.right, t.right),
  111. o = k(this.top, t.top),
  112. r = V(this.bottom, t.bottom),
  113. h = e - n,
  114. l = r - o
  115. return h >= 0 && l >= 0 ? new s(n, o, h, l) : null
  116. },
  117. envelope: function (t) {
  118. if (!i(t, s)) return this
  119. var n = V(this.left, t.left),
  120. e = k(this.right, t.right),
  121. o = V(this.top, t.top),
  122. r = k(this.bottom, t.bottom),
  123. h = e - n,
  124. l = r - o
  125. return new s(n, o, h, l)
  126. }
  127. }),
  128. T(s, {
  129. ofContent: function (t, i) {
  130. return t && t !== document && t !== window
  131. ? i
  132. ? new s(0, 0, t.scrollWidth, t.scrollHeight)
  133. : new s(t.offsetLeft - t.scrollLeft, t.offsetTop - t.scrollTop, t.scrollWidth, t.scrollHeight)
  134. : new s(0, 0, b.width(), b.height())
  135. },
  136. ofViewport: function (t, i) {
  137. return t && t !== document && t !== window
  138. ? i
  139. ? new s(t.scrollLeft, t.scrollTop, t.clientWidth, t.clientHeight)
  140. : new s(t.offsetLeft, t.offsetTop, t.clientWidth, t.clientHeight)
  141. : new s(m.scrollLeft(), m.scrollTop(), m.width(), m.height())
  142. },
  143. ofElement: function (t) {
  144. var i = g(t)
  145. if (!i.is(':visible')) return null
  146. var n = i.offset()
  147. return new s(n.left, n.top, i.outerWidth(), i.outerHeight())
  148. }
  149. }),
  150. T(h.prototype, {
  151. equals: function (t) {
  152. return this.fracsEqual(t) && this.rectsEqual(t)
  153. },
  154. fracsEqual: function (t) {
  155. return r(this, t, ['visible', 'viewport', 'possible'])
  156. },
  157. rectsEqual: function (t) {
  158. return r(this.rects, t.rects, ['document', 'element', 'viewport'])
  159. }
  160. }),
  161. T(h, {
  162. of: function (t, i) {
  163. var e, o, r
  164. return (
  165. (t = (n(t) && s.ofElement(t)) || t),
  166. (i = (n(i) && s.ofViewport(i)) || i || s.ofViewport()),
  167. t instanceof s && (e = t.intersection(i))
  168. ? ((o = e.area()),
  169. (r = V(t.width, i.width) * V(t.height, i.height)),
  170. new h(o / t.area(), o / i.area(), o / r, {
  171. document: e,
  172. element: e.relativeTo(t),
  173. viewport: e.relativeTo(i)
  174. }))
  175. : new h()
  176. )
  177. }
  178. })
  179. var q = ['width', 'height', 'left', 'right', 'top', 'bottom'],
  180. S = ['possible', 'visible', 'viewport']
  181. T(l.prototype, {
  182. sorted: function (t, i) {
  183. var n = this.viewport
  184. return g
  185. .map(this.els, function (i) {
  186. return {
  187. el: i,
  188. val: c(i, n, t)
  189. }
  190. })
  191. .sort(i ? a : u)
  192. },
  193. best: function (t, i) {
  194. return this.els.length ? this.sorted(t, i)[0] : null
  195. }
  196. }),
  197. T(f.prototype, {
  198. equals: function (t) {
  199. return r(this, t, ['width', 'height', 'left', 'top', 'right', 'bottom', 'content', 'viewport'])
  200. }
  201. }),
  202. T(p.prototype, {
  203. equals: function (t) {
  204. return r(this, t, ['el'])
  205. },
  206. scrollState: function () {
  207. return new f(this.el)
  208. },
  209. scrollTo: function (t, i, n) {
  210. var e = g(this.el === window ? 'html,body' : this.el)
  211. ;(t = t || 0),
  212. (i = i || 0),
  213. (n = isNaN(n) ? 1e3 : n),
  214. e.stop(!0).animate(
  215. {
  216. scrollLeft: t,
  217. scrollTop: i
  218. },
  219. n
  220. )
  221. },
  222. scroll: function (t, i, n) {
  223. var e = this.el === window ? m : g(this.el)
  224. ;(t = t || 0), (i = i || 0), this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  225. },
  226. scrollToRect: function (t, i, n, e) {
  227. ;(i = i || 0), (n = n || 0), this.scrollTo(t.left - i, t.top - n, e)
  228. },
  229. scrollToElement: function (t, i, n, e) {
  230. var o = s.ofElement(t).relativeTo(s.ofContent(this.el))
  231. this.scrollToRect(o, i, n, e)
  232. }
  233. })
  234. var C = {
  235. init: function () {
  236. ;(this.callbacks = g.Callbacks('memory unique')), (this.currVal = null), (this.prevVal = null), (this.checkProxy = g.proxy(this.check, this)), this.autoCheck()
  237. },
  238. bind: function (t) {
  239. this.callbacks.add(t)
  240. },
  241. unbind: function (t) {
  242. t ? this.callbacks.remove(t) : this.callbacks.empty()
  243. },
  244. trigger: function () {
  245. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  246. },
  247. check: function (t) {
  248. var i = this.updatedValue(t)
  249. return void 0 !== i && ((this.prevVal = this.currVal), (this.currVal = i), this.trigger(), !0)
  250. },
  251. $autoTarget: m,
  252. autoEvents: 'load resize scroll',
  253. autoCheck: function (t) {
  254. this.$autoTarget[t === !1 ? 'off' : 'on'](this.autoEvents, this.checkProxy)
  255. }
  256. }
  257. T(d.prototype, C, {
  258. updatedValue: function () {
  259. var t = h.of(this.context, this.viewport)
  260. return this.currVal && this.currVal.equals(t) ? void 0 : t
  261. }
  262. }),
  263. T(v.prototype, C, {
  264. updatedValue: function () {
  265. var t = this.context.best(this.property, this.descending)
  266. return t && ((t = t.val > 0 ? t.el : null), this.currVal !== t) ? t : void 0
  267. }
  268. }),
  269. T(w.prototype, C, {
  270. updatedValue: function () {
  271. var t = new f(this.context)
  272. return this.currVal && this.currVal.equals(t) ? void 0 : t
  273. }
  274. })
  275. var L = function (t, i) {
  276. var n = [].slice,
  277. e = jQuery,
  278. o = e.extend,
  279. r = e.isFunction,
  280. s = o({}, i),
  281. h = function (i, n, o, s) {
  282. return (o = r(o) ? o.apply(i, n) : o), r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  283. },
  284. l = function () {
  285. return h(this, n.call(arguments), s.defaultStatic, l)
  286. },
  287. c = function (t) {
  288. return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
  289. },
  290. u = function (t) {
  291. t && (o(l, t.statics), o(c, t.methods)), (l.modplug = u)
  292. }
  293. ;(u.prev = {
  294. statics: e[t],
  295. methods: e.fn[t]
  296. }),
  297. u(i),
  298. (e[t] = l),
  299. (e.fn[t] = c)
  300. },
  301. M = 'fracs'
  302. L(M, {
  303. statics: {
  304. version: '0.15.0',
  305. Rect: s,
  306. Fractions: h,
  307. Group: l,
  308. ScrollState: f,
  309. Viewport: p,
  310. FracsCallbacks: d,
  311. GroupCallbacks: v,
  312. ScrollStateCallbacks: w,
  313. fracs: function (t, i) {
  314. return h.of(t, i)
  315. }
  316. },
  317. methods: {
  318. content: function (t) {
  319. return this.length ? s.ofContent(this[0], t) : null
  320. },
  321. envelope: function () {
  322. return o(this, function (t) {
  323. var i = s.ofElement(this)
  324. return t ? t.envelope(i) : i
  325. })
  326. },
  327. fracs: function (i, n, o) {
  328. t(i, 'string') || ((o = n), (n = i), (i = null)), y(n) || ((o = n), (n = null)), (o = e(o))
  329. var r = M + '.fracs.' + x(o)
  330. return 'unbind' === i
  331. ? this.each(function () {
  332. var t = g(this).data(r)
  333. t && t.unbind(n)
  334. })
  335. : 'check' === i
  336. ? this.each(function () {
  337. var t = g(this).data(r)
  338. t && t.check()
  339. })
  340. : y(n)
  341. ? this.each(function () {
  342. var t = g(this),
  343. i = t.data(r)
  344. i || ((i = new d(this, o)), t.data(r, i)), i.bind(n)
  345. })
  346. : this.length
  347. ? h.of(this[0], o)
  348. : null
  349. },
  350. intersection: function () {
  351. return o(this, function (t) {
  352. var i = s.ofElement(this)
  353. return t ? t.intersection(i) : i
  354. })
  355. },
  356. max: function (t, i, n) {
  357. return y(i) || ((n = i), (i = null)), (n = e(n)), i ? (new v(this, n, t, !0).bind(i), this) : this.pushStack(new l(this, n).best(t, !0).el)
  358. },
  359. min: function (t, i, n) {
  360. return y(i) || ((n = i), (i = null)), (n = e(n)), i ? (new v(this, n, t).bind(i), this) : this.pushStack(new l(this, n).best(t).el)
  361. },
  362. rect: function () {
  363. return this.length ? s.ofElement(this[0]) : null
  364. },
  365. scrollState: function (i, n) {
  366. var e = M + '.scrollState'
  367. return (
  368. t(i, 'string') || ((n = i), (i = null)),
  369. 'unbind' === i
  370. ? this.each(function () {
  371. var t = g(this).data(e)
  372. t && t.unbind(n)
  373. })
  374. : 'check' === i
  375. ? this.each(function () {
  376. var t = g(this).data(e)
  377. t && t.check()
  378. })
  379. : y(n)
  380. ? this.each(function () {
  381. var t = g(this),
  382. i = t.data(e)
  383. i || ((i = new w(this)), t.data(e, i)), i.bind(n)
  384. })
  385. : this.length
  386. ? new f(this[0])
  387. : null
  388. )
  389. },
  390. scroll: function (t, i, n) {
  391. return this.each(function () {
  392. new p(this).scroll(t, i, n)
  393. })
  394. },
  395. scrollTo: function (t, i, n, o) {
  396. return (
  397. g.isNumeric(t) && ((o = n), (n = i), (i = t), (t = null)),
  398. (t = e(t)),
  399. this.each(function () {
  400. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  401. })
  402. )
  403. },
  404. scrollToThis: function (t, i, n, o) {
  405. return (o = new p(e(o))), o.scrollToElement(this[0], t, i, n), this
  406. },
  407. softLink: function (t, i, n, o) {
  408. return (
  409. (o = new p(e(o))),
  410. this.filter('a[href^=#]').each(function () {
  411. var e = g(this)
  412. e.on('click', function () {
  413. o.scrollToElement(g(e.attr('href'))[0], t, i, n)
  414. })
  415. })
  416. )
  417. },
  418. sort: function (i, n, o) {
  419. return (
  420. t(n, 'boolean') || ((o = n), (n = null)),
  421. (o = e(o)),
  422. this.pushStack(
  423. g.map(new l(this, o).sorted(i, !n), function (t) {
  424. return t.el
  425. })
  426. )
  427. )
  428. },
  429. viewport: function (t) {
  430. return this.length ? s.ofViewport(this[0], t) : null
  431. }
  432. },
  433. defaultStatic: 'fracs',
  434. defaultMethod: 'fracs'
  435. })
  436. })()
  437. if ('undefined' == typeof jQuery) throw new Error("Bootstrap's JavaScript requires jQuery")
  438. ;+(function (t) {
  439. 'use strict'
  440. function e(e) {
  441. return this.each(function () {
  442. var o = t(this),
  443. s = o.data('bs.tooltip'),
  444. n = 'object' == typeof e && e
  445. ;(s || 'destroy' != e) && (s || o.data('bs.tooltip', (s = new i(this, n))), 'string' == typeof e && s[e]())
  446. })
  447. }
  448. var i = function (t, e) {
  449. ;(this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null), this.init('tooltip', t, e)
  450. }
  451. ;(i.VERSION = '3.2.0'),
  452. (i.DEFAULTS = {
  453. animation: !0,
  454. placement: 'top',
  455. selector: !1,
  456. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  457. trigger: 'hover focus',
  458. title: '',
  459. delay: 0,
  460. html: !1,
  461. container: !1,
  462. viewport: {
  463. selector: 'body',
  464. padding: 0
  465. }
  466. }),
  467. (i.prototype.init = function (e, i, o) {
  468. ;(this.enabled = !0),
  469. (this.type = e),
  470. (this.$element = t(i)),
  471. (this.options = this.getOptions(o)),
  472. (this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport))
  473. for (var s = this.options.trigger.split(' '), n = s.length; n--; ) {
  474. var r = s[n]
  475. if ('click' == r) this.$element.on('click.' + this.type, this.options.selector, t.proxy(this.toggle, this))
  476. else if ('manual' != r) {
  477. var a = 'hover' == r ? 'mouseenter' : 'focusin',
  478. l = 'hover' == r ? 'mouseleave' : 'focusout'
  479. this.$element.on(a + '.' + this.type, this.options.selector, t.proxy(this.enter, this)), this.$element.on(l + '.' + this.type, this.options.selector, t.proxy(this.leave, this))
  480. }
  481. }
  482. this.options.selector
  483. ? (this._options = t.extend({}, this.options, {
  484. trigger: 'manual',
  485. selector: ''
  486. }))
  487. : this.fixTitle()
  488. }),
  489. (i.prototype.getDefaults = function () {
  490. return i.DEFAULTS
  491. }),
  492. (i.prototype.getOptions = function (e) {
  493. return (
  494. (e = t.extend({}, this.getDefaults(), this.$element.data(), e)),
  495. e.delay &&
  496. 'number' == typeof e.delay &&
  497. (e.delay = {
  498. show: e.delay,
  499. hide: e.delay
  500. }),
  501. e
  502. )
  503. }),
  504. (i.prototype.getDelegateOptions = function () {
  505. var e = {},
  506. i = this.getDefaults()
  507. return (
  508. this._options &&
  509. t.each(this._options, function (t, o) {
  510. i[t] != o && (e[t] = o)
  511. }),
  512. e
  513. )
  514. }),
  515. (i.prototype.enter = function (e) {
  516. var i = e instanceof this.constructor ? e : t(e.currentTarget).data('bs.' + this.type)
  517. return (
  518. i || ((i = new this.constructor(e.currentTarget, this.getDelegateOptions())), t(e.currentTarget).data('bs.' + this.type, i)),
  519. clearTimeout(i.timeout),
  520. (i.hoverState = 'in'),
  521. i.options.delay && i.options.delay.show
  522. ? void (i.timeout = setTimeout(function () {
  523. // "in" == i.hoverState && i.show()
  524. }, i.options.delay.show))
  525. : i.show()
  526. )
  527. }),
  528. (i.prototype.leave = function (e) {
  529. var i = e instanceof this.constructor ? e : t(e.currentTarget).data('bs.' + this.type)
  530. return (
  531. i || ((i = new this.constructor(e.currentTarget, this.getDelegateOptions())), t(e.currentTarget).data('bs.' + this.type, i)),
  532. clearTimeout(i.timeout),
  533. (i.hoverState = 'out'),
  534. i.options.delay && i.options.delay.hide
  535. ? void (i.timeout = setTimeout(function () {
  536. 'out' == i.hoverState && i.hide()
  537. }, i.options.delay.hide))
  538. : i.hide()
  539. )
  540. }),
  541. (i.prototype.show = function () {
  542. var e = t.Event('show.bs.' + this.type)
  543. if (this.hasContent() && this.enabled) {
  544. this.$element.trigger(e)
  545. var i = t.contains(document.documentElement, this.$element[0])
  546. if (e.isDefaultPrevented() || !i) return
  547. var o = this,
  548. s = this.tip(),
  549. n = this.getUID(this.type)
  550. this.setContent(), s.attr('id', n), this.$element.attr('aria-describedby', n), this.options.animation && s.addClass('fade')
  551. var r = 'function' == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement,
  552. a = /\s?auto?\s?/i,
  553. l = a.test(r)
  554. l && (r = r.replace(a, '') || 'top'),
  555. s
  556. .detach()
  557. .css({
  558. top: 0,
  559. left: 0,
  560. display: 'block'
  561. })
  562. .addClass(r)
  563. .data('bs.' + this.type, this),
  564. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element)
  565. var p = this.getPosition(),
  566. h = s[0].offsetWidth,
  567. f = s[0].offsetHeight
  568. if (l) {
  569. var u = r,
  570. c = this.$element.parent(),
  571. d = this.getPosition(c)
  572. ;(r =
  573. 'bottom' == r && p.top + p.height + f - d.scroll > d.height
  574. ? 'top'
  575. : 'top' == r && p.top - d.scroll - f < 0
  576. ? 'bottom'
  577. : 'right' == r && p.right + h > d.width
  578. ? 'left'
  579. : 'left' == r && p.left - h < d.left
  580. ? 'right'
  581. : r),
  582. s.removeClass(u).addClass(r)
  583. }
  584. var g = this.getCalculatedOffset(r, p, h, f)
  585. this.applyPlacement(g, r)
  586. var y = function () {
  587. o.$element.trigger('shown.bs.' + o.type), (o.hoverState = null)
  588. }
  589. t.support.transition && this.$tip.hasClass('fade') ? s.one('bsTransitionEnd', y).emulateTransitionEnd(150) : y()
  590. }
  591. }),
  592. (i.prototype.applyPlacement = function (e, i) {
  593. var o = this.tip(),
  594. s = o[0].offsetWidth,
  595. n = o[0].offsetHeight,
  596. r = parseInt(o.css('margin-top'), 10),
  597. a = parseInt(o.css('margin-left'), 10)
  598. isNaN(r) && (r = 0),
  599. isNaN(a) && (a = 0),
  600. (e.top = e.top + r),
  601. (e.left = e.left + a),
  602. t.offset.setOffset(
  603. o[0],
  604. t.extend(
  605. {
  606. using: function (t) {
  607. o.css({
  608. top: Math.round(t.top),
  609. left: Math.round(t.left)
  610. })
  611. }
  612. },
  613. e
  614. ),
  615. 0
  616. ),
  617. o.addClass('in')
  618. var l = o[0].offsetWidth,
  619. p = o[0].offsetHeight
  620. 'top' == i && p != n && (e.top = e.top + n - p)
  621. var h = this.getViewportAdjustedDelta(i, e, l, p)
  622. h.left ? (e.left += h.left) : (e.top += h.top)
  623. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p,
  624. u = h.left ? 'left' : 'top',
  625. c = h.left ? 'offsetWidth' : 'offsetHeight'
  626. o.offset(e), this.replaceArrow(f, o[0][c], u)
  627. }),
  628. (i.prototype.replaceArrow = function (t, e, i) {
  629. this.arrow().css(i, t ? 50 * (1 - t / e) + '%' : '')
  630. }),
  631. (i.prototype.setContent = function () {
  632. var t = this.tip(),
  633. e = this.getTitle()
  634. t.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](e), t.removeClass('fade in top bottom left right')
  635. }),
  636. (i.prototype.hide = function () {
  637. function e() {
  638. 'in' != i.hoverState && o.detach(), i.$element.trigger('hidden.bs.' + i.type)
  639. }
  640. var i = this,
  641. o = this.tip(),
  642. s = t.Event('hide.bs.' + this.type)
  643. if ((this.$element.removeAttr('aria-describedby'), this.$element.trigger(s), !s.isDefaultPrevented()))
  644. return o.removeClass('in'), t.support.transition && this.$tip.hasClass('fade') ? o.one('bsTransitionEnd', e).emulateTransitionEnd(150) : e(), (this.hoverState = null), this
  645. }),
  646. (i.prototype.fixTitle = function () {
  647. var t = this.$element
  648. ;(t.attr('title') || 'string' != typeof t.attr('data-original-title')) && t.attr('data-original-title', t.attr('title') || '').attr('title', '')
  649. }),
  650. (i.prototype.hasContent = function () {
  651. return this.getTitle()
  652. }),
  653. (i.prototype.getPosition = function (e) {
  654. e = e || this.$element
  655. var i = e[0],
  656. o = 'BODY' == i.tagName
  657. return t.extend(
  658. {},
  659. 'function' == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null,
  660. {
  661. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  662. width: o ? t(window).width() : e.outerWidth(),
  663. height: o ? t(window).height() : e.outerHeight()
  664. },
  665. o
  666. ? {
  667. top: 0,
  668. left: 0
  669. }
  670. : e.offset()
  671. )
  672. }),
  673. (i.prototype.getCalculatedOffset = function (t, e, i, o) {
  674. return 'bottom' == t
  675. ? {
  676. top: e.top + e.height,
  677. left: e.left + e.width / 2 - i / 2
  678. }
  679. : 'top' == t
  680. ? {
  681. top: e.top - o,
  682. left: e.left + e.width / 2 - i / 2
  683. }
  684. : 'left' == t
  685. ? {
  686. top: e.top + e.height / 2 - o / 2,
  687. left: e.left - i
  688. }
  689. : {
  690. top: e.top + e.height / 2 - o / 2,
  691. left: e.left + e.width
  692. }
  693. }),
  694. (i.prototype.getViewportAdjustedDelta = function (t, e, i, o) {
  695. var s = {
  696. top: 0,
  697. left: 0
  698. }
  699. if (!this.$viewport) return s
  700. var n = (this.options.viewport && this.options.viewport.padding) || 0,
  701. r = this.getPosition(this.$viewport)
  702. if (/right|left/.test(t)) {
  703. var a = e.top - n - r.scroll,
  704. l = e.top + n - r.scroll + o
  705. a < r.top ? (s.top = r.top - a) : l > r.top + r.height && (s.top = r.top + r.height - l)
  706. } else {
  707. var p = e.left - n,
  708. h = e.left + n + i
  709. p < r.left ? (s.left = r.left - p) : h > r.width && (s.left = r.left + r.width - h)
  710. }
  711. return s
  712. }),
  713. (i.prototype.getTitle = function () {
  714. var t,
  715. e = this.$element,
  716. i = this.options
  717. return (t = e.attr('data-original-title') || ('function' == typeof i.title ? i.title.call(e[0]) : i.title))
  718. }),
  719. (i.prototype.getUID = function (t) {
  720. do t += ~~(1e6 * Math.random())
  721. while (document.getElementById(t))
  722. return t
  723. }),
  724. (i.prototype.tip = function () {
  725. return (this.$tip = this.$tip || t(this.options.template))
  726. }),
  727. (i.prototype.arrow = function () {
  728. return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
  729. }),
  730. (i.prototype.validate = function () {
  731. this.$element[0].parentNode || (this.hide(), (this.$element = null), (this.options = null))
  732. }),
  733. (i.prototype.enable = function () {
  734. this.enabled = !0
  735. }),
  736. (i.prototype.disable = function () {
  737. this.enabled = !1
  738. }),
  739. (i.prototype.toggleEnabled = function () {
  740. this.enabled = !this.enabled
  741. }),
  742. (i.prototype.toggle = function (e) {
  743. var i = this
  744. e && ((i = t(e.currentTarget).data('bs.' + this.type)), i || ((i = new this.constructor(e.currentTarget, this.getDelegateOptions())), t(e.currentTarget).data('bs.' + this.type, i))),
  745. i.tip().hasClass('in') ? i.leave(i) : i.enter(i)
  746. }),
  747. (i.prototype.destroy = function () {
  748. clearTimeout(this.timeout),
  749. this.hide()
  750. .$element.off('.' + this.type)
  751. .removeData('bs.' + this.type)
  752. })
  753. var o = t.fn.tooltip
  754. ;(t.fn.tooltip = e),
  755. (t.fn.tooltip.Constructor = i),
  756. (t.fn.tooltip.noConflict = function () {
  757. return (t.fn.tooltip = o), this
  758. })
  759. })(jQuery)
  760. !(function (e, t, n) {
  761. 'undefined' != typeof module && module.exports ? (module.exports = n()) : 'function' == typeof define && define.amd ? define(n) : (t[e] = n())
  762. })('Keen', this, function () {
  763. 'use strict'
  764. function Keen() {
  765. return _init.apply(this, arguments)
  766. }
  767. function _init(e) {
  768. if (_isUndefined(e)) throw new Error('Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/')
  769. if (_isUndefined(e.projectId) || 'String' !== _type(e.projectId) || e.projectId.length < 1) throw new Error('Please provide a projectId')
  770. this.configure(e)
  771. }
  772. function _extend(e) {
  773. for (var t = 1; t < arguments.length; t++) for (var n in arguments[t]) e[n] = arguments[t][n]
  774. return e
  775. }
  776. function _isUndefined(e) {
  777. return void 0 === e
  778. }
  779. function _type(e) {
  780. var t = e && e.constructor ? e.constructor.toString() : void 0
  781. return t ? t.match(/function (.*)\(/)[1] : 'Null'
  782. }
  783. function _each(e, t, n) {
  784. var r
  785. if (!e) return 0
  786. if (((n = n ? n : e), 'array' === _type(e))) {
  787. for (r = 0; r < e.length; r++) if (t.call(n, e[r], r, e) === !1) return 0
  788. } else for (r in e) if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1) return 0
  789. return 1
  790. }
  791. function _parse_params(e) {
  792. for (
  793. var t,
  794. n = {},
  795. r = /\+/g,
  796. i = /([^&=]+)=?([^&]*)/g,
  797. o = function (e) {
  798. return decodeURIComponent(e.replace(r, ' '))
  799. },
  800. a = e.split('?')[1];
  801. (t = i.exec(a));
  802. )
  803. n[o(t[1])] = o(t[2])
  804. return n
  805. }
  806. function _set_protocol(e) {
  807. switch (e) {
  808. case 'http':
  809. return 'http'
  810. case 'auto':
  811. return location.protocol.replace(/:/g, '')
  812. case 'https':
  813. case void 0:
  814. default:
  815. return 'https'
  816. }
  817. }
  818. function _set_request_type(e) {
  819. var t = e || 'jsonp',
  820. n = !1
  821. return ('Object' === _type(XMLHttpRequest) || 'Function' === _type(XMLHttpRequest)) && 'withCredentials' in new XMLHttpRequest() && (n = !0), null == t || 'xhr' == t ? (n ? 'xhr' : 'jsonp') : t
  822. }
  823. function _build_url(e) {
  824. return this.client.endpoint + '/projects/' + this.client.projectId + e
  825. }
  826. function _uploadEvent(e, t, n, r, i) {
  827. var o = _build_url.apply(this, ['/events/' + e]),
  828. a = {}
  829. ;(n = n !== !1), this.client.globalProperties && (a = this.client.globalProperties(e))
  830. for (var c in t) t.hasOwnProperty(c) && (a[c] = t[c])
  831. switch (this.client.requestType) {
  832. case 'xhr':
  833. _request.xhr.apply(this, ['POST', o, null, a, this.client.writeKey, n, r, i])
  834. break
  835. case 'jsonp':
  836. var s = JSON.stringify(a),
  837. l = Keen.Base64.encode(s)
  838. ;(o = o + '?api_key=' + this.client.writeKey), (o = o + '&data=' + l), (o = o + '&modified=' + new Date().getTime()), _request.jsonp.apply(this, [o, this.client.writeKey, r, i])
  839. break
  840. case 'beacon':
  841. var s = JSON.stringify(a),
  842. l = Keen.Base64.encode(s)
  843. ;(o = o + '?api_key=' + encodeURIComponent(this.client.writeKey)),
  844. (o = o + '&data=' + encodeURIComponent(l)),
  845. (o = o + '&modified=' + encodeURIComponent(new Date().getTime())),
  846. (o += '&c=clv1'),
  847. _request.beacon.apply(this, [o, null, r, i])
  848. }
  849. }
  850. Keen.prototype.configure = function (e) {
  851. return (
  852. (e.host = _isUndefined(e.host) ? 'api.keen.io/3.0' : e.host.replace(/.*?:\/\//g, '')),
  853. (e.protocol = _set_protocol(e.protocol)),
  854. (e.requestType = _set_request_type(e.requestType)),
  855. (this.client = {
  856. projectId: e.projectId,
  857. writeKey: e.writeKey,
  858. readKey: e.readKey,
  859. globalProperties: null,
  860. endpoint: e.protocol + '://' + e.host,
  861. requestType: e.requestType
  862. }),
  863. Keen.trigger('client', this, e),
  864. this.trigger('ready'),
  865. this
  866. )
  867. }
  868. var _request = {
  869. xhr: function (e, t, n, r, i, o, a, c) {
  870. if (!i) return Keen.log('Please provide a writeKey for https://keen.io/project/' + this.client.projectId)
  871. var s = new XMLHttpRequest()
  872. if (
  873. ((s.onreadystatechange = function () {
  874. if (4 == s.readyState)
  875. if (s.status >= 200 && s.status < 300) {
  876. var e
  877. try {
  878. e = JSON.parse(s.responseText)
  879. } catch (e) {
  880. Keen.log('Could not JSON parse HTTP response: ' + s.responseText), c && c(s, e)
  881. }
  882. a && e && a(e)
  883. } else Keen.log('HTTP request failed.'), c && c(s, null)
  884. }),
  885. s.open(e, t, o),
  886. i && s.setRequestHeader('Authorization', i),
  887. r && s.setRequestHeader('Content-Type', 'application/json'),
  888. n)
  889. )
  890. for (var l in n) n.hasOwnProperty(l) && s.setRequestHeader(l, n[l])
  891. var u = r ? JSON.stringify(r) : null
  892. s.send(u)
  893. },
  894. jsonp: function (e, t, n, r) {
  895. if (!t) return Keen.log('Please provide a writeKey for https://keen.io/project/' + this.client.projectId)
  896. if (t && e.indexOf('api_key') < 0) {
  897. var i = e.indexOf('?') > 0 ? '&' : '?'
  898. e = e + i + 'api_key=' + t
  899. }
  900. for (var o = 'keenJSONPCallback' + new Date().getTime(); o in window; ) o += 'a'
  901. var a = !1
  902. ;(window[o] = function (e) {
  903. ;(a = !0), n && e && n(e), (window[o] = void 0)
  904. }),
  905. (e = e + '&jsonp=' + o)
  906. var c = document.createElement('script')
  907. ;(c.id = 'keen-jsonp'),
  908. (c.src = e),
  909. document.getElementsByTagName('head')[0].appendChild(c),
  910. (c.onreadystatechange = function () {
  911. a === !1 && 'loaded' === this.readyState && ((a = !0), r && r())
  912. }),
  913. (c.onerror = function () {
  914. a === !1 && ((a = !0), r && r())
  915. })
  916. },
  917. beacon: function (e, t, n, r) {
  918. if (t && e.indexOf('api_key') < 0) {
  919. var i = e.indexOf('?') > 0 ? '&' : '?'
  920. e = e + i + 'api_key=' + t
  921. }
  922. var o = !1,
  923. a = document.createElement('img')
  924. ;(a.onload = function () {
  925. if (((o = !0), 'naturalHeight' in this)) {
  926. if (this.naturalHeight + this.naturalWidth === 0) return void this.onerror()
  927. } else if (this.width + this.height === 0) return void this.onerror()
  928. n &&
  929. n({
  930. created: !0
  931. })
  932. }),
  933. (a.onerror = function () {
  934. ;(o = !0), r && r()
  935. }),
  936. (a.src = e)
  937. }
  938. },
  939. Events = (Keen.Events = {
  940. on: function (e, t) {
  941. this.listeners || (this.listeners = {})
  942. var n = this.listeners[e] || (this.listeners[e] = [])
  943. return (
  944. n.push({
  945. callback: t
  946. }),
  947. this
  948. )
  949. },
  950. off: function (e, t) {
  951. if (!e && !t) return (this.listeners = void 0), delete this.listeners, this
  952. for (var n = this.listeners[e] || [], r = n.length; r--; )
  953. t && t == n[r].callback && this.listeners[e].splice(r, 1), (t && 0 != n.length) || ((this.listeners[e] = void 0), delete this.listeners[e])
  954. return this
  955. },
  956. trigger: function (e) {
  957. if (!this.listeners) return this
  958. for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++) n[r].callback.apply(this, t)
  959. return this
  960. }
  961. })
  962. _extend(Keen.prototype, Events),
  963. _extend(Keen, Events),
  964. (Keen.loaded = !0),
  965. (Keen.utils = {
  966. each: _each,
  967. extend: _extend,
  968. parseParams: _parse_params
  969. }),
  970. (Keen.ready = function (e) {
  971. Keen.loaded ? e() : Keen.on('ready', e)
  972. }),
  973. (Keen.log = function (e) {
  974. 'object' == typeof console && console.log('[Keen IO]', e)
  975. })
  976. var Plugins = (Keen.Plugins = {})
  977. ;(Keen.prototype.addEvent = function () {
  978. _uploadEvent.apply(this, arguments)
  979. }),
  980. (Keen.prototype.addEventSync = function (e, t, n, r) {
  981. _uploadEvent.apply(this, [e, t, !1, n, r])
  982. }),
  983. (Keen.prototype.trackExternalLink = function (e, t, n, r, i) {
  984. var o = e,
  985. a = o.metaKey,
  986. c = o.target,
  987. s = !1,
  988. l = function () {}
  989. return (
  990. void 0 === r && (r = 500),
  991. 'A' === c.nodeName
  992. ? (l = function () {
  993. a || s || ((s = !0), (window.location = c.href))
  994. })
  995. : 'FORM' === c.nodeName &&
  996. (l = function () {
  997. s || ((s = !0), c.submit())
  998. }),
  999. i &&
  1000. (l = function () {
  1001. s || ((s = !0), i())
  1002. }),
  1003. _uploadEvent.call(this, t, n, l, l),
  1004. setTimeout(function () {
  1005. l()
  1006. }, r),
  1007. !!a && void 0
  1008. )
  1009. }),
  1010. (Keen.prototype.setGlobalProperties = function (e) {
  1011. if (!this.client) return Keen.log('Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/')
  1012. if (!e || 'function' != typeof e) throw new Error('Invalid value for global properties: ' + e)
  1013. this.client.globalProperties = e
  1014. }),
  1015. (Keen.Base64 = {
  1016. map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
  1017. encode: function (e) {
  1018. var t,
  1019. n,
  1020. r,
  1021. i,
  1022. o,
  1023. a,
  1024. c,
  1025. s = '',
  1026. l = 0,
  1027. u = this.map
  1028. for (e = this.utf8.encode(e); l < e.length; )
  1029. (t = e.charCodeAt(l++)),
  1030. (n = e.charCodeAt(l++)),
  1031. (r = e.charCodeAt(l++)),
  1032. (i = t >> 2),
  1033. (o = ((3 & t) << 4) | (n >> 4)),
  1034. (a = isNaN(n) ? 64 : ((15 & n) << 2) | (r >> 6)),
  1035. (c = isNaN(n) || isNaN(r) ? 64 : 63 & r),
  1036. (s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c))
  1037. return s
  1038. },
  1039. decode: function (e) {
  1040. var t,
  1041. n,
  1042. r,
  1043. i,
  1044. o,
  1045. a,
  1046. c,
  1047. s = '',
  1048. l = 0,
  1049. u = this.map,
  1050. f = String.fromCharCode
  1051. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ''); l < e.length; )
  1052. (t = u.indexOf(e.charAt(l++))),
  1053. (n = u.indexOf(e.charAt(l++))),
  1054. (r = u.indexOf(e.charAt(l++))),
  1055. (i = u.indexOf(e.charAt(l++))),
  1056. (o = (t << 2) | (n >> 4)),
  1057. (a = ((15 & n) << 4) | (r >> 2)),
  1058. (c = ((3 & r) << 6) | i),
  1059. (s = s + (f(o) + (64 != r ? f(a) : '')) + (64 != i ? f(c) : ''))
  1060. return this.utf8.decode(s)
  1061. },
  1062. utf8: {
  1063. encode: function (e) {
  1064. for (var t, n = '', r = 0, i = String.fromCharCode; r < e.length; )
  1065. (t = e.charCodeAt(r++)), (n += 128 > t ? i(t) : t > 127 && 2048 > t ? i((t >> 6) | 192) + i((63 & t) | 128) : i((t >> 12) | 224) + i(((t >> 6) & 63) | 128) + i((63 & t) | 128))
  1066. return n
  1067. },
  1068. decode: function (e) {
  1069. for (var t, n, r = '', i = 0, o = String.fromCharCode; i < e.length; )
  1070. (n = e.charCodeAt(i)),
  1071. (r +=
  1072. 128 > n
  1073. ? [o(n), i++][0]
  1074. : n > 191 && 224 > n
  1075. ? [o(((31 & n) << 6) | (63 & (t = e.charCodeAt(i + 1)))), (i += 2)][0]
  1076. : [o(((15 & n) << 12) | ((63 & (t = e.charCodeAt(i + 1))) << 6) | (63 & (c3 = e.charCodeAt(i + 2)))), (i += 3)][0])
  1077. return r
  1078. }
  1079. }
  1080. }),
  1081. 'object' != typeof JSON && (JSON = {}),
  1082. (function () {
  1083. function f(e) {
  1084. return 10 > e ? '0' + e : e
  1085. }
  1086. function quote(e) {
  1087. return (
  1088. (escapable.lastIndex = 0),
  1089. escapable.test(e)
  1090. ? '"' +
  1091. e.replace(escapable, function (e) {
  1092. var t = meta[e]
  1093. return 'string' == typeof t ? t : '\\u' + ('0000' + e.charCodeAt(0).toString(16)).slice(-4)
  1094. }) +
  1095. '"'
  1096. : '"' + e + '"'
  1097. )
  1098. }
  1099. function str(e, t) {
  1100. var n,
  1101. r,
  1102. i,
  1103. o,
  1104. a,
  1105. c = gap,
  1106. s = t[e]
  1107. switch ((s && 'object' == typeof s && 'function' == typeof s.toJSON && (s = s.toJSON(e)), 'function' == typeof rep && (s = rep.call(t, e, s)), typeof s)) {
  1108. case 'string':
  1109. return quote(s)
  1110. case 'number':
  1111. return isFinite(s) ? String(s) : 'null'
  1112. case 'boolean':
  1113. case 'null':
  1114. return String(s)
  1115. case 'object':
  1116. if (!s) return 'null'
  1117. if (((gap += indent), (a = []), '[object Array]' === Object.prototype.toString.apply(s))) {
  1118. for (o = s.length, n = 0; o > n; n += 1) a[n] = str(n, s) || 'null'
  1119. return (i = 0 === a.length ? '[]' : gap ? '[\n' + gap + a.join(',\n' + gap) + '\n' + c + ']' : '[' + a.join(',') + ']'), (gap = c), i
  1120. }
  1121. if (rep && 'object' == typeof rep) for (o = rep.length, n = 0; o > n; n += 1) 'string' == typeof rep[n] && ((r = rep[n]), (i = str(r, s)), i && a.push(quote(r) + (gap ? ': ' : ':') + i))
  1122. else for (r in s) Object.prototype.hasOwnProperty.call(s, r) && ((i = str(r, s)), i && a.push(quote(r) + (gap ? ': ' : ':') + i))
  1123. return (i = 0 === a.length ? '{}' : gap ? '{\n' + gap + a.join(',\n' + gap) + '\n' + c + '}' : '{' + a.join(',') + '}'), (gap = c), i
  1124. }
  1125. }
  1126. 'function' != typeof Date.prototype.toJSON &&
  1127. ((Date.prototype.toJSON = function () {
  1128. return isFinite(this.valueOf())
  1129. ? this.getUTCFullYear() + '-' + f(this.getUTCMonth() + 1) + '-' + f(this.getUTCDate()) + 'T' + f(this.getUTCHours()) + ':' + f(this.getUTCMinutes()) + ':' + f(this.getUTCSeconds()) + 'Z'
  1130. : null
  1131. }),
  1132. (String.prototype.toJSON =
  1133. Number.prototype.toJSON =
  1134. Boolean.prototype.toJSON =
  1135. function () {
  1136. return this.valueOf()
  1137. }))
  1138. var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  1139. escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  1140. gap,
  1141. indent,
  1142. meta = {
  1143. '\b': '\\b',
  1144. '\t': '\\t',
  1145. '\n': '\\n',
  1146. '\f': '\\f',
  1147. '\r': '\\r',
  1148. '"': '\\"',
  1149. '\\': '\\\\'
  1150. },
  1151. rep
  1152. 'function' != typeof JSON.stringify &&
  1153. (JSON.stringify = function (e, t, n) {
  1154. var r
  1155. if (((gap = ''), (indent = ''), 'number' == typeof n)) for (r = 0; n > r; r += 1) indent += ' '
  1156. else 'string' == typeof n && (indent = n)
  1157. if (((rep = t), t && 'function' != typeof t && ('object' != typeof t || 'number' != typeof t.length))) throw new Error('JSON.stringify')
  1158. return str('', {
  1159. '': e
  1160. })
  1161. }),
  1162. 'function' != typeof JSON.parse &&
  1163. (JSON.parse = function (text, reviver) {
  1164. function walk(e, t) {
  1165. var n,
  1166. r,
  1167. i = e[t]
  1168. if (i && 'object' == typeof i) for (n in i) Object.prototype.hasOwnProperty.call(i, n) && ((r = walk(i, n)), void 0 !== r ? (i[n] = r) : delete i[n])
  1169. return reviver.call(e, t, i)
  1170. }
  1171. var j
  1172. if (
  1173. ((text = String(text)),
  1174. (cx.lastIndex = 0),
  1175. cx.test(text) &&
  1176. (text = text.replace(cx, function (e) {
  1177. return '\\u' + ('0000' + e.charCodeAt(0).toString(16)).slice(-4)
  1178. })),
  1179. /^[\],:{}\s]*$/.test(
  1180. text
  1181. .replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
  1182. .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
  1183. .replace(/(?:^|:|,)(?:\s*\[)+/g, '')
  1184. ))
  1185. )
  1186. return (
  1187. (j = eval('(' + text + ')')),
  1188. 'function' == typeof reviver
  1189. ? walk(
  1190. {
  1191. '': j
  1192. },
  1193. ''
  1194. )
  1195. : j
  1196. )
  1197. throw new SyntaxError('JSON.parse')
  1198. })
  1199. })(),
  1200. !(function (e, t, n) {
  1201. 'undefined' != typeof module && module.exports ? (module.exports = n()) : 'function' == typeof define && define.amd ? define(n) : (t[e] = n())
  1202. })('domready', Keen.utils, function (e) {
  1203. function t(e) {
  1204. for (d = 1; (e = r.shift()); ) e()
  1205. }
  1206. var n,
  1207. r = [],
  1208. i = !1,
  1209. o = document,
  1210. a = o.documentElement,
  1211. c = a.doScroll,
  1212. s = 'DOMContentLoaded',
  1213. l = 'addEventListener',
  1214. u = 'onreadystatechange',
  1215. f = 'readyState',
  1216. p = c ? /^loaded|^c/ : /^loaded|c/,
  1217. d = p.test(o[f])
  1218. return (
  1219. o[l] &&
  1220. o[l](
  1221. s,
  1222. (n = function () {
  1223. o.removeEventListener(s, n, i), t()
  1224. }),
  1225. i
  1226. ),
  1227. c &&
  1228. o.attachEvent(
  1229. u,
  1230. (n = function () {
  1231. ;/^c/.test(o[f]) && (o.detachEvent(u, n), t())
  1232. })
  1233. ),
  1234. (e = c
  1235. ? function (t) {
  1236. self != top
  1237. ? d
  1238. ? t()
  1239. : r.push(t)
  1240. : (function () {
  1241. try {
  1242. a.doScroll('left')
  1243. } catch (n) {
  1244. return setTimeout(function () {
  1245. e(t)
  1246. }, 50)
  1247. }
  1248. t()
  1249. })()
  1250. }
  1251. : function (e) {
  1252. d ? e() : r.push(e)
  1253. })
  1254. )
  1255. })
  1256. var loaded = window.Keen,
  1257. cached = window._Keen || {},
  1258. clients,
  1259. ready
  1260. if (loaded && cached) {
  1261. ;(clients = cached.clients || {}), (ready = cached.ready || [])
  1262. for (var instance in clients)
  1263. if (clients.hasOwnProperty(instance)) {
  1264. var client = clients[instance]
  1265. for (var method in Keen.prototype) Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method])
  1266. if (
  1267. ((loaded.Query = Keen.Query ? Keen.Query : function () {}),
  1268. (loaded.Visualization = Keen.Visualization ? Keen.Visualization : function () {}),
  1269. client._config && (client.configure.call(client, client._config), delete client._config),
  1270. client._setGlobalProperties)
  1271. ) {
  1272. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++) client.setGlobalProperties.apply(client, globals[i])
  1273. delete client._setGlobalProperties
  1274. }
  1275. if (client._addEvent) {
  1276. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++) client.addEvent.apply(client, queue[i])
  1277. delete client._addEvent
  1278. }
  1279. var callback = client._on || []
  1280. if (client._on) {
  1281. for (var i = 0; i < callback.length; i++) client.on.apply(client, callback[i])
  1282. client.trigger('ready'), delete client._on
  1283. }
  1284. }
  1285. for (var i = 0; i < ready.length; i++) {
  1286. var callback = ready[i]
  1287. Keen.on('ready', function () {
  1288. callback()
  1289. })
  1290. }
  1291. }
  1292. return (
  1293. Keen.loaded &&
  1294. setTimeout(function () {
  1295. Keen.utils.domready(function () {
  1296. Keen.trigger('ready')
  1297. })
  1298. }, 0),
  1299. Keen
  1300. )
  1301. })
  1302. !(function () {
  1303. var t = (window.analytics = window.analytics || [])
  1304. if (!t.initialize) {
  1305. if (t.invoked) return void (window.console && console.error && console.error('Segment snippet included twice.'))
  1306. ;(t.invoked = !0),
  1307. (t.methods = ['trackSubmit', 'trackClick', 'trackLink', 'trackForm', 'pageview', 'identify', 'reset', 'group', 'track', 'ready', 'alias', 'debug', 'page', 'once', 'off', 'on']),
  1308. (t.factory = function (e) {
  1309. return function () {
  1310. var n = Array.prototype.slice.call(arguments)
  1311. return n.unshift(e), t.push(n), t
  1312. }
  1313. })
  1314. for (var e = 0; e < t.methods.length; e++) {
  1315. var n = t.methods[e]
  1316. t[n] = t.factory(n)
  1317. }
  1318. ;(t.load = function (t) {
  1319. var e = document.createElement('script')
  1320. ;(e.type = 'text/javascript'), (e.async = !0), (e.src = ('https:' === document.location.protocol ? 'https://' : 'http://') + 'cdn.segment.com/analytics.js/v1/' + t + '/analytics.min.js')
  1321. var n = document.getElementsByTagName('script')[0]
  1322. n.parentNode.insertBefore(e, n)
  1323. }),
  1324. (t.SNIPPET_VERSION = '4.0.0')
  1325. }
  1326. })()
  1327. !(function (i, e) {
  1328. 'use strict'
  1329. var s = '',
  1330. r = '?',
  1331. o = 'function',
  1332. a = 'undefined',
  1333. n = 'object',
  1334. t = 'major',
  1335. d = 'model',
  1336. w = 'name',
  1337. l = 'type',
  1338. p = 'vendor',
  1339. m = 'version',
  1340. c = 'architecture',
  1341. u = 'console',
  1342. g = 'mobile',
  1343. f = 'tablet',
  1344. h = 'smarttv',
  1345. b = {
  1346. has: function (i, e) {
  1347. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1348. },
  1349. lowerize: function (i) {
  1350. return i.toLowerCase()
  1351. }
  1352. },
  1353. y = {
  1354. rgx: function () {
  1355. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1356. var c = m[p],
  1357. u = m[p + 1]
  1358. if (typeof i === a) {
  1359. i = {}
  1360. for (t in u) (d = u[t]), typeof d === n ? (i[d[0]] = e) : (i[d] = e)
  1361. }
  1362. for (s = r = 0; s < c.length; s++)
  1363. if ((w = c[s].exec(this.getUA()))) {
  1364. for (t = 0; t < u.length; t++)
  1365. (l = w[++r]),
  1366. (d = u[t]),
  1367. typeof d === n && d.length > 0
  1368. ? 2 == d.length
  1369. ? typeof d[1] == o
  1370. ? (i[d[0]] = d[1].call(this, l))
  1371. : (i[d[0]] = d[1])
  1372. : 3 == d.length
  1373. ? typeof d[1] !== o || (d[1].exec && d[1].test)
  1374. ? (i[d[0]] = l ? l.replace(d[1], d[2]) : e)
  1375. : (i[d[0]] = l ? d[1].call(this, l, d[2]) : e)
  1376. : 4 == d.length && (i[d[0]] = l ? d[3].call(this, l.replace(d[1], d[2])) : e)
  1377. : (i[d] = l ? l : e)
  1378. break
  1379. }
  1380. if (w) break
  1381. }
  1382. return i
  1383. },
  1384. str: function (i, s) {
  1385. for (var o in s)
  1386. if (typeof s[o] === n && s[o].length > 0) {
  1387. for (var a = 0; a < s[o].length; a++) if (b.has(s[o][a], i)) return o === r ? e : o
  1388. } else if (b.has(s[o], i)) return o === r ? e : o
  1389. return i
  1390. }
  1391. },
  1392. v = {
  1393. browser: {
  1394. oldsafari: {
  1395. major: {
  1396. 1: ['/8', '/1', '/3'],
  1397. 2: '/4',
  1398. '?': '/'
  1399. },
  1400. version: {
  1401. '1.0': '/8',
  1402. 1.2: '/1',
  1403. 1.3: '/3',
  1404. '2.0': '/412',
  1405. '2.0.2': '/416',
  1406. '2.0.3': '/417',
  1407. '2.0.4': '/419',
  1408. '?': '/'
  1409. }
  1410. }
  1411. },
  1412. device: {
  1413. sprint: {
  1414. model: {
  1415. 'Evo Shift 4G': '7373KT'
  1416. },
  1417. vendor: {
  1418. HTC: 'APA',
  1419. Sprint: 'Sprint'
  1420. }
  1421. }
  1422. },
  1423. os: {
  1424. windows: {
  1425. version: {
  1426. ME: '4.90',
  1427. 'NT 3.11': 'NT3.51',
  1428. 'NT 4.0': 'NT4.0',
  1429. 2e3: 'NT 5.0',
  1430. XP: ['NT 5.1', 'NT 5.2'],
  1431. Vista: 'NT 6.0',
  1432. 7: 'NT 6.1',
  1433. 8: 'NT 6.2',
  1434. 8.1: 'NT 6.3',
  1435. RT: 'ARM'
  1436. }
  1437. }
  1438. }
  1439. },
  1440. k = {
  1441. browser: [
  1442. [/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i],
  1443. [w, m, t],
  1444. [/\s(opr)\/((\d+)?[\w\.]+)/i],
  1445. [[w, 'Opera'], m, t],
  1446. [
  1447. /(kindle)\/((\d+)?[\w\.]+)/i,
  1448. /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i,
  1449. /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i,
  1450. /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i,
  1451. /(rekonq)((?:\/)[\w\.]+)*/i,
  1452. /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i
  1453. ],
  1454. [w, m, t],
  1455. [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i],
  1456. [[w, 'IE'], m, t],
  1457. [/(yabrowser)\/((\d+)?[\w\.]+)/i],
  1458. [[w, 'Yandex'], m, t],
  1459. [/(comodo_dragon)\/((\d+)?[\w\.]+)/i],
  1460. [[w, /_/g, ' '], m, t],
  1461. [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i],
  1462. [w, m, t],
  1463. [/(dolfin)\/((\d+)?[\w\.]+)/i],
  1464. [[w, 'Dolphin'], m, t],
  1465. [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i],
  1466. [[w, 'Chrome'], m, t],
  1467. [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i],
  1468. [m, t, [w, 'Mobile Safari']],
  1469. [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i],
  1470. [m, t, w],
  1471. [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i],
  1472. [w, [t, y.str, v.browser.oldsafari.major], [m, y.str, v.browser.oldsafari.version]],
  1473. [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i],
  1474. [w, m, t],
  1475. [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i],
  1476. [[w, 'Netscape'], m, t],
  1477. [
  1478. /(swiftfox)/i,
  1479. /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i,
  1480. /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i,
  1481. /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i,
  1482. /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i,
  1483. /(links)\s\(((\d+)?[\w\.]+)/i,
  1484. /(gobrowser)\/?((\d+)?[\w\.]+)*/i,
  1485. /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i,
  1486. /(mosaic)[\/\s]((\d+)?[\w\.]+)/i
  1487. ],
  1488. [w, m, t],
  1489. [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i],
  1490. [w, m, t],
  1491. [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i],
  1492. [w, m],
  1493. [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i],
  1494. [w, m, t],
  1495. [
  1496. /(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i,
  1497. /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i,
  1498. /(lg player|nexplayer)\s((\d+)[\d\.]+)/i,
  1499. /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i
  1500. ],
  1501. [w, m, t],
  1502. [/(nexplayer)\s((\d+)[\w\.-]+)/i],
  1503. [w, m, t],
  1504. [/(flrp)\/((\d+)[\w\.-]+)/i],
  1505. [[w, 'Flip Player'], m, t],
  1506. [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i],
  1507. [w],
  1508. [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i],
  1509. [w, m, t],
  1510. [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i],
  1511. [w, m, t],
  1512. [/(htc_one_s)\/((\d+)[\d\.]+)/i],
  1513. [[w, /_/g, ' '], m, t],
  1514. [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i],
  1515. [w, m],
  1516. [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i],
  1517. [w, m, t],
  1518. [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i],
  1519. [w],
  1520. [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i],
  1521. [w, m, t],
  1522. [/(nokia\d+)\/((\d+)[\w\.-]+)/i],
  1523. [w, m, t],
  1524. [/\s(songbird)\/((\d+)[\w\.-]+)/i],
  1525. [w, m, t],
  1526. [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i],
  1527. [w, m, t],
  1528. [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i],
  1529. [w],
  1530. [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i],
  1531. [w, m, t],
  1532. [/(smp)((\d+)[\d\.]+)/i],
  1533. [w, m, t],
  1534. [/(vlc) media player - version ((\d+)[\w\.]+)/i, /(vlc)\/((\d+)[\w\.-]+)/i, /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, /(foobar2000)\/((\d+)[\d\.]+)/i, /(itunes)\/((\d+)[\d\.]+)/i],
  1535. [w, m, t],
  1536. [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i],
  1537. [[w, /-/g, ' '], m, t],
  1538. [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i],
  1539. [m, t, [w, 'Windows']],
  1540. [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i],
  1541. [w, m, t],
  1542. [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i],
  1543. [[w, 'rad.io'], m, t]
  1544. ],
  1545. cpu: [
  1546. [/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],
  1547. [[c, 'amd64']],
  1548. [/(ia32(?=;))/i],
  1549. [[c, b.lowerize]],
  1550. [/((?:i[346]|x)86)[;\)]/i],
  1551. [[c, 'ia32']],
  1552. [/windows\s(ce|mobile);\sppc;/i],
  1553. [[c, 'arm']],
  1554. [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],
  1555. [[c, /ower/, '', b.lowerize]],
  1556. [/(sun4\w)[;\)]/i],
  1557. [[c, 'sparc']],
  1558. [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],
  1559. [c, b.lowerize]
  1560. ],
  1561. device: [
  1562. [/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],
  1563. [d, p, [l, f]],
  1564. [/applecoremedia\/[\w\.]+ \((ipad)/],
  1565. [d, [p, 'Apple'], [l, f]],
  1566. [/(apple\s{0,1}tv)/i],
  1567. [
  1568. [d, 'Apple TV'],
  1569. [p, 'Apple']
  1570. ],
  1571. [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i],
  1572. [p, d, [l, f]],
  1573. [/\((ip[honed|\s\w*]+);.+(apple)/i],
  1574. [d, p, [l, g]],
  1575. [/\((ip[honed|\s\w*]+);/i],
  1576. [d, [p, 'Apple'], [l, g]],
  1577. [/(blackberry)[\s-]?(\w+)/i, /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i],
  1578. [p, d, [l, g]],
  1579. [/\((bb10);\s(\w+)/i],
  1580. [[p, 'BlackBerry'], d, [l, g]],
  1581. [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i],
  1582. [[p, 'Asus'], d, [l, f]],
  1583. [/(sony)\s(tablet\s[ps])/i],
  1584. [p, d, [l, f]],
  1585. [/(nintendo)\s([wids3u]+)/i],
  1586. [p, d, [l, u]],
  1587. [/((playstation)\s[3portablevi]+)/i],
  1588. [[p, 'Sony'], d, [l, u]],
  1589. [/(sprint\s(\w+))/i],
  1590. [
  1591. [p, y.str, v.device.sprint.vendor],
  1592. [d, y.str, v.device.sprint.model],
  1593. [l, g]
  1594. ],
  1595. [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i],
  1596. [p, [d, /_/g, ' '], [l, g]],
  1597. [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i],
  1598. [[p, 'Motorola'], d, [l, g]],
  1599. [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i],
  1600. [[p, 'Motorola'], d, [l, f]],
  1601. [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i],
  1602. [[p, 'Samsung'], d, [l, f]],
  1603. [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i],
  1604. [[p, 'Samsung'], d, [l, g]],
  1605. [/(sie)-(\w+)*/i],
  1606. [[p, 'Siemens'], d, [l, g]],
  1607. [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i],
  1608. [[p, 'Nokia'], d, [l, g]],
  1609. [/android\s3\.[\s\w-;]{10}((a\d{3}))/i],
  1610. [[p, 'Acer'], d, [l, f]],
  1611. [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i],
  1612. [[p, 'LG'], d, [l, f]],
  1613. [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i],
  1614. [[p, 'LG'], d, [l, g]],
  1615. [/android.+((ideatab[a-z0-9\-\s]+))/i],
  1616. [[p, 'Lenovo'], d, [l, f]],
  1617. [/(lg) netcast\.tv/i],
  1618. [p, [l, h]],
  1619. [/(mobile|tablet);.+rv\:.+gecko\//i],
  1620. [l, p, d]
  1621. ],
  1622. engine: [
  1623. [/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i],
  1624. [w, m],
  1625. [/rv\:([\w\.]+).*(gecko)/i],
  1626. [m, w]
  1627. ],
  1628. os: [
  1629. [/microsoft\s(windows)\s(vista|xp)/i],
  1630. [w, m],
  1631. [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],
  1632. [w, [m, y.str, v.os.windows.version]],
  1633. [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],
  1634. [
  1635. [w, 'Windows'],
  1636. [m, y.str, v.os.windows.version]
  1637. ],
  1638. [/\((bb)(10);/i],
  1639. [[w, 'BlackBerry'], m],
  1640. [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i],
  1641. [w, m],
  1642. [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],
  1643. [[w, 'Symbian'], m],
  1644. [/mozilla.+\(mobile;.+gecko.+firefox/i],
  1645. [[w, 'Firefox OS'], m],
  1646. [
  1647. /(nintendo|playstation)\s([wids3portablevu]+)/i,
  1648. /(mint)[\/\s\(]?(\w+)*/i,
  1649. /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i,
  1650. /(hurd|linux)\s?([\w\.]+)*/i,
  1651. /(gnu)\s?([\w\.]+)*/i
  1652. ],
  1653. [w, m],
  1654. [/(cros)\s[\w]+\s([\w\.]+\w)/i],
  1655. [[w, 'Chromium OS'], m],
  1656. [/(sunos)\s?([\w\.]+\d)*/i],
  1657. [[w, 'Solaris'], m],
  1658. [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],
  1659. [w, m],
  1660. [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],
  1661. [
  1662. [w, 'iOS'],
  1663. [m, /_/g, '.']
  1664. ],
  1665. [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i],
  1666. [w, [m, /_/g, '.']],
  1667. [/(haiku)\s(\w+)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, /(unix)\s?([\w\.]+)*/i],
  1668. [w, m]
  1669. ]
  1670. },
  1671. x = function (e) {
  1672. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s)
  1673. return this instanceof x
  1674. ? ((this.getBrowser = function () {
  1675. return y.rgx.apply(this, k.browser)
  1676. }),
  1677. (this.getCPU = function () {
  1678. return y.rgx.apply(this, k.cpu)
  1679. }),
  1680. (this.getDevice = function () {
  1681. return y.rgx.apply(this, k.device)
  1682. }),
  1683. (this.getEngine = function () {
  1684. return y.rgx.apply(this, k.engine)
  1685. }),
  1686. (this.getOS = function () {
  1687. return y.rgx.apply(this, k.os)
  1688. }),
  1689. (this.getResult = function () {
  1690. return {
  1691. ua: this.getUA(),
  1692. browser: this.getBrowser(),
  1693. engine: this.getEngine(),
  1694. os: this.getOS(),
  1695. device: this.getDevice(),
  1696. cpu: this.getCPU()
  1697. }
  1698. }),
  1699. (this.getUA = function () {
  1700. return r
  1701. }),
  1702. (this.setUA = function (i) {
  1703. return (r = i), this
  1704. }),
  1705. void this.setUA(r))
  1706. : new x(e).getResult()
  1707. }
  1708. if (typeof exports !== a) typeof module !== a && module.exports && (exports = module.exports = x), (exports.UAParser = x)
  1709. else if (
  1710. ((i.UAParser = x),
  1711. typeof define === o &&
  1712. define.amd &&
  1713. define(function () {
  1714. return x
  1715. }),
  1716. typeof i.jQuery !== a)
  1717. ) {
  1718. var A = i.jQuery,
  1719. _ = new x()
  1720. ;(A.ua = _.getResult()),
  1721. (A.ua.get = function () {
  1722. return _.getUA()
  1723. }),
  1724. (A.ua.set = function (i) {
  1725. _.setUA(i)
  1726. var e = _.getResult()
  1727. for (var s in e) A.ua[s] = e[s]
  1728. })
  1729. }
  1730. })(this)
  1731. window.Modernizr = (function (n, e, t) {
  1732. function o(n) {
  1733. d.cssText = n
  1734. }
  1735. function r(n, e) {
  1736. return typeof n === e
  1737. }
  1738. var i,
  1739. c,
  1740. u,
  1741. a = '2.8.2',
  1742. f = {},
  1743. s = e.documentElement,
  1744. l = 'modernizr',
  1745. p = e.createElement(l),
  1746. d = p.style,
  1747. y = ({}.toString, {}),
  1748. w = [],
  1749. b = w.slice,
  1750. v = {}.hasOwnProperty
  1751. ;(u =
  1752. r(v, 'undefined') || r(v.call, 'undefined')
  1753. ? function (n, e) {
  1754. return e in n && r(n.constructor.prototype[e], 'undefined')
  1755. }
  1756. : function (n, e) {
  1757. return v.call(n, e)
  1758. }),
  1759. Function.prototype.bind ||
  1760. (Function.prototype.bind = function (n) {
  1761. var e = this
  1762. if ('function' != typeof e) throw new TypeError()
  1763. var t = b.call(arguments, 1),
  1764. o = function () {
  1765. if (this instanceof o) {
  1766. var r = function () {}
  1767. r.prototype = e.prototype
  1768. var i = new r(),
  1769. c = e.apply(i, t.concat(b.call(arguments)))
  1770. return Object(c) === c ? c : i
  1771. }
  1772. return e.apply(n, t.concat(b.call(arguments)))
  1773. }
  1774. return o
  1775. }),
  1776. (y.webgl = function () {
  1777. return !!n.WebGLRenderingContext
  1778. })
  1779. for (var h in y) u(y, h) && ((c = h.toLowerCase()), (f[c] = y[h]()), w.push((f[c] ? '' : 'no-') + c))
  1780. return (
  1781. (f.addTest = function (n, e) {
  1782. if ('object' == typeof n) for (var o in n) u(n, o) && f.addTest(o, n[o])
  1783. else {
  1784. if (((n = n.toLowerCase()), f[n] !== t)) return f
  1785. ;(e = 'function' == typeof e ? e() : e), 'undefined' != typeof enableClasses && enableClasses && (s.className += ' ' + (e ? '' : 'no-') + n), (f[n] = e)
  1786. }
  1787. return f
  1788. }),
  1789. o(''),
  1790. (p = i = null),
  1791. (f._version = a),
  1792. f
  1793. )
  1794. })(this, this.document)
  1795. !(function (e, t, a) {
  1796. 'use strict'
  1797. function n(t, h, m) {
  1798. function H(a) {
  1799. var n = 0,
  1800. i = Ee.length
  1801. if (
  1802. ((Ce.old = e.extend({}, Ce)),
  1803. (Ie = we ? 0 : be[ge.horizontal ? 'width' : 'height']()),
  1804. (ke = Be[ge.horizontal ? 'width' : 'height']()),
  1805. (ze = we ? t : Pe[ge.horizontal ? 'outerWidth' : 'outerHeight']()),
  1806. (Ee.length = 0),
  1807. (Ce.start = 0),
  1808. (Ce.end = q(ze - Ie, 0)),
  1809. Re)
  1810. ) {
  1811. ;(n = Ne.length), (qe = Pe.children(ge.itemSelector)), (Ne.length = 0)
  1812. var r,
  1813. s = c(Pe, ge.horizontal ? 'paddingLeft' : 'paddingTop'),
  1814. o = c(Pe, ge.horizontal ? 'paddingRight' : 'paddingBottom'),
  1815. l = 'border-box' === e(qe).css('boxSizing'),
  1816. u = 'none' !== qe.css('float'),
  1817. f = 0,
  1818. v = qe.length - 1
  1819. ;(ze = 0),
  1820. qe.each(function (t, a) {
  1821. var n = e(a),
  1822. i = a.getBoundingClientRect(),
  1823. l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top),
  1824. d = c(n, ge.horizontal ? 'marginLeft' : 'marginTop'),
  1825. p = c(n, ge.horizontal ? 'marginRight' : 'marginBottom'),
  1826. h = l + d + p,
  1827. m = !d || !p,
  1828. g = {}
  1829. ;(g.el = a),
  1830. (g.size = m ? l : h),
  1831. (g.half = g.size / 2),
  1832. (g.start = ze + (m ? d : 0)),
  1833. (g.center = g.start - E(Ie / 2 - g.size / 2)),
  1834. (g.end = g.start - Ie + g.size),
  1835. t || (ze += s),
  1836. (ze += h),
  1837. ge.horizontal || u || (p && d && t > 0 && (ze -= N(d, p))),
  1838. t === v && ((g.end += o), (ze += o), (f = m ? p : 0)),
  1839. Ne.push(g),
  1840. (r = g)
  1841. }),
  1842. (Pe[0].style[ge.horizontal ? 'width' : 'height'] = (l ? ze : ze - s - o) + 'px'),
  1843. (ze -= f),
  1844. Ne.length ? ((Ce.start = Ne[0][Me ? 'center' : 'start']), (Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start)) : (Ce.start = Ce.end = 0)
  1845. }
  1846. if (
  1847. ((Ce.center = E(Ce.end / 2 + Ce.start / 2)),
  1848. Q(),
  1849. Se.length &&
  1850. ke > 0 &&
  1851. (ge.dynamicHandle
  1852. ? ((Te = Ce.start === Ce.end ? ke : E((ke * Ie) / ze)), (Te = d(Te, ge.minHandleSize, ke)), (Se[0].style[ge.horizontal ? 'width' : 'height'] = Te + 'px'))
  1853. : (Te = Se[ge.horizontal ? 'outerWidth' : 'outerHeight']()),
  1854. (xe.end = ke - Te),
  1855. it || j()),
  1856. !we && Ie > 0)
  1857. ) {
  1858. var p = Ce.start,
  1859. h = ''
  1860. if (Re)
  1861. e.each(Ne, function (e, t) {
  1862. Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && ((p = t.start), Ee.push(p), (p += Ie), p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  1863. })
  1864. else for (; p - Ie < Ce.end; ) Ee.push(p), (p += Ie)
  1865. if (De[0] && i !== Ee.length) {
  1866. for (var m = 0; m < Ee.length; m++) h += ge.pageBuilder.call(ye, m)
  1867. ;(Ae = De.html(h).children()), Ae.eq(Oe.activePage).addClass(ge.activeClass)
  1868. }
  1869. }
  1870. if (((Oe.slideeSize = ze), (Oe.frameSize = Ie), (Oe.sbSize = ke), (Oe.handleSize = Te), Re)) {
  1871. a && null != ge.startAt && (W(ge.startAt), ye[Le ? 'toCenter' : 'toStart'](ge.startAt))
  1872. var g = Ne[Oe.activeItem]
  1873. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  1874. } else a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end))
  1875. pe('load')
  1876. }
  1877. function X(e, t, a) {
  1878. if (Re && at.released && !a) {
  1879. var n = $(e),
  1880. i = e > Ce.start && e < Ce.end
  1881. Le ? (i && (e = Ne[n.centerItem].center), Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
  1882. }
  1883. at.init && at.slidee && ge.elasticBounds ? (e > Ce.end ? (e = Ce.end + (e - Ce.end) / 6) : e < Ce.start && (e = Ce.start + (e - Ce.start) / 6)) : (e = d(e, Ce.start, Ce.end)),
  1884. (et.start = +new Date()),
  1885. (et.time = 0),
  1886. (et.from = Ce.cur),
  1887. (et.to = e),
  1888. (et.delta = e - Ce.cur),
  1889. (et.tweesing = at.tweese || (at.init && !at.slidee)),
  1890. (et.immediate = !et.tweesing && (t || (at.init && at.slidee) || !ge.speed)),
  1891. (at.tweese = 0),
  1892. e !== Ce.dest && ((Ce.dest = e), pe('change'), it || Y()),
  1893. K(),
  1894. Q(),
  1895. Z(),
  1896. F()
  1897. }
  1898. function Y() {
  1899. if (ye.initialized) {
  1900. if (!it) return (it = w(Y)), void (at.released && pe('moveStart'))
  1901. et.immediate
  1902. ? (Ce.cur = et.to)
  1903. : et.tweesing
  1904. ? ((et.tweeseDelta = et.to - Ce.cur), x(et.tweeseDelta) < 0.1 ? (Ce.cur = et.to) : (Ce.cur += et.tweeseDelta * (at.released ? ge.swingSpeed : ge.syncSpeed)))
  1905. : ((et.time = N(+new Date() - et.start, ge.speed)), (Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed))),
  1906. et.to === Ce.cur ? ((Ce.cur = et.to), (at.tweese = it = 0)) : (it = w(Y)),
  1907. pe('move'),
  1908. we || (f ? (Pe[0].style[f] = v + (ge.horizontal ? 'translateX' : 'translateY') + '(' + -Ce.cur + 'px)') : (Pe[0].style[ge.horizontal ? 'left' : 'top'] = -E(Ce.cur) + 'px')),
  1909. !it && at.released && pe('moveEnd'),
  1910. j()
  1911. }
  1912. }
  1913. function j() {
  1914. Se.length &&
  1915. ((xe.cur = Ce.start === Ce.end ? 0 : (((at.init && !at.slidee ? Ce.dest : Ce.cur) - Ce.start) / (Ce.end - Ce.start)) * xe.end),
  1916. (xe.cur = d(E(xe.cur), xe.start, xe.end)),
  1917. _e.hPos !== xe.cur &&
  1918. ((_e.hPos = xe.cur), f ? (Se[0].style[f] = v + (ge.horizontal ? 'translateX' : 'translateY') + '(' + xe.cur + 'px)') : (Se[0].style[ge.horizontal ? 'left' : 'top'] = xe.cur + 'px')))
  1919. }
  1920. function F() {
  1921. Ae[0] && _e.page !== Oe.activePage && ((_e.page = Oe.activePage), Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass), pe('activePage', _e.page))
  1922. }
  1923. function M() {
  1924. ;(tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start)) || ye.stop(),
  1925. (ot = at.init ? w(M) : 0),
  1926. (tt.now = +new Date()),
  1927. (tt.pos = Ce.cur + ((tt.now - tt.lastTime) / 1e3) * tt.speed),
  1928. X(at.init ? tt.pos : E(tt.pos)),
  1929. at.init || Ce.cur !== Ce.dest || pe('moveEnd'),
  1930. (tt.lastTime = tt.now)
  1931. }
  1932. function L(e, t, n) {
  1933. if (('boolean' === i(t) && ((n = t), (t = a)), t === a)) X(Ce[e], n)
  1934. else {
  1935. if (Le && 'center' !== e) return
  1936. var r = ye.getPos(t)
  1937. r && X(r[e], n, !Le)
  1938. }
  1939. }
  1940. function R(e) {
  1941. return null != e ? (l(e) ? (e >= 0 && e < Ne.length ? e : -1) : qe.index(e)) : -1
  1942. }
  1943. function U(e) {
  1944. return R(l(e) && 0 > e ? e + Ne.length : e)
  1945. }
  1946. function W(e, t) {
  1947. var a = R(e)
  1948. return (
  1949. !(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass), qe.eq(a).addClass(ge.activeClass), (_e.active = Oe.activeItem = a), Z(), pe('active', a)), a)
  1950. )
  1951. }
  1952. function $(e) {
  1953. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end)
  1954. var t = {},
  1955. a = Me ? 0 : Ie / 2
  1956. if (!we)
  1957. for (var n = 0, i = Ee.length; i > n; n++) {
  1958. if (e >= Ce.end || n === Ee.length - 1) {
  1959. t.activePage = Ee.length - 1
  1960. break
  1961. }
  1962. if (e <= Ee[n] + a) {
  1963. t.activePage = n
  1964. break
  1965. }
  1966. }
  1967. if (Re) {
  1968. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  1969. if ((r === !1 && e <= Ne[c].start + Ne[c].half && (r = c), o === !1 && e <= Ne[c].center + Ne[c].half && (o = c), c === u - 1 || e <= Ne[c].end + Ne[c].half)) {
  1970. s = c
  1971. break
  1972. }
  1973. ;(t.firstItem = l(r) ? r : 0), (t.centerItem = l(o) ? o : t.firstItem), (t.lastItem = l(s) ? s : t.centerItem)
  1974. }
  1975. return t
  1976. }
  1977. function Q(t) {
  1978. e.extend(Oe, $(t))
  1979. }
  1980. function Z() {
  1981. var e = Ce.dest <= Ce.start,
  1982. t = Ce.dest >= Ce.end,
  1983. a = (e ? 1 : 0) | (t ? 2 : 0)
  1984. if (
  1985. (_e.slideePosState !== a &&
  1986. ((_e.slideePosState = a),
  1987. Je.is('button,input') && Je.prop('disabled', e),
  1988. Ke.is('button,input') && Ke.prop('disabled', t),
  1989. Je.add(Qe)[e ? 'addClass' : 'removeClass'](ge.disabledClass),
  1990. Ke.add($e)[t ? 'addClass' : 'removeClass'](ge.disabledClass)),
  1991. _e.fwdbwdState !== a && at.released && ((_e.fwdbwdState = a), Qe.is('button,input') && Qe.prop('disabled', e), $e.is('button,input') && $e.prop('disabled', t)),
  1992. Re && null != Oe.activeItem)
  1993. ) {
  1994. var n = 0 === Oe.activeItem,
  1995. i = Oe.activeItem >= Ne.length - 1,
  1996. r = (n ? 1 : 0) | (i ? 2 : 0)
  1997. _e.itemsButtonState !== r &&
  1998. ((_e.itemsButtonState = r),
  1999. Ze.is('button,input') && Ze.prop('disabled', n),
  2000. Ge.is('button,input') && Ge.prop('disabled', i),
  2001. Ze[n ? 'addClass' : 'removeClass'](ge.disabledClass),
  2002. Ge[i ? 'addClass' : 'removeClass'](ge.disabledClass))
  2003. }
  2004. }
  2005. function G(e, t, a) {
  2006. if (((e = U(e)), (t = U(t)), e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1))) {
  2007. qe.eq(e)[a ? 'insertAfter' : 'insertBefore'](Ne[t].el)
  2008. var n = t > e ? e : a ? t : t - 1,
  2009. i = e > t ? e : a ? t + 1 : t,
  2010. r = e > t
  2011. null != Oe.activeItem &&
  2012. (e === Oe.activeItem ? (_e.active = Oe.activeItem = a ? (r ? t + 1 : t) : r ? t : t - 1) : Oe.activeItem > n && Oe.activeItem < i && (_e.active = Oe.activeItem += r ? 1 : -1)),
  2013. H()
  2014. }
  2015. }
  2016. function J(e, t) {
  2017. for (var a = 0, n = Ve[e].length; n > a; a++) if (Ve[e][a] === t) return a
  2018. return -1
  2019. }
  2020. function K() {
  2021. at.released && !ye.isPaused && ye.resume()
  2022. }
  2023. function V(e) {
  2024. return E((d(e, xe.start, xe.end) / xe.end) * (Ce.end - Ce.start)) + Ce.start
  2025. }
  2026. function _() {
  2027. ;(at.history[0] = at.history[1]), (at.history[1] = at.history[2]), (at.history[2] = at.history[3]), (at.history[3] = at.delta)
  2028. }
  2029. function ee(e) {
  2030. ;(at.released = 0), (at.source = e), (at.slidee = 'slidee' === e)
  2031. }
  2032. function te(t) {
  2033. var a = 'touchstart' === t.type,
  2034. n = t.data.source,
  2035. i = 'slidee' === n
  2036. at.init ||
  2037. (!a && ie(t.target)) ||
  2038. (('handle' !== n || (ge.dragHandle && xe.start !== xe.end)) &&
  2039. (!i || (a ? ge.touchDragging : ge.mouseDragging && t.which < 2)) &&
  2040. (a || r(t),
  2041. ee(n),
  2042. (at.init = 0),
  2043. (at.$source = e(t.target)),
  2044. (at.touch = a),
  2045. (at.pointer = a ? t.originalEvent.touches[0] : t),
  2046. (at.initX = at.pointer.pageX),
  2047. (at.initY = at.pointer.pageY),
  2048. (at.initPos = i ? Ce.cur : xe.cur),
  2049. (at.start = +new Date()),
  2050. (at.time = 0),
  2051. (at.path = 0),
  2052. (at.delta = 0),
  2053. (at.locked = 0),
  2054. (at.history = [0, 0, 0, 0]),
  2055. (at.pathToLock = i ? (a ? 30 : 10) : 0),
  2056. b.on(a ? z : I, ae),
  2057. ye.pause(1),
  2058. (i ? Pe : Se).addClass(ge.draggedClass),
  2059. pe('moveStart'),
  2060. i && (rt = setInterval(_, 10))))
  2061. }
  2062. function ae(e) {
  2063. if (
  2064. ((at.released = 'mouseup' === e.type || 'touchend' === e.type),
  2065. (at.pointer = at.touch ? e.originalEvent[at.released ? 'changedTouches' : 'touches'][0] : e),
  2066. (at.pathX = at.pointer.pageX - at.initX),
  2067. (at.pathY = at.pointer.pageY - at.initY),
  2068. (at.path = D(A(at.pathX, 2) + A(at.pathY, 2))),
  2069. (at.delta = ge.horizontal ? at.pathX : at.pathY),
  2070. at.released || !(at.path < 1))
  2071. ) {
  2072. if (!at.init) {
  2073. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY))) return ne()
  2074. at.init = 1
  2075. }
  2076. r(e),
  2077. !at.locked && at.path > at.pathToLock && at.slidee && ((at.locked = 1), at.$source.on(B, s)),
  2078. at.released && (ne(), ge.releaseSwing && at.slidee && ((at.swing = ((at.delta - at.history[0]) / 40) * 300), (at.delta += at.swing), (at.tweese = x(at.swing) > 10))),
  2079. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  2080. }
  2081. }
  2082. function ne() {
  2083. clearInterval(rt),
  2084. (at.released = !0),
  2085. b.off(at.touch ? z : I, ae),
  2086. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  2087. setTimeout(function () {
  2088. at.$source.off(B, s)
  2089. }),
  2090. Ce.cur === Ce.dest && at.init && pe('moveEnd'),
  2091. ye.resume(1),
  2092. (at.init = 0)
  2093. }
  2094. function ie(t) {
  2095. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  2096. }
  2097. function re() {
  2098. ye.stop(), b.off('mouseup', re)
  2099. }
  2100. function se(e) {
  2101. switch ((r(e), this)) {
  2102. case $e[0]:
  2103. case Qe[0]:
  2104. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy), b.on('mouseup', re)
  2105. break
  2106. case Ze[0]:
  2107. ye.prev()
  2108. break
  2109. case Ge[0]:
  2110. ye.next()
  2111. break
  2112. case Je[0]:
  2113. ye.prevPage()
  2114. break
  2115. case Ke[0]:
  2116. ye.nextPage()
  2117. }
  2118. }
  2119. function oe(e) {
  2120. return (
  2121. (nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta),
  2122. (nt.curDelta /= 1 === e.deltaMode ? 3 : 100),
  2123. Re
  2124. ? ((p = +new Date()),
  2125. nt.last < p - nt.resetTime && (nt.delta = 0),
  2126. (nt.last = p),
  2127. (nt.delta += nt.curDelta),
  2128. x(nt.delta) < 1 ? (nt.finalDelta = 0) : ((nt.finalDelta = E(nt.delta / 1)), (nt.delta %= 1)),
  2129. nt.finalDelta)
  2130. : nt.curDelta
  2131. )
  2132. }
  2133. function le(e) {
  2134. e.originalEvent[g] = ye
  2135. var t = +new Date()
  2136. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window) return void (O = t)
  2137. if (ge.scrollBy && Ce.start !== Ce.end) {
  2138. var a = oe(e.originalEvent)
  2139. ;(ge.scrollTrap || (a > 0 && Ce.dest < Ce.end) || (0 > a && Ce.dest > Ce.start)) && r(e, 1), ye.slideBy(ge.scrollBy * a)
  2140. }
  2141. }
  2142. function ce(e) {
  2143. ge.clickBar && e.target === Be[0] && (r(e), X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  2144. }
  2145. function de(e) {
  2146. if (ge.keyboardNavBy)
  2147. switch (e.which) {
  2148. case ge.horizontal ? 37 : 38:
  2149. r(e), ye['pages' === ge.keyboardNavBy ? 'prevPage' : 'prev']()
  2150. break
  2151. case ge.horizontal ? 39 : 40:
  2152. r(e), ye['pages' === ge.keyboardNavBy ? 'nextPage' : 'next']()
  2153. }
  2154. }
  2155. function ue(e) {
  2156. return ie(this) ? void (e.originalEvent[g + 'ignore'] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + 'ignore'] || ye.activate(this))
  2157. }
  2158. function fe() {
  2159. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  2160. }
  2161. function ve(e) {
  2162. ge.pauseOnHover && ye['mouseenter' === e.type ? 'pause' : 'resume'](2)
  2163. }
  2164. function pe(e, t) {
  2165. if (Ve[e]) {
  2166. for (me = Ve[e].length, T.length = 0, he = 0; me > he; he++) T.push(Ve[e][he])
  2167. for (he = 0; me > he; he++) T[he].call(ye, e, t)
  2168. }
  2169. }
  2170. var he,
  2171. me,
  2172. ge = e.extend({}, n.defaults, h),
  2173. ye = this,
  2174. we = l(t),
  2175. be = e(t),
  2176. Pe = ge.slidee ? e(ge.slidee).eq(0) : be.children().eq(0),
  2177. Ie = 0,
  2178. ze = 0,
  2179. Ce = {
  2180. start: 0,
  2181. center: 0,
  2182. end: 0,
  2183. cur: 0,
  2184. dest: 0
  2185. },
  2186. Be = e(ge.scrollBar).eq(0),
  2187. Se = Be.children().eq(0),
  2188. ke = 0,
  2189. Te = 0,
  2190. xe = {
  2191. start: 0,
  2192. end: 0,
  2193. cur: 0
  2194. },
  2195. De = e(ge.pagesBar),
  2196. Ae = 0,
  2197. Ee = [],
  2198. qe = 0,
  2199. Ne = [],
  2200. Oe = {
  2201. firstItem: 0,
  2202. lastItem: 0,
  2203. centerItem: 0,
  2204. activeItem: null,
  2205. activePage: 0
  2206. },
  2207. He = new u(be[0]),
  2208. Xe = new u(Pe[0]),
  2209. Ye = new u(Be[0]),
  2210. je = new u(Se[0]),
  2211. Fe = 'basic' === ge.itemNav,
  2212. Me = 'forceCentered' === ge.itemNav,
  2213. Le = 'centered' === ge.itemNav || Me,
  2214. Re = !we && (Fe || Le || Me),
  2215. Ue = ge.scrollSource ? e(ge.scrollSource) : be,
  2216. We = ge.dragSource ? e(ge.dragSource) : be,
  2217. $e = e(ge.forward),
  2218. Qe = e(ge.backward),
  2219. Ze = e(ge.prev),
  2220. Ge = e(ge.next),
  2221. Je = e(ge.prevPage),
  2222. Ke = e(ge.nextPage),
  2223. Ve = {},
  2224. _e = {},
  2225. et = {},
  2226. tt = {},
  2227. at = {
  2228. released: 1
  2229. },
  2230. nt = {
  2231. last: 0,
  2232. delta: 0,
  2233. resetTime: 200
  2234. },
  2235. it = 0,
  2236. rt = 0,
  2237. st = 0,
  2238. ot = 0
  2239. we || (t = be[0]),
  2240. (ye.initialized = 0),
  2241. (ye.frame = t),
  2242. (ye.slidee = Pe[0]),
  2243. (ye.pos = Ce),
  2244. (ye.rel = Oe),
  2245. (ye.items = Ne),
  2246. (ye.pages = Ee),
  2247. (ye.isPaused = 0),
  2248. (ye.options = ge),
  2249. (ye.dragging = at),
  2250. (ye.reload = function () {
  2251. H()
  2252. }),
  2253. (ye.getPos = function (e) {
  2254. if (Re) {
  2255. var t = R(e)
  2256. return -1 !== t && Ne[t]
  2257. }
  2258. var a = Pe.find(e).eq(0)
  2259. if (a[0]) {
  2260. var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top,
  2261. i = a[ge.horizontal ? 'outerWidth' : 'outerHeight']()
  2262. return {
  2263. start: n,
  2264. center: n - Ie / 2 + i / 2,
  2265. end: n - Ie + i,
  2266. size: i
  2267. }
  2268. }
  2269. return !1
  2270. }),
  2271. (ye.moveBy = function (e) {
  2272. ;(tt.speed = e),
  2273. !at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && ((tt.lastTime = +new Date()), (tt.startPos = Ce.cur), ee('button'), (at.init = 1), pe('moveStart'), y(ot), M())
  2274. }),
  2275. (ye.stop = function () {
  2276. 'button' === at.source && ((at.init = 0), (at.released = 1))
  2277. }),
  2278. (ye.prev = function () {
  2279. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2280. }),
  2281. (ye.next = function () {
  2282. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2283. }),
  2284. (ye.prevPage = function () {
  2285. ye.activatePage(Oe.activePage - 1)
  2286. }),
  2287. (ye.nextPage = function () {
  2288. ye.activatePage(Oe.activePage + 1)
  2289. }),
  2290. (ye.slideBy = function (e, t) {
  2291. e && (Re ? ye[Le ? 'toCenter' : 'toStart'](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
  2292. }),
  2293. (ye.slideTo = function (e, t) {
  2294. X(e, t)
  2295. }),
  2296. (ye.toStart = function (e, t) {
  2297. L('start', e, t)
  2298. }),
  2299. (ye.toEnd = function (e, t) {
  2300. L('end', e, t)
  2301. }),
  2302. (ye.toCenter = function (e, t) {
  2303. L('center', e, t)
  2304. }),
  2305. (ye.getIndex = R),
  2306. (ye.activate = function (e, t) {
  2307. var a = W(e)
  2308. ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
  2309. }),
  2310. (ye.activatePage = function (e, t) {
  2311. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2312. }),
  2313. (ye.resume = function (e) {
  2314. ge.cycleBy &&
  2315. ge.cycleInterval &&
  2316. ('items' !== ge.cycleBy || (Ne[0] && null != Oe.activeItem)) &&
  2317. !(e < ye.isPaused) &&
  2318. ((ye.isPaused = 0),
  2319. st ? (st = clearTimeout(st)) : pe('resume'),
  2320. (st = setTimeout(function () {
  2321. switch ((pe('cycle'), ge.cycleBy)) {
  2322. case 'items':
  2323. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1)
  2324. break
  2325. case 'pages':
  2326. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2327. }
  2328. }, ge.cycleInterval)))
  2329. }),
  2330. (ye.pause = function (e) {
  2331. e < ye.isPaused || ((ye.isPaused = e || 100), st && ((st = clearTimeout(st)), pe('pause')))
  2332. }),
  2333. (ye.toggle = function () {
  2334. ye[st ? 'pause' : 'resume']()
  2335. }),
  2336. (ye.set = function (t, a) {
  2337. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2338. }),
  2339. (ye.add = function (t, a) {
  2340. var n = e(t)
  2341. Re
  2342. ? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el), null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length))
  2343. : Pe.append(n),
  2344. H()
  2345. }),
  2346. (ye.remove = function (t) {
  2347. if (Re) {
  2348. var a = U(t)
  2349. if (a > -1) {
  2350. qe.eq(a).remove()
  2351. var n = a === Oe.activeItem
  2352. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem), H(), n && ((_e.active = null), ye.activate(Oe.activeItem))
  2353. }
  2354. } else e(t).remove(), H()
  2355. }),
  2356. (ye.moveAfter = function (e, t) {
  2357. G(e, t, 1)
  2358. }),
  2359. (ye.moveBefore = function (e, t) {
  2360. G(e, t)
  2361. }),
  2362. (ye.on = function (e, t) {
  2363. if ('object' === i(e)) for (var a in e) e.hasOwnProperty(a) && ye.on(a, e[a])
  2364. else if ('function' === i(t)) for (var n = e.split(' '), r = 0, s = n.length; s > r; r++) (Ve[n[r]] = Ve[n[r]] || []), -1 === J(n[r], t) && Ve[n[r]].push(t)
  2365. else if ('array' === i(t)) for (var o = 0, l = t.length; l > o; o++) ye.on(e, t[o])
  2366. }),
  2367. (ye.one = function (e, t) {
  2368. function a() {
  2369. t.apply(ye, arguments), ye.off(e, a)
  2370. }
  2371. ye.on(e, a)
  2372. }),
  2373. (ye.off = function (e, t) {
  2374. if (t instanceof Array) for (var a = 0, n = t.length; n > a; a++) ye.off(e, t[a])
  2375. else
  2376. for (var i = e.split(' '), r = 0, s = i.length; s > r; r++)
  2377. if (((Ve[i[r]] = Ve[i[r]] || []), null == t)) Ve[i[r]].length = 0
  2378. else {
  2379. var o = J(i[r], t)
  2380. ;-1 !== o && Ve[i[r]].splice(o, 1)
  2381. }
  2382. }),
  2383. (ye.destroy = function () {
  2384. return (
  2385. Ue.add(Se)
  2386. .add(Be)
  2387. .add(De)
  2388. .add($e)
  2389. .add(Qe)
  2390. .add(Ze)
  2391. .add(Ge)
  2392. .add(Je)
  2393. .add(Ke)
  2394. .off('.' + g),
  2395. b.off('keydown', de),
  2396. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2397. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2398. De.empty(),
  2399. we || (be.off('.' + g), He.restore(), Xe.restore(), Ye.restore(), je.restore(), e.removeData(t, g)),
  2400. (Ne.length = Ee.length = 0),
  2401. (_e = {}),
  2402. (ye.initialized = 0),
  2403. ye
  2404. )
  2405. }),
  2406. (ye.init = function () {
  2407. if (!ye.initialized) {
  2408. ye.on(m)
  2409. var e = ['overflow', 'position'],
  2410. t = ['position', 'webkitTransform', 'msTransform', 'transform', 'left', 'top', 'width', 'height']
  2411. He.save.apply(He, e), Ye.save.apply(Ye, e), Xe.save.apply(Xe, t), je.save.apply(je, t)
  2412. var a = Se
  2413. return (
  2414. we || ((a = a.add(Pe)), be.css('overflow', 'hidden'), f || 'static' !== be.css('position') || be.css('position', 'relative')),
  2415. f
  2416. ? v && a.css(f, v)
  2417. : ('static' === Be.css('position') && Be.css('position', 'relative'),
  2418. a.css({
  2419. position: 'absolute'
  2420. })),
  2421. ge.forward && $e.on(S, se),
  2422. ge.backward && Qe.on(S, se),
  2423. ge.prev && Ze.on(B, se),
  2424. ge.next && Ge.on(B, se),
  2425. ge.prevPage && Je.on(B, se),
  2426. ge.nextPage && Ke.on(B, se),
  2427. Ue.on(C, le), // C是 "wheel.sly" 滚动监听
  2428. Be[0] && Be.on(B, ce),
  2429. Re && ge.activateOn && be.on(ge.activateOn + '.' + g, '*', ue),
  2430. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + '.' + g, '*', fe),
  2431. We.on(
  2432. P,
  2433. {
  2434. source: 'slidee'
  2435. },
  2436. te
  2437. ),
  2438. Se &&
  2439. Se.on(
  2440. P,
  2441. {
  2442. source: 'handle'
  2443. },
  2444. te
  2445. ),
  2446. b.on('keydown', de),
  2447. we || (be.on('mouseenter.' + g + ' mouseleave.' + g, ve), be.on('scroll.' + g, o)),
  2448. (ye.initialized = 1),
  2449. H(!0),
  2450. ge.cycleBy && !we && ye[ge.startPaused ? 'pause' : 'resume'](),
  2451. ye
  2452. )
  2453. }
  2454. })
  2455. }
  2456. function i(e) {
  2457. return null == e
  2458. ? String(e)
  2459. : 'object' == typeof e || 'function' == typeof e
  2460. ? Object.prototype.toString
  2461. .call(e)
  2462. .match(/\s([a-z]+)/i)[1]
  2463. .toLowerCase() || 'object'
  2464. : typeof e
  2465. }
  2466. function r(e, t) {
  2467. e.preventDefault(), t && e.stopPropagation()
  2468. }
  2469. function s(t) {
  2470. r(t, 1), e(this).off(t.type, s)
  2471. }
  2472. function o() {
  2473. ;(this.scrollLeft = 0), (this.scrollTop = 0)
  2474. }
  2475. function l(e) {
  2476. return !isNaN(parseFloat(e)) && isFinite(e)
  2477. }
  2478. function c(e, t) {
  2479. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ''))
  2480. }
  2481. function d(e, t, a) {
  2482. return t > e ? t : e > a ? a : e
  2483. }
  2484. function u(e) {
  2485. var t = {}
  2486. return (
  2487. (t.style = {}),
  2488. (t.save = function () {
  2489. if (e && e.nodeType) {
  2490. for (var a = 0; a < arguments.length; a++) t.style[arguments[a]] = e.style[arguments[a]]
  2491. return t
  2492. }
  2493. }),
  2494. (t.restore = function () {
  2495. if (e && e.nodeType) {
  2496. for (var a in t.style) t.style.hasOwnProperty(a) && (e.style[a] = t.style[a])
  2497. return t
  2498. }
  2499. }),
  2500. t
  2501. )
  2502. }
  2503. var f,
  2504. v,
  2505. p,
  2506. h = 'sly',
  2507. m = 'Sly',
  2508. g = h,
  2509. y = t.cancelAnimationFrame || t.cancelRequestAnimationFrame,
  2510. w = t.requestAnimationFrame,
  2511. b = e(document),
  2512. P = 'touchstart.' + g + ' mousedown.' + g,
  2513. I = 'mousemove.' + g + ' mouseup.' + g,
  2514. z = 'touchmove.' + g + ' touchend.' + g,
  2515. C = (document.implementation.hasFeature('Event.wheel', '3.0') ? 'wheel.' : 'mousewheel.') + g,
  2516. B = 'click.' + g,
  2517. S = 'mousedown.' + g,
  2518. k = ['INPUT', 'SELECT', 'BUTTON', 'TEXTAREA'],
  2519. T = [],
  2520. x = Math.abs,
  2521. D = Math.sqrt,
  2522. A = Math.pow,
  2523. E = Math.round,
  2524. q = Math.max,
  2525. N = Math.min,
  2526. O = 0
  2527. b.on(C, function (e) {
  2528. var t = e.originalEvent[g],
  2529. a = +new Date()
  2530. ;(!t || t.options.scrollHijack < a - O) && (O = a)
  2531. }),
  2532. (function (e) {
  2533. function t(e) {
  2534. var t = new Date().getTime(),
  2535. n = Math.max(0, 16 - (t - a)),
  2536. i = setTimeout(e, n)
  2537. return (a = t), i
  2538. }
  2539. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t
  2540. var a = new Date().getTime(),
  2541. n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout
  2542. y = function (t) {
  2543. n.call(e, t)
  2544. }
  2545. })(window),
  2546. (function () {
  2547. function e(e) {
  2548. for (var n = 0, i = t.length; i > n; n++) {
  2549. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e
  2550. if (null != a.style[r]) return r
  2551. }
  2552. }
  2553. var t = ['', 'webkit', 'moz', 'ms', 'o'],
  2554. a = document.createElement('div')
  2555. ;(f = e('transform')), (v = e('perspective') ? 'translateZ(0) ' : '')
  2556. })(),
  2557. (t[m] = n),
  2558. (e.fn[h] = function (t, a) {
  2559. var r, s
  2560. return (
  2561. e.isPlainObject(t) || (('string' === i(t) || t === !1) && ((r = t === !1 ? 'destroy' : t), (s = Array.prototype.slice.call(arguments, 1))), (t = {})),
  2562. this.each(function (i, o) {
  2563. var l = e.data(o, g)
  2564. l || r ? l && r && l[r] && l[r].apply(l, s) : (l = e.data(o, g, new n(o, t, a).init()))
  2565. })
  2566. )
  2567. }),
  2568. (n.defaults = {
  2569. slidee: null,
  2570. horizontal: !1,
  2571. itemNav: null,
  2572. itemSelector: null,
  2573. smart: !1,
  2574. activateOn: null,
  2575. activateMiddle: !1,
  2576. scrollSource: null,
  2577. scrollBy: 0,
  2578. scrollHijack: 300,
  2579. scrollTrap: !1,
  2580. dragSource: null,
  2581. mouseDragging: !1,
  2582. touchDragging: !1,
  2583. releaseSwing: !1,
  2584. swingSpeed: 0.2,
  2585. elasticBounds: !1,
  2586. interactive: null,
  2587. scrollBar: null,
  2588. dragHandle: !1,
  2589. dynamicHandle: !1,
  2590. minHandleSize: 50,
  2591. clickBar: !1,
  2592. syncSpeed: 0.5,
  2593. pagesBar: null,
  2594. activatePageOn: null,
  2595. pageBuilder: function (e) {
  2596. return '<li>' + (e + 1) + '</li>'
  2597. },
  2598. forward: null,
  2599. backward: null,
  2600. prev: null,
  2601. next: null,
  2602. prevPage: null,
  2603. nextPage: null,
  2604. cycleBy: null,
  2605. cycleInterval: 5e3,
  2606. pauseOnHover: !1,
  2607. startPaused: !1,
  2608. moveBy: 300,
  2609. speed: 0,
  2610. easing: 'swing',
  2611. startAt: null,
  2612. keyboardNavBy: null,
  2613. draggedClass: 'dragged',
  2614. activeClass: 'active',
  2615. disabledClass: 'disabled'
  2616. })
  2617. })(jQuery, window)
  2618. !(function e(t, i, n) {
  2619. function r(a, s) {
  2620. if (!i[a]) {
  2621. if (!t[a]) {
  2622. var l = 'function' == typeof require && require
  2623. if (!s && l) return l(a, !0)
  2624. if (o) return o(a, !0)
  2625. var c = new Error("Cannot find module '" + a + "'")
  2626. throw ((c.code = 'MODULE_NOT_FOUND'), c)
  2627. }
  2628. var h = (i[a] = {
  2629. exports: {}
  2630. })
  2631. t[a][0].call(
  2632. h.exports,
  2633. function (e) {
  2634. var i = t[a][1][e]
  2635. return r(i ? i : e)
  2636. },
  2637. h,
  2638. h.exports,
  2639. e,
  2640. t,
  2641. i,
  2642. n
  2643. )
  2644. }
  2645. return i[a].exports
  2646. }
  2647. for (var o = 'function' == typeof require && require, a = 0; a < n.length; a++) r(n[a])
  2648. return r
  2649. })(
  2650. {
  2651. 1: [
  2652. function (e, t, i) {
  2653. ;(function (i) {
  2654. 'use strict'
  2655. function n(e) {
  2656. ;(this.player = null),
  2657. (this.director = null),
  2658. (this.modelManager = null),
  2659. (this.container = null),
  2660. (this.tagManager = null),
  2661. (this.fadeInSpeed = e),
  2662. (null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed) || (this.fadeInSpeed = 0)
  2663. }
  2664. var r = e('three'),
  2665. o = e('./util/logger'),
  2666. a = (e('./util/common'), e('./enum/PlayerEvents')),
  2667. s = e('./enum/DirectorEvents'),
  2668. l = e('./settings'),
  2669. c = e('./enum/Viewmode'),
  2670. h = (e('./enum/WarpStyle'), e('./enum/BlackoutStyle'), e('./enum/ModelManagerEvents')),
  2671. u = e('./enum/tagEvents'),
  2672. d = e('./util/transitions'),
  2673. p = e('./util/lerp'),
  2674. f = new o(i)
  2675. //window.THREE = r;
  2676. ;(n.prototype.init = function (e, t, i, n, r) {
  2677. window.app = this
  2678. ;(this.player = t), (this.director = e), (this.modelManager = i), (this.tagManager = n), (this.container = r), this.updateModel(), this.bindEvents()
  2679. }),
  2680. (n.prototype.bindEvents = function () {
  2681. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  2682. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2683. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2684. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2685. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  2686. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  2687. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  2688. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2689. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  2690. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  2691. }),
  2692. (n.prototype.updateModel = function () {
  2693. //模型this.model
  2694. this.model = this.modelManager.getActiveModel()
  2695. }),
  2696. (n.prototype.handleWarpStarted = function () {
  2697. this.hidePlayerReticule()
  2698. }),
  2699. (n.prototype.ontagActivated = function () {
  2700. this.hidePlayerReticule()
  2701. }),
  2702. (n.prototype.onNavigationTotag = function () {
  2703. this.hidePlayerReticule()
  2704. }),
  2705. (n.prototype.handlePlayerModeChanging = function (e, t, i) {
  2706. var n = this.modelManager.getActiveModel(),
  2707. r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity
  2708. n.fadePanoMarkers(r), n.setMode(t)
  2709. }),
  2710. (n.prototype.handlePlayerModeChanged = function (e, t) {
  2711. var i = this.modelManager.getActiveModel(),
  2712. n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide
  2713. i.setSide(n), i.setMode(t)
  2714. }),
  2715. (n.prototype.handleClosestPanoChanging = function (e, t, i) {
  2716. i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i), t && !this.director.tourIsPlaying && t.hoverOn(i))
  2717. }),
  2718. (n.prototype.handleActionInterruption = function () {}),
  2719. (n.prototype.handleStartInside = function (e) {
  2720. var t = l[this.player.mode],
  2721. i = e ? 0 : t.transitionTime * t.skyboxOpacityLength
  2722. this.fadeIn(this.fadeInSpeed), (this.model.alpha = 0), (this.model.skybox.material.uniforms.opacity.value = 1), this.model.fadePanoMarkers(e ? 0 : t.markerOpacity)
  2723. var n = this.player.reticule
  2724. d.start(p.property(n.material, 'opacity', 0), i, null, 0, null, 'retReOpac')
  2725. }),
  2726. (n.prototype.handleStartOutside = function (e) {
  2727. this.fadeIn(e)
  2728. }),
  2729. (n.prototype.fadeIn = function (e) {
  2730. ;(null !== e && void 0 !== e) || ((e = 2e3), f.warn('DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.')), $(this.container).fadeIn(e)
  2731. }),
  2732. (n.prototype.hidePlayerReticule = function () {
  2733. this.player.reticule.hide()
  2734. }),
  2735. (t.exports = n)
  2736. }).call(this, '/js/DisplayController.js')
  2737. },
  2738. {
  2739. './enum/BlackoutStyle': 18,
  2740. './enum/DirectorEvents': 23,
  2741. './enum/tagEvents': 32,
  2742. './enum/ModelManagerEvents': 33,
  2743. './enum/PlayerEvents': 40,
  2744. './enum/Viewmode': 51,
  2745. './enum/WarpStyle': 52,
  2746. './settings': 166,
  2747. './util/common': 185,
  2748. './util/lerp': 188,
  2749. './util/logger': 189,
  2750. './util/transitions': 195,
  2751. three: 217
  2752. }
  2753. ],
  2754. 2: [
  2755. function (e, t, i) {
  2756. 'use strict'
  2757. function n() {
  2758. ;(this.baseStartTime = performance.timing.navigationStart), (this.loadingStartTime = null), (this.waitingStartTime = null), (this.appReadyTime = null)
  2759. }
  2760. ;(n.prototype.setBaseStartTime = function (e) {
  2761. this.baseStartTime = e || Date.now()
  2762. }),
  2763. (n.prototype.setWaitingStartTime = function (e) {
  2764. this.waitingStartTime = e || Date.now()
  2765. }),
  2766. (n.prototype.setLoadingStartTime = function (e) {
  2767. this.loadingStartTime = e || Date.now()
  2768. }),
  2769. (n.prototype.setAppReadyTime = function (e) {
  2770. this.appReadyTime = e || Date.now()
  2771. }),
  2772. (n.prototype.calcFullLoadingTime = function () {
  2773. var e = this.appReadyTime - this.baseStartTime
  2774. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime), e
  2775. }),
  2776. (t.exports = n)
  2777. },
  2778. {}
  2779. ],
  2780. 3: [
  2781. function (e, t, i) {
  2782. ;(function (i) {
  2783. 'use strict'
  2784. function n() {
  2785. return 100 * Math.random()
  2786. }
  2787. var r = e('./util/logger'),
  2788. o = e('./util/browser'),
  2789. a = new r(i),
  2790. s = (window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2791. initialized: !1,
  2792. init: function (e, t) {
  2793. if (((t = t || {}), !this.initialized)) {
  2794. ;(this.initialized = !0),
  2795. o.valueFromHash('tilegen') && (t.tilegen = 1 === o.valueFromHash('tilegen', 0)),
  2796. o.valueFromHash('imgopt') && (t.imgopt = 1 === o.valueFromHash('imgopt', 0))
  2797. for (var i in e) {
  2798. var r = i.match('^sc_tilegen_([0-9]+)$')
  2799. r && (s.tilegen = n() < parseInt(r[1]))
  2800. var l = i.match('^sc_imgopt_([0-9]+)$')
  2801. l && (s.imgopt = n() < parseInt(l[1]))
  2802. }
  2803. for (var c in t) (s[c] = t[c]), a.debug('A/B override:', c, s[c])
  2804. }
  2805. },
  2806. changeIfTileGenerating: function (e) {
  2807. return s.tilegen && ((e += e.indexOf('?') === -1 ? '?' : '&'), (e += '')), e
  2808. },
  2809. changeIfImageOptimzing: function (e) {
  2810. return s.imgopt && e.indexOf('imgopt=1') === -1 && ((e += e.indexOf('?') === -1 ? '?' : '&'), (e += '')), e
  2811. },
  2812. tilegen: !1,
  2813. imgopt: !1
  2814. })
  2815. t.exports = s
  2816. }).call(this, '/js/ab.js')
  2817. },
  2818. {
  2819. './util/browser': 182,
  2820. './util/logger': 189
  2821. }
  2822. ],
  2823. 4: [
  2824. function (e, t, i) {
  2825. ;(function (i) {
  2826. 'use strict'
  2827. function n() {
  2828. return {
  2829. addons: [
  2830. {
  2831. name: 'keen:ua_parser',
  2832. input: {
  2833. ua_string: 'user_agent'
  2834. },
  2835. output: 'parsed_user_agent'
  2836. }
  2837. ]
  2838. }
  2839. }
  2840. function r(e, t, i, n) {
  2841. function r(t) {
  2842. l[t.sid] = !0
  2843. var i = t.billboard.media && t.billboard.media.type,
  2844. n = {
  2845. tag_id: t.sid,
  2846. tags_visited: Object.keys(l).length,
  2847. tag_count: Object.keys(e.tags).length,
  2848. tag_view_count: ++E,
  2849. has_media: !!i
  2850. }
  2851. i && (n.media_type = i), u('tag_opened', n)
  2852. }
  2853. var l = {},
  2854. h = Date.now() - N,
  2855. f = null
  2856. n && (f = Date.now() - window.navigationStart)
  2857. var g
  2858. try {
  2859. g = /* e.data.player_options.highlight_reel && */ e.heroLocations.length > 0
  2860. } catch (e) {
  2861. g = !1
  2862. }
  2863. var v,
  2864. A = e.supportsVR
  2865. A ||
  2866. ((v = 'VR disabled at the model/account level'),
  2867. m.valueFromHash('vr') === _.NONE
  2868. ? (v = 'VR disabled, using &vr=0')
  2869. : m.detectAndroid()
  2870. ? b.isDeviceSupported(w.Android) || (v = 'VR disabled, unsupported Android version')
  2871. : m.detectIOS() && (b.isDeviceSupported(w.IOS) || (v = 'VR disabled, unsupported iOS version'))),
  2872. u('model_loaded', {
  2873. duration: h,
  2874. duration_from_navigation_start: f,
  2875. has_hlr: g,
  2876. has_vr: A,
  2877. vr_reason: v
  2878. })
  2879. var I = 0
  2880. e.panos.forEach(function (e) {
  2881. e.on('enter', function () {
  2882. c('pano_viewed', {
  2883. pano_id: e.id,
  2884. pano_view_count: ++I,
  2885. alignment_type: e.alignmentType,
  2886. interaction_source: O,
  2887. navigation_source: p
  2888. })
  2889. })
  2890. })
  2891. var E = 0
  2892. for (var T in e.tags) e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]))
  2893. t.on('tour_auto', function (e) {
  2894. p = 'tour_' + e
  2895. }),
  2896. t.on('tour_manual', function (e) {
  2897. ;(O = 'gui-' + e), (p = 'tour_manual')
  2898. }),
  2899. i.on(C.InteractionKey, function () {
  2900. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  2901. }),
  2902. i.on(C.InteractionDirect, function () {
  2903. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  2904. }),
  2905. o(t),
  2906. a(),
  2907. s()
  2908. }
  2909. function o(e) {
  2910. I.on(T.OPENED, function () {
  2911. c('showcase_share_intent', {
  2912. pano_id: e.currentPano && e.currentPano.id
  2913. })
  2914. }),
  2915. I.on(T.LINK_CLICKED, function (t) {
  2916. c('showcase_share_action', {
  2917. channel: t.channel,
  2918. pano_id: e.currentPano && e.currentPano.id
  2919. })
  2920. }),
  2921. E.on(x.ORIGIN_LINK_CLICKED, function () {
  2922. c('showcase_share_origin_link_clicked')
  2923. })
  2924. }
  2925. function a() {}
  2926. function s() {
  2927. b.on(
  2928. S.OPENED,
  2929. c.bind(this, 'showcase_gui', {
  2930. gui_action: 'click_vr_button'
  2931. })
  2932. ),
  2933. b.on(S.LAUNCH, function (e) {
  2934. c('showcase_gui', {
  2935. gui_action: 'launch_vr',
  2936. vr_platform: e.vr_platform,
  2937. vr_app: e.vr_app
  2938. })
  2939. }),
  2940. b.on(
  2941. S.PREV,
  2942. c.bind(this, 'showcase_gui', {
  2943. gui_action: 'vr_modal_prev'
  2944. })
  2945. ),
  2946. b.on(S.NEXT, function (e) {
  2947. c('showcase_gui', {
  2948. gui_action: e.nextAction
  2949. })
  2950. }),
  2951. b.on(
  2952. S.CLOSED,
  2953. c.bind(this, 'showcase_gui', {
  2954. gui_action: 'vr_modal_close'
  2955. })
  2956. ),
  2957. b.on(S.falseICECHOSEN, function (e) {
  2958. c('showcase_gui', {
  2959. gui_action: e.name + ' '
  2960. })
  2961. }),
  2962. b.on(S.STORE, function (e) {
  2963. c('showcase_gui', {
  2964. gui_action: 'launch_store',
  2965. store: e
  2966. })
  2967. })
  2968. }
  2969. function l(e, t) {
  2970. if (f)
  2971. try {
  2972. f.addEvent(
  2973. e,
  2974. v.extendObject(
  2975. {
  2976. host: window.location.host,
  2977. keen: n(),
  2978. user_agent: '${keen.user_agent}',
  2979. referrer: {
  2980. url: v.normalizeUrl(document.referrer),
  2981. domain: v.domainFromUrl(document.referrer),
  2982. url_original: document.referrer
  2983. },
  2984. embedded: m.inIframe(),
  2985. is_mobile: m.isMobile(),
  2986. version: '2.25.6-0-gd87e5b1'
  2987. },
  2988. t
  2989. )
  2990. )
  2991. } catch (e) {
  2992. P.warn('analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: ' + e)
  2993. }
  2994. }
  2995. function c(e, t) {
  2996. if (((t = t || {}), L))
  2997. try {
  2998. window.analytics.track(e, v.extendObject(t, B), {
  2999. context: {
  3000. app: {
  3001. name: 'showcase',
  3002. version: '2.25.6-0-gd87e5b1'
  3003. },
  3004. screen: {
  3005. width: window.screen.width,
  3006. height: window.screen.height,
  3007. density: window.devicePixelRatio
  3008. }
  3009. }
  3010. })
  3011. } catch (t) {
  3012. console.warn('Failed to send data to segment for ' + e)
  3013. }
  3014. }
  3015. function h(e, t) {
  3016. if (((t = t || {}), navigator.sendBeacon && L))
  3017. try {
  3018. navigator.sendBeacon(
  3019. 'https://api.segment.io/v1/t',
  3020. JSON.stringify({
  3021. event: e,
  3022. anonymousId: window.analytics.user().anonymousId(),
  3023. properties: v.extendObject(t, B),
  3024. writeKey: L,
  3025. sentAt: Date.now(),
  3026. type: 'track',
  3027. context: {
  3028. userAgent: m.userAgent(),
  3029. library: {
  3030. name: 'showcase-beacon',
  3031. version: '2.25.6-0-gd87e5b1'
  3032. },
  3033. app: {
  3034. name: 'showcase',
  3035. version: '2.25.6-0-gd87e5b1'
  3036. }
  3037. }
  3038. })
  3039. )
  3040. } catch (e) {
  3041. console.warn('Failed to send async segment request')
  3042. }
  3043. }
  3044. function u(e, t) {
  3045. ;(t = t || {}), c(e, t)
  3046. }
  3047. function d(e, t) {
  3048. ;(O = e === C.InteractionGui ? 'gui-' + t : e), (p = 'self_guided')
  3049. }
  3050. var p,
  3051. f,
  3052. g = (e('three'), e('./util/ajax'), e('./ab')),
  3053. m = e('./util/browser'),
  3054. v = e('./util/common'),
  3055. A = e('./settings'),
  3056. y = (e('./localization/localize'), e('./enum/Viewmode')),
  3057. C = e('./enum/ControlEvents'),
  3058. I = e('./gui/sharing/modal'),
  3059. E = e('./gui/title/titleBar'),
  3060. b = e('./gui/vr/vrModal'),
  3061. w = e('./enum/VRPlatforms'),
  3062. _ = e('./enum/VROption'),
  3063. T = e('./gui/sharing/ShareEvents'),
  3064. x = e('./gui/title/TitleEvents'),
  3065. S = e('./gui/vr/vrEvent'),
  3066. M = e('./tag/Billboard/BillboardEvent'),
  3067. R = e('./util/logger'),
  3068. P = new R(i),
  3069. O = (e('./enum/PlayerEvents'), 'direct'),
  3070. L = null,
  3071. D = !1,
  3072. N = null,
  3073. B = null,
  3074. F = v.uuid4()
  3075. t.exports = {
  3076. report: function (e, t, i, n) {
  3077. l('Session starts', {
  3078. model: e,
  3079. status: t,
  3080. loadtime: Date.now() - (N || Date.now()),
  3081. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  3082. autoplay: i,
  3083. quickstart: n,
  3084. ab_tilegen: g.tilegen,
  3085. ab_imgopt: g.imgopt
  3086. })
  3087. },
  3088. impression: function (e) {
  3089. e = e || {}
  3090. var t = void 0 === e.isVisible || e.isVisible,
  3091. i = (void 0 !== e.immediate && e.immediate, window.location.search.substr(1).split('&'))
  3092. u('impression', {
  3093. visible: t,
  3094. url_params: i
  3095. })
  3096. },
  3097. initKeen: function (e) {
  3098. return e.token && e.appId
  3099. ? void (f = new Keen({
  3100. projectId: e.appId,
  3101. writeKey: e.token,
  3102. readKey: '',
  3103. requestType: 'xhr'
  3104. }))
  3105. : void P.warn('no keen token/appId')
  3106. },
  3107. initSegment: function (e) {
  3108. return e.token
  3109. ? ((L = e.token),
  3110. window.analytics.load(e.token),
  3111. (B = {
  3112. model_id: e.model,
  3113. start_source: e.startSource,
  3114. autoplay: e.autoplay,
  3115. quickstart: e.quickstart,
  3116. language_tag: A.languageTag,
  3117. is_mobile: m.isMobile(),
  3118. iframe: m.inIframe(),
  3119. aspect_ratio: m.aspectRatio(),
  3120. session_id: F,
  3121. window: {
  3122. width: $('#player').width(),
  3123. height: $('#player').height()
  3124. },
  3125. platform: {
  3126. browser: {
  3127. name: $.ua.browser.name,
  3128. major: $.ua.browser.major,
  3129. version: $.ua.browser.version
  3130. },
  3131. os: {
  3132. name: $.ua.os.name,
  3133. version: $.ua.os.version
  3134. },
  3135. device: {
  3136. vendor: $.ua.device.vendor,
  3137. model: $.ua.device.model,
  3138. type: $.ua.device.type
  3139. }
  3140. }
  3141. }),
  3142. (D = Math.random() < A.analytics.sessionTrackingRate),
  3143. P.debug('tracking sample rate = ' + A.analytics.sessionTrackingRate),
  3144. void P.debug('tracking this session = ' + D))
  3145. : void P.warn('no segment token')
  3146. },
  3147. sessionStart: function (e) {
  3148. P.debug('analytics user_session_start'),
  3149. c('session_started'),
  3150. (N = Date.now()),
  3151. window.addEventListener('unload', function () {
  3152. h('session_ended', {
  3153. duration: Date.now() - N
  3154. })
  3155. })
  3156. },
  3157. modelLoaded: function (e, t, i, n) {
  3158. r(e, t, i, n)
  3159. },
  3160. loadComplete: function (e) {
  3161. var t = {
  3162. time_to_app_start: e
  3163. }
  3164. c('load_times', t)
  3165. },
  3166. track: function (e, t) {
  3167. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + ' )'), c(e, t))
  3168. },
  3169. trackAlways: function (e, t) {
  3170. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + ' )'), c(e, t)
  3171. },
  3172. getSessionId: function () {
  3173. return F
  3174. },
  3175. updateInteraction: d
  3176. }
  3177. }).call(this, '/js/analytics.js')
  3178. },
  3179. {
  3180. './ab': 3,
  3181. './enum/ControlEvents': 21,
  3182. './enum/PlayerEvents': 40,
  3183. './enum/VROption': 47,
  3184. './enum/VRPlatforms': 49,
  3185. './enum/Viewmode': 51,
  3186. './gui/sharing/ShareEvents': 76,
  3187. './gui/sharing/modal': 77,
  3188. './gui/title/TitleEvents': 80,
  3189. './gui/title/titleBar': 82,
  3190. './gui/vr/vrEvent': 85,
  3191. './gui/vr/vrModal': 87,
  3192. './localization/localize': 108,
  3193. './tag/Billboard/BillboardEvent': 120,
  3194. './settings': 166,
  3195. './util/ajax': 181,
  3196. './util/browser': 182,
  3197. './util/common': 185,
  3198. './util/logger': 189,
  3199. three: 217
  3200. }
  3201. ],
  3202. 5: [
  3203. function (e, t, i) {
  3204. 'use strict'
  3205. function n() {
  3206. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $('#player').width() / $('#player').height(), o.dollhouseNear, o.dollhouseFar), (this.controls = null)
  3207. }
  3208. var r = e('three'),
  3209. o = e('../constants'),
  3210. a = e('../util/cameraLight')
  3211. ;(n.prototype = Object.create(r.PerspectiveCamera.prototype)),
  3212. (n.prototype.updateAspect = function (e) {
  3213. ;(this.aspect = e), this.updateProjectionMatrix()
  3214. }),
  3215. (t.exports = n)
  3216. },
  3217. {
  3218. '../constants': 8,
  3219. '../util/cameraLight': 184,
  3220. three: 217
  3221. }
  3222. ],
  3223. 6: [
  3224. function (e, t, i) {
  3225. 'use strict'
  3226. function n() {
  3227. var e = $('#player').width() / $('#player').height()
  3228. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar), (this.controls = null), this.updateAspect(e)
  3229. }
  3230. var r = e('three'),
  3231. o = e('../constants')
  3232. ;(n.prototype = Object.create(r.OrthographicCamera.prototype)),
  3233. (n.prototype.updateAspect = function (e) {
  3234. ;(this.aspect = e), (this.top = o.orthoBase / e), (this.bottom = -o.orthoBase / e), this.updateProjectionMatrix()
  3235. }),
  3236. (t.exports = n)
  3237. },
  3238. {
  3239. '../constants': 8,
  3240. three: 217
  3241. }
  3242. ],
  3243. 7: [
  3244. function (e, t, i) {
  3245. 'use strict'
  3246. function n() {
  3247. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $('#player').width() / $('#player').height(), o.insideNear, o.insideFar), (this.controls = null)
  3248. }
  3249. var r = e('three'),
  3250. o = e('../settings'),
  3251. a = e('../util/cameraLight')
  3252. ;(n.prototype = Object.create(r.PerspectiveCamera.prototype)),
  3253. (n.prototype.updateAspect = function (e) {
  3254. ;(this.aspect = e), this.updateProjectionMatrix()
  3255. }),
  3256. (t.exports = n)
  3257. },
  3258. {
  3259. '../settings': 166,
  3260. '../util/cameraLight': 184,
  3261. three: 217
  3262. }
  3263. ],
  3264. 8: [
  3265. function (e, t, i) {
  3266. 'use strict'
  3267. t.exports = {
  3268. signedUrlDefaultExpireTime: 24e4,
  3269. signedUrlCheckInterval: 1e4,
  3270. signedUrlRefreshBuffer: 15e3,
  3271. dollhouseFOV: 70,
  3272. dollhouseNear: 1,
  3273. dollhouseFar: 5e3,
  3274. insideFOV: 70,
  3275. insideFOVMax: 120,
  3276. insideNear: 0.1,
  3277. insideFar: 5e3,
  3278. insideLookSpeed: 0.12,
  3279. insideLookLimitUp: 40, //视角
  3280. insideLookLimitDown: -40,
  3281. orthoNear: 1,
  3282. orthoFar: 5e3,
  3283. orthoBase: 10,
  3284. narrowLandscapeHeight: 290,
  3285. reallyNarrowLandscapeHeight: 250,
  3286. visionTilingStartDate: new Date('8/26/2016'),
  3287. visionTilingStartVersion: '1.1.407.13667',
  3288. windowHeightHighQualityThreshold: 900,
  3289. tourStepDelayDefault: 3500,
  3290. tourStepDelaySlideShow: 5e3,
  3291. workshopApsect: 9 / 16,
  3292. highQualityMaxZoom: 2,
  3293. ultraHighQualityMaxZoom: 3
  3294. }
  3295. },
  3296. {}
  3297. ],
  3298. 9: [
  3299. function (e, t, i) {
  3300. 'use strict'
  3301. function n() {
  3302. ;(this.activeControl = null), (this.controls = {}), (this.cameras = {})
  3303. }
  3304. var r = e('./PanoramaControls'),
  3305. o = e('./DollhouseControls'),
  3306. a = e('./FloorplanControls'),
  3307. s = e('../cameras/PanoramaCamera'),
  3308. l = e('../cameras/DollhouseCamera'),
  3309. c = e('../cameras/FloorplanCamera'),
  3310. h = e('events').EventEmitter,
  3311. u = e('../enum/ControlEvents'),
  3312. d = e('../enum/ModelManagerEvents'),
  3313. p = e('../enum/Viewmode'),
  3314. f = e('../settings')
  3315. ;(n.prototype = Object.create(h.prototype)),
  3316. (n.prototype.init = function (e, t) {
  3317. this.setUpControls(), this.bindEvents(e, t)
  3318. }),
  3319. (n.prototype.activateControls = function (e) {
  3320. this.activeControl && (this.activeControl.reset(), (this.activeControl.enabled = !1)), this.controls[e] && (this.controls[e].enabled = !0), (this.activeControl = this.controls[e])
  3321. }),
  3322. (n.prototype.setUpControls = function () {
  3323. var e = {},
  3324. t = {},
  3325. i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN],
  3326. n = [s, l, c],
  3327. h = [r, o, a]
  3328. i.forEach(
  3329. function (i, r) {
  3330. ;(e[i] = new n[r]()),
  3331. (t[i] = new h[r](e[i])),
  3332. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3333. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3334. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3335. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3336. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3337. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3338. }.bind(this)
  3339. ),
  3340. (this.controls = t),
  3341. (this.cameras = e)
  3342. }),
  3343. (n.prototype.bindEvents = function (e, t) {
  3344. e.addEventListener('mousemove', this.onMouseMove.bind(this)),
  3345. e.addEventListener('mousedown', this.onMouseDown.bind(this)),
  3346. e.addEventListener('mouseup', this.onMouseUp.bind(this)),
  3347. e.addEventListener('mouseover', this.onMouseOver.bind(this)),
  3348. f.useWheel && (e.addEventListener('mousewheel', this.onMouseWheel.bind(this), { passive: false }), e.addEventListener('DOMMouseScroll', this.onMouseWheel.bind(this))),
  3349. e.addEventListener('touchstart', this.onTouchStart.bind(this)),
  3350. e.addEventListener('touchmove', this.onTouchMove.bind(this)),
  3351. e.addEventListener('touchend', this.onTouchEnd.bind(this)),
  3352. e.addEventListener('contextmenu', function (e) {
  3353. e.preventDefault()
  3354. }),
  3355. e.addEventListener('pointerdown', this.onPointerDown.bind(this)),
  3356. e.addEventListener('pointermove', this.onPointerMove.bind(this)),
  3357. e.addEventListener('pointerup', this.onPointerUp.bind(this)),
  3358. e.addEventListener('pointerout', this.onPointerCancel.bind(this)),
  3359. e.addEventListener('pointercancel', this.onPointerCancel.bind(this)),
  3360. document.addEventListener('keydown', this.onKeyDown.bind(this)),
  3361. document.addEventListener('keyup', this.onKeyUp.bind(this)),
  3362. t.on(
  3363. d.ActiveModelChanged,
  3364. function (e) {
  3365. this.setModelForControls(e.model)
  3366. }.bind(this)
  3367. )
  3368. }),
  3369. (n.prototype.setModelForControls = function (e) {
  3370. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox)
  3371. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding)
  3372. ;[p.DOLLHOUSE, p.FLOORPLAN].forEach(
  3373. function (e) {
  3374. this.controls[e].setBounds(t)
  3375. }.bind(this)
  3376. )
  3377. }),
  3378. (n.prototype.onMouseDown = function (e) {
  3379. e.preventDefault(), this.activeControl && this.activeControl.onMouseDown(e)
  3380. }),
  3381. (n.prototype.onMouseMove = function (e) {
  3382. e.preventDefault(), this.activeControl && this.activeControl.onMouseMove(e)
  3383. }),
  3384. (n.prototype.onMouseUp = function (e) {
  3385. e.preventDefault(), this.activeControl && this.activeControl.onMouseUp(e)
  3386. }),
  3387. (n.prototype.onMouseOver = function (e) {
  3388. e.preventDefault(), this.activeControl && this.activeControl.onMouseOver(e)
  3389. }),
  3390. (n.prototype.onMouseWheel = function (e) {
  3391. e.preventDefault(), this.activeControl && this.activeControl.onMouseWheel(e)
  3392. }),
  3393. (n.prototype.onTouchStart = function (e) {
  3394. e.preventDefault(), this.activeControl && this.activeControl.onTouchStart(e)
  3395. var hotList = $('#hotListWrap')[0]
  3396. hotList.classList.remove('hotListActive')
  3397. $('#hotListContent ul .active').removeClass('active')
  3398. $('#hotList')[0].classList.remove('active')
  3399. }),
  3400. (n.prototype.onTouchMove = function (e) {
  3401. e.preventDefault(), this.activeControl && this.activeControl.onTouchMove(e)
  3402. }),
  3403. (n.prototype.onTouchEnd = function (e) {
  3404. e.preventDefault(), this.activeControl && this.activeControl.onTouchEnd(e)
  3405. }),
  3406. (n.prototype.onPointerDown = function (e) {
  3407. if ((e.preventDefault(), this.activeControl))
  3408. switch (e.pointerType) {
  3409. case 'mouse':
  3410. this.activeControl.onMouseDown(e)
  3411. break
  3412. default:
  3413. this.activeControl.onPointerDown(e)
  3414. }
  3415. }),
  3416. (n.prototype.onPointerMove = function (e) {
  3417. if ((e.preventDefault(), this.activeControl))
  3418. switch (e.pointerType) {
  3419. case 'mouse':
  3420. this.activeControl.onMouseMove(e)
  3421. break
  3422. default:
  3423. this.activeControl.onPointerMove(e)
  3424. }
  3425. }),
  3426. (n.prototype.onPointerUp = function (e) {
  3427. if ((e.preventDefault(), this.activeControl))
  3428. switch (e.pointerType) {
  3429. case 'mouse':
  3430. this.activeControl.onMouseUp(e)
  3431. break
  3432. default:
  3433. this.activeControl.onPointerUp(e)
  3434. }
  3435. }),
  3436. (n.prototype.onPointerCancel = function (e) {
  3437. e.preventDefault(), this.activeControl && 'mouse' !== e.pointerType && this.activeControl.onPointerUp(e)
  3438. }),
  3439. (n.prototype.onKeyDown = function (e) {
  3440. e.metaKey || e.ctrlKey || (e.preventDefault(), this.activeControl && this.activeControl.onKeyDown(e))
  3441. }),
  3442. (n.prototype.onKeyUp = function (e) {
  3443. e.preventDefault(), this.activeControl && this.activeControl.onKeyUp(e)
  3444. }),
  3445. (t.exports = n)
  3446. },
  3447. {
  3448. '../cameras/DollhouseCamera': 5,
  3449. '../cameras/FloorplanCamera': 6,
  3450. '../cameras/PanoramaCamera': 7,
  3451. '../enum/ControlEvents': 21,
  3452. '../enum/ModelManagerEvents': 33,
  3453. '../enum/Viewmode': 51,
  3454. '../settings': 166,
  3455. './DollhouseControls': 10,
  3456. './FloorplanControls': 11,
  3457. './PanoramaControls': 13,
  3458. events: 202
  3459. }
  3460. ],
  3461. 10: [
  3462. function (e, t, i) {
  3463. 'use strict'
  3464. function n(e) {
  3465. a.call(this, e),
  3466. (this.minPolarAngle = o.dollhouseDefault.minPolarAngle),
  3467. (this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle),
  3468. (this.minDistance = o.dollhouseDefault.minDistance),
  3469. (this.maxDistance = o.dollhouseDefault.maxDistance),
  3470. (this.adjustedMinDistance = this.minDistance),
  3471. (this.adjustedMaxDistance = this.maxDistance)
  3472. }
  3473. var r = e('three'),
  3474. o = e('../settings'),
  3475. a = e('./OutsideControls')
  3476. ;(n.prototype = Object.create(a.prototype)),
  3477. (n.prototype.pan = function (e, t) {
  3478. this.camera.updateMatrix()
  3479. var i = this.camera.position.clone().sub(this.target).length()
  3480. ;(i *= Math.tan(((this.camera.fov / 2) * Math.PI) / 180)), this.panLeft((2 * e * i) / $('#player').height()), this.panUp((-2 * t * i) / $('#player').height())
  3481. }),
  3482. (n.prototype.updateZoom = function () {
  3483. var e = this.offset.length()
  3484. return e * this.scale
  3485. }),
  3486. (n.prototype.setZoomBounds = function (e) {
  3487. var t = e.min.distanceTo(e.max)
  3488. ;(this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0)),
  3489. (this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius)),
  3490. (this.minDistance = this.adjustedMinDistance),
  3491. (this.maxDistance = this.adjustedMaxDistance)
  3492. }),
  3493. (n.prototype.resetRanges = function (e, t) {
  3494. e
  3495. ? ((this.minDistance = Math.min(e, this.minDistance)), (this.maxDistance = Math.max(e, this.maxDistance)))
  3496. : ((this.minDistance = this.adjustedMinDistance), (this.maxDistance = this.adjustedMaxDistance)),
  3497. t
  3498. ? ((this.minPolarAngle = r.Math.degToRad(-15)), (this.maxPolarAngle = r.Math.degToRad(89.9)))
  3499. : ((this.minPolarAngle = o.dollhouseDefault.minPolarAngle), (this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle))
  3500. }),
  3501. (n.prototype.toJSON = function () {
  3502. return a.prototype.toJSON.call(this)
  3503. }),
  3504. (t.exports = n)
  3505. },
  3506. {
  3507. '../settings': 166,
  3508. './OutsideControls': 12,
  3509. three: 217
  3510. }
  3511. ],
  3512. 11: [
  3513. function (e, t, i) {
  3514. 'use strict'
  3515. function n(e) {
  3516. a.call(this, e),
  3517. (this.minDistance = 15),
  3518. (this.maxDistance = 50),
  3519. (this.noRotateUpDown = !0),
  3520. (this.minPolarAngle = 0),
  3521. (this.maxPolarAngle = 0),
  3522. (this.mouseActions[l.LEFT] = s.PAN),
  3523. (this.mouseActions[l.MIDDLE] = s.DOLLY),
  3524. (this.mouseActions[l.RIGHT] = s.ROTATE),
  3525. (this.touchActions[1] = s.PAN),
  3526. (this.touchActions[2] = s.ROTATE_DOLLY),
  3527. (this.absoluteScale = 1),
  3528. (this.currentScale = 1)
  3529. }
  3530. var r = e('three'),
  3531. o = e('../settings'),
  3532. a = e('./OutsideControls'),
  3533. s = e('../enum/ControlActions'),
  3534. l = e('../enum/MouseButton'),
  3535. c = e('../util/math'),
  3536. h = e('../util/browser')
  3537. ;(n.prototype = Object.create(a.prototype)),
  3538. (n.prototype.zoomToContain = function (e) {
  3539. this.absoluteScale = this.getDefaultAbsoluteScale(e)
  3540. this.currentScale = this.absoluteScale
  3541. }),
  3542. (n.prototype.getDefaultAbsoluteScale = function (modelSize, ratio) {
  3543. let defaultRatio = 1.2,
  3544. absoluteScale
  3545. if (_settings.floorPlanAngle) {
  3546. //指定了角度的话,就和browser.aspectRatio()无关,总使用纵向
  3547. var angle = parseFloat(_settings.floorPlanAngle)
  3548. modelSize = modelSize.clone().applyEuler(new THREE.Euler(0, angle, 0))
  3549. var n = Math.max(Math.abs(modelSize.x), Math.abs(modelSize.z) * this.camera.aspect) //视口宽高比 >= 1 情况下,模型所占最大视口尺寸
  3550. var screenSize = Math.min($('#player').width(), $('#player').height())
  3551. var maxSize = 800 //模型最大占据像素
  3552. ratio = ratio != void 0 ? ratio : Math.max((screenSize * defaultRatio) / maxSize, defaultRatio)
  3553. absoluteScale = (n / 2 / o.orthoBase) * ratio //根据模型所占最大视口尺寸调整缩放
  3554. } else {
  3555. var t = Math.max(modelSize.x, modelSize.z),
  3556. i = Math.min(modelSize.x, modelSize.z),
  3557. n = Math.max(t, i * this.camera.aspect),
  3558. r = Math.max(i, t * this.camera.aspect)
  3559. absoluteScale = ((h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase) * defaultRatio
  3560. }
  3561. return absoluteScale
  3562. }),
  3563. /* n.prototype.rotateToView = function(e, t) {
  3564. var i = 0
  3565. , n = h.aspectRatio() < 1
  3566. , r = e.x < e.z;
  3567. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  3568. this.rotateLeft(i),
  3569. this.update(0)
  3570. },
  3571. */
  3572. (n.prototype.rotateToView = function (modelSize, direction) {
  3573. let i = 0,
  3574. n = h.aspectRatio() < 1 //是否模型尺寸显“细长”
  3575. if (_settings.floorPlanAngle) {
  3576. //规定了cadImage旋转值的话 (0是无效的,将不设置)
  3577. i = parseFloat(_settings.floorPlanAngle)
  3578. } else {
  3579. let r = modelSize.x < modelSize.z //是否视口为“窄屏”
  3580. if (n === r) {
  3581. //“细长” 且 “窄屏”,说明模型尺寸比例与视口比例匹配,相机坐标只需要调转“前”“后”
  3582. if (direction.z > 0) {
  3583. //(第一种情况)相机是否位于背面。 注:在默认情况下webgl的相机朝向-z, direction.z > 0 说明相机视野已经偏向+z,说明相机位于模型“背面”
  3584. i = Math.PI //经度上做180度轨道角位移,使相机移到静止模型的“前面”
  3585. }
  3586. //(第二种情况) 不做处理
  3587. } else if (direction.x > 0) {
  3588. i = Math.PI / 2
  3589. } else {
  3590. i = -Math.PI / 2
  3591. }
  3592. }
  3593. if (_settings.angleShift2d) {
  3594. i += THREE.Math.degToRad(_settings.angleShift2d)
  3595. }
  3596. this.rotateLeft(i)
  3597. this.update(0)
  3598. }),
  3599. (n.prototype.rotateToAngle = function (angle) {
  3600. //add 旋转到特定角度
  3601. this.rotateLeft(angle + this.lon)
  3602. this.update(0)
  3603. }),
  3604. (n.prototype.pan = function (e, t) {
  3605. this.camera.updateMatrix(),
  3606. this.panLeft((e * (this.camera.right - this.camera.left)) / $('#player').width()),
  3607. this.panUp((-t * (this.camera.top - this.camera.bottom)) / $('#player').height())
  3608. }),
  3609. (n.prototype.updateZoom = function () {
  3610. return (
  3611. (this.absoluteScale *= this.scale - 0.03 * this.keyboardZoomSpeed),
  3612. (this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit))),
  3613. (this.currentScale = 0.8 * this.currentScale + 0.2 * this.absoluteScale),
  3614. (this.camera.left = -o.orthoBase * this.currentScale),
  3615. (this.camera.right = o.orthoBase * this.currentScale),
  3616. (this.camera.top = (o.orthoBase * this.currentScale) / this.camera.aspect),
  3617. (this.camera.bottom = (-o.orthoBase * this.currentScale) / this.camera.aspect),
  3618. this.camera.updateProjectionMatrix(),
  3619. this.offset.length()
  3620. )
  3621. }),
  3622. (n.prototype.toJSON = (function () {
  3623. var e = new r.Quaternion(),
  3624. t = new r.Quaternion().setFromAxisAngle(new r.Vector3(0, 1, 0), r.Math.degToRad(90)),
  3625. i = new r.Quaternion()
  3626. return function () {
  3627. var n = a.prototype.toJSON.call(this)
  3628. return (
  3629. e.copy(n.camera_quaternion),
  3630. i.copy(t),
  3631. i.multiply(e),
  3632. (n.camera_quaternion.x = c.toPrecision(i.x, 4)),
  3633. (n.camera_quaternion.y = c.toPrecision(i.y, 4)),
  3634. (n.camera_quaternion.z = c.toPrecision(i.z, 4)),
  3635. (n.camera_quaternion.w = c.toPrecision(i.w, 4)),
  3636. (n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4)),
  3637. n
  3638. )
  3639. }
  3640. })()),
  3641. (t.exports = n)
  3642. },
  3643. {
  3644. '../enum/ControlActions': 20,
  3645. '../enum/MouseButton': 34,
  3646. '../settings': 166,
  3647. '../util/browser': 182,
  3648. '../util/math': 190,
  3649. './OutsideControls': 12,
  3650. three: 217
  3651. }
  3652. ],
  3653. 12: [
  3654. function (e, t, i) {
  3655. 'use strict'
  3656. function n(e) {
  3657. ;(this.camera = e),
  3658. (this.camera.controls = this),
  3659. (this.enabled = !1),
  3660. (this.target = new r.Vector3()),
  3661. (this.targetBounds = new r.Box3()),
  3662. (this.zoomSpeed = 1),
  3663. (this.minDistance = 0),
  3664. (this.maxDistance = 1 / 0),
  3665. (this.noRotateUpDown = !1),
  3666. (this.rotateSpeed = 1),
  3667. (this.keyboardZoomSpeed = 0),
  3668. (this.keyPanSpeed = 7),
  3669. (this.autoRotate = !1),
  3670. (this.autoRotateSpeed = 2),
  3671. (this.autoPan = !1),
  3672. (this.autoPanPosition = new r.Vector3()),
  3673. (this.minPolarAngle = r.Math.degToRad(25)),
  3674. (this.maxPolarAngle = r.Math.degToRad(65)),
  3675. (this.rotationAcceleration = new r.Vector2()),
  3676. (this.rotationSpeed = new r.Vector2()),
  3677. (this.panAcceleration = new r.Vector2()),
  3678. (this.panSpeed = new r.Vector2()),
  3679. (this.rotateStart = new r.Vector2()),
  3680. (this.rotateEnd = new r.Vector2()),
  3681. (this.rotateDelta = new r.Vector2()),
  3682. (this.panStart = new r.Vector2()),
  3683. (this.panEnd = new r.Vector2()),
  3684. (this.panDelta = new r.Vector2()),
  3685. (this.panOffset = new r.Vector3()),
  3686. (this.offset = new r.Vector3()),
  3687. (this.dollyStart = new r.Vector2()),
  3688. (this.dollyEnd = new r.Vector2()),
  3689. (this.dollyDelta = new r.Vector2()),
  3690. (this.phiDelta = 0),
  3691. (this.thetaDelta = 0),
  3692. (this.scale = 1),
  3693. (this.panVector = new r.Vector3()),
  3694. (this.lastPosition = new r.Vector3()),
  3695. (this.state = c.NONE),
  3696. (this.mouseActions = {}),
  3697. (this.mouseActions[h.LEFT] = c.ROTATE),
  3698. (this.mouseActions[h.MIDDLE] = c.DOLLY),
  3699. (this.mouseActions[h.RIGHT] = c.PAN),
  3700. (this.touchActions = {}),
  3701. (this.touchActions[1] = c.ROTATE),
  3702. (this.touchActions[2] = c.PAN_DOLLY),
  3703. (this.lastMoveTime = 0),
  3704. (this.pointersLimit = 2),
  3705. (this.pointers = [])
  3706. }
  3707. var r = e('three'),
  3708. o = e('../settings'),
  3709. a = e('../util/common'),
  3710. s = e('../util/math'),
  3711. l = e('../enum/Vectors'),
  3712. c = e('../enum/ControlActions'),
  3713. h = e('../enum/MouseButton'),
  3714. u = e('../enum/Keys'),
  3715. d = e('../enum/ControlEvents'),
  3716. p = e('events').EventEmitter,
  3717. f = 1e-6
  3718. ;(n.prototype = Object.create(p.prototype)),
  3719. (n.prototype.setBounds = function (e) {
  3720. this.targetBounds = e
  3721. }),
  3722. (n.prototype.isEngaged = function () {
  3723. return this.state !== c.NONE
  3724. }),
  3725. (n.prototype.rotateLeft = function (e) {
  3726. void 0 === e && (e = this.getAutoRotationAngle()), (this.thetaDelta -= e)
  3727. }),
  3728. (n.prototype.rotateUp = function (e) {
  3729. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()), (this.phiDelta -= e))
  3730. }),
  3731. (n.prototype.panLeft = function (e) {
  3732. var t = this.camera.matrix.elements
  3733. this.panOffset.set(t[0], 0, t[2]).normalize(), this.panOffset.multiplyScalar(-e), this.panVector.add(this.panOffset)
  3734. }),
  3735. (n.prototype.panUp = function (e) {
  3736. var t = this.camera.matrix.elements
  3737. this.panOffset.set(t[4], 0, t[6]).normalize(), this.panOffset.multiplyScalar(-e), this.panVector.add(this.panOffset)
  3738. }),
  3739. (n.prototype.startRotating = function (e, t) {
  3740. e && this.navRotationAcc('x', e), t && this.navRotationAcc('y', t)
  3741. }),
  3742. (n.prototype.stopRotating = function (e) {
  3743. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0), this.navRotationAcc('x', 0), this.navRotationAcc('y', 0)
  3744. }),
  3745. (n.prototype.setAutoPanPosition = (function (e, t) {
  3746. var i = new r.Vector3(),
  3747. n = new r.Vector3()
  3748. return function (e, t) {
  3749. i.copy(this.camera.position), (void 0 === e && null === e) || i.setX(e), (void 0 === t && null === t) || i.setZ(t)
  3750. var r = this.camera.position.distanceTo(this.target),
  3751. o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion)
  3752. ;(this.targetClamped = !1),
  3753. n.copy(i).addScaledVector(o, r),
  3754. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n), i.copy(n).addScaledVector(o, -r), (this.targetClamped = !0)),
  3755. (this.autoPanPosition.x = i.x),
  3756. (this.autoPanPosition.z = i.z),
  3757. this.autoPan && this.stopAutoPanning()
  3758. }
  3759. })()),
  3760. (n.prototype.stopAutoPanning = function () {
  3761. var e = this.autoPan
  3762. ;(this.autoPan = !1), this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  3763. }),
  3764. (n.prototype.dollyIn = function (e) {
  3765. void 0 === e && (e = this.getZoomScale()), (this.scale /= e)
  3766. }),
  3767. (n.prototype.dollyOut = function (e) {
  3768. void 0 === e && (e = this.getZoomScale()), (this.scale *= e)
  3769. }),
  3770. (n.prototype.updatePan = function (e) {
  3771. if ((this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e), this.pan(-this.panSpeed.x, this.panSpeed.y), this.autoPan)) {
  3772. var t = new r.Vector3().copy(this.autoPanPosition).sub(this.camera.position)
  3773. t.setY(0).clampLength(0, 50 * e),
  3774. this.target.add(t),
  3775. this.camera.position.add(t),
  3776. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && ((this.autoPan = !1), this.stopAutoPanning())
  3777. }
  3778. }),
  3779. (n.prototype.update = function (e) {
  3780. e || (e = 1 / 60)
  3781. var friction = Math.min(1, o.rotationFriction * e * 60) //add 如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  3782. this.rotationSpeed.multiplyScalar(1 - friction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  3783. this.rotateLeft(-this.rotationSpeed.x),
  3784. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3785. this.updatePan(e)
  3786. var t = this.camera.position
  3787. this.offset.copy(t).sub(this.target)
  3788. var i = Math.atan2(this.offset.x, this.offset.z),
  3789. n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y)
  3790. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3791. (i += this.thetaDelta),
  3792. (n += this.phiDelta),
  3793. (n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n))),
  3794. (n = Math.max(f, Math.min(Math.PI - f, n)))
  3795. ;(this.lon = i), (this.lat = n) //add
  3796. var r = this.updateZoom()
  3797. ;(r = Math.max(this.minDistance, Math.min(this.maxDistance, r))),
  3798. this.target.add(this.panVector),
  3799. this.targetBounds.clampPoint(this.target, this.target),
  3800. (this.offset.x = r * Math.sin(n) * Math.sin(i)),
  3801. (this.offset.y = r * Math.cos(n)),
  3802. (this.offset.z = r * Math.sin(n) * Math.cos(i)),
  3803. t.copy(this.target).add(this.offset),
  3804. this.camera.lookAt(this.target),
  3805. (this.thetaDelta = 0),
  3806. (this.phiDelta = 0),
  3807. (this.scale = 1),
  3808. this.panVector.set(0, 0, 0),
  3809. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  3810. }),
  3811. (n.prototype.getAutoRotationAngle = function () {
  3812. return ((2 * Math.PI) / 60 / 60) * this.autoRotateSpeed
  3813. }),
  3814. (n.prototype.getZoomScale = function () {
  3815. return Math.pow(0.95, this.zoomSpeed)
  3816. }),
  3817. (n.prototype.onMouseDown = function (e) {
  3818. if (this.enabled) {
  3819. switch ((e.preventDefault(), this.stopAutoPanning(), (this.mouseDown = !0), (this.state = this.mouseActions[e.button]), this.state)) {
  3820. case c.ROTATE:
  3821. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY), this.rotationSpeed.set(0, 0)
  3822. break
  3823. case c.DOLLY:
  3824. this.dollyStart.set(e.clientX, e.clientY)
  3825. break
  3826. case c.PAN:
  3827. this.panStart.set(e.clientX, e.clientY)
  3828. }
  3829. this.emit(d.InputStart, 'mouse')
  3830. }
  3831. }),
  3832. (n.prototype.onMouseMove = function (e) {
  3833. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3834. switch ((e.preventDefault(), this.state)) {
  3835. case c.ROTATE:
  3836. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3837. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3838. this.rotateLeft(((2 * Math.PI * this.rotateDelta.x) / $('#player').width()) * this.rotateSpeed),
  3839. this.rotateUp(((2 * Math.PI * this.rotateDelta.y) / $('#player').height()) * this.rotateSpeed),
  3840. this.rotateStart.copy(this.rotateEnd)
  3841. break
  3842. case c.DOLLY:
  3843. this.dollyEnd.set(e.clientX, e.clientY), this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart)
  3844. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut
  3845. t.call(this), this.dollyStart.copy(this.dollyEnd)
  3846. break
  3847. case c.PAN:
  3848. this.panEnd.set(e.clientX, e.clientY), this.panDelta.subVectors(this.panEnd, this.panStart), this.pan(this.panDelta.x, this.panDelta.y), this.panStart.copy(this.panEnd)
  3849. }
  3850. this.emit(d.Move, 'mouse'), (this.lastMoveTime = e.timeStamp), this.update()
  3851. }
  3852. }),
  3853. (n.prototype.onMouseUp = function (e) {
  3854. this.enabled &&
  3855. ((this.mouseDown = !1),
  3856. (this.state = c.NONE),
  3857. 'mouseover' !== e.type &&
  3858. (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3859. this.update(),
  3860. this.rotationAcceleration.set(0, 0),
  3861. this.rotateDelta.set(0, 0)))
  3862. }),
  3863. (n.prototype.onMouseOver = function (e) {
  3864. ;(0 !== e.which && 0 !== e.buttons) || this.onMouseUp(e)
  3865. }),
  3866. (n.prototype.onMouseWheel = function (e) {
  3867. if (this.enabled && o.useWheel) {
  3868. this.emit(d.Move, 'wheel')
  3869. var t = e.wheelDelta || -e.detail,
  3870. i = t > 0 ? this.dollyOut : this.dollyIn
  3871. i.call(this), this.update()
  3872. }
  3873. }),
  3874. (n.prototype.onKeyDown = function (e) {
  3875. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(), this.handleKeyDown(e.which)))
  3876. }),
  3877. (n.prototype.navRotationAcc = function (e, t) {
  3878. 'y' === e ? (this.noRotateUpDown ? (this.keyboardZoomSpeed = t) : (this.rotationAcceleration.y = t)) : (this.rotationAcceleration.x = t)
  3879. }),
  3880. (n.prototype.navPanAcc = function (e, t) {
  3881. this.stopAutoPanning(), (this.panAcceleration[e] = t)
  3882. }),
  3883. (n.prototype.handleKeyDown = function (e) {
  3884. var t = !0
  3885. switch (e) {
  3886. case u.UPARROW:
  3887. case u.I:
  3888. this.navRotationAcc('y', 1)
  3889. break
  3890. case u.DOWNARROW:
  3891. case u.K:
  3892. this.navRotationAcc('y', -1)
  3893. break
  3894. case u.LEFTARROW:
  3895. case u.J:
  3896. this.navRotationAcc('x', -1)
  3897. break
  3898. case u.RIGHTARROW:
  3899. case u.L:
  3900. this.navRotationAcc('x', 1)
  3901. break
  3902. case u.W:
  3903. this.navPanAcc('y', 1)
  3904. break
  3905. case u.S:
  3906. this.navPanAcc('y', -1)
  3907. break
  3908. case u.A:
  3909. this.navPanAcc('x', -1)
  3910. break
  3911. case u.D:
  3912. this.navPanAcc('x', 1)
  3913. break
  3914. default:
  3915. t = !1
  3916. }
  3917. t && this.emit(d.Move, 'key')
  3918. }),
  3919. (n.prototype.onKeyUp = function (e) {
  3920. this.enabled && (e.preventDefault(), e.stopPropagation(), this.handleKeyUp(e.which))
  3921. }),
  3922. (n.prototype.handleKeyUp = function (e) {
  3923. switch (e) {
  3924. case u.I:
  3925. case u.K:
  3926. case u.UPARROW:
  3927. case u.DOWNARROW:
  3928. ;(this.keyboardZoomSpeed = 0), (this.rotationAcceleration.y = 0)
  3929. break
  3930. case u.J:
  3931. case u.L:
  3932. case u.LEFTARROW:
  3933. case u.RIGHTARROW:
  3934. this.rotationAcceleration.x = 0
  3935. break
  3936. case u.S:
  3937. case u.W:
  3938. this.panAcceleration.y = 0
  3939. break
  3940. case u.A:
  3941. case u.D:
  3942. this.panAcceleration.x = 0
  3943. }
  3944. }),
  3945. (n.prototype.onTouchStart = function (e) {
  3946. if (this.enabled || this.state === c.NONE) {
  3947. e.preventDefault(), e.stopPropagation(), this.stopAutoPanning()
  3948. var t = function () {
  3949. if (2 === e.touches.length) {
  3950. var t = e.touches[0].pageX - e.touches[1].pageX,
  3951. i = e.touches[0].pageY - e.touches[1].pageY
  3952. this.dollyStart.set(t, i)
  3953. }
  3954. }.bind(this),
  3955. i = function () {
  3956. this.panStart.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY'))
  3957. }.bind(this),
  3958. n = function () {
  3959. this.rotateStart.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY'))
  3960. }.bind(this)
  3961. switch (((this.state = this.touchActions[e.touches.length]), this.state)) {
  3962. case c.PAN_DOLLY:
  3963. t()
  3964. case c.PAN:
  3965. i()
  3966. break
  3967. case c.ROTATE_DOLLY:
  3968. t()
  3969. case c.ROTATE:
  3970. n()
  3971. }
  3972. this.rotationSpeed.set(0, 0), this.emit(d.InputStart, 'touch')
  3973. }
  3974. }),
  3975. (n.prototype.onTouchMove = function (e) {
  3976. if (this.enabled && this.state !== c.NONE) {
  3977. e.preventDefault(), e.stopPropagation()
  3978. var t = function () {
  3979. var t = e.touches[0].pageX - e.touches[1].pageX,
  3980. i = e.touches[0].pageY - e.touches[1].pageY
  3981. this.dollyEnd.set(t, i)
  3982. var n = this.dollyStart.length() - this.dollyEnd.length()
  3983. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500), this.dollyStart.copy(this.dollyEnd)
  3984. }.bind(this),
  3985. i = function () {
  3986. this.panEnd.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY')),
  3987. this.panDelta.subVectors(this.panEnd, this.panStart),
  3988. this.pan(this.panDelta.x, this.panDelta.y),
  3989. this.panStart.copy(this.panEnd),
  3990. this.rotateDelta.set(0, 0)
  3991. }.bind(this),
  3992. n = function () {
  3993. this.rotateEnd.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY')),
  3994. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3995. this.rotateLeft(((2 * Math.PI * this.rotateDelta.x) / $('#player').width()) * this.rotateSpeed),
  3996. this.rotateUp(((2 * Math.PI * this.rotateDelta.y) / $('#player').height()) * this.rotateSpeed),
  3997. this.rotateStart.copy(this.rotateEnd)
  3998. }.bind(this),
  3999. r = function () {
  4000. if (2 === e.touches.length) {
  4001. var i = window.devicePixelRatio || 1,
  4002. r = e.touches[1].pageX - e.touches[0].pageX,
  4003. s = e.touches[1].pageY - e.touches[0].pageY,
  4004. l = Math.sqrt(r * r + s * s),
  4005. h = Math.abs(this.dollyStart.length() - l)
  4006. if (h > o.input.touchMoveThreshold * i) (this.state = c.DOLLY), t()
  4007. else {
  4008. var u = a.average(e.touches, 'pageX'),
  4009. d = a.average(e.touches, 'pageY'),
  4010. p = this.rotateDelta.set(u, d).sub(this.rotateStart).length()
  4011. p > o.input.touchMoveThreshold && ((this.state = c.ROTATE), this.rotateStart.set(u, d), n())
  4012. }
  4013. }
  4014. }.bind(this)
  4015. switch (this.state) {
  4016. case c.PAN_DOLLY:
  4017. t()
  4018. case c.PAN:
  4019. i()
  4020. break
  4021. case c.ROTATE_DOLLY:
  4022. r()
  4023. break
  4024. case c.DOLLY:
  4025. t()
  4026. break
  4027. case c.ROTATE:
  4028. n()
  4029. break
  4030. default:
  4031. this.state = c.NONE
  4032. }
  4033. ;(this.lastMoveTime = e.timeStamp), this.emit(d.Move, 'touch')
  4034. }
  4035. }),
  4036. (n.prototype.onTouchEnd = function (e) {
  4037. this.enabled &&
  4038. (this.state === c.ROTATE &&
  4039. (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  4040. (this.state = c.NONE),
  4041. this.update(),
  4042. this.rotationAcceleration.set(0, 0),
  4043. this.rotateDelta.set(0, 0))
  4044. }),
  4045. (n.prototype.onPointerDown = function (e) {
  4046. this.enabled &&
  4047. ('touch' === e.pointerType &&
  4048. (this.pointers.length < this.pointersLimit &&
  4049. this.pointers.push({
  4050. id: e.pointerId,
  4051. pageX: e.pageX,
  4052. pageY: e.pageY
  4053. }),
  4054. (e.touches = this.pointers),
  4055. this.onTouchStart(e)),
  4056. this.emit(d.InputStart, 'pointer'))
  4057. }),
  4058. (n.prototype.onPointerMove = function (e) {
  4059. this.enabled &&
  4060. 'touch' === e.pointerType &&
  4061. (this.pointers.forEach(function (t) {
  4062. e.pointerId === t.id && ((t.pageX = e.pageX), (t.pageY = e.pageY))
  4063. }),
  4064. (e.touches = this.pointers),
  4065. this.onTouchMove(e))
  4066. }),
  4067. (n.prototype.onPointerUp = function (e) {
  4068. this.enabled &&
  4069. 'touch' === e.pointerType &&
  4070. (this.pointers.forEach(
  4071. function (t, i) {
  4072. e.pointerId === t.id && this.pointers.splice(i, 1)
  4073. }.bind(this)
  4074. ),
  4075. (e.touches = this.pointers),
  4076. this.onTouchEnd(e))
  4077. }),
  4078. (n.prototype.reset = function () {
  4079. ;(this.state = c.NONE), this.stopAutoPanning(), this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0), this.panSpeed.set(0, 0), this.panAcceleration.set(0, 0)
  4080. }),
  4081. (n.prototype.toJSON = function () {
  4082. var e = {
  4083. camera_position: {
  4084. x: s.toPrecision(this.camera.position.x, 4),
  4085. y: s.toPrecision(this.camera.position.y, 4),
  4086. z: s.toPrecision(this.camera.position.z, 4)
  4087. },
  4088. camera_quaternion: {
  4089. x: s.toPrecision(this.camera.quaternion.x, 4),
  4090. y: s.toPrecision(this.camera.quaternion.y, 4),
  4091. z: s.toPrecision(this.camera.quaternion.z, 4),
  4092. w: s.toPrecision(this.camera.quaternion.w, 4)
  4093. }
  4094. }
  4095. return e
  4096. }),
  4097. (t.exports = n)
  4098. },
  4099. {
  4100. '../enum/ControlActions': 20,
  4101. '../enum/ControlEvents': 21,
  4102. '../enum/Keys': 30,
  4103. '../enum/MouseButton': 34,
  4104. '../enum/Vectors': 50,
  4105. '../settings': 166,
  4106. '../util/common': 185,
  4107. '../util/math': 190,
  4108. events: 202,
  4109. three: 217
  4110. }
  4111. ],
  4112. 13: [
  4113. function (e, t, i) {
  4114. ;(function (i) {
  4115. 'use strict'
  4116. function n(e) {
  4117. ;(this.camera = e),
  4118. (this.camera.controls = this),
  4119. (this.target = new r.Vector3(0, 0, 0)),
  4120. (this.lookVector = new r.Vector3()),
  4121. (this.lookSpeed = 0.05),
  4122. (this.rotationAcc = new r.Vector2()),
  4123. (this.rotationSpeed = new r.Vector2()),
  4124. (this.lat = 0),
  4125. (this.lon = 0),
  4126. (this.phi = 0),
  4127. (this.theta = 0),
  4128. (this.enabled = !1),
  4129. (this.locked = !1),
  4130. (this.pointer = new r.Vector2(0, 0)),
  4131. (this.rotationHistory = []),
  4132. (this.rotationDifference = new r.Vector2()),
  4133. (this.pointerDragOn = !1),
  4134. (this.pointerDragStart = new r.Vector2(0, 0)),
  4135. (this.pinchDistance = 0),
  4136. (this.moveStart = new r.Vector2()),
  4137. (this.moveTolerance = 0.01),
  4138. (this.pointersLimit = 2),
  4139. (this.pointers = [])
  4140. }
  4141. var r = e('three'),
  4142. o = e('../util/logger'),
  4143. a = e('../settings'),
  4144. s = e('../util/common'),
  4145. l = e('../util/math'),
  4146. c = (e('../enum/Vectors'), e('../enum/MouseButton')),
  4147. h = e('../enum/Keys'),
  4148. u = e('../enum/ControlEvents'),
  4149. d = e('events').EventEmitter
  4150. new o(i)
  4151. ;(n.prototype = Object.create(d.prototype)),
  4152. (n.prototype.usable = function () {
  4153. return this.enabled && !this.locked
  4154. }),
  4155. /* n.prototype.lookAt = function(e) {
  4156. var t = this.camera.position.clone().sub(e)
  4157. , i = Math.atan(t.z / t.x);
  4158. i += t.x < 0 ? Math.PI : 0,
  4159. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4160. this.lon = r.Math.radToDeg(i) + 180;
  4161. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4162. , o = Math.atan(t.y / n);
  4163. this.lat = -r.Math.radToDeg(o)
  4164. }
  4165. */
  4166. (n.prototype.lookAt = function (aim, dir) {
  4167. var t = dir || this.camera.position.clone().sub(aim) //aim所指点的笛卡尔坐标系
  4168. var i = Math.atan(t.z / t.x)
  4169. i += t.x < 0 ? Math.PI : 0
  4170. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0
  4171. this.lon = r.Math.radToDeg(i) + 180
  4172. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  4173. o = Math.atan(t.y / n)
  4174. this.lat = -r.Math.radToDeg(o)
  4175. }),
  4176. (n.prototype.startRotationFrom = function (e, t) {
  4177. l.convertScreenPositionToNDC(e, t, this.pointer),
  4178. (this.pointerDragOn = !0),
  4179. this.pointerDragStart.copy(this.pointer),
  4180. this.moveStart.copy(this.pointer),
  4181. (this.rotationHistory = []),
  4182. this.rotationSpeed.set(0, 0)
  4183. }),
  4184. (n.prototype.onMouseOver = function (e) {
  4185. !this.pointerDragOn || (0 !== e.which && 0 !== e.buttons) || this.onMouseUp(e)
  4186. }),
  4187. (n.prototype.onTouchStart = function (e) {
  4188. if (this.usable()) {
  4189. switch ((e.preventDefault(), e.stopPropagation(), e.touches.length)) {
  4190. case 1:
  4191. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY)
  4192. break
  4193. case 2:
  4194. var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width(),
  4195. i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height()
  4196. this.pinchDistance = Math.sqrt(t * t + i * i)
  4197. }
  4198. this.emit(u.InputStart, 'touch')
  4199. }
  4200. }),
  4201. (n.prototype.onPointerDown = function (e) {
  4202. this.usable() &&
  4203. 'touch' === e.pointerType &&
  4204. (this.pointers.length < this.pointersLimit &&
  4205. this.pointers.push({
  4206. id: e.pointerId,
  4207. clientX: e.clientX,
  4208. clientY: e.clientY
  4209. }),
  4210. (e.touches = this.pointers),
  4211. this.onTouchStart(e),
  4212. this.emit(u.InputStart, 'pointer'))
  4213. }),
  4214. (n.prototype.onMouseDown = function (e) {
  4215. if (this.usable()) {
  4216. switch ((e.preventDefault(), e.stopPropagation(), e.button)) {
  4217. case c.LEFT:
  4218. this.startRotationFrom(e.clientX, e.clientY)
  4219. }
  4220. SoundManager.pause('tour', true) // zeg 点击场景时停止语音
  4221. this.emit(u.InputStart, 'mouse')
  4222. }
  4223. }),
  4224. (n.prototype.updateRotation = function () {
  4225. if (this.usable() && this.pointerDragOn) {
  4226. var e = new r.Vector3(this.pointerDragStart.x, this.pointerDragStart.y, -1).unproject(this.camera),
  4227. t = new r.Vector3(this.pointer.x, this.pointer.y, -1).unproject(this.camera),
  4228. i = Math.sqrt(e.x * e.x + e.z * e.z),
  4229. n = Math.sqrt(t.x * t.x + t.z * t.z),
  4230. o = Math.atan2(e.y, i),
  4231. a = Math.atan2(t.y, n)
  4232. ;(this.rotationDifference.y = r.Math.radToDeg(o - a)), (e.y = 0), (t.y = 0)
  4233. var s = Math.acos(e.dot(t) / e.length() / t.length())
  4234. isNaN(s) || ((this.rotationDifference.x = r.Math.radToDeg(s)), this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)), this.pointerDragStart.copy(this.pointer)
  4235. }
  4236. }),
  4237. (n.prototype.onMouseMove = function (e) {
  4238. this.usable() &&
  4239. (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4240. this.pointerDragOn &&
  4241. (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) &&
  4242. this.emit(u.Move, 'mouse'))
  4243. }),
  4244. (n.prototype.onTouchMove = function (e) {
  4245. if (this.usable())
  4246. switch ((this.emit(u.Move, 'touch'), e.touches.length)) {
  4247. case 1:
  4248. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer)
  4249. break
  4250. case 2:
  4251. var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width(),
  4252. i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height(),
  4253. n = this.pinchDistance - Math.sqrt(t * t + i * i)
  4254. Math.abs(n) > 0.01 && (this.emit(u.InteractionDirect), this.emit(u.Pinch, n), (this.pinchDistance -= n))
  4255. }
  4256. }),
  4257. (n.prototype.onPointerMove = function (e) {
  4258. this.usable() &&
  4259. 'touch' === e.pointerType &&
  4260. (this.pointers.forEach(function (t) {
  4261. e.pointerId === t.id && ((t.clientX = e.clientX), (t.clientY = e.clientY))
  4262. }),
  4263. (e.touches = this.pointers),
  4264. this.onTouchMove(e))
  4265. }),
  4266. (n.prototype.endRotation = function () {
  4267. this.pointerDragOn = !1
  4268. var e = s.averageVectors(this.rotationHistory)
  4269. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4270. }),
  4271. (n.prototype.onTouchEnd = function (e) {
  4272. this.usable() && (e.preventDefault(), e.stopPropagation(), this.endRotation())
  4273. }),
  4274. (n.prototype.onMouseUp = function (e) {
  4275. //if(window.vrEnabled && !browser.isMobile() )return //xzw add
  4276. this.usable() && (e.preventDefault(), e.stopPropagation(), this.endRotation())
  4277. }),
  4278. (n.prototype.onPointerUp = function (e) {
  4279. this.usable() &&
  4280. 'touch' === e.pointerType &&
  4281. (this.pointers.forEach(
  4282. function (t, i) {
  4283. e.pointerId === t.id && this.pointers.splice(i, 1)
  4284. }.bind(this)
  4285. ),
  4286. (e.touches = this.pointers),
  4287. this.onTouchEnd(e))
  4288. }),
  4289. /* n.prototype.getLimitAngleAtPano = function(defaultAngle, pano){
  4290. let limitUpAtPano = a.upDownAngleLimitPanos?.[pano.id]
  4291. let insideLookLimitUp = limitUpAtPano?.up != void 0 ? limitUpAtPano?.up : defaultAngle
  4292. return insideLookLimitUp
  4293. } */
  4294. (n.prototype.update = function (e) {
  4295. this.lon, this.lat
  4296. for (this.updateRotation(), this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; ) this.rotationHistory.shift()
  4297. ;(this.lon += this.rotationDifference.x), (this.lat += this.rotationDifference.y), this.rotationDifference.set(0, 0)
  4298. //改
  4299. var friction = Math.min(1, a.rotationFriction * e * 60) //如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  4300. ;(this.rotationSpeed.x = this.rotationSpeed.x * (1 - friction) + this.rotationAcc.x * a.rotationAccelerationInside),
  4301. (this.rotationSpeed.y = this.rotationSpeed.y * (1 - friction) + this.rotationAcc.y * a.rotationAccelerationInside),
  4302. (this.lon += this.rotationSpeed.x * e),
  4303. (this.lat += this.rotationSpeed.y * e)
  4304. let insideLookLimitDown = this.insideLookLimitDown != void 0 ? this.insideLookLimitDown : a.insideLookLimitDown
  4305. let insideLookLimitUp = this.insideLookLimitUp != void 0 ? this.insideLookLimitUp : a.insideLookLimitUp
  4306. /* insideLookLimitUp = this.getLimitAngleAtPano(insideLookLimitUp, player.currentPano)
  4307. if(player.flying && player.nextPano){//过渡渐变
  4308. let insideLookLimitUp2 = this.getLimitAngleAtPano(insideLookLimitUp, player.nextPano)
  4309. if(insideLookLimitUp2 != insideLookLimitUp){
  4310. let object = transitions.funcs.find(e=>e.name == 'camFly')
  4311. if(object){
  4312. let r = object.current / object.duration
  4313. insideLookLimitUp = math.linearClamp(r,[0,1],[insideLookLimitUp,insideLookLimitUp2])
  4314. }else{
  4315. console.error('?????????????')
  4316. //insideLookLimitUp = insideLookLimitUp2
  4317. }
  4318. }
  4319. } */
  4320. insideLookLimitDown = insideLookLimitDown - a.insideFOV / 2 + this.camera.fov / 2
  4321. insideLookLimitUp = insideLookLimitUp + a.insideFOV / 2 - this.camera.fov / 2
  4322. 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 );
  4323. ;(this.phi = r.Math.degToRad(90 - this.lat)),
  4324. (this.theta = r.Math.degToRad(this.lon)),
  4325. (this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta)),
  4326. (this.lookVector.y = Math.cos(this.phi)),
  4327. (this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta)),
  4328. this.target.copy(this.lookVector).add(this.camera.position),
  4329. this.camera.lookAt(this.target)
  4330. }),
  4331. (n.prototype.onMouseWheel = function (e) {
  4332. if (this.usable()) {
  4333. var t = e.wheelDelta || -e.detail
  4334. this.emit(u.InteractionDirect), this.emit(u.Scroll, t)
  4335. }
  4336. }),
  4337. (n.prototype.onKeyDown = function (e) {
  4338. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(), this.handleKeyDown(e.which)))
  4339. }),
  4340. (n.prototype.handleKeyDown = function (e) {
  4341. var t = function (e, t) {
  4342. this.rotationAcc[e] = t
  4343. }.bind(this)
  4344. this.emit(u.InteractionKey)
  4345. var i = !0
  4346. switch (e) {
  4347. case h.LEFTARROW:
  4348. case h.J:
  4349. t('x', -1)
  4350. break
  4351. case h.RIGHTARROW:
  4352. case h.L:
  4353. t('x', 1)
  4354. break
  4355. case h.I:
  4356. t('y', 1)
  4357. break
  4358. case h.K:
  4359. t('y', -1)
  4360. break
  4361. default:
  4362. i = !1
  4363. }
  4364. i && this.emit(u.Move, 'key')
  4365. }),
  4366. (n.prototype.onKeyUp = function (e) {
  4367. this.usable() && (e.preventDefault(), e.stopPropagation(), this.handleKeyUp(e.which))
  4368. }),
  4369. (n.prototype.handleKeyUp = function (e) {
  4370. switch (e) {
  4371. case h.LEFTARROW:
  4372. case h.J:
  4373. case h.RIGHTARROW:
  4374. case h.L:
  4375. this.rotationAcc.x = 0
  4376. break
  4377. case h.I:
  4378. case h.K:
  4379. this.rotationAcc.y = 0
  4380. }
  4381. }),
  4382. (n.prototype.startRotating = function (e, t) {
  4383. e && (this.rotationAcc.x = e), t && (this.rotationAcc.y = t)
  4384. }),
  4385. (n.prototype.stopRotating = function (e) {
  4386. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0), this.rotationAcc.set(0, 0)
  4387. }),
  4388. (n.prototype.reset = function () {
  4389. ;(this.pointerDragOn = !1), this.rotationAcc.set(0, 0), this.rotationSpeed.set(0, 0), (this.pointers = [])
  4390. }),
  4391. (n.prototype.toJSON = function () {
  4392. var e = {
  4393. camera_position: {
  4394. x: l.toPrecision(this.camera.position.x, 4),
  4395. y: l.toPrecision(this.camera.position.y, 4),
  4396. z: l.toPrecision(this.camera.position.z, 4)
  4397. },
  4398. camera_quaternion: {
  4399. x: l.toPrecision(this.camera.quaternion.x, 4),
  4400. y: l.toPrecision(this.camera.quaternion.y, 4),
  4401. z: l.toPrecision(this.camera.quaternion.z, 4),
  4402. w: l.toPrecision(this.camera.quaternion.w, 4)
  4403. }
  4404. }
  4405. return e
  4406. }),
  4407. (n.prototype.setStateFromJSON = function (e) {
  4408. this.camera.position.copy(e.camera_position), this.camera.quaternion.copy(e.camera_quaternion)
  4409. }),
  4410. (t.exports = n)
  4411. }).call(this, '/js/controls/PanoramaControls.js')
  4412. },
  4413. {
  4414. '../enum/ControlEvents': 21,
  4415. '../enum/Keys': 30,
  4416. '../enum/MouseButton': 34,
  4417. '../enum/Vectors': 50,
  4418. '../settings': 166,
  4419. '../util/common': 185,
  4420. '../util/logger': 189,
  4421. '../util/math': 190,
  4422. events: 202,
  4423. three: 217
  4424. }
  4425. ],
  4426. 14: [
  4427. function (e, t, i) {
  4428. ;(function (i) {
  4429. 'use strict'
  4430. var n = e('three'),
  4431. r = e('../enum/Viewmode'),
  4432. o = e('../util/logger'),
  4433. a = new o(i)
  4434. t.exports = {
  4435. serialize: function (e) {
  4436. return encodeURI(JSON.stringify(e))
  4437. },
  4438. deserialize: function (e) {
  4439. function t(e) {
  4440. function t(e, t) {
  4441. return e && 'number' == typeof t && !isNaN(t)
  4442. }
  4443. return e.reduce(t, !0)
  4444. }
  4445. try {
  4446. var i = JSON.parse(decodeURI(e)),
  4447. o = {
  4448. mode: r.fromInt(i.camera_mode),
  4449. panoId: i.scan_id,
  4450. position: new n.Vector3().copy(i.camera_position),
  4451. quaternion: new n.Quaternion().copy(i.camera_quaternion),
  4452. zoom: i.ortho_zoom,
  4453. floorVisibility: i.floor_visibility
  4454. },
  4455. s = o.position
  4456. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0)
  4457. var l = o.quaternion
  4458. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1), o
  4459. } catch (i) {
  4460. a.debug('Not able to parse start location as JSON; falling back to old array style parsing')
  4461. try {
  4462. var c = e.split(','),
  4463. h = {
  4464. x: parseFloat(c[2]),
  4465. y: parseFloat(c[3]),
  4466. z: parseFloat(c[4])
  4467. },
  4468. u = {
  4469. x: parseFloat(c[5]),
  4470. y: parseFloat(c[6]),
  4471. z: parseFloat(c[7]),
  4472. w: parseFloat(c[8])
  4473. }
  4474. return (
  4475. t([h.x, h.y, h.z]) || ((h.x = 0), (h.y = 0), (h.z = 0)),
  4476. t([u.x, u.y, u.z, u.w]) || ((u.x = 0), (u.y = 0), (u.z = 0), (u.w = 1)),
  4477. {
  4478. mode: r.fromInt(c[0]),
  4479. panoId: c[1],
  4480. position: new n.Vector3().copy(h),
  4481. quaternion: new n.Quaternion().copy(u)
  4482. }
  4483. )
  4484. } catch (t) {
  4485. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4486. }
  4487. }
  4488. return null
  4489. }
  4490. }
  4491. }).call(this, '/js/controls/serializer.js')
  4492. },
  4493. {
  4494. '../enum/Viewmode': 51,
  4495. '../util/logger': 189,
  4496. three: 217
  4497. }
  4498. ],
  4499. 15: [
  4500. function (e, t, i) {
  4501. ;(function (i) {
  4502. 'use strict'
  4503. function n() {
  4504. ;(this.endlessLoop = a.warp.loop),
  4505. (this.clock = new r.Clock(!0)),
  4506. (this.model = null),
  4507. (this.player = null),
  4508. (this.currentItem = null),
  4509. (this.destinationItem = null),
  4510. (this.tourIsPlaying = !1),
  4511. (this.transitionStage = y.None),
  4512. (this.nextFunc = null),
  4513. (this.onTheBus = !1),
  4514. (this.tourInProgress = !1),
  4515. (this.reachSource = null),
  4516. (this.interrupted = !1),
  4517. (this.nItems = 0),
  4518. (this.walkingSectionPaused = !1)
  4519. }
  4520. var r = e('three'),
  4521. o = e('./util/logger'),
  4522. a = e('./settings'),
  4523. s = e('./util/transitions'),
  4524. l = e('events').EventEmitter,
  4525. c = e('./enum/Viewmode'),
  4526. h = e('./analytics'),
  4527. u = e('./enum/WarpStyle'),
  4528. s = e('./util/transitions'),
  4529. d = (e('./model/ModelManager'), e('./enum/ModelManagerEvents')),
  4530. p = e('./enum/DirectorEvents'),
  4531. f = e('./enum/PlayerEvents'),
  4532. g = (e('./enum/ControlEvents'), e('./enum/BlackoutStyle')),
  4533. m = e('./enum/PathDiscardMode'),
  4534. v = e('./enum/PathDisplayMode'),
  4535. A = (e('./player'), new o(i)),
  4536. y = Object.freeze({
  4537. None: 0,
  4538. Moving: 1,
  4539. Aiming: 2,
  4540. Interlude: 3
  4541. }),
  4542. C = Object.freeze({
  4543. Forward: 1,
  4544. NoChange: 0,
  4545. Backwards: -1
  4546. }),
  4547. I = s.getUniqueId()
  4548. ;(n.prototype = Object.create(l.prototype)),
  4549. (n.prototype.init = function (e, t) {
  4550. ;(this.player = e), (this.modelManager = t), this.updateModel(), this.resetAll(), this.bindEvents()
  4551. // // zeg 查询pano对应的导览片段
  4552. // if(!this.panoIdMap) {
  4553. // this.panoIdMap = new Map()
  4554. // this.model.heroLocations.forEach( (value, index) => {
  4555. // // value.heroLocations.forEach( hl => {
  4556. // if(!value.heroLocations) return
  4557. // let hl = value.heroLocations[0]
  4558. // let arr = this.panoIdMap.get(hl.panoId)
  4559. // if(arr){
  4560. // this.panoIdMap.set(hl.panoId, [...arr, index])
  4561. // } else {
  4562. // this.panoIdMap.set(hl.panoId, [index])
  4563. // }
  4564. // // })
  4565. // })
  4566. // }
  4567. }),
  4568. (n.prototype.resetAll = function () {
  4569. if (
  4570. ((this.currentItem = null),
  4571. (this.destinationItem = null),
  4572. (this.tourIsPlaying = !1),
  4573. //this.bgmReplay(),//xzw
  4574. (this.transitionStage = y.None),
  4575. (this.nextFunc = null),
  4576. (this.onTheBus = !1),
  4577. (this.reachSource = null),
  4578. (this.interrupted = !1),
  4579. this.model)
  4580. ) {
  4581. var e = a.path.typ === u.WALK ? u.WALK : u.STD
  4582. this.defaultWarpStyle = this.model.data.hasOwnProperty('player_options') && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4583. } else (this.defaultWarpStyle = u.BLACK), A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions')
  4584. this.resetSpecialTransition()
  4585. }),
  4586. (n.prototype.updateModel = function () {
  4587. ;(this.model = this.modelManager.getActiveModel()), (this.nItems = this.model.heroLocations.length)
  4588. }),
  4589. (n.prototype.bindEvents = function () {
  4590. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4591. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4592. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4593. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4594. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4595. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4596. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4597. this.player.once(f.Move, function () {
  4598. s.cancelById(I)
  4599. })
  4600. }),
  4601. (n.prototype.checkAndHandleWalkingtourInterruption = function (e) {
  4602. //快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
  4603. return /* e === u.WALK && ( */ this.interrupt(g.NONE), this.pauseWalkingSection(), this.player.fastForwardActivePanoFlight(), !0 /* ) */
  4604. }),
  4605. (n.prototype.handlePlayerMove = function (e) {
  4606. this.transitionStage === y.Interlude && this.interrupt(g.NONE), this.emit('update.controls')
  4607. }),
  4608. (n.prototype.handlePlayerPanoChosen = function (e, t) {
  4609. this.intermediateState() || e.id === t.id || ((this.onTheBus = !1), this.emit('update.controls'))
  4610. }),
  4611. (n.prototype.handlePlayerModeChanged = function (e, t) {
  4612. this.intermediateState() || e === t || ((this.onTheBus = !1), this.emit('update.controls'))
  4613. }),
  4614. (n.prototype.handlePlayerInputStart = function (e) {
  4615. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4616. }),
  4617. (n.prototype.handlePlayerFlyingStarted = function () {
  4618. this.clearWalkingSectionPaused()
  4619. }),
  4620. (n.prototype.describe = function () {
  4621. return {
  4622. nItems: this.nItems,
  4623. currentItem: this.currentItem,
  4624. destinationItem: this.destinationItem,
  4625. tourIsPlaying: this.tourIsPlaying,
  4626. onTheBus: this.onTheBus,
  4627. endlessLoop: this.endlessLoop,
  4628. viewMode: this.player.mode,
  4629. inTransition: this._inTransition(),
  4630. transitionStage: this.transitionStage,
  4631. tourInProgress: this.tourInProgress
  4632. }
  4633. }),
  4634. (n.prototype._inTransition = function () {
  4635. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4636. }),
  4637. (n.prototype.bounceable = function () {
  4638. var e = this.clock.getDelta()
  4639. return this.isInterrupted() || (e < 0.9 && e > 0.01) || (this.player.flying && !this.player.isWarping())
  4640. }),
  4641. (n.prototype.itemCompare = function (item1, item2, type) {
  4642. //add
  4643. if (type == 'equal') {
  4644. //==
  4645. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4646. } else if (type == 'less') {
  4647. //<
  4648. return (item1 && item2 && item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4649. }
  4650. })
  4651. ;(n.prototype.currentMoveDirection = function () {
  4652. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4653. return null === this.currentItem || void 0 === this.currentItem
  4654. ? y.Forward
  4655. : this.itemCompare(this.destinationItem, this.currentItem, 'equal')
  4656. ? y.NoChange
  4657. : this.itemCompare(this.currentItem, this.destinationItem, 'less')
  4658. ? y.Forward
  4659. : y.Backwards
  4660. }),
  4661. (n.prototype.clearPath = function () {
  4662. this._inTransition() || this.player.path.discardPathObject()
  4663. }),
  4664. (n.prototype.allFloors = function () {
  4665. this.model.toggleAllFloors()
  4666. }),
  4667. (n.prototype.actionComplete = function (e) {
  4668. if (
  4669. ((this.interrupted = !1),
  4670. (this.transitionStage = y.None),
  4671. this.resetSpecialTransition(),
  4672. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4673. this.tourIsPlaying || (this.player.disablePreRendering(), this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4674. this.emit('update.controls'),
  4675. this.nextFunc)
  4676. ) {
  4677. var t = this.nextFunc
  4678. ;(this.nextFunc = null), t()
  4679. }
  4680. }),
  4681. (n.prototype.awaitCompletion = function (e, t) {
  4682. ;(this.nextFunc = t), e()
  4683. }),
  4684. (n.prototype.updateSuccessFunction = function (e) {
  4685. this.nextFunc = e
  4686. }),
  4687. (n.prototype.interrupt = function (e, t) {
  4688. //滑动屏幕或按下键盘等
  4689. return (
  4690. !!this.wouldInterrupt() &&
  4691. (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4692. (this.tourIsPlaying = !1),
  4693. //this.bgmReplay(),//xzw
  4694. (this.interrupted = !0),
  4695. (this.nextFunc = null),
  4696. this.emit(p.ActionInterrupted),
  4697. (null !== e && void 0 !== e) || (e = g.BEGINNING),
  4698. this.player.interruptAndFastForward(e, t),
  4699. !0)
  4700. )
  4701. }),
  4702. (n.prototype.wouldInterrupt = function () {
  4703. return this.transitionStage !== y.None
  4704. }),
  4705. (n.prototype.intermediateState = function () {
  4706. return this.transitionStage !== y.None
  4707. }),
  4708. (n.prototype.isInterrupted = function () {
  4709. return this.interrupted
  4710. }),
  4711. (n.prototype.pauseWalkingSection = function () {
  4712. this.walkingSectionPaused = !0
  4713. }),
  4714. (n.prototype.clearWalkingSectionPaused = function () {
  4715. this.walkingSectionPaused = !1
  4716. }),
  4717. (n.prototype.autoTour = function () {
  4718. var e = Date.now()
  4719. this.model.auxDataPromise.then(
  4720. function () {
  4721. e = Date.now() - e
  4722. var t = a.warp.auto,
  4723. i = this.model.data && this.model.data.player_options /* && this.model.data.player_options.highlight_reel */
  4724. t >= 0 &&
  4725. this.model.heroCount() > 1 &&
  4726. i &&
  4727. s.trigger({
  4728. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  4729. done: function () {
  4730. this.playTour()
  4731. }.bind(this),
  4732. name: '_atr',
  4733. id: I
  4734. })
  4735. }.bind(this)
  4736. )
  4737. }),
  4738. (n.prototype.atDestinationPano = function (pano) {
  4739. if (null === this.destinationItem) return !1
  4740. pano = pano || this.player.currentPano
  4741. if (!pano) {
  4742. return !1
  4743. }
  4744. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4745. return destination && destination.panoId == pano.id
  4746. }),
  4747. (n.prototype.redirectToItem = function (e, t) {
  4748. if (null === e || void 0 === e) return void A.warn('Director.redirectToItem() -> Redirecting to null item.')
  4749. if (!this.wouldInterrupt()) return void A.warn('Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.')
  4750. if (this.player.mode === c.TRANSITIONING) return void A.debug('Director.redirectToItem() -> Cannot redirect while transitioning.')
  4751. A.debug('Director.redirectToItem() -> Redirecting to ' + e + ' via ' + t)
  4752. var i = function () {
  4753. s.setTimeout(
  4754. function () {
  4755. this.setDestinationItem(e), this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  4756. }.bind(this),
  4757. 0
  4758. )
  4759. }.bind(this)
  4760. this.interrupt(g.END, 0), this.updateSuccessFunction(i)
  4761. }),
  4762. (n.prototype.useSpecialTransition = function (e) {
  4763. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug('useSpecialTransition(): ' + e), (this.nextWarpStyle = u.BLACK)
  4764. }),
  4765. (n.prototype.resetSpecialTransition = function () {
  4766. this.nextWarpStyle = this.defaultWarpStyle
  4767. }),
  4768. (n.prototype.arrivedAtDestination = function (e) {
  4769. if (this.player.flying || this.player.isWarping()) A.warn('Cannot advance to interlude or aiming while player is flying or warping.')
  4770. else {
  4771. this.transitionStage = y.Aiming
  4772. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null
  4773. this.player.model.fadePanoMarkers(0),
  4774. this.awaitCompletion(
  4775. function () {
  4776. this.resetSpecialTransition(), e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4777. }.bind(this),
  4778. t
  4779. )
  4780. }
  4781. }),
  4782. (n.prototype.goToDestination = function (e, t, i, n) {
  4783. //音频
  4784. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  4785. // zeg 手动导览不播放音频
  4786. if (musicInfo && musicInfo.music && !e) {
  4787. let musicType = localStorage.getItem('xunirole') || 'male'
  4788. let isMale = musicType.indexOf('female') < 0
  4789. let fixMusic = isMale ? musicInfo.music : musicInfo.fmusic || musicInfo.music
  4790. // let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4791. let src = fixMusic
  4792. let audioObj = SoundManager.list.find(e => e.name == 'tour')
  4793. let audioSrc1 = common.getFileNameFromUrl(audioObj.src)
  4794. let audioSrc2 = common.getFileNameFromUrl(src)
  4795. if (audioSrc1 == audioSrc2) {
  4796. //应该是继续播放该folder
  4797. if (this.destinationItem[1] == 0) {
  4798. //从头开始播放 因为可能暂停后然后再点该缩略图播
  4799. SoundManager.play('tour', null, 0) // currentTime = 0;
  4800. } else if (audioObj.audio.paused && audioObj.audio.currentTime < audioObj.audio.duration) {
  4801. //未播完
  4802. SoundManager.play('tour') //继续播。为什么会有暂停的情况?如果手动切换到bgm了呢?
  4803. }
  4804. } else {
  4805. //很可能是该folder的起始
  4806. SoundManager.play('tour', manage.dealURL(src))
  4807. }
  4808. }
  4809. let oldPos = this.player.position.clone()
  4810. let oldPano = this.player.currentPano
  4811. if (((this.onTheBus = !0), this.emit('update.controls'), this.player.updateLastView(), !n && this.atDestinationPano())) {
  4812. /*
  4813. // 原地旋转时, 写到_warpCameraAim里,因那有时间
  4814. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4815. if(r.zoom && r.zoom != this.player.zoomLevel){//add
  4816. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  4817. } */
  4818. return void this.arrivedAtDestination(!0)
  4819. }
  4820. if (this.player.flying || this.player.isWarping()) A.warn('Cannot go to new destination while player is flying or warping.')
  4821. else {
  4822. var r = this.model.getHeroDescriptorByIndex(this.destinationItem),
  4823. o = null,
  4824. a1 = null
  4825. if (r.isPano()) {
  4826. //var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  4827. //var walk = window.DATA.black ? 'black' : 'walk';
  4828. //若是点击item,直接瞬间过渡。
  4829. var s = e ? 'black' : this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
  4830. if (this.destinationItem[0] == 0 && this.destinationItem[1] == 0)
  4831. s = 'black' // 周恩光加 返回最初导览点是瞬间过渡
  4832. ;(a1 = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, true, i, this.actionComplete.bind(this))),
  4833. (o = this.arrivedAtDestination.bind(this, !0))
  4834. if (s == 'black' && r.zoom && r.zoom != this.player.zoomLevel) {
  4835. //add
  4836. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  4837. }
  4838. } else {
  4839. ;(a1 = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this))), (o = this.arrivedAtDestination.bind(this, !1))
  4840. }
  4841. ;(this.transitionStage = y.Moving),
  4842. this.model.fadePanoMarkers(0),
  4843. this.awaitCompletion(
  4844. function () {
  4845. a1()
  4846. }.bind(this),
  4847. o
  4848. ),
  4849. this.emit('update.controls')
  4850. }
  4851. }),
  4852. (n.prototype.tourInterlude = function () {
  4853. if (
  4854. (h.trackAlways('reach_highlight', {
  4855. reach_source: this.reachSource
  4856. }),
  4857. this.model.fadePanoMarkers(0),
  4858. this.emit('update.controls'),
  4859. this.tourIsPlaying)
  4860. )
  4861. return this.atEndOfTour() && !this.endlessLoop
  4862. ? ((this.tourInProgress = !1),
  4863. void this.awaitCompletion(
  4864. function () {
  4865. ;(this.transitionStage = y.Interlude), this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4866. }.bind(this),
  4867. function () {
  4868. ;(this.currentItem = [0, 0]), this.stopTour(true), this.emit(p.TourEnd)
  4869. }.bind(this)
  4870. ),
  4871. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity)))
  4872. : void this.awaitCompletion(
  4873. function () {
  4874. ;(this.transitionStage = y.Interlude), this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4875. }.bind(this),
  4876. this.goNext.bind(this)
  4877. )
  4878. }),
  4879. (n.prototype.findNearestItem = function (endToStart = true, searchEvery) {
  4880. //找到离currentPano最近的导览
  4881. /* if(this.atDestinationPano(this.player.currentPano)){//在终点直接从头。但有的场景可能不希望如此,就想跳到所属的展区开始。
  4882. return [0,0] //2023.7.7发现在点击item后播放会从头开始
  4883. } */
  4884. //注:没有判断此刻是否在panorama模式,就使用currentPano
  4885. var result = { item: [0, 0], dis: Infinity }
  4886. var compare = (location, item) => {
  4887. if (location.panoId != void 0 && location.panoId != 'outside') {
  4888. var pano = this.model.panos.index[location.panoId]
  4889. var dis = pano.position.distanceTo(this.player.currentPano.position)
  4890. if (dis < result.dis) {
  4891. ;(result.item = item), (result.dis = dis), (result.location = location), (result.angle = null)
  4892. } else if (dis == result.dis) {
  4893. if (this.currentItem) {
  4894. if (result.angle == void 0) {
  4895. result.angle = result.location.quaternion.angleTo(player.quaternion)
  4896. } //用角度最接近的那一个
  4897. let angle = location.quaternion.angleTo(player.quaternion)
  4898. if (angle < result.angle) {
  4899. ;(result.item = item), (result.dis = dis), (result.location = location), (result.angle = angle)
  4900. }
  4901. /* //如果两个位置相同,优先播放在导览条上离激活的最近的那段导览
  4902. let dis1 = [Math.abs(item[0] - this.currentItem[0]), Math.abs(item[1] - this.currentItem[1])] //当前差距
  4903. let dis2 = [Math.abs(result.item[0] - this.currentItem[0]), Math.abs(result.item[1] - this.currentItem[1])]
  4904. if( this.itemCompare(dis1, dis2, 'less')){
  4905. result.item = item, result.dis = dis
  4906. } */
  4907. }
  4908. }
  4909. }
  4910. }
  4911. this.model.heroLocations.forEach((e, i) => {
  4912. if (e.heroLocations) {
  4913. if (searchEvery) {
  4914. e.heroLocations.forEach((a, j) => {
  4915. compare(a, [i, j])
  4916. })
  4917. } else {
  4918. var location = e.heroLocations.find(e => e.panoId != void 0)
  4919. location && compare(location, [i, 0]) //跳到此区域开头
  4920. }
  4921. } else {
  4922. compare(e, [i, 0])
  4923. }
  4924. })
  4925. if (endToStart && this.atEndOfTour(result.item)) {
  4926. //如果是最后一个点,直接跳到开头,否则导览开始就在终点的话不会从头开始
  4927. return [0, 0] //但注意最后是区域的话result.item是区域开头,除非站在最末最末尾的位置,上面的atDestinationPano直接返回
  4928. }
  4929. return result.item
  4930. })
  4931. n.prototype.playTour = function () {
  4932. if (!this.bounceable() && this.model.heroLocations.length) {
  4933. // ------------这部分处理逻辑目前已由playTourNearBy()取代------------------------------------
  4934. // if(!this.currentItem) this.currentItem = []
  4935. // if(this.currentItem[0] != 0 || this.destinationItem[0]!= this.nItems-1){
  4936. // // zeg 从当前pano进行自动导览
  4937. // let currentPanoDestinations = this.panoIdMap.get(this.player.currentPano.id)
  4938. // // this.model.heroLocations.forEach( (value, index) => {
  4939. // // if(value.heroLocations.find( hl => hl.panoId == this.player.currentPano.id )) {
  4940. // // currentPanoDestinations.push(index)
  4941. // // }
  4942. // // })
  4943. // if(!currentPanoDestinations) {
  4944. // // let panoIndex = this.model.panos.list.findIndex( pano => pano.id == this.player.currentPano.id )
  4945. // let panoIndex = this.model.panos.list.indexOf( this.player.currentPano )
  4946. // let neighbourIndex = [ panoIndex + 1, panoIndex - 1, panoIndex + 2, panoIndex - 2, panoIndex + 3, panoIndex - 3 ]
  4947. // for(var i = 0; i < neighbourIndex.length; i++) {
  4948. // currentPanoDestinations = this.panoIdMap.get(this.model.panos.list[neighbourIndex[i]]&&this.model.panos.list[neighbourIndex[i]].id)
  4949. // if(currentPanoDestinations && currentPanoDestinations[0] != 0) break
  4950. // }
  4951. // if(!currentPanoDestinations) currentPanoDestinations = [0];
  4952. // }
  4953. // if(currentPanoDestinations.indexOf(this.currentItem[0]) == -1) {
  4954. // this.currentItem[0] = currentPanoDestinations[0]
  4955. // }
  4956. // }
  4957. return this.tourIsPlaying
  4958. ? void A.info('tour is already playing')
  4959. : void (
  4960. this.wouldInterrupt() ||
  4961. (this.player.emit('tour_auto', this.defaultWarpStyle),
  4962. (this.tourInProgress = !0),
  4963. (this.reachSource = 'play'),
  4964. (this.tourIsPlaying = !0),
  4965. (this.wasZoomEnabled = this.player.zoomEnabled),
  4966. (this.player.zoomEnabled = !1),
  4967. this.resetSpecialTransition(),
  4968. this.emit('update.controls'),
  4969. this.emit(p.TourStart),
  4970. this.player.enablePreRendering(),
  4971. // this.currentItem[1] = null,
  4972. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(), this.goToDestination()) : /* this.goNext() */ (this.tourAdvance(0), this.goToDestination()))
  4973. ) //xzw: 不要直接跳到下一个点开始,从当前点开始,否则当一段区域内只有一个导览时播放会立刻跳到下一个缩略图进行。
  4974. }
  4975. }
  4976. ;(n.prototype.playTourNearBy = function () {
  4977. //就近导览
  4978. if (!this.bounceable()) {
  4979. return this.tourIsPlaying
  4980. ? void A.info('tour is already playing')
  4981. : void (
  4982. this.wouldInterrupt() ||
  4983. (this.player.emit('tour_auto', this.defaultWarpStyle),
  4984. (this.tourInProgress = !0),
  4985. (this.reachSource = 'play'),
  4986. (this.tourIsPlaying = !0),
  4987. (this.wasZoomEnabled = this.player.zoomEnabled),
  4988. (this.player.zoomEnabled = !1),
  4989. this.resetSpecialTransition(),
  4990. this.emit('update.controls'),
  4991. this.emit(p.TourStart),
  4992. this.player.enablePreRendering(),
  4993. /* this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4994. this.goToDestination()) : this.goNext())) */
  4995. this.setDestinationItem(this.findNearestItem()),
  4996. this.goToDestination())
  4997. )
  4998. }
  4999. }),
  5000. /* n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  5001. } */
  5002. (n.prototype.stopTour = function (isAutoStop) {
  5003. //停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  5004. SoundManager.pause('tour', true), // zeg 自动导览暂停时同时停止语音
  5005. this.isInterrupted() ||
  5006. (this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle)) ||
  5007. (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  5008. (this.tourIsPlaying = !1),
  5009. this.interrupt(),
  5010. this.clearWalkingSectionPaused(),
  5011. this.resetSpecialTransition(),
  5012. this.emit('update.controls'))
  5013. }),
  5014. (n.prototype.endTourProgress = function () {
  5015. ;(this.tourInProgress = !1), this.emit('update.controls'), this.emit(p.TourEnd)
  5016. }),
  5017. (n.prototype.goToHighlight = function (e) {
  5018. if (this.wouldInterrupt()) this.itemCompare(this.destinationItem, e, 'equal') ? this.interrupt() : this.redirectToItem(e, 'goToHighlight')
  5019. else {
  5020. if ((A.debug('<tour.goto ' + e + '>'), this.isInterrupted())) return
  5021. this.clearWalkingSectionPaused(), this.setDestinationItem(e), this.useSpecialTransition('Hilight')
  5022. this.goToDestination(true), //add true
  5023. h.trackAlways('reach_highlight', {
  5024. reach_source: 'thumb'
  5025. })
  5026. }
  5027. }),
  5028. (n.prototype.prevHighlight = function () {
  5029. this.bounceable() ||
  5030. (this.player.emit('tour_manual', 'prev'), this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(), (this.reachSource = 'prev'), this.goPrev()))
  5031. }),
  5032. (n.prototype.nextHighlight = function () {
  5033. this.bounceable() ||
  5034. (this.player.emit('tour_manual', 'next'), this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(), (this.reachSource = 'next'), this.goNext()))
  5035. }),
  5036. (n.prototype.changeMode = function (e) {
  5037. var t = $.Deferred(),
  5038. i = t.resolve.bind(t),
  5039. n = t.reject.bind(t)
  5040. this.emit(p.StartModeChange)
  5041. var r = function () {
  5042. return this.clearWalkingSectionPaused(), !!this.wouldInterrupt() && (this.interrupt(), !0)
  5043. }.bind(this)
  5044. if (!r()) {
  5045. switch (e) {
  5046. case c.PANORAMA:
  5047. this.player.mode === c.PANORAMA
  5048. ? this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(i).fail(n)
  5049. : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n)
  5050. break
  5051. case c.DOLLHOUSE:
  5052. case c.FLOORPLAN:
  5053. this.player
  5054. .flyToNewMode({
  5055. mode: e
  5056. })
  5057. .done(i)
  5058. .fail(n)
  5059. break
  5060. case c.OUTDOOR:
  5061. this.player.model.has360Views &&
  5062. (this.player.mode !== c.PANORAMA || (this.player.mode === c.PANORAMA && this.player.currentPano.isAligned())) &&
  5063. this.player.goToLastView(!1).done(i).fail(n)
  5064. }
  5065. return t.promise()
  5066. }
  5067. }),
  5068. (n.prototype.atEndOfTour = function (currentItem = this.currentItem) {
  5069. var end = currentItem && currentItem[0] >= this.nItems - 1
  5070. if (end) {
  5071. var heroLocations = this.model.heroLocations[this.nItems - 1].heroLocations
  5072. if (heroLocations) {
  5073. end = currentItem[1] >= heroLocations.length - 1
  5074. }
  5075. }
  5076. return end
  5077. }),
  5078. (n.prototype.firstDestination = function () {
  5079. //return 0 < this.nItems ? 0 : null
  5080. return 0 < this.nItems ? [0, 0] : null
  5081. }),
  5082. (n.prototype.finalDestination = function () {
  5083. //return 0 < this.nItems ? this.nItems - 1 : null
  5084. return 0 < this.nItems ? [this.nItems - 1, 0] : null
  5085. }),
  5086. (n.prototype.goPrev = function () {
  5087. this.tourAdvance(-1)
  5088. }),
  5089. (n.prototype.goNext = function () {
  5090. this.tourAdvance(1)
  5091. }),
  5092. (n.prototype.setDestinationItem = function (e) {
  5093. ;(this.destinationItem = e), this.emit('update.controls')
  5094. }),
  5095. (n.prototype.setCurrentItem = function (e) {
  5096. ;(this.currentItem = e), this.emit('update.controls')
  5097. }),
  5098. (n.prototype.nextItem = function (currentItem) {
  5099. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  5100. if (currentItem == void 0) return this.firstDestination()
  5101. var currentLocation = this.model.heroLocations[currentItem[0]]
  5102. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  5103. var item
  5104. if (this.currentItem[1] >= currentChildNum - 1) {
  5105. //子目录中最后一个
  5106. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  5107. } else {
  5108. item = [currentItem[0], currentItem[1] + 1]
  5109. }
  5110. if (item[0] >= this.nItems) {
  5111. item = this.firstDestination()
  5112. }
  5113. return item
  5114. //暂时不理会endlessLoop,默认为false
  5115. }),
  5116. (n.prototype.prevItem = function (currentItem) {
  5117. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  5118. if (currentItem == void 0) return this.firstDestination()
  5119. var item
  5120. var lastLocation = this.model.heroLocations[currentItem[0] - 1]
  5121. if (!lastLocation) return this.finalDestination() //[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  5122. else {
  5123. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  5124. if (this.currentItem[1] == 0) {
  5125. //子目录中第一个
  5126. return [currentItem[0] - 1, lastChildNum - 1]
  5127. } else {
  5128. return [currentItem[0], currentItem[1] - 1]
  5129. }
  5130. }
  5131. }),
  5132. (n.prototype.tourAdvance = function (e) {
  5133. //e是1或-1 或 0
  5134. A.debug('tourAdvance(' + e + ')')
  5135. if (null === this.currentItem || void 0 === this.currentItem) {
  5136. this.setDestinationItem(this.firstDestination())
  5137. // this.setDestinationItem([currentPanoDestinations[0], 0])
  5138. } else {
  5139. var item = this.currentItem
  5140. if (e == 1) {
  5141. item = this.nextItem(this.currentItem)
  5142. } else if (e == -1) {
  5143. item = this.prevItem(this.currentItem)
  5144. }
  5145. this.setDestinationItem(item)
  5146. }
  5147. if (this.itemCompare(this.destinationItem, this.finalDestination(), 'equal') /* [0] < 0 */) {
  5148. this.useSpecialTransition('reverse-looping to end')
  5149. } else if (this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')) {
  5150. this.useSpecialTransition('looping back to start')
  5151. }
  5152. /* var momentTour = this.getMomentTour(this.destinationItem);
  5153. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5154. var zoomLevel = this.player.zoomLevel;
  5155. this.player.zoomEnabled = true;
  5156. var zoom = function(e, d) {
  5157. this.player.zoomTo((1-e)*zoomLevel, true)
  5158. }.bind(this)
  5159. s.start(zoom, 1500, function(){
  5160. }, 0, d.easeOutQuad, "zoom")
  5161. } */
  5162. this.goToDestination()
  5163. }),
  5164. (n.prototype.getMomentTour = function (destinationItem) {
  5165. //add
  5166. var wholeMomentTour = window.DATA.momentTour || 'walk' //最外层 还有一种是'std'
  5167. if (!destinationItem) return wholeMomentTour
  5168. else {
  5169. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem) //最内层。 如果有使用最内层
  5170. if (currentLocation.momentTour) return currentLocation.momentTour
  5171. var currentLocation_ = this.model.heroLocations[destinationItem[0]]
  5172. return currentLocation_.momentTour || wholeMomentTour //若中间层或最内层有就使用,否则使用最外层
  5173. }
  5174. }),
  5175. (t.exports = n)
  5176. }).call(this, '/js/director.js')
  5177. },
  5178. {
  5179. './analytics': 4,
  5180. './enum/BlackoutStyle': 18,
  5181. './enum/ControlEvents': 21,
  5182. './enum/DirectorEvents': 23,
  5183. './enum/ModelManagerEvents': 33,
  5184. './enum/PathDiscardMode': 38,
  5185. './enum/PathDisplayMode': 39,
  5186. './enum/PlayerEvents': 40,
  5187. './enum/Viewmode': 51,
  5188. './enum/WarpStyle': 52,
  5189. './model/ModelManager': 140,
  5190. './player': 155,
  5191. './settings': 166,
  5192. './util/logger': 189,
  5193. './util/transitions': 195,
  5194. events: 202,
  5195. three: 217
  5196. }
  5197. ],
  5198. 16: [
  5199. function (e, t, i) {
  5200. 'use strict'
  5201. var n = e('three'),
  5202. r = e('./enum/Viewmode'),
  5203. o = (e('./settings'), e('./util/transitions')),
  5204. a = e('./enum/PlayerEvents'),
  5205. s = new n.ShaderPass(n.HorizontalBlurShader),
  5206. l = new n.ShaderPass(n.VerticalBlurShader)
  5207. l.renderToScreen = !0
  5208. var c = $('#player').width() / $('#player').height()
  5209. isNaN(c) && (c = 1)
  5210. var h = {
  5211. currentBlur: 0,
  5212. aspect: c,
  5213. blurStrength: 1,
  5214. hblurPass: s,
  5215. vblurPass: l,
  5216. fastTranMaskPass: new n.TransitionPass(),
  5217. bindEvents: function (e) {
  5218. e.on(a.ModeChanged, function (e, t) {
  5219. e === r.PANORAMA && (o.cancel(h.blur), o.cancel(h.addBlur), o.start(h.removeBlur, 500, null, 0, null, 'deblur'))
  5220. })
  5221. },
  5222. blur: function (e) {
  5223. h.currentBlur = e
  5224. var t = e * h.blurStrength
  5225. ;(l.uniforms.v.value = (t / 512) * h.aspect), (s.uniforms.h.value = t / 512)
  5226. },
  5227. addBlur: function (e) {
  5228. ;(e = Math.max(e, h.currentBlur)), h.blur(e)
  5229. },
  5230. removeBlur: function (e) {
  5231. ;(e = Math.min(1 - e, h.currentBlur)), h.blur(e)
  5232. }
  5233. }
  5234. h.blur(0), (t.exports = h)
  5235. },
  5236. {
  5237. './enum/PlayerEvents': 40,
  5238. './enum/Viewmode': 51,
  5239. './settings': 166,
  5240. './util/transitions': 195,
  5241. three: 217
  5242. }
  5243. ],
  5244. 17: [
  5245. function (e, t, i) {
  5246. 'use strict'
  5247. t.exports = {
  5248. UNKNOWN: 0,
  5249. ALIGNED: 1,
  5250. UNALIGNED: 2,
  5251. PLACED: 3
  5252. }
  5253. },
  5254. {}
  5255. ],
  5256. 18: [
  5257. function (e, t, i) {
  5258. 'use strict'
  5259. t.exports = {
  5260. NONE: 0,
  5261. MIDDLE: 1,
  5262. END: 2,
  5263. BEGINNING: 3,
  5264. FADEIN: 4
  5265. }
  5266. },
  5267. {}
  5268. ],
  5269. 19: [
  5270. function (e, t, i) {
  5271. 'use strict'
  5272. var n = e('three')
  5273. t.exports = {
  5274. newBlue: new n.Color(4967932),
  5275. altBlue: new n.Color(47355),
  5276. tagDefault: new n.Color(223357),
  5277. classicBlue: new n.Color(53759),
  5278. mpYellow: new n.Color(16502016),
  5279. mpOrange: new n.Color(16428055),
  5280. mpBlue: new n.Color(12096),
  5281. mpLtGrey: new n.Color(13751252),
  5282. mpDkGrey: new n.Color(10000019),
  5283. mpRed: new n.Color(12525854),
  5284. mpOrangeDesat: new n.Color(16764529),
  5285. mpBlueDesat: new n.Color(4034734),
  5286. mpRedDesat: new n.Color(14705505),
  5287. white: new n.Color(16777215),
  5288. black: new n.Color(0),
  5289. _desat: function (e, t) {
  5290. var i = t || 0.3,
  5291. r = new n.Color().copy(e).getHSL()
  5292. return new n.Color().setHSL(r.h, r.s * (1 - i), r.l)
  5293. },
  5294. _darken: function (e, t) {
  5295. var i = t || 0.2,
  5296. r = e.getHSL()
  5297. return new n.Color().setHSL(r.h, r.s, r.l * (1 - i))
  5298. }
  5299. }
  5300. },
  5301. {
  5302. three: 217
  5303. }
  5304. ],
  5305. 20: [
  5306. function (e, t, i) {
  5307. 'use strict'
  5308. t.exports = {
  5309. NONE: -1,
  5310. ROTATE: 0,
  5311. DOLLY: 1,
  5312. PAN: 2,
  5313. ROTATE_DOLLY: 3,
  5314. PAN_DOLLY: 4
  5315. }
  5316. },
  5317. {}
  5318. ],
  5319. 21: [
  5320. function (e, t, i) {
  5321. 'use strict'
  5322. t.exports = {
  5323. Move: 'move',
  5324. InteractionDirect: 'interaction.direct',
  5325. InteractionKey: 'interaction.key',
  5326. InteractionGui: 'interaction.gui',
  5327. FlyInDirection: 'fly.direction',
  5328. InputStart: 'input.start',
  5329. Pinch: 'input.pinch',
  5330. Scroll: 'input.scroll',
  5331. AutoPanInterrupt: 'autopan.interrupt',
  5332. AutoPanComplete: 'autopan.complete',
  5333. AutoPanClamped: 'autopan.clamped',
  5334. LongTap: 'longtap'
  5335. }
  5336. },
  5337. {}
  5338. ],
  5339. 22: [
  5340. function (e, t, i) {
  5341. 'use strict'
  5342. t.exports = Object.freeze({
  5343. FORWARD: 'FORWARD',
  5344. LEFT: 'LEFT',
  5345. RIGHT: 'RIGHT',
  5346. BACK: 'BACK',
  5347. UP: 'UP',
  5348. DOWN: 'DOWN'
  5349. })
  5350. },
  5351. {}
  5352. ],
  5353. 23: [
  5354. function (e, t, i) {
  5355. 'use strict'
  5356. t.exports = {
  5357. ActionInterrupted: 'action.interrupted',
  5358. TourStart: 'tour.start',
  5359. TourEnd: 'tour.end',
  5360. StartModeChange: 'mode.startChange'
  5361. }
  5362. },
  5363. {}
  5364. ],
  5365. 24: [
  5366. function (e, t, i) {
  5367. 'use strict'
  5368. t.exports = Object.freeze({
  5369. None: 0,
  5370. Queued: 1,
  5371. ForceQueued: 2,
  5372. Downloading: 3,
  5373. Downloaded: 4,
  5374. DownloadFailed: 5
  5375. })
  5376. },
  5377. {}
  5378. ],
  5379. 25: [
  5380. function (e, t, i) {
  5381. 'use strict'
  5382. t.exports = {
  5383. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5384. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5385. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5386. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5387. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5388. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5389. }
  5390. },
  5391. {}
  5392. ],
  5393. 26: [
  5394. function (e, t, i) {
  5395. 'use strict'
  5396. t.exports = {
  5397. Texture2D: 0,
  5398. TextureCube: 1
  5399. }
  5400. },
  5401. {}
  5402. ],
  5403. 27: [
  5404. function (e, t, i) {
  5405. 'use strict'
  5406. t.exports = {
  5407. SMALL: 'small',
  5408. LARGE: 'large'
  5409. }
  5410. },
  5411. {}
  5412. ],
  5413. 28: [
  5414. function (e, t, i) {
  5415. 'use strict'
  5416. var n = e('./Viewmode'),
  5417. r = {
  5418. LANDING: {},
  5419. NAVIGATION: 'navigation',
  5420. MORE_HELP: 'moreHelp',
  5421. TOUR_INTERACTION: {}
  5422. }
  5423. ;(r.LANDING[n.PANORAMA] = 'panorama.landing'),
  5424. (r.LANDING[n.OUTDOOR] = 'outdoor.landing'),
  5425. (r.LANDING[n.DOLLHOUSE] = 'dollhouse.landing'),
  5426. (r.LANDING[n.FLOORPLAN] = 'floorplan.landing'),
  5427. (r.TOUR_INTERACTION.standard = 'standard.tour'),
  5428. (r.TOUR_INTERACTION[n.OUTDOOR] = 'outdoor.tour'),
  5429. (r.TOUR_INTERACTION[n.FLOORPLAN] = 'floorplan.tour'),
  5430. (t.exports = r)
  5431. },
  5432. {
  5433. './Viewmode': 51
  5434. }
  5435. ],
  5436. 29: [
  5437. function (e, t, i) {
  5438. 'use strict'
  5439. var n = {
  5440. UP: 1,
  5441. DOWN: -1,
  5442. LEFT: 'L',
  5443. RIGHT: 'R',
  5444. FORWARD: 'F',
  5445. BACK: 'B',
  5446. reverse: {},
  5447. opposite: function (e) {
  5448. return this.reverse[e.toString()]
  5449. }
  5450. }
  5451. !(function () {
  5452. ;(n.reverse[n.UP] = n.DOWN), (n.reverse[n.DOWN] = n.UP), (n.reverse[n.LEFT] = n.RIGHT), (n.reverse[n.RIGHT] = n.LEFT), (n.reverse[n.FORWARD] = n.BACK), (n.reverse[n.BACK] = n.FORWARD)
  5453. })(),
  5454. (t.exports = n)
  5455. },
  5456. {}
  5457. ],
  5458. 30: [
  5459. function (e, t, i) {
  5460. 'use strict'
  5461. var n = e('../util/browser'),
  5462. r = {
  5463. ZERO: 48,
  5464. ONE: 49,
  5465. TWO: 50,
  5466. THREE: 51,
  5467. FOUR: 52,
  5468. FIVE: 53,
  5469. SIX: 54,
  5470. SEVEN: 55,
  5471. EIGHT: 56,
  5472. NINE: 57,
  5473. LEFTARROW: 37,
  5474. UPARROW: 38,
  5475. RIGHTARROW: 39,
  5476. DOWNARROW: 40,
  5477. A: 65,
  5478. B: 66,
  5479. C: 67,
  5480. D: 68,
  5481. E: 69,
  5482. F: 70,
  5483. G: 71,
  5484. H: 72,
  5485. I: 73,
  5486. J: 74,
  5487. K: 75,
  5488. L: 76,
  5489. M: 77,
  5490. N: 78,
  5491. O: 79,
  5492. P: 80,
  5493. Q: 81,
  5494. R: 82,
  5495. S: 83,
  5496. T: 84,
  5497. U: 85,
  5498. V: 86,
  5499. W: 87,
  5500. X: 88,
  5501. Y: 89,
  5502. Z: 90,
  5503. SPACE: 32,
  5504. RETURN: 13,
  5505. SEMICOLON: 186,
  5506. PLUSEQUALS: 187,
  5507. DASHUNDERSCORE: 189,
  5508. OPENBRACKET: 219
  5509. }
  5510. n.detectFirefox() && ((r.SEMICOLON = 59), (r.PLUSEQUALS = 61), (r.DASHUNDERSCORE = 173)), (t.exports = r)
  5511. },
  5512. {
  5513. '../util/browser': 182
  5514. }
  5515. ],
  5516. 31: [
  5517. function (e, t, i) {
  5518. 'use strict'
  5519. t.exports = {
  5520. EN_US: 'en-US',
  5521. ES_MX: 'es-MX',
  5522. FR_FR: 'fr-FR',
  5523. DE_DE: 'de-DE',
  5524. RU_RU: 'ru-RU',
  5525. CN_CN: 'cn-CN',
  5526. JP_JP: 'jp-JP'
  5527. }
  5528. },
  5529. {}
  5530. ],
  5531. 32: [
  5532. function (e, t, i) {
  5533. 'use strict'
  5534. t.exports = {
  5535. TagActivated: 'tag.activated',
  5536. TagDismissed: 'tag.dismissed',
  5537. TagNavigation: 'tag.navigation'
  5538. }
  5539. },
  5540. {}
  5541. ],
  5542. 33: [
  5543. function (e, t, i) {
  5544. 'use strict'
  5545. t.exports = {
  5546. ModelAdded: 'model-added',
  5547. ActiveModelChanged: 'active-model-changed'
  5548. }
  5549. },
  5550. {}
  5551. ],
  5552. 34: [
  5553. function (e, t, i) {
  5554. 'use strict'
  5555. t.exports = {
  5556. LEFT: 0,
  5557. MIDDLE: 1,
  5558. RIGHT: 2
  5559. }
  5560. },
  5561. {}
  5562. ],
  5563. 35: [
  5564. function (e, t, i) {
  5565. 'use strict'
  5566. t.exports = {
  5567. PanoRenderComplete: 'panorama.render.complete',
  5568. TileRenderFailure: 'panorama.tile.render.failed',
  5569. TileRenderSuccess: 'panorama.tile.render.success',
  5570. TileUploadAttempted: 'panorama.tile.upload.attempted',
  5571. UploadAttemptedForAllTiles: 'panorama.upload.attempted.all.tiles',
  5572. ZoomLevelRenderStarted: 'panorama.zoom.render.started'
  5573. }
  5574. },
  5575. {}
  5576. ],
  5577. 36: [
  5578. function (e, t, i) {
  5579. 'use strict'
  5580. t.exports = {
  5581. BASE: 1,
  5582. STANDARD: 2,
  5583. HIGH: 3,
  5584. ULTRAHIGH: 4
  5585. }
  5586. },
  5587. {}
  5588. ],
  5589. 37: [
  5590. function (e, t, i) {
  5591. 'use strict'
  5592. t.exports = {
  5593. LoadComplete: 'panorama.load.complete',
  5594. LoadFailed: 'panorama.load.failed',
  5595. TileLoaded: 'panorama.tile.loaded'
  5596. }
  5597. },
  5598. {}
  5599. ],
  5600. 38: [
  5601. function (e, t, i) {
  5602. 'use strict'
  5603. t.exports = Object.freeze({
  5604. Standard: 0,
  5605. Slow: 1,
  5606. Retain: 2
  5607. })
  5608. },
  5609. {}
  5610. ],
  5611. 39: [
  5612. function (e, t, i) {
  5613. 'use strict'
  5614. t.exports = Object.freeze({
  5615. Show: 0,
  5616. Hide: 1,
  5617. Retain: 2
  5618. })
  5619. },
  5620. {}
  5621. ],
  5622. 40: [
  5623. function (e, t, i) {
  5624. 'use strict'
  5625. t.exports = {
  5626. Move: 'move',
  5627. MoveComplete: 'move.complete',
  5628. ModeChanged: 'mode.changed',
  5629. ModeChanging: 'mode.changing',
  5630. PanoChosen: 'pano.chosen',
  5631. ClosestPanoChanging: 'closest.pano.changing',
  5632. WarpStarted: 'warp.started',
  5633. WarpInterrupted: 'warp.interrupted',
  5634. WarpEnded: 'warp.ended',
  5635. FlyinFinished: 'flyin.finished',
  5636. FlyingStarted: 'flying.started',
  5637. FlyingInterrupted: 'flying.interrupted',
  5638. FlyingEnded: 'flying.ended',
  5639. Ready: 'ready',
  5640. StartInside: 'start.inside',
  5641. StartOutside: 'start.outside',
  5642. ViewChanged: 'view.changed',
  5643. WarpInterruptedWithFlyTo: 'warp.interrupted.flyto',
  5644. InputStart: 'input.start'
  5645. }
  5646. },
  5647. {}
  5648. ],
  5649. 41: [
  5650. function (e, t, i) {
  5651. 'use strict'
  5652. t.exports = Object.freeze({
  5653. DEFAULT: 0,
  5654. PANOMARKERS: 1,
  5655. RETICULE: 2,
  5656. TAG: 3
  5657. })
  5658. },
  5659. {}
  5660. ],
  5661. 42: [
  5662. function (e, t, i) {
  5663. 'use strict'
  5664. t.exports = {
  5665. visibleFloor: 1,
  5666. ghostFloor: 3,
  5667. boundingSkybox: 1,
  5668. panoMarker: 2,
  5669. reticule: 3,
  5670. tagStem: 4,
  5671. tagDisc: 5,
  5672. ribbon: 100
  5673. }
  5674. },
  5675. {}
  5676. ],
  5677. 43: [
  5678. function (e, t, i) {
  5679. 'use strict'
  5680. t.exports = {
  5681. ContextCreated: 'scene-renderer-context-created',
  5682. AfterRender: 'after-render',
  5683. MemoryUsageUpdated: 'scene-renderer-memory-usage-updated'
  5684. }
  5685. },
  5686. {}
  5687. ],
  5688. 44: [
  5689. function (e, t, i) {
  5690. 'use strict'
  5691. t.exports = {
  5692. IDLE: 'idle',
  5693. BROWSE: 'browse',
  5694. EXAMINE: 'examine'
  5695. }
  5696. },
  5697. {}
  5698. ],
  5699. 45: [
  5700. function (e, t, i) {
  5701. 'use strict'
  5702. t.exports = {
  5703. TileDownloadSuccess: 'tiledownloader.download.success',
  5704. TileDownloadFailure: 'tiledownloader.download.failure',
  5705. PanoDownloadComplete: 'tiledownloader.pano.download.complete'
  5706. }
  5707. },
  5708. {}
  5709. ],
  5710. 46: [
  5711. function (e, t, i) {
  5712. 'use strict'
  5713. t.exports = {
  5714. CardboardAndroid: 'googlevr',
  5715. GearVR: 'gearvr',
  5716. CardboardIOS: 'googlevrios',
  5717. Cardboard: 'googlevr'
  5718. }
  5719. },
  5720. {}
  5721. ],
  5722. 47: [
  5723. function (e, t, i) {
  5724. 'use strict'
  5725. t.exports = {
  5726. NONE: 0,
  5727. CONTEXTUAL: 1,
  5728. ANDROID: 2
  5729. }
  5730. },
  5731. {}
  5732. ],
  5733. 48: [
  5734. function (e, t, i) {
  5735. 'use strict'
  5736. var n = {
  5737. Title: 0,
  5738. Cardboard: 1
  5739. },
  5740. r = {
  5741. Title: 0,
  5742. Cardboard: 1,
  5743. Gear: 2
  5744. }
  5745. !(function () {
  5746. ;[n, r].forEach(function (e) {
  5747. e.pageCount = Object.keys(e).length
  5748. })
  5749. })(),
  5750. (t.exports.ios = n),
  5751. (t.exports.standard = r)
  5752. },
  5753. {}
  5754. ],
  5755. 49: [
  5756. function (e, t, i) {
  5757. 'use strict'
  5758. t.exports = {
  5759. Android: 'android',
  5760. IOS: 'ios',
  5761. Desktop: 'desktop',
  5762. UnsupportedAndroid: 'android-unsupported'
  5763. }
  5764. },
  5765. {}
  5766. ],
  5767. 50: [
  5768. function (e, t, i) {
  5769. 'use strict'
  5770. var n = e('three')
  5771. t.exports = {
  5772. UP: new n.Vector3(0, 1, 0),
  5773. DOWN: new n.Vector3(0, -1, 0),
  5774. LEFT: new n.Vector3(-1, 0, 0),
  5775. RIGHT: new n.Vector3(1, 0, 0),
  5776. FORWARD: new n.Vector3(0, 0, -1),
  5777. BACK: new n.Vector3(0, 0, 1)
  5778. }
  5779. },
  5780. {
  5781. three: 217
  5782. }
  5783. ],
  5784. 51: [
  5785. function (e, t, i) {
  5786. 'use strict'
  5787. var n = e('../exception/ViewmodeConvertException'),
  5788. r = e('./coreViewmodes'),
  5789. o = e('../util/common'),
  5790. a = {
  5791. MESH: 'mesh',
  5792. OUTDOOR: 'outdoor',
  5793. TRANSITIONING: 'transitioning',
  5794. toInt: function (e) {
  5795. switch (e) {
  5796. case this.PANORAMA:
  5797. return 1
  5798. case this.DOLLHOUSE:
  5799. return 2
  5800. case this.FLOORPLAN:
  5801. return 3
  5802. case this.OUTDOOR:
  5803. return 4
  5804. case this.TRANSITIONING:
  5805. return -1
  5806. }
  5807. throw new n('No known conversion for Viewmode to int for mode: ' + e)
  5808. },
  5809. fromInt: function (e) {
  5810. switch (e) {
  5811. case '1':
  5812. case 1:
  5813. return this.PANORAMA
  5814. case '2':
  5815. case 2:
  5816. return this.DOLLHOUSE
  5817. case '3':
  5818. case 3:
  5819. return this.FLOORPLAN
  5820. case '4':
  5821. case 4:
  5822. return this.OUTDOOR
  5823. }
  5824. throw new n('No known conversion for int to viewmode for int: ' + e)
  5825. },
  5826. convertWorkshopModeInt: function (e) {
  5827. switch (e) {
  5828. case '0':
  5829. case 0:
  5830. case undefined: //xzw add
  5831. return this.PANORAMA
  5832. case '1':
  5833. case 1:
  5834. return this.FLOORPLAN
  5835. case '2':
  5836. case 2:
  5837. return this.DOLLHOUSE
  5838. case '3':
  5839. case 3:
  5840. return this.MESH
  5841. }
  5842. throw new n('No known conversion for Workshop int to viewmode for int: ' + e)
  5843. }
  5844. }
  5845. o.extendObject(a, r), (t.exports = a)
  5846. },
  5847. {
  5848. '../exception/ViewmodeConvertException': 58,
  5849. '../util/common': 185,
  5850. './coreViewmodes': 54
  5851. }
  5852. ],
  5853. 52: [
  5854. function (e, t, i) {
  5855. 'use strict'
  5856. t.exports = {
  5857. BLACK: 'black',
  5858. STD: 'std',
  5859. WALK: 'walk'
  5860. }
  5861. },
  5862. {}
  5863. ],
  5864. 53: [
  5865. function (e, t, i) {
  5866. 'use strict'
  5867. t.exports = {
  5868. ZoomIn: 'zoom.in',
  5869. ZoomOut: 'zoom.out',
  5870. ZoomMax: 'zoom.max',
  5871. ZoomMin: 'zoom.min'
  5872. }
  5873. },
  5874. {}
  5875. ],
  5876. 54: [
  5877. function (e, t, i) {
  5878. 'use strict'
  5879. t.exports = {
  5880. PANORAMA: 'panorama',
  5881. DOLLHOUSE: 'dollhouse',
  5882. FLOORPLAN: 'floorplan'
  5883. }
  5884. },
  5885. {}
  5886. ],
  5887. 55: [
  5888. function (e, t, i) {
  5889. 'use strict'
  5890. function n(e) {
  5891. this.message = e
  5892. }
  5893. t.exports = n
  5894. },
  5895. {}
  5896. ],
  5897. 56: [
  5898. function (e, t, i) {
  5899. 'use strict'
  5900. function n(e) {
  5901. r.call(this, e)
  5902. }
  5903. var r = e('./BasicException')
  5904. ;(n.prototype = Object.create(r.prototype)), (t.exports = n)
  5905. },
  5906. {
  5907. './BasicException': 55
  5908. }
  5909. ],
  5910. 57: [
  5911. function (e, t, i) {
  5912. 'use strict'
  5913. function n(e) {
  5914. r.call(this, e)
  5915. }
  5916. var r = e('./BasicException')
  5917. ;(n.prototype = Object.create(r.prototype)), (t.exports = n)
  5918. },
  5919. {
  5920. './BasicException': 55
  5921. }
  5922. ],
  5923. 58: [
  5924. function (e, t, i) {
  5925. 'use strict'
  5926. function n(e) {
  5927. r.call(this, e)
  5928. }
  5929. var r = e('./BasicException')
  5930. ;(n.prototype = Object.create(r.prototype)), (t.exports = n)
  5931. },
  5932. {
  5933. './BasicException': 55
  5934. }
  5935. ],
  5936. 59: [
  5937. function (e, t, i) {
  5938. ;(function (i) {
  5939. 'use strict'
  5940. function n(e) {
  5941. var t = {}
  5942. if (e) {
  5943. var i = e.flags
  5944. if (i) for (var n in i) i.hasOwnProperty(n) && (t[i[n]] = !0)
  5945. return t
  5946. }
  5947. return l.debug('Feature flags -> parseFeatureFlags: rawData is null.'), null
  5948. }
  5949. var r = e('./util/ajax'),
  5950. o = e('./util/showcase'),
  5951. a = e('./util/logger'),
  5952. s = '',
  5953. l = new a(i),
  5954. c = {}
  5955. t.exports = {
  5956. loadFeatureFlags: function (e) {
  5957. var t = $.Deferred()
  5958. return (
  5959. r
  5960. .get(e.urlBase + s, {
  5961. responseType: 'json',
  5962. prefetchFrom: 'user',
  5963. auth: o.getAuthorizationHeader()
  5964. })
  5965. .done(function (e) {
  5966. ;(c = n(e)), c ? t.resolve(c) : t.reject('loading-failed')
  5967. })
  5968. .fail(function () {
  5969. l.debug('Retrieval of feature flags failed.'), t.reject('loading-failed')
  5970. }),
  5971. t.promise()
  5972. )
  5973. },
  5974. getFlags: function () {
  5975. return c
  5976. },
  5977. updateDependentSettings: function (e, t) {
  5978. ;(e = e || c),
  5979. e.labels && (t.labels.enabled = !0),
  5980. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5981. e.showcase_sdk && (t.sdkInit = !0),
  5982. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5983. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5984. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5985. e.hide_sc_sharing && (t.share.enabled = !1)
  5986. }
  5987. }
  5988. }).call(this, '/js/featureflags.js')
  5989. },
  5990. {
  5991. './util/ajax': 181,
  5992. './util/logger': 189,
  5993. './util/showcase': 193
  5994. }
  5995. ],
  5996. 60: [
  5997. function (e, t, i) {
  5998. 'use strict'
  5999. var n =
  6000. (e('../util/common'),
  6001. {
  6002. status: 0,
  6003. set: function (e) {
  6004. if (isNaN(e)) return !1
  6005. var t = $('.progressbar')
  6006. 0 > e && (e = 0)
  6007. e > 100 && (e = 100)
  6008. var width = parseInt(t.css('width').replace('px', '')) / 100 //获取进度条总长度除以100
  6009. var barperc = e * width
  6010. var perc = Math.round(e)
  6011. var labelpos = parseInt(barperc) - 15
  6012. t.find('.bar').css('width', barperc) //已经再跑颜色的百分比
  6013. t.find('.label').css('left', labelpos) //上面跟着的字的百分比
  6014. t.find('.perc').text(perc + '%') //具体数字的百分比
  6015. this.status = e
  6016. },
  6017. done: function (e) {
  6018. return e || this.status ? ((this.status = null), this.set(100)) : this
  6019. }
  6020. })
  6021. t.exports.circleLoader = n
  6022. },
  6023. {
  6024. '../util/common': 185
  6025. }
  6026. ],
  6027. 61: [
  6028. function (e, t, i) {
  6029. 'use strict'
  6030. t.exports = Object.freeze({
  6031. CLOSE: 'modal.closer.close'
  6032. })
  6033. },
  6034. {}
  6035. ],
  6036. 62: [
  6037. function (e, t, i) {
  6038. 'use strict'
  6039. function n(e, t) {
  6040. t && (t.stopPropagation(), t.preventDefault()), e && this.emit(l.CLOSE, e), g.reset()
  6041. }
  6042. function r(e, t) {
  6043. function i() {
  6044. var t = e.offsetHeight >= $('#player').height() && e.offsetWidth >= $('#player').width()
  6045. t !== f && ((f = t), t ? (e.classList.add('closeByFooter'), h.classList.add('closeByFooter')) : (e.classList.remove('closeByFooter'), h.classList.remove('closeByFooter')))
  6046. }
  6047. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  6048. }
  6049. var o = e('../../settings'),
  6050. a = (e('../../tag/Media/MediaEvent'), e('../../util/browser')),
  6051. s = e('../../util/common'),
  6052. l = e('./ModalCloserEvent'),
  6053. c = e('events').EventEmitter,
  6054. h = document.getElementsByClassName('footer')[0],
  6055. u = h.querySelectorAll('.close')[0],
  6056. d = null,
  6057. p = null,
  6058. f = null,
  6059. g =
  6060. (a.isMobile(),
  6061. {
  6062. open: function (e) {
  6063. e &&
  6064. (r(e),
  6065. d && u.removeEventListener('click', d, !0),
  6066. (d = n.bind(this, e.id)),
  6067. u.addEventListener('click', d, !0),
  6068. p && window.removeEventListener('resize', p, !0),
  6069. (p = r.bind(this, e)),
  6070. window.addEventListener('resize', p, !0))
  6071. },
  6072. reset: function () {
  6073. h.classList.remove('closeByFooter'), u.removeEventListener('click', d, !0), window.removeEventListener('resize', p, !0), (d = p = f = null)
  6074. }
  6075. })
  6076. s.extendObject(g, c.prototype), (t.exports = g)
  6077. },
  6078. {
  6079. '../../tag/Media/MediaEvent': 131,
  6080. '../../settings': 166,
  6081. '../../util/browser': 182,
  6082. '../../util/common': 185,
  6083. './ModalCloserEvent': 61,
  6084. events: 202
  6085. }
  6086. ],
  6087. 63: [
  6088. function (e, t, i) {
  6089. 'use strict'
  6090. function n(e, t, i) {
  6091. var n = new r.GUI({
  6092. width: 400
  6093. }),
  6094. u = n.addFolder('Flydown from Dollhouse')
  6095. u.add(h.flydown, 'movementEasing', Object.keys(a)),
  6096. u.add(h.flydown, 'movementDelay', 0, 1).step(0.01),
  6097. u.add(h.flydown, 'rotationEasing', Object.keys(a)),
  6098. u.add(h.flydown, 'rotationDelay', 0, 1).step(0.01),
  6099. u.add(h.flydown, 'modelTextureDelay', 0, 1).step(0.01),
  6100. u.add(h.flydown, 'skyboxDelay', 0, 1).step(0.01),
  6101. u.add(h.dollhouseDefault, 'minPolarAngle', 0, o.Math.degToRad(50)),
  6102. u.add(h.dollhouseDefault, 'maxPolarAngle', o.Math.degToRad(50), o.Math.degToRad(170))
  6103. var d = n.addFolder('Transition between panos')
  6104. d.add(h.transition, 'blur', 0, 10).onFinishChange(function () {}),
  6105. d
  6106. .add(h.transition, 'flySpeed', 0, 10)
  6107. .step(0.01)
  6108. .onFinishChange(function () {
  6109. ;(h.transition.flyTime = 0),
  6110. d.__controllers.forEach(function (e) {
  6111. e.updateDisplay()
  6112. })
  6113. }),
  6114. d.add(h.transition, 'flyTime', 0, 5e3).onFinishChange(function () {
  6115. ;(h.transition.flySpeed = 0),
  6116. d.__controllers.forEach(function (e) {
  6117. e.updateDisplay()
  6118. })
  6119. }),
  6120. d.add(h.transition, 'aimTime', 500, 2500).step(50),
  6121. d.add(h.transition, 'aimSlowFactor', 1, 3).step(0.1),
  6122. d.add(h.transition, 'movementEasing', Object.keys(a))
  6123. var p = n.addFolder('Path Display')
  6124. p
  6125. .add(h.path, 'opacity', 0, 1)
  6126. .step(0.01)
  6127. .onFinishChange(function () {}),
  6128. p
  6129. .add(h.path, 'height', 0, 0.2)
  6130. .step(0.01)
  6131. .onFinishChange(function () {}),
  6132. p
  6133. .add(h.path, 'outsideHeight', 0, 2)
  6134. .step(0.01)
  6135. .onFinishChange(function () {}),
  6136. p
  6137. .add(h.path, 'ribbonWidth', 0.01, 0.35)
  6138. .step(0.01)
  6139. .onFinishChange(function () {}),
  6140. p
  6141. .add(h.path, 'waypointRadius', 0.01, 1.2)
  6142. .step(0.01)
  6143. .onFinishChange(function () {}),
  6144. p
  6145. .add(h.path, 'waypointPulse', 0, 3600)
  6146. .step(20)
  6147. .onFinishChange(function () {}),
  6148. p
  6149. .add(h.path, 'waypointIndoorRadius', 0.01, 1.2)
  6150. .step(0.01)
  6151. .onFinishChange(function () {}),
  6152. p
  6153. .add(h.path, 'fadeInTime', 0, 1200)
  6154. .step(10)
  6155. .onFinishChange(function () {}),
  6156. p
  6157. .add(h.path, 'fadeOutTime', 0, 1200)
  6158. .step(10)
  6159. .onFinishChange(function () {}),
  6160. p.add(h.path, 'color', Object.keys(l)).onFinishChange(function () {
  6161. ;(h.path.color = l[h.path.color]), (h.path.colorUp = l._desat(h.path.color)), (h.path.colorDown = l.darken(h.path.color))
  6162. }),
  6163. p.add(h, 'reticuleColor', Object.keys(l)).onFinishChange(function () {
  6164. h.reticuleColor = l[h.reticuleColor]
  6165. })
  6166. var f = n.addFolder('Warping'),
  6167. g = f.addFolder('Warp/Teleport')
  6168. g.add(h.warp, 'softPushDist', 0, 2).onFinishChange(function () {}),
  6169. g
  6170. .add(h.warp, 'softPushEnd', 0, 1)
  6171. .step(0.01)
  6172. .onFinishChange(function () {}),
  6173. g.add(h.warp, 'softBendAngle', 0, 45).onFinishChange(function () {}),
  6174. g.add(h.warp, 'softBendTilt', 0, 45).onFinishChange(function () {}),
  6175. g
  6176. .add(h.warp, 'softBendEnd', 0, 1)
  6177. .step(0.01)
  6178. .onFinishChange(function () {}),
  6179. g.add(h.warp, 'burnsAngle', 0, 30).onFinishChange(function () {}),
  6180. g.add(h.warp, 'minBurnsAngle', 0, 10).onFinishChange(function () {}),
  6181. g.add(h.warp, 'brakeStrength', 1, 8).onFinishChange(function () {}),
  6182. g
  6183. .add(h.warp, 'minBrakeAngle', 0, 5)
  6184. .step(0.01)
  6185. .onFinishChange(function () {}),
  6186. g
  6187. .add(h.warp, 'maxBrakeAngle', 0, 5)
  6188. .step(0.01)
  6189. .onFinishChange(function () {}),
  6190. g.add(h.path, 'mapGuides').onFinishChange(function () {}),
  6191. g
  6192. .add(h.warp, 'teleportTime', 0, 5e3)
  6193. .step(10)
  6194. .onFinishChange(function () {}),
  6195. g
  6196. .add(h.warp, 'outsideTime', 0, 5e3)
  6197. .step(10)
  6198. .onFinishChange(function () {}),
  6199. g.add(h.path, 'typ', Object.keys(c)).onFinishChange(function () {
  6200. h.path.typ = c[h.path.typ]
  6201. }),
  6202. g
  6203. .add(h.warp, 'loop')
  6204. .onChange(function () {})
  6205. .onFinishChange(function () {
  6206. t.endlessLoop = h.warp.loop
  6207. }),
  6208. g
  6209. .add(h.warp, 'walkSlideShowThreshhold', 1, 1e4)
  6210. .step(1)
  6211. .onFinishChange(function () {}),
  6212. g
  6213. .add(h.warp, 'walkExtraPanosDistance', 0, 3)
  6214. .step(0.1)
  6215. .onFinishChange(function () {}),
  6216. g
  6217. .add(h.transition, 'fastForwardFactor', 1, 10)
  6218. .step(1)
  6219. .onFinishChange(function () {})
  6220. var m = f.addFolder('Long Warp Only')
  6221. m
  6222. .add(h.warp, 'minWarpTime', 0, 5e3)
  6223. .step(10)
  6224. .onFinishChange(function () {
  6225. ;(h.warp.flySpeed = 0),
  6226. m.__controllers.forEach(function (e) {
  6227. e.updateDisplay()
  6228. })
  6229. }),
  6230. m
  6231. .add(h.warp, 'timePerMeter', 0, 5e3)
  6232. .step(10)
  6233. .onFinishChange(function () {}),
  6234. m
  6235. .add(h.warp, 'lookAheadMax', 0.01, 1)
  6236. .step(0.01)
  6237. .onFinishChange(function () {}),
  6238. m
  6239. .add(h.warp, 'lookAheadDist', 0.01, 4)
  6240. .step(0.01)
  6241. .onFinishChange(function () {}),
  6242. m
  6243. .add(h.warp, 'maxTurnPerSec', 0, 720)
  6244. .step(1)
  6245. .onFinishChange(function () {}),
  6246. m
  6247. .add(h.warp, 'maxAimPerSec', 0, 720)
  6248. .step(1)
  6249. .onFinishChange(function () {}),
  6250. m
  6251. .add(h.warp, 'turnFriction', 0, 1)
  6252. .step(0.01)
  6253. .onFinishChange(function () {}),
  6254. m
  6255. .add(h.warp, 'walkDelay', 0, 2e3)
  6256. .step(10)
  6257. .onFinishChange(function () {}),
  6258. m
  6259. .add(h.transition, 'flytimeMaxDistanceThreshold', 0, 25)
  6260. .step(10)
  6261. .onFinishChange(function () {}),
  6262. m
  6263. .add(h.warp, 'walkMaxDist', 0, 100)
  6264. .step(1)
  6265. .onFinishChange(function () {})
  6266. var v = n.addFolder('Warp Esoterica')
  6267. v
  6268. .add(h.warp, 'nearPanoDist', 0.01, 12)
  6269. .step(0)
  6270. .onFinishChange(function () {}),
  6271. v.add(h.warp, 'blur', 0.01, 1).onFinishChange(function () {}),
  6272. v
  6273. .add(h.warp, 'flySpeed', 0, 10)
  6274. .step(0.01)
  6275. .onFinishChange(function () {
  6276. ;(h.warp.minWarpTime = 0),
  6277. v.__controllers.forEach(function (e) {
  6278. e.updateDisplay()
  6279. })
  6280. }),
  6281. v.add(h.warp, 'showBunny').onFinishChange(function () {}),
  6282. v
  6283. .add(h.warp, 'fastTime', 0, 2500)
  6284. .step(10)
  6285. .onFinishChange(function () {}),
  6286. v.add(h.warp, 'movementEasing', Object.keys(a))
  6287. var A = n.addFolder('Misc')
  6288. A.add(h, 'dollhouseFOV', 10, 180).onChange(function () {
  6289. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  6290. }),
  6291. A.add(h, 'insideFOV', 10, 180).onChange(function () {
  6292. i.cameras[s.PANORAMA].fov = h.insideFOV
  6293. }),
  6294. A.add(h, 'insideLookSpeed', 0.01, 0.3)
  6295. .step(0.01)
  6296. .onChange(function () {}),
  6297. A.add(h, 'rotationAccelerationInside', 0.1, 10)
  6298. .step(0.1)
  6299. .onChange(function () {}),
  6300. A.add(h, 'rotationAccelerationOutside', 0.1, 10)
  6301. .step(0.1)
  6302. .onChange(function () {})
  6303. var y = n.addFolder('Navigation')
  6304. y.add(h.navigation, 'panoScores').onFinishChange(function () {
  6305. h.navigation.panoScores ||
  6306. e.panos.forEach(function (e) {
  6307. e.floor.remove(e.text3d), (e.text3d = null)
  6308. })
  6309. }),
  6310. y.add(h.navigation, 'mouseDirection'),
  6311. y.add(h.navigation, 'filterStrictness', 0, 1),
  6312. y.add(h.navigation, 'angleFactor', -60, 0),
  6313. y.add(h.navigation, 'directionFactor', 1, 20),
  6314. y.add(h.navigation, 'distanceFactor', -5, 5),
  6315. y.add(h.navigation, 'optionalityFactor', 0.1, 10)
  6316. var C = n.addFolder('tags'),
  6317. I = C.addFolder('Tag Creation')
  6318. I.add(h.tags.pole, 'enabled').name('poleEnabled'),
  6319. I.add(h.tags.pole, 'height', 0, 2.5).step(0.01).name('poleHeight'),
  6320. I.add(h.tags.pole, 'width', 1, 10).step(1).name('poleWidth'),
  6321. I.add(h.tags.pole, 'opacity', 0.1, 1).step(0.1).name('poleOpacity')
  6322. var E = C.addFolder('Visibility')
  6323. E.add(h.tags.visibility, 'anyDistance'),
  6324. E.add(h.tags.visibility, 'visibleDistance', 0.1, 30).step(0.1),
  6325. E.add(h.tags.visibility, 'cameraClearance', 0, 1).step(0.01),
  6326. E.add(h.tags.visibility, 'hideViaFloor'),
  6327. E.add(h.tags.visibility, 'hideOffScreenDisc').name('hideEdgeDisc'),
  6328. E.add(h.tags.visibility, 'hideOffScreenObject').name('hideEdgeObject')
  6329. var b = C.addFolder('Disc Parameters')
  6330. b.add(h.tags.disc.scale, 'nearBound', 0.1, 10).step(0.1),
  6331. b.add(h.tags.disc.scale, 'farBound', 0.1, 20).step(0.1).listen(),
  6332. b.add(h.tags.disc.scale, 'linkFarBound').onChange(function (e) {
  6333. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  6334. }),
  6335. b
  6336. .add(h.tags.disc.scale, 'linkPercent', 0, 100)
  6337. .step(1)
  6338. .onChange(function (e) {
  6339. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  6340. }),
  6341. b.add(h.tags.disc.scale, 'maxSize', 40, 200).step(1),
  6342. b.add(h.tags.disc.scale, 'minSize', 20, 100).step(1),
  6343. b.add(h.tags.disc.scale, 'responsiveness', 0, 100).step(1)
  6344. var w = C.addFolder('Navigate')
  6345. w.add(h.tags.navigate, 'nearestPano').name('nearestPano'),
  6346. w.add(h.tags.navigate, 'lineOfSight').name('lineOfSight'),
  6347. w.add(h.tags.navigate, 'reactivate').name('reactivate'),
  6348. w.add(h.tags.navigate, 'aimAt', ['disc', 'object', 'pole', 'nothing']).name('aim at'),
  6349. w.add(h.tags.navigate, 'tiltTolerance', 0, 50).step(1),
  6350. w.add(h.tags.navigate, 'rotateSpeedFactor', 0, 5).step(0.1)
  6351. var _ = n.addFolder('Debug')
  6352. _.add(h, 'wireframe').onFinishChange(function () {
  6353. e.chunks.forEach(function (t) {
  6354. t.material &&
  6355. (t.wireframeTwin ||
  6356. ((t.wireframeTwin = new o.WireframeHelper(t)),
  6357. (t.wireframeTwin.material.depthWrite = !1),
  6358. (t.wireframeTwin.material.depthTest = !1),
  6359. (t.wireframeTwin.material.opacity = 0.5),
  6360. (t.wireframeTwin.material.transparent = !0)),
  6361. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  6362. })
  6363. }),
  6364. _.add(h, 'skyboxWireframe').onFinishChange(function () {
  6365. h.skyboxWireframe ? ((e.skybox.wireframe = new o.WireframeHelper(e.skybox)), e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe), (e.skybox.wireframe = null))
  6366. }),
  6367. _.add(h, 'showSweeps').onFinishChange(function () {
  6368. e.setSweepVisibility(h.showSweeps)
  6369. }),
  6370. _.add(h, 'showMesh').onFinishChange(function () {
  6371. e.chunks.forEach(function (e) {
  6372. e.visible = h.showMesh
  6373. })
  6374. }),
  6375. _.add(h, 'showFloors').onFinishChange(function () {
  6376. e.floors.forEach(function (e) {
  6377. e.collider.children.forEach(function (e) {
  6378. e.material.visible = h.showFloors
  6379. })
  6380. })
  6381. }),
  6382. _.add(h, 'showSkyboxes').onFinishChange(function () {
  6383. e.panos.forEach(function (e) {
  6384. e.skyboxMesh.visible = h.showSkyboxes
  6385. })
  6386. }),
  6387. _.add(h, 'showNeighbors').onChange(function () {}),
  6388. _.add(e, 'alpha', 0, 1)
  6389. }
  6390. var r = e('../lib/dat.gui'),
  6391. o = e('three'),
  6392. a = e('../util/easing'),
  6393. s = e('../enum/Viewmode'),
  6394. l = e('../enum/Colors'),
  6395. c = e('../enum/WarpStyle'),
  6396. h = e('../settings')
  6397. e('../tag/tag')
  6398. ;(r.GUI.prototype.removeFolder = function (e) {
  6399. var t = this.__folders[e]
  6400. t && (t.close(), this.__ul.removeChild(t.domElement.parentNode), delete this.__folders[e], this.onResize())
  6401. }),
  6402. (t.exports.toggle = n)
  6403. },
  6404. {
  6405. '../enum/Colors': 19,
  6406. '../enum/Viewmode': 51,
  6407. '../enum/WarpStyle': 52,
  6408. '../lib/dat.gui': 93,
  6409. '../tag/tag': 123,
  6410. '../settings': 166,
  6411. '../util/easing': 186,
  6412. three: 217
  6413. }
  6414. ],
  6415. 64: [
  6416. function (e, t, i) {
  6417. ;(function (i) {
  6418. 'use strict'
  6419. function n(e, t, i, n) {
  6420. $('.gui-error .error-problem-text').text(e),
  6421. $('.gui-error .error-solution-text').text(t),
  6422. $('.gui-error .error-explanation').text(i),
  6423. $('.gui-error .error-actions').html(n),
  6424. $(window).resize(),
  6425. $('.gui-error').fadeIn(),
  6426. $('#bottom-logo').fadeIn()
  6427. }
  6428. function r(e) {
  6429. var t = [
  6430. '<div class="browser-tiles">',
  6431. '<div class="tile">',
  6432. '<a href="https://www.google.com/chrome/browser/" target="_blank">',
  6433. '<img class="icon" src="images/icon_Google_Chrome_2011.png" ',
  6434. 'rel="tiletip" title="Chrome"></a>',
  6435. '</div>',
  6436. '<div class="tile">',
  6437. '<a href="https://www.mozilla.org/en-US/firefox/new/" target="_blank">',
  6438. '<img class="icon" src="images/icon_Mozilla_Firefox.png" ',
  6439. 'rel="tiletip" title="Firefox"></a>',
  6440. '</div>',
  6441. '<div class="tile">',
  6442. '<a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie" target="_blank">',
  6443. '<img class="icon" src="images/icon_Internet_Explorer_10.png" ',
  6444. 'rel="tiletip" title="Internet Explorer"></a>',
  6445. '</div>',
  6446. '<div class="tile">',
  6447. '<a href="https://support.apple.com/en-us/HT204416" target="_blank">',
  6448. '<img class="icon" src="images/icon_MacOSX_Safari.png" ',
  6449. 'rel="tiletip" title="Safari"></a>',
  6450. '</div>',
  6451. '</div>'
  6452. ].join('')
  6453. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  6454. s.isMobile() ||
  6455. $('[rel=tiletip]').tooltip({
  6456. placement: 'bottom',
  6457. delay: {
  6458. show: 50,
  6459. hide: 0
  6460. },
  6461. trigger: 'hover',
  6462. viewport: {
  6463. selector: 'body',
  6464. padding: 10
  6465. }
  6466. })
  6467. }
  6468. function o() {
  6469. var e = s.isMobile() ? '' : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + '</span>' + h.ERROR_GENERIC_ACTIONS_3,
  6470. t = [h.ERROR_GENERIC_ACTIONS_1, e].join('')
  6471. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, '', t),
  6472. s.isMobile() ||
  6473. $('.install-browser').on('click touchstart', function (e) {
  6474. e.preventDefault(), e.stopPropagation(), r(' ')
  6475. })
  6476. }
  6477. function a(e) {
  6478. if (
  6479. ($('head title').text(c.pageTitle),
  6480. $('#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo').hide(),
  6481. $('#gui-loading').fadeOut(250),
  6482. $('#quick-blackout').hide(),
  6483. l.track('showcase_error', {
  6484. error_key: e
  6485. }),
  6486. h.locale || h.init(),
  6487. 'webgl-unsupported' === e)
  6488. )
  6489. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM)
  6490. else if ('webgl-ios' === e) n(h.ERROR_WEBGL_IOS_PROBLEM, h.ERROR_WEBGL_IOS_SOLUTION, '', h.ERROR_WEBGL_IOS_ACTIONS_1 + '<strong>' + h.ERROR_WEBGL_IOS_ACTIONS_2 + '</strong>.')
  6491. else if ('webgl-safari' === e)
  6492. n(
  6493. h.ERROR_WEBGL_SAFARI_PROBLEM,
  6494. '',
  6495. '',
  6496. h.ERROR_WEBGL_SAFARI_ACTIONS_1 +
  6497. '<strong>' +
  6498. h.ERROR_WEBGL_SAFARI_ACTIONS_2 +
  6499. '</strong>. ' +
  6500. h.ERROR_WEBGL_SAFARI_ACTIONS_3 +
  6501. '<strong>' +
  6502. h.ERROR_WEBGL_SAFARI_ACTIONS_4 +
  6503. '</strong>.'
  6504. )
  6505. else if ('webgl-generic' === e) o()
  6506. else if ('missing-urls' === e) n(h.ERROR_MISSING_URLS_PROBLEM, '', h.ERROR_MISSING_URLS_EXPLANATION)
  6507. else if ('loading-failed' === e)
  6508. n(h.ERROR_LOADING_FAILED_PROBLEM, '', '', h.ERROR_LOADING_FAILED_ACTIONS_1 + '<a class="link" target="_blank" href=' + p + '>' + h.ERROR_LOADING_FAILED_ACTIONS_2 + '</a>.')
  6509. else {
  6510. if ('loading-failed-maintenance' !== e) return void d.error('Unhandled error: ' + e)
  6511. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  6512. }
  6513. }
  6514. var s = e('./../util/browser'),
  6515. l = e('./../analytics'),
  6516. c = e('./../settings'),
  6517. h = e('../localization/localize'),
  6518. u = e('./../util/logger'),
  6519. d = new u(i),
  6520. p = '"https://support.port.com/hc/articles/208220058"'
  6521. t.exports.error = a
  6522. }).call(this, '/js/gui/error.js')
  6523. },
  6524. {
  6525. '../localization/localize': 108,
  6526. './../analytics': 4,
  6527. './../settings': 166,
  6528. './../util/browser': 182,
  6529. './../util/logger': 189
  6530. }
  6531. ],
  6532. 65: [
  6533. function (e, t, i) {
  6534. ;(function (i) {
  6535. 'use strict'
  6536. function n() {
  6537. ;(Ue = []), je.floors.visible && Ue.push('.gui-floor', '.gui-floor-title'), Ue.push('.hideTarget', '.pinTop.right')
  6538. }
  6539. function r() {
  6540. for (var e in je)
  6541. if (je.hasOwnProperty(e)) {
  6542. var t = je[e]
  6543. if (!t.visible) for (var i = 0; i < t.elements.length; i++) $(t.elements[i]).hide()
  6544. }
  6545. je.highlight.visible && $('.pinBottom').addClass('highlightExists'), je.tourControls.visible === !1 && $('#drawer').addClass('fullWidth'), n()
  6546. }
  6547. function o(e, t) {
  6548. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying
  6549. $('#gui-zoomin').toggle(i), $('#gui-zoomout').toggle(i)
  6550. }
  6551. function a() {
  6552. c(),
  6553. $('.pinBottom').toggleClass('open'),
  6554. $('#drawer').toggleClass('open'),
  6555. $('.footer').toggleClass('open'),
  6556. $('#drawer').hasClass('open')
  6557. ? ($('#pullTab .icon').attr('data-original-title', Re.CLOSE_HIGHLIGHTS), Ze('highlights'))
  6558. : ($('#pullTab .icon').attr('data-original-title', Re.OPEN_HIGHLIGHTS), ie.resetDrawer()),
  6559. setTimeout(
  6560. function () {
  6561. $('#pullTab').toggleClass('opened')
  6562. },
  6563. $('#drawer').hasClass('open') ? 0 : Q.highlightAnimationDuration
  6564. ),
  6565. $('.pinBottom').hasClass('open') && s($('.vr-popup')) && $('.vr-popup').is(':visible') && Ae.dismiss()
  6566. }
  6567. function s(e) {
  6568. var t
  6569. 'none' !== e.css('display') ? (t = e.position().top + e.outerHeight()) : (e.attr('style', 'visibility: hidden'), (t = e.position().top + e.outerHeight()), e.attr('style', 'display: none'))
  6570. var i = $('#player').outerHeight(),
  6571. n = i - 130
  6572. return n < t + 25
  6573. }
  6574. function l(e) {
  6575. 'touchstart' === e.type && e.preventDefault(), e.stopPropagation()
  6576. }
  6577. function c() {
  6578. W && (W.reload(), W.init())
  6579. }
  6580. function h(e) {
  6581. ne.show(e), r()
  6582. }
  6583. function u(e) {
  6584. ne.progress(e)
  6585. }
  6586. function d(e, t, i) {
  6587. var n = t.player
  6588. $('#gui-thumb').fadeOut(2500),
  6589. ne.hide(function () {
  6590. Ge = !1
  6591. }),
  6592. me.init(e, i),
  6593. de.finishSetup(Object.keys(e.tags).length),
  6594. i.on(Te.IMAGE_OPENED, Ze.bind(this, 'tag'))
  6595. var s = function () {
  6596. i.dismissExaminedTag(), i.disableHovering()
  6597. }
  6598. Ae.on(ye.OPENED, s), Ce.on(Me.OPENED, s), he.on(ue.OPENED, s), fe.on(ge.OPENED, s)
  6599. var l = i.enableHovering.bind(i)
  6600. if (
  6601. (Ae.on(ye.CLOSED, l),
  6602. Ce.on(Me.CLOSED, l),
  6603. he.on(ue.CLOSED, l),
  6604. fe.on(ge.CLOSED, l),
  6605. Q.labels.enabled && Object.keys(e.labels).length,
  6606. ((!settings.extractFloor || !settings.extractFloor[number]) && e.floors.length <= 1) || !je.floors.visible ? (je.floors.visible = !1) : (y(e, t), C(e.currentFloor, n.mode)),
  6607. getQueryVariable('m') === '372' && ((je.floors.visible = 1), y(e, t)),
  6608. r(),
  6609. o(t, t.player),
  6610. $('#gui').fadeIn(1500),
  6611. je.highlight.visible &&
  6612. (2 !== Q.startHighlights || e.has360Views) &&
  6613. setTimeout(function () {
  6614. a(), ((!e.has360Views && 1 !== Q.startHighlights) || (e.has360Views && 0 === Q.startHighlights)) && setTimeout(a, 2e3)
  6615. }, 2e3),
  6616. !K.isMobile())
  6617. )
  6618. for (var c = ['a', '#title-toggle', '.next-button', '.prev-button', '.gui-floor', '.meta-toggle', '.thumbImg', 'logo-button'], h = 0; h < c.length; h++) $(c[h]).addClass('hasHover')
  6619. O(e), de.setupToggling()
  6620. //xzw:
  6621. window.editHotPanel && editHotPanel()
  6622. //czj
  6623. navBorderRadius(e)
  6624. //czj 编辑界面
  6625. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  6626. window.EditTools && new EditTools(n.sceneRenderer)
  6627. }
  6628. function navBorderRadius(e) {
  6629. var pullTab = $('#pullTab'),
  6630. mobileRadius = {
  6631. bottom: { 'border-bottom-left-radius': '10px', 'border-bottom-right-radius': '10px' },
  6632. top: { 'border-top-left-radius': '10px', 'border-top-right-radius': '10px' }
  6633. },
  6634. topRadius = {
  6635. bottom: { 'border-top-right-radius': '10px', 'border-bottom-right-radius': '10px' },
  6636. top: { 'border-bottom-left-radius': '10px', 'border-top-left-radius': '10px' }
  6637. }
  6638. function BorderRadius(bottom, top) {
  6639. $('#gui-modes-map > div:visible:last').css(bottom)
  6640. if (pullTab.is(':visible')) {
  6641. $('.viewContainer > div:visible:first').css(top)
  6642. } else {
  6643. $('#gui-modes-map > div:visible:first').css(top)
  6644. }
  6645. }
  6646. if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
  6647. BorderRadius(mobileRadius.bottom, mobileRadius.top)
  6648. } else {
  6649. BorderRadius(topRadius.bottom, topRadius.top)
  6650. }
  6651. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  6652. if (window.DATA.model.special || window.DATA.special) {
  6653. window.specialScene && specialScene.special().afterImplement()
  6654. }
  6655. }
  6656. function p(e) {
  6657. e || (e = 0),
  6658. (We = !1),
  6659. window.setTimeout(
  6660. function () {
  6661. We || ((ze = !0), $('#gui-spinner').stop(!0, !0).show())
  6662. }.bind(this),
  6663. e
  6664. )
  6665. }
  6666. function f() {
  6667. $('#gui-spinner').stop(!0, !0), $('#gui-spinner').fadeOut(1e3), (We = !0), (ze = !1)
  6668. }
  6669. function g(e, t) {
  6670. var i = e.mode,
  6671. n = t || e.currentPano
  6672. $('#gui-modes-dollhouse').toggleClass('active', i === _e.DOLLHOUSE),
  6673. $('#gui-modes-floorplan').toggleClass('active', i === _e.FLOORPLAN),
  6674. $('#gui-modes-inside').toggleClass('active', i === _e.PANORAMA),
  6675. i === _e.PANORAMA
  6676. ? ($('#view-controllers').slideUp(500),
  6677. Q.show360Views.enabled && !n.isAligned()
  6678. ? ($('.gui-floor').addClass('hidden'), $('#gui-modes-outside').addClass('desktop-only'))
  6679. : ($('.gui-floor').removeClass('hidden'), $('#gui-modes-outside').removeClass('desktop-only')),
  6680. $('#gui-modes-outside').removeClass('hidden'))
  6681. : i !== _e.TRANSITIONING &&
  6682. (f(),
  6683. (Be = i),
  6684. $('#gui-modes-outside').addClass('hidden'),
  6685. e.model.has360Views && $('.gui-floor').removeClass('hidden'),
  6686. $('#view-controllers').is(':visible') || $('#view-controllers').slideDown(Q.guiAnimationSpeed))
  6687. }
  6688. function m(e, t) {
  6689. var i = t.player
  6690. $('#gui-modes-inside').on('mousedown touchstart', function (e) {
  6691. l(e),
  6692. J.updateInteraction(Se.InteractionGui, 'inside-button'),
  6693. J.track('USER', {
  6694. event_type: 'showcase_gui',
  6695. gui_action: 'click_inside_mode_button'
  6696. }),
  6697. t.changeMode(_e.PANORAMA)
  6698. }),
  6699. $('#gui-modes-outside')
  6700. .find('a')
  6701. .on('click', function (e) {
  6702. l(e),
  6703. J.track('showcase_gui', {
  6704. gui_action: 'click_outside_mode_button'
  6705. }),
  6706. t.changeMode(Be)
  6707. }),
  6708. $('#gui-modes-floorplan').on('click', function (e) {
  6709. l(e),
  6710. i.mode !== _e.FLOORPLAN &&
  6711. (J.track('showcase_gui', {
  6712. gui_action: 'click_floorplan_mode_button'
  6713. }),
  6714. t.changeMode(_e.FLOORPLAN))
  6715. }),
  6716. $('#gui-modes-dollhouse').on('click', function (e) {
  6717. l(e),
  6718. i.mode !== _e.DOLLHOUSE &&
  6719. (J.track('showcase_gui', {
  6720. gui_action: 'click_dollhouse_mode_button'
  6721. }),
  6722. t.changeMode(_e.DOLLHOUSE))
  6723. })
  6724. }
  6725. function v(e, t) {
  6726. function i() {
  6727. document.getElementById('vr').classList.remove('hidden'),
  6728. Q.vr.allowWebVR
  6729. ? K.getVRDisplay().then(
  6730. function (e) {
  6731. K.supportsFullscreen() ? n(e) : (De.warn('Unable to use WebVR when full screen is not supported'), $('.improper-embed').toggleClass('hidden', !1), r())
  6732. },
  6733. function (e) {
  6734. r()
  6735. }
  6736. )
  6737. : r()
  6738. }
  6739. function n(i) {
  6740. De.info(i.displayName + ' detected, VR button activates WebVR experience'), Ie.init(e.data, t, i, q), Ie.on(Ee.OPENED, Ze.bind(gui, 'vr')), Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6741. }
  6742. function r() {
  6743. De.info('WebVR support not found, VR button activates native app VR modal'),
  6744. Ae.init(e.data, q),
  6745. Ae.on(
  6746. ye.OPENED,
  6747. (function () {
  6748. var e = document.getElementById('vr-modal')
  6749. return function () {
  6750. Ze('vr'), le.open(e)
  6751. }
  6752. })()
  6753. ),
  6754. Ae.on(ye.CLOSED, le.reset)
  6755. }
  6756. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash('mls', 0)) {
  6757. /*********************** 方奕卓 VR功能事件监听 ********************/
  6758. K.isMobile() && $('#vr').css('display', '') // 显示vr功能按钮
  6759. switch (Q.vr.option) {
  6760. case Pe.CONTEXTUAL:
  6761. i()
  6762. break
  6763. case Pe.ANDROID:
  6764. K.detectAndroid() && i()
  6765. break
  6766. case Pe.NONE:
  6767. }
  6768. }
  6769. }
  6770. function A(e, t) {
  6771. $('#play').on('mousedown touchstart', function (e) {
  6772. l(e)
  6773. Ze('tour')
  6774. ve.play()
  6775. J.trackAlways('showcase_gui', {
  6776. gui_action: 'play_highlights'
  6777. })
  6778. }),
  6779. (window.startAndPlay = function (e) {
  6780. // l(e);
  6781. Ze('tour')
  6782. ve.play()
  6783. J.trackAlways('showcase_gui', {
  6784. gui_action: 'play_highlights'
  6785. })
  6786. })
  6787. $('#pause').on('mousedown touchstart', function (e) {
  6788. l(e),
  6789. ve.pause(),
  6790. J.trackAlways('showcase_gui', {
  6791. gui_action: 'pause_highlights'
  6792. })
  6793. }),
  6794. $('#gui-zoomin')
  6795. .find('a')
  6796. .on('click', function (e) {
  6797. l(e), t.player.zoomInIncrementally()
  6798. }),
  6799. $('#gui-zoomout')
  6800. .find('a')
  6801. .on('click', function (e) {
  6802. l(e), t.player.zoomOutIncrementally()
  6803. })
  6804. }
  6805. function y(e, t) {
  6806. for (var i = $('.gui-floor'), n = 0; n < e.floors.length; n++) {
  6807. if (getQueryVariable('m') === '372') continue
  6808. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name)
  6809. $('.gui-floor').find('.container').prepend(r)
  6810. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  6811. }
  6812. i.find('.container').prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + '</div>'),
  6813. i.on('click', function (e) {
  6814. l(e), Ze('floor'), i.toggleClass('open')
  6815. }),
  6816. $('.floorChoice').on('click', function (e) {
  6817. l(e)
  6818. var n = $(this).data('index')
  6819. 'all' !== n
  6820. ? (J.updateInteraction(Se.InteractionGui, 'floor-control'),
  6821. t.player.gotoFloor(n),
  6822. J.track('showcase_gui', {
  6823. gui_action: 'click_floor_select_button',
  6824. interaction_source: 'gui'
  6825. }))
  6826. : (J.updateInteraction(Se.InteractionGui, 'floor-control'),
  6827. Ze('move'),
  6828. t.allFloors(),
  6829. J.track('showcase_gui', {
  6830. gui_action: 'click_toggle_all_floors_button',
  6831. interaction_source: 'gui'
  6832. })),
  6833. i.removeClass('open')
  6834. })
  6835. }
  6836. function C(e, t) {
  6837. e &&
  6838. (t === _e.DOLLHOUSE || t === _e.FLOORPLAN
  6839. ? ($('.allFloorBtn').show(), $('.gui-floor-icon').hide(), $('.gui-floor-title').show())
  6840. : ($('.allFloorBtn').hide(), $('.gui-floor-icon').show(), $('.gui-floor-title').hide()),
  6841. e.model.allFloorsVisible
  6842. ? ($('.gui-floor-title').text(Re.FLOOR_ALL), $('.gui-floor-number').text(Re.FLOOR_ALL), $('.floorChoice').removeClass('active'), $('.floorChoice[data-index="all"]').addClass('active'))
  6843. : ($('.gui-floor-title').text(e.name),
  6844. $('.gui-floor-number').text(' ' + (e.floorIndex + 1)),
  6845. $('.floorChoice').removeClass('active'),
  6846. $('.floorChoice[data-index=' + e.floorIndex + ']').addClass('active')))
  6847. }
  6848. function I(e) {
  6849. return e.describe().inTransition
  6850. }
  6851. function b(e, t, i) {
  6852. Fe = e.heroLocations.length
  6853. var n = '<li class="thumbImg" data-index=""><img src=""></li>',
  6854. r = 100 / Fe + '%',
  6855. o = $('#thumb-container'),
  6856. a = $('#progressBar')
  6857. $('#status').find('.totalSteps').text(Fe)
  6858. for (var s = 0; s < Fe; s++) {
  6859. var c = e.heroLocations[s],
  6860. h = $(n)
  6861. var thumbUrl
  6862. if (c.heroLocations) {
  6863. //有子项,选第一张截图
  6864. thumbUrl = manage.dealURL(c.heroLocations[0].thumbUrl) //.replace('https://','').replace('http://','')
  6865. } else {
  6866. thumbUrl = manage.dealURL(c.thumbUrl) //.replace('https://','').replace('http://','')
  6867. }
  6868. h.attr('data-index', s)
  6869. je.highlight.visible && h.find('img').attr('src', thumbUrl)
  6870. if (c.name) {
  6871. var u = $('<div class="overlay"></div>').text(c.name)
  6872. h.prepend(u)
  6873. }
  6874. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6875. var d = e.panos.get(c.panoId),
  6876. p = d && !d.isAligned(),
  6877. f = p ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>' : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>'
  6878. h.prepend(f)
  6879. }
  6880. o.append(h), a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6881. }
  6882. ;(j = 144 * Fe),
  6883. (Y = 111 * Fe),
  6884. $('.thumbImg').on('mouseover', function () {
  6885. I(t) || i.showPathToHeroLocation([$(this).data('index'), 0]) //改
  6886. }),
  6887. $('.thumbImg').on('mouseout', function () {
  6888. t.clearPath()
  6889. }),
  6890. $('.thumbImg').on('click', function (e) {
  6891. l(e)
  6892. var i = $(this)
  6893. J.updateInteraction(Se.InteractionGui, 'thumbnail'),
  6894. J.trackAlways('showcase_gui', {
  6895. gui_action: 'click_highlight'
  6896. }),
  6897. t.goToHighlight([i.data('index'), 0]) //改
  6898. }),
  6899. $('.sectionCont').on('click', function (e) {
  6900. const imgActIndex = $(this).data('index')
  6901. console.log('imgActIndex')
  6902. t.goToHighlight([imgActIndex, 0])
  6903. }),
  6904. $('.previous')
  6905. .find('a')
  6906. .on('click', function (e) {
  6907. l(e),
  6908. J.trackAlways('showcase_gui', {
  6909. gui_action: 'prev_highlight'
  6910. }),
  6911. t.prevHighlight()
  6912. }),
  6913. $('.next')
  6914. .find('a')
  6915. .on('click', function (e) {
  6916. l(e),
  6917. J.trackAlways('showcase_gui', {
  6918. gui_action: 'next_highlight'
  6919. }),
  6920. t.nextHighlight()
  6921. }),
  6922. $('#drawer').on('mouseleave', function (e) {
  6923. l(e)
  6924. var t
  6925. try {
  6926. t = new MouseEvent('mouseup', {
  6927. clientX: e.clientX,
  6928. clientY: e.clientY,
  6929. screenX: e.screenX,
  6930. screenY: e.screenY
  6931. })
  6932. } catch (i) {
  6933. ;(t = document.createEvent('MouseEvents')),
  6934. t.initMouseEvent(
  6935. 'mouseup',
  6936. e.bubbles,
  6937. e.cancelable,
  6938. e.view,
  6939. e.detail,
  6940. e.screenX,
  6941. e.screenY,
  6942. e.clientX,
  6943. e.clientY,
  6944. e.ctrlKey,
  6945. e.altKey,
  6946. e.shiftKey,
  6947. e.metaKey,
  6948. e.button,
  6949. e.relatedTarget
  6950. )
  6951. }
  6952. document.dispatchEvent(t)
  6953. }),
  6954. (W = new Sly($('#scrollFrame'), {
  6955. horizontal: !0,
  6956. itemNav: 'centered',
  6957. smart: !0,
  6958. scrollTrap: !0,
  6959. scrollBy: 1,
  6960. mouseDragging: !0,
  6961. touchDragging: !0,
  6962. speed: 300,
  6963. dragHandle: !0,
  6964. dynamicHandle: !0,
  6965. clickBar: !0,
  6966. scrollBar: $('#scroller'),
  6967. activateOn: null
  6968. }).init()),
  6969. W.on('active', function (e, t) {
  6970. ;(Ve = t),
  6971. Ze('tour'),
  6972. $('.step').removeClass('active'),
  6973. $('#status')
  6974. .find('.curIdx')
  6975. .text(t + 1)
  6976. for (var i = 0; i <= t; i++)
  6977. $('#progressBar')
  6978. .find("[data-idx='" + i + "']")
  6979. .addClass('active')
  6980. }),
  6981. w()
  6982. //add :
  6983. let scrollFrame = $(W.frame)
  6984. scrollFrame.on('wheel.sly', function () {
  6985. lastMoveScrollTime = Date.now()
  6986. })
  6987. let dragstart
  6988. /* scrollFrame.on("pointerdown", function() {
  6989. dragstart = true
  6990. })
  6991. scrollFrame.on("pointerup", function() {
  6992. dragstart = false
  6993. }) */
  6994. scrollFrame.on('pointermove', function () {
  6995. //if(dragstart){
  6996. lastMoveScrollTime = Date.now()
  6997. //}
  6998. })
  6999. }
  7000. function w() {
  7001. var e = $('#player').width() - 20,
  7002. t = $('#scroller'),
  7003. i = $('#drawer'),
  7004. n = $('.pinBottom')
  7005. if ($('#player').width() < 488 || $('#player').height() < 488) t.addClass('hidden'), i.addClass('noScroll'), n.addClass('noScroll')
  7006. else {
  7007. var r = j > e,
  7008. o = !i.hasClass('noScroll'),
  7009. a = r !== o
  7010. a && (t.toggleClass('hidden'), i.toggleClass('noScroll'), n.toggleClass('noScroll'))
  7011. }
  7012. }
  7013. function _(e) {
  7014. je.tourControls.visible = true //e.tour_buttons && K.valueFromHash("gt", 1),
  7015. ;(je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash('mls', !1)),
  7016. (je.highlight.visible = /* e.highlight_reel && */ 1 !== Q.specialEdition && Q.showHighlights)
  7017. }
  7018. function T(e) {
  7019. function t(t, i) {
  7020. return !!e.player_options[t] && e[i || t]
  7021. }
  7022. $('.model-title').text(e.name)
  7023. var i = Q.pageTitle
  7024. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  7025. 2 !== K.valueFromHash('mls', 0) && e.name && (i = e.name),
  7026. (document.title = i),
  7027. K.isMobile()
  7028. ? $('#gui-fullscreen').css('display', 'none')
  7029. : ($('[rel=tooltip]').tooltip({
  7030. delay: {
  7031. show: 50,
  7032. hide: 0
  7033. },
  7034. trigger: 'hover',
  7035. html: !1,
  7036. viewport: {
  7037. selector: 'body',
  7038. padding: 10
  7039. }
  7040. }),
  7041. K.inIframe() && document.getElementsByClassName('pinBottom-container')[0].classList.add('embed')),
  7042. // 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"),
  7043. de.populate({
  7044. name: t('model_name', 'name'),
  7045. coBrand: t('presented_by'),
  7046. description: t('model_summary', 'summary') || '暂无内容',
  7047. contactName: t('contact_name'),
  7048. address: t('address'),
  7049. phone: t('contact_phone'),
  7050. formattedPhone: e.formatted_contact_phone,
  7051. email: t('contact_email'),
  7052. url: t('external_url'),
  7053. socialSharing: e.enable_social_sharing && e.is_public
  7054. })
  7055. }
  7056. function x(e, t, i, n, r, o) {
  7057. function a() {
  7058. o.setLoadingStartTime(), H(), r ? (re.showMessage(t, i, je.coBrand.visible), l()) : h(l)
  7059. }
  7060. var s = $.Deferred(),
  7061. l = s.resolve.bind(s)
  7062. return (
  7063. (Ge = !0),
  7064. O(e),
  7065. e.data.player_options && _(e.data.player_options),
  7066. 1 === Q.specialEdition && $('body').addClass('specialEdition'),
  7067. Re.localizeGUI(),
  7068. T(e.data),
  7069. r || $('.quick').addClass('hidden'),
  7070. //e.data.image && !r && E(e.data.image),
  7071. n ? (J.impression(), a()) : (o.setWaitingStartTime(), oe.show(r, a)),
  7072. s
  7073. )
  7074. }
  7075. function S(e, t, i, n, r, a, s) {
  7076. ;(q = s),
  7077. e.outsideAllowed() || $('#gui-modes-outside').addClass('invisible'),
  7078. e.supportedModes[_e.PANORAMA] || $('#gui-modes-inside').addClass('invisible'),
  7079. ae.init(),
  7080. re.init(e, a),
  7081. Oe.init(e, t, n),
  7082. $('.icon').on('mouseover', function () {
  7083. t.player && t.player.reticule.hide()
  7084. }),
  7085. m(e, t),
  7086. A(e, t),
  7087. e.data.enable_social_sharing &&
  7088. e.data.is_public &&
  7089. Q.share.enabled &&
  7090. (Ce.init(window.DATA.name /* e.data.name */),
  7091. Ce.on(
  7092. Me.OPENED,
  7093. (function () {
  7094. var e = document.getElementById('share-modal')
  7095. return function () {
  7096. Ze('share'), le.open(e)
  7097. }
  7098. })()
  7099. ),
  7100. Ce.on(Me.CLOSED, le.reset)),
  7101. e.heroLocations.length > 0 ? b(e, t, i) : ((je.highlight.visible = !1), (je.tourControls.visible = !1)),
  7102. de.on(pe.OPEN_INFO, Ze.bind(this, 'info')),
  7103. z(),
  7104. g(i),
  7105. v(e, r),
  7106. e.on('floor.changed', C),
  7107. e.on('waiting', R.bind(this, e)),
  7108. e.on('waiting-done', P.bind(this, e)),
  7109. i.on(xe.ModeChanged, function (e, n) {
  7110. g(i), o(t, i), n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR), he.updateMode(n)
  7111. }),
  7112. n.on(Se.Move, Ze.bind(this, 'move')),
  7113. i.on(xe.Ready, function () {
  7114. ie.init(n, i, i.tagManager, t),
  7115. i.on(xe.ModeChanged, function (e, t) {
  7116. e !== t && $('.vr-popup').is(':visible') && Ae.dismiss()
  7117. })
  7118. }),
  7119. i.on(xe.PanoChosen, function (e, t) {
  7120. g(i, t), he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  7121. }),
  7122. le.on(ce.CLOSE, function (e) {
  7123. switch (e) {
  7124. case 'vr-modal':
  7125. Ae.dismiss()
  7126. break
  7127. case 'share-modal':
  7128. Ce.hide()
  7129. break
  7130. case 'terms-modal':
  7131. fe.hide()
  7132. }
  7133. })
  7134. var l = $('#play').eq(0),
  7135. c = $('#pause').eq(0),
  7136. h = $('.pinBottom').toArray(),
  7137. u = $('#drawer').eq(0),
  7138. d = $('#playHead').eq(0),
  7139. p = $('#progressBar').eq(0),
  7140. f = $('#thumb-container').eq(0),
  7141. y = f.children(),
  7142. I = p.children()
  7143. t.on('update.controls', function () {
  7144. //导览控制
  7145. var n = t.describe()
  7146. if (n.tourIsPlaying || i.isWarping()) {
  7147. if (je.tourControls.visible) {
  7148. l.hide() //play button
  7149. c.show() //pause button
  7150. }
  7151. if (n.tourInProgress) {
  7152. h.forEach(function (e) {
  7153. e.classList.add('playing')
  7154. }),
  7155. u.addClass('playing'),
  7156. d.addClass('playing')
  7157. }
  7158. } else {
  7159. if (je.tourControls.visible) {
  7160. l.show(), c.hide()
  7161. }
  7162. if (!n.tourInProgress) {
  7163. ve.stopTour(),
  7164. h.forEach(function (e) {
  7165. e.classList.remove('playing')
  7166. }),
  7167. u.removeClass('playing'),
  7168. d.removeClass('playing')
  7169. }
  7170. }
  7171. var r, a, s
  7172. if (null !== n.currentItem) {
  7173. var p, f
  7174. $('#status')
  7175. .find('.curIdx')
  7176. .text(n.currentItem[0] + 1),
  7177. n.onTheBus ? ((p = 'active'), (f = 'recent')) : ((f = 'active'), (p = 'recent'))
  7178. var g = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0]
  7179. /* for (r = 0; r < e.heroLocations.length; r += 1)
  7180. s = y.eq(r),
  7181. a = I.eq(r),
  7182. s.removeClass(f),
  7183. a.removeClass(f),
  7184. n.onTheBus && r === n.destinationItem[0] ? (s.addClass(p),
  7185. a.addClass(p),
  7186. W.activate(r)) : n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p),
  7187. a.addClass(p)) : (s.removeClass(p),
  7188. a.removeClass(p)) */
  7189. for (r = 0; r < e.heroLocations.length; r += 1) {
  7190. ;(s = y.eq(r)), (a = I.eq(r)), s.removeClass(f), a.removeClass(f)
  7191. if (n.onTheBus && r === n.destinationItem[0]) {
  7192. s.addClass(p)
  7193. a.addClass(p)
  7194. if (Date.now() - lastMoveScrollTime > 2000) {
  7195. //add 如果一段时间内用户不操作scrollbar,才focus回这个item
  7196. W.activate(r) // scrollbar slide to this
  7197. }
  7198. } else {
  7199. n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p), a.addClass(p)) : (s.removeClass(p), a.removeClass(p))
  7200. }
  7201. }
  7202. } 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')
  7203. o(t, i)
  7204. }),
  7205. document.addEventListener(
  7206. 'keydown',
  7207. function (n) {
  7208. switch ((J.updateInteraction(Se.InteractionKey), n.which)) {
  7209. case we.ZERO:
  7210. Q.debug && e.toggleAlpha()
  7211. break
  7212. case we.NINE:
  7213. Q.debug && se.toggle()
  7214. break
  7215. case we.ONE:
  7216. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA)
  7217. break
  7218. case we.TWO:
  7219. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE)
  7220. break
  7221. case we.THREE:
  7222. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN)
  7223. break
  7224. case we.FOUR:
  7225. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR)
  7226. break
  7227. case we.SPACE:
  7228. je.tourControls.visible && ($('#playHead').hasClass('playing') || Ze('tour'))
  7229. break
  7230. case we.RETURN:
  7231. Q.debug && e.toggleExplodeUp()
  7232. break
  7233. case we.P:
  7234. k()
  7235. break
  7236. case we.U:
  7237. B()
  7238. break
  7239. case we.X:
  7240. Q.debug && e.toggleExplode()
  7241. break
  7242. case we.PLUSEQUALS:
  7243. t.player.activatePersistentZooming(!0), ie.hideUi()
  7244. break
  7245. case we.DASHUNDERSCORE:
  7246. t.player.activatePersistentZooming(!1), ie.hideUi()
  7247. break
  7248. case we.SEVEN:
  7249. De.info('Zoom level: ' + t.player.zoomLevel + ', FOV: ' + t.player.zoomFov)
  7250. break
  7251. case we.EIGHT:
  7252. t.player.decreaseZoomSpeed()
  7253. break
  7254. case we.NINE:
  7255. t.player.increaseZoomSpeed()
  7256. }
  7257. return i && i.reticule.hide(), !0
  7258. }.bind(this)
  7259. ),
  7260. document.addEventListener(
  7261. 'keyup',
  7262. function (e) {
  7263. switch (e.which) {
  7264. case we.PLUSEQUALS:
  7265. t.player.deactivatePersistentZooming()
  7266. break
  7267. case we.DASHUNDERSCORE:
  7268. t.player.deactivatePersistentZooming()
  7269. }
  7270. }.bind(this)
  7271. ),
  7272. F(e),
  7273. L(e, t.player),
  7274. M(i),
  7275. te.setAutoPlay(e.heroCount()),
  7276. he.init(i, a.mode),
  7277. he.on(ue.OPENED, Ze.bind(this, 'help')),
  7278. fe.init(),
  7279. fe.on(
  7280. ge.OPENED,
  7281. (function () {
  7282. var e = document.getElementById('terms-modal')
  7283. return function () {
  7284. Ze('terms'), le.open(e)
  7285. }
  7286. })()
  7287. ),
  7288. fe.on(ge.CLOSED, le.reset),
  7289. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  7290. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  7291. Q.profiling.enabled && se.show(),
  7292. ve.init(t)
  7293. }
  7294. function M(e) {
  7295. var t = function (e, t) {
  7296. $(e)
  7297. .find('a')
  7298. .each(function (e, i) {
  7299. t ? $(i).removeClass('buttonZoomDisabled').addClass('buttonZoomEnabled') : $(i).addClass('buttonZoomDisabled').removeClass('buttonZoomEnabled'),
  7300. (i.style.pointerEvents = t ? 'auto' : 'none')
  7301. })
  7302. },
  7303. i = function () {
  7304. e.zoomLevel >= Q.zoom.max ? t('#gui-zoomin', !1) : t('#gui-zoomin', !0), e.zoomLevel <= Q.zoom.min ? t('#gui-zoomout', !1) : t('#gui-zoomout', !0)
  7305. }
  7306. e.on(Ne.ZoomMax, function () {
  7307. t('#gui-zoomin', !1), t('#gui-zoomout', !0)
  7308. }),
  7309. e.on(Ne.ZoomMin, function () {
  7310. t('#gui-zoomin', !0), t('#gui-zoomout', !1)
  7311. }),
  7312. e.on(Ne.ZoomIn, function () {
  7313. t('#gui-zoomout', !0)
  7314. }),
  7315. e.on(Ne.ZoomOut, function () {
  7316. t('#gui-zoomin', !0)
  7317. }),
  7318. i()
  7319. }
  7320. function R(e) {
  7321. O(e)
  7322. }
  7323. function P(e) {
  7324. O(e)
  7325. }
  7326. function O(e) {
  7327. var t = e.waitQueue.length
  7328. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  7329. }
  7330. function L(e, t) {
  7331. He = {
  7332. gui: null,
  7333. visible: !1,
  7334. model: e,
  7335. player: t
  7336. }
  7337. }
  7338. function D(e, t) {
  7339. function i() {
  7340. var i = t.toJSON()
  7341. ;(n.linkToLocation = window.location.protocol + '//' + window.location.host + window.location.pathname + '?m=' + e.sid + '&start=' + be.serialize(i)),
  7342. t.tagManager.activeTag && (n.linkToLocation += '&tag=' + t.tagManager.activeTag.sid)
  7343. }
  7344. var n = {},
  7345. r = new Le.GUI({
  7346. autoPlace: !0,
  7347. width: '60%'
  7348. })
  7349. i(), t.on(xe.ViewChanged, i), r.add(n, 'linkToLocation').name(Re.LINK_TO_LOCATION).listen(), (r.domElement.id = 'datLinks')
  7350. var o = [].slice.call(r.domElement.querySelectorAll('.property-name'))
  7351. return (
  7352. o.forEach(function (e) {
  7353. if (!K.detectSafari()) {
  7354. var t = document.createElement('button')
  7355. t.classList.add('btn-deep-link'), (t.innerText = Re.MENU_COPY), e.nextSibling.appendChild(t)
  7356. var i = function () {
  7357. alert(Re.LINK_ALERT_COPY), t.hide()
  7358. }
  7359. t.addEventListener('click', function (e) {
  7360. try {
  7361. var t = e.target.parentNode.childNodes[0]
  7362. t.select()
  7363. var n = document.execCommand('copy')
  7364. t.blur(), n || i()
  7365. } catch (e) {
  7366. i()
  7367. }
  7368. })
  7369. }
  7370. }),
  7371. $(r.__closeButton).hide(),
  7372. r
  7373. )
  7374. }
  7375. function N(e) {
  7376. He.gui || (He.gui = D(He.model, He.player)), (He.visible = e), e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  7377. }
  7378. function B() {
  7379. N(!He.visible)
  7380. }
  7381. function F(e) {
  7382. ke = {
  7383. gui: null,
  7384. visible: !1,
  7385. model: e
  7386. }
  7387. }
  7388. function V(e) {
  7389. var t = new Le.GUI()
  7390. return (
  7391. t
  7392. .add(Q, 'showSweeps')
  7393. .name('Show sweeps')
  7394. .onFinishChange(function () {
  7395. e.setSweepVisibility(Q.showSweeps)
  7396. }),
  7397. t.add(Q, 'rotationAccelerationInside', 0.1, 10).name('Rotation speed').step(0.1),
  7398. t
  7399. .add(Q.transition, 'flyTime', 0, 5e3)
  7400. .name('Transition time')
  7401. .onFinishChange(function () {
  7402. ;(Q.transition.flySpeed = 0),
  7403. t.__controllers.forEach(function (e) {
  7404. e.updateDisplay()
  7405. })
  7406. }),
  7407. t.add(Q.path, 'opacity', 0, 1).name('Path opacity'),
  7408. $(t.__closeButton).hide(),
  7409. t
  7410. )
  7411. }
  7412. function U(e) {
  7413. ke.gui || (ke.gui = V(ke.model)), (ke.visible = e), e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  7414. }
  7415. function k() {
  7416. U(!ke.visible)
  7417. }
  7418. function H() {
  7419. function e(e) {
  7420. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target) /* || e.preventDefault()*/
  7421. }
  7422. $('body').css('touch-action', 'none'),
  7423. $('#gui-parent')
  7424. .find('*:not(#tag-billboards)')
  7425. .on('touchmove', function (e) {
  7426. // e.preventDefault()
  7427. })
  7428. var t = document.getElementById('terms-text'),
  7429. i = document.getElementById('more-help-wrapper'),
  7430. n = (document.getElementById('navigation-help-wrapper'), document.getElementById('help-dialog'), document.getElementById('tag-billboards'))
  7431. Q.useWheel && (document.body.addEventListener('mousewheel', e, { passive: false }), document.body.addEventListener('DOMMouseScroll', e)),
  7432. $('#terms-text, #more-help-wrapper, #navigation-help-wrapper')
  7433. .off('touchmove')
  7434. .on('touchmove', function (e) {
  7435. e.stopPropagation()
  7436. })
  7437. }
  7438. function G(e, t) {
  7439. for (var i = []; e; ) i.push(e), (e = e.parentNode)
  7440. for (; t && i.indexOf(t) === -1; ) t = t.parentNode
  7441. return t
  7442. }
  7443. function z() {
  7444. var e,
  7445. t = function (t) {
  7446. e = 0 === t.button || 1 === t.which ? t.target : null
  7447. },
  7448. i = function (t) {
  7449. e !== t.target && (e = G(e, t.target))
  7450. var i = document.getElementById('gui-parent')
  7451. if ((G(i, e) !== i && (e = null), e)) {
  7452. var n
  7453. try {
  7454. n = new MouseEvent('click', t)
  7455. } catch (e) {
  7456. ;(n = document.createEvent('MouseEvents')),
  7457. n.initMouseEvent(
  7458. 'click',
  7459. t.bubbles,
  7460. t.cancelable,
  7461. t.view,
  7462. t.detail,
  7463. t.screenX,
  7464. t.screenY,
  7465. t.clientX,
  7466. t.clientY,
  7467. t.ctrlKey,
  7468. t.altKey,
  7469. t.shiftKey,
  7470. t.metaKey,
  7471. t.button,
  7472. t.relatedTarget
  7473. )
  7474. }
  7475. ;(n.syntheticClick = !0), e.dispatchEvent(n), (e = null)
  7476. }
  7477. }
  7478. document.body.addEventListener('mousedown', t, !0),
  7479. document.body.addEventListener('mouseup', i, !0),
  7480. document.getElementById('gui-parent').addEventListener(
  7481. 'click',
  7482. function (e) {
  7483. e.syntheticClick || (e.stopPropagation(), 'A' === e.target.nodeName && e.preventDefault())
  7484. },
  7485. !0
  7486. )
  7487. }
  7488. var lastMoveScrollTime = 0 //add
  7489. var W,
  7490. j,
  7491. Y,
  7492. X,
  7493. Z,
  7494. q,
  7495. K = (e('three'), e('../util/ajax'), e('../util/browser')),
  7496. Q = e('../settings'),
  7497. J = e('../analytics'),
  7498. ee = (e('../util/transitions'), e('../util/camera'), e('../util/logger')),
  7499. te = (e('../objects/Snapshot'), e('./helpManager')),
  7500. ie = e('./immersiveMode'),
  7501. ne = e('./loadingScreen'),
  7502. re = e('./landingScreen'),
  7503. oe = e('./playButton'),
  7504. ae = e('./populateModal'),
  7505. se = e('./memoryUsage'),
  7506. le = e('./closer/modalCloser'),
  7507. ce = e('./closer/ModalCloserEvent'),
  7508. he = e('./help/help'),
  7509. ue = e('./help/HelpEvent'),
  7510. de = e('./title/titleBar'),
  7511. pe = e('./title/TitleEvents'),
  7512. fe = e('./terms/terms'),
  7513. ge = e('./terms/TermsEvent'),
  7514. me = e('./title/tagToggle'),
  7515. ve = e('./tourInteraction'),
  7516. Ae = e('./vr/vrModal'),
  7517. ye = e('./vr/vrEvent'),
  7518. Ce = e('./sharing/modal'),
  7519. Ie = e('./webvr/webVRgui'),
  7520. Ee = e('./webvr/WebVrEvent'),
  7521. be = e('../controls/serializer'),
  7522. we = e('../enum/Keys'),
  7523. _e = e('../enum/Viewmode'),
  7524. Te = (e('../enum/BlackoutStyle'), e('../tag/Media/MediaEvent')),
  7525. xe = (e('../enum/PathDiscardMode'), e('../enum/PathDisplayMode'), e('../enum/DirectorEvents'), e('../enum/PlayerEvents')),
  7526. Se = e('../enum/ControlEvents'),
  7527. Me = e('./sharing/ShareEvents'),
  7528. Re = e('../localization/localize'),
  7529. Pe = (e('../enum/Vectors'), e('../enum/WarpStyle'), e('../enum/AlignmentType'), e('../enum/VROption')),
  7530. Oe = e('./konami'),
  7531. Le = e('../lib/dat.gui'),
  7532. De = new ee(i),
  7533. Ne = (e('../util/showcase'), e('../enum/ZoomEvents')),
  7534. Be = _e.DOLLHOUSE,
  7535. Fe = 0,
  7536. Ve = 0,
  7537. Ue = ['.hideTarget'],
  7538. ke = null,
  7539. He = null,
  7540. Ge = !1,
  7541. ze = !1,
  7542. We = !1,
  7543. je = {
  7544. coBrand: {
  7545. visible: !0,
  7546. elements: ['.co-brand', '#loaderCoBrand']
  7547. },
  7548. help: {
  7549. visible: !0,
  7550. elements: ['.nav-help', '#nav-help']
  7551. },
  7552. tourControls: {
  7553. visible: !0,
  7554. elements: ['.next', '.previous', '#play']
  7555. },
  7556. highlight: {
  7557. visible: !0,
  7558. elements: ['#drawer', '#pullTab']
  7559. },
  7560. share: {
  7561. visible: !0,
  7562. elements: ['.socialButton', '#share']
  7563. },
  7564. fullScreen: {
  7565. visible: !0,
  7566. elements: ['#gui-fullscreen']
  7567. },
  7568. floors: {
  7569. visible: !0,
  7570. elements: ['.gui-floor']
  7571. }
  7572. },
  7573. Ye = (function () {
  7574. var e = document.getElementById('drawer')
  7575. return function () {
  7576. $('#player').height() < 400 && e.classList.contains('open') && a()
  7577. }
  7578. })(),
  7579. Xe = (function () {
  7580. var e = document.getElementById('meta-info')
  7581. return function () {
  7582. $('#player').height() < 400 && e.classList.contains('expand') && de.toggleMeta(!0)
  7583. }
  7584. })(),
  7585. Ze = (function (e) {
  7586. function t() {
  7587. u.classList.contains('expand') && de.toggleMeta(!0)
  7588. }
  7589. function i() {
  7590. fe.hide()
  7591. }
  7592. function n() {
  7593. he.close()
  7594. }
  7595. function r() {
  7596. Ae.dismiss()
  7597. }
  7598. function o() {
  7599. p.hasClass('open') && a(!0)
  7600. }
  7601. function l() {
  7602. Ce.hide()
  7603. }
  7604. function c() {
  7605. f.hasClass('open') && f.removeClass('open')
  7606. }
  7607. function h() {
  7608. d.classList.contains('fadeIn') && (d.classList.contains('landing') ? re.dismissModal() : d.classList.contains('tour') && ve.dismissModal())
  7609. }
  7610. var u = document.getElementById('meta-info'),
  7611. d = document.getElementById('interaction-modal'),
  7612. p = $('#drawer').eq(0),
  7613. f = $('.gui-floor').eq(0),
  7614. g = $('.vr-popup').eq(0)
  7615. return function (e) {
  7616. switch (e) {
  7617. case 'info':
  7618. i(), n(), Ye(), l(), c(), r(), h()
  7619. break
  7620. case 'terms':
  7621. t(), n(), o(), l(), c(), r(), h()
  7622. break
  7623. case 'help':
  7624. t(), i(), l(), c(), r(), h()
  7625. break
  7626. case 'vr':
  7627. t(), i(), l(), c(), n(), h(), s(g) && o()
  7628. break
  7629. case 'highlights':
  7630. Xe(), i(), l(), c()
  7631. break
  7632. case 'share':
  7633. t(), i(), n(), c(), r(), h()
  7634. break
  7635. case 'floor':
  7636. i(), l(), r()
  7637. break
  7638. case 'view':
  7639. c(), l(), i(), r()
  7640. break
  7641. case 'tour':
  7642. i(), l(), c(), r()
  7643. break
  7644. case 'move':
  7645. i(), l(), c(), r()
  7646. break
  7647. case 'resize':
  7648. t(), Ye(), c()
  7649. break
  7650. case 'tag':
  7651. i(), n(), l(), c(), r()
  7652. }
  7653. }
  7654. })()
  7655. $(document).on('fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange', function (e) {
  7656. $('#gui-fullscreen').toggle(!K.isFullscreen()),
  7657. $('#gui-fullscreen-exit').toggle(!!K.isFullscreen()),
  7658. setTimeout(function () {
  7659. $('.icon:visible').hide().show(0)
  7660. }, 100)
  7661. }),
  7662. $('#gui-fullscreen')
  7663. .find('a')
  7664. .on('click', function (e) {
  7665. l(e),
  7666. K.requestFullscreen($('body')[0]),
  7667. J.track('showcase_gui', {
  7668. gui_action: 'click_enter_fullscreen',
  7669. interaction_source: 'gui'
  7670. })
  7671. //czj
  7672. //W.reload()
  7673. }),
  7674. $('#gui-fullscreen-exit')
  7675. .find('a')
  7676. .on('click', function (e) {
  7677. l(e),
  7678. K.exitFullscreen(),
  7679. J.track('showcase_gui', {
  7680. gui_action: 'click_exit_fullscreen',
  7681. interaction_source: 'gui'
  7682. })
  7683. })
  7684. $(window)
  7685. .on('resize', function (e) {
  7686. var t = e.target.innerHeight,
  7687. i = e.target.innerWidth
  7688. ;(t === X && i === Z) || (je.highlight.visible && w(), Ze('resize'), $('.pinTop.right').removeClass('hideUnderMeta'), c(), (X = t), (Z = i))
  7689. })
  7690. .resize(),
  7691. K.supportsFullscreen() || $('#gui-fullscreen').hide(),
  7692. $('#pullTab').on('click', function (e) {
  7693. l(e),
  7694. $('#drawer').hasClass('open')
  7695. ? (J.trackAlways('showcase_gui', {
  7696. gui_action: 'hide_highlight_reel'
  7697. }),
  7698. $(this).addClass('open').children('img').attr('src', 'images/auto.png'))
  7699. : (J.trackAlways('showcase_gui', {
  7700. gui_action: 'show_highlight_reel'
  7701. }),
  7702. $(this).removeClass('open').children('img').attr('src', 'images/auto-suspend.png'))
  7703. a()
  7704. })
  7705. /***********************方奕卓 热点列表事件监听 ************************/
  7706. if (window.DATA.showHotListSta) {
  7707. $('#hotList').css('display', '')
  7708. $('#hotList').on('click', function (e) {
  7709. l(e)
  7710. var hotList = $('#hotListWrap')[0]
  7711. var isActive = hotList.classList.contains('hotListActive')
  7712. if (isActive) {
  7713. hotList.classList.remove('hotListActive')
  7714. this.classList.remove('active')
  7715. } else {
  7716. hotList.classList.add('hotListActive')
  7717. this.classList.add('active')
  7718. }
  7719. }),
  7720. $('#hotListContent ul').on('mouseover', function (e) {
  7721. l(e)
  7722. var target = e.target
  7723. var hotList = document.getElementById('hotListWrap')
  7724. if (target.tagName === 'SPAN') {
  7725. var targetParent = target.parentElement.parentElement
  7726. if (target.offsetWidth + 116 >= targetParent.clientWidth) {
  7727. hotList.style.width = target.offsetWidth + 116 + 'px'
  7728. } else {
  7729. hotList.style.width = ''
  7730. }
  7731. } else if (target.tagName === 'LI') {
  7732. var targetParent = target.parentElement
  7733. if (target.children[0].offsetWidth + 116 >= targetParent.clientWidth) {
  7734. hotList.style.width = target.children[0].offsetWidth + 116 + 'px'
  7735. } else {
  7736. hotList.style.width = ''
  7737. }
  7738. } else {
  7739. hotList.style.width = ''
  7740. }
  7741. })
  7742. $('#hotListContent ul').on('click', function (e) {
  7743. l(e)
  7744. this.preElem && this.preElem.classList.remove('active')
  7745. if (e.target.tagName === 'SPAN') {
  7746. e.target.parentElement.classList.add('active')
  7747. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player, true) // 打开热点
  7748. this.preElem = e.target.parentElement
  7749. } else {
  7750. e.target.classList.add('active')
  7751. e.target.hot && e.target.hot.examine(window.player, true) // 打开热点
  7752. this.preElem = e.target
  7753. }
  7754. })
  7755. $('#hotListClose').on('click', function (e) {
  7756. l(e)
  7757. var hotList = $('#hotListWrap')[0]
  7758. hotList.classList.remove('hotListActive')
  7759. $('#hotListContent ul .active').removeClass('active')
  7760. $('#hotList')[0].classList.remove('active')
  7761. })
  7762. }
  7763. /*****************************************************************/
  7764. $('#more-menu-button').on('click', function (e) {
  7765. l(e)
  7766. var t = $('#more-menu')
  7767. t.toggleClass('open')
  7768. }),
  7769. (t.exports.init = S),
  7770. (t.exports.startLoading = x),
  7771. (t.exports.endLoading = d),
  7772. (t.exports.onProgress = u)
  7773. }).call(this, '/js/gui/gui.js')
  7774. },
  7775. {
  7776. '../analytics': 4,
  7777. '../controls/serializer': 14,
  7778. '../enum/AlignmentType': 17,
  7779. '../enum/BlackoutStyle': 18,
  7780. '../enum/ControlEvents': 21,
  7781. '../enum/DirectorEvents': 23,
  7782. '../enum/Keys': 30,
  7783. '../enum/PathDiscardMode': 38,
  7784. '../enum/PathDisplayMode': 39,
  7785. '../enum/PlayerEvents': 40,
  7786. '../enum/VROption': 47,
  7787. '../enum/Vectors': 50,
  7788. '../enum/Viewmode': 51,
  7789. '../enum/WarpStyle': 52,
  7790. '../enum/ZoomEvents': 53,
  7791. '../lib/dat.gui': 93,
  7792. '../localization/localize': 108,
  7793. '../tag/Media/MediaEvent': 131,
  7794. '../objects/Snapshot': 153,
  7795. '../settings': 166,
  7796. '../util/ajax': 181,
  7797. '../util/browser': 182,
  7798. '../util/camera': 183,
  7799. '../util/logger': 189,
  7800. '../util/showcase': 193,
  7801. '../util/transitions': 195,
  7802. './closer/ModalCloserEvent': 61,
  7803. './closer/modalCloser': 62,
  7804. './help/HelpEvent': 66,
  7805. './help/help': 67,
  7806. './helpManager': 68,
  7807. './immersiveMode': 69,
  7808. './konami': 70,
  7809. './landingScreen': 71,
  7810. './loadingScreen': 72,
  7811. './memoryUsage': 73,
  7812. './playButton': 74,
  7813. './populateModal': 75,
  7814. './sharing/ShareEvents': 76,
  7815. './sharing/modal': 77,
  7816. './terms/TermsEvent': 78,
  7817. './terms/terms': 79,
  7818. './title/TitleEvents': 80,
  7819. './title/tagToggle': 81,
  7820. './title/titleBar': 82,
  7821. './tourInteraction': 84,
  7822. './vr/vrEvent': 85,
  7823. './vr/vrModal': 87,
  7824. './webvr/WebVrEvent': 88,
  7825. './webvr/webVRgui': 89,
  7826. three: 217
  7827. }
  7828. ],
  7829. 66: [
  7830. function (e, t, i) {
  7831. 'use strict'
  7832. t.exports = Object.freeze({
  7833. OPENED: 'help.opened',
  7834. CLOSED: 'help.closed'
  7835. })
  7836. },
  7837. {}
  7838. ],
  7839. 67: [
  7840. function (e, t, i) {
  7841. 'use strict'
  7842. function n() {
  7843. g.on('click', function (e) {
  7844. if (S && S !== l.TRANSITIONING) {
  7845. var t = window.getComputedStyle(y).getPropertyValue('opacity') > 0
  7846. t && !M ? R.close() : r()
  7847. }
  7848. }),
  7849. w.on('click', function (e) {
  7850. R.close()
  7851. }),
  7852. E.on('click', function (e) {
  7853. S && S !== l.TRANSITIONING && (s(), o())
  7854. }),
  7855. b.on('click', function (e) {
  7856. s(), a()
  7857. })
  7858. }
  7859. function r() {
  7860. S &&
  7861. S !== l.TRANSITIONING &&
  7862. ((M = !0),
  7863. setTimeout(function () {
  7864. M = !1
  7865. }, d.help.modalStayDuration),
  7866. R.emit(h.OPENED),
  7867. m.addClass('open ' + S),
  7868. g.addClass('open'),
  7869. s(),
  7870. o(),
  7871. y.style.removeProperty ? y.style.removeProperty('display') : y.style.removeAttribute('display'),
  7872. y.classList.add('fadeIn'))
  7873. }
  7874. function o() {
  7875. E.addClass('underline-tab'), u.fill(_, c.NAVIGATION, S), m.addClass(S)
  7876. }
  7877. function a() {
  7878. b.addClass('underline-tab'), u.fill(T, c.MORE_HELP), m.addClass('more-help')
  7879. }
  7880. function s(e, t) {
  7881. m.removeClass('more-help ' + l.PANORAMA + ' ' + l.DOLLHOUSE + ' ' + l.FLOORPLAN + ' ' + l.OUTDOOR),
  7882. I.forEach(function (e) {
  7883. e.classList.remove('underline-tab')
  7884. })
  7885. }
  7886. var l = e('../../enum/Viewmode'),
  7887. c = e('../../enum/HelpModalType'),
  7888. h = e('./HelpEvent'),
  7889. u = (e('../helpManager'), e('./../populateModal')),
  7890. d = e('../../settings'),
  7891. p = e('../../util/common'),
  7892. f = e('events').EventEmitter,
  7893. g = $('.footer-help').eq(0),
  7894. m = $('#help-dialog').eq(0),
  7895. v = document.querySelector('#quick-logo'),
  7896. A = document.querySelector('#loaderCoBrand'),
  7897. y = document.querySelector('#help-dialog'),
  7898. C = document.querySelector('.footer'),
  7899. I = $('.help-tabs').children().toArray(),
  7900. E = $('.navigation-tab').eq(0),
  7901. b = $('.more-help-tab').eq(0),
  7902. w = ($('#interaction-modal').eq(0).find('.interaction').toArray(), m.find('.close').eq(0)),
  7903. _ = m.find('.interactions').toArray(),
  7904. T = m.find('.ui-instructions').toArray(),
  7905. x = l.PANORAMA,
  7906. S = l.PANORAMA,
  7907. M = !1,
  7908. R = {
  7909. init: function (e, t) {
  7910. ;(S = t),
  7911. (x = t),
  7912. [y, A, v, C].forEach(function (e) {
  7913. e.classList.add(u.deviceType)
  7914. }),
  7915. n()
  7916. },
  7917. close: function () {
  7918. if (m.hasClass('open') && (this.emit(h.CLOSED), g.removeClass('open'), m.removeClass('open'), y.classList.contains('fadeIn'))) {
  7919. y.classList.remove('fadeIn')
  7920. var e = S === l.TRANSITIONING ? x : S
  7921. u.clear(_, c.NAVIGATION, e)
  7922. }
  7923. },
  7924. updateMode: function (e) {
  7925. ;(x = S), (S = e)
  7926. }
  7927. }
  7928. p.extendObject(R, f.prototype), (t.exports = R)
  7929. },
  7930. {
  7931. '../../enum/HelpModalType': 28,
  7932. '../../enum/Viewmode': 51,
  7933. '../../settings': 166,
  7934. '../../util/common': 185,
  7935. '../helpManager': 68,
  7936. './../populateModal': 75,
  7937. './HelpEvent': 66,
  7938. events: 202
  7939. }
  7940. ],
  7941. 68: [
  7942. function (e, t, i) {
  7943. ;(function (i) {
  7944. 'use strict'
  7945. var n = e('../util/browser'),
  7946. r = e('./../util/logger'),
  7947. o = e('./../settings'),
  7948. a = new r(i),
  7949. s = (function () {
  7950. var e
  7951. try {
  7952. return (e = window.localStorage.getItem('visitCount') || '0'), (e = (parseFloat(e) + 1).toString()), window.localStorage.setItem('visitCount', e), a.debug('visitCount = ' + e), e
  7953. } catch (t) {
  7954. ;(e = '1'), a.debug("couldn't set local storage")
  7955. }
  7956. })(),
  7957. l = !1
  7958. t.exports = {
  7959. isHelpDisabled: function () {
  7960. return '0' === n.valueFromHash('help', null) || l
  7961. },
  7962. isLargeHelpEnabled: function () {
  7963. return ('1' === s || '1' === n.valueFromHash('help', null)) && !this.isHelpDisabled()
  7964. },
  7965. isSmallHelpEnabled: function () {
  7966. return '2' === n.valueFromHash('help', null) && !this.isHelpDisabled()
  7967. },
  7968. isHelpEnabled: function () {
  7969. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7970. },
  7971. setAutoPlay: function (e) {
  7972. l = o.warp.auto >= 0 && e > 1
  7973. }
  7974. }
  7975. }).call(this, '/js/gui/helpManager.js')
  7976. },
  7977. {
  7978. '../util/browser': 182,
  7979. './../settings': 166,
  7980. './../util/logger': 189
  7981. }
  7982. ],
  7983. 69: [
  7984. function (e, t, i) {
  7985. 'use strict'
  7986. function n(e, t, i, n) {
  7987. ;(F = n), r(e, t, i, F), o(), (N = t.mode)
  7988. }
  7989. function r(e, t, i, n) {
  7990. ;[C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function (t) {
  7991. e.controls[t].on(v.Move, a), e.controls[t].on(v.LongTap, c)
  7992. }),
  7993. M.on('mousewheel DOMMouseScroll', a),
  7994. i.on(m.TagActivated, a),
  7995. i.on(m.TagNavigation, a),
  7996. t.on(A.FlyingEnded, s),
  7997. t.on(A.ModeChanging, function (e, t) {
  7998. B = t !== C.PANORAMA && e !== C.PANORAMA
  7999. }),
  8000. t.on(A.ModeChanged, function (e, i) {
  8001. // 备注sg 漫游状态通信
  8002. if (window.threeReact.state3d) window.threeReact.state3d(t.mode)
  8003. ;(N = t.mode), i !== C.TRANSITIONING ? l() : a('modeChange')
  8004. }),
  8005. n.on(y.TourStart, function () {
  8006. ;(L = !0), a()
  8007. }),
  8008. n.on(y.TourEnd, function () {
  8009. ;(L = !1), l()
  8010. }),
  8011. n.on(y.ActionInterrupted, function () {
  8012. L = !1
  8013. }),
  8014. R.addEventListener(
  8015. 'touchend',
  8016. function () {
  8017. $('#pullTab').hasClass('opened') && !L && l()
  8018. },
  8019. !0
  8020. )
  8021. }
  8022. function o() {
  8023. p.isMobile()
  8024. ? (b.forEach(function (e) {
  8025. e.classList.add('mobile')
  8026. }),
  8027. w.click(l))
  8028. : (b.forEach(function (e) {
  8029. e.addEventListener(
  8030. 'mouseleave',
  8031. function () {
  8032. !M.is(':hover') && b[0].classList.contains('detectHover') && l()
  8033. },
  8034. !0
  8035. )
  8036. }),
  8037. M.mouseleave(function () {
  8038. b[0].classList.contains('detectHover') && l()
  8039. }))
  8040. }
  8041. function a(e) {
  8042. D ||
  8043. (d(e) && _.hasClass('playing')) ||
  8044. (clearTimeout(O),
  8045. (P = !0),
  8046. g.close(),
  8047. h(e),
  8048. N !== C.DOLLHOUSE &&
  8049. N !== C.FLOORPLAN &&
  8050. ((x.hasClass('expand') && !S.hasClass('closed')) || 2 === p.valueFromHash('title', 1),
  8051. _.hasClass('playing') ||
  8052. (b.forEach(function (e) {
  8053. e.classList.add('detectHover')
  8054. }),
  8055. (O = setTimeout(l, f.immersive.timeToShowAgain)))))
  8056. }
  8057. function s() {
  8058. _.hasClass('playing') || (clearTimeout(O), (O = setTimeout(l, f.immersive.timeToShowAgain)))
  8059. }
  8060. function l() {
  8061. clearTimeout(O),
  8062. (P = !1),
  8063. I.forEach(function (e) {
  8064. e.classList.remove('drawerOpen')
  8065. }),
  8066. L ||
  8067. E.forEach(function (e) {
  8068. e.classList.remove('duringTour')
  8069. }),
  8070. b.forEach(function (e) {
  8071. e.classList.remove('detectHover')
  8072. })
  8073. }
  8074. function c() {
  8075. P ? l() : a(),
  8076. (D = !0),
  8077. setTimeout(function () {
  8078. D = !1
  8079. }, f.immersive.uiStayDuration)
  8080. }
  8081. function h(e) {
  8082. !d(e) && L
  8083. ? E.forEach(function (e) {
  8084. e.classList.remove('drawerOpen'), e.classList.add('duringTour')
  8085. })
  8086. : _.hasClass('open')
  8087. ? E.forEach(function (e) {
  8088. e.classList.remove('duringTour'), e.classList.add('drawerOpen')
  8089. })
  8090. : B ||
  8091. N === C.FLOORPLAN ||
  8092. N === C.DOLLHOUSE ||
  8093. E.forEach(function (e) {
  8094. e.classList.add('fadeOut')
  8095. })
  8096. }
  8097. function u() {
  8098. T.hasClass('duringTour') || ((L = !1), a('gui'), l())
  8099. }
  8100. function d(e) {
  8101. return 'mouse' === e || 'touch' === e || 'key' === e || 'gui' === e
  8102. }
  8103. var p = e('../util/browser'),
  8104. f = e('../settings'),
  8105. g = e('./help/help'),
  8106. m = e('../enum/tagEvents'),
  8107. v = e('../enum/ControlEvents'),
  8108. A = e('../enum/PlayerEvents'),
  8109. y = e('../enum/DirectorEvents'),
  8110. A = e('../enum/PlayerEvents'),
  8111. C = e('../enum/Viewmode'),
  8112. I = $('.pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer').toArray(),
  8113. E = $('.pinBottom-container, #drawer-container, .footer').toArray(),
  8114. b = $('#hover-bottom, #hover-top').toArray(),
  8115. w = ($('#pullTab').eq(0), $('#playHead').eq(0), $('.pinBottom-container').eq(0)),
  8116. _ = $('#drawer').eq(0),
  8117. T = $('#drawer-container').eq(0),
  8118. x = $('#meta-info').eq(0),
  8119. S = $('.pinTop.left').eq(0),
  8120. M = $('#player').eq(0),
  8121. R = document.getElementById('pullTab'),
  8122. P = !1,
  8123. O = null,
  8124. L = !1,
  8125. D = !1,
  8126. N = null,
  8127. B = !1,
  8128. F = null
  8129. ;(t.exports.init = n), (t.exports.hideUi = a), (t.exports.resetDrawer = u)
  8130. },
  8131. {
  8132. '../enum/ControlEvents': 21,
  8133. '../enum/DirectorEvents': 23,
  8134. '../enum/tagEvents': 32,
  8135. '../enum/PlayerEvents': 40,
  8136. '../enum/Viewmode': 51,
  8137. '../settings': 166,
  8138. '../util/browser': 182,
  8139. './help/help': 67
  8140. }
  8141. ],
  8142. 70: [
  8143. function (e, t, i) {
  8144. ;(function (i) {
  8145. 'use strict'
  8146. function n(e, t, i) {
  8147. l.debug('konami has the modelInstance')
  8148. var n = []
  8149. $(window).on('keydown', function (e) {
  8150. n.push(e.which), n.length > o.secretPanelWord.length && n.shift(), s.equalLists(n, o.secretPanelWord) && (l.debug('Developer mode active.'), (o.debug = !0))
  8151. }),
  8152. $(window).on('keydown', function n(r) {
  8153. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i), $(window).off('keydown', n)) : console.warn("sorry we're not ready yet"))
  8154. })
  8155. }
  8156. var r = e('./../util/logger'),
  8157. o = e('./../settings'),
  8158. a = e('./debug'),
  8159. s = e('./../util/common'),
  8160. l = (e('./gui'), new r(i))
  8161. o.console && $('body').append('<div id="debug-console"></div>'), (t.exports.init = n)
  8162. }).call(this, '/js/gui/konami.js')
  8163. },
  8164. {
  8165. './../settings': 166,
  8166. './../util/common': 185,
  8167. './../util/logger': 189,
  8168. './debug': 63,
  8169. './gui': 65
  8170. }
  8171. ],
  8172. 71: [
  8173. function (e, t, i) {
  8174. 'use strict'
  8175. function n(e, t) {
  8176. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  8177. }
  8178. function r(e) {
  8179. var t = $.Deferred()
  8180. e || t.resolve()
  8181. var i = c.startupFlyinDelay
  8182. return e === p.PANORAMA && (i += c.dollhouse.transitionTime), setTimeout(t.resolve.bind(t), i), t
  8183. }
  8184. function o(e, t, i) {
  8185. var n = 0
  8186. c.quickstart.enabled && (a(i), (n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay))
  8187. var r = function () {
  8188. e.once(g.Move, l), t.once(f.TourStart, l)
  8189. }
  8190. s(n, r)
  8191. }
  8192. function a(e) {
  8193. return /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  8194. v.before(y),
  8195. A = $(".quick-brand").toArray()),*/
  8196. m.addClass('fadeOut'),
  8197. setTimeout(function () {
  8198. A.forEach(function (e) {
  8199. e.classList.add('fadeIn')
  8200. })
  8201. }, c.quickstart.showTextDelay),
  8202. setTimeout(function () {
  8203. A.forEach(function (e) {
  8204. e.classList.add('fadeOut')
  8205. })
  8206. }, c.quickstart.fadeOutDelay),
  8207. !0
  8208. }
  8209. function s(e, t) {
  8210. setTimeout(function () {
  8211. if (h.isHelpEnabled()) {
  8212. if ((t(), u.init(), C.addClass('fadeIn landing ' + u.deviceType), h.isSmallHelpEnabled())) return void C.addClass('small')
  8213. u.fill(I, d.LANDING[E]), C.addClass(E)
  8214. }
  8215. }, e)
  8216. //csz 用户引导界面
  8217. var helpData = {
  8218. pc: ['images/pc_step1.png', 'images/pc_step2.png', 'images/pc_step3.png'],
  8219. mobile: ['images/phone_step1.png', 'images/phone_step2.png', 'images/phone_step3.png']
  8220. }
  8221. var navIcon = $('.nav-icon .icon')
  8222. if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) navIcon.attr('src', helpData.mobile[0])
  8223. function paging(id) {
  8224. id.on('click', function () {
  8225. var navPage = null
  8226. $(this).attr('data-id') == 'plus' ? (navPage = +navIcon.attr('data-page') + 1) : (navPage = +navIcon.attr('data-page') - 1)
  8227. if (navPage > helpData.length || navPage < 1) return false
  8228. if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
  8229. navIcon.attr({ 'data-page': navPage, src: helpData.mobile[navPage - 1] })
  8230. } else {
  8231. navIcon.attr({ 'data-page': navPage, src: helpData.pc[navPage - 1] })
  8232. }
  8233. })
  8234. }
  8235. paging($('.next-button'))
  8236. paging($('.prev-button'))
  8237. }
  8238. function l() {
  8239. u.clear(I, d.LANDING[E]), C.removeClass('fadeIn')
  8240. }
  8241. var c = e('../settings'),
  8242. h = (e('./help/help'), e('./helpManager')),
  8243. u = e('./populateModal'),
  8244. d = e('../enum/HelpModalType'),
  8245. p = e('../enum/Viewmode'),
  8246. f = e('../enum/DirectorEvents'),
  8247. g = e('../enum/PlayerEvents'),
  8248. m = $('#quick-blackout').eq(0),
  8249. v = $('#quick-logo').eq(0),
  8250. A = $('.quick-brand').toArray(),
  8251. y = $('#loaderCoBrand').eq(0),
  8252. C = $('#interaction-modal').eq(0),
  8253. I = C.find('.interaction').toArray(),
  8254. E = ($('#model-title, .pinBottom-container, #drawer-container, #drawer, .footer').toArray(), '')
  8255. ;(t.exports.delayLanding = r), (t.exports.showMessage = o), (t.exports.init = n), (t.exports.dismissModal = l)
  8256. },
  8257. {
  8258. '../enum/DirectorEvents': 23,
  8259. '../enum/HelpModalType': 28,
  8260. '../enum/PlayerEvents': 40,
  8261. '../enum/Viewmode': 51,
  8262. '../settings': 166,
  8263. './help/help': 67,
  8264. './helpManager': 68,
  8265. './populateModal': 75
  8266. }
  8267. ],
  8268. 72: [
  8269. function (e, t, i) {
  8270. 'use strict'
  8271. var n = e('./circleLoader').circleLoader
  8272. t.exports = {
  8273. element: $('#gui-loading'),
  8274. hide: function (e) {
  8275. n.done(), this.element.fadeOut(1500, e)
  8276. },
  8277. show: function (e) {
  8278. this.element.fadeIn(
  8279. 500,
  8280. function () {
  8281. this.element.css('display', 'table'), e && e()
  8282. }.bind(this)
  8283. )
  8284. },
  8285. progress: function (e) {
  8286. n.set(e)
  8287. }
  8288. }
  8289. },
  8290. {
  8291. './circleLoader': 60
  8292. }
  8293. ],
  8294. 73: [
  8295. function (e, t, i) {
  8296. 'use strict'
  8297. var n = e('../settings'),
  8298. r = $('#memory-info'),
  8299. o = r.find('#memory-gpu'),
  8300. a = !1
  8301. t.exports = {
  8302. show: function () {
  8303. n.profiling.enabled && (r.show(), (a = !0))
  8304. },
  8305. hide: function () {
  8306. r.hide(), (a = !1)
  8307. },
  8308. toggle: function () {
  8309. a ? this.hide() : this.show()
  8310. },
  8311. update: function (e) {
  8312. n.profiling.enabled && o.text(Math.floor(e / 1e6) + 'MB')
  8313. }
  8314. }
  8315. },
  8316. {
  8317. '../settings': 166
  8318. }
  8319. ],
  8320. 74: [
  8321. function (e, t, i) {
  8322. 'use strict'
  8323. var n = e('../util/browser'),
  8324. r = e('../analytics')
  8325. e('../settings')
  8326. t.exports = {
  8327. show: function (e, t) {
  8328. $('#gui-message').fadeOut(500, function () {
  8329. t()
  8330. })
  8331. }
  8332. }
  8333. },
  8334. {
  8335. '../analytics': 4,
  8336. '../settings': 166,
  8337. '../util/browser': 182
  8338. }
  8339. ],
  8340. 75: [
  8341. function (e, t, i) {
  8342. 'use strict'
  8343. function n(e, t, i, n) {
  8344. function r(e) {
  8345. return e.classList.contains(a)
  8346. }
  8347. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  8348. //for (var a in o) {
  8349. //var s = e.find(r);
  8350. //for (var l in o[a]) {
  8351. //var c = o[a][l];
  8352. //if ("top-info" === l || "bottom-info" === l) {
  8353. //var h = n ? c : "";
  8354. //czj 注释掉第一次打开的用户引导
  8355. //s.querySelector("." + l).textContent = h
  8356. //} else {
  8357. //var u = n ? c : "";
  8358. //, d = s.querySelector("." + l);
  8359. //d.src = u,
  8360. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  8361. //}
  8362. //}
  8363. //}
  8364. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  8365. // p.forEach(function(e) {
  8366. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  8367. // })
  8368. }
  8369. var r = e('../util/browser'),
  8370. o = e('../localization/localize'),
  8371. a = e('../enum/HelpModalType'),
  8372. s = (e('../enum/HelpModalSize'), e('../enum/Viewmode'))
  8373. t.exports = {
  8374. init: function () {
  8375. if (!this.hasInitialized) {
  8376. ;(this.hasInitialized = !0),
  8377. (this.deviceType = r.isMobile() ? 'mobile' : 'desktop'),
  8378. (this.assets = {}),
  8379. (this.assets[a.LANDING[s.PANORAMA]] = {
  8380. desktop: {
  8381. left: {
  8382. 'top-info': o.ROTATE,
  8383. 'big-image': 'images/nav_help_mouse_drag_left.png',
  8384. keyboard: 'images/nav_help_keyboard_left_right.png'
  8385. },
  8386. middle: {
  8387. 'top-info': o.MOVE,
  8388. 'big-image': 'images/nav_help_mouse_click.png',
  8389. keyboard: 'images/nav_help_keyboard_up_down.png'
  8390. },
  8391. right: {
  8392. 'top-info': o.ZOOM,
  8393. 'big-image': 'images/nav_help_mouse_zoom.png',
  8394. keyboard: 'images/nav_help_zoom_keys.png'
  8395. }
  8396. },
  8397. mobile: {
  8398. left: {
  8399. 'top-info': o.ROTATE,
  8400. 'big-image': 'images/nav_help_gesture_drag.png'
  8401. },
  8402. middle: {
  8403. 'top-info': o.MOVE,
  8404. 'big-image': 'images/nav_help_gesture_tap.png'
  8405. },
  8406. right: {
  8407. 'top-info': o.ZOOM,
  8408. 'big-image': 'images/nav_help_gesture_pinch.png'
  8409. }
  8410. }
  8411. }),
  8412. (this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]]))),
  8413. (this.assets[a.LANDING[s.DOLLHOUSE]] = {
  8414. desktop: {
  8415. left: {
  8416. 'top-info': o.ROTATE,
  8417. 'big-image': 'images/nav_help_mouse_drag_left.png',
  8418. keyboard: 'images/nav_help_keyboard_left_right.png'
  8419. },
  8420. middle: {
  8421. 'top-info': o.MOVE,
  8422. 'big-image': 'images/nav_help_mouse_position_right.png'
  8423. }
  8424. },
  8425. mobile: {
  8426. left: {
  8427. 'top-info': o.ROTATE,
  8428. 'big-image': 'images/nav_help_gesture_drag.png'
  8429. },
  8430. middle: {
  8431. 'top-info': o.MOVE,
  8432. 'big-image': 'images/nav_help_gesture_position_two_finger.png'
  8433. }
  8434. }
  8435. }),
  8436. (this.assets[a.LANDING[s.FLOORPLAN]] = {
  8437. desktop: {
  8438. left: {
  8439. 'top-info': o.MOVE,
  8440. 'big-image': 'images/nav_help_mouse_position_left.png'
  8441. },
  8442. middle: {
  8443. 'top-info': o.ROTATE,
  8444. 'big-image': 'images/nav_help_mouse_drag_right.png',
  8445. keyboard: 'images/nav_help_keyboard_left_right.png'
  8446. }
  8447. },
  8448. mobile: {
  8449. left: {
  8450. 'top-info': o.MOVE,
  8451. 'big-image': 'images/nav_help_gesture_position.png'
  8452. },
  8453. middle: {
  8454. 'top-info': o.ROTATE,
  8455. 'big-image': 'images/nav_help_gesture_drag_two_finger.png'
  8456. }
  8457. }
  8458. })
  8459. var e = {
  8460. 'top-info': o.INSIDE,
  8461. 'big-image': 'images/nav_help_click_inside.png',
  8462. keyboard: 'images/nav_help_inside_key.png'
  8463. }
  8464. ;(this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e), (this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e), (this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e)
  8465. var t = {
  8466. 'top-info': o.INSIDE,
  8467. 'big-image': 'images/nav_help_tap_inside.png'
  8468. }
  8469. ;(this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t),
  8470. (this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t),
  8471. (this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t),
  8472. (this.assets[a.NAVIGATION] = {}),
  8473. (this.assets[a.NAVIGATION][s.PANORAMA] = {
  8474. desktop: {
  8475. left: {
  8476. 'top-info': o.HELP_DESKTOP_PANORAMA_1A,
  8477. 'bottom-info': o.HELP_DESKTOP_PANORAMA_1B,
  8478. 'big-image': 'images/nav_help_mouse_drag_left.png',
  8479. keyboard: 'images/nav_help_keyboard_left_right.png'
  8480. },
  8481. middle: {
  8482. 'top-info': o.HELP_DESKTOP_PANORAMA_2A,
  8483. 'bottom-info': o.HELP_DESKTOP_PANORAMA_2B,
  8484. 'big-image': 'images/nav_help_mouse_click.png',
  8485. keyboard: 'images/nav_help_keyboard_up_down.png'
  8486. },
  8487. right: {
  8488. 'top-info': o.HELP_DESKTOP_PANORAMA_3A,
  8489. 'bottom-info': o.HELP_DESKTOP_PANORAMA_3B,
  8490. 'big-image': 'images/nav_help_mouse_zoom.png',
  8491. keyboard: 'images/nav_help_zoom_keys.png'
  8492. }
  8493. },
  8494. mobile: {
  8495. left: {
  8496. 'top-info': o.HELP_MOBILE_PANORAMA_1,
  8497. 'big-image': 'images/nav_help_gesture_drag.png'
  8498. },
  8499. middle: {
  8500. 'top-info': o.HELP_MOBILE_PANORAMA_2,
  8501. 'big-image': 'images/nav_help_gesture_tap.png'
  8502. },
  8503. right: {
  8504. 'top-info': o.HELP_MOBILE_3,
  8505. 'big-image': 'images/nav_help_gesture_pinch.png'
  8506. }
  8507. }
  8508. }),
  8509. (this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  8510. desktop: {
  8511. left: {
  8512. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_1A,
  8513. 'bottom-info': o.HELP_DESKTOP_DOLLHOUSE_1B,
  8514. 'big-image': 'images/nav_help_mouse_drag_left.png',
  8515. keyboard: 'images/nav_help_keyboard_all.png'
  8516. },
  8517. middle: {
  8518. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_2A,
  8519. 'big-image': 'images/nav_help_mouse_position_right.png'
  8520. },
  8521. right: {
  8522. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_3A,
  8523. 'big-image': 'images/nav_help_mouse_zoom.png'
  8524. }
  8525. },
  8526. mobile: {
  8527. left: {
  8528. 'top-info': o.HELP_MOBILE_DOLLHOUSE_1,
  8529. 'big-image': 'images/nav_help_gesture_drag.png'
  8530. },
  8531. middle: {
  8532. 'top-info': o.HELP_MOBILE_DOLLHOUSE_2,
  8533. 'big-image': 'images/nav_help_gesture_position_two_finger.png'
  8534. },
  8535. right: {
  8536. 'top-info': o.HELP_MOBILE_3,
  8537. 'big-image': 'images/nav_help_gesture_pinch.png'
  8538. }
  8539. }
  8540. }),
  8541. (this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8542. desktop: {
  8543. left: {
  8544. 'top-info': o.HELP_DESKTOP_FLOORPLAN_1A,
  8545. 'big-image': 'images/nav_help_mouse_position_left.png'
  8546. },
  8547. middle: {
  8548. 'top-info': o.HELP_DESKTOP_FLOORPLAN_2A,
  8549. 'bottom-info': o.HELP_DESKTOP_FLOORPLAN_2B,
  8550. 'big-image': 'images/nav_help_mouse_drag_right.png',
  8551. keyboard: 'images/nav_help_keyboard_left_right.png'
  8552. },
  8553. right: {
  8554. 'top-info': o.HELP_DESKTOP_FLOORPLAN_3A,
  8555. 'bottom-info': o.HELP_DESKTOP_FLOORPLAN_3B,
  8556. 'big-image': 'images/nav_help_mouse_zoom.png',
  8557. keyboard: 'images/nav_help_keyboard_up_down.png'
  8558. }
  8559. },
  8560. mobile: {
  8561. left: {
  8562. 'top-info': o.HELP_MOBILE_FLOORPLAN_1,
  8563. 'big-image': 'images/nav_help_gesture_position.png'
  8564. },
  8565. middle: {
  8566. 'top-info': o.HELP_MOBILE_FLOORPLAN_2,
  8567. 'big-image': 'images/nav_help_gesture_drag_two_finger.png'
  8568. },
  8569. right: {
  8570. 'top-info': o.HELP_MOBILE_3,
  8571. 'big-image': 'images/nav_help_gesture_pinch.png'
  8572. }
  8573. }
  8574. }),
  8575. (this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA]))),
  8576. (this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8577. 'top-info': o.HELP_DESKTOP_360_2A,
  8578. 'bottom-info': o.HELP_DESKTOP_360_2B,
  8579. 'big-image': 'images/nav_help_click_inside.png',
  8580. keyboard: 'images/nav_help_inside_key.png'
  8581. }),
  8582. (this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8583. 'top-info': o.HELP_MOBILE_360_2,
  8584. 'big-image': 'images/nav_help_tap_inside.png'
  8585. }),
  8586. (this.assets[a.MORE_HELP] = {
  8587. desktop: {
  8588. 'more-help-hlr': {
  8589. 'top-info': o.HELP_MORE_HLR_A,
  8590. 'big-image': 'images/nav_help_expand.svg',
  8591. 'bottom-info': o.HELP_DESKTOP_MORE_HLR_B
  8592. },
  8593. 'more-help-dollhouse': {
  8594. 'top-info': o.HELP_MORE_DOLLHOUSE_A,
  8595. 'big-image': 'images/nav_help_dollhouse.svg',
  8596. 'bottom-info': o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8597. },
  8598. 'more-help-floors': {
  8599. 'top-info': o.HELP_MORE_FLOORS_A,
  8600. 'big-image': 'images/nav_help_floor picker.svg',
  8601. 'bottom-info': o.HELP_DESKTOP_MORE_FLOORS_B
  8602. },
  8603. 'more-help-tag': {
  8604. 'top-info': o.HELP_MORE_TAG_A,
  8605. 'big-image': 'images/nav_help_tag.svg',
  8606. 'bottom-info': o.HELP_DESKTOP_MORE_TAG_B
  8607. },
  8608. 'more-help-zoom': {
  8609. 'top-info': o.HELP_MORE_ZOOM_A,
  8610. 'big-image': 'images/nav_help_zoom.svg',
  8611. 'bottom-info': o.HELP_DESKTOP_MORE_ZOOM_B
  8612. },
  8613. 'more-help-tour': {
  8614. 'top-info': o.HELP_MORE_TOUR_A,
  8615. 'big-image': 'images/nav_help_play.png',
  8616. 'bottom-info': o.HELP_DESKTOP_MORE_TOUR_B
  8617. },
  8618. 'more-help-inside': {
  8619. 'top-info': o.HELP_MORE_INSIDE_A,
  8620. 'big-image': 'images/nav_help_inside.svg',
  8621. 'bottom-info': o.HELP_DESKTOP_MORE_INSIDE_B
  8622. },
  8623. 'more-help-vr': {
  8624. 'top-info': o.HELP_MORE_VR_A,
  8625. 'big-image': 'images/nav_help_vr.svg',
  8626. 'bottom-info': o.HELP_DESKTOP_MORE_VR_B
  8627. },
  8628. 'more-help-360': {
  8629. 'top-info': o.HELP_MORE_360_A,
  8630. 'big-image': 'images/nav_help_360.svg',
  8631. 'bottom-info': o.HELP_DESKTOP_MORE_360_B
  8632. },
  8633. 'more-help-fullscreen': {
  8634. 'top-info': o.HELP_MORE_FULLSCREEN_A,
  8635. 'big-image': 'images/nav_help_fullscreen.svg',
  8636. 'bottom-info': o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8637. }
  8638. },
  8639. mobile: {
  8640. 'more-help-hlr': {
  8641. 'top-info': o.HELP_MORE_HLR_A,
  8642. 'big-image': 'images/nav_help_expand.svg',
  8643. 'bottom-info': o.HELP_DESKTOP_MORE_HLR_B
  8644. },
  8645. 'more-help-dollhouse': {
  8646. 'top-info': o.HELP_MORE_DOLLHOUSE_A,
  8647. 'big-image': 'images/nav_help_dollhouse.svg',
  8648. 'bottom-info': o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8649. },
  8650. 'more-help-floors': {
  8651. 'top-info': o.HELP_MORE_FLOORS_A,
  8652. 'big-image': 'images/nav_help_floor picker.svg',
  8653. 'bottom-info': o.HELP_DESKTOP_MORE_FLOORS_B
  8654. },
  8655. 'more-help-tag': {
  8656. 'top-info': o.HELP_MORE_TAG_A,
  8657. 'big-image': 'images/nav_help_tag.svg',
  8658. 'bottom-info': o.HELP_MOBILE_MORE_TAG_B
  8659. },
  8660. 'more-help-tour': {
  8661. 'top-info': o.HELP_MORE_TOUR_A,
  8662. 'big-image': 'images/nav_help_play.png',
  8663. 'bottom-info': o.HELP_DESKTOP_MORE_TOUR_B
  8664. },
  8665. 'more-help-inside': {
  8666. 'top-info': o.HELP_MORE_INSIDE_A,
  8667. 'big-image': 'images/nav_help_inside.svg',
  8668. 'bottom-info': o.HELP_MOBILE_MORE_INSIDE_B
  8669. },
  8670. 'more-help-vr': {
  8671. 'top-info': o.HELP_MORE_VR_A,
  8672. 'big-image': 'images/webvr.svg',
  8673. 'bottom-info': o.HELP_MOBILE_MORE_VR_B
  8674. },
  8675. 'more-help-360': {
  8676. 'top-info': o.HELP_MORE_360_A,
  8677. 'big-image': 'images/nav_help_360.svg',
  8678. 'bottom-info': o.HELP_MOBILE_MORE_360_B
  8679. }
  8680. }
  8681. }),
  8682. (this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8683. desktop: {
  8684. left: {
  8685. 'top-info': o.ROTATE,
  8686. 'big-image': 'images/nav_help_mouse_drag_left.png',
  8687. keyboard: 'images/nav_help_keyboard_left_right.png'
  8688. },
  8689. middle: {
  8690. 'top-info': o.MOVE,
  8691. 'big-image': 'images/nav_help_mouse_click.png',
  8692. keyboard: 'images/nav_help_keyboard_up_down.png'
  8693. },
  8694. right: {
  8695. 'top-info': o.PLAY,
  8696. 'big-image': 'images/Desktop-help-play-button.svg',
  8697. keyboard: 'images/Desktop-help-spacebar-2.svg'
  8698. }
  8699. },
  8700. mobile: {
  8701. left: {
  8702. 'top-info': o.ROTATE,
  8703. 'big-image': 'images/nav_help_gesture_drag.png'
  8704. },
  8705. middle: {
  8706. 'top-info': o.MOVE,
  8707. 'big-image': 'images/nav_help_gesture_tap.png'
  8708. },
  8709. right: {
  8710. 'top-info': o.PLAY,
  8711. 'big-image': 'images/mobile-help-play-button.svg'
  8712. }
  8713. }
  8714. }),
  8715. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]]))),
  8716. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle),
  8717. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle),
  8718. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]]))),
  8719. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left),
  8720. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left)
  8721. }
  8722. },
  8723. fill: function (e, t, i) {
  8724. n.call(this, e, t, i, !0)
  8725. },
  8726. clear: function (e, t, i) {
  8727. n.call(this, e, t, i, !1)
  8728. }
  8729. }
  8730. },
  8731. {
  8732. '../enum/HelpModalSize': 27,
  8733. '../enum/HelpModalType': 28,
  8734. '../enum/Viewmode': 51,
  8735. '../localization/localize': 108,
  8736. '../util/browser': 182
  8737. }
  8738. ],
  8739. 76: [
  8740. function (e, t, i) {
  8741. 'use strict'
  8742. t.exports = Object.freeze({
  8743. OPENED: 'share.open',
  8744. CLOSED: 'share.closed',
  8745. LINK_CLICKED: 'share.linked'
  8746. })
  8747. },
  8748. {}
  8749. ],
  8750. 77: [
  8751. function (e, t, i) {
  8752. 'use strict'
  8753. function n(e) {
  8754. function t(t, i) {
  8755. var n = window.screenY + ($('#player').height() - i) / 2,
  8756. r = window.screenX + ($('#player').width() - t) / 2,
  8757. o = 'top=' + n + ',left=' + r + ',width=' + t + ',height=' + i
  8758. I.emit(l.LINK_CLICKED, {
  8759. channel: e
  8760. }),
  8761. window.open(C[e], 'shareWindow', o)
  8762. }
  8763. switch (e) {
  8764. case y.FACEBOOK:
  8765. t(580, 420)
  8766. break
  8767. case y.TWITTER:
  8768. t(550, 440)
  8769. break
  8770. case y.MAIL:
  8771. I.emit(l.LINK_CLICKED, {
  8772. channel: 'email'
  8773. }),
  8774. window.open(C[e], '_blank')
  8775. break
  8776. case y.LINKEDIN:
  8777. }
  8778. }
  8779. function r(e) {
  8780. I.emit(l.LINK_CLICKED, {
  8781. channel: 'copylink'
  8782. })
  8783. var t = document.createRange()
  8784. t.selectNodeContents(v)
  8785. var i = window.getSelection()
  8786. i.removeAllRanges(), i.addRange(t), document.execCommand('copy'), A.classList.remove('hidden'), v.classList.add('highlighted')
  8787. }
  8788. function o(e) {
  8789. ;(e && (e.stopPropagation(), e.target === v)) || (window.getSelection().removeAllRanges(), v.classList.remove('highlighted'), A.classList.add('hidden'))
  8790. }
  8791. var a = e('../../util/browser'),
  8792. s = e('../../localization/localize'),
  8793. l = e('./ShareEvents'),
  8794. c = e('../../util/common'),
  8795. h = e('events').EventEmitter,
  8796. u = document.getElementById('sharing'),
  8797. d = document.getElementById('share-modal'),
  8798. p = document.getElementById('share-close'),
  8799. f = document.getElementById('facebook-share'),
  8800. g = document.getElementById('twitter-share'),
  8801. m = document.getElementById('mail-share'),
  8802. v = document.getElementById('share-url-text'),
  8803. A = document.getElementById('copy-success'),
  8804. y = Object.freeze({
  8805. FACEBOOK: 'facebook',
  8806. TWITTER: 'twitter',
  8807. MAIL: 'mail',
  8808. LINKEDIN: 'linkedin'
  8809. }),
  8810. C = {}
  8811. ;(C[y.FACEBOOK] = 'http://www.facebook.com/sharer.php?u=' + encodeURIComponent(window.location.href + '&utm_source=1') + '&t='),
  8812. (C[y.TWITTER] = 'http://twitter.com/intent/tweet?text='),
  8813. (C[y.MAIL] = 'mailto:?subject=')
  8814. var I = {
  8815. init: function (e) {
  8816. var t = encodeURIComponent(s.SHARE_EXPLORE + e + ' ' + s.SHARE_AT + ' ')
  8817. ;(C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + '&utm_source=1')),
  8818. (C[y.TWITTER] += t + encodeURIComponent(window.location.href + '&utm_source=2 ' + s.SHARE_WITH + ' #port')),
  8819. (C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + '&body=' + t + encodeURIComponent(window.location.href + '&utm_source=3')),
  8820. u.addEventListener('click', this.toggle.bind(this)),
  8821. p.addEventListener('click', this.hide.bind(this)),
  8822. v.addEventListener('click', r),
  8823. d.addEventListener('click', o),
  8824. f.addEventListener('click', n.bind(this, y.FACEBOOK)),
  8825. g.addEventListener('click', n.bind(this, y.TWITTER)),
  8826. m.addEventListener('click', n.bind(this, y.MAIL)),
  8827. (v.textContent = window.location.href + '&utm_source=4'),
  8828. d.classList.add(a.isMobile() ? 'mobile' : 'desktop'),
  8829. u.classList.remove('hidden')
  8830. },
  8831. show: function () {
  8832. this.emit(l.OPENED), d.classList.add('fadeIn')
  8833. },
  8834. hide: function () {
  8835. d.classList.contains('fadeIn') && (this.emit(l.CLOSED), document.selection && document.selection.empty(), window.getSelection().removeAllRanges(), o(), d.classList.remove('fadeIn'))
  8836. },
  8837. toggle: function () {
  8838. d.classList.contains('fadeIn') ? this.hide() : this.show()
  8839. }
  8840. }
  8841. c.extendObject(I, h.prototype), (t.exports = I)
  8842. },
  8843. {
  8844. '../../localization/localize': 108,
  8845. '../../util/browser': 182,
  8846. '../../util/common': 185,
  8847. './ShareEvents': 76,
  8848. events: 202
  8849. }
  8850. ],
  8851. 78: [
  8852. function (e, t, i) {
  8853. 'use strict'
  8854. t.exports = Object.freeze({
  8855. OPENED: 'terms.opened',
  8856. CLOSED: 'terms.closed'
  8857. })
  8858. },
  8859. {}
  8860. ],
  8861. 79: [
  8862. function (e, t, i) {
  8863. 'use strict'
  8864. var n = e('./TermsEvent'),
  8865. r = e('../../localization/localize'),
  8866. o = e('../../analytics'),
  8867. a = e('../../util/ajax'),
  8868. s = e('../../util/common'),
  8869. l = e('events').EventEmitter,
  8870. c = document.getElementById('terms-modal'),
  8871. h = {
  8872. init: function () {
  8873. $('.footer-terms').on(
  8874. 'click',
  8875. function (e) {
  8876. e.preventDefault(), this.show()
  8877. }.bind(this)
  8878. ),
  8879. $('#terms-modal .close').on('click', this.hide.bind(this))
  8880. },
  8881. show: function () {
  8882. this.emit(n.OPENED),
  8883. a
  8884. .get('static/' + r.TERMS_TEXT_FILE)
  8885. .done(function (e) {
  8886. var t = $('#terms-text').html(e)
  8887. o.track('showcase_gui', {
  8888. gui_action: 'click_terms_button',
  8889. interaction_source: 'gui'
  8890. }),
  8891. t.find('a').attr('target', '_blank')
  8892. })
  8893. .fail(function () {
  8894. $('#terms-text').html('<h1>' + r.TERMS_OF_USE + '</h1><p>' + r.TERMS_FAIL)
  8895. }),
  8896. c.classList.add('fadeIn')
  8897. },
  8898. hide: function (e) {
  8899. e && e.preventDefault(), c.classList.contains('fadeIn') && this.emit(n.CLOSED), c.classList.remove('fadeIn')
  8900. }
  8901. }
  8902. s.extendObject(h, l.prototype), (t.exports = h)
  8903. },
  8904. {
  8905. '../../analytics': 4,
  8906. '../../localization/localize': 108,
  8907. '../../util/ajax': 181,
  8908. '../../util/common': 185,
  8909. './TermsEvent': 78,
  8910. events: 202
  8911. }
  8912. ],
  8913. 80: [
  8914. function (e, t, i) {
  8915. 'use strict'
  8916. t.exports = Object.freeze({
  8917. OPEN_INFO: 'title.open.info',
  8918. CLOSE_INFO: 'title.close.info',
  8919. SHOW_INFO: 'title.show.info',
  8920. HIDE_INFO: 'title.hide.info',
  8921. LINK_CLICKED: 'title.link.click',
  8922. CONTACT_LINK_CLICKED: 'title.contact.click',
  8923. ORIGIN_LINK_CLICKED: 'title.origin.click'
  8924. })
  8925. },
  8926. {}
  8927. ],
  8928. 81: [
  8929. function (e, t, i) {
  8930. 'use strict'
  8931. function n(e, t) {
  8932. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8933. }
  8934. function r(e, t) {
  8935. function i(i) {
  8936. ;(e.shouldShowtags = 'show' === this.value), e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8937. }
  8938. document.getElementById('tag-toggles').classList.remove('hidden'), (document.getElementById('radio-tag-show').checked = !0)
  8939. for (var n = document.getElementById('tag-inputs').querySelectorAll('input'), r = 0; r < n.length; r++) n[r].addEventListener('change', i)
  8940. }
  8941. var o = e('../../settings')
  8942. t.exports.init = n
  8943. },
  8944. {
  8945. '../../settings': 166
  8946. }
  8947. ],
  8948. 82: [
  8949. function (e, t, i) {
  8950. ;(function (i) {
  8951. 'use strict'
  8952. function n(e, t) {
  8953. return e && u.valueFromHash('title', 1) && 2 !== u.valueFromHash('mls', 0)
  8954. ? ((document.getElementsByClassName('titleText')[0].innerText = e),
  8955. (g_weixinObj.title = e),
  8956. e.length > g.minTooltipCharacters && I.parentElement.setAttribute('data-original-title', e),
  8957. t && 1 !== m.specialEdition && m.brand && !m.mls
  8958. ? (document.getElementById('cobrandTitle').innerText = t)
  8959. : (document.getElementsByClassName('co-brand')[0].classList.add('hidden'),
  8960. document.getElementById('gui-name').classList.add('noCoBrand'),
  8961. document.getElementById('cobrandTitle').classList.add('hidden')),
  8962. !0)
  8963. : (document.getElementById('model-title').classList.add('hidden'), !1)
  8964. }
  8965. function r(e) {
  8966. return e ? ((L = !0), void (_.innerHTML = e)) : void _.classList.add('hidden')
  8967. }
  8968. function o(e, t, i, n) {
  8969. if ((!e && !t && !i) || !m.brand || u.valueFromHash('mls', !1)) return void T.classList.add('hidden')
  8970. L = !0
  8971. var r = [],
  8972. o = c(r, '<br>')
  8973. if ((e && o('<span id="contactName">' + e + '</span>'), t)) {
  8974. var a = n || t,
  8975. s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + '</a>' : '<span>' + a + '</span>'
  8976. o(s)
  8977. }
  8978. i && o('<a id="email" href="mailTo:' + i + '">' + i + '</a>'), (r[0] = ''), (x.innerHTML = r.join(''))
  8979. }
  8980. function a(e) {
  8981. if ('string' == typeof e)
  8982. try {
  8983. e = JSON.parse(e)
  8984. } catch (e) {
  8985. return y.warn('Unable to parse address data'), void S.parentElement.classList.add('hidden')
  8986. }
  8987. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip))) return void S.parentElement.classList.add('hidden')
  8988. L = !0
  8989. var t = [],
  8990. i = c(t, ' ')
  8991. e.address_1 && i(e.address_1),
  8992. e.address_2 && i(e.address_2),
  8993. e.city && i(e.city, ', '),
  8994. e.state && i(e.state, ', '),
  8995. e.zip && i(e.zip, e.state ? ' ' : ', '),
  8996. (t[0] = ''),
  8997. (S.innerText = t.join(''))
  8998. }
  8999. function s(e) {
  9000. var t = document.createElement('a')
  9001. return (t.id = 'url'), (t.target = '_blank'), (t.href = e), (t.innerText = e), t.addEventListener('click', N.emit.bind(N, v.ORIGIN_LINK_CLICKED)), t
  9002. }
  9003. function l(e) {
  9004. return (
  9005. !(!e || (u.inIframe() && document.referrer === e)) &&
  9006. (R.classList.remove('hidden'),
  9007. (P.innerHTML = f.WEBVR_LEARN_MORE + ': '),
  9008. P.appendChild(s(e)),
  9009. O.forEach(function (e) {
  9010. e.classList.add('share-link')
  9011. }),
  9012. !0)
  9013. )
  9014. }
  9015. function c(e, t) {
  9016. var i = e,
  9017. n = t
  9018. return function (e, t) {
  9019. i.push(t || n, e)
  9020. }
  9021. }
  9022. function h() {
  9023. document.getElementById('title-toggle').addEventListener('click', N.toggleTitle.bind(N)), L && I.addEventListener('click', N.toggleMeta.bind(N, !1))
  9024. var e = [].slice.call(_.querySelectorAll('a'))
  9025. e.forEach(function (e) {
  9026. e.addEventListener('click', N.emit.bind(N, v.LINK_CLICKED))
  9027. })
  9028. var t = [].slice.call(T.querySelectorAll('a'))
  9029. t.forEach(function (e) {
  9030. e.addEventListener(
  9031. 'click',
  9032. N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  9033. contact_type: e.getAttribute('id')
  9034. })
  9035. )
  9036. })
  9037. }
  9038. var u = e('../../util/browser'),
  9039. d = e('../../util/common'),
  9040. p = e('../../util/logger'),
  9041. f = e('../../localization/localize'),
  9042. g = e('./titleBarSettings'),
  9043. m = e('../../settings'),
  9044. v = e('./TitleEvents'),
  9045. A = e('events').EventEmitter,
  9046. y = new p(i),
  9047. C = document.querySelector('.pinTop.left'),
  9048. I = document.getElementsByClassName('title-container')[0],
  9049. E = document.getElementById('title-toggle').querySelector('i'),
  9050. b = document.getElementById('meta-info-wrapper'),
  9051. w = document.getElementById('meta-info'),
  9052. _ = document.getElementById('meta-description'),
  9053. T = document.getElementsByClassName('contact-info')[0],
  9054. x = document.getElementById('contact-data'),
  9055. S = document.getElementById('addressTxt'),
  9056. M = document.getElementById('tag-toggles'),
  9057. R = document.getElementById('share-origin'),
  9058. P = document.getElementById('share-link-wrapper'),
  9059. O = [w, b, I],
  9060. L = !1,
  9061. D = !1,
  9062. N = {
  9063. populate: function (e) {
  9064. if (n(window.DATA.name, e.coBrand)) {
  9065. if ((r(e.description), o(e.contactName, e.phone, e.email, e.formatted_contact_phone), a(e.address), L)) {
  9066. var t = document.createElement('br')
  9067. M.insertBefore(t, M.firstElementChild)
  9068. }
  9069. e.socialSharing && m.share.enabled && (D = l(e.url))
  9070. }
  9071. },
  9072. finishSetup: function (e) {
  9073. ;(L = L || !!e), h(), L || (D ? I.classList.add('share-only') : I.classList.add('no-meta'))
  9074. },
  9075. toggleMeta: function (e, t) {
  9076. var title = document.getElementById('model-title')
  9077. t && t.preventDefault()
  9078. var i = w.classList.contains('expand')
  9079. ;(e && !i) ||
  9080. (i
  9081. ? (O.forEach(function (e) {
  9082. e.classList.remove('expand')
  9083. }),
  9084. this.emit(v.CLOSE_INFO),
  9085. title.classList.remove('expand'))
  9086. : (O.forEach(function (e) {
  9087. e.classList.add('expand')
  9088. }),
  9089. title.classList.add('expand'),
  9090. this.emit(v.OPEN_INFO)))
  9091. },
  9092. setupToggling: function () {
  9093. ;(b.style.height = w.offsetHeight + 'px'),
  9094. w.addEventListener('transitionend', function () {
  9095. b.style.height = w.offsetHeight + 'px'
  9096. })
  9097. },
  9098. toggleTitle: function (e) {
  9099. e && e.preventDefault(),
  9100. C.classList.contains('closed')
  9101. ? (C.classList.add('open'),
  9102. E.classList.remove('icon-dpad-right'),
  9103. E.classList.add('icon-dpad-left'),
  9104. this.emit(v.SHOW_INFO),
  9105. setTimeout(function () {
  9106. C.classList.remove('closed'), C.classList.remove('open')
  9107. }, g.removeAnimationClasses))
  9108. : (C.classList.add('closed'), E.classList.remove('icon-dpad-left'), E.classList.add('icon-dpad-right'), this.emit(v.HIDE_INFO))
  9109. }
  9110. }
  9111. d.extendObject(N, A.prototype), (t.exports = N)
  9112. }).call(this, '/js/gui/title/titleBar.js')
  9113. },
  9114. {
  9115. '../../localization/localize': 108,
  9116. '../../settings': 166,
  9117. '../../util/browser': 182,
  9118. '../../util/common': 185,
  9119. '../../util/logger': 189,
  9120. './TitleEvents': 80,
  9121. './titleBarSettings': 83,
  9122. events: 202
  9123. }
  9124. ],
  9125. 83: [
  9126. function (e, t, i) {
  9127. 'use strict'
  9128. t.exports = Object.freeze({
  9129. minTooltipCharacters: 19,
  9130. removeAnimationClasses: 500
  9131. })
  9132. },
  9133. {}
  9134. ],
  9135. 84: [
  9136. function (e, t, i) {
  9137. 'use strict'
  9138. function n(e) {
  9139. ;(C = e),
  9140. P.forEach(function (e) {
  9141. b.addEventListener(e, u.bind(this, !1), !0), w.addEventListener(e, u.bind(this, !0), !0), E.addEventListener(e, stopTour2, !0)
  9142. /* S.forEach(function(t) {//会触发导览停止
  9143. t.addEventListener(e, stopTour, !0)
  9144. }) */
  9145. $('#drawer img').on(e, stopTour)
  9146. })
  9147. document.addEventListener('keydown', u.bind(this, !1), !0)
  9148. C.on(v.TourStart, function () {
  9149. E.classList.add('playing')
  9150. })
  9151. }
  9152. function play() {
  9153. //r
  9154. // C.playTour(),
  9155. C.playTourNearBy(), I && clearTimeout(I), d(), _.removeClass('fadeIn')
  9156. }
  9157. function stopTour2() {
  9158. //o
  9159. E.classList.contains('playing') &&
  9160. (C.stopTour(),
  9161. _.addClass('fadeIn'),
  9162. setTimeout(function () {
  9163. _.removeClass('fadeIn')
  9164. }, p.tourInteraction.showPauseButton),
  9165. O || (clearTimeout(I), (I = setTimeout(h, p.tourInteraction.showModal))),
  9166. setTimeout(function () {
  9167. E.classList.remove('playing')
  9168. }, p.tourInteraction.allowNextClick))
  9169. }
  9170. function stopTour() {
  9171. //a
  9172. C.tourInProgress && (C.stopTour(), C.endTourProgress(), E.classList.remove('playing'))
  9173. }
  9174. function togglePlay() {
  9175. //s
  9176. T.is(':visible') ? play() : stopTour2()
  9177. }
  9178. function l() {
  9179. x.hasClass('playing') && (clearTimeout(I), C.atEndOfTour() ? c() : _.removeClass('fadeIn'))
  9180. }
  9181. function c() {
  9182. E.classList.remove('playing'), h()
  9183. }
  9184. function h() {
  9185. //去掉导览结束时的提示
  9186. /* if (!p.tourInteraction.disabled) {
  9187. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  9188. M.addClass("fadeIn tour " + m.deviceType);
  9189. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  9190. if (!p.tourInteraction.smallModal) {
  9191. var t;
  9192. 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,
  9193. m.fill(R, A.TOUR_INTERACTION[t]),
  9194. M.addClass(t)
  9195. }
  9196. M.addClass(e)
  9197. } */
  9198. }
  9199. function u(e, t) {
  9200. if (t) {
  9201. var i = 'keydown' === t.type,
  9202. n = t.which === f.SPACE || C.tourIsPlaying
  9203. ;(i && n) || e || (O = !0), C.atEndOfTour() && d(), !C.tourIsPlaying && C.tourInProgress && (_.removeClass('fadeIn'), d(), t.which !== f.SPACE && stopTour()), i && n && togglePlay() //空格键播放或暂停
  9204. }
  9205. }
  9206. function d() {
  9207. M.removeClass('fadeIn')
  9208. }
  9209. var p = (e('../util/browser'), e('../settings')),
  9210. f = e('../enum/Keys'),
  9211. g = e('../enum/Viewmode'),
  9212. m = (e('./helpManager'), e('./populateModal')),
  9213. v = e('../enum/DirectorEvents'),
  9214. A = e('../enum/HelpModalType'),
  9215. y = e('../enum/HelpModalSize'),
  9216. C = null,
  9217. I = null,
  9218. E = document.getElementById('pause-overlay'),
  9219. b = document.getElementById('player'),
  9220. w = document.getElementById('gui'),
  9221. _ = $('#pause-icon').eq(0),
  9222. T = $('#play').eq(0),
  9223. x = $('#playHead').eq(0),
  9224. S = $('.rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan').toArray(),
  9225. M = $('#interaction-modal').eq(0),
  9226. R = $('#interaction-modal .interaction').toArray(),
  9227. P = ['touchstart', 'mousedown', 'pointerdown'],
  9228. O = !1
  9229. ;(t.exports.init = n),
  9230. (t.exports.play = play),
  9231. (t.exports.pause = stopTour2),
  9232. (t.exports.pauseWithoutCTA = stopTour),
  9233. (t.exports.togglePlay = togglePlay),
  9234. (t.exports.stopTour = l),
  9235. (t.exports.dismissModal = d)
  9236. },
  9237. {
  9238. '../enum/DirectorEvents': 23,
  9239. '../enum/HelpModalSize': 27,
  9240. '../enum/HelpModalType': 28,
  9241. '../enum/Keys': 30,
  9242. '../enum/Viewmode': 51,
  9243. '../settings': 166,
  9244. '../util/browser': 182,
  9245. './helpManager': 68,
  9246. './populateModal': 75
  9247. }
  9248. ],
  9249. 85: [
  9250. function (e, t, i) {
  9251. 'use strict'
  9252. t.exports = Object.freeze({
  9253. OPENED: 'vr.modal.opened',
  9254. LAUNCH: 'vr.modal.launch',
  9255. CLOSED: 'vr.modal.closed',
  9256. NEXT: 'vr.modal.next',
  9257. PREV: 'vr.modal.prev',
  9258. STORE: 'vr.modal.store',
  9259. falseICECHOSEN: 'vr.modal.device'
  9260. })
  9261. },
  9262. {}
  9263. ],
  9264. 86: [
  9265. function (e, t, i) {
  9266. 'use strict'
  9267. function n(e, t, i) {
  9268. function n(e, t, n, r) {
  9269. function o() {
  9270. return p + '&m=' + t + '&display=' + e
  9271. }
  9272. function s() {
  9273. var e = '&utm_medium=' + (a.inIframe() ? 'embed' : 'direct'),
  9274. t = '&utm_source=' + u,
  9275. n = '&utm_showcase_session_id=' + i
  9276. return e + t + n
  9277. }
  9278. function l() {
  9279. return d + '&sids=' + t + '&lsid=' + t + '&ln=' + encodeURIComponent(n) + '&ld=' + encodeURIComponent(r) + '&display=' + e
  9280. }
  9281. return a.valueFromHash('vrcoll', !1) ? l() + s() : o() + s()
  9282. }
  9283. function r(e, t, i, r) {
  9284. var o = 'https://api.branch.io/v1/url',
  9285. a = n(e, t, i, r),
  9286. s = {
  9287. responseType: 'json',
  9288. data: {
  9289. branch_key: h.appConfig.branch_key,
  9290. data: {
  9291. m: t,
  9292. full_url: a,
  9293. $desktop_url: m,
  9294. $og_app_id: '331853976762864119',
  9295. $og_title: i,
  9296. $og_description: r,
  9297. $og_image_url: location.origin + '/api/v1/player/models/' + t + '/thumb',
  9298. $canonical_url: window.location.href
  9299. }
  9300. }
  9301. }
  9302. c.post(o, s)
  9303. .done(function (t) {
  9304. f[e] = t.url
  9305. })
  9306. .fail(
  9307. function (t) {
  9308. f[e] = t
  9309. }.bind(this, a)
  9310. )
  9311. }
  9312. function o(e, t, i) {
  9313. for (var r in s) {
  9314. var o = s[r],
  9315. a = n(o, e, t, i)
  9316. f[o] = a
  9317. }
  9318. }
  9319. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href),
  9320. d = g + '/vr/dlist/?ret=' + u,
  9321. p = g + '/vr/show/?ret=' + u,
  9322. m = ''
  9323. switch (e) {
  9324. case l.IOS:
  9325. r(s.CardboardIOS, t.sid, t.name, t.summary)
  9326. break
  9327. default:
  9328. o(t.sid, t.name, t.summary)
  9329. }
  9330. }
  9331. function r(e) {
  9332. var t = f[e]
  9333. window.open(t, '_blank')
  9334. }
  9335. function o(e) {
  9336. var t = u[e]
  9337. window.open(t, '_blank')
  9338. }
  9339. var a = e('../../util/browser'),
  9340. s = e('../../enum/VRApps'),
  9341. l = e('../../enum/VRPlatforms'),
  9342. c = e('../../util/ajax'),
  9343. h = e('../../settings'),
  9344. u = {}
  9345. ;(u[s.CardboardAndroid] = 'https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri='),
  9346. (u[s.CardboardIOS] = 'https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri='),
  9347. (u[s.GearVR] = 'https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=')
  9348. for (var d in s) {
  9349. var p = s[d]
  9350. u[p] += encodeURIComponent(document.referrer + '&display=' + p)
  9351. }
  9352. var f = {},
  9353. g = (function () {
  9354. var e = window.location.host
  9355. return e.indexOf('.port.com') === -1 && e.indexOf('localhost') === -1 && (e = 'my.port.com'), 'https://' + e
  9356. })()
  9357. ;(t.exports.init = n), (t.exports.launch = r), (t.exports.launchStore = o)
  9358. },
  9359. {
  9360. '../../enum/VRApps': 46,
  9361. '../../enum/VRPlatforms': 49,
  9362. '../../settings': 166,
  9363. '../../util/ajax': 181,
  9364. '../../util/browser': 182
  9365. }
  9366. ],
  9367. 87: [
  9368. function (e, t, i) {
  9369. 'use strict'
  9370. function n(e) {
  9371. var t
  9372. switch (e) {
  9373. case m.IOS:
  9374. return (t = p.iosVersion()), t.major > 9 || (9 === t.major && t.minor >= 1)
  9375. case m.Android:
  9376. return (t = p.androidVersion()), t.major > 4 || (4 === t.major && t.minor > 4) || (4 === t.major && 4 === t.minor && t.patch >= 4)
  9377. }
  9378. return !1
  9379. }
  9380. function r(e, t) {
  9381. function i(e) {
  9382. K.emit(A.STORE, {
  9383. type: e
  9384. }),
  9385. f.launchStore(e)
  9386. }
  9387. function r(e) {
  9388. switch ((e !== _.pageCount && (a(e), N.text(e + 1 + ' / ' + _.pageCount)), e)) {
  9389. case _.Title:
  9390. O.css('display', 'none'), L.text(u[e]), o(s)
  9391. break
  9392. case _.Cardboard:
  9393. O.css('display', 'block'), L.text(u[e]), M.filter('.cardboard').off(), M.filter('.gearvr').off(), c(e, s), h(H, X, Z)
  9394. break
  9395. case _.Gear:
  9396. L.text(u[e]), c(e, s), T.addClass('lastPage'), h(G, X, Z)
  9397. break
  9398. case _.pageCount:
  9399. T.removeClass('fadeIn'), K.emit(A.CLOSED)
  9400. }
  9401. B.filter("[src='']").hide()
  9402. }
  9403. var s = (function () {
  9404. return p.detectAndroid()
  9405. ? p.detectAndroidMobile() && n(m.Android)
  9406. ? (T.addClass('supported'), (w = '.show-supported'), m.Android)
  9407. : (T.addClass('unsupported'), (w = '.show-unsupported'), m.UnsupportedAndroid)
  9408. : p.detectIPhone() || p.detectIPod()
  9409. ? (T.addClass('ios'), (w = '.show-ios'), (_ = v.ios), m.IOS)
  9410. : (T.addClass('desktop'), (w = '.show-desktop'), m.Desktop)
  9411. })()
  9412. f.init(s, e, t), s !== m.Desktop && T.addClass('mobile')
  9413. var l = function (e) {
  9414. K.emit(A.LAUNCH, {
  9415. vr_platform: s,
  9416. vr_app: e
  9417. }),
  9418. f.launch(e)
  9419. }
  9420. ;(q.cardboardAndroid = l.bind(this, g.CardboardAndroid)),
  9421. (q.gear = l.bind(this, g.GearVR)),
  9422. (q.cardboardIOS = l.bind(this, g.CardboardIOS)),
  9423. d(),
  9424. $('.show-supported, .show-unsupported, .show-ios, .show-desktop').hide(),
  9425. $(w).show()
  9426. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS],
  9427. y = ['vr_modal_learn_more', 'vr_modal_next', 'vr_modal_done']
  9428. s === m.IOS && (u.splice(1, 1), y.splice(1, 1)),
  9429. $('#vr').on('click', function (e) {
  9430. e.preventDefault()
  9431. player.FlyToMode('panorama', () => {
  9432. if (!window.vrEnabled) {
  9433. // 开启VR
  9434. window.vrEnabled = true
  9435. this.classList.add('active')
  9436. $('#gui div').not('#vrOff').addClass('vrHide')
  9437. $('#vrOffImg').css({ display: 'inline-block' })
  9438. } else {
  9439. }
  9440. })
  9441. })
  9442. let exitVR = function () {
  9443. $('#gui div').not('#vrOff').removeClass('vrHide')
  9444. $('#vrOffImg').css({ display: 'none' })
  9445. $('#player canvas').css({ width: '', height: '' }) // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
  9446. $('#vr').removeClass('active') // 清除vr按钮的激活样式
  9447. }
  9448. $('#vrOff').on('click', function () {
  9449. window.vrEnabled = false
  9450. exitVR()
  9451. })
  9452. window.bus.addEventListener('exitWebXR', e => {
  9453. exitVR()
  9454. })
  9455. var I = 'https://my.port.com/vr/show/?m=' + e.sid
  9456. s === m.IOS ? $('.cardboardLink').on('click', i.bind(this, g.CardboardIOS)) : $('.cardboardLink').on('click', i.bind(this, g.CardboardAndroid)),
  9457. $('.gearLink').on('click', i.bind(this, g.GearVR)),
  9458. $('span.modelLink').text(I),
  9459. O.on('click', function (e) {
  9460. K.emit(A.PREV), b--, r(b)
  9461. }),
  9462. L.on('click', function (e) {
  9463. L.text()
  9464. K.emit(A.NEXT, {
  9465. nextAction: y[b]
  9466. }),
  9467. b++,
  9468. r(b)
  9469. }),
  9470. T.find('.close').on('click', K.dismiss)
  9471. }
  9472. function o(e) {
  9473. switch (e) {
  9474. case m.Android:
  9475. M.filter('.cardboard').off().on('click', q.cardboardAndroid), M.filter('.gearvr').off().on('click', q.gear), s(H, G, 'logo-button', 'same-line')
  9476. break
  9477. case m.UnsupportedAndroid:
  9478. s('', z, '', '')
  9479. break
  9480. case m.IOS:
  9481. M.filter('.cardboard').off().on('click', q.cardboardIOS), s(H, '', 'logo-button', '')
  9482. break
  9483. case m.Desktop:
  9484. M.filter('.cardboard').off().on('click', l.bind(this, null, F, U)), M.filter('.gearvr').off().on('click', l.bind(this, G, V, null)), s(H, G, 'logo-button', 'same-line'), Q.cardboard()
  9485. }
  9486. }
  9487. function a(e) {
  9488. $('.p1, .p2, .p3').hide(),
  9489. x.insertAfter(S),
  9490. T.removeClass('front-page'),
  9491. T.removeClass('details-page'),
  9492. T.removeClass('lastPage'),
  9493. M.removeClass('logo-button'),
  9494. M.removeClass('same-line'),
  9495. S.removeClass('headsetOptions'),
  9496. R.attr('src', ''),
  9497. R.filter('.second').removeClass('gear'),
  9498. R.css('display', 'inline-block'),
  9499. R.off(),
  9500. P.filter('.second').css('display', ''),
  9501. D.css('display', 'none'),
  9502. $('.p' + (e + 1) + w).show(),
  9503. R.filter('.third').insertBefore(P.filter('.third'))
  9504. }
  9505. function s(e, t, i, n) {
  9506. T.addClass('front-page'),
  9507. R.filter('.first').attr('src', e),
  9508. R.filter('.second').attr('src', t),
  9509. M.filter('.first').addClass(i),
  9510. M.filter('.second').addClass(i),
  9511. M.addClass(n),
  9512. '.show-desktop' === w && S.insertAfter(x)
  9513. }
  9514. function l(e, t, i) {
  9515. S.addClass('headsetOptions'),
  9516. M.off(),
  9517. R.filter('.second').attr('src', t),
  9518. D.css('display', 'block'),
  9519. P.filter('.second').css('display', 'none'),
  9520. D.on('click', function () {
  9521. a(_.Title), o(m.Desktop)
  9522. }),
  9523. e &&
  9524. (K.emit(A.falseICECHOSEN, {
  9525. name: g.GearVR
  9526. }),
  9527. R.filter('.first').attr('src', e),
  9528. R.filter('.second').addClass('gear'),
  9529. R.filter('.second').on('click', f.launchStore.bind(this, g.GearVR)),
  9530. Q.gearvr()),
  9531. i &&
  9532. (K.emit(A.falseICECHOSEN, {
  9533. name: g.Cardboard
  9534. }),
  9535. R.filter('.third').attr('src', i),
  9536. R.filter('.third').show(),
  9537. R.filter('.third').insertAfter(R.filter('.second')),
  9538. R.filter('.third').addClass('link'),
  9539. R.filter('.second').addClass('link'),
  9540. R.filter('.second').on('click', f.launchStore.bind(this, g.CardboardIOS)),
  9541. R.filter('.third').on('click', f.launchStore.bind(this, g.CardboardAndroid)),
  9542. Q.cardboard())
  9543. }
  9544. function c(e, t) {
  9545. switch (t) {
  9546. case m.IOS:
  9547. ;(X = Y), (Z = j)
  9548. break
  9549. case m.Desktop:
  9550. e === _.Cardboard
  9551. ? ((X = F), (Z = U), R.filter('.second').on('click', f.launchStore.bind(this, g.CardboardIOS)), R.filter('.third').on('click', f.launchStore.bind(this, g.CardboardAndroid)))
  9552. : ((X = V), R.filter('.second').on('click', f.launchStore.bind(this, g.GearVR)), (Z = ''))
  9553. break
  9554. default:
  9555. e === _.Cardboard ? ((X = z), (Z = j)) : ((X = k), (Z = W))
  9556. }
  9557. }
  9558. function h(e, t, i) {
  9559. T.find('.inner').addClass('details-page'), T.addClass('details-page'), R.filter('.first').attr('src', e), R.filter('.second').attr('src', t), R.filter('.third').attr('src', i)
  9560. }
  9561. function u() {
  9562. T.hasClass('fadeIn') && (T.removeClass('fadeIn'), K.emit(A.CLOSED))
  9563. }
  9564. function d() {
  9565. var e = p.aspectRatio() > 1 && p.isMobile()
  9566. T.toggleClass('landscape', e).toggleClass('portrait', !e),
  9567. T.toggleClass('tiny', $('#player').height() <= y.narrowLandscapeHeight),
  9568. T.toggleClass('tinier', $('#player').height() <= y.reallyNarrowLandscapeHeight)
  9569. }
  9570. var p = e('../../util/browser'),
  9571. f = e('./vrLink'),
  9572. g = e('../../enum/VRApps'),
  9573. m = e('../../enum/VRPlatforms'),
  9574. v = e('../../enum/VRPages'),
  9575. A = e('./vrEvent'),
  9576. y = (e('../../settings'), e('../../constants')),
  9577. C = e('../../localization/localize'),
  9578. I = e('../../util/common'),
  9579. E = e('events').EventEmitter,
  9580. b = 0,
  9581. w = null,
  9582. _ = v.standard,
  9583. T = $('.vr-popup'),
  9584. x = T.find('.vr-popup-body'),
  9585. S = T.find('.vr-images'),
  9586. M = T.find('.img-container'),
  9587. R = T.find('.vr-sm-image'),
  9588. P = M.find('.vr-img-caption'),
  9589. O = $('.vr-buttons').find('.prev-button'),
  9590. L = $('.vr-buttons').find('.next-button'),
  9591. D = S.find('.front-close'),
  9592. N = $('.vr-page'),
  9593. B = T.find('img'),
  9594. F = 'images/apple-store.png',
  9595. V = 'images/badge-oculus.png',
  9596. U = 'images/badge-cardboard.png',
  9597. k = 'images/logo-samsung.png',
  9598. H = 'images/headset-cardboard.png',
  9599. G = 'images/headset-gearvr.png',
  9600. z = 'images/ico-android-robot.png',
  9601. W = 'images/ico-gearvr.png',
  9602. j = 'images/ico-vr.png',
  9603. Y = 'images/apple-logo-white.svg',
  9604. X = null,
  9605. Z = null,
  9606. q = {},
  9607. K = {
  9608. init: r,
  9609. dismiss: u,
  9610. isDeviceSupported: n
  9611. }
  9612. I.extendObject(K, E.prototype), $(window).resize(d)
  9613. var Q = (function () {
  9614. var e = P.filter('.first').find('.cardboard'),
  9615. t = P.filter('.first').find('.gearvr')
  9616. return {
  9617. cardboard: function () {
  9618. t.addClass('hidden'), e.removeClass('hidden')
  9619. },
  9620. gearvr: function () {
  9621. e.addClass('hidden'), t.removeClass('hidden')
  9622. }
  9623. }
  9624. })()
  9625. t.exports = K
  9626. },
  9627. {
  9628. '../../constants': 8,
  9629. '../../enum/VRApps': 46,
  9630. '../../enum/VRPages': 48,
  9631. '../../enum/VRPlatforms': 49,
  9632. '../../localization/localize': 108,
  9633. '../../settings': 166,
  9634. '../../util/browser': 182,
  9635. '../../util/common': 185,
  9636. './vrEvent': 85,
  9637. './vrLink': 86,
  9638. events: 202
  9639. }
  9640. ],
  9641. 88: [
  9642. function (e, t, i) {
  9643. 'use strict'
  9644. t.exports = Object.freeze({
  9645. OPENED: 'webvr.modal.opened',
  9646. SHOW_TERMS: 'webvr.footer.show.terms'
  9647. })
  9648. },
  9649. {}
  9650. ],
  9651. 89: [
  9652. function (e, t, i) {
  9653. ;(function (i) {
  9654. 'use strict'
  9655. function n(e, t, i, n) {
  9656. function r(e) {
  9657. e.preventDefault(), a(e.currentTarget.id)
  9658. }
  9659. function a(e) {
  9660. ne[e](),
  9661. Object.keys(ne).map(function (t, i) {
  9662. $('#' + t).toggleClass('tabs-underlined', t === e)
  9663. })
  9664. }
  9665. ;(y = i), (v = t), w.init(E.Android, e, n), m()
  9666. var l = new RegExp('daydream', 'i'),
  9667. c = l.test(y.displayName)
  9668. c
  9669. ? (a('tabdaydream'), B.filter('.device-headset-side').attr('src', H), D.find('.title').text(x.localizeText('WEBVR_FOR_DAYDREAM')))
  9670. : (a('tabcardboard'), B.filter('.device-headset-side').attr('src', Y), D.find('.title').text(x.localizeText('WEBVR_FOR_CARDBOARD'))),
  9671. $('#vr').on('click', function (e) {
  9672. e.preventDefault(), g('click_webvr_button'), L.is(':hidden') && (ie.emit(_.OPENED), o())
  9673. }),
  9674. $('.webvr-popup .close').on('click', function (e) {
  9675. e.preventDefault(), D.hasClass('hidden') ? (g('webvr_help_close'), p()) : s()
  9676. }),
  9677. $('#tabcardboard').on('click', r),
  9678. $('#tabdaydream').on('click', r),
  9679. $('#tabnative').on('click', r),
  9680. $('.webvr-popup .open-with-app').on('click', function (e) {
  9681. e.preventDefault(), g('webvr_learn_more'), a('tabnative'), p()
  9682. }),
  9683. $('.webvr-popup .help').on('click', function (e) {
  9684. e.preventDefault(), g(D.hasClass('hidden') ? 'webvr_help_close' : 'webvr_help_show'), p()
  9685. }),
  9686. $('.webvr-popup .terms').on('click', function (e) {
  9687. e.preventDefault(), g('webvr_click_terms'), s(), ie.emit(_.SHOW_TERMS)
  9688. }),
  9689. F.on('click', function (e) {
  9690. e.preventDefault(), g(ee), window.open(J, '_blank')
  9691. }),
  9692. V.on('click', function (e) {
  9693. e.preventDefault(), g('webvr_phone_link'), window.open(te, '_blank')
  9694. }),
  9695. $('.webvr-popup .badge-cardboard').on('click', function (e) {
  9696. e.preventDefault(), g('webvr_cardboard_link'), w.launch(b.CardboardAndroid)
  9697. }),
  9698. $('.webvr-popup .badge-oculus').on('click', function (e) {
  9699. e.preventDefault(), g('webvr_oculus_link'), w.launch(b.GearVR)
  9700. })
  9701. }
  9702. function r() {
  9703. function e() {
  9704. y.isPresenting || (f(), window.removeEventListener('vrdisplaypresentchange', e))
  9705. }
  9706. R.info('Headset mounted'), v.suspend()
  9707. var t = document.createElement('canvas')
  9708. for (t.getContext('webgl'), t.className = 'webvr-canvas', document.bgColor = '#000', document.body.style.backgroundColor = '#000'; document.body.firstChild; )
  9709. document.body.removeChild(document.body.firstChild)
  9710. document.body.appendChild(t),
  9711. g('webvr_enter_app'),
  9712. y
  9713. .requestPresent([
  9714. {
  9715. source: t,
  9716. predistorted: !0
  9717. }
  9718. ])
  9719. .catch(function (t) {
  9720. R.error('Failed to present: ' + t), g('webvr_exit_calibrate'), e()
  9721. }),
  9722. A.then(function () {
  9723. window.dispatchEvent(new Event('vrapp-start'))
  9724. }),
  9725. window.addEventListener('vrdisplaypresentchange', e)
  9726. }
  9727. function o() {
  9728. O.fadeOut(I.guiAnimationSpeed), L.fadeIn(I.guiAnimationSpeed), a()
  9729. }
  9730. function a() {
  9731. if (!A) {
  9732. var e = C.valueFromHash('webvr') || I.appConfig.webvr_version,
  9733. t = 'https://static.port.com/webvr/' + e + '/js/main.js'
  9734. A = new Promise(function (e, i) {
  9735. var n = document.createElement('script')
  9736. ;(n.type = 'text/javascript'), (n.src = t), (n.onload = e), document.head.appendChild(n)
  9737. })
  9738. }
  9739. D.find('.enter-button').on('click', r)
  9740. }
  9741. function s() {
  9742. g('webvr_modal_close'),
  9743. D.find('.enter-button').off('click', r),
  9744. L.fadeOut(I.guiAnimationSpeed, function () {
  9745. D.toggleClass('hidden', !1), N.toggleClass('hidden', !0), C.exitFullscreen()
  9746. }),
  9747. O.fadeIn(I.guiAnimationSpeed)
  9748. }
  9749. function l() {
  9750. k.toggleClass('hidden', !1), U.toggleClass('hidden', !0)
  9751. }
  9752. function c() {
  9753. k.toggleClass('hidden', !0), U.toggleClass('hidden', !1)
  9754. }
  9755. function h() {
  9756. B.filter('.device-headset').attr('src', G),
  9757. B.filter('.device-phone').attr('src', z),
  9758. (J = Z),
  9759. (ee = K),
  9760. F.text(x.localizeText('WEBVR_DAYDREAM_VIEW')),
  9761. V.text(x.localizeText('VR_NEED_DAYDREAM_PHONE')),
  9762. $('.webvr-popup .detail.daydream-label').toggleClass('hidden', !1),
  9763. c()
  9764. }
  9765. function u() {
  9766. B.filter('.badge-cardboard').attr('src', j), B.filter('.badge-oculus').attr('src', X), l()
  9767. }
  9768. function d() {
  9769. B.filter('.device-headset').attr('src', Y),
  9770. B.filter('.device-phone').attr('src', W),
  9771. (J = q),
  9772. (ee = Q),
  9773. F.text(x.localizeText('VR_GOOGLE_CARDBOARD')),
  9774. V.text(x.localizeText('VR_COMPATIBLE_ANDROID_LONG')),
  9775. $('.webvr-popup .detail.daydream-label').toggleClass('hidden', !0),
  9776. c()
  9777. }
  9778. function p() {
  9779. D.toggleClass('hidden'), N.toggleClass('hidden')
  9780. }
  9781. function f() {
  9782. R.info('exiting webVR'), g('webvr_exit_app'), window.location.search.indexOf('&qs=1') === -1 ? (window.location = window.location + '&qs=1') : (window.location = window.location)
  9783. }
  9784. function g(e) {
  9785. var t = C.isLandscape() ? 'landscape' : 'portrait'
  9786. T.trackAlways('showcase_gui', {
  9787. gui_action: e,
  9788. orientation: t
  9789. })
  9790. }
  9791. function m() {
  9792. var e = C.isLandscape()
  9793. L.toggleClass('landscape', e).toggleClass('portrait', !e)
  9794. }
  9795. var v,
  9796. A,
  9797. y,
  9798. C = e('../../util/browser'),
  9799. I = e('../../settings'),
  9800. E = (e('./../gui'), e('../../enum/VRPlatforms')),
  9801. b = e('../../enum/VRApps'),
  9802. w = e('./../vr/vrLink'),
  9803. _ = e('./WebVrEvent'),
  9804. T = e('../../analytics'),
  9805. x = (e('../../constants'), e('../../localization/localize')),
  9806. S = e('../../util/common'),
  9807. M = e('../../util/logger'),
  9808. R = new M(i),
  9809. P = e('events').EventEmitter,
  9810. O = $('#gui'),
  9811. L = $('.webvr-popup'),
  9812. D = $('.webvr-popup .page.p1'),
  9813. N = $('.webvr-popup .page.p2'),
  9814. B = L.find('.image'),
  9815. F = $('.webvr-popup .detail.headset'),
  9816. V = $('.webvr-popup .detail.phone'),
  9817. U = $('.webvr-popup .tab-content.webvr'),
  9818. k = $('.webvr-popup .tab-content.native'),
  9819. H = 'images/device-daydream-side.png',
  9820. G = 'images/device-daydream.png',
  9821. z = 'images/device-pixel.png',
  9822. W = 'images/ico-android-robot.png',
  9823. j = 'images/badge-cardboard.png',
  9824. Y = 'images/headset-cardboard.png',
  9825. X = 'images/badge-oculus.png',
  9826. Z = 'https://madeby.google.com/vr/',
  9827. q = 'https://vr.google.com/cardboard/get-cardboard/',
  9828. K = 'webvr_daydream_link',
  9829. Q = 'webvr_cardboard_link',
  9830. J = Z,
  9831. ee = K,
  9832. te = 'https://vr.google.com/daydream/phones/',
  9833. ie = {
  9834. init: n
  9835. },
  9836. ne = {
  9837. tabcardboard: d,
  9838. tabdaydream: h,
  9839. tabnative: u
  9840. }
  9841. S.extendObject(ie, P.prototype), $(window).resize(m), (t.exports = ie)
  9842. }).call(this, '/js/gui/webvr/webVRgui.js')
  9843. },
  9844. {
  9845. '../../analytics': 4,
  9846. '../../constants': 8,
  9847. '../../enum/VRApps': 46,
  9848. '../../enum/VRPlatforms': 49,
  9849. '../../localization/localize': 108,
  9850. '../../settings': 166,
  9851. '../../util/browser': 182,
  9852. '../../util/common': 185,
  9853. '../../util/logger': 189,
  9854. './../gui': 65,
  9855. './../vr/vrLink': 86,
  9856. './WebVrEvent': 88,
  9857. events: 202
  9858. }
  9859. ],
  9860. 90: [
  9861. function (e, t, i) {
  9862. 'use strict'
  9863. function n(e, t, i, n, o) {
  9864. n || 0 === n ? (this.floorId = n) : (this.floorId = -1), (this.roomId = o || ''), (this.labelId = e), (this.position = new r.Vector3().copy(t)), (this.text = i)
  9865. }
  9866. var r = e('three'),
  9867. o = e('../util/browser')
  9868. ;(n.prototype.build = function () {
  9869. var e = window.document.createElement('div')
  9870. o.isMobile() ? e.setAttribute('class', 'gui-floorplan-label gui-floorplan-label-mobile') : e.setAttribute('class', 'gui-floorplan-label')
  9871. var t = window.document.createElement('div')
  9872. t.setAttribute('class', 'gui-floorplan-label-text')
  9873. var i = window.document.createTextNode(this.text)
  9874. t.appendChild(i), e.appendChild(t), window.document.body.appendChild(e), (this.labelGui = e), (this.textBlock = t), $(this.labelGui).hide()
  9875. var n = window.getComputedStyle(this.labelGui)
  9876. this.initialTransform = n.transform || n.webkitTransform
  9877. }),
  9878. (t.exports = n)
  9879. },
  9880. {
  9881. '../util/browser': 182,
  9882. three: 217
  9883. }
  9884. ],
  9885. 91: [
  9886. function (e, t, i) {
  9887. 'use strict'
  9888. function n() {
  9889. ;(this.player = null), (this.modelManager = null), (this.container = null)
  9890. }
  9891. var r = e('three'),
  9892. o = (e('../util/common'), e('../enum/PlayerEvents')),
  9893. a = (e('../enum/DirectorEvents'), e('../enum/ModelManagerEvents')),
  9894. s = e('../settings'),
  9895. l = e('../enum/Viewmode'),
  9896. c = (e('../enum/WarpStyle'), e('../util/transitions'), e('../util/lerp'), e('../util/browser'))
  9897. //场景初始化
  9898. ;(n.prototype.init = function (e, t, i) {
  9899. ;(this.player = e), (this.modelManager = t), (this.container = i), this.updateModel(), this.bindEvents()
  9900. }),
  9901. (n.prototype.bindEvents = function () {
  9902. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  9903. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9904. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9905. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  9906. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  9907. }),
  9908. (n.prototype.updateModel = function () {
  9909. this.model = this.modelManager.getActiveModel()
  9910. }),
  9911. (n.prototype.handlePlayerViewChanged = function () {
  9912. this.updateLabelVisibility(), this.updateLabelDisplay()
  9913. }),
  9914. (n.prototype.getLabelsForFloor = function (e, t) {
  9915. return (
  9916. (t = t || []),
  9917. (t.length = 0),
  9918. this.model.labels.forEach(
  9919. function (i) {
  9920. this.labelVisibleForFloor(i, e) && t.push(i)
  9921. }.bind(this)
  9922. ),
  9923. t
  9924. )
  9925. }),
  9926. (n.prototype.getLabelsForCurrentFloor = function (e) {
  9927. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9928. }),
  9929. (n.prototype.labelVisibleForFloor = function (e, t) {
  9930. var i =
  9931. (c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile) || (!c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop)
  9932. if (!this.model.showingLabels || !e.labelGui || !i) return !1
  9933. var n = e.floorId === this.model.floors.size() - 1
  9934. return this.model.allFloorsVisible ? n : e.floorId === t
  9935. }),
  9936. (n.prototype.updateLabelVisibility = function (e) {
  9937. this.model.labels.forEach(
  9938. function (e) {
  9939. this.supportedMode() && this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex)
  9940. ? this.showLabel(e, s.labels.fadeInDelay, s.labels.fadeInDuration)
  9941. : this.hideLabel(e, s.labels.fadeOutDelay, s.labels.fadeOutDuration)
  9942. }.bind(this)
  9943. )
  9944. }),
  9945. (n.prototype.showAllLabels = function (e, t) {
  9946. this.model.labels.forEach(
  9947. function (i) {
  9948. this.showLabel(i, e, t)
  9949. }.bind(this)
  9950. )
  9951. }),
  9952. (n.prototype.hideAllLabels = function (e, t) {
  9953. this.model.labels.forEach(
  9954. function (i) {
  9955. this.hideLabel(i, e, t)
  9956. }.bind(this)
  9957. )
  9958. }),
  9959. (n.prototype.showLabel = function (e, t, i) {
  9960. this.model.showingLabels && (e.visible || ((e.visible = !0), (e.labelGui.style.display = 'block'), (e.labelGui.style.opacity = 0), $(e.labelGui).delay(t).fadeTo(i, 1)))
  9961. }),
  9962. (n.prototype.hideLabel = function (e, t, i) {
  9963. e.visible && ((e.visible = !1), c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9964. }),
  9965. (n.prototype.supportedMode = function () {
  9966. return this.player.mode === l.FLOORPLAN
  9967. }),
  9968. (n.prototype.updateLabelDisplay = (function () {
  9969. var e = (new r.Vector3(), new r.Vector3(), [])
  9970. return function () {
  9971. var t = this.player.getLabelScaleFactor(),
  9972. i = 0.6,
  9973. n = 1.2,
  9974. r = (1 - t) * n + i,
  9975. o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop
  9976. this.getLabelsForCurrentFloor(e)
  9977. for (var a = 0; a < e.length; a++) {
  9978. var l = e[a]
  9979. this.supportedMode() &&
  9980. l.labelGui &&
  9981. (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  9982. t >= o && l.text.length >= s.labels.minLengthForTruncate
  9983. ? (l.textBlock.innerText = l.text.substring(0, s.labels.truncateLength) + s.labels.truncateSuffix)
  9984. : (l.textBlock.innerText = l.text))
  9985. }
  9986. }
  9987. })()),
  9988. (n.prototype.updateProjectedGuiElement = (function () {
  9989. var e = new r.Vector3()
  9990. new r.Vector3()
  9991. return function (t, i, n, r, o) {
  9992. i.style.fontSize = 100 * o + '%'
  9993. var a = $('#player').width(),
  9994. s = $('#player').height(),
  9995. l = 0.5 * a,
  9996. c = 0.5 * s
  9997. e.copy(n), e.project(this.player.camera)
  9998. var h = e.x * l + l,
  9999. u = -(e.y * c) + c
  10000. ;(h -= t.offsetWidth / 2), (u -= t.offsetHeight / 2), (t.style.left = h + 'px'), (t.style.top = u + 'px')
  10001. }
  10002. })()),
  10003. (n.prototype.handleStartInside = function (e) {
  10004. this.updateLabelVisibility()
  10005. }),
  10006. (n.prototype.handleStartOutside = function () {
  10007. this.updateLabelVisibility()
  10008. }),
  10009. (t.exports = n)
  10010. },
  10011. {
  10012. '../enum/DirectorEvents': 23,
  10013. '../enum/ModelManagerEvents': 33,
  10014. '../enum/PlayerEvents': 40,
  10015. '../enum/Viewmode': 51,
  10016. '../enum/WarpStyle': 52,
  10017. '../settings': 166,
  10018. '../util/browser': 182,
  10019. '../util/common': 185,
  10020. '../util/lerp': 188,
  10021. '../util/transitions': 195,
  10022. three: 217
  10023. }
  10024. ],
  10025. 92: [
  10026. function (e, t, i) {
  10027. 'use strict'
  10028. Array.prototype.findIndex ||
  10029. (Array.prototype.findIndex = function (e) {
  10030. if (null == this) throw new TypeError('Array.prototype.findIndex called on null or undefined')
  10031. if ('function' != typeof e) throw new TypeError('predicate must be a function')
  10032. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++) if (((t = i[o]), e.call(r, t, o, i))) return o
  10033. return -1
  10034. }),
  10035. Array.prototype.find ||
  10036. Object.defineProperty(Array.prototype, 'find', {
  10037. value: function (e) {
  10038. if (null == this) throw new TypeError('"this" is null or not defined')
  10039. var t = Object(this),
  10040. i = t.length >>> 0
  10041. if ('function' != typeof e) throw new TypeError('predicate must be a function')
  10042. for (var n = arguments[1], r = 0; r < i; ) {
  10043. var o = t[r]
  10044. if (e.call(n, o, r, t)) return o
  10045. r++
  10046. }
  10047. }
  10048. })
  10049. },
  10050. {}
  10051. ],
  10052. 93: [
  10053. function (e, t, i) {
  10054. 'use strict'
  10055. var n = n || {}
  10056. ;(t.exports = n),
  10057. (n.gui = n.gui || {}),
  10058. (n.utils = n.utils || {}),
  10059. (n.controllers = n.controllers || {}),
  10060. (n.dom = n.dom || {}),
  10061. (n.color = n.color || {}),
  10062. (n.utils.css = (function () {
  10063. return {
  10064. load: function (e, t) {
  10065. t = t || document
  10066. var i = t.createElement('link')
  10067. ;(i.type = 'text/css'), (i.rel = 'stylesheet'), (i.href = e), t.getElementsByTagName('head')[0].appendChild(i)
  10068. },
  10069. inject: function (e, t) {
  10070. t = t || document
  10071. var i = document.createElement('style')
  10072. ;(i.type = 'text/css'), (i.innerHTML = e), t.getElementsByTagName('head')[0].appendChild(i)
  10073. }
  10074. }
  10075. })()),
  10076. (n.utils.common = (function () {
  10077. var e = Array.prototype.forEach,
  10078. t = Array.prototype.slice
  10079. return {
  10080. BREAK: {},
  10081. extend: function (e) {
  10082. return (
  10083. this.each(
  10084. t.call(arguments, 1),
  10085. function (t) {
  10086. for (var i in t) this.isUndefined(t[i]) || (e[i] = t[i])
  10087. },
  10088. this
  10089. ),
  10090. e
  10091. )
  10092. },
  10093. defaults: function (e) {
  10094. return (
  10095. this.each(
  10096. t.call(arguments, 1),
  10097. function (t) {
  10098. for (var i in t) this.isUndefined(e[i]) && (e[i] = t[i])
  10099. },
  10100. this
  10101. ),
  10102. e
  10103. )
  10104. },
  10105. compose: function () {
  10106. var e = t.call(arguments)
  10107. return function () {
  10108. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--) i = [e[n].apply(this, i)]
  10109. return i[0]
  10110. }
  10111. },
  10112. each: function (t, i, n) {
  10113. if (t)
  10114. if (e && t.forEach && t.forEach === e) t.forEach(i, n)
  10115. else if (t.length === t.length + 0) {
  10116. for (var r = 0, o = t.length; r < o; r++) if (r in t && i.call(n, t[r], r) === this.BREAK) return
  10117. } else for (var r in t) if (i.call(n, t[r], r) === this.BREAK) return
  10118. },
  10119. defer: function (e) {
  10120. setTimeout(e, 0)
  10121. },
  10122. toArray: function (e) {
  10123. return e.toArray ? e.toArray() : t.call(e)
  10124. },
  10125. isUndefined: function (e) {
  10126. return void 0 === e
  10127. },
  10128. isNull: function (e) {
  10129. return null === e
  10130. },
  10131. isNaN: function (e) {
  10132. return e !== e
  10133. },
  10134. isArray:
  10135. Array.isArray ||
  10136. function (e) {
  10137. return e.constructor === Array
  10138. },
  10139. isObject: function (e) {
  10140. return e === Object(e)
  10141. },
  10142. isNumber: function (e) {
  10143. return e === e + 0
  10144. },
  10145. isString: function (e) {
  10146. return e === e + ''
  10147. },
  10148. isBoolean: function (e) {
  10149. return e === !1 || e === !0
  10150. },
  10151. isFunction: function (e) {
  10152. return '[object Function]' === Object.prototype.toString.call(e)
  10153. }
  10154. }
  10155. })()),
  10156. (n.controllers.Controller = (function (e) {
  10157. var t = function (e, t) {
  10158. ;(this.initialValue = e[t]), (this.domElement = document.createElement('div')), (this.object = e), (this.property = t), (this.__onChange = void 0), (this.__onFinishChange = void 0)
  10159. }
  10160. return (
  10161. e.extend(t.prototype, {
  10162. onChange: function (e) {
  10163. return (this.__onChange = e), this
  10164. },
  10165. onFinishChange: function (e) {
  10166. return (this.__onFinishChange = e), this
  10167. },
  10168. setValue: function (e) {
  10169. return (this.object[this.property] = e), this.__onChange && this.__onChange.call(this, e), this.updateDisplay(), this
  10170. },
  10171. getValue: function () {
  10172. return this.object[this.property]
  10173. },
  10174. updateDisplay: function () {
  10175. return this
  10176. },
  10177. isModified: function () {
  10178. return this.initialValue !== this.getValue()
  10179. }
  10180. }),
  10181. t
  10182. )
  10183. })(n.utils.common)),
  10184. (n.dom.dom = (function (e) {
  10185. function t(t) {
  10186. if ('0' === t || e.isUndefined(t)) return 0
  10187. var i = t.match(r)
  10188. return e.isNull(i) ? 0 : parseFloat(i[1])
  10189. }
  10190. var i = {
  10191. HTMLEvents: ['change'],
  10192. MouseEvents: ['click', 'mousemove', 'mousedown', 'mouseup', 'mouseover'],
  10193. KeyboardEvents: ['keydown']
  10194. },
  10195. n = {}
  10196. e.each(i, function (t, i) {
  10197. e.each(t, function (e) {
  10198. n[e] = i
  10199. })
  10200. })
  10201. var r = /(\d+(\.\d+)?)px/,
  10202. o = {
  10203. makeSelectable: function (e, t) {
  10204. void 0 !== e &&
  10205. void 0 !== e.style &&
  10206. ((e.onselectstart = t
  10207. ? function () {
  10208. return !1
  10209. }
  10210. : function () {}),
  10211. (e.style.MozUserSelect = t ? 'auto' : 'none'),
  10212. (e.style.KhtmlUserSelect = t ? 'auto' : 'none'),
  10213. (e.unselectable = t ? 'on' : 'off'))
  10214. },
  10215. makeFullscreen: function (t, i, n) {
  10216. e.isUndefined(i) && (i = !0),
  10217. e.isUndefined(n) && (n = !0),
  10218. (t.style.position = 'absolute'),
  10219. i && ((t.style.left = 0), (t.style.right = 0)),
  10220. n && ((t.style.top = 0), (t.style.bottom = 0))
  10221. },
  10222. fakeEvent: function (t, i, r, o) {
  10223. r = r || {}
  10224. var a = n[i]
  10225. if (!a) throw new Error('Event type ' + i + ' not supported.')
  10226. var s = document.createEvent(a)
  10227. switch (a) {
  10228. case 'MouseEvents':
  10229. var l = r.x || r.clientX || 0,
  10230. c = r.y || r.clientY || 0
  10231. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null)
  10232. break
  10233. case 'KeyboardEvents':
  10234. var h = s.initKeyboardEvent || s.initKeyEvent
  10235. e.defaults(r, {
  10236. cancelable: !0,
  10237. ctrlKey: !1,
  10238. altKey: !1,
  10239. shiftKey: !1,
  10240. metaKey: !1,
  10241. keyCode: void 0,
  10242. charCode: void 0
  10243. }),
  10244. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode)
  10245. break
  10246. default:
  10247. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  10248. }
  10249. e.defaults(s, o), t.dispatchEvent(s)
  10250. },
  10251. bind: function (e, t, i, n) {
  10252. return (n = n || !1), e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent('on' + t, i), o
  10253. },
  10254. unbind: function (e, t, i, n) {
  10255. return (n = n || !1), e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent('on' + t, i), o
  10256. },
  10257. addClass: function (e, t) {
  10258. if (void 0 === e.className) e.className = t
  10259. else if (e.className !== t) {
  10260. var i = e.className.split(/ +/)
  10261. i.indexOf(t) == -1 && (i.push(t), (e.className = i.join(' ').replace(/^\s+/, '').replace(/\s+$/, '')))
  10262. }
  10263. return o
  10264. },
  10265. removeClass: function (e, t) {
  10266. if (t)
  10267. if (void 0 === e.className);
  10268. else if (e.className === t) e.removeAttribute('class')
  10269. else {
  10270. var i = e.className.split(/ +/),
  10271. n = i.indexOf(t)
  10272. n != -1 && (i.splice(n, 1), (e.className = i.join(' ')))
  10273. }
  10274. else e.className = void 0
  10275. return o
  10276. },
  10277. hasClass: function (e, t) {
  10278. return new RegExp('(?:^|\\s+)' + t + '(?:\\s+|$)').test(e.className) || !1
  10279. },
  10280. getWidth: function (e) {
  10281. var i = getComputedStyle(e)
  10282. return t(i['border-left-width']) + t(i['border-right-width']) + t(i['padding-left']) + t(i['padding-right']) + t(i.width)
  10283. },
  10284. getHeight: function (e) {
  10285. var i = getComputedStyle(e)
  10286. return t(i['border-top-width']) + t(i['border-bottom-width']) + t(i['padding-top']) + t(i['padding-bottom']) + t(i.height)
  10287. },
  10288. getOffset: function (e) {
  10289. var t = {
  10290. left: 0,
  10291. top: 0
  10292. }
  10293. if (e.offsetParent)
  10294. do (t.left += e.offsetLeft), (t.top += e.offsetTop)
  10295. while ((e = e.offsetParent))
  10296. return t
  10297. },
  10298. isActive: function (e) {
  10299. return e === document.activeElement && (e.type || e.href)
  10300. }
  10301. }
  10302. return o
  10303. })(n.utils.common)),
  10304. (n.controllers.OptionController = (function (e, t, i) {
  10305. var n = function (e, r, o) {
  10306. n.superclass.call(this, e, r)
  10307. var a = this
  10308. if (((this.__select = document.createElement('select')), i.isArray(o))) {
  10309. var s = {}
  10310. i.each(o, function (e) {
  10311. s[e] = e
  10312. }),
  10313. (o = s)
  10314. }
  10315. i.each(o, function (e, t) {
  10316. var i = document.createElement('option')
  10317. ;(i.innerHTML = t), i.setAttribute('value', e), a.__select.appendChild(i)
  10318. }),
  10319. this.updateDisplay(),
  10320. t.bind(this.__select, 'change', function () {
  10321. var e = this.options[this.selectedIndex].value
  10322. a.setValue(e)
  10323. }),
  10324. this.domElement.appendChild(this.__select)
  10325. }
  10326. return (
  10327. (n.superclass = e),
  10328. i.extend(n.prototype, e.prototype, {
  10329. setValue: function (e) {
  10330. var t = n.superclass.prototype.setValue.call(this, e)
  10331. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), t
  10332. },
  10333. updateDisplay: function () {
  10334. return (this.__select.value = this.getValue()), n.superclass.prototype.updateDisplay.call(this)
  10335. }
  10336. }),
  10337. n
  10338. )
  10339. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  10340. (n.controllers.NumberController = (function (e, t) {
  10341. function i(e) {
  10342. return (e = e.toString()), e.indexOf('.') > -1 ? e.length - e.indexOf('.') - 1 : 0
  10343. }
  10344. var n = function (e, r, o) {
  10345. n.superclass.call(this, e, r),
  10346. (o = o || {}),
  10347. (this.__min = o.min),
  10348. (this.__max = o.max),
  10349. (this.__step = o.step),
  10350. t.isUndefined(this.__step)
  10351. ? 0 == this.initialValue
  10352. ? (this.__impliedStep = 1)
  10353. : (this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10)
  10354. : (this.__impliedStep = this.__step),
  10355. (this.__precision = i(this.__impliedStep))
  10356. }
  10357. return (
  10358. (n.superclass = e),
  10359. t.extend(n.prototype, e.prototype, {
  10360. setValue: function (e) {
  10361. return (
  10362. void 0 !== this.__min && e < this.__min ? (e = this.__min) : void 0 !== this.__max && e > this.__max && (e = this.__max),
  10363. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  10364. n.superclass.prototype.setValue.call(this, e)
  10365. )
  10366. },
  10367. min: function (e) {
  10368. return (this.__min = e), this
  10369. },
  10370. max: function (e) {
  10371. return (this.__max = e), this
  10372. },
  10373. step: function (e) {
  10374. return (this.__step = e), (this.__impliedStep = e), (this.__precision = i(e)), this
  10375. }
  10376. }),
  10377. n
  10378. )
  10379. })(n.controllers.Controller, n.utils.common)),
  10380. (n.controllers.NumberControllerBox = (function (e, t, i) {
  10381. function n(e, t) {
  10382. var i = Math.pow(10, t)
  10383. return Math.round(e * i) / i
  10384. }
  10385. var r = function (e, n, o) {
  10386. function a() {
  10387. var e = parseFloat(d.__input.value)
  10388. i.isNaN(e) || d.setValue(e)
  10389. }
  10390. function s() {
  10391. a(), d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  10392. }
  10393. function l(e) {
  10394. t.bind(window, 'mousemove', c), t.bind(window, 'mouseup', h), (u = e.clientY)
  10395. }
  10396. function c(e) {
  10397. var t = u - e.clientY
  10398. d.setValue(d.getValue() + t * d.__impliedStep), (u = e.clientY)
  10399. }
  10400. function h() {
  10401. t.unbind(window, 'mousemove', c), t.unbind(window, 'mouseup', h)
  10402. }
  10403. ;(this.__truncationSuspended = !1), r.superclass.call(this, e, n, o)
  10404. var u,
  10405. d = this
  10406. ;(this.__input = document.createElement('input')),
  10407. this.__input.setAttribute('type', 'text'),
  10408. t.bind(this.__input, 'change', a),
  10409. t.bind(this.__input, 'blur', s),
  10410. t.bind(this.__input, 'mousedown', l),
  10411. t.bind(this.__input, 'keydown', function (e) {
  10412. 13 === e.keyCode && ((d.__truncationSuspended = !0), this.blur(), (d.__truncationSuspended = !1))
  10413. }),
  10414. this.updateDisplay(),
  10415. this.domElement.appendChild(this.__input)
  10416. }
  10417. return (
  10418. (r.superclass = e),
  10419. i.extend(r.prototype, e.prototype, {
  10420. updateDisplay: function () {
  10421. return (this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision)), r.superclass.prototype.updateDisplay.call(this)
  10422. }
  10423. }),
  10424. r
  10425. )
  10426. })(n.controllers.NumberController, n.dom.dom, n.utils.common)),
  10427. (n.controllers.NumberControllerSlider = (function (e, t, i, n, r) {
  10428. function o(e, t, i, n, r) {
  10429. return n + (r - n) * ((e - t) / (i - t))
  10430. }
  10431. var a = function (e, i, n, r, s) {
  10432. function l(e) {
  10433. t.bind(window, 'mousemove', c), t.bind(window, 'mouseup', h), c(e)
  10434. }
  10435. function c(e) {
  10436. e.preventDefault()
  10437. var i = t.getOffset(u.__background),
  10438. n = t.getWidth(u.__background)
  10439. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)), !1
  10440. }
  10441. function h() {
  10442. t.unbind(window, 'mousemove', c), t.unbind(window, 'mouseup', h), u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  10443. }
  10444. a.superclass.call(this, e, i, {
  10445. min: n,
  10446. max: r,
  10447. step: s
  10448. })
  10449. var u = this
  10450. ;(this.__background = document.createElement('div')),
  10451. (this.__foreground = document.createElement('div')),
  10452. t.bind(this.__background, 'mousedown', l),
  10453. t.addClass(this.__background, 'slider'),
  10454. t.addClass(this.__foreground, 'slider-fg'),
  10455. this.updateDisplay(),
  10456. this.__background.appendChild(this.__foreground),
  10457. this.domElement.appendChild(this.__background)
  10458. }
  10459. return (
  10460. (a.superclass = e),
  10461. (a.useDefaultStyles = function () {
  10462. i.inject(r)
  10463. }),
  10464. n.extend(a.prototype, e.prototype, {
  10465. updateDisplay: function () {
  10466. var e = (this.getValue() - this.__min) / (this.__max - this.__min)
  10467. return (this.__foreground.style.width = 100 * e + '%'), a.superclass.prototype.updateDisplay.call(this)
  10468. }
  10469. }),
  10470. a
  10471. )
  10472. })(
  10473. n.controllers.NumberController,
  10474. n.dom.dom,
  10475. n.utils.css,
  10476. n.utils.common,
  10477. '/**\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}'
  10478. )),
  10479. (n.controllers.FunctionController = (function (e, t, i) {
  10480. var n = function (e, i, r) {
  10481. n.superclass.call(this, e, i)
  10482. var o = this
  10483. ;(this.__button = document.createElement('div')),
  10484. (this.__button.innerHTML = void 0 === r ? 'Fire' : r),
  10485. t.bind(this.__button, 'click', function (e) {
  10486. return e.preventDefault(), o.fire(), !1
  10487. }),
  10488. t.addClass(this.__button, 'button'),
  10489. this.domElement.appendChild(this.__button)
  10490. }
  10491. return (
  10492. (n.superclass = e),
  10493. i.extend(n.prototype, e.prototype, {
  10494. fire: function () {
  10495. this.__onChange && this.__onChange.call(this), this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), this.getValue().call(this.object)
  10496. }
  10497. }),
  10498. n
  10499. )
  10500. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  10501. (n.controllers.BooleanController = (function (e, t, i) {
  10502. var n = function (e, i) {
  10503. function r() {
  10504. o.setValue(!o.__prev)
  10505. }
  10506. n.superclass.call(this, e, i)
  10507. var o = this
  10508. ;(this.__prev = this.getValue()),
  10509. (this.__checkbox = document.createElement('input')),
  10510. this.__checkbox.setAttribute('type', 'checkbox'),
  10511. t.bind(this.__checkbox, 'change', r, !1),
  10512. this.domElement.appendChild(this.__checkbox),
  10513. this.updateDisplay()
  10514. }
  10515. return (
  10516. (n.superclass = e),
  10517. i.extend(n.prototype, e.prototype, {
  10518. setValue: function (e) {
  10519. var t = n.superclass.prototype.setValue.call(this, e)
  10520. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), (this.__prev = this.getValue()), t
  10521. },
  10522. updateDisplay: function () {
  10523. return (
  10524. this.getValue() === !0 ? (this.__checkbox.setAttribute('checked', 'checked'), (this.__checkbox.checked = !0)) : (this.__checkbox.checked = !1),
  10525. n.superclass.prototype.updateDisplay.call(this)
  10526. )
  10527. }
  10528. }),
  10529. n
  10530. )
  10531. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  10532. (n.color.toString = (function (e) {
  10533. return function (t) {
  10534. if (1 == t.a || e.isUndefined(t.a)) {
  10535. for (var i = t.hex.toString(16); i.length < 6; ) i = '0' + i
  10536. return '#' + i
  10537. }
  10538. return 'rgba(' + Math.round(t.r) + ',' + Math.round(t.g) + ',' + Math.round(t.b) + ',' + t.a + ')'
  10539. }
  10540. })(n.utils.common)),
  10541. (n.color.interpret = (function (e, t) {
  10542. var i,
  10543. n,
  10544. r = function () {
  10545. n = !1
  10546. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0]
  10547. return (
  10548. t.each(o, function (r) {
  10549. if (r.litmus(e))
  10550. return (
  10551. t.each(r.conversions, function (r, o) {
  10552. if (((i = r.read(e)), n === !1 && i !== !1)) return (n = i), (i.conversionName = o), (i.conversion = r), t.BREAK
  10553. }),
  10554. t.BREAK
  10555. )
  10556. }),
  10557. n
  10558. )
  10559. },
  10560. o = [
  10561. {
  10562. litmus: t.isString,
  10563. conversions: {
  10564. THREE_CHAR_HEX: {
  10565. read: function (e) {
  10566. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i)
  10567. return (
  10568. null !== t && {
  10569. space: 'HEX',
  10570. hex: parseInt('0x' + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10571. }
  10572. )
  10573. },
  10574. write: e
  10575. },
  10576. SIX_CHAR_HEX: {
  10577. read: function (e) {
  10578. var t = e.match(/^#([A-F0-9]{6})$/i)
  10579. return (
  10580. null !== t && {
  10581. space: 'HEX',
  10582. hex: parseInt('0x' + t[1].toString())
  10583. }
  10584. )
  10585. },
  10586. write: e
  10587. },
  10588. CSS_RGB: {
  10589. read: function (e) {
  10590. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/)
  10591. return (
  10592. null !== t && {
  10593. space: 'RGB',
  10594. r: parseFloat(t[1]),
  10595. g: parseFloat(t[2]),
  10596. b: parseFloat(t[3])
  10597. }
  10598. )
  10599. },
  10600. write: e
  10601. },
  10602. CSS_RGBA: {
  10603. read: function (e) {
  10604. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/)
  10605. return (
  10606. null !== t && {
  10607. space: 'RGB',
  10608. r: parseFloat(t[1]),
  10609. g: parseFloat(t[2]),
  10610. b: parseFloat(t[3]),
  10611. a: parseFloat(t[4])
  10612. }
  10613. )
  10614. },
  10615. write: e
  10616. }
  10617. }
  10618. },
  10619. {
  10620. litmus: t.isNumber,
  10621. conversions: {
  10622. HEX: {
  10623. read: function (e) {
  10624. return {
  10625. space: 'HEX',
  10626. hex: e,
  10627. conversionName: 'HEX'
  10628. }
  10629. },
  10630. write: function (e) {
  10631. return e.hex
  10632. }
  10633. }
  10634. }
  10635. },
  10636. {
  10637. litmus: t.isArray,
  10638. conversions: {
  10639. RGB_ARRAY: {
  10640. read: function (e) {
  10641. return (
  10642. 3 == e.length && {
  10643. space: 'RGB',
  10644. r: e[0],
  10645. g: e[1],
  10646. b: e[2]
  10647. }
  10648. )
  10649. },
  10650. write: function (e) {
  10651. return [e.r, e.g, e.b]
  10652. }
  10653. },
  10654. RGBA_ARRAY: {
  10655. read: function (e) {
  10656. return (
  10657. 4 == e.length && {
  10658. space: 'RGB',
  10659. r: e[0],
  10660. g: e[1],
  10661. b: e[2],
  10662. a: e[3]
  10663. }
  10664. )
  10665. },
  10666. write: function (e) {
  10667. return [e.r, e.g, e.b, e.a]
  10668. }
  10669. }
  10670. }
  10671. },
  10672. {
  10673. litmus: t.isObject,
  10674. conversions: {
  10675. RGBA_OBJ: {
  10676. read: function (e) {
  10677. return (
  10678. !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10679. space: 'RGB',
  10680. r: e.r,
  10681. g: e.g,
  10682. b: e.b,
  10683. a: e.a
  10684. }
  10685. )
  10686. },
  10687. write: function (e) {
  10688. return {
  10689. r: e.r,
  10690. g: e.g,
  10691. b: e.b,
  10692. a: e.a
  10693. }
  10694. }
  10695. },
  10696. RGB_OBJ: {
  10697. read: function (e) {
  10698. return (
  10699. !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10700. space: 'RGB',
  10701. r: e.r,
  10702. g: e.g,
  10703. b: e.b
  10704. }
  10705. )
  10706. },
  10707. write: function (e) {
  10708. return {
  10709. r: e.r,
  10710. g: e.g,
  10711. b: e.b
  10712. }
  10713. }
  10714. },
  10715. HSVA_OBJ: {
  10716. read: function (e) {
  10717. return (
  10718. !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10719. space: 'HSV',
  10720. h: e.h,
  10721. s: e.s,
  10722. v: e.v,
  10723. a: e.a
  10724. }
  10725. )
  10726. },
  10727. write: function (e) {
  10728. return {
  10729. h: e.h,
  10730. s: e.s,
  10731. v: e.v,
  10732. a: e.a
  10733. }
  10734. }
  10735. },
  10736. HSV_OBJ: {
  10737. read: function (e) {
  10738. return (
  10739. !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10740. space: 'HSV',
  10741. h: e.h,
  10742. s: e.s,
  10743. v: e.v
  10744. }
  10745. )
  10746. },
  10747. write: function (e) {
  10748. return {
  10749. h: e.h,
  10750. s: e.s,
  10751. v: e.v
  10752. }
  10753. }
  10754. }
  10755. }
  10756. }
  10757. ]
  10758. return r
  10759. })(n.color.toString, n.utils.common)),
  10760. (n.GUI = n.gui.GUI =
  10761. (function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10762. function g(e, t, i, o) {
  10763. if (void 0 === t[i]) throw new Error('Object ' + t + ' has no property "' + i + '"')
  10764. var a
  10765. if (o.color) a = new h(t, i)
  10766. else {
  10767. var s = [t, i].concat(o.factoryArgs)
  10768. a = n.apply(e, s)
  10769. }
  10770. o.before instanceof r && (o.before = o.before.__li), A(e, a), p.addClass(a.domElement, 'c')
  10771. var l = document.createElement('span')
  10772. p.addClass(l, 'property-name'), (l.innerHTML = a.property)
  10773. var c = document.createElement('div')
  10774. c.appendChild(l), c.appendChild(a.domElement)
  10775. var u = m(e, c, o.before)
  10776. return p.addClass(u, V.CLASS_CONTROLLER_ROW), p.addClass(u, typeof a.getValue()), v(e, u, a), e.__controllers.push(a), a
  10777. }
  10778. function m(e, t, i) {
  10779. var n = document.createElement('li')
  10780. return t && n.appendChild(t), i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n), e.onResize(), n
  10781. }
  10782. function v(e, t, i) {
  10783. if (
  10784. ((i.__li = t),
  10785. (i.__gui = e),
  10786. f.extend(i, {
  10787. options: function (t) {
  10788. return arguments.length > 1
  10789. ? (i.remove(),
  10790. g(e, i.object, i.property, {
  10791. before: i.__li.nextElementSibling,
  10792. factoryArgs: [f.toArray(arguments)]
  10793. }))
  10794. : f.isArray(t) || f.isObject(t)
  10795. ? (i.remove(),
  10796. g(e, i.object, i.property, {
  10797. before: i.__li.nextElementSibling,
  10798. factoryArgs: [t]
  10799. }))
  10800. : void 0
  10801. },
  10802. name: function (e) {
  10803. return (i.__li.firstElementChild.firstElementChild.innerHTML = e), i
  10804. },
  10805. listen: function () {
  10806. return i.__gui.listen(i), i
  10807. },
  10808. remove: function () {
  10809. return i.__gui.remove(i), i
  10810. }
  10811. }),
  10812. i instanceof l)
  10813. ) {
  10814. var n = new s(i.object, i.property, {
  10815. min: i.__min,
  10816. max: i.__max,
  10817. step: i.__step
  10818. })
  10819. f.each(['updateDisplay', 'onChange', 'onFinishChange'], function (e) {
  10820. var t = i[e],
  10821. r = n[e]
  10822. i[e] = n[e] = function () {
  10823. var e = Array.prototype.slice.call(arguments)
  10824. return t.apply(i, e), r.apply(n, e)
  10825. }
  10826. }),
  10827. p.addClass(t, 'has-slider'),
  10828. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10829. } else if (i instanceof s) {
  10830. var r = function (t) {
  10831. return f.isNumber(i.__min) && f.isNumber(i.__max)
  10832. ? (i.remove(),
  10833. g(e, i.object, i.property, {
  10834. before: i.__li.nextElementSibling,
  10835. factoryArgs: [i.__min, i.__max, i.__step]
  10836. }))
  10837. : t
  10838. }
  10839. ;(i.min = f.compose(r, i.min)), (i.max = f.compose(r, i.max))
  10840. } else
  10841. i instanceof o
  10842. ? (p.bind(t, 'click', function () {
  10843. p.fakeEvent(i.__checkbox, 'click')
  10844. }),
  10845. p.bind(i.__checkbox, 'click', function (e) {
  10846. e.stopPropagation()
  10847. }))
  10848. : i instanceof a
  10849. ? (p.bind(t, 'click', function () {
  10850. p.fakeEvent(i.__button, 'click')
  10851. }),
  10852. p.bind(t, 'mouseover', function () {
  10853. p.addClass(i.__button, 'hover')
  10854. }),
  10855. p.bind(t, 'mouseout', function () {
  10856. p.removeClass(i.__button, 'hover')
  10857. }))
  10858. : i instanceof h &&
  10859. (p.addClass(t, 'color'),
  10860. (i.updateDisplay = f.compose(function (e) {
  10861. return (t.style.borderLeftColor = i.__color.toString()), e
  10862. }, i.updateDisplay)),
  10863. i.updateDisplay())
  10864. i.setValue = f.compose(function (t) {
  10865. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0), t
  10866. }, i.setValue)
  10867. }
  10868. function A(e, t) {
  10869. var i = e.getRoot(),
  10870. n = i.__rememberedObjects.indexOf(t.object)
  10871. if (n != -1) {
  10872. var r = i.__rememberedObjectIndecesToControllers[n]
  10873. if ((void 0 === r && ((r = {}), (i.__rememberedObjectIndecesToControllers[n] = r)), (r[t.property] = t), i.load && i.load.remembered)) {
  10874. var o,
  10875. a = i.load.remembered
  10876. if (a[e.preset]) o = a[e.preset]
  10877. else {
  10878. if (!a[L]) return
  10879. o = a[L]
  10880. }
  10881. if (o[n] && void 0 !== o[n][t.property]) {
  10882. var s = o[n][t.property]
  10883. ;(t.initialValue = s), t.setValue(s)
  10884. }
  10885. }
  10886. }
  10887. }
  10888. function y(e, t) {
  10889. return document.location.href + '.' + t
  10890. }
  10891. function C(e) {
  10892. var t = (e.__save_row = document.createElement('li'))
  10893. p.addClass(e.domElement, 'has-save'), e.__ul.insertBefore(t, e.__ul.firstChild), p.addClass(t, 'save-row')
  10894. var i = document.createElement('span')
  10895. ;(i.innerHTML = '&nbsp;'), p.addClass(i, 'button gears')
  10896. var n = document.createElement('span')
  10897. ;(n.innerHTML = 'Save'), p.addClass(n, 'button'), p.addClass(n, 'save')
  10898. var r = document.createElement('span')
  10899. ;(r.innerHTML = 'New'), p.addClass(r, 'button'), p.addClass(r, 'save-as')
  10900. var o = document.createElement('span')
  10901. ;(o.innerHTML = 'Revert'), p.addClass(o, 'button'), p.addClass(o, 'revert')
  10902. var a = (e.__preset_select = document.createElement('select'))
  10903. if (
  10904. (e.load && e.load.remembered
  10905. ? f.each(e.load.remembered, function (t, i) {
  10906. w(e, i, i == e.preset)
  10907. })
  10908. : w(e, L, !1),
  10909. p.bind(a, 'change', function () {
  10910. for (var t = 0; t < e.__preset_select.length; t++) e.__preset_select[t].innerHTML = e.__preset_select[t].value
  10911. e.preset = this.value
  10912. }),
  10913. t.appendChild(a),
  10914. t.appendChild(i),
  10915. t.appendChild(n),
  10916. t.appendChild(r),
  10917. t.appendChild(o),
  10918. D)
  10919. ) {
  10920. var s = document.getElementById('dg-save-locally'),
  10921. l = document.getElementById('dg-local-explain')
  10922. s.style.display = 'block'
  10923. var c = document.getElementById('dg-local-storage')
  10924. 'true' === localStorage.getItem(y(e, 'isLocal')) && c.setAttribute('checked', 'checked')
  10925. var h = function () {
  10926. l.style.display = e.useLocalStorage ? 'block' : 'none'
  10927. }
  10928. h(),
  10929. p.bind(c, 'change', function () {
  10930. ;(e.useLocalStorage = !e.useLocalStorage), h()
  10931. })
  10932. }
  10933. var u = document.getElementById('dg-new-constructor')
  10934. p.bind(u, 'keydown', function (e) {
  10935. !e.metaKey || (67 !== e.which && 67 != e.keyCode) || S.hide()
  10936. }),
  10937. p.bind(i, 'click', function () {
  10938. ;(u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2)), S.show(), u.focus(), u.select()
  10939. }),
  10940. p.bind(n, 'click', function () {
  10941. e.save()
  10942. }),
  10943. p.bind(r, 'click', function () {
  10944. var t = prompt('Enter a new preset name.')
  10945. t && e.saveAs(t)
  10946. }),
  10947. p.bind(o, 'click', function () {
  10948. e.revert()
  10949. })
  10950. }
  10951. function I(e) {
  10952. function t(t) {
  10953. return t.preventDefault(), (r = t.clientX), p.addClass(e.__closeButton, V.CLASS_DRAG), p.bind(window, 'mousemove', i), p.bind(window, 'mouseup', n), !1
  10954. }
  10955. function i(t) {
  10956. return t.preventDefault(), (e.width += r - t.clientX), e.onResize(), (r = t.clientX), !1
  10957. }
  10958. function n() {
  10959. p.removeClass(e.__closeButton, V.CLASS_DRAG), p.unbind(window, 'mousemove', i), p.unbind(window, 'mouseup', n)
  10960. }
  10961. ;(e.__resize_handle = document.createElement('div')),
  10962. f.extend(e.__resize_handle.style, {
  10963. width: '6px',
  10964. marginLeft: '-3px',
  10965. height: '200px',
  10966. cursor: 'ew-resize',
  10967. position: 'absolute'
  10968. })
  10969. var r
  10970. p.bind(e.__resize_handle, 'mousedown', t), p.bind(e.__closeButton, 'mousedown', t), e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  10971. }
  10972. function E(e, t) {
  10973. ;(e.domElement.style.width = t + 'px'), e.__save_row && e.autoPlace && (e.__save_row.style.width = t + 'px'), e.__closeButton && (e.__closeButton.style.width = t + 'px')
  10974. }
  10975. function b(e, t) {
  10976. var i = {}
  10977. return (
  10978. f.each(e.__rememberedObjects, function (n, r) {
  10979. var o = {},
  10980. a = e.__rememberedObjectIndecesToControllers[r]
  10981. f.each(a, function (e, i) {
  10982. o[i] = t ? e.initialValue : e.getValue()
  10983. }),
  10984. (i[r] = o)
  10985. }),
  10986. i
  10987. )
  10988. }
  10989. function w(e, t, i) {
  10990. var n = document.createElement('option')
  10991. ;(n.innerHTML = t), (n.value = t), e.__preset_select.appendChild(n), i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10992. }
  10993. function _(e) {
  10994. for (var t = 0; t < e.__preset_select.length; t++) e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10995. }
  10996. function T(e, t) {
  10997. var i = e.__preset_select[e.__preset_select.selectedIndex]
  10998. t ? (i.innerHTML = i.value + '*') : (i.innerHTML = i.value)
  10999. }
  11000. function x(e) {
  11001. 0 != e.length &&
  11002. u(function () {
  11003. x(e)
  11004. }),
  11005. f.each(e, function (e) {
  11006. e.updateDisplay()
  11007. })
  11008. }
  11009. e.inject(i)
  11010. var S,
  11011. M,
  11012. R = 'dg',
  11013. P = 72,
  11014. O = 20,
  11015. L = 'Default',
  11016. D = (function () {
  11017. try {
  11018. return 'localStorage' in window && null !== window.localStorage
  11019. } catch (e) {
  11020. return !1
  11021. }
  11022. })(),
  11023. N = !0,
  11024. B = !1,
  11025. F = [],
  11026. V = function (e) {
  11027. function t() {
  11028. var e = i.getRoot()
  11029. ;(e.width += 1),
  11030. f.defer(function () {
  11031. e.width -= 1
  11032. })
  11033. }
  11034. var i = this
  11035. ;(this.domElement = document.createElement('div')),
  11036. (this.__ul = document.createElement('ul')),
  11037. this.domElement.appendChild(this.__ul),
  11038. p.addClass(this.domElement, R),
  11039. (this.__folders = {}),
  11040. (this.__controllers = []),
  11041. (this.__rememberedObjects = []),
  11042. (this.__rememberedObjectIndecesToControllers = []),
  11043. (this.__listening = []),
  11044. (e = e || {}),
  11045. (e = f.defaults(e, {
  11046. autoPlace: !0,
  11047. width: V.DEFAULT_WIDTH
  11048. })),
  11049. (e = f.defaults(e, {
  11050. resizable: e.autoPlace,
  11051. hideable: e.autoPlace
  11052. })),
  11053. f.isUndefined(e.load)
  11054. ? (e.load = {
  11055. preset: L
  11056. })
  11057. : e.preset && (e.load.preset = e.preset),
  11058. f.isUndefined(e.parent) && e.hideable && F.push(this),
  11059. (e.resizable = f.isUndefined(e.parent) && e.resizable),
  11060. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0)
  11061. var n,
  11062. r = D && 'true' === localStorage.getItem(y(this, 'isLocal'))
  11063. if (
  11064. (Object.defineProperties(this, {
  11065. parent: {
  11066. get: function () {
  11067. return e.parent
  11068. }
  11069. },
  11070. scrollable: {
  11071. get: function () {
  11072. return e.scrollable
  11073. }
  11074. },
  11075. autoPlace: {
  11076. get: function () {
  11077. return e.autoPlace
  11078. }
  11079. },
  11080. preset: {
  11081. get: function () {
  11082. return i.parent ? i.getRoot().preset : e.load.preset
  11083. },
  11084. set: function (t) {
  11085. i.parent ? (i.getRoot().preset = t) : (e.load.preset = t), _(this), i.revert()
  11086. }
  11087. },
  11088. width: {
  11089. get: function () {
  11090. return e.width
  11091. },
  11092. set: function (t) {
  11093. ;(e.width = t), E(i, t)
  11094. }
  11095. },
  11096. name: {
  11097. get: function () {
  11098. return e.name
  11099. },
  11100. set: function (t) {
  11101. ;(e.name = t), a && (a.innerHTML = e.name)
  11102. }
  11103. },
  11104. closed: {
  11105. get: function () {
  11106. return e.closed
  11107. },
  11108. set: function (t) {
  11109. ;(e.closed = t),
  11110. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  11111. this.onResize(),
  11112. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  11113. }
  11114. },
  11115. load: {
  11116. get: function () {
  11117. return e.load
  11118. }
  11119. },
  11120. useLocalStorage: {
  11121. get: function () {
  11122. return r
  11123. },
  11124. set: function (e) {
  11125. D && ((r = e), e ? p.bind(window, 'unload', n) : p.unbind(window, 'unload', n), localStorage.setItem(y(i, 'isLocal'), e))
  11126. }
  11127. }
  11128. }),
  11129. f.isUndefined(e.parent))
  11130. ) {
  11131. if (((e.closed = !1), p.addClass(this.domElement, V.CLASS_MAIN), p.makeSelectable(this.domElement, !1), D && r)) {
  11132. i.useLocalStorage = !0
  11133. var o = localStorage.getItem(y(this, 'gui'))
  11134. o && (e.load = JSON.parse(o))
  11135. }
  11136. ;(this.__closeButton = document.createElement('div')),
  11137. (this.__closeButton.innerHTML = V.TEXT_CLOSED),
  11138. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  11139. this.domElement.appendChild(this.__closeButton),
  11140. p.bind(this.__closeButton, 'click', function () {
  11141. i.closed = !i.closed
  11142. })
  11143. } else {
  11144. void 0 === e.closed && (e.closed = !0)
  11145. var a = document.createTextNode(e.name)
  11146. p.addClass(a, 'controller-name')
  11147. var s = m(i, a),
  11148. l = function (e) {
  11149. return e.preventDefault(), (i.closed = !i.closed), !1
  11150. }
  11151. p.addClass(this.__ul, V.CLASS_CLOSED), p.addClass(s, 'title'), p.bind(s, 'click', l), e.closed || (this.closed = !1)
  11152. }
  11153. e.autoPlace &&
  11154. (f.isUndefined(e.parent) &&
  11155. (N && ((M = document.createElement('div')), p.addClass(M, R), p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER), document.body.appendChild(M), (N = !1)),
  11156. M.appendChild(this.domElement),
  11157. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  11158. this.parent || E(i, e.width)),
  11159. p.bind(window, 'resize', function () {
  11160. i.onResize()
  11161. }),
  11162. p.bind(this.__ul, 'webkitTransitionEnd', function () {
  11163. i.onResize()
  11164. }),
  11165. p.bind(this.__ul, 'transitionend', function () {
  11166. i.onResize()
  11167. }),
  11168. p.bind(this.__ul, 'oTransitionEnd', function () {
  11169. i.onResize()
  11170. }),
  11171. this.onResize(),
  11172. e.resizable && I(this),
  11173. (n = function () {
  11174. D && 'true' === localStorage.getItem(y(i, 'isLocal')) && localStorage.setItem(y(i, 'gui'), JSON.stringify(i.getSaveObject()))
  11175. }),
  11176. (this.saveToLocalStorageIfPossible = n)
  11177. i.getRoot()
  11178. e.parent || t()
  11179. }
  11180. return (
  11181. (V.toggleHide = function () {
  11182. ;(B = !B),
  11183. f.each(F, function (e) {
  11184. ;(e.domElement.style.zIndex = B ? -999 : 999), (e.domElement.style.opacity = B ? 0 : 1)
  11185. })
  11186. }),
  11187. (V.CLASS_AUTO_PLACE = 'a'),
  11188. (V.CLASS_AUTO_PLACE_CONTAINER = 'ac'),
  11189. (V.CLASS_MAIN = 'main'),
  11190. (V.CLASS_CONTROLLER_ROW = 'cr'),
  11191. (V.CLASS_TOO_TALL = 'taller-than-window'),
  11192. (V.CLASS_CLOSED = 'closed'),
  11193. (V.CLASS_CLOSE_BUTTON = 'close-button'),
  11194. (V.CLASS_DRAG = 'drag'),
  11195. (V.DEFAULT_WIDTH = 245),
  11196. (V.TEXT_CLOSED = 'Close Controls'),
  11197. (V.TEXT_OPEN = 'Open Controls'),
  11198. p.bind(
  11199. window,
  11200. 'keydown',
  11201. function (e) {
  11202. 'text' === document.activeElement.type || (e.which !== P && e.keyCode != P) || V.toggleHide()
  11203. },
  11204. !1
  11205. ),
  11206. f.extend(V.prototype, {
  11207. add: function (e, t) {
  11208. return g(this, e, t, {
  11209. factoryArgs: Array.prototype.slice.call(arguments, 2)
  11210. })
  11211. },
  11212. addColor: function (e, t) {
  11213. return g(this, e, t, {
  11214. color: !0
  11215. })
  11216. },
  11217. remove: function (e) {
  11218. this.__ul.removeChild(e.__li), this.__controllers.slice(this.__controllers.indexOf(e), 1)
  11219. var t = this
  11220. f.defer(function () {
  11221. t.onResize()
  11222. })
  11223. },
  11224. destroy: function () {
  11225. this.autoPlace && M.removeChild(this.domElement)
  11226. },
  11227. addFolder: function (e) {
  11228. if (void 0 !== this.__folders[e]) throw new Error('You already have a folder in this GUI by the name "' + e + '"')
  11229. var t = {
  11230. name: e,
  11231. parent: this
  11232. }
  11233. ;(t.autoPlace = this.autoPlace), this.load && this.load.folders && this.load.folders[e] && ((t.closed = this.load.folders[e].closed), (t.load = this.load.folders[e]))
  11234. var i = new V(t)
  11235. this.__folders[e] = i
  11236. var n = m(this, i.domElement)
  11237. return p.addClass(n, 'folder'), i
  11238. },
  11239. open: function () {
  11240. this.closed = !1
  11241. },
  11242. close: function () {
  11243. this.closed = !0
  11244. },
  11245. onResize: function () {
  11246. var e = this.getRoot()
  11247. if (e.scrollable) {
  11248. var t = p.getOffset(e.__ul).top,
  11249. i = 0
  11250. f.each(e.__ul.childNodes, function (t) {
  11251. ;(e.autoPlace && t === e.__save_row) || (i += p.getHeight(t))
  11252. }),
  11253. $('#player').height() - t - O < i
  11254. ? (p.addClass(e.domElement, V.CLASS_TOO_TALL), (e.__ul.style.height = $('#player').height() - t - O + 'px'))
  11255. : (p.removeClass(e.domElement, V.CLASS_TOO_TALL), (e.__ul.style.height = 'auto'))
  11256. }
  11257. e.__resize_handle &&
  11258. f.defer(function () {
  11259. e.__resize_handle.style.height = e.__ul.offsetHeight + 'px'
  11260. }),
  11261. e.__closeButton && (e.__closeButton.style.width = e.width + 'px')
  11262. },
  11263. remember: function () {
  11264. if ((f.isUndefined(S) && ((S = new d()), (S.domElement.innerHTML = t)), this.parent)) throw new Error('You can only call remember on a top level GUI.')
  11265. var e = this
  11266. f.each(Array.prototype.slice.call(arguments), function (t) {
  11267. 0 == e.__rememberedObjects.length && C(e), e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  11268. }),
  11269. this.autoPlace && E(this, this.width)
  11270. },
  11271. getRoot: function () {
  11272. for (var e = this; e.parent; ) e = e.parent
  11273. return e
  11274. },
  11275. getSaveObject: function () {
  11276. var e = this.load
  11277. return (
  11278. (e.closed = this.closed),
  11279. this.__rememberedObjects.length > 0 && ((e.preset = this.preset), e.remembered || (e.remembered = {}), (e.remembered[this.preset] = b(this))),
  11280. (e.folders = {}),
  11281. f.each(this.__folders, function (t, i) {
  11282. e.folders[i] = t.getSaveObject()
  11283. }),
  11284. e
  11285. )
  11286. },
  11287. save: function () {
  11288. this.load.remembered || (this.load.remembered = {}), (this.load.remembered[this.preset] = b(this)), T(this, !1), this.saveToLocalStorageIfPossible()
  11289. },
  11290. saveAs: function (e) {
  11291. this.load.remembered || ((this.load.remembered = {}), (this.load.remembered[L] = b(this, !0))),
  11292. (this.load.remembered[e] = b(this)),
  11293. (this.preset = e),
  11294. w(this, e, !0),
  11295. this.saveToLocalStorageIfPossible()
  11296. },
  11297. revert: function (e) {
  11298. f.each(
  11299. this.__controllers,
  11300. function (t) {
  11301. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  11302. },
  11303. this
  11304. ),
  11305. f.each(this.__folders, function (e) {
  11306. e.revert(e)
  11307. }),
  11308. e || T(this.getRoot(), !1)
  11309. },
  11310. listen: function (e) {
  11311. var t = 0 == this.__listening.length
  11312. this.__listening.push(e), t && x(this.__listening)
  11313. }
  11314. }),
  11315. V
  11316. )
  11317. })(
  11318. n.utils.css,
  11319. '<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>',
  11320. ".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",
  11321. (n.controllers.factory = (function (e, t, i, n, r, o, a) {
  11322. return function (s, l) {
  11323. var c = s[l]
  11324. return a.isArray(arguments[2]) || a.isObject(arguments[2])
  11325. ? new e(s, l, arguments[2])
  11326. : a.isNumber(c)
  11327. ? a.isNumber(arguments[2]) && a.isNumber(arguments[3])
  11328. ? new i(s, l, arguments[2], arguments[3])
  11329. : new t(s, l, {
  11330. min: arguments[2],
  11331. max: arguments[3]
  11332. })
  11333. : a.isString(c)
  11334. ? new n(s, l)
  11335. : a.isFunction(c)
  11336. ? new r(s, l, '')
  11337. : a.isBoolean(c)
  11338. ? new o(s, l)
  11339. : void 0
  11340. }
  11341. })(
  11342. n.controllers.OptionController,
  11343. n.controllers.NumberControllerBox,
  11344. n.controllers.NumberControllerSlider,
  11345. (n.controllers.StringController = (function (e, t, i) {
  11346. var n = function (e, i) {
  11347. function r() {
  11348. a.setValue(a.__input.value)
  11349. }
  11350. function o() {
  11351. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  11352. }
  11353. n.superclass.call(this, e, i)
  11354. var a = this
  11355. ;(this.__input = document.createElement('input')),
  11356. this.__input.setAttribute('type', 'text'),
  11357. t.bind(this.__input, 'keyup', r),
  11358. t.bind(this.__input, 'change', r),
  11359. t.bind(this.__input, 'blur', o),
  11360. t.bind(this.__input, 'keydown', function (e) {
  11361. 13 === e.keyCode && this.blur()
  11362. }),
  11363. this.updateDisplay(),
  11364. this.domElement.appendChild(this.__input)
  11365. }
  11366. return (
  11367. (n.superclass = e),
  11368. i.extend(n.prototype, e.prototype, {
  11369. updateDisplay: function () {
  11370. return t.isActive(this.__input) || (this.__input.value = this.getValue()), n.superclass.prototype.updateDisplay.call(this)
  11371. }
  11372. }),
  11373. n
  11374. )
  11375. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  11376. n.controllers.FunctionController,
  11377. n.controllers.BooleanController,
  11378. n.utils.common
  11379. )),
  11380. n.controllers.Controller,
  11381. n.controllers.BooleanController,
  11382. n.controllers.FunctionController,
  11383. n.controllers.NumberControllerBox,
  11384. n.controllers.NumberControllerSlider,
  11385. n.controllers.OptionController,
  11386. (n.controllers.ColorController = (function (e, t, i, n, r) {
  11387. function o(e, t, i, n) {
  11388. ;(e.style.background = ''),
  11389. r.each(l, function (r) {
  11390. e.style.cssText += 'background: ' + r + 'linear-gradient(' + t + ', ' + i + ' 0%, ' + n + ' 100%); '
  11391. })
  11392. }
  11393. function a(e) {
  11394. ;(e.style.background = ''),
  11395. (e.style.cssText += 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);'),
  11396. (e.style.cssText += 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  11397. (e.style.cssText += 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  11398. (e.style.cssText += 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  11399. (e.style.cssText += 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);')
  11400. }
  11401. var s = function (e, l) {
  11402. function c(e) {
  11403. p(e), t.bind(window, 'mousemove', p), t.bind(window, 'mouseup', h)
  11404. }
  11405. function h() {
  11406. t.unbind(window, 'mousemove', p), t.unbind(window, 'mouseup', h)
  11407. }
  11408. function u() {
  11409. var e = n(this.value)
  11410. e !== !1 ? ((g.__color.__state = e), g.setValue(g.__color.toOriginal())) : (this.value = g.__color.toString())
  11411. }
  11412. function d() {
  11413. t.unbind(window, 'mousemove', f), t.unbind(window, 'mouseup', d)
  11414. }
  11415. function p(e) {
  11416. e.preventDefault()
  11417. var i = t.getWidth(g.__saturation_field),
  11418. n = t.getOffset(g.__saturation_field),
  11419. r = (e.clientX - n.left + document.body.scrollLeft) / i,
  11420. o = 1 - (e.clientY - n.top + document.body.scrollTop) / i
  11421. return o > 1 ? (o = 1) : o < 0 && (o = 0), r > 1 ? (r = 1) : r < 0 && (r = 0), (g.__color.v = o), (g.__color.s = r), g.setValue(g.__color.toOriginal()), !1
  11422. }
  11423. function f(e) {
  11424. e.preventDefault()
  11425. var i = t.getHeight(g.__hue_field),
  11426. n = t.getOffset(g.__hue_field),
  11427. r = 1 - (e.clientY - n.top + document.body.scrollTop) / i
  11428. return r > 1 ? (r = 1) : r < 0 && (r = 0), (g.__color.h = 360 * r), g.setValue(g.__color.toOriginal()), !1
  11429. }
  11430. s.superclass.call(this, e, l), (this.__color = new i(this.getValue())), (this.__temp = new i(0))
  11431. var g = this
  11432. ;(this.domElement = document.createElement('div')),
  11433. t.makeSelectable(this.domElement, !1),
  11434. (this.__selector = document.createElement('div')),
  11435. (this.__selector.className = 'selector'),
  11436. (this.__saturation_field = document.createElement('div')),
  11437. (this.__saturation_field.className = 'saturation-field'),
  11438. (this.__field_knob = document.createElement('div')),
  11439. (this.__field_knob.className = 'field-knob'),
  11440. (this.__field_knob_border = '2px solid '),
  11441. (this.__hue_knob = document.createElement('div')),
  11442. (this.__hue_knob.className = 'hue-knob'),
  11443. (this.__hue_field = document.createElement('div')),
  11444. (this.__hue_field.className = 'hue-field'),
  11445. (this.__input = document.createElement('input')),
  11446. (this.__input.type = 'text'),
  11447. (this.__input_textShadow = '0 1px 1px '),
  11448. t.bind(this.__input, 'keydown', function (e) {
  11449. 13 === e.keyCode && u.call(this)
  11450. }),
  11451. t.bind(this.__input, 'blur', u),
  11452. t.bind(this.__selector, 'mousedown', function (e) {
  11453. t.addClass(this, 'drag').bind(window, 'mouseup', function (e) {
  11454. t.removeClass(g.__selector, 'drag')
  11455. })
  11456. })
  11457. var m = document.createElement('div')
  11458. r.extend(this.__selector.style, {
  11459. width: '122px',
  11460. height: '102px',
  11461. padding: '3px',
  11462. backgroundColor: '#222',
  11463. boxShadow: '0px 1px 3px rgba(0,0,0,0.3)'
  11464. }),
  11465. r.extend(this.__field_knob.style, {
  11466. position: 'absolute',
  11467. width: '12px',
  11468. height: '12px',
  11469. border: this.__field_knob_border + (this.__color.v < 0.5 ? '#fff' : '#000'),
  11470. boxShadow: '0px 1px 3px rgba(0,0,0,0.5)',
  11471. borderRadius: '12px',
  11472. zIndex: 1
  11473. }),
  11474. r.extend(this.__hue_knob.style, {
  11475. position: 'absolute',
  11476. width: '15px',
  11477. height: '2px',
  11478. borderRight: '4px solid #fff',
  11479. zIndex: 1
  11480. }),
  11481. r.extend(this.__saturation_field.style, {
  11482. width: '100px',
  11483. height: '100px',
  11484. border: '1px solid #555',
  11485. marginRight: '3px',
  11486. display: 'inline-block',
  11487. cursor: 'pointer'
  11488. }),
  11489. r.extend(m.style, {
  11490. width: '100%',
  11491. height: '100%',
  11492. background: 'none'
  11493. }),
  11494. o(m, 'top', 'rgba(0,0,0,0)', '#000'),
  11495. r.extend(this.__hue_field.style, {
  11496. width: '15px',
  11497. height: '100px',
  11498. display: 'inline-block',
  11499. border: '1px solid #555',
  11500. cursor: 'ns-resize'
  11501. }),
  11502. a(this.__hue_field),
  11503. r.extend(this.__input.style, {
  11504. outline: 'none',
  11505. textAlign: 'center',
  11506. color: '#fff',
  11507. border: 0,
  11508. fontWeight: 'bold',
  11509. textShadow: this.__input_textShadow + 'rgba(0,0,0,0.7)'
  11510. }),
  11511. t.bind(this.__saturation_field, 'mousedown', c),
  11512. t.bind(this.__field_knob, 'mousedown', c),
  11513. t.bind(this.__hue_field, 'mousedown', function (e) {
  11514. f(e), t.bind(window, 'mousemove', f), t.bind(window, 'mouseup', d)
  11515. }),
  11516. this.__saturation_field.appendChild(m),
  11517. this.__selector.appendChild(this.__field_knob),
  11518. this.__selector.appendChild(this.__saturation_field),
  11519. this.__selector.appendChild(this.__hue_field),
  11520. this.__hue_field.appendChild(this.__hue_knob),
  11521. this.domElement.appendChild(this.__input),
  11522. this.domElement.appendChild(this.__selector),
  11523. this.updateDisplay()
  11524. }
  11525. ;(s.superclass = e),
  11526. r.extend(s.prototype, e.prototype, {
  11527. updateDisplay: function () {
  11528. var e = n(this.getValue())
  11529. if (e !== !1) {
  11530. var t = !1
  11531. r.each(
  11532. i.COMPONENTS,
  11533. function (i) {
  11534. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i]) return (t = !0), {}
  11535. },
  11536. this
  11537. ),
  11538. t && r.extend(this.__color.__state, e)
  11539. }
  11540. r.extend(this.__temp.__state, this.__color.__state), (this.__temp.a = 1)
  11541. var a = this.__color.v < 0.5 || this.__color.s > 0.5 ? 255 : 0,
  11542. s = 255 - a
  11543. r.extend(this.__field_knob.style, {
  11544. marginLeft: 100 * this.__color.s - 7 + 'px',
  11545. marginTop: 100 * (1 - this.__color.v) - 7 + 'px',
  11546. backgroundColor: this.__temp.toString(),
  11547. border: this.__field_knob_border + 'rgb(' + a + ',' + a + ',' + a + ')'
  11548. }),
  11549. (this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + 'px'),
  11550. (this.__temp.s = 1),
  11551. (this.__temp.v = 1),
  11552. o(this.__saturation_field, 'left', '#fff', this.__temp.toString()),
  11553. r.extend(this.__input.style, {
  11554. backgroundColor: (this.__input.value = this.__color.toString()),
  11555. color: 'rgb(' + a + ',' + a + ',' + a + ')',
  11556. textShadow: this.__input_textShadow + 'rgba(' + s + ',' + s + ',' + s + ',.7)'
  11557. })
  11558. }
  11559. })
  11560. var l = ['-moz-', '-o-', '-webkit-', '-ms-', '']
  11561. return s
  11562. })(
  11563. n.controllers.Controller,
  11564. n.dom.dom,
  11565. (n.color.Color = (function (e, t, i, n) {
  11566. function r(e, t, i) {
  11567. Object.defineProperty(e, t, {
  11568. get: function () {
  11569. return 'RGB' === this.__state.space ? this.__state[t] : (a(this, t, i), this.__state[t])
  11570. },
  11571. set: function (e) {
  11572. 'RGB' !== this.__state.space && (a(this, t, i), (this.__state.space = 'RGB')), (this.__state[t] = e)
  11573. }
  11574. })
  11575. }
  11576. function o(e, t) {
  11577. Object.defineProperty(e, t, {
  11578. get: function () {
  11579. return 'HSV' === this.__state.space ? this.__state[t] : (s(this), this.__state[t])
  11580. },
  11581. set: function (e) {
  11582. 'HSV' !== this.__state.space && (s(this), (this.__state.space = 'HSV')), (this.__state[t] = e)
  11583. }
  11584. })
  11585. }
  11586. function a(e, i, r) {
  11587. if ('HEX' === e.__state.space) e.__state[i] = t.component_from_hex(e.__state.hex, r)
  11588. else {
  11589. if ('HSV' !== e.__state.space) throw 'Corrupted color state'
  11590. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11591. }
  11592. }
  11593. function s(e) {
  11594. var i = t.rgb_to_hsv(e.r, e.g, e.b)
  11595. n.extend(e.__state, {
  11596. s: i.s,
  11597. v: i.v
  11598. }),
  11599. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : (e.__state.h = i.h)
  11600. }
  11601. var l = function () {
  11602. if (((this.__state = e.apply(this, arguments)), this.__state === !1)) throw 'Failed to interpret color arguments'
  11603. this.__state.a = this.__state.a || 1
  11604. }
  11605. return (
  11606. (l.COMPONENTS = ['r', 'g', 'b', 'h', 's', 'v', 'hex', 'a']),
  11607. n.extend(l.prototype, {
  11608. toString: function () {
  11609. return i(this)
  11610. },
  11611. toOriginal: function () {
  11612. return this.__state.conversion.write(this)
  11613. }
  11614. }),
  11615. r(l.prototype, 'r', 2),
  11616. r(l.prototype, 'g', 1),
  11617. r(l.prototype, 'b', 0),
  11618. o(l.prototype, 'h'),
  11619. o(l.prototype, 's'),
  11620. o(l.prototype, 'v'),
  11621. Object.defineProperty(l.prototype, 'a', {
  11622. get: function () {
  11623. return this.__state.a
  11624. },
  11625. set: function (e) {
  11626. this.__state.a = e
  11627. }
  11628. }),
  11629. Object.defineProperty(l.prototype, 'hex', {
  11630. get: function () {
  11631. return 'HEX' !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)), this.__state.hex
  11632. },
  11633. set: function (e) {
  11634. ;(this.__state.space = 'HEX'), (this.__state.hex = e)
  11635. }
  11636. }),
  11637. l
  11638. )
  11639. })(
  11640. n.color.interpret,
  11641. (n.color.math = (function () {
  11642. var e
  11643. return {
  11644. hsv_to_rgb: function (e, t, i) {
  11645. var n = Math.floor(e / 60) % 6,
  11646. r = e / 60 - Math.floor(e / 60),
  11647. o = i * (1 - t),
  11648. a = i * (1 - r * t),
  11649. s = i * (1 - (1 - r) * t),
  11650. l = [
  11651. [i, s, o],
  11652. [a, i, o],
  11653. [o, i, s],
  11654. [o, a, i],
  11655. [s, o, i],
  11656. [i, o, a]
  11657. ][n]
  11658. return {
  11659. r: 255 * l[0],
  11660. g: 255 * l[1],
  11661. b: 255 * l[2]
  11662. }
  11663. },
  11664. rgb_to_hsv: function (e, t, i) {
  11665. var n,
  11666. r,
  11667. o = Math.min(e, t, i),
  11668. a = Math.max(e, t, i),
  11669. s = a - o
  11670. return 0 == a
  11671. ? {
  11672. h: NaN,
  11673. s: 0,
  11674. v: 0
  11675. }
  11676. : ((r = s / a),
  11677. (n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s),
  11678. (n /= 6),
  11679. n < 0 && (n += 1),
  11680. {
  11681. h: 360 * n,
  11682. s: r,
  11683. v: a / 255
  11684. })
  11685. },
  11686. rgb_to_hex: function (e, t, i) {
  11687. var n = this.hex_with_component(0, 2, e)
  11688. return (n = this.hex_with_component(n, 1, t)), (n = this.hex_with_component(n, 0, i))
  11689. },
  11690. component_from_hex: function (e, t) {
  11691. return (e >> (8 * t)) & 255
  11692. },
  11693. hex_with_component: function (t, i, n) {
  11694. return (n << (e = 8 * i)) | (t & ~(255 << e))
  11695. }
  11696. }
  11697. })()),
  11698. n.color.toString,
  11699. n.utils.common
  11700. )),
  11701. n.color.interpret,
  11702. n.utils.common
  11703. )),
  11704. (n.utils.requestAnimationFrame = (function () {
  11705. return (
  11706. window.requestAnimationFrame ||
  11707. window.webkitRequestAnimationFrame ||
  11708. window.mozRequestAnimationFrame ||
  11709. window.oRequestAnimationFrame ||
  11710. window.msRequestAnimationFrame ||
  11711. function (e, t) {
  11712. window.setTimeout(e, 1e3 / 60)
  11713. }
  11714. )
  11715. })()),
  11716. (n.dom.CenteredDiv = (function (e, t) {
  11717. var i = function () {
  11718. ;(this.backgroundElement = document.createElement('div')),
  11719. t.extend(this.backgroundElement.style, {
  11720. backgroundColor: 'rgba(0,0,0,0.8)',
  11721. top: 0,
  11722. left: 0,
  11723. display: 'none',
  11724. zIndex: '1000',
  11725. opacity: 0,
  11726. WebkitTransition: 'opacity 0.2s linear'
  11727. }),
  11728. e.makeFullscreen(this.backgroundElement),
  11729. (this.backgroundElement.style.position = 'fixed'),
  11730. (this.domElement = document.createElement('div')),
  11731. t.extend(this.domElement.style, {
  11732. position: 'fixed',
  11733. display: 'none',
  11734. zIndex: '1001',
  11735. opacity: 0,
  11736. WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear'
  11737. }),
  11738. document.body.appendChild(this.backgroundElement),
  11739. document.body.appendChild(this.domElement)
  11740. var i = this
  11741. e.bind(this.backgroundElement, 'click', function () {
  11742. i.hide()
  11743. })
  11744. }
  11745. return (
  11746. (i.prototype.show = function () {
  11747. var e = this
  11748. ;(this.backgroundElement.style.display = 'block'),
  11749. (this.domElement.style.display = 'block'),
  11750. (this.domElement.style.opacity = 0),
  11751. (this.domElement.style.webkitTransform = 'scale(1.1)'),
  11752. this.layout(),
  11753. t.defer(function () {
  11754. ;(e.backgroundElement.style.opacity = 1), (e.domElement.style.opacity = 1), (e.domElement.style.webkitTransform = 'scale(1)')
  11755. })
  11756. }),
  11757. (i.prototype.hide = function () {
  11758. var t = this,
  11759. i = function () {
  11760. ;(t.domElement.style.display = 'none'),
  11761. (t.backgroundElement.style.display = 'none'),
  11762. e.unbind(t.domElement, 'webkitTransitionEnd', i),
  11763. e.unbind(t.domElement, 'transitionend', i),
  11764. e.unbind(t.domElement, 'oTransitionEnd', i)
  11765. }
  11766. e.bind(this.domElement, 'webkitTransitionEnd', i),
  11767. e.bind(this.domElement, 'transitionend', i),
  11768. e.bind(this.domElement, 'oTransitionEnd', i),
  11769. (this.backgroundElement.style.opacity = 0),
  11770. (this.domElement.style.opacity = 0),
  11771. (this.domElement.style.webkitTransform = 'scale(1.1)')
  11772. }),
  11773. (i.prototype.layout = function () {
  11774. ;(this.domElement.style.left = $('#player').width() / 2 - e.getWidth(this.domElement) / 2 + 'px'),
  11775. (this.domElement.style.top = $('#player').height() / 2 - e.getHeight(this.domElement) / 2 + 'px')
  11776. }),
  11777. i
  11778. )
  11779. })(n.dom.dom, n.utils.common)),
  11780. n.dom.dom,
  11781. n.utils.common
  11782. ))
  11783. },
  11784. {}
  11785. ],
  11786. 94: [
  11787. function (e, t, i) {
  11788. ;(function (e) {
  11789. 'use strict'
  11790. function i(t) {
  11791. function i(e) {
  11792. for (
  11793. var t = [
  11794. 16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64,
  11795. 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99
  11796. ],
  11797. i = 0;
  11798. i < 64;
  11799. i++
  11800. ) {
  11801. var n = _((t[i] * e + 50) / 100)
  11802. n < 1 ? (n = 1) : n > 255 && (n = 255), (T[G[i]] = n)
  11803. }
  11804. for (
  11805. var r = [
  11806. 17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
  11807. 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99
  11808. ],
  11809. o = 0;
  11810. o < 64;
  11811. o++
  11812. ) {
  11813. var a = _((r[o] * e + 50) / 100)
  11814. a < 1 ? (a = 1) : a > 255 && (a = 255), (x[G[o]] = a)
  11815. }
  11816. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958, 0.5411961, 0.275899379], l = 0, c = 0; c < 8; c++)
  11817. for (var h = 0; h < 8; h++) (S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8)), (M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8)), l++
  11818. }
  11819. function n(e, t) {
  11820. for (var i = 0, n = 0, r = new Array(), o = 1; o <= 16; o++) {
  11821. for (var a = 1; a <= e[o]; a++) (r[t[n]] = []), (r[t[n]][0] = i), (r[t[n]][1] = o), n++, i++
  11822. i *= 2
  11823. }
  11824. return r
  11825. }
  11826. function r() {
  11827. ;(C = n(z, W)), (I = n(X, Z)), (E = n(j, Y)), (b = n(q, K))
  11828. }
  11829. function o() {
  11830. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11831. for (var n = e; n < t; n++) (P[32767 + n] = i), (R[32767 + n] = []), (R[32767 + n][1] = i), (R[32767 + n][0] = n)
  11832. for (var r = -(t - 1); r <= -e; r++) (P[32767 + r] = i), (R[32767 + r] = []), (R[32767 + r][1] = i), (R[32767 + r][0] = t - 1 + r)
  11833. ;(e <<= 1), (t <<= 1)
  11834. }
  11835. }
  11836. function a() {
  11837. for (var e = 0; e < 256; e++)
  11838. (H[e] = 19595 * e),
  11839. (H[(e + 256) >> 0] = 38470 * e),
  11840. (H[(e + 512) >> 0] = 7471 * e + 32768),
  11841. (H[(e + 768) >> 0] = -11059 * e),
  11842. (H[(e + 1024) >> 0] = -21709 * e),
  11843. (H[(e + 1280) >> 0] = 32768 * e + 8421375),
  11844. (H[(e + 1536) >> 0] = -27439 * e),
  11845. (H[(e + 1792) >> 0] = -5329 * e)
  11846. }
  11847. function s(e) {
  11848. for (var t = e[0], i = e[1] - 1; i >= 0; ) t & (1 << i) && (N |= 1 << B), i--, B--, B < 0 && (255 == N ? (l(255), l(0)) : l(N), (B = 7), (N = 0))
  11849. }
  11850. function l(e) {
  11851. D.push(e)
  11852. }
  11853. function c(e) {
  11854. l((e >> 8) & 255), l(255 & e)
  11855. }
  11856. function h(e, t) {
  11857. var i,
  11858. n,
  11859. r,
  11860. o,
  11861. a,
  11862. s,
  11863. l,
  11864. c,
  11865. h,
  11866. u = 0,
  11867. d = 8,
  11868. p = 64
  11869. for (h = 0; h < d; ++h) {
  11870. ;(i = e[u]), (n = e[u + 1]), (r = e[u + 2]), (o = e[u + 3]), (a = e[u + 4]), (s = e[u + 5]), (l = e[u + 6]), (c = e[u + 7])
  11871. var f = i + c,
  11872. g = i - c,
  11873. m = n + l,
  11874. v = n - l,
  11875. A = r + s,
  11876. y = r - s,
  11877. C = o + a,
  11878. I = o - a,
  11879. E = f + C,
  11880. b = f - C,
  11881. w = m + A,
  11882. _ = m - A
  11883. ;(e[u] = E + w), (e[u + 4] = E - w)
  11884. var T = 0.707106781 * (_ + b)
  11885. ;(e[u + 2] = b + T), (e[u + 6] = b - T), (E = I + y), (w = y + v), (_ = v + g)
  11886. var x = 0.382683433 * (E - _),
  11887. S = 0.5411961 * E + x,
  11888. M = 1.306562965 * _ + x,
  11889. R = 0.707106781 * w,
  11890. P = g + R,
  11891. L = g - R
  11892. ;(e[u + 5] = L + S), (e[u + 3] = L - S), (e[u + 1] = P + M), (e[u + 7] = P - M), (u += 8)
  11893. }
  11894. for (u = 0, h = 0; h < d; ++h) {
  11895. ;(i = e[u]), (n = e[u + 8]), (r = e[u + 16]), (o = e[u + 24]), (a = e[u + 32]), (s = e[u + 40]), (l = e[u + 48]), (c = e[u + 56])
  11896. var D = i + c,
  11897. N = i - c,
  11898. B = n + l,
  11899. F = n - l,
  11900. V = r + s,
  11901. U = r - s,
  11902. k = o + a,
  11903. H = o - a,
  11904. G = D + k,
  11905. z = D - k,
  11906. W = B + V,
  11907. j = B - V
  11908. ;(e[u] = G + W), (e[u + 32] = G - W)
  11909. var Y = 0.707106781 * (j + z)
  11910. ;(e[u + 16] = z + Y), (e[u + 48] = z - Y), (G = H + U), (W = U + F), (j = F + N)
  11911. var X = 0.382683433 * (G - j),
  11912. Z = 0.5411961 * G + X,
  11913. q = 1.306562965 * j + X,
  11914. K = 0.707106781 * W,
  11915. Q = N + K,
  11916. J = N - K
  11917. ;(e[u + 40] = J + Z), (e[u + 24] = J - Z), (e[u + 8] = Q + q), (e[u + 56] = Q - q), u++
  11918. }
  11919. var $
  11920. for (h = 0; h < p; ++h) ($ = e[h] * t[h]), (O[h] = $ > 0 ? ($ + 0.5) | 0 : ($ - 0.5) | 0)
  11921. return O
  11922. }
  11923. function u() {
  11924. c(65504), c(16), l(74), l(70), l(73), l(70), l(0), l(1), l(1), l(0), c(1), c(1), l(0), l(0)
  11925. }
  11926. function d(e, t) {
  11927. c(65472), c(17), l(8), c(t), c(e), l(3), l(1), l(17), l(0), l(2), l(17), l(1), l(3), l(17), l(1)
  11928. }
  11929. function p() {
  11930. c(65499), c(132), l(0)
  11931. for (var e = 0; e < 64; e++) l(T[e])
  11932. l(1)
  11933. for (var t = 0; t < 64; t++) l(x[t])
  11934. }
  11935. function f() {
  11936. c(65476), c(418), l(0)
  11937. for (var e = 0; e < 16; e++) l(z[e + 1])
  11938. for (var t = 0; t <= 11; t++) l(W[t])
  11939. l(16)
  11940. for (var i = 0; i < 16; i++) l(j[i + 1])
  11941. for (var n = 0; n <= 161; n++) l(Y[n])
  11942. l(1)
  11943. for (var r = 0; r < 16; r++) l(X[r + 1])
  11944. for (var o = 0; o <= 11; o++) l(Z[o])
  11945. l(17)
  11946. for (var a = 0; a < 16; a++) l(q[a + 1])
  11947. for (var s = 0; s <= 161; s++) l(K[s])
  11948. }
  11949. function g() {
  11950. c(65498), c(12), l(3), l(1), l(0), l(2), l(17), l(3), l(17), l(0), l(63), l(0)
  11951. }
  11952. function m(e, t, i, n, r) {
  11953. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f) L[G[f]] = p[f]
  11954. var g = L[0] - i
  11955. ;(i = L[0]), 0 == g ? s(n[0]) : ((o = 32767 + g), s(n[P[o]]), s(R[o]))
  11956. for (var m = 63; m > 0 && 0 == L[m]; m--);
  11957. if (0 == m) return s(a), i
  11958. for (var v, A = 1; A <= m; ) {
  11959. for (var y = A; 0 == L[A] && A <= m; ++A);
  11960. var C = A - y
  11961. if (C >= c) {
  11962. v = C >> 4
  11963. for (var I = 1; I <= v; ++I) s(l)
  11964. C &= 15
  11965. }
  11966. ;(o = 32767 + L[A]), s(r[(C << 4) + P[o]]), s(R[o]), A++
  11967. }
  11968. return m != u && s(a), i
  11969. }
  11970. function v() {
  11971. for (var e = String.fromCharCode, t = 0; t < 256; t++) k[t] = e(t)
  11972. }
  11973. function A(e) {
  11974. if ((e <= 0 && (e = 1), e > 100 && (e = 100), w != e)) {
  11975. var t = 0
  11976. ;(t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)), i(t), (w = e)
  11977. }
  11978. }
  11979. function y() {
  11980. var e = new Date().getTime()
  11981. t || (t = 50), v(), r(), o(), a(), A(t)
  11982. new Date().getTime() - e
  11983. }
  11984. var C,
  11985. I,
  11986. E,
  11987. b,
  11988. w,
  11989. _ = (Math.round, Math.floor),
  11990. T = new Array(64),
  11991. x = new Array(64),
  11992. S = new Array(64),
  11993. M = new Array(64),
  11994. R = new Array(65535),
  11995. P = new Array(65535),
  11996. O = new Array(64),
  11997. L = new Array(64),
  11998. D = [],
  11999. N = 0,
  12000. B = 7,
  12001. F = new Array(64),
  12002. V = new Array(64),
  12003. U = new Array(64),
  12004. k = new Array(256),
  12005. H = new Array(2048),
  12006. G = [
  12007. 0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60,
  12008. 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63
  12009. ],
  12010. z = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
  12011. W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
  12012. j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125],
  12013. Y = [
  12014. 1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38,
  12015. 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121,
  12016. 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194,
  12017. 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250
  12018. ],
  12019. X = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
  12020. Z = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
  12021. q = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119],
  12022. K = [
  12023. 0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25,
  12024. 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120,
  12025. 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185,
  12026. 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250
  12027. ]
  12028. ;(this.encode = function (t, i) {
  12029. var n = (new Date().getTime(), i.quality)
  12030. n && A(n), (D = new Array()), (N = 0), (B = 7), c(65496), u(), p(), d(t.width, t.height), f(), g()
  12031. var r = 0,
  12032. o = 0,
  12033. a = 0
  12034. ;(N = 0), (B = 7), (this.encode.displayName = '_encode_')
  12035. for (var l, h, v, y, w, _, T, x, R, P = t.data, O = t.width, L = t.height, k = i.flipY, G = 4 * O, z = k ? L : 0, W = k ? -8 : 8; (k && z > 0) || (!k && z < L); ) {
  12036. for (l = 0; l < G; ) {
  12037. for (w = G * z + l, _ = w, T = -1, x = 0, R = 0; R < 64; R++)
  12038. (x = (k ? 63 - R : R) >> 3),
  12039. (T = 4 * (7 & R)),
  12040. (_ = w + x * G + T),
  12041. z + x >= L && (_ -= G * (z + 1 + x - L)),
  12042. l + T >= G && (_ -= l + T - G + 4),
  12043. (h = P[_++]),
  12044. (v = P[_++]),
  12045. (y = P[_++]),
  12046. (F[R] = ((H[h] + H[(v + 256) >> 0] + H[(y + 512) >> 0]) >> 16) - 128),
  12047. (V[R] = ((H[(h + 768) >> 0] + H[(v + 1024) >> 0] + H[(y + 1280) >> 0]) >> 16) - 128),
  12048. (U[R] = ((H[(h + 1280) >> 0] + H[(v + 1536) >> 0] + H[(y + 1792) >> 0]) >> 16) - 128)
  12049. ;(r = m(F, S, r, C, E)), (o = m(V, M, o, I, b)), (a = m(U, M, a, I, b)), (l += 32)
  12050. }
  12051. z += W
  12052. }
  12053. if (B >= 0) {
  12054. var j = []
  12055. ;(j[1] = B + 1), (j[0] = (1 << (B + 1)) - 1), s(j)
  12056. }
  12057. return c(65497), new e(D)
  12058. }),
  12059. y()
  12060. }
  12061. function n(e, t) {
  12062. ;(t = t || {}), (t.quality = t.quality || 50)
  12063. var n = t.quality,
  12064. r = new i(n),
  12065. o = r.encode(e, t)
  12066. return {
  12067. data: o,
  12068. width: e.width,
  12069. height: e.height
  12070. }
  12071. }
  12072. t.exports.encode = n
  12073. }).call(this, e('buffer').Buffer)
  12074. },
  12075. {
  12076. buffer: 198
  12077. }
  12078. ],
  12079. 95: [
  12080. function (e, t, i) {
  12081. 'use strict'
  12082. !(function () {
  12083. if (
  12084. ('performance' in window == !1 && (window.performance = {}),
  12085. (Date.now =
  12086. Date.now ||
  12087. function () {
  12088. return new Date().getTime()
  12089. }),
  12090. 'now' in window.performance == !1)
  12091. ) {
  12092. var e = Date.now()
  12093. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12094. (window.performance.now = function () {
  12095. return Date.now() - e
  12096. })
  12097. }
  12098. })()
  12099. },
  12100. {}
  12101. ],
  12102. 96: [
  12103. function (e, t, i) {
  12104. 'use strict'
  12105. var n = e('three')
  12106. ;(n.EffectComposer = function (e, t) {
  12107. if (((this.renderer = e), void 0 === t)) {
  12108. var i = {
  12109. minFilter: n.LinearFilter,
  12110. magFilter: n.LinearFilter,
  12111. format: n.RGBAFormat,
  12112. stencilBuffer: !1
  12113. },
  12114. r = e.getSize()
  12115. t = new n.WebGLRenderTarget(r.width, r.height, i)
  12116. }
  12117. ;(this.renderTarget1 = t),
  12118. (this.renderTarget2 = t.clone()),
  12119. (this.writeBuffer = this.renderTarget1),
  12120. (this.readBuffer = this.renderTarget2),
  12121. (this.passes = []),
  12122. void 0 === n.CopyShader && console.error('THREE.EffectComposer relies on THREE.CopyShader'),
  12123. (this.copyPass = new n.ShaderPass(n.CopyShader))
  12124. }),
  12125. (n.EffectComposer.prototype = {
  12126. swapBuffers: function () {
  12127. var e = this.readBuffer
  12128. ;(this.readBuffer = this.writeBuffer), (this.writeBuffer = e)
  12129. },
  12130. addPass: function (e) {
  12131. this.passes.push(e)
  12132. },
  12133. insertPass: function (e, t) {
  12134. this.passes.splice(t, 0, e)
  12135. },
  12136. render: function (e) {
  12137. ;(this.writeBuffer = this.renderTarget1), (this.readBuffer = this.renderTarget2)
  12138. var t,
  12139. i,
  12140. r = !1,
  12141. o = this.passes.length
  12142. for (i = 0; i < o; i++)
  12143. if (((t = this.passes[i]), t.enabled)) {
  12144. if ((t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r), t.needsSwap)) {
  12145. if (r) {
  12146. var a = this.renderer.context
  12147. a.stencilFunc(a.NOTEQUAL, 1, 4294967295), this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e), a.stencilFunc(a.EQUAL, 1, 4294967295)
  12148. }
  12149. this.swapBuffers()
  12150. }
  12151. t instanceof n.MaskPass ? (r = !0) : t instanceof n.ClearMaskPass && (r = !1)
  12152. }
  12153. },
  12154. reset: function (e) {
  12155. if (void 0 === e) {
  12156. var t = this.renderer.getSize()
  12157. ;(e = this.renderTarget1.clone()), e.setSize(t.width, t.height)
  12158. }
  12159. this.renderTarget1.dispose(),
  12160. this.renderTarget2.dispose(),
  12161. (this.renderTarget1 = e),
  12162. (this.renderTarget2 = e.clone()),
  12163. (this.writeBuffer = this.renderTarget1),
  12164. (this.readBuffer = this.renderTarget2)
  12165. },
  12166. setSize: function (e, t) {
  12167. this.renderTarget1.setSize(e, t), this.renderTarget2.setSize(e, t)
  12168. this.passes.forEach(a => {
  12169. //add for TransitionPass
  12170. a.setSize && a.setSize(e, t)
  12171. })
  12172. }
  12173. })
  12174. },
  12175. {
  12176. three: 217
  12177. }
  12178. ],
  12179. 97: [
  12180. function (e, t, i) {
  12181. 'use strict'
  12182. var n = e('three')
  12183. ;(n.MaskPass = function (e, t) {
  12184. ;(this.scene = e), (this.camera = t), (this.enabled = !0), (this.clear = !0), (this.needsSwap = !1), (this.inverse = !1)
  12185. }),
  12186. (n.MaskPass.prototype = {
  12187. render: function (e, t, i, n) {
  12188. var r = e.context
  12189. r.colorMask(!1, !1, !1, !1), r.depthMask(!1)
  12190. var o, a
  12191. this.inverse ? ((o = 0), (a = 1)) : ((o = 1), (a = 0)),
  12192. r.enable(r.STENCIL_TEST),
  12193. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  12194. r.stencilFunc(r.ALWAYS, o, 4294967295),
  12195. r.clearStencil(a),
  12196. e.render(this.scene, this.camera, i, this.clear),
  12197. e.render(this.scene, this.camera, t, this.clear),
  12198. r.colorMask(!0, !0, !0, !0),
  12199. r.depthMask(!0),
  12200. r.stencilFunc(r.EQUAL, 1, 4294967295),
  12201. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  12202. }
  12203. }),
  12204. (n.ClearMaskPass = function () {
  12205. this.enabled = !0
  12206. }),
  12207. (n.ClearMaskPass.prototype = {
  12208. render: function (e, t, i, n) {
  12209. var r = e.context
  12210. r.disable(r.STENCIL_TEST)
  12211. }
  12212. })
  12213. },
  12214. {
  12215. three: 217
  12216. }
  12217. ],
  12218. 98: [
  12219. function (e, t, i) {
  12220. 'use strict'
  12221. var n = e('three')
  12222. ;(n.RenderPass = function (e, t, i, r, o) {
  12223. ;(this.scene = e),
  12224. (this.camera = t),
  12225. (this.overrideMaterial = i),
  12226. (this.clearColor = r),
  12227. (this.clearAlpha = void 0 !== o ? o : 1),
  12228. (this.oldClearColor = new n.Color()),
  12229. (this.oldClearAlpha = 1),
  12230. (this.enabled = !0),
  12231. (this.clear = !0),
  12232. (this.needsSwap = !1)
  12233. }),
  12234. (n.RenderPass.prototype = {
  12235. render: function (e, t, i, n) {
  12236. ;(this.scene.overrideMaterial = this.overrideMaterial),
  12237. this.clearColor && (this.oldClearColor.copy(e.getClearColor()), (this.oldClearAlpha = e.getClearAlpha()), e.setClearColor(this.clearColor, this.clearAlpha)),
  12238. e.render(this.scene, this.camera, i, this.clear),
  12239. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  12240. (this.scene.overrideMaterial = null)
  12241. }
  12242. })
  12243. },
  12244. {
  12245. three: 217
  12246. }
  12247. ],
  12248. 99: [
  12249. function (e, t, i) {
  12250. 'use strict'
  12251. var n = e('three')
  12252. ;(n.ShaderPass = function (e, t) {
  12253. ;(this.textureID = void 0 !== t ? t : 'tDiffuse'),
  12254. e instanceof n.ShaderMaterial
  12255. ? ((this.uniforms = e.uniforms), (this.material = e))
  12256. : e &&
  12257. ((this.uniforms = n.UniformsUtils.clone(e.uniforms)),
  12258. (this.material = new n.ShaderMaterial({
  12259. defines: e.defines || {},
  12260. uniforms: this.uniforms,
  12261. vertexShader: e.vertexShader,
  12262. fragmentShader: e.fragmentShader
  12263. }))),
  12264. (this.renderToScreen = !1),
  12265. (this.enabled = !0),
  12266. (this.needsSwap = !0),
  12267. (this.clear = !1),
  12268. (this.camera = new n.OrthographicCamera(-1, 1, 1, -1, 0, 1)),
  12269. (this.scene = new n.Scene()),
  12270. (this.quad = new n.Mesh(new n.PlaneBufferGeometry(2, 2), null)),
  12271. this.scene.add(this.quad)
  12272. }),
  12273. (n.ShaderPass.prototype = {
  12274. render: function (e, t, i, n) {
  12275. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  12276. (this.quad.material = this.material),
  12277. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  12278. }
  12279. })
  12280. },
  12281. {
  12282. three: 217
  12283. }
  12284. ],
  12285. 100: [
  12286. function (e, t, i) {
  12287. 'use strict'
  12288. var n = e('three')
  12289. n.CopyShader = {
  12290. uniforms: {
  12291. tDiffuse: {
  12292. type: 't',
  12293. value: null
  12294. },
  12295. opacity: {
  12296. type: 'f',
  12297. value: 1
  12298. }
  12299. },
  12300. vertexShader: ['varying vec2 vUv;', 'void main() {', 'vUv = uv;', 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );', '}'].join('\n'),
  12301. fragmentShader: [
  12302. 'uniform float opacity;',
  12303. 'uniform sampler2D tDiffuse;',
  12304. 'varying vec2 vUv;',
  12305. 'void main() {',
  12306. 'vec4 texel = texture2D( tDiffuse, vUv );',
  12307. 'gl_FragColor = opacity * texel;',
  12308. '}'
  12309. ].join('\n')
  12310. }
  12311. },
  12312. {
  12313. three: 217
  12314. }
  12315. ],
  12316. 101: [
  12317. function (e, t, i) {
  12318. 'use strict'
  12319. var n = e('three')
  12320. n.HorizontalBlurShader = {
  12321. uniforms: {
  12322. tDiffuse: {
  12323. type: 't',
  12324. value: null
  12325. },
  12326. h: {
  12327. type: 'f',
  12328. value: 1 / 512
  12329. }
  12330. },
  12331. vertexShader: ['varying vec2 vUv;', 'void main() {', 'vUv = uv;', 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );', '}'].join('\n'),
  12332. fragmentShader: [
  12333. 'uniform sampler2D tDiffuse;',
  12334. 'uniform float h;',
  12335. 'varying vec2 vUv;',
  12336. 'void main() {',
  12337. 'vec4 sum = vec4( 0.0 );',
  12338. 'sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;',
  12339. 'sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;',
  12340. 'sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;',
  12341. 'sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;',
  12342. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;',
  12343. 'sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;',
  12344. 'sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;',
  12345. 'sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;',
  12346. 'sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;',
  12347. 'gl_FragColor = sum;',
  12348. '}'
  12349. ].join('\n')
  12350. }
  12351. },
  12352. {
  12353. three: 217
  12354. }
  12355. ],
  12356. 102: [
  12357. function (e, t, i) {
  12358. 'use strict'
  12359. var n = e('three')
  12360. n.VerticalBlurShader = {
  12361. uniforms: {
  12362. tDiffuse: {
  12363. type: 't',
  12364. value: null
  12365. },
  12366. v: {
  12367. type: 'f',
  12368. value: 1 / 512
  12369. }
  12370. },
  12371. vertexShader: ['varying vec2 vUv;', 'void main() {', 'vUv = uv;', 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );', '}'].join('\n'),
  12372. fragmentShader: [
  12373. 'uniform sampler2D tDiffuse;',
  12374. 'uniform float v;',
  12375. 'varying vec2 vUv;',
  12376. 'void main() {',
  12377. 'vec4 sum = vec4( 0.0 );',
  12378. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;',
  12379. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;',
  12380. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;',
  12381. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;',
  12382. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;',
  12383. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;',
  12384. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;',
  12385. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;',
  12386. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;',
  12387. 'gl_FragColor = sum;',
  12388. '}'
  12389. ].join('\n')
  12390. }
  12391. },
  12392. {
  12393. three: 217
  12394. }
  12395. ],
  12396. 103: [
  12397. function (e, t, i) {
  12398. 'use strict'
  12399. var n = e('three')
  12400. !(function () {
  12401. if (('performance' in window == 0 && (window.performance = {}), 'now' in window.performance == 0)) {
  12402. var e = Date.now()
  12403. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12404. (window.performance.now = function () {
  12405. return Date.now() - e
  12406. })
  12407. }
  12408. })(),
  12409. (n.WebGLRenderer.prototype.paramThreeToGL = function (e) {
  12410. var t,
  12411. i = this.extensions,
  12412. r = this.context
  12413. if (e === n.RepeatWrapping) return r.REPEAT
  12414. if (e === n.ClampToEdgeWrapping) return r.CLAMP_TO_EDGE
  12415. if (e === n.MirroredRepeatWrapping) return r.MIRRORED_REPEAT
  12416. if (e === n.NearestFilter) return r.NEAREST
  12417. if (e === n.NearestMipMapNearestFilter) return r.NEAREST_MIPMAP_NEAREST
  12418. if (e === n.NearestMipMapLinearFilter) return r.NEAREST_MIPMAP_LINEAR
  12419. if (e === n.LinearFilter) return r.LINEAR
  12420. if (e === n.LinearMipMapNearestFilter) return r.LINEAR_MIPMAP_NEAREST
  12421. if (e === n.LinearMipMapLinearFilter) return r.LINEAR_MIPMAP_LINEAR
  12422. if (e === n.UnsignedByteType) return r.UNSIGNED_BYTE
  12423. if (e === n.UnsignedShort4444Type) return r.UNSIGNED_SHORT_4_4_4_4
  12424. if (e === n.UnsignedShort5551Type) return r.UNSIGNED_SHORT_5_5_5_1
  12425. if (e === n.UnsignedShort565Type) return r.UNSIGNED_SHORT_5_6_5
  12426. if (e === n.ByteType) return r.BYTE
  12427. if (e === n.ShortType) return r.SHORT
  12428. if (e === n.UnsignedShortType) return r.UNSIGNED_SHORT
  12429. if (e === n.IntType) return r.INT
  12430. if (e === n.UnsignedIntType) return r.UNSIGNED_INT
  12431. if (e === n.FloatType) return r.FLOAT
  12432. if (((t = i.get('OES_texture_half_float')), null !== t && e === n.HalfFloatType)) return t.HALF_FLOAT_OES
  12433. if (e === n.AlphaFormat) return r.ALPHA
  12434. if (e === n.RGBFormat) return r.RGB
  12435. if (e === n.RGBAFormat) return r.RGBA
  12436. if (e === n.LuminanceFormat) return r.LUMINANCE
  12437. if (e === n.LuminanceAlphaFormat) return r.LUMINANCE_ALPHA
  12438. if (e === n.AddEquation) return r.FUNC_ADD
  12439. if (e === n.SubtractEquation) return r.FUNC_SUBTRACT
  12440. if (e === n.ReverseSubtractEquation) return r.FUNC_REVERSE_SUBTRACT
  12441. if (e === n.ZeroFactor) return r.ZERO
  12442. if (e === n.OneFactor) return r.ONE
  12443. if (e === n.SrcColorFactor) return r.SRC_COLOR
  12444. if (e === n.OneMinusSrcColorFactor) return r.ONE_MINUS_SRC_COLOR
  12445. if (e === n.SrcAlphaFactor) return r.SRC_ALPHA
  12446. if (e === n.OneMinusSrcAlphaFactor) return r.ONE_MINUS_SRC_ALPHA
  12447. if (e === n.DstAlphaFactor) return r.DST_ALPHA
  12448. if (e === n.OneMinusDstAlphaFactor) return r.ONE_MINUS_DST_ALPHA
  12449. if (e === n.DstColorFactor) return r.DST_COLOR
  12450. if (e === n.OneMinusDstColorFactor) return r.ONE_MINUS_DST_COLOR
  12451. if (e === n.SrcAlphaSaturateFactor) return r.SRC_ALPHA_SATURATE
  12452. if (((t = i.get('WEBGL_compressed_texture_s3tc')), null !== t)) {
  12453. if (e === n.RGB_S3TC_DXT1_Format) return t.COMPRESSED_RGB_S3TC_DXT1_EXT
  12454. if (e === n.RGBA_S3TC_DXT1_Format) return t.COMPRESSED_RGBA_S3TC_DXT1_EXT
  12455. if (e === n.RGBA_S3TC_DXT3_Format) return t.COMPRESSED_RGBA_S3TC_DXT3_EXT
  12456. if (e === n.RGBA_S3TC_DXT5_Format) return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12457. }
  12458. if (((t = i.get('WEBGL_compressed_texture_pvrtc')), null !== t)) {
  12459. if (e === n.RGB_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG
  12460. if (e === n.RGB_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG
  12461. if (e === n.RGBA_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
  12462. if (e === n.RGBA_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12463. }
  12464. if (((t = i.get('WEBGL_compressed_texture_etc1')), null !== t && e === n.RGB_ETC1_Format)) return t.COMPRESSED_RGB_ETC1_WEBGL
  12465. if (((t = i.get('EXT_blend_minmax')), null !== t)) {
  12466. if (e === n.MinEquation) return t.MIN_EXT
  12467. if (e === n.MaxEquation) return t.MAX_EXT
  12468. }
  12469. return 0
  12470. }),
  12471. (n.WebGLState = function (e, t, i) {
  12472. var r = this,
  12473. o = new n.Vector4(),
  12474. a = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  12475. s = new Uint8Array(a),
  12476. l = new Uint8Array(a),
  12477. c = new Uint8Array(a),
  12478. h = {},
  12479. u = null,
  12480. d = null,
  12481. p = null,
  12482. f = null,
  12483. g = null,
  12484. m = null,
  12485. v = null,
  12486. A = null,
  12487. y = !1,
  12488. C = null,
  12489. I = null,
  12490. E = null,
  12491. b = null,
  12492. w = null,
  12493. _ = null,
  12494. T = null,
  12495. x = null,
  12496. S = null,
  12497. M = null,
  12498. R = null,
  12499. P = null,
  12500. O = null,
  12501. L = null,
  12502. D = null,
  12503. N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  12504. B = void 0,
  12505. F = {},
  12506. V = new n.Vector4(),
  12507. U = null,
  12508. k = null,
  12509. H = new n.Vector4(),
  12510. G = new n.Vector4()
  12511. ;(this.init = function () {
  12512. this.clearColor(0, 0, 0, 1),
  12513. this.clearDepth(1),
  12514. this.clearStencil(0),
  12515. this.enable(e.DEPTH_TEST),
  12516. e.depthFunc(e.LEQUAL),
  12517. e.frontFace(e.CCW),
  12518. e.cullFace(e.BACK),
  12519. this.enable(e.CULL_FACE),
  12520. this.enable(e.BLEND),
  12521. e.blendEquation(e.FUNC_ADD),
  12522. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12523. }),
  12524. (this.initAttributes = function () {
  12525. for (var e = 0, t = s.length; e < t; e++) s[e] = 0
  12526. }),
  12527. (this.enableAttribute = function (i) {
  12528. if (((s[i] = 1), 0 === l[i] && (e.enableVertexAttribArray(i), (l[i] = 1)), 0 !== c[i])) {
  12529. var n = t.get('ANGLE_instanced_arrays')
  12530. n.vertexAttribDivisorANGLE(i, 0), (c[i] = 0)
  12531. }
  12532. }),
  12533. (this.enableAttributeAndDivisor = function (t, i, n) {
  12534. ;(s[t] = 1), 0 === l[t] && (e.enableVertexAttribArray(t), (l[t] = 1)), c[t] !== i && (n.vertexAttribDivisorANGLE(t, i), (c[t] = i))
  12535. }),
  12536. (this.disableUnusedAttributes = function () {
  12537. for (var t = 0, i = l.length; t < i; t++) l[t] !== s[t] && (e.disableVertexAttribArray(t), (l[t] = 0))
  12538. }),
  12539. (this.enable = function (t) {
  12540. h[t] !== !0 && (e.enable(t), (h[t] = !0))
  12541. }),
  12542. (this.disable = function (t) {
  12543. h[t] !== !1 && (e.disable(t), (h[t] = !1))
  12544. }),
  12545. (this.getCompressedTextureFormats = function () {
  12546. if (null === u && ((u = []), t.get('WEBGL_compressed_texture_pvrtc') || t.get('WEBGL_compressed_texture_s3tc') || t.get('WEBGL_compressed_texture_etc1')))
  12547. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++) u.push(i[n])
  12548. return u
  12549. }),
  12550. (this.setBlending = function (t, r, o, a, s, l, c, h) {
  12551. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12552. (t === d && h === y) ||
  12553. (t === n.AdditiveBlending
  12554. ? h
  12555. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD), e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE))
  12556. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.SRC_ALPHA, e.ONE))
  12557. : t === n.SubtractiveBlending
  12558. ? h
  12559. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD), e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA))
  12560. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR))
  12561. : t === n.MultiplyBlending
  12562. ? h
  12563. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD), e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA))
  12564. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.SRC_COLOR))
  12565. : h
  12566. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD), e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA))
  12567. : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD), e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12568. (d = t),
  12569. (y = h)),
  12570. t === n.CustomBlending
  12571. ? ((s = s || r),
  12572. (l = l || o),
  12573. (c = c || a),
  12574. (r === p && s === m) || (e.blendEquationSeparate(i(r), i(s)), (p = r), (m = s)),
  12575. (o === f && a === g && l === v && c === A) || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)), (f = o), (g = a), (v = l), (A = c)))
  12576. : ((p = null), (f = null), (g = null), (m = null), (v = null), (A = null))
  12577. }),
  12578. (this.setDepthFunc = function (t) {
  12579. if (C !== t) {
  12580. if (t)
  12581. switch (t) {
  12582. case n.NeverDepth:
  12583. e.depthFunc(e.NEVER)
  12584. break
  12585. case n.AlwaysDepth:
  12586. e.depthFunc(e.ALWAYS)
  12587. break
  12588. case n.LessDepth:
  12589. e.depthFunc(e.LESS)
  12590. break
  12591. case n.LessEqualDepth:
  12592. e.depthFunc(e.LEQUAL)
  12593. break
  12594. case n.EqualDepth:
  12595. e.depthFunc(e.EQUAL)
  12596. break
  12597. case n.GreaterEqualDepth:
  12598. e.depthFunc(e.GEQUAL)
  12599. break
  12600. case n.GreaterDepth:
  12601. e.depthFunc(e.GREATER)
  12602. break
  12603. case n.NotEqualDepth:
  12604. e.depthFunc(e.NOTEQUAL)
  12605. break
  12606. default:
  12607. e.depthFunc(e.LEQUAL)
  12608. }
  12609. else e.depthFunc(e.LEQUAL)
  12610. C = t
  12611. }
  12612. }),
  12613. (this.setDepthTest = function (t) {
  12614. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12615. }),
  12616. (this.setDepthWrite = function (t) {
  12617. I !== t && (e.depthMask(t), (I = t))
  12618. }),
  12619. (this.setColorWrite = function (t) {
  12620. E !== t && (e.colorMask(t, t, t, t), (E = t))
  12621. }),
  12622. (this.setStencilFunc = function (t, i, n) {
  12623. ;(w === t && _ === i && T === n) || (e.stencilFunc(t, i, n), (w = t), (_ = i), (T = n))
  12624. }),
  12625. (this.setStencilOp = function (t, i, n) {
  12626. ;(x === t && S === i && M === n) || (e.stencilOp(t, i, n), (x = t), (S = i), (M = n))
  12627. }),
  12628. (this.setStencilTest = function (t) {
  12629. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12630. }),
  12631. (this.setStencilWrite = function (t) {
  12632. b !== t && (e.stencilMask(t), (b = t))
  12633. }),
  12634. (this.setFlipSided = function (t) {
  12635. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), (R = t))
  12636. }),
  12637. (this.setLineWidth = function (t) {
  12638. t !== P && (e.lineWidth(t), (P = t))
  12639. }),
  12640. (this.setPolygonOffset = function (t, i, n) {
  12641. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL), !t || (O === i && L === n) || (e.polygonOffset(i, n), (O = i), (L = n))
  12642. }),
  12643. (this.getScissorTest = function () {
  12644. return D
  12645. }),
  12646. (this.setScissorTest = function (t) {
  12647. ;(D = t), t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12648. }),
  12649. (this.activeTexture = function (t) {
  12650. void 0 === t && (t = e.TEXTURE0 + N - 1), B !== t && (e.activeTexture(t), (B = t))
  12651. }),
  12652. (this.bindTexture = function (t, i) {
  12653. void 0 === B && r.activeTexture()
  12654. var n = F[B]
  12655. void 0 === n &&
  12656. ((n = {
  12657. type: void 0,
  12658. texture: void 0
  12659. }),
  12660. (F[B] = n)),
  12661. (n.type === t && n.texture === i) || (e.bindTexture(t, i), (n.type = t), (n.texture = i))
  12662. }),
  12663. (this.compressedTexImage2D = function () {
  12664. try {
  12665. e.compressedTexImage2D.apply(e, arguments)
  12666. } catch (e) {
  12667. console.error(e)
  12668. }
  12669. }),
  12670. (this.texImage2D = function () {
  12671. try {
  12672. e.texImage2D.apply(e, arguments)
  12673. } catch (e) {
  12674. console.error(e)
  12675. }
  12676. }),
  12677. (this.clearColor = function (t, i, n, r) {
  12678. o.set(t, i, n, r), V.equals(o) === !1 && (e.clearColor(t, i, n, r), V.copy(o))
  12679. }),
  12680. (this.clearDepth = function (t) {
  12681. U !== t && (e.clearDepth(t), (U = t))
  12682. }),
  12683. (this.clearStencil = function (t) {
  12684. k !== t && (e.clearStencil(t), (k = t))
  12685. }),
  12686. (this.scissor = function (t) {
  12687. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), H.copy(t))
  12688. }),
  12689. (this.viewport = function (t) {
  12690. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), G.copy(t))
  12691. }),
  12692. (this.reset = function () {
  12693. for (var t = 0; t < l.length; t++) 1 === l[t] && (e.disableVertexAttribArray(t), (l[t] = 0))
  12694. ;(h = {}), (u = null), (B = void 0), (F = {}), (d = null), (E = null), (I = null), (b = null), (R = null)
  12695. })
  12696. })
  12697. },
  12698. {
  12699. three: 217
  12700. }
  12701. ],
  12702. 104: [
  12703. function (e, t, i) {
  12704. ;(function (i, n) {
  12705. 'use strict'
  12706. function r(e) {
  12707. this.urls = e
  12708. var t = i(
  12709. 'bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==',
  12710. 'base64'
  12711. )
  12712. ;(this.builder = a.loadProto(t)), (this.decoder = this.builder.build('binary_mesh'))
  12713. }
  12714. var o = e('three'),
  12715. a = e('protobufjs'),
  12716. s = e('../util/logger'),
  12717. l = (e('../util/common'), e('../util/ajax')),
  12718. c = e('../objects/Chunk'),
  12719. h = new s(n)
  12720. ;(r.prototype = {
  12721. constructor: r,
  12722. load: function (e, t, i, n) {
  12723. return (
  12724. h.time('download'),
  12725. l
  12726. .get(e, {
  12727. responseType: 'arraybuffer'
  12728. })
  12729. .done(
  12730. function (r) {
  12731. h.timeEnd('download'), this.parse(r, e, t, i, n)
  12732. }.bind(this)
  12733. )
  12734. .fail(n)
  12735. )
  12736. },
  12737. parse: function (e, t, i, n, r) {
  12738. var o = this.readProtobuf(e)
  12739. if (!o) return r()
  12740. try {
  12741. h.time('convert to webgl'), this.convertProtobufToSceneObject(o, t, i, n, r), h.timeEnd('convert to webgl')
  12742. } catch (e) {
  12743. return h.error('failed parsing .dam'), h.error(e.message), r()
  12744. }
  12745. },
  12746. readProtobuf: function (e) {
  12747. var t
  12748. try {
  12749. h.time('parse proto'), (t = this.decoder.decode(e)), h.timeEnd('parse proto')
  12750. } catch (e) {
  12751. return h.error('failed parsing proto for .dam'), h.error(e.message), null
  12752. }
  12753. return t
  12754. },
  12755. convertProtobufToSceneObject: function (e, t, i, n, r) {
  12756. function a(e) {
  12757. var i = new o.BufferGeometry()
  12758. return (
  12759. i.addAttribute('position', new o.BufferAttribute(new Float32Array(e.vertices.xyz, 0, 3), 3)),
  12760. e.vertices.uv.length > 0 && i.addAttribute('uv', new o.BufferAttribute(new Float32Array(e.vertices.uv, 0, 2), 2)),
  12761. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces, 0, 1), 1)),
  12762. i.applyMatrix(s),
  12763. i.computeBoundingBox(),
  12764. new c({
  12765. geometry: i,
  12766. textureName: e.material_name,
  12767. name: e.chunk_name,
  12768. meshUrl: t
  12769. })
  12770. )
  12771. }
  12772. if (0 === e.chunk.length) return h.warn('No chunks in damfile...'), i([])
  12773. var s = new o.Matrix4()
  12774. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1)
  12775. var l = e.chunk.map(a)
  12776. return l ? i(l) : (h.error('.dam protobuf came out with no chunks...'), r())
  12777. }
  12778. }),
  12779. (t.exports = r)
  12780. }).call(this, e('buffer').Buffer, '/js/loaders/DamLoader.js')
  12781. },
  12782. {
  12783. '../objects/Chunk': 144,
  12784. '../util/ajax': 181,
  12785. '../util/common': 185,
  12786. '../util/logger': 189,
  12787. buffer: 198,
  12788. protobufjs: 214,
  12789. three: 217
  12790. }
  12791. ],
  12792. 105: [
  12793. function (e, t, i) {
  12794. ;(function (i) {
  12795. 'use strict'
  12796. var n = (e('three'), e('../settings'), e('../util/browser'), e('./DamLoader')),
  12797. r = e('../util/logger'),
  12798. o = (e('../ab'), new r(i))
  12799. t.exports = {
  12800. getLoaders: function () {
  12801. return [
  12802. ['_50k', '.dam', n],
  12803. ['', '.dam', n]
  12804. ]
  12805. },
  12806. load: function (e, t, i, n, r, a) {
  12807. var s = this.getLoaders()
  12808. a = a || 0
  12809. var l = s[a]
  12810. if (!l) return void (r && r('No suitable model file found...'))
  12811. var c = l[0],
  12812. h = l[1],
  12813. u = new l[2](t),
  12814. d = t.get(e + c + h)
  12815. d
  12816. ? (o.debug('Trying ' + c + h),
  12817. u.load(
  12818. d,
  12819. i,
  12820. n,
  12821. function () {
  12822. this.load(e, t, i, n, r, ++a)
  12823. }.bind(this)
  12824. ))
  12825. : (o.debug('Skipping ' + h + ', not available'), this.load(e, t, i, n, r, ++a))
  12826. }
  12827. }
  12828. }).call(this, '/js/loaders/ModelLoader.js')
  12829. },
  12830. {
  12831. '../ab': 3,
  12832. '../settings': 166,
  12833. '../util/browser': 182,
  12834. '../util/logger': 189,
  12835. './DamLoader': 104,
  12836. three: 217
  12837. }
  12838. ],
  12839. 106: [
  12840. function (e, t, i) {
  12841. ;(function (i) {
  12842. 'use strict'
  12843. var n = e('../util/common'),
  12844. r = e('../util/texture'),
  12845. o = e('../util/browser'),
  12846. a = e('../util/logger'),
  12847. s = e('../settings'),
  12848. l = new a(i)
  12849. t.exports = {
  12850. load: function (e, t) {
  12851. function i(e, i) {
  12852. e || (t.push(i), p++, d.notify(p, a), p === a && d.resolve())
  12853. }
  12854. if (!e.chunks[0] || !e.chunks[0].meshUrl) return $.when()
  12855. var a = n.countUnique(
  12856. e.chunks.map(function (e) {
  12857. return e.textureName
  12858. })
  12859. ),
  12860. c = e.chunks[0].meshUrl.indexOf('_50k') !== -1 ? '_50k' : '',
  12861. h = '_50k' === c ? 'high' : 'low'
  12862. s.minimalMemoryMode &&
  12863. 'high' === h &&
  12864. (o.detectSamsungS6()
  12865. ? (l.warn('Galaxy S6 cannot handle large textures, turning down quality.'), (h = 'low'))
  12866. : a > s.maxMobileTextures && (l.warn('Model probably too large for mobile, turning down quality.'), (h = 'low')))
  12867. //经常没有low的贴图,这里要不要去掉转low的?? xzw
  12868. var u = e.data.job.uuid + c + '_texture_jpg_' + h + '/',
  12869. d = $.Deferred(),
  12870. p = 0
  12871. return (
  12872. e.chunks.forEach(function (t) {
  12873. if (!t.material.map && t.textureName) {
  12874. var n = e.urls.get(u + t.textureName)
  12875. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  12876. }
  12877. }),
  12878. d.promise()
  12879. )
  12880. }
  12881. }
  12882. }).call(this, '/js/loaders/ModelTextureLoader.js')
  12883. },
  12884. {
  12885. '../settings': 166,
  12886. '../util/browser': 182,
  12887. '../util/common': 185,
  12888. '../util/logger': 189,
  12889. '../util/texture': 194
  12890. }
  12891. ],
  12892. 107: [
  12893. function (e, t, i) {
  12894. ;(function (i, n) {
  12895. 'use strict'
  12896. function r(e) {
  12897. ;(this.model = e), (this.modelDataPath = this.model.urls.get('vision.modeldata') + '?m=' + new Date().getTime()), (this.sweepLocationsPath = this.model.urls.get('sweep_locations.csv'))
  12898. var t = i(
  12899. 'Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K',
  12900. 'base64'
  12901. ),
  12902. n = o.loadProto(t)
  12903. this.decoder = n.build('VisionModeldata')
  12904. }
  12905. var o = e('protobufjs'),
  12906. a = e('../util/ajax'),
  12907. s = (e('../util/common'), e('../util/math')),
  12908. l = e('../util/logger'),
  12909. c = new l(n)
  12910. ;(r.prototype.load = function () {
  12911. return this.modelDataPath
  12912. ? (c.info('Using vision.modeldata'), this.loadVisionModelData())
  12913. : this.sweepLocationsPath
  12914. ? (c.warn('Using sweep_locations.csv'), this.loadSweepLocationsCSV())
  12915. : (c.warn('No sweep file found'), $.when([]))
  12916. }),
  12917. (r.prototype.loadVisionModelData = function () {
  12918. return a
  12919. .get(this.modelDataPath, {
  12920. responseType: 'arraybuffer'
  12921. })
  12922. .then(
  12923. function (e) {
  12924. var t
  12925. try {
  12926. t = this.decoder.decode(e)
  12927. } catch (e) {
  12928. return c.warn('Could not decode vision.modeldata, trying sweep_locations.csv'), this.loadSweepLocationsCSV()
  12929. }
  12930. var i = t.sweepLocations
  12931. .map(function (e) {
  12932. return {
  12933. uuid: e.uuid.toUTF8().replace(/-/g, ''),
  12934. position: {
  12935. x: e.pose.translation.x,
  12936. y: e.pose.translation.y,
  12937. z: e.pose.translation.z
  12938. },
  12939. quaternion: {
  12940. x: e.pose.rotation.x,
  12941. y: e.pose.rotation.y,
  12942. z: e.pose.rotation.z,
  12943. w: e.pose.rotation.w
  12944. },
  12945. puck: {
  12946. x: e.puck.x,
  12947. y: e.puck.y,
  12948. z: e.puck.z
  12949. },
  12950. floor: window.sceneFrom == 'kankan' ? e.subgroup : e.group,
  12951. neighbours: e.visibles,
  12952. alignmentType: e.alignment_type
  12953. }
  12954. })
  12955. .map(function (e) {
  12956. return (e.position = s.convertVisionVector(e.position)), (e.quaternion = s.convertVisionQuaternion(e.quaternion)), (e.puck = s.convertVisionVector(e.puck)), e
  12957. })
  12958. return (
  12959. i.forEach(function (e) {
  12960. e.neighbours = e.neighbours.map(function (e) {
  12961. return i[e].uuid
  12962. })
  12963. }),
  12964. i
  12965. )
  12966. }.bind(this),
  12967. function () {
  12968. return c.warn('Could not load vision.modeldata, trying sweep_locations.csv'), this.loadSweepLocationsCSV()
  12969. }.bind(this)
  12970. )
  12971. }),
  12972. (r.prototype.loadSweepLocationsCSV = function () {
  12973. return a
  12974. .get(this.sweepLocationsPath)
  12975. .then(function (e) {
  12976. var t = e
  12977. .split('\n')
  12978. .map(function (e) {
  12979. return e.split(', ')
  12980. })
  12981. .filter(function (e) {
  12982. return e.length > 1
  12983. })
  12984. .map(function (e) {
  12985. return {
  12986. uuid: e[0],
  12987. position: {
  12988. x: parseFloat(e[1]),
  12989. y: parseFloat(e[2]),
  12990. z: parseFloat(e[3])
  12991. },
  12992. quaternion: {
  12993. x: parseFloat(e[4]),
  12994. y: parseFloat(e[5]),
  12995. z: parseFloat(e[6]),
  12996. w: parseFloat(e[7])
  12997. }
  12998. }
  12999. })
  13000. .map(function (e) {
  13001. return (e.position = s.convertVisionVector(e.position)), (e.quaternion = s.convertVisionQuaternion(e.quaternion)), e
  13002. })
  13003. return t
  13004. })
  13005. .fail(function () {
  13006. c.warn('Could not load sweep_locations.csv, no sweeps loaded.')
  13007. })
  13008. }),
  13009. (t.exports = r)
  13010. }).call(this, e('buffer').Buffer, '/js/loaders/SweepDataLoader.js')
  13011. },
  13012. {
  13013. '../util/ajax': 181,
  13014. '../util/common': 185,
  13015. '../util/logger': 189,
  13016. '../util/math': 190,
  13017. buffer: 198,
  13018. protobufjs: 214
  13019. }
  13020. ],
  13021. 108: [
  13022. function (e, t, i) {
  13023. ;(function (i) {
  13024. 'use strict'
  13025. function n() {
  13026. this.locale = null
  13027. }
  13028. var r = e('../settings'),
  13029. o = e('../util/common'),
  13030. a = e('../util/logger'),
  13031. s = e('../enum/Locale'),
  13032. l = new a(i)
  13033. ;(n.prototype.init = function () {
  13034. var t
  13035. switch (r.languageTag) {
  13036. case null:
  13037. case 'en':
  13038. case s.EN_US:
  13039. ;(this.locale = s.EN_US), (t = e('./strings-en-US'))
  13040. break
  13041. case 'es':
  13042. case s.ES_MX:
  13043. ;(this.locale = s.ES_MX), (t = e('./strings-es-MX'))
  13044. break
  13045. case 'fr':
  13046. case s.FR_FR:
  13047. ;(this.locale = s.FR_FR), (t = e('./strings-fr-FR'))
  13048. break
  13049. case 'de':
  13050. case s.DE_DE:
  13051. ;(this.locale = s.DE_DE), (t = e('./strings-de-DE'))
  13052. break
  13053. case 'ru':
  13054. case s.RU_RU:
  13055. ;(this.locale = s.RU_RU), (t = e('./strings-ru-RU'))
  13056. break
  13057. case 'cn':
  13058. case s.CN_CN:
  13059. ;(this.locale = s.CN_CN), (t = e('./strings-cn-CN'))
  13060. break
  13061. case 'jp':
  13062. case s.JP_JP:
  13063. ;(this.locale = s.JP_JP), (t = e('./strings-jp-JP'))
  13064. break
  13065. default:
  13066. l.info("Unsupported language tag, defaulting to 'en-US'"), (this.locale = s.EN_US), (t = e('./strings-en-US'))
  13067. }
  13068. l.info("Using locale '" + this.locale + "'"), o.extendObject(this, t)
  13069. }),
  13070. (n.prototype.localizeGUI = function () {
  13071. var e = document.querySelector('#gui-parent')
  13072. this.localizeTree(e), this.localizeLoadingText()
  13073. }),
  13074. (n.prototype.localizeLoadingText = function () {
  13075. // var e = document.querySelector("#loader-cont")
  13076. // , t = e.getAttribute("title");
  13077. // e.removeAttribute("title"),
  13078. // e.setAttribute("data-status", t),
  13079. // e.classList.add(this.locale),
  13080. document.querySelector('#help-dialog').classList.add(this.locale),
  13081. document.querySelector('#interaction-modal').classList.add(this.locale),
  13082. document.querySelector('#gui').classList.add(this.locale)
  13083. }),
  13084. (n.prototype.localizeTree = function (e) {
  13085. var t,
  13086. i,
  13087. n = /{\[{ ?(\w+) ?}\]}/
  13088. if (e.nodeType === Node.TEXT_NODE) (t = e.data.match(n)), t && ((i = t[1]), (e.data = this.localizeText(i) || i))
  13089. else if (e.nodeType === Node.ELEMENT_NODE) {
  13090. var r = e.getAttribute('title')
  13091. r && ((t = r.match(n)), t && ((i = t[1]), e.setAttribute('title', this.localizeText(i) || i)))
  13092. }
  13093. for (e = e.firstChild; e; ) this.localizeTree(e), (e = e.nextSibling)
  13094. }),
  13095. (n.prototype.localizeText = function (t) {
  13096. var i = this[t]
  13097. return (
  13098. i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."), (i = e('./strings-en-US')[t])),
  13099. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  13100. i
  13101. )
  13102. }),
  13103. (t.exports = new n())
  13104. }).call(this, '/js/localization/localize.js')
  13105. },
  13106. {
  13107. '../enum/Locale': 31,
  13108. '../settings': 166,
  13109. '../util/common': 185,
  13110. '../util/logger': 189,
  13111. './strings-cn-CN': 109,
  13112. './strings-de-DE': 110,
  13113. './strings-en-US': 111,
  13114. './strings-es-MX': 112,
  13115. './strings-fr-FR': 113,
  13116. './strings-jp-JP': 114,
  13117. './strings-ru-RU': 115
  13118. }
  13119. ],
  13120. 109: [
  13121. function (e, t, i) {
  13122. 'use strict'
  13123. t.exports = {
  13124. PAGE_TITLE: '',
  13125. LOADING: '正在加载',
  13126. PRESENTED_BY_CAPS: '呈现者:',
  13127. POWERED_BY: '技术支持:',
  13128. POWERED_BY_CAPS: '技术支持:',
  13129. DESKTOP_SHORT_CTA: '点击一次以探索这个 3D 空间。',
  13130. MOBILE_SHORT_CTA: '点击一次以探索这个 3D 空间。',
  13131. PRESENTED_BY: '呈现者:',
  13132. MORE: '更多 ',
  13133. LESS: '更少 ',
  13134. TAG_CONTENT: 'tag™ 内容',
  13135. SHOW: '显示',
  13136. HIDE: '隐藏',
  13137. DOLLHOUSE: '场景屋',
  13138. FLOOR_PLAN: '楼层平面图',
  13139. OPEN_HIGHLIGHTS: '打开精彩片段',
  13140. CLOSE_HIGHLIGHTS: '关闭',
  13141. PREVIOUS: '上一个',
  13142. PLAY: '播放',
  13143. PAUSE: '暂停',
  13144. NEXT: '下一个',
  13145. EXPLORE_3D_SPACE: '探索 3D 空间',
  13146. VIEW_DOLLHOUSE: '观看场景屋',
  13147. SOCIAL_SHARING: '分享这个空间',
  13148. VIEW_IN_VR: '以 VR 观看',
  13149. VIEW_FULLSCREEN: '全屏观看',
  13150. EXIT_FULLSCREEN: ' 退出全屏',
  13151. ZOOM_IN: '放大',
  13152. ZOOM_OUT: '缩小',
  13153. FLOOR_NAME: '楼层',
  13154. FLOOR_ALL: 'ALL',
  13155. FLOOR_Lang: ['Floor', ''],
  13156. TERMS: '条款',
  13157. PORT_TERMS: 'port 条款',
  13158. TERMS_OF_USE: '使用条款',
  13159. CLOSE_TERMS: '关闭',
  13160. TERMS_TEXT_FILE: 'terms-cn-CN.html',
  13161. TERMS_FAIL: '无法获取条款。请确保您有互联网连接以查看使用条款。',
  13162. WEBVR_FOR_DAYDREAM: '用于 Daydream 视图',
  13163. WEBVR_ENTER_WEBVR: '进入 VR',
  13164. WEBVR_DIFFERENT_HEADSET: '有其他耳机吗?',
  13165. WEBVR_LEARN_MORE: '了解更多',
  13166. WEBVR_VIEW_SPACE: '在 VR 中观看空间',
  13167. WEBVR_DAYDREAM_VIEW: 'Daydream 视图',
  13168. WEBVR_DAYDREAM_PHONE: '支持 Daydream 的手机',
  13169. WEBVR_FOR_CARDBOARD: '用于 Google Cardboard',
  13170. WEBVR_VIEW_CARDBOARD: '或在 Google Cardboard 上观看',
  13171. VR_VIEW_SPACE: '在虚拟现实中观看空间',
  13172. VR_LEARN_MORE_CAPS: '了解更多',
  13173. VR_PREVIOUS_CAPS: '上一个’,',
  13174. VR_NEXT_CAPS: '下一个',
  13175. VR_GOT_IT_CAPS: '明白了',
  13176. VR_SHOW_SUPPORTED: '点击以使用 VR 观看空间',
  13177. VR_SHOW_UNSUPPORTED: '很遗憾,您的设备不符合在 VR 中观看空间的最低要求。',
  13178. VR_SHOW_IOS_1: '点击以使用 VR 观看空间',
  13179. VR_SHOW_IOS_2: '需要有 port VR 应用程序和兼容的 iPhone 才能观看',
  13180. VR_WHAT_YOU_NEED: '关于...您需要什么',
  13181. VR_NEED_CARDBOARD: '您使用 Google Cardboard 时需要什么',
  13182. VR_NEED_SAMSUNG: '您使用 Samsung Gear VR 时需要什么',
  13183. VR_NEED_DAYDREAM: '需要事先与 DAYDREAM VIEW 配对',
  13184. VR_NEED_DAYDREAM_PHONE: '支持 Daydream 的手机',
  13185. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  13186. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  13187. VR_APP: 'port VR 应用程序',
  13188. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  13189. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  13190. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本',
  13191. VR_COMPATIBLE_IPHONES_3: '兼容的 iPhone',
  13192. VR_COMPATIBLE_ANDROID: '兼容的 Android 设备',
  13193. VR_COMPATIBLE_ANDROID_LONG: '4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏',
  13194. VR_ANDROID_DETAIL: '4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏',
  13195. VR_ANDROID_DVICES: 'Android 设备',
  13196. VR_COMPATIBLE_SAMSUNG: '兼容的 Samsung 设备',
  13197. VR_SAMSUNG_DETAIL: 'Galaxy S6 和更高版本',
  13198. VR_APP_FOR_CARDBOARD: '用于 Google Cardboard 的 port VR 应用程序',
  13199. VR_APP_FOR_SAMSUNG: '用于 Gear VR 的 port VR 应用程序',
  13200. VR_APP_FOR_ANDROID: '用于 Android 手机的 port VR 应用程序',
  13201. VR_APP_OPEN: '请使用 port VR 应用程序打开',
  13202. VR_DOWNLOAD_HERE: '在此下载',
  13203. VR_REQUIRE_HEADSET: '需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序',
  13204. VR_REDIRECT_TO_STORE: '如果未安装应用程序,您将跳转到应用程序商店。',
  13205. VR_IMPROPER_EMBED: 'port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。',
  13206. VR_OPEN_ANDROID_LINK: '在您的手机上打开链接',
  13207. VR_ANDROID_OPTIONS: '可用的 VR 耳机选项',
  13208. SHARE_TO: '分享到',
  13209. SHARE_LINK: '直接链接',
  13210. SHARE_EXPLORE: '探索',
  13211. SHARE_AT: '在',
  13212. SHARE_WITH: '使用',
  13213. SHARE_3D: '以 3D',
  13214. SHARE_COPIED: '已复制!',
  13215. ERROR_BROWSER_SOLUTION: '安装更新的浏览器以探索 3D。',
  13216. ERROR_BROWSER_EXPLANATION: 'WebGL 需要现代的浏览器。',
  13217. ERROR_GENERIC_PROBLEM: '糟糕,出现问题。',
  13218. ERROR_GENERIC_SOLUTION: '重新启动您的浏览器。',
  13219. ERROR_GENERIC_ACTIONS_1: '如果问题仍然存在,',
  13220. ERROR_GENERIC_ACTIONS_2: '请安装支持的浏览器',
  13221. ERROR_GENERIC_ACTIONS_3: ' 或',
  13222. ERROR_GENERIC_ACTIONS_4: '查看我们的故障排除指南',
  13223. ERROR_WEBGL_UNSUPPORTED_PROBLEM: '浏览器不受支持。',
  13224. ERROR_WEBGL_IOS_PROBLEM: 'iOS 版本不受支持。',
  13225. ERROR_WEBGL_IOS_SOLUTION: '升级到 iOS 8 或更高版本以在 3D 中探索。',
  13226. ERROR_WEBGL_IOS_ACTIONS_1: '点击 ',
  13227. ERROR_WEBGL_IOS_ACTIONS_2: '设置 > 通用 > 软件更新',
  13228. ERROR_WEBGL_SAFARI_PROBLEM: '启用 WebGL 以在 3D 中探索。',
  13229. ERROR_WEBGL_SAFARI_ACTIONS_1: '单击',
  13230. ERROR_WEBGL_SAFARI_ACTIONS_2: '菜单栏中的首选项 > 高级 > 显示开发菜单',
  13231. ERROR_WEBGL_SAFARI_ACTIONS_3: '然后单击',
  13232. ERROR_WEBGL_SAFARI_ACTIONS_4: '开发 > 启用 WebGL',
  13233. ERROR_MISSING_URLS_PROBLEM: '糟糕,没有此模型的全景。',
  13234. ERROR_MISSING_URLS_EXPLANATION: '这是较早的模型。网站所有者可能正在开发一种新模型。',
  13235. ERROR_LOADING_FAILED_PROBLEM: '糟糕,模式不可用。',
  13236. ERROR_LOADING_FAILED_ACTIONS_1: '如果问题仍然存在,',
  13237. ERROR_LOADING_FAILED_ACTIONS_2: '查看我们的故障排除指南',
  13238. ERROR_MAINTENANCE_PROBLEM: '正在进行维护',
  13239. ERROR_MAINTENANCE_SOLUTION: '请过几分钟再来。',
  13240. LINK_TO_LOCATION: '地点链接',
  13241. MENU_COPY: '复制',
  13242. LINK_ALERT_COPY: '请使用 CTRL/CMD + C 复制。',
  13243. ROTATE: '旋转',
  13244. MOVE: '移动',
  13245. INSIDE: '内部',
  13246. ZOOM: '缩放',
  13247. HELP: '小帮手',
  13248. HELP_NAVIGATION_TAB: '导航',
  13249. HELP_MORE_HELP_TAB: '更多帮助',
  13250. HELP_DESKTOP_PANORAMA_1A: '单击并拖动以环顾空间。',
  13251. HELP_DESKTOP_PANORAMA_2A: '单击整个空间内的圆环以四处移动。',
  13252. HELP_DESKTOP_PANORAMA_3A: '使用鼠标滚轮来放大和缩小。',
  13253. HELP_DESKTOP_PANORAMA_1B: '或者,使用箭头键向左向右转。',
  13254. HELP_DESKTOP_PANORAMA_2B: '或者,使用箭头键向前移动和向后移动。',
  13255. HELP_DESKTOP_PANORAMA_3B: '或者,使用加号和减号键来放大和缩小。',
  13256. HELP_DESKTOP_360_2A: '单击内部视图图标以进入空间。',
  13257. HELP_DESKTOP_360_2B: '或者,按 1 号键进入内部视图。 ',
  13258. HELP_DESKTOP_DOLLHOUSE_1A: '左键单击并向左、向右、向上和向下拖动以旋转场景屋。',
  13259. HELP_DESKTOP_DOLLHOUSE_2A: '右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。',
  13260. HELP_DESKTOP_DOLLHOUSE_3A: '使用鼠标滚轮来放大和缩小。',
  13261. HELP_DESKTOP_DOLLHOUSE_1B: '或者,使用箭头键来旋转场景屋。',
  13262. HELP_DESKTOP_FLOORPLAN_1A: '左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。',
  13263. HELP_DESKTOP_FLOORPLAN_2A: '右键单击并向左或向右拖动以旋转楼层平面图。',
  13264. HELP_DESKTOP_FLOORPLAN_3A: '使用鼠标滚轮来放大和缩小。',
  13265. HELP_DESKTOP_FLOORPLAN_2B: '或者,使用箭头键以向左或向右旋转。',
  13266. HELP_DESKTOP_FLOORPLAN_3B: '或者,使用箭头键来放大和缩小。',
  13267. HELP_MOBILE_PANORAMA_1: '触摸并拖动以环顾空间。',
  13268. HELP_MOBILE_PANORAMA_2: '点击整个空间内的圆环以四处移动。',
  13269. HELP_MOBILE_3: '使用捏合手势来放大和缩小。',
  13270. HELP_MOBILE_360_2: '点击内部视图图标以进入空间。',
  13271. HELP_MOBILE_DOLLHOUSE_1: '触摸并向上、向下、向左和向右拖动以旋转场景屋。',
  13272. HELP_MOBILE_DOLLHOUSE_2: '用两指触摸并拖动以定位场景屋。',
  13273. HELP_MOBILE_FLOORPLAN_1: '触摸并拖动以定位楼层平面图。',
  13274. HELP_MOBILE_FLOORPLAN_2: '用两指触摸并拖动以旋转楼层平面图。',
  13275. HELP_MORE_HLR_A: '精彩片段集锦',
  13276. HELP_DESKTOP_MORE_HLR_B: '打开以使用缩略图图像在空间中流览。',
  13277. HELP_MORE_DOLLHOUSE_A: '场景屋',
  13278. HELP_DESKTOP_MORE_DOLLHOUSE_B: '单击以查看和旋转 3D 内整个空间的俯视图。',
  13279. HELP_MOBILE_MORE_DOLLHOUSE_B: '点击以查看和旋转 3D 内整个空间的俯视图。',
  13280. HELP_MORE_FLOORS_A: '楼层选择器',
  13281. HELP_DESKTOP_MORE_FLOORS_B: '在空间中的楼层之间切换。',
  13282. HELP_MORE_TAG_A: 'tag™ 贴文',
  13283. HELP_DESKTOP_MORE_TAG_B: '单击或悬停鼠标以查看空间中的功能信息。',
  13284. HELP_MOBILE_MORE_TAG_B: '点击以查看空间中的功能信息。',
  13285. HELP_MORE_ZOOM_A: '缩放控件',
  13286. HELP_DESKTOP_MORE_ZOOM_B: '使用这些控件来放大和缩小或使用滚轮。',
  13287. HELP_MORE_TOUR_A: '导览控件',
  13288. HELP_DESKTOP_MORE_TOUR_B: '通过导览播放、暂停以及向前和向后流览。',
  13289. HELP_MORE_INSIDE_A: '内部视图',
  13290. HELP_DESKTOP_MORE_INSIDE_B: '单击以探索空间内部。',
  13291. HELP_MOBILE_MORE_INSIDE_B: '点击以探索空间内部。',
  13292. HELP_MORE_VR_A: 'VR 模式',
  13293. HELP_DESKTOP_MORE_VR_B: '单击以在虚拟现实中启动空间。',
  13294. HELP_MOBILE_MORE_VR_B: '点击以在虚拟现实中启动空间。',
  13295. HELP_MORE_360_A: '360° 视图',
  13296. HELP_DESKTOP_MORE_360_B: '单击精彩片段集锦中的 360 视图中以观看室外场景。',
  13297. HELP_MOBILE_MORE_360_B: '点击精彩片段集锦中的 360 视图中以观看室外场景。',
  13298. HELP_MORE_FULLSCREEN_A: '全屏',
  13299. HELP_DESKTOP_MORE_FULLSCREEN_B: '将 3D Showcase 扩展到全屏。',
  13300. CLOSE: '关闭'
  13301. }
  13302. },
  13303. {}
  13304. ],
  13305. 110: [
  13306. function (e, t, i) {
  13307. 'use strict'
  13308. t.exports = {
  13309. PAGE_TITLE: '',
  13310. LOADING: 'Lädt',
  13311. PRESENTED_BY_CAPS: 'PRÄSENTIERT VON',
  13312. POWERED_BY: 'Angetrieben von',
  13313. POWERED_BY_CAPS: 'ANGETRIEBEN VON',
  13314. DESKTOP_SHORT_CTA: 'Sehen sie sich in diesem 3D Raum um.',
  13315. MOBILE_SHORT_CTA: 'Sehen sie sich in diesem 3D Raum um.',
  13316. PRESENTED_BY: 'Präsentiert von ',
  13317. MORE: 'Mehr ',
  13318. LESS: 'Weniger ',
  13319. TAG_CONTENT: 'tag™ Inhalt',
  13320. SHOW: 'Anzeigen',
  13321. HIDE: 'Verbergen',
  13322. DOLLHOUSE: 'Puppenhaus',
  13323. FLOOR_PLAN: 'Grundriss',
  13324. OPEN_HIGHLIGHTS: 'Highlights anzeigen',
  13325. CLOSE_HIGHLIGHTS: 'Schließen',
  13326. PREVIOUS: 'Vorheriges',
  13327. PLAY: 'Abspielen',
  13328. PAUSE: 'Pausieren',
  13329. NEXT: 'Nächstes',
  13330. EXPLORE_3D_SPACE: 'Innenraum betreten',
  13331. VIEW_DOLLHOUSE: 'Puppenhaus ansehen',
  13332. SOCIAL_SHARING: 'Teilen Sie diesen Raum',
  13333. VIEW_IN_VR: 'In VR ansehen',
  13334. VIEW_FULLSCREEN: 'Ansicht im Vollbildmodus',
  13335. EXIT_FULLSCREEN: 'Beenden des Vollbildmodus',
  13336. ZOOM_IN: 'Vergrößern',
  13337. ZOOM_OUT: 'Verkleinern',
  13338. FLOOR_NAME: 'Etage ',
  13339. FLOOR_ALL: 'Alle',
  13340. TERMS: 'Bedingungen',
  13341. PORT_TERMS: 'port Bedingungen',
  13342. TERMS_OF_USE: 'Nutzungsbedingungen',
  13343. TERMS_TEXT_FILE: 'terms-de-DE.html',
  13344. CLOSE_TERMS: 'Schließen',
  13345. TERMS_FAIL: 'Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.',
  13346. HELP: 'Hilfe',
  13347. HELP_NAVIGATION_TAB: 'Navigation',
  13348. HELP_MORE_HELP_TAB: 'Hilfe-Details',
  13349. CLOSE: 'Schließen',
  13350. HELP_DESKTOP_PANORAMA_1A: 'Klicken und ziehen Sie um sich im Raum umzusehen.',
  13351. HELP_DESKTOP_PANORAMA_2A: 'Klicken Sie auf die Ringe im Raum um sich zu bewegen.',
  13352. HELP_DESKTOP_PANORAMA_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  13353. HELP_DESKTOP_PANORAMA_1B: 'Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.',
  13354. HELP_DESKTOP_PANORAMA_2B: 'Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.',
  13355. HELP_DESKTOP_PANORAMA_3B: 'Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.',
  13356. HELP_DESKTOP_360_2A: 'Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .',
  13357. HELP_DESKTOP_360_2B: 'Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.',
  13358. HELP_DESKTOP_DOLLHOUSE_1A: 'Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.',
  13359. HELP_DESKTOP_DOLLHOUSE_2A: 'Klicken mit der rechten Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Puppenhauses zu ändern.',
  13360. HELP_DESKTOP_DOLLHOUSE_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  13361. HELP_DESKTOP_DOLLHOUSE_1B: 'Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.',
  13362. HELP_DESKTOP_FLOORPLAN_1A: 'Klicken mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Grundrisses auf zu ändern.',
  13363. HELP_DESKTOP_FLOORPLAN_2A: 'Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.',
  13364. HELP_DESKTOP_FLOORPLAN_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  13365. HELP_DESKTOP_FLOORPLAN_2B: 'Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.',
  13366. HELP_DESKTOP_FLOORPLAN_3B: 'Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.',
  13367. HELP_MOBILE_PANORAMA_1: 'Berühren und ziehen an dem Raum um sich umzusehen.',
  13368. HELP_MOBILE_PANORAMA_2: 'Klicken Sie auf die Ringe im Raum, um sich zu bewegen.',
  13369. HELP_MOBILE_3: 'Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.',
  13370. HELP_MOBILE_360_2: 'Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.',
  13371. HELP_MOBILE_DOLLHOUSE_1: 'Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.',
  13372. HELP_MOBILE_DOLLHOUSE_2: 'Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.',
  13373. HELP_MOBILE_FLOORPLAN_1: 'Berühren und ziehen, um den Grundriss zu positionieren.',
  13374. HELP_MOBILE_FLOORPLAN_2: 'Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.',
  13375. HELP_MORE_HLR_A: 'Liste das Highlight',
  13376. HELP_DESKTOP_MORE_HLR_B: 'Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.',
  13377. HELP_MORE_DOLLHOUSE_A: 'Puppenhaus Ansicht',
  13378. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.',
  13379. HELP_MOBILE_MORE_DOLLHOUSE_B: 'Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.',
  13380. HELP_MORE_FLOORS_A: 'Etage auswählen',
  13381. HELP_DESKTOP_MORE_FLOORS_B: 'Zwischen den Etagen im Raum wechseln.',
  13382. HELP_MORE_TAG_A: 'tag™ Posts',
  13383. HELP_DESKTOP_MORE_TAG_B: 'Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.',
  13384. HELP_MOBILE_MORE_TAG_B: 'Tippen Sie für Informationen über die Funktionen im Raum.',
  13385. HELP_MORE_ZOOM_A: 'Zoom Steuerung',
  13386. HELP_DESKTOP_MORE_ZOOM_B: 'Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.',
  13387. HELP_MORE_TOUR_A: 'Tour Steuerung',
  13388. HELP_DESKTOP_MORE_TOUR_B: 'Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.',
  13389. HELP_MORE_INSIDE_A: 'Innenansicht',
  13390. HELP_DESKTOP_MORE_INSIDE_B: 'Klicken Sie hier um sich im Raum umzusehen.',
  13391. HELP_MOBILE_MORE_INSIDE_B: 'Sehen Sie sich in diesen 3D Raum um.',
  13392. HELP_MORE_VR_A: 'VR Modus',
  13393. HELP_DESKTOP_MORE_VR_B: 'Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.',
  13394. HELP_MOBILE_MORE_VR_B: 'Tippen Sie um den Raum in der virtuellen Realität zu starten.',
  13395. HELP_MORE_360_A: '360° Views Ansicht ',
  13396. HELP_DESKTOP_MORE_360_B: 'Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.',
  13397. HELP_MOBILE_MORE_360_B: 'Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.',
  13398. HELP_MORE_FULLSCREEN_A: 'Vollbild',
  13399. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Erweitern Sie 3D Showcase im Vollbildmodus.',
  13400. WEBVR_FOR_CARDBOARD: 'Für Google Cardboard',
  13401. WEBVR_FOR_DAYDREAM: 'Für Daydream View',
  13402. WEBVR_ENTER_WEBVR: 'Starten Sie VR',
  13403. WEBVR_DIFFERENT_HEADSET: 'Haben Sie anderes Headset?',
  13404. WEBVR_LEARN_MORE: 'Mehr Infos',
  13405. WEBVR_VIEW_SPACE: 'Ansicht des Raumes in VR',
  13406. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  13407. WEBVR_DAYDREAM_PHONE: 'Daydream-fähiges Handy',
  13408. WEBVR_VIEW_CARDBOARD: 'Oder mit Google Cardboard ansehen',
  13409. VR_WHAT_YOU_NEED: 'Was Sie dafür brauchen...',
  13410. VR_NEED_DAYDREAM_PHONE: 'Daydream-fähiges Handy',
  13411. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  13412. VR_APP: 'port VR App',
  13413. VR_APP_OPEN: 'Oder öffnen Sie die port VR App',
  13414. VR_COMPATIBLE_ANDROID_LONG: 'Kompatibles Android Gerät mit Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer',
  13415. VR_SAMSUNG_DETAIL: 'Galaxy S6 und neuer',
  13416. VR_APP_FOR_ANDROID: 'port VR app für Android',
  13417. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13418. VR_VIEW_SPACE: 'Ansicht des Raumes in VR',
  13419. VR_LEARN_MORE_CAPS: 'MEHR INFOS',
  13420. VR_PREVIOUS_CAPS: 'ZURÜCK',
  13421. VR_NEXT_CAPS: 'WEITER',
  13422. VR_GOT_IT_CAPS: 'VERSTANDEN',
  13423. VR_SHOW_SUPPORTED: 'Tippen Sie um den Raum in VR zu sehen',
  13424. VR_SHOW_UNSUPPORTED: 'Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.',
  13425. VR_SHOW_IOS_1: 'Tippen Sie um den Raum in VR zu sehen',
  13426. VR_SHOW_IOS_2: 'port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen',
  13427. VR_NEED_CARDBOARD: 'Was Sie dafür brauchen ist Google Cardboard',
  13428. VR_NEED_SAMSUNG: 'Was Sie dafür brauchen ist Samsung Gear VR',
  13429. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  13430. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  13431. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  13432. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s oder neuer, mit iOS 9.1 und später',
  13433. VR_COMPATIBLE_IPHONES_3: 'Kompatibles iPhones',
  13434. VR_COMPATIBLE_ANDROID: 'Kompatibles Android Gerät',
  13435. VR_ANDROID_DETAIL: 'Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer',
  13436. VR_ANDROID_DVICES: 'Android Geräte',
  13437. VR_COMPATIBLE_SAMSUNG: 'Kompatible Samsung Geräte',
  13438. VR_APP_FOR_CARDBOARD: 'port VR App für Google Cardboard',
  13439. VR_APP_FOR_SAMSUNG: 'port VR App für Gear VR',
  13440. VR_DOWNLOAD_HERE: 'Hier runterladen',
  13441. VR_REQUIRE_HEADSET: 'Benötigt das ein VR-Headset und port VR App für Android installiert wird',
  13442. VR_REDIRECT_TO_STORE: 'Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.',
  13443. VR_IMPROPER_EMBED: 'Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.',
  13444. VR_OPEN_ANDROID_LINK: 'Öffnen Sie den Link auf Ihrem Handy',
  13445. VR_ANDROID_OPTIONS: 'VR Headset Optionen',
  13446. SHARE_TO: 'Teilen auf',
  13447. SHARE_LINK: 'Direkter Link',
  13448. SHARE_EXPLORE: 'Umsehen',
  13449. SHARE_AT: 'auf',
  13450. SHARE_WITH: 'mit',
  13451. SHARE_3D: 'in 3D',
  13452. SHARE_COPIED: 'Kopiert!',
  13453. ERROR_BROWSER_SOLUTION: 'Installieren Sie einen neueren Browser um sich in 3D umzusehen.',
  13454. ERROR_BROWSER_EXPLANATION: 'WebGL benötigt einen modernen Browser.',
  13455. ERROR_GENERIC_PROBLEM: 'Huch, etwas ist schief gelaufen.',
  13456. ERROR_GENERIC_SOLUTION: 'Starten Sie Ihren Browser neu.',
  13457. ERROR_GENERIC_ACTIONS_1: 'Wenn das Problem weiterhin besteht, ',
  13458. ERROR_GENERIC_ACTIONS_2: 'Installieren Sie einen unterstützten Browser',
  13459. ERROR_GENERIC_ACTIONS_3: ' oder ',
  13460. ERROR_GENERIC_ACTIONS_4: 'Sehen Sie unseren Leitfaden zur Fehlerbehebung',
  13461. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Browser wird nicht unterstützt.',
  13462. ERROR_WEBGL_IOS_PROBLEM: 'iOS-Version wird nicht unterstützt.',
  13463. ERROR_WEBGL_IOS_SOLUTION: 'Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.',
  13464. ERROR_WEBGL_IOS_ACTIONS_1: 'Tippen ',
  13465. ERROR_WEBGL_IOS_ACTIONS_2: 'Einstellungen > Allgemein > Softwareaktualisierung',
  13466. ERROR_WEBGL_SAFARI_PROBLEM: 'Aktivieren Sie WebVR um sich in 3D umzusehen.',
  13467. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Klicken ',
  13468. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen',
  13469. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Klicken Sie dann ',
  13470. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Entwickler > WebGL Aktivieren',
  13471. ERROR_MISSING_URLS_PROBLEM: 'Huch, es gibt keine Panoramen für dieses Modell .',
  13472. ERROR_MISSING_URLS_EXPLANATION: 'Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.',
  13473. ERROR_LOADING_FAILED_PROBLEM: 'Huch, das Modell ist nicht verfügbar.',
  13474. ERROR_LOADING_FAILED_ACTIONS_1: 'Wenn das Problem weiterhin besteht, ',
  13475. ERROR_LOADING_FAILED_ACTIONS_2: 'sehen Sie unseren Leitfaden zur Fehlerbehebung',
  13476. ERROR_MAINTENANCE_PROBLEM: 'Wartung im Gange.',
  13477. ERROR_MAINTENANCE_SOLUTION: 'Bitte versuchen Sie es in ein paar Minuten nochmal.',
  13478. LINK_TO_LOCATION: 'Link zu',
  13479. MENU_COPY: 'Kopieren',
  13480. LINK_ALERT_COPY: 'Bitte benutzen Sie CTRL/CMD + C zum kopieren.',
  13481. ROTATE: 'Drehen',
  13482. INSIDE: 'Drinnen',
  13483. MOVE: 'Bewegen',
  13484. ZOOM: 'Vergrößern'
  13485. }
  13486. },
  13487. {}
  13488. ],
  13489. 111: [
  13490. function (e, t, i) {
  13491. 'use strict'
  13492. t.exports = {
  13493. PAGE_TITLE: '',
  13494. LOADING: 'Loading',
  13495. PRESENTED_BY_CAPS: 'PRESENTED BY',
  13496. POWERED_BY: 'powered by ',
  13497. POWERED_BY_CAPS: 'POWERED BY',
  13498. DESKTOP_SHORT_CTA: 'Click to explore this 3D space.',
  13499. MOBILE_SHORT_CTA: 'Tap to explore this 3D space.',
  13500. PRESENTED_BY: 'Presented by ',
  13501. MORE: 'More ',
  13502. LESS: 'Less ',
  13503. TAG_CONTENT: 'tag™ Content',
  13504. SHOW: 'Show',
  13505. HIDE: 'Hide',
  13506. DOLLHOUSE: 'Dollhouse',
  13507. FLOOR_PLAN: 'Floor plan',
  13508. OPEN_HIGHLIGHTS: 'Open Highlights',
  13509. CLOSE_HIGHLIGHTS: 'Close',
  13510. PREVIOUS: 'Previous',
  13511. PLAY: 'Play',
  13512. PAUSE: 'Pause',
  13513. NEXT: 'Next',
  13514. EXPLORE_3D_SPACE: 'Explore 3D Space',
  13515. VIEW_DOLLHOUSE: 'View dollhouse',
  13516. SOCIAL_SHARING: 'Share this Space',
  13517. VIEW_IN_VR: 'View in VR',
  13518. VIEW_FULLSCREEN: '全屏',
  13519. EXIT_FULLSCREEN: '退出全屏',
  13520. ZOOM_IN: 'Zoom in',
  13521. ZOOM_OUT: 'Zoom out',
  13522. FLOOR_NAME: 'Floor ',
  13523. FLOOR_ALL: '全部',
  13524. TERMS: 'Terms',
  13525. PORT_TERMS: 'port terms',
  13526. TERMS_OF_USE: 'Terms of Use',
  13527. TERMS_TEXT_FILE: 'terms-en-US.html',
  13528. CLOSE_TERMS: 'Close',
  13529. TERMS_FAIL: 'Could not fetch terms. Please make sure you have an internet connection to view the terms of use.',
  13530. HELP: 'Help',
  13531. HELP_NAVIGATION_TAB: 'Navigation',
  13532. HELP_MORE_HELP_TAB: 'More Help',
  13533. CLOSE: 'Close',
  13534. HELP_DESKTOP_PANORAMA_1A: 'Click and Drag to look around the Space.',
  13535. HELP_DESKTOP_PANORAMA_2A: 'Click on the rings throughout the space to move around.',
  13536. HELP_DESKTOP_PANORAMA_3A: 'Use the scroll wheel to zoom in and out.',
  13537. HELP_DESKTOP_PANORAMA_1B: 'Or, use the arrow keys to turn left and right.',
  13538. HELP_DESKTOP_PANORAMA_2B: 'Or, use the arrow keys to move forward and back.',
  13539. HELP_DESKTOP_PANORAMA_3B: 'Or, use the plus and minus keys to zoom in and out.',
  13540. HELP_DESKTOP_360_2A: 'Click the Inside View icon to enter the Space.',
  13541. HELP_DESKTOP_360_2B: 'Or, press the number 1 key to enter Inside View.',
  13542. HELP_DESKTOP_DOLLHOUSE_1A: 'Left click and drag left, right, up, and down to rotate the Dollhouse.',
  13543. HELP_DESKTOP_DOLLHOUSE_2A: 'Right click and drag left, right, up, and down to change the Dollhouse position on screen.',
  13544. HELP_DESKTOP_DOLLHOUSE_3A: 'Use the scroll wheel to zoom in and out.',
  13545. HELP_DESKTOP_DOLLHOUSE_1B: 'Or, use the arrow keys to rotate the Dollhouse.',
  13546. HELP_DESKTOP_FLOORPLAN_1A: 'Left click and drag left, right, up, and down to change the Floorplan position on screen.',
  13547. HELP_DESKTOP_FLOORPLAN_2A: 'Right click and drag left or right to rotate the Floorplan.',
  13548. HELP_DESKTOP_FLOORPLAN_3A: 'Use the scroll wheel to zoom in and out.',
  13549. HELP_DESKTOP_FLOORPLAN_2B: 'Or, use the arrow keys to rotate left or right.',
  13550. HELP_DESKTOP_FLOORPLAN_3B: 'Or, use the arrow keys to zoom in and out.',
  13551. HELP_MOBILE_PANORAMA_1: 'Touch and Drag to look around the Space.',
  13552. HELP_MOBILE_PANORAMA_2: 'Tap on the rings throughout the Space to move around.',
  13553. HELP_MOBILE_3: 'Use a pinch gesture to zoom in and out.',
  13554. HELP_MOBILE_360_2: 'Tap the Inside View icon to enter the Space.',
  13555. HELP_MOBILE_DOLLHOUSE_1: 'Touch and drag up, down, left, and right to rotate the Dollhouse.',
  13556. HELP_MOBILE_DOLLHOUSE_2: 'Touch and drag with two fingers to position the Dollhouse.',
  13557. HELP_MOBILE_FLOORPLAN_1: 'Touch and drag to position the Floorplan.',
  13558. HELP_MOBILE_FLOORPLAN_2: 'Touch and drag with two fingers to rotate the Floorplan.',
  13559. HELP_MORE_HLR_A: 'Highlight Reel',
  13560. HELP_DESKTOP_MORE_HLR_B: 'Open to navigate through the Space using thumbnail images.',
  13561. HELP_MORE_DOLLHOUSE_A: 'Dollhouse View',
  13562. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'Click to view and rotate a top-down view of the entire Space in 3D.',
  13563. HELP_MOBILE_MORE_DOLLHOUSE_B: 'Tap to view and rotate a top-down view of the entire Space in 3D.',
  13564. HELP_MORE_FLOORS_A: 'Floor Selector',
  13565. HELP_DESKTOP_MORE_FLOORS_B: 'Switch between floors in the Space.',
  13566. HELP_MORE_TAG_A: 'tag™ Posts',
  13567. HELP_DESKTOP_MORE_TAG_B: 'Click or hover over for information about features in the Space.',
  13568. HELP_MOBILE_MORE_TAG_B: 'Tap for information about features in the Space.',
  13569. HELP_MORE_ZOOM_A: 'Zoom Controls',
  13570. HELP_DESKTOP_MORE_ZOOM_B: 'Use these controls to zoom in and out or use the scroll wheel.',
  13571. HELP_MORE_TOUR_A: 'Tour Controls',
  13572. HELP_DESKTOP_MORE_TOUR_B: 'Play, pause, and navigate forward and backward through a Guided Tour.',
  13573. HELP_MORE_INSIDE_A: 'Inside View',
  13574. HELP_DESKTOP_MORE_INSIDE_B: 'Click to explore inside the Space.',
  13575. HELP_MOBILE_MORE_INSIDE_B: 'Tap to explore inside the Space.',
  13576. HELP_MORE_VR_A: 'VR Mode',
  13577. HELP_DESKTOP_MORE_VR_B: 'Click to launch the Space in virtual reality.',
  13578. HELP_MOBILE_MORE_VR_B: 'Tap to launch the Space in virtual reality.',
  13579. HELP_MORE_360_A: '360° Views',
  13580. HELP_DESKTOP_MORE_360_B: 'Click 360 Views in the Highlight Reel to view outdoor scenes.',
  13581. HELP_MOBILE_MORE_360_B: 'Tap 360 Views in the Highlight Reel to view outdoor scenes.',
  13582. HELP_MORE_FULLSCREEN_A: 'Full screen',
  13583. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Expand 3D Showcase to full screen.',
  13584. WEBVR_FOR_CARDBOARD: 'For Google Cardboard',
  13585. WEBVR_VIEW_CARDBOARD: 'Or View on Google Cardboard',
  13586. WEBVR_FOR_DAYDREAM: 'For Daydream View',
  13587. WEBVR_ENTER_WEBVR: 'ENTER VR',
  13588. WEBVR_DIFFERENT_HEADSET: 'Have a different headset?',
  13589. WEBVR_LEARN_MORE: 'Learn more',
  13590. WEBVR_VIEW_SPACE: 'View Space in VR',
  13591. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  13592. WEBVR_DAYDREAM_PHONE: 'Daydream-ready phone',
  13593. VR_VIEW_SPACE: 'View Space in Virtual Reality',
  13594. VR_LEARN_MORE_CAPS: 'LEARN MORE',
  13595. VR_PREVIOUS_CAPS: 'PREVIOUS',
  13596. VR_NEXT_CAPS: 'NEXT',
  13597. VR_GOT_IT_CAPS: 'GOT IT',
  13598. VR_SHOW_SUPPORTED: 'Tap to view the Space in VR with',
  13599. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13600. VR_SHOW_IOS_1: 'Tap to view the space in VR',
  13601. VR_SHOW_IOS_2: 'Requires port VR app and compatible iPhone to view',
  13602. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13603. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13604. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13605. VR_NEED_DAYDREAM: 'NEEDS PRIOR PAIRING WITH DAYDREAM VIEW',
  13606. VR_NEED_DAYDREAM_PHONE: 'Daydream-ready phone',
  13607. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  13608. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  13609. VR_APP: 'port VR App',
  13610. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  13611. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  13612. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s and newer, running iOS 9.1 and higher',
  13613. VR_COMPATIBLE_IPHONES_3: 'Compatible iPhones',
  13614. VR_COMPATIBLE_ANDROID: 'Compatible Android Devices',
  13615. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13616. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13617. VR_ANDROID_DVICES: 'Android Devices',
  13618. VR_COMPATIBLE_SAMSUNG: 'Compatible Samsung Devices',
  13619. VR_SAMSUNG_DETAIL: 'Galaxy S6 and Above',
  13620. VR_APP_FOR_CARDBOARD: 'port VR app for Google Cardboard',
  13621. VR_APP_FOR_SAMSUNG: 'port VR app for Gear VR',
  13622. VR_APP_FOR_ANDROID: 'port VR app for Android Phones',
  13623. VR_APP_OPEN: 'Open with the port VR app instead',
  13624. VR_DOWNLOAD_HERE: 'Download here',
  13625. VR_REQUIRE_HEADSET: 'Requires a VR headset and port VR app for Android to be installed',
  13626. VR_REDIRECT_TO_STORE: 'If app is not installed, you will be redirected to the app store.',
  13627. VR_IMPROPER_EMBED: 'The port Space is not embedded properly to support VR in your web browser.',
  13628. VR_OPEN_ANDROID_LINK: 'Open the Link on Your Mobile Phone',
  13629. VR_ANDROID_OPTIONS: 'Available VR Headset Options',
  13630. SHARE_TO: 'Share to',
  13631. SHARE_LINK: 'Direct Link',
  13632. SHARE_EXPLORE: 'Explore ',
  13633. SHARE_AT: 'at',
  13634. SHARE_WITH: 'with',
  13635. SHARE_3D: ' in 3D',
  13636. SHARE_COPIED: 'Copied!',
  13637. ERROR_BROWSER_SOLUTION: 'Install a new browser to explore in 3D.',
  13638. ERROR_BROWSER_EXPLANATION: 'WebGL requires a modern browser.',
  13639. ERROR_GENERIC_PROBLEM: 'Oops, something went wrong.',
  13640. ERROR_GENERIC_SOLUTION: 'Restart your browser.',
  13641. ERROR_GENERIC_ACTIONS_1: 'If the problem persists, ',
  13642. ERROR_GENERIC_ACTIONS_2: 'install a supported browser',
  13643. ERROR_GENERIC_ACTIONS_3: ' or ',
  13644. ERROR_GENERIC_ACTIONS_4: 'see our troubleshooting guide',
  13645. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Browser not supported.',
  13646. ERROR_WEBGL_IOS_PROBLEM: 'iOS version not supported.',
  13647. ERROR_WEBGL_IOS_SOLUTION: 'Upgrade to iOS 8 or higher to explore in 3D.',
  13648. ERROR_WEBGL_IOS_ACTIONS_1: 'Tap ',
  13649. ERROR_WEBGL_IOS_ACTIONS_2: 'Settings > General > Software Update',
  13650. ERROR_WEBGL_SAFARI_PROBLEM: 'Enable WebGL to explore in 3D.',
  13651. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Click ',
  13652. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Preferences > Advanced > Show Develop menu',
  13653. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Then click ',
  13654. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Develop > Enable WebGL',
  13655. ERROR_MISSING_URLS_PROBLEM: 'Oops, there are no panoramas for this model.',
  13656. ERROR_MISSING_URLS_EXPLANATION: 'This is an older model. The website owner may have a new model on the way.',
  13657. ERROR_LOADING_FAILED_PROBLEM: '模型不可用.',
  13658. ERROR_LOADING_FAILED_ACTIONS_1: 'If the problem persists, ',
  13659. ERROR_LOADING_FAILED_ACTIONS_2: 'see our troubleshooting guide',
  13660. ERROR_MAINTENANCE_PROBLEM: 'Maintenance in progress.',
  13661. ERROR_MAINTENANCE_SOLUTION: 'Please come back in a few minutes.',
  13662. LINK_TO_LOCATION: 'Link to location',
  13663. MENU_COPY: 'Copy',
  13664. LINK_ALERT_COPY: 'Please use CTRL/CMD + C to copy.',
  13665. ROTATE: 'Rotate',
  13666. INSIDE: 'Inside',
  13667. MOVE: 'Move',
  13668. ZOOM: 'Zoom'
  13669. }
  13670. },
  13671. {}
  13672. ],
  13673. 112: [
  13674. function (e, t, i) {
  13675. 'use strict'
  13676. t.exports = {
  13677. PAGE_TITLE: '',
  13678. LOADING: 'Cargando',
  13679. PRESENTED_BY_CAPS: 'PRESENTADO POR',
  13680. POWERED_BY: 'potenciando por ',
  13681. POWERED_BY_CAPS: 'POTENCIADO POR ',
  13682. DESKTOP_SHORT_CTA: 'Haga clic para explorar este Espacio 3D.',
  13683. MOBILE_SHORT_CTA: 'Pulse para explorar este Espacio 3D.',
  13684. PRESENTED_BY: 'Presentado por ',
  13685. MORE: 'Más ',
  13686. LESS: 'Menos ',
  13687. TAG_CONTENT: 'Contenido de tag™',
  13688. SHOW: 'Mostrar',
  13689. HIDE: 'Ocultar',
  13690. DOLLHOUSE: 'Dollhouse',
  13691. FLOOR_PLAN: 'Planos',
  13692. OPEN_HIGHLIGHTS: 'Aspectos Destacados',
  13693. CLOSE_HIGHLIGHTS: 'Cerrar',
  13694. PREVIOUS: 'Anterior',
  13695. PLAY: 'Play',
  13696. PAUSE: 'Pausa',
  13697. NEXT: 'Siguiente',
  13698. EXPLORE_3D_SPACE: 'Explorar el Espacio 3D',
  13699. VIEW_DOLLHOUSE: 'Ver dollhouse',
  13700. SOCIAL_SHARING: 'Compartir este espacio',
  13701. VIEW_IN_VR: 'Ver en realidad virtual',
  13702. VIEW_FULLSCREEN: 'Ver en pantalla completa',
  13703. EXIT_FULLSCREEN: 'Salir de pantalla completa',
  13704. ZOOM_IN: 'Acercar',
  13705. ZOOM_OUT: 'Alejar',
  13706. FLOOR_NAME: 'Piso ',
  13707. FLOOR_ALL: 'Todas',
  13708. TERMS: 'Condiciones',
  13709. PORT_TERMS: 'port términos de uso',
  13710. TERMS_OF_USE: 'Términos de uso',
  13711. TERMS_TEXT_FILE: 'terms-es-MX.html',
  13712. CLOSE_TERMS: 'Cerrar',
  13713. TERMS_FAIL: 'No se han podido obtener las condiciones. Asegúrese de tener una conexión a Internet para ver los términos de uso.',
  13714. HELP: 'Ayuda',
  13715. HELP_NAVIGATION_TAB: 'Navegación',
  13716. HELP_MORE_HELP_TAB: 'Más Ayuda',
  13717. CLOSE: 'Cerrar',
  13718. HELP_DESKTOP_PANORAMA_1A: 'Haga clic y arrastre para mirar alrededor del espacio.',
  13719. HELP_DESKTOP_PANORAMA_2A: 'Haga clic en los aros a lo largo del espacio para moverse.',
  13720. HELP_DESKTOP_PANORAMA_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  13721. HELP_DESKTOP_PANORAMA_1B: 'O use las teclas de flecha para girar a la izquierda y a la derecha.',
  13722. HELP_DESKTOP_PANORAMA_2B: 'O use las teclas de dirección para adelantar o retroceder.',
  13723. HELP_DESKTOP_PANORAMA_3B: 'O use la tecla más para acercar y la tecla menos para alejar.',
  13724. HELP_DESKTOP_360_2A: 'Haga clic en el icono Vista Interior para ingresar al Espacio.',
  13725. HELP_DESKTOP_360_2B: 'O bien, presione la tecla numero 1 para entrar en la Vista Interior.',
  13726. HELP_DESKTOP_DOLLHOUSE_1A: 'Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.',
  13727. HELP_DESKTOP_DOLLHOUSE_2A: 'Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.',
  13728. HELP_DESKTOP_DOLLHOUSE_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  13729. HELP_DESKTOP_DOLLHOUSE_1B: 'O use las teclas de dirección para girar la Dollhouse.',
  13730. HELP_DESKTOP_FLOORPLAN_1A: 'Haga clic con izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición de la planta.',
  13731. HELP_DESKTOP_FLOORPLAN_2A: 'Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.',
  13732. HELP_DESKTOP_FLOORPLAN_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  13733. HELP_DESKTOP_FLOORPLAN_2B: 'O use las teclas para girar hacia la izquierda o derecha.',
  13734. HELP_DESKTOP_FLOORPLAN_3B: 'O use las teclas de dirección para acercar o alejar.',
  13735. HELP_MOBILE_PANORAMA_1: 'Toque y arrastre para mirar alrededor del espacio.',
  13736. HELP_MOBILE_PANORAMA_2: 'Toque en los aros a lo largo del espacio para moverse.',
  13737. HELP_MOBILE_3: 'Use el gesto de pellizcar para acercar o alejar.',
  13738. HELP_MOBILE_360_2: 'Toque el ícono Vista Interior para entrar en el Espacio.',
  13739. HELP_MOBILE_DOLLHOUSE_1: 'Toque y arrastre con dos dedos para cambiar la posición della dollhouse.',
  13740. HELP_MOBILE_DOLLHOUSE_2: 'Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.',
  13741. HELP_MOBILE_FLOORPLAN_1: 'Toque y arrastre para cambiar la posición de la planta.',
  13742. HELP_MOBILE_FLOORPLAN_2: 'Toque y arrastre con dos dedos para girar la planta.',
  13743. HELP_MORE_HLR_A: 'Galería destacada',
  13744. HELP_DESKTOP_MORE_HLR_B: 'Abra para navegar a través del espacio utilizando imágenes en miniatura.',
  13745. HELP_MORE_DOLLHOUSE_A: 'Vista aérea por pisos',
  13746. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'Haga clic para ver y girar la Dollhouse del espacio completo en 3D.',
  13747. HELP_MOBILE_MORE_DOLLHOUSE_B: 'Toque para ver y girar la vista Dollhouse del espacio completo en 3D.',
  13748. HELP_MORE_FLOORS_A: 'Seleccionador de plantas',
  13749. HELP_DESKTOP_MORE_FLOORS_B: 'Cambie de una planta a otra en el espacio.',
  13750. HELP_MORE_TAG_A: 'tag™ Posts',
  13751. HELP_DESKTOP_MORE_TAG_B: 'Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.',
  13752. HELP_MOBILE_MORE_TAG_B: 'Toque para obtener más información acerca de las características del espacio.',
  13753. HELP_MORE_ZOOM_A: 'Controles de zoom',
  13754. HELP_DESKTOP_MORE_ZOOM_B: 'Use estos controles o la rueda de desplazamiento para acercar o alejar.',
  13755. HELP_MORE_TOUR_A: 'Controles de recorrido',
  13756. HELP_DESKTOP_MORE_TOUR_B: 'Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.',
  13757. HELP_MORE_INSIDE_A: 'Vista interior',
  13758. HELP_DESKTOP_MORE_INSIDE_B: 'Haga clic para explorar el interior del espacio.',
  13759. HELP_MOBILE_MORE_INSIDE_B: 'Toque para explorar el interior del espacio.',
  13760. HELP_MORE_VR_A: 'Modo de realidad virtual',
  13761. HELP_DESKTOP_MORE_VR_B: 'Toque para ver el espacio en realidad virtual.',
  13762. HELP_MOBILE_MORE_VR_B: 'Toque para ver el espacio en realidad virtual.',
  13763. HELP_MORE_360_A: '360° Views',
  13764. HELP_DESKTOP_MORE_360_B: 'Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.',
  13765. HELP_MOBILE_MORE_360_B: 'Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.',
  13766. HELP_MORE_FULLSCREEN_A: 'Pantalla completa',
  13767. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Expanda el escenario 3D para verlo en pantalla completa.',
  13768. WEBVR_FOR_CARDBOARD: 'Para Google Cardboard',
  13769. WEBVR_FOR_DAYDREAM: 'Para Daydream View',
  13770. WEBVR_ENTER_WEBVR: 'ENTRAR VR',
  13771. WEBVR_DIFFERENT_HEADSET: '¿Tiene un auricular diferente?',
  13772. WEBVR_LEARN_MORE: 'Más información',
  13773. WEBVR_VIEW_SPACE: 'Ver Espacio en VR',
  13774. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  13775. WEBVR_DAYDREAM_PHONE: 'Daydream Teléfono listos',
  13776. WEBVR_VIEW_CARDBOARD: 'O Ver en Google Cardboard',
  13777. VR_NEED_DAYDREAM: 'Necesidades antes de acoplarse con Daydream View',
  13778. VR_NEED_DAYDREAM_PHONE: 'Teléfono listo para Daydream',
  13779. VR_GOOGLE_DAYDREAM: 'Daydream de Google',
  13780. VR_APP: 'port VR App',
  13781. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13782. VR_APP_FOR_ANDROID: 'Aplicación port VR para Teléfonos Android',
  13783. VR_APP_OPEN: 'Abrir con la aplicación port VR en su lugar',
  13784. VR_VIEW_SPACE: 'Ver Espacio en realidad virtual',
  13785. VR_LEARN_MORE_CAPS: 'SABER MÁS',
  13786. VR_PREVIOUS_CAPS: 'ANTERIOR',
  13787. VR_NEXT_CAPS: 'SIGUIENTE',
  13788. VR_GOT_IT_CAPS: 'COMPRENDIDO',
  13789. VR_SHOW_SUPPORTED: 'Pulse para ver el Espacio en realidad virtual con',
  13790. VR_SHOW_UNSUPPORTED: 'Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.',
  13791. VR_SHOW_IOS_1: 'Pulse para ver el Espacio en realidad virtual',
  13792. VR_SHOW_IOS_2: 'Necesita la aplicación port VR y un iPhone compatible para ver',
  13793. VR_WHAT_YOU_NEED: 'Lo que necesitaras...',
  13794. VR_NEED_CARDBOARD: 'Lo que necesitaras con Google Cardboard',
  13795. VR_NEED_SAMSUNG: 'Lo que necesitaras con el Samsung Gear VR',
  13796. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  13797. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  13798. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  13799. VR_COMPATIBLE_IPHONES_2: 'Compatible con iPhone 6S o superior y con iOS 9.1 en adelante',
  13800. VR_COMPATIBLE_IPHONES_3: 'iPhones compatibles',
  13801. VR_COMPATIBLE_ANDROID: 'Dispositivos Android compatibles',
  13802. VR_ANDROID_DETAIL: 'Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante',
  13803. VR_ANDROID_DVICES: 'Dispositivos Android',
  13804. VR_COMPATIBLE_SAMSUNG: 'Dispositivos compatibles del Samsung',
  13805. VR_SAMSUNG_DETAIL: 'Galaxy S5 en adelante',
  13806. VR_APP_FOR_CARDBOARD: 'Aplicación port VR para Google Cardboard',
  13807. VR_APP_FOR_SAMSUNG: 'Aplicación port VR para Gear VR',
  13808. VR_DOWNLOAD_HERE: 'Descargar aquí',
  13809. VR_REQUIRE_HEADSET: 'Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android',
  13810. VR_REDIRECT_TO_STORE: 'Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.',
  13811. VR_IMPROPER_EMBED: 'El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.',
  13812. VR_OPEN_ANDROID_LINK: 'Abre el enlace en tu teléfono móvil',
  13813. VR_ANDROID_OPTIONS: 'Opciones de auriculares en RV disponibles',
  13814. SHARE_TO: 'Compartir en',
  13815. SHARE_LINK: 'Enlace directo',
  13816. SHARE_EXPLORE: 'Explorar ',
  13817. SHARE_AT: 'en',
  13818. SHARE_WITH: 'con',
  13819. SHARE_3D: ' en 3D',
  13820. SHARE_COPIED: '¡Copiado!',
  13821. ERROR_BROWSER_SOLUTION: 'Instale un nuevo navegador para explorar en 3D.',
  13822. ERROR_BROWSER_EXPLANATION: 'WebGL requiere un navegador moderno.',
  13823. ERROR_GENERIC_PROBLEM: 'Vaya, algo ha ido mal.',
  13824. ERROR_GENERIC_SOLUTION: 'Reinicie su navegador.',
  13825. ERROR_GENERIC_ACTIONS_1: 'Si el problema persiste, ',
  13826. ERROR_GENERIC_ACTIONS_2: 'instale un navegador compatible',
  13827. ERROR_GENERIC_ACTIONS_3: ' o ',
  13828. ERROR_GENERIC_ACTIONS_4: 'consulte nuestra guía de solución de problemas',
  13829. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Navegador no compatible.',
  13830. ERROR_WEBGL_IOS_PROBLEM: 'Versión de iOS no compatible.',
  13831. ERROR_WEBGL_IOS_SOLUTION: 'Actualice a iOS 8 o superior para explorar en 3D.',
  13832. ERROR_WEBGL_IOS_ACTIONS_1: 'Pulse ',
  13833. ERROR_WEBGL_IOS_ACTIONS_2: 'Ajustes > General > Actualización de software',
  13834. ERROR_WEBGL_SAFARI_PROBLEM: 'Habilite WebGL para explorar en 3D.',
  13835. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Haga clic en ',
  13836. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Preferencias > Avanzado > Mostrar el menú Desarrollar',
  13837. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Después, haga clic en ',
  13838. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Desarrollar > Habilitar WebGL',
  13839. ERROR_MISSING_URLS_PROBLEM: 'Vaya, no hay panoramas para este modelo.',
  13840. ERROR_MISSING_URLS_EXPLANATION: 'Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.',
  13841. ERROR_LOADING_FAILED_PROBLEM: 'Vaya, modelo no disponible.',
  13842. ERROR_LOADING_FAILED_ACTIONS_1: 'Si el problema persiste, ',
  13843. ERROR_LOADING_FAILED_ACTIONS_2: 'consulte nuestra guía de solución de problemas',
  13844. ERROR_MAINTENANCE_PROBLEM: 'Mantenimiento en progreso.',
  13845. ERROR_MAINTENANCE_SOLUTION: 'Regrese en unos minutos.',
  13846. LINK_TO_LOCATION: 'Enlace a la ubicación',
  13847. MENU_COPY: 'Copiar',
  13848. LINK_ALERT_COPY: 'Utilice CTRL/CMD + C para copiar.',
  13849. ROTATE: 'Girar',
  13850. INSIDE: 'Interior',
  13851. MOVE: 'Moverse',
  13852. ZOOM: 'Acercar o alejar'
  13853. }
  13854. },
  13855. {}
  13856. ],
  13857. 113: [
  13858. function (e, t, i) {
  13859. 'use strict'
  13860. t.exports = {
  13861. PAGE_TITLE: '',
  13862. LOADING: 'Chargement',
  13863. PRESENTED_BY_CAPS: 'PRÉSENTÉ PAR',
  13864. POWERED_BY: 'alimenté par ',
  13865. POWERED_BY_CAPS: 'ALIMENTÉ PAR',
  13866. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13867. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13868. PRESENTED_BY: 'Présenté par ',
  13869. MORE: 'Plus ',
  13870. LESS: 'Moins ',
  13871. TAG_CONTENT: 'Contenu tag™',
  13872. SHOW: 'Montrer',
  13873. HIDE: 'Cacher',
  13874. DOLLHOUSE: 'Dollhouse',
  13875. FLOOR_PLAN: 'Plan de sol',
  13876. OPEN_HIGHLIGHTS: 'Ouvrir les faits saillants',
  13877. CLOSE_HIGHLIGHTS: 'Fermer',
  13878. PREVIOUS: 'Précédent',
  13879. PLAY: 'Lecture',
  13880. PAUSE: 'Pause',
  13881. NEXT: 'Suivant',
  13882. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13883. VIEW_DOLLHOUSE: 'Voir dollhouse',
  13884. SOCIAL_SHARING: 'Partager cet espace',
  13885. VIEW_IN_VR: 'Voir en VR',
  13886. VIEW_FULLSCREEN: 'Plein écran',
  13887. EXIT_FULLSCREEN: 'Fermer plein écran',
  13888. ZOOM_IN: 'Zoom avant',
  13889. ZOOM_OUT: 'Zoom arrière',
  13890. FLOOR_NAME: 'Étage ',
  13891. FLOOR_ALL: 'Tous',
  13892. TERMS: 'Mentions légales',
  13893. PORT_TERMS: 'port mentions légales',
  13894. TERMS_OF_USE: "Conditions d'utilisation",
  13895. TERMS_TEXT_FILE: 'terms-fr-FR.html',
  13896. CLOSE_TERMS: 'Fermer',
  13897. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13898. HELP: 'Aide',
  13899. HELP_NAVIGATION_TAB: 'Navigation',
  13900. HELP_MORE_HELP_TAB: 'Aide',
  13901. CLOSE: 'Fermer',
  13902. HELP_DESKTOP_PANORAMA_1A: 'Cliquez et faites glisser pour regarder autour de l’espace.',
  13903. HELP_DESKTOP_PANORAMA_2A: 'Cliquez sur les anneaux pour vous déplacer.',
  13904. HELP_DESKTOP_PANORAMA_3A: 'Utilisez la molette de votre souris pour zoomer.',
  13905. HELP_DESKTOP_PANORAMA_1B: 'Ou utilisez les touches pour tourner.',
  13906. HELP_DESKTOP_PANORAMA_2B: 'Ou utilisez les touches pour avancer et reculer.',
  13907. HELP_DESKTOP_PANORAMA_3B: 'Ou utilisez les touches plus et moins pour zoomer.',
  13908. HELP_DESKTOP_360_2A: 'Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.',
  13909. HELP_DESKTOP_360_2B: 'Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.',
  13910. HELP_DESKTOP_DOLLHOUSE_1A: 'Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.',
  13911. HELP_DESKTOP_DOLLHOUSE_2A: 'Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.',
  13912. HELP_DESKTOP_DOLLHOUSE_3A: 'Utilisez la molette de votre souris pour zoomer.',
  13913. HELP_DESKTOP_DOLLHOUSE_1B: 'Ou utilisez les touches pour faire pivoter la vue Dollhouse.',
  13914. HELP_DESKTOP_FLOORPLAN_1A: 'Faites un clic droit pour changer la position du plan sur l’écran.',
  13915. HELP_DESKTOP_FLOORPLAN_2A: 'Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.',
  13916. HELP_DESKTOP_FLOORPLAN_3A: 'Utilisez la molette de votre souris pour zoomer.',
  13917. HELP_DESKTOP_FLOORPLAN_2B: 'Ou utilisez les touches pour faire pivoter à gauche ou à droite.',
  13918. HELP_DESKTOP_FLOORPLAN_3B: 'Ou utilisez les touches pour effectuer un zoom avant ou arrière.',
  13919. HELP_MOBILE_PANORAMA_1: 'Touchez et faites glisser pour regarder autour de l’espace.',
  13920. HELP_MOBILE_PANORAMA_2: 'Tapez sur les anneaux dans tout l’espace pour vous déplacer.',
  13921. HELP_MOBILE_3: 'Utilisez un geste de pincement pour zoomer avant/arrière.',
  13922. HELP_MOBILE_360_2: 'Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.',
  13923. HELP_MOBILE_DOLLHOUSE_1: 'Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.',
  13924. HELP_MOBILE_DOLLHOUSE_2: 'Touchez et faites glisser avec deux doigts pour positionner vue en coupe.',
  13925. HELP_MOBILE_FLOORPLAN_1: 'Touchez et faites glisser pour positionner le plan.',
  13926. HELP_MOBILE_FLOORPLAN_2: 'Touchez et faites glisser avec deux doigts pour faire pivoter le plan.',
  13927. HELP_MORE_HLR_A: 'Carrousel',
  13928. HELP_DESKTOP_MORE_HLR_B: 'Ouvrez pour naviguer dans l’espace en utilisant les vignettes.',
  13929. HELP_MORE_DOLLHOUSE_A: 'Vue en coupe',
  13930. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'Cliquez pour afficher et faire pivoter l’espace entier en 3D.',
  13931. HELP_MOBILE_MORE_DOLLHOUSE_B: 'Tapez pour afficher et faire pivoter l’espace entier en 3D.',
  13932. HELP_MORE_FLOORS_A: 'Sélecteur d’étage',
  13933. HELP_DESKTOP_MORE_FLOORS_B: 'Basculer entre les étages dans l’espace.',
  13934. HELP_MORE_TAG_A: 'tag™ Posts',
  13935. HELP_DESKTOP_MORE_TAG_B: 'Cliquez ou survolez pour obtenir des informations sur l’espace.',
  13936. HELP_MOBILE_MORE_TAG_B: 'Tapez pour obtenir des informations sur l’espace.',
  13937. HELP_MORE_ZOOM_A: 'Commandes de zoom',
  13938. HELP_DESKTOP_MORE_ZOOM_B: 'Utilisez votre clavier ou la molette de votre souris pour zoomer.',
  13939. HELP_MORE_TOUR_A: 'Commandes de la visite',
  13940. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13941. HELP_MORE_INSIDE_A: 'Vue intérieure',
  13942. HELP_DESKTOP_MORE_INSIDE_B: 'Cliquez pour explorer l’intérieur de l’espace.',
  13943. HELP_MOBILE_MORE_INSIDE_B: 'Tapez pour explorer l’intérieur de l’espace.',
  13944. HELP_MORE_VR_A: 'Mode RV',
  13945. HELP_DESKTOP_MORE_VR_B: 'Cliquez pour lancer l’espace en réalité virtuelle.',
  13946. HELP_MOBILE_MORE_VR_B: 'Tapez pour lancer l’espace en réalité virtuelle.',
  13947. HELP_MORE_360_A: 'Vues 360°',
  13948. HELP_DESKTOP_MORE_360_B: 'Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.',
  13949. HELP_MOBILE_MORE_360_B: 'Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.',
  13950. HELP_MORE_FULLSCREEN_A: 'Plein écran',
  13951. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Voir 3D Showcase en plein écran.',
  13952. WEBVR_FOR_CARDBOARD: 'Pour Google Cardboard',
  13953. WEBVR_FOR_DAYDREAM: 'Pour Daydream View',
  13954. WEBVR_ENTER_WEBVR: 'ENTRER VR',
  13955. WEBVR_DIFFERENT_HEADSET: 'Avez-vous un casque différent?',
  13956. WEBVR_LEARN_MORE: 'En savoir plus',
  13957. WEBVR_VIEW_SPACE: 'Voir Espace en VR',
  13958. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  13959. WEBVR_DAYDREAM_PHONE: 'Téléphone compatibles Daydream',
  13960. WEBVR_VIEW_CARDBOARD: 'Ou Afficher sur Google Cardboard',
  13961. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13962. VR_LEARN_MORE_CAPS: 'EN SAVOIR PLUS',
  13963. VR_PREVIOUS_CAPS: 'PRÉCÉDENT',
  13964. VR_NEXT_CAPS: 'SUIVANT',
  13965. VR_GOT_IT_CAPS: 'BIEN COMPRIS',
  13966. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13967. VR_SHOW_UNSUPPORTED: 'Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.',
  13968. VR_SHOW_IOS_1: 'Taper pour voir l’Espace en Realité Virtuelle',
  13969. VR_SHOW_IOS_2: 'Nécessite l’application port VR et un iPhone compatible pour voir',
  13970. VR_WHAT_YOU_NEED: 'Ce dont vous aurez besoin pour...',
  13971. VR_NEED_CARDBOARD: 'Ce dont vous aurez besoin avec Google Cardboard',
  13972. VR_NEED_SAMSUNG: 'Ce dont vous aurez besoin avec Samsung Gear VR',
  13973. VR_NEED_DAYDREAM: 'BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW',
  13974. VR_NEED_DAYDREAM_PHONE: 'Téléphone compatible avec Daydream',
  13975. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  13976. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  13977. VR_APP: 'port VR App',
  13978. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  13979. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  13980. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s et plus récent, avec iOS 9.1 et plus récent',
  13981. VR_COMPATIBLE_IPHONES_3: 'iPhones compatibles',
  13982. VR_COMPATIBLE_ANDROID: 'Appareils Android compatibles',
  13983. VR_COMPATIBLE_ANDROID_LONG: 'Compatible avec les écrans des appareils Android de 11,5 à 14 cm (4,5 à 5,5 po) fonctionnant sous Android OS 4.4.4 et plus',
  13984. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13985. VR_ANDROID_DVICES: 'Appareils Android',
  13986. VR_COMPATIBLE_SAMSUNG: 'Appareils Samsung Compatibles',
  13987. VR_SAMSUNG_DETAIL: 'Galaxy S6 et plus récents',
  13988. VR_APP_FOR_CARDBOARD: 'Application port VR pour Google Cardboard',
  13989. VR_APP_FOR_SAMSUNG: 'Application port VR pour Gear VR',
  13990. VR_APP_FOR_ANDROID: 'Application port VR pour téléphones Android',
  13991. VR_APP_OPEN: 'Ouvrir plutôt avec l’application port VR',
  13992. VR_DOWNLOAD_HERE: 'Télécharger ici',
  13993. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13994. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13995. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13996. VR_OPEN_ANDROID_LINK: 'Ouvrez ce lien avec votre appareil mobile',
  13997. VR_ANDROID_OPTIONS: 'Options disponibles pour casque VR sous',
  13998. SHARE_TO: 'Partager sur',
  13999. SHARE_LINK: 'Lien direct',
  14000. SHARE_EXPLORE: 'Explorer ',
  14001. SHARE_AT: 'à',
  14002. SHARE_WITH: 'avec',
  14003. SHARE_3D: ' en 3D',
  14004. SHARE_COPIED: 'Copié!',
  14005. ERROR_BROWSER_SOLUTION: 'Installer un nouveau navigateur pour explorer en 3D.',
  14006. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  14007. ERROR_GENERIC_PROBLEM: 'Il y eu un problème.',
  14008. ERROR_GENERIC_SOLUTION: 'Redémarrer votre navigateur.',
  14009. ERROR_GENERIC_ACTIONS_1: 'Si le problème persiste, ',
  14010. ERROR_GENERIC_ACTIONS_2: 'installez un navigateur plus récent',
  14011. ERROR_GENERIC_ACTIONS_3: ' ou ',
  14012. ERROR_GENERIC_ACTIONS_4: 'voir notre guide de dépannage',
  14013. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Navigateur non-supporté.',
  14014. ERROR_WEBGL_IOS_PROBLEM: 'Version iOS non-supportée.',
  14015. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  14016. ERROR_WEBGL_IOS_ACTIONS_1: 'Tapez ',
  14017. ERROR_WEBGL_IOS_ACTIONS_2: 'Paramètres > Général > Mise à jour Software',
  14018. ERROR_WEBGL_SAFARI_PROBLEM: 'Activez WegGL pour explorer en 3D.',
  14019. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Cliquez ',
  14020. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Préferences > Avancés > Voir menu développeur',
  14021. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Puis cliquez ',
  14022. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Développe > Activé WebGL',
  14023. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  14024. ERROR_MISSING_URLS_EXPLANATION: 'Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.',
  14025. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  14026. ERROR_LOADING_FAILED_ACTIONS_1: 'Si le problème persiste, ',
  14027. ERROR_LOADING_FAILED_ACTIONS_2: 'voir notre guide de dépannage',
  14028. ERROR_MAINTENANCE_PROBLEM: 'Maintenance en cours.',
  14029. ERROR_MAINTENANCE_SOLUTION: 'Revenez dans quelques instants.',
  14030. LINK_TO_LOCATION: "Lien vers l'emplacement",
  14031. MENU_COPY: 'Copie',
  14032. LINK_ALERT_COPY: 'Utiliser CTRL+CMD C pour copier.',
  14033. ROTATE: 'Faire pivoter',
  14034. INSIDE: 'Intérieure',
  14035. MOVE: 'Se déplacer',
  14036. ZOOM: 'Zoom'
  14037. }
  14038. },
  14039. {}
  14040. ],
  14041. 114: [
  14042. function (e, t, i) {
  14043. 'use strict'
  14044. t.exports = {
  14045. PAGE_TITLE: '',
  14046. LOADING: '読み込み中',
  14047. PRESENTED_BY_CAPS: 'PRESENTED BY',
  14048. POWERED_BY: 'powered by',
  14049. POWERED_BY_CAPS: 'POWERED BY',
  14050. DESKTOP_SHORT_CTA: 'クリックしてこの3D Spaceを探索',
  14051. MOBILE_SHORT_CTA: 'タップしてこの3D Spaceを探索',
  14052. PRESENTED_BY: 'Presented by ',
  14053. MORE: '全て表示 ',
  14054. LESS: '閉じる ',
  14055. TAG_CONTENT: 'tag™コンテンツ ',
  14056. SHOW: '表示',
  14057. HIDE: '非表示',
  14058. DOLLHOUSE: 'ドールハウス',
  14059. FLOOR_PLAN: 'フロアプラン',
  14060. OPEN_HIGHLIGHTS: 'ハイライトを開く',
  14061. CLOSE_HIGHLIGHTS: '閉じる',
  14062. PREVIOUS: '前へ',
  14063. PLAY: '再生',
  14064. PAUSE: '一時停止',
  14065. NEXT: '次へ',
  14066. EXPLORE_3D_SPACE: '3DSpaceの探索',
  14067. VIEW_DOLLHOUSE: 'ドールハウスの表示',
  14068. SOCIAL_SHARING: 'このSpaceを共有する',
  14069. VIEW_IN_VR: 'VRで表示',
  14070. VIEW_FULLSCREEN: 'フルスクリーン表示',
  14071. EXIT_FULLSCREEN: 'フルスクリーン表示を終了',
  14072. ZOOM_IN: 'ズームイン',
  14073. ZOOM_OUT: 'ズームアウト',
  14074. FLOOR_NAME: 'フロア ',
  14075. FLOOR_ALL: 'すべて',
  14076. TERMS: '規約',
  14077. PORT_TERMS: 'port規約',
  14078. TERMS_OF_USE: '利用規約',
  14079. CLOSE_TERMS: '閉じる',
  14080. TERMS_TEXT_FILE: 'terms-jp-JP.html',
  14081. TERMS_FAIL: '規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。',
  14082. WEBVR_FOR_DAYDREAM: 'Daydream View用',
  14083. WEBVR_ENTER_WEBVR: 'VRに入る',
  14084. WEBVR_DIFFERENT_HEADSET: '別のヘッドセットをお持ちですか?',
  14085. WEBVR_LEARN_MORE: 'もっと詳しく',
  14086. WEBVR_VIEW_SPACE: 'VRでSpaceを表示',
  14087. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  14088. WEBVR_DAYDREAM_PHONE: 'Daydream対応スマホ',
  14089. WEBVR_FOR_CARDBOARD: 'Google Cardboard用',
  14090. WEBVR_VIEW_CARDBOARD: 'またはGoogle Cardboardで表示',
  14091. VR_VIEW_SPACE: 'バーチャルリアリティでSpaceを表示',
  14092. VR_LEARN_MORE_CAPS: 'もっと詳しく',
  14093. VR_PREVIOUS_CAPS: '前へ',
  14094. VR_NEXT_CAPS: '次へ',
  14095. VR_GOT_IT_CAPS: '了解',
  14096. VR_SHOW_SUPPORTED: 'タップして次を使用してVRでSpaceを表示: ',
  14097. VR_SHOW_UNSUPPORTED: 'お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません',
  14098. VR_SHOW_IOS_1: 'タップしてVRでSpaceを表示',
  14099. VR_SHOW_IOS_2: '表示するにはport VRアプリと互換性のあるiPhoneが必要です',
  14100. VR_WHAT_YOU_NEED: '必要なもの',
  14101. VR_NEED_CARDBOARD: 'Google Cardboardに必要なもの',
  14102. VR_NEED_SAMSUNG: 'Samsung Gear VRに必要なもの',
  14103. VR_NEED_DAYDREAM: '事前にDaydream Viewとのペアリングが必要です',
  14104. VR_NEED_DAYDREAM_PHONE: 'Daydream対応スマホ',
  14105. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  14106. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  14107. VR_APP: 'port VRアプリ',
  14108. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  14109. VR_COMPATIBLE_IPHONES_1: 'iPhone',
  14110. VR_COMPATIBLE_IPHONES_2: 'iOS 9.1以降で動作するiPhone 5s以降のモデル',
  14111. VR_COMPATIBLE_IPHONES_3: '互換性のあるiPhone',
  14112. VR_COMPATIBLE_ANDROID: '互換性のあるAndroidデバイス',
  14113. VR_COMPATIBLE_ANDROID_LONG: 'Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ',
  14114. VR_ANDROID_DETAIL: 'Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ',
  14115. VR_ANDROID_DVICES: 'Androidデバイス',
  14116. VR_COMPATIBLE_SAMSUNG: '互換性のあるSamsungデバイス',
  14117. VR_SAMSUNG_DETAIL: 'Galaxy S5以降のモデル',
  14118. VR_APP_FOR_CARDBOARD: 'Google Cardboard用のport VRアプリ',
  14119. VR_APP_FOR_SAMSUNG: 'Gear VR 用のport VRアプリ',
  14120. VR_APP_FOR_ANDROID: 'Androidフォン用のport VRアプリ',
  14121. VR_APP_OPEN: 'port VRアプリで開く',
  14122. VR_DOWNLOAD_HERE: 'ここからダウンロード',
  14123. VR_REQUIRE_HEADSET: 'Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります',
  14124. VR_REDIRECT_TO_STORE: 'アプリがインストールされていない場合、App Storeにリダイレクトされます',
  14125. VR_IMPROPER_EMBED: 'お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。',
  14126. VR_OPEN_ANDROID_LINK: 'お使いの携帯電話でリンクを開いてください',
  14127. VR_ANDROID_OPTIONS: '利用可能なVRヘッドセットオプション',
  14128. SHARE_TO: '共有先',
  14129. SHARE_LINK: 'ダイレクトリンク',
  14130. SHARE_EXPLORE: '探索',
  14131. SHARE_AT: '場所',
  14132. SHARE_WITH: '使用アプリ',
  14133. SHARE_3D: '3Dで',
  14134. SHARE_COPIED: 'コピーされました!',
  14135. ERROR_BROWSER_SOLUTION: '3D探索するには、新しいバージョンのブラウザをインストールしてください',
  14136. ERROR_BROWSER_EXPLANATION: 'WebGLにはモダンブラウザが必要です。',
  14137. ERROR_GENERIC_PROBLEM: '問題が発生しました。',
  14138. ERROR_GENERIC_SOLUTION: 'ブラウザを再起動してください。',
  14139. ERROR_GENERIC_ACTIONS_1: '問題が解決しない場合は、',
  14140. ERROR_GENERIC_ACTIONS_2: 'サポートされているブラウザをインストールしてください',
  14141. ERROR_GENERIC_ACTIONS_3: 'または',
  14142. ERROR_GENERIC_ACTIONS_4: 'トラブルシューティングガイドを参照してください',
  14143. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'ブラウザがサポートされていません。',
  14144. ERROR_WEBGL_IOS_PROBLEM: 'サポートされていないiOSバージョンです。',
  14145. ERROR_WEBGL_IOS_SOLUTION: '3D探索するには、iOS 8以降にアップグレードしてください。',
  14146. ERROR_WEBGL_IOS_ACTIONS_1: '以下の順にタップします:',
  14147. ERROR_WEBGL_IOS_ACTIONS_2: '設定 > 全般 > ソフトウェアの更新',
  14148. ERROR_WEBGL_SAFARI_PROBLEM: 'WebGLを有効にして3Dで探索します。',
  14149. ERROR_WEBGL_SAFARI_ACTIONS_1: '以下の順にクリックします:',
  14150. ERROR_WEBGL_SAFARI_ACTIONS_2: '環境設定 > 詳細 > メニューバーに開発メニューを表示',
  14151. ERROR_WEBGL_SAFARI_ACTIONS_3: 'その後、以下の順にクリックします:',
  14152. ERROR_WEBGL_SAFARI_ACTIONS_4: '開発 > WebGLを有効にする',
  14153. ERROR_MISSING_URLS_PROBLEM: 'このモデルではパノラマを使用できません。',
  14154. ERROR_MISSING_URLS_EXPLANATION: 'これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。',
  14155. ERROR_LOADING_FAILED_PROBLEM: 'モデルは利用できません。',
  14156. ERROR_LOADING_FAILED_ACTIONS_1: '問題が解決しない場合は、',
  14157. ERROR_LOADING_FAILED_ACTIONS_2: 'トラブルシューティングガイドを参照してください',
  14158. ERROR_MAINTENANCE_PROBLEM: 'メンテナンスは進行中です。',
  14159. ERROR_MAINTENANCE_SOLUTION: 'しばらくしてからやり直し てください。',
  14160. LINK_TO_LOCATION: 'ロケーションへのリンク',
  14161. MENU_COPY: 'コピー',
  14162. LINK_ALERT_COPY: 'コピーするにはCTRL/CMD + Cを使用してください。',
  14163. ROTATE: '回転',
  14164. MOVE: '移動',
  14165. INSIDE: '内側',
  14166. ZOOM: 'ズーム',
  14167. HELP: 'ヘルプ',
  14168. HELP_NAVIGATION_TAB: 'ナビゲーション',
  14169. HELP_MORE_HELP_TAB: 'その他のヘルプ',
  14170. HELP_DESKTOP_PANORAMA_1A: 'Spaceを見回すには、クリックしてドラッグします。',
  14171. HELP_DESKTOP_PANORAMA_2A: '移動するには、Space全体にあるリングをクリックします。',
  14172. HELP_DESKTOP_PANORAMA_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  14173. HELP_DESKTOP_PANORAMA_1B: 'または、矢印キーを使用して左右に向きを変えます。',
  14174. HELP_DESKTOP_PANORAMA_2B: 'または、矢印キーを使用して前後に向きを変えます。',
  14175. HELP_DESKTOP_PANORAMA_3B: 'あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。',
  14176. HELP_DESKTOP_360_2A: '内側ビューアイコンをクリックしてSpaceに入ります。',
  14177. HELP_DESKTOP_360_2B: 'または、数字キー1を押して内側ビューに入ります。',
  14178. HELP_DESKTOP_DOLLHOUSE_1A: '左クリックと左右、上下のドラッグでドールハウスを回転します。',
  14179. HELP_DESKTOP_DOLLHOUSE_2A: '右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。',
  14180. HELP_DESKTOP_DOLLHOUSE_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  14181. HELP_DESKTOP_DOLLHOUSE_1B: 'または、矢印キーを使用してドールハウスを回転します。',
  14182. HELP_DESKTOP_FLOORPLAN_1A: '左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。',
  14183. HELP_DESKTOP_FLOORPLAN_2A: '右ボタンを押しながら左右にドラッグして、フロアプランを回転します。',
  14184. HELP_DESKTOP_FLOORPLAN_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  14185. HELP_DESKTOP_FLOORPLAN_2B: 'または、矢印キーを使用して左右に回転します。',
  14186. HELP_DESKTOP_FLOORPLAN_3B: 'または、矢印キーを使用して、ズームイン、ズームアウトします。',
  14187. HELP_MOBILE_PANORAMA_1: 'Spaceを見回すには、タッチしてドラッグします。',
  14188. HELP_MOBILE_PANORAMA_2: '移動するには、Space全体にあるリングをタップします。',
  14189. HELP_MOBILE_3: 'ピンチジェスチャーを使用してズームイン、ズームアウトします。',
  14190. HELP_MOBILE_360_2: '内側ビューアイコンをタップしてSpaceに入ります。',
  14191. HELP_MOBILE_DOLLHOUSE_1: 'タッチして上下左右にドラッグしてドールハウスを回転します。',
  14192. HELP_MOBILE_DOLLHOUSE_2: 'タッチして、2本指でドラッグしてドールハウスを配置します。',
  14193. HELP_MOBILE_FLOORPLAN_1: 'タッチ&ドラッグしてフロアプランを配置します。',
  14194. HELP_MOBILE_FLOORPLAN_2: 'タッチして、2本指でドラッグしてフロアプランを回転します。',
  14195. HELP_MORE_HLR_A: 'ハイライト',
  14196. HELP_DESKTOP_MORE_HLR_B: 'サムネイル画像を使用してSpaceを移動するために開きます。',
  14197. HELP_MORE_DOLLHOUSE_A: 'ドールハウス',
  14198. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'クリックして3DでSpace全体のトップダウンビューを表示して回転します。',
  14199. HELP_MOBILE_MORE_DOLLHOUSE_B: 'タップして3DでSpace全体のトップダウンビューを表示して回転します。',
  14200. HELP_MORE_FLOORS_A: 'フロアセレクター',
  14201. HELP_DESKTOP_MORE_FLOORS_B: 'Space内のフロアを切り替えます。',
  14202. HELP_MORE_TAG_A: 'tag™ Posts',
  14203. HELP_DESKTOP_MORE_TAG_B: 'クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。',
  14204. HELP_MOBILE_MORE_TAG_B: 'タップするとSpace内の機能についての説明が表示されます。',
  14205. HELP_MORE_ZOOM_A: 'ズームコントロール',
  14206. HELP_DESKTOP_MORE_ZOOM_B: 'これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。',
  14207. HELP_MORE_TOUR_A: 'ツアーコントロール',
  14208. HELP_DESKTOP_MORE_TOUR_B: 'ガイド付きツアー中に再生、一時停止、前方・後方に移動します。',
  14209. HELP_MORE_INSIDE_A: '内側ビュー',
  14210. HELP_DESKTOP_MORE_INSIDE_B: 'クリックしてSpace内を探索します。',
  14211. HELP_MOBILE_MORE_INSIDE_B: 'タップしてSpace内を探索します。',
  14212. HELP_MORE_VR_A: 'VRモード',
  14213. HELP_DESKTOP_MORE_VR_B: 'クリックしてバーチャルリアリティでSpaceを起動します。',
  14214. HELP_MOBILE_MORE_VR_B: 'タップしてバーチャルリアリティでSpaceを起動します。',
  14215. HELP_MORE_360_A: '360° Views',
  14216. HELP_DESKTOP_MORE_360_B: 'Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。',
  14217. HELP_MOBILE_MORE_360_B: 'Highlight Reelの360° Viewsをタップして屋外シーンを表示します。',
  14218. HELP_MORE_FULLSCREEN_A: 'フルスクリーン',
  14219. HELP_DESKTOP_MORE_FULLSCREEN_B: '3D Showcaseをフルスクリーン表示にします。',
  14220. CLOSE: '閉じる'
  14221. }
  14222. },
  14223. {}
  14224. ],
  14225. 115: [
  14226. function (e, t, i) {
  14227. 'use strict'
  14228. t.exports = {
  14229. PAGE_TITLE: '',
  14230. LOADING: 'Загрузка',
  14231. PRESENTED_BY_CAPS: 'ПРЕДСТАВЛЕНО',
  14232. POWERED_BY: 'разработано на платформе ',
  14233. POWERED_BY_CAPS: 'РАЗРАБОТАНО НА ПЛАТФОРМЕ',
  14234. DESKTOP_SHORT_CTA: 'Нажмите для просмотра.',
  14235. MOBILE_SHORT_CTA: 'Нажмите для просмотра.',
  14236. PRESENTED_BY: 'Представлено ',
  14237. MORE: 'Больше ',
  14238. LESS: 'Меньше ',
  14239. TAG_CONTENT: 'tag™ Контент',
  14240. SHOW: 'Показать',
  14241. HIDE: 'Скрыть',
  14242. DOLLHOUSE: 'Dollhouse',
  14243. FLOOR_PLAN: 'Планировка',
  14244. OPEN_HIGHLIGHTS: 'Открыть Фотоколлаж',
  14245. CLOSE_HIGHLIGHTS: 'Закрыть',
  14246. PREVIOUS: 'Предыдущий',
  14247. PLAY: 'Воспроизвести',
  14248. PAUSE: 'Пауза',
  14249. NEXT: 'Следующий',
  14250. EXPLORE_3D_SPACE: 'Просмотреть 3D модель',
  14251. VIEW_DOLLHOUSE: 'Посмотреть Dollhouse',
  14252. SOCIAL_SHARING: 'Поделиться этой моделью',
  14253. VIEW_IN_VR: 'Посмотреть в VR',
  14254. VIEW_FULLSCREEN: 'Полный экран',
  14255. EXIT_FULLSCREEN: 'Выйти из полноэкранного режима',
  14256. ZOOM_IN: 'Увеличить',
  14257. ZOOM_OUT: 'Уменьшить',
  14258. FLOOR_NAME: 'Этаж ',
  14259. FLOOR_ALL: 'Все',
  14260. TERMS: 'Условия',
  14261. PORT_TERMS: 'Правила пользования',
  14262. TERMS_OF_USE: 'Условия использования',
  14263. TERMS_TEXT_FILE: 'terms-ru-RU.html',
  14264. CLOSE_TERMS: 'Закрыть',
  14265. TERMS_FAIL: 'Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.',
  14266. HELP: 'Помощь',
  14267. HELP_NAVIGATION_TAB: 'Навигация',
  14268. HELP_MORE_HELP_TAB: 'Доп. Помощь',
  14269. CLOSE: 'Закрыть',
  14270. HELP_DESKTOP_PANORAMA_1A: 'Нажмите и перетащите, чтобы осмотреть пространство вокруг.',
  14271. HELP_DESKTOP_PANORAMA_2A: 'Для передвижения по модели нажимайте на круги .',
  14272. HELP_DESKTOP_PANORAMA_3A: 'Используйте колесо прокрутки для увеличения и уменьшения.',
  14273. HELP_DESKTOP_PANORAMA_1B: 'Или используйте клавиши со стрелками для поворота влево и вправо.',
  14274. HELP_DESKTOP_PANORAMA_2B: 'Или используйте стрелки для перемещения вперед и назад.',
  14275. HELP_DESKTOP_PANORAMA_3B: 'Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.',
  14276. HELP_DESKTOP_360_2A: 'Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.',
  14277. HELP_DESKTOP_360_2B: 'или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.',
  14278. HELP_DESKTOP_DOLLHOUSE_1A: 'Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.',
  14279. HELP_DESKTOP_DOLLHOUSE_2A: 'Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.',
  14280. HELP_DESKTOP_DOLLHOUSE_3A: 'Используйте колесо прокрутки чтобы увеличить и уменьшить.',
  14281. HELP_DESKTOP_DOLLHOUSE_1B: 'Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.',
  14282. HELP_DESKTOP_FLOORPLAN_1A: 'Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.',
  14283. HELP_DESKTOP_FLOORPLAN_2A: 'Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.',
  14284. HELP_DESKTOP_FLOORPLAN_3A: 'Используйте колесо прокрутки чтобы увеличить и уменьшить.',
  14285. HELP_DESKTOP_FLOORPLAN_2B: 'Или используйте клавиши со стрелками для поворота влево или вправо.',
  14286. HELP_DESKTOP_FLOORPLAN_3B: 'Или используйте стрелки для увеличения и уменьшения.',
  14287. HELP_MOBILE_PANORAMA_1: 'Нажмите и перетащите, чтобы осмотреть модель.',
  14288. HELP_MOBILE_PANORAMA_2: 'Для передвижения по модели нажимайте на круги.',
  14289. HELP_MOBILE_3: 'Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.',
  14290. HELP_MOBILE_360_2: 'Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.',
  14291. HELP_MOBILE_DOLLHOUSE_1: 'Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.',
  14292. HELP_MOBILE_DOLLHOUSE_2: 'Нажмите и перетащите, чтобы расположить Dollhouse.',
  14293. HELP_MOBILE_FLOORPLAN_1: 'Нажмите и перетащите, чтобы расположить план здания.',
  14294. HELP_MOBILE_FLOORPLAN_2: 'Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.',
  14295. HELP_MORE_HLR_A: 'Фотоколлаж',
  14296. HELP_DESKTOP_MORE_HLR_B: 'Откройте для перемещения по модели, используя иконки изображений.',
  14297. HELP_MORE_DOLLHOUSE_A: 'Dollhouse',
  14298. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.',
  14299. HELP_MOBILE_MORE_DOLLHOUSE_B: 'Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.',
  14300. HELP_MORE_FLOORS_A: 'Выбор Этажа',
  14301. HELP_DESKTOP_MORE_FLOORS_B: 'Переключение между этажами.',
  14302. HELP_MORE_TAG_A: 'tag™ Posts',
  14303. HELP_DESKTOP_MORE_TAG_B: 'Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.',
  14304. HELP_MOBILE_MORE_TAG_B: 'Нажмите для получения информации о функциях.',
  14305. HELP_MORE_ZOOM_A: 'Масштаб',
  14306. HELP_DESKTOP_MORE_ZOOM_B: 'Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.',
  14307. HELP_MORE_TOUR_A: 'Управление Туром',
  14308. HELP_DESKTOP_MORE_TOUR_B: 'Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.',
  14309. HELP_MORE_INSIDE_A: 'Вид Изнутри',
  14310. HELP_DESKTOP_MORE_INSIDE_B: 'Нажмите, чтобы просмотреть модель изнутри.',
  14311. HELP_MOBILE_MORE_INSIDE_B: 'Нажмите, чтобы просмотреть модель изнутри.',
  14312. HELP_MORE_VR_A: 'Режим VR',
  14313. HELP_DESKTOP_MORE_VR_B: 'Нажмите, чтобы запустить модель в виртуальной реальности.',
  14314. HELP_MOBILE_MORE_VR_B: 'Нажмите, чтобы запустить модель в виртуальной реальности.',
  14315. HELP_MORE_360_A: '360° Views',
  14316. HELP_DESKTOP_MORE_360_B: 'Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.',
  14317. HELP_MOBILE_MORE_360_B: 'Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.',
  14318. HELP_MORE_FULLSCREEN_A: 'Полный экран',
  14319. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Развернуть 3D Showcase во весь экран.',
  14320. WEBVR_FOR_CARDBOARD: 'Для Google Cardboard',
  14321. WEBVR_FOR_DAYDREAM: 'Для просмотра в Daydream',
  14322. WEBVR_ENTER_WEBVR: 'ВОЙТИ В VR ',
  14323. WEBVR_DIFFERENT_HEADSET: 'Есть другой VR-шлем?',
  14324. WEBVR_LEARN_MORE: 'Узнать больше',
  14325. WEBVR_VIEW_SPACE: 'Запустить модель в VR',
  14326. WEBVR_DAYDREAM_VIEW: 'Посмотреть в Daydream',
  14327. WEBVR_DAYDREAM_PHONE: 'Daydream-готовый телефон',
  14328. WEBVR_VIEW_CARDBOARD: 'Или просмотреть в Google Cardboard',
  14329. VR_WHAT_YOU_NEED: 'Что Вам потребуется...',
  14330. VR_NEED_DAYDREAM_PHONE: 'Daydream-готовый телефон',
  14331. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  14332. VR_APP: 'port VR App',
  14333. VR_APP_OPEN: 'Или открыть через приложение port VR',
  14334. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  14335. VR_SAMSUNG_DETAIL: 'Galaxy S6 и выше',
  14336. VR_APP_FOR_ANDROID: 'Приложение port VR для Android',
  14337. VR_NEED_DAYDREAM: 'Необходимо для соединением с Daydream',
  14338. VR_VIEW_SPACE: 'Запустить модель в VR',
  14339. VR_LEARN_MORE_CAPS: 'УЗНАТЬ БОЛЬШЕ',
  14340. VR_PREVIOUS_CAPS: 'ПРЕДЫДУЩИЙ',
  14341. VR_NEXT_CAPS: 'СЛЕДУЮЩИЙ',
  14342. VR_GOT_IT_CAPS: 'ЯСНО',
  14343. VR_SHOW_SUPPORTED: 'Нажмите, чтобы просмотреть модель в VR с помощью',
  14344. VR_SHOW_UNSUPPORTED: 'Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.',
  14345. VR_SHOW_IOS_1: 'Нажмите, чтобы просмотреть модель в VR',
  14346. VR_SHOW_IOS_2: 'Для просмотра требуется приложение port VR и совместимый iPhone',
  14347. VR_NEED_CARDBOARD: 'Что Вам потребуется для Google Cardboard',
  14348. VR_NEED_SAMSUNG: 'Что Вам потребуется для Samsung Gear VR',
  14349. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  14350. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  14351. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  14352. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s или новее с iOS 9.1 и выше',
  14353. VR_COMPATIBLE_IPHONES_3: 'Совместимые модели iPhone',
  14354. VR_COMPATIBLE_ANDROID: 'Совместимые Android устройства',
  14355. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  14356. VR_ANDROID_DVICES: 'Android устройства',
  14357. VR_COMPATIBLE_SAMSUNG: 'Совместимые Samsung устройства',
  14358. VR_APP_FOR_CARDBOARD: 'Приложение port VR для Google Cardboard',
  14359. VR_APP_FOR_SAMSUNG: 'Приложение port VR для Gear VR',
  14360. VR_DOWNLOAD_HERE: 'Скачать здесь',
  14361. VR_REQUIRE_HEADSET: 'Требуется VR-шлем и установленное приложение port VR для Android',
  14362. VR_REDIRECT_TO_STORE: 'Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.',
  14363. VR_IMPROPER_EMBED: 'port модель не встроена должным образом для поддержки VR в вашем веб-браузере.',
  14364. VR_OPEN_ANDROID_LINK: 'Откройте ссылку на Вашем мобильном телефоне',
  14365. VR_ANDROID_OPTIONS: 'Доступные опции VR-шлемов',
  14366. SHARE_TO: 'Поделиться',
  14367. SHARE_LINK: 'Прямая ссылка',
  14368. SHARE_EXPLORE: 'просмотреть',
  14369. SHARE_AT: 'на',
  14370. SHARE_WITH: 'с',
  14371. SHARE_3D: 'в 3D',
  14372. SHARE_COPIED: 'Скопировано!',
  14373. ERROR_BROWSER_SOLUTION: 'установите новый браузер, чтобы просмотреть 3D пространство.',
  14374. ERROR_BROWSER_EXPLANATION: 'WebGL требует современный браузер.',
  14375. ERROR_GENERIC_PROBLEM: 'Ой, что-то пошло не так.',
  14376. ERROR_GENERIC_SOLUTION: 'Перезапустите браузер.',
  14377. ERROR_GENERIC_ACTIONS_1: 'Если проблема не устранена, ',
  14378. ERROR_GENERIC_ACTIONS_2: 'установите поддерживаемый браузер',
  14379. ERROR_GENERIC_ACTIONS_3: ' или ',
  14380. ERROR_GENERIC_ACTIONS_4: 'смотрите наше руководство по устранению неполадок',
  14381. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Браузер не поддерживается.',
  14382. ERROR_WEBGL_IOS_PROBLEM: 'iOS-версия не поддерживается.',
  14383. ERROR_WEBGL_IOS_SOLUTION: 'Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.',
  14384. ERROR_WEBGL_IOS_ACTIONS_1: 'Нажмите ',
  14385. ERROR_WEBGL_IOS_ACTIONS_2: 'Настройки > Общие > Обновление ПО',
  14386. ERROR_WEBGL_SAFARI_PROBLEM: 'Включите WebGL для 3D-просмотра.',
  14387. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Нажмите ',
  14388. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Настойки > Дополнения > Показывать меню “Разработка” в строке меню',
  14389. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Затем нажмите ',
  14390. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Разработка > Разрешить WebGL',
  14391. ERROR_MISSING_URLS_PROBLEM: 'Ой, для этой модели нет панорамы.',
  14392. ERROR_MISSING_URLS_EXPLANATION: 'Эта модель устарела. У владельца веб-сайта может быть новая модель.',
  14393. ERROR_LOADING_FAILED_PROBLEM: 'Ой, модель недоступна.',
  14394. ERROR_LOADING_FAILED_ACTIONS_1: 'Если проблема не устранена, ',
  14395. ERROR_LOADING_FAILED_ACTIONS_2: 'посмотрите наше руководство по устранению неполадок',
  14396. ERROR_MAINTENANCE_PROBLEM: 'Выполняется техническое обслуживание.',
  14397. ERROR_MAINTENANCE_SOLUTION: 'Пожалуйста, попробуйте снова через несколько минут.',
  14398. LINK_TO_LOCATION: 'Ссылка на местоположение',
  14399. MENU_COPY: 'Копировать',
  14400. LINK_ALERT_COPY: 'Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.',
  14401. ROTATE: 'Вращать',
  14402. MOVE: 'Передвигаться',
  14403. INSIDE: 'Вид изнутри',
  14404. ZOOM: 'Масштаб'
  14405. }
  14406. },
  14407. {}
  14408. ],
  14409. 116: [
  14410. function (e, t, i) {
  14411. //main.js
  14412. ;(function (t) {
  14413. 'use strict'
  14414. var modelProgressBase = 0.4
  14415. var progressUpdate = function (e) {
  14416. // 0 <= e <= 1
  14417. console.log('e1:' + e)
  14418. e = Math.round(modelProgressBase * e * 100)
  14419. console.log('e2:' + e)
  14420. var t = $('.progressbar')
  14421. t.find('.bar').css('width', e + '%')
  14422. t.find('.label').css('left', (t.width() * e) / 100 - 15 + 'px') //上面跟着的字的百分比
  14423. t.find('.perc').text(e + '%') //具体数字的百分比
  14424. }
  14425. $('#gui-loading').fadeIn(200)
  14426. progressUpdate(0.1)
  14427. var fileName = g_version ? 'modeldata.js' : 'someData.json'
  14428. $.ajax(g_Prefix + 'data/' + window.number + '/' + fileName + '?' + randomTime().getTime(), { dataType: 'json' })
  14429. .done(function (e) {
  14430. //改
  14431. var data = matcher(e)
  14432. data.files.templates[0] = g_Prefix + e.files.templates[0].replace('{{number}}', window.number)
  14433. data.user = {
  14434. is_authenticated: false,
  14435. flags: [
  14436. 'payment_show_past_due',
  14437. 'sc_imgopt_100',
  14438. 'mattertags',
  14439. 'labels',
  14440. 'fastly_v2_urls',
  14441. 'vr',
  14442. 'uhql',
  14443. 'sc_segment_100',
  14444. 'show_segment_metrics',
  14445. 'content_distribution',
  14446. 'workshop_webgl',
  14447. 'show360views',
  14448. 'showcase_vr',
  14449. 'ws_zooming',
  14450. 'model_settings',
  14451. 'ws_360snapshots',
  14452. 'img_multi_dl',
  14453. 'vrworkshop',
  14454. 'tag_links',
  14455. 'ws_img_multi_dl',
  14456. 'mattertag_links',
  14457. 'billing_tab_hidden',
  14458. 'static_cloud_ui',
  14459. 'metrics',
  14460. 'mattertag_media',
  14461. 'img_size_download',
  14462. 'show_360snapshots',
  14463. 'floorplan',
  14464. 'sc_tilegen_0',
  14465. 'showcase_webvr',
  14466. 'sc_mixpanel_0',
  14467. 'show_clickbait',
  14468. 'zooming',
  14469. 'showcase_tiling',
  14470. 'list_signed_urls_default_3',
  14471. 'fastly_image_opto'
  14472. ]
  14473. }
  14474. try {
  14475. //处理一下导览数据
  14476. data.model.images = data.model.images.filter(e => {
  14477. if (!e.locations && !e.thumbnail_signed_src) return //旧的曾有导览数据是错误的,将它删除
  14478. if (e.locations) e.locations = e.locations.filter(e => e)
  14479. if (e.locations && e.locations.length == 0) return
  14480. return e
  14481. })
  14482. } catch (e) {
  14483. console.log(e)
  14484. }
  14485. window.DATA = data
  14486. data.model.summary = data.summary
  14487. data.model.name = data.name
  14488. for (let i in data) {
  14489. data[i] == 'false' && (data[i] = false)
  14490. }
  14491. progressUpdate(0.7)
  14492. StartLoad() //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  14493. if (data.weixinDesc) {
  14494. g_weixinObj.desc = data.weixinDesc
  14495. }
  14496. if (data.shareImgUrl) {
  14497. g_weixinObj.imgUrl = data.shareImgUrl
  14498. }
  14499. window.wx && manage.weixinShare()
  14500. //初始画面
  14501. data.camera_start && data.camera_start.thumbImg && E(manage.dealURL(data.camera_start.thumbImg))
  14502. function E(e) {
  14503. $('<img/>')
  14504. .attr('src', e)
  14505. .on('load', function () {
  14506. $('#gui-thumb')
  14507. .css('backgroundImage', 'url(' + e + ')')
  14508. .fadeIn(500),
  14509. $(this).remove()
  14510. })
  14511. }
  14512. //背景
  14513. ;(settings.transparentBg = settings.transparentBg || data.transparentBg || false), (settings.bgImg = settings.bgImg || data.bgImg || null)
  14514. if (settings.bgImg) {
  14515. $('#player').css({ 'background-image': 'url(' + settings.bgImg + ')', 'background-position': 'center center' })
  14516. }
  14517. {
  14518. //初始化导览时间
  14519. if (DATA.tourBlackSpeed == void 0) DATA.tourBlackSpeed = 100
  14520. window._settings.warp.teleportTime = (settings.teleportTime / DATA.tourBlackSpeed) * 100
  14521. if (DATA.tourWalkSpeed == void 0) DATA.tourWalkSpeed = 100
  14522. if (DATA.tourRotTime == '' || DATA.tourRotTime == void 0) {
  14523. DATA.tourRotTime = settings.tourRotTime //默认停留2秒
  14524. }
  14525. settings.playTourNearBy = !DATA.tourFromStart
  14526. }
  14527. {
  14528. //其他
  14529. _settings.floorPlanAngle = DATA.floorPlanAngle || 0
  14530. _settings.angleShift2d = DATA.angleShift2d || 0
  14531. if (DATA.insideLookLimit) {
  14532. _settings.insideLookLimitDown = DATA.insideLookLimit[0]
  14533. _settings.insideLookLimitUp = DATA.insideLookLimit[1]
  14534. }
  14535. /* _settings.upDownAngleLimitPanos = {
  14536. 25:{up:30},
  14537. 26:{up:30},
  14538. 27:{up:30},
  14539. 28:{up:30},
  14540. 29:{up:30},
  14541. 30:{up:30},
  14542. 31:{up:30},
  14543. 32:{up:30},
  14544. 33:{up:24},
  14545. 34:{up:30},
  14546. 35:{up:30},
  14547. 36:{up:30},
  14548. 37:{up:30},
  14549. 38:{up:30},
  14550. 39:{up:30}
  14551. } */
  14552. }
  14553. // if (data.showCad) {
  14554. // $.ajax({
  14555. // url: '//super.4dage.com/data/' + window.number + '/floor.json',
  14556. // method: 'GET',
  14557. // success(res) {
  14558. // grendCAD(res, document.documentElement, data.cadSignColor, data.cadBorderColor, data.cadBorderWidth)
  14559. // }
  14560. // })
  14561. // }
  14562. })
  14563. .fail(e => {
  14564. alert('缺少someData文件,请检查场景码是否正确。')
  14565. })
  14566. function StartLoad() {
  14567. //当加载完data后
  14568. function i() {
  14569. var e = window.number //Y.getModelIDFromQueryString();
  14570. if (!e) return b(null, 'loading-failed')
  14571. var t = Y.parseSidUrl(e),
  14572. i = l(),
  14573. a = c(),
  14574. s = o(),
  14575. u = V.quickstart.enabled,
  14576. g = null,
  14577. m = null,
  14578. v = null,
  14579. w = null,
  14580. T = null,
  14581. x = null,
  14582. S = null,
  14583. M = null,
  14584. R = null,
  14585. P = null,
  14586. O = null,
  14587. L = null,
  14588. N = new ue()
  14589. r(s)
  14590. h({
  14591. //MP开头写法
  14592. urlBase: t.urlBase
  14593. })
  14594. .then(function () {
  14595. return re.init(), d(t, e) //getModel and load
  14596. })
  14597. .then(function (e) {
  14598. progressUpdate(0.9)
  14599. return (
  14600. (P = e),
  14601. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  14602. startSource: i,
  14603. autoplay: V.autoplay,
  14604. quickstart: u
  14605. }),
  14606. P.urls.init()
  14607. )
  14608. })
  14609. .then(function () {
  14610. return P.loadPanos()
  14611. })
  14612. .then(function () {
  14613. ;(m = X.getStartCameraOptions(P, P.panos)),
  14614. (S = A(P)),
  14615. (O = y(u, m.mode)),
  14616. (v = O.controls),
  14617. (w = O.player),
  14618. (T = O.director),
  14619. (x = O.tagManager),
  14620. (M = O.tileDownloader),
  14621. (R = O.qualityManager),
  14622. (L = O.panoRenderer),
  14623. C(P, S, O, s),
  14624. (w.director = T), //xzw add
  14625. P.supportsTiles && M.start(),
  14626. !u || (m.mode === D.PANORAMA && m.pano) || (de.warn('Tried to quickstart, but failed as we are not starting in inside mode.'), (u = !1))
  14627. var e = null
  14628. if (u) {
  14629. de.warn('Quickstart engaged. Hold on to your knickers.')
  14630. var t = v.controls[D.PANORAMA]
  14631. ;(g = new ie(R, S.scene, S.camera, t, s)),
  14632. _(S, s, P),
  14633. (e = g.load(m).then(function () {
  14634. S.addComponent(g),
  14635. S.once(le.AfterRender, function () {
  14636. de.warn('First render after quickstart load finished.')
  14637. })
  14638. }))
  14639. }
  14640. window.flyToFirst = function () {
  14641. //xzw add
  14642. var pano = w.model.panos.get('8d778e19657f433fb9cf8947d823bb70')
  14643. var q = new _x.Quaternion(0.7099827027821568, -0.07708150183830938, 0.6958985789714591, 0.07555241737970636)
  14644. var lookAtPoint = new _x.Vector3(0, 0, -1).applyQuaternion(q).add(pano.position)
  14645. w.flyToPano({ pano: pano, lookAtPoint: lookAtPoint })
  14646. }
  14647. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  14648. })
  14649. .then(function () {
  14650. return f(P, U.onProgress, i, !u, a)
  14651. })
  14652. .then(function () {
  14653. if (
  14654. ((m.quickstart = u),
  14655. I(P, S, O, s),
  14656. S.started || _(S, s, P),
  14657. H.modelLoaded(P, w, v, V.autoplay),
  14658. E(w, P, m, V.autoplay).done(function () {
  14659. T.autoTour()
  14660. }),
  14661. !P.supportsTiles)
  14662. ) {
  14663. var e = new Z(P, w)
  14664. e.start()
  14665. }
  14666. u && (S.removeComponent(g), g.destroy(), m.pano.enter()),
  14667. U.init(P, T, w, v, S, m, H.getSessionId()),
  14668. U.endLoading(P, T, x),
  14669. S.once(le.AfterRender, function () {
  14670. N.setAppReadyTime()
  14671. var e = N.calcFullLoadingTime()
  14672. de.warn('Total load time: ' + e / 1e3), H.loadComplete(e), de.warn('First render after model load finished.')
  14673. try {
  14674. window.evt && window.dispatchEvent(window.evt)
  14675. parent.postMessage(
  14676. {
  14677. cmd: 'loaded'
  14678. },
  14679. '*'
  14680. )
  14681. } catch (err) {}
  14682. }),
  14683. S.on(le.MemoryUsageUpdated, n)
  14684. })
  14685. .fail(b.bind(this, e))
  14686. }
  14687. function n(e) {
  14688. ce.update(e)
  14689. }
  14690. function r(e) {
  14691. de.info('Version', '2.25.6-0-gd87e5b1'), (q.defaultMaxListeners = 1e3), a(e), s()
  14692. }
  14693. function o() {
  14694. return document.getElementById('player')
  14695. }
  14696. function a(e) {
  14697. e.addEventListener('dragenter', T, !1), e.addEventListener('dragover', T, !1)
  14698. }
  14699. function s() {
  14700. F.valueFromHash('title', !0) ||
  14701. $(document).ready(function () {
  14702. var e = $('.model-title')
  14703. e.hide()
  14704. })
  14705. }
  14706. function l() {
  14707. return F.valueFromHash('play', !1) ? 'autoplay' : F.inIframe() ? 'click' : 'fullpage'
  14708. }
  14709. function c() {
  14710. return {
  14711. panoElementsToLoad: 6,
  14712. modelElementsToLoad: 0,
  14713. totalElementsLoaded: 0,
  14714. totalElementsToLoad: 0,
  14715. totalPercentageLoaded: 0,
  14716. progressCallback: null
  14717. }
  14718. }
  14719. function h(e) {
  14720. return K.loadFeatureFlags(e).done(function (e) {
  14721. K.updateDependentSettings(e, V)
  14722. })
  14723. }
  14724. // function u(e) {
  14725. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  14726. // responseType: "json",
  14727. // prefetchFrom: "config"
  14728. // }).then(function(e) {
  14729. // return e ? void j.extendObject(V.appConfig, e) : {}
  14730. // }, function(e) {
  14731. // return de.warn("Failed loading runtime config, using defaults."),
  14732. // $.when({})
  14733. // })
  14734. // }
  14735. function d(e, t) {
  14736. var i = B.getModel({
  14737. url: t,
  14738. floors: F.valueFromHash('f', !0),
  14739. autoload: !1
  14740. })
  14741. return $.when(i, n).then(null, function (e) {
  14742. return this
  14743. })
  14744. }
  14745. function p(e, t, i, n, r) {
  14746. de.info('Model data loaded'),
  14747. de.debug('UUID: ' + e.data.job.uuid),
  14748. J.init(K.getFlags()),
  14749. i &&
  14750. H.initKeen({
  14751. token: i,
  14752. appId: n
  14753. }),
  14754. H.initSegment({
  14755. model: e.sid,
  14756. version: '2.25.6-0-gd87e5b1',
  14757. startSource: r.startSource,
  14758. token: t,
  14759. autoplay: r.autoplay,
  14760. quickstart: r.quickstart
  14761. })
  14762. }
  14763. function f(e, t, i, n, r) {
  14764. return (r.progressCallback = t), H.sessionStart(), e.load(n).progress(g.bind(this, r))
  14765. }
  14766. function g(e, t) {
  14767. ;(e.modelElementsToLoad = t[1]), v(e), m(e)
  14768. }
  14769. function m(e) {
  14770. e.totalElementsLoaded++,
  14771. (e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad),
  14772. //----许钟文-----------------模型进度条向后调整
  14773. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0)
  14774. e.totalPercentageLoaded = modelProgressBase + (1 - modelProgressBase) * e.totalPercentageLoaded
  14775. //console.log('pro:'+e.totalPercentageLoaded)
  14776. //---------------------------
  14777. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14778. }
  14779. function v(e) {
  14780. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14781. }
  14782. function A(e) {
  14783. var t = new x.PerspectiveCamera()
  14784. t.layers.enable(he.PANOMARKERS), t.layers.enable(he.RETICULE), t.layers.enable(he.TAG)
  14785. var i = new x.Scene(),
  14786. n = new x.AmbientLight(16777215)
  14787. i.add(n),
  14788. (i.plane = new x.Mesh(
  14789. new x.PlaneBufferGeometry(1e5, 1e5),
  14790. new x.RawShaderMaterial({
  14791. side: x.DoubleSide
  14792. })
  14793. )),
  14794. (i.plane.position.y = 0),
  14795. i.plane.rotateX(-Math.PI / 2),
  14796. (i.plane.material.visible = !1),
  14797. i.add(i.plane),
  14798. i.updateMatrixWorld(),
  14799. V.showScreenshotLocations &&
  14800. e.data.images.forEach(function (e) {
  14801. if (e.metadata && e.metadata.camera_position) {
  14802. var t = e.metadata.camera_position,
  14803. n = new x.Mesh(new x.BoxGeometry(0.3, 0.3, 0.3))
  14804. ;(n.position = t.clone()), i.add(n)
  14805. var r = e.metadata.camera_quaternion,
  14806. o = new x.Vector3(0, 0, -1).applyQuaternion(r)
  14807. i.add(new x.ArrowHelper(o, t.clone(), 1, 16711680))
  14808. }
  14809. }),
  14810. V.showAxis &&
  14811. (i.add(new x.ArrowHelper(new x.Vector3(0, 1, 0), new x.Vector3(0, 0, 0), 1, 255)),
  14812. i.add(new x.ArrowHelper(new x.Vector3(0, 0, 1), new x.Vector3(0, 0, 0), 1, 16711680)),
  14813. i.add(new x.ArrowHelper(new x.Vector3(1, 0, 0), new x.Vector3(0, 0, 0), 1, 65280)))
  14814. //背景
  14815. if (!settings.transparentBg && !settings.bgImg) {
  14816. i.skybox = new W()
  14817. i.add(i.skybox)
  14818. }
  14819. var r = new te(i, t, z)
  14820. return r
  14821. }
  14822. function y(e, t) {
  14823. var i = e ? 1 : 1e3,
  14824. n = J.tilegen || J.imgopt ? 6 : 2
  14825. n = F.valueFromHash('tileconc', n)
  14826. var r = new ne(),
  14827. o = new ae({
  14828. concurrentDownloads: n
  14829. }),
  14830. a = new se(),
  14831. s = new P(),
  14832. l = new M(),
  14833. c = new S(t),
  14834. h = new R(),
  14835. u = new O(i),
  14836. d = new L(),
  14837. p = new oe()
  14838. return {
  14839. qualityManager: r,
  14840. panoRenderer: a,
  14841. tileDownloader: o,
  14842. player: c,
  14843. director: l,
  14844. modelManager: s,
  14845. tagManager: p,
  14846. displayController: u,
  14847. labelDisplayController: d,
  14848. controls: h
  14849. }
  14850. }
  14851. function C(e, t, i, n) {
  14852. var r = i.controls,
  14853. o = i.qualityManager,
  14854. a = i.panoRenderer,
  14855. s = i.tileDownloader,
  14856. l = i.modelManager
  14857. r.init(n, l), ee.init(i.director, r, i.player, l, t), o.init(l), s.init(o), a.init(t, s, o), l.init(s, a, o), l.addModel(e), t.addComponent(G)
  14858. }
  14859. function I(e, t, i, n) {
  14860. var r = i.qualityManager,
  14861. o = i.panoRenderer,
  14862. a = i.tileDownloader,
  14863. s = i.modelManager,
  14864. l = i.player,
  14865. c = i.director,
  14866. h = i.tagManager,
  14867. u = i.displayController,
  14868. d = i.labelDisplayController,
  14869. p = i.controls
  14870. t.scene.add(e), (t.qualityManager = r)
  14871. var f = {
  14872. camera: t.camera,
  14873. director: c,
  14874. modelManager: s,
  14875. tileDownloader: a,
  14876. panoRenderer: o,
  14877. qualityManager: r,
  14878. tagManager: h,
  14879. container: n,
  14880. controls: p
  14881. }
  14882. l.init(f),
  14883. l.setScene(t.scene),
  14884. h.init(s, l),
  14885. c.init(l, s),
  14886. u.init(c, l, s, h, n),
  14887. d.init(l, s, n),
  14888. z.bindEvents(l),
  14889. t.addComponent(h),
  14890. t.addComponent(l),
  14891. t.addComponent(o),
  14892. (l.sceneRenderer = t) //xzw add 方便resize
  14893. }
  14894. function E(e, t, i, n) {
  14895. return de.info('Starting player in ' + i.mode), H.report(t.sid, 'started-playing', n, i.quickstart), e.start(i)
  14896. }
  14897. function b(e, t) {
  14898. de.error(t), k.error(t), H.report(e, 'error-' + t)
  14899. }
  14900. function w(e) {
  14901. var t = F.details()
  14902. t && 'Safari' === t.name && t.version > 500 && t.version < 600
  14903. ? (k.error('webgl-safari'), H.report(e, 'error-webgl-safari'))
  14904. : (k.error('webgl-generic'), H.report(e, 'error-webgl-generic'))
  14905. }
  14906. function _(e, t, i) {
  14907. try {
  14908. e.start(t)
  14909. } catch (e) {
  14910. throw (de.warn(e.message), w(i.sid), e)
  14911. }
  14912. }
  14913. function T(e) {
  14914. e.stopPropagation(), e.preventDefault()
  14915. }
  14916. //czj 判断someData 有没有hoticon字段 修改热点的样式
  14917. if (window.DATA.hoticon) {
  14918. g_HotImage = {
  14919. point: window.DATA.hoticon.default || 'https://super.4dage.com/images/4dagePoint2.png',
  14920. point2: window.DATA.hoticon.higt || 'https://super.4dage.com/images/4dagePoint.png'
  14921. }
  14922. }
  14923. //czj 判断someData 有没有backgroundMusic 添加音乐
  14924. if (window.DATA.backgroundMusic && window.isLocal) {
  14925. window.DATA.backgroundMusic = manage.dealURL(window.DATA.backgroundMusic)
  14926. } else if (g_version === 'one') {
  14927. window.DATA.backgroundMusic = manage.dealURL(g_Prefix + '/audio/' + 'audio' + window.number + '/background.mp3')
  14928. }
  14929. if (window.DATA.backgroundMusic) {
  14930. SoundManager.setSrc('bgm', window.DATA.backgroundMusic)
  14931. $('#volume').show()
  14932. }
  14933. //隐藏公司logo
  14934. if (window.DATA.loadlogo) {
  14935. showLogo()
  14936. }
  14937. // 隐藏顶部介绍
  14938. window.DATA.topText && topTextHide()
  14939. e('./lib/three75-shim'),
  14940. e('./lib/array-polyfill'),
  14941. e('./lib/performance-polyfill'),
  14942. e('./lib/shaders/CopyShader.js'),
  14943. e('./lib/shaders/HorizontalBlurShader.js'),
  14944. e('./lib/shaders/VerticalBlurShader.js'),
  14945. e('./lib/postprocessing/EffectComposer.js'),
  14946. e('./lib/postprocessing/RenderPass.js'),
  14947. e('./lib/postprocessing/MaskPass.js'),
  14948. e('./lib/postprocessing/ShaderPass.js'),
  14949. window.Promise || (window.Promise = e('promise-polyfill'))
  14950. var x = e('three'),
  14951. _x = e('three'),
  14952. S = (e('./util/sentry'), e('./player')),
  14953. M = e('./director'),
  14954. R = e('./controls/CameraControls'),
  14955. P = e('./model/ModelManager'),
  14956. O = e('./DisplayController'),
  14957. L = e('./label/LabelDisplayController'),
  14958. D = e('./enum/Viewmode'),
  14959. N = e('./util/logger'),
  14960. B = e('./showcase'),
  14961. F = e('./util/browser'),
  14962. V = e('./settings'),
  14963. U = e('./gui/gui'),
  14964. k = e('./gui/error'),
  14965. H = e('./analytics'),
  14966. G = e('./util/transitions'),
  14967. z = e('./effects'),
  14968. W = e('./objects/Skybox'),
  14969. j = e('./util/common'),
  14970. Y = (e('./util/PanoramaCollection'), e('./util/math'), e('./util/showcase')),
  14971. X = e('./util/camera'),
  14972. Z = (e('./objects/Panorama'), e('./cameras/PanoramaCamera'), e('./preloaders')),
  14973. q = e('events').EventEmitter,
  14974. K = e('./featureflags'),
  14975. Q = (e('./util/lerp'), e('./util/ajax')),
  14976. J = e('./ab'),
  14977. ee = e('./sdk/automation.js'),
  14978. te = e('./scene/SceneRenderer'),
  14979. ie = e('./scene/QuickstartManager'),
  14980. ne = e('./tile/QualityManager.js'),
  14981. re = e('./localization/localize'),
  14982. oe = e('./tag/tagManager'),
  14983. ae = e('./tile/TileDownloader'),
  14984. se = e('./tile/PanoRenderer'),
  14985. le = (e('./enum/PanoSizeClass'), e('./enum/PanoramaEvents'), e('./enum/SceneRendererEvents')),
  14986. ce = e('./gui/memoryUsage'),
  14987. he = e('./enum/RenderLayers'),
  14988. ue = e('./TimingData'),
  14989. de = new N(t)
  14990. ;(N.level = V.logLevel), (N.consoleEnabled = V.console), i()
  14991. }
  14992. }).call(this, '/js/main.js')
  14993. },
  14994. {
  14995. './DisplayController': 1,
  14996. './TimingData': 2,
  14997. './ab': 3,
  14998. './analytics': 4,
  14999. './cameras/PanoramaCamera': 7,
  15000. './controls/CameraControls': 9,
  15001. './director': 15,
  15002. './effects': 16,
  15003. './enum/PanoSizeClass': 36,
  15004. './enum/PanoramaEvents': 37,
  15005. './enum/RenderLayers': 41,
  15006. './enum/SceneRendererEvents': 43,
  15007. './enum/Viewmode': 51,
  15008. './featureflags': 59,
  15009. './gui/error': 64,
  15010. './gui/gui': 65,
  15011. './gui/memoryUsage': 73,
  15012. './label/LabelDisplayController': 91,
  15013. './lib/array-polyfill': 92,
  15014. './lib/performance-polyfill': 95,
  15015. './lib/postprocessing/EffectComposer.js': 96,
  15016. './lib/postprocessing/MaskPass.js': 97,
  15017. './lib/postprocessing/RenderPass.js': 98,
  15018. './lib/postprocessing/ShaderPass.js': 99,
  15019. './lib/shaders/CopyShader.js': 100,
  15020. './lib/shaders/HorizontalBlurShader.js': 101,
  15021. './lib/shaders/VerticalBlurShader.js': 102,
  15022. './lib/three75-shim': 103,
  15023. './localization/localize': 108,
  15024. './tag/tagManager': 124,
  15025. './model/ModelManager': 140,
  15026. './objects/Panorama': 148,
  15027. './objects/Skybox': 152,
  15028. './player': 155,
  15029. './preloaders': 156,
  15030. './scene/QuickstartManager': 157,
  15031. './scene/SceneRenderer': 158,
  15032. './sdk/automation.js': 164,
  15033. './settings': 166,
  15034. './showcase': 168,
  15035. './tile/PanoRenderer': 169,
  15036. './tile/QualityManager.js': 170,
  15037. './tile/TileDownloader': 171,
  15038. './util/PanoramaCollection': 178,
  15039. './util/ajax': 181,
  15040. './util/browser': 182,
  15041. './util/camera': 183,
  15042. './util/common': 185,
  15043. './util/lerp': 188,
  15044. './util/logger': 189,
  15045. './util/math': 190,
  15046. './util/sentry': 192,
  15047. './util/showcase': 193,
  15048. './util/transitions': 195,
  15049. events: 202,
  15050. 'promise-polyfill': 213,
  15051. three: 217
  15052. }
  15053. ],
  15054. 117: [
  15055. function (e, t, i) {
  15056. 'use strict'
  15057. function n(e) {
  15058. e = e || {}
  15059. r.RawShaderMaterial.call(
  15060. this,
  15061. a.extendObject(
  15062. {
  15063. fragmentShader: o.cube.fragmentShader,
  15064. vertexShader: o.cube.vertexShader,
  15065. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  15066. name: 'CubemapMaterial'
  15067. },
  15068. e
  15069. )
  15070. )
  15071. }
  15072. var r = e('three'),
  15073. o = e('../shaders'),
  15074. a = e('../util/common')
  15075. ;(n.prototype = Object.create(r.RawShaderMaterial.prototype)), (n.prototype.constructor = n), (t.exports = n)
  15076. },
  15077. {
  15078. '../shaders': 167,
  15079. '../util/common': 185,
  15080. three: 217
  15081. }
  15082. ],
  15083. 118: [
  15084. function (e, t, i) {
  15085. 'use strict'
  15086. function n(e) {
  15087. e = e || {}
  15088. r.RawShaderMaterial.call(
  15089. this,
  15090. a.extendObject(
  15091. {
  15092. fragmentShader: o.model.fragmentShader,
  15093. vertexShader: o.model.vertexShader,
  15094. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  15095. name: 'ModelTextureMaterial'
  15096. },
  15097. e
  15098. )
  15099. )
  15100. }
  15101. var r = e('three'),
  15102. o = e('../shaders'),
  15103. a = e('../util/common')
  15104. ;(n.prototype = Object.create(r.RawShaderMaterial.prototype)),
  15105. (n.prototype.constructor = n),
  15106. (n.prototype.setProjectedPanos = function (e, t, i) {
  15107. i && (this.uniforms.progress.value = 0),
  15108. e.ensureSkyboxReadyForRender(),
  15109. (this.uniforms.pano0Map.value = e.getSkyboxTexture()),
  15110. this.uniforms.pano0Position.value.copy(e.position),
  15111. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  15112. t.ensureSkyboxReadyForRender(),
  15113. (this.uniforms.pano1Map.value = t.getSkyboxTexture()),
  15114. this.uniforms.pano1Position.value.copy(t.position),
  15115. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  15116. }),
  15117. /* n.prototype.setEyeDir = function(dir, pos) {//加
  15118. this.uniforms.eyeDir.value.copy(dir)
  15119. this.uniforms.eyePos.value.copy(pos)
  15120. }
  15121. n.prototype.setBendCameraQua = function(matrix) {//加
  15122. this.uniforms.cameraDeltaMatrix.value.copy(matrix)
  15123. } */
  15124. (t.exports = n)
  15125. },
  15126. {
  15127. '../shaders': 167,
  15128. '../util/common': 185,
  15129. three: 217
  15130. }
  15131. ],
  15132. 119: [
  15133. function (e, t, i) {
  15134. ;(function (i) {
  15135. 'use strict'
  15136. function n(e, t, i, n) {
  15137. ;(this.div = null),
  15138. (this.body = null),
  15139. (this.label = e),
  15140. (this.description = t),
  15141. (this.parsedDescription = []),
  15142. (this.media = i || {
  15143. type: null
  15144. }),
  15145. (this.loadingSpinner = null),
  15146. (this.parser = new r({
  15147. supportLinks: !u.valueFromHash('mls'),
  15148. keepLinkLabels: !0
  15149. })),
  15150. (this.state = I.CLOSED),
  15151. (this.orientation = ''),
  15152. (this.initialTransform = ''),
  15153. (this.hovering = !1),
  15154. (this.openTransition = null),
  15155. (this.closeTransition = null),
  15156. (this.openPromise = null),
  15157. (this.closePromise = null),
  15158. (this.animationTransition = null),
  15159. (this.animationScale = 0)
  15160. }
  15161. var r = e('../Parser/DescriptionParser'),
  15162. o = e('../Media/Link'),
  15163. a = e('../Media/Image'),
  15164. s = e('../Media/EmbedlyPlayer'),
  15165. l = e('../Media/EmbedlyEmbed'),
  15166. c = e('../../util/transitions'),
  15167. h = e('../../util/lerp'),
  15168. u = e('../../util/browser'),
  15169. d = e('./BillboardEvent'),
  15170. p = e('../Media/MediaEvent'),
  15171. f = e('../Parser/DescriptionChunkType'),
  15172. g = e('events').EventEmitter,
  15173. m = e('./billboardSettings'),
  15174. v = e('./overlaySettings'),
  15175. A = e('../../util/logger'),
  15176. y = new A(i),
  15177. C = document.getElementById('tag-billboards')
  15178. C.addEventListener('touchend', function (e) {
  15179. C.style.pointerEvents = 'none'
  15180. }),
  15181. C.addEventListener('touchcancel', function (e) {
  15182. C.style.pointerEvents = 'none'
  15183. })
  15184. var I = {
  15185. CLOSED: 'closed',
  15186. OPENING: 'opening',
  15187. OPEN: 'open',
  15188. CLOSING: 'closing',
  15189. ACTIVE: 'active'
  15190. }
  15191. ;(n.prototype = Object.create(g.prototype)),
  15192. (n.prototype.build = function (e) {
  15193. this.parsedDescription = this.parser.parse(this.description)
  15194. var t = document.createElement('div')
  15195. ;(t.className = 'tag-container has-hotzone'), (this.div = t), (this.body = document.createElement('div')), (this.body.className = 'tag-body')
  15196. var i = document.createElement('div')
  15197. i.classList.add('tag-content')
  15198. var n = document.createElement('div')
  15199. n.classList.add('tag-text-content')
  15200. var r = document.createElement('div')
  15201. ;(r.className = 'tag-label'), (r.textContent = this.label), n.appendChild(r)
  15202. var o = document.createElement('div')
  15203. ;(o.className = 'tag-desc'),
  15204. n.appendChild(o),
  15205. i.appendChild(n),
  15206. this.body.appendChild(i),
  15207. this.appendDescriptionElements(this.parsedDescription, o),
  15208. this.appendMedia(),
  15209. t.appendChild(this.body),
  15210. C.appendChild(t),
  15211. this.bindEvents(t, this.body)
  15212. }),
  15213. (n.prototype.bindEvents = function (e, t) {
  15214. var i = function (e) {
  15215. return function (t) {
  15216. if (!this.div.classList.contains('overlay')) {
  15217. var i,
  15218. n = document.getElementById('player')
  15219. try {
  15220. i = new MouseEvent(e, t)
  15221. } catch (n) {
  15222. ;(i = document.createEvent('MouseEvents')),
  15223. i.initMouseEvent(
  15224. e,
  15225. t.bubbles,
  15226. t.cancelable,
  15227. t.view,
  15228. t.detail,
  15229. t.screenX,
  15230. t.screenY,
  15231. t.clientX,
  15232. t.clientY,
  15233. t.ctrlKey,
  15234. t.altKey,
  15235. t.shiftKey,
  15236. t.metaKey,
  15237. t.button,
  15238. t.relatedTarget
  15239. )
  15240. }
  15241. n.dispatchEvent(i)
  15242. }
  15243. }
  15244. }
  15245. t.addEventListener('mousedown', function (e) {
  15246. e.stopPropagation()
  15247. }),
  15248. t.addEventListener('mouseup', function (e) {
  15249. e.stopPropagation()
  15250. }),
  15251. e.addEventListener('touchstart', function (e) {
  15252. C.style.pointerEvents = 'auto'
  15253. }),
  15254. e.addEventListener('mousedown', i('mousedown').bind(this)),
  15255. e.addEventListener('mouseup', i('mouseup').bind(this)),
  15256. t.addEventListener(
  15257. 'mouseover',
  15258. function (t) {
  15259. this.state === I.OPEN && e.classList.remove('has-hotzone')
  15260. }.bind(this)
  15261. ),
  15262. e.addEventListener(
  15263. 'mouseenter',
  15264. function (e) {
  15265. this.state !== I.CLOSING && ((this.hovering = !0), this.emit(d.ENTER))
  15266. }.bind(this)
  15267. ),
  15268. e.addEventListener(
  15269. 'mouseleave',
  15270. function (e) {
  15271. ;(this.hovering = !1), this.emit(d.LEAVE)
  15272. }.bind(this)
  15273. ),
  15274. e.addEventListener('gesturestart', function (e) {
  15275. e.preventDefault()
  15276. })
  15277. var n = e.querySelector('.tag-text-content'),
  15278. r = 0
  15279. n.addEventListener('touchstart', function (e) {
  15280. r = e.changedTouches[0].clientY
  15281. }),
  15282. n.addEventListener('touchmove', function (t) {
  15283. function i(e) {
  15284. e && ((0 === e.scrollTop && t.changedTouches[0].clientY > r) || (e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r)) && t.preventDefault()
  15285. }
  15286. return e.classList.contains('overlay') ? i(this.querySelector('.tag-desc')) : void i(this)
  15287. }),
  15288. e.addEventListener('touchmove', function (e) {
  15289. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  15290. })
  15291. }),
  15292. (n.prototype.appendDescriptionElements = function (e, t) {
  15293. e.length > 0 && this.div.classList.add('has-text'),
  15294. e.forEach(
  15295. function (e, i) {
  15296. switch (e.type) {
  15297. case f.TEXT:
  15298. t.appendChild(this.createTextElement(e.text))
  15299. break
  15300. case f.LINK:
  15301. t.appendChild(this.createLinkElement(e.link))
  15302. }
  15303. }.bind(this)
  15304. )
  15305. }),
  15306. (n.prototype.appendLoadingSpinner = function () {
  15307. ;(this.loadingSpinner = document.createElement('div')), this.loadingSpinner.classList.add('loading-spinner')
  15308. var e = document.createElement('div')
  15309. e.classList.add('gui-spinner-icon'), this.loadingSpinner.appendChild(e), this.body.appendChild(this.loadingSpinner)
  15310. }),
  15311. (n.prototype.onMediaLoadFinished = function () {
  15312. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner), this.applyOrientation(this.orientation), (this.loadingSpinner = null))
  15313. }),
  15314. (n.prototype.appendMedia = function () {
  15315. if (this.media && this.media.type && 'error' !== this.media.type && (!u.valueFromHash('mls', 0) || this.media.type === f.IMAGE)) {
  15316. this.appendLoadingSpinner()
  15317. var e = document.createElement('div')
  15318. e.classList.add('tag-media-content')
  15319. var t = document.createElement('i')
  15320. switch (
  15321. (['icon', 'icon-close-thin', 'close'].forEach(function (e) {
  15322. t.classList.add(e)
  15323. }),
  15324. this.body.appendChild(t),
  15325. this.body.appendChild(e),
  15326. this.media.type)
  15327. ) {
  15328. case f.IMAGE:
  15329. e.appendChild(this.createImageElement(this.media, this.body))
  15330. break
  15331. case f.VIDEO:
  15332. e.appendChild(this.createVideoElement(this.media, this.body))
  15333. break
  15334. case f.RICH:
  15335. e.appendChild(this.createEmbedElement(this.media, this.body))
  15336. }
  15337. }
  15338. }),
  15339. (n.prototype.createTextElement = function (e) {
  15340. var t = document.createElement('span')
  15341. return (t.textContent = e), t
  15342. })
  15343. ;(n.prototype.createLinkElement = function (e) {
  15344. var t = new o(e)
  15345. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)), t.createDomElement()
  15346. }),
  15347. (n.prototype.createImageElement = function (e, t) {
  15348. function i() {
  15349. function e() {
  15350. m ||
  15351. (r.classList.remove('view-image'),
  15352. c.classList.add('overlay'),
  15353. i(),
  15354. window.addEventListener('resize', b),
  15355. c.addEventListener('click', a),
  15356. g.addEventListener('click', l),
  15357. f.addEventListener('click', s),
  15358. (m = !0),
  15359. o.emit(p.IMAGE_OPENED))
  15360. }
  15361. function i() {
  15362. t.classList.add('show-info'), h.classList.remove('collapsible'), (h.style.height = '')
  15363. var e = parseFloat(getComputedStyle(I).lineHeight),
  15364. i = y + e,
  15365. r = c.clientWidth - 2 * v.boundaryWidth - C,
  15366. a = c.clientHeight - 2 * v.boundaryHeight - C - i,
  15367. s = a,
  15368. l = s * n.aspect
  15369. l > r && ((l = r), (s = l / n.aspect)),
  15370. s > a && ((s = a), (l = s * n.aspect)),
  15371. (l += C),
  15372. (s += C + i),
  15373. (t.style.width = l + 'px'),
  15374. (t.style.height = s + 'px'),
  15375. (u.style.paddingTop = e + C + 'px'),
  15376. o.description.length > 0 && (h.classList.add('collapsible'), (h.style.height = h.clientHeight + 12 + 'px'), (E.style.height = 'calc(100% - ' + I.clientHeight + 'px)'))
  15377. }
  15378. function a(e) {
  15379. e.target === c && s()
  15380. }
  15381. function s() {
  15382. m &&
  15383. ((m = !1),
  15384. r.classList.add('view-image'),
  15385. c.classList.remove('overlay'),
  15386. (h.style.height = ''),
  15387. (u.style.paddingTop = ''),
  15388. (t.style.width = ''),
  15389. (t.style.height = ''),
  15390. window.removeEventListener('resize', b),
  15391. c.removeEventListener('click', a),
  15392. g.removeEventListener('click', l),
  15393. f.removeEventListener('click', s),
  15394. o.emit(p.IMAGE_CLOSED),
  15395. o.close(!0))
  15396. }
  15397. function l(e) {
  15398. t.classList.toggle('show-info')
  15399. }
  15400. var c = o.div,
  15401. h = c.getElementsByClassName('tag-content')[0],
  15402. u = c.getElementsByClassName('tag-media-content')[0],
  15403. f = t.getElementsByClassName('close')[0],
  15404. g = h.getElementsByClassName('tag-label')[0]
  15405. c.classList.add('has-image'), r.classList.add('view-image'), c.classList.add(n.aspect >= 1 ? 'image-landscape' : 'image-portrait'), o.applyOrientation(o.orientation)
  15406. var m = !1,
  15407. A = getComputedStyle(h),
  15408. y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom),
  15409. C = 2 * parseFloat(getComputedStyle(u).paddingLeft),
  15410. I = h.querySelector('.tag-label'),
  15411. E = h.querySelector('.tag-desc'),
  15412. b = (function () {
  15413. var e,
  15414. t,
  15415. n = 0
  15416. return function () {
  15417. clearInterval(e),
  15418. clearTimeout(t),
  15419. (e = setInterval(function () {
  15420. var e = c.clientHeight
  15421. n !== e && (i(), (n = e))
  15422. }, 100)),
  15423. (t = setTimeout(clearInterval.bind(this, e), 1e3))
  15424. }
  15425. })()
  15426. n.on(p.IMAGE_OPENING, e), o.on(d.ACTIVATE, e), o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)), o.on(d.CLOSING, s)
  15427. }
  15428. var n = new a(),
  15429. r = n.createDomElement()
  15430. this.once(d.OPENED, function () {
  15431. n.load(e.src)
  15432. .then(i)
  15433. .catch(function (t) {
  15434. y.warn('Failed to load image:', e.src), y.warn('with error:', t)
  15435. })
  15436. .then(this.onMediaLoadFinished.bind(this))
  15437. })
  15438. var o = this
  15439. return r
  15440. }),
  15441. (n.prototype.createVideoElement = function (e, t) {
  15442. var i = new s({
  15443. autoPlay: !0,
  15444. autoResume: !0,
  15445. startMuted: !1,
  15446. loop: !1
  15447. }),
  15448. n = i.createDomElement()
  15449. return (
  15450. this.once(
  15451. d.OPENED,
  15452. function () {
  15453. i.load(e.src)
  15454. .then(
  15455. function () {
  15456. this.div.classList.add('has-video'),
  15457. (this.state !== I.OPEN && this.state !== I.ACTIVE) || (i.show(), i.play()),
  15458. this.on(d.OPENING, i.show.bind(i)),
  15459. this.on(d.OPENED, i.play.bind(i)),
  15460. this.on(d.CLOSING, i.pause.bind(i)),
  15461. this.on(d.CLOSED, i.hide.bind(i))
  15462. }.bind(this)
  15463. )
  15464. .catch(function (t) {
  15465. y.warn('Failed to embed video:', e.src), y.warn('with error:', t)
  15466. })
  15467. .then(this.onMediaLoadFinished.bind(this))
  15468. }.bind(this)
  15469. ),
  15470. n
  15471. )
  15472. }),
  15473. (n.prototype.createEmbedElement = function (e, t) {
  15474. var i = new l(),
  15475. n = i.createDomElement()
  15476. return (
  15477. this.once(
  15478. d.OPENED,
  15479. function () {
  15480. i.load(e.src)
  15481. .then(
  15482. function () {
  15483. this.div.classList.add('has-embed'),
  15484. (this.state !== I.OPEN && this.state !== I.ACTIVE) || i.show(),
  15485. this.applyOrientation(this.orientation),
  15486. this.on(d.OPENING, i.show.bind(i)),
  15487. this.on(d.CLOSED, i.hide.bind(i))
  15488. }.bind(this)
  15489. )
  15490. .catch(function (t) {
  15491. y.warn('Failed to embed:', e.src), y.warn('with error:', t)
  15492. })
  15493. .then(this.onMediaLoadFinished.bind(this))
  15494. }.bind(this)
  15495. ),
  15496. n
  15497. )
  15498. }),
  15499. (n.prototype.open = function (e) {
  15500. return (
  15501. (this.openPromise = $.Deferred()),
  15502. this.state === I.ACTIVE
  15503. ? this.openPromise.resolve().promise()
  15504. : (this.hovering || this.div.classList.add('has-hotzone'),
  15505. this.openTransition
  15506. ? e && this.setActiveState()
  15507. : (this.openTransition = c.setTimeout(
  15508. function () {
  15509. this.state !== I.OPEN &&
  15510. (this.emit(d.OPENING),
  15511. e && this.emit(d.ACTIVATING),
  15512. (this.state = I.OPENING),
  15513. this.animateOpen(
  15514. function () {
  15515. e && this.setActiveState(), this.openPromise.resolve()
  15516. }.bind(this)
  15517. ))
  15518. }.bind(this),
  15519. m.animation.openDelay
  15520. )),
  15521. c.cancel(this.closeTransition),
  15522. this.closePromise && this.closePromise.reject(),
  15523. (this.closeTransition = void 0),
  15524. this.openPromise.promise())
  15525. )
  15526. }),
  15527. (n.prototype.close = function (e) {
  15528. return (
  15529. (this.closePromise = $.Deferred()),
  15530. !e && this.hovering
  15531. ? this.closePromise.reject().promise()
  15532. : (this.closeTransition ||
  15533. (this.closeTransition = c.setTimeout(
  15534. function () {
  15535. this.state !== I.CLOSED && (this.emit(d.CLOSING), (this.state = I.CLOSING), this.animateClose())
  15536. }.bind(this),
  15537. m.animation.closeDelay
  15538. )),
  15539. c.cancel(this.openTransition),
  15540. this.openPromise && this.openPromise.reject(),
  15541. (this.openTransition = void 0),
  15542. this.closePromise.resolve(),
  15543. this.closePromise.promise())
  15544. )
  15545. }),
  15546. (n.prototype.setActiveState = function () {
  15547. this.state !== I.CLOSED && ((this.state = I.ACTIVE), this.emit(d.ACTIVATE), this.div.classList.remove('has-hotzone'))
  15548. }),
  15549. (n.prototype.animateOpen = function (e) {
  15550. if (this.state === I.OPENING) {
  15551. if ((c.cancel(this.animationTransition), u.detectSamsungNative()))
  15552. return (this.boardOrientation = null), (this.div.style.visibility = 'visible'), this.emit(d.OPENED), (this.state = I.OPEN), void (e && e())
  15553. ;(this.div.style.webkitTransform = 'scale(0)'),
  15554. (this.div.style.transform = 'scale(0)'),
  15555. (this.div.style.visibility = 'visible'),
  15556. (this.animationTransition = c.start(
  15557. h.property(this, 'animationScale', 1),
  15558. m.animation.openDuration,
  15559. function () {
  15560. this.emit(d.OPENED), (this.state = I.OPEN), e && e()
  15561. }.bind(this)
  15562. ))
  15563. }
  15564. }),
  15565. (n.prototype.animateClose = function (e) {
  15566. this.state === I.CLOSING &&
  15567. (c.cancel(this.animationTransition),
  15568. (this.animationTransition = c.start(
  15569. h.property(this, 'animationScale', 0),
  15570. m.animation.closeDuration,
  15571. function () {
  15572. this.emit(d.CLOSED), (this.state = I.CLOSED), (this.div.style.visibility = 'hidden'), this.div.classList.contains('has-hotzone') || this.div.classList.add('has-hotzone'), e && e()
  15573. }.bind(this)
  15574. )))
  15575. }),
  15576. (n.prototype.needsUpdate = function () {
  15577. return this.state !== I.CLOSED
  15578. }),
  15579. (n.prototype.update = function (e, t) {
  15580. if (this.needsUpdate()) {
  15581. var i = (this.updateOrientation(e), this.calcScale(t)),
  15582. n = {
  15583. x: ((e.x + 1) * $('#player').width()) / 2,
  15584. y: ((e.y + 1) * $('#player').height()) / 2
  15585. }
  15586. ;(this.div.screenTransform = this.initialTransform + ' translate(' + n.x + 'px, ' + n.y + 'px) scale(' + i * this.animationScale + ')'),
  15587. (this.div.style.webkitTransform = this.div.screenTransform),
  15588. (this.div.style.transform = this.div.screenTransform)
  15589. }
  15590. }),
  15591. (n.prototype.getDimensions = function () {
  15592. return this.div.getBoundingClientRect()
  15593. }),
  15594. (n.prototype.calcScale = function (e) {
  15595. return Math.sqrt(e / 40) * m.boardToDiscRatio
  15596. }),
  15597. (n.prototype.updateOrientation = function (e) {
  15598. if (this.state !== I.ACTIVE) {
  15599. var t = 1 / 3,
  15600. i = e.y < -t ? 0 : e.y < t ? 1 : 2,
  15601. n = e.x < -t ? 0 : e.x < t ? 1 : 2,
  15602. r = ''
  15603. ;(r += 0 === n ? 'right' : 2 === n ? 'left' : ''),
  15604. (r += 0 === i ? '-down' : 2 === i ? '-up' : ''),
  15605. 1 === n &&
  15606. ((r = 0 === i ? 'bottom' : 2 === i ? 'top' : ''), 1 === i && (r = $('#player').width() > $('#player').height() ? (e.x < 0 ? 'right' : 'left') : e.y < 0 ? 'bottom' : 'top')),
  15607. (1 === n && 1 === i && r === this.orientation) || this.applyOrientation(r)
  15608. }
  15609. }),
  15610. (n.prototype.applyOrientation = function (e) {
  15611. ;(this.div.style.transform = this.div.style.webkitTransform = ''), this.div.classList.remove('tag-container-' + this.orientation), this.div.classList.add('tag-container-' + e)
  15612. var t = window.getComputedStyle(this.div)
  15613. ;(this.initialTransform = t.transform || t.webkitTransform), 'none' === this.initialTransform && (this.initialTransform = '')
  15614. var i = t.transform.slice(7, -1).split(','),
  15615. n = -i[4],
  15616. r = -i[5]
  15617. ;(this.div.style.webkitTransformOrigin = n + 'px ' + r + 'px'), (this.div.style.transformOrigin = n + 'px ' + r + 'px'), (this.orientation = e)
  15618. }),
  15619. (t.exports = n)
  15620. }).call(this, '/js/tag/Billboard/Billboard.js')
  15621. },
  15622. {
  15623. '../../util/browser': 182,
  15624. '../../util/lerp': 188,
  15625. '../../util/logger': 189,
  15626. '../../util/transitions': 195,
  15627. '../Media/EmbedlyEmbed': 125,
  15628. '../Media/EmbedlyPlayer': 126,
  15629. '../Media/Image': 128,
  15630. '../Media/Link': 129,
  15631. '../Media/MediaEvent': 131,
  15632. '../Parser/DescriptionChunkType': 133,
  15633. '../Parser/DescriptionParser': 134,
  15634. './BillboardEvent': 120,
  15635. './billboardSettings': 121,
  15636. './overlaySettings': 122,
  15637. events: 202
  15638. }
  15639. ],
  15640. 120: [
  15641. function (e, t, i) {
  15642. 'use strict'
  15643. t.exports = Object.freeze({
  15644. ENTER: 'billboard.enter',
  15645. LEAVE: 'billboard.leave',
  15646. OPENING: 'billboard.opening',
  15647. OPENED: 'billboard.open',
  15648. CLOSING: 'billboard.closing',
  15649. CLOSED: 'billboard.closed',
  15650. ACTIVATING: 'billboard.activating',
  15651. ACTIVATE: 'billboard.activate'
  15652. })
  15653. },
  15654. {}
  15655. ],
  15656. 121: [
  15657. function (e, t, i) {
  15658. 'use strict'
  15659. t.exports = Object.freeze({
  15660. animation: Object.freeze({
  15661. hoverOnClosing: !1,
  15662. openDelay: 100,
  15663. closeDelay: 50,
  15664. openDuration: 200,
  15665. closeDuration: 100
  15666. }),
  15667. boardToDiscRatio: 1.2
  15668. })
  15669. },
  15670. {}
  15671. ],
  15672. 122: [
  15673. function (e, t, i) {
  15674. 'use strict'
  15675. t.exports = Object.freeze({
  15676. boundaryWidth: 30,
  15677. boundaryHeight: 0
  15678. })
  15679. },
  15680. {}
  15681. ],
  15682. 123: [
  15683. function (e, t, i) {
  15684. //tag
  15685. ;(function (i) {
  15686. 'use strict'
  15687. function n(e, t, i) {
  15688. var n = i.version || '0'
  15689. '0' !== n && I.info('tag defined using version ' + n),
  15690. (this.model = e),
  15691. (this.sid = t),
  15692. (this.color = new r.Color().set(i.color || l.tagDefault)),
  15693. (this.hoverColor = l._darken(this.color, 0.2)),
  15694. (this.floor = null),
  15695. (this.floorIndex = i.floor),
  15696. (this.mode = s.PANORAMA),
  15697. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15698. (this.obj3d = null),
  15699. (this.disc = null),
  15700. (this.materials = {
  15701. disc: null,
  15702. pole: null
  15703. }),
  15704. (this.position = new r.Vector3().copy(i.position)),
  15705. (this.discPosition = new r.Vector3().copy(i.stem.direction)),
  15706. (this.discWorldPosition = null),
  15707. (this.discScale = 0.05),
  15708. (this.poleEnabled = i.stem.enabled),
  15709. (this.billboard = new o(i.label, i.description, i.media, this)),
  15710. (this.visibleTransition = null),
  15711. (this.hoveringDisc = !1)
  15712. }
  15713. var r = e('three'),
  15714. o = e('./Billboard/Billboard'),
  15715. a = e('../settings'),
  15716. s = e('../enum/Viewmode'),
  15717. l = e('../enum/Colors'),
  15718. c = e('../enum/RenderLayers'),
  15719. h = e('../enum/RenderOrder'),
  15720. u = (e('../util/common'), e('../util/math')),
  15721. d = e('../util/texture'),
  15722. p = e('../objects/Panorama'),
  15723. f = e('../shaders'),
  15724. g = e('../util/transitions'),
  15725. m = e('../util/lerp'),
  15726. v = e('../util/easing'),
  15727. A = e('./Billboard/BillboardEvent'),
  15728. y = e('events').EventEmitter,
  15729. C = e('../util/logger'),
  15730. I = new C(i),
  15731. E = d.loadBase64(
  15732. '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=='
  15733. ),
  15734. b = d.loadBase64(
  15735. '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'
  15736. ),
  15737. w = new r.PlaneBufferGeometry(1, 1)
  15738. ;(n.prototype = Object.create(y.prototype)),
  15739. (n.raycaster = new r.Raycaster()),
  15740. (n.prototype.bindEvents = function () {
  15741. this.billboard.on(A.ENTER, this.setHoverState.bind(this)), this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  15742. }),
  15743. (n.prototype.build = function () {
  15744. return (
  15745. (this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first()),
  15746. this.floor && (this.billboard.build(this.model.sid), (this.obj3d = this.buildObject3D()), this.floor.add(this.obj3d)),
  15747. this
  15748. )
  15749. }),
  15750. (n.prototype.buildObject3D = function () {
  15751. var e = new r.Object3D()
  15752. e.position.copy(this.position)
  15753. var t = r.UniformsUtils.clone(f.tagDisc.uniforms)
  15754. ;(t.bg.value = b),
  15755. (t.mask.value = E),
  15756. t.color.value.copy(this.color),
  15757. (this.materials.disc = new r.RawShaderMaterial({
  15758. transparent: !0,
  15759. vertexShader: f.tagDisc.vertexShader,
  15760. fragmentShader: f.tagDisc.fragmentShader,
  15761. uniforms: t
  15762. })),
  15763. (this.disc = new r.Mesh(w, this.materials.disc)),
  15764. this.disc.layers.set(c.TAG),
  15765. this.disc.position.copy(this.discPosition),
  15766. (this.disc.renderOrder = h.tagDisc),
  15767. (this.disc.tag = this)
  15768. var i = this.buildPole()
  15769. return i.layers.set(c.TAG), (i.renderOrder = h.tagStem), e.add(i), e.layers.set(c.TAG), e.add(this.disc)
  15770. }),
  15771. (n.prototype.buildPole = function () {
  15772. var e = new r.BufferGeometry(),
  15773. t = new Float32Array(6)
  15774. return (
  15775. (t[0] = t[1] = t[2] = 0),
  15776. (t[3] = this.discPosition.x),
  15777. (t[4] = this.discPosition.y),
  15778. (t[5] = this.discPosition.z),
  15779. e.addAttribute('position', new r.BufferAttribute(t, 3)),
  15780. (this.materials.pole = new r.LineBasicMaterial({
  15781. linewidth: a.tags.pole.width,
  15782. color: a.tags.pole.color,
  15783. opacity: 0,
  15784. visible: this.poleEnabled,
  15785. transparent: !0,
  15786. depthWrite: !1
  15787. })),
  15788. new r.Line(e, this.materials.pole)
  15789. )
  15790. }),
  15791. (n.prototype.setFreeState = function (e) {
  15792. ;(!e && this.hoveringDisc) ||
  15793. this.billboard.close(e).then(
  15794. function () {
  15795. this.materials.disc.uniforms.color.value = this.color
  15796. }.bind(this)
  15797. )
  15798. }),
  15799. (n.prototype.setHoverState = function (e) {
  15800. this.billboard.open(e), (this.materials.disc.uniforms.color.value = this.hoverColor)
  15801. }),
  15802. (n.prototype.hide = function (e, t) {
  15803. var i = $.Deferred()
  15804. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition)) return i.resolve().promise()
  15805. ;(e = e || 0), (t = t || 0), g.cancel(this.visibleTransition)
  15806. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity,
  15807. r = t + e,
  15808. o = t / r
  15809. return (
  15810. (this.visibleTransition = g.start(
  15811. (function (e) {
  15812. var t = m.property(e.materials.disc.uniforms.opacity, 'value', 0),
  15813. i = m.property(e.materials.pole, 'opacity', 0)
  15814. return function (n) {
  15815. t(n), e.materials.pole && i(n)
  15816. }
  15817. })(this),
  15818. r * n,
  15819. function () {
  15820. i.resolve()
  15821. },
  15822. o,
  15823. v[a.warp.blendEasing]
  15824. )),
  15825. i.promise()
  15826. )
  15827. }),
  15828. (n.prototype.show = function (e, t) {
  15829. var i = $.Deferred()
  15830. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition)) return i.resolve().promise()
  15831. ;(e = e || 0), (t = t || 0), g.cancel(this.visibleTransition)
  15832. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity,
  15833. r = t + e,
  15834. o = t / r
  15835. return (
  15836. (this.visibleTransition = g.start(
  15837. (function (e) {
  15838. var t = m.property(e.materials.disc.uniforms.opacity, 'value', a.tags.disc.opacity),
  15839. i = m.property(e.materials.pole, 'opacity', a.tags.pole.opacity)
  15840. return function (n) {
  15841. t(n), e.materials.pole && i(n)
  15842. }
  15843. })(this),
  15844. r * n,
  15845. function () {
  15846. i.resolve()
  15847. },
  15848. o,
  15849. v[a.warp.blendEasing]
  15850. )),
  15851. i.promise()
  15852. )
  15853. }),
  15854. (n.prototype.closestPanoTowardTag = function (e, t) {
  15855. var i = [],
  15856. o = [],
  15857. l = this.disc.getWorldPosition()
  15858. if (e === s.PANORAMA) {
  15859. var c = 0.5,
  15860. h = t.position.clone().sub(l).normalize()
  15861. i.push(p.filters.isPanoAligned()), i.push(p.filters.isNeighbourPanoTo(t)), i.push(p.filters.inPanoDirection(l, h, c)), o.push(p.scoreFunctions.direction(l, h))
  15862. }
  15863. var u = new r.Vector3(),
  15864. d = function (e) {
  15865. u.copy(l).sub(e.position)
  15866. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z))),
  15867. i = a.tags.navigate.tiltTolerance
  15868. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15869. },
  15870. f = function (e) {
  15871. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15872. }
  15873. i.push(f, d), o.push(p.scoreFunctions.distanceSquared(this, -2))
  15874. var g = this.model.panos.sortByScore(i, o)
  15875. if (a.tags.navigate.lineOfSight) {
  15876. for (var m = 0; m < g.length; m++) {
  15877. var v = g[m].item,
  15878. A = v.position.distanceTo(l)
  15879. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance) return null
  15880. n.raycaster.set(v.position, l.clone().sub(v.position).normalize())
  15881. var y = n.raycaster.intersectObjects(this.model.colliders)
  15882. if (0 === y.length || y[0].distance > A) return v
  15883. }
  15884. return null
  15885. }
  15886. return g.length > 0 && g[0].item
  15887. }),
  15888. (n.prototype.examine = function (e) {
  15889. var t = e.mode,
  15890. i = (a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano)) || e.currentPano,
  15891. n = this.disc.getWorldPosition()
  15892. this.billboard.setActiveState()
  15893. var o = function () {
  15894. var t = this.billboard.getDimensions(),
  15895. n = new r.Vector3()
  15896. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  15897. n.unproject(e.camera),
  15898. e.flyToPano({
  15899. pano: i,
  15900. lookAtPoint: n
  15901. })
  15902. }.bind(this)
  15903. if (t === s.PANORAMA)
  15904. if (i !== e.currentPano) {
  15905. var l = {
  15906. pano: i,
  15907. lookAtPoint: n,
  15908. duration: null,
  15909. maxDistanceOverride: null,
  15910. skipWarpingCheck: !1
  15911. }
  15912. e.flyToPano(l, o)
  15913. } else
  15914. setTimeout(
  15915. function () {
  15916. this.billboard.open().then(function () {
  15917. o()
  15918. })
  15919. }.bind(this),
  15920. 0
  15921. )
  15922. else {
  15923. var c = {
  15924. pano: i
  15925. }
  15926. if (n) {
  15927. var h = new r.Matrix4().lookAt(i.position, n, new r.Vector3(0, 1, 0))
  15928. c.quaternion = new r.Quaternion().setFromRotationMatrix(h)
  15929. }
  15930. ;(c.callback = o), (c.duration = 1500), (c.mode = s.PANORAMA), e.flyToNewMode(c)
  15931. }
  15932. }),
  15933. (n.prototype.update = (function (e, t) {
  15934. var i = new r.Vector3()
  15935. return function (e, t) {
  15936. ;(this.discWorldPosition = this.disc.getWorldPosition()),
  15937. this.updateDisc(e, t),
  15938. this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t), i.z < 1 && ((i.y *= -1), this.billboard.update(i, this.getDiscRadius(i, t))))
  15939. }
  15940. })()),
  15941. (n.prototype.updateDisc = (function (e, t) {
  15942. var i = new r.Vector3(),
  15943. o = new r.Vector3(),
  15944. l = new r.Vector3(),
  15945. c = new r.Vector3(),
  15946. h = new r.Vector3()
  15947. return function (e, t) {
  15948. var u = a.tags.visibility,
  15949. d = a.tags.disc.scale,
  15950. p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition)
  15951. if (
  15952. ((this.obj3d.visible =
  15953. 0 !== this.disc.material.opacity &&
  15954. (u.anyDistance || p <= u.visibleDistance || e === s.TRANSITIONING) &&
  15955. (!u.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) &&
  15956. (!u.hideOffScreenDisc || !this.offScreen(this.disc, t)) &&
  15957. (!u.hideOffScreenObject || !this.offScreen(this.obj3d, t))),
  15958. this.obj3d.visible)
  15959. ) {
  15960. this.disc.quaternion.copy(t.quaternion)
  15961. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound)
  15962. i.copy(this.discWorldPosition).project(t),
  15963. o.set($('#player').width() / 2, $('#player').height() / 2, 1).multiply(i),
  15964. l.set(f / 2, 0, 0).add(o),
  15965. c.set(2 / $('#player').width(), 2 / $('#player').height(), 1).multiply(l),
  15966. h.copy(c).unproject(t)
  15967. var g = h.distanceTo(this.discWorldPosition),
  15968. m = 1 + (a.tags.disc.scale.responsiveness / 100) * (n.viewportScale() - 1)
  15969. ;(this.discScale = g * m), this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15970. }
  15971. }
  15972. })()),
  15973. (n.prototype.getDiscRadius = (function (e, t) {
  15974. var i = new r.Vector3()
  15975. return function (e, t) {
  15976. return (
  15977. i
  15978. .set(-this.discScale / 2, 0, 0)
  15979. .applyQuaternion(t.quaternion)
  15980. .add(this.discWorldPosition)
  15981. .project(t),
  15982. Math.abs(e.x - i.x) * $('#player').width()
  15983. )
  15984. }
  15985. })()),
  15986. (n.prototype.tagVisibleOnCurrentFloor = function (e) {
  15987. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15988. }),
  15989. (n.prototype.offScreen = function (e, t) {
  15990. var i = e.getWorldPosition().project(t)
  15991. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15992. }),
  15993. (n.viewportScale = function () {
  15994. return (
  15995. (n.viewportWidth === $('#player').width() && n.viewportHeight === $('#player').height()) ||
  15996. ((n.viewportWidth = $('#player').width()),
  15997. (n.viewportHeight = $('#player').height()),
  15998. (n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize))),
  15999. n.currentViewportScale
  16000. )
  16001. }),
  16002. (t.exports = n)
  16003. }).call(this, '/js/tag/tag.js')
  16004. },
  16005. {
  16006. '../enum/Colors': 19,
  16007. '../enum/RenderLayers': 41,
  16008. '../enum/RenderOrder': 42,
  16009. '../enum/Viewmode': 51,
  16010. '../objects/Panorama': 148,
  16011. '../settings': 166,
  16012. '../shaders': 167,
  16013. '../util/common': 185,
  16014. '../util/easing': 186,
  16015. '../util/lerp': 188,
  16016. '../util/logger': 189,
  16017. '../util/math': 190,
  16018. '../util/texture': 194,
  16019. '../util/transitions': 195,
  16020. './Billboard/Billboard': 119,
  16021. './Billboard/BillboardEvent': 120,
  16022. events: 202,
  16023. three: 217
  16024. }
  16025. ],
  16026. 124: [
  16027. function (e, t, i) {
  16028. ;(function (i) {
  16029. 'use strict'
  16030. function n() {
  16031. ;(this.tagState = y.IDLE),
  16032. (this.intersectTag = null),
  16033. (this.hoveredTag = null),
  16034. (this.activeTag = null),
  16035. (this.tagDiscs = []),
  16036. (this.raycaster = new r.Raycaster()),
  16037. (this.modelManager = null),
  16038. (this.player = null),
  16039. (this.totaltags = 0),
  16040. (this.navigatingViaTag = !1),
  16041. (this.enabled = !1)
  16042. }
  16043. var r = e('three'),
  16044. o = e('../util/logger'),
  16045. a = e('../util/common'),
  16046. s = e('../controls/serializer'),
  16047. l = e('../objects/Snapshot'),
  16048. c = e('../settings'),
  16049. h = e('./Billboard/BillboardEvent'),
  16050. u = e('./Media/MediaEvent'),
  16051. d = e('./Media/LinkType'),
  16052. p = e('../enum/Viewmode'),
  16053. f = e('../enum/WarpStyle'),
  16054. g = e('../enum/BlackoutStyle'),
  16055. m = e('../enum/ModelManagerEvents'),
  16056. v = e('../enum/tagEvents'),
  16057. A = e('../enum/PlayerEvents'),
  16058. y = (e('../util/lerp'), e('../enum/TagStates')),
  16059. C = e('events').EventEmitter,
  16060. I = new o(i)
  16061. a.extend(n, C),
  16062. (n.prototype.init = function (e, t) {
  16063. ;(this.modelManager = e), (this.player = t), this.updateModel(), this.bindEvents()
  16064. }),
  16065. (n.prototype.update = function (e) {
  16066. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  16067. }),
  16068. (n.prototype.updateTags = function (e, t, i, n) {
  16069. for (var r in this.model.tags) this.model.tags[r].update(e, t, i, n)
  16070. }),
  16071. (n.prototype.updateModel = function () {
  16072. ;(this.model = this.modelManager.getActiveModel()), this.gettagsFromModel(), (this.totaltags = Object.keys(this.model.tags).length)
  16073. }),
  16074. (n.prototype.gettagsFromModel = function () {
  16075. this.tagDiscs = []
  16076. for (var e in this.model.tags) {
  16077. var t = this.model.tags[e].disc
  16078. t && this.tagDiscs.push(t)
  16079. }
  16080. }),
  16081. (n.prototype.bindEvents = function () {
  16082. function e() {
  16083. Object.keys(this.model.tags).forEach(
  16084. function (e) {
  16085. var t = this.model.tags[e]
  16086. t.bindEvents(),
  16087. t.billboard.on(
  16088. u.LINK_CLICK,
  16089. function (e) {
  16090. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  16091. }.bind(this)
  16092. ),
  16093. t.billboard.on(
  16094. u.IMAGE_OPENED,
  16095. function () {
  16096. ;(this.tagState = y.EXAMINE), this.emit(u.IMAGE_OPENED)
  16097. }.bind(this)
  16098. ),
  16099. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  16100. }.bind(this)
  16101. )
  16102. }
  16103. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  16104. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  16105. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  16106. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  16107. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  16108. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  16109. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  16110. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  16111. e.call(this)
  16112. }),
  16113. (n.prototype.navigateViaLink = function (e) {
  16114. var t = s.deserialize(e)
  16115. if (t)
  16116. if (t.mode === p.PANORAMA) {
  16117. try {
  16118. this.player.model.panos.get(t.panoId)
  16119. } catch (e) {
  16120. return void I.warn('Unable to find panorama location', t.panoId)
  16121. }
  16122. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  16123. } else {
  16124. var i = {
  16125. cameraMode: t.mode,
  16126. position: t.position,
  16127. quaternion: t.quaternion,
  16128. scanId: t.panoId,
  16129. orthoZoom: t.zoom,
  16130. floorVisibility: t.floorVisibility,
  16131. thumbUrl: null,
  16132. name: null
  16133. }
  16134. this.player.flyToNewMode({
  16135. mode: t.mode,
  16136. duration: c.warp.outsideTime,
  16137. warpDest: new l(i),
  16138. force: !0
  16139. })
  16140. }
  16141. }),
  16142. (n.prototype.handleWarpStart = function (e, t, i, n) {
  16143. this.dismissExaminedTag(), t === f.BLACK && ((null !== n && void 0 !== n) || (n = c.warp.teleportTime), e && (i = g.END), this.hideShowTagsForBlackoutStyle(i, n))
  16144. }),
  16145. (n.prototype.handleWarpInterruption = function (e, t, i) {
  16146. ;(null !== i && void 0 !== i) || (i = c.warp.teleportTime), this.hideShowTagsForBlackoutStyle(t, i)
  16147. }),
  16148. (n.prototype.hideShowTagsForBlackoutStyle = function (e, t) {
  16149. var i = 0,
  16150. n = 0,
  16151. r = t / 2
  16152. switch (((null !== e && void 0 !== e) || (e = g.MIDDLE), e)) {
  16153. case g.END:
  16154. this.hideAlltags(r)
  16155. break
  16156. case g.BEGINNING:
  16157. this.hideAlltags().done(this.showAlltags.bind(this, r))
  16158. break
  16159. case g.NONE:
  16160. break
  16161. case g.MIDDLE:
  16162. ;(i = r),
  16163. (n = r),
  16164. this.hideAlltags(n),
  16165. setTimeout(
  16166. function () {
  16167. this.showAlltags(i)
  16168. }.bind(this),
  16169. n
  16170. )
  16171. break
  16172. case g.FADEIN:
  16173. setTimeout(
  16174. function () {
  16175. this.showAlltags(r)
  16176. }.bind(this),
  16177. r
  16178. )
  16179. }
  16180. }),
  16181. (n.prototype.onPlayerModeChanging = function (e, t) {
  16182. t !== p.PANORAMA && this.dismissExaminedTag(), t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR)
  16183. var i = t !== p.OUTDOOR
  16184. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16185. }),
  16186. (n.prototype.onPanoChange = function (e, t) {
  16187. var i = this.navigatingViaTag
  16188. if (((this.navigatingViaTag = !1), !i)) {
  16189. this.dismissExaminedTag()
  16190. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA,
  16191. r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA
  16192. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16193. }
  16194. }),
  16195. (n.prototype.onPlayerReady = function (e, t, i) {
  16196. this.startAlltags(e, t ? i : null)
  16197. }),
  16198. (n.prototype.onPlayerFlyingEnded = function (e, t) {
  16199. this.updateClosestTags(e)
  16200. }),
  16201. (n.prototype.dismissExaminedTag = function () {
  16202. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(), this.hoveredTag && (this.hoveredTag.setFreeState(!0), (this.hoveredTag = null))
  16203. }),
  16204. (n.prototype.startAlltags = function (e, t) {
  16205. ;(this.model.shouldShowtags = c.tags.enabled),
  16206. (this.enabled = !0),
  16207. e ||
  16208. (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  16209. t &&
  16210. setTimeout(
  16211. function () {
  16212. this.activateTag(this.model.getTagBySid(t))
  16213. }.bind(this),
  16214. c.tags.startup.fadeInDuration / 2
  16215. ))
  16216. }),
  16217. (n.prototype.showAlltags = function (e, t, i) {
  16218. function n() {
  16219. o++, o === this.totaltags && ((this.model.tagsShown = !0), r.resolve())
  16220. }
  16221. var r = $.Deferred()
  16222. if ((!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned()) || !this.model.shouldShowtags) return r.resolve().promise()
  16223. var o = 0
  16224. for (var a in this.model.tags) {
  16225. var s = this.model.tags[a]
  16226. s.show(e, t).done(n.bind(this))
  16227. }
  16228. return r.promise()
  16229. }),
  16230. (n.prototype.hideAlltags = function (e, t) {
  16231. function i() {
  16232. r++, r === this.totaltags && ((this.model.tagsShown = !1), n.resolve())
  16233. }
  16234. var n = $.Deferred(),
  16235. r = 0
  16236. for (var o in this.model.tags) {
  16237. var a = this.model.tags[o]
  16238. a.hide(e, t).done(i.bind(this)), a === this.activeTag && this.dismissActiveTag()
  16239. }
  16240. return n.promise()
  16241. }),
  16242. (n.prototype.enableHovering = function () {
  16243. this.enabled = !0
  16244. }),
  16245. (n.prototype.disableHovering = function () {
  16246. this.enabled = !1
  16247. }),
  16248. (n.prototype.activateTag = function (e, t) {
  16249. ;(t = t || y.EXAMINE), (this.activeTag = e), (this.activeTag.hoveringDisc = !0), this.activeTag.setHoverState(t === y.EXAMINE), (this.tagState = t), this.emit(v.TagActivated, e)
  16250. }),
  16251. (n.prototype.dismissActiveTag = function () {
  16252. ;(this.activeTag.hoveringDisc = !1), this.activeTag.setFreeState(!0)
  16253. var e = this.activeTag
  16254. ;(this.activeTag = null), (this.tagState = y.IDLE), this.emit(v.TagDismissed, e)
  16255. }),
  16256. (n.prototype.clickedOnTag = function (e) {
  16257. var t = function () {
  16258. ;(this.navigatingViaTag = !0), this.activeTag.examine(this.player), this.emit(v.TagNavigation, this.activeTag)
  16259. }.bind(this)
  16260. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE), (this.activeTag = this.intersectTag), t(), !0) : (this.dismissActiveTag(), !1)
  16261. }),
  16262. (n.prototype.intersecttag = (function () {
  16263. var e = new r.Vector3(),
  16264. t = new r.Vector3(),
  16265. i = new r.Vector3()
  16266. return function (n, r, o) {
  16267. if (!this.enabled) return null
  16268. var a = null,
  16269. s = this.tagDiscs.filter(function (e) {
  16270. return e.parent.visible
  16271. })
  16272. if (s.length > 0) {
  16273. var l = this.model.floors.reduce(function (e, t) {
  16274. return t.hidden ? e : e.concat(t.collider.children)
  16275. }, s)
  16276. e.set(n.x, n.y, -1).unproject(o), t.set(n.x, n.y, 1).unproject(o), i.copy(t).sub(e).normalize(), this.raycaster.set(e, i)
  16277. var c = this.raycaster.intersectObjects(l)
  16278. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  16279. }
  16280. return (
  16281. (this.intersectTag = a),
  16282. r &&
  16283. (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || (this.tagState === y.EXAMINE && a)) && this.dismissActiveTag(),
  16284. a &&
  16285. a !== this.activeTag &&
  16286. (a.listeners(h.ENTER).length < 1 &&
  16287. (a.billboard.on(
  16288. h.ENTER,
  16289. function () {
  16290. this.hoveredTag = a
  16291. }.bind(this)
  16292. ),
  16293. a.billboard.on(
  16294. h.LEAVE,
  16295. function () {
  16296. this.hoveredTag = null
  16297. }.bind(this)
  16298. )),
  16299. this.activateTag(a, y.BROWSE))),
  16300. a
  16301. )
  16302. }
  16303. })()),
  16304. (n.prototype.rankedtagInDirection = (function () {
  16305. var e = [],
  16306. t = [],
  16307. i = new r.Vector3(),
  16308. n = new r.Vector3(),
  16309. o = new r.Vector3()
  16310. return function (r, a, s, l) {
  16311. var c = 0
  16312. t.length = 0
  16313. for (var h = 0; h < this.closesttags.length; h++) {
  16314. var u = this.closesttags[h]
  16315. n.copy(u.position), n.add(u.discPosition), i.copy(a), i.sub(n).negate(), i.normalize()
  16316. var d = i.dot(l)
  16317. if (d >= 0) {
  16318. o.copy(n), o.project(s)
  16319. var p = this.intersecttag(o, !1, s)
  16320. if (p) {
  16321. if (c >= e.length)
  16322. for (var f = 0; f < 64; f++)
  16323. e.push({
  16324. tag: u,
  16325. dot: d
  16326. })
  16327. var g = e[c]
  16328. ;(g.tag = u), (g.dot = d), (g.position = math.projectPositionToCanvas(n, s)), t.push(g), c++
  16329. }
  16330. }
  16331. }
  16332. return (
  16333. t.sort(function (e, t) {
  16334. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16335. }),
  16336. r < t.length ? t[r].tag : null
  16337. )
  16338. }
  16339. })()),
  16340. (n.prototype.updateClosestTags = (function () {
  16341. var e = new r.Vector3(),
  16342. t = 30
  16343. return function (i) {
  16344. this.closesttags || (this.closesttags = []), (this.closesttags.length = 0)
  16345. var n = this.model.tags
  16346. if (n)
  16347. for (var r in n)
  16348. if (n.hasOwnProperty(r)) {
  16349. var o = n[r],
  16350. a = o.position
  16351. e.copy(i), e.sub(a).negate()
  16352. var s = e.lengthSq()
  16353. s < t && this.closesttags.push(o)
  16354. }
  16355. }
  16356. })()),
  16357. (t.exports = n)
  16358. }).call(this, '/js/tag/tagManager.js')
  16359. },
  16360. {
  16361. '../controls/serializer': 14,
  16362. '../enum/BlackoutStyle': 18,
  16363. '../enum/tagEvents': 32,
  16364. '../enum/ModelManagerEvents': 33,
  16365. '../enum/PlayerEvents': 40,
  16366. '../enum/TagStates': 44,
  16367. '../enum/Viewmode': 51,
  16368. '../enum/WarpStyle': 52,
  16369. '../objects/Snapshot': 153,
  16370. '../settings': 166,
  16371. '../util/common': 185,
  16372. '../util/lerp': 188,
  16373. '../util/logger': 189,
  16374. './Billboard/BillboardEvent': 120,
  16375. './Media/LinkType': 130,
  16376. './Media/MediaEvent': 131,
  16377. events: 202,
  16378. three: 217
  16379. }
  16380. ],
  16381. 125: [
  16382. function (e, t, i) {
  16383. ;(function (i) {
  16384. 'use strict'
  16385. function n() {
  16386. ;(this.embedWrapper = null), (this.embedElement = null)
  16387. }
  16388. var r = e('../../util/ajax'),
  16389. o = e('./mediaSettings'),
  16390. a = e('../../settings'),
  16391. s = e('../../util/logger'),
  16392. l = new s(i)
  16393. ;(n.prototype.createDomElement = function () {
  16394. return (this.embedWrapper = document.createElement('div')), this.embedWrapper.classList.add('tag-embed'), this.embedWrapper.classList.add('hidden'), this.embedWrapper
  16395. }),
  16396. (n.prototype.load = function (e) {
  16397. var t = 'https://api.embedly.com/1/oembed?key=' + a.appConfig.embedly_key + '&url=' + encodeURIComponent(e) + '&maxwidth=' + o.maxEmbedWidth
  16398. return new Promise(
  16399. function (e, i) {
  16400. r.get(t).then(
  16401. function (t) {
  16402. if (((t = JSON.parse(t)), t.html && t.html.indexOf('<script') === -1)) {
  16403. this.embedWrapper.innerHTML = t.html
  16404. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth
  16405. if (((this.embedWrapper.style.width = n + 'px'), t.height)) {
  16406. var r = t.height / t.width
  16407. this.embedWrapper.style.height = n * r + 'px'
  16408. }
  16409. this.embedElement = this.embedWrapper.firstChild
  16410. var a = []
  16411. try {
  16412. a = [].slice.call(this.embedElement.querySelectorAll('a'))
  16413. } catch (e) {
  16414. l.debug('Error getting `a` elements for embed; was it an iframe?')
  16415. }
  16416. a.forEach(function (e) {
  16417. e.setAttribute('target', '_blank')
  16418. }),
  16419. this.embedElement.classList.add('hidden'),
  16420. this.embedWrapper.classList.remove('hidden'),
  16421. e()
  16422. } else i('Not a valid embed')
  16423. }.bind(this),
  16424. function (e) {
  16425. i(e.response)
  16426. }
  16427. )
  16428. }.bind(this)
  16429. )
  16430. }),
  16431. (n.prototype.show = function () {
  16432. this.embedElement && this.embedElement.classList.remove('hidden')
  16433. }),
  16434. (n.prototype.hide = function () {
  16435. this.embedElement && this.embedElement.classList.add('hidden')
  16436. }),
  16437. (t.exports = n)
  16438. }).call(this, '/js/tag/Media/EmbedlyEmbed.js')
  16439. },
  16440. {
  16441. '../../settings': 166,
  16442. '../../util/ajax': 181,
  16443. '../../util/logger': 189,
  16444. './mediaSettings': 132
  16445. }
  16446. ],
  16447. 126: [
  16448. function (e, t, i) {
  16449. ;(function (i) {
  16450. 'use strict'
  16451. function n(e) {
  16452. o.call(this), (this.options = e), (this.playerControls = null), (this.state = s.NOT_READY)
  16453. }
  16454. var r = e('../../util/browser'),
  16455. o = e('./EmbedlyEmbed'),
  16456. a = e('../../util/logger'),
  16457. s =
  16458. (new a(i),
  16459. Object.freeze({
  16460. NOT_READY: 'player.not.ready',
  16461. CUED: 'player.cued',
  16462. PLAYING: 'player.playing',
  16463. PAUSED: 'player.paused'
  16464. }))
  16465. ;(n.prototype = Object.create(o.prototype)),
  16466. (n.prototype.createDomElement = function () {
  16467. return (this.embedWrapper = document.createElement('div')), this.embedWrapper.classList.add('tag-video'), this.embedWrapper.classList.add('hidden'), this.embedWrapper
  16468. }),
  16469. (n.prototype.load = function (e) {
  16470. var t = function () {
  16471. function e(e) {
  16472. ;(this.playerState = s.CUED), this.options.startMuted && this.playerControls.mute()
  16473. }
  16474. function t(e) {
  16475. this.playerState = e
  16476. }
  16477. function i(e) {
  16478. this.playerControls.setCurrentTime(0), this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16479. }
  16480. ;(this.playerControls = new playerjs.Player(this.embedElement)),
  16481. this.playerControls.on('ready', e.bind(this)),
  16482. this.playerControls.on('play', t.bind(this, s.PLAYING)),
  16483. this.playerControls.on('pause', t.bind(this, s.PAUSED)),
  16484. this.playerControls.on('ended', i.bind(this))
  16485. }.bind(this)
  16486. return o.prototype.load.call(this, e).then(t.bind(this))
  16487. }),
  16488. (n.prototype.play = (function () {
  16489. var e = r.isMobile()
  16490. return function () {
  16491. this.playerState !== s.NOT_READY && this.playerControls && !e && ((this.state === s.CUED && this.options.autoPlay) || this.options.autoResume) && this.playerControls.play()
  16492. }
  16493. })()),
  16494. (n.prototype.pause = function () {
  16495. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  16496. }),
  16497. (t.exports = n)
  16498. }).call(this, '/js/tag/Media/EmbedlyPlayer.js')
  16499. },
  16500. {
  16501. '../../util/browser': 182,
  16502. '../../util/logger': 189,
  16503. './EmbedlyEmbed': 125
  16504. }
  16505. ],
  16506. 127: [
  16507. function (e, t, i) {
  16508. ;(function (i) {
  16509. 'use strict'
  16510. function n(e) {
  16511. function t() {
  16512. return (
  16513. a.debug('requesting file from embedly:', e.href),
  16514. r
  16515. .get(e.href, {
  16516. responseType: e.responseType
  16517. })
  16518. .then(function (t) {
  16519. return a.debug('requesting file finished:', e.href), t
  16520. })
  16521. )
  16522. }
  16523. function i() {}
  16524. return (s = new Promise(function (e, n) {
  16525. s.catch(i).then(function () {
  16526. t().then(e, n)
  16527. })
  16528. }))
  16529. }
  16530. var r = e('../../util/ajax'),
  16531. o = (e('./mediaSettings'), e('../../util/logger')),
  16532. a = new o(i),
  16533. s = Promise.resolve()
  16534. t.exports.enqueue = n
  16535. }).call(this, '/js/tag/Media/EmbedlyQueue.js')
  16536. },
  16537. {
  16538. '../../util/ajax': 181,
  16539. '../../util/logger': 189,
  16540. './mediaSettings': 132
  16541. }
  16542. ],
  16543. 128: [
  16544. function (e, t, i) {
  16545. ;(function (i) {
  16546. 'use strict'
  16547. function n() {
  16548. ;(this.imageWrapper = null), (this.width = 0), (this.height = 0), (this.aspect = 1)
  16549. }
  16550. var r = e('./MediaEvent'),
  16551. o = e('./EmbedlyQueue'),
  16552. a = e('events').EventEmitter,
  16553. s = e('../../util/logger'),
  16554. l = e('../../settings')
  16555. new s(i)
  16556. ;(n.prototype = Object.create(a.prototype)),
  16557. (n.prototype.createDomElement = function () {
  16558. return (
  16559. (this.imageWrapper = document.createElement('div')),
  16560. this.imageWrapper.classList.add('tag-image'),
  16561. this.imageWrapper.classList.add('hidden'),
  16562. this.imageWrapper.addEventListener(
  16563. 'click',
  16564. function (e) {
  16565. e.stopPropagation(), this.emit(r.IMAGE_OPENING), (this.imageWrapper.style.pointerEvents = 'none')
  16566. }.bind(this)
  16567. ),
  16568. this.imageWrapper
  16569. )
  16570. }),
  16571. (n.prototype.onClosed = function () {
  16572. this.imageWrapper.style.pointerEvents = 'auto'
  16573. }),
  16574. (n.prototype.load = function (e) {
  16575. var t = Math.max(window.screen.height, window.screen.width),
  16576. i = 'https://i.embed.ly/1/display/resize?key=' + l.appConfig.embedly_key + '&url=' + encodeURIComponent(e) + '&width=' + t + '&height=' + t
  16577. return new Promise(
  16578. function (e, t) {
  16579. function n(t) {
  16580. var i = t.target
  16581. ;(this.width = i.naturalWidth), (this.height = i.naturalHeight), (this.aspect = this.width / this.height)
  16582. var n = t.target.src
  16583. ;(this.imageWrapper.style.backgroundImage = 'url("' + n + '")'),
  16584. (this.imageWrapper.style.width = this.width + 'px'),
  16585. (this.imageWrapper.style.height = this.height + 'px'),
  16586. this.imageWrapper.classList.remove('hidden'),
  16587. e()
  16588. }
  16589. o.enqueue({
  16590. href: i,
  16591. responseType: 'arraybuffer'
  16592. }).then(
  16593. function (e) {
  16594. var t = new Uint8Array(e),
  16595. i = new Blob([t]),
  16596. r = new window.Image()
  16597. r.addEventListener('load', n.bind(this))
  16598. var o = URL.createObjectURL(i)
  16599. r.src = o
  16600. }.bind(this),
  16601. t
  16602. )
  16603. }.bind(this)
  16604. )
  16605. }),
  16606. (t.exports = n)
  16607. }).call(this, '/js/tag/Media/Image.js')
  16608. },
  16609. {
  16610. '../../settings': 166,
  16611. '../../util/logger': 189,
  16612. './EmbedlyQueue': 127,
  16613. './MediaEvent': 131,
  16614. events: 202
  16615. }
  16616. ],
  16617. 129: [
  16618. function (e, t, i) {
  16619. 'use strict'
  16620. function n(e) {
  16621. ;(this.label = e.label), (this.href = e.url), (this.type = this.updateLinkForType()), (this.domElement = null), (this.id = c++)
  16622. }
  16623. var r = e('./LinkType'),
  16624. o = e('./MediaEvent'),
  16625. a = e('../../util/browser'),
  16626. s = e('../../analytics'),
  16627. l = e('events').EventEmitter,
  16628. c = 0
  16629. ;(n.prototype = Object.create(l.prototype)),
  16630. (n.prototype.updateLinkForType = function () {
  16631. function e(e) {
  16632. var t = new RegExp('[#&?]start=([^#&?]*)'),
  16633. i = t.exec(e)
  16634. return i[1]
  16635. }
  16636. function t(e) {
  16637. return e + '&play=1'
  16638. }
  16639. var i = a.valueFromHash('m') || a.valueFromHash('model')
  16640. return this.href.indexOf('port.com/show') !== -1 || this.href.indexOf(window.location.host + '/show') !== -1
  16641. ? this.href.indexOf(i) !== -1 && this.href.indexOf('start=') !== -1
  16642. ? ((this.href = e(this.href)), r.NAVIGATION)
  16643. : ((this.href = t(this.href)), r.MODEL)
  16644. : r.EXT_LINK
  16645. })
  16646. var h = {}
  16647. ;(n.prototype.createDomElement = function () {
  16648. function e(e) {
  16649. switch (
  16650. (e.stopPropagation(),
  16651. (h[this.id] = !0),
  16652. s.trackAlways('click_tag_link', {
  16653. link_type: this.type,
  16654. link_count: c,
  16655. links_clicked: Object.keys(h).length
  16656. }),
  16657. this.type)
  16658. ) {
  16659. case r.MODEL:
  16660. window.location.replace(this.href)
  16661. break
  16662. case r.EXT_LINK:
  16663. window.open(this.href, '_blank')
  16664. }
  16665. this.emit(o.LINK_CLICK, {
  16666. type: this.type,
  16667. url: this.href
  16668. })
  16669. }
  16670. if (((this.domElement = document.createElement('a')), this.domElement.classList.add('tag-link'), (this.domElement.textContent = this.label), this.type === r.EXT_LINK)) {
  16671. this.domElement.textContent += ' '
  16672. var t = document.createElement('i')
  16673. t.classList.add('icon-ext-link'), (t.title = 'Link to external web site'), this.domElement.appendChild(t)
  16674. }
  16675. return this.domElement.addEventListener('click', e.bind(this)), this.domElement
  16676. }),
  16677. (t.exports = n)
  16678. },
  16679. {
  16680. '../../analytics': 4,
  16681. '../../util/browser': 182,
  16682. './LinkType': 130,
  16683. './MediaEvent': 131,
  16684. events: 202
  16685. }
  16686. ],
  16687. 130: [
  16688. function (e, t, i) {
  16689. 'use strict'
  16690. t.exports = {
  16691. NAVIGATION: 'navigation',
  16692. MODEL: 'model',
  16693. EXT_LINK: 'ext-link'
  16694. }
  16695. },
  16696. {}
  16697. ],
  16698. 131: [
  16699. function (e, t, i) {
  16700. 'use strict'
  16701. t.exports = Object.freeze({
  16702. LINK_CLICK: 'mtmedia.link',
  16703. IMAGE_LOADED: 'mtmedia.image.loaded',
  16704. IMAGE_OPENING: 'mtmedia.image.opening',
  16705. IMAGE_OPENED: 'mtmedia.image.opened',
  16706. IMAGE_CLOSING: 'mtmedia.image.closing',
  16707. IMAGE_CLOSED: 'mtmedia.image.closed',
  16708. VIDEO_START: 'mtmedia.video.start',
  16709. VIDEO_PAUSE: 'mtmedia.video.pause',
  16710. VIDEO_ENDED: 'mtmedia.video.end'
  16711. })
  16712. },
  16713. {}
  16714. ],
  16715. 132: [
  16716. function (e, t, i) {
  16717. 'use strict'
  16718. t.exports = Object.freeze({
  16719. maxEmbedWidth: 350,
  16720. defaultAspectRatio: 0.75
  16721. })
  16722. },
  16723. {}
  16724. ],
  16725. 133: [
  16726. function (e, t, i) {
  16727. 'use strict'
  16728. t.exports = Object.freeze({
  16729. TEXT: 'text',
  16730. LINK: 'link',
  16731. IMAGE: 'photo',
  16732. VIDEO: 'video',
  16733. RICH: 'rich'
  16734. })
  16735. },
  16736. {}
  16737. ],
  16738. 134: [
  16739. function (e, t, i) {
  16740. 'use strict'
  16741. function n(e) {
  16742. this.capabilities = {
  16743. links: {
  16744. enable: e.supportLinks,
  16745. keepLabels: e.keepLinkLabels
  16746. }
  16747. }
  16748. }
  16749. var r = e('./DescriptionChunkType')
  16750. ;(n.prototype.parse = function (e, t) {
  16751. var i = [],
  16752. n = e.split('[').map(function (e, t) {
  16753. return 0 === t ? e : '[' + e
  16754. })
  16755. return (
  16756. n.forEach(
  16757. function (e) {
  16758. var n = this.findMarkdown(e)
  16759. if (n) {
  16760. if (n.url.indexOf('javascript:') !== -1) return
  16761. this.addLinkChunk(i, n, t), this.addTextChunk(i, e.slice(n.markdown.length))
  16762. } else this.addTextChunk(i, e)
  16763. }.bind(this)
  16764. ),
  16765. i
  16766. )
  16767. }),
  16768. (n.prototype.findMarkdown = function (e) {
  16769. var t = /\[([^\]]*)\]\((.*)\)/,
  16770. i = e.match(t)
  16771. if (i) {
  16772. for (var n = i[2], r = 1, o = 0; o < n.length && ('(' === n[o] ? r++ : ')' === n[o] && r--, 0 !== r); ) o++
  16773. var a = n.length - o
  16774. return {
  16775. markdown: i[0].substring(0, i[0].length - a),
  16776. label: i[1],
  16777. url: i[2].substring(0, o)
  16778. }
  16779. }
  16780. }),
  16781. (n.prototype.addTextChunk = function (e, t) {
  16782. 0 !== t.length &&
  16783. e.push({
  16784. type: r.TEXT,
  16785. text: t
  16786. })
  16787. }),
  16788. (n.prototype.addLinkChunk = function (e, t) {
  16789. if (!this.capabilities.links.enable) return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label))
  16790. var i = {
  16791. label: t.label,
  16792. url: t.url
  16793. }
  16794. i.url.indexOf('://') === -1 && (i.url = 'http://' + i.url),
  16795. e.push({
  16796. type: r.LINK,
  16797. link: i
  16798. })
  16799. }),
  16800. (t.exports = n)
  16801. },
  16802. {
  16803. './DescriptionChunkType': 133
  16804. }
  16805. ],
  16806. 135: [
  16807. function (e, t, i) {
  16808. ;(function (i) {
  16809. 'use strict'
  16810. var n = e('../util/logger'),
  16811. r = new n(i),
  16812. o = {
  16813. parseIdsFromChunkName: function (e, t) {
  16814. ;(t.floorId = o.parseFloor(e)), (t.roomId = o.parseRoom(e))
  16815. },
  16816. parseFloor: function (e) {
  16817. var t = e.match(/_group([0-9]+)/)
  16818. if (!t) return 0
  16819. try {
  16820. return parseInt(t[1], 10)
  16821. } catch (e) {
  16822. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'), 0
  16823. }
  16824. },
  16825. parseRoom: function (e) {
  16826. var t = e.match(/_sub([0-9]+)/)
  16827. if (!t) return -1
  16828. try {
  16829. return parseInt(t[1], 10)
  16830. } catch (e) {
  16831. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'), 0
  16832. }
  16833. }
  16834. }
  16835. t.exports = o
  16836. }).call(this, '/js/model/Chunks.js')
  16837. },
  16838. {
  16839. '../util/logger': 189
  16840. }
  16841. ],
  16842. 136: [
  16843. function (e, t, i) {
  16844. ;(function (i) {
  16845. 'use strict'
  16846. function n(e) {
  16847. s.call(this), (this.model = e), (this.exploded = !1)
  16848. }
  16849. var r = e('../objects/Floor'),
  16850. o = (e('../settings'), e('../util/logger')),
  16851. a = e('../util/transitions'),
  16852. s = e('../util/IndexedCollection'),
  16853. l = e('../util/common'),
  16854. c = e('../util/easing')
  16855. new o(i)
  16856. l.inherit(n, s),
  16857. (n.prototype.add = function (e) {
  16858. s.prototype.add.call(this, e), this.model.add(e)
  16859. }),
  16860. (n.prototype.getIndex = function (e) {
  16861. return e.floorIndex
  16862. }),
  16863. (n.prototype.build = function () {
  16864. this.list.forEach(function (e) {
  16865. e.build()
  16866. })
  16867. }),
  16868. (n.prototype.size = function () {
  16869. return this.length
  16870. }),
  16871. (n.prototype.sort = function () {
  16872. s.prototype.sort.call(this, function (e, t) {
  16873. return e.floorIndex - t.floorIndex
  16874. })
  16875. }),
  16876. (n.prototype.nextFloor = function (e, t) {
  16877. return this.index[e.floorIndex + t] || null
  16878. }),
  16879. (n.prototype.getFloorAtPoint = function (e) {
  16880. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16881. var r = this.list[n],
  16882. o = r.distanceToPoint(e)
  16883. ;(!t || i > o) && ((i = o), (t = r))
  16884. }
  16885. return t
  16886. }),
  16887. (n.prototype.getOrMakeFloor = function (e) {
  16888. var t = this.index[e]
  16889. return t || ((t = new r(this.model, e)), this.add(t)), t
  16890. }),
  16891. (n.prototype.hide = function () {
  16892. this.list.forEach(function (e) {
  16893. e.hide()
  16894. })
  16895. }),
  16896. (n.prototype.show = function () {
  16897. this.list.forEach(function (e) {
  16898. e.show()
  16899. })
  16900. }),
  16901. (n.prototype.names = function () {
  16902. return this.list.reduce(function (e, t) {
  16903. return e.concat(t.name)
  16904. }, [])
  16905. }),
  16906. (n.prototype.toggleExplodeHorizontal = function () {
  16907. function e(e, t) {
  16908. r.copy(e.position),
  16909. (e.position.x = i[e.floorIndex] * t),
  16910. (e.position.y = 1 * e.floorIndex * t),
  16911. r.sub(e.position).multiplyScalar(-1),
  16912. e.panos.forEach(function (e) {
  16913. e.translate(r)
  16914. })
  16915. }
  16916. var t,
  16917. i = [],
  16918. n = 0
  16919. this.list.forEach(function (e, r, o) {
  16920. ;(t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0), (n += t), (i[r] = n)
  16921. }),
  16922. (i = i.map(function (e) {
  16923. return e - n / 2
  16924. }))
  16925. var r = this.list[0].position.clone()
  16926. this.exploded
  16927. ? this.list.forEach(function (t) {
  16928. a.start(
  16929. function (i) {
  16930. e(t, 1 - i)
  16931. },
  16932. 1500,
  16933. null,
  16934. 0,
  16935. c.easeOutExpo
  16936. )
  16937. })
  16938. : this.list.forEach(function (t) {
  16939. a.start(
  16940. function (i) {
  16941. e(t, i)
  16942. },
  16943. 1500,
  16944. null,
  16945. 0,
  16946. c.easeOutExpo
  16947. )
  16948. }),
  16949. (this.exploded = !this.exploded)
  16950. }),
  16951. (n.prototype.toggleExplodeVertical = function () {
  16952. function e(e, i) {
  16953. var n = n.copy(e.position)
  16954. ;(e.position.y = (5 * e.floorIndex - t.y / 2) * i),
  16955. n.sub(e.position).multiplyScalar(-1),
  16956. e.panos.forEach(function (e) {
  16957. e.translate(n)
  16958. })
  16959. }
  16960. var t = this.model.size
  16961. this.list[0].position.clone()
  16962. this.exploded
  16963. ? this.list.forEach(function (t) {
  16964. a.start(
  16965. function (i) {
  16966. e(t, 1 - i)
  16967. },
  16968. 1500,
  16969. null,
  16970. 0,
  16971. c.easeOutExpo
  16972. )
  16973. })
  16974. : this.list.forEach(function (t) {
  16975. a.start(
  16976. function (i) {
  16977. e(t, i)
  16978. },
  16979. 1500,
  16980. null,
  16981. 0,
  16982. c.easeOutExpo
  16983. )
  16984. }),
  16985. (this.exploded = !this.exploded)
  16986. }),
  16987. (t.exports = n)
  16988. }).call(this, '/js/model/FloorCollection.js')
  16989. },
  16990. {
  16991. '../objects/Floor': 146,
  16992. '../settings': 166,
  16993. '../util/IndexedCollection': 175,
  16994. '../util/common': 185,
  16995. '../util/easing': 186,
  16996. '../util/logger': 189,
  16997. '../util/transitions': 195
  16998. }
  16999. ],
  17000. 137: [
  17001. function (e, t, i) {
  17002. ;(function (i) {
  17003. 'use strict'
  17004. function n() {
  17005. c.call(this)
  17006. }
  17007. var r = e('../settings'),
  17008. o = e('../util/logger'),
  17009. a = e('../enum/Viewmode'),
  17010. s = e('../objects/Snapshot'),
  17011. l = (e('../util/math'), e('../util/common')),
  17012. c = e('../util/IndexedCollection'),
  17013. h = new o(i)
  17014. l.inherit(n, c),
  17015. (n.prototype.getImage = function (e) {
  17016. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  17017. }),
  17018. (n.prototype.filterByModesAndReel = function (e, t) {
  17019. for (var i = [], n = 0; n < t.length; n += 1) {
  17020. var r = t[n],
  17021. o = this.index[r.sid]
  17022. o && i.push(o)
  17023. }
  17024. var s = e[a.DOLLHOUSE],
  17025. l = e[a.FLOORPLAN]
  17026. ;(i = i.filter(function (e) {
  17027. if (!e.metadata || void 0 === e.metadata.camera_mode) return !0
  17028. var t
  17029. try {
  17030. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  17031. } catch (e) {
  17032. return h.debug(e.message), !1
  17033. }
  17034. return t === a.PANORAMA || (t === a.FLOORPLAN && l) || (t === a.DOLLHOUSE && s)
  17035. })),
  17036. i.length !== this.list.length && h.info('Disallowed ' + (this.list.length - i.length) + ' highlight images'),
  17037. (this.list = i),
  17038. this.reIndex()
  17039. }),
  17040. (n.prototype.getHeroLocations = function (panos) {
  17041. //改 增加二级location
  17042. if (0 === this.list.length) return []
  17043. var locations = []
  17044. var deal = (info, container) => {
  17045. var src = info.thumbnail_signed_src,
  17046. o = info.name || ''
  17047. if (info.metadata && void 0 !== info.metadata.camera_quaternion) {
  17048. if (!r.show360Views.enabled && info.metadata.scan_id) {
  17049. let a = panos.get(info.metadata.scan_id)
  17050. if (a && !a.isAligned()) return
  17051. }
  17052. var cameraMode = a.convertWorkshopModeInt(info.metadata.camera_mode)
  17053. if (cameraMode === a.MESH) return
  17054. if (window.isLocal) src = manage.dealURL(src)
  17055. else src = 'one' === g_version ? g_Prefix + src + '?' + randomTime().getTime() : src + '?' + randomTime().getTime()
  17056. var l = {
  17057. cameraMode: cameraMode,
  17058. position: info.metadata.camera_position,
  17059. quaternion: info.metadata.camera_quaternion,
  17060. zoom: info.metadata.zoom,
  17061. panoId: info.metadata.scan_id,
  17062. orthoZoom: info.metadata.ortho_zoom,
  17063. floorVisibility: void 0 !== info.metadata.floor_visibility ? info.metadata.floor_visibility.slice(0) : [],
  17064. thumbUrl: src,
  17065. name: n.filterImageName(o),
  17066. sid: info.sid
  17067. }
  17068. var item = new s(l)
  17069. item.momentTour = info.momentTour
  17070. item.dontRot = info.dontRot
  17071. item.rotTime = info.rotTime
  17072. item.musicInfo = info.musicInfo || g_data2.tourAudio[info.sid] || {} //新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  17073. container.push(item)
  17074. return item
  17075. }
  17076. }
  17077. this.list.forEach(image => {
  17078. if (image.images) {
  17079. var folder = $.extend({}, image)
  17080. folder.heroLocations = []
  17081. image.images.list.forEach(child => {
  17082. deal(child, folder.heroLocations)
  17083. })
  17084. folder.musicInfo = folder.musicInfo || {}
  17085. locations.push(folder)
  17086. delete folder.images
  17087. delete folder.locations
  17088. } else {
  17089. var item = deal(image, locations)
  17090. }
  17091. })
  17092. return locations
  17093. }),
  17094. (n.prototype.getIndex = function (e) {
  17095. return e.sid
  17096. }),
  17097. (n.filterImageName = function (e) {
  17098. return '' === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  17099. }),
  17100. (t.exports = n)
  17101. }).call(this, '/js/model/ImageCollection.js')
  17102. },
  17103. {
  17104. '../enum/Viewmode': 51,
  17105. '../objects/Snapshot': 153,
  17106. '../settings': 166,
  17107. '../util/IndexedCollection': 175,
  17108. '../util/common': 185,
  17109. '../util/logger': 189,
  17110. '../util/math': 190
  17111. }
  17112. ],
  17113. 138: [
  17114. function (e, t, i) {
  17115. ;(function (i) {
  17116. 'use strict'
  17117. function n() {
  17118. u.call(this)
  17119. }
  17120. var r = e('../label/Label'),
  17121. o = e('../settings'),
  17122. a = e('../util/logger'),
  17123. s = e('../util/math'),
  17124. l = e('../util/ajax'),
  17125. c = e('./RoomCollection'),
  17126. h = e('../util/common'),
  17127. u = e('../util/IndexedCollection')
  17128. new a(i)
  17129. h.inherit(n, u),
  17130. (n.prototype.getIndex = function (e) {
  17131. return e.labelId
  17132. }),
  17133. (n.prototype.associateWithRooms = function (e) {
  17134. this.forEach(function (t) {
  17135. e.forEach(function (e) {
  17136. e.roomId === t.roomId && (t.room = e)
  17137. })
  17138. })
  17139. }),
  17140. (n.prototype.createFromLabelData = function (e) {
  17141. e.forEach(
  17142. function (e) {
  17143. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId)
  17144. t = c.generateRoomId(e.floorId, t)
  17145. var i = new r(e.sid, e.position || e.positions[0], e.text, e.floorId, t)
  17146. ;(i.position = s.convertWorkshopVector(i.position)), this.add(i), i.build()
  17147. }.bind(this)
  17148. )
  17149. }),
  17150. (n.prototype.load = function (e, t) {
  17151. return l
  17152. .get(e, {
  17153. responseType: 'json',
  17154. auth: t ? o.authorizationHeader : null
  17155. })
  17156. .done(
  17157. function (e) {
  17158. var t = []
  17159. for (var i in e) {
  17160. var n = e[i]
  17161. t.push(n)
  17162. }
  17163. this.createFromLabelData(t)
  17164. }.bind(this)
  17165. )
  17166. }),
  17167. (n.parseRoomIndexFromWorkshopRoomId = function (e) {
  17168. var t = -1
  17169. if (e) {
  17170. if (typeof e == 'number') {
  17171. //add
  17172. t = parseInt(e)
  17173. } else {
  17174. var i = e.split('_')
  17175. t = parseInt(i[0])
  17176. }
  17177. }
  17178. return t
  17179. }),
  17180. (t.exports = n)
  17181. }).call(this, '/js/model/LabelCollection.js')
  17182. },
  17183. {
  17184. '../label/Label': 90,
  17185. '../settings': 166,
  17186. '../util/IndexedCollection': 175,
  17187. '../util/ajax': 181,
  17188. '../util/common': 185,
  17189. '../util/logger': 189,
  17190. '../util/math': 190,
  17191. './RoomCollection': 141
  17192. }
  17193. ],
  17194. 139: [
  17195. function (e, t, i) {
  17196. ;(function (i) {
  17197. 'use strict'
  17198. function n(e, t) {
  17199. o.Object3D.call(this)
  17200. this.sid = window.number //t.sid,
  17201. ;(this.data = t),
  17202. (this.options = e),
  17203. (this.urls = new s(e.urlFiles)),
  17204. (this.isPublic = void 0 !== t.is_public && t.is_public),
  17205. //创建heroLocations
  17206. (this.images = new _(this)),
  17207. this.images.extend(t.images),
  17208. this.images.forEach(info => {
  17209. if (info.locations) {
  17210. info.images = new _(this)
  17211. info.images.extend(info.locations)
  17212. }
  17213. })
  17214. this.heroLocations = []
  17215. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  17216. ;(this.outdoorPanoLocations = []),
  17217. (this.floors = new d(this)),
  17218. (this.floorsEnabled = void 0 === e.floors || e.floors),
  17219. (this.changingFloor = !1),
  17220. (this.chunks = []),
  17221. (this.panos = new A()),
  17222. (this.colliders = []),
  17223. (this.loadPanosPromise = null),
  17224. (this.loadMeshTexturesPromise = null),
  17225. (this.auxDataPromise = null),
  17226. (this.meshTexturesLoaded = !1),
  17227. (this.meshTextures = []),
  17228. (this.tags = {}),
  17229. (this.tagsShown = !1),
  17230. (this.shouldShowtags = !1),
  17231. (this.has360Views = !1),
  17232. (this.showingLabels = f.labels.enabled && t.player_options.labels),
  17233. (this.supportedModes = {}),
  17234. (this.supportedModes[c.PANORAMA] = !0),
  17235. (this.supportedModes[c.DOLLHOUSE] = !t.player_options || (t.player_options.dollhouse && w.valueFromHash('dh', 1))),
  17236. (this.supportedModes[c.FLOORPLAN] = !t.player_options || (t.player_options.floor_plan && w.valueFromHash('dh', 1))),
  17237. (this.supportedModes[c.TRANSITIONING] = !0),
  17238. (this.supportsTiles = this.configureTiling()),
  17239. // this.supportsVR = t.is_vr,
  17240. (this.supportsVR = window.DATA.supportsVR || false) //true; // 方奕卓 VR功能可配置
  17241. ;(this.mode = c.DOLLHOUSE),
  17242. (this.size = null),
  17243. (this.center = null),
  17244. (this.boundingBox = new o.Box3()),
  17245. (this.currentFloor = null),
  17246. (this.allFloorsVisible = !0),
  17247. (this.projectedPano0 = null),
  17248. (this.projectedPano1 = null),
  17249. this.floorsEnabled &&
  17250. t.floors &&
  17251. t.floors.indexOf(',') !== -1 &&
  17252. t.floors.split(',').forEach(
  17253. function (e, t) {
  17254. this.addFloor(new u(this, t, e.trim()))
  17255. }.bind(this)
  17256. ),
  17257. (this.waitQueue = []),
  17258. this.on(
  17259. 'load',
  17260. function (e) {
  17261. 0 !== this.waitQueue.length &&
  17262. ((this.waitQueue = this.waitQueue.filter(function (e) {
  17263. return !e.isLoadedCallback()
  17264. })),
  17265. 0 === this.waitQueue.length && this.emit('waiting-done'))
  17266. }.bind(this)
  17267. ),
  17268. this.setupCustomProperties()
  17269. this.hots = {}
  17270. }
  17271. function r() {
  17272. try {
  17273. var e = document.createElement('canvas'),
  17274. t = e.getContext('webgl')
  17275. t || (t = e.getContext('experimental-webgl'))
  17276. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  17277. return i
  17278. } catch (e) {
  17279. return 0
  17280. }
  17281. }
  17282. var o = e('three'),
  17283. a = e('../util/ajax'),
  17284. s = e('../util/ModelUrls'),
  17285. l = e('../objects/BoundingTextureSkybox'),
  17286. c = e('../enum/Viewmode'),
  17287. h = e('../enum/RenderOrder'),
  17288. u = (e('../enum/AlignmentType'), e('../objects/Floor')),
  17289. d = e('./FloorCollection'),
  17290. p = e('../objects/Chunk'),
  17291. f = (e('../objects/Room'), e('../objects/Snapshot'), e('../label/Label'), e('../util/math'), e('../settings')),
  17292. ss = e('../shaders'),
  17293. g = e('../util/logger'),
  17294. m = e('../tag/tag'),
  17295. v = (e('../tag/tagManager'), e('../objects/Panorama')),
  17296. A = e('../util/PanoramaCollection'),
  17297. y = e('../loaders/ModelLoader'),
  17298. C = e('../loaders/ModelTextureLoader'),
  17299. I = e('../loaders/SweepDataLoader'),
  17300. E = e('../util/transitions'),
  17301. b = e('../util/common'),
  17302. es = e('../util/easing'),
  17303. lerp = e('../util/lerp'),
  17304. tex = e('../util/texture'),
  17305. w = e('./../util/browser'),
  17306. _ = e('./ImageCollection'),
  17307. T = e('./RoomCollection'),
  17308. x = e('./LabelCollection'),
  17309. S = e('./Chunks'),
  17310. cameraLight = e('./util/cameraLight'),
  17311. M = e('./../util/showcase'),
  17312. R = e('../exception/BasicException'),
  17313. P = (e('../constants'), e('events').EventEmitter),
  17314. GLCubeFaces = e('../enum/GLCubeFaces'),
  17315. //,Hot = e("hot")
  17316. O = new g(i)
  17317. ;(n.prototype = Object.create(o.Object3D.prototype)),
  17318. b.extend(n, P),
  17319. (n.prototype.setupCustomProperties = function () {
  17320. var e = f.modelAlpha
  17321. Object.defineProperty(this, 'alpha', {
  17322. get: function () {
  17323. return e
  17324. },
  17325. set: function (t) {
  17326. e = t
  17327. //console.log(t)
  17328. this.chunks.forEach(function (chunk) {
  17329. if (chunk.material && chunk.material.uniforms.modelAlpha) {
  17330. chunk.material.uniforms.modelAlpha.value = e
  17331. //修改一下defines,为了在不需要map时不加载map。 by xzw
  17332. /* if (e>0) {
  17333. if (!('useModelMap' in chunk.material.defines)) {
  17334. chunk.material.defines.useModelMap = ''
  17335. chunk.material.needsUpdate = true
  17336. console.log('add useModelMap')
  17337. }
  17338. } else {
  17339. if ('useModelMap' in chunk.material.defines) {
  17340. delete chunk.material.defines.useModelMap
  17341. chunk.material.needsUpdate = true
  17342. chunk.material.uniforms.map.value.dispose() //防止崩溃(但是因为这样飞出要等待时间所以被去掉了)
  17343. console.log('delete useModelMap')
  17344. }
  17345. } */
  17346. }
  17347. })
  17348. }
  17349. })
  17350. }),
  17351. (n.prototype.configureTiling = function () {
  17352. var e = r()
  17353. if (e < 2048) return !1
  17354. O.warn('Max cube texture size: ' + e)
  17355. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  17356. var i = f.tiling.tilingFlagNames[t]
  17357. if ('1' === w.valueFromHash(i, null)) return !0
  17358. if ('0' === w.valueFromHash(i, null)) return !1
  17359. }
  17360. //--------------------------------------------许钟文-------------------------------------------
  17361. //return true;
  17362. return !!M.modelDataPromisesTiles(this.data) //免去访问mdoeldata.json的vision_version,不明白这是什么
  17363. //--------------------------------------------e n d -------------------------------------------
  17364. }),
  17365. (n.prototype.toggleAlpha = function () {
  17366. this.alpha < 1 ? (this.alpha = 1) : (this.alpha = 0)
  17367. }),
  17368. (n.prototype.load = function (e) {
  17369. var t = function () {
  17370. return $.when(this.loadPanos(), this.loadMesh())
  17371. },
  17372. i = this.urls.init().then(t.bind(this))
  17373. return (
  17374. e ? (i = i.then(this.loadMeshTextures.bind(this))) : i.then(this.loadMeshTextures.bind(this)),
  17375. (this.auxDataPromise = $.when(/*this.loadHighlightReel(), this.loadtags() */ this.loadhots(), this.loadLabels())),
  17376. $.when(i, this.auxDataPromise).done(this.build.bind(this))
  17377. ) //不要另外使用active_reel文件
  17378. }),
  17379. (n.prototype.loadMesh = function () {
  17380. function e(e) {
  17381. O.error(e), n.reject('loading-failed')
  17382. }
  17383. function t(e, t) {
  17384. n.notify(e, t)
  17385. }
  17386. function i(e, t) {
  17387. if (0 === e.length) {
  17388. O.warn('No geometry found for model, loading faux geometry, disabling outside mode'), (r.supportedModes[c.DOLLHOUSE] = !1), (r.supportedModes[c.FLOORPLAN] = !1)
  17389. var i = new p({
  17390. geometry: new o.PlaneBufferGeometry(5, 5, 1, 1)
  17391. })
  17392. ;(i.material.visible = !1), i.rotateX(-Math.PI / 2), i.geometry.computeBoundingBox(), (e = [i])
  17393. }
  17394. e.forEach(function (e) {
  17395. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0
  17396. r.addChunk(t, e)
  17397. }),
  17398. r.floors.sort(),
  17399. n.resolve(r)
  17400. }
  17401. var n = $.Deferred(),
  17402. r = this
  17403. return y.load(r.data.job.uuid, r.urls, i, t, e), n.promise()
  17404. }),
  17405. (n.prototype.loadMeshTextures = function () {
  17406. return this.loadTexturesPromise
  17407. ? this.loadTexturesPromise
  17408. : ((this.loadTexturesPromise = C.load(this, this.meshTextures).then(
  17409. function () {
  17410. this.meshTexturesLoaded = !0
  17411. }.bind(this)
  17412. )),
  17413. this.loadTexturesPromise)
  17414. }),
  17415. /* n.prototype.loadtags = function() {//xzw改
  17416. var e = $.Deferred();
  17417. if (!f.tags.enabled)
  17418. return e.resolve();
  17419. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  17420. t = "data/" + this.sid + "/tags.json"
  17421. return a.get(t, {
  17422. responseType: "json",
  17423. auth: this.isPublic ? null : f.authorizationHeader
  17424. }).done(function(t) {
  17425. var i = 0
  17426. , n = 0;
  17427. for (var r in t) {
  17428. var o = t[r];
  17429. o.enabled && (n++,
  17430. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  17431. i++))
  17432. }
  17433. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  17434. e.resolve()
  17435. }
  17436. .bind(this)).fail(function() {
  17437. O.warn("Getting tags failed, not displaying tags."),
  17438. e.resolve()
  17439. }),
  17440. e
  17441. } */
  17442. (n.prototype.shineHots = function () {
  17443. //xzw
  17444. E.trigger({
  17445. func: function (e) {
  17446. var opa = e <= 0.5 ? 2 * e : -2 * e + 2
  17447. for (var i in this.hots) {
  17448. this.hots[i].mesh.material.uniforms.opac.value = opa
  17449. }
  17450. }.bind(this),
  17451. cycling: true,
  17452. duration: 3000,
  17453. //easing: "easeInOutQuad",
  17454. name: 'hotShine'
  17455. })
  17456. }),
  17457. /* n.prototype.loadOverlays = function(overlays){
  17458. var overlays = window.data2 && window.data2.overlays
  17459. overlays && overlays.forEach((info)=>{
  17460. new Overlay(info)
  17461. })
  17462. Overlay.load()
  17463. }
  17464. */
  17465. (n.prototype.loadhots = function () {
  17466. //xzw
  17467. initHot(this)
  17468. this.roomLabels = []
  17469. this.hotsCount = 0
  17470. var r = $.Deferred()
  17471. var t = g_Prefix + 'data/' + this.sid + '/data2.js' + '?' + randomTime().getTime()
  17472. return (
  17473. a
  17474. .get(t, {
  17475. responseType: 'json',
  17476. auth: this.isPublic ? null : f.authorizationHeader
  17477. })
  17478. .done(
  17479. function (e) {
  17480. window.data2 = e
  17481. if (!e) {
  17482. console.error('data2 is null')
  17483. } else {
  17484. g_data2 = hotMatcher(e)
  17485. let create = () => {
  17486. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  17487. if (e.hots) {
  17488. var sids = Object.keys(e.hots).sort((a, b) => {
  17489. return e.hots[a].order - e.hots[b].order
  17490. })
  17491. sids.forEach(sid => {
  17492. e.hots[sid].sid = sid
  17493. if (e.hots[sid].texType == 'photo' && !e.hots[sid].texSrc) return console.error('有photo热点无texSrc', e.hots[sid])
  17494. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && 'byHot')
  17495. })
  17496. }
  17497. if (e.overlays) {
  17498. e.overlays.forEach(info => {
  17499. //if(info.file.includes('m/data/762/edit/20210312_112357584.mp4') )return;
  17500. new Hot(info, 'byOverlay')
  17501. })
  17502. }
  17503. Hot.createHotList()
  17504. Hot.startLoad()
  17505. {
  17506. let maxCount = browser.isMobile() ? 200000 : 400000
  17507. let noVisiHots = this.hotGroup.children.filter(e => !e.info.visiblePanos && e.info.texType != 'shine') //只看非热点的,否则数据太多
  17508. //let visiHots = this.hotGroup.children.filter(e=>e.info.visiblePanos)
  17509. let c = this.panos.list.length * this.colliders.length * noVisiHots.length
  17510. if (c > maxCount) {
  17511. //防止加载时间过长,分批计算
  17512. console.log('hot分批setVisiblePanos')
  17513. Hot.visiPanosCountSlice = Math.ceil(maxCount / this.colliders.length / noVisiHots.length)
  17514. Hot.visiEveryDurSlice = browser.isMobile() ? 25 : 16
  17515. let dur = Math.ceil(this.panos.list.length / Hot.visiPanosCountSlice) * Hot.visiEveryDurSlice
  17516. console.log(Hot.visiPanosCountSlice, Hot.visiEveryDurSlice, dur, Math.round(dur * noVisiHots.length))
  17517. if (noVisiHots.length) {
  17518. let i = 0
  17519. let hotVisiInterval = setInterval(() => {
  17520. noVisiHots[i].setVisiblePanos()
  17521. i++
  17522. if (i >= noVisiHots.length) {
  17523. clearInterval(hotVisiInterval)
  17524. }
  17525. }, dur)
  17526. }
  17527. }
  17528. }
  17529. if (DATA.roomLabels) {
  17530. DATA.roomLabels.forEach(data => {
  17531. this.roomLabels.push(new RoomLabel(data))
  17532. })
  17533. }
  17534. }
  17535. if (player.currentPano) {
  17536. create()
  17537. } else {
  17538. let f = () => {
  17539. window.bus.removeEventListener('playerAndModelReady', f)
  17540. create()
  17541. }
  17542. window.bus.addEventListener('playerAndModelReady', f)
  17543. }
  17544. g_index = w.valueFromHash('m')
  17545. }
  17546. /***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
  17547. /* var dataJsPromise = $.Deferred();
  17548. var dataJsUrl = g_Prefix+"data/" + this.sid + "/hot/js/data.js" +'?'+ randomTime().getTime();
  17549. a.get(dataJsUrl,{
  17550. responseType: "json",
  17551. auth: this.isPublic ? null : f.authorizationHeader
  17552. }).done(function(data) {
  17553. window.hotData = data;
  17554. this.createHotItem(data, this.hots);
  17555. for(let i in this.hots){//add
  17556. data[i] && this.hots[i].initStyleImg(data[i]);
  17557. }
  17558. dataJsPromise.resolve();
  17559. }.bind(this)).fail(function(){
  17560. console.log('Data.js is empty');
  17561. dataJsPromise.resolve();
  17562. }) */
  17563. r.resolve()
  17564. }.bind(this)
  17565. )
  17566. .fail(function () {
  17567. console.log('没有热点')
  17568. r.resolve()
  17569. }),
  17570. r
  17571. )
  17572. }),
  17573. (n.prototype.loadPanos = function () {
  17574. if (this.loadPanosPromise) return this.loadPanosPromise
  17575. var e = new I(this)
  17576. return (
  17577. (this.loadPanosPromise = e.load().then(
  17578. function (e) {
  17579. return (
  17580. this.data.sweeps &&
  17581. Object.keys(this.data.sweeps).length > 0 &&
  17582. (e = e.filter(
  17583. function (e) {
  17584. if (this.data.sweeps[e.uuid]) return this.data.sweeps[e.uuid].enabled
  17585. else console.log(e.uuid)
  17586. }.bind(this)
  17587. )),
  17588. this.panos.extend(
  17589. e.map(
  17590. function (e) {
  17591. return new v(this, e.uuid, e, this.supportsTiles)
  17592. }.bind(this)
  17593. )
  17594. ),
  17595. this.panos.forEach(
  17596. function (e) {
  17597. e.neighbourUUIDs &&
  17598. (e.neighbourUUIDs.forEach(
  17599. function (t) {
  17600. var i = this.panos.get(t)
  17601. i && this.panos.setNeighbour(e, i, !0)
  17602. }.bind(this)
  17603. ),
  17604. (e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0)))
  17605. }.bind(this)
  17606. ),
  17607. 0 === this.panos.length && (O.warn('Model has no panos, turning off inside mode'), (this.supportedModes[c.PANORAMA] = !1)),
  17608. $.when(this)
  17609. )
  17610. }.bind(this)
  17611. )),
  17612. this.loadPanosPromise
  17613. )
  17614. }),
  17615. (n.prototype.loadHighlightReel = function () {
  17616. //xzw
  17617. var e = $.Deferred(),
  17618. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  17619. t = this.options.urlBase + 'data/' + this.sid + '/active_reel.json'
  17620. return (
  17621. a
  17622. .get(t, {
  17623. responseType: 'json',
  17624. auth: this.isPublic ? null : f.authorizationHeader
  17625. })
  17626. .done(
  17627. function (t) {
  17628. t.reel ? (O.info('Got highlight reel with ' + t.reel.length + ' items'), this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info('No highlight reel found'),
  17629. e.resolve()
  17630. }.bind(this)
  17631. )
  17632. .fail(function () {
  17633. O.warn('Getting highlight reel failed, no highlights available'), e.resolve()
  17634. }),
  17635. e
  17636. )
  17637. }),
  17638. (n.prototype.waitForLoad = function (e, t) {
  17639. t() ||
  17640. (this.waitQueue.push({
  17641. object: e,
  17642. isLoadedCallback: t
  17643. }),
  17644. 1 === this.waitQueue.length && this.emit('waiting'))
  17645. }),
  17646. (n.prototype.hide = function () {
  17647. this.floors.hide()
  17648. }),
  17649. (n.prototype.show = function () {
  17650. this.floors.show()
  17651. }),
  17652. (n.prototype.floorNames = function () {
  17653. return this.floors.names()
  17654. }),
  17655. (n.prototype.warpDestFloors = function (e, t) {
  17656. if (!e || this.floors.length !== e.length) return void this.toggleAllFloors(!0)
  17657. var i = e.findIndex(
  17658. function (e) {
  17659. return e
  17660. }.bind(this)
  17661. )
  17662. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  17663. }),
  17664. (n.prototype.setFloor = function (e, t, i) {
  17665. this.allFloorsVisible && this.emit('allfloors.toggled', !1, this.currentFloor), (this.allFloorsVisible = !1), this._setFloor(e, t, i)
  17666. }),
  17667. (n.prototype.toggleAllFloors = function (e) {
  17668. ;(this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible), this.emit('allfloors.toggled', this.allFloorsVisible, this.currentFloor), this._setFloor(this.currentFloor)
  17669. }),
  17670. (n.prototype._setFloor = function (e, t, i) {
  17671. ;(t = t || this.mode), this.emit('floor.changed', e, t, this.currentFloor), (this.currentFloor = e)
  17672. var n
  17673. if (t === c.PANORAMA) {
  17674. if ((this.show(), this.shouldShowtags && this.tagsShown)) for (n in this.tags) this.tags[n].show(f.showFloorDuration)
  17675. } else if (
  17676. (t === c.FLOORPLAN || t === c.DOLLHOUSE) &&
  17677. (this.floors.list.forEach(
  17678. function (e, t) {
  17679. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17680. }.bind(this)
  17681. ),
  17682. this.shouldShowtags && this.tagsShown)
  17683. )
  17684. for (n in this.tags) {
  17685. var r = this.tags[n]
  17686. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  17687. }
  17688. var o = this,
  17689. a = e
  17690. E.start(
  17691. function () {},
  17692. f.showFloorDelay,
  17693. function () {
  17694. o.floors.forEach(function (e) {
  17695. e.chunks.forEach(function (t) {
  17696. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  17697. })
  17698. })
  17699. }.bind(this)
  17700. )
  17701. }),
  17702. (n.prototype.toggleExplode = function () {
  17703. this.floors.toggleExplodeHorizontal()
  17704. }),
  17705. (n.prototype.toggleExplodeUp = function () {
  17706. this.floors.toggleExplodeVertical()
  17707. }),
  17708. (n.prototype.nextFloor = function (e) {
  17709. return this.floors.nextFloor(this.currentFloor, e)
  17710. }),
  17711. (n.prototype.addFloor = function (e) {
  17712. this.floors.add(e)
  17713. }),
  17714. (n.prototype.getFloorAtPoint = function (e) {
  17715. return this.floors.getFloorAtPoint(e)
  17716. }),
  17717. (n.prototype.getTagBySid = function (e) {
  17718. return this.tags[e]
  17719. }),
  17720. (n.prototype.addChunk = function (e, t) {
  17721. this.floors.getOrMakeFloor(e).addChunk(t), this.chunks.push(t)
  17722. }),
  17723. (n.prototype.setMode = function (e) {
  17724. if (!this.supportedModes[e]) throw new R('Mode not supported for this model: ' + e)
  17725. this.mode = e
  17726. this.skybox.material.transparent = e == 'panorama' ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17727. this.chunks.forEach(function (t) {
  17728. t.setMode(e)
  17729. })
  17730. }),
  17731. (n.prototype.build = function () {
  17732. this.heroLocations = this.images.getHeroLocations(this.panos)
  17733. var e = function () {
  17734. return (
  17735. !!(this.heroImage && this.heroImage.metadata && this.heroImage.metadata.scan_id && this.panos.get(this.heroImage.metadata.scan_id)) &&
  17736. !this.panos.get(this.heroImage.metadata.scan_id).isAligned()
  17737. )
  17738. }.bind(this)()
  17739. ;(this.has360Views =
  17740. (f.show360Views.enabled &&
  17741. this.heroLocations.some(
  17742. function (e) {
  17743. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17744. }.bind(this)
  17745. )) ||
  17746. e),
  17747. null === this.heroImage && O.warn('No hero image defined.'),
  17748. (this.currentFloor = this.floors.last()),
  17749. this.floors.build(),
  17750. (this.colliders = this.floors.reduce(function (e, t) {
  17751. return e.concat(t.collider.children)
  17752. }, [])),
  17753. this.panos.forEach(
  17754. function (e) {
  17755. e.build1(),
  17756. e.on(
  17757. 'enter',
  17758. function () {
  17759. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17760. }.bind(this)
  17761. )
  17762. }.bind(this)
  17763. )
  17764. //有很多场景的floorPosition在地面之下,导致marker看不到,所以探测一下
  17765. let time1 = performance.now()
  17766. let downVec = new THREE.Vector3(0, -1, 0)
  17767. this.panos.forEach(pano => {
  17768. player.raycaster.set(pano.position, downVec)
  17769. let collider = pano.floor.collider.children
  17770. let n = player.raycaster.intersectObjects(collider, true) //add true
  17771. if (n && n[0]) {
  17772. if (n[0].point.y - pano.floorPosition.y > 0.03) {
  17773. //console.error(`${pano.id}, 探测高度${n[0].point.y.toPrecision(5)} 原高度 ${pano.floorPosition.y.toPrecision(5)}, 相差 ${(n[0].point.y - pano.floorPosition.y).toPrecision(5)}`)
  17774. pano.originFloorY = pano.floorPosition.y
  17775. pano.floorPosition.y = n[0].point.y
  17776. }
  17777. }
  17778. //是否需要排除一下相差过高的?因为可能探测到的是长椅这样的
  17779. })
  17780. let time2 = performance.now()
  17781. console.log('探测时间', time2 - time1)
  17782. this.panos.forEach(function (e) {
  17783. e.build2()
  17784. }),
  17785. this.floors.forEach(
  17786. function (e) {
  17787. this.boundingBox.union(e.boundingBox)
  17788. }.bind(this)
  17789. ),
  17790. (this.size = this.boundingBox.size()),
  17791. (this.center = this.boundingBox.center()),
  17792. this.floors.forEach(
  17793. function (e) {
  17794. O.info('Floor ' + e + ': ' + e.children.length + ' chunks, ' + e.panos.length + ' panos.')
  17795. }.bind(this)
  17796. ),
  17797. this.panos.populate_path_graph(),
  17798. (this.skybox = new l(this.boundingBox)),
  17799. (this.skybox.matrixWorldNeedsUpdate = !0),
  17800. this.add(this.skybox)
  17801. //因为一部分漫游点在模型外
  17802. {
  17803. let bounding = new THREE.Box3() //不包含pano的bound
  17804. this.floors.list.forEach(floor => {
  17805. bounding.union(floor.conservativeBoundingBox)
  17806. })
  17807. this.boundWithoutPanos = bounding
  17808. this.sizeWithoutPanos = bounding.size()
  17809. this.centerWithoutPanos = bounding.center()
  17810. /* 如果想居中模型, bound不加pano:
  17811. this.boundingBox = bounding
  17812. this.size = bounding.size()
  17813. this.center = bounding.center() */
  17814. }
  17815. this.createFloorLogo()
  17816. return (
  17817. O.debug('Done building model'),
  17818. v.raycastsDone > 0 && (O.warn('raycasts: ' + v.raycastsDone), O.warn('raycasts skipped: ' + v.raycastsSkipped)),
  17819. this.buildRooms(),
  17820. this.labels.associateWithRooms(this.rooms),
  17821. $.when(this)
  17822. )
  17823. }),
  17824. (n.prototype.createFloorLogo = function () {
  17825. console.log('createFloorLogo')
  17826. if (this.floorLogos || !settings.floorlogoURL) return
  17827. var url = settings.floorlogoURL
  17828. var map = tex.load(url) //可以追加done
  17829. this.floorLogos = []
  17830. for (var i = 0; i < 2; i++) {
  17831. //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  17832. var material = new o.MeshBasicMaterial({
  17833. opacity: 0,
  17834. map: map,
  17835. side: o.DoubleSide,
  17836. transparent: !0,
  17837. depthWrite: !1,
  17838. depthTest: false //改 在chunk\skybox外也可看到
  17839. })
  17840. var logo = new o.Mesh(new o.PlaneGeometry(2, 2, 1, 1), material)
  17841. //var s = (Store.metadata.floorLogoSize || 100)/100;
  17842. //logo.scale.set(s,s,s);
  17843. logo.position.set(0, -1.5, 0)
  17844. logo.lookAt(logo.position.clone().add(new o.Vector3(0, 1, 0)))
  17845. logo.renderOrder = 100 //cover the videoSkybox
  17846. //logo.layers.set(0)
  17847. this.add(logo)
  17848. this.floorLogos.push(logo)
  17849. }
  17850. this.floorLogos[1].visible = false
  17851. })
  17852. ;(n.prototype.adjustfloorLogoHeight = function (o) {
  17853. var h = player.currentPano.floorPosition.y + 0.01
  17854. this.floorLogos[1].position.setY(h)
  17855. this.floorLogos[0].position.setY(h)
  17856. //publicObjectSet.player.path.currentPanoMarker.mesh.position.y = h
  17857. }),
  17858. (n.prototype.changefloorLogoOpa = function (o) {
  17859. //改 i, opacity, time, delay
  17860. if (!this.floorLogos) return
  17861. E.cancelById('flOpa_' + o.index) //先停止之前该logo的透明度变化
  17862. if (o.from != void 0) this.floorLogos[o.index].material.opacity = o.from //初始透明度
  17863. if (!o.dur) {
  17864. //立刻
  17865. //this.floorLogos[o.index].material.uniforms.opacity.value = o.opa;
  17866. this.floorLogos[o.index].material.opacity = o.opa
  17867. } else {
  17868. //E.start(lerp.uniform(this.floorLogos[o.index], "opacity", o.opa), o.dur || 0, null,
  17869. E.start(lerp.property(this.floorLogos[o.index].material, 'opacity', o.opa), o.dur || 0, null, o.delay || 0, es['easeInQuad'], 'changefloorLogoOpa', 'flOpa_' + o.index)
  17870. }
  17871. }),
  17872. (n.prototype.updateFloorlogo = (function () {
  17873. //xzw add 更新地标的旋转
  17874. var lastQ, lastP
  17875. var equals = function (v1, v2, min) {
  17876. return Math.abs(v1 - v2) < min
  17877. }
  17878. var isSame = function (now, last, k) {
  17879. //如果和上次相同就不改变
  17880. if (!last) return false
  17881. var R = k.sceneRenderer
  17882. //var min = R.AFPS < 38 ? 0.005 : R.AFPS < 45 ? 0.0008 : R.AFPS < 50 ? 0.0006 : 0.0003;
  17883. //暂时:
  17884. var min = 0.0008
  17885. var same = equals(now.x, last.x, min) && equals(now.y, last.y, min) && equals(now.z, last.z, min) && (now.w != void 0 ? equals(now.w, last.w, min) : true)
  17886. return same
  17887. }
  17888. return function (Q, k) {
  17889. if (!Q) return
  17890. /* if(Config.ifFish && window.lowFPS){
  17891. this.fLCompute++;
  17892. if(R.AFPS < 38){
  17893. if(k.flyingToTag && k.flying && k.fLCompute %4 !=1) return; //点击tag过渡
  17894. else if(k.flying && k.fLCompute%2 !=1) return;
  17895. k.fLCompute %= 4;
  17896. }else if(R.AFPS < 45){
  17897. if(k.flyingToTag && k.flying && k.fLCompute %3 !=1) return; //点击tag过渡
  17898. else if(k.flying && k.fLCompute%2 !=1) return;
  17899. k.fLCompute %= 6;
  17900. }else{
  17901. if(k.flyingToTag && k.flying && k.fLCompute %2 !=1) return;
  17902. //else if(k.flying && k.fLCompute%2 !=1) return;
  17903. k.fLCompute %= 2;
  17904. }
  17905. } */
  17906. var sameQ, sameP, quaternion, visible
  17907. for (var i = 0; i < 2; i++) {
  17908. var logo = this.floorLogos[i]
  17909. if (!logo.visible || logo.material.uniforms.opacity.value == 0) continue
  17910. visible = true
  17911. }
  17912. if (!visible) return //如果两个都不可见,就不更改,如果有一个可见,就都改
  17913. var c = k.cameraControls.activeControl
  17914. var sameQ = c ? (c.lat < 10 ? equals(c.lon, lastQ, 0.1) : equals(c.lon, lastQ, 1)) : false
  17915. sameQ || (lastQ = c ? c.lon : null) //相机旋转是否改变了
  17916. for (var i = 0; i < 2; i++) {
  17917. var logo = this.floorLogos[i]
  17918. if (!sameQ) {
  17919. if (!quaternion) {
  17920. var a = new THREE.Vector3(0, 0, -1)
  17921. a.applyQuaternion(Q)
  17922. a.setY(0)
  17923. var _ = new THREE.Matrix4().lookAt(a, new THREE.Vector3(), new THREE.Vector3(0, 1, 0))
  17924. quaternion = new THREE.Quaternion().setFromRotationMatrix(_)
  17925. var a = new THREE.Quaternion(0, 0.7071067811865476, 0.7071067811865476, 0) //计算得
  17926. quaternion.multiply(a)
  17927. }
  17928. logo.quaternion.copy(quaternion)
  17929. }
  17930. }
  17931. }
  17932. })())
  17933. ;(n.prototype.loadLabels = function () {
  17934. //xzw
  17935. this.labels = new x(this)
  17936. var e = $.Deferred()
  17937. //加载俯视图的标签 注释这个备注就会加载
  17938. //原先是labels, 改为showLabels,因为之前的somedata写的labels都是true
  17939. window.DATA.showingLabels ? (this.showingLabels = true) : ''
  17940. if (!this.showingLabels) return e.resolve()
  17941. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  17942. var t = g_Prefix + 'data/' + this.sid + '/labels.json'
  17943. return (
  17944. this.labels
  17945. .load(t, !this.isPublic)
  17946. .done(e.resolve.bind(e))
  17947. .fail(function () {
  17948. O.warn('Getting labels failed, not displaying labels.'), e.resolve()
  17949. }),
  17950. e
  17951. )
  17952. }),
  17953. (n.prototype.buildRooms = function () {
  17954. ;(this.rooms = new T(this)), this.rooms.createFromChunks(this.chunks), this.rooms.calcRoomBoundaries()
  17955. }),
  17956. (n.prototype.updateProjectedPanos = function () {
  17957. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17958. }),
  17959. (n.prototype.setProjectedPanos = function (e, t, i) {
  17960. ;(void 0 !== i && null !== i) || (i = !0),
  17961. (i = !!i),
  17962. (this.projectedPano0 = e),
  17963. (this.projectedPano1 = t),
  17964. this.skybox.material.setProjectedPanos(e, t, i),
  17965. this.chunks.forEach(function (n) {
  17966. n.materialInside.setProjectedPanos(e, t, i)
  17967. })
  17968. }),
  17969. (n.prototype.setSide = function (e) {
  17970. this.floors.forEach(function (t) {
  17971. t.collider.material.side = e
  17972. })
  17973. }),
  17974. (n.prototype.heroCount = function () {
  17975. return this.heroLocations ? this.heroLocations.length : 0
  17976. }),
  17977. (n.prototype.getHeroDescriptorByIndex = function (e = []) {
  17978. //改 因增加了二级目录
  17979. if (e[0] < 0) return O.warn('Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0.'), null
  17980. if (this.heroCount() < 1) return O.warn('Model.getHeroDescriptorByIndex() -> No hero locations in this model'), null
  17981. var t = this.heroLocations[e[0]]
  17982. if (t.heroLocations && e[1] != void 0) {
  17983. t = t.heroLocations[e[1]]
  17984. }
  17985. return void 0 === t ? (O.warn('Model.getHeroDescriptorByIndex() -> Index ' + e + ' is not a validindex'), null) : t
  17986. }),
  17987. (n.prototype.findPanoramicHero = function () {
  17988. for (var e in this.heroLocations) if (this.heroLocations[e].cameraMode === c.PANORAMA) return this.heroLocations[e]
  17989. return null
  17990. }),
  17991. (n.prototype.listImagePanos = function () {
  17992. var e = [],
  17993. t = this
  17994. return (
  17995. this.images.forEach(function (i) {
  17996. if (i.metadata && i.metadata.scan_id) {
  17997. var n = t.panos.get(i.metadata.scan_id)
  17998. n && (t.supportsTiles || n.isLoaded('high') || e.push(n))
  17999. }
  18000. }),
  18001. e
  18002. )
  18003. }),
  18004. (n.prototype.fadePanoMarkers = function (/* e, t */ opacity, dur, o = {}) {
  18005. //改
  18006. //this.panos.fadeMarkerOpacity(e, t)
  18007. if (window.DATA.hideFloorMarker) return
  18008. var currentPano = player.currentPano
  18009. opacity = void 0 == opacity ? _settings.panorama.markerOpacity : opacity //不传opacity代表显示
  18010. var hideWhenFlyOut = () => {
  18011. var shows = [],
  18012. hides = []
  18013. player.model.panos.forEach(pano => {
  18014. hides.push(pano)
  18015. })
  18016. this.panos.fadeMarkerOpacity(0, dur, [{ toOp: 0, member: hides }])
  18017. }
  18018. if (opacity == 0) {
  18019. hideWhenFlyOut()
  18020. } else {
  18021. if (player.mode == 'panorama' && currentPano) {
  18022. var shows = [],
  18023. hides = []
  18024. player.model.panos.forEach(pano => {
  18025. //是邻近点就显示否则隐藏
  18026. if (currentPano.neighbourPanos[pano.id]) {
  18027. shows.push(pano)
  18028. } else {
  18029. hides.push(pano)
  18030. }
  18031. })
  18032. this.panos.fadeMarkerOpacity(opacity, dur, [
  18033. { toOp: opacity, member: shows },
  18034. { toOp: 0, member: hides }
  18035. ])
  18036. } else if (player.modeTran.split('-')[1] != 'panorama') {
  18037. //飞出后marker隐藏
  18038. hideWhenFlyOut()
  18039. }
  18040. }
  18041. }),
  18042. (n.prototype.setSweepVisibility = function (e) {
  18043. this.panos.forEach(function (t) {
  18044. t.marker && (t.marker.visible = e)
  18045. })
  18046. }),
  18047. (n.prototype.outsideAllowed = function () {
  18048. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  18049. }),
  18050. (n.prototype.addHighMapCube = function () {
  18051. //创建8*8的tile cube
  18052. if (player.qualityManager.getMaxZoomClass() == '4k' && player.qualityManager.maxRenderTargetSize == 2048) {
  18053. var geo = new THREE.PlaneGeometry(1, 1, 1, 1)
  18054. var cube = new THREE.Object3D()
  18055. cube.tiles = []
  18056. for (var cubeIndex = 0; cubeIndex < 6; cubeIndex++) {
  18057. var face = new THREE.Object3D()
  18058. for (var i = 0; i < 8; i++) {
  18059. for (var j = 0; j < 8; j++) {
  18060. var tile = new THREE.Mesh(geo, new THREE.MeshBasicMaterial({ side: 2 }))
  18061. tile.position.set(i - 3.5, j - 3.5, -4)
  18062. if (highMapAddColor) {
  18063. tile.material.opacity = 0.4
  18064. var colorHue = Math.random()
  18065. tile.material.color = new THREE.Color().setHSL(colorHue, 0.6, 0.9)
  18066. }
  18067. tile.material.transparent = true
  18068. tile.material.depthTest /* = tile.material.depthWrite */ = false //防止chunk比cube近从而被遮 且能不遮住box视频和热点等
  18069. tile.visible = false
  18070. tile.tileX = i
  18071. tile.tileY = j
  18072. tile.cubeFace = cubeIndex
  18073. tile.renderOrder = 2 //RenderOrder.highTileCube
  18074. cube.tiles.push(tile)
  18075. face.add(tile)
  18076. }
  18077. }
  18078. switch (cubeIndex) {
  18079. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  18080. face.rotation.set(0, Math.PI / 2, 0)
  18081. break
  18082. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  18083. face.rotation.set(0, -Math.PI / 2, 0)
  18084. break
  18085. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  18086. var rot1 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 1, 0), Math.PI)
  18087. var rot2 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(1, 0, 0), Math.PI / 2)
  18088. face.quaternion.copy(rot1).multiply(rot2)
  18089. //face.rotation.set(Math.PI/2,0,0);
  18090. break
  18091. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  18092. //face.rotation.set(-Math.PI/2,0,0);
  18093. var rot1 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 1, 0), Math.PI)
  18094. var rot2 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(1, 0, 0), -Math.PI / 2)
  18095. face.quaternion.copy(rot1).multiply(rot2)
  18096. break
  18097. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  18098. face.rotation.set(0, Math.PI, 0)
  18099. break
  18100. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  18101. face.rotation.set(0, 0, 0)
  18102. }
  18103. face.scale.set(1, -1, 1)
  18104. cube.add(face)
  18105. }
  18106. cube.name = 'highMapCube'
  18107. this.highMapCube = cube
  18108. this.add(cube)
  18109. cube.scale.set(0.21, 0.21, 0.21) //camera.near is 0.1
  18110. this.highMapCube.visible = false
  18111. this.highMapCube.texLoadedCount = 0
  18112. player.once('pano.chosen', () => {
  18113. //wait sceneRenderer
  18114. player.sceneRenderer.on('after-render', e => {
  18115. if (this.highMapCube.visibleTiles) {
  18116. this.updateTiles()
  18117. }
  18118. if (player && player.lastFrameChanged) {
  18119. common.intervalTool.isWaiting(
  18120. 'update4kTiles',
  18121. () => {
  18122. let vectorForward = player.getDirection()
  18123. this.updateTiles(vectorForward)
  18124. },
  18125. 500
  18126. )
  18127. }
  18128. })
  18129. })
  18130. }
  18131. })
  18132. /*
  18133. highMapCube会遮住场景中所有物体, 如果一定要显示的话,只能类似potree中的那样渲染一个深度贴图出来(model无需贴图),然后其他所有物体的shader中都加入一段代码。(貌似本身已经支持了?)
  18134. */
  18135. n.prototype.isHighMapLoaded = function (cubeFace, tileX, tileY) {
  18136. var tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  18137. return !!tile.material.map
  18138. }
  18139. n.prototype.updateTiles = function (direction) {
  18140. if (!this.highMapCube || !this.highMapCube.visible) return
  18141. if (this.highMapCube.tiles.filter(e => e.image).length <= 10) return //加载的太少了
  18142. //performance.mark('updateTiles-start')
  18143. if (direction) {
  18144. let camera = player.cameraControls.cameras.panorama
  18145. let hfov = THREE.Math.degToRad(cameraLight.getHFOVForCamera(camera, $('#player').width(), $('#player').height())) / 2
  18146. let vfov = THREE.Math.degToRad(camera.fov) / 2
  18147. /* let hcos = Math.cos(hfov / 2)
  18148. let vcos = Math.cos(vfov / 2) */
  18149. let list = this.highMapCube.tiles
  18150. list.forEach(e => {
  18151. //屏幕外的不显示
  18152. let pos = e.getWorldPosition(new THREE.Vector3())
  18153. let dir = new THREE.Vector3().subVectors(pos, this.highMapCube.position).normalize()
  18154. let hcos_ = dir.clone().setY(direction.y).normalize().dot(direction) //在direction的斜面上水平角度差
  18155. let hRad = Math.acos(hcos_)
  18156. let vRad = -200
  18157. if (hRad > hfov + 0.08) {
  18158. e.score = -100
  18159. } else {
  18160. vRad = Math.abs(Math.acos(dir.y) - Math.acos(direction.y))
  18161. if (vRad > vfov + 0.08) {
  18162. e.score = -100
  18163. } else {
  18164. e.score = -(hRad / hfov + vRad / vfov)
  18165. }
  18166. }
  18167. e.scores = hRad.toFixed(3) + ', ' + vRad.toFixed(3)
  18168. if (e.score == -100) {
  18169. this.resetTile(e)
  18170. }
  18171. })
  18172. this.highMapCube.visibleTiles = list.filter(e => e.score > -100)
  18173. /* this.highMapCube.visibleTiles.sort((e,b)=>{return e.score-b.score})
  18174. this.highMapCube.visibleTiles = this.highMapCube.visibleTiles.slice(0,10)
  18175. */
  18176. //list.forEach(e=>e.scoreLabel.setText(e.scores))
  18177. }
  18178. let needRecover = this.highMapCube.visibleTiles.filter(e => !e.material.map)
  18179. if (needRecover.length) {
  18180. let maxCount = 1 //common.getBestCount({ name: '4kmaxTileRecover', minCount: 0, maxCount: 2, durBound1: 1.5, durBound2: 6, ifLog: false, maxHistory: 2 })
  18181. let count = 0
  18182. needRecover.forEach((e, i) => {
  18183. //只更新若干个,因为太耗时了, 其余的等下帧更新
  18184. if (count >= maxCount) return
  18185. let r = this.recoverTile(e)
  18186. if (r) count++
  18187. })
  18188. }
  18189. }
  18190. n.prototype.getHighImage = function (image, cubeFace, tileX, tileY) {
  18191. this.gotSomeHighImg = true //标记,需要马上updateTiles
  18192. let tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  18193. tile.image = image //先记录下来
  18194. }
  18195. n.prototype.updateHighMap = function (image, cubeFace, tileX, tileY) {
  18196. let tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  18197. if (image) tile.image = image //先记录下来
  18198. if (tile.material.map) return
  18199. if (this.highMapCube.visibleTiles && !this.highMapCube.visibleTiles.includes(tile)) {
  18200. return
  18201. }
  18202. //简易创建贴图
  18203. /* var tex = this.$app.core.get('SceneRenderer').initSizedTexture2D(512, THREE.ClampToEdgeWrapping)
  18204. //var loaded = this.$app.core.get('Player').model.isHighMapLoaded(tile.cubeFace, tile.tileX, tile.tileY)
  18205. this.$app.core.get('SceneRenderer').uploadTexture2D(image, tex, 0, 0, 512, 512) //只替换tex对应的img,不新建
  18206. */
  18207. var tex = new THREE.Texture()
  18208. tex.image = image
  18209. tex.flipY = false
  18210. tex.wrapS = tex.wrapT = THREE.ClampToEdgeWrapping
  18211. tex.generateMipmaps = false
  18212. tex.minFilter = THREE.LinearFilter
  18213. tex.needsUpdate = true
  18214. tile.material.map = tex
  18215. if (highMapAddColor) {
  18216. tile.material.opacity = 1
  18217. }
  18218. tile.visible = true
  18219. tile.material.needsUpdate = true //发现每次开始放大但还未放大到4k时也会把之前加载过的4k加载
  18220. //console.log( {level:1} , 'updateHighMap', cubeFace, tileX, tileY)
  18221. }
  18222. n.prototype.recoverTile = function (tile) {
  18223. if (tile.material.map) return
  18224. if (tile.image) {
  18225. this.updateHighMap(tile.image, tile.cubeFace, tile.tileX, tile.tileY)
  18226. return true
  18227. } else {
  18228. //console.log('no image')
  18229. }
  18230. }
  18231. n.prototype.resetTile = function (tile, kill) {
  18232. if (kill) {
  18233. //完全消灭
  18234. tile.image = null
  18235. }
  18236. let map = tile.material.map
  18237. if (map) {
  18238. map.dispose() //这句其实无效。本来可以使用three自带的deallocateTexture(texture),但因为创建的方式不是普通的new Texture,所以并没有onTextureDispose的侦听,故要自己写
  18239. map.loaded = !1
  18240. map.version = 0
  18241. //这两句才是真正释放贴图资源的 ,类似app.sceneRenderer.deallocateCubeTexture(tile.material.map)
  18242. var h = player.sceneRenderer.renderer.properties.get(map)
  18243. player.sceneRenderer.renderer.getContext().deleteTexture(h.__webglTexture)
  18244. tile.material.map = null
  18245. if (highMapAddColor) {
  18246. tile.material.opacity = 0.4
  18247. }
  18248. tile.material.needsUpdate = true
  18249. tile.visible = false
  18250. //this.highMapCube.texLoadedCount --
  18251. //console.log({level:1},'resetTile'/* , tile.cubeFace, tile.tileX, tile.tileY */)
  18252. }
  18253. }
  18254. n.prototype.resetHighMap = function () {
  18255. if (!this.highMapCube) return
  18256. this.highMapCube.children.forEach(e =>
  18257. e.children.forEach(tile => {
  18258. this.resetTile(tile, true)
  18259. })
  18260. )
  18261. //this.highMapCube.texLoadedCount = 0
  18262. this.highMapCube.visibleTiles = null
  18263. this.hideHighMap()
  18264. }
  18265. n.prototype.setHighMap = function (pano) {
  18266. if (!this.highMapCube) return
  18267. this.highMapCube.position.copy(pano.position)
  18268. this.highMapCube.quaternion.copy(pano.quaternion)
  18269. }
  18270. n.prototype.showHighMap = function () {
  18271. if (!this.highMapCube) return
  18272. this.highMapCube.visible = true
  18273. }
  18274. n.prototype.hideHighMap = function () {
  18275. if (!this.highMapCube) return
  18276. this.highMapCube.visible = false
  18277. }
  18278. //缩小后继续显示cube呢还是不显示? 不显示的话,就要把cube上的复制到renderTarget上……会不会又崩溃,or没加载的显示???
  18279. t.exports = n
  18280. }).call(this, '/js/model/Model.js')
  18281. },
  18282. {
  18283. '../constants': 8,
  18284. '../enum/AlignmentType': 17,
  18285. '../enum/RenderOrder': 42,
  18286. '../enum/Viewmode': 51,
  18287. '../exception/BasicException': 55,
  18288. '../label/Label': 90,
  18289. '../loaders/ModelLoader': 105,
  18290. '../loaders/ModelTextureLoader': 106,
  18291. '../loaders/SweepDataLoader': 107,
  18292. '../tag/tag': 123,
  18293. './util/cameraLight': 184,
  18294. '../tag/tagManager': 124,
  18295. '../objects/BoundingTextureSkybox': 143,
  18296. '../objects/Chunk': 144,
  18297. '../objects/Floor': 146,
  18298. '../objects/Panorama': 148,
  18299. '../objects/Room': 150,
  18300. '../objects/Snapshot': 153,
  18301. '../settings': 166,
  18302. '../shaders': 167,
  18303. '../util/ModelUrls': 177,
  18304. '../util/PanoramaCollection': 178,
  18305. '../util/ajax': 181,
  18306. '../util/common': 185,
  18307. '../util/easing': 186,
  18308. '../util/lerp': 188,
  18309. '../util/logger': 189,
  18310. '../util/math': 190,
  18311. '../util/texture': 194,
  18312. '../util/transitions': 195,
  18313. './../util/browser': 182,
  18314. './../util/showcase': 193,
  18315. './Chunks': 135,
  18316. './FloorCollection': 136,
  18317. './ImageCollection': 137,
  18318. './LabelCollection': 138,
  18319. './RoomCollection': 141,
  18320. events: 202,
  18321. three: 217,
  18322. hot: 'hot',
  18323. '../enum/GLCubeFaces': 25
  18324. }
  18325. ],
  18326. 140: [
  18327. function (e, t, i) {
  18328. 'use strict'
  18329. function n() {
  18330. ;(this.modelMap = {}), (this.activeModel = null), (this.modelCount = 0), (this.tileDownloader = null), (this.panoRenderer = null)
  18331. }
  18332. var r = (e('three'), e('../util/common')),
  18333. o = e('../exception/BasicException'),
  18334. a = e('../enum/ModelManagerEvents'),
  18335. s = e('../enum/PanoRendererEvents'),
  18336. l = e('events').EventEmitter
  18337. ;(n.prototype.init = function (e, t, i) {
  18338. ;(this.tileDownloader = e), (this.panoRenderer = t), (this.qualityManager = i), this.bindEvents()
  18339. }),
  18340. (n.prototype.bindEvents = function () {
  18341. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  18342. }),
  18343. (n.prototype.onTileRendered = function (e, t, i, n) {}),
  18344. (n.prototype.addModel = function (e) {
  18345. ;(this.modelMap[e.sid] = e), 0 === this.modelCount && this.activateModel(e.sid), this.modelCount++, this.emit(a.ModelAdded)
  18346. }),
  18347. (n.prototype.getModel = function (e) {
  18348. return this.modelMap[e]
  18349. }),
  18350. (n.prototype.activateModel = function (e) {
  18351. var t = this.modelMap[e]
  18352. if (!t) throw new o('Tried to activate invalid model!')
  18353. var i = this.activeModel
  18354. ;(this.activeModel = t),
  18355. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  18356. this.tileDownloader.setUrls(t.urls),
  18357. t.panos.forEach(
  18358. function (e) {
  18359. e.attachToPanoRenderer(this.panoRenderer), (e.tileDownloader = this.tileDownloader), (e.qualityManager = this.qualityManager)
  18360. }.bind(this)
  18361. ),
  18362. this.emit(a.ActiveModelChanged, {
  18363. oldModel: i,
  18364. model: t
  18365. })
  18366. }),
  18367. (n.prototype.getActiveModel = function () {
  18368. return this.activeModel
  18369. }),
  18370. r.extend(n, l),
  18371. (t.exports = n)
  18372. },
  18373. {
  18374. '../enum/ModelManagerEvents': 33,
  18375. '../enum/PanoRendererEvents': 35,
  18376. '../exception/BasicException': 55,
  18377. '../util/common': 185,
  18378. events: 202,
  18379. three: 217
  18380. }
  18381. ],
  18382. 141: [
  18383. function (e, t, i) {
  18384. ;(function (i) {
  18385. 'use strict'
  18386. function n() {
  18387. s.call(this)
  18388. }
  18389. var r = e('../objects/Room'),
  18390. o = (e('../settings'), e('../util/logger')),
  18391. a = (e('../util/transitions'), e('../util/easing'), e('../util/common')),
  18392. s = e('../util/IndexedCollection'),
  18393. l = e('./Chunks')
  18394. new o(i)
  18395. a.inherit(n, s),
  18396. (n.prototype.getIndex = function (e) {
  18397. return e.roomId
  18398. }),
  18399. (n.prototype.calcRoomBoundaries = function () {
  18400. this.forEach(function (e) {
  18401. e.calcBoundaries()
  18402. })
  18403. }),
  18404. (n.prototype.createFromChunks = function (e) {
  18405. var t = {
  18406. floorId: -1,
  18407. roomId: -1
  18408. },
  18409. i = {}
  18410. e.forEach(
  18411. function (e) {
  18412. l.parseIdsFromChunkName(e.name, t)
  18413. var o = i[t.roomId]
  18414. if (!o) {
  18415. var a = n.generateRoomId(t.floorId, t.roomId)
  18416. ;(o = new r(t.floorId, a)), this.add(o), (i[t.roomId] = o)
  18417. }
  18418. o.addChunk(e)
  18419. }.bind(this)
  18420. ),
  18421. this.calcRoomBoundaries()
  18422. }),
  18423. (n.generateRoomId = function (e, t) {
  18424. return e + '_' + t
  18425. }),
  18426. (t.exports = n)
  18427. }).call(this, '/js/model/RoomCollection.js')
  18428. },
  18429. {
  18430. '../objects/Room': 150,
  18431. '../settings': 166,
  18432. '../util/IndexedCollection': 175,
  18433. '../util/common': 185,
  18434. '../util/easing': 186,
  18435. '../util/logger': 189,
  18436. '../util/transitions': 195,
  18437. './Chunks': 135
  18438. }
  18439. ],
  18440. 142: [
  18441. function (e, t, i) {
  18442. 'use strict'
  18443. function n(e, t, i) {
  18444. e = e.clone().expandByScalar(0.01) //改
  18445. var n = e.size(),
  18446. o = new r.BoxGeometry(n.x, n.y, n.z)
  18447. ;(o.boundingBox = e), r.Mesh.call(this, o, t), this.position.copy(e.center()), (this.frustumCulled = !1), i && this.add(new r.WireframeHelper(this))
  18448. }
  18449. var r = e('three')
  18450. ;(n.prototype = Object.create(r.Mesh.prototype)), (n.prototype.constructor = n), (t.exports = n)
  18451. },
  18452. {
  18453. three: 217
  18454. }
  18455. ],
  18456. 143: [
  18457. function (e, t, i) {
  18458. ;(function (i) {
  18459. 'use strict'
  18460. function n(e) {
  18461. h.time('Computing a nice bounding cubemap')
  18462. var t = new a({
  18463. side: r.BackSide,
  18464. transparent: !0
  18465. })
  18466. ;(t.uniforms.modelAlpha.value = 0), (t.uniforms.opacity.value = 1 - s.modelAlpha), (this.renderOrder = l.boundingSkybox), o.call(this, e, t), h.timeEnd('Computing a nice bounding cubemap')
  18467. }
  18468. var r = e('three'),
  18469. o = (e('../enum/Viewmode'), e('../shaders'), e('./BoundingMesh')),
  18470. a = e('../materials/ModelTextureMaterial'),
  18471. s = e('../settings'),
  18472. l = e('../enum/RenderOrder'),
  18473. c = e('../util/logger'),
  18474. h = new c(i)
  18475. ;(n.prototype = Object.create(o.prototype)), (n.prototype.constructor = n), (t.exports = n)
  18476. }).call(this, '/js/objects/BoundingTextureSkybox.js')
  18477. },
  18478. {
  18479. '../enum/RenderOrder': 42,
  18480. '../enum/Viewmode': 51,
  18481. '../materials/ModelTextureMaterial': 118,
  18482. '../settings': 166,
  18483. '../shaders': 167,
  18484. '../util/logger': 189,
  18485. './BoundingMesh': 142,
  18486. three: 217
  18487. }
  18488. ],
  18489. 144: [
  18490. function (e, t, i) {
  18491. 'use strict'
  18492. function n(e) {
  18493. this.materialInside = new s({
  18494. side: r.DoubleSide
  18495. })
  18496. var t = r.UniformsUtils.clone(o.modelOutside.uniforms)
  18497. ;(this.materialOutside = new r.RawShaderMaterial({
  18498. fragmentShader: o.modelOutside.fragmentShader,
  18499. vertexShader: o.modelOutside.vertexShader,
  18500. uniforms: t,
  18501. side: r.FrontSide,
  18502. name: 'chunkOut'
  18503. })),
  18504. r.Mesh.call(this, e.geometry, this.materialInside),
  18505. (this.name = e.name || ''),
  18506. (this.textureName = e.textureName),
  18507. (this.meshUrl = e.meshUrl)
  18508. }
  18509. var r = e('three'),
  18510. o = e('../shaders'),
  18511. a = e('../enum/Viewmode'),
  18512. s = e('../materials/ModelTextureMaterial')
  18513. ;(n.prototype = Object.create(r.Mesh.prototype)),
  18514. (n.prototype.setTextureMap = function (e) {
  18515. ;(this.materialInside.uniforms.map.value = e), (this.materialOutside.uniforms.map.value = e)
  18516. }),
  18517. (n.prototype.setMode = function (e) {
  18518. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside
  18519. ;(t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide),
  18520. (t.transparent = this.material.transparent),
  18521. (t.uniforms.opacity.value = this.material.uniforms.opacity.value),
  18522. (this.material = t)
  18523. }),
  18524. (t.exports = n)
  18525. },
  18526. {
  18527. '../enum/Viewmode': 51,
  18528. '../materials/ModelTextureMaterial': 118,
  18529. '../shaders': 167,
  18530. three: 217
  18531. }
  18532. ],
  18533. 145: [
  18534. function (e, t, i) {
  18535. 'use strict'
  18536. function n(e) {
  18537. ;(this.chunksize = e || 10),
  18538. (this.chunks = {}),
  18539. (this.boundingBoxes = {}),
  18540. (this.children = []),
  18541. (this.offset = new r.Vector3(0, 0.5, 0)),
  18542. (this.material = new r.MeshBasicMaterial({
  18543. color: 16777215 * Math.random(),
  18544. side: r.DoubleSide
  18545. }))
  18546. }
  18547. var r = e('three')
  18548. e('../enum/Viewmode')
  18549. ;(n.prototype.add = function (e) {
  18550. var t,
  18551. i,
  18552. n,
  18553. o,
  18554. a,
  18555. s,
  18556. l,
  18557. c,
  18558. h,
  18559. u,
  18560. d,
  18561. p,
  18562. f,
  18563. g,
  18564. m = e.attributes
  18565. m ? ((t = m.position.array), (i = void 0 !== e.index ? e.index.array : void 0)) : ((t = e.vertices), (n = e.faces))
  18566. var v = new r.Vector3()
  18567. if (i)
  18568. for (o = 0, a = i.length; o < a; o += 3) {
  18569. var A = 3 * i[o],
  18570. y = 3 * i[o + 1],
  18571. C = 3 * i[o + 2]
  18572. ;(s = (t[A] + t[y] + t[C]) / 3),
  18573. (l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3),
  18574. (c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3),
  18575. (h = Math.floor(s / this.chunksize)),
  18576. (u = Math.floor(l / this.chunksize)),
  18577. (d = Math.floor(c / this.chunksize)),
  18578. (p = h + '.' + u + '.' + d),
  18579. p in this.chunks ? ((g = this.chunks[p]), (f = this.boundingBoxes[p])) : ((g = this.chunks[p] = []), (f = this.boundingBoxes[p] = new r.Box3())),
  18580. g.push(t[A], t[A + 1], t[A + 2], t[y], t[y + 1], t[y + 2], t[C], t[C + 1], t[C + 2]),
  18581. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  18582. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  18583. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  18584. }
  18585. else
  18586. for (o = 0, a = t.length; o < a; o += 9)
  18587. (s = (t[o] + t[o + 3] + t[o + 6]) / 3),
  18588. (l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3),
  18589. (c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3),
  18590. (h = Math.floor(s / this.chunksize)),
  18591. (u = Math.floor(l / this.chunksize)),
  18592. (d = Math.floor(c / this.chunksize)),
  18593. (p = h + '.' + u + '.' + d),
  18594. p in this.chunks ? ((g = this.chunks[p]), (f = this.boundingBoxes[p])) : ((g = this.chunks[p] = []), (f = this.boundingBoxes[p] = new r.Box3())),
  18595. g.push(t[o], t[o + 1], t[o + 2], t[o + 3], t[o + 4], t[o + 5], t[o + 6], t[o + 7], t[o + 8]),
  18596. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  18597. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  18598. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  18599. }),
  18600. (n.prototype.build = function () {
  18601. var e = new r.Object3D()
  18602. e.material = this.material
  18603. for (var t in this.chunks) {
  18604. var i = this.chunks[t],
  18605. n = new r.BufferGeometry()
  18606. n.addAttribute('position', new r.BufferAttribute(new Float32Array(i), 3)), (n.boundingBox = this.boundingBoxes[t])
  18607. var o = new r.Mesh(n, this.material)
  18608. ;(o.material.visible = !1), e.add(o), (this.chunks[t] = [])
  18609. }
  18610. return e
  18611. }),
  18612. (t.exports = n)
  18613. },
  18614. {
  18615. '../enum/Viewmode': 51,
  18616. three: 217
  18617. }
  18618. ],
  18619. 146: [
  18620. function (e, t, i) {
  18621. 'use strict'
  18622. var r = e('three'),
  18623. o = e('../settings'),
  18624. a = e('../util/common'),
  18625. s = e('../util/lerp'),
  18626. l = e('./ChunkedCollider'),
  18627. c = e('../util/transitions'),
  18628. h = e('../util/easing'),
  18629. u = (e('../objects/Panorama'), e('../enum/RenderOrder')),
  18630. d = e('../localization/localize')
  18631. function n(e, t, i) {
  18632. r.Object3D.call(this),
  18633. (this.model = e),
  18634. (this.floorIndex = t),
  18635. (this.lang = o.languageTag),
  18636. (this.name = i || o.languageTag === 'cn' ? 'Floor ' + (t + 1) + '' : '第' + (t + 1) + '层'),
  18637. (this.panos = []),
  18638. (this.chunks = []),
  18639. (this.colliderBuilder = new l(3)),
  18640. (this.collider = null),
  18641. (this.center = null),
  18642. (this.boundingBox = new r.Box3()),
  18643. (this.size = null),
  18644. (this.hidden = !1),
  18645. (this.conservativeBoundingBox = new r.Box3()),
  18646. (this.debugColor = 16777215 * Math.random()),
  18647. (this.transition = null)
  18648. }
  18649. ;(n.prototype = Object.create(r.Object3D.prototype)),
  18650. (n.prototype.enter = function (e) {
  18651. this.model.setFloor(this, e)
  18652. }),
  18653. (n.prototype.hide = function (e) {
  18654. if (!this.hidden || this.transition) {
  18655. this.chunks.forEach(function (e) {
  18656. e.material.transparent = !0
  18657. }),
  18658. c.cancel(this.transition)
  18659. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay,
  18660. i = e ? 0 : o.hideFloorDelay / t
  18661. this.transition = c.start(
  18662. s.allUniforms(this.chunks, 'opacity', 0.08),
  18663. t,
  18664. function () {
  18665. this.hidden = !0
  18666. }.bind(this),
  18667. i,
  18668. h.easeInOutQuad
  18669. )
  18670. }
  18671. }),
  18672. (n.prototype.show = function (e) {
  18673. if (this.hidden || this.transition) {
  18674. ;(this.hidden = !1), c.cancel(this.transition)
  18675. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay,
  18676. i = e ? 0 : o.showFloorDelay / t
  18677. this.transition = c.start(
  18678. s.allUniforms(this.chunks, 'opacity', 1),
  18679. t,
  18680. function () {
  18681. this.hidden ||
  18682. this.chunks.forEach(function (e) {
  18683. e.material.transparent = !1
  18684. })
  18685. }.bind(this),
  18686. i,
  18687. h.easeInOutQuad
  18688. )
  18689. }
  18690. }),
  18691. (n.prototype.toggle = function (e, t) {
  18692. ;(e = void 0 === e ? this.hidden : e), e ? this.show(t) : this.hide(t)
  18693. }),
  18694. (n.prototype.containsPoint = function (e) {
  18695. return this.collider.children.some(function (t) {
  18696. return t.geometry.boundingBox || t.geometry.computeBoundingBox(), t.geometry.boundingBox.containsPoint(e)
  18697. })
  18698. }),
  18699. (n.prototype.distanceToPoint = function (e) {
  18700. var t = null,
  18701. i = 1 / 0
  18702. return (
  18703. this.collider.children.forEach(function (n) {
  18704. n.geometry.boundingBox || n.geometry.computeBoundingBox()
  18705. var r = n.geometry.boundingBox.distanceToPoint(e)
  18706. ;(!t || i > r) && ((i = r), (t = n))
  18707. }),
  18708. i
  18709. )
  18710. }),
  18711. (n.prototype.addChunk = function (e) {
  18712. ;(e.renderOrder = u.ghostFloor),
  18713. this.add(e),
  18714. this.chunks.push(e),
  18715. this.boundingBox.union(e.geometry.boundingBox),
  18716. (this.size = this.boundingBox.size()),
  18717. this.colliderBuilder.add(e.geometry)
  18718. }),
  18719. (n.prototype.addPano = function (e) {
  18720. this.panos.push(e), this.add(e.skyboxMesh), e.marker && this.add(e.marker)
  18721. if (e.neighbourUUIDs && e.neighbourUUIDs.length) {
  18722. //add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  18723. var t = new r.Vector3(1, 1, 1),
  18724. i = new r.Box3().setFromCenterAndSize(e.position, t)
  18725. this.boundingBox.union(i)
  18726. }
  18727. }),
  18728. (n.prototype.build = function () {
  18729. ;(this.collider = this.colliderBuilder.build(!0)),
  18730. this.add(this.collider),
  18731. (this.center = this.boundingBox.center()),
  18732. this.conservativeBoundingBox.copy(this.boundingBox),
  18733. (this.conservativeBoundingBox.min.y = a.lowerMedian(
  18734. this.collider.children.map(function (e) {
  18735. return e.geometry.boundingBox.min.y
  18736. }),
  18737. 5
  18738. )),
  18739. (this.conservativeBoundingBox.max.y = a.lowerMedian(
  18740. this.collider.children.map(function (e) {
  18741. return e.geometry.boundingBox.max.y
  18742. }),
  18743. 5
  18744. ))
  18745. if (!settings.extractFloor || !settings.extractFloor[window.number]) {
  18746. this.colliderBuilder = null
  18747. }
  18748. }),
  18749. (n.prototype.toShortString = function () {
  18750. return a.nth(this.floorIndex + 1)
  18751. }),
  18752. (n.prototype.toString = function () {
  18753. return this.name
  18754. }),
  18755. (n.prototype.constructor = n), //add
  18756. (t.exports = n)
  18757. },
  18758. {
  18759. '../enum/RenderOrder': 42,
  18760. '../localization/localize': 108,
  18761. './strings-cn-CN': 109,
  18762. '../objects/Panorama': 148,
  18763. '../settings': 166,
  18764. '../util/common': 185,
  18765. '../util/easing': 186,
  18766. '../util/lerp': 188,
  18767. '../util/transitions': 195,
  18768. './ChunkedCollider': 145,
  18769. three: 217
  18770. }
  18771. ],
  18772. 147: [
  18773. function (e, t, i) {
  18774. 'use strict'
  18775. function n(e) {
  18776. ;(this.player = e), (this.obj3d = null), (this.UP = new r.Vector3(0, 1, 0))
  18777. }
  18778. var r = e('three'),
  18779. o = e('../settings')
  18780. ;(n.prototype.prefs = {
  18781. linewidth: 3,
  18782. height: 0.07,
  18783. opacity: 0.45,
  18784. endScale: 0.05
  18785. }),
  18786. (n.prototype.discard = function () {
  18787. if (this.obj3d) {
  18788. var e = this.obj3d.parent
  18789. e && e.remove(this.obj3d)
  18790. }
  18791. this.obj3d = null
  18792. }),
  18793. (n.prototype.draw = function () {
  18794. if ((this.discard(), o.showNeighbors)) {
  18795. var e = this.player.currentPano.floor
  18796. this.obj3d = new r.Object3D()
  18797. var t = this.player.model.panos.getNeighbours(this.player.currentPano),
  18798. i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position)
  18799. i.y += this.prefs.height
  18800. var n = 0.1525,
  18801. a = 0.127,
  18802. s = 0.0127,
  18803. l = 0.1,
  18804. c = 0.19,
  18805. h = 0.2032,
  18806. u = 0.2286,
  18807. d = 0.255,
  18808. p = new r.Matrix4()
  18809. for (var f in t)
  18810. if (t[f]) {
  18811. var g = this.player.model.panos.get(f),
  18812. m = (g.position.clone().sub(this.player.model.position), g.position.clone().sub(g.floorPosition)),
  18813. v = g.floorPosition.clone().sub(this.player.model.position)
  18814. v.y += this.prefs.height
  18815. var A = new r.Geometry()
  18816. A.vertices.push(new r.Vector3(0, -s, 0), new r.Vector3(-s, 0, 0), new r.Vector3(0, s, 0), new r.Vector3(s, 0, 0), new r.Vector3(0, -s, 0)),
  18817. A.vertices.push(
  18818. new r.Vector3(0, -d, 0),
  18819. new r.Vector3(d, -d, 0),
  18820. new r.Vector3(d, n, 0),
  18821. new r.Vector3(-n, n, 0),
  18822. new r.Vector3(-n, a, 0),
  18823. new r.Vector3(-c, l, 0),
  18824. new r.Vector3(-c, -h, 0),
  18825. new r.Vector3(-n, -u, 0),
  18826. new r.Vector3(-n, -d, 0),
  18827. new r.Vector3(0, -d, 0)
  18828. ),
  18829. p.identity().setPosition(m),
  18830. A.applyMatrix(p),
  18831. A.vertices.push(new r.Vector3(0, -this.prefs.endScale, 0)),
  18832. A.vertices.push(
  18833. new r.Vector3(-this.prefs.endScale, -this.prefs.endScale, 0),
  18834. new r.Vector3(-this.prefs.endScale, this.prefs.endScale, 0),
  18835. new r.Vector3(this.prefs.endScale, this.prefs.endScale, 0),
  18836. new r.Vector3(this.prefs.endScale, -this.prefs.endScale, 0)
  18837. ),
  18838. p.lookAt(v, i, this.UP).setPosition(v),
  18839. A.applyMatrix(p),
  18840. A.vertices.push(v, i)
  18841. var y = new r.Line(
  18842. A,
  18843. new r.LineBasicMaterial({
  18844. color: g.debugColor.getHex(),
  18845. transparent: !0,
  18846. opacity: this.prefs.opacity,
  18847. depthWrite: !1,
  18848. name: 'sLine' + f,
  18849. linewidth: this.prefs.linewidth
  18850. })
  18851. )
  18852. this.obj3d.add(y)
  18853. }
  18854. e.add(this.obj3d)
  18855. }
  18856. }),
  18857. (n.prototype.update = function () {
  18858. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  18859. }),
  18860. (t.exports = n)
  18861. },
  18862. {
  18863. '../settings': 166,
  18864. three: 217
  18865. }
  18866. ],
  18867. 148: [
  18868. function (e, t, i) {
  18869. ;(function (i) {
  18870. 'use strict'
  18871. function n(e, t, i, n) {
  18872. ;(this.model = e),
  18873. (this.id = t),
  18874. (this.alignmentType = i.alignmentType || l.ALIGNED),
  18875. (this.neighbourUUIDs = i.neighbours || null),
  18876. (this.neighbourPanos = null),
  18877. (this.floor = null),
  18878. (this.floorIndex = i.floor),
  18879. (this.failedLoadingAt = 0),
  18880. (this.maxLoadRetries = 4),
  18881. (this.origin = i.position.clone()),
  18882. (this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0, -5, 0) : i.position.clone()),
  18883. (this.quaternion = i.quaternion.clone()),
  18884. (this.skyboxMesh = new r.Mesh(E)),
  18885. this.skyboxMesh.position.copy(this.position),
  18886. this.skyboxMesh.quaternion.copy(this.quaternion),
  18887. (this.skyboxMesh.name = 'skybox'),
  18888. (this.skyboxMesh.visible = !1),
  18889. this.skyboxMesh.updateMatrix(),
  18890. this.skyboxMesh.updateMatrixWorld(),
  18891. (this.marker = null),
  18892. (this.showFloorMarker = !window.DATA.hideFloorMarker)
  18893. if (this.isAligned()) {
  18894. ;(this.marker = new r.Mesh(
  18895. b,
  18896. new r.MeshBasicMaterial({
  18897. map: w,
  18898. side: r.DoubleSide,
  18899. opacity: 0,
  18900. transparent: !0,
  18901. depthWrite: !1
  18902. })
  18903. )),
  18904. (this.marker.visible = false) //改:先不显示,之后根据opacity显示
  18905. ;(this.marker.renderOrder = s.panoMarker), (this.marker.name = 'marker'), (this.marker.pano = this), this.marker.layers.set(v.PANOMARKERS), this.marker.updateMatrixWorld()
  18906. if (!window.DATA.hideFloorMarker) {
  18907. //xzw
  18908. let opa = this.marker.material.opacity
  18909. Object.defineProperty(this.marker.material, 'opacity', {
  18910. get: function () {
  18911. return opa
  18912. },
  18913. set: o => {
  18914. opa = o
  18915. convertTool.updateVisible(this.marker, 'hideWhenZeroOpa', o > 0)
  18916. //if(o==0)console.log('o==0',this.id,this.marker.visible)
  18917. //console.log(o,this.id,this.marker.visible)
  18918. }
  18919. })
  18920. }
  18921. a.colorMarkerOnLoad &&
  18922. this.on('load', function () {
  18923. this.marker.material.color.set(65280)
  18924. })
  18925. }
  18926. ;(this.debugColor = new r.Color().setHSL(0.06 + 0.53 * Math.random(), 0.8 + 0.2 * Math.random(), 0.5 + 0.2 * Math.random())),
  18927. (this.floorPosition = i.puck ? i.puck.clone() : null),
  18928. (this.tiled = n),
  18929. this.tiled
  18930. ? (this.solidSkybox = null)
  18931. : ((this.solidSkybox = new r.Texture([null, null, null, null, null, null])),
  18932. (this.solidSkybox.flipY = !1),
  18933. a.minimalMemoryMode && ((this.solidSkybox.minFilter = r.LinearFilter), (this.solidSkybox.magFilter = r.LinearFilter), (this.solidSkybox.generateMipmaps = !1))),
  18934. (this.zoomed = !1),
  18935. (this.panoRenderer = null),
  18936. (this.qualityManager = null),
  18937. (this.tileDownloader = null),
  18938. (this.tiledPanoRenderTarget = null),
  18939. (this.minimumTiledPanoLoaded = !1),
  18940. (this.highestPartialTileRenderOpCompleted = 0),
  18941. (this.highestFullTileRenderOpCompleted = 0),
  18942. (this.shouldRedrawOnBaseLoaded = !1),
  18943. (this.lockUntilRenderingComplete = !1),
  18944. a.colorMarkerOnLoad &&
  18945. this.on('load', function () {
  18946. this.marker.material.color.set(65280)
  18947. })
  18948. /********************************************************************fyz改vr from徐世廷*************************************************************/
  18949. var e = new r.TextureLoader()
  18950. e.setCrossOrigin(!0)
  18951. var g = e.load('images/texture.jpg')
  18952. if (
  18953. ((this.vrMarker = new r.Mesh(
  18954. new r.OctahedronGeometry(0.1, 0),
  18955. new r.MeshLambertMaterial({
  18956. color: 16777215,
  18957. transparent: !0,
  18958. opacity: 0.75,
  18959. map: g
  18960. })
  18961. )),
  18962. (this.vrMarker.boluoType = 'vr'),
  18963. (this.vrMarker.position.z = 1),
  18964. (this.vrMarker.enabled = !0),
  18965. (this.vrMarker.visible = !1),
  18966. (window.vrMarkers = window.vrMarkers || []),
  18967. window.vrMarkers.push(this.vrMarker),
  18968. this.marker && this.marker.add(this.vrMarker),
  18969. a.showAxis &&
  18970. (this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0, 1, 0), new r.Vector3(0, 0, 0), 1, 255)),
  18971. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0, 0, 1), new r.Vector3(0, 0, 0), 1, 16711680)),
  18972. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(1, 0, 0), new r.Vector3(0, 0, 0), 1, 65280))),
  18973. this.adjustAngleEnable)
  18974. ) {
  18975. var i = new r.Quaternion()
  18976. i.setFromAxisAngle(new r.Vector3(1, 0, 0), this.adjustAngleX), this.skyboxMesh.quaternion.multiply(i)
  18977. var m = new r.Quaternion()
  18978. m.setFromAxisAngle(new r.Vector3(0, 1, 0), this.adjustAngleY), this.skyboxMesh.quaternion.multiply(m)
  18979. var n = new r.Quaternion()
  18980. n.setFromAxisAngle(new r.Vector3(0, 0, 1), this.adjustAngleZ),
  18981. this.skyboxMesh.quaternion.multiply(n),
  18982. this.skyboxMesh.updateMatrix(),
  18983. this.skyboxMesh.updateMatrixWorld(),
  18984. this.model.updateProjectedPanos()
  18985. }
  18986. /**************************************************************************************************************************************/
  18987. }
  18988. var r = e('three'),
  18989. o = e('../util/logger'),
  18990. a = e('../settings'),
  18991. s = (e('../enum/Viewmode'), e('../enum/RenderOrder')),
  18992. l = e('../enum/AlignmentType'),
  18993. c = (e('../util/common'), e('../util/transitions')),
  18994. h = e('../util/lerp'),
  18995. u = e('../util/ajax'),
  18996. d = e('../util/texture'),
  18997. p = e('../util/panorama'),
  18998. f = (e('../enum/TileDownloaderEvents'), e('../enum/PanoramaEvents')),
  18999. g = e('../enum/PanoRendererEvents'),
  19000. m = e('../enum/PanoSizeClass'),
  19001. v = e('../enum/RenderLayers'),
  19002. A = (e('../scene/SceneRenderer'), e('../enum/GLCubeFaces'), e('../exception/BasicException')),
  19003. y = e('../tile/TileUtils'),
  19004. C = e('events').EventEmitter,
  19005. I = new o(i),
  19006. E = new r.SphereBufferGeometry(0.1),
  19007. b = new r.PlaneBufferGeometry(0.35, 0.35, 1, 1),
  19008. w = d.load('images/marker.png')
  19009. w.anisotropy = browser.isMobile() ? 1 : 3 //add
  19010. ;(n.prototype = Object.create(C.prototype)),
  19011. (n.prototype.enter = (function () {
  19012. var e = null
  19013. return function () {
  19014. this.setZoomed(!1),
  19015. this.emit('enter', {
  19016. oldPano: e,
  19017. newPano: this
  19018. }),
  19019. (e = this)
  19020. this.model.setHighMap(this) //add
  19021. }
  19022. })()),
  19023. (n.prototype.exit = function () {
  19024. this.tiled
  19025. ? (this.clearWaitDeferreds(),
  19026. (this.minimumTiledPanoLoaded = !1),
  19027. (this.tiledPanoRenderTarget = null),
  19028. this.setZoomed(!1),
  19029. this.panoRenderer.deactivateTiledPano(this),
  19030. (this.highestPartialTileRenderOpCompleted = 0),
  19031. (this.highestFullTileRenderOpCompleted = 0))
  19032. : (this.solidSkybox.dispose(), (this.solidSkybox.loaded = !1), (this.solidSkybox.version = 0)),
  19033. this.emit('exit')
  19034. }),
  19035. (n.prototype.hoverOn = function (e) {
  19036. this.marker &&
  19037. (c.start(h.property(this.marker.material, 'opacity', a[e].markerOpacityOnHover), 250), a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite('HIT', 12525854))
  19038. }),
  19039. (n.prototype.hoverOff = function (e) {
  19040. this.marker && c.start(h.property(this.marker.material, 'opacity', a[e].markerOpacity), 250)
  19041. }),
  19042. (n.prototype.build1 = function () {
  19043. ;(this.floor =
  19044. this.floor ||
  19045. this.model.floors.get(this.floorIndex) ||
  19046. (this.model.floors.list.length == 1 ? this.model.floors.list[0] : this.raycastToFindFloor()) ||
  19047. this.model.getFloorAtPoint(this.position)),
  19048. this.floor.addPano(this),
  19049. (this.floorPosition = this.floorPosition || this.raycastFloorPosition()),
  19050. (this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos()),
  19051. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  19052. }),
  19053. (n.prototype.build2 = function () {
  19054. ;(this.floorPosition = this.floorPosition || this.interpolateFloorPosition()), (this.height = this.position.distanceTo(this.floorPosition)), this.placeMarker()
  19055. }),
  19056. (n.prototype.interpolateFloorPosition = function () {
  19057. var e = this.model.panos
  19058. .filter(n.filters.isNeighbourPanoTo(this))
  19059. .filter(function (e) {
  19060. return !!e.floorPosition
  19061. })
  19062. .sort(
  19063. function (e, t) {
  19064. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  19065. }.bind(this)
  19066. ),
  19067. t = this.position.clone()
  19068. return e.length >= 2 ? (t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2) : t.add(a.noMeshFloorPositionOffset), t
  19069. }),
  19070. (n.prototype.raycastFloorPosition = function () {
  19071. I.warn('Performance warning: Raycasting to find floor position')
  19072. var e = new r.Raycaster(this.position, new r.Vector3(0, -1, 0)),
  19073. t = e.intersectObjects(this.model.colliders)
  19074. return t.length ? t[0].point : null
  19075. }),
  19076. (n.prototype.raycastToFindFloor = (function () {
  19077. var e = [
  19078. new r.Vector3(0, -1, 0),
  19079. new r.Vector3(1, -1, 0),
  19080. new r.Vector3(0, -1, 1),
  19081. new r.Vector3(-1, -1, 0),
  19082. new r.Vector3(0, -1, -1),
  19083. new r.Vector3(1, 0, 0),
  19084. new r.Vector3(0, 0, 1),
  19085. new r.Vector3(-1, 0, 0),
  19086. new r.Vector3(0, 0, -1)
  19087. ]
  19088. return function () {
  19089. I.warn('Performance warning: Raycasting to find floor index')
  19090. for (var t = 0; t < e.length; t++) {
  19091. var i = new r.Raycaster(this.position.clone(), e[t].clone()),
  19092. n = i.intersectObjects(this.model.colliders)
  19093. if (n.length) return n[0].object.parent.parent
  19094. }
  19095. return null
  19096. }
  19097. })()),
  19098. (n.prototype.placeMarker = function () {
  19099. this.marker &&
  19100. (this.marker.position.copy(this.floorPosition),
  19101. //this.fixedFloorY != void 0 && this.marker.position.setY(this.fixedFloorY),//add
  19102. (this.marker.position.y += settings.markerHeight),
  19103. this.marker.lookAt(new r.Vector3(0, 1, 0).add(this.marker.position)))
  19104. }),
  19105. (n.prototype.translate = function (e) {
  19106. this.position.add(e), this.floorPosition.add(e)
  19107. }),
  19108. (n.prototype.findClosestMidtpointPanoTo = function (e) {
  19109. new r.Vector3().addVectors(this.position, e.position).divideScalar(2)
  19110. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  19111. }),
  19112. (n.prototype.attachToPanoRenderer = function (e) {
  19113. ;(this.panoRenderer = e),
  19114. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  19115. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  19116. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  19117. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  19118. })
  19119. var _ = {}
  19120. ;(n.prototype.getWaitDeferred = function (e) {
  19121. var t = _[this.id]
  19122. t || ((t = {}), (_[this.id] = t))
  19123. var i = t[e]
  19124. return (
  19125. i ||
  19126. ((i = {
  19127. deferred: $.Deferred(),
  19128. active: !1
  19129. }),
  19130. (t[e] = i)),
  19131. i
  19132. )
  19133. }),
  19134. (n.prototype.resetWaitDeferred = function (e) {
  19135. var t = this.getWaitDeferred(e)
  19136. ;(t.active = !1), (t.deferred = $.Deferred())
  19137. }),
  19138. (n.prototype.clearWaitDeferreds = function () {
  19139. var e = _[this.id]
  19140. e || ((e = {}), (_[this.id] = e))
  19141. for (var t in e)
  19142. if (e.hasOwnProperty(t)) {
  19143. var i = e[t]
  19144. ;(i.active = !1), (i.deferred = $.Deferred())
  19145. }
  19146. }),
  19147. (n.prototype.loadTiledPano = (function () {
  19148. var e = (new r.Vector3(), []),
  19149. t = []
  19150. return function (i, n, r, o, a, s) {
  19151. ;(null !== o && void 0 !== o) || (o = !0), (null !== a && void 0 !== a) || (a = !0)
  19152. var l = this.getWaitDeferred(i),
  19153. c = l.deferred,
  19154. h = null,
  19155. u = null
  19156. if ((r && ('number' == typeof r ? (h = r) : ((h = r.hFov), (u = r.vFov))), !this.isLoaded(i))) {
  19157. if (!l.active) {
  19158. if (((l.active = !0), r)) {
  19159. var d = y.matchingTilesInDirection(this, i, n, h, u)
  19160. ;(e[this.id + ':' + i] = {
  19161. tileCount: 0,
  19162. targetTileCount: d
  19163. }),
  19164. I.info('Loading partial pano: ' + this.id + ' with ' + d + ' tiles')
  19165. }
  19166. t[this.id] ||
  19167. ((t[this.id] = !0),
  19168. this.on(
  19169. f.LoadComplete,
  19170. function (e, t) {
  19171. //console.warn('点位下载完成 ', 'id:'+this.id, 'count:'+t )
  19172. var i = this.getWaitDeferred(e).deferred
  19173. i && 'pending' === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t), this.resetWaitDeferred(e))
  19174. }.bind(this)
  19175. ),
  19176. this.on(
  19177. f.LoadFailed,
  19178. function (e) {
  19179. var t = this.getWaitDeferred(e).deferred
  19180. t && 'pending' === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e), this.resetWaitDeferred(e))
  19181. }.bind(this)
  19182. ),
  19183. this.on(
  19184. f.TileLoaded,
  19185. function (t, i, n) {
  19186. //console.log('tileLoaded', 'id:'+this.id, 'size:'+t, 'index:'+i )
  19187. var r = this.getWaitDeferred(t).deferred
  19188. if (r && 'pending' === r.state()) {
  19189. r.notify(t, i, n)
  19190. var o = e[this.id + ':' + t]
  19191. o && (o.tileCount++, o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0), r.resolve(t, n), this.resetWaitDeferred(t)))
  19192. }
  19193. }.bind(this)
  19194. ))
  19195. }
  19196. this.tileDownloader.clearForceQueue(),
  19197. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  19198. (this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, Math.min(2048, this.qualityManager.getMaxNavPanoSize()), o)), //不要超过2048否则漫游到下一个点时卡顿
  19199. this.panoRenderer.renderPanoTiles(this.id, n, a)
  19200. }
  19201. return c.promise()
  19202. }
  19203. })()),
  19204. (n.prototype.onUploadAttemptedForAllTiles = function (e, t, i) {
  19205. if (e === this.id) {
  19206. var n = this.qualityManager.getPanoSize(m.BASE)
  19207. t === n &&
  19208. this.shouldRedrawOnBaseLoaded &&
  19209. ((this.shouldRedrawOnBaseLoaded = !1), this.panoRenderer.resetRenderStatus(this.id, !0, !1), this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  19210. }
  19211. }),
  19212. (n.prototype.onTileRendered = function (e, t, i, n) {
  19213. e === this.id && this.emit(f.TileLoaded, t, i, n)
  19214. }),
  19215. (n.prototype.onPanoRendered = function (e, t, i, n) {
  19216. e === this.id &&
  19217. ((this.minimumTiledPanoLoaded = !0),
  19218. this.updateSkyboxForZoomLevel(),
  19219. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  19220. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  19221. this.emit('load', t),
  19222. this.model.emit('load', this),
  19223. this.emit(f.LoadComplete, t, i))
  19224. }),
  19225. (n.prototype.setZoomed = function (e) {
  19226. ;(this.zoomed = e), this.updateSkyboxForZoomLevel()
  19227. if (e) {
  19228. //add
  19229. if (player.qualityManager.getNavZoomClass() != '1k') {
  19230. this.model.showHighMap()
  19231. }
  19232. } else {
  19233. this.model.hideHighMap()
  19234. }
  19235. }),
  19236. (n.prototype.ensureSkyboxReadyForRender = function () {
  19237. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0), (this.solidSkybox.loaded = !0))
  19238. }),
  19239. (n.prototype.updateSkyboxForZoomLevel = function () {
  19240. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  19241. }),
  19242. (n.prototype.getSkyboxTexture = function () {
  19243. //return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  19244. if (!this.tiled) {
  19245. return this.solidSkybox
  19246. }
  19247. if (this.minimumTiledPanoLoaded) {
  19248. if (this.zoomed && (this.qualityManager.maxRenderTargetSize > this.qualityManager.maxNavPanoSize || player.qualityManager.getNavZoomClass() == '4k')) {
  19249. //change 如果放大后和不放大都是2k就不用这个
  19250. return this.panoRenderer.zoomRenderTarget.texture
  19251. } else {
  19252. this.tiledPanoRenderTarget.texture.mapping = THREE.UVMapping //add
  19253. return this.tiledPanoRenderTarget.texture
  19254. }
  19255. } else {
  19256. return null
  19257. }
  19258. }),
  19259. (n.prototype.onTileRenderFail = function (e, t, i) {
  19260. e === this.id && this.emit(f.LoadFailed, t)
  19261. }),
  19262. (n.prototype.isLoaded = function (e) {
  19263. if (this.tiled) {
  19264. if (e && 'string' == typeof e) throw new A('Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass')
  19265. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  19266. }
  19267. if (e && 'number' == typeof e) throw new A('Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.')
  19268. return !!this.solidSkybox.high || e in this.solidSkybox
  19269. }),
  19270. (n.prototype.loadCube = function (e) {
  19271. if (this.isLoaded(e)) return I.info('Skipping load of pano, already loaded'), $.when()
  19272. this.emit('loading', e), this.model.emit('loading', this)
  19273. var t = p.getCubemapUrls(this.model.urls, this.id, e),
  19274. i = t.filter(function (e) {
  19275. return !e
  19276. })
  19277. 'low' === e && i.length > 0 && (I.info('Pano', this.id, 'not available in low res, loading high res right away'), (e = 'high'), (t = p.getCubemapUrls(this.model.urls, this.id, e)))
  19278. var n = 0,
  19279. r = [0, 1, 2, 3, 4, 5].map(
  19280. function (e, i, n) {
  19281. return u.getImage(t[i])
  19282. }.bind(this)
  19283. )
  19284. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(
  19285. function (t, i, n, r, o, a) {
  19286. return (
  19287. (this.solidSkybox[e] = [t, i, n, r, o, a]),
  19288. ('high' !== e && this.solidSkybox.high) || ((this.solidSkybox.image = this.solidSkybox[e]), (this.solidSkybox.low = null)),
  19289. (this.solidSkybox.needsUpdate = !0),
  19290. this.emit('load', e),
  19291. this.model.emit('load', this),
  19292. this
  19293. )
  19294. }.bind(this),
  19295. function () {
  19296. I.error('Downloading cubemap for pano', this.id, 'failed'), (this.failedLoadingAt = Date.now())
  19297. }.bind(this),
  19298. function () {
  19299. return $.when(++n, 6)
  19300. }
  19301. )
  19302. }),
  19303. (n.raycastsSkipped = 0),
  19304. (n.raycastsDone = 0),
  19305. (n.prototype.findNeighourPanos = function () {
  19306. return (
  19307. this.model.panos.setNeighbour(this.id, this.id, !1),
  19308. this.model.panos.forEach(
  19309. function (e) {
  19310. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  19311. var t = this.position.distanceTo(e.position)
  19312. if (t > a.panoramaNeighbourMaxDistance) return this.model.panos.setNeighbour(this, e, !1), void n.raycastsSkipped++
  19313. var i = e.position.clone().sub(this.position).normalize(),
  19314. o = new r.Raycaster(this.position, i.clone(), 0, t),
  19315. s = o.intersectObjects(this.model.colliders)
  19316. n.raycastsDone++,
  19317. this.model.panos.setNeighbour(this, e, 0 === s.length),
  19318. a.showNeighbourRaycasts &&
  19319. (s.length ? this.floor.model.add(new r.ArrowHelper(i, this.position, s[0].distance, 16711680)) : this.floor.model.add(new r.ArrowHelper(i, this.position, t, 16777215, 0, 0)))
  19320. }
  19321. }.bind(this)
  19322. ),
  19323. this.model.panos.neighbourMap[this.id]
  19324. )
  19325. }),
  19326. (n.prototype.worldPosition = function () {
  19327. return this.position
  19328. }),
  19329. (n.prototype.addLabel = function () {
  19330. this.removeLabel()
  19331. this.label = new TextSprite({
  19332. sizeInfo: {
  19333. minSize: 100,
  19334. maxSize: 200,
  19335. nearBound: 0.7,
  19336. farBound: 10, //Math.max(20, player.model.size.length() / 3),
  19337. farBoundPlan: 100
  19338. },
  19339. backgroundColor: { r: 255, g: 255, b: 255, a: 0.4 },
  19340. textColor: { r: 0, g: 0, b: 0, a: 1 },
  19341. borderRadius: 15,
  19342. renderOrder: 5,
  19343. text: this.id //`${this.id}-f${this.floorIndex}`
  19344. })
  19345. let position = this.floorPosition.clone()
  19346. position.y += 0.2
  19347. this.label.position.copy(position)
  19348. this.floor.add(this.label)
  19349. }),
  19350. (n.prototype.removeLabel = function () {
  19351. this.label && (this.floor.remove(this.label), this.label.material.dispose(), (this.label = null))
  19352. }),
  19353. /* n.prototype.addTextSprite = function(e, t) {
  19354. this.removeTextSprite();
  19355. var i = document.createElement("canvas")
  19356. , n = i.getContext("2d");
  19357. i.width = 256,
  19358. i.height = 256;
  19359. var o = "Arial"
  19360. , a = 60;
  19361. n.font = "bold " + a + "px " + o,
  19362. n.fillStyle = "white";
  19363. var s = n.measureText(e).width;
  19364. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  19365. var l = new r.Texture(i);
  19366. l.needsUpdate = !0;
  19367. var c = new r.SpriteMaterial({
  19368. map: l,
  19369. color: t || 16428055
  19370. });
  19371. this.text3d = new r.Sprite(c),
  19372. this.text3d.position.copy(this.skyboxMesh.position),
  19373. this.floor.add(this.text3d)
  19374. }
  19375. ,
  19376. n.prototype.removeTextSprite = function() {
  19377. this.text3d && (this.floor.remove(this.text3d),
  19378. this.text3d = null)
  19379. }*/
  19380. (n.prototype.isAligned = function () {
  19381. return this.alignmentType === l.ALIGNED
  19382. }),
  19383. (n.filters = {
  19384. inDirection: function (e, t, i) {
  19385. return function (n) {
  19386. var r = n.position.clone().sub(e).normalize()
  19387. return r.dot(t) > i
  19388. }
  19389. },
  19390. inFloorDirection: function (e, t, i) {
  19391. return function (n) {
  19392. var r = n.floorPosition.clone().sub(e).normalize()
  19393. return r.dot(t) > i
  19394. }
  19395. },
  19396. inPanoDirection: function (e, t, i) {
  19397. return (
  19398. (i = a.navigation.panoScores ? a.navigation.filterStrictness : i),
  19399. function (n) {
  19400. var r = n.floorPosition.clone().sub(e).normalize(),
  19401. o = n.position.clone().sub(e).normalize()
  19402. return r.dot(t) > i || o.dot(t) > i
  19403. }
  19404. )
  19405. },
  19406. atFloor: function (e) {
  19407. return function (t) {
  19408. return !e || t.floor === e
  19409. }
  19410. },
  19411. not: function (e) {
  19412. return function (t) {
  19413. return t !== e
  19414. }
  19415. },
  19416. notIn: function (e) {
  19417. return function (t) {
  19418. return e.indexOf(t) === -1
  19419. }
  19420. },
  19421. isLoaded: function () {
  19422. return function (e) {
  19423. return e.isLoaded()
  19424. }
  19425. },
  19426. isNotLoaded: function () {
  19427. return function (e) {
  19428. return !e.isLoaded()
  19429. }
  19430. },
  19431. isCloseEnoughTo: function (e, t) {
  19432. return function (i) {
  19433. return e.distanceTo(i.floorPosition) < t
  19434. }
  19435. },
  19436. hasMinimumHeightDifferenceTo: function (e, t) {
  19437. return function (i) {
  19438. return Math.abs(i.position.y - e.y) > t
  19439. }
  19440. },
  19441. isNotBehindNormal: function (e, t) {
  19442. var i = new r.Vector3()
  19443. return (
  19444. (t = t.clone()),
  19445. function (n) {
  19446. var r = i.copy(n.position).sub(e).normalize()
  19447. return r.dot(t) > 0
  19448. }
  19449. )
  19450. },
  19451. isNeighbourPanoTo: function (e) {
  19452. return function (t) {
  19453. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  19454. }
  19455. },
  19456. isNeighbourOfNeighbourTo: function (e) {
  19457. return function (t) {
  19458. return (
  19459. !!e.neighbourPanos[t.id] ||
  19460. e.neighbourUUIDs.some(function (i) {
  19461. var n = e.model.panos.get(i)
  19462. return !!n && n.neighbourPanos[t.id]
  19463. })
  19464. )
  19465. }
  19466. },
  19467. isNotRecentlyFailed: function (e) {
  19468. return function (t) {
  19469. return Date.now() - t.failedLoadingAt > e
  19470. }
  19471. },
  19472. isOnVisibleFloor: function () {
  19473. return function (e) {
  19474. return !e.floor.hidden
  19475. }
  19476. },
  19477. isPanoAligned: function () {
  19478. return function (e) {
  19479. return e.isAligned()
  19480. }
  19481. }
  19482. }),
  19483. (n.sortFunctions = {
  19484. distanceToPoint: function (e) {
  19485. return function (t, i) {
  19486. return t.position.distanceTo(e) - i.position.distanceTo(e)
  19487. }
  19488. },
  19489. floorDistanceToPoint: function (e) {
  19490. return function (t, i) {
  19491. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  19492. }
  19493. },
  19494. choose: function (e) {
  19495. return function (t, i) {
  19496. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  19497. }
  19498. }
  19499. }),
  19500. (n.scoreFunctions = {
  19501. distance: function (e, t) {
  19502. return (
  19503. (t = t || a.navigation.distanceFactor),
  19504. function (i) {
  19505. return e ? e.position.distanceTo(i.position) * t : 0
  19506. }
  19507. )
  19508. },
  19509. distanceSquared: function (e, t) {
  19510. return (
  19511. (t = t || a.navigation.distanceFactor),
  19512. function (i) {
  19513. return e ? e.position.distanceToSquared(i.position) * t : 0
  19514. }
  19515. )
  19516. },
  19517. direction: function (e, t) {
  19518. return function (i) {
  19519. var n = i.position.clone().sub(e).normalize()
  19520. return n.dot(t) * a.navigation.directionFactor
  19521. }
  19522. },
  19523. angle: function (e, t) {
  19524. return function (i) {
  19525. var n = i.position.clone().sub(e).normalize()
  19526. return n.angleTo(t) * a.navigation.angleFactor
  19527. }
  19528. },
  19529. inFieldOfView: function (e, t) {
  19530. return function (i) {
  19531. var n = i.position.clone().sub(e).normalize()
  19532. return n.dot(t) > 0.75 ? 10 : -1
  19533. }
  19534. },
  19535. optionality: function (e) {
  19536. return function (t) {
  19537. var i = t.neighbourUUIDs.filter(function (t) {
  19538. return !(t in e.neighbourUUIDs) && t !== e.id
  19539. })
  19540. return i.length * a.navigation.optionalityFactor
  19541. }
  19542. },
  19543. penalizeHeightDifferenceUnder: function (e, t) {
  19544. return function (i) {
  19545. return e.y - i.position.y < t ? -20 : 0
  19546. }
  19547. }
  19548. }),
  19549. (t.exports = n)
  19550. }).call(this, '/js/objects/Panorama.js')
  19551. },
  19552. {
  19553. '../enum/AlignmentType': 17,
  19554. '../enum/GLCubeFaces': 25,
  19555. '../enum/PanoRendererEvents': 35,
  19556. '../enum/PanoSizeClass': 36,
  19557. '../enum/PanoramaEvents': 37,
  19558. '../enum/RenderLayers': 41,
  19559. '../enum/RenderOrder': 42,
  19560. '../enum/TileDownloaderEvents': 45,
  19561. '../enum/Viewmode': 51,
  19562. '../exception/BasicException': 55,
  19563. '../scene/SceneRenderer': 158,
  19564. '../settings': 166,
  19565. '../tile/TileUtils': 174,
  19566. '../util/ajax': 181,
  19567. '../util/common': 185,
  19568. '../util/lerp': 188,
  19569. '../util/logger': 189,
  19570. '../util/panorama': 191,
  19571. '../util/texture': 194,
  19572. '../util/transitions': 195,
  19573. events: 202,
  19574. three: 217
  19575. }
  19576. ],
  19577. 149: [
  19578. function (e, t, i) {
  19579. 'use strict'
  19580. function n(e) {
  19581. var t = r.UniformsUtils.clone(c.waypoint.uniforms)
  19582. ;(t.map.value = d), (t.opacity.value = 0), t.color.value.set(o.reticuleColor), (t.showMouseMarker = !window.DATA.hideMouseMarker)
  19583. r.Mesh.call(
  19584. this,
  19585. new r.PlaneBufferGeometry(0.4, 0.4, 1, 1),
  19586. new r.RawShaderMaterial({
  19587. side: r.DoubleSide,
  19588. depthWrite: !1,
  19589. depthTest: !1,
  19590. transparent: !0,
  19591. vertexShader: c.waypoint.vertexShader,
  19592. fragmentShader: c.waypoint.fragmentShader,
  19593. uniforms: t,
  19594. name: 'waypoint',
  19595. opacity: 0,
  19596. visible: t.showMouseMarker // 显示/隐藏鼠标标志
  19597. })
  19598. ),
  19599. this.layers.set(h.RETICULE),
  19600. (this.renderOrder = u.reticule),
  19601. (this.player = e),
  19602. (this.direction = new r.Vector3()),
  19603. (this.hidden = !0),
  19604. (this.mouseLastMoveTime = Date.now())
  19605. }
  19606. var r = e('three'),
  19607. o = e('../settings'),
  19608. a = e('../util/transitions'),
  19609. s = e('../util/texture'),
  19610. l = e('../util/lerp'),
  19611. c = e('../shaders'),
  19612. h = e('../enum/RenderLayers'),
  19613. u = e('../enum/RenderOrder'),
  19614. d = s.load('images/reticule.png')
  19615. d.anisotropy = browser.isMobile() ? 1 : 4 //各向异性
  19616. ;(n.prototype = Object.create(r.Mesh.prototype)),
  19617. (n.prototype.move = function (e, t, i) {
  19618. ;(this.hidden = i), (this.mouseLastMoveTime = Date.now())
  19619. }),
  19620. (n.prototype.hide = function () {
  19621. this.hidden || ((this.hidden = !0), a.start(l.property(this.material.uniforms.opacity, 'value', 0), o.reticuleOpacityTransitionTime))
  19622. }),
  19623. (n.prototype.show = function () {
  19624. ;(this.hidden = !1), this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, 'value', o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  19625. }),
  19626. (n.prototype.update = function () {
  19627. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  19628. }),
  19629. (n.prototype.updatePosition = function (e, t) {
  19630. if (!this.hidden) {
  19631. if (!t) return this.hide()
  19632. var i = t.point,
  19633. n = e.distanceTo(i),
  19634. r = 1 + 0.01 * n
  19635. n < 1 && (r -= 1 - n),
  19636. this.show(),
  19637. this.scale.set(r, r, r),
  19638. (this.direction = this.direction.multiplyScalar(0.8)),
  19639. this.direction.add(t.face.normal.clone().multiplyScalar(0.2)),
  19640. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(0.01)),
  19641. this.lookAt(this.position.clone().add(this.direction))
  19642. }
  19643. }),
  19644. (n.prototype.writeAstag = function () {
  19645. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16),
  19646. t = new Date()
  19647. this.tagCount = 'undefined' == typeof this.tagCount ? 1 : this.tagCount + 1
  19648. var i = {
  19649. enabled: !0,
  19650. version: '0',
  19651. created: t.toISOString(),
  19652. created_by: 'APITest',
  19653. position: this.position.clone(),
  19654. stem: {
  19655. enabled: o.tags.pole.enabled,
  19656. direction: this.direction.multiplyScalar(o.tags.pole.height)
  19657. },
  19658. label: 'tag ' + this.tagCount,
  19659. description: 'Description ' + e,
  19660. floor: (function (e) {
  19661. if (e.currentFloor) {
  19662. var t = e.floors.indexOf(e.currentFloor)
  19663. return t > -1 ? t : void 0
  19664. }
  19665. })(this.player.model),
  19666. type: 'info',
  19667. metadata: {
  19668. preferred_camera: {
  19669. mode: this.player.mode
  19670. }
  19671. }
  19672. }
  19673. console.log('--------------------------'), console.log(JSON.stringify(i))
  19674. var n = this.player.model.addtag(e, i).build()
  19675. n && (n.disc && this.player.tagDiscs.push(n.disc), n.visible || n.show(o.tags.startup.fadeInDuration))
  19676. }),
  19677. (t.exports = n)
  19678. },
  19679. {
  19680. '../enum/RenderLayers': 41,
  19681. '../enum/RenderOrder': 42,
  19682. '../settings': 166,
  19683. '../shaders': 167,
  19684. '../util/lerp': 188,
  19685. '../util/texture': 194,
  19686. '../util/transitions': 195,
  19687. three: 217
  19688. }
  19689. ],
  19690. 150: [
  19691. function (e, t, i) {
  19692. 'use strict'
  19693. function n(e, t) {
  19694. ;(this.chunks = []), (this.floorId = e), (this.roomId = t), (this.position = new r.Vector3())
  19695. }
  19696. var r = e('three')
  19697. ;(n.prototype.addChunk = function (e) {
  19698. this.chunks.push(e)
  19699. }),
  19700. (n.prototype.calcBoundaries = function () {
  19701. for (var e = new r.Vector3(), t = new r.Vector3(0, 0, 0), i = new r.Vector3(0, 0, 0), n = new r.Vector3(0, 0, 0), o = 0, a = 0; a < this.chunks.length; a++) {
  19702. var s = this.chunks[a],
  19703. l = s.geometry.attributes.position
  19704. if (l) for (var c = 0; c < l.array.length; c += 3) e.set(l.array[c], l.array[c + 1], l.array[c + 2]), t.add(e), 0 === c ? (i.copy(e), n.copy(e)) : (i.max(e), n.min(e)), o++
  19705. }
  19706. o > 0 ? (t.multiplyScalar(1 / o), (this.average = t)) : (this.average = null),
  19707. (this.boundsMax = i),
  19708. (this.boundsMin = n),
  19709. (this.center = new r.Vector3()),
  19710. this.center.copy(i).sub(n).multiplyScalar(0.5).add(n)
  19711. }),
  19712. (t.exports = n)
  19713. },
  19714. {
  19715. three: 217
  19716. }
  19717. ],
  19718. 151: [
  19719. function (e, t, i) {
  19720. ;(function (i) {
  19721. 'use strict'
  19722. function n(e, t, i) {
  19723. ;(this.obj3d = null),
  19724. (this.nodes = []),
  19725. (this.colorHull = []),
  19726. (this.shortPaths = {}),
  19727. (this.floorHull = null),
  19728. (this.cameraHull = null),
  19729. (this.floorPathDistance = 0),
  19730. (this.floorCurvePoints = null),
  19731. (this.floorCurveColors = null),
  19732. (this.camCurvePoints = null),
  19733. (this.warpDestHeroLoc = null),
  19734. (this.warpDestPano = null),
  19735. (this.warpPathPoints = null),
  19736. (this.warpPathLengths = [0]),
  19737. (this.warpLength = 0),
  19738. (this.closeWarpDistance = 4),
  19739. (this.UP = A.UP.clone()),
  19740. (this.longestStep = 0),
  19741. (this.upcomingTransType = null),
  19742. (this.burnsDir = 1), //导览在DOLLHOUSE停留时的旋转方向 1 或 -1
  19743. (this.prevNextDist = 0),
  19744. (this.nextI = 0),
  19745. (this.activeTransType = null),
  19746. (this.lastTransType = null),
  19747. (this.bunnyObj = null),
  19748. (this.director = e),
  19749. (this.player = t),
  19750. (this.playerControls = i),
  19751. (this.modelManager = t.modelManager),
  19752. this.updateModel(),
  19753. this.updateDefaultsFromModelData(),
  19754. this.bindEvents(),
  19755. (this.warping = !1),
  19756. (this.waitingToWarp = !1),
  19757. (this.warpInterrupted = !1),
  19758. (this.warpInterruptionBlackoutStyle = null),
  19759. (this.warpInterruptionTravelTime = null)
  19760. }
  19761. var r = e('three'),
  19762. o = e('../util/logger'),
  19763. a = e('../enum/Viewmode'),
  19764. s = e('../enum/RenderOrder'),
  19765. l = e('../enum/WarpStyle'),
  19766. c = e('../settings'),
  19767. h = e('../util/math'),
  19768. u = e('../util/lerp'),
  19769. d = e('../util/easing'),
  19770. p = e('../util/transitions'),
  19771. f = e('../objects/Snapshot'),
  19772. g = e('../effects'),
  19773. m = e('../shaders'),
  19774. v = (e('../gui/gui'), e('../util/texture')),
  19775. A = e('../enum/Vectors'),
  19776. y = (e('../model/ModelManager'), new o(i)),
  19777. C = e('../enum/PlayerEvents'),
  19778. I = e('../enum/BlackoutStyle'),
  19779. E = e('../enum/ModelManagerEvents'),
  19780. b = e('../constants'),
  19781. w = {
  19782. path: v.loadBase64(
  19783. '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'
  19784. ),
  19785. pathEnd: v.load('images/End.png'),
  19786. pathStart: v.loadBase64(
  19787. '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=='
  19788. )
  19789. }
  19790. ;(n.prototype.setScene = function (e) {
  19791. this.createCpm(e), this.createBunnyObj(e)
  19792. }),
  19793. (n.prototype.updateModel = function () {
  19794. this.model = this.modelManager.getActiveModel()
  19795. }),
  19796. (n.prototype.bindEvents = function () {
  19797. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  19798. }),
  19799. (n.prototype.updateDefaultsFromModelData = function () {
  19800. this.model.data
  19801. }),
  19802. (n.prototype.pointPathDistance = function (e) {
  19803. for (var t = 0, i = 1; i < e.length; i += 1) t += e[i - 1].distanceTo(e[i])
  19804. return t
  19805. }),
  19806. (n.prototype.pointPathLengths = function (e) {
  19807. for (var t = [0], i = 1; i < e.length; i += 1) t.push(t[i - 1] + e[i - 1].distanceTo(e[i]))
  19808. return t
  19809. }),
  19810. (n.prototype.interpAlongPath = function (e, t, i) {
  19811. var n,
  19812. o = new r.Vector3(),
  19813. a = t[t.length - 1]
  19814. if (i < 1) {
  19815. n = i * a
  19816. for (var s = 1; s < t.length; s += 1)
  19817. if (t[s] > n) {
  19818. var l = (n - t[s - 1]) / (t[s] - t[s - 1])
  19819. return o.copy(e[s]), o.sub(e[s - 1]), o.multiplyScalar(l), o.add(e[s - 1]), o
  19820. }
  19821. } else o.copy(e[e.length - 1])
  19822. return o
  19823. }),
  19824. (n.prototype.pathHeight = function () {
  19825. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  19826. }),
  19827. (n.prototype.createBunnyObj = function (e) {
  19828. this.bunnyObj || ((this.bunnyObj = new r.AxisHelper(0.1)), (this.bunnyObj.visible = c.warp.showBunny)),
  19829. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  19830. e.add(this.bunnyObj)
  19831. }),
  19832. (n.prototype.createCpm = function (e) {
  19833. if (!this.currentPanoMarker) {
  19834. var t = this.makeWaypointObj(w.pathEnd, 'Current')
  19835. ;(t.material.uniforms.opacity.value = 0),
  19836. //变成一个定位sprite
  19837. /* let sprite = new THREE.Mesh(new THREE.PlaneBufferGeometry(0.4,0.4,1,1), new THREE.MeshBasicMaterial({
  19838. map: v.load('images/icon_address.png'), depthTest:false,
  19839. transparent:true,
  19840. }))
  19841. sprite.position.y = 0.3
  19842. let t = new THREE.Object3D()
  19843. t.add(sprite)
  19844. setTimeout(()=>{
  19845. window.player.on("view.changed",()=>{
  19846. player.path.currentPanoMarker.mesh.quaternion.copy(player.quaternion)
  19847. })
  19848. },1000)*/
  19849. (this.currentPanoMarker = {
  19850. mesh: t,
  19851. placed: !1
  19852. })
  19853. }
  19854. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19855. this.placeCpm(),
  19856. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  19857. }),
  19858. (n.prototype.placeCpm = function () {
  19859. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  19860. var e = this.player.currentPano.floor
  19861. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor &&
  19862. (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh), e.add(this.currentPanoMarker.mesh)),
  19863. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  19864. (this.currentPanoMarker.mesh.position.y += this.pathHeight()),
  19865. (this.currentPanoMarker.placed = !0)
  19866. } else this.popOutCpm()
  19867. }),
  19868. (n.prototype.fadeInCpm = function (e) {
  19869. //this.player.mode === a.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || c.path.mapGuides && this.currentPanoMarker.placed && p.start(u.property(this.currentPanoMarker.mesh.children[0].material/* .uniforms.opacity */, "opacity", 1), e)
  19870. ;(this.player.mode === a.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned()) ||
  19871. (c.path.mapGuides && this.currentPanoMarker.placed && p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, 'value', 1), e))
  19872. }),
  19873. (n.prototype.fadeOutCpm = function (e) {
  19874. //p.start(u.property(this.currentPanoMarker.mesh.children[0].material/* .uniforms.opacity */, "opacity", 0), e)
  19875. p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, 'value', 0), e)
  19876. })
  19877. ;(n.prototype.popInCpm = function () {
  19878. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  19879. }),
  19880. (n.prototype.popOutCpm = function () {
  19881. this.fadeOutCpm(2)
  19882. }),
  19883. (n.prototype.brushPrefs = {
  19884. linewidth: 7,
  19885. strokeWidth: 15,
  19886. cvSegments: 48,
  19887. paveStep: 0.1,
  19888. paveWidth: 0.2,
  19889. lookBlendDist: 3,
  19890. maxTurn: r.Math.degToRad(2)
  19891. }),
  19892. (n.prototype.panoPathDistance = function (e) {
  19893. var t = this.model.panos
  19894. if (!e || e.length < 2) return 0
  19895. for (var i = [], n = 0; n < e.length; n += 1) i.push(t.get(e[n]).floorPosition)
  19896. return this.pointPathDistance(i)
  19897. }),
  19898. (n.prototype.loadTileTexture = function (e) {
  19899. var t = v.load(
  19900. e,
  19901. function (t) {
  19902. ;(t.wrapS = r.RepeatWrapping), (t.wrapT = r.RepeatWrapping), (t.needsUpdate = !0), y.debug('path texture "' + e + '" is ready')
  19903. },
  19904. function () {
  19905. y.error('path texture "' + e + '" failed')
  19906. }
  19907. )
  19908. return (t.mapping = r.UVMapping), t
  19909. }),
  19910. (n.prototype.buildWarpDestinationDescriptor = function (e, t, i, n, r, o) {
  19911. var a = {
  19912. cameraMode: n,
  19913. position: e,
  19914. quaternion: t,
  19915. panoId: i,
  19916. orthoZoom: o,
  19917. floorVisibility: r,
  19918. thumbUrl: null,
  19919. name: null
  19920. }
  19921. return new f(a)
  19922. }),
  19923. (n.prototype.buildWarpDestinationDescriptorFromHero = function (e) {
  19924. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  19925. }),
  19926. (n.prototype.setWarpDestination = function (e) {
  19927. this.warpDestHeroLoc = e
  19928. }),
  19929. (n.prototype.setWarpDestinationByHeroIndex = function (e) {
  19930. var t = this.getHeroDescriptorByHeroIndex(e)
  19931. return null !== t && (this.setWarpDestination(t), !0)
  19932. }),
  19933. (n.prototype.setWarpDestinationByPano = function (e, t) {
  19934. var i = this.model.panos.get(e.id)
  19935. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  19936. }),
  19937. (n.prototype.setWarpDestinationByPanoId = function (e, t) {
  19938. var i = this.model.panos.get(e)
  19939. if (i) {
  19940. t = t || new r.Quaternion()
  19941. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, 'panorama', [], -1)
  19942. return this.setWarpDestination(n), !0
  19943. }
  19944. return !1
  19945. }),
  19946. (n.prototype.getHeroDescriptorByHeroIndex = function (e) {
  19947. var t = this.model.heroCount()
  19948. /* if (null !== this.warpDestHeroLoc && t < 2)
  19949. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  19950. this.model.getHeroDescriptorByIndex(0); */
  19951. var i = this.model.getHeroDescriptorByIndex(e)
  19952. if (i) {
  19953. var n = i.isPano() ? i.panoId : i.cameraMode
  19954. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + ' choices.')
  19955. }
  19956. return i
  19957. }),
  19958. (n.prototype.getHeroDescriptorByPano = function (e) {
  19959. var t = this.model.panos.get(e.id)
  19960. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  19961. }),
  19962. (n.prototype.getHeroDescriptorByPanoId = function (e) {
  19963. var t = this.getHeroIndexFromPanoId(e)
  19964. return this.getHeroDescriptorByHeroIndex(t)
  19965. }),
  19966. (n.prototype.getHeroIndexFromPanoId = function (e) {
  19967. for (var t = 0; t < this.model.heroLocations.length; t++) {
  19968. var i = this.model.heroLocations[t],
  19969. n = this.getHeroId(i)
  19970. if (n && n === e) return t
  19971. }
  19972. return -1
  19973. }),
  19974. (n.prototype.getHeroPano = function (e) {
  19975. if (null === e) return y.warn('getHeroPano(): no destination'), null
  19976. var t = this.getHeroId(e),
  19977. i = this.model.panos.get(t)
  19978. return void 0 === i && ((i = null), '' !== t && y.debug('unable to find pano "' + t + '"')), i
  19979. }),
  19980. (n.prototype.getHeroId = function (e) {
  19981. return e.panoId
  19982. }),
  19983. (n.prototype.setWarpDestPano = function () {
  19984. return (this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc)), this.warpDestPano
  19985. }),
  19986. (n.prototype.brushToWarpPano = function (e, t) {
  19987. if ((this.discardPathObject(), !this.setWarpDestPano())) return !1
  19988. if ((this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn('Can only brush from pano to pano'), !this.warpDestPano)) return y.info('No brush'), !1
  19989. if (!this.player.currentPano) return y.debug('No current pano, visibility undefined'), !1
  19990. if (!this.warpDestPano) return y.info('No wPano, visibility undefined'), !1
  19991. if (!this.warpDestPano.isAligned()) return y.debug('Cannot brush to unaligned pano'), !1
  19992. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides,
  19993. n = !0
  19994. if (this.player.currentPano.id === this.warpDestPano.id) y.debug('Already at destination pano')
  19995. else {
  19996. ;(this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano)),
  19997. (n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1),
  19998. (this.obj3d = new r.Object3D()),
  19999. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ')'),
  20000. n
  20001. ? (y.info('No "walkable" route, using fall-back warp style transition'), (e = t))
  20002. : (this.setPathHulls(this.nodes),
  20003. this.setFloorCurves(),
  20004. i &&
  20005. ('chevron' === c.path.style
  20006. ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints))
  20007. : 'ribbon' === c.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))),
  20008. this.player.currentPano.floor.add(this.obj3d)
  20009. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN,
  20010. s = e === l.STD
  20011. if (!n && (i || s)) {
  20012. if (o) {
  20013. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints)
  20014. this.obj3d.add(h)
  20015. }
  20016. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1])
  20017. this.obj3d.add(u)
  20018. }
  20019. this.appearSlow()
  20020. }
  20021. return (this.upcomingTransType = e), !n
  20022. }),
  20023. (n.prototype.findShortestPath = function (e, t) {
  20024. if (!e || !t) return null
  20025. var i = c.warp.walkExtraPanosDistance,
  20026. n = e.id + ':' + t.id + ':' + i
  20027. if (this.shortPaths.hasOwnProperty(n)) return this.shortPaths[n] ? this.shortPaths[n].slice() : null
  20028. var r = t.id + ':' + e.id + ':' + i
  20029. if (this.shortPaths.hasOwnProperty(r)) return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null
  20030. var o = this.model.panos.aStarSearch(e, t)
  20031. return this.model.panos.includeNodesNearPath(o, i), (this.shortPaths[n] = o ? o.slice() : null), o
  20032. }),
  20033. (n.prototype.makePathHulls = function (e) {
  20034. var t,
  20035. i,
  20036. n,
  20037. r,
  20038. o,
  20039. a = 0,
  20040. s = [],
  20041. l = [],
  20042. h = [],
  20043. u = this.model.panos
  20044. ;(t = u.get(e[0])), (r = t.floor.floorIndex)
  20045. for (var d = 0; d < e.length; d += 1)
  20046. (t = u.get(e[d])),
  20047. (i = t.floorPosition.clone().sub(this.model.position)),
  20048. (i.y += this.pathHeight()),
  20049. s.push(i),
  20050. l.push(t.position.clone()),
  20051. (n = t.floor.floorIndex),
  20052. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  20053. d > 0 && ((o = l[d].distanceTo(l[d - 1])), o > a && (a = o))
  20054. return (
  20055. a > this.longestStep && ((this.longestStep = a), y.debug('path contains ' + a + ' meter segment')),
  20056. {
  20057. floor: s,
  20058. camera: l,
  20059. color: h
  20060. }
  20061. )
  20062. }),
  20063. (n.prototype.makeFloorCurves = function (e, t, i) {
  20064. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius,
  20065. o = this.pointPathDistance(e) - 2 * n,
  20066. s = e.slice(0),
  20067. l = s[1].clone().sub(s[0])
  20068. ;(l.y = 0),
  20069. l.normalize().multiplyScalar(n),
  20070. (s[0] = new r.Vector3().copy(s[0]).add(l)),
  20071. (l = s[s.length - 2].clone().sub(s[s.length - 1])),
  20072. (l.y = 0),
  20073. l.normalize().multiplyScalar(n),
  20074. (s[s.length - 1] = new r.Vector3().copy(s[s.length - 1]).add(l))
  20075. var h = new r.CatmullRomCurve3(s),
  20076. u = Math.floor(o / i)
  20077. ;(u = 4 * Math.floor(u / 4)), (u = Math.max(4, u))
  20078. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3(), A = 0; A < g.length; A += 1) {
  20079. ;(f = 0), (d = g[A].distanceTo(e[0]))
  20080. for (var y = 1; y < e.length; y += 1) v.copy(g[A]).sub(e[y]), (v.y *= 4), (p = v.length()), p < d && (f = y)
  20081. m.push(t[f])
  20082. }
  20083. return {
  20084. distance: o,
  20085. points: g,
  20086. colors: m
  20087. }
  20088. }),
  20089. (n.prototype.makeCameraCurvePoints = function (e, t) {
  20090. var i = this.pointPathDistance(e),
  20091. n = new r.CatmullRomCurve3(e)
  20092. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  20093. }),
  20094. (n.prototype.makeCameraCurveTangents = function (e, t) {
  20095. var i = this.pointPathDistance(e),
  20096. n = new r.CatmullRomCurve3(e),
  20097. o = Math.max(2, Math.floor(i / t))
  20098. o || (o = 5)
  20099. for (var a = [], s = 0; s <= o; s++) a.push(n.getTangentAt(s / o))
  20100. return a
  20101. }),
  20102. (n.prototype.setPathHulls = function (e) {
  20103. var t = this.makePathHulls(e)
  20104. ;(this.floorHull = t.floor), (this.cameraHull = t.camera), (this.colorHull = t.color)
  20105. }),
  20106. (n.prototype.setFloorCurves = function () {
  20107. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep)
  20108. ;(this.floorPathDistance = e.distance), (this.floorCurvePoints = e.points), (this.floorCurveColors = e.colors)
  20109. }),
  20110. (n.prototype.setCameraCurvePoints = function () {
  20111. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  20112. }),
  20113. (n.prototype.chooseWarpPath = function (e) {
  20114. var t,
  20115. i,
  20116. n,
  20117. o = this.playerControls.cameras[a.PANORAMA]
  20118. if (this.player.currentPano === this.warpDestPano || !e) return (this.warpPathPoints = null), (this.warpLength = 0), !1
  20119. ;(this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano)),
  20120. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1
  20121. ? (y.debug('warp path to unreachable node'),
  20122. (t = this.warpDestPano.position.clone().sub(o.position)),
  20123. (i = t.clone().negate()),
  20124. t.multiplyScalar(0.15).add(o.position),
  20125. i.multiplyScalar(0.15).add(this.warpDestPano.position),
  20126. (t.y = o.position.y),
  20127. (i.y = this.warpDestPano.position.y),
  20128. (n = new r.CubicBezierCurve3(o.position.clone(), t, i, this.warpDestPano.position.clone())),
  20129. (this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)))
  20130. : (y.debug('follow warp path (path distance was ' + this.nodes.length + ' nodes, ' + this.floorPathDistance + ')'),
  20131. this.setCameraCurvePoints(),
  20132. (this.warpPathPoints = this.camCurvePoints.slice(0))),
  20133. (this.warpLength = 0),
  20134. (this.warpPathLengths = [0])
  20135. for (
  20136. var s = new r.Vector3(), l = new r.Vector3(), h = Math.cos(r.Math.degToRad(c.warp.minBrakeAngle)), u = Math.cos(r.Math.degToRad(c.warp.maxBrakeAngle)), d = 1;
  20137. d < this.warpPathPoints.length;
  20138. d += 1
  20139. ) {
  20140. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d])
  20141. var p = s.length()
  20142. s.y *= c.warp.climbEffort
  20143. var f = s.length() / p
  20144. if (d > 1) {
  20145. s.setY(0).normalize(),
  20146. l
  20147. .copy(this.warpPathPoints[d - 2])
  20148. .sub(this.warpPathPoints[d - 1])
  20149. .setY(0)
  20150. .normalize()
  20151. var g = Math.min(1, s.dot(l)),
  20152. m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h))
  20153. f = Math.max(m, f)
  20154. }
  20155. ;(this.warpLength += p * f), (this.warpPathLengths[d] = this.warpLength)
  20156. }
  20157. return !0
  20158. }),
  20159. (n.prototype.drawPathRibbon = function (e, t) {
  20160. this.bunnyObj.visible = c.warp.showBunny
  20161. for (var i = 0.6 * c.path.ribbonWidth * 0.5, n = new r.Vector3(), o = new r.Vector3(0, this.pathHeight(), 0), l = new r.Geometry(), h = new r.Vector3(), u = 0; u < e.length; u += 1) {
  20162. h.copy(e[u]), 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(), h.normalize(), n.crossVectors(h, A.UP), n.multiplyScalar(i)
  20163. var d = new r.Vector3().copy(e[u]).add(o)
  20164. d.sub(n), l.vertices.push(d), (d = new r.Vector3().copy(e[u]).add(o)), d.add(n), l.vertices.push(d)
  20165. }
  20166. var p,
  20167. f = 0
  20168. for (u = 0; u < e.length - 1; u += 1) {
  20169. var g = 2 * u,
  20170. v = f
  20171. f += e[u + 1].distanceTo(e[u])
  20172. var y = f,
  20173. C = t[u],
  20174. I = t[u + 1]
  20175. ;(p = new r.Face3(g, g + 1, g + 2)),
  20176. (p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)]),
  20177. l.faces.push(p),
  20178. l.faceVertexUvs[0].push([new r.Vector2(0, v), new r.Vector2(1, v), new r.Vector2(0, y)]),
  20179. (p = new r.Face3(g + 2, g + 1, g + 3)),
  20180. (p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)]),
  20181. l.faces.push(p),
  20182. l.faceVertexUvs[0].push([new r.Vector2(0, y), new r.Vector2(1, v), new r.Vector2(1, y)])
  20183. }
  20184. l.computeFaceNormals(), l.computeVertexNormals()
  20185. var E, b
  20186. this.player.mode === a.PANORAMA
  20187. ? ((b = r.UniformsUtils.clone(m.ribbon.uniforms)),
  20188. (b.map.value = w.path),
  20189. (b.opacity.value = 0),
  20190. b.color.value.set(c.path.color),
  20191. (E = new r.RawShaderMaterial({
  20192. side: r.DoubleSide,
  20193. depthWrite: !1,
  20194. transparent: !0,
  20195. vertexShader: m.ribbon.vertexShader,
  20196. fragmentShader: m.ribbon.fragmentShader,
  20197. uniforms: b,
  20198. name: 'ribbonT',
  20199. opacity: 0
  20200. })))
  20201. : (E = new r.MeshBasicMaterial({
  20202. color: 16777215,
  20203. side: r.DoubleSide,
  20204. name: 'ribbonOut',
  20205. vertexColors: r.VertexColors
  20206. }))
  20207. var _ = new r.Mesh(l, E)
  20208. _.renderOrder = 10
  20209. return (_.name = 'ribbon'), this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon), _
  20210. }),
  20211. (n.prototype.drawPathPavement = function (e) {
  20212. for (var t, i = 0.25, n = new r.Vector3(), o = new r.Geometry(), s = new r.Vector3(), l = 0; l < e.length; l += 1)
  20213. s.copy(e[l]),
  20214. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  20215. s.normalize(),
  20216. n.crossVectors(s, A.UP),
  20217. n.multiplyScalar(this.brushPrefs.paveWidth),
  20218. (t = new r.Vector3().copy(e[l])),
  20219. t.sub(n),
  20220. o.vertices.push(t),
  20221. o.vertices.push(new r.Vector3().copy(e[l])),
  20222. (t = new r.Vector3().copy(e[l])),
  20223. t.add(n),
  20224. o.vertices.push(t)
  20225. var h, u, d
  20226. for (l = 0; l < e.length - 1; l += 1)
  20227. (h = 3 * l + 1),
  20228. (u = l * i),
  20229. (d = u + i),
  20230. o.faces.push(new r.Face3(h - 1, h, h + 3)),
  20231. o.faceVertexUvs[0].push([new r.Vector2(0, u), new r.Vector2(0.5, u), new r.Vector2(0.5, d)]),
  20232. o.faces.push(new r.Face3(h + 3, h + 2, h - 1)),
  20233. o.faceVertexUvs[0].push([new r.Vector2(0.5, d), new r.Vector2(0, d), new r.Vector2(0, u)]),
  20234. o.faces.push(new r.Face3(h + 3, h, h + 1)),
  20235. o.faceVertexUvs[0].push([new r.Vector2(0.5, d), new r.Vector2(0.5, u), new r.Vector2(1, u)]),
  20236. o.faces.push(new r.Face3(h + 3, h + 1, h + 4)),
  20237. o.faceVertexUvs[0].push([new r.Vector2(0.5, d), new r.Vector2(1, u), new r.Vector2(1, d)])
  20238. var p =
  20239. this.player.mode === a.PANORAMA
  20240. ? new r.MeshBasicMaterial({
  20241. color: c.path.color,
  20242. side: r.DoubleSide,
  20243. transparent: !0,
  20244. depthWrite: !1,
  20245. opacity: 0,
  20246. name: 'paveT',
  20247. map: w.path
  20248. })
  20249. : new r.MeshBasicMaterial({
  20250. color: c.path.color,
  20251. side: r.DoubleSide,
  20252. transparent: !0,
  20253. depthWrite: !1,
  20254. opacity: 1,
  20255. name: 'paveO',
  20256. map: w.path
  20257. })
  20258. return new r.Mesh(o, p)
  20259. }),
  20260. (n.prototype.hintPrefs = {
  20261. rad: 0.18,
  20262. width: 0.0125,
  20263. depth: 0.0625,
  20264. setBack: -0.04,
  20265. markRad: 0.25,
  20266. markInnerRad: 0.16
  20267. }),
  20268. (n.prototype.makeWaypointObj = function (e, t) {
  20269. var i = new r.Geometry(),
  20270. n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius,
  20271. o = this.pathHeight()
  20272. i.vertices.push(new r.Vector3(-n, o, n), new r.Vector3(-n, o, -n), new r.Vector3(n, o, -n), new r.Vector3(n, o, n)),
  20273. i.faces.push(new r.Face3(0, 1, 2), new r.Face3(2, 3, 0)),
  20274. i.faceVertexUvs[0].push([new r.Vector2(0, 0), new r.Vector2(1, 0), new r.Vector2(1, 1)]),
  20275. i.faceVertexUvs[0].push([new r.Vector2(1, 1), new r.Vector2(0, 1), new r.Vector2(0, 0)])
  20276. var s = r.UniformsUtils.clone(m.waypoint.uniforms)
  20277. ;(s.map.value = e), (s.opacity.value = 0), s.color.value.set(c.path.color)
  20278. var l = {
  20279. side: r.DoubleSide,
  20280. depthWrite: !1,
  20281. transparent: !0,
  20282. vertexShader: m.waypoint.vertexShader,
  20283. fragmentShader: m.waypoint.fragmentShader,
  20284. uniforms: s,
  20285. name: 'waypoint',
  20286. opacity: 0
  20287. }
  20288. this.player.mode !== a.PANORAMA && ((l.depthTest = !1), (l.name = 'wayPtOut'))
  20289. var h = new r.RawShaderMaterial(l),
  20290. u = new r.Mesh(i, h)
  20291. return (u.name = t), u
  20292. }),
  20293. (n.prototype.makeStartMarker = function (e, t) {
  20294. var i = new r.Vector3().copy(t[1]).sub(t[0])
  20295. ;(i.y = 0), i.normalize()
  20296. var n = Math.acos(i.x),
  20297. o = this.makeWaypointObj(w.pathStart, 'Start')
  20298. return o.rotateOnAxis(new r.Vector3(0, 1, 0), n), o.position.copy(e), o
  20299. }),
  20300. (n.prototype.makeEndMarker = function (e) {
  20301. var t = this.makeWaypointObj(w.pathEnd, 'End'),
  20302. i = this.model.panos.get(this.nodes[0]).floor.floorIndex,
  20303. n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex
  20304. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown), t.position.copy(e), t
  20305. }),
  20306. (n.prototype.pathClean = function (e) {
  20307. if (e) {
  20308. for (var t in e.children) this.pathClean(e.children[t])
  20309. e.geometry && e.geometry.dispose(), e.material && e.material.dispose()
  20310. }
  20311. }),
  20312. (n.prototype.discardPathObject = function () {
  20313. if (this.obj3d) {
  20314. var e = this.obj3d.parent
  20315. e && e.remove(this.obj3d), this.pathClean(this.obj3d)
  20316. }
  20317. ;(this.obj3d = null), this.popInCpm()
  20318. }),
  20319. (n.prototype.discardSlow = function () {
  20320. if (this.obj3d) {
  20321. if (this.player.mode !== a.PANORAMA) return void this.discardPathObject()
  20322. for (
  20323. var e,
  20324. t = this,
  20325. i = 0,
  20326. n = function () {
  20327. this.discardPathObject()
  20328. }.bind(this),
  20329. r = 0;
  20330. r < t.obj3d.children.length;
  20331. r += 1
  20332. )
  20333. (e = t.obj3d.children[r]),
  20334. void 0 !== e.material &&
  20335. e.material.transparent === !0 &&
  20336. (void 0 !== e.material.uniforms
  20337. ? p.start(u.property(e.material.uniforms.opacity, 'value', 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing])
  20338. : p.start(u.property(e.material, 'opacity', 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing]),
  20339. (i += 1),
  20340. (n = null))
  20341. 0 === i && this.discardPathObject(), this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  20342. }
  20343. }),
  20344. (n.prototype.appearSlow = function () {
  20345. var e,
  20346. t = this
  20347. this.fadeOutCpm(c.path.fadeInTime)
  20348. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  20349. (e = t.obj3d.children[n]),
  20350. void 0 !== e.material &&
  20351. e.material.transparent === !0 &&
  20352. (void 0 !== e.material.uniforms
  20353. ? p.start(u.property(e.material.uniforms.opacity, 'value', i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing])
  20354. : p.start(u.property(e.material, 'opacity', i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing]))
  20355. }),
  20356. (n.prototype.update = function () {
  20357. this.obj3d && this.obj3d.updateMatrixWorld()
  20358. }),
  20359. (n.prototype.calcBurnsAmount = function (e) {
  20360. //计算导览点旋转角
  20361. var t = r.Math.degToRad(c.warp.burnsAngle)
  20362. if (this.player.mode === a.PANORAMA) {
  20363. var i = this.burnsDir * t
  20364. if (this.upcomingTransType === l.BLACK) return i
  20365. var n = e
  20366. if (null === n) return y.warn('Transition request for non-highlight'), i
  20367. var o = this.getHeroDescriptorByHeroIndex(n)
  20368. if (null === o) return i
  20369. if (!o.isPano()) return i
  20370. var s = this.getHeroPano(o),
  20371. h = this.playerControls.cameras[a.PANORAMA],
  20372. u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize(),
  20373. d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t),
  20374. p = function (e) {
  20375. var i = Math.acos(Math.min(1, e.dot(u))),
  20376. n = new r.Vector3().crossVectors(u, e)
  20377. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  20378. }
  20379. if (s === this.player.currentPano) return (i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize()))
  20380. var f = this.findShortestPath(this.player.currentPano, s)
  20381. if (void 0 === f || null === f || f.length < 1) return y.debug('Empty path ahead...'), i
  20382. var g = this.makePathHulls(f),
  20383. m = new r.CatmullRomCurve3(g.camera),
  20384. v = Math.min(0.1, c.warp.lookAheadDist / m.getLength())
  20385. return (i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize()))
  20386. }
  20387. return this.player.mode === a.DOLLHOUSE ? 0.02 * this.burnsDir : this.burnsDir
  20388. }),
  20389. (n.prototype.waitNextStep = function (e, t, time) {
  20390. //xzw 改时间
  20391. var i = time == void 0 ? c.warp.tourStepDelay : time
  20392. i == void 0 && (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault)
  20393. var n = new r.Euler(),
  20394. o = new r.Vector3()
  20395. y.debug('Starting wait: ' + (void 0 !== t))
  20396. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem) //this.model.heroLocations[this.director.currentItem[0]]
  20397. var s = currentLocation.dontRot || this.calcBurnsAmount(e),
  20398. h = function () {
  20399. this.endWarpState(), this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0), t && t()
  20400. }.bind(this),
  20401. u = function (e, t) {
  20402. if (this.warpInterrupted) return h(), !0
  20403. var r = t || 1e3 / 60
  20404. if (c.warp.doBurns && !currentLocation.dontRot)
  20405. if (this.player.mode === a.PANORAMA) {
  20406. var l = this.playerControls.cameras[a.PANORAMA]
  20407. n.setFromQuaternion(l.quaternion, c.warp.eOrder)
  20408. var u = i == 0 ? s : (r * s) / i
  20409. u = Math.sign(u) * Math.max(u, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  20410. ;(n.y += u), o.set(0, 0, -1), o.applyEuler(n), o.add(l.position), l.controls.lookAt(o), l.controls.lookVector.copy(o), l.lookAt(o)
  20411. } else
  20412. this.player.mode === a.DOLLHOUSE ? (this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s) : (this.playerControls.controls[a.FLOORPLAN].absoluteScale *= 0.9996)
  20413. }.bind(this)
  20414. this.startWarpState(), p.start(u, i, h, 0, d.easeInOutQuad, 'wait')
  20415. }),
  20416. (n.prototype.warpToNonPano = function (e) {
  20417. if ((this.discardPathObject(), this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN)) {
  20418. var t = function () {
  20419. e && e()
  20420. }.bind(this)
  20421. this.player.flyToNewMode({
  20422. mode: this.warpDestHeroLoc.cameraMode,
  20423. duration: c.warp.outsideTime,
  20424. warpDest: this.warpDestHeroLoc,
  20425. callback: t,
  20426. force: !0
  20427. })
  20428. } else y.warn('no warp destination!!!'), e && e()
  20429. }),
  20430. (n.prototype._resetWarpShaderParams = function (e) {
  20431. //
  20432. this.player.mode === a.PANORAMA &&
  20433. (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0), void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  20434. /* if(momentTourBlackNewType && "newBlack" in e.material.defines){
  20435. delete e.material.defines.newBlack;
  20436. e.material.needsUpdate = true
  20437. } */
  20438. }),
  20439. (n.prototype._clearWarpShading = function () {
  20440. for (var e = this.model.chunks, t = 0; t < e.length; t += 1) this._resetWarpShaderParams(e[t]), (e[t].visible = !0)
  20441. this._resetWarpShaderParams(this.model.skybox)
  20442. }),
  20443. (n.prototype._warpStopFlying = function () {
  20444. ;(this.activeTransType = null), this.placeCpm()
  20445. }),
  20446. (n.prototype._wrapupTravelOnlyBits = function () {
  20447. this._warpStopFlying(),
  20448. this.warpPathPoints && (this.player.currentPano.exit(), this.warpDestPano.enter(), (this.player.currentPano = this.warpDestPano)),
  20449. this.player.spider.draw(),
  20450. this.placeCpm()
  20451. }),
  20452. (n.prototype._wrapupTravel = function (e) {
  20453. this._wrapupTravelOnlyBits(), this.warpCameraAim(e)
  20454. }),
  20455. (n.prototype._wrapupWarpShading = function (e) {
  20456. this._clearWarpShading(), this._wrapupTravel(e)
  20457. }),
  20458. (n.prototype.wrapupWarpShadingOnly = function (e, t) {
  20459. t !== I.END && this._clearWarpShading(), this._wrapupTravelOnlyBits(), (this.upcomingTransType = null), e && e()
  20460. }),
  20461. (n.prototype._warpCameraAim = function (e, t) {
  20462. //到每个片段终点时转向终点朝向。
  20463. var i = this.warpDestHeroLoc.quaternion,
  20464. n = this.playerControls.cameras[a.PANORAMA],
  20465. o = new r.Vector3(0, 0, 1).applyQuaternion(i).normalize(),
  20466. s = new r.Vector3(0, 0, 1).applyQuaternion(n.quaternion).normalize(),
  20467. l = s.dot(o),
  20468. u = r.Math.radToDeg(Math.acos(l)),
  20469. f = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder),
  20470. g = new r.Euler().setFromQuaternion(n.quaternion, c.warp.eOrder),
  20471. m = new r.Euler(f.x - g.x, f.y - g.y, f.z - g.z, c.warp.eOrder)
  20472. ;(m.y = h.constrainedTurn(m.y)), (this.burnsDir = Math.sign(m.y))
  20473. var v = new r.Euler(0, 0, 0, c.warp.eOrder),
  20474. A = new r.Vector3(),
  20475. C = function (e, t) {
  20476. return (
  20477. !!this.warpInterrupted ||
  20478. ((v.x = g.x + e * m.x),
  20479. (v.y = g.y + e * m.y),
  20480. (v.z = g.z + e * m.z),
  20481. A.set(0, 0, -1),
  20482. A.applyEuler(v),
  20483. A.add(n.position),
  20484. n.controls.lookAt(A),
  20485. n.controls.lookVector.copy(A),
  20486. void n.lookAt(A))
  20487. )
  20488. }.bind(this)
  20489. /* return u > c.warp.minRotation ? (p.start(C, e, t, 0, d[c.warp.movementEasing])
  20490. ,(this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20491. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20492. ):
  20493. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20494. ,void (t && t())
  20495. ) */
  20496. this.warpDestHeroLoc.zoom != this.player.zoomLevel && //add 原地转向最终方位时
  20497. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom, e)
  20498. return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) : (y.info('Aim angle only is ' + u.toPrecision(3) + ' degrees, skipping explicit re-aim'), void (t && t()))
  20499. }),
  20500. (n.prototype._warpBendAim = function (e, t, i, n) {
  20501. var o = n || 0,
  20502. s = this.playerControls.cameras[a.PANORAMA],
  20503. l = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder),
  20504. u = new r.Euler().setFromQuaternion(s.quaternion, c.warp.eOrder),
  20505. f = new r.Euler(l.x - u.x, l.y - u.y, l.z - u.z, c.warp.eOrder)
  20506. f.y = h.constrainedTurn(f.y)
  20507. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x))
  20508. ;(f.x = g * Math.sign(f.x)), (g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g)), (this.burnsDir = Math.sign(f.y)), (g *= Math.sign(f.y)), (f.y = g)
  20509. var m = new r.Euler(0, 0, 0, c.warp.eOrder),
  20510. v = new r.Vector3(),
  20511. A = function (e, t) {
  20512. 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)
  20513. else {
  20514. var i = (1 - e) * c.warp.softBendEnd
  20515. ;(m.x = l.x - i * f.x), (m.y = l.y - i * f.y), (m.z = l.z - i * f.z)
  20516. }
  20517. v.set(0, 0, -1), v.applyEuler(m), v.add(s.position)
  20518. s.controls.lookAt(v), s.controls.lookVector.copy(v), s.lookAt(v)
  20519. }.bind(this)
  20520. if (window.DATA.momentTourBlackNewType) {
  20521. A(1)
  20522. } else return p.start(A, t, i, o, d[c.warp.movementEasing])
  20523. }),
  20524. (n.prototype._warpStepCameraAim = function (e, t, i) {
  20525. var n = this.playerControls.cameras[a.PANORAMA],
  20526. o = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder),
  20527. s = new r.Euler().setFromQuaternion(n.quaternion, c.warp.eOrder),
  20528. l = new r.Euler(o.x - s.x, o.y - s.y, o.z - s.z, c.warp.eOrder)
  20529. ;(l.y = h.constrainedTurn(l.y)), (this.burnsDir = Math.sign(l.y))
  20530. var u = new r.Euler(0, 0, 0, c.warp.eOrder),
  20531. f = new r.Vector3(),
  20532. g = function (e, t) {
  20533. e < 0.5 ? u.copy(s) : u.copy(o), f.set(0, 0, -1), f.applyEuler(u), f.add(n.position), n.controls.lookAt(f), n.controls.lookVector.copy(f), n.lookAt(f)
  20534. }.bind(this)
  20535. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  20536. }),
  20537. (n.prototype.setBurnsDir = function () {
  20538. var e = this.playerControls.cameras[a.PANORAMA],
  20539. t = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder),
  20540. i = new r.Euler().setFromQuaternion(e.quaternion, c.warp.eOrder),
  20541. n = new r.Euler(t.x - i.x, t.y - i.y, t.z - i.z, c.warp.eOrder)
  20542. ;(n.y = h.constrainedTurn(n.y)), (this.burnsDir = Math.sign(n.y))
  20543. }),
  20544. (n.prototype.stepWarpPath = function (firstPos, e) {
  20545. var i = this.playerControls.cameras[a.PANORAMA]
  20546. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  20547. if (!n) {
  20548. return i.position.copy(this.warpDestPano.position), !0
  20549. }
  20550. /* if (!this.warpPathPoints)
  20551. return i.position.copy(this.warpDestPano.position),
  20552. !0;
  20553. var n = this.warpPathPoints[0] */
  20554. var o = this.warpDestPano.position
  20555. /* console.log(firstPos)
  20556. console.log(o) */
  20557. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  20558. var s = new r.Vector3()
  20559. e < 0.5
  20560. ? s
  20561. .copy(this.cameraHull[1])
  20562. .sub(n)
  20563. .normalize()
  20564. .multiplyScalar(c.warp.softPushDist * e)
  20565. .add(n)
  20566. : s
  20567. .copy(this.cameraHull[this.cameraHull.length - 2])
  20568. .sub(o)
  20569. .normalize()
  20570. .multiplyScalar(c.warp.softPushDist * c.warp.softPushEnd * (1 - e))
  20571. .add(o),
  20572. i.position.copy(s)
  20573. } else e < 0.5 ? i.position.copy(n) : i.position.copy(o)
  20574. }),
  20575. (n.prototype.interruptAndFastForward = function (e, t) {
  20576. this.warping &&
  20577. ((this.warpInterrupted = !0),
  20578. (this.warpInterruptionBlackoutStyle = e),
  20579. (this.warpInterruptionTravelTime = t),
  20580. (null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle) || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  20581. (null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime) || (this.warpInterruptionTravelTime = c.minWarpTime))
  20582. }),
  20583. (n.prototype.warpCameraAim = function (e) {
  20584. var t = c.warp.minWarpTime
  20585. if (this.upcomingTransType === l.BLACK) t = c.warp.teleportTime
  20586. else {
  20587. var i = this.playerControls.cameras[a.PANORAMA],
  20588. n = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder),
  20589. o = new r.Euler().setFromQuaternion(i.quaternion, c.warp.eOrder),
  20590. s = new r.Euler(n.x - o.x, n.y - o.y, n.z - o.z, c.warp.eOrder)
  20591. s.y = h.constrainedTurn(s.y)
  20592. var u = (1e3 * Math.abs(s.y)) / r.Math.degToRad(c.warp.maxAimPerSec)
  20593. t = Math.max(t, u)
  20594. }
  20595. var d = function () {
  20596. this._warpStopFlying(), this.discardSlow(), e && e()
  20597. }.bind(this)
  20598. this._warpCameraAim(t, d)
  20599. }),
  20600. (n.prototype.warpCommonParameters = function (e, t, i, n) {
  20601. this.model.skybox.material.uniforms.blackout.value = n
  20602. var r = u.uniform(this.model.skybox, 'progress', 1),
  20603. o = u.allUniforms(this.model.chunks, 'progress', 1),
  20604. a = !1,
  20605. s = function () {
  20606. if (this.warpInterrupted) return (a = !0), !0
  20607. }.bind(this),
  20608. l = function (e, t) {
  20609. return i && a ? ((this.model.skybox.material.uniforms.progress.value = 0), !0) : void r(e, t)
  20610. }.bind(this),
  20611. h = function (e, t) {
  20612. return i && a ? (o(0), !0) : void o(e, t)
  20613. }.bind(this)
  20614. p.start(s, e, null, t, null, 'safeHaltWatch'), p.start(l, e, null, t, d[c.warp.blendEasing], 'skyboxProgress'), p.start(h, e, null, t, d[c.warp.blendEasing], 'chunkProgress')
  20615. }),
  20616. (n.prototype.warpTravel_STD = function (e) {
  20617. var t,
  20618. i = Math.min(c.warp.lookAheadMax, c.warp.lookAheadDist / this.warpLength),
  20619. n = this.playerControls.cameras[a.PANORAMA],
  20620. o = (Math.min(0.25, 3 / this.warpLength), Math.min(0.35, 7 / this.warpLength)),
  20621. s = new r.Euler(0, 0, 0, c.warp.eOrder),
  20622. f = new r.Vector3(),
  20623. m = new r.Euler().setFromQuaternion(n.quaternion, c.warp.eOrder),
  20624. v = new r.Euler().copy(m),
  20625. C = n.position.clone(),
  20626. E = new r.Matrix4(),
  20627. b = new r.Euler(),
  20628. w = c.warp.minWarpTime
  20629. ;(w += this.warpLength * c.warp.timePerMeter), c.warp.flySpeed > 0.01 && (w = (1e3 * this.warpLength) / c.warp.flySpeed)
  20630. var _ = !1,
  20631. T = this.warpDestHeroLoc.quaternion,
  20632. x = new r.Vector3(0, 0, -1).applyQuaternion(T).normalize(),
  20633. S = this.warpPathPoints[this.warpPathPoints.length - 1]
  20634. .clone()
  20635. .sub(this.warpPathPoints[this.warpPathPoints.length - 2])
  20636. .normalize(),
  20637. M = S.dot(x),
  20638. R = r.Math.radToDeg(Math.acos(M)),
  20639. P = function (e) {
  20640. var t = o,
  20641. i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1))
  20642. return i
  20643. },
  20644. O = function () {
  20645. return (
  20646. E.lookAt(C, t, A.UP),
  20647. s.setFromRotationMatrix(E, c.warp.eOrder),
  20648. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20649. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20650. h.constrainedTurn(b.y)
  20651. )
  20652. }.bind(this),
  20653. L = function (e, t) {
  20654. if (this.warpInterrupted) return (_ = !0), !0
  20655. }.bind(this),
  20656. D = function (e, t) {
  20657. return _ || !this.warpPathPoints ? (g.blur(0), !0) : void g.blur(e)
  20658. }.bind(this),
  20659. N = u.allUniforms(this.model.chunks, 'modelAlpha', 1),
  20660. B = function (e, t) {
  20661. return _ || !this.warpPathPoints ? (N(0), !0) : void N(e, t)
  20662. }.bind(this),
  20663. F = function (e, t) {
  20664. if (!this.warpPathPoints) return n.position.copy(this.warpDestPano.position), !0
  20665. if (_) return !0
  20666. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e)
  20667. n.position.copy(i), (C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, 0.99 * e))
  20668. }.bind(this),
  20669. V = function (e, n) {
  20670. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug('Lost bunny.'), !0)
  20671. }.bind(this),
  20672. U = function (e, o) {
  20673. if (_) return y.debug('>>>> Walkthrough interupted at t=' + e), !0
  20674. if (!this.warpPathPoints) return !0
  20675. var a = this.warpLength * e,
  20676. l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist),
  20677. u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength)
  20678. c.warp.matchCam && (l *= 1 - u),
  20679. E.lookAt(C, t, A.UP),
  20680. s.setFromRotationMatrix(E, c.warp.eOrder),
  20681. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20682. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20683. (b.y = h.constrainedTurn(b.y)),
  20684. (s.x = m.x + l * b.x),
  20685. (s.y = m.y + l * b.y),
  20686. (s.z = m.z + l * b.z),
  20687. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  20688. (b.y = h.constrainedTurn(b.y))
  20689. var d = (r.Math.degToRad(c.warp.maxTurnPerSec) * o) / 1e3
  20690. ;(b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y))),
  20691. (v.x = v.x + b.x * c.warp.turnFriction),
  20692. (v.y = v.y + b.y * c.warp.turnFriction),
  20693. (v.z = v.z + b.z * c.warp.turnFriction),
  20694. (v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x))
  20695. var p = t.clone().sub(C).normalize()
  20696. if (R < c.warp.maxAimRotation && u > 0) {
  20697. var g = 1 - u
  20698. ;(p.x = p.x * g + u * S.x), (p.y = p.y * g + u * S.y), (p.z = p.z * g + u * S.z), p.normalize()
  20699. }
  20700. this.bunnyObj.position.copy(n.position).add(p),
  20701. f.set(0, 0, -1).applyEuler(v).normalize(),
  20702. f.multiplyScalar(8),
  20703. f.add(n.position),
  20704. (e > 1 - i && c.warp.matchCam) || (n.controls.lookAt(f), n.controls.lookVector.copy(f), n.lookAt(f))
  20705. }.bind(this),
  20706. k = function () {
  20707. _ ? (this.discardSlow(), (this.upcomingTransType = l.BLACK), this.warpTravel_BLACK(-0.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  20708. }.bind(this)
  20709. V(0)
  20710. var H = c.warp.motionLeadTime + (1e3 * Math.abs(O())) / r.Math.degToRad(c.warp.maxTurnPerSec)
  20711. w += H
  20712. var G = H / w
  20713. this.warpCommonParameters(w, G, !0, I.NONE),
  20714. p.start(L, w, null, 0, null, '_haltWatcher'),
  20715. c.warp.blur > 0 && ((g.blurStrength = c.warp.blur), p.start(D, w, null, G, P, 'blurring')),
  20716. p.start(B, w, null, G, P, 'modelAlpha'),
  20717. p.start(F, w, null, G, d[c.warp.blendEasing], 'followPath'),
  20718. p.start(V, w, null, G, d[c.warp.blendEasing], 'goBunny'),
  20719. p.start(U, w, k, 0, d[c.warp.blendEasing], 'lookAtBunny')
  20720. }),
  20721. (n.prototype.warpTravel_BLACK = function (e, t, i, n) {
  20722. var r = e || 0
  20723. ;(void 0 !== t && null !== t) || (t = c.warp.teleportTime)
  20724. //add
  20725. player.model.hotGroup.visible = false
  20726. let oldPano = this.player.currentPano
  20727. let toPano = this.player.model.panos.get(this.warpDestHeroLoc.panoId)
  20728. this.player.emit('pano.chosen', oldPano, toPano)
  20729. var done = () => {
  20730. this.player.transitionPos({
  20731. type: 'beforeFlytopano',
  20732. pano: this.player.currentPano,
  20733. dur: 0,
  20734. callback: () => {
  20735. player.model.hotGroup.visible = true
  20736. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  20737. }
  20738. })
  20739. this.player.emit('flying.ended', toPano.position, oldPano.position, toPano, oldPano)
  20740. }
  20741. if (window.DATA.momentTourBlackNewType) {
  20742. player.sceneRenderer.effects.fastTranMaskPass.start(player.sceneRenderer)
  20743. var camera = this.playerControls.cameras[a.PANORAMA]
  20744. var end = this.warpDestHeroLoc.position
  20745. camera.position.copy(end)
  20746. setTimeout(() => {
  20747. player.sceneRenderer.effects.fastTranMaskPass.stop()
  20748. this.wrapupWarpShadingOnly(n, i)
  20749. done()
  20750. }, t)
  20751. } else {
  20752. var o = function () {
  20753. this.wrapupWarpShadingOnly(n, i)
  20754. done()
  20755. }.bind(this)
  20756. var firstPos = this.player.position.clone() //add
  20757. p.start(this.stepWarpPath.bind(this, firstPos), t, o, r, d[c.warp.blendEasing], 'stepMotion')
  20758. }
  20759. this.warpCommonParameters(t, r, !1, i)
  20760. this.model.chunks.concat(this.model.skybox).forEach(function (e) {
  20761. // 改
  20762. if (window.DATA.momentTourBlackNewType) {
  20763. e.material.uniforms.blackout.value = 5 //i 改
  20764. //e.material.defines.newBlack = ''
  20765. //e.material.needsUpdate = true
  20766. } else {
  20767. e.material.uniforms.blackout.value = i
  20768. }
  20769. }),
  20770. this._warpBendAim(null, t, null, r)
  20771. }),
  20772. (n.prototype.flightStepWalk = (function (e, t, i) {
  20773. var n = 0.001,
  20774. o = 1,
  20775. a = 1.2,
  20776. s = new r.Vector3(),
  20777. h = new r.Vector3(),
  20778. u = function (e, t) {
  20779. //导览速度
  20780. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold),
  20781. // , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  20782. r = i * c.warp.flytimeDistanceMultiplier + c.warp.flyTime
  20783. h.copy(A.FORWARD), this.player.getDirection(h), s.copy(t).sub(e.position).normalize()
  20784. var l = s.dot(h),
  20785. u = Math.acos(l),
  20786. d = u / r
  20787. d > n && ((r *= d / n), u < o && (r *= a))
  20788. return (r / DATA.tourWalkSpeed) * 100 // 改
  20789. }
  20790. return function (e, t, i) {
  20791. if (this.warpInterrupted) i && i()
  20792. else if (this.activeTransType !== l.WALK) this._clearWarpShading(), this._warpStopFlying(), this.player.spider.draw(), this.placeCpm(), i && i()
  20793. else if (this.player.currentPano !== e) {
  20794. var n = {
  20795. pano: e,
  20796. lookAtPoint: t,
  20797. duration: null,
  20798. maxDistanceOverride: c.warp.walkMaxDist,
  20799. skipWarpingCheck: !1,
  20800. constantMoveSpeed: !0
  20801. }
  20802. if (e == this.warpDestPano) {
  20803. //到达终点前,放大到终点的zoom
  20804. n.zoomLevel = this.warpDestHeroLoc.zoom
  20805. }
  20806. ;(n.duration = u.call(this, e, t)), this.player.nonInterruptingFlyToPano(n, i)
  20807. } else i && i()
  20808. }
  20809. })()),
  20810. (n.prototype.makeWalkFlightFunc = function (e, t, i) {
  20811. return this.flightStepWalk.bind(this, e, t, i)
  20812. }),
  20813. (n.prototype.warpTravel_WALK = (function () {
  20814. var e = []
  20815. return function (t) {
  20816. var i = this.player.model.panos
  20817. e.length = 0
  20818. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  20819. var s = this.nodes[a],
  20820. l = i.get(s)
  20821. a === this.nodes.length - 1
  20822. ;(o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist), (n && o) || (e.push(s), (n = l))
  20823. }
  20824. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1])
  20825. var h = e.length,
  20826. u = i.get(e[h - 1]),
  20827. d = new Array(h + 1)
  20828. d[d.length - 1] = function () {
  20829. t && t()
  20830. }.bind(this)
  20831. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  20832. var g = e[p]
  20833. u = i.get(g)
  20834. var m = new r.Vector3()
  20835. this.getLookAtForWalkingTourNode(e, p, m), (d[f - 1] = this.makeWalkFlightFunc(u, m, d[f])), p--
  20836. }
  20837. d[0]()
  20838. }
  20839. })()),
  20840. (n.prototype.getLookAtForWalkingTourNode = (function () {
  20841. var e = new r.Vector3(),
  20842. t = new r.Vector3(),
  20843. i = new r.Vector3(),
  20844. n = new r.Vector3(),
  20845. o = new r.Vector3(),
  20846. a = 0.65,
  20847. s = 0.75,
  20848. l = 0.2,
  20849. c = 0.4,
  20850. h = 0.2,
  20851. u = 3
  20852. return function (r, d, p) {
  20853. var f = r.length
  20854. if (d >= f) return !1
  20855. var g = 1,
  20856. m = 1
  20857. t.set(0, 0, 0), o.set(0, 0, 0)
  20858. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  20859. if (((v = this.player.model.panos.get(r[A])), this.getOrientationForWalkingTourNode(r, A, i), A === d && e.copy(i), n.copy(i), A > d)) {
  20860. var y = n.dot(e) < a
  20861. ;(g *= y ? l : s), (m *= y ? h : c)
  20862. }
  20863. i.multiplyScalar(g), t.add(i), o.lerp(v.position, m)
  20864. }
  20865. return t.normalize(), p.copy(o), p.add(t), !0
  20866. }
  20867. })()),
  20868. (n.prototype.getOrientationForWalkingTourNode = function (e, t, i) {
  20869. var n = e.length
  20870. if (t >= n) return !1
  20871. if (t === n - 1) i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion)
  20872. else {
  20873. var r = this.player.model.panos.get(e[t]),
  20874. o = this.player.model.panos.get(e[t + 1])
  20875. i.copy(o.position).sub(r.position)
  20876. }
  20877. return i.normalize(), !0
  20878. }),
  20879. (n.prototype.warpCameraTravel = function (e, t, i, n) {
  20880. if (((this.activeTransType = this.upcomingTransType), (this.lastTransType = this.activeTransType), (this.upcomingTransType = null), !e)) {
  20881. var r = function () {
  20882. this._wrapupTravel(n)
  20883. }.bind(this),
  20884. o = {
  20885. pano: this.warpDestPano,
  20886. lookAtPoint: null,
  20887. duration: null,
  20888. maxDistanceOverride: null,
  20889. skipWarpingCheck: !1
  20890. }
  20891. return void this.player.flyToPano(o, r)
  20892. }
  20893. this.activeTransType === l.BLACK
  20894. ? this.warpTravel_BLACK(null, i, t, n)
  20895. : this.activeTransType === l.WALK
  20896. ? this.warpTravel_WALK(
  20897. function () {
  20898. this._clearWarpShading(), this._warpStopFlying(), this.player.spider.draw(), this.placeCpm(), n && n()
  20899. }.bind(this)
  20900. )
  20901. : this.warpTravel_STD(n)
  20902. }),
  20903. (n.prototype.startWarpState = function () {
  20904. ;(this.warping = !0), (this.warpInterrupted = !1), (this.warpInterruptionBlackoutStyle = null), (this.warpInterruptionTravelTime = null)
  20905. }),
  20906. (n.prototype.endWarpState = function () {
  20907. this.warping = !1
  20908. this.director.emit('warp.end') //xzw add
  20909. }),
  20910. (n.prototype.warpToPano = function (e, t, i, n) {
  20911. if (this.warping) return void y.warn('Cannot warp when already warping')
  20912. if (((this.upcomingTransType = e), (this.activeTransType = null), !this.setWarpDestPano())) return (this.upcomingTransType = null), void this.warpToNonPano(n)
  20913. if (this.player.mode !== a.PANORAMA)
  20914. return (
  20915. (this.upcomingTransType = null),
  20916. this.discardSlow(),
  20917. void this.player.flyToNewMode({
  20918. mode: a.PANORAMA,
  20919. pano: this.warpDestPano,
  20920. duration: c.warp.outsideTime,
  20921. warpDest: this.warpDestHeroLoc,
  20922. callback: n,
  20923. force: !0
  20924. })
  20925. )
  20926. if (!this.warpDestPano) return y.warn('no warp destination, callback dropped'), void (this.upcomingTransType = null)
  20927. var r = !(
  20928. this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) &&
  20929. this.warpDestPano !== this.player.currentPano &&
  20930. this.warpDestPano.position.distanceTo(this.player.currentPano.position) < c.warp.nearPanoDist
  20931. ),
  20932. o = this.chooseWarpPath(r)
  20933. if (o && this.upcomingTransType !== l.WALK) {
  20934. var s = function () {
  20935. ;(this.waitingToWarp = !1), this.warpToPano(e, t, i, n)
  20936. }.bind(this)
  20937. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, 'high', 'low', this.player.basePanoSize, s)) return void (this.waitingToWarp = !0)
  20938. }
  20939. this.player.currentPano ||
  20940. (y.warn('Arrived at a very strange spot!'), (this.player.currentPano = this.warpDestPano), this.placeCpm(), this.fadeOutCpm(c.path.fadeOutTime), this.player.spider.draw()),
  20941. y.debug('Warping to pano ', this.warpDestPano.position),
  20942. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  20943. this.startWarpState()
  20944. var h = function () {
  20945. this.endWarpState(), n && n()
  20946. }.bind(this)
  20947. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h)
  20948. //this.player.smoothZoomToDefault(c.zoom.restoreTime);
  20949. }),
  20950. (t.exports = n)
  20951. }).call(this, '/js/objects/ShowPath.js')
  20952. },
  20953. {
  20954. '../constants': 8,
  20955. '../effects': 16,
  20956. '../enum/BlackoutStyle': 18,
  20957. '../enum/ModelManagerEvents': 33,
  20958. '../enum/PlayerEvents': 40,
  20959. '../enum/RenderOrder': 42,
  20960. '../enum/Vectors': 50,
  20961. '../enum/Viewmode': 51,
  20962. '../enum/WarpStyle': 52,
  20963. '../gui/gui': 65,
  20964. '../model/ModelManager': 140,
  20965. '../objects/Snapshot': 153,
  20966. '../settings': 166,
  20967. '../shaders': 167,
  20968. '../util/easing': 186,
  20969. '../util/lerp': 188,
  20970. '../util/logger': 189,
  20971. '../util/math': 190,
  20972. '../util/texture': 194,
  20973. '../util/transitions': 195,
  20974. three: 217
  20975. }
  20976. ],
  20977. 152: [
  20978. function (e, t, i) {
  20979. 'use strict'
  20980. function n() {
  20981. var e = new r.SphereBufferGeometry(a.skyboxRadius, 20, 5),
  20982. t = new r.RawShaderMaterial({
  20983. fragmentShader: o.skysphere.fragmentShader,
  20984. vertexShader: o.skysphere.vertexShader,
  20985. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  20986. side: r.BackSide,
  20987. name: 'skysphere'
  20988. })
  20989. ;(t.uniforms.radius.value = e.parameters.radius), r.Mesh.call(this, e, t)
  20990. }
  20991. var r = e('three'),
  20992. o = e('../shaders'),
  20993. a = e('../settings')
  20994. ;(n.prototype = Object.create(r.Mesh.prototype)), (n.prototype.constructor = n), (t.exports = n)
  20995. },
  20996. {
  20997. '../settings': 166,
  20998. '../shaders': 167,
  20999. three: 217
  21000. }
  21001. ],
  21002. 153: [
  21003. function (e, t, i) {
  21004. ;(function (i) {
  21005. 'use strict'
  21006. function n(e) {
  21007. o.call(this, e),
  21008. (this.sid = e.sid), //xzw add
  21009. (this.panoId = e.panoId),
  21010. (this.orthoZoom = e.orthoZoom),
  21011. (this.floorVisibility = e.floorVisibility),
  21012. (this.thumbUrl = e.thumbUrl),
  21013. (this.name = e.name),
  21014. (this.zoom = e.zoom)
  21015. }
  21016. var r = (e('three'), e('../util/logger')),
  21017. o = (e('../settings'), e('../enum/Viewmode'), e('../util/common'), e('../util/transitions'), e('../util/lerp'), e('../util/ajax'), e('../util/texture'), e('./View'))
  21018. e('events').EventEmitter, new r(i)
  21019. ;(n.prototype = Object.create(o.prototype)),
  21020. (n.prototype.isPano = function () {
  21021. return this.panoId && '' !== this.panoId && this.panoId != 'outside'
  21022. }),
  21023. (t.exports = n)
  21024. }).call(this, '/js/objects/Snapshot.js')
  21025. },
  21026. {
  21027. '../enum/Viewmode': 51,
  21028. '../settings': 166,
  21029. '../util/ajax': 181,
  21030. '../util/common': 185,
  21031. '../util/lerp': 188,
  21032. '../util/logger': 189,
  21033. '../util/texture': 194,
  21034. '../util/transitions': 195,
  21035. './View': 154,
  21036. events: 202,
  21037. three: 217
  21038. }
  21039. ],
  21040. 154: [
  21041. function (e, t, i) {
  21042. ;(function (i) {
  21043. 'use strict'
  21044. function n(e) {
  21045. ;(e = e || {}), (this.position = new r.Vector3()), (this.quaternion = new r.Quaternion()), this.update(e)
  21046. }
  21047. var r = e('three'),
  21048. o = e('../util/logger'),
  21049. a = (e('../settings'), e('../enum/Viewmode'), e('../util/common'), e('../util/transitions'), e('../util/lerp'), e('../util/ajax'), e('../util/texture'), e('events').EventEmitter)
  21050. new o(i)
  21051. ;(n.prototype = Object.create(a.prototype)),
  21052. (n.prototype.isValid = function () {
  21053. return !!this.cameraMode
  21054. }),
  21055. (n.prototype.update = function (e) {
  21056. return (
  21057. (this.cameraMode = e.cameraMode || this.cameraMode),
  21058. (this.pano = e.pano || this.pano),
  21059. e.position && this.position.copy(e.position),
  21060. e.quaternion && this.quaternion.copy(e.quaternion),
  21061. this
  21062. )
  21063. }),
  21064. (t.exports = n)
  21065. }).call(this, '/js/objects/View.js')
  21066. },
  21067. {
  21068. '../enum/Viewmode': 51,
  21069. '../settings': 166,
  21070. '../util/ajax': 181,
  21071. '../util/common': 185,
  21072. '../util/lerp': 188,
  21073. '../util/logger': 189,
  21074. '../util/texture': 194,
  21075. '../util/transitions': 195,
  21076. events: 202,
  21077. three: 217
  21078. }
  21079. ],
  21080. 155: [
  21081. function (e, t, i) {
  21082. //player.js
  21083. ;(function (i) {
  21084. 'use strict'
  21085. function n(e) {
  21086. ;(this.currentPano = null),
  21087. (this.nextPano = null),
  21088. (this.camera = null),
  21089. (this.paused = !1),
  21090. (this.flying = !1),
  21091. (this.sceneIntersectionPlane = null),
  21092. (this.target = new r.Vector3()),
  21093. (this.mouse = new r.Vector3(1.1, 1.1, 0.5)),
  21094. (this.mouseAtMouseDown = new r.Vector2()),
  21095. (this.mouseCouldBeClickToMove = !1),
  21096. (this.mouseLastMoveTime = Date.now()),
  21097. (this.mouseDown = !1),
  21098. (this.mouseDownTimer = null),
  21099. (this.couldBeLongTap = !1),
  21100. (this.containsMouse = !1), //
  21101. (this.isTouchEvent = !1),
  21102. (this.isPanoHover = !1),
  21103. (this.reticule = new a(this)),
  21104. (this.panoMarkers = []),
  21105. (this.spider = new h(this)),
  21106. (this.quaternion = new r.Quaternion()),
  21107. (this.position = new r.Vector3(15, 10, 15)),
  21108. (this.previousState = null),
  21109. (this.lastInsideView = new c()),
  21110. (this.last360View = new c()),
  21111. (this.raycaster = new r.Raycaster()),
  21112. (this.intersect = null),
  21113. (this.lastChangeTime = Date.now()),
  21114. (this.history = new I()),
  21115. (this.cameraControls = null),
  21116. (this.path = null),
  21117. (this.model = null),
  21118. (this.domElement = null),
  21119. (this.cachedPanoCandidates = null),
  21120. (this.basePanoSize = 0),
  21121. (this.standardPanoSize = 0),
  21122. (this.highPanoSize = 0),
  21123. (this.ultraHighPanoSize = 0),
  21124. (this.zoomLevel = 1),
  21125. (this.zooming = 0),
  21126. (this.zoomSpeed = 0.5),
  21127. (this.scrollZoomSpeed = 0.06),
  21128. (this.zoomSpeedAdjust = 0.05),
  21129. (this.defaultZoomIncrement = 0.2),
  21130. (this.baseFov = f.insideFOV),
  21131. (this.zoomFov = this.baseFov),
  21132. (this.zoomEnabled = !0),
  21133. (this.preRenderingEnabled = !1),
  21134. this.setupCustomProperties(e),
  21135. (this.zoomStats = new L())
  21136. window.player = this
  21137. this.modeTran = ''
  21138. }
  21139. var r = e('three'),
  21140. o = e('./util/logger'),
  21141. a = e('./objects/Reticule'),
  21142. s = e('./objects/Panorama'),
  21143. l = e('./objects/ShowPath'),
  21144. c = e('./objects/View'),
  21145. h = (e('./objects/Snapshot'), e('./objects/NSpider')),
  21146. u = e('./enum/Viewmode'),
  21147. d = (e('./enum/TagStates'), e('./enum/Vectors')),
  21148. p = e('./enum/Keys'),
  21149. f = (e('./enum/AlignmentType'), e('./settings')),
  21150. g = e('./util/common'),
  21151. m = (e('./util/browser'), e('./util/math')),
  21152. v = e('./util/lerp'),
  21153. A = e('./util/easing'),
  21154. y = e('./util/transitions'),
  21155. C = e('events').EventEmitter,
  21156. I = (e('./shaders'), e('./util/history')),
  21157. E = (e('./util/camera'), e('./model/ModelManager'), e('./enum/PathDiscardMode')),
  21158. b = e('./enum/PathDisplayMode'),
  21159. w = e('./enum/PlayerEvents'),
  21160. _ = e('./enum/ControlEvents'),
  21161. T = e('./enum/ModelManagerEvents'),
  21162. x = e('./enum/WarpStyle'),
  21163. S = e('./enum/BlackoutStyle'),
  21164. M = e('./exception/BasicException'),
  21165. R = e('./enum/PanoSizeClass'),
  21166. P = (e('./tile/TileDownloader'), e('./tile/TilePrioritizer')),
  21167. O = (e('./enum/PanoramaEvents'), e('./enum/ZoomEvents')),
  21168. L = e('./util/ZoomStats'),
  21169. D = e('./constants'),
  21170. N = e('./util/common'),
  21171. B = e('./util/cameraLight'),
  21172. //, Hot = e('hot')
  21173. F = new o(i),
  21174. V = Object.freeze({
  21175. FlyToPano: y.getUniqueId(),
  21176. FlyToNewMode: y.getUniqueId(),
  21177. FlyToSameMode: y.getUniqueId(),
  21178. FlyToViewFloor: y.getUniqueId(),
  21179. LookTransition: y.getUniqueId(),
  21180. ZoomTransition: y.getUniqueId()
  21181. })
  21182. ;(n.prototype = Object.create(C.prototype)),
  21183. (n.prototype.init = function (e) {
  21184. ;(this.modelManager = e.modelManager),
  21185. (this.tileDownloader = e.tileDownloader),
  21186. (this.panoRenderer = e.panoRenderer),
  21187. (this.qualityManager = e.qualityManager),
  21188. (this.domElement = e.container),
  21189. (this.camera = e.camera),
  21190. (this.tagManager = e.tagManager),
  21191. (this.cameraControls = e.controls),
  21192. (this.path = new l(e.director, this, e.controls)),
  21193. (this.basePanoSize = this.qualityManager.getPanoSize(R.BASE)),
  21194. (this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD)),
  21195. (this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH)),
  21196. (this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH)),
  21197. (this.tileDownloader.processPriorityQueue = !1),
  21198. (this.tileDownloader.tilePrioritizer = new P(this.qualityManager, this.basePanoSize, this.standardPanoSize, this.highPanoSize, this.ultraHighPanoSize)),
  21199. this.bindEvents(e.container),
  21200. this.updateModel()
  21201. //this.guider2 = new PanTransGuide(this)
  21202. })
  21203. //xzw add: 截图
  21204. function dataURLtoBlob(dataurl) {
  21205. var arr = dataurl.split(','),
  21206. mime = arr[0].match(/:(.*?);/)[1],
  21207. bstr = atob(arr[1]),
  21208. n = bstr.length,
  21209. u8arr = new Uint8Array(n)
  21210. while (n--) {
  21211. u8arr[n] = bstr.charCodeAt(n)
  21212. }
  21213. return new Blob([u8arr], { type: mime })
  21214. }
  21215. n.prototype.screenShot = function (o) {
  21216. if (this.flying || this.flyingToTag) return
  21217. var R = this.sceneRenderer
  21218. R.updateScreenSize(o)
  21219. for (var i in this.model.panos.index) {
  21220. if (!this.model.panos.index[i].marker) continue
  21221. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible
  21222. this.model.panos.index[i].marker.visible = false
  21223. }
  21224. for (var i in this.model.hots) {
  21225. this.model.hots[i].mesh.visible = false
  21226. }
  21227. this.reticule.visible = false
  21228. this.reticule.forceUnvisible = true
  21229. this.path.currentPanoMarker.mesh.visible = false
  21230. setTimeout(
  21231. function () {
  21232. //因resize效用没办法立即生效(原因未知),故而延后
  21233. R.renderer.clear(true, true, true)
  21234. R.renderer.render(R.scene, R.camera)
  21235. var imgData = R.renderer.domElement.toDataURL(o.type, 0.9)
  21236. o.f && o.f(imgData)
  21237. R.updateScreenSize({ resize: true })
  21238. this.reticule.visible = true
  21239. for (var i in this.model.hots) {
  21240. this.model.hots[i].mesh.visible = true
  21241. }
  21242. for (var i in this.model.panos.index) {
  21243. this.model.panos.index[i].marker.visible = this.model.panos.index[i].marker.forceHide
  21244. }
  21245. this.path.currentPanoMarker.mesh.visible = true
  21246. R.renderer.render(R.scene, R.camera)
  21247. }.bind(this),
  21248. 30
  21249. ) //这个数字不能太小
  21250. }
  21251. var scaleImg = e('scaleImg')
  21252. var ResizeImg = function (img, option) {
  21253. var img2 //不能直接改img 否则可能触发第二次img.onload
  21254. var compress = function (ratio, type) {
  21255. var image = img2 || img
  21256. var c = document.createElement('canvas')
  21257. c.width = image.width
  21258. c.height = image.height
  21259. var ctx = c.getContext('2d')
  21260. ctx.drawImage(image, 0, 0, image.width, image.height)
  21261. img2 = scaleImg(ratio /* option.maxSize/oldSize */, c, type /* option.type||"png" */) //最大不能超过0.8M
  21262. }
  21263. var reCom = function () {
  21264. //如果有了img2 就只需要img2 否则创造新的img2
  21265. var image = img2 || img
  21266. var blob = dataURLtoBlob(image.src)
  21267. if (option.maxWeight && blob.size > option.maxWeight) {
  21268. compress(option.maxWeight / blob.size, 'jpeg')
  21269. blob = dataURLtoBlob(image.src)
  21270. }
  21271. if (!img2) {
  21272. img2 = new Image()
  21273. }
  21274. img2.base64Src = image.src
  21275. img2.src = window.URL.createObjectURL(blob)
  21276. }
  21277. var oldSize = Math.max(img.width, img.height)
  21278. if (option.toType != 'png') {
  21279. //不是非要png的话
  21280. if (option.oldType == 'jpeg') {
  21281. //jpeg先判断尺寸,然后是尺寸
  21282. if (oldSize > option.maxSize) {
  21283. compress(option.maxSize / oldSize, 'jpeg')
  21284. }
  21285. reCom()
  21286. } else if (option.oldType == 'png') {
  21287. //png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  21288. if (option.maxWeight && option.weight > option.maxWeight) {
  21289. //如果一开始大小不大就不压缩 还是png
  21290. compress(oldSize > option.maxSize ? option.maxSize / oldSize : 1, 'jpeg')
  21291. reCom()
  21292. }
  21293. }
  21294. } else {
  21295. //?貌似png会越压缩越大?
  21296. }
  21297. return img2 || img
  21298. }
  21299. var _fixType = function (type) {
  21300. type = type.toLowerCase().replace(/jpg/i, 'jpeg')
  21301. var r = type.match(/png|jpeg|bmp|gif/)[0]
  21302. return 'image/' + r
  21303. }
  21304. var saveFile = function (data, filename) {
  21305. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a')
  21306. save_link.href = data
  21307. save_link.download = filename
  21308. var event = document.createEvent('MouseEvents')
  21309. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null)
  21310. save_link.dispatchEvent(event)
  21311. }
  21312. ;(n.prototype.getWrapShot = function () {
  21313. //获取导览点截图/初始画面和信息
  21314. var info = this.getSnapAngleInfo()
  21315. var str = ',{\r\t' + info
  21316. var arg = arguments[0]
  21317. this.screenShot({
  21318. width: g_snapShotWidth * 4,
  21319. height: g_snapShotHeight * 4,
  21320. type: 'image/jpeg',
  21321. f: function (imgData) {
  21322. if (arg && arg.__callback) {
  21323. return arg.__callback(imgData, info)
  21324. }
  21325. var img = new Image()
  21326. img.src = imgData
  21327. img.onload = function () {
  21328. var img2 = ResizeImg(this, { maxSize: g_snapShotWidth, oldType: 'jpeg' }) //暂定缩略图大小
  21329. img2.src.replace(_fixType('image/jpeg'), 'image/octet-stream')
  21330. var filename = 'snap' + new Date().getTime()
  21331. saveFile(img2.src, filename + '.jpg')
  21332. str += ',\r\t"thumbnail_signed_src":"' + filename + '.jpg",'
  21333. str += '\r\t"sid":"' + filename + '",'
  21334. str += '\r\t"name":"' + filename + '"\r}'
  21335. logData(str)
  21336. }
  21337. }
  21338. })
  21339. }),
  21340. (n.prototype.getSnapAngleInfo = function () {
  21341. var info = {}
  21342. var str = '"metadata":{'
  21343. var q = this.camera.quaternion.clone()
  21344. switch (this.mode) {
  21345. case 'panorama':
  21346. info.scan_id = this.currentPano.id
  21347. str += '"scan_id":"' + this.currentPano.id + '",'
  21348. break
  21349. case 'floorplan':
  21350. info.camera_mode = 1
  21351. q = new r.Quaternion().setFromAxisAngle(new r.Vector3(0, 1, 0), r.Math.degToRad(90))
  21352. q.multiply(this.camera.quaternion)
  21353. str += '"camera_mode":1,'
  21354. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  21355. str += '"ortho_zoom":' + m.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ','
  21356. break
  21357. case 'dollhouse':
  21358. info.camera_mode = 2
  21359. str += '"camera_mode":2,'
  21360. break
  21361. }
  21362. info.camera_position = m.toPrecision(this.camera.position.toArray(), 4)
  21363. console.log(info.camera_position)
  21364. if (window.screenSta === 'tour') {
  21365. // fyz 导览截屏需要做额外的
  21366. /**fyz 对相机截屏的角度进行校对 */
  21367. var out = new r.Quaternion(q.x, q.y, q.z, q.w)
  21368. out.multiply(new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  21369. out.x *= -1
  21370. out.w *= -1
  21371. info.camera_quaternion = m.toPrecision(out.toArray(), 4)
  21372. } else {
  21373. info.camera_quaternion = m.toPrecision(q.toArray(), 4)
  21374. }
  21375. info.zoom = this.zoomLevel
  21376. console.log(info.camera_quaternion)
  21377. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  21378. // fyz 扩展编辑页面, 加上导览点缩放值
  21379. str += '"camera_position":[' + info.camera_position + '],"camera_quaternion":[' + info.camera_quaternion + '], "zoom":' + info.zoom + '}'
  21380. return str
  21381. })
  21382. //------end
  21383. ;(n.prototype.setupCustomProperties = function (e) {
  21384. var t = e || u.PANORAMA
  21385. Object.defineProperty(this, 'mode', {
  21386. get: function () {
  21387. return t
  21388. },
  21389. set: function (e) {
  21390. var i = t
  21391. ;(t = e), this.onModeUpdated(i, t)
  21392. }
  21393. })
  21394. }),
  21395. (n.prototype.isInMode = function () {
  21396. for (var e = 0; e < arguments.length; e++) if (this.mode === arguments[e]) return !0
  21397. return !1
  21398. }),
  21399. (n.prototype.isOutsideMode = function (e) {
  21400. return (e = e || this.mode), e === u.DOLLHOUSE || e === u.FLOORPLAN
  21401. }),
  21402. (n.prototype.is360View = function (e, t) {
  21403. return e === u.PANORAMA && t && !t.isAligned()
  21404. }),
  21405. (n.prototype.setScene = function (e) {
  21406. ;(this.sceneIntersectionPlane = e.plane), this.path.setScene(e), this.moveReticuleToScene(e)
  21407. }),
  21408. (n.prototype.moveReticuleToScene = function (e) {
  21409. this.reticule.parent && this.reticule.parent.remove(this.reticule), e.add(this.reticule)
  21410. }),
  21411. (n.prototype.updateModel = function () {
  21412. function e(e, t, n) {
  21413. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  21414. }
  21415. function t(e, t) {
  21416. if (this.mode === u.DOLLHOUSE) {
  21417. var n = e ? this.model.center.y : (n = t.center.y)
  21418. i.call(this, n)
  21419. }
  21420. }
  21421. function i(e) {
  21422. var t = this.cameraControls.cameras[u.DOLLHOUSE],
  21423. i = this.cameraControls.controls[u.DOLLHOUSE],
  21424. n = t.position.y + (e - i.target.y),
  21425. r = f.showFloorDuration + f.showFloorDelay
  21426. y.start(v.property(i.target, 'y', e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  21427. y.start(v.property(t.position, 'y', n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  21428. }
  21429. ;(this.model = this.modelManager.getActiveModel()),
  21430. this.model.on('floor.changed', e.bind(this)),
  21431. this.model.on('allfloors.toggled', t.bind(this)),
  21432. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model))
  21433. /*******************************************************************VR fyz改 from徐世廷*******************************************************************/
  21434. var e2 = this
  21435. this.model.panos.list.forEach(function (a) {
  21436. a.vrMarker.addEventListener('click', function () {
  21437. e2.flyToPano({
  21438. pano: a
  21439. })
  21440. })
  21441. })
  21442. /********************************************************************************************************************************************/
  21443. this.model.addHighMapCube() //add
  21444. this.on(w.FlyingStarted, this.model.resetHighMap.bind(this.model))
  21445. }),
  21446. (n.prototype.updateModelDependentData = function () {
  21447. this.cameraControls.setModelForControls(this.model), this.getPanoMarkersFromModel(this.model)
  21448. }),
  21449. (n.prototype.onModelChanged = function () {
  21450. this.updateModel(), this.updateModelDependentData()
  21451. }),
  21452. (n.prototype.getPanoMarkersFromModel = function (e) {
  21453. this.panoMarkers = e.panos.list.reduce(function (e, t) {
  21454. return t.marker ? e.concat(t.marker) : e
  21455. }, [])
  21456. }),
  21457. (n.prototype.handleControlMove = function (e) {
  21458. this.emit(w.Move, e)
  21459. }),
  21460. (n.prototype.handleControlInputStart = function (e) {
  21461. this.emit(w.InputStart, e)
  21462. }),
  21463. (n.prototype.onModeUpdated = function (e, t) {
  21464. this.cameraControls.activateControls(t), this.emit(w.ModeChanged, e, t)
  21465. }),
  21466. (n.prototype.isWarping = function () {
  21467. //是否导览缓慢走向某个点
  21468. return this.path.warping
  21469. }),
  21470. (n.prototype.isWaitingToWarp = function () {
  21471. return this.path.waitingToWarp
  21472. }),
  21473. (n.prototype.getLabelScaleFactor = function () {
  21474. if (this.isOutsideMode()) {
  21475. var e = 10,
  21476. t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e)
  21477. return t
  21478. }
  21479. return 0.5
  21480. }),
  21481. /* n.prototype.changeMusic = function() {//xzw add
  21482. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  21483. } */
  21484. (n.prototype.bindEvents = function (e) {
  21485. e !== document && e.setAttribute('tabindex', -1),
  21486. e.addEventListener('mousedown', this.onMouseDown.bind(this)),
  21487. e.addEventListener('mousemove', this.onMouseMove.bind(this)),
  21488. e.addEventListener('mouseover', this.onMouseOver.bind(this)),
  21489. e.addEventListener('mouseout', this.onMouseOut.bind(this)),
  21490. e.addEventListener('mouseup', this.onMouseUp.bind(this)),
  21491. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  21492. e.addEventListener('touchstart', this.onTouchStart.bind(this)),
  21493. e.addEventListener('touchmove', this.onTouchMove.bind(this)),
  21494. e.addEventListener('touchend', this.onTouchEnd.bind(this)),
  21495. e.addEventListener('pointerdown', this.onPointerDown.bind(this)),
  21496. e.addEventListener('pointermove', this.onPointerMove.bind(this)),
  21497. e.addEventListener('pointerup', this.onPointerUp.bind(this)),
  21498. e.addEventListener('pointerout', this.onPointerOut.bind(this)),
  21499. e.addEventListener('pointercancel', this.onPointerCancel.bind(this)),
  21500. document.addEventListener('keydown', this.onKeyDown.bind(this)),
  21501. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  21502. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  21503. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  21504. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  21505. window.addEventListener('snapshotBegin', this.getWrapShot.bind(this)), //xzw add
  21506. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  21507. // lzb
  21508. window.getSeft && getSeft(this)
  21509. }),
  21510. (n.prototype.onMouseDown = function (e) {
  21511. e.currentTarget !== document && e.currentTarget.focus(), 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1), this.updateIntersect())
  21512. }),
  21513. (n.prototype.onMouseMove = function (e) {
  21514. ;(this.isTouchEvent = !1), this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  21515. }),
  21516. (n.prototype.onMouseOver = function (e) {
  21517. ;(this.containsMouse = !0), !this.mouseDown || (0 !== e.which && 0 !== e.buttons) || (this.mouseDown = !1)
  21518. if (this.intersectHot) {
  21519. this.intersectHot.setHoverState(true)
  21520. }
  21521. }),
  21522. (n.prototype.onMouseOut = function (e) {
  21523. this.containsMouse = !1
  21524. if (this.intersectHot) {
  21525. this.intersectHot.setHoverState(false)
  21526. }
  21527. }),
  21528. (n.prototype.onMouseUp = function (e) {
  21529. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  21530. }),
  21531. (n.prototype.onTouchStart = function (e) {
  21532. if ((e.currentTarget !== document && e.currentTarget.focus(), !this.mouseDown)) {
  21533. this.couldBeLongTap = !0
  21534. var t = g.average(e.changedTouches, 'clientX'),
  21535. i = g.average(e.changedTouches, 'clientY')
  21536. this.handleInputStart.call(this, t, i, !0),
  21537. (this.mouseDownTimer = setTimeout(
  21538. function () {
  21539. this.updateIntersect(), this.handleInputEnd.call(this, t, i, !0)
  21540. }.bind(this),
  21541. f.input.longTapThreshold
  21542. ))
  21543. }
  21544. }),
  21545. (n.prototype.onTouchMove = function (e) {
  21546. var t = g.average(e.changedTouches, 'clientX'),
  21547. i = g.average(e.changedTouches, 'clientY')
  21548. this.handleInputMove.call(this, t, i, !0)
  21549. }),
  21550. (n.prototype.onTouchEnd = function (e) {
  21551. if ((clearTimeout(this.mouseDownTimer), this.mouseDown)) {
  21552. ;(this.couldBeLongTap = !1), this.updateIntersect()
  21553. var t = g.average(e.changedTouches, 'clientX'),
  21554. i = g.average(e.changedTouches, 'clientY')
  21555. this.handleInputEnd.call(this, t, i, !0)
  21556. }
  21557. //add
  21558. if (this.intersectHot) this.intersectHot.setHoverState(false)
  21559. this.intersectHot = null
  21560. Hot.mobileAutoPlay(this)
  21561. }),
  21562. (n.prototype.onPointerDown = function (e) {
  21563. return (
  21564. e.currentTarget !== document && e.currentTarget.focus(),
  21565. this.mouseDown || 'mouse' === e.pointerType
  21566. ? this.onMouseDown(e)
  21567. : ((this.couldBeLongTap = !0),
  21568. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  21569. void (this.mouseDownTimer = setTimeout(
  21570. function () {
  21571. this.updateIntersect(), this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  21572. }.bind(this),
  21573. f.input.longTapThreshold
  21574. )))
  21575. )
  21576. }),
  21577. (n.prototype.onPointerMove = function (e) {
  21578. 'mouse' !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  21579. }),
  21580. (n.prototype.onPointerUp = function (e) {
  21581. return this.mouseDown && 'mouse' !== e.pointerType
  21582. ? (clearTimeout(this.mouseDownTimer), (this.couldBeLongTap = !1), this.updateIntersect(), void this.handleInputEnd.call(this, e.clientX, e.clientY, !0))
  21583. : this.onMouseUp(e)
  21584. }),
  21585. (n.prototype.onPointerOut = function (e) {
  21586. this.mouseDown = !1
  21587. }),
  21588. (n.prototype.onPointerCancel = function (e) {
  21589. this.mouseDown = !1
  21590. }),
  21591. (n.prototype.onKeyDown = function (e) {
  21592. var t = function () {
  21593. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, 'key')
  21594. }.bind(this),
  21595. i = e.which
  21596. switch (i) {
  21597. case p.F:
  21598. t(), this.changeFloor(-1)
  21599. break
  21600. case p.R:
  21601. t(), this.changeFloor(1)
  21602. }
  21603. if (this.mode === u.PANORAMA)
  21604. switch (i) {
  21605. case p.UPARROW:
  21606. case p.W:
  21607. this.flyLocalDirection(d.FORWARD.clone())
  21608. break
  21609. case p.DOWNARROW:
  21610. case p.S:
  21611. this.flyLocalDirection(d.BACK.clone())
  21612. break
  21613. case p.A:
  21614. this.flyLocalDirection(d.LEFT.clone())
  21615. break
  21616. case p.D:
  21617. this.flyLocalDirection(d.RIGHT.clone())
  21618. }
  21619. }),
  21620. (n.prototype.handleScrollPinchZoom = (function () {
  21621. return function (e) {
  21622. var t = e,
  21623. i = this.zoomLevel
  21624. this.zoomBy(t), this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  21625. }
  21626. })()),
  21627. (n.prototype.handleControlPinch = function (e) {
  21628. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0, 0, e).normalize())
  21629. }),
  21630. (n.prototype.handleControlScroll = function (e) {
  21631. f.zoom.enabled
  21632. ? (e > 0 ? (e = 1 + this.scrollZoomSpeed) : e < 0 && (e = 1 - this.scrollZoomSpeed), 0 !== e && this.handleScrollPinchZoom(e))
  21633. : this.flyLocalDirection(new r.Vector3(0, 0, -e).normalize())
  21634. }),
  21635. (n.prototype.handleInputStart = function (e, t, i) {
  21636. //许钟文加
  21637. var pad = this.handelPadding(e, t)
  21638. e = pad.x
  21639. t = pad.y
  21640. ;(this.isTouchEvent = i),
  21641. m.convertScreenPositionToNDC(e, t, this.mouse),
  21642. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  21643. (this.mouseCouldBeClickToMove = !0),
  21644. (this.mouseDown = !0)
  21645. Hot.mobileAutoPlay(this)
  21646. }),
  21647. (n.prototype.handelPadding = function (x, y) {
  21648. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  21649. if (!this.pad)
  21650. this.pad = {
  21651. //可以直接用$("#player")[0].getBoundingClientRect() , 因为body没有offset
  21652. x: dom.getOffset('left', $('#player')[0]),
  21653. y: dom.getOffset('top', $('#player')[0])
  21654. }
  21655. return {
  21656. x: x - this.pad.x,
  21657. y: y - this.pad.y
  21658. }
  21659. })
  21660. ;(n.prototype.handleInputMove = function (e, t, i) {
  21661. //许钟文加
  21662. var pad = this.handelPadding(e, t)
  21663. e = pad.x
  21664. t = pad.y
  21665. ;(this.isTouchEvent = i),
  21666. m.convertScreenPositionToNDC(e, t, this.mouse),
  21667. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && ((this.mouseCouldBeClickToMove = !1), (this.couldBeLongTap = !1), clearTimeout(this.mouseDownTimer)),
  21668. (this.mouseLastMoveTime = Date.now()),
  21669. this.reticule.move(e, t, i)
  21670. }),
  21671. (n.prototype.handleInputEnd = function (e, t, i) {
  21672. //xzw
  21673. if (((this.isTouchEvent = i), (this.mouseDown = !1), this.cameraControls.controls[u.PANORAMA].emit('interaction.direct'), !i && this.couldBeLongTap)) return !0
  21674. if (this.handleLongTap()) return !0
  21675. /* if(this.director.tourIsPlaying){
  21676. return !0;
  21677. } */
  21678. if (this.mouseCouldBeClickToMove) {
  21679. if (this.flying)
  21680. return (
  21681. this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType), //停止导览
  21682. !0
  21683. )
  21684. //add----
  21685. if (this.checkHotClick())
  21686. //add
  21687. return !0
  21688. if (this.hoveringPlane) {
  21689. this.clickOverlay(this.hoveringPlane)
  21690. return
  21691. }
  21692. if ((this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? 'touch' : 'mouse'), this.history.invalidate(), this.intersect))
  21693. return this.flyToPanoClosestToMouse()
  21694. if (this.mode === u.PANORAMA) {
  21695. var n = this.closestPanoInDirection(this.getMouseDirection())
  21696. return n
  21697. ? this.flyToPano({
  21698. pano: n
  21699. })
  21700. : this.bump(this.getMouseDirection())
  21701. }
  21702. }
  21703. //this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode) //xzw 删,否则拖拽后就不高亮了
  21704. }),
  21705. (n.prototype.handleLongTap = function () {
  21706. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA)) return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, 'touch'), !0
  21707. }),
  21708. (n.prototype.checktagClick = function () {
  21709. if (this.tagManager.intersectTag) {
  21710. var e = this.isTouchEvent,
  21711. t = this.tagManager.clickedOnTag(e, this)
  21712. return e || t || y.cancelById(V.LookTransition), !0
  21713. }
  21714. if (this.tagManager.activeTag) return this.tagManager.dismissActiveTag(), !1
  21715. }),
  21716. (n.prototype.rankedtagInDirection = function (e, t) {
  21717. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  21718. }),
  21719. (n.prototype.start = function (e) {
  21720. //-------------------
  21721. //-------------------
  21722. var t = e.mode,
  21723. i = e.pano,
  21724. n = e.position,
  21725. rr = e.quaternion,
  21726. o = e.tag,
  21727. a = e.quickstart,
  21728. s = $.Deferred()
  21729. this.updateModelDependentData(), this.updateFromControls(), this.findDefaultViews()
  21730. var l = this.is360View(t, i)
  21731. return (
  21732. !this.model.outsideAllowed() || l || a ? this.startInside(i, n, rr, o, s) : this.startOutside(e, s),
  21733. s.done(
  21734. function (e) {
  21735. this.emit(w.Ready, l, e, o)
  21736. }.bind(this)
  21737. ),
  21738. s.promise()
  21739. )
  21740. }),
  21741. (n.prototype.startOutside = function (e, t) {
  21742. var i = e.mode,
  21743. n = e.pano,
  21744. r = e.position,
  21745. o = e.quaternion,
  21746. a = e.zoom,
  21747. s = e.floorVisibility,
  21748. l = e.tag
  21749. this.emit(w.StartOutside, f[i].transitionTime),
  21750. this.isOutsideMode(i)
  21751. ? (this.model.warpDestFloors(s, !0), y.cancelById(V.FlyToViewFloor), i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o), t.resolve(!1))
  21752. : this.startInsideWithFlyin(n, r, o, l, t)
  21753. }),
  21754. (n.prototype.startInside = function (e, t, i, n, r) {
  21755. ;(r = r || $.Deferred()), (this.currentPano = e)
  21756. window.bus.dispatchEvent({ type: 'playerAndModelReady' })
  21757. this.ready = true
  21758. var o = e && !e.isAligned()
  21759. if (((t = o ? e.position : t || e.position), (i = i || e.quaternion), e)) {
  21760. var a = this.startInside.bind(this, e, t, i, n, r)
  21761. if (this.checkAndWaitForPanoLoad(e, 'high', 'low', this.basePanoSize, a)) return
  21762. }
  21763. //add
  21764. this.transitionPos({ type: 'beforeFlytopano', pano: this.currentPano, dur: 0 })
  21765. //this.updateHotVisible()
  21766. Hot.updateVisibles([this.currentPano])
  21767. this.modeTran = 'panorama-panorama'
  21768. return (
  21769. (this.mode = u.PANORAMA),
  21770. e.floor.enter(this.mode),
  21771. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  21772. this.switchCameraMode(this.mode, i),
  21773. this.emit(w.StartInside, o),
  21774. r.resolve(!0),
  21775. r
  21776. )
  21777. }),
  21778. (n.prototype.startInsideWithFlyin = function (e, t, i, n, r) {
  21779. if (((r = r || $.Deferred()), this.dollhouseMode(), !e)) return F.warn('Player.startInsideWithFlyin() -> targetPano is invalid.'), r.resolve(!1), r
  21780. t = t || e.position
  21781. var o = i || this.cameraControls.activeControl.camera.quaternion,
  21782. a = e.position
  21783. return (
  21784. this.fitDollhouse(a, t, o),
  21785. setTimeout(
  21786. function (t) {
  21787. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t)
  21788. var n = {
  21789. mode: u.PANORAMA,
  21790. pano: e,
  21791. quaternion: i,
  21792. callback: function () {
  21793. this.emit(w.FlyinFinished), r.resolve(!0)
  21794. }.bind(this)
  21795. }
  21796. this.flyToNewMode(n)
  21797. }.bind(this, this.cameraControls.activeControl.maxDistance),
  21798. f.startupFlyinDelay
  21799. ),
  21800. r
  21801. )
  21802. }),
  21803. (n.prototype.checkAndWaitForPanoLoad = (function () {
  21804. var e = {},
  21805. t = {},
  21806. i = 5e3,
  21807. n = function () {
  21808. for (var n in e)
  21809. if (e.hasOwnProperty(n) && e[n]) {
  21810. var r = performance.now() - t[n]
  21811. if (r < i) return !0
  21812. }
  21813. return !1
  21814. }
  21815. return function (r, o, a, s, l, c, h, u, d, p) {
  21816. if (n()) return !0
  21817. var f = function (t, i, n) {
  21818. N.delayOneFrame(
  21819. function () {
  21820. ;(e[t] = !1), l && l(i, n)
  21821. }.bind(this)
  21822. )
  21823. }.bind(this, r.id),
  21824. g = function (t, i) {
  21825. N.delayOneFrame(
  21826. function () {
  21827. ;(e[t] = !1), c && c(i)
  21828. }.bind(this)
  21829. )
  21830. }.bind(this, r.id)
  21831. try {
  21832. return (
  21833. (null !== u && void 0 !== u) || (u = !0),
  21834. this.model.supportsTiles ? (e[r.id] = this.checkAndWaitForTiledPanoLoad(r, s, f, g, h, u, d, p)) : (e[r.id] = this.checkAndWaitForWholePanoLoad(r, o, a, f, u)),
  21835. e[r.id] && (t[r.id] = performance.now()),
  21836. e[r.id]
  21837. )
  21838. } catch (n) {
  21839. throw ((e[r.id] = !1), (t[r.id] = performance.now() - i), n)
  21840. }
  21841. }
  21842. })()),
  21843. (n.prototype.checkAndWaitForWholePanoLoad = function (e, t, i, n, r) {
  21844. if (!e) throw new M('Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.')
  21845. return (
  21846. r &&
  21847. this.model.waitForLoad(e, function () {
  21848. return e.isLoaded(i)
  21849. }),
  21850. !e.isLoaded(t) && (e.loadCube(t).done(n), !0)
  21851. )
  21852. }),
  21853. (n.prototype.checkAndWaitForTiledPanoLoad = (function () {
  21854. var e = new r.Vector3()
  21855. return function (t, i, n, r, o, a, s, l) {
  21856. if (!t) throw new M('Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.')
  21857. return (
  21858. e.copy(d.FORWARD),
  21859. this.getDirection(e),
  21860. !t.isLoaded(i) &&
  21861. (a &&
  21862. this.model.waitForLoad(t, function () {
  21863. return t.isLoaded(i)
  21864. }),
  21865. t
  21866. .loadTiledPano(i, e, null, s, l)
  21867. .done(
  21868. function (e, t) {
  21869. n && n(e, t)
  21870. }.bind(this)
  21871. )
  21872. .fail(
  21873. function (e) {
  21874. r && r(e)
  21875. }.bind(this)
  21876. )
  21877. .progress(
  21878. function (e, t, i) {
  21879. o && o(e, t, i)
  21880. }.bind(this)
  21881. ),
  21882. !0)
  21883. )
  21884. }
  21885. })()),
  21886. (n.prototype.switchCameraMode = function (e, t) {
  21887. var i = this.cameraControls.controls[e],
  21888. n = i.camera
  21889. switch (e) {
  21890. case u.PANORAMA:
  21891. n.position.copy(this.currentPano.position)
  21892. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize()
  21893. i.lookAt(o.add(n.position))
  21894. break
  21895. case u.DOLLHOUSE:
  21896. /* var a = this.position.clone();
  21897. 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),
  21898. n.position.copy(a),
  21899. i.target.copy(this.target.clone().setY(this.model.center.y));
  21900. break; */
  21901. //for多楼层 且 让模型刚好适应屏幕
  21902. var box = this.model.boundingBox.clone()
  21903. box.applyMatrix4(this.camera.matrixWorld) //将 boundingbox、也就是模型, 转换到当前相机朝向
  21904. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  21905. var fov = B.getHFOVFromVFOV(f.insideFOV, n.aspect, 1) //获得在当前窗口的横向的fov
  21906. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2)) //根据上面获得的参数得到target到相机的距离
  21907. //console.log(boxSize.x,distance, boxSize.length() / 2)
  21908. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  21909. if (this.mode === u.PANORAMA) {
  21910. i.target.copy(this.model.center)
  21911. var vec = this.getDirection().negate().setY(1).normalize() //获得朝向
  21912. } else {
  21913. i.target.copy(this.target.clone().setY(this.model.center.y))
  21914. var vec = d.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  21915. }
  21916. vec.multiplyScalar(distance)
  21917. n.position.copy(i.target.clone().add(vec))
  21918. break
  21919. case u.FLOORPLAN:
  21920. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  21921. i.target.copy(this.model.center).setY(0),
  21922. i.zoomToContain(this.model.size),
  21923. i.rotateToView(this.model.size, this.getDirection())
  21924. }
  21925. i.update(0)
  21926. }),
  21927. (n.prototype.update = (function () {
  21928. var e = (new r.Vector3(), {}),
  21929. t = []
  21930. return function (i) {
  21931. this.updatePersistentZooming(i), this.updateFromControls(i), this.getCurrentNodePanos(t)
  21932. this.lastFrameChanged = false
  21933. if (this.hasChanged(e)) {
  21934. this.lastFrameChanged = e.cameraChanged3 ? 'level3' : e.cameraChanged2 ? 'level2' : e.cameraChanged ? 'level1' : false
  21935. ;(this.lastChangeTime = Date.now()),
  21936. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  21937. this.emit(w.ViewChanged, e),
  21938. // 注意: player.cameraControls.activeControl.camera 的 matrix是错的
  21939. this.intersect && this.magnifier && this.magnifier.update(this.intersect.point)
  21940. }
  21941. if (e.cameraChanged2) {
  21942. //变化要更大些
  21943. }
  21944. if (e.cameraChanged) {
  21945. this.mode == 'panorama' && window.cad && cad.setSign({ x: this.position.x, y: this.position.z }, this.cameraControls.controls.panorama.lon)
  21946. /* for(var i in this.model.hots){
  21947. this.model.hots[i].updateTitle(this)
  21948. } */
  21949. Hot.updateHots()
  21950. }
  21951. this.model.supportsTiles && (this.updateTileDownloader(t), this.updatePanoRenderer(t)),
  21952. this.updatePreRendering(t),
  21953. this.reticule.update(),
  21954. this.path.update(),
  21955. this.spider.update(),
  21956. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  21957. this.updateControlLocks(),
  21958. this.model.supportsTiles && this.updateZoomPano()
  21959. }
  21960. })()),
  21961. /* n.prototype.controlVideosPlay = function() {//判断box视频是否可见 不可见就暂停
  21962. var lastMode, lastPano;
  21963. return function(){
  21964. var mode = this.mode;
  21965. var pano = mode == "panorama" ? this.currentPano : "";
  21966. if(mode != "panorama" || pano != lastPano){
  21967. overlay.noBlock = null
  21968. }
  21969. this.overlayGroup.children.forEach((overlay)=>{
  21970. if(overlay.overlayType == "video" ){
  21971. var matrix = overlay.plane.matrixWorld;
  21972. var inSight = false;
  21973. var cameraDir = this.getDirection();
  21974. var planeDir = (new r.Vector3).copy(d.FORWARD).applyQuaternion(overlay.plane.quaternion)
  21975. var vertexes = []
  21976. if(cameraDir.angleTo(planeDir)>Math.PI/2){//朝向相机视线
  21977. for(let i=0; i<4; i++){
  21978. var vertex = overlay.plane.geometry.vertices[i].clone().applyMatrix4(matrix)
  21979. vertexes.push(vertex)
  21980. if(overlay.noBlock == null){
  21981. if(!m.ifShelter(vertex)){
  21982. overlay.noBlock = true
  21983. }
  21984. inSight = true; break;
  21985. }else{
  21986. overlay.noBlock = true
  21987. }
  21988. if(m.getPos2d(vertex, this.camera, $("#player")[0]).inSight){
  21989. inSight = true; break;
  21990. }
  21991. }
  21992. }
  21993. overlay.inSight = inSight
  21994. if(!inSight)overlay.plane.material.map.image.pause()
  21995. else overlay.plane.material.map.image.play()//maybe fail
  21996. }
  21997. })
  21998. lastMode = mode, lastPano = pano
  21999. }
  22000. }() */
  22001. (n.prototype.updatePersistentZooming = function (e) {
  22002. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  22003. }),
  22004. (n.prototype.updateControlLocks = function () {
  22005. this.currentPano &&
  22006. this.model.supportsTiles &&
  22007. (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  22008. }),
  22009. (n.prototype.updatePanoRenderer = (function () {
  22010. var e = new r.Vector3()
  22011. return function (t) {
  22012. var i = this.nextPano || this.currentPano
  22013. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD), this.getDirection(e), this.panoRenderer.updateDirection(e))
  22014. }
  22015. })()),
  22016. (n.prototype.cleanupInactivePanos = (function () {
  22017. var e = [],
  22018. t = []
  22019. return function () {
  22020. ;(e.length = 0), e.push(this.currentPano), this.nextPano && e.push(this.nextPano), (t.length = 0)
  22021. for (var i = 0; i < this.panoRenderer.activePanos.length; i++) t.push(this.panoRenderer.activePanos[i])
  22022. for (var n = 0; n < t.length; n++) {
  22023. for (var r = t[n], o = !0, a = 0; a < e.length; a++) r.id === e[a].id && (o = !1)
  22024. o && r.exit()
  22025. }
  22026. }
  22027. })()),
  22028. (n.prototype.updatePreRendering = (function () {
  22029. var e = {}
  22030. return function (t) {
  22031. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  22032. var i = this.nextPano || this.currentPano
  22033. if (i && t && t.length > 1) {
  22034. var n = t.findIndex(function (e) {
  22035. if (e.id === i.id) return !0
  22036. })
  22037. if (n >= 0 && n + 1 < t.length) {
  22038. var r = t[n + 1]
  22039. r.isLoaded(this.basePanoSize) ||
  22040. e[r.id] ||
  22041. (window.setTimeout(
  22042. function (t) {
  22043. this.checkAndWaitForPanoLoad(t, 'high', 'low', this.basePanoSize, null, null, null, !1, !1, !1),
  22044. window.setTimeout(
  22045. function (t) {
  22046. e[t.id] = !1
  22047. }.bind(this, t),
  22048. f.tiling.panoPreRenderRepeatDelay
  22049. )
  22050. }.bind(this, r),
  22051. f.tiling.panoPreRenderDelay
  22052. ),
  22053. (e[r.id] = !0))
  22054. }
  22055. }
  22056. }
  22057. }
  22058. })()),
  22059. (n.prototype.enablePreRendering = function () {
  22060. this.preRenderingEnabled = !0
  22061. }),
  22062. (n.prototype.disablePreRendering = function () {
  22063. ;(this.preRenderingEnabled = !1), this.cleanupInactivePanos()
  22064. }),
  22065. (n.prototype.updateTileDownloader = (function () {
  22066. var e = new r.Vector3()
  22067. return function (t) {
  22068. var i = this.nextPano || this.currentPano
  22069. i &&
  22070. (e.copy(d.FORWARD),
  22071. this.getDirection(e),
  22072. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  22073. (this.tileDownloader.processPriorityQueue = !0))
  22074. }
  22075. })()),
  22076. (n.prototype.updateFromControls = function (e) {
  22077. ;(null !== e && void 0 !== e) || (e = 0),
  22078. this.cameraControls.activeControl &&
  22079. (this.cameraControls.activeControl.update(e),
  22080. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  22081. this.position.copy(this.cameraControls.activeControl.camera.position),
  22082. this.target.copy(this.cameraControls.activeControl.target),
  22083. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  22084. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  22085. this.camera.position.copy(this.position),
  22086. this.camera.quaternion.copy(this.quaternion),
  22087. this.camera.updateMatrix(),
  22088. this.camera.updateMatrixWorld()
  22089. }),
  22090. (n.prototype.hasChanged = function (e) {
  22091. if (!this.previousState) {
  22092. this.previousState = {
  22093. allFloorsVisible: this.model.allFloorsVisible,
  22094. position: this.position.clone(),
  22095. quaternion: this.quaternion.clone(),
  22096. mouse: this.mouse.clone(),
  22097. //labelScaleFactor: this.getLabelScaleFactor(),
  22098. currentFloor: this.model.currentFloor,
  22099. projectionMatrix: this.camera.projectionMatrix.clone(),
  22100. worldMatrix: this.camera.matrixWorld.clone(),
  22101. mode: this.mode,
  22102. modelPosition: this.model.position.clone(),
  22103. modelCenter: this.model.center.clone(),
  22104. zoomLevel: this.zoomLevel
  22105. }
  22106. e.cameraChanged = e.cameraChanged2 = true
  22107. return !0
  22108. }
  22109. //许钟文改 分成相机是否改变cameraChanged 和其他
  22110. var a =
  22111. this.position.equals(this.previousState.position) &&
  22112. this.quaternion.equals(this.previousState.quaternion) &&
  22113. this.camera.matrixWorld.equals(this.previousState.worldMatrix) &&
  22114. this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) &&
  22115. this.mode === this.previousState.mode &&
  22116. this.zoomLevel === this.previousState.zoomLevel &&
  22117. this.model.center.equals(this.previousState.modelCenter) &&
  22118. this.model.position.equals(this.previousState.modelPosition)
  22119. var t =
  22120. a &&
  22121. this.mouse.equals(this.previousState.mouse) &&
  22122. this.model.allFloorsVisible === this.previousState.allFloorsVisible /* && this.getLabelScaleFactor() === this.previousState.labelScaleFactor */ &&
  22123. this.model.currentFloor === this.previousState.currentFloor &&
  22124. null === this.nextPano
  22125. e.cameraChanged = !a
  22126. ;(e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible),
  22127. (e.moved = !this.position.equals(this.previousState.position)),
  22128. (e.rotated = !this.quaternion.equals(this.previousState.quaternion)),
  22129. (e.mouseMoved = !this.mouse.equals(this.previousState.mouse)),
  22130. // e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  22131. (e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor),
  22132. (e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix)),
  22133. (e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix)),
  22134. (e.modeChanged = this.mode !== this.previousState.mode),
  22135. (e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition)),
  22136. (e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter)),
  22137. (e.nextPanoActive = null !== this.nextPano),
  22138. (e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel)
  22139. /* if(e.cameraChanged){//
  22140. 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)
  22141. }else e.cameraChanged2 = false */
  22142. if (e.cameraChanged) {
  22143. e.cameraChanged2 =
  22144. e.cameraProjectionChanged || !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 5) || !MathLight.closeTo(this.position, this.previousState.position, 4)
  22145. e.cameraChanged3 =
  22146. e.cameraProjectionChanged || !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 3)
  22147. } else {
  22148. e.cameraChanged2 = false
  22149. e.cameraChanged3 = false
  22150. }
  22151. ;(this.previousState.allFloorsVisible = this.model.allFloorsVisible),
  22152. this.previousState.position.copy(this.position),
  22153. this.previousState.quaternion.copy(this.quaternion),
  22154. this.previousState.mouse.copy(this.mouse),
  22155. //this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  22156. (this.previousState.currentFloor = this.model.currentFloor),
  22157. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  22158. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  22159. (this.previousState.mode = this.mode),
  22160. this.previousState.modelPosition.copy(this.model.position),
  22161. this.previousState.modelCenter.copy(this.model.center),
  22162. (this.previousState.zoomLevel = this.zoomLevel)
  22163. //console.log("cameraChanged2 "+ e.cameraChanged2 + ", mouseMoved "+e.mouseMoved)
  22164. return !t
  22165. }),
  22166. (n.prototype.updateIntersect = function () {
  22167. var e = this.flying || this.isWarping(),
  22168. t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged(),
  22169. i = y.getById(V.LookTransition),
  22170. n = !(e || t || this.isTouchEvent || (i.length && i[0].running))
  22171. {
  22172. //clear:
  22173. if (this.intersectHot) this.intersectHot.setHoverState(false)
  22174. this.intersectHot = null
  22175. CursorDeal.remove('hoverHot')
  22176. }
  22177. var deal = () => {
  22178. if (this.intersect && this.intersect.object.visible) {
  22179. if ('hotSprite' == this.intersect.object.type) {
  22180. this.intersectHot = this.intersect.object
  22181. while (!(this.intersectHot instanceof Hot)) {
  22182. this.intersectHot = this.intersectHot.parent
  22183. }
  22184. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass('active')
  22185. this.intersectHot.setHoverState(true)
  22186. }
  22187. }
  22188. }
  22189. if (this.model.hotGroup) {
  22190. var hots = this.model.hotGroup.children.filter(e => e.info.actionType.examine || e.info.actionType.fastTran || e.info.actionType.openHot || e.info.actionType.playAndPause)
  22191. let colliders = this.model.floors.reduce(
  22192. function (e, t) {
  22193. return t.hidden ? e : e.concat(t.collider.children)
  22194. },
  22195. this.mode === 'panorama' ? this.panoMarkers : []
  22196. )
  22197. this.intersect = this.getMouseIntersect(null, hots.concat(colliders /* this.model.colliders */))
  22198. if (this.intersect) {
  22199. deal()
  22200. let intersect = this.intersect
  22201. if (this.intersectHot) {
  22202. this.intersect = null
  22203. CursorDeal.add('hoverHot')
  22204. } else {
  22205. if (intersect.object.parent.parent.hidden) {
  22206. //楼层已隐藏
  22207. this.intersect = null
  22208. }
  22209. }
  22210. }
  22211. } else {
  22212. this.intersect = this.getMouseIntersect()
  22213. }
  22214. this.intersect && this.updateClosestPano(this.intersect),
  22215. this.closestPano || this.closestPanoInDirection(this.getMouseDirection())
  22216. ? (this.reticule.updatePosition(this.position, this.intersect), f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection()))
  22217. : this.reticule.hide()
  22218. }),
  22219. (n.prototype.checkHotClick = function () {
  22220. if (this.intersectHot) {
  22221. if (this.intersectHot.texType == 'video' && this.intersectHot.info.actionType.playAndPause) {
  22222. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  22223. }
  22224. this.intersectHot.examine(this)
  22225. return true
  22226. }
  22227. }),
  22228. (n.prototype.getMouseDirection = function (e) {
  22229. e = e || this.mouse
  22230. var t = new r.Vector3(e.x, e.y, -1).unproject(this.camera),
  22231. i = new r.Vector3(e.x, e.y, 1).unproject(this.camera)
  22232. return i.sub(t).normalize()
  22233. }),
  22234. (n.prototype.hoverOverlay = function (mesh) {
  22235. if (!mesh) {
  22236. this.hoveringPlane = null
  22237. $('#player').css('cursor', this.currentCursor || '')
  22238. } else {
  22239. var overlay = mesh.parent
  22240. $('#player').css('cursor', 'pointer')
  22241. this.hoveringPlane = overlay
  22242. return true
  22243. }
  22244. }),
  22245. (n.prototype.clickOverlay = function (overlay) {
  22246. if (this.openOverlay && !overlay) return
  22247. var plane = overlay.plane
  22248. /* if(overlay.overlayType == "video"){
  22249. if(plane.material.map.image.paused) plane.material.map.image.play()
  22250. else plane.material.map.image.pause()
  22251. } */
  22252. if (overlay.overlayType == 'video') {
  22253. overlay.switchPlay(!!overlay.pausedByUser)
  22254. }
  22255. /* if(window.EditOverlay &&EditOverlay.editing){
  22256. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  22257. $('#overlayProp').removeClass('atRight').removeClass('hide')
  22258. EditOverlay.endAddPlane();
  22259. EditOverlay.updateOverlayPanel(overlay)
  22260. EditOverlay.controlSelectOverlay(overlay)
  22261. return;
  22262. } */
  22263. }),
  22264. (n.prototype.getMouseIntersect = function (e, t) {
  22265. //xzw change
  22266. ;(e = e || this.mouse.clone()),
  22267. (t =
  22268. t ||
  22269. this.model.floors.reduce(
  22270. function (e, t) {
  22271. return t.hidden ? e : e.concat(t.collider.children)
  22272. },
  22273. this.mode === u.PANORAMA ? this.panoMarkers : []
  22274. ))
  22275. var i = new r.Vector3(e.x, e.y, -1).unproject(this.camera)
  22276. this.raycaster.set(i, this.getMouseDirection(e))
  22277. var n = this.raycaster.intersectObjects(t, true) //add true
  22278. var o = n[0]
  22279. if (o) {
  22280. o.face &&
  22281. ((o.normal = o.face.normal.applyQuaternion(o.object.quaternion)),
  22282. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  22283. this.currentPano ? (o.onFloor = o.point.y < this.position.y - 0.5 * this.currentPano.height) : (o.onFloor = o.point.y < this.position.y - 0.5),
  22284. (o.horizontal = 0.8 < o.normal.y))
  22285. return o
  22286. }
  22287. }),
  22288. (n.prototype.updateClosestPano = function (e) {
  22289. var t = [s.filters.isPanoAligned()]
  22290. if (this.mode === u.PANORAMA) {
  22291. if (!this.currentPano) return
  22292. t.push(s.filters.not(this.currentPano)),
  22293. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  22294. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), 0.25)),
  22295. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  22296. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  22297. } else {
  22298. t.push(s.filters.isOnVisibleFloor()), t.push(this.checkHasNeighbor) //add
  22299. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), 0.25))
  22300. }
  22301. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)])
  22302. i !== this.closestPano
  22303. ? (i && (this.isPanoHover = !0),
  22304. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  22305. (this.closestPano = i),
  22306. this.closestPano && this.mode == 'panorama' ? CursorDeal.add('hoverPano') : CursorDeal.remove('hoverPano')) //add
  22307. : (this.isPanoHover = !1)
  22308. }),
  22309. (n.prototype.dollhouseMode = function (e, t) {
  22310. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE), (this.mode = u.DOLLHOUSE), this.cameraControls.controls[u.DOLLHOUSE].reset()
  22311. var i = new r.Vector3(this.model.center.x, 0, this.model.center.z),
  22312. n = new r.Vector3(15, 10, 15)
  22313. if (e && t) {
  22314. var o = d.FORWARD.clone().applyQuaternion(t),
  22315. a = this.model.center.clone().sub(e),
  22316. s = a.dot(o)
  22317. s > 0 ? ((i = o.clone().multiplyScalar(s).add(e)), n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  22318. }
  22319. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  22320. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  22321. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  22322. this.updateFromControls(),
  22323. (this.model.alpha = 1),
  22324. (this.model.skybox.material.uniforms.opacity.value = 0)
  22325. }),
  22326. (n.prototype.insideMode = function (e, t) {
  22327. var i = $.Deferred(),
  22328. n = t || null
  22329. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  22330. var r = [s.filters.isPanoAligned()]
  22331. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  22332. (e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)])),
  22333. this.flyToNewMode({
  22334. mode: u.PANORAMA,
  22335. pano: e,
  22336. callback: n
  22337. })
  22338. .done(i.resolve.bind(i))
  22339. .fail(i.reject.bind(i))
  22340. } else {
  22341. var o = this.mode === u.PANORAMA ? 'Already in panorama mode' : 'Cannot change mode during mode transition'
  22342. i.reject(o)
  22343. }
  22344. return i.promise()
  22345. }),
  22346. (n.prototype.fitDollhouse = function (e, t, i) {
  22347. //许钟文改 飞入前寻找和初始视角最合适的位置
  22348. //if(urlHasValue('oldEntry')){
  22349. //搬自一代。
  22350. var maxY = this.model.boundingBox.max.y
  22351. var n = d.FORWARD.clone().applyQuaternion(i),
  22352. i = n.clone().add(e)
  22353. this.cameraControls.activeControl.target.copy(i),
  22354. this.cameraControls.activeControl.camera.position
  22355. .set(0, maxY * 2.4, 0)
  22356. .add(e)
  22357. .add(n.multiplyScalar(-10))
  22358. //return;
  22359. /* //this.camera.position.copy(this.model.center);
  22360. //this.camera.updateMatrixWorld()
  22361. this.switchCameraMode("dollhouse", i) */
  22362. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  22363. //直接用一代的这个 效果和二代几乎一样,且不会甩
  22364. /* var n = d.FORWARD.clone().applyQuaternion(i);
  22365. this.cameraControls.activeControl.target.copy(n).add(e);
  22366. var o = d.RIGHT.clone().applyQuaternion(i)
  22367. , a = d.UP.clone()
  22368. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  22369. , l = this.model.boundingBox.max.clone()
  22370. , c = this.model.boundingBox.min.clone()
  22371. , 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)]
  22372. , u = 0
  22373. , p = 0
  22374. , g = 0;
  22375. h.forEach(function(e, t, i) {
  22376. var n = Math.abs(e.dot(o))
  22377. , r = e.dot(s);
  22378. n > u && (u = n,
  22379. p = r),
  22380. r > g && (g = r)
  22381. });
  22382. 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)))
  22383. , v = s.clone().multiplyScalar(p).add(t)
  22384. , A = s.clone().multiplyScalar(g).add(t);
  22385. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  22386. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  22387. p = Math.max(p, 10),
  22388. g = Math.max(g, 10);
  22389. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  22390. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  22391. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  22392. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  22393. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  22394. */
  22395. }),
  22396. (n.prototype.floorplanMode = function (e, t, i) {
  22397. this.mode = u.FLOORPLAN
  22398. var n = this.cameraControls.controls[u.FLOORPLAN]
  22399. n.reset()
  22400. var r = e ? e : this.model.center
  22401. if (
  22402. (n.target.copy(r).setY(0),
  22403. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  22404. i ? ((n.currentScale = i / ($('#player').width() / $('#player').height())), (n.absoluteScale = n.currentScale)) : n.zoomToContain(this.model.size),
  22405. t)
  22406. ) {
  22407. var o = d.LEFT.clone().applyQuaternion(t)
  22408. n.rotateLeft(-Math.atan2(o.x, o.z))
  22409. } else n.rotateToView(this.model.size, this.getDirection())
  22410. n.update(0)
  22411. }),
  22412. (n.prototype.nonInterruptingFlyToPano = function (e, t) {
  22413. return (e.skipWarpingCheck = !0), this.flyToPano(e, t)
  22414. }),
  22415. (n.prototype.updateMarkerVisi = function () {
  22416. //加
  22417. if (this.mode != 'panorama') return
  22418. this.model.panos.list.forEach(pano => {
  22419. if (!pano.marker) return
  22420. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id]
  22421. })
  22422. }),
  22423. /* n.prototype.updateHotVisible = function(pano){
  22424. var hots = this.model.hots;
  22425. pano = pano || this.currentPano;
  22426. for (var index in hots){
  22427. var visible;
  22428. if(this.mode != "panorama"){
  22429. visible = true;
  22430. }else{
  22431. //hots[index].mesh.material.depthTest = false;
  22432. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  22433. }
  22434. hots[index].mesh.visible = visible;
  22435. }
  22436. } */
  22437. (n.prototype.flyToPano = function (e, t) {
  22438. var i = e.pano,
  22439. aim = e.lookAtPoint,
  22440. aimQua = e.quaternion, //ADD
  22441. o = e.duration,
  22442. a = e.aimDuration,
  22443. s = e.maxDistanceOverride,
  22444. l = e.skipWarpingCheck,
  22445. c = e.constantMoveSpeed,
  22446. h = null,
  22447. p = null
  22448. if (aim) {
  22449. var _ = new r.Matrix4().lookAt(i.position, aim, d.UP)
  22450. aimQua = new r.Quaternion().setFromRotationMatrix(_)
  22451. } else aimQua = aimQua
  22452. var zoomLevel = e.zoomLevel || 1 //add
  22453. if (this.flying) return t && t(e)
  22454. window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(i)
  22455. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD)) return F.warn('Player.flyToPano() -> Cannot fly when warping'), t && t(), !1
  22456. if ((this.updateLastView(), this.mode !== u.PANORAMA)) {
  22457. var m
  22458. return void this.flyToNewMode({
  22459. mode: u.PANORAMA,
  22460. pano: i,
  22461. duration: o,
  22462. quaternion: aimQua,
  22463. callback: t
  22464. })
  22465. }
  22466. if (
  22467. !i ||
  22468. ((h = g.deepExtend(e)),
  22469. (p = function () {
  22470. N.delayOneFrame(
  22471. function () {
  22472. this.flyToPano(h, t)
  22473. }.bind(this)
  22474. )
  22475. }.bind(this)),
  22476. !this.checkAndWaitForPanoLoad(i, 'high', 'low', this.basePanoSize, p))
  22477. ) {
  22478. var C = function (e) {
  22479. t && t(e)
  22480. }.bind(this)
  22481. this.currentPano || ((this.currentPano = i), this.path.placeCpm(), this.path.fadeOutCpm(f.path.fadeOutTime), this.spider.draw())
  22482. var I = o
  22483. if ('number' != typeof o) {
  22484. var E = s || f.transition.flytimeMaxDistanceThreshold
  22485. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  22486. }
  22487. if ((f.transition.flySpeed > 0.01 && (I = (1e3 * this.currentPano.position.distanceTo(i.position)) / f.transition.flySpeed), zoomLevel !== this.zoomLevel))
  22488. switch (f.zoom.transitionStyle) {
  22489. case 1:
  22490. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? I / 2 : I) //改
  22491. break
  22492. case 2:
  22493. return (h = g.deepExtend(e)), (p = this.flyToPano.bind(this, h, t)), void this.smoothZoomFovTo(null, zoomLevel, f.zoom.restoreTime * (this.zoomLevel - 1), p)
  22494. }
  22495. if (aimQua) {
  22496. y.cancelById(V.LookTransition), (I *= f.transition.aimSlowFactor)
  22497. var b = this.cameraControls.activeControl.camera.quaternion.clone(),
  22498. S = b.clone(),
  22499. M = new r.Vector3()
  22500. if (i === this.currentPano) {
  22501. var R = d.FORWARD.clone().applyQuaternion(b),
  22502. P = d.FORWARD.clone().applyQuaternion(aimQua),
  22503. O = R.angleTo(P)
  22504. return (
  22505. (void 0 !== a && null !== a) || (a = ((1 * Math.sqrt(O)) / f.tags.navigate.rotateSpeedFactor) * 1e3),
  22506. void y.start(
  22507. function (e) {
  22508. S.copy(b),
  22509. v.quaternion(S, aimQua)(e),
  22510. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22511. this.cameraControls.activeControl.lookAt(M)
  22512. }.bind(this),
  22513. a,
  22514. C,
  22515. 0,
  22516. A[f.transition.movementEasing],
  22517. null,
  22518. V.LookTransition
  22519. )
  22520. )
  22521. }
  22522. }
  22523. if (i === this.currentPano) return void C()
  22524. this.flying = !0
  22525. var L = this.position.clone(),
  22526. D = this.currentPano
  22527. F.debug('Flying to pano ', i.position), this.emit(w.PanoChosen, this.currentPano, i), this.emit(w.FlyingStarted, i.position, L, i, D)
  22528. //---------before fly--------------- add
  22529. this.transitionPos({ type: 'beforeFlytopano', pano: i, dur: I }) //add
  22530. Hot.updateVisibles([this.currentPano, i], 'every')
  22531. //地标变化
  22532. if (this.model.floorLogos) {
  22533. this.model.changefloorLogoOpa({ index: 0, opa: 0, dur: p, delay: 0.7 }) //this.model.floorLogoFade(0, _duration*0.5, 0.7);
  22534. this.model.floorLogos[1].position.copy(i.floorPosition.clone().sub(this.model.position))
  22535. //this.model.adjustfloorLogoHeight();
  22536. this.model.floorLogos[1].material.opacity = 0 //uniforms.opacity.value = 0;
  22537. this.model.floorLogos[1].visible = true
  22538. this.model.changefloorLogoOpa({ index: 1, opa: 1, dur: 250 }) //this.model.floorLogoShow(1,250);
  22539. }
  22540. //=======================================
  22541. this.nextPano = i
  22542. let beginTran = () => {
  22543. aimQua &&
  22544. y.start(
  22545. function (e) {
  22546. S.copy(b), v.quaternion(S, aimQua)(e), M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position), this.cameraControls.activeControl.lookAt(M)
  22547. }.bind(this),
  22548. I,
  22549. null,
  22550. 0,
  22551. A[f.transition.movementEasing],
  22552. null,
  22553. V.LookTransition
  22554. )
  22555. var B = c ? null : A[f.transition.movementEasing]
  22556. y.start(v.uniform(this.model.skybox, 'progress', 1), I, null, 0, A[f.transition.blendEasing], 'skyFly', V.FlyToPano),
  22557. y.start(v.allUniforms(this.model.chunks, 'progress', 1), I, null, 0, A[f.transition.blendEasing], 'chunkFly', V.FlyToPano),
  22558. y.start(
  22559. v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position),
  22560. I,
  22561. function (e) {
  22562. ;(this.flying = !1),
  22563. this.currentPano !== i && this.currentPano.exit(),
  22564. i.enter(),
  22565. (this.currentPano = i),
  22566. (this.nextPano = null),
  22567. this.path.placeCpm(),
  22568. this.path.fadeOutCpm(f.path.fadeOutTime),
  22569. this.spider.draw(),
  22570. this.emit(w.FlyingEnded, i.position, L, i, D),
  22571. this.updateMarkerVisi(), //add
  22572. C(e)
  22573. //add:
  22574. if (this.mode == 'panorama') {
  22575. if (this.model.floorLogos) {
  22576. this.model.floorLogos[0].position.copy(this.model.floorLogos[1].position)
  22577. //this.model.adjustfloorLogoHeight()
  22578. this.model.changefloorLogoOpa({ index: 0, opa: 1, dur: 0 }) //this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  22579. this.model.floorLogos[1].visible = false
  22580. }
  22581. this.model.fadePanoMarkers() //add
  22582. Hot.updateVisibles([this.currentPano]) //add
  22583. }
  22584. }.bind(this),
  22585. 0,
  22586. B,
  22587. 'camFly',
  22588. V.FlyToPano
  22589. )
  22590. }
  22591. if (!this.model.supportsTiles && i.getSkyboxTexture().image[0].width > 1024 /* || this.qualityManager.getMaxZoomClass() == '4k' */) {
  22592. setTimeout(() => {
  22593. beginTran()
  22594. }, 50) //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  22595. } else {
  22596. beginTran()
  22597. }
  22598. }
  22599. }),
  22600. (n.prototype.warpToPano = function (o = {}) {})
  22601. n.prototype.blackToPano = function (o = {}, callback) {
  22602. //add 瞬间过渡
  22603. //o.panoId = "8bc9156b288d48459e4e0f74d7051ef1"
  22604. if (this.flying || this.isWarping()) return
  22605. let pano = o.pano || this.model.panos.index[o.panoId]
  22606. if (this.mode !== u.PANORAMA) {
  22607. var m
  22608. void this.flyToNewMode({
  22609. mode: u.PANORAMA,
  22610. pano,
  22611. duration: o.duration,
  22612. quaternion: o.quaternion,
  22613. callback
  22614. })
  22615. }
  22616. let oldPos = this.position.clone()
  22617. let oldPano = this.currentPano
  22618. this.path.warpDestPano = pano
  22619. var retry = () => {
  22620. ;(this.waitingToWarp = !1), this.blackToPano(o, callback)
  22621. }
  22622. if (this.checkAndWaitForPanoLoad(pano, 'high', 'low', this.basePanoSize, retry)) return void (this.waitingToWarp = !0)
  22623. this.flying = true
  22624. this.nextPano = pano //提前加载高清图片
  22625. this.path.warpDestHeroLoc = {
  22626. panoId: pano.id,
  22627. position: pano.position,
  22628. quaternion: o.quaternion || this.quaternion.clone()
  22629. }
  22630. this.path.warpTravel_BLACK(null, 1500, 1, () => {
  22631. pano != this.currentPano && this.currentPano.exit()
  22632. pano.enter()
  22633. this.currentPano = pano
  22634. this.flying = false
  22635. this.nextPano = null
  22636. this.updateMarkerVisi() //add
  22637. callback && callback()
  22638. })
  22639. }
  22640. window._transitionPosId = 9999
  22641. n.prototype.transitionPos = function (o = {}) {
  22642. //渐变overlay和热点的位置
  22643. y.cancelById(_transitionPosId)
  22644. var begin = function (object, pos, qua, scale) {
  22645. if (pos) {
  22646. if (!same(object.position, pos, 0.01)) {
  22647. y.start(
  22648. v.vector(object.position, pos),
  22649. o.dur,
  22650. e => {
  22651. object.updateScale()
  22652. },
  22653. 0,
  22654. A[f.transition.movementEasing],
  22655. 'transitionPos',
  22656. _transitionPosId
  22657. )
  22658. }
  22659. if (qua && !same(object.quaternion, qua, 1e-6)) {
  22660. y.start(v.quaternion(object.quaternion, qua), o.dur, e => {}, 0, A[f.transition.movementEasing], 'transitionPos', _transitionPosId)
  22661. }
  22662. if (scale && !same(object.scale, scale, 0.001)) {
  22663. y.start(v.vector(object.scale, scale), o.dur, e => {}, 0, A[f.transition.movementEasing], 'transitionPos', _transitionPosId)
  22664. }
  22665. }
  22666. }
  22667. var same = function (vec1, vec2, diff) {
  22668. var s = Math.abs(vec1.x - vec2.x) < diff && Math.abs(vec1.y - vec2.y) < diff && Math.abs(vec1.z - vec2.z) < diff
  22669. if (s && vec1.w) s = Math.abs(vec1.w - vec2.w) < diff
  22670. return s
  22671. }
  22672. var sid = o.pano != void 0 ? o.pano.id : 'outside'
  22673. for (let i in this.model.hots) {
  22674. //是否判断visible?
  22675. var hot = this.model.hots[i]
  22676. var panoData = hot.info.transformAtPanos[sid]
  22677. var useCustom = !panoData
  22678. //if(hot.usingTransformData || !useCustom){
  22679. var pos = useCustom ? hot.info.position : panoData.pos
  22680. var qua = hot.isSprite ? null : useCustom ? hot.info.quaternion : panoData.qua
  22681. var scale = useCustom ? hot.info.scale : panoData.scale
  22682. begin(hot, pos, qua, scale)
  22683. //}
  22684. //hot.usingTransformData = !useCustom;
  22685. }
  22686. if (o.callback) {
  22687. setTimeout(() => {
  22688. o.callback()
  22689. }, o.dur + 16) //姑且这么写
  22690. }
  22691. }
  22692. window._tranOutsideFocus = 4399
  22693. n.prototype.focusPoint = function (o = {}) {
  22694. //当在外时,聚焦相机到这一点
  22695. console.log('focusPoint')
  22696. if (this.mode == 'floorplan') {
  22697. var modelSize = o.modelSize || new THREE.Vector3(8, 8, 8) //可视范围
  22698. var control = this.cameraControls.controls.floorplan
  22699. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  22700. var currentScale = control.absoluteScale
  22701. var currentTarget = control.target.clone()
  22702. y.cancelById(window._tranOutsideFocus, true)
  22703. y.start(
  22704. function (progress) {
  22705. control.absoluteScale = absoluteScale * progress + currentScale * (1 - progress)
  22706. control.target = o.aim
  22707. .clone()
  22708. .multiplyScalar(progress)
  22709. .add(currentTarget.clone().multiplyScalar(1 - progress))
  22710. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  22711. }.bind(this),
  22712. o.dur || 600,
  22713. null /* cancelFuc */,
  22714. 0,
  22715. A[f.transition.movementEasing],
  22716. 'outsideFocus',
  22717. window._tranOutsideFocus,
  22718. null /* cancelFuc */
  22719. )
  22720. } else if (player.mode == 'dollhouse') {
  22721. var control = player.cameraControls.controls.dollhouse
  22722. var radius = o.radius || 8
  22723. var currentTarget = control.target.clone()
  22724. var dir = control.offset.clone().normalize()
  22725. var currentRadius = control.offset.length()
  22726. y.cancelById(window._tranOutsideFocus, true)
  22727. y.start(
  22728. function (progress) {
  22729. control.target = o.aim
  22730. .clone()
  22731. .multiplyScalar(progress)
  22732. .add(currentTarget.clone().multiplyScalar(1 - progress))
  22733. let radius_ = radius * progress + currentRadius * (1 - progress)
  22734. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  22735. }.bind(this),
  22736. o.dur || 600,
  22737. null /* cancelFuc */,
  22738. 0,
  22739. A[f.transition.movementEasing],
  22740. 'outsideFocus',
  22741. window._tranOutsideFocus,
  22742. null /* cancelFuc */
  22743. )
  22744. } else if (this.mode == 'panorama') {
  22745. this.flyToPano({
  22746. lookAtPoint: o.aim.clone(),
  22747. pano: this.currentPano,
  22748. aimDuration: o.dur || 600
  22749. })
  22750. }
  22751. }
  22752. /*
  22753. 切换到某个模式后再执行函数
  22754. */
  22755. n.prototype.FlyToMode = function (mode, f1, duration) {
  22756. var f2
  22757. if (this.mode == mode) {
  22758. f1 && f1()
  22759. } else {
  22760. f2 = f1
  22761. if (this.mode == 'transitioning' && this.modeTran.split('-')[1] != mode) {
  22762. //正飞向其他模式,就要先飞完再飞进来然后执行
  22763. this.afterCModeFuc = function () {
  22764. /* objects.gui.modeChange[mode](null, {
  22765. fuc: f2 这个写法会使得先添加的回调fuc取代之后添加的afterCModeFuc,所以统一改为afterCModeFuc
  22766. }); */
  22767. this.afterCModeFuc = f2
  22768. this.flyToNewMode({
  22769. mode: mode,
  22770. pano: mode == 'panorama' && this.currentPano
  22771. //callback : f2
  22772. })
  22773. //这个fuc在trainsitioning状态下传入是无效的,所以后面得用afterCModeFuc。但是执行完afterCModeFuc,afterCModeFuc会变为null,所以里面得用fuc。。orz
  22774. }.bind(this)
  22775. } else {
  22776. if (this.afterCModeFuc) console.log('已经有afterCModeFuc了!!!!!!!!!!!!!!!')
  22777. this.afterCModeFuc = f2 //飞入后执行
  22778. try {
  22779. //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22780. this.flyToNewMode({ mode: mode, pano: mode == 'panorama' && this.currentPano, duration: duration })
  22781. } catch (e) {
  22782. console.log('FlyToMode遇到问题?')
  22783. }
  22784. }
  22785. }
  22786. }
  22787. ;(n.prototype.fastForwardActivePanoFlight = function (e) {
  22788. e = e || (f.transition.fastForwardFactor / 10) * 4 + 1
  22789. y.adjustSpeed(V.FlyToPano, e)
  22790. y.adjustSpeed(V.LookTransition, e)
  22791. }),
  22792. (n.prototype.flyToPanoClosestToMouse = function () {
  22793. if ((Date.now() - this.mouseLastMoveTime > 50 && ((this.intersect = this.getMouseIntersect()), this.intersect && this.updateClosestPano(this.intersect)), this.closestPano))
  22794. return this.flyToPano({
  22795. pano: this.closestPano
  22796. })
  22797. var e = this.getMouseDirection()
  22798. this.flyDirection(e) ||
  22799. this.flyToPano({
  22800. pano: this.currentPano
  22801. })
  22802. }),
  22803. (n.prototype.flyLocalDirection = function (e) {
  22804. var t = this.getDirection(e),
  22805. i = 1 === e.z ? 0.4 : 0.75,
  22806. n = 1 === Math.abs(e.x)
  22807. return this.flyDirection(t, i, n)
  22808. }),
  22809. (n.prototype.flyDirection = function (e, t, i) {
  22810. Hot.closePopup() //xzw add
  22811. var n = $.Deferred()
  22812. this.history.invalidate()
  22813. var r = this.closestPanoInDirection(e, t, i)
  22814. return (
  22815. r
  22816. ? this.flyToPano(
  22817. {
  22818. pano: r
  22819. },
  22820. n.resolve.bind(n, !0)
  22821. )
  22822. : (this.bump(e), n.resolve(!1)),
  22823. n.promise()
  22824. )
  22825. }),
  22826. (n.prototype.closestPanoInDirection = function (e, t, i) {
  22827. return this.rankedPanoInDirection(0, e, t, i)
  22828. }),
  22829. (n.prototype.rankedPanoInDirection = (function () {
  22830. var e = {
  22831. pano: null,
  22832. candidates: []
  22833. }
  22834. return function (t, i, n, r) {
  22835. t || (t = 0), (n = void 0 !== n ? n : 0.75)
  22836. var o = r ? 'angle' : 'direction'
  22837. return (
  22838. this.model.panos.findRankedByScore(
  22839. t,
  22840. [s.filters.isPanoAligned(), s.filters.not(this.currentPano), s.filters.isNeighbourPanoTo(this.currentPano), s.filters.inPanoDirection(this.position, i, n)],
  22841. [s.scoreFunctions.distanceSquared(this.currentPano), s.scoreFunctions[o](this.position, i)],
  22842. e
  22843. ),
  22844. (this.cachedPanoCandidates = e.candidates),
  22845. e.pano
  22846. )
  22847. }
  22848. })()),
  22849. (n.prototype.bump = function (e) {
  22850. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  22851. var t,
  22852. i,
  22853. n,
  22854. r = f.transition,
  22855. o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8,
  22856. a = this.camera.getWorldDirection().dot(e),
  22857. s = Math.abs(a) > 0.5
  22858. if (s)
  22859. (t = function () {
  22860. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], 'zoom', a > 0 ? 1.04 : 0.96), o, i, 0, A.easeInOutSine, 'bumpZStart')
  22861. }.bind(this)),
  22862. (i = function () {
  22863. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], 'zoom', 1), 5 * o, n, 0, A.easeInOutSine, 'bumpZRelax')
  22864. }.bind(this))
  22865. else {
  22866. var l = this.camera.position.clone(),
  22867. c = e.clone()
  22868. this.raycaster.set(l, c)
  22869. var h = this.model.floors.reduce(function (e, t) {
  22870. return e.concat(t.collider.children)
  22871. }, []),
  22872. d = this.raycaster.intersectObjects(h),
  22873. p = d.length > 0 ? d[0].distance / 25 : 0.04,
  22874. g = l.clone().add(c.multiplyScalar(p))
  22875. ;(t = function () {
  22876. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, 'bumpTStart')
  22877. }.bind(this)),
  22878. (i = function () {
  22879. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, 'bumpTRelax')
  22880. }.bind(this))
  22881. }
  22882. ;(n = function () {
  22883. this.flying = !1
  22884. }.bind(this)),
  22885. (this.flying = !0),
  22886. t()
  22887. }
  22888. }),
  22889. (n.prototype.changeFloor = function (e) {
  22890. if (!this.is360View(this.mode, this.currentPano))
  22891. if (this.mode === u.PANORAMA) {
  22892. var t = this.history.reversePano(e)
  22893. t && t.isAligned()
  22894. ? this.flyToPano({
  22895. pano: t
  22896. })
  22897. : this.changeFloorByScore(e)
  22898. } else this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  22899. }),
  22900. (n.prototype.changeFloorByScore = (function () {
  22901. var e = {
  22902. pano: null,
  22903. candidates: []
  22904. }
  22905. return function (t) {
  22906. var i = this.model.nextFloor(t)
  22907. return i
  22908. ? (this.model.panos.lowestByScore(
  22909. [s.filters.atFloor(i), s.filters.isPanoAligned()],
  22910. [
  22911. s.scoreFunctions.distance(this.currentPano),
  22912. s.scoreFunctions.direction(this.position, new r.Vector3(0, t, 0)),
  22913. s.scoreFunctions.penalizeHeightDifferenceUnder(this.position, 0.5)
  22914. ],
  22915. e
  22916. ),
  22917. void (e.pano
  22918. ? ((this.cachedPanoCandidates = e.candidates),
  22919. this.history.push(t, this.currentPano),
  22920. this.flyToPano({
  22921. pano: e.pano
  22922. }))
  22923. : F.warn('No pano found on selected floor, not moving there.')))
  22924. : void F.debug('player.changeFloor(' + t + '): no such floor')
  22925. }
  22926. })()),
  22927. (n.prototype.gotoFloor = function (e) {
  22928. var t = e - this.model.currentFloor.floorIndex
  22929. this.changeFloor(t)
  22930. }),
  22931. (n.prototype.getDirection = function (e) {
  22932. return (e = e ? e : new r.Vector3().copy(d.FORWARD)), e.applyQuaternion(this.camera.quaternion)
  22933. }),
  22934. (n.prototype.flyToSameMode = function (e, t, i, n, o) {
  22935. if (((o = o || $.Deferred()), this.mode === u.TRANSITIONING)) return F.warn('should not be transitioning here'), n && n(!1), o.reject().promise()
  22936. var a = i || !1,
  22937. s = i ? i.position : this.position,
  22938. l = this.position.clone(),
  22939. c = this.currentPano
  22940. if (
  22941. (F.debug('New pose in mode ' + this.mode),
  22942. !e ||
  22943. ((retryCallback = function () {
  22944. N.delayOneFrame(
  22945. function () {
  22946. this.flyToSameMode(e, t, i, n, o)
  22947. }.bind(this)
  22948. )
  22949. }.bind(this)),
  22950. !this.checkAndWaitForPanoLoad(e, 'high', 'low', this.basePanoSize, retryCallback)))
  22951. ) {
  22952. var h = function () {
  22953. this.emit(w.FlyingEnded, s, l, e, c), n && n(!0)
  22954. }.bind(this),
  22955. d = f[this.mode],
  22956. p = void 0 !== t ? t : d.transitionTime,
  22957. g = new r.Vector3(),
  22958. C = new r.Vector3()
  22959. if ((this.emit(w.FlyingStarted, s, l, e, c), this.mode === u.PANORAMA)) F.warn('we should not be here for panorama views')
  22960. else if (this.mode === u.DOLLHOUSE)
  22961. if (a) {
  22962. var I = new r.Vector3(0, 1, 0)
  22963. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0), this.model.warpDestFloors(i.floorVisibility), C.copy(i.position)
  22964. var E = new r.Vector3(0, 0, -1).applyQuaternion(i.quaternion),
  22965. b = new r.Raycaster(C.clone(), E.clone(), 0, 1 / 0),
  22966. _ = b.intersectObjects(this.model.colliders),
  22967. T = 3
  22968. _.length
  22969. ? (g.copy(_[0].point), (T = 0.75 * C.distanceTo(g)))
  22970. : (g.copy(E).multiplyScalar(3).add(C), F.debug('Tried to restore dollhouse mode that did not intersect...', i.position, i.quaternion))
  22971. var x = new r.Matrix4().lookAt(C, g, I),
  22972. S = new r.Euler().setFromRotationMatrix(x, f.warp.eOrder),
  22973. M = g.distanceTo(C),
  22974. R = new r.Matrix4().lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I),
  22975. P = new r.Euler().setFromRotationMatrix(R, f.warp.eOrder),
  22976. O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target)
  22977. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0)
  22978. var L = new r.Euler(S.x - P.x, S.y - P.y, S.z - P.z, f.warp.eOrder)
  22979. ;(L.y = L.y > Math.PI ? (L.y -= 2 * Math.PI) : L.y < -Math.PI ? (L.y += 2 * Math.PI) : L.y), (this.path.burnsDir = Math.sign(L.y))
  22980. var D = new r.Euler(0, 0, 0, f.warp.eOrder),
  22981. B = new r.Vector3()
  22982. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  22983. y.start(
  22984. function (e, t) {
  22985. ;(D.x = P.x + e * L.x), (D.y = P.y + e * L.y), (D.z = P.z + e * L.z)
  22986. var i = O + e * (M - O)
  22987. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target), this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  22988. }.bind(this),
  22989. p,
  22990. null,
  22991. f.flydown.movementDelay,
  22992. A[f.flydown.movementEasing],
  22993. null,
  22994. V.FlyToSameMode
  22995. ),
  22996. y.start(
  22997. function (e, t) {
  22998. this.cameraControls.controls[u.DOLLHOUSE].update(),
  22999. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  23000. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  23001. }.bind(this),
  23002. p,
  23003. null,
  23004. f.flydown.movementDelay,
  23005. A[f.flydown.movementEasing],
  23006. null,
  23007. V.FlyToSameMode
  23008. )
  23009. } else F.warn('invalid warp destination in flyToSameMode()? ignore it then')
  23010. else if ((this.path.placeCpm(), this.path.fadeInCpm(f.path.fadeInTime), i)) {
  23011. this.model.warpDestFloors(i.floorVisibility)
  23012. var U = this.cameraControls.cameras[u.FLOORPLAN],
  23013. k = this.cameraControls.controls[u.FLOORPLAN],
  23014. H = k.target.clone(),
  23015. G = i.position.clone().sub(H),
  23016. z = U.position.clone().sub(k.target),
  23017. W = z.length(),
  23018. j = new r.Vector3(-1, 0, 0).applyQuaternion(i.quaternion).normalize(),
  23019. Y = Math.atan2(k.offset.x, k.offset.z),
  23020. X = Math.atan2(j.x, j.z),
  23021. Z = k.absoluteScale,
  23022. q = m.convertWorkshopOrthoZoom(i.orthoZoom)
  23023. y.start(
  23024. function (e, t) {
  23025. k.target.copy(G).multiplyScalar(e).add(H)
  23026. var i = Y + (X - Y) * e
  23027. ;(k.offset.x = W * Math.sin(i)),
  23028. (k.offset.z = W * Math.cos(i)),
  23029. U.position.copy(k.target).add(k.offset),
  23030. (k.absoluteScale = Z + e * (q - Z)),
  23031. k.update(),
  23032. this.quaternion.copy(U.quaternion),
  23033. this.position.copy(U.position),
  23034. this.target.copy(k.target),
  23035. this.camera.projectionMatrix.copy(U.projectionMatrix)
  23036. }.bind(this),
  23037. p,
  23038. null,
  23039. 0,
  23040. A[f.flydown.movementEasing],
  23041. null,
  23042. V.FlyToSameMode
  23043. )
  23044. } else F.info('flyToSameMode() funny floorplan view? skipping')
  23045. return (
  23046. y.setTimeout(
  23047. function (e) {
  23048. ;(this.mode = e), h(), o.resolve(!0)
  23049. }.bind(this, this.mode),
  23050. p,
  23051. V.FlyToSameMode
  23052. ),
  23053. (this.mode = u.TRANSITIONING),
  23054. o.promise()
  23055. )
  23056. }
  23057. }),
  23058. (n.prototype.flyToNewMode = function (e, t) {
  23059. Hot.closePopup() //xzw add
  23060. e = e || {}
  23061. var i = e.mode,
  23062. n = e.pano,
  23063. o = e.duration,
  23064. a = e.warpDest,
  23065. s = e.callback,
  23066. l = e.force,
  23067. c = e.quaternion
  23068. if (((t = t || $.Deferred()), this.isWarping()))
  23069. return F.warn('Player.flyToNewMode() -> Cannot fly when warping'), s && s(!1), t.reject('Cannot change mode during tour transition').promise()
  23070. if (this.mode === u.TRANSITIONING) return s && s(!1), t.reject('Cannot change mode during mode transition').promise()
  23071. if (i === this.mode)
  23072. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)), t.promise()) : (s && s(!1), t.reject('Already in ' + i + ' mode').promise())
  23073. var h = a || !1
  23074. F.debug('Switching mode to ' + i)
  23075. if (window.vrEnabled && i != 'panorama') {
  23076. return s && s(!1), t.reject('vr不允许飞出').promise()
  23077. }
  23078. var d = function () {
  23079. N.delayOneFrame(
  23080. function () {
  23081. this.flyToNewMode(e, t)
  23082. }.bind(this)
  23083. )
  23084. }.bind(this)
  23085. if (n && this.checkAndWaitForPanoLoad(n, 'low', 'low', this.basePanoSize, d)) return t.promise()
  23086. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  23087. return (
  23088. F.info('Waiting for model textures to be loaded before going out to dollhouse'),
  23089. this.model.waitForLoad(
  23090. this.model,
  23091. function () {
  23092. return this.model.meshTexturesLoaded
  23093. }.bind(this)
  23094. ),
  23095. this.model.loadMeshTextures().done(d),
  23096. t.promise()
  23097. )
  23098. this.history.invalidate(), this.updateLastView()
  23099. var p = this.mode,
  23100. C = this.cameraControls.cameras[i]
  23101. e = g.deepExtend({}, f[i], f[p + '-' + i])
  23102. var I = void 0 !== o ? o : e.transitionTime
  23103. this.emit(w.ModeChanging, p, i, n, I), n && (this.currentPano = n), this.switchCameraMode(i, c), y.cancelById(V.LookTransition)
  23104. //before fly---------------------
  23105. this.modeTran = p + '-' + i //add
  23106. if (this.mode == 'panorama') {
  23107. if (this.model.floorLogos) {
  23108. this.model.floorLogos[0].visible = false
  23109. this.model.floorLogos[1].visible = false
  23110. }
  23111. }
  23112. if (i == 'panorama') {
  23113. this.transitionPos({ type: 'beforeFlyIn', pano: n, dur: I }) //add
  23114. } else {
  23115. this.transitionPos({ type: 'beforeFlyOut', dur: I / 2 }) //add
  23116. }
  23117. window.bus.dispatchEvent({ type: 'playerAndModelReady' })
  23118. this.ready = true
  23119. //------------------------------------
  23120. var beginTran = () => {
  23121. var _ = new r.Vector3().copy(this.position)
  23122. if (i === u.PANORAMA) {
  23123. this.emit(w.PanoChosen, n, n),
  23124. setTimeout(
  23125. function () {
  23126. n.floor.enter(i)
  23127. }.bind(this),
  23128. I / 2
  23129. ),
  23130. this.path.fadeOutCpm(f.path.fadeOutTime)
  23131. if (this.model.floorLogos) {
  23132. this.model.floorLogos[0].position.copy(n.floorPosition.clone().sub(this.model.position)) //改
  23133. this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position) //for floorIcon position
  23134. }
  23135. } else if (i === u.DOLLHOUSE) {
  23136. if (
  23137. (h && (this.model.stayPut = !0),
  23138. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0), this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  23139. this.path.placeCpm(),
  23140. this.path.fadeInCpm(f.path.fadeInTime),
  23141. h)
  23142. ) {
  23143. var T = new r.Vector3(this.model.center.x, 0, this.model.center.z)
  23144. _.set(15, 10, 15)
  23145. var M = new r.Vector3(0, 0, -1).applyQuaternion(a.quaternion),
  23146. R = new r.Raycaster(a.position.clone(), M.clone(), 0, 1 / 0),
  23147. P = R.intersectObjects([this.sceneIntersectionPlane])
  23148. P.length
  23149. ? (T.copy(P[0].point), _.copy(a.position), this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0.75 * _.distanceTo(T), !0))
  23150. : (F.warn('Tried to restore dollhouse mode that did not intersect...', a.position, a.quaternion), this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  23151. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  23152. _.add(this.model.position),
  23153. C.position.copy(_),
  23154. this.cameraControls.controls[u.DOLLHOUSE].update()
  23155. }
  23156. } else if ((this.path.placeCpm(), this.path.fadeInCpm(f.path.fadeInTime), a)) {
  23157. this.model.warpDestFloors(a.floorVisibility)
  23158. var O = this.cameraControls.cameras[u.FLOORPLAN],
  23159. L = this.cameraControls.controls[u.FLOORPLAN],
  23160. D = O.position.clone().sub(L.target),
  23161. B = new r.Vector3(-1, 0, 0).applyQuaternion(a.quaternion).normalize(),
  23162. U = Math.atan2(B.x, B.z)
  23163. L.target.copy(a.position)
  23164. var k = D.length()
  23165. ;(L.offset.x = k * Math.sin(U)), (L.offset.y = 0), (L.offset.z = k * Math.cos(U)), O.position.copy(L.target).add(L.offset)
  23166. L.target.clone().sub(C.position)
  23167. C.quaternion.copy(a.quaternion), (L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom)), (L.absoluteScale = L.currentScale), L.update()
  23168. } else this.model.currentFloor.enter(i)
  23169. var H = this.currentPano,
  23170. G = this.position.clone()
  23171. this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  23172. (this.flying = !0),
  23173. this.isOutsideMode(i) && this.is360View(p, H)
  23174. ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15), C.controls.target.set(this.model.center.x, 0, this.model.center.z), C.controls.update()),
  23175. (e.blackoutStyle = S.FADEIN),
  23176. (I = f.show360Views.transitionTime),
  23177. this.fade360View(I, C, e))
  23178. : this.isOutsideMode(p) && this.is360View(i, n)
  23179. ? (h && this.switchCameraMode(i, h.quaternion),
  23180. (this.mode = i),
  23181. this.path && this.path.popOutCpm(),
  23182. (e.blackoutStyle = S.END),
  23183. (I = f.show360Views.transitionTime),
  23184. this.fade360View(I, C, e))
  23185. : (y.start(v.property(this.model, 'alpha', e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  23186. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  23187. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  23188. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  23189. y.start(v.uniform(this.model.skybox, 'opacity', e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  23190. y.start(v.property(this.reticule.material.uniforms.opacity, 'value', 0), I, null, V.FlyToNewMode)),
  23191. y.setTimeout(
  23192. function () {
  23193. ;(this.flying = !1),
  23194. p === u.PANORAMA && i !== u.PANORAMA
  23195. ? this.currentPano.exit()
  23196. : p !== u.PANORAMA &&
  23197. i === u.PANORAMA &&
  23198. (this.currentPano !== H && H.exit(), this.currentPano.enter(), this.path.placeCpm(), this.path.fadeOutCpm(f.path.fadeOutTime), this.spider.draw()),
  23199. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  23200. (this.mode = i),
  23201. this.emit(w.FlyingEnded, _, G, this.currentPano, H)
  23202. //add:
  23203. this.updateMarkerVisi()
  23204. //(this.mode == u.PANORAMA) && this.updateHotVisible(),
  23205. this.mode == u.PANORAMA &&
  23206. this.model.floorLogos &&
  23207. (this.model.changefloorLogoOpa({ index: 0, from: 0, opa: 1, dur: 150 }), //this.model.floorLogoShow(0,150);
  23208. (this.model.floorLogos[0].visible = true))
  23209. if (this.afterCModeFuc) {
  23210. //手动加的函数
  23211. var cf = this.afterCModeFuc
  23212. this.afterCModeFuc = null //因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  23213. cf()
  23214. }
  23215. if (this.mode == u.PANORAMA) {
  23216. Hot.updateVisibles([this.currentPano])
  23217. this.model.fadePanoMarkers()
  23218. } else {
  23219. Hot.updateVisibles(true)
  23220. this.model.hotGroup.children.forEach(overlay => {
  23221. if (overlay.animateInfo) {
  23222. GifTexDeal.start(overlay.animation)
  23223. }
  23224. })
  23225. }
  23226. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(), t.resolve())
  23227. }.bind(this),
  23228. I,
  23229. V.FlyToNewMode
  23230. )
  23231. }
  23232. if (i == 'panorama' && !this.model.supportsTiles && n.getSkyboxTexture().image[0].width > 1024) {
  23233. setTimeout(() => {
  23234. beginTran()
  23235. }, 16) //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  23236. } else {
  23237. beginTran()
  23238. }
  23239. this.mode = u.TRANSITIONING
  23240. //p == "panorama" && this.updateHotVisible(),
  23241. return t.promise()
  23242. }),
  23243. (n.prototype.fade360View = function (e, t, i) {
  23244. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  23245. $(this.domElement).fadeOut(
  23246. 0.5 * e,
  23247. function () {
  23248. ;(this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity),
  23249. (this.model.alpha = i.modelAlpha),
  23250. this.position.copy(t.position),
  23251. this.quaternion.copy(t.quaternion),
  23252. this.camera.projectionMatrix.copy(t.projectionMatrix),
  23253. $(this.domElement).fadeIn(0.5 * e)
  23254. }.bind(this)
  23255. )
  23256. }),
  23257. (n.prototype.findDefaultViews = function () {
  23258. this.findDefaultView(this.lastInsideView, !0), this.findDefaultView(this.last360View, !1)
  23259. }),
  23260. (n.prototype.findDefaultView = function (e, t) {
  23261. var i,
  23262. n = this.model.heroLocations,
  23263. r = this.model.panos,
  23264. o = n.findIndex(function (e) {
  23265. if (e.cameraMode !== u.PANORAMA) return !1
  23266. var i = r.get(e.panoId)
  23267. return i && i.isAligned() === t
  23268. })
  23269. o >= 0
  23270. ? ((i = r.get(n[o].panoId)),
  23271. e.update({
  23272. cameraMode: u.PANORAMA,
  23273. pano: i,
  23274. position: n[o].position,
  23275. quaternion: n[o].quaternion
  23276. }))
  23277. : ((o = r.list.findIndex(function (e) {
  23278. return e.isAligned() === t
  23279. })),
  23280. o >= 0
  23281. ? ((i = r.list[o]),
  23282. e.update({
  23283. cameraMode: u.PANORAMA,
  23284. pano: i,
  23285. position: i.position
  23286. }))
  23287. : F.warn('There are no', t ? 'inside' : '360º', 'views in this model'))
  23288. }),
  23289. (n.prototype.updateLastView = function () {
  23290. if (this.mode === u.PANORAMA) {
  23291. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View
  23292. e.update({
  23293. pano: this.currentPano,
  23294. position: this.position,
  23295. quaternion: this.quaternion
  23296. })
  23297. }
  23298. }),
  23299. (n.prototype.goToLastView = function (e, t) {
  23300. var i = $.Deferred(),
  23301. n = i.resolve.bind(i),
  23302. r = i.reject.bind(i),
  23303. o = e ? this.lastInsideView : this.last360View
  23304. return (
  23305. this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  23306. this.isInMode(u.PANORAMA)
  23307. ? (this.path && this.path.popOutCpm(), this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r))
  23308. : this.isOutsideMode() &&
  23309. this.flyToNewMode({
  23310. mode: o.cameraMode,
  23311. pano: o.pano,
  23312. quaternion: o.quaternion,
  23313. callback: t
  23314. })
  23315. .done(n)
  23316. .fail(r),
  23317. i.promise()
  23318. )
  23319. }),
  23320. (n.prototype.fadeToView = function (e, t, i, n) {
  23321. var r = $.Deferred(),
  23322. o = r.resolve.bind(r),
  23323. a = r.reject.bind(r)
  23324. if (!t.isValid() || (t.cameraMode === u.PANORAMA && !t.pano)) return F.warn('Tried to fade to an illegal view', t.cameraMode), a('Cannot go to illegal view'), r.promise()
  23325. var s =
  23326. (f[t.cameraMode],
  23327. function () {
  23328. $(this.domElement).fadeIn(0.5 * i), n && n(), o()
  23329. }.bind(this)),
  23330. l = e ? S.FADEIN : S.END
  23331. return (
  23332. this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  23333. $(this.domElement).fadeOut(
  23334. 0.5 * i,
  23335. function () {
  23336. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  23337. t.cameraMode === u.PANORAMA
  23338. ? this.flyToPano(
  23339. {
  23340. pano: t.pano,
  23341. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  23342. duration: 0
  23343. },
  23344. s
  23345. )
  23346. : this.flyToNewMode({
  23347. mode: t.cameraMode,
  23348. quaternion: t.quaternion,
  23349. duration: 0,
  23350. callback: s
  23351. })
  23352. }.bind(this)
  23353. ),
  23354. r.promise()
  23355. )
  23356. }),
  23357. (n.prototype.startWarp = function (e, t, i, n, r, o) {
  23358. if ((this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1), this.flying)) return F.warn('Player.startWarp() -> Cannot warp when flying'), o && o(), !1
  23359. ;(null !== e && void 0 !== e) || (e = b.Show), this.history.invalidate()
  23360. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : (i = this.path.upcomingTransType)
  23361. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned()
  23362. return (
  23363. this.emit(w.WarpStarted, a, i, n, r),
  23364. (n = n || S.MIDDLE),
  23365. this.path.warpToPano(
  23366. i,
  23367. n,
  23368. r,
  23369. function () {
  23370. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  23371. this.emit(w.WarpEnded, i),
  23372. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  23373. o && o()
  23374. }.bind(this)
  23375. ),
  23376. e === b.Hide && this.path.discardPathObject(),
  23377. !0
  23378. )
  23379. }),
  23380. (n.prototype.warpToPanoById = function (e, t, i, n, r, o, a, s) {
  23381. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn('Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()'), s && s(), !1)
  23382. }),
  23383. (n.prototype.warpToPanoByHeroIndex = function (e, t, i, n, r, o, a) {
  23384. return this.path.setWarpDestinationByHeroIndex(e)
  23385. ? this.startWarp(t, i, n, r, o, a)
  23386. : (F.warn('Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()'), a && a(), !1)
  23387. }),
  23388. (n.prototype.warpToPano = function (e, t, i, n, r, o, a, s) {
  23389. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  23390. }),
  23391. (n.prototype.warpToNonPanoByHeroIndex = function (e, t) {
  23392. return this.path.setWarpDestinationByHeroIndex(e)
  23393. ? (this.path.warpToNonPano(t), !0)
  23394. : (F.warn('Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()'), t && t(), !1)
  23395. }),
  23396. (n.prototype.aimTourCamera = function (e, t, i, n) {
  23397. return F.debug('player.aimTourCamera(' + e + ') calling warpToPanoByHeroIndex(' + e + ')'), this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  23398. }),
  23399. (n.prototype.showPathToHeroLocation = function (e) {
  23400. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  23401. }),
  23402. (n.prototype.tourInterlude = function (e, t) {
  23403. this.history.invalidate()
  23404. this.path.discardSlow()
  23405. //xzw:
  23406. var defaultRotTime = DATA.tourRotTime * 1000
  23407. var timeEachItem = (2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed)) * 200 //预估时间假设每个item飞的时间(如果距离远就少了)
  23408. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)
  23409. var currentLocation0 = this.model.heroLocations[this.director.currentItem[0]]
  23410. //zeg 标注一下
  23411. //var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  23412. var rotTime
  23413. if (currentLocation.rotTime == void 0 || currentLocation.rotTime == '') {
  23414. var restChildCount = currentLocation0.heroLocations ? currentLocation0.heroLocations.length - this.director.currentItem[1] - 1 : 0
  23415. var hasMusic = currentLocation0 && currentLocation0.musicInfo.music
  23416. if (hasMusic) {
  23417. var audioObj = SoundManager.list.find(e => e.name == 'tour')
  23418. var current = audioObj.audio.currentTime * 1e3 // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  23419. rotTime = currentLocation0.musicInfo.time - current
  23420. if (restChildCount) {
  23421. //如果当前folder中还有剩下的item,平分一下时间
  23422. rotTime = (rotTime - timeEachItem * restChildCount) / (restChildCount + 1)
  23423. }
  23424. } else {
  23425. rotTime = defaultRotTime
  23426. }
  23427. rotTime = Math.max(0, rotTime)
  23428. Log('rotTime ' + rotTime + ' at item ' + this.director.currentItem + (hasMusic ? ',musicCurrentTime:' + current + '音乐总长:' + currentLocation0.musicInfo.time : ''), '#E8E')
  23429. } else {
  23430. rotTime = currentLocation.rotTime * 1000
  23431. Log('rotTime ' + rotTime + ' at item ' + this.director.currentItem, '#E8E')
  23432. }
  23433. this.path.waitNextStep(
  23434. e,
  23435. function () {
  23436. t && t()
  23437. }.bind(this),
  23438. rotTime
  23439. )
  23440. }),
  23441. (n.prototype.stopInterlude = function () {
  23442. this.interruptAndFastForward(null, 0)
  23443. }),
  23444. (n.prototype.interruptAndFastForward = function (e, t) {
  23445. //Log('interruptAndFastForward' , '#f00')
  23446. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t), this.flying && this.emit(w.FlyingInterrupted), this.path.interruptAndFastForward(e, t)
  23447. }),
  23448. (n.prototype.setSize = function (e, t) {
  23449. var i = e / t
  23450. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t)
  23451. var n = B.getHFOVFromVFOV(f.insideFOV, e, t)
  23452. n > f.insideFOVMax ? (this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t)) : (this.baseFov = f.insideFOV)
  23453. for (var r in this.cameraControls.cameras) {
  23454. var o = this.cameraControls.cameras[r]
  23455. ;(o.fov = this.baseFov * (1 / this.zoomLevel)), o.updateAspect(i)
  23456. }
  23457. }),
  23458. (n.prototype.toJSON = function () {
  23459. var e = {}
  23460. return this.cameraControls.activeControl
  23461. ? ((e = this.cameraControls.activeControl.toJSON()),
  23462. (e.camera_mode = u.toInt(this.mode)),
  23463. this.isOutsideMode()
  23464. ? this.model.allFloorsVisible
  23465. ? (e.floor_visibility = [])
  23466. : (e.floor_visibility = this.model.floors.list.map(function (e) {
  23467. return e.hidden ? 0 : 1
  23468. }))
  23469. : u.PANORAMA && (e.scan_id = this.currentPano.id),
  23470. e)
  23471. : e
  23472. }),
  23473. (n.prototype.getCurrentNodePanos = function (e) {
  23474. this.model.panos.map
  23475. if (((e.length = 0), this.path.nodes)) {
  23476. var momentTour = this.director.getMomentTour(this.director.destinationItem)
  23477. if (momentTour == 'black') {
  23478. //改 upcomingPanos如果是black的只需要起点和终点
  23479. if (this.path.nodes.length) {
  23480. e.push(this.model.panos.get(this.path.nodes[0]))
  23481. }
  23482. if (this.path.nodes.length > 1) {
  23483. e.push(this.model.panos.get(this.path.nodes[this.path.nodes.length - 1]))
  23484. }
  23485. } else {
  23486. for (var t = 0; t < this.path.nodes.length; t++) {
  23487. var i = this.path.nodes[t]
  23488. e.push(this.model.panos.get(i))
  23489. }
  23490. }
  23491. }
  23492. }),
  23493. (n.prototype.zoomIncrementally = function (e) {
  23494. var t = this.zoomLevel
  23495. this.zoomTo(this.zoomLevel + e), t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  23496. }),
  23497. (n.prototype.zoomInIncrementally = function (e) {
  23498. ;(e = e || this.defaultZoomIncrement), this.zoomIncrementally(e)
  23499. }),
  23500. (n.prototype.zoomOutIncrementally = function (e) {
  23501. ;(e = e || -this.defaultZoomIncrement), this.zoomIncrementally(e)
  23502. }),
  23503. (n.prototype.zoomBy = function (e) {
  23504. this.zoomTo(this.zoomLevel * e)
  23505. }),
  23506. (n.prototype.zoomIn = function () {
  23507. this.zoomBy(1 + this.zoomSpeed)
  23508. }),
  23509. (n.prototype.zoomOut = function () {
  23510. this.zoomBy(1 - this.zoomSpeed)
  23511. }),
  23512. (n.prototype.zoomTo = function (e, t) {
  23513. if (t || (f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled)) {
  23514. if (
  23515. (e < f.zoom.min && (e = f.zoom.min),
  23516. e > f.zoom.max && (e = f.zoom.max),
  23517. e > this.zoomLevel ? (this.emit(O.ZoomIn), e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut), e === f.zoom.min && this.emit(O.ZoomMin)),
  23518. this.cameraControls.activeControl)
  23519. ) {
  23520. var i = this.cameraControls.activeControl.camera
  23521. ;(this.zoomLevel = e), (i.fov = this.baseFov * (1 / this.zoomLevel)), i.updateProjectionMatrix(), (this.zoomFov = i.fov)
  23522. }
  23523. }
  23524. }),
  23525. (n.prototype.increaseZoomSpeed = function () {
  23526. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  23527. }),
  23528. (n.prototype.decreaseZoomSpeed = function () {
  23529. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  23530. }),
  23531. (n.prototype.clampZoomSpeed = function (e) {
  23532. return e < 0 ? 0 : e
  23533. }),
  23534. (n.prototype.activatePersistentZooming = function (e) {
  23535. this.zooming = e ? 1 : -1
  23536. }),
  23537. (n.prototype.deactivatePersistentZooming = function () {
  23538. this.zooming = 0
  23539. }),
  23540. (n.prototype.zoomDefault = function () {
  23541. this.zoomTo(1, !0)
  23542. }),
  23543. (window.fovTranId = 333) //add
  23544. n.prototype.smoothZoomToDefault = function (e, t) {
  23545. y.cancelById(window.fovTranId)
  23546. var i,
  23547. n = this.zoomLevel,
  23548. r = function (e) {
  23549. e > 1 && (e = 1), (i = n * (1 - e) + e), this.zoomTo(i, !0)
  23550. }.bind(this),
  23551. o = function () {
  23552. this.zoomDefault(), t && window.setTimeout(t, 50)
  23553. }.bind(this)
  23554. y.start(r, e, o, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  23555. }
  23556. n.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {
  23557. //add
  23558. y.cancelById(window.fovTranId)
  23559. console.log('smoothZoomFovTo ' + zoomLevel)
  23560. var i,
  23561. n = this.zoomLevel,
  23562. aimLevel = zoomLevel || this.baseFov / fov
  23563. if (n == aimLevel) return
  23564. var fun = function (e) {
  23565. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel), this.zoomTo(i, !0)
  23566. }.bind(this)
  23567. y.start(fun, dur, callback, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  23568. }
  23569. n.prototype.updateZoomPano = function () {
  23570. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA && this.currentPano) {
  23571. let navTileClass = this.qualityManager.getNavZoomClass()
  23572. let tileClass = this.qualityManager.getMaxZoomClass()
  23573. if (navTileClass == '4k') {
  23574. var r = true
  23575. } else {
  23576. var levelThreshold1 = navTileClass == '1k' ? 1.1 : 1.5,
  23577. levelThreshold2 = 1.8 //levelThreshold2不能比zoom.max大也就是不能超过2,否则zoom.max将无法提升到3
  23578. var t = this.zoomLevel > levelThreshold1,
  23579. i = this.flying && this.nextPano && this.nextPano !== this.currentPano,
  23580. n = !i && !this.isWarping(),
  23581. r = t //&& n ; // 允许flying状态下加载4K图
  23582. }
  23583. this.tileDownloader.tilePrioritizer.setZoomingActive(r), this.panoRenderer.setZoomingActive(r, this.currentPano, !0)
  23584. var o = function (pano, ifZoom) {
  23585. this.panoRenderer.resetRenderStatus(pano.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  23586. this.panoRenderer.clearAllQueuedUploadsForPano(pano.id),
  23587. this.panoRenderer.renderPanoTiles(pano.id, null, !1, !1),
  23588. pano.setZoomed(ifZoom)
  23589. }.bind(this)
  23590. if (navTileClass == '4k') {
  23591. if (!this.currentPano.zoomed) {
  23592. o(this.currentPano, !0)
  23593. this.panoRenderer.enableUltraHighQualityMode(
  23594. function () {
  23595. //开启4k getMaxZoomPanoSize
  23596. this.qualityManager.useUltraHighResolutionPanos && (f.zoom.max = D.ultraHighQualityMaxZoom)
  23597. o(this.currentPano, !0)
  23598. }.bind(this)
  23599. )
  23600. }
  23601. } else {
  23602. let zoomLevelRes = this.qualityManager.zoomLevelResolution
  23603. if (r && (!this.currentPano.zoomed || (zoomLevelRes && zoomLevelRes != '4k'))) {
  23604. //needZoom
  23605. this.currentPano.zoomed || o(this.currentPano, !0)
  23606. if (navTileClass == '1k' && tileClass != '1k' && this.zoomLevel < levelThreshold2) {
  23607. this.panoRenderer.enableHighQuality(
  23608. function () {
  23609. //开启2k
  23610. if (tileClass != '4k') {
  23611. o(this.currentPano, !0)
  23612. }
  23613. }.bind(this)
  23614. )
  23615. } else {
  23616. this.panoRenderer.enableUltraHighQualityMode(
  23617. function () {
  23618. //开启4k getMaxZoomPanoSize
  23619. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom)
  23620. o(this.currentPano, !0)
  23621. }.bind(this)
  23622. )
  23623. }
  23624. } else {
  23625. !t && this.currentPano.zoomed && o(this.currentPano, !1)
  23626. }
  23627. //有三个级别的话,需要标记zoomLevelResolution,以便更新maxZoomPanoSize判断能下载的最高级别
  23628. if (r && navTileClass == '1k' && tileClass == '4k') {
  23629. //目前只有手机端navTileClass == '1k'
  23630. var change = zoomedFlag => {
  23631. this.qualityManager.updateMaximums() //更新maxZoomPanoSize
  23632. this.panoRenderer.setupZoomRenderTarget() //更新renderTarget
  23633. //this.currentPano.setZoomed(t);//更新uniforms贴图
  23634. if (this.qualityManager.zoomLevelResolution == '4k') {
  23635. this.model.showHighMap()
  23636. } else {
  23637. this.model.hideHighMap()
  23638. }
  23639. }
  23640. this.qualityManager.zoomLevelResolution = this.zoomLevel >= levelThreshold2 ? '4k' : this.zoomLevel > levelThreshold1 ? '2k' : '1k'
  23641. if (this.oldZoomLevel < levelThreshold2 && this.zoomLevel >= levelThreshold2) {
  23642. //1k/2k-4k
  23643. change()
  23644. o(this.currentPano, t)
  23645. } else if (this.oldZoomLevel <= levelThreshold1 && this.zoomLevel > levelThreshold1) {
  23646. //1k-2k
  23647. change()
  23648. } else if (this.oldZoomLevel > levelThreshold2 && this.zoomLevel <= levelThreshold2) {
  23649. //4k-2k/1k
  23650. change()
  23651. o(this.currentPano, t)
  23652. } else if (this.oldZoomLevel > levelThreshold1 && this.zoomLevel <= levelThreshold1) {
  23653. //2k-1k
  23654. change()
  23655. }
  23656. this.oldZoomLevel = this.zoomLevel
  23657. }
  23658. }
  23659. }
  23660. }
  23661. ;(n.prototype.checkHasNeighbor = function (pano) {
  23662. //add
  23663. for (var i in pano.neighbourPanos) {
  23664. if (i == pano.id) continue
  23665. if (pano.neighbourPanos[i]) {
  23666. return true
  23667. }
  23668. }
  23669. }),
  23670. (t.exports = n)
  23671. }).call(this, '/js/player.js')
  23672. },
  23673. {
  23674. './constants': 8,
  23675. './enum/AlignmentType': 17,
  23676. './enum/BlackoutStyle': 18,
  23677. './enum/ControlEvents': 21,
  23678. './enum/Keys': 30,
  23679. './enum/ModelManagerEvents': 33,
  23680. './enum/PanoSizeClass': 36,
  23681. './enum/PanoramaEvents': 37,
  23682. './enum/PathDiscardMode': 38,
  23683. './enum/PathDisplayMode': 39,
  23684. './enum/PlayerEvents': 40,
  23685. './enum/TagStates': 44,
  23686. './enum/Vectors': 50,
  23687. './enum/Viewmode': 51,
  23688. './enum/WarpStyle': 52,
  23689. './enum/ZoomEvents': 53,
  23690. './exception/BasicException': 55,
  23691. './model/ModelManager': 140,
  23692. './objects/NSpider': 147,
  23693. './objects/Panorama': 148,
  23694. './objects/Reticule': 149,
  23695. './objects/ShowPath': 151,
  23696. './objects/Snapshot': 153,
  23697. './objects/View': 154,
  23698. './settings': 166,
  23699. './shaders': 167,
  23700. './tile/TileDownloader': 171,
  23701. './tile/TilePrioritizer': 172,
  23702. './util/ZoomStats': 179,
  23703. './util/browser': 182,
  23704. './util/camera': 183,
  23705. './util/cameraLight': 184,
  23706. './util/common': 185,
  23707. './util/easing': 186,
  23708. './util/history': 187,
  23709. './util/lerp': 188,
  23710. './util/logger': 189,
  23711. './util/math': 190,
  23712. './util/transitions': 195,
  23713. hot: 'hot',
  23714. scaleImg: 'scaleImg',
  23715. events: 202,
  23716. three: 217
  23717. }
  23718. ],
  23719. scaleImg: [
  23720. function (t, e) {
  23721. // xzw
  23722. var OUTPUT = e
  23723. ;(function () {
  23724. function t(t, a, i, r) {
  23725. function h() {
  23726. ;(B = 'object' == typeof i ? i : a.src || r ? u : document.createElement('canvas')), (B.width = s), (B.height = f), (G = B.getContext('2d'))
  23727. }
  23728. function n(t) {
  23729. if (t) {
  23730. var e,
  23731. a = G.getImageData(0, 0, s, f),
  23732. i = a.data
  23733. for (e = 0; at > e; e += 4) (i[e] = (t[e] * it) | 0), (i[e + 1] = (t[e + 1] * it) | 0), (i[e + 2] = (t[e + 2] * it) | 0), (i[e + 3] = (t[e + 3] * it) | 0)
  23734. return delete t, a
  23735. }
  23736. return G.getImageData(0, 0, s, f)
  23737. }
  23738. function o(t, e, a, i, r) {
  23739. return 0.5 * (i - e + (2 * e - 5 * a + 4 * i - r + (3 * (a - i) + r - e) * t) * t) * t + a
  23740. }
  23741. a || ((a = t.input), (i = t.output), (r = t.inputRemovable), t.scale && (t = t.scale))
  23742. var u, d
  23743. if (a.src)
  23744. if (((u = document.createElement('canvas')), null != a.naturalWidth)) (u.width = a.naturalWidth), (u.height = a.naturalHeight)
  23745. else if (null != a.runtimeStyle) {
  23746. var l = a.runtimeStyle,
  23747. c = l.width,
  23748. g = l.height
  23749. ;(l.width = 'auto'), (l.height = 'auto'), (u.width = a.width), (u.height = a.height), (l.width = c), (l.height = g)
  23750. } else {
  23751. var c = a.width,
  23752. g = a.height
  23753. a.removeAttribute && (a.removeAttribute('width'), a.removeAttribute('height')), (u.width = a.width), (u.height = a.height), (a.width = c), (a.height = g)
  23754. }
  23755. else u = a
  23756. ;(d = u.getContext('2d')), a.src && d.drawImage(a, 0, 0)
  23757. var s,
  23758. f,
  23759. m = u.width,
  23760. w = u.height,
  23761. p = d.getImageData(0, 0, m, w).data
  23762. if (!m || !w) return !1
  23763. ;(a.src || r) && u.clearRect(0, 0, m, w),
  23764. 'object' == typeof t
  23765. ? t.width
  23766. ? ((s = (t.width + 0.5) | 0), (f = (t.height + 0.5) | 0))
  23767. : ((s = (m * t.scaleX + 0.5) | 0), (f = (w * t.scaleY + 0.5) | 0))
  23768. : ((s = (t * m + 0.5) | 0), (f = (t * w + 0.5) | 0))
  23769. var v,
  23770. b,
  23771. y,
  23772. x,
  23773. D,
  23774. I,
  23775. A,
  23776. j,
  23777. R,
  23778. k,
  23779. C,
  23780. E,
  23781. F,
  23782. L,
  23783. S,
  23784. U,
  23785. W,
  23786. H,
  23787. alpha,
  23788. X,
  23789. Y,
  23790. q,
  23791. z,
  23792. B,
  23793. G,
  23794. J,
  23795. K,
  23796. M,
  23797. N,
  23798. O,
  23799. P,
  23800. Q,
  23801. T,
  23802. V,
  23803. Z,
  23804. $ = s << 2,
  23805. _ = m << 2,
  23806. tt = 0,
  23807. et = 0,
  23808. at = $ * f,
  23809. it = 255.99 / 255,
  23810. rt = s / m,
  23811. ht = f / w,
  23812. nt = rt * ht
  23813. if (rt > 1 || ht > 1)
  23814. for (h(), J = n(), K = J.data, x = 0; f > x; x++)
  23815. for (b = x / ht, R = 0 | b, q = b - R, N = R * _, M = 1 > R ? N : N - _, w - 2 > R ? ((O = N + _), (P = (R + 2) * _)) : (O = P = R > w - 2 ? N : N + _), y = 0; s > y; y++, et += 4)
  23816. (v = y / rt),
  23817. (j = 0 | v),
  23818. (z = v - j),
  23819. (T = j << 2),
  23820. (Q = 1 > j ? T : T - 4),
  23821. m - 2 > j ? ((V = T + 4), (Z = T + 8)) : (V = Z = j > m - 2 ? T : T + 4),
  23822. (H =
  23823. (o(
  23824. q,
  23825. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  23826. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  23827. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  23828. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  23829. ) *
  23830. it) |
  23831. 0),
  23832. ++Q,
  23833. ++T,
  23834. ++V,
  23835. ++Z,
  23836. (X =
  23837. (o(
  23838. q,
  23839. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  23840. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  23841. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  23842. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  23843. ) *
  23844. it) |
  23845. 0),
  23846. ++Q,
  23847. ++T,
  23848. ++V,
  23849. ++Z,
  23850. (Y =
  23851. (o(
  23852. q,
  23853. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  23854. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  23855. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  23856. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  23857. ) *
  23858. it) |
  23859. 0),
  23860. ++Q,
  23861. ++T,
  23862. ++V,
  23863. ++Z,
  23864. (alpha =
  23865. (o(
  23866. q,
  23867. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  23868. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  23869. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  23870. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  23871. ) *
  23872. it) |
  23873. 0),
  23874. (K[et] = H >= 0 ? (256 > H ? H : 255) : 0),
  23875. (K[et + 1] = X >= 0 ? (256 > X ? X : 255) : 0),
  23876. (K[et + 2] = Y >= 0 ? (256 > Y ? Y : 255) : 0),
  23877. (K[et + 3] = alpha >= 0 ? (256 > alpha ? alpha : 255) : 0)
  23878. else {
  23879. if (e.Float32Array) W = new Float32Array(at)
  23880. else for (W = [], et = 0; at > et; ++et) W[et] = 0
  23881. for (b = 0; w > b; b++)
  23882. for (x = b * ht, A = 0 | x, D = A * $, U = !!((A - ((x + ht) | 0)) * (w - 1 - b)) << 1, U && ((F = A + 1 - x), (L = x + ht - A - 1)), v = 0; m > v; v++, tt += 4)
  23883. switch (
  23884. ((y = v * rt),
  23885. (I = 0 | y),
  23886. (et = D + (I << 2)),
  23887. (S = !!((I - ((y + rt) | 0)) * (m - 1 - v))),
  23888. S && ((C = I + 1 - y), (E = y + rt - I - 1)),
  23889. (H = p[tt]),
  23890. (X = p[tt + 1]),
  23891. (Y = p[tt + 2]),
  23892. (alpha = p[tt + 3]),
  23893. S + U)
  23894. ) {
  23895. case 0:
  23896. ;(W[et] += H * nt), (W[et + 1] += X * nt), (W[et + 2] += Y * nt), (W[et + 3] += alpha * nt)
  23897. break
  23898. case 1:
  23899. ;(k = C * ht),
  23900. (W[et] += H * k),
  23901. (W[et + 1] += X * k),
  23902. (W[et + 2] += Y * k),
  23903. (W[et + 3] += alpha * k),
  23904. (k = E * ht),
  23905. (W[et + 4] += H * k),
  23906. (W[et + 5] += X * k),
  23907. (W[et + 6] += Y * k),
  23908. (W[et + 7] += alpha * k)
  23909. break
  23910. case 2:
  23911. ;(k = rt * F),
  23912. (W[et] += H * k),
  23913. (W[et + 1] += X * k),
  23914. (W[et + 2] += Y * k),
  23915. (W[et + 3] += alpha * k),
  23916. (k = rt * L),
  23917. (et += $),
  23918. (W[et] += H * k),
  23919. (W[et + 1] += X * k),
  23920. (W[et + 2] += Y * k),
  23921. (W[et + 3] += alpha * k)
  23922. break
  23923. default:
  23924. ;(k = C * F),
  23925. (W[et] += H * k),
  23926. (W[et + 1] += X * k),
  23927. (W[et + 2] += Y * k),
  23928. (W[et + 3] += alpha * k),
  23929. (k = E * F),
  23930. (W[et + 4] += H * k),
  23931. (W[et + 5] += X * k),
  23932. (W[et + 6] += Y * k),
  23933. (W[et + 7] += alpha * k),
  23934. (k = C * L),
  23935. (et += $),
  23936. (W[et] += H * k),
  23937. (W[et + 1] += X * k),
  23938. (W[et + 2] += Y * k),
  23939. (W[et + 3] += alpha * k),
  23940. (k = E * L),
  23941. (W[et + 4] += H * k),
  23942. (W[et + 5] += X * k),
  23943. (W[et + 6] += Y * k),
  23944. (W[et + 7] += alpha * k)
  23945. }
  23946. delete p, h(), (J = n(W))
  23947. }
  23948. if ((G.putImageData(J, 0, 0), 'string' == typeof i)) {
  23949. if ('png' === i || 'jpeg' === i) {
  23950. var ot
  23951. return (ot = r && a.src ? a : new Image()), (ot.width = s), (ot.height = f), (ot.src = B.toDataURL('image/' + i, 0.85)), ot
  23952. }
  23953. if ('png-src' === i || 'jpeg-src' === i) return B.toDataURL('image/' + i.split('-')[0], 0.85)
  23954. }
  23955. return B
  23956. }
  23957. var e = this
  23958. 'undefined' != typeof exports ? ('undefined' != typeof module && module.exports && (exports = module.exports = t), (exports.scale = t)) : (c = t)
  23959. }).call(this)
  23960. OUTPUT.exports = c
  23961. },
  23962. {}
  23963. ],
  23964. 156: [
  23965. function (e, t, i) {
  23966. ;(function (i) {
  23967. 'use strict'
  23968. function n(e, t) {
  23969. ;(this.model = e), (this.panos = e.panos), (this.player = t), (this.imagePanos = this.listImagePanos()), (this.retryMinimumTime = 1e4)
  23970. }
  23971. var r = (e('three'), e('./enum/Viewmode')),
  23972. o = (e('./settings'), e('./objects/Panorama')),
  23973. a = e('./util/logger'),
  23974. s = new a(i)
  23975. ;(n.prototype.start = function () {
  23976. this.loadNextPano(
  23977. function (e) {
  23978. e
  23979. ? this.start()
  23980. : (s.debug('No suitable pano loaded, waiting a little while before looking again'),
  23981. setTimeout(
  23982. function () {
  23983. this.start()
  23984. }.bind(this),
  23985. 1e3
  23986. ))
  23987. }.bind(this)
  23988. )
  23989. }),
  23990. (n.prototype.validLoadTarget = function (e) {
  23991. return e && !e.isLoaded('high') && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  23992. }),
  23993. (n.prototype.listImagePanos = function () {
  23994. var e = [],
  23995. t = this
  23996. return (
  23997. this.model.images.forEach(function (i) {
  23998. if (i.metadata && i.metadata.scan_id) {
  23999. var n = t.model.panos.get(i.metadata.scan_id)
  24000. n && !n.isLoaded('high') && e.push(n)
  24001. }
  24002. }),
  24003. e
  24004. )
  24005. }),
  24006. (n.prototype.nextNotLoadedImage = function () {
  24007. for (; this.imagePanos.length > 0; ) {
  24008. var e = this.imagePanos[0]
  24009. if (!e.isLoaded('high')) return e
  24010. this.imagePanos.shift()
  24011. }
  24012. return null
  24013. }),
  24014. (n.prototype.loadNextPano = function (e) {
  24015. var t,
  24016. i,
  24017. n = this.model.waitQueue.filter(function (e) {
  24018. return e.object instanceof o
  24019. })
  24020. n.length > 0
  24021. ? ((t = n[0].object), s.debug('Overrode pano selection: Flying to an unloaded pano ' + t.id))
  24022. : this.validLoadTarget(this.player.currentPano)
  24023. ? ((t = this.player.currentPano), s.debug('Overrode pano selection: Currently at an unloaded pano ' + t.id))
  24024. : this.validLoadTarget(this.player.closestPano)
  24025. ? ((t = this.player.closestPano), s.debug('Overrode pano selection: Hovering over an unloaded pano ' + t.id))
  24026. : this.validLoadTarget(this.nextNotLoadedImage())
  24027. ? ((i = 'high'), (t = this.imagePanos[0]), s.debug('Overrode pano selection: Highlight image ' + t.id))
  24028. : this.player.mode === r.PANORAMA &&
  24029. ((t = this.panos.lowestByScore(
  24030. [this.validLoadTarget.bind(this), o.filters.isNeighbourPanoTo(this.player.currentPano)],
  24031. [
  24032. o.scoreFunctions.distance(this.player.currentPano),
  24033. o.scoreFunctions.direction(this.player.position, this.player.getDirection()),
  24034. o.scoreFunctions.inFieldOfView(this.player.position, this.player.getDirection())
  24035. ]
  24036. )),
  24037. t && s.debug('Normal pano selection: neighbor ' + t.id)),
  24038. t
  24039. ? ((i = i || t.isLoaded('low') ? 'high' : 'low'),
  24040. s.debug('Preloading ' + i + '-res pano ' + t.id),
  24041. t
  24042. .loadCube(i)
  24043. .done(e)
  24044. .fail(function () {
  24045. s.warn('Failed preloading pano', t.id, ', marking it as failed and forgetting it for a while'), e()
  24046. }))
  24047. : e && e(null)
  24048. }),
  24049. (t.exports = n)
  24050. }).call(this, '/js/preloaders.js')
  24051. },
  24052. {
  24053. './enum/Viewmode': 51,
  24054. './objects/Panorama': 148,
  24055. './settings': 166,
  24056. './util/logger': 189,
  24057. three: 217
  24058. }
  24059. ],
  24060. 157: [
  24061. function (e, t, i) {
  24062. ;(function (i) {
  24063. 'use strict'
  24064. function n(e, t, i, n, r) {
  24065. ;(this.qualityManager = e),
  24066. (this.scene = t),
  24067. (this.camera = i),
  24068. (this.container = r),
  24069. (this.controls = n),
  24070. (this.controls.enabled = !0),
  24071. (this.controls.locked = !0),
  24072. (this.quickstartCamera = n.camera),
  24073. (this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $('#player').width(), $('#player').height())),
  24074. (this.skybox = null)
  24075. }
  24076. var r = e('three'),
  24077. o = e('../util/logger'),
  24078. a = e('../constants'),
  24079. s = (e('../util/transitions'), e('../util/lerp'), e('../util/easing'), e('../enum/Vectors')),
  24080. l = e('../enum/PanoSizeClass'),
  24081. c = (e('../materials/ModelTextureMaterial'), e('../materials/CubemapMaterial')),
  24082. h = (e('../cameras/PanoramaCamera'), e('../controls/PanoramaControls'), e('../tile/TileUtils'), e('../util/camera'), e('../util/cameraLight')),
  24083. u = (e('../util/browser'), e('../settings'), e('../gui/helpManager'), new o(i))
  24084. ;(n.prototype.load = function (e) {
  24085. e.pano.shouldRedrawOnBaseLoaded = !0
  24086. var t,
  24087. i,
  24088. n = this,
  24089. r = s.FORWARD.clone().applyQuaternion(e.quaternion),
  24090. o = r.clone().negate()
  24091. this.controls.lookAt(r.add(this.quickstartCamera.position))
  24092. var a = this.qualityManager.getPanoSize(l.BASE),
  24093. c = this.qualityManager.getPanoSize(l.STANDARD)
  24094. if (e.pano.tiled) {
  24095. u.warn('Loading startPano, TILED', e.pano.id)
  24096. var d = h.getHFOVForCamera(this.quickstartCamera, $('#player').width(), $('#player').height()),
  24097. p = this.quickstartCamera.fov
  24098. u.warn('Quickstart loading tiles in frustum: [horizontal FOV: ' + d + ', vertical FOV: ' + p + ']'),
  24099. (t = e.pano.loadTiledPano(
  24100. c,
  24101. r,
  24102. {
  24103. hFov: d,
  24104. vFov: p
  24105. },
  24106. !1,
  24107. !1,
  24108. !0
  24109. )),
  24110. (i = e.pano.loadTiledPano(a, o, null, !1, !1, !0))
  24111. } else u.warn('Loading startPano', e.pano.id), (t = e.pano.loadCube('high'))
  24112. return $.when(t).then(
  24113. function () {
  24114. n.init(e.pano, e.quaternion),
  24115. e.pano.tiled
  24116. ? i.done(
  24117. function () {
  24118. ;(e.pano.lockUntilRenderingComplete = !1), (this.controls.locked = !1)
  24119. }.bind(this)
  24120. )
  24121. : (this.controls.locked = !1)
  24122. }.bind(this)
  24123. )
  24124. }),
  24125. (n.prototype.init = function (e, t) {
  24126. u.info('Quickstart done loading, adding scene objects'),
  24127. (e.lockUntilRenderingComplete = !0),
  24128. (this.skybox = new r.Mesh(
  24129. new r.CubeGeometry(1, 1, 1),
  24130. new c({
  24131. side: r.BackSide
  24132. })
  24133. )),
  24134. (this.skybox.material.uniforms.map.value = e.getSkyboxTexture()),
  24135. this.skybox.quaternion.copy(e.quaternion),
  24136. this.scene.add(this.skybox),
  24137. $(this.container).show()
  24138. }),
  24139. (n.prototype.update = function (e) {
  24140. this.controls.update(e), this.camera.copy(this.quickstartCamera)
  24141. }),
  24142. (n.prototype.setSize = function (e, t) {
  24143. this.quickstartCamera.updateAspect(e / t)
  24144. }),
  24145. (n.prototype.destroy = function () {
  24146. this.scene.remove(this.skybox)
  24147. }),
  24148. (t.exports = n)
  24149. }).call(this, '/js/scene/QuickstartManager.js')
  24150. },
  24151. {
  24152. '../cameras/PanoramaCamera': 7,
  24153. '../constants': 8,
  24154. '../controls/PanoramaControls': 13,
  24155. '../enum/PanoSizeClass': 36,
  24156. '../enum/Vectors': 50,
  24157. '../gui/helpManager': 68,
  24158. '../materials/CubemapMaterial': 117,
  24159. '../materials/ModelTextureMaterial': 118,
  24160. '../settings': 166,
  24161. '../tile/TileUtils': 174,
  24162. '../util/browser': 182,
  24163. '../util/camera': 183,
  24164. '../util/cameraLight': 184,
  24165. '../util/easing': 186,
  24166. '../util/lerp': 188,
  24167. '../util/logger': 189,
  24168. '../util/transitions': 195,
  24169. three: 217
  24170. }
  24171. ],
  24172. 158: [
  24173. function (e, t, i) {
  24174. 'use strict'
  24175. function n(e, t, i) {
  24176. ;(this.scene = e),
  24177. (this.camera = t),
  24178. (this.renderer = null),
  24179. (this.effects = i),
  24180. (this.animateCallback = null),
  24181. (this.composer = null),
  24182. (this.qualityManager = null),
  24183. (e.renderWidth = 0),
  24184. (e.renderHeight = 0),
  24185. (this.updateClock = new r.Clock()),
  24186. (this.components = []),
  24187. (this.updateListeners = []),
  24188. (this.resizeListeners = []),
  24189. (this.forceUpdateSize = !1),
  24190. (this.started = !1),
  24191. (this.textures = {}),
  24192. (this.suspendedObjects = [])
  24193. }
  24194. var r = e('three'),
  24195. o = e('../shaders'),
  24196. a = e('../enum/SceneRendererEvents'),
  24197. s = e('../enum/GLTextureType'),
  24198. l = e('../enum/GLCubeFaces'),
  24199. c = e('../exception/BasicException'),
  24200. h = e('../exception/RendererCreationException'),
  24201. /**********************************************************************fyz改 from徐世廷**********************************************************************/
  24202. m = e('../util/browser'),
  24203. /**************************************************************************************************************************************************/
  24204. u = e('../settings'),
  24205. d = e('events').EventEmitter
  24206. ;(window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame),
  24207. (n.prototype = Object.create(d.prototype)),
  24208. (n.prototype.addComponent = function (e) {
  24209. this.components.push(e), e.update && this.updateListeners.push(e), e.setSize && (this.resizeListeners.push(e), (this.forceUpdateSize = !0))
  24210. }),
  24211. (n.prototype.removeComponent = function (e) {
  24212. var t = function (t) {
  24213. return t !== e
  24214. }
  24215. ;(this.components = this.components.filter(t)), (this.updateListeners = this.updateListeners.filter(t)), (this.resizeListeners = this.resizeListeners.filter(t))
  24216. }),
  24217. (n.prototype.start = function (e) {
  24218. if (this.started) throw new c("Can't start SceneRenderer, already started")
  24219. this.createContext(e),
  24220. /***************************************************VR fyz改 from徐世廷**********************************************************************/
  24221. /* m.isMobile() && */ this.boluoVrInit(),
  24222. /*******************************************************************************************************************************/
  24223. this.initComposer(),
  24224. (this.started = !0),
  24225. (p = p.bind(this))()
  24226. }),
  24227. (n.prototype.createContext = function (e) {
  24228. var transparent = !!(settings.transparentBg || settings.bgImg)
  24229. try {
  24230. ;(this.renderer = new r.WebGLRenderer({ antialias: !m.isMobile(), alpha: transparent })),
  24231. (this.renderer.autoClear = !0),
  24232. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  24233. this.renderer.setSize($('#player').width(), $('#player').height(), false), //改
  24234. transparent && this.renderer.setClearColor(0x000000, 0) //透明
  24235. this.emit(a.ContextCreated)
  24236. } catch (e) {
  24237. throw new h('Unable to create a WebGL rendering context')
  24238. }
  24239. u.profiling.enabled && this.overrideTextures(), e.appendChild(this.renderer.domElement)
  24240. /* window.stats = new Stats();
  24241. e.appendChild( stats.dom ); */
  24242. }),
  24243. (n.prototype.overrideTextures = function () {
  24244. var e = this.renderer.context,
  24245. t = 0,
  24246. i = e.createTexture
  24247. e.createTexture = function () {
  24248. var n = i.call(e)
  24249. return (n.id = t++), (this.textures[n.id] = n), n
  24250. }.bind(this)
  24251. var n = e.texImage2D
  24252. e.texImage2D = function (t, i, r, o, a, l, c, h, u) {
  24253. var d,
  24254. p = this.getTextureTypeFromTarget(e, t)
  24255. ;(d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D)),
  24256. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : ((c = o), (h = a), (u = l), (o = u.naturalWidth), (a = u.naturalHeight), n.call(e, t, i, r, c, h, u))
  24257. var f = this.textures[d.id]
  24258. ;(f.width = p === s.TextureCube ? 6 * o : o), (f.height = a)
  24259. }.bind(this)
  24260. var r = e.deleteTexture
  24261. e.deleteTexture = function (t) {
  24262. delete this.textures[t.id], r.call(e, t)
  24263. }.bind(this)
  24264. }),
  24265. (n.prototype.updateTextureMemory = (function () {
  24266. var e = null
  24267. return function () {
  24268. var t = 0
  24269. for (var i in this.textures) {
  24270. var n = this.textures[i]
  24271. n.width && n.height && (t += n.width * n.height * 4)
  24272. }
  24273. t !== e && this.emit(a.MemoryUsageUpdated, t), (e = t)
  24274. }
  24275. })()),
  24276. (n.prototype.getTextureTypeFromTarget = function (e, t) {
  24277. switch (t) {
  24278. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  24279. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  24280. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  24281. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24282. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  24283. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24284. return s.TextureCube
  24285. case e.TEXTURE_2D:
  24286. return s.Texture2D
  24287. default:
  24288. return null
  24289. }
  24290. }),
  24291. (n.prototype.initComposer = function () {
  24292. ;(this.composer = new r.EffectComposer(this.renderer)),
  24293. this.composer.addPass(new r.RenderPass(this.scene, this.camera)),
  24294. //this.composer.addPass(this.effects.hblurPass),
  24295. //this.composer.addPass(this.effects.vblurPass)
  24296. this.composer.addPass(this.effects.fastTranMaskPass) //add
  24297. }),
  24298. (n.prototype.setSize = function (e, t, devicePixelRatio) {
  24299. ;(this.renderWidth = e),
  24300. (this.renderHeight = t),
  24301. (this.effects.aspect = e / t),
  24302. /* this.renderer.setSize(e, t), -----MP */
  24303. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  24304. this.composer.setSize(e, t)
  24305. for (var i = 0; i < this.resizeListeners.length; i++) this.resizeListeners[i].setSize(e, t)
  24306. }),
  24307. (n.prototype.render = function () {
  24308. //this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24309. this.effects.fastTranMaskPass.enabled ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24310. })
  24311. /******************************************************************************************************徐世廷**********************************************************************/
  24312. var vrPermission = {}
  24313. var vrPermissionCallBack = function (info1, info2) {
  24314. if (info1 == 'reset') {
  24315. vrPermission = {}
  24316. } else {
  24317. vrPermission[info1] = info2
  24318. if (Object.keys(vrPermission).length == 2 && (vrPermission.deviceMotion != 'granted' || vrPermission.deviceOrientation != 'granted')) {
  24319. alert('运动和方向访问失败。这会导致画面视角一直固定。您需要完全关闭此应用,然后再次打开,并允许访问运动与方向。')
  24320. }
  24321. }
  24322. }
  24323. ;(n.prototype.boluoVrInit = function () {
  24324. console.log('boluoVrInit')
  24325. //webxr.init(this.renderer)
  24326. ;(this.isHuawei5X = m.detectHUAWEI5X()), (this.oldRenderer = this.renderer), (this.newRenderer = new this.vrRenderer(this.renderer, this, this.camera))
  24327. window.panoCamera = this.camera
  24328. var a = this
  24329. ;(window._vrEnabled = !1),
  24330. Object.defineProperty(window, 'vrEnabled', {
  24331. get: function () {
  24332. return window._vrEnabled
  24333. },
  24334. set: function (b) {
  24335. //if(webxr.xrType)return webxr.enterVR()
  24336. b = !!b
  24337. b
  24338. ? ((a.renderer = a.newRenderer),
  24339. window.vrMarkers.forEach(function (a) {
  24340. a.visible = !0
  24341. }))
  24342. : ((a.renderer = a.oldRenderer),
  24343. window.vrMarkers.forEach(function (a) {
  24344. a.visible = !1
  24345. })),
  24346. (a.cursor.visible = b),
  24347. a.setSize(window.innerWidth, window.innerHeight)
  24348. window._vrEnabled = b
  24349. $('.cad').css('visibility', b ? 'hidden' : '')
  24350. b ? browser.requestFullscreen(document.body) : browser.exitFullscreen()
  24351. a.setSizeFitGlass()
  24352. setTimeout(() => {
  24353. console.log('ch', document.body.clientWidth, document.body.clientHeight, window.innerWidth, window.innerHeight) //全屏后得到的才准确
  24354. a.setSizeFitGlass()
  24355. }, 600)
  24356. if (b) {
  24357. setTimeout(function () {
  24358. console.log('orientEnable' + window.orientEnable)
  24359. if (window.vrEnabled && !window.orientEnable) {
  24360. //很可能没能触发陀螺仪事件
  24361. if (m.detectIOS() /* && m.detectSafari() */) {
  24362. var b = m.iosVersion() //{major: 10, minor: 3, patch: 1}
  24363. console.log('开始获取权限 major' + b.major)
  24364. if (b.major == 12 && b.minor >= 2) {
  24365. if (browser.detectSafari()) alert('浏览器未能检测到转动。为完整体验VR效果,请打开 “设置” > “Safari” > “隐私和安全” 下的 “运动和方向访问” 开关,然后刷新此页面。')
  24366. else {
  24367. //app??
  24368. alert('浏览器未能检测到转动。请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。')
  24369. }
  24370. } else if (b.major >= 13) {
  24371. if (!window.location.href.includes('https://')) {
  24372. console.log('需要https')
  24373. alert('当前网页下,高于ios12的浏览器版本可能不支持陀螺仪开启。')
  24374. return
  24375. }
  24376. var hasFailed = window.vrPermission && (window.vrPermission.deviceMotion != 'granted' || window.vrPermission.deviceOrientation != 'granted')
  24377. setTimeout(
  24378. () => {
  24379. //如果使用了alert会阻断这个事件,报以下错requusting device orientation or motion access requires a user gesture
  24380. if (!window.vrEnabled || window.orientEnable) return
  24381. vrPermissionCallBack('reset')
  24382. console.log(window.DeviceMotionEvent)
  24383. if (window.DeviceMotionEvent && window.DeviceMotionEvent.requestPermission && typeof window.DeviceMotionEvent.requestPermission === 'function') {
  24384. console.log('开始获取权限1')
  24385. ///注意:需要https 本地服务器permissionState会得到denied
  24386. window.DeviceMotionEvent.requestPermission()
  24387. .then(permissionState => {
  24388. console.log('permissionState1: ' + permissionState)
  24389. vrPermissionCallBack('deviceMotion', permissionState)
  24390. })
  24391. .catch(function (e) {
  24392. vrPermissionCallBack('deviceMotion', false)
  24393. console.log(e)
  24394. })
  24395. } else {
  24396. console.log('window.DeviceMotionEvent undefined')
  24397. vrPermissionCallBack('deviceMotion', false)
  24398. }
  24399. if (window.DeviceOrientationEvent && window.DeviceOrientationEvent.requestPermission && typeof window.DeviceOrientationEvent.requestPermission === 'function') {
  24400. console.log('开始获取权限2')
  24401. window.DeviceOrientationEvent.requestPermission()
  24402. .then(permissionState => {
  24403. console.log('permissionState2: ' + permissionState)
  24404. vrPermissionCallBack('deviceOrientation', permissionState)
  24405. })
  24406. .catch(function (e) {
  24407. vrPermissionCallBack('deviceOrientation', false)
  24408. console.log(e)
  24409. })
  24410. } else {
  24411. console.log('window.DeviceOrientationEvent undefined')
  24412. vrPermissionCallBack('deviceOrientation', false)
  24413. }
  24414. },
  24415. hasFailed ? 0 : 150
  24416. )
  24417. /* /* setTimeout(function(){
  24418. if(settings.vrEnabled && !window.orientEnable){
  24419. $alert("若画面视角一直固定,您需要完全关闭Safari浏览器,然后再次打开以开启运动和方向访问。")
  24420. }
  24421. },4000) */
  24422. } else console.log('陀螺仪未能启用 ios ' + b.major + '.' + b.minor)
  24423. } else {
  24424. //$alert("浏览器未能检测到转动", "请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24425. }
  24426. } else {
  24427. //已经触发了
  24428. }
  24429. }, 200)
  24430. } else {
  24431. if (player.mode == 'panorama') {
  24432. //xzw add
  24433. player.cameraControls.controls.panorama.endRotation()
  24434. }
  24435. }
  24436. }
  24437. }),
  24438. this.createCursor(0.5, !1, 1, 16777215, 0)
  24439. var b = {
  24440. setSize: function (b, c) {
  24441. a.camera.aspect = b / c
  24442. }
  24443. }
  24444. this.resizeListeners.push(b), this.vrLoadingInit()
  24445. document.addEventListener('fullscreenchange', e => {
  24446. this.setSizeFitGlass()
  24447. })
  24448. }),
  24449. (n.prototype.vrLoadingInit = function () {
  24450. var a = function (camera) {
  24451. var a = this,
  24452. b = new r.RingGeometry(1.3, 1.5, 32, 32, 0, 1.2 * Math.PI),
  24453. c = new r.MeshBasicMaterial({
  24454. color: 4967932,
  24455. side: r.DoubleSide
  24456. }),
  24457. d = new r.Mesh(b, c)
  24458. ;(this.mesh = d),
  24459. (d.position.z = -2),
  24460. d.scale.set(0.08, 0.08, 0.08),
  24461. (d.visible = !1),
  24462. camera.add(d),
  24463. //window.player.camera.add(d),
  24464. (a.enabled = !1),
  24465. (this.update = function (b) {
  24466. 1 == a.enabled && (d.rotation.z += 15 * b)
  24467. })
  24468. },
  24469. a = new a(this.camera)
  24470. ;(window.Loading = a), this.updateListeners.push(a)
  24471. }),
  24472. (n.prototype.createCursor = function (a, b, c, d, e) {
  24473. var g,
  24474. h = new r.SpriteMaterial({
  24475. opacity: c,
  24476. color: d,
  24477. transparent: b,
  24478. map: this.boluoGetTexture('images/cursor.png'),
  24479. needsUpdate: !0,
  24480. side: r.DoubleSide
  24481. })
  24482. ;(h.map.offset = new r.Vector2((1 / 17) * e, 0)),
  24483. (h.map.repeat = new r.Vector2(1 / 17, 1)),
  24484. (h.depthTest = !1),
  24485. (h.blending = r.AdditiveBlending),
  24486. (g = new r.Sprite(h)),
  24487. // g.scale.set(a, a, a),
  24488. g.scale.set(0.3, 0.3, 0.3)
  24489. ;(g.position.z = -2), (g.visible = !1), (g.name = 'cursor'), this.camera.add(g), this.scene.add(this.camera), (this.cursor = g)
  24490. var i = new this.CursorAnimation(this.scene, g, this.camera)
  24491. ;(this.cursor.triggerTargetEvent = i.triggerTargetEvent), this.updateListeners.push(i)
  24492. })
  24493. ;(n.prototype.setSizeFitGlass = function () {
  24494. //add 现在大多数手机过长,可能超出眼镜范围,导致看不全眩晕。另外注意调节和镜头的距离。
  24495. let verti = window.orientation == 0 || window.orientation == 180 //竖屏
  24496. console.log('setSizeFitGlass')
  24497. if (document.fullscreenElement && !verti && window.vrEnabled && !browser.isMobile()) {
  24498. let longW = Math.max(document.body.clientWidth, document.body.clientHeight)
  24499. let shortW = Math.min(document.body.clientWidth, document.body.clientHeight)
  24500. const hopeRatio = 1.84 //因为无法知道手机长度,只能估计,若长宽比较大,很可能过长,所以缩短点。
  24501. let r = longW / shortW
  24502. if (r > hopeRatio) {
  24503. let w = shortW * hopeRatio
  24504. window.player.domElement.style.width = w + 'px' //缩短
  24505. window.player.domElement.style.transform = `translate(${(longW - w) * 0.5}px,0)` //居中。但我手机荣耀自带浏览器会向右多偏移一些不知为何
  24506. }
  24507. } else {
  24508. window.player.domElement.style.width = ''
  24509. window.player.domElement.style.transform = ''
  24510. }
  24511. }),
  24512. (window.orientEnable = 0) //是否能触发deviceorientation
  24513. ;(n.prototype.CursorAnimation = function (a, b, c) {
  24514. function d() {
  24515. g.orient = r.Math.degToRad(window.orientation || 0)
  24516. player.sceneRenderer.setSizeFitGlass()
  24517. }
  24518. function e(a) {
  24519. if (!window.vrEnabled && window.orientEnable) return
  24520. window.orientEnable || (window.orientEnable = 1)
  24521. var b = r.Math.degToRad(a.alpha),
  24522. c = r.Math.degToRad(a.beta),
  24523. d = r.Math.degToRad(a.gamma)
  24524. if (
  24525. (this.isHuawei5X
  24526. ? (-1e3 === g.alpha && (g.alpha = b),
  24527. -1e3 === g.beta && (g.beta = c),
  24528. -1e3 === g.gamma && (g.gamma = d),
  24529. Math.abs(b - g.alpha) > 0.06 && (g.alpha = b),
  24530. Math.abs(c - g.beta) > 0.006 && (g.beta = c),
  24531. Math.abs(d - g.gamma) > 0.006 && (g.gamma = d))
  24532. : ((g.alpha = b), (g.beta = c), (g.gamma = d)),
  24533. n.vrDebug)
  24534. ) {
  24535. $('#info-device-orientation').css('display', 'block')
  24536. var e = ''
  24537. ;(e += 'alpha=(' + g.alpha + ')<BR/>'), (e += 'beta=(' + g.beta + ')<BR/>'), (e += 'gamma=' + g.gamma + '<BR/>'), (document.getElementById('info-device-orientation').innerHTML = e)
  24538. }
  24539. }
  24540. ;(this.cursor = b), (this.raycaster = new r.Raycaster()), (this.targetEventObj = {}), (this.type = 1), (this.tweenFlag = !0)
  24541. var g = this
  24542. ;(this.target = c),
  24543. console.log(c.uuid),
  24544. (this.euler = new r.Euler()),
  24545. (this.q0 = new r.Quaternion()),
  24546. (this.q1 = new r.Quaternion(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5))),
  24547. (this.zee = new r.Vector3(0, 0, 1)),
  24548. (this.alpha = -1e3),
  24549. (this.beta = -1e3),
  24550. (this.gamma = -1e3),
  24551. (this.orient = r.Math.degToRad(window.orientation || 0)),
  24552. window.addEventListener('orientationchange', d),
  24553. window.addEventListener('deviceorientation', e),
  24554. (this.setObjectQuaternion = function (a, b, d, e, f) {
  24555. if (b == -1000) return //防止打开就歪着
  24556. g.euler.set(d, b, -e, 'YXZ'), a.setFromEuler(g.euler), a.multiply(g.q1), a.multiply(g.q0.setFromAxisAngle(g.zee, -f)), c.updateMatrixWorld()
  24557. }),
  24558. parent !== window &&
  24559. window.addEventListener('message', function (a) {
  24560. var b = JSON.parse(a.data),
  24561. c = -1 !== window.navigator.userAgent.indexOf('KIW-TL00H')
  24562. b &&
  24563. b.alpha &&
  24564. b.beta &&
  24565. b.gamma &&
  24566. (function (a) {
  24567. var c = r.Math.degToRad(b.alpha),
  24568. d = r.Math.degToRad(b.beta),
  24569. e = r.Math.degToRad(b.gamma)
  24570. a
  24571. ? (-1e3 === g.alpha && (g.alpha = c),
  24572. -1e3 === g.beta && (g.beta = d),
  24573. -1e3 === g.gamma && (g.gamma = e),
  24574. Math.abs(c - g.alpha) > 0.06 && (g.alpha = c),
  24575. Math.abs(d - g.beta) > 0.006 && (g.beta = d),
  24576. Math.abs(e - g.gamma) > 0.006 && (g.gamma = e))
  24577. : ((g.alpha = c), (g.beta = d), (g.gamma = e))
  24578. })(c)
  24579. }),
  24580. (this.update = function (a) {
  24581. TWEEN.update()
  24582. if (window.vrEnabled) {
  24583. if (window.ifTest || !browser.isMobile()) this.triggerTargetEvent() //测试时不根据陀螺仪来转向
  24584. else {
  24585. this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient)
  24586. this.triggerTargetEvent()
  24587. }
  24588. }
  24589. }),
  24590. (this.triggerTargetEvent = function () {
  24591. var a = this.choseObj(),
  24592. b = a ? a.object : void 0
  24593. ;(this.targetEventObj.currentObj = b),
  24594. b !== this.targetEventObj.lastObj &&
  24595. (b && this.autoCursorPosition(a),
  24596. 1 === this.type
  24597. ? (this.cursorAnimate && this.cursorAnimate.stop(),
  24598. b &&
  24599. b.enabled &&
  24600. this.startAnimate(
  24601. function () {
  24602. this.clickCallback(b)
  24603. }.bind(this)
  24604. ))
  24605. : this.type,
  24606. (this.targetEventObj.lastObj = b))
  24607. }),
  24608. (this.choseObj = function () {
  24609. this.raycaster.setFromCamera(
  24610. {
  24611. x: 0,
  24612. y: 0
  24613. },
  24614. c
  24615. )
  24616. var a = (this.raycaster.ray, window.vrMarkers),
  24617. b = this.raycaster.intersectObjects(a)
  24618. if (b.length > 0) return b[0]
  24619. }),
  24620. (this.clickCallback = function (a) {
  24621. this.runTHREEAction(a, 'onclick')
  24622. }),
  24623. (this.runTHREEAction = function (a, b) {
  24624. switch (b) {
  24625. case 'onclick':
  24626. a._listeners &&
  24627. a._listeners.click &&
  24628. a._listeners.click.forEach(function (a) {
  24629. a()
  24630. })
  24631. break
  24632. case 'onhover':
  24633. a._listeners &&
  24634. a._listeners.hover &&
  24635. a._listeners.hover.forEach(function (a) {
  24636. a()
  24637. })
  24638. break
  24639. case 'onout':
  24640. a._listeners &&
  24641. a._listeners.out &&
  24642. a._listeners.out.forEach(function (a) {
  24643. a()
  24644. })
  24645. }
  24646. }),
  24647. (this.startAnimate = function (a) {
  24648. this.tweenFlag && this.initAnimation(a)
  24649. }),
  24650. (this.initAnimation = function (a) {
  24651. var b = this,
  24652. c = this.cursor.material.map.offset,
  24653. d = function (a) {
  24654. return Math.floor(17 * a) / 17
  24655. }
  24656. ;(b.tweenFlag = !1),
  24657. (this.cursorAnimate = new TWEEN.Tween(c)
  24658. .to(
  24659. {
  24660. x: 1
  24661. },
  24662. 1e3
  24663. )
  24664. .onStart(function () {
  24665. b.tweenFlag = !1
  24666. })
  24667. .onStop(function () {
  24668. ;(b.tweenFlag = !0), (this.x = 0), (c.x = 0)
  24669. })
  24670. .onUpdate(function () {})
  24671. .onComplete(function () {
  24672. a(),
  24673. (c.x = 0),
  24674. setTimeout(function () {
  24675. b.tweenFlag = !0
  24676. }, 1500)
  24677. })),
  24678. this.cursorAnimate.easing(d),
  24679. this.cursorAnimate.start()
  24680. }),
  24681. (this.autoCursorPosition = function (a) {
  24682. // var b = Math.abs(a.distance - 10);
  24683. // this.cursor.position.z = -b,
  24684. // b /= 10;
  24685. // alert(b);
  24686. // this.cursor.scale.set(b, b, b)
  24687. this.cursor.scale.set(0.3, 0.3, 0.3)
  24688. })
  24689. }),
  24690. (n.prototype.vrRenderer = function (a, b, c) {
  24691. var d = new b.vrCamera(c)
  24692. d.bananaAspect = 0.75 // fov origin:0.8
  24693. this.width, this.height
  24694. var b = this
  24695. ;(this.setSize = function (c, d) {
  24696. a.setSize.call(this, c, d), (b.width = c), (b.height = d)
  24697. }),
  24698. (this.render = function (b, c, e, f) {
  24699. window.cameraQua = c.quaternion.clone()
  24700. var g, h
  24701. if (c.__RESS__SKIP__STEREO__) return a.render(b, c, e, f)
  24702. if ('PerspectiveCamera' === c.type) (g = d.cameraL), (h = d.cameraR), b.updateMatrixWorld(), null === c.parent && c.updateMatrixWorld(), d.vrCameraUpdate(c)
  24703. else {
  24704. if ('OrthographicCamera' !== c.type) return DEBUG && console.error('Unsupported renderer: ', c.type)
  24705. g = h = c
  24706. }
  24707. a.setScissorTest(!0),
  24708. a.setScissor(0, 0, this.width / 2, this.height),
  24709. a.setViewport(0, 0, this.width / 2, this.height),
  24710. a.render.call(this, b, g, e, f),
  24711. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  24712. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  24713. a.render.call(this, b, h, e, f),
  24714. a.setScissorTest(!1)
  24715. }),
  24716. (this.__proto__ = {
  24717. __proto__: a
  24718. })
  24719. }),
  24720. (n.prototype.vrCamera = function (a) {
  24721. ;(this.type = 'StereoCamera'),
  24722. (this._aspect = 1),
  24723. (this._overlap = 0.064),
  24724. (this.cameraL = new r.PerspectiveCamera()),
  24725. this.cameraL.layers.enable(1),
  24726. (this.cameraL.near = 0.01), //xzw add
  24727. (this.cameraL.matrixAutoUpdate = !1),
  24728. (this.cameraR = new r.PerspectiveCamera()),
  24729. this.cameraR.layers.enable(2),
  24730. (this.cameraR.near = 0.01), //xzw add
  24731. (this.cameraR.matrixAutoUpdate = !1),
  24732. (this.eyeRight = new r.Matrix4()),
  24733. (this.eyeLeft = new r.Matrix4()),
  24734. (this.vrCameraNeedsUpdate = !0),
  24735. (window.vrCameraL = this.cameraL) // fyz 记录vr相机
  24736. Object.defineProperty(this, 'bananaAspect', {
  24737. get: function () {
  24738. return this._aspect
  24739. },
  24740. set: function (a) {
  24741. this._aspect !== a && (this.vrCameraNeedsUpdate = !0), (this._aspect = a)
  24742. }
  24743. }),
  24744. Object.defineProperty(this, 'overlap', {
  24745. //瞳距
  24746. get: function () {
  24747. return this._overlap
  24748. },
  24749. set: function (a) {
  24750. this._overlap !== a && (this.vrCameraNeedsUpdate = !0), (this._overlap = a)
  24751. }
  24752. }),
  24753. (this.vrCameraUpdate = function (a) {
  24754. this.vrCameraNeedsUpdate = true
  24755. if (
  24756. ((this.vrCameraNeedsUpdate =
  24757. this.vrCameraNeedsUpdate || this.bananaFov !== a.fov || this.bananaReal_aspect !== a.aspect * this.bananaAspect || this.bananaNear !== a.near || this.bananaFar !== a.far),
  24758. this.vrCameraNeedsUpdate)
  24759. ) {
  24760. ;(this.vrCameraNeedsUpdate = !1),
  24761. //console.debug("vrCameraUpdate"),
  24762. (this.bananaFocus = a.focus),
  24763. (this.bananaFov = a.fov),
  24764. (this.bananaReal_aspect = a.aspect * (window.ban || this.bananaAspect)),
  24765. (this.bananaNear = a.near),
  24766. (this.bananaFar = a.far),
  24767. //console.debug(a.aspect),
  24768. (this.bananaFocus = 10)
  24769. var b,
  24770. c,
  24771. d = a.projectionMatrix.clone(),
  24772. e = this.overlap / 2,
  24773. f = (e * this.bananaNear) / this.bananaFocus,
  24774. g = this.bananaNear * Math.tan((Math.PI / 180) * this.bananaFov * 0.5)
  24775. ;(this.eyeLeft.elements[12] = -e),
  24776. (this.eyeRight.elements[12] = e),
  24777. (b = -g * this.bananaReal_aspect + f),
  24778. (c = g * this.bananaReal_aspect + f),
  24779. (d.elements[0] = (2 * this.bananaNear) / (c - b)),
  24780. (d.elements[8] = (c + b) / (c - b)),
  24781. this.cameraL.projectionMatrix.copy(d),
  24782. (b = -g * this.bananaReal_aspect - f),
  24783. (c = g * this.bananaReal_aspect - f),
  24784. (d.elements[0] = (2 * this.bananaNear) / (c - b)),
  24785. (d.elements[8] = (c + b) / (c - b)),
  24786. this.cameraR.projectionMatrix.copy(d)
  24787. }
  24788. this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(this.eyeLeft), this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(this.eyeRight)
  24789. })
  24790. }),
  24791. (n.prototype.boluoGetTexture = function (a) {
  24792. var b = new r.TextureLoader()
  24793. return (b.crossOrigin = 'anonymous'), b.load(a)
  24794. })
  24795. /* let webxr = {
  24796. init(renderer) {
  24797. this.renderer = renderer
  24798. renderer.xr = new THREE.WebXRManager(renderer, renderer.getContext());
  24799. renderer.xr.enabled = true
  24800. if ('xr' in navigator && 'isSessionSupported' in navigator.xr) {
  24801. //pico firefox
  24802. var mode = 'immersive-vr'
  24803. navigator.xr
  24804. .isSessionSupported(mode)
  24805. .then(supported => {
  24806. if (!supported) {
  24807. this.xrNotFound('isSessionSupported not supported')
  24808. } else {
  24809. this.xrType = 'xr' //showEnterXR();
  24810. }
  24811. })
  24812. .catch(this.xrNotFound.bind(this, 'isSessionSupported error'))
  24813. } else if ('getVRDisplays' in navigator) {
  24814. //pico 的vr browser是这个
  24815. console.log('getVRDisplays')
  24816. let setDevice = device => {
  24817. this.xrType = 'vr'
  24818. this.device = device
  24819. this.renderer.xr.setDevice(device) //新版是renderer.vr
  24820. }
  24821. window.addEventListener(
  24822. 'vrdisplayconnect',
  24823. function (event) {
  24824. setDevice(event.display)
  24825. },
  24826. false
  24827. )
  24828. window.addEventListener(
  24829. 'vrdisplaydisconnect',
  24830. function ( ) {
  24831. console.log('vrdisplaydisconnect')
  24832. window.bus.dispatchEvent({type:'exitWebXR'})
  24833. },
  24834. false
  24835. )
  24836. window.addEventListener(
  24837. 'vrdisplaypresentchange',
  24838. function (event) {
  24839. console.log('vrdisplaypresentchange', event.display.isPresenting ? 'EXIT VR' : 'ENTER VR')
  24840. event.display.isPresenting || window.bus.dispatchEvent({type:'exitWebXR'})
  24841. },
  24842. false
  24843. )
  24844. window.addEventListener(
  24845. 'vrdisplayactivate',
  24846. function (event) {
  24847. event.display.requestPresent([{ source: this.renderer.domElement }])
  24848. },
  24849. false
  24850. )
  24851. navigator
  24852. .getVRDisplays()
  24853. .then(function (displays) {
  24854. if (displays.length > 0) {
  24855. setDevice(displays[0])
  24856. } else {
  24857. this.xrNotFound('no displays')
  24858. }
  24859. })
  24860. .catch(this.xrNotFound.bind(this, 'getVRDisplays error'))
  24861. } else {
  24862. this.xrNotFound('xr not supported')
  24863. }
  24864. },
  24865. enterVR() {
  24866. if (!this.xrType) return //不支持
  24867. console.log('enterVR', this.xrType)
  24868. if (this.xrType == 'vr') {
  24869. this.device.isPresenting ? this.device.exitPresent() : this.device.requestPresent([{ source: renderer.domElement }])
  24870. } else if (this.xrType == 'xr') {
  24871. if (this.currentSession == void 0) {
  24872. console.log('this.currentSession == void 0 ')
  24873. function getXRSessionInit(mode, options) {
  24874. var space = (options || {}).referenceSpaceType || 'local-floor'
  24875. var sessionInit = (options && options.sessionInit) || {}
  24876. // Nothing to do for default features.
  24877. if (space == 'viewer') return sessionInit
  24878. if (space == 'local' && mode.startsWith('immersive')) return sessionInit
  24879. // If the user already specified the space as an optional or required feature, don't do anything.
  24880. if (sessionInit.optionalFeatures && sessionInit.optionalFeatures.includes(space)) return sessionInit
  24881. if (sessionInit.requiredFeatures && sessionInit.requiredFeatures.includes(space)) return sessionInit
  24882. // The user didn't request the reference space type as a feature. Add it to a shallow copy
  24883. // of the user-supplied sessionInit requiredFeatures (if any) to ensure it's valid to
  24884. // request it later.
  24885. var newInit = Object.assign({}, sessionInit)
  24886. newInit.requiredFeatures = [space]
  24887. if (sessionInit.requiredFeatures) {
  24888. newInit.requiredFeatures = newInit.requiredFeatures.concat(sessionInit.requiredFeatures)
  24889. }
  24890. return newInit
  24891. }
  24892. let onSessionEnded = ( ) => {
  24893. console.log('onSessionEnded')
  24894. this.currentSession.removeEventListener('end', onSessionEnded)
  24895. setTimeout(()=>{
  24896. this.renderer.xr.setSession(null)
  24897. this.currentSession = null
  24898. window.bus.dispatchEvent({type:'exitWebXR'})
  24899. },1)//延迟原因:先使THREE里的onSessionEnded执行
  24900. }
  24901. let onSessionStarted = session => {
  24902. console.log('onSessionStarted')
  24903. session.addEventListener('end', onSessionEnded)
  24904. this.renderer.xr.setSession(session)
  24905. this.currentSession = session
  24906. }
  24907. var mode = 'immersive-vr'
  24908. var sessionInit = getXRSessionInit(mode)
  24909. navigator.xr.requestSession(mode, sessionInit).then(onSessionStarted)
  24910. } else {
  24911. console.log('this.currentSession.end()', this.currentSession)
  24912. this.currentSession.end()
  24913. }
  24914. }
  24915. },
  24916. xrNotFound(text) {
  24917. console.log('xrNotFound:', text)
  24918. },
  24919. } */
  24920. /***********************************************************************************************************************************************************************************/
  24921. ;(n.prototype.updateScreenSize = (function () {
  24922. //xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  24923. var W, H //当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  24924. return function (o) {
  24925. var render = false
  24926. var ratio
  24927. var w, h //记录应当render的大小
  24928. if (o && !o.resize && o.width != void 0 && o.height != void 0) {
  24929. ;(w = o.width), (h = o.height), (render = true), (ratio = 1)
  24930. } else {
  24931. w = $('#player').width()
  24932. h = $('#player').height()
  24933. o && o.resize && ((W = this.renderWidth), (H = this.renderHeight))
  24934. ;(w !== W || h !== H || this.forceUpdateSize) && ((W = w), (H = h), (render = true), (ratio = window.devicePixelRatio))
  24935. }
  24936. if (render) {
  24937. this.setSize(w, h, ratio)
  24938. this.forceUpdateSize = !1
  24939. }
  24940. }
  24941. })()),
  24942. (n.prototype.updateComponents = function () {
  24943. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++) this.updateListeners[t].update(e)
  24944. }),
  24945. (n.prototype.suspend = function () {
  24946. ;(this.started = !1),
  24947. (this.suspendedObjects = this.scene.children.map(
  24948. function (e) {
  24949. return this.scene.remove(e), e
  24950. }.bind(this)
  24951. )),
  24952. this.render()
  24953. }),
  24954. (n.prototype.resume = function () {
  24955. this.suspendedObjects.forEach(
  24956. function (e) {
  24957. this.scene.add(e)
  24958. }.bind(this)
  24959. ),
  24960. (this.suspendedObjects = []),
  24961. (this.started = !0),
  24962. p()
  24963. })
  24964. var p = function () {
  24965. this.started &&
  24966. (window.requestAnimationFrame(p),
  24967. this.updateScreenSize(), // fyz resize
  24968. this.updateComponents(),
  24969. this.updateTextureMemory(),
  24970. this.render(),
  24971. window.stats && (window.fps = stats.update()),
  24972. this.emit(a.AfterRender))
  24973. }
  24974. ;(n.prototype.getImageData = (function () {
  24975. var e = document.createElement('canvas'),
  24976. t = e.getContext('2d')
  24977. return function (i, n, r) {
  24978. return (e.width === n && e.height === r) || ((e.width = n), (e.height = r)), t.drawImage(i, 0, 0, n, r), t.getImageData(0, 0, n, r)
  24979. }
  24980. })()),
  24981. (n.prototype.initSizedTexture2D = function (e, t, i) {
  24982. var n = this.renderer,
  24983. o = n.context,
  24984. a = n.state,
  24985. s = new r.Texture(null)
  24986. ;(s.flipY = !1), i !== !0 && (i = !1), (s.generateMipmaps = i)
  24987. var l = n.paramThreeToGL(s.format),
  24988. c = n.paramThreeToGL(s.type),
  24989. h = n.properties.get(s),
  24990. u = o.createTexture()
  24991. a.bindTexture(o.TEXTURE_2D, u), o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY), o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null), (s.wrapS = t), (s.wrapT = t)
  24992. var d = n.paramThreeToGL(t)
  24993. return (
  24994. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  24995. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  24996. i
  24997. ? ((s.magFilter = r.LinearFilter),
  24998. (s.minFilter = r.LinearMipMapLinearFilter),
  24999. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  25000. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  25001. o.generateMipmap(o.TEXTURE_2D))
  25002. : ((s.magFilter = r.LinearFilter),
  25003. (s.minFilter = r.LinearFilter),
  25004. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  25005. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  25006. a.bindTexture(o.TEXTURE_2D, null),
  25007. (h.__webglTexture = u),
  25008. s
  25009. )
  25010. }),
  25011. (n.prototype.initSizedCubeMap = function (e, t) {
  25012. var i = this.renderer,
  25013. n = i.context,
  25014. o = i.state,
  25015. a = new r.CubeTexture([null, null, null, null, null, null])
  25016. ;(a.flipY = !1), (a.generateMipmaps = t)
  25017. var s = i.paramThreeToGL(a.format),
  25018. l = i.paramThreeToGL(a.type),
  25019. c = i.properties.get(a),
  25020. h = n.createTexture()
  25021. o.bindTexture(n.TEXTURE_CUBE_MAP, h), n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY)
  25022. for (var u = 0; u < 6; u++) n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null)
  25023. return (
  25024. t
  25025. ? ((a.magFilter = r.LinearFilter),
  25026. (a.minFilter = r.LinearMipMapLinearFilter),
  25027. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  25028. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  25029. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  25030. n.generateMipmap(n.TEXTURE_CUBE_MAP))
  25031. : ((a.magFilter = r.LinearFilter),
  25032. (a.minFilter = r.LinearFilter),
  25033. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  25034. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  25035. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  25036. (c.__image__webglTextureCube = h),
  25037. a
  25038. )
  25039. }),
  25040. (n.prototype.deallocateCubeTexture = function (e) {
  25041. var t = this.renderer,
  25042. i = t.context,
  25043. n = t.properties.get(e)
  25044. i.deleteTexture(n.__image__webglTextureCube)
  25045. }),
  25046. (n.prototype.uploadTexture2D = function (e, t, i, n, r, o) {
  25047. var a = this.renderer,
  25048. s = a.context,
  25049. l = a.state,
  25050. c = a.properties.get(t)
  25051. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  25052. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  25053. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  25054. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  25055. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  25056. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  25057. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  25058. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  25059. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  25060. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  25061. l.bindTexture(s.TEXTURE_2D, null)
  25062. }),
  25063. (n.prototype.uploadTexture3D = function (e, t, i, n, r, o, a) {
  25064. var s = this.renderer,
  25065. l = s.context,
  25066. c = s.state,
  25067. h = s.properties.get(t)
  25068. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  25069. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  25070. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  25071. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  25072. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  25073. }),
  25074. (n.prototype.rebuildMipMaps2D = function (e) {
  25075. var t = this.renderer,
  25076. i = t.context,
  25077. n = t.state
  25078. t.properties.get(e)
  25079. i.generateMipmap(i.TEXTURE_2D), n.bindTexture(i.TEXTURE_2D, null)
  25080. }),
  25081. (n.prototype.rebuildMipMaps3D = function (e) {
  25082. var t = this.renderer,
  25083. i = t.context,
  25084. n = t.state,
  25085. r = t.properties.get(e)
  25086. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube), i.generateMipmap(i.TEXTURE_CUBE_MAP), n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  25087. }),
  25088. (n.prototype.renderToCubeMap = (function () {
  25089. var e = !1,
  25090. t = null,
  25091. i = null,
  25092. n = null,
  25093. a = null,
  25094. s = null,
  25095. l = 1
  25096. return function (c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  25097. var _ = this.renderer
  25098. _.context
  25099. e ||
  25100. ((i = new r.OrthographicCamera(l / -2, l / 2, l / 2, l / -2, -200, 200)),
  25101. (i.position.z = 150),
  25102. (t = new r.Scene()),
  25103. t.add(i),
  25104. (n = new r.ShaderMaterial({
  25105. uniforms: {
  25106. tDiffuse: {
  25107. type: 't',
  25108. value: null
  25109. },
  25110. alpha: {
  25111. type: 'f',
  25112. value: 1
  25113. }
  25114. },
  25115. vertexShader: o.basicTextured.vertexShader,
  25116. fragmentShader: o.basicTextured.fragmentShader,
  25117. depthWrite: !1,
  25118. depthTest: !1,
  25119. side: r.DoubleSide
  25120. })),
  25121. (a = new r.PlaneBufferGeometry(l, l)),
  25122. (s = new r.Mesh(a, n)),
  25123. (s.position.z = 0),
  25124. t.add(s),
  25125. (e = !0))
  25126. var T = a.getAttribute('uv')
  25127. T.setDynamic(!0), (T.needsUpdate = !0)
  25128. var x = T.array,
  25129. S = p / u,
  25130. M = f / d,
  25131. R = g / u,
  25132. P = m / d
  25133. ;(x[0] = S), (x[1] = M + P), (x[2] = S + R), (x[3] = M + P), (x[4] = S), (x[5] = M), (x[6] = S + R), (x[7] = M)
  25134. var O = a.getAttribute('position')
  25135. O.setDynamic(!0), (O.needsUpdate = !0)
  25136. var L = O.array,
  25137. D = v / h.width - l / 2,
  25138. N = A / h.height - l / 2,
  25139. B = y / h.width,
  25140. F = C / h.height
  25141. ;(L[0] = D), (L[1] = N + F), (L[3] = D + B), (L[4] = N + F), (L[6] = D), (L[7] = N), (L[9] = D + B), (L[10] = N)
  25142. this.renderer.properties.get(c)
  25143. ;(n.uniforms.tDiffuse.value = c),
  25144. (n.blending = E || r.NoBlending),
  25145. (n.transparent = !!b),
  25146. (void 0 !== w && null !== w) || (w = 1),
  25147. (n.uniforms.alpha.value = w),
  25148. (n.needUpdate = !0),
  25149. (h.activeCubeFace = I),
  25150. h.viewport.set(0, 0, h.width, h.height)
  25151. var V = this.renderer.autoClear
  25152. ;(this.renderer.autoClear = !1), this.renderer.render(t, i, h, !1), (this.renderer.autoClear = V)
  25153. }
  25154. })()),
  25155. (n.prototype.copyCubeMap = (function () {
  25156. var e = !1,
  25157. t = null,
  25158. i = null,
  25159. a = null,
  25160. s = null,
  25161. l = null,
  25162. c = new r.Euler()
  25163. new r.Vector3()
  25164. return function (h, u, d, p, f, g, m, v, A) {
  25165. if (f > this.qualityManager.maxRenderTargetSize) return //add
  25166. this.renderer
  25167. if (!e) {
  25168. var y = 2
  25169. ;(i = new r.OrthographicCamera(y / -2, y / 2, y / 2, y / -2, 0, 200)),
  25170. i.position.set(0, 0, 0),
  25171. (t = new r.Scene()),
  25172. t.add(i),
  25173. (a = new r.ShaderMaterial({
  25174. uniforms: {
  25175. tDiffuse: {
  25176. type: 't',
  25177. value: null
  25178. },
  25179. alpha: {
  25180. type: 'f',
  25181. value: 1
  25182. }
  25183. },
  25184. vertexShader: o.copyCubeMap.vertexShader,
  25185. fragmentShader: o.copyCubeMap.fragmentShader,
  25186. depthWrite: !1,
  25187. depthTest: !1,
  25188. side: r.DoubleSide
  25189. })),
  25190. (s = new r.BoxGeometry(y, y, y)),
  25191. (l = new r.Mesh(s, a)),
  25192. t.add(l),
  25193. (e = !0)
  25194. }
  25195. for (var C = 0; C < 6; C++)
  25196. n.getCubeOrientationForCubeFace(C, c),
  25197. l.rotation.copy(c),
  25198. (l.matrixWorldNeedsUpdate = !0),
  25199. l.updateMatrixWorld(),
  25200. (a.uniforms.tDiffuse.value = h),
  25201. (a.blending = m || r.NoBlending),
  25202. (a.transparent = !!v),
  25203. (void 0 !== A && null !== A) || (A = 1),
  25204. (a.uniforms.alpha.value = A),
  25205. (a.needUpdate = !0),
  25206. (u.activeCubeFace = C),
  25207. u.viewport.set(0, 0, f, g),
  25208. this.renderer.render(t, i, u, !1)
  25209. }
  25210. })()),
  25211. (n.getLookAtForCubeFace = function (e, t) {
  25212. switch (e) {
  25213. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  25214. t.set(1, 0, 0)
  25215. break
  25216. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  25217. t.set(-1, 0, 0)
  25218. break
  25219. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  25220. t.set(0, 1, 0)
  25221. break
  25222. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  25223. t.set(0, -1, 0)
  25224. break
  25225. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  25226. t.set(0, 0, 1)
  25227. break
  25228. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  25229. t.set(0, 0, -1)
  25230. }
  25231. }),
  25232. (n.getCubeOrientationForCubeFace = function (e, t) {
  25233. switch (e) {
  25234. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  25235. t.set(0, -Math.PI / 2, 0)
  25236. break
  25237. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  25238. t.set(0, Math.PI / 2, 0)
  25239. break
  25240. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  25241. t.set(Math.PI / 2, Math.PI, 0)
  25242. break
  25243. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  25244. t.set(-Math.PI / 2, Math.PI, 0)
  25245. break
  25246. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  25247. t.set(0, -Math.PI, 0)
  25248. break
  25249. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  25250. t.set(0, 0, 0)
  25251. }
  25252. }),
  25253. (t.exports = n)
  25254. },
  25255. {
  25256. '../enum/GLCubeFaces': 25,
  25257. '../enum/GLTextureType': 26,
  25258. '../enum/SceneRendererEvents': 43,
  25259. '../exception/BasicException': 55,
  25260. '../exception/RendererCreationException': 57,
  25261. '../settings': 166,
  25262. '../shaders': 167,
  25263. /********************************************************************fyz改 from徐世廷**********************************************************************/
  25264. '../util/browser': 182,
  25265. /************************************************************************************************************************************************/
  25266. events: 202,
  25267. three: 217
  25268. }
  25269. ],
  25270. 159: [
  25271. function (e, t, i) {
  25272. 'use strict'
  25273. function n(e) {
  25274. ;(this.messenger = new a(e)), (this.clientKey = null)
  25275. }
  25276. var r = e('../util/ajax'),
  25277. o = e('./PostMessageType'),
  25278. a = e('./postmessage'),
  25279. s = e('./VersionInfo'),
  25280. l = e('events').EventEmitter,
  25281. c = window.location.origin + '/api/v1/user/'
  25282. ;(n.prototype = Object.create(l.prototype)),
  25283. (n.prototype.bindEvents = function () {
  25284. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  25285. }),
  25286. (n.prototype.waitForConnection = function () {
  25287. var e = new Promise(
  25288. function (e, t) {
  25289. this.messenger.on(
  25290. o.CONNECT,
  25291. function (i) {
  25292. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  25293. }.bind(this)
  25294. )
  25295. }.bind(this)
  25296. )
  25297. return e
  25298. }),
  25299. (n.prototype.onConnectionReceived = function (e) {
  25300. return (
  25301. this.messenger.setTarget(e.source, e.origin),
  25302. this.verifyConnection(e).then(
  25303. function (t, i) {
  25304. this.messenger.send({
  25305. type: o.ACCEPT,
  25306. toId: e.fromId,
  25307. warning: i
  25308. }),
  25309. (this.clientKey = t),
  25310. this.messenger.removeAllListeners(o.CONNECT),
  25311. this.bindEvents()
  25312. }.bind(this),
  25313. function (t) {
  25314. this.messenger.send({
  25315. type: o.REJECT,
  25316. toId: e.fromId,
  25317. reason: t
  25318. }),
  25319. this.messenger.setTarget()
  25320. }.bind(this)
  25321. )
  25322. )
  25323. }),
  25324. (n.prototype.verifyConnection = function (e) {
  25325. return new Promise(function (t, i) {
  25326. var n
  25327. if (s.isDeprecated(e.sdkVersion)) n = '这个版本正在被弃用'
  25328. else if (!s.isSupported(e.sdkVersion)) return i('不支持此版本的SDK')
  25329. var o = {
  25330. cache: !1,
  25331. headers: {
  25332. 'X-port-Application-Key': e.applicationKey,
  25333. 'X-port-Referrer': e.origin
  25334. }
  25335. }
  25336. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, 'key/referrer mismatch'))
  25337. })
  25338. }),
  25339. (n.prototype.onMessageReceived = function (e) {
  25340. if (this.validateClientApplicationKey(e.applicationKey)) {
  25341. var t = this
  25342. ;(e.onDone = function (i) {
  25343. ;(i.toId = e.fromId), (i.uid = e.uid), (i.type = o.RESPONSE), t.messenger.send(i)
  25344. }),
  25345. this.emit(o.ACTION, e)
  25346. }
  25347. }),
  25348. (n.prototype.validateClientApplicationKey = function (e) {
  25349. return this.clientKey === e
  25350. }),
  25351. (n.prototype.sendEvent = function (e, t) {
  25352. this.messenger.send({
  25353. type: o.EVENT,
  25354. eventType: e,
  25355. eventData: t
  25356. })
  25357. }),
  25358. (t.exports = n)
  25359. },
  25360. {
  25361. '../util/ajax': 181,
  25362. './PostMessageType': 160,
  25363. './VersionInfo': 163,
  25364. './postmessage': 165,
  25365. events: 202
  25366. }
  25367. ],
  25368. 160: [
  25369. function (e, t, i) {
  25370. 'use strict'
  25371. t.exports = Object.freeze({
  25372. CONNECT: 'postmessage.connect',
  25373. ACCEPT: 'postmessage.accept',
  25374. REJECT: 'postmessage.reject',
  25375. ACTION: 'postmessage.action',
  25376. RESPONSE: 'postmessage.response',
  25377. EVENT: 'postmessage.event'
  25378. })
  25379. },
  25380. {}
  25381. ],
  25382. 161: [
  25383. function (e, t, i) {
  25384. 'use strict'
  25385. t.exports = Object.freeze({
  25386. MOVE: 'sdk.move',
  25387. ENTER_PANO: 'sdk.enterpano',
  25388. MODEL_LOADED: 'sdk.modelloaded'
  25389. })
  25390. },
  25391. {}
  25392. ],
  25393. 162: [
  25394. function (e, t, i) {
  25395. 'use strict'
  25396. t.exports = Object.freeze({
  25397. FLY: 'transition.fly',
  25398. FADEOUT: 'transition.fade',
  25399. INSTANT: 'transition.instant'
  25400. })
  25401. },
  25402. {}
  25403. ],
  25404. 163: [
  25405. function (e, t, i) {
  25406. 'use strict'
  25407. t.exports = {
  25408. current: '1.0',
  25409. supported: ['1.0'],
  25410. deprecated: [],
  25411. isSupported: function (e) {
  25412. return this.supported.indexOf(e) !== -1
  25413. },
  25414. isDeprecated: function (e) {
  25415. return this.deprecated.indexOf(e) !== -1
  25416. },
  25417. isValid: function (e) {
  25418. return this.isSupported(e) || this.isDeprecated(e)
  25419. }
  25420. }
  25421. },
  25422. {}
  25423. ],
  25424. 164: [
  25425. function (e, t, i) {
  25426. ;(function (i) {
  25427. 'use strict'
  25428. function n(e, t, i) {
  25429. e && (e = e.toLowerCase().trim())
  25430. var n = new I.UP.clone(),
  25431. r = Math.PI / 3,
  25432. o = Math.PI / 2
  25433. switch (e) {
  25434. case 'left':
  25435. i.copy(t), i.applyAxisAngle(n, o)
  25436. break
  25437. case 'right':
  25438. i.copy(t), i.applyAxisAngle(n, -o)
  25439. break
  25440. case 'forwardleft':
  25441. i.copy(t), i.applyAxisAngle(n, r)
  25442. break
  25443. case 'forwardright':
  25444. i.copy(t), i.applyAxisAngle(n, -r)
  25445. break
  25446. case 'forward':
  25447. default:
  25448. i.copy(t)
  25449. }
  25450. return i
  25451. }
  25452. function r(e, t) {
  25453. if (e) {
  25454. var i = {
  25455. pano: e,
  25456. lookAtPoint: null,
  25457. duration: null,
  25458. maxDistanceOverride: null,
  25459. skipWarpingCheck: !1
  25460. }
  25461. this.player.flyToPano(i, function () {
  25462. t &&
  25463. t({
  25464. success: !0,
  25465. message: 'Transition complete.'
  25466. })
  25467. })
  25468. } else
  25469. R.warn('Showcase -> clickPanoObject: Unable to find pano.'),
  25470. t &&
  25471. t({
  25472. success: !1,
  25473. error: 'Unable to find pano.'
  25474. })
  25475. }
  25476. function o(e, t) {
  25477. var i = this.findRankedPano(e, t)
  25478. return i >= 0 ? this.handleToObject[i] : (R.warn('Showcase -> findRankedPanoObject: Unable to find nearby pano.'), null)
  25479. }
  25480. function a(e, t) {
  25481. var i = this.findRankedtag(e, t)
  25482. return i >= 0 ? this.handleToObject[i] : (R.warn('Showcase -> findRankedtagObject: Unable to find nearby tag.'), null)
  25483. }
  25484. function s(e, t) {
  25485. t.copy(I.FORWARD), e.getDirection(t)
  25486. }
  25487. function l(e) {
  25488. function t(e) {
  25489. var t = new c.Euler().setFromQuaternion(e.quaternion, 'YXZ')
  25490. return {
  25491. x: c.Math.radToDeg(t._x),
  25492. y: c.Math.radToDeg(t._y),
  25493. z: c.Math.radToDeg(t._z)
  25494. }
  25495. }
  25496. var i = function (e) {
  25497. return e.alignmentType !== m.ALIGNED
  25498. ? null
  25499. : {
  25500. x: e.position.x,
  25501. y: e.position.y,
  25502. z: e.position.z
  25503. }
  25504. }
  25505. return {
  25506. panos: e.panos.list.map(function (n) {
  25507. var r = y.getCubemapUrls(e.urls, n.id, 'high')[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z]
  25508. return {
  25509. uuid: n.id,
  25510. aligned: n.alignmentType === m.ALIGNED,
  25511. neighbourUUIDs: n.neighbourUUIDs.slice(),
  25512. position: i(n),
  25513. rotation: t(n),
  25514. thumbnail: r
  25515. }
  25516. })
  25517. }
  25518. }
  25519. var c = e('three'),
  25520. h = e('./ApiHost'),
  25521. u = e('../util/logger'),
  25522. d = e('../util/common'),
  25523. p = e('../util/math'),
  25524. f = e('../enum/ModelManagerEvents'),
  25525. g = e('./PostMessageType'),
  25526. m = e('../enum/AlignmentType'),
  25527. v = e('../enum/Direction'),
  25528. A = e('./TransitionStyles'),
  25529. y = e('../util/panorama'),
  25530. C = e('../enum/GLCubeFaces'),
  25531. I = e('../enum/Vectors'),
  25532. E = e('../enum/Viewmode'),
  25533. b = e('../enum/WarpStyle'),
  25534. w = (e('../enum/Keys'), e('../enum/PlayerEvents')),
  25535. _ = e('../sdk/SdkEvents'),
  25536. I = e('../enum/Vectors'),
  25537. T = e('../enum/ControlEvents'),
  25538. x = e('../enum/RenderLayers'),
  25539. S = (e('../constants'), e('../settings')),
  25540. M = e('../lib/jpeg_encoder'),
  25541. R = new u(i),
  25542. P = (function () {
  25543. var e = function e() {
  25544. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD), e.player.getDirection(e.playerDirection), e.projectVectors()
  25545. var t = e.playerDirection.angleTo(e.lastFacingDirection)
  25546. if (((e.angleTravelled += Math.abs(t)), e.angleTravelled >= Math.abs(e.angle))) {
  25547. if (((e.active = !1), e.onDone)) {
  25548. var i = e.onDone
  25549. i()
  25550. }
  25551. } else e.lastFacingDirection.copy(e.playerDirection), window.setTimeout(e, 4)
  25552. }
  25553. return (
  25554. (e.active = !1),
  25555. (e.angle = 0),
  25556. (e.angleTravelled = 0),
  25557. (e.playerDirection = new c.Vector3()),
  25558. (e.lastFacingDirection = new c.Vector3()),
  25559. (e.onDone = null),
  25560. (e.player = null),
  25561. (e.start = function (t, i, n, r) {
  25562. ;(e.active = !0),
  25563. t && i && (i = 0),
  25564. (e.angle = t || i),
  25565. (e.xAngle = t),
  25566. (e.yAngle = i),
  25567. (e.angleTravelled = 0),
  25568. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25569. n.getDirection(e.playerDirection),
  25570. e.lastFacingDirection.copy(e.playerDirection),
  25571. e.projectVectors(),
  25572. (e.onDone = r),
  25573. (e.player = n),
  25574. e()
  25575. }),
  25576. (e.projectVectors = function () {
  25577. e.xAngle && (e.playerDirection.projectOnPlane(I.UP), e.lastFacingDirection.projectOnPlane(I.UP))
  25578. }),
  25579. e
  25580. )
  25581. })(),
  25582. O = (function () {
  25583. var e = new c.Vector3()
  25584. return function (t) {
  25585. t ? (e.copy(t.position), e.add(t.discPosition), p.projectPositionToCanvas(e, this.player.camera, e), this.click(e.x, e.y)) : R.warn('Showcase -> clicktagObject: Unable to find tag.')
  25586. }
  25587. })(),
  25588. L = function () {
  25589. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  25590. },
  25591. D = function () {
  25592. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  25593. },
  25594. N = (function (e) {
  25595. var t = new c.Vector3()
  25596. return function (e) {
  25597. var i = this.player.getDirection()
  25598. t.copy(i)
  25599. var n = t.y
  25600. ;(t.y = 0), t.normalize()
  25601. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1)
  25602. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA) return 0 !== e && R.warn('Cannot rotate in y direction when in ' + this.player.mode + ' mode'), 0
  25603. this.player.mode === E.DOLLHOUSE && (r = -r)
  25604. var o = L.call(this) - 0.1,
  25605. a = D.call(this) + 0.1,
  25606. s = r + e
  25607. s > o ? (s = o) : s < a && (s = a)
  25608. var l = s - r
  25609. return e > 0 && l < 0.01 && (l = 0), e < 0 && l > -0.01 && (l = 0), l
  25610. }
  25611. })(),
  25612. B = (function () {
  25613. var e = new c.Euler()
  25614. return function (t) {
  25615. return (
  25616. e.setFromQuaternion(t.quaternion, 'YXZ'),
  25617. {
  25618. position: {
  25619. x: t.position.x,
  25620. y: t.position.y,
  25621. z: t.position.z
  25622. },
  25623. rotation: {
  25624. x: c.Math.radToDeg(e.x),
  25625. y: c.Math.radToDeg(e.y),
  25626. z: 0
  25627. },
  25628. pano: t.currentPano ? t.currentPano.id : null,
  25629. mode: t.mode
  25630. }
  25631. )
  25632. }
  25633. })(),
  25634. F = null
  25635. t.exports = {
  25636. init: function (e, t, i, n, r) {
  25637. V.init(e, t, i, r),
  25638. (F = new Promise(
  25639. function (e, t) {
  25640. i.on(w.Ready, function () {
  25641. e()
  25642. })
  25643. }.bind(this)
  25644. ))
  25645. var o = new h(window),
  25646. a = o.waitForConnection()
  25647. a.then(function (e) {
  25648. o.on(g.ACTION, V.onMessageReceive.bind(V))
  25649. })
  25650. var s = (function () {
  25651. var e = Date.now()
  25652. return function () {
  25653. if (!(Date.now() - e < 100)) {
  25654. var t = B(i)
  25655. o.sendEvent(_.MOVE, {
  25656. state: t
  25657. }),
  25658. (e = Date.now())
  25659. }
  25660. }
  25661. })()
  25662. i.on(w.Move, s),
  25663. i.on(w.ViewChanged, s),
  25664. n.on(f.ActiveModelChanged, function (e) {
  25665. function t(e) {
  25666. var t,
  25667. i = e.newPano.id
  25668. e.oldPano && (t = e.oldPano.id),
  25669. i !== t &&
  25670. o.sendEvent(_.ENTER_PANO, {
  25671. oldPano: t,
  25672. newPano: i
  25673. })
  25674. }
  25675. var i = e.model,
  25676. n = e.oldModel
  25677. ;(V.model = i),
  25678. a.then(function () {
  25679. o.sendEvent(_.MODEL_LOADED, {
  25680. metadata: l(i)
  25681. })
  25682. }),
  25683. n &&
  25684. n.panos.forEach(function (e) {
  25685. e.removeEventListener('enter', t)
  25686. }),
  25687. i.panos.forEach(function (e) {
  25688. e.on('enter', t)
  25689. })
  25690. })
  25691. }
  25692. }
  25693. var V = {
  25694. director: null,
  25695. player: null,
  25696. controls: null,
  25697. sceneRenderer: null,
  25698. model: null,
  25699. init: function (e, t, i, n) {
  25700. ;(this.director = e), (this.player = i), (this.controls = t), (this.sceneRenderer = n)
  25701. },
  25702. handleToObject: {},
  25703. objectToHandle: {},
  25704. handleCount: 0,
  25705. onMessageReceive: function (e) {
  25706. if (e) {
  25707. var t = e.targetFunction,
  25708. i = e.params,
  25709. n = e.onDone
  25710. t && this[t] && this[t](i, n)
  25711. }
  25712. },
  25713. waitForInit: function (e, t) {
  25714. F.then(
  25715. t.bind({
  25716. success: !0,
  25717. message: 'Init complete.'
  25718. })
  25719. )
  25720. },
  25721. moveToPano: (function (e, t) {
  25722. var i = new c.Euler(0, 0, 0, 'YXZ'),
  25723. n = new c.Quaternion()
  25724. return function (e, t) {
  25725. var r = e.pano,
  25726. o = e.rotation,
  25727. a = e.transition
  25728. if (!this.model)
  25729. return t({
  25730. success: !1,
  25731. error: 'The model has not been loaded yet'
  25732. })
  25733. var s = this.model.panos.get(r)
  25734. if (!s)
  25735. return t({
  25736. success: !1,
  25737. error: r + ' does not exist in this model'
  25738. })
  25739. if (!o)
  25740. return t({
  25741. sucess: !1,
  25742. erorr: o + ' is not a valid rotation'
  25743. })
  25744. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), 'YXZ'), console.log(o.z)
  25745. var l = {
  25746. success: !0,
  25747. message: r
  25748. }
  25749. if (a === A.FADEOUT) n.setFromEuler(i), this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l))
  25750. else {
  25751. var h, u
  25752. a === A.INSTANT && ((h = 0), (u = 0))
  25753. var d = I.FORWARD.clone().applyEuler(i).add(s.position)
  25754. this.player.flyToPano(
  25755. {
  25756. pano: s,
  25757. lookAtPoint: d,
  25758. duration: h,
  25759. aimDuration: u
  25760. },
  25761. t.bind(this, l)
  25762. )
  25763. }
  25764. }
  25765. })(),
  25766. moveInDirection: function (e, t) {
  25767. var i = e.direction
  25768. return 'undefined' == typeof v[i]
  25769. ? (R.warn('Showcase -> moveInDirection: Cannot move in invalid direction.'),
  25770. void (
  25771. t &&
  25772. t({
  25773. success: !1,
  25774. error: 'Invalid direction.'
  25775. })
  25776. ))
  25777. : void this.player.flyLocalDirection(I[i].clone()).then(function (e) {
  25778. t(
  25779. e
  25780. ? {
  25781. success: !0,
  25782. message: 'moved ' + i
  25783. }
  25784. : {
  25785. success: !1,
  25786. error: 'Cannot move in direction: ' + i
  25787. }
  25788. )
  25789. })
  25790. },
  25791. getPose: function (e, t) {
  25792. this.player.camera.position, new c.Euler().setFromQuaternion(this.player.camera.quaternion, 'YXZ')
  25793. return t({
  25794. success: !0,
  25795. message: B(this.player)
  25796. })
  25797. },
  25798. takeScreenShot: (function () {
  25799. var e = new c.PerspectiveCamera(),
  25800. t = new c.WebGLRenderTarget()
  25801. return function (i, n) {
  25802. if (!i.resolution)
  25803. return n({
  25804. success: !1,
  25805. error: 'An invalid resolution was specified'
  25806. })
  25807. if (i.resolution.width === -1 || i.resolution.height === -1) {
  25808. var r = this.sceneRenderer.renderer.getSize()
  25809. ;(i.resolution.width = r.width), (i.resolution.height = r.height)
  25810. }
  25811. e.layers.set(x.DEFAULT),
  25812. i.visibleObjects &&
  25813. (i.visibleObjects.showtags && e.layers.enable(x.TAG), i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS), i.visibleObjects.showReticule && e.layers.enable(x.RETICULE))
  25814. var o = i.resolution.width,
  25815. a = i.resolution.height,
  25816. s = o / a
  25817. e.position.copy(this.sceneRenderer.camera.position),
  25818. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  25819. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  25820. (e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s),
  25821. t.setSize(o, a),
  25822. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t)
  25823. var l = new Uint8Array(o * a * 4)
  25824. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l)
  25825. var c = M.encode(
  25826. {
  25827. data: l,
  25828. width: o,
  25829. height: a,
  25830. heading: 180,
  25831. pitch: 0
  25832. },
  25833. {
  25834. quality: 75,
  25835. flipY: !0
  25836. }
  25837. ),
  25838. h = 'data:image/jpg;base64,' + d.uint8ToBase64(c.data)
  25839. n({
  25840. success: !0,
  25841. message: h
  25842. })
  25843. }
  25844. })(),
  25845. findRankedPano: (function (e, t) {
  25846. var i = new c.Vector3(),
  25847. r = new c.Vector3()
  25848. return function (e, t) {
  25849. s(this.player, r), n(t, r, i)
  25850. var o = this.player.rankedPanoInDirection(e, i)
  25851. if (o) {
  25852. var a = this.objectToHandle[o.id]
  25853. return a || ((this.objectToHandle[o.id] = a = this.handleCount++), (this.handleToObject[a] = o)), a
  25854. }
  25855. return R.warn('Showcase -> findRankedPano: Unable to find nearby pano.'), -1
  25856. }
  25857. })(),
  25858. findRankedtag: (function (e, t) {
  25859. var i = new c.Vector3(),
  25860. r = new c.Vector3()
  25861. return function (e, t) {
  25862. s(this.player, r), n(t, r, i)
  25863. var o = this.player.rankedtagInDirection(e, i)
  25864. if (o) {
  25865. var a = this.objectToHandle[o.sid]
  25866. return a || ((this.objectToHandle[o.sid] = a = this.handleCount++), (this.handleToObject[a] = o)), a
  25867. }
  25868. return R.warn('Showcase -> findRankedtag: Unable to find nearby tag.'), -1
  25869. }
  25870. })(),
  25871. clickNearesttag: function (e) {
  25872. this.clickRankedtag(0, e)
  25873. },
  25874. clickRankedtag: function (e, t) {
  25875. var i = a.call(this, e, t)
  25876. i && O.call(this, i)
  25877. },
  25878. clickNearestPano: function (e, t) {
  25879. this.clickRankedPano(0, e, t)
  25880. },
  25881. clickRankedPano: function (e, t, i) {
  25882. var n = o.call(this, e, t)
  25883. n ? r.call(this, n, i) : i(null)
  25884. },
  25885. clickPano: function (e, t) {
  25886. var i = this.handleTable[e]
  25887. i ? r.call(this, i, t) : t(null)
  25888. },
  25889. rotateDirection: (function () {
  25890. return function (e, t) {
  25891. var i = e.direction,
  25892. n = e.angle
  25893. if (!P.active) {
  25894. var r = 0,
  25895. o = 0,
  25896. a = 0,
  25897. s = 0
  25898. if (!n || isNaN(n))
  25899. return (
  25900. R.warn('Showcase -> rotateDirection: Invalid rotation angle.'),
  25901. void (
  25902. t &&
  25903. t({
  25904. success: !1,
  25905. error: 'Invalid rotation angle.'
  25906. })
  25907. )
  25908. )
  25909. if (this.player.mode === E.TRANSITIONING)
  25910. return (
  25911. R.warn('Automation -> rotateDirection: Cannot rotate while transitioning'),
  25912. void (
  25913. t &&
  25914. t({
  25915. success: !1,
  25916. error: 'Cannot rotate while transitioning'
  25917. })
  25918. )
  25919. )
  25920. if (i === v.RIGHT || i === v.LEFT) i === v.RIGHT && (n = -n), (r = n > 0 ? -1 : 1), (a = n)
  25921. else {
  25922. if (i !== v.UP && i !== v.DOWN)
  25923. return (
  25924. R.warn('Showcase -> rotateDirection: Invalid direction for rotation: ' + i),
  25925. void (
  25926. t &&
  25927. t({
  25928. success: !1,
  25929. error: 'Invalid direction for rotation.'
  25930. })
  25931. )
  25932. )
  25933. if (this.player.mode === E.FLOORPLAN)
  25934. return (
  25935. R.warn('Showcase -> rotateDirection: Cannot rotate ' + i + ' in floorplan mode'),
  25936. void (
  25937. t &&
  25938. t({
  25939. success: !1,
  25940. error: 'Cannot rotate ' + i + ' in floorplan mode'
  25941. })
  25942. )
  25943. )
  25944. if ((i === v.DOWN && (n = -n), (n = N.call(this, n)), 0 === n))
  25945. return (
  25946. R.warn('Showcase -> rotateDirection: Already at maximum rotation in direction: ' + i),
  25947. void (
  25948. t &&
  25949. t({
  25950. success: !1,
  25951. error: 'Already at maximum rotation in direction: ' + i
  25952. })
  25953. )
  25954. )
  25955. ;(o = n > 0 ? 1 : -1), (s = n)
  25956. }
  25957. var l = n
  25958. ;(n = c.Math.degToRad(n)), (a = c.Math.degToRad(a)), (s = c.Math.degToRad(s))
  25959. var h = this.controls.activeControl,
  25960. u = function () {
  25961. h.stopRotating(!0),
  25962. t &&
  25963. t({
  25964. success: !0,
  25965. message: 'Rotated ' + l.toFixed(2) + '° in direction: ' + e.direction
  25966. })
  25967. }
  25968. h.startRotating(r, o), P.start(a, s, this.player, u)
  25969. }
  25970. }
  25971. })(),
  25972. rotate: (function () {
  25973. var e = new c.Vector3(),
  25974. t = new c.Vector3()
  25975. return function (i, n) {
  25976. var r = i.xAngle,
  25977. o = i.yAngle
  25978. if (!P.active) {
  25979. if (((r = r || 0), (o = o || 0), isNaN(r) || isNaN(o)))
  25980. return (
  25981. R.warn('Showcase -> rotate: Invalid rotation angle.'),
  25982. void (
  25983. n &&
  25984. n({
  25985. success: !1,
  25986. error: 'Invalid rotation angle.'
  25987. })
  25988. )
  25989. )
  25990. if (this.player.mode === E.TRANSITIONING)
  25991. return (
  25992. R.warn('Automation -> rotate: Cannot rotate while transitioning'),
  25993. void (
  25994. n &&
  25995. n({
  25996. success: !1,
  25997. error: 'Cannot rotate while transitioning'
  25998. })
  25999. )
  26000. )
  26001. Math.abs(r) < 0.01 && (r = 0), Math.abs(o) < 0.01 && (o = 0)
  26002. var a = o
  26003. ;(o = N.call(this, o)), (r = -r)
  26004. var s = a > 0 ? 'UP' : 'DOWN'
  26005. if (!r && a && !o)
  26006. return (
  26007. R.warn('Showcase -> rotate: Already at maximum rotation in direction: ' + s),
  26008. void (
  26009. n &&
  26010. n({
  26011. success: !1,
  26012. error: 'Already at maximum rotation in direction: ' + s
  26013. })
  26014. )
  26015. )
  26016. a > o && R.warn('Showcase -> rotate: Reached maximum rotation in direction: ' + s)
  26017. var l = o
  26018. ;(o = c.Math.degToRad(o)),
  26019. (r = c.Math.degToRad(r)),
  26020. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  26021. this.player.getDirection(e),
  26022. t.copy(e).applyAxisAngle(I.UP, r),
  26023. t.applyAxisAngle(I.RIGHT, o)
  26024. var h = (e.angleTo(t), r > 0 ? -1 : r < 0 ? 1 : 0),
  26025. u = o > 0 ? 1 : o < 0 ? -1 : 0
  26026. Math.abs(r) > Math.abs(o) ? (u *= Math.abs(o / r)) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o))
  26027. var d = this.controls.activeControl,
  26028. p = function () {
  26029. d.stopRotating(!0),
  26030. n &&
  26031. n({
  26032. success: !0,
  26033. message: 'Rotated ' + i.xAngle.toFixed(2) + '° horizontally, ' + l.toFixed(2) + '° vertically'
  26034. })
  26035. }
  26036. d.startRotating(h, u), P.start(r, o, this.player, p)
  26037. }
  26038. }
  26039. })(),
  26040. panCamera: function (e, t) {
  26041. function i(e) {
  26042. switch ((r.removeAllListeners(T.AutoPanComplete), r.removeAllListeners(T.AutoPanInterrupt), r.removeAllListeners(T.AutoPanClamped), e)) {
  26043. case T.AutoPanInterrupt:
  26044. t({
  26045. success: !0,
  26046. message: 'Camera panning interrupted.'
  26047. })
  26048. break
  26049. case T.AutoPanClamped:
  26050. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  26051. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < 0.01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < 0.01)
  26052. return void t({
  26053. success: !1,
  26054. error: 'Already at edge of current model bounds.'
  26055. })
  26056. var i = 'The view point is outside the bounds for the current model. '
  26057. ;(i += 'The view point was clamped to ' + o(r.target.x, r.target.z)), console.warn(i)
  26058. }
  26059. case T.AutoPanComplete:
  26060. t({
  26061. success: !0,
  26062. message: 'Panned camera to position ' + o(r.autoPanPosition.x, r.autoPanPosition.z)
  26063. })
  26064. }
  26065. }
  26066. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  26067. return t({
  26068. success: !1,
  26069. error: 'Camera panning is not available in the current mode: ' + this.player.mode
  26070. })
  26071. var n = e.position,
  26072. r = this.player.control
  26073. r.setAutoPanPosition(n.x, n.z), (r.autoPan = !0)
  26074. var o = function (e, t) {
  26075. return '(' + e.toFixed(2) + ', ' + t.toFixed(2) + ')'
  26076. }
  26077. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)), r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)), r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  26078. },
  26079. click: function (e, t) {
  26080. var i = e.x,
  26081. n = e.y,
  26082. r = e.percentage
  26083. r === !0 && ((i = (i / 100) * $('#player').width()), (n = (n / 100) * $('#player').height())),
  26084. this.player.handleInputStart(i, n),
  26085. this.player.updateIntersect(),
  26086. this.player.handleInputEnd(i, n)
  26087. },
  26088. mouseOver: function (e, t) {
  26089. var i = e.x,
  26090. n = e.y,
  26091. r = e.percentage
  26092. r === !0 && ((i = (i / 100) * $('#player').width()), (n = (n / 100) * $('#player').height())), this.player.handleInputMove(i, n), this.player.updateIntersect()
  26093. },
  26094. moveToMode: function (e, t) {
  26095. function i(e) {
  26096. t(
  26097. e
  26098. ? {
  26099. success: !1,
  26100. error: 'Failed to load new mode: ' + e
  26101. }
  26102. : {
  26103. success: !0,
  26104. message: 'Moved to new mode: ' + n
  26105. }
  26106. )
  26107. }
  26108. var n = e.mode
  26109. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN
  26110. ? this.director.changeMode(n).then(
  26111. function () {
  26112. i()
  26113. },
  26114. function (e) {
  26115. i(e)
  26116. }
  26117. )
  26118. : t({
  26119. success: !1,
  26120. error: 'Invalid mode selection'
  26121. })
  26122. }
  26123. }
  26124. }).call(this, '/js/sdk/automation.js')
  26125. },
  26126. {
  26127. '../constants': 8,
  26128. '../enum/AlignmentType': 17,
  26129. '../enum/ControlEvents': 21,
  26130. '../enum/Direction': 22,
  26131. '../enum/GLCubeFaces': 25,
  26132. '../enum/Keys': 30,
  26133. '../enum/ModelManagerEvents': 33,
  26134. '../enum/PlayerEvents': 40,
  26135. '../enum/RenderLayers': 41,
  26136. '../enum/Vectors': 50,
  26137. '../enum/Viewmode': 51,
  26138. '../enum/WarpStyle': 52,
  26139. '../lib/jpeg_encoder': 94,
  26140. '../sdk/SdkEvents': 161,
  26141. '../settings': 166,
  26142. '../util/common': 185,
  26143. '../util/logger': 189,
  26144. '../util/math': 190,
  26145. '../util/panorama': 191,
  26146. './ApiHost': 159,
  26147. './PostMessageType': 160,
  26148. './TransitionStyles': 162,
  26149. three: 217
  26150. }
  26151. ],
  26152. 165: [
  26153. function (e, t, i) {
  26154. 'use strict'
  26155. function n(e) {
  26156. ;(this.sourceWindow = e), (this.targetWindow = null), (this.targetOrigin = null), (this.id = Math.floor(1e5 * Math.random())), this.bindEvents()
  26157. }
  26158. var r = e('./PostMessageType'),
  26159. o = e('events').EventEmitter
  26160. ;(n.prototype = Object.create(o.prototype)),
  26161. (n.prototype.bindEvents = function () {
  26162. this.sourceWindow.addEventListener('message', this.onPostmessageReceived.bind(this))
  26163. }),
  26164. (n.prototype.setTarget = function (e, t) {
  26165. ;(this.targetWindow = e), (this.targetOrigin = t)
  26166. }),
  26167. (n.prototype.onPostmessageReceived = function (e) {
  26168. var t = e.origin || e.originalEvent.origin,
  26169. i = e.source
  26170. switch (e.data.type) {
  26171. case r.CONNECT:
  26172. break
  26173. case r.RESPONSE:
  26174. if (this.id !== e.data.toId) return
  26175. default:
  26176. if (!this.validateMessageOrigin(t)) return
  26177. }
  26178. var n = e.data
  26179. ;(n.source = i), (n.origin = t), (n.timestamp = Date.now()), this.emit(e.data.type, n)
  26180. }),
  26181. (n.prototype.validateMessageOrigin = function (e) {
  26182. return '*' === this.targetOrigin || e === this.targetOrigin
  26183. }),
  26184. (n.prototype.send = function (e) {
  26185. this.targetWindow && this.targetOrigin && ((e.fromId = this.id), this.targetWindow.postMessage(e, this.targetOrigin))
  26186. }),
  26187. (t.exports = n)
  26188. },
  26189. {
  26190. './PostMessageType': 160,
  26191. events: 202
  26192. }
  26193. ],
  26194. 166: [
  26195. function (e, t, i) {
  26196. 'use strict'
  26197. var n = e('three'),
  26198. r = e('./util/browser'),
  26199. o = e('./enum/Viewmode'),
  26200. a = e('./enum/VROption'),
  26201. s = e('./enum/Colors'),
  26202. l = e('./enum/WarpStyle'),
  26203. c = e('./util/easing'),
  26204. h = e('./util/common'),
  26205. u = e('./util/showcase'),
  26206. d = e('./constants'),
  26207. p = {
  26208. debug: !1,
  26209. version: '2.25.6-0-gd87e5b1',
  26210. languageTag: r.valueFromHash('lang', null),
  26211. pageTitle: '四维虚拟漫游',
  26212. authorizationHeader: u.getAuthorizationHeader(),
  26213. autoplay: r.valueFromHash('play', !1) || !r.inIframe(),
  26214. logLevel: r.valueFromHash('log', 2),
  26215. skyboxRadius: 2500,
  26216. modelBoundsPadding: 5,
  26217. showNeighbors: !1,
  26218. brand: r.valueFromHash('brand', !0),
  26219. showHighlights: r.valueFromHash('hhl', !0) && r.valueFromHash('hr', 1),
  26220. startHighlights: r.valueFromHash('hl', -1),
  26221. specialEdition: r.valueFromHash('bn', 0),
  26222. useWheel: r.valueFromHash('wh', !0),
  26223. crossOrigin: 'anonymous',
  26224. fancierTransition: !1,
  26225. wireframe: !1,
  26226. skyboxWireframe: !1,
  26227. modelAlpha: 1,
  26228. highlightPanoSelection: !1,
  26229. showSweeps: !0,
  26230. showSkyboxes: !1,
  26231. showMesh: !0,
  26232. showFloors: !1,
  26233. showFloorDuration: 300,
  26234. showFloorDelay: 300,
  26235. hideFloorDuration: 300,
  26236. hideFloorDelay: 0,
  26237. reticuleOpacityTransitionTime: 250,
  26238. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue, // 方奕卓 配置鼠标标志颜色
  26239. markerOpacityTransitionTime: 500,
  26240. guiAnimationSpeed: 250,
  26241. highlightAnimationDuration: 500,
  26242. modelComponentLoadSpinnerDelay: 150,
  26243. captureErrors: !1,
  26244. maxMobileTextures: 6,
  26245. minimalMemoryMode: r.valueFromHash('m3', r.isMobile()),
  26246. startupFlyinDelay: 3e3,
  26247. dollhouseDefault: {
  26248. minDistance: 15,
  26249. maxDistance: 50,
  26250. minPolarAngle: n.Math.degToRad(10),
  26251. maxPolarAngle: n.Math.degToRad(90)
  26252. },
  26253. hideReticuleTimeout: 1e3,
  26254. analytics: {
  26255. inactivityThreshold: 30,
  26256. sessionTrackingRate: 0.15,
  26257. maxTrackedErrors: 20,
  26258. sessionDurationPingFrequency: 10,
  26259. sessionDurationTimeout: 15
  26260. },
  26261. flydown: {
  26262. movementEasing: 'easeInOutQuad',
  26263. movementDelay: 0.001,
  26264. rotationEasing: 'easeInOutQuad',
  26265. rotationDelay: 0.5,
  26266. modelTextureDelay: 0.75,
  26267. skyboxDelay: 0.75
  26268. },
  26269. transition: {
  26270. flySpeed: 0.001,
  26271. flyTime: 750,
  26272. flytimeMaxDistanceThreshold: 5,
  26273. flytimeDistanceMultiplier: 150,
  26274. aimTime: 1500,
  26275. aimSlowFactor: 1.5,
  26276. blur: 0.8,
  26277. movementEasing: 'easeInOutQuad',
  26278. blendEasing: 'easeInOutQuad',
  26279. fastForwardFactor: 4 //r.valueFromHash("mfis", 3) //快速停止导览的速度,原先是3
  26280. },
  26281. show360Views: {
  26282. enabled: !0,
  26283. transitionTime: 1e3
  26284. },
  26285. quickstart: {
  26286. enabled: 1 === r.valueFromHash('qust', 0) || 1 === r.valueFromHash('qs', 0),
  26287. animation: 1400,
  26288. showTextDelay: 500,
  26289. fadeOutDelay: 3e3,
  26290. fovChange: 10
  26291. },
  26292. appConfig: {
  26293. webvr_version: null,
  26294. segment_key: null,
  26295. embedly_key: null,
  26296. branch_key: null,
  26297. keen_write_key: null,
  26298. keen_project_id: null
  26299. },
  26300. vr: {
  26301. enabled: !0,
  26302. allowWebVR: !1,
  26303. option: r.valueFromHash('vr', a.CONTEXTUAL)
  26304. },
  26305. share: {
  26306. enabled: !r.valueFromHash('mls', 0) && r.valueFromHash('brand', !0)
  26307. },
  26308. input: {
  26309. longTapThreshold: 200,
  26310. moveToleranceNDC: 0.01, //.08,
  26311. touchMoveThreshold: 25
  26312. },
  26313. help: {
  26314. modalStayDuration: 600
  26315. },
  26316. immersive: {
  26317. timeToShowAgain: 1250,
  26318. uiStayDuration: 600
  26319. },
  26320. tourInteraction: {
  26321. disabled: '0' === r.valueFromHash('tourcta', null),
  26322. showPauseButton: 1e3,
  26323. showModal: 1500,
  26324. allowNextClick: 200,
  26325. largeModal: '1' === r.valueFromHash('tourcta', null),
  26326. smallModal: '2' === r.valueFromHash('tourcta', null)
  26327. },
  26328. labels: {
  26329. enabled: !1,
  26330. hideUntilStart: !0,
  26331. fadeInDuration: 250,
  26332. fadeInDelay: 250,
  26333. fadeOutDuration: 250,
  26334. fadeOutDelay: 0,
  26335. zoomHideThreshhold: {
  26336. mobile: r.isSmallScreen() ? 0.45 : 0.6,
  26337. desktop: 2
  26338. },
  26339. zoomTruncateThreshhold: {
  26340. mobile: r.isSmallScreen() ? 0.35 : 0.45,
  26341. desktop: 0.85
  26342. },
  26343. minLengthForTruncate: 16,
  26344. truncateLength: 12,
  26345. truncateSuffix: '...'
  26346. },
  26347. tags: {
  26348. enabled: r.valueFromHash('mt', 1),
  26349. startup: {
  26350. hideUntilStart: !0,
  26351. fadeInDuration: 500,
  26352. fadeInDelay: 100
  26353. },
  26354. visibility: {
  26355. anyDistance: !0,
  26356. visibleDistance: 8,
  26357. cameraClearance: 0.1,
  26358. alphaTestLevel: 0.05,
  26359. hideViaFloor: !0,
  26360. hideOffScreenDisc: !1,
  26361. hideOffScreenObject: !1
  26362. },
  26363. disc: {
  26364. opacity: 1,
  26365. disabledOpacity: 0.5,
  26366. scale: {
  26367. nearBound: 1.5,
  26368. farBound: 4.8,
  26369. linkFarBound: !1,
  26370. linkPercent: 40,
  26371. maxSize: 80,
  26372. minSize: 40,
  26373. baseViewportSize: 800,
  26374. responsiveness: 100
  26375. }
  26376. },
  26377. pole: {
  26378. enabled: !0,
  26379. height: 0.5,
  26380. width: 2,
  26381. opacity: 0.5,
  26382. color: 'white'
  26383. },
  26384. navigate: {
  26385. nearestPano: !0,
  26386. lineOfSight: !0,
  26387. reactivate: !0,
  26388. aimAt: 'disc',
  26389. tiltTolerance: 25,
  26390. rotateSpeedFactor: 0.6
  26391. }
  26392. },
  26393. path: {
  26394. color: window.DATA.floorMarkerColor || s.newBlue, // 方奕卓 配置导览标志颜色
  26395. colorUp: s._desat(s.newBlue, 0.5),
  26396. colorDown: s._darken(s.newBlue, 0.35),
  26397. opacity: 0.5,
  26398. style: 'ribbon',
  26399. height: 0.025,
  26400. ribbonWidth: 0.24,
  26401. outsideHeight: 0.5,
  26402. waypointRadius: 0.5,
  26403. waypointIndoorRadius: 0.24,
  26404. waypointPulse: 1e3,
  26405. typ: l.BLACK,
  26406. meshFree: r.valueFromHash('mf', 1),
  26407. mapGuides: r.valueFromHash('guides', !0),
  26408. fadeInTime: 400,
  26409. fadeOutTime: 300
  26410. },
  26411. warp: {
  26412. nearPanoDist: 0.1,
  26413. matchCam: !1,
  26414. blur: 0.33,
  26415. fastTime: 1500,
  26416. teleportTime: 1500, //瞬间过渡的时间
  26417. flytimeDistanceMultiplier: 150, //add
  26418. flyTime: 750, //add
  26419. outsideTime: 2e3,
  26420. lookAheadMax: 0.3,
  26421. lookAheadDist: 2.5,
  26422. softPushDist: 0.37,
  26423. softPushEnd: 0.3,
  26424. softBendAngle: 8,
  26425. softBendTilt: 4,
  26426. softBendEnd: 0.3,
  26427. doBurns: true, //r.valueFromHash("kb", !0),
  26428. burnsAngle: 8, //导览在每个点停留时的旋转角度
  26429. minBurnsAngle: 35,
  26430. minDownAngle: -35,
  26431. maxTurnPerSec: 280,
  26432. maxAimPerSec: 35,
  26433. minRotation: 12,
  26434. maxAimRotation: 33.2,
  26435. turnFriction: 0.2,
  26436. flySpeed: 0.01,
  26437. minWarpTime: 1200,
  26438. warpInterruptionRedirectTime: 500,
  26439. tourStepDelay: r.valueFromHash('st', 0),
  26440. walkDelay: 0,
  26441. walkMaxDist: 50,
  26442. walkMinDist: 0.8,
  26443. walkSlideShowThreshhold: 3000,
  26444. walkExtraPanosDistance: 0.4,
  26445. timePerMeter: 1200,
  26446. motionLeadTime: 5000,
  26447. movementEasing: 'easeInOutQuad',
  26448. blendEasing: 'easeInOutQuad',
  26449. showBunny: !1,
  26450. loop: r.valueFromHash('lp', !1),
  26451. auto: r.valueFromHash('ts', -1),
  26452. eOrder: 'YXZ', //"YXZ",
  26453. stepFactor: 0.25,
  26454. brakeStrength: 2,
  26455. minBrakeAngle: 0.1,
  26456. maxBrakeAngle: 1.8,
  26457. climbEffort: 4
  26458. },
  26459. rotationFriction: 0.05,
  26460. rotationAccelerationInside: 4.5,
  26461. rotationAccelerationOutside: 0.15,
  26462. rotationAfterMoveMultiplier: 40,
  26463. rotationAfterMoveHistoryCount: 5,
  26464. panFriction: 0.09,
  26465. panAccelerationOutside: 60,
  26466. onload: r.valueFromHash('onload', o.PANORAMA),
  26467. zoomNearLimit: 0.1,
  26468. zoomFarLimit: 50,
  26469. navigation: {
  26470. panoScores: !1,
  26471. mouseDirection: !0,
  26472. filterStrictness: 0.75,
  26473. angleFactor: -30,
  26474. directionFactor: 10,
  26475. distanceFactor: -1,
  26476. optionalityFactor: 3
  26477. },
  26478. sdkInit: !1,
  26479. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  26480. console: r.valueFromHash('console', !1),
  26481. noMeshFloorPositionOffset: new n.Vector3(0, -1.2, 0),
  26482. panoramaNeighbourMaxDistance: 5,
  26483. panoFloorClickRadius: 0.35,
  26484. showScreenshotLocations: !1,
  26485. showAxis: !1,
  26486. showNeighbourRaycasts: !1,
  26487. colorMarkerOnLoad: !1,
  26488. colorMarkerByFloor: !1,
  26489. tiling: {
  26490. panoPreRenderRepeatDelay: 2500,
  26491. panoPreRenderDelay: 500,
  26492. preRenderTourPanos: r.valueFromHash('tileprerender', 0),
  26493. tilingFlagNames: ['usetiles', 'tiles'],
  26494. maxNavPanoQuality: r.valueFromHash('maxtileq', null),
  26495. maxZoomPanoQuality: r.valueFromHash('maxztileq', null),
  26496. overlayStyle: r.valueFromHash('tileoverlay', 0),
  26497. uploadIntervalDelay: r.valueFromHash('tileupdelay', 10),
  26498. initialIntervalDelay: r.valueFromHash('itiledelay', 0),
  26499. maxNonBaseUploadsPerFrame: r.valueFromHash('maxnbtpf', 1 /* 2 */),
  26500. maxBaseUploadsPerFrame: r.valueFromHash('maxbtpf', 6),
  26501. customCompression: r.valueFromHash('tilecustcomp', 0),
  26502. // mobileHighQualityOverride: !1,
  26503. mobileHighQualityOverride: 1,
  26504. allowUltraHighResolution: true
  26505. },
  26506. zoom: {
  26507. enabled: true,
  26508. forceOff: r.valueFromHash('nozoom', 0),
  26509. overridemax: r.valueFromHash('maxzoom', null),
  26510. overridemin: r.valueFromHash('minzoom', null),
  26511. max: d.highQualityMaxZoom,
  26512. min: 1,
  26513. transitionStyle: r.valueFromHash('zoomtrans', 1),
  26514. activationThreshold: 1.1,
  26515. restoreTime: 500
  26516. },
  26517. profiling: {
  26518. enabled: r.valueFromHash('mem', !1)
  26519. }
  26520. }
  26521. ;(p = h.deepExtend(p, d, {
  26522. insideFOV: r.valueFromHash('fov', d.insideFOV),
  26523. insideFOVMax: r.valueFromHash('fovmax', d.insideFOVMax),
  26524. panorama: {
  26525. transitionTime: 1e3,
  26526. modelAlpha: 0,
  26527. modelAlphaDelay: p.flydown.modelTextureDelay,
  26528. modelAlphaLength: 1,
  26529. skyboxOpacity: 1,
  26530. skyboxOpacityDelay: p.flydown.skyboxDelay,
  26531. skyboxOpacityLength: 0.9,
  26532. fovLength: 1,
  26533. fovDelay: 0,
  26534. cameraMatrixDuration: 0.8,
  26535. cameraMatrixDelay: 0,
  26536. cameraMatrixEase: c.easeInCubic,
  26537. reticuleOpacity: 1,
  26538. markerOpacity: 0.3,
  26539. markerOpacityOnHover: 1
  26540. },
  26541. dollhouse: {
  26542. transitionTime: 1e3,
  26543. modelAlpha: 1,
  26544. modelAlphaDelay: 0,
  26545. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26546. skyboxOpacity: 0,
  26547. skyboxOpacityDelay: 0,
  26548. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26549. fovLength: 1,
  26550. fovDelay: 0,
  26551. cameraMatrixDuration: 0.8,
  26552. cameraMatrixDelay: 0.3,
  26553. cameraMatrixEase: c.easeInCubic,
  26554. reticuleOpacity: 1,
  26555. markerOpacity: 0,
  26556. markerOpacityOnHover: 0
  26557. },
  26558. floorplan: {
  26559. transitionTime: 1e3,
  26560. modelAlpha: 1,
  26561. modelAlphaDelay: 0,
  26562. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26563. skyboxOpacity: 0,
  26564. skyboxOpacityDelay: 0,
  26565. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26566. fovLength: 1,
  26567. fovDelay: 0,
  26568. cameraMatrixDuration: 0.5,
  26569. cameraMatrixDelay: 0,
  26570. cameraMatrixEase: c.easeOutCubic,
  26571. reticuleOpacity: 1,
  26572. markerOpacity: 0,
  26573. markerOpacityOnHover: 0,
  26574. cameraHeight: 50
  26575. },
  26576. transitioning: {
  26577. reticuleOpacity: 0,
  26578. markerOpacity: 0.3,
  26579. markerOpacityOnHover: 1
  26580. },
  26581. 'floorplan-dollhouse': {
  26582. rotationDelay: 0,
  26583. rotationDuration: 1
  26584. },
  26585. 'floorplan-panorama': {
  26586. rotationDelay: 0.5,
  26587. rotationDuration: 1
  26588. },
  26589. 'dollhouse-panorama': {
  26590. rotationDelay: 0.5,
  26591. rotationDuration: 1
  26592. },
  26593. 'dollhouse-floorplan': {
  26594. rotationDelay: 0,
  26595. rotationDuration: 1,
  26596. cameraMatrixDuration: 1.05,
  26597. cameraMatrixDelay: 0.5
  26598. },
  26599. 'panorama-dollhouse': {
  26600. rotationDelay: 0,
  26601. rotationDuration: 0.5
  26602. },
  26603. 'panorama-floorplan': {
  26604. transitionTime: 1500,
  26605. rotationDelay: 0,
  26606. rotationDuration: 0.5
  26607. }
  26608. })),
  26609. p.path.meshFree && (p.path.typ = l.WALK),
  26610. (p.zoom.max = p.zoom.overridemax || p.zoom.max),
  26611. (p.zoom.min = p.zoom.overridemin || p.zoom.min),
  26612. (window._settings = t.exports = p)
  26613. },
  26614. {
  26615. './constants': 8,
  26616. './enum/Colors': 19,
  26617. './enum/VROption': 47,
  26618. './enum/Viewmode': 51,
  26619. './enum/WarpStyle': 52,
  26620. './util/browser': 182,
  26621. './util/common': 185,
  26622. './util/easing': 186,
  26623. './util/showcase': 193,
  26624. three: 217
  26625. }
  26626. ],
  26627. 167: [
  26628. function (e, t, i) {
  26629. 'use strict'
  26630. var n = e('three'),
  26631. r = e('./settings'),
  26632. o =
  26633. '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',
  26634. a = 'precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n'
  26635. t.exports = {
  26636. basicTextured: {
  26637. uniforms: {
  26638. tDiffuse: {
  26639. type: 't',
  26640. value: null
  26641. },
  26642. alpha: {
  26643. type: 'f',
  26644. value: 1
  26645. }
  26646. },
  26647. vertexShader: 'varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  26648. fragmentShader:
  26649. '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}'
  26650. },
  26651. copyCubeMap: {
  26652. uniforms: {
  26653. tDiffuse: {
  26654. type: 't',
  26655. value: null
  26656. },
  26657. alpha: {
  26658. type: 'f',
  26659. value: 1
  26660. }
  26661. },
  26662. vertexShader:
  26663. 'varying vec3 vWorldPos;\nvoid main() {\n vWorldPos = vec3(-position.x, -position.y, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  26664. fragmentShader:
  26665. '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}'
  26666. },
  26667. cube: {
  26668. uniforms: {
  26669. map: {
  26670. type: 't',
  26671. value: null
  26672. },
  26673. opacity: {
  26674. type: 'f',
  26675. value: 1
  26676. }
  26677. },
  26678. vertexShader: o + 'varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n',
  26679. fragmentShader:
  26680. a +
  26681. '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'
  26682. },
  26683. model: {
  26684. uniforms: {
  26685. map: {
  26686. type: 't',
  26687. value: null
  26688. },
  26689. modelAlpha: {
  26690. type: 'f',
  26691. value: r.modelAlpha
  26692. },
  26693. opacity: {
  26694. type: 'f',
  26695. value: 1
  26696. },
  26697. progress: {
  26698. type: 'f',
  26699. value: 0
  26700. },
  26701. blackout: {
  26702. type: 'i',
  26703. value: 0
  26704. },
  26705. pano0Map: {
  26706. type: 't',
  26707. value: null
  26708. },
  26709. pano0Position: {
  26710. type: 'v3',
  26711. value: new n.Vector3()
  26712. },
  26713. pano0Matrix: {
  26714. type: 'm4',
  26715. value: new n.Matrix4()
  26716. },
  26717. pano1Map: {
  26718. type: 't',
  26719. value: null
  26720. },
  26721. pano1Position: {
  26722. type: 'v3',
  26723. value: new n.Vector3()
  26724. },
  26725. pano1Matrix: {
  26726. type: 'm4',
  26727. value: new n.Matrix4()
  26728. }
  26729. },
  26730. vertexShader:
  26731. o +
  26732. `uniform vec3 pano0Position;
  26733. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  26734. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  26735. varying vec3 vWorldPosition0;
  26736. varying vec3 vWorldPosition1;
  26737. uniform int blackout;
  26738. void main() {
  26739. vUv = uv;
  26740. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  26741. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  26742. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  26743. vWorldPosition0.x *= -1.0;
  26744. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  26745. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  26746. vWorldPosition1.x *= -1.0;
  26747. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  26748. }`,
  26749. fragmentShader:
  26750. a +
  26751. `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  26752. 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
  26753. void main() {
  26754. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  26755. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  26756. vec4 colorFromPanos;
  26757. if (blackout == 5){//add for TransitionPass
  26758. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  26759. }else{
  26760. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  26761. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  26762. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  26763. else if (blackout == 1) {
  26764. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  26765. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  26766. }
  26767. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  26768. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  26769. }
  26770. //#ifdef useModelMap //起不了作用为啥
  26771. if(modelAlpha>0.0){
  26772. vec4 colorFromTexture = texture2D( map, vUv );
  26773. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  26774. }
  26775. //#endif
  26776. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  26777. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  26778. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  26779. }`
  26780. },
  26781. hot: {
  26782. uniforms: {
  26783. color: {
  26784. type: 'c',
  26785. value: new n.Color(0xff2200)
  26786. },
  26787. opac: {
  26788. type: 'f',
  26789. value: 0
  26790. },
  26791. texture1: {
  26792. type: 't',
  26793. value: null
  26794. },
  26795. texture2: {
  26796. type: 't',
  26797. value: null
  26798. }
  26799. },
  26800. vertexShader: 'varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n',
  26801. fragmentShader:
  26802. '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'
  26803. },
  26804. modelOutside: {
  26805. uniforms: {
  26806. map: {
  26807. type: 't',
  26808. value: null
  26809. },
  26810. opacity: {
  26811. type: 'f',
  26812. value: 1
  26813. }
  26814. },
  26815. vertexShader: o + 'varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n',
  26816. fragmentShader:
  26817. a +
  26818. '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'
  26819. },
  26820. ribbon: {
  26821. uniforms: {
  26822. map: {
  26823. type: 't',
  26824. value: null
  26825. },
  26826. opacity: {
  26827. type: 'f',
  26828. value: 1
  26829. },
  26830. color: {
  26831. type: 'c',
  26832. value: new n.Color(r.path.color)
  26833. }
  26834. },
  26835. vertexShader:
  26836. o +
  26837. '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',
  26838. fragmentShader:
  26839. a +
  26840. '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'
  26841. },
  26842. waypoint: {
  26843. uniforms: {
  26844. map: {
  26845. type: 't',
  26846. value: null
  26847. },
  26848. opacity: {
  26849. type: 'f',
  26850. value: 1
  26851. },
  26852. pulse: {
  26853. type: 'f',
  26854. value: 1
  26855. },
  26856. nearFade: {
  26857. type: 'v2',
  26858. value: new n.Vector2(2 * r.insideNear, 2 * r.path.waypointIndoorRadius)
  26859. },
  26860. color: {
  26861. type: 'c',
  26862. value: new n.Color(r.reticuleColor)
  26863. }
  26864. },
  26865. vertexShader:
  26866. o +
  26867. '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',
  26868. fragmentShader:
  26869. a +
  26870. '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'
  26871. },
  26872. modelDebug: {
  26873. uniforms: {
  26874. map: {
  26875. type: 't',
  26876. value: null
  26877. },
  26878. modelAlpha: {
  26879. type: 'f',
  26880. value: r.modelAlpha
  26881. },
  26882. depthmapRatio: {
  26883. type: 'f',
  26884. value: 0
  26885. },
  26886. opacity: {
  26887. type: 'f',
  26888. value: 1
  26889. },
  26890. progress: {
  26891. type: 'f',
  26892. value: 0
  26893. },
  26894. considerOcclusion: {
  26895. type: 'i',
  26896. value: r.fancierTransition
  26897. },
  26898. highlightPanoSelection: {
  26899. type: 'i',
  26900. value: 0
  26901. },
  26902. useThirdPano: {
  26903. type: 'i',
  26904. value: r.useThirdPano
  26905. },
  26906. pano0Map: {
  26907. type: 't',
  26908. value: null
  26909. },
  26910. pano0Depth: {
  26911. type: 't',
  26912. value: null
  26913. },
  26914. pano0Position: {
  26915. type: 'v3',
  26916. value: new n.Vector3()
  26917. },
  26918. pano0Matrix: {
  26919. type: 'm4',
  26920. value: new n.Matrix4()
  26921. },
  26922. pano0Weight: {
  26923. type: 'f',
  26924. value: r.transition.pano0Weight
  26925. },
  26926. pano1Map: {
  26927. type: 't',
  26928. value: null
  26929. },
  26930. pano1Depth: {
  26931. type: 't',
  26932. value: null
  26933. },
  26934. pano1Position: {
  26935. type: 'v3',
  26936. value: new n.Vector3()
  26937. },
  26938. pano1Matrix: {
  26939. type: 'm4',
  26940. value: new n.Matrix4()
  26941. },
  26942. pano1Weight: {
  26943. type: 'f',
  26944. value: r.transition.pano1Weight
  26945. },
  26946. pano2Map: {
  26947. type: 't',
  26948. value: null
  26949. },
  26950. pano2Depth: {
  26951. type: 't',
  26952. value: null
  26953. },
  26954. pano2Position: {
  26955. type: 'v3',
  26956. value: new n.Vector3()
  26957. },
  26958. pano2Matrix: {
  26959. type: 'm4',
  26960. value: new n.Matrix4()
  26961. },
  26962. pano2Weight: {
  26963. type: 'f',
  26964. value: r.transition.pano2Weight
  26965. }
  26966. },
  26967. vertexShader:
  26968. o +
  26969. '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',
  26970. fragmentShader:
  26971. a +
  26972. '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'
  26973. },
  26974. customDepth: {
  26975. uniforms: {
  26976. panoPosition: {
  26977. type: 'v3',
  26978. value: new n.Vector3()
  26979. }
  26980. },
  26981. vertexShader:
  26982. o +
  26983. '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',
  26984. fragmentShader:
  26985. a +
  26986. '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'
  26987. },
  26988. skysphere: {
  26989. uniforms: {
  26990. radius: {
  26991. type: 'f',
  26992. value: 0
  26993. }
  26994. },
  26995. vertexShader:
  26996. o +
  26997. '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',
  26998. fragmentShader:
  26999. a +
  27000. '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'
  27001. },
  27002. tagDisc: {
  27003. uniforms: {
  27004. opacity: {
  27005. type: 'f',
  27006. value: 0
  27007. },
  27008. color: {
  27009. type: 'c',
  27010. value: new n.Color()
  27011. },
  27012. bg: {
  27013. type: 't',
  27014. value: null
  27015. },
  27016. mask: {
  27017. type: 't',
  27018. value: null
  27019. }
  27020. },
  27021. vertexShader: o + 'varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  27022. fragmentShader:
  27023. a +
  27024. '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'
  27025. }
  27026. }
  27027. },
  27028. {
  27029. './settings': 166,
  27030. three: 217
  27031. }
  27032. ],
  27033. 168: [
  27034. function (e, t, i) {
  27035. ;(function (i) {
  27036. 'use strict'
  27037. var n = e('three'),
  27038. r = (e('url'), e('./util/ajax')),
  27039. o = e('./settings'),
  27040. a = e('./util/logger'),
  27041. s = e('./util/math'),
  27042. l = e('./util/showcase'),
  27043. c = e('./objects/Panorama'),
  27044. h = new a(i),
  27045. u = e('./model/Model'),
  27046. d = e('./shaders'),
  27047. p = e('./util/transitions'),
  27048. f = e('./objects/Chunk'),
  27049. g = e('./objects/Reticule'),
  27050. m = e('./objects/Skybox'),
  27051. v = e('./objects/Floor'),
  27052. A = e('./cameras/DollhouseCamera'),
  27053. y = e('./cameras/FloorplanCamera'),
  27054. C = e('./cameras/PanoramaCamera'),
  27055. I = e('./controls/DollhouseControls'),
  27056. E = e('./controls/FloorplanControls'),
  27057. b = e('./controls/PanoramaControls')
  27058. ;(n.ImageUtils.crossOrigin = o.crossOrigin),
  27059. (t.exports = {
  27060. shaders: d,
  27061. transitions: p,
  27062. Model: u,
  27063. Chunk: f,
  27064. Floor: v,
  27065. Skybox: m,
  27066. Reticule: g,
  27067. Panorama: c,
  27068. DollhouseCamera: A,
  27069. FloorplanCamera: y,
  27070. PanoramaCamera: C,
  27071. DollhouseControls: I,
  27072. FloorplanControls: E,
  27073. PanoramaControls: b,
  27074. getModel: function (e) {
  27075. if (!e.url) throw 'getModel(): missing parameter "url"'
  27076. e.autoload = void 0 === e.autoload || e.autoload
  27077. var t = l.parseSidUrl(e.url)
  27078. ;(e.urlBase = t.urlBase), (e.urlModel = t.urlModel), (e.urlFiles = t.urlFiles)
  27079. var i = this._getPlatformError()
  27080. return i ? $.Deferred().reject(i).promise() : ((this.options = e), this._loadModel().then(this._buildModel.bind(this)))
  27081. },
  27082. _getPlatformError: function () {
  27083. return 'IE' === $.ua.browser.name && parseInt($.ua.browser.major) < 11
  27084. ? 'webgl-unsupported'
  27085. : 'iOS' === $.ua.os.name && /^[0-7][$\.]/.test($.ua.os.version)
  27086. ? 'webgl-ios'
  27087. : Modernizr.webgl
  27088. ? null
  27089. : 'webgl-unsupported'
  27090. },
  27091. _loadModel: function () {
  27092. return r
  27093. .get(this.options.urlModel, {
  27094. responseType: 'json',
  27095. prefetchFrom: 'model',
  27096. auth: l.getAuthorizationHeader()
  27097. })
  27098. .then(null, function () {
  27099. return h.warn('Model loading failed at initial metadata load'), 'loading-failed'
  27100. })
  27101. },
  27102. _buildModel: function (e) {
  27103. e = l.normalizeModeldata(e, s)
  27104. var t = new u(this.options, e)
  27105. return this.options.autoload ? t.load(!0) : $.when(t)
  27106. }
  27107. })
  27108. }).call(this, '/js/showcase.js')
  27109. },
  27110. {
  27111. './cameras/DollhouseCamera': 5,
  27112. './cameras/FloorplanCamera': 6,
  27113. './cameras/PanoramaCamera': 7,
  27114. './controls/DollhouseControls': 10,
  27115. './controls/FloorplanControls': 11,
  27116. './controls/PanoramaControls': 13,
  27117. './model/Model': 139,
  27118. './objects/Chunk': 144,
  27119. './objects/Floor': 146,
  27120. './objects/Panorama': 148,
  27121. './objects/Reticule': 149,
  27122. './objects/Skybox': 152,
  27123. './settings': 166,
  27124. './shaders': 167,
  27125. './util/ajax': 181,
  27126. './util/logger': 189,
  27127. './util/math': 190,
  27128. './util/showcase': 193,
  27129. './util/transitions': 195,
  27130. three: 217,
  27131. url: 208
  27132. }
  27133. ],
  27134. 169: [
  27135. function (e, t, i) {
  27136. 'use strict'
  27137. function n() {
  27138. var e = {
  27139. renderTarget: null,
  27140. inUse: !1,
  27141. size: -1,
  27142. pano: null
  27143. }
  27144. return e
  27145. }
  27146. function r(e) {
  27147. M.push(e)
  27148. }
  27149. function o(e) {
  27150. var t = n()
  27151. return (t.inUse = !0), (t.size = e), r(t), t
  27152. }
  27153. function a(e) {
  27154. for (var t = 0; t < M.length; t++) {
  27155. var i = M[t]
  27156. if (!i.inUse && i.size === e) return (i.inUse = !0), i
  27157. }
  27158. return null
  27159. }
  27160. function s(e) {
  27161. for (var t = 0; t < M.length; t++) {
  27162. var i = M[t]
  27163. if (i.renderTarget === e) return (i.inUse = !1), !0
  27164. }
  27165. return !1
  27166. }
  27167. function l() {
  27168. ;(this.tileDirectory = {}),
  27169. (this.activeRenderTargetDescriptors = {}),
  27170. (this.activePanos = []),
  27171. (this.panoLODDescriptors = {}),
  27172. (this.panoDescriptors = {}),
  27173. (this.tileTrees = {}),
  27174. (this.sceneRenderer = null),
  27175. (this.tileDownloader = null),
  27176. (this.forceQueue = []),
  27177. (this.uploadQueues = {}),
  27178. (this.uploadInterval = null),
  27179. (this.uploadIntervalCancelled = !1),
  27180. (this.usingTileOverlay = !1),
  27181. (this.overlayTilesLoaded = !1),
  27182. (this.overlayTileBase = null),
  27183. (this.overlayTilesBasic = {}),
  27184. (this.overlayTilesEnhanced = {}),
  27185. (this.zoomRenderTarget = null),
  27186. (this.zoomPano = null),
  27187. (this.zoomingActive = !1),
  27188. (this.zoomPanoId = null),
  27189. (this.zoomPanoRenderingDisabled = !1),
  27190. (this.direction = new h.Vector3()),
  27191. (this.initTime = -1),
  27192. (this.maxBaseUploadsPerFrame = x),
  27193. (this.maxNonBaseUploadsPerFrame = T)
  27194. }
  27195. function c() {
  27196. this.uploadIntervalCancelled ||
  27197. (this.overlayTilesLoaded || !this.usingTileOverlay
  27198. ? ((b = !0),
  27199. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  27200. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : (this.uploadInterval = null))
  27201. : this.refreshUploadInterval(this.uploadIntervalDelay))
  27202. }
  27203. /* function c() {
  27204. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  27205. this.updateUploadQueue(1, 2),
  27206. w = 18,
  27207. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  27208. } */
  27209. var h = e('three'),
  27210. u = e('../exception/BasicException'),
  27211. d = e('../settings'),
  27212. p = e('../enum/PanoSizeClass'),
  27213. f = (e('../objects/Panorama'), e('../enum/PanoRendererEvents')),
  27214. g = e('../enum/SceneRendererEvents'),
  27215. m = e('../enum/TileDownloaderEvents'),
  27216. v = e('../enum/Vectors'),
  27217. A = (e('../enum/GLCubeFaces'), e('../objects/Panorama'), e('./TileTree')),
  27218. y = (e('./TileDownloader'), e('./TilePrioritizer')),
  27219. C = e('./TileUtils'),
  27220. p = e('../enum/PanoSizeClass'),
  27221. I = (e('../util/browser'), e('../util/panorama')),
  27222. E = e('events').EventEmitter,
  27223. b = !1,
  27224. w = d.tiling.uploadIntervalDelay,
  27225. _ = d.tiling.initialIntervalDelay,
  27226. T = d.tiling.maxNonBaseUploadsPerFrame,
  27227. x = d.tiling.maxBaseUploadsPerFrame,
  27228. S = {
  27229. Base: 0,
  27230. Remaining: 1
  27231. },
  27232. M = []
  27233. window.targetList = M
  27234. ;(l.prototype = Object.create(E.prototype)),
  27235. (l.prototype.init = function (e, t, i) {
  27236. ;(this.sceneRenderer = e),
  27237. (this.tileDownloader = t),
  27238. (this.qualityManager = i),
  27239. this.bindEvents(),
  27240. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  27241. (this.initTime = performance.now())
  27242. }),
  27243. (l.prototype.getActivePanoTextures = function (e) {
  27244. e = e || []
  27245. for (var t = 0; t < M.length; t++) {
  27246. var i = M[t]
  27247. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  27248. }
  27249. }),
  27250. (l.prototype.hasQueuedTiles = function () {
  27251. var e = this.peekNextFromUploadQueue()
  27252. return null !== e && void 0 !== e
  27253. }),
  27254. (l.prototype.getActiveRenderTargetDescriptor = function (e) {
  27255. return this.activeRenderTargetDescriptors[e]
  27256. }),
  27257. (l.prototype.setActiveRenderTargetDescriptor = function (e, t) {
  27258. this.activeRenderTargetDescriptors[e] = t
  27259. }),
  27260. (l.prototype.loadOverlayTiles = function () {
  27261. if (0 !== d.tiling.overlayStyle) {
  27262. var e = 0,
  27263. t = function (t, n, r) {
  27264. ;(t = n
  27265. ? (t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping))
  27266. : (this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping))),
  27267. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  27268. e++,
  27269. e === i.length && (this.overlayTilesLoaded = !0)
  27270. }.bind(this),
  27271. i = [
  27272. ['images/outlineBase.png', t.bind(this, this.overlayTileBase, null)],
  27273. ['images/outlineBasic512.png', t.bind(this, this.overlayTilesBasic, 256)],
  27274. ['images/outlineBasic512.png', t.bind(this, this.overlayTilesBasic, 512)],
  27275. ['images/outlineBasic1024.png', t.bind(this, this.overlayTilesBasic, 1024)],
  27276. ['images/outlineBasic2048.png', t.bind(this, this.overlayTilesBasic, 2048)],
  27277. ['images/outlineBasic4096.png', t.bind(this, this.overlayTilesBasic, 4096)],
  27278. ['images/outlineEnhanced512.png', t.bind(this, this.overlayTilesEnhanced, 256)],
  27279. ['images/outlineEnhanced512.png', t.bind(this, this.overlayTilesEnhanced, 512)],
  27280. ['images/outlineEnhanced1024.png', t.bind(this, this.overlayTilesEnhanced, 1024)],
  27281. ['images/outlineEnhanced2048.png', t.bind(this, this.overlayTilesEnhanced, 2048)],
  27282. ['images/outlineEnhanced4096.png', t.bind(this, this.overlayTilesEnhanced, 4096)]
  27283. ]
  27284. i.forEach(
  27285. function (e) {
  27286. this.tileDownloader.loadImage(e[0], 0, e[1])
  27287. }.bind(this)
  27288. ),
  27289. (this.usingTileOverlay = !0)
  27290. } else this.usingTileOverlay = !1
  27291. }),
  27292. (l.prototype.bindEvents = function () {
  27293. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  27294. }),
  27295. (l.prototype.setupZoomRenderTarget = (function () {
  27296. var targets = {}
  27297. return function () {
  27298. if (this.qualityManager.maxRenderTargetSize == '2k' && this.qualityManager.getMaxNavPanoSize() == '2k') return //不使用zoomTarget 直接用pano的tiledPanoRenderTarget,防崩溃
  27299. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  27300. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize()) return
  27301. var e = this.zoomRenderTarget
  27302. var size = this.qualityManager.getMaxZoomPanoSize()
  27303. if (size > this.qualityManager.maxRenderTargetSize) {
  27304. return
  27305. }
  27306. if (targets[size]) {
  27307. this.zoomRenderTarget = targets[size]
  27308. } else {
  27309. this.zoomRenderTarget = this.initTiledPano(size, true) //放大后不使用抗锯齿,否则消耗更多内存
  27310. targets[size] = this.zoomRenderTarget
  27311. }
  27312. if (e) {
  27313. //将旧的zoomRenderTarget渲染到新zoomRenderTarget上
  27314. var t = e.width,
  27315. i = this.zoomRenderTarget.width
  27316. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  27317. e.texture.dispose(),
  27318. (e.texture.loaded = !1),
  27319. (e.texture.version = 0),
  27320. this.sceneRenderer.deallocateCubeTexture(e.texture),
  27321. (e.texture = null)
  27322. }
  27323. this.zoomPanoRenderingDisabled = !1
  27324. } else this.zoomPanoRenderingDisabled = !0
  27325. }
  27326. })()),
  27327. (l.prototype.enableHighQuality = function (e) {
  27328. //xzw add 如果最多只要2k图的话enableUltraHighQualityMode替换成这个
  27329. if (!this.qualityManager.highQualityModeStarted) {
  27330. this.setupZoomRenderTarget()
  27331. e()
  27332. this.qualityManager.highQualityModeStarted = true
  27333. }
  27334. }),
  27335. (l.prototype.enableUltraHighQualityMode = function (e) {
  27336. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  27337. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH)
  27338. this.tileDownloader.testDownload(
  27339. t,
  27340. C.TILE_SIZE,
  27341. function (t) {
  27342. t && (this.qualityManager.enableUltraHighQualityMode(), this.setupZoomRenderTarget(), e())
  27343. }.bind(this)
  27344. )
  27345. }
  27346. }),
  27347. (l.prototype.activateTiledPano = function (e, t, i) {
  27348. i && this.clearAllQueuedUploads()
  27349. for (var n = 0; n < C.FACES_PER_PANO; n++) this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize())
  27350. this.linkAllTilesAndNodes(e)
  27351. var r = this.getActiveRenderTargetDescriptor(e.id),
  27352. l = t
  27353. if ((l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()), !r || l !== r.size)) {
  27354. if ((r && s(r.renderTarget), (r = a(l)), !r)) {
  27355. var c = this.initTiledPano(l, !browser.isMobile() /* !1 */)
  27356. ;(r = o(c.width)), (r.renderTarget = c)
  27357. }
  27358. ;(r.pano = e), this.resetPanoDescriptor(e.id), this.resetPanoLODDescriptors(e.id), this.resetRenderStatus(e.id, !0, !0)
  27359. }
  27360. this.setActiveRenderTargetDescriptor(e.id, r)
  27361. var h = i ? 0 : 1
  27362. return this.updateActivePanos(e, h), r.renderTarget
  27363. }),
  27364. (l.prototype.deactivateTiledPano = function (e) {
  27365. var t = this.getActiveRenderTargetDescriptor(e.id)
  27366. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget), this.setActiveRenderTargetDescriptor(e.id, null)
  27367. var i = this.getUploadQueueForPano(e.id)
  27368. this.clearUploadQueue(i), this.updateActivePanos()
  27369. }),
  27370. (l.prototype.updateActivePanos = (function () {
  27371. var e = []
  27372. return function (t, i) {
  27373. e.length = 0
  27374. for (var n = 0; n < this.activePanos.length; n++) {
  27375. t && e.length === i && e.push(t)
  27376. var r = this.activePanos[n],
  27377. o = this.getActiveRenderTargetDescriptor(r.id)
  27378. ;(t && r.id === t.id) || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  27379. }
  27380. t && i >= e.length && e.push(t), (this.activePanos.length = 0), this.activePanos.push.apply(this.activePanos, e)
  27381. }
  27382. })()),
  27383. (l.prototype.getActivePanoCount = function () {
  27384. return this.activePanos.length
  27385. }),
  27386. (l.prototype.resetRenderStatus = function (e, t, i, n) {
  27387. var r = null
  27388. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1)
  27389. for (
  27390. var o = function (e, n, r, o) {
  27391. i && (n.tile.zoomUploaded = !1), t && (n.tile.uploaded = !1)
  27392. },
  27393. a = 0;
  27394. a < C.FACES_PER_PANO;
  27395. a++
  27396. ) {
  27397. var s = this.getTileTree(e, a)
  27398. s.breadthFirst({
  27399. callback: o.bind(this, a),
  27400. minLevel: r
  27401. })
  27402. }
  27403. }),
  27404. (l.prototype.copyBaseRenderStatusToZoomed = function (e) {
  27405. for (
  27406. var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()),
  27407. i = function (e, t, i, n) {
  27408. ;(t.tile.zoomUploaded = t.tile.uploaded), (t.zoomCovered = t.covered)
  27409. },
  27410. n = 0;
  27411. n < C.FACES_PER_PANO;
  27412. n++
  27413. ) {
  27414. var r = this.getTileTree(e, n)
  27415. r.breadthFirst({
  27416. callback: i.bind(this, n),
  27417. maxLevel: t
  27418. })
  27419. }
  27420. }),
  27421. (l.prototype.renderPanoTiles = (function () {
  27422. var e = []
  27423. return function (t, i, n, r) {
  27424. ;(this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize()) || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  27425. (i = i || this.direction || v.FORWARD)
  27426. var o = this.getActiveRenderTargetDescriptor(t)
  27427. if (!this.isRenderTargetDescriptorValid(o)) throw new u('PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.')
  27428. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  27429. var s = this.getTileTree(t, a)
  27430. ;(e.length = 0),
  27431. s.breadthFirst({
  27432. saveVisited: e
  27433. })
  27434. for (var l = 0; l < e.length; l++) {
  27435. var c = e[l]
  27436. this.queueTileUpload(c.tile, !1, r || (0 === l && n))
  27437. }
  27438. }
  27439. this.updateDirection(i)
  27440. }
  27441. })()),
  27442. (l.prototype.isRenderTargetDescriptorValid = function (e) {
  27443. return e && e.renderTarget
  27444. }),
  27445. (l.prototype.isPanoActive = function (e) {
  27446. var t = this.getActiveRenderTargetDescriptor(e)
  27447. return this.isRenderTargetDescriptorValid(t)
  27448. }),
  27449. (l.prototype.isPanoZoomed = function (e) {
  27450. return this.zoomingActive && this.zoomPanoId === e
  27451. }),
  27452. (l.prototype.initTileTree = function (e, t, i) {
  27453. var n = this.tileTrees[e]
  27454. n || ((n = []), (this.tileTrees[e] = n))
  27455. var r = n[t]
  27456. if (!r) {
  27457. var o = A.getLevelCountForSize(C.TILE_SIZE, i)
  27458. ;(r = new A(C.TILE_SIZE, o)), (n[t] = r)
  27459. }
  27460. }),
  27461. (l.prototype.getTileTree = function (e, t) {
  27462. var i = this.tileTrees[e]
  27463. if (!i) throw new u('PanoRenderer.getTileTree() -> Tree array not yet initialized!')
  27464. var n = i[t]
  27465. if (!n) throw new u('PanoRenderer.getTileTree() -> Tree not yet initialized!')
  27466. return n
  27467. }),
  27468. (l.prototype.initTiledPano = function (e, antialias) {
  27469. var i = this.sceneRenderer.renderer,
  27470. n =
  27471. (i.context,
  27472. new h.WebGLRenderTargetCube(e, e, {
  27473. stencilBuffer: !1
  27474. })),
  27475. r = new h.CubeTexture([])
  27476. ;(n.texture = r),
  27477. (r.image = [null, null, null, null, null, null]),
  27478. (r.flipY = !0),
  27479. //antialias: 如果抗锯齿的话,采用mipmap,会增加一倍的存储消耗。原版本都是不抗锯齿的。但是抗锯齿效果更柔和
  27480. antialias
  27481. ? ((r.generateMipmaps = !0), (r.magFilter = h.LinearFilter), (r.minFilter = h.LinearMipMapLinearFilter))
  27482. : ((r.generateMipmaps = !1), (r.magFilter = h.LinearFilter), (r.minFilter = h.LinearFilter)),
  27483. (r.format = h.RGBAFormat),
  27484. i.setRenderTarget(n),
  27485. i.setRenderTarget(null)
  27486. var o = i.properties.get(r)
  27487. return (o.__image__webglTextureCube = o.__webglTexture), n
  27488. }),
  27489. (l.prototype.getUploadQueueForPano = function (e) {
  27490. var t = this.uploadQueues[e]
  27491. return t || ((t = []), (this.uploadQueues[e] = t)), t
  27492. }),
  27493. (l.prototype.isTileUploaded = function (e) {
  27494. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  27495. }),
  27496. (l.prototype.setUploaded = function (e, t) {
  27497. this.isPanoZoomed(e.panoId) ? (e.zoomUploaded = t) : (e.uploaded = t)
  27498. }),
  27499. (l.prototype.queueTileUpload = function (e, t, i) {
  27500. var n = this.getActiveRenderTargetDescriptor(e.panoId)
  27501. if (
  27502. this.isRenderTargetDescriptorValid(n) &&
  27503. e.downloaded &&
  27504. !this.isTileUploaded(e) &&
  27505. (!e.uploadQueued || i) &&
  27506. (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)
  27507. ) {
  27508. var r = this.getUploadQueueForPano(e.panoId)
  27509. i
  27510. ? this.uploadTile(e, !1)
  27511. : (this.shoulPushToFrontOfQueue(e) ? this.forceQueue.push(e) : t && this.direction ? y.insertSortedPanoTile(r, e, n.pano, this.direction) : r.push(e),
  27512. (e.uploadQueued = !0),
  27513. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  27514. }
  27515. }),
  27516. (l.prototype.shoulPushToFrontOfQueue = function (e) {
  27517. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27518. }),
  27519. (l.prototype.getTopUploadQueue = function () {
  27520. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  27521. for (var n = 0; n < this.activePanos.length; n++)
  27522. if (((e = this.activePanos[n]), (t = this.getUploadQueueForPano(e.id)), t.length > 0))
  27523. switch (i) {
  27524. case S.Base:
  27525. if (0 === t[0].level) return t
  27526. break
  27527. case S.Remaining:
  27528. return t
  27529. }
  27530. return null
  27531. }),
  27532. (l.prototype.getNextFromUploadQueue = (function () {
  27533. var e = function (e) {
  27534. var t = e.shift()
  27535. return (t.uploadQueued = !1), t
  27536. }
  27537. return function () {
  27538. if (this.forceQueue.length > 0) return e(this.forceQueue)
  27539. var t = this.getTopUploadQueue()
  27540. return t && t.length > 0 ? e(t) : null
  27541. }
  27542. })()),
  27543. (l.prototype.peekNextFromUploadQueue = function () {
  27544. if (this.forceQueue.length > 0) return this.forceQueue[0]
  27545. var e = this.getTopUploadQueue()
  27546. return e && e.length > 0 ? e[0] : null
  27547. }),
  27548. (l.prototype.clearAllQueuedUploads = function () {
  27549. this.clearAllUploadQueues(null, 0)
  27550. }),
  27551. (l.prototype.clearAllQueuedUploadsForPano = function (e) {
  27552. this.clearAllUploadQueues(e, 0)
  27553. }),
  27554. (l.prototype.clearAllUploadQueues = function (e, t) {
  27555. if (e) this.clearUploadQueue(this.getUploadQueueForPano(e), t), this.clearUploadQueue(this.forceQueue, t, e)
  27556. else {
  27557. for (var i = 0; i < this.activePanos.length; i++) {
  27558. var n = this.activePanos[i]
  27559. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  27560. }
  27561. this.clearUploadQueue(this.forceQueue, t)
  27562. }
  27563. }),
  27564. (l.prototype.clearUploadQueue = function (e, t, i) {
  27565. ;(void 0 !== t && null !== t) || (t = 0)
  27566. for (var n = 0; n < e.length; ) {
  27567. var r = e[n]
  27568. ;(!i || (i && i === r.tile.panoId)) && r.level >= t ? ((r.uploadQueued = !1), e.splice(n, 1)) : n++
  27569. }
  27570. }),
  27571. (l.prototype.refreshUploadInterval = (function () {
  27572. var e = null
  27573. return function (t) {
  27574. this.uploadIntervalCancelled ||
  27575. (e || (e = c.bind(this)), (null !== t && void 0 !== t) || (t = w), b || (t = _), (this.uploadInterval = window.setTimeout(e, t)), (this.uploadIntervalDelay = t))
  27576. }
  27577. })()),
  27578. (l.prototype.update = (function () {
  27579. var e = performance.now(),
  27580. t = 0
  27581. return function () {
  27582. ;(this.uploadIntervalCancelled = !0), window.clearTimeout(this.uploadInterval), (this.uploadInterval = null)
  27583. var i = performance.now() - e
  27584. !(i > w || 0 === t) ||
  27585. (!this.overlayTilesLoaded && this.usingTileOverlay) ||
  27586. (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame), (e = performance.now())),
  27587. t++
  27588. }
  27589. })()),
  27590. (l.prototype.updateUploadQueue = function (e, t) {
  27591. e || (e = 1)
  27592. for (var i = 0, n = 0; ; ) {
  27593. if (n >= t || i >= e) break
  27594. var r = this.getNextFromUploadQueue()
  27595. if (!r) break
  27596. if ((0 !== r.level ? i++ : n++, !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  27597. var o = this.getActiveRenderTargetDescriptor(r.panoId)
  27598. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  27599. }
  27600. }
  27601. }),
  27602. (l.prototype.updateDirection = function (e) {
  27603. if ((e = e || this.direction)) {
  27604. this.direction = e
  27605. for (var t = 0; t < this.activePanos.length; t++) {
  27606. var i = this.activePanos[t],
  27607. n = this.getUploadQueueForPano(i.id)
  27608. y.sortPanoTiles(n, i, this.direction)
  27609. }
  27610. }
  27611. }),
  27612. (l.prototype.uploadTile = (function () {
  27613. var e = {},
  27614. t = (new h.Vector4(), d.tiling.overlayStyle)
  27615. //var failHistory = {};
  27616. return function (i, n) {
  27617. var r = i.panoId,
  27618. o = i.image,
  27619. a = i.tileSize,
  27620. s = i.panoSize,
  27621. l = i.tileIndex,
  27622. c = (i.faceTileIndex, i.totalTiles),
  27623. u = (i.face, i.tileX),
  27624. d = i.tileY,
  27625. p = !0,
  27626. g = !1,
  27627. m = (this.getPanoDescriptor(r), this.getPanoLODDescriptor(r, s)),
  27628. v = this.getActiveRenderTargetDescriptor(r),
  27629. A = v.renderTarget,
  27630. y = v.size
  27631. if (
  27632. (this.isPanoZoomed(r) && ((A = this.zoomRenderTarget), (y = A.width)), //this.qualityManager.getMaxZoomPanoSize()),
  27633. this.isRenderTargetDescriptorValid(v) || ((p = !1), (g = !1)),
  27634. n || (this.anyUploaded(i.node) && ((p = !1), (g = !0)), this.isTileUploaded(i) && ((p = !1), (g = !1))),
  27635. p)
  27636. ) {
  27637. /* if(failHistory[''+r+s+l]){
  27638. console.log('uploadTile retry', r, s, l)
  27639. }
  27640. console.log('uploadTile 成功', r, s, l)
  27641. */
  27642. var C = u * a,
  27643. I = d * a,
  27644. E = (a / s) * y,
  27645. b = (C / s) * y,
  27646. w = (I / s) * y
  27647. if (s > this.qualityManager.maxRenderTargetSize) {
  27648. player.model.getHighImage(o, i.cubeFace, u, d)
  27649. } else {
  27650. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping))
  27651. var _ = e[a]
  27652. this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a)
  27653. if (1 === t || 2 === t) {
  27654. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced
  27655. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  27656. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, 0.5)
  27657. } else this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace)
  27658. }
  27659. m.uploadCount++, this.emit(f.TileRenderSuccess, r, s, l, c), m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c), this.setUploaded(i, !0), this.addCoverageForNode(i.node)
  27660. } else {
  27661. this.setUploaded(i, !1)
  27662. //console.log('uploadTile 失败', r, s, l)
  27663. //failHistory[''+r+s+l] = true;
  27664. }
  27665. return (
  27666. i.uploadAttempted || (m.uploadAttempts++, this.emit(f.TileUploadAttempted, r, s, l, c)),
  27667. (i.uploadAttempted = !0),
  27668. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  27669. g
  27670. )
  27671. }
  27672. })()),
  27673. (l.prototype.linkTileAndNode = function (e, t) {
  27674. ;(t.tile = e), (e.node = t)
  27675. }),
  27676. (l.prototype.linkAllTilesAndNodes = function (e) {
  27677. for (
  27678. var t = function (t, i, n, r, o) {
  27679. var a = this.getTileDirectoryEntry(e.id, i, r, o)
  27680. this.linkTileAndNode(a, n)
  27681. },
  27682. i = 0;
  27683. i < C.FACES_PER_PANO;
  27684. i++
  27685. ) {
  27686. var n = this.getTileTree(e.id, i)
  27687. n.breadthFirst({
  27688. callback: t.bind(this, n, i)
  27689. })
  27690. }
  27691. }),
  27692. (l.prototype.anyUploaded = function (e) {
  27693. if (!e) return !1
  27694. if (e.tile && this.isTileUploaded(e.tile)) return !0
  27695. if (e.children)
  27696. for (var t = 0; t < e.children.length; t++) {
  27697. var i = e.children[t]
  27698. if (this.anyUploaded(i)) return !0
  27699. }
  27700. return !1
  27701. }),
  27702. (l.prototype.setNodeCovered = function (e, t) {
  27703. this.isPanoZoomed(e.tile.panoId) ? (e.zoomCovered = t) : (e.covered = t)
  27704. }),
  27705. (l.prototype.isNodeCovered = function (e) {
  27706. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  27707. }),
  27708. (l.prototype.addCoverageForNode = function (e) {
  27709. if ((this.setNodeCovered(e, !0), e.parent && e.covered)) {
  27710. var t = e.parent
  27711. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  27712. }
  27713. }),
  27714. (l.prototype.calcFullCoverage = function (e) {
  27715. var t = !1
  27716. if (e.children)
  27717. for (var i = 0; i < e.children.length; i++) {
  27718. var n = e.children[i]
  27719. t = t || this.calcFullCoverage(n)
  27720. }
  27721. e.covered = e.tile.uploaded || t
  27722. }),
  27723. (l.prototype.nodeSubcovered = function (e) {
  27724. if (!e.children) return !1
  27725. for (var t = 0; t < e.children.length; t++) if (!e.children[t] || !this.isNodeCovered(e.children[t])) return !1
  27726. return !0
  27727. }),
  27728. (l.prototype.resetPanoDescriptor = function (e) {
  27729. this.getPanoDescriptor(e)
  27730. }),
  27731. (l.prototype.getPanoDescriptor = function (e) {
  27732. var t = this.panoDescriptors[e]
  27733. return t || ((t = {}), (this.panoDescriptors[e] = t)), t
  27734. }),
  27735. (l.prototype.resetPanoLODDescriptors = function (e) {
  27736. var t = this.getPanoLODDescriptors(e)
  27737. for (var i in t)
  27738. if (t.hasOwnProperty(i)) {
  27739. var n = t[i]
  27740. ;(n.uploadCount = 0), (n.uploadAttempts = 0)
  27741. }
  27742. }),
  27743. (l.prototype.getPanoLODDescriptor = function (e, t) {
  27744. var i = this.getPanoLODDescriptors(e),
  27745. n = i[t]
  27746. return (
  27747. n ||
  27748. ((n = {
  27749. uploadCount: 0,
  27750. uploadAttempts: 0
  27751. }),
  27752. (i[t] = n)),
  27753. n
  27754. )
  27755. }),
  27756. (l.prototype.getPanoLODDescriptors = function (e) {
  27757. var t = this.panoLODDescriptors[e]
  27758. return t || ((t = {}), (this.panoLODDescriptors[e] = t)), t
  27759. }),
  27760. (l.prototype.onTileDownloaded = function (e) {
  27761. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize),
  27762. i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex)
  27763. if (
  27764. ((i.downloaded = !0),
  27765. (i.image = e.image),
  27766. (i.panoSize = e.panoSize),
  27767. (i.tileX = e.tileX),
  27768. (i.tileY = e.tileY),
  27769. (i.totalTiles = e.totalTiles),
  27770. (i.tileIndex = e.tileIndex),
  27771. (i.faceTileIndex = e.faceTileIndex),
  27772. (i.face = e.face),
  27773. (i.cubeFace = I.mapFaceToCubemapFace(e.face)),
  27774. (i.panoId = e.panoId),
  27775. (i.tileSize = e.tileSize),
  27776. (i.direction = new h.Vector3().copy(e.direction)),
  27777. (i.node = null),
  27778. (i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize)),
  27779. this.isPanoActive(i.panoId))
  27780. ) {
  27781. var n = this.getTileTree(i.panoId, i.face),
  27782. r = n.getSubNode(i.panoSize, i.tileX, i.tileY)
  27783. this.linkTileAndNode(i, r), this.queueTileUpload(i, !0)
  27784. }
  27785. }),
  27786. (l.prototype.getTileDirectoryEntry = function (e, t, i, n) {
  27787. var r = this.tileDirectory[e]
  27788. r || ((r = {}), (this.tileDirectory[e] = r))
  27789. var o = 16384 * t + 1024 * i + n,
  27790. a = r[o]
  27791. return (
  27792. a ||
  27793. ((a = {
  27794. downloaded: !1,
  27795. uploaded: !1,
  27796. zoomUploaded: !1
  27797. }),
  27798. (r[o] = a)),
  27799. (a._key = e + ':' + t + ':' + i + ':' + n),
  27800. (a._tileKey = o),
  27801. a
  27802. )
  27803. }),
  27804. (l.prototype.setZoomingActive = function (e, t, i) {
  27805. this.zoomPanoRenderingDisabled ||
  27806. (e === this.zoomingActive && this.zoomPanoId === t.id) ||
  27807. ((this.zoomingActive = e), (this.zoomPanoId = t.id), this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  27808. }),
  27809. (l.prototype.updateZoomedPanoFromBase = function (e) {
  27810. if (!this.zoomPanoRenderingDisabled) {
  27811. var t = this.getActiveRenderTargetDescriptor(e.id)
  27812. if (t && t.renderTarget) {
  27813. var i = Math.min(this.qualityManager.maxRenderTargetSize, this.qualityManager.getMaxZoomPanoSize()), //this.qualityManager.getMaxZoomPanoSize()
  27814. n = t.renderTarget,
  27815. r = t.size
  27816. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i), this.copyBaseRenderStatusToZoomed(e.id)
  27817. }
  27818. }
  27819. }),
  27820. (t.exports = l)
  27821. },
  27822. {
  27823. '../enum/GLCubeFaces': 25,
  27824. '../enum/PanoRendererEvents': 35,
  27825. '../enum/PanoSizeClass': 36,
  27826. '../enum/SceneRendererEvents': 43,
  27827. '../enum/TileDownloaderEvents': 45,
  27828. '../enum/Vectors': 50,
  27829. '../exception/BasicException': 55,
  27830. '../objects/Panorama': 148,
  27831. '../settings': 166,
  27832. '../util/browser': 182,
  27833. '../util/panorama': 191,
  27834. './TileDownloader': 171,
  27835. './TilePrioritizer': 172,
  27836. './TileTree': 173,
  27837. './TileUtils': 174,
  27838. events: 202,
  27839. three: 217
  27840. }
  27841. ],
  27842. 170: [
  27843. function (e, t, i) {
  27844. 'use strict'
  27845. function n(e, t, i) {
  27846. ;(this.maxNavPanoSize = -1),
  27847. (this.maxZoomPanoSize = -1),
  27848. (this.devicePixelDensity = e),
  27849. (this.deviceScreenSize = t),
  27850. (this.clientBandwidth = i),
  27851. (this.panoSizeClassMap = {}),
  27852. (this.useHighResolutionPanos = !0),
  27853. (this.useUltraHighResolutionPanos = !1),
  27854. (this.modelHasUltraHighPanos = !1)
  27855. this.maxRenderTargetSize = a.isMobile() ? 2048 : 4096 //add
  27856. this.maxRenderTargetSize = Math.min(common.getMaxCubemapSize(), this.maxRenderTargetSize) //add
  27857. }
  27858. var r = e('../enum/PanoSizeClass'),
  27859. o = e('../settings'),
  27860. a = e('../util/browser'),
  27861. s = e('../constants'),
  27862. l = e('../util/showcase'),
  27863. c = e('../enum/ModelManagerEvents')
  27864. ;(n.prototype.init = function (e) {
  27865. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  27866. (this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH)),
  27867. (this.highSize = this.getPanoSize(r.HIGH)),
  27868. (this.standardSize = this.getPanoSize(r.STANDARD)),
  27869. (this.baseSize = this.getPanoSize(r.BASE)),
  27870. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  27871. (this.highQualityThreshold = a.valueFromHash('threshold2k', s.windowHeightHighQualityThreshold)),
  27872. this.updateMaximums(),
  27873. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  27874. }),
  27875. (n.prototype.updateFromModel = function (e) {
  27876. this.updateHighResolutionSettings(e), this.updateUltraHighResolutionSettings(e)
  27877. }),
  27878. (n.prototype.updateHighResolutionSettings = function (e) {
  27879. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  27880. l.modelDataPromisesTiles(e.data) ? (this.useHighResolutionPanos = !0) : (this.useHighResolutionPanos = !1),
  27881. //this.useHighResolutionPanos = !0;
  27882. //----------------------e n d -----------------------------------------------------------------
  27883. this.updateMaximums()
  27884. }),
  27885. (n.prototype.updateUltraHighResolutionSettings = function (e) {
  27886. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? (this.useUltraHighResolutionPanos = !0) : (this.useUltraHighResolutionPanos = !1), this.updateMaximums()
  27887. }),
  27888. (n.prototype.enableUltraHighQualityMode = function () {
  27889. ;(this.modelHasUltraHighPanos = !0), this.updateUltraHighResolutionSettings(null)
  27890. }),
  27891. (n.prototype.ultraHighQualityModeEnabled = function () {
  27892. return this.modelHasUltraHighPanos
  27893. }),
  27894. (n.prototype.onModelChanged = function (e) {
  27895. this.updateFromModel(e.model), this.updateMaximums()
  27896. }),
  27897. (n.prototype.updateMaximums = function () {
  27898. ;(this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize()),
  27899. (this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize()),
  27900. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  27901. }),
  27902. (n.prototype.buildPanoSizeClassMap = function () {
  27903. ;(this.panoSizeClassMap[r.BASE] = 512), (this.panoSizeClassMap[r.STANDARD] = 1024), (this.panoSizeClassMap[r.HIGH] = 2048), (this.panoSizeClassMap[r.ULTRAHIGH] = 4096)
  27904. }),
  27905. (n.prototype.getPanoSize = function (e) {
  27906. return this.panoSizeClassMap[e]
  27907. }),
  27908. (n.prototype.getMaxPossiblePanoSize = function () {
  27909. return this.getPanoSize(r.ULTRAHIGH)
  27910. }),
  27911. (n.prototype.getMaxPanoSize = function () {
  27912. return this.maxZoomPanoSize
  27913. }),
  27914. (n.prototype.getMaxNavPanoSize = function () {
  27915. return this.maxNavPanoSize
  27916. }),
  27917. (n.prototype.getMaxZoomPanoSize = function () {
  27918. return this.maxZoomPanoSize
  27919. }),
  27920. /* n.prototype.detectMaxNavPanoSizeClass = function() {
  27921. if(settings.mobileNavHigh)return r.HIGH //改
  27922. else return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  27923. } */
  27924. (n.prototype.detectDevice = function () {
  27925. //add
  27926. if (a.isMobile()) {
  27927. let area = $('#player').width() * $('#player').height()
  27928. if (area < 768 * 1024) {
  27929. //ipad mini full screen 大场景拍的质量很好默认不需要很高清
  27930. return 'mobile'
  27931. } else {
  27932. return 'bigMobile'
  27933. }
  27934. } else {
  27935. return 'pc'
  27936. }
  27937. })
  27938. ;(n.prototype.detectMaxNavPanoSizeClass = function () {
  27939. //xzw 改
  27940. switch (this.getNavZoomClass()) {
  27941. case '1k':
  27942. return r.STANDARD
  27943. break
  27944. case '2k':
  27945. default:
  27946. return r.HIGH
  27947. case '4k':
  27948. return r.ULTRAHIGH
  27949. }
  27950. }),
  27951. (n.prototype.detectMaxNavPanoSize = function () {
  27952. var e = this.detectMaxNavPanoSizeClass()
  27953. return this.getPanoSize(e)
  27954. }),
  27955. (n.prototype.getMaxZoomClass = function () {
  27956. //add
  27957. let type = this.detectDevice()
  27958. let setting = settings.tileClass[type] //见manage.js的settings
  27959. return setting.max
  27960. })
  27961. ;(n.prototype.getNavZoomClass = function () {
  27962. //add
  27963. let type = this.detectDevice()
  27964. let setting = settings.tileClass[type]
  27965. return setting.nav
  27966. }),
  27967. (n.prototype.detectMaxZoomPanoSize = function () {
  27968. //获取当前zoomRenderTarget应下载的最高级别
  27969. //若是有三个级别,每次只需要加载到当前的zoomLevel;而两级时因为有zoomed来判断是使用基本贴图还是zoomRenderTarget,所以只需要返回最大的即可
  27970. if (this.zoomLevelResolution) {
  27971. //有三个级别
  27972. if (this.zoomLevelResolution == '4k' && this.useUltraHighResolutionPanos) {
  27973. return this.getPanoSize(r.ULTRAHIGH)
  27974. } else if (this.zoomLevelResolution == '1k' || !this.useHighResolutionPanos) {
  27975. return this.getPanoSize(r.STANDARD)
  27976. } else {
  27977. return this.getPanoSize(r.HIGH)
  27978. }
  27979. } else {
  27980. let tileClass = this.getMaxZoomClass()
  27981. if (tileClass == '1k') return this.getPanoSize(r.STANDARD)
  27982. if (tileClass == '4k' && this.useUltraHighResolutionPanos) {
  27983. return this.getPanoSize(r.ULTRAHIGH)
  27984. } else {
  27985. //'2k'
  27986. return this.getPanoSize(r.HIGH)
  27987. }
  27988. }
  27989. }),
  27990. /* n.prototype.detectMaxZoomPanoSize = function() {
  27991. 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)
  27992. } */
  27993. (t.exports = n)
  27994. },
  27995. {
  27996. '../constants': 8,
  27997. '../enum/ModelManagerEvents': 33,
  27998. '../enum/PanoSizeClass': 36,
  27999. '../settings': 166,
  28000. '../util/browser': 182,
  28001. '../util/showcase': 193
  28002. }
  28003. ],
  28004. 171: [
  28005. function (e, t, i) {
  28006. ;(function (i) {
  28007. 'use strict'
  28008. function n(e) {
  28009. ;(this.panos = null),
  28010. (this.retryMinimumTime = 1e4),
  28011. (this.urls = null),
  28012. (this.panoLoadCallbacks = {}),
  28013. (this.downloadDescriptors = {}),
  28014. (this.priorityQueue = []),
  28015. (this.forceQueue = []),
  28016. (this.activeDownloads = []),
  28017. (this.qualityManager = null),
  28018. (this.tilePrioritizer = null),
  28019. (this.refreshInterval = null),
  28020. (this.processPriorityQueue = !1),
  28021. (this.concurrentDownloads = e.concurrentDownloads || 1),
  28022. (this.downloadTestResults = {})
  28023. }
  28024. var r = e('three'),
  28025. o = (e('../enum/Viewmode'), e('../settings')),
  28026. a = (e('../objects/Panorama'), e('../util/logger')),
  28027. s = (e('../enum/Vectors'), e('../enum/PanoSizeClass'), e('../enum/TileDownloaderEvents')),
  28028. l = e('./TilePrioritizer'),
  28029. c = e('./TileUtils'),
  28030. h = (e('../enum/GLCubeFaces'), e('../enum/DownloadStatus')),
  28031. u = e('../util/panorama'),
  28032. d = e('../util/ajax'),
  28033. p = e('../ab'),
  28034. f = e('events').EventEmitter,
  28035. g =
  28036. (new a(i),
  28037. Object.freeze({
  28038. Testing: 1,
  28039. Success: 2,
  28040. Fail: 3
  28041. }))
  28042. ;(n.prototype = Object.create(f.prototype)),
  28043. (n.IDLE_REFRESH_DELAY = 500),
  28044. (n.ACTIVE_REFRESH_DELAY = 16),
  28045. (n.DOWNLOAD_RETRIES = 4),
  28046. (n.prototype.init = function (e) {
  28047. this.qualityManager = e
  28048. }),
  28049. (n.prototype.setUrls = function (e) {
  28050. this.urls = e
  28051. }),
  28052. (n.prototype.setPanoData = function (e, t, i) {
  28053. ;(this.panos = e), (this.imagePanos = t), (this.panoGroupId = i)
  28054. }),
  28055. (n.prototype.start = function () {
  28056. this.refreshUpdateInterval(0)
  28057. }),
  28058. (n.prototype.stop = function () {
  28059. window.cancel(this.refreshInterval)
  28060. }),
  28061. (n.prototype.refreshUpdateInterval = function (e) {
  28062. e || (e = 0),
  28063. (this.refreshInterval = window.setTimeout(
  28064. function () {
  28065. var e = this.update()
  28066. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  28067. }.bind(this),
  28068. e
  28069. ))
  28070. }),
  28071. (n.prototype.update = function () {
  28072. var e = this.forceQueue.length > 0
  28073. return (
  28074. this.processQueueForDownloading(this.forceQueue),
  28075. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos), this.priorityQueue.length > 0 && (e = !0), this.processQueueForDownloading(this.priorityQueue)),
  28076. e
  28077. )
  28078. }),
  28079. (n.prototype.forceQueueTilesForPano = (function () {
  28080. var e = [],
  28081. t = []
  28082. return function (i, n, r, o, a, s) {
  28083. e.length = 0
  28084. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  28085. var p = u[d]
  28086. ;(p.status !== h.None && p.status !== h.Queued) || e.push(p)
  28087. }
  28088. if (r && e.length > 0) {
  28089. l.sortPanoTiles(e, i, r), (t.length = 0), c.matchingTilesInDirection(i, n, r, o, a, t)
  28090. for (
  28091. var f = 0,
  28092. g = function (e) {
  28093. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  28094. };
  28095. f < e.length;
  28096. ) {
  28097. var m = e[f],
  28098. v = t.findIndex(g)
  28099. v < 0 ? e.splice(f, 1) : f++
  28100. }
  28101. }
  28102. for (var A = 0; A < e.length; A++) this.forceQueue.push(e[A])
  28103. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued), this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1), s && this.processQueueForDownloading(this.forceQueue, !0)
  28104. }
  28105. })()),
  28106. (n.prototype.clearForceQueue = function () {
  28107. this.clearQueue(this.forceQueue)
  28108. }),
  28109. (n.prototype.queuePrioritizedTilesForPanos = function (e) {
  28110. this.tilePrioritizer &&
  28111. (this.clearQueue(this.priorityQueue),
  28112. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  28113. this.clearFromQueue(this.priorityQueue, h.None, !0),
  28114. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  28115. }),
  28116. (n.prototype.clearQueue = function (e) {
  28117. this.setStatusForAllDescriptors(e, h.None), (e.length = 0)
  28118. }),
  28119. (n.prototype.clearFromQueue = function (e, t, i) {
  28120. for (var n = 0; n < e.length; n++) {
  28121. var r = e[n]
  28122. r && ((t === r.status && !i) || (t !== r.status && i)) && (e[n] = null)
  28123. }
  28124. }),
  28125. (n.prototype.setStatusForAllDescriptors = function (e, t) {
  28126. for (var i = 0; i < e.length; i++) {
  28127. var n = e[i]
  28128. n && (n.status = t)
  28129. }
  28130. }),
  28131. (n.prototype.setStatusOrRemoveForAllDescriptors = function (e, t) {
  28132. for (var i = 0; i < e.length; i++) {
  28133. var n = e[i]
  28134. n && (n.status !== t ? (n.status = t) : (e[i] = null))
  28135. }
  28136. }),
  28137. (n.prototype.getTileDownloadDescriptors = function (e, t) {
  28138. var i = this.getAllTileDownloadDescriptorsForPano(e),
  28139. n = i[t]
  28140. return n || ((n = this.buildDownloadDescriptorArray(t)), (i[t] = n), this.initTileDownloadDescriptors(n, e, t)), n
  28141. }),
  28142. (n.prototype.getAllTileDownloadDescriptorsForPano = function (e) {
  28143. var t = this.downloadDescriptors[e.id]
  28144. return t || ((t = {}), (this.downloadDescriptors[e.id] = t)), t
  28145. }),
  28146. (n.prototype.processQueueForDownloading = function (e, t) {
  28147. if ((this.cleanupActiveDownloads(), this.activeDownloads.length < this.concurrentDownloads || t))
  28148. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  28149. var o = e.shift()
  28150. o && (this.startDownload(o), n++)
  28151. }
  28152. }),
  28153. (n.prototype.testDownload = function (e, t, i) {
  28154. var n = this.downloadTestResults[e]
  28155. if (n) return void (n === g.Success ? i(!0) : n === g.Fail && i(!1))
  28156. this.downloadTestResults[e] = g.Testing
  28157. var r = this.panos.list[0],
  28158. o = this.getTileUrl(r.id, e, t, 0),
  28159. a = function (t) {
  28160. ;(this.downloadTestResults[e] = g.Success), i(!0)
  28161. }.bind(this),
  28162. s = function () {
  28163. ;(this.downloadTestResults[e] = g.Fail), i(!1)
  28164. }.bind(this)
  28165. this.loadImage(o, 0, a, s)
  28166. }),
  28167. (n.prototype.startDownload = function (e) {
  28168. e.status = h.Downloading
  28169. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex)
  28170. this.activeDownloads.push(e), this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  28171. }),
  28172. (n.prototype.downloadFailed = function (e, t) {}),
  28173. (n.prototype.downloadComplete = function (e, t) {
  28174. if (e.panoGroupId === this.panoGroupId) {
  28175. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize)
  28176. ;(e.status = h.Downloaded), i && i.onProgress && i.onProgress(e.pano, e.panoSize)
  28177. var n = {
  28178. panoId: e.pano.id,
  28179. image: t,
  28180. tileSize: e.tileSize,
  28181. panoSize: e.panoSize,
  28182. tileIndex: e.tileIndex,
  28183. faceTileIndex: e.faceTileIndex,
  28184. totalTiles: e.totalTiles,
  28185. face: e.face,
  28186. tileX: e.tileX,
  28187. tileY: e.tileY,
  28188. direction: e.direction
  28189. }
  28190. ;(e.image = t),
  28191. this.emit(s.TileDownloadSuccess, n),
  28192. this.isPanoDownloaded(e.pano, e.panoSize) &&
  28193. ((n = {
  28194. panoId: e.pano.id,
  28195. tileSize: e.tileSize,
  28196. panoSize: e.panoSize
  28197. }),
  28198. this.emit(s.PanoDownloadComplete, n),
  28199. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  28200. }
  28201. }),
  28202. (n.prototype.cleanupActiveDownloads = (function () {
  28203. var e = []
  28204. return function () {
  28205. e.length = 0
  28206. for (var t = 0; t < this.activeDownloads.length; t++) {
  28207. var i = this.activeDownloads[t]
  28208. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  28209. }
  28210. ;(this.activeDownloads.length = 0), this.activeDownloads.push.apply(this.activeDownloads, e)
  28211. }
  28212. })()),
  28213. (n.prototype.isPanoDownloaded = function (e, t) {
  28214. var i = this.getTileDownloadDescriptors(e, t)
  28215. if (i.length <= 0) return !1
  28216. for (var n = 0; n < i.length; n++) {
  28217. var r = i[n]
  28218. if (r.status !== h.Downloaded) return !1
  28219. }
  28220. return !0
  28221. }),
  28222. (n.prototype.setPanoLoadCallbacks = function (e, t, i, n, r) {
  28223. var o = e.id + ':' + this.qualityManager.getPanoSize(t)
  28224. this.panoLoadCallbacks[o] = {
  28225. onLoad: i,
  28226. onFail: n,
  28227. onProgress: r
  28228. }
  28229. }),
  28230. (n.prototype.getPanoLoadCallbacks = function (e, t) {
  28231. var i = e.id + ':' + t
  28232. return this.panoLoadCallbacks[i]
  28233. }),
  28234. (n.prototype.buildDownloadDescriptorArray = function (e) {
  28235. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  28236. var r = this.buildDownloadDescriptor()
  28237. i.push(r)
  28238. }
  28239. return i
  28240. }),
  28241. (n.prototype.buildDownloadDescriptor = function () {
  28242. var e = {
  28243. panoGroupId: null,
  28244. pano: null,
  28245. panoSize: -1,
  28246. tileSize: -1,
  28247. tileIndex: -1,
  28248. totalTiles: -1,
  28249. faceTileIndex: -1,
  28250. status: h.None,
  28251. url: null,
  28252. image: null,
  28253. direction: new r.Vector3(),
  28254. face: -1,
  28255. cubeFace: -1,
  28256. tileX: -1,
  28257. tileY: -1
  28258. }
  28259. return e
  28260. }),
  28261. (n.prototype.initTileDownloadDescriptors = function (e, t, i) {
  28262. for (var n = 0; n < e.length; n++) {
  28263. var r = e[n]
  28264. this.initTileDownloadDescriptor(r, t, i, n)
  28265. }
  28266. }),
  28267. (n.prototype.initTileDownloadDescriptor = function (e, t, i, n) {
  28268. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i
  28269. ;(e.face = c.getFaceForTile(i, n)),
  28270. (e.cubeFace = u.mapFaceToCubemapFace(e.face)),
  28271. (e.panoGroupId = this.panoGroupId),
  28272. (e.pano = t),
  28273. (e.panoSize = i),
  28274. (e.tileSize = r),
  28275. (e.tileIndex = n),
  28276. (e.totalTiles = c.getTileCountForSize(i)),
  28277. (e.status = h.None),
  28278. (e.image = null),
  28279. c.getTileLocation(e.panoSize, e.tileIndex, e),
  28280. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  28281. }),
  28282. (n.prototype.getTileUrl = (function () {
  28283. var e = {
  28284. 256: '256',
  28285. 512: '512',
  28286. 1024: '1k',
  28287. 2048: '2k',
  28288. 4096: '4k'
  28289. },
  28290. t = {
  28291. face: -1,
  28292. faceTileIndex: -1,
  28293. tileX: -1,
  28294. tileY: -1
  28295. }
  28296. return function (i, n, r, a) {
  28297. c.getTileLocation(n, a, t)
  28298. var s = Math.floor(n / r),
  28299. l = s * s,
  28300. h = Math.floor(a / l),
  28301. u = ''
  28302. 1 === o.tiling.customCompression && (u = '_' + o.tiling['q' + e[n]])
  28303. var d = this.urls.get('tiles/' + i + '/' + e[n] + u + '_face' + h + '_' + t.tileX + '_' + t.tileY + '.jpg')
  28304. return (d = p.changeIfTileGenerating(d))
  28305. }
  28306. })()),
  28307. (n.prototype.loadImage = function (e, t, i, n) {
  28308. d.getImage(e, t)
  28309. .then(function (e) {
  28310. i(e)
  28311. })
  28312. .fail(n)
  28313. }),
  28314. (t.exports = n)
  28315. }).call(this, '/js/tile/TileDownloader.js')
  28316. },
  28317. {
  28318. '../ab': 3,
  28319. '../enum/DownloadStatus': 24,
  28320. '../enum/GLCubeFaces': 25,
  28321. '../enum/PanoSizeClass': 36,
  28322. '../enum/TileDownloaderEvents': 45,
  28323. '../enum/Vectors': 50,
  28324. '../enum/Viewmode': 51,
  28325. '../objects/Panorama': 148,
  28326. '../settings': 166,
  28327. '../util/ajax': 181,
  28328. '../util/logger': 189,
  28329. '../util/panorama': 191,
  28330. './TilePrioritizer': 172,
  28331. './TileUtils': 174,
  28332. events: 202,
  28333. three: 217
  28334. }
  28335. ],
  28336. 172: [
  28337. function (e, t, i) {
  28338. ;(function (i) {
  28339. 'use strict'
  28340. function n(e, t, i, o, a) {
  28341. ;(this.qualityManager = e),
  28342. (this.maxNavQuality = this.qualityManager.getMaxNavPanoSize()),
  28343. (this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()),
  28344. (this.baseSize = t),
  28345. (this.standardSize = i),
  28346. (this.highSize = o),
  28347. (this.ultraHighSize = a),
  28348. (this.priorityCriteria = new n.PriorityCriteria(null, new r.Vector3(0, 0, 0), new r.Vector3(0, 0, -1), new r.Vector3(0, 0, -1)))
  28349. }
  28350. var r = e('three'),
  28351. o = (e('../enum/Viewmode'), e('../settings'), e('../settings'), e('../objects/Panorama')),
  28352. a = e('../util/logger'),
  28353. s = (e('../enum/Vectors'), e('../enum/PanoSizeClass'), e('../enum/ModelManagerEvents'), e('../enum/GLCubeFaces'), e('../enum/DownloadStatus')),
  28354. l = (e('../util/browser'), e('./TileUtils')),
  28355. c = e('../util/math'),
  28356. h =
  28357. (e('events').EventEmitter,
  28358. new a(i),
  28359. Object.freeze({
  28360. None: 0,
  28361. DirectionalFOV: 1
  28362. }))
  28363. ;(n.PriorityCriteria = function (e, t, i, n, o) {
  28364. ;(this.pano = e),
  28365. (this.cameraPosition = new r.Vector3().copy(t)),
  28366. (this.cameraDir = new r.Vector3().copy(i)),
  28367. (this.panoSpaceDir = new r.Vector3().copy(n)),
  28368. (this.upcomingPanos = o),
  28369. (this.copy = function (e) {
  28370. ;(this.pano = e.pano), this.cameraPosition.copy(e.cameraPosition), this.cameraDir.copy(e.cameraDir), this.panoSpaceDir.copy(e.panoSpaceDir), (this.upcomingPanos = o)
  28371. }),
  28372. (this.zoomingActive = !1)
  28373. }),
  28374. (n.DIRECTIONAL_FOV = 180),
  28375. (n.DIRECTIONAL_FOV_NARROW = 120),
  28376. (n.MAX_SCORED_PANOS_TOCONSIDER = 6),
  28377. (n.MAX_SCORED_PANOS_TOADD = 2),
  28378. (n.MAX_UPCOMING_PANOS_TOADD = 3),
  28379. (n.DIRECTION_SCORE_STRICTNESS = 0.75),
  28380. (n.appendQueue = function (e, t) {
  28381. if (e && t) for (var i = 0; i < t.length; i++) e.push(t[i])
  28382. }),
  28383. (n.prototype.updateCriteria = function (e, t, i, n) {
  28384. ;(this.priorityCriteria.pano = e),
  28385. this.priorityCriteria.cameraPosition.copy(t),
  28386. this.priorityCriteria.cameraDir.copy(i),
  28387. (this.priorityCriteria.upcomingPanos = n),
  28388. (this.maxNavQuality = this.qualityManager.getMaxNavPanoSize())
  28389. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  28390. if (!player.panoRenderer.isPanoZoomed(e.id)) {
  28391. //xzw add,直到到达该点后才能下载4k,否则不会渲染到zoomRenderTarget上
  28392. this.maxNavQuality = Math.min(2048, this.maxNavQuality)
  28393. this.maxZoomQuality = Math.min(2048, this.maxZoomQuality)
  28394. }
  28395. }),
  28396. (n.prototype.filterAndPrioritize = (function () {
  28397. var e = [],
  28398. t = [],
  28399. i = []
  28400. return function (r, o, a) {
  28401. this.populateNeighborPanos(this.priorityCriteria.pano, o, e), this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER)
  28402. var s = this.baseSize,
  28403. l = this.standardSize,
  28404. c = this.highSize,
  28405. h = this.ultraHighSize
  28406. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  28407. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  28408. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, 1024, n.MAX_UPCOMING_PANOS_TOADD), //更清晰些
  28409. (i.length = 0),
  28410. this.canDownloadSize(l) &&
  28411. this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28412. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28413. n.appendQueue(r, i),
  28414. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  28415. (i.length = 0),
  28416. this.canDownloadSize(c) &&
  28417. this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28418. this.canDownloadSize(h) &&
  28419. this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28420. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28421. n.appendQueue(r, i),
  28422. (i.length = 0),
  28423. this.canDownloadSize(l) &&
  28424. this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28425. this.canDownloadSize(c) &&
  28426. this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28427. this.canDownloadSize(h) &&
  28428. this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28429. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28430. n.appendQueue(r, i),
  28431. this.queueTilesForPanos(r, e, a, s)
  28432. }
  28433. })()),
  28434. (n.prototype.canDownloadSize = function (e) {
  28435. return this.maxNavQuality >= e || (this.maxZoomQuality >= e && this.zoomingActive)
  28436. }),
  28437. (n.prototype.populateNeighborPanos = function (e, t, i) {
  28438. ;(i = i || []), (i.length = 0)
  28439. var n = t.getNeighbours(e)
  28440. for (var r in n)
  28441. if (n.hasOwnProperty(r)) {
  28442. var o = t.get(r)
  28443. i.push(o)
  28444. }
  28445. return i
  28446. }),
  28447. (n.prototype.populateScoredPanos = function (e, t, i, r, a) {
  28448. ;(i = i || []), (i.length = 0)
  28449. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)],
  28450. l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)],
  28451. c = t.sortByScore(s, l)
  28452. if (c)
  28453. for (var h = 0; h < c.length && h < a; h++) {
  28454. var u = c[h].item
  28455. i.push(u)
  28456. }
  28457. return i
  28458. }),
  28459. (n.prototype.queueTilesForPanos = function (e, t, i, n, r) {
  28460. for (var o = 0, a = 0; a < t.length; a++) {
  28461. var s = t[a],
  28462. l = this.queueTilesForPano(e, i, s, n)
  28463. if (((o += l > 0 ? 1 : 0), r && o >= r)) break
  28464. }
  28465. return o
  28466. }),
  28467. (n.prototype.queueTilesForPano = (function () {
  28468. var e = {
  28469. filter: h.None
  28470. }
  28471. return function (t, i, n, r) {
  28472. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  28473. }
  28474. })()),
  28475. (n.prototype.queueTilesForPanosInDirection = (function () {
  28476. var e = new r.Vector3()
  28477. return function (t, i, n, r, o, a, s, l) {
  28478. for (var h = 0, u = 0; u < n.length; u++) {
  28479. var d = n[u]
  28480. e.copy(d.position), e.sub(o), e.normalize()
  28481. var p = Math.max(Math.min(a.dot(e), 1), -1),
  28482. f = c.getFOVDotThreshold(s)
  28483. if (p >= f) {
  28484. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s)
  28485. if (((h += g > 0 ? 1 : 0), l && h >= l)) break
  28486. }
  28487. }
  28488. return h
  28489. }
  28490. })()),
  28491. (n.prototype.queueTilesInDirectionForPanos = function (e, t, i, n, r, o, a, s) {
  28492. for (var l = 0, c = 0; c < i.length; c++) {
  28493. var h = i[c],
  28494. u = this.queueTilesInDirectionForPano(e, t, h, n, o, a)
  28495. if (((l += u > 0 ? 1 : 0), s && l >= s)) break
  28496. }
  28497. return l
  28498. }),
  28499. (n.prototype.queueTilesInDirectionForPano = (function () {
  28500. var e = {
  28501. filter: h.DirectionalFOV,
  28502. direction: new r.Vector3(),
  28503. fov: 60
  28504. },
  28505. t = new r.Vector3()
  28506. return function (i, n, r, o, a, s, c) {
  28507. return t.copy(s), l.getRelativeDirection(r.quaternion, t), e.direction.copy(t), (e.fov = c), this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  28508. }
  28509. })()),
  28510. (n.prototype.filterAndQueueTileDownloadDescriptors = (function () {
  28511. var e = []
  28512. return function (t, i, n, r, o) {
  28513. var a = i.getTileDownloadDescriptors(n, r)
  28514. ;(e.length = 0), this.filterTileDownloadDescriptors(n, a, e, o)
  28515. for (var s = 0, l = 0; l < e.length; l++) {
  28516. var c = e[l]
  28517. c && (t.push(c), s++)
  28518. }
  28519. return s
  28520. }
  28521. })()),
  28522. (n.prototype.filterTileDownloadDescriptors = (function () {
  28523. new r.Vector3()
  28524. return function (e, t, i, n) {
  28525. var r, o
  28526. switch (n.filter) {
  28527. case h.DirectionalFOV:
  28528. for (r = 0; r < t.length; r++) (o = t[r]), l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o)
  28529. break
  28530. default:
  28531. for (r = 0; r < t.length; r++) (o = t[r]), i.push(o)
  28532. }
  28533. for (r = 0; r < i.length; r++) (o = i[r]), this.canIncludeDescriptor(o) || (i[r] = null)
  28534. }
  28535. })()),
  28536. (n.prototype.canIncludeDescriptor = function (e) {
  28537. return e.status !== s.Downloading && e.status !== s.Downloaded
  28538. }),
  28539. (n.prototype.canIncludePano = function (e, t) {
  28540. return !e.isLoaded(t)
  28541. }),
  28542. (n.getFOVDotThreshold = function (e) {
  28543. return Math.cos(r.Math.degToRad(e / 2))
  28544. })
  28545. var u = (function () {
  28546. var e = function e(t, i) {
  28547. var n = e._panoSpaceDir,
  28548. r = e._fovThreshold,
  28549. o = e._fovThresholdNarrow,
  28550. a = Math.max(Math.min(n.dot(t.direction), 1), -1),
  28551. s = Math.max(Math.min(n.dot(i.direction), 1), -1)
  28552. return (
  28553. (t._dot = a),
  28554. (i._dot = s),
  28555. a >= r && s < r ? -1 : a < r && s >= r ? 1 : a >= o && s < o ? -1 : a < o && s >= o ? 1 : t.panoSize > i.panoSize ? 1 : i.panoSize > t.panoSize ? -1 : -(a - s)
  28556. )
  28557. }
  28558. return (e._panoSpaceDir = new r.Vector3()), (e._fovThreshold = -1), (e._fovThresholdNarrow = -1), e
  28559. })()
  28560. ;(n.sortPanoTiles = function (e, t, i) {
  28561. u._panoSpaceDir.copy(i),
  28562. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  28563. (u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW)),
  28564. (u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV)),
  28565. e.sort(u)
  28566. }),
  28567. (n.insertSortedPanoTile = function (e, t, i, r) {
  28568. u._panoSpaceDir.copy(r),
  28569. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  28570. (u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW)),
  28571. (u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV))
  28572. for (var o = -1, a = 0; a < e.length; a++) {
  28573. var s = u(t, e[a])
  28574. if (s <= 0) {
  28575. o = a
  28576. break
  28577. }
  28578. }
  28579. if (o === -1) e[e.length] = t
  28580. else {
  28581. for (var h = e.length; h > o; h--) e[h] = e[h - 1]
  28582. e[o] = t
  28583. }
  28584. }),
  28585. (n.prototype.setZoomingActive = function (e) {
  28586. e !== this.zoomingActive && (this.zoomingActive = e)
  28587. }),
  28588. (t.exports = n)
  28589. }).call(this, '/js/tile/TilePrioritizer.js')
  28590. },
  28591. {
  28592. '../enum/DownloadStatus': 24,
  28593. '../enum/GLCubeFaces': 25,
  28594. '../enum/ModelManagerEvents': 33,
  28595. '../enum/PanoSizeClass': 36,
  28596. '../enum/Vectors': 50,
  28597. '../enum/Viewmode': 51,
  28598. '../objects/Panorama': 148,
  28599. '../settings': 166,
  28600. '../util/browser': 182,
  28601. '../util/logger': 189,
  28602. '../util/math': 190,
  28603. './TileUtils': 174,
  28604. events: 202,
  28605. three: 217
  28606. }
  28607. ],
  28608. 173: [
  28609. function (e, t, i) {
  28610. 'use strict'
  28611. function n(e, t) {
  28612. ;(this.levels = t), (this.tileSize = e), (this.root = null), (this.allNodes = []), a(this)
  28613. }
  28614. function r(e, t) {
  28615. ;(this.tree = e), (this.parent = t), (this.children = []), (this.id = ++u)
  28616. }
  28617. function o(e, t, i, r, a, s, l, h) {
  28618. if (e) {
  28619. l = l || n.TraversalType.PreOrder
  28620. var u = r * c + i
  28621. if ((l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r), s && s.push(e)), e.children && 0 !== e.children.length)) {
  28622. for (var d = r * c, p = i * c, f = 0; f < c; f++) for (var g = 0; g < c; g++) o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h)
  28623. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r), s && s.push(e))
  28624. }
  28625. }
  28626. }
  28627. function a(e) {
  28628. e.root = s(e, null, 0)
  28629. }
  28630. function s(e, t, i) {
  28631. if (i > e.levels) return null
  28632. var n = new r(e, t)
  28633. e.allNodes.push(n)
  28634. for (var o = 0; o < h; o++) n.children[o] = s(e, n, i + 1)
  28635. return n
  28636. }
  28637. function l(e, t, i, n, r) {
  28638. if (!e) return null
  28639. if (0 === i) return e
  28640. if (!e.children || 0 === e.children.length) return null
  28641. var o = Math.pow(c, i),
  28642. a = o / c,
  28643. s = n % a,
  28644. h = r % a,
  28645. u = Math.floor(r / a),
  28646. d = Math.floor(n / a),
  28647. p = u * c + d,
  28648. f = e.children[p]
  28649. return l(f, t + 1, i - 1, s, h)
  28650. }
  28651. var c = (e('three'), e('./TileUtils'), e('../objects/Panorama'), e('../util/panorama'), e('events').EventEmitter, 2),
  28652. h = c * c
  28653. n.TraversalType = Object.freeze({
  28654. PreOrder: 0,
  28655. PostOrder: 1
  28656. })
  28657. var u = 0
  28658. ;(n.getLevelCountForSize = function (e, t) {
  28659. var i = 0
  28660. for (t < e && (t = e); ; ) {
  28661. if (((t /= c), t < e)) break
  28662. i++
  28663. }
  28664. return i
  28665. }),
  28666. (n.getSizeForLevel = function (e, t) {
  28667. return Math.pow(c, t) * e
  28668. }),
  28669. (n.prototype.getSubNode = function (e, t, i) {
  28670. ;(!t || e < this.tileSize) && (t = 0), (!i || e < this.tileSize) && (i = 0), e < this.tileSize && (e = this.tileSize)
  28671. var r = n.getLevelCountForSize(this.tileSize, e),
  28672. o = l(this.root, 0, r, t, i)
  28673. return o
  28674. }),
  28675. (n.prototype.breadthFirst = function (e) {
  28676. e = e || {}
  28677. var t = !!e.nullLevelEnd,
  28678. i = e.maxLevel,
  28679. n = e.minLevel,
  28680. r = e.callback,
  28681. o = e.saveVisited,
  28682. a = [],
  28683. s = {},
  28684. l = 0,
  28685. c = 0
  28686. for (a.push(this.root), a.push(s); a.length > 0 && !(i && l > i); ) {
  28687. var h = a.shift()
  28688. if (h === s) (!n || l >= n) && (r && t && r(null), o && t && o.push(null)), a.length > 0 && a.push(s), l++, (c = 0)
  28689. else {
  28690. if (h.children)
  28691. for (var u = 0; u < h.children.length; u++) {
  28692. var d = h.children[u]
  28693. d && a.push(h.children[u])
  28694. }
  28695. var p = this.getFaceIndexFromNode(h)
  28696. ;(!n || l >= n) && (r && r(h, l, p), o && o.push(h)), c++
  28697. }
  28698. }
  28699. }),
  28700. (n.prototype.getFaceIndexFromNode = function (e) {
  28701. if (!e) return -1
  28702. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  28703. var o = i.parent
  28704. if (!o) break
  28705. for (var a = -1, s = 0; s < o.children.length; s++) o.children[s] === i && (a = s)
  28706. var l = a % c,
  28707. h = Math.floor(a / c)
  28708. ;(n = l * t + n), (r = h * t + r), (t *= c), (i = o)
  28709. }
  28710. return r * t + n
  28711. }),
  28712. (n.prototype.depthFirst = function (e, t, i) {
  28713. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  28714. }),
  28715. (t.exports = n)
  28716. },
  28717. {
  28718. '../objects/Panorama': 148,
  28719. '../util/panorama': 191,
  28720. './TileUtils': 174,
  28721. events: 202,
  28722. three: 217
  28723. }
  28724. ],
  28725. 174: [
  28726. function (e, t, i) {
  28727. 'use strict'
  28728. var n = e('../enum/GLCubeFaces'),
  28729. r = e('../util/MathLight'),
  28730. o = {}
  28731. ;(o.TILE_SIZE = 512),
  28732. (o.FACES_PER_PANO = 6),
  28733. (o.LocationOnTile = {
  28734. Center: 0,
  28735. UpperLeft: 1,
  28736. UpperRight: 2,
  28737. LowerRight: 3,
  28738. LowerLeft: 4
  28739. }),
  28740. (o.getTileVector = (function () {
  28741. return function (e, t, i, a, s, l, c, h) {
  28742. l = l || o.LocationOnTile.Center
  28743. var u = e / t,
  28744. d = a / u
  28745. s = -s + (u - 1)
  28746. var p = s / u,
  28747. f = t / e,
  28748. g = 2 * f,
  28749. m = g / 2,
  28750. v = 2 * d - 1 + m,
  28751. A = 2 * p - 1 + m
  28752. switch (l) {
  28753. case o.LocationOnTile.UpperLeft:
  28754. ;(v -= m), (A += m), (v += c * g)
  28755. break
  28756. case o.LocationOnTile.UpperRight:
  28757. ;(v += m), (A += m), (A -= c * g)
  28758. break
  28759. case o.LocationOnTile.LowerRight:
  28760. ;(v += m), (A -= m), (v -= c * g)
  28761. break
  28762. case o.LocationOnTile.LowerLeft:
  28763. ;(v -= m), (A -= m), (A += c * g)
  28764. break
  28765. case o.LocationOnTile.Center:
  28766. }
  28767. switch (i) {
  28768. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28769. r.setVector(h, -1, A, -v)
  28770. break
  28771. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28772. r.setVector(h, 1, A, v)
  28773. break
  28774. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28775. r.setVector(h, -v, 1, -A)
  28776. break
  28777. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28778. r.setVector(h, -v, -1, A)
  28779. break
  28780. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28781. r.setVector(h, -v, A, 1)
  28782. break
  28783. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28784. r.setVector(h, v, A, -1)
  28785. }
  28786. r.normalize(h)
  28787. }
  28788. })()),
  28789. (o.getFaceForTile = function (e, t) {
  28790. var i = o.TILE_SIZE
  28791. e < o.TILE_SIZE && (i = e)
  28792. var n = Math.floor(e / i),
  28793. r = n * n
  28794. return Math.floor(t / r)
  28795. }),
  28796. (o.getTileLocation = function (e, t, i) {
  28797. var n = o.TILE_SIZE
  28798. e < o.TILE_SIZE && (n = e)
  28799. var r = o.getFaceForTile(e, t),
  28800. a = Math.floor(e / n),
  28801. s = a * a,
  28802. l = t - r * s
  28803. ;(i.tileX = l % a), (i.tileY = Math.floor(l / a)), (i.face = r), (i.faceTileIndex = l)
  28804. }),
  28805. (o.getTileCountForSize = function (e) {
  28806. if (e <= o.TILE_SIZE) return o.FACES_PER_PANO
  28807. var t = Math.floor(e / o.TILE_SIZE),
  28808. i = t * t,
  28809. n = i * o.FACES_PER_PANO
  28810. return n
  28811. }),
  28812. (o.getRelativeDirection = (function () {
  28813. var e = new r.Matrix4(),
  28814. t = new r.Quaternion()
  28815. return function (i, n) {
  28816. t.copy(i), t.inverse(), e.makeRotationFromQuaternion(t), e.applyToVector3(n), r.normalize(n)
  28817. }
  28818. })()),
  28819. (o.matchingTilesInDirection = (function () {
  28820. var e = new r.Vector3(),
  28821. t = new r.Vector3(0, 0, -1),
  28822. i = new r.Quaternion(),
  28823. n = function (e, t) {
  28824. e.push({
  28825. face: t.face,
  28826. faceTileIndex: t.faceTileIndex,
  28827. tileX: t.tileX,
  28828. tileY: t.tileY
  28829. })
  28830. },
  28831. a = (function () {
  28832. var e = {
  28833. face: -1,
  28834. faceTileIndex: -1,
  28835. tileX: -1,
  28836. tileY: -1
  28837. }
  28838. return function (t, i, r) {
  28839. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++) o.getTileLocation(t, l, e), (i && !i(e)) || (s++, r && n(r, e))
  28840. return s
  28841. }
  28842. })()
  28843. return function (n, s, l, c, h, u) {
  28844. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE
  28845. o.getTileCountForSize(s)
  28846. if (!c && !h) return a(s, null, u)
  28847. var p = !!h
  28848. if (((h = h || c), (h = Math.max(0, Math.min(h, 360))), (c = Math.max(0, Math.min(c, 360))), r.copyVector(l, e), o.getRelativeDirection(n.quaternion, e), p)) {
  28849. i.setFromUnitVectors(e, t)
  28850. var f = function (e) {
  28851. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  28852. }
  28853. return a(s, f, u)
  28854. }
  28855. var g = function (t) {
  28856. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  28857. }
  28858. return a(s, g, u)
  28859. }
  28860. })()),
  28861. (o.isTileWithinFrustum = (function () {
  28862. var e = new r.Vector3(),
  28863. t = 1e-5
  28864. return function (i, n, a, s, l, c, h, u) {
  28865. for (
  28866. var d = Math.tan(0.5 * u * r.RADIANS_PER_DEGREE),
  28867. p = -d,
  28868. f = Math.tan(0.5 * h * r.RADIANS_PER_DEGREE),
  28869. g = -f,
  28870. m = o.mapFaceToCubemapFace(a),
  28871. v = 0,
  28872. A = 0,
  28873. y = 0,
  28874. C = 0,
  28875. I = 0,
  28876. E = 0,
  28877. b = o.LocationOnTile.Center;
  28878. b <= o.LocationOnTile.LowerLeft;
  28879. b++
  28880. )
  28881. if ((o.getTileVector(i, n, m, s, l, b, 0, e), r.applyQuaternionToVector(c, e), e.z >= -t)) I++
  28882. else {
  28883. var w = -1 / e.z,
  28884. _ = e.x * w,
  28885. T = e.y * w
  28886. T > d ? v++ : T < p && A++, _ > f ? y++ : _ < g && C++, E++
  28887. }
  28888. return A !== E && v !== E && y !== E && C !== E
  28889. }
  28890. })()),
  28891. (o.isTileWithinFOV = (function () {
  28892. var e = new r.Vector3(),
  28893. t = new r.Vector3(0, 1, 0),
  28894. i = new r.Vector3(1, 0, 0)
  28895. return function (n, a, s, l, c, h, u) {
  28896. var d = o.mapFaceToCubemapFace(s)
  28897. if ((r.cross(h, t, i), o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e), o.isWithinFOV(e, h, u, null))) return !0
  28898. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  28899. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++) if ((o.getTileVector(n, a, d, l, c, v, g, e), o.isWithinFOV(e, h, u, null))) return !0
  28900. g += p
  28901. }
  28902. return !1
  28903. }
  28904. })()),
  28905. (o.isWithinFOV = (function () {
  28906. var e = new r.Vector3(),
  28907. t = new r.Vector3()
  28908. return function (i, n, o, a) {
  28909. if ((r.copyVector(i, t), a)) {
  28910. r.copyVector(a, e), r.normalize(e)
  28911. var s = r.dot(e, i)
  28912. ;(e.x *= s), (e.y *= s), (e.z *= s), r.subVector(t, e)
  28913. }
  28914. var l = (o / 2) * r.RADIANS_PER_DEGREE,
  28915. c = Math.cos(l),
  28916. h = r.dot(t, n)
  28917. return h >= c
  28918. }
  28919. })()),
  28920. (o.mapFaceToCubemapFace = (function () {
  28921. var e = {
  28922. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  28923. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  28924. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  28925. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  28926. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  28927. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  28928. }
  28929. return function (t) {
  28930. return e[t]
  28931. }
  28932. })()),
  28933. (t.exports = o)
  28934. },
  28935. {
  28936. '../enum/GLCubeFaces': 25,
  28937. '../util/MathLight': 176
  28938. }
  28939. ],
  28940. 175: [
  28941. function (e, t, i) {
  28942. ;(function (i) {
  28943. 'use strict'
  28944. function n() {
  28945. ;(this.list = []),
  28946. (this.index = {}),
  28947. Object.defineProperty(this, 'length', {
  28948. get: function () {
  28949. return this.list.length
  28950. }
  28951. })
  28952. }
  28953. var r = (e('./common'), e('./logger'))
  28954. new r(i)
  28955. ;(n.prototype.forEach = function (e) {
  28956. this.list.forEach(e)
  28957. }),
  28958. (n.prototype.add = function (e) {
  28959. this.list.push(e), (this.index[this.getIndex(e)] = e)
  28960. }),
  28961. (n.prototype.getIndex = function (e) {
  28962. throw new Error('IndexedCollection.getIndex not implemented in subclass.')
  28963. }),
  28964. (n.prototype.extend = function (e) {
  28965. for (var t = 0; t < e.length; t++) this.add(e[t])
  28966. }),
  28967. (n.prototype.get = function (e) {
  28968. return this.index[e]
  28969. }),
  28970. (n.prototype.first = function () {
  28971. return this.list[0]
  28972. }),
  28973. (n.prototype.last = function () {
  28974. return this.list[this.list.length - 1]
  28975. }),
  28976. (n.prototype.reIndex = function () {
  28977. this.index = {}
  28978. var e = this
  28979. this.forEach(function (t) {
  28980. e.index[e.getIndex(t)] = t
  28981. })
  28982. }),
  28983. (n.prototype.filter = function (e) {
  28984. var t = this.list.filter(e)
  28985. return this.reIndex(), t
  28986. }),
  28987. (n.prototype.reduce = function (e, t) {
  28988. return this.list.reduce(e, t)
  28989. }),
  28990. (n.prototype.sort = function (e) {
  28991. return this.list.sort(e)
  28992. }),
  28993. (n.prototype.indexOf = function (e) {
  28994. for (var t = 0; t < this.list.length; ++t) if (this.list[t] === e) return t
  28995. return -1
  28996. }),
  28997. (t.exports = n)
  28998. }).call(this, '/js/util/IndexedCollection.js')
  28999. },
  29000. {
  29001. './common': 185,
  29002. './logger': 189
  29003. }
  29004. ],
  29005. 176: [
  29006. function (e, t, i) {
  29007. 'use strict'
  29008. var n = e('../constants'),
  29009. r = {}
  29010. ;(r.RADIANS_PER_DEGREE = Math.PI / 180),
  29011. (r.DEGREES_PER_RADIAN = 180 / Math.PI),
  29012. (r.Vector3 = function (e, t, i) {
  29013. ;(this.x = e || 0), (this.y = t || 0), (this.z = i || 0)
  29014. }),
  29015. (r.Matrix4 = function () {
  29016. ;(this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])),
  29017. arguments.length > 0 && console.error('MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.')
  29018. }),
  29019. (r.Matrix4.prototype = {
  29020. identity: function () {
  29021. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  29022. },
  29023. copy: function (e) {
  29024. return this.elements.set(e.elements), this
  29025. },
  29026. applyToVector3: function (e) {
  29027. var t = e.x,
  29028. i = e.y,
  29029. n = e.z,
  29030. r = this.elements
  29031. return (e.x = r[0] * t + r[4] * i + r[8] * n + r[12]), (e.y = r[1] * t + r[5] * i + r[9] * n + r[13]), (e.z = r[2] * t + r[6] * i + r[10] * n + r[14]), this
  29032. },
  29033. getInverse: function (e, t) {
  29034. var i = this.elements,
  29035. n = e.elements,
  29036. r = n[0],
  29037. o = n[1],
  29038. a = n[2],
  29039. s = n[3],
  29040. l = n[4],
  29041. c = n[5],
  29042. h = n[6],
  29043. u = n[7],
  29044. d = n[8],
  29045. p = n[9],
  29046. f = n[10],
  29047. g = n[11],
  29048. m = n[12],
  29049. v = n[13],
  29050. A = n[14],
  29051. y = n[15],
  29052. C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y,
  29053. I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y,
  29054. E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y,
  29055. b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A,
  29056. w = r * C + o * I + a * E + s * b
  29057. if (0 === w) {
  29058. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0"
  29059. if (t) throw new Error(_)
  29060. return console.warn(_), this.identity()
  29061. }
  29062. var T = 1 / w
  29063. return (
  29064. (i[0] = C * T),
  29065. (i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T),
  29066. (i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T),
  29067. (i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T),
  29068. (i[4] = I * T),
  29069. (i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T),
  29070. (i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T),
  29071. (i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T),
  29072. (i[8] = E * T),
  29073. (i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T),
  29074. (i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T),
  29075. (i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T),
  29076. (i[12] = b * T),
  29077. (i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T),
  29078. (i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T),
  29079. (i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T),
  29080. this
  29081. )
  29082. },
  29083. makeRotationFromQuaternion: function (e) {
  29084. var t = this.elements,
  29085. i = e.x,
  29086. n = e.y,
  29087. r = e.z,
  29088. o = e.w,
  29089. a = i + i,
  29090. s = n + n,
  29091. l = r + r,
  29092. c = i * a,
  29093. h = i * s,
  29094. u = i * l,
  29095. d = n * s,
  29096. p = n * l,
  29097. f = r * l,
  29098. g = o * a,
  29099. m = o * s,
  29100. v = o * l
  29101. return (
  29102. (t[0] = 1 - (d + f)),
  29103. (t[4] = h - v),
  29104. (t[8] = u + m),
  29105. (t[1] = h + v),
  29106. (t[5] = 1 - (c + f)),
  29107. (t[9] = p - g),
  29108. (t[2] = u - m),
  29109. (t[6] = p + g),
  29110. (t[10] = 1 - (c + d)),
  29111. (t[3] = 0),
  29112. (t[7] = 0),
  29113. (t[11] = 0),
  29114. (t[12] = 0),
  29115. (t[13] = 0),
  29116. (t[14] = 0),
  29117. (t[15] = 1),
  29118. this
  29119. )
  29120. }
  29121. }),
  29122. (r.Quaternion = function (e, t, i, n) {
  29123. ;(this._x = e || 0), (this._y = t || 0), (this._z = i || 0), (this._w = void 0 !== n ? n : 1)
  29124. }),
  29125. (r.Quaternion.prototype = {
  29126. get x() {
  29127. return this._x
  29128. },
  29129. set x(e) {
  29130. this._x = e
  29131. },
  29132. get y() {
  29133. return this._y
  29134. },
  29135. set y(e) {
  29136. this._y = e
  29137. },
  29138. get z() {
  29139. return this._z
  29140. },
  29141. set z(e) {
  29142. this._z = e
  29143. },
  29144. get w() {
  29145. return this._w
  29146. },
  29147. set w(e) {
  29148. this._w = e
  29149. },
  29150. copy: function (e) {
  29151. ;(this._x = e.x), (this._y = e.y), (this._z = e.z), (this._w = e.w)
  29152. },
  29153. inverse: function () {
  29154. return this.conjugate().normalize()
  29155. },
  29156. conjugate: function () {
  29157. return (this._x *= -1), (this._y *= -1), (this._z *= -1), this
  29158. },
  29159. length: function () {
  29160. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  29161. },
  29162. normalize: function () {
  29163. var e = this.length()
  29164. return (
  29165. 0 === e
  29166. ? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1))
  29167. : ((e = 1 / e), (this._x = this._x * e), (this._y = this._y * e), (this._z = this._z * e), (this._w = this._w * e)),
  29168. this
  29169. )
  29170. },
  29171. setFromAxisAngle: function (e, t) {
  29172. var i = t / 2,
  29173. n = Math.sin(i)
  29174. return (this._x = e.x * n), (this._y = e.y * n), (this._z = e.z * n), (this._w = Math.cos(i)), this
  29175. },
  29176. setFromUnitVectors: (function () {
  29177. var e,
  29178. t,
  29179. i = 1e-6
  29180. return function (n, o) {
  29181. return (
  29182. void 0 === e && (e = new r.Vector3()),
  29183. (t = r.dot(n, o) + 1),
  29184. t < i ? ((t = 0), Math.abs(n.x) > Math.abs(n.z) ? r.setVector(e, -n.y, n.x, 0) : r.setVector(e, 0, -n.z, n.y)) : r.cross(n, o, e),
  29185. (this._x = e.x),
  29186. (this._y = e.y),
  29187. (this._z = e.z),
  29188. (this._w = t),
  29189. this.normalize()
  29190. )
  29191. }
  29192. })(),
  29193. multiply: function (e) {
  29194. return this.multiplyQuaternions(this, e)
  29195. },
  29196. premultiply: function (e) {
  29197. return this.multiplyQuaternions(e, this)
  29198. },
  29199. multiplyQuaternions: function (e, t) {
  29200. var i = e._x,
  29201. n = e._y,
  29202. r = e._z,
  29203. o = e._w,
  29204. a = t._x,
  29205. s = t._y,
  29206. l = t._z,
  29207. c = t._w
  29208. return (this._x = i * c + o * a + n * l - r * s), (this._y = n * c + o * s + r * a - i * l), (this._z = r * c + o * l + i * s - n * a), (this._w = o * c - i * a - n * s - r * l), this
  29209. }
  29210. }),
  29211. (r.convertWorkshopVector = function (e) {
  29212. return new r.Vector3(-e.x, e.y, e.z)
  29213. }),
  29214. (r.convertWorkshopQuaternion = function (e) {
  29215. return new r.Quaternion(-e.x, e.y, e.z, -e.w).multiply(new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0))
  29216. })
  29217. ;(r.convertWorkshopOrthoZoom = function (e) {
  29218. //xzw
  29219. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  29220. return e === -1 ? -1 : ((e * ($('#player').width() / $('#player').height())) / g_snapShotWidth) * g_snapShotHeight
  29221. }),
  29222. (r.convertWorkshopPanoramaQuaternion = function (e) {
  29223. return new r.Quaternion(e.x, -e.y, -e.z, e.w).normalize().multiply(new r.Quaternion().setFromAxisAngle(new r.Vector3(0, 1, 0), 270 * r.RADIANS_PER_DEGREE))
  29224. }),
  29225. (r.normalize = function (e) {
  29226. var t = e.x * e.x + e.y * e.y + e.z * e.z,
  29227. i = Math.sqrt(t)
  29228. ;(e.x /= i), (e.y /= i), (e.z /= i)
  29229. }),
  29230. (r.dot = function (e, t) {
  29231. return e.x * t.x + e.y * t.y + e.z * t.z
  29232. }),
  29233. (r.cross = function (e, t, i) {
  29234. var n = e.x,
  29235. r = e.y,
  29236. o = e.z
  29237. ;(i.x = r * t.z - o * t.y), (i.y = o * t.x - n * t.z), (i.z = n * t.y - r * t.x)
  29238. }),
  29239. (r.setVector = function (e, t, i, n) {
  29240. ;(e.x = t), (e.y = i), (e.z = n)
  29241. }),
  29242. (r.copyVector = function (e, t) {
  29243. ;(t.x = e.x), (t.y = e.y), (t.z = e.z)
  29244. }),
  29245. (r.addVector = function (e, t) {
  29246. ;(e.x += t.x), (e.y += t.y), (e.z += t.z)
  29247. }),
  29248. (r.subVector = function (e, t) {
  29249. ;(e.x -= t.x), (e.y -= t.y), (e.z -= t.z)
  29250. }),
  29251. (r.applyQuaternionToVector = function (e, t) {
  29252. var i = t.x,
  29253. n = t.y,
  29254. r = t.z,
  29255. o = e.x,
  29256. a = e.y,
  29257. s = e.z,
  29258. l = e.w,
  29259. c = l * i + a * r - s * n,
  29260. h = l * n + s * i - o * r,
  29261. u = l * r + o * n - a * i,
  29262. d = -o * i - a * n - s * r
  29263. ;(t.x = c * l + d * -o + h * -s - u * -a), (t.y = h * l + d * -a + u * -o - c * -s), (t.z = u * l + d * -s + c * -a - h * -o)
  29264. }),
  29265. (r.angleBetweenVectors = function (e, t) {
  29266. return Math.acos(r.dot(e, t))
  29267. }),
  29268. (t.exports = r)
  29269. },
  29270. {
  29271. '../constants': 8
  29272. }
  29273. ],
  29274. 177: [
  29275. function (e, t, i) {
  29276. ;(function (i) {
  29277. 'use strict'
  29278. function n(e) {
  29279. ;(this.cache = null), (this.expires = 0)
  29280. }
  29281. function r() {
  29282. ;(this.baseUrl = null), (this.cache = null), (this.expires = 0)
  29283. }
  29284. function o() {
  29285. ;(this.baseUrl = null), (this.expires = 0)
  29286. }
  29287. function a(e) {
  29288. ;(this.initialLoadingPromise = null),
  29289. (this.endpoint = e + '?type=3'),
  29290. (this.urlContainer = null),
  29291. (this.authorizationHeader = h.getAuthorizationHeader()),
  29292. (this.containerClasses = [o, r, n])
  29293. }
  29294. var s = e('./ajax'),
  29295. l = e('./logger'),
  29296. c = e('../constants'),
  29297. h = e('./showcase'),
  29298. u = (e('../ab'), new l(i))
  29299. ;(n.prototype = {
  29300. version: 1,
  29301. validate: function (e) {
  29302. return 'catalog.json' in e && Object.keys(e).length > 0
  29303. },
  29304. update: function (e) {
  29305. return (this.cache = e), (this.expires = Date.now() + c.signedUrlDefaultExpireTime), $.when()
  29306. },
  29307. get: function (e) {
  29308. return this.cache[e]
  29309. }
  29310. }),
  29311. (r.prototype = {
  29312. version: 2,
  29313. validate: function (e) {
  29314. return 'catalog.json' in e && 'base.url' in e && Object.keys(e).length > 1
  29315. },
  29316. update: function (e) {
  29317. return (this.baseUrl = e['base.url']), (this.cache = e), (this.expires = Date.now() + c.signedUrlDefaultExpireTime), $.when()
  29318. },
  29319. get: function (e) {
  29320. var t = this.cache[e]
  29321. return t ? this.baseUrl.replace('{{filename}}', e) + t : null
  29322. }
  29323. }),
  29324. (o.prototype = {
  29325. version: 3,
  29326. validate: function (e) {
  29327. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  29328. },
  29329. update: function (e) {
  29330. return (this.baseUrl = e.templates[0]), e.expires ? (this.expires = 1e3 * e.expires) : (this.expires = Date.now() + c.signedUrlDefaultExpireTime), $.when()
  29331. },
  29332. get: function (e) {
  29333. return this.baseUrl.replace('{{filename}}', e)
  29334. }
  29335. }),
  29336. (a.prototype = {
  29337. init: function () {
  29338. return this.initialLoadingPromise
  29339. ? this.initialLoadingPromise
  29340. : (setInterval(
  29341. function () {
  29342. var e = this.urlContainer ? this.urlContainer.expires : Date.now()
  29343. Date.now() + c.signedUrlRefreshBuffer > e &&
  29344. (u.debug('Refreshing urls...'),
  29345. this.refresh()
  29346. .done(function () {
  29347. u.debug('Refreshed')
  29348. })
  29349. .fail(function () {
  29350. u.error('Failed url refresh, urls might go stale soon')
  29351. }))
  29352. }.bind(this),
  29353. c.signedUrlCheckInterval
  29354. ),
  29355. (this.initialLoadingPromise = this.refresh()),
  29356. this.initialLoadingPromise)
  29357. },
  29358. refresh: function (e) {
  29359. //已经在someData.js里加载过了 不用再加载file了吧
  29360. e = e || {}
  29361. /*var t = void 0 === e.cache || e.cache;
  29362. return s.get( this.endpoint , { //file
  29363. responseType: "json",
  29364. prefetchFrom: t ? "files" : null,
  29365. cache: t,
  29366. auth: this.authorizationHeader
  29367. }).then(function(e) {
  29368. if (this.urlContainer && this.urlContainer.validate(e))
  29369. return this.urlContainer.update(e);
  29370. for (var i = 0; i < this.containerClasses.length; i++) {
  29371. var n = this.containerClasses[i]
  29372. , r = new n;
  29373. if (r.validate(e))
  29374. return u.info("Using urls version " + r.version),
  29375. this.urlContainer = r,
  29376. this.urlContainer.update(e)
  29377. }
  29378. return t ? this.refresh({
  29379. cache: !1
  29380. }) : $.Deferred().reject("missing-urls")
  29381. }
  29382. .bind(this), function(e) {
  29383. return "loading-failed"
  29384. }) */
  29385. return $.Deferred().resolve()
  29386. },
  29387. get: function (e) {
  29388. //return this.urlContainer.get(e)
  29389. return window.DATA.files.templates[0].replace('{{filename}}', e)
  29390. }
  29391. }),
  29392. (t.exports = a)
  29393. }).call(this, '/js/util/ModelUrls.js')
  29394. },
  29395. {
  29396. '../ab': 3,
  29397. '../constants': 8,
  29398. './ajax': 181,
  29399. './logger': 189,
  29400. './showcase': 193
  29401. }
  29402. ],
  29403. 178: [
  29404. function (e, t, i) {
  29405. ;(function (i) {
  29406. 'use strict'
  29407. function n() {
  29408. u.call(this), (this.neighbourMap = {}), (this.map = null)
  29409. }
  29410. var r = e('three'),
  29411. o = e('./common'),
  29412. a = e('../settings'),
  29413. s = e('../objects/Panorama'),
  29414. a = e('../settings'),
  29415. l = e('./aStar'),
  29416. c = e('./logger'),
  29417. h = new c(i),
  29418. u = e('./IndexedCollection'),
  29419. d = e('./transitions')
  29420. o.inherit(n, u),
  29421. (n.prototype.getIndex = function (e) {
  29422. return e.id
  29423. }),
  29424. (n.prototype.find = function (e, t) {
  29425. var i = o.filterAll(this.list, e)
  29426. return 0 === i.length
  29427. ? null
  29428. : (t &&
  29429. t.forEach(function (e) {
  29430. i = o.stableSort(i, e)
  29431. }),
  29432. i[0])
  29433. }),
  29434. /* n.prototype.sortByScore = function(e, t) {
  29435. var i = o.filterAll(this.list, e);
  29436. return 0 === i.length ? null : i = i.map(function(e) {
  29437. return {
  29438. pano: e,
  29439. score: t.reduce(function(t, i) {
  29440. return t + i(e)
  29441. }, 0)
  29442. }
  29443. }).sort(function(e, t) {
  29444. return t.score - e.score;
  29445. })
  29446. } */
  29447. (n.prototype.sortByScore = function (request, rank) {
  29448. return common.sortByScore(this.list, request, rank)
  29449. }),
  29450. (n.prototype.lowestByScore = function (e, t, i) {
  29451. return this.findRankedByScore(0, e, t, i)
  29452. }),
  29453. (n.prototype.findRankedByScore = function (e, t, i, n) {
  29454. n && ((n.candidates = null), (n.pano = null)), e || (e = 0)
  29455. var r = this.sortByScore(t, i)
  29456. return !r || 0 === r.length || e >= r.length ? null : (n && ((n.candidates = r), (n.pano = r[e].item)), r[e].item)
  29457. }),
  29458. (n.prototype.showPanoScores = function (e) {
  29459. this.list.forEach(function (e) {
  29460. e.removeTextSprite()
  29461. })
  29462. var t = 6344768
  29463. e.forEach(function (e) {
  29464. e.pano.addTextSprite(e.score.toFixed(2), t), (t = 16428055)
  29465. })
  29466. }),
  29467. (n.prototype.isNeighbour = function (e, t) {
  29468. return this.neighbourMap[e.id][t.id]
  29469. }),
  29470. (n.prototype.getNeighbours = function (e) {
  29471. return this.neighbourMap[e.id]
  29472. }),
  29473. (n.prototype.setNeighbour = function (e, t, i) {
  29474. return (
  29475. this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  29476. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  29477. (this.neighbourMap[e.id][e.id] = !0),
  29478. (this.neighbourMap[t.id][t.id] = !0),
  29479. (this.neighbourMap[e.id][t.id] = i),
  29480. (this.neighbourMap[t.id][e.id] = i),
  29481. this.neighbourMap[e.id]
  29482. )
  29483. }),
  29484. (n.prototype.findClosest = function (e, t) {
  29485. var i = [s.filters.isPanoAligned()]
  29486. return t && i.push(s.filters.inDirection(e, t, 0.75)), this.find(i, [s.sortFunctions.distanceToPoint(e)])
  29487. }),
  29488. (n.prototype.dualNeighbors = function (e, t) {
  29489. var i,
  29490. n = []
  29491. for (i in this.neighbourMap[e.id]) this.neighbourMap[t.id][i] && n.push(i)
  29492. return n
  29493. }),
  29494. (n.prototype.populate_path_graph = function () {
  29495. var e,
  29496. t,
  29497. i,
  29498. n,
  29499. o,
  29500. a,
  29501. s,
  29502. l,
  29503. c = Date.now(),
  29504. u = {},
  29505. d = 0,
  29506. p = new r.Vector3(0, 0, 0),
  29507. f = 0,
  29508. g = 0
  29509. for (e = 0; e < this.list.length; e += 1) {
  29510. ;(o = this.list[e]), (s = {}), (l = !1), (i = o.neighbourPanos || o.findNeighourPanos())
  29511. for (t in i)
  29512. if (i[t]) {
  29513. ;(a = this.index[t]), p.copy(o.floorPosition), p.sub(a.floorPosition)
  29514. var m = Math.sqrt(p.x * p.x + p.z * p.z),
  29515. v = (Math.abs(p.y) / Math.max(m, 0.01), Math.max(0, Math.abs(p.y) - 0.2))
  29516. v > 0 ? ((f += 1), (v = Math.pow(4 * v, 2)), (m = Math.pow(m, 2)), (n = Math.sqrt(v * v + m * m))) : ((g += 1), (n = p.length())), (s[a.id] = n), (l = !0)
  29517. }
  29518. l ? (u[o.id] = s) : (d += 1)
  29519. }
  29520. ;(this.map = u), h.info('graph ready in ' + (Date.now() - c) + 'ms, ' + d + ' had no neighbors')
  29521. }),
  29522. (n.prototype.aStarSearch = function (e, t) {
  29523. var i = Date.now(),
  29524. n = new l({
  29525. start: e,
  29526. isEnd: function (e) {
  29527. return e === t
  29528. },
  29529. neighbor: function (e) {
  29530. var t = e.neighbourPanos || e.findNeighourPanos(),
  29531. i = []
  29532. for (var n in t) t[n] && i.push(this.index[n]) //add: t[n] &&
  29533. return i
  29534. }.bind(this),
  29535. distance: function (e, t) {
  29536. var i = this.map[e.id],
  29537. n = i[t.id]
  29538. return n
  29539. }.bind(this),
  29540. heuristic: function (e, t) {
  29541. return 1
  29542. }.bind(this),
  29543. hash: function (e) {
  29544. return e.id
  29545. },
  29546. timeout: 5e3
  29547. })
  29548. if ((h.debug('A* search in ' + (Date.now() - i) + 'ms'), 'success' !== n.status)) return h.debug('Did not find A* path from ' + e + ' to ' + t), null
  29549. h.debug('Total cost ' + n.cost.toPrecision(3) + ', ' + n.path.length + ' steps')
  29550. var r = []
  29551. return (
  29552. n.path.forEach(function (e) {
  29553. r.push(e.id)
  29554. }),
  29555. r
  29556. )
  29557. }),
  29558. (n.prototype.includeNodesNearPath = (function () {
  29559. var e = new r.Vector3(),
  29560. t = new r.Vector3(),
  29561. i = new r.Vector3(),
  29562. n = new r.Vector3(),
  29563. o = new r.Vector3(),
  29564. a = new r.Vector3(),
  29565. s = new r.Vector3(),
  29566. l = new r.Vector3(),
  29567. c = [],
  29568. h = new r.Vector3(),
  29569. u = new r.Vector3()
  29570. return function (r, d) {
  29571. if (r)
  29572. for (
  29573. var p = function (e, t, i) {
  29574. return o.copy(t).sub(e), o.dot(i)
  29575. },
  29576. f = function (e, t) {
  29577. return p(h, e.position, i) - p(h, t.position, i)
  29578. },
  29579. g = 0;
  29580. g < r.length - 1;
  29581. ) {
  29582. var m = r[g],
  29583. v = r[g + 1],
  29584. A = this.index[m],
  29585. y = this.index[v]
  29586. h.copy(A.position), u.copy(y.position), (c.length = 0), e.copy(u).sub(h), i.copy(e).normalize()
  29587. for (var C = 0; C < this.list.length; C++) {
  29588. var I = this.list[C]
  29589. o.copy(I.position).sub(h)
  29590. var E = o.dot(i)
  29591. if (E > 0) {
  29592. s.copy(i), s.multiplyScalar(E), a.copy(o), a.sub(s)
  29593. var b = a.length()
  29594. if (b < d) {
  29595. t.copy(e).negate(), n.copy(t).normalize(), l.copy(I.position).sub(u)
  29596. var w = l.dot(n)
  29597. w > 0 && c.push(I)
  29598. }
  29599. }
  29600. }
  29601. if (c.length > 0) {
  29602. c.sort(f)
  29603. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--) r[_] = r[_ - c.length]
  29604. for (var T = 0; T < c.length; T++) r[T + g + 1] = c[T].id
  29605. }
  29606. g += c.length + 1
  29607. }
  29608. }
  29609. })()),
  29610. /* n.prototype. = function(e, t) {
  29611. var i = void 0 === e ? a.panorama.markerOpacity : e
  29612. , n = this.list.findIndex(function(e) {
  29613. return e.marker
  29614. });
  29615. if (!(n < 0)) {
  29616. var r = this.list[n].marker.material.opacity;
  29617. if (r !== e) {
  29618. var o = i - r;
  29619. d.trigger({
  29620. func: function(e, t) {
  29621. var i = r + e * o;
  29622. this.forEach(function(e) {
  29623. e.marker && (e.marker.material.opacity = i)
  29624. })
  29625. }
  29626. .bind(this),
  29627. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  29628. name: "_fpm"
  29629. })
  29630. }
  29631. }
  29632. } */
  29633. (n.prototype.fadeMarkerOpacity = function (e, t, gr) {
  29634. d.cancelById('fadeMarkerOpacity')
  29635. var n = this.list.findIndex(function (e) {
  29636. //why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  29637. return e.marker
  29638. })
  29639. if (n < 0) {
  29640. //logger.info('marker findIndex<0')
  29641. return
  29642. }
  29643. var group
  29644. var tran = function (list, index) {
  29645. list.member = list.member.filter(function (m) {
  29646. return m.marker && m.marker.material.opacity != list.toOp
  29647. })
  29648. transitions.trigger({
  29649. func: function (e, t) {
  29650. //e:0-1
  29651. list.member.forEach(function (m) {
  29652. var o = m.marker.oldOpacity
  29653. var i = o + e * (list.toOp - o)
  29654. m.marker && (m.marker.material.opacity = i)
  29655. })
  29656. }.bind(this),
  29657. duration: void 0 == t ? a.markerOpacityTransitionTime : t,
  29658. name: '_fpm_' + index,
  29659. id: 'fadeMarkerOpacity'
  29660. })
  29661. }
  29662. this.forEach(function (e) {
  29663. //先记录旧的opacity
  29664. e.marker && (e.marker.oldOpacity = e.marker.material.opacity)
  29665. })
  29666. group = gr
  29667. /* if (e > 0 && gr) {
  29668. group = gr
  29669. } else {
  29670. group = [
  29671. {
  29672. member: this.list,
  29673. toOp: 0,
  29674. },
  29675. ]
  29676. } */
  29677. for (var i = 0; i < group.length; i++) {
  29678. tran(group[i], i)
  29679. }
  29680. }),
  29681. (t.exports = n)
  29682. }).call(this, '/js/util/PanoramaCollection.js')
  29683. },
  29684. {
  29685. '../objects/Panorama': 148,
  29686. '../settings': 166,
  29687. './IndexedCollection': 175,
  29688. './aStar': 180,
  29689. './common': 185,
  29690. './logger': 189,
  29691. './transitions': 195,
  29692. three: 217
  29693. }
  29694. ],
  29695. 179: [
  29696. function (e, t, i) {
  29697. 'use strict'
  29698. function n() {
  29699. ;(this.actionSequence = []), (this.actionSequenceInProgress = !1)
  29700. }
  29701. function r(e, t, i, n) {
  29702. s.trackAlways('zoom_' + e, {
  29703. from: t,
  29704. to: i,
  29705. pano: n
  29706. })
  29707. }
  29708. function o(e, t) {
  29709. r('initial', 1, e, t)
  29710. }
  29711. function a(e, t, i) {
  29712. r('followup', e, t, i)
  29713. }
  29714. var s = e('../analytics')
  29715. ;(n.prototype.reset = function (e) {
  29716. ;(this.actionSequenceInProgress = !1), (this.actionSequence.length = 0)
  29717. }),
  29718. (n.prototype.addZoomAction = (function () {
  29719. var e = null,
  29720. t = null,
  29721. i = !1,
  29722. n = function () {
  29723. if (((e = null), this.actionSequence.length > 0)) {
  29724. var i = this.actionSequence[0].start,
  29725. n = this.actionSequence[this.actionSequence.length - 1].end
  29726. 1 === i ? o(n, t) : a(i, n, t)
  29727. }
  29728. this.reset()
  29729. }
  29730. return function (r, o, a) {
  29731. if (r !== o) {
  29732. i || ((n = n.bind(this)), (i = !0)),
  29733. e && (window.clearTimeout(e), (e = null)),
  29734. (a === t && this.actionSequenceInProgress) || (this.reset(), (t = a)),
  29735. (this.actionSequenceInProgress = !0)
  29736. var s = {
  29737. start: r,
  29738. end: o
  29739. }
  29740. this.actionSequence.push(s), (e = window.setTimeout(n, 150))
  29741. }
  29742. }
  29743. })()),
  29744. (t.exports = n)
  29745. },
  29746. {
  29747. '../analytics': 4
  29748. }
  29749. ],
  29750. 180: [
  29751. function (e, t, i) {
  29752. 'use strict'
  29753. function n(e) {
  29754. void 0 === e.timeout && (e.timeout = 1 / 0)
  29755. var t = e.hash || o,
  29756. i = {
  29757. data: e.start,
  29758. g: 0,
  29759. h: e.heuristic(e.start)
  29760. },
  29761. n = i
  29762. i.f = i.h
  29763. var h = new s(),
  29764. u = new l(a),
  29765. d = c()
  29766. u.push(i), d.set(t(i.data), i)
  29767. for (var p = new Date(); u.size(); ) {
  29768. if (new Date() - p > e.timeout)
  29769. return {
  29770. status: 'timeout',
  29771. cost: n.g,
  29772. path: r(n)
  29773. }
  29774. var f = u.pop()
  29775. if ((d.delete(t(f.data)), e.isEnd(f.data)))
  29776. return {
  29777. status: 'success',
  29778. cost: f.g,
  29779. path: r(f)
  29780. }
  29781. h.add(t(f.data))
  29782. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  29783. var v = g[m]
  29784. if (!h.contains(t(v))) {
  29785. var A = f.g + e.distance(f.data, v),
  29786. y = d.get(t(v)),
  29787. C = !1
  29788. if (void 0 === y)
  29789. (y = {
  29790. data: v
  29791. }),
  29792. d.set(t(v), y)
  29793. else {
  29794. if (y.g < A) continue
  29795. C = !0
  29796. }
  29797. ;(y.parent = f), (y.g = A), (y.h = e.heuristic(v)), (y.f = A + y.h), y.h < n.h && (n = y), C ? u.heapify() : u.push(y)
  29798. }
  29799. }
  29800. }
  29801. return {
  29802. status: 'noPath',
  29803. cost: n.g,
  29804. path: r(n)
  29805. }
  29806. }
  29807. function r(e) {
  29808. if (void 0 !== e.parent) {
  29809. var t = r(e.parent)
  29810. return t.push(e.data), t
  29811. }
  29812. return [e.data]
  29813. }
  29814. function o(e) {
  29815. return e.toString()
  29816. }
  29817. function a(e, t) {
  29818. return e.f - t.f
  29819. }
  29820. var s = e('Set'),
  29821. l = e('heap'),
  29822. c = e('dict')
  29823. t.exports = n
  29824. },
  29825. {
  29826. Set: 196,
  29827. dict: 210,
  29828. heap: 211
  29829. }
  29830. ],
  29831. 181: [
  29832. function (e, t, i) {
  29833. ;(function (i) {
  29834. 'use strict'
  29835. function n(e, t, i) {
  29836. var n = new XMLHttpRequest()
  29837. if (i && 'withCredentials' in n) n.open(e, t, i)
  29838. else if ('undefined' != typeof XDomainRequest) (n = new XDomainRequest()), n.open(e, t)
  29839. else {
  29840. if (i) throw 'Browser does not support CORS!'
  29841. n.open(e, t)
  29842. }
  29843. return n
  29844. }
  29845. function r(e, t, i) {
  29846. function o() {
  29847. u.warn('Retrying ', t), r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  29848. }
  29849. function a(e, t) {
  29850. var i = e.response
  29851. if ('json' === t && 'object' != typeof i)
  29852. try {
  29853. i = JSON.parse(e.responseText)
  29854. } catch (e) {
  29855. return void c.reject({
  29856. error: 'Failed parsing JSON'
  29857. })
  29858. }
  29859. else if ('image/jpeg' === t) {
  29860. var n = new Uint8Array(e.response),
  29861. r = new Blob([n], {
  29862. type: 'image/jpeg'
  29863. }),
  29864. o = URL.createObjectURL(r)
  29865. ;(i = new Image()),
  29866. (i.src = o),
  29867. (i.crossOrigin = 'Anonymous'),
  29868. (i.onload = function () {
  29869. URL.revokeObjectURL(o)
  29870. })
  29871. }
  29872. return i
  29873. }
  29874. var s = n(e, t, !1)
  29875. if (((i = i || {}), (i.retries = void 0 !== i.retries ? i.retries : 0), (i.retry = void 0 !== i.retry ? i.retry : 'get' === e.toLowerCase()), i.responseType))
  29876. if (['arraybuffer', 'text', 'json'].indexOf(i.responseType) > -1) s.responseType = i.responseType
  29877. else {
  29878. if ('image/jpeg' !== i.responseType) throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"')
  29879. s.responseType = 'arraybuffer'
  29880. }
  29881. if (
  29882. ('json' === i.responseType && s.setRequestHeader('Accept', 'application/json'),
  29883. i.auth && s.setRequestHeader('Authorization', i.auth),
  29884. 'object' == typeof i.data && ((i.data = JSON.stringify(i.data)), s.setRequestHeader('Content-Type', 'application/json')),
  29885. 'object' == typeof i.headers)
  29886. )
  29887. for (var l in i.headers) s.setRequestHeader(l, i.headers[l])
  29888. var c = $.Deferred()
  29889. return (
  29890. (s.onreadystatechange = function (e) {
  29891. if (4 === this.readyState)
  29892. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3) i.retries++, setTimeout(o, 1e3)
  29893. else if (200 === this.status) {
  29894. var t = a(this, i.responseType)
  29895. c.resolve(t)
  29896. } else c.reject(this)
  29897. }),
  29898. (s.onprogress = function (e) {
  29899. c.notify(e)
  29900. }),
  29901. s.send(i.data),
  29902. c.promise()
  29903. )
  29904. }
  29905. function o(e) {
  29906. return Object.keys(e)
  29907. .sort()
  29908. .map(function (t) {
  29909. return {
  29910. key: t,
  29911. value: e[t]
  29912. }
  29913. })
  29914. }
  29915. function a(e, t) {
  29916. var i = t.responseType || null,
  29917. n = t.auth || null,
  29918. r = t.prefetchFrom || null,
  29919. a = e + '__' + i + '__' + n + '__' + r
  29920. return (
  29921. t.headers &&
  29922. o(t.headers).forEach(function (e) {
  29923. a += '__' + e.key + ':' + e.value
  29924. }),
  29925. a
  29926. )
  29927. }
  29928. function s(e, t) {
  29929. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  29930. }
  29931. function l(e, t, i) {
  29932. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  29933. }
  29934. var c = e('./logger'),
  29935. h = e('../ab'),
  29936. u = new c(i)
  29937. ;(window.URL = window.URL || window.webkitURL),
  29938. (window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {}),
  29939. (window.DATA = window.DATA || {}),
  29940. /* setTimeout(function() {//MP-- xzw delete
  29941. window.MP_REQUEST_CACHE = null,
  29942. window.DATA = {}
  29943. }, 6e4),
  29944. window.onpageshow = function(e) {
  29945. e.persisted && (window.MP_REQUEST_CACHE = null,
  29946. window.DATA = {})
  29947. } */
  29948. (t.exports = {
  29949. get: function (e, t) {
  29950. t = t || {}
  29951. var i = void 0 === t.cache || t.cache
  29952. if (i) {
  29953. var n = s(e, t)
  29954. if (n) return n
  29955. }
  29956. var o
  29957. return (o = t.prefetchFrom && window.DATA[t.prefetchFrom] ? $.when(window.DATA[t.prefetchFrom]) : r('GET', e, t)), i && l(e, t, o), o
  29958. },
  29959. post: function (e, t) {
  29960. return r('POST', e, t)
  29961. },
  29962. patch: function (e, t) {
  29963. return r('PATCH', e, t)
  29964. },
  29965. getImage: function (e, t) {
  29966. //xzw改 遇到部分图片在ios16以上显示不出,ios18更严重。查阅解决方法为使用decode
  29967. function i() {
  29968. u.warn('Retrying ', e),
  29969. o
  29970. .getImage(e, t - 1)
  29971. .done(n.resolve.bind(n))
  29972. .progress(n.notify.bind(n))
  29973. .fail(n.reject.bind(n))
  29974. }
  29975. var n = $.Deferred(),
  29976. r = new Image(),
  29977. o = this
  29978. e = h.changeIfImageOptimzing(e)
  29979. ;(r.crossOrigin = 'anonymous'), (r.src = e)
  29980. /* if(browser.texNeedDecode){//
  29981. r.decode().then((e) => {
  29982. let delay = Math.round(r.width * r.height / 30000)
  29983. browser.isMobile() && (delay *= 3)
  29984. //console.log('delay111111111111',delay)
  29985. setTimeout(()=>{n.resolve(r)}, delay ) //需延迟,否则报错 WebGL: INVALID_VALUE: texImage2D: bad image data,但延迟时间不定。 试过定时1秒后更新tex没用。 直接改图为rgb模式了
  29986. }).catch((error) => {
  29987. console.error('Image decoding failed:?!!!!', error);
  29988. });
  29989. }else{//原本的代码: */
  29990. ;(null !== t && void 0 !== t) || (t = 3)
  29991. ;(r.onerror = function () {
  29992. t > 0 ? setTimeout(i, 1e3) : n.reject()
  29993. }),
  29994. (r.onload = function () {
  29995. n.resolve(r)
  29996. })
  29997. //}
  29998. return n
  29999. /*
  30000. Safari 浏览器在 iOS 上有一个特殊的图像解码策略,称为“懒加载”或“延迟解码”。这意味着图像不会立即解码,而是在需要显示时才解码。这可能会导致某些情况下图像无法及时显示。
  30001. 使用 decode() 方法:如果你使用的是现代浏览器(如 Safari 14+),可以尝试使用 ImageBitmapRenderingContext 的 createImageBitmap() 和 decode() 方法来提前解码图像。
  30002. const image = new Image();
  30003. image.src = 'image.png';
  30004. image.decode().then(() => {
  30005. const texture = new THREE.Texture(image);
  30006. texture.needsUpdate = true;
  30007. }).catch((error) => {
  30008. console.error('Image decoding failed:', error);
  30009. });
  30010. */
  30011. }
  30012. })
  30013. }).call(this, '/js/util/ajax.js')
  30014. },
  30015. {
  30016. '../ab': 3,
  30017. './logger': 189
  30018. }
  30019. ],
  30020. 182: [
  30021. function (e, t, i) {
  30022. 'use strict'
  30023. function n(e, t) {
  30024. var i = window.navigator.userAgent,
  30025. n = i.match(e)
  30026. return (
  30027. (n = n ? n[1].split(t) : []),
  30028. {
  30029. major: parseInt(n[0]) || 0,
  30030. minor: parseInt(n[1]) || 0,
  30031. patch: parseInt(n[2]) || 0
  30032. }
  30033. )
  30034. }
  30035. var r = e('../exception/DeviceMismatchException')
  30036. t.exports = {
  30037. supportsFullscreen: function () {
  30038. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  30039. },
  30040. isPointerLocked: function () {
  30041. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  30042. },
  30043. requestFullscreen: function (e, t) {
  30044. e.requestFullscreen
  30045. ? e.requestFullscreen()
  30046. : e.mozRequestFullScreen
  30047. ? e.mozRequestFullScreen()
  30048. : e.webkitRequestFullscreen
  30049. ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)
  30050. : e.msRequestFullscreen && e.msRequestFullscreen(),
  30051. t && $(document).on('fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange', browser.requestPointerLock)
  30052. },
  30053. requestPointerLock: function () {
  30054. var e
  30055. if (document.fullscreenElement) e = document.fullscreenElement()
  30056. else if (document.mozFullscreenElement) e = document.mozFullscreenElement()
  30057. else if (document.mozFullScreenElement) e = document.mozFullScreenElement()
  30058. else {
  30059. if (!document.webkitFullscreenElement) return
  30060. e = document.webkitFullscreenElement()
  30061. }
  30062. ;(e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock),
  30063. e.requestPointerLock(),
  30064. $(document).off('fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange', this)
  30065. },
  30066. exitPointerLock: function () {
  30067. ;(document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock), document.exitPointerLock()
  30068. },
  30069. exitFullscreen: function () {
  30070. document.exitFullscreen
  30071. ? document.exitFullscreen()
  30072. : document.msExitFullscreen
  30073. ? document.msExitFullscreen()
  30074. : document.mozCancelFullScreen
  30075. ? document.mozCancelFullScreen()
  30076. : document.webkitExitFullscreen && document.webkitExitFullscreen()
  30077. },
  30078. details: function () {
  30079. var e = navigator.userAgent.match('(Firefox|Chrome|Safari)/([\\d]+)')
  30080. return e
  30081. ? {
  30082. name: e[1],
  30083. version: parseInt(e[2]),
  30084. platform: navigator.platform
  30085. }
  30086. : {}
  30087. },
  30088. is: function (e) {
  30089. return this.details() && this.details().name === e
  30090. },
  30091. inIframe: function () {
  30092. return window.parent !== window
  30093. },
  30094. aspectRatio: function () {
  30095. var e = $('#player').width() / $('#player').height()
  30096. return isFinite(e) ? e : 0
  30097. },
  30098. userAgent: function () {
  30099. return window.navigator.userAgent
  30100. },
  30101. isLandscape: function () {
  30102. return this.isMobile && this.aspectRatio() > 1
  30103. },
  30104. isSmallScreen: function () {
  30105. var e = screen.width / window.devicePixelRatio
  30106. return e < 240
  30107. },
  30108. detectIE: function () {
  30109. var e = window.navigator.userAgent,
  30110. t = e.indexOf('MSIE ')
  30111. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  30112. },
  30113. detectSafari: function () {
  30114. var e = window.navigator.userAgent,
  30115. t = e.indexOf('Safari')
  30116. return t !== -1 && !this.detectChrome() //因为 Chrome 的用户代理字符串中也包含 "Safari"。
  30117. },
  30118. SafariVersion: function () {
  30119. //add
  30120. if (!this.detectSafari()) return
  30121. const match = window.navigator.userAgent.match(/Version\/(\d+)\.(\d+)/)
  30122. if (match) {
  30123. return {
  30124. major: parseInt(match[1], 10),
  30125. minor: parseInt(match[2], 10)
  30126. }
  30127. }
  30128. },
  30129. detectFirefox: function () {
  30130. var e = window.navigator.userAgent
  30131. return e.indexOf('Firefox') !== -1
  30132. },
  30133. detectChrome: function () {
  30134. var e = window.navigator.userAgent
  30135. return e.indexOf('Chrome') !== -1 && !this.detectOpera()
  30136. },
  30137. detectOpera: function () {
  30138. var e = window.navigator.userAgent
  30139. return e.indexOf('OPR') !== -1
  30140. },
  30141. detectIOS: function () {
  30142. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  30143. },
  30144. detectIPad: function () {
  30145. var e = window.navigator.userAgent,
  30146. t = /iPad/
  30147. return t.test(e)
  30148. },
  30149. detectIPod: function () {
  30150. var e = window.navigator.userAgent,
  30151. t = /iPod/
  30152. return t.test(e)
  30153. },
  30154. detectIPhone: function () {
  30155. var e = window.navigator.userAgent,
  30156. t = /iPhone/
  30157. return t.test(e)
  30158. },
  30159. detectAndroid: function () {
  30160. var e = window.navigator.userAgent
  30161. return e.indexOf('Android') !== -1
  30162. },
  30163. detectAndroidMobile: function () {
  30164. var e = window.navigator.userAgent
  30165. return this.detectAndroid() && e.indexOf('Mobile') !== -1
  30166. },
  30167. detectSamsungNative: function () {
  30168. var e = window.navigator.userAgent
  30169. return e.indexOf('SM-G900H') !== -1 || e.indexOf('GT-I9500') !== -1 || e.indexOf('SM-N900') !== -1
  30170. },
  30171. detectSamsungS6: function () {
  30172. var e = window.navigator.userAgent
  30173. return e.indexOf('SM-G92') !== -1
  30174. },
  30175. /************************************************************fyz改from徐世廷*************************************************************/
  30176. detectHUAWEI5X: function () {
  30177. return -1 !== window.navigator.userAgent.indexOf('KIW-TL00H')
  30178. },
  30179. /*******************************************************************************************************************************/
  30180. detectWebVR: function () {
  30181. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  30182. },
  30183. getVRDisplay: function () {
  30184. var e = $.Deferred()
  30185. return this.detectWebVR()
  30186. ? (navigator.getVRDisplays().then(function (t) {
  30187. t.length >= 1 && e.resolve(t[0]), e.reject(null)
  30188. }),
  30189. e)
  30190. : e.reject(null)
  30191. },
  30192. iosVersion: function () {
  30193. if (!this.detectIOS()) throw new r('Did not detect an iDevice')
  30194. var e = /((?:\d+\_?){1,3}) like Mac OS/,
  30195. t = '_'
  30196. return n(e, t)
  30197. },
  30198. androidVersion: function () {
  30199. if (!this.detectAndroid()) throw new r('Did not detect an Android based device')
  30200. var e = /Android ((?:\d+\.?){1,3})/,
  30201. t = '.'
  30202. return n(e, t)
  30203. },
  30204. valueFromCookie: function (e, t) {
  30205. var i = new RegExp(e + '=([0-9a-f]+)(; ?|$)').exec(document.cookie)
  30206. if (!i) return t
  30207. var n = i[1]
  30208. return 'boolean' == typeof t ? 'true' === n || '1' === n : 'number' == typeof t ? parseFloat(n) : n
  30209. }
  30210. }
  30211. Object.assign(window.browser, t.exports)
  30212. t.exports = window.browser
  30213. //window.browser.texNeedDecode = true//browser.SafariVersion()?.major > 14
  30214. changeLog()
  30215. },
  30216. {
  30217. '../exception/DeviceMismatchException': 56
  30218. }
  30219. ],
  30220. 183: [
  30221. function (e, t, i) {
  30222. ;(function (i) {
  30223. 'use strict'
  30224. function n(e, t) {
  30225. var i = r(t)
  30226. var replaceAll = function (str, f, e) {
  30227. //f全部替换成e
  30228. var reg = new RegExp(f, 'g') //创建正则RegExp对象
  30229. return str.replace(reg, e)
  30230. }
  30231. //获取方法:postFix = `&firstView=pano:${player.currentPano.id},qua:${math.toPrecision(player.quaternion.toArray(),4)}&qs=1`
  30232. var urlFirstView = c.valueFromHash('firstView')
  30233. if (urlFirstView) {
  30234. //&firstView=pano:e98808cfdb894f33851c3b3d7d0a2679,qua:-0.01515,0.325382,0.0052157,0.9454&qs=1
  30235. try {
  30236. urlFirstView = replaceAll(urlFirstView, 'pano:', '"pano":"')
  30237. if (urlFirstView.includes('qua')) {
  30238. urlFirstView = replaceAll(urlFirstView, ',qua:', '","qua":[')
  30239. urlFirstView += ']'
  30240. } else {
  30241. urlFirstView += '"'
  30242. }
  30243. urlFirstView = '{' + urlFirstView + '}'
  30244. let info = JSON.parse(urlFirstView)
  30245. i.pano = t.index[info.pano] //panos.get(info.pano)
  30246. if (!i.pano) {
  30247. urlFirstView = false
  30248. console.error('检测到firstView但是 找不到该pano')
  30249. } else {
  30250. if (info.qua) {
  30251. i.quaternion = new THREE.Quaternion().fromArray(info.qua)
  30252. } else {
  30253. i.quaternion = new THREE.Quaternion()
  30254. }
  30255. i.zoom = -1
  30256. i.mode = 'panorama'
  30257. i.setByUrl = true
  30258. }
  30259. } catch (e) {
  30260. urlFirstView = false
  30261. console.error('检测到firstView但是解析出错' + e)
  30262. }
  30263. }
  30264. if (Object.keys(i).length > 0) return i
  30265. if (e.heroImage) i = o(e, t)
  30266. else if (window.DATA.camera_start) {
  30267. var n = window.DATA.camera_start
  30268. try {
  30269. Object.keys(n).length > 0 &&
  30270. !l.isEmptyQuaternion(n.camera.quaternion) &&
  30271. ((i.mode = h.convertWorkshopModeInt(n.mode)),
  30272. (i.position = n.camera.position),
  30273. //i.quaternion = n.camera.quaternion,
  30274. (i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion)), //xzw
  30275. (i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom)),
  30276. n.pano &&
  30277. ((i.pano = t.get(n.pano.uuid) || t.findClosest(i.position)),
  30278. d.debug('Using camera_start'),
  30279. d.debug('Modeldata pano: ', i.pano.quaternion),
  30280. d.debug('Camera start pano: ', n.pano.quaternion)),
  30281. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  30282. } catch (e) {
  30283. d.warn(e.message)
  30284. if (i.mode == 'panorama' && !i.pano) i.pano = t.list[0]
  30285. }
  30286. }
  30287. if (
  30288. (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  30289. i.mode === h.MESH && i.position && ((i.mode = h.PANORAMA), (i.pano = t.findClosest(i.position)), (i.quaternion = i.pano.quaternion)),
  30290. 0 === Object.keys(i).length)
  30291. ) {
  30292. var a = t.list[0]
  30293. a && ((i.mode = h.PANORAMA), (i.pano = a), (i.position = a.position), (i.quaternion = a.quaternion), d.info('Starting at 1st pano ' + a.id))
  30294. }
  30295. return (i.mode = i.mode || h.DOLLHOUSE), i
  30296. }
  30297. function r(e) {
  30298. var t = c.valueFromHash('start', ''),
  30299. i = {}
  30300. if ('' !== t) {
  30301. d.debug('Start override found in parameters, trying to parse...'), (i = a(t) || {})
  30302. var n = c.valueFromHash('tag', null)
  30303. n && (i.tag = n), i.panoId && (i.pano = e.get(i.panoId))
  30304. }
  30305. return i
  30306. }
  30307. function o(e, t) {
  30308. if (!e.heroImage || !e.heroImage.metadata.camera_position) return {}
  30309. var i = {},
  30310. n = e.heroImage.metadata
  30311. d.debug('Using start position from thumbnail image'), (i.position = n.camera_position), (i.quaternion = n.camera_quaternion)
  30312. try {
  30313. ;(i.mode = h.convertWorkshopModeInt(n.camera_mode)), i.mode === h.PANORAMA ? (i.pano = t.get(n.scan_id)) : (i.floorVisibility = n.floor_visibility)
  30314. } catch (e) {
  30315. d.debug(e.message)
  30316. }
  30317. return i
  30318. }
  30319. function a(e) {
  30320. return s.deserialize(e)
  30321. }
  30322. var s = e('../controls/serializer'),
  30323. l = e('../util/math'),
  30324. c = e('./browser'),
  30325. h = e('../enum/Viewmode'),
  30326. u = e('../util/logger'),
  30327. th = e('three'), //xzw
  30328. d = new u(i)
  30329. t.exports = {
  30330. getStartCameraOptions: n
  30331. }
  30332. }).call(this, '/js/util/camera.js')
  30333. },
  30334. {
  30335. '../controls/serializer': 14,
  30336. '../enum/Viewmode': 51,
  30337. '../util/logger': 189,
  30338. '../util/math': 190,
  30339. './browser': 182,
  30340. three: 217
  30341. }
  30342. ],
  30343. 184: [
  30344. function (e, t, i) {
  30345. 'use strict'
  30346. function n(e, t, i) {
  30347. return o(e.fov, t, i)
  30348. }
  30349. var r = e('./MathLight'),
  30350. o = function (e, t, i) {
  30351. var n = t,
  30352. o = i,
  30353. a = 2 * Math.atan(Math.tan((e * r.RADIANS_PER_DEGREE) / 2) * (n / o)) * r.DEGREES_PER_RADIAN
  30354. return a
  30355. },
  30356. a = function (e, t, i) {
  30357. var n = t,
  30358. o = i,
  30359. a = 2 * Math.atan(Math.tan((e * r.RADIANS_PER_DEGREE) / 2) * (o / n)) * r.DEGREES_PER_RADIAN
  30360. return a
  30361. },
  30362. s = function (e, t, i, n) {
  30363. var r = o(e, i, n)
  30364. return r > t ? a(t, i, n) : e
  30365. }
  30366. t.exports = {
  30367. clampVFOV: s,
  30368. getHFOVForCamera: n,
  30369. getHFOVFromVFOV: o,
  30370. getVFOVFromHFOV: a
  30371. }
  30372. window.MathLight = t.exports
  30373. MathLight.closeTo = function (e1, e2, precision) {
  30374. //xzw add 判断e1,e2是否接近
  30375. var prec = Math.pow(10, -(precision || 4))
  30376. var s1 = Math.abs(e1.x - e2.x) < prec && Math.abs(e1.y - e2.y) < prec && Math.abs(e1.z - e2.z) < prec
  30377. if (e1.w) {
  30378. return s1 && Math.abs(e1.w - e2.w) < prec
  30379. } else return s1
  30380. }
  30381. },
  30382. {
  30383. './MathLight': 176
  30384. }
  30385. ],
  30386. 185: [
  30387. function (e, t, i) {
  30388. 'use strict'
  30389. var n = e('three')
  30390. ;(t.exports = {
  30391. delayOneFrame: function (e) {
  30392. window.setTimeout(e, 1)
  30393. },
  30394. normalizeUrl: function (e) {
  30395. return e.replace('https://', 'http://')
  30396. },
  30397. domainFromUrl: function (e) {
  30398. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e)
  30399. return t ? t[3] : e
  30400. },
  30401. average: function (e, t) {
  30402. if (0 === e.length) return null
  30403. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  30404. var o = t ? e[r][t] : e[r]
  30405. ;(i += o), n++
  30406. }
  30407. return i / n
  30408. },
  30409. countUnique: function (e) {
  30410. for (var t = {}, i = 0; i < e.length; i++) t[e[i]] = 1 + (t[e[i]] || 0)
  30411. return Object.keys(t).length
  30412. },
  30413. averageVectors: function (e, t) {
  30414. var i = new n.Vector3()
  30415. if (0 === e.length) return i
  30416. for (var r = 0, o = 0; o < e.length; o++) {
  30417. var a = t ? e[o][t] : e[o]
  30418. i.add(a), r++
  30419. }
  30420. return i.divideScalar(r)
  30421. },
  30422. equalLists: function (e, t) {
  30423. if (e.length !== t.length) return !1
  30424. for (var i = 0; i < e.length; i++) if (e[i] !== t[i]) return !1
  30425. return !0
  30426. },
  30427. lowerMedian: function (e, t) {
  30428. if (0 === e.length) return null
  30429. ;(t = t || 2),
  30430. e.sort(function (e, t) {
  30431. return e - t
  30432. })
  30433. var i = Math.floor(e.length / t)
  30434. return e[i]
  30435. },
  30436. stableSort: function (e, t) {
  30437. return e
  30438. .map(function (e, t) {
  30439. return {
  30440. value: e,
  30441. index: t
  30442. }
  30443. })
  30444. .sort(function (e, i) {
  30445. var n = t(e.value, i.value)
  30446. return 0 !== n ? n : e.index - i.index
  30447. })
  30448. .map(function (e) {
  30449. return e.value
  30450. })
  30451. },
  30452. filterAll: function (e, t) {
  30453. return e.filter(function (e) {
  30454. return t.every(function (t) {
  30455. return t(e)
  30456. })
  30457. })
  30458. },
  30459. formatDate: function (e) {
  30460. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join('-')
  30461. },
  30462. formatDatetime: function (e) {
  30463. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join('-')
  30464. },
  30465. randomString: function (e) {
  30466. for (var t = '', i = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', n = 0; n < e; n++) t += i.charAt(Math.floor(Math.random() * i.length))
  30467. return t
  30468. },
  30469. uint8ToBase64: function (e, t) {
  30470. ;(t && 'number' == typeof t) || (t = 8192)
  30471. for (var i = [], n = 0; n < e.length; n += t) i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)))
  30472. return btoa(i.join(''))
  30473. },
  30474. uuid4: function e(t) {
  30475. return t ? (t ^ ((16 * Math.random()) >> (t / 4))).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  30476. },
  30477. nth: function (e) {
  30478. return (e %= 10), 1 === e ? e + 'st' : 2 === e ? e + 'nd' : 3 === e ? e + 'rd' : e + 'th'
  30479. },
  30480. extendObject: function (e, t) {
  30481. return (
  30482. Object.keys(t).forEach(function (i) {
  30483. e[i] = t[i]
  30484. }),
  30485. e
  30486. )
  30487. },
  30488. deepExtend: function e(t) {
  30489. t = t || {}
  30490. for (var i = 1; i < arguments.length; i++) {
  30491. var n = arguments[i]
  30492. if (n) for (var r in n) n.hasOwnProperty(r) && ('object' == typeof n[r] ? (t[r] = e(t[r], n[r])) : (t[r] = n[r]))
  30493. }
  30494. return t
  30495. },
  30496. inherit: function (e, t) {
  30497. ;(e.prototype = Object.create(t.prototype)), (e.prototype.constructor = e)
  30498. },
  30499. extend: function (e, t) {
  30500. for (var i in t.prototype) e.prototype[i] = t.prototype[i]
  30501. },
  30502. getFileNameFromUrl: function (url) {
  30503. return url.split('/').pop()
  30504. }
  30505. }),
  30506. (Math.sign = function (e) {
  30507. return e < 0 ? -1 : 1
  30508. })
  30509. window.common = t.exports
  30510. expandCommon(common)
  30511. },
  30512. {
  30513. three: 217
  30514. }
  30515. ],
  30516. 186: [
  30517. function (e, t, i) {
  30518. 'use strict'
  30519. var n = {}
  30520. ;(n.linearTween = function (e, t, i, n) {
  30521. return (i * e) / n + t
  30522. }),
  30523. (n.easeInQuad = function (e, t, i, n) {
  30524. return (e /= n), i * e * e + t
  30525. }),
  30526. (n.easeOutQuad = function (e, t, i, n) {
  30527. return (e /= n), -i * e * (e - 2) + t
  30528. }),
  30529. (n.easeInOutQuad = function (e, t, i, n) {
  30530. return (e /= n / 2), e < 1 ? (i / 2) * e * e + t : (e--, (-i / 2) * (e * (e - 2) - 1) + t)
  30531. }),
  30532. (n.easeInCubic = function (e, t, i, n) {
  30533. return (e /= n), i * e * e * e + t
  30534. }),
  30535. (n.easeOutCubic = function (e, t, i, n) {
  30536. return (e /= n), e--, i * (e * e * e + 1) + t
  30537. }),
  30538. (n.easeInOutCubic = function (e, t, i, n) {
  30539. return (e /= n / 2), e < 1 ? (i / 2) * e * e * e + t : ((e -= 2), (i / 2) * (e * e * e + 2) + t)
  30540. }),
  30541. (n.easeInQuart = function (e, t, i, n) {
  30542. return (e /= n), i * e * e * e * e + t
  30543. }),
  30544. (n.easeOutQuart = function (e, t, i, n) {
  30545. return (e /= n), e--, -i * (e * e * e * e - 1) + t
  30546. }),
  30547. (n.easeInOutQuart = function (e, t, i, n) {
  30548. return (e /= n / 2), e < 1 ? (i / 2) * e * e * e * e + t : ((e -= 2), (-i / 2) * (e * e * e * e - 2) + t)
  30549. }),
  30550. (n.easeInQuint = function (e, t, i, n) {
  30551. return (e /= n), i * e * e * e * e * e + t
  30552. }),
  30553. (n.easeOutQuint = function (e, t, i, n) {
  30554. return (e /= n), e--, i * (e * e * e * e * e + 1) + t
  30555. }),
  30556. (n.easeInOutQuint = function (e, t, i, n) {
  30557. return (e /= n / 2), e < 1 ? (i / 2) * e * e * e * e * e + t : ((e -= 2), (i / 2) * (e * e * e * e * e + 2) + t)
  30558. }),
  30559. (n.easeInSine = function (e, t, i, n) {
  30560. return -i * Math.cos((e / n) * (Math.PI / 2)) + i + t
  30561. }),
  30562. (n.easeOutSine = function (e, t, i, n) {
  30563. return i * Math.sin((e / n) * (Math.PI / 2)) + t
  30564. }),
  30565. (n.easeInOutSine = function (e, t, i, n) {
  30566. return (-i / 2) * (Math.cos((Math.PI * e) / n) - 1) + t
  30567. }),
  30568. (n.easeInExpo = function (e, t, i, n) {
  30569. return i * Math.pow(2, 10 * (e / n - 1)) + t
  30570. }),
  30571. (n.easeOutExpo = function (e, t, i, n) {
  30572. return i * (-Math.pow(2, (-10 * e) / n) + 1) + t
  30573. }),
  30574. (n.easeInOutExpo = function (e, t, i, n) {
  30575. return (e /= n / 2), e < 1 ? (i / 2) * Math.pow(2, 10 * (e - 1)) + t : (e--, (i / 2) * (-Math.pow(2, -10 * e) + 2) + t)
  30576. }),
  30577. (n.easeInCirc = function (e, t, i, n) {
  30578. return (e /= n), -i * (Math.sqrt(1 - e * e) - 1) + t
  30579. }),
  30580. (n.easeOutCirc = function (e, t, i, n) {
  30581. return (e /= n), e--, i * Math.sqrt(1 - e * e) + t
  30582. }),
  30583. (n.easeInOutCirc = function (e, t, i, n) {
  30584. return (e /= n / 2), e < 1 ? (-i / 2) * (Math.sqrt(1 - e * e) - 1) + t : ((e -= 2), (i / 2) * (Math.sqrt(1 - e * e) + 1) + t)
  30585. }),
  30586. (n.easeInElastic = function (e, t, i, n) {
  30587. var r = 1.70158,
  30588. o = 0,
  30589. a = i
  30590. return 0 === e
  30591. ? t
  30592. : 1 === (e /= n)
  30593. ? t + i
  30594. : (o || (o = 0.3 * n),
  30595. a < Math.abs(i) ? ((a = i), (r = o / 4)) : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  30596. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin(((e * n - r) * (2 * Math.PI)) / o)) + t)
  30597. }),
  30598. (n.easeOutElastic = function (e, t, i, n) {
  30599. var r = 1.70158,
  30600. o = 0,
  30601. a = i
  30602. return 0 === e
  30603. ? t
  30604. : 1 === (e /= n)
  30605. ? t + i
  30606. : (o || (o = 0.3 * n),
  30607. a < Math.abs(i) ? ((a = i), (r = o / 4)) : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  30608. a * Math.pow(2, -10 * e) * Math.sin(((e * n - r) * (2 * Math.PI)) / o) + i + t)
  30609. }),
  30610. (n.easeInOutElastic = function (e, t, i, n) {
  30611. var r = 1.70158,
  30612. o = 0,
  30613. a = i
  30614. return 0 === e
  30615. ? t
  30616. : 2 === (e /= n / 2)
  30617. ? t + i
  30618. : (o || (o = n * (0.3 * 1.5)),
  30619. a < Math.abs(i) ? ((a = i), (r = o / 4)) : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  30620. e < 1
  30621. ? -0.5 * (a * Math.pow(2, 10 * (e -= 1)) * Math.sin(((e * n - r) * (2 * Math.PI)) / o)) + t
  30622. : a * Math.pow(2, -10 * (e -= 1)) * Math.sin(((e * n - r) * (2 * Math.PI)) / o) * 0.5 + i + t)
  30623. }),
  30624. (n.easeInBack = function (e, t, i, n, r) {
  30625. return void 0 === r && (r = 1.70158), i * (e /= n) * e * ((r + 1) * e - r) + t
  30626. }),
  30627. (n.easeOutBack = function (e, t, i, n, r) {
  30628. return void 0 === r && (r = 1.70158), i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  30629. }),
  30630. (n.easeInOutBack = function (e, t, i, n, r) {
  30631. return void 0 === r && (r = 1.70158), (e /= n / 2) < 1 ? (i / 2) * (e * e * (((r *= 1.525) + 1) * e - r)) + t : (i / 2) * ((e -= 2) * e * (((r *= 1.525) + 1) * e + r) + 2) + t
  30632. }),
  30633. (n.easeOutBounce = function (e, t, i, n) {
  30634. return (e /= n) < 1 / 2.75
  30635. ? i * (7.5625 * e * e) + t
  30636. : e < 2 / 2.75
  30637. ? i * (7.5625 * (e -= 1.5 / 2.75) * e + 0.75) + t
  30638. : e < 2.5 / 2.75
  30639. ? i * (7.5625 * (e -= 2.25 / 2.75) * e + 0.9375) + t
  30640. : i * (7.5625 * (e -= 2.625 / 2.75) * e + 0.984375) + t
  30641. }),
  30642. (n.easeInBounce = function (e, t, i, r) {
  30643. return i - n.easeOutBounce(r - e, 0, i, r) + t
  30644. }),
  30645. (n.easeInOutBounce = function (e, t, i, r) {
  30646. return e < r / 2 ? 0.5 * n.easeInBounce(2 * e, 0, i, r) + t : 0.5 * n.easeOutBounce(x, 2 * e - r, 0, i, r) + 0.5 * i + t
  30647. }),
  30648. (t.exports = n)
  30649. window.easing = n
  30650. },
  30651. {}
  30652. ],
  30653. 187: [
  30654. function (e, t, i) {
  30655. 'use strict'
  30656. function n() {
  30657. ;(this.events = []), (this.valid = !1)
  30658. }
  30659. var r = e('../enum/Joystick')
  30660. ;(n.prototype.push = function (e, t) {
  30661. this.events.push({
  30662. direction: e,
  30663. pano: t
  30664. }),
  30665. (this.valid = !0)
  30666. }),
  30667. (n.prototype.pop = function (e) {
  30668. var t = this.events.pop()
  30669. return this.events.length < 1 && (this.valid = !1), t
  30670. }),
  30671. (n.prototype.peek = function () {
  30672. return this.events.length
  30673. ? this.events[this.events.length - 1]
  30674. : {
  30675. direction: null,
  30676. pano: null
  30677. }
  30678. }),
  30679. (n.prototype.invalidate = function () {
  30680. ;(this.events = []), (this.valid = !1)
  30681. }),
  30682. (n.prototype.reversePano = function (e) {
  30683. if (!this.valid) return null
  30684. var t = this.peek()
  30685. return r.opposite(e) === t.direction ? (this.pop(), t.pano) : null
  30686. }),
  30687. (t.exports = n)
  30688. },
  30689. {
  30690. '../enum/Joystick': 29
  30691. }
  30692. ],
  30693. 188: [
  30694. function (e, t, i) {
  30695. 'use strict'
  30696. window.lerp = t.exports = {
  30697. vector: function (e, t) {
  30698. var i = e.clone()
  30699. return (
  30700. (t = t.clone()),
  30701. function (n) {
  30702. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  30703. }
  30704. )
  30705. },
  30706. quaternion: function (e, t) {
  30707. var i = e.clone()
  30708. return function (n) {
  30709. e.copy(i).slerp(t, n)
  30710. }
  30711. },
  30712. property: function (e, t, i, n) {
  30713. var r = e[t]
  30714. return function (o) {
  30715. ;(e[t] = r * (1 - o) + i * o), n && n(e[t])
  30716. }
  30717. },
  30718. uniform: function (e, t, i) {
  30719. var n = e.material.uniforms[t].value
  30720. return function (r) {
  30721. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  30722. }
  30723. },
  30724. matrix4: function (e, t) {
  30725. var i = e.clone()
  30726. return function (n) {
  30727. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++) r[s] = o[s] * (1 - n) + a[s] * n
  30728. }
  30729. },
  30730. allUniforms: function (e, t, i) {
  30731. var n = e.map(
  30732. function (e) {
  30733. return this.uniform(e, t, i)
  30734. }.bind(this)
  30735. )
  30736. return function (e) {
  30737. n.forEach(function (t) {
  30738. t(e)
  30739. })
  30740. }
  30741. }
  30742. }
  30743. },
  30744. {}
  30745. ],
  30746. 189: [
  30747. function (e, t, i) {
  30748. 'use strict'
  30749. function n(e) {
  30750. var t,
  30751. i,
  30752. o,
  30753. a,
  30754. s = e.split('/'),
  30755. l = '[' + s[s.length - 1].replace('.js', '') + ']',
  30756. c = {}
  30757. if (n.consoleEnabled) {
  30758. var h = function (e) {
  30759. $('#debug-console').append('<p>' + e + '</p>'), ($('#debug-console')[0].scrollTop = $('#debug-console')[0].scrollHeight)
  30760. }
  30761. ;(t = function (e) {
  30762. h(Array.prototype.slice.call(arguments).join(' '))
  30763. }),
  30764. (i = function (e) {
  30765. h(Array.prototype.slice.call(arguments).join(' '))
  30766. }),
  30767. (o = function (e) {
  30768. h('WARN: ' + Array.prototype.slice.call(arguments).join(' '))
  30769. }),
  30770. (a = function (e) {
  30771. h('ERROR: ' + Array.prototype.slice.call(arguments).join(' '))
  30772. })
  30773. } else
  30774. console.log
  30775. ? ((t = console.log), (i = console.info ? console.info : console.log), (o = console.warn ? console.warn : console.log), (a = console.error ? console.error : console.log))
  30776. : (t = i = o = a = function () {})
  30777. var u = function (e) {
  30778. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  30779. },
  30780. d = function (t, i) {
  30781. if (r) {
  30782. var o = Array.prototype.slice.call(t).join(' ')
  30783. r.captureMessage(o, {
  30784. level: i,
  30785. path: e,
  30786. timestamp: n.timestamp()
  30787. })
  30788. }
  30789. },
  30790. p = function (t, i) {
  30791. if (r) {
  30792. var o = Array.prototype.slice.call(t).join(' ')
  30793. r.captureException(new Error(o), {
  30794. level: i,
  30795. path: e,
  30796. timestamp: n.timestamp()
  30797. })
  30798. }
  30799. }
  30800. return {
  30801. debug: function () {
  30802. n.level >= n.levels.debug && t.apply(console, u(arguments))
  30803. },
  30804. info: function () {
  30805. n.level >= n.levels.info && i.apply(console, u(arguments))
  30806. },
  30807. warn: function () {
  30808. d(arguments, 'warn'), n.level >= n.levels.warn && o.apply(console, u(arguments))
  30809. },
  30810. error: function () {
  30811. p(arguments, 'error'), n.level >= n.levels.error && a.apply(console, u(arguments))
  30812. },
  30813. v3str: function (e, t) {
  30814. var i = void 0 === t ? 2 : t
  30815. return '(' + e.x.toPrecision(i) + ', ' + e.y.toPrecision(i) + ', ' + e.z.toPrecision(i) + ')'
  30816. },
  30817. eulstr: function (e, t) {
  30818. var i = void 0 === t ? 2 : t
  30819. return '(' + THREE.Math.radToDeg(e.x).toPrecision(i) + ', ' + THREE.Math.radToDeg(e.y).toPrecision(i) + ', ' + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  30820. },
  30821. time: function (e) {
  30822. n.level >= n.levels.debug && (c[e] = Date.now())
  30823. },
  30824. timeEnd: function (e) {
  30825. if (n.level >= n.levels.debug) {
  30826. var t = c[e]
  30827. if (!t) return
  30828. var i = (Date.now() - t) / 1e3
  30829. this.debug(e, i + 's')
  30830. }
  30831. }
  30832. }
  30833. }
  30834. var r = window.Raven
  30835. ;(n.timestamp = function () {
  30836. return (Date.now() - window.navigationStart) / 1e3 + 's'
  30837. }),
  30838. (n.levels = {
  30839. debug: 3,
  30840. info: 2,
  30841. warn: 1,
  30842. error: 0
  30843. }),
  30844. (n.level = n.levels.info),
  30845. (t.exports = n)
  30846. },
  30847. {}
  30848. ],
  30849. 190: [
  30850. function (e, t, i) {
  30851. 'use strict'
  30852. var n = e('three'),
  30853. r = e('../enum/GLCubeFaces'),
  30854. o = e('../constants')
  30855. t.exports = {
  30856. convertVisionVector: function (e) {
  30857. return new n.Vector3(e.x, e.z, -e.y)
  30858. },
  30859. convertVisionQuaternion: function (e) {
  30860. return new n.Quaternion(e.x, e.z, -e.y, e.w).multiply(new n.Quaternion().setFromAxisAngle(new n.Vector3(0, 1, 0), n.Math.degToRad(90)))
  30861. },
  30862. convertWorkshopVector: function (e) {
  30863. return new n.Vector3(-e.x, e.y, e.z)
  30864. },
  30865. convertWorkshopQuaternion: function (e) {
  30866. return new n.Quaternion(-e.x, e.y, e.z, -e.w).multiply(new n.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0))
  30867. },
  30868. convertWorkshopPanoramaQuaternion: function (e) {
  30869. return new n.Quaternion(e.x, -e.y, -e.z, e.w).normalize().multiply(new n.Quaternion().setFromAxisAngle(new n.Vector3(0, 1, 0), n.Math.degToRad(270)))
  30870. },
  30871. convertWorkshopOrthoZoom: function (e) {
  30872. // xzw
  30873. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  30874. //return e;
  30875. return e === -1 ? -1 : ((e * ($('#player').width() / $('#player').height())) / g_snapShotWidth) * g_snapShotHeight
  30876. },
  30877. toPrecision: function (e, t) {
  30878. //xzw change
  30879. var f = function (e, t) {
  30880. var i = Math.pow(10, t)
  30881. return Math.round(e * i) / i
  30882. }
  30883. if (e instanceof Array) {
  30884. for (var s = 0; s < e.length; s++) {
  30885. e[s] = f(e[s], t)
  30886. }
  30887. return e
  30888. } else return f(e, t)
  30889. },
  30890. isEmptyQuaternion: function (e) {
  30891. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  30892. },
  30893. projectPositionToCanvas: function (e, t, i) {
  30894. ;(i = i || new n.Vector3()), i.copy(e)
  30895. var r = 0.5 * $('#player').width(),
  30896. o = 0.5 * $('#player').height()
  30897. return i.project(t), (i.x = i.x * r + r), (i.y = -(i.y * o) + o), i
  30898. },
  30899. convertScreenPositionToNDC: function (e, t, i) {
  30900. return (i = i || new n.Vector2()), (i.x = (e / $('#player').width()) * 2 - 1), (i.y = 2 * -(t / $('#player').height()) + 1), i
  30901. },
  30902. constrainedTurn: function (e) {
  30903. var t = e % (2 * Math.PI)
  30904. return (t = t > Math.PI ? (t -= 2 * Math.PI) : t < -Math.PI ? (t += 2 * Math.PI) : t)
  30905. },
  30906. getFOVDotThreshold: function (e) {
  30907. return Math.cos(n.Math.degToRad(e / 2))
  30908. },
  30909. transform2DForwardVectorByCubeFace: function (e, t, i, n) {
  30910. switch (e) {
  30911. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  30912. i.set(1, t.y, t.x)
  30913. break
  30914. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  30915. i.set(-1, t.y, -t.x)
  30916. break
  30917. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  30918. i.set(-t.x, 1, -t.y)
  30919. break
  30920. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  30921. i.set(-t.x, -1, t.y)
  30922. break
  30923. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  30924. i.set(-t.x, t.y, 1)
  30925. break
  30926. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  30927. i.set(t.x, t.y, -1)
  30928. }
  30929. n && i.normalize()
  30930. },
  30931. //add:
  30932. getPos2d: function (point, camera, dom) {
  30933. var camera = camera
  30934. var dom = dom
  30935. 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);
  30936. var x, y
  30937. x = ((pos.x + 1) / 2) * dom.clientWidth
  30938. y = (1 - (pos.y + 1) / 2) * dom.clientHeight
  30939. var inSight = x <= dom.clientWidth && x >= 0 && y <= dom.clientHeight && y >= 0
  30940. return {
  30941. pos: new THREE.Vector2(x, y),
  30942. vector: pos,
  30943. trueSide: pos.z < 1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  30944. inSight: inSight //在屏幕范围内可见
  30945. }
  30946. },
  30947. getDirByLonLat: function (lon, lat) {
  30948. var dir = new THREE.Vector3()
  30949. var phi = THREE.Math.degToRad(90 - lat)
  30950. var theta = THREE.Math.degToRad(lon)
  30951. dir.x = Math.sin(phi) * Math.cos(theta)
  30952. dir.y = Math.cos(phi)
  30953. dir.z = Math.sin(phi) * Math.sin(theta)
  30954. return dir.negate()
  30955. }
  30956. }
  30957. window.math = t.exports
  30958. expandMath(math)
  30959. },
  30960. {
  30961. '../constants': 8,
  30962. '../enum/GLCubeFaces': 25,
  30963. three: 217
  30964. }
  30965. ],
  30966. 191: [
  30967. function (e, t, i) {
  30968. 'use strict'
  30969. function n(e, t, i) {
  30970. return a.map(
  30971. function (n, o) {
  30972. return e.get('pan/' + i + '/' + t + '_skybox' + r(n) + '.jpg')
  30973. }.bind(this)
  30974. )
  30975. }
  30976. function r(e) {
  30977. return s[e]
  30978. }
  30979. var o = e('../enum/GLCubeFaces'),
  30980. a = [0, 1, 2, 3, 4, 5],
  30981. s = {
  30982. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  30983. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  30984. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  30985. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  30986. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  30987. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  30988. }
  30989. t.exports = {
  30990. mapFaceToCubemapFace: r,
  30991. getCubemapUrls: n
  30992. }
  30993. },
  30994. {
  30995. '../enum/GLCubeFaces': 25
  30996. }
  30997. ],
  30998. 192: [
  30999. function (e, t, i) {
  31000. 'use strict'
  31001. t.exports = {
  31002. captureErrors: function (e, t, i) {
  31003. if ('Raven' in window) {
  31004. Raven.config(e, t).install(), i && Raven.setTagsContext(i)
  31005. var n = console.warn,
  31006. r = console.error
  31007. ;(console.warn = function () {
  31008. var e = Array.prototype.slice.call(arguments)
  31009. Raven.captureMessage(e.join(' '), {
  31010. level: 'warning'
  31011. }),
  31012. n.apply(console, e)
  31013. }),
  31014. (console.error = function () {
  31015. var e = Array.prototype.slice.call(arguments)
  31016. Raven.captureException(new Error(e.join(' ')), {
  31017. level: 'error'
  31018. }),
  31019. r.apply(console, e)
  31020. })
  31021. } else console.error('Raven not found, not capturing errors.')
  31022. }
  31023. }
  31024. },
  31025. {}
  31026. ],
  31027. 193: [
  31028. function (e, t, i) {
  31029. ;(function (i) {
  31030. 'use strict'
  31031. var n = e('./browser'),
  31032. r = e('../constants'),
  31033. o = e('url'),
  31034. a = e('./logger'),
  31035. ss = e('three'),
  31036. s = new a(i),
  31037. l = {
  31038. getAuthorizationHeader: function () {
  31039. var e = n.valueFromHash('auth')
  31040. if (e) return e.replace(',', ' ')
  31041. var t = n.valueFromCookie('token')
  31042. return t ? 'Token ' + t : null
  31043. },
  31044. parseSidUrl: function (e) {
  31045. var t, i
  31046. t = g_Prefix
  31047. if (((e = e || ''), e.match(/^https?/))) {
  31048. var n = o.parse(e)
  31049. ;(t = g_Prefix), (i = e)
  31050. } else {
  31051. //xzw 原先的不能用
  31052. //t = window.location.protocol + "//" + window.location.host, //MP
  31053. t = g_Prefix
  31054. //i = t + "/api/player/models/" + e; //MP
  31055. i = t + 'data/' + e
  31056. }
  31057. return {
  31058. urlBase: t,
  31059. urlModel: i,
  31060. urlFiles: i + (i.match(/\/$/) ? 'files' : '/files'),
  31061. urlThumb: i + (i.match(/\/$/) ? 'thumb' : '/thumb')
  31062. }
  31063. },
  31064. getModelIDFromQueryString: function () {
  31065. return n.valueFromHash('model') || n.valueFromHash('m')
  31066. },
  31067. /* normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  31068. e = JSON.parse(JSON.stringify(e));
  31069. var i = null;
  31070. if (e.images.forEach(function(n) {
  31071. if(!n.metadata) return;
  31072. if ("string" == typeof n.metadata)
  31073. try {
  31074. n.metadata = JSON.parse(n.metadata)
  31075. } catch (e) {
  31076. s.warn("Unable to parse image metadata"),
  31077. n.metadata = null
  31078. }
  31079. else{
  31080. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  31081. }
  31082. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  31083. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  31084. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  31085. }else{
  31086. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  31087. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  31088. n.metadata.zoom = n.metadata.zoom || 1;
  31089. }
  31090. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  31091. }),
  31092. //icon初始视角的:
  31093. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  31094. var n = {};
  31095. n.pano = {
  31096. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  31097. position: t.convertWorkshopVector(i.scan_position),
  31098. uuid: i.scan_id
  31099. },
  31100. n.camera = {
  31101. quaternion: i.camera_quaternion,
  31102. position: i.camera_position
  31103. },
  31104. e.startPano = n
  31105. }
  31106. return e
  31107. },
  31108. */
  31109. normalizeModeldata: function (e, t) {
  31110. //xzw 修改导览images数据
  31111. e = JSON.parse(JSON.stringify(e))
  31112. var i = null
  31113. var deal = function (n) {
  31114. if (!n.metadata) return
  31115. if ('string' == typeof n.metadata)
  31116. try {
  31117. n.metadata = JSON.parse(n.metadata)
  31118. } catch (e) {
  31119. s.warn('Unable to parse image metadata'), (n.metadata = null)
  31120. }
  31121. else {
  31122. 'object' == typeof n.metadata && s.debug('image.metadata already a JSON object')
  31123. }
  31124. if (n.metadata.camera_position instanceof Array) {
  31125. //xzw 改的格式
  31126. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position)
  31127. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion)
  31128. } else {
  31129. n.metadata.camera_position = new ss.Vector3().copy(n.metadata.camera_position)
  31130. n.metadata.camera_quaternion = new ss.Quaternion().copy(n.metadata.camera_quaternion)
  31131. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  31132. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  31133. }
  31134. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  31135. }
  31136. //改
  31137. e.images.forEach(info => {
  31138. if (info.locations) {
  31139. info.locations.forEach(a => deal(a))
  31140. } else {
  31141. deal(info)
  31142. }
  31143. })
  31144. //icon初始视角的:
  31145. if (i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  31146. var n = {}
  31147. ;(n.pano = {
  31148. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  31149. position: t.convertWorkshopVector(i.scan_position),
  31150. uuid: i.scan_id
  31151. }),
  31152. (n.camera = {
  31153. quaternion: i.camera_quaternion,
  31154. position: i.camera_position
  31155. }),
  31156. (e.startPano = n)
  31157. }
  31158. return e
  31159. },
  31160. visionVersionToInt: (function () {
  31161. var e = new RegExp(['(?:[0-9.]+\\.){1,4}', '([0-9]+)', '[^\\.]*$'].join(''))
  31162. return function (t) {
  31163. if (!t) throw new Error('Vision version is required')
  31164. var i = e.exec(t)
  31165. if (null === i) throw new Error('String is not a vision version: ' + t)
  31166. return parseInt(i[1])
  31167. }
  31168. })(),
  31169. modelDataPromisesTiles: function (e) {
  31170. var vision_version = e.vision_version || window.DATA.vision_version
  31171. if (vision_version)
  31172. try {
  31173. return l.visionVersionToInt(vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  31174. } catch (t) {
  31175. s.warn('Invalid vision version: ' + vision_version)
  31176. }
  31177. // var t = e.created ? new Date(e.created) : null;
  31178. // return t && t >= r.visionTilingStartDate
  31179. return false
  31180. }
  31181. }
  31182. t.exports = l
  31183. }).call(this, '/js/util/showcase.js')
  31184. },
  31185. {
  31186. '../constants': 8,
  31187. './browser': 182,
  31188. './logger': 189,
  31189. three: 217,
  31190. url: 208
  31191. }
  31192. ],
  31193. 194: [
  31194. function (e, t, i) {
  31195. 'use strict'
  31196. var n = e('../util/ajax'),
  31197. r = e('three'),
  31198. o = e('../settings'),
  31199. a = {}
  31200. t.exports = {
  31201. load: function (e, t, i) {
  31202. var s = a[e]
  31203. return s
  31204. ? (t &&
  31205. setTimeout(function () {
  31206. t(s)
  31207. }, 1),
  31208. s)
  31209. : ((s = new r.Texture()),
  31210. o.minimalMemoryMode && ((s.minFilter = r.LinearFilter), (s.magFilter = r.LinearFilter), (s.generateMipmaps = !1)),
  31211. (s.sourceFile = e),
  31212. (a[e] = s),
  31213. n
  31214. .getImage(e)
  31215. .then(function (e) {
  31216. ;(s.image = e), (s.needsUpdate = !0), t && t(s)
  31217. })
  31218. .fail(i),
  31219. s)
  31220. },
  31221. loadBase64: function (e, t) {
  31222. t = t || 'png'
  31223. var i = new r.Texture()
  31224. return (
  31225. (i.image = document.createElement('img')),
  31226. i.image.setAttribute('src', 'data:image/' + t + ';base64,' + e),
  31227. o.minimalMemoryMode && ((i.minFilter = r.LinearFilter), (i.magFilter = r.LinearFilter), (i.generateMipmaps = !1)),
  31228. (i.needsUpdate = !0),
  31229. i
  31230. )
  31231. },
  31232. isLoaded: function (e) {
  31233. return !!a[e]
  31234. }
  31235. }
  31236. window.Texture = t.exports
  31237. },
  31238. {
  31239. '../settings': 166,
  31240. '../util/ajax': 181,
  31241. three: 217
  31242. }
  31243. ],
  31244. 195: [
  31245. function (e, t, i) {
  31246. 'use strict'
  31247. var n = e('./easing')
  31248. window.transitions = t.exports = {
  31249. globalDone: null,
  31250. funcs: [],
  31251. counter: 0,
  31252. uniqueID: 0,
  31253. start: function (e, t, i, r, o, a, s) {
  31254. return (
  31255. (r = r || 0),
  31256. this.funcs.push({
  31257. func: e,
  31258. current: -r * Math.abs(t),
  31259. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  31260. done: i,
  31261. easing: o || n.linearTween,
  31262. cycling: t < 0,
  31263. running: !0,
  31264. debug: r < 0,
  31265. name: a || 'T' + this.counter,
  31266. id: void 0 === s ? this.counter : s,
  31267. paused: !1
  31268. }),
  31269. e(0, 16),
  31270. (this.counter += 1),
  31271. e
  31272. )
  31273. },
  31274. trigger: function (e) {
  31275. var t = void 0 === e.delayRatio ? 0 : e.delayRatio,
  31276. i = e.func || function () {},
  31277. r = void 0 === e.duration ? 0 : e.duration
  31278. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r))
  31279. var o = e.done || null,
  31280. a = e.easing || n.linearTween,
  31281. s = e.name || 'R' + this.counter,
  31282. l = void 0 === e.id ? this.counter : e.id
  31283. return this.start(i, r, o, t, a, s, l)
  31284. },
  31285. setTimeout: function (e, t, i) {
  31286. var n = void 0 === i ? this.counter : i
  31287. return this.trigger({
  31288. done: e,
  31289. duration: void 0 === t ? 0 : t,
  31290. name: 'O' + this.counter,
  31291. id: n
  31292. })
  31293. },
  31294. pause: function () {
  31295. this.paused = !0
  31296. },
  31297. resume: function () {
  31298. this.paused = !1
  31299. },
  31300. update: function (e) {
  31301. this.funcs.forEach(function (t) {
  31302. if (!(t.paused || ((t.current += 1e3 * e), t.current < 0)))
  31303. if (t.current >= t.duration && !t.cycling) {
  31304. var i = t.easing(1, 0, 1, 1)
  31305. t.func(i, 1e3 * e), t.done && t.done(), (t.running = !1)
  31306. } else {
  31307. var n = t.easing((t.current % t.duration) / t.duration, 0, 1, 1),
  31308. r = t.func(n, 1e3 * e) || !1
  31309. r && (t.done && t.done(), (t.running = !1))
  31310. }
  31311. })
  31312. var t = this.funcs.length
  31313. this.funcs = this.funcs.filter(function (e) {
  31314. return e.running
  31315. })
  31316. var i = this.funcs.length
  31317. if (t > 0 && 0 === i && this.globalDone) {
  31318. var n = this.globalDone
  31319. ;(this.globalDone = null), n()
  31320. }
  31321. },
  31322. adjustSpeed: function (e, t) {
  31323. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  31324. var r = i[n]
  31325. ;(r.duration /= t), (r.current /= t)
  31326. }
  31327. },
  31328. getById: function (e) {
  31329. return this.funcs.filter(function (t) {
  31330. return e === t.id
  31331. })
  31332. },
  31333. get: function (e) {
  31334. for (var t = 0; t < this.funcs.length; t += 1) if (this.funcs[t].func === e) return this.funcs[t]
  31335. return null
  31336. },
  31337. isRunning: function (e) {
  31338. var t = this.get(e)
  31339. return null !== t && t.running
  31340. },
  31341. countActive: function () {
  31342. for (var e = 0, t = 0; t < this.funcs.length; t += 1) e += this.funcs[t].running
  31343. return e
  31344. },
  31345. listActive: function () {
  31346. for (var e = [], t = 0; t < this.funcs.length; t += 1) this.funcs[t].running && e.push(this.funcs[t].name)
  31347. return e
  31348. },
  31349. done: function (e) {
  31350. this.globalDone = e
  31351. },
  31352. cancelById: function (e) {
  31353. var t = void 0 === e ? 0 : e
  31354. this.funcs = this.funcs.filter(function (e) {
  31355. return e.id !== t
  31356. })
  31357. },
  31358. cancel: function (e) {
  31359. this.funcs = this.funcs.filter(function (t) {
  31360. return t.func !== e
  31361. })
  31362. },
  31363. getUniqueId: function () {
  31364. return (this.uniqueID -= 1), this.uniqueID
  31365. }
  31366. }
  31367. },
  31368. {
  31369. './easing': 186
  31370. }
  31371. ],
  31372. 196: [
  31373. function (e, t, i) {
  31374. function n(e) {
  31375. if (
  31376. ((this.set = {}),
  31377. (this.infContains = function () {
  31378. return !0
  31379. }),
  31380. 'object' == typeof e)
  31381. )
  31382. if (e instanceof Array) for (var t = 0; t < e.length; t++) this.set[e[t]] = !0
  31383. else this.set = e
  31384. else if ('function' == typeof e) this.infContains = e
  31385. else if ('undefined' != typeof e) throw new Error('set must be either an array or an object.')
  31386. }
  31387. ;(t.exports = n),
  31388. (n.prototype.contains = function (e) {
  31389. return !!this.set[e]
  31390. }),
  31391. (n.prototype.has = n.prototype.contains),
  31392. (n.prototype.add = function (e) {
  31393. if (1 == arguments.length) this.set[e] = !0
  31394. else for (var t = 0; t < arguments.length; t++) this.set[arguments[t]] = !0
  31395. }),
  31396. (n.prototype.addAll = function (e) {
  31397. if ('object' != typeof e && !(e instanceof Array)) throw new Error('arr must be an array.')
  31398. for (var t = 0; t < e.length; t++) this.add(e[t])
  31399. }),
  31400. (n.prototype.remove = function (e) {
  31401. if (1 == arguments.length) delete this.set[e]
  31402. else for (var t = 0; t < arguments.length; t++) delete this.set[arguments[t]]
  31403. }),
  31404. (n.prototype.delete = n.prototype.remove),
  31405. (n.prototype.clear = function () {
  31406. this.set = {}
  31407. }),
  31408. (n.prototype.size = function () {
  31409. return Object.keys(this.set).length
  31410. }),
  31411. (n.prototype.toString = function () {
  31412. return '{' + Object.keys(this.set).toString() + '}'
  31413. }),
  31414. (n.prototype.toArray = function () {
  31415. return 'undefined' == typeof this.set ? [] : Object.keys(this.set)
  31416. }),
  31417. (n.prototype['*values'] = n.prototype.toArray)
  31418. },
  31419. {}
  31420. ],
  31421. 197: [function (e, t, i) {}, {}],
  31422. 198: [
  31423. function (e, t, i) {
  31424. ;(function (t) {
  31425. 'use strict'
  31426. function n() {
  31427. try {
  31428. var e = new Uint8Array(1)
  31429. return (
  31430. (e.__proto__ = {
  31431. __proto__: Uint8Array.prototype,
  31432. foo: function () {
  31433. return 42
  31434. }
  31435. }),
  31436. 42 === e.foo() && 'function' == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  31437. )
  31438. } catch (e) {
  31439. return !1
  31440. }
  31441. }
  31442. function r() {
  31443. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  31444. }
  31445. function o(e, t) {
  31446. if (r() < t) throw new RangeError('Invalid typed array length')
  31447. return a.TYPED_ARRAY_SUPPORT ? ((e = new Uint8Array(t)), (e.__proto__ = a.prototype)) : (null === e && (e = new a(t)), (e.length = t)), e
  31448. }
  31449. function a(e, t, i) {
  31450. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a)) return new a(e, t, i)
  31451. if ('number' == typeof e) {
  31452. if ('string' == typeof t) throw new Error('If encoding is specified then the first argument must be a string')
  31453. return h(this, e)
  31454. }
  31455. return s(this, e, t, i)
  31456. }
  31457. function s(e, t, i, n) {
  31458. if ('number' == typeof t) throw new TypeError('"value" argument must not be a number')
  31459. return 'undefined' != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : 'string' == typeof t ? u(e, t, i) : f(e, t)
  31460. }
  31461. function l(e) {
  31462. if ('number' != typeof e) throw new TypeError('"size" argument must be a number')
  31463. if (e < 0) throw new RangeError('"size" argument must not be negative')
  31464. }
  31465. function c(e, t, i, n) {
  31466. return l(t), t <= 0 ? o(e, t) : void 0 !== i ? ('string' == typeof n ? o(e, t).fill(i, n) : o(e, t).fill(i)) : o(e, t)
  31467. }
  31468. function h(e, t) {
  31469. if ((l(t), (e = o(e, t < 0 ? 0 : 0 | g(t))), !a.TYPED_ARRAY_SUPPORT)) for (var i = 0; i < t; ++i) e[i] = 0
  31470. return e
  31471. }
  31472. function u(e, t, i) {
  31473. if ((('string' == typeof i && '' !== i) || (i = 'utf8'), !a.isEncoding(i))) throw new TypeError('"encoding" must be a valid string encoding')
  31474. var n = 0 | v(t, i)
  31475. e = o(e, n)
  31476. var r = e.write(t, i)
  31477. return r !== n && (e = e.slice(0, r)), e
  31478. }
  31479. function d(e, t) {
  31480. var i = t.length < 0 ? 0 : 0 | g(t.length)
  31481. e = o(e, i)
  31482. for (var n = 0; n < i; n += 1) e[n] = 255 & t[n]
  31483. return e
  31484. }
  31485. function p(e, t, i, n) {
  31486. if ((t.byteLength, i < 0 || t.byteLength < i)) throw new RangeError("'offset' is out of bounds")
  31487. if (t.byteLength < i + (n || 0)) throw new RangeError("'length' is out of bounds")
  31488. return (
  31489. (t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t, i) : new Uint8Array(t, i, n)),
  31490. a.TYPED_ARRAY_SUPPORT ? ((e = t), (e.__proto__ = a.prototype)) : (e = d(e, t)),
  31491. e
  31492. )
  31493. }
  31494. function f(e, t) {
  31495. if (a.isBuffer(t)) {
  31496. var i = 0 | g(t.length)
  31497. return (e = o(e, i)), 0 === e.length ? e : (t.copy(e, 0, 0, i), e)
  31498. }
  31499. if (t) {
  31500. if (('undefined' != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer) || 'length' in t) return 'number' != typeof t.length || K(t.length) ? o(e, 0) : d(e, t)
  31501. if ('Buffer' === t.type && $(t.data)) return d(e, t.data)
  31502. }
  31503. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  31504. }
  31505. function g(e) {
  31506. if (e >= r()) throw new RangeError('Attempt to allocate Buffer larger than maximum size: 0x' + r().toString(16) + ' bytes')
  31507. return 0 | e
  31508. }
  31509. function m(e) {
  31510. return +e != e && (e = 0), a.alloc(+e)
  31511. }
  31512. function v(e, t) {
  31513. if (a.isBuffer(e)) return e.length
  31514. if ('undefined' != typeof ArrayBuffer && 'function' == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer)) return e.byteLength
  31515. 'string' != typeof e && (e = '' + e)
  31516. var i = e.length
  31517. if (0 === i) return 0
  31518. for (var n = !1; ; )
  31519. switch (t) {
  31520. case 'ascii':
  31521. case 'latin1':
  31522. case 'binary':
  31523. return i
  31524. case 'utf8':
  31525. case 'utf-8':
  31526. case void 0:
  31527. return j(e).length
  31528. case 'ucs2':
  31529. case 'ucs-2':
  31530. case 'utf16le':
  31531. case 'utf-16le':
  31532. return 2 * i
  31533. case 'hex':
  31534. return i >>> 1
  31535. case 'base64':
  31536. return Z(e).length
  31537. default:
  31538. if (n) return j(e).length
  31539. ;(t = ('' + t).toLowerCase()), (n = !0)
  31540. }
  31541. }
  31542. function A(e, t, i) {
  31543. var n = !1
  31544. if (((void 0 === t || t < 0) && (t = 0), t > this.length)) return ''
  31545. if (((void 0 === i || i > this.length) && (i = this.length), i <= 0)) return ''
  31546. if (((i >>>= 0), (t >>>= 0), i <= t)) return ''
  31547. for (e || (e = 'utf8'); ; )
  31548. switch (e) {
  31549. case 'hex':
  31550. return L(this, t, i)
  31551. case 'utf8':
  31552. case 'utf-8':
  31553. return M(this, t, i)
  31554. case 'ascii':
  31555. return P(this, t, i)
  31556. case 'latin1':
  31557. case 'binary':
  31558. return O(this, t, i)
  31559. case 'base64':
  31560. return S(this, t, i)
  31561. case 'ucs2':
  31562. case 'ucs-2':
  31563. case 'utf16le':
  31564. case 'utf-16le':
  31565. return D(this, t, i)
  31566. default:
  31567. if (n) throw new TypeError('Unknown encoding: ' + e)
  31568. ;(e = (e + '').toLowerCase()), (n = !0)
  31569. }
  31570. }
  31571. function y(e, t, i) {
  31572. var n = e[t]
  31573. ;(e[t] = e[i]), (e[i] = n)
  31574. }
  31575. function C(e, t, i, n, r) {
  31576. if (0 === e.length) return -1
  31577. if (
  31578. ('string' == typeof i ? ((n = i), (i = 0)) : i > 2147483647 ? (i = 2147483647) : i < -2147483648 && (i = -2147483648),
  31579. (i = +i),
  31580. isNaN(i) && (i = r ? 0 : e.length - 1),
  31581. i < 0 && (i = e.length + i),
  31582. i >= e.length)
  31583. ) {
  31584. if (r) return -1
  31585. i = e.length - 1
  31586. } else if (i < 0) {
  31587. if (!r) return -1
  31588. i = 0
  31589. }
  31590. if (('string' == typeof t && (t = a.from(t, n)), a.isBuffer(t))) return 0 === t.length ? -1 : I(e, t, i, n, r)
  31591. if ('number' == typeof t)
  31592. return (
  31593. (t &= 255),
  31594. a.TYPED_ARRAY_SUPPORT && 'function' == typeof Uint8Array.prototype.indexOf
  31595. ? r
  31596. ? Uint8Array.prototype.indexOf.call(e, t, i)
  31597. : Uint8Array.prototype.lastIndexOf.call(e, t, i)
  31598. : I(e, [t], i, n, r)
  31599. )
  31600. throw new TypeError('val must be string, number or Buffer')
  31601. }
  31602. function I(e, t, i, n, r) {
  31603. function o(e, t) {
  31604. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  31605. }
  31606. var a = 1,
  31607. s = e.length,
  31608. l = t.length
  31609. if (void 0 !== n && ((n = String(n).toLowerCase()), 'ucs2' === n || 'ucs-2' === n || 'utf16le' === n || 'utf-16le' === n)) {
  31610. if (e.length < 2 || t.length < 2) return -1
  31611. ;(a = 2), (s /= 2), (l /= 2), (i /= 2)
  31612. }
  31613. var c
  31614. if (r) {
  31615. var h = -1
  31616. for (c = i; c < s; c++)
  31617. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  31618. if ((h === -1 && (h = c), c - h + 1 === l)) return h * a
  31619. } else h !== -1 && (c -= c - h), (h = -1)
  31620. } else
  31621. for (i + l > s && (i = s - l), c = i; c >= 0; c--) {
  31622. for (var u = !0, d = 0; d < l; d++)
  31623. if (o(e, c + d) !== o(t, d)) {
  31624. u = !1
  31625. break
  31626. }
  31627. if (u) return c
  31628. }
  31629. return -1
  31630. }
  31631. function E(e, t, i, n) {
  31632. i = Number(i) || 0
  31633. var r = e.length - i
  31634. n ? ((n = Number(n)), n > r && (n = r)) : (n = r)
  31635. var o = t.length
  31636. if (o % 2 !== 0) throw new TypeError('Invalid hex string')
  31637. n > o / 2 && (n = o / 2)
  31638. for (var a = 0; a < n; ++a) {
  31639. var s = parseInt(t.substr(2 * a, 2), 16)
  31640. if (isNaN(s)) return a
  31641. e[i + a] = s
  31642. }
  31643. return a
  31644. }
  31645. function b(e, t, i, n) {
  31646. return q(j(t, e.length - i), e, i, n)
  31647. }
  31648. function w(e, t, i, n) {
  31649. return q(Y(t), e, i, n)
  31650. }
  31651. function _(e, t, i, n) {
  31652. return w(e, t, i, n)
  31653. }
  31654. function T(e, t, i, n) {
  31655. return q(Z(t), e, i, n)
  31656. }
  31657. function x(e, t, i, n) {
  31658. return q(X(t, e.length - i), e, i, n)
  31659. }
  31660. function S(e, t, i) {
  31661. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  31662. }
  31663. function M(e, t, i) {
  31664. i = Math.min(e.length, i)
  31665. for (var n = [], r = t; r < i; ) {
  31666. var o = e[r],
  31667. a = null,
  31668. s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1
  31669. if (r + s <= i) {
  31670. var l, c, h, u
  31671. switch (s) {
  31672. case 1:
  31673. o < 128 && (a = o)
  31674. break
  31675. case 2:
  31676. ;(l = e[r + 1]), 128 === (192 & l) && ((u = ((31 & o) << 6) | (63 & l)), u > 127 && (a = u))
  31677. break
  31678. case 3:
  31679. ;(l = e[r + 1]), (c = e[r + 2]), 128 === (192 & l) && 128 === (192 & c) && ((u = ((15 & o) << 12) | ((63 & l) << 6) | (63 & c)), u > 2047 && (u < 55296 || u > 57343) && (a = u))
  31680. break
  31681. case 4:
  31682. ;(l = e[r + 1]),
  31683. (c = e[r + 2]),
  31684. (h = e[r + 3]),
  31685. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && ((u = ((15 & o) << 18) | ((63 & l) << 12) | ((63 & c) << 6) | (63 & h)), u > 65535 && u < 1114112 && (a = u))
  31686. }
  31687. }
  31688. null === a ? ((a = 65533), (s = 1)) : a > 65535 && ((a -= 65536), n.push(((a >>> 10) & 1023) | 55296), (a = 56320 | (1023 & a))), n.push(a), (r += s)
  31689. }
  31690. return R(n)
  31691. }
  31692. function R(e) {
  31693. var t = e.length
  31694. if (t <= ee) return String.fromCharCode.apply(String, e)
  31695. for (var i = '', n = 0; n < t; ) i += String.fromCharCode.apply(String, e.slice(n, (n += ee)))
  31696. return i
  31697. }
  31698. function P(e, t, i) {
  31699. var n = ''
  31700. i = Math.min(e.length, i)
  31701. for (var r = t; r < i; ++r) n += String.fromCharCode(127 & e[r])
  31702. return n
  31703. }
  31704. function O(e, t, i) {
  31705. var n = ''
  31706. i = Math.min(e.length, i)
  31707. for (var r = t; r < i; ++r) n += String.fromCharCode(e[r])
  31708. return n
  31709. }
  31710. function L(e, t, i) {
  31711. var n = e.length
  31712. ;(!t || t < 0) && (t = 0), (!i || i < 0 || i > n) && (i = n)
  31713. for (var r = '', o = t; o < i; ++o) r += W(e[o])
  31714. return r
  31715. }
  31716. function D(e, t, i) {
  31717. for (var n = e.slice(t, i), r = '', o = 0; o < n.length; o += 2) r += String.fromCharCode(n[o] + 256 * n[o + 1])
  31718. return r
  31719. }
  31720. function N(e, t, i) {
  31721. if (e % 1 !== 0 || e < 0) throw new RangeError('offset is not uint')
  31722. if (e + t > i) throw new RangeError('Trying to access beyond buffer length')
  31723. }
  31724. function B(e, t, i, n, r, o) {
  31725. if (!a.isBuffer(e)) throw new TypeError('"buffer" argument must be a Buffer instance')
  31726. if (t > r || t < o) throw new RangeError('"value" argument is out of bounds')
  31727. if (i + n > e.length) throw new RangeError('Index out of range')
  31728. }
  31729. function F(e, t, i, n) {
  31730. t < 0 && (t = 65535 + t + 1)
  31731. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r) e[i + r] = (t & (255 << (8 * (n ? r : 1 - r)))) >>> (8 * (n ? r : 1 - r))
  31732. }
  31733. function V(e, t, i, n) {
  31734. t < 0 && (t = 4294967295 + t + 1)
  31735. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r) e[i + r] = (t >>> (8 * (n ? r : 3 - r))) & 255
  31736. }
  31737. function U(e, t, i, n, r, o) {
  31738. if (i + n > e.length) throw new RangeError('Index out of range')
  31739. if (i < 0) throw new RangeError('Index out of range')
  31740. }
  31741. function k(e, t, i, n, r) {
  31742. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38), J.write(e, t, i, n, 23, 4), i + 4
  31743. }
  31744. function H(e, t, i, n, r) {
  31745. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308), J.write(e, t, i, n, 52, 8), i + 8
  31746. }
  31747. function G(e) {
  31748. if (((e = z(e).replace(te, '')), e.length < 2)) return ''
  31749. for (; e.length % 4 !== 0; ) e += '='
  31750. return e
  31751. }
  31752. function z(e) {
  31753. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, '')
  31754. }
  31755. function W(e) {
  31756. return e < 16 ? '0' + e.toString(16) : e.toString(16)
  31757. }
  31758. function j(e, t) {
  31759. t = t || 1 / 0
  31760. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  31761. if (((i = e.charCodeAt(a)), i > 55295 && i < 57344)) {
  31762. if (!r) {
  31763. if (i > 56319) {
  31764. ;(t -= 3) > -1 && o.push(239, 191, 189)
  31765. continue
  31766. }
  31767. if (a + 1 === n) {
  31768. ;(t -= 3) > -1 && o.push(239, 191, 189)
  31769. continue
  31770. }
  31771. r = i
  31772. continue
  31773. }
  31774. if (i < 56320) {
  31775. ;(t -= 3) > -1 && o.push(239, 191, 189), (r = i)
  31776. continue
  31777. }
  31778. i = (((r - 55296) << 10) | (i - 56320)) + 65536
  31779. } else r && (t -= 3) > -1 && o.push(239, 191, 189)
  31780. if (((r = null), i < 128)) {
  31781. if ((t -= 1) < 0) break
  31782. o.push(i)
  31783. } else if (i < 2048) {
  31784. if ((t -= 2) < 0) break
  31785. o.push((i >> 6) | 192, (63 & i) | 128)
  31786. } else if (i < 65536) {
  31787. if ((t -= 3) < 0) break
  31788. o.push((i >> 12) | 224, ((i >> 6) & 63) | 128, (63 & i) | 128)
  31789. } else {
  31790. if (!(i < 1114112)) throw new Error('Invalid code point')
  31791. if ((t -= 4) < 0) break
  31792. o.push((i >> 18) | 240, ((i >> 12) & 63) | 128, ((i >> 6) & 63) | 128, (63 & i) | 128)
  31793. }
  31794. }
  31795. return o
  31796. }
  31797. function Y(e) {
  31798. for (var t = [], i = 0; i < e.length; ++i) t.push(255 & e.charCodeAt(i))
  31799. return t
  31800. }
  31801. function X(e, t) {
  31802. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a) (i = e.charCodeAt(a)), (n = i >> 8), (r = i % 256), o.push(r), o.push(n)
  31803. return o
  31804. }
  31805. function Z(e) {
  31806. return Q.toByteArray(G(e))
  31807. }
  31808. function q(e, t, i, n) {
  31809. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r) t[r + i] = e[r]
  31810. return r
  31811. }
  31812. function K(e) {
  31813. return e !== e
  31814. }
  31815. var Q = e('base64-js'),
  31816. J = e('ieee754'),
  31817. $ = e('isarray')
  31818. ;(i.Buffer = a),
  31819. (i.SlowBuffer = m),
  31820. (i.INSPECT_MAX_BYTES = 50),
  31821. (a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n()),
  31822. (i.kMaxLength = r()),
  31823. (a.poolSize = 8192),
  31824. (a._augment = function (e) {
  31825. return (e.__proto__ = a.prototype), e
  31826. }),
  31827. (a.from = function (e, t, i) {
  31828. return s(null, e, t, i)
  31829. }),
  31830. a.TYPED_ARRAY_SUPPORT &&
  31831. ((a.prototype.__proto__ = Uint8Array.prototype),
  31832. (a.__proto__ = Uint8Array),
  31833. 'undefined' != typeof Symbol &&
  31834. Symbol.species &&
  31835. a[Symbol.species] === a &&
  31836. Object.defineProperty(a, Symbol.species, {
  31837. value: null,
  31838. configurable: !0
  31839. })),
  31840. (a.alloc = function (e, t, i) {
  31841. return c(null, e, t, i)
  31842. }),
  31843. (a.allocUnsafe = function (e) {
  31844. return h(null, e)
  31845. }),
  31846. (a.allocUnsafeSlow = function (e) {
  31847. return h(null, e)
  31848. }),
  31849. (a.isBuffer = function (e) {
  31850. return !(null == e || !e._isBuffer)
  31851. }),
  31852. (a.compare = function (e, t) {
  31853. if (!a.isBuffer(e) || !a.isBuffer(t)) throw new TypeError('Arguments must be Buffers')
  31854. if (e === t) return 0
  31855. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  31856. if (e[r] !== t[r]) {
  31857. ;(i = e[r]), (n = t[r])
  31858. break
  31859. }
  31860. return i < n ? -1 : n < i ? 1 : 0
  31861. }),
  31862. (a.isEncoding = function (e) {
  31863. switch (String(e).toLowerCase()) {
  31864. case 'hex':
  31865. case 'utf8':
  31866. case 'utf-8':
  31867. case 'ascii':
  31868. case 'latin1':
  31869. case 'binary':
  31870. case 'base64':
  31871. case 'ucs2':
  31872. case 'ucs-2':
  31873. case 'utf16le':
  31874. case 'utf-16le':
  31875. return !0
  31876. default:
  31877. return !1
  31878. }
  31879. }),
  31880. (a.concat = function (e, t) {
  31881. if (!$(e)) throw new TypeError('"list" argument must be an Array of Buffers')
  31882. if (0 === e.length) return a.alloc(0)
  31883. var i
  31884. if (void 0 === t) for (t = 0, i = 0; i < e.length; ++i) t += e[i].length
  31885. var n = a.allocUnsafe(t),
  31886. r = 0
  31887. for (i = 0; i < e.length; ++i) {
  31888. var o = e[i]
  31889. if (!a.isBuffer(o)) throw new TypeError('"list" argument must be an Array of Buffers')
  31890. o.copy(n, r), (r += o.length)
  31891. }
  31892. return n
  31893. }),
  31894. (a.byteLength = v),
  31895. (a.prototype._isBuffer = !0),
  31896. (a.prototype.swap16 = function () {
  31897. var e = this.length
  31898. if (e % 2 !== 0) throw new RangeError('Buffer size must be a multiple of 16-bits')
  31899. for (var t = 0; t < e; t += 2) y(this, t, t + 1)
  31900. return this
  31901. }),
  31902. (a.prototype.swap32 = function () {
  31903. var e = this.length
  31904. if (e % 4 !== 0) throw new RangeError('Buffer size must be a multiple of 32-bits')
  31905. for (var t = 0; t < e; t += 4) y(this, t, t + 3), y(this, t + 1, t + 2)
  31906. return this
  31907. }),
  31908. (a.prototype.swap64 = function () {
  31909. var e = this.length
  31910. if (e % 8 !== 0) throw new RangeError('Buffer size must be a multiple of 64-bits')
  31911. for (var t = 0; t < e; t += 8) y(this, t, t + 7), y(this, t + 1, t + 6), y(this, t + 2, t + 5), y(this, t + 3, t + 4)
  31912. return this
  31913. }),
  31914. (a.prototype.toString = function () {
  31915. var e = 0 | this.length
  31916. return 0 === e ? '' : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  31917. }),
  31918. (a.prototype.equals = function (e) {
  31919. if (!a.isBuffer(e)) throw new TypeError('Argument must be a Buffer')
  31920. return this === e || 0 === a.compare(this, e)
  31921. }),
  31922. (a.prototype.inspect = function () {
  31923. var e = '',
  31924. t = i.INSPECT_MAX_BYTES
  31925. return this.length > 0 && ((e = this.toString('hex', 0, t).match(/.{2}/g).join(' ')), this.length > t && (e += ' ... ')), '<Buffer ' + e + '>'
  31926. }),
  31927. (a.prototype.compare = function (e, t, i, n, r) {
  31928. if (!a.isBuffer(e)) throw new TypeError('Argument must be a Buffer')
  31929. if ((void 0 === t && (t = 0), void 0 === i && (i = e ? e.length : 0), void 0 === n && (n = 0), void 0 === r && (r = this.length), t < 0 || i > e.length || n < 0 || r > this.length))
  31930. throw new RangeError('out of range index')
  31931. if (n >= r && t >= i) return 0
  31932. if (n >= r) return -1
  31933. if (t >= i) return 1
  31934. if (((t >>>= 0), (i >>>= 0), (n >>>= 0), (r >>>= 0), this === e)) return 0
  31935. for (var o = r - n, s = i - t, l = Math.min(o, s), c = this.slice(n, r), h = e.slice(t, i), u = 0; u < l; ++u)
  31936. if (c[u] !== h[u]) {
  31937. ;(o = c[u]), (s = h[u])
  31938. break
  31939. }
  31940. return o < s ? -1 : s < o ? 1 : 0
  31941. }),
  31942. (a.prototype.includes = function (e, t, i) {
  31943. return this.indexOf(e, t, i) !== -1
  31944. }),
  31945. (a.prototype.indexOf = function (e, t, i) {
  31946. return C(this, e, t, i, !0)
  31947. }),
  31948. (a.prototype.lastIndexOf = function (e, t, i) {
  31949. return C(this, e, t, i, !1)
  31950. }),
  31951. (a.prototype.write = function (e, t, i, n) {
  31952. if (void 0 === t) (n = 'utf8'), (i = this.length), (t = 0)
  31953. else if (void 0 === i && 'string' == typeof t) (n = t), (i = this.length), (t = 0)
  31954. else {
  31955. if (!isFinite(t)) throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported')
  31956. ;(t |= 0), isFinite(i) ? ((i |= 0), void 0 === n && (n = 'utf8')) : ((n = i), (i = void 0))
  31957. }
  31958. var r = this.length - t
  31959. if (((void 0 === i || i > r) && (i = r), (e.length > 0 && (i < 0 || t < 0)) || t > this.length)) throw new RangeError('Attempt to write outside buffer bounds')
  31960. n || (n = 'utf8')
  31961. for (var o = !1; ; )
  31962. switch (n) {
  31963. case 'hex':
  31964. return E(this, e, t, i)
  31965. case 'utf8':
  31966. case 'utf-8':
  31967. return b(this, e, t, i)
  31968. case 'ascii':
  31969. return w(this, e, t, i)
  31970. case 'latin1':
  31971. case 'binary':
  31972. return _(this, e, t, i)
  31973. case 'base64':
  31974. return T(this, e, t, i)
  31975. case 'ucs2':
  31976. case 'ucs-2':
  31977. case 'utf16le':
  31978. case 'utf-16le':
  31979. return x(this, e, t, i)
  31980. default:
  31981. if (o) throw new TypeError('Unknown encoding: ' + n)
  31982. ;(n = ('' + n).toLowerCase()), (o = !0)
  31983. }
  31984. }),
  31985. (a.prototype.toJSON = function () {
  31986. return {
  31987. type: 'Buffer',
  31988. data: Array.prototype.slice.call(this._arr || this, 0)
  31989. }
  31990. })
  31991. var ee = 4096
  31992. ;(a.prototype.slice = function (e, t) {
  31993. var i = this.length
  31994. ;(e = ~~e), (t = void 0 === t ? i : ~~t), e < 0 ? ((e += i), e < 0 && (e = 0)) : e > i && (e = i), t < 0 ? ((t += i), t < 0 && (t = 0)) : t > i && (t = i), t < e && (t = e)
  31995. var n
  31996. if (a.TYPED_ARRAY_SUPPORT) (n = this.subarray(e, t)), (n.__proto__ = a.prototype)
  31997. else {
  31998. var r = t - e
  31999. n = new a(r, void 0)
  32000. for (var o = 0; o < r; ++o) n[o] = this[o + e]
  32001. }
  32002. return n
  32003. }),
  32004. (a.prototype.readUIntLE = function (e, t, i) {
  32005. ;(e |= 0), (t |= 0), i || N(e, t, this.length)
  32006. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); ) n += this[e + o] * r
  32007. return n
  32008. }),
  32009. (a.prototype.readUIntBE = function (e, t, i) {
  32010. ;(e |= 0), (t |= 0), i || N(e, t, this.length)
  32011. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); ) n += this[e + --t] * r
  32012. return n
  32013. }),
  32014. (a.prototype.readUInt8 = function (e, t) {
  32015. return t || N(e, 1, this.length), this[e]
  32016. }),
  32017. (a.prototype.readUInt16LE = function (e, t) {
  32018. return t || N(e, 2, this.length), this[e] | (this[e + 1] << 8)
  32019. }),
  32020. (a.prototype.readUInt16BE = function (e, t) {
  32021. return t || N(e, 2, this.length), (this[e] << 8) | this[e + 1]
  32022. }),
  32023. (a.prototype.readUInt32LE = function (e, t) {
  32024. return t || N(e, 4, this.length), (this[e] | (this[e + 1] << 8) | (this[e + 2] << 16)) + 16777216 * this[e + 3]
  32025. }),
  32026. (a.prototype.readUInt32BE = function (e, t) {
  32027. return t || N(e, 4, this.length), 16777216 * this[e] + ((this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3])
  32028. }),
  32029. (a.prototype.readIntLE = function (e, t, i) {
  32030. ;(e |= 0), (t |= 0), i || N(e, t, this.length)
  32031. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); ) n += this[e + o] * r
  32032. return (r *= 128), n >= r && (n -= Math.pow(2, 8 * t)), n
  32033. }),
  32034. (a.prototype.readIntBE = function (e, t, i) {
  32035. ;(e |= 0), (t |= 0), i || N(e, t, this.length)
  32036. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); ) o += this[e + --n] * r
  32037. return (r *= 128), o >= r && (o -= Math.pow(2, 8 * t)), o
  32038. }),
  32039. (a.prototype.readInt8 = function (e, t) {
  32040. return t || N(e, 1, this.length), 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  32041. }),
  32042. (a.prototype.readInt16LE = function (e, t) {
  32043. t || N(e, 2, this.length)
  32044. var i = this[e] | (this[e + 1] << 8)
  32045. return 32768 & i ? 4294901760 | i : i
  32046. }),
  32047. (a.prototype.readInt16BE = function (e, t) {
  32048. t || N(e, 2, this.length)
  32049. var i = this[e + 1] | (this[e] << 8)
  32050. return 32768 & i ? 4294901760 | i : i
  32051. }),
  32052. (a.prototype.readInt32LE = function (e, t) {
  32053. return t || N(e, 4, this.length), this[e] | (this[e + 1] << 8) | (this[e + 2] << 16) | (this[e + 3] << 24)
  32054. }),
  32055. (a.prototype.readInt32BE = function (e, t) {
  32056. return t || N(e, 4, this.length), (this[e] << 24) | (this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3]
  32057. }),
  32058. (a.prototype.readFloatLE = function (e, t) {
  32059. return t || N(e, 4, this.length), J.read(this, e, !0, 23, 4)
  32060. }),
  32061. (a.prototype.readFloatBE = function (e, t) {
  32062. return t || N(e, 4, this.length), J.read(this, e, !1, 23, 4)
  32063. }),
  32064. (a.prototype.readDoubleLE = function (e, t) {
  32065. return t || N(e, 8, this.length), J.read(this, e, !0, 52, 8)
  32066. }),
  32067. (a.prototype.readDoubleBE = function (e, t) {
  32068. return t || N(e, 8, this.length), J.read(this, e, !1, 52, 8)
  32069. }),
  32070. (a.prototype.writeUIntLE = function (e, t, i, n) {
  32071. if (((e = +e), (t |= 0), (i |= 0), !n)) {
  32072. var r = Math.pow(2, 8 * i) - 1
  32073. B(this, e, t, i, r, 0)
  32074. }
  32075. var o = 1,
  32076. a = 0
  32077. for (this[t] = 255 & e; ++a < i && (o *= 256); ) this[t + a] = (e / o) & 255
  32078. return t + i
  32079. }),
  32080. (a.prototype.writeUIntBE = function (e, t, i, n) {
  32081. if (((e = +e), (t |= 0), (i |= 0), !n)) {
  32082. var r = Math.pow(2, 8 * i) - 1
  32083. B(this, e, t, i, r, 0)
  32084. }
  32085. var o = i - 1,
  32086. a = 1
  32087. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); ) this[t + o] = (e / a) & 255
  32088. return t + i
  32089. }),
  32090. (a.prototype.writeUInt8 = function (e, t, i) {
  32091. return (e = +e), (t |= 0), i || B(this, e, t, 1, 255, 0), a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), (this[t] = 255 & e), t + 1
  32092. }),
  32093. (a.prototype.writeUInt16LE = function (e, t, i) {
  32094. return (e = +e), (t |= 0), i || B(this, e, t, 2, 65535, 0), a.TYPED_ARRAY_SUPPORT ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8)) : F(this, e, t, !0), t + 2
  32095. }),
  32096. (a.prototype.writeUInt16BE = function (e, t, i) {
  32097. return (e = +e), (t |= 0), i || B(this, e, t, 2, 65535, 0), a.TYPED_ARRAY_SUPPORT ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e)) : F(this, e, t, !1), t + 2
  32098. }),
  32099. (a.prototype.writeUInt32LE = function (e, t, i) {
  32100. return (
  32101. (e = +e),
  32102. (t |= 0),
  32103. i || B(this, e, t, 4, 4294967295, 0),
  32104. a.TYPED_ARRAY_SUPPORT ? ((this[t + 3] = e >>> 24), (this[t + 2] = e >>> 16), (this[t + 1] = e >>> 8), (this[t] = 255 & e)) : V(this, e, t, !0),
  32105. t + 4
  32106. )
  32107. }),
  32108. (a.prototype.writeUInt32BE = function (e, t, i) {
  32109. return (
  32110. (e = +e),
  32111. (t |= 0),
  32112. i || B(this, e, t, 4, 4294967295, 0),
  32113. a.TYPED_ARRAY_SUPPORT ? ((this[t] = e >>> 24), (this[t + 1] = e >>> 16), (this[t + 2] = e >>> 8), (this[t + 3] = 255 & e)) : V(this, e, t, !1),
  32114. t + 4
  32115. )
  32116. }),
  32117. (a.prototype.writeIntLE = function (e, t, i, n) {
  32118. if (((e = +e), (t |= 0), !n)) {
  32119. var r = Math.pow(2, 8 * i - 1)
  32120. B(this, e, t, i, r - 1, -r)
  32121. }
  32122. var o = 0,
  32123. a = 1,
  32124. s = 0
  32125. for (this[t] = 255 & e; ++o < i && (a *= 256); ) e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1), (this[t + o] = (((e / a) >> 0) - s) & 255)
  32126. return t + i
  32127. }),
  32128. (a.prototype.writeIntBE = function (e, t, i, n) {
  32129. if (((e = +e), (t |= 0), !n)) {
  32130. var r = Math.pow(2, 8 * i - 1)
  32131. B(this, e, t, i, r - 1, -r)
  32132. }
  32133. var o = i - 1,
  32134. a = 1,
  32135. s = 0
  32136. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); ) e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1), (this[t + o] = (((e / a) >> 0) - s) & 255)
  32137. return t + i
  32138. }),
  32139. (a.prototype.writeInt8 = function (e, t, i) {
  32140. return (e = +e), (t |= 0), i || B(this, e, t, 1, 127, -128), a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), e < 0 && (e = 255 + e + 1), (this[t] = 255 & e), t + 1
  32141. }),
  32142. (a.prototype.writeInt16LE = function (e, t, i) {
  32143. return (e = +e), (t |= 0), i || B(this, e, t, 2, 32767, -32768), a.TYPED_ARRAY_SUPPORT ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8)) : F(this, e, t, !0), t + 2
  32144. }),
  32145. (a.prototype.writeInt16BE = function (e, t, i) {
  32146. return (e = +e), (t |= 0), i || B(this, e, t, 2, 32767, -32768), a.TYPED_ARRAY_SUPPORT ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e)) : F(this, e, t, !1), t + 2
  32147. }),
  32148. (a.prototype.writeInt32LE = function (e, t, i) {
  32149. return (
  32150. (e = +e),
  32151. (t |= 0),
  32152. i || B(this, e, t, 4, 2147483647, -2147483648),
  32153. a.TYPED_ARRAY_SUPPORT ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8), (this[t + 2] = e >>> 16), (this[t + 3] = e >>> 24)) : V(this, e, t, !0),
  32154. t + 4
  32155. )
  32156. }),
  32157. (a.prototype.writeInt32BE = function (e, t, i) {
  32158. return (
  32159. (e = +e),
  32160. (t |= 0),
  32161. i || B(this, e, t, 4, 2147483647, -2147483648),
  32162. e < 0 && (e = 4294967295 + e + 1),
  32163. a.TYPED_ARRAY_SUPPORT ? ((this[t] = e >>> 24), (this[t + 1] = e >>> 16), (this[t + 2] = e >>> 8), (this[t + 3] = 255 & e)) : V(this, e, t, !1),
  32164. t + 4
  32165. )
  32166. }),
  32167. (a.prototype.writeFloatLE = function (e, t, i) {
  32168. return k(this, e, t, !0, i)
  32169. }),
  32170. (a.prototype.writeFloatBE = function (e, t, i) {
  32171. return k(this, e, t, !1, i)
  32172. }),
  32173. (a.prototype.writeDoubleLE = function (e, t, i) {
  32174. return H(this, e, t, !0, i)
  32175. }),
  32176. (a.prototype.writeDoubleBE = function (e, t, i) {
  32177. return H(this, e, t, !1, i)
  32178. }),
  32179. (a.prototype.copy = function (e, t, i, n) {
  32180. if ((i || (i = 0), n || 0 === n || (n = this.length), t >= e.length && (t = e.length), t || (t = 0), n > 0 && n < i && (n = i), n === i)) return 0
  32181. if (0 === e.length || 0 === this.length) return 0
  32182. if (t < 0) throw new RangeError('targetStart out of bounds')
  32183. if (i < 0 || i >= this.length) throw new RangeError('sourceStart out of bounds')
  32184. if (n < 0) throw new RangeError('sourceEnd out of bounds')
  32185. n > this.length && (n = this.length), e.length - t < n - i && (n = e.length - t + i)
  32186. var r,
  32187. o = n - i
  32188. if (this === e && i < t && t < n) for (r = o - 1; r >= 0; --r) e[r + t] = this[r + i]
  32189. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT) for (r = 0; r < o; ++r) e[r + t] = this[r + i]
  32190. else Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t)
  32191. return o
  32192. }),
  32193. (a.prototype.fill = function (e, t, i, n) {
  32194. if ('string' == typeof e) {
  32195. if (('string' == typeof t ? ((n = t), (t = 0), (i = this.length)) : 'string' == typeof i && ((n = i), (i = this.length)), 1 === e.length)) {
  32196. var r = e.charCodeAt(0)
  32197. r < 256 && (e = r)
  32198. }
  32199. if (void 0 !== n && 'string' != typeof n) throw new TypeError('encoding must be a string')
  32200. if ('string' == typeof n && !a.isEncoding(n)) throw new TypeError('Unknown encoding: ' + n)
  32201. } else 'number' == typeof e && (e &= 255)
  32202. if (t < 0 || this.length < t || this.length < i) throw new RangeError('Out of range index')
  32203. if (i <= t) return this
  32204. ;(t >>>= 0), (i = void 0 === i ? this.length : i >>> 0), e || (e = 0)
  32205. var o
  32206. if ('number' == typeof e) for (o = t; o < i; ++o) this[o] = e
  32207. else {
  32208. var s = a.isBuffer(e) ? e : j(new a(e, n).toString()),
  32209. l = s.length
  32210. for (o = 0; o < i - t; ++o) this[o + t] = s[o % l]
  32211. }
  32212. return this
  32213. })
  32214. var te = /[^+\/0-9A-Za-z-_]/g
  32215. }).call(this, 'undefined' != typeof global ? global : 'undefined' != typeof self ? self : 'undefined' != typeof window ? window : {})
  32216. },
  32217. {
  32218. 'base64-js': 199,
  32219. ieee754: 200,
  32220. isarray: 201
  32221. }
  32222. ],
  32223. 199: [
  32224. function (e, t, i) {
  32225. 'use strict'
  32226. function n(e) {
  32227. var t = e.length
  32228. if (t % 4 > 0) throw new Error('Invalid string. Length must be a multiple of 4')
  32229. return '=' === e[t - 2] ? 2 : '=' === e[t - 1] ? 1 : 0
  32230. }
  32231. function r(e) {
  32232. return (3 * e.length) / 4 - n(e)
  32233. }
  32234. function o(e) {
  32235. var t,
  32236. i,
  32237. r,
  32238. o,
  32239. a,
  32240. s,
  32241. l = e.length
  32242. ;(a = n(e)), (s = new u((3 * l) / 4 - a)), (r = a > 0 ? l - 4 : l)
  32243. var c = 0
  32244. for (t = 0, i = 0; t < r; t += 4, i += 3)
  32245. (o = (h[e.charCodeAt(t)] << 18) | (h[e.charCodeAt(t + 1)] << 12) | (h[e.charCodeAt(t + 2)] << 6) | h[e.charCodeAt(t + 3)]),
  32246. (s[c++] = (o >> 16) & 255),
  32247. (s[c++] = (o >> 8) & 255),
  32248. (s[c++] = 255 & o)
  32249. return (
  32250. 2 === a
  32251. ? ((o = (h[e.charCodeAt(t)] << 2) | (h[e.charCodeAt(t + 1)] >> 4)), (s[c++] = 255 & o))
  32252. : 1 === a && ((o = (h[e.charCodeAt(t)] << 10) | (h[e.charCodeAt(t + 1)] << 4) | (h[e.charCodeAt(t + 2)] >> 2)), (s[c++] = (o >> 8) & 255), (s[c++] = 255 & o)),
  32253. s
  32254. )
  32255. }
  32256. function a(e) {
  32257. return c[(e >> 18) & 63] + c[(e >> 12) & 63] + c[(e >> 6) & 63] + c[63 & e]
  32258. }
  32259. function s(e, t, i) {
  32260. for (var n, r = [], o = t; o < i; o += 3) (n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2]), r.push(a(n))
  32261. return r.join('')
  32262. }
  32263. function l(e) {
  32264. for (var t, i = e.length, n = i % 3, r = '', o = [], a = 16383, l = 0, h = i - n; l < h; l += a) o.push(s(e, l, l + a > h ? h : l + a))
  32265. return (
  32266. 1 === n
  32267. ? ((t = e[i - 1]), (r += c[t >> 2]), (r += c[(t << 4) & 63]), (r += '=='))
  32268. : 2 === n && ((t = (e[i - 2] << 8) + e[i - 1]), (r += c[t >> 10]), (r += c[(t >> 4) & 63]), (r += c[(t << 2) & 63]), (r += '=')),
  32269. o.push(r),
  32270. o.join('')
  32271. )
  32272. }
  32273. ;(i.byteLength = r), (i.toByteArray = o), (i.fromByteArray = l)
  32274. for (var c = [], h = [], u = 'undefined' != typeof Uint8Array ? Uint8Array : Array, d = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', p = 0, f = d.length; p < f; ++p)
  32275. (c[p] = d[p]), (h[d.charCodeAt(p)] = p)
  32276. ;(h['-'.charCodeAt(0)] = 62), (h['_'.charCodeAt(0)] = 63)
  32277. },
  32278. {}
  32279. ],
  32280. 200: [
  32281. function (e, t, i) {
  32282. ;(i.read = function (e, t, i, n, r) {
  32283. var o,
  32284. a,
  32285. s = 8 * r - n - 1,
  32286. l = (1 << s) - 1,
  32287. c = l >> 1,
  32288. h = -7,
  32289. u = i ? r - 1 : 0,
  32290. d = i ? -1 : 1,
  32291. p = e[t + u]
  32292. for (u += d, o = p & ((1 << -h) - 1), p >>= -h, h += s; h > 0; o = 256 * o + e[t + u], u += d, h -= 8);
  32293. for (a = o & ((1 << -h) - 1), o >>= -h, h += n; h > 0; a = 256 * a + e[t + u], u += d, h -= 8);
  32294. if (0 === o) o = 1 - c
  32295. else {
  32296. if (o === l) return a ? NaN : (p ? -1 : 1) * (1 / 0)
  32297. ;(a += Math.pow(2, n)), (o -= c)
  32298. }
  32299. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  32300. }),
  32301. (i.write = function (e, t, i, n, r, o) {
  32302. var a,
  32303. s,
  32304. l,
  32305. c = 8 * o - r - 1,
  32306. h = (1 << c) - 1,
  32307. u = h >> 1,
  32308. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  32309. p = n ? 0 : o - 1,
  32310. f = n ? 1 : -1,
  32311. g = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0
  32312. for (
  32313. t = Math.abs(t),
  32314. isNaN(t) || t === 1 / 0
  32315. ? ((s = isNaN(t) ? 1 : 0), (a = h))
  32316. : ((a = Math.floor(Math.log(t) / Math.LN2)),
  32317. t * (l = Math.pow(2, -a)) < 1 && (a--, (l *= 2)),
  32318. (t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u)),
  32319. t * l >= 2 && (a++, (l /= 2)),
  32320. a + u >= h ? ((s = 0), (a = h)) : a + u >= 1 ? ((s = (t * l - 1) * Math.pow(2, r)), (a += u)) : ((s = t * Math.pow(2, u - 1) * Math.pow(2, r)), (a = 0)));
  32321. r >= 8;
  32322. e[i + p] = 255 & s, p += f, s /= 256, r -= 8
  32323. );
  32324. for (a = (a << r) | s, c += r; c > 0; e[i + p] = 255 & a, p += f, a /= 256, c -= 8);
  32325. e[i + p - f] |= 128 * g
  32326. })
  32327. },
  32328. {}
  32329. ],
  32330. 201: [
  32331. function (e, t, i) {
  32332. var n = {}.toString
  32333. t.exports =
  32334. Array.isArray ||
  32335. function (e) {
  32336. return '[object Array]' == n.call(e)
  32337. }
  32338. },
  32339. {}
  32340. ],
  32341. 202: [
  32342. function (e, t, i) {
  32343. function n() {
  32344. ;(this._events = this._events || {}), (this._maxListeners = this._maxListeners || void 0)
  32345. }
  32346. function r(e) {
  32347. return 'function' == typeof e
  32348. }
  32349. function o(e) {
  32350. return 'number' == typeof e
  32351. }
  32352. function a(e) {
  32353. return 'object' == typeof e && null !== e
  32354. }
  32355. function s(e) {
  32356. return void 0 === e
  32357. }
  32358. ;(t.exports = n),
  32359. (n.EventEmitter = n),
  32360. (n.prototype._events = void 0),
  32361. (n.prototype._maxListeners = void 0),
  32362. (n.defaultMaxListeners = 10),
  32363. (n.prototype.setMaxListeners = function (e) {
  32364. if (!o(e) || e < 0 || isNaN(e)) throw TypeError('n must be a positive number')
  32365. return (this._maxListeners = e), this
  32366. }),
  32367. (n.prototype.emit = function (e) {
  32368. var t, i, n, o, l, c
  32369. if ((this._events || (this._events = {}), 'error' === e && (!this._events.error || (a(this._events.error) && !this._events.error.length)))) {
  32370. if (((t = arguments[1]), t instanceof Error)) throw t
  32371. var h = new Error('Uncaught, unspecified "error" event. (' + t + ')')
  32372. throw ((h.context = t), h)
  32373. }
  32374. if (((i = this._events[e]), s(i))) return !1
  32375. if (r(i))
  32376. switch (arguments.length) {
  32377. case 1:
  32378. i.call(this)
  32379. break
  32380. case 2:
  32381. i.call(this, arguments[1])
  32382. break
  32383. case 3:
  32384. i.call(this, arguments[1], arguments[2])
  32385. break
  32386. default:
  32387. ;(o = Array.prototype.slice.call(arguments, 1)), i.apply(this, o)
  32388. }
  32389. else if (a(i)) for (o = Array.prototype.slice.call(arguments, 1), c = i.slice(), n = c.length, l = 0; l < n; l++) c[l].apply(this, o)
  32390. return !0
  32391. }),
  32392. (n.prototype.addListener = function (e, t) {
  32393. var i
  32394. if (!r(t)) throw TypeError('listener must be a function')
  32395. return (
  32396. this._events || (this._events = {}),
  32397. this._events.newListener && this.emit('newListener', e, r(t.listener) ? t.listener : t),
  32398. this._events[e] ? (a(this._events[e]) ? this._events[e].push(t) : (this._events[e] = [this._events[e], t])) : (this._events[e] = t),
  32399. a(this._events[e]) &&
  32400. !this._events[e].warned &&
  32401. ((i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners),
  32402. i &&
  32403. i > 0 &&
  32404. this._events[e].length > i &&
  32405. ((this._events[e].warned = !0),
  32406. console.error('(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.', this._events[e].length),
  32407. 'function' == typeof console.trace && console.trace())),
  32408. this
  32409. )
  32410. }),
  32411. (n.prototype.on = n.prototype.addListener),
  32412. (n.prototype.once = function (e, t) {
  32413. function i() {
  32414. this.removeListener(e, i), n || ((n = !0), t.apply(this, arguments))
  32415. }
  32416. if (!r(t)) throw TypeError('listener must be a function')
  32417. var n = !1
  32418. return (i.listener = t), this.on(e, i), this
  32419. }),
  32420. (n.prototype.removeListener = function (e, t) {
  32421. var i, n, o, s
  32422. if (!r(t)) throw TypeError('listener must be a function')
  32423. if (!this._events || !this._events[e]) return this
  32424. if (((i = this._events[e]), (o = i.length), (n = -1), i === t || (r(i.listener) && i.listener === t)))
  32425. delete this._events[e], this._events.removeListener && this.emit('removeListener', e, t)
  32426. else if (a(i)) {
  32427. for (s = o; s-- > 0; )
  32428. if (i[s] === t || (i[s].listener && i[s].listener === t)) {
  32429. n = s
  32430. break
  32431. }
  32432. if (n < 0) return this
  32433. 1 === i.length ? ((i.length = 0), delete this._events[e]) : i.splice(n, 1), this._events.removeListener && this.emit('removeListener', e, t)
  32434. }
  32435. return this
  32436. }),
  32437. (n.prototype.removeAllListeners = function (e) {
  32438. var t, i
  32439. if (!this._events) return this
  32440. if (!this._events.removeListener) return 0 === arguments.length ? (this._events = {}) : this._events[e] && delete this._events[e], this
  32441. if (0 === arguments.length) {
  32442. for (t in this._events) 'removeListener' !== t && this.removeAllListeners(t)
  32443. return this.removeAllListeners('removeListener'), (this._events = {}), this
  32444. }
  32445. if (((i = this._events[e]), r(i))) this.removeListener(e, i)
  32446. else if (i) for (; i.length; ) this.removeListener(e, i[i.length - 1])
  32447. return delete this._events[e], this
  32448. }),
  32449. (n.prototype.listeners = function (e) {
  32450. var t
  32451. return (t = this._events && this._events[e] ? (r(this._events[e]) ? [this._events[e]] : this._events[e].slice()) : [])
  32452. }),
  32453. (n.prototype.listenerCount = function (e) {
  32454. if (this._events) {
  32455. var t = this._events[e]
  32456. if (r(t)) return 1
  32457. if (t) return t.length
  32458. }
  32459. return 0
  32460. }),
  32461. (n.listenerCount = function (e, t) {
  32462. return e.listenerCount(t)
  32463. })
  32464. },
  32465. {}
  32466. ],
  32467. 203: [
  32468. function (e, t, i) {
  32469. function n() {
  32470. throw new Error('setTimeout has not been defined')
  32471. }
  32472. function r() {
  32473. throw new Error('clearTimeout has not been defined')
  32474. }
  32475. function o(e) {
  32476. if (u === setTimeout) return setTimeout(e, 0)
  32477. if ((u === n || !u) && setTimeout) return (u = setTimeout), setTimeout(e, 0)
  32478. try {
  32479. return u(e, 0)
  32480. } catch (t) {
  32481. try {
  32482. return u.call(null, e, 0)
  32483. } catch (t) {
  32484. return u.call(this, e, 0)
  32485. }
  32486. }
  32487. }
  32488. function a(e) {
  32489. if (d === clearTimeout) return clearTimeout(e)
  32490. if ((d === r || !d) && clearTimeout) return (d = clearTimeout), clearTimeout(e)
  32491. try {
  32492. return d(e)
  32493. } catch (t) {
  32494. try {
  32495. return d.call(null, e)
  32496. } catch (t) {
  32497. return d.call(this, e)
  32498. }
  32499. }
  32500. }
  32501. function s() {
  32502. m && f && ((m = !1), f.length ? (g = f.concat(g)) : (v = -1), g.length && l())
  32503. }
  32504. function l() {
  32505. if (!m) {
  32506. var e = o(s)
  32507. m = !0
  32508. for (var t = g.length; t; ) {
  32509. for (f = g, g = []; ++v < t; ) f && f[v].run()
  32510. ;(v = -1), (t = g.length)
  32511. }
  32512. ;(f = null), (m = !1), a(e)
  32513. }
  32514. }
  32515. function c(e, t) {
  32516. ;(this.fun = e), (this.array = t)
  32517. }
  32518. function h() {}
  32519. var u,
  32520. d,
  32521. p = (t.exports = {})
  32522. !(function () {
  32523. try {
  32524. u = 'function' == typeof setTimeout ? setTimeout : n
  32525. } catch (e) {
  32526. u = n
  32527. }
  32528. try {
  32529. d = 'function' == typeof clearTimeout ? clearTimeout : r
  32530. } catch (e) {
  32531. d = r
  32532. }
  32533. })()
  32534. var f,
  32535. g = [],
  32536. m = !1,
  32537. v = -1
  32538. ;(p.nextTick = function (e) {
  32539. var t = new Array(arguments.length - 1)
  32540. if (arguments.length > 1) for (var i = 1; i < arguments.length; i++) t[i - 1] = arguments[i]
  32541. g.push(new c(e, t)), 1 !== g.length || m || o(l)
  32542. }),
  32543. (c.prototype.run = function () {
  32544. this.fun.apply(null, this.array)
  32545. }),
  32546. (p.title = 'browser'),
  32547. (p.browser = !0),
  32548. (p.env = {}),
  32549. (p.argv = []),
  32550. (p.version = ''),
  32551. (p.versions = {}),
  32552. (p.on = h),
  32553. (p.addListener = h),
  32554. (p.once = h),
  32555. (p.off = h),
  32556. (p.removeListener = h),
  32557. (p.removeAllListeners = h),
  32558. (p.emit = h),
  32559. (p.binding = function (e) {
  32560. throw new Error('process.binding is not supported')
  32561. }),
  32562. (p.cwd = function () {
  32563. return '/'
  32564. }),
  32565. (p.chdir = function (e) {
  32566. throw new Error('process.chdir is not supported')
  32567. }),
  32568. (p.umask = function () {
  32569. return 0
  32570. })
  32571. },
  32572. {}
  32573. ],
  32574. 204: [
  32575. function (e, t, i) {
  32576. ;(function (e) {
  32577. !(function (n) {
  32578. function r(e) {
  32579. throw new RangeError(L[e])
  32580. }
  32581. function o(e, t) {
  32582. for (var i = e.length, n = []; i--; ) n[i] = t(e[i])
  32583. return n
  32584. }
  32585. function a(e, t) {
  32586. var i = e.split('@'),
  32587. n = ''
  32588. i.length > 1 && ((n = i[0] + '@'), (e = i[1])), (e = e.replace(O, '.'))
  32589. var r = e.split('.'),
  32590. a = o(r, t).join('.')
  32591. return n + a
  32592. }
  32593. function s(e) {
  32594. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  32595. (t = e.charCodeAt(r++)),
  32596. t >= 55296 && t <= 56319 && r < o ? ((i = e.charCodeAt(r++)), 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t), r--)) : n.push(t)
  32597. return n
  32598. }
  32599. function l(e) {
  32600. return o(e, function (e) {
  32601. var t = ''
  32602. return e > 65535 && ((e -= 65536), (t += B(((e >>> 10) & 1023) | 55296)), (e = 56320 | (1023 & e))), (t += B(e))
  32603. }).join('')
  32604. }
  32605. function c(e) {
  32606. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  32607. }
  32608. function h(e, t) {
  32609. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  32610. }
  32611. function u(e, t, i) {
  32612. var n = 0
  32613. for (e = i ? N(e / T) : e >> 1, e += N(e / t); e > (D * w) >> 1; n += E) e = N(e / D)
  32614. return N(n + ((D + 1) * e) / (e + _))
  32615. }
  32616. function d(e) {
  32617. var t,
  32618. i,
  32619. n,
  32620. o,
  32621. a,
  32622. s,
  32623. h,
  32624. d,
  32625. p,
  32626. f,
  32627. g = [],
  32628. m = e.length,
  32629. v = 0,
  32630. A = S,
  32631. y = x
  32632. for (i = e.lastIndexOf(M), i < 0 && (i = 0), n = 0; n < i; ++n) e.charCodeAt(n) >= 128 && r('not-basic'), g.push(e.charCodeAt(n))
  32633. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  32634. for (
  32635. a = v, s = 1, h = E;
  32636. o >= m && r('invalid-input'), (d = c(e.charCodeAt(o++))), (d >= E || d > N((I - v) / s)) && r('overflow'), (v += d * s), (p = h <= y ? b : h >= y + w ? w : h - y), !(d < p);
  32637. h += E
  32638. )
  32639. (f = E - p), s > N(I / f) && r('overflow'), (s *= f)
  32640. ;(t = g.length + 1), (y = u(v - a, t, 0 == a)), N(v / t) > I - A && r('overflow'), (A += N(v / t)), (v %= t), g.splice(v++, 0, A)
  32641. }
  32642. return l(g)
  32643. }
  32644. function p(e) {
  32645. var t,
  32646. i,
  32647. n,
  32648. o,
  32649. a,
  32650. l,
  32651. c,
  32652. d,
  32653. p,
  32654. f,
  32655. g,
  32656. m,
  32657. v,
  32658. A,
  32659. y,
  32660. C = []
  32661. for (e = s(e), m = e.length, t = S, i = 0, a = x, l = 0; l < m; ++l) (g = e[l]), g < 128 && C.push(B(g))
  32662. for (n = o = C.length, o && C.push(M); n < m; ) {
  32663. for (c = I, l = 0; l < m; ++l) (g = e[l]), g >= t && g < c && (c = g)
  32664. for (v = n + 1, c - t > N((I - i) / v) && r('overflow'), i += (c - t) * v, t = c, l = 0; l < m; ++l)
  32665. if (((g = e[l]), g < t && ++i > I && r('overflow'), g == t)) {
  32666. for (d = i, p = E; (f = p <= a ? b : p >= a + w ? w : p - a), !(d < f); p += E) (y = d - f), (A = E - f), C.push(B(h(f + (y % A), 0))), (d = N(y / A))
  32667. C.push(B(h(d, 0))), (a = u(i, v, n == o)), (i = 0), ++n
  32668. }
  32669. ++i, ++t
  32670. }
  32671. return C.join('')
  32672. }
  32673. function f(e) {
  32674. return a(e, function (e) {
  32675. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  32676. })
  32677. }
  32678. function g(e) {
  32679. return a(e, function (e) {
  32680. return P.test(e) ? 'xn--' + p(e) : e
  32681. })
  32682. }
  32683. var m = 'object' == typeof i && i && !i.nodeType && i,
  32684. v = 'object' == typeof t && t && !t.nodeType && t,
  32685. A = 'object' == typeof e && e
  32686. ;(A.global !== A && A.window !== A && A.self !== A) || (n = A)
  32687. var y,
  32688. C,
  32689. I = 2147483647,
  32690. E = 36,
  32691. b = 1,
  32692. w = 26,
  32693. _ = 38,
  32694. T = 700,
  32695. x = 72,
  32696. S = 128,
  32697. M = '-',
  32698. R = /^xn--/,
  32699. P = /[^\x20-\x7E]/,
  32700. O = /[\x2E\u3002\uFF0E\uFF61]/g,
  32701. L = {
  32702. overflow: 'Overflow: input needs wider integers to process',
  32703. 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
  32704. 'invalid-input': 'Invalid input'
  32705. },
  32706. D = E - b,
  32707. N = Math.floor,
  32708. B = String.fromCharCode
  32709. if (
  32710. ((y = {
  32711. version: '1.4.1',
  32712. ucs2: {
  32713. decode: s,
  32714. encode: l
  32715. },
  32716. decode: d,
  32717. encode: p,
  32718. toASCII: g,
  32719. toUnicode: f
  32720. }),
  32721. 'function' == typeof define && 'object' == typeof define.amd && define.amd)
  32722. )
  32723. define('punycode', function () {
  32724. return y
  32725. })
  32726. else if (m && v)
  32727. if (t.exports == m) v.exports = y
  32728. else for (C in y) y.hasOwnProperty(C) && (m[C] = y[C])
  32729. else n.punycode = y
  32730. })(this)
  32731. }).call(this, 'undefined' != typeof global ? global : 'undefined' != typeof self ? self : 'undefined' != typeof window ? window : {})
  32732. },
  32733. {}
  32734. ],
  32735. 205: [
  32736. function (e, t, i) {
  32737. 'use strict'
  32738. function n(e, t) {
  32739. return Object.prototype.hasOwnProperty.call(e, t)
  32740. }
  32741. t.exports = function (e, t, i, o) {
  32742. ;(t = t || '&'), (i = i || '=')
  32743. var a = {}
  32744. if ('string' != typeof e || 0 === e.length) return a
  32745. var s = /\+/g
  32746. e = e.split(t)
  32747. var l = 1e3
  32748. o && 'number' == typeof o.maxKeys && (l = o.maxKeys)
  32749. var c = e.length
  32750. l > 0 && c > l && (c = l)
  32751. for (var h = 0; h < c; ++h) {
  32752. var u,
  32753. d,
  32754. p,
  32755. f,
  32756. g = e[h].replace(s, '%20'),
  32757. m = g.indexOf(i)
  32758. m >= 0 ? ((u = g.substr(0, m)), (d = g.substr(m + 1))) : ((u = g), (d = '')),
  32759. (p = decodeURIComponent(u)),
  32760. (f = decodeURIComponent(d)),
  32761. n(a, p) ? (r(a[p]) ? a[p].push(f) : (a[p] = [a[p], f])) : (a[p] = f)
  32762. }
  32763. return a
  32764. }
  32765. var r =
  32766. Array.isArray ||
  32767. function (e) {
  32768. return '[object Array]' === Object.prototype.toString.call(e)
  32769. }
  32770. },
  32771. {}
  32772. ],
  32773. 206: [
  32774. function (e, t, i) {
  32775. 'use strict'
  32776. function n(e, t) {
  32777. if (e.map) return e.map(t)
  32778. for (var i = [], n = 0; n < e.length; n++) i.push(t(e[n], n))
  32779. return i
  32780. }
  32781. var r = function (e) {
  32782. switch (typeof e) {
  32783. case 'string':
  32784. return e
  32785. case 'boolean':
  32786. return e ? 'true' : 'false'
  32787. case 'number':
  32788. return isFinite(e) ? e : ''
  32789. default:
  32790. return ''
  32791. }
  32792. }
  32793. t.exports = function (e, t, i, s) {
  32794. return (
  32795. (t = t || '&'),
  32796. (i = i || '='),
  32797. null === e && (e = void 0),
  32798. 'object' == typeof e
  32799. ? n(a(e), function (a) {
  32800. var s = encodeURIComponent(r(a)) + i
  32801. return o(e[a])
  32802. ? n(e[a], function (e) {
  32803. return s + encodeURIComponent(r(e))
  32804. }).join(t)
  32805. : s + encodeURIComponent(r(e[a]))
  32806. }).join(t)
  32807. : s
  32808. ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e))
  32809. : ''
  32810. )
  32811. }
  32812. var o =
  32813. Array.isArray ||
  32814. function (e) {
  32815. return '[object Array]' === Object.prototype.toString.call(e)
  32816. },
  32817. a =
  32818. Object.keys ||
  32819. function (e) {
  32820. var t = []
  32821. for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && t.push(i)
  32822. return t
  32823. }
  32824. },
  32825. {}
  32826. ],
  32827. 207: [
  32828. function (e, t, i) {
  32829. 'use strict'
  32830. ;(i.decode = i.parse = e('./decode')), (i.encode = i.stringify = e('./encode'))
  32831. },
  32832. {
  32833. './decode': 205,
  32834. './encode': 206
  32835. }
  32836. ],
  32837. 208: [
  32838. function (e, t, i) {
  32839. 'use strict'
  32840. function n() {
  32841. ;(this.protocol = null),
  32842. (this.slashes = null),
  32843. (this.auth = null),
  32844. (this.host = null),
  32845. (this.port = null),
  32846. (this.hostname = null),
  32847. (this.hash = null),
  32848. (this.search = null),
  32849. (this.query = null),
  32850. (this.pathname = null),
  32851. (this.path = null),
  32852. (this.href = null)
  32853. }
  32854. function r(e, t, i) {
  32855. if (e && c.isObject(e) && e instanceof n) return e
  32856. var r = new n()
  32857. return r.parse(e, t, i), r
  32858. }
  32859. function o(e) {
  32860. return c.isString(e) && (e = r(e)), e instanceof n ? e.format() : n.prototype.format.call(e)
  32861. }
  32862. function a(e, t) {
  32863. return r(e, !1, !0).resolve(t)
  32864. }
  32865. function s(e, t) {
  32866. return e ? r(e, !1, !0).resolveObject(t) : t
  32867. }
  32868. var l = e('punycode'),
  32869. c = e('./util')
  32870. ;(i.parse = r), (i.resolve = a), (i.resolveObject = s), (i.format = o), (i.Url = n)
  32871. var h = /^([a-z0-9.+-]+:)/i,
  32872. u = /:[0-9]*$/,
  32873. d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
  32874. p = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'],
  32875. f = ['{', '}', '|', '\\', '^', '`'].concat(p),
  32876. g = ["'"].concat(f),
  32877. m = ['%', '/', '?', ';', '#'].concat(g),
  32878. v = ['/', '?', '#'],
  32879. A = 255,
  32880. y = /^[+a-z0-9A-Z_-]{0,63}$/,
  32881. C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
  32882. I = {
  32883. javascript: !0,
  32884. 'javascript:': !0
  32885. },
  32886. E = {
  32887. javascript: !0,
  32888. 'javascript:': !0
  32889. },
  32890. b = {
  32891. http: !0,
  32892. https: !0,
  32893. ftp: !0,
  32894. gopher: !0,
  32895. file: !0,
  32896. 'http:': !0,
  32897. 'https:': !0,
  32898. 'ftp:': !0,
  32899. 'gopher:': !0,
  32900. 'file:': !0
  32901. },
  32902. w = e('querystring')
  32903. ;(n.prototype.parse = function (e, t, i) {
  32904. if (!c.isString(e)) throw new TypeError("Parameter 'url' must be a string, not " + typeof e)
  32905. var n = e.indexOf('?'),
  32906. r = n !== -1 && n < e.indexOf('#') ? '?' : '#',
  32907. o = e.split(r),
  32908. a = /\\/g
  32909. ;(o[0] = o[0].replace(a, '/')), (e = o.join(r))
  32910. var s = e
  32911. if (((s = s.trim()), !i && 1 === e.split('#').length)) {
  32912. var u = d.exec(s)
  32913. if (u)
  32914. return (
  32915. (this.path = s),
  32916. (this.href = s),
  32917. (this.pathname = u[1]),
  32918. u[2] ? ((this.search = u[2]), t ? (this.query = w.parse(this.search.substr(1))) : (this.query = this.search.substr(1))) : t && ((this.search = ''), (this.query = {})),
  32919. this
  32920. )
  32921. }
  32922. var p = h.exec(s)
  32923. if (p) {
  32924. p = p[0]
  32925. var f = p.toLowerCase()
  32926. ;(this.protocol = f), (s = s.substr(p.length))
  32927. }
  32928. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  32929. var _ = '//' === s.substr(0, 2)
  32930. !_ || (p && E[p]) || ((s = s.substr(2)), (this.slashes = !0))
  32931. }
  32932. if (!E[p] && (_ || (p && !b[p]))) {
  32933. for (var T = -1, x = 0; x < v.length; x++) {
  32934. var S = s.indexOf(v[x])
  32935. S !== -1 && (T === -1 || S < T) && (T = S)
  32936. }
  32937. var M, R
  32938. ;(R = T === -1 ? s.lastIndexOf('@') : s.lastIndexOf('@', T)), R !== -1 && ((M = s.slice(0, R)), (s = s.slice(R + 1)), (this.auth = decodeURIComponent(M))), (T = -1)
  32939. for (var x = 0; x < m.length; x++) {
  32940. var S = s.indexOf(m[x])
  32941. S !== -1 && (T === -1 || S < T) && (T = S)
  32942. }
  32943. T === -1 && (T = s.length), (this.host = s.slice(0, T)), (s = s.slice(T)), this.parseHost(), (this.hostname = this.hostname || '')
  32944. var P = '[' === this.hostname[0] && ']' === this.hostname[this.hostname.length - 1]
  32945. if (!P)
  32946. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  32947. var D = O[x]
  32948. if (D && !D.match(y)) {
  32949. for (var N = '', B = 0, F = D.length; B < F; B++) N += D.charCodeAt(B) > 127 ? 'x' : D[B]
  32950. if (!N.match(y)) {
  32951. var V = O.slice(0, x),
  32952. U = O.slice(x + 1),
  32953. k = D.match(C)
  32954. k && (V.push(k[1]), U.unshift(k[2])), U.length && (s = '/' + U.join('.') + s), (this.hostname = V.join('.'))
  32955. break
  32956. }
  32957. }
  32958. }
  32959. this.hostname.length > A ? (this.hostname = '') : (this.hostname = this.hostname.toLowerCase()), P || (this.hostname = l.toASCII(this.hostname))
  32960. var H = this.port ? ':' + this.port : '',
  32961. G = this.hostname || ''
  32962. ;(this.host = G + H), (this.href += this.host), P && ((this.hostname = this.hostname.substr(1, this.hostname.length - 2)), '/' !== s[0] && (s = '/' + s))
  32963. }
  32964. if (!I[f])
  32965. for (var x = 0, L = g.length; x < L; x++) {
  32966. var z = g[x]
  32967. if (s.indexOf(z) !== -1) {
  32968. var W = encodeURIComponent(z)
  32969. W === z && (W = escape(z)), (s = s.split(z).join(W))
  32970. }
  32971. }
  32972. var j = s.indexOf('#')
  32973. j !== -1 && ((this.hash = s.substr(j)), (s = s.slice(0, j)))
  32974. var Y = s.indexOf('?')
  32975. if (
  32976. (Y !== -1 ? ((this.search = s.substr(Y)), (this.query = s.substr(Y + 1)), t && (this.query = w.parse(this.query)), (s = s.slice(0, Y))) : t && ((this.search = ''), (this.query = {})),
  32977. s && (this.pathname = s),
  32978. b[f] && this.hostname && !this.pathname && (this.pathname = '/'),
  32979. this.pathname || this.search)
  32980. ) {
  32981. var H = this.pathname || '',
  32982. X = this.search || ''
  32983. this.path = H + X
  32984. }
  32985. return (this.href = this.format()), this
  32986. }),
  32987. (n.prototype.format = function () {
  32988. var e = this.auth || ''
  32989. e && ((e = encodeURIComponent(e)), (e = e.replace(/%3A/i, ':')), (e += '@'))
  32990. var t = this.protocol || '',
  32991. i = this.pathname || '',
  32992. n = this.hash || '',
  32993. r = !1,
  32994. o = ''
  32995. this.host ? (r = e + this.host) : this.hostname && ((r = e + (this.hostname.indexOf(':') === -1 ? this.hostname : '[' + this.hostname + ']')), this.port && (r += ':' + this.port)),
  32996. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query))
  32997. var a = this.search || (o && '?' + o) || ''
  32998. return (
  32999. t && ':' !== t.substr(-1) && (t += ':'),
  33000. this.slashes || ((!t || b[t]) && r !== !1) ? ((r = '//' + (r || '')), i && '/' !== i.charAt(0) && (i = '/' + i)) : r || (r = ''),
  33001. n && '#' !== n.charAt(0) && (n = '#' + n),
  33002. a && '?' !== a.charAt(0) && (a = '?' + a),
  33003. (i = i.replace(/[?#]/g, function (e) {
  33004. return encodeURIComponent(e)
  33005. })),
  33006. (a = a.replace('#', '%23')),
  33007. t + r + i + a + n
  33008. )
  33009. }),
  33010. (n.prototype.resolve = function (e) {
  33011. return this.resolveObject(r(e, !1, !0)).format()
  33012. }),
  33013. (n.prototype.resolveObject = function (e) {
  33014. if (c.isString(e)) {
  33015. var t = new n()
  33016. t.parse(e, !1, !0), (e = t)
  33017. }
  33018. for (var i = new n(), r = Object.keys(this), o = 0; o < r.length; o++) {
  33019. var a = r[o]
  33020. i[a] = this[a]
  33021. }
  33022. if (((i.hash = e.hash), '' === e.href)) return (i.href = i.format()), i
  33023. if (e.slashes && !e.protocol) {
  33024. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  33025. var h = s[l]
  33026. 'protocol' !== h && (i[h] = e[h])
  33027. }
  33028. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = '/'), (i.href = i.format()), i
  33029. }
  33030. if (e.protocol && e.protocol !== i.protocol) {
  33031. if (!b[e.protocol]) {
  33032. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  33033. var p = u[d]
  33034. i[p] = e[p]
  33035. }
  33036. return (i.href = i.format()), i
  33037. }
  33038. if (((i.protocol = e.protocol), e.host || E[e.protocol])) i.pathname = e.pathname
  33039. else {
  33040. for (var f = (e.pathname || '').split('/'); f.length && !(e.host = f.shift()); );
  33041. e.host || (e.host = ''), e.hostname || (e.hostname = ''), '' !== f[0] && f.unshift(''), f.length < 2 && f.unshift(''), (i.pathname = f.join('/'))
  33042. }
  33043. if (((i.search = e.search), (i.query = e.query), (i.host = e.host || ''), (i.auth = e.auth), (i.hostname = e.hostname || e.host), (i.port = e.port), i.pathname || i.search)) {
  33044. var g = i.pathname || '',
  33045. m = i.search || ''
  33046. i.path = g + m
  33047. }
  33048. return (i.slashes = i.slashes || e.slashes), (i.href = i.format()), i
  33049. }
  33050. var v = i.pathname && '/' === i.pathname.charAt(0),
  33051. A = e.host || (e.pathname && '/' === e.pathname.charAt(0)),
  33052. y = A || v || (i.host && e.pathname),
  33053. C = y,
  33054. I = (i.pathname && i.pathname.split('/')) || [],
  33055. f = (e.pathname && e.pathname.split('/')) || [],
  33056. w = i.protocol && !b[i.protocol]
  33057. if (
  33058. (w &&
  33059. ((i.hostname = ''),
  33060. (i.port = null),
  33061. i.host && ('' === I[0] ? (I[0] = i.host) : I.unshift(i.host)),
  33062. (i.host = ''),
  33063. e.protocol && ((e.hostname = null), (e.port = null), e.host && ('' === f[0] ? (f[0] = e.host) : f.unshift(e.host)), (e.host = null)),
  33064. (y = y && ('' === f[0] || '' === I[0]))),
  33065. A)
  33066. )
  33067. (i.host = e.host || '' === e.host ? e.host : i.host), (i.hostname = e.hostname || '' === e.hostname ? e.hostname : i.hostname), (i.search = e.search), (i.query = e.query), (I = f)
  33068. else if (f.length) I || (I = []), I.pop(), (I = I.concat(f)), (i.search = e.search), (i.query = e.query)
  33069. else if (!c.isNullOrUndefined(e.search)) {
  33070. if (w) {
  33071. i.hostname = i.host = I.shift()
  33072. var _ = !!(i.host && i.host.indexOf('@') > 0) && i.host.split('@')
  33073. _ && ((i.auth = _.shift()), (i.host = i.hostname = _.shift()))
  33074. }
  33075. return (
  33076. (i.search = e.search),
  33077. (i.query = e.query),
  33078. (c.isNull(i.pathname) && c.isNull(i.search)) || (i.path = (i.pathname ? i.pathname : '') + (i.search ? i.search : '')),
  33079. (i.href = i.format()),
  33080. i
  33081. )
  33082. }
  33083. if (!I.length) return (i.pathname = null), i.search ? (i.path = '/' + i.search) : (i.path = null), (i.href = i.format()), i
  33084. for (var T = I.slice(-1)[0], x = ((i.host || e.host || I.length > 1) && ('.' === T || '..' === T)) || '' === T, S = 0, M = I.length; M >= 0; M--)
  33085. (T = I[M]), '.' === T ? I.splice(M, 1) : '..' === T ? (I.splice(M, 1), S++) : S && (I.splice(M, 1), S--)
  33086. if (!y && !C) for (; S--; S) I.unshift('..')
  33087. !y || '' === I[0] || (I[0] && '/' === I[0].charAt(0)) || I.unshift(''), x && '/' !== I.join('/').substr(-1) && I.push('')
  33088. var R = '' === I[0] || (I[0] && '/' === I[0].charAt(0))
  33089. if (w) {
  33090. i.hostname = i.host = R ? '' : I.length ? I.shift() : ''
  33091. var _ = !!(i.host && i.host.indexOf('@') > 0) && i.host.split('@')
  33092. _ && ((i.auth = _.shift()), (i.host = i.hostname = _.shift()))
  33093. }
  33094. return (
  33095. (y = y || (i.host && I.length)),
  33096. y && !R && I.unshift(''),
  33097. I.length ? (i.pathname = I.join('/')) : ((i.pathname = null), (i.path = null)),
  33098. (c.isNull(i.pathname) && c.isNull(i.search)) || (i.path = (i.pathname ? i.pathname : '') + (i.search ? i.search : '')),
  33099. (i.auth = e.auth || i.auth),
  33100. (i.slashes = i.slashes || e.slashes),
  33101. (i.href = i.format()),
  33102. i
  33103. )
  33104. }),
  33105. (n.prototype.parseHost = function () {
  33106. var e = this.host,
  33107. t = u.exec(e)
  33108. t && ((t = t[0]), ':' !== t && (this.port = t.substr(1)), (e = e.substr(0, e.length - t.length))), e && (this.hostname = e)
  33109. })
  33110. },
  33111. {
  33112. './util': 209,
  33113. punycode: 204,
  33114. querystring: 207
  33115. }
  33116. ],
  33117. 209: [
  33118. function (e, t, i) {
  33119. 'use strict'
  33120. t.exports = {
  33121. isString: function (e) {
  33122. return 'string' == typeof e
  33123. },
  33124. isObject: function (e) {
  33125. return 'object' == typeof e && null !== e
  33126. },
  33127. isNull: function (e) {
  33128. return null === e
  33129. },
  33130. isNullOrUndefined: function (e) {
  33131. return null == e
  33132. }
  33133. }
  33134. },
  33135. {}
  33136. ],
  33137. 210: [
  33138. function (e, t, i) {
  33139. 'use strict'
  33140. function n(e) {
  33141. return l + e
  33142. }
  33143. function r(e) {
  33144. return e.substring(l.length)
  33145. }
  33146. function o(e, t) {
  33147. for (var i in t)
  33148. Object.defineProperty(e, i, {
  33149. value: t[i],
  33150. configurable: !0,
  33151. writable: !0
  33152. })
  33153. }
  33154. function a(e) {
  33155. if ('string' != typeof e) throw new TypeError('key must be a string.')
  33156. }
  33157. var s = Object.prototype.hasOwnProperty,
  33158. l = '~'
  33159. t.exports = function (e) {
  33160. var t = Object.create(null),
  33161. i = 0,
  33162. l = {}
  33163. return (
  33164. o(l, {
  33165. get: function (e, i) {
  33166. a(e)
  33167. var r = n(e)
  33168. return r in t ? t[r] : i
  33169. },
  33170. set: function (e, r) {
  33171. a(e)
  33172. var o = n(e)
  33173. return o in t || ++i, (t[o] = r)
  33174. },
  33175. has: function (e) {
  33176. return a(e), n(e) in t
  33177. },
  33178. delete: function (e) {
  33179. a(e)
  33180. var r = n(e)
  33181. return r in t && (--i, delete t[r], !0)
  33182. },
  33183. clear: function () {
  33184. ;(t = Object.create(null)), (i = 0)
  33185. },
  33186. forEach: function (e, i) {
  33187. if ('function' != typeof e) throw new TypeError('`callback` must be a function')
  33188. for (var n in t)
  33189. if (s.call(t, n)) {
  33190. var o = r(n),
  33191. a = t[n]
  33192. e.call(i, a, o, l)
  33193. }
  33194. }
  33195. }),
  33196. Object.defineProperty(l, 'size', {
  33197. get: function () {
  33198. return i
  33199. },
  33200. configurable: !0
  33201. }),
  33202. 'object' == typeof e &&
  33203. null !== e &&
  33204. Object.keys(e).forEach(function (t) {
  33205. l.set(t, e[t])
  33206. }),
  33207. l
  33208. )
  33209. }
  33210. },
  33211. {}
  33212. ],
  33213. 211: [
  33214. function (e, t, i) {
  33215. t.exports = e('./lib/heap')
  33216. },
  33217. {
  33218. './lib/heap': 212
  33219. }
  33220. ],
  33221. 212: [
  33222. function (e, t, i) {
  33223. ;(function () {
  33224. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m
  33225. ;(r = Math.floor),
  33226. (u = Math.min),
  33227. (n = function (e, t) {
  33228. return e < t ? -1 : e > t ? 1 : 0
  33229. }),
  33230. (h = function (e, t, i, o, a) {
  33231. var s
  33232. if ((null == i && (i = 0), null == a && (a = n), i < 0)) throw new Error('lo must be non-negative')
  33233. for (null == o && (o = e.length); i < o; ) (s = r((i + o) / 2)), a(t, e[s]) < 0 ? (o = s) : (i = s + 1)
  33234. return [].splice.apply(e, [i, i - i].concat(t)), t
  33235. }),
  33236. (s = function (e, t, i) {
  33237. return null == i && (i = n), e.push(t), g(e, 0, e.length - 1, i)
  33238. }),
  33239. (a = function (e, t) {
  33240. var i, r
  33241. return null == t && (t = n), (i = e.pop()), e.length ? ((r = e[0]), (e[0] = i), m(e, 0, t)) : (r = i), r
  33242. }),
  33243. (c = function (e, t, i) {
  33244. var r
  33245. return null == i && (i = n), (r = e[0]), (e[0] = t), m(e, 0, i), r
  33246. }),
  33247. (l = function (e, t, i) {
  33248. var r
  33249. return null == i && (i = n), e.length && i(e[0], t) < 0 && ((r = [e[0], t]), (t = r[0]), (e[0] = r[1]), m(e, 0, i)), t
  33250. }),
  33251. (o = function (e, t) {
  33252. var i, o, a, s, l, c
  33253. for (
  33254. null == t && (t = n),
  33255. s = function () {
  33256. c = []
  33257. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--) c.push(t)
  33258. return c
  33259. }
  33260. .apply(this)
  33261. .reverse(),
  33262. l = [],
  33263. o = 0,
  33264. a = s.length;
  33265. o < a;
  33266. o++
  33267. )
  33268. (i = s[o]), l.push(m(e, i, t))
  33269. return l
  33270. }),
  33271. (f = function (e, t, i) {
  33272. var r
  33273. if ((null == i && (i = n), (r = e.indexOf(t)), r !== -1)) return g(e, 0, r, i), m(e, r, i)
  33274. }),
  33275. (d = function (e, t, i) {
  33276. var r, a, s, c, h
  33277. if ((null == i && (i = n), (a = e.slice(0, t)), !a.length)) return a
  33278. for (o(a, i), h = e.slice(t), s = 0, c = h.length; s < c; s++) (r = h[s]), l(a, r, i)
  33279. return a.sort(i).reverse()
  33280. }),
  33281. (p = function (e, t, i) {
  33282. var r, s, l, c, d, p, f, g, m, v
  33283. if ((null == i && (i = n), 10 * t <= e.length)) {
  33284. if (((c = e.slice(0, t).sort(i)), !c.length)) return c
  33285. for (l = c[c.length - 1], g = e.slice(t), d = 0, f = g.length; d < f; d++) (r = g[d]), i(r, l) < 0 && (h(c, r, 0, null, i), c.pop(), (l = c[c.length - 1]))
  33286. return c
  33287. }
  33288. for (o(e, i), v = [], s = p = 0, m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p) v.push(a(e, i))
  33289. return v
  33290. }),
  33291. (g = function (e, t, i, r) {
  33292. var o, a, s
  33293. for (null == r && (r = n), o = e[i]; i > t && ((s = (i - 1) >> 1), (a = e[s]), r(o, a) < 0); ) (e[i] = a), (i = s)
  33294. return (e[i] = o)
  33295. }),
  33296. (m = function (e, t, i) {
  33297. var r, o, a, s, l
  33298. for (null == i && (i = n), o = e.length, l = t, a = e[t], r = 2 * t + 1; r < o; ) (s = r + 1), s < o && !(i(e[r], e[s]) < 0) && (r = s), (e[t] = e[r]), (t = r), (r = 2 * t + 1)
  33299. return (e[t] = a), g(e, l, t, i)
  33300. }),
  33301. (e = (function () {
  33302. function e(e) {
  33303. ;(this.cmp = null != e ? e : n), (this.nodes = [])
  33304. }
  33305. return (
  33306. (e.push = s),
  33307. (e.pop = a),
  33308. (e.replace = c),
  33309. (e.pushpop = l),
  33310. (e.heapify = o),
  33311. (e.updateItem = f),
  33312. (e.nlargest = d),
  33313. (e.nsmallest = p),
  33314. (e.prototype.push = function (e) {
  33315. return s(this.nodes, e, this.cmp)
  33316. }),
  33317. (e.prototype.pop = function () {
  33318. return a(this.nodes, this.cmp)
  33319. }),
  33320. (e.prototype.peek = function () {
  33321. return this.nodes[0]
  33322. }),
  33323. (e.prototype.contains = function (e) {
  33324. return this.nodes.indexOf(e) !== -1
  33325. }),
  33326. (e.prototype.replace = function (e) {
  33327. return c(this.nodes, e, this.cmp)
  33328. }),
  33329. (e.prototype.pushpop = function (e) {
  33330. return l(this.nodes, e, this.cmp)
  33331. }),
  33332. (e.prototype.heapify = function () {
  33333. return o(this.nodes, this.cmp)
  33334. }),
  33335. (e.prototype.updateItem = function (e) {
  33336. return f(this.nodes, e, this.cmp)
  33337. }),
  33338. (e.prototype.clear = function () {
  33339. return (this.nodes = [])
  33340. }),
  33341. (e.prototype.empty = function () {
  33342. return 0 === this.nodes.length
  33343. }),
  33344. (e.prototype.size = function () {
  33345. return this.nodes.length
  33346. }),
  33347. (e.prototype.clone = function () {
  33348. var t
  33349. return (t = new e()), (t.nodes = this.nodes.slice(0)), t
  33350. }),
  33351. (e.prototype.toArray = function () {
  33352. return this.nodes.slice(0)
  33353. }),
  33354. (e.prototype.insert = e.prototype.push),
  33355. (e.prototype.top = e.prototype.peek),
  33356. (e.prototype.front = e.prototype.peek),
  33357. (e.prototype.has = e.prototype.contains),
  33358. (e.prototype.copy = e.prototype.clone),
  33359. e
  33360. )
  33361. })()),
  33362. (function (e, n) {
  33363. return 'function' == typeof define && define.amd ? define([], n) : 'object' == typeof i ? (t.exports = n()) : (e.Heap = n())
  33364. })(this, function () {
  33365. return e
  33366. })
  33367. }).call(this)
  33368. },
  33369. {}
  33370. ],
  33371. 213: [
  33372. function (e, t, i) {
  33373. !(function (e) {
  33374. function i() {}
  33375. function n(e, t) {
  33376. return function () {
  33377. e.apply(t, arguments)
  33378. }
  33379. }
  33380. function r(e) {
  33381. if ('object' != typeof this) throw new TypeError('Promises must be constructed via new')
  33382. if ('function' != typeof e) throw new TypeError('not a function')
  33383. ;(this._state = 0), (this._handled = !1), (this._value = void 0), (this._deferreds = []), h(e, this)
  33384. }
  33385. function o(e, t) {
  33386. for (; 3 === e._state; ) e = e._value
  33387. return 0 === e._state
  33388. ? void e._deferreds.push(t)
  33389. : ((e._handled = !0),
  33390. void r._immediateFn(function () {
  33391. var i = 1 === e._state ? t.onFulfilled : t.onRejected
  33392. if (null === i) return void (1 === e._state ? a : s)(t.promise, e._value)
  33393. var n
  33394. try {
  33395. n = i(e._value)
  33396. } catch (e) {
  33397. return void s(t.promise, e)
  33398. }
  33399. a(t.promise, n)
  33400. }))
  33401. }
  33402. function a(e, t) {
  33403. try {
  33404. if (t === e) throw new TypeError('A promise cannot be resolved with itself.')
  33405. if (t && ('object' == typeof t || 'function' == typeof t)) {
  33406. var i = t.then
  33407. if (t instanceof r) return (e._state = 3), (e._value = t), void l(e)
  33408. if ('function' == typeof i) return void h(n(i, t), e)
  33409. }
  33410. ;(e._state = 1), (e._value = t), l(e)
  33411. } catch (t) {
  33412. s(e, t)
  33413. }
  33414. }
  33415. function s(e, t) {
  33416. ;(e._state = 2), (e._value = t), l(e)
  33417. }
  33418. function l(e) {
  33419. 2 === e._state &&
  33420. 0 === e._deferreds.length &&
  33421. r._immediateFn(function () {
  33422. e._handled || r._unhandledRejectionFn(e._value)
  33423. })
  33424. for (var t = 0, i = e._deferreds.length; t < i; t++) o(e, e._deferreds[t])
  33425. e._deferreds = null
  33426. }
  33427. function c(e, t, i) {
  33428. ;(this.onFulfilled = 'function' == typeof e ? e : null), (this.onRejected = 'function' == typeof t ? t : null), (this.promise = i)
  33429. }
  33430. function h(e, t) {
  33431. var i = !1
  33432. try {
  33433. e(
  33434. function (e) {
  33435. i || ((i = !0), a(t, e))
  33436. },
  33437. function (e) {
  33438. i || ((i = !0), s(t, e))
  33439. }
  33440. )
  33441. } catch (e) {
  33442. if (i) return
  33443. ;(i = !0), s(t, e)
  33444. }
  33445. }
  33446. var u = setTimeout
  33447. ;(r.prototype.catch = function (e) {
  33448. return this.then(null, e)
  33449. }),
  33450. (r.prototype.then = function (e, t) {
  33451. var n = new this.constructor(i)
  33452. return o(this, new c(e, t, n)), n
  33453. }),
  33454. (r.all = function (e) {
  33455. var t = Array.prototype.slice.call(e)
  33456. return new r(function (e, i) {
  33457. function n(o, a) {
  33458. try {
  33459. if (a && ('object' == typeof a || 'function' == typeof a)) {
  33460. var s = a.then
  33461. if ('function' == typeof s)
  33462. return void s.call(
  33463. a,
  33464. function (e) {
  33465. n(o, e)
  33466. },
  33467. i
  33468. )
  33469. }
  33470. ;(t[o] = a), 0 === --r && e(t)
  33471. } catch (e) {
  33472. i(e)
  33473. }
  33474. }
  33475. if (0 === t.length) return e([])
  33476. for (var r = t.length, o = 0; o < t.length; o++) n(o, t[o])
  33477. })
  33478. }),
  33479. (r.resolve = function (e) {
  33480. return e && 'object' == typeof e && e.constructor === r
  33481. ? e
  33482. : new r(function (t) {
  33483. t(e)
  33484. })
  33485. }),
  33486. (r.reject = function (e) {
  33487. return new r(function (t, i) {
  33488. i(e)
  33489. })
  33490. }),
  33491. (r.race = function (e) {
  33492. return new r(function (t, i) {
  33493. for (var n = 0, r = e.length; n < r; n++) e[n].then(t, i)
  33494. })
  33495. }),
  33496. (r._immediateFn =
  33497. ('function' == typeof setImmediate &&
  33498. function (e) {
  33499. setImmediate(e)
  33500. }) ||
  33501. function (e) {
  33502. u(e, 0)
  33503. }),
  33504. (r._unhandledRejectionFn = function (e) {
  33505. 'undefined' != typeof console && console && console.warn('Possible Unhandled Promise Rejection:', e)
  33506. }),
  33507. (r._setImmediateFn = function (e) {
  33508. r._immediateFn = e
  33509. }),
  33510. (r._setUnhandledRejectionFn = function (e) {
  33511. r._unhandledRejectionFn = e
  33512. }),
  33513. 'undefined' != typeof t && t.exports ? (t.exports = r) : e.Promise || (e.Promise = r)
  33514. })(this)
  33515. },
  33516. {}
  33517. ],
  33518. 214: [
  33519. function (e, t, i) {
  33520. ;(function (i) {
  33521. !(function (i, n) {
  33522. 'function' == typeof define && define.amd
  33523. ? define(['bytebuffer'], n)
  33524. : 'function' == typeof e && 'object' == typeof t && t && t.exports
  33525. ? (t.exports = n(e('bytebuffer'), !0))
  33526. : ((i.dcodeIO = i.dcodeIO || {}).ProtoBuf = n(i.dcodeIO.ByteBuffer))
  33527. })(this, function (t, n) {
  33528. 'use strict'
  33529. var r = {}
  33530. return (
  33531. (r.ByteBuffer = t),
  33532. (r.Long = t.Long || null),
  33533. (r.VERSION = '5.0.1'),
  33534. (r.WIRE_TYPES = {}),
  33535. (r.WIRE_TYPES.VARINT = 0),
  33536. (r.WIRE_TYPES.BITS64 = 1),
  33537. (r.WIRE_TYPES.LDELIM = 2),
  33538. (r.WIRE_TYPES.STARTGROUP = 3),
  33539. (r.WIRE_TYPES.ENDGROUP = 4),
  33540. (r.WIRE_TYPES.BITS32 = 5),
  33541. (r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32]),
  33542. (r.TYPES = {
  33543. int32: {
  33544. name: 'int32',
  33545. wireType: r.WIRE_TYPES.VARINT,
  33546. defaultValue: 0
  33547. },
  33548. uint32: {
  33549. name: 'uint32',
  33550. wireType: r.WIRE_TYPES.VARINT,
  33551. defaultValue: 0
  33552. },
  33553. sint32: {
  33554. name: 'sint32',
  33555. wireType: r.WIRE_TYPES.VARINT,
  33556. defaultValue: 0
  33557. },
  33558. int64: {
  33559. name: 'int64',
  33560. wireType: r.WIRE_TYPES.VARINT,
  33561. defaultValue: r.Long ? r.Long.ZERO : void 0
  33562. },
  33563. uint64: {
  33564. name: 'uint64',
  33565. wireType: r.WIRE_TYPES.VARINT,
  33566. defaultValue: r.Long ? r.Long.UZERO : void 0
  33567. },
  33568. sint64: {
  33569. name: 'sint64',
  33570. wireType: r.WIRE_TYPES.VARINT,
  33571. defaultValue: r.Long ? r.Long.ZERO : void 0
  33572. },
  33573. bool: {
  33574. name: 'bool',
  33575. wireType: r.WIRE_TYPES.VARINT,
  33576. defaultValue: !1
  33577. },
  33578. double: {
  33579. name: 'double',
  33580. wireType: r.WIRE_TYPES.BITS64,
  33581. defaultValue: 0
  33582. },
  33583. string: {
  33584. name: 'string',
  33585. wireType: r.WIRE_TYPES.LDELIM,
  33586. defaultValue: ''
  33587. },
  33588. bytes: {
  33589. name: 'bytes',
  33590. wireType: r.WIRE_TYPES.LDELIM,
  33591. defaultValue: null
  33592. },
  33593. fixed32: {
  33594. name: 'fixed32',
  33595. wireType: r.WIRE_TYPES.BITS32,
  33596. defaultValue: 0
  33597. },
  33598. sfixed32: {
  33599. name: 'sfixed32',
  33600. wireType: r.WIRE_TYPES.BITS32,
  33601. defaultValue: 0
  33602. },
  33603. fixed64: {
  33604. name: 'fixed64',
  33605. wireType: r.WIRE_TYPES.BITS64,
  33606. defaultValue: r.Long ? r.Long.UZERO : void 0
  33607. },
  33608. sfixed64: {
  33609. name: 'sfixed64',
  33610. wireType: r.WIRE_TYPES.BITS64,
  33611. defaultValue: r.Long ? r.Long.ZERO : void 0
  33612. },
  33613. float: {
  33614. name: 'float',
  33615. wireType: r.WIRE_TYPES.BITS32,
  33616. defaultValue: 0
  33617. },
  33618. enum: {
  33619. name: 'enum',
  33620. wireType: r.WIRE_TYPES.VARINT,
  33621. defaultValue: 0
  33622. },
  33623. message: {
  33624. name: 'message',
  33625. wireType: r.WIRE_TYPES.LDELIM,
  33626. defaultValue: null
  33627. },
  33628. group: {
  33629. name: 'group',
  33630. wireType: r.WIRE_TYPES.STARTGROUP,
  33631. defaultValue: null
  33632. }
  33633. }),
  33634. (r.MAP_KEY_TYPES = [
  33635. r.TYPES.int32,
  33636. r.TYPES.sint32,
  33637. r.TYPES.sfixed32,
  33638. r.TYPES.uint32,
  33639. r.TYPES.fixed32,
  33640. r.TYPES.int64,
  33641. r.TYPES.sint64,
  33642. r.TYPES.sfixed64,
  33643. r.TYPES.uint64,
  33644. r.TYPES.fixed64,
  33645. r.TYPES.bool,
  33646. r.TYPES.string,
  33647. r.TYPES.bytes
  33648. ]),
  33649. (r.ID_MIN = 1),
  33650. (r.ID_MAX = 536870911),
  33651. (r.convertFieldsToCamelCase = !1),
  33652. (r.populateAccessors = !0),
  33653. (r.populateDefaults = !0),
  33654. (r.Util = (function () {
  33655. var t = {}
  33656. return (
  33657. (t.IS_NODE = !('object' != typeof i || i + '' != '[object process]' || i.browser)),
  33658. (t.XHR = function () {
  33659. for (
  33660. var e = [
  33661. function () {
  33662. return new XMLHttpRequest()
  33663. },
  33664. function () {
  33665. return new ActiveXObject('Msxml2.XMLHTTP')
  33666. },
  33667. function () {
  33668. return new ActiveXObject('Msxml3.XMLHTTP')
  33669. },
  33670. function () {
  33671. return new ActiveXObject('Microsoft.XMLHTTP')
  33672. }
  33673. ],
  33674. t = null,
  33675. i = 0;
  33676. i < e.length;
  33677. i++
  33678. ) {
  33679. try {
  33680. t = e[i]()
  33681. } catch (e) {
  33682. continue
  33683. }
  33684. break
  33685. }
  33686. if (!t) throw Error('XMLHttpRequest is not supported')
  33687. return t
  33688. }),
  33689. (t.fetch = function (i, n) {
  33690. if ((n && 'function' != typeof n && (n = null), t.IS_NODE)) {
  33691. var r = e('fs')
  33692. if (n)
  33693. r.readFile(i, function (e, t) {
  33694. n(e ? null : '' + t)
  33695. })
  33696. else
  33697. try {
  33698. return r.readFileSync(i)
  33699. } catch (e) {
  33700. return null
  33701. }
  33702. } else {
  33703. var o = t.XHR()
  33704. if ((o.open('GET', i, !!n), o.setRequestHeader('Accept', 'text/plain'), 'function' == typeof o.overrideMimeType && o.overrideMimeType('text/plain'), !n))
  33705. return o.send(null), 200 == o.status || (0 == o.status && 'string' == typeof o.responseText) ? o.responseText : null
  33706. if (
  33707. ((o.onreadystatechange = function () {
  33708. 4 == o.readyState && n(200 == o.status || (0 == o.status && 'string' == typeof o.responseText) ? o.responseText : null)
  33709. }),
  33710. 4 == o.readyState)
  33711. )
  33712. return
  33713. o.send(null)
  33714. }
  33715. }),
  33716. (t.toCamelCase = function (e) {
  33717. return e.replace(/_([a-zA-Z])/g, function (e, t) {
  33718. return t.toUpperCase()
  33719. })
  33720. }),
  33721. t
  33722. )
  33723. })()),
  33724. (r.Lang = {
  33725. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  33726. RULE: /^(?:required|optional|repeated|map)$/,
  33727. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  33728. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  33729. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  33730. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  33731. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  33732. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  33733. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  33734. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  33735. NUMBER_OCT: /^0[0-7]+$/,
  33736. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  33737. BOOL: /^(?:true|false)$/i,
  33738. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  33739. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  33740. WHITESPACE: /\s/,
  33741. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  33742. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  33743. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  33744. }),
  33745. (r.DotProto = (function (e, t) {
  33746. function i(e, i) {
  33747. var n = -1,
  33748. r = 1
  33749. if (('-' == e.charAt(0) && ((r = -1), (e = e.substring(1))), t.NUMBER_DEC.test(e))) n = parseInt(e)
  33750. else if (t.NUMBER_HEX.test(e)) n = parseInt(e.substring(2), 16)
  33751. else {
  33752. if (!t.NUMBER_OCT.test(e)) throw Error('illegal id value: ' + (r < 0 ? '-' : '') + e)
  33753. n = parseInt(e.substring(1), 8)
  33754. }
  33755. if (((n = (r * n) | 0), !i && n < 0)) throw Error('illegal id value: ' + (r < 0 ? '-' : '') + e)
  33756. return n
  33757. }
  33758. function n(e) {
  33759. var i = 1
  33760. if (('-' == e.charAt(0) && ((i = -1), (e = e.substring(1))), t.NUMBER_DEC.test(e))) return i * parseInt(e, 10)
  33761. if (t.NUMBER_HEX.test(e)) return i * parseInt(e.substring(2), 16)
  33762. if (t.NUMBER_OCT.test(e)) return i * parseInt(e.substring(1), 8)
  33763. if ('inf' === e) return i * (1 / 0)
  33764. if ('nan' === e) return NaN
  33765. if (t.NUMBER_FLT.test(e)) return i * parseFloat(e)
  33766. throw Error('illegal number value: ' + (i < 0 ? '-' : '') + e)
  33767. }
  33768. function r(e, t, i) {
  33769. 'undefined' == typeof e[t] ? (e[t] = i) : (Array.isArray(e[t]) || (e[t] = [e[t]]), e[t].push(i))
  33770. }
  33771. var o = {},
  33772. a = function (e) {
  33773. ;(this.source = e + ''), (this.index = 0), (this.line = 1), (this.stack = []), (this._stringOpen = null)
  33774. },
  33775. s = a.prototype
  33776. ;(s._readString = function () {
  33777. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ
  33778. e.lastIndex = this.index - 1
  33779. var i = e.exec(this.source)
  33780. if (!i) throw Error('unterminated string')
  33781. return (this.index = e.lastIndex), this.stack.push(this._stringOpen), (this._stringOpen = null), i[1]
  33782. }),
  33783. (s.next = function () {
  33784. if (this.stack.length > 0) return this.stack.shift()
  33785. if (this.index >= this.source.length) return null
  33786. if (null !== this._stringOpen) return this._readString()
  33787. var e, i, n
  33788. do {
  33789. for (e = !1; t.WHITESPACE.test((n = this.source.charAt(this.index))); ) if (('\n' === n && ++this.line, ++this.index === this.source.length)) return null
  33790. if ('/' === this.source.charAt(this.index))
  33791. if ((++this.index, '/' === this.source.charAt(this.index))) {
  33792. for (; '\n' !== this.source.charAt(++this.index); ) if (this.index == this.source.length) return null
  33793. ++this.index, ++this.line, (e = !0)
  33794. } else {
  33795. if ('*' !== (n = this.source.charAt(this.index))) return '/'
  33796. do {
  33797. if (('\n' === n && ++this.line, ++this.index === this.source.length)) return null
  33798. ;(i = n), (n = this.source.charAt(this.index))
  33799. } while ('*' !== i || '/' !== n)
  33800. ++this.index, (e = !0)
  33801. }
  33802. } while (e)
  33803. if (this.index === this.source.length) return null
  33804. var r = this.index
  33805. t.DELIM.lastIndex = 0
  33806. var o = t.DELIM.test(this.source.charAt(r++))
  33807. if (!o) for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); ) ++r
  33808. var a = this.source.substring(this.index, (this.index = r))
  33809. return ('"' !== a && "'" !== a) || (this._stringOpen = a), a
  33810. }),
  33811. (s.peek = function () {
  33812. if (0 === this.stack.length) {
  33813. var e = this.next()
  33814. if (null === e) return null
  33815. this.stack.push(e)
  33816. }
  33817. return this.stack[0]
  33818. }),
  33819. (s.skip = function (e) {
  33820. var t = this.next()
  33821. if (t !== e) throw Error("illegal '" + t + "', '" + e + "' expected")
  33822. }),
  33823. (s.omit = function (e) {
  33824. return this.peek() === e && (this.next(), !0)
  33825. }),
  33826. (s.toString = function () {
  33827. return 'Tokenizer (' + this.index + '/' + this.source.length + ' at line ' + this.line + ')'
  33828. }),
  33829. (o.Tokenizer = a)
  33830. var l = function (e) {
  33831. ;(this.tn = new a(e)), (this.proto3 = !1)
  33832. },
  33833. c = l.prototype
  33834. return (
  33835. (c.parse = function () {
  33836. var e,
  33837. i,
  33838. n = {
  33839. name: '[ROOT]',
  33840. package: null,
  33841. messages: [],
  33842. enums: [],
  33843. imports: [],
  33844. options: {},
  33845. services: []
  33846. },
  33847. r = !0
  33848. try {
  33849. for (; (e = this.tn.next()); )
  33850. switch (e) {
  33851. case 'package':
  33852. if (!r || null !== n.package) throw Error("unexpected 'package'")
  33853. if (((e = this.tn.next()), !t.TYPEREF.test(e))) throw Error('illegal package name: ' + e)
  33854. this.tn.skip(';'), (n.package = e)
  33855. break
  33856. case 'import':
  33857. if (!r) throw Error("unexpected 'import'")
  33858. ;(e = this.tn.peek()), ('public' === e || (i = 'weak' === e)) && this.tn.next(), (e = this._readString()), this.tn.skip(';'), i || n.imports.push(e)
  33859. break
  33860. case 'syntax':
  33861. if (!r) throw Error("unexpected 'syntax'")
  33862. this.tn.skip('='), 'proto3' === (n.syntax = this._readString()) && (this.proto3 = !0), this.tn.skip(';')
  33863. break
  33864. case 'message':
  33865. this._parseMessage(n, null), (r = !1)
  33866. break
  33867. case 'enum':
  33868. this._parseEnum(n), (r = !1)
  33869. break
  33870. case 'option':
  33871. this._parseOption(n)
  33872. break
  33873. case 'service':
  33874. this._parseService(n)
  33875. break
  33876. case 'extend':
  33877. this._parseExtend(n)
  33878. break
  33879. default:
  33880. throw Error("unexpected '" + e + "'")
  33881. }
  33882. } catch (e) {
  33883. throw ((e.message = 'Parse error at line ' + this.tn.line + ': ' + e.message), e)
  33884. }
  33885. return delete n.name, n
  33886. }),
  33887. (l.parse = function (e) {
  33888. return new l(e).parse()
  33889. }),
  33890. (c._readString = function () {
  33891. var e,
  33892. t,
  33893. i = ''
  33894. do {
  33895. if (((t = this.tn.next()), "'" !== t && '"' !== t)) throw Error('illegal string delimiter: ' + t)
  33896. ;(i += this.tn.next()), this.tn.skip(t), (e = this.tn.peek())
  33897. } while ('"' === e || '"' === e)
  33898. return i
  33899. }),
  33900. (c._readValue = function (e) {
  33901. var i = this.tn.peek()
  33902. if ('"' === i || "'" === i) return this._readString()
  33903. if ((this.tn.next(), t.NUMBER.test(i))) return n(i)
  33904. if (t.BOOL.test(i)) return 'true' === i.toLowerCase()
  33905. if (e && t.TYPEREF.test(i)) return i
  33906. throw Error('illegal value: ' + i)
  33907. }),
  33908. (c._parseOption = function (e, i) {
  33909. var n = this.tn.next(),
  33910. r = !1
  33911. if (('(' === n && ((r = !0), (n = this.tn.next())), !t.TYPEREF.test(n))) throw Error('illegal option name: ' + n)
  33912. var o = n
  33913. r && (this.tn.skip(')'), (o = '(' + o + ')'), (n = this.tn.peek()), t.FQTYPEREF.test(n) && ((o += n), this.tn.next())),
  33914. this.tn.skip('='),
  33915. this._parseOptionValue(e, o),
  33916. i || this.tn.skip(';')
  33917. }),
  33918. (c._parseOptionValue = function (e, i) {
  33919. var n = this.tn.peek()
  33920. if ('{' !== n) r(e.options, i, this._readValue(!0))
  33921. else
  33922. for (this.tn.skip('{'); '}' !== (n = this.tn.next()); ) {
  33923. if (!t.NAME.test(n)) throw Error('illegal option name: ' + i + '.' + n)
  33924. this.tn.omit(':') ? r(e.options, i + '.' + n, this._readValue(!0)) : this._parseOptionValue(e, i + '.' + n)
  33925. }
  33926. }),
  33927. (c._parseService = function (e) {
  33928. var i = this.tn.next()
  33929. if (!t.NAME.test(i)) throw Error('illegal service name at line ' + this.tn.line + ': ' + i)
  33930. var n = i,
  33931. r = {
  33932. name: n,
  33933. rpc: {},
  33934. options: {}
  33935. }
  33936. for (this.tn.skip('{'); '}' !== (i = this.tn.next()); )
  33937. if ('option' === i) this._parseOption(r)
  33938. else {
  33939. if ('rpc' !== i) throw Error('illegal service token: ' + i)
  33940. this._parseServiceRPC(r)
  33941. }
  33942. this.tn.omit(';'), e.services.push(r)
  33943. }),
  33944. (c._parseServiceRPC = function (e) {
  33945. var i = 'rpc',
  33946. n = this.tn.next()
  33947. if (!t.NAME.test(n)) throw Error('illegal rpc service method name: ' + n)
  33948. var r = n,
  33949. o = {
  33950. request: null,
  33951. response: null,
  33952. request_stream: !1,
  33953. response_stream: !1,
  33954. options: {}
  33955. }
  33956. if ((this.tn.skip('('), (n = this.tn.next()), 'stream' === n.toLowerCase() && ((o.request_stream = !0), (n = this.tn.next())), !t.TYPEREF.test(n)))
  33957. throw Error('illegal rpc service request type: ' + n)
  33958. if (((o.request = n), this.tn.skip(')'), (n = this.tn.next()), 'returns' !== n.toLowerCase())) throw Error('illegal rpc service request type delimiter: ' + n)
  33959. if (
  33960. (this.tn.skip('('),
  33961. (n = this.tn.next()),
  33962. 'stream' === n.toLowerCase() && ((o.response_stream = !0), (n = this.tn.next())),
  33963. (o.response = n),
  33964. this.tn.skip(')'),
  33965. (n = this.tn.peek()),
  33966. '{' === n)
  33967. ) {
  33968. for (this.tn.next(); '}' !== (n = this.tn.next()); ) {
  33969. if ('option' !== n) throw Error('illegal rpc service token: ' + n)
  33970. this._parseOption(o)
  33971. }
  33972. this.tn.omit(';')
  33973. } else this.tn.skip(';')
  33974. 'undefined' == typeof e[i] && (e[i] = {}), (e[i][r] = o)
  33975. }),
  33976. (c._parseMessage = function (e, n) {
  33977. var r = !!n,
  33978. o = this.tn.next(),
  33979. a = {
  33980. name: '',
  33981. fields: [],
  33982. enums: [],
  33983. messages: [],
  33984. options: {},
  33985. services: [],
  33986. oneofs: {}
  33987. }
  33988. if (!t.NAME.test(o)) throw Error('illegal ' + (r ? 'group' : 'message') + ' name: ' + o)
  33989. for (
  33990. a.name = o, r && (this.tn.skip('='), (n.id = i(this.tn.next())), (a.isGroup = !0)), o = this.tn.peek(), '[' === o && n && this._parseFieldOptions(n), this.tn.skip('{');
  33991. '}' !== (o = this.tn.next());
  33992. )
  33993. if (t.RULE.test(o)) this._parseMessageField(a, o)
  33994. else if ('oneof' === o) this._parseMessageOneOf(a)
  33995. else if ('enum' === o) this._parseEnum(a)
  33996. else if ('message' === o) this._parseMessage(a)
  33997. else if ('option' === o) this._parseOption(a)
  33998. else if ('service' === o) this._parseService(a)
  33999. else if ('extensions' === o) a.extensions = this._parseExtensionRanges()
  34000. else if ('reserved' === o) this._parseIgnored()
  34001. else if ('extend' === o) this._parseExtend(a)
  34002. else {
  34003. if (!t.TYPEREF.test(o)) throw Error('illegal message token: ' + o)
  34004. if (!this.proto3) throw Error('illegal field rule: ' + o)
  34005. this._parseMessageField(a, 'optional', o)
  34006. }
  34007. return this.tn.omit(';'), e.messages.push(a), a
  34008. }),
  34009. (c._parseIgnored = function () {
  34010. for (; ';' !== this.tn.peek(); ) this.tn.next()
  34011. this.tn.skip(';')
  34012. }),
  34013. (c._parseMessageField = function (e, n, r) {
  34014. if (!t.RULE.test(n)) throw Error('illegal message field rule: ' + n)
  34015. var o,
  34016. a = {
  34017. rule: n,
  34018. type: '',
  34019. name: '',
  34020. options: {},
  34021. id: 0
  34022. }
  34023. if ('map' === n) {
  34024. if (r) throw Error('illegal type: ' + r)
  34025. if ((this.tn.skip('<'), (o = this.tn.next()), !t.TYPE.test(o) && !t.TYPEREF.test(o))) throw Error('illegal message field type: ' + o)
  34026. if (((a.keytype = o), this.tn.skip(','), (o = this.tn.next()), !t.TYPE.test(o) && !t.TYPEREF.test(o))) throw Error('illegal message field: ' + o)
  34027. if (((a.type = o), this.tn.skip('>'), (o = this.tn.next()), !t.NAME.test(o))) throw Error('illegal message field name: ' + o)
  34028. ;(a.name = o), this.tn.skip('='), (a.id = i(this.tn.next())), (o = this.tn.peek()), '[' === o && this._parseFieldOptions(a), this.tn.skip(';')
  34029. } else if (((r = 'undefined' != typeof r ? r : this.tn.next()), 'group' === r)) {
  34030. var s = this._parseMessage(e, a)
  34031. if (!/^[A-Z]/.test(s.name)) throw Error('illegal group name: ' + s.name)
  34032. ;(a.type = s.name), (a.name = s.name.toLowerCase()), this.tn.omit(';')
  34033. } else {
  34034. if (!t.TYPE.test(r) && !t.TYPEREF.test(r)) throw Error('illegal message field type: ' + r)
  34035. if (((a.type = r), (o = this.tn.next()), !t.NAME.test(o))) throw Error('illegal message field name: ' + o)
  34036. ;(a.name = o), this.tn.skip('='), (a.id = i(this.tn.next())), (o = this.tn.peek()), '[' === o && this._parseFieldOptions(a), this.tn.skip(';')
  34037. }
  34038. return e.fields.push(a), a
  34039. }),
  34040. (c._parseMessageOneOf = function (e) {
  34041. var i = this.tn.next()
  34042. if (!t.NAME.test(i)) throw Error('illegal oneof name: ' + i)
  34043. var n,
  34044. r = i,
  34045. o = []
  34046. for (this.tn.skip('{'); '}' !== (i = this.tn.next()); ) (n = this._parseMessageField(e, 'optional', i)), (n.oneof = r), o.push(n.id)
  34047. this.tn.omit(';'), (e.oneofs[r] = o)
  34048. }),
  34049. (c._parseFieldOptions = function (e) {
  34050. this.tn.skip('[')
  34051. for (var t, i = !0; ']' !== (t = this.tn.peek()); ) i || this.tn.skip(','), this._parseOption(e, !0), (i = !1)
  34052. this.tn.next()
  34053. }),
  34054. (c._parseEnum = function (e) {
  34055. var n = {
  34056. name: '',
  34057. values: [],
  34058. options: {}
  34059. },
  34060. r = this.tn.next()
  34061. if (!t.NAME.test(r)) throw Error('illegal name: ' + r)
  34062. for (n.name = r, this.tn.skip('{'); '}' !== (r = this.tn.next()); )
  34063. if ('option' === r) this._parseOption(n)
  34064. else {
  34065. if (!t.NAME.test(r)) throw Error('illegal name: ' + r)
  34066. this.tn.skip('=')
  34067. var o = {
  34068. name: r,
  34069. id: i(this.tn.next(), !0)
  34070. }
  34071. ;(r = this.tn.peek()),
  34072. '[' === r &&
  34073. this._parseFieldOptions({
  34074. options: {}
  34075. }),
  34076. this.tn.skip(';'),
  34077. n.values.push(o)
  34078. }
  34079. this.tn.omit(';'), e.enums.push(n)
  34080. }),
  34081. (c._parseExtensionRanges = function () {
  34082. var t,
  34083. i,
  34084. r,
  34085. o = []
  34086. do {
  34087. for (i = []; ; ) {
  34088. switch ((t = this.tn.next())) {
  34089. case 'min':
  34090. r = e.ID_MIN
  34091. break
  34092. case 'max':
  34093. r = e.ID_MAX
  34094. break
  34095. default:
  34096. r = n(t)
  34097. }
  34098. if ((i.push(r), 2 === i.length)) break
  34099. if ('to' !== this.tn.peek()) {
  34100. i.push(r)
  34101. break
  34102. }
  34103. this.tn.next()
  34104. }
  34105. o.push(i)
  34106. } while (this.tn.omit(','))
  34107. return this.tn.skip(';'), o
  34108. }),
  34109. (c._parseExtend = function (e) {
  34110. var i = this.tn.next()
  34111. if (!t.TYPEREF.test(i)) throw Error('illegal extend reference: ' + i)
  34112. var n = {
  34113. ref: i,
  34114. fields: []
  34115. }
  34116. for (this.tn.skip('{'); '}' !== (i = this.tn.next()); )
  34117. if (t.RULE.test(i)) this._parseMessageField(n, i)
  34118. else {
  34119. if (!t.TYPEREF.test(i)) throw Error('illegal extend token: ' + i)
  34120. if (!this.proto3) throw Error('illegal field rule: ' + i)
  34121. this._parseMessageField(n, 'optional', i)
  34122. }
  34123. return this.tn.omit(';'), e.messages.push(n), n
  34124. }),
  34125. (c.toString = function () {
  34126. return 'Parser at line ' + this.tn.line
  34127. }),
  34128. (o.Parser = l),
  34129. o
  34130. )
  34131. })(r, r.Lang)),
  34132. (r.Reflect = (function (e) {
  34133. function i(i) {
  34134. if (('string' == typeof i && (i = e.TYPES[i]), 'undefined' == typeof i.defaultValue)) throw Error('default value for type ' + i.name + ' is not supported')
  34135. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  34136. }
  34137. function n(t, i) {
  34138. if (t && 'number' == typeof t.low && 'number' == typeof t.high && 'boolean' == typeof t.unsigned && t.low === t.low && t.high === t.high)
  34139. return new e.Long(t.low, t.high, 'undefined' == typeof i ? t.unsigned : i)
  34140. if ('string' == typeof t) return e.Long.fromString(t, i || !1, 10)
  34141. if ('number' == typeof t) return e.Long.fromNumber(t, i || !1)
  34142. throw Error('not convertible to Long')
  34143. }
  34144. function r(t, i) {
  34145. var n = i.readVarint32(),
  34146. o = 7 & n,
  34147. a = n >>> 3
  34148. switch (o) {
  34149. case e.WIRE_TYPES.VARINT:
  34150. do n = i.readUint8()
  34151. while (128 === (128 & n))
  34152. break
  34153. case e.WIRE_TYPES.BITS64:
  34154. i.offset += 8
  34155. break
  34156. case e.WIRE_TYPES.LDELIM:
  34157. ;(n = i.readVarint32()), (i.offset += n)
  34158. break
  34159. case e.WIRE_TYPES.STARTGROUP:
  34160. r(a, i)
  34161. break
  34162. case e.WIRE_TYPES.ENDGROUP:
  34163. if (a === t) return !1
  34164. throw Error('Illegal GROUPEND after unknown group: ' + a + ' (' + t + ' expected)')
  34165. case e.WIRE_TYPES.BITS32:
  34166. i.offset += 4
  34167. break
  34168. default:
  34169. throw Error('Illegal wire type in unknown group ' + t + ': ' + o)
  34170. }
  34171. return !0
  34172. }
  34173. var o = {},
  34174. a = function (e, t, i) {
  34175. ;(this.builder = e), (this.parent = t), (this.name = i), this.className
  34176. },
  34177. s = a.prototype
  34178. ;(s.fqn = function () {
  34179. for (var e = this.name, t = this; ; ) {
  34180. if (((t = t.parent), null == t)) break
  34181. e = t.name + '.' + e
  34182. }
  34183. return e
  34184. }),
  34185. (s.toString = function (e) {
  34186. return (e ? this.className + ' ' : '') + this.fqn()
  34187. }),
  34188. (s.build = function () {
  34189. throw Error(this.toString(!0) + ' cannot be built directly')
  34190. }),
  34191. (o.T = a)
  34192. var l = function (e, t, i, n, r) {
  34193. a.call(this, e, t, i), (this.className = 'Namespace'), (this.children = []), (this.options = n || {}), (this.syntax = r || 'proto2')
  34194. },
  34195. c = (l.prototype = Object.create(a.prototype))
  34196. ;(c.getChildren = function (e) {
  34197. if (((e = e || null), null == e)) return this.children.slice()
  34198. for (var t = [], i = 0, n = this.children.length; i < n; ++i) this.children[i] instanceof e && t.push(this.children[i])
  34199. return t
  34200. }),
  34201. (c.addChild = function (e) {
  34202. var t
  34203. if ((t = this.getChild(e.name)))
  34204. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName)) t.name = t.originalName
  34205. else {
  34206. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  34207. throw Error('Duplicate name in namespace ' + this.toString(!0) + ': ' + e.name)
  34208. e.name = e.originalName
  34209. }
  34210. this.children.push(e)
  34211. }),
  34212. (c.getChild = function (e) {
  34213. for (var t = 'number' == typeof e ? 'id' : 'name', i = 0, n = this.children.length; i < n; ++i) if (this.children[i][t] === e) return this.children[i]
  34214. return null
  34215. }),
  34216. (c.resolve = function (e, t) {
  34217. var i = 'string' == typeof e ? e.split('.') : e,
  34218. n = this,
  34219. r = 0
  34220. if ('' === i[r]) {
  34221. for (; null !== n.parent; ) n = n.parent
  34222. r++
  34223. }
  34224. var a
  34225. do {
  34226. do {
  34227. if (!(n instanceof o.Namespace)) {
  34228. n = null
  34229. break
  34230. }
  34231. if (((a = n.getChild(i[r])), !a || !(a instanceof o.T) || (t && !(a instanceof o.Namespace)))) {
  34232. n = null
  34233. break
  34234. }
  34235. ;(n = a), r++
  34236. } while (r < i.length)
  34237. if (null != n) break
  34238. if (null !== this.parent) return this.parent.resolve(e, t)
  34239. } while (null != n)
  34240. return n
  34241. }),
  34242. (c.qn = function (e) {
  34243. var t = [],
  34244. i = e
  34245. do t.unshift(i.name), (i = i.parent)
  34246. while (null !== i)
  34247. for (var n = 1; n <= t.length; n++) {
  34248. var r = t.slice(t.length - n)
  34249. if (e === this.resolve(r, e instanceof o.Namespace)) return r.join('.')
  34250. }
  34251. return e.fqn()
  34252. }),
  34253. (c.build = function () {
  34254. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n) (e = i[n]), e instanceof l && (t[e.name] = e.build())
  34255. return (
  34256. Object.defineProperty &&
  34257. Object.defineProperty(t, '$options', {
  34258. value: this.buildOpt()
  34259. }),
  34260. t
  34261. )
  34262. }),
  34263. (c.buildOpt = function () {
  34264. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  34265. var r = t[i],
  34266. o = this.options[t[i]]
  34267. e[r] = o
  34268. }
  34269. return e
  34270. }),
  34271. (c.getOption = function (e) {
  34272. return 'undefined' == typeof e ? this.options : 'undefined' != typeof this.options[e] ? this.options[e] : null
  34273. }),
  34274. (o.Namespace = l)
  34275. var h = function (t, i, n, r) {
  34276. if (((this.type = t), (this.resolvedType = i), (this.isMapKey = n), (this.syntax = r), n && e.MAP_KEY_TYPES.indexOf(t) < 0)) throw Error('Invalid map key type: ' + t.name)
  34277. },
  34278. u = h.prototype
  34279. ;(h.defaultFieldValue = i),
  34280. (u.verifyValue = function (i) {
  34281. function r(e, t) {
  34282. throw Error('Illegal value for ' + o.toString(!0) + ' of type ' + o.type.name + ': ' + e + ' (' + t + ')')
  34283. }
  34284. var o = this
  34285. switch (this.type) {
  34286. case e.TYPES.int32:
  34287. case e.TYPES.sint32:
  34288. case e.TYPES.sfixed32:
  34289. return ('number' != typeof i || (i === i && i % 1 !== 0)) && r(typeof i, 'not an integer'), i > 4294967295 ? 0 | i : i
  34290. case e.TYPES.uint32:
  34291. case e.TYPES.fixed32:
  34292. return ('number' != typeof i || (i === i && i % 1 !== 0)) && r(typeof i, 'not an integer'), i < 0 ? i >>> 0 : i
  34293. case e.TYPES.int64:
  34294. case e.TYPES.sint64:
  34295. case e.TYPES.sfixed64:
  34296. if (e.Long)
  34297. try {
  34298. return n(i, !1)
  34299. } catch (e) {
  34300. r(typeof i, e.message)
  34301. }
  34302. else r(typeof i, 'requires Long.js')
  34303. case e.TYPES.uint64:
  34304. case e.TYPES.fixed64:
  34305. if (e.Long)
  34306. try {
  34307. return n(i, !0)
  34308. } catch (e) {
  34309. r(typeof i, e.message)
  34310. }
  34311. else r(typeof i, 'requires Long.js')
  34312. case e.TYPES.bool:
  34313. return 'boolean' != typeof i && r(typeof i, 'not a boolean'), i
  34314. case e.TYPES.float:
  34315. case e.TYPES.double:
  34316. return 'number' != typeof i && r(typeof i, 'not a number'), i
  34317. case e.TYPES.string:
  34318. return 'string' == typeof i || (i && i instanceof String) || r(typeof i, 'not a string'), '' + i
  34319. case e.TYPES.bytes:
  34320. return t.isByteBuffer(i) ? i : t.wrap(i, 'base64')
  34321. case e.TYPES.enum:
  34322. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value)
  34323. for (l = 0; l < a.length; l++) {
  34324. if (a[l].name == i) return a[l].id
  34325. if (a[l].id == i) return a[l].id
  34326. }
  34327. if ('proto3' === this.syntax)
  34328. return ('number' != typeof i || (i === i && i % 1 !== 0)) && r(typeof i, 'not an integer'), (i > 4294967295 || i < 0) && r(typeof i, 'not in range for uint32'), i
  34329. r(i, 'not a valid enum value')
  34330. case e.TYPES.group:
  34331. case e.TYPES.message:
  34332. if (((i && 'object' == typeof i) || r(typeof i, 'object expected'), i instanceof this.resolvedType.clazz)) return i
  34333. if (i instanceof e.Builder.Message) {
  34334. var s = {}
  34335. for (var l in i) i.hasOwnProperty(l) && (s[l] = i[l])
  34336. i = s
  34337. }
  34338. return new this.resolvedType.clazz(i)
  34339. }
  34340. throw Error('[INTERNAL] Illegal value for ' + this.toString(!0) + ': ' + i + ' (undefined type ' + this.type + ')')
  34341. }),
  34342. (u.calculateLength = function (i, n) {
  34343. if (null === n) return 0
  34344. var r
  34345. switch (this.type) {
  34346. case e.TYPES.int32:
  34347. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n)
  34348. case e.TYPES.uint32:
  34349. return t.calculateVarint32(n)
  34350. case e.TYPES.sint32:
  34351. return t.calculateVarint32(t.zigZagEncode32(n))
  34352. case e.TYPES.fixed32:
  34353. case e.TYPES.sfixed32:
  34354. case e.TYPES.float:
  34355. return 4
  34356. case e.TYPES.int64:
  34357. case e.TYPES.uint64:
  34358. return t.calculateVarint64(n)
  34359. case e.TYPES.sint64:
  34360. return t.calculateVarint64(t.zigZagEncode64(n))
  34361. case e.TYPES.fixed64:
  34362. case e.TYPES.sfixed64:
  34363. return 8
  34364. case e.TYPES.bool:
  34365. return 1
  34366. case e.TYPES.enum:
  34367. return t.calculateVarint32(n)
  34368. case e.TYPES.double:
  34369. return 8
  34370. case e.TYPES.string:
  34371. return (r = t.calculateUTF8Bytes(n)), t.calculateVarint32(r) + r
  34372. case e.TYPES.bytes:
  34373. if (n.remaining() < 0) throw Error('Illegal value for ' + this.toString(!0) + ': ' + n.remaining() + ' bytes remaining')
  34374. return t.calculateVarint32(n.remaining()) + n.remaining()
  34375. case e.TYPES.message:
  34376. return (r = this.resolvedType.calculate(n)), t.calculateVarint32(r) + r
  34377. case e.TYPES.group:
  34378. return (r = this.resolvedType.calculate(n)), r + t.calculateVarint32((i << 3) | e.WIRE_TYPES.ENDGROUP)
  34379. }
  34380. throw Error('[INTERNAL] Illegal value to encode in ' + this.toString(!0) + ': ' + n + ' (unknown type)')
  34381. }),
  34382. (u.encodeValue = function (i, n, r) {
  34383. if (null === n) return r
  34384. switch (this.type) {
  34385. case e.TYPES.int32:
  34386. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n)
  34387. break
  34388. case e.TYPES.uint32:
  34389. r.writeVarint32(n)
  34390. break
  34391. case e.TYPES.sint32:
  34392. r.writeVarint32ZigZag(n)
  34393. break
  34394. case e.TYPES.fixed32:
  34395. r.writeUint32(n)
  34396. break
  34397. case e.TYPES.sfixed32:
  34398. r.writeInt32(n)
  34399. break
  34400. case e.TYPES.int64:
  34401. case e.TYPES.uint64:
  34402. r.writeVarint64(n)
  34403. break
  34404. case e.TYPES.sint64:
  34405. r.writeVarint64ZigZag(n)
  34406. break
  34407. case e.TYPES.fixed64:
  34408. r.writeUint64(n)
  34409. break
  34410. case e.TYPES.sfixed64:
  34411. r.writeInt64(n)
  34412. break
  34413. case e.TYPES.bool:
  34414. 'string' == typeof n ? r.writeVarint32('false' === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0)
  34415. break
  34416. case e.TYPES.enum:
  34417. r.writeVarint32(n)
  34418. break
  34419. case e.TYPES.float:
  34420. r.writeFloat32(n)
  34421. break
  34422. case e.TYPES.double:
  34423. r.writeFloat64(n)
  34424. break
  34425. case e.TYPES.string:
  34426. r.writeVString(n)
  34427. break
  34428. case e.TYPES.bytes:
  34429. if (n.remaining() < 0) throw Error('Illegal value for ' + this.toString(!0) + ': ' + n.remaining() + ' bytes remaining')
  34430. var o = n.offset
  34431. r.writeVarint32(n.remaining()), r.append(n), (n.offset = o)
  34432. break
  34433. case e.TYPES.message:
  34434. var a = new t().LE()
  34435. this.resolvedType.encode(n, a), r.writeVarint32(a.offset), r.append(a.flip())
  34436. break
  34437. case e.TYPES.group:
  34438. this.resolvedType.encode(n, r), r.writeVarint32((i << 3) | e.WIRE_TYPES.ENDGROUP)
  34439. break
  34440. default:
  34441. throw Error('[INTERNAL] Illegal value to encode in ' + this.toString(!0) + ': ' + n + ' (unknown type)')
  34442. }
  34443. return r
  34444. }),
  34445. (u.decode = function (t, i, n) {
  34446. if (i != this.type.wireType) throw Error('Unexpected wire type for element')
  34447. var r, o
  34448. switch (this.type) {
  34449. case e.TYPES.int32:
  34450. return 0 | t.readVarint32()
  34451. case e.TYPES.uint32:
  34452. return t.readVarint32() >>> 0
  34453. case e.TYPES.sint32:
  34454. return 0 | t.readVarint32ZigZag()
  34455. case e.TYPES.fixed32:
  34456. return t.readUint32() >>> 0
  34457. case e.TYPES.sfixed32:
  34458. return 0 | t.readInt32()
  34459. case e.TYPES.int64:
  34460. return t.readVarint64()
  34461. case e.TYPES.uint64:
  34462. return t.readVarint64().toUnsigned()
  34463. case e.TYPES.sint64:
  34464. return t.readVarint64ZigZag()
  34465. case e.TYPES.fixed64:
  34466. return t.readUint64()
  34467. case e.TYPES.sfixed64:
  34468. return t.readInt64()
  34469. case e.TYPES.bool:
  34470. return !!t.readVarint32()
  34471. case e.TYPES.enum:
  34472. return t.readVarint32()
  34473. case e.TYPES.float:
  34474. return t.readFloat()
  34475. case e.TYPES.double:
  34476. return t.readDouble()
  34477. case e.TYPES.string:
  34478. return t.readVString()
  34479. case e.TYPES.bytes:
  34480. if (((o = t.readVarint32()), t.remaining() < o)) throw Error('Illegal number of bytes for ' + this.toString(!0) + ': ' + o + ' required but got only ' + t.remaining())
  34481. return (r = t.clone()), (r.limit = r.offset + o), (t.offset += o), r
  34482. case e.TYPES.message:
  34483. return (o = t.readVarint32()), this.resolvedType.decode(t, o)
  34484. case e.TYPES.group:
  34485. return this.resolvedType.decode(t, -1, n)
  34486. }
  34487. throw Error('[INTERNAL] Illegal decode type')
  34488. }),
  34489. (u.valueFromString = function (i) {
  34490. if (!this.isMapKey) throw Error('valueFromString() called on non-map-key element')
  34491. switch (this.type) {
  34492. case e.TYPES.int32:
  34493. case e.TYPES.sint32:
  34494. case e.TYPES.sfixed32:
  34495. case e.TYPES.uint32:
  34496. case e.TYPES.fixed32:
  34497. return this.verifyValue(parseInt(i))
  34498. case e.TYPES.int64:
  34499. case e.TYPES.sint64:
  34500. case e.TYPES.sfixed64:
  34501. case e.TYPES.uint64:
  34502. case e.TYPES.fixed64:
  34503. return this.verifyValue(i)
  34504. case e.TYPES.bool:
  34505. return 'true' === i
  34506. case e.TYPES.string:
  34507. return this.verifyValue(i)
  34508. case e.TYPES.bytes:
  34509. return t.fromBinary(i)
  34510. }
  34511. }),
  34512. (u.valueToString = function (t) {
  34513. if (!this.isMapKey) throw Error('valueToString() called on non-map-key element')
  34514. return this.type === e.TYPES.bytes ? t.toString('binary') : t.toString()
  34515. }),
  34516. (o.Element = h)
  34517. var d = function (e, t, i, n, r, o) {
  34518. l.call(this, e, t, i, n, o),
  34519. (this.className = 'Message'),
  34520. (this.extensions = void 0),
  34521. (this.clazz = null),
  34522. (this.isGroup = !!r),
  34523. (this._fields = null),
  34524. (this._fieldsById = null),
  34525. (this._fieldsByName = null)
  34526. },
  34527. p = (d.prototype = Object.create(l.prototype))
  34528. ;(p.build = function (i) {
  34529. if (this.clazz && !i) return this.clazz
  34530. var n = (function (e, i) {
  34531. function n(i, r, o, a) {
  34532. if (null === i || 'object' != typeof i) {
  34533. if (a && a instanceof e.Reflect.Enum) {
  34534. var s = e.Reflect.Enum.getName(a.object, i)
  34535. if (null !== s) return s
  34536. }
  34537. return i
  34538. }
  34539. if (t.isByteBuffer(i)) return r ? i.toBase64() : i.toBuffer()
  34540. if (e.Long.isLong(i)) return o ? i.toString() : e.Long.fromValue(i)
  34541. var l
  34542. if (Array.isArray(i))
  34543. return (
  34544. (l = []),
  34545. i.forEach(function (e, t) {
  34546. l[t] = n(e, r, o, a)
  34547. }),
  34548. l
  34549. )
  34550. if (((l = {}), i instanceof e.Map)) {
  34551. for (var c = i.entries(), h = c.next(); !h.done; h = c.next()) l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType)
  34552. return l
  34553. }
  34554. var u = i.$type,
  34555. d = void 0
  34556. for (var p in i) i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? (l[p] = n(i[p], r, o, d.resolvedType)) : (l[p] = n(i[p], r, o)))
  34557. return l
  34558. }
  34559. var r = i.getChildren(e.Reflect.Message.Field),
  34560. o = i.getChildren(e.Reflect.Message.OneOf),
  34561. a = function (n, s) {
  34562. e.Builder.Message.call(this)
  34563. for (var l = 0, c = o.length; l < c; ++l) this[o[l].name] = null
  34564. for (l = 0, c = r.length; l < c; ++l) {
  34565. var h = r[l]
  34566. ;(this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null), (!h.required && 'proto3' !== i.syntax) || null === h.defaultValue || (this[h.name] = h.defaultValue)
  34567. }
  34568. if (arguments.length > 0) {
  34569. var u
  34570. if (
  34571. 1 !== arguments.length ||
  34572. null === n ||
  34573. 'object' != typeof n ||
  34574. !('function' != typeof n.encode || n instanceof a) ||
  34575. Array.isArray(n) ||
  34576. n instanceof e.Map ||
  34577. t.isByteBuffer(n) ||
  34578. n instanceof ArrayBuffer ||
  34579. (e.Long && n instanceof e.Long)
  34580. )
  34581. for (l = 0, c = arguments.length; l < c; ++l) 'undefined' != typeof (u = arguments[l]) && this.$set(r[l].name, u)
  34582. else this.$set(n)
  34583. }
  34584. },
  34585. s = (a.prototype = Object.create(e.Builder.Message.prototype))
  34586. ;(s.add = function (t, n, r) {
  34587. var o = i._fieldsByName[t]
  34588. if (!r) {
  34589. if (!o) throw Error(this + '#' + t + ' is undefined')
  34590. if (!(o instanceof e.Reflect.Message.Field)) throw Error(this + '#' + t + ' is not a field: ' + o.toString(!0))
  34591. if (!o.repeated) throw Error(this + '#' + t + ' is not a repeated field')
  34592. n = o.verifyValue(n, !0)
  34593. }
  34594. return null === this[t] && (this[t] = []), this[t].push(n), this
  34595. }),
  34596. (s.$add = s.add),
  34597. (s.set = function (t, n, r) {
  34598. if (t && 'object' == typeof t) {
  34599. r = n
  34600. for (var o in t) t.hasOwnProperty(o) && 'undefined' != typeof (n = t[o]) && this.$set(o, n, r)
  34601. return this
  34602. }
  34603. var a = i._fieldsByName[t]
  34604. if (r) this[t] = n
  34605. else {
  34606. if (!a) throw Error(this + '#' + t + ' is not a field: undefined')
  34607. if (!(a instanceof e.Reflect.Message.Field)) throw Error(this + '#' + t + ' is not a field: ' + a.toString(!0))
  34608. this[a.name] = n = a.verifyValue(n)
  34609. }
  34610. if (a && a.oneof) {
  34611. var s = this[a.oneof.name]
  34612. null !== n ? (null !== s && s !== a.name && (this[s] = null), (this[a.oneof.name] = a.name)) : s === t && (this[a.oneof.name] = null)
  34613. }
  34614. return this
  34615. }),
  34616. (s.$set = s.set),
  34617. (s.get = function (t, n) {
  34618. if (n) return this[t]
  34619. var r = i._fieldsByName[t]
  34620. if (!(r && r instanceof e.Reflect.Message.Field)) throw Error(this + '#' + t + ' is not a field: undefined')
  34621. if (!(r instanceof e.Reflect.Message.Field)) throw Error(this + '#' + t + ' is not a field: ' + r.toString(!0))
  34622. return this[r.name]
  34623. }),
  34624. (s.$get = s.get)
  34625. for (var l = 0; l < r.length; l++) {
  34626. var c = r[l]
  34627. c instanceof e.Reflect.Message.ExtensionField ||
  34628. (i.builder.options.populateAccessors &&
  34629. (function (e) {
  34630. var t = e.originalName.replace(/(_[a-zA-Z])/g, function (e) {
  34631. return e.toUpperCase().replace('_', '')
  34632. })
  34633. t = t.substring(0, 1).toUpperCase() + t.substring(1)
  34634. var n = e.originalName.replace(/([A-Z])/g, function (e) {
  34635. return '_' + e
  34636. }),
  34637. r = function (t, i) {
  34638. return (this[e.name] = i ? t : e.verifyValue(t)), this
  34639. },
  34640. o = function () {
  34641. return this[e.name]
  34642. }
  34643. null === i.getChild('set' + t) && (s['set' + t] = r),
  34644. null === i.getChild('set_' + n) && (s['set_' + n] = r),
  34645. null === i.getChild('get' + t) && (s['get' + t] = o),
  34646. null === i.getChild('get_' + n) && (s['get_' + n] = o)
  34647. })(c))
  34648. }
  34649. ;(s.encode = function (e, n) {
  34650. 'boolean' == typeof e && ((n = e), (e = void 0))
  34651. var r = !1
  34652. e || ((e = new t()), (r = !0))
  34653. var o = e.littleEndian
  34654. try {
  34655. return i.encode(this, e.LE(), n), (r ? e.flip() : e).LE(o)
  34656. } catch (t) {
  34657. throw (e.LE(o), t)
  34658. }
  34659. }),
  34660. (a.encode = function (e, t, i) {
  34661. return new a(e).encode(t, i)
  34662. }),
  34663. (s.calculate = function () {
  34664. return i.calculate(this)
  34665. }),
  34666. (s.encodeDelimited = function (e, n) {
  34667. var r = !1
  34668. e || ((e = new t()), (r = !0))
  34669. var o = new t().LE()
  34670. return i.encode(this, o, n).flip(), e.writeVarint32(o.remaining()), e.append(o), r ? e.flip() : e
  34671. }),
  34672. (s.encodeAB = function () {
  34673. try {
  34674. return this.encode().toArrayBuffer()
  34675. } catch (e) {
  34676. throw (e.encoded && (e.encoded = e.encoded.toArrayBuffer()), e)
  34677. }
  34678. }),
  34679. (s.toArrayBuffer = s.encodeAB),
  34680. (s.encodeNB = function () {
  34681. try {
  34682. return this.encode().toBuffer()
  34683. } catch (e) {
  34684. throw (e.encoded && (e.encoded = e.encoded.toBuffer()), e)
  34685. }
  34686. }),
  34687. (s.toBuffer = s.encodeNB),
  34688. (s.encode64 = function () {
  34689. try {
  34690. return this.encode().toBase64()
  34691. } catch (e) {
  34692. throw (e.encoded && (e.encoded = e.encoded.toBase64()), e)
  34693. }
  34694. }),
  34695. (s.toBase64 = s.encode64),
  34696. (s.encodeHex = function () {
  34697. try {
  34698. return this.encode().toHex()
  34699. } catch (e) {
  34700. throw (e.encoded && (e.encoded = e.encoded.toHex()), e)
  34701. }
  34702. }),
  34703. (s.toHex = s.encodeHex),
  34704. (s.toRaw = function (e, t) {
  34705. return n(this, !!e, !!t, this.$type)
  34706. }),
  34707. (s.encodeJSON = function () {
  34708. return JSON.stringify(n(this, !0, !0, this.$type))
  34709. }),
  34710. (a.decode = function (e, n, r) {
  34711. 'string' == typeof n && ((r = n), (n = -1)), 'string' == typeof e && (e = t.wrap(e, r ? r : 'base64')), (e = t.isByteBuffer(e) ? e : t.wrap(e))
  34712. var o = e.littleEndian
  34713. try {
  34714. var a = i.decode(e.LE())
  34715. return e.LE(o), a
  34716. } catch (t) {
  34717. throw (e.LE(o), t)
  34718. }
  34719. }),
  34720. (a.decodeDelimited = function (e, n) {
  34721. if (('string' == typeof e && (e = t.wrap(e, n ? n : 'base64')), (e = t.isByteBuffer(e) ? e : t.wrap(e)), e.remaining() < 1)) return null
  34722. var r = e.offset,
  34723. o = e.readVarint32()
  34724. if (e.remaining() < o) return (e.offset = r), null
  34725. try {
  34726. var a = i.decode(e.slice(e.offset, e.offset + o).LE())
  34727. return (e.offset += o), a
  34728. } catch (t) {
  34729. throw ((e.offset += o), t)
  34730. }
  34731. }),
  34732. (a.decode64 = function (e) {
  34733. return a.decode(e, 'base64')
  34734. }),
  34735. (a.decodeHex = function (e) {
  34736. return a.decode(e, 'hex')
  34737. }),
  34738. (a.decodeJSON = function (e) {
  34739. return new a(JSON.parse(e))
  34740. }),
  34741. (s.toString = function () {
  34742. return i.toString()
  34743. })
  34744. return (
  34745. Object.defineProperty &&
  34746. (Object.defineProperty(a, '$options', {
  34747. value: i.buildOpt()
  34748. }),
  34749. Object.defineProperty(s, '$options', {
  34750. value: a.$options
  34751. }),
  34752. Object.defineProperty(a, '$type', {
  34753. value: i
  34754. }),
  34755. Object.defineProperty(s, '$type', {
  34756. value: i
  34757. })),
  34758. a
  34759. )
  34760. })(e, this)
  34761. ;(this._fields = []), (this._fieldsById = {}), (this._fieldsByName = {})
  34762. for (var r, o = 0, a = this.children.length; o < a; o++)
  34763. if (((r = this.children[o]), r instanceof A || r instanceof d || r instanceof E)) {
  34764. if (n.hasOwnProperty(r.name)) throw Error('Illegal reflect child of ' + this.toString(!0) + ': ' + r.toString(!0) + " cannot override static property '" + r.name + "'")
  34765. n[r.name] = r.build()
  34766. } else if (r instanceof d.Field) r.build(), this._fields.push(r), (this._fieldsById[r.id] = r), (this._fieldsByName[r.name] = r)
  34767. else if (!(r instanceof d.OneOf || r instanceof I)) throw Error('Illegal reflect child of ' + this.toString(!0) + ': ' + this.children[o].toString(!0))
  34768. return (this.clazz = n)
  34769. }),
  34770. (p.encode = function (e, t, i) {
  34771. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  34772. (n = this._fields[a]), (r = e[n.name]), n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e)
  34773. if (null !== o) {
  34774. var l = Error('Missing at least one required field for ' + this.toString(!0) + ': ' + o)
  34775. throw ((l.encoded = t), l)
  34776. }
  34777. return t
  34778. }),
  34779. (p.calculate = function (e) {
  34780. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  34781. if (((t = this._fields[r]), (i = e[t.name]), t.required && null === i)) throw Error('Missing at least one required field for ' + this.toString(!0) + ': ' + t)
  34782. n += t.calculate(i, e)
  34783. }
  34784. return n
  34785. }),
  34786. (p.decode = function (t, i, n) {
  34787. i = 'number' == typeof i ? i : -1
  34788. for (var o, a, s, l, c = t.offset, h = new this.clazz(); t.offset < c + i || (i === -1 && t.remaining() > 0); ) {
  34789. if (((o = t.readVarint32()), (a = 7 & o), (s = o >>> 3), a === e.WIRE_TYPES.ENDGROUP)) {
  34790. if (s !== n) throw Error('Illegal group end indicator for ' + this.toString(!0) + ': ' + s + ' (' + (n ? n + ' expected' : 'not a group') + ')')
  34791. break
  34792. }
  34793. if ((l = this._fieldsById[s])) {
  34794. if (l.repeated && !l.options.packed) h[l.name].push(l.decode(a, t))
  34795. else if (l.map) {
  34796. var u = l.decode(a, t)
  34797. h[l.name].set(u[0], u[1])
  34798. } else if (((h[l.name] = l.decode(a, t)), l.oneof)) {
  34799. var d = h[l.oneof.name]
  34800. null !== d && d !== l.name && (h[d] = null), (h[l.oneof.name] = l.name)
  34801. }
  34802. } else
  34803. switch (a) {
  34804. case e.WIRE_TYPES.VARINT:
  34805. t.readVarint32()
  34806. break
  34807. case e.WIRE_TYPES.BITS32:
  34808. t.offset += 4
  34809. break
  34810. case e.WIRE_TYPES.BITS64:
  34811. t.offset += 8
  34812. break
  34813. case e.WIRE_TYPES.LDELIM:
  34814. var p = t.readVarint32()
  34815. t.offset += p
  34816. break
  34817. case e.WIRE_TYPES.STARTGROUP:
  34818. for (; r(s, t); );
  34819. break
  34820. default:
  34821. throw Error('Illegal wire type for unknown field ' + s + ' in ' + this.toString(!0) + '#decode: ' + a)
  34822. }
  34823. }
  34824. for (var f = 0, g = this._fields.length; f < g; ++f)
  34825. if (((l = this._fields[f]), null === h[l.name]))
  34826. if ('proto3' === this.syntax) h[l.name] = l.defaultValue
  34827. else {
  34828. if (l.required) {
  34829. var m = Error('Missing at least one required field for ' + this.toString(!0) + ': ' + l.name)
  34830. throw ((m.decoded = h), m)
  34831. }
  34832. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  34833. }
  34834. return h
  34835. }),
  34836. (o.Message = d)
  34837. var f = function (t, i, n, r, o, s, l, c, h, u) {
  34838. a.call(this, t, i, s),
  34839. (this.className = 'Message.Field'),
  34840. (this.required = 'required' === n),
  34841. (this.repeated = 'repeated' === n),
  34842. (this.map = 'map' === n),
  34843. (this.keyType = r || null),
  34844. (this.type = o),
  34845. (this.resolvedType = null),
  34846. (this.id = l),
  34847. (this.options = c || {}),
  34848. (this.defaultValue = null),
  34849. (this.oneof = h || null),
  34850. (this.syntax = u || 'proto2'),
  34851. (this.originalName = this.name),
  34852. (this.element = null),
  34853. (this.keyElement = null),
  34854. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  34855. },
  34856. g = (f.prototype = Object.create(a.prototype))
  34857. ;(g.build = function () {
  34858. ;(this.element = new h(this.type, this.resolvedType, !1, this.syntax)),
  34859. this.map && (this.keyElement = new h(this.keyType, void 0, !0, this.syntax)),
  34860. 'proto3' !== this.syntax || this.repeated || this.map
  34861. ? 'undefined' != typeof this.options.default && (this.defaultValue = this.verifyValue(this.options.default))
  34862. : (this.defaultValue = h.defaultFieldValue(this.type))
  34863. }),
  34864. (g.verifyValue = function (t, i) {
  34865. function n(e, t) {
  34866. throw Error('Illegal value for ' + r.toString(!0) + ' of type ' + r.type.name + ': ' + e + ' (' + t + ')')
  34867. }
  34868. i = i || !1
  34869. var r = this
  34870. if (null === t)
  34871. return (
  34872. this.required && n(typeof t, 'required'), 'proto3' === this.syntax && this.type !== e.TYPES.message && n(typeof t, 'proto3 field without field presence cannot be null'), null
  34873. )
  34874. var o
  34875. if (this.repeated && !i) {
  34876. Array.isArray(t) || (t = [t])
  34877. var a = []
  34878. for (o = 0; o < t.length; o++) a.push(this.element.verifyValue(t[o]))
  34879. return a
  34880. }
  34881. return this.map && !i
  34882. ? t instanceof e.Map
  34883. ? t
  34884. : (t instanceof Object || n(typeof t, 'expected ProtoBuf.Map or raw object for map field'), new e.Map(this, t))
  34885. : (!this.repeated && Array.isArray(t) && n(typeof t, 'no array expected'), this.element.verifyValue(t))
  34886. }),
  34887. (g.hasWirePresence = function (t, i) {
  34888. if ('proto3' !== this.syntax) return null !== t
  34889. if (this.oneof && i[this.oneof.name] === this.name) return !0
  34890. switch (this.type) {
  34891. case e.TYPES.int32:
  34892. case e.TYPES.sint32:
  34893. case e.TYPES.sfixed32:
  34894. case e.TYPES.uint32:
  34895. case e.TYPES.fixed32:
  34896. return 0 !== t
  34897. case e.TYPES.int64:
  34898. case e.TYPES.sint64:
  34899. case e.TYPES.sfixed64:
  34900. case e.TYPES.uint64:
  34901. case e.TYPES.fixed64:
  34902. return 0 !== t.low || 0 !== t.high
  34903. case e.TYPES.bool:
  34904. return t
  34905. case e.TYPES.float:
  34906. case e.TYPES.double:
  34907. return 0 !== t
  34908. case e.TYPES.string:
  34909. return t.length > 0
  34910. case e.TYPES.bytes:
  34911. return t.remaining() > 0
  34912. case e.TYPES.enum:
  34913. return 0 !== t
  34914. case e.TYPES.message:
  34915. return null !== t
  34916. default:
  34917. return !0
  34918. }
  34919. }),
  34920. (g.encode = function (i, n, r) {
  34921. if (null === this.type || 'object' != typeof this.type) throw Error('[INTERNAL] Unresolved type in ' + this.toString(!0) + ': ' + this.type)
  34922. if (null === i || (this.repeated && 0 == i.length)) return n
  34923. try {
  34924. if (this.repeated) {
  34925. var o
  34926. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  34927. n.writeVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM), n.ensureCapacity((n.offset += 1))
  34928. var a = n.offset
  34929. for (o = 0; o < i.length; o++) this.element.encodeValue(this.id, i[o], n)
  34930. var s = n.offset - a,
  34931. l = t.calculateVarint32(s)
  34932. if (l > 1) {
  34933. var c = n.slice(a, n.offset)
  34934. ;(a += l - 1), (n.offset = a), n.append(c)
  34935. }
  34936. n.writeVarint32(s, a - l)
  34937. } else for (o = 0; o < i.length; o++) n.writeVarint32((this.id << 3) | this.type.wireType), this.element.encodeValue(this.id, i[o], n)
  34938. } else
  34939. this.map
  34940. ? i.forEach(function (i, r, o) {
  34941. var a =
  34942. t.calculateVarint32(8 | this.keyType.wireType) +
  34943. this.keyElement.calculateLength(1, r) +
  34944. t.calculateVarint32(16 | this.type.wireType) +
  34945. this.element.calculateLength(2, i)
  34946. n.writeVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM),
  34947. n.writeVarint32(a),
  34948. n.writeVarint32(8 | this.keyType.wireType),
  34949. this.keyElement.encodeValue(1, r, n),
  34950. n.writeVarint32(16 | this.type.wireType),
  34951. this.element.encodeValue(2, i, n)
  34952. }, this)
  34953. : this.hasWirePresence(i, r) && (n.writeVarint32((this.id << 3) | this.type.wireType), this.element.encodeValue(this.id, i, n))
  34954. } catch (e) {
  34955. throw Error('Illegal value for ' + this.toString(!0) + ': ' + i + ' (' + e + ')')
  34956. }
  34957. return n
  34958. }),
  34959. (g.calculate = function (i, n) {
  34960. if (((i = this.verifyValue(i)), null === this.type || 'object' != typeof this.type)) throw Error('[INTERNAL] Unresolved type in ' + this.toString(!0) + ': ' + this.type)
  34961. if (null === i || (this.repeated && 0 == i.length)) return 0
  34962. var r = 0
  34963. try {
  34964. if (this.repeated) {
  34965. var o, a
  34966. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  34967. for (r += t.calculateVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM), a = 0, o = 0; o < i.length; o++) a += this.element.calculateLength(this.id, i[o])
  34968. ;(r += t.calculateVarint32(a)), (r += a)
  34969. } else for (o = 0; o < i.length; o++) (r += t.calculateVarint32((this.id << 3) | this.type.wireType)), (r += this.element.calculateLength(this.id, i[o]))
  34970. } else
  34971. this.map
  34972. ? i.forEach(function (i, n, o) {
  34973. var a =
  34974. t.calculateVarint32(8 | this.keyType.wireType) +
  34975. this.keyElement.calculateLength(1, n) +
  34976. t.calculateVarint32(16 | this.type.wireType) +
  34977. this.element.calculateLength(2, i)
  34978. ;(r += t.calculateVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM)), (r += t.calculateVarint32(a)), (r += a)
  34979. }, this)
  34980. : this.hasWirePresence(i, n) && ((r += t.calculateVarint32((this.id << 3) | this.type.wireType)), (r += this.element.calculateLength(this.id, i)))
  34981. } catch (e) {
  34982. throw Error('Illegal value for ' + this.toString(!0) + ': ' + i + ' (' + e + ')')
  34983. }
  34984. return r
  34985. }),
  34986. (g.decode = function (t, i, n) {
  34987. var r,
  34988. o,
  34989. a = (!this.map && t == this.type.wireType) || (!n && this.repeated && this.options.packed && t == e.WIRE_TYPES.LDELIM) || (this.map && t == e.WIRE_TYPES.LDELIM)
  34990. if (!a) throw Error('Illegal wire type for field ' + this.toString(!0) + ': ' + t + ' (' + this.type.wireType + ' expected)')
  34991. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  34992. ;(o = i.readVarint32()), (o = i.offset + o)
  34993. for (var s = []; i.offset < o; ) s.push(this.decode(this.type.wireType, i, !0))
  34994. return s
  34995. }
  34996. if (this.map) {
  34997. var l = h.defaultFieldValue(this.keyType)
  34998. if (((r = h.defaultFieldValue(this.type)), (o = i.readVarint32()), i.remaining() < o))
  34999. throw Error('Illegal number of bytes for ' + this.toString(!0) + ': ' + o + ' required but got only ' + i.remaining())
  35000. var c = i.clone()
  35001. for (c.limit = c.offset + o, i.offset += o; c.remaining() > 0; ) {
  35002. var u = c.readVarint32()
  35003. t = 7 & u
  35004. var d = u >>> 3
  35005. if (1 === d) l = this.keyElement.decode(c, t, d)
  35006. else {
  35007. if (2 !== d) throw Error('Unexpected tag in map field key/value submessage')
  35008. r = this.element.decode(c, t, d)
  35009. }
  35010. }
  35011. return [l, r]
  35012. }
  35013. return this.element.decode(i, t, this.id)
  35014. }),
  35015. (o.Message.Field = f)
  35016. var m = function (e, t, i, n, r, o, a) {
  35017. f.call(this, e, t, i, null, n, r, o, a), this.extension
  35018. }
  35019. ;(m.prototype = Object.create(f.prototype)), (o.Message.ExtensionField = m)
  35020. var v = function (e, t, i) {
  35021. a.call(this, e, t, i), (this.fields = [])
  35022. }
  35023. o.Message.OneOf = v
  35024. var A = function (e, t, i, n, r) {
  35025. l.call(this, e, t, i, n, r), (this.className = 'Enum'), (this.object = null)
  35026. }
  35027. A.getName = function (e, t) {
  35028. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r) if (e[(i = n[r])] === t) return i
  35029. return null
  35030. }
  35031. var y = (A.prototype = Object.create(l.prototype))
  35032. ;(y.build = function (t) {
  35033. if (this.object && !t) return this.object
  35034. for (var i = new e.Builder.Enum(), n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r) i[n[r].name] = n[r].id
  35035. return (
  35036. Object.defineProperty &&
  35037. Object.defineProperty(i, '$options', {
  35038. value: this.buildOpt(),
  35039. enumerable: !1
  35040. }),
  35041. (this.object = i)
  35042. )
  35043. }),
  35044. (o.Enum = A)
  35045. var C = function (e, t, i, n) {
  35046. a.call(this, e, t, i), (this.className = 'Enum.Value'), (this.id = n)
  35047. }
  35048. ;(C.prototype = Object.create(a.prototype)), (o.Enum.Value = C)
  35049. var I = function (e, t, i, n) {
  35050. a.call(this, e, t, i), (this.field = n)
  35051. }
  35052. ;(I.prototype = Object.create(a.prototype)), (o.Extension = I)
  35053. var E = function (e, t, i, n) {
  35054. l.call(this, e, t, i, n), (this.className = 'Service'), (this.clazz = null)
  35055. },
  35056. b = (E.prototype = Object.create(l.prototype))
  35057. ;(b.build = function (i) {
  35058. return this.clazz && !i
  35059. ? this.clazz
  35060. : (this.clazz = (function (e, i) {
  35061. for (
  35062. var n = function (t) {
  35063. e.Builder.Service.call(this),
  35064. (this.rpcImpl =
  35065. t ||
  35066. function (e, t, i) {
  35067. setTimeout(i.bind(this, Error('Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services')), 0)
  35068. })
  35069. },
  35070. r = (n.prototype = Object.create(e.Builder.Service.prototype)),
  35071. o = i.getChildren(e.Reflect.Service.RPCMethod),
  35072. a = 0;
  35073. a < o.length;
  35074. a++
  35075. )
  35076. !(function (e) {
  35077. ;(r[e.name] = function (n, r) {
  35078. try {
  35079. try {
  35080. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  35081. } catch (e) {
  35082. if (!(e instanceof TypeError)) throw e
  35083. }
  35084. if (null === n || 'object' != typeof n) throw Error('Illegal arguments')
  35085. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  35086. this.rpcImpl(e.fqn(), n, function (t, n) {
  35087. if (t) return void r(t)
  35088. null === n && (n = '')
  35089. try {
  35090. n = e.resolvedResponseType.clazz.decode(n)
  35091. } catch (e) {}
  35092. return n && n instanceof e.resolvedResponseType.clazz ? void r(null, n) : void r(Error('Illegal response type received in service method ' + i.name + '#' + e.name))
  35093. })
  35094. } catch (e) {
  35095. setTimeout(r.bind(this, e), 0)
  35096. }
  35097. }),
  35098. (n[e.name] = function (t, i, r) {
  35099. new n(t)[e.name](i, r)
  35100. }),
  35101. Object.defineProperty &&
  35102. (Object.defineProperty(n[e.name], '$options', {
  35103. value: e.buildOpt()
  35104. }),
  35105. Object.defineProperty(r[e.name], '$options', {
  35106. value: n[e.name].$options
  35107. }))
  35108. })(o[a])
  35109. return (
  35110. Object.defineProperty &&
  35111. (Object.defineProperty(n, '$options', {
  35112. value: i.buildOpt()
  35113. }),
  35114. Object.defineProperty(r, '$options', {
  35115. value: n.$options
  35116. }),
  35117. Object.defineProperty(n, '$type', {
  35118. value: i
  35119. }),
  35120. Object.defineProperty(r, '$type', {
  35121. value: i
  35122. })),
  35123. n
  35124. )
  35125. })(e, this))
  35126. }),
  35127. (o.Service = E)
  35128. var w = function (e, t, i, n) {
  35129. a.call(this, e, t, i), (this.className = 'Service.Method'), (this.options = n || {})
  35130. },
  35131. _ = (w.prototype = Object.create(a.prototype))
  35132. ;(_.buildOpt = c.buildOpt), (o.Service.Method = w)
  35133. var T = function (e, t, i, n, r, o, a, s) {
  35134. w.call(this, e, t, i, s),
  35135. (this.className = 'Service.RPCMethod'),
  35136. (this.requestName = n),
  35137. (this.responseName = r),
  35138. (this.requestStream = o),
  35139. (this.responseStream = a),
  35140. (this.resolvedRequestType = null),
  35141. (this.resolvedResponseType = null)
  35142. }
  35143. return (T.prototype = Object.create(w.prototype)), (o.Service.RPCMethod = T), o
  35144. })(r)),
  35145. (r.Builder = (function (t, i, n) {
  35146. function r(e) {
  35147. e.messages &&
  35148. e.messages.forEach(function (t) {
  35149. ;(t.syntax = e.syntax), r(t)
  35150. }),
  35151. e.enums &&
  35152. e.enums.forEach(function (t) {
  35153. t.syntax = e.syntax
  35154. })
  35155. }
  35156. var o = function (e) {
  35157. ;(this.ns = new n.Namespace(this, null, '')),
  35158. (this.ptr = this.ns),
  35159. (this.resolved = !1),
  35160. (this.result = null),
  35161. (this.files = {}),
  35162. (this.importRoot = null),
  35163. (this.options = e || {})
  35164. },
  35165. a = o.prototype
  35166. return (
  35167. (o.isMessage = function (e) {
  35168. return 'string' == typeof e.name && 'undefined' == typeof e.values && 'undefined' == typeof e.rpc
  35169. }),
  35170. (o.isMessageField = function (e) {
  35171. return 'string' == typeof e.rule && 'string' == typeof e.name && 'string' == typeof e.type && 'undefined' != typeof e.id
  35172. }),
  35173. (o.isEnum = function (e) {
  35174. return 'string' == typeof e.name && !('undefined' == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  35175. }),
  35176. (o.isService = function (e) {
  35177. return !('string' != typeof e.name || 'object' != typeof e.rpc || !e.rpc)
  35178. }),
  35179. (o.isExtend = function (e) {
  35180. return 'string' == typeof e.ref
  35181. }),
  35182. (a.reset = function () {
  35183. return (this.ptr = this.ns), this
  35184. }),
  35185. (a.define = function (e) {
  35186. if ('string' != typeof e || !i.TYPEREF.test(e)) throw Error('illegal namespace: ' + e)
  35187. return (
  35188. e.split('.').forEach(function (e) {
  35189. var t = this.ptr.getChild(e)
  35190. null === t && this.ptr.addChild((t = new n.Namespace(this, this.ptr, e))), (this.ptr = t)
  35191. }, this),
  35192. this
  35193. )
  35194. }),
  35195. (a.create = function (e) {
  35196. if (!e) return this
  35197. if (Array.isArray(e)) {
  35198. if (0 === e.length) return this
  35199. e = e.slice()
  35200. } else e = [e]
  35201. for (var i = [e]; i.length > 0; ) {
  35202. if (((e = i.pop()), !Array.isArray(e))) throw Error('not a valid namespace: ' + JSON.stringify(e))
  35203. for (; e.length > 0; ) {
  35204. var r = e.shift()
  35205. if (o.isMessage(r)) {
  35206. var a = new n.Message(this, this.ptr, r.name, r.options, r.isGroup, r.syntax),
  35207. s = {}
  35208. r.oneofs &&
  35209. Object.keys(r.oneofs).forEach(function (e) {
  35210. a.addChild((s[e] = new n.Message.OneOf(this, a, e)))
  35211. }, this),
  35212. r.fields &&
  35213. r.fields.forEach(function (e) {
  35214. if (null !== a.getChild(0 | e.id)) throw Error('duplicate or invalid field id in ' + a.name + ': ' + e.id)
  35215. if (e.options && 'object' != typeof e.options) throw Error('illegal field options in ' + a.name + '#' + e.name)
  35216. var t = null
  35217. if ('string' == typeof e.oneof && !(t = s[e.oneof])) throw Error('illegal oneof in ' + a.name + '#' + e.name + ': ' + e.oneof)
  35218. ;(e = new n.Message.Field(this, a, e.rule, e.keytype, e.type, e.name, e.id, e.options, t, r.syntax)), t && t.fields.push(e), a.addChild(e)
  35219. }, this)
  35220. var l = []
  35221. if (
  35222. (r.enums &&
  35223. r.enums.forEach(function (e) {
  35224. l.push(e)
  35225. }),
  35226. r.messages &&
  35227. r.messages.forEach(function (e) {
  35228. l.push(e)
  35229. }),
  35230. r.services &&
  35231. r.services.forEach(function (e) {
  35232. l.push(e)
  35233. }),
  35234. r.extensions && ('number' == typeof r.extensions[0] ? (a.extensions = [r.extensions]) : (a.extensions = r.extensions)),
  35235. this.ptr.addChild(a),
  35236. l.length > 0)
  35237. ) {
  35238. i.push(e), (e = l), (l = null), (this.ptr = a), (a = null)
  35239. continue
  35240. }
  35241. l = null
  35242. } else if (o.isEnum(r))
  35243. (a = new n.Enum(this, this.ptr, r.name, r.options, r.syntax)),
  35244. r.values.forEach(function (e) {
  35245. a.addChild(new n.Enum.Value(this, a, e.name, e.id))
  35246. }, this),
  35247. this.ptr.addChild(a)
  35248. else if (o.isService(r))
  35249. (a = new n.Service(this, this.ptr, r.name, r.options)),
  35250. Object.keys(r.rpc).forEach(function (e) {
  35251. var t = r.rpc[e]
  35252. a.addChild(new n.Service.RPCMethod(this, a, e, t.request, t.response, !!t.request_stream, !!t.response_stream, t.options))
  35253. }, this),
  35254. this.ptr.addChild(a)
  35255. else {
  35256. if (!o.isExtend(r)) throw Error('not a valid definition: ' + JSON.stringify(r))
  35257. if ((a = this.ptr.resolve(r.ref, !0)))
  35258. r.fields.forEach(function (e) {
  35259. if (null !== a.getChild(0 | e.id)) throw Error('duplicate extended field id in ' + a.name + ': ' + e.id)
  35260. if (a.extensions) {
  35261. var i = !1
  35262. if (
  35263. (a.extensions.forEach(function (t) {
  35264. e.id >= t[0] && e.id <= t[1] && (i = !0)
  35265. }),
  35266. !i)
  35267. )
  35268. throw Error('illegal extended field id in ' + a.name + ': ' + e.id + ' (not within valid ranges)')
  35269. }
  35270. var r = e.name
  35271. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r))
  35272. var o = new n.Message.ExtensionField(this, a, e.rule, e.type, this.ptr.fqn() + '.' + r, e.id, e.options),
  35273. s = new n.Extension(this, this.ptr, e.name, o)
  35274. ;(o.extension = s), this.ptr.addChild(s), a.addChild(o)
  35275. }, this)
  35276. else if (!/\.?google\.protobuf\./.test(r.ref)) throw Error('extended message ' + r.ref + ' is not defined')
  35277. }
  35278. ;(r = null), (a = null)
  35279. }
  35280. ;(e = null), (this.ptr = this.ptr.parent)
  35281. }
  35282. return (this.resolved = !1), (this.result = null), this
  35283. }),
  35284. (a.import = function (i, n) {
  35285. var o = '/'
  35286. if ('string' == typeof n) {
  35287. if ((t.Util.IS_NODE && (n = e('path').resolve(n)), this.files[n] === !0)) return this.reset()
  35288. this.files[n] = !0
  35289. } else if ('object' == typeof n) {
  35290. var a = n.root
  35291. t.Util.IS_NODE && (a = e('path').resolve(a)), (a.indexOf('\\') >= 0 || n.file.indexOf('\\') >= 0) && (o = '\\')
  35292. var s = a + o + n.file
  35293. if (this.files[s] === !0) return this.reset()
  35294. this.files[s] = !0
  35295. }
  35296. if (i.imports && i.imports.length > 0) {
  35297. var l,
  35298. c = !1
  35299. 'object' == typeof n
  35300. ? ((this.importRoot = n.root), (c = !0), (l = this.importRoot), (n = n.file), (l.indexOf('\\') >= 0 || n.indexOf('\\') >= 0) && (o = '\\'))
  35301. : 'string' == typeof n
  35302. ? this.importRoot
  35303. ? (l = this.importRoot)
  35304. : n.indexOf('/') >= 0
  35305. ? ((l = n.replace(/\/[^\/]*$/, '')), '' === l && (l = '/'))
  35306. : n.indexOf('\\') >= 0
  35307. ? ((l = n.replace(/\\[^\\]*$/, '')), (o = '\\'))
  35308. : (l = '.')
  35309. : (l = null)
  35310. for (var h = 0; h < i.imports.length; h++)
  35311. if ('string' == typeof i.imports[h]) {
  35312. if (!l) throw Error('cannot determine import root')
  35313. var u = i.imports[h]
  35314. if ('google/protobuf/descriptor.proto' === u) continue
  35315. if (((u = l + o + u), this.files[u] === !0)) continue
  35316. ;/\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, '.json'))
  35317. var d = t.Util.fetch(u)
  35318. if (null === d) throw Error("failed to import '" + u + "' in '" + n + "': file not found")
  35319. ;/\.json$/i.test(u) ? this.import(JSON.parse(d + ''), u) : this.import(t.DotProto.Parser.parse(d), u)
  35320. } else
  35321. n
  35322. ? /\.(\w+)$/.test(n)
  35323. ? this.import(
  35324. i.imports[h],
  35325. n.replace(/^(.+)\.(\w+)$/, function (e, t, i) {
  35326. return t + '_import' + h + '.' + i
  35327. })
  35328. )
  35329. : this.import(i.imports[h], n + '_import' + h)
  35330. : this.import(i.imports[h])
  35331. c && (this.importRoot = null)
  35332. }
  35333. i.package && this.define(i.package), i.syntax && r(i)
  35334. var p = this.ptr
  35335. return (
  35336. i.options &&
  35337. Object.keys(i.options).forEach(function (e) {
  35338. p.options[e] = i.options[e]
  35339. }),
  35340. i.messages && (this.create(i.messages), (this.ptr = p)),
  35341. i.enums && (this.create(i.enums), (this.ptr = p)),
  35342. i.services && (this.create(i.services), (this.ptr = p)),
  35343. i.extends && this.create(i.extends),
  35344. this.reset()
  35345. )
  35346. }),
  35347. (a.resolveAll = function () {
  35348. var e
  35349. if (null == this.ptr || 'object' == typeof this.ptr.type) return this
  35350. if (this.ptr instanceof n.Namespace)
  35351. this.ptr.children.forEach(function (e) {
  35352. ;(this.ptr = e), this.resolveAll()
  35353. }, this)
  35354. else if (this.ptr instanceof n.Message.Field) {
  35355. if (i.TYPE.test(this.ptr.type)) this.ptr.type = t.TYPES[this.ptr.type]
  35356. else {
  35357. if (!i.TYPEREF.test(this.ptr.type)) throw Error('illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.type)
  35358. if (((e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)), !e))
  35359. throw Error('unresolvable type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.type)
  35360. if (((this.ptr.resolvedType = e), e instanceof n.Enum)) {
  35361. if (((this.ptr.type = t.TYPES.enum), 'proto3' === this.ptr.syntax && 'proto3' !== e.syntax)) throw Error('proto3 message cannot reference proto2 enum')
  35362. } else {
  35363. if (!(e instanceof n.Message)) throw Error('illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.type)
  35364. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  35365. }
  35366. }
  35367. if (this.ptr.map) {
  35368. if (!i.TYPE.test(this.ptr.keyType)) throw Error('illegal key type for map field in ' + this.ptr.toString(!0) + ': ' + this.ptr.keyType)
  35369. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  35370. }
  35371. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  35372. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod)) throw Error('illegal service type in ' + this.ptr.toString(!0))
  35373. if (((e = this.ptr.parent.resolve(this.ptr.requestName, !0)), !(e && e instanceof t.Reflect.Message)))
  35374. throw Error('Illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.requestName)
  35375. if (((this.ptr.resolvedRequestType = e), (e = this.ptr.parent.resolve(this.ptr.responseName, !0)), !(e && e instanceof t.Reflect.Message)))
  35376. throw Error('Illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.responseName)
  35377. this.ptr.resolvedResponseType = e
  35378. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  35379. throw Error('illegal object in namespace: ' + typeof this.ptr + ': ' + this.ptr)
  35380. return this.reset()
  35381. }),
  35382. (a.build = function (e) {
  35383. if ((this.reset(), this.resolved || (this.resolveAll(), (this.resolved = !0), (this.result = null)), null === this.result && (this.result = this.ns.build()), !e))
  35384. return this.result
  35385. for (var t = 'string' == typeof e ? e.split('.') : e, i = this.result, n = 0; n < t.length; n++) {
  35386. if (!i[t[n]]) {
  35387. i = null
  35388. break
  35389. }
  35390. i = i[t[n]]
  35391. }
  35392. return i
  35393. }),
  35394. (a.lookup = function (e, t) {
  35395. return e ? this.ns.resolve(e, t) : this.ns
  35396. }),
  35397. (a.toString = function () {
  35398. return 'Builder'
  35399. }),
  35400. (o.Message = function () {}),
  35401. (o.Enum = function () {}),
  35402. (o.Service = function () {}),
  35403. o
  35404. )
  35405. })(r, r.Lang, r.Reflect)),
  35406. (r.Map = (function (e, t) {
  35407. function i(e) {
  35408. var t = 0
  35409. return {
  35410. next: function () {
  35411. return t < e.length
  35412. ? {
  35413. done: !1,
  35414. value: e[t++]
  35415. }
  35416. : {
  35417. done: !0
  35418. }
  35419. }
  35420. }
  35421. }
  35422. var n = function (e, i) {
  35423. if (!e.map) throw Error('field is not a map')
  35424. if (
  35425. ((this.field = e),
  35426. (this.keyElem = new t.Element(e.keyType, null, !0, e.syntax)),
  35427. (this.valueElem = new t.Element(e.type, e.resolvedType, !1, e.syntax)),
  35428. (this.map = {}),
  35429. Object.defineProperty(this, 'size', {
  35430. get: function () {
  35431. return Object.keys(this.map).length
  35432. }
  35433. }),
  35434. i)
  35435. )
  35436. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  35437. var o = this.keyElem.valueFromString(n[r]),
  35438. a = this.valueElem.verifyValue(i[n[r]])
  35439. this.map[this.keyElem.valueToString(o)] = {
  35440. key: o,
  35441. value: a
  35442. }
  35443. }
  35444. },
  35445. r = n.prototype
  35446. return (
  35447. (r.clear = function () {
  35448. this.map = {}
  35449. }),
  35450. (r.delete = function (e) {
  35451. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e)),
  35452. i = t in this.map
  35453. return delete this.map[t], i
  35454. }),
  35455. (r.entries = function () {
  35456. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++) t.push([(e = this.map[n[r]]).key, e.value])
  35457. return i(t)
  35458. }),
  35459. (r.keys = function () {
  35460. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++) e.push(this.map[t[n]].key)
  35461. return i(e)
  35462. }),
  35463. (r.values = function () {
  35464. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++) e.push(this.map[t[n]].value)
  35465. return i(e)
  35466. }),
  35467. (r.forEach = function (e, t) {
  35468. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++) e.call(t, (i = this.map[n[r]]).value, i.key, this)
  35469. }),
  35470. (r.set = function (e, t) {
  35471. var i = this.keyElem.verifyValue(e),
  35472. n = this.valueElem.verifyValue(t)
  35473. return (
  35474. (this.map[this.keyElem.valueToString(i)] = {
  35475. key: i,
  35476. value: n
  35477. }),
  35478. this
  35479. )
  35480. }),
  35481. (r.get = function (e) {
  35482. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  35483. if (t in this.map) return this.map[t].value
  35484. }),
  35485. (r.has = function (e) {
  35486. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  35487. return t in this.map
  35488. }),
  35489. n
  35490. )
  35491. })(r, r.Reflect)),
  35492. (r.loadProto = function (e, t, i) {
  35493. return ('string' == typeof t || (t && 'string' == typeof t.file && 'string' == typeof t.root)) && ((i = t), (t = void 0)), r.loadJson(r.DotProto.Parser.parse(e), t, i)
  35494. }),
  35495. (r.protoFromString = r.loadProto),
  35496. (r.loadProtoFile = function (e, t, i) {
  35497. if ((t && 'object' == typeof t ? ((i = t), (t = null)) : (t && 'function' == typeof t) || (t = null), t))
  35498. return r.Util.fetch('string' == typeof e ? e : e.root + '/' + e.file, function (n) {
  35499. if (null === n) return void t(Error('Failed to fetch file'))
  35500. try {
  35501. t(null, r.loadProto(n, i, e))
  35502. } catch (e) {
  35503. t(e)
  35504. }
  35505. })
  35506. var n = r.Util.fetch('object' == typeof e ? e.root + '/' + e.file : e)
  35507. return null === n ? null : r.loadProto(n, i, e)
  35508. }),
  35509. (r.protoFromFile = r.loadProtoFile),
  35510. (r.newBuilder = function (e) {
  35511. return (
  35512. (e = e || {}),
  35513. 'undefined' == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  35514. 'undefined' == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  35515. new r.Builder(e)
  35516. )
  35517. }),
  35518. (r.loadJson = function (e, t, i) {
  35519. return (
  35520. ('string' == typeof t || (t && 'string' == typeof t.file && 'string' == typeof t.root)) && ((i = t), (t = null)),
  35521. (t && 'object' == typeof t) || (t = r.newBuilder()),
  35522. 'string' == typeof e && (e = JSON.parse(e)),
  35523. t.import(e, i),
  35524. t.resolveAll(),
  35525. t
  35526. )
  35527. }),
  35528. (r.loadJsonFile = function (e, t, i) {
  35529. if ((t && 'object' == typeof t ? ((i = t), (t = null)) : (t && 'function' == typeof t) || (t = null), t))
  35530. return r.Util.fetch('string' == typeof e ? e : e.root + '/' + e.file, function (n) {
  35531. if (null === n) return void t(Error('Failed to fetch file'))
  35532. try {
  35533. t(null, r.loadJson(JSON.parse(n), i, e))
  35534. } catch (e) {
  35535. t(e)
  35536. }
  35537. })
  35538. var n = r.Util.fetch('object' == typeof e ? e.root + '/' + e.file : e)
  35539. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  35540. }),
  35541. r
  35542. )
  35543. })
  35544. }).call(this, e('_process'))
  35545. },
  35546. {
  35547. _process: 203,
  35548. bytebuffer: 215,
  35549. fs: 197,
  35550. path: 197
  35551. }
  35552. ],
  35553. 215: [
  35554. function (e, t, i) {
  35555. !(function (i, n) {
  35556. 'function' == typeof define && define.amd
  35557. ? define(['long'], n)
  35558. : 'function' == typeof e && 'object' == typeof t && t && t.exports
  35559. ? (t.exports = (function () {
  35560. var t
  35561. try {
  35562. t = e('long')
  35563. } catch (e) {}
  35564. return n(t)
  35565. })())
  35566. : ((i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long))
  35567. })(this, function (e) {
  35568. 'use strict'
  35569. function t(e) {
  35570. var t = 0
  35571. return function () {
  35572. return t < e.length ? e.charCodeAt(t++) : null
  35573. }
  35574. }
  35575. function i() {
  35576. var e = [],
  35577. t = []
  35578. return function () {
  35579. return 0 === arguments.length
  35580. ? t.join('') + l.apply(String, e)
  35581. : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)), (e.length = 0)), void Array.prototype.push.apply(e, arguments))
  35582. }
  35583. }
  35584. function n(e, t, i, n, r) {
  35585. var o,
  35586. a,
  35587. s = 8 * r - n - 1,
  35588. l = (1 << s) - 1,
  35589. c = l >> 1,
  35590. h = -7,
  35591. u = i ? r - 1 : 0,
  35592. d = i ? -1 : 1,
  35593. p = e[t + u]
  35594. for (u += d, o = p & ((1 << -h) - 1), p >>= -h, h += s; h > 0; o = 256 * o + e[t + u], u += d, h -= 8);
  35595. for (a = o & ((1 << -h) - 1), o >>= -h, h += n; h > 0; a = 256 * a + e[t + u], u += d, h -= 8);
  35596. if (0 === o) o = 1 - c
  35597. else {
  35598. if (o === l) return a ? NaN : (p ? -1 : 1) * (1 / 0)
  35599. ;(a += Math.pow(2, n)), (o -= c)
  35600. }
  35601. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  35602. }
  35603. function r(e, t, i, n, r, o) {
  35604. var a,
  35605. s,
  35606. l,
  35607. c = 8 * o - r - 1,
  35608. h = (1 << c) - 1,
  35609. u = h >> 1,
  35610. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  35611. p = n ? 0 : o - 1,
  35612. f = n ? 1 : -1,
  35613. g = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0
  35614. for (
  35615. t = Math.abs(t),
  35616. isNaN(t) || t === 1 / 0
  35617. ? ((s = isNaN(t) ? 1 : 0), (a = h))
  35618. : ((a = Math.floor(Math.log(t) / Math.LN2)),
  35619. t * (l = Math.pow(2, -a)) < 1 && (a--, (l *= 2)),
  35620. (t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u)),
  35621. t * l >= 2 && (a++, (l /= 2)),
  35622. a + u >= h ? ((s = 0), (a = h)) : a + u >= 1 ? ((s = (t * l - 1) * Math.pow(2, r)), (a += u)) : ((s = t * Math.pow(2, u - 1) * Math.pow(2, r)), (a = 0)));
  35623. r >= 8;
  35624. e[i + p] = 255 & s, p += f, s /= 256, r -= 8
  35625. );
  35626. for (a = (a << r) | s, c += r; c > 0; e[i + p] = 255 & a, p += f, a /= 256, c -= 8);
  35627. e[i + p - f] |= 128 * g
  35628. }
  35629. var o = function (e, t, i) {
  35630. if (('undefined' == typeof e && (e = o.DEFAULT_CAPACITY), 'undefined' == typeof t && (t = o.DEFAULT_ENDIAN), 'undefined' == typeof i && (i = o.DEFAULT_NOASSERT), !i)) {
  35631. if (((e |= 0), e < 0)) throw RangeError('Illegal capacity')
  35632. ;(t = !!t), (i = !!i)
  35633. }
  35634. ;(this.buffer = 0 === e ? s : new ArrayBuffer(e)),
  35635. (this.view = 0 === e ? null : new Uint8Array(this.buffer)),
  35636. (this.offset = 0),
  35637. (this.markedOffset = -1),
  35638. (this.limit = e),
  35639. (this.littleEndian = t),
  35640. (this.noAssert = i)
  35641. }
  35642. ;(o.VERSION = '5.0.1'), (o.LITTLE_ENDIAN = !0), (o.BIG_ENDIAN = !1), (o.DEFAULT_CAPACITY = 16), (o.DEFAULT_ENDIAN = o.BIG_ENDIAN), (o.DEFAULT_NOASSERT = !1), (o.Long = e || null)
  35643. var a = o.prototype
  35644. a.__isByteBuffer__,
  35645. Object.defineProperty(a, '__isByteBuffer__', {
  35646. value: !0,
  35647. enumerable: !1,
  35648. configurable: !1
  35649. })
  35650. var s = new ArrayBuffer(0),
  35651. l = String.fromCharCode
  35652. ;(o.accessor = function () {
  35653. return Uint8Array
  35654. }),
  35655. (o.allocate = function (e, t, i) {
  35656. return new o(e, t, i)
  35657. }),
  35658. (o.concat = function (e, t, i, n) {
  35659. ;('boolean' != typeof t && 'string' == typeof t) || ((n = i), (i = t), (t = void 0))
  35660. for (var r, a = 0, s = 0, l = e.length; s < l; ++s) o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)), (r = e[s].limit - e[s].offset), r > 0 && (a += r)
  35661. if (0 === a) return new o(0, i, n)
  35662. var c,
  35663. h = new o(a, i, n)
  35664. for (s = 0; s < l; ) (c = e[s++]), (r = c.limit - c.offset), r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset), (h.offset += r))
  35665. return (h.limit = h.offset), (h.offset = 0), h
  35666. }),
  35667. (o.isByteBuffer = function (e) {
  35668. return (e && e.__isByteBuffer__) === !0
  35669. }),
  35670. (o.type = function () {
  35671. return ArrayBuffer
  35672. }),
  35673. (o.wrap = function (e, t, i, n) {
  35674. if (('string' != typeof t && ((n = i), (i = t), (t = void 0)), 'string' == typeof e))
  35675. switch (('undefined' == typeof t && (t = 'utf8'), t)) {
  35676. case 'base64':
  35677. return o.fromBase64(e, i)
  35678. case 'hex':
  35679. return o.fromHex(e, i)
  35680. case 'binary':
  35681. return o.fromBinary(e, i)
  35682. case 'utf8':
  35683. return o.fromUTF8(e, i)
  35684. case 'debug':
  35685. return o.fromDebug(e, i)
  35686. default:
  35687. throw Error('Unsupported encoding: ' + t)
  35688. }
  35689. if (null === e || 'object' != typeof e) throw TypeError('Illegal buffer')
  35690. var r
  35691. if (o.isByteBuffer(e)) return (r = a.clone.call(e)), (r.markedOffset = -1), r
  35692. if (e instanceof Uint8Array)
  35693. (r = new o(0, i, n)), e.length > 0 && ((r.buffer = e.buffer), (r.offset = e.byteOffset), (r.limit = e.byteOffset + e.byteLength), (r.view = new Uint8Array(e.buffer)))
  35694. else if (e instanceof ArrayBuffer)
  35695. (r = new o(0, i, n)), e.byteLength > 0 && ((r.buffer = e), (r.offset = 0), (r.limit = e.byteLength), (r.view = e.byteLength > 0 ? new Uint8Array(e) : null))
  35696. else {
  35697. if ('[object Array]' !== Object.prototype.toString.call(e)) throw TypeError('Illegal buffer')
  35698. ;(r = new o(e.length, i, n)), (r.limit = e.length)
  35699. for (var s = 0; s < e.length; ++s) r.view[s] = e[s]
  35700. }
  35701. return r
  35702. }),
  35703. (a.writeBitSet = function (e, t) {
  35704. var i = 'undefined' == typeof t
  35705. if ((i && (t = this.offset), !this.noAssert)) {
  35706. if (!(e instanceof Array)) throw TypeError('Illegal BitSet: Not an array')
  35707. if ('number' != typeof t || t % 1 !== 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  35708. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  35709. }
  35710. var n,
  35711. r = t,
  35712. o = e.length,
  35713. a = o >> 3,
  35714. s = 0
  35715. for (t += this.writeVarint32(o, t); a--; )
  35716. (n =
  35717. (1 & !!e[s++]) |
  35718. ((1 & !!e[s++]) << 1) |
  35719. ((1 & !!e[s++]) << 2) |
  35720. ((1 & !!e[s++]) << 3) |
  35721. ((1 & !!e[s++]) << 4) |
  35722. ((1 & !!e[s++]) << 5) |
  35723. ((1 & !!e[s++]) << 6) |
  35724. ((1 & !!e[s++]) << 7)),
  35725. this.writeByte(n, t++)
  35726. if (s < o) {
  35727. var l = 0
  35728. for (n = 0; s < o; ) n |= (1 & !!e[s++]) << l++
  35729. this.writeByte(n, t++)
  35730. }
  35731. return i ? ((this.offset = t), this) : t - r
  35732. }),
  35733. (a.readBitSet = function (e) {
  35734. var t = 'undefined' == typeof e
  35735. t && (e = this.offset)
  35736. var i,
  35737. n = this.readVarint32(e),
  35738. r = n.value,
  35739. o = r >> 3,
  35740. a = 0,
  35741. s = []
  35742. for (e += n.length; o--; )
  35743. (i = this.readByte(e++)),
  35744. (s[a++] = !!(1 & i)),
  35745. (s[a++] = !!(2 & i)),
  35746. (s[a++] = !!(4 & i)),
  35747. (s[a++] = !!(8 & i)),
  35748. (s[a++] = !!(16 & i)),
  35749. (s[a++] = !!(32 & i)),
  35750. (s[a++] = !!(64 & i)),
  35751. (s[a++] = !!(128 & i))
  35752. if (a < r) {
  35753. var l = 0
  35754. for (i = this.readByte(e++); a < r; ) s[a++] = !!((i >> l++) & 1)
  35755. }
  35756. return t && (this.offset = e), s
  35757. }),
  35758. (a.readBytes = function (e, t) {
  35759. var i = 'undefined' == typeof t
  35760. if ((i && (t = this.offset), !this.noAssert)) {
  35761. if ('number' != typeof t || t % 1 !== 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  35762. if (((t >>>= 0), t < 0 || t + e > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+' + e + ') <= ' + this.buffer.byteLength)
  35763. }
  35764. var n = this.slice(t, t + e)
  35765. return i && (this.offset += e), n
  35766. }),
  35767. (a.writeBytes = a.append),
  35768. (a.writeInt8 = function (e, t) {
  35769. var i = 'undefined' == typeof t
  35770. if ((i && (t = this.offset), !this.noAssert)) {
  35771. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  35772. if (((e |= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  35773. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  35774. }
  35775. t += 1
  35776. var n = this.buffer.byteLength
  35777. return t > n && this.resize((n *= 2) > t ? n : t), (t -= 1), (this.view[t] = e), i && (this.offset += 1), this
  35778. }),
  35779. (a.writeByte = a.writeInt8),
  35780. (a.readInt8 = function (e) {
  35781. var t = 'undefined' == typeof e
  35782. if ((t && (e = this.offset), !this.noAssert)) {
  35783. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  35784. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength)
  35785. }
  35786. var i = this.view[e]
  35787. return 128 === (128 & i) && (i = -(255 - i + 1)), t && (this.offset += 1), i
  35788. }),
  35789. (a.readByte = a.readInt8),
  35790. (a.writeUint8 = function (e, t) {
  35791. var i = 'undefined' == typeof t
  35792. if ((i && (t = this.offset), !this.noAssert)) {
  35793. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  35794. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  35795. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  35796. }
  35797. t += 1
  35798. var n = this.buffer.byteLength
  35799. return t > n && this.resize((n *= 2) > t ? n : t), (t -= 1), (this.view[t] = e), i && (this.offset += 1), this
  35800. }),
  35801. (a.writeUInt8 = a.writeUint8),
  35802. (a.readUint8 = function (e) {
  35803. var t = 'undefined' == typeof e
  35804. if ((t && (e = this.offset), !this.noAssert)) {
  35805. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  35806. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength)
  35807. }
  35808. var i = this.view[e]
  35809. return t && (this.offset += 1), i
  35810. }),
  35811. (a.readUInt8 = a.readUint8),
  35812. (a.writeInt16 = function (e, t) {
  35813. var i = 'undefined' == typeof t
  35814. if ((i && (t = this.offset), !this.noAssert)) {
  35815. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  35816. if (((e |= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  35817. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  35818. }
  35819. t += 2
  35820. var n = this.buffer.byteLength
  35821. return (
  35822. t > n && this.resize((n *= 2) > t ? n : t),
  35823. (t -= 2),
  35824. this.littleEndian ? ((this.view[t + 1] = (65280 & e) >>> 8), (this.view[t] = 255 & e)) : ((this.view[t] = (65280 & e) >>> 8), (this.view[t + 1] = 255 & e)),
  35825. i && (this.offset += 2),
  35826. this
  35827. )
  35828. }),
  35829. (a.writeShort = a.writeInt16),
  35830. (a.readInt16 = function (e) {
  35831. var t = 'undefined' == typeof e
  35832. if ((t && (e = this.offset), !this.noAssert)) {
  35833. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  35834. if (((e >>>= 0), e < 0 || e + 2 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+2) <= ' + this.buffer.byteLength)
  35835. }
  35836. var i = 0
  35837. return (
  35838. this.littleEndian ? ((i = this.view[e]), (i |= this.view[e + 1] << 8)) : ((i = this.view[e] << 8), (i |= this.view[e + 1])),
  35839. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  35840. t && (this.offset += 2),
  35841. i
  35842. )
  35843. }),
  35844. (a.readShort = a.readInt16),
  35845. (a.writeUint16 = function (e, t) {
  35846. var i = 'undefined' == typeof t
  35847. if ((i && (t = this.offset), !this.noAssert)) {
  35848. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  35849. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  35850. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  35851. }
  35852. t += 2
  35853. var n = this.buffer.byteLength
  35854. return (
  35855. t > n && this.resize((n *= 2) > t ? n : t),
  35856. (t -= 2),
  35857. this.littleEndian ? ((this.view[t + 1] = (65280 & e) >>> 8), (this.view[t] = 255 & e)) : ((this.view[t] = (65280 & e) >>> 8), (this.view[t + 1] = 255 & e)),
  35858. i && (this.offset += 2),
  35859. this
  35860. )
  35861. }),
  35862. (a.writeUInt16 = a.writeUint16),
  35863. (a.readUint16 = function (e) {
  35864. var t = 'undefined' == typeof e
  35865. if ((t && (e = this.offset), !this.noAssert)) {
  35866. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  35867. if (((e >>>= 0), e < 0 || e + 2 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+2) <= ' + this.buffer.byteLength)
  35868. }
  35869. var i = 0
  35870. return this.littleEndian ? ((i = this.view[e]), (i |= this.view[e + 1] << 8)) : ((i = this.view[e] << 8), (i |= this.view[e + 1])), t && (this.offset += 2), i
  35871. }),
  35872. (a.readUInt16 = a.readUint16),
  35873. (a.writeInt32 = function (e, t) {
  35874. var i = 'undefined' == typeof t
  35875. if ((i && (t = this.offset), !this.noAssert)) {
  35876. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  35877. if (((e |= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  35878. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  35879. }
  35880. t += 4
  35881. var n = this.buffer.byteLength
  35882. return (
  35883. t > n && this.resize((n *= 2) > t ? n : t),
  35884. (t -= 4),
  35885. this.littleEndian
  35886. ? ((this.view[t + 3] = (e >>> 24) & 255), (this.view[t + 2] = (e >>> 16) & 255), (this.view[t + 1] = (e >>> 8) & 255), (this.view[t] = 255 & e))
  35887. : ((this.view[t] = (e >>> 24) & 255), (this.view[t + 1] = (e >>> 16) & 255), (this.view[t + 2] = (e >>> 8) & 255), (this.view[t + 3] = 255 & e)),
  35888. i && (this.offset += 4),
  35889. this
  35890. )
  35891. }),
  35892. (a.writeInt = a.writeInt32),
  35893. (a.readInt32 = function (e) {
  35894. var t = 'undefined' == typeof e
  35895. if ((t && (e = this.offset), !this.noAssert)) {
  35896. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  35897. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength)
  35898. }
  35899. var i = 0
  35900. return (
  35901. this.littleEndian
  35902. ? ((i = this.view[e + 2] << 16), (i |= this.view[e + 1] << 8), (i |= this.view[e]), (i += (this.view[e + 3] << 24) >>> 0))
  35903. : ((i = this.view[e + 1] << 16), (i |= this.view[e + 2] << 8), (i |= this.view[e + 3]), (i += (this.view[e] << 24) >>> 0)),
  35904. (i |= 0),
  35905. t && (this.offset += 4),
  35906. i
  35907. )
  35908. }),
  35909. (a.readInt = a.readInt32),
  35910. (a.writeUint32 = function (e, t) {
  35911. var i = 'undefined' == typeof t
  35912. if ((i && (t = this.offset), !this.noAssert)) {
  35913. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  35914. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  35915. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  35916. }
  35917. t += 4
  35918. var n = this.buffer.byteLength
  35919. return (
  35920. t > n && this.resize((n *= 2) > t ? n : t),
  35921. (t -= 4),
  35922. this.littleEndian
  35923. ? ((this.view[t + 3] = (e >>> 24) & 255), (this.view[t + 2] = (e >>> 16) & 255), (this.view[t + 1] = (e >>> 8) & 255), (this.view[t] = 255 & e))
  35924. : ((this.view[t] = (e >>> 24) & 255), (this.view[t + 1] = (e >>> 16) & 255), (this.view[t + 2] = (e >>> 8) & 255), (this.view[t + 3] = 255 & e)),
  35925. i && (this.offset += 4),
  35926. this
  35927. )
  35928. }),
  35929. (a.writeUInt32 = a.writeUint32),
  35930. (a.readUint32 = function (e) {
  35931. var t = 'undefined' == typeof e
  35932. if ((t && (e = this.offset), !this.noAssert)) {
  35933. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  35934. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength)
  35935. }
  35936. var i = 0
  35937. return (
  35938. this.littleEndian
  35939. ? ((i = this.view[e + 2] << 16), (i |= this.view[e + 1] << 8), (i |= this.view[e]), (i += (this.view[e + 3] << 24) >>> 0))
  35940. : ((i = this.view[e + 1] << 16), (i |= this.view[e + 2] << 8), (i |= this.view[e + 3]), (i += (this.view[e] << 24) >>> 0)),
  35941. t && (this.offset += 4),
  35942. i
  35943. )
  35944. }),
  35945. (a.readUInt32 = a.readUint32),
  35946. e &&
  35947. ((a.writeInt64 = function (t, i) {
  35948. var n = 'undefined' == typeof i
  35949. if ((n && (i = this.offset), !this.noAssert)) {
  35950. if ('number' == typeof t) t = e.fromNumber(t)
  35951. else if ('string' == typeof t) t = e.fromString(t)
  35952. else if (!(t && t instanceof e)) throw TypeError('Illegal value: ' + t + ' (not an integer or Long)')
  35953. if ('number' != typeof i || i % 1 !== 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  35954. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  35955. }
  35956. 'number' == typeof t ? (t = e.fromNumber(t)) : 'string' == typeof t && (t = e.fromString(t)), (i += 8)
  35957. var r = this.buffer.byteLength
  35958. i > r && this.resize((r *= 2) > i ? r : i), (i -= 8)
  35959. var o = t.low,
  35960. a = t.high
  35961. return (
  35962. this.littleEndian
  35963. ? ((this.view[i + 3] = (o >>> 24) & 255),
  35964. (this.view[i + 2] = (o >>> 16) & 255),
  35965. (this.view[i + 1] = (o >>> 8) & 255),
  35966. (this.view[i] = 255 & o),
  35967. (i += 4),
  35968. (this.view[i + 3] = (a >>> 24) & 255),
  35969. (this.view[i + 2] = (a >>> 16) & 255),
  35970. (this.view[i + 1] = (a >>> 8) & 255),
  35971. (this.view[i] = 255 & a))
  35972. : ((this.view[i] = (a >>> 24) & 255),
  35973. (this.view[i + 1] = (a >>> 16) & 255),
  35974. (this.view[i + 2] = (a >>> 8) & 255),
  35975. (this.view[i + 3] = 255 & a),
  35976. (i += 4),
  35977. (this.view[i] = (o >>> 24) & 255),
  35978. (this.view[i + 1] = (o >>> 16) & 255),
  35979. (this.view[i + 2] = (o >>> 8) & 255),
  35980. (this.view[i + 3] = 255 & o)),
  35981. n && (this.offset += 8),
  35982. this
  35983. )
  35984. }),
  35985. (a.writeLong = a.writeInt64),
  35986. (a.readInt64 = function (t) {
  35987. var i = 'undefined' == typeof t
  35988. if ((i && (t = this.offset), !this.noAssert)) {
  35989. if ('number' != typeof t || t % 1 !== 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  35990. if (((t >>>= 0), t < 0 || t + 8 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+8) <= ' + this.buffer.byteLength)
  35991. }
  35992. var n = 0,
  35993. r = 0
  35994. this.littleEndian
  35995. ? ((n = this.view[t + 2] << 16),
  35996. (n |= this.view[t + 1] << 8),
  35997. (n |= this.view[t]),
  35998. (n += (this.view[t + 3] << 24) >>> 0),
  35999. (t += 4),
  36000. (r = this.view[t + 2] << 16),
  36001. (r |= this.view[t + 1] << 8),
  36002. (r |= this.view[t]),
  36003. (r += (this.view[t + 3] << 24) >>> 0))
  36004. : ((r = this.view[t + 1] << 16),
  36005. (r |= this.view[t + 2] << 8),
  36006. (r |= this.view[t + 3]),
  36007. (r += (this.view[t] << 24) >>> 0),
  36008. (t += 4),
  36009. (n = this.view[t + 1] << 16),
  36010. (n |= this.view[t + 2] << 8),
  36011. (n |= this.view[t + 3]),
  36012. (n += (this.view[t] << 24) >>> 0))
  36013. var o = new e(n, r, !1)
  36014. return i && (this.offset += 8), o
  36015. }),
  36016. (a.readLong = a.readInt64),
  36017. (a.writeUint64 = function (t, i) {
  36018. var n = 'undefined' == typeof i
  36019. if ((n && (i = this.offset), !this.noAssert)) {
  36020. if ('number' == typeof t) t = e.fromNumber(t)
  36021. else if ('string' == typeof t) t = e.fromString(t)
  36022. else if (!(t && t instanceof e)) throw TypeError('Illegal value: ' + t + ' (not an integer or Long)')
  36023. if ('number' != typeof i || i % 1 !== 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  36024. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  36025. }
  36026. 'number' == typeof t ? (t = e.fromNumber(t)) : 'string' == typeof t && (t = e.fromString(t)), (i += 8)
  36027. var r = this.buffer.byteLength
  36028. i > r && this.resize((r *= 2) > i ? r : i), (i -= 8)
  36029. var o = t.low,
  36030. a = t.high
  36031. return (
  36032. this.littleEndian
  36033. ? ((this.view[i + 3] = (o >>> 24) & 255),
  36034. (this.view[i + 2] = (o >>> 16) & 255),
  36035. (this.view[i + 1] = (o >>> 8) & 255),
  36036. (this.view[i] = 255 & o),
  36037. (i += 4),
  36038. (this.view[i + 3] = (a >>> 24) & 255),
  36039. (this.view[i + 2] = (a >>> 16) & 255),
  36040. (this.view[i + 1] = (a >>> 8) & 255),
  36041. (this.view[i] = 255 & a))
  36042. : ((this.view[i] = (a >>> 24) & 255),
  36043. (this.view[i + 1] = (a >>> 16) & 255),
  36044. (this.view[i + 2] = (a >>> 8) & 255),
  36045. (this.view[i + 3] = 255 & a),
  36046. (i += 4),
  36047. (this.view[i] = (o >>> 24) & 255),
  36048. (this.view[i + 1] = (o >>> 16) & 255),
  36049. (this.view[i + 2] = (o >>> 8) & 255),
  36050. (this.view[i + 3] = 255 & o)),
  36051. n && (this.offset += 8),
  36052. this
  36053. )
  36054. }),
  36055. (a.writeUInt64 = a.writeUint64),
  36056. (a.readUint64 = function (t) {
  36057. var i = 'undefined' == typeof t
  36058. if ((i && (t = this.offset), !this.noAssert)) {
  36059. if ('number' != typeof t || t % 1 !== 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  36060. if (((t >>>= 0), t < 0 || t + 8 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+8) <= ' + this.buffer.byteLength)
  36061. }
  36062. var n = 0,
  36063. r = 0
  36064. this.littleEndian
  36065. ? ((n = this.view[t + 2] << 16),
  36066. (n |= this.view[t + 1] << 8),
  36067. (n |= this.view[t]),
  36068. (n += (this.view[t + 3] << 24) >>> 0),
  36069. (t += 4),
  36070. (r = this.view[t + 2] << 16),
  36071. (r |= this.view[t + 1] << 8),
  36072. (r |= this.view[t]),
  36073. (r += (this.view[t + 3] << 24) >>> 0))
  36074. : ((r = this.view[t + 1] << 16),
  36075. (r |= this.view[t + 2] << 8),
  36076. (r |= this.view[t + 3]),
  36077. (r += (this.view[t] << 24) >>> 0),
  36078. (t += 4),
  36079. (n = this.view[t + 1] << 16),
  36080. (n |= this.view[t + 2] << 8),
  36081. (n |= this.view[t + 3]),
  36082. (n += (this.view[t] << 24) >>> 0))
  36083. var o = new e(n, r, !0)
  36084. return i && (this.offset += 8), o
  36085. }),
  36086. (a.readUInt64 = a.readUint64)),
  36087. (a.writeFloat32 = function (e, t) {
  36088. var i = 'undefined' == typeof t
  36089. if ((i && (t = this.offset), !this.noAssert)) {
  36090. if ('number' != typeof e) throw TypeError('Illegal value: ' + e + ' (not a number)')
  36091. if ('number' != typeof t || t % 1 !== 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  36092. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  36093. }
  36094. t += 4
  36095. var n = this.buffer.byteLength
  36096. return t > n && this.resize((n *= 2) > t ? n : t), (t -= 4), r(this.view, e, t, this.littleEndian, 23, 4), i && (this.offset += 4), this
  36097. }),
  36098. (a.writeFloat = a.writeFloat32),
  36099. (a.readFloat32 = function (e) {
  36100. var t = 'undefined' == typeof e
  36101. if ((t && (e = this.offset), !this.noAssert)) {
  36102. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  36103. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength)
  36104. }
  36105. var i = n(this.view, e, this.littleEndian, 23, 4)
  36106. return t && (this.offset += 4), i
  36107. }),
  36108. (a.readFloat = a.readFloat32),
  36109. (a.writeFloat64 = function (e, t) {
  36110. var i = 'undefined' == typeof t
  36111. if ((i && (t = this.offset), !this.noAssert)) {
  36112. if ('number' != typeof e) throw TypeError('Illegal value: ' + e + ' (not a number)')
  36113. if ('number' != typeof t || t % 1 !== 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  36114. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  36115. }
  36116. t += 8
  36117. var n = this.buffer.byteLength
  36118. return t > n && this.resize((n *= 2) > t ? n : t), (t -= 8), r(this.view, e, t, this.littleEndian, 52, 8), i && (this.offset += 8), this
  36119. }),
  36120. (a.writeDouble = a.writeFloat64),
  36121. (a.readFloat64 = function (e) {
  36122. var t = 'undefined' == typeof e
  36123. if ((t && (e = this.offset), !this.noAssert)) {
  36124. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  36125. if (((e >>>= 0), e < 0 || e + 8 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+8) <= ' + this.buffer.byteLength)
  36126. }
  36127. var i = n(this.view, e, this.littleEndian, 52, 8)
  36128. return t && (this.offset += 8), i
  36129. }),
  36130. (a.readDouble = a.readFloat64),
  36131. (o.MAX_VARINT32_BYTES = 5),
  36132. (o.calculateVarint32 = function (e) {
  36133. return (e >>>= 0), e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  36134. }),
  36135. (o.zigZagEncode32 = function (e) {
  36136. return (((e |= 0) << 1) ^ (e >> 31)) >>> 0
  36137. }),
  36138. (o.zigZagDecode32 = function (e) {
  36139. return ((e >>> 1) ^ -(1 & e)) | 0
  36140. }),
  36141. (a.writeVarint32 = function (e, t) {
  36142. var i = 'undefined' == typeof t
  36143. if ((i && (t = this.offset), !this.noAssert)) {
  36144. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  36145. if (((e |= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  36146. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  36147. }
  36148. var n,
  36149. r = o.calculateVarint32(e)
  36150. t += r
  36151. var a = this.buffer.byteLength
  36152. for (t > a && this.resize((a *= 2) > t ? a : t), t -= r, e >>>= 0; e >= 128; ) (n = (127 & e) | 128), (this.view[t++] = n), (e >>>= 7)
  36153. return (this.view[t++] = e), i ? ((this.offset = t), this) : r
  36154. }),
  36155. (a.writeVarint32ZigZag = function (e, t) {
  36156. return this.writeVarint32(o.zigZagEncode32(e), t)
  36157. }),
  36158. (a.readVarint32 = function (e) {
  36159. var t = 'undefined' == typeof e
  36160. if ((t && (e = this.offset), !this.noAssert)) {
  36161. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  36162. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength)
  36163. }
  36164. var i,
  36165. n = 0,
  36166. r = 0
  36167. do {
  36168. if (!this.noAssert && e > this.limit) {
  36169. var o = Error('Truncated')
  36170. throw ((o.truncated = !0), o)
  36171. }
  36172. ;(i = this.view[e++]), n < 5 && (r |= (127 & i) << (7 * n)), ++n
  36173. } while (0 !== (128 & i))
  36174. return (
  36175. (r |= 0),
  36176. t
  36177. ? ((this.offset = e), r)
  36178. : {
  36179. value: r,
  36180. length: n
  36181. }
  36182. )
  36183. }),
  36184. (a.readVarint32ZigZag = function (e) {
  36185. var t = this.readVarint32(e)
  36186. return 'object' == typeof t ? (t.value = o.zigZagDecode32(t.value)) : (t = o.zigZagDecode32(t)), t
  36187. }),
  36188. e &&
  36189. ((o.MAX_VARINT64_BYTES = 10),
  36190. (o.calculateVarint64 = function (t) {
  36191. 'number' == typeof t ? (t = e.fromNumber(t)) : 'string' == typeof t && (t = e.fromString(t))
  36192. var i = t.toInt() >>> 0,
  36193. n = t.shiftRightUnsigned(28).toInt() >>> 0,
  36194. r = t.shiftRightUnsigned(56).toInt() >>> 0
  36195. return 0 == r ? (0 == n ? (i < 16384 ? (i < 128 ? 1 : 2) : i < 1 << 21 ? 3 : 4) : n < 16384 ? (n < 128 ? 5 : 6) : n < 1 << 21 ? 7 : 8) : r < 128 ? 9 : 10
  36196. }),
  36197. (o.zigZagEncode64 = function (t) {
  36198. return (
  36199. 'number' == typeof t ? (t = e.fromNumber(t, !1)) : 'string' == typeof t ? (t = e.fromString(t, !1)) : t.unsigned !== !1 && (t = t.toSigned()),
  36200. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  36201. )
  36202. }),
  36203. (o.zigZagDecode64 = function (t) {
  36204. return (
  36205. 'number' == typeof t ? (t = e.fromNumber(t, !1)) : 'string' == typeof t ? (t = e.fromString(t, !1)) : t.unsigned !== !1 && (t = t.toSigned()),
  36206. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  36207. )
  36208. }),
  36209. (a.writeVarint64 = function (t, i) {
  36210. var n = 'undefined' == typeof i
  36211. if ((n && (i = this.offset), !this.noAssert)) {
  36212. if ('number' == typeof t) t = e.fromNumber(t)
  36213. else if ('string' == typeof t) t = e.fromString(t)
  36214. else if (!(t && t instanceof e)) throw TypeError('Illegal value: ' + t + ' (not an integer or Long)')
  36215. if ('number' != typeof i || i % 1 !== 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  36216. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  36217. }
  36218. 'number' == typeof t ? (t = e.fromNumber(t, !1)) : 'string' == typeof t ? (t = e.fromString(t, !1)) : t.unsigned !== !1 && (t = t.toSigned())
  36219. var r = o.calculateVarint64(t),
  36220. a = t.toInt() >>> 0,
  36221. s = t.shiftRightUnsigned(28).toInt() >>> 0,
  36222. l = t.shiftRightUnsigned(56).toInt() >>> 0
  36223. i += r
  36224. var c = this.buffer.byteLength
  36225. switch ((i > c && this.resize((c *= 2) > i ? c : i), (i -= r), r)) {
  36226. case 10:
  36227. this.view[i + 9] = (l >>> 7) & 1
  36228. case 9:
  36229. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l
  36230. case 8:
  36231. this.view[i + 7] = 8 !== r ? (s >>> 21) | 128 : (s >>> 21) & 127
  36232. case 7:
  36233. this.view[i + 6] = 7 !== r ? (s >>> 14) | 128 : (s >>> 14) & 127
  36234. case 6:
  36235. this.view[i + 5] = 6 !== r ? (s >>> 7) | 128 : (s >>> 7) & 127
  36236. case 5:
  36237. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s
  36238. case 4:
  36239. this.view[i + 3] = 4 !== r ? (a >>> 21) | 128 : (a >>> 21) & 127
  36240. case 3:
  36241. this.view[i + 2] = 3 !== r ? (a >>> 14) | 128 : (a >>> 14) & 127
  36242. case 2:
  36243. this.view[i + 1] = 2 !== r ? (a >>> 7) | 128 : (a >>> 7) & 127
  36244. case 1:
  36245. this.view[i] = 1 !== r ? 128 | a : 127 & a
  36246. }
  36247. return n ? ((this.offset += r), this) : r
  36248. }),
  36249. (a.writeVarint64ZigZag = function (e, t) {
  36250. return this.writeVarint64(o.zigZagEncode64(e), t)
  36251. }),
  36252. (a.readVarint64 = function (t) {
  36253. var i = 'undefined' == typeof t
  36254. if ((i && (t = this.offset), !this.noAssert)) {
  36255. if ('number' != typeof t || t % 1 !== 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  36256. if (((t >>>= 0), t < 0 || t + 1 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+1) <= ' + this.buffer.byteLength)
  36257. }
  36258. var n = t,
  36259. r = 0,
  36260. o = 0,
  36261. a = 0,
  36262. s = 0
  36263. if (
  36264. ((s = this.view[t++]),
  36265. (r = 127 & s),
  36266. 128 & s &&
  36267. ((s = this.view[t++]),
  36268. (r |= (127 & s) << 7),
  36269. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  36270. ((s = this.view[t++]),
  36271. (r |= (127 & s) << 14),
  36272. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  36273. ((s = this.view[t++]),
  36274. (r |= (127 & s) << 21),
  36275. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  36276. ((s = this.view[t++]),
  36277. (o = 127 & s),
  36278. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  36279. ((s = this.view[t++]),
  36280. (o |= (127 & s) << 7),
  36281. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  36282. ((s = this.view[t++]),
  36283. (o |= (127 & s) << 14),
  36284. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  36285. ((s = this.view[t++]),
  36286. (o |= (127 & s) << 21),
  36287. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  36288. ((s = this.view[t++]),
  36289. (a = 127 & s),
  36290. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  36291. ((s = this.view[t++]), (a |= (127 & s) << 7), 128 & s || (this.noAssert && 'undefined' == typeof s)))))))))))
  36292. )
  36293. throw Error('Buffer overrun')
  36294. var l = e.fromBits(r | (o << 28), (o >>> 4) | (a << 24), !1)
  36295. return i
  36296. ? ((this.offset = t), l)
  36297. : {
  36298. value: l,
  36299. length: t - n
  36300. }
  36301. }),
  36302. (a.readVarint64ZigZag = function (t) {
  36303. var i = this.readVarint64(t)
  36304. return i && i.value instanceof e ? (i.value = o.zigZagDecode64(i.value)) : (i = o.zigZagDecode64(i)), i
  36305. })),
  36306. (a.writeCString = function (e, i) {
  36307. var n = 'undefined' == typeof i
  36308. n && (i = this.offset)
  36309. var r,
  36310. o = e.length
  36311. if (!this.noAssert) {
  36312. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  36313. for (r = 0; r < o; ++r) if (0 === e.charCodeAt(r)) throw RangeError('Illegal str: Contains NULL-characters')
  36314. if ('number' != typeof i || i % 1 !== 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  36315. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  36316. }
  36317. ;(o = h.calculateUTF16asUTF8(t(e))[1]), (i += o + 1)
  36318. var a = this.buffer.byteLength
  36319. return (
  36320. i > a && this.resize((a *= 2) > i ? a : i),
  36321. (i -= o + 1),
  36322. h.encodeUTF16toUTF8(
  36323. t(e),
  36324. function (e) {
  36325. this.view[i++] = e
  36326. }.bind(this)
  36327. ),
  36328. (this.view[i++] = 0),
  36329. n ? ((this.offset = i), this) : o
  36330. )
  36331. }),
  36332. (a.readCString = function (e) {
  36333. var t = 'undefined' == typeof e
  36334. if ((t && (e = this.offset), !this.noAssert)) {
  36335. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  36336. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength)
  36337. }
  36338. var n,
  36339. r = e,
  36340. o = -1
  36341. return (
  36342. h.decodeUTF8toUTF16(
  36343. function () {
  36344. if (0 === o) return null
  36345. if (e >= this.limit) throw RangeError('Illegal range: Truncated data, ' + e + ' < ' + this.limit)
  36346. return (o = this.view[e++]), 0 === o ? null : o
  36347. }.bind(this),
  36348. (n = i()),
  36349. !0
  36350. ),
  36351. t
  36352. ? ((this.offset = e), n())
  36353. : {
  36354. string: n(),
  36355. length: e - r
  36356. }
  36357. )
  36358. }),
  36359. (a.writeIString = function (e, i) {
  36360. var n = 'undefined' == typeof i
  36361. if ((n && (i = this.offset), !this.noAssert)) {
  36362. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  36363. if ('number' != typeof i || i % 1 !== 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  36364. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  36365. }
  36366. var r,
  36367. o = i
  36368. ;(r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1]), (i += 4 + r)
  36369. var a = this.buffer.byteLength
  36370. if (
  36371. (i > a && this.resize((a *= 2) > i ? a : i),
  36372. (i -= 4 + r),
  36373. this.littleEndian
  36374. ? ((this.view[i + 3] = (r >>> 24) & 255), (this.view[i + 2] = (r >>> 16) & 255), (this.view[i + 1] = (r >>> 8) & 255), (this.view[i] = 255 & r))
  36375. : ((this.view[i] = (r >>> 24) & 255), (this.view[i + 1] = (r >>> 16) & 255), (this.view[i + 2] = (r >>> 8) & 255), (this.view[i + 3] = 255 & r)),
  36376. (i += 4),
  36377. h.encodeUTF16toUTF8(
  36378. t(e),
  36379. function (e) {
  36380. this.view[i++] = e
  36381. }.bind(this)
  36382. ),
  36383. i !== o + 4 + r)
  36384. )
  36385. throw RangeError('Illegal range: Truncated data, ' + i + ' == ' + (i + 4 + r))
  36386. return n ? ((this.offset = i), this) : i - o
  36387. }),
  36388. (a.readIString = function (e) {
  36389. var t = 'undefined' == typeof e
  36390. if ((t && (e = this.offset), !this.noAssert)) {
  36391. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  36392. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength)
  36393. }
  36394. var i = e,
  36395. n = this.readUint32(e),
  36396. r = this.readUTF8String(n, o.METRICS_BYTES, (e += 4))
  36397. return (
  36398. (e += r.length),
  36399. t
  36400. ? ((this.offset = e), r.string)
  36401. : {
  36402. string: r.string,
  36403. length: e - i
  36404. }
  36405. )
  36406. }),
  36407. (o.METRICS_CHARS = 'c'),
  36408. (o.METRICS_BYTES = 'b'),
  36409. (a.writeUTF8String = function (e, i) {
  36410. var n = 'undefined' == typeof i
  36411. if ((n && (i = this.offset), !this.noAssert)) {
  36412. if ('number' != typeof i || i % 1 !== 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  36413. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  36414. }
  36415. var r,
  36416. o = i
  36417. ;(r = h.calculateUTF16asUTF8(t(e))[1]), (i += r)
  36418. var a = this.buffer.byteLength
  36419. return (
  36420. i > a && this.resize((a *= 2) > i ? a : i),
  36421. (i -= r),
  36422. h.encodeUTF16toUTF8(
  36423. t(e),
  36424. function (e) {
  36425. this.view[i++] = e
  36426. }.bind(this)
  36427. ),
  36428. n ? ((this.offset = i), this) : i - o
  36429. )
  36430. }),
  36431. (a.writeString = a.writeUTF8String),
  36432. (o.calculateUTF8Chars = function (e) {
  36433. return h.calculateUTF16asUTF8(t(e))[0]
  36434. }),
  36435. (o.calculateUTF8Bytes = function (e) {
  36436. return h.calculateUTF16asUTF8(t(e))[1]
  36437. }),
  36438. (o.calculateString = o.calculateUTF8Bytes),
  36439. (a.readUTF8String = function (e, t, n) {
  36440. 'number' == typeof t && ((n = t), (t = void 0))
  36441. var r = 'undefined' == typeof n
  36442. if ((r && (n = this.offset), 'undefined' == typeof t && (t = o.METRICS_CHARS), !this.noAssert)) {
  36443. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal length: ' + e + ' (not an integer)')
  36444. if (((e |= 0), 'number' != typeof n || n % 1 !== 0)) throw TypeError('Illegal offset: ' + n + ' (not an integer)')
  36445. if (((n >>>= 0), n < 0 || n + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + n + ' (+0) <= ' + this.buffer.byteLength)
  36446. }
  36447. var a,
  36448. s = 0,
  36449. l = n
  36450. if (t === o.METRICS_CHARS) {
  36451. if (
  36452. ((a = i()),
  36453. h.decodeUTF8(
  36454. function () {
  36455. return s < e && n < this.limit ? this.view[n++] : null
  36456. }.bind(this),
  36457. function (e) {
  36458. ++s, h.UTF8toUTF16(e, a)
  36459. }
  36460. ),
  36461. s !== e)
  36462. )
  36463. throw RangeError('Illegal range: Truncated data, ' + s + ' == ' + e)
  36464. return r
  36465. ? ((this.offset = n), a())
  36466. : {
  36467. string: a(),
  36468. length: n - l
  36469. }
  36470. }
  36471. if (t === o.METRICS_BYTES) {
  36472. if (!this.noAssert) {
  36473. if ('number' != typeof n || n % 1 !== 0) throw TypeError('Illegal offset: ' + n + ' (not an integer)')
  36474. if (((n >>>= 0), n < 0 || n + e > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + n + ' (+' + e + ') <= ' + this.buffer.byteLength)
  36475. }
  36476. var c = n + e
  36477. if (
  36478. (h.decodeUTF8toUTF16(
  36479. function () {
  36480. return n < c ? this.view[n++] : null
  36481. }.bind(this),
  36482. (a = i()),
  36483. this.noAssert
  36484. ),
  36485. n !== c)
  36486. )
  36487. throw RangeError('Illegal range: Truncated data, ' + n + ' == ' + c)
  36488. return r
  36489. ? ((this.offset = n), a())
  36490. : {
  36491. string: a(),
  36492. length: n - l
  36493. }
  36494. }
  36495. throw TypeError('Unsupported metrics: ' + t)
  36496. }),
  36497. (a.readString = a.readUTF8String),
  36498. (a.writeVString = function (e, i) {
  36499. var n = 'undefined' == typeof i
  36500. if ((n && (i = this.offset), !this.noAssert)) {
  36501. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  36502. if ('number' != typeof i || i % 1 !== 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  36503. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  36504. }
  36505. var r,
  36506. a,
  36507. s = i
  36508. ;(r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1]), (a = o.calculateVarint32(r)), (i += a + r)
  36509. var l = this.buffer.byteLength
  36510. if (
  36511. (i > l && this.resize((l *= 2) > i ? l : i),
  36512. (i -= a + r),
  36513. (i += this.writeVarint32(r, i)),
  36514. h.encodeUTF16toUTF8(
  36515. t(e),
  36516. function (e) {
  36517. this.view[i++] = e
  36518. }.bind(this)
  36519. ),
  36520. i !== s + r + a)
  36521. )
  36522. throw RangeError('Illegal range: Truncated data, ' + i + ' == ' + (i + r + a))
  36523. return n ? ((this.offset = i), this) : i - s
  36524. }),
  36525. (a.readVString = function (e) {
  36526. var t = 'undefined' == typeof e
  36527. if ((t && (e = this.offset), !this.noAssert)) {
  36528. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  36529. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength)
  36530. }
  36531. var i = e,
  36532. n = this.readVarint32(e),
  36533. r = this.readUTF8String(n.value, o.METRICS_BYTES, (e += n.length))
  36534. return (
  36535. (e += r.length),
  36536. t
  36537. ? ((this.offset = e), r.string)
  36538. : {
  36539. string: r.string,
  36540. length: e - i
  36541. }
  36542. )
  36543. }),
  36544. (a.append = function (e, t, i) {
  36545. ;('number' != typeof t && 'string' == typeof t) || ((i = t), (t = void 0))
  36546. var n = 'undefined' == typeof i
  36547. if ((n && (i = this.offset), !this.noAssert)) {
  36548. if ('number' != typeof i || i % 1 !== 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  36549. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  36550. }
  36551. e instanceof o || (e = o.wrap(e, t))
  36552. var r = e.limit - e.offset
  36553. if (r <= 0) return this
  36554. i += r
  36555. var a = this.buffer.byteLength
  36556. return i > a && this.resize((a *= 2) > i ? a : i), (i -= r), this.view.set(e.view.subarray(e.offset, e.limit), i), (e.offset += r), n && (this.offset += r), this
  36557. }),
  36558. (a.appendTo = function (e, t) {
  36559. return e.append(this, t), this
  36560. }),
  36561. (a.assert = function (e) {
  36562. return (this.noAssert = !e), this
  36563. }),
  36564. (a.capacity = function () {
  36565. return this.buffer.byteLength
  36566. }),
  36567. (a.clear = function () {
  36568. return (this.offset = 0), (this.limit = this.buffer.byteLength), (this.markedOffset = -1), this
  36569. }),
  36570. (a.clone = function (e) {
  36571. var t = new o(0, this.littleEndian, this.noAssert)
  36572. return (
  36573. e ? ((t.buffer = new ArrayBuffer(this.buffer.byteLength)), (t.view = new Uint8Array(t.buffer))) : ((t.buffer = this.buffer), (t.view = this.view)),
  36574. (t.offset = this.offset),
  36575. (t.markedOffset = this.markedOffset),
  36576. (t.limit = this.limit),
  36577. t
  36578. )
  36579. }),
  36580. (a.compact = function (e, t) {
  36581. if (('undefined' == typeof e && (e = this.offset), 'undefined' == typeof t && (t = this.limit), !this.noAssert)) {
  36582. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal begin: Not an integer')
  36583. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal end: Not an integer')
  36584. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength)
  36585. }
  36586. if (0 === e && t === this.buffer.byteLength) return this
  36587. var i = t - e
  36588. if (0 === i) return (this.buffer = s), (this.view = null), this.markedOffset >= 0 && (this.markedOffset -= e), (this.offset = 0), (this.limit = 0), this
  36589. var n = new ArrayBuffer(i),
  36590. r = new Uint8Array(n)
  36591. return r.set(this.view.subarray(e, t)), (this.buffer = n), (this.view = r), this.markedOffset >= 0 && (this.markedOffset -= e), (this.offset = 0), (this.limit = i), this
  36592. }),
  36593. (a.copy = function (e, t) {
  36594. if (('undefined' == typeof e && (e = this.offset), 'undefined' == typeof t && (t = this.limit), !this.noAssert)) {
  36595. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal begin: Not an integer')
  36596. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal end: Not an integer')
  36597. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength)
  36598. }
  36599. if (e === t) return new o(0, this.littleEndian, this.noAssert)
  36600. var i = t - e,
  36601. n = new o(i, this.littleEndian, this.noAssert)
  36602. return (n.offset = 0), (n.limit = i), n.markedOffset >= 0 && (n.markedOffset -= e), this.copyTo(n, 0, e, t), n
  36603. }),
  36604. (a.copyTo = function (e, t, i, n) {
  36605. var r, a
  36606. if (!this.noAssert && !o.isByteBuffer(e)) throw TypeError('Illegal target: Not a ByteBuffer')
  36607. if (
  36608. ((t = (a = 'undefined' == typeof t) ? e.offset : 0 | t),
  36609. (i = (r = 'undefined' == typeof i) ? this.offset : 0 | i),
  36610. (n = 'undefined' == typeof n ? this.limit : 0 | n),
  36611. t < 0 || t > e.buffer.byteLength)
  36612. )
  36613. throw RangeError('Illegal target range: 0 <= ' + t + ' <= ' + e.buffer.byteLength)
  36614. if (i < 0 || n > this.buffer.byteLength) throw RangeError('Illegal source range: 0 <= ' + i + ' <= ' + this.buffer.byteLength)
  36615. var s = n - i
  36616. return 0 === s ? e : (e.ensureCapacity(t + s), e.view.set(this.view.subarray(i, n), t), r && (this.offset += s), a && (e.offset += s), this)
  36617. }),
  36618. (a.ensureCapacity = function (e) {
  36619. var t = this.buffer.byteLength
  36620. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  36621. }),
  36622. (a.fill = function (e, t, i) {
  36623. var n = 'undefined' == typeof t
  36624. if (
  36625. (n && (t = this.offset),
  36626. 'string' == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  36627. 'undefined' == typeof t && (t = this.offset),
  36628. 'undefined' == typeof i && (i = this.limit),
  36629. !this.noAssert)
  36630. ) {
  36631. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  36632. if (((e |= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal begin: Not an integer')
  36633. if (((t >>>= 0), 'number' != typeof i || i % 1 !== 0)) throw TypeError('Illegal end: Not an integer')
  36634. if (((i >>>= 0), t < 0 || t > i || i > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + t + ' <= ' + i + ' <= ' + this.buffer.byteLength)
  36635. }
  36636. if (t >= i) return this
  36637. for (; t < i; ) this.view[t++] = e
  36638. return n && (this.offset = t), this
  36639. }),
  36640. (a.flip = function () {
  36641. return (this.limit = this.offset), (this.offset = 0), this
  36642. }),
  36643. (a.mark = function (e) {
  36644. if (((e = 'undefined' == typeof e ? this.offset : e), !this.noAssert)) {
  36645. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  36646. if (((e >>>= 0), e < 0 || e + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+0) <= ' + this.buffer.byteLength)
  36647. }
  36648. return (this.markedOffset = e), this
  36649. }),
  36650. (a.order = function (e) {
  36651. if (!this.noAssert && 'boolean' != typeof e) throw TypeError('Illegal littleEndian: Not a boolean')
  36652. return (this.littleEndian = !!e), this
  36653. }),
  36654. (a.LE = function (e) {
  36655. return (this.littleEndian = 'undefined' == typeof e || !!e), this
  36656. }),
  36657. (a.BE = function (e) {
  36658. return (this.littleEndian = 'undefined' != typeof e && !e), this
  36659. }),
  36660. (a.prepend = function (e, t, i) {
  36661. ;('number' != typeof t && 'string' == typeof t) || ((i = t), (t = void 0))
  36662. var n = 'undefined' == typeof i
  36663. if ((n && (i = this.offset), !this.noAssert)) {
  36664. if ('number' != typeof i || i % 1 !== 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  36665. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  36666. }
  36667. e instanceof o || (e = o.wrap(e, t))
  36668. var r = e.limit - e.offset
  36669. if (r <= 0) return this
  36670. var a = r - i
  36671. if (a > 0) {
  36672. var s = new ArrayBuffer(this.buffer.byteLength + a),
  36673. l = new Uint8Array(s)
  36674. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  36675. (this.buffer = s),
  36676. (this.view = l),
  36677. (this.offset += a),
  36678. this.markedOffset >= 0 && (this.markedOffset += a),
  36679. (this.limit += a),
  36680. (i += a)
  36681. } else {
  36682. new Uint8Array(this.buffer)
  36683. }
  36684. return this.view.set(e.view.subarray(e.offset, e.limit), i - r), (e.offset = e.limit), n && (this.offset -= r), this
  36685. }),
  36686. (a.prependTo = function (e, t) {
  36687. return e.prepend(this, t), this
  36688. }),
  36689. (a.printDebug = function (e) {
  36690. 'function' != typeof e && (e = console.log.bind(console)), e(this.toString() + '\n-------------------------------------------------------------------\n' + this.toDebug(!0))
  36691. }),
  36692. (a.remaining = function () {
  36693. return this.limit - this.offset
  36694. }),
  36695. (a.reset = function () {
  36696. return this.markedOffset >= 0 ? ((this.offset = this.markedOffset), (this.markedOffset = -1)) : (this.offset = 0), this
  36697. }),
  36698. (a.resize = function (e) {
  36699. if (!this.noAssert) {
  36700. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal capacity: ' + e + ' (not an integer)')
  36701. if (((e |= 0), e < 0)) throw RangeError('Illegal capacity: 0 <= ' + e)
  36702. }
  36703. if (this.buffer.byteLength < e) {
  36704. var t = new ArrayBuffer(e),
  36705. i = new Uint8Array(t)
  36706. i.set(this.view), (this.buffer = t), (this.view = i)
  36707. }
  36708. return this
  36709. }),
  36710. (a.reverse = function (e, t) {
  36711. if (('undefined' == typeof e && (e = this.offset), 'undefined' == typeof t && (t = this.limit), !this.noAssert)) {
  36712. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal begin: Not an integer')
  36713. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal end: Not an integer')
  36714. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength)
  36715. }
  36716. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)), this)
  36717. }),
  36718. (a.skip = function (e) {
  36719. if (!this.noAssert) {
  36720. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal length: ' + e + ' (not an integer)')
  36721. e |= 0
  36722. }
  36723. var t = this.offset + e
  36724. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength)) throw RangeError('Illegal length: 0 <= ' + this.offset + ' + ' + e + ' <= ' + this.buffer.byteLength)
  36725. return (this.offset = t), this
  36726. }),
  36727. (a.slice = function (e, t) {
  36728. if (('undefined' == typeof e && (e = this.offset), 'undefined' == typeof t && (t = this.limit), !this.noAssert)) {
  36729. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal begin: Not an integer')
  36730. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal end: Not an integer')
  36731. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength)
  36732. }
  36733. var i = this.clone()
  36734. return (i.offset = e), (i.limit = t), i
  36735. }),
  36736. (a.toBuffer = function (e) {
  36737. var t = this.offset,
  36738. i = this.limit
  36739. if (!this.noAssert) {
  36740. if ('number' != typeof t || t % 1 !== 0) throw TypeError('Illegal offset: Not an integer')
  36741. if (((t >>>= 0), 'number' != typeof i || i % 1 !== 0)) throw TypeError('Illegal limit: Not an integer')
  36742. if (((i >>>= 0), t < 0 || t > i || i > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + t + ' <= ' + i + ' <= ' + this.buffer.byteLength)
  36743. }
  36744. if (!e && 0 === t && i === this.buffer.byteLength) return this.buffer
  36745. if (t === i) return s
  36746. var n = new ArrayBuffer(i - t)
  36747. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0), n
  36748. }),
  36749. (a.toArrayBuffer = a.toBuffer),
  36750. (a.toString = function (e, t, i) {
  36751. if ('undefined' == typeof e) return 'ByteBufferAB(offset=' + this.offset + ',markedOffset=' + this.markedOffset + ',limit=' + this.limit + ',capacity=' + this.capacity() + ')'
  36752. switch (('number' == typeof e && ((e = 'utf8'), (t = e), (i = t)), e)) {
  36753. case 'utf8':
  36754. return this.toUTF8(t, i)
  36755. case 'base64':
  36756. return this.toBase64(t, i)
  36757. case 'hex':
  36758. return this.toHex(t, i)
  36759. case 'binary':
  36760. return this.toBinary(t, i)
  36761. case 'debug':
  36762. return this.toDebug()
  36763. case 'columns':
  36764. return this.toColumns()
  36765. default:
  36766. throw Error('Unsupported encoding: ' + e)
  36767. }
  36768. })
  36769. var c = (function () {
  36770. for (
  36771. var e = {},
  36772. t = [
  36773. 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
  36774. 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47
  36775. ],
  36776. i = [],
  36777. n = 0,
  36778. r = t.length;
  36779. n < r;
  36780. ++n
  36781. )
  36782. i[t[n]] = n
  36783. return (
  36784. (e.encode = function (e, i) {
  36785. for (var n, r; null !== (n = e()); )
  36786. i(t[(n >> 2) & 63]),
  36787. (r = (3 & n) << 4),
  36788. null !== (n = e())
  36789. ? ((r |= (n >> 4) & 15), i(t[63 & (r | ((n >> 4) & 15))]), (r = (15 & n) << 2), null !== (n = e()) ? (i(t[63 & (r | ((n >> 6) & 3))]), i(t[63 & n])) : (i(t[63 & r]), i(61)))
  36790. : (i(t[63 & r]), i(61), i(61))
  36791. }),
  36792. (e.decode = function (e, t) {
  36793. function n(e) {
  36794. throw Error('Illegal character code: ' + e)
  36795. }
  36796. for (var r, o, a; null !== (r = e()); )
  36797. if (((o = i[r]), 'undefined' == typeof o && n(r), null !== (r = e()) && ((a = i[r]), 'undefined' == typeof a && n(r), t(((o << 2) >>> 0) | ((48 & a) >> 4)), null !== (r = e())))) {
  36798. if (((o = i[r]), 'undefined' == typeof o)) {
  36799. if (61 === r) break
  36800. n(r)
  36801. }
  36802. if ((t((((15 & a) << 4) >>> 0) | ((60 & o) >> 2)), null !== (r = e()))) {
  36803. if (((a = i[r]), 'undefined' == typeof a)) {
  36804. if (61 === r) break
  36805. n(r)
  36806. }
  36807. t((((3 & o) << 6) >>> 0) | a)
  36808. }
  36809. }
  36810. }),
  36811. (e.test = function (e) {
  36812. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  36813. }),
  36814. e
  36815. )
  36816. })()
  36817. ;(a.toBase64 = function (e, t) {
  36818. if (('undefined' == typeof e && (e = this.offset), 'undefined' == typeof t && (t = this.limit), (e |= 0), (t |= 0), e < 0 || t > this.capacity || e > t)) throw RangeError('begin, end')
  36819. var n
  36820. return (
  36821. c.encode(
  36822. function () {
  36823. return e < t ? this.view[e++] : null
  36824. }.bind(this),
  36825. (n = i())
  36826. ),
  36827. n()
  36828. )
  36829. }),
  36830. (o.fromBase64 = function (e, i) {
  36831. if ('string' != typeof e) throw TypeError('str')
  36832. var n = new o((e.length / 4) * 3, i),
  36833. r = 0
  36834. return (
  36835. c.decode(t(e), function (e) {
  36836. n.view[r++] = e
  36837. }),
  36838. (n.limit = r),
  36839. n
  36840. )
  36841. }),
  36842. (o.btoa = function (e) {
  36843. return o.fromBinary(e).toBase64()
  36844. }),
  36845. (o.atob = function (e) {
  36846. return o.fromBase64(e).toBinary()
  36847. }),
  36848. (a.toBinary = function (e, t) {
  36849. if (('undefined' == typeof e && (e = this.offset), 'undefined' == typeof t && (t = this.limit), (e |= 0), (t |= 0), e < 0 || t > this.capacity() || e > t)) throw RangeError('begin, end')
  36850. if (e === t) return ''
  36851. for (var i = [], n = []; e < t; ) i.push(this.view[e++]), i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)), (i = []))
  36852. return n.join('') + String.fromCharCode.apply(String, i)
  36853. }),
  36854. (o.fromBinary = function (e, t) {
  36855. if ('string' != typeof e) throw TypeError('str')
  36856. for (var i, n = 0, r = e.length, a = new o(r, t); n < r; ) {
  36857. if (((i = e.charCodeAt(n)), i > 255)) throw RangeError('illegal char code: ' + i)
  36858. a.view[n++] = i
  36859. }
  36860. return (a.limit = r), a
  36861. }),
  36862. (a.toDebug = function (e) {
  36863. for (var t, i = -1, n = this.buffer.byteLength, r = '', o = '', a = ''; i < n; ) {
  36864. if (
  36865. (i !== -1 && ((t = this.view[i]), (r += t < 16 ? '0' + t.toString(16).toUpperCase() : t.toString(16).toUpperCase()), e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : '.')),
  36866. ++i,
  36867. e && i > 0 && i % 16 === 0 && i !== n)
  36868. ) {
  36869. for (; r.length < 51; ) r += ' '
  36870. ;(a += r + o + '\n'), (r = o = '')
  36871. }
  36872. r +=
  36873. i === this.offset && i === this.limit
  36874. ? i === this.markedOffset
  36875. ? '!'
  36876. : '|'
  36877. : i === this.offset
  36878. ? i === this.markedOffset
  36879. ? '['
  36880. : '<'
  36881. : i === this.limit
  36882. ? i === this.markedOffset
  36883. ? ']'
  36884. : '>'
  36885. : i === this.markedOffset
  36886. ? "'"
  36887. : e || (0 !== i && i !== n)
  36888. ? ' '
  36889. : ''
  36890. }
  36891. if (e && ' ' !== r) {
  36892. for (; r.length < 51; ) r += ' '
  36893. a += r + o + '\n'
  36894. }
  36895. return e ? a : r
  36896. }),
  36897. (o.fromDebug = function (e, t, i) {
  36898. for (var n, r, a = e.length, s = new o(((a + 1) / 3) | 0, t, i), l = 0, c = 0, h = !1, u = !1, d = !1, p = !1, f = !1; l < a; ) {
  36899. switch ((n = e.charAt(l++))) {
  36900. case '!':
  36901. if (!i) {
  36902. if (u || d || p) {
  36903. f = !0
  36904. break
  36905. }
  36906. u = d = p = !0
  36907. }
  36908. ;(s.offset = s.markedOffset = s.limit = c), (h = !1)
  36909. break
  36910. case '|':
  36911. if (!i) {
  36912. if (u || p) {
  36913. f = !0
  36914. break
  36915. }
  36916. u = p = !0
  36917. }
  36918. ;(s.offset = s.limit = c), (h = !1)
  36919. break
  36920. case '[':
  36921. if (!i) {
  36922. if (u || d) {
  36923. f = !0
  36924. break
  36925. }
  36926. u = d = !0
  36927. }
  36928. ;(s.offset = s.markedOffset = c), (h = !1)
  36929. break
  36930. case '<':
  36931. if (!i) {
  36932. if (u) {
  36933. f = !0
  36934. break
  36935. }
  36936. u = !0
  36937. }
  36938. ;(s.offset = c), (h = !1)
  36939. break
  36940. case ']':
  36941. if (!i) {
  36942. if (p || d) {
  36943. f = !0
  36944. break
  36945. }
  36946. p = d = !0
  36947. }
  36948. ;(s.limit = s.markedOffset = c), (h = !1)
  36949. break
  36950. case '>':
  36951. if (!i) {
  36952. if (p) {
  36953. f = !0
  36954. break
  36955. }
  36956. p = !0
  36957. }
  36958. ;(s.limit = c), (h = !1)
  36959. break
  36960. case "'":
  36961. if (!i) {
  36962. if (d) {
  36963. f = !0
  36964. break
  36965. }
  36966. d = !0
  36967. }
  36968. ;(s.markedOffset = c), (h = !1)
  36969. break
  36970. case ' ':
  36971. h = !1
  36972. break
  36973. default:
  36974. if (!i && h) {
  36975. f = !0
  36976. break
  36977. }
  36978. if (((r = parseInt(n + e.charAt(l++), 16)), !i && (isNaN(r) || r < 0 || r > 255))) throw TypeError('Illegal str: Not a debug encoded string')
  36979. ;(s.view[c++] = r), (h = !0)
  36980. }
  36981. if (f) throw TypeError('Illegal str: Invalid symbol at ' + l)
  36982. }
  36983. if (!i) {
  36984. if (!u || !p) throw TypeError('Illegal str: Missing offset or limit')
  36985. if (c < s.buffer.byteLength) throw TypeError('Illegal str: Not a debug encoded string (is it hex?) ' + c + ' < ' + a)
  36986. }
  36987. return s
  36988. }),
  36989. (a.toHex = function (e, t) {
  36990. if (((e = 'undefined' == typeof e ? this.offset : e), (t = 'undefined' == typeof t ? this.limit : t), !this.noAssert)) {
  36991. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal begin: Not an integer')
  36992. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal end: Not an integer')
  36993. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength)
  36994. }
  36995. for (var i, n = new Array(t - e); e < t; ) (i = this.view[e++]), i < 16 ? n.push('0', i.toString(16)) : n.push(i.toString(16))
  36996. return n.join('')
  36997. }),
  36998. (o.fromHex = function (e, t, i) {
  36999. if (!i) {
  37000. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  37001. if (e.length % 2 !== 0) throw TypeError('Illegal str: Length not a multiple of 2')
  37002. }
  37003. for (var n, r = e.length, a = new o((r / 2) | 0, t), s = 0, l = 0; s < r; s += 2) {
  37004. if (((n = parseInt(e.substring(s, s + 2), 16)), !i && (!isFinite(n) || n < 0 || n > 255))) throw TypeError('Illegal str: Contains non-hex characters')
  37005. a.view[l++] = n
  37006. }
  37007. return (a.limit = l), a
  37008. })
  37009. var h = (function () {
  37010. var e = {}
  37011. return (
  37012. (e.MAX_CODEPOINT = 1114111),
  37013. (e.encodeUTF8 = function (e, t) {
  37014. var i = null
  37015. for (
  37016. 'number' == typeof e &&
  37017. ((i = e),
  37018. (e = function () {
  37019. return null
  37020. }));
  37021. null !== i || null !== (i = e());
  37022. )
  37023. i < 128
  37024. ? t(127 & i)
  37025. : i < 2048
  37026. ? (t(((i >> 6) & 31) | 192), t((63 & i) | 128))
  37027. : i < 65536
  37028. ? (t(((i >> 12) & 15) | 224), t(((i >> 6) & 63) | 128), t((63 & i) | 128))
  37029. : (t(((i >> 18) & 7) | 240), t(((i >> 12) & 63) | 128), t(((i >> 6) & 63) | 128), t((63 & i) | 128)),
  37030. (i = null)
  37031. }),
  37032. (e.decodeUTF8 = function (e, t) {
  37033. for (
  37034. var i,
  37035. n,
  37036. r,
  37037. o,
  37038. a = function (e) {
  37039. e = e.slice(0, e.indexOf(null))
  37040. var t = Error(e.toString())
  37041. throw ((t.name = 'TruncatedError'), (t.bytes = e), t)
  37042. };
  37043. null !== (i = e());
  37044. )
  37045. if (0 === (128 & i)) t(i)
  37046. else if (192 === (224 & i)) null === (n = e()) && a([i, n]), t(((31 & i) << 6) | (63 & n))
  37047. else if (224 === (240 & i)) (null === (n = e()) || null === (r = e())) && a([i, n, r]), t(((15 & i) << 12) | ((63 & n) << 6) | (63 & r))
  37048. else {
  37049. if (240 !== (248 & i)) throw RangeError('Illegal starting byte: ' + i)
  37050. ;(null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]), t(((7 & i) << 18) | ((63 & n) << 12) | ((63 & r) << 6) | (63 & o))
  37051. }
  37052. }),
  37053. (e.UTF16toUTF8 = function (e, t) {
  37054. for (var i, n = null; ; ) {
  37055. if (null === (i = null !== n ? n : e())) break
  37056. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536), (n = null)) : t(i)
  37057. }
  37058. null !== n && t(n)
  37059. }),
  37060. (e.UTF8toUTF16 = function (e, t) {
  37061. var i = null
  37062. for (
  37063. 'number' == typeof e &&
  37064. ((i = e),
  37065. (e = function () {
  37066. return null
  37067. }));
  37068. null !== i || null !== (i = e());
  37069. )
  37070. i <= 65535 ? t(i) : ((i -= 65536), t((i >> 10) + 55296), t((i % 1024) + 56320)), (i = null)
  37071. }),
  37072. (e.encodeUTF16toUTF8 = function (t, i) {
  37073. e.UTF16toUTF8(t, function (t) {
  37074. e.encodeUTF8(t, i)
  37075. })
  37076. }),
  37077. (e.decodeUTF8toUTF16 = function (t, i) {
  37078. e.decodeUTF8(t, function (t) {
  37079. e.UTF8toUTF16(t, i)
  37080. })
  37081. }),
  37082. (e.calculateCodePoint = function (e) {
  37083. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  37084. }),
  37085. (e.calculateUTF8 = function (e) {
  37086. for (var t, i = 0; null !== (t = e()); ) i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4
  37087. return i
  37088. }),
  37089. (e.calculateUTF16asUTF8 = function (t) {
  37090. var i = 0,
  37091. n = 0
  37092. return (
  37093. e.UTF16toUTF8(t, function (e) {
  37094. ++i, (n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4)
  37095. }),
  37096. [i, n]
  37097. )
  37098. }),
  37099. e
  37100. )
  37101. })()
  37102. return (
  37103. (a.toUTF8 = function (e, t) {
  37104. if (('undefined' == typeof e && (e = this.offset), 'undefined' == typeof t && (t = this.limit), !this.noAssert)) {
  37105. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal begin: Not an integer')
  37106. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal end: Not an integer')
  37107. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength)
  37108. }
  37109. var n
  37110. try {
  37111. h.decodeUTF8toUTF16(
  37112. function () {
  37113. return e < t ? this.view[e++] : null
  37114. }.bind(this),
  37115. (n = i())
  37116. )
  37117. } catch (i) {
  37118. if (e !== t) throw RangeError('Illegal range: Truncated data, ' + e + ' != ' + t)
  37119. }
  37120. return n()
  37121. }),
  37122. (o.fromUTF8 = function (e, i, n) {
  37123. if (!n && 'string' != typeof e) throw TypeError('Illegal str: Not a string')
  37124. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1], i, n),
  37125. a = 0
  37126. return (
  37127. h.encodeUTF16toUTF8(t(e), function (e) {
  37128. r.view[a++] = e
  37129. }),
  37130. (r.limit = a),
  37131. r
  37132. )
  37133. }),
  37134. o
  37135. )
  37136. })
  37137. },
  37138. {
  37139. long: 216
  37140. }
  37141. ],
  37142. 216: [
  37143. function (e, t, i) {
  37144. !(function (i, n) {
  37145. 'function' == typeof define && define.amd ? define([], n) : 'function' == typeof e && 'object' == typeof t && t && t.exports ? (t.exports = n()) : ((i.dcodeIO = i.dcodeIO || {}).Long = n())
  37146. })(this, function () {
  37147. 'use strict'
  37148. function e(e, t, i) {
  37149. ;(this.low = 0 | e), (this.high = 0 | t), (this.unsigned = !!i)
  37150. }
  37151. function t(e) {
  37152. return (e && e.__isLong__) === !0
  37153. }
  37154. function i(e, t) {
  37155. var i, n, o
  37156. return t
  37157. ? ((e >>>= 0), (o = 0 <= e && e < 256) && (n = l[e]) ? n : ((i = r(e, (0 | e) < 0 ? -1 : 0, !0)), o && (l[e] = i), i))
  37158. : ((e |= 0), (o = -128 <= e && e < 128) && (n = s[e]) ? n : ((i = r(e, e < 0 ? -1 : 0, !1)), o && (s[e] = i), i))
  37159. }
  37160. function n(e, t) {
  37161. if (isNaN(e) || !isFinite(e)) return t ? m : g
  37162. if (t) {
  37163. if (e < 0) return m
  37164. if (e >= d) return I
  37165. } else {
  37166. if (e <= -p) return E
  37167. if (e + 1 >= p) return C
  37168. }
  37169. return e < 0 ? n(-e, t).neg() : r(e % u | 0, (e / u) | 0, t)
  37170. }
  37171. function r(t, i, n) {
  37172. return new e(t, i, n)
  37173. }
  37174. function o(e, t, i) {
  37175. if (0 === e.length) throw Error('empty string')
  37176. if ('NaN' === e || 'Infinity' === e || '+Infinity' === e || '-Infinity' === e) return g
  37177. if (('number' == typeof t ? ((i = t), (t = !1)) : (t = !!t), (i = i || 10), i < 2 || 36 < i)) throw RangeError('radix')
  37178. var r
  37179. if ((r = e.indexOf('-')) > 0) throw Error('interior hyphen')
  37180. if (0 === r) return o(e.substring(1), t, i).neg()
  37181. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  37182. var h = Math.min(8, e.length - l),
  37183. u = parseInt(e.substring(l, l + h), i)
  37184. if (h < 8) {
  37185. var d = n(c(i, h))
  37186. s = s.mul(d).add(n(u))
  37187. } else (s = s.mul(a)), (s = s.add(n(u)))
  37188. }
  37189. return (s.unsigned = t), s
  37190. }
  37191. function a(t) {
  37192. return t instanceof e ? t : 'number' == typeof t ? n(t) : 'string' == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  37193. }
  37194. e.prototype.__isLong__,
  37195. Object.defineProperty(e.prototype, '__isLong__', {
  37196. value: !0,
  37197. enumerable: !1,
  37198. configurable: !1
  37199. }),
  37200. (e.isLong = t)
  37201. var s = {},
  37202. l = {}
  37203. ;(e.fromInt = i), (e.fromNumber = n), (e.fromBits = r)
  37204. var c = Math.pow
  37205. ;(e.fromString = o), (e.fromValue = a)
  37206. var h = 1 << 24,
  37207. u = 4294967296,
  37208. d = 0x10000000000000000,
  37209. p = d / 2,
  37210. f = i(h),
  37211. g = i(0)
  37212. e.ZERO = g
  37213. var m = i(0, !0)
  37214. e.UZERO = m
  37215. var v = i(1)
  37216. e.ONE = v
  37217. var A = i(1, !0)
  37218. e.UONE = A
  37219. var y = i(-1)
  37220. e.NEG_ONE = y
  37221. var C = r(-1, 2147483647, !1)
  37222. e.MAX_VALUE = C
  37223. var I = r(-1, -1, !0)
  37224. e.MAX_UNSIGNED_VALUE = I
  37225. var E = r(0, -2147483648, !1)
  37226. e.MIN_VALUE = E
  37227. var b = e.prototype
  37228. return (
  37229. (b.toInt = function () {
  37230. return this.unsigned ? this.low >>> 0 : this.low
  37231. }),
  37232. (b.toNumber = function () {
  37233. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  37234. }),
  37235. (b.toString = function (e) {
  37236. if (((e = e || 10), e < 2 || 36 < e)) throw RangeError('radix')
  37237. if (this.isZero()) return '0'
  37238. if (this.isNegative()) {
  37239. if (this.eq(E)) {
  37240. var t = n(e),
  37241. i = this.div(t),
  37242. r = i.mul(t).sub(this)
  37243. return i.toString(e) + r.toInt().toString(e)
  37244. }
  37245. return '-' + this.neg().toString(e)
  37246. }
  37247. for (var o = n(c(e, 6), this.unsigned), a = this, s = ''; ; ) {
  37248. var l = a.div(o),
  37249. h = a.sub(l.mul(o)).toInt() >>> 0,
  37250. u = h.toString(e)
  37251. if (((a = l), a.isZero())) return u + s
  37252. for (; u.length < 6; ) u = '0' + u
  37253. s = '' + u + s
  37254. }
  37255. }),
  37256. (b.getHighBits = function () {
  37257. return this.high
  37258. }),
  37259. (b.getHighBitsUnsigned = function () {
  37260. return this.high >>> 0
  37261. }),
  37262. (b.getLowBits = function () {
  37263. return this.low
  37264. }),
  37265. (b.getLowBitsUnsigned = function () {
  37266. return this.low >>> 0
  37267. }),
  37268. (b.getNumBitsAbs = function () {
  37269. if (this.isNegative()) return this.eq(E) ? 64 : this.neg().getNumBitsAbs()
  37270. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & (1 << t)); t--);
  37271. return 0 != this.high ? t + 33 : t + 1
  37272. }),
  37273. (b.isZero = function () {
  37274. return 0 === this.high && 0 === this.low
  37275. }),
  37276. (b.isNegative = function () {
  37277. return !this.unsigned && this.high < 0
  37278. }),
  37279. (b.isPositive = function () {
  37280. return this.unsigned || this.high >= 0
  37281. }),
  37282. (b.isOdd = function () {
  37283. return 1 === (1 & this.low)
  37284. }),
  37285. (b.isEven = function () {
  37286. return 0 === (1 & this.low)
  37287. }),
  37288. (b.equals = function (e) {
  37289. return t(e) || (e = a(e)), (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && this.high === e.high && this.low === e.low
  37290. }),
  37291. (b.eq = b.equals),
  37292. (b.notEquals = function (e) {
  37293. return !this.eq(e)
  37294. }),
  37295. (b.neq = b.notEquals),
  37296. (b.lessThan = function (e) {
  37297. return this.comp(e) < 0
  37298. }),
  37299. (b.lt = b.lessThan),
  37300. (b.lessThanOrEqual = function (e) {
  37301. return this.comp(e) <= 0
  37302. }),
  37303. (b.lte = b.lessThanOrEqual),
  37304. (b.greaterThan = function (e) {
  37305. return this.comp(e) > 0
  37306. }),
  37307. (b.gt = b.greaterThan),
  37308. (b.greaterThanOrEqual = function (e) {
  37309. return this.comp(e) >= 0
  37310. }),
  37311. (b.gte = b.greaterThanOrEqual),
  37312. (b.compare = function (e) {
  37313. if ((t(e) || (e = a(e)), this.eq(e))) return 0
  37314. var i = this.isNegative(),
  37315. n = e.isNegative()
  37316. return i && !n
  37317. ? -1
  37318. : !i && n
  37319. ? 1
  37320. : this.unsigned
  37321. ? e.high >>> 0 > this.high >>> 0 || (e.high === this.high && e.low >>> 0 > this.low >>> 0)
  37322. ? -1
  37323. : 1
  37324. : this.sub(e).isNegative()
  37325. ? -1
  37326. : 1
  37327. }),
  37328. (b.comp = b.compare),
  37329. (b.negate = function () {
  37330. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  37331. }),
  37332. (b.neg = b.negate),
  37333. (b.add = function (e) {
  37334. t(e) || (e = a(e))
  37335. var i = this.high >>> 16,
  37336. n = 65535 & this.high,
  37337. o = this.low >>> 16,
  37338. s = 65535 & this.low,
  37339. l = e.high >>> 16,
  37340. c = 65535 & e.high,
  37341. h = e.low >>> 16,
  37342. u = 65535 & e.low,
  37343. d = 0,
  37344. p = 0,
  37345. f = 0,
  37346. g = 0
  37347. return (
  37348. (g += s + u),
  37349. (f += g >>> 16),
  37350. (g &= 65535),
  37351. (f += o + h),
  37352. (p += f >>> 16),
  37353. (f &= 65535),
  37354. (p += n + c),
  37355. (d += p >>> 16),
  37356. (p &= 65535),
  37357. (d += i + l),
  37358. (d &= 65535),
  37359. r((f << 16) | g, (d << 16) | p, this.unsigned)
  37360. )
  37361. }),
  37362. (b.subtract = function (e) {
  37363. return t(e) || (e = a(e)), this.add(e.neg())
  37364. }),
  37365. (b.sub = b.subtract),
  37366. (b.multiply = function (e) {
  37367. if (this.isZero()) return g
  37368. if ((t(e) || (e = a(e)), e.isZero())) return g
  37369. if (this.eq(E)) return e.isOdd() ? E : g
  37370. if (e.eq(E)) return this.isOdd() ? E : g
  37371. if (this.isNegative()) return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg()
  37372. if (e.isNegative()) return this.mul(e.neg()).neg()
  37373. if (this.lt(f) && e.lt(f)) return n(this.toNumber() * e.toNumber(), this.unsigned)
  37374. var i = this.high >>> 16,
  37375. o = 65535 & this.high,
  37376. s = this.low >>> 16,
  37377. l = 65535 & this.low,
  37378. c = e.high >>> 16,
  37379. h = 65535 & e.high,
  37380. u = e.low >>> 16,
  37381. d = 65535 & e.low,
  37382. p = 0,
  37383. m = 0,
  37384. v = 0,
  37385. A = 0
  37386. return (
  37387. (A += l * d),
  37388. (v += A >>> 16),
  37389. (A &= 65535),
  37390. (v += s * d),
  37391. (m += v >>> 16),
  37392. (v &= 65535),
  37393. (v += l * u),
  37394. (m += v >>> 16),
  37395. (v &= 65535),
  37396. (m += o * d),
  37397. (p += m >>> 16),
  37398. (m &= 65535),
  37399. (m += s * u),
  37400. (p += m >>> 16),
  37401. (m &= 65535),
  37402. (m += l * h),
  37403. (p += m >>> 16),
  37404. (m &= 65535),
  37405. (p += i * d + o * u + s * h + l * c),
  37406. (p &= 65535),
  37407. r((v << 16) | A, (p << 16) | m, this.unsigned)
  37408. )
  37409. }),
  37410. (b.mul = b.multiply),
  37411. (b.divide = function (e) {
  37412. if ((t(e) || (e = a(e)), e.isZero())) throw Error('division by zero')
  37413. if (this.isZero()) return this.unsigned ? m : g
  37414. var i, r, o
  37415. if (this.unsigned) {
  37416. if ((e.unsigned || (e = e.toUnsigned()), e.gt(this))) return m
  37417. if (e.gt(this.shru(1))) return A
  37418. o = m
  37419. } else {
  37420. if (this.eq(E)) {
  37421. if (e.eq(v) || e.eq(y)) return E
  37422. if (e.eq(E)) return v
  37423. var s = this.shr(1)
  37424. return (i = s.div(e).shl(1)), i.eq(g) ? (e.isNegative() ? v : y) : ((r = this.sub(e.mul(i))), (o = i.add(r.div(e))))
  37425. }
  37426. if (e.eq(E)) return this.unsigned ? m : g
  37427. if (this.isNegative()) return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg()
  37428. if (e.isNegative()) return this.div(e.neg()).neg()
  37429. o = g
  37430. }
  37431. for (r = this; r.gte(e); ) {
  37432. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()))
  37433. for (var l = Math.ceil(Math.log(i) / Math.LN2), h = l <= 48 ? 1 : c(2, l - 48), u = n(i), d = u.mul(e); d.isNegative() || d.gt(r); ) (i -= h), (u = n(i, this.unsigned)), (d = u.mul(e))
  37434. u.isZero() && (u = v), (o = o.add(u)), (r = r.sub(d))
  37435. }
  37436. return o
  37437. }),
  37438. (b.div = b.divide),
  37439. (b.modulo = function (e) {
  37440. return t(e) || (e = a(e)), this.sub(this.div(e).mul(e))
  37441. }),
  37442. (b.mod = b.modulo),
  37443. (b.not = function () {
  37444. return r(~this.low, ~this.high, this.unsigned)
  37445. }),
  37446. (b.and = function (e) {
  37447. return t(e) || (e = a(e)), r(this.low & e.low, this.high & e.high, this.unsigned)
  37448. }),
  37449. (b.or = function (e) {
  37450. return t(e) || (e = a(e)), r(this.low | e.low, this.high | e.high, this.unsigned)
  37451. }),
  37452. (b.xor = function (e) {
  37453. return t(e) || (e = a(e)), r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  37454. }),
  37455. (b.shiftLeft = function (e) {
  37456. return t(e) && (e = e.toInt()), 0 === (e &= 63) ? this : e < 32 ? r(this.low << e, (this.high << e) | (this.low >>> (32 - e)), this.unsigned) : r(0, this.low << (e - 32), this.unsigned)
  37457. }),
  37458. (b.shl = b.shiftLeft),
  37459. (b.shiftRight = function (e) {
  37460. return (
  37461. t(e) && (e = e.toInt()),
  37462. 0 === (e &= 63) ? this : e < 32 ? r((this.low >>> e) | (this.high << (32 - e)), this.high >> e, this.unsigned) : r(this.high >> (e - 32), this.high >= 0 ? 0 : -1, this.unsigned)
  37463. )
  37464. }),
  37465. (b.shr = b.shiftRight),
  37466. (b.shiftRightUnsigned = function (e) {
  37467. if ((t(e) && (e = e.toInt()), (e &= 63), 0 === e)) return this
  37468. var i = this.high
  37469. if (e < 32) {
  37470. var n = this.low
  37471. return r((n >>> e) | (i << (32 - e)), i >>> e, this.unsigned)
  37472. }
  37473. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> (e - 32), 0, this.unsigned)
  37474. }),
  37475. (b.shru = b.shiftRightUnsigned),
  37476. (b.toSigned = function () {
  37477. return this.unsigned ? r(this.low, this.high, !1) : this
  37478. }),
  37479. (b.toUnsigned = function () {
  37480. return this.unsigned ? this : r(this.low, this.high, !0)
  37481. }),
  37482. (b.toBytes = function (e) {
  37483. return e ? this.toBytesLE() : this.toBytesBE()
  37484. }),
  37485. (b.toBytesLE = function () {
  37486. var e = this.high,
  37487. t = this.low
  37488. return [255 & t, (t >>> 8) & 255, (t >>> 16) & 255, (t >>> 24) & 255, 255 & e, (e >>> 8) & 255, (e >>> 16) & 255, (e >>> 24) & 255]
  37489. }),
  37490. (b.toBytesBE = function () {
  37491. var e = this.high,
  37492. t = this.low
  37493. return [(e >>> 24) & 255, (e >>> 16) & 255, (e >>> 8) & 255, 255 & e, (t >>> 24) & 255, (t >>> 16) & 255, (t >>> 8) & 255, 255 & t]
  37494. }),
  37495. e
  37496. )
  37497. })
  37498. },
  37499. {}
  37500. ],
  37501. 217: [
  37502. function (e, t, i) {
  37503. var n = {
  37504. REVISION: '75'
  37505. }
  37506. 'function' == typeof define && define.amd ? define('three', n) : 'undefined' != typeof i && 'undefined' != typeof t && (t.exports = n),
  37507. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  37508. void 0 === Math.sign &&
  37509. (Math.sign = function (e) {
  37510. return e < 0 ? -1 : e > 0 ? 1 : +e
  37511. }),
  37512. void 0 === Function.prototype.name &&
  37513. void 0 !== Object.defineProperty &&
  37514. Object.defineProperty(Function.prototype, 'name', {
  37515. get: function () {
  37516. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  37517. }
  37518. }),
  37519. void 0 === Object.assign &&
  37520. Object.defineProperty(Object, 'assign', {
  37521. writable: !0,
  37522. configurable: !0,
  37523. value: function (e) {
  37524. 'use strict'
  37525. if (void 0 === e || null === e) throw new TypeError('Cannot convert first argument to object')
  37526. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  37527. var r = arguments[i]
  37528. if (void 0 !== r && null !== r) {
  37529. r = Object(r)
  37530. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  37531. var l = o[a],
  37532. c = Object.getOwnPropertyDescriptor(r, l)
  37533. void 0 !== c && c.enumerable && (t[l] = r[l])
  37534. }
  37535. }
  37536. }
  37537. return t
  37538. }
  37539. }),
  37540. (n.MOUSE = {
  37541. LEFT: 0,
  37542. MIDDLE: 1,
  37543. RIGHT: 2
  37544. }),
  37545. (n.CullFaceNone = 0),
  37546. (n.CullFaceBack = 1),
  37547. (n.CullFaceFront = 2),
  37548. (n.CullFaceFrontBack = 3),
  37549. (n.FrontFaceDirectionCW = 0),
  37550. (n.FrontFaceDirectionCCW = 1),
  37551. (n.BasicShadowMap = 0),
  37552. (n.PCFShadowMap = 1),
  37553. (n.PCFSoftShadowMap = 2),
  37554. (n.FrontSide = 0),
  37555. (n.BackSide = 1),
  37556. (n.DoubleSide = 2),
  37557. (n.FlatShading = 1),
  37558. (n.SmoothShading = 2),
  37559. (n.NoColors = 0),
  37560. (n.FaceColors = 1),
  37561. (n.VertexColors = 2),
  37562. (n.NoBlending = 0),
  37563. (n.NormalBlending = 1),
  37564. (n.AdditiveBlending = 2),
  37565. (n.SubtractiveBlending = 3),
  37566. (n.MultiplyBlending = 4),
  37567. (n.CustomBlending = 5),
  37568. (n.AddEquation = 100),
  37569. (n.SubtractEquation = 101),
  37570. (n.ReverseSubtractEquation = 102),
  37571. (n.MinEquation = 103),
  37572. (n.MaxEquation = 104),
  37573. (n.ZeroFactor = 200),
  37574. (n.OneFactor = 201),
  37575. (n.SrcColorFactor = 202),
  37576. (n.OneMinusSrcColorFactor = 203),
  37577. (n.SrcAlphaFactor = 204),
  37578. (n.OneMinusSrcAlphaFactor = 205),
  37579. (n.DstAlphaFactor = 206),
  37580. (n.OneMinusDstAlphaFactor = 207),
  37581. (n.DstColorFactor = 208),
  37582. (n.OneMinusDstColorFactor = 209),
  37583. (n.SrcAlphaSaturateFactor = 210),
  37584. (n.NeverDepth = 0),
  37585. (n.AlwaysDepth = 1),
  37586. (n.LessDepth = 2),
  37587. (n.LessEqualDepth = 3),
  37588. (n.EqualDepth = 4),
  37589. (n.GreaterEqualDepth = 5),
  37590. (n.GreaterDepth = 6),
  37591. (n.NotEqualDepth = 7),
  37592. (n.MultiplyOperation = 0),
  37593. (n.MixOperation = 1),
  37594. (n.AddOperation = 2),
  37595. (n.NoToneMapping = 0),
  37596. (n.LinearToneMapping = 1),
  37597. (n.ReinhardToneMapping = 2),
  37598. (n.Uncharted2ToneMapping = 3),
  37599. (n.CineonToneMapping = 4),
  37600. (n.UVMapping = 300),
  37601. (n.CubeReflectionMapping = 301),
  37602. (n.CubeRefractionMapping = 302),
  37603. (n.EquirectangularReflectionMapping = 303),
  37604. (n.EquirectangularRefractionMapping = 304),
  37605. (n.SphericalReflectionMapping = 305),
  37606. (n.CubeUVReflectionMapping = 306),
  37607. (n.CubeUVRefractionMapping = 307),
  37608. (n.RepeatWrapping = 1e3),
  37609. (n.ClampToEdgeWrapping = 1001),
  37610. (n.MirroredRepeatWrapping = 1002),
  37611. (n.NearestFilter = 1003),
  37612. (n.NearestMipMapNearestFilter = 1004),
  37613. (n.NearestMipMapLinearFilter = 1005),
  37614. (n.LinearFilter = 1006),
  37615. (n.LinearMipMapNearestFilter = 1007),
  37616. (n.LinearMipMapLinearFilter = 1008),
  37617. (n.UnsignedByteType = 1009),
  37618. (n.ByteType = 1010),
  37619. (n.ShortType = 1011),
  37620. (n.UnsignedShortType = 1012),
  37621. (n.IntType = 1013),
  37622. (n.UnsignedIntType = 1014),
  37623. (n.FloatType = 1015),
  37624. (n.HalfFloatType = 1025),
  37625. (n.UnsignedShort4444Type = 1016),
  37626. (n.UnsignedShort5551Type = 1017),
  37627. (n.UnsignedShort565Type = 1018),
  37628. (n.AlphaFormat = 1019),
  37629. (n.RGBFormat = 1020),
  37630. (n.RGBAFormat = 1021),
  37631. (n.LuminanceFormat = 1022),
  37632. (n.LuminanceAlphaFormat = 1023),
  37633. (n.RGBEFormat = n.RGBAFormat),
  37634. (n.RGB_S3TC_DXT1_Format = 2001),
  37635. (n.RGBA_S3TC_DXT1_Format = 2002),
  37636. (n.RGBA_S3TC_DXT3_Format = 2003),
  37637. (n.RGBA_S3TC_DXT5_Format = 2004),
  37638. (n.RGB_PVRTC_4BPPV1_Format = 2100),
  37639. (n.RGB_PVRTC_2BPPV1_Format = 2101),
  37640. (n.RGBA_PVRTC_4BPPV1_Format = 2102),
  37641. (n.RGBA_PVRTC_2BPPV1_Format = 2103),
  37642. (n.RGB_ETC1_Format = 2151),
  37643. (n.LoopOnce = 2200),
  37644. (n.LoopRepeat = 2201),
  37645. (n.LoopPingPong = 2202),
  37646. (n.InterpolateDiscrete = 2300),
  37647. (n.InterpolateLinear = 2301),
  37648. (n.InterpolateSmooth = 2302),
  37649. (n.ZeroCurvatureEnding = 2400),
  37650. (n.ZeroSlopeEnding = 2401),
  37651. (n.WrapAroundEnding = 2402),
  37652. (n.TrianglesDrawMode = 0),
  37653. (n.TriangleStripDrawMode = 1),
  37654. (n.TriangleFanDrawMode = 2),
  37655. (n.LinearEncoding = 3e3),
  37656. (n.sRGBEncoding = 3001),
  37657. (n.GammaEncoding = 3007),
  37658. (n.RGBEEncoding = 3002),
  37659. (n.LogLuvEncoding = 3003),
  37660. (n.RGBM7Encoding = 3004),
  37661. (n.RGBM16Encoding = 3005),
  37662. (n.RGBDEncoding = 3006),
  37663. (n.Color = function (e) {
  37664. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  37665. }),
  37666. (n.Color.prototype = {
  37667. constructor: n.Color,
  37668. r: 1,
  37669. g: 1,
  37670. b: 1,
  37671. set: function (e) {
  37672. return e instanceof n.Color ? this.copy(e) : 'number' == typeof e ? this.setHex(e) : 'string' == typeof e && this.setStyle(e), this
  37673. },
  37674. setScalar: function (e) {
  37675. ;(this.r = e), (this.g = e), (this.b = e)
  37676. },
  37677. setHex: function (e) {
  37678. return (e = Math.floor(e)), (this.r = ((e >> 16) & 255) / 255), (this.g = ((e >> 8) & 255) / 255), (this.b = (255 & e) / 255), this
  37679. },
  37680. setRGB: function (e, t, i) {
  37681. return (this.r = e), (this.g = t), (this.b = i), this
  37682. },
  37683. setHSL: (function () {
  37684. function e(e, t, i) {
  37685. return i < 0 && (i += 1), i > 1 && (i -= 1), i < 1 / 6 ? e + 6 * (t - e) * i : i < 0.5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  37686. }
  37687. return function (t, i, r) {
  37688. if (((t = n.Math.euclideanModulo(t, 1)), (i = n.Math.clamp(i, 0, 1)), (r = n.Math.clamp(r, 0, 1)), 0 === i)) this.r = this.g = this.b = r
  37689. else {
  37690. var o = r <= 0.5 ? r * (1 + i) : r + i - r * i,
  37691. a = 2 * r - o
  37692. ;(this.r = e(a, o, t + 1 / 3)), (this.g = e(a, o, t)), (this.b = e(a, o, t - 1 / 3))
  37693. }
  37694. return this
  37695. }
  37696. })(),
  37697. setStyle: function (e) {
  37698. function t(t) {
  37699. void 0 !== t && parseFloat(t) < 1 && console.warn('THREE.Color: Alpha component of ' + e + ' will be ignored.')
  37700. }
  37701. var i
  37702. if ((i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e))) {
  37703. var r,
  37704. o = i[1],
  37705. a = i[2]
  37706. switch (o) {
  37707. case 'rgb':
  37708. case 'rgba':
  37709. if ((r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)))
  37710. return (this.r = Math.min(255, parseInt(r[1], 10)) / 255), (this.g = Math.min(255, parseInt(r[2], 10)) / 255), (this.b = Math.min(255, parseInt(r[3], 10)) / 255), t(r[5]), this
  37711. if ((r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)))
  37712. return (this.r = Math.min(100, parseInt(r[1], 10)) / 100), (this.g = Math.min(100, parseInt(r[2], 10)) / 100), (this.b = Math.min(100, parseInt(r[3], 10)) / 100), t(r[5]), this
  37713. break
  37714. case 'hsl':
  37715. case 'hsla':
  37716. if ((r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))) {
  37717. var s = parseFloat(r[1]) / 360,
  37718. l = parseInt(r[2], 10) / 100,
  37719. c = parseInt(r[3], 10) / 100
  37720. return t(r[5]), this.setHSL(s, l, c)
  37721. }
  37722. }
  37723. } else if ((i = /^\#([A-Fa-f0-9]+)$/.exec(e))) {
  37724. var h = i[1],
  37725. u = h.length
  37726. if (3 === u)
  37727. return (
  37728. (this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255), (this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255), (this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255), this
  37729. )
  37730. if (6 === u)
  37731. return (
  37732. (this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255), (this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255), (this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255), this
  37733. )
  37734. }
  37735. if (e && e.length > 0) {
  37736. var h = n.ColorKeywords[e]
  37737. void 0 !== h ? this.setHex(h) : console.warn('THREE.Color: Unknown color ' + e)
  37738. }
  37739. return this
  37740. },
  37741. clone: function () {
  37742. return new this.constructor(this.r, this.g, this.b)
  37743. },
  37744. copy: function (e) {
  37745. return (this.r = e.r), (this.g = e.g), (this.b = e.b), this
  37746. },
  37747. copyGammaToLinear: function (e, t) {
  37748. return void 0 === t && (t = 2), (this.r = Math.pow(e.r, t)), (this.g = Math.pow(e.g, t)), (this.b = Math.pow(e.b, t)), this
  37749. },
  37750. copyLinearToGamma: function (e, t) {
  37751. void 0 === t && (t = 2)
  37752. var i = t > 0 ? 1 / t : 1
  37753. return (this.r = Math.pow(e.r, i)), (this.g = Math.pow(e.g, i)), (this.b = Math.pow(e.b, i)), this
  37754. },
  37755. convertGammaToLinear: function () {
  37756. var e = this.r,
  37757. t = this.g,
  37758. i = this.b
  37759. return (this.r = e * e), (this.g = t * t), (this.b = i * i), this
  37760. },
  37761. convertLinearToGamma: function () {
  37762. return (this.r = Math.sqrt(this.r)), (this.g = Math.sqrt(this.g)), (this.b = Math.sqrt(this.b)), this
  37763. },
  37764. getHex: function () {
  37765. return ((255 * this.r) << 16) ^ ((255 * this.g) << 8) ^ ((255 * this.b) << 0)
  37766. },
  37767. getHexString: function () {
  37768. return ('000000' + this.getHex().toString(16)).slice(-6)
  37769. },
  37770. getHSL: function (e) {
  37771. var t,
  37772. i,
  37773. n = e || {
  37774. h: 0,
  37775. s: 0,
  37776. l: 0
  37777. },
  37778. r = this.r,
  37779. o = this.g,
  37780. a = this.b,
  37781. s = Math.max(r, o, a),
  37782. l = Math.min(r, o, a),
  37783. c = (l + s) / 2
  37784. if (l === s) (t = 0), (i = 0)
  37785. else {
  37786. var h = s - l
  37787. switch (((i = c <= 0.5 ? h / (s + l) : h / (2 - s - l)), s)) {
  37788. case r:
  37789. t = (o - a) / h + (o < a ? 6 : 0)
  37790. break
  37791. case o:
  37792. t = (a - r) / h + 2
  37793. break
  37794. case a:
  37795. t = (r - o) / h + 4
  37796. }
  37797. t /= 6
  37798. }
  37799. return (n.h = t), (n.s = i), (n.l = c), n
  37800. },
  37801. getStyle: function () {
  37802. return 'rgb(' + ((255 * this.r) | 0) + ',' + ((255 * this.g) | 0) + ',' + ((255 * this.b) | 0) + ')'
  37803. },
  37804. offsetHSL: function (e, t, i) {
  37805. var n = this.getHSL()
  37806. return (n.h += e), (n.s += t), (n.l += i), this.setHSL(n.h, n.s, n.l), this
  37807. },
  37808. add: function (e) {
  37809. return (this.r += e.r), (this.g += e.g), (this.b += e.b), this
  37810. },
  37811. addColors: function (e, t) {
  37812. return (this.r = e.r + t.r), (this.g = e.g + t.g), (this.b = e.b + t.b), this
  37813. },
  37814. addScalar: function (e) {
  37815. return (this.r += e), (this.g += e), (this.b += e), this
  37816. },
  37817. multiply: function (e) {
  37818. return (this.r *= e.r), (this.g *= e.g), (this.b *= e.b), this
  37819. },
  37820. multiplyScalar: function (e) {
  37821. return (this.r *= e), (this.g *= e), (this.b *= e), this
  37822. },
  37823. lerp: function (e, t) {
  37824. return (this.r += (e.r - this.r) * t), (this.g += (e.g - this.g) * t), (this.b += (e.b - this.b) * t), this
  37825. },
  37826. equals: function (e) {
  37827. return e.r === this.r && e.g === this.g && e.b === this.b
  37828. },
  37829. fromArray: function (e, t) {
  37830. return void 0 === t && (t = 0), (this.r = e[t]), (this.g = e[t + 1]), (this.b = e[t + 2]), this
  37831. },
  37832. toArray: function (e, t) {
  37833. return void 0 === e && (e = []), void 0 === t && (t = 0), (e[t] = this.r), (e[t + 1] = this.g), (e[t + 2] = this.b), e
  37834. }
  37835. }),
  37836. (n.ColorKeywords = {
  37837. aliceblue: 15792383,
  37838. antiquewhite: 16444375,
  37839. aqua: 65535,
  37840. aquamarine: 8388564,
  37841. azure: 15794175,
  37842. beige: 16119260,
  37843. bisque: 16770244,
  37844. black: 0,
  37845. blanchedalmond: 16772045,
  37846. blue: 255,
  37847. blueviolet: 9055202,
  37848. brown: 10824234,
  37849. burlywood: 14596231,
  37850. cadetblue: 6266528,
  37851. chartreuse: 8388352,
  37852. chocolate: 13789470,
  37853. coral: 16744272,
  37854. cornflowerblue: 6591981,
  37855. cornsilk: 16775388,
  37856. crimson: 14423100,
  37857. cyan: 65535,
  37858. darkblue: 139,
  37859. darkcyan: 35723,
  37860. darkgoldenrod: 12092939,
  37861. darkgray: 11119017,
  37862. darkgreen: 25600,
  37863. darkgrey: 11119017,
  37864. darkkhaki: 12433259,
  37865. darkmagenta: 9109643,
  37866. darkolivegreen: 5597999,
  37867. darkorange: 16747520,
  37868. darkorchid: 10040012,
  37869. darkred: 9109504,
  37870. darksalmon: 15308410,
  37871. darkseagreen: 9419919,
  37872. darkslateblue: 4734347,
  37873. darkslategray: 3100495,
  37874. darkslategrey: 3100495,
  37875. darkturquoise: 52945,
  37876. darkviolet: 9699539,
  37877. deeppink: 16716947,
  37878. deepskyblue: 49151,
  37879. dimgray: 6908265,
  37880. dimgrey: 6908265,
  37881. dodgerblue: 2003199,
  37882. firebrick: 11674146,
  37883. floralwhite: 16775920,
  37884. forestgreen: 2263842,
  37885. fuchsia: 16711935,
  37886. gainsboro: 14474460,
  37887. ghostwhite: 16316671,
  37888. gold: 16766720,
  37889. goldenrod: 14329120,
  37890. gray: 8421504,
  37891. green: 32768,
  37892. greenyellow: 11403055,
  37893. grey: 8421504,
  37894. honeydew: 15794160,
  37895. hotpink: 16738740,
  37896. indianred: 13458524,
  37897. indigo: 4915330,
  37898. ivory: 16777200,
  37899. khaki: 15787660,
  37900. lavender: 15132410,
  37901. lavenderblush: 16773365,
  37902. lawngreen: 8190976,
  37903. lemonchiffon: 16775885,
  37904. lightblue: 11393254,
  37905. lightcoral: 15761536,
  37906. lightcyan: 14745599,
  37907. lightgoldenrodyellow: 16448210,
  37908. lightgray: 13882323,
  37909. lightgreen: 9498256,
  37910. lightgrey: 13882323,
  37911. lightpink: 16758465,
  37912. lightsalmon: 16752762,
  37913. lightseagreen: 2142890,
  37914. lightskyblue: 8900346,
  37915. lightslategray: 7833753,
  37916. lightslategrey: 7833753,
  37917. lightsteelblue: 11584734,
  37918. lightyellow: 16777184,
  37919. lime: 65280,
  37920. limegreen: 3329330,
  37921. linen: 16445670,
  37922. magenta: 16711935,
  37923. maroon: 8388608,
  37924. mediumaquamarine: 6737322,
  37925. mediumblue: 205,
  37926. mediumorchid: 12211667,
  37927. mediumpurple: 9662683,
  37928. mediumseagreen: 3978097,
  37929. mediumslateblue: 8087790,
  37930. mediumspringgreen: 64154,
  37931. mediumturquoise: 4772300,
  37932. mediumvioletred: 13047173,
  37933. midnightblue: 1644912,
  37934. mintcream: 16121850,
  37935. mistyrose: 16770273,
  37936. moccasin: 16770229,
  37937. navajowhite: 16768685,
  37938. navy: 128,
  37939. oldlace: 16643558,
  37940. olive: 8421376,
  37941. olivedrab: 7048739,
  37942. orange: 16753920,
  37943. orangered: 16729344,
  37944. orchid: 14315734,
  37945. palegoldenrod: 15657130,
  37946. palegreen: 10025880,
  37947. paleturquoise: 11529966,
  37948. palevioletred: 14381203,
  37949. papayawhip: 16773077,
  37950. peachpuff: 16767673,
  37951. peru: 13468991,
  37952. pink: 16761035,
  37953. plum: 14524637,
  37954. powderblue: 11591910,
  37955. purple: 8388736,
  37956. red: 16711680,
  37957. rosybrown: 12357519,
  37958. royalblue: 4286945,
  37959. saddlebrown: 9127187,
  37960. salmon: 16416882,
  37961. sandybrown: 16032864,
  37962. seagreen: 3050327,
  37963. seashell: 16774638,
  37964. sienna: 10506797,
  37965. silver: 12632256,
  37966. skyblue: 8900331,
  37967. slateblue: 6970061,
  37968. slategray: 7372944,
  37969. slategrey: 7372944,
  37970. snow: 16775930,
  37971. springgreen: 65407,
  37972. steelblue: 4620980,
  37973. tan: 13808780,
  37974. teal: 32896,
  37975. thistle: 14204888,
  37976. tomato: 16737095,
  37977. turquoise: 4251856,
  37978. violet: 15631086,
  37979. wheat: 16113331,
  37980. white: 16777215,
  37981. whitesmoke: 16119285,
  37982. yellow: 16776960,
  37983. yellowgreen: 10145074
  37984. }),
  37985. (n.Quaternion = function (e, t, i, n) {
  37986. ;(this._x = e || 0), (this._y = t || 0), (this._z = i || 0), (this._w = void 0 !== n ? n : 1)
  37987. }),
  37988. (n.Quaternion.prototype = {
  37989. constructor: n.Quaternion,
  37990. get x() {
  37991. return this._x
  37992. },
  37993. set x(e) {
  37994. ;(this._x = e), this.onChangeCallback()
  37995. },
  37996. get y() {
  37997. return this._y
  37998. },
  37999. set y(e) {
  38000. ;(this._y = e), this.onChangeCallback()
  38001. },
  38002. get z() {
  38003. return this._z
  38004. },
  38005. set z(e) {
  38006. ;(this._z = e), this.onChangeCallback()
  38007. },
  38008. get w() {
  38009. return this._w
  38010. },
  38011. set w(e) {
  38012. ;(this._w = e), this.onChangeCallback()
  38013. },
  38014. set: function (e, t, i, n) {
  38015. return (this._x = e), (this._y = t), (this._z = i), (this._w = n), this.onChangeCallback(), this
  38016. },
  38017. clone: function () {
  38018. return new this.constructor(this._x, this._y, this._z, this._w)
  38019. },
  38020. copy: function (e) {
  38021. return (this._x = e.x), (this._y = e.y), (this._z = e.z), (this._w = e.w), this.onChangeCallback(), this
  38022. },
  38023. setFromEuler: function (e, t) {
  38024. if (e instanceof n.Euler == !1) throw new Error('THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.')
  38025. var i = Math.cos(e._x / 2),
  38026. r = Math.cos(e._y / 2),
  38027. o = Math.cos(e._z / 2),
  38028. a = Math.sin(e._x / 2),
  38029. s = Math.sin(e._y / 2),
  38030. l = Math.sin(e._z / 2),
  38031. c = e.order
  38032. return (
  38033. 'XYZ' === c
  38034. ? ((this._x = a * r * o + i * s * l), (this._y = i * s * o - a * r * l), (this._z = i * r * l + a * s * o), (this._w = i * r * o - a * s * l))
  38035. : 'YXZ' === c
  38036. ? ((this._x = a * r * o + i * s * l), (this._y = i * s * o - a * r * l), (this._z = i * r * l - a * s * o), (this._w = i * r * o + a * s * l))
  38037. : 'ZXY' === c
  38038. ? ((this._x = a * r * o - i * s * l), (this._y = i * s * o + a * r * l), (this._z = i * r * l + a * s * o), (this._w = i * r * o - a * s * l))
  38039. : 'ZYX' === c
  38040. ? ((this._x = a * r * o - i * s * l), (this._y = i * s * o + a * r * l), (this._z = i * r * l - a * s * o), (this._w = i * r * o + a * s * l))
  38041. : 'YZX' === c
  38042. ? ((this._x = a * r * o + i * s * l), (this._y = i * s * o + a * r * l), (this._z = i * r * l - a * s * o), (this._w = i * r * o - a * s * l))
  38043. : 'XZY' === c && ((this._x = a * r * o - i * s * l), (this._y = i * s * o - a * r * l), (this._z = i * r * l + a * s * o), (this._w = i * r * o + a * s * l)),
  38044. t !== !1 && this.onChangeCallback(),
  38045. this
  38046. )
  38047. },
  38048. setFromAxisAngle: function (e, t) {
  38049. var i = t / 2,
  38050. n = Math.sin(i)
  38051. return (this._x = e.x * n), (this._y = e.y * n), (this._z = e.z * n), (this._w = Math.cos(i)), this.onChangeCallback(), this
  38052. },
  38053. setFromRotationMatrix: function (e) {
  38054. var t,
  38055. i = e.elements,
  38056. n = i[0],
  38057. r = i[4],
  38058. o = i[8],
  38059. a = i[1],
  38060. s = i[5],
  38061. l = i[9],
  38062. c = i[2],
  38063. h = i[6],
  38064. u = i[10],
  38065. d = n + s + u
  38066. return (
  38067. d > 0
  38068. ? ((t = 0.5 / Math.sqrt(d + 1)), (this._w = 0.25 / t), (this._x = (h - l) * t), (this._y = (o - c) * t), (this._z = (a - r) * t))
  38069. : n > s && n > u
  38070. ? ((t = 2 * Math.sqrt(1 + n - s - u)), (this._w = (h - l) / t), (this._x = 0.25 * t), (this._y = (r + a) / t), (this._z = (o + c) / t))
  38071. : s > u
  38072. ? ((t = 2 * Math.sqrt(1 + s - n - u)), (this._w = (o - c) / t), (this._x = (r + a) / t), (this._y = 0.25 * t), (this._z = (l + h) / t))
  38073. : ((t = 2 * Math.sqrt(1 + u - n - s)), (this._w = (a - r) / t), (this._x = (o + c) / t), (this._y = (l + h) / t), (this._z = 0.25 * t)),
  38074. this.onChangeCallback(),
  38075. this
  38076. )
  38077. },
  38078. setFromUnitVectors: (function () {
  38079. var e,
  38080. t,
  38081. i = 1e-6
  38082. return function (r, o) {
  38083. return (
  38084. void 0 === e && (e = new n.Vector3()),
  38085. (t = r.dot(o) + 1),
  38086. t < i ? ((t = 0), Math.abs(r.x) > Math.abs(r.z) ? e.set(-r.y, r.x, 0) : e.set(0, -r.z, r.y)) : e.crossVectors(r, o),
  38087. (this._x = e.x),
  38088. (this._y = e.y),
  38089. (this._z = e.z),
  38090. (this._w = t),
  38091. this.normalize(),
  38092. this
  38093. )
  38094. }
  38095. })(),
  38096. inverse: function () {
  38097. return this.conjugate().normalize(), this
  38098. },
  38099. conjugate: function () {
  38100. return (this._x *= -1), (this._y *= -1), (this._z *= -1), this.onChangeCallback(), this
  38101. },
  38102. dot: function (e) {
  38103. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  38104. },
  38105. lengthSq: function () {
  38106. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  38107. },
  38108. length: function () {
  38109. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  38110. },
  38111. normalize: function () {
  38112. var e = this.length()
  38113. return (
  38114. 0 === e
  38115. ? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1))
  38116. : ((e = 1 / e), (this._x = this._x * e), (this._y = this._y * e), (this._z = this._z * e), (this._w = this._w * e)),
  38117. this.onChangeCallback(),
  38118. this
  38119. )
  38120. },
  38121. multiply: function (e, t) {
  38122. return void 0 !== t
  38123. ? (console.warn('THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.'), this.multiplyQuaternions(e, t))
  38124. : this.multiplyQuaternions(this, e)
  38125. },
  38126. multiplyQuaternions: function (e, t) {
  38127. var i = e._x,
  38128. n = e._y,
  38129. r = e._z,
  38130. o = e._w,
  38131. a = t._x,
  38132. s = t._y,
  38133. l = t._z,
  38134. c = t._w
  38135. return (
  38136. (this._x = i * c + o * a + n * l - r * s),
  38137. (this._y = n * c + o * s + r * a - i * l),
  38138. (this._z = r * c + o * l + i * s - n * a),
  38139. (this._w = o * c - i * a - n * s - r * l),
  38140. this.onChangeCallback(),
  38141. this
  38142. )
  38143. },
  38144. slerp: function (e, t) {
  38145. if (0 === t) return this
  38146. if (1 === t) return this.copy(e)
  38147. var i = this._x,
  38148. n = this._y,
  38149. r = this._z,
  38150. o = this._w,
  38151. a = o * e._w + i * e._x + n * e._y + r * e._z
  38152. if ((a < 0 ? ((this._w = -e._w), (this._x = -e._x), (this._y = -e._y), (this._z = -e._z), (a = -a)) : this.copy(e), a >= 1))
  38153. return (this._w = o), (this._x = i), (this._y = n), (this._z = r), this
  38154. var s = Math.sqrt(1 - a * a)
  38155. if (Math.abs(s) < 0.001) return (this._w = 0.5 * (o + this._w)), (this._x = 0.5 * (i + this._x)), (this._y = 0.5 * (n + this._y)), (this._z = 0.5 * (r + this._z)), this
  38156. var l = Math.atan2(s, a),
  38157. c = Math.sin((1 - t) * l) / s,
  38158. h = Math.sin(t * l) / s
  38159. return (this._w = o * c + this._w * h), (this._x = i * c + this._x * h), (this._y = n * c + this._y * h), (this._z = r * c + this._z * h), this.onChangeCallback(), this
  38160. },
  38161. equals: function (e) {
  38162. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  38163. },
  38164. fromArray: function (e, t) {
  38165. return void 0 === t && (t = 0), (this._x = e[t]), (this._y = e[t + 1]), (this._z = e[t + 2]), (this._w = e[t + 3]), this.onChangeCallback(), this
  38166. },
  38167. toArray: function (e, t) {
  38168. return void 0 === e && (e = []), void 0 === t && (t = 0), (e[t] = this._x), (e[t + 1] = this._y), (e[t + 2] = this._z), (e[t + 3] = this._w), e
  38169. },
  38170. onChange: function (e) {
  38171. return (this.onChangeCallback = e), this
  38172. },
  38173. onChangeCallback: function () {}
  38174. }),
  38175. Object.assign(n.Quaternion, {
  38176. slerp: function (e, t, i, n) {
  38177. return i.copy(e).slerp(t, n)
  38178. },
  38179. slerpFlat: function (e, t, i, n, r, o, a) {
  38180. var s = i[n + 0],
  38181. l = i[n + 1],
  38182. c = i[n + 2],
  38183. h = i[n + 3],
  38184. u = r[o + 0],
  38185. d = r[o + 1],
  38186. p = r[o + 2],
  38187. f = r[o + 3]
  38188. if (h !== f || s !== u || l !== d || c !== p) {
  38189. var g = 1 - a,
  38190. m = s * u + l * d + c * p + h * f,
  38191. v = m >= 0 ? 1 : -1,
  38192. A = 1 - m * m
  38193. if (A > Number.EPSILON) {
  38194. var y = Math.sqrt(A),
  38195. C = Math.atan2(y, m * v)
  38196. ;(g = Math.sin(g * C) / y), (a = Math.sin(a * C) / y)
  38197. }
  38198. var I = a * v
  38199. if (((s = s * g + u * I), (l = l * g + d * I), (c = c * g + p * I), (h = h * g + f * I), g === 1 - a)) {
  38200. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h)
  38201. ;(s *= E), (l *= E), (c *= E), (h *= E)
  38202. }
  38203. }
  38204. ;(e[t] = s), (e[t + 1] = l), (e[t + 2] = c), (e[t + 3] = h)
  38205. }
  38206. }),
  38207. (n.Vector2 = function (e, t) {
  38208. ;(this.x = e || 0), (this.y = t || 0)
  38209. }),
  38210. (n.Vector2.prototype = {
  38211. constructor: n.Vector2,
  38212. get width() {
  38213. return this.x
  38214. },
  38215. set width(e) {
  38216. this.x = e
  38217. },
  38218. get height() {
  38219. return this.y
  38220. },
  38221. set height(e) {
  38222. this.y = e
  38223. },
  38224. set: function (e, t) {
  38225. return (this.x = e), (this.y = t), this
  38226. },
  38227. setScalar: function (e) {
  38228. return (this.x = e), (this.y = e), this
  38229. },
  38230. setX: function (e) {
  38231. return (this.x = e), this
  38232. },
  38233. setY: function (e) {
  38234. return (this.y = e), this
  38235. },
  38236. setComponent: function (e, t) {
  38237. switch (e) {
  38238. case 0:
  38239. this.x = t
  38240. break
  38241. case 1:
  38242. this.y = t
  38243. break
  38244. default:
  38245. throw new Error('index is out of range: ' + e)
  38246. }
  38247. },
  38248. getComponent: function (e) {
  38249. switch (e) {
  38250. case 0:
  38251. return this.x
  38252. case 1:
  38253. return this.y
  38254. default:
  38255. throw new Error('index is out of range: ' + e)
  38256. }
  38257. },
  38258. clone: function () {
  38259. return new this.constructor(this.x, this.y)
  38260. },
  38261. copy: function (e) {
  38262. return (this.x = e.x), (this.y = e.y), this
  38263. },
  38264. add: function (e, t) {
  38265. return void 0 !== t
  38266. ? (console.warn('THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'), this.addVectors(e, t))
  38267. : ((this.x += e.x), (this.y += e.y), this)
  38268. },
  38269. addScalar: function (e) {
  38270. return (this.x += e), (this.y += e), this
  38271. },
  38272. addVectors: function (e, t) {
  38273. return (this.x = e.x + t.x), (this.y = e.y + t.y), this
  38274. },
  38275. addScaledVector: function (e, t) {
  38276. return (this.x += e.x * t), (this.y += e.y * t), this
  38277. },
  38278. sub: function (e, t) {
  38279. return void 0 !== t
  38280. ? (console.warn('THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'), this.subVectors(e, t))
  38281. : ((this.x -= e.x), (this.y -= e.y), this)
  38282. },
  38283. subScalar: function (e) {
  38284. return (this.x -= e), (this.y -= e), this
  38285. },
  38286. subVectors: function (e, t) {
  38287. return (this.x = e.x - t.x), (this.y = e.y - t.y), this
  38288. },
  38289. multiply: function (e) {
  38290. return (this.x *= e.x), (this.y *= e.y), this
  38291. },
  38292. multiplyScalar: function (e) {
  38293. return isFinite(e) ? ((this.x *= e), (this.y *= e)) : ((this.x = 0), (this.y = 0)), this
  38294. },
  38295. divide: function (e) {
  38296. return (this.x /= e.x), (this.y /= e.y), this
  38297. },
  38298. divideScalar: function (e) {
  38299. return this.multiplyScalar(1 / e)
  38300. },
  38301. min: function (e) {
  38302. return (this.x = Math.min(this.x, e.x)), (this.y = Math.min(this.y, e.y)), this
  38303. },
  38304. max: function (e) {
  38305. return (this.x = Math.max(this.x, e.x)), (this.y = Math.max(this.y, e.y)), this
  38306. },
  38307. clamp: function (e, t) {
  38308. return (this.x = Math.max(e.x, Math.min(t.x, this.x))), (this.y = Math.max(e.y, Math.min(t.y, this.y))), this
  38309. },
  38310. clampScalar: (function () {
  38311. var e, t
  38312. return function (i, r) {
  38313. return void 0 === e && ((e = new n.Vector2()), (t = new n.Vector2())), e.set(i, i), t.set(r, r), this.clamp(e, t)
  38314. }
  38315. })(),
  38316. clampLength: function (e, t) {
  38317. var i = this.length()
  38318. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i), this
  38319. },
  38320. floor: function () {
  38321. return (this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), this
  38322. },
  38323. ceil: function () {
  38324. return (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), this
  38325. },
  38326. round: function () {
  38327. return (this.x = Math.round(this.x)), (this.y = Math.round(this.y)), this
  38328. },
  38329. roundToZero: function () {
  38330. return (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)), (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)), this
  38331. },
  38332. negate: function () {
  38333. return (this.x = -this.x), (this.y = -this.y), this
  38334. },
  38335. dot: function (e) {
  38336. return this.x * e.x + this.y * e.y
  38337. },
  38338. lengthSq: function () {
  38339. return this.x * this.x + this.y * this.y
  38340. },
  38341. length: function () {
  38342. return Math.sqrt(this.x * this.x + this.y * this.y)
  38343. },
  38344. lengthManhattan: function () {
  38345. return Math.abs(this.x) + Math.abs(this.y)
  38346. },
  38347. normalize: function () {
  38348. return this.divideScalar(this.length())
  38349. },
  38350. angle: function () {
  38351. var e = Math.atan2(this.y, this.x)
  38352. return e < 0 && (e += 2 * Math.PI), e
  38353. },
  38354. distanceTo: function (e) {
  38355. return Math.sqrt(this.distanceToSquared(e))
  38356. },
  38357. distanceToSquared: function (e) {
  38358. var t = this.x - e.x,
  38359. i = this.y - e.y
  38360. return t * t + i * i
  38361. },
  38362. setLength: function (e) {
  38363. return this.multiplyScalar(e / this.length())
  38364. },
  38365. lerp: function (e, t) {
  38366. return (this.x += (e.x - this.x) * t), (this.y += (e.y - this.y) * t), this
  38367. },
  38368. lerpVectors: function (e, t, i) {
  38369. return this.subVectors(t, e).multiplyScalar(i).add(e), this
  38370. },
  38371. equals: function (e) {
  38372. return e.x === this.x && e.y === this.y
  38373. },
  38374. fromArray: function (e, t) {
  38375. return void 0 === t && (t = 0), (this.x = e[t]), (this.y = e[t + 1]), this
  38376. },
  38377. toArray: function (e, t) {
  38378. return void 0 === e && (e = []), void 0 === t && (t = 0), (e[t] = this.x), (e[t + 1] = this.y), e
  38379. },
  38380. fromAttribute: function (e, t, i) {
  38381. return void 0 === i && (i = 0), (t = t * e.itemSize + i), (this.x = e.array[t]), (this.y = e.array[t + 1]), this
  38382. },
  38383. rotateAround: function (e, t) {
  38384. var i = Math.cos(t),
  38385. n = Math.sin(t),
  38386. r = this.x - e.x,
  38387. o = this.y - e.y
  38388. return (this.x = r * i - o * n + e.x), (this.y = r * n + o * i + e.y), this
  38389. }
  38390. }),
  38391. (n.Vector3 = function (e, t, i) {
  38392. ;(this.x = e || 0), (this.y = t || 0), (this.z = i || 0)
  38393. }),
  38394. (n.Vector3.prototype = {
  38395. constructor: n.Vector3,
  38396. set: function (e, t, i) {
  38397. return (this.x = e), (this.y = t), (this.z = i), this
  38398. },
  38399. setScalar: function (e) {
  38400. return (this.x = e), (this.y = e), (this.z = e), this
  38401. },
  38402. setX: function (e) {
  38403. return (this.x = e), this
  38404. },
  38405. setY: function (e) {
  38406. return (this.y = e), this
  38407. },
  38408. setZ: function (e) {
  38409. return (this.z = e), this
  38410. },
  38411. setComponent: function (e, t) {
  38412. switch (e) {
  38413. case 0:
  38414. this.x = t
  38415. break
  38416. case 1:
  38417. this.y = t
  38418. break
  38419. case 2:
  38420. this.z = t
  38421. break
  38422. default:
  38423. throw new Error('index is out of range: ' + e)
  38424. }
  38425. },
  38426. getComponent: function (e) {
  38427. switch (e) {
  38428. case 0:
  38429. return this.x
  38430. case 1:
  38431. return this.y
  38432. case 2:
  38433. return this.z
  38434. default:
  38435. throw new Error('index is out of range: ' + e)
  38436. }
  38437. },
  38438. clone: function () {
  38439. return new this.constructor(this.x, this.y, this.z)
  38440. },
  38441. copy: function (e) {
  38442. return (this.x = e.x), (this.y = e.y), (this.z = e.z), this
  38443. },
  38444. add: function (e, t) {
  38445. return void 0 !== t
  38446. ? (console.warn('THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'), this.addVectors(e, t))
  38447. : ((this.x += e.x), (this.y += e.y), (this.z += e.z), this)
  38448. },
  38449. addScalar: function (e) {
  38450. return (this.x += e), (this.y += e), (this.z += e), this
  38451. },
  38452. addVectors: function (e, t) {
  38453. return (this.x = e.x + t.x), (this.y = e.y + t.y), (this.z = e.z + t.z), this
  38454. },
  38455. addScaledVector: function (e, t) {
  38456. return (this.x += e.x * t), (this.y += e.y * t), (this.z += e.z * t), this
  38457. },
  38458. sub: function (e, t) {
  38459. return void 0 !== t
  38460. ? (console.warn('THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'), this.subVectors(e, t))
  38461. : ((this.x -= e.x), (this.y -= e.y), (this.z -= e.z), this)
  38462. },
  38463. subScalar: function (e) {
  38464. return (this.x -= e), (this.y -= e), (this.z -= e), this
  38465. },
  38466. subVectors: function (e, t) {
  38467. return (this.x = e.x - t.x), (this.y = e.y - t.y), (this.z = e.z - t.z), this
  38468. },
  38469. multiply: function (e, t) {
  38470. return void 0 !== t
  38471. ? (console.warn('THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.'), this.multiplyVectors(e, t))
  38472. : ((this.x *= e.x), (this.y *= e.y), (this.z *= e.z), this)
  38473. },
  38474. multiplyScalar: function (e) {
  38475. return isFinite(e) ? ((this.x *= e), (this.y *= e), (this.z *= e)) : ((this.x = 0), (this.y = 0), (this.z = 0)), this
  38476. },
  38477. multiplyVectors: function (e, t) {
  38478. return (this.x = e.x * t.x), (this.y = e.y * t.y), (this.z = e.z * t.z), this
  38479. },
  38480. applyEuler: (function () {
  38481. var e
  38482. return function (t) {
  38483. return (
  38484. t instanceof n.Euler == !1 && console.error('THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.'),
  38485. void 0 === e && (e = new n.Quaternion()),
  38486. this.applyQuaternion(e.setFromEuler(t)),
  38487. this
  38488. )
  38489. }
  38490. })(),
  38491. applyAxisAngle: (function () {
  38492. var e
  38493. return function (t, i) {
  38494. return void 0 === e && (e = new n.Quaternion()), this.applyQuaternion(e.setFromAxisAngle(t, i)), this
  38495. }
  38496. })(),
  38497. applyMatrix3: function (e) {
  38498. var t = this.x,
  38499. i = this.y,
  38500. n = this.z,
  38501. r = e.elements
  38502. return (this.x = r[0] * t + r[3] * i + r[6] * n), (this.y = r[1] * t + r[4] * i + r[7] * n), (this.z = r[2] * t + r[5] * i + r[8] * n), this
  38503. },
  38504. applyMatrix4: function (e) {
  38505. var t = this.x,
  38506. i = this.y,
  38507. n = this.z,
  38508. r = e.elements
  38509. return (this.x = r[0] * t + r[4] * i + r[8] * n + r[12]), (this.y = r[1] * t + r[5] * i + r[9] * n + r[13]), (this.z = r[2] * t + r[6] * i + r[10] * n + r[14]), this
  38510. },
  38511. applyProjection: function (e) {
  38512. var t = this.x,
  38513. i = this.y,
  38514. n = this.z,
  38515. r = e.elements,
  38516. o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15])
  38517. return (this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o), (this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o), (this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o), this
  38518. },
  38519. applyQuaternion: function (e) {
  38520. var t = this.x,
  38521. i = this.y,
  38522. n = this.z,
  38523. r = e.x,
  38524. o = e.y,
  38525. a = e.z,
  38526. s = e.w,
  38527. l = s * t + o * n - a * i,
  38528. c = s * i + a * t - r * n,
  38529. h = s * n + r * i - o * t,
  38530. u = -r * t - o * i - a * n
  38531. return (this.x = l * s + u * -r + c * -a - h * -o), (this.y = c * s + u * -o + h * -r - l * -a), (this.z = h * s + u * -a + l * -o - c * -r), this
  38532. },
  38533. project: (function () {
  38534. var e
  38535. return function (t) {
  38536. return void 0 === e && (e = new n.Matrix4()), e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)), this.applyProjection(e)
  38537. }
  38538. })(),
  38539. unproject: (function () {
  38540. var e
  38541. return function (t) {
  38542. return void 0 === e && (e = new n.Matrix4()), e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)), this.applyProjection(e)
  38543. }
  38544. })(),
  38545. transformDirection: function (e) {
  38546. var t = this.x,
  38547. i = this.y,
  38548. n = this.z,
  38549. r = e.elements
  38550. return (this.x = r[0] * t + r[4] * i + r[8] * n), (this.y = r[1] * t + r[5] * i + r[9] * n), (this.z = r[2] * t + r[6] * i + r[10] * n), this.normalize(), this
  38551. },
  38552. divide: function (e) {
  38553. return (this.x /= e.x), (this.y /= e.y), (this.z /= e.z), this
  38554. },
  38555. divideScalar: function (e) {
  38556. return this.multiplyScalar(1 / e)
  38557. },
  38558. min: function (e) {
  38559. return (this.x = Math.min(this.x, e.x)), (this.y = Math.min(this.y, e.y)), (this.z = Math.min(this.z, e.z)), this
  38560. },
  38561. max: function (e) {
  38562. return (this.x = Math.max(this.x, e.x)), (this.y = Math.max(this.y, e.y)), (this.z = Math.max(this.z, e.z)), this
  38563. },
  38564. clamp: function (e, t) {
  38565. return (this.x = Math.max(e.x, Math.min(t.x, this.x))), (this.y = Math.max(e.y, Math.min(t.y, this.y))), (this.z = Math.max(e.z, Math.min(t.z, this.z))), this
  38566. },
  38567. clampScalar: (function () {
  38568. var e, t
  38569. return function (i, r) {
  38570. return void 0 === e && ((e = new n.Vector3()), (t = new n.Vector3())), e.set(i, i, i), t.set(r, r, r), this.clamp(e, t)
  38571. }
  38572. })(),
  38573. clampLength: function (e, t) {
  38574. var i = this.length()
  38575. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i), this
  38576. },
  38577. floor: function () {
  38578. return (this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), (this.z = Math.floor(this.z)), this
  38579. },
  38580. ceil: function () {
  38581. return (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), (this.z = Math.ceil(this.z)), this
  38582. },
  38583. round: function () {
  38584. return (this.x = Math.round(this.x)), (this.y = Math.round(this.y)), (this.z = Math.round(this.z)), this
  38585. },
  38586. roundToZero: function () {
  38587. return (
  38588. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  38589. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  38590. (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
  38591. this
  38592. )
  38593. },
  38594. negate: function () {
  38595. return (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), this
  38596. },
  38597. dot: function (e) {
  38598. return this.x * e.x + this.y * e.y + this.z * e.z
  38599. },
  38600. lengthSq: function () {
  38601. return this.x * this.x + this.y * this.y + this.z * this.z
  38602. },
  38603. length: function () {
  38604. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38605. },
  38606. lengthManhattan: function () {
  38607. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38608. },
  38609. normalize: function () {
  38610. return this.divideScalar(this.length())
  38611. },
  38612. setLength: function (e) {
  38613. return this.multiplyScalar(e / this.length())
  38614. },
  38615. lerp: function (e, t) {
  38616. return (this.x += (e.x - this.x) * t), (this.y += (e.y - this.y) * t), (this.z += (e.z - this.z) * t), this
  38617. },
  38618. lerpVectors: function (e, t, i) {
  38619. return this.subVectors(t, e).multiplyScalar(i).add(e), this
  38620. },
  38621. cross: function (e, t) {
  38622. if (void 0 !== t) return console.warn('THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.'), this.crossVectors(e, t)
  38623. var i = this.x,
  38624. n = this.y,
  38625. r = this.z
  38626. return (this.x = n * e.z - r * e.y), (this.y = r * e.x - i * e.z), (this.z = i * e.y - n * e.x), this
  38627. },
  38628. crossVectors: function (e, t) {
  38629. var i = e.x,
  38630. n = e.y,
  38631. r = e.z,
  38632. o = t.x,
  38633. a = t.y,
  38634. s = t.z
  38635. return (this.x = n * s - r * a), (this.y = r * o - i * s), (this.z = i * a - n * o), this
  38636. },
  38637. projectOnVector: (function () {
  38638. var e, t
  38639. return function (i) {
  38640. return void 0 === e && (e = new n.Vector3()), e.copy(i).normalize(), (t = this.dot(e)), this.copy(e).multiplyScalar(t)
  38641. }
  38642. })(),
  38643. projectOnPlane: (function () {
  38644. var e
  38645. return function (t) {
  38646. return void 0 === e && (e = new n.Vector3()), e.copy(this).projectOnVector(t), this.sub(e)
  38647. }
  38648. })(),
  38649. reflect: (function () {
  38650. var e
  38651. return function (t) {
  38652. return void 0 === e && (e = new n.Vector3()), this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  38653. }
  38654. })(),
  38655. angleTo: function (e) {
  38656. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq())
  38657. return Math.acos(n.Math.clamp(t, -1, 1))
  38658. },
  38659. distanceTo: function (e) {
  38660. return Math.sqrt(this.distanceToSquared(e))
  38661. },
  38662. distanceToSquared: function (e) {
  38663. var t = this.x - e.x,
  38664. i = this.y - e.y,
  38665. n = this.z - e.z
  38666. return t * t + i * i + n * n
  38667. },
  38668. setFromSpherical: function (e) {
  38669. var t = Math.sin(e.phi) * e.radius
  38670. return (this.x = t * Math.sin(e.theta)), (this.y = Math.cos(e.phi) * e.radius), (this.z = t * Math.cos(e.theta)), this
  38671. },
  38672. setFromMatrixPosition: function (e) {
  38673. return this.setFromMatrixColumn(e, 3)
  38674. },
  38675. setFromMatrixScale: function (e) {
  38676. var t = this.setFromMatrixColumn(e, 0).length(),
  38677. i = this.setFromMatrixColumn(e, 1).length(),
  38678. n = this.setFromMatrixColumn(e, 2).length()
  38679. return (this.x = t), (this.y = i), (this.z = n), this
  38680. },
  38681. setFromMatrixColumn: function (e, t) {
  38682. return (
  38683. 'number' == typeof e && (console.warn('THREE.Vector3: setFromMatrixColumn now expects ( matrix, index ).'), (e = arguments[1]), (t = arguments[0])), this.fromArray(e.elements, 4 * t)
  38684. )
  38685. },
  38686. equals: function (e) {
  38687. return e.x === this.x && e.y === this.y && e.z === this.z
  38688. },
  38689. fromArray: function (e, t) {
  38690. return void 0 === t && (t = 0), (this.x = e[t]), (this.y = e[t + 1]), (this.z = e[t + 2]), this
  38691. },
  38692. toArray: function (e, t) {
  38693. return void 0 === e && (e = []), void 0 === t && (t = 0), (e[t] = this.x), (e[t + 1] = this.y), (e[t + 2] = this.z), e
  38694. },
  38695. fromAttribute: function (e, t, i) {
  38696. return void 0 === i && (i = 0), (t = t * e.itemSize + i), (this.x = e.array[t]), (this.y = e.array[t + 1]), (this.z = e.array[t + 2]), this
  38697. }
  38698. }),
  38699. (n.Vector4 = function (e, t, i, n) {
  38700. ;(this.x = e || 0), (this.y = t || 0), (this.z = i || 0), (this.w = void 0 !== n ? n : 1)
  38701. }),
  38702. (n.Vector4.prototype = {
  38703. constructor: n.Vector4,
  38704. set: function (e, t, i, n) {
  38705. return (this.x = e), (this.y = t), (this.z = i), (this.w = n), this
  38706. },
  38707. setScalar: function (e) {
  38708. return (this.x = e), (this.y = e), (this.z = e), (this.w = e), this
  38709. },
  38710. setX: function (e) {
  38711. return (this.x = e), this
  38712. },
  38713. setY: function (e) {
  38714. return (this.y = e), this
  38715. },
  38716. setZ: function (e) {
  38717. return (this.z = e), this
  38718. },
  38719. setW: function (e) {
  38720. return (this.w = e), this
  38721. },
  38722. setComponent: function (e, t) {
  38723. switch (e) {
  38724. case 0:
  38725. this.x = t
  38726. break
  38727. case 1:
  38728. this.y = t
  38729. break
  38730. case 2:
  38731. this.z = t
  38732. break
  38733. case 3:
  38734. this.w = t
  38735. break
  38736. default:
  38737. throw new Error('index is out of range: ' + e)
  38738. }
  38739. },
  38740. getComponent: function (e) {
  38741. switch (e) {
  38742. case 0:
  38743. return this.x
  38744. case 1:
  38745. return this.y
  38746. case 2:
  38747. return this.z
  38748. case 3:
  38749. return this.w
  38750. default:
  38751. throw new Error('index is out of range: ' + e)
  38752. }
  38753. },
  38754. clone: function () {
  38755. return new this.constructor(this.x, this.y, this.z, this.w)
  38756. },
  38757. copy: function (e) {
  38758. return (this.x = e.x), (this.y = e.y), (this.z = e.z), (this.w = void 0 !== e.w ? e.w : 1), this
  38759. },
  38760. add: function (e, t) {
  38761. return void 0 !== t
  38762. ? (console.warn('THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'), this.addVectors(e, t))
  38763. : ((this.x += e.x), (this.y += e.y), (this.z += e.z), (this.w += e.w), this)
  38764. },
  38765. addScalar: function (e) {
  38766. return (this.x += e), (this.y += e), (this.z += e), (this.w += e), this
  38767. },
  38768. addVectors: function (e, t) {
  38769. return (this.x = e.x + t.x), (this.y = e.y + t.y), (this.z = e.z + t.z), (this.w = e.w + t.w), this
  38770. },
  38771. addScaledVector: function (e, t) {
  38772. return (this.x += e.x * t), (this.y += e.y * t), (this.z += e.z * t), (this.w += e.w * t), this
  38773. },
  38774. sub: function (e, t) {
  38775. return void 0 !== t
  38776. ? (console.warn('THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'), this.subVectors(e, t))
  38777. : ((this.x -= e.x), (this.y -= e.y), (this.z -= e.z), (this.w -= e.w), this)
  38778. },
  38779. subScalar: function (e) {
  38780. return (this.x -= e), (this.y -= e), (this.z -= e), (this.w -= e), this
  38781. },
  38782. subVectors: function (e, t) {
  38783. return (this.x = e.x - t.x), (this.y = e.y - t.y), (this.z = e.z - t.z), (this.w = e.w - t.w), this
  38784. },
  38785. multiplyScalar: function (e) {
  38786. return isFinite(e) ? ((this.x *= e), (this.y *= e), (this.z *= e), (this.w *= e)) : ((this.x = 0), (this.y = 0), (this.z = 0), (this.w = 0)), this
  38787. },
  38788. applyMatrix4: function (e) {
  38789. var t = this.x,
  38790. i = this.y,
  38791. n = this.z,
  38792. r = this.w,
  38793. o = e.elements
  38794. return (
  38795. (this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r),
  38796. (this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r),
  38797. (this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r),
  38798. (this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r),
  38799. this
  38800. )
  38801. },
  38802. divideScalar: function (e) {
  38803. return this.multiplyScalar(1 / e)
  38804. },
  38805. setAxisAngleFromQuaternion: function (e) {
  38806. this.w = 2 * Math.acos(e.w)
  38807. var t = Math.sqrt(1 - e.w * e.w)
  38808. return t < 1e-4 ? ((this.x = 1), (this.y = 0), (this.z = 0)) : ((this.x = e.x / t), (this.y = e.y / t), (this.z = e.z / t)), this
  38809. },
  38810. setAxisAngleFromRotationMatrix: function (e) {
  38811. var t,
  38812. i,
  38813. n,
  38814. r,
  38815. o = 0.01,
  38816. a = 0.1,
  38817. s = e.elements,
  38818. l = s[0],
  38819. c = s[4],
  38820. h = s[8],
  38821. u = s[1],
  38822. d = s[5],
  38823. p = s[9],
  38824. f = s[2],
  38825. g = s[6],
  38826. m = s[10]
  38827. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  38828. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a) return this.set(1, 0, 0, 0), this
  38829. t = Math.PI
  38830. var v = (l + 1) / 2,
  38831. A = (d + 1) / 2,
  38832. y = (m + 1) / 2,
  38833. C = (c + u) / 4,
  38834. I = (h + f) / 4,
  38835. E = (p + g) / 4
  38836. return (
  38837. v > A && v > y
  38838. ? v < o
  38839. ? ((i = 0), (n = 0.707106781), (r = 0.707106781))
  38840. : ((i = Math.sqrt(v)), (n = C / i), (r = I / i))
  38841. : A > y
  38842. ? A < o
  38843. ? ((i = 0.707106781), (n = 0), (r = 0.707106781))
  38844. : ((n = Math.sqrt(A)), (i = C / n), (r = E / n))
  38845. : y < o
  38846. ? ((i = 0.707106781), (n = 0.707106781), (r = 0))
  38847. : ((r = Math.sqrt(y)), (i = I / r), (n = E / r)),
  38848. this.set(i, n, r, t),
  38849. this
  38850. )
  38851. }
  38852. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c))
  38853. return Math.abs(b) < 0.001 && (b = 1), (this.x = (g - p) / b), (this.y = (h - f) / b), (this.z = (u - c) / b), (this.w = Math.acos((l + d + m - 1) / 2)), this
  38854. },
  38855. min: function (e) {
  38856. return (this.x = Math.min(this.x, e.x)), (this.y = Math.min(this.y, e.y)), (this.z = Math.min(this.z, e.z)), (this.w = Math.min(this.w, e.w)), this
  38857. },
  38858. max: function (e) {
  38859. return (this.x = Math.max(this.x, e.x)), (this.y = Math.max(this.y, e.y)), (this.z = Math.max(this.z, e.z)), (this.w = Math.max(this.w, e.w)), this
  38860. },
  38861. clamp: function (e, t) {
  38862. return (
  38863. (this.x = Math.max(e.x, Math.min(t.x, this.x))),
  38864. (this.y = Math.max(e.y, Math.min(t.y, this.y))),
  38865. (this.z = Math.max(e.z, Math.min(t.z, this.z))),
  38866. (this.w = Math.max(e.w, Math.min(t.w, this.w))),
  38867. this
  38868. )
  38869. },
  38870. clampScalar: (function () {
  38871. var e, t
  38872. return function (i, r) {
  38873. return void 0 === e && ((e = new n.Vector4()), (t = new n.Vector4())), e.set(i, i, i, i), t.set(r, r, r, r), this.clamp(e, t)
  38874. }
  38875. })(),
  38876. floor: function () {
  38877. return (this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), (this.z = Math.floor(this.z)), (this.w = Math.floor(this.w)), this
  38878. },
  38879. ceil: function () {
  38880. return (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), (this.z = Math.ceil(this.z)), (this.w = Math.ceil(this.w)), this
  38881. },
  38882. round: function () {
  38883. return (this.x = Math.round(this.x)), (this.y = Math.round(this.y)), (this.z = Math.round(this.z)), (this.w = Math.round(this.w)), this
  38884. },
  38885. roundToZero: function () {
  38886. return (
  38887. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  38888. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  38889. (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
  38890. (this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w)),
  38891. this
  38892. )
  38893. },
  38894. negate: function () {
  38895. return (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), (this.w = -this.w), this
  38896. },
  38897. dot: function (e) {
  38898. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38899. },
  38900. lengthSq: function () {
  38901. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38902. },
  38903. length: function () {
  38904. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38905. },
  38906. lengthManhattan: function () {
  38907. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38908. },
  38909. normalize: function () {
  38910. return this.divideScalar(this.length())
  38911. },
  38912. setLength: function (e) {
  38913. return this.multiplyScalar(e / this.length())
  38914. },
  38915. lerp: function (e, t) {
  38916. return (this.x += (e.x - this.x) * t), (this.y += (e.y - this.y) * t), (this.z += (e.z - this.z) * t), (this.w += (e.w - this.w) * t), this
  38917. },
  38918. lerpVectors: function (e, t, i) {
  38919. return this.subVectors(t, e).multiplyScalar(i).add(e), this
  38920. },
  38921. equals: function (e) {
  38922. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38923. },
  38924. fromArray: function (e, t) {
  38925. return void 0 === t && (t = 0), (this.x = e[t]), (this.y = e[t + 1]), (this.z = e[t + 2]), (this.w = e[t + 3]), this
  38926. },
  38927. toArray: function (e, t) {
  38928. return void 0 === e && (e = []), void 0 === t && (t = 0), (e[t] = this.x), (e[t + 1] = this.y), (e[t + 2] = this.z), (e[t + 3] = this.w), e
  38929. },
  38930. fromAttribute: function (e, t, i) {
  38931. return void 0 === i && (i = 0), (t = t * e.itemSize + i), (this.x = e.array[t]), (this.y = e.array[t + 1]), (this.z = e.array[t + 2]), (this.w = e.array[t + 3]), this
  38932. }
  38933. }),
  38934. (n.Euler = function (e, t, i, r) {
  38935. ;(this._x = e || 0), (this._y = t || 0), (this._z = i || 0), (this._order = r || n.Euler.DefaultOrder)
  38936. }),
  38937. (n.Euler.RotationOrders = ['XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX']),
  38938. (n.Euler.DefaultOrder = 'XYZ'),
  38939. (n.Euler.prototype = {
  38940. constructor: n.Euler,
  38941. get x() {
  38942. return this._x
  38943. },
  38944. set x(e) {
  38945. ;(this._x = e), this.onChangeCallback()
  38946. },
  38947. get y() {
  38948. return this._y
  38949. },
  38950. set y(e) {
  38951. ;(this._y = e), this.onChangeCallback()
  38952. },
  38953. get z() {
  38954. return this._z
  38955. },
  38956. set z(e) {
  38957. ;(this._z = e), this.onChangeCallback()
  38958. },
  38959. get order() {
  38960. return this._order
  38961. },
  38962. set order(e) {
  38963. ;(this._order = e), this.onChangeCallback()
  38964. },
  38965. set: function (e, t, i, n) {
  38966. return (this._x = e), (this._y = t), (this._z = i), (this._order = n || this._order), this.onChangeCallback(), this
  38967. },
  38968. clone: function () {
  38969. return new this.constructor(this._x, this._y, this._z, this._order)
  38970. },
  38971. copy: function (e) {
  38972. return (this._x = e._x), (this._y = e._y), (this._z = e._z), (this._order = e._order), this.onChangeCallback(), this
  38973. },
  38974. setFromRotationMatrix: function (e, t, i) {
  38975. var r = n.Math.clamp,
  38976. o = e.elements,
  38977. a = o[0],
  38978. s = o[4],
  38979. l = o[8],
  38980. c = o[1],
  38981. h = o[5],
  38982. u = o[9],
  38983. d = o[2],
  38984. p = o[6],
  38985. f = o[10]
  38986. return (
  38987. (t = t || this._order),
  38988. 'XYZ' === t
  38989. ? ((this._y = Math.asin(r(l, -1, 1))), Math.abs(l) < 0.99999 ? ((this._x = Math.atan2(-u, f)), (this._z = Math.atan2(-s, a))) : ((this._x = Math.atan2(p, h)), (this._z = 0)))
  38990. : 'YXZ' === t
  38991. ? ((this._x = Math.asin(-r(u, -1, 1))), Math.abs(u) < 0.99999 ? ((this._y = Math.atan2(l, f)), (this._z = Math.atan2(c, h))) : ((this._y = Math.atan2(-d, a)), (this._z = 0)))
  38992. : 'ZXY' === t
  38993. ? ((this._x = Math.asin(r(p, -1, 1))), Math.abs(p) < 0.99999 ? ((this._y = Math.atan2(-d, f)), (this._z = Math.atan2(-s, h))) : ((this._y = 0), (this._z = Math.atan2(c, a))))
  38994. : 'ZYX' === t
  38995. ? ((this._y = Math.asin(-r(d, -1, 1))), Math.abs(d) < 0.99999 ? ((this._x = Math.atan2(p, f)), (this._z = Math.atan2(c, a))) : ((this._x = 0), (this._z = Math.atan2(-s, h))))
  38996. : 'YZX' === t
  38997. ? ((this._z = Math.asin(r(c, -1, 1))), Math.abs(c) < 0.99999 ? ((this._x = Math.atan2(-u, h)), (this._y = Math.atan2(-d, a))) : ((this._x = 0), (this._y = Math.atan2(l, f))))
  38998. : 'XZY' === t
  38999. ? ((this._z = Math.asin(-r(s, -1, 1))), Math.abs(s) < 0.99999 ? ((this._x = Math.atan2(p, h)), (this._y = Math.atan2(l, a))) : ((this._x = Math.atan2(-u, f)), (this._y = 0)))
  39000. : console.warn('THREE.Euler: .setFromRotationMatrix() given unsupported order: ' + t),
  39001. (this._order = t),
  39002. i !== !1 && this.onChangeCallback(),
  39003. this
  39004. )
  39005. },
  39006. setFromQuaternion: (function () {
  39007. var e
  39008. return function (t, i, r) {
  39009. return void 0 === e && (e = new n.Matrix4()), e.makeRotationFromQuaternion(t), this.setFromRotationMatrix(e, i, r), this
  39010. }
  39011. })(),
  39012. setFromVector3: function (e, t) {
  39013. return this.set(e.x, e.y, e.z, t || this._order)
  39014. },
  39015. reorder: (function () {
  39016. var e = new n.Quaternion()
  39017. return function (t) {
  39018. e.setFromEuler(this), this.setFromQuaternion(e, t)
  39019. }
  39020. })(),
  39021. equals: function (e) {
  39022. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  39023. },
  39024. fromArray: function (e) {
  39025. return (this._x = e[0]), (this._y = e[1]), (this._z = e[2]), void 0 !== e[3] && (this._order = e[3]), this.onChangeCallback(), this
  39026. },
  39027. toArray: function (e, t) {
  39028. return void 0 === e && (e = []), void 0 === t && (t = 0), (e[t] = this._x), (e[t + 1] = this._y), (e[t + 2] = this._z), (e[t + 3] = this._order), e
  39029. },
  39030. toVector3: function (e) {
  39031. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x, this._y, this._z)
  39032. },
  39033. onChange: function (e) {
  39034. return (this.onChangeCallback = e), this
  39035. },
  39036. onChangeCallback: function () {}
  39037. }),
  39038. (n.Line3 = function (e, t) {
  39039. ;(this.start = void 0 !== e ? e : new n.Vector3()), (this.end = void 0 !== t ? t : new n.Vector3())
  39040. }),
  39041. (n.Line3.prototype = {
  39042. constructor: n.Line3,
  39043. set: function (e, t) {
  39044. return this.start.copy(e), this.end.copy(t), this
  39045. },
  39046. clone: function () {
  39047. return new this.constructor().copy(this)
  39048. },
  39049. copy: function (e) {
  39050. return this.start.copy(e.start), this.end.copy(e.end), this
  39051. },
  39052. center: function (e) {
  39053. var t = e || new n.Vector3()
  39054. return t.addVectors(this.start, this.end).multiplyScalar(0.5)
  39055. },
  39056. delta: function (e) {
  39057. var t = e || new n.Vector3()
  39058. return t.subVectors(this.end, this.start)
  39059. },
  39060. distanceSq: function () {
  39061. return this.start.distanceToSquared(this.end)
  39062. },
  39063. distance: function () {
  39064. return this.start.distanceTo(this.end)
  39065. },
  39066. at: function (e, t) {
  39067. var i = t || new n.Vector3()
  39068. return this.delta(i).multiplyScalar(e).add(this.start)
  39069. },
  39070. closestPointToPointParameter: (function () {
  39071. var e = new n.Vector3(),
  39072. t = new n.Vector3()
  39073. return function (i, r) {
  39074. e.subVectors(i, this.start), t.subVectors(this.end, this.start)
  39075. var o = t.dot(t),
  39076. a = t.dot(e),
  39077. s = a / o
  39078. return r && (s = n.Math.clamp(s, 0, 1)), s
  39079. }
  39080. })(),
  39081. closestPointToPoint: function (e, t, i) {
  39082. var r = this.closestPointToPointParameter(e, t),
  39083. o = i || new n.Vector3()
  39084. return this.delta(o).multiplyScalar(r).add(this.start)
  39085. },
  39086. applyMatrix4: function (e) {
  39087. return this.start.applyMatrix4(e), this.end.applyMatrix4(e), this
  39088. },
  39089. equals: function (e) {
  39090. return e.start.equals(this.start) && e.end.equals(this.end)
  39091. }
  39092. }),
  39093. (n.Box2 = function (e, t) {
  39094. ;(this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0), +(1 / 0))), (this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0), -(1 / 0)))
  39095. }),
  39096. (n.Box2.prototype = {
  39097. constructor: n.Box2,
  39098. set: function (e, t) {
  39099. return this.min.copy(e), this.max.copy(t), this
  39100. },
  39101. setFromPoints: function (e) {
  39102. this.makeEmpty()
  39103. for (var t = 0, i = e.length; t < i; t++) this.expandByPoint(e[t])
  39104. return this
  39105. },
  39106. setFromCenterAndSize: (function () {
  39107. var e = new n.Vector2()
  39108. return function (t, i) {
  39109. var n = e.copy(i).multiplyScalar(0.5)
  39110. return this.min.copy(t).sub(n), this.max.copy(t).add(n), this
  39111. }
  39112. })(),
  39113. clone: function () {
  39114. return new this.constructor().copy(this)
  39115. },
  39116. copy: function (e) {
  39117. return this.min.copy(e.min), this.max.copy(e.max), this
  39118. },
  39119. makeEmpty: function () {
  39120. return (this.min.x = this.min.y = +(1 / 0)), (this.max.x = this.max.y = -(1 / 0)), this
  39121. },
  39122. isEmpty: function () {
  39123. return this.max.x < this.min.x || this.max.y < this.min.y
  39124. },
  39125. center: function (e) {
  39126. var t = e || new n.Vector2()
  39127. return t.addVectors(this.min, this.max).multiplyScalar(0.5)
  39128. },
  39129. size: function (e) {
  39130. var t = e || new n.Vector2()
  39131. return t.subVectors(this.max, this.min)
  39132. },
  39133. expandByPoint: function (e) {
  39134. return this.min.min(e), this.max.max(e), this
  39135. },
  39136. expandByVector: function (e) {
  39137. return this.min.sub(e), this.max.add(e), this
  39138. },
  39139. expandByScalar: function (e) {
  39140. return this.min.addScalar(-e), this.max.addScalar(e), this
  39141. },
  39142. containsPoint: function (e) {
  39143. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  39144. },
  39145. containsBox: function (e) {
  39146. return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y
  39147. },
  39148. getParameter: function (e, t) {
  39149. var i = t || new n.Vector2()
  39150. return i.set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y))
  39151. },
  39152. intersectsBox: function (e) {
  39153. return !(e.max.x < this.min.x || e.min.x > this.max.x || e.max.y < this.min.y || e.min.y > this.max.y)
  39154. },
  39155. clampPoint: function (e, t) {
  39156. var i = t || new n.Vector2()
  39157. return i.copy(e).clamp(this.min, this.max)
  39158. },
  39159. distanceToPoint: (function () {
  39160. var e = new n.Vector2()
  39161. return function (t) {
  39162. var i = e.copy(t).clamp(this.min, this.max)
  39163. return i.sub(t).length()
  39164. }
  39165. })(),
  39166. intersect: function (e) {
  39167. return this.min.max(e.min), this.max.min(e.max), this
  39168. },
  39169. union: function (e) {
  39170. return this.min.min(e.min), this.max.max(e.max), this
  39171. },
  39172. translate: function (e) {
  39173. return this.min.add(e), this.max.add(e), this
  39174. },
  39175. equals: function (e) {
  39176. return e.min.equals(this.min) && e.max.equals(this.max)
  39177. }
  39178. }),
  39179. (n.Box3 = function (e, t) {
  39180. ;(this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0), +(1 / 0), +(1 / 0))), (this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0), -(1 / 0), -(1 / 0)))
  39181. }),
  39182. (n.Box3.prototype = {
  39183. constructor: n.Box3,
  39184. set: function (e, t) {
  39185. return this.min.copy(e), this.max.copy(t), this
  39186. },
  39187. setFromArray: function (e) {
  39188. this.makeEmpty()
  39189. for (var t = +(1 / 0), i = +(1 / 0), n = +(1 / 0), r = -(1 / 0), o = -(1 / 0), a = -(1 / 0), s = 0, l = e.length; s < l; s += 3) {
  39190. var c = e[s],
  39191. h = e[s + 1],
  39192. u = e[s + 2]
  39193. c < t && (t = c), h < i && (i = h), u < n && (n = u), c > r && (r = c), h > o && (o = h), u > a && (a = u)
  39194. }
  39195. this.min.set(t, i, n), this.max.set(r, o, a)
  39196. },
  39197. setFromPoints: function (e) {
  39198. this.makeEmpty()
  39199. for (var t = 0, i = e.length; t < i; t++) this.expandByPoint(e[t])
  39200. return this
  39201. },
  39202. setFromCenterAndSize: (function () {
  39203. var e = new n.Vector3()
  39204. return function (t, i) {
  39205. var n = e.copy(i).multiplyScalar(0.5)
  39206. return this.min.copy(t).sub(n), this.max.copy(t).add(n), this
  39207. }
  39208. })(),
  39209. setFromObject: (function () {
  39210. var e
  39211. return function (t) {
  39212. void 0 === e && (e = new n.Box3())
  39213. var i = this
  39214. return (
  39215. this.makeEmpty(),
  39216. t.updateMatrixWorld(!0),
  39217. t.traverse(function (t) {
  39218. var n = t.geometry
  39219. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(), n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox), e.applyMatrix4(t.matrixWorld), i.union(e)))
  39220. }),
  39221. this
  39222. )
  39223. }
  39224. })(),
  39225. clone: function () {
  39226. return new this.constructor().copy(this)
  39227. },
  39228. copy: function (e) {
  39229. return this.min.copy(e.min), this.max.copy(e.max), this
  39230. },
  39231. makeEmpty: function () {
  39232. return (this.min.x = this.min.y = this.min.z = +(1 / 0)), (this.max.x = this.max.y = this.max.z = -(1 / 0)), this
  39233. },
  39234. isEmpty: function () {
  39235. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  39236. },
  39237. center: function (e) {
  39238. var t = e || new n.Vector3()
  39239. return t.addVectors(this.min, this.max).multiplyScalar(0.5)
  39240. },
  39241. size: function (e) {
  39242. var t = e || new n.Vector3()
  39243. return t.subVectors(this.max, this.min)
  39244. },
  39245. expandByPoint: function (e) {
  39246. return this.min.min(e), this.max.max(e), this
  39247. },
  39248. expandByVector: function (e) {
  39249. return this.min.sub(e), this.max.add(e), this
  39250. },
  39251. expandByScalar: function (e) {
  39252. return this.min.addScalar(-e), this.max.addScalar(e), this
  39253. },
  39254. containsPoint: function (e) {
  39255. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y || e.z < this.min.z || e.z > this.max.z)
  39256. },
  39257. containsBox: function (e) {
  39258. return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y && this.min.z <= e.min.z && e.max.z <= this.max.z
  39259. },
  39260. getParameter: function (e, t) {
  39261. var i = t || new n.Vector3()
  39262. return i.set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y), (e.z - this.min.z) / (this.max.z - this.min.z))
  39263. },
  39264. intersectsBox: function (e) {
  39265. return !(e.max.x < this.min.x || e.min.x > this.max.x || e.max.y < this.min.y || e.min.y > this.max.y || e.max.z < this.min.z || e.min.z > this.max.z)
  39266. },
  39267. intersectsSphere: (function () {
  39268. var e
  39269. return function (t) {
  39270. return void 0 === e && (e = new n.Vector3()), this.clampPoint(t.center, e), e.distanceToSquared(t.center) <= t.radius * t.radius
  39271. }
  39272. })(),
  39273. intersectsPlane: function (e) {
  39274. var t, i
  39275. return (
  39276. e.normal.x > 0 ? ((t = e.normal.x * this.min.x), (i = e.normal.x * this.max.x)) : ((t = e.normal.x * this.max.x), (i = e.normal.x * this.min.x)),
  39277. e.normal.y > 0 ? ((t += e.normal.y * this.min.y), (i += e.normal.y * this.max.y)) : ((t += e.normal.y * this.max.y), (i += e.normal.y * this.min.y)),
  39278. e.normal.z > 0 ? ((t += e.normal.z * this.min.z), (i += e.normal.z * this.max.z)) : ((t += e.normal.z * this.max.z), (i += e.normal.z * this.min.z)),
  39279. t <= e.constant && i >= e.constant
  39280. )
  39281. },
  39282. clampPoint: function (e, t) {
  39283. var i = t || new n.Vector3()
  39284. return i.copy(e).clamp(this.min, this.max)
  39285. },
  39286. distanceToPoint: (function () {
  39287. var e = new n.Vector3()
  39288. return function (t) {
  39289. var i = e.copy(t).clamp(this.min, this.max)
  39290. return i.sub(t).length()
  39291. }
  39292. })(),
  39293. getBoundingSphere: (function () {
  39294. var e = new n.Vector3()
  39295. return function (t) {
  39296. var i = t || new n.Sphere()
  39297. return (i.center = this.center()), (i.radius = 0.5 * this.size(e).length()), i
  39298. }
  39299. })(),
  39300. intersect: function (e) {
  39301. return this.min.max(e.min), this.max.min(e.max), this
  39302. },
  39303. union: function (e) {
  39304. return this.min.min(e.min), this.max.max(e.max), this
  39305. },
  39306. applyMatrix4: (function () {
  39307. var e = [new n.Vector3(), new n.Vector3(), new n.Vector3(), new n.Vector3(), new n.Vector3(), new n.Vector3(), new n.Vector3(), new n.Vector3()]
  39308. return function (t) {
  39309. return (
  39310. e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  39311. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  39312. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  39313. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  39314. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  39315. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  39316. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  39317. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  39318. this.makeEmpty(),
  39319. this.setFromPoints(e),
  39320. this
  39321. )
  39322. }
  39323. })(),
  39324. translate: function (e) {
  39325. return this.min.add(e), this.max.add(e), this
  39326. },
  39327. equals: function (e) {
  39328. return e.min.equals(this.min) && e.max.equals(this.max)
  39329. }
  39330. }),
  39331. (n.Matrix3 = function () {
  39332. ;(this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1])), arguments.length > 0 && console.error('THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.')
  39333. }),
  39334. (n.Matrix3.prototype = {
  39335. constructor: n.Matrix3,
  39336. set: function (e, t, i, n, r, o, a, s, l) {
  39337. var c = this.elements
  39338. return (c[0] = e), (c[1] = n), (c[2] = a), (c[3] = t), (c[4] = r), (c[5] = s), (c[6] = i), (c[7] = o), (c[8] = l), this
  39339. },
  39340. identity: function () {
  39341. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this
  39342. },
  39343. clone: function () {
  39344. return new this.constructor().fromArray(this.elements)
  39345. },
  39346. copy: function (e) {
  39347. var t = e.elements
  39348. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]), this
  39349. },
  39350. setFromMatrix4: function (e) {
  39351. var t = e.elements
  39352. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]), this
  39353. },
  39354. applyToVector3Array: (function () {
  39355. var e
  39356. return function (t, i, r) {
  39357. void 0 === e && (e = new n.Vector3()), void 0 === i && (i = 0), void 0 === r && (r = t.length)
  39358. for (var o = 0, a = i; o < r; o += 3, a += 3) e.fromArray(t, a), e.applyMatrix3(this), e.toArray(t, a)
  39359. return t
  39360. }
  39361. })(),
  39362. applyToBuffer: (function () {
  39363. var e
  39364. return function (t, i, r) {
  39365. void 0 === e && (e = new n.Vector3()), void 0 === i && (i = 0), void 0 === r && (r = t.length / t.itemSize)
  39366. for (var o = 0, a = i; o < r; o++, a++) (e.x = t.getX(a)), (e.y = t.getY(a)), (e.z = t.getZ(a)), e.applyMatrix3(this), t.setXYZ(e.x, e.y, e.z)
  39367. return t
  39368. }
  39369. })(),
  39370. multiplyScalar: function (e) {
  39371. var t = this.elements
  39372. return (t[0] *= e), (t[3] *= e), (t[6] *= e), (t[1] *= e), (t[4] *= e), (t[7] *= e), (t[2] *= e), (t[5] *= e), (t[8] *= e), this
  39373. },
  39374. determinant: function () {
  39375. var e = this.elements,
  39376. t = e[0],
  39377. i = e[1],
  39378. n = e[2],
  39379. r = e[3],
  39380. o = e[4],
  39381. a = e[5],
  39382. s = e[6],
  39383. l = e[7],
  39384. c = e[8]
  39385. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39386. },
  39387. getInverse: function (e, t) {
  39388. e instanceof n.Matrix4 && console.warn('THREE.Matrix3.getInverse no longer takes a Matrix4 argument.')
  39389. var i = e.elements,
  39390. r = this.elements,
  39391. o = i[0],
  39392. a = i[1],
  39393. s = i[2],
  39394. l = i[3],
  39395. c = i[4],
  39396. h = i[5],
  39397. u = i[6],
  39398. d = i[7],
  39399. p = i[8],
  39400. f = p * c - h * d,
  39401. g = h * u - p * l,
  39402. m = d * l - c * u,
  39403. v = o * f + a * g + s * m
  39404. if (0 === v) {
  39405. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0"
  39406. if (t) throw new Error(A)
  39407. return console.warn(A), this.identity()
  39408. }
  39409. return (
  39410. (r[0] = f),
  39411. (r[1] = s * d - p * a),
  39412. (r[2] = h * a - s * c),
  39413. (r[3] = g),
  39414. (r[4] = p * o - s * u),
  39415. (r[5] = s * l - h * o),
  39416. (r[6] = m),
  39417. (r[7] = a * u - d * o),
  39418. (r[8] = c * o - a * l),
  39419. this.multiplyScalar(1 / v)
  39420. )
  39421. },
  39422. transpose: function () {
  39423. var e,
  39424. t = this.elements
  39425. return (e = t[1]), (t[1] = t[3]), (t[3] = e), (e = t[2]), (t[2] = t[6]), (t[6] = e), (e = t[5]), (t[5] = t[7]), (t[7] = e), this
  39426. },
  39427. flattenToArrayOffset: function (e, t) {
  39428. var i = this.elements
  39429. return (e[t] = i[0]), (e[t + 1] = i[1]), (e[t + 2] = i[2]), (e[t + 3] = i[3]), (e[t + 4] = i[4]), (e[t + 5] = i[5]), (e[t + 6] = i[6]), (e[t + 7] = i[7]), (e[t + 8] = i[8]), e
  39430. },
  39431. getNormalMatrix: function (e) {
  39432. return this.setFromMatrix4(e).getInverse(this).transpose()
  39433. },
  39434. transposeIntoArray: function (e) {
  39435. var t = this.elements
  39436. return (e[0] = t[0]), (e[1] = t[3]), (e[2] = t[6]), (e[3] = t[1]), (e[4] = t[4]), (e[5] = t[7]), (e[6] = t[2]), (e[7] = t[5]), (e[8] = t[8]), this
  39437. },
  39438. fromArray: function (e) {
  39439. return this.elements.set(e), this
  39440. },
  39441. toArray: function () {
  39442. var e = this.elements
  39443. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39444. }
  39445. }),
  39446. (n.Matrix4 = function () {
  39447. ;(this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])),
  39448. arguments.length > 0 && console.error('THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.')
  39449. }),
  39450. (n.Matrix4.prototype = {
  39451. constructor: n.Matrix4,
  39452. set: function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39453. var m = this.elements
  39454. return (
  39455. (m[0] = e),
  39456. (m[4] = t),
  39457. (m[8] = i),
  39458. (m[12] = n),
  39459. (m[1] = r),
  39460. (m[5] = o),
  39461. (m[9] = a),
  39462. (m[13] = s),
  39463. (m[2] = l),
  39464. (m[6] = c),
  39465. (m[10] = h),
  39466. (m[14] = u),
  39467. (m[3] = d),
  39468. (m[7] = p),
  39469. (m[11] = f),
  39470. (m[15] = g),
  39471. this
  39472. )
  39473. },
  39474. identity: function () {
  39475. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  39476. },
  39477. clone: function () {
  39478. return new n.Matrix4().fromArray(this.elements)
  39479. },
  39480. copy: function (e) {
  39481. return this.elements.set(e.elements), this
  39482. },
  39483. copyPosition: function (e) {
  39484. var t = this.elements,
  39485. i = e.elements
  39486. return (t[12] = i[12]), (t[13] = i[13]), (t[14] = i[14]), this
  39487. },
  39488. extractBasis: function (e, t, i) {
  39489. return e.setFromMatrixColumn(this, 0), t.setFromMatrixColumn(this, 1), i.setFromMatrixColumn(this, 2), this
  39490. },
  39491. makeBasis: function (e, t, i) {
  39492. return this.set(e.x, t.x, i.x, 0, e.y, t.y, i.y, 0, e.z, t.z, i.z, 0, 0, 0, 0, 1), this
  39493. },
  39494. extractRotation: (function () {
  39495. var e
  39496. return function (t) {
  39497. void 0 === e && (e = new n.Vector3())
  39498. var i = this.elements,
  39499. r = t.elements,
  39500. o = 1 / e.setFromMatrixColumn(t, 0).length(),
  39501. a = 1 / e.setFromMatrixColumn(t, 1).length(),
  39502. s = 1 / e.setFromMatrixColumn(t, 2).length()
  39503. return (i[0] = r[0] * o), (i[1] = r[1] * o), (i[2] = r[2] * o), (i[4] = r[4] * a), (i[5] = r[5] * a), (i[6] = r[6] * a), (i[8] = r[8] * s), (i[9] = r[9] * s), (i[10] = r[10] * s), this
  39504. }
  39505. })(),
  39506. makeRotationFromEuler: function (e) {
  39507. e instanceof n.Euler == !1 && console.error('THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.')
  39508. var t = this.elements,
  39509. i = e.x,
  39510. r = e.y,
  39511. o = e.z,
  39512. a = Math.cos(i),
  39513. s = Math.sin(i),
  39514. l = Math.cos(r),
  39515. c = Math.sin(r),
  39516. h = Math.cos(o),
  39517. u = Math.sin(o)
  39518. if ('XYZ' === e.order) {
  39519. var d = a * h,
  39520. p = a * u,
  39521. f = s * h,
  39522. g = s * u
  39523. ;(t[0] = l * h), (t[4] = -l * u), (t[8] = c), (t[1] = p + f * c), (t[5] = d - g * c), (t[9] = -s * l), (t[2] = g - d * c), (t[6] = f + p * c), (t[10] = a * l)
  39524. } else if ('YXZ' === e.order) {
  39525. var m = l * h,
  39526. v = l * u,
  39527. A = c * h,
  39528. y = c * u
  39529. ;(t[0] = m + y * s), (t[4] = A * s - v), (t[8] = a * c), (t[1] = a * u), (t[5] = a * h), (t[9] = -s), (t[2] = v * s - A), (t[6] = y + m * s), (t[10] = a * l)
  39530. } else if ('ZXY' === e.order) {
  39531. var m = l * h,
  39532. v = l * u,
  39533. A = c * h,
  39534. y = c * u
  39535. ;(t[0] = m - y * s), (t[4] = -a * u), (t[8] = A + v * s), (t[1] = v + A * s), (t[5] = a * h), (t[9] = y - m * s), (t[2] = -a * c), (t[6] = s), (t[10] = a * l)
  39536. } else if ('ZYX' === e.order) {
  39537. var d = a * h,
  39538. p = a * u,
  39539. f = s * h,
  39540. g = s * u
  39541. ;(t[0] = l * h), (t[4] = f * c - p), (t[8] = d * c + g), (t[1] = l * u), (t[5] = g * c + d), (t[9] = p * c - f), (t[2] = -c), (t[6] = s * l), (t[10] = a * l)
  39542. } else if ('YZX' === e.order) {
  39543. var C = a * l,
  39544. I = a * c,
  39545. E = s * l,
  39546. b = s * c
  39547. ;(t[0] = l * h), (t[4] = b - C * u), (t[8] = E * u + I), (t[1] = u), (t[5] = a * h), (t[9] = -s * h), (t[2] = -c * h), (t[6] = I * u + E), (t[10] = C - b * u)
  39548. } else if ('XZY' === e.order) {
  39549. var C = a * l,
  39550. I = a * c,
  39551. E = s * l,
  39552. b = s * c
  39553. ;(t[0] = l * h), (t[4] = -u), (t[8] = c * h), (t[1] = C * u + b), (t[5] = a * h), (t[9] = I * u - E), (t[2] = E * u - I), (t[6] = s * h), (t[10] = b * u + C)
  39554. }
  39555. return (t[3] = 0), (t[7] = 0), (t[11] = 0), (t[12] = 0), (t[13] = 0), (t[14] = 0), (t[15] = 1), this
  39556. },
  39557. makeRotationFromQuaternion: function (e) {
  39558. var t = this.elements,
  39559. i = e.x,
  39560. n = e.y,
  39561. r = e.z,
  39562. o = e.w,
  39563. a = i + i,
  39564. s = n + n,
  39565. l = r + r,
  39566. c = i * a,
  39567. h = i * s,
  39568. u = i * l,
  39569. d = n * s,
  39570. p = n * l,
  39571. f = r * l,
  39572. g = o * a,
  39573. m = o * s,
  39574. v = o * l
  39575. return (
  39576. (t[0] = 1 - (d + f)),
  39577. (t[4] = h - v),
  39578. (t[8] = u + m),
  39579. (t[1] = h + v),
  39580. (t[5] = 1 - (c + f)),
  39581. (t[9] = p - g),
  39582. (t[2] = u - m),
  39583. (t[6] = p + g),
  39584. (t[10] = 1 - (c + d)),
  39585. (t[3] = 0),
  39586. (t[7] = 0),
  39587. (t[11] = 0),
  39588. (t[12] = 0),
  39589. (t[13] = 0),
  39590. (t[14] = 0),
  39591. (t[15] = 1),
  39592. this
  39593. )
  39594. },
  39595. lookAt: (function () {
  39596. var e, t, i
  39597. return function (r, o, a) {
  39598. void 0 === e && (e = new n.Vector3()), void 0 === t && (t = new n.Vector3()), void 0 === i && (i = new n.Vector3())
  39599. var s = this.elements
  39600. return (
  39601. i.subVectors(r, o).normalize(),
  39602. 0 === i.lengthSq() && (i.z = 1),
  39603. e.crossVectors(a, i).normalize(),
  39604. 0 === e.lengthSq() && ((i.x += 1e-4), e.crossVectors(a, i).normalize()),
  39605. t.crossVectors(i, e),
  39606. (s[0] = e.x),
  39607. (s[4] = t.x),
  39608. (s[8] = i.x),
  39609. (s[1] = e.y),
  39610. (s[5] = t.y),
  39611. (s[9] = i.y),
  39612. (s[2] = e.z),
  39613. (s[6] = t.z),
  39614. (s[10] = i.z),
  39615. this
  39616. )
  39617. }
  39618. })(),
  39619. multiply: function (e, t) {
  39620. return void 0 !== t
  39621. ? (console.warn('THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.'), this.multiplyMatrices(e, t))
  39622. : this.multiplyMatrices(this, e)
  39623. },
  39624. multiplyMatrices: function (e, t) {
  39625. var i = e.elements,
  39626. n = t.elements,
  39627. r = this.elements,
  39628. o = i[0],
  39629. a = i[4],
  39630. s = i[8],
  39631. l = i[12],
  39632. c = i[1],
  39633. h = i[5],
  39634. u = i[9],
  39635. d = i[13],
  39636. p = i[2],
  39637. f = i[6],
  39638. g = i[10],
  39639. m = i[14],
  39640. v = i[3],
  39641. A = i[7],
  39642. y = i[11],
  39643. C = i[15],
  39644. I = n[0],
  39645. E = n[4],
  39646. b = n[8],
  39647. w = n[12],
  39648. _ = n[1],
  39649. T = n[5],
  39650. x = n[9],
  39651. S = n[13],
  39652. M = n[2],
  39653. R = n[6],
  39654. P = n[10],
  39655. O = n[14],
  39656. L = n[3],
  39657. D = n[7],
  39658. N = n[11],
  39659. B = n[15]
  39660. return (
  39661. (r[0] = o * I + a * _ + s * M + l * L),
  39662. (r[4] = o * E + a * T + s * R + l * D),
  39663. (r[8] = o * b + a * x + s * P + l * N),
  39664. (r[12] = o * w + a * S + s * O + l * B),
  39665. (r[1] = c * I + h * _ + u * M + d * L),
  39666. (r[5] = c * E + h * T + u * R + d * D),
  39667. (r[9] = c * b + h * x + u * P + d * N),
  39668. (r[13] = c * w + h * S + u * O + d * B),
  39669. (r[2] = p * I + f * _ + g * M + m * L),
  39670. (r[6] = p * E + f * T + g * R + m * D),
  39671. (r[10] = p * b + f * x + g * P + m * N),
  39672. (r[14] = p * w + f * S + g * O + m * B),
  39673. (r[3] = v * I + A * _ + y * M + C * L),
  39674. (r[7] = v * E + A * T + y * R + C * D),
  39675. (r[11] = v * b + A * x + y * P + C * N),
  39676. (r[15] = v * w + A * S + y * O + C * B),
  39677. this
  39678. )
  39679. },
  39680. multiplyToArray: function (e, t, i) {
  39681. var n = this.elements
  39682. return (
  39683. this.multiplyMatrices(e, t),
  39684. (i[0] = n[0]),
  39685. (i[1] = n[1]),
  39686. (i[2] = n[2]),
  39687. (i[3] = n[3]),
  39688. (i[4] = n[4]),
  39689. (i[5] = n[5]),
  39690. (i[6] = n[6]),
  39691. (i[7] = n[7]),
  39692. (i[8] = n[8]),
  39693. (i[9] = n[9]),
  39694. (i[10] = n[10]),
  39695. (i[11] = n[11]),
  39696. (i[12] = n[12]),
  39697. (i[13] = n[13]),
  39698. (i[14] = n[14]),
  39699. (i[15] = n[15]),
  39700. this
  39701. )
  39702. },
  39703. multiplyScalar: function (e) {
  39704. var t = this.elements
  39705. return (
  39706. (t[0] *= e),
  39707. (t[4] *= e),
  39708. (t[8] *= e),
  39709. (t[12] *= e),
  39710. (t[1] *= e),
  39711. (t[5] *= e),
  39712. (t[9] *= e),
  39713. (t[13] *= e),
  39714. (t[2] *= e),
  39715. (t[6] *= e),
  39716. (t[10] *= e),
  39717. (t[14] *= e),
  39718. (t[3] *= e),
  39719. (t[7] *= e),
  39720. (t[11] *= e),
  39721. (t[15] *= e),
  39722. this
  39723. )
  39724. },
  39725. applyToVector3Array: (function () {
  39726. var e
  39727. return function (t, i, r) {
  39728. void 0 === e && (e = new n.Vector3()), void 0 === i && (i = 0), void 0 === r && (r = t.length)
  39729. for (var o = 0, a = i; o < r; o += 3, a += 3) e.fromArray(t, a), e.applyMatrix4(this), e.toArray(t, a)
  39730. return t
  39731. }
  39732. })(),
  39733. applyToBuffer: (function () {
  39734. var e
  39735. return function (t, i, r) {
  39736. void 0 === e && (e = new n.Vector3()), void 0 === i && (i = 0), void 0 === r && (r = t.length / t.itemSize)
  39737. for (var o = 0, a = i; o < r; o++, a++) (e.x = t.getX(a)), (e.y = t.getY(a)), (e.z = t.getZ(a)), e.applyMatrix4(this), t.setXYZ(e.x, e.y, e.z)
  39738. return t
  39739. }
  39740. })(),
  39741. determinant: function () {
  39742. var e = this.elements,
  39743. t = e[0],
  39744. i = e[4],
  39745. n = e[8],
  39746. r = e[12],
  39747. o = e[1],
  39748. a = e[5],
  39749. s = e[9],
  39750. l = e[13],
  39751. c = e[2],
  39752. h = e[6],
  39753. u = e[10],
  39754. d = e[14],
  39755. p = e[3],
  39756. f = e[7],
  39757. g = e[11],
  39758. m = e[15]
  39759. return (
  39760. p * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) +
  39761. f * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) +
  39762. g * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) +
  39763. m * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  39764. )
  39765. },
  39766. transpose: function () {
  39767. var e,
  39768. t = this.elements
  39769. return (
  39770. (e = t[1]),
  39771. (t[1] = t[4]),
  39772. (t[4] = e),
  39773. (e = t[2]),
  39774. (t[2] = t[8]),
  39775. (t[8] = e),
  39776. (e = t[6]),
  39777. (t[6] = t[9]),
  39778. (t[9] = e),
  39779. (e = t[3]),
  39780. (t[3] = t[12]),
  39781. (t[12] = e),
  39782. (e = t[7]),
  39783. (t[7] = t[13]),
  39784. (t[13] = e),
  39785. (e = t[11]),
  39786. (t[11] = t[14]),
  39787. (t[14] = e),
  39788. this
  39789. )
  39790. },
  39791. flattenToArrayOffset: function (e, t) {
  39792. var i = this.elements
  39793. return (
  39794. (e[t] = i[0]),
  39795. (e[t + 1] = i[1]),
  39796. (e[t + 2] = i[2]),
  39797. (e[t + 3] = i[3]),
  39798. (e[t + 4] = i[4]),
  39799. (e[t + 5] = i[5]),
  39800. (e[t + 6] = i[6]),
  39801. (e[t + 7] = i[7]),
  39802. (e[t + 8] = i[8]),
  39803. (e[t + 9] = i[9]),
  39804. (e[t + 10] = i[10]),
  39805. (e[t + 11] = i[11]),
  39806. (e[t + 12] = i[12]),
  39807. (e[t + 13] = i[13]),
  39808. (e[t + 14] = i[14]),
  39809. (e[t + 15] = i[15]),
  39810. e
  39811. )
  39812. },
  39813. getPosition: (function () {
  39814. var e
  39815. return function () {
  39816. return (
  39817. void 0 === e && (e = new n.Vector3()),
  39818. console.warn('THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.'),
  39819. e.setFromMatrixColumn(this, 3)
  39820. )
  39821. }
  39822. })(),
  39823. setPosition: function (e) {
  39824. var t = this.elements
  39825. return (t[12] = e.x), (t[13] = e.y), (t[14] = e.z), this
  39826. },
  39827. getInverse: function (e, t) {
  39828. var i = this.elements,
  39829. n = e.elements,
  39830. r = n[0],
  39831. o = n[1],
  39832. a = n[2],
  39833. s = n[3],
  39834. l = n[4],
  39835. c = n[5],
  39836. h = n[6],
  39837. u = n[7],
  39838. d = n[8],
  39839. p = n[9],
  39840. f = n[10],
  39841. g = n[11],
  39842. m = n[12],
  39843. v = n[13],
  39844. A = n[14],
  39845. y = n[15],
  39846. C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y,
  39847. I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y,
  39848. E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y,
  39849. b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A,
  39850. w = r * C + o * I + a * E + s * b
  39851. if (0 === w) {
  39852. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0"
  39853. if (t) throw new Error(_)
  39854. return console.warn(_), this.identity()
  39855. }
  39856. return (
  39857. (i[0] = C),
  39858. (i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y),
  39859. (i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y),
  39860. (i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g),
  39861. (i[4] = I),
  39862. (i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y),
  39863. (i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y),
  39864. (i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g),
  39865. (i[8] = E),
  39866. (i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y),
  39867. (i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y),
  39868. (i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g),
  39869. (i[12] = b),
  39870. (i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A),
  39871. (i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A),
  39872. (i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f),
  39873. this.multiplyScalar(1 / w)
  39874. )
  39875. },
  39876. scale: function (e) {
  39877. var t = this.elements,
  39878. i = e.x,
  39879. n = e.y,
  39880. r = e.z
  39881. return (t[0] *= i), (t[4] *= n), (t[8] *= r), (t[1] *= i), (t[5] *= n), (t[9] *= r), (t[2] *= i), (t[6] *= n), (t[10] *= r), (t[3] *= i), (t[7] *= n), (t[11] *= r), this
  39882. },
  39883. getMaxScaleOnAxis: function () {
  39884. var e = this.elements,
  39885. t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2],
  39886. i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6],
  39887. n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10]
  39888. return Math.sqrt(Math.max(t, i, n))
  39889. },
  39890. makeTranslation: function (e, t, i) {
  39891. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1), this
  39892. },
  39893. makeRotationX: function (e) {
  39894. var t = Math.cos(e),
  39895. i = Math.sin(e)
  39896. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1), this
  39897. },
  39898. makeRotationY: function (e) {
  39899. var t = Math.cos(e),
  39900. i = Math.sin(e)
  39901. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1), this
  39902. },
  39903. makeRotationZ: function (e) {
  39904. var t = Math.cos(e),
  39905. i = Math.sin(e)
  39906. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  39907. },
  39908. makeRotationAxis: function (e, t) {
  39909. var i = Math.cos(t),
  39910. n = Math.sin(t),
  39911. r = 1 - i,
  39912. o = e.x,
  39913. a = e.y,
  39914. s = e.z,
  39915. l = r * o,
  39916. c = r * a
  39917. return this.set(l * o + i, l * a - n * s, l * s + n * a, 0, l * a + n * s, c * a + i, c * s - n * o, 0, l * s - n * a, c * s + n * o, r * s * s + i, 0, 0, 0, 0, 1), this
  39918. },
  39919. makeScale: function (e, t, i) {
  39920. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1), this
  39921. },
  39922. compose: function (e, t, i) {
  39923. return this.makeRotationFromQuaternion(t), this.scale(i), this.setPosition(e), this
  39924. },
  39925. decompose: (function () {
  39926. var e, t
  39927. return function (i, r, o) {
  39928. void 0 === e && (e = new n.Vector3()), void 0 === t && (t = new n.Matrix4())
  39929. var a = this.elements,
  39930. s = e.set(a[0], a[1], a[2]).length(),
  39931. l = e.set(a[4], a[5], a[6]).length(),
  39932. c = e.set(a[8], a[9], a[10]).length(),
  39933. h = this.determinant()
  39934. h < 0 && (s = -s), (i.x = a[12]), (i.y = a[13]), (i.z = a[14]), t.elements.set(this.elements)
  39935. var u = 1 / s,
  39936. d = 1 / l,
  39937. p = 1 / c
  39938. return (
  39939. (t.elements[0] *= u),
  39940. (t.elements[1] *= u),
  39941. (t.elements[2] *= u),
  39942. (t.elements[4] *= d),
  39943. (t.elements[5] *= d),
  39944. (t.elements[6] *= d),
  39945. (t.elements[8] *= p),
  39946. (t.elements[9] *= p),
  39947. (t.elements[10] *= p),
  39948. r.setFromRotationMatrix(t),
  39949. (o.x = s),
  39950. (o.y = l),
  39951. (o.z = c),
  39952. this
  39953. )
  39954. }
  39955. })(),
  39956. makeFrustum: function (e, t, i, n, r, o) {
  39957. var a = this.elements,
  39958. s = (2 * r) / (t - e),
  39959. l = (2 * r) / (n - i),
  39960. c = (t + e) / (t - e),
  39961. h = (n + i) / (n - i),
  39962. u = -(o + r) / (o - r),
  39963. d = (-2 * o * r) / (o - r)
  39964. return (
  39965. (a[0] = s),
  39966. (a[4] = 0),
  39967. (a[8] = c),
  39968. (a[12] = 0),
  39969. (a[1] = 0),
  39970. (a[5] = l),
  39971. (a[9] = h),
  39972. (a[13] = 0),
  39973. (a[2] = 0),
  39974. (a[6] = 0),
  39975. (a[10] = u),
  39976. (a[14] = d),
  39977. (a[3] = 0),
  39978. (a[7] = 0),
  39979. (a[11] = -1),
  39980. (a[15] = 0),
  39981. this
  39982. )
  39983. },
  39984. makePerspective: function (e, t, i, r) {
  39985. var o = i * Math.tan(n.Math.degToRad(0.5 * e)),
  39986. a = -o,
  39987. s = a * t,
  39988. l = o * t
  39989. return this.makeFrustum(s, l, a, o, i, r)
  39990. },
  39991. makeOrthographic: function (e, t, i, n, r, o) {
  39992. var a = this.elements,
  39993. s = 1 / (t - e),
  39994. l = 1 / (i - n),
  39995. c = 1 / (o - r),
  39996. h = (t + e) * s,
  39997. u = (i + n) * l,
  39998. d = (o + r) * c
  39999. return (
  40000. (a[0] = 2 * s),
  40001. (a[4] = 0),
  40002. (a[8] = 0),
  40003. (a[12] = -h),
  40004. (a[1] = 0),
  40005. (a[5] = 2 * l),
  40006. (a[9] = 0),
  40007. (a[13] = -u),
  40008. (a[2] = 0),
  40009. (a[6] = 0),
  40010. (a[10] = -2 * c),
  40011. (a[14] = -d),
  40012. (a[3] = 0),
  40013. (a[7] = 0),
  40014. (a[11] = 0),
  40015. (a[15] = 1),
  40016. this
  40017. )
  40018. },
  40019. equals: function (e) {
  40020. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++) if (t[n] !== i[n]) return !1
  40021. return !0
  40022. },
  40023. fromArray: function (e) {
  40024. return this.elements.set(e), this
  40025. },
  40026. toArray: function () {
  40027. var e = this.elements
  40028. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8], e[9], e[10], e[11], e[12], e[13], e[14], e[15]]
  40029. }
  40030. }),
  40031. (n.Ray = function (e, t) {
  40032. ;(this.origin = void 0 !== e ? e : new n.Vector3()), (this.direction = void 0 !== t ? t : new n.Vector3())
  40033. }),
  40034. (n.Ray.prototype = {
  40035. constructor: n.Ray,
  40036. set: function (e, t) {
  40037. return this.origin.copy(e), this.direction.copy(t), this
  40038. },
  40039. clone: function () {
  40040. return new this.constructor().copy(this)
  40041. },
  40042. copy: function (e) {
  40043. return this.origin.copy(e.origin), this.direction.copy(e.direction), this
  40044. },
  40045. at: function (e, t) {
  40046. var i = t || new n.Vector3()
  40047. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  40048. },
  40049. lookAt: function (e) {
  40050. this.direction.copy(e).sub(this.origin).normalize()
  40051. },
  40052. recast: (function () {
  40053. var e = new n.Vector3()
  40054. return function (t) {
  40055. return this.origin.copy(this.at(t, e)), this
  40056. }
  40057. })(),
  40058. closestPointToPoint: function (e, t) {
  40059. var i = t || new n.Vector3()
  40060. i.subVectors(e, this.origin)
  40061. var r = i.dot(this.direction)
  40062. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  40063. },
  40064. distanceToPoint: function (e) {
  40065. return Math.sqrt(this.distanceSqToPoint(e))
  40066. },
  40067. distanceSqToPoint: (function () {
  40068. var e = new n.Vector3()
  40069. return function (t) {
  40070. var i = e.subVectors(t, this.origin).dot(this.direction)
  40071. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin), e.distanceToSquared(t))
  40072. }
  40073. })(),
  40074. distanceSqToSegment: (function () {
  40075. var e = new n.Vector3(),
  40076. t = new n.Vector3(),
  40077. i = new n.Vector3()
  40078. return function (n, r, o, a) {
  40079. e.copy(n).add(r).multiplyScalar(0.5), t.copy(r).sub(n).normalize(), i.copy(this.origin).sub(e)
  40080. var s,
  40081. l,
  40082. c,
  40083. h,
  40084. u = 0.5 * n.distanceTo(r),
  40085. d = -this.direction.dot(t),
  40086. p = i.dot(this.direction),
  40087. f = -i.dot(t),
  40088. g = i.lengthSq(),
  40089. m = Math.abs(1 - d * d)
  40090. if (m > 0)
  40091. if (((s = d * f - p), (l = d * p - f), (h = u * m), s >= 0))
  40092. if (l >= -h)
  40093. if (l <= h) {
  40094. var v = 1 / m
  40095. ;(s *= v), (l *= v), (c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g)
  40096. } else (l = u), (s = Math.max(0, -(d * l + p))), (c = -s * s + l * (l + 2 * f) + g)
  40097. else (l = -u), (s = Math.max(0, -(d * l + p))), (c = -s * s + l * (l + 2 * f) + g)
  40098. else
  40099. l <= -h
  40100. ? ((s = Math.max(0, -(-d * u + p))), (l = s > 0 ? -u : Math.min(Math.max(-u, -f), u)), (c = -s * s + l * (l + 2 * f) + g))
  40101. : l <= h
  40102. ? ((s = 0), (l = Math.min(Math.max(-u, -f), u)), (c = l * (l + 2 * f) + g))
  40103. : ((s = Math.max(0, -(d * u + p))), (l = s > 0 ? u : Math.min(Math.max(-u, -f), u)), (c = -s * s + l * (l + 2 * f) + g))
  40104. else (l = d > 0 ? -u : u), (s = Math.max(0, -(d * l + p))), (c = -s * s + l * (l + 2 * f) + g)
  40105. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin), a && a.copy(t).multiplyScalar(l).add(e), c
  40106. }
  40107. })(),
  40108. intersectSphere: (function () {
  40109. var e = new n.Vector3()
  40110. return function (t, i) {
  40111. e.subVectors(t.center, this.origin)
  40112. var n = e.dot(this.direction),
  40113. r = e.dot(e) - n * n,
  40114. o = t.radius * t.radius
  40115. if (r > o) return null
  40116. var a = Math.sqrt(o - r),
  40117. s = n - a,
  40118. l = n + a
  40119. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  40120. }
  40121. })(),
  40122. intersectsSphere: function (e) {
  40123. return this.distanceToPoint(e.center) <= e.radius
  40124. },
  40125. distanceToPlane: function (e) {
  40126. var t = e.normal.dot(this.direction)
  40127. if (0 === t) return 0 === e.distanceToPoint(this.origin) ? 0 : null
  40128. var i = -(this.origin.dot(e.normal) + e.constant) / t
  40129. return i >= 0 ? i : null
  40130. },
  40131. intersectPlane: function (e, t) {
  40132. var i = this.distanceToPlane(e)
  40133. return null === i ? null : this.at(i, t)
  40134. },
  40135. intersectsPlane: function (e) {
  40136. var t = e.distanceToPoint(this.origin)
  40137. if (0 === t) return !0
  40138. var i = e.normal.dot(this.direction)
  40139. return i * t < 0
  40140. },
  40141. intersectBox: function (e, t) {
  40142. var i,
  40143. n,
  40144. r,
  40145. o,
  40146. a,
  40147. s,
  40148. l = 1 / this.direction.x,
  40149. c = 1 / this.direction.y,
  40150. h = 1 / this.direction.z,
  40151. u = this.origin
  40152. return (
  40153. l >= 0 ? ((i = (e.min.x - u.x) * l), (n = (e.max.x - u.x) * l)) : ((i = (e.max.x - u.x) * l), (n = (e.min.x - u.x) * l)),
  40154. c >= 0 ? ((r = (e.min.y - u.y) * c), (o = (e.max.y - u.y) * c)) : ((r = (e.max.y - u.y) * c), (o = (e.min.y - u.y) * c)),
  40155. i > o || r > n
  40156. ? null
  40157. : ((r > i || i !== i) && (i = r),
  40158. (o < n || n !== n) && (n = o),
  40159. h >= 0 ? ((a = (e.min.z - u.z) * h), (s = (e.max.z - u.z) * h)) : ((a = (e.max.z - u.z) * h), (s = (e.min.z - u.z) * h)),
  40160. i > s || a > n ? null : ((a > i || i !== i) && (i = a), (s < n || n !== n) && (n = s), n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  40161. )
  40162. },
  40163. intersectsBox: (function () {
  40164. var e = new n.Vector3()
  40165. return function (t) {
  40166. return null !== this.intersectBox(t, e)
  40167. }
  40168. })(),
  40169. intersectTriangle: (function () {
  40170. var e = new n.Vector3(),
  40171. t = new n.Vector3(),
  40172. i = new n.Vector3(),
  40173. r = new n.Vector3()
  40174. return function (n, o, a, s, l) {
  40175. t.subVectors(o, n), i.subVectors(a, n), r.crossVectors(t, i)
  40176. var c,
  40177. h = this.direction.dot(r)
  40178. if (h > 0) {
  40179. if (s) return null
  40180. c = 1
  40181. } else {
  40182. if (!(h < 0)) return null
  40183. ;(c = -1), (h = -h)
  40184. }
  40185. e.subVectors(this.origin, n)
  40186. var u = c * this.direction.dot(i.crossVectors(e, i))
  40187. if (u < 0) return null
  40188. var d = c * this.direction.dot(t.cross(e))
  40189. if (d < 0) return null
  40190. if (u + d > h) return null
  40191. var p = -c * e.dot(r)
  40192. return p < 0 ? null : this.at(p / h, l)
  40193. }
  40194. })(),
  40195. applyMatrix4: function (e) {
  40196. return this.direction.add(this.origin).applyMatrix4(e), this.origin.applyMatrix4(e), this.direction.sub(this.origin), this.direction.normalize(), this
  40197. },
  40198. equals: function (e) {
  40199. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40200. }
  40201. }),
  40202. (n.Sphere = function (e, t) {
  40203. ;(this.center = void 0 !== e ? e : new n.Vector3()), (this.radius = void 0 !== t ? t : 0)
  40204. }),
  40205. (n.Sphere.prototype = {
  40206. constructor: n.Sphere,
  40207. set: function (e, t) {
  40208. return this.center.copy(e), (this.radius = t), this
  40209. },
  40210. setFromPoints: (function () {
  40211. var e = new n.Box3()
  40212. return function (t, i) {
  40213. var n = this.center
  40214. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n)
  40215. for (var r = 0, o = 0, a = t.length; o < a; o++) r = Math.max(r, n.distanceToSquared(t[o]))
  40216. return (this.radius = Math.sqrt(r)), this
  40217. }
  40218. })(),
  40219. clone: function () {
  40220. return new this.constructor().copy(this)
  40221. },
  40222. copy: function (e) {
  40223. return this.center.copy(e.center), (this.radius = e.radius), this
  40224. },
  40225. empty: function () {
  40226. return this.radius <= 0
  40227. },
  40228. containsPoint: function (e) {
  40229. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40230. },
  40231. distanceToPoint: function (e) {
  40232. return e.distanceTo(this.center) - this.radius
  40233. },
  40234. intersectsSphere: function (e) {
  40235. var t = this.radius + e.radius
  40236. return e.center.distanceToSquared(this.center) <= t * t
  40237. },
  40238. intersectsBox: function (e) {
  40239. return e.intersectsSphere(this)
  40240. },
  40241. intersectsPlane: function (e) {
  40242. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40243. },
  40244. clampPoint: function (e, t) {
  40245. var i = this.center.distanceToSquared(e),
  40246. r = t || new n.Vector3()
  40247. return r.copy(e), i > this.radius * this.radius && (r.sub(this.center).normalize(), r.multiplyScalar(this.radius).add(this.center)), r
  40248. },
  40249. getBoundingBox: function (e) {
  40250. var t = e || new n.Box3()
  40251. return t.set(this.center, this.center), t.expandByScalar(this.radius), t
  40252. },
  40253. applyMatrix4: function (e) {
  40254. return this.center.applyMatrix4(e), (this.radius = this.radius * e.getMaxScaleOnAxis()), this
  40255. },
  40256. translate: function (e) {
  40257. return this.center.add(e), this
  40258. },
  40259. equals: function (e) {
  40260. return e.center.equals(this.center) && e.radius === this.radius
  40261. }
  40262. }),
  40263. (n.Frustum = function (e, t, i, r, o, a) {
  40264. this.planes = [
  40265. void 0 !== e ? e : new n.Plane(),
  40266. void 0 !== t ? t : new n.Plane(),
  40267. void 0 !== i ? i : new n.Plane(),
  40268. void 0 !== r ? r : new n.Plane(),
  40269. void 0 !== o ? o : new n.Plane(),
  40270. void 0 !== a ? a : new n.Plane()
  40271. ]
  40272. }),
  40273. (n.Frustum.prototype = {
  40274. constructor: n.Frustum,
  40275. set: function (e, t, i, n, r, o) {
  40276. var a = this.planes
  40277. return a[0].copy(e), a[1].copy(t), a[2].copy(i), a[3].copy(n), a[4].copy(r), a[5].copy(o), this
  40278. },
  40279. clone: function () {
  40280. return new this.constructor().copy(this)
  40281. },
  40282. copy: function (e) {
  40283. for (var t = this.planes, i = 0; i < 6; i++) t[i].copy(e.planes[i])
  40284. return this
  40285. },
  40286. setFromMatrix: function (e) {
  40287. var t = this.planes,
  40288. i = e.elements,
  40289. n = i[0],
  40290. r = i[1],
  40291. o = i[2],
  40292. a = i[3],
  40293. s = i[4],
  40294. l = i[5],
  40295. c = i[6],
  40296. h = i[7],
  40297. u = i[8],
  40298. d = i[9],
  40299. p = i[10],
  40300. f = i[11],
  40301. g = i[12],
  40302. m = i[13],
  40303. v = i[14],
  40304. A = i[15]
  40305. return (
  40306. t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  40307. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  40308. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  40309. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  40310. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  40311. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  40312. this
  40313. )
  40314. },
  40315. intersectsObject: (function () {
  40316. var e = new n.Sphere()
  40317. return function (t) {
  40318. var i = t.geometry
  40319. return null === i.boundingSphere && i.computeBoundingSphere(), e.copy(i.boundingSphere), e.applyMatrix4(t.matrixWorld), this.intersectsSphere(e)
  40320. }
  40321. })(),
  40322. intersectsSphere: function (e) {
  40323. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40324. var o = t[r].distanceToPoint(i)
  40325. if (o < n) return !1
  40326. }
  40327. return !0
  40328. },
  40329. intersectsBox: (function () {
  40330. var e = new n.Vector3(),
  40331. t = new n.Vector3()
  40332. return function (i) {
  40333. for (var n = this.planes, r = 0; r < 6; r++) {
  40334. var o = n[r]
  40335. ;(e.x = o.normal.x > 0 ? i.min.x : i.max.x),
  40336. (t.x = o.normal.x > 0 ? i.max.x : i.min.x),
  40337. (e.y = o.normal.y > 0 ? i.min.y : i.max.y),
  40338. (t.y = o.normal.y > 0 ? i.max.y : i.min.y),
  40339. (e.z = o.normal.z > 0 ? i.min.z : i.max.z),
  40340. (t.z = o.normal.z > 0 ? i.max.z : i.min.z)
  40341. var a = o.distanceToPoint(e),
  40342. s = o.distanceToPoint(t)
  40343. if (a < 0 && s < 0) return !1
  40344. }
  40345. return !0
  40346. }
  40347. })(),
  40348. containsPoint: function (e) {
  40349. for (var t = this.planes, i = 0; i < 6; i++) if (t[i].distanceToPoint(e) < 0) return !1
  40350. return !0
  40351. }
  40352. }),
  40353. (n.Plane = function (e, t) {
  40354. ;(this.normal = void 0 !== e ? e : new n.Vector3(1, 0, 0)), (this.constant = void 0 !== t ? t : 0)
  40355. }),
  40356. (n.Plane.prototype = {
  40357. constructor: n.Plane,
  40358. set: function (e, t) {
  40359. return this.normal.copy(e), (this.constant = t), this
  40360. },
  40361. setComponents: function (e, t, i, n) {
  40362. return this.normal.set(e, t, i), (this.constant = n), this
  40363. },
  40364. setFromNormalAndCoplanarPoint: function (e, t) {
  40365. return this.normal.copy(e), (this.constant = -t.dot(this.normal)), this
  40366. },
  40367. setFromCoplanarPoints: (function () {
  40368. var e = new n.Vector3(),
  40369. t = new n.Vector3()
  40370. return function (i, n, r) {
  40371. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize()
  40372. return this.setFromNormalAndCoplanarPoint(o, i), this
  40373. }
  40374. })(),
  40375. clone: function () {
  40376. return new this.constructor().copy(this)
  40377. },
  40378. copy: function (e) {
  40379. return this.normal.copy(e.normal), (this.constant = e.constant), this
  40380. },
  40381. normalize: function () {
  40382. var e = 1 / this.normal.length()
  40383. return this.normal.multiplyScalar(e), (this.constant *= e), this
  40384. },
  40385. negate: function () {
  40386. return (this.constant *= -1), this.normal.negate(), this
  40387. },
  40388. distanceToPoint: function (e) {
  40389. return this.normal.dot(e) + this.constant
  40390. },
  40391. distanceToSphere: function (e) {
  40392. return this.distanceToPoint(e.center) - e.radius
  40393. },
  40394. projectPoint: function (e, t) {
  40395. return this.orthoPoint(e, t).sub(e).negate()
  40396. },
  40397. orthoPoint: function (e, t) {
  40398. var i = this.distanceToPoint(e),
  40399. r = t || new n.Vector3()
  40400. return r.copy(this.normal).multiplyScalar(i)
  40401. },
  40402. intersectLine: (function () {
  40403. var e = new n.Vector3()
  40404. return function (t, i) {
  40405. var r = i || new n.Vector3(),
  40406. o = t.delta(e),
  40407. a = this.normal.dot(o)
  40408. if (0 !== a) {
  40409. var s = -(t.start.dot(this.normal) + this.constant) / a
  40410. if (!(s < 0 || s > 1)) return r.copy(o).multiplyScalar(s).add(t.start)
  40411. } else if (0 === this.distanceToPoint(t.start)) return r.copy(t.start)
  40412. }
  40413. })(),
  40414. intersectsLine: function (e) {
  40415. var t = this.distanceToPoint(e.start),
  40416. i = this.distanceToPoint(e.end)
  40417. return (t < 0 && i > 0) || (i < 0 && t > 0)
  40418. },
  40419. intersectsBox: function (e) {
  40420. return e.intersectsPlane(this)
  40421. },
  40422. intersectsSphere: function (e) {
  40423. return e.intersectsPlane(this)
  40424. },
  40425. coplanarPoint: function (e) {
  40426. var t = e || new n.Vector3()
  40427. return t.copy(this.normal).multiplyScalar(-this.constant)
  40428. },
  40429. applyMatrix4: (function () {
  40430. var e = new n.Vector3(),
  40431. t = new n.Vector3(),
  40432. i = new n.Matrix3()
  40433. return function (n, r) {
  40434. var o = r || i.getNormalMatrix(n),
  40435. a = e.copy(this.normal).applyMatrix3(o),
  40436. s = this.coplanarPoint(t)
  40437. return s.applyMatrix4(n), this.setFromNormalAndCoplanarPoint(a, s), this
  40438. }
  40439. })(),
  40440. translate: function (e) {
  40441. return (this.constant = this.constant - e.dot(this.normal)), this
  40442. },
  40443. equals: function (e) {
  40444. return e.normal.equals(this.normal) && e.constant === this.constant
  40445. }
  40446. }),
  40447. (n.Spherical = function (e, t, i) {
  40448. return (this.radius = void 0 !== e ? e : 1), (this.phi = void 0 !== t ? t : 0), (this.theta = void 0 !== i ? i : 0), this
  40449. }),
  40450. (n.Spherical.prototype = {
  40451. constructor: n.Spherical,
  40452. set: function (e, t, i) {
  40453. ;(this.radius = e), (this.phi = t), (this.theta = i)
  40454. },
  40455. clone: function () {
  40456. return new this.constructor().copy(this)
  40457. },
  40458. copy: function (e) {
  40459. return this.radius.copy(e.radius), this.phi.copy(e.phi), this.theta.copy(e.theta), this
  40460. },
  40461. makeSafe: function () {
  40462. var e = 1e-6
  40463. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  40464. },
  40465. setFromVector3: function (e) {
  40466. return (
  40467. (this.radius = e.length()),
  40468. 0 === this.radius ? ((this.theta = 0), (this.phi = 0)) : ((this.theta = Math.atan2(e.x, e.z)), (this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1)))),
  40469. this
  40470. )
  40471. }
  40472. }),
  40473. (n.Math = {
  40474. generateUUID: (function () {
  40475. var e,
  40476. t = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''),
  40477. i = new Array(36),
  40478. n = 0
  40479. return function () {
  40480. for (var r = 0; r < 36; r++)
  40481. 8 === r || 13 === r || 18 === r || 23 === r
  40482. ? (i[r] = '-')
  40483. : 14 === r
  40484. ? (i[r] = '4')
  40485. : (n <= 2 && (n = (33554432 + 16777216 * Math.random()) | 0), (e = 15 & n), (n >>= 4), (i[r] = t[19 === r ? (3 & e) | 8 : e]))
  40486. return i.join('')
  40487. }
  40488. })(),
  40489. clamp: function (e, t, i) {
  40490. return Math.max(t, Math.min(i, e))
  40491. },
  40492. euclideanModulo: function (e, t) {
  40493. return ((e % t) + t) % t
  40494. },
  40495. mapLinear: function (e, t, i, n, r) {
  40496. return n + ((e - t) * (r - n)) / (i - t)
  40497. },
  40498. smoothstep: function (e, t, i) {
  40499. return e <= t ? 0 : e >= i ? 1 : ((e = (e - t) / (i - t)), e * e * (3 - 2 * e))
  40500. },
  40501. smootherstep: function (e, t, i) {
  40502. return e <= t ? 0 : e >= i ? 1 : ((e = (e - t) / (i - t)), e * e * e * (e * (6 * e - 15) + 10))
  40503. },
  40504. random16: function () {
  40505. return console.warn('THREE.Math.random16() has been deprecated. Use Math.random() instead.'), Math.random()
  40506. },
  40507. randInt: function (e, t) {
  40508. return e + Math.floor(Math.random() * (t - e + 1))
  40509. },
  40510. randFloat: function (e, t) {
  40511. return e + Math.random() * (t - e)
  40512. },
  40513. randFloatSpread: function (e) {
  40514. return e * (0.5 - Math.random())
  40515. },
  40516. degToRad: (function () {
  40517. var e = Math.PI / 180
  40518. return function (t) {
  40519. return t * e
  40520. }
  40521. })(),
  40522. radToDeg: (function () {
  40523. var e = 180 / Math.PI
  40524. return function (t) {
  40525. return t * e
  40526. }
  40527. })(),
  40528. isPowerOfTwo: function (e) {
  40529. return 0 === (e & (e - 1)) && 0 !== e
  40530. },
  40531. nearestPowerOfTwo: function (e) {
  40532. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40533. },
  40534. nextPowerOfTwo: function (e) {
  40535. return e--, (e |= e >> 1), (e |= e >> 2), (e |= e >> 4), (e |= e >> 8), (e |= e >> 16), e++, e
  40536. }
  40537. }),
  40538. (n.Spline = function (e) {
  40539. function t(e, t, i, n, r, o, a) {
  40540. var s = 0.5 * (i - e),
  40541. l = 0.5 * (n - t)
  40542. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40543. }
  40544. this.points = e
  40545. var i,
  40546. r,
  40547. o,
  40548. a,
  40549. s,
  40550. l,
  40551. c,
  40552. h,
  40553. u,
  40554. d = [],
  40555. p = {
  40556. x: 0,
  40557. y: 0,
  40558. z: 0
  40559. }
  40560. ;(this.initFromArray = function (e) {
  40561. this.points = []
  40562. for (var t = 0; t < e.length; t++)
  40563. this.points[t] = {
  40564. x: e[t][0],
  40565. y: e[t][1],
  40566. z: e[t][2]
  40567. }
  40568. }),
  40569. (this.getPoint = function (e) {
  40570. return (
  40571. (i = (this.points.length - 1) * e),
  40572. (r = Math.floor(i)),
  40573. (o = i - r),
  40574. (d[0] = 0 === r ? r : r - 1),
  40575. (d[1] = r),
  40576. (d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1),
  40577. (d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2),
  40578. (l = this.points[d[0]]),
  40579. (c = this.points[d[1]]),
  40580. (h = this.points[d[2]]),
  40581. (u = this.points[d[3]]),
  40582. (a = o * o),
  40583. (s = o * a),
  40584. (p.x = t(l.x, c.x, h.x, u.x, o, a, s)),
  40585. (p.y = t(l.y, c.y, h.y, u.y, o, a, s)),
  40586. (p.z = t(l.z, c.z, h.z, u.z, o, a, s)),
  40587. p
  40588. )
  40589. }),
  40590. (this.getControlPointsArray = function () {
  40591. var e,
  40592. t,
  40593. i = this.points.length,
  40594. n = []
  40595. for (e = 0; e < i; e++) (t = this.points[e]), (n[e] = [t.x, t.y, t.z])
  40596. return n
  40597. }),
  40598. (this.getLength = function (e) {
  40599. var t,
  40600. i,
  40601. r,
  40602. o,
  40603. a = 0,
  40604. s = 0,
  40605. l = 0,
  40606. c = new n.Vector3(),
  40607. h = new n.Vector3(),
  40608. u = [],
  40609. d = 0
  40610. for (u[0] = 0, e || (e = 100), r = this.points.length * e, c.copy(this.points[0]), t = 1; t < r; t++)
  40611. (i = t / r), (o = this.getPoint(i)), h.copy(o), (d += h.distanceTo(c)), c.copy(o), (a = (this.points.length - 1) * i), (s = Math.floor(a)), s !== l && ((u[s] = d), (l = s))
  40612. return (
  40613. (u[u.length] = d),
  40614. {
  40615. chunks: u,
  40616. total: d
  40617. }
  40618. )
  40619. }),
  40620. (this.reparametrizeByArcLength = function (e) {
  40621. var t,
  40622. i,
  40623. r,
  40624. o,
  40625. a,
  40626. s,
  40627. l,
  40628. c,
  40629. h = [],
  40630. u = new n.Vector3(),
  40631. d = this.getLength()
  40632. for (h.push(u.copy(this.points[0]).clone()), t = 1; t < this.points.length; t++) {
  40633. for (s = d.chunks[t] - d.chunks[t - 1], l = Math.ceil((e * s) / d.total), o = (t - 1) / (this.points.length - 1), a = t / (this.points.length - 1), i = 1; i < l - 1; i++)
  40634. (r = o + i * (1 / l) * (a - o)), (c = this.getPoint(r)), h.push(u.copy(c).clone())
  40635. h.push(u.copy(this.points[t]).clone())
  40636. }
  40637. this.points = h
  40638. })
  40639. }),
  40640. (n.Triangle = function (e, t, i) {
  40641. ;(this.a = void 0 !== e ? e : new n.Vector3()), (this.b = void 0 !== t ? t : new n.Vector3()), (this.c = void 0 !== i ? i : new n.Vector3())
  40642. }),
  40643. (n.Triangle.normal = (function () {
  40644. var e = new n.Vector3()
  40645. return function (t, i, r, o) {
  40646. var a = o || new n.Vector3()
  40647. a.subVectors(r, i), e.subVectors(t, i), a.cross(e)
  40648. var s = a.lengthSq()
  40649. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  40650. }
  40651. })()),
  40652. (n.Triangle.barycoordFromPoint = (function () {
  40653. var e = new n.Vector3(),
  40654. t = new n.Vector3(),
  40655. i = new n.Vector3()
  40656. return function (r, o, a, s, l) {
  40657. e.subVectors(s, o), t.subVectors(a, o), i.subVectors(r, o)
  40658. var c = e.dot(e),
  40659. h = e.dot(t),
  40660. u = e.dot(i),
  40661. d = t.dot(t),
  40662. p = t.dot(i),
  40663. f = c * d - h * h,
  40664. g = l || new n.Vector3()
  40665. if (0 === f) return g.set(-2, -1, -1)
  40666. var m = 1 / f,
  40667. v = (d * u - h * p) * m,
  40668. A = (c * p - h * u) * m
  40669. return g.set(1 - v - A, A, v)
  40670. }
  40671. })()),
  40672. (n.Triangle.containsPoint = (function () {
  40673. var e = new n.Vector3()
  40674. return function (t, i, r, o) {
  40675. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e)
  40676. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  40677. }
  40678. })()),
  40679. (n.Triangle.prototype = {
  40680. constructor: n.Triangle,
  40681. set: function (e, t, i) {
  40682. return this.a.copy(e), this.b.copy(t), this.c.copy(i), this
  40683. },
  40684. setFromPointsAndIndices: function (e, t, i, n) {
  40685. return this.a.copy(e[t]), this.b.copy(e[i]), this.c.copy(e[n]), this
  40686. },
  40687. clone: function () {
  40688. return new this.constructor().copy(this)
  40689. },
  40690. copy: function (e) {
  40691. return this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this
  40692. },
  40693. area: (function () {
  40694. var e = new n.Vector3(),
  40695. t = new n.Vector3()
  40696. return function () {
  40697. return e.subVectors(this.c, this.b), t.subVectors(this.a, this.b), 0.5 * e.cross(t).length()
  40698. }
  40699. })(),
  40700. midpoint: function (e) {
  40701. var t = e || new n.Vector3()
  40702. return t
  40703. .addVectors(this.a, this.b)
  40704. .add(this.c)
  40705. .multiplyScalar(1 / 3)
  40706. },
  40707. normal: function (e) {
  40708. return n.Triangle.normal(this.a, this.b, this.c, e)
  40709. },
  40710. plane: function (e) {
  40711. var t = e || new n.Plane()
  40712. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  40713. },
  40714. barycoordFromPoint: function (e, t) {
  40715. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  40716. },
  40717. containsPoint: function (e) {
  40718. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  40719. },
  40720. equals: function (e) {
  40721. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  40722. }
  40723. }),
  40724. (n.Interpolant = function (e, t, i, n) {
  40725. ;(this.parameterPositions = e), (this._cachedIndex = 0), (this.resultBuffer = void 0 !== n ? n : new t.constructor(i)), (this.sampleValues = t), (this.valueSize = i)
  40726. }),
  40727. (n.Interpolant.prototype = {
  40728. constructor: n.Interpolant,
  40729. evaluate: function (e) {
  40730. var t = this.parameterPositions,
  40731. i = this._cachedIndex,
  40732. n = t[i],
  40733. r = t[i - 1]
  40734. e: {
  40735. t: {
  40736. var o
  40737. i: {
  40738. n: if (!(e < n)) {
  40739. for (var a = i + 2; ; ) {
  40740. if (void 0 === n) {
  40741. if (e < r) break n
  40742. return (i = t.length), (this._cachedIndex = i), this.afterEnd_(i - 1, e, r)
  40743. }
  40744. if (i === a) break
  40745. if (((r = n), (n = t[++i]), e < n)) break t
  40746. }
  40747. o = t.length
  40748. break i
  40749. }
  40750. {
  40751. if (e >= r) break e
  40752. var s = t[1]
  40753. e < s && ((i = 2), (r = s))
  40754. for (var a = i - 2; ; ) {
  40755. if (void 0 === r) return (this._cachedIndex = 0), this.beforeStart_(0, e, n)
  40756. if (i === a) break
  40757. if (((n = r), (r = t[--i - 1]), e >= r)) break t
  40758. }
  40759. ;(o = i), (i = 0)
  40760. }
  40761. }
  40762. for (; i < o; ) {
  40763. var l = (i + o) >>> 1
  40764. e < t[l] ? (o = l) : (i = l + 1)
  40765. }
  40766. if (((n = t[i]), (r = t[i - 1]), void 0 === r)) return (this._cachedIndex = 0), this.beforeStart_(0, e, n)
  40767. if (void 0 === n) return (i = t.length), (this._cachedIndex = i), this.afterEnd_(i - 1, r, e)
  40768. }
  40769. ;(this._cachedIndex = i), this.intervalChanged_(i, r, n)
  40770. }
  40771. return this.interpolate_(i, r, e, n)
  40772. },
  40773. settings: null,
  40774. DefaultSettings_: {},
  40775. getSettings_: function () {
  40776. return this.settings || this.DefaultSettings_
  40777. },
  40778. copySampleValue_: function (e) {
  40779. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o) t[o] = i[r + o]
  40780. return t
  40781. },
  40782. interpolate_: function (e, t, i, n) {
  40783. throw new Error('call to abstract method')
  40784. },
  40785. intervalChanged_: function (e, t, i) {}
  40786. }),
  40787. Object.assign(n.Interpolant.prototype, {
  40788. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  40789. afterEnd_: n.Interpolant.prototype.copySampleValue_
  40790. }),
  40791. (n.CubicInterpolant = function (e, t, i, r) {
  40792. n.Interpolant.call(this, e, t, i, r), (this._weightPrev = -0), (this._offsetPrev = -0), (this._weightNext = -0), (this._offsetNext = -0)
  40793. }),
  40794. (n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  40795. constructor: n.CubicInterpolant,
  40796. DefaultSettings_: {
  40797. endingStart: n.ZeroCurvatureEnding,
  40798. endingEnd: n.ZeroCurvatureEnding
  40799. },
  40800. intervalChanged_: function (e, t, i) {
  40801. var r = this.parameterPositions,
  40802. o = e - 2,
  40803. a = e + 1,
  40804. s = r[o],
  40805. l = r[a]
  40806. if (void 0 === s)
  40807. switch (this.getSettings_().endingStart) {
  40808. case n.ZeroSlopeEnding:
  40809. ;(o = e), (s = 2 * t - i)
  40810. break
  40811. case n.WrapAroundEnding:
  40812. ;(o = r.length - 2), (s = t + r[o] - r[o + 1])
  40813. break
  40814. default:
  40815. ;(o = e), (s = i)
  40816. }
  40817. if (void 0 === l)
  40818. switch (this.getSettings_().endingEnd) {
  40819. case n.ZeroSlopeEnding:
  40820. ;(a = e), (l = 2 * i - t)
  40821. break
  40822. case n.WrapAroundEnding:
  40823. ;(a = 1), (l = i + r[1] - r[0])
  40824. break
  40825. default:
  40826. ;(a = e - 1), (l = t)
  40827. }
  40828. var c = 0.5 * (i - t),
  40829. h = this.valueSize
  40830. ;(this._weightPrev = c / (t - s)), (this._weightNext = c / (l - i)), (this._offsetPrev = o * h), (this._offsetNext = a * h)
  40831. },
  40832. interpolate_: function (e, t, i, n) {
  40833. for (
  40834. var r = this.resultBuffer,
  40835. o = this.sampleValues,
  40836. a = this.valueSize,
  40837. s = e * a,
  40838. l = s - a,
  40839. c = this._offsetPrev,
  40840. h = this._offsetNext,
  40841. u = this._weightPrev,
  40842. d = this._weightNext,
  40843. p = (i - t) / (n - t),
  40844. f = p * p,
  40845. g = f * p,
  40846. m = -u * g + 2 * u * f - u * p,
  40847. v = (1 + u) * g + (-1.5 - 2 * u) * f + (-0.5 + u) * p + 1,
  40848. A = (-1 - d) * g + (1.5 + d) * f + 0.5 * p,
  40849. y = d * g - d * f,
  40850. C = 0;
  40851. C !== a;
  40852. ++C
  40853. )
  40854. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C]
  40855. return r
  40856. }
  40857. })),
  40858. (n.DiscreteInterpolant = function (e, t, i, r) {
  40859. n.Interpolant.call(this, e, t, i, r)
  40860. }),
  40861. (n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  40862. constructor: n.DiscreteInterpolant,
  40863. interpolate_: function (e, t, i, n) {
  40864. return this.copySampleValue_(e - 1)
  40865. }
  40866. })),
  40867. (n.LinearInterpolant = function (e, t, i, r) {
  40868. n.Interpolant.call(this, e, t, i, r)
  40869. }),
  40870. (n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  40871. constructor: n.LinearInterpolant,
  40872. interpolate_: function (e, t, i, n) {
  40873. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = s - a, c = (i - t) / (n - t), h = 1 - c, u = 0; u !== a; ++u) r[u] = o[l + u] * h + o[s + u] * c
  40874. return r
  40875. }
  40876. })),
  40877. (n.QuaternionLinearInterpolant = function (e, t, i, r) {
  40878. n.Interpolant.call(this, e, t, i, r)
  40879. }),
  40880. (n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  40881. constructor: n.QuaternionLinearInterpolant,
  40882. interpolate_: function (e, t, i, r) {
  40883. for (var o = this.resultBuffer, a = this.sampleValues, s = this.valueSize, l = e * s, c = (i - t) / (r - t), h = l + s; l !== h; l += 4) n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c)
  40884. return o
  40885. }
  40886. })),
  40887. (n.Clock = function (e) {
  40888. ;(this.autoStart = void 0 === e || e), (this.startTime = 0), (this.oldTime = 0), (this.elapsedTime = 0), (this.running = !1)
  40889. }),
  40890. (n.Clock.prototype = {
  40891. constructor: n.Clock,
  40892. start: function () {
  40893. ;(this.startTime = performance.now()), (this.oldTime = this.startTime), (this.running = !0)
  40894. },
  40895. stop: function () {
  40896. this.getElapsedTime(), (this.running = !1)
  40897. },
  40898. getElapsedTime: function () {
  40899. return this.getDelta(), this.elapsedTime
  40900. },
  40901. getDelta: function () {
  40902. var e = 0
  40903. if ((this.autoStart && !this.running && this.start(), this.running)) {
  40904. var t = performance.now()
  40905. ;(e = 0.001 * (t - this.oldTime)), (this.oldTime = t), (this.elapsedTime += e)
  40906. }
  40907. return e
  40908. }
  40909. }),
  40910. (n.EventDispatcher = function () {}),
  40911. (n.EventDispatcher.prototype = {
  40912. constructor: n.EventDispatcher,
  40913. apply: function (e) {
  40914. ;(e.addEventListener = n.EventDispatcher.prototype.addEventListener),
  40915. (e.hasEventListener = n.EventDispatcher.prototype.hasEventListener),
  40916. (e.removeEventListener = n.EventDispatcher.prototype.removeEventListener),
  40917. (e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent)
  40918. },
  40919. addEventListener: function (e, t) {
  40920. void 0 === this._listeners && (this._listeners = {})
  40921. var i = this._listeners
  40922. void 0 === i[e] && (i[e] = []), i[e].indexOf(t) === -1 && i[e].push(t)
  40923. },
  40924. hasEventListener: function (e, t) {
  40925. if (void 0 === this._listeners) return !1
  40926. var i = this._listeners
  40927. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  40928. },
  40929. removeEventListener: function (e, t) {
  40930. if (void 0 !== this._listeners) {
  40931. var i = this._listeners,
  40932. n = i[e]
  40933. if (void 0 !== n) {
  40934. var r = n.indexOf(t)
  40935. r !== -1 && n.splice(r, 1)
  40936. }
  40937. }
  40938. },
  40939. dispatchEvent: function (e) {
  40940. if (void 0 !== this._listeners) {
  40941. var t = this._listeners,
  40942. i = t[e.type]
  40943. if (void 0 !== i) {
  40944. e.target = this
  40945. for (var n = [], r = i.length, o = 0; o < r; o++) n[o] = i[o]
  40946. for (var o = 0; o < r; o++) n[o].call(this, e)
  40947. }
  40948. }
  40949. }
  40950. }),
  40951. (n.Layers = function () {
  40952. this.mask = 1
  40953. }),
  40954. (n.Layers.prototype = {
  40955. constructor: n.Layers,
  40956. set: function (e) {
  40957. this.mask = 1 << e
  40958. },
  40959. enable: function (e) {
  40960. this.mask |= 1 << e
  40961. },
  40962. toggle: function (e) {
  40963. this.mask ^= 1 << e
  40964. },
  40965. disable: function (e) {
  40966. this.mask &= ~(1 << e)
  40967. },
  40968. test: function (e) {
  40969. return 0 !== (this.mask & e.mask)
  40970. }
  40971. }),
  40972. (function (e) {
  40973. function t(e, t) {
  40974. return e.distance - t.distance
  40975. }
  40976. function i(e, t, n, r) {
  40977. if (e.visible !== !1 && (e.raycast(t, n), r === !0)) for (var o = e.children, a = 0, s = o.length; a < s; a++) i(o[a], t, n, !0)
  40978. }
  40979. ;(e.Raycaster = function (t, i, n, r) {
  40980. ;(this.ray = new e.Ray(t, i)),
  40981. (this.near = n || 0),
  40982. (this.far = r || 1 / 0),
  40983. (this.params = {
  40984. Mesh: {},
  40985. Line: {},
  40986. LOD: {},
  40987. Points: {
  40988. threshold: 1
  40989. },
  40990. Sprite: {}
  40991. }),
  40992. Object.defineProperties(this.params, {
  40993. PointCloud: {
  40994. get: function () {
  40995. return console.warn('THREE.Raycaster: params.PointCloud has been renamed to params.Points.'), this.Points
  40996. }
  40997. }
  40998. })
  40999. }),
  41000. (e.Raycaster.prototype = {
  41001. constructor: e.Raycaster,
  41002. linePrecision: 1,
  41003. set: function (e, t) {
  41004. this.ray.set(e, t)
  41005. },
  41006. setFromCamera: function (t, i) {
  41007. i instanceof e.PerspectiveCamera
  41008. ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld), this.ray.direction.set(t.x, t.y, 0.5).unproject(i).sub(this.ray.origin).normalize())
  41009. : i instanceof e.OrthographicCamera
  41010. ? (this.ray.origin.set(t.x, t.y, -1).unproject(i), this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld))
  41011. : console.error('THREE.Raycaster: Unsupported camera type.')
  41012. },
  41013. intersectObject: function (e, n) {
  41014. var r = []
  41015. return i(e, this, r, n), r.sort(t), r
  41016. },
  41017. intersectObjects: function (e, n) {
  41018. var r = []
  41019. if (Array.isArray(e) === !1) return console.warn('THREE.Raycaster.intersectObjects: objects is not an Array.'), r
  41020. for (var o = 0, a = e.length; o < a; o++) i(e[o], this, r, n)
  41021. return r.sort(t), r
  41022. }
  41023. })
  41024. })(n),
  41025. (n.Object3D = function () {
  41026. function e() {
  41027. o.setFromEuler(r, !1)
  41028. }
  41029. function t() {
  41030. r.setFromQuaternion(o, void 0, !1)
  41031. }
  41032. Object.defineProperty(this, 'id', {
  41033. value: n.Object3DIdCount++
  41034. }),
  41035. (this.uuid = n.Math.generateUUID()),
  41036. (this.name = ''),
  41037. (this.type = 'Object3D'),
  41038. (this.parent = null),
  41039. (this.children = []),
  41040. (this.up = n.Object3D.DefaultUp.clone())
  41041. var i = new n.Vector3(),
  41042. r = new n.Euler(),
  41043. o = new n.Quaternion(),
  41044. a = new n.Vector3(1, 1, 1)
  41045. r.onChange(e),
  41046. o.onChange(t),
  41047. Object.defineProperties(this, {
  41048. position: {
  41049. enumerable: !0,
  41050. value: i
  41051. },
  41052. rotation: {
  41053. enumerable: !0,
  41054. value: r
  41055. },
  41056. quaternion: {
  41057. enumerable: !0,
  41058. value: o
  41059. },
  41060. scale: {
  41061. enumerable: !0,
  41062. value: a
  41063. },
  41064. modelViewMatrix: {
  41065. value: new n.Matrix4()
  41066. },
  41067. normalMatrix: {
  41068. value: new n.Matrix3()
  41069. }
  41070. }),
  41071. (this.rotationAutoUpdate = !0),
  41072. (this.matrix = new n.Matrix4()),
  41073. (this.matrixWorld = new n.Matrix4()),
  41074. (this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate),
  41075. (this.matrixWorldNeedsUpdate = !1),
  41076. (this.layers = new n.Layers()),
  41077. (this.visible = !0),
  41078. (this.castShadow = !1),
  41079. (this.receiveShadow = !1),
  41080. (this.frustumCulled = !0),
  41081. (this.renderOrder = 0),
  41082. (this.userData = {})
  41083. }),
  41084. (n.Object3D.DefaultUp = new n.Vector3(0, 1, 0)),
  41085. (n.Object3D.DefaultMatrixAutoUpdate = !0),
  41086. (n.Object3D.prototype = {
  41087. constructor: n.Object3D,
  41088. applyMatrix: function (e) {
  41089. this.matrix.multiplyMatrices(e, this.matrix), this.matrix.decompose(this.position, this.quaternion, this.scale)
  41090. },
  41091. setRotationFromAxisAngle: function (e, t) {
  41092. this.quaternion.setFromAxisAngle(e, t)
  41093. },
  41094. setRotationFromEuler: function (e) {
  41095. this.quaternion.setFromEuler(e, !0)
  41096. },
  41097. setRotationFromMatrix: function (e) {
  41098. this.quaternion.setFromRotationMatrix(e)
  41099. },
  41100. setRotationFromQuaternion: function (e) {
  41101. this.quaternion.copy(e)
  41102. },
  41103. rotateOnAxis: (function () {
  41104. var e = new n.Quaternion()
  41105. return function (t, i) {
  41106. return e.setFromAxisAngle(t, i), this.quaternion.multiply(e), this
  41107. }
  41108. })(),
  41109. rotateX: (function () {
  41110. var e = new n.Vector3(1, 0, 0)
  41111. return function (t) {
  41112. return this.rotateOnAxis(e, t)
  41113. }
  41114. })(),
  41115. rotateY: (function () {
  41116. var e = new n.Vector3(0, 1, 0)
  41117. return function (t) {
  41118. return this.rotateOnAxis(e, t)
  41119. }
  41120. })(),
  41121. rotateZ: (function () {
  41122. var e = new n.Vector3(0, 0, 1)
  41123. return function (t) {
  41124. return this.rotateOnAxis(e, t)
  41125. }
  41126. })(),
  41127. translateOnAxis: (function () {
  41128. var e = new n.Vector3()
  41129. return function (t, i) {
  41130. return e.copy(t).applyQuaternion(this.quaternion), this.position.add(e.multiplyScalar(i)), this
  41131. }
  41132. })(),
  41133. translateX: (function () {
  41134. var e = new n.Vector3(1, 0, 0)
  41135. return function (t) {
  41136. return this.translateOnAxis(e, t)
  41137. }
  41138. })(),
  41139. translateY: (function () {
  41140. var e = new n.Vector3(0, 1, 0)
  41141. return function (t) {
  41142. return this.translateOnAxis(e, t)
  41143. }
  41144. })(),
  41145. translateZ: (function () {
  41146. var e = new n.Vector3(0, 0, 1)
  41147. return function (t) {
  41148. return this.translateOnAxis(e, t)
  41149. }
  41150. })(),
  41151. localToWorld: function (e) {
  41152. return e.applyMatrix4(this.matrixWorld)
  41153. },
  41154. worldToLocal: (function () {
  41155. var e = new n.Matrix4()
  41156. return function (t) {
  41157. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  41158. }
  41159. })(),
  41160. lookAt: (function () {
  41161. var e = new n.Matrix4()
  41162. return function (t) {
  41163. e.lookAt(t, this.position, this.up), this.quaternion.setFromRotationMatrix(e)
  41164. }
  41165. })(),
  41166. add: function (e) {
  41167. if (arguments.length > 1) {
  41168. for (var t = 0; t < arguments.length; t++) this.add(arguments[t])
  41169. return this
  41170. }
  41171. return e === this
  41172. ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e), this)
  41173. : (e instanceof n.Object3D
  41174. ? (null !== e.parent && e.parent.remove(e),
  41175. (e.parent = this),
  41176. e.dispatchEvent({
  41177. type: 'added'
  41178. }),
  41179. this.children.push(e))
  41180. : console.error('THREE.Object3D.add: object not an instance of THREE.Object3D.', e),
  41181. this)
  41182. },
  41183. remove: function (e) {
  41184. if (arguments.length > 1) for (var t = 0; t < arguments.length; t++) this.remove(arguments[t])
  41185. var i = this.children.indexOf(e)
  41186. i !== -1 &&
  41187. ((e.parent = null),
  41188. e.dispatchEvent({
  41189. type: 'removed'
  41190. }),
  41191. this.children.splice(i, 1))
  41192. },
  41193. getObjectById: function (e) {
  41194. return this.getObjectByProperty('id', e)
  41195. },
  41196. getObjectByName: function (e) {
  41197. return this.getObjectByProperty('name', e)
  41198. },
  41199. getObjectByProperty: function (e, t) {
  41200. if (this[e] === t) return this
  41201. for (var i = 0, n = this.children.length; i < n; i++) {
  41202. var r = this.children[i],
  41203. o = r.getObjectByProperty(e, t)
  41204. if (void 0 !== o) return o
  41205. }
  41206. },
  41207. getWorldPosition: function (e) {
  41208. var t = e || new n.Vector3()
  41209. return this.updateMatrixWorld(!0), t.setFromMatrixPosition(this.matrixWorld)
  41210. },
  41211. getWorldQuaternion: (function () {
  41212. var e = new n.Vector3(),
  41213. t = new n.Vector3()
  41214. return function (i) {
  41215. var r = i || new n.Quaternion()
  41216. return this.updateMatrixWorld(!0), this.matrixWorld.decompose(e, r, t), r
  41217. }
  41218. })(),
  41219. getWorldRotation: (function () {
  41220. var e = new n.Quaternion()
  41221. return function (t) {
  41222. var i = t || new n.Euler()
  41223. return this.getWorldQuaternion(e), i.setFromQuaternion(e, this.rotation.order, !1)
  41224. }
  41225. })(),
  41226. getWorldScale: (function () {
  41227. var e = new n.Vector3(),
  41228. t = new n.Quaternion()
  41229. return function (i) {
  41230. var r = i || new n.Vector3()
  41231. return this.updateMatrixWorld(!0), this.matrixWorld.decompose(e, t, r), r
  41232. }
  41233. })(),
  41234. getWorldDirection: (function () {
  41235. var e = new n.Quaternion()
  41236. return function (t) {
  41237. var i = t || new n.Vector3()
  41238. return this.getWorldQuaternion(e), i.set(0, 0, 1).applyQuaternion(e)
  41239. }
  41240. })(),
  41241. raycast: function () {},
  41242. traverse: function (e) {
  41243. e(this)
  41244. for (var t = this.children, i = 0, n = t.length; i < n; i++) t[i].traverse(e)
  41245. },
  41246. traverseVisible: function (e) {
  41247. if (this.visible !== !1) {
  41248. e(this)
  41249. for (var t = this.children, i = 0, n = t.length; i < n; i++) t[i].traverseVisible(e)
  41250. }
  41251. },
  41252. traverseAncestors: function (e) {
  41253. var t = this.parent
  41254. null !== t && (e(t), t.traverseAncestors(e))
  41255. },
  41256. updateMatrix: function () {
  41257. this.matrix.compose(this.position, this.quaternion, this.scale), (this.matrixWorldNeedsUpdate = !0)
  41258. },
  41259. updateMatrixWorld: function (e) {
  41260. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  41261. (this.matrixWorldNeedsUpdate !== !0 && e !== !0) ||
  41262. (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix), (this.matrixWorldNeedsUpdate = !1), (e = !0))
  41263. for (var t = 0, i = this.children.length; t < i; t++) this.children[t].updateMatrixWorld(e)
  41264. },
  41265. toJSON: function (e) {
  41266. function t(e) {
  41267. var t = []
  41268. for (var i in e) {
  41269. var n = e[i]
  41270. delete n.metadata, t.push(n)
  41271. }
  41272. return t
  41273. }
  41274. var i = void 0 === e,
  41275. n = {}
  41276. i &&
  41277. ((e = {
  41278. geometries: {},
  41279. materials: {},
  41280. textures: {},
  41281. images: {}
  41282. }),
  41283. (n.metadata = {
  41284. version: 4.4,
  41285. type: 'Object',
  41286. generator: 'Object3D.toJSON'
  41287. }))
  41288. var r = {}
  41289. if (
  41290. ((r.uuid = this.uuid),
  41291. (r.type = this.type),
  41292. '' !== this.name && (r.name = this.name),
  41293. '{}' !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41294. this.castShadow === !0 && (r.castShadow = !0),
  41295. this.receiveShadow === !0 && (r.receiveShadow = !0),
  41296. this.visible === !1 && (r.visible = !1),
  41297. (r.matrix = this.matrix.toArray()),
  41298. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)), (r.geometry = this.geometry.uuid)),
  41299. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)), (r.material = this.material.uuid)),
  41300. this.children.length > 0)
  41301. ) {
  41302. r.children = []
  41303. for (var o = 0; o < this.children.length; o++) r.children.push(this.children[o].toJSON(e).object)
  41304. }
  41305. if (i) {
  41306. var a = t(e.geometries),
  41307. s = t(e.materials),
  41308. l = t(e.textures),
  41309. c = t(e.images)
  41310. a.length > 0 && (n.geometries = a), s.length > 0 && (n.materials = s), l.length > 0 && (n.textures = l), c.length > 0 && (n.images = c)
  41311. }
  41312. return (n.object = r), n
  41313. },
  41314. clone: function (e) {
  41315. return new this.constructor().copy(this, e)
  41316. },
  41317. copy: function (e, t) {
  41318. if (
  41319. (void 0 === t && (t = !0),
  41320. (this.name = e.name),
  41321. this.up.copy(e.up),
  41322. this.position.copy(e.position),
  41323. this.quaternion.copy(e.quaternion),
  41324. this.scale.copy(e.scale),
  41325. (this.rotationAutoUpdate = e.rotationAutoUpdate),
  41326. this.matrix.copy(e.matrix),
  41327. this.matrixWorld.copy(e.matrixWorld),
  41328. (this.matrixAutoUpdate = e.matrixAutoUpdate),
  41329. (this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate),
  41330. (this.visible = e.visible),
  41331. (this.castShadow = e.castShadow),
  41332. (this.receiveShadow = e.receiveShadow),
  41333. (this.frustumCulled = e.frustumCulled),
  41334. (this.renderOrder = e.renderOrder),
  41335. (this.userData = JSON.parse(JSON.stringify(e.userData))),
  41336. t === !0)
  41337. )
  41338. for (var i = 0; i < e.children.length; i++) {
  41339. var n = e.children[i]
  41340. this.add(n.clone())
  41341. }
  41342. return this
  41343. }
  41344. }),
  41345. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  41346. (n.Object3DIdCount = 0),
  41347. (n.Face3 = function (e, t, i, r, o, a) {
  41348. ;(this.a = e),
  41349. (this.b = t),
  41350. (this.c = i),
  41351. (this.normal = r instanceof n.Vector3 ? r : new n.Vector3()),
  41352. (this.vertexNormals = Array.isArray(r) ? r : []),
  41353. (this.color = o instanceof n.Color ? o : new n.Color()),
  41354. (this.vertexColors = Array.isArray(o) ? o : []),
  41355. (this.materialIndex = void 0 !== a ? a : 0)
  41356. }),
  41357. (n.Face3.prototype = {
  41358. constructor: n.Face3,
  41359. clone: function () {
  41360. return new this.constructor().copy(this)
  41361. },
  41362. copy: function (e) {
  41363. ;(this.a = e.a), (this.b = e.b), (this.c = e.c), this.normal.copy(e.normal), this.color.copy(e.color), (this.materialIndex = e.materialIndex)
  41364. for (var t = 0, i = e.vertexNormals.length; t < i; t++) this.vertexNormals[t] = e.vertexNormals[t].clone()
  41365. for (var t = 0, i = e.vertexColors.length; t < i; t++) this.vertexColors[t] = e.vertexColors[t].clone()
  41366. return this
  41367. }
  41368. }),
  41369. (n.BufferAttribute = function (e, t) {
  41370. ;(this.uuid = n.Math.generateUUID()),
  41371. (this.array = e),
  41372. (this.itemSize = t),
  41373. (this.dynamic = !1),
  41374. (this.updateRange = {
  41375. offset: 0,
  41376. count: -1
  41377. }),
  41378. (this.version = 0)
  41379. }),
  41380. (n.BufferAttribute.prototype = {
  41381. constructor: n.BufferAttribute,
  41382. get count() {
  41383. return this.array.length / this.itemSize
  41384. },
  41385. set needsUpdate(e) {
  41386. e === !0 && this.version++
  41387. },
  41388. setDynamic: function (e) {
  41389. return (this.dynamic = e), this
  41390. },
  41391. copy: function (e) {
  41392. return (this.array = new e.array.constructor(e.array)), (this.itemSize = e.itemSize), (this.dynamic = e.dynamic), this
  41393. },
  41394. copyAt: function (e, t, i) {
  41395. ;(e *= this.itemSize), (i *= t.itemSize)
  41396. for (var n = 0, r = this.itemSize; n < r; n++) this.array[e + n] = t.array[i + n]
  41397. return this
  41398. },
  41399. copyArray: function (e) {
  41400. return this.array.set(e), this
  41401. },
  41402. copyColorsArray: function (e) {
  41403. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41404. var a = e[r]
  41405. void 0 === a && (console.warn('THREE.BufferAttribute.copyColorsArray(): color is undefined', r), (a = new n.Color())), (t[i++] = a.r), (t[i++] = a.g), (t[i++] = a.b)
  41406. }
  41407. return this
  41408. },
  41409. copyIndicesArray: function (e) {
  41410. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41411. var o = e[n]
  41412. ;(t[i++] = o.a), (t[i++] = o.b), (t[i++] = o.c)
  41413. }
  41414. return this
  41415. },
  41416. copyVector2sArray: function (e) {
  41417. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41418. var a = e[r]
  41419. void 0 === a && (console.warn('THREE.BufferAttribute.copyVector2sArray(): vector is undefined', r), (a = new n.Vector2())), (t[i++] = a.x), (t[i++] = a.y)
  41420. }
  41421. return this
  41422. },
  41423. copyVector3sArray: function (e) {
  41424. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41425. var a = e[r]
  41426. void 0 === a && (console.warn('THREE.BufferAttribute.copyVector3sArray(): vector is undefined', r), (a = new n.Vector3())), (t[i++] = a.x), (t[i++] = a.y), (t[i++] = a.z)
  41427. }
  41428. return this
  41429. },
  41430. copyVector4sArray: function (e) {
  41431. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41432. var a = e[r]
  41433. void 0 === a && (console.warn('THREE.BufferAttribute.copyVector4sArray(): vector is undefined', r), (a = new n.Vector4())),
  41434. (t[i++] = a.x),
  41435. (t[i++] = a.y),
  41436. (t[i++] = a.z),
  41437. (t[i++] = a.w)
  41438. }
  41439. return this
  41440. },
  41441. set: function (e, t) {
  41442. return void 0 === t && (t = 0), this.array.set(e, t), this
  41443. },
  41444. getX: function (e) {
  41445. return this.array[e * this.itemSize]
  41446. },
  41447. setX: function (e, t) {
  41448. return (this.array[e * this.itemSize] = t), this
  41449. },
  41450. getY: function (e) {
  41451. return this.array[e * this.itemSize + 1]
  41452. },
  41453. setY: function (e, t) {
  41454. return (this.array[e * this.itemSize + 1] = t), this
  41455. },
  41456. getZ: function (e) {
  41457. return this.array[e * this.itemSize + 2]
  41458. },
  41459. setZ: function (e, t) {
  41460. return (this.array[e * this.itemSize + 2] = t), this
  41461. },
  41462. getW: function (e) {
  41463. return this.array[e * this.itemSize + 3]
  41464. },
  41465. setW: function (e, t) {
  41466. return (this.array[e * this.itemSize + 3] = t), this
  41467. },
  41468. setXY: function (e, t, i) {
  41469. return (e *= this.itemSize), (this.array[e + 0] = t), (this.array[e + 1] = i), this
  41470. },
  41471. setXYZ: function (e, t, i, n) {
  41472. return (e *= this.itemSize), (this.array[e + 0] = t), (this.array[e + 1] = i), (this.array[e + 2] = n), this
  41473. },
  41474. setXYZW: function (e, t, i, n, r) {
  41475. return (e *= this.itemSize), (this.array[e + 0] = t), (this.array[e + 1] = i), (this.array[e + 2] = n), (this.array[e + 3] = r), this
  41476. },
  41477. clone: function () {
  41478. return new this.constructor().copy(this)
  41479. }
  41480. }),
  41481. (n.Int8Attribute = function (e, t) {
  41482. return new n.BufferAttribute(new Int8Array(e), t)
  41483. }),
  41484. (n.Uint8Attribute = function (e, t) {
  41485. return new n.BufferAttribute(new Uint8Array(e), t)
  41486. }),
  41487. (n.Uint8ClampedAttribute = function (e, t) {
  41488. return new n.BufferAttribute(new Uint8ClampedArray(e), t)
  41489. }),
  41490. (n.Int16Attribute = function (e, t) {
  41491. return new n.BufferAttribute(new Int16Array(e), t)
  41492. }),
  41493. (n.Uint16Attribute = function (e, t) {
  41494. return new n.BufferAttribute(new Uint16Array(e), t)
  41495. })
  41496. n.Int32Attribute = function (e, t) {
  41497. return new n.BufferAttribute(new Int32Array(e), t)
  41498. }
  41499. ;(n.Uint32Attribute = function (e, t) {
  41500. return new n.BufferAttribute(new Uint32Array(e), t)
  41501. }),
  41502. (n.Float32Attribute = function (e, t) {
  41503. return new n.BufferAttribute(new Float32Array(e), t)
  41504. }),
  41505. (n.Float64Attribute = function (e, t) {
  41506. return new n.BufferAttribute(new Float64Array(e), t)
  41507. }),
  41508. (n.DynamicBufferAttribute = function (e, t) {
  41509. return console.warn('THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.'), new n.BufferAttribute(e, t).setDynamic(!0)
  41510. }),
  41511. (n.InstancedBufferAttribute = function (e, t, i) {
  41512. n.BufferAttribute.call(this, e, t), (this.meshPerAttribute = i || 1)
  41513. }),
  41514. (n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype)),
  41515. (n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute),
  41516. (n.InstancedBufferAttribute.prototype.copy = function (e) {
  41517. return n.BufferAttribute.prototype.copy.call(this, e), (this.meshPerAttribute = e.meshPerAttribute), this
  41518. }),
  41519. (n.InterleavedBuffer = function (e, t) {
  41520. ;(this.uuid = n.Math.generateUUID()),
  41521. (this.array = e),
  41522. (this.stride = t),
  41523. (this.dynamic = !1),
  41524. (this.updateRange = {
  41525. offset: 0,
  41526. count: -1
  41527. }),
  41528. (this.version = 0)
  41529. }),
  41530. (n.InterleavedBuffer.prototype = {
  41531. constructor: n.InterleavedBuffer,
  41532. get length() {
  41533. return this.array.length
  41534. },
  41535. get count() {
  41536. return this.array.length / this.stride
  41537. },
  41538. set needsUpdate(e) {
  41539. e === !0 && this.version++
  41540. },
  41541. setDynamic: function (e) {
  41542. return (this.dynamic = e), this
  41543. },
  41544. copy: function (e) {
  41545. return (this.array = new e.array.constructor(e.array)), (this.stride = e.stride), (this.dynamic = e.dynamic), this
  41546. },
  41547. copyAt: function (e, t, i) {
  41548. ;(e *= this.stride), (i *= t.stride)
  41549. for (var n = 0, r = this.stride; n < r; n++) this.array[e + n] = t.array[i + n]
  41550. return this
  41551. },
  41552. set: function (e, t) {
  41553. return void 0 === t && (t = 0), this.array.set(e, t), this
  41554. },
  41555. clone: function () {
  41556. return new this.constructor().copy(this)
  41557. }
  41558. }),
  41559. (n.InstancedInterleavedBuffer = function (e, t, i) {
  41560. n.InterleavedBuffer.call(this, e, t), (this.meshPerAttribute = i || 1)
  41561. }),
  41562. (n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype)),
  41563. (n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer),
  41564. (n.InstancedInterleavedBuffer.prototype.copy = function (e) {
  41565. return n.InterleavedBuffer.prototype.copy.call(this, e), (this.meshPerAttribute = e.meshPerAttribute), this
  41566. }),
  41567. (n.InterleavedBufferAttribute = function (e, t, i) {
  41568. ;(this.uuid = n.Math.generateUUID()), (this.data = e), (this.itemSize = t), (this.offset = i)
  41569. }),
  41570. (n.InterleavedBufferAttribute.prototype = {
  41571. constructor: n.InterleavedBufferAttribute,
  41572. get length() {
  41573. return console.warn('THREE.BufferAttribute: .length has been deprecated. Please use .count.'), this.array.length
  41574. },
  41575. get count() {
  41576. return this.data.count
  41577. },
  41578. setX: function (e, t) {
  41579. return (this.data.array[e * this.data.stride + this.offset] = t), this
  41580. },
  41581. setY: function (e, t) {
  41582. return (this.data.array[e * this.data.stride + this.offset + 1] = t), this
  41583. },
  41584. setZ: function (e, t) {
  41585. return (this.data.array[e * this.data.stride + this.offset + 2] = t), this
  41586. },
  41587. setW: function (e, t) {
  41588. return (this.data.array[e * this.data.stride + this.offset + 3] = t), this
  41589. },
  41590. getX: function (e) {
  41591. return this.data.array[e * this.data.stride + this.offset]
  41592. },
  41593. getY: function (e) {
  41594. return this.data.array[e * this.data.stride + this.offset + 1]
  41595. },
  41596. getZ: function (e) {
  41597. return this.data.array[e * this.data.stride + this.offset + 2]
  41598. },
  41599. getW: function (e) {
  41600. return this.data.array[e * this.data.stride + this.offset + 3]
  41601. },
  41602. setXY: function (e, t, i) {
  41603. return (e = e * this.data.stride + this.offset), (this.data.array[e + 0] = t), (this.data.array[e + 1] = i), this
  41604. },
  41605. setXYZ: function (e, t, i, n) {
  41606. return (e = e * this.data.stride + this.offset), (this.data.array[e + 0] = t), (this.data.array[e + 1] = i), (this.data.array[e + 2] = n), this
  41607. },
  41608. setXYZW: function (e, t, i, n, r) {
  41609. return (e = e * this.data.stride + this.offset), (this.data.array[e + 0] = t), (this.data.array[e + 1] = i), (this.data.array[e + 2] = n), (this.data.array[e + 3] = r), this
  41610. }
  41611. }),
  41612. (n.Geometry = function () {
  41613. Object.defineProperty(this, 'id', {
  41614. value: n.GeometryIdCount++
  41615. }),
  41616. (this.uuid = n.Math.generateUUID()),
  41617. (this.name = ''),
  41618. (this.type = 'Geometry'),
  41619. (this.vertices = []),
  41620. (this.colors = []),
  41621. (this.faces = []),
  41622. (this.faceVertexUvs = [[]]),
  41623. (this.morphTargets = []),
  41624. (this.morphNormals = []),
  41625. (this.skinWeights = []),
  41626. (this.skinIndices = []),
  41627. (this.lineDistances = []),
  41628. (this.boundingBox = null),
  41629. (this.boundingSphere = null),
  41630. (this.verticesNeedUpdate = !1),
  41631. (this.elementsNeedUpdate = !1),
  41632. (this.uvsNeedUpdate = !1),
  41633. (this.normalsNeedUpdate = !1),
  41634. (this.colorsNeedUpdate = !1),
  41635. (this.lineDistancesNeedUpdate = !1),
  41636. (this.groupsNeedUpdate = !1)
  41637. }),
  41638. (n.Geometry.prototype = {
  41639. constructor: n.Geometry,
  41640. applyMatrix: function (e) {
  41641. for (var t = new n.Matrix3().getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  41642. var o = this.vertices[i]
  41643. o.applyMatrix4(e)
  41644. }
  41645. for (var i = 0, r = this.faces.length; i < r; i++) {
  41646. var a = this.faces[i]
  41647. a.normal.applyMatrix3(t).normalize()
  41648. for (var s = 0, l = a.vertexNormals.length; s < l; s++) a.vertexNormals[s].applyMatrix3(t).normalize()
  41649. }
  41650. return (
  41651. null !== this.boundingBox && this.computeBoundingBox(),
  41652. null !== this.boundingSphere && this.computeBoundingSphere(),
  41653. (this.verticesNeedUpdate = !0),
  41654. (this.normalsNeedUpdate = !0),
  41655. this
  41656. )
  41657. },
  41658. rotateX: (function () {
  41659. var e
  41660. return function (t) {
  41661. return void 0 === e && (e = new n.Matrix4()), e.makeRotationX(t), this.applyMatrix(e), this
  41662. }
  41663. })(),
  41664. rotateY: (function () {
  41665. var e
  41666. return function (t) {
  41667. return void 0 === e && (e = new n.Matrix4()), e.makeRotationY(t), this.applyMatrix(e), this
  41668. }
  41669. })(),
  41670. rotateZ: (function () {
  41671. var e
  41672. return function (t) {
  41673. return void 0 === e && (e = new n.Matrix4()), e.makeRotationZ(t), this.applyMatrix(e), this
  41674. }
  41675. })(),
  41676. translate: (function () {
  41677. var e
  41678. return function (t, i, r) {
  41679. return void 0 === e && (e = new n.Matrix4()), e.makeTranslation(t, i, r), this.applyMatrix(e), this
  41680. }
  41681. })(),
  41682. scale: (function () {
  41683. var e
  41684. return function (t, i, r) {
  41685. return void 0 === e && (e = new n.Matrix4()), e.makeScale(t, i, r), this.applyMatrix(e), this
  41686. }
  41687. })(),
  41688. lookAt: (function () {
  41689. var e
  41690. return function (t) {
  41691. void 0 === e && (e = new n.Object3D()), e.lookAt(t), e.updateMatrix(), this.applyMatrix(e.matrix)
  41692. }
  41693. })(),
  41694. fromBufferGeometry: function (e) {
  41695. function t(e, t, r, o) {
  41696. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : [],
  41697. f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : [],
  41698. g = new n.Face3(e, t, r, a, f, o)
  41699. i.faces.push(g),
  41700. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  41701. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  41702. }
  41703. var i = this,
  41704. r = null !== e.index ? e.index.array : void 0,
  41705. o = e.attributes,
  41706. a = o.position.array,
  41707. s = void 0 !== o.normal ? o.normal.array : void 0,
  41708. l = void 0 !== o.color ? o.color.array : void 0,
  41709. c = void 0 !== o.uv ? o.uv.array : void 0,
  41710. h = void 0 !== o.uv2 ? o.uv2.array : void 0
  41711. void 0 !== h && (this.faceVertexUvs[1] = [])
  41712. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3, g += 2)
  41713. i.vertices.push(new n.Vector3(a[f], a[f + 1], a[f + 2])),
  41714. void 0 !== s && u.push(new n.Vector3(s[f], s[f + 1], s[f + 2])),
  41715. void 0 !== l && i.colors.push(new n.Color(l[f], l[f + 1], l[f + 2])),
  41716. void 0 !== c && d.push(new n.Vector2(c[g], c[g + 1])),
  41717. void 0 !== h && p.push(new n.Vector2(h[g], h[g + 1]))
  41718. if (void 0 !== r) {
  41719. var m = e.groups
  41720. if (m.length > 0) for (var f = 0; f < m.length; f++) for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3) t(r[g], r[g + 1], r[g + 2], v.materialIndex)
  41721. else for (var f = 0; f < r.length; f += 3) t(r[f], r[f + 1], r[f + 2])
  41722. } else for (var f = 0; f < a.length / 3; f += 3) t(f, f + 1, f + 2)
  41723. return (
  41724. this.computeFaceNormals(), null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()), null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()), this
  41725. )
  41726. },
  41727. center: function () {
  41728. this.computeBoundingBox()
  41729. var e = this.boundingBox.center().negate()
  41730. return this.translate(e.x, e.y, e.z), e
  41731. },
  41732. normalize: function () {
  41733. this.computeBoundingSphere()
  41734. var e = this.boundingSphere.center,
  41735. t = this.boundingSphere.radius,
  41736. i = 0 === t ? 1 : 1 / t,
  41737. r = new n.Matrix4()
  41738. return r.set(i, 0, 0, -i * e.x, 0, i, 0, -i * e.y, 0, 0, i, -i * e.z, 0, 0, 0, 1), this.applyMatrix(r), this
  41739. },
  41740. computeFaceNormals: function () {
  41741. for (var e = new n.Vector3(), t = new n.Vector3(), i = 0, r = this.faces.length; i < r; i++) {
  41742. var o = this.faces[i],
  41743. a = this.vertices[o.a],
  41744. s = this.vertices[o.b],
  41745. l = this.vertices[o.c]
  41746. e.subVectors(l, s), t.subVectors(a, s), e.cross(t), e.normalize(), o.normal.copy(e)
  41747. }
  41748. },
  41749. computeVertexNormals: function (e) {
  41750. void 0 === e && (e = !0)
  41751. var t, i, r, o, a, s
  41752. for (s = new Array(this.vertices.length), t = 0, i = this.vertices.length; t < i; t++) s[t] = new n.Vector3()
  41753. if (e) {
  41754. var l,
  41755. c,
  41756. h,
  41757. u = new n.Vector3(),
  41758. d = new n.Vector3()
  41759. for (r = 0, o = this.faces.length; r < o; r++)
  41760. (a = this.faces[r]),
  41761. (l = this.vertices[a.a]),
  41762. (c = this.vertices[a.b]),
  41763. (h = this.vertices[a.c]),
  41764. u.subVectors(h, c),
  41765. d.subVectors(l, c),
  41766. u.cross(d),
  41767. s[a.a].add(u),
  41768. s[a.b].add(u),
  41769. s[a.c].add(u)
  41770. } else for (r = 0, o = this.faces.length; r < o; r++) (a = this.faces[r]), s[a.a].add(a.normal), s[a.b].add(a.normal), s[a.c].add(a.normal)
  41771. for (t = 0, i = this.vertices.length; t < i; t++) s[t].normalize()
  41772. for (r = 0, o = this.faces.length; r < o; r++) {
  41773. a = this.faces[r]
  41774. var p = a.vertexNormals
  41775. 3 === p.length ? (p[0].copy(s[a.a]), p[1].copy(s[a.b]), p[2].copy(s[a.c])) : ((p[0] = s[a.a].clone()), (p[1] = s[a.b].clone()), (p[2] = s[a.c].clone()))
  41776. }
  41777. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  41778. },
  41779. computeMorphNormals: function () {
  41780. var e, t, i, r, o
  41781. for (i = 0, r = this.faces.length; i < r; i++)
  41782. for (
  41783. o = this.faces[i],
  41784. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : (o.__originalFaceNormal = o.normal.clone()),
  41785. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  41786. e = 0,
  41787. t = o.vertexNormals.length;
  41788. e < t;
  41789. e++
  41790. )
  41791. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : (o.__originalVertexNormals[e] = o.vertexNormals[e].clone())
  41792. var a = new n.Geometry()
  41793. for (a.faces = this.faces, e = 0, t = this.morphTargets.length; e < t; e++) {
  41794. if (!this.morphNormals[e]) {
  41795. ;(this.morphNormals[e] = {}), (this.morphNormals[e].faceNormals = []), (this.morphNormals[e].vertexNormals = [])
  41796. var s,
  41797. l,
  41798. c = this.morphNormals[e].faceNormals,
  41799. h = this.morphNormals[e].vertexNormals
  41800. for (i = 0, r = this.faces.length; i < r; i++)
  41801. (s = new n.Vector3()),
  41802. (l = {
  41803. a: new n.Vector3(),
  41804. b: new n.Vector3(),
  41805. c: new n.Vector3()
  41806. }),
  41807. c.push(s),
  41808. h.push(l)
  41809. }
  41810. var u = this.morphNormals[e]
  41811. ;(a.vertices = this.morphTargets[e].vertices), a.computeFaceNormals(), a.computeVertexNormals()
  41812. var s, l
  41813. for (i = 0, r = this.faces.length; i < r; i++)
  41814. (o = this.faces[i]), (s = u.faceNormals[i]), (l = u.vertexNormals[i]), s.copy(o.normal), l.a.copy(o.vertexNormals[0]), l.b.copy(o.vertexNormals[1]), l.c.copy(o.vertexNormals[2])
  41815. }
  41816. for (i = 0, r = this.faces.length; i < r; i++) (o = this.faces[i]), (o.normal = o.__originalFaceNormal), (o.vertexNormals = o.__originalVertexNormals)
  41817. },
  41818. computeTangents: function () {
  41819. console.warn('THREE.Geometry: .computeTangents() has been removed.')
  41820. },
  41821. computeLineDistances: function () {
  41822. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++) i > 0 && (e += t[i].distanceTo(t[i - 1])), (this.lineDistances[i] = e)
  41823. },
  41824. computeBoundingBox: function () {
  41825. null === this.boundingBox && (this.boundingBox = new n.Box3()), this.boundingBox.setFromPoints(this.vertices)
  41826. },
  41827. computeBoundingSphere: function () {
  41828. null === this.boundingSphere && (this.boundingSphere = new n.Sphere()), this.boundingSphere.setFromPoints(this.vertices)
  41829. },
  41830. merge: function (e, t, i) {
  41831. if (e instanceof n.Geometry == !1) return void console.error('THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.', e)
  41832. var r,
  41833. o = this.vertices.length,
  41834. a = this.vertices,
  41835. s = e.vertices,
  41836. l = this.faces,
  41837. c = e.faces,
  41838. h = this.faceVertexUvs[0],
  41839. u = e.faceVertexUvs[0]
  41840. void 0 === i && (i = 0), void 0 !== t && (r = new n.Matrix3().getNormalMatrix(t))
  41841. for (var d = 0, p = s.length; d < p; d++) {
  41842. var f = s[d],
  41843. g = f.clone()
  41844. void 0 !== t && g.applyMatrix4(t), a.push(g)
  41845. }
  41846. for (d = 0, p = c.length; d < p; d++) {
  41847. var m,
  41848. v,
  41849. A,
  41850. y = c[d],
  41851. C = y.vertexNormals,
  41852. I = y.vertexColors
  41853. ;(m = new n.Face3(y.a + o, y.b + o, y.c + o)), m.normal.copy(y.normal), void 0 !== r && m.normal.applyMatrix3(r).normalize()
  41854. for (var E = 0, b = C.length; E < b; E++) (v = C[E].clone()), void 0 !== r && v.applyMatrix3(r).normalize(), m.vertexNormals.push(v)
  41855. m.color.copy(y.color)
  41856. for (var E = 0, b = I.length; E < b; E++) (A = I[E]), m.vertexColors.push(A.clone())
  41857. ;(m.materialIndex = y.materialIndex + i), l.push(m)
  41858. }
  41859. for (d = 0, p = u.length; d < p; d++) {
  41860. var w = u[d],
  41861. _ = []
  41862. if (void 0 !== w) {
  41863. for (var E = 0, b = w.length; E < b; E++) _.push(w[E].clone())
  41864. h.push(_)
  41865. }
  41866. }
  41867. },
  41868. mergeMesh: function (e) {
  41869. return e instanceof n.Mesh == !1
  41870. ? void console.error('THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.', e)
  41871. : (e.matrixAutoUpdate && e.updateMatrix(), void this.merge(e.geometry, e.matrix))
  41872. },
  41873. mergeVertices: function () {
  41874. var e,
  41875. t,
  41876. i,
  41877. n,
  41878. r,
  41879. o,
  41880. a,
  41881. s,
  41882. l = {},
  41883. c = [],
  41884. h = [],
  41885. u = 4,
  41886. d = Math.pow(10, u)
  41887. for (i = 0, n = this.vertices.length; i < n; i++)
  41888. (e = this.vertices[i]),
  41889. (t = Math.round(e.x * d) + '_' + Math.round(e.y * d) + '_' + Math.round(e.z * d)),
  41890. void 0 === l[t] ? ((l[t] = i), c.push(this.vertices[i]), (h[i] = c.length - 1)) : (h[i] = h[l[t]])
  41891. var p = []
  41892. for (i = 0, n = this.faces.length; i < n; i++) {
  41893. ;(r = this.faces[i]), (r.a = h[r.a]), (r.b = h[r.b]), (r.c = h[r.c]), (o = [r.a, r.b, r.c])
  41894. for (var f = -1, g = 0; g < 3; g++)
  41895. if (o[g] === o[(g + 1) % 3]) {
  41896. ;(f = g), p.push(i)
  41897. break
  41898. }
  41899. }
  41900. for (i = p.length - 1; i >= 0; i--) {
  41901. var m = p[i]
  41902. for (this.faces.splice(m, 1), a = 0, s = this.faceVertexUvs.length; a < s; a++) this.faceVertexUvs[a].splice(m, 1)
  41903. }
  41904. var v = this.vertices.length - c.length
  41905. return (this.vertices = c), v
  41906. },
  41907. sortFacesByMaterialIndex: function () {
  41908. function e(e, t) {
  41909. return e.materialIndex - t.materialIndex
  41910. }
  41911. for (var t = this.faces, i = t.length, n = 0; n < i; n++) t[n]._id = n
  41912. t.sort(e)
  41913. var r,
  41914. o,
  41915. a = this.faceVertexUvs[0],
  41916. s = this.faceVertexUvs[1]
  41917. a && a.length === i && (r = []), s && s.length === i && (o = [])
  41918. for (var n = 0; n < i; n++) {
  41919. var l = t[n]._id
  41920. r && r.push(a[l]), o && o.push(s[l])
  41921. }
  41922. r && (this.faceVertexUvs[0] = r), o && (this.faceVertexUvs[1] = o)
  41923. },
  41924. toJSON: function () {
  41925. function e(e, t, i) {
  41926. return i ? e | (1 << t) : e & ~(1 << t)
  41927. }
  41928. function t(e) {
  41929. var t = e.x.toString() + e.y.toString() + e.z.toString()
  41930. return void 0 !== d[t] ? d[t] : ((d[t] = u.length / 3), u.push(e.x, e.y, e.z), d[t])
  41931. }
  41932. function i(e) {
  41933. var t = e.r.toString() + e.g.toString() + e.b.toString()
  41934. return void 0 !== f[t] ? f[t] : ((f[t] = p.length), p.push(e.getHex()), f[t])
  41935. }
  41936. function n(e) {
  41937. var t = e.x.toString() + e.y.toString()
  41938. return void 0 !== m[t] ? m[t] : ((m[t] = g.length / 2), g.push(e.x, e.y), m[t])
  41939. }
  41940. var r = {
  41941. metadata: {
  41942. version: 4.4,
  41943. type: 'Geometry',
  41944. generator: 'Geometry.toJSON'
  41945. }
  41946. }
  41947. if (((r.uuid = this.uuid), (r.type = this.type), '' !== this.name && (r.name = this.name), void 0 !== this.parameters)) {
  41948. var o = this.parameters
  41949. for (var a in o) void 0 !== o[a] && (r[a] = o[a])
  41950. return r
  41951. }
  41952. for (var s = [], l = 0; l < this.vertices.length; l++) {
  41953. var c = this.vertices[l]
  41954. s.push(c.x, c.y, c.z)
  41955. }
  41956. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  41957. var v = this.faces[l],
  41958. A = !0,
  41959. y = !1,
  41960. C = void 0 !== this.faceVertexUvs[0][l],
  41961. I = v.normal.length() > 0,
  41962. E = v.vertexNormals.length > 0,
  41963. b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b,
  41964. w = v.vertexColors.length > 0,
  41965. _ = 0
  41966. if (
  41967. ((_ = e(_, 0, 0)),
  41968. (_ = e(_, 1, A)),
  41969. (_ = e(_, 2, y)),
  41970. (_ = e(_, 3, C)),
  41971. (_ = e(_, 4, I)),
  41972. (_ = e(_, 5, E)),
  41973. (_ = e(_, 6, b)),
  41974. (_ = e(_, 7, w)),
  41975. h.push(_),
  41976. h.push(v.a, v.b, v.c),
  41977. h.push(v.materialIndex),
  41978. C)
  41979. ) {
  41980. var T = this.faceVertexUvs[0][l]
  41981. h.push(n(T[0]), n(T[1]), n(T[2]))
  41982. }
  41983. if ((I && h.push(t(v.normal)), E)) {
  41984. var x = v.vertexNormals
  41985. h.push(t(x[0]), t(x[1]), t(x[2]))
  41986. }
  41987. if ((b && h.push(i(v.color)), w)) {
  41988. var S = v.vertexColors
  41989. h.push(i(S[0]), i(S[1]), i(S[2]))
  41990. }
  41991. }
  41992. return (r.data = {}), (r.data.vertices = s), (r.data.normals = u), p.length > 0 && (r.data.colors = p), g.length > 0 && (r.data.uvs = [g]), (r.data.faces = h), r
  41993. },
  41994. clone: function () {
  41995. return new n.Geometry().copy(this)
  41996. },
  41997. copy: function (e) {
  41998. ;(this.vertices = []), (this.faces = []), (this.faceVertexUvs = [[]])
  41999. for (var t = e.vertices, i = 0, n = t.length; i < n; i++) this.vertices.push(t[i].clone())
  42000. for (var r = e.faces, i = 0, n = r.length; i < n; i++) this.faces.push(r[i].clone())
  42001. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  42002. var o = e.faceVertexUvs[i]
  42003. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = [])
  42004. for (var a = 0, s = o.length; a < s; a++) {
  42005. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42006. var d = l[h]
  42007. c.push(d.clone())
  42008. }
  42009. this.faceVertexUvs[i].push(c)
  42010. }
  42011. }
  42012. return this
  42013. },
  42014. dispose: function () {
  42015. this.dispatchEvent({
  42016. type: 'dispose'
  42017. })
  42018. }
  42019. }),
  42020. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  42021. (n.GeometryIdCount = 0),
  42022. (n.DirectGeometry = function () {
  42023. Object.defineProperty(this, 'id', {
  42024. value: n.GeometryIdCount++
  42025. }),
  42026. (this.uuid = n.Math.generateUUID()),
  42027. (this.name = ''),
  42028. (this.type = 'DirectGeometry'),
  42029. (this.indices = []),
  42030. (this.vertices = []),
  42031. (this.normals = []),
  42032. (this.colors = []),
  42033. (this.uvs = []),
  42034. (this.uvs2 = []),
  42035. (this.groups = []),
  42036. (this.morphTargets = {}),
  42037. (this.skinWeights = []),
  42038. (this.skinIndices = []),
  42039. (this.boundingBox = null),
  42040. (this.boundingSphere = null),
  42041. (this.verticesNeedUpdate = !1),
  42042. (this.normalsNeedUpdate = !1),
  42043. (this.colorsNeedUpdate = !1),
  42044. (this.uvsNeedUpdate = !1),
  42045. (this.groupsNeedUpdate = !1)
  42046. }),
  42047. (n.DirectGeometry.prototype = {
  42048. constructor: n.DirectGeometry,
  42049. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  42050. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  42051. computeFaceNormals: function () {
  42052. console.warn('THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.')
  42053. },
  42054. computeVertexNormals: function () {
  42055. console.warn('THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.')
  42056. },
  42057. computeGroups: function (e) {
  42058. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42059. var a = r[o]
  42060. a.materialIndex !== i &&
  42061. ((i = a.materialIndex),
  42062. void 0 !== t && ((t.count = 3 * o - t.start), n.push(t)),
  42063. (t = {
  42064. start: 3 * o,
  42065. materialIndex: i
  42066. }))
  42067. }
  42068. void 0 !== t && ((t.count = 3 * o - t.start), n.push(t)), (this.groups = n)
  42069. },
  42070. fromGeometry: function (e) {
  42071. var t,
  42072. i = e.faces,
  42073. r = e.vertices,
  42074. o = e.faceVertexUvs,
  42075. a = o[0] && o[0].length > 0,
  42076. s = o[1] && o[1].length > 0,
  42077. l = e.morphTargets,
  42078. c = l.length
  42079. if (c > 0) {
  42080. t = []
  42081. for (var h = 0; h < c; h++) t[h] = []
  42082. this.morphTargets.position = t
  42083. }
  42084. var u,
  42085. d = e.morphNormals,
  42086. p = d.length
  42087. if (p > 0) {
  42088. u = []
  42089. for (var h = 0; h < p; h++) u[h] = []
  42090. this.morphTargets.normal = u
  42091. }
  42092. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  42093. var A = i[h]
  42094. this.vertices.push(r[A.a], r[A.b], r[A.c])
  42095. var y = A.vertexNormals
  42096. if (3 === y.length) this.normals.push(y[0], y[1], y[2])
  42097. else {
  42098. var C = A.normal
  42099. this.normals.push(C, C, C)
  42100. }
  42101. var I = A.vertexColors
  42102. if (3 === I.length) this.colors.push(I[0], I[1], I[2])
  42103. else {
  42104. var E = A.color
  42105. this.colors.push(E, E, E)
  42106. }
  42107. if (a === !0) {
  42108. var b = o[0][h]
  42109. void 0 !== b
  42110. ? this.uvs.push(b[0], b[1], b[2])
  42111. : (console.warn('THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ', h), this.uvs.push(new n.Vector2(), new n.Vector2(), new n.Vector2()))
  42112. }
  42113. if (s === !0) {
  42114. var b = o[1][h]
  42115. void 0 !== b
  42116. ? this.uvs2.push(b[0], b[1], b[2])
  42117. : (console.warn('THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ', h), this.uvs2.push(new n.Vector2(), new n.Vector2(), new n.Vector2()))
  42118. }
  42119. for (var w = 0; w < c; w++) {
  42120. var _ = l[w].vertices
  42121. t[w].push(_[A.a], _[A.b], _[A.c])
  42122. }
  42123. for (var w = 0; w < p; w++) {
  42124. var T = d[w].vertexNormals[h]
  42125. u[w].push(T.a, T.b, T.c)
  42126. }
  42127. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]), v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  42128. }
  42129. return (
  42130. this.computeGroups(e),
  42131. (this.verticesNeedUpdate = e.verticesNeedUpdate),
  42132. (this.normalsNeedUpdate = e.normalsNeedUpdate),
  42133. (this.colorsNeedUpdate = e.colorsNeedUpdate),
  42134. (this.uvsNeedUpdate = e.uvsNeedUpdate),
  42135. (this.groupsNeedUpdate = e.groupsNeedUpdate),
  42136. this
  42137. )
  42138. },
  42139. dispose: function () {
  42140. this.dispatchEvent({
  42141. type: 'dispose'
  42142. })
  42143. }
  42144. }),
  42145. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  42146. (n.BufferGeometry = function () {
  42147. Object.defineProperty(this, 'id', {
  42148. value: n.GeometryIdCount++
  42149. }),
  42150. (this.uuid = n.Math.generateUUID()),
  42151. (this.name = ''),
  42152. (this.type = 'BufferGeometry'),
  42153. (this.index = null),
  42154. (this.attributes = {}),
  42155. (this.morphAttributes = {}),
  42156. (this.groups = []),
  42157. (this.boundingBox = null),
  42158. (this.boundingSphere = null),
  42159. (this.drawRange = {
  42160. start: 0,
  42161. count: 1 / 0
  42162. })
  42163. }),
  42164. (n.BufferGeometry.prototype = {
  42165. constructor: n.BufferGeometry,
  42166. getIndex: function () {
  42167. return this.index
  42168. },
  42169. setIndex: function (e) {
  42170. this.index = e
  42171. },
  42172. addAttribute: function (e, t) {
  42173. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1
  42174. ? (console.warn('THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).'), void this.addAttribute(e, new n.BufferAttribute(arguments[1], arguments[2])))
  42175. : 'index' === e
  42176. ? (console.warn('THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.'), void this.setIndex(t))
  42177. : ((this.attributes[e] = t), this)
  42178. },
  42179. getAttribute: function (e) {
  42180. return this.attributes[e]
  42181. },
  42182. removeAttribute: function (e) {
  42183. return delete this.attributes[e], this
  42184. },
  42185. addGroup: function (e, t, i) {
  42186. this.groups.push({
  42187. start: e,
  42188. count: t,
  42189. materialIndex: void 0 !== i ? i : 0
  42190. })
  42191. },
  42192. clearGroups: function () {
  42193. this.groups = []
  42194. },
  42195. setDrawRange: function (e, t) {
  42196. ;(this.drawRange.start = e), (this.drawRange.count = t)
  42197. },
  42198. applyMatrix: function (e) {
  42199. var t = this.attributes.position
  42200. void 0 !== t && (e.applyToVector3Array(t.array), (t.needsUpdate = !0))
  42201. var i = this.attributes.normal
  42202. if (void 0 !== i) {
  42203. var r = new n.Matrix3().getNormalMatrix(e)
  42204. r.applyToVector3Array(i.array), (i.needsUpdate = !0)
  42205. }
  42206. return null !== this.boundingBox && this.computeBoundingBox(), null !== this.boundingSphere && this.computeBoundingSphere(), this
  42207. },
  42208. rotateX: (function () {
  42209. var e
  42210. return function (t) {
  42211. return void 0 === e && (e = new n.Matrix4()), e.makeRotationX(t), this.applyMatrix(e), this
  42212. }
  42213. })(),
  42214. rotateY: (function () {
  42215. var e
  42216. return function (t) {
  42217. return void 0 === e && (e = new n.Matrix4()), e.makeRotationY(t), this.applyMatrix(e), this
  42218. }
  42219. })(),
  42220. rotateZ: (function () {
  42221. var e
  42222. return function (t) {
  42223. return void 0 === e && (e = new n.Matrix4()), e.makeRotationZ(t), this.applyMatrix(e), this
  42224. }
  42225. })(),
  42226. translate: (function () {
  42227. var e
  42228. return function (t, i, r) {
  42229. return void 0 === e && (e = new n.Matrix4()), e.makeTranslation(t, i, r), this.applyMatrix(e), this
  42230. }
  42231. })(),
  42232. scale: (function () {
  42233. var e
  42234. return function (t, i, r) {
  42235. return void 0 === e && (e = new n.Matrix4()), e.makeScale(t, i, r), this.applyMatrix(e), this
  42236. }
  42237. })(),
  42238. lookAt: (function () {
  42239. var e
  42240. return function (t) {
  42241. void 0 === e && (e = new n.Object3D()), e.lookAt(t), e.updateMatrix(), this.applyMatrix(e.matrix)
  42242. }
  42243. })(),
  42244. center: function () {
  42245. this.computeBoundingBox()
  42246. var e = this.boundingBox.center().negate()
  42247. return this.translate(e.x, e.y, e.z), e
  42248. },
  42249. setFromObject: function (e) {
  42250. var t = e.geometry
  42251. if (e instanceof n.Points || e instanceof n.Line) {
  42252. var i = new n.Float32Attribute(3 * t.vertices.length, 3),
  42253. r = new n.Float32Attribute(3 * t.colors.length, 3)
  42254. if (
  42255. (this.addAttribute('position', i.copyVector3sArray(t.vertices)),
  42256. this.addAttribute('color', r.copyColorsArray(t.colors)),
  42257. t.lineDistances && t.lineDistances.length === t.vertices.length)
  42258. ) {
  42259. var o = new n.Float32Attribute(t.lineDistances.length, 1)
  42260. this.addAttribute('lineDistance', o.copyArray(t.lineDistances))
  42261. }
  42262. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()), null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42263. } else e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t)
  42264. return this
  42265. },
  42266. updateFromObject: function (e) {
  42267. var t = e.geometry
  42268. if (e instanceof n.Mesh) {
  42269. var i = t.__directGeometry
  42270. if (void 0 === i) return this.fromGeometry(t)
  42271. ;(i.verticesNeedUpdate = t.verticesNeedUpdate),
  42272. (i.normalsNeedUpdate = t.normalsNeedUpdate),
  42273. (i.colorsNeedUpdate = t.colorsNeedUpdate),
  42274. (i.uvsNeedUpdate = t.uvsNeedUpdate),
  42275. (i.groupsNeedUpdate = t.groupsNeedUpdate),
  42276. (t.verticesNeedUpdate = !1),
  42277. (t.normalsNeedUpdate = !1),
  42278. (t.colorsNeedUpdate = !1),
  42279. (t.uvsNeedUpdate = !1),
  42280. (t.groupsNeedUpdate = !1),
  42281. (t = i)
  42282. }
  42283. if (t.verticesNeedUpdate === !0) {
  42284. var r = this.attributes.position
  42285. void 0 !== r && (r.copyVector3sArray(t.vertices), (r.needsUpdate = !0)), (t.verticesNeedUpdate = !1)
  42286. }
  42287. if (t.normalsNeedUpdate === !0) {
  42288. var r = this.attributes.normal
  42289. void 0 !== r && (r.copyVector3sArray(t.normals), (r.needsUpdate = !0)), (t.normalsNeedUpdate = !1)
  42290. }
  42291. if (t.colorsNeedUpdate === !0) {
  42292. var r = this.attributes.color
  42293. void 0 !== r && (r.copyColorsArray(t.colors), (r.needsUpdate = !0)), (t.colorsNeedUpdate = !1)
  42294. }
  42295. if (t.uvsNeedUpdate) {
  42296. var r = this.attributes.uv
  42297. void 0 !== r && (r.copyVector2sArray(t.uvs), (r.needsUpdate = !0)), (t.uvsNeedUpdate = !1)
  42298. }
  42299. if (t.lineDistancesNeedUpdate) {
  42300. var r = this.attributes.lineDistance
  42301. void 0 !== r && (r.copyArray(t.lineDistances), (r.needsUpdate = !0)), (t.lineDistancesNeedUpdate = !1)
  42302. }
  42303. return t.groupsNeedUpdate && (t.computeGroups(e.geometry), (this.groups = t.groups), (t.groupsNeedUpdate = !1)), this
  42304. },
  42305. fromGeometry: function (e) {
  42306. return (e.__directGeometry = new n.DirectGeometry().fromGeometry(e)), this.fromDirectGeometry(e.__directGeometry)
  42307. },
  42308. fromDirectGeometry: function (e) {
  42309. var t = new Float32Array(3 * e.vertices.length)
  42310. if ((this.addAttribute('position', new n.BufferAttribute(t, 3).copyVector3sArray(e.vertices)), e.normals.length > 0)) {
  42311. var i = new Float32Array(3 * e.normals.length)
  42312. this.addAttribute('normal', new n.BufferAttribute(i, 3).copyVector3sArray(e.normals))
  42313. }
  42314. if (e.colors.length > 0) {
  42315. var r = new Float32Array(3 * e.colors.length)
  42316. this.addAttribute('color', new n.BufferAttribute(r, 3).copyColorsArray(e.colors))
  42317. }
  42318. if (e.uvs.length > 0) {
  42319. var o = new Float32Array(2 * e.uvs.length)
  42320. this.addAttribute('uv', new n.BufferAttribute(o, 2).copyVector2sArray(e.uvs))
  42321. }
  42322. if (e.uvs2.length > 0) {
  42323. var a = new Float32Array(2 * e.uvs2.length)
  42324. this.addAttribute('uv2', new n.BufferAttribute(a, 2).copyVector2sArray(e.uvs2))
  42325. }
  42326. if (e.indices.length > 0) {
  42327. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array,
  42328. l = new s(3 * e.indices.length)
  42329. this.setIndex(new n.BufferAttribute(l, 1).copyIndicesArray(e.indices))
  42330. }
  42331. this.groups = e.groups
  42332. for (var c in e.morphTargets) {
  42333. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  42334. var f = u[d],
  42335. g = new n.Float32Attribute(3 * f.length, 3)
  42336. h.push(g.copyVector3sArray(f))
  42337. }
  42338. this.morphAttributes[c] = h
  42339. }
  42340. if (e.skinIndices.length > 0) {
  42341. var m = new n.Float32Attribute(4 * e.skinIndices.length, 4)
  42342. this.addAttribute('skinIndex', m.copyVector4sArray(e.skinIndices))
  42343. }
  42344. if (e.skinWeights.length > 0) {
  42345. var v = new n.Float32Attribute(4 * e.skinWeights.length, 4)
  42346. this.addAttribute('skinWeight', v.copyVector4sArray(e.skinWeights))
  42347. }
  42348. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()), null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()), this
  42349. },
  42350. computeBoundingBox: (function () {
  42351. new n.Vector3()
  42352. return function () {
  42353. null === this.boundingBox && (this.boundingBox = new n.Box3())
  42354. var e = this.attributes.position.array
  42355. e && this.boundingBox.setFromArray(e),
  42356. (void 0 !== e && 0 !== e.length) || (this.boundingBox.min.set(0, 0, 0), this.boundingBox.max.set(0, 0, 0)),
  42357. (isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) &&
  42358. console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this)
  42359. }
  42360. })(),
  42361. computeBoundingSphere: (function () {
  42362. var e = new n.Box3(),
  42363. t = new n.Vector3()
  42364. return function () {
  42365. null === this.boundingSphere && (this.boundingSphere = new n.Sphere())
  42366. var i = this.attributes.position.array
  42367. if (i) {
  42368. var r = this.boundingSphere.center
  42369. e.setFromArray(i), e.center(r)
  42370. for (var o = 0, a = 0, s = i.length; a < s; a += 3) t.fromArray(i, a), (o = Math.max(o, r.distanceToSquared(t)))
  42371. ;(this.boundingSphere.radius = Math.sqrt(o)),
  42372. isNaN(this.boundingSphere.radius) &&
  42373. console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42374. }
  42375. }
  42376. })(),
  42377. computeFaceNormals: function () {},
  42378. computeVertexNormals: function () {
  42379. var e = this.index,
  42380. t = this.attributes,
  42381. i = this.groups
  42382. if (t.position) {
  42383. var r = t.position.array
  42384. if (void 0 === t.normal) this.addAttribute('normal', new n.BufferAttribute(new Float32Array(r.length), 3))
  42385. else for (var o = t.normal.array, a = 0, s = o.length; a < s; a++) o[a] = 0
  42386. var l,
  42387. c,
  42388. h,
  42389. u = t.normal.array,
  42390. d = new n.Vector3(),
  42391. p = new n.Vector3(),
  42392. f = new n.Vector3(),
  42393. g = new n.Vector3(),
  42394. m = new n.Vector3()
  42395. if (e) {
  42396. var v = e.array
  42397. 0 === i.length && this.addGroup(0, v.length)
  42398. for (var A = 0, y = i.length; A < y; ++A)
  42399. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  42400. (l = 3 * v[a + 0]),
  42401. (c = 3 * v[a + 1]),
  42402. (h = 3 * v[a + 2]),
  42403. d.fromArray(r, l),
  42404. p.fromArray(r, c),
  42405. f.fromArray(r, h),
  42406. g.subVectors(f, p),
  42407. m.subVectors(d, p),
  42408. g.cross(m),
  42409. (u[l] += g.x),
  42410. (u[l + 1] += g.y),
  42411. (u[l + 2] += g.z),
  42412. (u[c] += g.x),
  42413. (u[c + 1] += g.y),
  42414. (u[c + 2] += g.z),
  42415. (u[h] += g.x),
  42416. (u[h + 1] += g.y),
  42417. (u[h + 2] += g.z)
  42418. } else
  42419. for (var a = 0, s = r.length; a < s; a += 9)
  42420. d.fromArray(r, a),
  42421. p.fromArray(r, a + 3),
  42422. f.fromArray(r, a + 6),
  42423. g.subVectors(f, p),
  42424. m.subVectors(d, p),
  42425. g.cross(m),
  42426. (u[a] = g.x),
  42427. (u[a + 1] = g.y),
  42428. (u[a + 2] = g.z),
  42429. (u[a + 3] = g.x),
  42430. (u[a + 4] = g.y),
  42431. (u[a + 5] = g.z),
  42432. (u[a + 6] = g.x),
  42433. (u[a + 7] = g.y),
  42434. (u[a + 8] = g.z)
  42435. this.normalizeNormals(), (t.normal.needsUpdate = !0)
  42436. }
  42437. },
  42438. merge: function (e, t) {
  42439. if (e instanceof n.BufferGeometry == !1) return void console.error('THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.', e)
  42440. void 0 === t && (t = 0)
  42441. var i = this.attributes
  42442. for (var r in i) if (void 0 !== e.attributes[r]) for (var o = i[r], a = o.array, s = e.attributes[r], l = s.array, c = s.itemSize, h = 0, u = c * t; h < l.length; h++, u++) a[u] = l[h]
  42443. return this
  42444. },
  42445. normalizeNormals: function () {
  42446. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  42447. (e = r[o]), (t = r[o + 1]), (i = r[o + 2]), (n = 1 / Math.sqrt(e * e + t * t + i * i)), (r[o] *= n), (r[o + 1] *= n), (r[o + 2] *= n)
  42448. },
  42449. toNonIndexed: function () {
  42450. if (null === this.index) return console.warn('THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed.'), this
  42451. var e = new n.BufferGeometry(),
  42452. t = this.index.array,
  42453. i = this.attributes
  42454. for (var r in i) {
  42455. for (var o = i[r], a = o.array, s = o.itemSize, l = new a.constructor(t.length * s), c = 0, h = 0, u = 0, d = t.length; u < d; u++) {
  42456. c = t[u] * s
  42457. for (var p = 0; p < s; p++) l[h++] = a[c++]
  42458. }
  42459. e.addAttribute(r, new n.BufferAttribute(l, s))
  42460. }
  42461. return e
  42462. },
  42463. toJSON: function () {
  42464. var e = {
  42465. metadata: {
  42466. version: 4.4,
  42467. type: 'BufferGeometry',
  42468. generator: 'BufferGeometry.toJSON'
  42469. }
  42470. }
  42471. if (((e.uuid = this.uuid), (e.type = this.type), '' !== this.name && (e.name = this.name), void 0 !== this.parameters)) {
  42472. var t = this.parameters
  42473. for (var i in t) void 0 !== t[i] && (e[i] = t[i])
  42474. return e
  42475. }
  42476. e.data = {
  42477. attributes: {}
  42478. }
  42479. var n = this.index
  42480. if (null !== n) {
  42481. var r = Array.prototype.slice.call(n.array)
  42482. e.data.index = {
  42483. type: n.array.constructor.name,
  42484. array: r
  42485. }
  42486. }
  42487. var o = this.attributes
  42488. for (var i in o) {
  42489. var a = o[i],
  42490. r = Array.prototype.slice.call(a.array)
  42491. e.data.attributes[i] = {
  42492. itemSize: a.itemSize,
  42493. type: a.array.constructor.name,
  42494. array: r
  42495. }
  42496. }
  42497. var s = this.groups
  42498. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)))
  42499. var l = this.boundingSphere
  42500. return (
  42501. null !== l &&
  42502. (e.data.boundingSphere = {
  42503. center: l.center.toArray(),
  42504. radius: l.radius
  42505. }),
  42506. e
  42507. )
  42508. },
  42509. clone: function () {
  42510. return new n.BufferGeometry().copy(this)
  42511. },
  42512. copy: function (e) {
  42513. var t = e.index
  42514. null !== t && this.setIndex(t.clone())
  42515. var i = e.attributes
  42516. for (var n in i) {
  42517. var r = i[n]
  42518. this.addAttribute(n, r.clone())
  42519. }
  42520. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42521. var l = o[a]
  42522. this.addGroup(l.start, l.count)
  42523. }
  42524. return this
  42525. },
  42526. dispose: function () {
  42527. this.dispatchEvent({
  42528. type: 'dispose'
  42529. })
  42530. }
  42531. }),
  42532. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  42533. (n.BufferGeometry.MaxIndex = 65535),
  42534. (n.InstancedBufferGeometry = function () {
  42535. n.BufferGeometry.call(this), (this.type = 'InstancedBufferGeometry'), (this.maxInstancedCount = void 0)
  42536. }),
  42537. (n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  42538. (n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry),
  42539. (n.InstancedBufferGeometry.prototype.addGroup = function (e, t, i) {
  42540. this.groups.push({
  42541. start: e,
  42542. count: t,
  42543. instances: i
  42544. })
  42545. }),
  42546. (n.InstancedBufferGeometry.prototype.copy = function (e) {
  42547. var t = e.index
  42548. null !== t && this.setIndex(t.clone())
  42549. var i = e.attributes
  42550. for (var n in i) {
  42551. var r = i[n]
  42552. this.addAttribute(n, r.clone())
  42553. }
  42554. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42555. var l = o[a]
  42556. this.addGroup(l.start, l.count, l.instances)
  42557. }
  42558. return this
  42559. }),
  42560. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  42561. (n.Uniform = function (e, t) {
  42562. ;(this.type = e), (this.value = t), (this.dynamic = !1)
  42563. }),
  42564. (n.Uniform.prototype = {
  42565. constructor: n.Uniform,
  42566. onUpdate: function (e) {
  42567. return (this.dynamic = !0), (this.onUpdateCallback = e), this
  42568. }
  42569. }),
  42570. (n.AnimationClip = function (e, t, i) {
  42571. ;(this.name = e || n.Math.generateUUID()), (this.tracks = i), (this.duration = void 0 !== t ? t : -1), this.duration < 0 && this.resetDuration(), this.trim(), this.optimize()
  42572. }),
  42573. (n.AnimationClip.prototype = {
  42574. constructor: n.AnimationClip,
  42575. resetDuration: function () {
  42576. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  42577. var r = this.tracks[i]
  42578. t = Math.max(t, r.times[r.times.length - 1])
  42579. }
  42580. this.duration = t
  42581. },
  42582. trim: function () {
  42583. for (var e = 0; e < this.tracks.length; e++) this.tracks[e].trim(0, this.duration)
  42584. return this
  42585. },
  42586. optimize: function () {
  42587. for (var e = 0; e < this.tracks.length; e++) this.tracks[e].optimize()
  42588. return this
  42589. }
  42590. }),
  42591. Object.assign(n.AnimationClip, {
  42592. parse: function (e) {
  42593. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o) t.push(n.KeyframeTrack.parse(i[o]).scale(r))
  42594. return new n.AnimationClip(e.name, e.duration, t)
  42595. },
  42596. toJSON: function (e) {
  42597. for (
  42598. var t = [],
  42599. i = e.tracks,
  42600. r = {
  42601. name: e.name,
  42602. duration: e.duration,
  42603. tracks: t
  42604. },
  42605. o = 0,
  42606. a = i.length;
  42607. o !== a;
  42608. ++o
  42609. )
  42610. t.push(n.KeyframeTrack.toJSON(i[o]))
  42611. return r
  42612. },
  42613. CreateFromMorphTargetSequence: function (e, t, i) {
  42614. for (var r = t.length, o = [], a = 0; a < r; a++) {
  42615. var s = [],
  42616. l = []
  42617. s.push((a + r - 1) % r, a, (a + 1) % r), l.push(0, 1, 0)
  42618. var c = n.AnimationUtils.getKeyframeOrder(s)
  42619. ;(s = n.AnimationUtils.sortedArray(s, 1, c)),
  42620. (l = n.AnimationUtils.sortedArray(l, 1, c)),
  42621. 0 === s[0] && (s.push(r), l.push(l[0])),
  42622. o.push(new n.NumberKeyframeTrack('.morphTargetInfluences[' + t[a].name + ']', s, l).scale(1 / i))
  42623. }
  42624. return new n.AnimationClip(e, -1, o)
  42625. },
  42626. findByName: function (e, t) {
  42627. for (var i = 0; i < e.length; i++) if (e[i].name === t) return e[i]
  42628. return null
  42629. },
  42630. CreateClipsFromMorphTargetSequences: function (e, t) {
  42631. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  42632. var s = e[o],
  42633. l = s.name.match(r)
  42634. if (l && l.length > 1) {
  42635. var c = l[1],
  42636. h = i[c]
  42637. h || (i[c] = h = []), h.push(s)
  42638. }
  42639. }
  42640. var u = []
  42641. for (var c in i) u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t))
  42642. return u
  42643. },
  42644. parseAnimation: function (e, t, i) {
  42645. if (!e) return console.error(' no animation in JSONLoader data'), null
  42646. for (
  42647. var r = function (e, t, i, r, o) {
  42648. if (0 !== i.length) {
  42649. var a = [],
  42650. s = []
  42651. n.AnimationUtils.flattenJSON(i, a, s, r), 0 !== a.length && o.push(new e(t, a, s))
  42652. }
  42653. },
  42654. o = [],
  42655. a = e.name || 'default',
  42656. s = e.length || -1,
  42657. l = e.fps || 30,
  42658. c = e.hierarchy || [],
  42659. h = 0;
  42660. h < c.length;
  42661. h++
  42662. ) {
  42663. var u = c[h].keys
  42664. if (u && 0 != u.length)
  42665. if (u[0].morphTargets) {
  42666. for (var d = {}, p = 0; p < u.length; p++) if (u[p].morphTargets) for (var f = 0; f < u[p].morphTargets.length; f++) d[u[p].morphTargets[f]] = -1
  42667. for (var g in d) {
  42668. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  42669. var A = u[p]
  42670. m.push(A.time), v.push(A.morphTarget === g ? 1 : 0)
  42671. }
  42672. o.push(new n.NumberKeyframeTrack('.morphTargetInfluence[' + g + ']', m, v))
  42673. }
  42674. s = d.length * (l || 1)
  42675. } else {
  42676. var y = '.bones[' + t[h].name + ']'
  42677. r(n.VectorKeyframeTrack, y + '.position', u, 'pos', o), r(n.QuaternionKeyframeTrack, y + '.quaternion', u, 'rot', o), r(n.VectorKeyframeTrack, y + '.scale', u, 'scl', o)
  42678. }
  42679. }
  42680. if (0 === o.length) return null
  42681. var C = new n.AnimationClip(a, s, o)
  42682. return C
  42683. }
  42684. }),
  42685. (n.AnimationMixer = function (e) {
  42686. ;(this._root = e), this._initMemoryManager(), (this._accuIndex = 0), (this.time = 0), (this.timeScale = 1)
  42687. }),
  42688. (n.AnimationMixer.prototype = {
  42689. constructor: n.AnimationMixer,
  42690. clipAction: function (e, t) {
  42691. var i,
  42692. r = t || this._root,
  42693. o = r.uuid,
  42694. a = 'string' == typeof e ? e : e.name,
  42695. s = e !== a ? e : null,
  42696. l = this._actionsByClip[a]
  42697. if (void 0 !== l) {
  42698. var c = l.actionByRoot[o]
  42699. if (void 0 !== c) return c
  42700. if (((i = l.knownActions[0]), (s = i._clip), e !== a && e !== s)) throw new Error('Different clips with the same name detected!')
  42701. }
  42702. if (null === s) return null
  42703. var h = new n.AnimationMixer._Action(this, s, t)
  42704. return this._bindAction(h, i), this._addInactiveAction(h, a, o), h
  42705. },
  42706. existingAction: function (e, t) {
  42707. var i = t || this._root,
  42708. n = i.uuid,
  42709. r = 'string' == typeof e ? e : e.name,
  42710. o = this._actionsByClip[r]
  42711. return void 0 !== o ? o.actionByRoot[n] || null : null
  42712. },
  42713. stopAllAction: function () {
  42714. var e = this._actions,
  42715. t = this._nActiveActions,
  42716. i = this._bindings,
  42717. n = this._nActiveBindings
  42718. ;(this._nActiveActions = 0), (this._nActiveBindings = 0)
  42719. for (var r = 0; r !== t; ++r) e[r].reset()
  42720. for (var r = 0; r !== n; ++r) i[r].useCount = 0
  42721. return this
  42722. },
  42723. update: function (e) {
  42724. e *= this.timeScale
  42725. for (var t = this._actions, i = this._nActiveActions, n = (this.time += e), r = Math.sign(e), o = (this._accuIndex ^= 1), a = 0; a !== i; ++a) {
  42726. var s = t[a]
  42727. s.enabled && s._update(n, e, r, o)
  42728. }
  42729. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a) l[a].apply(o)
  42730. return this
  42731. },
  42732. getRoot: function () {
  42733. return this._root
  42734. },
  42735. uncacheClip: function (e) {
  42736. var t = this._actions,
  42737. i = e.name,
  42738. n = this._actionsByClip,
  42739. r = n[i]
  42740. if (void 0 !== r) {
  42741. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  42742. var l = o[a]
  42743. this._deactivateAction(l)
  42744. var c = l._cacheIndex,
  42745. h = t[t.length - 1]
  42746. ;(l._cacheIndex = null), (l._byClipCacheIndex = null), (h._cacheIndex = c), (t[c] = h), t.pop(), this._removeInactiveBindingsForAction(l)
  42747. }
  42748. delete n[i]
  42749. }
  42750. },
  42751. uncacheRoot: function (e) {
  42752. var t = e.uuid,
  42753. i = this._actionsByClip
  42754. for (var n in i) {
  42755. var r = i[n].actionByRoot,
  42756. o = r[t]
  42757. void 0 !== o && (this._deactivateAction(o), this._removeInactiveAction(o))
  42758. }
  42759. var a = this._bindingsByRootAndName,
  42760. s = a[t]
  42761. if (void 0 !== s)
  42762. for (var l in s) {
  42763. var c = s[l]
  42764. c.restoreOriginalState(), this._removeInactiveBinding(c)
  42765. }
  42766. },
  42767. uncacheAction: function (e, t) {
  42768. var i = this.existingAction(e, t)
  42769. null !== i && (this._deactivateAction(i), this._removeInactiveAction(i))
  42770. }
  42771. }),
  42772. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  42773. (n.AnimationMixer._Action = function (e, t, i) {
  42774. ;(this._mixer = e), (this._clip = t), (this._localRoot = i || null)
  42775. for (
  42776. var r = t.tracks,
  42777. o = r.length,
  42778. a = new Array(o),
  42779. s = {
  42780. endingStart: n.ZeroCurvatureEnding,
  42781. endingEnd: n.ZeroCurvatureEnding
  42782. },
  42783. l = 0;
  42784. l !== o;
  42785. ++l
  42786. ) {
  42787. var c = r[l].createInterpolant(null)
  42788. ;(a[l] = c), (c.settings = s)
  42789. }
  42790. ;(this._interpolantSettings = s),
  42791. (this._interpolants = a),
  42792. (this._propertyBindings = new Array(o)),
  42793. (this._cacheIndex = null),
  42794. (this._byClipCacheIndex = null),
  42795. (this._timeScaleInterpolant = null),
  42796. (this._weightInterpolant = null),
  42797. (this.loop = n.LoopRepeat),
  42798. (this._loopCount = -1),
  42799. (this._startTime = null),
  42800. (this.time = 0),
  42801. (this.timeScale = 1),
  42802. (this._effectiveTimeScale = 1),
  42803. (this.weight = 1),
  42804. (this._effectiveWeight = 1),
  42805. (this.repetitions = 1 / 0),
  42806. (this.paused = !1),
  42807. (this.enabled = !0),
  42808. (this.clampWhenFinished = !1),
  42809. (this.zeroSlopeAtStart = !0),
  42810. (this.zeroSlopeAtEnd = !0)
  42811. }),
  42812. (n.AnimationMixer._Action.prototype = {
  42813. constructor: n.AnimationMixer._Action,
  42814. play: function () {
  42815. return this._mixer._activateAction(this), this
  42816. },
  42817. stop: function () {
  42818. return this._mixer._deactivateAction(this), this.reset()
  42819. },
  42820. reset: function () {
  42821. return (this.paused = !1), (this.enabled = !0), (this.time = 0), (this._loopCount = -1), (this._startTime = null), this.stopFading().stopWarping()
  42822. },
  42823. isRunning: function () {
  42824. this._startTime
  42825. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  42826. },
  42827. isScheduled: function () {
  42828. return this._mixer._isActiveAction(this)
  42829. },
  42830. startAt: function (e) {
  42831. return (this._startTime = e), this
  42832. },
  42833. setLoop: function (e, t) {
  42834. return (this.loop = e), (this.repetitions = t), this
  42835. },
  42836. setEffectiveWeight: function (e) {
  42837. return (this.weight = e), (this._effectiveWeight = this.enabled ? e : 0), this.stopFading()
  42838. },
  42839. getEffectiveWeight: function () {
  42840. return this._effectiveWeight
  42841. },
  42842. fadeIn: function (e) {
  42843. return this._scheduleFading(e, 0, 1)
  42844. },
  42845. fadeOut: function (e) {
  42846. return this._scheduleFading(e, 1, 0)
  42847. },
  42848. crossFadeFrom: function (e, t, i) {
  42849. this._mixer
  42850. if ((e.fadeOut(t), this.fadeIn(t), i)) {
  42851. var n = this._clip.duration,
  42852. r = e._clip.duration,
  42853. o = r / n,
  42854. a = n / r
  42855. e.warp(1, o, t), this.warp(a, 1, t)
  42856. }
  42857. return this
  42858. },
  42859. crossFadeTo: function (e, t, i) {
  42860. return e.crossFadeFrom(this, t, i)
  42861. },
  42862. stopFading: function () {
  42863. var e = this._weightInterpolant
  42864. return null !== e && ((this._weightInterpolant = null), this._mixer._takeBackControlInterpolant(e)), this
  42865. },
  42866. setEffectiveTimeScale: function (e) {
  42867. return (this.timeScale = e), (this._effectiveTimeScale = this.paused ? 0 : e), this.stopWarping()
  42868. },
  42869. getEffectiveTimeScale: function () {
  42870. return this._effectiveTimeScale
  42871. },
  42872. setDuration: function (e) {
  42873. return (this.timeScale = this._clip.duration / e), this.stopWarping()
  42874. },
  42875. syncWith: function (e) {
  42876. return (this.time = e.time), (this.timeScale = e.timeScale), this.stopWarping()
  42877. },
  42878. halt: function (e) {
  42879. return this.warp(this._currentTimeScale, 0, e)
  42880. },
  42881. warp: function (e, t, i) {
  42882. var n = this._mixer,
  42883. r = n.time,
  42884. o = this._timeScaleInterpolant,
  42885. a = this.timeScale
  42886. null === o && ((o = n._lendControlInterpolant()), (this._timeScaleInterpolant = o))
  42887. var s = o.parameterPositions,
  42888. l = o.sampleValues
  42889. return (s[0] = r), (s[1] = r + i), (l[0] = e / a), (l[1] = t / a), this
  42890. },
  42891. stopWarping: function () {
  42892. var e = this._timeScaleInterpolant
  42893. return null !== e && ((this._timeScaleInterpolant = null), this._mixer._takeBackControlInterpolant(e)), this
  42894. },
  42895. getMixer: function () {
  42896. return this._mixer
  42897. },
  42898. getClip: function () {
  42899. return this._clip
  42900. },
  42901. getRoot: function () {
  42902. return this._localRoot || this._mixer._root
  42903. },
  42904. _update: function (e, t, i, n) {
  42905. var r = this._startTime
  42906. if (null !== r) {
  42907. var o = (e - r) * i
  42908. if (o < 0 || 0 === i) return
  42909. ;(this._startTime = null), (t = i * o)
  42910. }
  42911. t *= this._updateTimeScale(e)
  42912. var a = this._updateTime(t),
  42913. s = this._updateWeight(e)
  42914. if (s > 0) for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h) l[h].evaluate(a), c[h].accumulate(n, s)
  42915. },
  42916. _updateWeight: function (e) {
  42917. var t = 0
  42918. if (this.enabled) {
  42919. t = this.weight
  42920. var i = this._weightInterpolant
  42921. if (null !== i) {
  42922. var n = i.evaluate(e)[0]
  42923. ;(t *= n), e > i.parameterPositions[1] && (this.stopFading(), 0 === n && (this.enabled = !1))
  42924. }
  42925. }
  42926. return (this._effectiveWeight = t), t
  42927. },
  42928. _updateTimeScale: function (e) {
  42929. var t = 0
  42930. if (!this.paused) {
  42931. t = this.timeScale
  42932. var i = this._timeScaleInterpolant
  42933. if (null !== i) {
  42934. var n = i.evaluate(e)[0]
  42935. ;(t *= n), e > i.parameterPositions[1] && (this.stopWarping(), 0 === t ? (this.pause = !0) : (this.timeScale = t))
  42936. }
  42937. }
  42938. return (this._effectiveTimeScale = t), t
  42939. },
  42940. _updateTime: function (e) {
  42941. var t = this.time + e
  42942. if (0 === e) return t
  42943. var i = this._clip.duration,
  42944. r = this.loop,
  42945. o = this._loopCount,
  42946. a = !1
  42947. switch (r) {
  42948. case n.LoopOnce:
  42949. if ((o === -1 && ((this.loopCount = 0), this._setEndings(!0, !0, !1)), t >= i)) t = i
  42950. else {
  42951. if (!(t < 0)) break
  42952. t = 0
  42953. }
  42954. this.clampWhenFinished ? (this.pause = !0) : (this.enabled = !1),
  42955. this._mixer.dispatchEvent({
  42956. type: 'finished',
  42957. action: this,
  42958. direction: e < 0 ? -1 : 1
  42959. })
  42960. break
  42961. case n.LoopPingPong:
  42962. a = !0
  42963. case n.LoopRepeat:
  42964. if ((o === -1 && (e > 0 ? ((o = 0), this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)), t >= i || t < 0)) {
  42965. var s = Math.floor(t / i)
  42966. ;(t -= i * s), (o += Math.abs(s))
  42967. var l = this.repetitions - o
  42968. if (l < 0) {
  42969. this.clampWhenFinished ? (this.paused = !0) : (this.enabled = !1),
  42970. (t = e > 0 ? i : 0),
  42971. this._mixer.dispatchEvent({
  42972. type: 'finished',
  42973. action: this,
  42974. direction: e > 0 ? 1 : -1
  42975. })
  42976. break
  42977. }
  42978. if (0 === l) {
  42979. var c = e < 0
  42980. this._setEndings(c, !c, a)
  42981. } else this._setEndings(!1, !1, a)
  42982. ;(this._loopCount = o),
  42983. this._mixer.dispatchEvent({
  42984. type: 'loop',
  42985. action: this,
  42986. loopDelta: s
  42987. })
  42988. }
  42989. if (r === n.LoopPingPong && 1 === (1 & o)) return (this.time = t), i - t
  42990. }
  42991. return (this.time = t), t
  42992. },
  42993. _setEndings: function (e, t, i) {
  42994. var r = this._interpolantSettings
  42995. i
  42996. ? ((r.endingStart = n.ZeroSlopeEnding), (r.endingEnd = n.ZeroSlopeEnding))
  42997. : (e ? (r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding) : (r.endingStart = n.WrapAroundEnding),
  42998. t ? (r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding) : (r.endingEnd = n.WrapAroundEnding))
  42999. },
  43000. _scheduleFading: function (e, t, i) {
  43001. var n = this._mixer,
  43002. r = n.time,
  43003. o = this._weightInterpolant
  43004. null === o && ((o = n._lendControlInterpolant()), (this._weightInterpolant = o))
  43005. var a = o.parameterPositions,
  43006. s = o.sampleValues
  43007. return (a[0] = r), (s[0] = t), (a[1] = r + e), (s[1] = i), this
  43008. }
  43009. }),
  43010. Object.assign(n.AnimationMixer.prototype, {
  43011. _bindAction: function (e, t) {
  43012. var i = e._localRoot || this._root,
  43013. r = e._clip.tracks,
  43014. o = r.length,
  43015. a = e._propertyBindings,
  43016. s = e._interpolants,
  43017. l = i.uuid,
  43018. c = this._bindingsByRootAndName,
  43019. h = c[l]
  43020. void 0 === h && ((h = {}), (c[l] = h))
  43021. for (var u = 0; u !== o; ++u) {
  43022. var d = r[u],
  43023. p = d.name,
  43024. f = h[p]
  43025. if (void 0 !== f) a[u] = f
  43026. else {
  43027. if (((f = a[u]), void 0 !== f)) {
  43028. null === f._cacheIndex && (++f.referenceCount, this._addInactiveBinding(f, l, p))
  43029. continue
  43030. }
  43031. var g = t && t._propertyBindings[u].binding.parsedPath
  43032. ;(f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g), d.ValueTypeName, d.getValueSize())), ++f.referenceCount, this._addInactiveBinding(f, l, p), (a[u] = f)
  43033. }
  43034. s[u].resultBuffer = f.buffer
  43035. }
  43036. },
  43037. _activateAction: function (e) {
  43038. if (!this._isActiveAction(e)) {
  43039. if (null === e._cacheIndex) {
  43040. var t = (e._localRoot || this._root).uuid,
  43041. i = e._clip.name,
  43042. n = this._actionsByClip[i]
  43043. this._bindAction(e, n && n.knownActions[0]), this._addInactiveAction(e, i, t)
  43044. }
  43045. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43046. var s = r[o]
  43047. 0 === s.useCount++ && (this._lendBinding(s), s.saveOriginalState())
  43048. }
  43049. this._lendAction(e)
  43050. }
  43051. },
  43052. _deactivateAction: function (e) {
  43053. if (this._isActiveAction(e)) {
  43054. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43055. var r = t[i]
  43056. 0 === --r.useCount && (r.restoreOriginalState(), this._takeBackBinding(r))
  43057. }
  43058. this._takeBackAction(e)
  43059. }
  43060. },
  43061. _initMemoryManager: function () {
  43062. ;(this._actions = []),
  43063. (this._nActiveActions = 0),
  43064. (this._actionsByClip = {}),
  43065. (this._bindings = []),
  43066. (this._nActiveBindings = 0),
  43067. (this._bindingsByRootAndName = {}),
  43068. (this._controlInterpolants = []),
  43069. (this._nActiveControlInterpolants = 0)
  43070. var e = this
  43071. this.stats = {
  43072. actions: {
  43073. get total() {
  43074. return e._actions.length
  43075. },
  43076. get inUse() {
  43077. return e._nActiveActions
  43078. }
  43079. },
  43080. bindings: {
  43081. get total() {
  43082. return e._bindings.length
  43083. },
  43084. get inUse() {
  43085. return e._nActiveBindings
  43086. }
  43087. },
  43088. controlInterpolants: {
  43089. get total() {
  43090. return e._controlInterpolants.length
  43091. },
  43092. get inUse() {
  43093. return e._nActiveControlInterpolants
  43094. }
  43095. }
  43096. }
  43097. },
  43098. _isActiveAction: function (e) {
  43099. var t = e._cacheIndex
  43100. return null !== t && t < this._nActiveActions
  43101. },
  43102. _addInactiveAction: function (e, t, i) {
  43103. var n = this._actions,
  43104. r = this._actionsByClip,
  43105. o = r[t]
  43106. if (void 0 === o)
  43107. (o = {
  43108. knownActions: [e],
  43109. actionByRoot: {}
  43110. }),
  43111. (e._byClipCacheIndex = 0),
  43112. (r[t] = o)
  43113. else {
  43114. var a = o.knownActions
  43115. ;(e._byClipCacheIndex = a.length), a.push(e)
  43116. }
  43117. ;(e._cacheIndex = n.length), n.push(e), (o.actionByRoot[i] = e)
  43118. },
  43119. _removeInactiveAction: function (e) {
  43120. var t = this._actions,
  43121. i = t[t.length - 1],
  43122. n = e._cacheIndex
  43123. ;(i._cacheIndex = n), (t[n] = i), t.pop(), (e._cacheIndex = null)
  43124. var r = e._clip.name,
  43125. o = this._actionsByClip,
  43126. a = o[r],
  43127. s = a.knownActions,
  43128. l = s[s.length - 1],
  43129. c = e._byClipCacheIndex
  43130. ;(l._byClipCacheIndex = c), (s[c] = l), s.pop(), (e._byClipCacheIndex = null)
  43131. var h = a.actionByRoot,
  43132. u = (t._localRoot || this._root).uuid
  43133. delete h[u], 0 === s.length && delete o[r], this._removeInactiveBindingsForAction(e)
  43134. },
  43135. _removeInactiveBindingsForAction: function (e) {
  43136. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43137. var r = t[i]
  43138. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  43139. }
  43140. },
  43141. _lendAction: function (e) {
  43142. var t = this._actions,
  43143. i = e._cacheIndex,
  43144. n = this._nActiveActions++,
  43145. r = t[n]
  43146. ;(e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r)
  43147. },
  43148. _takeBackAction: function (e) {
  43149. var t = this._actions,
  43150. i = e._cacheIndex,
  43151. n = --this._nActiveActions,
  43152. r = t[n]
  43153. ;(e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r)
  43154. },
  43155. _addInactiveBinding: function (e, t, i) {
  43156. var n = this._bindingsByRootAndName,
  43157. r = n[t],
  43158. o = this._bindings
  43159. void 0 === r && ((r = {}), (n[t] = r)), (r[i] = e), (e._cacheIndex = o.length), o.push(e)
  43160. },
  43161. _removeInactiveBinding: function (e) {
  43162. var t = this._bindings,
  43163. i = e.binding,
  43164. n = i.rootNode.uuid,
  43165. r = i.path,
  43166. o = this._bindingsByRootAndName,
  43167. a = o[n],
  43168. s = t[t.length - 1],
  43169. l = e._cacheIndex
  43170. ;(s._cacheIndex = l), (t[l] = s), t.pop(), delete a[r]
  43171. e: {
  43172. for (var c in a) break e
  43173. delete o[n]
  43174. }
  43175. },
  43176. _lendBinding: function (e) {
  43177. var t = this._bindings,
  43178. i = e._cacheIndex,
  43179. n = this._nActiveBindings++,
  43180. r = t[n]
  43181. ;(e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r)
  43182. },
  43183. _takeBackBinding: function (e) {
  43184. var t = this._bindings,
  43185. i = e._cacheIndex,
  43186. n = --this._nActiveBindings,
  43187. r = t[n]
  43188. ;(e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r)
  43189. },
  43190. _lendControlInterpolant: function () {
  43191. var e = this._controlInterpolants,
  43192. t = this._nActiveControlInterpolants++,
  43193. i = e[t]
  43194. return void 0 === i && ((i = new n.LinearInterpolant(new Float32Array(2), new Float32Array(2), 1, this._controlInterpolantsResultBuffer)), (i.__cacheIndex = t), (e[t] = i)), i
  43195. },
  43196. _takeBackControlInterpolant: function (e) {
  43197. var t = this._controlInterpolants,
  43198. i = e.__cacheIndex,
  43199. n = --this._nActiveControlInterpolants,
  43200. r = t[n]
  43201. ;(e.__cacheIndex = n), (t[n] = e), (r.__cacheIndex = i), (t[i] = r)
  43202. },
  43203. _controlInterpolantsResultBuffer: new Float32Array(1)
  43204. }),
  43205. (n.AnimationObjectGroup = function (e) {
  43206. ;(this.uuid = n.Math.generateUUID()), (this._objects = Array.prototype.slice.call(arguments)), (this.nCachedObjects_ = 0)
  43207. var t = {}
  43208. this._indicesByUUID = t
  43209. for (var i = 0, r = arguments.length; i !== r; ++i) t[arguments[i].uuid] = i
  43210. ;(this._paths = []), (this._parsedPaths = []), (this._bindings = []), (this._bindingsIndicesByPath = {})
  43211. var o = this
  43212. this.stats = {
  43213. objects: {
  43214. get total() {
  43215. return o._objects.length
  43216. },
  43217. get inUse() {
  43218. return this.total - o.nCachedObjects_
  43219. }
  43220. },
  43221. get bindingsPerObject() {
  43222. return o._bindings.length
  43223. }
  43224. }
  43225. }),
  43226. (n.AnimationObjectGroup.prototype = {
  43227. constructor: n.AnimationObjectGroup,
  43228. add: function (e) {
  43229. for (
  43230. var t = this._objects,
  43231. i = t.length,
  43232. r = this.nCachedObjects_,
  43233. o = this._indicesByUUID,
  43234. a = this._paths,
  43235. s = this._parsedPaths,
  43236. l = this._bindings,
  43237. c = l.length,
  43238. h = 0,
  43239. u = arguments.length;
  43240. h !== u;
  43241. ++h
  43242. ) {
  43243. var d = arguments[h],
  43244. p = d.uuid,
  43245. f = o[p]
  43246. if (void 0 === f) {
  43247. ;(f = i++), (o[p] = f), t.push(d)
  43248. for (var g = 0, m = c; g !== m; ++g) l[g].push(new n.PropertyBinding(d, a[g], s[g]))
  43249. } else if (f < r) {
  43250. var v = t[f],
  43251. A = --r,
  43252. y = t[A]
  43253. ;(o[y.uuid] = f), (t[f] = y), (o[p] = A), (t[A] = d)
  43254. for (var g = 0, m = c; g !== m; ++g) {
  43255. var C = l[g],
  43256. I = C[A],
  43257. E = C[f]
  43258. ;(C[f] = I), void 0 === E && (E = new n.PropertyBinding(d, a[g], s[g])), (C[A] = E)
  43259. }
  43260. } else t[f] !== v && console.error('Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...')
  43261. }
  43262. this.nCachedObjects_ = r
  43263. },
  43264. remove: function (e) {
  43265. for (var t = this._objects, i = (t.length, this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43266. var l = arguments[a],
  43267. c = l.uuid,
  43268. h = n[c]
  43269. if (void 0 !== h && h >= i) {
  43270. var u = i++,
  43271. d = t[u]
  43272. ;(n[d.uuid] = h), (t[h] = d), (n[c] = u), (t[u] = l)
  43273. for (var p = 0, f = o; p !== f; ++p) {
  43274. var g = r[p],
  43275. m = g[u],
  43276. v = g[h]
  43277. ;(g[h] = m), (g[u] = v)
  43278. }
  43279. }
  43280. }
  43281. this.nCachedObjects_ = i
  43282. },
  43283. uncache: function (e) {
  43284. for (var t = this._objects, i = t.length, n = this.nCachedObjects_, r = this._indicesByUUID, o = this._bindings, a = o.length, s = 0, l = arguments.length; s !== l; ++s) {
  43285. var c = arguments[s],
  43286. h = c.uuid,
  43287. u = r[h]
  43288. if (void 0 !== u)
  43289. if ((delete r[h], u < n)) {
  43290. var d = --n,
  43291. p = t[d],
  43292. f = --i,
  43293. g = t[f]
  43294. ;(r[p.uuid] = u), (t[u] = p), (r[g.uuid] = d), (t[d] = g), t.pop()
  43295. for (var m = 0, v = a; m !== v; ++m) {
  43296. var A = o[m],
  43297. y = A[d],
  43298. C = A[f]
  43299. ;(A[u] = y), (A[d] = C), A.pop()
  43300. }
  43301. } else {
  43302. var f = --i,
  43303. g = t[f]
  43304. ;(r[g.uuid] = u), (t[u] = g), t.pop()
  43305. for (var m = 0, v = a; m !== v; ++m) {
  43306. var A = o[m]
  43307. ;(A[u] = A[f]), A.pop()
  43308. }
  43309. }
  43310. }
  43311. this.nCachedObjects_ = n
  43312. },
  43313. subscribe_: function (e, t) {
  43314. var i = this._bindingsIndicesByPath,
  43315. r = i[e],
  43316. o = this._bindings
  43317. if (void 0 !== r) return o[r]
  43318. var a = this._paths,
  43319. s = this._parsedPaths,
  43320. l = this._objects,
  43321. c = l.length,
  43322. h = this.nCachedObjects_,
  43323. u = new Array(c)
  43324. ;(r = o.length), (i[e] = r), a.push(e), s.push(t), o.push(u)
  43325. for (var d = h, p = l.length; d !== p; ++d) {
  43326. var f = l[d]
  43327. u[d] = new n.PropertyBinding(f, e, t)
  43328. }
  43329. return u
  43330. },
  43331. unsubscribe_: function (e) {
  43332. var t = this._bindingsIndicesByPath,
  43333. i = t[e]
  43334. if (void 0 !== i) {
  43335. var n = this._paths,
  43336. r = this._parsedPaths,
  43337. o = this._bindings,
  43338. a = o.length - 1,
  43339. s = o[a],
  43340. l = e[a]
  43341. ;(t[l] = i), (o[i] = s), o.pop(), (r[i] = r[a]), r.pop(), (n[i] = n[a]), n.pop()
  43342. }
  43343. }
  43344. }),
  43345. (n.AnimationUtils = {
  43346. arraySlice: function (e, t, i) {
  43347. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  43348. },
  43349. convertArray: function (e, t, i) {
  43350. return !e || (!i && e.constructor === t) ? e : 'number' == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  43351. },
  43352. isTypedArray: function (e) {
  43353. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  43354. },
  43355. getKeyframeOrder: function (e) {
  43356. function t(t, i) {
  43357. return e[t] - e[i]
  43358. }
  43359. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r) n[r] = r
  43360. return n.sort(t), n
  43361. },
  43362. sortedArray: function (e, t, i) {
  43363. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o) for (var s = i[o] * t, l = 0; l !== t; ++l) r[a++] = e[s + l]
  43364. return r
  43365. },
  43366. flattenJSON: function (e, t, i, n) {
  43367. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; ) o = e[r++]
  43368. if (void 0 !== o) {
  43369. var a = o[n]
  43370. if (void 0 !== a)
  43371. if (Array.isArray(a)) {
  43372. do (a = o[n]), void 0 !== a && (t.push(o.time), i.push.apply(i, a)), (o = e[r++])
  43373. while (void 0 !== o)
  43374. } else if (void 0 !== a.toArray) {
  43375. do (a = o[n]), void 0 !== a && (t.push(o.time), a.toArray(i, i.length)), (o = e[r++])
  43376. while (void 0 !== o)
  43377. } else
  43378. do (a = o[n]), void 0 !== a && (t.push(o.time), i.push(a)), (o = e[r++])
  43379. while (void 0 !== o)
  43380. }
  43381. }
  43382. }),
  43383. (n.KeyframeTrack = function (e, t, i, r) {
  43384. if (void 0 === e) throw new Error('track name is undefined')
  43385. if (void 0 === t || 0 === t.length) throw new Error('no keyframes in track named ' + e)
  43386. ;(this.name = e),
  43387. (this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType)),
  43388. (this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType)),
  43389. this.setInterpolation(r || this.DefaultInterpolation),
  43390. this.validate(),
  43391. this.optimize()
  43392. }),
  43393. (n.KeyframeTrack.prototype = {
  43394. constructor: n.KeyframeTrack,
  43395. TimeBufferType: Float32Array,
  43396. ValueBufferType: Float32Array,
  43397. DefaultInterpolation: n.InterpolateLinear,
  43398. InterpolantFactoryMethodDiscrete: function (e) {
  43399. return new n.DiscreteInterpolant(this.times, this.values, this.getValueSize(), e)
  43400. },
  43401. InterpolantFactoryMethodLinear: function (e) {
  43402. return new n.LinearInterpolant(this.times, this.values, this.getValueSize(), e)
  43403. },
  43404. InterpolantFactoryMethodSmooth: function (e) {
  43405. return new n.CubicInterpolant(this.times, this.values, this.getValueSize(), e)
  43406. },
  43407. setInterpolation: function (e) {
  43408. var t = void 0
  43409. switch (e) {
  43410. case n.InterpolateDiscrete:
  43411. t = this.InterpolantFactoryMethodDiscrete
  43412. break
  43413. case n.InterpolateLinear:
  43414. t = this.InterpolantFactoryMethodLinear
  43415. break
  43416. case n.InterpolateSmooth:
  43417. t = this.InterpolantFactoryMethodSmooth
  43418. }
  43419. if (void 0 === t) {
  43420. var i = 'unsupported interpolation for ' + this.ValueTypeName + ' keyframe track named ' + this.name
  43421. if (void 0 === this.createInterpolant) {
  43422. if (e === this.DefaultInterpolation) throw new Error(i)
  43423. this.setInterpolation(this.DefaultInterpolation)
  43424. }
  43425. return void console.warn(i)
  43426. }
  43427. this.createInterpolant = t
  43428. },
  43429. getInterpolation: function () {
  43430. switch (this.createInterpolant) {
  43431. case this.InterpolantFactoryMethodDiscrete:
  43432. return n.InterpolateDiscrete
  43433. case this.InterpolantFactoryMethodLinear:
  43434. return n.InterpolateLinear
  43435. case this.InterpolantFactoryMethodSmooth:
  43436. return n.InterpolateSmooth
  43437. }
  43438. },
  43439. getValueSize: function () {
  43440. return this.values.length / this.times.length
  43441. },
  43442. shift: function (e) {
  43443. if (0 !== e) for (var t = this.times, i = 0, n = t.length; i !== n; ++i) t[i] += e
  43444. return this
  43445. },
  43446. scale: function (e) {
  43447. if (1 !== e) for (var t = this.times, i = 0, n = t.length; i !== n; ++i) t[i] *= e
  43448. return this
  43449. },
  43450. trim: function (e, t) {
  43451. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; ) ++o
  43452. for (; a !== -1 && i[a] > t; ) --a
  43453. if ((++a, 0 !== o || a !== r)) {
  43454. o >= a && ((a = Math.max(a, 1)), (o = a - 1))
  43455. var s = this.getValueSize()
  43456. ;(this.times = n.AnimationUtils.arraySlice(i, o, a)), (this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s))
  43457. }
  43458. return this
  43459. },
  43460. validate: function () {
  43461. var e = !0,
  43462. t = this.getValueSize()
  43463. t - Math.floor(t) !== 0 && (console.error('invalid value size in track', this), (e = !1))
  43464. var i = this.times,
  43465. r = this.values,
  43466. o = i.length
  43467. 0 === o && (console.error('track is empty', this), (e = !1))
  43468. for (var a = null, s = 0; s !== o; s++) {
  43469. var l = i[s]
  43470. if ('number' == typeof l && isNaN(l)) {
  43471. console.error('time is not a valid number', this, s, l), (e = !1)
  43472. break
  43473. }
  43474. if (null !== a && a > l) {
  43475. console.error('out of order keys', this, s, l, a), (e = !1)
  43476. break
  43477. }
  43478. a = l
  43479. }
  43480. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  43481. for (var s = 0, c = r.length; s !== c; ++s) {
  43482. var h = r[s]
  43483. if (isNaN(h)) {
  43484. console.error('value is not a valid number', this, s, h), (e = !1)
  43485. break
  43486. }
  43487. }
  43488. return e
  43489. },
  43490. optimize: function () {
  43491. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  43492. var s = !1,
  43493. l = e[o],
  43494. c = e[o + 1]
  43495. if (l !== c && (1 !== o || l !== l[0]))
  43496. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  43497. var f = t[h + p]
  43498. if (f !== t[u + p] || f !== t[d + p]) {
  43499. s = !0
  43500. break
  43501. }
  43502. }
  43503. if (s) {
  43504. if (o !== r) {
  43505. e[r] = e[o]
  43506. for (var g = o * i, m = r * i, p = 0; p !== i; ++p) t[m + p] = t[g + p]
  43507. }
  43508. ++r
  43509. }
  43510. }
  43511. return r !== e.length && ((this.times = n.AnimationUtils.arraySlice(e, 0, r)), (this.values = n.AnimationUtils.arraySlice(t, 0, r * i))), this
  43512. }
  43513. }),
  43514. Object.assign(n.KeyframeTrack, {
  43515. parse: function (e) {
  43516. if (void 0 === e.type) throw new Error('track type undefined, can not parse')
  43517. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type)
  43518. if (void 0 === e.times) {
  43519. console.warn('legacy JSON format detected, converting')
  43520. var i = [],
  43521. r = []
  43522. n.AnimationUtils.flattenJSON(e.keys, i, r, 'value'), (e.times = i), (e.values = r)
  43523. }
  43524. return void 0 !== t.parse ? t.parse(e) : new t(e.name, e.times, e.values, e.interpolation)
  43525. },
  43526. toJSON: function (e) {
  43527. var t,
  43528. i = e.constructor
  43529. if (void 0 !== i.toJSON) t = i.toJSON(e)
  43530. else {
  43531. t = {
  43532. name: e.name,
  43533. times: n.AnimationUtils.convertArray(e.times, Array),
  43534. values: n.AnimationUtils.convertArray(e.values, Array)
  43535. }
  43536. var r = e.getInterpolation()
  43537. r !== e.DefaultInterpolation && (t.interpolation = r)
  43538. }
  43539. return (t.type = e.ValueTypeName), t
  43540. },
  43541. _getTrackTypeForValueTypeName: function (e) {
  43542. switch (e.toLowerCase()) {
  43543. case 'scalar':
  43544. case 'double':
  43545. case 'float':
  43546. case 'number':
  43547. case 'integer':
  43548. return n.NumberKeyframeTrack
  43549. case 'vector':
  43550. case 'vector2':
  43551. case 'vector3':
  43552. case 'vector4':
  43553. return n.VectorKeyframeTrack
  43554. case 'color':
  43555. return n.ColorKeyframeTrack
  43556. case 'quaternion':
  43557. return n.QuaternionKeyframeTrack
  43558. case 'bool':
  43559. case 'boolean':
  43560. return n.BooleanKeyframeTrack
  43561. case 'string':
  43562. return n.StringKeyframeTrack
  43563. }
  43564. throw new Error('Unsupported typeName: ' + e)
  43565. }
  43566. }),
  43567. (n.PropertyBinding = function (e, t, i) {
  43568. ;(this.path = t), (this.parsedPath = i || n.PropertyBinding.parseTrackName(t)), (this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e), (this.rootNode = e)
  43569. }),
  43570. (n.PropertyBinding.prototype = {
  43571. constructor: n.PropertyBinding,
  43572. getValue: function (e, t) {
  43573. this.bind(), this.getValue(e, t)
  43574. },
  43575. setValue: function (e, t) {
  43576. this.bind(), this.setValue(e, t)
  43577. },
  43578. bind: function () {
  43579. var e = this.node,
  43580. t = this.parsedPath,
  43581. i = t.objectName,
  43582. r = t.propertyName,
  43583. o = t.propertyIndex
  43584. if (
  43585. (e || ((e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode), (this.node = e)),
  43586. (this.getValue = this._getValue_unavailable),
  43587. (this.setValue = this._setValue_unavailable),
  43588. !e)
  43589. )
  43590. return void console.error(' trying to update node for track: ' + this.path + " but it wasn't found.")
  43591. if (i) {
  43592. var a = t.objectIndex
  43593. switch (i) {
  43594. case 'materials':
  43595. if (!e.material) return void console.error(' can not bind to material as node does not have a material', this)
  43596. if (!e.material.materials) return void console.error(' can not bind to material.materials as node.material does not have a materials array', this)
  43597. e = e.material.materials
  43598. break
  43599. case 'bones':
  43600. if (!e.skeleton) return void console.error(' can not bind to bones as node does not have a skeleton', this)
  43601. e = e.skeleton.bones
  43602. for (var s = 0; s < e.length; s++)
  43603. if (e[s].name === a) {
  43604. a = s
  43605. break
  43606. }
  43607. break
  43608. default:
  43609. if (void 0 === e[i]) return void console.error(' can not bind to objectName of node, undefined', this)
  43610. e = e[i]
  43611. }
  43612. if (void 0 !== a) {
  43613. if (void 0 === e[a]) return void console.error(' trying to bind to objectIndex of objectName, but is undefined:', this, e)
  43614. e = e[a]
  43615. }
  43616. }
  43617. var l = e[r]
  43618. if (!l) {
  43619. var c = t.nodeName
  43620. return void console.error(' trying to update property for track: ' + c + '.' + r + " but it wasn't found.", e)
  43621. }
  43622. var h = this.Versioning.None
  43623. void 0 !== e.needsUpdate
  43624. ? ((h = this.Versioning.NeedsUpdate), (this.targetObject = e))
  43625. : void 0 !== e.matrixWorldNeedsUpdate && ((h = this.Versioning.MatrixWorldNeedsUpdate), (this.targetObject = e))
  43626. var u = this.BindingType.Direct
  43627. if (void 0 !== o) {
  43628. if ('morphTargetInfluences' === r) {
  43629. if (!e.geometry) return void console.error(' can not bind to morphTargetInfluences becasuse node does not have a geometry', this)
  43630. if (!e.geometry.morphTargets) return void console.error(' can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets', this)
  43631. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  43632. if (e.geometry.morphTargets[s].name === o) {
  43633. o = s
  43634. break
  43635. }
  43636. }
  43637. ;(u = this.BindingType.ArrayElement), (this.resolvedProperty = l), (this.propertyIndex = o)
  43638. } else
  43639. void 0 !== l.fromArray && void 0 !== l.toArray
  43640. ? ((u = this.BindingType.HasFromToArray), (this.resolvedProperty = l))
  43641. : void 0 !== l.length
  43642. ? ((u = this.BindingType.EntireArray), (this.resolvedProperty = l))
  43643. : (this.propertyName = r)
  43644. ;(this.getValue = this.GetterByBindingType[u]), (this.setValue = this.SetterByBindingTypeAndVersioning[u][h])
  43645. },
  43646. unbind: function () {
  43647. ;(this.node = null), (this.getValue = this._getValue_unbound), (this.setValue = this._setValue_unbound)
  43648. }
  43649. }),
  43650. Object.assign(n.PropertyBinding.prototype, {
  43651. _getValue_unavailable: function () {},
  43652. _setValue_unavailable: function () {},
  43653. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  43654. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  43655. BindingType: {
  43656. Direct: 0,
  43657. EntireArray: 1,
  43658. ArrayElement: 2,
  43659. HasFromToArray: 3
  43660. },
  43661. Versioning: {
  43662. None: 0,
  43663. NeedsUpdate: 1,
  43664. MatrixWorldNeedsUpdate: 2
  43665. },
  43666. GetterByBindingType: [
  43667. function (e, t) {
  43668. e[t] = this.node[this.propertyName]
  43669. },
  43670. function (e, t) {
  43671. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n) e[t++] = i[n]
  43672. },
  43673. function (e, t) {
  43674. e[t] = this.resolvedProperty[this.propertyIndex]
  43675. },
  43676. function (e, t) {
  43677. this.resolvedProperty.toArray(e, t)
  43678. }
  43679. ],
  43680. SetterByBindingTypeAndVersioning: [
  43681. [
  43682. function (e, t) {
  43683. this.node[this.propertyName] = e[t]
  43684. },
  43685. function (e, t) {
  43686. ;(this.node[this.propertyName] = e[t]), (this.targetObject.needsUpdate = !0)
  43687. },
  43688. function (e, t) {
  43689. ;(this.node[this.propertyName] = e[t]), (this.targetObject.matrixWorldNeedsUpdate = !0)
  43690. }
  43691. ],
  43692. [
  43693. function (e, t) {
  43694. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n) i[n] = e[t++]
  43695. },
  43696. function (e, t) {
  43697. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n) i[n] = e[t++]
  43698. this.targetObject.needsUpdate = !0
  43699. },
  43700. function (e, t) {
  43701. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n) i[n] = e[t++]
  43702. this.targetObject.matrixWorldNeedsUpdate = !0
  43703. }
  43704. ],
  43705. [
  43706. function (e, t) {
  43707. this.resolvedProperty[this.propertyIndex] = e[t]
  43708. },
  43709. function (e, t) {
  43710. ;(this.resolvedProperty[this.propertyIndex] = e[t]), (this.targetObject.needsUpdate = !0)
  43711. },
  43712. function (e, t) {
  43713. ;(this.resolvedProperty[this.propertyIndex] = e[t]), (this.targetObject.matrixWorldNeedsUpdate = !0)
  43714. }
  43715. ],
  43716. [
  43717. function (e, t) {
  43718. this.resolvedProperty.fromArray(e, t)
  43719. },
  43720. function (e, t) {
  43721. this.resolvedProperty.fromArray(e, t), (this.targetObject.needsUpdate = !0)
  43722. },
  43723. function (e, t) {
  43724. this.resolvedProperty.fromArray(e, t), (this.targetObject.matrixWorldNeedsUpdate = !0)
  43725. }
  43726. ]
  43727. ]
  43728. }),
  43729. (n.PropertyBinding.Composite = function (e, t, i) {
  43730. var r = i || n.PropertyBinding.parseTrackName(t)
  43731. ;(this._targetGroup = e), (this._bindings = e.subscribe_(t, r))
  43732. }),
  43733. (n.PropertyBinding.Composite.prototype = {
  43734. constructor: n.PropertyBinding.Composite,
  43735. getValue: function (e, t) {
  43736. this.bind()
  43737. var i = this._targetGroup.nCachedObjects_,
  43738. n = this._bindings[i]
  43739. void 0 !== n && n.getValue(e, t)
  43740. },
  43741. setValue: function (e, t) {
  43742. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n) i[n].setValue(e, t)
  43743. },
  43744. bind: function () {
  43745. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t) e[t].bind()
  43746. },
  43747. unbind: function () {
  43748. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t) e[t].unbind()
  43749. }
  43750. }),
  43751. (n.PropertyBinding.create = function (e, t, i) {
  43752. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e, t, i) : new n.PropertyBinding(e, t, i)
  43753. }),
  43754. (n.PropertyBinding.parseTrackName = function (e) {
  43755. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/,
  43756. i = t.exec(e)
  43757. if (!i) throw new Error('cannot parse trackName at all: ' + e)
  43758. i.index === t.lastIndex && t.lastIndex++
  43759. var n = {
  43760. nodeName: i[3],
  43761. objectName: i[5],
  43762. objectIndex: i[7],
  43763. propertyName: i[9],
  43764. propertyIndex: i[11]
  43765. }
  43766. if (null === n.propertyName || 0 === n.propertyName.length) throw new Error('can not parse propertyName from trackName: ' + e)
  43767. return n
  43768. }),
  43769. (n.PropertyBinding.findNode = function (e, t) {
  43770. if (!t || '' === t || 'root' === t || '.' === t || t === -1 || t === e.name || t === e.uuid) return e
  43771. if (e.skeleton) {
  43772. var i = function (e) {
  43773. for (var i = 0; i < e.bones.length; i++) {
  43774. var n = e.bones[i]
  43775. if (n.name === t) return n
  43776. }
  43777. return null
  43778. },
  43779. n = i(e.skeleton)
  43780. if (n) return n
  43781. }
  43782. if (e.children) {
  43783. var r = function (e) {
  43784. for (var i = 0; i < e.length; i++) {
  43785. var n = e[i]
  43786. if (n.name === t || n.uuid === t) return n
  43787. var o = r(n.children)
  43788. if (o) return o
  43789. }
  43790. return null
  43791. },
  43792. o = r(e.children)
  43793. if (o) return o
  43794. }
  43795. return null
  43796. }),
  43797. (n.PropertyMixer = function (e, t, i) {
  43798. ;(this.binding = e), (this.valueSize = i)
  43799. var n,
  43800. r = Float64Array
  43801. switch (t) {
  43802. case 'quaternion':
  43803. n = this._slerp
  43804. break
  43805. case 'string':
  43806. case 'bool':
  43807. ;(r = Array), (n = this._select)
  43808. break
  43809. default:
  43810. n = this._lerp
  43811. }
  43812. ;(this.buffer = new r(4 * i)), (this._mixBufferRegion = n), (this.cumulativeWeight = 0), (this.useCount = 0), (this.referenceCount = 0)
  43813. }),
  43814. (n.PropertyMixer.prototype = {
  43815. constructor: n.PropertyMixer,
  43816. accumulate: function (e, t) {
  43817. var i = this.buffer,
  43818. n = this.valueSize,
  43819. r = e * n + n,
  43820. o = this.cumulativeWeight
  43821. if (0 === o) {
  43822. for (var a = 0; a !== n; ++a) i[r + a] = i[a]
  43823. o = t
  43824. } else {
  43825. o += t
  43826. var s = t / o
  43827. this._mixBufferRegion(i, r, 0, s, n)
  43828. }
  43829. this.cumulativeWeight = o
  43830. },
  43831. apply: function (e) {
  43832. var t = this.valueSize,
  43833. i = this.buffer,
  43834. n = e * t + t,
  43835. r = this.cumulativeWeight,
  43836. o = this.binding
  43837. if (((this.cumulativeWeight = 0), r < 1)) {
  43838. var a = 3 * t
  43839. this._mixBufferRegion(i, n, a, 1 - r, t)
  43840. }
  43841. for (var s = t, l = t + t; s !== l; ++s)
  43842. if (i[s] !== i[s + t]) {
  43843. o.setValue(i, n)
  43844. break
  43845. }
  43846. },
  43847. saveOriginalState: function () {
  43848. var e = this.binding,
  43849. t = this.buffer,
  43850. i = this.valueSize,
  43851. n = 3 * i
  43852. e.getValue(t, n)
  43853. for (var r = i, o = n; r !== o; ++r) t[r] = t[n + (r % i)]
  43854. this.cumulativeWeight = 0
  43855. },
  43856. restoreOriginalState: function () {
  43857. var e = 3 * this.valueSize
  43858. this.binding.setValue(this.buffer, e)
  43859. },
  43860. _select: function (e, t, i, n, r) {
  43861. if (n >= 0.5) for (var o = 0; o !== r; ++o) e[t + o] = e[i + o]
  43862. },
  43863. _slerp: function (e, t, i, r, o) {
  43864. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  43865. },
  43866. _lerp: function (e, t, i, n, r) {
  43867. for (var o = 1 - n, a = 0; a !== r; ++a) {
  43868. var s = t + a
  43869. e[s] = e[s] * o + e[i + a] * n
  43870. }
  43871. }
  43872. }),
  43873. (n.BooleanKeyframeTrack = function (e, t, i) {
  43874. n.KeyframeTrack.call(this, e, t, i)
  43875. }),
  43876. (n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  43877. constructor: n.BooleanKeyframeTrack,
  43878. ValueTypeName: 'bool',
  43879. ValueBufferType: Array,
  43880. DefaultInterpolation: n.IntepolateDiscrete,
  43881. InterpolantFactoryMethodLinear: void 0,
  43882. InterpolantFactoryMethodSmooth: void 0
  43883. })),
  43884. (n.NumberKeyframeTrack = function (e, t, i, r) {
  43885. n.KeyframeTrack.call(this, e, t, i, r)
  43886. }),
  43887. (n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  43888. constructor: n.NumberKeyframeTrack,
  43889. ValueTypeName: 'number'
  43890. })),
  43891. (n.QuaternionKeyframeTrack = function (e, t, i, r) {
  43892. n.KeyframeTrack.call(this, e, t, i, r)
  43893. }),
  43894. (n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  43895. constructor: n.QuaternionKeyframeTrack,
  43896. ValueTypeName: 'quaternion',
  43897. DefaultInterpolation: n.InterpolateLinear,
  43898. InterpolantFactoryMethodLinear: function (e) {
  43899. return new n.QuaternionLinearInterpolant(this.times, this.values, this.getValueSize(), e)
  43900. },
  43901. InterpolantFactoryMethodSmooth: void 0
  43902. })),
  43903. (n.StringKeyframeTrack = function (e, t, i, r) {
  43904. n.KeyframeTrack.call(this, e, t, i, r)
  43905. }),
  43906. (n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  43907. constructor: n.StringKeyframeTrack,
  43908. ValueTypeName: 'string',
  43909. ValueBufferType: Array,
  43910. DefaultInterpolation: n.IntepolateDiscrete,
  43911. InterpolantFactoryMethodLinear: void 0,
  43912. InterpolantFactoryMethodSmooth: void 0
  43913. })),
  43914. (n.VectorKeyframeTrack = function (e, t, i, r) {
  43915. n.KeyframeTrack.call(this, e, t, i, r)
  43916. }),
  43917. (n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  43918. constructor: n.VectorKeyframeTrack,
  43919. ValueTypeName: 'vector'
  43920. })),
  43921. (n.Audio = function (e) {
  43922. n.Object3D.call(this),
  43923. (this.type = 'Audio'),
  43924. (this.context = e.context),
  43925. (this.source = this.context.createBufferSource()),
  43926. (this.source.onended = this.onEnded.bind(this)),
  43927. (this.gain = this.context.createGain()),
  43928. this.gain.connect(e.getInput()),
  43929. (this.autoplay = !1),
  43930. (this.startTime = 0),
  43931. (this.playbackRate = 1),
  43932. (this.isPlaying = !1),
  43933. (this.hasPlaybackControl = !0),
  43934. (this.sourceType = 'empty'),
  43935. (this.filter = null)
  43936. }),
  43937. (n.Audio.prototype = Object.create(n.Object3D.prototype)),
  43938. (n.Audio.prototype.constructor = n.Audio),
  43939. (n.Audio.prototype.getOutput = function () {
  43940. return this.gain
  43941. }),
  43942. (n.Audio.prototype.load = function (e) {
  43943. var t = new n.AudioBuffer(this.context)
  43944. return t.load(e), this.setBuffer(t), this
  43945. }),
  43946. (n.Audio.prototype.setNodeSource = function (e) {
  43947. return (this.hasPlaybackControl = !1), (this.sourceType = 'audioNode'), (this.source = e), this.connect(), this
  43948. }),
  43949. (n.Audio.prototype.setBuffer = function (e) {
  43950. var t = this
  43951. return (
  43952. e.onReady(function (e) {
  43953. ;(t.source.buffer = e), (t.sourceType = 'buffer'), t.autoplay && t.play()
  43954. }),
  43955. this
  43956. )
  43957. }),
  43958. (n.Audio.prototype.play = function () {
  43959. if (this.isPlaying === !0) return void console.warn('THREE.Audio: Audio is already playing.')
  43960. if (this.hasPlaybackControl === !1) return void console.warn('THREE.Audio: this Audio has no playback control.')
  43961. var e = this.context.createBufferSource()
  43962. ;(e.buffer = this.source.buffer),
  43963. (e.loop = this.source.loop),
  43964. (e.onended = this.source.onended),
  43965. e.start(0, this.startTime),
  43966. (e.playbackRate.value = this.playbackRate),
  43967. (this.isPlaying = !0),
  43968. (this.source = e),
  43969. this.connect()
  43970. }),
  43971. (n.Audio.prototype.pause = function () {
  43972. return this.hasPlaybackControl === !1 ? void console.warn('THREE.Audio: this Audio has no playback control.') : (this.source.stop(), void (this.startTime = this.context.currentTime))
  43973. }),
  43974. (n.Audio.prototype.stop = function () {
  43975. return this.hasPlaybackControl === !1 ? void console.warn('THREE.Audio: this Audio has no playback control.') : (this.source.stop(), void (this.startTime = 0))
  43976. }),
  43977. (n.Audio.prototype.connect = function () {
  43978. null !== this.filter ? (this.source.connect(this.filter), this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  43979. }),
  43980. (n.Audio.prototype.disconnect = function () {
  43981. null !== this.filter ? (this.source.disconnect(this.filter), this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  43982. }),
  43983. (n.Audio.prototype.getFilter = function () {
  43984. return this.filter
  43985. }),
  43986. (n.Audio.prototype.setFilter = function (e) {
  43987. void 0 === e && (e = null), this.isPlaying === !0 ? (this.disconnect(), (this.filter = e), this.connect()) : (this.filter = e)
  43988. }),
  43989. (n.Audio.prototype.setPlaybackRate = function (e) {
  43990. return this.hasPlaybackControl === !1
  43991. ? void console.warn('THREE.Audio: this Audio has no playback control.')
  43992. : ((this.playbackRate = e), void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  43993. }),
  43994. (n.Audio.prototype.getPlaybackRate = function () {
  43995. return this.playbackRate
  43996. }),
  43997. (n.Audio.prototype.onEnded = function () {
  43998. this.isPlaying = !1
  43999. }),
  44000. (n.Audio.prototype.setLoop = function (e) {
  44001. return this.hasPlaybackControl === !1 ? void console.warn('THREE.Audio: this Audio has no playback control.') : void (this.source.loop = e)
  44002. }),
  44003. (n.Audio.prototype.getLoop = function () {
  44004. return this.hasPlaybackControl === !1 ? (console.warn('THREE.Audio: this Audio has no playback control.'), !1) : this.source.loop
  44005. }),
  44006. (n.Audio.prototype.setVolume = function (e) {
  44007. this.gain.gain.value = e
  44008. }),
  44009. (n.Audio.prototype.getVolume = function () {
  44010. return this.gain.gain.value
  44011. }),
  44012. (n.AudioAnalyser = function (e, t) {
  44013. ;(this.analyser = e.context.createAnalyser()),
  44014. (this.analyser.fftSize = void 0 !== t ? t : 2048),
  44015. (this.data = new Uint8Array(this.analyser.frequencyBinCount)),
  44016. e.getOutput().connect(this.analyser)
  44017. }),
  44018. (n.AudioAnalyser.prototype = {
  44019. constructor: n.AudioAnalyser,
  44020. getData: function () {
  44021. return this.analyser.getByteFrequencyData(this.data), this.data
  44022. }
  44023. }),
  44024. (n.AudioBuffer = function (e) {
  44025. ;(this.context = e), (this.ready = !1), (this.readyCallbacks = [])
  44026. }),
  44027. (n.AudioBuffer.prototype.load = function (e) {
  44028. var t = this,
  44029. i = new XMLHttpRequest()
  44030. return (
  44031. i.open('GET', e, !0),
  44032. (i.responseType = 'arraybuffer'),
  44033. (i.onload = function (e) {
  44034. t.context.decodeAudioData(this.response, function (e) {
  44035. ;(t.buffer = e), (t.ready = !0)
  44036. for (var i = 0; i < t.readyCallbacks.length; i++) t.readyCallbacks[i](t.buffer)
  44037. t.readyCallbacks = []
  44038. })
  44039. }),
  44040. i.send(),
  44041. this
  44042. )
  44043. }),
  44044. (n.AudioBuffer.prototype.onReady = function (e) {
  44045. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44046. }),
  44047. (n.PositionalAudio = function (e) {
  44048. n.Audio.call(this, e), (this.panner = this.context.createPanner()), this.panner.connect(this.gain)
  44049. }),
  44050. (n.PositionalAudio.prototype = Object.create(n.Audio.prototype)),
  44051. (n.PositionalAudio.prototype.constructor = n.PositionalAudio),
  44052. (n.PositionalAudio.prototype.getOutput = function () {
  44053. return this.panner
  44054. }),
  44055. (n.PositionalAudio.prototype.setRefDistance = function (e) {
  44056. this.panner.refDistance = e
  44057. }),
  44058. (n.PositionalAudio.prototype.getRefDistance = function () {
  44059. return this.panner.refDistance
  44060. }),
  44061. (n.PositionalAudio.prototype.setRolloffFactor = function (e) {
  44062. this.panner.rolloffFactor = e
  44063. }),
  44064. (n.PositionalAudio.prototype.getRolloffFactor = function () {
  44065. return this.panner.rolloffFactor
  44066. }),
  44067. (n.PositionalAudio.prototype.setDistanceModel = function (e) {
  44068. this.panner.distanceModel = e
  44069. }),
  44070. (n.PositionalAudio.prototype.getDistanceModel = function () {
  44071. return this.panner.distanceModel
  44072. }),
  44073. (n.PositionalAudio.prototype.setMaxDistance = function (e) {
  44074. this.panner.maxDistance = e
  44075. }),
  44076. (n.PositionalAudio.prototype.getMaxDistance = function () {
  44077. return this.panner.maxDistance
  44078. }),
  44079. (n.PositionalAudio.prototype.updateMatrixWorld = (function () {
  44080. var e = new n.Vector3()
  44081. return function (t) {
  44082. n.Object3D.prototype.updateMatrixWorld.call(this, t), e.setFromMatrixPosition(this.matrixWorld), this.panner.setPosition(e.x, e.y, e.z)
  44083. }
  44084. })()),
  44085. (n.AudioListener = function () {
  44086. n.Object3D.call(this),
  44087. (this.type = 'AudioListener'),
  44088. (this.context = new (window.AudioContext || window.webkitAudioContext)()),
  44089. (this.gain = this.context.createGain()),
  44090. this.gain.connect(this.context.destination),
  44091. (this.filter = null)
  44092. }),
  44093. (n.AudioListener.prototype = Object.create(n.Object3D.prototype)),
  44094. (n.AudioListener.prototype.constructor = n.AudioListener),
  44095. (n.AudioListener.prototype.getInput = function () {
  44096. return this.gain
  44097. }),
  44098. (n.AudioListener.prototype.removeFilter = function () {
  44099. null !== this.filter && (this.gain.disconnect(this.filter), this.filter.disconnect(this.context.destination), this.gain.connect(this.context.destination), (this.filter = null))
  44100. }),
  44101. (n.AudioListener.prototype.setFilter = function (e) {
  44102. null !== this.filter ? (this.gain.disconnect(this.filter), this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  44103. (this.filter = e),
  44104. this.gain.connect(this.filter),
  44105. this.filter.connect(this.context.destination)
  44106. }),
  44107. (n.AudioListener.prototype.getFilter = function () {
  44108. return this.filter
  44109. }),
  44110. (n.AudioListener.prototype.setMasterVolume = function (e) {
  44111. this.gain.gain.value = e
  44112. }),
  44113. (n.AudioListener.prototype.getMasterVolume = function () {
  44114. return this.gain.gain.value
  44115. }),
  44116. (n.AudioListener.prototype.updateMatrixWorld = (function () {
  44117. var e = new n.Vector3(),
  44118. t = new n.Quaternion(),
  44119. i = new n.Vector3(),
  44120. r = new n.Vector3()
  44121. return function (o) {
  44122. n.Object3D.prototype.updateMatrixWorld.call(this, o)
  44123. var a = this.context.listener,
  44124. s = this.up
  44125. this.matrixWorld.decompose(e, t, i), r.set(0, 0, -1).applyQuaternion(t), a.setPosition(e.x, e.y, e.z), a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  44126. }
  44127. })()),
  44128. (n.Camera = function () {
  44129. n.Object3D.call(this), (this.type = 'Camera'), (this.matrixWorldInverse = new n.Matrix4()), (this.projectionMatrix = new n.Matrix4())
  44130. }),
  44131. (n.Camera.prototype = Object.create(n.Object3D.prototype)),
  44132. (n.Camera.prototype.constructor = n.Camera),
  44133. (n.Camera.prototype.getWorldDirection = (function () {
  44134. var e = new n.Quaternion()
  44135. return function (t) {
  44136. var i = t || new n.Vector3()
  44137. return this.getWorldQuaternion(e), i.set(0, 0, -1).applyQuaternion(e)
  44138. }
  44139. })()),
  44140. (n.Camera.prototype.lookAt = (function () {
  44141. var e = new n.Matrix4()
  44142. return function (t) {
  44143. e.lookAt(this.position, t, this.up), this.quaternion.setFromRotationMatrix(e)
  44144. }
  44145. })()),
  44146. (n.Camera.prototype.clone = function () {
  44147. return new this.constructor().copy(this)
  44148. }),
  44149. (n.Camera.prototype.copy = function (e) {
  44150. return n.Object3D.prototype.copy.call(this, e), this.matrixWorldInverse.copy(e.matrixWorldInverse), this.projectionMatrix.copy(e.projectionMatrix), this
  44151. }),
  44152. (n.CubeCamera = function (e, t, i) {
  44153. n.Object3D.call(this), (this.type = 'CubeCamera')
  44154. var r = 90,
  44155. o = 1,
  44156. a = new n.PerspectiveCamera(r, o, e, t)
  44157. a.up.set(0, -1, 0), a.lookAt(new n.Vector3(1, 0, 0)), this.add(a)
  44158. var s = new n.PerspectiveCamera(r, o, e, t)
  44159. s.up.set(0, -1, 0), s.lookAt(new n.Vector3(-1, 0, 0)), this.add(s)
  44160. var l = new n.PerspectiveCamera(r, o, e, t)
  44161. l.up.set(0, 0, 1), l.lookAt(new n.Vector3(0, 1, 0)), this.add(l)
  44162. var c = new n.PerspectiveCamera(r, o, e, t)
  44163. c.up.set(0, 0, -1), c.lookAt(new n.Vector3(0, -1, 0)), this.add(c)
  44164. var h = new n.PerspectiveCamera(r, o, e, t)
  44165. h.up.set(0, -1, 0), h.lookAt(new n.Vector3(0, 0, 1)), this.add(h)
  44166. var u = new n.PerspectiveCamera(r, o, e, t)
  44167. u.up.set(0, -1, 0), u.lookAt(new n.Vector3(0, 0, -1)), this.add(u)
  44168. var d = {
  44169. format: n.RGBFormat,
  44170. magFilter: n.LinearFilter,
  44171. minFilter: n.LinearFilter
  44172. }
  44173. ;(this.renderTarget = new n.WebGLRenderTargetCube(i, i, d)),
  44174. (this.updateCubeMap = function (e, t) {
  44175. null === this.parent && this.updateMatrixWorld()
  44176. var i = this.renderTarget,
  44177. n = i.texture.generateMipmaps
  44178. ;(i.texture.generateMipmaps = !1),
  44179. (i.activeCubeFace = 0),
  44180. e.render(t, a, i),
  44181. (i.activeCubeFace = 1),
  44182. e.render(t, s, i),
  44183. (i.activeCubeFace = 2),
  44184. e.render(t, l, i),
  44185. (i.activeCubeFace = 3),
  44186. e.render(t, c, i),
  44187. (i.activeCubeFace = 4),
  44188. e.render(t, h, i),
  44189. (i.texture.generateMipmaps = n),
  44190. (i.activeCubeFace = 5),
  44191. e.render(t, u, i),
  44192. e.setRenderTarget(null)
  44193. })
  44194. }),
  44195. (n.CubeCamera.prototype = Object.create(n.Object3D.prototype)),
  44196. (n.CubeCamera.prototype.constructor = n.CubeCamera),
  44197. (n.OrthographicCamera = function (e, t, i, r, o, a) {
  44198. n.Camera.call(this),
  44199. (this.type = 'OrthographicCamera'),
  44200. (this.zoom = 1),
  44201. (this.left = e),
  44202. (this.right = t),
  44203. (this.top = i),
  44204. (this.bottom = r),
  44205. (this.near = void 0 !== o ? o : 0.1),
  44206. (this.far = void 0 !== a ? a : 2e3),
  44207. this.updateProjectionMatrix()
  44208. }),
  44209. (n.OrthographicCamera.prototype = Object.create(n.Camera.prototype)),
  44210. (n.OrthographicCamera.prototype.constructor = n.OrthographicCamera),
  44211. (n.OrthographicCamera.prototype.updateProjectionMatrix = function () {
  44212. var e = (this.right - this.left) / (2 * this.zoom),
  44213. t = (this.top - this.bottom) / (2 * this.zoom),
  44214. i = (this.right + this.left) / 2,
  44215. n = (this.top + this.bottom) / 2
  44216. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  44217. }),
  44218. (n.OrthographicCamera.prototype.copy = function (e) {
  44219. return (
  44220. n.Camera.prototype.copy.call(this, e),
  44221. (this.left = e.left),
  44222. (this.right = e.right),
  44223. (this.top = e.top),
  44224. (this.bottom = e.bottom),
  44225. (this.near = e.near),
  44226. (this.far = e.far),
  44227. (this.zoom = e.zoom),
  44228. this
  44229. )
  44230. }),
  44231. (n.OrthographicCamera.prototype.toJSON = function (e) {
  44232. var t = n.Object3D.prototype.toJSON.call(this, e)
  44233. return (
  44234. (t.object.zoom = this.zoom),
  44235. (t.object.left = this.left),
  44236. (t.object.right = this.right),
  44237. (t.object.top = this.top),
  44238. (t.object.bottom = this.bottom),
  44239. (t.object.near = this.near),
  44240. (t.object.far = this.far),
  44241. t
  44242. )
  44243. }),
  44244. (n.PerspectiveCamera = function (e, t, i, r) {
  44245. n.Camera.call(this),
  44246. (this.type = 'PerspectiveCamera'),
  44247. (this.focalLength = 10),
  44248. (this.zoom = 1),
  44249. (this.fov = void 0 !== e ? e : 50),
  44250. (this.aspect = void 0 !== t ? t : 1),
  44251. (this.near = void 0 !== i ? i : 0.1),
  44252. (this.far = void 0 !== r ? r : 2e3),
  44253. this.updateProjectionMatrix()
  44254. }),
  44255. (n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype)),
  44256. (n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera),
  44257. (n.PerspectiveCamera.prototype.setLens = function (e, t) {
  44258. void 0 === t && (t = 24), (this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e)))), this.updateProjectionMatrix()
  44259. }),
  44260. (n.PerspectiveCamera.prototype.setViewOffset = function (e, t, i, n, r, o) {
  44261. ;(this.fullWidth = e), (this.fullHeight = t), (this.x = i), (this.y = n), (this.width = r), (this.height = o), this.updateProjectionMatrix()
  44262. }),
  44263. (n.PerspectiveCamera.prototype.updateProjectionMatrix = function () {
  44264. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(0.5 * n.Math.degToRad(this.fov)) / this.zoom))
  44265. if (this.fullWidth) {
  44266. var t = this.fullWidth / this.fullHeight,
  44267. i = Math.tan(n.Math.degToRad(0.5 * e)) * this.near,
  44268. r = -i,
  44269. o = t * r,
  44270. a = t * i,
  44271. s = Math.abs(a - o),
  44272. l = Math.abs(i - r)
  44273. this.projectionMatrix.makeFrustum(
  44274. o + (this.x * s) / this.fullWidth,
  44275. o + ((this.x + this.width) * s) / this.fullWidth,
  44276. i - ((this.y + this.height) * l) / this.fullHeight,
  44277. i - (this.y * l) / this.fullHeight,
  44278. this.near,
  44279. this.far
  44280. )
  44281. } else this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  44282. }),
  44283. (n.PerspectiveCamera.prototype.copy = function (e) {
  44284. return (
  44285. n.Camera.prototype.copy.call(this, e),
  44286. (this.focalLength = e.focalLength),
  44287. (this.zoom = e.zoom),
  44288. (this.fov = e.fov),
  44289. (this.aspect = e.aspect),
  44290. (this.near = e.near),
  44291. (this.far = e.far),
  44292. this
  44293. )
  44294. }),
  44295. (n.PerspectiveCamera.prototype.toJSON = function (e) {
  44296. var t = n.Object3D.prototype.toJSON.call(this, e)
  44297. return (
  44298. (t.object.focalLength = this.focalLength),
  44299. (t.object.zoom = this.zoom),
  44300. (t.object.fov = this.fov),
  44301. (t.object.aspect = this.aspect),
  44302. (t.object.near = this.near),
  44303. (t.object.far = this.far),
  44304. t
  44305. )
  44306. }),
  44307. (n.StereoCamera = function () {
  44308. ;(this.type = 'StereoCamera'),
  44309. (this.aspect = 1),
  44310. (this.cameraL = new n.PerspectiveCamera()),
  44311. this.cameraL.layers.enable(1),
  44312. (this.cameraL.matrixAutoUpdate = !1),
  44313. (this.cameraR = new n.PerspectiveCamera()),
  44314. this.cameraR.layers.enable(2),
  44315. (this.cameraR.matrixAutoUpdate = !1)
  44316. }),
  44317. (n.StereoCamera.prototype = {
  44318. constructor: n.StereoCamera,
  44319. update: (function () {
  44320. var e,
  44321. t,
  44322. i,
  44323. r,
  44324. o,
  44325. a = new n.Matrix4(),
  44326. s = new n.Matrix4()
  44327. return function (l) {
  44328. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far
  44329. if (c) {
  44330. ;(e = l.focalLength), (t = l.fov), (i = l.aspect * this.aspect), (r = l.near), (o = l.far)
  44331. var h,
  44332. u,
  44333. d = l.projectionMatrix.clone(),
  44334. p = 0.032,
  44335. f = (p * r) / e,
  44336. g = r * Math.tan(n.Math.degToRad(0.5 * t))
  44337. ;(s.elements[12] = -p),
  44338. (a.elements[12] = p),
  44339. (h = -g * i + f),
  44340. (u = g * i + f),
  44341. (d.elements[0] = (2 * r) / (u - h)),
  44342. (d.elements[8] = (u + h) / (u - h)),
  44343. this.cameraL.projectionMatrix.copy(d),
  44344. (h = -g * i - f),
  44345. (u = g * i - f),
  44346. (d.elements[0] = (2 * r) / (u - h)),
  44347. (d.elements[8] = (u + h) / (u - h)),
  44348. this.cameraR.projectionMatrix.copy(d)
  44349. }
  44350. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s), this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  44351. }
  44352. })()
  44353. }),
  44354. (n.Light = function (e, t) {
  44355. n.Object3D.call(this), (this.type = 'Light'), (this.color = new n.Color(e)), (this.intensity = void 0 !== t ? t : 1), (this.receiveShadow = void 0)
  44356. }),
  44357. (n.Light.prototype = Object.create(n.Object3D.prototype)),
  44358. (n.Light.prototype.constructor = n.Light),
  44359. (n.Light.prototype.copy = function (e) {
  44360. return n.Object3D.prototype.copy.call(this, e), this.color.copy(e.color), (this.intensity = e.intensity), this
  44361. }),
  44362. (n.Light.prototype.toJSON = function (e) {
  44363. var t = n.Object3D.prototype.toJSON.call(this, e)
  44364. return (
  44365. (t.object.color = this.color.getHex()),
  44366. (t.object.intensity = this.intensity),
  44367. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  44368. void 0 !== this.distance && (t.object.distance = this.distance),
  44369. void 0 !== this.angle && (t.object.angle = this.angle),
  44370. void 0 !== this.decay && (t.object.decay = this.decay),
  44371. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  44372. t
  44373. )
  44374. }),
  44375. (n.LightShadow = function (e) {
  44376. ;(this.camera = e), (this.bias = 0), (this.radius = 1), (this.mapSize = new n.Vector2(512, 512)), (this.map = null), (this.matrix = new n.Matrix4())
  44377. }),
  44378. (n.LightShadow.prototype = {
  44379. constructor: n.LightShadow,
  44380. copy: function (e) {
  44381. return (this.camera = e.camera.clone()), (this.bias = e.bias), (this.radius = e.radius), this.mapSize.copy(e.mapSize), this
  44382. },
  44383. clone: function () {
  44384. return new this.constructor().copy(this)
  44385. }
  44386. }),
  44387. (n.AmbientLight = function (e, t) {
  44388. n.Light.call(this, e, t), (this.type = 'AmbientLight'), (this.castShadow = void 0)
  44389. }),
  44390. (n.AmbientLight.prototype = Object.create(n.Light.prototype)),
  44391. (n.AmbientLight.prototype.constructor = n.AmbientLight),
  44392. (n.DirectionalLight = function (e, t) {
  44393. n.Light.call(this, e, t),
  44394. (this.type = 'DirectionalLight'),
  44395. this.position.set(0, 1, 0),
  44396. this.updateMatrix(),
  44397. (this.target = new n.Object3D()),
  44398. (this.shadow = new n.LightShadow(new n.OrthographicCamera(-5, 5, 5, -5, 0.5, 500)))
  44399. }),
  44400. (n.DirectionalLight.prototype = Object.create(n.Light.prototype)),
  44401. (n.DirectionalLight.prototype.constructor = n.DirectionalLight),
  44402. (n.DirectionalLight.prototype.copy = function (e) {
  44403. return n.Light.prototype.copy.call(this, e), (this.target = e.target.clone()), (this.shadow = e.shadow.clone()), this
  44404. }),
  44405. (n.HemisphereLight = function (e, t, i) {
  44406. n.Light.call(this, e, i), (this.type = 'HemisphereLight'), (this.castShadow = void 0), this.position.set(0, 1, 0), this.updateMatrix(), (this.groundColor = new n.Color(t))
  44407. }),
  44408. (n.HemisphereLight.prototype = Object.create(n.Light.prototype)),
  44409. (n.HemisphereLight.prototype.constructor = n.HemisphereLight),
  44410. (n.HemisphereLight.prototype.copy = function (e) {
  44411. return n.Light.prototype.copy.call(this, e), this.groundColor.copy(e.groundColor), this
  44412. }),
  44413. (n.PointLight = function (e, t, i, r) {
  44414. n.Light.call(this, e, t),
  44415. (this.type = 'PointLight'),
  44416. (this.distance = void 0 !== i ? i : 0),
  44417. (this.decay = void 0 !== r ? r : 1),
  44418. (this.shadow = new n.LightShadow(new n.PerspectiveCamera(90, 1, 0.5, 500)))
  44419. }),
  44420. (n.PointLight.prototype = Object.create(n.Light.prototype)),
  44421. (n.PointLight.prototype.constructor = n.PointLight),
  44422. Object.defineProperty(n.PointLight.prototype, 'power', {
  44423. get: function () {
  44424. return 4 * this.intensity * Math.PI
  44425. },
  44426. set: function (e) {
  44427. this.intensity = e / (4 * Math.PI)
  44428. }
  44429. }),
  44430. (n.PointLight.prototype.copy = function (e) {
  44431. return n.Light.prototype.copy.call(this, e), (this.distance = e.distance), (this.decay = e.decay), (this.shadow = e.shadow.clone()), this
  44432. }),
  44433. (n.SpotLight = function (e, t, i, r, o, a) {
  44434. n.Light.call(this, e, t),
  44435. (this.type = 'SpotLight'),
  44436. this.position.set(0, 1, 0),
  44437. this.updateMatrix(),
  44438. (this.target = new n.Object3D()),
  44439. (this.distance = void 0 !== i ? i : 0),
  44440. (this.angle = void 0 !== r ? r : Math.PI / 3),
  44441. (this.penumbra = void 0 !== o ? o : 0),
  44442. (this.decay = void 0 !== a ? a : 1),
  44443. (this.shadow = new n.LightShadow(new n.PerspectiveCamera(50, 1, 0.5, 500)))
  44444. }),
  44445. (n.SpotLight.prototype = Object.create(n.Light.prototype)),
  44446. (n.SpotLight.prototype.constructor = n.SpotLight),
  44447. Object.defineProperty(n.SpotLight.prototype, 'power', {
  44448. get: function () {
  44449. return this.intensity * Math.PI
  44450. },
  44451. set: function (e) {
  44452. this.intensity = e / Math.PI
  44453. }
  44454. }),
  44455. (n.SpotLight.prototype.copy = function (e) {
  44456. return (
  44457. n.Light.prototype.copy.call(this, e),
  44458. (this.distance = e.distance),
  44459. (this.angle = e.angle),
  44460. (this.penumbra = e.penumbra),
  44461. (this.decay = e.decay),
  44462. (this.target = e.target.clone()),
  44463. (this.shadow = e.shadow.clone()),
  44464. this
  44465. )
  44466. }),
  44467. (n.Cache = {
  44468. enabled: !1,
  44469. files: {},
  44470. add: function (e, t) {
  44471. this.enabled !== !1 && (this.files[e] = t)
  44472. },
  44473. get: function (e) {
  44474. if (this.enabled !== !1) return this.files[e]
  44475. },
  44476. remove: function (e) {
  44477. delete this.files[e]
  44478. },
  44479. clear: function () {
  44480. this.files = {}
  44481. }
  44482. }),
  44483. (n.Loader = function () {
  44484. ;(this.onLoadStart = function () {}), (this.onLoadProgress = function () {}), (this.onLoadComplete = function () {})
  44485. }),
  44486. (n.Loader.prototype = {
  44487. constructor: n.Loader,
  44488. crossOrigin: void 0,
  44489. extractUrlBase: function (e) {
  44490. var t = e.split('/')
  44491. return 1 === t.length ? './' : (t.pop(), t.join('/') + '/')
  44492. },
  44493. initMaterials: function (e, t, i) {
  44494. for (var n = [], r = 0; r < e.length; ++r) n[r] = this.createMaterial(e[r], t, i)
  44495. return n
  44496. },
  44497. createMaterial: (function () {
  44498. var e, t, i
  44499. return function (r, o, a) {
  44500. function s(e, i, r, s, c) {
  44501. var h,
  44502. u = o + e,
  44503. d = n.Loader.Handlers.get(u)
  44504. null !== d ? (h = d.load(u)) : (t.setCrossOrigin(a), (h = t.load(u))),
  44505. void 0 !== i && (h.repeat.fromArray(i), 1 !== i[0] && (h.wrapS = n.RepeatWrapping), 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  44506. void 0 !== r && h.offset.fromArray(r),
  44507. void 0 !== s &&
  44508. ('repeat' === s[0] && (h.wrapS = n.RepeatWrapping),
  44509. 'mirror' === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  44510. 'repeat' === s[1] && (h.wrapT = n.RepeatWrapping),
  44511. 'mirror' === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  44512. void 0 !== c && (h.anisotropy = c)
  44513. var p = n.Math.generateUUID()
  44514. return (l[p] = h), p
  44515. }
  44516. void 0 === e && (e = new n.Color()), void 0 === t && (t = new n.TextureLoader()), void 0 === i && (i = new n.MaterialLoader())
  44517. var l = {},
  44518. c = {
  44519. uuid: n.Math.generateUUID(),
  44520. type: 'MeshLambertMaterial'
  44521. }
  44522. for (var h in r) {
  44523. var u = r[h]
  44524. switch (h) {
  44525. case 'DbgColor':
  44526. case 'DbgIndex':
  44527. case 'opticalDensity':
  44528. case 'illumination':
  44529. break
  44530. case 'DbgName':
  44531. c.name = u
  44532. break
  44533. case 'blending':
  44534. c.blending = n[u]
  44535. break
  44536. case 'colorAmbient':
  44537. case 'mapAmbient':
  44538. console.warn('THREE.Loader.createMaterial:', h, 'is no longer supported.')
  44539. break
  44540. case 'colorDiffuse':
  44541. c.color = e.fromArray(u).getHex()
  44542. break
  44543. case 'colorSpecular':
  44544. c.specular = e.fromArray(u).getHex()
  44545. break
  44546. case 'colorEmissive':
  44547. c.emissive = e.fromArray(u).getHex()
  44548. break
  44549. case 'specularCoef':
  44550. c.shininess = u
  44551. break
  44552. case 'shading':
  44553. 'basic' === u.toLowerCase() && (c.type = 'MeshBasicMaterial'), 'phong' === u.toLowerCase() && (c.type = 'MeshPhongMaterial')
  44554. break
  44555. case 'mapDiffuse':
  44556. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy)
  44557. break
  44558. case 'mapDiffuseRepeat':
  44559. case 'mapDiffuseOffset':
  44560. case 'mapDiffuseWrap':
  44561. case 'mapDiffuseAnisotropy':
  44562. break
  44563. case 'mapLight':
  44564. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy)
  44565. break
  44566. case 'mapLightRepeat':
  44567. case 'mapLightOffset':
  44568. case 'mapLightWrap':
  44569. case 'mapLightAnisotropy':
  44570. break
  44571. case 'mapAO':
  44572. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy)
  44573. break
  44574. case 'mapAORepeat':
  44575. case 'mapAOOffset':
  44576. case 'mapAOWrap':
  44577. case 'mapAOAnisotropy':
  44578. break
  44579. case 'mapBump':
  44580. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy)
  44581. break
  44582. case 'mapBumpScale':
  44583. c.bumpScale = u
  44584. break
  44585. case 'mapBumpRepeat':
  44586. case 'mapBumpOffset':
  44587. case 'mapBumpWrap':
  44588. case 'mapBumpAnisotropy':
  44589. break
  44590. case 'mapNormal':
  44591. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy)
  44592. break
  44593. case 'mapNormalFactor':
  44594. c.normalScale = [u, u]
  44595. break
  44596. case 'mapNormalRepeat':
  44597. case 'mapNormalOffset':
  44598. case 'mapNormalWrap':
  44599. case 'mapNormalAnisotropy':
  44600. break
  44601. case 'mapSpecular':
  44602. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy)
  44603. break
  44604. case 'mapSpecularRepeat':
  44605. case 'mapSpecularOffset':
  44606. case 'mapSpecularWrap':
  44607. case 'mapSpecularAnisotropy':
  44608. break
  44609. case 'mapAlpha':
  44610. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy)
  44611. break
  44612. case 'mapAlphaRepeat':
  44613. case 'mapAlphaOffset':
  44614. case 'mapAlphaWrap':
  44615. case 'mapAlphaAnisotropy':
  44616. break
  44617. case 'flipSided':
  44618. c.side = n.BackSide
  44619. break
  44620. case 'doubleSided':
  44621. c.side = n.DoubleSide
  44622. break
  44623. case 'transparency':
  44624. console.warn('THREE.Loader.createMaterial: transparency has been renamed to opacity'), (c.opacity = u)
  44625. break
  44626. case 'depthTest':
  44627. case 'depthWrite':
  44628. case 'colorWrite':
  44629. case 'opacity':
  44630. case 'reflectivity':
  44631. case 'transparent':
  44632. case 'visible':
  44633. case 'wireframe':
  44634. c[h] = u
  44635. break
  44636. case 'vertexColors':
  44637. u === !0 && (c.vertexColors = n.VertexColors), 'face' === u && (c.vertexColors = n.FaceColors)
  44638. break
  44639. default:
  44640. console.error('THREE.Loader.createMaterial: Unsupported', h, u)
  44641. }
  44642. }
  44643. return 'MeshBasicMaterial' === c.type && delete c.emissive, 'MeshPhongMaterial' !== c.type && delete c.specular, c.opacity < 1 && (c.transparent = !0), i.setTextures(l), i.parse(c)
  44644. }
  44645. })()
  44646. }),
  44647. (n.Loader.Handlers = {
  44648. handlers: [],
  44649. add: function (e, t) {
  44650. this.handlers.push(e, t)
  44651. },
  44652. get: function (e) {
  44653. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  44654. var r = t[i],
  44655. o = t[i + 1]
  44656. if (r.test(e)) return o
  44657. }
  44658. return null
  44659. }
  44660. }),
  44661. (n.XHRLoader = function (e) {
  44662. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  44663. }),
  44664. (n.XHRLoader.prototype = {
  44665. constructor: n.XHRLoader,
  44666. load: function (e, t, i, r) {
  44667. void 0 !== this.path && (e = this.path + e)
  44668. var o = this,
  44669. a = n.Cache.get(e)
  44670. if (void 0 !== a)
  44671. return (
  44672. t &&
  44673. setTimeout(function () {
  44674. t(a)
  44675. }, 0),
  44676. a
  44677. )
  44678. var s = new XMLHttpRequest()
  44679. return (
  44680. s.overrideMimeType('text/plain'),
  44681. s.open('GET', e, !0),
  44682. s.addEventListener(
  44683. 'load',
  44684. function (i) {
  44685. var a = i.target.response
  44686. n.Cache.add(e, a),
  44687. 200 === this.status
  44688. ? (t && t(a), o.manager.itemEnd(e))
  44689. : 0 === this.status
  44690. ? (console.warn('THREE.XHRLoader: HTTP Status 0 received.'), t && t(a), o.manager.itemEnd(e))
  44691. : (r && r(i), o.manager.itemError(e))
  44692. },
  44693. !1
  44694. ),
  44695. void 0 !== i &&
  44696. s.addEventListener(
  44697. 'progress',
  44698. function (e) {
  44699. i(e)
  44700. },
  44701. !1
  44702. ),
  44703. s.addEventListener(
  44704. 'error',
  44705. function (t) {
  44706. r && r(t), o.manager.itemError(e)
  44707. },
  44708. !1
  44709. ),
  44710. void 0 !== this.responseType && (s.responseType = this.responseType),
  44711. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  44712. s.send(null),
  44713. o.manager.itemStart(e),
  44714. s
  44715. )
  44716. },
  44717. setPath: function (e) {
  44718. this.path = e
  44719. },
  44720. setResponseType: function (e) {
  44721. this.responseType = e
  44722. },
  44723. setWithCredentials: function (e) {
  44724. this.withCredentials = e
  44725. }
  44726. }),
  44727. (n.FontLoader = function (e) {
  44728. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  44729. }),
  44730. (n.FontLoader.prototype = {
  44731. constructor: n.FontLoader,
  44732. load: function (e, t, i, r) {
  44733. var o = new n.XHRLoader(this.manager)
  44734. o.load(
  44735. e,
  44736. function (e) {
  44737. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  44738. },
  44739. i,
  44740. r
  44741. )
  44742. }
  44743. }),
  44744. (n.ImageLoader = function (e) {
  44745. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  44746. }),
  44747. (n.ImageLoader.prototype = {
  44748. constructor: n.ImageLoader,
  44749. load: function (e, t, i, r) {
  44750. void 0 !== this.path && (e = this.path + e)
  44751. var o = this,
  44752. a = n.Cache.get(e)
  44753. if (void 0 !== a)
  44754. return (
  44755. o.manager.itemStart(e),
  44756. t
  44757. ? setTimeout(function () {
  44758. t(a), o.manager.itemEnd(e)
  44759. }, 0)
  44760. : o.manager.itemEnd(e),
  44761. a
  44762. )
  44763. var s = document.createElement('img')
  44764. return (
  44765. s.addEventListener(
  44766. 'load',
  44767. function (i) {
  44768. n.Cache.add(e, this), t && t(this), o.manager.itemEnd(e)
  44769. },
  44770. !1
  44771. ),
  44772. void 0 !== i &&
  44773. s.addEventListener(
  44774. 'progress',
  44775. function (e) {
  44776. i(e)
  44777. },
  44778. !1
  44779. ),
  44780. s.addEventListener(
  44781. 'error',
  44782. function (t) {
  44783. r && r(t), o.manager.itemError(e)
  44784. },
  44785. !1
  44786. ),
  44787. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  44788. o.manager.itemStart(e),
  44789. (s.src = e),
  44790. s
  44791. )
  44792. },
  44793. setCrossOrigin: function (e) {
  44794. this.crossOrigin = e
  44795. },
  44796. setPath: function (e) {
  44797. this.path = e
  44798. }
  44799. }),
  44800. (n.JSONLoader = function (e) {
  44801. 'boolean' == typeof e && (console.warn('THREE.JSONLoader: showStatus parameter has been removed from constructor.'), (e = void 0)),
  44802. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager),
  44803. (this.withCredentials = !1)
  44804. }),
  44805. (n.JSONLoader.prototype = {
  44806. constructor: n.JSONLoader,
  44807. get statusDomElement() {
  44808. return (
  44809. void 0 === this._statusDomElement && (this._statusDomElement = document.createElement('div')),
  44810. console.warn('THREE.JSONLoader: .statusDomElement has been removed.'),
  44811. this._statusDomElement
  44812. )
  44813. },
  44814. load: function (e, t, i, r) {
  44815. var o = this,
  44816. a = this.texturePath && 'string' == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e),
  44817. s = new n.XHRLoader(this.manager)
  44818. s.setWithCredentials(this.withCredentials),
  44819. s.load(
  44820. e,
  44821. function (i) {
  44822. var n = JSON.parse(i),
  44823. r = n.metadata
  44824. if (void 0 !== r) {
  44825. var s = r.type
  44826. if (void 0 !== s) {
  44827. if ('object' === s.toLowerCase()) return void console.error('THREE.JSONLoader: ' + e + ' should be loaded with THREE.ObjectLoader instead.')
  44828. if ('scene' === s.toLowerCase()) return void console.error('THREE.JSONLoader: ' + e + ' should be loaded with THREE.SceneLoader instead.')
  44829. }
  44830. }
  44831. var l = o.parse(n, a)
  44832. t(l.geometry, l.materials)
  44833. },
  44834. i,
  44835. r
  44836. )
  44837. },
  44838. setTexturePath: function (e) {
  44839. this.texturePath = e
  44840. },
  44841. parse: function (e, t) {
  44842. function i(t) {
  44843. function i(e, t) {
  44844. return e & (1 << t)
  44845. }
  44846. var r,
  44847. o,
  44848. a,
  44849. l,
  44850. c,
  44851. h,
  44852. u,
  44853. d,
  44854. p,
  44855. f,
  44856. g,
  44857. m,
  44858. v,
  44859. A,
  44860. y,
  44861. C,
  44862. I,
  44863. E,
  44864. b,
  44865. w,
  44866. _,
  44867. T,
  44868. x,
  44869. S,
  44870. M,
  44871. R,
  44872. P,
  44873. O = e.faces,
  44874. L = e.vertices,
  44875. D = e.normals,
  44876. N = e.colors,
  44877. B = 0
  44878. if (void 0 !== e.uvs) {
  44879. for (r = 0; r < e.uvs.length; r++) e.uvs[r].length && B++
  44880. for (r = 0; r < B; r++) s.faceVertexUvs[r] = []
  44881. }
  44882. for (l = 0, c = L.length; l < c; ) (E = new n.Vector3()), (E.x = L[l++] * t), (E.y = L[l++] * t), (E.z = L[l++] * t), s.vertices.push(E)
  44883. for (l = 0, c = O.length; l < c; )
  44884. if (((f = O[l++]), (g = i(f, 0)), (m = i(f, 1)), (v = i(f, 3)), (A = i(f, 4)), (y = i(f, 5)), (C = i(f, 6)), (I = i(f, 7)), g)) {
  44885. if (
  44886. ((w = new n.Face3()),
  44887. (w.a = O[l]),
  44888. (w.b = O[l + 1]),
  44889. (w.c = O[l + 3]),
  44890. (_ = new n.Face3()),
  44891. (_.a = O[l + 1]),
  44892. (_.b = O[l + 2]),
  44893. (_.c = O[l + 3]),
  44894. (l += 4),
  44895. m && ((p = O[l++]), (w.materialIndex = p), (_.materialIndex = p)),
  44896. (a = s.faces.length),
  44897. v)
  44898. )
  44899. for (r = 0; r < B; r++)
  44900. for (S = e.uvs[r], s.faceVertexUvs[r][a] = [], s.faceVertexUvs[r][a + 1] = [], o = 0; o < 4; o++)
  44901. (d = O[l++]), (R = S[2 * d]), (P = S[2 * d + 1]), (M = new n.Vector2(R, P)), 2 !== o && s.faceVertexUvs[r][a].push(M), 0 !== o && s.faceVertexUvs[r][a + 1].push(M)
  44902. if ((A && ((u = 3 * O[l++]), w.normal.set(D[u++], D[u++], D[u]), _.normal.copy(w.normal)), y))
  44903. for (r = 0; r < 4; r++) (u = 3 * O[l++]), (x = new n.Vector3(D[u++], D[u++], D[u])), 2 !== r && w.vertexNormals.push(x), 0 !== r && _.vertexNormals.push(x)
  44904. if ((C && ((h = O[l++]), (T = N[h]), w.color.setHex(T), _.color.setHex(T)), I))
  44905. for (r = 0; r < 4; r++) (h = O[l++]), (T = N[h]), 2 !== r && w.vertexColors.push(new n.Color(T)), 0 !== r && _.vertexColors.push(new n.Color(T))
  44906. s.faces.push(w), s.faces.push(_)
  44907. } else {
  44908. if (((b = new n.Face3()), (b.a = O[l++]), (b.b = O[l++]), (b.c = O[l++]), m && ((p = O[l++]), (b.materialIndex = p)), (a = s.faces.length), v))
  44909. for (r = 0; r < B; r++)
  44910. for (S = e.uvs[r], s.faceVertexUvs[r][a] = [], o = 0; o < 3; o++) (d = O[l++]), (R = S[2 * d]), (P = S[2 * d + 1]), (M = new n.Vector2(R, P)), s.faceVertexUvs[r][a].push(M)
  44911. if ((A && ((u = 3 * O[l++]), b.normal.set(D[u++], D[u++], D[u])), y)) for (r = 0; r < 3; r++) (u = 3 * O[l++]), (x = new n.Vector3(D[u++], D[u++], D[u])), b.vertexNormals.push(x)
  44912. if ((C && ((h = O[l++]), b.color.setHex(N[h])), I)) for (r = 0; r < 3; r++) (h = O[l++]), b.vertexColors.push(new n.Color(N[h]))
  44913. s.faces.push(b)
  44914. }
  44915. }
  44916. function r() {
  44917. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2
  44918. if (e.skinWeights)
  44919. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  44920. var o = e.skinWeights[i],
  44921. a = t > 1 ? e.skinWeights[i + 1] : 0,
  44922. l = t > 2 ? e.skinWeights[i + 2] : 0,
  44923. c = t > 3 ? e.skinWeights[i + 3] : 0
  44924. s.skinWeights.push(new n.Vector4(o, a, l, c))
  44925. }
  44926. if (e.skinIndices)
  44927. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  44928. var h = e.skinIndices[i],
  44929. u = t > 1 ? e.skinIndices[i + 1] : 0,
  44930. d = t > 2 ? e.skinIndices[i + 2] : 0,
  44931. p = t > 3 ? e.skinIndices[i + 3] : 0
  44932. s.skinIndices.push(new n.Vector4(h, u, d, p))
  44933. }
  44934. ;(s.bones = e.bones),
  44935. s.bones &&
  44936. s.bones.length > 0 &&
  44937. (s.skinWeights.length !== s.skinIndices.length || s.skinIndices.length !== s.vertices.length) &&
  44938. console.warn(
  44939. 'When skinning, number of vertices (' + s.vertices.length + '), skinIndices (' + s.skinIndices.length + '), and skinWeights (' + s.skinWeights.length + ') should match.'
  44940. )
  44941. }
  44942. function o(t) {
  44943. if (void 0 !== e.morphTargets)
  44944. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  44945. ;(s.morphTargets[i] = {}), (s.morphTargets[i].name = e.morphTargets[i].name), (s.morphTargets[i].vertices = [])
  44946. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  44947. var h = new n.Vector3()
  44948. ;(h.x = a[l] * t), (h.y = a[l + 1] * t), (h.z = a[l + 2] * t), o.push(h)
  44949. }
  44950. }
  44951. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  44952. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.')
  44953. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++) u[i].color.fromArray(d, 3 * i)
  44954. }
  44955. }
  44956. function a() {
  44957. var t = [],
  44958. i = []
  44959. void 0 !== e.animation && i.push(e.animation), void 0 !== e.animations && (e.animations.length ? (i = i.concat(e.animations)) : i.push(e.animations))
  44960. for (var r = 0; r < i.length; r++) {
  44961. var o = n.AnimationClip.parseAnimation(i[r], s.bones)
  44962. o && t.push(o)
  44963. }
  44964. if (s.morphTargets) {
  44965. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10)
  44966. t = t.concat(a)
  44967. }
  44968. t.length > 0 && (s.animations = t)
  44969. }
  44970. var s = new n.Geometry(),
  44971. l = void 0 !== e.scale ? 1 / e.scale : 1
  44972. if ((i(l), r(), o(l), a(), s.computeFaceNormals(), s.computeBoundingSphere(), void 0 === e.materials || 0 === e.materials.length))
  44973. return {
  44974. geometry: s
  44975. }
  44976. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin)
  44977. return {
  44978. geometry: s,
  44979. materials: c
  44980. }
  44981. }
  44982. }),
  44983. (n.LoadingManager = function (e, t, i) {
  44984. var n = this,
  44985. r = !1,
  44986. o = 0,
  44987. a = 0
  44988. ;(this.onStart = void 0),
  44989. (this.onLoad = e),
  44990. (this.onProgress = t),
  44991. (this.onError = i),
  44992. (this.itemStart = function (e) {
  44993. a++, r === !1 && void 0 !== n.onStart && n.onStart(e, o, a), (r = !0)
  44994. }),
  44995. (this.itemEnd = function (e) {
  44996. o++, void 0 !== n.onProgress && n.onProgress(e, o, a), o === a && ((r = !1), void 0 !== n.onLoad && n.onLoad())
  44997. }),
  44998. (this.itemError = function (e) {
  44999. void 0 !== n.onError && n.onError(e)
  45000. })
  45001. }),
  45002. (n.DefaultLoadingManager = new n.LoadingManager()),
  45003. (n.BufferGeometryLoader = function (e) {
  45004. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45005. }),
  45006. (n.BufferGeometryLoader.prototype = {
  45007. constructor: n.BufferGeometryLoader,
  45008. load: function (e, t, i, r) {
  45009. var o = this,
  45010. a = new n.XHRLoader(o.manager)
  45011. a.load(
  45012. e,
  45013. function (e) {
  45014. t(o.parse(JSON.parse(e)))
  45015. },
  45016. i,
  45017. r
  45018. )
  45019. },
  45020. parse: function (e) {
  45021. var t = new n.BufferGeometry(),
  45022. i = e.data.index,
  45023. r = {
  45024. Int8Array: Int8Array,
  45025. Uint8Array: Uint8Array,
  45026. Uint8ClampedArray: Uint8ClampedArray,
  45027. Int16Array: Int16Array,
  45028. Uint16Array: Uint16Array,
  45029. Int32Array: Int32Array,
  45030. Uint32Array: Uint32Array,
  45031. Float32Array: Float32Array,
  45032. Float64Array: Float64Array
  45033. }
  45034. if (void 0 !== i) {
  45035. var o = new r[i.type](i.array)
  45036. t.setIndex(new n.BufferAttribute(o, 1))
  45037. }
  45038. var a = e.data.attributes
  45039. for (var s in a) {
  45040. var l = a[s],
  45041. o = new r[l.type](l.array)
  45042. t.addAttribute(s, new n.BufferAttribute(o, l.itemSize))
  45043. }
  45044. var c = e.data.groups || e.data.drawcalls || e.data.offsets
  45045. if (void 0 !== c)
  45046. for (var h = 0, u = c.length; h !== u; ++h) {
  45047. var d = c[h]
  45048. t.addGroup(d.start, d.count, d.materialIndex)
  45049. }
  45050. var p = e.data.boundingSphere
  45051. if (void 0 !== p) {
  45052. var f = new n.Vector3()
  45053. void 0 !== p.center && f.fromArray(p.center), (t.boundingSphere = new n.Sphere(f, p.radius))
  45054. }
  45055. return t
  45056. }
  45057. }),
  45058. (n.MaterialLoader = function (e) {
  45059. ;(this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this.textures = {})
  45060. }),
  45061. (n.MaterialLoader.prototype = {
  45062. constructor: n.MaterialLoader,
  45063. load: function (e, t, i, r) {
  45064. var o = this,
  45065. a = new n.XHRLoader(o.manager)
  45066. a.load(
  45067. e,
  45068. function (e) {
  45069. t(o.parse(JSON.parse(e)))
  45070. },
  45071. i,
  45072. r
  45073. )
  45074. },
  45075. setTextures: function (e) {
  45076. this.textures = e
  45077. },
  45078. getTexture: function (e) {
  45079. var t = this.textures
  45080. return void 0 === t[e] && console.warn('THREE.MaterialLoader: Undefined texture', e), t[e]
  45081. },
  45082. parse: function (e) {
  45083. var t = new n[e.type]()
  45084. if (
  45085. (void 0 !== e.uuid && (t.uuid = e.uuid),
  45086. void 0 !== e.name && (t.name = e.name),
  45087. void 0 !== e.color && t.color.setHex(e.color),
  45088. void 0 !== e.roughness && (t.roughness = e.roughness),
  45089. void 0 !== e.metalness && (t.metalness = e.metalness),
  45090. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  45091. void 0 !== e.specular && t.specular.setHex(e.specular),
  45092. void 0 !== e.shininess && (t.shininess = e.shininess),
  45093. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  45094. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  45095. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  45096. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  45097. void 0 !== e.shading && (t.shading = e.shading),
  45098. void 0 !== e.blending && (t.blending = e.blending),
  45099. void 0 !== e.side && (t.side = e.side),
  45100. void 0 !== e.opacity && (t.opacity = e.opacity),
  45101. void 0 !== e.transparent && (t.transparent = e.transparent),
  45102. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  45103. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  45104. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  45105. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  45106. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  45107. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  45108. void 0 !== e.size && (t.size = e.size),
  45109. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  45110. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  45111. void 0 !== e.alphaMap && ((t.alphaMap = this.getTexture(e.alphaMap)), (t.transparent = !0)),
  45112. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  45113. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  45114. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  45115. void 0 !== e.normalScale)
  45116. ) {
  45117. var i = e.normalScale
  45118. Array.isArray(i) === !1 && (i = [i, i]), (t.normalScale = new n.Vector2().fromArray(i))
  45119. }
  45120. if (
  45121. (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  45122. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  45123. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  45124. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  45125. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  45126. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  45127. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  45128. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  45129. void 0 !== e.envMap && ((t.envMap = this.getTexture(e.envMap)), (t.combine = n.MultiplyOperation)),
  45130. e.reflectivity && (t.reflectivity = e.reflectivity),
  45131. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  45132. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  45133. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  45134. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  45135. void 0 !== e.materials)
  45136. )
  45137. for (var r = 0, o = e.materials.length; r < o; r++) t.materials.push(this.parse(e.materials[r]))
  45138. return t
  45139. }
  45140. }),
  45141. (n.ObjectLoader = function (e) {
  45142. ;(this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this.texturePath = '')
  45143. }),
  45144. (n.ObjectLoader.prototype = {
  45145. constructor: n.ObjectLoader,
  45146. load: function (e, t, i, r) {
  45147. '' === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf('/') + 1))
  45148. var o = this,
  45149. a = new n.XHRLoader(o.manager)
  45150. a.load(
  45151. e,
  45152. function (e) {
  45153. o.parse(JSON.parse(e), t)
  45154. },
  45155. i,
  45156. r
  45157. )
  45158. },
  45159. setTexturePath: function (e) {
  45160. this.texturePath = e
  45161. },
  45162. setCrossOrigin: function (e) {
  45163. this.crossOrigin = e
  45164. },
  45165. parse: function (e, t) {
  45166. var i = this.parseGeometries(e.geometries),
  45167. n = this.parseImages(e.images, function () {
  45168. void 0 !== t && t(a)
  45169. }),
  45170. r = this.parseTextures(e.textures, n),
  45171. o = this.parseMaterials(e.materials, r),
  45172. a = this.parseObject(e.object, i, o)
  45173. return e.animations && (a.animations = this.parseAnimations(e.animations)), (void 0 !== e.images && 0 !== e.images.length) || (void 0 !== t && t(a)), a
  45174. },
  45175. parseGeometries: function (e) {
  45176. var t = {}
  45177. if (void 0 !== e)
  45178. for (var i = new n.JSONLoader(), r = new n.BufferGeometryLoader(), o = 0, a = e.length; o < a; o++) {
  45179. var s,
  45180. l = e[o]
  45181. switch (l.type) {
  45182. case 'PlaneGeometry':
  45183. case 'PlaneBufferGeometry':
  45184. s = new n[l.type](l.width, l.height, l.widthSegments, l.heightSegments)
  45185. break
  45186. case 'BoxGeometry':
  45187. case 'BoxBufferGeometry':
  45188. case 'CubeGeometry':
  45189. s = new n[l.type](l.width, l.height, l.depth, l.widthSegments, l.heightSegments, l.depthSegments)
  45190. break
  45191. case 'CircleGeometry':
  45192. case 'CircleBufferGeometry':
  45193. s = new n[l.type](l.radius, l.segments, l.thetaStart, l.thetaLength)
  45194. break
  45195. case 'CylinderGeometry':
  45196. case 'CylinderBufferGeometry':
  45197. s = new n[l.type](l.radiusTop, l.radiusBottom, l.height, l.radialSegments, l.heightSegments, l.openEnded, l.thetaStart, l.thetaLength)
  45198. break
  45199. case 'SphereGeometry':
  45200. case 'SphereBufferGeometry':
  45201. s = new n[l.type](l.radius, l.widthSegments, l.heightSegments, l.phiStart, l.phiLength, l.thetaStart, l.thetaLength)
  45202. break
  45203. case 'DodecahedronGeometry':
  45204. s = new n.DodecahedronGeometry(l.radius, l.detail)
  45205. break
  45206. case 'IcosahedronGeometry':
  45207. s = new n.IcosahedronGeometry(l.radius, l.detail)
  45208. break
  45209. case 'OctahedronGeometry':
  45210. s = new n.OctahedronGeometry(l.radius, l.detail)
  45211. break
  45212. case 'TetrahedronGeometry':
  45213. s = new n.TetrahedronGeometry(l.radius, l.detail)
  45214. break
  45215. case 'RingGeometry':
  45216. case 'RingBufferGeometry':
  45217. s = new n[l.type](l.innerRadius, l.outerRadius, l.thetaSegments, l.phiSegments, l.thetaStart, l.thetaLength)
  45218. break
  45219. case 'TorusGeometry':
  45220. case 'TorusBufferGeometry':
  45221. s = new n[l.type](l.radius, l.tube, l.radialSegments, l.tubularSegments, l.arc)
  45222. break
  45223. case 'TorusKnotGeometry':
  45224. case 'TorusKnotBufferGeometry':
  45225. s = new n[l.type](l.radius, l.tube, l.tubularSegments, l.radialSegments, l.p, l.q)
  45226. break
  45227. case 'LatheGeometry':
  45228. s = new n.LatheGeometry(l.points, l.segments, l.phiStart, l.phiLength)
  45229. break
  45230. case 'BufferGeometry':
  45231. s = r.parse(l)
  45232. break
  45233. case 'Geometry':
  45234. s = i.parse(l.data, this.texturePath).geometry
  45235. break
  45236. default:
  45237. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"')
  45238. continue
  45239. }
  45240. ;(s.uuid = l.uuid), void 0 !== l.name && (s.name = l.name), (t[l.uuid] = s)
  45241. }
  45242. return t
  45243. },
  45244. parseMaterials: function (e, t) {
  45245. var i = {}
  45246. if (void 0 !== e) {
  45247. var r = new n.MaterialLoader()
  45248. r.setTextures(t)
  45249. for (var o = 0, a = e.length; o < a; o++) {
  45250. var s = r.parse(e[o])
  45251. i[s.uuid] = s
  45252. }
  45253. }
  45254. return i
  45255. },
  45256. parseAnimations: function (e) {
  45257. for (var t = [], i = 0; i < e.length; i++) {
  45258. var r = n.AnimationClip.parse(e[i])
  45259. t.push(r)
  45260. }
  45261. return t
  45262. },
  45263. parseImages: function (e, t) {
  45264. function i(e) {
  45265. return (
  45266. r.manager.itemStart(e),
  45267. s.load(e, function () {
  45268. r.manager.itemEnd(e)
  45269. })
  45270. )
  45271. }
  45272. var r = this,
  45273. o = {}
  45274. if (void 0 !== e && e.length > 0) {
  45275. var a = new n.LoadingManager(t),
  45276. s = new n.ImageLoader(a)
  45277. s.setCrossOrigin(this.crossOrigin)
  45278. for (var l = 0, c = e.length; l < c; l++) {
  45279. var h = e[l],
  45280. u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url
  45281. o[h.uuid] = i(u)
  45282. }
  45283. }
  45284. return o
  45285. },
  45286. parseTextures: function (e, t) {
  45287. function i(e) {
  45288. return 'number' == typeof e ? e : (console.warn('THREE.ObjectLoader.parseTexture: Constant should be in numeric form.', e), n[e])
  45289. }
  45290. var r = {}
  45291. if (void 0 !== e)
  45292. for (var o = 0, a = e.length; o < a; o++) {
  45293. var s = e[o]
  45294. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid), void 0 === t[s.image] && console.warn('THREE.ObjectLoader: Undefined image', s.image)
  45295. var l = new n.Texture(t[s.image])
  45296. ;(l.needsUpdate = !0),
  45297. (l.uuid = s.uuid),
  45298. void 0 !== s.name && (l.name = s.name),
  45299. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  45300. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0], s.offset[1])),
  45301. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0], s.repeat[1])),
  45302. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  45303. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  45304. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  45305. Array.isArray(s.wrap) && ((l.wrapS = i(s.wrap[0])), (l.wrapT = i(s.wrap[1]))),
  45306. (r[s.uuid] = l)
  45307. }
  45308. return r
  45309. },
  45310. parseObject: (function () {
  45311. var e = new n.Matrix4()
  45312. return function (t, i, r) {
  45313. function o(e) {
  45314. return void 0 === i[e] && console.warn('THREE.ObjectLoader: Undefined geometry', e), i[e]
  45315. }
  45316. function a(e) {
  45317. if (void 0 !== e) return void 0 === r[e] && console.warn('THREE.ObjectLoader: Undefined material', e), r[e]
  45318. }
  45319. var s
  45320. switch (t.type) {
  45321. case 'Scene':
  45322. s = new n.Scene()
  45323. break
  45324. case 'PerspectiveCamera':
  45325. s = new n.PerspectiveCamera(t.fov, t.aspect, t.near, t.far)
  45326. break
  45327. case 'OrthographicCamera':
  45328. s = new n.OrthographicCamera(t.left, t.right, t.top, t.bottom, t.near, t.far)
  45329. break
  45330. case 'AmbientLight':
  45331. s = new n.AmbientLight(t.color, t.intensity)
  45332. break
  45333. case 'DirectionalLight':
  45334. s = new n.DirectionalLight(t.color, t.intensity)
  45335. break
  45336. case 'PointLight':
  45337. s = new n.PointLight(t.color, t.intensity, t.distance, t.decay)
  45338. break
  45339. case 'SpotLight':
  45340. s = new n.SpotLight(t.color, t.intensity, t.distance, t.angle, t.penumbra, t.decay)
  45341. break
  45342. case 'HemisphereLight':
  45343. s = new n.HemisphereLight(t.color, t.groundColor, t.intensity)
  45344. break
  45345. case 'Mesh':
  45346. var l = o(t.geometry),
  45347. c = a(t.material)
  45348. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l, c) : new n.Mesh(l, c)
  45349. break
  45350. case 'LOD':
  45351. s = new n.LOD()
  45352. break
  45353. case 'Line':
  45354. s = new n.Line(o(t.geometry), a(t.material), t.mode)
  45355. break
  45356. case 'PointCloud':
  45357. case 'Points':
  45358. s = new n.Points(o(t.geometry), a(t.material))
  45359. break
  45360. case 'Sprite':
  45361. s = new n.Sprite(a(t.material))
  45362. break
  45363. case 'Group':
  45364. s = new n.Group()
  45365. break
  45366. default:
  45367. s = new n.Object3D()
  45368. }
  45369. if (
  45370. ((s.uuid = t.uuid),
  45371. void 0 !== t.name && (s.name = t.name),
  45372. void 0 !== t.matrix
  45373. ? (e.fromArray(t.matrix), e.decompose(s.position, s.quaternion, s.scale))
  45374. : (void 0 !== t.position && s.position.fromArray(t.position), void 0 !== t.rotation && s.rotation.fromArray(t.rotation), void 0 !== t.scale && s.scale.fromArray(t.scale)),
  45375. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  45376. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  45377. void 0 !== t.visible && (s.visible = t.visible),
  45378. void 0 !== t.userData && (s.userData = t.userData),
  45379. void 0 !== t.children)
  45380. )
  45381. for (var h in t.children) s.add(this.parseObject(t.children[h], i, r))
  45382. if ('LOD' === t.type)
  45383. for (var u = t.levels, d = 0; d < u.length; d++) {
  45384. var p = u[d],
  45385. h = s.getObjectByProperty('uuid', p.object)
  45386. void 0 !== h && s.addLevel(h, p.distance)
  45387. }
  45388. return s
  45389. }
  45390. })()
  45391. }),
  45392. (n.TextureLoader = function (e) {
  45393. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45394. }),
  45395. (n.TextureLoader.prototype = {
  45396. constructor: n.TextureLoader,
  45397. load: function (e, t, i, r) {
  45398. var o = new n.Texture(),
  45399. a = new n.ImageLoader(this.manager)
  45400. return (
  45401. a.setCrossOrigin(this.crossOrigin),
  45402. a.setPath(this.path),
  45403. a.load(
  45404. e,
  45405. function (e) {
  45406. ;(o.image = e), (o.needsUpdate = !0), void 0 !== t && t(o)
  45407. },
  45408. i,
  45409. r
  45410. ),
  45411. o
  45412. )
  45413. },
  45414. setCrossOrigin: function (e) {
  45415. this.crossOrigin = e
  45416. },
  45417. setPath: function (e) {
  45418. this.path = e
  45419. }
  45420. }),
  45421. (n.CubeTextureLoader = function (e) {
  45422. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45423. }),
  45424. (n.CubeTextureLoader.prototype = {
  45425. constructor: n.CubeTextureLoader,
  45426. load: function (e, t, i, r) {
  45427. function o(i) {
  45428. s.load(
  45429. e[i],
  45430. function (e) {
  45431. ;(a.images[i] = e), l++, 6 === l && ((a.needsUpdate = !0), t && t(a))
  45432. },
  45433. void 0,
  45434. r
  45435. )
  45436. }
  45437. var a = new n.CubeTexture(),
  45438. s = new n.ImageLoader(this.manager)
  45439. s.setCrossOrigin(this.crossOrigin), s.setPath(this.path)
  45440. for (var l = 0, c = 0; c < e.length; ++c) o(c)
  45441. return a
  45442. },
  45443. setCrossOrigin: function (e) {
  45444. this.crossOrigin = e
  45445. },
  45446. setPath: function (e) {
  45447. this.path = e
  45448. }
  45449. }),
  45450. (n.DataTextureLoader = n.BinaryTextureLoader =
  45451. function (e) {
  45452. ;(this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this._parser = null)
  45453. }),
  45454. (n.BinaryTextureLoader.prototype = {
  45455. constructor: n.BinaryTextureLoader,
  45456. load: function (e, t, i, r) {
  45457. var o = this,
  45458. a = new n.DataTexture(),
  45459. s = new n.XHRLoader(this.manager)
  45460. return (
  45461. s.setResponseType('arraybuffer'),
  45462. s.load(
  45463. e,
  45464. function (e) {
  45465. var i = o._parser(e)
  45466. i &&
  45467. (void 0 !== i.image ? (a.image = i.image) : void 0 !== i.data && ((a.image.width = i.width), (a.image.height = i.height), (a.image.data = i.data)),
  45468. (a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping),
  45469. (a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping),
  45470. (a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter),
  45471. (a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter),
  45472. (a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1),
  45473. void 0 !== i.format && (a.format = i.format),
  45474. void 0 !== i.type && (a.type = i.type),
  45475. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  45476. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  45477. (a.needsUpdate = !0),
  45478. t && t(a, i))
  45479. },
  45480. i,
  45481. r
  45482. ),
  45483. a
  45484. )
  45485. }
  45486. }),
  45487. (n.CompressedTextureLoader = function (e) {
  45488. ;(this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this._parser = null)
  45489. })
  45490. n.CompressedTextureLoader.prototype = {
  45491. constructor: n.CompressedTextureLoader,
  45492. load: function (e, t, i, r) {
  45493. function o(o) {
  45494. c.load(
  45495. e[o],
  45496. function (e) {
  45497. var i = a._parser(e, !0)
  45498. ;(s[o] = {
  45499. width: i.width,
  45500. height: i.height,
  45501. format: i.format,
  45502. mipmaps: i.mipmaps
  45503. }),
  45504. (h += 1),
  45505. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter), (l.format = i.format), (l.needsUpdate = !0), t && t(l))
  45506. },
  45507. i,
  45508. r
  45509. )
  45510. }
  45511. var a = this,
  45512. s = [],
  45513. l = new n.CompressedTexture()
  45514. l.image = s
  45515. var c = new n.XHRLoader(this.manager)
  45516. if ((c.setPath(this.path), c.setResponseType('arraybuffer'), Array.isArray(e))) for (var h = 0, u = 0, d = e.length; u < d; ++u) o(u)
  45517. else
  45518. c.load(
  45519. e,
  45520. function (e) {
  45521. var i = a._parser(e, !0)
  45522. if (i.isCubemap)
  45523. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  45524. s[o] = {
  45525. mipmaps: []
  45526. }
  45527. for (var c = 0; c < i.mipmapCount; c++) s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]), (s[o].format = i.format), (s[o].width = i.width), (s[o].height = i.height)
  45528. }
  45529. else (l.image.width = i.width), (l.image.height = i.height), (l.mipmaps = i.mipmaps)
  45530. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter), (l.format = i.format), (l.needsUpdate = !0), t && t(l)
  45531. },
  45532. i,
  45533. r
  45534. )
  45535. return l
  45536. },
  45537. setPath: function (e) {
  45538. this.path = e
  45539. }
  45540. }
  45541. ;(n.Material = function () {
  45542. Object.defineProperty(this, 'id', {
  45543. value: n.MaterialIdCount++
  45544. }),
  45545. (this.uuid = n.Math.generateUUID()),
  45546. (this.name = ''),
  45547. (this.type = 'Material'),
  45548. (this.side = n.FrontSide),
  45549. (this.opacity = 1),
  45550. (this.transparent = !1),
  45551. (this.blending = n.NormalBlending),
  45552. (this.blendSrc = n.SrcAlphaFactor),
  45553. (this.blendDst = n.OneMinusSrcAlphaFactor),
  45554. (this.blendEquation = n.AddEquation),
  45555. (this.blendSrcAlpha = null),
  45556. (this.blendDstAlpha = null),
  45557. (this.blendEquationAlpha = null),
  45558. (this.depthFunc = n.LessEqualDepth),
  45559. (this.depthTest = !0),
  45560. (this.depthWrite = !0),
  45561. (this.colorWrite = !0),
  45562. (this.precision = null),
  45563. (this.polygonOffset = !1),
  45564. (this.polygonOffsetFactor = 0),
  45565. (this.polygonOffsetUnits = 0),
  45566. (this.alphaTest = 0),
  45567. (this.premultipliedAlpha = !1),
  45568. (this.overdraw = 0),
  45569. (this.visible = !0),
  45570. (this._needsUpdate = !0)
  45571. }),
  45572. (n.Material.prototype = {
  45573. constructor: n.Material,
  45574. get needsUpdate() {
  45575. return this._needsUpdate
  45576. },
  45577. set needsUpdate(e) {
  45578. e === !0 && this.update(), (this._needsUpdate = e)
  45579. },
  45580. setValues: function (e) {
  45581. if (void 0 !== e)
  45582. for (var t in e) {
  45583. var i = e[t]
  45584. if (void 0 !== i) {
  45585. var r = this[t]
  45586. void 0 !== r
  45587. ? r instanceof n.Color
  45588. ? r.set(i)
  45589. : r instanceof n.Vector3 && i instanceof n.Vector3
  45590. ? r.copy(i)
  45591. : 'overdraw' === t
  45592. ? (this[t] = Number(i))
  45593. : (this[t] = i)
  45594. : console.warn('THREE.' + this.type + ": '" + t + "' is not a property of this material.")
  45595. } else console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  45596. }
  45597. },
  45598. toJSON: function (e) {
  45599. function t(e) {
  45600. var t = []
  45601. for (var i in e) {
  45602. var n = e[i]
  45603. delete n.metadata, t.push(n)
  45604. }
  45605. return t
  45606. }
  45607. var i = void 0 === e
  45608. i &&
  45609. (e = {
  45610. textures: {},
  45611. images: {}
  45612. })
  45613. var r = {
  45614. metadata: {
  45615. version: 4.4,
  45616. type: 'Material',
  45617. generator: 'Material.toJSON'
  45618. }
  45619. }
  45620. if (
  45621. ((r.uuid = this.uuid),
  45622. (r.type = this.type),
  45623. '' !== this.name && (r.name = this.name),
  45624. this.color instanceof n.Color && (r.color = this.color.getHex()),
  45625. 0.5 !== this.roughness && (r.roughness = this.roughness),
  45626. 0.5 !== this.metalness && (r.metalness = this.metalness),
  45627. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  45628. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  45629. void 0 !== this.shininess && (r.shininess = this.shininess),
  45630. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  45631. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  45632. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  45633. this.bumpMap instanceof n.Texture && ((r.bumpMap = this.bumpMap.toJSON(e).uuid), (r.bumpScale = this.bumpScale)),
  45634. this.normalMap instanceof n.Texture && ((r.normalMap = this.normalMap.toJSON(e).uuid), (r.normalScale = this.normalScale.toArray())),
  45635. this.displacementMap instanceof n.Texture &&
  45636. ((r.displacementMap = this.displacementMap.toJSON(e).uuid), (r.displacementScale = this.displacementScale), (r.displacementBias = this.displacementBias)),
  45637. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  45638. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  45639. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  45640. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  45641. this.envMap instanceof n.Texture && ((r.envMap = this.envMap.toJSON(e).uuid), (r.reflectivity = this.reflectivity)),
  45642. void 0 !== this.size && (r.size = this.size),
  45643. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  45644. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  45645. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  45646. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  45647. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  45648. this.opacity < 1 && (r.opacity = this.opacity),
  45649. this.transparent === !0 && (r.transparent = this.transparent),
  45650. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  45651. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  45652. this.wireframe === !0 && (r.wireframe = this.wireframe),
  45653. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  45654. i)
  45655. ) {
  45656. var o = t(e.textures),
  45657. a = t(e.images)
  45658. o.length > 0 && (r.textures = o), a.length > 0 && (r.images = a)
  45659. }
  45660. return r
  45661. },
  45662. clone: function () {
  45663. return new this.constructor().copy(this)
  45664. },
  45665. copy: function (e) {
  45666. return (
  45667. (this.name = e.name),
  45668. (this.side = e.side),
  45669. (this.opacity = e.opacity),
  45670. (this.transparent = e.transparent),
  45671. (this.blending = e.blending),
  45672. (this.blendSrc = e.blendSrc),
  45673. (this.blendDst = e.blendDst),
  45674. (this.blendEquation = e.blendEquation),
  45675. (this.blendSrcAlpha = e.blendSrcAlpha),
  45676. (this.blendDstAlpha = e.blendDstAlpha),
  45677. (this.blendEquationAlpha = e.blendEquationAlpha),
  45678. (this.depthFunc = e.depthFunc),
  45679. (this.depthTest = e.depthTest),
  45680. (this.depthWrite = e.depthWrite),
  45681. (this.colorWrite = e.colorWrite),
  45682. (this.precision = e.precision),
  45683. (this.polygonOffset = e.polygonOffset),
  45684. (this.polygonOffsetFactor = e.polygonOffsetFactor),
  45685. (this.polygonOffsetUnits = e.polygonOffsetUnits),
  45686. (this.alphaTest = e.alphaTest),
  45687. (this.premultipliedAlpha = e.premultipliedAlpha),
  45688. (this.overdraw = e.overdraw),
  45689. (this.visible = e.visible),
  45690. this
  45691. )
  45692. },
  45693. update: function () {
  45694. this.dispatchEvent({
  45695. type: 'update'
  45696. })
  45697. },
  45698. dispose: function () {
  45699. this.dispatchEvent({
  45700. type: 'dispose'
  45701. })
  45702. }
  45703. }),
  45704. n.EventDispatcher.prototype.apply(n.Material.prototype),
  45705. (n.MaterialIdCount = 0),
  45706. (n.LineBasicMaterial = function (e) {
  45707. n.Material.call(this),
  45708. (this.type = 'LineBasicMaterial'),
  45709. (this.color = new n.Color(16777215)),
  45710. (this.linewidth = 1),
  45711. (this.linecap = 'round'),
  45712. (this.linejoin = 'round'),
  45713. (this.blending = n.NormalBlending),
  45714. (this.vertexColors = n.NoColors),
  45715. (this.fog = !0),
  45716. this.setValues(e)
  45717. }),
  45718. (n.LineBasicMaterial.prototype = Object.create(n.Material.prototype)),
  45719. (n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial),
  45720. (n.LineBasicMaterial.prototype.copy = function (e) {
  45721. return (
  45722. n.Material.prototype.copy.call(this, e),
  45723. this.color.copy(e.color),
  45724. (this.linewidth = e.linewidth),
  45725. (this.linecap = e.linecap),
  45726. (this.linejoin = e.linejoin),
  45727. (this.vertexColors = e.vertexColors),
  45728. (this.fog = e.fog),
  45729. this
  45730. )
  45731. }),
  45732. (n.LineDashedMaterial = function (e) {
  45733. n.Material.call(this),
  45734. (this.type = 'LineDashedMaterial'),
  45735. (this.color = new n.Color(16777215)),
  45736. (this.linewidth = 1),
  45737. (this.scale = 1),
  45738. (this.dashSize = 3),
  45739. (this.gapSize = 1),
  45740. (this.blending = n.NormalBlending),
  45741. (this.vertexColors = n.NoColors),
  45742. (this.fog = !0),
  45743. this.setValues(e)
  45744. }),
  45745. (n.LineDashedMaterial.prototype = Object.create(n.Material.prototype)),
  45746. (n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial),
  45747. (n.LineDashedMaterial.prototype.copy = function (e) {
  45748. return (
  45749. n.Material.prototype.copy.call(this, e),
  45750. this.color.copy(e.color),
  45751. (this.linewidth = e.linewidth),
  45752. (this.scale = e.scale),
  45753. (this.dashSize = e.dashSize),
  45754. (this.gapSize = e.gapSize),
  45755. (this.vertexColors = e.vertexColors),
  45756. (this.fog = e.fog),
  45757. this
  45758. )
  45759. }),
  45760. (n.MeshBasicMaterial = function (e) {
  45761. n.Material.call(this),
  45762. (this.type = 'MeshBasicMaterial'),
  45763. (this.color = new n.Color(16777215)),
  45764. (this.map = null),
  45765. (this.aoMap = null),
  45766. (this.aoMapIntensity = 1),
  45767. (this.specularMap = null),
  45768. (this.alphaMap = null),
  45769. (this.envMap = null),
  45770. (this.combine = n.MultiplyOperation),
  45771. (this.reflectivity = 1),
  45772. (this.refractionRatio = 0.98),
  45773. (this.fog = !0),
  45774. (this.shading = n.SmoothShading),
  45775. (this.blending = n.NormalBlending),
  45776. (this.wireframe = !1),
  45777. (this.wireframeLinewidth = 1),
  45778. (this.wireframeLinecap = 'round'),
  45779. (this.wireframeLinejoin = 'round'),
  45780. (this.vertexColors = n.NoColors),
  45781. (this.skinning = !1),
  45782. (this.morphTargets = !1),
  45783. this.setValues(e)
  45784. }),
  45785. (n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype)),
  45786. (n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial),
  45787. (n.MeshBasicMaterial.prototype.copy = function (e) {
  45788. return (
  45789. n.Material.prototype.copy.call(this, e),
  45790. this.color.copy(e.color),
  45791. (this.map = e.map),
  45792. (this.aoMap = e.aoMap),
  45793. (this.aoMapIntensity = e.aoMapIntensity),
  45794. (this.specularMap = e.specularMap),
  45795. (this.alphaMap = e.alphaMap),
  45796. (this.envMap = e.envMap),
  45797. (this.combine = e.combine),
  45798. (this.reflectivity = e.reflectivity),
  45799. (this.refractionRatio = e.refractionRatio),
  45800. (this.fog = e.fog),
  45801. (this.shading = e.shading),
  45802. (this.wireframe = e.wireframe),
  45803. (this.wireframeLinewidth = e.wireframeLinewidth),
  45804. (this.wireframeLinecap = e.wireframeLinecap),
  45805. (this.wireframeLinejoin = e.wireframeLinejoin),
  45806. (this.vertexColors = e.vertexColors),
  45807. (this.skinning = e.skinning),
  45808. (this.morphTargets = e.morphTargets),
  45809. this
  45810. )
  45811. }),
  45812. (n.MeshLambertMaterial = function (e) {
  45813. n.Material.call(this),
  45814. (this.type = 'MeshLambertMaterial'),
  45815. (this.color = new n.Color(16777215)),
  45816. (this.map = null),
  45817. (this.lightMap = null),
  45818. (this.lightMapIntensity = 1),
  45819. (this.aoMap = null),
  45820. (this.aoMapIntensity = 1),
  45821. (this.emissive = new n.Color(0)),
  45822. (this.emissiveIntensity = 1),
  45823. (this.emissiveMap = null),
  45824. (this.specularMap = null),
  45825. (this.alphaMap = null),
  45826. (this.envMap = null),
  45827. (this.combine = n.MultiplyOperation),
  45828. (this.reflectivity = 1),
  45829. (this.refractionRatio = 0.98),
  45830. (this.fog = !0),
  45831. (this.blending = n.NormalBlending),
  45832. (this.wireframe = !1),
  45833. (this.wireframeLinewidth = 1),
  45834. (this.wireframeLinecap = 'round'),
  45835. (this.wireframeLinejoin = 'round'),
  45836. (this.vertexColors = n.NoColors),
  45837. (this.skinning = !1),
  45838. (this.morphTargets = !1),
  45839. (this.morphNormals = !1),
  45840. this.setValues(e)
  45841. }),
  45842. (n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype)),
  45843. (n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial),
  45844. (n.MeshLambertMaterial.prototype.copy = function (e) {
  45845. return (
  45846. n.Material.prototype.copy.call(this, e),
  45847. this.color.copy(e.color),
  45848. (this.map = e.map),
  45849. (this.lightMap = e.lightMap),
  45850. (this.lightMapIntensity = e.lightMapIntensity),
  45851. (this.aoMap = e.aoMap),
  45852. (this.aoMapIntensity = e.aoMapIntensity),
  45853. this.emissive.copy(e.emissive),
  45854. (this.emissiveMap = e.emissiveMap),
  45855. (this.emissiveIntensity = e.emissiveIntensity),
  45856. (this.specularMap = e.specularMap),
  45857. (this.alphaMap = e.alphaMap),
  45858. (this.envMap = e.envMap),
  45859. (this.combine = e.combine),
  45860. (this.reflectivity = e.reflectivity),
  45861. (this.refractionRatio = e.refractionRatio),
  45862. (this.fog = e.fog),
  45863. (this.wireframe = e.wireframe),
  45864. (this.wireframeLinewidth = e.wireframeLinewidth),
  45865. (this.wireframeLinecap = e.wireframeLinecap),
  45866. (this.wireframeLinejoin = e.wireframeLinejoin),
  45867. (this.vertexColors = e.vertexColors),
  45868. (this.skinning = e.skinning),
  45869. (this.morphTargets = e.morphTargets),
  45870. (this.morphNormals = e.morphNormals),
  45871. this
  45872. )
  45873. }),
  45874. (n.MeshPhongMaterial = function (e) {
  45875. n.Material.call(this),
  45876. (this.type = 'MeshPhongMaterial'),
  45877. (this.color = new n.Color(16777215)),
  45878. (this.specular = new n.Color(1118481)),
  45879. (this.shininess = 30),
  45880. (this.map = null),
  45881. (this.lightMap = null),
  45882. (this.lightMapIntensity = 1),
  45883. (this.aoMap = null),
  45884. (this.aoMapIntensity = 1),
  45885. (this.emissive = new n.Color(0)),
  45886. (this.emissiveIntensity = 1),
  45887. (this.emissiveMap = null),
  45888. (this.bumpMap = null),
  45889. (this.bumpScale = 1),
  45890. (this.normalMap = null),
  45891. (this.normalScale = new n.Vector2(1, 1)),
  45892. (this.displacementMap = null),
  45893. (this.displacementScale = 1),
  45894. (this.displacementBias = 0),
  45895. (this.specularMap = null),
  45896. (this.alphaMap = null),
  45897. (this.envMap = null),
  45898. (this.combine = n.MultiplyOperation),
  45899. (this.reflectivity = 1),
  45900. (this.refractionRatio = 0.98),
  45901. (this.fog = !0),
  45902. (this.shading = n.SmoothShading),
  45903. (this.blending = n.NormalBlending),
  45904. (this.wireframe = !1),
  45905. (this.wireframeLinewidth = 1),
  45906. (this.wireframeLinecap = 'round'),
  45907. (this.wireframeLinejoin = 'round'),
  45908. (this.vertexColors = n.NoColors),
  45909. (this.skinning = !1),
  45910. (this.morphTargets = !1),
  45911. (this.morphNormals = !1),
  45912. this.setValues(e)
  45913. }),
  45914. (n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype)),
  45915. (n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial),
  45916. (n.MeshPhongMaterial.prototype.copy = function (e) {
  45917. return (
  45918. n.Material.prototype.copy.call(this, e),
  45919. this.color.copy(e.color),
  45920. this.specular.copy(e.specular),
  45921. (this.shininess = e.shininess),
  45922. (this.map = e.map),
  45923. (this.lightMap = e.lightMap),
  45924. (this.lightMapIntensity = e.lightMapIntensity),
  45925. (this.aoMap = e.aoMap),
  45926. (this.aoMapIntensity = e.aoMapIntensity),
  45927. this.emissive.copy(e.emissive),
  45928. (this.emissiveMap = e.emissiveMap),
  45929. (this.emissiveIntensity = e.emissiveIntensity),
  45930. (this.bumpMap = e.bumpMap),
  45931. (this.bumpScale = e.bumpScale),
  45932. (this.normalMap = e.normalMap),
  45933. this.normalScale.copy(e.normalScale),
  45934. (this.displacementMap = e.displacementMap),
  45935. (this.displacementScale = e.displacementScale),
  45936. (this.displacementBias = e.displacementBias),
  45937. (this.specularMap = e.specularMap),
  45938. (this.alphaMap = e.alphaMap),
  45939. (this.envMap = e.envMap),
  45940. (this.combine = e.combine),
  45941. (this.reflectivity = e.reflectivity),
  45942. (this.refractionRatio = e.refractionRatio),
  45943. (this.fog = e.fog),
  45944. (this.shading = e.shading),
  45945. (this.wireframe = e.wireframe),
  45946. (this.wireframeLinewidth = e.wireframeLinewidth),
  45947. (this.wireframeLinecap = e.wireframeLinecap),
  45948. (this.wireframeLinejoin = e.wireframeLinejoin),
  45949. (this.vertexColors = e.vertexColors),
  45950. (this.skinning = e.skinning),
  45951. (this.morphTargets = e.morphTargets),
  45952. (this.morphNormals = e.morphNormals),
  45953. this
  45954. )
  45955. }),
  45956. (n.MeshStandardMaterial = function (e) {
  45957. n.Material.call(this),
  45958. (this.type = 'MeshStandardMaterial'),
  45959. (this.color = new n.Color(16777215)),
  45960. (this.roughness = 0.5),
  45961. (this.metalness = 0.5),
  45962. (this.map = null),
  45963. (this.lightMap = null),
  45964. (this.lightMapIntensity = 1),
  45965. (this.aoMap = null),
  45966. (this.aoMapIntensity = 1),
  45967. (this.emissive = new n.Color(0)),
  45968. (this.emissiveIntensity = 1),
  45969. (this.emissiveMap = null),
  45970. (this.bumpMap = null),
  45971. (this.bumpScale = 1),
  45972. (this.normalMap = null),
  45973. (this.normalScale = new n.Vector2(1, 1)),
  45974. (this.displacementMap = null),
  45975. (this.displacementScale = 1),
  45976. (this.displacementBias = 0),
  45977. (this.roughnessMap = null),
  45978. (this.metalnessMap = null),
  45979. (this.alphaMap = null),
  45980. (this.envMap = null),
  45981. (this.envMapIntensity = 1),
  45982. (this.refractionRatio = 0.98),
  45983. (this.fog = !0),
  45984. (this.shading = n.SmoothShading),
  45985. (this.blending = n.NormalBlending),
  45986. (this.wireframe = !1),
  45987. (this.wireframeLinewidth = 1),
  45988. (this.wireframeLinecap = 'round'),
  45989. (this.wireframeLinejoin = 'round'),
  45990. (this.vertexColors = n.NoColors),
  45991. (this.skinning = !1),
  45992. (this.morphTargets = !1),
  45993. (this.morphNormals = !1),
  45994. this.setValues(e)
  45995. }),
  45996. (n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype)),
  45997. (n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial),
  45998. (n.MeshStandardMaterial.prototype.copy = function (e) {
  45999. return (
  46000. n.Material.prototype.copy.call(this, e),
  46001. this.color.copy(e.color),
  46002. (this.roughness = e.roughness),
  46003. (this.metalness = e.metalness),
  46004. (this.map = e.map),
  46005. (this.lightMap = e.lightMap),
  46006. (this.lightMapIntensity = e.lightMapIntensity),
  46007. (this.aoMap = e.aoMap),
  46008. (this.aoMapIntensity = e.aoMapIntensity),
  46009. this.emissive.copy(e.emissive),
  46010. (this.emissiveMap = e.emissiveMap),
  46011. (this.emissiveIntensity = e.emissiveIntensity),
  46012. (this.bumpMap = e.bumpMap),
  46013. (this.bumpScale = e.bumpScale),
  46014. (this.normalMap = e.normalMap),
  46015. this.normalScale.copy(e.normalScale),
  46016. (this.displacementMap = e.displacementMap),
  46017. (this.displacementScale = e.displacementScale),
  46018. (this.displacementBias = e.displacementBias),
  46019. (this.roughnessMap = e.roughnessMap),
  46020. (this.metalnessMap = e.metalnessMap),
  46021. (this.alphaMap = e.alphaMap),
  46022. (this.envMap = e.envMap),
  46023. (this.envMapIntensity = e.envMapIntensity),
  46024. (this.refractionRatio = e.refractionRatio),
  46025. (this.fog = e.fog),
  46026. (this.shading = e.shading),
  46027. (this.wireframe = e.wireframe),
  46028. (this.wireframeLinewidth = e.wireframeLinewidth),
  46029. (this.wireframeLinecap = e.wireframeLinecap),
  46030. (this.wireframeLinejoin = e.wireframeLinejoin),
  46031. (this.vertexColors = e.vertexColors),
  46032. (this.skinning = e.skinning),
  46033. (this.morphTargets = e.morphTargets),
  46034. (this.morphNormals = e.morphNormals),
  46035. this
  46036. )
  46037. }),
  46038. (n.MeshDepthMaterial = function (e) {
  46039. n.Material.call(this), (this.type = 'MeshDepthMaterial'), (this.morphTargets = !1), (this.wireframe = !1), (this.wireframeLinewidth = 1), this.setValues(e)
  46040. }),
  46041. (n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype)),
  46042. (n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial),
  46043. (n.MeshDepthMaterial.prototype.copy = function (e) {
  46044. return n.Material.prototype.copy.call(this, e), (this.wireframe = e.wireframe), (this.wireframeLinewidth = e.wireframeLinewidth), this
  46045. }),
  46046. (n.MeshNormalMaterial = function (e) {
  46047. n.Material.call(this, e), (this.type = 'MeshNormalMaterial'), (this.wireframe = !1), (this.wireframeLinewidth = 1), (this.morphTargets = !1), this.setValues(e)
  46048. }),
  46049. (n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype)),
  46050. (n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial),
  46051. (n.MeshNormalMaterial.prototype.copy = function (e) {
  46052. return n.Material.prototype.copy.call(this, e), (this.wireframe = e.wireframe), (this.wireframeLinewidth = e.wireframeLinewidth), this
  46053. }),
  46054. (n.MultiMaterial = function (e) {
  46055. ;(this.uuid = n.Math.generateUUID()), (this.type = 'MultiMaterial'), (this.materials = e instanceof Array ? e : []), (this.visible = !0)
  46056. }),
  46057. (n.MultiMaterial.prototype = {
  46058. constructor: n.MultiMaterial,
  46059. toJSON: function (e) {
  46060. for (
  46061. var t = {
  46062. metadata: {
  46063. version: 4.2,
  46064. type: 'material',
  46065. generator: 'MaterialExporter'
  46066. },
  46067. uuid: this.uuid,
  46068. type: this.type,
  46069. materials: []
  46070. },
  46071. i = this.materials,
  46072. n = 0,
  46073. r = i.length;
  46074. n < r;
  46075. n++
  46076. ) {
  46077. var o = i[n].toJSON(e)
  46078. delete o.metadata, t.materials.push(o)
  46079. }
  46080. return (t.visible = this.visible), t
  46081. },
  46082. clone: function () {
  46083. for (var e = new this.constructor(), t = 0; t < this.materials.length; t++) e.materials.push(this.materials[t].clone())
  46084. return (e.visible = this.visible), e
  46085. }
  46086. }),
  46087. (n.PointsMaterial = function (e) {
  46088. n.Material.call(this),
  46089. (this.type = 'PointsMaterial'),
  46090. (this.color = new n.Color(16777215)),
  46091. (this.map = null),
  46092. (this.size = 1),
  46093. (this.sizeAttenuation = !0),
  46094. (this.blending = n.NormalBlending),
  46095. (this.vertexColors = n.NoColors),
  46096. (this.fog = !0),
  46097. this.setValues(e)
  46098. }),
  46099. (n.PointsMaterial.prototype = Object.create(n.Material.prototype)),
  46100. (n.PointsMaterial.prototype.constructor = n.PointsMaterial),
  46101. (n.PointsMaterial.prototype.copy = function (e) {
  46102. return (
  46103. n.Material.prototype.copy.call(this, e),
  46104. this.color.copy(e.color),
  46105. (this.map = e.map),
  46106. (this.size = e.size),
  46107. (this.sizeAttenuation = e.sizeAttenuation),
  46108. (this.vertexColors = e.vertexColors),
  46109. (this.fog = e.fog),
  46110. this
  46111. )
  46112. }),
  46113. (n.ShaderMaterial = function (e) {
  46114. n.Material.call(this),
  46115. (this.type = 'ShaderMaterial'),
  46116. (this.defines = {}),
  46117. (this.uniforms = {}),
  46118. (this.vertexShader = 'void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}'),
  46119. (this.fragmentShader = 'void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}'),
  46120. (this.shading = n.SmoothShading),
  46121. (this.linewidth = 1),
  46122. (this.wireframe = !1),
  46123. (this.wireframeLinewidth = 1),
  46124. (this.fog = !1),
  46125. (this.lights = !1),
  46126. (this.vertexColors = n.NoColors),
  46127. (this.skinning = !1),
  46128. (this.morphTargets = !1),
  46129. (this.morphNormals = !1),
  46130. (this.extensions = {
  46131. derivatives: !1,
  46132. fragDepth: !1,
  46133. drawBuffers: !1,
  46134. shaderTextureLOD: !1
  46135. }),
  46136. (this.defaultAttributeValues = {
  46137. color: [1, 1, 1],
  46138. uv: [0, 0],
  46139. uv2: [0, 0]
  46140. }),
  46141. (this.index0AttributeName = void 0),
  46142. void 0 !== e && (void 0 !== e.attributes && console.error('THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.'), this.setValues(e))
  46143. }),
  46144. (n.ShaderMaterial.prototype = Object.create(n.Material.prototype)),
  46145. (n.ShaderMaterial.prototype.constructor = n.ShaderMaterial),
  46146. (n.ShaderMaterial.prototype.copy = function (e) {
  46147. return (
  46148. n.Material.prototype.copy.call(this, e),
  46149. (this.fragmentShader = e.fragmentShader),
  46150. (this.vertexShader = e.vertexShader),
  46151. (this.uniforms = n.UniformsUtils.clone(e.uniforms)),
  46152. (this.defines = e.defines),
  46153. (this.shading = e.shading),
  46154. (this.wireframe = e.wireframe),
  46155. (this.wireframeLinewidth = e.wireframeLinewidth),
  46156. (this.fog = e.fog),
  46157. (this.lights = e.lights),
  46158. (this.vertexColors = e.vertexColors),
  46159. (this.skinning = e.skinning),
  46160. (this.morphTargets = e.morphTargets),
  46161. (this.morphNormals = e.morphNormals),
  46162. (this.extensions = e.extensions),
  46163. this
  46164. )
  46165. }),
  46166. (n.ShaderMaterial.prototype.toJSON = function (e) {
  46167. var t = n.Material.prototype.toJSON.call(this, e)
  46168. return (t.uniforms = this.uniforms), (t.vertexShader = this.vertexShader), (t.fragmentShader = this.fragmentShader), t
  46169. }),
  46170. (n.RawShaderMaterial = function (e) {
  46171. n.ShaderMaterial.call(this, e), (this.type = 'RawShaderMaterial')
  46172. }),
  46173. (n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype)),
  46174. (n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial),
  46175. (n.SpriteMaterial = function (e) {
  46176. n.Material.call(this), (this.type = 'SpriteMaterial'), (this.color = new n.Color(16777215)), (this.map = null), (this.rotation = 0), (this.fog = !1), this.setValues(e)
  46177. }),
  46178. (n.SpriteMaterial.prototype = Object.create(n.Material.prototype)),
  46179. (n.SpriteMaterial.prototype.constructor = n.SpriteMaterial),
  46180. (n.SpriteMaterial.prototype.copy = function (e) {
  46181. return n.Material.prototype.copy.call(this, e), this.color.copy(e.color), (this.map = e.map), (this.rotation = e.rotation), (this.fog = e.fog), this
  46182. }),
  46183. (n.Texture = function (e, t, i, r, o, a, s, l, c) {
  46184. Object.defineProperty(this, 'id', {
  46185. value: n.TextureIdCount++
  46186. }),
  46187. (this.uuid = n.Math.generateUUID()),
  46188. (this.name = ''),
  46189. (this.sourceFile = ''),
  46190. (this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE),
  46191. (this.mipmaps = []),
  46192. (this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING),
  46193. (this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping),
  46194. (this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping),
  46195. (this.magFilter = void 0 !== o ? o : n.LinearFilter),
  46196. (this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter),
  46197. (this.anisotropy = void 0 !== c ? c : 1),
  46198. (this.format = void 0 !== s ? s : n.RGBAFormat),
  46199. (this.type = void 0 !== l ? l : n.UnsignedByteType),
  46200. (this.offset = new n.Vector2(0, 0)),
  46201. (this.repeat = new n.Vector2(1, 1)),
  46202. (this.generateMipmaps = !0),
  46203. (this.premultiplyAlpha = !1),
  46204. (this.flipY = !0),
  46205. (this.unpackAlignment = 4),
  46206. (this.encoding = n.LinearEncoding),
  46207. (this.version = 0),
  46208. (this.onUpdate = null)
  46209. }),
  46210. (n.Texture.DEFAULT_IMAGE = void 0),
  46211. (n.Texture.DEFAULT_MAPPING = n.UVMapping),
  46212. (n.Texture.prototype = {
  46213. constructor: n.Texture,
  46214. set needsUpdate(e) {
  46215. e === !0 && this.version++
  46216. },
  46217. clone: function () {
  46218. return new this.constructor().copy(this)
  46219. },
  46220. copy: function (e) {
  46221. return (
  46222. (this.image = e.image),
  46223. (this.mipmaps = e.mipmaps.slice(0)),
  46224. (this.mapping = e.mapping),
  46225. (this.wrapS = e.wrapS),
  46226. (this.wrapT = e.wrapT),
  46227. (this.magFilter = e.magFilter),
  46228. (this.minFilter = e.minFilter),
  46229. (this.anisotropy = e.anisotropy),
  46230. (this.format = e.format),
  46231. (this.type = e.type),
  46232. this.offset.copy(e.offset),
  46233. this.repeat.copy(e.repeat),
  46234. (this.generateMipmaps = e.generateMipmaps),
  46235. (this.premultiplyAlpha = e.premultiplyAlpha),
  46236. (this.flipY = e.flipY),
  46237. (this.unpackAlignment = e.unpackAlignment),
  46238. (this.encoding = e.encoding),
  46239. this
  46240. )
  46241. },
  46242. toJSON: function (e) {
  46243. function t(e) {
  46244. var t
  46245. return (
  46246. void 0 !== e.toDataURL ? (t = e) : ((t = document.createElement('canvas')), (t.width = e.width), (t.height = e.height), t.getContext('2d').drawImage(e, 0, 0, e.width, e.height)),
  46247. t.width > 2048 || t.height > 2048 ? t.toDataURL('image/jpeg', 0.6) : t.toDataURL('image/png')
  46248. )
  46249. }
  46250. if (void 0 !== e.textures[this.uuid]) return e.textures[this.uuid]
  46251. var i = {
  46252. metadata: {
  46253. version: 4.4,
  46254. type: 'Texture',
  46255. generator: 'Texture.toJSON'
  46256. },
  46257. uuid: this.uuid,
  46258. name: this.name,
  46259. mapping: this.mapping,
  46260. repeat: [this.repeat.x, this.repeat.y],
  46261. offset: [this.offset.x, this.offset.y],
  46262. wrap: [this.wrapS, this.wrapT],
  46263. minFilter: this.minFilter,
  46264. magFilter: this.magFilter,
  46265. anisotropy: this.anisotropy
  46266. }
  46267. if (void 0 !== this.image) {
  46268. var r = this.image
  46269. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  46270. void 0 === e.images[r.uuid] &&
  46271. (e.images[r.uuid] = {
  46272. uuid: r.uuid,
  46273. url: t(r)
  46274. }),
  46275. (i.image = r.uuid)
  46276. }
  46277. return (e.textures[this.uuid] = i), i
  46278. },
  46279. dispose: function () {
  46280. this.dispatchEvent({
  46281. type: 'dispose'
  46282. })
  46283. },
  46284. transformUv: function (e) {
  46285. if (this.mapping === n.UVMapping) {
  46286. if ((e.multiply(this.repeat), e.add(this.offset), e.x < 0 || e.x > 1))
  46287. switch (this.wrapS) {
  46288. case n.RepeatWrapping:
  46289. e.x = e.x - Math.floor(e.x)
  46290. break
  46291. case n.ClampToEdgeWrapping:
  46292. e.x = e.x < 0 ? 0 : 1
  46293. break
  46294. case n.MirroredRepeatWrapping:
  46295. 1 === Math.abs(Math.floor(e.x) % 2) ? (e.x = Math.ceil(e.x) - e.x) : (e.x = e.x - Math.floor(e.x))
  46296. }
  46297. if (e.y < 0 || e.y > 1)
  46298. switch (this.wrapT) {
  46299. case n.RepeatWrapping:
  46300. e.y = e.y - Math.floor(e.y)
  46301. break
  46302. case n.ClampToEdgeWrapping:
  46303. e.y = e.y < 0 ? 0 : 1
  46304. break
  46305. case n.MirroredRepeatWrapping:
  46306. 1 === Math.abs(Math.floor(e.y) % 2) ? (e.y = Math.ceil(e.y) - e.y) : (e.y = e.y - Math.floor(e.y))
  46307. }
  46308. this.flipY && (e.y = 1 - e.y)
  46309. }
  46310. }
  46311. }),
  46312. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  46313. (n.TextureIdCount = 0),
  46314. (n.CanvasTexture = function (e, t, i, r, o, a, s, l, c) {
  46315. n.Texture.call(this, e, t, i, r, o, a, s, l, c), (this.needsUpdate = !0)
  46316. }),
  46317. (n.CanvasTexture.prototype = Object.create(n.Texture.prototype)),
  46318. (n.CanvasTexture.prototype.constructor = n.CanvasTexture),
  46319. (n.CubeTexture = function (e, t, i, r, o, a, s, l, c) {
  46320. ;(e = void 0 !== e ? e : []), (t = void 0 !== t ? t : n.CubeReflectionMapping), n.Texture.call(this, e, t, i, r, o, a, s, l, c), (this.flipY = !1)
  46321. }),
  46322. (n.CubeTexture.prototype = Object.create(n.Texture.prototype)),
  46323. (n.CubeTexture.prototype.constructor = n.CubeTexture),
  46324. Object.defineProperty(n.CubeTexture.prototype, 'images', {
  46325. get: function () {
  46326. return this.image
  46327. },
  46328. set: function (e) {
  46329. this.image = e
  46330. }
  46331. }),
  46332. (n.CompressedTexture = function (e, t, i, r, o, a, s, l, c, h, u) {
  46333. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  46334. (this.image = {
  46335. width: t,
  46336. height: i
  46337. }),
  46338. (this.mipmaps = e),
  46339. (this.flipY = !1),
  46340. (this.generateMipmaps = !1)
  46341. }),
  46342. (n.CompressedTexture.prototype = Object.create(n.Texture.prototype)),
  46343. (n.CompressedTexture.prototype.constructor = n.CompressedTexture),
  46344. (n.DataTexture = function (e, t, i, r, o, a, s, l, c, h, u) {
  46345. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  46346. (this.image = {
  46347. data: e,
  46348. width: t,
  46349. height: i
  46350. }),
  46351. (this.magFilter = void 0 !== c ? c : n.NearestFilter),
  46352. (this.minFilter = void 0 !== h ? h : n.NearestFilter),
  46353. (this.flipY = !1),
  46354. (this.generateMipmaps = !1)
  46355. }),
  46356. (n.DataTexture.prototype = Object.create(n.Texture.prototype)),
  46357. (n.DataTexture.prototype.constructor = n.DataTexture),
  46358. (n.VideoTexture = function (e, t, i, r, o, a, s, l, c) {
  46359. function h() {
  46360. requestAnimationFrame(h)
  46361. if (!e.paused && e.readyState === e.HAVE_ENOUGH_DATA) {
  46362. //改 add !e.paused
  46363. u.needsUpdate = !0
  46364. }
  46365. }
  46366. n.Texture.call(this, e, t, i, r, o, a, s, l, c), (this.generateMipmaps = !1)
  46367. var u = this
  46368. h()
  46369. }),
  46370. (n.VideoTexture.prototype = Object.create(n.Texture.prototype)),
  46371. (n.VideoTexture.prototype.constructor = n.VideoTexture),
  46372. (n.Group = function () {
  46373. n.Object3D.call(this), (this.type = 'Group')
  46374. }),
  46375. (n.Group.prototype = Object.create(n.Object3D.prototype)),
  46376. (n.Group.prototype.constructor = n.Group),
  46377. (n.Points = function (e, t) {
  46378. n.Object3D.call(this),
  46379. (this.type = 'Points'),
  46380. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  46381. (this.material =
  46382. void 0 !== t
  46383. ? t
  46384. : new n.PointsMaterial({
  46385. color: 16777215 * Math.random()
  46386. }))
  46387. }),
  46388. (n.Points.prototype = Object.create(n.Object3D.prototype)),
  46389. (n.Points.prototype.constructor = n.Points),
  46390. (n.Points.prototype.raycast = (function () {
  46391. var e = new n.Matrix4(),
  46392. t = new n.Ray(),
  46393. i = new n.Sphere()
  46394. return function (r, o) {
  46395. function a(e, i) {
  46396. var n = t.distanceSqToPoint(e)
  46397. if (n < d) {
  46398. var a = t.closestPointToPoint(e)
  46399. a.applyMatrix4(c)
  46400. var l = r.ray.origin.distanceTo(a)
  46401. if (l < r.near || l > r.far) return
  46402. o.push({
  46403. distance: l,
  46404. distanceToRay: Math.sqrt(n),
  46405. point: a.clone(),
  46406. index: i,
  46407. face: null,
  46408. object: s
  46409. })
  46410. }
  46411. }
  46412. var s = this,
  46413. l = this.geometry,
  46414. c = this.matrixWorld,
  46415. h = r.params.Points.threshold
  46416. if ((null === l.boundingSphere && l.computeBoundingSphere(), i.copy(l.boundingSphere), i.applyMatrix4(c), r.ray.intersectsSphere(i) !== !1)) {
  46417. e.getInverse(c), t.copy(r.ray).applyMatrix4(e)
  46418. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3),
  46419. d = u * u,
  46420. p = new n.Vector3()
  46421. if (l instanceof n.BufferGeometry) {
  46422. var f = l.index,
  46423. g = l.attributes,
  46424. m = g.position.array
  46425. if (null !== f)
  46426. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  46427. var C = v[A]
  46428. p.fromArray(m, 3 * C), a(p, C)
  46429. }
  46430. else for (var A = 0, I = m.length / 3; A < I; A++) p.fromArray(m, 3 * A), a(p, A)
  46431. } else for (var E = l.vertices, A = 0, I = E.length; A < I; A++) a(E[A], A)
  46432. }
  46433. }
  46434. })()),
  46435. (n.Points.prototype.clone = function () {
  46436. return new this.constructor(this.geometry, this.material).copy(this)
  46437. }),
  46438. (n.Line = function (e, t, i) {
  46439. return 1 === i
  46440. ? (console.warn('THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead.'), new n.LineSegments(e, t))
  46441. : (n.Object3D.call(this),
  46442. (this.type = 'Line'),
  46443. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  46444. void (this.material =
  46445. void 0 !== t
  46446. ? t
  46447. : new n.LineBasicMaterial({
  46448. color: 16777215 * Math.random()
  46449. })))
  46450. }),
  46451. (n.Line.prototype = Object.create(n.Object3D.prototype)),
  46452. (n.Line.prototype.constructor = n.Line),
  46453. (n.Line.prototype.raycast = (function () {
  46454. var e = new n.Matrix4(),
  46455. t = new n.Ray(),
  46456. i = new n.Sphere()
  46457. return function (r, o) {
  46458. var a = r.linePrecision,
  46459. s = a * a,
  46460. l = this.geometry,
  46461. c = this.matrixWorld
  46462. if ((null === l.boundingSphere && l.computeBoundingSphere(), i.copy(l.boundingSphere), i.applyMatrix4(c), r.ray.intersectsSphere(i) !== !1)) {
  46463. e.getInverse(c), t.copy(r.ray).applyMatrix4(e)
  46464. var h = new n.Vector3(),
  46465. u = new n.Vector3(),
  46466. d = new n.Vector3(),
  46467. p = new n.Vector3(),
  46468. f = this instanceof n.LineSegments ? 2 : 1
  46469. if (l instanceof n.BufferGeometry) {
  46470. var g = l.index,
  46471. m = l.attributes,
  46472. v = m.position.array
  46473. if (null !== g)
  46474. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  46475. var I = A[y],
  46476. E = A[y + 1]
  46477. h.fromArray(v, 3 * I), u.fromArray(v, 3 * E)
  46478. var b = t.distanceSqToSegment(h, u, p, d)
  46479. if (!(b > s)) {
  46480. p.applyMatrix4(this.matrixWorld)
  46481. var w = r.ray.origin.distanceTo(p)
  46482. w < r.near ||
  46483. w > r.far ||
  46484. o.push({
  46485. distance: w,
  46486. point: d.clone().applyMatrix4(this.matrixWorld),
  46487. index: y,
  46488. face: null,
  46489. faceIndex: null,
  46490. object: this
  46491. })
  46492. }
  46493. }
  46494. else
  46495. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  46496. h.fromArray(v, 3 * y), u.fromArray(v, 3 * y + 3)
  46497. var b = t.distanceSqToSegment(h, u, p, d)
  46498. if (!(b > s)) {
  46499. p.applyMatrix4(this.matrixWorld)
  46500. var w = r.ray.origin.distanceTo(p)
  46501. w < r.near ||
  46502. w > r.far ||
  46503. o.push({
  46504. distance: w,
  46505. point: d.clone().applyMatrix4(this.matrixWorld),
  46506. index: y,
  46507. face: null,
  46508. faceIndex: null,
  46509. object: this
  46510. })
  46511. }
  46512. }
  46513. } else if (l instanceof n.Geometry)
  46514. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  46515. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d)
  46516. if (!(b > s)) {
  46517. p.applyMatrix4(this.matrixWorld)
  46518. var w = r.ray.origin.distanceTo(p)
  46519. w < r.near ||
  46520. w > r.far ||
  46521. o.push({
  46522. distance: w,
  46523. point: d.clone().applyMatrix4(this.matrixWorld),
  46524. index: y,
  46525. face: null,
  46526. faceIndex: null,
  46527. object: this
  46528. })
  46529. }
  46530. }
  46531. }
  46532. }
  46533. })()),
  46534. (n.Line.prototype.clone = function () {
  46535. return new this.constructor(this.geometry, this.material).copy(this)
  46536. }),
  46537. (n.LineStrip = 0),
  46538. (n.LinePieces = 1),
  46539. (n.LineSegments = function (e, t) {
  46540. n.Line.call(this, e, t), (this.type = 'LineSegments')
  46541. }),
  46542. (n.LineSegments.prototype = Object.create(n.Line.prototype)),
  46543. (n.LineSegments.prototype.constructor = n.LineSegments),
  46544. (n.Mesh = function (e, t) {
  46545. n.Object3D.call(this),
  46546. (this.type = 'Mesh'),
  46547. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  46548. (this.material =
  46549. void 0 !== t
  46550. ? t
  46551. : new n.MeshBasicMaterial({
  46552. color: 16777215 * Math.random()
  46553. })),
  46554. (this.drawMode = n.TrianglesDrawMode),
  46555. this.updateMorphTargets()
  46556. }),
  46557. (n.Mesh.prototype = Object.create(n.Object3D.prototype)),
  46558. (n.Mesh.prototype.constructor = n.Mesh),
  46559. (n.Mesh.prototype.setDrawMode = function (e) {
  46560. this.drawMode = e
  46561. }),
  46562. (n.Mesh.prototype.updateMorphTargets = function () {
  46563. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  46564. ;(this.morphTargetBase = -1), (this.morphTargetInfluences = []), (this.morphTargetDictionary = {})
  46565. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++) this.morphTargetInfluences.push(0), (this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e)
  46566. }
  46567. }),
  46568. (n.Mesh.prototype.getMorphTargetIndexByName = function (e) {
  46569. return void 0 !== this.morphTargetDictionary[e]
  46570. ? this.morphTargetDictionary[e]
  46571. : (console.warn('THREE.Mesh.getMorphTargetIndexByName: morph target ' + e + ' does not exist. Returning 0.'), 0)
  46572. }),
  46573. (n.Mesh.prototype.raycast = (function () {
  46574. function e(e, t, i, r, o, a, s) {
  46575. return n.Triangle.barycoordFromPoint(e, t, i, r, m), o.multiplyScalar(m.x), a.multiplyScalar(m.y), s.multiplyScalar(m.z), o.add(a).add(s), o.clone()
  46576. }
  46577. function t(e, t, i, r, o, a, s) {
  46578. var l,
  46579. c = e.material
  46580. if (((l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s)), null === l)) return null
  46581. A.copy(s), A.applyMatrix4(e.matrixWorld)
  46582. var h = t.ray.origin.distanceTo(A)
  46583. return h < t.near || h > t.far
  46584. ? null
  46585. : {
  46586. distance: h,
  46587. point: A.clone(),
  46588. object: e
  46589. }
  46590. }
  46591. function i(i, r, o, a, h, u, d, m) {
  46592. s.fromArray(a, 3 * u), l.fromArray(a, 3 * d), c.fromArray(a, 3 * m)
  46593. var A = t(i, r, o, s, l, c, v)
  46594. return (
  46595. A &&
  46596. (h && (p.fromArray(h, 2 * u), f.fromArray(h, 2 * d), g.fromArray(h, 2 * m), (A.uv = e(v, s, l, c, p, f, g))),
  46597. (A.face = new n.Face3(u, d, m, n.Triangle.normal(s, l, c))),
  46598. (A.faceIndex = u)),
  46599. A
  46600. )
  46601. }
  46602. var r = new n.Matrix4(),
  46603. o = new n.Ray(),
  46604. a = new n.Sphere(),
  46605. s = new n.Vector3(),
  46606. l = new n.Vector3(),
  46607. c = new n.Vector3(),
  46608. h = new n.Vector3(),
  46609. u = new n.Vector3(),
  46610. d = new n.Vector3(),
  46611. p = new n.Vector2(),
  46612. f = new n.Vector2(),
  46613. g = new n.Vector2(),
  46614. m = new n.Vector3(),
  46615. v = new n.Vector3(),
  46616. A = new n.Vector3()
  46617. return function (m, A) {
  46618. var y = this.geometry,
  46619. C = this.material,
  46620. I = this.matrixWorld
  46621. if (
  46622. void 0 !== C &&
  46623. (null === y.boundingSphere && y.computeBoundingSphere(),
  46624. a.copy(y.boundingSphere),
  46625. a.applyMatrix4(I),
  46626. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I), o.copy(m.ray).applyMatrix4(r), null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))
  46627. ) {
  46628. var E, b
  46629. if (y instanceof n.BufferGeometry) {
  46630. var w,
  46631. _,
  46632. T,
  46633. x = y.index,
  46634. S = y.attributes,
  46635. M = S.position.array
  46636. if ((void 0 !== S.uv && (E = S.uv.array), null !== x))
  46637. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  46638. (w = R[P]), (_ = R[P + 1]), (T = R[P + 2]), (b = i(this, m, o, M, E, w, _, T)), b && ((b.faceIndex = Math.floor(P / 3)), A.push(b))
  46639. else for (var P = 0, O = M.length; P < O; P += 9) (w = P / 3), (_ = w + 1), (T = w + 2), (b = i(this, m, o, M, E, w, _, T)), b && ((b.index = w), A.push(b))
  46640. } else if (y instanceof n.Geometry) {
  46641. var L,
  46642. D,
  46643. N,
  46644. B = C instanceof n.MultiMaterial,
  46645. F = B === !0 ? C.materials : null,
  46646. V = y.vertices,
  46647. U = y.faces,
  46648. k = y.faceVertexUvs[0]
  46649. k.length > 0 && (E = k)
  46650. for (var H = 0, G = U.length; H < G; H++) {
  46651. var z = U[H],
  46652. W = B === !0 ? F[z.materialIndex] : C
  46653. if (void 0 !== W) {
  46654. if (((L = V[z.a]), (D = V[z.b]), (N = V[z.c]), W.morphTargets === !0)) {
  46655. var j = y.morphTargets,
  46656. Y = this.morphTargetInfluences
  46657. s.set(0, 0, 0), l.set(0, 0, 0), c.set(0, 0, 0)
  46658. for (var X = 0, Z = j.length; X < Z; X++) {
  46659. var q = Y[X]
  46660. if (0 !== q) {
  46661. var K = j[X].vertices
  46662. s.addScaledVector(h.subVectors(K[z.a], L), q), l.addScaledVector(u.subVectors(K[z.b], D), q), c.addScaledVector(d.subVectors(K[z.c], N), q)
  46663. }
  46664. }
  46665. s.add(L), l.add(D), c.add(N), (L = s), (D = l), (N = c)
  46666. }
  46667. if ((b = t(this, m, o, L, D, N, v))) {
  46668. if (E) {
  46669. var Q = E[H]
  46670. p.copy(Q[0]), f.copy(Q[1]), g.copy(Q[2]), (b.uv = e(v, L, D, N, p, f, g))
  46671. }
  46672. ;(b.face = z), (b.faceIndex = H), A.push(b)
  46673. }
  46674. }
  46675. }
  46676. }
  46677. }
  46678. }
  46679. })()),
  46680. (n.Mesh.prototype.clone = function () {
  46681. return new this.constructor(this.geometry, this.material).copy(this)
  46682. }),
  46683. (n.Bone = function (e) {
  46684. n.Object3D.call(this), (this.type = 'Bone'), (this.skin = e)
  46685. }),
  46686. (n.Bone.prototype = Object.create(n.Object3D.prototype)),
  46687. (n.Bone.prototype.constructor = n.Bone),
  46688. (n.Bone.prototype.copy = function (e) {
  46689. return n.Object3D.prototype.copy.call(this, e), (this.skin = e.skin), this
  46690. }),
  46691. (n.Skeleton = function (e, t, i) {
  46692. if (((this.useVertexTexture = void 0 === i || i), (this.identityMatrix = new n.Matrix4()), (e = e || []), (this.bones = e.slice(0)), this.useVertexTexture)) {
  46693. var r = Math.sqrt(4 * this.bones.length)
  46694. ;(r = n.Math.nextPowerOfTwo(Math.ceil(r))),
  46695. (r = Math.max(r, 4)),
  46696. (this.boneTextureWidth = r),
  46697. (this.boneTextureHeight = r),
  46698. (this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4)),
  46699. (this.boneTexture = new n.DataTexture(this.boneMatrices, this.boneTextureWidth, this.boneTextureHeight, n.RGBAFormat, n.FloatType))
  46700. } else this.boneMatrices = new Float32Array(16 * this.bones.length)
  46701. if (void 0 === t) this.calculateInverses()
  46702. else if (this.bones.length === t.length) this.boneInverses = t.slice(0)
  46703. else {
  46704. console.warn('THREE.Skeleton bonInverses is the wrong length.'), (this.boneInverses = [])
  46705. for (var o = 0, a = this.bones.length; o < a; o++) this.boneInverses.push(new n.Matrix4())
  46706. }
  46707. }),
  46708. (n.Skeleton.prototype.calculateInverses = function () {
  46709. this.boneInverses = []
  46710. for (var e = 0, t = this.bones.length; e < t; e++) {
  46711. var i = new n.Matrix4()
  46712. this.bones[e] && i.getInverse(this.bones[e].matrixWorld), this.boneInverses.push(i)
  46713. }
  46714. }),
  46715. (n.Skeleton.prototype.pose = function () {
  46716. for (var e, t = 0, i = this.bones.length; t < i; t++) (e = this.bones[t]), e && e.matrixWorld.getInverse(this.boneInverses[t])
  46717. for (var t = 0, i = this.bones.length; t < i; t++)
  46718. (e = this.bones[t]),
  46719. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld), e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld), e.matrix.decompose(e.position, e.quaternion, e.scale))
  46720. }),
  46721. (n.Skeleton.prototype.update = (function () {
  46722. var e = new n.Matrix4()
  46723. return function () {
  46724. for (var t = 0, i = this.bones.length; t < i; t++) {
  46725. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix
  46726. e.multiplyMatrices(n, this.boneInverses[t]), e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  46727. }
  46728. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  46729. }
  46730. })()),
  46731. (n.Skeleton.prototype.clone = function () {
  46732. return new n.Skeleton(this.bones, this.boneInverses, this.useVertexTexture)
  46733. }),
  46734. (n.SkinnedMesh = function (e, t, i) {
  46735. n.Mesh.call(this, e, t), (this.type = 'SkinnedMesh'), (this.bindMode = 'attached'), (this.bindMatrix = new n.Matrix4()), (this.bindMatrixInverse = new n.Matrix4())
  46736. var r = []
  46737. if (this.geometry && void 0 !== this.geometry.bones) {
  46738. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  46739. (a = this.geometry.bones[s]),
  46740. (o = new n.Bone(this)),
  46741. r.push(o),
  46742. (o.name = a.name),
  46743. o.position.fromArray(a.pos),
  46744. o.quaternion.fromArray(a.rotq),
  46745. void 0 !== a.scl && o.scale.fromArray(a.scl)
  46746. for (var s = 0, l = this.geometry.bones.length; s < l; ++s) (a = this.geometry.bones[s]), a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  46747. }
  46748. this.normalizeSkinWeights(), this.updateMatrixWorld(!0), this.bind(new n.Skeleton(r, void 0, i), this.matrixWorld)
  46749. }),
  46750. (n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype)),
  46751. (n.SkinnedMesh.prototype.constructor = n.SkinnedMesh),
  46752. (n.SkinnedMesh.prototype.bind = function (e, t) {
  46753. ;(this.skeleton = e), void 0 === t && (this.updateMatrixWorld(!0), this.skeleton.calculateInverses(), (t = this.matrixWorld)), this.bindMatrix.copy(t), this.bindMatrixInverse.getInverse(t)
  46754. }),
  46755. (n.SkinnedMesh.prototype.pose = function () {
  46756. this.skeleton.pose()
  46757. }),
  46758. (n.SkinnedMesh.prototype.normalizeSkinWeights = function () {
  46759. if (this.geometry instanceof n.Geometry)
  46760. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  46761. var t = this.geometry.skinWeights[e],
  46762. i = 1 / t.lengthManhattan()
  46763. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  46764. }
  46765. else if (this.geometry instanceof n.BufferGeometry)
  46766. for (var r = new n.Vector4(), o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  46767. ;(r.x = o.getX(e)), (r.y = o.getY(e)), (r.z = o.getZ(e)), (r.w = o.getW(e))
  46768. var i = 1 / r.lengthManhattan()
  46769. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0), o.setXYZW(e, r.x, r.y, r.z, r.w)
  46770. }
  46771. }),
  46772. (n.SkinnedMesh.prototype.updateMatrixWorld = function (e) {
  46773. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  46774. 'attached' === this.bindMode
  46775. ? this.bindMatrixInverse.getInverse(this.matrixWorld)
  46776. : 'detached' === this.bindMode
  46777. ? this.bindMatrixInverse.getInverse(this.bindMatrix)
  46778. : console.warn('THREE.SkinnedMesh unrecognized bindMode: ' + this.bindMode)
  46779. }),
  46780. (n.SkinnedMesh.prototype.clone = function () {
  46781. return new this.constructor(this.geometry, this.material, this.useVertexTexture).copy(this)
  46782. }),
  46783. (n.LOD = function () {
  46784. n.Object3D.call(this),
  46785. (this.type = 'LOD'),
  46786. Object.defineProperties(this, {
  46787. levels: {
  46788. enumerable: !0,
  46789. value: []
  46790. },
  46791. objects: {
  46792. get: function () {
  46793. return console.warn('THREE.LOD: .objects has been renamed to .levels.'), this.levels
  46794. }
  46795. }
  46796. })
  46797. }),
  46798. (n.LOD.prototype = Object.create(n.Object3D.prototype)),
  46799. (n.LOD.prototype.constructor = n.LOD),
  46800. (n.LOD.prototype.addLevel = function (e, t) {
  46801. void 0 === t && (t = 0), (t = Math.abs(t))
  46802. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++);
  46803. i.splice(n, 0, {
  46804. distance: t,
  46805. object: e
  46806. }),
  46807. this.add(e)
  46808. }),
  46809. (n.LOD.prototype.getObjectForDistance = function (e) {
  46810. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++);
  46811. return t[i - 1].object
  46812. }),
  46813. (n.LOD.prototype.raycast = (function () {
  46814. var e = new n.Vector3()
  46815. return function (t, i) {
  46816. e.setFromMatrixPosition(this.matrixWorld)
  46817. var n = t.ray.origin.distanceTo(e)
  46818. this.getObjectForDistance(n).raycast(t, i)
  46819. }
  46820. })()),
  46821. (n.LOD.prototype.update = (function () {
  46822. var e = new n.Vector3(),
  46823. t = new n.Vector3()
  46824. return function (i) {
  46825. var n = this.levels
  46826. if (n.length > 1) {
  46827. e.setFromMatrixPosition(i.matrixWorld), t.setFromMatrixPosition(this.matrixWorld)
  46828. var r = e.distanceTo(t)
  46829. n[0].object.visible = !0
  46830. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++) (n[o - 1].object.visible = !1), (n[o].object.visible = !0)
  46831. for (; o < a; o++) n[o].object.visible = !1
  46832. }
  46833. }
  46834. })()),
  46835. (n.LOD.prototype.copy = function (e) {
  46836. n.Object3D.prototype.copy.call(this, e, !1)
  46837. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  46838. var o = t[i]
  46839. this.addLevel(o.object.clone(), o.distance)
  46840. }
  46841. return this
  46842. }),
  46843. (n.LOD.prototype.toJSON = function (e) {
  46844. var t = n.Object3D.prototype.toJSON.call(this, e)
  46845. t.object.levels = []
  46846. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  46847. var a = i[r]
  46848. t.object.levels.push({
  46849. object: a.object.uuid,
  46850. distance: a.distance
  46851. })
  46852. }
  46853. return t
  46854. }),
  46855. (n.Sprite = (function () {
  46856. var e = new Uint16Array([0, 1, 2, 0, 2, 3]),
  46857. t = new Float32Array([-0.5, -0.5, 0, 0.5, -0.5, 0, 0.5, 0.5, 0, -0.5, 0.5, 0]),
  46858. i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  46859. r = new n.BufferGeometry()
  46860. return (
  46861. r.setIndex(new n.BufferAttribute(e, 1)),
  46862. r.addAttribute('position', new n.BufferAttribute(t, 3)),
  46863. r.addAttribute('uv', new n.BufferAttribute(i, 2)),
  46864. function (e) {
  46865. n.Object3D.call(this), (this.type = 'Sprite'), (this.geometry = r), (this.material = void 0 !== e ? e : new n.SpriteMaterial())
  46866. }
  46867. )
  46868. })()),
  46869. (n.Sprite.prototype = Object.create(n.Object3D.prototype)),
  46870. (n.Sprite.prototype.constructor = n.Sprite),
  46871. (n.Sprite.prototype.raycast = (function () {
  46872. var e = new n.Vector3()
  46873. return function (t, i) {
  46874. e.setFromMatrixPosition(this.matrixWorld)
  46875. var n = t.ray.distanceSqToPoint(e),
  46876. r = this.scale.x * this.scale.y
  46877. n > r ||
  46878. i.push({
  46879. distance: Math.sqrt(n),
  46880. point: this.position,
  46881. face: null,
  46882. object: this
  46883. })
  46884. }
  46885. })()),
  46886. (n.Sprite.prototype.clone = function () {
  46887. return new this.constructor(this.material).copy(this)
  46888. }),
  46889. (n.Particle = n.Sprite),
  46890. (n.LensFlare = function (e, t, i, r, o) {
  46891. n.Object3D.call(this), (this.lensFlares = []), (this.positionScreen = new n.Vector3()), (this.customUpdateCallback = void 0), void 0 !== e && this.add(e, t, i, r, o)
  46892. }),
  46893. (n.LensFlare.prototype = Object.create(n.Object3D.prototype)),
  46894. (n.LensFlare.prototype.constructor = n.LensFlare),
  46895. (n.LensFlare.prototype.add = function (e, t, i, r, o, a) {
  46896. void 0 === t && (t = -1),
  46897. void 0 === i && (i = 0),
  46898. void 0 === a && (a = 1),
  46899. void 0 === o && (o = new n.Color(16777215)),
  46900. void 0 === r && (r = n.NormalBlending),
  46901. (i = Math.min(i, Math.max(0, i))),
  46902. this.lensFlares.push({
  46903. texture: e,
  46904. size: t,
  46905. distance: i,
  46906. x: 0,
  46907. y: 0,
  46908. z: 0,
  46909. scale: 1,
  46910. rotation: 0,
  46911. opacity: a,
  46912. color: o,
  46913. blending: r
  46914. })
  46915. }),
  46916. (n.LensFlare.prototype.updateLensFlares = function () {
  46917. var e,
  46918. t,
  46919. i = this.lensFlares.length,
  46920. n = 2 * -this.positionScreen.x,
  46921. r = 2 * -this.positionScreen.y
  46922. for (e = 0; e < i; e++)
  46923. (t = this.lensFlares[e]),
  46924. (t.x = this.positionScreen.x + n * t.distance),
  46925. (t.y = this.positionScreen.y + r * t.distance),
  46926. (t.wantedRotation = t.x * Math.PI * 0.25),
  46927. (t.rotation += 0.25 * (t.wantedRotation - t.rotation))
  46928. }),
  46929. (n.LensFlare.prototype.copy = function (e) {
  46930. n.Object3D.prototype.copy.call(this, e), this.positionScreen.copy(e.positionScreen), (this.customUpdateCallback = e.customUpdateCallback)
  46931. for (var t = 0, i = e.lensFlares.length; t < i; t++) this.lensFlares.push(e.lensFlares[t])
  46932. return this
  46933. }),
  46934. (n.Scene = function () {
  46935. n.Object3D.call(this), (this.type = 'Scene'), (this.fog = null), (this.overrideMaterial = null), (this.autoUpdate = !0)
  46936. }),
  46937. (n.Scene.prototype = Object.create(n.Object3D.prototype)),
  46938. (n.Scene.prototype.constructor = n.Scene),
  46939. (n.Scene.prototype.copy = function (e, t) {
  46940. return (
  46941. n.Object3D.prototype.copy.call(this, e, t),
  46942. null !== e.fog && (this.fog = e.fog.clone()),
  46943. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  46944. (this.autoUpdate = e.autoUpdate),
  46945. (this.matrixAutoUpdate = e.matrixAutoUpdate),
  46946. this
  46947. )
  46948. }),
  46949. (n.Fog = function (e, t, i) {
  46950. ;(this.name = ''), (this.color = new n.Color(e)), (this.near = void 0 !== t ? t : 1), (this.far = void 0 !== i ? i : 1e3)
  46951. }),
  46952. (n.Fog.prototype.clone = function () {
  46953. return new n.Fog(this.color.getHex(), this.near, this.far)
  46954. }),
  46955. (n.FogExp2 = function (e, t) {
  46956. ;(this.name = ''), (this.color = new n.Color(e)), (this.density = void 0 !== t ? t : 25e-5)
  46957. }),
  46958. (n.FogExp2.prototype.clone = function () {
  46959. return new n.FogExp2(this.color.getHex(), this.density)
  46960. }),
  46961. (n.ShaderChunk = {}),
  46962. (n.ShaderChunk.alphamap_fragment = '#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n'),
  46963. (n.ShaderChunk.alphamap_pars_fragment = '#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n'),
  46964. (n.ShaderChunk.alphatest_fragment = '#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n'),
  46965. (n.ShaderChunk.aomap_fragment =
  46966. '#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'),
  46967. (n.ShaderChunk.aomap_pars_fragment = '#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif'),
  46968. (n.ShaderChunk.begin_vertex = '\nvec3 transformed = vec3( position );\n'),
  46969. (n.ShaderChunk.beginnormal_vertex = '\nvec3 objectNormal = vec3( normal );\n'),
  46970. (n.ShaderChunk.bsdfs =
  46971. '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'),
  46972. (n.ShaderChunk.bumpmap_pars_fragment =
  46973. '#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'),
  46974. (n.ShaderChunk.color_fragment = '#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif'),
  46975. (n.ShaderChunk.color_pars_fragment = '#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n'),
  46976. (n.ShaderChunk.color_pars_vertex = '#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif'),
  46977. (n.ShaderChunk.color_vertex = '#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif'),
  46978. (n.ShaderChunk.common =
  46979. '#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'),
  46980. (n.ShaderChunk.cube_uv_reflection_fragment =
  46981. '#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'),
  46982. (n.ShaderChunk.defaultnormal_vertex = '#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n'),
  46983. (n.ShaderChunk.displacementmap_vertex = '#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n'),
  46984. (n.ShaderChunk.displacementmap_pars_vertex =
  46985. '#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n'),
  46986. (n.ShaderChunk.emissivemap_fragment =
  46987. '#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n'),
  46988. (n.ShaderChunk.emissivemap_pars_fragment = '#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n'),
  46989. (n.ShaderChunk.encodings_pars_fragment =
  46990. '\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'),
  46991. (n.ShaderChunk.encodings_fragment = ' gl_FragColor = linearToOutputTexel( gl_FragColor );\n'),
  46992. (n.ShaderChunk.envmap_fragment =
  46993. '#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'),
  46994. (n.ShaderChunk.envmap_pars_fragment =
  46995. '#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'),
  46996. (n.ShaderChunk.envmap_pars_vertex =
  46997. '#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'),
  46998. (n.ShaderChunk.envmap_vertex =
  46999. '#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'),
  47000. (n.ShaderChunk.fog_fragment =
  47001. '#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'),
  47002. (n.ShaderChunk.fog_pars_fragment =
  47003. '#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'),
  47004. (n.ShaderChunk.lightmap_fragment = '#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n'),
  47005. (n.ShaderChunk.lightmap_pars_fragment = '#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif'),
  47006. (n.ShaderChunk.lights_lambert_vertex =
  47007. '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'),
  47008. (n.ShaderChunk.lights_pars =
  47009. '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'),
  47010. (n.ShaderChunk.lights_phong_fragment =
  47011. 'BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n'),
  47012. (n.ShaderChunk.lights_phong_pars_fragment =
  47013. '#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'),
  47014. (n.ShaderChunk.lights_phong_pars_vertex = '#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n'),
  47015. (n.ShaderChunk.lights_phong_vertex = '#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n'),
  47016. (n.ShaderChunk.lights_standard_fragment =
  47017. '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'),
  47018. (n.ShaderChunk.lights_standard_pars_fragment =
  47019. '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'),
  47020. (n.ShaderChunk.lights_template =
  47021. '\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'),
  47022. (n.ShaderChunk.logdepthbuf_fragment = '#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif'),
  47023. (n.ShaderChunk.logdepthbuf_pars_fragment = '#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n'),
  47024. (n.ShaderChunk.logdepthbuf_pars_vertex = '#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif'),
  47025. (n.ShaderChunk.logdepthbuf_vertex =
  47026. '#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'),
  47027. (n.ShaderChunk.map_fragment = '#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n'),
  47028. (n.ShaderChunk.map_pars_fragment = '#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n'),
  47029. (n.ShaderChunk.map_particle_fragment =
  47030. '#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'),
  47031. (n.ShaderChunk.map_particle_pars_fragment = '#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n'),
  47032. (n.ShaderChunk.metalnessmap_fragment =
  47033. 'float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n'),
  47034. (n.ShaderChunk.metalnessmap_pars_fragment = '#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif'),
  47035. (n.ShaderChunk.morphnormal_vertex =
  47036. '#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'),
  47037. (n.ShaderChunk.morphtarget_pars_vertex =
  47038. '#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')
  47039. n.ShaderChunk.morphtarget_vertex =
  47040. '#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'
  47041. ;(n.ShaderChunk.normal_fragment =
  47042. '#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'),
  47043. (n.ShaderChunk.normalmap_pars_fragment =
  47044. '#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'),
  47045. (n.ShaderChunk.premultiplied_alpha_fragment = '#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n'),
  47046. (n.ShaderChunk.project_vertex =
  47047. '#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'),
  47048. (n.ShaderChunk.roughnessmap_fragment =
  47049. 'float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n'),
  47050. (n.ShaderChunk.roughnessmap_pars_fragment = '#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif'),
  47051. (n.ShaderChunk.shadowmap_pars_fragment =
  47052. '#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'),
  47053. (n.ShaderChunk.shadowmap_pars_vertex =
  47054. '#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'),
  47055. (n.ShaderChunk.shadowmap_vertex =
  47056. '#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'),
  47057. (n.ShaderChunk.shadowmask_pars_fragment =
  47058. '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'),
  47059. (n.ShaderChunk.skinbase_vertex =
  47060. '#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'),
  47061. (n.ShaderChunk.skinning_pars_vertex =
  47062. '#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'),
  47063. (n.ShaderChunk.skinning_vertex =
  47064. '#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'),
  47065. (n.ShaderChunk.skinnormal_vertex =
  47066. '#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'),
  47067. (n.ShaderChunk.specularmap_fragment =
  47068. 'float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif'),
  47069. (n.ShaderChunk.specularmap_pars_fragment = '#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif'),
  47070. (n.ShaderChunk.tonemapping_fragment = '#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n'),
  47071. (n.ShaderChunk.tonemapping_pars_fragment =
  47072. '#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'),
  47073. (n.ShaderChunk.uv2_pars_fragment = '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif'),
  47074. (n.ShaderChunk.uv2_pars_vertex = '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif'),
  47075. (n.ShaderChunk.uv2_vertex = '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif'),
  47076. (n.ShaderChunk.uv_pars_fragment =
  47077. '#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'),
  47078. (n.ShaderChunk.uv_pars_vertex =
  47079. '#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'),
  47080. (n.ShaderChunk.uv_vertex =
  47081. '#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'),
  47082. (n.ShaderChunk.worldpos_vertex =
  47083. '#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'),
  47084. (n.UniformsUtils = {
  47085. merge: function (e) {
  47086. for (var t = {}, i = 0; i < e.length; i++) {
  47087. var n = this.clone(e[i])
  47088. for (var r in n) t[r] = n[r]
  47089. }
  47090. return t
  47091. },
  47092. clone: function (e) {
  47093. var t = {}
  47094. for (var i in e) {
  47095. t[i] = {}
  47096. for (var r in e[i]) {
  47097. var o = e[i][r]
  47098. o instanceof n.Color || o instanceof n.Vector2 || o instanceof n.Vector3 || o instanceof n.Vector4 || o instanceof n.Matrix3 || o instanceof n.Matrix4 || o instanceof n.Texture
  47099. ? (t[i][r] = o.clone())
  47100. : Array.isArray(o)
  47101. ? (t[i][r] = o.slice())
  47102. : (t[i][r] = o)
  47103. }
  47104. }
  47105. return t
  47106. }
  47107. }),
  47108. (n.UniformsLib = {
  47109. common: {
  47110. diffuse: {
  47111. type: 'c',
  47112. value: new n.Color(15658734)
  47113. },
  47114. opacity: {
  47115. type: 'f',
  47116. value: 1
  47117. },
  47118. map: {
  47119. type: 't',
  47120. value: null
  47121. },
  47122. offsetRepeat: {
  47123. type: 'v4',
  47124. value: new n.Vector4(0, 0, 1, 1)
  47125. },
  47126. specularMap: {
  47127. type: 't',
  47128. value: null
  47129. },
  47130. alphaMap: {
  47131. type: 't',
  47132. value: null
  47133. },
  47134. envMap: {
  47135. type: 't',
  47136. value: null
  47137. },
  47138. flipEnvMap: {
  47139. type: 'f',
  47140. value: -1
  47141. },
  47142. reflectivity: {
  47143. type: 'f',
  47144. value: 1
  47145. },
  47146. refractionRatio: {
  47147. type: 'f',
  47148. value: 0.98
  47149. }
  47150. },
  47151. aomap: {
  47152. aoMap: {
  47153. type: 't',
  47154. value: null
  47155. },
  47156. aoMapIntensity: {
  47157. type: 'f',
  47158. value: 1
  47159. }
  47160. },
  47161. lightmap: {
  47162. lightMap: {
  47163. type: 't',
  47164. value: null
  47165. },
  47166. lightMapIntensity: {
  47167. type: 'f',
  47168. value: 1
  47169. }
  47170. },
  47171. emissivemap: {
  47172. emissiveMap: {
  47173. type: 't',
  47174. value: null
  47175. }
  47176. },
  47177. bumpmap: {
  47178. bumpMap: {
  47179. type: 't',
  47180. value: null
  47181. },
  47182. bumpScale: {
  47183. type: 'f',
  47184. value: 1
  47185. }
  47186. },
  47187. normalmap: {
  47188. normalMap: {
  47189. type: 't',
  47190. value: null
  47191. },
  47192. normalScale: {
  47193. type: 'v2',
  47194. value: new n.Vector2(1, 1)
  47195. }
  47196. },
  47197. displacementmap: {
  47198. displacementMap: {
  47199. type: 't',
  47200. value: null
  47201. },
  47202. displacementScale: {
  47203. type: 'f',
  47204. value: 1
  47205. },
  47206. displacementBias: {
  47207. type: 'f',
  47208. value: 0
  47209. }
  47210. },
  47211. roughnessmap: {
  47212. roughnessMap: {
  47213. type: 't',
  47214. value: null
  47215. }
  47216. },
  47217. metalnessmap: {
  47218. metalnessMap: {
  47219. type: 't',
  47220. value: null
  47221. }
  47222. },
  47223. fog: {
  47224. fogDensity: {
  47225. type: 'f',
  47226. value: 25e-5
  47227. },
  47228. fogNear: {
  47229. type: 'f',
  47230. value: 1
  47231. },
  47232. fogFar: {
  47233. type: 'f',
  47234. value: 2e3
  47235. },
  47236. fogColor: {
  47237. type: 'c',
  47238. value: new n.Color(16777215)
  47239. }
  47240. },
  47241. lights: {
  47242. ambientLightColor: {
  47243. type: 'fv',
  47244. value: []
  47245. },
  47246. directionalLights: {
  47247. type: 'sa',
  47248. value: [],
  47249. properties: {
  47250. direction: {
  47251. type: 'v3'
  47252. },
  47253. color: {
  47254. type: 'c'
  47255. },
  47256. shadow: {
  47257. type: 'i'
  47258. },
  47259. shadowBias: {
  47260. type: 'f'
  47261. },
  47262. shadowRadius: {
  47263. type: 'f'
  47264. },
  47265. shadowMapSize: {
  47266. type: 'v2'
  47267. }
  47268. }
  47269. },
  47270. directionalShadowMap: {
  47271. type: 'tv',
  47272. value: []
  47273. },
  47274. directionalShadowMatrix: {
  47275. type: 'm4v',
  47276. value: []
  47277. },
  47278. spotLights: {
  47279. type: 'sa',
  47280. value: [],
  47281. properties: {
  47282. color: {
  47283. type: 'c'
  47284. },
  47285. position: {
  47286. type: 'v3'
  47287. },
  47288. direction: {
  47289. type: 'v3'
  47290. },
  47291. distance: {
  47292. type: 'f'
  47293. },
  47294. coneCos: {
  47295. type: 'f'
  47296. },
  47297. penumbraCos: {
  47298. type: 'f'
  47299. },
  47300. decay: {
  47301. type: 'f'
  47302. },
  47303. shadow: {
  47304. type: 'i'
  47305. },
  47306. shadowBias: {
  47307. type: 'f'
  47308. },
  47309. shadowRadius: {
  47310. type: 'f'
  47311. },
  47312. shadowMapSize: {
  47313. type: 'v2'
  47314. }
  47315. }
  47316. },
  47317. spotShadowMap: {
  47318. type: 'tv',
  47319. value: []
  47320. },
  47321. spotShadowMatrix: {
  47322. type: 'm4v',
  47323. value: []
  47324. },
  47325. pointLights: {
  47326. type: 'sa',
  47327. value: [],
  47328. properties: {
  47329. color: {
  47330. type: 'c'
  47331. },
  47332. position: {
  47333. type: 'v3'
  47334. },
  47335. decay: {
  47336. type: 'f'
  47337. },
  47338. distance: {
  47339. type: 'f'
  47340. },
  47341. shadow: {
  47342. type: 'i'
  47343. },
  47344. shadowBias: {
  47345. type: 'f'
  47346. },
  47347. shadowRadius: {
  47348. type: 'f'
  47349. },
  47350. shadowMapSize: {
  47351. type: 'v2'
  47352. }
  47353. }
  47354. },
  47355. pointShadowMap: {
  47356. type: 'tv',
  47357. value: []
  47358. },
  47359. pointShadowMatrix: {
  47360. type: 'm4v',
  47361. value: []
  47362. },
  47363. hemisphereLights: {
  47364. type: 'sa',
  47365. value: [],
  47366. properties: {
  47367. direction: {
  47368. type: 'v3'
  47369. },
  47370. skyColor: {
  47371. type: 'c'
  47372. },
  47373. groundColor: {
  47374. type: 'c'
  47375. }
  47376. }
  47377. }
  47378. },
  47379. points: {
  47380. diffuse: {
  47381. type: 'c',
  47382. value: new n.Color(15658734)
  47383. },
  47384. opacity: {
  47385. type: 'f',
  47386. value: 1
  47387. },
  47388. size: {
  47389. type: 'f',
  47390. value: 1
  47391. },
  47392. scale: {
  47393. type: 'f',
  47394. value: 1
  47395. },
  47396. map: {
  47397. type: 't',
  47398. value: null
  47399. },
  47400. offsetRepeat: {
  47401. type: 'v4',
  47402. value: new n.Vector4(0, 0, 1, 1)
  47403. }
  47404. }
  47405. }),
  47406. (n.ShaderChunk.cube_frag =
  47407. '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'),
  47408. (n.ShaderChunk.cube_vert =
  47409. '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'),
  47410. (n.ShaderChunk.depth_frag =
  47411. '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'),
  47412. (n.ShaderChunk.depth_vert =
  47413. '#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'),
  47414. (n.ShaderChunk.depthRGBA_frag =
  47415. '#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'),
  47416. (n.ShaderChunk.depthRGBA_vert =
  47417. '#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'),
  47418. (n.ShaderChunk.distanceRGBA_frag =
  47419. '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'),
  47420. (n.ShaderChunk.distanceRGBA_vert =
  47421. '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'),
  47422. (n.ShaderChunk.equirect_frag =
  47423. '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'),
  47424. (n.ShaderChunk.equirect_vert =
  47425. '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'),
  47426. (n.ShaderChunk.linedashed_frag =
  47427. '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'),
  47428. (n.ShaderChunk.linedashed_vert =
  47429. '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'),
  47430. (n.ShaderChunk.meshbasic_frag =
  47431. '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'),
  47432. (n.ShaderChunk.meshbasic_vert =
  47433. '#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'),
  47434. (n.ShaderChunk.meshlambert_frag =
  47435. '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'),
  47436. (n.ShaderChunk.meshlambert_vert =
  47437. '#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'),
  47438. (n.ShaderChunk.meshphong_frag =
  47439. '#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'),
  47440. (n.ShaderChunk.meshphong_vert =
  47441. '#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'),
  47442. (n.ShaderChunk.meshstandard_frag =
  47443. '#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'),
  47444. (n.ShaderChunk.meshstandard_vert =
  47445. '#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'),
  47446. (n.ShaderChunk.normal_frag =
  47447. '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'),
  47448. (n.ShaderChunk.normal_vert =
  47449. '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'),
  47450. (n.ShaderChunk.points_frag =
  47451. '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'),
  47452. (n.ShaderChunk.points_vert =
  47453. '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'),
  47454. (n.ShaderLib = {
  47455. basic: {
  47456. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  47457. vertexShader: n.ShaderChunk.meshbasic_vert,
  47458. fragmentShader: n.ShaderChunk.meshbasic_frag
  47459. },
  47460. lambert: {
  47461. uniforms: n.UniformsUtils.merge([
  47462. n.UniformsLib.common,
  47463. n.UniformsLib.aomap,
  47464. n.UniformsLib.lightmap,
  47465. n.UniformsLib.emissivemap,
  47466. n.UniformsLib.fog,
  47467. n.UniformsLib.lights,
  47468. {
  47469. emissive: {
  47470. type: 'c',
  47471. value: new n.Color(0)
  47472. }
  47473. }
  47474. ]),
  47475. vertexShader: n.ShaderChunk.meshlambert_vert,
  47476. fragmentShader: n.ShaderChunk.meshlambert_frag
  47477. },
  47478. phong: {
  47479. uniforms: n.UniformsUtils.merge([
  47480. n.UniformsLib.common,
  47481. n.UniformsLib.aomap,
  47482. n.UniformsLib.lightmap,
  47483. n.UniformsLib.emissivemap,
  47484. n.UniformsLib.bumpmap,
  47485. n.UniformsLib.normalmap,
  47486. n.UniformsLib.displacementmap,
  47487. n.UniformsLib.fog,
  47488. n.UniformsLib.lights,
  47489. {
  47490. emissive: {
  47491. type: 'c',
  47492. value: new n.Color(0)
  47493. },
  47494. specular: {
  47495. type: 'c',
  47496. value: new n.Color(1118481)
  47497. },
  47498. shininess: {
  47499. type: 'f',
  47500. value: 30
  47501. }
  47502. }
  47503. ]),
  47504. vertexShader: n.ShaderChunk.meshphong_vert,
  47505. fragmentShader: n.ShaderChunk.meshphong_frag
  47506. },
  47507. standard: {
  47508. uniforms: n.UniformsUtils.merge([
  47509. n.UniformsLib.common,
  47510. n.UniformsLib.aomap,
  47511. n.UniformsLib.lightmap,
  47512. n.UniformsLib.emissivemap,
  47513. n.UniformsLib.bumpmap,
  47514. n.UniformsLib.normalmap,
  47515. n.UniformsLib.displacementmap,
  47516. n.UniformsLib.roughnessmap,
  47517. n.UniformsLib.metalnessmap,
  47518. n.UniformsLib.fog,
  47519. n.UniformsLib.lights,
  47520. {
  47521. emissive: {
  47522. type: 'c',
  47523. value: new n.Color(0)
  47524. },
  47525. roughness: {
  47526. type: 'f',
  47527. value: 0.5
  47528. },
  47529. metalness: {
  47530. type: 'f',
  47531. value: 0
  47532. },
  47533. envMapIntensity: {
  47534. type: 'f',
  47535. value: 1
  47536. }
  47537. }
  47538. ]),
  47539. vertexShader: n.ShaderChunk.meshstandard_vert,
  47540. fragmentShader: n.ShaderChunk.meshstandard_frag
  47541. },
  47542. points: {
  47543. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  47544. vertexShader: n.ShaderChunk.points_vert,
  47545. fragmentShader: n.ShaderChunk.points_frag
  47546. },
  47547. dashed: {
  47548. uniforms: n.UniformsUtils.merge([
  47549. n.UniformsLib.common,
  47550. n.UniformsLib.fog,
  47551. {
  47552. scale: {
  47553. type: 'f',
  47554. value: 1
  47555. },
  47556. dashSize: {
  47557. type: 'f',
  47558. value: 1
  47559. },
  47560. totalSize: {
  47561. type: 'f',
  47562. value: 2
  47563. }
  47564. }
  47565. ]),
  47566. vertexShader: n.ShaderChunk.linedashed_vert,
  47567. fragmentShader: n.ShaderChunk.linedashed_frag
  47568. },
  47569. depth: {
  47570. uniforms: {
  47571. mNear: {
  47572. type: 'f',
  47573. value: 1
  47574. },
  47575. mFar: {
  47576. type: 'f',
  47577. value: 2e3
  47578. },
  47579. opacity: {
  47580. type: 'f',
  47581. value: 1
  47582. }
  47583. },
  47584. vertexShader: n.ShaderChunk.depth_vert,
  47585. fragmentShader: n.ShaderChunk.depth_frag
  47586. },
  47587. normal: {
  47588. uniforms: {
  47589. opacity: {
  47590. type: 'f',
  47591. value: 1
  47592. }
  47593. },
  47594. vertexShader: n.ShaderChunk.normal_vert,
  47595. fragmentShader: n.ShaderChunk.normal_frag
  47596. },
  47597. cube: {
  47598. uniforms: {
  47599. tCube: {
  47600. type: 't',
  47601. value: null
  47602. },
  47603. tFlip: {
  47604. type: 'f',
  47605. value: -1
  47606. }
  47607. },
  47608. vertexShader: n.ShaderChunk.cube_vert,
  47609. fragmentShader: n.ShaderChunk.cube_frag
  47610. },
  47611. equirect: {
  47612. uniforms: {
  47613. tEquirect: {
  47614. type: 't',
  47615. value: null
  47616. },
  47617. tFlip: {
  47618. type: 'f',
  47619. value: -1
  47620. }
  47621. },
  47622. vertexShader: n.ShaderChunk.equirect_vert,
  47623. fragmentShader: n.ShaderChunk.equirect_frag
  47624. },
  47625. depthRGBA: {
  47626. uniforms: {},
  47627. vertexShader: n.ShaderChunk.depthRGBA_vert,
  47628. fragmentShader: n.ShaderChunk.depthRGBA_frag
  47629. },
  47630. distanceRGBA: {
  47631. uniforms: {
  47632. lightPos: {
  47633. type: 'v3',
  47634. value: new n.Vector3(0, 0, 0)
  47635. }
  47636. },
  47637. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  47638. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  47639. }
  47640. }),
  47641. (n.WebGLRenderer = function (e) {
  47642. function t() {
  47643. return null === ye ? Oe : 1
  47644. }
  47645. function i(e, t, i, n) {
  47646. se === !0 && ((e *= n), (t *= n), (i *= n)), Ye.clearColor(e, t, i, n)
  47647. }
  47648. function r() {
  47649. Ye.init(), Ye.scissor(we.copy(Le).multiplyScalar(Oe)), Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)), i(Se.r, Se.g, Se.b, Me)
  47650. }
  47651. function o() {
  47652. ;(Ae = null), (be = null), (Ee = ''), (Ie = -1), Ye.reset()
  47653. }
  47654. function a(e) {
  47655. e.preventDefault(), o(), r(), Xe.clear()
  47656. }
  47657. function s(e) {
  47658. var t = e.target
  47659. t.removeEventListener('dispose', s), h(t), ke.textures--
  47660. }
  47661. function l(e) {
  47662. var t = e.target
  47663. t.removeEventListener('dispose', l), u(t), ke.textures--
  47664. }
  47665. function c(e) {
  47666. var t = e.target
  47667. t.removeEventListener('dispose', c), d(t)
  47668. }
  47669. function h(e) {
  47670. var t = Xe.get(e)
  47671. if (e.image && t.__image__webglTextureCube) Ge.deleteTexture(t.__image__webglTextureCube)
  47672. else {
  47673. if (void 0 === t.__webglInit) return
  47674. Ge.deleteTexture(t.__webglTexture)
  47675. }
  47676. Xe.delete(e)
  47677. }
  47678. function u(e) {
  47679. var t = Xe.get(e),
  47680. i = Xe.get(e.texture)
  47681. if (e && void 0 !== i.__webglTexture) {
  47682. if ((Ge.deleteTexture(i.__webglTexture), e instanceof n.WebGLRenderTargetCube))
  47683. for (var r = 0; r < 6; r++) Ge.deleteFramebuffer(t.__webglFramebuffer[r]), Ge.deleteRenderbuffer(t.__webglDepthbuffer[r])
  47684. else Ge.deleteFramebuffer(t.__webglFramebuffer), Ge.deleteRenderbuffer(t.__webglDepthbuffer)
  47685. Xe.delete(e.texture), Xe.delete(e)
  47686. }
  47687. }
  47688. function d(e) {
  47689. p(e), Xe.delete(e)
  47690. }
  47691. function p(e) {
  47692. var t = Xe.get(e).program
  47693. ;(e.program = void 0), void 0 !== t && qe.releaseProgram(t)
  47694. }
  47695. function f(e, t, i, r) {
  47696. var o
  47697. if (i instanceof n.InstancedBufferGeometry && ((o = We.get('ANGLE_instanced_arrays')), null === o))
  47698. return void console.error('THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.')
  47699. void 0 === r && (r = 0), Ye.initAttributes()
  47700. var a = i.attributes,
  47701. s = t.getAttributes(),
  47702. l = e.defaultAttributeValues
  47703. for (var c in s) {
  47704. var h = s[c]
  47705. if (h >= 0) {
  47706. var u = a[c]
  47707. if (void 0 !== u) {
  47708. var d = u.itemSize,
  47709. p = Ze.getAttributeBuffer(u)
  47710. if (u instanceof n.InterleavedBufferAttribute) {
  47711. var f = u.data,
  47712. g = f.stride,
  47713. m = u.offset
  47714. f instanceof n.InstancedInterleavedBuffer
  47715. ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o), void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count))
  47716. : Ye.enableAttribute(h),
  47717. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  47718. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  47719. } else
  47720. u instanceof n.InstancedBufferAttribute
  47721. ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o), void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count))
  47722. : Ye.enableAttribute(h),
  47723. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  47724. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  47725. } else if (void 0 !== l) {
  47726. var v = l[c]
  47727. if (void 0 !== v)
  47728. switch (v.length) {
  47729. case 2:
  47730. Ge.vertexAttrib2fv(h, v)
  47731. break
  47732. case 3:
  47733. Ge.vertexAttrib3fv(h, v)
  47734. break
  47735. case 4:
  47736. Ge.vertexAttrib4fv(h, v)
  47737. break
  47738. default:
  47739. Ge.vertexAttrib1fv(h, v)
  47740. }
  47741. }
  47742. }
  47743. }
  47744. Ye.disableUnusedAttributes()
  47745. }
  47746. function g(e, t) {
  47747. return Math.abs(t[0]) - Math.abs(e[0])
  47748. }
  47749. function m(e, t) {
  47750. return e.object.renderOrder !== t.object.renderOrder
  47751. ? e.object.renderOrder - t.object.renderOrder
  47752. : e.material.id !== t.material.id
  47753. ? e.material.id - t.material.id
  47754. : e.z !== t.z
  47755. ? e.z - t.z
  47756. : e.id - t.id
  47757. }
  47758. function v(e, t) {
  47759. return e.object.renderOrder !== t.object.renderOrder ? e.object.renderOrder - t.object.renderOrder : e.z !== t.z ? t.z - e.z : e.id - t.id
  47760. }
  47761. function A(e, t, i, n, r) {
  47762. var o, a
  47763. i.transparent ? ((o = de), (a = ++pe)) : ((o = he), (a = ++ue))
  47764. var s = o[a]
  47765. void 0 !== s
  47766. ? ((s.id = e.id), (s.object = e), (s.geometry = t), (s.material = i), (s.z = Ve.z), (s.group = r))
  47767. : ((s = {
  47768. id: e.id,
  47769. object: e,
  47770. geometry: t,
  47771. material: i,
  47772. z: Ve.z,
  47773. group: r
  47774. }),
  47775. o.push(s))
  47776. }
  47777. function y(e, t) {
  47778. if (e.visible !== !1) {
  47779. if (e.layers.test(t.layers))
  47780. if (e instanceof n.Light) ce.push(e)
  47781. else if (e instanceof n.Sprite) (e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0) || ge.push(e)
  47782. else if (e instanceof n.LensFlare) me.push(e)
  47783. else if (e instanceof n.ImmediateRenderObject) ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld), Ve.applyProjection(Fe)), A(e, null, e.material, Ve.z, null)
  47784. else if (
  47785. (e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) &&
  47786. (e instanceof n.SkinnedMesh && e.skeleton.update(), e.frustumCulled === !1 || Be.intersectsObject(e) === !0)
  47787. ) {
  47788. var i = e.material
  47789. if (i.visible === !0) {
  47790. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld), Ve.applyProjection(Fe))
  47791. var r = Ze.update(e)
  47792. if (i instanceof n.MultiMaterial)
  47793. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  47794. var c = o[s],
  47795. h = a[c.materialIndex]
  47796. h.visible === !0 && A(e, r, h, Ve.z, c)
  47797. }
  47798. else A(e, r, i, Ve.z, null)
  47799. }
  47800. }
  47801. for (var u = e.children, s = 0, l = u.length; s < l; s++) y(u[s], t)
  47802. }
  47803. }
  47804. function C(e, t, i, r) {
  47805. for (var o = 0, a = e.length; o < a; o++) {
  47806. var s = e[o],
  47807. l = s.object,
  47808. c = s.geometry,
  47809. h = void 0 === r ? s.material : r,
  47810. u = s.group
  47811. if ((l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld), l.normalMatrix.getNormalMatrix(l.modelViewMatrix), l instanceof n.ImmediateRenderObject)) {
  47812. E(h)
  47813. var d = w(t, i, h, l)
  47814. ;(Ee = ''),
  47815. l.render(function (e) {
  47816. ve.renderBufferImmediate(e, d, h)
  47817. })
  47818. } else ve.renderBufferDirect(t, i, c, h, l, u)
  47819. }
  47820. }
  47821. function I(e, t, i) {
  47822. var r = Xe.get(e),
  47823. o = qe.getParameters(e, Ue, t, i),
  47824. a = qe.getProgramCode(e, o),
  47825. s = r.program,
  47826. l = !0
  47827. if (void 0 === s) e.addEventListener('dispose', c)
  47828. else if (s.code !== a) p(e)
  47829. else {
  47830. if (void 0 !== o.shaderID) return
  47831. l = !1
  47832. }
  47833. if (l) {
  47834. if (o.shaderID) {
  47835. var h = n.ShaderLib[o.shaderID]
  47836. r.__webglShader = {
  47837. name: e.type,
  47838. uniforms: n.UniformsUtils.clone(h.uniforms),
  47839. vertexShader: h.vertexShader,
  47840. fragmentShader: h.fragmentShader
  47841. }
  47842. } else
  47843. r.__webglShader = {
  47844. name: e.type,
  47845. uniforms: e.uniforms,
  47846. vertexShader: e.vertexShader,
  47847. fragmentShader: e.fragmentShader
  47848. }
  47849. ;(e.__webglShader = r.__webglShader), (s = qe.acquireProgram(e, o, a)), (r.program = s), (e.program = s)
  47850. }
  47851. var u = s.getAttributes()
  47852. if (e.morphTargets) {
  47853. e.numSupportedMorphTargets = 0
  47854. for (var d = 0; d < ve.maxMorphTargets; d++) u['morphTarget' + d] >= 0 && e.numSupportedMorphTargets++
  47855. }
  47856. if (e.morphNormals) {
  47857. e.numSupportedMorphNormals = 0
  47858. for (var d = 0; d < ve.maxMorphNormals; d++) u['morphNormal' + d] >= 0 && e.numSupportedMorphNormals++
  47859. }
  47860. r.uniformsList = []
  47861. var f = r.__webglShader.uniforms,
  47862. g = r.program.getUniforms()
  47863. for (var m in f) {
  47864. var v = g[m]
  47865. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  47866. }
  47867. ;(e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) &&
  47868. ((r.lightsHash = Ue.hash),
  47869. (f.ambientLightColor.value = Ue.ambient),
  47870. (f.directionalLights.value = Ue.directional),
  47871. (f.spotLights.value = Ue.spot),
  47872. (f.pointLights.value = Ue.point),
  47873. (f.hemisphereLights.value = Ue.hemi),
  47874. (f.directionalShadowMap.value = Ue.directionalShadowMap),
  47875. (f.directionalShadowMatrix.value = Ue.directionalShadowMatrix),
  47876. (f.spotShadowMap.value = Ue.spotShadowMap),
  47877. (f.spotShadowMatrix.value = Ue.spotShadowMatrix),
  47878. (f.pointShadowMap.value = Ue.pointShadowMap),
  47879. (f.pointShadowMatrix.value = Ue.pointShadowMatrix)),
  47880. (r.hasDynamicUniforms = !1)
  47881. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  47882. var C = r.uniformsList[A][0]
  47883. if (C.dynamic === !0) {
  47884. r.hasDynamicUniforms = !0
  47885. break
  47886. }
  47887. }
  47888. }
  47889. function E(e) {
  47890. b(e),
  47891. e.transparent === !0
  47892. ? Ye.setBlending(e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha, e.premultipliedAlpha)
  47893. : Ye.setBlending(n.NoBlending),
  47894. Ye.setDepthFunc(e.depthFunc),
  47895. Ye.setDepthTest(e.depthTest),
  47896. Ye.setDepthWrite(e.depthWrite),
  47897. Ye.setColorWrite(e.colorWrite),
  47898. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  47899. }
  47900. function b(e) {
  47901. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE), Ye.setFlipSided(e.side === n.BackSide)
  47902. }
  47903. function w(e, t, i, r) {
  47904. xe = 0
  47905. var o = Xe.get(i)
  47906. void 0 === o.program && (i.needsUpdate = !0), void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0), i.needsUpdate && (I(i, t, r), (i.needsUpdate = !1))
  47907. var a = !1,
  47908. s = !1,
  47909. l = !1,
  47910. c = o.program,
  47911. h = c.getUniforms(),
  47912. u = o.__webglShader.uniforms
  47913. if (
  47914. (c.id !== Ae && (Ge.useProgram(c.program), (Ae = c.id), (a = !0), (s = !0), (l = !0)),
  47915. i.id !== Ie && ((Ie = i.id), (s = !0)),
  47916. (a || e !== be) &&
  47917. (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  47918. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  47919. e !== be && ((be = e), (s = !0), (l = !0)),
  47920. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) &&
  47921. void 0 !== h.cameraPosition &&
  47922. (Ve.setFromMatrixPosition(e.matrixWorld), Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  47923. (i instanceof n.MeshPhongMaterial ||
  47924. i instanceof n.MeshLambertMaterial ||
  47925. i instanceof n.MeshBasicMaterial ||
  47926. i instanceof n.MeshStandardMaterial ||
  47927. i instanceof n.ShaderMaterial ||
  47928. i.skinning) &&
  47929. void 0 !== h.viewMatrix &&
  47930. Ge.uniformMatrix4fv(h.viewMatrix, !1, e.matrixWorldInverse.elements),
  47931. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  47932. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  47933. i.skinning)
  47934. )
  47935. if (
  47936. (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  47937. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  47938. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture)
  47939. ) {
  47940. if (void 0 !== h.boneTexture) {
  47941. var d = B()
  47942. Ge.uniform1i(h.boneTexture, d), ve.setTexture(r.skeleton.boneTexture, d)
  47943. }
  47944. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  47945. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  47946. } else r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices)
  47947. return (
  47948. s &&
  47949. ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  47950. t && i.fog && R(u, t),
  47951. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  47952. i instanceof n.LineBasicMaterial
  47953. ? x(u, i)
  47954. : i instanceof n.LineDashedMaterial
  47955. ? (x(u, i), S(u, i))
  47956. : i instanceof n.PointsMaterial
  47957. ? M(u, i)
  47958. : i instanceof n.MeshLambertMaterial
  47959. ? P(u, i)
  47960. : i instanceof n.MeshPhongMaterial
  47961. ? O(u, i)
  47962. : i instanceof n.MeshStandardMaterial
  47963. ? L(u, i)
  47964. : i instanceof n.MeshDepthMaterial
  47965. ? ((u.mNear.value = e.near), (u.mFar.value = e.far), (u.opacity.value = i.opacity))
  47966. : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  47967. V(o.uniformsList)),
  47968. N(h, r),
  47969. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  47970. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  47971. c
  47972. )
  47973. }
  47974. function _(e, t, i) {
  47975. for (var n = [], r = 0, o = e.length; r < o; r++) {
  47976. var a = e[r][0],
  47977. s = a.onUpdateCallback
  47978. void 0 !== s && (s.bind(a)(t, i), n.push(e[r]))
  47979. }
  47980. V(n)
  47981. }
  47982. function T(e, t) {
  47983. ;(e.opacity.value = t.opacity),
  47984. (e.diffuse.value = t.color),
  47985. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  47986. (e.map.value = t.map),
  47987. (e.specularMap.value = t.specularMap),
  47988. (e.alphaMap.value = t.alphaMap),
  47989. t.aoMap && ((e.aoMap.value = t.aoMap), (e.aoMapIntensity.value = t.aoMapIntensity))
  47990. var i
  47991. if (
  47992. (t.map
  47993. ? (i = t.map)
  47994. : t.specularMap
  47995. ? (i = t.specularMap)
  47996. : t.displacementMap
  47997. ? (i = t.displacementMap)
  47998. : t.normalMap
  47999. ? (i = t.normalMap)
  48000. : t.bumpMap
  48001. ? (i = t.bumpMap)
  48002. : t.roughnessMap
  48003. ? (i = t.roughnessMap)
  48004. : t.metalnessMap
  48005. ? (i = t.metalnessMap)
  48006. : t.alphaMap
  48007. ? (i = t.alphaMap)
  48008. : t.emissiveMap && (i = t.emissiveMap),
  48009. void 0 !== i)
  48010. ) {
  48011. i instanceof n.WebGLRenderTarget && (i = i.texture)
  48012. var r = i.offset,
  48013. o = i.repeat
  48014. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  48015. }
  48016. ;(e.envMap.value = t.envMap),
  48017. (e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1),
  48018. (e.reflectivity.value = t.reflectivity),
  48019. (e.refractionRatio.value = t.refractionRatio)
  48020. }
  48021. function x(e, t) {
  48022. ;(e.diffuse.value = t.color), (e.opacity.value = t.opacity)
  48023. }
  48024. function S(e, t) {
  48025. ;(e.dashSize.value = t.dashSize), (e.totalSize.value = t.dashSize + t.gapSize), (e.scale.value = t.scale)
  48026. }
  48027. function M(e, t) {
  48028. if (((e.diffuse.value = t.color), (e.opacity.value = t.opacity), (e.size.value = t.size * Oe), (e.scale.value = te.clientHeight / 2), (e.map.value = t.map), null !== t.map)) {
  48029. var i = t.map.offset,
  48030. n = t.map.repeat
  48031. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  48032. }
  48033. }
  48034. function R(e, t) {
  48035. ;(e.fogColor.value = t.color), t instanceof n.Fog ? ((e.fogNear.value = t.near), (e.fogFar.value = t.far)) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  48036. }
  48037. function P(e, t) {
  48038. t.lightMap && ((e.lightMap.value = t.lightMap), (e.lightMapIntensity.value = t.lightMapIntensity)), t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  48039. }
  48040. function O(e, t) {
  48041. ;(e.specular.value = t.specular),
  48042. (e.shininess.value = Math.max(t.shininess, 1e-4)),
  48043. t.lightMap && ((e.lightMap.value = t.lightMap), (e.lightMapIntensity.value = t.lightMapIntensity)),
  48044. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48045. t.bumpMap && ((e.bumpMap.value = t.bumpMap), (e.bumpScale.value = t.bumpScale)),
  48046. t.normalMap && ((e.normalMap.value = t.normalMap), e.normalScale.value.copy(t.normalScale)),
  48047. t.displacementMap && ((e.displacementMap.value = t.displacementMap), (e.displacementScale.value = t.displacementScale), (e.displacementBias.value = t.displacementBias))
  48048. }
  48049. function L(e, t) {
  48050. ;(e.roughness.value = t.roughness),
  48051. (e.metalness.value = t.metalness),
  48052. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  48053. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  48054. t.lightMap && ((e.lightMap.value = t.lightMap), (e.lightMapIntensity.value = t.lightMapIntensity)),
  48055. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48056. t.bumpMap && ((e.bumpMap.value = t.bumpMap), (e.bumpScale.value = t.bumpScale)),
  48057. t.normalMap && ((e.normalMap.value = t.normalMap), e.normalScale.value.copy(t.normalScale)),
  48058. t.displacementMap && ((e.displacementMap.value = t.displacementMap), (e.displacementScale.value = t.displacementScale), (e.displacementBias.value = t.displacementBias)),
  48059. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  48060. }
  48061. function D(e, t) {
  48062. ;(e.ambientLightColor.needsUpdate = t), (e.directionalLights.needsUpdate = t), (e.pointLights.needsUpdate = t), (e.spotLights.needsUpdate = t), (e.hemisphereLights.needsUpdate = t)
  48063. }
  48064. function N(e, t) {
  48065. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements), e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  48066. }
  48067. function B() {
  48068. var e = xe
  48069. return e >= je.maxTextures && console.warn('WebGLRenderer: trying to use ' + e + ' texture units while this GPU supports only ' + je.maxTextures), (xe += 1), e
  48070. }
  48071. function F(e, t, i, r) {
  48072. var o, a
  48073. if ('1i' === t) Ge.uniform1i(i, r)
  48074. else if ('1f' === t) Ge.uniform1f(i, r)
  48075. else if ('2f' === t) Ge.uniform2f(i, r[0], r[1])
  48076. else if ('3f' === t) Ge.uniform3f(i, r[0], r[1], r[2])
  48077. else if ('4f' === t) Ge.uniform4f(i, r[0], r[1], r[2], r[3])
  48078. else if ('1iv' === t) Ge.uniform1iv(i, r)
  48079. else if ('3iv' === t) Ge.uniform3iv(i, r)
  48080. else if ('1fv' === t) Ge.uniform1fv(i, r)
  48081. else if ('2fv' === t) Ge.uniform2fv(i, r)
  48082. else if ('3fv' === t) Ge.uniform3fv(i, r)
  48083. else if ('4fv' === t) Ge.uniform4fv(i, r)
  48084. else if ('Matrix2fv' === t) Ge.uniformMatrix2fv(i, !1, r)
  48085. else if ('Matrix3fv' === t) Ge.uniformMatrix3fv(i, !1, r)
  48086. else if ('Matrix4fv' === t) Ge.uniformMatrix4fv(i, !1, r)
  48087. else if ('i' === t) Ge.uniform1i(i, r)
  48088. else if ('f' === t) Ge.uniform1f(i, r)
  48089. else if ('v2' === t) Ge.uniform2f(i, r.x, r.y)
  48090. else if ('v3' === t) Ge.uniform3f(i, r.x, r.y, r.z)
  48091. else if ('v4' === t) Ge.uniform4f(i, r.x, r.y, r.z, r.w)
  48092. else if ('c' === t) Ge.uniform3f(i, r.r, r.g, r.b)
  48093. else if ('s' === t) {
  48094. var s = e.properties
  48095. for (var l in s) {
  48096. var c = s[l],
  48097. h = i[l],
  48098. u = r[l]
  48099. F(c, c.type, h, u)
  48100. }
  48101. } else if ('sa' === t)
  48102. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  48103. for (var l in s) {
  48104. var c = s[l],
  48105. h = i[d][l],
  48106. u = r[d][l]
  48107. F(c, c.type, h, u)
  48108. }
  48109. else if ('iv1' === t) Ge.uniform1iv(i, r)
  48110. else if ('iv' === t) Ge.uniform3iv(i, r)
  48111. else if ('fv1' === t) Ge.uniform1fv(i, r)
  48112. else if ('fv' === t) Ge.uniform3fv(i, r)
  48113. else if ('v2v' === t) {
  48114. void 0 === e._array && (e._array = new Float32Array(2 * r.length))
  48115. for (var d = 0, f = 0, g = r.length; d < g; d++, f += 2) (e._array[f + 0] = r[d].x), (e._array[f + 1] = r[d].y)
  48116. Ge.uniform2fv(i, e._array)
  48117. } else if ('v3v' === t) {
  48118. void 0 === e._array && (e._array = new Float32Array(3 * r.length))
  48119. for (var d = 0, m = 0, g = r.length; d < g; d++, m += 3) (e._array[m + 0] = r[d].x), (e._array[m + 1] = r[d].y), (e._array[m + 2] = r[d].z)
  48120. Ge.uniform3fv(i, e._array)
  48121. } else if ('v4v' === t) {
  48122. void 0 === e._array && (e._array = new Float32Array(4 * r.length))
  48123. for (var d = 0, v = 0, g = r.length; d < g; d++, v += 4) (e._array[v + 0] = r[d].x), (e._array[v + 1] = r[d].y), (e._array[v + 2] = r[d].z), (e._array[v + 3] = r[d].w)
  48124. Ge.uniform4fv(i, e._array)
  48125. } else if ('m2' === t) Ge.uniformMatrix2fv(i, !1, r.elements)
  48126. else if ('m3' === t) Ge.uniformMatrix3fv(i, !1, r.elements)
  48127. else if ('m3v' === t) {
  48128. void 0 === e._array && (e._array = new Float32Array(9 * r.length))
  48129. for (var d = 0, g = r.length; d < g; d++) r[d].flattenToArrayOffset(e._array, 9 * d)
  48130. Ge.uniformMatrix3fv(i, !1, e._array)
  48131. } else if ('m4' === t) Ge.uniformMatrix4fv(i, !1, r.elements)
  48132. else if ('m4v' === t) {
  48133. void 0 === e._array && (e._array = new Float32Array(16 * r.length))
  48134. for (var d = 0, g = r.length; d < g; d++) r[d].flattenToArrayOffset(e._array, 16 * d)
  48135. Ge.uniformMatrix4fv(i, !1, e._array)
  48136. } else if ('t' === t) {
  48137. if (((o = r), (a = B()), Ge.uniform1i(i, a), !o)) return
  48138. o instanceof n.CubeTexture || (Array.isArray(o.image) && 6 === o.image.length)
  48139. ? Y(o, a)
  48140. : o instanceof n.WebGLRenderTargetCube
  48141. ? X(o.texture, a)
  48142. : o instanceof n.WebGLRenderTarget
  48143. ? ve.setTexture(o.texture, a)
  48144. : ve.setTexture(o, a)
  48145. } else if ('tv' === t) {
  48146. void 0 === e._array && (e._array = [])
  48147. for (var d = 0, g = e.value.length; d < g; d++) e._array[d] = B()
  48148. Ge.uniform1iv(i, e._array)
  48149. for (var d = 0, g = e.value.length; d < g; d++)
  48150. (o = e.value[d]),
  48151. (a = e._array[d]),
  48152. o &&
  48153. (o instanceof n.CubeTexture || (o.image instanceof Array && 6 === o.image.length)
  48154. ? Y(o, a)
  48155. : o instanceof n.WebGLRenderTarget
  48156. ? ve.setTexture(o.texture, a)
  48157. : o instanceof n.WebGLRenderTargetCube
  48158. ? X(o.texture, a)
  48159. : ve.setTexture(o, a))
  48160. } else console.warn('THREE.WebGLRenderer: Unknown uniform type: ' + t)
  48161. }
  48162. function V(e) {
  48163. for (var t = 0, i = e.length; t < i; t++) {
  48164. var n = e[t][0]
  48165. if (n.needsUpdate !== !1) {
  48166. var r = n.type,
  48167. o = e[t][1],
  48168. a = n.value
  48169. F(n, r, o, a)
  48170. }
  48171. }
  48172. }
  48173. function U(e, t) {
  48174. var i,
  48175. r,
  48176. o,
  48177. a,
  48178. s,
  48179. l,
  48180. c = 0,
  48181. h = 0,
  48182. u = 0,
  48183. d = t.matrixWorldInverse,
  48184. p = 0,
  48185. f = 0,
  48186. g = 0,
  48187. m = 0,
  48188. v = 0
  48189. for (Ue.shadowsPointLight = 0, i = 0, r = e.length; i < r; i++)
  48190. if (((o = e[i]), (a = o.color), (s = o.intensity), (l = o.distance), o instanceof n.AmbientLight)) (c += a.r * s), (h += a.g * s), (u += a.b * s)
  48191. else if (o instanceof n.DirectionalLight) {
  48192. var A = Ke.get(o)
  48193. A.color.copy(o.color).multiplyScalar(o.intensity),
  48194. A.direction.setFromMatrixPosition(o.matrixWorld),
  48195. Ve.setFromMatrixPosition(o.target.matrixWorld),
  48196. A.direction.sub(Ve),
  48197. A.direction.transformDirection(d),
  48198. (A.shadow = o.castShadow),
  48199. o.castShadow && ((A.shadowBias = o.shadow.bias), (A.shadowRadius = o.shadow.radius), (A.shadowMapSize = o.shadow.mapSize), (Ue.shadows[v++] = o)),
  48200. (Ue.directionalShadowMap[p] = o.shadow.map),
  48201. (Ue.directionalShadowMatrix[p] = o.shadow.matrix),
  48202. (Ue.directional[p++] = A)
  48203. } else if (o instanceof n.SpotLight) {
  48204. var A = Ke.get(o)
  48205. A.position.setFromMatrixPosition(o.matrixWorld),
  48206. A.position.applyMatrix4(d),
  48207. A.color.copy(a).multiplyScalar(s),
  48208. (A.distance = l),
  48209. A.direction.setFromMatrixPosition(o.matrixWorld),
  48210. Ve.setFromMatrixPosition(o.target.matrixWorld),
  48211. A.direction.sub(Ve),
  48212. A.direction.transformDirection(d),
  48213. (A.coneCos = Math.cos(o.angle)),
  48214. (A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra))),
  48215. (A.decay = 0 === o.distance ? 0 : o.decay),
  48216. (A.shadow = o.castShadow),
  48217. o.castShadow && ((A.shadowBias = o.shadow.bias), (A.shadowRadius = o.shadow.radius), (A.shadowMapSize = o.shadow.mapSize), (Ue.shadows[v++] = o)),
  48218. (Ue.spotShadowMap[g] = o.shadow.map),
  48219. (Ue.spotShadowMatrix[g] = o.shadow.matrix),
  48220. (Ue.spot[g++] = A)
  48221. } else if (o instanceof n.PointLight) {
  48222. var A = Ke.get(o)
  48223. A.position.setFromMatrixPosition(o.matrixWorld),
  48224. A.position.applyMatrix4(d),
  48225. A.color.copy(o.color).multiplyScalar(o.intensity),
  48226. (A.distance = o.distance),
  48227. (A.decay = 0 === o.distance ? 0 : o.decay),
  48228. (A.shadow = o.castShadow),
  48229. o.castShadow && ((A.shadowBias = o.shadow.bias), (A.shadowRadius = o.shadow.radius), (A.shadowMapSize = o.shadow.mapSize), (Ue.shadows[v++] = o)),
  48230. (Ue.pointShadowMap[f] = o.shadow.map),
  48231. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4()),
  48232. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  48233. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  48234. (Ue.point[f++] = A)
  48235. } else if (o instanceof n.HemisphereLight) {
  48236. var A = Ke.get(o)
  48237. A.direction.setFromMatrixPosition(o.matrixWorld),
  48238. A.direction.transformDirection(d),
  48239. A.direction.normalize(),
  48240. A.skyColor.copy(o.color).multiplyScalar(s),
  48241. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  48242. (Ue.hemi[m++] = A)
  48243. }
  48244. ;(Ue.ambient[0] = c),
  48245. (Ue.ambient[1] = h),
  48246. (Ue.ambient[2] = u),
  48247. (Ue.directional.length = p),
  48248. (Ue.spot.length = g),
  48249. (Ue.point.length = f),
  48250. (Ue.hemi.length = m),
  48251. (Ue.shadows.length = v),
  48252. (Ue.hash = p + ',' + f + ',' + g + ',' + m + ',' + v)
  48253. }
  48254. function k(e, t, i) {
  48255. var r
  48256. if (
  48257. (i
  48258. ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  48259. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  48260. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  48261. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter)))
  48262. : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  48263. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  48264. (t.wrapS === n.ClampToEdgeWrapping && t.wrapT === n.ClampToEdgeWrapping) ||
  48265. console.warn('THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.', t),
  48266. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  48267. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  48268. t.minFilter !== n.NearestFilter &&
  48269. t.minFilter !== n.LinearFilter &&
  48270. console.warn('THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.', t)),
  48271. (r = We.get('EXT_texture_filter_anisotropic')))
  48272. ) {
  48273. if (t.type === n.FloatType && null === We.get('OES_texture_float_linear')) return
  48274. if (t.type === n.HalfFloatType && null === We.get('OES_texture_half_float_linear')) return
  48275. ;(t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) &&
  48276. (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())), (Xe.get(t).__currentAnisotropy = t.anisotropy))
  48277. }
  48278. }
  48279. function H(e, t, i) {
  48280. void 0 === e.__webglInit && ((e.__webglInit = !0), t.addEventListener('dispose', s), (e.__webglTexture = Ge.createTexture()), ke.textures++),
  48281. Ye.activeTexture(Ge.TEXTURE0 + i),
  48282. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  48283. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  48284. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  48285. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment)
  48286. var r = G(t.image, je.maxTextureSize)
  48287. W(t) && z(r) === !1 && (r = j(r))
  48288. var o = z(r),
  48289. a = ee(t.format),
  48290. l = ee(t.type)
  48291. k(Ge.TEXTURE_2D, t, o)
  48292. var c,
  48293. h = t.mipmaps
  48294. if (t instanceof n.DataTexture)
  48295. if (h.length > 0 && o) {
  48296. for (var u = 0, d = h.length; u < d; u++) (c = h[u]), Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data)
  48297. t.generateMipmaps = !1
  48298. } else Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data)
  48299. else if (t instanceof n.CompressedTexture)
  48300. for (var u = 0, d = h.length; u < d; u++)
  48301. (c = h[u]),
  48302. t.format !== n.RGBAFormat && t.format !== n.RGBFormat
  48303. ? Ye.getCompressedTextureFormats().indexOf(a) > -1
  48304. ? Ye.compressedTexImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, c.data)
  48305. : console.warn('THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()')
  48306. : Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data)
  48307. else if (h.length > 0 && o) {
  48308. for (var u = 0, d = h.length; u < d; u++) (c = h[u]), Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c)
  48309. t.generateMipmaps = !1
  48310. } else Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r)
  48311. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D), (e.__version = t.version), t.onUpdate && t.onUpdate(t)
  48312. }
  48313. function G(e, t) {
  48314. if (e.width > t || e.height > t) {
  48315. var i = t / Math.max(e.width, e.height),
  48316. n = document.createElement('canvas')
  48317. ;(n.width = Math.floor(e.width * i)), (n.height = Math.floor(e.height * i))
  48318. var r = n.getContext('2d')
  48319. return (
  48320. r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  48321. console.warn('THREE.WebGLRenderer: image is too big (' + e.width + 'x' + e.height + '). Resized to ' + n.width + 'x' + n.height, e),
  48322. n
  48323. )
  48324. }
  48325. return e
  48326. }
  48327. function z(e) {
  48328. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  48329. }
  48330. function W(e) {
  48331. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || (e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter)
  48332. }
  48333. function j(e) {
  48334. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  48335. var t = document.createElement('canvas')
  48336. ;(t.width = n.Math.nearestPowerOfTwo(e.width)), (t.height = n.Math.nearestPowerOfTwo(e.height))
  48337. var i = t.getContext('2d')
  48338. return (
  48339. i.drawImage(e, 0, 0, t.width, t.height),
  48340. console.warn('THREE.WebGLRenderer: image is not power of two (' + e.width + 'x' + e.height + '). Resized to ' + t.width + 'x' + t.height, e),
  48341. t
  48342. )
  48343. }
  48344. return e
  48345. }
  48346. function Y(e, t) {
  48347. var i = Xe.get(e)
  48348. if (6 === e.image.length)
  48349. if (e.version > 0 && i.__version !== e.version) {
  48350. i.__image__webglTextureCube || (e.addEventListener('dispose', s), (i.__image__webglTextureCube = Ge.createTexture()), ke.textures++),
  48351. Ye.activeTexture(Ge.TEXTURE0 + t),
  48352. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  48353. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY)
  48354. for (var r = e instanceof n.CompressedTexture, o = e.image[0] instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  48355. !ve.autoScaleCubemaps || r || o ? (a[l] = o ? e.image[l].image : e.image[l]) : (a[l] = G(e.image[l], je.maxCubemapSize))
  48356. var c = a[0],
  48357. h = z(c),
  48358. u = ee(e.format),
  48359. d = ee(e.type)
  48360. k(Ge.TEXTURE_CUBE_MAP, e, h)
  48361. for (var l = 0; l < 6; l++)
  48362. if (r)
  48363. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  48364. (p = f[g]),
  48365. e.format !== n.RGBAFormat && e.format !== n.RGBFormat
  48366. ? Ye.getCompressedTextureFormats().indexOf(u) > -1
  48367. ? Ye.compressedTexImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, p.data)
  48368. : console.warn('THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()')
  48369. : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, u, d, p.data)
  48370. else o ? Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, a[l].width, a[l].height, 0, u, d, a[l].data) : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, u, d, a[l])
  48371. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP), (i.__version = e.version), e.onUpdate && e.onUpdate(e)
  48372. } else Ye.activeTexture(Ge.TEXTURE0 + t), Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  48373. }
  48374. function X(e, t) {
  48375. Ye.activeTexture(Ge.TEXTURE0 + t), Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  48376. }
  48377. function Z(e, t, i, n) {
  48378. var r = ee(t.texture.format),
  48379. o = ee(t.texture.type)
  48380. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  48381. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  48382. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  48383. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  48384. }
  48385. function q(e, t) {
  48386. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  48387. t.depthBuffer && !t.stencilBuffer
  48388. ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height), Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_ATTACHMENT, Ge.RENDERBUFFER, e))
  48389. : t.depthBuffer && t.stencilBuffer
  48390. ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_STENCIL, t.width, t.height), Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e))
  48391. : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  48392. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  48393. }
  48394. function K(e) {
  48395. var t = Xe.get(e),
  48396. i = e instanceof n.WebGLRenderTargetCube
  48397. if (i) {
  48398. t.__webglDepthbuffer = []
  48399. for (var r = 0; r < 6; r++) Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]), (t.__webglDepthbuffer[r] = Ge.createRenderbuffer()), q(t.__webglDepthbuffer[r], e)
  48400. } else Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer), (t.__webglDepthbuffer = Ge.createRenderbuffer()), q(t.__webglDepthbuffer, e)
  48401. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  48402. }
  48403. function Q(e) {
  48404. var t = Xe.get(e),
  48405. i = Xe.get(e.texture)
  48406. e.addEventListener('dispose', l), (i.__webglTexture = Ge.createTexture()), ke.textures++
  48407. var r = e instanceof n.WebGLRenderTargetCube,
  48408. o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  48409. if (r) {
  48410. t.__webglFramebuffer = []
  48411. for (var a = 0; a < 6; a++) t.__webglFramebuffer[a] = Ge.createFramebuffer()
  48412. } else t.__webglFramebuffer = Ge.createFramebuffer()
  48413. if (r) {
  48414. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture), k(Ge.TEXTURE_CUBE_MAP, e.texture, o)
  48415. for (var a = 0; a < 6; a++) Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a)
  48416. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP), Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  48417. } else
  48418. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  48419. k(Ge.TEXTURE_2D, e.texture, o),
  48420. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  48421. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  48422. Ye.bindTexture(Ge.TEXTURE_2D, null)
  48423. e.depthBuffer && K(e)
  48424. }
  48425. function J(e) {
  48426. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D,
  48427. i = Xe.get(e.texture).__webglTexture
  48428. Ye.bindTexture(t, i), Ge.generateMipmap(t), Ye.bindTexture(t, null)
  48429. }
  48430. function $(e) {
  48431. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  48432. }
  48433. function ee(e) {
  48434. var t
  48435. if (e === n.RepeatWrapping) return Ge.REPEAT
  48436. if (e === n.ClampToEdgeWrapping) return Ge.CLAMP_TO_EDGE
  48437. if (e === n.MirroredRepeatWrapping) return Ge.MIRRORED_REPEAT
  48438. if (e === n.NearestFilter) return Ge.NEAREST
  48439. if (e === n.NearestMipMapNearestFilter) return Ge.NEAREST_MIPMAP_NEAREST
  48440. if (e === n.NearestMipMapLinearFilter) return Ge.NEAREST_MIPMAP_LINEAR
  48441. if (e === n.LinearFilter) return Ge.LINEAR
  48442. if (e === n.LinearMipMapNearestFilter) return Ge.LINEAR_MIPMAP_NEAREST
  48443. if (e === n.LinearMipMapLinearFilter) return Ge.LINEAR_MIPMAP_LINEAR
  48444. if (e === n.UnsignedByteType) return Ge.UNSIGNED_BYTE
  48445. if (e === n.UnsignedShort4444Type) return Ge.UNSIGNED_SHORT_4_4_4_4
  48446. if (e === n.UnsignedShort5551Type) return Ge.UNSIGNED_SHORT_5_5_5_1
  48447. if (e === n.UnsignedShort565Type) return Ge.UNSIGNED_SHORT_5_6_5
  48448. if (e === n.ByteType) return Ge.BYTE
  48449. if (e === n.ShortType) return Ge.SHORT
  48450. if (e === n.UnsignedShortType) return Ge.UNSIGNED_SHORT
  48451. if (e === n.IntType) return Ge.INT
  48452. if (e === n.UnsignedIntType) return Ge.UNSIGNED_INT
  48453. if (e === n.FloatType) return Ge.FLOAT
  48454. if (((t = We.get('OES_texture_half_float')), null !== t && e === n.HalfFloatType)) return t.HALF_FLOAT_OES
  48455. if (e === n.AlphaFormat) return Ge.ALPHA
  48456. if (e === n.RGBFormat) return Ge.RGB
  48457. if (e === n.RGBAFormat) return Ge.RGBA
  48458. if (e === n.LuminanceFormat) return Ge.LUMINANCE
  48459. if (e === n.LuminanceAlphaFormat) return Ge.LUMINANCE_ALPHA
  48460. if (e === n.AddEquation) return Ge.FUNC_ADD
  48461. if (e === n.SubtractEquation) return Ge.FUNC_SUBTRACT
  48462. if (e === n.ReverseSubtractEquation) return Ge.FUNC_REVERSE_SUBTRACT
  48463. if (e === n.ZeroFactor) return Ge.ZERO
  48464. if (e === n.OneFactor) return Ge.ONE
  48465. if (e === n.SrcColorFactor) return Ge.SRC_COLOR
  48466. if (e === n.OneMinusSrcColorFactor) return Ge.ONE_MINUS_SRC_COLOR
  48467. if (e === n.SrcAlphaFactor) return Ge.SRC_ALPHA
  48468. if (e === n.OneMinusSrcAlphaFactor) return Ge.ONE_MINUS_SRC_ALPHA
  48469. if (e === n.DstAlphaFactor) return Ge.DST_ALPHA
  48470. if (e === n.OneMinusDstAlphaFactor) return Ge.ONE_MINUS_DST_ALPHA
  48471. if (e === n.DstColorFactor) return Ge.DST_COLOR
  48472. if (e === n.OneMinusDstColorFactor) return Ge.ONE_MINUS_DST_COLOR
  48473. if (e === n.SrcAlphaSaturateFactor) return Ge.SRC_ALPHA_SATURATE
  48474. if (((t = We.get('WEBGL_compressed_texture_s3tc')), null !== t)) {
  48475. if (e === n.RGB_S3TC_DXT1_Format) return t.COMPRESSED_RGB_S3TC_DXT1_EXT
  48476. if (e === n.RGBA_S3TC_DXT1_Format) return t.COMPRESSED_RGBA_S3TC_DXT1_EXT
  48477. if (e === n.RGBA_S3TC_DXT3_Format) return t.COMPRESSED_RGBA_S3TC_DXT3_EXT
  48478. if (e === n.RGBA_S3TC_DXT5_Format) return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  48479. }
  48480. if (((t = We.get('WEBGL_compressed_texture_pvrtc')), null !== t)) {
  48481. if (e === n.RGB_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG
  48482. if (e === n.RGB_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG
  48483. if (e === n.RGBA_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
  48484. if (e === n.RGBA_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  48485. }
  48486. if (((t = We.get('WEBGL_compressed_texture_etc1')), null !== t && e === n.RGB_ETC1_Format)) return t.COMPRESSED_RGB_ETC1_WEBGL
  48487. if (((t = We.get('EXT_blend_minmax')), null !== t)) {
  48488. if (e === n.MinEquation) return t.MIN_EXT
  48489. if (e === n.MaxEquation) return t.MAX_EXT
  48490. }
  48491. return 0
  48492. }
  48493. console.log('THREE.WebGLRenderer', n.REVISION), (e = e || {})
  48494. var te = void 0 !== e.canvas ? e.canvas : document.createElement('canvas'),
  48495. ie = void 0 !== e.context ? e.context : null,
  48496. ne = void 0 !== e.alpha && e.alpha,
  48497. re = void 0 === e.depth || e.depth,
  48498. oe = void 0 === e.stencil || e.stencil,
  48499. ae = void 0 !== e.antialias && e.antialias,
  48500. se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha,
  48501. le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer,
  48502. ce = [],
  48503. he = [],
  48504. ue = -1,
  48505. de = [],
  48506. pe = -1,
  48507. fe = new Float32Array(8),
  48508. ge = [],
  48509. me = []
  48510. ;(this.domElement = te),
  48511. (this.context = null),
  48512. (this.autoClear = !0),
  48513. (this.autoClearColor = !0),
  48514. (this.autoClearDepth = !0),
  48515. (this.autoClearStencil = !0),
  48516. (this.sortObjects = !0),
  48517. (this.gammaFactor = 2),
  48518. (this.gammaInput = !1),
  48519. (this.gammaOutput = !1),
  48520. (this.physicallyCorrectLights = !1),
  48521. (this.toneMapping = n.LinearToneMapping),
  48522. (this.toneMappingExposure = 1),
  48523. (this.toneMappingWhitePoint = 1),
  48524. (this.maxMorphTargets = 8),
  48525. (this.maxMorphNormals = 4),
  48526. (this.autoScaleCubemaps = !0)
  48527. var ve = this,
  48528. Ae = null,
  48529. ye = null,
  48530. Ce = null,
  48531. Ie = -1,
  48532. Ee = '',
  48533. be = null,
  48534. we = new n.Vector4(),
  48535. _e = null,
  48536. Te = new n.Vector4(),
  48537. xe = 0,
  48538. Se = new n.Color(0),
  48539. Me = 0,
  48540. Re = te.width,
  48541. Pe = te.height,
  48542. Oe = 1,
  48543. Le = new n.Vector4(0, 0, Re, Pe),
  48544. De = !1,
  48545. Ne = new n.Vector4(0, 0, Re, Pe),
  48546. Be = new n.Frustum(),
  48547. Fe = new n.Matrix4(),
  48548. Ve = new n.Vector3(),
  48549. Ue = {
  48550. hash: '',
  48551. ambient: [0, 0, 0],
  48552. directional: [],
  48553. directionalShadowMap: [],
  48554. directionalShadowMatrix: [],
  48555. spot: [],
  48556. spotShadowMap: [],
  48557. spotShadowMatrix: [],
  48558. point: [],
  48559. pointShadowMap: [],
  48560. pointShadowMatrix: [],
  48561. hemi: [],
  48562. shadows: [],
  48563. shadowsPointLight: 0
  48564. },
  48565. ke = {
  48566. geometries: 0,
  48567. textures: 0
  48568. },
  48569. He = {
  48570. calls: 0,
  48571. vertices: 0,
  48572. faces: 0,
  48573. points: 0
  48574. }
  48575. this.info = {
  48576. render: He,
  48577. memory: ke,
  48578. programs: null
  48579. }
  48580. var Ge
  48581. try {
  48582. var ze = {
  48583. alpha: ne,
  48584. depth: re,
  48585. stencil: oe,
  48586. antialias: ae,
  48587. premultipliedAlpha: se,
  48588. preserveDrawingBuffer: le
  48589. }
  48590. if (((Ge = ie || te.getContext('webgl', ze) || te.getContext('experimental-webgl', ze)), null === Ge))
  48591. throw null !== te.getContext('webgl') ? 'Error creating WebGL context with your selected attributes.' : 'Error creating WebGL context.'
  48592. void 0 === Ge.getShaderPrecisionFormat &&
  48593. (Ge.getShaderPrecisionFormat = function () {
  48594. return {
  48595. rangeMin: 1,
  48596. rangeMax: 1,
  48597. precision: 1
  48598. }
  48599. }),
  48600. te.addEventListener('webglcontextlost', a, !1)
  48601. } catch (e) {
  48602. console.error('THREE.WebGLRenderer: ' + e)
  48603. }
  48604. var We = new n.WebGLExtensions(Ge)
  48605. We.get('OES_texture_float'),
  48606. We.get('OES_texture_float_linear'),
  48607. We.get('OES_texture_half_float'),
  48608. We.get('OES_texture_half_float_linear'),
  48609. We.get('OES_standard_derivatives'),
  48610. We.get('ANGLE_instanced_arrays'),
  48611. We.get('OES_element_index_uint') && (n.BufferGeometry.MaxIndex = 4294967296)
  48612. var je = new n.WebGLCapabilities(Ge, We, e),
  48613. Ye = new n.WebGLState(Ge, We, ee),
  48614. Xe = new n.WebGLProperties(),
  48615. Ze = new n.WebGLObjects(Ge, Xe, this.info),
  48616. qe = new n.WebGLPrograms(this, je),
  48617. Ke = new n.WebGLLights()
  48618. this.info.programs = qe.programs
  48619. var Qe = new n.WebGLBufferRenderer(Ge, We, He),
  48620. Je = new n.WebGLIndexedBufferRenderer(Ge, We, He)
  48621. r(), (this.context = Ge), (this.capabilities = je), (this.extensions = We), (this.properties = Xe), (this.state = Ye)
  48622. var $e = new n.WebGLShadowMap(this, Ue, Ze)
  48623. this.shadowMap = $e
  48624. var et = new n.SpritePlugin(this, ge),
  48625. tt = new n.LensFlarePlugin(this, me)
  48626. ;(this.getContext = function () {
  48627. return Ge
  48628. }),
  48629. (this.getContextAttributes = function () {
  48630. return Ge.getContextAttributes()
  48631. }),
  48632. (this.forceContextLoss = function () {
  48633. We.get('WEBGL_lose_context').loseContext()
  48634. }),
  48635. (this.getMaxAnisotropy = (function () {
  48636. var e
  48637. return function () {
  48638. if (void 0 !== e) return e
  48639. var t = We.get('EXT_texture_filter_anisotropic')
  48640. return (e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0)
  48641. }
  48642. })()),
  48643. (this.getPrecision = function () {
  48644. return je.precision
  48645. }),
  48646. (this.getPixelRatio = function () {
  48647. return Oe
  48648. }),
  48649. (this.setPixelRatio = function (e) {
  48650. void 0 !== e && ((Oe = e), this.setSize(Ne.z, Ne.w, !1))
  48651. }),
  48652. (this.getSize = function () {
  48653. return {
  48654. width: Re,
  48655. height: Pe
  48656. }
  48657. }),
  48658. (this.setSize = function (e, t, i, devicePixelRatio) {
  48659. if (devicePixelRatio != void 0)
  48660. Oe = devicePixelRatio //xzw add 改分辨率 始终保持清晰
  48661. ;(Re = e), (Pe = t), (te.width = e * Oe), (te.height = t * Oe), i !== !1 && ((te.style.width = e + 'px'), (te.style.height = t + 'px')), this.setViewport(0, 0, e, t)
  48662. }),
  48663. (this.setViewport = function (e, t, i, n) {
  48664. Ye.viewport(Ne.set(e, t, i, n))
  48665. }),
  48666. (this.setScissor = function (e, t, i, n) {
  48667. Ye.scissor(Le.set(e, t, i, n))
  48668. }),
  48669. (this.setScissorTest = function (e) {
  48670. Ye.setScissorTest((De = e))
  48671. }),
  48672. (this.getClearColor = function () {
  48673. return Se
  48674. }),
  48675. (this.setClearColor = function (e, t) {
  48676. Se.set(e), (Me = void 0 !== t ? t : 1), i(Se.r, Se.g, Se.b, Me)
  48677. }),
  48678. (this.getClearAlpha = function () {
  48679. return Me
  48680. }),
  48681. (this.setClearAlpha = function (e) {
  48682. ;(Me = e), i(Se.r, Se.g, Se.b, Me)
  48683. }),
  48684. (this.clear = function (e, t, i) {
  48685. var n = 0
  48686. ;(void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT), (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT), (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT), Ge.clear(n)
  48687. }),
  48688. (this.clearColor = function () {
  48689. this.clear(!0, !1, !1)
  48690. }),
  48691. (this.clearDepth = function () {
  48692. this.clear(!1, !0, !1)
  48693. }),
  48694. (this.clearStencil = function () {
  48695. this.clear(!1, !1, !0)
  48696. }),
  48697. (this.clearTarget = function (e, t, i, n) {
  48698. this.setRenderTarget(e), this.clear(t, i, n)
  48699. }),
  48700. (this.resetGLState = o),
  48701. (this.dispose = function () {
  48702. te.removeEventListener('webglcontextlost', a, !1)
  48703. }),
  48704. (this.renderBufferImmediate = function (e, t, i) {
  48705. Ye.initAttributes()
  48706. var r = Xe.get(e)
  48707. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  48708. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  48709. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  48710. e.hasColors && !r.color && (r.color = Ge.createBuffer())
  48711. var o = t.getAttributes()
  48712. if (
  48713. (e.hasPositions &&
  48714. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  48715. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  48716. Ye.enableAttribute(o.position),
  48717. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  48718. e.hasNormals)
  48719. ) {
  48720. if ((Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal), 'MeshPhongMaterial' !== i.type && 'MeshStandardMaterial' !== i.type && i.shading === n.FlatShading))
  48721. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  48722. var l = e.normalArray,
  48723. c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3,
  48724. h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3,
  48725. u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3
  48726. ;(l[a + 0] = c), (l[a + 1] = h), (l[a + 2] = u), (l[a + 3] = c), (l[a + 4] = h), (l[a + 5] = u), (l[a + 6] = c), (l[a + 7] = h), (l[a + 8] = u)
  48727. }
  48728. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW), Ye.enableAttribute(o.normal), Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  48729. }
  48730. e.hasUvs &&
  48731. i.map &&
  48732. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv), Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW), Ye.enableAttribute(o.uv), Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  48733. e.hasColors &&
  48734. i.vertexColors !== n.NoColors &&
  48735. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  48736. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  48737. Ye.enableAttribute(o.color),
  48738. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  48739. Ye.disableUnusedAttributes(),
  48740. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  48741. (e.count = 0)
  48742. }),
  48743. (this.renderBufferDirect = function (e, i, r, o, a, s) {
  48744. E(o)
  48745. var l = w(e, i, o, a),
  48746. c = !1,
  48747. h = r.id + '_' + l.id + '_' + o.wireframe
  48748. h !== Ee && ((Ee = h), (c = !0))
  48749. var u = a.morphTargetInfluences
  48750. if (void 0 !== u) {
  48751. for (var d = [], p = 0, m = u.length; p < m; p++) {
  48752. var v = u[p]
  48753. d.push([v, p])
  48754. }
  48755. d.sort(g), d.length > 8 && (d.length = 8)
  48756. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  48757. var v = d[p]
  48758. if (((fe[p] = v[0]), 0 !== v[0])) {
  48759. var y = v[1]
  48760. o.morphTargets === !0 && A.position && r.addAttribute('morphTarget' + p, A.position[y]), o.morphNormals === !0 && A.normal && r.addAttribute('morphNormal' + p, A.normal[y])
  48761. } else o.morphTargets === !0 && r.removeAttribute('morphTarget' + p), o.morphNormals === !0 && r.removeAttribute('morphNormal' + p)
  48762. }
  48763. var C = l.getUniforms()
  48764. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe), (c = !0)
  48765. }
  48766. var y = r.index,
  48767. I = r.attributes.position
  48768. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r))
  48769. var b
  48770. null !== y ? ((b = Je), b.setIndex(y)) : (b = Qe), c && (f(o, l, r), null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)))
  48771. var _ = 0,
  48772. T = 1 / 0
  48773. null !== y ? (T = y.count) : void 0 !== I && (T = I.count)
  48774. var x = r.drawRange.start,
  48775. S = r.drawRange.count,
  48776. M = null !== s ? s.start : 0,
  48777. R = null !== s ? s.count : 1 / 0,
  48778. P = Math.max(_, x, M),
  48779. O = Math.min(_ + T, x + S, M + R) - 1,
  48780. L = Math.max(0, O - P + 1)
  48781. if (a instanceof n.Mesh)
  48782. if (o.wireframe === !0) Ye.setLineWidth(o.wireframeLinewidth * t()), b.setMode(Ge.LINES)
  48783. else
  48784. switch (a.drawMode) {
  48785. case n.TrianglesDrawMode:
  48786. b.setMode(Ge.TRIANGLES)
  48787. break
  48788. case n.TriangleStripDrawMode:
  48789. b.setMode(Ge.TRIANGLE_STRIP)
  48790. break
  48791. case n.TriangleFanDrawMode:
  48792. b.setMode(Ge.TRIANGLE_FAN)
  48793. }
  48794. else if (a instanceof n.Line) {
  48795. var D = o.linewidth
  48796. void 0 === D && (D = 1), Ye.setLineWidth(D * t()), a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  48797. } else a instanceof n.Points && b.setMode(Ge.POINTS)
  48798. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  48799. }),
  48800. (this.render = function (e, t, i, r) {
  48801. if (t instanceof n.Camera == !1) return void console.error('THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.')
  48802. var o = e.fog
  48803. if (
  48804. ((Ee = ''),
  48805. (Ie = -1),
  48806. (be = null),
  48807. e.autoUpdate === !0 && e.updateMatrixWorld(),
  48808. null === t.parent && t.updateMatrixWorld(),
  48809. t.matrixWorldInverse.getInverse(t.matrixWorld),
  48810. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  48811. Be.setFromMatrix(Fe),
  48812. (ce.length = 0),
  48813. (ue = -1),
  48814. (pe = -1),
  48815. (ge.length = 0),
  48816. (me.length = 0),
  48817. y(e, t),
  48818. (he.length = ue + 1),
  48819. (de.length = pe + 1),
  48820. ve.sortObjects === !0 && (he.sort(m), de.sort(v)),
  48821. U(ce, t),
  48822. $e.render(e, t),
  48823. (He.calls = 0),
  48824. (He.vertices = 0),
  48825. (He.faces = 0),
  48826. (He.points = 0),
  48827. void 0 === i && (i = null),
  48828. this.setRenderTarget(i),
  48829. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  48830. e.overrideMaterial)
  48831. ) {
  48832. var a = e.overrideMaterial
  48833. C(he, t, o, a), C(de, t, o, a)
  48834. } else Ye.setBlending(n.NoBlending), C(he, t, o), C(de, t, o)
  48835. if ((et.render(e, t), tt.render(e, t, Te), i)) {
  48836. var s = i.texture
  48837. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  48838. }
  48839. Ye.setDepthTest(!0), Ye.setDepthWrite(!0), Ye.setColorWrite(!0)
  48840. }),
  48841. (this.setFaceCulling = function (e, t) {
  48842. e === n.CullFaceNone
  48843. ? Ye.disable(Ge.CULL_FACE)
  48844. : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  48845. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  48846. Ye.enable(Ge.CULL_FACE))
  48847. }),
  48848. (this.setTexture = function (e, t) {
  48849. var i = Xe.get(e)
  48850. if (e.version > 0 && i.__version !== e.version) {
  48851. var n = e.image
  48852. return void 0 === n
  48853. ? void console.warn('THREE.WebGLRenderer: Texture marked for update but image is undefined', e)
  48854. : n.complete === !1
  48855. ? void console.warn('THREE.WebGLRenderer: Texture marked for update but image is incomplete', e)
  48856. : void H(i, e, t)
  48857. }
  48858. Ye.activeTexture(Ge.TEXTURE0 + t), Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  48859. }),
  48860. (this.getCurrentRenderTarget = function () {
  48861. return ye
  48862. }),
  48863. (this.setRenderTargetFramebuffer = function (renderTarget, defaultFramebuffer) {
  48864. //add
  48865. const renderTargetProperties = Xe.get(renderTarget)
  48866. renderTargetProperties.__webglFramebuffer = defaultFramebuffer
  48867. renderTargetProperties.__useDefaultFramebuffer = defaultFramebuffer === undefined
  48868. }),
  48869. (this.setFramebuffer = function (value) {
  48870. //add
  48871. if (Ce !== value && ye === null) Ge.bindFramebuffer(36160, value)
  48872. Ce = value
  48873. }),
  48874. (this.setRenderTarget = function (e) {
  48875. ;(ye = e), e && void 0 === Xe.get(e).__webglFramebuffer && Q(e)
  48876. var t,
  48877. i = e instanceof n.WebGLRenderTargetCube
  48878. if (e) {
  48879. var r = Xe.get(e)
  48880. ;(t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer), we.copy(e.scissor), (_e = e.scissorTest), Te.copy(e.viewport)
  48881. } else (t = null), we.copy(Le).multiplyScalar(Oe), (_e = De), Te.copy(Ne).multiplyScalar(Oe)
  48882. if ((Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t), (Ce = t)), Ye.scissor(we), Ye.setScissorTest(_e), Ye.viewport(Te), i)) {
  48883. var o = Xe.get(e.texture)
  48884. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  48885. }
  48886. }),
  48887. (this.readRenderTargetPixels = function (e, t, i, r, o, a) {
  48888. if (e instanceof n.WebGLRenderTarget == !1) return void console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.')
  48889. var s = Xe.get(e).__webglFramebuffer
  48890. if (s) {
  48891. var l = !1
  48892. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s), (l = !0))
  48893. try {
  48894. var c = e.texture
  48895. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  48896. return void console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.')
  48897. if (
  48898. !(
  48899. c.type === n.UnsignedByteType ||
  48900. ee(c.type) === Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_TYPE) ||
  48901. (c.type === n.FloatType && We.get('WEBGL_color_buffer_float')) ||
  48902. (c.type === n.HalfFloatType && We.get('EXT_color_buffer_half_float'))
  48903. )
  48904. )
  48905. return void console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.')
  48906. Ge.checkFramebufferStatus(Ge.FRAMEBUFFER) === Ge.FRAMEBUFFER_COMPLETE
  48907. ? Ge.readPixels(t, i, r, o, ee(c.format), ee(c.type), a)
  48908. : console.error('THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.')
  48909. } finally {
  48910. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  48911. }
  48912. }
  48913. })
  48914. }),
  48915. (n.WebGLRenderTarget = function (e, t, i) {
  48916. ;(this.uuid = n.Math.generateUUID()),
  48917. (this.width = e),
  48918. (this.height = t),
  48919. (this.scissor = new n.Vector4(0, 0, e, t)),
  48920. (this.scissorTest = !1),
  48921. (this.viewport = new n.Vector4(0, 0, e, t)),
  48922. (i = i || {}),
  48923. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  48924. (this.texture = new n.Texture(void 0, void 0, i.wrapS, i.wrapT, i.magFilter, i.minFilter, i.format, i.type, i.anisotropy)),
  48925. (this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer),
  48926. (this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer)
  48927. }),
  48928. (n.WebGLRenderTarget.prototype = {
  48929. constructor: n.WebGLRenderTarget,
  48930. setSize: function (e, t) {
  48931. ;(this.width === e && this.height === t) || ((this.width = e), (this.height = t), this.dispose()), this.viewport.set(0, 0, e, t), this.scissor.set(0, 0, e, t)
  48932. },
  48933. clone: function () {
  48934. return new this.constructor().copy(this)
  48935. },
  48936. copy: function (e) {
  48937. return (
  48938. (this.width = e.width),
  48939. (this.height = e.height),
  48940. this.viewport.copy(e.viewport),
  48941. (this.texture = e.texture.clone()),
  48942. (this.depthBuffer = e.depthBuffer),
  48943. (this.stencilBuffer = e.stencilBuffer),
  48944. this
  48945. )
  48946. },
  48947. dispose: function () {
  48948. this.dispatchEvent({
  48949. type: 'dispose'
  48950. })
  48951. }
  48952. }),
  48953. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  48954. (n.WebGLRenderTargetCube = function (e, t, i) {
  48955. n.WebGLRenderTarget.call(this, e, t, i), (this.activeCubeFace = 0), (this.activeMipMapLevel = 0)
  48956. }),
  48957. (n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype)),
  48958. (n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube),
  48959. (n.WebGLBufferRenderer = function (e, t, i) {
  48960. function r(e) {
  48961. s = e
  48962. }
  48963. function o(t, n) {
  48964. e.drawArrays(s, t, n), i.calls++, (i.vertices += n), s === e.TRIANGLES && (i.faces += n / 3)
  48965. }
  48966. function a(r) {
  48967. var o = t.get('ANGLE_instanced_arrays')
  48968. if (null === o) return void console.error('THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.')
  48969. var a = r.attributes.position,
  48970. l = 0
  48971. a instanceof n.InterleavedBufferAttribute
  48972. ? ((l = a.data.count), o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount))
  48973. : ((l = a.count), o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  48974. i.calls++,
  48975. (i.vertices += l * r.maxInstancedCount),
  48976. s === e.TRIANGLES && (i.faces += (r.maxInstancedCount * l) / 3)
  48977. }
  48978. var s
  48979. ;(this.setMode = r), (this.render = o), (this.renderInstances = a)
  48980. }),
  48981. (n.WebGLIndexedBufferRenderer = function (e, t, i) {
  48982. function n(e) {
  48983. s = e
  48984. }
  48985. function r(i) {
  48986. i.array instanceof Uint32Array && t.get('OES_element_index_uint') ? ((l = e.UNSIGNED_INT), (c = 4)) : ((l = e.UNSIGNED_SHORT), (c = 2))
  48987. }
  48988. function o(t, n) {
  48989. e.drawElements(s, n, l, t * c), i.calls++, (i.vertices += n), s === e.TRIANGLES && (i.faces += n / 3)
  48990. }
  48991. function a(n, r, o) {
  48992. var a = t.get('ANGLE_instanced_arrays')
  48993. return null === a
  48994. ? void console.error('THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.')
  48995. : (a.drawElementsInstancedANGLE(s, o, l, r * c, n.maxInstancedCount),
  48996. i.calls++,
  48997. (i.vertices += o * n.maxInstancedCount),
  48998. void (s === e.TRIANGLES && (i.faces += (n.maxInstancedCount * o) / 3)))
  48999. }
  49000. var s, l, c
  49001. ;(this.setMode = n), (this.setIndex = r), (this.render = o), (this.renderInstances = a)
  49002. }),
  49003. (n.WebGLExtensions = function (e) {
  49004. var t = {}
  49005. this.get = function (i) {
  49006. if (void 0 !== t[i]) return t[i]
  49007. var n
  49008. switch (i) {
  49009. case 'EXT_texture_filter_anisotropic':
  49010. n = e.getExtension('EXT_texture_filter_anisotropic') || e.getExtension('MOZ_EXT_texture_filter_anisotropic') || e.getExtension('WEBKIT_EXT_texture_filter_anisotropic')
  49011. break
  49012. case 'WEBGL_compressed_texture_s3tc':
  49013. n = e.getExtension('WEBGL_compressed_texture_s3tc') || e.getExtension('MOZ_WEBGL_compressed_texture_s3tc') || e.getExtension('WEBKIT_WEBGL_compressed_texture_s3tc')
  49014. break
  49015. case 'WEBGL_compressed_texture_pvrtc':
  49016. n = e.getExtension('WEBGL_compressed_texture_pvrtc') || e.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc')
  49017. break
  49018. case 'WEBGL_compressed_texture_etc1':
  49019. n = e.getExtension('WEBGL_compressed_texture_etc1')
  49020. break
  49021. default:
  49022. n = e.getExtension(i)
  49023. }
  49024. return null === n && console.warn('THREE.WebGLRenderer: ' + i + ' extension not supported.'), (t[i] = n), n
  49025. }
  49026. }),
  49027. (n.WebGLCapabilities = function (e, t, i) {
  49028. function n(t) {
  49029. if ('highp' === t) {
  49030. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0) return 'highp'
  49031. t = 'mediump'
  49032. }
  49033. return 'mediump' === t && e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT).precision > 0
  49034. ? 'mediump'
  49035. : 'lowp'
  49036. }
  49037. ;(this.getMaxPrecision = n),
  49038. (this.precision = void 0 !== i.precision ? i.precision : 'highp'),
  49039. (this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer),
  49040. (this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),
  49041. (this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS)),
  49042. (this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE)),
  49043. (this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE)),
  49044. (this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS)),
  49045. (this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS)),
  49046. (this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS)),
  49047. (this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS)),
  49048. (this.vertexTextures = this.maxVertexTextures > 0),
  49049. (this.floatFragmentTextures = !!t.get('OES_texture_float')),
  49050. (this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures)
  49051. var r = n(this.precision)
  49052. r !== this.precision && (console.warn('THREE.WebGLRenderer:', this.precision, 'not supported, using', r, 'instead.'), (this.precision = r)),
  49053. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get('EXT_frag_depth'))
  49054. }),
  49055. (n.WebGLGeometries = function (e, t, i) {
  49056. function r(e) {
  49057. var t = e.geometry
  49058. if (void 0 !== h[t.id]) return h[t.id]
  49059. t.addEventListener('dispose', o)
  49060. var r
  49061. return (
  49062. t instanceof n.BufferGeometry
  49063. ? (r = t)
  49064. : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = new n.BufferGeometry().setFromObject(e)), (r = t._bufferGeometry)),
  49065. (h[t.id] = r),
  49066. i.memory.geometries++,
  49067. r
  49068. )
  49069. }
  49070. function o(e) {
  49071. var n = e.target,
  49072. r = h[n.id]
  49073. null !== r.index && s(r.index), l(r.attributes), n.removeEventListener('dispose', o), delete h[n.id]
  49074. var a = t.get(n)
  49075. a.wireframe && s(a.wireframe), t.delete(n)
  49076. var c = t.get(r)
  49077. c.wireframe && s(c.wireframe), t.delete(r), i.memory.geometries--
  49078. }
  49079. function a(e) {
  49080. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  49081. }
  49082. function s(t) {
  49083. var i = a(t)
  49084. void 0 !== i && (e.deleteBuffer(i), c(t))
  49085. }
  49086. function l(e) {
  49087. for (var t in e) s(e[t])
  49088. }
  49089. function c(e) {
  49090. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  49091. }
  49092. var h = {}
  49093. this.get = r
  49094. }),
  49095. (n.WebGLLights = function () {
  49096. var e = {}
  49097. this.get = function (t) {
  49098. if (void 0 !== e[t.id]) return e[t.id]
  49099. var i
  49100. switch (t.type) {
  49101. case 'DirectionalLight':
  49102. i = {
  49103. direction: new n.Vector3(),
  49104. color: new n.Color(),
  49105. shadow: !1,
  49106. shadowBias: 0,
  49107. shadowRadius: 1,
  49108. shadowMapSize: new n.Vector2()
  49109. }
  49110. break
  49111. case 'SpotLight':
  49112. i = {
  49113. position: new n.Vector3(),
  49114. direction: new n.Vector3(),
  49115. color: new n.Color(),
  49116. distance: 0,
  49117. coneCos: 0,
  49118. penumbraCos: 0,
  49119. decay: 0,
  49120. shadow: !1,
  49121. shadowBias: 0,
  49122. shadowRadius: 1,
  49123. shadowMapSize: new n.Vector2()
  49124. }
  49125. break
  49126. case 'PointLight':
  49127. i = {
  49128. position: new n.Vector3(),
  49129. color: new n.Color(),
  49130. distance: 0,
  49131. decay: 0,
  49132. shadow: !1,
  49133. shadowBias: 0,
  49134. shadowRadius: 1,
  49135. shadowMapSize: new n.Vector2()
  49136. }
  49137. break
  49138. case 'HemisphereLight':
  49139. i = {
  49140. direction: new n.Vector3(),
  49141. skyColor: new n.Color(),
  49142. groundColor: new n.Color()
  49143. }
  49144. }
  49145. return (e[t.id] = i), i
  49146. }
  49147. }),
  49148. (n.WebGLObjects = function (e, t, i) {
  49149. function r(t) {
  49150. var i = u.get(t)
  49151. t.geometry instanceof n.Geometry && i.updateFromObject(t)
  49152. var r = i.index,
  49153. a = i.attributes
  49154. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER)
  49155. for (var s in a) o(a[s], e.ARRAY_BUFFER)
  49156. var l = i.morphAttributes
  49157. for (var s in l) for (var c = l[s], h = 0, d = c.length; h < d; h++) o(c[h], e.ARRAY_BUFFER)
  49158. return i
  49159. }
  49160. function o(e, i) {
  49161. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e,
  49162. o = t.get(r)
  49163. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  49164. }
  49165. function a(t, i, n) {
  49166. ;(t.__webglBuffer = e.createBuffer()), e.bindBuffer(n, t.__webglBuffer)
  49167. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW
  49168. e.bufferData(n, i.array, r), (t.version = i.version)
  49169. }
  49170. function s(t, i, n) {
  49171. e.bindBuffer(n, t.__webglBuffer),
  49172. i.dynamic === !1 || i.updateRange.count === -1
  49173. ? e.bufferSubData(n, 0, i.array)
  49174. : 0 === i.updateRange.count
  49175. ? console.error(
  49176. 'THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.'
  49177. )
  49178. : (e.bufferSubData(n, i.updateRange.offset * i.array.BYTES_PER_ELEMENT, i.array.subarray(i.updateRange.offset, i.updateRange.offset + i.updateRange.count)),
  49179. (i.updateRange.count = 0)),
  49180. (t.version = i.version)
  49181. }
  49182. function l(e) {
  49183. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  49184. }
  49185. function c(i) {
  49186. var r = t.get(i)
  49187. if (void 0 !== r.wireframe) return r.wireframe
  49188. var a = [],
  49189. s = i.index,
  49190. l = i.attributes,
  49191. c = l.position
  49192. if (null !== s)
  49193. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  49194. var g = d[p + 0],
  49195. m = d[p + 1],
  49196. v = d[p + 2]
  49197. h(u, g, m) && a.push(g, m), h(u, m, v) && a.push(m, v), h(u, v, g) && a.push(v, g)
  49198. }
  49199. else
  49200. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  49201. var g = p + 0,
  49202. m = p + 1,
  49203. v = p + 2
  49204. a.push(g, m, m, v, v, g)
  49205. }
  49206. var A = c.count > 65535 ? Uint32Array : Uint16Array,
  49207. y = new n.BufferAttribute(new A(a), 1)
  49208. return o(y, e.ELEMENT_ARRAY_BUFFER), (r.wireframe = y), y
  49209. }
  49210. function h(e, t, i) {
  49211. if (t > i) {
  49212. var n = t
  49213. ;(t = i), (i = n)
  49214. }
  49215. var r = e[t]
  49216. return void 0 === r ? ((e[t] = [i]), !0) : r.indexOf(i) === -1 && (r.push(i), !0)
  49217. }
  49218. var u = new n.WebGLGeometries(e, t, i)
  49219. ;(this.getAttributeBuffer = l), (this.getWireframeAttribute = c), (this.update = r)
  49220. }),
  49221. (n.WebGLProgram = (function () {
  49222. function e(e) {
  49223. switch (e) {
  49224. case n.LinearEncoding:
  49225. return ['Linear', '( value )']
  49226. case n.sRGBEncoding:
  49227. return ['sRGB', '( value )']
  49228. case n.RGBEEncoding:
  49229. return ['RGBE', '( value )']
  49230. case n.RGBM7Encoding:
  49231. return ['RGBM', '( value, 7.0 )']
  49232. case n.RGBM16Encoding:
  49233. return ['RGBM', '( value, 16.0 )']
  49234. case n.RGBDEncoding:
  49235. return ['RGBD', '( value, 256.0 )']
  49236. case n.GammaEncoding:
  49237. return ['Gamma', '( value, float( GAMMA_FACTOR ) )']
  49238. default:
  49239. throw new Error('unsupported encoding: ' + e)
  49240. }
  49241. }
  49242. function t(t, i) {
  49243. var n = e(i)
  49244. return 'vec4 ' + t + '( vec4 value ) { return ' + n[0] + 'ToLinear' + n[1] + '; }'
  49245. }
  49246. function i(t, i) {
  49247. var n = e(i)
  49248. return 'vec4 ' + t + '( vec4 value ) { return LinearTo' + n[0] + n[1] + '; }'
  49249. }
  49250. function r(e, t) {
  49251. var i
  49252. switch (t) {
  49253. case n.LinearToneMapping:
  49254. i = 'Linear'
  49255. break
  49256. case n.ReinhardToneMapping:
  49257. i = 'Reinhard'
  49258. break
  49259. case n.Uncharted2ToneMapping:
  49260. i = 'Uncharted2'
  49261. break
  49262. case n.CineonToneMapping:
  49263. i = 'OptimizedCineon'
  49264. break
  49265. default:
  49266. throw new Error('unsupported toneMapping: ' + t)
  49267. }
  49268. return 'vec3 ' + e + '( vec3 color ) { return ' + i + 'ToneMapping( color ); }'
  49269. }
  49270. function o(e, t, i) {
  49271. e = e || {}
  49272. var n = [
  49273. e.derivatives || t.envMapCubeUV || t.bumpMap || t.normalMap || t.flatShading ? '#extension GL_OES_standard_derivatives : enable' : '',
  49274. (e.fragDepth || t.logarithmicDepthBuffer) && i.get('EXT_frag_depth') ? '#extension GL_EXT_frag_depth : enable' : '',
  49275. e.drawBuffers && i.get('WEBGL_draw_buffers') ? '#extension GL_EXT_draw_buffers : require' : '',
  49276. (e.shaderTextureLOD || t.envMap) && i.get('EXT_shader_texture_lod') ? '#extension GL_EXT_shader_texture_lod : enable' : ''
  49277. ]
  49278. return n.filter(c).join('\n')
  49279. }
  49280. function a(e) {
  49281. var t = []
  49282. for (var i in e) {
  49283. var n = e[i]
  49284. n !== !1 && t.push('#define ' + i + ' ' + n)
  49285. }
  49286. return t.join('\n')
  49287. }
  49288. function s(e, t, i) {
  49289. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  49290. var a = e.getActiveUniform(t, o),
  49291. s = a.name,
  49292. l = e.getUniformLocation(t, s),
  49293. c = f.exec(s)
  49294. if (c) {
  49295. var h = c[1],
  49296. u = c[2],
  49297. d = n[h]
  49298. d || (d = n[h] = {}), (d[u] = l)
  49299. } else if ((c = g.exec(s))) {
  49300. var p = c[1],
  49301. v = c[2],
  49302. A = c[3],
  49303. y = n[p]
  49304. y || (y = n[p] = [])
  49305. var C = y[v]
  49306. C || (C = y[v] = {}), (C[A] = l)
  49307. } else if ((c = m.exec(s))) {
  49308. var p = c[1]
  49309. n[p] = l
  49310. } else n[s] = l
  49311. }
  49312. return n
  49313. }
  49314. function l(e, t, i) {
  49315. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  49316. var a = e.getActiveAttrib(t, o),
  49317. s = a.name
  49318. n[s] = e.getAttribLocation(t, s)
  49319. }
  49320. return n
  49321. }
  49322. function c(e) {
  49323. return '' !== e
  49324. }
  49325. function h(e, t) {
  49326. return e
  49327. .replace(/NUM_DIR_LIGHTS/g, t.numDirLights)
  49328. .replace(/NUM_SPOT_LIGHTS/g, t.numSpotLights)
  49329. .replace(/NUM_POINT_LIGHTS/g, t.numPointLights)
  49330. .replace(/NUM_HEMI_LIGHTS/g, t.numHemiLights)
  49331. }
  49332. function u(e) {
  49333. function t(e, t) {
  49334. var i = n.ShaderChunk[t]
  49335. if (void 0 === i) throw new Error('Can not resolve #include <' + t + '>')
  49336. return u(i)
  49337. }
  49338. var i = /#include +<([\w\d.]+)>/g
  49339. return e.replace(i, t)
  49340. }
  49341. function d(e) {
  49342. function t(e, t, i, n) {
  49343. for (var r = '', o = parseInt(t); o < parseInt(i); o++) r += n.replace(/\[ i \]/g, '[ ' + o + ' ]')
  49344. return r
  49345. }
  49346. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g
  49347. return e.replace(i, t)
  49348. }
  49349. var p = 0,
  49350. f = /^([\w\d_]+)\.([\w\d_]+)$/,
  49351. g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  49352. m = /^([\w\d_]+)\[0\]$/
  49353. return function (e, f, g, m) {
  49354. var v = e.context,
  49355. A = g.extensions,
  49356. y = g.defines,
  49357. C = g.__webglShader.vertexShader,
  49358. I = g.__webglShader.fragmentShader,
  49359. E = 'SHADOWMAP_TYPE_BASIC'
  49360. m.shadowMapType === n.PCFShadowMap ? (E = 'SHADOWMAP_TYPE_PCF') : m.shadowMapType === n.PCFSoftShadowMap && (E = 'SHADOWMAP_TYPE_PCF_SOFT')
  49361. var b = 'ENVMAP_TYPE_CUBE',
  49362. w = 'ENVMAP_MODE_REFLECTION',
  49363. _ = 'ENVMAP_BLENDING_MULTIPLY'
  49364. if (m.envMap) {
  49365. switch (g.envMap.mapping) {
  49366. case n.CubeReflectionMapping:
  49367. case n.CubeRefractionMapping:
  49368. b = 'ENVMAP_TYPE_CUBE'
  49369. break
  49370. case n.CubeUVReflectionMapping:
  49371. case n.CubeUVRefractionMapping:
  49372. b = 'ENVMAP_TYPE_CUBE_UV'
  49373. break
  49374. case n.EquirectangularReflectionMapping:
  49375. case n.EquirectangularRefractionMapping:
  49376. b = 'ENVMAP_TYPE_EQUIREC'
  49377. break
  49378. case n.SphericalReflectionMapping:
  49379. b = 'ENVMAP_TYPE_SPHERE'
  49380. }
  49381. switch (g.envMap.mapping) {
  49382. case n.CubeRefractionMapping:
  49383. case n.EquirectangularRefractionMapping:
  49384. w = 'ENVMAP_MODE_REFRACTION'
  49385. }
  49386. switch (g.combine) {
  49387. case n.MultiplyOperation:
  49388. _ = 'ENVMAP_BLENDING_MULTIPLY'
  49389. break
  49390. case n.MixOperation:
  49391. _ = 'ENVMAP_BLENDING_MIX'
  49392. break
  49393. case n.AddOperation:
  49394. _ = 'ENVMAP_BLENDING_ADD'
  49395. }
  49396. }
  49397. var T,
  49398. x,
  49399. S = e.gammaFactor > 0 ? e.gammaFactor : 1,
  49400. M = o(A, m, e.extensions),
  49401. R = a(y),
  49402. P = v.createProgram()
  49403. g instanceof n.RawShaderMaterial
  49404. ? ((T = ''), (x = ''))
  49405. : ((T = [
  49406. 'precision ' + m.precision + ' float;',
  49407. 'precision ' + m.precision + ' int;',
  49408. '#define SHADER_NAME ' + g.__webglShader.name,
  49409. R,
  49410. m.supportsVertexTextures ? '#define VERTEX_TEXTURES' : '',
  49411. '#define GAMMA_FACTOR ' + S,
  49412. '#define MAX_BONES ' + m.maxBones,
  49413. m.map ? '#define USE_MAP' : '',
  49414. m.envMap ? '#define USE_ENVMAP' : '',
  49415. m.envMap ? '#define ' + w : '',
  49416. m.lightMap ? '#define USE_LIGHTMAP' : '',
  49417. m.aoMap ? '#define USE_AOMAP' : '',
  49418. m.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
  49419. m.bumpMap ? '#define USE_BUMPMAP' : '',
  49420. m.normalMap ? '#define USE_NORMALMAP' : '',
  49421. m.displacementMap && m.supportsVertexTextures ? '#define USE_DISPLACEMENTMAP' : '',
  49422. m.specularMap ? '#define USE_SPECULARMAP' : '',
  49423. m.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
  49424. m.metalnessMap ? '#define USE_METALNESSMAP' : '',
  49425. m.alphaMap ? '#define USE_ALPHAMAP' : '',
  49426. m.vertexColors ? '#define USE_COLOR' : '',
  49427. m.flatShading ? '#define FLAT_SHADED' : '',
  49428. m.skinning ? '#define USE_SKINNING' : '',
  49429. m.useVertexTexture ? '#define BONE_TEXTURE' : '',
  49430. m.morphTargets ? '#define USE_MORPHTARGETS' : '',
  49431. m.morphNormals && m.flatShading === !1 ? '#define USE_MORPHNORMALS' : '',
  49432. m.doubleSided ? '#define DOUBLE_SIDED' : '',
  49433. m.flipSided ? '#define FLIP_SIDED' : '',
  49434. m.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',
  49435. m.shadowMapEnabled ? '#define ' + E : '',
  49436. m.pointLightShadows > 0 ? '#define POINT_LIGHT_SHADOWS' : '',
  49437. m.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '',
  49438. m.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
  49439. m.logarithmicDepthBuffer && e.extensions.get('EXT_frag_depth') ? '#define USE_LOGDEPTHBUF_EXT' : '',
  49440. 'uniform mat4 modelMatrix;',
  49441. 'uniform mat4 modelViewMatrix;',
  49442. 'uniform mat4 projectionMatrix;',
  49443. 'uniform mat4 viewMatrix;',
  49444. 'uniform mat3 normalMatrix;',
  49445. 'uniform vec3 cameraPosition;',
  49446. 'attribute vec3 position;',
  49447. 'attribute vec3 normal;',
  49448. 'attribute vec2 uv;',
  49449. '#ifdef USE_COLOR',
  49450. '\tattribute vec3 color;',
  49451. '#endif',
  49452. '#ifdef USE_MORPHTARGETS',
  49453. '\tattribute vec3 morphTarget0;',
  49454. '\tattribute vec3 morphTarget1;',
  49455. '\tattribute vec3 morphTarget2;',
  49456. '\tattribute vec3 morphTarget3;',
  49457. '\t#ifdef USE_MORPHNORMALS',
  49458. '\t\tattribute vec3 morphNormal0;',
  49459. '\t\tattribute vec3 morphNormal1;',
  49460. '\t\tattribute vec3 morphNormal2;',
  49461. '\t\tattribute vec3 morphNormal3;',
  49462. '\t#else',
  49463. '\t\tattribute vec3 morphTarget4;',
  49464. '\t\tattribute vec3 morphTarget5;',
  49465. '\t\tattribute vec3 morphTarget6;',
  49466. '\t\tattribute vec3 morphTarget7;',
  49467. '\t#endif',
  49468. '#endif',
  49469. '#ifdef USE_SKINNING',
  49470. '\tattribute vec4 skinIndex;',
  49471. '\tattribute vec4 skinWeight;',
  49472. '#endif',
  49473. '\n'
  49474. ]
  49475. .filter(c)
  49476. .join('\n')),
  49477. (x = [
  49478. M,
  49479. 'precision ' + m.precision + ' float;',
  49480. 'precision ' + m.precision + ' int;',
  49481. '#define SHADER_NAME ' + g.__webglShader.name,
  49482. R,
  49483. m.alphaTest ? '#define ALPHATEST ' + m.alphaTest : '',
  49484. '#define GAMMA_FACTOR ' + S,
  49485. m.useFog && m.fog ? '#define USE_FOG' : '',
  49486. m.useFog && m.fogExp ? '#define FOG_EXP2' : '',
  49487. m.map ? '#define USE_MAP' : '',
  49488. m.envMap ? '#define USE_ENVMAP' : '',
  49489. m.envMap ? '#define ' + b : '',
  49490. m.envMap ? '#define ' + w : '',
  49491. m.envMap ? '#define ' + _ : '',
  49492. m.lightMap ? '#define USE_LIGHTMAP' : '',
  49493. m.aoMap ? '#define USE_AOMAP' : '',
  49494. m.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
  49495. m.bumpMap ? '#define USE_BUMPMAP' : '',
  49496. m.normalMap ? '#define USE_NORMALMAP' : '',
  49497. m.specularMap ? '#define USE_SPECULARMAP' : '',
  49498. m.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
  49499. m.metalnessMap ? '#define USE_METALNESSMAP' : '',
  49500. m.alphaMap ? '#define USE_ALPHAMAP' : '',
  49501. m.vertexColors ? '#define USE_COLOR' : '',
  49502. m.flatShading ? '#define FLAT_SHADED' : '',
  49503. m.doubleSided ? '#define DOUBLE_SIDED' : '',
  49504. m.flipSided ? '#define FLIP_SIDED' : '',
  49505. m.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',
  49506. m.shadowMapEnabled ? '#define ' + E : '',
  49507. m.pointLightShadows > 0 ? '#define POINT_LIGHT_SHADOWS' : '',
  49508. m.premultipliedAlpha ? '#define PREMULTIPLIED_ALPHA' : '',
  49509. m.physicallyCorrectLights ? '#define PHYSICALLY_CORRECT_LIGHTS' : '',
  49510. m.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
  49511. m.logarithmicDepthBuffer && e.extensions.get('EXT_frag_depth') ? '#define USE_LOGDEPTHBUF_EXT' : '',
  49512. m.envMap && e.extensions.get('EXT_shader_texture_lod') ? '#define TEXTURE_LOD_EXT' : '',
  49513. 'uniform mat4 viewMatrix;',
  49514. 'uniform vec3 cameraPosition;',
  49515. m.toneMapping !== n.NoToneMapping ? '#define TONE_MAPPING' : '',
  49516. m.toneMapping !== n.NoToneMapping ? n.ShaderChunk.tonemapping_pars_fragment : '',
  49517. m.toneMapping !== n.NoToneMapping ? r('toneMapping', m.toneMapping) : '',
  49518. m.outputEncoding || m.mapEncoding || m.envMapEncoding || m.emissiveMapEncoding ? n.ShaderChunk.encodings_pars_fragment : '',
  49519. m.mapEncoding ? t('mapTexelToLinear', m.mapEncoding) : '',
  49520. m.envMapEncoding ? t('envMapTexelToLinear', m.envMapEncoding) : '',
  49521. m.emissiveMapEncoding ? t('emissiveMapTexelToLinear', m.emissiveMapEncoding) : '',
  49522. m.outputEncoding ? i('linearToOutputTexel', m.outputEncoding) : '',
  49523. '\n'
  49524. ]
  49525. .filter(c)
  49526. .join('\n'))),
  49527. (C = u(C, m)),
  49528. (C = h(C, m)),
  49529. (I = u(I, m)),
  49530. (I = h(I, m)),
  49531. g instanceof n.ShaderMaterial == !1 && ((C = d(C)), (I = d(I)))
  49532. var O = T + C,
  49533. L = x + I,
  49534. D = n.WebGLShader(v, v.VERTEX_SHADER, O),
  49535. N = n.WebGLShader(v, v.FRAGMENT_SHADER, L)
  49536. v.attachShader(P, D),
  49537. v.attachShader(P, N),
  49538. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, 'position'),
  49539. v.linkProgram(P)
  49540. var B = v.getProgramInfoLog(P),
  49541. F = v.getShaderInfoLog(D),
  49542. V = v.getShaderInfoLog(N),
  49543. U = !0,
  49544. k = !0
  49545. v.getProgramParameter(P, v.LINK_STATUS) === !1
  49546. ? ((U = !1), console.error('THREE.WebGLProgram: shader error: ', v.getError(), 'gl.VALIDATE_STATUS', v.getProgramParameter(P, v.VALIDATE_STATUS), 'gl.getProgramInfoLog', B, F, V))
  49547. : '' !== B
  49548. ? console.warn('THREE.WebGLProgram: gl.getProgramInfoLog()', B)
  49549. : ('' !== F && '' !== V) || (k = !1),
  49550. k &&
  49551. (this.diagnostics = {
  49552. runnable: U,
  49553. material: g,
  49554. programLog: B,
  49555. vertexShader: {
  49556. log: F,
  49557. prefix: T
  49558. },
  49559. fragmentShader: {
  49560. log: V,
  49561. prefix: x
  49562. }
  49563. }),
  49564. v.deleteShader(D),
  49565. v.deleteShader(N)
  49566. var H
  49567. this.getUniforms = function () {
  49568. return void 0 === H && (H = s(v, P)), H
  49569. }
  49570. var G
  49571. return (
  49572. (this.getAttributes = function () {
  49573. return void 0 === G && (G = l(v, P)), G
  49574. }),
  49575. (this.destroy = function () {
  49576. v.deleteProgram(P), (this.program = void 0)
  49577. }),
  49578. Object.defineProperties(this, {
  49579. uniforms: {
  49580. get: function () {
  49581. return console.warn('THREE.WebGLProgram: .uniforms is now .getUniforms().'), this.getUniforms()
  49582. }
  49583. },
  49584. attributes: {
  49585. get: function () {
  49586. return console.warn('THREE.WebGLProgram: .attributes is now .getAttributes().'), this.getAttributes()
  49587. }
  49588. }
  49589. }),
  49590. (this.id = p++),
  49591. (this.code = f),
  49592. (this.usedTimes = 1),
  49593. (this.program = P),
  49594. (this.vertexShader = D),
  49595. (this.fragmentShader = N),
  49596. this
  49597. )
  49598. }
  49599. })()),
  49600. (n.WebGLPrograms = function (e, t) {
  49601. function i(e) {
  49602. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture) return 1024
  49603. var i = t.maxVertexUniforms,
  49604. r = Math.floor((i - 20) / 4),
  49605. o = r
  49606. return (
  49607. void 0 !== e &&
  49608. e instanceof n.SkinnedMesh &&
  49609. ((o = Math.min(e.skeleton.bones.length, o)),
  49610. o < e.skeleton.bones.length && console.warn('WebGLRenderer: too many bones - ' + e.skeleton.bones.length + ', this GPU supports just ' + o + ' (try OpenGL instead of ANGLE)')),
  49611. o
  49612. )
  49613. }
  49614. function r(e, t) {
  49615. var i
  49616. return (
  49617. e ? (e instanceof n.Texture ? (i = e.encoding) : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding)) : (i = n.LinearEncoding),
  49618. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  49619. i
  49620. )
  49621. }
  49622. var o = [],
  49623. a = {
  49624. MeshDepthMaterial: 'depth',
  49625. MeshNormalMaterial: 'normal',
  49626. MeshBasicMaterial: 'basic',
  49627. MeshLambertMaterial: 'lambert',
  49628. MeshPhongMaterial: 'phong',
  49629. MeshStandardMaterial: 'standard',
  49630. LineBasicMaterial: 'basic',
  49631. LineDashedMaterial: 'dashed',
  49632. PointsMaterial: 'points'
  49633. },
  49634. s = [
  49635. 'precision',
  49636. 'supportsVertexTextures',
  49637. 'map',
  49638. 'mapEncoding',
  49639. 'envMap',
  49640. 'envMapMode',
  49641. 'envMapEncoding',
  49642. 'lightMap',
  49643. 'aoMap',
  49644. 'emissiveMap',
  49645. 'emissiveMapEncoding',
  49646. 'bumpMap',
  49647. 'normalMap',
  49648. 'displacementMap',
  49649. 'specularMap',
  49650. 'roughnessMap',
  49651. 'metalnessMap',
  49652. 'alphaMap',
  49653. 'combine',
  49654. 'vertexColors',
  49655. 'fog',
  49656. 'useFog',
  49657. 'fogExp',
  49658. 'flatShading',
  49659. 'sizeAttenuation',
  49660. 'logarithmicDepthBuffer',
  49661. 'skinning',
  49662. 'maxBones',
  49663. 'useVertexTexture',
  49664. 'morphTargets',
  49665. 'morphNormals',
  49666. 'maxMorphTargets',
  49667. 'maxMorphNormals',
  49668. 'premultipliedAlpha',
  49669. 'numDirLights',
  49670. 'numPointLights',
  49671. 'numSpotLights',
  49672. 'numHemiLights',
  49673. 'shadowMapEnabled',
  49674. 'pointLightShadows',
  49675. 'toneMapping',
  49676. 'physicallyCorrectLights',
  49677. 'shadowMapType',
  49678. 'alphaTest',
  49679. 'doubleSided',
  49680. 'flipSided'
  49681. ]
  49682. ;(this.getParameters = function (o, s, l, c) {
  49683. var h = a[o.type],
  49684. u = i(c),
  49685. d = e.getPrecision()
  49686. null !== o.precision && ((d = t.getMaxPrecision(o.precision)), d !== o.precision && console.warn('THREE.WebGLProgram.getParameters:', o.precision, 'not supported, using', d, 'instead.'))
  49687. var p = {
  49688. shaderID: h,
  49689. precision: d,
  49690. supportsVertexTextures: t.vertexTextures,
  49691. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  49692. map: !!o.map,
  49693. mapEncoding: r(o.map, e.gammaInput),
  49694. envMap: !!o.envMap,
  49695. envMapMode: o.envMap && o.envMap.mapping,
  49696. envMapEncoding: r(o.envMap, e.gammaInput),
  49697. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  49698. lightMap: !!o.lightMap,
  49699. aoMap: !!o.aoMap,
  49700. emissiveMap: !!o.emissiveMap,
  49701. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  49702. bumpMap: !!o.bumpMap,
  49703. normalMap: !!o.normalMap,
  49704. displacementMap: !!o.displacementMap,
  49705. roughnessMap: !!o.roughnessMap,
  49706. metalnessMap: !!o.metalnessMap,
  49707. specularMap: !!o.specularMap,
  49708. alphaMap: !!o.alphaMap,
  49709. combine: o.combine,
  49710. vertexColors: o.vertexColors,
  49711. fog: l,
  49712. useFog: o.fog,
  49713. fogExp: l instanceof n.FogExp2,
  49714. flatShading: o.shading === n.FlatShading,
  49715. sizeAttenuation: o.sizeAttenuation,
  49716. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  49717. skinning: o.skinning,
  49718. maxBones: u,
  49719. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  49720. morphTargets: o.morphTargets,
  49721. morphNormals: o.morphNormals,
  49722. maxMorphTargets: e.maxMorphTargets,
  49723. maxMorphNormals: e.maxMorphNormals,
  49724. numDirLights: s.directional.length,
  49725. numPointLights: s.point.length,
  49726. numSpotLights: s.spot.length,
  49727. numHemiLights: s.hemi.length,
  49728. pointLightShadows: s.shadowsPointLight,
  49729. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  49730. shadowMapType: e.shadowMap.type,
  49731. toneMapping: e.toneMapping,
  49732. physicallyCorrectLights: e.physicallyCorrectLights,
  49733. premultipliedAlpha: o.premultipliedAlpha,
  49734. alphaTest: o.alphaTest,
  49735. doubleSided: o.side === n.DoubleSide,
  49736. flipSided: o.side === n.BackSide
  49737. }
  49738. return p
  49739. }),
  49740. (this.getProgramCode = function (e, t) {
  49741. var i = []
  49742. if ((t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader), i.push(e.vertexShader)), void 0 !== e.defines)) for (var n in e.defines) i.push(n), i.push(e.defines[n])
  49743. for (var r = 0; r < s.length; r++) {
  49744. var o = s[r]
  49745. i.push(o), i.push(t[o])
  49746. }
  49747. return i.join()
  49748. }),
  49749. (this.acquireProgram = function (t, i, r) {
  49750. for (var a, s = 0, l = o.length; s < l; s++) {
  49751. var c = o[s]
  49752. if (c.code === r) {
  49753. ;(a = c), ++a.usedTimes
  49754. break
  49755. }
  49756. }
  49757. return void 0 === a && ((a = new n.WebGLProgram(e, r, t, i)), o.push(a)), a
  49758. }),
  49759. (this.releaseProgram = function (e) {
  49760. if (0 === --e.usedTimes) {
  49761. var t = o.indexOf(e)
  49762. ;(o[t] = o[o.length - 1]), o.pop(), e.destroy()
  49763. }
  49764. }),
  49765. (this.programs = o)
  49766. }),
  49767. (n.WebGLProperties = function () {
  49768. var e = {}
  49769. ;(this.get = function (t) {
  49770. var i = t.uuid,
  49771. n = e[i]
  49772. return void 0 === n && ((n = {}), (e[i] = n)), n
  49773. }),
  49774. (this.delete = function (t) {
  49775. delete e[t.uuid]
  49776. }),
  49777. (this.clear = function () {
  49778. e = {}
  49779. })
  49780. }),
  49781. (n.WebGLShader = (function () {
  49782. function e(e) {
  49783. for (var t = e.split('\n'), i = 0; i < t.length; i++) t[i] = i + 1 + ': ' + t[i]
  49784. return t.join('\n')
  49785. }
  49786. return function (t, i, n) {
  49787. var r = t.createShader(i)
  49788. return (
  49789. t.shaderSource(r, n),
  49790. t.compileShader(r),
  49791. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  49792. '' !== t.getShaderInfoLog(r) && console.warn('THREE.WebGLShader: gl.getShaderInfoLog()', i === t.VERTEX_SHADER ? 'vertex' : 'fragment', t.getShaderInfoLog(r), e(n)),
  49793. r
  49794. )
  49795. }
  49796. })()),
  49797. (n.WebGLShadowMap = function (e, t, i) {
  49798. function r(e, t, i, r) {
  49799. var o = e.geometry,
  49800. a = null,
  49801. s = v,
  49802. l = e.customDepthMaterial
  49803. if ((i && ((s = A), (l = e.customDistanceMaterial)), l)) a = l
  49804. else {
  49805. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets,
  49806. h = e instanceof n.SkinnedMesh && t.skinning,
  49807. u = 0
  49808. c && (u |= f), h && (u |= g), (a = s[u])
  49809. }
  49810. return (a.visible = t.visible), (a.wireframe = t.wireframe), (a.wireframeLinewidth = t.wireframeLinewidth), i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r), a
  49811. }
  49812. function o(e, t, i) {
  49813. if (e.visible !== !1) {
  49814. if (e.layers.test(t.layers) && (e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && e.castShadow && (e.frustumCulled === !1 || l.intersectsObject(e) === !0)) {
  49815. var r = e.material
  49816. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld), p.push(e))
  49817. }
  49818. for (var a = e.children, s = 0, c = a.length; s < c; s++) o(a[s], t, i)
  49819. }
  49820. }
  49821. for (
  49822. var a = e.context,
  49823. s = e.state,
  49824. l = new n.Frustum(),
  49825. c = new n.Matrix4(),
  49826. h = new n.Vector2(),
  49827. u = new n.Vector3(),
  49828. d = new n.Vector3(),
  49829. p = [],
  49830. f = 1,
  49831. g = 2,
  49832. m = (f | g) + 1,
  49833. v = new Array(m),
  49834. A = new Array(m),
  49835. y = [new n.Vector3(1, 0, 0), new n.Vector3(-1, 0, 0), new n.Vector3(0, 0, 1), new n.Vector3(0, 0, -1), new n.Vector3(0, 1, 0), new n.Vector3(0, -1, 0)],
  49836. C = [new n.Vector3(0, 1, 0), new n.Vector3(0, 1, 0), new n.Vector3(0, 1, 0), new n.Vector3(0, 1, 0), new n.Vector3(0, 0, 1), new n.Vector3(0, 0, -1)],
  49837. I = [new n.Vector4(), new n.Vector4(), new n.Vector4(), new n.Vector4(), new n.Vector4(), new n.Vector4()],
  49838. E = n.ShaderLib.depthRGBA,
  49839. b = n.UniformsUtils.clone(E.uniforms),
  49840. w = n.ShaderLib.distanceRGBA,
  49841. _ = n.UniformsUtils.clone(w.uniforms),
  49842. T = 0;
  49843. T !== m;
  49844. ++T
  49845. ) {
  49846. var x = 0 !== (T & f),
  49847. S = 0 !== (T & g),
  49848. M = new n.ShaderMaterial({
  49849. uniforms: b,
  49850. vertexShader: E.vertexShader,
  49851. fragmentShader: E.fragmentShader,
  49852. morphTargets: x,
  49853. skinning: S
  49854. })
  49855. v[T] = M
  49856. var R = new n.ShaderMaterial({
  49857. defines: {
  49858. USE_SHADOWMAP: ''
  49859. },
  49860. uniforms: _,
  49861. vertexShader: w.vertexShader,
  49862. fragmentShader: w.fragmentShader,
  49863. morphTargets: x,
  49864. skinning: S
  49865. })
  49866. A[T] = R
  49867. }
  49868. var P = this
  49869. ;(this.enabled = !1),
  49870. (this.autoUpdate = !0),
  49871. (this.needsUpdate = !1),
  49872. (this.type = n.PCFShadowMap),
  49873. (this.cullFace = n.CullFaceFront),
  49874. (this.render = function (f, g) {
  49875. var m,
  49876. v,
  49877. A = t.shadows
  49878. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  49879. s.clearColor(1, 1, 1, 1),
  49880. s.disable(a.BLEND),
  49881. s.enable(a.CULL_FACE),
  49882. a.frontFace(a.CCW),
  49883. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  49884. s.setDepthTest(!0),
  49885. s.setScissorTest(!1)
  49886. for (var E = 0, b = A.length; E < b; E++) {
  49887. var w = A[E],
  49888. _ = w.shadow,
  49889. T = _.camera
  49890. if ((h.copy(_.mapSize), w instanceof n.PointLight)) {
  49891. ;(m = 6), (v = !0)
  49892. var x = h.x,
  49893. S = h.y
  49894. I[0].set(2 * x, S, x, S), I[1].set(0, S, x, S), I[2].set(3 * x, S, x, S), I[3].set(x, S, x, S), I[4].set(3 * x, 0, x, S), I[5].set(x, 0, x, S), (h.x *= 4), (h.y *= 2)
  49895. } else (m = 1), (v = !1)
  49896. if (null === _.map) {
  49897. var M = {
  49898. minFilter: n.NearestFilter,
  49899. magFilter: n.NearestFilter,
  49900. format: n.RGBAFormat
  49901. }
  49902. ;(_.map = new n.WebGLRenderTarget(h.x, h.y, M)), w instanceof n.SpotLight && (T.aspect = h.x / h.y), T.updateProjectionMatrix()
  49903. }
  49904. var R = _.map,
  49905. O = _.matrix
  49906. d.setFromMatrixPosition(w.matrixWorld), T.position.copy(d), e.setRenderTarget(R), e.clear()
  49907. for (var L = 0; L < m; L++) {
  49908. if (v) {
  49909. u.copy(T.position), u.add(y[L]), T.up.copy(C[L]), T.lookAt(u)
  49910. var D = I[L]
  49911. s.viewport(D)
  49912. } else u.setFromMatrixPosition(w.target.matrixWorld), T.lookAt(u)
  49913. T.updateMatrixWorld(),
  49914. T.matrixWorldInverse.getInverse(T.matrixWorld),
  49915. O.set(0.5, 0, 0, 0.5, 0, 0.5, 0, 0.5, 0, 0, 0.5, 0.5, 0, 0, 0, 1),
  49916. O.multiply(T.projectionMatrix),
  49917. O.multiply(T.matrixWorldInverse),
  49918. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  49919. l.setFromMatrix(c),
  49920. (p.length = 0),
  49921. o(f, g, T)
  49922. for (var N = 0, B = p.length; N < B; N++) {
  49923. var F = p[N],
  49924. V = i.update(F),
  49925. U = F.material
  49926. if (U instanceof n.MultiMaterial)
  49927. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  49928. var W = k[G],
  49929. j = H[W.materialIndex]
  49930. if (j.visible === !0) {
  49931. var Y = r(F, j, v, d)
  49932. e.renderBufferDirect(T, null, V, Y, F, W)
  49933. }
  49934. }
  49935. else {
  49936. var Y = r(F, U, v, d)
  49937. e.renderBufferDirect(T, null, V, Y, F, null)
  49938. }
  49939. }
  49940. }
  49941. }
  49942. var X = e.getClearColor(),
  49943. Z = e.getClearAlpha()
  49944. e.setClearColor(X, Z), s.enable(a.BLEND), P.cullFace === n.CullFaceFront && a.cullFace(a.BACK), (P.needsUpdate = !1)
  49945. }
  49946. })
  49947. }),
  49948. (n.WebGLState = function (e, t, i) {
  49949. var r = this,
  49950. o = new n.Vector4(),
  49951. a = new Uint8Array(16),
  49952. s = new Uint8Array(16),
  49953. l = new Uint8Array(16),
  49954. c = {},
  49955. h = null,
  49956. u = null,
  49957. d = null,
  49958. p = null,
  49959. f = null,
  49960. g = null,
  49961. m = null,
  49962. v = null,
  49963. A = !1,
  49964. y = null,
  49965. C = null,
  49966. I = null,
  49967. E = null,
  49968. b = null,
  49969. w = null,
  49970. _ = null,
  49971. T = null,
  49972. x = null,
  49973. S = null,
  49974. M = null,
  49975. R = null,
  49976. P = null,
  49977. O = null,
  49978. L = null,
  49979. D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  49980. N = void 0,
  49981. B = {},
  49982. F = new n.Vector4(),
  49983. V = null,
  49984. U = null,
  49985. k = new n.Vector4(),
  49986. H = new n.Vector4(),
  49987. G = e.createTexture()
  49988. e.bindTexture(e.TEXTURE_2D, G),
  49989. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  49990. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  49991. (this.init = function () {
  49992. this.clearColor(0, 0, 0, 1),
  49993. this.clearDepth(1),
  49994. this.clearStencil(0),
  49995. this.enable(e.DEPTH_TEST),
  49996. e.depthFunc(e.LEQUAL),
  49997. e.frontFace(e.CCW),
  49998. e.cullFace(e.BACK),
  49999. this.enable(e.CULL_FACE),
  50000. this.enable(e.BLEND),
  50001. e.blendEquation(e.FUNC_ADD),
  50002. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  50003. }),
  50004. (this.initAttributes = function () {
  50005. for (var e = 0, t = a.length; e < t; e++) a[e] = 0
  50006. }),
  50007. (this.enableAttribute = function (i) {
  50008. if (((a[i] = 1), 0 === s[i] && (e.enableVertexAttribArray(i), (s[i] = 1)), 0 !== l[i])) {
  50009. var n = t.get('ANGLE_instanced_arrays')
  50010. n.vertexAttribDivisorANGLE(i, 0), (l[i] = 0)
  50011. }
  50012. }),
  50013. (this.enableAttributeAndDivisor = function (t, i, n) {
  50014. ;(a[t] = 1), 0 === s[t] && (e.enableVertexAttribArray(t), (s[t] = 1)), l[t] !== i && (n.vertexAttribDivisorANGLE(t, i), (l[t] = i))
  50015. }),
  50016. (this.disableUnusedAttributes = function () {
  50017. for (var t = 0, i = s.length; t < i; t++) s[t] !== a[t] && (e.disableVertexAttribArray(t), (s[t] = 0))
  50018. }),
  50019. (this.enable = function (t) {
  50020. c[t] !== !0 && (e.enable(t), (c[t] = !0))
  50021. }),
  50022. (this.disable = function (t) {
  50023. c[t] !== !1 && (e.disable(t), (c[t] = !1))
  50024. }),
  50025. (this.getCompressedTextureFormats = function () {
  50026. if (null === h && ((h = []), t.get('WEBGL_compressed_texture_pvrtc') || t.get('WEBGL_compressed_texture_s3tc') || t.get('WEBGL_compressed_texture_etc1')))
  50027. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++) h.push(i[n])
  50028. return h
  50029. }),
  50030. (this.setBlending = function (t, r, o, a, s, l, c, h) {
  50031. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  50032. (t === u && h === A) ||
  50033. (t === n.AdditiveBlending
  50034. ? h
  50035. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD), e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE))
  50036. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.SRC_ALPHA, e.ONE))
  50037. : t === n.SubtractiveBlending
  50038. ? h
  50039. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD), e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA))
  50040. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR))
  50041. : t === n.MultiplyBlending
  50042. ? h
  50043. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD), e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA))
  50044. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.SRC_COLOR))
  50045. : h
  50046. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD), e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA))
  50047. : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD), e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  50048. (u = t),
  50049. (A = h)),
  50050. t === n.CustomBlending
  50051. ? ((s = s || r),
  50052. (l = l || o),
  50053. (c = c || a),
  50054. (r === d && s === g) || (e.blendEquationSeparate(i(r), i(s)), (d = r), (g = s)),
  50055. (o === p && a === f && l === m && c === v) || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)), (p = o), (f = a), (m = l), (v = c)))
  50056. : ((d = null), (p = null), (f = null), (g = null), (m = null), (v = null))
  50057. }),
  50058. (this.setDepthFunc = function (t) {
  50059. if (y !== t) {
  50060. if (t)
  50061. switch (t) {
  50062. case n.NeverDepth:
  50063. e.depthFunc(e.NEVER)
  50064. break
  50065. case n.AlwaysDepth:
  50066. e.depthFunc(e.ALWAYS)
  50067. break
  50068. case n.LessDepth:
  50069. e.depthFunc(e.LESS)
  50070. break
  50071. case n.LessEqualDepth:
  50072. e.depthFunc(e.LEQUAL)
  50073. break
  50074. case n.EqualDepth:
  50075. e.depthFunc(e.EQUAL)
  50076. break
  50077. case n.GreaterEqualDepth:
  50078. e.depthFunc(e.GEQUAL)
  50079. break
  50080. case n.GreaterDepth:
  50081. e.depthFunc(e.GREATER)
  50082. break
  50083. case n.NotEqualDepth:
  50084. e.depthFunc(e.NOTEQUAL)
  50085. break
  50086. default:
  50087. e.depthFunc(e.LEQUAL)
  50088. }
  50089. else e.depthFunc(e.LEQUAL)
  50090. y = t
  50091. }
  50092. }),
  50093. (this.setDepthTest = function (t) {
  50094. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  50095. }),
  50096. (this.setDepthWrite = function (t) {
  50097. C !== t && (e.depthMask(t), (C = t))
  50098. }),
  50099. (this.setColorWrite = function (t) {
  50100. I !== t && (e.colorMask(t, t, t, t), (I = t))
  50101. }),
  50102. (this.setStencilFunc = function (t, i, n) {
  50103. ;(b === t && w === i && _ === n) || (e.stencilFunc(t, i, n), (b = t), (w = i), (_ = n))
  50104. }),
  50105. (this.setStencilOp = function (t, i, n) {
  50106. ;(T === t && x === i && S === n) || (e.stencilOp(t, i, n), (T = t), (x = i), (S = n))
  50107. }),
  50108. (this.setStencilTest = function (t) {
  50109. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  50110. }),
  50111. (this.setStencilWrite = function (t) {
  50112. E !== t && (e.stencilMask(t), (E = t))
  50113. }),
  50114. (this.setFlipSided = function (t) {
  50115. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), (M = t))
  50116. }),
  50117. (this.setLineWidth = function (t) {
  50118. t !== R && (e.lineWidth(t), (R = t))
  50119. }),
  50120. (this.setPolygonOffset = function (t, i, n) {
  50121. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL), !t || (P === i && O === n) || (e.polygonOffset(i, n), (P = i), (O = n))
  50122. }),
  50123. (this.getScissorTest = function () {
  50124. return L
  50125. }),
  50126. (this.setScissorTest = function (t) {
  50127. ;(L = t), t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  50128. }),
  50129. (this.activeTexture = function (t) {
  50130. void 0 === t && (t = e.TEXTURE0 + D - 1), N !== t && (e.activeTexture(t), (N = t))
  50131. }),
  50132. (this.bindTexture = function (t, i) {
  50133. void 0 === N && r.activeTexture()
  50134. var n = B[N]
  50135. void 0 === n &&
  50136. ((n = {
  50137. type: void 0,
  50138. texture: void 0
  50139. }),
  50140. (B[N] = n)),
  50141. (n.type === t && n.texture === i) || (e.bindTexture(t, i || G), (n.type = t), (n.texture = i))
  50142. }),
  50143. (this.compressedTexImage2D = function () {
  50144. try {
  50145. e.compressedTexImage2D.apply(e, arguments)
  50146. } catch (e) {
  50147. console.error(e)
  50148. }
  50149. }),
  50150. (this.texImage2D = function () {
  50151. try {
  50152. e.texImage2D.apply(e, arguments)
  50153. } catch (e) {
  50154. console.error(e)
  50155. }
  50156. }),
  50157. (this.clearColor = function (t, i, n, r) {
  50158. o.set(t, i, n, r), F.equals(o) === !1 && (e.clearColor(t, i, n, r), F.copy(o))
  50159. }),
  50160. (this.clearDepth = function (t) {
  50161. V !== t && (e.clearDepth(t), (V = t))
  50162. }),
  50163. (this.clearStencil = function (t) {
  50164. U !== t && (e.clearStencil(t), (U = t))
  50165. }),
  50166. (this.scissor = function (t) {
  50167. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), k.copy(t))
  50168. }),
  50169. (this.viewport = function (t) {
  50170. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), H.copy(t))
  50171. }),
  50172. (this.reset = function () {
  50173. for (var t = 0; t < s.length; t++) 1 === s[t] && (e.disableVertexAttribArray(t), (s[t] = 0))
  50174. ;(c = {}), (h = null), (N = void 0), (B = {}), (u = null), (I = null), (C = null), (E = null), (M = null)
  50175. })
  50176. }),
  50177. (n.LensFlarePlugin = function (e, t) {
  50178. function i() {
  50179. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1]),
  50180. t = new Uint16Array([0, 1, 2, 0, 2, 3])
  50181. ;(o = p.createBuffer()),
  50182. (a = p.createBuffer()),
  50183. p.bindBuffer(p.ARRAY_BUFFER, o),
  50184. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  50185. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  50186. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  50187. (u = p.createTexture()),
  50188. (d = p.createTexture()),
  50189. f.bindTexture(p.TEXTURE_2D, u),
  50190. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  50191. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  50192. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  50193. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  50194. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  50195. f.bindTexture(p.TEXTURE_2D, d),
  50196. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  50197. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  50198. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  50199. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  50200. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  50201. (h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0)
  50202. var i
  50203. ;(i = h
  50204. ? {
  50205. vertexShader: [
  50206. 'uniform lowp int renderType;',
  50207. 'uniform vec3 screenPosition;',
  50208. 'uniform vec2 scale;',
  50209. 'uniform float rotation;',
  50210. 'uniform sampler2D occlusionMap;',
  50211. 'attribute vec2 position;',
  50212. 'attribute vec2 uv;',
  50213. 'varying vec2 vUV;',
  50214. 'varying float vVisibility;',
  50215. 'void main() {',
  50216. 'vUV = uv;',
  50217. 'vec2 pos = position;',
  50218. 'if ( renderType == 2 ) {',
  50219. 'vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );',
  50220. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );',
  50221. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );',
  50222. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );',
  50223. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );',
  50224. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );',
  50225. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );',
  50226. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );',
  50227. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );',
  50228. 'vVisibility = visibility.r / 9.0;',
  50229. 'vVisibility *= 1.0 - visibility.g / 9.0;',
  50230. 'vVisibility *= visibility.b / 9.0;',
  50231. 'vVisibility *= 1.0 - visibility.a / 9.0;',
  50232. 'pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;',
  50233. 'pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;',
  50234. '}',
  50235. 'gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );',
  50236. '}'
  50237. ].join('\n'),
  50238. fragmentShader: [
  50239. 'uniform lowp int renderType;',
  50240. 'uniform sampler2D map;',
  50241. 'uniform float opacity;',
  50242. 'uniform vec3 color;',
  50243. 'varying vec2 vUV;',
  50244. 'varying float vVisibility;',
  50245. 'void main() {',
  50246. 'if ( renderType == 0 ) {',
  50247. 'gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );',
  50248. '} else if ( renderType == 1 ) {',
  50249. 'gl_FragColor = texture2D( map, vUV );',
  50250. '} else {',
  50251. 'vec4 texture = texture2D( map, vUV );',
  50252. 'texture.a *= opacity * vVisibility;',
  50253. 'gl_FragColor = texture;',
  50254. 'gl_FragColor.rgb *= color;',
  50255. '}',
  50256. '}'
  50257. ].join('\n')
  50258. }
  50259. : {
  50260. vertexShader: [
  50261. 'uniform lowp int renderType;',
  50262. 'uniform vec3 screenPosition;',
  50263. 'uniform vec2 scale;',
  50264. 'uniform float rotation;',
  50265. 'attribute vec2 position;',
  50266. 'attribute vec2 uv;',
  50267. 'varying vec2 vUV;',
  50268. 'void main() {',
  50269. 'vUV = uv;',
  50270. 'vec2 pos = position;',
  50271. 'if ( renderType == 2 ) {',
  50272. 'pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;',
  50273. 'pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;',
  50274. '}',
  50275. 'gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );',
  50276. '}'
  50277. ].join('\n'),
  50278. fragmentShader: [
  50279. 'precision mediump float;',
  50280. 'uniform lowp int renderType;',
  50281. 'uniform sampler2D map;',
  50282. 'uniform sampler2D occlusionMap;',
  50283. 'uniform float opacity;',
  50284. 'uniform vec3 color;',
  50285. 'varying vec2 vUV;',
  50286. 'void main() {',
  50287. 'if ( renderType == 0 ) {',
  50288. 'gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );',
  50289. '} else if ( renderType == 1 ) {',
  50290. 'gl_FragColor = texture2D( map, vUV );',
  50291. '} else {',
  50292. 'float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;',
  50293. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;',
  50294. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;',
  50295. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;',
  50296. 'visibility = ( 1.0 - visibility / 4.0 );',
  50297. 'vec4 texture = texture2D( map, vUV );',
  50298. 'texture.a *= opacity * visibility;',
  50299. 'gl_FragColor = texture;',
  50300. 'gl_FragColor.rgb *= color;',
  50301. '}',
  50302. '}'
  50303. ].join('\n')
  50304. }),
  50305. (s = r(i)),
  50306. (l = {
  50307. vertex: p.getAttribLocation(s, 'position'),
  50308. uv: p.getAttribLocation(s, 'uv')
  50309. }),
  50310. (c = {
  50311. renderType: p.getUniformLocation(s, 'renderType'),
  50312. map: p.getUniformLocation(s, 'map'),
  50313. occlusionMap: p.getUniformLocation(s, 'occlusionMap'),
  50314. opacity: p.getUniformLocation(s, 'opacity'),
  50315. color: p.getUniformLocation(s, 'color'),
  50316. scale: p.getUniformLocation(s, 'scale'),
  50317. rotation: p.getUniformLocation(s, 'rotation'),
  50318. screenPosition: p.getUniformLocation(s, 'screenPosition')
  50319. })
  50320. }
  50321. function r(t) {
  50322. var i = p.createProgram(),
  50323. n = p.createShader(p.FRAGMENT_SHADER),
  50324. r = p.createShader(p.VERTEX_SHADER),
  50325. o = 'precision ' + e.getPrecision() + ' float;\n'
  50326. return (
  50327. p.shaderSource(n, o + t.fragmentShader), p.shaderSource(r, o + t.vertexShader), p.compileShader(n), p.compileShader(r), p.attachShader(i, n), p.attachShader(i, r), p.linkProgram(i), i
  50328. )
  50329. }
  50330. var o,
  50331. a,
  50332. s,
  50333. l,
  50334. c,
  50335. h,
  50336. u,
  50337. d,
  50338. p = e.context,
  50339. f = e.state
  50340. this.render = function (r, g, m) {
  50341. if (0 !== t.length) {
  50342. var v = new n.Vector3(),
  50343. A = m.w / m.z,
  50344. y = 0.5 * m.z,
  50345. C = 0.5 * m.w,
  50346. I = 16 / m.w,
  50347. E = new n.Vector2(I * A, I),
  50348. b = new n.Vector3(1, 1, 0),
  50349. w = new n.Vector2(1, 1)
  50350. void 0 === s && i(),
  50351. p.useProgram(s),
  50352. f.initAttributes(),
  50353. f.enableAttribute(l.vertex),
  50354. f.enableAttribute(l.uv),
  50355. f.disableUnusedAttributes(),
  50356. p.uniform1i(c.occlusionMap, 0),
  50357. p.uniform1i(c.map, 1),
  50358. p.bindBuffer(p.ARRAY_BUFFER, o),
  50359. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  50360. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  50361. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  50362. f.disable(p.CULL_FACE),
  50363. f.setDepthWrite(!1)
  50364. for (var _ = 0, T = t.length; _ < T; _++) {
  50365. ;(I = 16 / m.w), E.set(I * A, I)
  50366. var x = t[_]
  50367. if (
  50368. (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  50369. v.applyMatrix4(g.matrixWorldInverse),
  50370. v.applyProjection(g.projectionMatrix),
  50371. b.copy(v),
  50372. (w.x = b.x * y + y),
  50373. (w.y = b.y * C + C),
  50374. h || (w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w))
  50375. ) {
  50376. f.activeTexture(p.TEXTURE0),
  50377. f.bindTexture(p.TEXTURE_2D, null),
  50378. f.activeTexture(p.TEXTURE1),
  50379. f.bindTexture(p.TEXTURE_2D, u),
  50380. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  50381. p.uniform1i(c.renderType, 0),
  50382. p.uniform2f(c.scale, E.x, E.y),
  50383. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  50384. f.disable(p.BLEND),
  50385. f.enable(p.DEPTH_TEST),
  50386. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  50387. f.activeTexture(p.TEXTURE0),
  50388. f.bindTexture(p.TEXTURE_2D, d),
  50389. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  50390. p.uniform1i(c.renderType, 1),
  50391. f.disable(p.DEPTH_TEST),
  50392. f.activeTexture(p.TEXTURE1),
  50393. f.bindTexture(p.TEXTURE_2D, u),
  50394. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  50395. x.positionScreen.copy(b),
  50396. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  50397. p.uniform1i(c.renderType, 2),
  50398. f.enable(p.BLEND)
  50399. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  50400. var R = x.lensFlares[S]
  50401. R.opacity > 0.001 &&
  50402. R.scale > 0.001 &&
  50403. ((b.x = R.x),
  50404. (b.y = R.y),
  50405. (b.z = R.z),
  50406. (I = (R.size * R.scale) / m.w),
  50407. (E.x = I * A),
  50408. (E.y = I),
  50409. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  50410. p.uniform2f(c.scale, E.x, E.y),
  50411. p.uniform1f(c.rotation, R.rotation),
  50412. p.uniform1f(c.opacity, R.opacity),
  50413. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  50414. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  50415. e.setTexture(R.texture, 1),
  50416. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  50417. }
  50418. }
  50419. }
  50420. f.enable(p.CULL_FACE), f.enable(p.DEPTH_TEST), f.setDepthWrite(!0), e.resetGLState()
  50421. }
  50422. }
  50423. }),
  50424. (n.SpritePlugin = function (e, t) {
  50425. function i() {
  50426. var e = new Float32Array([-0.5, -0.5, 0, 0, 0.5, -0.5, 1, 0, 0.5, 0.5, 1, 1, -0.5, 0.5, 0, 1]),
  50427. t = new Uint16Array([0, 1, 2, 0, 2, 3])
  50428. ;(a = d.createBuffer()),
  50429. (s = d.createBuffer()),
  50430. d.bindBuffer(d.ARRAY_BUFFER, a),
  50431. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  50432. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  50433. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  50434. (l = r()),
  50435. (c = {
  50436. position: d.getAttribLocation(l, 'position'),
  50437. uv: d.getAttribLocation(l, 'uv')
  50438. }),
  50439. (h = {
  50440. uvOffset: d.getUniformLocation(l, 'uvOffset'),
  50441. uvScale: d.getUniformLocation(l, 'uvScale'),
  50442. rotation: d.getUniformLocation(l, 'rotation'),
  50443. scale: d.getUniformLocation(l, 'scale'),
  50444. color: d.getUniformLocation(l, 'color'),
  50445. map: d.getUniformLocation(l, 'map'),
  50446. opacity: d.getUniformLocation(l, 'opacity'),
  50447. modelViewMatrix: d.getUniformLocation(l, 'modelViewMatrix'),
  50448. projectionMatrix: d.getUniformLocation(l, 'projectionMatrix'),
  50449. fogType: d.getUniformLocation(l, 'fogType'),
  50450. fogDensity: d.getUniformLocation(l, 'fogDensity'),
  50451. fogNear: d.getUniformLocation(l, 'fogNear'),
  50452. fogFar: d.getUniformLocation(l, 'fogFar'),
  50453. fogColor: d.getUniformLocation(l, 'fogColor'),
  50454. alphaTest: d.getUniformLocation(l, 'alphaTest')
  50455. })
  50456. var i = document.createElement('canvas')
  50457. ;(i.width = 8), (i.height = 8)
  50458. var o = i.getContext('2d')
  50459. ;(o.fillStyle = 'white'), o.fillRect(0, 0, 8, 8), (u = new n.Texture(i)), (u.needsUpdate = !0)
  50460. }
  50461. function r() {
  50462. var t = d.createProgram(),
  50463. i = d.createShader(d.VERTEX_SHADER),
  50464. n = d.createShader(d.FRAGMENT_SHADER)
  50465. return (
  50466. d.shaderSource(
  50467. i,
  50468. [
  50469. 'precision ' + e.getPrecision() + ' float;',
  50470. 'uniform mat4 modelViewMatrix;',
  50471. 'uniform mat4 projectionMatrix;',
  50472. 'uniform float rotation;',
  50473. 'uniform vec2 scale;',
  50474. 'uniform vec2 uvOffset;',
  50475. 'uniform vec2 uvScale;',
  50476. 'attribute vec2 position;',
  50477. 'attribute vec2 uv;',
  50478. 'varying vec2 vUV;',
  50479. 'void main() {',
  50480. 'vUV = uvOffset + uv * uvScale;',
  50481. 'vec2 alignedPosition = position * scale;',
  50482. 'vec2 rotatedPosition;',
  50483. 'rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;',
  50484. 'rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;',
  50485. 'vec4 finalPosition;',
  50486. 'finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );',
  50487. 'finalPosition.xy += rotatedPosition;',
  50488. 'finalPosition = projectionMatrix * finalPosition;',
  50489. 'gl_Position = finalPosition;',
  50490. '}'
  50491. ].join('\n')
  50492. ),
  50493. d.shaderSource(
  50494. n,
  50495. [
  50496. 'precision ' + e.getPrecision() + ' float;',
  50497. 'uniform vec3 color;',
  50498. 'uniform sampler2D map;',
  50499. 'uniform float opacity;',
  50500. 'uniform int fogType;',
  50501. 'uniform vec3 fogColor;',
  50502. 'uniform float fogDensity;',
  50503. 'uniform float fogNear;',
  50504. 'uniform float fogFar;',
  50505. 'uniform float alphaTest;',
  50506. 'varying vec2 vUV;',
  50507. 'void main() {',
  50508. 'vec4 texture = texture2D( map, vUV );',
  50509. 'if ( texture.a < alphaTest ) discard;',
  50510. 'gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );',
  50511. 'if ( fogType > 0 ) {',
  50512. 'float depth = gl_FragCoord.z / gl_FragCoord.w;',
  50513. 'float fogFactor = 0.0;',
  50514. 'if ( fogType == 1 ) {',
  50515. 'fogFactor = smoothstep( fogNear, fogFar, depth );',
  50516. '} else {',
  50517. 'const float LOG2 = 1.442695;',
  50518. 'fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );',
  50519. 'fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );',
  50520. '}',
  50521. 'gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );',
  50522. '}',
  50523. '}'
  50524. ].join('\n')
  50525. ),
  50526. d.compileShader(i),
  50527. d.compileShader(n),
  50528. d.attachShader(t, i),
  50529. d.attachShader(t, n),
  50530. d.linkProgram(t),
  50531. t
  50532. )
  50533. }
  50534. function o(e, t) {
  50535. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  50536. }
  50537. var a,
  50538. s,
  50539. l,
  50540. c,
  50541. h,
  50542. u,
  50543. d = e.context,
  50544. p = e.state,
  50545. f = new n.Vector3(),
  50546. g = new n.Quaternion(),
  50547. m = new n.Vector3()
  50548. this.render = function (r, v) {
  50549. if (0 !== t.length) {
  50550. void 0 === l && i(),
  50551. d.useProgram(l),
  50552. p.initAttributes(),
  50553. p.enableAttribute(c.position),
  50554. p.enableAttribute(c.uv),
  50555. p.disableUnusedAttributes(),
  50556. p.disable(d.CULL_FACE),
  50557. p.enable(d.BLEND),
  50558. d.bindBuffer(d.ARRAY_BUFFER, a),
  50559. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  50560. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  50561. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  50562. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  50563. p.activeTexture(d.TEXTURE0),
  50564. d.uniform1i(h.map, 0)
  50565. var A = 0,
  50566. y = 0,
  50567. C = r.fog
  50568. C
  50569. ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  50570. C instanceof n.Fog
  50571. ? (d.uniform1f(h.fogNear, C.near), d.uniform1f(h.fogFar, C.far), d.uniform1i(h.fogType, 1), (A = 1), (y = 1))
  50572. : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density), d.uniform1i(h.fogType, 2), (A = 2), (y = 2)))
  50573. : (d.uniform1i(h.fogType, 0), (A = 0), (y = 0))
  50574. for (var I = 0, E = t.length; I < E; I++) {
  50575. var b = t[I]
  50576. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld), (b.z = -b.modelViewMatrix.elements[14])
  50577. }
  50578. t.sort(o)
  50579. for (var w = [], I = 0, E = t.length; I < E; I++) {
  50580. var b = t[I],
  50581. _ = b.material
  50582. d.uniform1f(h.alphaTest, _.alphaTest), d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements), b.matrixWorld.decompose(f, g, m), (w[0] = m.x), (w[1] = m.y)
  50583. var T = 0
  50584. r.fog && _.fog && (T = y),
  50585. A !== T && (d.uniform1i(h.fogType, T), (A = T)),
  50586. null !== _.map
  50587. ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y), d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y))
  50588. : (d.uniform2f(h.uvOffset, 0, 0), d.uniform2f(h.uvScale, 1, 1)),
  50589. d.uniform1f(h.opacity, _.opacity),
  50590. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  50591. d.uniform1f(h.rotation, _.rotation),
  50592. d.uniform2fv(h.scale, w),
  50593. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  50594. p.setDepthTest(_.depthTest),
  50595. p.setDepthWrite(_.depthWrite),
  50596. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  50597. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  50598. }
  50599. p.enable(d.CULL_FACE), e.resetGLState()
  50600. }
  50601. }
  50602. }),
  50603. Object.defineProperties(n.Box2.prototype, {
  50604. empty: {
  50605. value: function () {
  50606. return console.warn('THREE.Box2: .empty() has been renamed to .isEmpty().'), this.isEmpty()
  50607. }
  50608. },
  50609. isIntersectionBox: {
  50610. value: function (e) {
  50611. return console.warn('THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().'), this.intersectsBox(e)
  50612. }
  50613. }
  50614. }),
  50615. Object.defineProperties(n.Box3.prototype, {
  50616. empty: {
  50617. value: function () {
  50618. return console.warn('THREE.Box3: .empty() has been renamed to .isEmpty().'), this.isEmpty()
  50619. }
  50620. },
  50621. isIntersectionBox: {
  50622. value: function (e) {
  50623. return console.warn('THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().'), this.intersectsBox(e)
  50624. }
  50625. },
  50626. isIntersectionSphere: {
  50627. value: function (e) {
  50628. return console.warn('THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().'), this.intersectsSphere(e)
  50629. }
  50630. }
  50631. }),
  50632. Object.defineProperties(n.Matrix3.prototype, {
  50633. multiplyVector3: {
  50634. value: function (e) {
  50635. return console.warn('THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.'), e.applyMatrix3(this)
  50636. }
  50637. },
  50638. multiplyVector3Array: {
  50639. value: function (e) {
  50640. return console.warn('THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.'), this.applyToVector3Array(e)
  50641. }
  50642. }
  50643. }),
  50644. Object.defineProperties(n.Matrix4.prototype, {
  50645. extractPosition: {
  50646. value: function (e) {
  50647. return console.warn('THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().'), this.copyPosition(e)
  50648. }
  50649. },
  50650. setRotationFromQuaternion: {
  50651. value: function (e) {
  50652. return console.warn('THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().'), this.makeRotationFromQuaternion(e)
  50653. }
  50654. },
  50655. multiplyVector3: {
  50656. value: function (e) {
  50657. return console.warn('THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.'), e.applyProjection(this)
  50658. }
  50659. },
  50660. multiplyVector4: {
  50661. value: function (e) {
  50662. return console.warn('THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.'), e.applyMatrix4(this)
  50663. }
  50664. },
  50665. multiplyVector3Array: {
  50666. value: function (e) {
  50667. return console.warn('THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.'), this.applyToVector3Array(e)
  50668. }
  50669. },
  50670. rotateAxis: {
  50671. value: function (e) {
  50672. console.warn('THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.'), e.transformDirection(this)
  50673. }
  50674. },
  50675. crossVector: {
  50676. value: function (e) {
  50677. return console.warn('THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.'), e.applyMatrix4(this)
  50678. }
  50679. },
  50680. translate: {
  50681. value: function (e) {
  50682. console.error('THREE.Matrix4: .translate() has been removed.')
  50683. }
  50684. },
  50685. rotateX: {
  50686. value: function (e) {
  50687. console.error('THREE.Matrix4: .rotateX() has been removed.')
  50688. }
  50689. },
  50690. rotateY: {
  50691. value: function (e) {
  50692. console.error('THREE.Matrix4: .rotateY() has been removed.')
  50693. }
  50694. },
  50695. rotateZ: {
  50696. value: function (e) {
  50697. console.error('THREE.Matrix4: .rotateZ() has been removed.')
  50698. }
  50699. },
  50700. rotateByAxis: {
  50701. value: function (e, t) {
  50702. console.error('THREE.Matrix4: .rotateByAxis() has been removed.')
  50703. }
  50704. }
  50705. }),
  50706. Object.defineProperties(n.Plane.prototype, {
  50707. isIntersectionLine: {
  50708. value: function (e) {
  50709. return console.warn('THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().'), this.intersectsLine(e)
  50710. }
  50711. }
  50712. }),
  50713. Object.defineProperties(n.Quaternion.prototype, {
  50714. multiplyVector3: {
  50715. value: function (e) {
  50716. return console.warn('THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.'), e.applyQuaternion(this)
  50717. }
  50718. }
  50719. }),
  50720. Object.defineProperties(n.Ray.prototype, {
  50721. isIntersectionBox: {
  50722. value: function (e) {
  50723. return console.warn('THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().'), this.intersectsBox(e)
  50724. }
  50725. },
  50726. isIntersectionPlane: {
  50727. value: function (e) {
  50728. return console.warn('THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().'), this.intersectsPlane(e)
  50729. }
  50730. },
  50731. isIntersectionSphere: {
  50732. value: function (e) {
  50733. return console.warn('THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().'), this.intersectsSphere(e)
  50734. }
  50735. }
  50736. }),
  50737. Object.defineProperties(n.Vector3.prototype, {
  50738. setEulerFromRotationMatrix: {
  50739. value: function () {
  50740. console.error('THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.')
  50741. }
  50742. },
  50743. setEulerFromQuaternion: {
  50744. value: function () {
  50745. console.error('THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.')
  50746. }
  50747. },
  50748. getPositionFromMatrix: {
  50749. value: function (e) {
  50750. return console.warn('THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().'), this.setFromMatrixPosition(e)
  50751. }
  50752. },
  50753. getScaleFromMatrix: {
  50754. value: function (e) {
  50755. return console.warn('THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().'), this.setFromMatrixScale(e)
  50756. }
  50757. },
  50758. getColumnFromMatrix: {
  50759. value: function (e, t) {
  50760. return console.warn('THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().'), this.setFromMatrixColumn(e, t)
  50761. }
  50762. }
  50763. }),
  50764. (n.Face4 = function (e, t, i, r, o, a, s) {
  50765. return console.warn('THREE.Face4 has been removed. A THREE.Face3 will be created instead.'), new n.Face3(e, t, i, o, a, s)
  50766. }),
  50767. (n.Vertex = function (e, t, i) {
  50768. return console.warn('THREE.Vertex has been removed. Use THREE.Vector3 instead.'), new n.Vector3(e, t, i)
  50769. }),
  50770. Object.defineProperties(n.Object3D.prototype, {
  50771. eulerOrder: {
  50772. get: function () {
  50773. return console.warn('THREE.Object3D: .eulerOrder is now .rotation.order.'), this.rotation.order
  50774. },
  50775. set: function (e) {
  50776. console.warn('THREE.Object3D: .eulerOrder is now .rotation.order.'), (this.rotation.order = e)
  50777. }
  50778. },
  50779. getChildByName: {
  50780. value: function (e) {
  50781. return console.warn('THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().'), this.getObjectByName(e)
  50782. }
  50783. },
  50784. renderDepth: {
  50785. set: function (e) {
  50786. console.warn('THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.')
  50787. }
  50788. },
  50789. translate: {
  50790. value: function (e, t) {
  50791. return console.warn('THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.'), this.translateOnAxis(t, e)
  50792. }
  50793. },
  50794. useQuaternion: {
  50795. get: function () {
  50796. console.warn('THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.')
  50797. },
  50798. set: function (e) {
  50799. console.warn('THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.')
  50800. }
  50801. }
  50802. }),
  50803. Object.defineProperties(n, {
  50804. PointCloud: {
  50805. value: function (e, t) {
  50806. return console.warn('THREE.PointCloud has been renamed to THREE.Points.'), new n.Points(e, t)
  50807. }
  50808. },
  50809. ParticleSystem: {
  50810. value: function (e, t) {
  50811. return console.warn('THREE.ParticleSystem has been renamed to THREE.Points.'), new n.Points(e, t)
  50812. }
  50813. }
  50814. }),
  50815. Object.defineProperties(n.Light.prototype, {
  50816. onlyShadow: {
  50817. set: function (e) {
  50818. console.warn('THREE.Light: .onlyShadow has been removed.')
  50819. }
  50820. },
  50821. shadowCameraFov: {
  50822. set: function (e) {
  50823. console.warn('THREE.Light: .shadowCameraFov is now .shadow.camera.fov.'), (this.shadow.camera.fov = e)
  50824. }
  50825. },
  50826. shadowCameraLeft: {
  50827. set: function (e) {
  50828. console.warn('THREE.Light: .shadowCameraLeft is now .shadow.camera.left.'), (this.shadow.camera.left = e)
  50829. }
  50830. },
  50831. shadowCameraRight: {
  50832. set: function (e) {
  50833. console.warn('THREE.Light: .shadowCameraRight is now .shadow.camera.right.'), (this.shadow.camera.right = e)
  50834. }
  50835. },
  50836. shadowCameraTop: {
  50837. set: function (e) {
  50838. console.warn('THREE.Light: .shadowCameraTop is now .shadow.camera.top.'), (this.shadow.camera.top = e)
  50839. }
  50840. },
  50841. shadowCameraBottom: {
  50842. set: function (e) {
  50843. console.warn('THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.'), (this.shadow.camera.bottom = e)
  50844. }
  50845. },
  50846. shadowCameraNear: {
  50847. set: function (e) {
  50848. console.warn('THREE.Light: .shadowCameraNear is now .shadow.camera.near.'), (this.shadow.camera.near = e)
  50849. }
  50850. },
  50851. shadowCameraFar: {
  50852. set: function (e) {
  50853. console.warn('THREE.Light: .shadowCameraFar is now .shadow.camera.far.'), (this.shadow.camera.far = e)
  50854. }
  50855. },
  50856. shadowCameraVisible: {
  50857. set: function (e) {
  50858. console.warn('THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.')
  50859. }
  50860. },
  50861. shadowBias: {
  50862. set: function (e) {
  50863. console.warn('THREE.Light: .shadowBias is now .shadow.bias.'), (this.shadow.bias = e)
  50864. }
  50865. },
  50866. shadowDarkness: {
  50867. set: function (e) {
  50868. console.warn('THREE.Light: .shadowDarkness has been removed.')
  50869. }
  50870. },
  50871. shadowMapWidth: {
  50872. set: function (e) {
  50873. console.warn('THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.'), (this.shadow.mapSize.width = e)
  50874. }
  50875. },
  50876. shadowMapHeight: {
  50877. set: function (e) {
  50878. console.warn('THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.'), (this.shadow.mapSize.height = e)
  50879. }
  50880. }
  50881. }),
  50882. Object.defineProperties(n.BufferAttribute.prototype, {
  50883. length: {
  50884. get: function () {
  50885. return console.warn('THREE.BufferAttribute: .length has been deprecated. Please use .count.'), this.array.length
  50886. }
  50887. }
  50888. }),
  50889. Object.defineProperties(n.BufferGeometry.prototype, {
  50890. drawcalls: {
  50891. get: function () {
  50892. return console.error('THREE.BufferGeometry: .drawcalls has been renamed to .groups.'), this.groups
  50893. }
  50894. },
  50895. offsets: {
  50896. get: function () {
  50897. return console.warn('THREE.BufferGeometry: .offsets has been renamed to .groups.'), this.groups
  50898. }
  50899. },
  50900. addIndex: {
  50901. value: function (e) {
  50902. console.warn('THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().'), this.setIndex(e)
  50903. }
  50904. },
  50905. addDrawCall: {
  50906. value: function (e, t, i) {
  50907. void 0 !== i && console.warn('THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.'),
  50908. console.warn('THREE.BufferGeometry: .addDrawCall() is now .addGroup().'),
  50909. this.addGroup(e, t)
  50910. }
  50911. },
  50912. clearDrawCalls: {
  50913. value: function () {
  50914. console.warn('THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().'), this.clearGroups()
  50915. }
  50916. },
  50917. computeTangents: {
  50918. value: function () {
  50919. console.warn('THREE.BufferGeometry: .computeTangents() has been removed.')
  50920. }
  50921. },
  50922. computeOffsets: {
  50923. value: function () {
  50924. console.warn('THREE.BufferGeometry: .computeOffsets() has been removed.')
  50925. }
  50926. }
  50927. }),
  50928. Object.defineProperties(n.Material.prototype, {
  50929. wrapAround: {
  50930. get: function () {
  50931. console.warn('THREE.' + this.type + ': .wrapAround has been removed.')
  50932. },
  50933. set: function (e) {
  50934. console.warn('THREE.' + this.type + ': .wrapAround has been removed.')
  50935. }
  50936. },
  50937. wrapRGB: {
  50938. get: function () {
  50939. return console.warn('THREE.' + this.type + ': .wrapRGB has been removed.'), new n.Color()
  50940. }
  50941. }
  50942. }),
  50943. Object.defineProperties(n, {
  50944. PointCloudMaterial: {
  50945. value: function (e) {
  50946. return console.warn('THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.'), new n.PointsMaterial(e)
  50947. }
  50948. },
  50949. ParticleBasicMaterial: {
  50950. value: function (e) {
  50951. return console.warn('THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.'), new n.PointsMaterial(e)
  50952. }
  50953. },
  50954. ParticleSystemMaterial: {
  50955. value: function (e) {
  50956. return console.warn('THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.'), new n.PointsMaterial(e)
  50957. }
  50958. }
  50959. }),
  50960. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  50961. metal: {
  50962. get: function () {
  50963. return console.warn('THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.'), !1
  50964. },
  50965. set: function (e) {
  50966. console.warn('THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead')
  50967. }
  50968. }
  50969. }),
  50970. Object.defineProperties(n.ShaderMaterial.prototype, {
  50971. derivatives: {
  50972. get: function () {
  50973. return console.warn('THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.'), this.extensions.derivatives
  50974. },
  50975. set: function (e) {
  50976. console.warn('THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.'), (this.extensions.derivatives = e)
  50977. }
  50978. }
  50979. }),
  50980. Object.defineProperties(n.WebGLRenderer.prototype, {
  50981. supportsFloatTextures: {
  50982. value: function () {
  50983. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."), this.extensions.get('OES_texture_float')
  50984. }
  50985. },
  50986. supportsHalfFloatTextures: {
  50987. value: function () {
  50988. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."), this.extensions.get('OES_texture_half_float')
  50989. }
  50990. },
  50991. supportsStandardDerivatives: {
  50992. value: function () {
  50993. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."), this.extensions.get('OES_standard_derivatives')
  50994. }
  50995. },
  50996. supportsCompressedTextureS3TC: {
  50997. value: function () {
  50998. return (
  50999. console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."), this.extensions.get('WEBGL_compressed_texture_s3tc')
  51000. )
  51001. }
  51002. },
  51003. supportsCompressedTexturePVRTC: {
  51004. value: function () {
  51005. return (
  51006. console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  51007. this.extensions.get('WEBGL_compressed_texture_pvrtc')
  51008. )
  51009. }
  51010. },
  51011. supportsBlendMinMax: {
  51012. value: function () {
  51013. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."), this.extensions.get('EXT_blend_minmax')
  51014. }
  51015. },
  51016. supportsVertexTextures: {
  51017. value: function () {
  51018. return this.capabilities.vertexTextures
  51019. }
  51020. },
  51021. supportsInstancedArrays: {
  51022. value: function () {
  51023. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."), this.extensions.get('ANGLE_instanced_arrays')
  51024. }
  51025. },
  51026. enableScissorTest: {
  51027. value: function (e) {
  51028. console.warn('THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().'), this.setScissorTest(e)
  51029. }
  51030. },
  51031. initMaterial: {
  51032. value: function () {
  51033. console.warn('THREE.WebGLRenderer: .initMaterial() has been removed.')
  51034. }
  51035. },
  51036. addPrePlugin: {
  51037. value: function () {
  51038. console.warn('THREE.WebGLRenderer: .addPrePlugin() has been removed.')
  51039. }
  51040. },
  51041. addPostPlugin: {
  51042. value: function () {
  51043. console.warn('THREE.WebGLRenderer: .addPostPlugin() has been removed.')
  51044. }
  51045. },
  51046. updateShadowMap: {
  51047. value: function () {
  51048. console.warn('THREE.WebGLRenderer: .updateShadowMap() has been removed.')
  51049. }
  51050. },
  51051. shadowMapEnabled: {
  51052. get: function () {
  51053. return this.shadowMap.enabled
  51054. },
  51055. set: function (e) {
  51056. console.warn('THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.'), (this.shadowMap.enabled = e)
  51057. }
  51058. },
  51059. shadowMapType: {
  51060. get: function () {
  51061. return this.shadowMap.type
  51062. },
  51063. set: function (e) {
  51064. console.warn('THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.'), (this.shadowMap.type = e)
  51065. }
  51066. },
  51067. shadowMapCullFace: {
  51068. get: function () {
  51069. return this.shadowMap.cullFace
  51070. },
  51071. set: function (e) {
  51072. console.warn('THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.'), (this.shadowMap.cullFace = e)
  51073. }
  51074. }
  51075. }),
  51076. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  51077. wrapS: {
  51078. get: function () {
  51079. return console.warn('THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.'), this.texture.wrapS
  51080. },
  51081. set: function (e) {
  51082. console.warn('THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.'), (this.texture.wrapS = e)
  51083. }
  51084. },
  51085. wrapT: {
  51086. get: function () {
  51087. return console.warn('THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.'), this.texture.wrapT
  51088. },
  51089. set: function (e) {
  51090. console.warn('THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.'), (this.texture.wrapT = e)
  51091. }
  51092. },
  51093. magFilter: {
  51094. get: function () {
  51095. return console.warn('THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.'), this.texture.magFilter
  51096. },
  51097. set: function (e) {
  51098. console.warn('THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.'), (this.texture.magFilter = e)
  51099. }
  51100. },
  51101. minFilter: {
  51102. get: function () {
  51103. return console.warn('THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.'), this.texture.minFilter
  51104. },
  51105. set: function (e) {
  51106. console.warn('THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.'), (this.texture.minFilter = e)
  51107. }
  51108. },
  51109. anisotropy: {
  51110. get: function () {
  51111. return console.warn('THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.'), this.texture.anisotropy
  51112. },
  51113. set: function (e) {
  51114. console.warn('THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.'), (this.texture.anisotropy = e)
  51115. }
  51116. },
  51117. offset: {
  51118. get: function () {
  51119. return console.warn('THREE.WebGLRenderTarget: .offset is now .texture.offset.'), this.texture.offset
  51120. },
  51121. set: function (e) {
  51122. console.warn('THREE.WebGLRenderTarget: .offset is now .texture.offset.'), (this.texture.offset = e)
  51123. }
  51124. },
  51125. repeat: {
  51126. get: function () {
  51127. return console.warn('THREE.WebGLRenderTarget: .repeat is now .texture.repeat.'), this.texture.repeat
  51128. },
  51129. set: function (e) {
  51130. console.warn('THREE.WebGLRenderTarget: .repeat is now .texture.repeat.'), (this.texture.repeat = e)
  51131. }
  51132. },
  51133. format: {
  51134. get: function () {
  51135. return console.warn('THREE.WebGLRenderTarget: .format is now .texture.format.'), this.texture.format
  51136. },
  51137. set: function (e) {
  51138. console.warn('THREE.WebGLRenderTarget: .format is now .texture.format.'), (this.texture.format = e)
  51139. }
  51140. },
  51141. type: {
  51142. get: function () {
  51143. return console.warn('THREE.WebGLRenderTarget: .type is now .texture.type.'), this.texture.type
  51144. },
  51145. set: function (e) {
  51146. console.warn('THREE.WebGLRenderTarget: .type is now .texture.type.'), (this.texture.type = e)
  51147. }
  51148. },
  51149. generateMipmaps: {
  51150. get: function () {
  51151. return console.warn('THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.'), this.texture.generateMipmaps
  51152. },
  51153. set: function (e) {
  51154. console.warn('THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.'), (this.texture.generateMipmaps = e)
  51155. }
  51156. }
  51157. }),
  51158. (n.GeometryUtils = {
  51159. merge: function (e, t, i) {
  51160. console.warn('THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.')
  51161. var r
  51162. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(), (r = t.matrix), (t = t.geometry)), e.merge(t, r, i)
  51163. },
  51164. center: function (e) {
  51165. return console.warn('THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.'), e.center()
  51166. }
  51167. }),
  51168. (n.ImageUtils = {
  51169. crossOrigin: void 0,
  51170. loadTexture: function (e, t, i, r) {
  51171. console.warn('THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.')
  51172. var o = new n.TextureLoader()
  51173. o.setCrossOrigin(this.crossOrigin)
  51174. var a = o.load(e, i, void 0, r)
  51175. return t && (a.mapping = t), a
  51176. },
  51177. loadTextureCube: function (e, t, i, r) {
  51178. console.warn('THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.')
  51179. var o = new n.CubeTextureLoader()
  51180. o.setCrossOrigin(this.crossOrigin)
  51181. var a = o.load(e, i, void 0, r)
  51182. return t && (a.mapping = t), a
  51183. },
  51184. loadCompressedTexture: function () {
  51185. console.error('THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.')
  51186. },
  51187. loadCompressedTextureCube: function () {
  51188. console.error('THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.')
  51189. }
  51190. }),
  51191. (n.Projector = function () {
  51192. console.error('THREE.Projector has been moved to /examples/js/renderers/Projector.js.'),
  51193. (this.projectVector = function (e, t) {
  51194. console.warn('THREE.Projector: .projectVector() is now vector.project().'), e.project(t)
  51195. }),
  51196. (this.unprojectVector = function (e, t) {
  51197. console.warn('THREE.Projector: .unprojectVector() is now vector.unproject().'), e.unproject(t)
  51198. }),
  51199. (this.pickingRay = function (e, t) {
  51200. console.error('THREE.Projector: .pickingRay() is now raycaster.setFromCamera().')
  51201. })
  51202. }),
  51203. (n.CanvasRenderer = function () {
  51204. console.error('THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js'),
  51205. (this.domElement = document.createElement('canvas')),
  51206. (this.clear = function () {}),
  51207. (this.render = function () {}),
  51208. (this.setClearColor = function () {}),
  51209. (this.setSize = function () {})
  51210. }),
  51211. (n.MeshFaceMaterial = n.MultiMaterial),
  51212. (n.CurveUtils = {
  51213. tangentQuadraticBezier: function (e, t, i, n) {
  51214. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  51215. },
  51216. tangentCubicBezier: function (e, t, i, n, r) {
  51217. return -3 * t * (1 - e) * (1 - e) + 3 * i * (1 - e) * (1 - e) - 6 * e * i * (1 - e) + 6 * e * n * (1 - e) - 3 * e * e * n + 3 * e * e * r
  51218. },
  51219. tangentSpline: function (e, t, i, n, r) {
  51220. var o = 6 * e * e - 6 * e,
  51221. a = 3 * e * e - 4 * e + 1,
  51222. s = -6 * e * e + 6 * e,
  51223. l = 3 * e * e - 2 * e
  51224. return o + a + s + l
  51225. },
  51226. interpolate: function (e, t, i, n, r) {
  51227. var o = 0.5 * (i - e),
  51228. a = 0.5 * (n - t),
  51229. s = r * r,
  51230. l = r * s
  51231. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  51232. }
  51233. }),
  51234. (n.SceneUtils = {
  51235. createMultiMaterialObject: function (e, t) {
  51236. for (var i = new n.Group(), r = 0, o = t.length; r < o; r++) i.add(new n.Mesh(e, t[r]))
  51237. return i
  51238. },
  51239. detach: function (e, t, i) {
  51240. e.applyMatrix(t.matrixWorld), t.remove(e), i.add(e)
  51241. },
  51242. attach: function (e, t, i) {
  51243. var r = new n.Matrix4()
  51244. r.getInverse(i.matrixWorld), e.applyMatrix(r), t.remove(e), i.add(e)
  51245. }
  51246. }),
  51247. (n.ShapeUtils = {
  51248. area: function (e) {
  51249. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++) i += e[n].x * e[r].y - e[r].x * e[n].y
  51250. return 0.5 * i
  51251. },
  51252. triangulate: (function () {
  51253. function e(e, t, i, n, r, o) {
  51254. var a, s, l, c, h, u, d, p, f
  51255. if (((s = e[o[t]].x), (l = e[o[t]].y), (c = e[o[i]].x), (h = e[o[i]].y), (u = e[o[n]].x), (d = e[o[n]].y), Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))) return !1
  51256. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M
  51257. for (g = u - c, m = d - h, v = s - u, A = l - d, y = c - s, C = h - l, a = 0; a < r; a++)
  51258. if (
  51259. ((p = e[o[a]].x),
  51260. (f = e[o[a]].y),
  51261. !((p === s && f === l) || (p === c && f === h) || (p === u && f === d)) &&
  51262. ((I = p - s),
  51263. (E = f - l),
  51264. (b = p - c),
  51265. (w = f - h),
  51266. (_ = p - u),
  51267. (T = f - d),
  51268. (M = g * w - m * b),
  51269. (x = y * E - C * I),
  51270. (S = v * T - A * _),
  51271. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  51272. )
  51273. return !1
  51274. return !0
  51275. }
  51276. return function (t, i) {
  51277. var r = t.length
  51278. if (r < 3) return null
  51279. var o,
  51280. a,
  51281. s,
  51282. l = [],
  51283. c = [],
  51284. h = []
  51285. if (n.ShapeUtils.area(t) > 0) for (a = 0; a < r; a++) c[a] = a
  51286. else for (a = 0; a < r; a++) c[a] = r - 1 - a
  51287. var u = r,
  51288. d = 2 * u
  51289. for (a = u - 1; u > 2; ) {
  51290. if (d-- <= 0) return console.warn('THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()'), i ? h : l
  51291. if (((o = a), u <= o && (o = 0), (a = o + 1), u <= a && (a = 0), (s = a + 1), u <= s && (s = 0), e(t, o, a, s, u, c))) {
  51292. var p, f, g, m, v
  51293. for (p = c[o], f = c[a], g = c[s], l.push([t[p], t[f], t[g]]), h.push([c[o], c[a], c[s]]), m = a, v = a + 1; v < u; m++, v++) c[m] = c[v]
  51294. u--, (d = 2 * u)
  51295. }
  51296. }
  51297. return i ? h : l
  51298. }
  51299. })(),
  51300. triangulateShape: function (e, t) {
  51301. function i(e, t, i) {
  51302. return e.x !== t.x ? (e.x < t.x ? e.x <= i.x && i.x <= t.x : t.x <= i.x && i.x <= e.x) : e.y < t.y ? e.y <= i.y && i.y <= t.y : t.y <= i.y && i.y <= e.y
  51303. }
  51304. function r(e, t, n, r, o) {
  51305. var a = t.x - e.x,
  51306. s = t.y - e.y,
  51307. l = r.x - n.x,
  51308. c = r.y - n.y,
  51309. h = e.x - n.x,
  51310. u = e.y - n.y,
  51311. d = s * l - a * c,
  51312. p = s * h - a * u
  51313. if (Math.abs(d) > Number.EPSILON) {
  51314. var f
  51315. if (d > 0) {
  51316. if (p < 0 || p > d) return []
  51317. if (((f = c * h - l * u), f < 0 || f > d)) return []
  51318. } else {
  51319. if (p > 0 || p < d) return []
  51320. if (((f = c * h - l * u), f > 0 || f < d)) return []
  51321. }
  51322. if (0 === f) return !o || (0 !== p && p !== d) ? [e] : []
  51323. if (f === d) return !o || (0 !== p && p !== d) ? [t] : []
  51324. if (0 === p) return [n]
  51325. if (p === d) return [r]
  51326. var g = f / d
  51327. return [
  51328. {
  51329. x: e.x + g * a,
  51330. y: e.y + g * s
  51331. }
  51332. ]
  51333. }
  51334. if (0 !== p || c * h !== l * u) return []
  51335. var m = 0 === a && 0 === s,
  51336. v = 0 === l && 0 === c
  51337. if (m && v) return e.x !== n.x || e.y !== n.y ? [] : [e]
  51338. if (m) return i(n, r, e) ? [e] : []
  51339. if (v) return i(e, t, n) ? [n] : []
  51340. var A, y, C, I, E, b, w, _
  51341. return (
  51342. 0 !== a
  51343. ? (e.x < t.x ? ((A = e), (C = e.x), (y = t), (I = t.x)) : ((A = t), (C = t.x), (y = e), (I = e.x)),
  51344. n.x < r.x ? ((E = n), (w = n.x), (b = r), (_ = r.x)) : ((E = r), (w = r.x), (b = n), (_ = n.x)))
  51345. : (e.y < t.y ? ((A = e), (C = e.y), (y = t), (I = t.y)) : ((A = t), (C = t.y), (y = e), (I = e.y)),
  51346. n.y < r.y ? ((E = n), (w = n.y), (b = r), (_ = r.y)) : ((E = r), (w = r.y), (b = n), (_ = n.y))),
  51347. C <= w ? (I < w ? [] : I === w ? (o ? [] : [E]) : I <= _ ? [E, y] : [E, b]) : C > _ ? [] : C === _ ? (o ? [] : [A]) : I <= _ ? [A, y] : [A, b]
  51348. )
  51349. }
  51350. function o(e, t, i, n) {
  51351. var r = t.x - e.x,
  51352. o = t.y - e.y,
  51353. a = i.x - e.x,
  51354. s = i.y - e.y,
  51355. l = n.x - e.x,
  51356. c = n.y - e.y,
  51357. h = r * s - o * a,
  51358. u = r * c - o * l
  51359. if (Math.abs(h) > Number.EPSILON) {
  51360. var d = l * s - c * a
  51361. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  51362. }
  51363. return u > 0
  51364. }
  51365. function a(e, t) {
  51366. function i(e, t) {
  51367. var i = A.length - 1,
  51368. n = e - 1
  51369. n < 0 && (n = i)
  51370. var r = e + 1
  51371. r > i && (r = 0)
  51372. var a = o(A[e], A[n], A[r], s[t])
  51373. if (!a) return !1
  51374. var l = s.length - 1,
  51375. c = t - 1
  51376. c < 0 && (c = l)
  51377. var h = t + 1
  51378. return h > l && (h = 0), (a = o(s[t], s[c], s[h], A[e])), !!a
  51379. }
  51380. function n(e, t) {
  51381. var i, n, o
  51382. for (i = 0; i < A.length; i++) if (((n = i + 1), (n %= A.length), (o = r(e, t, A[i], A[n], !0)), o.length > 0)) return !0
  51383. return !1
  51384. }
  51385. function a(e, i) {
  51386. var n, o, a, s, l
  51387. for (n = 0; n < y.length; n++) for (o = t[y[n]], a = 0; a < o.length; a++) if (((s = a + 1), (s %= o.length), (l = r(e, i, o[a], o[s], !0)), l.length > 0)) return !0
  51388. return !1
  51389. }
  51390. for (var s, l, c, h, u, d, p, f, g, m, v, A = e.concat(), y = [], C = [], I = 0, E = t.length; I < E; I++) y.push(I)
  51391. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  51392. if ((w--, w < 0)) {
  51393. console.log('Infinite Loop! Holes left:' + y.length + ', Probably Hole outside Shape!')
  51394. break
  51395. }
  51396. for (c = b; c < A.length; c++) {
  51397. ;(h = A[c]), (l = -1)
  51398. for (var I = 0; I < y.length; I++)
  51399. if (((d = y[I]), (p = h.x + ':' + h.y + ':' + d), void 0 === C[p])) {
  51400. s = t[d]
  51401. for (var _ = 0; _ < s.length; _++)
  51402. if (((u = s[_]), i(c, _) && !n(h, u) && !a(h, u))) {
  51403. ;(l = _), y.splice(I, 1), (f = A.slice(0, c + 1)), (g = A.slice(c)), (m = s.slice(l)), (v = s.slice(0, l + 1)), (A = f.concat(m).concat(v).concat(g)), (b = c)
  51404. break
  51405. }
  51406. if (l >= 0) break
  51407. C[p] = !0
  51408. }
  51409. if (l >= 0) break
  51410. }
  51411. }
  51412. return A
  51413. }
  51414. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++) Array.prototype.push.apply(f, t[g])
  51415. for (s = 0, l = f.length; s < l; s++) (u = f[s].x + ':' + f[s].y), void 0 !== p[u] && console.warn('THREE.Shape: Duplicate point', u), (p[u] = s)
  51416. var v = a(e, t),
  51417. A = n.ShapeUtils.triangulate(v, !1)
  51418. for (s = 0, l = A.length; s < l; s++) for (h = A[s], c = 0; c < 3; c++) (u = h[c].x + ':' + h[c].y), (d = p[u]), void 0 !== d && (h[c] = d)
  51419. return A.concat()
  51420. },
  51421. isClockWise: function (e) {
  51422. return n.ShapeUtils.area(e) < 0
  51423. },
  51424. b2: (function () {
  51425. function e(e, t) {
  51426. var i = 1 - e
  51427. return i * i * t
  51428. }
  51429. function t(e, t) {
  51430. return 2 * (1 - e) * e * t
  51431. }
  51432. function i(e, t) {
  51433. return e * e * t
  51434. }
  51435. return function (n, r, o, a) {
  51436. return e(n, r) + t(n, o) + i(n, a)
  51437. }
  51438. })(),
  51439. b3: (function () {
  51440. function e(e, t) {
  51441. var i = 1 - e
  51442. return i * i * i * t
  51443. }
  51444. function t(e, t) {
  51445. var i = 1 - e
  51446. return 3 * i * i * e * t
  51447. }
  51448. function i(e, t) {
  51449. var i = 1 - e
  51450. return 3 * i * e * e * t
  51451. }
  51452. function n(e, t) {
  51453. return e * e * e * t
  51454. }
  51455. return function (r, o, a, s, l) {
  51456. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  51457. }
  51458. })()
  51459. }),
  51460. (n.Curve = function () {}),
  51461. (n.Curve.prototype = {
  51462. constructor: n.Curve,
  51463. getPoint: function (e) {
  51464. return console.warn('THREE.Curve: Warning, getPoint() not implemented!'), null
  51465. },
  51466. getPointAt: function (e) {
  51467. var t = this.getUtoTmapping(e)
  51468. return this.getPoint(t)
  51469. },
  51470. getPoints: function (e) {
  51471. e || (e = 5)
  51472. var t,
  51473. i = []
  51474. for (t = 0; t <= e; t++) i.push(this.getPoint(t / e))
  51475. return i
  51476. },
  51477. getSpacedPoints: function (e) {
  51478. e || (e = 5)
  51479. var t,
  51480. i = []
  51481. for (t = 0; t <= e; t++) i.push(this.getPointAt(t / e))
  51482. return i
  51483. },
  51484. getLength: function () {
  51485. var e = this.getLengths()
  51486. return e[e.length - 1]
  51487. },
  51488. getLengths: function (e) {
  51489. if ((e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200), this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate))
  51490. return this.cacheArcLengths
  51491. this.needsUpdate = !1
  51492. var t,
  51493. i,
  51494. n = [],
  51495. r = this.getPoint(0),
  51496. o = 0
  51497. for (n.push(0), i = 1; i <= e; i++) (t = this.getPoint(i / e)), (o += t.distanceTo(r)), n.push(o), (r = t)
  51498. return (this.cacheArcLengths = n), n
  51499. },
  51500. updateArcLengths: function () {
  51501. ;(this.needsUpdate = !0), this.getLengths()
  51502. },
  51503. getUtoTmapping: function (e, t) {
  51504. var i,
  51505. n = this.getLengths(),
  51506. r = 0,
  51507. o = n.length
  51508. i = t ? t : e * n[o - 1]
  51509. for (var a, s = 0, l = o - 1; s <= l; )
  51510. if (((r = Math.floor(s + (l - s) / 2)), (a = n[r] - i), a < 0)) s = r + 1
  51511. else {
  51512. if (!(a > 0)) {
  51513. l = r
  51514. break
  51515. }
  51516. l = r - 1
  51517. }
  51518. if (((r = l), n[r] === i)) {
  51519. var c = r / (o - 1)
  51520. return c
  51521. }
  51522. var h = n[r],
  51523. u = n[r + 1],
  51524. d = u - h,
  51525. p = (i - h) / d,
  51526. c = (r + p) / (o - 1)
  51527. return c
  51528. },
  51529. getTangent: function (e) {
  51530. var t = 1e-4,
  51531. i = e - t,
  51532. n = e + t
  51533. i < 0 && (i = 0), n > 1 && (n = 1)
  51534. var r = this.getPoint(i),
  51535. o = this.getPoint(n),
  51536. a = o.clone().sub(r)
  51537. return a.normalize()
  51538. },
  51539. getTangentAt: function (e) {
  51540. var t = this.getUtoTmapping(e)
  51541. return this.getTangent(t)
  51542. }
  51543. }),
  51544. (n.Curve.create = function (e, t) {
  51545. return (e.prototype = Object.create(n.Curve.prototype)), (e.prototype.constructor = e), (e.prototype.getPoint = t), e
  51546. }),
  51547. (n.CurvePath = function () {
  51548. ;(this.curves = []), (this.autoClose = !1)
  51549. }),
  51550. (n.CurvePath.prototype = Object.create(n.Curve.prototype)),
  51551. (n.CurvePath.prototype.constructor = n.CurvePath),
  51552. (n.CurvePath.prototype.add = function (e) {
  51553. this.curves.push(e)
  51554. }),
  51555. (n.CurvePath.prototype.closePath = function () {
  51556. var e = this.curves[0].getPoint(0),
  51557. t = this.curves[this.curves.length - 1].getPoint(1)
  51558. e.equals(t) || this.curves.push(new n.LineCurve(t, e))
  51559. }),
  51560. (n.CurvePath.prototype.getPoint = function (e) {
  51561. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  51562. if (i[n] >= t) {
  51563. var r = i[n] - t,
  51564. o = this.curves[n],
  51565. a = 1 - r / o.getLength()
  51566. return o.getPointAt(a)
  51567. }
  51568. n++
  51569. }
  51570. return null
  51571. }),
  51572. (n.CurvePath.prototype.getLength = function () {
  51573. var e = this.getCurveLengths()
  51574. return e[e.length - 1]
  51575. }),
  51576. (n.CurvePath.prototype.getCurveLengths = function () {
  51577. if (this.cacheLengths && this.cacheLengths.length === this.curves.length) return this.cacheLengths
  51578. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++) (t += this.curves[i].getLength()), e.push(t)
  51579. return (this.cacheLengths = e), e
  51580. }),
  51581. (n.CurvePath.prototype.createPointsGeometry = function (e) {
  51582. var t = this.getPoints(e)
  51583. return this.createGeometry(t)
  51584. }),
  51585. (n.CurvePath.prototype.createSpacedPointsGeometry = function (e) {
  51586. var t = this.getSpacedPoints(e)
  51587. return this.createGeometry(t)
  51588. }),
  51589. (n.CurvePath.prototype.createGeometry = function (e) {
  51590. for (var t = new n.Geometry(), i = 0, r = e.length; i < r; i++) {
  51591. var o = e[i]
  51592. t.vertices.push(new n.Vector3(o.x, o.y, o.z || 0))
  51593. }
  51594. return t
  51595. }),
  51596. (n.Font = function (e) {
  51597. this.data = e
  51598. }),
  51599. (n.Font.prototype = {
  51600. constructor: n.Font,
  51601. generateShapes: function (e, t, i) {
  51602. function r(e) {
  51603. for (var i = String(e).split(''), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  51604. var c = o(i[l], n, r)
  51605. ;(r += c.offset), s.push(c.path)
  51606. }
  51607. return s
  51608. }
  51609. function o(e, t, r) {
  51610. var o = a.glyphs[e] || a.glyphs['?']
  51611. if (o) {
  51612. var s,
  51613. l,
  51614. c,
  51615. h,
  51616. u,
  51617. d,
  51618. p,
  51619. f,
  51620. g,
  51621. m,
  51622. v,
  51623. A = new n.Path(),
  51624. y = [],
  51625. C = n.ShapeUtils.b2,
  51626. I = n.ShapeUtils.b3
  51627. if (o.o)
  51628. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(' ')), b = 0, w = E.length; b < w; ) {
  51629. var _ = E[b++]
  51630. switch (_) {
  51631. case 'm':
  51632. ;(s = E[b++] * t + r), (l = E[b++] * t), A.moveTo(s, l)
  51633. break
  51634. case 'l':
  51635. ;(s = E[b++] * t + r), (l = E[b++] * t), A.lineTo(s, l)
  51636. break
  51637. case 'q':
  51638. if (((c = E[b++] * t + r), (h = E[b++] * t), (p = E[b++] * t + r), (f = E[b++] * t), A.quadraticCurveTo(p, f, c, h), (v = y[y.length - 1]))) {
  51639. ;(u = v.x), (d = v.y)
  51640. for (var T = 1; T <= i; T++) {
  51641. var x = T / i
  51642. C(x, u, p, c), C(x, d, f, h)
  51643. }
  51644. }
  51645. break
  51646. case 'b':
  51647. if (
  51648. ((c = E[b++] * t + r),
  51649. (h = E[b++] * t),
  51650. (p = E[b++] * t + r),
  51651. (f = E[b++] * t),
  51652. (g = E[b++] * t + r),
  51653. (m = E[b++] * t),
  51654. A.bezierCurveTo(p, f, g, m, c, h),
  51655. (v = y[y.length - 1]))
  51656. ) {
  51657. ;(u = v.x), (d = v.y)
  51658. for (var T = 1; T <= i; T++) {
  51659. var x = T / i
  51660. I(x, u, p, g, c), I(x, d, f, m, h)
  51661. }
  51662. }
  51663. }
  51664. }
  51665. return {
  51666. offset: o.ha * t,
  51667. path: A
  51668. }
  51669. }
  51670. }
  51671. void 0 === t && (t = 100), void 0 === i && (i = 4)
  51672. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++) Array.prototype.push.apply(l, s[c].toShapes())
  51673. return l
  51674. }
  51675. }),
  51676. (n.Path = function (e) {
  51677. n.CurvePath.call(this), (this.actions = []), e && this.fromPoints(e)
  51678. }),
  51679. (n.Path.prototype = Object.create(n.CurvePath.prototype)),
  51680. (n.Path.prototype.constructor = n.Path),
  51681. (n.Path.prototype.fromPoints = function (e) {
  51682. this.moveTo(e[0].x, e[0].y)
  51683. for (var t = 1, i = e.length; t < i; t++) this.lineTo(e[t].x, e[t].y)
  51684. }),
  51685. (n.Path.prototype.moveTo = function (e, t) {
  51686. this.actions.push({
  51687. action: 'moveTo',
  51688. args: [e, t]
  51689. })
  51690. }),
  51691. (n.Path.prototype.lineTo = function (e, t) {
  51692. var i = this.actions[this.actions.length - 1].args,
  51693. r = i[i.length - 2],
  51694. o = i[i.length - 1],
  51695. a = new n.LineCurve(new n.Vector2(r, o), new n.Vector2(e, t))
  51696. this.curves.push(a),
  51697. this.actions.push({
  51698. action: 'lineTo',
  51699. args: [e, t]
  51700. })
  51701. }),
  51702. (n.Path.prototype.quadraticCurveTo = function (e, t, i, r) {
  51703. var o = this.actions[this.actions.length - 1].args,
  51704. a = o[o.length - 2],
  51705. s = o[o.length - 1],
  51706. l = new n.QuadraticBezierCurve(new n.Vector2(a, s), new n.Vector2(e, t), new n.Vector2(i, r))
  51707. this.curves.push(l),
  51708. this.actions.push({
  51709. action: 'quadraticCurveTo',
  51710. args: [e, t, i, r]
  51711. })
  51712. }),
  51713. (n.Path.prototype.bezierCurveTo = function (e, t, i, r, o, a) {
  51714. var s = this.actions[this.actions.length - 1].args,
  51715. l = s[s.length - 2],
  51716. c = s[s.length - 1],
  51717. h = new n.CubicBezierCurve(new n.Vector2(l, c), new n.Vector2(e, t), new n.Vector2(i, r), new n.Vector2(o, a))
  51718. this.curves.push(h),
  51719. this.actions.push({
  51720. action: 'bezierCurveTo',
  51721. args: [e, t, i, r, o, a]
  51722. })
  51723. }),
  51724. (n.Path.prototype.splineThru = function (e) {
  51725. var t = Array.prototype.slice.call(arguments),
  51726. i = this.actions[this.actions.length - 1].args,
  51727. r = i[i.length - 2],
  51728. o = i[i.length - 1],
  51729. a = [new n.Vector2(r, o)]
  51730. Array.prototype.push.apply(a, e)
  51731. var s = new n.SplineCurve(a)
  51732. this.curves.push(s),
  51733. this.actions.push({
  51734. action: 'splineThru',
  51735. args: t
  51736. })
  51737. }),
  51738. (n.Path.prototype.arc = function (e, t, i, n, r, o) {
  51739. var a = this.actions[this.actions.length - 1].args,
  51740. s = a[a.length - 2],
  51741. l = a[a.length - 1]
  51742. this.absarc(e + s, t + l, i, n, r, o)
  51743. }),
  51744. (n.Path.prototype.absarc = function (e, t, i, n, r, o) {
  51745. this.absellipse(e, t, i, i, n, r, o)
  51746. }),
  51747. (n.Path.prototype.ellipse = function (e, t, i, n, r, o, a, s) {
  51748. var l = this.actions[this.actions.length - 1].args,
  51749. c = l[l.length - 2],
  51750. h = l[l.length - 1]
  51751. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  51752. }),
  51753. (n.Path.prototype.absellipse = function (e, t, i, r, o, a, s, l) {
  51754. var c = [e, t, i, r, o, a, s, l || 0],
  51755. h = new n.EllipseCurve(e, t, i, r, o, a, s, l)
  51756. this.curves.push(h)
  51757. var u = h.getPoint(1)
  51758. c.push(u.x),
  51759. c.push(u.y),
  51760. this.actions.push({
  51761. action: 'ellipse',
  51762. args: c
  51763. })
  51764. }),
  51765. (n.Path.prototype.getSpacedPoints = function (e) {
  51766. e || (e = 40)
  51767. for (var t = [], i = 0; i < e; i++) t.push(this.getPoint(i / e))
  51768. return this.autoClose && t.push(t[0]), t
  51769. }),
  51770. (n.Path.prototype.getPoints = function (e) {
  51771. e = e || 12
  51772. for (var t, i, r, o, a, s, l, c, h, u, d, p = n.ShapeUtils.b2, f = n.ShapeUtils.b3, g = [], m = 0, v = this.actions.length; m < v; m++) {
  51773. var A = this.actions[m],
  51774. y = A.action,
  51775. C = A.args
  51776. switch (y) {
  51777. case 'moveTo':
  51778. g.push(new n.Vector2(C[0], C[1]))
  51779. break
  51780. case 'lineTo':
  51781. g.push(new n.Vector2(C[0], C[1]))
  51782. break
  51783. case 'quadraticCurveTo':
  51784. ;(t = C[2]),
  51785. (i = C[3]),
  51786. (a = C[0]),
  51787. (s = C[1]),
  51788. g.length > 0 ? ((h = g[g.length - 1]), (l = h.x), (c = h.y)) : ((h = this.actions[m - 1].args), (l = h[h.length - 2]), (c = h[h.length - 1]))
  51789. for (var I = 1; I <= e; I++) {
  51790. var E = I / e
  51791. ;(u = p(E, l, a, t)), (d = p(E, c, s, i)), g.push(new n.Vector2(u, d))
  51792. }
  51793. break
  51794. case 'bezierCurveTo':
  51795. ;(t = C[4]),
  51796. (i = C[5]),
  51797. (a = C[0]),
  51798. (s = C[1]),
  51799. (r = C[2]),
  51800. (o = C[3]),
  51801. g.length > 0 ? ((h = g[g.length - 1]), (l = h.x), (c = h.y)) : ((h = this.actions[m - 1].args), (l = h[h.length - 2]), (c = h[h.length - 1]))
  51802. for (var I = 1; I <= e; I++) {
  51803. var E = I / e
  51804. ;(u = f(E, l, a, r, t)), (d = f(E, c, s, o, i)), g.push(new n.Vector2(u, d))
  51805. }
  51806. break
  51807. case 'splineThru':
  51808. h = this.actions[m - 1].args
  51809. var b = new n.Vector2(h[h.length - 2], h[h.length - 1]),
  51810. w = [b],
  51811. _ = e * C[0].length
  51812. w = w.concat(C[0])
  51813. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++) g.push(T.getPointAt(I / _))
  51814. break
  51815. case 'arc':
  51816. for (var x, S = C[0], M = C[1], R = C[2], P = C[3], O = C[4], L = !!C[5], D = O - P, N = 2 * e, I = 1; I <= N; I++) {
  51817. var E = I / N
  51818. L || (E = 1 - E), (x = P + E * D), (u = S + R * Math.cos(x)), (d = M + R * Math.sin(x)), g.push(new n.Vector2(u, d))
  51819. }
  51820. break
  51821. case 'ellipse':
  51822. var x,
  51823. B,
  51824. F,
  51825. S = C[0],
  51826. M = C[1],
  51827. V = C[2],
  51828. U = C[3],
  51829. P = C[4],
  51830. O = C[5],
  51831. L = !!C[6],
  51832. k = C[7],
  51833. D = O - P,
  51834. N = 2 * e
  51835. 0 !== k && ((B = Math.cos(k)), (F = Math.sin(k)))
  51836. for (var I = 1; I <= N; I++) {
  51837. var E = I / N
  51838. if ((L || (E = 1 - E), (x = P + E * D), (u = S + V * Math.cos(x)), (d = M + U * Math.sin(x)), 0 !== k)) {
  51839. var H = u,
  51840. G = d
  51841. ;(u = (H - S) * B - (G - M) * F + S), (d = (H - S) * F + (G - M) * B + M)
  51842. }
  51843. g.push(new n.Vector2(u, d))
  51844. }
  51845. }
  51846. }
  51847. var z = g[g.length - 1]
  51848. return Math.abs(z.x - g[0].x) < Number.EPSILON && Math.abs(z.y - g[0].y) < Number.EPSILON && g.splice(g.length - 1, 1), this.autoClose && g.push(g[0]), g
  51849. }),
  51850. (n.Path.prototype.toShapes = function (e, t) {
  51851. function i(e) {
  51852. for (var t = [], i = new n.Path(), r = 0, o = e.length; r < o; r++) {
  51853. var a = e[r],
  51854. s = a.args,
  51855. l = a.action
  51856. 'moveTo' === l && 0 !== i.actions.length && (t.push(i), (i = new n.Path())), i[l].apply(i, s)
  51857. }
  51858. return 0 !== i.actions.length && t.push(i), t
  51859. }
  51860. function r(e) {
  51861. for (var t = [], i = 0, r = e.length; i < r; i++) {
  51862. var o = e[i],
  51863. a = new n.Shape()
  51864. ;(a.actions = o.actions), (a.curves = o.curves), t.push(a)
  51865. }
  51866. return t
  51867. }
  51868. function o(e, t) {
  51869. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  51870. var a = t[r],
  51871. s = t[o],
  51872. l = s.x - a.x,
  51873. c = s.y - a.y
  51874. if (Math.abs(c) > Number.EPSILON) {
  51875. if ((c < 0 && ((a = t[o]), (l = -l), (s = t[r]), (c = -c)), e.y < a.y || e.y > s.y)) continue
  51876. if (e.y === a.y) {
  51877. if (e.x === a.x) return !0
  51878. } else {
  51879. var h = c * (e.x - a.x) - l * (e.y - a.y)
  51880. if (0 === h) return !0
  51881. if (h < 0) continue
  51882. n = !n
  51883. }
  51884. } else {
  51885. if (e.y !== a.y) continue
  51886. if ((s.x <= e.x && e.x <= a.x) || (a.x <= e.x && e.x <= s.x)) return !0
  51887. }
  51888. }
  51889. return n
  51890. }
  51891. var a = n.ShapeUtils.isClockWise,
  51892. s = i(this.actions)
  51893. if (0 === s.length) return []
  51894. if (t === !0) return r(s)
  51895. var l,
  51896. c,
  51897. h,
  51898. u = []
  51899. if (1 === s.length) return (c = s[0]), (h = new n.Shape()), (h.actions = c.actions), (h.curves = c.curves), u.push(h), u
  51900. var d = !a(s[0].getPoints())
  51901. d = e ? !d : d
  51902. var p,
  51903. f = [],
  51904. g = [],
  51905. m = [],
  51906. v = 0
  51907. ;(g[v] = void 0), (m[v] = [])
  51908. for (var A = 0, y = s.length; A < y; A++)
  51909. (c = s[A]),
  51910. (p = c.getPoints()),
  51911. (l = a(p)),
  51912. (l = e ? !l : l),
  51913. l
  51914. ? (!d && g[v] && v++,
  51915. (g[v] = {
  51916. s: new n.Shape(),
  51917. p: p
  51918. }),
  51919. (g[v].s.actions = c.actions),
  51920. (g[v].s.curves = c.curves),
  51921. d && v++,
  51922. (m[v] = []))
  51923. : m[v].push({
  51924. h: c,
  51925. p: p[0]
  51926. })
  51927. if (!g[0]) return r(s)
  51928. if (g.length > 1) {
  51929. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++) f[E] = []
  51930. for (var E = 0, b = g.length; E < b; E++)
  51931. for (var w = m[E], _ = 0; _ < w.length; _++) {
  51932. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  51933. o(T.p, g[S].p) &&
  51934. (E !== S &&
  51935. I.push({
  51936. froms: E,
  51937. tos: S,
  51938. hole: _
  51939. }),
  51940. x ? ((x = !1), f[S].push(T)) : (C = !0))
  51941. x && f[E].push(T)
  51942. }
  51943. I.length > 0 && (C || (m = f))
  51944. }
  51945. for (var M, A = 0, R = g.length; A < R; A++) {
  51946. ;(h = g[A].s), u.push(h), (M = m[A])
  51947. for (var P = 0, O = M.length; P < O; P++) h.holes.push(M[P].h)
  51948. }
  51949. return u
  51950. }),
  51951. (n.Shape = function () {
  51952. n.Path.apply(this, arguments), (this.holes = [])
  51953. }),
  51954. (n.Shape.prototype = Object.create(n.Path.prototype)),
  51955. (n.Shape.prototype.constructor = n.Shape),
  51956. (n.Shape.prototype.extrude = function (e) {
  51957. return new n.ExtrudeGeometry(this, e)
  51958. }),
  51959. (n.Shape.prototype.makeGeometry = function (e) {
  51960. return new n.ShapeGeometry(this, e)
  51961. }),
  51962. (n.Shape.prototype.getPointsHoles = function (e) {
  51963. for (var t = [], i = 0, n = this.holes.length; i < n; i++) t[i] = this.holes[i].getPoints(e)
  51964. return t
  51965. }),
  51966. (n.Shape.prototype.extractAllPoints = function (e) {
  51967. return {
  51968. shape: this.getPoints(e),
  51969. holes: this.getPointsHoles(e)
  51970. }
  51971. }),
  51972. (n.Shape.prototype.extractPoints = function (e) {
  51973. return this.extractAllPoints(e)
  51974. }),
  51975. (n.LineCurve = function (e, t) {
  51976. ;(this.v1 = e), (this.v2 = t)
  51977. }),
  51978. (n.LineCurve.prototype = Object.create(n.Curve.prototype)),
  51979. (n.LineCurve.prototype.constructor = n.LineCurve),
  51980. (n.LineCurve.prototype.getPoint = function (e) {
  51981. var t = this.v2.clone().sub(this.v1)
  51982. return t.multiplyScalar(e).add(this.v1), t
  51983. }),
  51984. (n.LineCurve.prototype.getPointAt = function (e) {
  51985. return this.getPoint(e)
  51986. }),
  51987. (n.LineCurve.prototype.getTangent = function (e) {
  51988. var t = this.v2.clone().sub(this.v1)
  51989. return t.normalize()
  51990. }),
  51991. (n.QuadraticBezierCurve = function (e, t, i) {
  51992. ;(this.v0 = e), (this.v1 = t), (this.v2 = i)
  51993. }),
  51994. (n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype)),
  51995. (n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve),
  51996. (n.QuadraticBezierCurve.prototype.getPoint = function (e) {
  51997. var t = n.ShapeUtils.b2
  51998. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x), t(e, this.v0.y, this.v1.y, this.v2.y))
  51999. }),
  52000. (n.QuadraticBezierCurve.prototype.getTangent = function (e) {
  52001. var t = n.CurveUtils.tangentQuadraticBezier
  52002. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x), t(e, this.v0.y, this.v1.y, this.v2.y)).normalize()
  52003. }),
  52004. (n.CubicBezierCurve = function (e, t, i, n) {
  52005. ;(this.v0 = e), (this.v1 = t), (this.v2 = i), (this.v3 = n)
  52006. }),
  52007. (n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype)),
  52008. (n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve),
  52009. (n.CubicBezierCurve.prototype.getPoint = function (e) {
  52010. var t = n.ShapeUtils.b3
  52011. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x), t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y))
  52012. }),
  52013. (n.CubicBezierCurve.prototype.getTangent = function (e) {
  52014. var t = n.CurveUtils.tangentCubicBezier
  52015. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x), t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)).normalize()
  52016. }),
  52017. (n.SplineCurve = function (e) {
  52018. this.points = void 0 == e ? [] : e
  52019. }),
  52020. (n.SplineCurve.prototype = Object.create(n.Curve.prototype)),
  52021. (n.SplineCurve.prototype.constructor = n.SplineCurve),
  52022. (n.SplineCurve.prototype.getPoint = function (e) {
  52023. var t = this.points,
  52024. i = (t.length - 1) * e,
  52025. r = Math.floor(i),
  52026. o = i - r,
  52027. a = t[0 === r ? r : r - 1],
  52028. s = t[r],
  52029. l = t[r > t.length - 2 ? t.length - 1 : r + 1],
  52030. c = t[r > t.length - 3 ? t.length - 1 : r + 2],
  52031. h = n.CurveUtils.interpolate
  52032. return new n.Vector2(h(a.x, s.x, l.x, c.x, o), h(a.y, s.y, l.y, c.y, o))
  52033. }),
  52034. (n.EllipseCurve = function (e, t, i, n, r, o, a, s) {
  52035. ;(this.aX = e), (this.aY = t), (this.xRadius = i), (this.yRadius = n), (this.aStartAngle = r), (this.aEndAngle = o), (this.aClockwise = a), (this.aRotation = s || 0)
  52036. }),
  52037. (n.EllipseCurve.prototype = Object.create(n.Curve.prototype)),
  52038. (n.EllipseCurve.prototype.constructor = n.EllipseCurve),
  52039. (n.EllipseCurve.prototype.getPoint = function (e) {
  52040. var t = this.aEndAngle - this.aStartAngle
  52041. t < 0 && (t += 2 * Math.PI), t > 2 * Math.PI && (t -= 2 * Math.PI)
  52042. var i
  52043. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t
  52044. var r = this.aX + this.xRadius * Math.cos(i),
  52045. o = this.aY + this.yRadius * Math.sin(i)
  52046. if (0 !== this.aRotation) {
  52047. var a = Math.cos(this.aRotation),
  52048. s = Math.sin(this.aRotation),
  52049. l = r,
  52050. c = o
  52051. ;(r = (l - this.aX) * a - (c - this.aY) * s + this.aX), (o = (l - this.aX) * s + (c - this.aY) * a + this.aY)
  52052. }
  52053. return new n.Vector2(r, o)
  52054. }),
  52055. (n.ArcCurve = function (e, t, i, r, o, a) {
  52056. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  52057. }),
  52058. (n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype)),
  52059. (n.ArcCurve.prototype.constructor = n.ArcCurve),
  52060. (n.LineCurve3 = n.Curve.create(
  52061. function (e, t) {
  52062. ;(this.v1 = e), (this.v2 = t)
  52063. },
  52064. function (e) {
  52065. var t = new n.Vector3()
  52066. return t.subVectors(this.v2, this.v1), t.multiplyScalar(e), t.add(this.v1), t
  52067. }
  52068. )),
  52069. (n.QuadraticBezierCurve3 = n.Curve.create(
  52070. function (e, t, i) {
  52071. ;(this.v0 = e), (this.v1 = t), (this.v2 = i)
  52072. },
  52073. function (e) {
  52074. var t = n.ShapeUtils.b2
  52075. return new n.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x), t(e, this.v0.y, this.v1.y, this.v2.y), t(e, this.v0.z, this.v1.z, this.v2.z))
  52076. }
  52077. )),
  52078. (n.CubicBezierCurve3 = n.Curve.create(
  52079. function (e, t, i, n) {
  52080. ;(this.v0 = e), (this.v1 = t), (this.v2 = i), (this.v3 = n)
  52081. },
  52082. function (e) {
  52083. var t = n.ShapeUtils.b3
  52084. return new n.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x), t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y), t(e, this.v0.z, this.v1.z, this.v2.z, this.v3.z))
  52085. }
  52086. )),
  52087. (n.SplineCurve3 = n.Curve.create(
  52088. function (e) {
  52089. console.warn('THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3'), (this.points = void 0 == e ? [] : e)
  52090. },
  52091. function (e) {
  52092. var t = this.points,
  52093. i = (t.length - 1) * e,
  52094. r = Math.floor(i),
  52095. o = i - r,
  52096. a = t[0 == r ? r : r - 1],
  52097. s = t[r],
  52098. l = t[r > t.length - 2 ? t.length - 1 : r + 1],
  52099. c = t[r > t.length - 3 ? t.length - 1 : r + 2],
  52100. h = n.CurveUtils.interpolate
  52101. return new n.Vector3(h(a.x, s.x, l.x, c.x, o), h(a.y, s.y, l.y, c.y, o), h(a.z, s.z, l.z, c.z, o))
  52102. }
  52103. )),
  52104. (n.CatmullRomCurve3 = (function () {
  52105. function e() {}
  52106. var t = new n.Vector3(),
  52107. i = new e(),
  52108. r = new e(),
  52109. o = new e()
  52110. return (
  52111. (e.prototype.init = function (e, t, i, n) {
  52112. ;(this.c0 = e), (this.c1 = i), (this.c2 = -3 * e + 3 * t - 2 * i - n), (this.c3 = 2 * e - 2 * t + i + n)
  52113. }),
  52114. (e.prototype.initNonuniformCatmullRom = function (e, t, i, n, r, o, a) {
  52115. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o,
  52116. l = (i - t) / o - (n - t) / (o + a) + (n - i) / a
  52117. ;(s *= o), (l *= o), this.init(t, i, s, l)
  52118. }),
  52119. (e.prototype.initCatmullRom = function (e, t, i, n, r) {
  52120. this.init(t, i, r * (i - e), r * (n - t))
  52121. }),
  52122. (e.prototype.calc = function (e) {
  52123. var t = e * e,
  52124. i = t * e
  52125. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  52126. }),
  52127. n.Curve.create(
  52128. function (e) {
  52129. ;(this.points = e || []), (this.closed = !1)
  52130. },
  52131. function (e) {
  52132. var a,
  52133. s,
  52134. l,
  52135. c,
  52136. h = this.points
  52137. ;(c = h.length),
  52138. c < 2 && console.log('duh, you need at least 2 points'),
  52139. (a = (c - (this.closed ? 0 : 1)) * e),
  52140. (s = Math.floor(a)),
  52141. (l = a - s),
  52142. this.closed ? (s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length) : 0 === l && s === c - 1 && ((s = c - 2), (l = 1))
  52143. var u, d, p, f
  52144. if (
  52145. (this.closed || s > 0 ? (u = h[(s - 1) % c]) : (t.subVectors(h[0], h[1]).add(h[0]), (u = t)),
  52146. (d = h[s % c]),
  52147. (p = h[(s + 1) % c]),
  52148. this.closed || s + 2 < c ? (f = h[(s + 2) % c]) : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]), (f = t)),
  52149. void 0 === this.type || 'centripetal' === this.type || 'chordal' === this.type)
  52150. ) {
  52151. var g = 'chordal' === this.type ? 0.5 : 0.25,
  52152. m = Math.pow(u.distanceToSquared(d), g),
  52153. v = Math.pow(d.distanceToSquared(p), g),
  52154. A = Math.pow(p.distanceToSquared(f), g)
  52155. v < 1e-4 && (v = 1),
  52156. m < 1e-4 && (m = v),
  52157. A < 1e-4 && (A = v),
  52158. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  52159. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  52160. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  52161. } else if ('catmullrom' === this.type) {
  52162. var y = void 0 !== this.tension ? this.tension : 0.5
  52163. i.initCatmullRom(u.x, d.x, p.x, f.x, y), r.initCatmullRom(u.y, d.y, p.y, f.y, y), o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  52164. }
  52165. var C = new n.Vector3(i.calc(l), r.calc(l), o.calc(l))
  52166. return C
  52167. }
  52168. )
  52169. )
  52170. })()),
  52171. (n.ClosedSplineCurve3 = function (e) {
  52172. console.warn('THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3.'), n.CatmullRomCurve3.call(this, e), (this.type = 'catmullrom'), (this.closed = !0)
  52173. }),
  52174. (n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype)),
  52175. (n.BoxGeometry = function (e, t, i, r, o, a) {
  52176. n.Geometry.call(this),
  52177. (this.type = 'BoxGeometry'),
  52178. (this.parameters = {
  52179. width: e,
  52180. height: t,
  52181. depth: i,
  52182. widthSegments: r,
  52183. heightSegments: o,
  52184. depthSegments: a
  52185. }),
  52186. this.fromBufferGeometry(new n.BoxBufferGeometry(e, t, i, r, o, a)),
  52187. this.mergeVertices()
  52188. }),
  52189. (n.BoxGeometry.prototype = Object.create(n.Geometry.prototype)),
  52190. (n.BoxGeometry.prototype.constructor = n.BoxGeometry),
  52191. (n.CubeGeometry = n.BoxGeometry),
  52192. (n.BoxBufferGeometry = function (e, t, i, r, o, a) {
  52193. function s(e, t, i) {
  52194. var n = 0
  52195. return (n += e * t * 2), (n += e * i * 2), (n += i * t * 2), 4 * n
  52196. }
  52197. function l(e, t, i, r, o, a, s, l, h, u, I) {
  52198. for (var E = a / h, b = s / u, w = a / 2, _ = s / 2, T = l / 2, x = h + 1, S = u + 1, M = 0, R = 0, P = new n.Vector3(), O = 0; O < S; O++)
  52199. for (var L = O * b - _, D = 0; D < x; D++) {
  52200. var N = D * E - w
  52201. ;(P[e] = N * r),
  52202. (P[t] = L * o),
  52203. (P[i] = T),
  52204. (p[m] = P.x),
  52205. (p[m + 1] = P.y),
  52206. (p[m + 2] = P.z),
  52207. (P[e] = 0),
  52208. (P[t] = 0),
  52209. (P[i] = l > 0 ? 1 : -1),
  52210. (f[m] = P.x),
  52211. (f[m + 1] = P.y),
  52212. (f[m + 2] = P.z),
  52213. (g[v] = D / h),
  52214. (g[v + 1] = 1 - O / u),
  52215. (m += 3),
  52216. (v += 2),
  52217. (M += 1)
  52218. }
  52219. for (O = 0; O < u; O++)
  52220. for (D = 0; D < h; D++) {
  52221. var B = y + D + x * O,
  52222. F = y + D + x * (O + 1),
  52223. V = y + (D + 1) + x * (O + 1),
  52224. U = y + (D + 1) + x * O
  52225. ;(d[A] = B), (d[A + 1] = F), (d[A + 2] = U), (d[A + 3] = F), (d[A + 4] = V), (d[A + 5] = U), (A += 6), (R += 6)
  52226. }
  52227. c.addGroup(C, R, I), (C += R), (y += M)
  52228. }
  52229. n.BufferGeometry.call(this),
  52230. (this.type = 'BoxBufferGeometry'),
  52231. (this.parameters = {
  52232. width: e,
  52233. height: t,
  52234. depth: i,
  52235. widthSegments: r,
  52236. heightSegments: o,
  52237. depthSegments: a
  52238. })
  52239. var c = this
  52240. ;(r = Math.floor(r) || 1), (o = Math.floor(o) || 1), (a = Math.floor(a) || 1)
  52241. var h = s(r, o, a),
  52242. u = (h / 4) * 6,
  52243. d = new (u > 65535 ? Uint32Array : Uint16Array)(u),
  52244. p = new Float32Array(3 * h),
  52245. f = new Float32Array(3 * h),
  52246. g = new Float32Array(2 * h),
  52247. m = 0,
  52248. v = 0,
  52249. A = 0,
  52250. y = 0,
  52251. C = 0
  52252. l('z', 'y', 'x', -1, -1, i, t, e, a, o, 0),
  52253. l('z', 'y', 'x', 1, -1, i, t, -e, a, o, 1),
  52254. l('x', 'z', 'y', 1, 1, e, i, t, r, a, 2),
  52255. l('x', 'z', 'y', 1, -1, e, i, -t, r, a, 3),
  52256. l('x', 'y', 'z', 1, -1, e, t, i, r, o, 4),
  52257. l('x', 'y', 'z', -1, -1, e, t, -i, r, o, 5),
  52258. this.setIndex(new n.BufferAttribute(d, 1)),
  52259. this.addAttribute('position', new n.BufferAttribute(p, 3)),
  52260. this.addAttribute('normal', new n.BufferAttribute(f, 3)),
  52261. this.addAttribute('uv', new n.BufferAttribute(g, 2))
  52262. }),
  52263. (n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  52264. (n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry),
  52265. (n.CircleGeometry = function (e, t, i, r) {
  52266. n.Geometry.call(this),
  52267. (this.type = 'CircleGeometry'),
  52268. (this.parameters = {
  52269. radius: e,
  52270. segments: t,
  52271. thetaStart: i,
  52272. thetaLength: r
  52273. }),
  52274. this.fromBufferGeometry(new n.CircleBufferGeometry(e, t, i, r))
  52275. }),
  52276. (n.CircleGeometry.prototype = Object.create(n.Geometry.prototype)),
  52277. (n.CircleGeometry.prototype.constructor = n.CircleGeometry),
  52278. (n.CircleBufferGeometry = function (e, t, i, r) {
  52279. n.BufferGeometry.call(this),
  52280. (this.type = 'CircleBufferGeometry'),
  52281. (this.parameters = {
  52282. radius: e,
  52283. segments: t,
  52284. thetaStart: i,
  52285. thetaLength: r
  52286. }),
  52287. (e = e || 50),
  52288. (t = void 0 !== t ? Math.max(3, t) : 8),
  52289. (i = void 0 !== i ? i : 0),
  52290. (r = void 0 !== r ? r : 2 * Math.PI)
  52291. var o = t + 2,
  52292. a = new Float32Array(3 * o),
  52293. s = new Float32Array(3 * o),
  52294. l = new Float32Array(2 * o)
  52295. ;(s[2] = 1), (l[0] = 0.5), (l[1] = 0.5)
  52296. for (var c = 0, h = 3, u = 2; c <= t; c++, h += 3, u += 2) {
  52297. var d = i + (c / t) * r
  52298. ;(a[h] = e * Math.cos(d)), (a[h + 1] = e * Math.sin(d)), (s[h + 2] = 1), (l[u] = (a[h] / e + 1) / 2), (l[u + 1] = (a[h + 1] / e + 1) / 2)
  52299. }
  52300. for (var p = [], h = 1; h <= t; h++) p.push(h, h + 1, 0)
  52301. this.setIndex(new n.BufferAttribute(new Uint16Array(p), 1)),
  52302. this.addAttribute('position', new n.BufferAttribute(a, 3)),
  52303. this.addAttribute('normal', new n.BufferAttribute(s, 3)),
  52304. this.addAttribute('uv', new n.BufferAttribute(l, 2)),
  52305. (this.boundingSphere = new n.Sphere(new n.Vector3(), e))
  52306. }),
  52307. (n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  52308. (n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry),
  52309. (n.CylinderBufferGeometry = function (e, t, i, r, o, a, s, l) {
  52310. function c() {
  52311. var e = (r + 1) * (o + 1)
  52312. return a === !1 && (e += 2 * (r + 1) + 2 * r), e
  52313. }
  52314. function h() {
  52315. var e = r * o * 2 * 3
  52316. return a === !1 && (e += 2 * r * 3), e
  52317. }
  52318. function u() {
  52319. var a,
  52320. c,
  52321. h = new n.Vector3(),
  52322. u = new n.Vector3(),
  52323. d = (t - e) / i
  52324. for (c = 0; c <= o; c++) {
  52325. var p = [],
  52326. f = c / o,
  52327. b = f * (t - e) + e
  52328. for (a = 0; a <= r; a++) {
  52329. var w = a / r
  52330. ;(u.x = b * Math.sin(w * l + s)),
  52331. (u.y = -f * i + E),
  52332. (u.z = b * Math.cos(w * l + s)),
  52333. m.setXYZ(y, u.x, u.y, u.z),
  52334. h.copy(u),
  52335. ((0 === e && 0 === c) || (0 === t && c === o)) && ((h.x = Math.sin(w * l + s)), (h.z = Math.cos(w * l + s))),
  52336. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  52337. v.setXYZ(y, h.x, h.y, h.z),
  52338. A.setXY(y, w, 1 - f),
  52339. p.push(y),
  52340. y++
  52341. }
  52342. I.push(p)
  52343. }
  52344. for (a = 0; a < r; a++)
  52345. for (c = 0; c < o; c++) {
  52346. var _ = I[c][a],
  52347. T = I[c + 1][a],
  52348. x = I[c + 1][a + 1],
  52349. S = I[c][a + 1]
  52350. g.setX(C, _), C++, g.setX(C, T), C++, g.setX(C, S), C++, g.setX(C, T), C++, g.setX(C, x), C++, g.setX(C, S), C++
  52351. }
  52352. }
  52353. function d(i) {
  52354. var o,
  52355. a,
  52356. c,
  52357. h = new n.Vector2(),
  52358. u = new n.Vector3(),
  52359. d = i === !0 ? e : t,
  52360. p = i === !0 ? 1 : -1
  52361. for (a = y, o = 1; o <= r; o++) m.setXYZ(y, 0, E * p, 0), v.setXYZ(y, 0, p, 0), i === !0 ? ((h.x = o / r), (h.y = 0)) : ((h.x = (o - 1) / r), (h.y = 1)), A.setXY(y, h.x, h.y), y++
  52362. for (c = y, o = 0; o <= r; o++) {
  52363. var f = o / r
  52364. ;(u.x = d * Math.sin(f * l + s)), (u.y = E * p), (u.z = d * Math.cos(f * l + s)), m.setXYZ(y, u.x, u.y, u.z), v.setXYZ(y, 0, p, 0), A.setXY(y, f, i === !0 ? 1 : 0), y++
  52365. }
  52366. for (o = 0; o < r; o++) {
  52367. var I = a + o,
  52368. b = c + o
  52369. i === !0 ? (g.setX(C, b), C++, g.setX(C, b + 1), C++, g.setX(C, I), C++) : (g.setX(C, b + 1), C++, g.setX(C, b), C++, g.setX(C, I), C++)
  52370. }
  52371. }
  52372. n.BufferGeometry.call(this),
  52373. (this.type = 'CylinderBufferGeometry'),
  52374. (this.parameters = {
  52375. radiusTop: e,
  52376. radiusBottom: t,
  52377. height: i,
  52378. radialSegments: r,
  52379. heightSegments: o,
  52380. openEnded: a,
  52381. thetaStart: s,
  52382. thetaLength: l
  52383. }),
  52384. (e = void 0 !== e ? e : 20),
  52385. (t = void 0 !== t ? t : 20),
  52386. (i = void 0 !== i ? i : 100),
  52387. (r = Math.floor(r) || 8),
  52388. (o = Math.floor(o) || 1),
  52389. (a = void 0 !== a && a),
  52390. (s = void 0 !== s ? s : 0),
  52391. (l = void 0 !== l ? l : 2 * Math.PI)
  52392. var p = c(),
  52393. f = h(),
  52394. g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f), 1),
  52395. m = new n.BufferAttribute(new Float32Array(3 * p), 3),
  52396. v = new n.BufferAttribute(new Float32Array(3 * p), 3),
  52397. A = new n.BufferAttribute(new Float32Array(2 * p), 2),
  52398. y = 0,
  52399. C = 0,
  52400. I = [],
  52401. E = i / 2
  52402. u(), a === !1 && (e > 0 && d(!0), t > 0 && d(!1)), this.setIndex(g), this.addAttribute('position', m), this.addAttribute('normal', v), this.addAttribute('uv', A)
  52403. }),
  52404. (n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  52405. (n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry),
  52406. (n.CylinderGeometry = function (e, t, i, r, o, a, s, l) {
  52407. n.Geometry.call(this),
  52408. (this.type = 'CylinderGeometry'),
  52409. (this.parameters = {
  52410. radiusTop: e,
  52411. radiusBottom: t,
  52412. height: i,
  52413. radialSegments: r,
  52414. heightSegments: o,
  52415. openEnded: a,
  52416. thetaStart: s,
  52417. thetaLength: l
  52418. }),
  52419. this.fromBufferGeometry(new n.CylinderBufferGeometry(e, t, i, r, o, a, s, l)),
  52420. this.mergeVertices()
  52421. }),
  52422. (n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype)),
  52423. (n.CylinderGeometry.prototype.constructor = n.CylinderGeometry),
  52424. (n.EdgesGeometry = function (e, t) {
  52425. function i(e, t) {
  52426. return e - t
  52427. }
  52428. n.BufferGeometry.call(this), (t = void 0 !== t ? t : 1)
  52429. var r,
  52430. o = Math.cos(n.Math.degToRad(t)),
  52431. a = [0, 0],
  52432. s = {},
  52433. l = ['a', 'b', 'c']
  52434. e instanceof n.BufferGeometry ? ((r = new n.Geometry()), r.fromBufferGeometry(e)) : (r = e.clone()), r.mergeVertices(), r.computeFaceNormals()
  52435. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  52436. for (var p = h[u], f = 0; f < 3; f++) {
  52437. ;(a[0] = p[l[f]]), (a[1] = p[l[(f + 1) % 3]]), a.sort(i)
  52438. var g = a.toString()
  52439. void 0 === s[g]
  52440. ? (s[g] = {
  52441. vert1: a[0],
  52442. vert2: a[1],
  52443. face1: u,
  52444. face2: void 0
  52445. })
  52446. : (s[g].face2 = u)
  52447. }
  52448. var m = []
  52449. for (var g in s) {
  52450. var v = s[g]
  52451. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  52452. var A = c[v.vert1]
  52453. m.push(A.x), m.push(A.y), m.push(A.z), (A = c[v.vert2]), m.push(A.x), m.push(A.y), m.push(A.z)
  52454. }
  52455. }
  52456. this.addAttribute('position', new n.BufferAttribute(new Float32Array(m), 3))
  52457. }),
  52458. (n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  52459. (n.EdgesGeometry.prototype.constructor = n.EdgesGeometry),
  52460. (n.ExtrudeGeometry = function (e, t) {
  52461. return 'undefined' == typeof e
  52462. ? void (e = [])
  52463. : (n.Geometry.call(this), (this.type = 'ExtrudeGeometry'), (e = Array.isArray(e) ? e : [e]), this.addShapeList(e, t), void this.computeFaceNormals())
  52464. })
  52465. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype)
  52466. ;(n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry),
  52467. (n.ExtrudeGeometry.prototype.addShapeList = function (e, t) {
  52468. for (var i = e.length, n = 0; n < i; n++) {
  52469. var r = e[n]
  52470. this.addShape(r, t)
  52471. }
  52472. }),
  52473. (n.ExtrudeGeometry.prototype.addShape = function (e, t) {
  52474. function i(e, t, i) {
  52475. return t || console.error('THREE.ExtrudeGeometry: vec does not exist'), t.clone().multiplyScalar(i).add(e)
  52476. }
  52477. function r(e, t, i) {
  52478. var r,
  52479. o,
  52480. a = 1,
  52481. s = e.x - t.x,
  52482. l = e.y - t.y,
  52483. c = i.x - e.x,
  52484. h = i.y - e.y,
  52485. u = s * s + l * l,
  52486. d = s * h - l * c
  52487. if (Math.abs(d) > Number.EPSILON) {
  52488. var p = Math.sqrt(u),
  52489. f = Math.sqrt(c * c + h * h),
  52490. g = t.x - l / p,
  52491. m = t.y + s / p,
  52492. v = i.x - h / f,
  52493. A = i.y + c / f,
  52494. y = ((v - g) * h - (A - m) * c) / (s * h - l * c)
  52495. ;(r = g + s * y - e.x), (o = m + l * y - e.y)
  52496. var C = r * r + o * o
  52497. if (C <= 2) return new n.Vector2(r, o)
  52498. a = Math.sqrt(C / 2)
  52499. } else {
  52500. var I = !1
  52501. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  52502. I ? ((r = -l), (o = s), (a = Math.sqrt(u))) : ((r = s), (o = l), (a = Math.sqrt(u / 2)))
  52503. }
  52504. return new n.Vector2(r / a, o / a)
  52505. }
  52506. function o() {
  52507. if (C) {
  52508. var e = 0,
  52509. t = z * e
  52510. for (Y = 0; Y < W; Y++) (G = N[Y]), c(G[2] + t, G[1] + t, G[0] + t)
  52511. for (e = E + 2 * y, t = z * e, Y = 0; Y < W; Y++) (G = N[Y]), c(G[0] + t, G[1] + t, G[2] + t)
  52512. } else {
  52513. for (Y = 0; Y < W; Y++) (G = N[Y]), c(G[2], G[1], G[0])
  52514. for (Y = 0; Y < W; Y++) (G = N[Y]), c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  52515. }
  52516. }
  52517. function a() {
  52518. var e = 0
  52519. for (s(B, e), e += B.length, x = 0, S = L.length; x < S; x++) (T = L[x]), s(T, e), (e += T.length)
  52520. }
  52521. function s(e, t) {
  52522. var i, n
  52523. for (Y = e.length; --Y >= 0; ) {
  52524. ;(i = Y), (n = Y - 1), n < 0 && (n = e.length - 1)
  52525. var r = 0,
  52526. o = E + 2 * y
  52527. for (r = 0; r < o; r++) {
  52528. var a = z * r,
  52529. s = z * (r + 1),
  52530. l = t + i + a,
  52531. c = t + n + a,
  52532. u = t + n + s,
  52533. d = t + i + s
  52534. h(l, c, u, d, e, r, o, i, n)
  52535. }
  52536. }
  52537. }
  52538. function l(e, t, i) {
  52539. M.vertices.push(new n.Vector3(e, t, i))
  52540. }
  52541. function c(e, t, i) {
  52542. ;(e += R), (t += R), (i += R), M.faces.push(new n.Face3(e, t, i, null, null, 0))
  52543. var r = _.generateTopUV(M, e, t, i)
  52544. M.faceVertexUvs[0].push(r)
  52545. }
  52546. function h(e, t, i, r, o, a, s, l, c) {
  52547. ;(e += R), (t += R), (i += R), (r += R), M.faces.push(new n.Face3(e, t, r, null, null, 1)), M.faces.push(new n.Face3(t, i, r, null, null, 1))
  52548. var h = _.generateSideWallUV(M, e, t, i, r)
  52549. M.faceVertexUvs[0].push([h[0], h[1], h[3]]), M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  52550. }
  52551. var u,
  52552. d,
  52553. p,
  52554. f,
  52555. g,
  52556. m = void 0 !== t.amount ? t.amount : 100,
  52557. v = void 0 !== t.bevelThickness ? t.bevelThickness : 6,
  52558. A = void 0 !== t.bevelSize ? t.bevelSize : v - 2,
  52559. y = void 0 !== t.bevelSegments ? t.bevelSegments : 3,
  52560. C = void 0 === t.bevelEnabled || t.bevelEnabled,
  52561. I = void 0 !== t.curveSegments ? t.curveSegments : 12,
  52562. E = void 0 !== t.steps ? t.steps : 1,
  52563. b = t.extrudePath,
  52564. w = !1,
  52565. _ = void 0 !== t.UVGenerator ? t.UVGenerator : n.ExtrudeGeometry.WorldUVGenerator
  52566. b &&
  52567. ((u = b.getSpacedPoints(E)),
  52568. (w = !0),
  52569. (C = !1),
  52570. (d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b, E, !1)),
  52571. (p = new n.Vector3()),
  52572. (f = new n.Vector3()),
  52573. (g = new n.Vector3())),
  52574. C || ((y = 0), (v = 0), (A = 0))
  52575. var T,
  52576. x,
  52577. S,
  52578. M = this,
  52579. R = this.vertices.length,
  52580. P = e.extractPoints(I),
  52581. O = P.shape,
  52582. L = P.holes,
  52583. D = !n.ShapeUtils.isClockWise(O)
  52584. if (D) {
  52585. for (O = O.reverse(), x = 0, S = L.length; x < S; x++) (T = L[x]), n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse())
  52586. D = !1
  52587. }
  52588. var N = n.ShapeUtils.triangulateShape(O, L),
  52589. B = O
  52590. for (x = 0, S = L.length; x < S; x++) (T = L[x]), (O = O.concat(T))
  52591. for (var F, V, U, k, H, G, z = O.length, W = N.length, j = [], Y = 0, X = B.length, Z = X - 1, q = Y + 1; Y < X; Y++, Z++, q++)
  52592. Z === X && (Z = 0), q === X && (q = 0), (j[Y] = r(B[Y], B[Z], B[q]))
  52593. var K,
  52594. Q = [],
  52595. J = j.concat()
  52596. for (x = 0, S = L.length; x < S; x++) {
  52597. for (T = L[x], K = [], Y = 0, X = T.length, Z = X - 1, q = Y + 1; Y < X; Y++, Z++, q++) Z === X && (Z = 0), q === X && (q = 0), (K[Y] = r(T[Y], T[Z], T[q]))
  52598. Q.push(K), (J = J.concat(K))
  52599. }
  52600. for (F = 0; F < y; F++) {
  52601. for (U = F / y, k = v * (1 - U), V = A * Math.sin((U * Math.PI) / 2), Y = 0, X = B.length; Y < X; Y++) (H = i(B[Y], j[Y], V)), l(H.x, H.y, -k)
  52602. for (x = 0, S = L.length; x < S; x++) for (T = L[x], K = Q[x], Y = 0, X = T.length; Y < X; Y++) (H = i(T[Y], K[Y], V)), l(H.x, H.y, -k)
  52603. }
  52604. for (V = A, Y = 0; Y < z; Y++)
  52605. (H = C ? i(O[Y], J[Y], V) : O[Y]),
  52606. w ? (f.copy(d.normals[0]).multiplyScalar(H.x), p.copy(d.binormals[0]).multiplyScalar(H.y), g.copy(u[0]).add(f).add(p), l(g.x, g.y, g.z)) : l(H.x, H.y, 0)
  52607. var $
  52608. for ($ = 1; $ <= E; $++)
  52609. for (Y = 0; Y < z; Y++)
  52610. (H = C ? i(O[Y], J[Y], V) : O[Y]),
  52611. w ? (f.copy(d.normals[$]).multiplyScalar(H.x), p.copy(d.binormals[$]).multiplyScalar(H.y), g.copy(u[$]).add(f).add(p), l(g.x, g.y, g.z)) : l(H.x, H.y, (m / E) * $)
  52612. for (F = y - 1; F >= 0; F--) {
  52613. for (U = F / y, k = v * (1 - U), V = A * Math.sin((U * Math.PI) / 2), Y = 0, X = B.length; Y < X; Y++) (H = i(B[Y], j[Y], V)), l(H.x, H.y, m + k)
  52614. for (x = 0, S = L.length; x < S; x++) for (T = L[x], K = Q[x], Y = 0, X = T.length; Y < X; Y++) (H = i(T[Y], K[Y], V)), w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  52615. }
  52616. o(), a()
  52617. }),
  52618. (n.ExtrudeGeometry.WorldUVGenerator = {
  52619. generateTopUV: function (e, t, i, r) {
  52620. var o = e.vertices,
  52621. a = o[t],
  52622. s = o[i],
  52623. l = o[r]
  52624. return [new n.Vector2(a.x, a.y), new n.Vector2(s.x, s.y), new n.Vector2(l.x, l.y)]
  52625. },
  52626. generateSideWallUV: function (e, t, i, r, o) {
  52627. var a = e.vertices,
  52628. s = a[t],
  52629. l = a[i],
  52630. c = a[r],
  52631. h = a[o]
  52632. return Math.abs(s.y - l.y) < 0.01
  52633. ? [new n.Vector2(s.x, 1 - s.z), new n.Vector2(l.x, 1 - l.z), new n.Vector2(c.x, 1 - c.z), new n.Vector2(h.x, 1 - h.z)]
  52634. : [new n.Vector2(s.y, 1 - s.z), new n.Vector2(l.y, 1 - l.z), new n.Vector2(c.y, 1 - c.z), new n.Vector2(h.y, 1 - h.z)]
  52635. }
  52636. }),
  52637. (n.ShapeGeometry = function (e, t) {
  52638. n.Geometry.call(this), (this.type = 'ShapeGeometry'), Array.isArray(e) === !1 && (e = [e]), this.addShapeList(e, t), this.computeFaceNormals()
  52639. }),
  52640. (n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype)),
  52641. (n.ShapeGeometry.prototype.constructor = n.ShapeGeometry),
  52642. (n.ShapeGeometry.prototype.addShapeList = function (e, t) {
  52643. for (var i = 0, n = e.length; i < n; i++) this.addShape(e[i], t)
  52644. return this
  52645. }),
  52646. (n.ShapeGeometry.prototype.addShape = function (e, t) {
  52647. void 0 === t && (t = {})
  52648. var i,
  52649. r,
  52650. o,
  52651. a = void 0 !== t.curveSegments ? t.curveSegments : 12,
  52652. s = t.material,
  52653. l = void 0 === t.UVGenerator ? n.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator,
  52654. c = this.vertices.length,
  52655. h = e.extractPoints(a),
  52656. u = h.shape,
  52657. d = h.holes,
  52658. p = !n.ShapeUtils.isClockWise(u)
  52659. if (p) {
  52660. for (u = u.reverse(), i = 0, r = d.length; i < r; i++) (o = d[i]), n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse())
  52661. p = !1
  52662. }
  52663. var f = n.ShapeUtils.triangulateShape(u, d)
  52664. for (i = 0, r = d.length; i < r; i++) (o = d[i]), (u = u.concat(o))
  52665. var g,
  52666. m,
  52667. v = u.length,
  52668. A = f.length
  52669. for (i = 0; i < v; i++) (g = u[i]), this.vertices.push(new n.Vector3(g.x, g.y, 0))
  52670. for (i = 0; i < A; i++) {
  52671. m = f[i]
  52672. var y = m[0] + c,
  52673. C = m[1] + c,
  52674. I = m[2] + c
  52675. this.faces.push(new n.Face3(y, C, I, null, null, s)), this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  52676. }
  52677. }),
  52678. (n.LatheBufferGeometry = function (e, t, i, r) {
  52679. n.BufferGeometry.call(this),
  52680. (this.type = 'LatheBufferGeometry'),
  52681. (this.parameters = {
  52682. points: e,
  52683. segments: t,
  52684. phiStart: i,
  52685. phiLength: r
  52686. }),
  52687. (t = Math.floor(t) || 12),
  52688. (i = i || 0),
  52689. (r = r || 2 * Math.PI),
  52690. (r = n.Math.clamp(r, 0, 2 * Math.PI))
  52691. var o,
  52692. a,
  52693. s,
  52694. l = (t + 1) * e.length,
  52695. c = t * e.length * 2 * 3,
  52696. h = new n.BufferAttribute(new (c > 65535 ? Uint32Array : Uint16Array)(c), 1),
  52697. u = new n.BufferAttribute(new Float32Array(3 * l), 3),
  52698. d = new n.BufferAttribute(new Float32Array(2 * l), 2),
  52699. p = 0,
  52700. f = 0,
  52701. g = (1 / (e.length - 1), 1 / t),
  52702. m = new n.Vector3(),
  52703. v = new n.Vector2()
  52704. for (a = 0; a <= t; a++) {
  52705. var A = i + a * g * r,
  52706. y = Math.sin(A),
  52707. C = Math.cos(A)
  52708. for (s = 0; s <= e.length - 1; s++)
  52709. (m.x = e[s].x * y), (m.y = e[s].y), (m.z = e[s].x * C), u.setXYZ(p, m.x, m.y, m.z), (v.x = a / t), (v.y = s / (e.length - 1)), d.setXY(p, v.x, v.y), p++
  52710. }
  52711. for (a = 0; a < t; a++)
  52712. for (s = 0; s < e.length - 1; s++) {
  52713. o = s + a * e.length
  52714. var I = o,
  52715. E = o + e.length,
  52716. b = o + e.length + 1,
  52717. w = o + 1
  52718. h.setX(f, I), f++, h.setX(f, E), f++, h.setX(f, w), f++, h.setX(f, E), f++, h.setX(f, b), f++, h.setX(f, w), f++
  52719. }
  52720. if ((this.setIndex(h), this.addAttribute('position', u), this.addAttribute('uv', d), this.computeVertexNormals(), r === 2 * Math.PI)) {
  52721. var _ = this.attributes.normal.array,
  52722. T = new n.Vector3(),
  52723. x = new n.Vector3(),
  52724. S = new n.Vector3()
  52725. for (o = t * e.length * 3, a = 0, s = 0; a < e.length; a++, s += 3)
  52726. (T.x = _[s + 0]),
  52727. (T.y = _[s + 1]),
  52728. (T.z = _[s + 2]),
  52729. (x.x = _[o + s + 0]),
  52730. (x.y = _[o + s + 1]),
  52731. (x.z = _[o + s + 2]),
  52732. S.addVectors(T, x).normalize(),
  52733. (_[s + 0] = _[o + s + 0] = S.x),
  52734. (_[s + 1] = _[o + s + 1] = S.y),
  52735. (_[s + 2] = _[o + s + 2] = S.z)
  52736. }
  52737. }),
  52738. (n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  52739. (n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry),
  52740. (n.LatheGeometry = function (e, t, i, r) {
  52741. n.Geometry.call(this),
  52742. (this.type = 'LatheGeometry'),
  52743. (this.parameters = {
  52744. points: e,
  52745. segments: t,
  52746. phiStart: i,
  52747. phiLength: r
  52748. }),
  52749. this.fromBufferGeometry(new n.LatheBufferGeometry(e, t, i, r)),
  52750. this.mergeVertices()
  52751. }),
  52752. (n.LatheGeometry.prototype = Object.create(n.Geometry.prototype)),
  52753. (n.LatheGeometry.prototype.constructor = n.LatheGeometry),
  52754. (n.PlaneGeometry = function (e, t, i, r) {
  52755. n.Geometry.call(this),
  52756. (this.type = 'PlaneGeometry'),
  52757. (this.parameters = {
  52758. width: e,
  52759. height: t,
  52760. widthSegments: i,
  52761. heightSegments: r
  52762. }),
  52763. this.fromBufferGeometry(new n.PlaneBufferGeometry(e, t, i, r))
  52764. }),
  52765. (n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype)),
  52766. (n.PlaneGeometry.prototype.constructor = n.PlaneGeometry),
  52767. (n.PlaneBufferGeometry = function (e, t, i, r) {
  52768. n.BufferGeometry.call(this),
  52769. (this.type = 'PlaneBufferGeometry'),
  52770. (this.parameters = {
  52771. width: e,
  52772. height: t,
  52773. widthSegments: i,
  52774. heightSegments: r
  52775. })
  52776. for (
  52777. var o = e / 2,
  52778. a = t / 2,
  52779. s = Math.floor(i) || 1,
  52780. l = Math.floor(r) || 1,
  52781. c = s + 1,
  52782. h = l + 1,
  52783. u = e / s,
  52784. d = t / l,
  52785. p = new Float32Array(c * h * 3),
  52786. f = new Float32Array(c * h * 3),
  52787. g = new Float32Array(c * h * 2),
  52788. m = 0,
  52789. v = 0,
  52790. A = 0;
  52791. A < h;
  52792. A++
  52793. )
  52794. for (var y = A * d - a, C = 0; C < c; C++) {
  52795. var I = C * u - o
  52796. ;(p[m] = I), (p[m + 1] = -y), (f[m + 2] = 1), (g[v] = C / s), (g[v + 1] = 1 - A / l), (m += 3), (v += 2)
  52797. }
  52798. m = 0
  52799. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  52800. for (var C = 0; C < s; C++) {
  52801. var b = C + c * A,
  52802. w = C + c * (A + 1),
  52803. _ = C + 1 + c * (A + 1),
  52804. T = C + 1 + c * A
  52805. ;(E[m] = b), (E[m + 1] = w), (E[m + 2] = T), (E[m + 3] = w), (E[m + 4] = _), (E[m + 5] = T), (m += 6)
  52806. }
  52807. this.setIndex(new n.BufferAttribute(E, 1)),
  52808. this.addAttribute('position', new n.BufferAttribute(p, 3)),
  52809. this.addAttribute('normal', new n.BufferAttribute(f, 3)),
  52810. this.addAttribute('uv', new n.BufferAttribute(g, 2))
  52811. }),
  52812. (n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  52813. (n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry),
  52814. (n.RingBufferGeometry = function (e, t, i, r, o, a) {
  52815. n.BufferGeometry.call(this),
  52816. (this.type = 'RingBufferGeometry'),
  52817. (this.parameters = {
  52818. innerRadius: e,
  52819. outerRadius: t,
  52820. thetaSegments: i,
  52821. phiSegments: r,
  52822. thetaStart: o,
  52823. thetaLength: a
  52824. }),
  52825. (e = e || 20),
  52826. (t = t || 50),
  52827. (o = void 0 !== o ? o : 0),
  52828. (a = void 0 !== a ? a : 2 * Math.PI),
  52829. (i = void 0 !== i ? Math.max(3, i) : 8),
  52830. (r = void 0 !== r ? Math.max(1, r) : 1)
  52831. var s,
  52832. l,
  52833. c,
  52834. h = (i + 1) * (r + 1),
  52835. u = i * r * 2 * 3,
  52836. d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u), 1),
  52837. p = new n.BufferAttribute(new Float32Array(3 * h), 3),
  52838. f = new n.BufferAttribute(new Float32Array(3 * h), 3),
  52839. g = new n.BufferAttribute(new Float32Array(2 * h), 2),
  52840. m = 0,
  52841. v = 0,
  52842. A = e,
  52843. y = (t - e) / r,
  52844. C = new n.Vector3(),
  52845. I = new n.Vector2()
  52846. for (l = 0; l <= r; l++) {
  52847. for (c = 0; c <= i; c++)
  52848. (s = o + (c / i) * a),
  52849. (C.x = A * Math.cos(s)),
  52850. (C.y = A * Math.sin(s)),
  52851. p.setXYZ(m, C.x, C.y, C.z),
  52852. f.setXYZ(m, 0, 0, 1),
  52853. (I.x = (C.x / t + 1) / 2),
  52854. (I.y = (C.y / t + 1) / 2),
  52855. g.setXY(m, I.x, I.y),
  52856. m++
  52857. A += y
  52858. }
  52859. for (l = 0; l < r; l++) {
  52860. var E = l * (i + 1)
  52861. for (c = 0; c < i; c++) {
  52862. s = c + E
  52863. var b = s,
  52864. w = s + i + 1,
  52865. _ = s + i + 2,
  52866. T = s + 1
  52867. d.setX(v, b), v++, d.setX(v, w), v++, d.setX(v, _), v++, d.setX(v, b), v++, d.setX(v, _), v++, d.setX(v, T), v++
  52868. }
  52869. }
  52870. this.setIndex(d), this.addAttribute('position', p), this.addAttribute('normal', f), this.addAttribute('uv', g)
  52871. }),
  52872. (n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  52873. (n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry),
  52874. (n.RingGeometry = function (e, t, i, r, o, a) {
  52875. n.Geometry.call(this),
  52876. (this.type = 'RingGeometry'),
  52877. (this.parameters = {
  52878. innerRadius: e,
  52879. outerRadius: t,
  52880. thetaSegments: i,
  52881. phiSegments: r,
  52882. thetaStart: o,
  52883. thetaLength: a
  52884. }),
  52885. this.fromBufferGeometry(new n.RingBufferGeometry(e, t, i, r, o, a))
  52886. }),
  52887. (n.RingGeometry.prototype = Object.create(n.Geometry.prototype)),
  52888. (n.RingGeometry.prototype.constructor = n.RingGeometry),
  52889. (n.SphereGeometry = function (e, t, i, r, o, a, s) {
  52890. n.Geometry.call(this),
  52891. (this.type = 'SphereGeometry'),
  52892. (this.parameters = {
  52893. radius: e,
  52894. widthSegments: t,
  52895. heightSegments: i,
  52896. phiStart: r,
  52897. phiLength: o,
  52898. thetaStart: a,
  52899. thetaLength: s
  52900. }),
  52901. this.fromBufferGeometry(new n.SphereBufferGeometry(e, t, i, r, o, a, s))
  52902. }),
  52903. (n.SphereGeometry.prototype = Object.create(n.Geometry.prototype)),
  52904. (n.SphereGeometry.prototype.constructor = n.SphereGeometry),
  52905. (n.SphereBufferGeometry = function (e, t, i, r, o, a, s) {
  52906. n.BufferGeometry.call(this),
  52907. (this.type = 'SphereBufferGeometry'),
  52908. (this.parameters = {
  52909. radius: e,
  52910. widthSegments: t,
  52911. heightSegments: i,
  52912. phiStart: r,
  52913. phiLength: o,
  52914. thetaStart: a,
  52915. thetaLength: s
  52916. }),
  52917. (e = e || 50),
  52918. (t = Math.max(3, Math.floor(t) || 8)),
  52919. (i = Math.max(2, Math.floor(i) || 6)),
  52920. (r = void 0 !== r ? r : 0),
  52921. (o = void 0 !== o ? o : 2 * Math.PI),
  52922. (a = void 0 !== a ? a : 0),
  52923. (s = void 0 !== s ? s : Math.PI)
  52924. for (
  52925. var l = a + s,
  52926. c = (t + 1) * (i + 1),
  52927. h = new n.BufferAttribute(new Float32Array(3 * c), 3),
  52928. u = new n.BufferAttribute(new Float32Array(3 * c), 3),
  52929. d = new n.BufferAttribute(new Float32Array(2 * c), 2),
  52930. p = 0,
  52931. f = [],
  52932. g = new n.Vector3(),
  52933. m = 0;
  52934. m <= i;
  52935. m++
  52936. ) {
  52937. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  52938. var C = y / t,
  52939. I = -e * Math.cos(r + C * o) * Math.sin(a + A * s),
  52940. E = e * Math.cos(a + A * s),
  52941. b = e * Math.sin(r + C * o) * Math.sin(a + A * s)
  52942. g.set(I, E, b).normalize(), h.setXYZ(p, I, E, b), u.setXYZ(p, g.x, g.y, g.z), d.setXY(p, C, 1 - A), v.push(p), p++
  52943. }
  52944. f.push(v)
  52945. }
  52946. for (var w = [], m = 0; m < i; m++)
  52947. for (var y = 0; y < t; y++) {
  52948. var _ = f[m][y + 1],
  52949. T = f[m][y],
  52950. x = f[m + 1][y],
  52951. S = f[m + 1][y + 1]
  52952. ;(0 !== m || a > 0) && w.push(_, T, S), (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  52953. }
  52954. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w, 1)),
  52955. this.addAttribute('position', h),
  52956. this.addAttribute('normal', u),
  52957. this.addAttribute('uv', d),
  52958. (this.boundingSphere = new n.Sphere(new n.Vector3(), e))
  52959. }),
  52960. (n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  52961. (n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry),
  52962. (n.TextGeometry = function (e, t) {
  52963. t = t || {}
  52964. var i = t.font
  52965. if (i instanceof n.Font == !1) return console.error('THREE.TextGeometry: font parameter is not an instance of THREE.Font.'), new n.Geometry()
  52966. var r = i.generateShapes(e, t.size, t.curveSegments)
  52967. ;(t.amount = void 0 !== t.height ? t.height : 50),
  52968. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  52969. void 0 === t.bevelSize && (t.bevelSize = 8),
  52970. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  52971. n.ExtrudeGeometry.call(this, r, t),
  52972. (this.type = 'TextGeometry')
  52973. }),
  52974. (n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype)),
  52975. (n.TextGeometry.prototype.constructor = n.TextGeometry),
  52976. (n.TorusBufferGeometry = function (e, t, i, r, o) {
  52977. n.BufferGeometry.call(this),
  52978. (this.type = 'TorusBufferGeometry'),
  52979. (this.parameters = {
  52980. radius: e,
  52981. tube: t,
  52982. radialSegments: i,
  52983. tubularSegments: r,
  52984. arc: o
  52985. }),
  52986. (e = e || 100),
  52987. (t = t || 40),
  52988. (i = Math.floor(i) || 8),
  52989. (r = Math.floor(r) || 6),
  52990. (o = o || 2 * Math.PI)
  52991. var a,
  52992. s,
  52993. l = (i + 1) * (r + 1),
  52994. c = i * r * 2 * 3,
  52995. h = new (c > 65535 ? Uint32Array : Uint16Array)(c),
  52996. u = new Float32Array(3 * l),
  52997. d = new Float32Array(3 * l),
  52998. p = new Float32Array(2 * l),
  52999. f = 0,
  53000. g = 0,
  53001. m = 0,
  53002. v = new n.Vector3(),
  53003. A = new n.Vector3(),
  53004. y = new n.Vector3()
  53005. for (a = 0; a <= i; a++)
  53006. for (s = 0; s <= r; s++) {
  53007. var C = (s / r) * o,
  53008. I = (a / i) * Math.PI * 2
  53009. ;(A.x = (e + t * Math.cos(I)) * Math.cos(C)),
  53010. (A.y = (e + t * Math.cos(I)) * Math.sin(C)),
  53011. (A.z = t * Math.sin(I)),
  53012. (u[f] = A.x),
  53013. (u[f + 1] = A.y),
  53014. (u[f + 2] = A.z),
  53015. (v.x = e * Math.cos(C)),
  53016. (v.y = e * Math.sin(C)),
  53017. y.subVectors(A, v).normalize(),
  53018. (d[f] = y.x),
  53019. (d[f + 1] = y.y),
  53020. (d[f + 2] = y.z),
  53021. (p[g] = s / r),
  53022. (p[g + 1] = a / i),
  53023. (f += 3),
  53024. (g += 2)
  53025. }
  53026. for (a = 1; a <= i; a++)
  53027. for (s = 1; s <= r; s++) {
  53028. var E = (r + 1) * a + s - 1,
  53029. b = (r + 1) * (a - 1) + s - 1,
  53030. w = (r + 1) * (a - 1) + s,
  53031. _ = (r + 1) * a + s
  53032. ;(h[m] = E), (h[m + 1] = b), (h[m + 2] = _), (h[m + 3] = b), (h[m + 4] = w), (h[m + 5] = _), (m += 6)
  53033. }
  53034. this.setIndex(new n.BufferAttribute(h, 1)),
  53035. this.addAttribute('position', new n.BufferAttribute(u, 3)),
  53036. this.addAttribute('normal', new n.BufferAttribute(d, 3)),
  53037. this.addAttribute('uv', new n.BufferAttribute(p, 2))
  53038. }),
  53039. (n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  53040. (n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry),
  53041. (n.TorusGeometry = function (e, t, i, r, o) {
  53042. n.Geometry.call(this),
  53043. (this.type = 'TorusGeometry'),
  53044. (this.parameters = {
  53045. radius: e,
  53046. tube: t,
  53047. radialSegments: i,
  53048. tubularSegments: r,
  53049. arc: o
  53050. }),
  53051. this.fromBufferGeometry(new n.TorusBufferGeometry(e, t, i, r, o))
  53052. }),
  53053. (n.TorusGeometry.prototype = Object.create(n.Geometry.prototype)),
  53054. (n.TorusGeometry.prototype.constructor = n.TorusGeometry),
  53055. (n.TorusKnotBufferGeometry = function (e, t, i, r, o, a) {
  53056. function s(e, t, i, n, r) {
  53057. var o = Math.cos(e),
  53058. a = Math.sin(e),
  53059. s = (i / t) * e,
  53060. l = Math.cos(s)
  53061. ;(r.x = n * (2 + l) * 0.5 * o), (r.y = n * (2 + l) * a * 0.5), (r.z = n * Math.sin(s) * 0.5)
  53062. }
  53063. n.BufferGeometry.call(this),
  53064. (this.type = 'TorusKnotBufferGeometry'),
  53065. (this.parameters = {
  53066. radius: e,
  53067. tube: t,
  53068. tubularSegments: i,
  53069. radialSegments: r,
  53070. p: o,
  53071. q: a
  53072. }),
  53073. (e = e || 100),
  53074. (t = t || 40),
  53075. (i = Math.floor(i) || 64),
  53076. (r = Math.floor(r) || 8),
  53077. (o = o || 2),
  53078. (a = a || 3)
  53079. var l,
  53080. c,
  53081. h = (r + 1) * (i + 1),
  53082. u = r * i * 2 * 3,
  53083. d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u), 1),
  53084. p = new n.BufferAttribute(new Float32Array(3 * h), 3),
  53085. f = new n.BufferAttribute(new Float32Array(3 * h), 3),
  53086. g = new n.BufferAttribute(new Float32Array(2 * h), 2),
  53087. m = 0,
  53088. v = 0,
  53089. A = new n.Vector3(),
  53090. y = new n.Vector3(),
  53091. C = new n.Vector2(),
  53092. I = new n.Vector3(),
  53093. E = new n.Vector3(),
  53094. b = new n.Vector3(),
  53095. w = new n.Vector3(),
  53096. _ = new n.Vector3()
  53097. for (l = 0; l <= i; ++l) {
  53098. var T = (l / i) * o * Math.PI * 2
  53099. for (s(T, o, a, e, I), s(T + 0.01, o, a, e, E), w.subVectors(E, I), _.addVectors(E, I), b.crossVectors(w, _), _.crossVectors(b, w), b.normalize(), _.normalize(), c = 0; c <= r; ++c) {
  53100. var x = (c / r) * Math.PI * 2,
  53101. S = -t * Math.cos(x),
  53102. M = t * Math.sin(x)
  53103. ;(A.x = I.x + (S * _.x + M * b.x)),
  53104. (A.y = I.y + (S * _.y + M * b.y)),
  53105. (A.z = I.z + (S * _.z + M * b.z)),
  53106. p.setXYZ(m, A.x, A.y, A.z),
  53107. y.subVectors(A, I).normalize(),
  53108. f.setXYZ(m, y.x, y.y, y.z),
  53109. (C.x = l / i),
  53110. (C.y = c / r),
  53111. g.setXY(m, C.x, C.y),
  53112. m++
  53113. }
  53114. }
  53115. for (c = 1; c <= i; c++)
  53116. for (l = 1; l <= r; l++) {
  53117. var R = (r + 1) * (c - 1) + (l - 1),
  53118. P = (r + 1) * c + (l - 1),
  53119. O = (r + 1) * c + l,
  53120. L = (r + 1) * (c - 1) + l
  53121. d.setX(v, R), v++, d.setX(v, P), v++, d.setX(v, L), v++, d.setX(v, P), v++, d.setX(v, O), v++, d.setX(v, L), v++
  53122. }
  53123. this.setIndex(d), this.addAttribute('position', p), this.addAttribute('normal', f), this.addAttribute('uv', g)
  53124. }),
  53125. (n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  53126. (n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry),
  53127. (n.TorusKnotGeometry = function (e, t, i, r, o, a, s) {
  53128. n.Geometry.call(this),
  53129. (this.type = 'TorusKnotGeometry'),
  53130. (this.parameters = {
  53131. radius: e,
  53132. tube: t,
  53133. tubularSegments: i,
  53134. radialSegments: r,
  53135. p: o,
  53136. q: a
  53137. }),
  53138. void 0 !== s && console.warn('THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead.'),
  53139. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e, t, i, r, o, a)),
  53140. this.mergeVertices()
  53141. }),
  53142. (n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype)),
  53143. (n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry),
  53144. (n.TubeGeometry = function (e, t, i, r, o, a) {
  53145. function s(e, t, i) {
  53146. return R.vertices.push(new n.Vector3(e, t, i)) - 1
  53147. }
  53148. n.Geometry.call(this),
  53149. (this.type = 'TubeGeometry'),
  53150. (this.parameters = {
  53151. path: e,
  53152. segments: t,
  53153. radius: i,
  53154. radialSegments: r,
  53155. closed: o,
  53156. taper: a
  53157. }),
  53158. (t = t || 64),
  53159. (i = i || 1),
  53160. (r = r || 8),
  53161. (o = o || !1),
  53162. (a = a || n.TubeGeometry.NoTaper)
  53163. var l,
  53164. c,
  53165. h,
  53166. u,
  53167. d,
  53168. p,
  53169. f,
  53170. g,
  53171. m,
  53172. v,
  53173. A,
  53174. y,
  53175. C,
  53176. I,
  53177. E,
  53178. b,
  53179. w,
  53180. _,
  53181. T,
  53182. x,
  53183. S,
  53184. M = [],
  53185. R = this,
  53186. P = t + 1,
  53187. O = new n.Vector3(),
  53188. L = new n.TubeGeometry.FrenetFrames(e, t, o),
  53189. D = L.tangents,
  53190. N = L.normals,
  53191. B = L.binormals
  53192. for (this.tangents = D, this.normals = N, this.binormals = B, v = 0; v < P; v++)
  53193. for (M[v] = [], u = v / (P - 1), m = e.getPointAt(u), l = D[v], c = N[v], h = B[v], p = i * a(u), A = 0; A < r; A++)
  53194. (d = (A / r) * 2 * Math.PI),
  53195. (f = -p * Math.cos(d)),
  53196. (g = p * Math.sin(d)),
  53197. O.copy(m),
  53198. (O.x += f * c.x + g * h.x),
  53199. (O.y += f * c.y + g * h.y),
  53200. (O.z += f * c.z + g * h.z),
  53201. (M[v][A] = s(O.x, O.y, O.z))
  53202. for (v = 0; v < t; v++)
  53203. for (A = 0; A < r; A++)
  53204. (y = o ? (v + 1) % t : v + 1),
  53205. (C = (A + 1) % r),
  53206. (I = M[v][A]),
  53207. (E = M[y][A]),
  53208. (b = M[y][C]),
  53209. (w = M[v][C]),
  53210. (_ = new n.Vector2(v / t, A / r)),
  53211. (T = new n.Vector2((v + 1) / t, A / r)),
  53212. (x = new n.Vector2((v + 1) / t, (A + 1) / r)),
  53213. (S = new n.Vector2(v / t, (A + 1) / r)),
  53214. this.faces.push(new n.Face3(I, E, w)),
  53215. this.faceVertexUvs[0].push([_, T, S]),
  53216. this.faces.push(new n.Face3(E, b, w)),
  53217. this.faceVertexUvs[0].push([T.clone(), x, S.clone()])
  53218. this.computeFaceNormals(), this.computeVertexNormals()
  53219. }),
  53220. (n.TubeGeometry.prototype = Object.create(n.Geometry.prototype)),
  53221. (n.TubeGeometry.prototype.constructor = n.TubeGeometry),
  53222. (n.TubeGeometry.NoTaper = function (e) {
  53223. return 1
  53224. }),
  53225. (n.TubeGeometry.SinusoidalTaper = function (e) {
  53226. return Math.sin(Math.PI * e)
  53227. }),
  53228. (n.TubeGeometry.FrenetFrames = function (e, t, i) {
  53229. function r() {
  53230. ;(f[0] = new n.Vector3()),
  53231. (g[0] = new n.Vector3()),
  53232. (a = Number.MAX_VALUE),
  53233. (s = Math.abs(p[0].x)),
  53234. (l = Math.abs(p[0].y)),
  53235. (c = Math.abs(p[0].z)),
  53236. s <= a && ((a = s), d.set(1, 0, 0)),
  53237. l <= a && ((a = l), d.set(0, 1, 0)),
  53238. c <= a && d.set(0, 0, 1),
  53239. m.crossVectors(p[0], d).normalize(),
  53240. f[0].crossVectors(p[0], m),
  53241. g[0].crossVectors(p[0], f[0])
  53242. }
  53243. var o,
  53244. a,
  53245. s,
  53246. l,
  53247. c,
  53248. h,
  53249. u,
  53250. d = new n.Vector3(),
  53251. p = [],
  53252. f = [],
  53253. g = [],
  53254. m = new n.Vector3(),
  53255. v = new n.Matrix4(),
  53256. A = t + 1
  53257. for (this.tangents = p, this.normals = f, this.binormals = g, h = 0; h < A; h++) (u = h / (A - 1)), (p[h] = e.getTangentAt(u)), p[h].normalize()
  53258. for (r(), h = 1; h < A; h++)
  53259. (f[h] = f[h - 1].clone()),
  53260. (g[h] = g[h - 1].clone()),
  53261. m.crossVectors(p[h - 1], p[h]),
  53262. m.length() > Number.EPSILON && (m.normalize(), (o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1))), f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  53263. g[h].crossVectors(p[h], f[h])
  53264. if (i)
  53265. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)), o /= A - 1, p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o), h = 1; h < A; h++)
  53266. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)), g[h].crossVectors(p[h], f[h])
  53267. }),
  53268. (n.PolyhedronGeometry = function (e, t, i, r) {
  53269. function o(e) {
  53270. var t = e.normalize().clone()
  53271. t.index = u.vertices.push(t) - 1
  53272. var i = l(e) / 2 / Math.PI + 0.5,
  53273. r = c(e) / Math.PI + 0.5
  53274. return (t.uv = new n.Vector2(i, 1 - r)), t
  53275. }
  53276. function a(e, t, i, r) {
  53277. var o = new n.Face3(e.index, t.index, i.index, [e.clone(), t.clone(), i.clone()], void 0, r)
  53278. u.faces.push(o), C.copy(e).add(t).add(i).divideScalar(3)
  53279. var a = l(C)
  53280. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  53281. }
  53282. function s(e, t) {
  53283. for (var i = Math.pow(2, t), n = o(u.vertices[e.a]), r = o(u.vertices[e.b]), s = o(u.vertices[e.c]), l = [], c = e.materialIndex, h = 0; h <= i; h++) {
  53284. l[h] = []
  53285. for (var d = o(n.clone().lerp(s, h / i)), p = o(r.clone().lerp(s, h / i)), f = i - h, g = 0; g <= f; g++) 0 === g && h === i ? (l[h][g] = d) : (l[h][g] = o(d.clone().lerp(p, g / f)))
  53286. }
  53287. for (var h = 0; h < i; h++)
  53288. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  53289. var m = Math.floor(g / 2)
  53290. g % 2 === 0 ? a(l[h][m + 1], l[h + 1][m], l[h][m], c) : a(l[h][m + 1], l[h + 1][m + 1], l[h + 1][m], c)
  53291. }
  53292. }
  53293. function l(e) {
  53294. return Math.atan2(e.z, -e.x)
  53295. }
  53296. function c(e) {
  53297. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  53298. }
  53299. function h(e, t, i) {
  53300. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1, e.y)), 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + 0.5, e.y)), e.clone()
  53301. }
  53302. n.Geometry.call(this),
  53303. (this.type = 'PolyhedronGeometry'),
  53304. (this.parameters = {
  53305. vertices: e,
  53306. indices: t,
  53307. radius: i,
  53308. detail: r
  53309. }),
  53310. (i = i || 1),
  53311. (r = r || 0)
  53312. for (var u = this, d = 0, p = e.length; d < p; d += 3) o(new n.Vector3(e[d], e[d + 1], e[d + 2]))
  53313. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3, m++) {
  53314. var v = f[t[d]],
  53315. A = f[t[d + 1]],
  53316. y = f[t[d + 2]]
  53317. g[m] = new n.Face3(v.index, A.index, y.index, [v.clone(), A.clone(), y.clone()], void 0, m)
  53318. }
  53319. for (var C = new n.Vector3(), d = 0, p = g.length; d < p; d++) s(g[d], r)
  53320. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  53321. var I = this.faceVertexUvs[0][d],
  53322. E = I[0].x,
  53323. b = I[1].x,
  53324. w = I[2].x,
  53325. _ = Math.max(E, b, w),
  53326. T = Math.min(E, b, w)
  53327. _ > 0.9 && T < 0.1 && (E < 0.2 && (I[0].x += 1), b < 0.2 && (I[1].x += 1), w < 0.2 && (I[2].x += 1))
  53328. }
  53329. for (var d = 0, p = this.vertices.length; d < p; d++) this.vertices[d].multiplyScalar(i)
  53330. this.mergeVertices(), this.computeFaceNormals(), (this.boundingSphere = new n.Sphere(new n.Vector3(), i))
  53331. }),
  53332. (n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype)),
  53333. (n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry),
  53334. (n.DodecahedronGeometry = function (e, t) {
  53335. var i = (1 + Math.sqrt(5)) / 2,
  53336. r = 1 / i,
  53337. o = [
  53338. -1,
  53339. -1,
  53340. -1,
  53341. -1,
  53342. -1,
  53343. 1,
  53344. -1,
  53345. 1,
  53346. -1,
  53347. -1,
  53348. 1,
  53349. 1,
  53350. 1,
  53351. -1,
  53352. -1,
  53353. 1,
  53354. -1,
  53355. 1,
  53356. 1,
  53357. 1,
  53358. -1,
  53359. 1,
  53360. 1,
  53361. 1,
  53362. 0,
  53363. -r,
  53364. -i,
  53365. 0,
  53366. -r,
  53367. i,
  53368. 0,
  53369. r,
  53370. -i,
  53371. 0,
  53372. r,
  53373. i,
  53374. -r,
  53375. -i,
  53376. 0,
  53377. -r,
  53378. i,
  53379. 0,
  53380. r,
  53381. -i,
  53382. 0,
  53383. r,
  53384. i,
  53385. 0,
  53386. -i,
  53387. 0,
  53388. -r,
  53389. i,
  53390. 0,
  53391. -r,
  53392. -i,
  53393. 0,
  53394. r,
  53395. i,
  53396. 0,
  53397. r
  53398. ],
  53399. a = [
  53400. 3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10, 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0, 12, 1, 0, 1, 18, 0, 18, 16, 6, 10, 2, 6, 2, 13, 6, 13,
  53401. 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4, 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14, 5,
  53402. 1, 5, 9
  53403. ]
  53404. n.PolyhedronGeometry.call(this, o, a, e, t),
  53405. (this.type = 'DodecahedronGeometry'),
  53406. (this.parameters = {
  53407. radius: e,
  53408. detail: t
  53409. })
  53410. }),
  53411. (n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  53412. (n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry),
  53413. (n.IcosahedronGeometry = function (e, t) {
  53414. var i = (1 + Math.sqrt(5)) / 2,
  53415. r = [-1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, 0, 0, -1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, i, 0, -1, i, 0, 1, -i, 0, -1, -i, 0, 1],
  53416. o = [
  53417. 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9,
  53418. 8, 1
  53419. ]
  53420. n.PolyhedronGeometry.call(this, r, o, e, t),
  53421. (this.type = 'IcosahedronGeometry'),
  53422. (this.parameters = {
  53423. radius: e,
  53424. detail: t
  53425. })
  53426. }),
  53427. (n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  53428. (n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry),
  53429. (n.OctahedronGeometry = function (e, t) {
  53430. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1],
  53431. 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]
  53432. n.PolyhedronGeometry.call(this, i, r, e, t),
  53433. (this.type = 'OctahedronGeometry'),
  53434. (this.parameters = {
  53435. radius: e,
  53436. detail: t
  53437. })
  53438. }),
  53439. (n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  53440. (n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry),
  53441. (n.TetrahedronGeometry = function (e, t) {
  53442. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1],
  53443. r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1]
  53444. n.PolyhedronGeometry.call(this, i, r, e, t),
  53445. (this.type = 'TetrahedronGeometry'),
  53446. (this.parameters = {
  53447. radius: e,
  53448. detail: t
  53449. })
  53450. }),
  53451. (n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  53452. (n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry),
  53453. (n.ParametricGeometry = function (e, t, i) {
  53454. n.Geometry.call(this),
  53455. (this.type = 'ParametricGeometry'),
  53456. (this.parameters = {
  53457. func: e,
  53458. slices: t,
  53459. stacks: i
  53460. })
  53461. var r,
  53462. o,
  53463. a,
  53464. s,
  53465. l,
  53466. c = this.vertices,
  53467. h = this.faces,
  53468. u = this.faceVertexUvs[0],
  53469. d = t + 1
  53470. for (r = 0; r <= i; r++) for (l = r / i, o = 0; o <= t; o++) (s = o / t), (a = e(s, l)), c.push(a)
  53471. var p, f, g, m, v, A, y, C
  53472. for (r = 0; r < i; r++)
  53473. for (o = 0; o < t; o++)
  53474. (p = r * d + o),
  53475. (f = r * d + o + 1),
  53476. (g = (r + 1) * d + o + 1),
  53477. (m = (r + 1) * d + o),
  53478. (v = new n.Vector2(o / t, r / i)),
  53479. (A = new n.Vector2((o + 1) / t, r / i)),
  53480. (y = new n.Vector2((o + 1) / t, (r + 1) / i)),
  53481. (C = new n.Vector2(o / t, (r + 1) / i)),
  53482. h.push(new n.Face3(p, f, m)),
  53483. u.push([v, A, C]),
  53484. h.push(new n.Face3(f, g, m)),
  53485. u.push([A.clone(), y, C.clone()])
  53486. this.computeFaceNormals(), this.computeVertexNormals()
  53487. }),
  53488. (n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype)),
  53489. (n.ParametricGeometry.prototype.constructor = n.ParametricGeometry),
  53490. (n.WireframeGeometry = function (e) {
  53491. function t(e, t) {
  53492. return e - t
  53493. }
  53494. n.BufferGeometry.call(this)
  53495. var i = [0, 0],
  53496. r = {},
  53497. o = ['a', 'b', 'c']
  53498. if (e instanceof n.Geometry) {
  53499. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  53500. for (var d = s[h], p = 0; p < 3; p++) {
  53501. ;(i[0] = d[o[p]]), (i[1] = d[o[(p + 1) % 3]]), i.sort(t)
  53502. var f = i.toString()
  53503. void 0 === r[f] && ((c[2 * l] = i[0]), (c[2 * l + 1] = i[1]), (r[f] = !0), l++)
  53504. }
  53505. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  53506. for (var p = 0; p < 2; p++) {
  53507. var m = a[c[2 * h + p]],
  53508. v = 6 * h + 3 * p
  53509. ;(g[v + 0] = m.x), (g[v + 1] = m.y), (g[v + 2] = m.z)
  53510. }
  53511. this.addAttribute('position', new n.BufferAttribute(g, 3))
  53512. } else if (e instanceof n.BufferGeometry)
  53513. if (null !== e.index) {
  53514. var A = e.index.array,
  53515. a = e.attributes.position,
  53516. y = e.groups,
  53517. l = 0
  53518. 0 === y.length && e.addGroup(0, A.length)
  53519. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  53520. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  53521. for (var p = 0; p < 3; p++) {
  53522. ;(i[0] = A[h + p]), (i[1] = A[h + ((p + 1) % 3)]), i.sort(t)
  53523. var f = i.toString()
  53524. void 0 === r[f] && ((c[2 * l] = i[0]), (c[2 * l + 1] = i[1]), (r[f] = !0), l++)
  53525. }
  53526. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  53527. for (var p = 0; p < 2; p++) {
  53528. var v = 6 * h + 3 * p,
  53529. T = c[2 * h + p]
  53530. ;(g[v + 0] = a.getX(T)), (g[v + 1] = a.getY(T)), (g[v + 2] = a.getZ(T))
  53531. }
  53532. this.addAttribute('position', new n.BufferAttribute(g, 3))
  53533. } else {
  53534. for (var a = e.attributes.position.array, l = a.length / 3, x = l / 3, g = new Float32Array(2 * l * 3), h = 0, u = x; h < u; h++)
  53535. for (var p = 0; p < 3; p++) {
  53536. var v = 18 * h + 6 * p,
  53537. S = 9 * h + 3 * p
  53538. ;(g[v + 0] = a[S]), (g[v + 1] = a[S + 1]), (g[v + 2] = a[S + 2])
  53539. var T = 9 * h + 3 * ((p + 1) % 3)
  53540. ;(g[v + 3] = a[T]), (g[v + 4] = a[T + 1]), (g[v + 5] = a[T + 2])
  53541. }
  53542. this.addAttribute('position', new n.BufferAttribute(g, 3))
  53543. }
  53544. }),
  53545. (n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  53546. (n.WireframeGeometry.prototype.constructor = n.WireframeGeometry),
  53547. (n.AxisHelper = function (e) {
  53548. e = e || 1
  53549. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e]),
  53550. i = new Float32Array([1, 0, 0, 1, 0.6, 0, 0, 1, 0, 0.6, 1, 0, 0, 0, 1, 0, 0.6, 1]),
  53551. r = new n.BufferGeometry()
  53552. r.addAttribute('position', new n.BufferAttribute(t, 3)), r.addAttribute('color', new n.BufferAttribute(i, 3))
  53553. var o = new n.LineBasicMaterial({
  53554. vertexColors: n.VertexColors
  53555. })
  53556. n.LineSegments.call(this, r, o)
  53557. }),
  53558. (n.AxisHelper.prototype = Object.create(n.LineSegments.prototype)),
  53559. (n.AxisHelper.prototype.constructor = n.AxisHelper),
  53560. (n.ArrowHelper = (function () {
  53561. var e = new n.Geometry()
  53562. e.vertices.push(new n.Vector3(0, 0, 0), new n.Vector3(0, 1, 0))
  53563. var t = new n.CylinderGeometry(0, 0.5, 1, 5, 1)
  53564. return (
  53565. t.translate(0, -0.5, 0),
  53566. function (i, r, o, a, s, l) {
  53567. n.Object3D.call(this),
  53568. void 0 === a && (a = 16776960),
  53569. void 0 === o && (o = 1),
  53570. void 0 === s && (s = 0.2 * o),
  53571. void 0 === l && (l = 0.2 * s),
  53572. this.position.copy(r),
  53573. (this.line = new n.Line(
  53574. e,
  53575. new n.LineBasicMaterial({
  53576. color: a
  53577. })
  53578. )),
  53579. (this.line.matrixAutoUpdate = !1),
  53580. this.add(this.line),
  53581. (this.cone = new n.Mesh(
  53582. t,
  53583. new n.MeshBasicMaterial({
  53584. color: a
  53585. })
  53586. )),
  53587. (this.cone.matrixAutoUpdate = !1),
  53588. this.add(this.cone),
  53589. this.setDirection(i),
  53590. this.setLength(o, s, l)
  53591. }
  53592. )
  53593. })()),
  53594. (n.ArrowHelper.prototype = Object.create(n.Object3D.prototype)),
  53595. (n.ArrowHelper.prototype.constructor = n.ArrowHelper),
  53596. (n.ArrowHelper.prototype.setDirection = (function () {
  53597. var e,
  53598. t = new n.Vector3()
  53599. return function (i) {
  53600. i.y > 0.99999
  53601. ? this.quaternion.set(0, 0, 0, 1)
  53602. : i.y < -0.99999
  53603. ? this.quaternion.set(1, 0, 0, 0)
  53604. : (t.set(i.z, 0, -i.x).normalize(), (e = Math.acos(i.y)), this.quaternion.setFromAxisAngle(t, e))
  53605. }
  53606. })()),
  53607. (n.ArrowHelper.prototype.setLength = function (e, t, i) {
  53608. void 0 === t && (t = 0.2 * e),
  53609. void 0 === i && (i = 0.2 * t),
  53610. this.line.scale.set(1, Math.max(0, e - t), 1),
  53611. this.line.updateMatrix(),
  53612. this.cone.scale.set(i, t, i),
  53613. (this.cone.position.y = e),
  53614. this.cone.updateMatrix()
  53615. }),
  53616. (n.ArrowHelper.prototype.setColor = function (e) {
  53617. this.line.material.color.set(e), this.cone.material.color.set(e)
  53618. }),
  53619. (n.BoxHelper = function (e) {
  53620. var t = new Uint16Array([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7]),
  53621. i = new Float32Array(24),
  53622. r = new n.BufferGeometry()
  53623. r.setIndex(new n.BufferAttribute(t, 1)),
  53624. r.addAttribute('position', new n.BufferAttribute(i, 3)),
  53625. n.LineSegments.call(
  53626. this,
  53627. r,
  53628. new n.LineBasicMaterial({
  53629. color: 16776960
  53630. })
  53631. ),
  53632. void 0 !== e && this.update(e)
  53633. }),
  53634. (n.BoxHelper.prototype = Object.create(n.LineSegments.prototype)),
  53635. (n.BoxHelper.prototype.constructor = n.BoxHelper),
  53636. (n.BoxHelper.prototype.update = (function () {
  53637. var e = new n.Box3()
  53638. return function (t) {
  53639. if ((e.setFromObject(t), !e.isEmpty())) {
  53640. var i = e.min,
  53641. n = e.max,
  53642. r = this.geometry.attributes.position,
  53643. o = r.array
  53644. ;(o[0] = n.x),
  53645. (o[1] = n.y),
  53646. (o[2] = n.z),
  53647. (o[3] = i.x),
  53648. (o[4] = n.y),
  53649. (o[5] = n.z),
  53650. (o[6] = i.x),
  53651. (o[7] = i.y),
  53652. (o[8] = n.z),
  53653. (o[9] = n.x),
  53654. (o[10] = i.y),
  53655. (o[11] = n.z),
  53656. (o[12] = n.x),
  53657. (o[13] = n.y),
  53658. (o[14] = i.z),
  53659. (o[15] = i.x),
  53660. (o[16] = n.y),
  53661. (o[17] = i.z),
  53662. (o[18] = i.x),
  53663. (o[19] = i.y),
  53664. (o[20] = i.z),
  53665. (o[21] = n.x),
  53666. (o[22] = i.y),
  53667. (o[23] = i.z),
  53668. (r.needsUpdate = !0),
  53669. this.geometry.computeBoundingSphere()
  53670. }
  53671. }
  53672. })()),
  53673. (n.BoundingBoxHelper = function (e, t) {
  53674. var i = void 0 !== t ? t : 8947848
  53675. ;(this.object = e),
  53676. (this.box = new n.Box3()),
  53677. n.Mesh.call(
  53678. this,
  53679. new n.BoxGeometry(1, 1, 1),
  53680. new n.MeshBasicMaterial({
  53681. color: i,
  53682. wireframe: !0
  53683. })
  53684. )
  53685. }),
  53686. (n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype)),
  53687. (n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper),
  53688. (n.BoundingBoxHelper.prototype.update = function () {
  53689. this.box.setFromObject(this.object), this.box.size(this.scale), this.box.center(this.position)
  53690. }),
  53691. (n.CameraHelper = function (e) {
  53692. function t(e, t, n) {
  53693. i(e, n), i(t, n)
  53694. }
  53695. function i(e, t) {
  53696. r.vertices.push(new n.Vector3()), r.colors.push(new n.Color(t)), void 0 === a[e] && (a[e] = []), a[e].push(r.vertices.length - 1)
  53697. }
  53698. var r = new n.Geometry(),
  53699. o = new n.LineBasicMaterial({
  53700. color: 16777215,
  53701. vertexColors: n.FaceColors
  53702. }),
  53703. a = {},
  53704. s = 16755200,
  53705. l = 16711680,
  53706. c = 43775,
  53707. h = 16777215,
  53708. u = 3355443
  53709. t('n1', 'n2', s),
  53710. t('n2', 'n4', s),
  53711. t('n4', 'n3', s),
  53712. t('n3', 'n1', s),
  53713. t('f1', 'f2', s),
  53714. t('f2', 'f4', s),
  53715. t('f4', 'f3', s),
  53716. t('f3', 'f1', s),
  53717. t('n1', 'f1', s),
  53718. t('n2', 'f2', s),
  53719. t('n3', 'f3', s),
  53720. t('n4', 'f4', s),
  53721. t('p', 'n1', l),
  53722. t('p', 'n2', l),
  53723. t('p', 'n3', l),
  53724. t('p', 'n4', l),
  53725. t('u1', 'u2', c),
  53726. t('u2', 'u3', c),
  53727. t('u3', 'u1', c),
  53728. t('c', 't', h),
  53729. t('p', 'c', u),
  53730. t('cn1', 'cn2', u),
  53731. t('cn3', 'cn4', u),
  53732. t('cf1', 'cf2', u),
  53733. t('cf3', 'cf4', u),
  53734. n.LineSegments.call(this, r, o),
  53735. (this.camera = e),
  53736. this.camera.updateProjectionMatrix(),
  53737. (this.matrix = e.matrixWorld),
  53738. (this.matrixAutoUpdate = !1),
  53739. (this.pointMap = a),
  53740. this.update()
  53741. }),
  53742. (n.CameraHelper.prototype = Object.create(n.LineSegments.prototype)),
  53743. (n.CameraHelper.prototype.constructor = n.CameraHelper),
  53744. (n.CameraHelper.prototype.update = (function () {
  53745. function e(e, n, a, s) {
  53746. r.set(n, a, s).unproject(o)
  53747. var l = i[e]
  53748. if (void 0 !== l) for (var c = 0, h = l.length; c < h; c++) t.vertices[l[c]].copy(r)
  53749. }
  53750. var t,
  53751. i,
  53752. r = new n.Vector3(),
  53753. o = new n.Camera()
  53754. return function () {
  53755. ;(t = this.geometry), (i = this.pointMap)
  53756. var n = 1,
  53757. r = 1
  53758. o.projectionMatrix.copy(this.camera.projectionMatrix),
  53759. e('c', 0, 0, -1),
  53760. e('t', 0, 0, 1),
  53761. e('n1', -n, -r, -1),
  53762. e('n2', n, -r, -1),
  53763. e('n3', -n, r, -1),
  53764. e('n4', n, r, -1),
  53765. e('f1', -n, -r, 1),
  53766. e('f2', n, -r, 1),
  53767. e('f3', -n, r, 1),
  53768. e('f4', n, r, 1),
  53769. e('u1', 0.7 * n, 1.1 * r, -1),
  53770. e('u2', 0.7 * -n, 1.1 * r, -1),
  53771. e('u3', 0, 2 * r, -1),
  53772. e('cf1', -n, 0, 1),
  53773. e('cf2', n, 0, 1),
  53774. e('cf3', 0, -r, 1),
  53775. e('cf4', 0, r, 1),
  53776. e('cn1', -n, 0, -1),
  53777. e('cn2', n, 0, -1),
  53778. e('cn3', 0, -r, -1),
  53779. e('cn4', 0, r, -1),
  53780. (t.verticesNeedUpdate = !0)
  53781. }
  53782. })()),
  53783. (n.DirectionalLightHelper = function (e, t) {
  53784. n.Object3D.call(this), (this.light = e), this.light.updateMatrixWorld(), (this.matrix = e.matrixWorld), (this.matrixAutoUpdate = !1), (t = t || 1)
  53785. var i = new n.Geometry()
  53786. i.vertices.push(new n.Vector3(-t, t, 0), new n.Vector3(t, t, 0), new n.Vector3(t, -t, 0), new n.Vector3(-t, -t, 0), new n.Vector3(-t, t, 0))
  53787. var r = new n.LineBasicMaterial({
  53788. fog: !1
  53789. })
  53790. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  53791. (this.lightPlane = new n.Line(i, r)),
  53792. this.add(this.lightPlane),
  53793. (i = new n.Geometry()),
  53794. i.vertices.push(new n.Vector3(), new n.Vector3()),
  53795. (r = new n.LineBasicMaterial({
  53796. fog: !1
  53797. })),
  53798. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  53799. (this.targetLine = new n.Line(i, r)),
  53800. this.add(this.targetLine),
  53801. this.update()
  53802. }),
  53803. (n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype)),
  53804. (n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper),
  53805. (n.DirectionalLightHelper.prototype.dispose = function () {
  53806. this.lightPlane.geometry.dispose(), this.lightPlane.material.dispose(), this.targetLine.geometry.dispose(), this.targetLine.material.dispose()
  53807. }),
  53808. (n.DirectionalLightHelper.prototype.update = (function () {
  53809. var e = new n.Vector3(),
  53810. t = new n.Vector3(),
  53811. i = new n.Vector3()
  53812. return function () {
  53813. e.setFromMatrixPosition(this.light.matrixWorld),
  53814. t.setFromMatrixPosition(this.light.target.matrixWorld),
  53815. i.subVectors(t, e),
  53816. this.lightPlane.lookAt(i),
  53817. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  53818. this.targetLine.geometry.vertices[1].copy(i),
  53819. (this.targetLine.geometry.verticesNeedUpdate = !0),
  53820. this.targetLine.material.color.copy(this.lightPlane.material.color)
  53821. }
  53822. })()),
  53823. (n.EdgesHelper = function (e, t, i) {
  53824. var r = void 0 !== t ? t : 16777215
  53825. n.LineSegments.call(
  53826. this,
  53827. new n.EdgesGeometry(e.geometry, i),
  53828. new n.LineBasicMaterial({
  53829. color: r
  53830. })
  53831. ),
  53832. (this.matrix = e.matrixWorld),
  53833. (this.matrixAutoUpdate = !1)
  53834. }),
  53835. (n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype)),
  53836. (n.EdgesHelper.prototype.constructor = n.EdgesHelper),
  53837. (n.FaceNormalsHelper = function (e, t, i, r) {
  53838. ;(this.object = e), (this.size = void 0 !== t ? t : 1)
  53839. var o = void 0 !== i ? i : 16776960,
  53840. a = void 0 !== r ? r : 1,
  53841. s = 0,
  53842. l = this.object.geometry
  53843. l instanceof n.Geometry ? (s = l.faces.length) : console.warn('THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.')
  53844. var c = new n.BufferGeometry(),
  53845. h = new n.Float32Attribute(2 * s * 3, 3)
  53846. c.addAttribute('position', h),
  53847. n.LineSegments.call(
  53848. this,
  53849. c,
  53850. new n.LineBasicMaterial({
  53851. color: o,
  53852. linewidth: a
  53853. })
  53854. ),
  53855. (this.matrixAutoUpdate = !1),
  53856. this.update()
  53857. }),
  53858. (n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype)),
  53859. (n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper),
  53860. (n.FaceNormalsHelper.prototype.update = (function () {
  53861. var e = new n.Vector3(),
  53862. t = new n.Vector3(),
  53863. i = new n.Matrix3()
  53864. return function () {
  53865. this.object.updateMatrixWorld(!0), i.getNormalMatrix(this.object.matrixWorld)
  53866. for (var n = this.object.matrixWorld, r = this.geometry.attributes.position, o = this.object.geometry, a = o.vertices, s = o.faces, l = 0, c = 0, h = s.length; c < h; c++) {
  53867. var u = s[c],
  53868. d = u.normal
  53869. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  53870. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  53871. r.setXYZ(l, e.x, e.y, e.z),
  53872. (l += 1),
  53873. r.setXYZ(l, t.x, t.y, t.z),
  53874. (l += 1)
  53875. }
  53876. return (r.needsUpdate = !0), this
  53877. }
  53878. })()),
  53879. (n.GridHelper = function (e, t) {
  53880. var i = new n.Geometry(),
  53881. r = new n.LineBasicMaterial({
  53882. vertexColors: n.VertexColors
  53883. })
  53884. ;(this.color1 = new n.Color(4473924)), (this.color2 = new n.Color(8947848))
  53885. for (var o = -e; o <= e; o += t) {
  53886. i.vertices.push(new n.Vector3(-e, 0, o), new n.Vector3(e, 0, o), new n.Vector3(o, 0, -e), new n.Vector3(o, 0, e))
  53887. var a = 0 === o ? this.color1 : this.color2
  53888. i.colors.push(a, a, a, a)
  53889. }
  53890. n.LineSegments.call(this, i, r)
  53891. }),
  53892. (n.GridHelper.prototype = Object.create(n.LineSegments.prototype)),
  53893. (n.GridHelper.prototype.constructor = n.GridHelper),
  53894. (n.GridHelper.prototype.setColors = function (e, t) {
  53895. this.color1.set(e), this.color2.set(t), (this.geometry.colorsNeedUpdate = !0)
  53896. }),
  53897. (n.HemisphereLightHelper = function (e, t) {
  53898. n.Object3D.call(this), (this.light = e), this.light.updateMatrixWorld(), (this.matrix = e.matrixWorld), (this.matrixAutoUpdate = !1), (this.colors = [new n.Color(), new n.Color()])
  53899. var i = new n.SphereGeometry(t, 4, 2)
  53900. i.rotateX(-Math.PI / 2)
  53901. for (var r = 0, o = 8; r < o; r++) i.faces[r].color = this.colors[r < 4 ? 0 : 1]
  53902. var a = new n.MeshBasicMaterial({
  53903. vertexColors: n.FaceColors,
  53904. wireframe: !0
  53905. })
  53906. ;(this.lightSphere = new n.Mesh(i, a)), this.add(this.lightSphere), this.update()
  53907. }),
  53908. (n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype)),
  53909. (n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper),
  53910. (n.HemisphereLightHelper.prototype.dispose = function () {
  53911. this.lightSphere.geometry.dispose(), this.lightSphere.material.dispose()
  53912. }),
  53913. (n.HemisphereLightHelper.prototype.update = (function () {
  53914. var e = new n.Vector3()
  53915. return function () {
  53916. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  53917. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  53918. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  53919. (this.lightSphere.geometry.colorsNeedUpdate = !0)
  53920. }
  53921. })()),
  53922. (n.PointLightHelper = function (e, t) {
  53923. ;(this.light = e), this.light.updateMatrixWorld()
  53924. var i = new n.SphereGeometry(t, 4, 2),
  53925. r = new n.MeshBasicMaterial({
  53926. wireframe: !0,
  53927. fog: !1
  53928. })
  53929. r.color.copy(this.light.color).multiplyScalar(this.light.intensity), n.Mesh.call(this, i, r), (this.matrix = this.light.matrixWorld), (this.matrixAutoUpdate = !1)
  53930. }),
  53931. (n.PointLightHelper.prototype = Object.create(n.Mesh.prototype)),
  53932. (n.PointLightHelper.prototype.constructor = n.PointLightHelper),
  53933. (n.PointLightHelper.prototype.dispose = function () {
  53934. this.geometry.dispose(), this.material.dispose()
  53935. }),
  53936. (n.PointLightHelper.prototype.update = function () {
  53937. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  53938. }),
  53939. (n.SkeletonHelper = function (e) {
  53940. this.bones = this.getBoneList(e)
  53941. for (var t = new n.Geometry(), i = 0; i < this.bones.length; i++) {
  53942. var r = this.bones[i]
  53943. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3()), t.vertices.push(new n.Vector3()), t.colors.push(new n.Color(0, 0, 1)), t.colors.push(new n.Color(0, 1, 0)))
  53944. }
  53945. t.dynamic = !0
  53946. var o = new n.LineBasicMaterial({
  53947. vertexColors: n.VertexColors,
  53948. depthTest: !1,
  53949. depthWrite: !1,
  53950. transparent: !0
  53951. })
  53952. n.LineSegments.call(this, t, o), (this.root = e), (this.matrix = e.matrixWorld), (this.matrixAutoUpdate = !1), this.update()
  53953. }),
  53954. (n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype)),
  53955. (n.SkeletonHelper.prototype.constructor = n.SkeletonHelper),
  53956. (n.SkeletonHelper.prototype.getBoneList = function (e) {
  53957. var t = []
  53958. e instanceof n.Bone && t.push(e)
  53959. for (var i = 0; i < e.children.length; i++) t.push.apply(t, this.getBoneList(e.children[i]))
  53960. return t
  53961. }),
  53962. (n.SkeletonHelper.prototype.update = function () {
  53963. for (var e = this.geometry, t = new n.Matrix4().getInverse(this.root.matrixWorld), i = new n.Matrix4(), r = 0, o = 0; o < this.bones.length; o++) {
  53964. var a = this.bones[o]
  53965. a.parent instanceof n.Bone &&
  53966. (i.multiplyMatrices(t, a.matrixWorld), e.vertices[r].setFromMatrixPosition(i), i.multiplyMatrices(t, a.parent.matrixWorld), e.vertices[r + 1].setFromMatrixPosition(i), (r += 2))
  53967. }
  53968. ;(e.verticesNeedUpdate = !0), e.computeBoundingSphere()
  53969. }),
  53970. (n.SpotLightHelper = function (e) {
  53971. n.Object3D.call(this), (this.light = e), this.light.updateMatrixWorld(), (this.matrix = e.matrixWorld), (this.matrixAutoUpdate = !1)
  53972. var t = new n.CylinderGeometry(0, 1, 1, 8, 1, !0)
  53973. t.translate(0, -0.5, 0), t.rotateX(-Math.PI / 2)
  53974. var i = new n.MeshBasicMaterial({
  53975. wireframe: !0,
  53976. fog: !1
  53977. })
  53978. ;(this.cone = new n.Mesh(t, i)), this.add(this.cone), this.update()
  53979. }),
  53980. (n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype)),
  53981. (n.SpotLightHelper.prototype.constructor = n.SpotLightHelper),
  53982. (n.SpotLightHelper.prototype.dispose = function () {
  53983. this.cone.geometry.dispose(), this.cone.material.dispose()
  53984. }),
  53985. (n.SpotLightHelper.prototype.update = (function () {
  53986. var e = new n.Vector3(),
  53987. t = new n.Vector3()
  53988. return function () {
  53989. var i = this.light.distance ? this.light.distance : 1e4,
  53990. n = i * Math.tan(this.light.angle)
  53991. this.cone.scale.set(n, n, i),
  53992. e.setFromMatrixPosition(this.light.matrixWorld),
  53993. t.setFromMatrixPosition(this.light.target.matrixWorld),
  53994. this.cone.lookAt(t.sub(e)),
  53995. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  53996. }
  53997. })()),
  53998. (n.VertexNormalsHelper = function (e, t, i, r) {
  53999. ;(this.object = e), (this.size = void 0 !== t ? t : 1)
  54000. var o = void 0 !== i ? i : 16711680,
  54001. a = void 0 !== r ? r : 1,
  54002. s = 0,
  54003. l = this.object.geometry
  54004. l instanceof n.Geometry ? (s = 3 * l.faces.length) : l instanceof n.BufferGeometry && (s = l.attributes.normal.count)
  54005. var c = new n.BufferGeometry(),
  54006. h = new n.Float32Attribute(2 * s * 3, 3)
  54007. c.addAttribute('position', h),
  54008. n.LineSegments.call(
  54009. this,
  54010. c,
  54011. new n.LineBasicMaterial({
  54012. color: o,
  54013. linewidth: a
  54014. })
  54015. ),
  54016. (this.matrixAutoUpdate = !1),
  54017. this.update()
  54018. }),
  54019. (n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype)),
  54020. (n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper),
  54021. (n.VertexNormalsHelper.prototype.update = (function () {
  54022. var e = new n.Vector3(),
  54023. t = new n.Vector3(),
  54024. i = new n.Matrix3()
  54025. return function () {
  54026. var r = ['a', 'b', 'c']
  54027. this.object.updateMatrixWorld(!0), i.getNormalMatrix(this.object.matrixWorld)
  54028. var o = this.object.matrixWorld,
  54029. a = this.geometry.attributes.position,
  54030. s = this.object.geometry
  54031. if (s instanceof n.Geometry)
  54032. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  54033. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  54034. var m = l[p[r[f]]],
  54035. v = p.vertexNormals[f]
  54036. e.copy(m).applyMatrix4(o), t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e), a.setXYZ(h, e.x, e.y, e.z), (h += 1), a.setXYZ(h, t.x, t.y, t.z), (h += 1)
  54037. }
  54038. else if (s instanceof n.BufferGeometry)
  54039. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  54040. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  54041. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  54042. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  54043. a.setXYZ(h, e.x, e.y, e.z),
  54044. (h += 1),
  54045. a.setXYZ(h, t.x, t.y, t.z),
  54046. (h += 1)
  54047. return (a.needsUpdate = !0), this
  54048. }
  54049. })()),
  54050. (n.WireframeHelper = function (e, t) {
  54051. var i = void 0 !== t ? t : 16777215
  54052. n.LineSegments.call(
  54053. this,
  54054. new n.WireframeGeometry(e.geometry),
  54055. new n.LineBasicMaterial({
  54056. color: i
  54057. })
  54058. ),
  54059. (this.matrix = e.matrixWorld),
  54060. (this.matrixAutoUpdate = !1)
  54061. }),
  54062. (n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype)),
  54063. (n.WireframeHelper.prototype.constructor = n.WireframeHelper),
  54064. (n.ImmediateRenderObject = function (e) {
  54065. n.Object3D.call(this), (this.material = e), (this.render = function (e) {})
  54066. }),
  54067. (n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype)),
  54068. (n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject),
  54069. (n.MorphBlendMesh = function (e, t) {
  54070. n.Mesh.call(this, e, t), (this.animationsMap = {}), (this.animationsList = [])
  54071. var i = this.geometry.morphTargets.length,
  54072. r = '__default',
  54073. o = 0,
  54074. a = i - 1,
  54075. s = i / 1
  54076. this.createAnimation(r, o, a, s), this.setAnimationWeight(r, 1)
  54077. }),
  54078. (n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype)),
  54079. (n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh),
  54080. (n.MorphBlendMesh.prototype.createAnimation = function (e, t, i, n) {
  54081. var r = {
  54082. start: t,
  54083. end: i,
  54084. length: i - t + 1,
  54085. fps: n,
  54086. duration: (i - t) / n,
  54087. lastFrame: 0,
  54088. currentFrame: 0,
  54089. active: !1,
  54090. time: 0,
  54091. direction: 1,
  54092. weight: 1,
  54093. directionBackwards: !1,
  54094. mirroredLoop: !1
  54095. }
  54096. ;(this.animationsMap[e] = r), this.animationsList.push(r)
  54097. }),
  54098. (n.MorphBlendMesh.prototype.autoCreateAnimations = function (e) {
  54099. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  54100. var s = r.morphTargets[o],
  54101. l = s.name.match(i)
  54102. if (l && l.length > 1) {
  54103. var c = l[1]
  54104. n[c] ||
  54105. (n[c] = {
  54106. start: 1 / 0,
  54107. end: -(1 / 0)
  54108. })
  54109. var h = n[c]
  54110. o < h.start && (h.start = o), o > h.end && (h.end = o), t || (t = c)
  54111. }
  54112. }
  54113. for (var c in n) {
  54114. var h = n[c]
  54115. this.createAnimation(c, h.start, h.end, e)
  54116. }
  54117. this.firstAnimation = t
  54118. }),
  54119. (n.MorphBlendMesh.prototype.setAnimationDirectionForward = function (e) {
  54120. var t = this.animationsMap[e]
  54121. t && ((t.direction = 1), (t.directionBackwards = !1))
  54122. }),
  54123. (n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function (e) {
  54124. var t = this.animationsMap[e]
  54125. t && ((t.direction = -1), (t.directionBackwards = !0))
  54126. }),
  54127. (n.MorphBlendMesh.prototype.setAnimationFPS = function (e, t) {
  54128. var i = this.animationsMap[e]
  54129. i && ((i.fps = t), (i.duration = (i.end - i.start) / i.fps))
  54130. }),
  54131. (n.MorphBlendMesh.prototype.setAnimationDuration = function (e, t) {
  54132. var i = this.animationsMap[e]
  54133. i && ((i.duration = t), (i.fps = (i.end - i.start) / i.duration))
  54134. }),
  54135. (n.MorphBlendMesh.prototype.setAnimationWeight = function (e, t) {
  54136. var i = this.animationsMap[e]
  54137. i && (i.weight = t)
  54138. }),
  54139. (n.MorphBlendMesh.prototype.setAnimationTime = function (e, t) {
  54140. var i = this.animationsMap[e]
  54141. i && (i.time = t)
  54142. }),
  54143. (n.MorphBlendMesh.prototype.getAnimationTime = function (e) {
  54144. var t = 0,
  54145. i = this.animationsMap[e]
  54146. return i && (t = i.time), t
  54147. }),
  54148. (n.MorphBlendMesh.prototype.getAnimationDuration = function (e) {
  54149. var t = -1,
  54150. i = this.animationsMap[e]
  54151. return i && (t = i.duration), t
  54152. }),
  54153. (n.MorphBlendMesh.prototype.playAnimation = function (e) {
  54154. var t = this.animationsMap[e]
  54155. t ? ((t.time = 0), (t.active = !0)) : console.warn('THREE.MorphBlendMesh: animation[' + e + '] undefined in .playAnimation()')
  54156. }),
  54157. (n.MorphBlendMesh.prototype.stopAnimation = function (e) {
  54158. var t = this.animationsMap[e]
  54159. t && (t.active = !1)
  54160. }),
  54161. (n.MorphBlendMesh.prototype.update = function (e) {
  54162. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  54163. var r = this.animationsList[t]
  54164. if (r.active) {
  54165. var o = r.duration / r.length
  54166. ;(r.time += r.direction * e),
  54167. r.mirroredLoop
  54168. ? (r.time > r.duration || r.time < 0) &&
  54169. ((r.direction *= -1), r.time > r.duration && ((r.time = r.duration), (r.directionBackwards = !0)), r.time < 0 && ((r.time = 0), (r.directionBackwards = !1)))
  54170. : ((r.time = r.time % r.duration), r.time < 0 && (r.time += r.duration))
  54171. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1),
  54172. s = r.weight
  54173. a !== r.currentFrame &&
  54174. ((this.morphTargetInfluences[r.lastFrame] = 0),
  54175. (this.morphTargetInfluences[r.currentFrame] = 1 * s),
  54176. (this.morphTargetInfluences[a] = 0),
  54177. (r.lastFrame = r.currentFrame),
  54178. (r.currentFrame = a))
  54179. var l = (r.time % o) / o
  54180. r.directionBackwards && (l = 1 - l),
  54181. r.currentFrame !== r.lastFrame
  54182. ? ((this.morphTargetInfluences[r.currentFrame] = l * s), (this.morphTargetInfluences[r.lastFrame] = (1 - l) * s))
  54183. : (this.morphTargetInfluences[r.currentFrame] = s)
  54184. }
  54185. }
  54186. }),
  54187. 'undefined' != typeof i ? ('undefined' != typeof t && t.exports && (i = t.exports = n), (i.THREE = n)) : (this.THREE = n)
  54188. window.THREE = n
  54189. getObjLoader()
  54190. initByTHREE(THREE)
  54191. //getWebXRManager()
  54192. },
  54193. {}
  54194. ]
  54195. },
  54196. {},
  54197. [116]
  54198. )
  54199. class PanTransGuide {
  54200. constructor(player) {
  54201. this.player = player
  54202. this.currentIndex = 0
  54203. this.getNodes()
  54204. }
  54205. getNodes() {
  54206. this.nodes = []
  54207. let path = this.player.path
  54208. let last
  54209. let index = this.player.model.heroLocations.findIndex(e => e.name == '沉浸看展') //先去掉之前旧的数据
  54210. if (index > -1) {
  54211. let locations = this.player.model.heroLocations[index].heroLocations
  54212. this.player.model.heroLocations.splice(index, 1)
  54213. }
  54214. let get = (e, originItem) => {
  54215. if (e.cameraMode != 'panorama') {
  54216. e.originItem = originItem
  54217. this.nodes.push(e)
  54218. return (last = null) //断连
  54219. }
  54220. if (last) {
  54221. e.visited = true
  54222. path.setWarpDestination(e)
  54223. path.setWarpDestPano()
  54224. let A = path.getHeroPano(last),
  54225. B = path.warpDestPano
  54226. if (e.momentTour == 'black' && A != B) {
  54227. path.nodes = [A.id, B.id] //直接加入
  54228. } else {
  54229. path.nodes = path.findShortestPath(A, B)
  54230. if (path.nodes == null) {
  54231. //两个点之间不相通
  54232. console.log('两个点之间不相通', A.id, B.id)
  54233. path.nodes = [A.id, B.id] //直接加入
  54234. }
  54235. }
  54236. let wholeDis = 0,
  54237. disSections = []
  54238. path.nodes.forEach((cur, i) => {
  54239. if (i == 0) return
  54240. let prePano = this.player.model.panos.get(path.nodes[i - 1])
  54241. let curPano = this.player.model.panos.get(cur)
  54242. let dis = prePano.position.distanceTo(curPano.position)
  54243. disSections.push(dis)
  54244. wholeDis += dis
  54245. }, 0)
  54246. let quaStart = last.quaternion
  54247. let quaEnd = e.quaternion
  54248. path.nodes.forEach((panoId, j) => {
  54249. if (j == 0) {
  54250. if (path.nodes.length == 1) return this.nodes.push({ panoId, quaternion: quaEnd }) //原地旋转
  54251. if (!last) return //和上一段末尾重复
  54252. return this.nodes.push({ panoId, quaternion: quaStart })
  54253. }
  54254. let r = disSections[j - 1] / wholeDis
  54255. let quaternion = quaStart.clone()
  54256. lerp.quaternion(quaternion, quaEnd)(r)
  54257. this.nodes.push({ panoId, quaternion })
  54258. })
  54259. }
  54260. last = e
  54261. }
  54262. this.player.model.heroLocations.forEach((e, i) => {
  54263. if (e.heroLocations) {
  54264. e.heroLocations.forEach((a, j) => get(a, [i, j]))
  54265. } else {
  54266. get(e, [i, 0])
  54267. }
  54268. })
  54269. //补 因为last前一个可能不是panorama,导致last没加进nodes
  54270. if (last && !last.visited) {
  54271. get(last)
  54272. }
  54273. }
  54274. go(axis) {
  54275. if (this.player.flying) return
  54276. let aimNode
  54277. let cur = this.nodes[this.currentIndex]
  54278. if (cur.panoId != this.player.currentPano.id && player.mode == 'panorama') {
  54279. //已走动){//已走动
  54280. let curs = this.nodes.filter(e => e.panoId == this.player.currentPano)
  54281. curs.sort((a, b) => {
  54282. //如果有多个,找到和currentIndex最接近的,可能是刚走过的
  54283. let indexA = this.nodes.indexOf(a)
  54284. let indexB = this.nodes.indexOf(b)
  54285. return Math.abs(indexA - this.currentIndex) < Math.abs(indexB - this.currentIndex)
  54286. })
  54287. cur = curs[0]
  54288. if (!cur) {
  54289. //不在道上 . 找离当前位置最近的node
  54290. let disMap = new Map()
  54291. let nodes_ = this.nodes.filter(e => !e.originItem)
  54292. nodes_.forEach(e => {
  54293. disMap.set(e, player.currentPano.position.distanceToSquared(this.player.model.panos.get(e.panoId).position))
  54294. })
  54295. let sorted = nodes_.slice().sort((a, b) => {
  54296. return disMap.get(a) - disMap.get(b)
  54297. })
  54298. this.currentIndex = this.nodes.indexOf(sorted[0]) //next
  54299. if (axis == -1) {
  54300. this.moveIndex(-1)
  54301. }
  54302. aimNode = this.nodes[this.currentIndex]
  54303. }
  54304. }
  54305. let lastIndex = this.currentIndex
  54306. if (!aimNode) {
  54307. this.moveIndex(axis)
  54308. aimNode = this.nodes[this.currentIndex]
  54309. }
  54310. if (aimNode.originItem) {
  54311. //要飞出的,直接用导览飞
  54312. player.director.setDestinationItem(aimNode.originItem)
  54313. player.director.goToDestination()
  54314. return
  54315. }
  54316. //let dis = this.player.model.panos.get(aimNode.panoId).position.distanceTo(this.player.position)
  54317. let moveStyle = (lastIndex == 0 && axis == -1) || (this.currentIndex == 0 && axis != -1) ? 'blackToPano' : 'flyToPano'
  54318. this.player[moveStyle]({ pano: this.player.model.panos.get(aimNode.panoId), quaternion: aimNode.quaternion }, () => {
  54319. //更新导览进度条
  54320. player.director.setDestinationItem(player.director.findNearestItem(true, true))
  54321. })
  54322. }
  54323. moveIndex(step) {
  54324. this.currentIndex += step + this.nodes.length
  54325. this.currentIndex %= this.nodes.length
  54326. return this.currentIndex
  54327. }
  54328. }
  54329. //2025新的需求 沉浸看展直接使用导览
  54330. window.tourPlayCtl = {
  54331. go(axis) {
  54332. player.guider2.go(axis)
  54333. }
  54334. }
  54335. /*
  54336. function getWebXRManager(){
  54337. class ArrayCamera extends THREE.PerspectiveCamera {
  54338. constructor(array = []) {
  54339. super();
  54340. this.isArrayCamera = true;
  54341. this.cameras = array;
  54342. }
  54343. }
  54344. function WebGLAnimation() {
  54345. let context = null;
  54346. let isAnimating = false;
  54347. let animationLoop = null;
  54348. let requestId = null;
  54349. function onAnimationFrame(time, frame) {
  54350. animationLoop(time, frame);
  54351. requestId = context.requestAnimationFrame(onAnimationFrame);
  54352. }
  54353. return {
  54354. start: function () {
  54355. if (isAnimating === true) return;
  54356. if (animationLoop === null) return;
  54357. requestId = context.requestAnimationFrame(onAnimationFrame);
  54358. isAnimating = true;
  54359. },
  54360. stop: function () {
  54361. context.cancelAnimationFrame(requestId);
  54362. isAnimating = false;
  54363. },
  54364. setAnimationLoop: function (callback) {
  54365. animationLoop = callback;
  54366. },
  54367. setContext: function (value) {
  54368. context = value;
  54369. }
  54370. };
  54371. }
  54372. function WebXRManager( renderer, gl ) {
  54373. var scope = this;
  54374. var session = null;
  54375. // var framebufferScaleFactor = 1.0;
  54376. var referenceSpace = null;
  54377. var referenceSpaceType = 'local-floor';
  54378. var pose = null;
  54379. var controllers = [];
  54380. var sortedInputSources = [];
  54381. function isPresenting() {
  54382. return session !== null && referenceSpace !== null;
  54383. }
  54384. //
  54385. var cameraL = new THREE.PerspectiveCamera();
  54386. cameraL.layers.enable( 1 );
  54387. cameraL.viewport = new THREE.Vector4();
  54388. var cameraR = new THREE.PerspectiveCamera();
  54389. cameraR.layers.enable( 2 );
  54390. cameraR.viewport = new THREE.Vector4();
  54391. var cameraVR = new ArrayCamera( [ cameraL, cameraR ] );
  54392. cameraVR.layers.enable( 1 );
  54393. cameraVR.layers.enable( 2 );
  54394. //
  54395. this.enabled = false;
  54396. this.getController = function ( id ) {
  54397. var controller = controllers[ id ];
  54398. if ( controller === undefined ) {
  54399. controller = new THREE.Group();
  54400. controller.matrixAutoUpdate = false;
  54401. controller.visible = false;
  54402. controllers[ id ] = controller;
  54403. }
  54404. return controller;
  54405. };
  54406. //
  54407. function onSessionEvent( event ) {
  54408. for ( var i = 0; i < controllers.length; i ++ ) {
  54409. if ( sortedInputSources[ i ] === event.inputSource ) {
  54410. controllers[ i ].dispatchEvent( { type: event.type } );
  54411. }
  54412. }
  54413. }
  54414. function onSessionEnd() {
  54415. renderer.setFramebuffer( null );
  54416. renderer.setRenderTarget( renderer.getRenderTarget() ); // Hack #15830
  54417. animation.stop();
  54418. scope.dispatchEvent( { type: 'sessionend' } );
  54419. }
  54420. function onRequestReferenceSpace( value ) {
  54421. referenceSpace = value;
  54422. animation.setContext( session );
  54423. animation.start();
  54424. scope.dispatchEvent( { type: 'sessionstart' } );
  54425. }
  54426. this.setFramebufferScaleFactor = function ( ) {
  54427. // framebufferScaleFactor = value;
  54428. };
  54429. this.setReferenceSpaceType = function ( value ) {
  54430. referenceSpaceType = value;
  54431. };
  54432. this.getSession = function () {
  54433. return session;
  54434. };
  54435. this.setSession = function ( value ) {
  54436. session = value;
  54437. if ( session !== null ) {
  54438. session.addEventListener( 'select', onSessionEvent );
  54439. session.addEventListener( 'selectstart', onSessionEvent );
  54440. session.addEventListener( 'selectend', onSessionEvent );
  54441. session.addEventListener( 'end', onSessionEnd );
  54442. // eslint-disable-next-line no-undef
  54443. session.updateRenderState( { baseLayer: new XRWebGLLayer( session, gl, { antialias: false } ) } );
  54444. session.requestReferenceSpace( referenceSpaceType ).then( onRequestReferenceSpace );
  54445. //
  54446. session.addEventListener( 'inputsourceschange', updateInputSources );
  54447. updateInputSources();
  54448. }
  54449. };
  54450. function updateInputSources() {
  54451. for ( var i = 0; i < controllers.length; i ++ ) {
  54452. sortedInputSources[ i ] = findInputSource( i );
  54453. }
  54454. }
  54455. function findInputSource( id ) {
  54456. var inputSources = session.inputSources;
  54457. for ( var i = 0; i < inputSources.length; i ++ ) {
  54458. var inputSource = inputSources[ i ];
  54459. var handedness = inputSource.handedness;
  54460. if ( id === 0 && ( handedness === 'none' || handedness === 'right' ) ) return inputSource;
  54461. if ( id === 1 && ( handedness === 'left' ) ) return inputSource;
  54462. }
  54463. }
  54464. //
  54465. function updateCamera( camera, parent ) {
  54466. if ( parent === null ) {
  54467. camera.matrixWorld.copy( camera.matrix );
  54468. } else {
  54469. camera.matrixWorld.multiplyMatrices( parent.matrixWorld, camera.matrix );
  54470. }
  54471. camera.matrixWorldInverse.getInverse( camera.matrixWorld );
  54472. }
  54473. this.getCamera = function ( camera ) {
  54474. if ( isPresenting() ) {
  54475. var parent = camera.parent;
  54476. var cameras = cameraVR.cameras;
  54477. updateCamera( cameraVR, parent );
  54478. for ( var i = 0; i < cameras.length; i ++ ) {
  54479. updateCamera( cameras[ i ], parent );
  54480. }
  54481. // update camera and its children
  54482. camera.matrixWorld.copy( cameraVR.matrixWorld );
  54483. var children = camera.children;
  54484. for ( var i = 0, l = children.length; i < l; i ++ ) {
  54485. children[ i ].updateMatrixWorld( true );
  54486. }
  54487. setProjectionFromUnion( cameraVR, cameraL, cameraR );
  54488. return cameraVR;
  54489. }
  54490. return camera;
  54491. };
  54492. this.isPresenting = isPresenting;
  54493. // Animation Loop
  54494. var onAnimationFrameCallback = null;
  54495. function onAnimationFrame( time, frame ) {
  54496. pose = frame.getViewerPose( referenceSpace );
  54497. if ( pose !== null ) {
  54498. var views = pose.views;
  54499. var baseLayer = session.renderState.baseLayer;
  54500. renderer.setFramebuffer( baseLayer.framebuffer );
  54501. for ( var i = 0; i < views.length; i ++ ) {
  54502. var view = views[ i ];
  54503. var viewport = baseLayer.getViewport( view );
  54504. var viewMatrix = view.transform.inverse.matrix;
  54505. var camera = cameraVR.cameras[ i ];
  54506. camera.matrix.fromArray( viewMatrix ).getInverse( camera.matrix );
  54507. camera.projectionMatrix.fromArray( view.projectionMatrix );
  54508. camera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height );
  54509. if ( i === 0 ) {
  54510. cameraVR.matrix.copy( camera.matrix );
  54511. }
  54512. }
  54513. }
  54514. //
  54515. for ( var i = 0; i < controllers.length; i ++ ) {
  54516. var controller = controllers[ i ];
  54517. var inputSource = sortedInputSources[ i ];
  54518. if ( inputSource ) {
  54519. var inputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace );
  54520. if ( inputPose !== null ) {
  54521. controller.matrix.fromArray( inputPose.transform.matrix );
  54522. controller.matrix.decompose( controller.position, controller.rotation, controller.scale );
  54523. controller.visible = true;
  54524. continue;
  54525. }
  54526. }
  54527. controller.visible = false;
  54528. }
  54529. if ( onAnimationFrameCallback ) onAnimationFrameCallback( time );
  54530. }
  54531. var animation = new WebGLAnimation();
  54532. animation.setAnimationLoop( onAnimationFrame );
  54533. this.setAnimationLoop = function ( callback ) {
  54534. onAnimationFrameCallback = callback;
  54535. };
  54536. this.dispose = function () {};
  54537. // DEPRECATED
  54538. this.getStandingMatrix = function () {
  54539. console.warn( 'THREE.WebXRManager: getStandingMatrix() is no longer needed.' );
  54540. return new THREE.Matrix4();
  54541. };
  54542. this.getDevice = function () {
  54543. console.warn( 'THREE.WebXRManager: getDevice() has been deprecated.' );
  54544. };
  54545. this.setDevice = function () {
  54546. console.warn( 'THREE.WebXRManager: setDevice() has been deprecated.' );
  54547. };
  54548. this.setFrameOfReferenceType = function () {
  54549. console.warn( 'THREE.WebXRManager: setFrameOfReferenceType() has been deprecated.' );
  54550. };
  54551. this.submitFrame = function () {};
  54552. }
  54553. Object.assign( WebXRManager.prototype, THREE.EventDispatcher.prototype );
  54554. THREE.WebXRManager = WebXRManager
  54555. }
  54556. function getWebXRManager(){
  54557. class ArrayCamera extends THREE.PerspectiveCamera {
  54558. constructor(array = []) {
  54559. super();
  54560. this.isArrayCamera = true;
  54561. this.cameras = array;
  54562. }
  54563. }
  54564. class WebXRController {
  54565. constructor() {
  54566. this._targetRay = null;
  54567. this._grip = null;
  54568. this._hand = null;
  54569. }
  54570. getHandSpace() {
  54571. if (this._hand === null) {
  54572. this._hand = new THREE.Group();
  54573. this._hand.matrixAutoUpdate = false;
  54574. this._hand.visible = false;
  54575. this._hand.joints = {};
  54576. this._hand.inputState = {
  54577. pinching: false
  54578. };
  54579. }
  54580. return this._hand;
  54581. }
  54582. getTargetRaySpace() {
  54583. if (this._targetRay === null) {
  54584. this._targetRay = new THREE.Group();
  54585. this._targetRay.matrixAutoUpdate = false;
  54586. this._targetRay.visible = false;
  54587. this._targetRay.hasLinearVelocity = false;
  54588. this._targetRay.linearVelocity = new THREE.Vector3();
  54589. this._targetRay.hasAngularVelocity = false;
  54590. this._targetRay.angularVelocity = new THREE.Vector3();
  54591. }
  54592. return this._targetRay;
  54593. }
  54594. getGripSpace() {
  54595. if (this._grip === null) {
  54596. this._grip = new THREE.Group();
  54597. this._grip.matrixAutoUpdate = false;
  54598. this._grip.visible = false;
  54599. this._grip.hasLinearVelocity = false;
  54600. this._grip.linearVelocity = new THREE.Vector3();
  54601. this._grip.hasAngularVelocity = false;
  54602. this._grip.angularVelocity = new THREE.Vector3();
  54603. }
  54604. return this._grip;
  54605. }
  54606. dispatchEvent(event) {
  54607. if (this._targetRay !== null) {
  54608. this._targetRay.dispatchEvent(event);
  54609. }
  54610. if (this._grip !== null) {
  54611. this._grip.dispatchEvent(event);
  54612. }
  54613. if (this._hand !== null) {
  54614. this._hand.dispatchEvent(event);
  54615. }
  54616. return this;
  54617. }
  54618. disconnect(inputSource) {
  54619. this.dispatchEvent({
  54620. type: 'disconnected',
  54621. data: inputSource
  54622. });
  54623. if (this._targetRay !== null) {
  54624. this._targetRay.visible = false;
  54625. }
  54626. if (this._grip !== null) {
  54627. this._grip.visible = false;
  54628. }
  54629. if (this._hand !== null) {
  54630. this._hand.visible = false;
  54631. }
  54632. return this;
  54633. }
  54634. update(inputSource, frame, referenceSpace) {
  54635. let inputPose = null;
  54636. let gripPose = null;
  54637. let handPose = null;
  54638. const targetRay = this._targetRay;
  54639. const grip = this._grip;
  54640. const hand = this._hand;
  54641. if (inputSource && frame.session.visibilityState !== 'visible-blurred') {
  54642. if (hand && inputSource.hand) {
  54643. handPose = true;
  54644. for (const inputjoint of inputSource.hand.values()) {
  54645. // Update the joints groups with the XRJoint poses
  54646. const jointPose = frame.getJointPose(inputjoint, referenceSpace);
  54647. if (hand.joints[inputjoint.jointName] === undefined) {
  54648. // The transform of this joint will be updated with the joint pose on each frame
  54649. const joint = new THREE.Group();
  54650. joint.matrixAutoUpdate = false;
  54651. joint.visible = false;
  54652. hand.joints[inputjoint.jointName] = joint; // ??
  54653. hand.add(joint);
  54654. }
  54655. const joint = hand.joints[inputjoint.jointName];
  54656. if (jointPose !== null) {
  54657. joint.matrix.fromArray(jointPose.transform.matrix);
  54658. joint.matrix.decompose(joint.position, joint.rotation, joint.scale);
  54659. joint.jointRadius = jointPose.radius;
  54660. }
  54661. joint.visible = jointPose !== null;
  54662. } // Custom events
  54663. // Check pinchz
  54664. const indexTip = hand.joints['index-finger-tip'];
  54665. const thumbTip = hand.joints['thumb-tip'];
  54666. const distance = indexTip.position.distanceTo(thumbTip.position);
  54667. const distanceToPinch = 0.02;
  54668. const threshold = 0.005;
  54669. if (hand.inputState.pinching && distance > distanceToPinch + threshold) {
  54670. hand.inputState.pinching = false;
  54671. this.dispatchEvent({
  54672. type: 'pinchend',
  54673. handedness: inputSource.handedness,
  54674. target: this
  54675. });
  54676. } else if (!hand.inputState.pinching && distance <= distanceToPinch - threshold) {
  54677. hand.inputState.pinching = true;
  54678. this.dispatchEvent({
  54679. type: 'pinchstart',
  54680. handedness: inputSource.handedness,
  54681. target: this
  54682. });
  54683. }
  54684. } else {
  54685. if (grip !== null && inputSource.gripSpace) {
  54686. gripPose = frame.getPose(inputSource.gripSpace, referenceSpace);
  54687. if (gripPose !== null) {
  54688. grip.matrix.fromArray(gripPose.transform.matrix);
  54689. grip.matrix.decompose(grip.position, grip.rotation, grip.scale);
  54690. if (gripPose.linearVelocity) {
  54691. grip.hasLinearVelocity = true;
  54692. grip.linearVelocity.copy(gripPose.linearVelocity);
  54693. } else {
  54694. grip.hasLinearVelocity = false;
  54695. }
  54696. if (gripPose.angularVelocity) {
  54697. grip.hasAngularVelocity = true;
  54698. grip.angularVelocity.copy(gripPose.angularVelocity);
  54699. } else {
  54700. grip.hasAngularVelocity = false;
  54701. }
  54702. }
  54703. }
  54704. }
  54705. if (targetRay !== null) {
  54706. 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
  54707. if (inputPose === null && gripPose !== null) {
  54708. inputPose = gripPose;
  54709. }
  54710. if (inputPose !== null) {
  54711. targetRay.matrix.fromArray(inputPose.transform.matrix);
  54712. targetRay.matrix.decompose(targetRay.position, targetRay.rotation, targetRay.scale);
  54713. if (inputPose.linearVelocity) {
  54714. targetRay.hasLinearVelocity = true;
  54715. targetRay.linearVelocity.copy(inputPose.linearVelocity);
  54716. } else {
  54717. targetRay.hasLinearVelocity = false;
  54718. }
  54719. if (inputPose.angularVelocity) {
  54720. targetRay.hasAngularVelocity = true;
  54721. targetRay.angularVelocity.copy(inputPose.angularVelocity);
  54722. } else {
  54723. targetRay.hasAngularVelocity = false;
  54724. }
  54725. this.dispatchEvent(_moveEvent);
  54726. }
  54727. }
  54728. }
  54729. if (targetRay !== null) {
  54730. targetRay.visible = inputPose !== null;
  54731. }
  54732. if (grip !== null) {
  54733. grip.visible = gripPose !== null;
  54734. }
  54735. if (hand !== null) {
  54736. hand.visible = handPose !== null;
  54737. }
  54738. return this;
  54739. }
  54740. }
  54741. function WebGLAnimation() {
  54742. let context = null;
  54743. let isAnimating = false;
  54744. let animationLoop = null;
  54745. let requestId = null;
  54746. function onAnimationFrame(time, frame) {
  54747. animationLoop(time, frame);
  54748. requestId = context.requestAnimationFrame(onAnimationFrame);
  54749. }
  54750. return {
  54751. start: function () {
  54752. if (isAnimating === true) return;
  54753. if (animationLoop === null) return;
  54754. requestId = context.requestAnimationFrame(onAnimationFrame);
  54755. isAnimating = true;
  54756. },
  54757. stop: function () {
  54758. context.cancelAnimationFrame(requestId);
  54759. isAnimating = false;
  54760. },
  54761. setAnimationLoop: function (callback) {
  54762. animationLoop = callback;
  54763. },
  54764. setContext: function (value) {
  54765. context = value;
  54766. }
  54767. };
  54768. }
  54769. class WebXRManager extends THREE.EventDispatcher {
  54770. constructor(renderer, gl) {
  54771. super();
  54772. const scope = this;
  54773. let session = null;
  54774. let framebufferScaleFactor = 1.0;
  54775. let referenceSpace = null;
  54776. let referenceSpaceType = 'local-floor';
  54777. let customReferenceSpace = null;
  54778. let pose = null;
  54779. let glBinding = null;
  54780. let glProjLayer = null;
  54781. let glBaseLayer = null;
  54782. let xrFrame = null;
  54783. const attributes = gl.getContextAttributes();
  54784. let initialRenderTarget = null;
  54785. let newRenderTarget = null;
  54786. const controllers = [];
  54787. const controllerInputSources = []; //
  54788. const cameraL = new THREE.PerspectiveCamera();
  54789. cameraL.layers.enable(1);
  54790. cameraL.viewport = new THREE.Vector4();
  54791. const cameraR = new THREE.PerspectiveCamera();
  54792. cameraR.layers.enable(2);
  54793. cameraR.viewport = new THREE.Vector4();
  54794. const cameras = [cameraL, cameraR];
  54795. const cameraVR = new ArrayCamera();
  54796. cameraVR.layers.enable(1);
  54797. cameraVR.layers.enable(2);
  54798. let _currentDepthNear = null;
  54799. let _currentDepthFar = null; //
  54800. this.cameraAutoUpdate = true;
  54801. this.enabled = false;
  54802. this.isPresenting = false;
  54803. this.getController = function (index) {
  54804. let controller = controllers[index];
  54805. if (controller === undefined) {
  54806. controller = new WebXRController();
  54807. controllers[index] = controller;
  54808. }
  54809. return controller.getTargetRaySpace();
  54810. };
  54811. this.getControllerGrip = function (index) {
  54812. let controller = controllers[index];
  54813. if (controller === undefined) {
  54814. controller = new WebXRController();
  54815. controllers[index] = controller;
  54816. }
  54817. return controller.getGripSpace();
  54818. };
  54819. this.getHand = function (index) {
  54820. let controller = controllers[index];
  54821. if (controller === undefined) {
  54822. controller = new WebXRController();
  54823. controllers[index] = controller;
  54824. }
  54825. return controller.getHandSpace();
  54826. }; //
  54827. function onSessionEvent(event) {
  54828. const controllerIndex = controllerInputSources.indexOf(event.inputSource);
  54829. if (controllerIndex === -1) {
  54830. return;
  54831. }
  54832. const controller = controllers[controllerIndex];
  54833. if (controller !== undefined) {
  54834. controller.dispatchEvent({
  54835. type: event.type,
  54836. data: event.inputSource
  54837. });
  54838. }
  54839. }
  54840. function onSessionEnd() {
  54841. session.removeEventListener('select', onSessionEvent);
  54842. session.removeEventListener('selectstart', onSessionEvent);
  54843. session.removeEventListener('selectend', onSessionEvent);
  54844. session.removeEventListener('squeeze', onSessionEvent);
  54845. session.removeEventListener('squeezestart', onSessionEvent);
  54846. session.removeEventListener('squeezeend', onSessionEvent);
  54847. session.removeEventListener('end', onSessionEnd);
  54848. session.removeEventListener('inputsourceschange', onInputSourcesChange);
  54849. for (let i = 0; i < controllers.length; i++) {
  54850. const inputSource = controllerInputSources[i];
  54851. if (inputSource === null) continue;
  54852. controllerInputSources[i] = null;
  54853. controllers[i].disconnect(inputSource);
  54854. }
  54855. _currentDepthNear = null;
  54856. _currentDepthFar = null; // restore framebuffer/rendering state
  54857. renderer.setRenderTarget(initialRenderTarget);
  54858. glBaseLayer = null;
  54859. glProjLayer = null;
  54860. glBinding = null;
  54861. session = null;
  54862. newRenderTarget = null; //
  54863. animation.stop();
  54864. scope.isPresenting = false;
  54865. scope.dispatchEvent({
  54866. type: 'sessionend'
  54867. });
  54868. }
  54869. this.setFramebufferScaleFactor = function (value) {
  54870. framebufferScaleFactor = value;
  54871. if (scope.isPresenting === true) {
  54872. console.warn('THREE.WebXRManager: Cannot change framebuffer scale while presenting.');
  54873. }
  54874. };
  54875. this.setReferenceSpaceType = function (value) {
  54876. referenceSpaceType = value;
  54877. if (scope.isPresenting === true) {
  54878. console.warn('THREE.WebXRManager: Cannot change reference space type while presenting.');
  54879. }
  54880. };
  54881. this.getReferenceSpace = function () {
  54882. return customReferenceSpace || referenceSpace;
  54883. };
  54884. this.setReferenceSpace = function (space) {
  54885. customReferenceSpace = space;
  54886. };
  54887. this.getBaseLayer = function () {
  54888. return glProjLayer !== null ? glProjLayer : glBaseLayer;
  54889. };
  54890. this.getBinding = function () {
  54891. return glBinding;
  54892. };
  54893. this.getFrame = function () {
  54894. return xrFrame;
  54895. };
  54896. this.getSession = function () {
  54897. return session;
  54898. };
  54899. this.setSession = async function (value) {
  54900. session = value;
  54901. if (session !== null) {
  54902. initialRenderTarget = renderer.getCurrentRenderTarget();
  54903. session.addEventListener('select', onSessionEvent);
  54904. session.addEventListener('selectstart', onSessionEvent);
  54905. session.addEventListener('selectend', onSessionEvent);
  54906. session.addEventListener('squeeze', onSessionEvent);
  54907. session.addEventListener('squeezestart', onSessionEvent);
  54908. session.addEventListener('squeezeend', onSessionEvent);
  54909. session.addEventListener('end', onSessionEnd);
  54910. session.addEventListener('inputsourceschange', onInputSourcesChange);
  54911. if (attributes.xrCompatible !== true) {
  54912. await gl.makeXRCompatible();
  54913. }
  54914. if (session.renderState.layers === undefined || renderer.capabilities.isWebGL2 === false) {
  54915. const layerInit = {
  54916. antialias: session.renderState.layers === undefined ? attributes.antialias : true,
  54917. alpha: attributes.alpha,
  54918. depth: attributes.depth,
  54919. stencil: attributes.stencil,
  54920. framebufferScaleFactor: framebufferScaleFactor
  54921. };
  54922. glBaseLayer = new XRWebGLLayer(session, gl, layerInit);
  54923. session.updateRenderState({
  54924. baseLayer: glBaseLayer
  54925. });
  54926. newRenderTarget = new THREE.WebGLRenderTarget(glBaseLayer.framebufferWidth, glBaseLayer.framebufferHeight, {
  54927. format: THREE.RGBAFormat,
  54928. type: THREE.UnsignedByteType,
  54929. encoding: renderer.outputEncoding
  54930. });
  54931. } else {
  54932. let depthFormat = null;
  54933. let depthType = null;
  54934. let glDepthFormat = null;
  54935. if (attributes.depth) {
  54936. glDepthFormat = attributes.stencil ? gl.DEPTH24_STENCIL8 : gl.DEPTH_COMPONENT24;
  54937. depthFormat = attributes.stencil ? DepthStencilFormat : DepthFormat;
  54938. depthType = attributes.stencil ? UnsignedInt248Type : UnsignedIntType;
  54939. }
  54940. const projectionlayerInit = {
  54941. colorFormat: gl.RGBA8,
  54942. depthFormat: glDepthFormat,
  54943. scaleFactor: framebufferScaleFactor
  54944. };
  54945. glBinding = new XRWebGLBinding(session, gl);
  54946. glProjLayer = glBinding.createProjectionLayer(projectionlayerInit);
  54947. session.updateRenderState({
  54948. layers: [glProjLayer]
  54949. });
  54950. newRenderTarget = new THREE.WebGLRenderTarget(glProjLayer.textureWidth, glProjLayer.textureHeight, {
  54951. format: THREE.RGBAFormat,
  54952. type: THREE.UnsignedByteType,
  54953. depthTexture: new THREE.DepthTexture(glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat),
  54954. stencilBuffer: attributes.stencil,
  54955. encoding: renderer.outputEncoding,
  54956. samples: attributes.antialias ? 4 : 0
  54957. });
  54958. const renderTargetProperties = renderer.properties.get(newRenderTarget);
  54959. renderTargetProperties.__ignoreDepthValues = glProjLayer.ignoreDepthValues;
  54960. }
  54961. newRenderTarget.isXRRenderTarget = true; // TODO Remove this when possible, see #23278
  54962. // Set foveation to maximum.
  54963. this.setFoveation(1.0);
  54964. customReferenceSpace = null;
  54965. referenceSpace = await session.requestReferenceSpace(referenceSpaceType);
  54966. animation.setContext(session);
  54967. animation.start();
  54968. scope.isPresenting = true;
  54969. scope.dispatchEvent({
  54970. type: 'sessionstart'
  54971. });
  54972. }
  54973. };
  54974. function onInputSourcesChange(event) {
  54975. // Notify disconnected
  54976. for (let i = 0; i < event.removed.length; i++) {
  54977. const inputSource = event.removed[i];
  54978. const index = controllerInputSources.indexOf(inputSource);
  54979. if (index >= 0) {
  54980. controllerInputSources[index] = null;
  54981. controllers[index].dispatchEvent({
  54982. type: 'disconnected',
  54983. data: inputSource
  54984. });
  54985. }
  54986. } // Notify connected
  54987. for (let i = 0; i < event.added.length; i++) {
  54988. const inputSource = event.added[i];
  54989. let controllerIndex = controllerInputSources.indexOf(inputSource);
  54990. if (controllerIndex === -1) {
  54991. // Assign input source a controller that currently has no input source
  54992. for (let i = 0; i < controllers.length; i++) {
  54993. if (i >= controllerInputSources.length) {
  54994. controllerInputSources.push(inputSource);
  54995. controllerIndex = i;
  54996. break;
  54997. } else if (controllerInputSources[i] === null) {
  54998. controllerInputSources[i] = inputSource;
  54999. controllerIndex = i;
  55000. break;
  55001. }
  55002. } // If all controllers do currently receive input we ignore new ones
  55003. if (controllerIndex === -1) break;
  55004. }
  55005. const controller = controllers[controllerIndex];
  55006. if (controller) {
  55007. controller.dispatchEvent({
  55008. type: 'connected',
  55009. data: inputSource
  55010. });
  55011. }
  55012. }
  55013. } //
  55014. const cameraLPos = new THREE.Vector3();
  55015. const cameraRPos = new THREE.Vector3();
  55016. function setProjectionFromUnion(camera, cameraL, cameraR) {
  55017. cameraLPos.setFromMatrixPosition(cameraL.matrixWorld);
  55018. cameraRPos.setFromMatrixPosition(cameraR.matrixWorld);
  55019. const ipd = cameraLPos.distanceTo(cameraRPos);
  55020. const projL = cameraL.projectionMatrix.elements;
  55021. const projR = cameraR.projectionMatrix.elements; // VR systems will have identical far and near planes, and
  55022. // most likely identical top and bottom frustum extents.
  55023. // Use the left camera for these values.
  55024. const near = projL[14] / (projL[10] - 1);
  55025. const far = projL[14] / (projL[10] + 1);
  55026. const topFov = (projL[9] + 1) / projL[5];
  55027. const bottomFov = (projL[9] - 1) / projL[5];
  55028. const leftFov = (projL[8] - 1) / projL[0];
  55029. const rightFov = (projR[8] + 1) / projR[0];
  55030. const left = near * leftFov;
  55031. const right = near * rightFov; // Calculate the new camera's position offset from the
  55032. // left camera. xOffset should be roughly half `ipd`.
  55033. const zOffset = ipd / (-leftFov + rightFov);
  55034. const xOffset = zOffset * -leftFov; // TODO: Better way to apply this offset?
  55035. cameraL.matrixWorld.decompose(camera.position, camera.quaternion, camera.scale);
  55036. camera.translateX(xOffset);
  55037. camera.translateZ(zOffset);
  55038. camera.matrixWorld.compose(camera.position, camera.quaternion, camera.scale);
  55039. camera.matrixWorldInverse.copy(camera.matrixWorld).invert(); // Find the union of the frustum values of the cameras and scale
  55040. // the values so that the near plane's position does not change in world space,
  55041. // although must now be relative to the new union camera.
  55042. const near2 = near + zOffset;
  55043. const far2 = far + zOffset;
  55044. const left2 = left - xOffset;
  55045. const right2 = right + (ipd - xOffset);
  55046. const top2 = topFov * far / far2 * near2;
  55047. const bottom2 = bottomFov * far / far2 * near2;
  55048. camera.projectionMatrix.makePerspective(left2, right2, top2, bottom2, near2, far2);
  55049. }
  55050. function updateCamera(camera, parent) {
  55051. if (parent === null) {
  55052. camera.matrixWorld.copy(camera.matrix);
  55053. } else {
  55054. camera.matrixWorld.multiplyMatrices(parent.matrixWorld, camera.matrix);
  55055. }
  55056. camera.matrixWorldInverse.copy(camera.matrixWorld).invert();
  55057. }
  55058. this.updateCamera = function (camera) {
  55059. if (session === null) return;
  55060. cameraVR.near = cameraR.near = cameraL.near = camera.near;
  55061. cameraVR.far = cameraR.far = cameraL.far = camera.far;
  55062. if (_currentDepthNear !== cameraVR.near || _currentDepthFar !== cameraVR.far) {
  55063. // Note that the new renderState won't apply until the next frame. See #18320
  55064. session.updateRenderState({
  55065. depthNear: cameraVR.near,
  55066. depthFar: cameraVR.far
  55067. });
  55068. _currentDepthNear = cameraVR.near;
  55069. _currentDepthFar = cameraVR.far;
  55070. }
  55071. const parent = camera.parent;
  55072. const cameras = cameraVR.cameras;
  55073. updateCamera(cameraVR, parent);
  55074. for (let i = 0; i < cameras.length; i++) {
  55075. updateCamera(cameras[i], parent);
  55076. }
  55077. cameraVR.matrixWorld.decompose(cameraVR.position, cameraVR.quaternion, cameraVR.scale); // update user camera and its children
  55078. camera.position.copy(cameraVR.position);
  55079. camera.quaternion.copy(cameraVR.quaternion);
  55080. camera.scale.copy(cameraVR.scale);
  55081. camera.matrix.copy(cameraVR.matrix);
  55082. camera.matrixWorld.copy(cameraVR.matrixWorld);
  55083. const children = camera.children;
  55084. for (let i = 0, l = children.length; i < l; i++) {
  55085. children[i].updateMatrixWorld(true);
  55086. } // update projection matrix for proper view frustum culling
  55087. if (cameras.length === 2) {
  55088. setProjectionFromUnion(cameraVR, cameraL, cameraR);
  55089. } else {
  55090. // assume single camera setup (AR)
  55091. cameraVR.projectionMatrix.copy(cameraL.projectionMatrix);
  55092. }
  55093. };
  55094. this.getCamera = function () {
  55095. return cameraVR;
  55096. };
  55097. this.getFoveation = function () {
  55098. if (glProjLayer !== null) {
  55099. return glProjLayer.fixedFoveation;
  55100. }
  55101. if (glBaseLayer !== null) {
  55102. return glBaseLayer.fixedFoveation;
  55103. }
  55104. return undefined;
  55105. };
  55106. this.setFoveation = function (foveation) {
  55107. // 0 = no foveation = full resolution
  55108. // 1 = maximum foveation = the edges render at lower resolution
  55109. if (glProjLayer !== null) {
  55110. glProjLayer.fixedFoveation = foveation;
  55111. }
  55112. if (glBaseLayer !== null && glBaseLayer.fixedFoveation !== undefined) {
  55113. glBaseLayer.fixedFoveation = foveation;
  55114. }
  55115. }; // Animation Loop
  55116. let onAnimationFrameCallback = null;
  55117. function onAnimationFrame(time, frame) {
  55118. pose = frame.getViewerPose(customReferenceSpace || referenceSpace);
  55119. xrFrame = frame;
  55120. if (pose !== null) {
  55121. const views = pose.views;
  55122. if (glBaseLayer !== null) {
  55123. renderer.setRenderTargetFramebuffer(newRenderTarget, glBaseLayer.framebuffer);
  55124. renderer.setRenderTarget(newRenderTarget);
  55125. }
  55126. let cameraVRNeedsUpdate = false; // check if it's necessary to rebuild cameraVR's camera list
  55127. if (views.length !== cameraVR.cameras.length) {
  55128. cameraVR.cameras.length = 0;
  55129. cameraVRNeedsUpdate = true;
  55130. }
  55131. for (let i = 0; i < views.length; i++) {
  55132. const view = views[i];
  55133. let viewport = null;
  55134. if (glBaseLayer !== null) {
  55135. viewport = glBaseLayer.getViewport(view);
  55136. } else {
  55137. const glSubImage = glBinding.getViewSubImage(glProjLayer, view);
  55138. viewport = glSubImage.viewport; // For side-by-side projection, we only produce a single texture for both eyes.
  55139. if (i === 0) {
  55140. renderer.setRenderTargetTextures(newRenderTarget, glSubImage.colorTexture, glProjLayer.ignoreDepthValues ? undefined : glSubImage.depthStencilTexture);
  55141. renderer.setRenderTarget(newRenderTarget);
  55142. }
  55143. }
  55144. let camera = cameras[i];
  55145. if (camera === undefined) {
  55146. camera = new THREE.PerspectiveCamera();
  55147. camera.layers.enable(i);
  55148. camera.viewport = new THREE.Vector4();
  55149. cameras[i] = camera;
  55150. }
  55151. camera.matrix.fromArray(view.transform.matrix);
  55152. camera.projectionMatrix.fromArray(view.projectionMatrix);
  55153. camera.viewport.set(viewport.x, viewport.y, viewport.width, viewport.height);
  55154. if (i === 0) {
  55155. cameraVR.matrix.copy(camera.matrix);
  55156. }
  55157. if (cameraVRNeedsUpdate === true) {
  55158. cameraVR.cameras.push(camera);
  55159. }
  55160. }
  55161. } //
  55162. for (let i = 0; i < controllers.length; i++) {
  55163. const inputSource = controllerInputSources[i];
  55164. const controller = controllers[i];
  55165. if (inputSource !== null && controller !== undefined) {
  55166. controller.update(inputSource, frame, customReferenceSpace || referenceSpace);
  55167. }
  55168. }
  55169. if (onAnimationFrameCallback) onAnimationFrameCallback(time, frame);
  55170. xrFrame = null;
  55171. }
  55172. const animation = new WebGLAnimation();
  55173. animation.setAnimationLoop(onAnimationFrame);
  55174. this.setAnimationLoop = function (callback) {
  55175. onAnimationFrameCallback = callback;
  55176. };
  55177. this.dispose = function () {};
  55178. }
  55179. }
  55180. THREE.WebXRManager = WebXRManager
  55181. } */
  55182. /*
  55183. var addMagnifier = function(){
  55184. class Magnifier extends THREE.Object3D {
  55185. constructor () {
  55186. super()
  55187. let circleGeo = new THREE.CircleGeometry(0.1, 100);
  55188. this.camera = new THREE.PerspectiveCamera(50, 1, 0.1, 1); //fov aspect near far
  55189. this.renderTarget = new THREE.WebGLRenderTarget(256,256, {
  55190. minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter,
  55191. format: THREE.RGBAFormat ,
  55192. //type: THREE.FloatType,
  55193. //minFilter: THREE.NearestFilter,
  55194. //magFilter: THREE.NearestFilter,
  55195. } )
  55196. this.mesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  55197. side: THREE.DoubleSide ,
  55198. map: this.renderTarget.texture ,
  55199. transparent:true,
  55200. depthTest: !1,
  55201. depthWrite: !1,
  55202. }))
  55203. this.overlayMesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  55204. side: THREE.DoubleSide ,
  55205. map: Texture.load('images/crosshair.png') ,
  55206. transparent:true,
  55207. depthTest: !1,
  55208. depthWrite: !1,
  55209. }))
  55210. this.add(this.mesh)
  55211. this.add(this.overlayMesh)
  55212. player.model.add(this);
  55213. player.magnifier = this;
  55214. }
  55215. update(aimPos){
  55216. const magDistance_ = 0.3;
  55217. var playerPos = player.position
  55218. var vec = playerPos.clone().sub(aimPos).normalize().multiplyScalar(magDistance_)
  55219. this.camera.position.copy(aimPos.clone().add(vec))
  55220. this.camera.lookAt(aimPos)
  55221. var playerCamera = player.camera
  55222. this.quaternion.copy(playerCamera.quaternion);
  55223. var pos2d = player.mouse.clone();
  55224. var shift = 400;
  55225. var clientHeight = player.domElement.clientHeight
  55226. var clientY = - (pos2d.y - 1) * clientHeight / 2;
  55227. pos2d.y = clientY < 300 ? pos2d.y - shift/clientHeight : pos2d.y + shift/clientHeight
  55228. let newPos = new THREE.Vector3(pos2d.x,pos2d.y,0.7).unproject(playerCamera);
  55229. this.position.copy(newPos)
  55230. var renderer = player.sceneRenderer.renderer
  55231. var oldAutoClear = renderer.autoClear
  55232. renderer.autoClear = false
  55233. //renderer.clear( true, true, true );
  55234. renderer.render(player.sceneRenderer.scene, this.camera, this.renderTarget, true)
  55235. renderer.autoClear = oldAutoClear
  55236. }
  55237. }
  55238. new Magnifier()
  55239. }
  55240. */
  55241. /*
  55242. 笔记:
  55243. 导览缩放的几处: 1 搜索smoothZoomFovTo 2 flightStepWalk里
  55244. {
  55245. //到导览中某个点位(假设点位不重复)
  55246. var id = 73
  55247. var p = player.model.heroLocations.find(e=>e.heroLocations && e.heroLocations.find(e=>e.panoId == id))
  55248. var i = player.model.heroLocations.indexOf(p)
  55249. var p1 = p.heroLocations.find(e=>e.panoId == id)
  55250. var j = p.heroLocations.indexOf(p1)
  55251. player.director.goToHighlight([i,j])
  55252. }
  55253. 展示版导览改为就近导览,所以一开始并非第一个。如果在最后一个点上会自动从头开始
  55254. 关于pc-nav 4k
  55255. 两种选择,1 按照正常流程,因为nav为4k所以直接使用4k的tiledPanoRenderTarget, 但useUltraHighResolutionPanos需要开启才能达到4k,否则是2k。这样的话第一个点位需要手动重新替换tiledPanoRenderTarget,所以废弃
  55256. 2 使zoomed一直为true,直接使用zoomRenderTarget。 参考之前写过的三屏的本地4k。 且创建的tiledPanoRenderTarget不能超过2048否则过渡卡顿;且直到到达该点后才能下载4k,否则不会渲染到zoomRenderTarget上
  55257. 如果body使用transform旋转90度,需要改的地方:
  55258. convertScreenPositionToNDC: function(e, t, i) {//rotate 90 body: transform: rotate(90deg);
  55259. return i = i || new n.Vector2,
  55260. i.y = e / $("#player").height() * 2 - 1, //注意,当body旋转90度后,虽然clientX和clinetY是按照正常垂直视角,但player的长宽和原先一样,不会因为倒转而交换
  55261. i.x = t / $("#player").width() * 2 - 1,
  55262. i
  55263. },
  55264. outsideControl的 n.prototype.onTouchMove = function(e) {中的
  55265. this.pan(this.panDelta.x, this.panDelta.y) 改为 this.pan(this.panDelta.y, -this.panDelta.x), //rotate 90
  55266. 还有
  55267. this.rotateLeft(2 * Math.PI * this.rotateDelta.y / $("#player").width() * this.rotateSpeed), //rotate 90
  55268. this.rotateUp(2 * Math.PI * -this.rotateDelta.x / $("#player").height() * this.rotateSpeed),
  55269. ===================
  55270. 一些事件
  55271. player.model.on("floor.changed",(currentFloor, mode, oldFloor)=>{//楼层变化
  55272. player.on("pano.chosen", 旧的pano, 新的pano) //点位变化前
  55273. player.on("flying.ended", 新位置, 旧位置, 新的pano, 旧的pano) //点位变化后,或飞出后
  55274. 一些后缀
  55275. &panoLabel 加pano标签
  55276. director.on("tour.end") //导览结束 是否在导览播放中:player.director.tourInProgress() 不包括点击item
  55277. player.isWarping() //是否在导览中,包括点击item的fly
  55278. 我加了个 director.on("warp.end")
  55279. */