main_2020_show.js 2.8 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806578075780857809578105781157812578135781457815578165781757818578195782057821578225782357824578255782657827578285782957830578315783257833578345783557836578375783857839578405784157842578435784457845578465784757848578495785057851578525785357854578555785657857578585785957860578615786257863578645786557866578675786857869578705787157872578735787457875578765787757878578795788057881578825788357884578855788657887578885788957890578915789257893578945789557896578975789857899579005790157902579035790457905579065790757908579095791057911579125791357914579155791657917579185791957920579215792257923579245792557926579275792857929579305793157932579335793457935579365793757938579395794057941579425794357944579455794657947579485794957950579515795257953579545795557956579575795857959579605796157962579635796457965579665796757968579695797057971579725797357974579755797657977579785797957980579815798257983579845798557986579875798857989579905799157992579935799457995579965799757998579995800058001580025800358004580055800658007580085800958010580115801258013580145801558016580175801858019580205802158022580235802458025580265802758028580295803058031580325803358034580355803658037580385803958040580415804258043580445804558046580475804858049580505805158052580535805458055580565805758058580595806058061580625806358064580655806658067580685806958070580715807258073580745807558076580775807858079580805808158082580835808458085580865808758088580895809058091580925809358094580955809658097580985809958100581015810258103581045810558106581075810858109581105811158112581135811458115581165811758118581195812058121581225812358124581255812658127581285812958130581315813258133581345813558136581375813858139581405814158142581435814458145581465814758148581495815058151581525815358154581555815658157581585815958160581615816258163581645816558166581675816858169581705817158172581735817458175581765817758178581795818058181581825818358184581855818658187581885818958190581915819258193581945819558196581975819858199582005820158202582035820458205582065820758208582095821058211582125821358214582155821658217582185821958220582215822258223582245822558226582275822858229582305823158232582335823458235582365823758238582395824058241582425824358244582455824658247582485824958250582515825258253582545825558256582575825858259582605826158262582635826458265582665826758268582695827058271582725827358274582755827658277582785827958280582815828258283582845828558286582875828858289582905829158292582935829458295582965829758298582995830058301583025830358304583055830658307583085830958310583115831258313583145831558316583175831858319583205832158322583235832458325583265832758328583295833058331583325833358334583355833658337583385833958340583415834258343583445834558346583475834858349583505835158352583535835458355583565835758358583595836058361583625836358364583655836658367583685836958370583715837258373583745837558376583775837858379583805838158382583835838458385583865838758388583895839058391583925839358394583955839658397583985839958400584015840258403584045840558406584075840858409584105841158412584135841458415584165841758418584195842058421584225842358424584255842658427584285842958430584315843258433584345843558436584375843858439584405844158442584435844458445584465844758448584495845058451584525845358454584555845658457584585845958460584615846258463584645846558466584675846858469584705847158472584735847458475584765847758478584795848058481584825848358484584855848658487584885848958490584915849258493584945849558496584975849858499585005850158502585035850458505585065850758508585095851058511585125851358514585155851658517585185851958520585215852258523585245852558526585275852858529585305853158532585335853458535585365853758538585395854058541585425854358544585455854658547585485854958550585515855258553585545855558556585575855858559585605856158562585635856458565585665856758568585695857058571585725857358574585755857658577585785857958580585815858258583585845858558586585875858858589585905859158592585935859458595585965859758598585995860058601586025860358604586055860658607586085860958610586115861258613586145861558616586175861858619586205862158622586235862458625586265862758628586295863058631586325863358634586355863658637586385863958640586415864258643586445864558646586475864858649586505865158652586535865458655586565865758658586595866058661586625866358664586655866658667586685866958670586715867258673586745867558676586775867858679586805868158682586835868458685586865868758688586895869058691586925869358694586955869658697586985869958700587015870258703587045870558706587075870858709587105871158712587135871458715587165871758718587195872058721587225872358724587255872658727587285872958730587315873258733587345873558736587375873858739587405874158742587435874458745587465874758748587495875058751587525875358754587555875658757587585875958760587615876258763587645876558766587675876858769587705877158772587735877458775587765877758778587795878058781587825878358784587855878658787587885878958790587915879258793587945879558796587975879858799588005880158802588035880458805588065880758808588095881058811588125881358814588155881658817588185881958820588215882258823588245882558826588275882858829588305883158832588335883458835588365883758838588395884058841588425884358844588455884658847588485884958850588515885258853588545885558856588575885858859588605886158862588635886458865588665886758868588695887058871588725887358874588755887658877588785887958880588815888258883588845888558886588875888858889588905889158892588935889458895588965889758898588995890058901589025890358904589055890658907589085890958910589115891258913589145891558916589175891858919589205892158922589235892458925589265892758928589295893058931589325893358934589355893658937589385893958940589415894258943589445894558946589475894858949589505895158952589535895458955589565895758958589595896058961589625896358964589655896658967589685896958970589715897258973589745897558976589775897858979589805898158982589835898458985589865898758988589895899058991589925899358994589955899658997589985899959000590015900259003590045900559006590075900859009590105901159012590135901459015590165901759018590195902059021590225902359024590255902659027590285902959030590315903259033590345903559036590375903859039590405904159042590435904459045590465904759048590495905059051590525905359054590555905659057590585905959060590615906259063590645906559066590675906859069590705907159072590735907459075590765907759078590795908059081590825908359084590855908659087590885908959090590915909259093590945909559096590975909859099591005910159102591035910459105591065910759108591095911059111591125911359114591155911659117591185911959120591215912259123591245912559126591275912859129591305913159132591335913459135591365913759138591395914059141591425914359144591455914659147591485914959150591515915259153591545915559156591575915859159591605916159162591635916459165591665916759168591695917059171591725917359174591755917659177591785917959180591815918259183591845918559186591875918859189591905919159192591935919459195591965919759198591995920059201592025920359204592055920659207592085920959210592115921259213592145921559216592175921859219592205922159222592235922459225592265922759228592295923059231592325923359234592355923659237592385923959240592415924259243592445924559246592475924859249592505925159252592535925459255592565925759258592595926059261592625926359264592655926659267592685926959270592715927259273592745927559276592775927859279592805928159282592835928459285592865928759288592895929059291592925929359294592955929659297592985929959300593015930259303593045930559306593075930859309593105931159312593135931459315593165931759318593195932059321593225932359324593255932659327593285932959330593315933259333593345933559336593375933859339593405934159342593435934459345593465934759348593495935059351593525935359354593555935659357593585935959360593615936259363593645936559366593675936859369593705937159372593735937459375593765937759378593795938059381593825938359384593855938659387593885938959390593915939259393593945939559396593975939859399594005940159402594035940459405594065940759408594095941059411594125941359414594155941659417594185941959420594215942259423594245942559426594275942859429594305943159432594335943459435594365943759438594395944059441594425944359444594455944659447594485944959450594515945259453594545945559456594575945859459594605946159462594635946459465594665946759468594695947059471594725947359474594755947659477594785947959480594815948259483594845948559486594875948859489594905949159492594935949459495594965949759498594995950059501595025950359504595055950659507595085950959510595115951259513595145951559516595175951859519595205952159522595235952459525595265952759528595295953059531595325953359534595355953659537595385953959540595415954259543595445954559546595475954859549595505955159552595535955459555595565955759558595595956059561595625956359564595655956659567595685956959570595715957259573595745957559576595775957859579595805958159582595835958459585595865958759588595895959059591595925959359594595955959659597595985959959600596015960259603596045960559606596075960859609596105961159612596135961459615596165961759618596195962059621596225962359624596255962659627596285962959630596315963259633596345963559636596375963859639596405964159642596435964459645596465964759648596495965059651596525965359654596555965659657596585965959660596615966259663596645966559666596675966859669596705967159672596735967459675596765967759678596795968059681596825968359684596855968659687596885968959690596915969259693596945969559696596975969859699597005970159702597035970459705597065970759708597095971059711597125971359714597155971659717597185971959720597215972259723597245972559726597275972859729597305973159732597335973459735597365973759738597395974059741597425974359744597455974659747597485974959750597515975259753597545975559756597575975859759597605976159762597635976459765597665976759768597695977059771597725977359774597755977659777597785977959780597815978259783597845978559786597875978859789597905979159792597935979459795597965979759798597995980059801598025980359804598055980659807598085980959810598115981259813598145981559816598175981859819598205982159822598235982459825598265982759828598295983059831598325983359834598355983659837598385983959840598415984259843598445984559846598475984859849598505985159852598535985459855598565985759858598595986059861598625986359864598655986659867598685986959870598715987259873598745987559876598775987859879598805988159882598835988459885598865988759888598895989059891598925989359894598955989659897598985989959900599015990259903599045990559906599075990859909599105991159912599135991459915599165991759918599195992059921599225992359924599255992659927599285992959930599315993259933599345993559936599375993859939599405994159942599435994459945599465994759948599495995059951599525995359954599555995659957599585995959960599615996259963599645996559966599675996859969599705997159972599735997459975599765997759978599795998059981599825998359984599855998659987599885998959990599915999259993599945999559996599975999859999600006000160002600036000460005600066000760008600096001060011600126001360014600156001660017600186001960020600216002260023600246002560026600276002860029600306003160032600336003460035600366003760038600396004060041600426004360044600456004660047600486004960050600516005260053600546005560056600576005860059600606006160062600636006460065600666006760068600696007060071600726007360074600756007660077600786007960080600816008260083600846008560086600876008860089600906009160092600936009460095600966009760098600996010060101601026010360104601056010660107601086010960110601116011260113601146011560116601176011860119601206012160122601236012460125601266012760128601296013060131601326013360134601356013660137601386013960140601416014260143601446014560146601476014860149601506015160152601536015460155601566015760158601596016060161601626016360164601656016660167601686016960170601716017260173601746017560176601776017860179601806018160182601836018460185601866018760188601896019060191601926019360194601956019660197601986019960200602016020260203602046020560206602076020860209602106021160212602136021460215602166021760218602196022060221602226022360224602256022660227602286022960230602316023260233602346023560236602376023860239602406024160242602436024460245602466024760248602496025060251602526025360254602556025660257602586025960260602616026260263602646026560266602676026860269602706027160272602736027460275602766027760278602796028060281602826028360284602856028660287602886028960290602916029260293602946029560296602976029860299603006030160302603036030460305603066030760308603096031060311603126031360314603156031660317603186031960320603216032260323603246032560326603276032860329603306033160332603336033460335603366033760338603396034060341603426034360344603456034660347603486034960350603516035260353603546035560356603576035860359603606036160362603636036460365603666036760368603696037060371603726037360374603756037660377603786037960380603816038260383603846038560386603876038860389603906039160392603936039460395603966039760398603996040060401604026040360404604056040660407604086040960410604116041260413604146041560416604176041860419604206042160422604236042460425604266042760428604296043060431604326043360434604356043660437604386043960440604416044260443604446044560446604476044860449604506045160452604536045460455604566045760458604596046060461604626046360464604656046660467604686046960470604716047260473604746047560476604776047860479604806048160482604836048460485604866048760488604896049060491604926049360494604956049660497604986049960500605016050260503605046050560506605076050860509605106051160512605136051460515605166051760518605196052060521605226052360524605256052660527605286052960530605316053260533605346053560536605376053860539605406054160542605436054460545605466054760548605496055060551605526055360554605556055660557605586055960560605616056260563605646056560566605676056860569605706057160572605736057460575605766057760578605796058060581605826058360584605856058660587605886058960590605916059260593605946059560596605976059860599606006060160602606036060460605606066060760608606096061060611606126061360614606156061660617606186061960620606216062260623606246062560626606276062860629606306063160632606336063460635606366063760638606396064060641606426064360644606456064660647606486064960650606516065260653606546065560656606576065860659606606066160662606636066460665606666066760668606696067060671606726067360674606756067660677606786067960680606816068260683606846068560686606876068860689606906069160692606936069460695606966069760698606996070060701607026070360704607056070660707607086070960710607116071260713607146071560716607176071860719607206072160722607236072460725607266072760728607296073060731607326073360734607356073660737607386073960740607416074260743607446074560746607476074860749607506075160752607536075460755607566075760758607596076060761607626076360764607656076660767607686076960770607716077260773607746077560776607776077860779607806078160782607836078460785607866078760788607896079060791607926079360794607956079660797607986079960800608016080260803608046080560806608076080860809608106081160812608136081460815608166081760818608196082060821608226082360824608256082660827608286082960830608316083260833608346083560836608376083860839608406084160842608436084460845608466084760848608496085060851608526085360854608556085660857608586085960860608616086260863608646086560866608676086860869608706087160872608736087460875608766087760878608796088060881608826088360884608856088660887608886088960890608916089260893608946089560896608976089860899609006090160902609036090460905609066090760908609096091060911609126091360914609156091660917609186091960920609216092260923609246092560926609276092860929609306093160932609336093460935609366093760938609396094060941609426094360944609456094660947609486094960950609516095260953609546095560956609576095860959609606096160962609636096460965609666096760968609696097060971609726097360974609756097660977609786097960980609816098260983609846098560986609876098860989609906099160992609936099460995609966099760998609996100061001610026100361004610056100661007610086100961010610116101261013610146101561016610176101861019610206102161022610236102461025610266102761028610296103061031610326103361034610356103661037610386103961040610416104261043610446104561046610476104861049610506105161052610536105461055610566105761058610596106061061610626106361064610656106661067610686106961070610716107261073610746107561076610776107861079610806108161082610836108461085610866108761088610896109061091610926109361094610956109661097610986109961100611016110261103611046110561106611076110861109611106111161112611136111461115611166111761118611196112061121611226112361124611256112661127611286112961130611316113261133611346113561136611376113861139611406114161142611436114461145611466114761148611496115061151611526115361154611556115661157611586115961160611616116261163611646116561166611676116861169611706117161172611736117461175611766117761178611796118061181611826118361184611856118661187611886118961190611916119261193611946119561196611976119861199612006120161202612036120461205612066120761208612096121061211612126121361214612156121661217612186121961220612216122261223612246122561226612276122861229612306123161232612336123461235612366123761238612396124061241612426124361244612456124661247612486124961250612516125261253612546125561256612576125861259612606126161262612636126461265612666126761268612696127061271612726127361274612756127661277612786127961280612816128261283612846128561286612876128861289612906129161292612936129461295612966129761298612996130061301613026130361304613056130661307613086130961310613116131261313613146131561316613176131861319613206132161322613236132461325613266132761328613296133061331613326133361334613356133661337613386133961340613416134261343613446134561346613476134861349613506135161352613536135461355613566135761358613596136061361613626136361364613656136661367613686136961370613716137261373613746137561376613776137861379613806138161382613836138461385613866138761388613896139061391613926139361394613956139661397613986139961400614016140261403614046140561406614076140861409614106141161412614136141461415614166141761418614196142061421614226142361424614256142661427614286142961430614316143261433614346143561436614376143861439614406144161442614436144461445614466144761448614496145061451614526145361454614556145661457614586145961460614616146261463614646146561466614676146861469614706147161472614736147461475614766147761478614796148061481614826148361484614856148661487614886148961490614916149261493614946149561496614976149861499615006150161502615036150461505615066150761508615096151061511615126151361514615156151661517615186151961520615216152261523615246152561526615276152861529615306153161532615336153461535615366153761538615396154061541615426154361544615456154661547615486154961550615516155261553615546155561556615576155861559615606156161562615636156461565615666156761568615696157061571615726157361574615756157661577615786157961580615816158261583615846158561586615876158861589615906159161592615936159461595615966159761598615996160061601616026160361604616056160661607616086160961610616116161261613616146161561616616176161861619616206162161622616236162461625616266162761628616296163061631616326163361634616356163661637616386163961640616416164261643616446164561646616476164861649616506165161652616536165461655616566165761658616596166061661616626166361664616656166661667616686166961670616716167261673616746167561676616776167861679616806168161682616836168461685616866168761688616896169061691616926169361694616956169661697616986169961700617016170261703617046170561706617076170861709617106171161712617136171461715617166171761718617196172061721617226172361724617256172661727617286172961730617316173261733617346173561736617376173861739617406174161742617436174461745617466174761748617496175061751617526175361754617556175661757617586175961760617616176261763617646176561766617676176861769617706177161772617736177461775617766177761778617796178061781617826178361784617856178661787617886178961790617916179261793617946179561796617976179861799618006180161802618036180461805618066180761808618096181061811618126181361814618156181661817618186181961820618216182261823618246182561826618276182861829618306183161832618336183461835618366183761838618396184061841618426184361844618456184661847618486184961850618516185261853618546185561856618576185861859618606186161862618636186461865618666186761868618696187061871618726187361874618756187661877618786187961880618816188261883618846188561886618876188861889618906189161892618936189461895618966189761898618996190061901619026190361904619056190661907619086190961910619116191261913619146191561916619176191861919619206192161922619236192461925619266192761928619296193061931619326193361934619356193661937619386193961940619416194261943619446194561946619476194861949619506195161952619536195461955619566195761958619596196061961619626196361964619656196661967619686196961970619716197261973619746197561976619776197861979619806198161982619836198461985619866198761988619896199061991619926199361994619956199661997619986199962000620016200262003620046200562006620076200862009620106201162012620136201462015620166201762018620196202062021620226202362024620256202662027620286202962030620316203262033620346203562036620376203862039620406204162042620436204462045620466204762048620496205062051620526205362054620556205662057620586205962060620616206262063620646206562066620676206862069620706207162072620736207462075620766207762078620796208062081620826208362084620856208662087620886208962090620916209262093620946209562096620976209862099621006210162102621036210462105621066210762108621096211062111621126211362114621156211662117621186211962120621216212262123621246212562126621276212862129621306213162132621336213462135621366213762138621396214062141621426214362144621456214662147621486214962150621516215262153621546215562156621576215862159621606216162162621636216462165621666216762168621696217062171621726217362174621756217662177621786217962180621816218262183621846218562186621876218862189621906219162192621936219462195621966219762198621996220062201622026220362204622056220662207622086220962210622116221262213622146221562216622176221862219622206222162222622236222462225622266222762228622296223062231622326223362234622356223662237622386223962240622416224262243622446224562246622476224862249622506225162252622536225462255622566225762258622596226062261622626226362264622656226662267622686226962270622716227262273622746227562276622776227862279622806228162282622836228462285622866228762288622896229062291622926229362294622956229662297622986229962300623016230262303623046230562306623076230862309623106231162312623136231462315623166231762318623196232062321623226232362324623256232662327623286232962330623316233262333623346233562336623376233862339623406234162342623436234462345623466234762348623496235062351623526235362354623556235662357623586235962360623616236262363623646236562366623676236862369623706237162372623736237462375623766237762378623796238062381623826238362384623856238662387623886238962390623916239262393623946239562396623976239862399624006240162402624036240462405624066240762408624096241062411624126241362414624156241662417624186241962420624216242262423624246242562426624276242862429624306243162432624336243462435624366243762438624396244062441624426244362444624456244662447624486244962450624516245262453624546245562456624576245862459624606246162462624636246462465624666246762468624696247062471624726247362474624756247662477624786247962480624816248262483624846248562486624876248862489624906249162492624936249462495624966249762498624996250062501625026250362504625056250662507625086250962510625116251262513625146251562516625176251862519625206252162522625236252462525625266252762528625296253062531625326253362534625356253662537625386253962540625416254262543625446254562546625476254862549625506255162552625536255462555625566255762558625596256062561625626256362564625656256662567625686256962570625716257262573625746257562576625776257862579625806258162582625836258462585625866258762588625896259062591625926259362594625956259662597625986259962600626016260262603626046260562606626076260862609626106261162612626136261462615626166261762618626196262062621626226262362624626256262662627626286262962630626316263262633626346263562636626376263862639626406264162642626436264462645626466264762648626496265062651626526265362654626556265662657626586265962660626616266262663626646266562666626676266862669626706267162672626736267462675626766267762678626796268062681626826268362684626856268662687626886268962690626916269262693626946269562696626976269862699627006270162702627036270462705627066270762708627096271062711627126271362714627156271662717627186271962720627216272262723627246272562726627276272862729627306273162732627336273462735627366273762738627396274062741627426274362744627456274662747627486274962750627516275262753627546275562756627576275862759627606276162762627636276462765627666276762768627696277062771627726277362774627756277662777627786277962780627816278262783627846278562786627876278862789627906279162792627936279462795627966279762798627996280062801628026280362804628056280662807628086280962810628116281262813628146281562816628176281862819628206282162822628236282462825628266282762828628296283062831628326283362834628356283662837628386283962840628416284262843628446284562846628476284862849628506285162852628536285462855628566285762858628596286062861628626286362864628656286662867628686286962870628716287262873628746287562876628776287862879628806288162882628836288462885628866288762888628896289062891628926289362894628956289662897628986289962900629016290262903629046290562906629076290862909629106291162912629136291462915629166291762918629196292062921629226292362924629256292662927629286292962930629316293262933629346293562936629376293862939629406294162942629436294462945629466294762948629496295062951629526295362954629556295662957629586295962960629616296262963629646296562966629676296862969629706297162972629736297462975629766297762978629796298062981629826298362984629856298662987629886298962990629916299262993629946299562996629976299862999630006300163002630036300463005630066300763008630096301063011630126301363014630156301663017630186301963020630216302263023630246302563026630276302863029630306303163032630336303463035630366303763038630396304063041630426304363044630456304663047630486304963050630516305263053630546305563056630576305863059630606306163062630636306463065630666306763068630696307063071630726307363074630756307663077630786307963080630816308263083630846308563086630876308863089630906309163092630936309463095630966309763098630996310063101631026310363104631056310663107631086310963110631116311263113631146311563116631176311863119631206312163122631236312463125631266312763128631296313063131631326313363134631356313663137631386313963140631416314263143631446314563146631476314863149631506315163152631536315463155631566315763158631596316063161631626316363164631656316663167631686316963170631716317263173631746317563176631776317863179631806318163182631836318463185631866318763188631896319063191631926319363194631956319663197631986319963200632016320263203632046320563206632076320863209632106321163212632136321463215632166321763218632196322063221632226322363224632256322663227632286322963230632316323263233632346323563236632376323863239632406324163242632436324463245632466324763248632496325063251632526325363254632556325663257632586325963260632616326263263632646326563266632676326863269632706327163272632736327463275632766327763278632796328063281632826328363284632856328663287632886328963290632916329263293632946329563296632976329863299633006330163302633036330463305633066330763308633096331063311633126331363314633156331663317633186331963320633216332263323633246332563326633276332863329633306333163332633336333463335633366333763338633396334063341633426334363344633456334663347633486334963350633516335263353633546335563356633576335863359633606336163362633636336463365633666336763368633696337063371633726337363374633756337663377633786337963380633816338263383633846338563386633876338863389633906339163392633936339463395633966339763398633996340063401634026340363404634056340663407634086340963410634116341263413634146341563416634176341863419634206342163422634236342463425634266342763428634296343063431634326343363434634356343663437634386343963440634416344263443634446344563446634476344863449634506345163452634536345463455634566345763458634596346063461634626346363464634656346663467634686346963470634716347263473634746347563476634776347863479634806348163482634836348463485634866348763488634896349063491634926349363494634956349663497634986349963500635016350263503635046350563506635076350863509635106351163512635136351463515635166351763518635196352063521635226352363524635256352663527635286352963530635316353263533635346353563536635376353863539635406354163542635436354463545635466354763548635496355063551635526355363554635556355663557635586355963560635616356263563635646356563566635676356863569635706357163572635736357463575635766357763578635796358063581635826358363584635856358663587635886358963590635916359263593635946359563596635976359863599636006360163602636036360463605636066360763608636096361063611636126361363614636156361663617636186361963620636216362263623636246362563626636276362863629636306363163632636336363463635636366363763638636396364063641636426364363644636456364663647636486364963650636516365263653636546365563656636576365863659636606366163662636636366463665636666366763668636696367063671636726367363674636756367663677636786367963680636816368263683636846368563686636876368863689636906369163692636936369463695636966369763698636996370063701637026370363704637056370663707637086370963710637116371263713637146371563716637176371863719637206372163722637236372463725637266372763728637296373063731637326373363734637356373663737637386373963740637416374263743637446374563746637476374863749637506375163752637536375463755637566375763758637596376063761637626376363764637656376663767637686376963770637716377263773637746377563776637776377863779637806378163782637836378463785637866378763788637896379063791637926379363794637956379663797637986379963800638016380263803638046380563806638076380863809638106381163812638136381463815638166381763818638196382063821638226382363824638256382663827638286382963830638316383263833638346383563836638376383863839638406384163842638436384463845638466384763848638496385063851638526385363854638556385663857638586385963860638616386263863638646386563866638676386863869638706387163872638736387463875638766387763878638796388063881638826388363884638856388663887638886388963890638916389263893638946389563896638976389863899639006390163902639036390463905639066390763908639096391063911639126391363914639156391663917639186391963920639216392263923639246392563926639276392863929639306393163932639336393463935639366393763938639396394063941639426394363944639456394663947639486394963950639516395263953639546395563956639576395863959639606396163962639636396463965639666396763968639696397063971639726397363974639756397663977639786397963980639816398263983639846398563986639876398863989639906399163992639936399463995639966399763998639996400064001640026400364004640056400664007640086400964010640116401264013640146401564016640176401864019640206402164022640236402464025640266402764028640296403064031640326403364034640356403664037640386403964040640416404264043640446404564046640476404864049640506405164052640536405464055640566405764058640596406064061640626406364064640656406664067640686406964070640716407264073640746407564076640776407864079640806408164082640836408464085640866408764088640896409064091640926409364094640956409664097640986409964100641016410264103641046410564106641076410864109641106411164112641136411464115641166411764118641196412064121641226412364124641256412664127641286412964130641316413264133641346413564136641376413864139641406414164142641436414464145641466414764148641496415064151641526415364154641556415664157641586415964160641616416264163641646416564166641676416864169641706417164172641736417464175641766417764178641796418064181641826418364184641856418664187641886418964190641916419264193641946419564196641976419864199642006420164202642036420464205642066420764208642096421064211642126421364214642156421664217642186421964220642216422264223642246422564226642276422864229642306423164232642336423464235642366423764238642396424064241642426424364244642456424664247642486424964250642516425264253642546425564256642576425864259642606426164262642636426464265642666426764268642696427064271642726427364274642756427664277642786427964280642816428264283642846428564286642876428864289642906429164292642936429464295642966429764298642996430064301643026430364304643056430664307643086430964310643116431264313643146431564316643176431864319643206432164322643236432464325643266432764328643296433064331643326433364334643356433664337643386433964340643416434264343643446434564346643476434864349643506435164352643536435464355643566435764358643596436064361643626436364364643656436664367643686436964370643716437264373643746437564376643776437864379643806438164382643836438464385643866438764388643896439064391643926439364394643956439664397643986439964400644016440264403644046440564406644076440864409644106441164412644136441464415644166441764418644196442064421644226442364424644256442664427644286442964430644316443264433644346443564436644376443864439644406444164442644436444464445644466444764448644496445064451644526445364454644556445664457644586445964460644616446264463644646446564466644676446864469644706447164472644736447464475644766447764478644796448064481644826448364484644856448664487644886448964490644916449264493644946449564496644976449864499645006450164502645036450464505645066450764508645096451064511645126451364514645156451664517645186451964520645216452264523645246452564526645276452864529645306453164532645336453464535645366453764538645396454064541645426454364544645456454664547645486454964550645516455264553645546455564556645576455864559645606456164562645636456464565645666456764568645696457064571645726457364574645756457664577645786457964580645816458264583645846458564586645876458864589645906459164592645936459464595645966459764598645996460064601646026460364604646056460664607646086460964610646116461264613646146461564616646176461864619646206462164622646236462464625646266462764628646296463064631646326463364634646356463664637646386463964640646416464264643646446464564646646476464864649646506465164652646536465464655646566465764658646596466064661646626466364664646656466664667646686466964670646716467264673646746467564676646776467864679646806468164682646836468464685646866468764688646896469064691646926469364694646956469664697646986469964700647016470264703647046470564706647076470864709647106471164712647136471464715647166471764718647196472064721647226472364724647256472664727647286472964730647316473264733647346473564736647376473864739647406474164742647436474464745647466474764748647496475064751647526475364754647556475664757647586475964760647616476264763647646476564766647676476864769647706477164772647736477464775647766477764778647796478064781647826478364784647856478664787647886478964790647916479264793647946479564796647976479864799648006480164802648036480464805648066480764808648096481064811648126481364814648156481664817648186481964820648216482264823648246482564826648276482864829648306483164832648336483464835648366483764838648396484064841648426484364844648456484664847648486484964850648516485264853648546485564856648576485864859648606486164862648636486464865648666486764868648696487064871648726487364874648756487664877648786487964880648816488264883648846488564886648876488864889648906489164892648936489464895648966489764898648996490064901649026490364904649056490664907649086490964910649116491264913649146491564916649176491864919649206492164922649236492464925649266492764928649296493064931649326493364934649356493664937649386493964940649416494264943649446494564946649476494864949649506495164952649536495464955649566495764958649596496064961649626496364964649656496664967649686496964970649716497264973649746497564976649776497864979649806498164982649836498464985649866498764988649896499064991649926499364994649956499664997649986499965000650016500265003650046500565006650076500865009650106501165012650136501465015650166501765018650196502065021650226502365024650256502665027650286502965030650316503265033650346503565036650376503865039650406504165042650436504465045650466504765048650496505065051650526505365054650556505665057650586505965060650616506265063650646506565066650676506865069650706507165072650736507465075650766507765078650796508065081650826508365084650856508665087650886508965090650916509265093650946509565096650976509865099651006510165102651036510465105651066510765108651096511065111651126511365114651156511665117651186511965120651216512265123651246512565126651276512865129651306513165132651336513465135651366513765138651396514065141651426514365144651456514665147651486514965150651516515265153651546515565156651576515865159651606516165162651636516465165651666516765168651696517065171651726517365174651756517665177651786517965180651816518265183651846518565186651876518865189651906519165192651936519465195651966519765198651996520065201652026520365204652056520665207652086520965210652116521265213652146521565216652176521865219652206522165222652236522465225652266522765228652296523065231652326523365234652356523665237652386523965240652416524265243652446524565246652476524865249652506525165252652536525465255652566525765258652596526065261652626526365264652656526665267652686526965270652716527265273652746527565276652776527865279652806528165282652836528465285652866528765288652896529065291652926529365294652956529665297652986529965300653016530265303653046530565306653076530865309653106531165312653136531465315653166531765318653196532065321653226532365324653256532665327653286532965330653316533265333653346533565336653376533865339653406534165342653436534465345653466534765348653496535065351653526535365354653556535665357653586535965360653616536265363653646536565366653676536865369653706537165372653736537465375653766537765378653796538065381653826538365384653856538665387653886538965390653916539265393653946539565396653976539865399654006540165402654036540465405654066540765408654096541065411654126541365414654156541665417654186541965420654216542265423654246542565426654276542865429654306543165432654336543465435654366543765438654396544065441654426544365444654456544665447654486544965450654516545265453654546545565456654576545865459654606546165462654636546465465654666546765468654696547065471654726547365474654756547665477654786547965480654816548265483654846548565486654876548865489654906549165492654936549465495654966549765498654996550065501655026550365504655056550665507655086550965510655116551265513655146551565516655176551865519655206552165522655236552465525655266552765528655296553065531655326553365534655356553665537655386553965540655416554265543655446554565546655476554865549655506555165552655536555465555655566555765558655596556065561655626556365564655656556665567655686556965570655716557265573655746557565576655776557865579655806558165582655836558465585655866558765588655896559065591655926559365594655956559665597655986559965600656016560265603656046560565606656076560865609656106561165612656136561465615656166561765618656196562065621656226562365624656256562665627656286562965630656316563265633656346563565636656376563865639656406564165642656436564465645656466564765648656496565065651656526565365654656556565665657656586565965660656616566265663656646566565666656676566865669656706567165672656736567465675656766567765678656796568065681656826568365684656856568665687656886568965690656916569265693656946569565696656976569865699657006570165702657036570465705657066570765708657096571065711657126571365714657156571665717657186571965720657216572265723657246572565726657276572865729657306573165732657336573465735657366573765738657396574065741657426574365744657456574665747657486574965750657516575265753657546575565756657576575865759657606576165762657636576465765657666576765768657696577065771657726577365774657756577665777657786577965780657816578265783657846578565786657876578865789657906579165792657936579465795657966579765798657996580065801658026580365804658056580665807658086580965810658116581265813658146581565816658176581865819658206582165822658236582465825658266582765828658296583065831658326583365834658356583665837658386583965840658416584265843658446584565846658476584865849658506585165852658536585465855658566585765858658596586065861658626586365864658656586665867658686586965870658716587265873658746587565876658776587865879658806588165882658836588465885658866588765888658896589065891658926589365894658956589665897658986589965900659016590265903659046590565906659076590865909659106591165912659136591465915659166591765918659196592065921659226592365924659256592665927659286592965930659316593265933659346593565936659376593865939659406594165942659436594465945659466594765948659496595065951659526595365954659556595665957659586595965960659616596265963659646596565966659676596865969659706597165972659736597465975659766597765978659796598065981659826598365984659856598665987659886598965990659916599265993659946599565996659976599865999660006600166002660036600466005660066600766008660096601066011660126601366014660156601666017660186601966020660216602266023660246602566026660276602866029660306603166032660336603466035660366603766038660396604066041660426604366044660456604666047660486604966050660516605266053660546605566056660576605866059660606606166062660636606466065660666606766068660696607066071660726607366074660756607666077660786607966080660816608266083660846608566086660876608866089660906609166092660936609466095660966609766098660996610066101661026610366104661056610666107661086610966110661116611266113661146611566116661176611866119661206612166122661236612466125661266612766128661296613066131661326613366134661356613666137661386613966140661416614266143661446614566146661476614866149661506615166152661536615466155661566615766158661596616066161661626616366164661656616666167661686616966170661716617266173661746617566176661776617866179661806618166182661836618466185661866618766188661896619066191661926619366194661956619666197661986619966200662016620266203662046620566206662076620866209662106621166212662136621466215662166621766218662196622066221662226622366224662256622666227662286622966230662316623266233662346623566236662376623866239662406624166242662436624466245662466624766248662496625066251662526625366254662556625666257662586625966260662616626266263662646626566266662676626866269662706627166272662736627466275662766627766278662796628066281662826628366284662856628666287662886628966290662916629266293662946629566296662976629866299663006630166302663036630466305663066630766308663096631066311663126631366314663156631666317663186631966320663216632266323663246632566326663276632866329663306633166332663336633466335663366633766338663396634066341663426634366344663456634666347663486634966350663516635266353663546635566356663576635866359663606636166362663636636466365663666636766368663696637066371663726637366374663756637666377663786637966380663816638266383663846638566386663876638866389663906639166392663936639466395663966639766398663996640066401664026640366404664056640666407664086640966410664116641266413664146641566416664176641866419664206642166422664236642466425664266642766428664296643066431664326643366434664356643666437664386643966440664416644266443664446644566446664476644866449664506645166452664536645466455664566645766458664596646066461664626646366464664656646666467664686646966470664716647266473664746647566476664776647866479664806648166482664836648466485664866648766488664896649066491664926649366494664956649666497664986649966500665016650266503665046650566506665076650866509665106651166512665136651466515665166651766518665196652066521665226652366524665256652666527665286652966530665316653266533665346653566536665376653866539665406654166542665436654466545665466654766548665496655066551665526655366554665556655666557665586655966560665616656266563665646656566566665676656866569665706657166572665736657466575665766657766578665796658066581665826658366584665856658666587665886658966590665916659266593665946659566596665976659866599666006660166602666036660466605666066660766608666096661066611666126661366614666156661666617666186661966620666216662266623666246662566626666276662866629666306663166632666336663466635666366663766638666396664066641666426664366644666456664666647666486664966650666516665266653666546665566656666576665866659666606666166662666636666466665666666666766668666696667066671666726667366674666756667666677666786667966680666816668266683666846668566686666876668866689666906669166692666936669466695666966669766698666996670066701667026670366704667056670666707667086670966710667116671266713667146671566716667176671866719667206672166722667236672466725667266672766728667296673066731667326673366734667356673666737667386673966740667416674266743667446674566746667476674866749667506675166752667536675466755667566675766758667596676066761667626676366764667656676666767667686676966770667716677266773667746677566776667776677866779667806678166782667836678466785667866678766788667896679066791667926679366794667956679666797667986679966800668016680266803668046680566806668076680866809668106681166812668136681466815668166681766818668196682066821668226682366824668256682666827668286682966830668316683266833668346683566836668376683866839668406684166842668436684466845668466684766848668496685066851668526685366854668556685666857668586685966860668616686266863668646686566866668676686866869668706687166872668736687466875668766687766878668796688066881668826688366884668856688666887668886688966890668916689266893668946689566896668976689866899669006690166902669036690466905669066690766908669096691066911669126691366914669156691666917669186691966920669216692266923669246692566926669276692866929669306693166932669336693466935669366693766938669396694066941669426694366944669456694666947669486694966950669516695266953669546695566956669576695866959669606696166962669636696466965669666696766968669696697066971669726697366974669756697666977669786697966980669816698266983669846698566986669876698866989669906699166992669936699466995669966699766998669996700067001670026700367004670056700667007670086700967010670116701267013670146701567016670176701867019670206702167022670236702467025670266702767028670296703067031670326703367034670356703667037670386703967040670416704267043670446704567046670476704867049670506705167052670536705467055670566705767058670596706067061670626706367064670656706667067670686706967070670716707267073670746707567076670776707867079670806708167082670836708467085670866708767088670896709067091670926709367094670956709667097670986709967100671016710267103671046710567106671076710867109671106711167112671136711467115671166711767118671196712067121671226712367124671256712667127671286712967130671316713267133671346713567136671376713867139671406714167142671436714467145671466714767148671496715067151671526715367154671556715667157671586715967160671616716267163671646716567166671676716867169671706717167172671736717467175671766717767178671796718067181671826718367184671856718667187671886718967190671916719267193671946719567196671976719867199672006720167202672036720467205672066720767208672096721067211672126721367214672156721667217672186721967220672216722267223672246722567226672276722867229672306723167232672336723467235672366723767238672396724067241672426724367244672456724667247672486724967250672516725267253672546725567256672576725867259672606726167262672636726467265672666726767268672696727067271672726727367274672756727667277672786727967280672816728267283672846728567286672876728867289672906729167292672936729467295672966729767298672996730067301673026730367304673056730667307673086730967310673116731267313673146731567316673176731867319673206732167322673236732467325673266732767328673296733067331673326733367334673356733667337673386733967340673416734267343673446734567346673476734867349673506735167352673536735467355673566735767358673596736067361673626736367364673656736667367673686736967370673716737267373673746737567376673776737867379673806738167382673836738467385673866738767388673896739067391673926739367394673956739667397673986739967400674016740267403674046740567406674076740867409674106741167412674136741467415674166741767418674196742067421674226742367424674256742667427674286742967430674316743267433674346743567436674376743867439674406744167442674436744467445674466744767448674496745067451674526745367454674556745667457674586745967460674616746267463674646746567466674676746867469674706747167472674736747467475674766747767478674796748067481674826748367484674856748667487674886748967490674916749267493674946749567496674976749867499675006750167502675036750467505675066750767508675096751067511675126751367514675156751667517675186751967520675216752267523675246752567526675276752867529675306753167532675336753467535675366753767538675396754067541675426754367544675456754667547675486754967550675516755267553675546755567556675576755867559675606756167562675636756467565675666756767568675696757067571675726757367574675756757667577675786757967580675816758267583675846758567586675876758867589675906759167592675936759467595675966759767598675996760067601676026760367604676056760667607676086760967610676116761267613676146761567616676176761867619676206762167622676236762467625676266762767628676296763067631676326763367634676356763667637676386763967640676416764267643676446764567646676476764867649676506765167652676536765467655676566765767658676596766067661676626766367664676656766667667676686766967670676716767267673676746767567676676776767867679676806768167682676836768467685676866768767688676896769067691676926769367694676956769667697676986769967700677016770267703677046770567706677076770867709677106771167712677136771467715677166771767718677196772067721677226772367724677256772667727677286772967730677316773267733677346773567736677376773867739677406774167742677436774467745677466774767748677496775067751677526775367754677556775667757677586775967760677616776267763677646776567766677676776867769677706777167772677736777467775677766777767778677796778067781677826778367784677856778667787677886778967790677916779267793677946779567796677976779867799678006780167802678036780467805678066780767808678096781067811678126781367814678156781667817678186781967820678216782267823678246782567826678276782867829678306783167832678336783467835678366783767838678396784067841678426784367844678456784667847678486784967850678516785267853678546785567856678576785867859678606786167862678636786467865678666786767868678696787067871678726787367874678756787667877678786787967880678816788267883678846788567886678876788867889678906789167892678936789467895678966789767898678996790067901679026790367904679056790667907679086790967910679116791267913679146791567916679176791867919679206792167922679236792467925679266792767928679296793067931679326793367934679356793667937679386793967940679416794267943679446794567946679476794867949679506795167952679536795467955679566795767958679596796067961679626796367964679656796667967679686796967970679716797267973679746797567976679776797867979679806798167982679836798467985679866798767988679896799067991679926799367994679956799667997679986799968000680016800268003680046800568006680076800868009680106801168012680136801468015680166801768018680196802068021680226802368024680256802668027680286802968030680316803268033680346803568036680376803868039680406804168042680436804468045680466804768048680496805068051680526805368054680556805668057680586805968060680616806268063680646806568066680676806868069680706807168072680736807468075680766807768078680796808068081680826808368084680856808668087680886808968090680916809268093680946809568096680976809868099681006810168102681036810468105681066810768108681096811068111681126811368114681156811668117681186811968120681216812268123681246812568126681276812868129681306813168132681336813468135681366813768138681396814068141681426814368144681456814668147681486814968150681516815268153681546815568156681576815868159681606816168162681636816468165681666816768168681696817068171681726817368174681756817668177681786817968180681816818268183681846818568186681876818868189681906819168192681936819468195681966819768198681996820068201682026820368204682056820668207682086820968210682116821268213682146821568216682176821868219682206822168222682236822468225682266822768228682296823068231682326823368234682356823668237682386823968240682416824268243682446824568246682476824868249682506825168252682536825468255682566825768258682596826068261682626826368264682656826668267682686826968270682716827268273682746827568276682776827868279682806828168282682836828468285682866828768288682896829068291682926829368294682956829668297682986829968300683016830268303683046830568306683076830868309683106831168312683136831468315683166831768318683196832068321683226832368324683256832668327683286832968330683316833268333683346833568336683376833868339683406834168342683436834468345683466834768348683496835068351683526835368354683556835668357683586835968360683616836268363683646836568366683676836868369683706837168372683736837468375683766837768378683796838068381683826838368384683856838668387683886838968390683916839268393683946839568396683976839868399684006840168402684036840468405684066840768408684096841068411684126841368414684156841668417684186841968420684216842268423684246842568426684276842868429684306843168432684336843468435684366843768438684396844068441684426844368444684456844668447684486844968450684516845268453684546845568456684576845868459684606846168462684636846468465684666846768468684696847068471684726847368474684756847668477684786847968480684816848268483684846848568486684876848868489684906849168492684936849468495684966849768498684996850068501685026850368504685056850668507685086850968510685116851268513685146851568516685176851868519685206852168522685236852468525685266852768528685296853068531685326853368534685356853668537685386853968540685416854268543685446854568546685476854868549685506855168552685536855468555685566855768558685596856068561685626856368564685656856668567685686856968570685716857268573685746857568576685776857868579685806858168582685836858468585685866858768588685896859068591685926859368594685956859668597685986859968600686016860268603686046860568606686076860868609686106861168612686136861468615686166861768618686196862068621686226862368624686256862668627686286862968630686316863268633686346863568636686376863868639686406864168642686436864468645686466864768648686496865068651686526865368654686556865668657686586865968660686616866268663686646866568666686676866868669686706867168672686736867468675686766867768678686796868068681686826868368684686856868668687686886868968690686916869268693686946869568696686976869868699687006870168702687036870468705687066870768708687096871068711687126871368714687156871668717687186871968720687216872268723687246872568726687276872868729687306873168732687336873468735687366873768738687396874068741687426874368744687456874668747687486874968750687516875268753687546875568756687576875868759687606876168762687636876468765687666876768768687696877068771687726877368774687756877668777687786877968780687816878268783687846878568786687876878868789687906879168792687936879468795687966879768798687996880068801688026880368804688056880668807688086880968810688116881268813688146881568816688176881868819688206882168822688236882468825688266882768828688296883068831688326883368834688356883668837688386883968840688416884268843688446884568846688476884868849688506885168852688536885468855688566885768858688596886068861688626886368864688656886668867688686886968870688716887268873688746887568876688776887868879688806888168882688836888468885688866888768888688896889068891688926889368894688956889668897688986889968900689016890268903689046890568906689076890868909689106891168912689136891468915689166891768918689196892068921689226892368924689256892668927689286892968930689316893268933689346893568936689376893868939689406894168942689436894468945689466894768948689496895068951689526895368954689556895668957689586895968960689616896268963689646896568966689676896868969689706897168972689736897468975689766897768978689796898068981689826898368984689856898668987689886898968990689916899268993689946899568996689976899868999690006900169002690036900469005690066900769008690096901069011690126901369014690156901669017690186901969020690216902269023690246902569026690276902869029690306903169032690336903469035690366903769038690396904069041690426904369044690456904669047690486904969050690516905269053690546905569056690576905869059690606906169062690636906469065690666906769068690696907069071690726907369074690756907669077690786907969080690816908269083690846908569086690876908869089690906909169092690936909469095690966909769098690996910069101691026910369104691056910669107691086910969110691116911269113691146911569116691176911869119691206912169122691236912469125691266912769128691296913069131691326913369134691356913669137691386913969140691416914269143691446914569146691476914869149691506915169152691536915469155691566915769158691596916069161691626916369164691656916669167691686916969170691716917269173691746917569176691776917869179691806918169182691836918469185691866918769188691896919069191691926919369194691956919669197691986919969200692016920269203692046920569206692076920869209692106921169212692136921469215692166921769218692196922069221692226922369224692256922669227692286922969230692316923269233692346923569236692376923869239692406924169242692436924469245692466924769248692496925069251692526925369254692556925669257692586925969260692616926269263692646926569266692676926869269692706927169272692736927469275692766927769278692796928069281692826928369284692856928669287692886928969290692916929269293692946929569296692976929869299693006930169302693036930469305693066930769308693096931069311693126931369314693156931669317693186931969320693216932269323693246932569326693276932869329693306933169332693336933469335693366933769338693396934069341693426934369344693456934669347693486934969350693516935269353693546935569356693576935869359693606936169362693636936469365693666936769368693696937069371693726937369374693756937669377693786937969380693816938269383693846938569386693876938869389693906939169392693936939469395693966939769398693996940069401694026940369404694056940669407694086940969410694116941269413694146941569416694176941869419694206942169422694236942469425694266942769428694296943069431694326943369434694356943669437694386943969440694416944269443694446944569446694476944869449694506945169452694536945469455694566945769458694596946069461694626946369464694656946669467694686946969470694716947269473694746947569476694776947869479694806948169482694836948469485694866948769488694896949069491694926949369494694956949669497694986949969500695016950269503695046950569506695076950869509695106951169512695136951469515695166951769518695196952069521695226952369524695256952669527695286952969530695316953269533695346953569536695376953869539695406954169542695436954469545695466954769548695496955069551695526955369554695556955669557695586955969560695616956269563695646956569566695676956869569695706957169572695736957469575695766957769578695796958069581695826958369584695856958669587695886958969590695916959269593695946959569596695976959869599696006960169602696036960469605696066960769608696096961069611696126961369614696156961669617696186961969620696216962269623696246962569626696276962869629696306963169632696336963469635696366963769638696396964069641696426964369644696456964669647696486964969650696516965269653696546965569656696576965869659696606966169662696636966469665696666966769668696696967069671696726967369674696756967669677696786967969680696816968269683696846968569686696876968869689696906969169692696936969469695696966969769698696996970069701697026970369704697056970669707697086970969710697116971269713697146971569716697176971869719697206972169722697236972469725697266972769728697296973069731697326973369734697356973669737697386973969740697416974269743697446974569746697476974869749697506975169752697536975469755697566975769758697596976069761697626976369764697656976669767697686976969770697716977269773697746977569776697776977869779697806978169782697836978469785697866978769788697896979069791697926979369794697956979669797697986979969800698016980269803698046980569806698076980869809698106981169812698136981469815698166981769818698196982069821698226982369824698256982669827698286982969830698316983269833698346983569836698376983869839698406984169842698436984469845698466984769848698496985069851698526985369854698556985669857698586985969860698616986269863698646986569866698676986869869698706987169872698736987469875698766987769878698796988069881698826988369884698856988669887698886988969890698916989269893698946989569896698976989869899699006990169902699036990469905699066990769908699096991069911699126991369914699156991669917699186991969920699216992269923699246992569926699276992869929699306993169932699336993469935699366993769938699396994069941699426994369944699456994669947699486994969950699516995269953699546995569956699576995869959699606996169962699636996469965699666996769968699696997069971699726997369974699756997669977699786997969980699816998269983699846998569986699876998869989699906999169992699936999469995699966999769998699997000070001700027000370004700057000670007700087000970010700117001270013700147001570016700177001870019700207002170022700237002470025700267002770028700297003070031700327003370034700357003670037700387003970040700417004270043700447004570046700477004870049700507005170052700537005470055700567005770058700597006070061700627006370064700657006670067700687006970070700717007270073700747007570076700777007870079700807008170082700837008470085700867008770088700897009070091700927009370094700957009670097700987009970100701017010270103701047010570106701077010870109701107011170112701137011470115701167011770118701197012070121701227012370124701257012670127701287012970130701317013270133701347013570136701377013870139701407014170142701437014470145701467014770148701497015070151701527015370154701557015670157701587015970160701617016270163701647016570166701677016870169701707017170172701737017470175701767017770178701797018070181701827018370184701857018670187701887018970190701917019270193701947019570196701977019870199702007020170202702037020470205702067020770208702097021070211702127021370214702157021670217702187021970220702217022270223702247022570226702277022870229702307023170232702337023470235702367023770238702397024070241702427024370244702457024670247702487024970250702517025270253702547025570256702577025870259702607026170262702637026470265702667026770268702697027070271702727027370274702757027670277702787027970280702817028270283702847028570286702877028870289702907029170292702937029470295702967029770298702997030070301703027030370304703057030670307703087030970310703117031270313703147031570316703177031870319703207032170322703237032470325703267032770328703297033070331703327033370334703357033670337703387033970340703417034270343703447034570346703477034870349703507035170352703537035470355703567035770358703597036070361703627036370364703657036670367703687036970370703717037270373703747037570376703777037870379703807038170382703837038470385703867038770388703897039070391703927039370394703957039670397703987039970400704017040270403704047040570406704077040870409704107041170412704137041470415704167041770418704197042070421704227042370424704257042670427704287042970430704317043270433704347043570436704377043870439704407044170442704437044470445704467044770448704497045070451704527045370454704557045670457704587045970460704617046270463704647046570466704677046870469704707047170472704737047470475704767047770478704797048070481704827048370484704857048670487704887048970490704917049270493704947049570496704977049870499705007050170502705037050470505705067050770508705097051070511705127051370514705157051670517705187051970520705217052270523705247052570526705277052870529705307053170532705337053470535705367053770538705397054070541705427054370544705457054670547705487054970550705517055270553705547055570556705577055870559705607056170562705637056470565705667056770568705697057070571705727057370574705757057670577705787057970580705817058270583705847058570586705877058870589705907059170592705937059470595705967059770598705997060070601706027060370604706057060670607706087060970610706117061270613706147061570616706177061870619706207062170622706237062470625706267062770628706297063070631706327063370634706357063670637706387063970640706417064270643706447064570646706477064870649706507065170652706537065470655706567065770658706597066070661706627066370664706657066670667706687066970670706717067270673706747067570676706777067870679706807068170682706837068470685706867068770688706897069070691706927069370694706957069670697706987069970700707017070270703707047070570706707077070870709707107071170712707137071470715707167071770718707197072070721707227072370724707257072670727707287072970730707317073270733707347073570736707377073870739707407074170742707437074470745707467074770748707497075070751707527075370754707557075670757707587075970760707617076270763707647076570766707677076870769707707077170772707737077470775707767077770778707797078070781707827078370784707857078670787707887078970790707917079270793707947079570796707977079870799708007080170802708037080470805708067080770808708097081070811708127081370814708157081670817708187081970820708217082270823708247082570826708277082870829708307083170832708337083470835708367083770838708397084070841708427084370844708457084670847708487084970850708517085270853708547085570856708577085870859708607086170862708637086470865708667086770868708697087070871708727087370874708757087670877708787087970880708817088270883708847088570886708877088870889708907089170892708937089470895708967089770898708997090070901709027090370904709057090670907709087090970910709117091270913709147091570916709177091870919709207092170922709237092470925709267092770928709297093070931709327093370934709357093670937709387093970940709417094270943709447094570946709477094870949709507095170952709537095470955709567095770958709597096070961709627096370964709657096670967709687096970970709717097270973709747097570976709777097870979709807098170982709837098470985709867098770988709897099070991709927099370994709957099670997709987099971000710017100271003710047100571006710077100871009710107101171012710137101471015710167101771018710197102071021710227102371024710257102671027710287102971030710317103271033710347103571036710377103871039710407104171042710437104471045710467104771048710497105071051710527105371054710557105671057710587105971060710617106271063710647106571066710677106871069710707107171072710737107471075710767107771078710797108071081710827108371084710857108671087710887108971090710917109271093710947109571096710977109871099711007110171102711037110471105711067110771108711097111071111711127111371114711157111671117711187111971120711217112271123711247112571126711277112871129711307113171132711337113471135711367113771138711397114071141711427114371144711457114671147711487114971150711517115271153711547115571156711577115871159711607116171162711637116471165711667116771168711697117071171711727117371174711757117671177711787117971180711817118271183711847118571186711877118871189711907119171192711937119471195711967119771198711997120071201712027120371204712057120671207712087120971210712117121271213712147121571216712177121871219712207122171222712237122471225712267122771228712297123071231712327123371234712357123671237712387123971240712417124271243712447124571246712477124871249712507125171252712537125471255712567125771258712597126071261712627126371264712657126671267712687126971270712717127271273712747127571276712777127871279712807128171282712837128471285712867128771288712897129071291712927129371294712957129671297712987129971300713017130271303713047130571306713077130871309713107131171312713137131471315713167131771318713197132071321713227132371324713257132671327713287132971330713317133271333713347133571336713377133871339713407134171342713437134471345713467134771348713497135071351713527135371354713557135671357713587135971360713617136271363713647136571366713677136871369713707137171372713737137471375713767137771378713797138071381713827138371384713857138671387713887138971390713917139271393713947139571396713977139871399714007140171402714037140471405714067140771408714097141071411714127141371414714157141671417714187141971420714217142271423714247142571426714277142871429714307143171432714337143471435714367143771438714397144071441714427144371444714457144671447714487144971450714517145271453714547145571456714577145871459714607146171462714637146471465714667146771468714697147071471714727147371474714757147671477714787147971480714817148271483714847148571486714877148871489714907149171492714937149471495714967149771498714997150071501715027150371504715057150671507715087150971510715117151271513715147151571516715177151871519715207152171522715237152471525715267152771528715297153071531715327153371534715357153671537715387153971540715417154271543715447154571546715477154871549715507155171552715537155471555715567155771558715597156071561715627156371564715657156671567715687156971570715717157271573715747157571576715777157871579715807158171582715837158471585715867158771588715897159071591715927159371594715957159671597715987159971600716017160271603716047160571606716077160871609716107161171612716137161471615716167161771618716197162071621716227162371624716257162671627716287162971630716317163271633716347163571636716377163871639716407164171642716437164471645716467164771648716497165071651716527165371654716557165671657716587165971660716617166271663716647166571666716677166871669716707167171672716737167471675716767167771678716797168071681716827168371684716857168671687716887168971690716917169271693716947169571696716977169871699717007170171702717037170471705717067170771708717097171071711717127171371714717157171671717717187171971720717217172271723717247172571726717277172871729717307173171732717337173471735717367173771738717397174071741717427174371744717457174671747717487174971750717517175271753717547175571756717577175871759717607176171762717637176471765717667176771768717697177071771717727177371774717757177671777717787177971780717817178271783717847178571786717877178871789717907179171792717937179471795717967179771798717997180071801718027180371804718057180671807718087180971810718117181271813718147181571816718177181871819718207182171822718237182471825718267182771828718297183071831718327183371834718357183671837718387183971840718417184271843718447184571846718477184871849718507185171852718537185471855718567185771858718597186071861718627186371864718657186671867718687186971870718717187271873718747187571876718777187871879718807188171882718837188471885718867188771888718897189071891718927189371894718957189671897718987189971900719017190271903719047190571906719077190871909719107191171912719137191471915719167191771918719197192071921719227192371924719257192671927719287192971930719317193271933719347193571936719377193871939719407194171942719437194471945719467194771948719497195071951719527195371954719557195671957719587195971960719617196271963719647196571966719677196871969719707197171972719737197471975719767197771978719797198071981719827198371984719857198671987719887198971990719917199271993719947199571996719977199871999720007200172002720037200472005720067200772008720097201072011720127201372014720157201672017720187201972020720217202272023720247202572026720277202872029720307203172032720337203472035720367203772038720397204072041720427204372044720457204672047720487204972050720517205272053720547205572056720577205872059720607206172062720637206472065720667206772068720697207072071720727207372074720757207672077720787207972080720817208272083720847208572086720877208872089720907209172092720937209472095720967209772098720997210072101721027210372104721057210672107721087210972110721117211272113721147211572116721177211872119721207212172122721237212472125721267212772128721297213072131721327213372134721357213672137721387213972140721417214272143721447214572146721477214872149721507215172152721537215472155721567215772158721597216072161721627216372164721657216672167721687216972170721717217272173721747217572176721777217872179721807218172182721837218472185721867218772188721897219072191721927219372194721957219672197721987219972200722017220272203722047220572206722077220872209722107221172212722137221472215722167221772218722197222072221722227222372224722257222672227722287222972230722317223272233722347223572236722377223872239722407224172242722437224472245722467224772248722497225072251722527225372254722557225672257722587225972260722617226272263722647226572266722677226872269722707227172272722737227472275722767227772278722797228072281722827228372284722857228672287722887228972290722917229272293722947229572296722977229872299723007230172302723037230472305723067230772308723097231072311723127231372314723157231672317723187231972320723217232272323723247232572326723277232872329723307233172332723337233472335723367233772338723397234072341723427234372344723457234672347723487234972350723517235272353723547235572356723577235872359723607236172362723637236472365723667236772368723697237072371723727237372374723757237672377723787237972380723817238272383723847238572386723877238872389723907239172392723937239472395723967239772398723997240072401724027240372404724057240672407724087240972410724117241272413724147241572416724177241872419724207242172422724237242472425724267242772428724297243072431724327243372434724357243672437724387243972440724417244272443724447244572446724477244872449724507245172452724537245472455724567245772458724597246072461724627246372464724657246672467724687246972470724717247272473724747247572476724777247872479724807248172482724837248472485724867248772488724897249072491724927249372494724957249672497724987249972500725017250272503725047250572506725077250872509725107251172512725137251472515725167251772518725197252072521725227252372524725257252672527725287252972530725317253272533725347253572536725377253872539725407254172542725437254472545725467254772548725497255072551725527255372554725557255672557725587255972560725617256272563725647256572566725677256872569725707257172572725737257472575725767257772578725797258072581725827258372584725857258672587725887258972590725917259272593725947259572596725977259872599726007260172602726037260472605726067260772608726097261072611726127261372614726157261672617726187261972620726217262272623726247262572626726277262872629726307263172632726337263472635726367263772638726397264072641726427264372644726457264672647726487264972650726517265272653726547265572656726577265872659726607266172662726637266472665726667266772668726697267072671726727267372674726757267672677726787267972680726817268272683726847268572686726877268872689726907269172692726937269472695726967269772698726997270072701727027270372704727057270672707727087270972710727117271272713727147271572716727177271872719727207272172722727237272472725727267272772728727297273072731727327273372734727357273672737727387273972740727417274272743727447274572746727477274872749727507275172752727537275472755727567275772758727597276072761727627276372764727657276672767727687276972770727717277272773727747277572776727777277872779727807278172782727837278472785727867278772788727897279072791727927279372794727957279672797727987279972800728017280272803728047280572806728077280872809728107281172812728137281472815728167281772818728197282072821728227282372824728257282672827728287282972830728317283272833728347283572836728377283872839728407284172842728437284472845728467284772848728497285072851728527285372854728557285672857728587285972860728617286272863728647286572866728677286872869728707287172872728737287472875728767287772878728797288072881728827288372884728857288672887728887288972890728917289272893728947289572896728977289872899729007290172902729037290472905729067290772908729097291072911729127291372914729157291672917729187291972920729217292272923729247292572926729277292872929729307293172932729337293472935729367293772938729397294072941729427294372944729457294672947729487294972950729517295272953729547295572956729577295872959729607296172962729637296472965729667296772968729697297072971729727297372974729757297672977729787297972980729817298272983729847298572986729877298872989729907299172992729937299472995729967299772998729997300073001730027300373004730057300673007730087300973010730117301273013730147301573016730177301873019730207302173022730237302473025730267302773028730297303073031730327303373034730357303673037730387303973040730417304273043730447304573046730477304873049730507305173052730537305473055730567305773058730597306073061730627306373064730657306673067730687306973070730717307273073730747307573076730777307873079730807308173082730837308473085730867308773088730897309073091730927309373094730957309673097730987309973100731017310273103731047310573106731077310873109731107311173112731137311473115731167311773118731197312073121731227312373124731257312673127731287312973130731317313273133731347313573136731377313873139731407314173142731437314473145731467314773148731497315073151731527315373154731557315673157731587315973160731617316273163731647316573166731677316873169731707317173172731737317473175731767317773178731797318073181731827318373184731857318673187731887318973190731917319273193731947319573196731977319873199732007320173202732037320473205732067320773208732097321073211732127321373214732157321673217732187321973220732217322273223732247322573226732277322873229732307323173232732337323473235732367323773238732397324073241732427324373244732457324673247732487324973250732517325273253732547325573256732577325873259732607326173262732637326473265732667326773268732697327073271732727327373274732757327673277732787327973280732817328273283732847328573286732877328873289732907329173292732937329473295732967329773298732997330073301733027330373304733057330673307733087330973310733117331273313733147331573316733177331873319733207332173322733237332473325733267332773328733297333073331733327333373334733357333673337733387333973340733417334273343733447334573346733477334873349733507335173352733537335473355733567335773358733597336073361733627336373364733657336673367733687336973370733717337273373733747337573376733777337873379733807338173382733837338473385733867338773388733897339073391733927339373394733957339673397733987339973400734017340273403734047340573406734077340873409734107341173412734137341473415734167341773418734197342073421734227342373424734257342673427734287342973430734317343273433734347343573436734377343873439734407344173442734437344473445734467344773448734497345073451734527345373454734557345673457734587345973460734617346273463734647346573466734677346873469734707347173472734737347473475734767347773478734797348073481734827348373484734857348673487734887348973490734917349273493734947349573496734977349873499735007350173502735037350473505735067350773508735097351073511735127351373514735157351673517735187351973520735217352273523735247352573526735277352873529735307353173532735337353473535735367353773538735397354073541735427354373544735457354673547735487354973550735517355273553735547355573556735577355873559735607356173562735637356473565735667356773568735697357073571735727357373574735757357673577735787357973580735817358273583735847358573586735877358873589735907359173592735937359473595735967359773598735997360073601736027360373604736057360673607736087360973610736117361273613736147361573616736177361873619736207362173622736237362473625736267362773628736297363073631736327363373634736357363673637736387363973640
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. let highMapAddColor = 0; //true
  5. !(function () {
  6. "use strict";
  7. function t(t, i) {
  8. return typeof t === i;
  9. }
  10. function i(t, i) {
  11. return t instanceof i;
  12. }
  13. function n(t) {
  14. return t && t.nodeType;
  15. }
  16. function e(t) {
  17. return n(t) ? t : i(t, g) ? t[0] : void 0;
  18. }
  19. function o(t, i, n) {
  20. return (
  21. g.each(t, function (t, e) {
  22. n = i.call(e, n, t, e);
  23. }),
  24. n
  25. );
  26. }
  27. function r(t, i, n) {
  28. var e, o, r;
  29. if (t === i) return !0;
  30. if (!t || !i || t.constructor !== i.constructor) return !1;
  31. for (e = 0, o = n.length; o > e; e += 1) {
  32. if (((r = n[e]), t[r] && y(t[r].equals) && !t[r].equals(i[r]))) return !1;
  33. if (t[r] !== i[r]) return !1;
  34. }
  35. return !0;
  36. }
  37. function s(t, i, n, e) {
  38. (this.left = E(t)),
  39. (this.top = E(i)),
  40. (this.width = E(n)),
  41. (this.height = E(e)),
  42. (this.right = this.left + this.width),
  43. (this.bottom = this.top + this.height);
  44. }
  45. function h(t, i, n, e) {
  46. (this.visible = t || 0),
  47. (this.viewport = i || 0),
  48. (this.possible = n || 0),
  49. (this.rects = (e && T({}, e)) || null);
  50. }
  51. function l(t, i) {
  52. (this.els = t), (this.viewport = i);
  53. }
  54. function c(t, i, n) {
  55. var e;
  56. return (
  57. g.inArray(n, q) >= 0
  58. ? (e = s.ofElement(t))
  59. : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  60. e ? e[n] : 0
  61. );
  62. }
  63. function u(t, i) {
  64. return t.val - i.val;
  65. }
  66. function a(t, i) {
  67. return i.val - t.val;
  68. }
  69. function f(t) {
  70. var i = s.ofContent(t, !0),
  71. n = s.ofViewport(t, !0),
  72. e = i.width - n.width,
  73. o = i.height - n.height;
  74. (this.content = i),
  75. (this.viewport = n),
  76. (this.width = 0 >= e ? null : n.left / e),
  77. (this.height = 0 >= o ? null : n.top / o),
  78. (this.left = n.left),
  79. (this.top = n.top),
  80. (this.right = i.right - n.right),
  81. (this.bottom = i.bottom - n.bottom);
  82. }
  83. function p(t) {
  84. this.el = t || window;
  85. }
  86. function d(t, i) {
  87. (this.context = t), (this.viewport = i), this.init();
  88. }
  89. function v(t, i, n, e) {
  90. (this.context = new l(t, i)),
  91. (this.property = n),
  92. (this.descending = e),
  93. this.init();
  94. }
  95. function w(t) {
  96. t && t !== window && t !== document
  97. ? ((this.context = t), (this.$autoTarget = g(t)))
  98. : (this.context = window),
  99. this.init();
  100. }
  101. var g = jQuery,
  102. m = g(window),
  103. b = g(document),
  104. T = g.extend,
  105. y = g.isFunction,
  106. k = Math.max,
  107. V = Math.min,
  108. E = Math.round,
  109. x = (function () {
  110. var t = {},
  111. i = 1;
  112. return function (n) {
  113. return n ? (t[n] || ((t[n] = i), (i += 1)), t[n]) : 0;
  114. };
  115. })();
  116. T(s.prototype, {
  117. equals: function (t) {
  118. return r(this, t, ["left", "top", "width", "height"]);
  119. },
  120. area: function () {
  121. return this.width * this.height;
  122. },
  123. relativeTo: function (t) {
  124. return new s(
  125. this.left - t.left,
  126. this.top - t.top,
  127. this.width,
  128. this.height
  129. );
  130. },
  131. intersection: function (t) {
  132. if (!i(t, s)) return null;
  133. var n = k(this.left, t.left),
  134. e = V(this.right, t.right),
  135. o = k(this.top, t.top),
  136. r = V(this.bottom, t.bottom),
  137. h = e - n,
  138. l = r - o;
  139. return h >= 0 && l >= 0 ? new s(n, o, h, l) : null;
  140. },
  141. envelope: function (t) {
  142. if (!i(t, s)) return this;
  143. var n = V(this.left, t.left),
  144. e = k(this.right, t.right),
  145. o = V(this.top, t.top),
  146. r = k(this.bottom, t.bottom),
  147. h = e - n,
  148. l = r - o;
  149. return new s(n, o, h, l);
  150. },
  151. }),
  152. T(s, {
  153. ofContent: function (t, i) {
  154. return t && t !== document && t !== window
  155. ? i
  156. ? new s(0, 0, t.scrollWidth, t.scrollHeight)
  157. : new s(
  158. t.offsetLeft - t.scrollLeft,
  159. t.offsetTop - t.scrollTop,
  160. t.scrollWidth,
  161. t.scrollHeight
  162. )
  163. : new s(0, 0, b.width(), b.height());
  164. },
  165. ofViewport: function (t, i) {
  166. return t && t !== document && t !== window
  167. ? i
  168. ? new s(t.scrollLeft, t.scrollTop, t.clientWidth, t.clientHeight)
  169. : new s(t.offsetLeft, t.offsetTop, t.clientWidth, t.clientHeight)
  170. : new s(m.scrollLeft(), m.scrollTop(), m.width(), m.height());
  171. },
  172. ofElement: function (t) {
  173. var i = g(t);
  174. if (!i.is(":visible")) return null;
  175. var n = i.offset();
  176. return new s(n.left, n.top, i.outerWidth(), i.outerHeight());
  177. },
  178. }),
  179. T(h.prototype, {
  180. equals: function (t) {
  181. return this.fracsEqual(t) && this.rectsEqual(t);
  182. },
  183. fracsEqual: function (t) {
  184. return r(this, t, ["visible", "viewport", "possible"]);
  185. },
  186. rectsEqual: function (t) {
  187. return r(this.rects, t.rects, ["document", "element", "viewport"]);
  188. },
  189. }),
  190. T(h, {
  191. of: function (t, i) {
  192. var e, o, r;
  193. return (
  194. (t = (n(t) && s.ofElement(t)) || t),
  195. (i = (n(i) && s.ofViewport(i)) || i || s.ofViewport()),
  196. t instanceof s && (e = t.intersection(i))
  197. ? ((o = e.area()),
  198. (r = V(t.width, i.width) * V(t.height, i.height)),
  199. new h(o / t.area(), o / i.area(), o / r, {
  200. document: e,
  201. element: e.relativeTo(t),
  202. viewport: e.relativeTo(i),
  203. }))
  204. : new h()
  205. );
  206. },
  207. });
  208. var q = ["width", "height", "left", "right", "top", "bottom"],
  209. S = ["possible", "visible", "viewport"];
  210. T(l.prototype, {
  211. sorted: function (t, i) {
  212. var n = this.viewport;
  213. return g
  214. .map(this.els, function (i) {
  215. return {
  216. el: i,
  217. val: c(i, n, t),
  218. };
  219. })
  220. .sort(i ? a : u);
  221. },
  222. best: function (t, i) {
  223. return this.els.length ? this.sorted(t, i)[0] : null;
  224. },
  225. }),
  226. T(f.prototype, {
  227. equals: function (t) {
  228. return r(this, t, [
  229. "width",
  230. "height",
  231. "left",
  232. "top",
  233. "right",
  234. "bottom",
  235. "content",
  236. "viewport",
  237. ]);
  238. },
  239. }),
  240. T(p.prototype, {
  241. equals: function (t) {
  242. return r(this, t, ["el"]);
  243. },
  244. scrollState: function () {
  245. return new f(this.el);
  246. },
  247. scrollTo: function (t, i, n) {
  248. var e = g(this.el === window ? "html,body" : this.el);
  249. (t = t || 0),
  250. (i = i || 0),
  251. (n = isNaN(n) ? 1e3 : n),
  252. e.stop(!0).animate(
  253. {
  254. scrollLeft: t,
  255. scrollTop: i,
  256. },
  257. n
  258. );
  259. },
  260. scroll: function (t, i, n) {
  261. var e = this.el === window ? m : g(this.el);
  262. (t = t || 0),
  263. (i = i || 0),
  264. this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n);
  265. },
  266. scrollToRect: function (t, i, n, e) {
  267. (i = i || 0), (n = n || 0), this.scrollTo(t.left - i, t.top - n, e);
  268. },
  269. scrollToElement: function (t, i, n, e) {
  270. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  271. this.scrollToRect(o, i, n, e);
  272. },
  273. });
  274. var C = {
  275. init: function () {
  276. (this.callbacks = g.Callbacks("memory unique")),
  277. (this.currVal = null),
  278. (this.prevVal = null),
  279. (this.checkProxy = g.proxy(this.check, this)),
  280. this.autoCheck();
  281. },
  282. bind: function (t) {
  283. this.callbacks.add(t);
  284. },
  285. unbind: function (t) {
  286. t ? this.callbacks.remove(t) : this.callbacks.empty();
  287. },
  288. trigger: function () {
  289. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal]);
  290. },
  291. check: function (t) {
  292. var i = this.updatedValue(t);
  293. return (
  294. void 0 !== i &&
  295. ((this.prevVal = this.currVal), (this.currVal = i), this.trigger(), !0)
  296. );
  297. },
  298. $autoTarget: m,
  299. autoEvents: "load resize scroll",
  300. autoCheck: function (t) {
  301. this.$autoTarget[t === !1 ? "off" : "on"](
  302. this.autoEvents,
  303. this.checkProxy
  304. );
  305. },
  306. };
  307. T(d.prototype, C, {
  308. updatedValue: function () {
  309. var t = h.of(this.context, this.viewport);
  310. return this.currVal && this.currVal.equals(t) ? void 0 : t;
  311. },
  312. }),
  313. T(v.prototype, C, {
  314. updatedValue: function () {
  315. var t = this.context.best(this.property, this.descending);
  316. return t && ((t = t.val > 0 ? t.el : null), this.currVal !== t)
  317. ? t
  318. : void 0;
  319. },
  320. }),
  321. T(w.prototype, C, {
  322. updatedValue: function () {
  323. var t = new f(this.context);
  324. return this.currVal && this.currVal.equals(t) ? void 0 : t;
  325. },
  326. });
  327. var L = function (t, i) {
  328. var n = [].slice,
  329. e = jQuery,
  330. o = e.extend,
  331. r = e.isFunction,
  332. s = o({}, i),
  333. h = function (i, n, o, s) {
  334. return (
  335. (o = r(o) ? o.apply(i, n) : o),
  336. r(s[o])
  337. ? s[o].apply(i, n)
  338. : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  339. );
  340. },
  341. l = function () {
  342. return h(this, n.call(arguments), s.defaultStatic, l);
  343. },
  344. c = function (t) {
  345. return r(c[t])
  346. ? c[t].apply(this, n.call(arguments, 1))
  347. : h(this, n.call(arguments), s.defaultMethod, c);
  348. },
  349. u = function (t) {
  350. t && (o(l, t.statics), o(c, t.methods)), (l.modplug = u);
  351. };
  352. (u.prev = {
  353. statics: e[t],
  354. methods: e.fn[t],
  355. }),
  356. u(i),
  357. (e[t] = l),
  358. (e.fn[t] = c);
  359. },
  360. M = "fracs";
  361. L(M, {
  362. statics: {
  363. version: "0.15.0",
  364. Rect: s,
  365. Fractions: h,
  366. Group: l,
  367. ScrollState: f,
  368. Viewport: p,
  369. FracsCallbacks: d,
  370. GroupCallbacks: v,
  371. ScrollStateCallbacks: w,
  372. fracs: function (t, i) {
  373. return h.of(t, i);
  374. },
  375. },
  376. methods: {
  377. content: function (t) {
  378. return this.length ? s.ofContent(this[0], t) : null;
  379. },
  380. envelope: function () {
  381. return o(this, function (t) {
  382. var i = s.ofElement(this);
  383. return t ? t.envelope(i) : i;
  384. });
  385. },
  386. fracs: function (i, n, o) {
  387. t(i, "string") || ((o = n), (n = i), (i = null)),
  388. y(n) || ((o = n), (n = null)),
  389. (o = e(o));
  390. var r = M + ".fracs." + x(o);
  391. return "unbind" === i
  392. ? this.each(function () {
  393. var t = g(this).data(r);
  394. t && t.unbind(n);
  395. })
  396. : "check" === i
  397. ? this.each(function () {
  398. var t = g(this).data(r);
  399. t && t.check();
  400. })
  401. : y(n)
  402. ? this.each(function () {
  403. var t = g(this),
  404. i = t.data(r);
  405. i || ((i = new d(this, o)), t.data(r, i)), i.bind(n);
  406. })
  407. : this.length
  408. ? h.of(this[0], o)
  409. : null;
  410. },
  411. intersection: function () {
  412. return o(this, function (t) {
  413. var i = s.ofElement(this);
  414. return t ? t.intersection(i) : i;
  415. });
  416. },
  417. max: function (t, i, n) {
  418. return (
  419. y(i) || ((n = i), (i = null)),
  420. (n = e(n)),
  421. i
  422. ? (new v(this, n, t, !0).bind(i), this)
  423. : this.pushStack(new l(this, n).best(t, !0).el)
  424. );
  425. },
  426. min: function (t, i, n) {
  427. return (
  428. y(i) || ((n = i), (i = null)),
  429. (n = e(n)),
  430. i
  431. ? (new v(this, n, t).bind(i), this)
  432. : this.pushStack(new l(this, n).best(t).el)
  433. );
  434. },
  435. rect: function () {
  436. return this.length ? s.ofElement(this[0]) : null;
  437. },
  438. scrollState: function (i, n) {
  439. var e = M + ".scrollState";
  440. return (
  441. t(i, "string") || ((n = i), (i = null)),
  442. "unbind" === i
  443. ? this.each(function () {
  444. var t = g(this).data(e);
  445. t && t.unbind(n);
  446. })
  447. : "check" === i
  448. ? this.each(function () {
  449. var t = g(this).data(e);
  450. t && t.check();
  451. })
  452. : y(n)
  453. ? this.each(function () {
  454. var t = g(this),
  455. i = t.data(e);
  456. i || ((i = new w(this)), t.data(e, i)), i.bind(n);
  457. })
  458. : this.length
  459. ? new f(this[0])
  460. : null
  461. );
  462. },
  463. scroll: function (t, i, n) {
  464. return this.each(function () {
  465. new p(this).scroll(t, i, n);
  466. });
  467. },
  468. scrollTo: function (t, i, n, o) {
  469. return (
  470. g.isNumeric(t) && ((o = n), (n = i), (i = t), (t = null)),
  471. (t = e(t)),
  472. this.each(function () {
  473. t
  474. ? new p(this).scrollToElement(t, i, n, o)
  475. : new p(this).scrollTo(i, n, o);
  476. })
  477. );
  478. },
  479. scrollToThis: function (t, i, n, o) {
  480. return (o = new p(e(o))), o.scrollToElement(this[0], t, i, n), this;
  481. },
  482. softLink: function (t, i, n, o) {
  483. return (
  484. (o = new p(e(o))),
  485. this.filter("a[href^=#]").each(function () {
  486. var e = g(this);
  487. e.on("click", function () {
  488. o.scrollToElement(g(e.attr("href"))[0], t, i, n);
  489. });
  490. })
  491. );
  492. },
  493. sort: function (i, n, o) {
  494. return (
  495. t(n, "boolean") || ((o = n), (n = null)),
  496. (o = e(o)),
  497. this.pushStack(
  498. g.map(new l(this, o).sorted(i, !n), function (t) {
  499. return t.el;
  500. })
  501. )
  502. );
  503. },
  504. viewport: function (t) {
  505. return this.length ? s.ofViewport(this[0], t) : null;
  506. },
  507. },
  508. defaultStatic: "fracs",
  509. defaultMethod: "fracs",
  510. });
  511. })();
  512. if ("undefined" == typeof jQuery)
  513. throw new Error("Bootstrap's JavaScript requires jQuery");
  514. +(function (t) {
  515. "use strict";
  516. function e(e) {
  517. return this.each(function () {
  518. var o = t(this),
  519. s = o.data("bs.tooltip"),
  520. n = "object" == typeof e && e;
  521. (s || "destroy" != e) &&
  522. (s || o.data("bs.tooltip", (s = new i(this, n))),
  523. "string" == typeof e && s[e]());
  524. });
  525. }
  526. var i = function (t, e) {
  527. (this.type =
  528. this.options =
  529. this.enabled =
  530. this.timeout =
  531. this.hoverState =
  532. this.$element =
  533. null),
  534. this.init("tooltip", t, e);
  535. };
  536. (i.VERSION = "3.2.0"),
  537. (i.DEFAULTS = {
  538. animation: !0,
  539. placement: "top",
  540. selector: !1,
  541. template:
  542. '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  543. trigger: "hover focus",
  544. title: "",
  545. delay: 0,
  546. html: !1,
  547. container: !1,
  548. viewport: {
  549. selector: "body",
  550. padding: 0,
  551. },
  552. }),
  553. (i.prototype.init = function (e, i, o) {
  554. (this.enabled = !0),
  555. (this.type = e),
  556. (this.$element = t(i)),
  557. (this.options = this.getOptions(o)),
  558. (this.$viewport =
  559. this.options.viewport &&
  560. t(this.options.viewport.selector || this.options.viewport));
  561. for (var s = this.options.trigger.split(" "), n = s.length; n--; ) {
  562. var r = s[n];
  563. if ("click" == r)
  564. this.$element.on(
  565. "click." + this.type,
  566. this.options.selector,
  567. t.proxy(this.toggle, this)
  568. );
  569. else if ("manual" != r) {
  570. var a = "hover" == r ? "mouseenter" : "focusin",
  571. l = "hover" == r ? "mouseleave" : "focusout";
  572. this.$element.on(
  573. a + "." + this.type,
  574. this.options.selector,
  575. t.proxy(this.enter, this)
  576. ),
  577. this.$element.on(
  578. l + "." + this.type,
  579. this.options.selector,
  580. t.proxy(this.leave, this)
  581. );
  582. }
  583. }
  584. this.options.selector
  585. ? (this._options = t.extend({}, this.options, {
  586. trigger: "manual",
  587. selector: "",
  588. }))
  589. : this.fixTitle();
  590. }),
  591. (i.prototype.getDefaults = function () {
  592. return i.DEFAULTS;
  593. }),
  594. (i.prototype.getOptions = function (e) {
  595. return (
  596. (e = t.extend({}, this.getDefaults(), this.$element.data(), e)),
  597. e.delay &&
  598. "number" == typeof e.delay &&
  599. (e.delay = {
  600. show: e.delay,
  601. hide: e.delay,
  602. }),
  603. e
  604. );
  605. }),
  606. (i.prototype.getDelegateOptions = function () {
  607. var e = {},
  608. i = this.getDefaults();
  609. return (
  610. this._options &&
  611. t.each(this._options, function (t, o) {
  612. i[t] != o && (e[t] = o);
  613. }),
  614. e
  615. );
  616. }),
  617. (i.prototype.enter = function (e) {
  618. var i =
  619. e instanceof this.constructor
  620. ? e
  621. : t(e.currentTarget).data("bs." + this.type);
  622. return (
  623. i ||
  624. ((i = new this.constructor(
  625. e.currentTarget,
  626. this.getDelegateOptions()
  627. )),
  628. t(e.currentTarget).data("bs." + this.type, i)),
  629. clearTimeout(i.timeout),
  630. (i.hoverState = "in"),
  631. i.options.delay && i.options.delay.show
  632. ? void (i.timeout = setTimeout(function () {
  633. // "in" == i.hoverState && i.show()
  634. }, i.options.delay.show))
  635. : i.show()
  636. );
  637. }),
  638. (i.prototype.leave = function (e) {
  639. var i =
  640. e instanceof this.constructor
  641. ? e
  642. : t(e.currentTarget).data("bs." + this.type);
  643. return (
  644. i ||
  645. ((i = new this.constructor(
  646. e.currentTarget,
  647. this.getDelegateOptions()
  648. )),
  649. t(e.currentTarget).data("bs." + this.type, i)),
  650. clearTimeout(i.timeout),
  651. (i.hoverState = "out"),
  652. i.options.delay && i.options.delay.hide
  653. ? void (i.timeout = setTimeout(function () {
  654. "out" == i.hoverState && i.hide();
  655. }, i.options.delay.hide))
  656. : i.hide()
  657. );
  658. }),
  659. (i.prototype.show = function () {
  660. var e = t.Event("show.bs." + this.type);
  661. if (this.hasContent() && this.enabled) {
  662. this.$element.trigger(e);
  663. var i = t.contains(document.documentElement, this.$element[0]);
  664. if (e.isDefaultPrevented() || !i) return;
  665. var o = this,
  666. s = this.tip(),
  667. n = this.getUID(this.type);
  668. this.setContent(),
  669. s.attr("id", n),
  670. this.$element.attr("aria-describedby", n),
  671. this.options.animation && s.addClass("fade");
  672. var r =
  673. "function" == typeof this.options.placement
  674. ? this.options.placement.call(this, s[0], this.$element[0])
  675. : this.options.placement,
  676. a = /\s?auto?\s?/i,
  677. l = a.test(r);
  678. l && (r = r.replace(a, "") || "top"),
  679. s
  680. .detach()
  681. .css({
  682. top: 0,
  683. left: 0,
  684. display: "block",
  685. })
  686. .addClass(r)
  687. .data("bs." + this.type, this),
  688. this.options.container
  689. ? s.appendTo(this.options.container)
  690. : s.insertAfter(this.$element);
  691. var p = this.getPosition(),
  692. h = s[0].offsetWidth,
  693. f = s[0].offsetHeight;
  694. if (l) {
  695. var u = r,
  696. c = this.$element.parent(),
  697. d = this.getPosition(c);
  698. (r =
  699. "bottom" == r && p.top + p.height + f - d.scroll > d.height
  700. ? "top"
  701. : "top" == r && p.top - d.scroll - f < 0
  702. ? "bottom"
  703. : "right" == r && p.right + h > d.width
  704. ? "left"
  705. : "left" == r && p.left - h < d.left
  706. ? "right"
  707. : r),
  708. s.removeClass(u).addClass(r);
  709. }
  710. var g = this.getCalculatedOffset(r, p, h, f);
  711. this.applyPlacement(g, r);
  712. var y = function () {
  713. o.$element.trigger("shown.bs." + o.type), (o.hoverState = null);
  714. };
  715. t.support.transition && this.$tip.hasClass("fade")
  716. ? s.one("bsTransitionEnd", y).emulateTransitionEnd(150)
  717. : y();
  718. }
  719. }),
  720. (i.prototype.applyPlacement = function (e, i) {
  721. var o = this.tip(),
  722. s = o[0].offsetWidth,
  723. n = o[0].offsetHeight,
  724. r = parseInt(o.css("margin-top"), 10),
  725. a = parseInt(o.css("margin-left"), 10);
  726. isNaN(r) && (r = 0),
  727. isNaN(a) && (a = 0),
  728. (e.top = e.top + r),
  729. (e.left = e.left + a),
  730. t.offset.setOffset(
  731. o[0],
  732. t.extend(
  733. {
  734. using: function (t) {
  735. o.css({
  736. top: Math.round(t.top),
  737. left: Math.round(t.left),
  738. });
  739. },
  740. },
  741. e
  742. ),
  743. 0
  744. ),
  745. o.addClass("in");
  746. var l = o[0].offsetWidth,
  747. p = o[0].offsetHeight;
  748. "top" == i && p != n && (e.top = e.top + n - p);
  749. var h = this.getViewportAdjustedDelta(i, e, l, p);
  750. h.left ? (e.left += h.left) : (e.top += h.top);
  751. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p,
  752. u = h.left ? "left" : "top",
  753. c = h.left ? "offsetWidth" : "offsetHeight";
  754. o.offset(e), this.replaceArrow(f, o[0][c], u);
  755. }),
  756. (i.prototype.replaceArrow = function (t, e, i) {
  757. this.arrow().css(i, t ? 50 * (1 - t / e) + "%" : "");
  758. }),
  759. (i.prototype.setContent = function () {
  760. var t = this.tip(),
  761. e = this.getTitle();
  762. t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
  763. t.removeClass("fade in top bottom left right");
  764. }),
  765. (i.prototype.hide = function () {
  766. function e() {
  767. "in" != i.hoverState && o.detach(),
  768. i.$element.trigger("hidden.bs." + i.type);
  769. }
  770. var i = this,
  771. o = this.tip(),
  772. s = t.Event("hide.bs." + this.type);
  773. if (
  774. (this.$element.removeAttr("aria-describedby"),
  775. this.$element.trigger(s),
  776. !s.isDefaultPrevented())
  777. )
  778. return (
  779. o.removeClass("in"),
  780. t.support.transition && this.$tip.hasClass("fade")
  781. ? o.one("bsTransitionEnd", e).emulateTransitionEnd(150)
  782. : e(),
  783. (this.hoverState = null),
  784. this
  785. );
  786. }),
  787. (i.prototype.fixTitle = function () {
  788. var t = this.$element;
  789. (t.attr("title") || "string" != typeof t.attr("data-original-title")) &&
  790. t.attr("data-original-title", t.attr("title") || "").attr("title", "");
  791. }),
  792. (i.prototype.hasContent = function () {
  793. return this.getTitle();
  794. }),
  795. (i.prototype.getPosition = function (e) {
  796. e = e || this.$element;
  797. var i = e[0],
  798. o = "BODY" == i.tagName;
  799. return t.extend(
  800. {},
  801. "function" == typeof i.getBoundingClientRect
  802. ? i.getBoundingClientRect()
  803. : null,
  804. {
  805. scroll: o
  806. ? document.documentElement.scrollTop || document.body.scrollTop
  807. : e.scrollTop(),
  808. width: o ? t(window).width() : e.outerWidth(),
  809. height: o ? t(window).height() : e.outerHeight(),
  810. },
  811. o
  812. ? {
  813. top: 0,
  814. left: 0,
  815. }
  816. : e.offset()
  817. );
  818. }),
  819. (i.prototype.getCalculatedOffset = function (t, e, i, o) {
  820. return "bottom" == t
  821. ? {
  822. top: e.top + e.height,
  823. left: e.left + e.width / 2 - i / 2,
  824. }
  825. : "top" == t
  826. ? {
  827. top: e.top - o,
  828. left: e.left + e.width / 2 - i / 2,
  829. }
  830. : "left" == t
  831. ? {
  832. top: e.top + e.height / 2 - o / 2,
  833. left: e.left - i,
  834. }
  835. : {
  836. top: e.top + e.height / 2 - o / 2,
  837. left: e.left + e.width,
  838. };
  839. }),
  840. (i.prototype.getViewportAdjustedDelta = function (t, e, i, o) {
  841. var s = {
  842. top: 0,
  843. left: 0,
  844. };
  845. if (!this.$viewport) return s;
  846. var n = (this.options.viewport && this.options.viewport.padding) || 0,
  847. r = this.getPosition(this.$viewport);
  848. if (/right|left/.test(t)) {
  849. var a = e.top - n - r.scroll,
  850. l = e.top + n - r.scroll + o;
  851. a < r.top
  852. ? (s.top = r.top - a)
  853. : l > r.top + r.height && (s.top = r.top + r.height - l);
  854. } else {
  855. var p = e.left - n,
  856. h = e.left + n + i;
  857. p < r.left
  858. ? (s.left = r.left - p)
  859. : h > r.width && (s.left = r.left + r.width - h);
  860. }
  861. return s;
  862. }),
  863. (i.prototype.getTitle = function () {
  864. var t,
  865. e = this.$element,
  866. i = this.options;
  867. return (t =
  868. e.attr("data-original-title") ||
  869. ("function" == typeof i.title ? i.title.call(e[0]) : i.title));
  870. }),
  871. (i.prototype.getUID = function (t) {
  872. do t += ~~(1e6 * Math.random());
  873. while (document.getElementById(t));
  874. return t;
  875. }),
  876. (i.prototype.tip = function () {
  877. return (this.$tip = this.$tip || t(this.options.template));
  878. }),
  879. (i.prototype.arrow = function () {
  880. return (this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow"));
  881. }),
  882. (i.prototype.validate = function () {
  883. this.$element[0].parentNode ||
  884. (this.hide(), (this.$element = null), (this.options = null));
  885. }),
  886. (i.prototype.enable = function () {
  887. this.enabled = !0;
  888. }),
  889. (i.prototype.disable = function () {
  890. this.enabled = !1;
  891. }),
  892. (i.prototype.toggleEnabled = function () {
  893. this.enabled = !this.enabled;
  894. }),
  895. (i.prototype.toggle = function (e) {
  896. var i = this;
  897. e &&
  898. ((i = t(e.currentTarget).data("bs." + this.type)),
  899. i ||
  900. ((i = new this.constructor(
  901. e.currentTarget,
  902. this.getDelegateOptions()
  903. )),
  904. t(e.currentTarget).data("bs." + this.type, i))),
  905. i.tip().hasClass("in") ? i.leave(i) : i.enter(i);
  906. }),
  907. (i.prototype.destroy = function () {
  908. clearTimeout(this.timeout),
  909. this.hide()
  910. .$element.off("." + this.type)
  911. .removeData("bs." + this.type);
  912. });
  913. var o = t.fn.tooltip;
  914. (t.fn.tooltip = e),
  915. (t.fn.tooltip.Constructor = i),
  916. (t.fn.tooltip.noConflict = function () {
  917. return (t.fn.tooltip = o), this;
  918. });
  919. })(jQuery);
  920. !(function (e, t, n) {
  921. "undefined" != typeof module && module.exports
  922. ? (module.exports = n())
  923. : "function" == typeof define && define.amd
  924. ? define(n)
  925. : (t[e] = n());
  926. })("Keen", this, function () {
  927. "use strict";
  928. function Keen() {
  929. return _init.apply(this, arguments);
  930. }
  931. function _init(e) {
  932. if (_isUndefined(e))
  933. throw new Error(
  934. "Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/"
  935. );
  936. if (
  937. _isUndefined(e.projectId) ||
  938. "String" !== _type(e.projectId) ||
  939. e.projectId.length < 1
  940. )
  941. throw new Error("Please provide a projectId");
  942. this.configure(e);
  943. }
  944. function _extend(e) {
  945. for (var t = 1; t < arguments.length; t++)
  946. for (var n in arguments[t]) e[n] = arguments[t][n];
  947. return e;
  948. }
  949. function _isUndefined(e) {
  950. return void 0 === e;
  951. }
  952. function _type(e) {
  953. var t = e && e.constructor ? e.constructor.toString() : void 0;
  954. return t ? t.match(/function (.*)\(/)[1] : "Null";
  955. }
  956. function _each(e, t, n) {
  957. var r;
  958. if (!e) return 0;
  959. if (((n = n ? n : e), "array" === _type(e))) {
  960. for (r = 0; r < e.length; r++) if (t.call(n, e[r], r, e) === !1) return 0;
  961. } else for (r in e) if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1) return 0;
  962. return 1;
  963. }
  964. function _parse_params(e) {
  965. for (
  966. var t,
  967. n = {},
  968. r = /\+/g,
  969. i = /([^&=]+)=?([^&]*)/g,
  970. o = function (e) {
  971. return decodeURIComponent(e.replace(r, " "));
  972. },
  973. a = e.split("?")[1];
  974. (t = i.exec(a));
  975. )
  976. n[o(t[1])] = o(t[2]);
  977. return n;
  978. }
  979. function _set_protocol(e) {
  980. switch (e) {
  981. case "http":
  982. return "http";
  983. case "auto":
  984. return location.protocol.replace(/:/g, "");
  985. case "https":
  986. case void 0:
  987. default:
  988. return "https";
  989. }
  990. }
  991. function _set_request_type(e) {
  992. var t = e || "jsonp",
  993. n = !1;
  994. return (
  995. ("Object" === _type(XMLHttpRequest) ||
  996. "Function" === _type(XMLHttpRequest)) &&
  997. "withCredentials" in new XMLHttpRequest() &&
  998. (n = !0),
  999. null == t || "xhr" == t ? (n ? "xhr" : "jsonp") : t
  1000. );
  1001. }
  1002. function _build_url(e) {
  1003. return this.client.endpoint + "/projects/" + this.client.projectId + e;
  1004. }
  1005. function _uploadEvent(e, t, n, r, i) {
  1006. var o = _build_url.apply(this, ["/events/" + e]),
  1007. a = {};
  1008. (n = n !== !1),
  1009. this.client.globalProperties && (a = this.client.globalProperties(e));
  1010. for (var c in t) t.hasOwnProperty(c) && (a[c] = t[c]);
  1011. switch (this.client.requestType) {
  1012. case "xhr":
  1013. _request.xhr.apply(this, [
  1014. "POST",
  1015. o,
  1016. null,
  1017. a,
  1018. this.client.writeKey,
  1019. n,
  1020. r,
  1021. i,
  1022. ]);
  1023. break;
  1024. case "jsonp":
  1025. var s = JSON.stringify(a),
  1026. l = Keen.Base64.encode(s);
  1027. (o = o + "?api_key=" + this.client.writeKey),
  1028. (o = o + "&data=" + l),
  1029. (o = o + "&modified=" + new Date().getTime()),
  1030. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  1031. break;
  1032. case "beacon":
  1033. var s = JSON.stringify(a),
  1034. l = Keen.Base64.encode(s);
  1035. (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)),
  1036. (o = o + "&data=" + encodeURIComponent(l)),
  1037. (o = o + "&modified=" + encodeURIComponent(new Date().getTime())),
  1038. (o += "&c=clv1"),
  1039. _request.beacon.apply(this, [o, null, r, i]);
  1040. }
  1041. }
  1042. Keen.prototype.configure = function (e) {
  1043. return (
  1044. (e.host = _isUndefined(e.host)
  1045. ? "api.keen.io/3.0"
  1046. : e.host.replace(/.*?:\/\//g, "")),
  1047. (e.protocol = _set_protocol(e.protocol)),
  1048. (e.requestType = _set_request_type(e.requestType)),
  1049. (this.client = {
  1050. projectId: e.projectId,
  1051. writeKey: e.writeKey,
  1052. readKey: e.readKey,
  1053. globalProperties: null,
  1054. endpoint: e.protocol + "://" + e.host,
  1055. requestType: e.requestType,
  1056. }),
  1057. Keen.trigger("client", this, e),
  1058. this.trigger("ready"),
  1059. this
  1060. );
  1061. };
  1062. var _request = {
  1063. xhr: function (e, t, n, r, i, o, a, c) {
  1064. if (!i)
  1065. return Keen.log(
  1066. "Please provide a writeKey for https://keen.io/project/" +
  1067. this.client.projectId
  1068. );
  1069. var s = new XMLHttpRequest();
  1070. if (
  1071. ((s.onreadystatechange = function () {
  1072. if (4 == s.readyState)
  1073. if (s.status >= 200 && s.status < 300) {
  1074. var e;
  1075. try {
  1076. e = JSON.parse(s.responseText);
  1077. } catch (e) {
  1078. Keen.log(
  1079. "Could not JSON parse HTTP response: " + s.responseText
  1080. ),
  1081. c && c(s, e);
  1082. }
  1083. a && e && a(e);
  1084. } else Keen.log("HTTP request failed."), c && c(s, null);
  1085. }),
  1086. s.open(e, t, o),
  1087. i && s.setRequestHeader("Authorization", i),
  1088. r && s.setRequestHeader("Content-Type", "application/json"),
  1089. n)
  1090. )
  1091. for (var l in n) n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  1092. var u = r ? JSON.stringify(r) : null;
  1093. s.send(u);
  1094. },
  1095. jsonp: function (e, t, n, r) {
  1096. if (!t)
  1097. return Keen.log(
  1098. "Please provide a writeKey for https://keen.io/project/" +
  1099. this.client.projectId
  1100. );
  1101. if (t && e.indexOf("api_key") < 0) {
  1102. var i = e.indexOf("?") > 0 ? "&" : "?";
  1103. e = e + i + "api_key=" + t;
  1104. }
  1105. for (var o = "keenJSONPCallback" + new Date().getTime(); o in window; )
  1106. o += "a";
  1107. var a = !1;
  1108. (window[o] = function (e) {
  1109. (a = !0), n && e && n(e), (window[o] = void 0);
  1110. }),
  1111. (e = e + "&jsonp=" + o);
  1112. var c = document.createElement("script");
  1113. (c.id = "keen-jsonp"),
  1114. (c.src = e),
  1115. document.getElementsByTagName("head")[0].appendChild(c),
  1116. (c.onreadystatechange = function () {
  1117. a === !1 && "loaded" === this.readyState && ((a = !0), r && r());
  1118. }),
  1119. (c.onerror = function () {
  1120. a === !1 && ((a = !0), r && r());
  1121. });
  1122. },
  1123. beacon: function (e, t, n, r) {
  1124. if (t && e.indexOf("api_key") < 0) {
  1125. var i = e.indexOf("?") > 0 ? "&" : "?";
  1126. e = e + i + "api_key=" + t;
  1127. }
  1128. var o = !1,
  1129. a = document.createElement("img");
  1130. (a.onload = function () {
  1131. if (((o = !0), "naturalHeight" in this)) {
  1132. if (this.naturalHeight + this.naturalWidth === 0)
  1133. return void this.onerror();
  1134. } else if (this.width + this.height === 0) return void this.onerror();
  1135. n &&
  1136. n({
  1137. created: !0,
  1138. });
  1139. }),
  1140. (a.onerror = function () {
  1141. (o = !0), r && r();
  1142. }),
  1143. (a.src = e);
  1144. },
  1145. },
  1146. Events = (Keen.Events = {
  1147. on: function (e, t) {
  1148. this.listeners || (this.listeners = {});
  1149. var n = this.listeners[e] || (this.listeners[e] = []);
  1150. return (
  1151. n.push({
  1152. callback: t,
  1153. }),
  1154. this
  1155. );
  1156. },
  1157. off: function (e, t) {
  1158. if (!e && !t)
  1159. return (this.listeners = void 0), delete this.listeners, this;
  1160. for (var n = this.listeners[e] || [], r = n.length; r--; )
  1161. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  1162. (t && 0 != n.length) ||
  1163. ((this.listeners[e] = void 0), delete this.listeners[e]);
  1164. return this;
  1165. },
  1166. trigger: function (e) {
  1167. if (!this.listeners) return this;
  1168. for (
  1169. var t = Array.prototype.slice.call(arguments, 1),
  1170. n = this.listeners[e] || [],
  1171. r = 0;
  1172. r < n.length;
  1173. r++
  1174. )
  1175. n[r].callback.apply(this, t);
  1176. return this;
  1177. },
  1178. });
  1179. _extend(Keen.prototype, Events),
  1180. _extend(Keen, Events),
  1181. (Keen.loaded = !0),
  1182. (Keen.utils = {
  1183. each: _each,
  1184. extend: _extend,
  1185. parseParams: _parse_params,
  1186. }),
  1187. (Keen.ready = function (e) {
  1188. Keen.loaded ? e() : Keen.on("ready", e);
  1189. }),
  1190. (Keen.log = function (e) {
  1191. "object" == typeof console && console.log("[Keen IO]", e);
  1192. });
  1193. var Plugins = (Keen.Plugins = {});
  1194. (Keen.prototype.addEvent = function () {
  1195. _uploadEvent.apply(this, arguments);
  1196. }),
  1197. (Keen.prototype.addEventSync = function (e, t, n, r) {
  1198. _uploadEvent.apply(this, [e, t, !1, n, r]);
  1199. }),
  1200. (Keen.prototype.trackExternalLink = function (e, t, n, r, i) {
  1201. var o = e,
  1202. a = o.metaKey,
  1203. c = o.target,
  1204. s = !1,
  1205. l = function () {};
  1206. return (
  1207. void 0 === r && (r = 500),
  1208. "A" === c.nodeName
  1209. ? (l = function () {
  1210. a || s || ((s = !0), (window.location = c.href));
  1211. })
  1212. : "FORM" === c.nodeName &&
  1213. (l = function () {
  1214. s || ((s = !0), c.submit());
  1215. }),
  1216. i &&
  1217. (l = function () {
  1218. s || ((s = !0), i());
  1219. }),
  1220. _uploadEvent.call(this, t, n, l, l),
  1221. setTimeout(function () {
  1222. l();
  1223. }, r),
  1224. !!a && void 0
  1225. );
  1226. }),
  1227. (Keen.prototype.setGlobalProperties = function (e) {
  1228. if (!this.client)
  1229. return Keen.log(
  1230. "Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/"
  1231. );
  1232. if (!e || "function" != typeof e)
  1233. throw new Error("Invalid value for global properties: " + e);
  1234. this.client.globalProperties = e;
  1235. }),
  1236. (Keen.Base64 = {
  1237. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1238. encode: function (e) {
  1239. var t,
  1240. n,
  1241. r,
  1242. i,
  1243. o,
  1244. a,
  1245. c,
  1246. s = "",
  1247. l = 0,
  1248. u = this.map;
  1249. for (e = this.utf8.encode(e); l < e.length; )
  1250. (t = e.charCodeAt(l++)),
  1251. (n = e.charCodeAt(l++)),
  1252. (r = e.charCodeAt(l++)),
  1253. (i = t >> 2),
  1254. (o = ((3 & t) << 4) | (n >> 4)),
  1255. (a = isNaN(n) ? 64 : ((15 & n) << 2) | (r >> 6)),
  1256. (c = isNaN(n) || isNaN(r) ? 64 : 63 & r),
  1257. (s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c));
  1258. return s;
  1259. },
  1260. decode: function (e) {
  1261. var t,
  1262. n,
  1263. r,
  1264. i,
  1265. o,
  1266. a,
  1267. c,
  1268. s = "",
  1269. l = 0,
  1270. u = this.map,
  1271. f = String.fromCharCode;
  1272. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1273. (t = u.indexOf(e.charAt(l++))),
  1274. (n = u.indexOf(e.charAt(l++))),
  1275. (r = u.indexOf(e.charAt(l++))),
  1276. (i = u.indexOf(e.charAt(l++))),
  1277. (o = (t << 2) | (n >> 4)),
  1278. (a = ((15 & n) << 4) | (r >> 2)),
  1279. (c = ((3 & r) << 6) | i),
  1280. (s = s + (f(o) + (64 != r ? f(a) : "")) + (64 != i ? f(c) : ""));
  1281. return this.utf8.decode(s);
  1282. },
  1283. utf8: {
  1284. encode: function (e) {
  1285. for (var t, n = "", r = 0, i = String.fromCharCode; r < e.length; )
  1286. (t = e.charCodeAt(r++)),
  1287. (n +=
  1288. 128 > t
  1289. ? i(t)
  1290. : t > 127 && 2048 > t
  1291. ? i((t >> 6) | 192) + i((63 & t) | 128)
  1292. : i((t >> 12) | 224) +
  1293. i(((t >> 6) & 63) | 128) +
  1294. i((63 & t) | 128));
  1295. return n;
  1296. },
  1297. decode: function (e) {
  1298. for (var t, n, r = "", i = 0, o = String.fromCharCode; i < e.length; )
  1299. (n = e.charCodeAt(i)),
  1300. (r +=
  1301. 128 > n
  1302. ? [o(n), i++][0]
  1303. : n > 191 && 224 > n
  1304. ? [
  1305. o(((31 & n) << 6) | (63 & (t = e.charCodeAt(i + 1)))),
  1306. (i += 2),
  1307. ][0]
  1308. : [
  1309. o(
  1310. ((15 & n) << 12) |
  1311. ((63 & (t = e.charCodeAt(i + 1))) << 6) |
  1312. (63 & (c3 = e.charCodeAt(i + 2)))
  1313. ),
  1314. (i += 3),
  1315. ][0]);
  1316. return r;
  1317. },
  1318. },
  1319. }),
  1320. "object" != typeof JSON && (JSON = {}),
  1321. (function () {
  1322. function f(e) {
  1323. return 10 > e ? "0" + e : e;
  1324. }
  1325. function quote(e) {
  1326. return (
  1327. (escapable.lastIndex = 0),
  1328. escapable.test(e)
  1329. ? '"' +
  1330. e.replace(escapable, function (e) {
  1331. var t = meta[e];
  1332. return "string" == typeof t
  1333. ? t
  1334. : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4);
  1335. }) +
  1336. '"'
  1337. : '"' + e + '"'
  1338. );
  1339. }
  1340. function str(e, t) {
  1341. var n,
  1342. r,
  1343. i,
  1344. o,
  1345. a,
  1346. c = gap,
  1347. s = t[e];
  1348. switch (
  1349. (s &&
  1350. "object" == typeof s &&
  1351. "function" == typeof s.toJSON &&
  1352. (s = s.toJSON(e)),
  1353. "function" == typeof rep && (s = rep.call(t, e, s)),
  1354. typeof s)
  1355. ) {
  1356. case "string":
  1357. return quote(s);
  1358. case "number":
  1359. return isFinite(s) ? String(s) : "null";
  1360. case "boolean":
  1361. case "null":
  1362. return String(s);
  1363. case "object":
  1364. if (!s) return "null";
  1365. if (
  1366. ((gap += indent),
  1367. (a = []),
  1368. "[object Array]" === Object.prototype.toString.apply(s))
  1369. ) {
  1370. for (o = s.length, n = 0; o > n; n += 1)
  1371. a[n] = str(n, s) || "null";
  1372. return (
  1373. (i =
  1374. 0 === a.length
  1375. ? "[]"
  1376. : gap
  1377. ? "[\n" + gap + a.join(",\n" + gap) + "\n" + c + "]"
  1378. : "[" + a.join(",") + "]"),
  1379. (gap = c),
  1380. i
  1381. );
  1382. }
  1383. if (rep && "object" == typeof rep)
  1384. for (o = rep.length, n = 0; o > n; n += 1)
  1385. "string" == typeof rep[n] &&
  1386. ((r = rep[n]),
  1387. (i = str(r, s)),
  1388. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1389. else
  1390. for (r in s)
  1391. Object.prototype.hasOwnProperty.call(s, r) &&
  1392. ((i = str(r, s)),
  1393. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1394. return (
  1395. (i =
  1396. 0 === a.length
  1397. ? "{}"
  1398. : gap
  1399. ? "{\n" + gap + a.join(",\n" + gap) + "\n" + c + "}"
  1400. : "{" + a.join(",") + "}"),
  1401. (gap = c),
  1402. i
  1403. );
  1404. }
  1405. }
  1406. "function" != typeof Date.prototype.toJSON &&
  1407. ((Date.prototype.toJSON = function () {
  1408. return isFinite(this.valueOf())
  1409. ? this.getUTCFullYear() +
  1410. "-" +
  1411. f(this.getUTCMonth() + 1) +
  1412. "-" +
  1413. f(this.getUTCDate()) +
  1414. "T" +
  1415. f(this.getUTCHours()) +
  1416. ":" +
  1417. f(this.getUTCMinutes()) +
  1418. ":" +
  1419. f(this.getUTCSeconds()) +
  1420. "Z"
  1421. : null;
  1422. }),
  1423. (String.prototype.toJSON =
  1424. Number.prototype.toJSON =
  1425. Boolean.prototype.toJSON =
  1426. function () {
  1427. return this.valueOf();
  1428. }));
  1429. var cx =
  1430. /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  1431. escapable =
  1432. /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  1433. gap,
  1434. indent,
  1435. meta = {
  1436. "\b": "\\b",
  1437. "\t": "\\t",
  1438. "\n": "\\n",
  1439. "\f": "\\f",
  1440. "\r": "\\r",
  1441. '"': '\\"',
  1442. "\\": "\\\\",
  1443. },
  1444. rep;
  1445. "function" != typeof JSON.stringify &&
  1446. (JSON.stringify = function (e, t, n) {
  1447. var r;
  1448. if (((gap = ""), (indent = ""), "number" == typeof n))
  1449. for (r = 0; n > r; r += 1) indent += " ";
  1450. else "string" == typeof n && (indent = n);
  1451. if (
  1452. ((rep = t),
  1453. t &&
  1454. "function" != typeof t &&
  1455. ("object" != typeof t || "number" != typeof t.length))
  1456. )
  1457. throw new Error("JSON.stringify");
  1458. return str("", {
  1459. "": e,
  1460. });
  1461. }),
  1462. "function" != typeof JSON.parse &&
  1463. (JSON.parse = function (text, reviver) {
  1464. function walk(e, t) {
  1465. var n,
  1466. r,
  1467. i = e[t];
  1468. if (i && "object" == typeof i)
  1469. for (n in i)
  1470. Object.prototype.hasOwnProperty.call(i, n) &&
  1471. ((r = walk(i, n)), void 0 !== r ? (i[n] = r) : delete i[n]);
  1472. return reviver.call(e, t, i);
  1473. }
  1474. var j;
  1475. if (
  1476. ((text = String(text)),
  1477. (cx.lastIndex = 0),
  1478. cx.test(text) &&
  1479. (text = text.replace(cx, function (e) {
  1480. return (
  1481. "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1482. );
  1483. })),
  1484. /^[\],:{}\s]*$/.test(
  1485. text
  1486. .replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
  1487. .replace(
  1488. /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
  1489. "]"
  1490. )
  1491. .replace(/(?:^|:|,)(?:\s*\[)+/g, "")
  1492. ))
  1493. )
  1494. return (
  1495. (j = eval("(" + text + ")")),
  1496. "function" == typeof reviver
  1497. ? walk(
  1498. {
  1499. "": j,
  1500. },
  1501. ""
  1502. )
  1503. : j
  1504. );
  1505. throw new SyntaxError("JSON.parse");
  1506. });
  1507. })(),
  1508. !(function (e, t, n) {
  1509. "undefined" != typeof module && module.exports
  1510. ? (module.exports = n())
  1511. : "function" == typeof define && define.amd
  1512. ? define(n)
  1513. : (t[e] = n());
  1514. })("domready", Keen.utils, function (e) {
  1515. function t(e) {
  1516. for (d = 1; (e = r.shift()); ) e();
  1517. }
  1518. var n,
  1519. r = [],
  1520. i = !1,
  1521. o = document,
  1522. a = o.documentElement,
  1523. c = a.doScroll,
  1524. s = "DOMContentLoaded",
  1525. l = "addEventListener",
  1526. u = "onreadystatechange",
  1527. f = "readyState",
  1528. p = c ? /^loaded|^c/ : /^loaded|c/,
  1529. d = p.test(o[f]);
  1530. return (
  1531. o[l] &&
  1532. o[l](
  1533. s,
  1534. (n = function () {
  1535. o.removeEventListener(s, n, i), t();
  1536. }),
  1537. i
  1538. ),
  1539. c &&
  1540. o.attachEvent(
  1541. u,
  1542. (n = function () {
  1543. /^c/.test(o[f]) && (o.detachEvent(u, n), t());
  1544. })
  1545. ),
  1546. (e = c
  1547. ? function (t) {
  1548. self != top
  1549. ? d
  1550. ? t()
  1551. : r.push(t)
  1552. : (function () {
  1553. try {
  1554. a.doScroll("left");
  1555. } catch (n) {
  1556. return setTimeout(function () {
  1557. e(t);
  1558. }, 50);
  1559. }
  1560. t();
  1561. })();
  1562. }
  1563. : function (e) {
  1564. d ? e() : r.push(e);
  1565. })
  1566. );
  1567. });
  1568. var loaded = window.Keen,
  1569. cached = window._Keen || {},
  1570. clients,
  1571. ready;
  1572. if (loaded && cached) {
  1573. (clients = cached.clients || {}), (ready = cached.ready || []);
  1574. for (var instance in clients)
  1575. if (clients.hasOwnProperty(instance)) {
  1576. var client = clients[instance];
  1577. for (var method in Keen.prototype)
  1578. Keen.prototype.hasOwnProperty(method) &&
  1579. (loaded.prototype[method] = Keen.prototype[method]);
  1580. if (
  1581. ((loaded.Query = Keen.Query ? Keen.Query : function () {}),
  1582. (loaded.Visualization = Keen.Visualization
  1583. ? Keen.Visualization
  1584. : function () {}),
  1585. client._config &&
  1586. (client.configure.call(client, client._config),
  1587. delete client._config),
  1588. client._setGlobalProperties)
  1589. ) {
  1590. for (
  1591. var globals = client._setGlobalProperties, i = 0;
  1592. i < globals.length;
  1593. i++
  1594. )
  1595. client.setGlobalProperties.apply(client, globals[i]);
  1596. delete client._setGlobalProperties;
  1597. }
  1598. if (client._addEvent) {
  1599. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1600. client.addEvent.apply(client, queue[i]);
  1601. delete client._addEvent;
  1602. }
  1603. var callback = client._on || [];
  1604. if (client._on) {
  1605. for (var i = 0; i < callback.length; i++)
  1606. client.on.apply(client, callback[i]);
  1607. client.trigger("ready"), delete client._on;
  1608. }
  1609. }
  1610. for (var i = 0; i < ready.length; i++) {
  1611. var callback = ready[i];
  1612. Keen.on("ready", function () {
  1613. callback();
  1614. });
  1615. }
  1616. }
  1617. return (
  1618. Keen.loaded &&
  1619. setTimeout(function () {
  1620. Keen.utils.domready(function () {
  1621. Keen.trigger("ready");
  1622. });
  1623. }, 0),
  1624. Keen
  1625. );
  1626. });
  1627. !(function () {
  1628. var t = (window.analytics = window.analytics || []);
  1629. if (!t.initialize) {
  1630. if (t.invoked)
  1631. return void (
  1632. window.console &&
  1633. console.error &&
  1634. console.error("Segment snippet included twice.")
  1635. );
  1636. (t.invoked = !0),
  1637. (t.methods = [
  1638. "trackSubmit",
  1639. "trackClick",
  1640. "trackLink",
  1641. "trackForm",
  1642. "pageview",
  1643. "identify",
  1644. "reset",
  1645. "group",
  1646. "track",
  1647. "ready",
  1648. "alias",
  1649. "debug",
  1650. "page",
  1651. "once",
  1652. "off",
  1653. "on",
  1654. ]),
  1655. (t.factory = function (e) {
  1656. return function () {
  1657. var n = Array.prototype.slice.call(arguments);
  1658. return n.unshift(e), t.push(n), t;
  1659. };
  1660. });
  1661. for (var e = 0; e < t.methods.length; e++) {
  1662. var n = t.methods[e];
  1663. t[n] = t.factory(n);
  1664. }
  1665. (t.load = function (t) {
  1666. var e = document.createElement("script");
  1667. (e.type = "text/javascript"),
  1668. (e.async = !0),
  1669. (e.src =
  1670. ("https:" === document.location.protocol ? "https://" : "http://") +
  1671. "cdn.segment.com/analytics.js/v1/" +
  1672. t +
  1673. "/analytics.min.js");
  1674. var n = document.getElementsByTagName("script")[0];
  1675. n.parentNode.insertBefore(e, n);
  1676. }),
  1677. (t.SNIPPET_VERSION = "4.0.0");
  1678. }
  1679. })();
  1680. !(function (i, e) {
  1681. "use strict";
  1682. var s = "",
  1683. r = "?",
  1684. o = "function",
  1685. a = "undefined",
  1686. n = "object",
  1687. t = "major",
  1688. d = "model",
  1689. w = "name",
  1690. l = "type",
  1691. p = "vendor",
  1692. m = "version",
  1693. c = "architecture",
  1694. u = "console",
  1695. g = "mobile",
  1696. f = "tablet",
  1697. h = "smarttv",
  1698. b = {
  1699. has: function (i, e) {
  1700. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1;
  1701. },
  1702. lowerize: function (i) {
  1703. return i.toLowerCase();
  1704. },
  1705. },
  1706. y = {
  1707. rgx: function () {
  1708. for (
  1709. var i, s, r, t, d, w, l, p = 0, m = arguments;
  1710. p < m.length;
  1711. p += 2
  1712. ) {
  1713. var c = m[p],
  1714. u = m[p + 1];
  1715. if (typeof i === a) {
  1716. i = {};
  1717. for (t in u)
  1718. (d = u[t]), typeof d === n ? (i[d[0]] = e) : (i[d] = e);
  1719. }
  1720. for (s = r = 0; s < c.length; s++)
  1721. if ((w = c[s].exec(this.getUA()))) {
  1722. for (t = 0; t < u.length; t++)
  1723. (l = w[++r]),
  1724. (d = u[t]),
  1725. typeof d === n && d.length > 0
  1726. ? 2 == d.length
  1727. ? typeof d[1] == o
  1728. ? (i[d[0]] = d[1].call(this, l))
  1729. : (i[d[0]] = d[1])
  1730. : 3 == d.length
  1731. ? typeof d[1] !== o || (d[1].exec && d[1].test)
  1732. ? (i[d[0]] = l ? l.replace(d[1], d[2]) : e)
  1733. : (i[d[0]] = l ? d[1].call(this, l, d[2]) : e)
  1734. : 4 == d.length &&
  1735. (i[d[0]] = l
  1736. ? d[3].call(this, l.replace(d[1], d[2]))
  1737. : e)
  1738. : (i[d] = l ? l : e);
  1739. break;
  1740. }
  1741. if (w) break;
  1742. }
  1743. return i;
  1744. },
  1745. str: function (i, s) {
  1746. for (var o in s)
  1747. if (typeof s[o] === n && s[o].length > 0) {
  1748. for (var a = 0; a < s[o].length; a++)
  1749. if (b.has(s[o][a], i)) return o === r ? e : o;
  1750. } else if (b.has(s[o], i)) return o === r ? e : o;
  1751. return i;
  1752. },
  1753. },
  1754. v = {
  1755. browser: {
  1756. oldsafari: {
  1757. major: {
  1758. 1: ["/8", "/1", "/3"],
  1759. 2: "/4",
  1760. "?": "/",
  1761. },
  1762. version: {
  1763. "1.0": "/8",
  1764. 1.2: "/1",
  1765. 1.3: "/3",
  1766. "2.0": "/412",
  1767. "2.0.2": "/416",
  1768. "2.0.3": "/417",
  1769. "2.0.4": "/419",
  1770. "?": "/",
  1771. },
  1772. },
  1773. },
  1774. device: {
  1775. sprint: {
  1776. model: {
  1777. "Evo Shift 4G": "7373KT",
  1778. },
  1779. vendor: {
  1780. HTC: "APA",
  1781. Sprint: "Sprint",
  1782. },
  1783. },
  1784. },
  1785. os: {
  1786. windows: {
  1787. version: {
  1788. ME: "4.90",
  1789. "NT 3.11": "NT3.51",
  1790. "NT 4.0": "NT4.0",
  1791. 2e3: "NT 5.0",
  1792. XP: ["NT 5.1", "NT 5.2"],
  1793. Vista: "NT 6.0",
  1794. 7: "NT 6.1",
  1795. 8: "NT 6.2",
  1796. 8.1: "NT 6.3",
  1797. RT: "ARM",
  1798. },
  1799. },
  1800. },
  1801. },
  1802. k = {
  1803. browser: [
  1804. [
  1805. /(opera\smini)\/((\d+)?[\w\.-]+)/i,
  1806. /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i,
  1807. /(opera).+version\/((\d+)?[\w\.]+)/i,
  1808. /(opera)[\/\s]+((\d+)?[\w\.]+)/i,
  1809. ],
  1810. [w, m, t],
  1811. [/\s(opr)\/((\d+)?[\w\.]+)/i],
  1812. [[w, "Opera"], m, t],
  1813. [
  1814. /(kindle)\/((\d+)?[\w\.]+)/i,
  1815. /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i,
  1816. /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i,
  1817. /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i,
  1818. /(rekonq)((?:\/)[\w\.]+)*/i,
  1819. /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i,
  1820. ],
  1821. [w, m, t],
  1822. [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i],
  1823. [[w, "IE"], m, t],
  1824. [/(yabrowser)\/((\d+)?[\w\.]+)/i],
  1825. [[w, "Yandex"], m, t],
  1826. [/(comodo_dragon)\/((\d+)?[\w\.]+)/i],
  1827. [[w, /_/g, " "], m, t],
  1828. [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i],
  1829. [w, m, t],
  1830. [/(dolfin)\/((\d+)?[\w\.]+)/i],
  1831. [[w, "Dolphin"], m, t],
  1832. [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i],
  1833. [[w, "Chrome"], m, t],
  1834. [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i],
  1835. [m, t, [w, "Mobile Safari"]],
  1836. [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i],
  1837. [m, t, w],
  1838. [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i],
  1839. [
  1840. w,
  1841. [t, y.str, v.browser.oldsafari.major],
  1842. [m, y.str, v.browser.oldsafari.version],
  1843. ],
  1844. [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i],
  1845. [w, m, t],
  1846. [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i],
  1847. [[w, "Netscape"], m, t],
  1848. [
  1849. /(swiftfox)/i,
  1850. /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i,
  1851. /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i,
  1852. /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i,
  1853. /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i,
  1854. /(links)\s\(((\d+)?[\w\.]+)/i,
  1855. /(gobrowser)\/?((\d+)?[\w\.]+)*/i,
  1856. /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i,
  1857. /(mosaic)[\/\s]((\d+)?[\w\.]+)/i,
  1858. ],
  1859. [w, m, t],
  1860. [
  1861. /(apple(?:coremedia|))\/((\d+)[\w\._]+)/i,
  1862. /(coremedia) v((\d+)[\w\._]+)/i,
  1863. ],
  1864. [w, m, t],
  1865. [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i],
  1866. [w, m],
  1867. [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i],
  1868. [w, m, t],
  1869. [
  1870. /(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i,
  1871. /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i,
  1872. /(lg player|nexplayer)\s((\d+)[\d\.]+)/i,
  1873. /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i,
  1874. ],
  1875. [w, m, t],
  1876. [/(nexplayer)\s((\d+)[\w\.-]+)/i],
  1877. [w, m, t],
  1878. [/(flrp)\/((\d+)[\w\.-]+)/i],
  1879. [[w, "Flip Player"], m, t],
  1880. [
  1881. /(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i,
  1882. ],
  1883. [w],
  1884. [
  1885. /(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i,
  1886. ],
  1887. [w, m, t],
  1888. [
  1889. /(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i,
  1890. /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i,
  1891. /(lavf)((\d+)[\d\.]+)/i,
  1892. ],
  1893. [w, m, t],
  1894. [/(htc_one_s)\/((\d+)[\d\.]+)/i],
  1895. [[w, /_/g, " "], m, t],
  1896. [
  1897. /(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i,
  1898. ],
  1899. [w, m],
  1900. [
  1901. /(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i,
  1902. /(mplayer) unknown-((\d+)[\w\.\-]+)/i,
  1903. ],
  1904. [w, m, t],
  1905. [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i],
  1906. [w],
  1907. [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i],
  1908. [w, m, t],
  1909. [/(nokia\d+)\/((\d+)[\w\.-]+)/i],
  1910. [w, m, t],
  1911. [/\s(songbird)\/((\d+)[\w\.-]+)/i],
  1912. [w, m, t],
  1913. [
  1914. /(winamp)3 version ((\d+)[\w\.-]+)/i,
  1915. /(winamp)\s((\d+)[\w\.-]+)/i,
  1916. /(winamp)mpeg\/((\d+)[\w\.-]+)/i,
  1917. ],
  1918. [w, m, t],
  1919. [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i],
  1920. [w],
  1921. [
  1922. /(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i,
  1923. ],
  1924. [w, m, t],
  1925. [/(smp)((\d+)[\d\.]+)/i],
  1926. [w, m, t],
  1927. [
  1928. /(vlc) media player - version ((\d+)[\w\.]+)/i,
  1929. /(vlc)\/((\d+)[\w\.-]+)/i,
  1930. /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i,
  1931. /(foobar2000)\/((\d+)[\d\.]+)/i,
  1932. /(itunes)\/((\d+)[\d\.]+)/i,
  1933. ],
  1934. [w, m, t],
  1935. [
  1936. /(wmplayer)\/((\d+)[\w\.-]+)/i,
  1937. /(windows-media-player)\/((\d+)[\w\.-]+)/i,
  1938. ],
  1939. [[w, /-/g, " "], m, t],
  1940. [
  1941. /windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i,
  1942. ],
  1943. [m, t, [w, "Windows"]],
  1944. [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i],
  1945. [w, m, t],
  1946. [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i],
  1947. [[w, "rad.io"], m, t],
  1948. ],
  1949. cpu: [
  1950. [/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],
  1951. [[c, "amd64"]],
  1952. [/(ia32(?=;))/i],
  1953. [[c, b.lowerize]],
  1954. [/((?:i[346]|x)86)[;\)]/i],
  1955. [[c, "ia32"]],
  1956. [/windows\s(ce|mobile);\sppc;/i],
  1957. [[c, "arm"]],
  1958. [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],
  1959. [[c, /ower/, "", b.lowerize]],
  1960. [/(sun4\w)[;\)]/i],
  1961. [[c, "sparc"]],
  1962. [
  1963. /(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i,
  1964. ],
  1965. [c, b.lowerize],
  1966. ],
  1967. device: [
  1968. [/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],
  1969. [d, p, [l, f]],
  1970. [/applecoremedia\/[\w\.]+ \((ipad)/],
  1971. [d, [p, "Apple"], [l, f]],
  1972. [/(apple\s{0,1}tv)/i],
  1973. [
  1974. [d, "Apple TV"],
  1975. [p, "Apple"],
  1976. ],
  1977. [
  1978. /(hp).+(touchpad)/i,
  1979. /(kindle)\/([\w\.]+)/i,
  1980. /\s(nook)[\w\s]+build\/(\w+)/i,
  1981. /(dell)\s(strea[kpr\s\d]*[\dko])/i,
  1982. ],
  1983. [p, d, [l, f]],
  1984. [/\((ip[honed|\s\w*]+);.+(apple)/i],
  1985. [d, p, [l, g]],
  1986. [/\((ip[honed|\s\w*]+);/i],
  1987. [d, [p, "Apple"], [l, g]],
  1988. [
  1989. /(blackberry)[\s-]?(\w+)/i,
  1990. /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i,
  1991. /(hp)\s([\w\s]+\w)/i,
  1992. /(asus)-?(\w+)/i,
  1993. ],
  1994. [p, d, [l, g]],
  1995. [/\((bb10);\s(\w+)/i],
  1996. [[p, "BlackBerry"], d, [l, g]],
  1997. [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i],
  1998. [[p, "Asus"], d, [l, f]],
  1999. [/(sony)\s(tablet\s[ps])/i],
  2000. [p, d, [l, f]],
  2001. [/(nintendo)\s([wids3u]+)/i],
  2002. [p, d, [l, u]],
  2003. [/((playstation)\s[3portablevi]+)/i],
  2004. [[p, "Sony"], d, [l, u]],
  2005. [/(sprint\s(\w+))/i],
  2006. [
  2007. [p, y.str, v.device.sprint.vendor],
  2008. [d, y.str, v.device.sprint.model],
  2009. [l, g],
  2010. ],
  2011. [
  2012. /(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,
  2013. /(zte)-(\w+)*/i,
  2014. /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i,
  2015. ],
  2016. [p, [d, /_/g, " "], [l, g]],
  2017. [
  2018. /\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i,
  2019. /(mot)[\s-]?(\w+)*/i,
  2020. ],
  2021. [[p, "Motorola"], d, [l, g]],
  2022. [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i],
  2023. [[p, "Motorola"], d, [l, f]],
  2024. [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i],
  2025. [[p, "Samsung"], d, [l, f]],
  2026. [
  2027. /((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i,
  2028. /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,
  2029. /sec-((sgh\w+))/i,
  2030. ],
  2031. [[p, "Samsung"], d, [l, g]],
  2032. [/(sie)-(\w+)*/i],
  2033. [[p, "Siemens"], d, [l, g]],
  2034. [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i],
  2035. [[p, "Nokia"], d, [l, g]],
  2036. [/android\s3\.[\s\w-;]{10}((a\d{3}))/i],
  2037. [[p, "Acer"], d, [l, f]],
  2038. [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i],
  2039. [[p, "LG"], d, [l, f]],
  2040. [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i],
  2041. [[p, "LG"], d, [l, g]],
  2042. [/android.+((ideatab[a-z0-9\-\s]+))/i],
  2043. [[p, "Lenovo"], d, [l, f]],
  2044. [/(lg) netcast\.tv/i],
  2045. [p, [l, h]],
  2046. [/(mobile|tablet);.+rv\:.+gecko\//i],
  2047. [l, p, d],
  2048. ],
  2049. engine: [
  2050. [
  2051. /(presto)\/([\w\.]+)/i,
  2052. /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,
  2053. /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,
  2054. /(icab)[\/\s]([23]\.[\d\.]+)/i,
  2055. ],
  2056. [w, m],
  2057. [/rv\:([\w\.]+).*(gecko)/i],
  2058. [m, w],
  2059. ],
  2060. os: [
  2061. [/microsoft\s(windows)\s(vista|xp)/i],
  2062. [w, m],
  2063. [
  2064. /(windows)\snt\s6\.2;\s(arm)/i,
  2065. /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i,
  2066. ],
  2067. [w, [m, y.str, v.os.windows.version]],
  2068. [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],
  2069. [
  2070. [w, "Windows"],
  2071. [m, y.str, v.os.windows.version],
  2072. ],
  2073. [/\((bb)(10);/i],
  2074. [[w, "BlackBerry"], m],
  2075. [
  2076. /(blackberry)\w*\/?([\w\.]+)*/i,
  2077. /(tizen)\/([\w\.]+)/i,
  2078. /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i,
  2079. ],
  2080. [w, m],
  2081. [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],
  2082. [[w, "Symbian"], m],
  2083. [/mozilla.+\(mobile;.+gecko.+firefox/i],
  2084. [[w, "Firefox OS"], m],
  2085. [
  2086. /(nintendo|playstation)\s([wids3portablevu]+)/i,
  2087. /(mint)[\/\s\(]?(\w+)*/i,
  2088. /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i,
  2089. /(hurd|linux)\s?([\w\.]+)*/i,
  2090. /(gnu)\s?([\w\.]+)*/i,
  2091. ],
  2092. [w, m],
  2093. [/(cros)\s[\w]+\s([\w\.]+\w)/i],
  2094. [[w, "Chromium OS"], m],
  2095. [/(sunos)\s?([\w\.]+\d)*/i],
  2096. [[w, "Solaris"], m],
  2097. [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],
  2098. [w, m],
  2099. [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],
  2100. [
  2101. [w, "iOS"],
  2102. [m, /_/g, "."],
  2103. ],
  2104. [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i],
  2105. [w, [m, /_/g, "."]],
  2106. [
  2107. /(haiku)\s(\w+)/i,
  2108. /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,
  2109. /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i,
  2110. /(unix)\s?([\w\.]+)*/i,
  2111. ],
  2112. [w, m],
  2113. ],
  2114. },
  2115. x = function (e) {
  2116. var r =
  2117. e ||
  2118. (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  2119. return this instanceof x
  2120. ? ((this.getBrowser = function () {
  2121. return y.rgx.apply(this, k.browser);
  2122. }),
  2123. (this.getCPU = function () {
  2124. return y.rgx.apply(this, k.cpu);
  2125. }),
  2126. (this.getDevice = function () {
  2127. return y.rgx.apply(this, k.device);
  2128. }),
  2129. (this.getEngine = function () {
  2130. return y.rgx.apply(this, k.engine);
  2131. }),
  2132. (this.getOS = function () {
  2133. return y.rgx.apply(this, k.os);
  2134. }),
  2135. (this.getResult = function () {
  2136. return {
  2137. ua: this.getUA(),
  2138. browser: this.getBrowser(),
  2139. engine: this.getEngine(),
  2140. os: this.getOS(),
  2141. device: this.getDevice(),
  2142. cpu: this.getCPU(),
  2143. };
  2144. }),
  2145. (this.getUA = function () {
  2146. return r;
  2147. }),
  2148. (this.setUA = function (i) {
  2149. return (r = i), this;
  2150. }),
  2151. void this.setUA(r))
  2152. : new x(e).getResult();
  2153. };
  2154. if (typeof exports !== a)
  2155. typeof module !== a && module.exports && (exports = module.exports = x),
  2156. (exports.UAParser = x);
  2157. else if (
  2158. ((i.UAParser = x),
  2159. typeof define === o &&
  2160. define.amd &&
  2161. define(function () {
  2162. return x;
  2163. }),
  2164. typeof i.jQuery !== a)
  2165. ) {
  2166. var A = i.jQuery,
  2167. _ = new x();
  2168. (A.ua = _.getResult()),
  2169. (A.ua.get = function () {
  2170. return _.getUA();
  2171. }),
  2172. (A.ua.set = function (i) {
  2173. _.setUA(i);
  2174. var e = _.getResult();
  2175. for (var s in e) A.ua[s] = e[s];
  2176. });
  2177. }
  2178. })(this);
  2179. window.Modernizr = (function (n, e, t) {
  2180. function o(n) {
  2181. d.cssText = n;
  2182. }
  2183. function r(n, e) {
  2184. return typeof n === e;
  2185. }
  2186. var i,
  2187. c,
  2188. u,
  2189. a = "2.8.2",
  2190. f = {},
  2191. s = e.documentElement,
  2192. l = "modernizr",
  2193. p = e.createElement(l),
  2194. d = p.style,
  2195. y = ({}.toString, {}),
  2196. w = [],
  2197. b = w.slice,
  2198. v = {}.hasOwnProperty;
  2199. (u =
  2200. r(v, "undefined") || r(v.call, "undefined")
  2201. ? function (n, e) {
  2202. return e in n && r(n.constructor.prototype[e], "undefined");
  2203. }
  2204. : function (n, e) {
  2205. return v.call(n, e);
  2206. }),
  2207. Function.prototype.bind ||
  2208. (Function.prototype.bind = function (n) {
  2209. var e = this;
  2210. if ("function" != typeof e) throw new TypeError();
  2211. var t = b.call(arguments, 1),
  2212. o = function () {
  2213. if (this instanceof o) {
  2214. var r = function () {};
  2215. r.prototype = e.prototype;
  2216. var i = new r(),
  2217. c = e.apply(i, t.concat(b.call(arguments)));
  2218. return Object(c) === c ? c : i;
  2219. }
  2220. return e.apply(n, t.concat(b.call(arguments)));
  2221. };
  2222. return o;
  2223. }),
  2224. (y.webgl = function () {
  2225. return !!n.WebGLRenderingContext;
  2226. });
  2227. for (var h in y)
  2228. u(y, h) &&
  2229. ((c = h.toLowerCase()), (f[c] = y[h]()), w.push((f[c] ? "" : "no-") + c));
  2230. return (
  2231. (f.addTest = function (n, e) {
  2232. if ("object" == typeof n) for (var o in n) u(n, o) && f.addTest(o, n[o]);
  2233. else {
  2234. if (((n = n.toLowerCase()), f[n] !== t)) return f;
  2235. (e = "function" == typeof e ? e() : e),
  2236. "undefined" != typeof enableClasses &&
  2237. enableClasses &&
  2238. (s.className += " " + (e ? "" : "no-") + n),
  2239. (f[n] = e);
  2240. }
  2241. return f;
  2242. }),
  2243. o(""),
  2244. (p = i = null),
  2245. (f._version = a),
  2246. f
  2247. );
  2248. })(this, this.document);
  2249. !(function (e, t, a) {
  2250. "use strict";
  2251. function n(t, h, m) {
  2252. function H(a) {
  2253. var n = 0,
  2254. i = Ee.length;
  2255. if (
  2256. ((Ce.old = e.extend({}, Ce)),
  2257. (Ie = we ? 0 : be[ge.horizontal ? "width" : "height"]()),
  2258. (ke = Be[ge.horizontal ? "width" : "height"]()),
  2259. (ze = we ? t : Pe[ge.horizontal ? "outerWidth" : "outerHeight"]()),
  2260. (Ee.length = 0),
  2261. (Ce.start = 0),
  2262. (Ce.end = q(ze - Ie, 0)),
  2263. Re)
  2264. ) {
  2265. (n = Ne.length), (qe = Pe.children(ge.itemSelector)), (Ne.length = 0);
  2266. var r,
  2267. s = c(Pe, ge.horizontal ? "paddingLeft" : "paddingTop"),
  2268. o = c(Pe, ge.horizontal ? "paddingRight" : "paddingBottom"),
  2269. l = "border-box" === e(qe).css("boxSizing"),
  2270. u = "none" !== qe.css("float"),
  2271. f = 0,
  2272. v = qe.length - 1;
  2273. (ze = 0),
  2274. qe.each(function (t, a) {
  2275. var n = e(a),
  2276. i = a.getBoundingClientRect(),
  2277. l = E(
  2278. ge.horizontal
  2279. ? i.width || i.right - i.left
  2280. : i.height || i.bottom - i.top
  2281. ),
  2282. d = c(n, ge.horizontal ? "marginLeft" : "marginTop"),
  2283. p = c(n, ge.horizontal ? "marginRight" : "marginBottom"),
  2284. h = l + d + p,
  2285. m = !d || !p,
  2286. g = {};
  2287. (g.el = a),
  2288. (g.size = m ? l : h),
  2289. (g.half = g.size / 2),
  2290. (g.start = ze + (m ? d : 0)),
  2291. (g.center = g.start - E(Ie / 2 - g.size / 2)),
  2292. (g.end = g.start - Ie + g.size),
  2293. t || (ze += s),
  2294. (ze += h),
  2295. ge.horizontal || u || (p && d && t > 0 && (ze -= N(d, p))),
  2296. t === v && ((g.end += o), (ze += o), (f = m ? p : 0)),
  2297. Ne.push(g),
  2298. (r = g);
  2299. }),
  2300. (Pe[0].style[ge.horizontal ? "width" : "height"] =
  2301. (l ? ze : ze - s - o) + "px"),
  2302. (ze -= f),
  2303. Ne.length
  2304. ? ((Ce.start = Ne[0][Me ? "center" : "start"]),
  2305. (Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start))
  2306. : (Ce.start = Ce.end = 0);
  2307. }
  2308. if (
  2309. ((Ce.center = E(Ce.end / 2 + Ce.start / 2)),
  2310. Q(),
  2311. Se.length &&
  2312. ke > 0 &&
  2313. (ge.dynamicHandle
  2314. ? ((Te = Ce.start === Ce.end ? ke : E((ke * Ie) / ze)),
  2315. (Te = d(Te, ge.minHandleSize, ke)),
  2316. (Se[0].style[ge.horizontal ? "width" : "height"] = Te + "px"))
  2317. : (Te = Se[ge.horizontal ? "outerWidth" : "outerHeight"]()),
  2318. (xe.end = ke - Te),
  2319. it || j()),
  2320. !we && Ie > 0)
  2321. ) {
  2322. var p = Ce.start,
  2323. h = "";
  2324. if (Re)
  2325. e.each(Ne, function (e, t) {
  2326. Me
  2327. ? Ee.push(t.center)
  2328. : t.start + t.size > p &&
  2329. p <= Ce.end &&
  2330. ((p = t.start),
  2331. Ee.push(p),
  2332. (p += Ie),
  2333. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end));
  2334. });
  2335. else for (; p - Ie < Ce.end; ) Ee.push(p), (p += Ie);
  2336. if (De[0] && i !== Ee.length) {
  2337. for (var m = 0; m < Ee.length; m++) h += ge.pageBuilder.call(ye, m);
  2338. (Ae = De.html(h).children()),
  2339. Ae.eq(Oe.activePage).addClass(ge.activeClass);
  2340. }
  2341. }
  2342. if (
  2343. ((Oe.slideeSize = ze),
  2344. (Oe.frameSize = Ie),
  2345. (Oe.sbSize = ke),
  2346. (Oe.handleSize = Te),
  2347. Re)
  2348. ) {
  2349. a &&
  2350. null != ge.startAt &&
  2351. (W(ge.startAt), ye[Le ? "toCenter" : "toStart"](ge.startAt));
  2352. var g = Ne[Oe.activeItem];
  2353. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end));
  2354. } else
  2355. a
  2356. ? null != ge.startAt && X(ge.startAt, 1)
  2357. : X(d(Ce.dest, Ce.start, Ce.end));
  2358. pe("load");
  2359. }
  2360. function X(e, t, a) {
  2361. if (Re && at.released && !a) {
  2362. var n = $(e),
  2363. i = e > Ce.start && e < Ce.end;
  2364. Le
  2365. ? (i && (e = Ne[n.centerItem].center),
  2366. Me && ge.activateMiddle && W(n.centerItem))
  2367. : i && (e = Ne[n.firstItem].start);
  2368. }
  2369. at.init && at.slidee && ge.elasticBounds
  2370. ? e > Ce.end
  2371. ? (e = Ce.end + (e - Ce.end) / 6)
  2372. : e < Ce.start && (e = Ce.start + (e - Ce.start) / 6)
  2373. : (e = d(e, Ce.start, Ce.end)),
  2374. (et.start = +new Date()),
  2375. (et.time = 0),
  2376. (et.from = Ce.cur),
  2377. (et.to = e),
  2378. (et.delta = e - Ce.cur),
  2379. (et.tweesing = at.tweese || (at.init && !at.slidee)),
  2380. (et.immediate =
  2381. !et.tweesing && (t || (at.init && at.slidee) || !ge.speed)),
  2382. (at.tweese = 0),
  2383. e !== Ce.dest && ((Ce.dest = e), pe("change"), it || Y()),
  2384. K(),
  2385. Q(),
  2386. Z(),
  2387. F();
  2388. }
  2389. function Y() {
  2390. if (ye.initialized) {
  2391. if (!it) return (it = w(Y)), void (at.released && pe("moveStart"));
  2392. et.immediate
  2393. ? (Ce.cur = et.to)
  2394. : et.tweesing
  2395. ? ((et.tweeseDelta = et.to - Ce.cur),
  2396. x(et.tweeseDelta) < 0.1
  2397. ? (Ce.cur = et.to)
  2398. : (Ce.cur +=
  2399. et.tweeseDelta *
  2400. (at.released ? ge.swingSpeed : ge.syncSpeed)))
  2401. : ((et.time = N(+new Date() - et.start, ge.speed)),
  2402. (Ce.cur =
  2403. et.from +
  2404. et.delta *
  2405. e.easing[ge.easing](
  2406. et.time / ge.speed,
  2407. et.time,
  2408. 0,
  2409. 1,
  2410. ge.speed
  2411. ))),
  2412. et.to === Ce.cur
  2413. ? ((Ce.cur = et.to), (at.tweese = it = 0))
  2414. : (it = w(Y)),
  2415. pe("move"),
  2416. we ||
  2417. (f
  2418. ? (Pe[0].style[f] =
  2419. v +
  2420. (ge.horizontal ? "translateX" : "translateY") +
  2421. "(" +
  2422. -Ce.cur +
  2423. "px)")
  2424. : (Pe[0].style[ge.horizontal ? "left" : "top"] =
  2425. -E(Ce.cur) + "px")),
  2426. !it && at.released && pe("moveEnd"),
  2427. j();
  2428. }
  2429. }
  2430. function j() {
  2431. Se.length &&
  2432. ((xe.cur =
  2433. Ce.start === Ce.end
  2434. ? 0
  2435. : (((at.init && !at.slidee ? Ce.dest : Ce.cur) - Ce.start) /
  2436. (Ce.end - Ce.start)) *
  2437. xe.end),
  2438. (xe.cur = d(E(xe.cur), xe.start, xe.end)),
  2439. _e.hPos !== xe.cur &&
  2440. ((_e.hPos = xe.cur),
  2441. f
  2442. ? (Se[0].style[f] =
  2443. v +
  2444. (ge.horizontal ? "translateX" : "translateY") +
  2445. "(" +
  2446. xe.cur +
  2447. "px)")
  2448. : (Se[0].style[ge.horizontal ? "left" : "top"] = xe.cur + "px")));
  2449. }
  2450. function F() {
  2451. Ae[0] &&
  2452. _e.page !== Oe.activePage &&
  2453. ((_e.page = Oe.activePage),
  2454. Ae.removeClass(ge.activeClass)
  2455. .eq(Oe.activePage)
  2456. .addClass(ge.activeClass),
  2457. pe("activePage", _e.page));
  2458. }
  2459. function M() {
  2460. (tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start)) || ye.stop(),
  2461. (ot = at.init ? w(M) : 0),
  2462. (tt.now = +new Date()),
  2463. (tt.pos = Ce.cur + ((tt.now - tt.lastTime) / 1e3) * tt.speed),
  2464. X(at.init ? tt.pos : E(tt.pos)),
  2465. at.init || Ce.cur !== Ce.dest || pe("moveEnd"),
  2466. (tt.lastTime = tt.now);
  2467. }
  2468. function L(e, t, n) {
  2469. if (("boolean" === i(t) && ((n = t), (t = a)), t === a)) X(Ce[e], n);
  2470. else {
  2471. if (Le && "center" !== e) return;
  2472. var r = ye.getPos(t);
  2473. r && X(r[e], n, !Le);
  2474. }
  2475. }
  2476. function R(e) {
  2477. return null != e
  2478. ? l(e)
  2479. ? e >= 0 && e < Ne.length
  2480. ? e
  2481. : -1
  2482. : qe.index(e)
  2483. : -1;
  2484. }
  2485. function U(e) {
  2486. return R(l(e) && 0 > e ? e + Ne.length : e);
  2487. }
  2488. function W(e, t) {
  2489. var a = R(e);
  2490. return (
  2491. !(!Re || 0 > a) &&
  2492. ((_e.active !== a || t) &&
  2493. (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2494. qe.eq(a).addClass(ge.activeClass),
  2495. (_e.active = Oe.activeItem = a),
  2496. Z(),
  2497. pe("active", a)),
  2498. a)
  2499. );
  2500. }
  2501. function $(e) {
  2502. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  2503. var t = {},
  2504. a = Me ? 0 : Ie / 2;
  2505. if (!we)
  2506. for (var n = 0, i = Ee.length; i > n; n++) {
  2507. if (e >= Ce.end || n === Ee.length - 1) {
  2508. t.activePage = Ee.length - 1;
  2509. break;
  2510. }
  2511. if (e <= Ee[n] + a) {
  2512. t.activePage = n;
  2513. break;
  2514. }
  2515. }
  2516. if (Re) {
  2517. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  2518. if (
  2519. (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  2520. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  2521. c === u - 1 || e <= Ne[c].end + Ne[c].half)
  2522. ) {
  2523. s = c;
  2524. break;
  2525. }
  2526. (t.firstItem = l(r) ? r : 0),
  2527. (t.centerItem = l(o) ? o : t.firstItem),
  2528. (t.lastItem = l(s) ? s : t.centerItem);
  2529. }
  2530. return t;
  2531. }
  2532. function Q(t) {
  2533. e.extend(Oe, $(t));
  2534. }
  2535. function Z() {
  2536. var e = Ce.dest <= Ce.start,
  2537. t = Ce.dest >= Ce.end,
  2538. a = (e ? 1 : 0) | (t ? 2 : 0);
  2539. if (
  2540. (_e.slideePosState !== a &&
  2541. ((_e.slideePosState = a),
  2542. Je.is("button,input") && Je.prop("disabled", e),
  2543. Ke.is("button,input") && Ke.prop("disabled", t),
  2544. Je.add(Qe)[e ? "addClass" : "removeClass"](ge.disabledClass),
  2545. Ke.add($e)[t ? "addClass" : "removeClass"](ge.disabledClass)),
  2546. _e.fwdbwdState !== a &&
  2547. at.released &&
  2548. ((_e.fwdbwdState = a),
  2549. Qe.is("button,input") && Qe.prop("disabled", e),
  2550. $e.is("button,input") && $e.prop("disabled", t)),
  2551. Re && null != Oe.activeItem)
  2552. ) {
  2553. var n = 0 === Oe.activeItem,
  2554. i = Oe.activeItem >= Ne.length - 1,
  2555. r = (n ? 1 : 0) | (i ? 2 : 0);
  2556. _e.itemsButtonState !== r &&
  2557. ((_e.itemsButtonState = r),
  2558. Ze.is("button,input") && Ze.prop("disabled", n),
  2559. Ge.is("button,input") && Ge.prop("disabled", i),
  2560. Ze[n ? "addClass" : "removeClass"](ge.disabledClass),
  2561. Ge[i ? "addClass" : "removeClass"](ge.disabledClass));
  2562. }
  2563. }
  2564. function G(e, t, a) {
  2565. if (
  2566. ((e = U(e)),
  2567. (t = U(t)),
  2568. e > -1 &&
  2569. t > -1 &&
  2570. e !== t &&
  2571. (!a || t !== e - 1) &&
  2572. (a || t !== e + 1))
  2573. ) {
  2574. qe.eq(e)[a ? "insertAfter" : "insertBefore"](Ne[t].el);
  2575. var n = t > e ? e : a ? t : t - 1,
  2576. i = e > t ? e : a ? t + 1 : t,
  2577. r = e > t;
  2578. null != Oe.activeItem &&
  2579. (e === Oe.activeItem
  2580. ? (_e.active = Oe.activeItem = a ? (r ? t + 1 : t) : r ? t : t - 1)
  2581. : Oe.activeItem > n &&
  2582. Oe.activeItem < i &&
  2583. (_e.active = Oe.activeItem += r ? 1 : -1)),
  2584. H();
  2585. }
  2586. }
  2587. function J(e, t) {
  2588. for (var a = 0, n = Ve[e].length; n > a; a++)
  2589. if (Ve[e][a] === t) return a;
  2590. return -1;
  2591. }
  2592. function K() {
  2593. at.released && !ye.isPaused && ye.resume();
  2594. }
  2595. function V(e) {
  2596. return (
  2597. E((d(e, xe.start, xe.end) / xe.end) * (Ce.end - Ce.start)) + Ce.start
  2598. );
  2599. }
  2600. function _() {
  2601. (at.history[0] = at.history[1]),
  2602. (at.history[1] = at.history[2]),
  2603. (at.history[2] = at.history[3]),
  2604. (at.history[3] = at.delta);
  2605. }
  2606. function ee(e) {
  2607. (at.released = 0), (at.source = e), (at.slidee = "slidee" === e);
  2608. }
  2609. function te(t) {
  2610. var a = "touchstart" === t.type,
  2611. n = t.data.source,
  2612. i = "slidee" === n;
  2613. at.init ||
  2614. (!a && ie(t.target)) ||
  2615. (("handle" !== n || (ge.dragHandle && xe.start !== xe.end)) &&
  2616. (!i || (a ? ge.touchDragging : ge.mouseDragging && t.which < 2)) &&
  2617. (a || r(t),
  2618. ee(n),
  2619. (at.init = 0),
  2620. (at.$source = e(t.target)),
  2621. (at.touch = a),
  2622. (at.pointer = a ? t.originalEvent.touches[0] : t),
  2623. (at.initX = at.pointer.pageX),
  2624. (at.initY = at.pointer.pageY),
  2625. (at.initPos = i ? Ce.cur : xe.cur),
  2626. (at.start = +new Date()),
  2627. (at.time = 0),
  2628. (at.path = 0),
  2629. (at.delta = 0),
  2630. (at.locked = 0),
  2631. (at.history = [0, 0, 0, 0]),
  2632. (at.pathToLock = i ? (a ? 30 : 10) : 0),
  2633. b.on(a ? z : I, ae),
  2634. ye.pause(1),
  2635. (i ? Pe : Se).addClass(ge.draggedClass),
  2636. pe("moveStart"),
  2637. i && (rt = setInterval(_, 10))));
  2638. }
  2639. function ae(e) {
  2640. if (
  2641. ((at.released = "mouseup" === e.type || "touchend" === e.type),
  2642. (at.pointer = at.touch
  2643. ? e.originalEvent[at.released ? "changedTouches" : "touches"][0]
  2644. : e),
  2645. (at.pathX = at.pointer.pageX - at.initX),
  2646. (at.pathY = at.pointer.pageY - at.initY),
  2647. (at.path = D(A(at.pathX, 2) + A(at.pathY, 2))),
  2648. (at.delta = ge.horizontal ? at.pathX : at.pathY),
  2649. at.released || !(at.path < 1))
  2650. ) {
  2651. if (!at.init) {
  2652. if (
  2653. !(ge.horizontal
  2654. ? x(at.pathX) > x(at.pathY)
  2655. : x(at.pathX) < x(at.pathY))
  2656. )
  2657. return ne();
  2658. at.init = 1;
  2659. }
  2660. r(e),
  2661. !at.locked &&
  2662. at.path > at.pathToLock &&
  2663. at.slidee &&
  2664. ((at.locked = 1), at.$source.on(B, s)),
  2665. at.released &&
  2666. (ne(),
  2667. ge.releaseSwing &&
  2668. at.slidee &&
  2669. ((at.swing = ((at.delta - at.history[0]) / 40) * 300),
  2670. (at.delta += at.swing),
  2671. (at.tweese = x(at.swing) > 10))),
  2672. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta));
  2673. }
  2674. }
  2675. function ne() {
  2676. clearInterval(rt),
  2677. (at.released = !0),
  2678. b.off(at.touch ? z : I, ae),
  2679. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  2680. setTimeout(function () {
  2681. at.$source.off(B, s);
  2682. }),
  2683. Ce.cur === Ce.dest && at.init && pe("moveEnd"),
  2684. ye.resume(1),
  2685. (at.init = 0);
  2686. }
  2687. function ie(t) {
  2688. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive);
  2689. }
  2690. function re() {
  2691. ye.stop(), b.off("mouseup", re);
  2692. }
  2693. function se(e) {
  2694. switch ((r(e), this)) {
  2695. case $e[0]:
  2696. case Qe[0]:
  2697. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy), b.on("mouseup", re);
  2698. break;
  2699. case Ze[0]:
  2700. ye.prev();
  2701. break;
  2702. case Ge[0]:
  2703. ye.next();
  2704. break;
  2705. case Je[0]:
  2706. ye.prevPage();
  2707. break;
  2708. case Ke[0]:
  2709. ye.nextPage();
  2710. }
  2711. }
  2712. function oe(e) {
  2713. return (
  2714. (nt.curDelta =
  2715. (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta),
  2716. (nt.curDelta /= 1 === e.deltaMode ? 3 : 100),
  2717. Re
  2718. ? ((p = +new Date()),
  2719. nt.last < p - nt.resetTime && (nt.delta = 0),
  2720. (nt.last = p),
  2721. (nt.delta += nt.curDelta),
  2722. x(nt.delta) < 1
  2723. ? (nt.finalDelta = 0)
  2724. : ((nt.finalDelta = E(nt.delta / 1)), (nt.delta %= 1)),
  2725. nt.finalDelta)
  2726. : nt.curDelta
  2727. );
  2728. }
  2729. function le(e) {
  2730. e.originalEvent[g] = ye;
  2731. var t = +new Date();
  2732. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window)
  2733. return void (O = t);
  2734. if (ge.scrollBy && Ce.start !== Ce.end) {
  2735. var a = oe(e.originalEvent);
  2736. (ge.scrollTrap ||
  2737. (a > 0 && Ce.dest < Ce.end) ||
  2738. (0 > a && Ce.dest > Ce.start)) &&
  2739. r(e, 1),
  2740. ye.slideBy(ge.scrollBy * a);
  2741. }
  2742. }
  2743. function ce(e) {
  2744. ge.clickBar &&
  2745. e.target === Be[0] &&
  2746. (r(e),
  2747. X(
  2748. V(
  2749. (ge.horizontal
  2750. ? e.pageX - Be.offset().left
  2751. : e.pageY - Be.offset().top) -
  2752. Te / 2
  2753. )
  2754. ));
  2755. }
  2756. function de(e) {
  2757. if (ge.keyboardNavBy)
  2758. switch (e.which) {
  2759. case ge.horizontal ? 37 : 38:
  2760. r(e), ye["pages" === ge.keyboardNavBy ? "prevPage" : "prev"]();
  2761. break;
  2762. case ge.horizontal ? 39 : 40:
  2763. r(e), ye["pages" === ge.keyboardNavBy ? "nextPage" : "next"]();
  2764. }
  2765. }
  2766. function ue(e) {
  2767. return ie(this)
  2768. ? void (e.originalEvent[g + "ignore"] = !0)
  2769. : void (
  2770. this.parentNode !== Pe[0] ||
  2771. e.originalEvent[g + "ignore"] ||
  2772. ye.activate(this)
  2773. );
  2774. }
  2775. function fe() {
  2776. this.parentNode === De[0] && ye.activatePage(Ae.index(this));
  2777. }
  2778. function ve(e) {
  2779. ge.pauseOnHover && ye["mouseenter" === e.type ? "pause" : "resume"](2);
  2780. }
  2781. function pe(e, t) {
  2782. if (Ve[e]) {
  2783. for (me = Ve[e].length, T.length = 0, he = 0; me > he; he++)
  2784. T.push(Ve[e][he]);
  2785. for (he = 0; me > he; he++) T[he].call(ye, e, t);
  2786. }
  2787. }
  2788. var he,
  2789. me,
  2790. ge = e.extend({}, n.defaults, h),
  2791. ye = this,
  2792. we = l(t),
  2793. be = e(t),
  2794. Pe = ge.slidee ? e(ge.slidee).eq(0) : be.children().eq(0),
  2795. Ie = 0,
  2796. ze = 0,
  2797. Ce = {
  2798. start: 0,
  2799. center: 0,
  2800. end: 0,
  2801. cur: 0,
  2802. dest: 0,
  2803. },
  2804. Be = e(ge.scrollBar).eq(0),
  2805. Se = Be.children().eq(0),
  2806. ke = 0,
  2807. Te = 0,
  2808. xe = {
  2809. start: 0,
  2810. end: 0,
  2811. cur: 0,
  2812. },
  2813. De = e(ge.pagesBar),
  2814. Ae = 0,
  2815. Ee = [],
  2816. qe = 0,
  2817. Ne = [],
  2818. Oe = {
  2819. firstItem: 0,
  2820. lastItem: 0,
  2821. centerItem: 0,
  2822. activeItem: null,
  2823. activePage: 0,
  2824. },
  2825. He = new u(be[0]),
  2826. Xe = new u(Pe[0]),
  2827. Ye = new u(Be[0]),
  2828. je = new u(Se[0]),
  2829. Fe = "basic" === ge.itemNav,
  2830. Me = "forceCentered" === ge.itemNav,
  2831. Le = "centered" === ge.itemNav || Me,
  2832. Re = !we && (Fe || Le || Me),
  2833. Ue = ge.scrollSource ? e(ge.scrollSource) : be,
  2834. We = ge.dragSource ? e(ge.dragSource) : be,
  2835. $e = e(ge.forward),
  2836. Qe = e(ge.backward),
  2837. Ze = e(ge.prev),
  2838. Ge = e(ge.next),
  2839. Je = e(ge.prevPage),
  2840. Ke = e(ge.nextPage),
  2841. Ve = {},
  2842. _e = {},
  2843. et = {},
  2844. tt = {},
  2845. at = {
  2846. released: 1,
  2847. },
  2848. nt = {
  2849. last: 0,
  2850. delta: 0,
  2851. resetTime: 200,
  2852. },
  2853. it = 0,
  2854. rt = 0,
  2855. st = 0,
  2856. ot = 0;
  2857. we || (t = be[0]),
  2858. (ye.initialized = 0),
  2859. (ye.frame = t),
  2860. (ye.slidee = Pe[0]),
  2861. (ye.pos = Ce),
  2862. (ye.rel = Oe),
  2863. (ye.items = Ne),
  2864. (ye.pages = Ee),
  2865. (ye.isPaused = 0),
  2866. (ye.options = ge),
  2867. (ye.dragging = at),
  2868. (ye.reload = function () {
  2869. H();
  2870. }),
  2871. (ye.getPos = function (e) {
  2872. if (Re) {
  2873. var t = R(e);
  2874. return -1 !== t && Ne[t];
  2875. }
  2876. var a = Pe.find(e).eq(0);
  2877. if (a[0]) {
  2878. var n = ge.horizontal
  2879. ? a.offset().left - Pe.offset().left
  2880. : a.offset().top - Pe.offset().top,
  2881. i = a[ge.horizontal ? "outerWidth" : "outerHeight"]();
  2882. return {
  2883. start: n,
  2884. center: n - Ie / 2 + i / 2,
  2885. end: n - Ie + i,
  2886. size: i,
  2887. };
  2888. }
  2889. return !1;
  2890. }),
  2891. (ye.moveBy = function (e) {
  2892. (tt.speed = e),
  2893. !at.init &&
  2894. tt.speed &&
  2895. Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) &&
  2896. ((tt.lastTime = +new Date()),
  2897. (tt.startPos = Ce.cur),
  2898. ee("button"),
  2899. (at.init = 1),
  2900. pe("moveStart"),
  2901. y(ot),
  2902. M());
  2903. }),
  2904. (ye.stop = function () {
  2905. "button" === at.source && ((at.init = 0), (at.released = 1));
  2906. }),
  2907. (ye.prev = function () {
  2908. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1);
  2909. }),
  2910. (ye.next = function () {
  2911. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1);
  2912. }),
  2913. (ye.prevPage = function () {
  2914. ye.activatePage(Oe.activePage - 1);
  2915. }),
  2916. (ye.nextPage = function () {
  2917. ye.activatePage(Oe.activePage + 1);
  2918. }),
  2919. (ye.slideBy = function (e, t) {
  2920. e &&
  2921. (Re
  2922. ? ye[Le ? "toCenter" : "toStart"](
  2923. d(
  2924. (Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e,
  2925. 0,
  2926. Ne.length
  2927. )
  2928. )
  2929. : X(Ce.dest + e, t));
  2930. }),
  2931. (ye.slideTo = function (e, t) {
  2932. X(e, t);
  2933. }),
  2934. (ye.toStart = function (e, t) {
  2935. L("start", e, t);
  2936. }),
  2937. (ye.toEnd = function (e, t) {
  2938. L("end", e, t);
  2939. }),
  2940. (ye.toCenter = function (e, t) {
  2941. L("center", e, t);
  2942. }),
  2943. (ye.getIndex = R),
  2944. (ye.activate = function (e, t) {
  2945. var a = W(e);
  2946. ge.smart &&
  2947. a !== !1 &&
  2948. (Le
  2949. ? ye.toCenter(a, t)
  2950. : a >= Oe.lastItem
  2951. ? ye.toStart(a, t)
  2952. : a <= Oe.firstItem
  2953. ? ye.toEnd(a, t)
  2954. : K());
  2955. }),
  2956. (ye.activatePage = function (e, t) {
  2957. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t);
  2958. }),
  2959. (ye.resume = function (e) {
  2960. ge.cycleBy &&
  2961. ge.cycleInterval &&
  2962. ("items" !== ge.cycleBy || (Ne[0] && null != Oe.activeItem)) &&
  2963. !(e < ye.isPaused) &&
  2964. ((ye.isPaused = 0),
  2965. st ? (st = clearTimeout(st)) : pe("resume"),
  2966. (st = setTimeout(function () {
  2967. switch ((pe("cycle"), ge.cycleBy)) {
  2968. case "items":
  2969. ye.activate(
  2970. Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1
  2971. );
  2972. break;
  2973. case "pages":
  2974. ye.activatePage(
  2975. Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1
  2976. );
  2977. }
  2978. }, ge.cycleInterval)));
  2979. }),
  2980. (ye.pause = function (e) {
  2981. e < ye.isPaused ||
  2982. ((ye.isPaused = e || 100),
  2983. st && ((st = clearTimeout(st)), pe("pause")));
  2984. }),
  2985. (ye.toggle = function () {
  2986. ye[st ? "pause" : "resume"]();
  2987. }),
  2988. (ye.set = function (t, a) {
  2989. e.isPlainObject(t)
  2990. ? e.extend(ge, t)
  2991. : ge.hasOwnProperty(t) && (ge[t] = a);
  2992. }),
  2993. (ye.add = function (t, a) {
  2994. var n = e(t);
  2995. Re
  2996. ? (null == a || !Ne[0] || a >= Ne.length
  2997. ? n.appendTo(Pe)
  2998. : Ne.length && n.insertBefore(Ne[a].el),
  2999. null != Oe.activeItem &&
  3000. a <= Oe.activeItem &&
  3001. (_e.active = Oe.activeItem += n.length))
  3002. : Pe.append(n),
  3003. H();
  3004. }),
  3005. (ye.remove = function (t) {
  3006. if (Re) {
  3007. var a = U(t);
  3008. if (a > -1) {
  3009. qe.eq(a).remove();
  3010. var n = a === Oe.activeItem;
  3011. null != Oe.activeItem &&
  3012. a < Oe.activeItem &&
  3013. (_e.active = --Oe.activeItem),
  3014. H(),
  3015. n && ((_e.active = null), ye.activate(Oe.activeItem));
  3016. }
  3017. } else e(t).remove(), H();
  3018. }),
  3019. (ye.moveAfter = function (e, t) {
  3020. G(e, t, 1);
  3021. }),
  3022. (ye.moveBefore = function (e, t) {
  3023. G(e, t);
  3024. }),
  3025. (ye.on = function (e, t) {
  3026. if ("object" === i(e))
  3027. for (var a in e) e.hasOwnProperty(a) && ye.on(a, e[a]);
  3028. else if ("function" === i(t))
  3029. for (var n = e.split(" "), r = 0, s = n.length; s > r; r++)
  3030. (Ve[n[r]] = Ve[n[r]] || []), -1 === J(n[r], t) && Ve[n[r]].push(t);
  3031. else if ("array" === i(t))
  3032. for (var o = 0, l = t.length; l > o; o++) ye.on(e, t[o]);
  3033. }),
  3034. (ye.one = function (e, t) {
  3035. function a() {
  3036. t.apply(ye, arguments), ye.off(e, a);
  3037. }
  3038. ye.on(e, a);
  3039. }),
  3040. (ye.off = function (e, t) {
  3041. if (t instanceof Array)
  3042. for (var a = 0, n = t.length; n > a; a++) ye.off(e, t[a]);
  3043. else
  3044. for (var i = e.split(" "), r = 0, s = i.length; s > r; r++)
  3045. if (((Ve[i[r]] = Ve[i[r]] || []), null == t)) Ve[i[r]].length = 0;
  3046. else {
  3047. var o = J(i[r], t);
  3048. -1 !== o && Ve[i[r]].splice(o, 1);
  3049. }
  3050. }),
  3051. (ye.destroy = function () {
  3052. return (
  3053. Ue.add(Se)
  3054. .add(Be)
  3055. .add(De)
  3056. .add($e)
  3057. .add(Qe)
  3058. .add(Ze)
  3059. .add(Ge)
  3060. .add(Je)
  3061. .add(Ke)
  3062. .off("." + g),
  3063. b.off("keydown", de),
  3064. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  3065. qe &&
  3066. null != Oe.activeItem &&
  3067. qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  3068. De.empty(),
  3069. we ||
  3070. (be.off("." + g),
  3071. He.restore(),
  3072. Xe.restore(),
  3073. Ye.restore(),
  3074. je.restore(),
  3075. e.removeData(t, g)),
  3076. (Ne.length = Ee.length = 0),
  3077. (_e = {}),
  3078. (ye.initialized = 0),
  3079. ye
  3080. );
  3081. }),
  3082. (ye.init = function () {
  3083. if (!ye.initialized) {
  3084. ye.on(m);
  3085. var e = ["overflow", "position"],
  3086. t = [
  3087. "position",
  3088. "webkitTransform",
  3089. "msTransform",
  3090. "transform",
  3091. "left",
  3092. "top",
  3093. "width",
  3094. "height",
  3095. ];
  3096. He.save.apply(He, e),
  3097. Ye.save.apply(Ye, e),
  3098. Xe.save.apply(Xe, t),
  3099. je.save.apply(je, t);
  3100. var a = Se;
  3101. return (
  3102. we ||
  3103. ((a = a.add(Pe)),
  3104. be.css("overflow", "hidden"),
  3105. f ||
  3106. "static" !== be.css("position") ||
  3107. be.css("position", "relative")),
  3108. f
  3109. ? v && a.css(f, v)
  3110. : ("static" === Be.css("position") &&
  3111. Be.css("position", "relative"),
  3112. a.css({
  3113. position: "absolute",
  3114. })),
  3115. ge.forward && $e.on(S, se),
  3116. ge.backward && Qe.on(S, se),
  3117. ge.prev && Ze.on(B, se),
  3118. ge.next && Ge.on(B, se),
  3119. ge.prevPage && Je.on(B, se),
  3120. ge.nextPage && Ke.on(B, se),
  3121. Ue.on(C, le), // C是 "wheel.sly" 滚动监听
  3122. Be[0] && Be.on(B, ce),
  3123. Re && ge.activateOn && be.on(ge.activateOn + "." + g, "*", ue),
  3124. De[0] &&
  3125. ge.activatePageOn &&
  3126. De.on(ge.activatePageOn + "." + g, "*", fe),
  3127. We.on(
  3128. P,
  3129. {
  3130. source: "slidee",
  3131. },
  3132. te
  3133. ),
  3134. Se &&
  3135. Se.on(
  3136. P,
  3137. {
  3138. source: "handle",
  3139. },
  3140. te
  3141. ),
  3142. b.on("keydown", de),
  3143. we ||
  3144. (be.on("mouseenter." + g + " mouseleave." + g, ve),
  3145. be.on("scroll." + g, o)),
  3146. (ye.initialized = 1),
  3147. H(!0),
  3148. ge.cycleBy && !we && ye[ge.startPaused ? "pause" : "resume"](),
  3149. ye
  3150. );
  3151. }
  3152. });
  3153. }
  3154. function i(e) {
  3155. return null == e
  3156. ? String(e)
  3157. : "object" == typeof e || "function" == typeof e
  3158. ? Object.prototype.toString
  3159. .call(e)
  3160. .match(/\s([a-z]+)/i)[1]
  3161. .toLowerCase() || "object"
  3162. : typeof e;
  3163. }
  3164. function r(e, t) {
  3165. e.preventDefault(), t && e.stopPropagation();
  3166. }
  3167. function s(t) {
  3168. r(t, 1), e(this).off(t.type, s);
  3169. }
  3170. function o() {
  3171. (this.scrollLeft = 0), (this.scrollTop = 0);
  3172. }
  3173. function l(e) {
  3174. return !isNaN(parseFloat(e)) && isFinite(e);
  3175. }
  3176. function c(e, t) {
  3177. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ""));
  3178. }
  3179. function d(e, t, a) {
  3180. return t > e ? t : e > a ? a : e;
  3181. }
  3182. function u(e) {
  3183. var t = {};
  3184. return (
  3185. (t.style = {}),
  3186. (t.save = function () {
  3187. if (e && e.nodeType) {
  3188. for (var a = 0; a < arguments.length; a++)
  3189. t.style[arguments[a]] = e.style[arguments[a]];
  3190. return t;
  3191. }
  3192. }),
  3193. (t.restore = function () {
  3194. if (e && e.nodeType) {
  3195. for (var a in t.style)
  3196. t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  3197. return t;
  3198. }
  3199. }),
  3200. t
  3201. );
  3202. }
  3203. var f,
  3204. v,
  3205. p,
  3206. h = "sly",
  3207. m = "Sly",
  3208. g = h,
  3209. y = t.cancelAnimationFrame || t.cancelRequestAnimationFrame,
  3210. w = t.requestAnimationFrame,
  3211. b = e(document),
  3212. P = "touchstart." + g + " mousedown." + g,
  3213. I = "mousemove." + g + " mouseup." + g,
  3214. z = "touchmove." + g + " touchend." + g,
  3215. C =
  3216. (document.implementation.hasFeature("Event.wheel", "3.0")
  3217. ? "wheel."
  3218. : "mousewheel.") + g,
  3219. B = "click." + g,
  3220. S = "mousedown." + g,
  3221. k = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"],
  3222. T = [],
  3223. x = Math.abs,
  3224. D = Math.sqrt,
  3225. A = Math.pow,
  3226. E = Math.round,
  3227. q = Math.max,
  3228. N = Math.min,
  3229. O = 0;
  3230. b.on(C, function (e) {
  3231. var t = e.originalEvent[g],
  3232. a = +new Date();
  3233. (!t || t.options.scrollHijack < a - O) && (O = a);
  3234. }),
  3235. (function (e) {
  3236. function t(e) {
  3237. var t = new Date().getTime(),
  3238. n = Math.max(0, 16 - (t - a)),
  3239. i = setTimeout(e, n);
  3240. return (a = t), i;
  3241. }
  3242. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  3243. var a = new Date().getTime(),
  3244. n =
  3245. e.cancelAnimationFrame ||
  3246. e.webkitCancelAnimationFrame ||
  3247. e.clearTimeout;
  3248. y = function (t) {
  3249. n.call(e, t);
  3250. };
  3251. })(window),
  3252. (function () {
  3253. function e(e) {
  3254. for (var n = 0, i = t.length; i > n; n++) {
  3255. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  3256. if (null != a.style[r]) return r;
  3257. }
  3258. }
  3259. var t = ["", "webkit", "moz", "ms", "o"],
  3260. a = document.createElement("div");
  3261. (f = e("transform")), (v = e("perspective") ? "translateZ(0) " : "");
  3262. })(),
  3263. (t[m] = n),
  3264. (e.fn[h] = function (t, a) {
  3265. var r, s;
  3266. return (
  3267. e.isPlainObject(t) ||
  3268. (("string" === i(t) || t === !1) &&
  3269. ((r = t === !1 ? "destroy" : t),
  3270. (s = Array.prototype.slice.call(arguments, 1))),
  3271. (t = {})),
  3272. this.each(function (i, o) {
  3273. var l = e.data(o, g);
  3274. l || r
  3275. ? l && r && l[r] && l[r].apply(l, s)
  3276. : (l = e.data(o, g, new n(o, t, a).init()));
  3277. })
  3278. );
  3279. }),
  3280. (n.defaults = {
  3281. slidee: null,
  3282. horizontal: !1,
  3283. itemNav: null,
  3284. itemSelector: null,
  3285. smart: !1,
  3286. activateOn: null,
  3287. activateMiddle: !1,
  3288. scrollSource: null,
  3289. scrollBy: 0,
  3290. scrollHijack: 300,
  3291. scrollTrap: !1,
  3292. dragSource: null,
  3293. mouseDragging: !1,
  3294. touchDragging: !1,
  3295. releaseSwing: !1,
  3296. swingSpeed: 0.2,
  3297. elasticBounds: !1,
  3298. interactive: null,
  3299. scrollBar: null,
  3300. dragHandle: !1,
  3301. dynamicHandle: !1,
  3302. minHandleSize: 50,
  3303. clickBar: !1,
  3304. syncSpeed: 0.5,
  3305. pagesBar: null,
  3306. activatePageOn: null,
  3307. pageBuilder: function (e) {
  3308. return "<li>" + (e + 1) + "</li>";
  3309. },
  3310. forward: null,
  3311. backward: null,
  3312. prev: null,
  3313. next: null,
  3314. prevPage: null,
  3315. nextPage: null,
  3316. cycleBy: null,
  3317. cycleInterval: 5e3,
  3318. pauseOnHover: !1,
  3319. startPaused: !1,
  3320. moveBy: 300,
  3321. speed: 0,
  3322. easing: "swing",
  3323. startAt: null,
  3324. keyboardNavBy: null,
  3325. draggedClass: "dragged",
  3326. activeClass: "active",
  3327. disabledClass: "disabled",
  3328. });
  3329. })(jQuery, window);
  3330. !(function e(t, i, n) {
  3331. function r(a, s) {
  3332. if (!i[a]) {
  3333. if (!t[a]) {
  3334. var l = "function" == typeof require && require;
  3335. if (!s && l) return l(a, !0);
  3336. if (o) return o(a, !0);
  3337. var c = new Error("Cannot find module '" + a + "'");
  3338. throw ((c.code = "MODULE_NOT_FOUND"), c);
  3339. }
  3340. var h = (i[a] = {
  3341. exports: {},
  3342. });
  3343. t[a][0].call(
  3344. h.exports,
  3345. function (e) {
  3346. var i = t[a][1][e];
  3347. return r(i ? i : e);
  3348. },
  3349. h,
  3350. h.exports,
  3351. e,
  3352. t,
  3353. i,
  3354. n
  3355. );
  3356. }
  3357. return i[a].exports;
  3358. }
  3359. for (
  3360. var o = "function" == typeof require && require, a = 0;
  3361. a < n.length;
  3362. a++
  3363. )
  3364. r(n[a]);
  3365. return r;
  3366. })(
  3367. {
  3368. 1: [
  3369. function (e, t, i) {
  3370. (function (i) {
  3371. "use strict";
  3372. function n(e) {
  3373. (this.player = null),
  3374. (this.director = null),
  3375. (this.modelManager = null),
  3376. (this.container = null),
  3377. (this.tagManager = null),
  3378. (this.fadeInSpeed = e),
  3379. (null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed) ||
  3380. (this.fadeInSpeed = 0);
  3381. }
  3382. var r = e("three"),
  3383. o = e("./util/logger"),
  3384. a = (e("./util/common"), e("./enum/PlayerEvents")),
  3385. s = e("./enum/DirectorEvents"),
  3386. l = e("./settings"),
  3387. c = e("./enum/Viewmode"),
  3388. h =
  3389. (e("./enum/WarpStyle"),
  3390. e("./enum/BlackoutStyle"),
  3391. e("./enum/ModelManagerEvents")),
  3392. u = e("./enum/tagEvents"),
  3393. d = e("./util/transitions"),
  3394. p = e("./util/lerp"),
  3395. f = new o(i);
  3396. //window.THREE = r;
  3397. (n.prototype.init = function (e, t, i, n, r) {
  3398. window.app = this;
  3399. (this.player = t),
  3400. (this.director = e),
  3401. (this.modelManager = i),
  3402. (this.tagManager = n),
  3403. (this.container = r),
  3404. this.updateModel(),
  3405. this.bindEvents();
  3406. }),
  3407. (n.prototype.bindEvents = function () {
  3408. this.modelManager.on(
  3409. h.ActiveModelChanged,
  3410. this.updateModel.bind(this)
  3411. ),
  3412. this.player.on(
  3413. a.ModeChanging,
  3414. this.handlePlayerModeChanging.bind(this)
  3415. ),
  3416. this.player.on(
  3417. a.ModeChanged,
  3418. this.handlePlayerModeChanged.bind(this)
  3419. ),
  3420. this.player.on(
  3421. a.ClosestPanoChanging,
  3422. this.handleClosestPanoChanging.bind(this)
  3423. ),
  3424. this.player.on(
  3425. a.StartInside,
  3426. this.handleStartInside.bind(this)
  3427. ),
  3428. this.player.on(
  3429. a.StartOutside,
  3430. this.handleStartOutside.bind(this)
  3431. ),
  3432. this.player.on(
  3433. a.WarpStarted,
  3434. this.handleWarpStarted.bind(this)
  3435. ),
  3436. this.director.on(
  3437. s.ActionInterrupted,
  3438. this.handleActionInterruption.bind(this)
  3439. ),
  3440. this.tagManager.on(
  3441. u.TagActivated,
  3442. this.ontagActivated.bind(this)
  3443. ),
  3444. this.tagManager.on(
  3445. u.TagNavigation,
  3446. this.onNavigationTotag.bind(this)
  3447. );
  3448. }),
  3449. (n.prototype.updateModel = function () {
  3450. //模型this.model
  3451. this.model = this.modelManager.getActiveModel();
  3452. }),
  3453. (n.prototype.handleWarpStarted = function () {
  3454. this.hidePlayerReticule();
  3455. }),
  3456. (n.prototype.ontagActivated = function () {
  3457. this.hidePlayerReticule();
  3458. }),
  3459. (n.prototype.onNavigationTotag = function () {
  3460. this.hidePlayerReticule();
  3461. }),
  3462. (n.prototype.handlePlayerModeChanging = function (e, t, i) {
  3463. var n = this.modelManager.getActiveModel(),
  3464. r =
  3465. this.player.is360View(t, i) || this.director.tourIsPlaying
  3466. ? 0
  3467. : l[t].markerOpacity;
  3468. n.fadePanoMarkers(r), n.setMode(t);
  3469. }),
  3470. (n.prototype.handlePlayerModeChanged = function (e, t) {
  3471. var i = this.modelManager.getActiveModel(),
  3472. n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  3473. i.setSide(n), i.setMode(t);
  3474. }),
  3475. (n.prototype.handleClosestPanoChanging = function (e, t, i) {
  3476. i !== c.TRANSITIONING &&
  3477. (e && !this.director.tourIsPlaying && e.hoverOff(i),
  3478. t && !this.director.tourIsPlaying && t.hoverOn(i));
  3479. }),
  3480. (n.prototype.handleActionInterruption = function () {}),
  3481. (n.prototype.handleStartInside = function (e) {
  3482. var t = l[this.player.mode],
  3483. i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  3484. this.fadeIn(this.fadeInSpeed),
  3485. (this.model.alpha = 0),
  3486. (this.model.skybox.material.uniforms.opacity.value = 1),
  3487. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  3488. var n = this.player.reticule;
  3489. d.start(
  3490. p.property(n.material, "opacity", 0),
  3491. i,
  3492. null,
  3493. 0,
  3494. null,
  3495. "retReOpac"
  3496. );
  3497. }),
  3498. (n.prototype.handleStartOutside = function (e) {
  3499. this.fadeIn(e);
  3500. }),
  3501. (n.prototype.fadeIn = function (e) {
  3502. (null !== e && void 0 !== e) ||
  3503. ((e = 2e3),
  3504. f.warn(
  3505. "DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms."
  3506. )),
  3507. $(this.container).fadeIn(e);
  3508. }),
  3509. (n.prototype.hidePlayerReticule = function () {
  3510. this.player.reticule.hide();
  3511. }),
  3512. (t.exports = n);
  3513. }).call(this, "/js/DisplayController.js");
  3514. },
  3515. {
  3516. "./enum/BlackoutStyle": 18,
  3517. "./enum/DirectorEvents": 23,
  3518. "./enum/tagEvents": 32,
  3519. "./enum/ModelManagerEvents": 33,
  3520. "./enum/PlayerEvents": 40,
  3521. "./enum/Viewmode": 51,
  3522. "./enum/WarpStyle": 52,
  3523. "./settings": 166,
  3524. "./util/common": 185,
  3525. "./util/lerp": 188,
  3526. "./util/logger": 189,
  3527. "./util/transitions": 195,
  3528. three: 217,
  3529. },
  3530. ],
  3531. 2: [
  3532. function (e, t, i) {
  3533. "use strict";
  3534. function n() {
  3535. (this.baseStartTime = performance.timing.navigationStart),
  3536. (this.loadingStartTime = null),
  3537. (this.waitingStartTime = null),
  3538. (this.appReadyTime = null);
  3539. }
  3540. (n.prototype.setBaseStartTime = function (e) {
  3541. this.baseStartTime = e || Date.now();
  3542. }),
  3543. (n.prototype.setWaitingStartTime = function (e) {
  3544. this.waitingStartTime = e || Date.now();
  3545. }),
  3546. (n.prototype.setLoadingStartTime = function (e) {
  3547. this.loadingStartTime = e || Date.now();
  3548. }),
  3549. (n.prototype.setAppReadyTime = function (e) {
  3550. this.appReadyTime = e || Date.now();
  3551. }),
  3552. (n.prototype.calcFullLoadingTime = function () {
  3553. var e = this.appReadyTime - this.baseStartTime;
  3554. return (
  3555. this.waitingStartTime &&
  3556. (e -= this.loadingStartTime - this.waitingStartTime),
  3557. e
  3558. );
  3559. }),
  3560. (t.exports = n);
  3561. },
  3562. {},
  3563. ],
  3564. 3: [
  3565. function (e, t, i) {
  3566. (function (i) {
  3567. "use strict";
  3568. function n() {
  3569. return 100 * Math.random();
  3570. }
  3571. var r = e("./util/logger"),
  3572. o = e("./util/browser"),
  3573. a = new r(i),
  3574. s = (window.MP_AB_TESTS = window.MP_AB_TESTS || {
  3575. initialized: !1,
  3576. init: function (e, t) {
  3577. if (((t = t || {}), !this.initialized)) {
  3578. (this.initialized = !0),
  3579. o.valueFromHash("tilegen") &&
  3580. (t.tilegen = 1 === o.valueFromHash("tilegen", 0)),
  3581. o.valueFromHash("imgopt") &&
  3582. (t.imgopt = 1 === o.valueFromHash("imgopt", 0));
  3583. for (var i in e) {
  3584. var r = i.match("^sc_tilegen_([0-9]+)$");
  3585. r && (s.tilegen = n() < parseInt(r[1]));
  3586. var l = i.match("^sc_imgopt_([0-9]+)$");
  3587. l && (s.imgopt = n() < parseInt(l[1]));
  3588. }
  3589. for (var c in t)
  3590. (s[c] = t[c]), a.debug("A/B override:", c, s[c]);
  3591. }
  3592. },
  3593. changeIfTileGenerating: function (e) {
  3594. return (
  3595. s.tilegen &&
  3596. ((e += e.indexOf("?") === -1 ? "?" : "&"), (e += "")),
  3597. e
  3598. );
  3599. },
  3600. changeIfImageOptimzing: function (e) {
  3601. return (
  3602. s.imgopt &&
  3603. e.indexOf("imgopt=1") === -1 &&
  3604. ((e += e.indexOf("?") === -1 ? "?" : "&"), (e += "")),
  3605. e
  3606. );
  3607. },
  3608. tilegen: !1,
  3609. imgopt: !1,
  3610. });
  3611. t.exports = s;
  3612. }).call(this, "/js/ab.js");
  3613. },
  3614. {
  3615. "./util/browser": 182,
  3616. "./util/logger": 189,
  3617. },
  3618. ],
  3619. 4: [
  3620. function (e, t, i) {
  3621. (function (i) {
  3622. "use strict";
  3623. function n() {
  3624. return {
  3625. addons: [
  3626. {
  3627. name: "keen:ua_parser",
  3628. input: {
  3629. ua_string: "user_agent",
  3630. },
  3631. output: "parsed_user_agent",
  3632. },
  3633. ],
  3634. };
  3635. }
  3636. function r(e, t, i, n) {
  3637. function r(t) {
  3638. l[t.sid] = !0;
  3639. var i = t.billboard.media && t.billboard.media.type,
  3640. n = {
  3641. tag_id: t.sid,
  3642. tags_visited: Object.keys(l).length,
  3643. tag_count: Object.keys(e.tags).length,
  3644. tag_view_count: ++E,
  3645. has_media: !!i,
  3646. };
  3647. i && (n.media_type = i), u("tag_opened", n);
  3648. }
  3649. var l = {},
  3650. h = Date.now() - N,
  3651. f = null;
  3652. n && (f = Date.now() - window.navigationStart);
  3653. var g;
  3654. try {
  3655. g =
  3656. /* e.data.player_options.highlight_reel && */ e.heroLocations
  3657. .length > 0;
  3658. } catch (e) {
  3659. g = !1;
  3660. }
  3661. var v,
  3662. A = e.supportsVR;
  3663. A ||
  3664. ((v = "VR disabled at the model/account level"),
  3665. m.valueFromHash("vr") === _.NONE
  3666. ? (v = "VR disabled, using &vr=0")
  3667. : m.detectAndroid()
  3668. ? b.isDeviceSupported(w.Android) ||
  3669. (v = "VR disabled, unsupported Android version")
  3670. : m.detectIOS() &&
  3671. (b.isDeviceSupported(w.IOS) ||
  3672. (v = "VR disabled, unsupported iOS version"))),
  3673. u("model_loaded", {
  3674. duration: h,
  3675. duration_from_navigation_start: f,
  3676. has_hlr: g,
  3677. has_vr: A,
  3678. vr_reason: v,
  3679. });
  3680. var I = 0;
  3681. e.panos.forEach(function (e) {
  3682. e.on("enter", function () {
  3683. c("pano_viewed", {
  3684. pano_id: e.id,
  3685. pano_view_count: ++I,
  3686. alignment_type: e.alignmentType,
  3687. interaction_source: O,
  3688. navigation_source: p,
  3689. });
  3690. });
  3691. });
  3692. var E = 0;
  3693. for (var T in e.tags)
  3694. e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  3695. t.on("tour_auto", function (e) {
  3696. p = "tour_" + e;
  3697. }),
  3698. t.on("tour_manual", function (e) {
  3699. (O = "gui-" + e), (p = "tour_manual");
  3700. }),
  3701. i.on(C.InteractionKey, function () {
  3702. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey);
  3703. }),
  3704. i.on(C.InteractionDirect, function () {
  3705. t.mode === y.TRANSITIONING ||
  3706. t.flying ||
  3707. d(C.InteractionDirect);
  3708. }),
  3709. o(t),
  3710. a(),
  3711. s();
  3712. }
  3713. function o(e) {
  3714. I.on(T.OPENED, function () {
  3715. c("showcase_share_intent", {
  3716. pano_id: e.currentPano && e.currentPano.id,
  3717. });
  3718. }),
  3719. I.on(T.LINK_CLICKED, function (t) {
  3720. c("showcase_share_action", {
  3721. channel: t.channel,
  3722. pano_id: e.currentPano && e.currentPano.id,
  3723. });
  3724. }),
  3725. E.on(x.ORIGIN_LINK_CLICKED, function () {
  3726. c("showcase_share_origin_link_clicked");
  3727. });
  3728. }
  3729. function a() {}
  3730. function s() {
  3731. b.on(
  3732. S.OPENED,
  3733. c.bind(this, "showcase_gui", {
  3734. gui_action: "click_vr_button",
  3735. })
  3736. ),
  3737. b.on(S.LAUNCH, function (e) {
  3738. c("showcase_gui", {
  3739. gui_action: "launch_vr",
  3740. vr_platform: e.vr_platform,
  3741. vr_app: e.vr_app,
  3742. });
  3743. }),
  3744. b.on(
  3745. S.PREV,
  3746. c.bind(this, "showcase_gui", {
  3747. gui_action: "vr_modal_prev",
  3748. })
  3749. ),
  3750. b.on(S.NEXT, function (e) {
  3751. c("showcase_gui", {
  3752. gui_action: e.nextAction,
  3753. });
  3754. }),
  3755. b.on(
  3756. S.CLOSED,
  3757. c.bind(this, "showcase_gui", {
  3758. gui_action: "vr_modal_close",
  3759. })
  3760. ),
  3761. b.on(S.falseICECHOSEN, function (e) {
  3762. c("showcase_gui", {
  3763. gui_action: e.name + " ",
  3764. });
  3765. }),
  3766. b.on(S.STORE, function (e) {
  3767. c("showcase_gui", {
  3768. gui_action: "launch_store",
  3769. store: e,
  3770. });
  3771. });
  3772. }
  3773. function l(e, t) {
  3774. if (f)
  3775. try {
  3776. f.addEvent(
  3777. e,
  3778. v.extendObject(
  3779. {
  3780. host: window.location.host,
  3781. keen: n(),
  3782. user_agent: "${keen.user_agent}",
  3783. referrer: {
  3784. url: v.normalizeUrl(document.referrer),
  3785. domain: v.domainFromUrl(document.referrer),
  3786. url_original: document.referrer,
  3787. },
  3788. embedded: m.inIframe(),
  3789. is_mobile: m.isMobile(),
  3790. version: "2.25.6-0-gd87e5b1",
  3791. },
  3792. t
  3793. )
  3794. );
  3795. } catch (e) {
  3796. P.warn(
  3797. "analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " +
  3798. e
  3799. );
  3800. }
  3801. }
  3802. function c(e, t) {
  3803. if (((t = t || {}), L))
  3804. try {
  3805. window.analytics.track(e, v.extendObject(t, B), {
  3806. context: {
  3807. app: {
  3808. name: "showcase",
  3809. version: "2.25.6-0-gd87e5b1",
  3810. },
  3811. screen: {
  3812. width: window.screen.width,
  3813. height: window.screen.height,
  3814. density: window.devicePixelRatio,
  3815. },
  3816. },
  3817. });
  3818. } catch (t) {
  3819. console.warn("Failed to send data to segment for " + e);
  3820. }
  3821. }
  3822. function h(e, t) {
  3823. if (((t = t || {}), navigator.sendBeacon && L))
  3824. try {
  3825. navigator.sendBeacon(
  3826. "https://api.segment.io/v1/t",
  3827. JSON.stringify({
  3828. event: e,
  3829. anonymousId: window.analytics.user().anonymousId(),
  3830. properties: v.extendObject(t, B),
  3831. writeKey: L,
  3832. sentAt: Date.now(),
  3833. type: "track",
  3834. context: {
  3835. userAgent: m.userAgent(),
  3836. library: {
  3837. name: "showcase-beacon",
  3838. version: "2.25.6-0-gd87e5b1",
  3839. },
  3840. app: {
  3841. name: "showcase",
  3842. version: "2.25.6-0-gd87e5b1",
  3843. },
  3844. },
  3845. })
  3846. );
  3847. } catch (e) {
  3848. console.warn("Failed to send async segment request");
  3849. }
  3850. }
  3851. function u(e, t) {
  3852. (t = t || {}), c(e, t);
  3853. }
  3854. function d(e, t) {
  3855. (O = e === C.InteractionGui ? "gui-" + t : e), (p = "self_guided");
  3856. }
  3857. var p,
  3858. f,
  3859. g = (e("three"), e("./util/ajax"), e("./ab")),
  3860. m = e("./util/browser"),
  3861. v = e("./util/common"),
  3862. A = e("./settings"),
  3863. y = (e("./localization/localize"), e("./enum/Viewmode")),
  3864. C = e("./enum/ControlEvents"),
  3865. I = e("./gui/sharing/modal"),
  3866. E = e("./gui/title/titleBar"),
  3867. b = e("./gui/vr/vrModal"),
  3868. w = e("./enum/VRPlatforms"),
  3869. _ = e("./enum/VROption"),
  3870. T = e("./gui/sharing/ShareEvents"),
  3871. x = e("./gui/title/TitleEvents"),
  3872. S = e("./gui/vr/vrEvent"),
  3873. M = e("./tag/Billboard/BillboardEvent"),
  3874. R = e("./util/logger"),
  3875. P = new R(i),
  3876. O = (e("./enum/PlayerEvents"), "direct"),
  3877. L = null,
  3878. D = !1,
  3879. N = null,
  3880. B = null,
  3881. F = v.uuid4();
  3882. t.exports = {
  3883. report: function (e, t, i, n) {
  3884. l("Session starts", {
  3885. model: e,
  3886. status: t,
  3887. loadtime: Date.now() - (N || Date.now()),
  3888. loadtime_from_navigation_start: i
  3889. ? Date.now() - window.navigationStart
  3890. : null,
  3891. autoplay: i,
  3892. quickstart: n,
  3893. ab_tilegen: g.tilegen,
  3894. ab_imgopt: g.imgopt,
  3895. });
  3896. },
  3897. impression: function (e) {
  3898. e = e || {};
  3899. var t = void 0 === e.isVisible || e.isVisible,
  3900. i =
  3901. (void 0 !== e.immediate && e.immediate,
  3902. window.location.search.substr(1).split("&"));
  3903. u("impression", {
  3904. visible: t,
  3905. url_params: i,
  3906. });
  3907. },
  3908. initKeen: function (e) {
  3909. return e.token && e.appId
  3910. ? void (f = new Keen({
  3911. projectId: e.appId,
  3912. writeKey: e.token,
  3913. readKey: "",
  3914. requestType: "xhr",
  3915. }))
  3916. : void P.warn("no keen token/appId");
  3917. },
  3918. initSegment: function (e) {
  3919. return e.token
  3920. ? ((L = e.token),
  3921. window.analytics.load(e.token),
  3922. (B = {
  3923. model_id: e.model,
  3924. start_source: e.startSource,
  3925. autoplay: e.autoplay,
  3926. quickstart: e.quickstart,
  3927. language_tag: A.languageTag,
  3928. is_mobile: m.isMobile(),
  3929. iframe: m.inIframe(),
  3930. aspect_ratio: m.aspectRatio(),
  3931. session_id: F,
  3932. window: {
  3933. width: $("#player").width(),
  3934. height: $("#player").height(),
  3935. },
  3936. platform: {
  3937. browser: {
  3938. name: $.ua.browser.name,
  3939. major: $.ua.browser.major,
  3940. version: $.ua.browser.version,
  3941. },
  3942. os: {
  3943. name: $.ua.os.name,
  3944. version: $.ua.os.version,
  3945. },
  3946. device: {
  3947. vendor: $.ua.device.vendor,
  3948. model: $.ua.device.model,
  3949. type: $.ua.device.type,
  3950. },
  3951. },
  3952. }),
  3953. (D = Math.random() < A.analytics.sessionTrackingRate),
  3954. P.debug(
  3955. "tracking sample rate = " + A.analytics.sessionTrackingRate
  3956. ),
  3957. void P.debug("tracking this session = " + D))
  3958. : void P.warn("no segment token");
  3959. },
  3960. sessionStart: function (e) {
  3961. P.debug("analytics user_session_start"),
  3962. c("session_started"),
  3963. (N = Date.now()),
  3964. window.addEventListener("unload", function () {
  3965. h("session_ended", {
  3966. duration: Date.now() - N,
  3967. });
  3968. });
  3969. },
  3970. modelLoaded: function (e, t, i, n) {
  3971. r(e, t, i, n);
  3972. },
  3973. loadComplete: function (e) {
  3974. var t = {
  3975. time_to_app_start: e,
  3976. };
  3977. c("load_times", t);
  3978. },
  3979. track: function (e, t) {
  3980. D &&
  3981. (P.debug(
  3982. 'analytics.track("' + e + '", ' + JSON.stringify(t) + " )"
  3983. ),
  3984. c(e, t));
  3985. },
  3986. trackAlways: function (e, t) {
  3987. P.debug(
  3988. 'analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"
  3989. ),
  3990. c(e, t);
  3991. },
  3992. getSessionId: function () {
  3993. return F;
  3994. },
  3995. updateInteraction: d,
  3996. };
  3997. }).call(this, "/js/analytics.js");
  3998. },
  3999. {
  4000. "./ab": 3,
  4001. "./enum/ControlEvents": 21,
  4002. "./enum/PlayerEvents": 40,
  4003. "./enum/VROption": 47,
  4004. "./enum/VRPlatforms": 49,
  4005. "./enum/Viewmode": 51,
  4006. "./gui/sharing/ShareEvents": 76,
  4007. "./gui/sharing/modal": 77,
  4008. "./gui/title/TitleEvents": 80,
  4009. "./gui/title/titleBar": 82,
  4010. "./gui/vr/vrEvent": 85,
  4011. "./gui/vr/vrModal": 87,
  4012. "./localization/localize": 108,
  4013. "./tag/Billboard/BillboardEvent": 120,
  4014. "./settings": 166,
  4015. "./util/ajax": 181,
  4016. "./util/browser": 182,
  4017. "./util/common": 185,
  4018. "./util/logger": 189,
  4019. three: 217,
  4020. },
  4021. ],
  4022. 5: [
  4023. function (e, t, i) {
  4024. "use strict";
  4025. function n() {
  4026. r.PerspectiveCamera.call(
  4027. this,
  4028. a.clampVFOV(o.dollhouseFOV),
  4029. $("#player").width() / $("#player").height(),
  4030. o.dollhouseNear,
  4031. o.dollhouseFar
  4032. ),
  4033. (this.controls = null);
  4034. }
  4035. var r = e("three"),
  4036. o = e("../constants"),
  4037. a = e("../util/cameraLight");
  4038. (n.prototype = Object.create(r.PerspectiveCamera.prototype)),
  4039. (n.prototype.updateAspect = function (e) {
  4040. (this.aspect = e), this.updateProjectionMatrix();
  4041. }),
  4042. (t.exports = n);
  4043. },
  4044. {
  4045. "../constants": 8,
  4046. "../util/cameraLight": 184,
  4047. three: 217,
  4048. },
  4049. ],
  4050. 6: [
  4051. function (e, t, i) {
  4052. "use strict";
  4053. function n() {
  4054. var e = $("#player").width() / $("#player").height();
  4055. r.OrthographicCamera.call(
  4056. this,
  4057. -o.orthoBase,
  4058. o.orthoBase,
  4059. o.orthoBase / e,
  4060. -o.orthoBase / e,
  4061. o.orthoNear,
  4062. o.orthoFar
  4063. ),
  4064. (this.controls = null),
  4065. this.updateAspect(e);
  4066. }
  4067. var r = e("three"),
  4068. o = e("../constants");
  4069. (n.prototype = Object.create(r.OrthographicCamera.prototype)),
  4070. (n.prototype.updateAspect = function (e) {
  4071. (this.aspect = e),
  4072. (this.top = o.orthoBase / e),
  4073. (this.bottom = -o.orthoBase / e),
  4074. this.updateProjectionMatrix();
  4075. }),
  4076. (t.exports = n);
  4077. },
  4078. {
  4079. "../constants": 8,
  4080. three: 217,
  4081. },
  4082. ],
  4083. 7: [
  4084. function (e, t, i) {
  4085. "use strict";
  4086. function n() {
  4087. r.PerspectiveCamera.call(
  4088. this,
  4089. a.clampVFOV(o.insideFOV),
  4090. $("#player").width() / $("#player").height(),
  4091. o.insideNear,
  4092. o.insideFar
  4093. ),
  4094. (this.controls = null);
  4095. }
  4096. var r = e("three"),
  4097. o = e("../settings"),
  4098. a = e("../util/cameraLight");
  4099. (n.prototype = Object.create(r.PerspectiveCamera.prototype)),
  4100. (n.prototype.updateAspect = function (e) {
  4101. (this.aspect = e), this.updateProjectionMatrix();
  4102. }),
  4103. (t.exports = n);
  4104. },
  4105. {
  4106. "../settings": 166,
  4107. "../util/cameraLight": 184,
  4108. three: 217,
  4109. },
  4110. ],
  4111. 8: [
  4112. function (e, t, i) {
  4113. "use strict";
  4114. t.exports = {
  4115. signedUrlDefaultExpireTime: 24e4,
  4116. signedUrlCheckInterval: 1e4,
  4117. signedUrlRefreshBuffer: 15e3,
  4118. dollhouseFOV: 70,
  4119. dollhouseNear: 1,
  4120. dollhouseFar: 5e3,
  4121. insideFOV: 70,
  4122. insideFOVMax: 120,
  4123. insideNear: 0.1,
  4124. insideFar: 5e3,
  4125. insideLookSpeed: 0.12,
  4126. insideLookLimitUp: 40, //视角
  4127. insideLookLimitDown: -40,
  4128. orthoNear: 1,
  4129. orthoFar: 5e3,
  4130. orthoBase: 10,
  4131. narrowLandscapeHeight: 290,
  4132. reallyNarrowLandscapeHeight: 250,
  4133. visionTilingStartDate: new Date("8/26/2016"),
  4134. visionTilingStartVersion: "1.1.407.13667",
  4135. windowHeightHighQualityThreshold: 900,
  4136. tourStepDelayDefault: 3500,
  4137. tourStepDelaySlideShow: 5e3,
  4138. workshopApsect: 9 / 16,
  4139. highQualityMaxZoom: 2,
  4140. ultraHighQualityMaxZoom: 3,
  4141. };
  4142. },
  4143. {},
  4144. ],
  4145. 9: [
  4146. function (e, t, i) {
  4147. "use strict";
  4148. function n() {
  4149. (this.activeControl = null),
  4150. (this.controls = {}),
  4151. (this.cameras = {});
  4152. }
  4153. var r = e("./PanoramaControls"),
  4154. o = e("./DollhouseControls"),
  4155. a = e("./FloorplanControls"),
  4156. s = e("../cameras/PanoramaCamera"),
  4157. l = e("../cameras/DollhouseCamera"),
  4158. c = e("../cameras/FloorplanCamera"),
  4159. h = e("events").EventEmitter,
  4160. u = e("../enum/ControlEvents"),
  4161. d = e("../enum/ModelManagerEvents"),
  4162. p = e("../enum/Viewmode"),
  4163. f = e("../settings");
  4164. (n.prototype = Object.create(h.prototype)),
  4165. (n.prototype.init = function (e, t) {
  4166. this.setUpControls(), this.bindEvents(e, t);
  4167. }),
  4168. (n.prototype.activateControls = function (e) {
  4169. this.activeControl &&
  4170. (this.activeControl.reset(), (this.activeControl.enabled = !1)),
  4171. this.controls[e] && (this.controls[e].enabled = !0),
  4172. (this.activeControl = this.controls[e]);
  4173. }),
  4174. (n.prototype.setUpControls = function () {
  4175. var e = {},
  4176. t = {},
  4177. i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN],
  4178. n = [s, l, c],
  4179. h = [r, o, a];
  4180. i.forEach(
  4181. function (i, r) {
  4182. (e[i] = new n[r]()),
  4183. (t[i] = new h[r](e[i])),
  4184. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  4185. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  4186. t[i].on(
  4187. u.InteractionDirect,
  4188. this.emit.bind(this, u.InteractionDirect)
  4189. ),
  4190. t[i].on(
  4191. u.InteractionKey,
  4192. this.emit.bind(this, u.InteractionKey)
  4193. ),
  4194. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  4195. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll));
  4196. }.bind(this)
  4197. ),
  4198. (this.controls = t),
  4199. (this.cameras = e);
  4200. }),
  4201. (n.prototype.bindEvents = function (e, t) {
  4202. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  4203. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  4204. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  4205. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  4206. f.useWheel &&
  4207. (e.addEventListener(
  4208. "mousewheel",
  4209. this.onMouseWheel.bind(this),
  4210. { passive: false }
  4211. ),
  4212. e.addEventListener(
  4213. "DOMMouseScroll",
  4214. this.onMouseWheel.bind(this)
  4215. )),
  4216. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  4217. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  4218. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  4219. e.addEventListener("contextmenu", function (e) {
  4220. e.preventDefault();
  4221. }),
  4222. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  4223. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  4224. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  4225. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  4226. e.addEventListener(
  4227. "pointercancel",
  4228. this.onPointerCancel.bind(this)
  4229. ),
  4230. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  4231. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  4232. t.on(
  4233. d.ActiveModelChanged,
  4234. function (e) {
  4235. this.setModelForControls(e.model);
  4236. }.bind(this)
  4237. );
  4238. }),
  4239. (n.prototype.setModelForControls = function (e) {
  4240. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  4241. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  4242. [p.DOLLHOUSE, p.FLOORPLAN].forEach(
  4243. function (e) {
  4244. this.controls[e].setBounds(t);
  4245. }.bind(this)
  4246. );
  4247. }),
  4248. (n.prototype.onMouseDown = function (e) {
  4249. e.preventDefault(),
  4250. this.activeControl && this.activeControl.onMouseDown(e);
  4251. }),
  4252. (n.prototype.onMouseMove = function (e) {
  4253. e.preventDefault(),
  4254. this.activeControl && this.activeControl.onMouseMove(e);
  4255. }),
  4256. (n.prototype.onMouseUp = function (e) {
  4257. e.preventDefault(),
  4258. this.activeControl && this.activeControl.onMouseUp(e);
  4259. }),
  4260. (n.prototype.onMouseOver = function (e) {
  4261. e.preventDefault(),
  4262. this.activeControl && this.activeControl.onMouseOver(e);
  4263. }),
  4264. (n.prototype.onMouseWheel = function (e) {
  4265. e.preventDefault(),
  4266. this.activeControl && this.activeControl.onMouseWheel(e);
  4267. }),
  4268. (n.prototype.onTouchStart = function (e) {
  4269. e.preventDefault(),
  4270. this.activeControl && this.activeControl.onTouchStart(e);
  4271. var hotList = $("#hotListWrap")[0];
  4272. hotList.classList.remove("hotListActive");
  4273. $("#hotListContent ul .active").removeClass("active");
  4274. $("#hotList")[0].classList.remove("active");
  4275. }),
  4276. (n.prototype.onTouchMove = function (e) {
  4277. e.preventDefault(),
  4278. this.activeControl && this.activeControl.onTouchMove(e);
  4279. }),
  4280. (n.prototype.onTouchEnd = function (e) {
  4281. e.preventDefault(),
  4282. this.activeControl && this.activeControl.onTouchEnd(e);
  4283. }),
  4284. (n.prototype.onPointerDown = function (e) {
  4285. if ((e.preventDefault(), this.activeControl))
  4286. switch (e.pointerType) {
  4287. case "mouse":
  4288. this.activeControl.onMouseDown(e);
  4289. break;
  4290. default:
  4291. this.activeControl.onPointerDown(e);
  4292. }
  4293. }),
  4294. (n.prototype.onPointerMove = function (e) {
  4295. if ((e.preventDefault(), this.activeControl))
  4296. switch (e.pointerType) {
  4297. case "mouse":
  4298. this.activeControl.onMouseMove(e);
  4299. break;
  4300. default:
  4301. this.activeControl.onPointerMove(e);
  4302. }
  4303. }),
  4304. (n.prototype.onPointerUp = function (e) {
  4305. if ((e.preventDefault(), this.activeControl))
  4306. switch (e.pointerType) {
  4307. case "mouse":
  4308. this.activeControl.onMouseUp(e);
  4309. break;
  4310. default:
  4311. this.activeControl.onPointerUp(e);
  4312. }
  4313. }),
  4314. (n.prototype.onPointerCancel = function (e) {
  4315. e.preventDefault(),
  4316. this.activeControl &&
  4317. "mouse" !== e.pointerType &&
  4318. this.activeControl.onPointerUp(e);
  4319. }),
  4320. (n.prototype.onKeyDown = function (e) {
  4321. e.metaKey ||
  4322. e.ctrlKey ||
  4323. (e.preventDefault(),
  4324. this.activeControl && this.activeControl.onKeyDown(e));
  4325. }),
  4326. (n.prototype.onKeyUp = function (e) {
  4327. e.preventDefault(),
  4328. this.activeControl && this.activeControl.onKeyUp(e);
  4329. }),
  4330. (t.exports = n);
  4331. },
  4332. {
  4333. "../cameras/DollhouseCamera": 5,
  4334. "../cameras/FloorplanCamera": 6,
  4335. "../cameras/PanoramaCamera": 7,
  4336. "../enum/ControlEvents": 21,
  4337. "../enum/ModelManagerEvents": 33,
  4338. "../enum/Viewmode": 51,
  4339. "../settings": 166,
  4340. "./DollhouseControls": 10,
  4341. "./FloorplanControls": 11,
  4342. "./PanoramaControls": 13,
  4343. events: 202,
  4344. },
  4345. ],
  4346. 10: [
  4347. function (e, t, i) {
  4348. "use strict";
  4349. function n(e) {
  4350. a.call(this, e),
  4351. (this.minPolarAngle = o.dollhouseDefault.minPolarAngle),
  4352. (this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle),
  4353. (this.minDistance = o.dollhouseDefault.minDistance),
  4354. (this.maxDistance = o.dollhouseDefault.maxDistance),
  4355. (this.adjustedMinDistance = this.minDistance),
  4356. (this.adjustedMaxDistance = this.maxDistance);
  4357. }
  4358. var r = e("three"),
  4359. o = e("../settings"),
  4360. a = e("./OutsideControls");
  4361. (n.prototype = Object.create(a.prototype)),
  4362. (n.prototype.pan = function (e, t) {
  4363. this.camera.updateMatrix();
  4364. var i = this.camera.position.clone().sub(this.target).length();
  4365. (i *= Math.tan(((this.camera.fov / 2) * Math.PI) / 180)),
  4366. this.panLeft((2 * e * i) / $("#player").height()),
  4367. this.panUp((-2 * t * i) / $("#player").height());
  4368. }),
  4369. (n.prototype.updateZoom = function () {
  4370. var e = this.offset.length();
  4371. return e * this.scale;
  4372. }),
  4373. (n.prototype.setZoomBounds = function (e) {
  4374. var t = e.min.distanceTo(e.max);
  4375. (this.adjustedMinDistance = Math.max(
  4376. Math.min(t / 2, o.dollhouseDefault.minDistance),
  4377. 0
  4378. )),
  4379. (this.adjustedMaxDistance = Math.min(
  4380. Math.max(t, o.dollhouseDefault.maxDistance),
  4381. o.skyboxRadius
  4382. )),
  4383. (this.minDistance = this.adjustedMinDistance),
  4384. (this.maxDistance = this.adjustedMaxDistance);
  4385. }),
  4386. (n.prototype.resetRanges = function (e, t) {
  4387. e
  4388. ? ((this.minDistance = Math.min(e, this.minDistance)),
  4389. (this.maxDistance = Math.max(e, this.maxDistance)))
  4390. : ((this.minDistance = this.adjustedMinDistance),
  4391. (this.maxDistance = this.adjustedMaxDistance)),
  4392. t
  4393. ? ((this.minPolarAngle = r.Math.degToRad(-15)),
  4394. (this.maxPolarAngle = r.Math.degToRad(89.9)))
  4395. : ((this.minPolarAngle = o.dollhouseDefault.minPolarAngle),
  4396. (this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle));
  4397. }),
  4398. (n.prototype.toJSON = function () {
  4399. return a.prototype.toJSON.call(this);
  4400. }),
  4401. (t.exports = n);
  4402. },
  4403. {
  4404. "../settings": 166,
  4405. "./OutsideControls": 12,
  4406. three: 217,
  4407. },
  4408. ],
  4409. 11: [
  4410. function (e, t, i) {
  4411. "use strict";
  4412. function n(e) {
  4413. a.call(this, e),
  4414. (this.minDistance = 15),
  4415. (this.maxDistance = 50),
  4416. (this.noRotateUpDown = !0),
  4417. (this.minPolarAngle = 0),
  4418. (this.maxPolarAngle = 0),
  4419. (this.mouseActions[l.LEFT] = s.PAN),
  4420. (this.mouseActions[l.MIDDLE] = s.DOLLY),
  4421. (this.mouseActions[l.RIGHT] = s.ROTATE),
  4422. (this.touchActions[1] = s.PAN),
  4423. (this.touchActions[2] = s.ROTATE_DOLLY),
  4424. (this.absoluteScale = 1),
  4425. (this.currentScale = 1);
  4426. }
  4427. var r = e("three"),
  4428. o = e("../settings"),
  4429. a = e("./OutsideControls"),
  4430. s = e("../enum/ControlActions"),
  4431. l = e("../enum/MouseButton"),
  4432. c = e("../util/math"),
  4433. h = e("../util/browser");
  4434. (n.prototype = Object.create(a.prototype)),
  4435. (n.prototype.zoomToContain = function (e) {
  4436. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  4437. this.currentScale = this.absoluteScale;
  4438. }),
  4439. (n.prototype.getDefaultAbsoluteScale = function (modelSize, ratio) {
  4440. let defaultRatio = 1.2,
  4441. absoluteScale;
  4442. if (_settings.floorPlanAngle) {
  4443. //指定了角度的话,就和browser.aspectRatio()无关,总使用纵向
  4444. var angle = parseFloat(_settings.floorPlanAngle);
  4445. modelSize = modelSize
  4446. .clone()
  4447. .applyEuler(new THREE.Euler(0, angle, 0));
  4448. var n = Math.max(
  4449. Math.abs(modelSize.x),
  4450. Math.abs(modelSize.z) * this.camera.aspect
  4451. ); //视口宽高比 >= 1 情况下,模型所占最大视口尺寸
  4452. var screenSize = Math.min(
  4453. $("#player").width(),
  4454. $("#player").height()
  4455. );
  4456. var maxSize = 800; //模型最大占据像素
  4457. ratio =
  4458. ratio != void 0
  4459. ? ratio
  4460. : Math.max(
  4461. (screenSize * defaultRatio) / maxSize,
  4462. defaultRatio
  4463. );
  4464. absoluteScale = (n / 2 / o.orthoBase) * ratio; //根据模型所占最大视口尺寸调整缩放
  4465. } else {
  4466. var t = Math.max(modelSize.x, modelSize.z),
  4467. i = Math.min(modelSize.x, modelSize.z),
  4468. n = Math.max(t, i * this.camera.aspect),
  4469. r = Math.max(i, t * this.camera.aspect);
  4470. absoluteScale =
  4471. ((h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase) *
  4472. defaultRatio;
  4473. }
  4474. return absoluteScale;
  4475. }),
  4476. /* n.prototype.rotateToView = function(e, t) {
  4477. var i = 0
  4478. , n = h.aspectRatio() < 1
  4479. , r = e.x < e.z;
  4480. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  4481. this.rotateLeft(i),
  4482. this.update(0)
  4483. },
  4484. */
  4485. (n.prototype.rotateToView = function (modelSize, direction) {
  4486. let i = 0,
  4487. n = h.aspectRatio() < 1; //是否模型尺寸显“细长”
  4488. if (_settings.floorPlanAngle) {
  4489. //规定了cadImage旋转值的话 (0是无效的,将不设置)
  4490. i = parseFloat(_settings.floorPlanAngle);
  4491. } else {
  4492. let r = modelSize.x < modelSize.z; //是否视口为“窄屏”
  4493. if (n === r) {
  4494. //“细长” 且 “窄屏”,说明模型尺寸比例与视口比例匹配,相机坐标只需要调转“前”“后”
  4495. if (direction.z > 0) {
  4496. //(第一种情况)相机是否位于背面。 注:在默认情况下webgl的相机朝向-z, direction.z > 0 说明相机视野已经偏向+z,说明相机位于模型“背面”
  4497. i = Math.PI; //经度上做180度轨道角位移,使相机移到静止模型的“前面”
  4498. }
  4499. //(第二种情况) 不做处理
  4500. } else if (direction.x > 0) {
  4501. i = Math.PI / 2;
  4502. } else {
  4503. i = -Math.PI / 2;
  4504. }
  4505. }
  4506. this.rotateLeft(i);
  4507. this.update(0);
  4508. }),
  4509. (n.prototype.rotateToAngle = function (angle) {
  4510. //add 旋转到特定角度
  4511. this.rotateLeft(angle + this.lon);
  4512. this.update(0);
  4513. }),
  4514. (n.prototype.pan = function (e, t) {
  4515. this.camera.updateMatrix(),
  4516. this.panLeft(
  4517. (e * (this.camera.right - this.camera.left)) /
  4518. $("#player").width()
  4519. ),
  4520. this.panUp(
  4521. (-t * (this.camera.top - this.camera.bottom)) /
  4522. $("#player").height()
  4523. );
  4524. }),
  4525. (n.prototype.updateZoom = function () {
  4526. return (
  4527. (this.absoluteScale *=
  4528. this.scale - 0.03 * this.keyboardZoomSpeed),
  4529. (this.absoluteScale = Math.max(
  4530. o.zoomNearLimit,
  4531. Math.min(this.absoluteScale, o.zoomFarLimit)
  4532. )),
  4533. (this.currentScale =
  4534. 0.8 * this.currentScale + 0.2 * this.absoluteScale),
  4535. (this.camera.left = -o.orthoBase * this.currentScale),
  4536. (this.camera.right = o.orthoBase * this.currentScale),
  4537. (this.camera.top =
  4538. (o.orthoBase * this.currentScale) / this.camera.aspect),
  4539. (this.camera.bottom =
  4540. (-o.orthoBase * this.currentScale) / this.camera.aspect),
  4541. this.camera.updateProjectionMatrix(),
  4542. this.offset.length()
  4543. );
  4544. }),
  4545. (n.prototype.toJSON = (function () {
  4546. var e = new r.Quaternion(),
  4547. t = new r.Quaternion().setFromAxisAngle(
  4548. new r.Vector3(0, 1, 0),
  4549. r.Math.degToRad(90)
  4550. ),
  4551. i = new r.Quaternion();
  4552. return function () {
  4553. var n = a.prototype.toJSON.call(this);
  4554. return (
  4555. e.copy(n.camera_quaternion),
  4556. i.copy(t),
  4557. i.multiply(e),
  4558. (n.camera_quaternion.x = c.toPrecision(i.x, 4)),
  4559. (n.camera_quaternion.y = c.toPrecision(i.y, 4)),
  4560. (n.camera_quaternion.z = c.toPrecision(i.z, 4)),
  4561. (n.camera_quaternion.w = c.toPrecision(i.w, 4)),
  4562. (n.ortho_zoom = c.toPrecision(
  4563. this.currentScale * this.camera.aspect,
  4564. 4
  4565. )),
  4566. n
  4567. );
  4568. };
  4569. })()),
  4570. (t.exports = n);
  4571. },
  4572. {
  4573. "../enum/ControlActions": 20,
  4574. "../enum/MouseButton": 34,
  4575. "../settings": 166,
  4576. "../util/browser": 182,
  4577. "../util/math": 190,
  4578. "./OutsideControls": 12,
  4579. three: 217,
  4580. },
  4581. ],
  4582. 12: [
  4583. function (e, t, i) {
  4584. "use strict";
  4585. function n(e) {
  4586. (this.camera = e),
  4587. (this.camera.controls = this),
  4588. (this.enabled = !1),
  4589. (this.target = new r.Vector3()),
  4590. (this.targetBounds = new r.Box3()),
  4591. (this.zoomSpeed = 1),
  4592. (this.minDistance = 0),
  4593. (this.maxDistance = 1 / 0),
  4594. (this.noRotateUpDown = !1),
  4595. (this.rotateSpeed = 1),
  4596. (this.keyboardZoomSpeed = 0),
  4597. (this.keyPanSpeed = 7),
  4598. (this.autoRotate = !1),
  4599. (this.autoRotateSpeed = 2),
  4600. (this.autoPan = !1),
  4601. (this.autoPanPosition = new r.Vector3()),
  4602. (this.minPolarAngle = r.Math.degToRad(25)),
  4603. (this.maxPolarAngle = r.Math.degToRad(65)),
  4604. (this.rotationAcceleration = new r.Vector2()),
  4605. (this.rotationSpeed = new r.Vector2()),
  4606. (this.panAcceleration = new r.Vector2()),
  4607. (this.panSpeed = new r.Vector2()),
  4608. (this.rotateStart = new r.Vector2()),
  4609. (this.rotateEnd = new r.Vector2()),
  4610. (this.rotateDelta = new r.Vector2()),
  4611. (this.panStart = new r.Vector2()),
  4612. (this.panEnd = new r.Vector2()),
  4613. (this.panDelta = new r.Vector2()),
  4614. (this.panOffset = new r.Vector3()),
  4615. (this.offset = new r.Vector3()),
  4616. (this.dollyStart = new r.Vector2()),
  4617. (this.dollyEnd = new r.Vector2()),
  4618. (this.dollyDelta = new r.Vector2()),
  4619. (this.phiDelta = 0),
  4620. (this.thetaDelta = 0),
  4621. (this.scale = 1),
  4622. (this.panVector = new r.Vector3()),
  4623. (this.lastPosition = new r.Vector3()),
  4624. (this.state = c.NONE),
  4625. (this.mouseActions = {}),
  4626. (this.mouseActions[h.LEFT] = c.ROTATE),
  4627. (this.mouseActions[h.MIDDLE] = c.DOLLY),
  4628. (this.mouseActions[h.RIGHT] = c.PAN),
  4629. (this.touchActions = {}),
  4630. (this.touchActions[1] = c.ROTATE),
  4631. (this.touchActions[2] = c.PAN_DOLLY),
  4632. (this.lastMoveTime = 0),
  4633. (this.pointersLimit = 2),
  4634. (this.pointers = []);
  4635. }
  4636. var r = e("three"),
  4637. o = e("../settings"),
  4638. a = e("../util/common"),
  4639. s = e("../util/math"),
  4640. l = e("../enum/Vectors"),
  4641. c = e("../enum/ControlActions"),
  4642. h = e("../enum/MouseButton"),
  4643. u = e("../enum/Keys"),
  4644. d = e("../enum/ControlEvents"),
  4645. p = e("events").EventEmitter,
  4646. f = 1e-6;
  4647. (n.prototype = Object.create(p.prototype)),
  4648. (n.prototype.setBounds = function (e) {
  4649. this.targetBounds = e;
  4650. }),
  4651. (n.prototype.isEngaged = function () {
  4652. return this.state !== c.NONE;
  4653. }),
  4654. (n.prototype.rotateLeft = function (e) {
  4655. void 0 === e && (e = this.getAutoRotationAngle()),
  4656. (this.thetaDelta -= e);
  4657. }),
  4658. (n.prototype.rotateUp = function (e) {
  4659. this.noRotateUpDown ||
  4660. (void 0 === e && (e = this.getAutoRotationAngle()),
  4661. (this.phiDelta -= e));
  4662. }),
  4663. (n.prototype.panLeft = function (e) {
  4664. var t = this.camera.matrix.elements;
  4665. this.panOffset.set(t[0], 0, t[2]).normalize(),
  4666. this.panOffset.multiplyScalar(-e),
  4667. this.panVector.add(this.panOffset);
  4668. }),
  4669. (n.prototype.panUp = function (e) {
  4670. var t = this.camera.matrix.elements;
  4671. this.panOffset.set(t[4], 0, t[6]).normalize(),
  4672. this.panOffset.multiplyScalar(-e),
  4673. this.panVector.add(this.panOffset);
  4674. }),
  4675. (n.prototype.startRotating = function (e, t) {
  4676. e && this.navRotationAcc("x", e), t && this.navRotationAcc("y", t);
  4677. }),
  4678. (n.prototype.stopRotating = function (e) {
  4679. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4680. this.navRotationAcc("x", 0),
  4681. this.navRotationAcc("y", 0);
  4682. }),
  4683. (n.prototype.setAutoPanPosition = (function (e, t) {
  4684. var i = new r.Vector3(),
  4685. n = new r.Vector3();
  4686. return function (e, t) {
  4687. i.copy(this.camera.position),
  4688. (void 0 === e && null === e) || i.setX(e),
  4689. (void 0 === t && null === t) || i.setZ(t);
  4690. var r = this.camera.position.distanceTo(this.target),
  4691. o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  4692. (this.targetClamped = !1),
  4693. n.copy(i).addScaledVector(o, r),
  4694. this.targetBounds.containsPoint(n) ||
  4695. (this.targetBounds.clampPoint(n, n),
  4696. i.copy(n).addScaledVector(o, -r),
  4697. (this.targetClamped = !0)),
  4698. (this.autoPanPosition.x = i.x),
  4699. (this.autoPanPosition.z = i.z),
  4700. this.autoPan && this.stopAutoPanning();
  4701. };
  4702. })()),
  4703. (n.prototype.stopAutoPanning = function () {
  4704. var e = this.autoPan;
  4705. (this.autoPan = !1),
  4706. this.emit(
  4707. this.targetClamped
  4708. ? d.AutoPanClamped
  4709. : e
  4710. ? d.AutoPanInterrupt
  4711. : d.AutoPanComplete
  4712. );
  4713. }),
  4714. (n.prototype.dollyIn = function (e) {
  4715. void 0 === e && (e = this.getZoomScale()), (this.scale /= e);
  4716. }),
  4717. (n.prototype.dollyOut = function (e) {
  4718. void 0 === e && (e = this.getZoomScale()), (this.scale *= e);
  4719. }),
  4720. (n.prototype.updatePan = function (e) {
  4721. if (
  4722. (this.panSpeed
  4723. .multiplyScalar(1 - o.panFriction)
  4724. .addScaledVector(
  4725. this.panAcceleration,
  4726. o.panAccelerationOutside * e
  4727. ),
  4728. this.pan(-this.panSpeed.x, this.panSpeed.y),
  4729. this.autoPan)
  4730. ) {
  4731. var t = new r.Vector3()
  4732. .copy(this.autoPanPosition)
  4733. .sub(this.camera.position);
  4734. t.setY(0).clampLength(0, 50 * e),
  4735. this.target.add(t),
  4736. this.camera.position.add(t),
  4737. this.autoPanPosition.x === this.camera.position.x &&
  4738. this.autoPanPosition.z === this.camera.position.z &&
  4739. ((this.autoPan = !1), this.stopAutoPanning());
  4740. }
  4741. }),
  4742. (n.prototype.update = function (e) {
  4743. e || (e = 1 / 60);
  4744. var friction = Math.min(1, o.rotationFriction * e * 60); //add 如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  4745. this.rotationSpeed
  4746. .multiplyScalar(1 - friction)
  4747. .addScaledVector(
  4748. this.rotationAcceleration,
  4749. o.rotationAccelerationOutside * e
  4750. ),
  4751. this.rotateLeft(-this.rotationSpeed.x),
  4752. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  4753. this.updatePan(e);
  4754. var t = this.camera.position;
  4755. this.offset.copy(t).sub(this.target);
  4756. var i = Math.atan2(this.offset.x, this.offset.z),
  4757. n = Math.atan2(
  4758. Math.sqrt(
  4759. this.offset.x * this.offset.x + this.offset.z * this.offset.z
  4760. ),
  4761. this.offset.y
  4762. );
  4763. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  4764. (i += this.thetaDelta),
  4765. (n += this.phiDelta),
  4766. (n = Math.max(
  4767. this.minPolarAngle,
  4768. Math.min(this.maxPolarAngle, n)
  4769. )),
  4770. (n = Math.max(f, Math.min(Math.PI - f, n)));
  4771. (this.lon = i), (this.lat = n); //add
  4772. var r = this.updateZoom();
  4773. (r = Math.max(this.minDistance, Math.min(this.maxDistance, r))),
  4774. this.target.add(this.panVector),
  4775. this.targetBounds.clampPoint(this.target, this.target),
  4776. (this.offset.x = r * Math.sin(n) * Math.sin(i)),
  4777. (this.offset.y = r * Math.cos(n)),
  4778. (this.offset.z = r * Math.sin(n) * Math.cos(i)),
  4779. t.copy(this.target).add(this.offset),
  4780. this.camera.lookAt(this.target),
  4781. (this.thetaDelta = 0),
  4782. (this.phiDelta = 0),
  4783. (this.scale = 1),
  4784. this.panVector.set(0, 0, 0),
  4785. this.lastPosition.distanceTo(this.camera.position) > 0 &&
  4786. this.lastPosition.copy(this.camera.position);
  4787. }),
  4788. (n.prototype.getAutoRotationAngle = function () {
  4789. return ((2 * Math.PI) / 60 / 60) * this.autoRotateSpeed;
  4790. }),
  4791. (n.prototype.getZoomScale = function () {
  4792. return Math.pow(0.95, this.zoomSpeed);
  4793. }),
  4794. (n.prototype.onMouseDown = function (e) {
  4795. if (this.enabled) {
  4796. switch (
  4797. (e.preventDefault(),
  4798. this.stopAutoPanning(),
  4799. (this.mouseDown = !0),
  4800. (this.state = this.mouseActions[e.button]),
  4801. this.state)
  4802. ) {
  4803. case c.ROTATE:
  4804. this.rotateStart.set(
  4805. e.clientX,
  4806. this.noRotateUpDown ? 0 : e.clientY
  4807. ),
  4808. this.rotationSpeed.set(0, 0);
  4809. break;
  4810. case c.DOLLY:
  4811. this.dollyStart.set(e.clientX, e.clientY);
  4812. break;
  4813. case c.PAN:
  4814. this.panStart.set(e.clientX, e.clientY);
  4815. }
  4816. this.emit(d.InputStart, "mouse");
  4817. }
  4818. }),
  4819. (n.prototype.onMouseMove = function (e) {
  4820. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  4821. switch ((e.preventDefault(), this.state)) {
  4822. case c.ROTATE:
  4823. this.rotateEnd.set(
  4824. e.clientX,
  4825. this.noRotateUpDown ? 0 : e.clientY
  4826. ),
  4827. this.rotateDelta.subVectors(
  4828. this.rotateEnd,
  4829. this.rotateStart
  4830. ),
  4831. this.rotateLeft(
  4832. ((2 * Math.PI * this.rotateDelta.x) /
  4833. $("#player").width()) *
  4834. this.rotateSpeed
  4835. ),
  4836. this.rotateUp(
  4837. ((2 * Math.PI * this.rotateDelta.y) /
  4838. $("#player").height()) *
  4839. this.rotateSpeed
  4840. ),
  4841. this.rotateStart.copy(this.rotateEnd);
  4842. break;
  4843. case c.DOLLY:
  4844. this.dollyEnd.set(e.clientX, e.clientY),
  4845. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  4846. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  4847. t.call(this), this.dollyStart.copy(this.dollyEnd);
  4848. break;
  4849. case c.PAN:
  4850. this.panEnd.set(e.clientX, e.clientY),
  4851. this.panDelta.subVectors(this.panEnd, this.panStart),
  4852. this.pan(this.panDelta.x, this.panDelta.y),
  4853. this.panStart.copy(this.panEnd);
  4854. }
  4855. this.emit(d.Move, "mouse"),
  4856. (this.lastMoveTime = e.timeStamp),
  4857. this.update();
  4858. }
  4859. }),
  4860. (n.prototype.onMouseUp = function (e) {
  4861. this.enabled &&
  4862. ((this.mouseDown = !1),
  4863. (this.state = c.NONE),
  4864. "mouseover" !== e.type &&
  4865. (e.timeStamp > this.lastMoveTime + 100
  4866. ? (this.rotationSpeed.set(0, 0),
  4867. this.rotationAcceleration.set(0, 0))
  4868. : this.rotationAcceleration.set(
  4869. -this.rotateDelta.x,
  4870. this.rotateDelta.y
  4871. ),
  4872. this.update(),
  4873. this.rotationAcceleration.set(0, 0),
  4874. this.rotateDelta.set(0, 0)));
  4875. }),
  4876. (n.prototype.onMouseOver = function (e) {
  4877. (0 !== e.which && 0 !== e.buttons) || this.onMouseUp(e);
  4878. }),
  4879. (n.prototype.onMouseWheel = function (e) {
  4880. if (this.enabled && o.useWheel) {
  4881. this.emit(d.Move, "wheel");
  4882. var t = e.wheelDelta || -e.detail,
  4883. i = t > 0 ? this.dollyOut : this.dollyIn;
  4884. i.call(this), this.update();
  4885. }
  4886. }),
  4887. (n.prototype.onKeyDown = function (e) {
  4888. this.enabled &&
  4889. (e.metaKey ||
  4890. e.ctrlKey ||
  4891. (e.preventDefault(), this.handleKeyDown(e.which)));
  4892. }),
  4893. (n.prototype.navRotationAcc = function (e, t) {
  4894. "y" === e
  4895. ? this.noRotateUpDown
  4896. ? (this.keyboardZoomSpeed = t)
  4897. : (this.rotationAcceleration.y = t)
  4898. : (this.rotationAcceleration.x = t);
  4899. }),
  4900. (n.prototype.navPanAcc = function (e, t) {
  4901. this.stopAutoPanning(), (this.panAcceleration[e] = t);
  4902. }),
  4903. (n.prototype.handleKeyDown = function (e) {
  4904. var t = !0;
  4905. switch (e) {
  4906. case u.UPARROW:
  4907. case u.I:
  4908. this.navRotationAcc("y", 1);
  4909. break;
  4910. case u.DOWNARROW:
  4911. case u.K:
  4912. this.navRotationAcc("y", -1);
  4913. break;
  4914. case u.LEFTARROW:
  4915. case u.J:
  4916. this.navRotationAcc("x", -1);
  4917. break;
  4918. case u.RIGHTARROW:
  4919. case u.L:
  4920. this.navRotationAcc("x", 1);
  4921. break;
  4922. case u.W:
  4923. this.navPanAcc("y", 1);
  4924. break;
  4925. case u.S:
  4926. this.navPanAcc("y", -1);
  4927. break;
  4928. case u.A:
  4929. this.navPanAcc("x", -1);
  4930. break;
  4931. case u.D:
  4932. this.navPanAcc("x", 1);
  4933. break;
  4934. default:
  4935. t = !1;
  4936. }
  4937. t && this.emit(d.Move, "key");
  4938. }),
  4939. (n.prototype.onKeyUp = function (e) {
  4940. this.enabled &&
  4941. (e.preventDefault(),
  4942. e.stopPropagation(),
  4943. this.handleKeyUp(e.which));
  4944. }),
  4945. (n.prototype.handleKeyUp = function (e) {
  4946. switch (e) {
  4947. case u.I:
  4948. case u.K:
  4949. case u.UPARROW:
  4950. case u.DOWNARROW:
  4951. (this.keyboardZoomSpeed = 0), (this.rotationAcceleration.y = 0);
  4952. break;
  4953. case u.J:
  4954. case u.L:
  4955. case u.LEFTARROW:
  4956. case u.RIGHTARROW:
  4957. this.rotationAcceleration.x = 0;
  4958. break;
  4959. case u.S:
  4960. case u.W:
  4961. this.panAcceleration.y = 0;
  4962. break;
  4963. case u.A:
  4964. case u.D:
  4965. this.panAcceleration.x = 0;
  4966. }
  4967. }),
  4968. (n.prototype.onTouchStart = function (e) {
  4969. if (this.enabled || this.state === c.NONE) {
  4970. e.preventDefault(), e.stopPropagation(), this.stopAutoPanning();
  4971. var t = function () {
  4972. if (2 === e.touches.length) {
  4973. var t = e.touches[0].pageX - e.touches[1].pageX,
  4974. i = e.touches[0].pageY - e.touches[1].pageY;
  4975. this.dollyStart.set(t, i);
  4976. }
  4977. }.bind(this),
  4978. i = function () {
  4979. this.panStart.set(
  4980. a.average(e.touches, "pageX"),
  4981. a.average(e.touches, "pageY")
  4982. );
  4983. }.bind(this),
  4984. n = function () {
  4985. this.rotateStart.set(
  4986. a.average(e.touches, "pageX"),
  4987. a.average(e.touches, "pageY")
  4988. );
  4989. }.bind(this);
  4990. switch (
  4991. ((this.state = this.touchActions[e.touches.length]), this.state)
  4992. ) {
  4993. case c.PAN_DOLLY:
  4994. t();
  4995. case c.PAN:
  4996. i();
  4997. break;
  4998. case c.ROTATE_DOLLY:
  4999. t();
  5000. case c.ROTATE:
  5001. n();
  5002. }
  5003. this.rotationSpeed.set(0, 0), this.emit(d.InputStart, "touch");
  5004. }
  5005. }),
  5006. (n.prototype.onTouchMove = function (e) {
  5007. if (this.enabled && this.state !== c.NONE) {
  5008. e.preventDefault(), e.stopPropagation();
  5009. var t = function () {
  5010. var t = e.touches[0].pageX - e.touches[1].pageX,
  5011. i = e.touches[0].pageY - e.touches[1].pageY;
  5012. this.dollyEnd.set(t, i);
  5013. var n = this.dollyStart.length() - this.dollyEnd.length();
  5014. n > 0
  5015. ? this.dollyOut(1 + n / 500)
  5016. : this.dollyIn(1 - n / 500),
  5017. this.dollyStart.copy(this.dollyEnd);
  5018. }.bind(this),
  5019. i = function () {
  5020. this.panEnd.set(
  5021. a.average(e.touches, "pageX"),
  5022. a.average(e.touches, "pageY")
  5023. ),
  5024. this.panDelta.subVectors(this.panEnd, this.panStart),
  5025. this.pan(this.panDelta.x, this.panDelta.y),
  5026. this.panStart.copy(this.panEnd),
  5027. this.rotateDelta.set(0, 0);
  5028. }.bind(this),
  5029. n = function () {
  5030. this.rotateEnd.set(
  5031. a.average(e.touches, "pageX"),
  5032. a.average(e.touches, "pageY")
  5033. ),
  5034. this.rotateDelta.subVectors(
  5035. this.rotateEnd,
  5036. this.rotateStart
  5037. ),
  5038. this.rotateLeft(
  5039. ((2 * Math.PI * this.rotateDelta.x) /
  5040. $("#player").width()) *
  5041. this.rotateSpeed
  5042. ),
  5043. this.rotateUp(
  5044. ((2 * Math.PI * this.rotateDelta.y) /
  5045. $("#player").height()) *
  5046. this.rotateSpeed
  5047. ),
  5048. this.rotateStart.copy(this.rotateEnd);
  5049. }.bind(this),
  5050. r = function () {
  5051. if (2 === e.touches.length) {
  5052. var i = window.devicePixelRatio || 1,
  5053. r = e.touches[1].pageX - e.touches[0].pageX,
  5054. s = e.touches[1].pageY - e.touches[0].pageY,
  5055. l = Math.sqrt(r * r + s * s),
  5056. h = Math.abs(this.dollyStart.length() - l);
  5057. if (h > o.input.touchMoveThreshold * i)
  5058. (this.state = c.DOLLY), t();
  5059. else {
  5060. var u = a.average(e.touches, "pageX"),
  5061. d = a.average(e.touches, "pageY"),
  5062. p = this.rotateDelta
  5063. .set(u, d)
  5064. .sub(this.rotateStart)
  5065. .length();
  5066. p > o.input.touchMoveThreshold &&
  5067. ((this.state = c.ROTATE),
  5068. this.rotateStart.set(u, d),
  5069. n());
  5070. }
  5071. }
  5072. }.bind(this);
  5073. switch (this.state) {
  5074. case c.PAN_DOLLY:
  5075. t();
  5076. case c.PAN:
  5077. i();
  5078. break;
  5079. case c.ROTATE_DOLLY:
  5080. r();
  5081. break;
  5082. case c.DOLLY:
  5083. t();
  5084. break;
  5085. case c.ROTATE:
  5086. n();
  5087. break;
  5088. default:
  5089. this.state = c.NONE;
  5090. }
  5091. (this.lastMoveTime = e.timeStamp), this.emit(d.Move, "touch");
  5092. }
  5093. }),
  5094. (n.prototype.onTouchEnd = function (e) {
  5095. this.enabled &&
  5096. (this.state === c.ROTATE &&
  5097. (e.timeStamp > this.lastMoveTime + 100
  5098. ? (this.rotationSpeed.set(0, 0),
  5099. this.rotationAcceleration.set(0, 0))
  5100. : this.rotationAcceleration.set(
  5101. -this.rotateDelta.x,
  5102. this.rotateDelta.y
  5103. )),
  5104. (this.state = c.NONE),
  5105. this.update(),
  5106. this.rotationAcceleration.set(0, 0),
  5107. this.rotateDelta.set(0, 0));
  5108. }),
  5109. (n.prototype.onPointerDown = function (e) {
  5110. this.enabled &&
  5111. ("touch" === e.pointerType &&
  5112. (this.pointers.length < this.pointersLimit &&
  5113. this.pointers.push({
  5114. id: e.pointerId,
  5115. pageX: e.pageX,
  5116. pageY: e.pageY,
  5117. }),
  5118. (e.touches = this.pointers),
  5119. this.onTouchStart(e)),
  5120. this.emit(d.InputStart, "pointer"));
  5121. }),
  5122. (n.prototype.onPointerMove = function (e) {
  5123. this.enabled &&
  5124. "touch" === e.pointerType &&
  5125. (this.pointers.forEach(function (t) {
  5126. e.pointerId === t.id &&
  5127. ((t.pageX = e.pageX), (t.pageY = e.pageY));
  5128. }),
  5129. (e.touches = this.pointers),
  5130. this.onTouchMove(e));
  5131. }),
  5132. (n.prototype.onPointerUp = function (e) {
  5133. this.enabled &&
  5134. "touch" === e.pointerType &&
  5135. (this.pointers.forEach(
  5136. function (t, i) {
  5137. e.pointerId === t.id && this.pointers.splice(i, 1);
  5138. }.bind(this)
  5139. ),
  5140. (e.touches = this.pointers),
  5141. this.onTouchEnd(e));
  5142. }),
  5143. (n.prototype.reset = function () {
  5144. (this.state = c.NONE),
  5145. this.stopAutoPanning(),
  5146. this.rotationSpeed.set(0, 0),
  5147. this.rotationAcceleration.set(0, 0),
  5148. this.panSpeed.set(0, 0),
  5149. this.panAcceleration.set(0, 0);
  5150. }),
  5151. (n.prototype.toJSON = function () {
  5152. var e = {
  5153. camera_position: {
  5154. x: s.toPrecision(this.camera.position.x, 4),
  5155. y: s.toPrecision(this.camera.position.y, 4),
  5156. z: s.toPrecision(this.camera.position.z, 4),
  5157. },
  5158. camera_quaternion: {
  5159. x: s.toPrecision(this.camera.quaternion.x, 4),
  5160. y: s.toPrecision(this.camera.quaternion.y, 4),
  5161. z: s.toPrecision(this.camera.quaternion.z, 4),
  5162. w: s.toPrecision(this.camera.quaternion.w, 4),
  5163. },
  5164. };
  5165. return e;
  5166. }),
  5167. (t.exports = n);
  5168. },
  5169. {
  5170. "../enum/ControlActions": 20,
  5171. "../enum/ControlEvents": 21,
  5172. "../enum/Keys": 30,
  5173. "../enum/MouseButton": 34,
  5174. "../enum/Vectors": 50,
  5175. "../settings": 166,
  5176. "../util/common": 185,
  5177. "../util/math": 190,
  5178. events: 202,
  5179. three: 217,
  5180. },
  5181. ],
  5182. 13: [
  5183. function (e, t, i) {
  5184. (function (i) {
  5185. "use strict";
  5186. function n(e) {
  5187. (this.camera = e),
  5188. (this.camera.controls = this),
  5189. (this.target = new r.Vector3(0, 0, 0)),
  5190. (this.lookVector = new r.Vector3()),
  5191. (this.lookSpeed = 0.05),
  5192. (this.rotationAcc = new r.Vector2()),
  5193. (this.rotationSpeed = new r.Vector2()),
  5194. (this.lat = 0),
  5195. (this.lon = 0),
  5196. (this.phi = 0),
  5197. (this.theta = 0),
  5198. (this.enabled = !1),
  5199. (this.locked = !1),
  5200. (this.pointer = new r.Vector2(0, 0)),
  5201. (this.rotationHistory = []),
  5202. (this.rotationDifference = new r.Vector2()),
  5203. (this.pointerDragOn = !1),
  5204. (this.pointerDragStart = new r.Vector2(0, 0)),
  5205. (this.pinchDistance = 0),
  5206. (this.moveStart = new r.Vector2()),
  5207. (this.moveTolerance = 0.01),
  5208. (this.pointersLimit = 2),
  5209. (this.pointers = []);
  5210. }
  5211. var r = e("three"),
  5212. o = e("../util/logger"),
  5213. a = e("../settings"),
  5214. s = e("../util/common"),
  5215. l = e("../util/math"),
  5216. c = (e("../enum/Vectors"), e("../enum/MouseButton")),
  5217. h = e("../enum/Keys"),
  5218. u = e("../enum/ControlEvents"),
  5219. d = e("events").EventEmitter;
  5220. new o(i);
  5221. (n.prototype = Object.create(d.prototype)),
  5222. (n.prototype.usable = function () {
  5223. return this.enabled && !this.locked;
  5224. }),
  5225. /* n.prototype.lookAt = function(e) {
  5226. var t = this.camera.position.clone().sub(e)
  5227. , i = Math.atan(t.z / t.x);
  5228. i += t.x < 0 ? Math.PI : 0,
  5229. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  5230. this.lon = r.Math.radToDeg(i) + 180;
  5231. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  5232. , o = Math.atan(t.y / n);
  5233. this.lat = -r.Math.radToDeg(o)
  5234. }
  5235. */
  5236. (n.prototype.lookAt = function (aim, dir) {
  5237. var t = dir || this.camera.position.clone().sub(aim); //aim所指点的笛卡尔坐标系
  5238. var i = Math.atan(t.z / t.x);
  5239. i += t.x < 0 ? Math.PI : 0;
  5240. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0;
  5241. this.lon = r.Math.radToDeg(i) + 180;
  5242. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  5243. o = Math.atan(t.y / n);
  5244. this.lat = -r.Math.radToDeg(o);
  5245. }),
  5246. (n.prototype.startRotationFrom = function (e, t) {
  5247. l.convertScreenPositionToNDC(e, t, this.pointer),
  5248. (this.pointerDragOn = !0),
  5249. this.pointerDragStart.copy(this.pointer),
  5250. this.moveStart.copy(this.pointer),
  5251. (this.rotationHistory = []),
  5252. this.rotationSpeed.set(0, 0);
  5253. }),
  5254. (n.prototype.onMouseOver = function (e) {
  5255. !this.pointerDragOn ||
  5256. (0 !== e.which && 0 !== e.buttons) ||
  5257. this.onMouseUp(e);
  5258. }),
  5259. (n.prototype.onTouchStart = function (e) {
  5260. if (this.usable()) {
  5261. switch (
  5262. (e.preventDefault(), e.stopPropagation(), e.touches.length)
  5263. ) {
  5264. case 1:
  5265. this.startRotationFrom(
  5266. e.touches[0].clientX,
  5267. e.touches[0].clientY
  5268. );
  5269. break;
  5270. case 2:
  5271. var t =
  5272. (e.touches[0].clientX - e.touches[1].clientX) /
  5273. $("#player").width(),
  5274. i =
  5275. (e.touches[0].clientY - e.touches[1].clientY) /
  5276. $("#player").height();
  5277. this.pinchDistance = Math.sqrt(t * t + i * i);
  5278. }
  5279. this.emit(u.InputStart, "touch");
  5280. }
  5281. }),
  5282. (n.prototype.onPointerDown = function (e) {
  5283. this.usable() &&
  5284. "touch" === e.pointerType &&
  5285. (this.pointers.length < this.pointersLimit &&
  5286. this.pointers.push({
  5287. id: e.pointerId,
  5288. clientX: e.clientX,
  5289. clientY: e.clientY,
  5290. }),
  5291. (e.touches = this.pointers),
  5292. this.onTouchStart(e),
  5293. this.emit(u.InputStart, "pointer"));
  5294. }),
  5295. (n.prototype.onMouseDown = function (e) {
  5296. if (this.usable()) {
  5297. switch ((e.preventDefault(), e.stopPropagation(), e.button)) {
  5298. case c.LEFT:
  5299. this.startRotationFrom(e.clientX, e.clientY);
  5300. }
  5301. SoundManager.pause("tour"); // zeg 点击场景时停止语音
  5302. this.emit(u.InputStart, "mouse");
  5303. }
  5304. }),
  5305. (n.prototype.updateRotation = function () {
  5306. if (this.usable() && this.pointerDragOn) {
  5307. var e = new r.Vector3(
  5308. this.pointerDragStart.x,
  5309. this.pointerDragStart.y,
  5310. -1
  5311. ).unproject(this.camera),
  5312. t = new r.Vector3(
  5313. this.pointer.x,
  5314. this.pointer.y,
  5315. -1
  5316. ).unproject(this.camera),
  5317. i = Math.sqrt(e.x * e.x + e.z * e.z),
  5318. n = Math.sqrt(t.x * t.x + t.z * t.z),
  5319. o = Math.atan2(e.y, i),
  5320. a = Math.atan2(t.y, n);
  5321. (this.rotationDifference.y = r.Math.radToDeg(o - a)),
  5322. (e.y = 0),
  5323. (t.y = 0);
  5324. var s = Math.acos(e.dot(t) / e.length() / t.length());
  5325. isNaN(s) ||
  5326. ((this.rotationDifference.x = r.Math.radToDeg(s)),
  5327. this.pointerDragStart.x < this.pointer.x &&
  5328. (this.rotationDifference.x *= -1)),
  5329. this.pointerDragStart.copy(this.pointer);
  5330. }
  5331. }),
  5332. (n.prototype.onMouseMove = function (e) {
  5333. this.usable() &&
  5334. (l.convertScreenPositionToNDC(
  5335. e.clientX,
  5336. e.clientY,
  5337. this.pointer
  5338. ),
  5339. this.pointerDragOn &&
  5340. (Math.abs(this.pointer.x - this.moveStart.x) >
  5341. this.moveTolerance ||
  5342. Math.abs(this.pointer.y - this.moveStart.y) >
  5343. this.moveTolerance) &&
  5344. this.emit(u.Move, "mouse"));
  5345. }),
  5346. (n.prototype.onTouchMove = function (e) {
  5347. if (this.usable())
  5348. switch ((this.emit(u.Move, "touch"), e.touches.length)) {
  5349. case 1:
  5350. l.convertScreenPositionToNDC(
  5351. e.touches[0].clientX,
  5352. e.touches[0].clientY,
  5353. this.pointer
  5354. );
  5355. break;
  5356. case 2:
  5357. var t =
  5358. (e.touches[0].clientX - e.touches[1].clientX) /
  5359. $("#player").width(),
  5360. i =
  5361. (e.touches[0].clientY - e.touches[1].clientY) /
  5362. $("#player").height(),
  5363. n = this.pinchDistance - Math.sqrt(t * t + i * i);
  5364. Math.abs(n) > 0.01 &&
  5365. (this.emit(u.InteractionDirect),
  5366. this.emit(u.Pinch, n),
  5367. (this.pinchDistance -= n));
  5368. }
  5369. }),
  5370. (n.prototype.onPointerMove = function (e) {
  5371. this.usable() &&
  5372. "touch" === e.pointerType &&
  5373. (this.pointers.forEach(function (t) {
  5374. e.pointerId === t.id &&
  5375. ((t.clientX = e.clientX), (t.clientY = e.clientY));
  5376. }),
  5377. (e.touches = this.pointers),
  5378. this.onTouchMove(e));
  5379. }),
  5380. (n.prototype.endRotation = function () {
  5381. this.pointerDragOn = !1;
  5382. var e = s.averageVectors(this.rotationHistory);
  5383. this.rotationSpeed.set(
  5384. e.x * a.rotationAfterMoveMultiplier,
  5385. e.y * a.rotationAfterMoveMultiplier
  5386. );
  5387. }),
  5388. (n.prototype.onTouchEnd = function (e) {
  5389. this.usable() &&
  5390. (e.preventDefault(), e.stopPropagation(), this.endRotation());
  5391. }),
  5392. (n.prototype.onMouseUp = function (e) {
  5393. this.usable() &&
  5394. (e.preventDefault(), e.stopPropagation(), this.endRotation());
  5395. }),
  5396. (n.prototype.onPointerUp = function (e) {
  5397. this.usable() &&
  5398. "touch" === e.pointerType &&
  5399. (this.pointers.forEach(
  5400. function (t, i) {
  5401. e.pointerId === t.id && this.pointers.splice(i, 1);
  5402. }.bind(this)
  5403. ),
  5404. (e.touches = this.pointers),
  5405. this.onTouchEnd(e));
  5406. }),
  5407. (n.prototype.update = function (e) {
  5408. this.lon, this.lat;
  5409. for (
  5410. this.updateRotation(),
  5411. this.rotationHistory.push(this.rotationDifference.clone());
  5412. this.rotationHistory.length > a.rotationAfterMoveHistoryCount;
  5413. )
  5414. this.rotationHistory.shift();
  5415. (this.lon += this.rotationDifference.x),
  5416. (this.lat += this.rotationDifference.y),
  5417. this.rotationDifference.set(0, 0);
  5418. //改
  5419. var friction = Math.min(1, a.rotationFriction * e * 60); //如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  5420. (this.rotationSpeed.x =
  5421. this.rotationSpeed.x * (1 - friction) +
  5422. this.rotationAcc.x * a.rotationAccelerationInside),
  5423. (this.rotationSpeed.y =
  5424. this.rotationSpeed.y * (1 - friction) +
  5425. this.rotationAcc.y * a.rotationAccelerationInside),
  5426. (this.lon += this.rotationSpeed.x * e),
  5427. (this.lat += this.rotationSpeed.y * e);
  5428. //this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  5429. var insideLookLimitDown =
  5430. a.insideLookLimitDown - a.insideFOV / 2 + this.camera.fov / 2;
  5431. var insideLookLimitUp =
  5432. a.insideLookLimitUp + a.insideFOV / 2 - this.camera.fov / 2;
  5433. this.lat = Math.max(
  5434. insideLookLimitDown,
  5435. Math.min(insideLookLimitUp, this.lat)
  5436. ); //通过预定义的俯仰角最大最小范围(insideLookLimitUp、insideLookLimitDown)来限制俯仰角。 注:这种数学计算很常见,因此API也很常见(clamp),等价于 this.lat = THREE.Math.clamp( this.lat, settings.insideLookLimitDown, settings.insideLookLimitUp );
  5437. (this.phi = r.Math.degToRad(90 - this.lat)),
  5438. (this.theta = r.Math.degToRad(this.lon)),
  5439. (this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta)),
  5440. (this.lookVector.y = Math.cos(this.phi)),
  5441. (this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta)),
  5442. this.target.copy(this.lookVector).add(this.camera.position),
  5443. this.camera.lookAt(this.target);
  5444. }),
  5445. (n.prototype.onMouseWheel = function (e) {
  5446. if (this.usable()) {
  5447. var t = e.wheelDelta || -e.detail;
  5448. this.emit(u.InteractionDirect), this.emit(u.Scroll, t);
  5449. }
  5450. }),
  5451. (n.prototype.onKeyDown = function (e) {
  5452. this.usable() &&
  5453. (e.metaKey ||
  5454. e.ctrlKey ||
  5455. (e.preventDefault(), this.handleKeyDown(e.which)));
  5456. }),
  5457. (n.prototype.handleKeyDown = function (e) {
  5458. var t = function (e, t) {
  5459. this.rotationAcc[e] = t;
  5460. }.bind(this);
  5461. this.emit(u.InteractionKey);
  5462. var i = !0;
  5463. switch (e) {
  5464. case h.LEFTARROW:
  5465. case h.J:
  5466. t("x", -1);
  5467. break;
  5468. case h.RIGHTARROW:
  5469. case h.L:
  5470. t("x", 1);
  5471. break;
  5472. case h.I:
  5473. t("y", 1);
  5474. break;
  5475. case h.K:
  5476. t("y", -1);
  5477. break;
  5478. default:
  5479. i = !1;
  5480. }
  5481. i && this.emit(u.Move, "key");
  5482. }),
  5483. (n.prototype.onKeyUp = function (e) {
  5484. this.usable() &&
  5485. (e.preventDefault(),
  5486. e.stopPropagation(),
  5487. this.handleKeyUp(e.which));
  5488. }),
  5489. (n.prototype.handleKeyUp = function (e) {
  5490. switch (e) {
  5491. case h.LEFTARROW:
  5492. case h.J:
  5493. case h.RIGHTARROW:
  5494. case h.L:
  5495. this.rotationAcc.x = 0;
  5496. break;
  5497. case h.I:
  5498. case h.K:
  5499. this.rotationAcc.y = 0;
  5500. }
  5501. }),
  5502. (n.prototype.startRotating = function (e, t) {
  5503. e && (this.rotationAcc.x = e), t && (this.rotationAcc.y = t);
  5504. }),
  5505. (n.prototype.stopRotating = function (e) {
  5506. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  5507. this.rotationAcc.set(0, 0);
  5508. }),
  5509. (n.prototype.reset = function () {
  5510. (this.pointerDragOn = !1),
  5511. this.rotationAcc.set(0, 0),
  5512. this.rotationSpeed.set(0, 0),
  5513. (this.pointers = []);
  5514. }),
  5515. (n.prototype.toJSON = function () {
  5516. var e = {
  5517. camera_position: {
  5518. x: l.toPrecision(this.camera.position.x, 4),
  5519. y: l.toPrecision(this.camera.position.y, 4),
  5520. z: l.toPrecision(this.camera.position.z, 4),
  5521. },
  5522. camera_quaternion: {
  5523. x: l.toPrecision(this.camera.quaternion.x, 4),
  5524. y: l.toPrecision(this.camera.quaternion.y, 4),
  5525. z: l.toPrecision(this.camera.quaternion.z, 4),
  5526. w: l.toPrecision(this.camera.quaternion.w, 4),
  5527. },
  5528. };
  5529. return e;
  5530. }),
  5531. (n.prototype.setStateFromJSON = function (e) {
  5532. this.camera.position.copy(e.camera_position),
  5533. this.camera.quaternion.copy(e.camera_quaternion);
  5534. }),
  5535. (t.exports = n);
  5536. }).call(this, "/js/controls/PanoramaControls.js");
  5537. },
  5538. {
  5539. "../enum/ControlEvents": 21,
  5540. "../enum/Keys": 30,
  5541. "../enum/MouseButton": 34,
  5542. "../enum/Vectors": 50,
  5543. "../settings": 166,
  5544. "../util/common": 185,
  5545. "../util/logger": 189,
  5546. "../util/math": 190,
  5547. events: 202,
  5548. three: 217,
  5549. },
  5550. ],
  5551. 14: [
  5552. function (e, t, i) {
  5553. (function (i) {
  5554. "use strict";
  5555. var n = e("three"),
  5556. r = e("../enum/Viewmode"),
  5557. o = e("../util/logger"),
  5558. a = new o(i);
  5559. t.exports = {
  5560. serialize: function (e) {
  5561. return encodeURI(JSON.stringify(e));
  5562. },
  5563. deserialize: function (e) {
  5564. function t(e) {
  5565. function t(e, t) {
  5566. return e && "number" == typeof t && !isNaN(t);
  5567. }
  5568. return e.reduce(t, !0);
  5569. }
  5570. try {
  5571. var i = JSON.parse(decodeURI(e)),
  5572. o = {
  5573. mode: r.fromInt(i.camera_mode),
  5574. panoId: i.scan_id,
  5575. position: new n.Vector3().copy(i.camera_position),
  5576. quaternion: new n.Quaternion().copy(i.camera_quaternion),
  5577. zoom: i.ortho_zoom,
  5578. floorVisibility: i.floor_visibility,
  5579. },
  5580. s = o.position;
  5581. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  5582. var l = o.quaternion;
  5583. return (
  5584. t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1), o
  5585. );
  5586. } catch (i) {
  5587. a.debug(
  5588. "Not able to parse start location as JSON; falling back to old array style parsing"
  5589. );
  5590. try {
  5591. var c = e.split(","),
  5592. h = {
  5593. x: parseFloat(c[2]),
  5594. y: parseFloat(c[3]),
  5595. z: parseFloat(c[4]),
  5596. },
  5597. u = {
  5598. x: parseFloat(c[5]),
  5599. y: parseFloat(c[6]),
  5600. z: parseFloat(c[7]),
  5601. w: parseFloat(c[8]),
  5602. };
  5603. return (
  5604. t([h.x, h.y, h.z]) || ((h.x = 0), (h.y = 0), (h.z = 0)),
  5605. t([u.x, u.y, u.z, u.w]) ||
  5606. ((u.x = 0), (u.y = 0), (u.z = 0), (u.w = 1)),
  5607. {
  5608. mode: r.fromInt(c[0]),
  5609. panoId: c[1],
  5610. position: new n.Vector3().copy(h),
  5611. quaternion: new n.Quaternion().copy(u),
  5612. }
  5613. );
  5614. } catch (t) {
  5615. a.warn(
  5616. 'Invalid start override, ignoring: "' + e + '"',
  5617. t.message
  5618. );
  5619. }
  5620. }
  5621. return null;
  5622. },
  5623. };
  5624. }).call(this, "/js/controls/serializer.js");
  5625. },
  5626. {
  5627. "../enum/Viewmode": 51,
  5628. "../util/logger": 189,
  5629. three: 217,
  5630. },
  5631. ],
  5632. 15: [
  5633. function (e, t, i) {
  5634. (function (i) {
  5635. "use strict";
  5636. function n() {
  5637. (this.endlessLoop = a.warp.loop),
  5638. (this.clock = new r.Clock(!0)),
  5639. (this.model = null),
  5640. (this.player = null),
  5641. (this.currentItem = null),
  5642. (this.destinationItem = null),
  5643. (this.tourIsPlaying = !1),
  5644. (this.transitionStage = y.None),
  5645. (this.nextFunc = null),
  5646. (this.onTheBus = !1),
  5647. (this.tourInProgress = !1),
  5648. (this.reachSource = null),
  5649. (this.interrupted = !1),
  5650. (this.nItems = 0),
  5651. (this.walkingSectionPaused = !1);
  5652. }
  5653. var r = e("three"),
  5654. o = e("./util/logger"),
  5655. a = e("./settings"),
  5656. s = e("./util/transitions"),
  5657. l = e("events").EventEmitter,
  5658. c = e("./enum/Viewmode"),
  5659. h = e("./analytics"),
  5660. u = e("./enum/WarpStyle"),
  5661. s = e("./util/transitions"),
  5662. d = (e("./model/ModelManager"), e("./enum/ModelManagerEvents")),
  5663. p = e("./enum/DirectorEvents"),
  5664. f = e("./enum/PlayerEvents"),
  5665. g = (e("./enum/ControlEvents"), e("./enum/BlackoutStyle")),
  5666. m = e("./enum/PathDiscardMode"),
  5667. v = e("./enum/PathDisplayMode"),
  5668. A = (e("./player"), new o(i)),
  5669. y = Object.freeze({
  5670. None: 0,
  5671. Moving: 1,
  5672. Aiming: 2,
  5673. Interlude: 3,
  5674. }),
  5675. C = Object.freeze({
  5676. Forward: 1,
  5677. NoChange: 0,
  5678. Backwards: -1,
  5679. }),
  5680. I = s.getUniqueId();
  5681. (n.prototype = Object.create(l.prototype)),
  5682. (n.prototype.init = function (e, t) {
  5683. (this.player = e),
  5684. (this.modelManager = t),
  5685. this.updateModel(),
  5686. this.resetAll(),
  5687. this.bindEvents();
  5688. // // zeg 查询pano对应的导览片段
  5689. // if(!this.panoIdMap) {
  5690. // this.panoIdMap = new Map()
  5691. // this.model.heroLocations.forEach( (value, index) => {
  5692. // // value.heroLocations.forEach( hl => {
  5693. // if(!value.heroLocations) return
  5694. // let hl = value.heroLocations[0]
  5695. // let arr = this.panoIdMap.get(hl.panoId)
  5696. // if(arr){
  5697. // this.panoIdMap.set(hl.panoId, [...arr, index])
  5698. // } else {
  5699. // this.panoIdMap.set(hl.panoId, [index])
  5700. // }
  5701. // // })
  5702. // })
  5703. // }
  5704. }),
  5705. (n.prototype.resetAll = function () {
  5706. if (
  5707. ((this.currentItem = null),
  5708. (this.destinationItem = null),
  5709. (this.tourIsPlaying = !1),
  5710. //this.bgmReplay(),//xzw
  5711. (this.transitionStage = y.None),
  5712. (this.nextFunc = null),
  5713. (this.onTheBus = !1),
  5714. (this.reachSource = null),
  5715. (this.interrupted = !1),
  5716. this.model)
  5717. ) {
  5718. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  5719. this.defaultWarpStyle =
  5720. this.model.data.hasOwnProperty("player_options") &&
  5721. this.model.data.player_options &&
  5722. this.model.data.player_options.fast_transitions === !1
  5723. ? e
  5724. : u.BLACK;
  5725. } else
  5726. (this.defaultWarpStyle = u.BLACK),
  5727. A.warn(
  5728. 'No model yet, choosing "' +
  5729. this.defaultWarpStyle +
  5730. '" transitions'
  5731. );
  5732. this.resetSpecialTransition();
  5733. }),
  5734. (n.prototype.updateModel = function () {
  5735. (this.model = this.modelManager.getActiveModel()),
  5736. (this.nItems = this.model.heroLocations.length);
  5737. }),
  5738. (n.prototype.bindEvents = function () {
  5739. this.modelManager.on(
  5740. d.ActiveModelChanged,
  5741. this.updateModel.bind(this)
  5742. ),
  5743. this.player.on(
  5744. f.WarpInterruptedWithFlyTo,
  5745. this.checkAndHandleWalkingtourInterruption.bind(this)
  5746. ),
  5747. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  5748. this.player.on(
  5749. f.PanoChosen,
  5750. this.handlePlayerPanoChosen.bind(this)
  5751. ),
  5752. this.player.on(
  5753. f.ModeChanged,
  5754. this.handlePlayerModeChanged.bind(this)
  5755. ),
  5756. this.player.on(
  5757. f.InputStart,
  5758. this.handlePlayerInputStart.bind(this)
  5759. ),
  5760. this.player.on(
  5761. f.FlyingStarted,
  5762. this.handlePlayerFlyingStarted.bind(this)
  5763. ),
  5764. this.player.once(f.Move, function () {
  5765. s.cancelById(I);
  5766. });
  5767. }),
  5768. (n.prototype.checkAndHandleWalkingtourInterruption = function (e) {
  5769. //快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
  5770. return (
  5771. /* e === u.WALK && ( */ this.interrupt(g.NONE),
  5772. this.pauseWalkingSection(),
  5773. this.player.fastForwardActivePanoFlight(),
  5774. !0
  5775. ); /* ) */
  5776. }),
  5777. (n.prototype.handlePlayerMove = function (e) {
  5778. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  5779. this.emit("update.controls");
  5780. }),
  5781. (n.prototype.handlePlayerPanoChosen = function (e, t) {
  5782. this.intermediateState() ||
  5783. e.id === t.id ||
  5784. ((this.onTheBus = !1), this.emit("update.controls"));
  5785. }),
  5786. (n.prototype.handlePlayerModeChanged = function (e, t) {
  5787. this.intermediateState() ||
  5788. e === t ||
  5789. ((this.onTheBus = !1), this.emit("update.controls"));
  5790. }),
  5791. (n.prototype.handlePlayerInputStart = function (e) {
  5792. this.transitionStage === y.Interlude && this.interrupt(g.NONE);
  5793. }),
  5794. (n.prototype.handlePlayerFlyingStarted = function () {
  5795. this.clearWalkingSectionPaused();
  5796. }),
  5797. (n.prototype.describe = function () {
  5798. return {
  5799. nItems: this.nItems,
  5800. currentItem: this.currentItem,
  5801. destinationItem: this.destinationItem,
  5802. tourIsPlaying: this.tourIsPlaying,
  5803. onTheBus: this.onTheBus,
  5804. endlessLoop: this.endlessLoop,
  5805. viewMode: this.player.mode,
  5806. inTransition: this._inTransition(),
  5807. transitionStage: this.transitionStage,
  5808. tourInProgress: this.tourInProgress,
  5809. };
  5810. }),
  5811. (n.prototype._inTransition = function () {
  5812. return (
  5813. this.player.flying ||
  5814. this.player.isWarping() ||
  5815. this.player.isWaitingToWarp() ||
  5816. this.player.mode === c.TRANSITIONING ||
  5817. this.tourIsPlaying
  5818. );
  5819. }),
  5820. (n.prototype.bounceable = function () {
  5821. var e = this.clock.getDelta();
  5822. return (
  5823. this.isInterrupted() ||
  5824. (e < 0.9 && e > 0.01) ||
  5825. (this.player.flying && !this.player.isWarping())
  5826. );
  5827. }),
  5828. (n.prototype.itemCompare = function (item1, item2, type) {
  5829. //add
  5830. if (type == "equal") {
  5831. //==
  5832. return (
  5833. item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  5834. );
  5835. } else if (type == "less") {
  5836. //<
  5837. return (
  5838. (item1 && item2 && item1[0] < item2[0]) ||
  5839. (item1[0] == item2[0] && item1[1] < item2[1])
  5840. );
  5841. }
  5842. });
  5843. (n.prototype.currentMoveDirection = function () {
  5844. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  5845. return null === this.currentItem || void 0 === this.currentItem
  5846. ? y.Forward
  5847. : this.itemCompare(
  5848. this.destinationItem,
  5849. this.currentItem,
  5850. "equal"
  5851. )
  5852. ? y.NoChange
  5853. : this.itemCompare(this.currentItem, this.destinationItem, "less")
  5854. ? y.Forward
  5855. : y.Backwards;
  5856. }),
  5857. (n.prototype.clearPath = function () {
  5858. this._inTransition() || this.player.path.discardPathObject();
  5859. }),
  5860. (n.prototype.allFloors = function () {
  5861. this.model.toggleAllFloors();
  5862. }),
  5863. (n.prototype.actionComplete = function (e) {
  5864. if (
  5865. ((this.interrupted = !1),
  5866. (this.transitionStage = y.None),
  5867. this.resetSpecialTransition(),
  5868. null !== this.destinationItem &&
  5869. this.setCurrentItem(this.destinationItem),
  5870. this.tourIsPlaying ||
  5871. (this.player.disablePreRendering(),
  5872. this.player.mode === c.PANORAMA &&
  5873. this.player.currentPano.isAligned() &&
  5874. this.model.fadePanoMarkers()),
  5875. this.emit("update.controls"),
  5876. this.nextFunc)
  5877. ) {
  5878. var t = this.nextFunc;
  5879. (this.nextFunc = null), t();
  5880. }
  5881. }),
  5882. (n.prototype.awaitCompletion = function (e, t) {
  5883. (this.nextFunc = t), e();
  5884. }),
  5885. (n.prototype.updateSuccessFunction = function (e) {
  5886. this.nextFunc = e;
  5887. }),
  5888. (n.prototype.interrupt = function (e, t) {
  5889. return (
  5890. !!this.wouldInterrupt() &&
  5891. (this.tourIsPlaying &&
  5892. (this.player.zoomEnabled = this.wasZoomEnabled),
  5893. (this.tourIsPlaying = !1),
  5894. //this.bgmReplay(),//xzw
  5895. (this.interrupted = !0),
  5896. (this.nextFunc = null),
  5897. this.emit(p.ActionInterrupted),
  5898. (null !== e && void 0 !== e) || (e = g.BEGINNING),
  5899. this.player.interruptAndFastForward(e, t),
  5900. !0)
  5901. );
  5902. }),
  5903. (n.prototype.wouldInterrupt = function () {
  5904. return this.transitionStage !== y.None;
  5905. }),
  5906. (n.prototype.intermediateState = function () {
  5907. return this.transitionStage !== y.None;
  5908. }),
  5909. (n.prototype.isInterrupted = function () {
  5910. return this.interrupted;
  5911. }),
  5912. (n.prototype.pauseWalkingSection = function () {
  5913. this.walkingSectionPaused = !0;
  5914. }),
  5915. (n.prototype.clearWalkingSectionPaused = function () {
  5916. this.walkingSectionPaused = !1;
  5917. }),
  5918. (n.prototype.autoTour = function () {
  5919. var e = Date.now();
  5920. this.model.auxDataPromise.then(
  5921. function () {
  5922. e = Date.now() - e;
  5923. var t = a.warp.auto,
  5924. i =
  5925. this.model.data &&
  5926. this.model.data
  5927. .player_options; /* && this.model.data.player_options.highlight_reel */
  5928. t >= 0 &&
  5929. this.model.heroCount() > 1 &&
  5930. i &&
  5931. s.trigger({
  5932. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  5933. done: function () {
  5934. this.playTour();
  5935. }.bind(this),
  5936. name: "_atr",
  5937. id: I,
  5938. });
  5939. }.bind(this)
  5940. );
  5941. }),
  5942. (n.prototype.atDestinationPano = function (pano) {
  5943. if (null === this.destinationItem) return !1;
  5944. pano = pano || this.player.currentPano;
  5945. if (!pano) {
  5946. return !1;
  5947. }
  5948. var destination =
  5949. this.destinationItem &&
  5950. this.model.getHeroDescriptorByIndex(this.destinationItem);
  5951. return destination && destination.panoId == pano.id;
  5952. }),
  5953. (n.prototype.redirectToItem = function (e, t) {
  5954. if (null === e || void 0 === e)
  5955. return void A.warn(
  5956. "Director.redirectToItem() -> Redirecting to null item."
  5957. );
  5958. if (!this.wouldInterrupt())
  5959. return void A.warn(
  5960. "Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt."
  5961. );
  5962. if (this.player.mode === c.TRANSITIONING)
  5963. return void A.debug(
  5964. "Director.redirectToItem() -> Cannot redirect while transitioning."
  5965. );
  5966. A.debug(
  5967. "Director.redirectToItem() -> Redirecting to " + e + " via " + t
  5968. );
  5969. var i = function () {
  5970. s.setTimeout(
  5971. function () {
  5972. this.setDestinationItem(e),
  5973. this.goToDestination(
  5974. !0,
  5975. g.BEGINNING,
  5976. a.warp.warpInterruptionRedirectTime,
  5977. !1
  5978. );
  5979. }.bind(this),
  5980. 0
  5981. );
  5982. }.bind(this);
  5983. this.interrupt(g.END, 0), this.updateSuccessFunction(i);
  5984. }),
  5985. (n.prototype.useSpecialTransition = function (e) {
  5986. void 0 !== e &&
  5987. this.defaultWarpStyle !== u.BLACK &&
  5988. A.debug("useSpecialTransition(): " + e),
  5989. (this.nextWarpStyle = u.BLACK);
  5990. }),
  5991. (n.prototype.resetSpecialTransition = function () {
  5992. this.nextWarpStyle = this.defaultWarpStyle;
  5993. }),
  5994. (n.prototype.arrivedAtDestination = function (e) {
  5995. if (this.player.flying || this.player.isWarping())
  5996. A.warn(
  5997. "Cannot advance to interlude or aiming while player is flying or warping."
  5998. );
  5999. else {
  6000. this.transitionStage = y.Aiming;
  6001. var t = this.tourIsPlaying
  6002. ? this.tourInterlude.bind(
  6003. this,
  6004. this.nextItem(this.currentItem)
  6005. )
  6006. : null;
  6007. this.player.model.fadePanoMarkers(0),
  6008. this.awaitCompletion(
  6009. function () {
  6010. this.resetSpecialTransition(),
  6011. e
  6012. ? this.player.aimTourCamera(
  6013. this.destinationItem,
  6014. v.Retain,
  6015. v.Slow,
  6016. this.actionComplete.bind(this)
  6017. )
  6018. : this.actionComplete();
  6019. }.bind(this),
  6020. t
  6021. );
  6022. }
  6023. }),
  6024. (n.prototype.goToDestination = function (e, t, i, n) {
  6025. //音频
  6026. var musicInfo =
  6027. this.model.heroLocations[this.destinationItem[0]].musicInfo;
  6028. // zeg 手动导览不播放音频
  6029. if (musicInfo && musicInfo.music && !e) {
  6030. let musicType = localStorage.getItem("xunirole") || "male";
  6031. let isMale = musicType.indexOf("female") < 0;
  6032. let fixMusic = isMale
  6033. ? musicInfo.music
  6034. : musicInfo.fmusic || musicInfo.music;
  6035. // let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  6036. let src = fixMusic;
  6037. let audioObj = SoundManager.list.find((e) => e.name == "tour");
  6038. let audioSrc1 = common.getFileNameFromUrl(audioObj.src);
  6039. let audioSrc2 = common.getFileNameFromUrl(src);
  6040. if (audioSrc1 == audioSrc2) {
  6041. //应该是继续播放该folder
  6042. if (this.destinationItem[1] == 0) {
  6043. //从头开始播放 因为可能暂停后然后再点该缩略图播
  6044. SoundManager.play("tour", null, 0); // currentTime = 0;
  6045. } else if (
  6046. audioObj.audio.paused &&
  6047. audioObj.audio.currentTime < audioObj.audio.duration
  6048. ) {
  6049. //未播完
  6050. SoundManager.play("tour"); //继续播。为什么会有暂停的情况?如果手动切换到bgm了呢?
  6051. }
  6052. } else {
  6053. //很可能是该folder的起始
  6054. SoundManager.play("tour", manage.dealURL(src));
  6055. }
  6056. }
  6057. let oldPos = this.player.position.clone();
  6058. let oldPano = this.player.currentPano;
  6059. if (
  6060. ((this.onTheBus = !0),
  6061. this.emit("update.controls"),
  6062. this.player.updateLastView(),
  6063. !n && this.atDestinationPano())
  6064. ) {
  6065. /*
  6066. // 原地旋转时, 写到_warpCameraAim里,因那有时间
  6067. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  6068. if(r.zoom && r.zoom != this.player.zoomLevel){//add
  6069. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  6070. } */
  6071. return void this.arrivedAtDestination(!0);
  6072. }
  6073. if (this.player.flying || this.player.isWarping())
  6074. A.warn(
  6075. "Cannot go to new destination while player is flying or warping."
  6076. );
  6077. else {
  6078. var r = this.model.getHeroDescriptorByIndex(
  6079. this.destinationItem
  6080. ),
  6081. o = null,
  6082. a1 = null;
  6083. if (r.isPano()) {
  6084. //var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  6085. //var walk = window.DATA.black ? 'black' : 'walk';
  6086. //若是点击item,直接瞬间过渡。
  6087. var s = e
  6088. ? "black"
  6089. : this.getMomentTour(this.destinationItem); //window.DATA.momentTour || "walk";
  6090. if (
  6091. this.destinationItem[0] == 0 &&
  6092. this.destinationItem[1] == 0
  6093. )
  6094. s = "black"; // 周恩光加 返回最初导览点是瞬间过渡
  6095. (a1 = this.player.warpToPanoByHeroIndex.bind(
  6096. this.player,
  6097. this.destinationItem,
  6098. v.Show,
  6099. m.Slow,
  6100. s,
  6101. true,
  6102. i,
  6103. this.actionComplete.bind(this)
  6104. )),
  6105. (o = this.arrivedAtDestination.bind(this, !0));
  6106. if (
  6107. s == "black" &&
  6108. r.zoom &&
  6109. r.zoom != this.player.zoomLevel
  6110. ) {
  6111. //add
  6112. this.player.smoothZoomFovTo(
  6113. null,
  6114. r.zoom,
  6115. a.warp.teleportTime
  6116. ); //瞬间过渡的时间
  6117. }
  6118. } else {
  6119. (a1 = this.player.warpToNonPanoByHeroIndex.bind(
  6120. this.player,
  6121. this.destinationItem,
  6122. this.actionComplete.bind(this)
  6123. )),
  6124. (o = this.arrivedAtDestination.bind(this, !1));
  6125. }
  6126. (this.transitionStage = y.Moving),
  6127. this.model.fadePanoMarkers(0),
  6128. this.awaitCompletion(
  6129. function () {
  6130. a1();
  6131. }.bind(this),
  6132. o
  6133. ),
  6134. this.emit("update.controls");
  6135. }
  6136. }),
  6137. (n.prototype.tourInterlude = function () {
  6138. if (
  6139. (h.trackAlways("reach_highlight", {
  6140. reach_source: this.reachSource,
  6141. }),
  6142. this.model.fadePanoMarkers(0),
  6143. this.emit("update.controls"),
  6144. this.tourIsPlaying)
  6145. )
  6146. return this.atEndOfTour() && !this.endlessLoop
  6147. ? ((this.tourInProgress = !1),
  6148. void this.awaitCompletion(
  6149. function () {
  6150. (this.transitionStage = y.Interlude),
  6151. this.player.tourInterlude(
  6152. this.nextItem(this.currentItem),
  6153. this.actionComplete.bind(this)
  6154. );
  6155. }.bind(this),
  6156. function () {
  6157. (this.currentItem = [0, 0]),
  6158. this.stopTour(true),
  6159. this.emit(p.TourEnd);
  6160. }.bind(this)
  6161. ),
  6162. void (
  6163. this.player.mode === c.PANORAMA &&
  6164. this.model.fadePanoMarkers(a.panorama.markerOpacity)
  6165. ))
  6166. : void this.awaitCompletion(
  6167. function () {
  6168. (this.transitionStage = y.Interlude),
  6169. this.player.tourInterlude(
  6170. this.nextItem(this.currentItem),
  6171. this.actionComplete.bind(this)
  6172. );
  6173. }.bind(this),
  6174. this.goNext.bind(this)
  6175. );
  6176. }),
  6177. (n.prototype.findNearestItem = function (endToStart = true) {
  6178. //找到离currentPano最近的导览
  6179. /* if(this.atDestinationPano(this.player.currentPano)){//在终点直接从头。但有的场景可能不希望如此,就想跳到所属的展区开始。
  6180. return [0,0] //2023.7.7发现在点击item后播放会从头开始
  6181. } */
  6182. //注:没有判断此刻是否在panorama模式,就使用currentPano
  6183. var result = { item: [0, 0], dis: Infinity };
  6184. var compare = (location, item) => {
  6185. if (location.panoId != void 0 && location.panoId != "outside") {
  6186. var pano = this.model.panos.index[location.panoId];
  6187. var dis = pano.position.distanceTo(
  6188. this.player.currentPano.position
  6189. );
  6190. if (dis < result.dis) {
  6191. (result.item = item), (result.dis = dis);
  6192. } else if (dis == result.dis) {
  6193. //如果两个位置相同,优先播放在导览条上离激活的最近的那段导览
  6194. /* if(this.itemCompare(item, this.currentItem, 'equal')){
  6195. result.item = item, result.dis = dis
  6196. } */
  6197. if (
  6198. this.currentItem &&
  6199. Math.abs(item[0] - this.currentItem[0]) <
  6200. Math.abs(result.item[0] - this.currentItem[0])
  6201. ) {
  6202. (result.item = item), (result.dis = dis);
  6203. }
  6204. }
  6205. }
  6206. };
  6207. this.model.heroLocations.forEach((e, i) => {
  6208. if (e.heroLocations) {
  6209. /* e.heroLocations.forEach((a,j)=>{
  6210. compare(a, [i,j])
  6211. }) */
  6212. var location = e.heroLocations.find(
  6213. (e) => e.panoId != void 0
  6214. );
  6215. location && compare(location, [i, 0]); //跳到此区域开头
  6216. } else {
  6217. compare(e, [i, 0]);
  6218. }
  6219. });
  6220. if (endToStart && this.atEndOfTour(result.item)) {
  6221. //如果是最后一个点,直接跳到开头,否则导览开始就在终点的话不会从头开始
  6222. return [0, 0]; //但注意最后是区域的话result.item是区域开头,除非站在最末最末尾的位置,上面的atDestinationPano直接返回
  6223. }
  6224. return result.item;
  6225. });
  6226. n.prototype.playTour = function () {
  6227. if (!this.bounceable() && this.model.heroLocations.length) {
  6228. // ------------这部分处理逻辑目前已由playTourNearBy()取代------------------------------------
  6229. // if(!this.currentItem) this.currentItem = []
  6230. // if(this.currentItem[0] != 0 || this.destinationItem[0]!= this.nItems-1){
  6231. // // zeg 从当前pano进行自动导览
  6232. // let currentPanoDestinations = this.panoIdMap.get(this.player.currentPano.id)
  6233. // // this.model.heroLocations.forEach( (value, index) => {
  6234. // // if(value.heroLocations.find( hl => hl.panoId == this.player.currentPano.id )) {
  6235. // // currentPanoDestinations.push(index)
  6236. // // }
  6237. // // })
  6238. // if(!currentPanoDestinations) {
  6239. // // let panoIndex = this.model.panos.list.findIndex( pano => pano.id == this.player.currentPano.id )
  6240. // let panoIndex = this.model.panos.list.indexOf( this.player.currentPano )
  6241. // let neighbourIndex = [ panoIndex + 1, panoIndex - 1, panoIndex + 2, panoIndex - 2, panoIndex + 3, panoIndex - 3 ]
  6242. // for(var i = 0; i < neighbourIndex.length; i++) {
  6243. // currentPanoDestinations = this.panoIdMap.get(this.model.panos.list[neighbourIndex[i]]&&this.model.panos.list[neighbourIndex[i]].id)
  6244. // if(currentPanoDestinations && currentPanoDestinations[0] != 0) break
  6245. // }
  6246. // if(!currentPanoDestinations) currentPanoDestinations = [0];
  6247. // }
  6248. // if(currentPanoDestinations.indexOf(this.currentItem[0]) == -1) {
  6249. // this.currentItem[0] = currentPanoDestinations[0]
  6250. // }
  6251. // }
  6252. return this.tourIsPlaying
  6253. ? void A.info("tour is already playing")
  6254. : void (
  6255. this.wouldInterrupt() ||
  6256. (this.player.emit("tour_auto", this.defaultWarpStyle),
  6257. (this.tourInProgress = !0),
  6258. (this.reachSource = "play"),
  6259. (this.tourIsPlaying = !0),
  6260. (this.wasZoomEnabled = this.player.zoomEnabled),
  6261. (this.player.zoomEnabled = !1),
  6262. this.resetSpecialTransition(),
  6263. this.emit("update.controls"),
  6264. this.emit(p.TourStart),
  6265. this.player.enablePreRendering(),
  6266. // this.currentItem[1] = null,
  6267. this.walkingSectionPaused
  6268. ? (this.clearWalkingSectionPaused(),
  6269. this.goToDestination())
  6270. : /* this.goNext() */ (this.tourAdvance(0),
  6271. this.goToDestination()))
  6272. ); //xzw: 不要直接跳到下一个点开始,从当前点开始,否则当一段区域内只有一个导览时播放会立刻跳到下一个缩略图进行。
  6273. }
  6274. };
  6275. (n.prototype.playTourNearBy = function () {
  6276. //就近导览
  6277. if (!this.bounceable()) {
  6278. return this.tourIsPlaying
  6279. ? void A.info("tour is already playing")
  6280. : void (
  6281. this.wouldInterrupt() ||
  6282. (this.player.emit("tour_auto", this.defaultWarpStyle),
  6283. (this.tourInProgress = !0),
  6284. (this.reachSource = "play"),
  6285. (this.tourIsPlaying = !0),
  6286. (this.wasZoomEnabled = this.player.zoomEnabled),
  6287. (this.player.zoomEnabled = !1),
  6288. this.resetSpecialTransition(),
  6289. this.emit("update.controls"),
  6290. this.emit(p.TourStart),
  6291. this.player.enablePreRendering(),
  6292. /* this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  6293. this.goToDestination()) : this.goNext())) */
  6294. this.setDestinationItem(this.findNearestItem()),
  6295. this.goToDestination())
  6296. );
  6297. }
  6298. }),
  6299. /* n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  6300. } */
  6301. (n.prototype.stopTour = function (isAutoStop) {
  6302. //停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  6303. SoundManager.pause("tour"), // zeg 自动导览暂停时同时停止语音
  6304. this.isInterrupted() ||
  6305. (this.transitionStage === y.Moving &&
  6306. this.checkAndHandleWalkingtourInterruption(
  6307. this.nextWarpStyle
  6308. )) ||
  6309. (this.tourIsPlaying &&
  6310. (this.player.zoomEnabled = this.wasZoomEnabled),
  6311. (this.tourIsPlaying = !1),
  6312. this.interrupt(),
  6313. this.clearWalkingSectionPaused(),
  6314. this.resetSpecialTransition(),
  6315. this.emit("update.controls"));
  6316. }),
  6317. (n.prototype.endTourProgress = function () {
  6318. (this.tourInProgress = !1),
  6319. this.emit("update.controls"),
  6320. this.emit(p.TourEnd);
  6321. }),
  6322. (n.prototype.goToHighlight = function (e) {
  6323. if (this.wouldInterrupt())
  6324. this.itemCompare(this.destinationItem, e, "equal")
  6325. ? this.interrupt()
  6326. : this.redirectToItem(e, "goToHighlight");
  6327. else {
  6328. if ((A.debug("<tour.goto " + e + ">"), this.isInterrupted()))
  6329. return;
  6330. this.clearWalkingSectionPaused(),
  6331. this.setDestinationItem(e),
  6332. this.useSpecialTransition("Hilight");
  6333. this.goToDestination(true), //add true
  6334. h.trackAlways("reach_highlight", {
  6335. reach_source: "thumb",
  6336. });
  6337. }
  6338. }),
  6339. (n.prototype.prevHighlight = function () {
  6340. this.bounceable() ||
  6341. (this.player.emit("tour_manual", "prev"),
  6342. this.interrupt(g.BEGINNING) ||
  6343. this.isInterrupted() ||
  6344. (this.clearWalkingSectionPaused(),
  6345. (this.reachSource = "prev"),
  6346. this.goPrev()));
  6347. }),
  6348. (n.prototype.nextHighlight = function () {
  6349. this.bounceable() ||
  6350. (this.player.emit("tour_manual", "next"),
  6351. this.interrupt(g.BEGINNING) ||
  6352. this.isInterrupted() ||
  6353. (this.clearWalkingSectionPaused(),
  6354. (this.reachSource = "next"),
  6355. this.goNext()));
  6356. }),
  6357. (n.prototype.changeMode = function (e) {
  6358. var t = $.Deferred(),
  6359. i = t.resolve.bind(t),
  6360. n = t.reject.bind(t);
  6361. this.emit(p.StartModeChange);
  6362. var r = function () {
  6363. return (
  6364. this.clearWalkingSectionPaused(),
  6365. !!this.wouldInterrupt() && (this.interrupt(), !0)
  6366. );
  6367. }.bind(this);
  6368. if (!r()) {
  6369. switch (e) {
  6370. case c.PANORAMA:
  6371. this.player.mode === c.PANORAMA
  6372. ? this.player.currentPano.isAligned() ||
  6373. this.player.goToLastView(!0).done(i).fail(n)
  6374. : this.player
  6375. .insideMode(this.player.lastInsideView.pano)
  6376. .done(i)
  6377. .fail(n);
  6378. break;
  6379. case c.DOLLHOUSE:
  6380. case c.FLOORPLAN:
  6381. this.player
  6382. .flyToNewMode({
  6383. mode: e,
  6384. })
  6385. .done(i)
  6386. .fail(n);
  6387. break;
  6388. case c.OUTDOOR:
  6389. this.player.model.has360Views &&
  6390. (this.player.mode !== c.PANORAMA ||
  6391. (this.player.mode === c.PANORAMA &&
  6392. this.player.currentPano.isAligned())) &&
  6393. this.player.goToLastView(!1).done(i).fail(n);
  6394. }
  6395. return t.promise();
  6396. }
  6397. }),
  6398. (n.prototype.atEndOfTour = function (
  6399. currentItem = this.currentItem
  6400. ) {
  6401. var end = currentItem && currentItem[0] >= this.nItems - 1;
  6402. if (end) {
  6403. var heroLocations =
  6404. this.model.heroLocations[this.nItems - 1].heroLocations;
  6405. if (heroLocations) {
  6406. end = currentItem[1] >= heroLocations.length - 1;
  6407. }
  6408. }
  6409. return end;
  6410. }),
  6411. (n.prototype.firstDestination = function () {
  6412. //return 0 < this.nItems ? 0 : null
  6413. return 0 < this.nItems ? [0, 0] : null;
  6414. }),
  6415. (n.prototype.finalDestination = function () {
  6416. //return 0 < this.nItems ? this.nItems - 1 : null
  6417. return 0 < this.nItems ? [this.nItems - 1, 0] : null;
  6418. }),
  6419. (n.prototype.goPrev = function () {
  6420. this.tourAdvance(-1);
  6421. }),
  6422. (n.prototype.goNext = function () {
  6423. this.tourAdvance(1);
  6424. }),
  6425. (n.prototype.setDestinationItem = function (e) {
  6426. (this.destinationItem = e), this.emit("update.controls");
  6427. }),
  6428. (n.prototype.setCurrentItem = function (e) {
  6429. (this.currentItem = e), this.emit("update.controls");
  6430. }),
  6431. (n.prototype.nextItem = function (currentItem) {
  6432. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  6433. if (currentItem == void 0) return this.firstDestination();
  6434. var currentLocation = this.model.heroLocations[currentItem[0]];
  6435. var currentChildNum = currentLocation.heroLocations
  6436. ? currentLocation.heroLocations.length
  6437. : 1;
  6438. var item;
  6439. if (this.currentItem[1] >= currentChildNum - 1) {
  6440. //子目录中最后一个
  6441. item = [currentItem[0] + 1, 0]; //结果可能超出nItems
  6442. } else {
  6443. item = [currentItem[0], currentItem[1] + 1];
  6444. }
  6445. if (item[0] >= this.nItems) {
  6446. item = this.firstDestination();
  6447. }
  6448. return item;
  6449. //暂时不理会endlessLoop,默认为false
  6450. }),
  6451. (n.prototype.prevItem = function (currentItem) {
  6452. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  6453. if (currentItem == void 0) return this.firstDestination();
  6454. var item;
  6455. var lastLocation = this.model.heroLocations[currentItem[0] - 1];
  6456. if (!lastLocation)
  6457. return this.finalDestination(); //[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  6458. else {
  6459. var lastChildNum = lastLocation.heroLocations
  6460. ? lastLocation.heroLocations.length
  6461. : 1;
  6462. if (this.currentItem[1] == 0) {
  6463. //子目录中第一个
  6464. return [currentItem[0] - 1, lastChildNum - 1];
  6465. } else {
  6466. return [currentItem[0], currentItem[1] - 1];
  6467. }
  6468. }
  6469. }),
  6470. (n.prototype.tourAdvance = function (e) {
  6471. //e是1或-1 或 0
  6472. A.debug("tourAdvance(" + e + ")");
  6473. // // zeg改
  6474. if (null === this.currentItem || void 0 === this.currentItem) {
  6475. // this.setDestinationItem(this.firstDestination())
  6476. // this.setDestinationItem([currentPanoDestinations[0], 0])
  6477. this.setDestinationItem([this.currentItem[0], 0]);
  6478. }
  6479. // else if(this.currentItem[1] == null) {
  6480. // this.setDestinationItem([this.currentItem[0], 0])
  6481. // }
  6482. else {
  6483. var item = this.currentItem;
  6484. if (e == 1) {
  6485. item = this.nextItem(this.currentItem);
  6486. } else if (e == -1) {
  6487. item = this.prevItem(this.currentItem);
  6488. }
  6489. this.setDestinationItem(item);
  6490. }
  6491. if (
  6492. this.itemCompare(
  6493. this.destinationItem,
  6494. this.finalDestination(),
  6495. "equal"
  6496. )
  6497. ) {
  6498. this.useSpecialTransition("reverse-looping to end");
  6499. } else if (
  6500. this.itemCompare(
  6501. this.destinationItem,
  6502. this.firstDestination(),
  6503. "equal"
  6504. )
  6505. ) {
  6506. this.useSpecialTransition("looping back to start");
  6507. }
  6508. /* var momentTour = this.getMomentTour(this.destinationItem);
  6509. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  6510. var zoomLevel = this.player.zoomLevel;
  6511. this.player.zoomEnabled = true;
  6512. var zoom = function(e, d) {
  6513. this.player.zoomTo((1-e)*zoomLevel, true)
  6514. }.bind(this)
  6515. s.start(zoom, 1500, function(){
  6516. }, 0, d.easeOutQuad, "zoom")
  6517. } */
  6518. this.goToDestination();
  6519. }),
  6520. (n.prototype.getMomentTour = function (destinationItem) {
  6521. //add
  6522. var wholeMomentTour = window.DATA.momentTour || "walk"; //最外层 还有一种是'std'
  6523. if (!destinationItem) return wholeMomentTour;
  6524. else {
  6525. var currentLocation =
  6526. this.model.getHeroDescriptorByIndex(destinationItem); //最内层。 如果有使用最内层
  6527. if (currentLocation.momentTour)
  6528. return currentLocation.momentTour;
  6529. var currentLocation_ =
  6530. this.model.heroLocations[destinationItem[0]];
  6531. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  6532. }
  6533. }),
  6534. (t.exports = n);
  6535. }).call(this, "/js/director.js");
  6536. },
  6537. {
  6538. "./analytics": 4,
  6539. "./enum/BlackoutStyle": 18,
  6540. "./enum/ControlEvents": 21,
  6541. "./enum/DirectorEvents": 23,
  6542. "./enum/ModelManagerEvents": 33,
  6543. "./enum/PathDiscardMode": 38,
  6544. "./enum/PathDisplayMode": 39,
  6545. "./enum/PlayerEvents": 40,
  6546. "./enum/Viewmode": 51,
  6547. "./enum/WarpStyle": 52,
  6548. "./model/ModelManager": 140,
  6549. "./player": 155,
  6550. "./settings": 166,
  6551. "./util/logger": 189,
  6552. "./util/transitions": 195,
  6553. events: 202,
  6554. three: 217,
  6555. },
  6556. ],
  6557. 16: [
  6558. function (e, t, i) {
  6559. "use strict";
  6560. var n = e("three"),
  6561. r = e("./enum/Viewmode"),
  6562. o = (e("./settings"), e("./util/transitions")),
  6563. a = e("./enum/PlayerEvents"),
  6564. s = new n.ShaderPass(n.HorizontalBlurShader),
  6565. l = new n.ShaderPass(n.VerticalBlurShader);
  6566. l.renderToScreen = !0;
  6567. var c = $("#player").width() / $("#player").height();
  6568. isNaN(c) && (c = 1);
  6569. //initTransitionPass(n)
  6570. var h = {
  6571. currentBlur: 0,
  6572. aspect: c,
  6573. blurStrength: 1,
  6574. hblurPass: s,
  6575. vblurPass: l,
  6576. transitionMaskPass: new n.TransitionPass(),
  6577. bindEvents: function (e) {
  6578. e.on(a.ModeChanged, function (e, t) {
  6579. e === r.PANORAMA &&
  6580. (o.cancel(h.blur),
  6581. o.cancel(h.addBlur),
  6582. o.start(h.removeBlur, 500, null, 0, null, "deblur"));
  6583. });
  6584. },
  6585. blur: function (e) {
  6586. h.currentBlur = e;
  6587. var t = e * h.blurStrength;
  6588. (l.uniforms.v.value = (t / 512) * h.aspect),
  6589. (s.uniforms.h.value = t / 512);
  6590. },
  6591. addBlur: function (e) {
  6592. (e = Math.max(e, h.currentBlur)), h.blur(e);
  6593. },
  6594. removeBlur: function (e) {
  6595. (e = Math.min(1 - e, h.currentBlur)), h.blur(e);
  6596. },
  6597. };
  6598. h.blur(0), (t.exports = h);
  6599. },
  6600. {
  6601. "./enum/PlayerEvents": 40,
  6602. "./enum/Viewmode": 51,
  6603. "./settings": 166,
  6604. "./util/transitions": 195,
  6605. three: 217,
  6606. },
  6607. ],
  6608. 17: [
  6609. function (e, t, i) {
  6610. "use strict";
  6611. t.exports = {
  6612. UNKNOWN: 0,
  6613. ALIGNED: 1,
  6614. UNALIGNED: 2,
  6615. PLACED: 3,
  6616. };
  6617. },
  6618. {},
  6619. ],
  6620. 18: [
  6621. function (e, t, i) {
  6622. "use strict";
  6623. t.exports = {
  6624. NONE: 0,
  6625. MIDDLE: 1,
  6626. END: 2,
  6627. BEGINNING: 3,
  6628. FADEIN: 4,
  6629. };
  6630. },
  6631. {},
  6632. ],
  6633. 19: [
  6634. function (e, t, i) {
  6635. "use strict";
  6636. var n = e("three");
  6637. t.exports = {
  6638. newBlue: new n.Color(4967932),
  6639. altBlue: new n.Color(47355),
  6640. tagDefault: new n.Color(223357),
  6641. classicBlue: new n.Color(53759),
  6642. mpYellow: new n.Color(16502016),
  6643. mpOrange: new n.Color(16428055),
  6644. mpBlue: new n.Color(12096),
  6645. mpLtGrey: new n.Color(13751252),
  6646. mpDkGrey: new n.Color(10000019),
  6647. mpRed: new n.Color(12525854),
  6648. mpOrangeDesat: new n.Color(16764529),
  6649. mpBlueDesat: new n.Color(4034734),
  6650. mpRedDesat: new n.Color(14705505),
  6651. white: new n.Color(16777215),
  6652. black: new n.Color(0),
  6653. _desat: function (e, t) {
  6654. var i = t || 0.3,
  6655. r = new n.Color().copy(e).getHSL();
  6656. return new n.Color().setHSL(r.h, r.s * (1 - i), r.l);
  6657. },
  6658. _darken: function (e, t) {
  6659. var i = t || 0.2,
  6660. r = e.getHSL();
  6661. return new n.Color().setHSL(r.h, r.s, r.l * (1 - i));
  6662. },
  6663. };
  6664. },
  6665. {
  6666. three: 217,
  6667. },
  6668. ],
  6669. 20: [
  6670. function (e, t, i) {
  6671. "use strict";
  6672. t.exports = {
  6673. NONE: -1,
  6674. ROTATE: 0,
  6675. DOLLY: 1,
  6676. PAN: 2,
  6677. ROTATE_DOLLY: 3,
  6678. PAN_DOLLY: 4,
  6679. };
  6680. },
  6681. {},
  6682. ],
  6683. 21: [
  6684. function (e, t, i) {
  6685. "use strict";
  6686. t.exports = {
  6687. Move: "move",
  6688. InteractionDirect: "interaction.direct",
  6689. InteractionKey: "interaction.key",
  6690. InteractionGui: "interaction.gui",
  6691. FlyInDirection: "fly.direction",
  6692. InputStart: "input.start",
  6693. Pinch: "input.pinch",
  6694. Scroll: "input.scroll",
  6695. AutoPanInterrupt: "autopan.interrupt",
  6696. AutoPanComplete: "autopan.complete",
  6697. AutoPanClamped: "autopan.clamped",
  6698. LongTap: "longtap",
  6699. };
  6700. },
  6701. {},
  6702. ],
  6703. 22: [
  6704. function (e, t, i) {
  6705. "use strict";
  6706. t.exports = Object.freeze({
  6707. FORWARD: "FORWARD",
  6708. LEFT: "LEFT",
  6709. RIGHT: "RIGHT",
  6710. BACK: "BACK",
  6711. UP: "UP",
  6712. DOWN: "DOWN",
  6713. });
  6714. },
  6715. {},
  6716. ],
  6717. 23: [
  6718. function (e, t, i) {
  6719. "use strict";
  6720. t.exports = {
  6721. ActionInterrupted: "action.interrupted",
  6722. TourStart: "tour.start",
  6723. TourEnd: "tour.end",
  6724. StartModeChange: "mode.startChange",
  6725. };
  6726. },
  6727. {},
  6728. ],
  6729. 24: [
  6730. function (e, t, i) {
  6731. "use strict";
  6732. t.exports = Object.freeze({
  6733. None: 0,
  6734. Queued: 1,
  6735. ForceQueued: 2,
  6736. Downloading: 3,
  6737. Downloaded: 4,
  6738. DownloadFailed: 5,
  6739. });
  6740. },
  6741. {},
  6742. ],
  6743. 25: [
  6744. function (e, t, i) {
  6745. "use strict";
  6746. t.exports = {
  6747. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  6748. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  6749. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  6750. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  6751. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  6752. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5,
  6753. };
  6754. },
  6755. {},
  6756. ],
  6757. 26: [
  6758. function (e, t, i) {
  6759. "use strict";
  6760. t.exports = {
  6761. Texture2D: 0,
  6762. TextureCube: 1,
  6763. };
  6764. },
  6765. {},
  6766. ],
  6767. 27: [
  6768. function (e, t, i) {
  6769. "use strict";
  6770. t.exports = {
  6771. SMALL: "small",
  6772. LARGE: "large",
  6773. };
  6774. },
  6775. {},
  6776. ],
  6777. 28: [
  6778. function (e, t, i) {
  6779. "use strict";
  6780. var n = e("./Viewmode"),
  6781. r = {
  6782. LANDING: {},
  6783. NAVIGATION: "navigation",
  6784. MORE_HELP: "moreHelp",
  6785. TOUR_INTERACTION: {},
  6786. };
  6787. (r.LANDING[n.PANORAMA] = "panorama.landing"),
  6788. (r.LANDING[n.OUTDOOR] = "outdoor.landing"),
  6789. (r.LANDING[n.DOLLHOUSE] = "dollhouse.landing"),
  6790. (r.LANDING[n.FLOORPLAN] = "floorplan.landing"),
  6791. (r.TOUR_INTERACTION.standard = "standard.tour"),
  6792. (r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour"),
  6793. (r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour"),
  6794. (t.exports = r);
  6795. },
  6796. {
  6797. "./Viewmode": 51,
  6798. },
  6799. ],
  6800. 29: [
  6801. function (e, t, i) {
  6802. "use strict";
  6803. var n = {
  6804. UP: 1,
  6805. DOWN: -1,
  6806. LEFT: "L",
  6807. RIGHT: "R",
  6808. FORWARD: "F",
  6809. BACK: "B",
  6810. reverse: {},
  6811. opposite: function (e) {
  6812. return this.reverse[e.toString()];
  6813. },
  6814. };
  6815. !(function () {
  6816. (n.reverse[n.UP] = n.DOWN),
  6817. (n.reverse[n.DOWN] = n.UP),
  6818. (n.reverse[n.LEFT] = n.RIGHT),
  6819. (n.reverse[n.RIGHT] = n.LEFT),
  6820. (n.reverse[n.FORWARD] = n.BACK),
  6821. (n.reverse[n.BACK] = n.FORWARD);
  6822. })(),
  6823. (t.exports = n);
  6824. },
  6825. {},
  6826. ],
  6827. 30: [
  6828. function (e, t, i) {
  6829. "use strict";
  6830. var n = e("../util/browser"),
  6831. r = {
  6832. ZERO: 48,
  6833. ONE: 49,
  6834. TWO: 50,
  6835. THREE: 51,
  6836. FOUR: 52,
  6837. FIVE: 53,
  6838. SIX: 54,
  6839. SEVEN: 55,
  6840. EIGHT: 56,
  6841. NINE: 57,
  6842. LEFTARROW: 37,
  6843. UPARROW: 38,
  6844. RIGHTARROW: 39,
  6845. DOWNARROW: 40,
  6846. A: 65,
  6847. B: 66,
  6848. C: 67,
  6849. D: 68,
  6850. E: 69,
  6851. F: 70,
  6852. G: 71,
  6853. H: 72,
  6854. I: 73,
  6855. J: 74,
  6856. K: 75,
  6857. L: 76,
  6858. M: 77,
  6859. N: 78,
  6860. O: 79,
  6861. P: 80,
  6862. Q: 81,
  6863. R: 82,
  6864. S: 83,
  6865. T: 84,
  6866. U: 85,
  6867. V: 86,
  6868. W: 87,
  6869. X: 88,
  6870. Y: 89,
  6871. Z: 90,
  6872. SPACE: 32,
  6873. RETURN: 13,
  6874. SEMICOLON: 186,
  6875. PLUSEQUALS: 187,
  6876. DASHUNDERSCORE: 189,
  6877. OPENBRACKET: 219,
  6878. };
  6879. n.detectFirefox() &&
  6880. ((r.SEMICOLON = 59), (r.PLUSEQUALS = 61), (r.DASHUNDERSCORE = 173)),
  6881. (t.exports = r);
  6882. },
  6883. {
  6884. "../util/browser": 182,
  6885. },
  6886. ],
  6887. 31: [
  6888. function (e, t, i) {
  6889. "use strict";
  6890. t.exports = {
  6891. EN_US: "en-US",
  6892. ES_MX: "es-MX",
  6893. FR_FR: "fr-FR",
  6894. DE_DE: "de-DE",
  6895. RU_RU: "ru-RU",
  6896. CN_CN: "cn-CN",
  6897. JP_JP: "jp-JP",
  6898. };
  6899. },
  6900. {},
  6901. ],
  6902. 32: [
  6903. function (e, t, i) {
  6904. "use strict";
  6905. t.exports = {
  6906. TagActivated: "tag.activated",
  6907. TagDismissed: "tag.dismissed",
  6908. TagNavigation: "tag.navigation",
  6909. };
  6910. },
  6911. {},
  6912. ],
  6913. 33: [
  6914. function (e, t, i) {
  6915. "use strict";
  6916. t.exports = {
  6917. ModelAdded: "model-added",
  6918. ActiveModelChanged: "active-model-changed",
  6919. };
  6920. },
  6921. {},
  6922. ],
  6923. 34: [
  6924. function (e, t, i) {
  6925. "use strict";
  6926. t.exports = {
  6927. LEFT: 0,
  6928. MIDDLE: 1,
  6929. RIGHT: 2,
  6930. };
  6931. },
  6932. {},
  6933. ],
  6934. 35: [
  6935. function (e, t, i) {
  6936. "use strict";
  6937. t.exports = {
  6938. PanoRenderComplete: "panorama.render.complete",
  6939. TileRenderFailure: "panorama.tile.render.failed",
  6940. TileRenderSuccess: "panorama.tile.render.success",
  6941. TileUploadAttempted: "panorama.tile.upload.attempted",
  6942. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  6943. ZoomLevelRenderStarted: "panorama.zoom.render.started",
  6944. };
  6945. },
  6946. {},
  6947. ],
  6948. 36: [
  6949. function (e, t, i) {
  6950. "use strict";
  6951. t.exports = {
  6952. BASE: 1,
  6953. STANDARD: 2,
  6954. HIGH: 3,
  6955. ULTRAHIGH: 4,
  6956. };
  6957. },
  6958. {},
  6959. ],
  6960. 37: [
  6961. function (e, t, i) {
  6962. "use strict";
  6963. t.exports = {
  6964. LoadComplete: "panorama.load.complete",
  6965. LoadFailed: "panorama.load.failed",
  6966. TileLoaded: "panorama.tile.loaded",
  6967. };
  6968. },
  6969. {},
  6970. ],
  6971. 38: [
  6972. function (e, t, i) {
  6973. "use strict";
  6974. t.exports = Object.freeze({
  6975. Standard: 0,
  6976. Slow: 1,
  6977. Retain: 2,
  6978. });
  6979. },
  6980. {},
  6981. ],
  6982. 39: [
  6983. function (e, t, i) {
  6984. "use strict";
  6985. t.exports = Object.freeze({
  6986. Show: 0,
  6987. Hide: 1,
  6988. Retain: 2,
  6989. });
  6990. },
  6991. {},
  6992. ],
  6993. 40: [
  6994. function (e, t, i) {
  6995. "use strict";
  6996. t.exports = {
  6997. Move: "move",
  6998. MoveComplete: "move.complete",
  6999. ModeChanged: "mode.changed",
  7000. ModeChanging: "mode.changing",
  7001. PanoChosen: "pano.chosen",
  7002. ClosestPanoChanging: "closest.pano.changing",
  7003. WarpStarted: "warp.started",
  7004. WarpInterrupted: "warp.interrupted",
  7005. WarpEnded: "warp.ended",
  7006. FlyinFinished: "flyin.finished",
  7007. FlyingStarted: "flying.started",
  7008. FlyingInterrupted: "flying.interrupted",
  7009. FlyingEnded: "flying.ended",
  7010. Ready: "ready",
  7011. StartInside: "start.inside",
  7012. StartOutside: "start.outside",
  7013. ViewChanged: "view.changed",
  7014. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  7015. InputStart: "input.start",
  7016. };
  7017. },
  7018. {},
  7019. ],
  7020. 41: [
  7021. function (e, t, i) {
  7022. "use strict";
  7023. t.exports = Object.freeze({
  7024. DEFAULT: 0,
  7025. PANOMARKERS: 1,
  7026. RETICULE: 2,
  7027. TAG: 3,
  7028. });
  7029. },
  7030. {},
  7031. ],
  7032. 42: [
  7033. function (e, t, i) {
  7034. "use strict";
  7035. t.exports = {
  7036. visibleFloor: 1,
  7037. ghostFloor: 3,
  7038. boundingSkybox: 1,
  7039. panoMarker: 2,
  7040. reticule: 3,
  7041. tagStem: 4,
  7042. tagDisc: 5,
  7043. ribbon: 100,
  7044. };
  7045. },
  7046. {},
  7047. ],
  7048. 43: [
  7049. function (e, t, i) {
  7050. "use strict";
  7051. t.exports = {
  7052. ContextCreated: "scene-renderer-context-created",
  7053. AfterRender: "after-render",
  7054. MemoryUsageUpdated: "scene-renderer-memory-usage-updated",
  7055. };
  7056. },
  7057. {},
  7058. ],
  7059. 44: [
  7060. function (e, t, i) {
  7061. "use strict";
  7062. t.exports = {
  7063. IDLE: "idle",
  7064. BROWSE: "browse",
  7065. EXAMINE: "examine",
  7066. };
  7067. },
  7068. {},
  7069. ],
  7070. 45: [
  7071. function (e, t, i) {
  7072. "use strict";
  7073. t.exports = {
  7074. TileDownloadSuccess: "tiledownloader.download.success",
  7075. TileDownloadFailure: "tiledownloader.download.failure",
  7076. PanoDownloadComplete: "tiledownloader.pano.download.complete",
  7077. };
  7078. },
  7079. {},
  7080. ],
  7081. 46: [
  7082. function (e, t, i) {
  7083. "use strict";
  7084. t.exports = {
  7085. CardboardAndroid: "googlevr",
  7086. GearVR: "gearvr",
  7087. CardboardIOS: "googlevrios",
  7088. Cardboard: "googlevr",
  7089. };
  7090. },
  7091. {},
  7092. ],
  7093. 47: [
  7094. function (e, t, i) {
  7095. "use strict";
  7096. t.exports = {
  7097. NONE: 0,
  7098. CONTEXTUAL: 1,
  7099. ANDROID: 2,
  7100. };
  7101. },
  7102. {},
  7103. ],
  7104. 48: [
  7105. function (e, t, i) {
  7106. "use strict";
  7107. var n = {
  7108. Title: 0,
  7109. Cardboard: 1,
  7110. },
  7111. r = {
  7112. Title: 0,
  7113. Cardboard: 1,
  7114. Gear: 2,
  7115. };
  7116. !(function () {
  7117. [n, r].forEach(function (e) {
  7118. e.pageCount = Object.keys(e).length;
  7119. });
  7120. })(),
  7121. (t.exports.ios = n),
  7122. (t.exports.standard = r);
  7123. },
  7124. {},
  7125. ],
  7126. 49: [
  7127. function (e, t, i) {
  7128. "use strict";
  7129. t.exports = {
  7130. Android: "android",
  7131. IOS: "ios",
  7132. Desktop: "desktop",
  7133. UnsupportedAndroid: "android-unsupported",
  7134. };
  7135. },
  7136. {},
  7137. ],
  7138. 50: [
  7139. function (e, t, i) {
  7140. "use strict";
  7141. var n = e("three");
  7142. t.exports = {
  7143. UP: new n.Vector3(0, 1, 0),
  7144. DOWN: new n.Vector3(0, -1, 0),
  7145. LEFT: new n.Vector3(-1, 0, 0),
  7146. RIGHT: new n.Vector3(1, 0, 0),
  7147. FORWARD: new n.Vector3(0, 0, -1),
  7148. BACK: new n.Vector3(0, 0, 1),
  7149. };
  7150. },
  7151. {
  7152. three: 217,
  7153. },
  7154. ],
  7155. 51: [
  7156. function (e, t, i) {
  7157. "use strict";
  7158. var n = e("../exception/ViewmodeConvertException"),
  7159. r = e("./coreViewmodes"),
  7160. o = e("../util/common"),
  7161. a = {
  7162. MESH: "mesh",
  7163. OUTDOOR: "outdoor",
  7164. TRANSITIONING: "transitioning",
  7165. toInt: function (e) {
  7166. switch (e) {
  7167. case this.PANORAMA:
  7168. return 1;
  7169. case this.DOLLHOUSE:
  7170. return 2;
  7171. case this.FLOORPLAN:
  7172. return 3;
  7173. case this.OUTDOOR:
  7174. return 4;
  7175. case this.TRANSITIONING:
  7176. return -1;
  7177. }
  7178. throw new n(
  7179. "No known conversion for Viewmode to int for mode: " + e
  7180. );
  7181. },
  7182. fromInt: function (e) {
  7183. switch (e) {
  7184. case "1":
  7185. case 1:
  7186. return this.PANORAMA;
  7187. case "2":
  7188. case 2:
  7189. return this.DOLLHOUSE;
  7190. case "3":
  7191. case 3:
  7192. return this.FLOORPLAN;
  7193. case "4":
  7194. case 4:
  7195. return this.OUTDOOR;
  7196. }
  7197. throw new n(
  7198. "No known conversion for int to viewmode for int: " + e
  7199. );
  7200. },
  7201. convertWorkshopModeInt: function (e) {
  7202. switch (e) {
  7203. case "0":
  7204. case 0:
  7205. case undefined: //xzw add
  7206. return this.PANORAMA;
  7207. case "1":
  7208. case 1:
  7209. return this.FLOORPLAN;
  7210. case "2":
  7211. case 2:
  7212. return this.DOLLHOUSE;
  7213. case "3":
  7214. case 3:
  7215. return this.MESH;
  7216. }
  7217. throw new n(
  7218. "No known conversion for Workshop int to viewmode for int: " + e
  7219. );
  7220. },
  7221. };
  7222. o.extendObject(a, r), (t.exports = a);
  7223. },
  7224. {
  7225. "../exception/ViewmodeConvertException": 58,
  7226. "../util/common": 185,
  7227. "./coreViewmodes": 54,
  7228. },
  7229. ],
  7230. 52: [
  7231. function (e, t, i) {
  7232. "use strict";
  7233. t.exports = {
  7234. BLACK: "black",
  7235. STD: "std",
  7236. WALK: "walk",
  7237. };
  7238. },
  7239. {},
  7240. ],
  7241. 53: [
  7242. function (e, t, i) {
  7243. "use strict";
  7244. t.exports = {
  7245. ZoomIn: "zoom.in",
  7246. ZoomOut: "zoom.out",
  7247. ZoomMax: "zoom.max",
  7248. ZoomMin: "zoom.min",
  7249. };
  7250. },
  7251. {},
  7252. ],
  7253. 54: [
  7254. function (e, t, i) {
  7255. "use strict";
  7256. t.exports = {
  7257. PANORAMA: "panorama",
  7258. DOLLHOUSE: "dollhouse",
  7259. FLOORPLAN: "floorplan",
  7260. };
  7261. },
  7262. {},
  7263. ],
  7264. 55: [
  7265. function (e, t, i) {
  7266. "use strict";
  7267. function n(e) {
  7268. this.message = e;
  7269. }
  7270. t.exports = n;
  7271. },
  7272. {},
  7273. ],
  7274. 56: [
  7275. function (e, t, i) {
  7276. "use strict";
  7277. function n(e) {
  7278. r.call(this, e);
  7279. }
  7280. var r = e("./BasicException");
  7281. (n.prototype = Object.create(r.prototype)), (t.exports = n);
  7282. },
  7283. {
  7284. "./BasicException": 55,
  7285. },
  7286. ],
  7287. 57: [
  7288. function (e, t, i) {
  7289. "use strict";
  7290. function n(e) {
  7291. r.call(this, e);
  7292. }
  7293. var r = e("./BasicException");
  7294. (n.prototype = Object.create(r.prototype)), (t.exports = n);
  7295. },
  7296. {
  7297. "./BasicException": 55,
  7298. },
  7299. ],
  7300. 58: [
  7301. function (e, t, i) {
  7302. "use strict";
  7303. function n(e) {
  7304. r.call(this, e);
  7305. }
  7306. var r = e("./BasicException");
  7307. (n.prototype = Object.create(r.prototype)), (t.exports = n);
  7308. },
  7309. {
  7310. "./BasicException": 55,
  7311. },
  7312. ],
  7313. 59: [
  7314. function (e, t, i) {
  7315. (function (i) {
  7316. "use strict";
  7317. function n(e) {
  7318. var t = {};
  7319. if (e) {
  7320. var i = e.flags;
  7321. if (i) for (var n in i) i.hasOwnProperty(n) && (t[i[n]] = !0);
  7322. return t;
  7323. }
  7324. return (
  7325. l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  7326. null
  7327. );
  7328. }
  7329. var r = e("./util/ajax"),
  7330. o = e("./util/showcase"),
  7331. a = e("./util/logger"),
  7332. s = "",
  7333. l = new a(i),
  7334. c = {};
  7335. t.exports = {
  7336. loadFeatureFlags: function (e) {
  7337. var t = $.Deferred();
  7338. return (
  7339. r
  7340. .get(e.urlBase + s, {
  7341. responseType: "json",
  7342. prefetchFrom: "user",
  7343. auth: o.getAuthorizationHeader(),
  7344. })
  7345. .done(function (e) {
  7346. (c = n(e)), c ? t.resolve(c) : t.reject("loading-failed");
  7347. })
  7348. .fail(function () {
  7349. l.debug("Retrieval of feature flags failed."),
  7350. t.reject("loading-failed");
  7351. }),
  7352. t.promise()
  7353. );
  7354. },
  7355. getFlags: function () {
  7356. return c;
  7357. },
  7358. updateDependentSettings: function (e, t) {
  7359. (e = e || c),
  7360. e.labels && (t.labels.enabled = !0),
  7361. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  7362. e.showcase_sdk && (t.sdkInit = !0),
  7363. e.mobile_highq_override &&
  7364. (t.tiling.mobileHighQualityOverride = !0),
  7365. e.showcase_webvr && (t.vr.allowWebVR = !0),
  7366. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  7367. e.hide_sc_sharing && (t.share.enabled = !1);
  7368. },
  7369. };
  7370. }).call(this, "/js/featureflags.js");
  7371. },
  7372. {
  7373. "./util/ajax": 181,
  7374. "./util/logger": 189,
  7375. "./util/showcase": 193,
  7376. },
  7377. ],
  7378. 60: [
  7379. function (e, t, i) {
  7380. "use strict";
  7381. var n =
  7382. (e("../util/common"),
  7383. {
  7384. status: 0,
  7385. set: function (e) {
  7386. if (isNaN(e)) return !1;
  7387. var t = $(".progressbar");
  7388. 0 > e && (e = 0);
  7389. e > 100 && (e = 100);
  7390. var width = parseInt(t.css("width").replace("px", "")) / 100; //获取进度条总长度除以100
  7391. var barperc = e * width;
  7392. var perc = Math.round(e);
  7393. var labelpos = parseInt(barperc) - 15;
  7394. t.find(".bar").css("width", barperc); //已经再跑颜色的百分比
  7395. t.find(".label").css("left", labelpos); //上面跟着的字的百分比
  7396. t.find(".perc").text(perc + "%"); //具体数字的百分比
  7397. this.status = e;
  7398. },
  7399. done: function (e) {
  7400. return e || this.status
  7401. ? ((this.status = null), this.set(100))
  7402. : this;
  7403. },
  7404. });
  7405. t.exports.circleLoader = n;
  7406. },
  7407. {
  7408. "../util/common": 185,
  7409. },
  7410. ],
  7411. 61: [
  7412. function (e, t, i) {
  7413. "use strict";
  7414. t.exports = Object.freeze({
  7415. CLOSE: "modal.closer.close",
  7416. });
  7417. },
  7418. {},
  7419. ],
  7420. 62: [
  7421. function (e, t, i) {
  7422. "use strict";
  7423. function n(e, t) {
  7424. t && (t.stopPropagation(), t.preventDefault()),
  7425. e && this.emit(l.CLOSE, e),
  7426. g.reset();
  7427. }
  7428. function r(e, t) {
  7429. function i() {
  7430. var t =
  7431. e.offsetHeight >= $("#player").height() &&
  7432. e.offsetWidth >= $("#player").width();
  7433. t !== f &&
  7434. ((f = t),
  7435. t
  7436. ? (e.classList.add("closeByFooter"),
  7437. h.classList.add("closeByFooter"))
  7438. : (e.classList.remove("closeByFooter"),
  7439. h.classList.remove("closeByFooter")));
  7440. }
  7441. t ? setTimeout(i, o.guiAnimationSpeed) : i();
  7442. }
  7443. var o = e("../../settings"),
  7444. a = (e("../../tag/Media/MediaEvent"), e("../../util/browser")),
  7445. s = e("../../util/common"),
  7446. l = e("./ModalCloserEvent"),
  7447. c = e("events").EventEmitter,
  7448. h = document.getElementsByClassName("footer")[0],
  7449. u = h.querySelectorAll(".close")[0],
  7450. d = null,
  7451. p = null,
  7452. f = null,
  7453. g =
  7454. (a.isMobile(),
  7455. {
  7456. open: function (e) {
  7457. e &&
  7458. (r(e),
  7459. d && u.removeEventListener("click", d, !0),
  7460. (d = n.bind(this, e.id)),
  7461. u.addEventListener("click", d, !0),
  7462. p && window.removeEventListener("resize", p, !0),
  7463. (p = r.bind(this, e)),
  7464. window.addEventListener("resize", p, !0));
  7465. },
  7466. reset: function () {
  7467. h.classList.remove("closeByFooter"),
  7468. u.removeEventListener("click", d, !0),
  7469. window.removeEventListener("resize", p, !0),
  7470. (d = p = f = null);
  7471. },
  7472. });
  7473. s.extendObject(g, c.prototype), (t.exports = g);
  7474. },
  7475. {
  7476. "../../tag/Media/MediaEvent": 131,
  7477. "../../settings": 166,
  7478. "../../util/browser": 182,
  7479. "../../util/common": 185,
  7480. "./ModalCloserEvent": 61,
  7481. events: 202,
  7482. },
  7483. ],
  7484. 63: [
  7485. function (e, t, i) {
  7486. "use strict";
  7487. function n(e, t, i) {
  7488. var n = new r.GUI({
  7489. width: 400,
  7490. }),
  7491. u = n.addFolder("Flydown from Dollhouse");
  7492. u.add(h.flydown, "movementEasing", Object.keys(a)),
  7493. u.add(h.flydown, "movementDelay", 0, 1).step(0.01),
  7494. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  7495. u.add(h.flydown, "rotationDelay", 0, 1).step(0.01),
  7496. u.add(h.flydown, "modelTextureDelay", 0, 1).step(0.01),
  7497. u.add(h.flydown, "skyboxDelay", 0, 1).step(0.01),
  7498. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  7499. u.add(
  7500. h.dollhouseDefault,
  7501. "maxPolarAngle",
  7502. o.Math.degToRad(50),
  7503. o.Math.degToRad(170)
  7504. );
  7505. var d = n.addFolder("Transition between panos");
  7506. d.add(h.transition, "blur", 0, 10).onFinishChange(function () {}),
  7507. d
  7508. .add(h.transition, "flySpeed", 0, 10)
  7509. .step(0.01)
  7510. .onFinishChange(function () {
  7511. (h.transition.flyTime = 0),
  7512. d.__controllers.forEach(function (e) {
  7513. e.updateDisplay();
  7514. });
  7515. }),
  7516. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function () {
  7517. (h.transition.flySpeed = 0),
  7518. d.__controllers.forEach(function (e) {
  7519. e.updateDisplay();
  7520. });
  7521. }),
  7522. d.add(h.transition, "aimTime", 500, 2500).step(50),
  7523. d.add(h.transition, "aimSlowFactor", 1, 3).step(0.1),
  7524. d.add(h.transition, "movementEasing", Object.keys(a));
  7525. var p = n.addFolder("Path Display");
  7526. p
  7527. .add(h.path, "opacity", 0, 1)
  7528. .step(0.01)
  7529. .onFinishChange(function () {}),
  7530. p
  7531. .add(h.path, "height", 0, 0.2)
  7532. .step(0.01)
  7533. .onFinishChange(function () {}),
  7534. p
  7535. .add(h.path, "outsideHeight", 0, 2)
  7536. .step(0.01)
  7537. .onFinishChange(function () {}),
  7538. p
  7539. .add(h.path, "ribbonWidth", 0.01, 0.35)
  7540. .step(0.01)
  7541. .onFinishChange(function () {}),
  7542. p
  7543. .add(h.path, "waypointRadius", 0.01, 1.2)
  7544. .step(0.01)
  7545. .onFinishChange(function () {}),
  7546. p
  7547. .add(h.path, "waypointPulse", 0, 3600)
  7548. .step(20)
  7549. .onFinishChange(function () {}),
  7550. p
  7551. .add(h.path, "waypointIndoorRadius", 0.01, 1.2)
  7552. .step(0.01)
  7553. .onFinishChange(function () {}),
  7554. p
  7555. .add(h.path, "fadeInTime", 0, 1200)
  7556. .step(10)
  7557. .onFinishChange(function () {}),
  7558. p
  7559. .add(h.path, "fadeOutTime", 0, 1200)
  7560. .step(10)
  7561. .onFinishChange(function () {}),
  7562. p.add(h.path, "color", Object.keys(l)).onFinishChange(function () {
  7563. (h.path.color = l[h.path.color]),
  7564. (h.path.colorUp = l._desat(h.path.color)),
  7565. (h.path.colorDown = l.darken(h.path.color));
  7566. }),
  7567. p
  7568. .add(h, "reticuleColor", Object.keys(l))
  7569. .onFinishChange(function () {
  7570. h.reticuleColor = l[h.reticuleColor];
  7571. });
  7572. var f = n.addFolder("Warping"),
  7573. g = f.addFolder("Warp/Teleport");
  7574. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function () {}),
  7575. g
  7576. .add(h.warp, "softPushEnd", 0, 1)
  7577. .step(0.01)
  7578. .onFinishChange(function () {}),
  7579. g
  7580. .add(h.warp, "softBendAngle", 0, 45)
  7581. .onFinishChange(function () {}),
  7582. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function () {}),
  7583. g
  7584. .add(h.warp, "softBendEnd", 0, 1)
  7585. .step(0.01)
  7586. .onFinishChange(function () {}),
  7587. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function () {}),
  7588. g
  7589. .add(h.warp, "minBurnsAngle", 0, 10)
  7590. .onFinishChange(function () {}),
  7591. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function () {}),
  7592. g
  7593. .add(h.warp, "minBrakeAngle", 0, 5)
  7594. .step(0.01)
  7595. .onFinishChange(function () {}),
  7596. g
  7597. .add(h.warp, "maxBrakeAngle", 0, 5)
  7598. .step(0.01)
  7599. .onFinishChange(function () {}),
  7600. g.add(h.path, "mapGuides").onFinishChange(function () {}),
  7601. g
  7602. .add(h.warp, "teleportTime", 0, 5e3)
  7603. .step(10)
  7604. .onFinishChange(function () {}),
  7605. g
  7606. .add(h.warp, "outsideTime", 0, 5e3)
  7607. .step(10)
  7608. .onFinishChange(function () {}),
  7609. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function () {
  7610. h.path.typ = c[h.path.typ];
  7611. }),
  7612. g
  7613. .add(h.warp, "loop")
  7614. .onChange(function () {})
  7615. .onFinishChange(function () {
  7616. t.endlessLoop = h.warp.loop;
  7617. }),
  7618. g
  7619. .add(h.warp, "walkSlideShowThreshhold", 1, 1e4)
  7620. .step(1)
  7621. .onFinishChange(function () {}),
  7622. g
  7623. .add(h.warp, "walkExtraPanosDistance", 0, 3)
  7624. .step(0.1)
  7625. .onFinishChange(function () {}),
  7626. g
  7627. .add(h.transition, "fastForwardFactor", 1, 10)
  7628. .step(1)
  7629. .onFinishChange(function () {});
  7630. var m = f.addFolder("Long Warp Only");
  7631. m
  7632. .add(h.warp, "minWarpTime", 0, 5e3)
  7633. .step(10)
  7634. .onFinishChange(function () {
  7635. (h.warp.flySpeed = 0),
  7636. m.__controllers.forEach(function (e) {
  7637. e.updateDisplay();
  7638. });
  7639. }),
  7640. m
  7641. .add(h.warp, "timePerMeter", 0, 5e3)
  7642. .step(10)
  7643. .onFinishChange(function () {}),
  7644. m
  7645. .add(h.warp, "lookAheadMax", 0.01, 1)
  7646. .step(0.01)
  7647. .onFinishChange(function () {}),
  7648. m
  7649. .add(h.warp, "lookAheadDist", 0.01, 4)
  7650. .step(0.01)
  7651. .onFinishChange(function () {}),
  7652. m
  7653. .add(h.warp, "maxTurnPerSec", 0, 720)
  7654. .step(1)
  7655. .onFinishChange(function () {}),
  7656. m
  7657. .add(h.warp, "maxAimPerSec", 0, 720)
  7658. .step(1)
  7659. .onFinishChange(function () {}),
  7660. m
  7661. .add(h.warp, "turnFriction", 0, 1)
  7662. .step(0.01)
  7663. .onFinishChange(function () {}),
  7664. m
  7665. .add(h.warp, "walkDelay", 0, 2e3)
  7666. .step(10)
  7667. .onFinishChange(function () {}),
  7668. m
  7669. .add(h.transition, "flytimeMaxDistanceThreshold", 0, 25)
  7670. .step(10)
  7671. .onFinishChange(function () {}),
  7672. m
  7673. .add(h.warp, "walkMaxDist", 0, 100)
  7674. .step(1)
  7675. .onFinishChange(function () {});
  7676. var v = n.addFolder("Warp Esoterica");
  7677. v
  7678. .add(h.warp, "nearPanoDist", 0.01, 12)
  7679. .step(0)
  7680. .onFinishChange(function () {}),
  7681. v.add(h.warp, "blur", 0.01, 1).onFinishChange(function () {}),
  7682. v
  7683. .add(h.warp, "flySpeed", 0, 10)
  7684. .step(0.01)
  7685. .onFinishChange(function () {
  7686. (h.warp.minWarpTime = 0),
  7687. v.__controllers.forEach(function (e) {
  7688. e.updateDisplay();
  7689. });
  7690. }),
  7691. v.add(h.warp, "showBunny").onFinishChange(function () {}),
  7692. v
  7693. .add(h.warp, "fastTime", 0, 2500)
  7694. .step(10)
  7695. .onFinishChange(function () {}),
  7696. v.add(h.warp, "movementEasing", Object.keys(a));
  7697. var A = n.addFolder("Misc");
  7698. A.add(h, "dollhouseFOV", 10, 180).onChange(function () {
  7699. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV;
  7700. }),
  7701. A.add(h, "insideFOV", 10, 180).onChange(function () {
  7702. i.cameras[s.PANORAMA].fov = h.insideFOV;
  7703. }),
  7704. A.add(h, "insideLookSpeed", 0.01, 0.3)
  7705. .step(0.01)
  7706. .onChange(function () {}),
  7707. A.add(h, "rotationAccelerationInside", 0.1, 10)
  7708. .step(0.1)
  7709. .onChange(function () {}),
  7710. A.add(h, "rotationAccelerationOutside", 0.1, 10)
  7711. .step(0.1)
  7712. .onChange(function () {});
  7713. var y = n.addFolder("Navigation");
  7714. y.add(h.navigation, "panoScores").onFinishChange(function () {
  7715. h.navigation.panoScores ||
  7716. e.panos.forEach(function (e) {
  7717. e.floor.remove(e.text3d), (e.text3d = null);
  7718. });
  7719. }),
  7720. y.add(h.navigation, "mouseDirection"),
  7721. y.add(h.navigation, "filterStrictness", 0, 1),
  7722. y.add(h.navigation, "angleFactor", -60, 0),
  7723. y.add(h.navigation, "directionFactor", 1, 20),
  7724. y.add(h.navigation, "distanceFactor", -5, 5),
  7725. y.add(h.navigation, "optionalityFactor", 0.1, 10);
  7726. var C = n.addFolder("tags"),
  7727. I = C.addFolder("Tag Creation");
  7728. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  7729. I.add(h.tags.pole, "height", 0, 2.5).step(0.01).name("poleHeight"),
  7730. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  7731. I.add(h.tags.pole, "opacity", 0.1, 1).step(0.1).name("poleOpacity");
  7732. var E = C.addFolder("Visibility");
  7733. E.add(h.tags.visibility, "anyDistance"),
  7734. E.add(h.tags.visibility, "visibleDistance", 0.1, 30).step(0.1),
  7735. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(0.01),
  7736. E.add(h.tags.visibility, "hideViaFloor"),
  7737. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  7738. E.add(h.tags.visibility, "hideOffScreenObject").name(
  7739. "hideEdgeObject"
  7740. );
  7741. var b = C.addFolder("Disc Parameters");
  7742. b.add(h.tags.disc.scale, "nearBound", 0.1, 10).step(0.1),
  7743. b.add(h.tags.disc.scale, "farBound", 0.1, 20).step(0.1).listen(),
  7744. b.add(h.tags.disc.scale, "linkFarBound").onChange(function (e) {
  7745. e &&
  7746. (h.tags.disc.scale.farBound =
  7747. h.tags.visibility.visibleDistance *
  7748. (1 - h.tags.disc.scale.linkPercent / 100));
  7749. }),
  7750. b
  7751. .add(h.tags.disc.scale, "linkPercent", 0, 100)
  7752. .step(1)
  7753. .onChange(function (e) {
  7754. h.tags.disc.scale.linkFarBound &&
  7755. (h.tags.disc.scale.farBound =
  7756. h.tags.visibility.visibleDistance * (1 - e / 100));
  7757. }),
  7758. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  7759. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  7760. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  7761. var w = C.addFolder("Navigate");
  7762. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  7763. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  7764. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  7765. w
  7766. .add(h.tags.navigate, "aimAt", [
  7767. "disc",
  7768. "object",
  7769. "pole",
  7770. "nothing",
  7771. ])
  7772. .name("aim at"),
  7773. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  7774. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(0.1);
  7775. var _ = n.addFolder("Debug");
  7776. _.add(h, "wireframe").onFinishChange(function () {
  7777. e.chunks.forEach(function (t) {
  7778. t.material &&
  7779. (t.wireframeTwin ||
  7780. ((t.wireframeTwin = new o.WireframeHelper(t)),
  7781. (t.wireframeTwin.material.depthWrite = !1),
  7782. (t.wireframeTwin.material.depthTest = !1),
  7783. (t.wireframeTwin.material.opacity = 0.5),
  7784. (t.wireframeTwin.material.transparent = !0)),
  7785. h.wireframe
  7786. ? e.add(t.wireframeTwin)
  7787. : e.remove(t.wireframeTwin));
  7788. });
  7789. }),
  7790. _.add(h, "skyboxWireframe").onFinishChange(function () {
  7791. h.skyboxWireframe
  7792. ? ((e.skybox.wireframe = new o.WireframeHelper(e.skybox)),
  7793. e.add(e.skybox.wireframe))
  7794. : (e.remove(e.skybox.wireframe), (e.skybox.wireframe = null));
  7795. }),
  7796. _.add(h, "showSweeps").onFinishChange(function () {
  7797. e.setSweepVisibility(h.showSweeps);
  7798. }),
  7799. _.add(h, "showMesh").onFinishChange(function () {
  7800. e.chunks.forEach(function (e) {
  7801. e.visible = h.showMesh;
  7802. });
  7803. }),
  7804. _.add(h, "showFloors").onFinishChange(function () {
  7805. e.floors.forEach(function (e) {
  7806. e.collider.children.forEach(function (e) {
  7807. e.material.visible = h.showFloors;
  7808. });
  7809. });
  7810. }),
  7811. _.add(h, "showSkyboxes").onFinishChange(function () {
  7812. e.panos.forEach(function (e) {
  7813. e.skyboxMesh.visible = h.showSkyboxes;
  7814. });
  7815. }),
  7816. _.add(h, "showNeighbors").onChange(function () {}),
  7817. _.add(e, "alpha", 0, 1);
  7818. }
  7819. var r = e("../lib/dat.gui"),
  7820. o = e("three"),
  7821. a = e("../util/easing"),
  7822. s = e("../enum/Viewmode"),
  7823. l = e("../enum/Colors"),
  7824. c = e("../enum/WarpStyle"),
  7825. h = e("../settings");
  7826. e("../tag/tag");
  7827. (r.GUI.prototype.removeFolder = function (e) {
  7828. var t = this.__folders[e];
  7829. t &&
  7830. (t.close(),
  7831. this.__ul.removeChild(t.domElement.parentNode),
  7832. delete this.__folders[e],
  7833. this.onResize());
  7834. }),
  7835. (t.exports.toggle = n);
  7836. },
  7837. {
  7838. "../enum/Colors": 19,
  7839. "../enum/Viewmode": 51,
  7840. "../enum/WarpStyle": 52,
  7841. "../lib/dat.gui": 93,
  7842. "../tag/tag": 123,
  7843. "../settings": 166,
  7844. "../util/easing": 186,
  7845. three: 217,
  7846. },
  7847. ],
  7848. 64: [
  7849. function (e, t, i) {
  7850. (function (i) {
  7851. "use strict";
  7852. function n(e, t, i, n) {
  7853. $(".gui-error .error-problem-text").text(e),
  7854. $(".gui-error .error-solution-text").text(t),
  7855. $(".gui-error .error-explanation").text(i),
  7856. $(".gui-error .error-actions").html(n),
  7857. $(window).resize(),
  7858. $(".gui-error").fadeIn(),
  7859. $("#bottom-logo").fadeIn();
  7860. }
  7861. function r(e) {
  7862. var t = [
  7863. '<div class="browser-tiles">',
  7864. '<div class="tile">',
  7865. '<a href="https://www.google.com/chrome/browser/" target="_blank">',
  7866. '<img class="icon" src="images/icon_Google_Chrome_2011.png" ',
  7867. 'rel="tiletip" title="Chrome"></a>',
  7868. "</div>",
  7869. '<div class="tile">',
  7870. '<a href="https://www.mozilla.org/en-US/firefox/new/" target="_blank">',
  7871. '<img class="icon" src="images/icon_Mozilla_Firefox.png" ',
  7872. 'rel="tiletip" title="Firefox"></a>',
  7873. "</div>",
  7874. '<div class="tile">',
  7875. '<a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie" target="_blank">',
  7876. '<img class="icon" src="images/icon_Internet_Explorer_10.png" ',
  7877. 'rel="tiletip" title="Internet Explorer"></a>',
  7878. "</div>",
  7879. '<div class="tile">',
  7880. '<a href="https://support.apple.com/en-us/HT204416" target="_blank">',
  7881. '<img class="icon" src="images/icon_MacOSX_Safari.png" ',
  7882. 'rel="tiletip" title="Safari"></a>',
  7883. "</div>",
  7884. "</div>",
  7885. ].join("");
  7886. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  7887. s.isMobile() ||
  7888. $("[rel=tiletip]").tooltip({
  7889. placement: "bottom",
  7890. delay: {
  7891. show: 50,
  7892. hide: 0,
  7893. },
  7894. trigger: "hover",
  7895. viewport: {
  7896. selector: "body",
  7897. padding: 10,
  7898. },
  7899. });
  7900. }
  7901. function o() {
  7902. var e = s.isMobile()
  7903. ? ""
  7904. : '<span class="link install-browser">' +
  7905. h.ERROR_GENERIC_ACTIONS_2 +
  7906. "</span>" +
  7907. h.ERROR_GENERIC_ACTIONS_3,
  7908. t = [h.ERROR_GENERIC_ACTIONS_1, e].join("");
  7909. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  7910. s.isMobile() ||
  7911. $(".install-browser").on("click touchstart", function (e) {
  7912. e.preventDefault(), e.stopPropagation(), r(" ");
  7913. });
  7914. }
  7915. function a(e) {
  7916. if (
  7917. ($("head title").text(c.pageTitle),
  7918. $(
  7919. "#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo"
  7920. ).hide(),
  7921. $("#gui-loading").fadeOut(250),
  7922. $("#quick-blackout").hide(),
  7923. l.track("showcase_error", {
  7924. error_key: e,
  7925. }),
  7926. h.locale || h.init(),
  7927. "webgl-unsupported" === e)
  7928. )
  7929. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  7930. else if ("webgl-ios" === e)
  7931. n(
  7932. h.ERROR_WEBGL_IOS_PROBLEM,
  7933. h.ERROR_WEBGL_IOS_SOLUTION,
  7934. "",
  7935. h.ERROR_WEBGL_IOS_ACTIONS_1 +
  7936. "<strong>" +
  7937. h.ERROR_WEBGL_IOS_ACTIONS_2 +
  7938. "</strong>."
  7939. );
  7940. else if ("webgl-safari" === e)
  7941. n(
  7942. h.ERROR_WEBGL_SAFARI_PROBLEM,
  7943. "",
  7944. "",
  7945. h.ERROR_WEBGL_SAFARI_ACTIONS_1 +
  7946. "<strong>" +
  7947. h.ERROR_WEBGL_SAFARI_ACTIONS_2 +
  7948. "</strong>. " +
  7949. h.ERROR_WEBGL_SAFARI_ACTIONS_3 +
  7950. "<strong>" +
  7951. h.ERROR_WEBGL_SAFARI_ACTIONS_4 +
  7952. "</strong>."
  7953. );
  7954. else if ("webgl-generic" === e) o();
  7955. else if ("missing-urls" === e)
  7956. n(
  7957. h.ERROR_MISSING_URLS_PROBLEM,
  7958. "",
  7959. h.ERROR_MISSING_URLS_EXPLANATION
  7960. );
  7961. else if ("loading-failed" === e)
  7962. n(
  7963. h.ERROR_LOADING_FAILED_PROBLEM,
  7964. "",
  7965. "",
  7966. h.ERROR_LOADING_FAILED_ACTIONS_1 +
  7967. '<a class="link" target="_blank" href=' +
  7968. p +
  7969. ">" +
  7970. h.ERROR_LOADING_FAILED_ACTIONS_2 +
  7971. "</a>."
  7972. );
  7973. else {
  7974. if ("loading-failed-maintenance" !== e)
  7975. return void d.error("Unhandled error: " + e);
  7976. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION);
  7977. }
  7978. }
  7979. var s = e("./../util/browser"),
  7980. l = e("./../analytics"),
  7981. c = e("./../settings"),
  7982. h = e("../localization/localize"),
  7983. u = e("./../util/logger"),
  7984. d = new u(i),
  7985. p = '"https://support.port.com/hc/articles/208220058"';
  7986. t.exports.error = a;
  7987. }).call(this, "/js/gui/error.js");
  7988. },
  7989. {
  7990. "../localization/localize": 108,
  7991. "./../analytics": 4,
  7992. "./../settings": 166,
  7993. "./../util/browser": 182,
  7994. "./../util/logger": 189,
  7995. },
  7996. ],
  7997. 65: [
  7998. function (e, t, i) {
  7999. (function (i) {
  8000. "use strict";
  8001. function n() {
  8002. (Ue = []),
  8003. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  8004. Ue.push(".hideTarget", ".pinTop.right");
  8005. }
  8006. function r() {
  8007. for (var e in je)
  8008. if (je.hasOwnProperty(e)) {
  8009. var t = je[e];
  8010. if (!t.visible)
  8011. for (var i = 0; i < t.elements.length; i++)
  8012. $(t.elements[i]).hide();
  8013. }
  8014. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  8015. je.tourControls.visible === !1 &&
  8016. $("#drawer").addClass("fullWidth"),
  8017. n();
  8018. }
  8019. function o(e, t) {
  8020. var i =
  8021. !K.isMobile() &&
  8022. Q.zoom.enabled &&
  8023. t.mode === _e.PANORAMA &&
  8024. !e.tourIsPlaying;
  8025. $("#gui-zoomin").toggle(i), $("#gui-zoomout").toggle(i);
  8026. }
  8027. function a() {
  8028. c(),
  8029. $(".pinBottom").toggleClass("open"),
  8030. $("#drawer").toggleClass("open"),
  8031. $(".footer").toggleClass("open"),
  8032. $("#drawer").hasClass("open")
  8033. ? ($("#pullTab .icon").attr(
  8034. "data-original-title",
  8035. Re.CLOSE_HIGHLIGHTS
  8036. ),
  8037. Ze("highlights"))
  8038. : ($("#pullTab .icon").attr(
  8039. "data-original-title",
  8040. Re.OPEN_HIGHLIGHTS
  8041. ),
  8042. ie.resetDrawer()),
  8043. setTimeout(
  8044. function () {
  8045. $("#pullTab").toggleClass("opened");
  8046. },
  8047. $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration
  8048. ),
  8049. $(".pinBottom").hasClass("open") &&
  8050. s($(".vr-popup")) &&
  8051. $(".vr-popup").is(":visible") &&
  8052. Ae.dismiss();
  8053. }
  8054. function s(e) {
  8055. var t;
  8056. "none" !== e.css("display")
  8057. ? (t = e.position().top + e.outerHeight())
  8058. : (e.attr("style", "visibility: hidden"),
  8059. (t = e.position().top + e.outerHeight()),
  8060. e.attr("style", "display: none"));
  8061. var i = $("#player").outerHeight(),
  8062. n = i - 130;
  8063. return n < t + 25;
  8064. }
  8065. function l(e) {
  8066. "touchstart" === e.type && e.preventDefault(), e.stopPropagation();
  8067. }
  8068. function c() {
  8069. W && (W.reload(), W.init());
  8070. }
  8071. function h(e) {
  8072. ne.show(e), r();
  8073. }
  8074. function u(e) {
  8075. ne.progress(e);
  8076. }
  8077. function d(e, t, i) {
  8078. var n = t.player;
  8079. $("#gui-thumb").fadeOut(2500),
  8080. ne.hide(function () {
  8081. Ge = !1;
  8082. }),
  8083. me.init(e, i),
  8084. de.finishSetup(Object.keys(e.tags).length),
  8085. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  8086. var s = function () {
  8087. i.dismissExaminedTag(), i.disableHovering();
  8088. };
  8089. Ae.on(ye.OPENED, s),
  8090. Ce.on(Me.OPENED, s),
  8091. he.on(ue.OPENED, s),
  8092. fe.on(ge.OPENED, s);
  8093. var l = i.enableHovering.bind(i);
  8094. if (
  8095. (Ae.on(ye.CLOSED, l),
  8096. Ce.on(Me.CLOSED, l),
  8097. he.on(ue.CLOSED, l),
  8098. fe.on(ge.CLOSED, l),
  8099. Q.labels.enabled && Object.keys(e.labels).length,
  8100. e.floors.length <= 1 || !je.floors.visible
  8101. ? (je.floors.visible = !1)
  8102. : (y(e, t), C(e.currentFloor, n.mode)),
  8103. getQueryVariable("m") === "372" &&
  8104. ((je.floors.visible = 1), y(e, t)),
  8105. r(),
  8106. o(t, t.player),
  8107. $("#gui").fadeIn(1500),
  8108. je.highlight.visible &&
  8109. (2 !== Q.startHighlights || e.has360Views) &&
  8110. setTimeout(function () {
  8111. a(),
  8112. ((!e.has360Views && 1 !== Q.startHighlights) ||
  8113. (e.has360Views && 0 === Q.startHighlights)) &&
  8114. setTimeout(a, 2e3);
  8115. }, 2e3),
  8116. !K.isMobile())
  8117. )
  8118. for (
  8119. var c = [
  8120. "a",
  8121. "#title-toggle",
  8122. ".next-button",
  8123. ".prev-button",
  8124. ".gui-floor",
  8125. ".meta-toggle",
  8126. ".thumbImg",
  8127. "logo-button",
  8128. ],
  8129. h = 0;
  8130. h < c.length;
  8131. h++
  8132. )
  8133. $(c[h]).addClass("hasHover");
  8134. O(e), de.setupToggling();
  8135. //xzw:
  8136. window.editHotPanel && editHotPanel();
  8137. //czj
  8138. navBorderRadius(e);
  8139. //czj 编辑界面
  8140. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  8141. window.EditTools && new EditTools(n.sceneRenderer);
  8142. }
  8143. function navBorderRadius(e) {
  8144. var pullTab = $("#pullTab"),
  8145. mobileRadius = {
  8146. bottom: {
  8147. "border-bottom-left-radius": "10px",
  8148. "border-bottom-right-radius": "10px",
  8149. },
  8150. top: {
  8151. "border-top-left-radius": "10px",
  8152. "border-top-right-radius": "10px",
  8153. },
  8154. },
  8155. topRadius = {
  8156. bottom: {
  8157. "border-top-right-radius": "10px",
  8158. "border-bottom-right-radius": "10px",
  8159. },
  8160. top: {
  8161. "border-bottom-left-radius": "10px",
  8162. "border-top-left-radius": "10px",
  8163. },
  8164. };
  8165. function BorderRadius(bottom, top) {
  8166. $("#gui-modes-map > div:visible:last").css(bottom);
  8167. if (pullTab.is(":visible")) {
  8168. $(".viewContainer > div:visible:first").css(top);
  8169. } else {
  8170. $("#gui-modes-map > div:visible:first").css(top);
  8171. }
  8172. }
  8173. if (
  8174. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)
  8175. ) {
  8176. BorderRadius(mobileRadius.bottom, mobileRadius.top);
  8177. } else {
  8178. BorderRadius(topRadius.bottom, topRadius.top);
  8179. }
  8180. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  8181. if (window.DATA.model.special || window.DATA.special) {
  8182. window.specialScene && specialScene.special().afterImplement();
  8183. }
  8184. }
  8185. function p(e) {
  8186. e || (e = 0),
  8187. (We = !1),
  8188. window.setTimeout(
  8189. function () {
  8190. We || ((ze = !0), $("#gui-spinner").stop(!0, !0).show());
  8191. }.bind(this),
  8192. e
  8193. );
  8194. }
  8195. function f() {
  8196. $("#gui-spinner").stop(!0, !0),
  8197. $("#gui-spinner").fadeOut(1e3),
  8198. (We = !0),
  8199. (ze = !1);
  8200. }
  8201. function g(e, t) {
  8202. var i = e.mode,
  8203. n = t || e.currentPano;
  8204. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  8205. $("#gui-modes-floorplan").toggleClass(
  8206. "active",
  8207. i === _e.FLOORPLAN
  8208. ),
  8209. $("#gui-modes-inside").toggleClass("active", i === _e.PANORAMA),
  8210. i === _e.PANORAMA
  8211. ? ($("#view-controllers").slideUp(500),
  8212. Q.show360Views.enabled && !n.isAligned()
  8213. ? ($(".gui-floor").addClass("hidden"),
  8214. $("#gui-modes-outside").addClass("desktop-only"))
  8215. : ($(".gui-floor").removeClass("hidden"),
  8216. $("#gui-modes-outside").removeClass("desktop-only")),
  8217. $("#gui-modes-outside").removeClass("hidden"))
  8218. : i !== _e.TRANSITIONING &&
  8219. (f(),
  8220. (Be = i),
  8221. $("#gui-modes-outside").addClass("hidden"),
  8222. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  8223. $("#view-controllers").is(":visible") ||
  8224. $("#view-controllers").slideDown(Q.guiAnimationSpeed));
  8225. }
  8226. function m(e, t) {
  8227. var i = t.player;
  8228. $("#gui-modes-inside").on("mousedown touchstart", function (e) {
  8229. l(e),
  8230. J.updateInteraction(Se.InteractionGui, "inside-button"),
  8231. J.track("USER", {
  8232. event_type: "showcase_gui",
  8233. gui_action: "click_inside_mode_button",
  8234. }),
  8235. t.changeMode(_e.PANORAMA);
  8236. }),
  8237. $("#gui-modes-outside")
  8238. .find("a")
  8239. .on("click", function (e) {
  8240. l(e),
  8241. J.track("showcase_gui", {
  8242. gui_action: "click_outside_mode_button",
  8243. }),
  8244. t.changeMode(Be);
  8245. }),
  8246. $("#gui-modes-floorplan").on("click", function (e) {
  8247. l(e),
  8248. i.mode !== _e.FLOORPLAN &&
  8249. (J.track("showcase_gui", {
  8250. gui_action: "click_floorplan_mode_button",
  8251. }),
  8252. t.changeMode(_e.FLOORPLAN));
  8253. }),
  8254. $("#gui-modes-dollhouse").on("click", function (e) {
  8255. l(e),
  8256. i.mode !== _e.DOLLHOUSE &&
  8257. (J.track("showcase_gui", {
  8258. gui_action: "click_dollhouse_mode_button",
  8259. }),
  8260. t.changeMode(_e.DOLLHOUSE));
  8261. });
  8262. }
  8263. function v(e, t) {
  8264. function i() {
  8265. document.getElementById("vr").classList.remove("hidden"),
  8266. Q.vr.allowWebVR
  8267. ? K.getVRDisplay().then(
  8268. function (e) {
  8269. K.supportsFullscreen()
  8270. ? n(e)
  8271. : (De.warn(
  8272. "Unable to use WebVR when full screen is not supported"
  8273. ),
  8274. $(".improper-embed").toggleClass("hidden", !1),
  8275. r());
  8276. },
  8277. function (e) {
  8278. r();
  8279. }
  8280. )
  8281. : r();
  8282. }
  8283. function n(i) {
  8284. De.info(
  8285. i.displayName +
  8286. " detected, VR button activates WebVR experience"
  8287. ),
  8288. Ie.init(e.data, t, i, q),
  8289. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  8290. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe));
  8291. }
  8292. function r() {
  8293. De.info(
  8294. "WebVR support not found, VR button activates native app VR modal"
  8295. ),
  8296. Ae.init(e.data, q),
  8297. Ae.on(
  8298. ye.OPENED,
  8299. (function () {
  8300. var e = document.getElementById("vr-modal");
  8301. return function () {
  8302. Ze("vr"), le.open(e);
  8303. };
  8304. })()
  8305. ),
  8306. Ae.on(ye.CLOSED, le.reset);
  8307. }
  8308. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0)) {
  8309. /*********************** 方奕卓 VR功能事件监听 ********************/
  8310. K.isMobile() && $("#vr").css("display", ""); // 显示vr功能按钮
  8311. switch (Q.vr.option) {
  8312. case Pe.CONTEXTUAL:
  8313. i();
  8314. break;
  8315. case Pe.ANDROID:
  8316. K.detectAndroid() && i();
  8317. break;
  8318. case Pe.NONE:
  8319. }
  8320. }
  8321. }
  8322. function A(e, t) {
  8323. $("#play").on("mousedown touchstart", function (e) {
  8324. l(e);
  8325. Ze("tour");
  8326. ve.play();
  8327. J.trackAlways("showcase_gui", {
  8328. gui_action: "play_highlights",
  8329. });
  8330. }),
  8331. (window.startAndPlay = function (e) {
  8332. // l(e);
  8333. Ze("tour");
  8334. ve.play();
  8335. J.trackAlways("showcase_gui", {
  8336. gui_action: "play_highlights",
  8337. });
  8338. });
  8339. $("#pause").on("mousedown touchstart", function (e) {
  8340. l(e),
  8341. ve.pause(),
  8342. J.trackAlways("showcase_gui", {
  8343. gui_action: "pause_highlights",
  8344. });
  8345. }),
  8346. $("#gui-zoomin")
  8347. .find("a")
  8348. .on("click", function (e) {
  8349. l(e), t.player.zoomInIncrementally();
  8350. }),
  8351. $("#gui-zoomout")
  8352. .find("a")
  8353. .on("click", function (e) {
  8354. l(e), t.player.zoomOutIncrementally();
  8355. });
  8356. }
  8357. function y(e, t) {
  8358. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  8359. if (getQueryVariable("m") === "372") continue;
  8360. var r = $(
  8361. '<div class="floorChoice" data-index="' + n + '"></div>'
  8362. ).text(e.floors.get(n).name);
  8363. $(".gui-floor").find(".container").prepend(r);
  8364. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  8365. }
  8366. i
  8367. .find(".container")
  8368. .prepend(
  8369. '<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' +
  8370. Re.FLOOR_ALL +
  8371. "</div>"
  8372. ),
  8373. i.on("click", function (e) {
  8374. l(e), Ze("floor"), i.toggleClass("open");
  8375. }),
  8376. $(".floorChoice").on("click", function (e) {
  8377. l(e);
  8378. var n = $(this).data("index");
  8379. "all" !== n
  8380. ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  8381. t.player.gotoFloor(n),
  8382. J.track("showcase_gui", {
  8383. gui_action: "click_floor_select_button",
  8384. interaction_source: "gui",
  8385. }))
  8386. : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  8387. Ze("move"),
  8388. t.allFloors(),
  8389. J.track("showcase_gui", {
  8390. gui_action: "click_toggle_all_floors_button",
  8391. interaction_source: "gui",
  8392. })),
  8393. i.removeClass("open");
  8394. });
  8395. }
  8396. function C(e, t) {
  8397. e &&
  8398. (t === _e.DOLLHOUSE || t === _e.FLOORPLAN
  8399. ? ($(".allFloorBtn").show(),
  8400. $(".gui-floor-icon").hide(),
  8401. $(".gui-floor-title").show())
  8402. : ($(".allFloorBtn").hide(),
  8403. $(".gui-floor-icon").show(),
  8404. $(".gui-floor-title").hide()),
  8405. e.model.allFloorsVisible
  8406. ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  8407. $(".gui-floor-number").text(Re.FLOOR_ALL),
  8408. $(".floorChoice").removeClass("active"),
  8409. $('.floorChoice[data-index="all"]').addClass("active"))
  8410. : ($(".gui-floor-title").text(e.name),
  8411. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  8412. $(".floorChoice").removeClass("active"),
  8413. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass(
  8414. "active"
  8415. )));
  8416. }
  8417. function I(e) {
  8418. return e.describe().inTransition;
  8419. }
  8420. function b(e, t, i) {
  8421. Fe = e.heroLocations.length;
  8422. var n = '<li class="thumbImg" data-index=""><img src=""></li>',
  8423. r = 100 / Fe + "%",
  8424. o = $("#thumb-container"),
  8425. a = $("#progressBar");
  8426. $("#status").find(".totalSteps").text(Fe);
  8427. for (var s = 0; s < Fe; s++) {
  8428. var c = e.heroLocations[s],
  8429. h = $(n);
  8430. var thumbUrl;
  8431. if (c.heroLocations) {
  8432. //有子项,选第一张截图
  8433. thumbUrl = manage.dealURL(c.heroLocations[0].thumbUrl); //.replace('https://','').replace('http://','')
  8434. } else {
  8435. thumbUrl = manage.dealURL(c.thumbUrl); //.replace('https://','').replace('http://','')
  8436. }
  8437. h.attr("data-index", s);
  8438. je.highlight.visible && h.find("img").attr("src", thumbUrl);
  8439. if (c.name) {
  8440. var u = $('<div class="overlay"></div>').text(c.name);
  8441. h.prepend(u);
  8442. }
  8443. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  8444. var d = e.panos.get(c.panoId),
  8445. p = d && !d.isAligned(),
  8446. f = p
  8447. ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>'
  8448. : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>';
  8449. h.prepend(f);
  8450. }
  8451. o.append(h),
  8452. a.append(
  8453. '<div class="step" data-idx="' +
  8454. s +
  8455. '" style="width:' +
  8456. r +
  8457. '"></div>'
  8458. );
  8459. }
  8460. (j = 144 * Fe),
  8461. (Y = 111 * Fe),
  8462. $(".thumbImg").on("mouseover", function () {
  8463. I(t) || i.showPathToHeroLocation([$(this).data("index"), 0]); //改
  8464. }),
  8465. $(".thumbImg").on("mouseout", function () {
  8466. t.clearPath();
  8467. }),
  8468. $(".thumbImg").on("click", function (e) {
  8469. l(e);
  8470. var i = $(this);
  8471. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  8472. J.trackAlways("showcase_gui", {
  8473. gui_action: "click_highlight",
  8474. }),
  8475. t.goToHighlight([i.data("index"), 0]); //改
  8476. }),
  8477. $(".previous")
  8478. .find("a")
  8479. .on("click", function (e) {
  8480. l(e),
  8481. J.trackAlways("showcase_gui", {
  8482. gui_action: "prev_highlight",
  8483. }),
  8484. t.prevHighlight();
  8485. }),
  8486. $(".next")
  8487. .find("a")
  8488. .on("click", function (e) {
  8489. l(e),
  8490. J.trackAlways("showcase_gui", {
  8491. gui_action: "next_highlight",
  8492. }),
  8493. t.nextHighlight();
  8494. }),
  8495. $("#drawer").on("mouseleave", function (e) {
  8496. l(e);
  8497. var t;
  8498. try {
  8499. t = new MouseEvent("mouseup", {
  8500. clientX: e.clientX,
  8501. clientY: e.clientY,
  8502. screenX: e.screenX,
  8503. screenY: e.screenY,
  8504. });
  8505. } catch (i) {
  8506. (t = document.createEvent("MouseEvents")),
  8507. t.initMouseEvent(
  8508. "mouseup",
  8509. e.bubbles,
  8510. e.cancelable,
  8511. e.view,
  8512. e.detail,
  8513. e.screenX,
  8514. e.screenY,
  8515. e.clientX,
  8516. e.clientY,
  8517. e.ctrlKey,
  8518. e.altKey,
  8519. e.shiftKey,
  8520. e.metaKey,
  8521. e.button,
  8522. e.relatedTarget
  8523. );
  8524. }
  8525. document.dispatchEvent(t);
  8526. }),
  8527. (W = new Sly($("#scrollFrame"), {
  8528. horizontal: !0,
  8529. itemNav: "centered",
  8530. smart: !0,
  8531. scrollTrap: !0,
  8532. scrollBy: 1,
  8533. mouseDragging: !0,
  8534. touchDragging: !0,
  8535. speed: 300,
  8536. dragHandle: !0,
  8537. dynamicHandle: !0,
  8538. clickBar: !0,
  8539. scrollBar: $("#scroller"),
  8540. activateOn: null,
  8541. }).init()),
  8542. W.on("active", function (e, t) {
  8543. (Ve = t),
  8544. Ze("tour"),
  8545. $(".step").removeClass("active"),
  8546. $("#status")
  8547. .find(".curIdx")
  8548. .text(t + 1);
  8549. for (var i = 0; i <= t; i++)
  8550. $("#progressBar")
  8551. .find("[data-idx='" + i + "']")
  8552. .addClass("active");
  8553. }),
  8554. w();
  8555. //add :
  8556. let scrollFrame = $(W.frame);
  8557. scrollFrame.on("wheel.sly", function () {
  8558. lastMoveScrollTime = Date.now();
  8559. });
  8560. let dragstart;
  8561. /* scrollFrame.on("pointerdown", function() {
  8562. dragstart = true
  8563. })
  8564. scrollFrame.on("pointerup", function() {
  8565. dragstart = false
  8566. }) */
  8567. scrollFrame.on("pointermove", function () {
  8568. //if(dragstart){
  8569. lastMoveScrollTime = Date.now();
  8570. //}
  8571. });
  8572. }
  8573. function w() {
  8574. var e = $("#player").width() - 20,
  8575. t = $("#scroller"),
  8576. i = $("#drawer"),
  8577. n = $(".pinBottom");
  8578. if ($("#player").width() < 488 || $("#player").height() < 488)
  8579. t.addClass("hidden"),
  8580. i.addClass("noScroll"),
  8581. n.addClass("noScroll");
  8582. else {
  8583. var r = j > e,
  8584. o = !i.hasClass("noScroll"),
  8585. a = r !== o;
  8586. a &&
  8587. (t.toggleClass("hidden"),
  8588. i.toggleClass("noScroll"),
  8589. n.toggleClass("noScroll"));
  8590. }
  8591. }
  8592. function _(e) {
  8593. je.tourControls.visible = true; //e.tour_buttons && K.valueFromHash("gt", 1),
  8594. (je.coBrand.visible =
  8595. e.presented_by &&
  8596. 1 !== Q.specialEdition &&
  8597. Q.brand &&
  8598. !K.valueFromHash("mls", !1)),
  8599. (je.highlight.visible =
  8600. /* e.highlight_reel && */ 1 !== Q.specialEdition &&
  8601. Q.showHighlights);
  8602. }
  8603. function T(e) {
  8604. function t(t, i) {
  8605. return !!e.player_options[t] && e[i || t];
  8606. }
  8607. $(".model-title").text(e.name);
  8608. var i = Q.pageTitle;
  8609. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  8610. 2 !== K.valueFromHash("mls", 0) && e.name && (i = e.name),
  8611. (document.title = i),
  8612. K.isMobile()
  8613. ? $("#gui-fullscreen").css("display", "none")
  8614. : ($("[rel=tooltip]").tooltip({
  8615. delay: {
  8616. show: 50,
  8617. hide: 0,
  8618. },
  8619. trigger: "hover",
  8620. html: !1,
  8621. viewport: {
  8622. selector: "body",
  8623. padding: 10,
  8624. },
  8625. }),
  8626. K.inIframe() &&
  8627. document
  8628. .getElementsByClassName("pinBottom-container")[0]
  8629. .classList.add("embed")),
  8630. // 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"),
  8631. de.populate({
  8632. name: t("model_name", "name"),
  8633. coBrand: t("presented_by"),
  8634. description: t("model_summary", "summary") || "暂无内容",
  8635. contactName: t("contact_name"),
  8636. address: t("address"),
  8637. phone: t("contact_phone"),
  8638. formattedPhone: e.formatted_contact_phone,
  8639. email: t("contact_email"),
  8640. url: t("external_url"),
  8641. socialSharing: e.enable_social_sharing && e.is_public,
  8642. });
  8643. }
  8644. function x(e, t, i, n, r, o) {
  8645. function a() {
  8646. o.setLoadingStartTime(),
  8647. H(),
  8648. r ? (re.showMessage(t, i, je.coBrand.visible), l()) : h(l);
  8649. }
  8650. var s = $.Deferred(),
  8651. l = s.resolve.bind(s);
  8652. return (
  8653. (Ge = !0),
  8654. O(e),
  8655. e.data.player_options && _(e.data.player_options),
  8656. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  8657. Re.localizeGUI(),
  8658. T(e.data),
  8659. r || $(".quick").addClass("hidden"),
  8660. //e.data.image && !r && E(e.data.image),
  8661. n
  8662. ? (J.impression(), a())
  8663. : (o.setWaitingStartTime(), oe.show(r, a)),
  8664. s
  8665. );
  8666. }
  8667. function S(e, t, i, n, r, a, s) {
  8668. (q = s),
  8669. e.outsideAllowed() ||
  8670. $("#gui-modes-outside").addClass("invisible"),
  8671. e.supportedModes[_e.PANORAMA] ||
  8672. $("#gui-modes-inside").addClass("invisible"),
  8673. ae.init(),
  8674. re.init(e, a),
  8675. Oe.init(e, t, n),
  8676. $(".icon").on("mouseover", function () {
  8677. t.player && t.player.reticule.hide();
  8678. }),
  8679. m(e, t),
  8680. A(e, t),
  8681. e.data.enable_social_sharing &&
  8682. e.data.is_public &&
  8683. Q.share.enabled &&
  8684. (Ce.init(window.DATA.name /* e.data.name */),
  8685. Ce.on(
  8686. Me.OPENED,
  8687. (function () {
  8688. var e = document.getElementById("share-modal");
  8689. return function () {
  8690. Ze("share"), le.open(e);
  8691. };
  8692. })()
  8693. ),
  8694. Ce.on(Me.CLOSED, le.reset)),
  8695. e.heroLocations.length > 0
  8696. ? b(e, t, i)
  8697. : ((je.highlight.visible = !1), (je.tourControls.visible = !1)),
  8698. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  8699. z(),
  8700. g(i),
  8701. v(e, r),
  8702. e.on("floor.changed", C),
  8703. e.on("waiting", R.bind(this, e)),
  8704. e.on("waiting-done", P.bind(this, e)),
  8705. i.on(xe.ModeChanged, function (e, n) {
  8706. g(i),
  8707. o(t, i),
  8708. n === _e.PANORAMA &&
  8709. i.currentPano &&
  8710. !i.currentPano.isAligned() &&
  8711. (n = _e.OUTDOOR),
  8712. he.updateMode(n);
  8713. }),
  8714. n.on(Se.Move, Ze.bind(this, "move")),
  8715. i.on(xe.Ready, function () {
  8716. ie.init(n, i, i.tagManager, t),
  8717. i.on(xe.ModeChanged, function (e, t) {
  8718. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss();
  8719. });
  8720. }),
  8721. i.on(xe.PanoChosen, function (e, t) {
  8722. g(i, t),
  8723. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA);
  8724. }),
  8725. le.on(ce.CLOSE, function (e) {
  8726. switch (e) {
  8727. case "vr-modal":
  8728. Ae.dismiss();
  8729. break;
  8730. case "share-modal":
  8731. Ce.hide();
  8732. break;
  8733. case "terms-modal":
  8734. fe.hide();
  8735. }
  8736. });
  8737. var l = $("#play").eq(0),
  8738. c = $("#pause").eq(0),
  8739. h = $(".pinBottom").toArray(),
  8740. u = $("#drawer").eq(0),
  8741. d = $("#playHead").eq(0),
  8742. p = $("#progressBar").eq(0),
  8743. f = $("#thumb-container").eq(0),
  8744. y = f.children(),
  8745. I = p.children();
  8746. t.on("update.controls", function () {
  8747. //导览控制
  8748. var n = t.describe();
  8749. n.tourIsPlaying || i.isWarping()
  8750. ? (je.tourControls.visible && (l.hide(), c.show()),
  8751. n.tourInProgress &&
  8752. (h.forEach(function (e) {
  8753. e.classList.add("playing");
  8754. }),
  8755. u.addClass("playing"),
  8756. d.addClass("playing")))
  8757. : (je.tourControls.visible && (l.show(), c.hide()),
  8758. n.tourInProgress ||
  8759. (ve.stopTour(),
  8760. h.forEach(function (e) {
  8761. e.classList.remove("playing");
  8762. }),
  8763. u.removeClass("playing"),
  8764. d.removeClass("playing")));
  8765. var r, a, s;
  8766. if (null !== n.currentItem) {
  8767. var p, f;
  8768. $("#status")
  8769. .find(".curIdx")
  8770. .text(n.currentItem[0] + 1),
  8771. n.onTheBus
  8772. ? ((p = "active"), (f = "recent"))
  8773. : ((f = "active"), (p = "recent"));
  8774. var g =
  8775. null === n.destinationItem ||
  8776. n.currentItem[0] === n.destinationItem[0];
  8777. /* for (r = 0; r < e.heroLocations.length; r += 1)
  8778. s = y.eq(r),
  8779. a = I.eq(r),
  8780. s.removeClass(f),
  8781. a.removeClass(f),
  8782. n.onTheBus && r === n.destinationItem[0] ? (s.addClass(p),
  8783. a.addClass(p),
  8784. W.activate(r)) : n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p),
  8785. a.addClass(p)) : (s.removeClass(p),
  8786. a.removeClass(p)) */
  8787. for (r = 0; r < e.heroLocations.length; r += 1) {
  8788. (s = y.eq(r)),
  8789. (a = I.eq(r)),
  8790. s.removeClass(f),
  8791. a.removeClass(f);
  8792. if (n.onTheBus && r === n.destinationItem[0]) {
  8793. s.addClass(p);
  8794. a.addClass(p);
  8795. if (Date.now() - lastMoveScrollTime > 2000) {
  8796. //add 如果一段时间内用户不操作scrollbar,才focus回这个item
  8797. W.activate(r); // scrollbar slide to this
  8798. }
  8799. } else {
  8800. n.onTheBus && g && r === n.currentItem[0]
  8801. ? (s.addClass(p), a.addClass(p))
  8802. : (s.removeClass(p), a.removeClass(p));
  8803. }
  8804. }
  8805. } 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");
  8806. o(t, i);
  8807. }),
  8808. document.addEventListener(
  8809. "keydown",
  8810. function (n) {
  8811. switch ((J.updateInteraction(Se.InteractionKey), n.which)) {
  8812. case we.ZERO:
  8813. Q.debug && e.toggleAlpha();
  8814. break;
  8815. case we.NINE:
  8816. Q.debug && se.toggle();
  8817. break;
  8818. case we.ONE:
  8819. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  8820. break;
  8821. case we.TWO:
  8822. e.outsideAllowed() &&
  8823. !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) &&
  8824. t.changeMode(_e.DOLLHOUSE);
  8825. break;
  8826. case we.THREE:
  8827. e.outsideAllowed() &&
  8828. !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) &&
  8829. t.changeMode(_e.FLOORPLAN);
  8830. break;
  8831. case we.FOUR:
  8832. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  8833. break;
  8834. case we.SPACE:
  8835. je.tourControls.visible &&
  8836. ($("#playHead").hasClass("playing") || Ze("tour"));
  8837. break;
  8838. case we.RETURN:
  8839. Q.debug && e.toggleExplodeUp();
  8840. break;
  8841. case we.P:
  8842. k();
  8843. break;
  8844. case we.U:
  8845. B();
  8846. break;
  8847. case we.X:
  8848. Q.debug && e.toggleExplode();
  8849. break;
  8850. case we.PLUSEQUALS:
  8851. t.player.activatePersistentZooming(!0), ie.hideUi();
  8852. break;
  8853. case we.DASHUNDERSCORE:
  8854. t.player.activatePersistentZooming(!1), ie.hideUi();
  8855. break;
  8856. case we.SEVEN:
  8857. De.info(
  8858. "Zoom level: " +
  8859. t.player.zoomLevel +
  8860. ", FOV: " +
  8861. t.player.zoomFov
  8862. );
  8863. break;
  8864. case we.EIGHT:
  8865. t.player.decreaseZoomSpeed();
  8866. break;
  8867. case we.NINE:
  8868. t.player.increaseZoomSpeed();
  8869. }
  8870. return i && i.reticule.hide(), !0;
  8871. }.bind(this)
  8872. ),
  8873. document.addEventListener(
  8874. "keyup",
  8875. function (e) {
  8876. switch (e.which) {
  8877. case we.PLUSEQUALS:
  8878. t.player.deactivatePersistentZooming();
  8879. break;
  8880. case we.DASHUNDERSCORE:
  8881. t.player.deactivatePersistentZooming();
  8882. }
  8883. }.bind(this)
  8884. ),
  8885. F(e),
  8886. L(e, t.player),
  8887. M(i),
  8888. te.setAutoPlay(e.heroCount()),
  8889. he.init(i, a.mode),
  8890. he.on(ue.OPENED, Ze.bind(this, "help")),
  8891. fe.init(),
  8892. fe.on(
  8893. ge.OPENED,
  8894. (function () {
  8895. var e = document.getElementById("terms-modal");
  8896. return function () {
  8897. Ze("terms"), le.open(e);
  8898. };
  8899. })()
  8900. ),
  8901. fe.on(ge.CLOSED, le.reset),
  8902. Q.quickstart.enabled ||
  8903. re
  8904. .delayLanding(a.mode)
  8905. .then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  8906. (Q.quickstart.enabled || i.model.outsideAllowed()) &&
  8907. ie.init(n, i, i.tagManager, t),
  8908. Q.profiling.enabled && se.show(),
  8909. ve.init(t);
  8910. }
  8911. function M(e) {
  8912. var t = function (e, t) {
  8913. $(e)
  8914. .find("a")
  8915. .each(function (e, i) {
  8916. t
  8917. ? $(i)
  8918. .removeClass("buttonZoomDisabled")
  8919. .addClass("buttonZoomEnabled")
  8920. : $(i)
  8921. .addClass("buttonZoomDisabled")
  8922. .removeClass("buttonZoomEnabled"),
  8923. (i.style.pointerEvents = t ? "auto" : "none");
  8924. });
  8925. },
  8926. i = function () {
  8927. e.zoomLevel >= Q.zoom.max
  8928. ? t("#gui-zoomin", !1)
  8929. : t("#gui-zoomin", !0),
  8930. e.zoomLevel <= Q.zoom.min
  8931. ? t("#gui-zoomout", !1)
  8932. : t("#gui-zoomout", !0);
  8933. };
  8934. e.on(Ne.ZoomMax, function () {
  8935. t("#gui-zoomin", !1), t("#gui-zoomout", !0);
  8936. }),
  8937. e.on(Ne.ZoomMin, function () {
  8938. t("#gui-zoomin", !0), t("#gui-zoomout", !1);
  8939. }),
  8940. e.on(Ne.ZoomIn, function () {
  8941. t("#gui-zoomout", !0);
  8942. }),
  8943. e.on(Ne.ZoomOut, function () {
  8944. t("#gui-zoomin", !0);
  8945. }),
  8946. i();
  8947. }
  8948. function R(e) {
  8949. O(e);
  8950. }
  8951. function P(e) {
  8952. O(e);
  8953. }
  8954. function O(e) {
  8955. var t = e.waitQueue.length;
  8956. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay);
  8957. }
  8958. function L(e, t) {
  8959. He = {
  8960. gui: null,
  8961. visible: !1,
  8962. model: e,
  8963. player: t,
  8964. };
  8965. }
  8966. function D(e, t) {
  8967. function i() {
  8968. var i = t.toJSON();
  8969. (n.linkToLocation =
  8970. window.location.protocol +
  8971. "//" +
  8972. window.location.host +
  8973. window.location.pathname +
  8974. "?m=" +
  8975. e.sid +
  8976. "&start=" +
  8977. be.serialize(i)),
  8978. t.tagManager.activeTag &&
  8979. (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid);
  8980. }
  8981. var n = {},
  8982. r = new Le.GUI({
  8983. autoPlace: !0,
  8984. width: "60%",
  8985. });
  8986. i(),
  8987. t.on(xe.ViewChanged, i),
  8988. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  8989. (r.domElement.id = "datLinks");
  8990. var o = [].slice.call(
  8991. r.domElement.querySelectorAll(".property-name")
  8992. );
  8993. return (
  8994. o.forEach(function (e) {
  8995. if (!K.detectSafari()) {
  8996. var t = document.createElement("button");
  8997. t.classList.add("btn-deep-link"),
  8998. (t.innerText = Re.MENU_COPY),
  8999. e.nextSibling.appendChild(t);
  9000. var i = function () {
  9001. alert(Re.LINK_ALERT_COPY), t.hide();
  9002. };
  9003. t.addEventListener("click", function (e) {
  9004. try {
  9005. var t = e.target.parentNode.childNodes[0];
  9006. t.select();
  9007. var n = document.execCommand("copy");
  9008. t.blur(), n || i();
  9009. } catch (e) {
  9010. i();
  9011. }
  9012. });
  9013. }
  9014. }),
  9015. $(r.__closeButton).hide(),
  9016. r
  9017. );
  9018. }
  9019. function N(e) {
  9020. He.gui || (He.gui = D(He.model, He.player)),
  9021. (He.visible = e),
  9022. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide();
  9023. }
  9024. function B() {
  9025. N(!He.visible);
  9026. }
  9027. function F(e) {
  9028. ke = {
  9029. gui: null,
  9030. visible: !1,
  9031. model: e,
  9032. };
  9033. }
  9034. function V(e) {
  9035. var t = new Le.GUI();
  9036. return (
  9037. t
  9038. .add(Q, "showSweeps")
  9039. .name("Show sweeps")
  9040. .onFinishChange(function () {
  9041. e.setSweepVisibility(Q.showSweeps);
  9042. }),
  9043. t
  9044. .add(Q, "rotationAccelerationInside", 0.1, 10)
  9045. .name("Rotation speed")
  9046. .step(0.1),
  9047. t
  9048. .add(Q.transition, "flyTime", 0, 5e3)
  9049. .name("Transition time")
  9050. .onFinishChange(function () {
  9051. (Q.transition.flySpeed = 0),
  9052. t.__controllers.forEach(function (e) {
  9053. e.updateDisplay();
  9054. });
  9055. }),
  9056. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  9057. $(t.__closeButton).hide(),
  9058. t
  9059. );
  9060. }
  9061. function U(e) {
  9062. ke.gui || (ke.gui = V(ke.model)),
  9063. (ke.visible = e),
  9064. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide();
  9065. }
  9066. function k() {
  9067. U(!ke.visible);
  9068. }
  9069. function H() {
  9070. function e(e) {
  9071. e.target === t ||
  9072. $.contains(t, e.target) ||
  9073. e.target === i ||
  9074. $.contains(i, e.target) ||
  9075. e.target === n ||
  9076. $.contains(n, e.target); /* || e.preventDefault()*/
  9077. }
  9078. $("body").css("touch-action", "none"),
  9079. $("#gui-parent")
  9080. .find("*:not(#tag-billboards)")
  9081. .on("touchmove", function (e) {
  9082. // e.preventDefault()
  9083. });
  9084. var t = document.getElementById("terms-text"),
  9085. i = document.getElementById("more-help-wrapper"),
  9086. n =
  9087. (document.getElementById("navigation-help-wrapper"),
  9088. document.getElementById("help-dialog"),
  9089. document.getElementById("tag-billboards"));
  9090. Q.useWheel &&
  9091. (document.body.addEventListener("mousewheel", e, {
  9092. passive: false,
  9093. }),
  9094. document.body.addEventListener("DOMMouseScroll", e)),
  9095. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper")
  9096. .off("touchmove")
  9097. .on("touchmove", function (e) {
  9098. e.stopPropagation();
  9099. });
  9100. }
  9101. function G(e, t) {
  9102. for (var i = []; e; ) i.push(e), (e = e.parentNode);
  9103. for (; t && i.indexOf(t) === -1; ) t = t.parentNode;
  9104. return t;
  9105. }
  9106. function z() {
  9107. var e,
  9108. t = function (t) {
  9109. e = 0 === t.button || 1 === t.which ? t.target : null;
  9110. },
  9111. i = function (t) {
  9112. e !== t.target && (e = G(e, t.target));
  9113. var i = document.getElementById("gui-parent");
  9114. if ((G(i, e) !== i && (e = null), e)) {
  9115. var n;
  9116. try {
  9117. n = new MouseEvent("click", t);
  9118. } catch (e) {
  9119. (n = document.createEvent("MouseEvents")),
  9120. n.initMouseEvent(
  9121. "click",
  9122. t.bubbles,
  9123. t.cancelable,
  9124. t.view,
  9125. t.detail,
  9126. t.screenX,
  9127. t.screenY,
  9128. t.clientX,
  9129. t.clientY,
  9130. t.ctrlKey,
  9131. t.altKey,
  9132. t.shiftKey,
  9133. t.metaKey,
  9134. t.button,
  9135. t.relatedTarget
  9136. );
  9137. }
  9138. (n.syntheticClick = !0), e.dispatchEvent(n), (e = null);
  9139. }
  9140. };
  9141. document.body.addEventListener("mousedown", t, !0),
  9142. document.body.addEventListener("mouseup", i, !0),
  9143. document.getElementById("gui-parent").addEventListener(
  9144. "click",
  9145. function (e) {
  9146. e.syntheticClick ||
  9147. (e.stopPropagation(),
  9148. "A" === e.target.nodeName && e.preventDefault());
  9149. },
  9150. !0
  9151. );
  9152. }
  9153. var lastMoveScrollTime = 0; //add
  9154. var W,
  9155. j,
  9156. Y,
  9157. X,
  9158. Z,
  9159. q,
  9160. K = (e("three"), e("../util/ajax"), e("../util/browser")),
  9161. Q = e("../settings"),
  9162. J = e("../analytics"),
  9163. ee =
  9164. (e("../util/transitions"),
  9165. e("../util/camera"),
  9166. e("../util/logger")),
  9167. te = (e("../objects/Snapshot"), e("./helpManager")),
  9168. ie = e("./immersiveMode"),
  9169. ne = e("./loadingScreen"),
  9170. re = e("./landingScreen"),
  9171. oe = e("./playButton"),
  9172. ae = e("./populateModal"),
  9173. se = e("./memoryUsage"),
  9174. le = e("./closer/modalCloser"),
  9175. ce = e("./closer/ModalCloserEvent"),
  9176. he = e("./help/help"),
  9177. ue = e("./help/HelpEvent"),
  9178. de = e("./title/titleBar"),
  9179. pe = e("./title/TitleEvents"),
  9180. fe = e("./terms/terms"),
  9181. ge = e("./terms/TermsEvent"),
  9182. me = e("./title/tagToggle"),
  9183. ve = e("./tourInteraction"),
  9184. Ae = e("./vr/vrModal"),
  9185. ye = e("./vr/vrEvent"),
  9186. Ce = e("./sharing/modal"),
  9187. Ie = e("./webvr/webVRgui"),
  9188. Ee = e("./webvr/WebVrEvent"),
  9189. be = e("../controls/serializer"),
  9190. we = e("../enum/Keys"),
  9191. _e = e("../enum/Viewmode"),
  9192. Te = (e("../enum/BlackoutStyle"), e("../tag/Media/MediaEvent")),
  9193. xe =
  9194. (e("../enum/PathDiscardMode"),
  9195. e("../enum/PathDisplayMode"),
  9196. e("../enum/DirectorEvents"),
  9197. e("../enum/PlayerEvents")),
  9198. Se = e("../enum/ControlEvents"),
  9199. Me = e("./sharing/ShareEvents"),
  9200. Re = e("../localization/localize"),
  9201. Pe =
  9202. (e("../enum/Vectors"),
  9203. e("../enum/WarpStyle"),
  9204. e("../enum/AlignmentType"),
  9205. e("../enum/VROption")),
  9206. Oe = e("./konami"),
  9207. Le = e("../lib/dat.gui"),
  9208. De = new ee(i),
  9209. Ne = (e("../util/showcase"), e("../enum/ZoomEvents")),
  9210. Be = _e.DOLLHOUSE,
  9211. Fe = 0,
  9212. Ve = 0,
  9213. Ue = [".hideTarget"],
  9214. ke = null,
  9215. He = null,
  9216. Ge = !1,
  9217. ze = !1,
  9218. We = !1,
  9219. je = {
  9220. coBrand: {
  9221. visible: !0,
  9222. elements: [".co-brand", "#loaderCoBrand"],
  9223. },
  9224. help: {
  9225. visible: !0,
  9226. elements: [".nav-help", "#nav-help"],
  9227. },
  9228. tourControls: {
  9229. visible: !0,
  9230. elements: [".next", ".previous", "#play"],
  9231. },
  9232. highlight: {
  9233. visible: !0,
  9234. elements: ["#drawer", "#pullTab"],
  9235. },
  9236. share: {
  9237. visible: !0,
  9238. elements: [".socialButton", "#share"],
  9239. },
  9240. fullScreen: {
  9241. visible: !0,
  9242. elements: ["#gui-fullscreen"],
  9243. },
  9244. floors: {
  9245. visible: !0,
  9246. elements: [".gui-floor"],
  9247. },
  9248. },
  9249. Ye = (function () {
  9250. var e = document.getElementById("drawer");
  9251. return function () {
  9252. $("#player").height() < 400 &&
  9253. e.classList.contains("open") &&
  9254. a();
  9255. };
  9256. })(),
  9257. Xe = (function () {
  9258. var e = document.getElementById("meta-info");
  9259. return function () {
  9260. $("#player").height() < 400 &&
  9261. e.classList.contains("expand") &&
  9262. de.toggleMeta(!0);
  9263. };
  9264. })(),
  9265. Ze = (function (e) {
  9266. function t() {
  9267. u.classList.contains("expand") && de.toggleMeta(!0);
  9268. }
  9269. function i() {
  9270. fe.hide();
  9271. }
  9272. function n() {
  9273. he.close();
  9274. }
  9275. function r() {
  9276. Ae.dismiss();
  9277. }
  9278. function o() {
  9279. p.hasClass("open") && a(!0);
  9280. }
  9281. function l() {
  9282. Ce.hide();
  9283. }
  9284. function c() {
  9285. f.hasClass("open") && f.removeClass("open");
  9286. }
  9287. function h() {
  9288. d.classList.contains("fadeIn") &&
  9289. (d.classList.contains("landing")
  9290. ? re.dismissModal()
  9291. : d.classList.contains("tour") && ve.dismissModal());
  9292. }
  9293. var u = document.getElementById("meta-info"),
  9294. d = document.getElementById("interaction-modal"),
  9295. p = $("#drawer").eq(0),
  9296. f = $(".gui-floor").eq(0),
  9297. g = $(".vr-popup").eq(0);
  9298. return function (e) {
  9299. switch (e) {
  9300. case "info":
  9301. i(), n(), Ye(), l(), c(), r(), h();
  9302. break;
  9303. case "terms":
  9304. t(), n(), o(), l(), c(), r(), h();
  9305. break;
  9306. case "help":
  9307. t(), i(), l(), c(), r(), h();
  9308. break;
  9309. case "vr":
  9310. t(), i(), l(), c(), n(), h(), s(g) && o();
  9311. break;
  9312. case "highlights":
  9313. Xe(), i(), l(), c();
  9314. break;
  9315. case "share":
  9316. t(), i(), n(), c(), r(), h();
  9317. break;
  9318. case "floor":
  9319. i(), l(), r();
  9320. break;
  9321. case "view":
  9322. c(), l(), i(), r();
  9323. break;
  9324. case "tour":
  9325. i(), l(), c(), r();
  9326. break;
  9327. case "move":
  9328. i(), l(), c(), r();
  9329. break;
  9330. case "resize":
  9331. t(), Ye(), c();
  9332. break;
  9333. case "tag":
  9334. i(), n(), l(), c(), r();
  9335. }
  9336. };
  9337. })();
  9338. $(document).on(
  9339. "fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange",
  9340. function (e) {
  9341. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  9342. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  9343. setTimeout(function () {
  9344. $(".icon:visible").hide().show(0);
  9345. }, 100);
  9346. }
  9347. ),
  9348. $("#gui-fullscreen")
  9349. .find("a")
  9350. .on("click", function (e) {
  9351. l(e),
  9352. K.requestFullscreen($("body")[0]),
  9353. J.track("showcase_gui", {
  9354. gui_action: "click_enter_fullscreen",
  9355. interaction_source: "gui",
  9356. });
  9357. //czj
  9358. //W.reload()
  9359. }),
  9360. $("#gui-fullscreen-exit")
  9361. .find("a")
  9362. .on("click", function (e) {
  9363. l(e),
  9364. K.exitFullscreen(),
  9365. J.track("showcase_gui", {
  9366. gui_action: "click_exit_fullscreen",
  9367. interaction_source: "gui",
  9368. });
  9369. });
  9370. $(window)
  9371. .on("resize", function (e) {
  9372. var t = e.target.innerHeight,
  9373. i = e.target.innerWidth;
  9374. (t === X && i === Z) ||
  9375. (je.highlight.visible && w(),
  9376. Ze("resize"),
  9377. $(".pinTop.right").removeClass("hideUnderMeta"),
  9378. c(),
  9379. (X = t),
  9380. (Z = i));
  9381. })
  9382. .resize(),
  9383. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  9384. $("#pullTab").on("click", function (e) {
  9385. l(e),
  9386. $("#drawer").hasClass("open")
  9387. ? (J.trackAlways("showcase_gui", {
  9388. gui_action: "hide_highlight_reel",
  9389. }),
  9390. $(this)
  9391. .addClass("open")
  9392. .children("img")
  9393. .attr("src", "images/auto.png"))
  9394. : (J.trackAlways("showcase_gui", {
  9395. gui_action: "show_highlight_reel",
  9396. }),
  9397. $(this)
  9398. .removeClass("open")
  9399. .children("img")
  9400. .attr("src", "images/auto-suspend.png"));
  9401. a();
  9402. });
  9403. /***********************方奕卓 热点列表事件监听 ************************/
  9404. if (window.DATA.showHotListSta) {
  9405. $("#hotList").css("display", "");
  9406. $("#hotList").on("click", function (e) {
  9407. l(e);
  9408. var hotList = $("#hotListWrap")[0];
  9409. var isActive = hotList.classList.contains("hotListActive");
  9410. if (isActive) {
  9411. hotList.classList.remove("hotListActive");
  9412. this.classList.remove("active");
  9413. } else {
  9414. hotList.classList.add("hotListActive");
  9415. this.classList.add("active");
  9416. }
  9417. }),
  9418. $("#hotListContent ul").on("mouseover", function (e) {
  9419. l(e);
  9420. var target = e.target;
  9421. var hotList = document.getElementById("hotListWrap");
  9422. if (target.tagName === "SPAN") {
  9423. var targetParent = target.parentElement.parentElement;
  9424. if (target.offsetWidth + 116 >= targetParent.clientWidth) {
  9425. hotList.style.width = target.offsetWidth + 116 + "px";
  9426. } else {
  9427. hotList.style.width = "";
  9428. }
  9429. } else if (target.tagName === "LI") {
  9430. var targetParent = target.parentElement;
  9431. if (
  9432. target.children[0].offsetWidth + 116 >=
  9433. targetParent.clientWidth
  9434. ) {
  9435. hotList.style.width =
  9436. target.children[0].offsetWidth + 116 + "px";
  9437. } else {
  9438. hotList.style.width = "";
  9439. }
  9440. } else {
  9441. hotList.style.width = "";
  9442. }
  9443. });
  9444. $("#hotListContent ul").on("click", function (e) {
  9445. l(e);
  9446. this.preElem && this.preElem.classList.remove("active");
  9447. if (e.target.tagName === "SPAN") {
  9448. e.target.parentElement.classList.add("active");
  9449. e.target.parentElement.hot &&
  9450. e.target.parentElement.hot.examine(window.player, true); // 打开热点
  9451. this.preElem = e.target.parentElement;
  9452. } else {
  9453. e.target.classList.add("active");
  9454. e.target.hot && e.target.hot.examine(window.player, true); // 打开热点
  9455. this.preElem = e.target;
  9456. }
  9457. });
  9458. $("#hotListClose").on("click", function (e) {
  9459. l(e);
  9460. var hotList = $("#hotListWrap")[0];
  9461. hotList.classList.remove("hotListActive");
  9462. $("#hotListContent ul .active").removeClass("active");
  9463. $("#hotList")[0].classList.remove("active");
  9464. });
  9465. }
  9466. /*****************************************************************/
  9467. $("#more-menu-button").on("click", function (e) {
  9468. l(e);
  9469. var t = $("#more-menu");
  9470. t.toggleClass("open");
  9471. }),
  9472. (t.exports.init = S),
  9473. (t.exports.startLoading = x),
  9474. (t.exports.endLoading = d),
  9475. (t.exports.onProgress = u);
  9476. }).call(this, "/js/gui/gui.js");
  9477. },
  9478. {
  9479. "../analytics": 4,
  9480. "../controls/serializer": 14,
  9481. "../enum/AlignmentType": 17,
  9482. "../enum/BlackoutStyle": 18,
  9483. "../enum/ControlEvents": 21,
  9484. "../enum/DirectorEvents": 23,
  9485. "../enum/Keys": 30,
  9486. "../enum/PathDiscardMode": 38,
  9487. "../enum/PathDisplayMode": 39,
  9488. "../enum/PlayerEvents": 40,
  9489. "../enum/VROption": 47,
  9490. "../enum/Vectors": 50,
  9491. "../enum/Viewmode": 51,
  9492. "../enum/WarpStyle": 52,
  9493. "../enum/ZoomEvents": 53,
  9494. "../lib/dat.gui": 93,
  9495. "../localization/localize": 108,
  9496. "../tag/Media/MediaEvent": 131,
  9497. "../objects/Snapshot": 153,
  9498. "../settings": 166,
  9499. "../util/ajax": 181,
  9500. "../util/browser": 182,
  9501. "../util/camera": 183,
  9502. "../util/logger": 189,
  9503. "../util/showcase": 193,
  9504. "../util/transitions": 195,
  9505. "./closer/ModalCloserEvent": 61,
  9506. "./closer/modalCloser": 62,
  9507. "./help/HelpEvent": 66,
  9508. "./help/help": 67,
  9509. "./helpManager": 68,
  9510. "./immersiveMode": 69,
  9511. "./konami": 70,
  9512. "./landingScreen": 71,
  9513. "./loadingScreen": 72,
  9514. "./memoryUsage": 73,
  9515. "./playButton": 74,
  9516. "./populateModal": 75,
  9517. "./sharing/ShareEvents": 76,
  9518. "./sharing/modal": 77,
  9519. "./terms/TermsEvent": 78,
  9520. "./terms/terms": 79,
  9521. "./title/TitleEvents": 80,
  9522. "./title/tagToggle": 81,
  9523. "./title/titleBar": 82,
  9524. "./tourInteraction": 84,
  9525. "./vr/vrEvent": 85,
  9526. "./vr/vrModal": 87,
  9527. "./webvr/WebVrEvent": 88,
  9528. "./webvr/webVRgui": 89,
  9529. three: 217,
  9530. },
  9531. ],
  9532. 66: [
  9533. function (e, t, i) {
  9534. "use strict";
  9535. t.exports = Object.freeze({
  9536. OPENED: "help.opened",
  9537. CLOSED: "help.closed",
  9538. });
  9539. },
  9540. {},
  9541. ],
  9542. 67: [
  9543. function (e, t, i) {
  9544. "use strict";
  9545. function n() {
  9546. g.on("click", function (e) {
  9547. if (S && S !== l.TRANSITIONING) {
  9548. var t =
  9549. window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  9550. t && !M ? R.close() : r();
  9551. }
  9552. }),
  9553. w.on("click", function (e) {
  9554. R.close();
  9555. }),
  9556. E.on("click", function (e) {
  9557. S && S !== l.TRANSITIONING && (s(), o());
  9558. }),
  9559. b.on("click", function (e) {
  9560. s(), a();
  9561. });
  9562. }
  9563. function r() {
  9564. S &&
  9565. S !== l.TRANSITIONING &&
  9566. ((M = !0),
  9567. setTimeout(function () {
  9568. M = !1;
  9569. }, d.help.modalStayDuration),
  9570. R.emit(h.OPENED),
  9571. m.addClass("open " + S),
  9572. g.addClass("open"),
  9573. s(),
  9574. o(),
  9575. y.style.removeProperty
  9576. ? y.style.removeProperty("display")
  9577. : y.style.removeAttribute("display"),
  9578. y.classList.add("fadeIn"));
  9579. }
  9580. function o() {
  9581. E.addClass("underline-tab"),
  9582. u.fill(_, c.NAVIGATION, S),
  9583. m.addClass(S);
  9584. }
  9585. function a() {
  9586. b.addClass("underline-tab"),
  9587. u.fill(T, c.MORE_HELP),
  9588. m.addClass("more-help");
  9589. }
  9590. function s(e, t) {
  9591. m.removeClass(
  9592. "more-help " +
  9593. l.PANORAMA +
  9594. " " +
  9595. l.DOLLHOUSE +
  9596. " " +
  9597. l.FLOORPLAN +
  9598. " " +
  9599. l.OUTDOOR
  9600. ),
  9601. I.forEach(function (e) {
  9602. e.classList.remove("underline-tab");
  9603. });
  9604. }
  9605. var l = e("../../enum/Viewmode"),
  9606. c = e("../../enum/HelpModalType"),
  9607. h = e("./HelpEvent"),
  9608. u = (e("../helpManager"), e("./../populateModal")),
  9609. d = e("../../settings"),
  9610. p = e("../../util/common"),
  9611. f = e("events").EventEmitter,
  9612. g = $(".footer-help").eq(0),
  9613. m = $("#help-dialog").eq(0),
  9614. v = document.querySelector("#quick-logo"),
  9615. A = document.querySelector("#loaderCoBrand"),
  9616. y = document.querySelector("#help-dialog"),
  9617. C = document.querySelector(".footer"),
  9618. I = $(".help-tabs").children().toArray(),
  9619. E = $(".navigation-tab").eq(0),
  9620. b = $(".more-help-tab").eq(0),
  9621. w =
  9622. ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  9623. m.find(".close").eq(0)),
  9624. _ = m.find(".interactions").toArray(),
  9625. T = m.find(".ui-instructions").toArray(),
  9626. x = l.PANORAMA,
  9627. S = l.PANORAMA,
  9628. M = !1,
  9629. R = {
  9630. init: function (e, t) {
  9631. (S = t),
  9632. (x = t),
  9633. [y, A, v, C].forEach(function (e) {
  9634. e.classList.add(u.deviceType);
  9635. }),
  9636. n();
  9637. },
  9638. close: function () {
  9639. if (
  9640. m.hasClass("open") &&
  9641. (this.emit(h.CLOSED),
  9642. g.removeClass("open"),
  9643. m.removeClass("open"),
  9644. y.classList.contains("fadeIn"))
  9645. ) {
  9646. y.classList.remove("fadeIn");
  9647. var e = S === l.TRANSITIONING ? x : S;
  9648. u.clear(_, c.NAVIGATION, e);
  9649. }
  9650. },
  9651. updateMode: function (e) {
  9652. (x = S), (S = e);
  9653. },
  9654. };
  9655. p.extendObject(R, f.prototype), (t.exports = R);
  9656. },
  9657. {
  9658. "../../enum/HelpModalType": 28,
  9659. "../../enum/Viewmode": 51,
  9660. "../../settings": 166,
  9661. "../../util/common": 185,
  9662. "../helpManager": 68,
  9663. "./../populateModal": 75,
  9664. "./HelpEvent": 66,
  9665. events: 202,
  9666. },
  9667. ],
  9668. 68: [
  9669. function (e, t, i) {
  9670. (function (i) {
  9671. "use strict";
  9672. var n = e("../util/browser"),
  9673. r = e("./../util/logger"),
  9674. o = e("./../settings"),
  9675. a = new r(i),
  9676. s = (function () {
  9677. var e;
  9678. try {
  9679. return (
  9680. (e = window.localStorage.getItem("visitCount") || "0"),
  9681. (e = (parseFloat(e) + 1).toString()),
  9682. window.localStorage.setItem("visitCount", e),
  9683. a.debug("visitCount = " + e),
  9684. e
  9685. );
  9686. } catch (t) {
  9687. (e = "1"), a.debug("couldn't set local storage");
  9688. }
  9689. })(),
  9690. l = !1;
  9691. t.exports = {
  9692. isHelpDisabled: function () {
  9693. return "0" === n.valueFromHash("help", null) || l;
  9694. },
  9695. isLargeHelpEnabled: function () {
  9696. return (
  9697. ("1" === s || "1" === n.valueFromHash("help", null)) &&
  9698. !this.isHelpDisabled()
  9699. );
  9700. },
  9701. isSmallHelpEnabled: function () {
  9702. return (
  9703. "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  9704. );
  9705. },
  9706. isHelpEnabled: function () {
  9707. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled();
  9708. },
  9709. setAutoPlay: function (e) {
  9710. l = o.warp.auto >= 0 && e > 1;
  9711. },
  9712. };
  9713. }).call(this, "/js/gui/helpManager.js");
  9714. },
  9715. {
  9716. "../util/browser": 182,
  9717. "./../settings": 166,
  9718. "./../util/logger": 189,
  9719. },
  9720. ],
  9721. 69: [
  9722. function (e, t, i) {
  9723. "use strict";
  9724. function n(e, t, i, n) {
  9725. (F = n), r(e, t, i, F), o(), (N = t.mode);
  9726. }
  9727. function r(e, t, i, n) {
  9728. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function (t) {
  9729. e.controls[t].on(v.Move, a), e.controls[t].on(v.LongTap, c);
  9730. }),
  9731. M.on("mousewheel DOMMouseScroll", a),
  9732. i.on(m.TagActivated, a),
  9733. i.on(m.TagNavigation, a),
  9734. t.on(A.FlyingEnded, s),
  9735. t.on(A.ModeChanging, function (e, t) {
  9736. B = t !== C.PANORAMA && e !== C.PANORAMA;
  9737. }),
  9738. t.on(A.ModeChanged, function (e, i) {
  9739. (N = t.mode), i !== C.TRANSITIONING ? l() : a("modeChange");
  9740. }),
  9741. n.on(y.TourStart, function () {
  9742. (L = !0), a();
  9743. }),
  9744. n.on(y.TourEnd, function () {
  9745. (L = !1), l();
  9746. }),
  9747. n.on(y.ActionInterrupted, function () {
  9748. L = !1;
  9749. }),
  9750. R.addEventListener(
  9751. "touchend",
  9752. function () {
  9753. $("#pullTab").hasClass("opened") && !L && l();
  9754. },
  9755. !0
  9756. );
  9757. }
  9758. function o() {
  9759. p.isMobile()
  9760. ? (b.forEach(function (e) {
  9761. e.classList.add("mobile");
  9762. }),
  9763. w.click(l))
  9764. : (b.forEach(function (e) {
  9765. e.addEventListener(
  9766. "mouseleave",
  9767. function () {
  9768. !M.is(":hover") &&
  9769. b[0].classList.contains("detectHover") &&
  9770. l();
  9771. },
  9772. !0
  9773. );
  9774. }),
  9775. M.mouseleave(function () {
  9776. b[0].classList.contains("detectHover") && l();
  9777. }));
  9778. }
  9779. function a(e) {
  9780. D ||
  9781. (d(e) && _.hasClass("playing")) ||
  9782. (clearTimeout(O),
  9783. (P = !0),
  9784. g.close(),
  9785. h(e),
  9786. N !== C.DOLLHOUSE &&
  9787. N !== C.FLOORPLAN &&
  9788. ((x.hasClass("expand") && !S.hasClass("closed")) ||
  9789. 2 === p.valueFromHash("title", 1),
  9790. _.hasClass("playing") ||
  9791. (b.forEach(function (e) {
  9792. e.classList.add("detectHover");
  9793. }),
  9794. (O = setTimeout(l, f.immersive.timeToShowAgain)))));
  9795. }
  9796. function s() {
  9797. _.hasClass("playing") ||
  9798. (clearTimeout(O), (O = setTimeout(l, f.immersive.timeToShowAgain)));
  9799. }
  9800. function l() {
  9801. clearTimeout(O),
  9802. (P = !1),
  9803. I.forEach(function (e) {
  9804. e.classList.remove("drawerOpen");
  9805. }),
  9806. L ||
  9807. E.forEach(function (e) {
  9808. e.classList.remove("duringTour");
  9809. }),
  9810. b.forEach(function (e) {
  9811. e.classList.remove("detectHover");
  9812. });
  9813. }
  9814. function c() {
  9815. P ? l() : a(),
  9816. (D = !0),
  9817. setTimeout(function () {
  9818. D = !1;
  9819. }, f.immersive.uiStayDuration);
  9820. }
  9821. function h(e) {
  9822. !d(e) && L
  9823. ? E.forEach(function (e) {
  9824. e.classList.remove("drawerOpen"), e.classList.add("duringTour");
  9825. })
  9826. : _.hasClass("open")
  9827. ? E.forEach(function (e) {
  9828. e.classList.remove("duringTour"), e.classList.add("drawerOpen");
  9829. })
  9830. : B ||
  9831. N === C.FLOORPLAN ||
  9832. N === C.DOLLHOUSE ||
  9833. E.forEach(function (e) {
  9834. e.classList.add("fadeOut");
  9835. });
  9836. }
  9837. function u() {
  9838. T.hasClass("duringTour") || ((L = !1), a("gui"), l());
  9839. }
  9840. function d(e) {
  9841. return "mouse" === e || "touch" === e || "key" === e || "gui" === e;
  9842. }
  9843. var p = e("../util/browser"),
  9844. f = e("../settings"),
  9845. g = e("./help/help"),
  9846. m = e("../enum/tagEvents"),
  9847. v = e("../enum/ControlEvents"),
  9848. A = e("../enum/PlayerEvents"),
  9849. y = e("../enum/DirectorEvents"),
  9850. A = e("../enum/PlayerEvents"),
  9851. C = e("../enum/Viewmode"),
  9852. I = $(
  9853. ".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer"
  9854. ).toArray(),
  9855. E = $(".pinBottom-container, #drawer-container, .footer").toArray(),
  9856. b = $("#hover-bottom, #hover-top").toArray(),
  9857. w =
  9858. ($("#pullTab").eq(0),
  9859. $("#playHead").eq(0),
  9860. $(".pinBottom-container").eq(0)),
  9861. _ = $("#drawer").eq(0),
  9862. T = $("#drawer-container").eq(0),
  9863. x = $("#meta-info").eq(0),
  9864. S = $(".pinTop.left").eq(0),
  9865. M = $("#player").eq(0),
  9866. R = document.getElementById("pullTab"),
  9867. P = !1,
  9868. O = null,
  9869. L = !1,
  9870. D = !1,
  9871. N = null,
  9872. B = !1,
  9873. F = null;
  9874. (t.exports.init = n),
  9875. (t.exports.hideUi = a),
  9876. (t.exports.resetDrawer = u);
  9877. },
  9878. {
  9879. "../enum/ControlEvents": 21,
  9880. "../enum/DirectorEvents": 23,
  9881. "../enum/tagEvents": 32,
  9882. "../enum/PlayerEvents": 40,
  9883. "../enum/Viewmode": 51,
  9884. "../settings": 166,
  9885. "../util/browser": 182,
  9886. "./help/help": 67,
  9887. },
  9888. ],
  9889. 70: [
  9890. function (e, t, i) {
  9891. (function (i) {
  9892. "use strict";
  9893. function n(e, t, i) {
  9894. l.debug("konami has the modelInstance");
  9895. var n = [];
  9896. $(window).on("keydown", function (e) {
  9897. n.push(e.which),
  9898. n.length > o.secretPanelWord.length && n.shift(),
  9899. s.equalLists(n, o.secretPanelWord) &&
  9900. (l.debug("Developer mode active."), (o.debug = !0));
  9901. }),
  9902. $(window).on("keydown", function n(r) {
  9903. o.debug &&
  9904. 72 === r.which &&
  9905. (e && i
  9906. ? (a.toggle(e, t, i), $(window).off("keydown", n))
  9907. : console.warn("sorry we're not ready yet"));
  9908. });
  9909. }
  9910. var r = e("./../util/logger"),
  9911. o = e("./../settings"),
  9912. a = e("./debug"),
  9913. s = e("./../util/common"),
  9914. l = (e("./gui"), new r(i));
  9915. o.console && $("body").append('<div id="debug-console"></div>'),
  9916. (t.exports.init = n);
  9917. }).call(this, "/js/gui/konami.js");
  9918. },
  9919. {
  9920. "./../settings": 166,
  9921. "./../util/common": 185,
  9922. "./../util/logger": 189,
  9923. "./debug": 63,
  9924. "./gui": 65,
  9925. },
  9926. ],
  9927. 71: [
  9928. function (e, t, i) {
  9929. "use strict";
  9930. function n(e, t) {
  9931. E =
  9932. t.mode === p.PANORAMA && t.pano && !t.pano.isAligned()
  9933. ? p.OUTDOOR
  9934. : t.mode;
  9935. }
  9936. function r(e) {
  9937. var t = $.Deferred();
  9938. e || t.resolve();
  9939. var i = c.startupFlyinDelay;
  9940. return (
  9941. e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  9942. setTimeout(t.resolve.bind(t), i),
  9943. t
  9944. );
  9945. }
  9946. function o(e, t, i) {
  9947. var n = 0;
  9948. c.quickstart.enabled &&
  9949. (a(i),
  9950. (n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay));
  9951. var r = function () {
  9952. e.once(g.Move, l), t.once(f.TourStart, l);
  9953. };
  9954. s(n, r);
  9955. }
  9956. function a(e) {
  9957. return; /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  9958. v.before(y),
  9959. A = $(".quick-brand").toArray()),*/
  9960. m.addClass("fadeOut"),
  9961. setTimeout(function () {
  9962. A.forEach(function (e) {
  9963. e.classList.add("fadeIn");
  9964. });
  9965. }, c.quickstart.showTextDelay),
  9966. setTimeout(function () {
  9967. A.forEach(function (e) {
  9968. e.classList.add("fadeOut");
  9969. });
  9970. }, c.quickstart.fadeOutDelay),
  9971. !0;
  9972. }
  9973. function s(e, t) {
  9974. setTimeout(function () {
  9975. if (h.isHelpEnabled()) {
  9976. if (
  9977. (t(),
  9978. u.init(),
  9979. C.addClass("fadeIn landing " + u.deviceType),
  9980. h.isSmallHelpEnabled())
  9981. )
  9982. return void C.addClass("small");
  9983. u.fill(I, d.LANDING[E]), C.addClass(E);
  9984. }
  9985. }, e);
  9986. //csz 用户引导界面
  9987. var helpData = {
  9988. pc: [
  9989. "images/pc_step1.png",
  9990. "images/pc_step2.png",
  9991. "images/pc_step3.png",
  9992. ],
  9993. mobile: [
  9994. "images/phone_step1.png",
  9995. "images/phone_step2.png",
  9996. "images/phone_step3.png",
  9997. ],
  9998. };
  9999. var navIcon = $(".nav-icon .icon");
  10000. if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent))
  10001. navIcon.attr("src", helpData.mobile[0]);
  10002. function paging(id) {
  10003. id.on("click", function () {
  10004. var navPage = null;
  10005. $(this).attr("data-id") == "plus"
  10006. ? (navPage = +navIcon.attr("data-page") + 1)
  10007. : (navPage = +navIcon.attr("data-page") - 1);
  10008. if (navPage > helpData.length || navPage < 1) return false;
  10009. if (
  10010. /Android|webOS|iPhone|iPod|BlackBerry/i.test(
  10011. navigator.userAgent
  10012. )
  10013. ) {
  10014. navIcon.attr({
  10015. "data-page": navPage,
  10016. src: helpData.mobile[navPage - 1],
  10017. });
  10018. } else {
  10019. navIcon.attr({
  10020. "data-page": navPage,
  10021. src: helpData.pc[navPage - 1],
  10022. });
  10023. }
  10024. });
  10025. }
  10026. paging($(".next-button"));
  10027. paging($(".prev-button"));
  10028. }
  10029. function l() {
  10030. u.clear(I, d.LANDING[E]), C.removeClass("fadeIn");
  10031. }
  10032. var c = e("../settings"),
  10033. h = (e("./help/help"), e("./helpManager")),
  10034. u = e("./populateModal"),
  10035. d = e("../enum/HelpModalType"),
  10036. p = e("../enum/Viewmode"),
  10037. f = e("../enum/DirectorEvents"),
  10038. g = e("../enum/PlayerEvents"),
  10039. m = $("#quick-blackout").eq(0),
  10040. v = $("#quick-logo").eq(0),
  10041. A = $(".quick-brand").toArray(),
  10042. y = $("#loaderCoBrand").eq(0),
  10043. C = $("#interaction-modal").eq(0),
  10044. I = C.find(".interaction").toArray(),
  10045. E =
  10046. ($(
  10047. "#model-title, .pinBottom-container, #drawer-container, #drawer, .footer"
  10048. ).toArray(),
  10049. "");
  10050. (t.exports.delayLanding = r),
  10051. (t.exports.showMessage = o),
  10052. (t.exports.init = n),
  10053. (t.exports.dismissModal = l);
  10054. },
  10055. {
  10056. "../enum/DirectorEvents": 23,
  10057. "../enum/HelpModalType": 28,
  10058. "../enum/PlayerEvents": 40,
  10059. "../enum/Viewmode": 51,
  10060. "../settings": 166,
  10061. "./help/help": 67,
  10062. "./helpManager": 68,
  10063. "./populateModal": 75,
  10064. },
  10065. ],
  10066. 72: [
  10067. function (e, t, i) {
  10068. "use strict";
  10069. var n = e("./circleLoader").circleLoader;
  10070. t.exports = {
  10071. element: $("#gui-loading"),
  10072. hide: function (e) {
  10073. n.done(), this.element.fadeOut(1500, e);
  10074. },
  10075. show: function (e) {
  10076. this.element.fadeIn(
  10077. 500,
  10078. function () {
  10079. this.element.css("display", "table"), e && e();
  10080. }.bind(this)
  10081. );
  10082. },
  10083. progress: function (e) {
  10084. n.set(e);
  10085. },
  10086. };
  10087. },
  10088. {
  10089. "./circleLoader": 60,
  10090. },
  10091. ],
  10092. 73: [
  10093. function (e, t, i) {
  10094. "use strict";
  10095. var n = e("../settings"),
  10096. r = $("#memory-info"),
  10097. o = r.find("#memory-gpu"),
  10098. a = !1;
  10099. t.exports = {
  10100. show: function () {
  10101. n.profiling.enabled && (r.show(), (a = !0));
  10102. },
  10103. hide: function () {
  10104. r.hide(), (a = !1);
  10105. },
  10106. toggle: function () {
  10107. a ? this.hide() : this.show();
  10108. },
  10109. update: function (e) {
  10110. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB");
  10111. },
  10112. };
  10113. },
  10114. {
  10115. "../settings": 166,
  10116. },
  10117. ],
  10118. 74: [
  10119. function (e, t, i) {
  10120. "use strict";
  10121. var n = e("../util/browser"),
  10122. r = e("../analytics");
  10123. e("../settings");
  10124. t.exports = {
  10125. show: function (e, t) {
  10126. $("#gui-message").fadeOut(500, function () {
  10127. t();
  10128. });
  10129. },
  10130. };
  10131. },
  10132. {
  10133. "../analytics": 4,
  10134. "../settings": 166,
  10135. "../util/browser": 182,
  10136. },
  10137. ],
  10138. 75: [
  10139. function (e, t, i) {
  10140. "use strict";
  10141. function n(e, t, i, n) {
  10142. function r(e) {
  10143. return e.classList.contains(a);
  10144. }
  10145. var o = i
  10146. ? this.assets[t][i][this.deviceType]
  10147. : this.assets[t][this.deviceType];
  10148. //for (var a in o) {
  10149. //var s = e.find(r);
  10150. //for (var l in o[a]) {
  10151. //var c = o[a][l];
  10152. //if ("top-info" === l || "bottom-info" === l) {
  10153. //var h = n ? c : "";
  10154. //czj 注释掉第一次打开的用户引导
  10155. //s.querySelector("." + l).textContent = h
  10156. //} else {
  10157. //var u = n ? c : "";
  10158. //, d = s.querySelector("." + l);
  10159. //d.src = u,
  10160. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  10161. //}
  10162. //}
  10163. //}
  10164. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  10165. // p.forEach(function(e) {
  10166. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  10167. // })
  10168. }
  10169. var r = e("../util/browser"),
  10170. o = e("../localization/localize"),
  10171. a = e("../enum/HelpModalType"),
  10172. s = (e("../enum/HelpModalSize"), e("../enum/Viewmode"));
  10173. t.exports = {
  10174. init: function () {
  10175. if (!this.hasInitialized) {
  10176. (this.hasInitialized = !0),
  10177. (this.deviceType = r.isMobile() ? "mobile" : "desktop"),
  10178. (this.assets = {}),
  10179. (this.assets[a.LANDING[s.PANORAMA]] = {
  10180. desktop: {
  10181. left: {
  10182. "top-info": o.ROTATE,
  10183. "big-image": "images/nav_help_mouse_drag_left.png",
  10184. keyboard: "images/nav_help_keyboard_left_right.png",
  10185. },
  10186. middle: {
  10187. "top-info": o.MOVE,
  10188. "big-image": "images/nav_help_mouse_click.png",
  10189. keyboard: "images/nav_help_keyboard_up_down.png",
  10190. },
  10191. right: {
  10192. "top-info": o.ZOOM,
  10193. "big-image": "images/nav_help_mouse_zoom.png",
  10194. keyboard: "images/nav_help_zoom_keys.png",
  10195. },
  10196. },
  10197. mobile: {
  10198. left: {
  10199. "top-info": o.ROTATE,
  10200. "big-image": "images/nav_help_gesture_drag.png",
  10201. },
  10202. middle: {
  10203. "top-info": o.MOVE,
  10204. "big-image": "images/nav_help_gesture_tap.png",
  10205. },
  10206. right: {
  10207. "top-info": o.ZOOM,
  10208. "big-image": "images/nav_help_gesture_pinch.png",
  10209. },
  10210. },
  10211. }),
  10212. (this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(
  10213. JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])
  10214. )),
  10215. (this.assets[a.LANDING[s.DOLLHOUSE]] = {
  10216. desktop: {
  10217. left: {
  10218. "top-info": o.ROTATE,
  10219. "big-image": "images/nav_help_mouse_drag_left.png",
  10220. keyboard: "images/nav_help_keyboard_left_right.png",
  10221. },
  10222. middle: {
  10223. "top-info": o.MOVE,
  10224. "big-image": "images/nav_help_mouse_position_right.png",
  10225. },
  10226. },
  10227. mobile: {
  10228. left: {
  10229. "top-info": o.ROTATE,
  10230. "big-image": "images/nav_help_gesture_drag.png",
  10231. },
  10232. middle: {
  10233. "top-info": o.MOVE,
  10234. "big-image":
  10235. "images/nav_help_gesture_position_two_finger.png",
  10236. },
  10237. },
  10238. }),
  10239. (this.assets[a.LANDING[s.FLOORPLAN]] = {
  10240. desktop: {
  10241. left: {
  10242. "top-info": o.MOVE,
  10243. "big-image": "images/nav_help_mouse_position_left.png",
  10244. },
  10245. middle: {
  10246. "top-info": o.ROTATE,
  10247. "big-image": "images/nav_help_mouse_drag_right.png",
  10248. keyboard: "images/nav_help_keyboard_left_right.png",
  10249. },
  10250. },
  10251. mobile: {
  10252. left: {
  10253. "top-info": o.MOVE,
  10254. "big-image": "images/nav_help_gesture_position.png",
  10255. },
  10256. middle: {
  10257. "top-info": o.ROTATE,
  10258. "big-image":
  10259. "images/nav_help_gesture_drag_two_finger.png",
  10260. },
  10261. },
  10262. });
  10263. var e = {
  10264. "top-info": o.INSIDE,
  10265. "big-image": "images/nav_help_click_inside.png",
  10266. keyboard: "images/nav_help_inside_key.png",
  10267. };
  10268. (this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e),
  10269. (this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e),
  10270. (this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e);
  10271. var t = {
  10272. "top-info": o.INSIDE,
  10273. "big-image": "images/nav_help_tap_inside.png",
  10274. };
  10275. (this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t),
  10276. (this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t),
  10277. (this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t),
  10278. (this.assets[a.NAVIGATION] = {}),
  10279. (this.assets[a.NAVIGATION][s.PANORAMA] = {
  10280. desktop: {
  10281. left: {
  10282. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  10283. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  10284. "big-image": "images/nav_help_mouse_drag_left.png",
  10285. keyboard: "images/nav_help_keyboard_left_right.png",
  10286. },
  10287. middle: {
  10288. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  10289. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  10290. "big-image": "images/nav_help_mouse_click.png",
  10291. keyboard: "images/nav_help_keyboard_up_down.png",
  10292. },
  10293. right: {
  10294. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  10295. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  10296. "big-image": "images/nav_help_mouse_zoom.png",
  10297. keyboard: "images/nav_help_zoom_keys.png",
  10298. },
  10299. },
  10300. mobile: {
  10301. left: {
  10302. "top-info": o.HELP_MOBILE_PANORAMA_1,
  10303. "big-image": "images/nav_help_gesture_drag.png",
  10304. },
  10305. middle: {
  10306. "top-info": o.HELP_MOBILE_PANORAMA_2,
  10307. "big-image": "images/nav_help_gesture_tap.png",
  10308. },
  10309. right: {
  10310. "top-info": o.HELP_MOBILE_3,
  10311. "big-image": "images/nav_help_gesture_pinch.png",
  10312. },
  10313. },
  10314. }),
  10315. (this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  10316. desktop: {
  10317. left: {
  10318. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  10319. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  10320. "big-image": "images/nav_help_mouse_drag_left.png",
  10321. keyboard: "images/nav_help_keyboard_all.png",
  10322. },
  10323. middle: {
  10324. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  10325. "big-image": "images/nav_help_mouse_position_right.png",
  10326. },
  10327. right: {
  10328. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  10329. "big-image": "images/nav_help_mouse_zoom.png",
  10330. },
  10331. },
  10332. mobile: {
  10333. left: {
  10334. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  10335. "big-image": "images/nav_help_gesture_drag.png",
  10336. },
  10337. middle: {
  10338. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  10339. "big-image":
  10340. "images/nav_help_gesture_position_two_finger.png",
  10341. },
  10342. right: {
  10343. "top-info": o.HELP_MOBILE_3,
  10344. "big-image": "images/nav_help_gesture_pinch.png",
  10345. },
  10346. },
  10347. }),
  10348. (this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  10349. desktop: {
  10350. left: {
  10351. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  10352. "big-image": "images/nav_help_mouse_position_left.png",
  10353. },
  10354. middle: {
  10355. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  10356. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  10357. "big-image": "images/nav_help_mouse_drag_right.png",
  10358. keyboard: "images/nav_help_keyboard_left_right.png",
  10359. },
  10360. right: {
  10361. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  10362. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  10363. "big-image": "images/nav_help_mouse_zoom.png",
  10364. keyboard: "images/nav_help_keyboard_up_down.png",
  10365. },
  10366. },
  10367. mobile: {
  10368. left: {
  10369. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  10370. "big-image": "images/nav_help_gesture_position.png",
  10371. },
  10372. middle: {
  10373. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  10374. "big-image":
  10375. "images/nav_help_gesture_drag_two_finger.png",
  10376. },
  10377. right: {
  10378. "top-info": o.HELP_MOBILE_3,
  10379. "big-image": "images/nav_help_gesture_pinch.png",
  10380. },
  10381. },
  10382. }),
  10383. (this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(
  10384. JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])
  10385. )),
  10386. (this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  10387. "top-info": o.HELP_DESKTOP_360_2A,
  10388. "bottom-info": o.HELP_DESKTOP_360_2B,
  10389. "big-image": "images/nav_help_click_inside.png",
  10390. keyboard: "images/nav_help_inside_key.png",
  10391. }),
  10392. (this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  10393. "top-info": o.HELP_MOBILE_360_2,
  10394. "big-image": "images/nav_help_tap_inside.png",
  10395. }),
  10396. (this.assets[a.MORE_HELP] = {
  10397. desktop: {
  10398. "more-help-hlr": {
  10399. "top-info": o.HELP_MORE_HLR_A,
  10400. "big-image": "images/nav_help_expand.svg",
  10401. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B,
  10402. },
  10403. "more-help-dollhouse": {
  10404. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  10405. "big-image": "images/nav_help_dollhouse.svg",
  10406. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B,
  10407. },
  10408. "more-help-floors": {
  10409. "top-info": o.HELP_MORE_FLOORS_A,
  10410. "big-image": "images/nav_help_floor picker.svg",
  10411. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B,
  10412. },
  10413. "more-help-tag": {
  10414. "top-info": o.HELP_MORE_TAG_A,
  10415. "big-image": "images/nav_help_tag.svg",
  10416. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B,
  10417. },
  10418. "more-help-zoom": {
  10419. "top-info": o.HELP_MORE_ZOOM_A,
  10420. "big-image": "images/nav_help_zoom.svg",
  10421. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B,
  10422. },
  10423. "more-help-tour": {
  10424. "top-info": o.HELP_MORE_TOUR_A,
  10425. "big-image": "images/nav_help_play.png",
  10426. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B,
  10427. },
  10428. "more-help-inside": {
  10429. "top-info": o.HELP_MORE_INSIDE_A,
  10430. "big-image": "images/nav_help_inside.svg",
  10431. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B,
  10432. },
  10433. "more-help-vr": {
  10434. "top-info": o.HELP_MORE_VR_A,
  10435. "big-image": "images/nav_help_vr.svg",
  10436. "bottom-info": o.HELP_DESKTOP_MORE_VR_B,
  10437. },
  10438. "more-help-360": {
  10439. "top-info": o.HELP_MORE_360_A,
  10440. "big-image": "images/nav_help_360.svg",
  10441. "bottom-info": o.HELP_DESKTOP_MORE_360_B,
  10442. },
  10443. "more-help-fullscreen": {
  10444. "top-info": o.HELP_MORE_FULLSCREEN_A,
  10445. "big-image": "images/nav_help_fullscreen.svg",
  10446. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B,
  10447. },
  10448. },
  10449. mobile: {
  10450. "more-help-hlr": {
  10451. "top-info": o.HELP_MORE_HLR_A,
  10452. "big-image": "images/nav_help_expand.svg",
  10453. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B,
  10454. },
  10455. "more-help-dollhouse": {
  10456. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  10457. "big-image": "images/nav_help_dollhouse.svg",
  10458. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B,
  10459. },
  10460. "more-help-floors": {
  10461. "top-info": o.HELP_MORE_FLOORS_A,
  10462. "big-image": "images/nav_help_floor picker.svg",
  10463. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B,
  10464. },
  10465. "more-help-tag": {
  10466. "top-info": o.HELP_MORE_TAG_A,
  10467. "big-image": "images/nav_help_tag.svg",
  10468. "bottom-info": o.HELP_MOBILE_MORE_TAG_B,
  10469. },
  10470. "more-help-tour": {
  10471. "top-info": o.HELP_MORE_TOUR_A,
  10472. "big-image": "images/nav_help_play.png",
  10473. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B,
  10474. },
  10475. "more-help-inside": {
  10476. "top-info": o.HELP_MORE_INSIDE_A,
  10477. "big-image": "images/nav_help_inside.svg",
  10478. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B,
  10479. },
  10480. "more-help-vr": {
  10481. "top-info": o.HELP_MORE_VR_A,
  10482. "big-image": "images/webvr.svg",
  10483. "bottom-info": o.HELP_MOBILE_MORE_VR_B,
  10484. },
  10485. "more-help-360": {
  10486. "top-info": o.HELP_MORE_360_A,
  10487. "big-image": "images/nav_help_360.svg",
  10488. "bottom-info": o.HELP_MOBILE_MORE_360_B,
  10489. },
  10490. },
  10491. }),
  10492. (this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  10493. desktop: {
  10494. left: {
  10495. "top-info": o.ROTATE,
  10496. "big-image": "images/nav_help_mouse_drag_left.png",
  10497. keyboard: "images/nav_help_keyboard_left_right.png",
  10498. },
  10499. middle: {
  10500. "top-info": o.MOVE,
  10501. "big-image": "images/nav_help_mouse_click.png",
  10502. keyboard: "images/nav_help_keyboard_up_down.png",
  10503. },
  10504. right: {
  10505. "top-info": o.PLAY,
  10506. "big-image": "images/Desktop-help-play-button.svg",
  10507. keyboard: "images/Desktop-help-spacebar-2.svg",
  10508. },
  10509. },
  10510. mobile: {
  10511. left: {
  10512. "top-info": o.ROTATE,
  10513. "big-image": "images/nav_help_gesture_drag.png",
  10514. },
  10515. middle: {
  10516. "top-info": o.MOVE,
  10517. "big-image": "images/nav_help_gesture_tap.png",
  10518. },
  10519. right: {
  10520. "top-info": o.PLAY,
  10521. "big-image": "images/mobile-help-play-button.svg",
  10522. },
  10523. },
  10524. }),
  10525. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(
  10526. JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])
  10527. )),
  10528. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle =
  10529. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle),
  10530. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle =
  10531. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle),
  10532. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(
  10533. JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])
  10534. )),
  10535. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left =
  10536. this.assets[a.LANDING[s.FLOORPLAN]].desktop.left),
  10537. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left =
  10538. this.assets[a.LANDING[s.FLOORPLAN]].mobile.left);
  10539. }
  10540. },
  10541. fill: function (e, t, i) {
  10542. n.call(this, e, t, i, !0);
  10543. },
  10544. clear: function (e, t, i) {
  10545. n.call(this, e, t, i, !1);
  10546. },
  10547. };
  10548. },
  10549. {
  10550. "../enum/HelpModalSize": 27,
  10551. "../enum/HelpModalType": 28,
  10552. "../enum/Viewmode": 51,
  10553. "../localization/localize": 108,
  10554. "../util/browser": 182,
  10555. },
  10556. ],
  10557. 76: [
  10558. function (e, t, i) {
  10559. "use strict";
  10560. t.exports = Object.freeze({
  10561. OPENED: "share.open",
  10562. CLOSED: "share.closed",
  10563. LINK_CLICKED: "share.linked",
  10564. });
  10565. },
  10566. {},
  10567. ],
  10568. 77: [
  10569. function (e, t, i) {
  10570. "use strict";
  10571. function n(e) {
  10572. function t(t, i) {
  10573. var n = window.screenY + ($("#player").height() - i) / 2,
  10574. r = window.screenX + ($("#player").width() - t) / 2,
  10575. o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  10576. I.emit(l.LINK_CLICKED, {
  10577. channel: e,
  10578. }),
  10579. window.open(C[e], "shareWindow", o);
  10580. }
  10581. switch (e) {
  10582. case y.FACEBOOK:
  10583. t(580, 420);
  10584. break;
  10585. case y.TWITTER:
  10586. t(550, 440);
  10587. break;
  10588. case y.MAIL:
  10589. I.emit(l.LINK_CLICKED, {
  10590. channel: "email",
  10591. }),
  10592. window.open(C[e], "_blank");
  10593. break;
  10594. case y.LINKEDIN:
  10595. }
  10596. }
  10597. function r(e) {
  10598. I.emit(l.LINK_CLICKED, {
  10599. channel: "copylink",
  10600. });
  10601. var t = document.createRange();
  10602. t.selectNodeContents(v);
  10603. var i = window.getSelection();
  10604. i.removeAllRanges(),
  10605. i.addRange(t),
  10606. document.execCommand("copy"),
  10607. A.classList.remove("hidden"),
  10608. v.classList.add("highlighted");
  10609. }
  10610. function o(e) {
  10611. (e && (e.stopPropagation(), e.target === v)) ||
  10612. (window.getSelection().removeAllRanges(),
  10613. v.classList.remove("highlighted"),
  10614. A.classList.add("hidden"));
  10615. }
  10616. var a = e("../../util/browser"),
  10617. s = e("../../localization/localize"),
  10618. l = e("./ShareEvents"),
  10619. c = e("../../util/common"),
  10620. h = e("events").EventEmitter,
  10621. u = document.getElementById("sharing"),
  10622. d = document.getElementById("share-modal"),
  10623. p = document.getElementById("share-close"),
  10624. f = document.getElementById("facebook-share"),
  10625. g = document.getElementById("twitter-share"),
  10626. m = document.getElementById("mail-share"),
  10627. v = document.getElementById("share-url-text"),
  10628. A = document.getElementById("copy-success"),
  10629. y = Object.freeze({
  10630. FACEBOOK: "facebook",
  10631. TWITTER: "twitter",
  10632. MAIL: "mail",
  10633. LINKEDIN: "linkedin",
  10634. }),
  10635. C = {};
  10636. (C[y.FACEBOOK] =
  10637. "http://www.facebook.com/sharer.php?u=" +
  10638. encodeURIComponent(window.location.href + "&utm_source=1") +
  10639. "&t="),
  10640. (C[y.TWITTER] = "http://twitter.com/intent/tweet?text="),
  10641. (C[y.MAIL] = "mailto:?subject=");
  10642. var I = {
  10643. init: function (e) {
  10644. var t = encodeURIComponent(
  10645. s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " "
  10646. );
  10647. (C[y.FACEBOOK] +=
  10648. t + encodeURIComponent(window.location.href + "&utm_source=1")),
  10649. (C[y.TWITTER] +=
  10650. t +
  10651. encodeURIComponent(
  10652. window.location.href +
  10653. "&utm_source=2 " +
  10654. s.SHARE_WITH +
  10655. " #port"
  10656. )),
  10657. (C[y.MAIL] +=
  10658. encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) +
  10659. "&body=" +
  10660. t +
  10661. encodeURIComponent(window.location.href + "&utm_source=3")),
  10662. u.addEventListener("click", this.toggle.bind(this)),
  10663. p.addEventListener("click", this.hide.bind(this)),
  10664. v.addEventListener("click", r),
  10665. d.addEventListener("click", o),
  10666. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  10667. g.addEventListener("click", n.bind(this, y.TWITTER)),
  10668. m.addEventListener("click", n.bind(this, y.MAIL)),
  10669. (v.textContent = window.location.href + "&utm_source=4"),
  10670. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  10671. u.classList.remove("hidden");
  10672. },
  10673. show: function () {
  10674. this.emit(l.OPENED), d.classList.add("fadeIn");
  10675. },
  10676. hide: function () {
  10677. d.classList.contains("fadeIn") &&
  10678. (this.emit(l.CLOSED),
  10679. document.selection && document.selection.empty(),
  10680. window.getSelection().removeAllRanges(),
  10681. o(),
  10682. d.classList.remove("fadeIn"));
  10683. },
  10684. toggle: function () {
  10685. d.classList.contains("fadeIn") ? this.hide() : this.show();
  10686. },
  10687. };
  10688. c.extendObject(I, h.prototype), (t.exports = I);
  10689. },
  10690. {
  10691. "../../localization/localize": 108,
  10692. "../../util/browser": 182,
  10693. "../../util/common": 185,
  10694. "./ShareEvents": 76,
  10695. events: 202,
  10696. },
  10697. ],
  10698. 78: [
  10699. function (e, t, i) {
  10700. "use strict";
  10701. t.exports = Object.freeze({
  10702. OPENED: "terms.opened",
  10703. CLOSED: "terms.closed",
  10704. });
  10705. },
  10706. {},
  10707. ],
  10708. 79: [
  10709. function (e, t, i) {
  10710. "use strict";
  10711. var n = e("./TermsEvent"),
  10712. r = e("../../localization/localize"),
  10713. o = e("../../analytics"),
  10714. a = e("../../util/ajax"),
  10715. s = e("../../util/common"),
  10716. l = e("events").EventEmitter,
  10717. c = document.getElementById("terms-modal"),
  10718. h = {
  10719. init: function () {
  10720. $(".footer-terms").on(
  10721. "click",
  10722. function (e) {
  10723. e.preventDefault(), this.show();
  10724. }.bind(this)
  10725. ),
  10726. $("#terms-modal .close").on("click", this.hide.bind(this));
  10727. },
  10728. show: function () {
  10729. this.emit(n.OPENED),
  10730. a
  10731. .get("static/" + r.TERMS_TEXT_FILE)
  10732. .done(function (e) {
  10733. var t = $("#terms-text").html(e);
  10734. o.track("showcase_gui", {
  10735. gui_action: "click_terms_button",
  10736. interaction_source: "gui",
  10737. }),
  10738. t.find("a").attr("target", "_blank");
  10739. })
  10740. .fail(function () {
  10741. $("#terms-text").html(
  10742. "<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL
  10743. );
  10744. }),
  10745. c.classList.add("fadeIn");
  10746. },
  10747. hide: function (e) {
  10748. e && e.preventDefault(),
  10749. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  10750. c.classList.remove("fadeIn");
  10751. },
  10752. };
  10753. s.extendObject(h, l.prototype), (t.exports = h);
  10754. },
  10755. {
  10756. "../../analytics": 4,
  10757. "../../localization/localize": 108,
  10758. "../../util/ajax": 181,
  10759. "../../util/common": 185,
  10760. "./TermsEvent": 78,
  10761. events: 202,
  10762. },
  10763. ],
  10764. 80: [
  10765. function (e, t, i) {
  10766. "use strict";
  10767. t.exports = Object.freeze({
  10768. OPEN_INFO: "title.open.info",
  10769. CLOSE_INFO: "title.close.info",
  10770. SHOW_INFO: "title.show.info",
  10771. HIDE_INFO: "title.hide.info",
  10772. LINK_CLICKED: "title.link.click",
  10773. CONTACT_LINK_CLICKED: "title.contact.click",
  10774. ORIGIN_LINK_CLICKED: "title.origin.click",
  10775. });
  10776. },
  10777. {},
  10778. ],
  10779. 81: [
  10780. function (e, t, i) {
  10781. "use strict";
  10782. function n(e, t) {
  10783. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t);
  10784. }
  10785. function r(e, t) {
  10786. function i(i) {
  10787. (e.shouldShowtags = "show" === this.value),
  10788. e.shouldShowtags
  10789. ? t.showAlltags(o.tags.startup.fadeInDuration)
  10790. : t.hideAlltags(o.tags.startup.fadeInDuration);
  10791. }
  10792. document.getElementById("tag-toggles").classList.remove("hidden"),
  10793. (document.getElementById("radio-tag-show").checked = !0);
  10794. for (
  10795. var n = document
  10796. .getElementById("tag-inputs")
  10797. .querySelectorAll("input"),
  10798. r = 0;
  10799. r < n.length;
  10800. r++
  10801. )
  10802. n[r].addEventListener("change", i);
  10803. }
  10804. var o = e("../../settings");
  10805. t.exports.init = n;
  10806. },
  10807. {
  10808. "../../settings": 166,
  10809. },
  10810. ],
  10811. 82: [
  10812. function (e, t, i) {
  10813. (function (i) {
  10814. "use strict";
  10815. function n(e, t) {
  10816. return e &&
  10817. u.valueFromHash("title", 1) &&
  10818. 2 !== u.valueFromHash("mls", 0)
  10819. ? ((document.getElementsByClassName("titleText")[0].innerText =
  10820. e),
  10821. (g_weixinObj.title = e),
  10822. e.length > g.minTooltipCharacters &&
  10823. I.parentElement.setAttribute("data-original-title", e),
  10824. t && 1 !== m.specialEdition && m.brand && !m.mls
  10825. ? (document.getElementById("cobrandTitle").innerText = t)
  10826. : (document
  10827. .getElementsByClassName("co-brand")[0]
  10828. .classList.add("hidden"),
  10829. document
  10830. .getElementById("gui-name")
  10831. .classList.add("noCoBrand"),
  10832. document
  10833. .getElementById("cobrandTitle")
  10834. .classList.add("hidden")),
  10835. !0)
  10836. : (document.getElementById("model-title").classList.add("hidden"),
  10837. !1);
  10838. }
  10839. function r(e) {
  10840. return e
  10841. ? ((L = !0), void (_.innerHTML = e))
  10842. : void _.classList.add("hidden");
  10843. }
  10844. function o(e, t, i, n) {
  10845. if ((!e && !t && !i) || !m.brand || u.valueFromHash("mls", !1))
  10846. return void T.classList.add("hidden");
  10847. L = !0;
  10848. var r = [],
  10849. o = c(r, "<br>");
  10850. if ((e && o('<span id="contactName">' + e + "</span>"), t)) {
  10851. var a = n || t,
  10852. s = u.isMobile()
  10853. ? '<a id="phone" href="callto:' + t + '">' + a + "</a>"
  10854. : "<span>" + a + "</span>";
  10855. o(s);
  10856. }
  10857. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  10858. (r[0] = ""),
  10859. (x.innerHTML = r.join(""));
  10860. }
  10861. function a(e) {
  10862. if ("string" == typeof e)
  10863. try {
  10864. e = JSON.parse(e);
  10865. } catch (e) {
  10866. return (
  10867. y.warn("Unable to parse address data"),
  10868. void S.parentElement.classList.add("hidden")
  10869. );
  10870. }
  10871. if (
  10872. !(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip))
  10873. )
  10874. return void S.parentElement.classList.add("hidden");
  10875. L = !0;
  10876. var t = [],
  10877. i = c(t, " ");
  10878. e.address_1 && i(e.address_1),
  10879. e.address_2 && i(e.address_2),
  10880. e.city && i(e.city, ", "),
  10881. e.state && i(e.state, ", "),
  10882. e.zip && i(e.zip, e.state ? " " : ", "),
  10883. (t[0] = ""),
  10884. (S.innerText = t.join(""));
  10885. }
  10886. function s(e) {
  10887. var t = document.createElement("a");
  10888. return (
  10889. (t.id = "url"),
  10890. (t.target = "_blank"),
  10891. (t.href = e),
  10892. (t.innerText = e),
  10893. t.addEventListener(
  10894. "click",
  10895. N.emit.bind(N, v.ORIGIN_LINK_CLICKED)
  10896. ),
  10897. t
  10898. );
  10899. }
  10900. function l(e) {
  10901. return (
  10902. !(!e || (u.inIframe() && document.referrer === e)) &&
  10903. (R.classList.remove("hidden"),
  10904. (P.innerHTML = f.WEBVR_LEARN_MORE + ": "),
  10905. P.appendChild(s(e)),
  10906. O.forEach(function (e) {
  10907. e.classList.add("share-link");
  10908. }),
  10909. !0)
  10910. );
  10911. }
  10912. function c(e, t) {
  10913. var i = e,
  10914. n = t;
  10915. return function (e, t) {
  10916. i.push(t || n, e);
  10917. };
  10918. }
  10919. function h() {
  10920. document
  10921. .getElementById("title-toggle")
  10922. .addEventListener("click", N.toggleTitle.bind(N)),
  10923. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  10924. var e = [].slice.call(_.querySelectorAll("a"));
  10925. e.forEach(function (e) {
  10926. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED));
  10927. });
  10928. var t = [].slice.call(T.querySelectorAll("a"));
  10929. t.forEach(function (e) {
  10930. e.addEventListener(
  10931. "click",
  10932. N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  10933. contact_type: e.getAttribute("id"),
  10934. })
  10935. );
  10936. });
  10937. }
  10938. var u = e("../../util/browser"),
  10939. d = e("../../util/common"),
  10940. p = e("../../util/logger"),
  10941. f = e("../../localization/localize"),
  10942. g = e("./titleBarSettings"),
  10943. m = e("../../settings"),
  10944. v = e("./TitleEvents"),
  10945. A = e("events").EventEmitter,
  10946. y = new p(i),
  10947. C = document.querySelector(".pinTop.left"),
  10948. I = document.getElementsByClassName("title-container")[0],
  10949. E = document.getElementById("title-toggle").querySelector("i"),
  10950. b = document.getElementById("meta-info-wrapper"),
  10951. w = document.getElementById("meta-info"),
  10952. _ = document.getElementById("meta-description"),
  10953. T = document.getElementsByClassName("contact-info")[0],
  10954. x = document.getElementById("contact-data"),
  10955. S = document.getElementById("addressTxt"),
  10956. M = document.getElementById("tag-toggles"),
  10957. R = document.getElementById("share-origin"),
  10958. P = document.getElementById("share-link-wrapper"),
  10959. O = [w, b, I],
  10960. L = !1,
  10961. D = !1,
  10962. N = {
  10963. populate: function (e) {
  10964. if (n(window.DATA.name, e.coBrand)) {
  10965. if (
  10966. (r(e.description),
  10967. o(
  10968. e.contactName,
  10969. e.phone,
  10970. e.email,
  10971. e.formatted_contact_phone
  10972. ),
  10973. a(e.address),
  10974. L)
  10975. ) {
  10976. var t = document.createElement("br");
  10977. M.insertBefore(t, M.firstElementChild);
  10978. }
  10979. e.socialSharing && m.share.enabled && (D = l(e.url));
  10980. }
  10981. },
  10982. finishSetup: function (e) {
  10983. (L = L || !!e),
  10984. h(),
  10985. L ||
  10986. (D
  10987. ? I.classList.add("share-only")
  10988. : I.classList.add("no-meta"));
  10989. },
  10990. toggleMeta: function (e, t) {
  10991. var title = document.getElementById("model-title");
  10992. t && t.preventDefault();
  10993. var i = w.classList.contains("expand");
  10994. (e && !i) ||
  10995. (i
  10996. ? (O.forEach(function (e) {
  10997. e.classList.remove("expand");
  10998. }),
  10999. this.emit(v.CLOSE_INFO),
  11000. title.classList.remove("expand"))
  11001. : (O.forEach(function (e) {
  11002. e.classList.add("expand");
  11003. }),
  11004. title.classList.add("expand"),
  11005. this.emit(v.OPEN_INFO)));
  11006. },
  11007. setupToggling: function () {
  11008. (b.style.height = w.offsetHeight + "px"),
  11009. w.addEventListener("transitionend", function () {
  11010. b.style.height = w.offsetHeight + "px";
  11011. });
  11012. },
  11013. toggleTitle: function (e) {
  11014. e && e.preventDefault(),
  11015. C.classList.contains("closed")
  11016. ? (C.classList.add("open"),
  11017. E.classList.remove("icon-dpad-right"),
  11018. E.classList.add("icon-dpad-left"),
  11019. this.emit(v.SHOW_INFO),
  11020. setTimeout(function () {
  11021. C.classList.remove("closed"),
  11022. C.classList.remove("open");
  11023. }, g.removeAnimationClasses))
  11024. : (C.classList.add("closed"),
  11025. E.classList.remove("icon-dpad-left"),
  11026. E.classList.add("icon-dpad-right"),
  11027. this.emit(v.HIDE_INFO));
  11028. },
  11029. };
  11030. d.extendObject(N, A.prototype), (t.exports = N);
  11031. }).call(this, "/js/gui/title/titleBar.js");
  11032. },
  11033. {
  11034. "../../localization/localize": 108,
  11035. "../../settings": 166,
  11036. "../../util/browser": 182,
  11037. "../../util/common": 185,
  11038. "../../util/logger": 189,
  11039. "./TitleEvents": 80,
  11040. "./titleBarSettings": 83,
  11041. events: 202,
  11042. },
  11043. ],
  11044. 83: [
  11045. function (e, t, i) {
  11046. "use strict";
  11047. t.exports = Object.freeze({
  11048. minTooltipCharacters: 19,
  11049. removeAnimationClasses: 500,
  11050. });
  11051. },
  11052. {},
  11053. ],
  11054. 84: [
  11055. function (e, t, i) {
  11056. "use strict";
  11057. function n(e) {
  11058. (C = e),
  11059. P.forEach(function (e) {
  11060. b.addEventListener(e, u.bind(this, !1), !0),
  11061. w.addEventListener(e, u.bind(this, !0), !0),
  11062. E.addEventListener(e, o, !0);
  11063. S.forEach(function (t) {
  11064. //会触发导览停止
  11065. t.addEventListener(e, a, !0);
  11066. });
  11067. $("#drawer img").on(e, a);
  11068. });
  11069. document.addEventListener("keydown", u.bind(this, !1), !0);
  11070. C.on(v.TourStart, function () {
  11071. E.classList.add("playing");
  11072. });
  11073. }
  11074. function r() {
  11075. // C.playTour(),
  11076. C.playTourNearBy(),
  11077. I && clearTimeout(I),
  11078. d(),
  11079. _.removeClass("fadeIn");
  11080. }
  11081. function o() {
  11082. E.classList.contains("playing") &&
  11083. (C.stopTour(),
  11084. _.addClass("fadeIn"),
  11085. setTimeout(function () {
  11086. _.removeClass("fadeIn");
  11087. }, p.tourInteraction.showPauseButton),
  11088. O ||
  11089. (clearTimeout(I),
  11090. (I = setTimeout(h, p.tourInteraction.showModal))),
  11091. setTimeout(function () {
  11092. E.classList.remove("playing");
  11093. }, p.tourInteraction.allowNextClick));
  11094. }
  11095. function a() {
  11096. C.tourInProgress &&
  11097. (C.stopTour(), C.endTourProgress(), E.classList.remove("playing"));
  11098. }
  11099. function s() {
  11100. T.is(":visible") ? r() : o();
  11101. }
  11102. function l() {
  11103. x.hasClass("playing") &&
  11104. (clearTimeout(I), C.atEndOfTour() ? c() : _.removeClass("fadeIn"));
  11105. }
  11106. function c() {
  11107. E.classList.remove("playing"), h();
  11108. }
  11109. function h() {
  11110. //去掉导览结束时的提示
  11111. /* if (!p.tourInteraction.disabled) {
  11112. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  11113. M.addClass("fadeIn tour " + m.deviceType);
  11114. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  11115. if (!p.tourInteraction.smallModal) {
  11116. var t;
  11117. 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,
  11118. m.fill(R, A.TOUR_INTERACTION[t]),
  11119. M.addClass(t)
  11120. }
  11121. M.addClass(e)
  11122. } */
  11123. }
  11124. function u(e, t) {
  11125. if (t) {
  11126. var i = "keydown" === t.type,
  11127. n = t.which === f.SPACE || C.tourIsPlaying;
  11128. (i && n) || e || (O = !0),
  11129. C.atEndOfTour() && d(),
  11130. !C.tourIsPlaying &&
  11131. C.tourInProgress &&
  11132. (_.removeClass("fadeIn"), d(), t.which !== f.SPACE && a()),
  11133. i && n && s();
  11134. }
  11135. }
  11136. function d() {
  11137. M.removeClass("fadeIn");
  11138. }
  11139. var p = (e("../util/browser"), e("../settings")),
  11140. f = e("../enum/Keys"),
  11141. g = e("../enum/Viewmode"),
  11142. m = (e("./helpManager"), e("./populateModal")),
  11143. v = e("../enum/DirectorEvents"),
  11144. A = e("../enum/HelpModalType"),
  11145. y = e("../enum/HelpModalSize"),
  11146. C = null,
  11147. I = null,
  11148. E = document.getElementById("pause-overlay"),
  11149. b = document.getElementById("player"),
  11150. w = document.getElementById("gui"),
  11151. _ = $("#pause-icon").eq(0),
  11152. T = $("#play").eq(0),
  11153. x = $("#playHead").eq(0),
  11154. S = $(
  11155. ".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan"
  11156. ).toArray(),
  11157. M = $("#interaction-modal").eq(0),
  11158. R = $("#interaction-modal .interaction").toArray(),
  11159. P = ["touchstart", "mousedown", "pointerdown"],
  11160. O = !1;
  11161. (t.exports.init = n),
  11162. (t.exports.play = r),
  11163. (t.exports.pause = o),
  11164. (t.exports.pauseWithoutCTA = a),
  11165. (t.exports.togglePlay = s),
  11166. (t.exports.stopTour = l),
  11167. (t.exports.dismissModal = d);
  11168. },
  11169. {
  11170. "../enum/DirectorEvents": 23,
  11171. "../enum/HelpModalSize": 27,
  11172. "../enum/HelpModalType": 28,
  11173. "../enum/Keys": 30,
  11174. "../enum/Viewmode": 51,
  11175. "../settings": 166,
  11176. "../util/browser": 182,
  11177. "./helpManager": 68,
  11178. "./populateModal": 75,
  11179. },
  11180. ],
  11181. 85: [
  11182. function (e, t, i) {
  11183. "use strict";
  11184. t.exports = Object.freeze({
  11185. OPENED: "vr.modal.opened",
  11186. LAUNCH: "vr.modal.launch",
  11187. CLOSED: "vr.modal.closed",
  11188. NEXT: "vr.modal.next",
  11189. PREV: "vr.modal.prev",
  11190. STORE: "vr.modal.store",
  11191. falseICECHOSEN: "vr.modal.device",
  11192. });
  11193. },
  11194. {},
  11195. ],
  11196. 86: [
  11197. function (e, t, i) {
  11198. "use strict";
  11199. function n(e, t, i) {
  11200. function n(e, t, n, r) {
  11201. function o() {
  11202. return p + "&m=" + t + "&display=" + e;
  11203. }
  11204. function s() {
  11205. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct"),
  11206. t = "&utm_source=" + u,
  11207. n = "&utm_showcase_session_id=" + i;
  11208. return e + t + n;
  11209. }
  11210. function l() {
  11211. return (
  11212. d +
  11213. "&sids=" +
  11214. t +
  11215. "&lsid=" +
  11216. t +
  11217. "&ln=" +
  11218. encodeURIComponent(n) +
  11219. "&ld=" +
  11220. encodeURIComponent(r) +
  11221. "&display=" +
  11222. e
  11223. );
  11224. }
  11225. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s();
  11226. }
  11227. function r(e, t, i, r) {
  11228. var o = "https://api.branch.io/v1/url",
  11229. a = n(e, t, i, r),
  11230. s = {
  11231. responseType: "json",
  11232. data: {
  11233. branch_key: h.appConfig.branch_key,
  11234. data: {
  11235. m: t,
  11236. full_url: a,
  11237. $desktop_url: m,
  11238. $og_app_id: "331853976762864119",
  11239. $og_title: i,
  11240. $og_description: r,
  11241. $og_image_url:
  11242. location.origin + "/api/v1/player/models/" + t + "/thumb",
  11243. $canonical_url: window.location.href,
  11244. },
  11245. },
  11246. };
  11247. c.post(o, s)
  11248. .done(function (t) {
  11249. f[e] = t.url;
  11250. })
  11251. .fail(
  11252. function (t) {
  11253. f[e] = t;
  11254. }.bind(this, a)
  11255. );
  11256. }
  11257. function o(e, t, i) {
  11258. for (var r in s) {
  11259. var o = s[r],
  11260. a = n(o, e, t, i);
  11261. f[o] = a;
  11262. }
  11263. }
  11264. var u = a.inIframe()
  11265. ? encodeURIComponent(document.referrer)
  11266. : encodeURIComponent(window.location.href),
  11267. d = g + "/vr/dlist/?ret=" + u,
  11268. p = g + "/vr/show/?ret=" + u,
  11269. m = "";
  11270. switch (e) {
  11271. case l.IOS:
  11272. r(s.CardboardIOS, t.sid, t.name, t.summary);
  11273. break;
  11274. default:
  11275. o(t.sid, t.name, t.summary);
  11276. }
  11277. }
  11278. function r(e) {
  11279. var t = f[e];
  11280. window.open(t, "_blank");
  11281. }
  11282. function o(e) {
  11283. var t = u[e];
  11284. window.open(t, "_blank");
  11285. }
  11286. var a = e("../../util/browser"),
  11287. s = e("../../enum/VRApps"),
  11288. l = e("../../enum/VRPlatforms"),
  11289. c = e("../../util/ajax"),
  11290. h = e("../../settings"),
  11291. u = {};
  11292. (u[s.CardboardAndroid] =
  11293. "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri="),
  11294. (u[s.CardboardIOS] =
  11295. "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri="),
  11296. (u[s.GearVR] =
  11297. "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=");
  11298. for (var d in s) {
  11299. var p = s[d];
  11300. u[p] += encodeURIComponent(document.referrer + "&display=" + p);
  11301. }
  11302. var f = {},
  11303. g = (function () {
  11304. var e = window.location.host;
  11305. return (
  11306. e.indexOf(".port.com") === -1 &&
  11307. e.indexOf("localhost") === -1 &&
  11308. (e = "my.port.com"),
  11309. "https://" + e
  11310. );
  11311. })();
  11312. (t.exports.init = n),
  11313. (t.exports.launch = r),
  11314. (t.exports.launchStore = o);
  11315. },
  11316. {
  11317. "../../enum/VRApps": 46,
  11318. "../../enum/VRPlatforms": 49,
  11319. "../../settings": 166,
  11320. "../../util/ajax": 181,
  11321. "../../util/browser": 182,
  11322. },
  11323. ],
  11324. 87: [
  11325. function (e, t, i) {
  11326. "use strict";
  11327. function n(e) {
  11328. var t;
  11329. switch (e) {
  11330. case m.IOS:
  11331. return (
  11332. (t = p.iosVersion()),
  11333. t.major > 9 || (9 === t.major && t.minor >= 1)
  11334. );
  11335. case m.Android:
  11336. return (
  11337. (t = p.androidVersion()),
  11338. t.major > 4 ||
  11339. (4 === t.major && t.minor > 4) ||
  11340. (4 === t.major && 4 === t.minor && t.patch >= 4)
  11341. );
  11342. }
  11343. return !1;
  11344. }
  11345. function r(e, t) {
  11346. function i(e) {
  11347. K.emit(A.STORE, {
  11348. type: e,
  11349. }),
  11350. f.launchStore(e);
  11351. }
  11352. function r(e) {
  11353. switch (
  11354. (e !== _.pageCount && (a(e), N.text(e + 1 + " / " + _.pageCount)),
  11355. e)
  11356. ) {
  11357. case _.Title:
  11358. O.css("display", "none"), L.text(u[e]), o(s);
  11359. break;
  11360. case _.Cardboard:
  11361. O.css("display", "block"),
  11362. L.text(u[e]),
  11363. M.filter(".cardboard").off(),
  11364. M.filter(".gearvr").off(),
  11365. c(e, s),
  11366. h(H, X, Z);
  11367. break;
  11368. case _.Gear:
  11369. L.text(u[e]), c(e, s), T.addClass("lastPage"), h(G, X, Z);
  11370. break;
  11371. case _.pageCount:
  11372. T.removeClass("fadeIn"), K.emit(A.CLOSED);
  11373. }
  11374. B.filter("[src='']").hide();
  11375. }
  11376. var s = (function () {
  11377. return p.detectAndroid()
  11378. ? p.detectAndroidMobile() && n(m.Android)
  11379. ? (T.addClass("supported"), (w = ".show-supported"), m.Android)
  11380. : (T.addClass("unsupported"),
  11381. (w = ".show-unsupported"),
  11382. m.UnsupportedAndroid)
  11383. : p.detectIPhone() || p.detectIPod()
  11384. ? (T.addClass("ios"), (w = ".show-ios"), (_ = v.ios), m.IOS)
  11385. : (T.addClass("desktop"), (w = ".show-desktop"), m.Desktop);
  11386. })();
  11387. f.init(s, e, t), s !== m.Desktop && T.addClass("mobile");
  11388. var l = function (e) {
  11389. K.emit(A.LAUNCH, {
  11390. vr_platform: s,
  11391. vr_app: e,
  11392. }),
  11393. f.launch(e);
  11394. };
  11395. (q.cardboardAndroid = l.bind(this, g.CardboardAndroid)),
  11396. (q.gear = l.bind(this, g.GearVR)),
  11397. (q.cardboardIOS = l.bind(this, g.CardboardIOS)),
  11398. d(),
  11399. $(
  11400. ".show-supported, .show-unsupported, .show-ios, .show-desktop"
  11401. ).hide(),
  11402. $(w).show();
  11403. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS],
  11404. y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  11405. s === m.IOS && (u.splice(1, 1), y.splice(1, 1)),
  11406. $("#vr").on("click", function (e) {
  11407. e.preventDefault();
  11408. player.FlyToMode("panorama", () => {
  11409. if (!window.vrEnabled) {
  11410. // 开启VR
  11411. window.vrEnabled = true;
  11412. this.classList.add("active");
  11413. $("#gui div").not("#vrOff").addClass("vrHide");
  11414. $("#vrOffImg").css({ display: "inline-block" });
  11415. } else {
  11416. }
  11417. });
  11418. });
  11419. let exitVR = function () {
  11420. $("#gui div").not("#vrOff").removeClass("vrHide");
  11421. $("#vrOffImg").css({ display: "none" });
  11422. $("#player canvas").css({ width: "", height: "" }); // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
  11423. $("#vr").removeClass("active"); // 清除vr按钮的激活样式
  11424. };
  11425. $("#vrOff").on("click", function () {
  11426. window.vrEnabled = false;
  11427. exitVR();
  11428. });
  11429. window.bus.addEventListener("exitWebXR", (e) => {
  11430. exitVR();
  11431. });
  11432. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  11433. s === m.IOS
  11434. ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS))
  11435. : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  11436. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  11437. $("span.modelLink").text(I),
  11438. O.on("click", function (e) {
  11439. K.emit(A.PREV), b--, r(b);
  11440. }),
  11441. L.on("click", function (e) {
  11442. L.text();
  11443. K.emit(A.NEXT, {
  11444. nextAction: y[b],
  11445. }),
  11446. b++,
  11447. r(b);
  11448. }),
  11449. T.find(".close").on("click", K.dismiss);
  11450. }
  11451. function o(e) {
  11452. switch (e) {
  11453. case m.Android:
  11454. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  11455. M.filter(".gearvr").off().on("click", q.gear),
  11456. s(H, G, "logo-button", "same-line");
  11457. break;
  11458. case m.UnsupportedAndroid:
  11459. s("", z, "", "");
  11460. break;
  11461. case m.IOS:
  11462. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  11463. s(H, "", "logo-button", "");
  11464. break;
  11465. case m.Desktop:
  11466. M.filter(".cardboard")
  11467. .off()
  11468. .on("click", l.bind(this, null, F, U)),
  11469. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  11470. s(H, G, "logo-button", "same-line"),
  11471. Q.cardboard();
  11472. }
  11473. }
  11474. function a(e) {
  11475. $(".p1, .p2, .p3").hide(),
  11476. x.insertAfter(S),
  11477. T.removeClass("front-page"),
  11478. T.removeClass("details-page"),
  11479. T.removeClass("lastPage"),
  11480. M.removeClass("logo-button"),
  11481. M.removeClass("same-line"),
  11482. S.removeClass("headsetOptions"),
  11483. R.attr("src", ""),
  11484. R.filter(".second").removeClass("gear"),
  11485. R.css("display", "inline-block"),
  11486. R.off(),
  11487. P.filter(".second").css("display", ""),
  11488. D.css("display", "none"),
  11489. $(".p" + (e + 1) + w).show(),
  11490. R.filter(".third").insertBefore(P.filter(".third"));
  11491. }
  11492. function s(e, t, i, n) {
  11493. T.addClass("front-page"),
  11494. R.filter(".first").attr("src", e),
  11495. R.filter(".second").attr("src", t),
  11496. M.filter(".first").addClass(i),
  11497. M.filter(".second").addClass(i),
  11498. M.addClass(n),
  11499. ".show-desktop" === w && S.insertAfter(x);
  11500. }
  11501. function l(e, t, i) {
  11502. S.addClass("headsetOptions"),
  11503. M.off(),
  11504. R.filter(".second").attr("src", t),
  11505. D.css("display", "block"),
  11506. P.filter(".second").css("display", "none"),
  11507. D.on("click", function () {
  11508. a(_.Title), o(m.Desktop);
  11509. }),
  11510. e &&
  11511. (K.emit(A.falseICECHOSEN, {
  11512. name: g.GearVR,
  11513. }),
  11514. R.filter(".first").attr("src", e),
  11515. R.filter(".second").addClass("gear"),
  11516. R.filter(".second").on(
  11517. "click",
  11518. f.launchStore.bind(this, g.GearVR)
  11519. ),
  11520. Q.gearvr()),
  11521. i &&
  11522. (K.emit(A.falseICECHOSEN, {
  11523. name: g.Cardboard,
  11524. }),
  11525. R.filter(".third").attr("src", i),
  11526. R.filter(".third").show(),
  11527. R.filter(".third").insertAfter(R.filter(".second")),
  11528. R.filter(".third").addClass("link"),
  11529. R.filter(".second").addClass("link"),
  11530. R.filter(".second").on(
  11531. "click",
  11532. f.launchStore.bind(this, g.CardboardIOS)
  11533. ),
  11534. R.filter(".third").on(
  11535. "click",
  11536. f.launchStore.bind(this, g.CardboardAndroid)
  11537. ),
  11538. Q.cardboard());
  11539. }
  11540. function c(e, t) {
  11541. switch (t) {
  11542. case m.IOS:
  11543. (X = Y), (Z = j);
  11544. break;
  11545. case m.Desktop:
  11546. e === _.Cardboard
  11547. ? ((X = F),
  11548. (Z = U),
  11549. R.filter(".second").on(
  11550. "click",
  11551. f.launchStore.bind(this, g.CardboardIOS)
  11552. ),
  11553. R.filter(".third").on(
  11554. "click",
  11555. f.launchStore.bind(this, g.CardboardAndroid)
  11556. ))
  11557. : ((X = V),
  11558. R.filter(".second").on(
  11559. "click",
  11560. f.launchStore.bind(this, g.GearVR)
  11561. ),
  11562. (Z = ""));
  11563. break;
  11564. default:
  11565. e === _.Cardboard ? ((X = z), (Z = j)) : ((X = k), (Z = W));
  11566. }
  11567. }
  11568. function h(e, t, i) {
  11569. T.find(".inner").addClass("details-page"),
  11570. T.addClass("details-page"),
  11571. R.filter(".first").attr("src", e),
  11572. R.filter(".second").attr("src", t),
  11573. R.filter(".third").attr("src", i);
  11574. }
  11575. function u() {
  11576. T.hasClass("fadeIn") && (T.removeClass("fadeIn"), K.emit(A.CLOSED));
  11577. }
  11578. function d() {
  11579. var e = p.aspectRatio() > 1 && p.isMobile();
  11580. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  11581. T.toggleClass(
  11582. "tiny",
  11583. $("#player").height() <= y.narrowLandscapeHeight
  11584. ),
  11585. T.toggleClass(
  11586. "tinier",
  11587. $("#player").height() <= y.reallyNarrowLandscapeHeight
  11588. );
  11589. }
  11590. var p = e("../../util/browser"),
  11591. f = e("./vrLink"),
  11592. g = e("../../enum/VRApps"),
  11593. m = e("../../enum/VRPlatforms"),
  11594. v = e("../../enum/VRPages"),
  11595. A = e("./vrEvent"),
  11596. y = (e("../../settings"), e("../../constants")),
  11597. C = e("../../localization/localize"),
  11598. I = e("../../util/common"),
  11599. E = e("events").EventEmitter,
  11600. b = 0,
  11601. w = null,
  11602. _ = v.standard,
  11603. T = $(".vr-popup"),
  11604. x = T.find(".vr-popup-body"),
  11605. S = T.find(".vr-images"),
  11606. M = T.find(".img-container"),
  11607. R = T.find(".vr-sm-image"),
  11608. P = M.find(".vr-img-caption"),
  11609. O = $(".vr-buttons").find(".prev-button"),
  11610. L = $(".vr-buttons").find(".next-button"),
  11611. D = S.find(".front-close"),
  11612. N = $(".vr-page"),
  11613. B = T.find("img"),
  11614. F = "images/apple-store.png",
  11615. V = "images/badge-oculus.png",
  11616. U = "images/badge-cardboard.png",
  11617. k = "images/logo-samsung.png",
  11618. H = "images/headset-cardboard.png",
  11619. G = "images/headset-gearvr.png",
  11620. z = "images/ico-android-robot.png",
  11621. W = "images/ico-gearvr.png",
  11622. j = "images/ico-vr.png",
  11623. Y = "images/apple-logo-white.svg",
  11624. X = null,
  11625. Z = null,
  11626. q = {},
  11627. K = {
  11628. init: r,
  11629. dismiss: u,
  11630. isDeviceSupported: n,
  11631. };
  11632. I.extendObject(K, E.prototype), $(window).resize(d);
  11633. var Q = (function () {
  11634. var e = P.filter(".first").find(".cardboard"),
  11635. t = P.filter(".first").find(".gearvr");
  11636. return {
  11637. cardboard: function () {
  11638. t.addClass("hidden"), e.removeClass("hidden");
  11639. },
  11640. gearvr: function () {
  11641. e.addClass("hidden"), t.removeClass("hidden");
  11642. },
  11643. };
  11644. })();
  11645. t.exports = K;
  11646. },
  11647. {
  11648. "../../constants": 8,
  11649. "../../enum/VRApps": 46,
  11650. "../../enum/VRPages": 48,
  11651. "../../enum/VRPlatforms": 49,
  11652. "../../localization/localize": 108,
  11653. "../../settings": 166,
  11654. "../../util/browser": 182,
  11655. "../../util/common": 185,
  11656. "./vrEvent": 85,
  11657. "./vrLink": 86,
  11658. events: 202,
  11659. },
  11660. ],
  11661. 88: [
  11662. function (e, t, i) {
  11663. "use strict";
  11664. t.exports = Object.freeze({
  11665. OPENED: "webvr.modal.opened",
  11666. SHOW_TERMS: "webvr.footer.show.terms",
  11667. });
  11668. },
  11669. {},
  11670. ],
  11671. 89: [
  11672. function (e, t, i) {
  11673. (function (i) {
  11674. "use strict";
  11675. function n(e, t, i, n) {
  11676. function r(e) {
  11677. e.preventDefault(), a(e.currentTarget.id);
  11678. }
  11679. function a(e) {
  11680. ne[e](),
  11681. Object.keys(ne).map(function (t, i) {
  11682. $("#" + t).toggleClass("tabs-underlined", t === e);
  11683. });
  11684. }
  11685. (y = i), (v = t), w.init(E.Android, e, n), m();
  11686. var l = new RegExp("daydream", "i"),
  11687. c = l.test(y.displayName);
  11688. c
  11689. ? (a("tabdaydream"),
  11690. B.filter(".device-headset-side").attr("src", H),
  11691. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM")))
  11692. : (a("tabcardboard"),
  11693. B.filter(".device-headset-side").attr("src", Y),
  11694. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  11695. $("#vr").on("click", function (e) {
  11696. e.preventDefault(),
  11697. g("click_webvr_button"),
  11698. L.is(":hidden") && (ie.emit(_.OPENED), o());
  11699. }),
  11700. $(".webvr-popup .close").on("click", function (e) {
  11701. e.preventDefault(),
  11702. D.hasClass("hidden") ? (g("webvr_help_close"), p()) : s();
  11703. }),
  11704. $("#tabcardboard").on("click", r),
  11705. $("#tabdaydream").on("click", r),
  11706. $("#tabnative").on("click", r),
  11707. $(".webvr-popup .open-with-app").on("click", function (e) {
  11708. e.preventDefault(), g("webvr_learn_more"), a("tabnative"), p();
  11709. }),
  11710. $(".webvr-popup .help").on("click", function (e) {
  11711. e.preventDefault(),
  11712. g(
  11713. D.hasClass("hidden")
  11714. ? "webvr_help_close"
  11715. : "webvr_help_show"
  11716. ),
  11717. p();
  11718. }),
  11719. $(".webvr-popup .terms").on("click", function (e) {
  11720. e.preventDefault(),
  11721. g("webvr_click_terms"),
  11722. s(),
  11723. ie.emit(_.SHOW_TERMS);
  11724. }),
  11725. F.on("click", function (e) {
  11726. e.preventDefault(), g(ee), window.open(J, "_blank");
  11727. }),
  11728. V.on("click", function (e) {
  11729. e.preventDefault(),
  11730. g("webvr_phone_link"),
  11731. window.open(te, "_blank");
  11732. }),
  11733. $(".webvr-popup .badge-cardboard").on("click", function (e) {
  11734. e.preventDefault(),
  11735. g("webvr_cardboard_link"),
  11736. w.launch(b.CardboardAndroid);
  11737. }),
  11738. $(".webvr-popup .badge-oculus").on("click", function (e) {
  11739. e.preventDefault(), g("webvr_oculus_link"), w.launch(b.GearVR);
  11740. });
  11741. }
  11742. function r() {
  11743. function e() {
  11744. y.isPresenting ||
  11745. (f(), window.removeEventListener("vrdisplaypresentchange", e));
  11746. }
  11747. R.info("Headset mounted"), v.suspend();
  11748. var t = document.createElement("canvas");
  11749. for (
  11750. t.getContext("webgl"),
  11751. t.className = "webvr-canvas",
  11752. document.bgColor = "#000",
  11753. document.body.style.backgroundColor = "#000";
  11754. document.body.firstChild;
  11755. )
  11756. document.body.removeChild(document.body.firstChild);
  11757. document.body.appendChild(t),
  11758. g("webvr_enter_app"),
  11759. y
  11760. .requestPresent([
  11761. {
  11762. source: t,
  11763. predistorted: !0,
  11764. },
  11765. ])
  11766. .catch(function (t) {
  11767. R.error("Failed to present: " + t),
  11768. g("webvr_exit_calibrate"),
  11769. e();
  11770. }),
  11771. A.then(function () {
  11772. window.dispatchEvent(new Event("vrapp-start"));
  11773. }),
  11774. window.addEventListener("vrdisplaypresentchange", e);
  11775. }
  11776. function o() {
  11777. O.fadeOut(I.guiAnimationSpeed), L.fadeIn(I.guiAnimationSpeed), a();
  11778. }
  11779. function a() {
  11780. if (!A) {
  11781. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version,
  11782. t = "https://static.port.com/webvr/" + e + "/js/main.js";
  11783. A = new Promise(function (e, i) {
  11784. var n = document.createElement("script");
  11785. (n.type = "text/javascript"),
  11786. (n.src = t),
  11787. (n.onload = e),
  11788. document.head.appendChild(n);
  11789. });
  11790. }
  11791. D.find(".enter-button").on("click", r);
  11792. }
  11793. function s() {
  11794. g("webvr_modal_close"),
  11795. D.find(".enter-button").off("click", r),
  11796. L.fadeOut(I.guiAnimationSpeed, function () {
  11797. D.toggleClass("hidden", !1),
  11798. N.toggleClass("hidden", !0),
  11799. C.exitFullscreen();
  11800. }),
  11801. O.fadeIn(I.guiAnimationSpeed);
  11802. }
  11803. function l() {
  11804. k.toggleClass("hidden", !1), U.toggleClass("hidden", !0);
  11805. }
  11806. function c() {
  11807. k.toggleClass("hidden", !0), U.toggleClass("hidden", !1);
  11808. }
  11809. function h() {
  11810. B.filter(".device-headset").attr("src", G),
  11811. B.filter(".device-phone").attr("src", z),
  11812. (J = Z),
  11813. (ee = K),
  11814. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  11815. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  11816. $(".webvr-popup .detail.daydream-label").toggleClass(
  11817. "hidden",
  11818. !1
  11819. ),
  11820. c();
  11821. }
  11822. function u() {
  11823. B.filter(".badge-cardboard").attr("src", j),
  11824. B.filter(".badge-oculus").attr("src", X),
  11825. l();
  11826. }
  11827. function d() {
  11828. B.filter(".device-headset").attr("src", Y),
  11829. B.filter(".device-phone").attr("src", W),
  11830. (J = q),
  11831. (ee = Q),
  11832. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  11833. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  11834. $(".webvr-popup .detail.daydream-label").toggleClass(
  11835. "hidden",
  11836. !0
  11837. ),
  11838. c();
  11839. }
  11840. function p() {
  11841. D.toggleClass("hidden"), N.toggleClass("hidden");
  11842. }
  11843. function f() {
  11844. R.info("exiting webVR"),
  11845. g("webvr_exit_app"),
  11846. window.location.search.indexOf("&qs=1") === -1
  11847. ? (window.location = window.location + "&qs=1")
  11848. : (window.location = window.location);
  11849. }
  11850. function g(e) {
  11851. var t = C.isLandscape() ? "landscape" : "portrait";
  11852. T.trackAlways("showcase_gui", {
  11853. gui_action: e,
  11854. orientation: t,
  11855. });
  11856. }
  11857. function m() {
  11858. var e = C.isLandscape();
  11859. L.toggleClass("landscape", e).toggleClass("portrait", !e);
  11860. }
  11861. var v,
  11862. A,
  11863. y,
  11864. C = e("../../util/browser"),
  11865. I = e("../../settings"),
  11866. E = (e("./../gui"), e("../../enum/VRPlatforms")),
  11867. b = e("../../enum/VRApps"),
  11868. w = e("./../vr/vrLink"),
  11869. _ = e("./WebVrEvent"),
  11870. T = e("../../analytics"),
  11871. x = (e("../../constants"), e("../../localization/localize")),
  11872. S = e("../../util/common"),
  11873. M = e("../../util/logger"),
  11874. R = new M(i),
  11875. P = e("events").EventEmitter,
  11876. O = $("#gui"),
  11877. L = $(".webvr-popup"),
  11878. D = $(".webvr-popup .page.p1"),
  11879. N = $(".webvr-popup .page.p2"),
  11880. B = L.find(".image"),
  11881. F = $(".webvr-popup .detail.headset"),
  11882. V = $(".webvr-popup .detail.phone"),
  11883. U = $(".webvr-popup .tab-content.webvr"),
  11884. k = $(".webvr-popup .tab-content.native"),
  11885. H = "images/device-daydream-side.png",
  11886. G = "images/device-daydream.png",
  11887. z = "images/device-pixel.png",
  11888. W = "images/ico-android-robot.png",
  11889. j = "images/badge-cardboard.png",
  11890. Y = "images/headset-cardboard.png",
  11891. X = "images/badge-oculus.png",
  11892. Z = "https://madeby.google.com/vr/",
  11893. q = "https://vr.google.com/cardboard/get-cardboard/",
  11894. K = "webvr_daydream_link",
  11895. Q = "webvr_cardboard_link",
  11896. J = Z,
  11897. ee = K,
  11898. te = "https://vr.google.com/daydream/phones/",
  11899. ie = {
  11900. init: n,
  11901. },
  11902. ne = {
  11903. tabcardboard: d,
  11904. tabdaydream: h,
  11905. tabnative: u,
  11906. };
  11907. S.extendObject(ie, P.prototype),
  11908. $(window).resize(m),
  11909. (t.exports = ie);
  11910. }).call(this, "/js/gui/webvr/webVRgui.js");
  11911. },
  11912. {
  11913. "../../analytics": 4,
  11914. "../../constants": 8,
  11915. "../../enum/VRApps": 46,
  11916. "../../enum/VRPlatforms": 49,
  11917. "../../localization/localize": 108,
  11918. "../../settings": 166,
  11919. "../../util/browser": 182,
  11920. "../../util/common": 185,
  11921. "../../util/logger": 189,
  11922. "./../gui": 65,
  11923. "./../vr/vrLink": 86,
  11924. "./WebVrEvent": 88,
  11925. events: 202,
  11926. },
  11927. ],
  11928. 90: [
  11929. function (e, t, i) {
  11930. "use strict";
  11931. function n(e, t, i, n, o) {
  11932. n || 0 === n ? (this.floorId = n) : (this.floorId = -1),
  11933. (this.roomId = o || ""),
  11934. (this.labelId = e),
  11935. (this.position = new r.Vector3().copy(t)),
  11936. (this.text = i);
  11937. }
  11938. var r = e("three"),
  11939. o = e("../util/browser");
  11940. (n.prototype.build = function () {
  11941. var e = window.document.createElement("div");
  11942. o.isMobile()
  11943. ? e.setAttribute(
  11944. "class",
  11945. "gui-floorplan-label gui-floorplan-label-mobile"
  11946. )
  11947. : e.setAttribute("class", "gui-floorplan-label");
  11948. var t = window.document.createElement("div");
  11949. t.setAttribute("class", "gui-floorplan-label-text");
  11950. var i = window.document.createTextNode(this.text);
  11951. t.appendChild(i),
  11952. e.appendChild(t),
  11953. window.document.body.appendChild(e),
  11954. (this.labelGui = e),
  11955. (this.textBlock = t),
  11956. $(this.labelGui).hide();
  11957. var n = window.getComputedStyle(this.labelGui);
  11958. this.initialTransform = n.transform || n.webkitTransform;
  11959. }),
  11960. (t.exports = n);
  11961. },
  11962. {
  11963. "../util/browser": 182,
  11964. three: 217,
  11965. },
  11966. ],
  11967. 91: [
  11968. function (e, t, i) {
  11969. "use strict";
  11970. function n() {
  11971. (this.player = null),
  11972. (this.modelManager = null),
  11973. (this.container = null);
  11974. }
  11975. var r = e("three"),
  11976. o = (e("../util/common"), e("../enum/PlayerEvents")),
  11977. a = (e("../enum/DirectorEvents"), e("../enum/ModelManagerEvents")),
  11978. s = e("../settings"),
  11979. l = e("../enum/Viewmode"),
  11980. c =
  11981. (e("../enum/WarpStyle"),
  11982. e("../util/transitions"),
  11983. e("../util/lerp"),
  11984. e("../util/browser"));
  11985. //场景初始化
  11986. (n.prototype.init = function (e, t, i) {
  11987. (this.player = e),
  11988. (this.modelManager = t),
  11989. (this.container = i),
  11990. this.updateModel(),
  11991. this.bindEvents();
  11992. }),
  11993. (n.prototype.bindEvents = function () {
  11994. this.modelManager.on(
  11995. a.ActiveModelChanged,
  11996. this.updateModel.bind(this)
  11997. ),
  11998. this.player.on(
  11999. o.ViewChanged,
  12000. this.handlePlayerViewChanged.bind(this)
  12001. ),
  12002. this.player.on(
  12003. o.ModeChanged,
  12004. this.handlePlayerViewChanged.bind(this)
  12005. ),
  12006. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  12007. this.player.on(
  12008. o.StartOutside,
  12009. this.handleStartOutside.bind(this)
  12010. );
  12011. }),
  12012. (n.prototype.updateModel = function () {
  12013. this.model = this.modelManager.getActiveModel();
  12014. }),
  12015. (n.prototype.handlePlayerViewChanged = function () {
  12016. this.updateLabelVisibility(), this.updateLabelDisplay();
  12017. }),
  12018. (n.prototype.getLabelsForFloor = function (e, t) {
  12019. return (
  12020. (t = t || []),
  12021. (t.length = 0),
  12022. this.model.labels.forEach(
  12023. function (i) {
  12024. this.labelVisibleForFloor(i, e) && t.push(i);
  12025. }.bind(this)
  12026. ),
  12027. t
  12028. );
  12029. }),
  12030. (n.prototype.getLabelsForCurrentFloor = function (e) {
  12031. return this.getLabelsForFloor(
  12032. this.model.currentFloor.floorIndex,
  12033. e
  12034. );
  12035. }),
  12036. (n.prototype.labelVisibleForFloor = function (e, t) {
  12037. var i =
  12038. (c.isMobile() &&
  12039. this.player.getLabelScaleFactor() <
  12040. s.labels.zoomHideThreshhold.mobile) ||
  12041. (!c.isMobile() &&
  12042. this.player.getLabelScaleFactor() <
  12043. s.labels.zoomHideThreshhold.desktop);
  12044. if (!this.model.showingLabels || !e.labelGui || !i) return !1;
  12045. var n = e.floorId === this.model.floors.size() - 1;
  12046. return this.model.allFloorsVisible ? n : e.floorId === t;
  12047. }),
  12048. (n.prototype.updateLabelVisibility = function (e) {
  12049. this.model.labels.forEach(
  12050. function (e) {
  12051. this.supportedMode() &&
  12052. this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex)
  12053. ? this.showLabel(
  12054. e,
  12055. s.labels.fadeInDelay,
  12056. s.labels.fadeInDuration
  12057. )
  12058. : this.hideLabel(
  12059. e,
  12060. s.labels.fadeOutDelay,
  12061. s.labels.fadeOutDuration
  12062. );
  12063. }.bind(this)
  12064. );
  12065. }),
  12066. (n.prototype.showAllLabels = function (e, t) {
  12067. this.model.labels.forEach(
  12068. function (i) {
  12069. this.showLabel(i, e, t);
  12070. }.bind(this)
  12071. );
  12072. }),
  12073. (n.prototype.hideAllLabels = function (e, t) {
  12074. this.model.labels.forEach(
  12075. function (i) {
  12076. this.hideLabel(i, e, t);
  12077. }.bind(this)
  12078. );
  12079. }),
  12080. (n.prototype.showLabel = function (e, t, i) {
  12081. this.model.showingLabels &&
  12082. (e.visible ||
  12083. ((e.visible = !0),
  12084. (e.labelGui.style.display = "block"),
  12085. (e.labelGui.style.opacity = 0),
  12086. $(e.labelGui).delay(t).fadeTo(i, 1)));
  12087. }),
  12088. (n.prototype.hideLabel = function (e, t, i) {
  12089. e.visible &&
  12090. ((e.visible = !1),
  12091. c.isMobile()
  12092. ? $(e.labelGui).hide()
  12093. : $(e.labelGui).delay(t).fadeOut(i));
  12094. }),
  12095. (n.prototype.supportedMode = function () {
  12096. return this.player.mode === l.FLOORPLAN;
  12097. }),
  12098. (n.prototype.updateLabelDisplay = (function () {
  12099. var e = (new r.Vector3(), new r.Vector3(), []);
  12100. return function () {
  12101. var t = this.player.getLabelScaleFactor(),
  12102. i = 0.6,
  12103. n = 1.2,
  12104. r = (1 - t) * n + i,
  12105. o = c.isMobile()
  12106. ? s.labels.zoomTruncateThreshhold.mobile
  12107. : s.labels.zoomTruncateThreshhold.desktop;
  12108. this.getLabelsForCurrentFloor(e);
  12109. for (var a = 0; a < e.length; a++) {
  12110. var l = e[a];
  12111. this.supportedMode() &&
  12112. l.labelGui &&
  12113. (this.updateProjectedGuiElement(
  12114. l.labelGui,
  12115. l.textBlock,
  12116. l.position,
  12117. r,
  12118. r
  12119. ),
  12120. t >= o && l.text.length >= s.labels.minLengthForTruncate
  12121. ? (l.textBlock.innerText =
  12122. l.text.substring(0, s.labels.truncateLength) +
  12123. s.labels.truncateSuffix)
  12124. : (l.textBlock.innerText = l.text));
  12125. }
  12126. };
  12127. })()),
  12128. (n.prototype.updateProjectedGuiElement = (function () {
  12129. var e = new r.Vector3();
  12130. new r.Vector3();
  12131. return function (t, i, n, r, o) {
  12132. i.style.fontSize = 100 * o + "%";
  12133. var a = $("#player").width(),
  12134. s = $("#player").height(),
  12135. l = 0.5 * a,
  12136. c = 0.5 * s;
  12137. e.copy(n), e.project(this.player.camera);
  12138. var h = e.x * l + l,
  12139. u = -(e.y * c) + c;
  12140. (h -= t.offsetWidth / 2),
  12141. (u -= t.offsetHeight / 2),
  12142. (t.style.left = h + "px"),
  12143. (t.style.top = u + "px");
  12144. };
  12145. })()),
  12146. (n.prototype.handleStartInside = function (e) {
  12147. this.updateLabelVisibility();
  12148. }),
  12149. (n.prototype.handleStartOutside = function () {
  12150. this.updateLabelVisibility();
  12151. }),
  12152. (t.exports = n);
  12153. },
  12154. {
  12155. "../enum/DirectorEvents": 23,
  12156. "../enum/ModelManagerEvents": 33,
  12157. "../enum/PlayerEvents": 40,
  12158. "../enum/Viewmode": 51,
  12159. "../enum/WarpStyle": 52,
  12160. "../settings": 166,
  12161. "../util/browser": 182,
  12162. "../util/common": 185,
  12163. "../util/lerp": 188,
  12164. "../util/transitions": 195,
  12165. three: 217,
  12166. },
  12167. ],
  12168. 92: [
  12169. function (e, t, i) {
  12170. "use strict";
  12171. Array.prototype.findIndex ||
  12172. (Array.prototype.findIndex = function (e) {
  12173. if (null == this)
  12174. throw new TypeError(
  12175. "Array.prototype.findIndex called on null or undefined"
  12176. );
  12177. if ("function" != typeof e)
  12178. throw new TypeError("predicate must be a function");
  12179. for (
  12180. var t,
  12181. i = Object(this),
  12182. n = i.length >>> 0,
  12183. r = arguments[1],
  12184. o = 0;
  12185. o < n;
  12186. o++
  12187. )
  12188. if (((t = i[o]), e.call(r, t, o, i))) return o;
  12189. return -1;
  12190. }),
  12191. Array.prototype.find ||
  12192. Object.defineProperty(Array.prototype, "find", {
  12193. value: function (e) {
  12194. if (null == this)
  12195. throw new TypeError('"this" is null or not defined');
  12196. var t = Object(this),
  12197. i = t.length >>> 0;
  12198. if ("function" != typeof e)
  12199. throw new TypeError("predicate must be a function");
  12200. for (var n = arguments[1], r = 0; r < i; ) {
  12201. var o = t[r];
  12202. if (e.call(n, o, r, t)) return o;
  12203. r++;
  12204. }
  12205. },
  12206. });
  12207. },
  12208. {},
  12209. ],
  12210. 93: [
  12211. function (e, t, i) {
  12212. "use strict";
  12213. var n = n || {};
  12214. (t.exports = n),
  12215. (n.gui = n.gui || {}),
  12216. (n.utils = n.utils || {}),
  12217. (n.controllers = n.controllers || {}),
  12218. (n.dom = n.dom || {}),
  12219. (n.color = n.color || {}),
  12220. (n.utils.css = (function () {
  12221. return {
  12222. load: function (e, t) {
  12223. t = t || document;
  12224. var i = t.createElement("link");
  12225. (i.type = "text/css"),
  12226. (i.rel = "stylesheet"),
  12227. (i.href = e),
  12228. t.getElementsByTagName("head")[0].appendChild(i);
  12229. },
  12230. inject: function (e, t) {
  12231. t = t || document;
  12232. var i = document.createElement("style");
  12233. (i.type = "text/css"),
  12234. (i.innerHTML = e),
  12235. t.getElementsByTagName("head")[0].appendChild(i);
  12236. },
  12237. };
  12238. })()),
  12239. (n.utils.common = (function () {
  12240. var e = Array.prototype.forEach,
  12241. t = Array.prototype.slice;
  12242. return {
  12243. BREAK: {},
  12244. extend: function (e) {
  12245. return (
  12246. this.each(
  12247. t.call(arguments, 1),
  12248. function (t) {
  12249. for (var i in t) this.isUndefined(t[i]) || (e[i] = t[i]);
  12250. },
  12251. this
  12252. ),
  12253. e
  12254. );
  12255. },
  12256. defaults: function (e) {
  12257. return (
  12258. this.each(
  12259. t.call(arguments, 1),
  12260. function (t) {
  12261. for (var i in t) this.isUndefined(e[i]) && (e[i] = t[i]);
  12262. },
  12263. this
  12264. ),
  12265. e
  12266. );
  12267. },
  12268. compose: function () {
  12269. var e = t.call(arguments);
  12270. return function () {
  12271. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  12272. i = [e[n].apply(this, i)];
  12273. return i[0];
  12274. };
  12275. },
  12276. each: function (t, i, n) {
  12277. if (t)
  12278. if (e && t.forEach && t.forEach === e) t.forEach(i, n);
  12279. else if (t.length === t.length + 0) {
  12280. for (var r = 0, o = t.length; r < o; r++)
  12281. if (r in t && i.call(n, t[r], r) === this.BREAK) return;
  12282. } else
  12283. for (var r in t)
  12284. if (i.call(n, t[r], r) === this.BREAK) return;
  12285. },
  12286. defer: function (e) {
  12287. setTimeout(e, 0);
  12288. },
  12289. toArray: function (e) {
  12290. return e.toArray ? e.toArray() : t.call(e);
  12291. },
  12292. isUndefined: function (e) {
  12293. return void 0 === e;
  12294. },
  12295. isNull: function (e) {
  12296. return null === e;
  12297. },
  12298. isNaN: function (e) {
  12299. return e !== e;
  12300. },
  12301. isArray:
  12302. Array.isArray ||
  12303. function (e) {
  12304. return e.constructor === Array;
  12305. },
  12306. isObject: function (e) {
  12307. return e === Object(e);
  12308. },
  12309. isNumber: function (e) {
  12310. return e === e + 0;
  12311. },
  12312. isString: function (e) {
  12313. return e === e + "";
  12314. },
  12315. isBoolean: function (e) {
  12316. return e === !1 || e === !0;
  12317. },
  12318. isFunction: function (e) {
  12319. return (
  12320. "[object Function]" === Object.prototype.toString.call(e)
  12321. );
  12322. },
  12323. };
  12324. })()),
  12325. (n.controllers.Controller = (function (e) {
  12326. var t = function (e, t) {
  12327. (this.initialValue = e[t]),
  12328. (this.domElement = document.createElement("div")),
  12329. (this.object = e),
  12330. (this.property = t),
  12331. (this.__onChange = void 0),
  12332. (this.__onFinishChange = void 0);
  12333. };
  12334. return (
  12335. e.extend(t.prototype, {
  12336. onChange: function (e) {
  12337. return (this.__onChange = e), this;
  12338. },
  12339. onFinishChange: function (e) {
  12340. return (this.__onFinishChange = e), this;
  12341. },
  12342. setValue: function (e) {
  12343. return (
  12344. (this.object[this.property] = e),
  12345. this.__onChange && this.__onChange.call(this, e),
  12346. this.updateDisplay(),
  12347. this
  12348. );
  12349. },
  12350. getValue: function () {
  12351. return this.object[this.property];
  12352. },
  12353. updateDisplay: function () {
  12354. return this;
  12355. },
  12356. isModified: function () {
  12357. return this.initialValue !== this.getValue();
  12358. },
  12359. }),
  12360. t
  12361. );
  12362. })(n.utils.common)),
  12363. (n.dom.dom = (function (e) {
  12364. function t(t) {
  12365. if ("0" === t || e.isUndefined(t)) return 0;
  12366. var i = t.match(r);
  12367. return e.isNull(i) ? 0 : parseFloat(i[1]);
  12368. }
  12369. var i = {
  12370. HTMLEvents: ["change"],
  12371. MouseEvents: [
  12372. "click",
  12373. "mousemove",
  12374. "mousedown",
  12375. "mouseup",
  12376. "mouseover",
  12377. ],
  12378. KeyboardEvents: ["keydown"],
  12379. },
  12380. n = {};
  12381. e.each(i, function (t, i) {
  12382. e.each(t, function (e) {
  12383. n[e] = i;
  12384. });
  12385. });
  12386. var r = /(\d+(\.\d+)?)px/,
  12387. o = {
  12388. makeSelectable: function (e, t) {
  12389. void 0 !== e &&
  12390. void 0 !== e.style &&
  12391. ((e.onselectstart = t
  12392. ? function () {
  12393. return !1;
  12394. }
  12395. : function () {}),
  12396. (e.style.MozUserSelect = t ? "auto" : "none"),
  12397. (e.style.KhtmlUserSelect = t ? "auto" : "none"),
  12398. (e.unselectable = t ? "on" : "off"));
  12399. },
  12400. makeFullscreen: function (t, i, n) {
  12401. e.isUndefined(i) && (i = !0),
  12402. e.isUndefined(n) && (n = !0),
  12403. (t.style.position = "absolute"),
  12404. i && ((t.style.left = 0), (t.style.right = 0)),
  12405. n && ((t.style.top = 0), (t.style.bottom = 0));
  12406. },
  12407. fakeEvent: function (t, i, r, o) {
  12408. r = r || {};
  12409. var a = n[i];
  12410. if (!a)
  12411. throw new Error("Event type " + i + " not supported.");
  12412. var s = document.createEvent(a);
  12413. switch (a) {
  12414. case "MouseEvents":
  12415. var l = r.x || r.clientX || 0,
  12416. c = r.y || r.clientY || 0;
  12417. s.initMouseEvent(
  12418. i,
  12419. r.bubbles || !1,
  12420. r.cancelable || !0,
  12421. window,
  12422. r.clickCount || 1,
  12423. 0,
  12424. 0,
  12425. l,
  12426. c,
  12427. !1,
  12428. !1,
  12429. !1,
  12430. !1,
  12431. 0,
  12432. null
  12433. );
  12434. break;
  12435. case "KeyboardEvents":
  12436. var h = s.initKeyboardEvent || s.initKeyEvent;
  12437. e.defaults(r, {
  12438. cancelable: !0,
  12439. ctrlKey: !1,
  12440. altKey: !1,
  12441. shiftKey: !1,
  12442. metaKey: !1,
  12443. keyCode: void 0,
  12444. charCode: void 0,
  12445. }),
  12446. h(
  12447. i,
  12448. r.bubbles || !1,
  12449. r.cancelable,
  12450. window,
  12451. r.ctrlKey,
  12452. r.altKey,
  12453. r.shiftKey,
  12454. r.metaKey,
  12455. r.keyCode,
  12456. r.charCode
  12457. );
  12458. break;
  12459. default:
  12460. s.initEvent(i, r.bubbles || !1, r.cancelable || !0);
  12461. }
  12462. e.defaults(s, o), t.dispatchEvent(s);
  12463. },
  12464. bind: function (e, t, i, n) {
  12465. return (
  12466. (n = n || !1),
  12467. e.addEventListener
  12468. ? e.addEventListener(t, i, n)
  12469. : e.attachEvent && e.attachEvent("on" + t, i),
  12470. o
  12471. );
  12472. },
  12473. unbind: function (e, t, i, n) {
  12474. return (
  12475. (n = n || !1),
  12476. e.removeEventListener
  12477. ? e.removeEventListener(t, i, n)
  12478. : e.detachEvent && e.detachEvent("on" + t, i),
  12479. o
  12480. );
  12481. },
  12482. addClass: function (e, t) {
  12483. if (void 0 === e.className) e.className = t;
  12484. else if (e.className !== t) {
  12485. var i = e.className.split(/ +/);
  12486. i.indexOf(t) == -1 &&
  12487. (i.push(t),
  12488. (e.className = i
  12489. .join(" ")
  12490. .replace(/^\s+/, "")
  12491. .replace(/\s+$/, "")));
  12492. }
  12493. return o;
  12494. },
  12495. removeClass: function (e, t) {
  12496. if (t)
  12497. if (void 0 === e.className);
  12498. else if (e.className === t) e.removeAttribute("class");
  12499. else {
  12500. var i = e.className.split(/ +/),
  12501. n = i.indexOf(t);
  12502. n != -1 && (i.splice(n, 1), (e.className = i.join(" ")));
  12503. }
  12504. else e.className = void 0;
  12505. return o;
  12506. },
  12507. hasClass: function (e, t) {
  12508. return (
  12509. new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(
  12510. e.className
  12511. ) || !1
  12512. );
  12513. },
  12514. getWidth: function (e) {
  12515. var i = getComputedStyle(e);
  12516. return (
  12517. t(i["border-left-width"]) +
  12518. t(i["border-right-width"]) +
  12519. t(i["padding-left"]) +
  12520. t(i["padding-right"]) +
  12521. t(i.width)
  12522. );
  12523. },
  12524. getHeight: function (e) {
  12525. var i = getComputedStyle(e);
  12526. return (
  12527. t(i["border-top-width"]) +
  12528. t(i["border-bottom-width"]) +
  12529. t(i["padding-top"]) +
  12530. t(i["padding-bottom"]) +
  12531. t(i.height)
  12532. );
  12533. },
  12534. getOffset: function (e) {
  12535. var t = {
  12536. left: 0,
  12537. top: 0,
  12538. };
  12539. if (e.offsetParent)
  12540. do (t.left += e.offsetLeft), (t.top += e.offsetTop);
  12541. while ((e = e.offsetParent));
  12542. return t;
  12543. },
  12544. isActive: function (e) {
  12545. return e === document.activeElement && (e.type || e.href);
  12546. },
  12547. };
  12548. return o;
  12549. })(n.utils.common)),
  12550. (n.controllers.OptionController = (function (e, t, i) {
  12551. var n = function (e, r, o) {
  12552. n.superclass.call(this, e, r);
  12553. var a = this;
  12554. if (
  12555. ((this.__select = document.createElement("select")),
  12556. i.isArray(o))
  12557. ) {
  12558. var s = {};
  12559. i.each(o, function (e) {
  12560. s[e] = e;
  12561. }),
  12562. (o = s);
  12563. }
  12564. i.each(o, function (e, t) {
  12565. var i = document.createElement("option");
  12566. (i.innerHTML = t),
  12567. i.setAttribute("value", e),
  12568. a.__select.appendChild(i);
  12569. }),
  12570. this.updateDisplay(),
  12571. t.bind(this.__select, "change", function () {
  12572. var e = this.options[this.selectedIndex].value;
  12573. a.setValue(e);
  12574. }),
  12575. this.domElement.appendChild(this.__select);
  12576. };
  12577. return (
  12578. (n.superclass = e),
  12579. i.extend(n.prototype, e.prototype, {
  12580. setValue: function (e) {
  12581. var t = n.superclass.prototype.setValue.call(this, e);
  12582. return (
  12583. this.__onFinishChange &&
  12584. this.__onFinishChange.call(this, this.getValue()),
  12585. t
  12586. );
  12587. },
  12588. updateDisplay: function () {
  12589. return (
  12590. (this.__select.value = this.getValue()),
  12591. n.superclass.prototype.updateDisplay.call(this)
  12592. );
  12593. },
  12594. }),
  12595. n
  12596. );
  12597. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  12598. (n.controllers.NumberController = (function (e, t) {
  12599. function i(e) {
  12600. return (
  12601. (e = e.toString()),
  12602. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  12603. );
  12604. }
  12605. var n = function (e, r, o) {
  12606. n.superclass.call(this, e, r),
  12607. (o = o || {}),
  12608. (this.__min = o.min),
  12609. (this.__max = o.max),
  12610. (this.__step = o.step),
  12611. t.isUndefined(this.__step)
  12612. ? 0 == this.initialValue
  12613. ? (this.__impliedStep = 1)
  12614. : (this.__impliedStep =
  12615. Math.pow(
  12616. 10,
  12617. Math.floor(Math.log(this.initialValue) / Math.LN10)
  12618. ) / 10)
  12619. : (this.__impliedStep = this.__step),
  12620. (this.__precision = i(this.__impliedStep));
  12621. };
  12622. return (
  12623. (n.superclass = e),
  12624. t.extend(n.prototype, e.prototype, {
  12625. setValue: function (e) {
  12626. return (
  12627. void 0 !== this.__min && e < this.__min
  12628. ? (e = this.__min)
  12629. : void 0 !== this.__max &&
  12630. e > this.__max &&
  12631. (e = this.__max),
  12632. void 0 !== this.__step &&
  12633. e % this.__step != 0 &&
  12634. (e = Math.round(e / this.__step) * this.__step),
  12635. n.superclass.prototype.setValue.call(this, e)
  12636. );
  12637. },
  12638. min: function (e) {
  12639. return (this.__min = e), this;
  12640. },
  12641. max: function (e) {
  12642. return (this.__max = e), this;
  12643. },
  12644. step: function (e) {
  12645. return (
  12646. (this.__step = e),
  12647. (this.__impliedStep = e),
  12648. (this.__precision = i(e)),
  12649. this
  12650. );
  12651. },
  12652. }),
  12653. n
  12654. );
  12655. })(n.controllers.Controller, n.utils.common)),
  12656. (n.controllers.NumberControllerBox = (function (e, t, i) {
  12657. function n(e, t) {
  12658. var i = Math.pow(10, t);
  12659. return Math.round(e * i) / i;
  12660. }
  12661. var r = function (e, n, o) {
  12662. function a() {
  12663. var e = parseFloat(d.__input.value);
  12664. i.isNaN(e) || d.setValue(e);
  12665. }
  12666. function s() {
  12667. a(),
  12668. d.__onFinishChange &&
  12669. d.__onFinishChange.call(d, d.getValue());
  12670. }
  12671. function l(e) {
  12672. t.bind(window, "mousemove", c),
  12673. t.bind(window, "mouseup", h),
  12674. (u = e.clientY);
  12675. }
  12676. function c(e) {
  12677. var t = u - e.clientY;
  12678. d.setValue(d.getValue() + t * d.__impliedStep), (u = e.clientY);
  12679. }
  12680. function h() {
  12681. t.unbind(window, "mousemove", c),
  12682. t.unbind(window, "mouseup", h);
  12683. }
  12684. (this.__truncationSuspended = !1),
  12685. r.superclass.call(this, e, n, o);
  12686. var u,
  12687. d = this;
  12688. (this.__input = document.createElement("input")),
  12689. this.__input.setAttribute("type", "text"),
  12690. t.bind(this.__input, "change", a),
  12691. t.bind(this.__input, "blur", s),
  12692. t.bind(this.__input, "mousedown", l),
  12693. t.bind(this.__input, "keydown", function (e) {
  12694. 13 === e.keyCode &&
  12695. ((d.__truncationSuspended = !0),
  12696. this.blur(),
  12697. (d.__truncationSuspended = !1));
  12698. }),
  12699. this.updateDisplay(),
  12700. this.domElement.appendChild(this.__input);
  12701. };
  12702. return (
  12703. (r.superclass = e),
  12704. i.extend(r.prototype, e.prototype, {
  12705. updateDisplay: function () {
  12706. return (
  12707. (this.__input.value = this.__truncationSuspended
  12708. ? this.getValue()
  12709. : n(this.getValue(), this.__precision)),
  12710. r.superclass.prototype.updateDisplay.call(this)
  12711. );
  12712. },
  12713. }),
  12714. r
  12715. );
  12716. })(n.controllers.NumberController, n.dom.dom, n.utils.common)),
  12717. (n.controllers.NumberControllerSlider = (function (e, t, i, n, r) {
  12718. function o(e, t, i, n, r) {
  12719. return n + (r - n) * ((e - t) / (i - t));
  12720. }
  12721. var a = function (e, i, n, r, s) {
  12722. function l(e) {
  12723. t.bind(window, "mousemove", c),
  12724. t.bind(window, "mouseup", h),
  12725. c(e);
  12726. }
  12727. function c(e) {
  12728. e.preventDefault();
  12729. var i = t.getOffset(u.__background),
  12730. n = t.getWidth(u.__background);
  12731. return (
  12732. u.setValue(
  12733. o(e.clientX, i.left, i.left + n, u.__min, u.__max)
  12734. ),
  12735. !1
  12736. );
  12737. }
  12738. function h() {
  12739. t.unbind(window, "mousemove", c),
  12740. t.unbind(window, "mouseup", h),
  12741. u.__onFinishChange &&
  12742. u.__onFinishChange.call(u, u.getValue());
  12743. }
  12744. a.superclass.call(this, e, i, {
  12745. min: n,
  12746. max: r,
  12747. step: s,
  12748. });
  12749. var u = this;
  12750. (this.__background = document.createElement("div")),
  12751. (this.__foreground = document.createElement("div")),
  12752. t.bind(this.__background, "mousedown", l),
  12753. t.addClass(this.__background, "slider"),
  12754. t.addClass(this.__foreground, "slider-fg"),
  12755. this.updateDisplay(),
  12756. this.__background.appendChild(this.__foreground),
  12757. this.domElement.appendChild(this.__background);
  12758. };
  12759. return (
  12760. (a.superclass = e),
  12761. (a.useDefaultStyles = function () {
  12762. i.inject(r);
  12763. }),
  12764. n.extend(a.prototype, e.prototype, {
  12765. updateDisplay: function () {
  12766. var e =
  12767. (this.getValue() - this.__min) / (this.__max - this.__min);
  12768. return (
  12769. (this.__foreground.style.width = 100 * e + "%"),
  12770. a.superclass.prototype.updateDisplay.call(this)
  12771. );
  12772. },
  12773. }),
  12774. a
  12775. );
  12776. })(
  12777. n.controllers.NumberController,
  12778. n.dom.dom,
  12779. n.utils.css,
  12780. n.utils.common,
  12781. "/**\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}"
  12782. )),
  12783. (n.controllers.FunctionController = (function (e, t, i) {
  12784. var n = function (e, i, r) {
  12785. n.superclass.call(this, e, i);
  12786. var o = this;
  12787. (this.__button = document.createElement("div")),
  12788. (this.__button.innerHTML = void 0 === r ? "Fire" : r),
  12789. t.bind(this.__button, "click", function (e) {
  12790. return e.preventDefault(), o.fire(), !1;
  12791. }),
  12792. t.addClass(this.__button, "button"),
  12793. this.domElement.appendChild(this.__button);
  12794. };
  12795. return (
  12796. (n.superclass = e),
  12797. i.extend(n.prototype, e.prototype, {
  12798. fire: function () {
  12799. this.__onChange && this.__onChange.call(this),
  12800. this.__onFinishChange &&
  12801. this.__onFinishChange.call(this, this.getValue()),
  12802. this.getValue().call(this.object);
  12803. },
  12804. }),
  12805. n
  12806. );
  12807. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  12808. (n.controllers.BooleanController = (function (e, t, i) {
  12809. var n = function (e, i) {
  12810. function r() {
  12811. o.setValue(!o.__prev);
  12812. }
  12813. n.superclass.call(this, e, i);
  12814. var o = this;
  12815. (this.__prev = this.getValue()),
  12816. (this.__checkbox = document.createElement("input")),
  12817. this.__checkbox.setAttribute("type", "checkbox"),
  12818. t.bind(this.__checkbox, "change", r, !1),
  12819. this.domElement.appendChild(this.__checkbox),
  12820. this.updateDisplay();
  12821. };
  12822. return (
  12823. (n.superclass = e),
  12824. i.extend(n.prototype, e.prototype, {
  12825. setValue: function (e) {
  12826. var t = n.superclass.prototype.setValue.call(this, e);
  12827. return (
  12828. this.__onFinishChange &&
  12829. this.__onFinishChange.call(this, this.getValue()),
  12830. (this.__prev = this.getValue()),
  12831. t
  12832. );
  12833. },
  12834. updateDisplay: function () {
  12835. return (
  12836. this.getValue() === !0
  12837. ? (this.__checkbox.setAttribute("checked", "checked"),
  12838. (this.__checkbox.checked = !0))
  12839. : (this.__checkbox.checked = !1),
  12840. n.superclass.prototype.updateDisplay.call(this)
  12841. );
  12842. },
  12843. }),
  12844. n
  12845. );
  12846. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  12847. (n.color.toString = (function (e) {
  12848. return function (t) {
  12849. if (1 == t.a || e.isUndefined(t.a)) {
  12850. for (var i = t.hex.toString(16); i.length < 6; ) i = "0" + i;
  12851. return "#" + i;
  12852. }
  12853. return (
  12854. "rgba(" +
  12855. Math.round(t.r) +
  12856. "," +
  12857. Math.round(t.g) +
  12858. "," +
  12859. Math.round(t.b) +
  12860. "," +
  12861. t.a +
  12862. ")"
  12863. );
  12864. };
  12865. })(n.utils.common)),
  12866. (n.color.interpret = (function (e, t) {
  12867. var i,
  12868. n,
  12869. r = function () {
  12870. n = !1;
  12871. var e =
  12872. arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  12873. return (
  12874. t.each(o, function (r) {
  12875. if (r.litmus(e))
  12876. return (
  12877. t.each(r.conversions, function (r, o) {
  12878. if (((i = r.read(e)), n === !1 && i !== !1))
  12879. return (
  12880. (n = i),
  12881. (i.conversionName = o),
  12882. (i.conversion = r),
  12883. t.BREAK
  12884. );
  12885. }),
  12886. t.BREAK
  12887. );
  12888. }),
  12889. n
  12890. );
  12891. },
  12892. o = [
  12893. {
  12894. litmus: t.isString,
  12895. conversions: {
  12896. THREE_CHAR_HEX: {
  12897. read: function (e) {
  12898. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  12899. return (
  12900. null !== t && {
  12901. space: "HEX",
  12902. hex: parseInt(
  12903. "0x" +
  12904. t[1].toString() +
  12905. t[1].toString() +
  12906. t[2].toString() +
  12907. t[2].toString() +
  12908. t[3].toString() +
  12909. t[3].toString()
  12910. ),
  12911. }
  12912. );
  12913. },
  12914. write: e,
  12915. },
  12916. SIX_CHAR_HEX: {
  12917. read: function (e) {
  12918. var t = e.match(/^#([A-F0-9]{6})$/i);
  12919. return (
  12920. null !== t && {
  12921. space: "HEX",
  12922. hex: parseInt("0x" + t[1].toString()),
  12923. }
  12924. );
  12925. },
  12926. write: e,
  12927. },
  12928. CSS_RGB: {
  12929. read: function (e) {
  12930. var t = e.match(
  12931. /^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/
  12932. );
  12933. return (
  12934. null !== t && {
  12935. space: "RGB",
  12936. r: parseFloat(t[1]),
  12937. g: parseFloat(t[2]),
  12938. b: parseFloat(t[3]),
  12939. }
  12940. );
  12941. },
  12942. write: e,
  12943. },
  12944. CSS_RGBA: {
  12945. read: function (e) {
  12946. var t = e.match(
  12947. /^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/
  12948. );
  12949. return (
  12950. null !== t && {
  12951. space: "RGB",
  12952. r: parseFloat(t[1]),
  12953. g: parseFloat(t[2]),
  12954. b: parseFloat(t[3]),
  12955. a: parseFloat(t[4]),
  12956. }
  12957. );
  12958. },
  12959. write: e,
  12960. },
  12961. },
  12962. },
  12963. {
  12964. litmus: t.isNumber,
  12965. conversions: {
  12966. HEX: {
  12967. read: function (e) {
  12968. return {
  12969. space: "HEX",
  12970. hex: e,
  12971. conversionName: "HEX",
  12972. };
  12973. },
  12974. write: function (e) {
  12975. return e.hex;
  12976. },
  12977. },
  12978. },
  12979. },
  12980. {
  12981. litmus: t.isArray,
  12982. conversions: {
  12983. RGB_ARRAY: {
  12984. read: function (e) {
  12985. return (
  12986. 3 == e.length && {
  12987. space: "RGB",
  12988. r: e[0],
  12989. g: e[1],
  12990. b: e[2],
  12991. }
  12992. );
  12993. },
  12994. write: function (e) {
  12995. return [e.r, e.g, e.b];
  12996. },
  12997. },
  12998. RGBA_ARRAY: {
  12999. read: function (e) {
  13000. return (
  13001. 4 == e.length && {
  13002. space: "RGB",
  13003. r: e[0],
  13004. g: e[1],
  13005. b: e[2],
  13006. a: e[3],
  13007. }
  13008. );
  13009. },
  13010. write: function (e) {
  13011. return [e.r, e.g, e.b, e.a];
  13012. },
  13013. },
  13014. },
  13015. },
  13016. {
  13017. litmus: t.isObject,
  13018. conversions: {
  13019. RGBA_OBJ: {
  13020. read: function (e) {
  13021. return (
  13022. !!(
  13023. t.isNumber(e.r) &&
  13024. t.isNumber(e.g) &&
  13025. t.isNumber(e.b) &&
  13026. t.isNumber(e.a)
  13027. ) && {
  13028. space: "RGB",
  13029. r: e.r,
  13030. g: e.g,
  13031. b: e.b,
  13032. a: e.a,
  13033. }
  13034. );
  13035. },
  13036. write: function (e) {
  13037. return {
  13038. r: e.r,
  13039. g: e.g,
  13040. b: e.b,
  13041. a: e.a,
  13042. };
  13043. },
  13044. },
  13045. RGB_OBJ: {
  13046. read: function (e) {
  13047. return (
  13048. !!(
  13049. t.isNumber(e.r) &&
  13050. t.isNumber(e.g) &&
  13051. t.isNumber(e.b)
  13052. ) && {
  13053. space: "RGB",
  13054. r: e.r,
  13055. g: e.g,
  13056. b: e.b,
  13057. }
  13058. );
  13059. },
  13060. write: function (e) {
  13061. return {
  13062. r: e.r,
  13063. g: e.g,
  13064. b: e.b,
  13065. };
  13066. },
  13067. },
  13068. HSVA_OBJ: {
  13069. read: function (e) {
  13070. return (
  13071. !!(
  13072. t.isNumber(e.h) &&
  13073. t.isNumber(e.s) &&
  13074. t.isNumber(e.v) &&
  13075. t.isNumber(e.a)
  13076. ) && {
  13077. space: "HSV",
  13078. h: e.h,
  13079. s: e.s,
  13080. v: e.v,
  13081. a: e.a,
  13082. }
  13083. );
  13084. },
  13085. write: function (e) {
  13086. return {
  13087. h: e.h,
  13088. s: e.s,
  13089. v: e.v,
  13090. a: e.a,
  13091. };
  13092. },
  13093. },
  13094. HSV_OBJ: {
  13095. read: function (e) {
  13096. return (
  13097. !!(
  13098. t.isNumber(e.h) &&
  13099. t.isNumber(e.s) &&
  13100. t.isNumber(e.v)
  13101. ) && {
  13102. space: "HSV",
  13103. h: e.h,
  13104. s: e.s,
  13105. v: e.v,
  13106. }
  13107. );
  13108. },
  13109. write: function (e) {
  13110. return {
  13111. h: e.h,
  13112. s: e.s,
  13113. v: e.v,
  13114. };
  13115. },
  13116. },
  13117. },
  13118. },
  13119. ];
  13120. return r;
  13121. })(n.color.toString, n.utils.common)),
  13122. (n.GUI = n.gui.GUI =
  13123. (function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  13124. function g(e, t, i, o) {
  13125. if (void 0 === t[i])
  13126. throw new Error(
  13127. "Object " + t + ' has no property "' + i + '"'
  13128. );
  13129. var a;
  13130. if (o.color) a = new h(t, i);
  13131. else {
  13132. var s = [t, i].concat(o.factoryArgs);
  13133. a = n.apply(e, s);
  13134. }
  13135. o.before instanceof r && (o.before = o.before.__li),
  13136. A(e, a),
  13137. p.addClass(a.domElement, "c");
  13138. var l = document.createElement("span");
  13139. p.addClass(l, "property-name"), (l.innerHTML = a.property);
  13140. var c = document.createElement("div");
  13141. c.appendChild(l), c.appendChild(a.domElement);
  13142. var u = m(e, c, o.before);
  13143. return (
  13144. p.addClass(u, V.CLASS_CONTROLLER_ROW),
  13145. p.addClass(u, typeof a.getValue()),
  13146. v(e, u, a),
  13147. e.__controllers.push(a),
  13148. a
  13149. );
  13150. }
  13151. function m(e, t, i) {
  13152. var n = document.createElement("li");
  13153. return (
  13154. t && n.appendChild(t),
  13155. i
  13156. ? e.__ul.insertBefore(n, params.before)
  13157. : e.__ul.appendChild(n),
  13158. e.onResize(),
  13159. n
  13160. );
  13161. }
  13162. function v(e, t, i) {
  13163. if (
  13164. ((i.__li = t),
  13165. (i.__gui = e),
  13166. f.extend(i, {
  13167. options: function (t) {
  13168. return arguments.length > 1
  13169. ? (i.remove(),
  13170. g(e, i.object, i.property, {
  13171. before: i.__li.nextElementSibling,
  13172. factoryArgs: [f.toArray(arguments)],
  13173. }))
  13174. : f.isArray(t) || f.isObject(t)
  13175. ? (i.remove(),
  13176. g(e, i.object, i.property, {
  13177. before: i.__li.nextElementSibling,
  13178. factoryArgs: [t],
  13179. }))
  13180. : void 0;
  13181. },
  13182. name: function (e) {
  13183. return (
  13184. (i.__li.firstElementChild.firstElementChild.innerHTML =
  13185. e),
  13186. i
  13187. );
  13188. },
  13189. listen: function () {
  13190. return i.__gui.listen(i), i;
  13191. },
  13192. remove: function () {
  13193. return i.__gui.remove(i), i;
  13194. },
  13195. }),
  13196. i instanceof l)
  13197. ) {
  13198. var n = new s(i.object, i.property, {
  13199. min: i.__min,
  13200. max: i.__max,
  13201. step: i.__step,
  13202. });
  13203. f.each(
  13204. ["updateDisplay", "onChange", "onFinishChange"],
  13205. function (e) {
  13206. var t = i[e],
  13207. r = n[e];
  13208. i[e] = n[e] = function () {
  13209. var e = Array.prototype.slice.call(arguments);
  13210. return t.apply(i, e), r.apply(n, e);
  13211. };
  13212. }
  13213. ),
  13214. p.addClass(t, "has-slider"),
  13215. i.domElement.insertBefore(
  13216. n.domElement,
  13217. i.domElement.firstElementChild
  13218. );
  13219. } else if (i instanceof s) {
  13220. var r = function (t) {
  13221. return f.isNumber(i.__min) && f.isNumber(i.__max)
  13222. ? (i.remove(),
  13223. g(e, i.object, i.property, {
  13224. before: i.__li.nextElementSibling,
  13225. factoryArgs: [i.__min, i.__max, i.__step],
  13226. }))
  13227. : t;
  13228. };
  13229. (i.min = f.compose(r, i.min)), (i.max = f.compose(r, i.max));
  13230. } else
  13231. i instanceof o
  13232. ? (p.bind(t, "click", function () {
  13233. p.fakeEvent(i.__checkbox, "click");
  13234. }),
  13235. p.bind(i.__checkbox, "click", function (e) {
  13236. e.stopPropagation();
  13237. }))
  13238. : i instanceof a
  13239. ? (p.bind(t, "click", function () {
  13240. p.fakeEvent(i.__button, "click");
  13241. }),
  13242. p.bind(t, "mouseover", function () {
  13243. p.addClass(i.__button, "hover");
  13244. }),
  13245. p.bind(t, "mouseout", function () {
  13246. p.removeClass(i.__button, "hover");
  13247. }))
  13248. : i instanceof h &&
  13249. (p.addClass(t, "color"),
  13250. (i.updateDisplay = f.compose(function (e) {
  13251. return (
  13252. (t.style.borderLeftColor = i.__color.toString()), e
  13253. );
  13254. }, i.updateDisplay)),
  13255. i.updateDisplay());
  13256. i.setValue = f.compose(function (t) {
  13257. return (
  13258. e.getRoot().__preset_select &&
  13259. i.isModified() &&
  13260. T(e.getRoot(), !0),
  13261. t
  13262. );
  13263. }, i.setValue);
  13264. }
  13265. function A(e, t) {
  13266. var i = e.getRoot(),
  13267. n = i.__rememberedObjects.indexOf(t.object);
  13268. if (n != -1) {
  13269. var r = i.__rememberedObjectIndecesToControllers[n];
  13270. if (
  13271. (void 0 === r &&
  13272. ((r = {}),
  13273. (i.__rememberedObjectIndecesToControllers[n] = r)),
  13274. (r[t.property] = t),
  13275. i.load && i.load.remembered)
  13276. ) {
  13277. var o,
  13278. a = i.load.remembered;
  13279. if (a[e.preset]) o = a[e.preset];
  13280. else {
  13281. if (!a[L]) return;
  13282. o = a[L];
  13283. }
  13284. if (o[n] && void 0 !== o[n][t.property]) {
  13285. var s = o[n][t.property];
  13286. (t.initialValue = s), t.setValue(s);
  13287. }
  13288. }
  13289. }
  13290. }
  13291. function y(e, t) {
  13292. return document.location.href + "." + t;
  13293. }
  13294. function C(e) {
  13295. var t = (e.__save_row = document.createElement("li"));
  13296. p.addClass(e.domElement, "has-save"),
  13297. e.__ul.insertBefore(t, e.__ul.firstChild),
  13298. p.addClass(t, "save-row");
  13299. var i = document.createElement("span");
  13300. (i.innerHTML = "&nbsp;"), p.addClass(i, "button gears");
  13301. var n = document.createElement("span");
  13302. (n.innerHTML = "Save"),
  13303. p.addClass(n, "button"),
  13304. p.addClass(n, "save");
  13305. var r = document.createElement("span");
  13306. (r.innerHTML = "New"),
  13307. p.addClass(r, "button"),
  13308. p.addClass(r, "save-as");
  13309. var o = document.createElement("span");
  13310. (o.innerHTML = "Revert"),
  13311. p.addClass(o, "button"),
  13312. p.addClass(o, "revert");
  13313. var a = (e.__preset_select = document.createElement("select"));
  13314. if (
  13315. (e.load && e.load.remembered
  13316. ? f.each(e.load.remembered, function (t, i) {
  13317. w(e, i, i == e.preset);
  13318. })
  13319. : w(e, L, !1),
  13320. p.bind(a, "change", function () {
  13321. for (var t = 0; t < e.__preset_select.length; t++)
  13322. e.__preset_select[t].innerHTML =
  13323. e.__preset_select[t].value;
  13324. e.preset = this.value;
  13325. }),
  13326. t.appendChild(a),
  13327. t.appendChild(i),
  13328. t.appendChild(n),
  13329. t.appendChild(r),
  13330. t.appendChild(o),
  13331. D)
  13332. ) {
  13333. var s = document.getElementById("dg-save-locally"),
  13334. l = document.getElementById("dg-local-explain");
  13335. s.style.display = "block";
  13336. var c = document.getElementById("dg-local-storage");
  13337. "true" === localStorage.getItem(y(e, "isLocal")) &&
  13338. c.setAttribute("checked", "checked");
  13339. var h = function () {
  13340. l.style.display = e.useLocalStorage ? "block" : "none";
  13341. };
  13342. h(),
  13343. p.bind(c, "change", function () {
  13344. (e.useLocalStorage = !e.useLocalStorage), h();
  13345. });
  13346. }
  13347. var u = document.getElementById("dg-new-constructor");
  13348. p.bind(u, "keydown", function (e) {
  13349. !e.metaKey || (67 !== e.which && 67 != e.keyCode) || S.hide();
  13350. }),
  13351. p.bind(i, "click", function () {
  13352. (u.innerHTML = JSON.stringify(
  13353. e.getSaveObject(),
  13354. void 0,
  13355. 2
  13356. )),
  13357. S.show(),
  13358. u.focus(),
  13359. u.select();
  13360. }),
  13361. p.bind(n, "click", function () {
  13362. e.save();
  13363. }),
  13364. p.bind(r, "click", function () {
  13365. var t = prompt("Enter a new preset name.");
  13366. t && e.saveAs(t);
  13367. }),
  13368. p.bind(o, "click", function () {
  13369. e.revert();
  13370. });
  13371. }
  13372. function I(e) {
  13373. function t(t) {
  13374. return (
  13375. t.preventDefault(),
  13376. (r = t.clientX),
  13377. p.addClass(e.__closeButton, V.CLASS_DRAG),
  13378. p.bind(window, "mousemove", i),
  13379. p.bind(window, "mouseup", n),
  13380. !1
  13381. );
  13382. }
  13383. function i(t) {
  13384. return (
  13385. t.preventDefault(),
  13386. (e.width += r - t.clientX),
  13387. e.onResize(),
  13388. (r = t.clientX),
  13389. !1
  13390. );
  13391. }
  13392. function n() {
  13393. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  13394. p.unbind(window, "mousemove", i),
  13395. p.unbind(window, "mouseup", n);
  13396. }
  13397. (e.__resize_handle = document.createElement("div")),
  13398. f.extend(e.__resize_handle.style, {
  13399. width: "6px",
  13400. marginLeft: "-3px",
  13401. height: "200px",
  13402. cursor: "ew-resize",
  13403. position: "absolute",
  13404. });
  13405. var r;
  13406. p.bind(e.__resize_handle, "mousedown", t),
  13407. p.bind(e.__closeButton, "mousedown", t),
  13408. e.domElement.insertBefore(
  13409. e.__resize_handle,
  13410. e.domElement.firstElementChild
  13411. );
  13412. }
  13413. function E(e, t) {
  13414. (e.domElement.style.width = t + "px"),
  13415. e.__save_row &&
  13416. e.autoPlace &&
  13417. (e.__save_row.style.width = t + "px"),
  13418. e.__closeButton && (e.__closeButton.style.width = t + "px");
  13419. }
  13420. function b(e, t) {
  13421. var i = {};
  13422. return (
  13423. f.each(e.__rememberedObjects, function (n, r) {
  13424. var o = {},
  13425. a = e.__rememberedObjectIndecesToControllers[r];
  13426. f.each(a, function (e, i) {
  13427. o[i] = t ? e.initialValue : e.getValue();
  13428. }),
  13429. (i[r] = o);
  13430. }),
  13431. i
  13432. );
  13433. }
  13434. function w(e, t, i) {
  13435. var n = document.createElement("option");
  13436. (n.innerHTML = t),
  13437. (n.value = t),
  13438. e.__preset_select.appendChild(n),
  13439. i &&
  13440. (e.__preset_select.selectedIndex =
  13441. e.__preset_select.length - 1);
  13442. }
  13443. function _(e) {
  13444. for (var t = 0; t < e.__preset_select.length; t++)
  13445. e.__preset_select[t].value == e.preset &&
  13446. (e.__preset_select.selectedIndex = t);
  13447. }
  13448. function T(e, t) {
  13449. var i = e.__preset_select[e.__preset_select.selectedIndex];
  13450. t ? (i.innerHTML = i.value + "*") : (i.innerHTML = i.value);
  13451. }
  13452. function x(e) {
  13453. 0 != e.length &&
  13454. u(function () {
  13455. x(e);
  13456. }),
  13457. f.each(e, function (e) {
  13458. e.updateDisplay();
  13459. });
  13460. }
  13461. e.inject(i);
  13462. var S,
  13463. M,
  13464. R = "dg",
  13465. P = 72,
  13466. O = 20,
  13467. L = "Default",
  13468. D = (function () {
  13469. try {
  13470. return (
  13471. "localStorage" in window && null !== window.localStorage
  13472. );
  13473. } catch (e) {
  13474. return !1;
  13475. }
  13476. })(),
  13477. N = !0,
  13478. B = !1,
  13479. F = [],
  13480. V = function (e) {
  13481. function t() {
  13482. var e = i.getRoot();
  13483. (e.width += 1),
  13484. f.defer(function () {
  13485. e.width -= 1;
  13486. });
  13487. }
  13488. var i = this;
  13489. (this.domElement = document.createElement("div")),
  13490. (this.__ul = document.createElement("ul")),
  13491. this.domElement.appendChild(this.__ul),
  13492. p.addClass(this.domElement, R),
  13493. (this.__folders = {}),
  13494. (this.__controllers = []),
  13495. (this.__rememberedObjects = []),
  13496. (this.__rememberedObjectIndecesToControllers = []),
  13497. (this.__listening = []),
  13498. (e = e || {}),
  13499. (e = f.defaults(e, {
  13500. autoPlace: !0,
  13501. width: V.DEFAULT_WIDTH,
  13502. })),
  13503. (e = f.defaults(e, {
  13504. resizable: e.autoPlace,
  13505. hideable: e.autoPlace,
  13506. })),
  13507. f.isUndefined(e.load)
  13508. ? (e.load = {
  13509. preset: L,
  13510. })
  13511. : e.preset && (e.load.preset = e.preset),
  13512. f.isUndefined(e.parent) && e.hideable && F.push(this),
  13513. (e.resizable = f.isUndefined(e.parent) && e.resizable),
  13514. e.autoPlace &&
  13515. f.isUndefined(e.scrollable) &&
  13516. (e.scrollable = !0);
  13517. var n,
  13518. r =
  13519. D && "true" === localStorage.getItem(y(this, "isLocal"));
  13520. if (
  13521. (Object.defineProperties(this, {
  13522. parent: {
  13523. get: function () {
  13524. return e.parent;
  13525. },
  13526. },
  13527. scrollable: {
  13528. get: function () {
  13529. return e.scrollable;
  13530. },
  13531. },
  13532. autoPlace: {
  13533. get: function () {
  13534. return e.autoPlace;
  13535. },
  13536. },
  13537. preset: {
  13538. get: function () {
  13539. return i.parent ? i.getRoot().preset : e.load.preset;
  13540. },
  13541. set: function (t) {
  13542. i.parent
  13543. ? (i.getRoot().preset = t)
  13544. : (e.load.preset = t),
  13545. _(this),
  13546. i.revert();
  13547. },
  13548. },
  13549. width: {
  13550. get: function () {
  13551. return e.width;
  13552. },
  13553. set: function (t) {
  13554. (e.width = t), E(i, t);
  13555. },
  13556. },
  13557. name: {
  13558. get: function () {
  13559. return e.name;
  13560. },
  13561. set: function (t) {
  13562. (e.name = t), a && (a.innerHTML = e.name);
  13563. },
  13564. },
  13565. closed: {
  13566. get: function () {
  13567. return e.closed;
  13568. },
  13569. set: function (t) {
  13570. (e.closed = t),
  13571. e.closed
  13572. ? p.addClass(i.__ul, V.CLASS_CLOSED)
  13573. : p.removeClass(i.__ul, V.CLASS_CLOSED),
  13574. this.onResize(),
  13575. i.__closeButton &&
  13576. (i.__closeButton.innerHTML = t
  13577. ? V.TEXT_OPEN
  13578. : V.TEXT_CLOSED);
  13579. },
  13580. },
  13581. load: {
  13582. get: function () {
  13583. return e.load;
  13584. },
  13585. },
  13586. useLocalStorage: {
  13587. get: function () {
  13588. return r;
  13589. },
  13590. set: function (e) {
  13591. D &&
  13592. ((r = e),
  13593. e
  13594. ? p.bind(window, "unload", n)
  13595. : p.unbind(window, "unload", n),
  13596. localStorage.setItem(y(i, "isLocal"), e));
  13597. },
  13598. },
  13599. }),
  13600. f.isUndefined(e.parent))
  13601. ) {
  13602. if (
  13603. ((e.closed = !1),
  13604. p.addClass(this.domElement, V.CLASS_MAIN),
  13605. p.makeSelectable(this.domElement, !1),
  13606. D && r)
  13607. ) {
  13608. i.useLocalStorage = !0;
  13609. var o = localStorage.getItem(y(this, "gui"));
  13610. o && (e.load = JSON.parse(o));
  13611. }
  13612. (this.__closeButton = document.createElement("div")),
  13613. (this.__closeButton.innerHTML = V.TEXT_CLOSED),
  13614. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  13615. this.domElement.appendChild(this.__closeButton),
  13616. p.bind(this.__closeButton, "click", function () {
  13617. i.closed = !i.closed;
  13618. });
  13619. } else {
  13620. void 0 === e.closed && (e.closed = !0);
  13621. var a = document.createTextNode(e.name);
  13622. p.addClass(a, "controller-name");
  13623. var s = m(i, a),
  13624. l = function (e) {
  13625. return e.preventDefault(), (i.closed = !i.closed), !1;
  13626. };
  13627. p.addClass(this.__ul, V.CLASS_CLOSED),
  13628. p.addClass(s, "title"),
  13629. p.bind(s, "click", l),
  13630. e.closed || (this.closed = !1);
  13631. }
  13632. e.autoPlace &&
  13633. (f.isUndefined(e.parent) &&
  13634. (N &&
  13635. ((M = document.createElement("div")),
  13636. p.addClass(M, R),
  13637. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  13638. document.body.appendChild(M),
  13639. (N = !1)),
  13640. M.appendChild(this.domElement),
  13641. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  13642. this.parent || E(i, e.width)),
  13643. p.bind(window, "resize", function () {
  13644. i.onResize();
  13645. }),
  13646. p.bind(this.__ul, "webkitTransitionEnd", function () {
  13647. i.onResize();
  13648. }),
  13649. p.bind(this.__ul, "transitionend", function () {
  13650. i.onResize();
  13651. }),
  13652. p.bind(this.__ul, "oTransitionEnd", function () {
  13653. i.onResize();
  13654. }),
  13655. this.onResize(),
  13656. e.resizable && I(this),
  13657. (n = function () {
  13658. D &&
  13659. "true" === localStorage.getItem(y(i, "isLocal")) &&
  13660. localStorage.setItem(
  13661. y(i, "gui"),
  13662. JSON.stringify(i.getSaveObject())
  13663. );
  13664. }),
  13665. (this.saveToLocalStorageIfPossible = n);
  13666. i.getRoot();
  13667. e.parent || t();
  13668. };
  13669. return (
  13670. (V.toggleHide = function () {
  13671. (B = !B),
  13672. f.each(F, function (e) {
  13673. (e.domElement.style.zIndex = B ? -999 : 999),
  13674. (e.domElement.style.opacity = B ? 0 : 1);
  13675. });
  13676. }),
  13677. (V.CLASS_AUTO_PLACE = "a"),
  13678. (V.CLASS_AUTO_PLACE_CONTAINER = "ac"),
  13679. (V.CLASS_MAIN = "main"),
  13680. (V.CLASS_CONTROLLER_ROW = "cr"),
  13681. (V.CLASS_TOO_TALL = "taller-than-window"),
  13682. (V.CLASS_CLOSED = "closed"),
  13683. (V.CLASS_CLOSE_BUTTON = "close-button"),
  13684. (V.CLASS_DRAG = "drag"),
  13685. (V.DEFAULT_WIDTH = 245),
  13686. (V.TEXT_CLOSED = "Close Controls"),
  13687. (V.TEXT_OPEN = "Open Controls"),
  13688. p.bind(
  13689. window,
  13690. "keydown",
  13691. function (e) {
  13692. "text" === document.activeElement.type ||
  13693. (e.which !== P && e.keyCode != P) ||
  13694. V.toggleHide();
  13695. },
  13696. !1
  13697. ),
  13698. f.extend(V.prototype, {
  13699. add: function (e, t) {
  13700. return g(this, e, t, {
  13701. factoryArgs: Array.prototype.slice.call(arguments, 2),
  13702. });
  13703. },
  13704. addColor: function (e, t) {
  13705. return g(this, e, t, {
  13706. color: !0,
  13707. });
  13708. },
  13709. remove: function (e) {
  13710. this.__ul.removeChild(e.__li),
  13711. this.__controllers.slice(
  13712. this.__controllers.indexOf(e),
  13713. 1
  13714. );
  13715. var t = this;
  13716. f.defer(function () {
  13717. t.onResize();
  13718. });
  13719. },
  13720. destroy: function () {
  13721. this.autoPlace && M.removeChild(this.domElement);
  13722. },
  13723. addFolder: function (e) {
  13724. if (void 0 !== this.__folders[e])
  13725. throw new Error(
  13726. 'You already have a folder in this GUI by the name "' +
  13727. e +
  13728. '"'
  13729. );
  13730. var t = {
  13731. name: e,
  13732. parent: this,
  13733. };
  13734. (t.autoPlace = this.autoPlace),
  13735. this.load &&
  13736. this.load.folders &&
  13737. this.load.folders[e] &&
  13738. ((t.closed = this.load.folders[e].closed),
  13739. (t.load = this.load.folders[e]));
  13740. var i = new V(t);
  13741. this.__folders[e] = i;
  13742. var n = m(this, i.domElement);
  13743. return p.addClass(n, "folder"), i;
  13744. },
  13745. open: function () {
  13746. this.closed = !1;
  13747. },
  13748. close: function () {
  13749. this.closed = !0;
  13750. },
  13751. onResize: function () {
  13752. var e = this.getRoot();
  13753. if (e.scrollable) {
  13754. var t = p.getOffset(e.__ul).top,
  13755. i = 0;
  13756. f.each(e.__ul.childNodes, function (t) {
  13757. (e.autoPlace && t === e.__save_row) ||
  13758. (i += p.getHeight(t));
  13759. }),
  13760. $("#player").height() - t - O < i
  13761. ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  13762. (e.__ul.style.height =
  13763. $("#player").height() - t - O + "px"))
  13764. : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  13765. (e.__ul.style.height = "auto"));
  13766. }
  13767. e.__resize_handle &&
  13768. f.defer(function () {
  13769. e.__resize_handle.style.height =
  13770. e.__ul.offsetHeight + "px";
  13771. }),
  13772. e.__closeButton &&
  13773. (e.__closeButton.style.width = e.width + "px");
  13774. },
  13775. remember: function () {
  13776. if (
  13777. (f.isUndefined(S) &&
  13778. ((S = new d()), (S.domElement.innerHTML = t)),
  13779. this.parent)
  13780. )
  13781. throw new Error(
  13782. "You can only call remember on a top level GUI."
  13783. );
  13784. var e = this;
  13785. f.each(Array.prototype.slice.call(arguments), function (t) {
  13786. 0 == e.__rememberedObjects.length && C(e),
  13787. e.__rememberedObjects.indexOf(t) == -1 &&
  13788. e.__rememberedObjects.push(t);
  13789. }),
  13790. this.autoPlace && E(this, this.width);
  13791. },
  13792. getRoot: function () {
  13793. for (var e = this; e.parent; ) e = e.parent;
  13794. return e;
  13795. },
  13796. getSaveObject: function () {
  13797. var e = this.load;
  13798. return (
  13799. (e.closed = this.closed),
  13800. this.__rememberedObjects.length > 0 &&
  13801. ((e.preset = this.preset),
  13802. e.remembered || (e.remembered = {}),
  13803. (e.remembered[this.preset] = b(this))),
  13804. (e.folders = {}),
  13805. f.each(this.__folders, function (t, i) {
  13806. e.folders[i] = t.getSaveObject();
  13807. }),
  13808. e
  13809. );
  13810. },
  13811. save: function () {
  13812. this.load.remembered || (this.load.remembered = {}),
  13813. (this.load.remembered[this.preset] = b(this)),
  13814. T(this, !1),
  13815. this.saveToLocalStorageIfPossible();
  13816. },
  13817. saveAs: function (e) {
  13818. this.load.remembered ||
  13819. ((this.load.remembered = {}),
  13820. (this.load.remembered[L] = b(this, !0))),
  13821. (this.load.remembered[e] = b(this)),
  13822. (this.preset = e),
  13823. w(this, e, !0),
  13824. this.saveToLocalStorageIfPossible();
  13825. },
  13826. revert: function (e) {
  13827. f.each(
  13828. this.__controllers,
  13829. function (t) {
  13830. this.getRoot().load.remembered
  13831. ? A(e || this.getRoot(), t)
  13832. : t.setValue(t.initialValue);
  13833. },
  13834. this
  13835. ),
  13836. f.each(this.__folders, function (e) {
  13837. e.revert(e);
  13838. }),
  13839. e || T(this.getRoot(), !1);
  13840. },
  13841. listen: function (e) {
  13842. var t = 0 == this.__listening.length;
  13843. this.__listening.push(e), t && x(this.__listening);
  13844. },
  13845. }),
  13846. V
  13847. );
  13848. })(
  13849. n.utils.css,
  13850. '<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>',
  13851. ".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",
  13852. (n.controllers.factory = (function (e, t, i, n, r, o, a) {
  13853. return function (s, l) {
  13854. var c = s[l];
  13855. return a.isArray(arguments[2]) || a.isObject(arguments[2])
  13856. ? new e(s, l, arguments[2])
  13857. : a.isNumber(c)
  13858. ? a.isNumber(arguments[2]) && a.isNumber(arguments[3])
  13859. ? new i(s, l, arguments[2], arguments[3])
  13860. : new t(s, l, {
  13861. min: arguments[2],
  13862. max: arguments[3],
  13863. })
  13864. : a.isString(c)
  13865. ? new n(s, l)
  13866. : a.isFunction(c)
  13867. ? new r(s, l, "")
  13868. : a.isBoolean(c)
  13869. ? new o(s, l)
  13870. : void 0;
  13871. };
  13872. })(
  13873. n.controllers.OptionController,
  13874. n.controllers.NumberControllerBox,
  13875. n.controllers.NumberControllerSlider,
  13876. (n.controllers.StringController = (function (e, t, i) {
  13877. var n = function (e, i) {
  13878. function r() {
  13879. a.setValue(a.__input.value);
  13880. }
  13881. function o() {
  13882. a.__onFinishChange &&
  13883. a.__onFinishChange.call(a, a.getValue());
  13884. }
  13885. n.superclass.call(this, e, i);
  13886. var a = this;
  13887. (this.__input = document.createElement("input")),
  13888. this.__input.setAttribute("type", "text"),
  13889. t.bind(this.__input, "keyup", r),
  13890. t.bind(this.__input, "change", r),
  13891. t.bind(this.__input, "blur", o),
  13892. t.bind(this.__input, "keydown", function (e) {
  13893. 13 === e.keyCode && this.blur();
  13894. }),
  13895. this.updateDisplay(),
  13896. this.domElement.appendChild(this.__input);
  13897. };
  13898. return (
  13899. (n.superclass = e),
  13900. i.extend(n.prototype, e.prototype, {
  13901. updateDisplay: function () {
  13902. return (
  13903. t.isActive(this.__input) ||
  13904. (this.__input.value = this.getValue()),
  13905. n.superclass.prototype.updateDisplay.call(this)
  13906. );
  13907. },
  13908. }),
  13909. n
  13910. );
  13911. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  13912. n.controllers.FunctionController,
  13913. n.controllers.BooleanController,
  13914. n.utils.common
  13915. )),
  13916. n.controllers.Controller,
  13917. n.controllers.BooleanController,
  13918. n.controllers.FunctionController,
  13919. n.controllers.NumberControllerBox,
  13920. n.controllers.NumberControllerSlider,
  13921. n.controllers.OptionController,
  13922. (n.controllers.ColorController = (function (e, t, i, n, r) {
  13923. function o(e, t, i, n) {
  13924. (e.style.background = ""),
  13925. r.each(l, function (r) {
  13926. e.style.cssText +=
  13927. "background: " +
  13928. r +
  13929. "linear-gradient(" +
  13930. t +
  13931. ", " +
  13932. i +
  13933. " 0%, " +
  13934. n +
  13935. " 100%); ";
  13936. });
  13937. }
  13938. function a(e) {
  13939. (e.style.background = ""),
  13940. (e.style.cssText +=
  13941. "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);"),
  13942. (e.style.cssText +=
  13943. "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"),
  13944. (e.style.cssText +=
  13945. "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"),
  13946. (e.style.cssText +=
  13947. "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"),
  13948. (e.style.cssText +=
  13949. "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);");
  13950. }
  13951. var s = function (e, l) {
  13952. function c(e) {
  13953. p(e),
  13954. t.bind(window, "mousemove", p),
  13955. t.bind(window, "mouseup", h);
  13956. }
  13957. function h() {
  13958. t.unbind(window, "mousemove", p),
  13959. t.unbind(window, "mouseup", h);
  13960. }
  13961. function u() {
  13962. var e = n(this.value);
  13963. e !== !1
  13964. ? ((g.__color.__state = e),
  13965. g.setValue(g.__color.toOriginal()))
  13966. : (this.value = g.__color.toString());
  13967. }
  13968. function d() {
  13969. t.unbind(window, "mousemove", f),
  13970. t.unbind(window, "mouseup", d);
  13971. }
  13972. function p(e) {
  13973. e.preventDefault();
  13974. var i = t.getWidth(g.__saturation_field),
  13975. n = t.getOffset(g.__saturation_field),
  13976. r = (e.clientX - n.left + document.body.scrollLeft) / i,
  13977. o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  13978. return (
  13979. o > 1 ? (o = 1) : o < 0 && (o = 0),
  13980. r > 1 ? (r = 1) : r < 0 && (r = 0),
  13981. (g.__color.v = o),
  13982. (g.__color.s = r),
  13983. g.setValue(g.__color.toOriginal()),
  13984. !1
  13985. );
  13986. }
  13987. function f(e) {
  13988. e.preventDefault();
  13989. var i = t.getHeight(g.__hue_field),
  13990. n = t.getOffset(g.__hue_field),
  13991. r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  13992. return (
  13993. r > 1 ? (r = 1) : r < 0 && (r = 0),
  13994. (g.__color.h = 360 * r),
  13995. g.setValue(g.__color.toOriginal()),
  13996. !1
  13997. );
  13998. }
  13999. s.superclass.call(this, e, l),
  14000. (this.__color = new i(this.getValue())),
  14001. (this.__temp = new i(0));
  14002. var g = this;
  14003. (this.domElement = document.createElement("div")),
  14004. t.makeSelectable(this.domElement, !1),
  14005. (this.__selector = document.createElement("div")),
  14006. (this.__selector.className = "selector"),
  14007. (this.__saturation_field = document.createElement("div")),
  14008. (this.__saturation_field.className = "saturation-field"),
  14009. (this.__field_knob = document.createElement("div")),
  14010. (this.__field_knob.className = "field-knob"),
  14011. (this.__field_knob_border = "2px solid "),
  14012. (this.__hue_knob = document.createElement("div")),
  14013. (this.__hue_knob.className = "hue-knob"),
  14014. (this.__hue_field = document.createElement("div")),
  14015. (this.__hue_field.className = "hue-field"),
  14016. (this.__input = document.createElement("input")),
  14017. (this.__input.type = "text"),
  14018. (this.__input_textShadow = "0 1px 1px "),
  14019. t.bind(this.__input, "keydown", function (e) {
  14020. 13 === e.keyCode && u.call(this);
  14021. }),
  14022. t.bind(this.__input, "blur", u),
  14023. t.bind(this.__selector, "mousedown", function (e) {
  14024. t.addClass(this, "drag").bind(
  14025. window,
  14026. "mouseup",
  14027. function (e) {
  14028. t.removeClass(g.__selector, "drag");
  14029. }
  14030. );
  14031. });
  14032. var m = document.createElement("div");
  14033. r.extend(this.__selector.style, {
  14034. width: "122px",
  14035. height: "102px",
  14036. padding: "3px",
  14037. backgroundColor: "#222",
  14038. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)",
  14039. }),
  14040. r.extend(this.__field_knob.style, {
  14041. position: "absolute",
  14042. width: "12px",
  14043. height: "12px",
  14044. border:
  14045. this.__field_knob_border +
  14046. (this.__color.v < 0.5 ? "#fff" : "#000"),
  14047. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  14048. borderRadius: "12px",
  14049. zIndex: 1,
  14050. }),
  14051. r.extend(this.__hue_knob.style, {
  14052. position: "absolute",
  14053. width: "15px",
  14054. height: "2px",
  14055. borderRight: "4px solid #fff",
  14056. zIndex: 1,
  14057. }),
  14058. r.extend(this.__saturation_field.style, {
  14059. width: "100px",
  14060. height: "100px",
  14061. border: "1px solid #555",
  14062. marginRight: "3px",
  14063. display: "inline-block",
  14064. cursor: "pointer",
  14065. }),
  14066. r.extend(m.style, {
  14067. width: "100%",
  14068. height: "100%",
  14069. background: "none",
  14070. }),
  14071. o(m, "top", "rgba(0,0,0,0)", "#000"),
  14072. r.extend(this.__hue_field.style, {
  14073. width: "15px",
  14074. height: "100px",
  14075. display: "inline-block",
  14076. border: "1px solid #555",
  14077. cursor: "ns-resize",
  14078. }),
  14079. a(this.__hue_field),
  14080. r.extend(this.__input.style, {
  14081. outline: "none",
  14082. textAlign: "center",
  14083. color: "#fff",
  14084. border: 0,
  14085. fontWeight: "bold",
  14086. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)",
  14087. }),
  14088. t.bind(this.__saturation_field, "mousedown", c),
  14089. t.bind(this.__field_knob, "mousedown", c),
  14090. t.bind(this.__hue_field, "mousedown", function (e) {
  14091. f(e),
  14092. t.bind(window, "mousemove", f),
  14093. t.bind(window, "mouseup", d);
  14094. }),
  14095. this.__saturation_field.appendChild(m),
  14096. this.__selector.appendChild(this.__field_knob),
  14097. this.__selector.appendChild(this.__saturation_field),
  14098. this.__selector.appendChild(this.__hue_field),
  14099. this.__hue_field.appendChild(this.__hue_knob),
  14100. this.domElement.appendChild(this.__input),
  14101. this.domElement.appendChild(this.__selector),
  14102. this.updateDisplay();
  14103. };
  14104. (s.superclass = e),
  14105. r.extend(s.prototype, e.prototype, {
  14106. updateDisplay: function () {
  14107. var e = n(this.getValue());
  14108. if (e !== !1) {
  14109. var t = !1;
  14110. r.each(
  14111. i.COMPONENTS,
  14112. function (i) {
  14113. if (
  14114. !r.isUndefined(e[i]) &&
  14115. !r.isUndefined(this.__color.__state[i]) &&
  14116. e[i] !== this.__color.__state[i]
  14117. )
  14118. return (t = !0), {};
  14119. },
  14120. this
  14121. ),
  14122. t && r.extend(this.__color.__state, e);
  14123. }
  14124. r.extend(this.__temp.__state, this.__color.__state),
  14125. (this.__temp.a = 1);
  14126. var a =
  14127. this.__color.v < 0.5 || this.__color.s > 0.5
  14128. ? 255
  14129. : 0,
  14130. s = 255 - a;
  14131. r.extend(this.__field_knob.style, {
  14132. marginLeft: 100 * this.__color.s - 7 + "px",
  14133. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  14134. backgroundColor: this.__temp.toString(),
  14135. border:
  14136. this.__field_knob_border +
  14137. "rgb(" +
  14138. a +
  14139. "," +
  14140. a +
  14141. "," +
  14142. a +
  14143. ")",
  14144. }),
  14145. (this.__hue_knob.style.marginTop =
  14146. 100 * (1 - this.__color.h / 360) + "px"),
  14147. (this.__temp.s = 1),
  14148. (this.__temp.v = 1),
  14149. o(
  14150. this.__saturation_field,
  14151. "left",
  14152. "#fff",
  14153. this.__temp.toString()
  14154. ),
  14155. r.extend(this.__input.style, {
  14156. backgroundColor: (this.__input.value =
  14157. this.__color.toString()),
  14158. color: "rgb(" + a + "," + a + "," + a + ")",
  14159. textShadow:
  14160. this.__input_textShadow +
  14161. "rgba(" +
  14162. s +
  14163. "," +
  14164. s +
  14165. "," +
  14166. s +
  14167. ",.7)",
  14168. });
  14169. },
  14170. });
  14171. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  14172. return s;
  14173. })(
  14174. n.controllers.Controller,
  14175. n.dom.dom,
  14176. (n.color.Color = (function (e, t, i, n) {
  14177. function r(e, t, i) {
  14178. Object.defineProperty(e, t, {
  14179. get: function () {
  14180. return "RGB" === this.__state.space
  14181. ? this.__state[t]
  14182. : (a(this, t, i), this.__state[t]);
  14183. },
  14184. set: function (e) {
  14185. "RGB" !== this.__state.space &&
  14186. (a(this, t, i), (this.__state.space = "RGB")),
  14187. (this.__state[t] = e);
  14188. },
  14189. });
  14190. }
  14191. function o(e, t) {
  14192. Object.defineProperty(e, t, {
  14193. get: function () {
  14194. return "HSV" === this.__state.space
  14195. ? this.__state[t]
  14196. : (s(this), this.__state[t]);
  14197. },
  14198. set: function (e) {
  14199. "HSV" !== this.__state.space &&
  14200. (s(this), (this.__state.space = "HSV")),
  14201. (this.__state[t] = e);
  14202. },
  14203. });
  14204. }
  14205. function a(e, i, r) {
  14206. if ("HEX" === e.__state.space)
  14207. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  14208. else {
  14209. if ("HSV" !== e.__state.space)
  14210. throw "Corrupted color state";
  14211. n.extend(
  14212. e.__state,
  14213. t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v)
  14214. );
  14215. }
  14216. }
  14217. function s(e) {
  14218. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  14219. n.extend(e.__state, {
  14220. s: i.s,
  14221. v: i.v,
  14222. }),
  14223. n.isNaN(i.h)
  14224. ? n.isUndefined(e.__state.h) && (e.__state.h = 0)
  14225. : (e.__state.h = i.h);
  14226. }
  14227. var l = function () {
  14228. if (
  14229. ((this.__state = e.apply(this, arguments)),
  14230. this.__state === !1)
  14231. )
  14232. throw "Failed to interpret color arguments";
  14233. this.__state.a = this.__state.a || 1;
  14234. };
  14235. return (
  14236. (l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"]),
  14237. n.extend(l.prototype, {
  14238. toString: function () {
  14239. return i(this);
  14240. },
  14241. toOriginal: function () {
  14242. return this.__state.conversion.write(this);
  14243. },
  14244. }),
  14245. r(l.prototype, "r", 2),
  14246. r(l.prototype, "g", 1),
  14247. r(l.prototype, "b", 0),
  14248. o(l.prototype, "h"),
  14249. o(l.prototype, "s"),
  14250. o(l.prototype, "v"),
  14251. Object.defineProperty(l.prototype, "a", {
  14252. get: function () {
  14253. return this.__state.a;
  14254. },
  14255. set: function (e) {
  14256. this.__state.a = e;
  14257. },
  14258. }),
  14259. Object.defineProperty(l.prototype, "hex", {
  14260. get: function () {
  14261. return (
  14262. "HEX" !== !this.__state.space &&
  14263. (this.__state.hex = t.rgb_to_hex(
  14264. this.r,
  14265. this.g,
  14266. this.b
  14267. )),
  14268. this.__state.hex
  14269. );
  14270. },
  14271. set: function (e) {
  14272. (this.__state.space = "HEX"), (this.__state.hex = e);
  14273. },
  14274. }),
  14275. l
  14276. );
  14277. })(
  14278. n.color.interpret,
  14279. (n.color.math = (function () {
  14280. var e;
  14281. return {
  14282. hsv_to_rgb: function (e, t, i) {
  14283. var n = Math.floor(e / 60) % 6,
  14284. r = e / 60 - Math.floor(e / 60),
  14285. o = i * (1 - t),
  14286. a = i * (1 - r * t),
  14287. s = i * (1 - (1 - r) * t),
  14288. l = [
  14289. [i, s, o],
  14290. [a, i, o],
  14291. [o, i, s],
  14292. [o, a, i],
  14293. [s, o, i],
  14294. [i, o, a],
  14295. ][n];
  14296. return {
  14297. r: 255 * l[0],
  14298. g: 255 * l[1],
  14299. b: 255 * l[2],
  14300. };
  14301. },
  14302. rgb_to_hsv: function (e, t, i) {
  14303. var n,
  14304. r,
  14305. o = Math.min(e, t, i),
  14306. a = Math.max(e, t, i),
  14307. s = a - o;
  14308. return 0 == a
  14309. ? {
  14310. h: NaN,
  14311. s: 0,
  14312. v: 0,
  14313. }
  14314. : ((r = s / a),
  14315. (n =
  14316. e == a
  14317. ? (t - i) / s
  14318. : t == a
  14319. ? 2 + (i - e) / s
  14320. : 4 + (e - t) / s),
  14321. (n /= 6),
  14322. n < 0 && (n += 1),
  14323. {
  14324. h: 360 * n,
  14325. s: r,
  14326. v: a / 255,
  14327. });
  14328. },
  14329. rgb_to_hex: function (e, t, i) {
  14330. var n = this.hex_with_component(0, 2, e);
  14331. return (
  14332. (n = this.hex_with_component(n, 1, t)),
  14333. (n = this.hex_with_component(n, 0, i))
  14334. );
  14335. },
  14336. component_from_hex: function (e, t) {
  14337. return (e >> (8 * t)) & 255;
  14338. },
  14339. hex_with_component: function (t, i, n) {
  14340. return (n << (e = 8 * i)) | (t & ~(255 << e));
  14341. },
  14342. };
  14343. })()),
  14344. n.color.toString,
  14345. n.utils.common
  14346. )),
  14347. n.color.interpret,
  14348. n.utils.common
  14349. )),
  14350. (n.utils.requestAnimationFrame = (function () {
  14351. return (
  14352. window.requestAnimationFrame ||
  14353. window.webkitRequestAnimationFrame ||
  14354. window.mozRequestAnimationFrame ||
  14355. window.oRequestAnimationFrame ||
  14356. window.msRequestAnimationFrame ||
  14357. function (e, t) {
  14358. window.setTimeout(e, 1e3 / 60);
  14359. }
  14360. );
  14361. })()),
  14362. (n.dom.CenteredDiv = (function (e, t) {
  14363. var i = function () {
  14364. (this.backgroundElement = document.createElement("div")),
  14365. t.extend(this.backgroundElement.style, {
  14366. backgroundColor: "rgba(0,0,0,0.8)",
  14367. top: 0,
  14368. left: 0,
  14369. display: "none",
  14370. zIndex: "1000",
  14371. opacity: 0,
  14372. WebkitTransition: "opacity 0.2s linear",
  14373. }),
  14374. e.makeFullscreen(this.backgroundElement),
  14375. (this.backgroundElement.style.position = "fixed"),
  14376. (this.domElement = document.createElement("div")),
  14377. t.extend(this.domElement.style, {
  14378. position: "fixed",
  14379. display: "none",
  14380. zIndex: "1001",
  14381. opacity: 0,
  14382. WebkitTransition:
  14383. "-webkit-transform 0.2s ease-out, opacity 0.2s linear",
  14384. }),
  14385. document.body.appendChild(this.backgroundElement),
  14386. document.body.appendChild(this.domElement);
  14387. var i = this;
  14388. e.bind(this.backgroundElement, "click", function () {
  14389. i.hide();
  14390. });
  14391. };
  14392. return (
  14393. (i.prototype.show = function () {
  14394. var e = this;
  14395. (this.backgroundElement.style.display = "block"),
  14396. (this.domElement.style.display = "block"),
  14397. (this.domElement.style.opacity = 0),
  14398. (this.domElement.style.webkitTransform = "scale(1.1)"),
  14399. this.layout(),
  14400. t.defer(function () {
  14401. (e.backgroundElement.style.opacity = 1),
  14402. (e.domElement.style.opacity = 1),
  14403. (e.domElement.style.webkitTransform = "scale(1)");
  14404. });
  14405. }),
  14406. (i.prototype.hide = function () {
  14407. var t = this,
  14408. i = function () {
  14409. (t.domElement.style.display = "none"),
  14410. (t.backgroundElement.style.display = "none"),
  14411. e.unbind(t.domElement, "webkitTransitionEnd", i),
  14412. e.unbind(t.domElement, "transitionend", i),
  14413. e.unbind(t.domElement, "oTransitionEnd", i);
  14414. };
  14415. e.bind(this.domElement, "webkitTransitionEnd", i),
  14416. e.bind(this.domElement, "transitionend", i),
  14417. e.bind(this.domElement, "oTransitionEnd", i),
  14418. (this.backgroundElement.style.opacity = 0),
  14419. (this.domElement.style.opacity = 0),
  14420. (this.domElement.style.webkitTransform = "scale(1.1)");
  14421. }),
  14422. (i.prototype.layout = function () {
  14423. (this.domElement.style.left =
  14424. $("#player").width() / 2 -
  14425. e.getWidth(this.domElement) / 2 +
  14426. "px"),
  14427. (this.domElement.style.top =
  14428. $("#player").height() / 2 -
  14429. e.getHeight(this.domElement) / 2 +
  14430. "px");
  14431. }),
  14432. i
  14433. );
  14434. })(n.dom.dom, n.utils.common)),
  14435. n.dom.dom,
  14436. n.utils.common
  14437. ));
  14438. },
  14439. {},
  14440. ],
  14441. 94: [
  14442. function (e, t, i) {
  14443. (function (e) {
  14444. "use strict";
  14445. function i(t) {
  14446. function i(e) {
  14447. for (
  14448. var t = [
  14449. 16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60,
  14450. 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87,
  14451. 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64,
  14452. 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72,
  14453. 92, 95, 98, 112, 100, 103, 99,
  14454. ],
  14455. i = 0;
  14456. i < 64;
  14457. i++
  14458. ) {
  14459. var n = _((t[i] * e + 50) / 100);
  14460. n < 1 ? (n = 1) : n > 255 && (n = 255), (T[G[i]] = n);
  14461. }
  14462. for (
  14463. var r = [
  14464. 17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99,
  14465. 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99,
  14466. 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
  14467. 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
  14468. 99, 99, 99, 99,
  14469. ],
  14470. o = 0;
  14471. o < 64;
  14472. o++
  14473. ) {
  14474. var a = _((r[o] * e + 50) / 100);
  14475. a < 1 ? (a = 1) : a > 255 && (a = 255), (x[G[o]] = a);
  14476. }
  14477. for (
  14478. var s = [
  14479. 1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958,
  14480. 0.5411961, 0.275899379,
  14481. ],
  14482. l = 0,
  14483. c = 0;
  14484. c < 8;
  14485. c++
  14486. )
  14487. for (var h = 0; h < 8; h++)
  14488. (S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8)),
  14489. (M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8)),
  14490. l++;
  14491. }
  14492. function n(e, t) {
  14493. for (var i = 0, n = 0, r = new Array(), o = 1; o <= 16; o++) {
  14494. for (var a = 1; a <= e[o]; a++)
  14495. (r[t[n]] = []), (r[t[n]][0] = i), (r[t[n]][1] = o), n++, i++;
  14496. i *= 2;
  14497. }
  14498. return r;
  14499. }
  14500. function r() {
  14501. (C = n(z, W)), (I = n(X, Z)), (E = n(j, Y)), (b = n(q, K));
  14502. }
  14503. function o() {
  14504. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  14505. for (var n = e; n < t; n++)
  14506. (P[32767 + n] = i),
  14507. (R[32767 + n] = []),
  14508. (R[32767 + n][1] = i),
  14509. (R[32767 + n][0] = n);
  14510. for (var r = -(t - 1); r <= -e; r++)
  14511. (P[32767 + r] = i),
  14512. (R[32767 + r] = []),
  14513. (R[32767 + r][1] = i),
  14514. (R[32767 + r][0] = t - 1 + r);
  14515. (e <<= 1), (t <<= 1);
  14516. }
  14517. }
  14518. function a() {
  14519. for (var e = 0; e < 256; e++)
  14520. (H[e] = 19595 * e),
  14521. (H[(e + 256) >> 0] = 38470 * e),
  14522. (H[(e + 512) >> 0] = 7471 * e + 32768),
  14523. (H[(e + 768) >> 0] = -11059 * e),
  14524. (H[(e + 1024) >> 0] = -21709 * e),
  14525. (H[(e + 1280) >> 0] = 32768 * e + 8421375),
  14526. (H[(e + 1536) >> 0] = -27439 * e),
  14527. (H[(e + 1792) >> 0] = -5329 * e);
  14528. }
  14529. function s(e) {
  14530. for (var t = e[0], i = e[1] - 1; i >= 0; )
  14531. t & (1 << i) && (N |= 1 << B),
  14532. i--,
  14533. B--,
  14534. B < 0 && (255 == N ? (l(255), l(0)) : l(N), (B = 7), (N = 0));
  14535. }
  14536. function l(e) {
  14537. D.push(e);
  14538. }
  14539. function c(e) {
  14540. l((e >> 8) & 255), l(255 & e);
  14541. }
  14542. function h(e, t) {
  14543. var i,
  14544. n,
  14545. r,
  14546. o,
  14547. a,
  14548. s,
  14549. l,
  14550. c,
  14551. h,
  14552. u = 0,
  14553. d = 8,
  14554. p = 64;
  14555. for (h = 0; h < d; ++h) {
  14556. (i = e[u]),
  14557. (n = e[u + 1]),
  14558. (r = e[u + 2]),
  14559. (o = e[u + 3]),
  14560. (a = e[u + 4]),
  14561. (s = e[u + 5]),
  14562. (l = e[u + 6]),
  14563. (c = e[u + 7]);
  14564. var f = i + c,
  14565. g = i - c,
  14566. m = n + l,
  14567. v = n - l,
  14568. A = r + s,
  14569. y = r - s,
  14570. C = o + a,
  14571. I = o - a,
  14572. E = f + C,
  14573. b = f - C,
  14574. w = m + A,
  14575. _ = m - A;
  14576. (e[u] = E + w), (e[u + 4] = E - w);
  14577. var T = 0.707106781 * (_ + b);
  14578. (e[u + 2] = b + T),
  14579. (e[u + 6] = b - T),
  14580. (E = I + y),
  14581. (w = y + v),
  14582. (_ = v + g);
  14583. var x = 0.382683433 * (E - _),
  14584. S = 0.5411961 * E + x,
  14585. M = 1.306562965 * _ + x,
  14586. R = 0.707106781 * w,
  14587. P = g + R,
  14588. L = g - R;
  14589. (e[u + 5] = L + S),
  14590. (e[u + 3] = L - S),
  14591. (e[u + 1] = P + M),
  14592. (e[u + 7] = P - M),
  14593. (u += 8);
  14594. }
  14595. for (u = 0, h = 0; h < d; ++h) {
  14596. (i = e[u]),
  14597. (n = e[u + 8]),
  14598. (r = e[u + 16]),
  14599. (o = e[u + 24]),
  14600. (a = e[u + 32]),
  14601. (s = e[u + 40]),
  14602. (l = e[u + 48]),
  14603. (c = e[u + 56]);
  14604. var D = i + c,
  14605. N = i - c,
  14606. B = n + l,
  14607. F = n - l,
  14608. V = r + s,
  14609. U = r - s,
  14610. k = o + a,
  14611. H = o - a,
  14612. G = D + k,
  14613. z = D - k,
  14614. W = B + V,
  14615. j = B - V;
  14616. (e[u] = G + W), (e[u + 32] = G - W);
  14617. var Y = 0.707106781 * (j + z);
  14618. (e[u + 16] = z + Y),
  14619. (e[u + 48] = z - Y),
  14620. (G = H + U),
  14621. (W = U + F),
  14622. (j = F + N);
  14623. var X = 0.382683433 * (G - j),
  14624. Z = 0.5411961 * G + X,
  14625. q = 1.306562965 * j + X,
  14626. K = 0.707106781 * W,
  14627. Q = N + K,
  14628. J = N - K;
  14629. (e[u + 40] = J + Z),
  14630. (e[u + 24] = J - Z),
  14631. (e[u + 8] = Q + q),
  14632. (e[u + 56] = Q - q),
  14633. u++;
  14634. }
  14635. var $;
  14636. for (h = 0; h < p; ++h)
  14637. ($ = e[h] * t[h]),
  14638. (O[h] = $ > 0 ? ($ + 0.5) | 0 : ($ - 0.5) | 0);
  14639. return O;
  14640. }
  14641. function u() {
  14642. c(65504),
  14643. c(16),
  14644. l(74),
  14645. l(70),
  14646. l(73),
  14647. l(70),
  14648. l(0),
  14649. l(1),
  14650. l(1),
  14651. l(0),
  14652. c(1),
  14653. c(1),
  14654. l(0),
  14655. l(0);
  14656. }
  14657. function d(e, t) {
  14658. c(65472),
  14659. c(17),
  14660. l(8),
  14661. c(t),
  14662. c(e),
  14663. l(3),
  14664. l(1),
  14665. l(17),
  14666. l(0),
  14667. l(2),
  14668. l(17),
  14669. l(1),
  14670. l(3),
  14671. l(17),
  14672. l(1);
  14673. }
  14674. function p() {
  14675. c(65499), c(132), l(0);
  14676. for (var e = 0; e < 64; e++) l(T[e]);
  14677. l(1);
  14678. for (var t = 0; t < 64; t++) l(x[t]);
  14679. }
  14680. function f() {
  14681. c(65476), c(418), l(0);
  14682. for (var e = 0; e < 16; e++) l(z[e + 1]);
  14683. for (var t = 0; t <= 11; t++) l(W[t]);
  14684. l(16);
  14685. for (var i = 0; i < 16; i++) l(j[i + 1]);
  14686. for (var n = 0; n <= 161; n++) l(Y[n]);
  14687. l(1);
  14688. for (var r = 0; r < 16; r++) l(X[r + 1]);
  14689. for (var o = 0; o <= 11; o++) l(Z[o]);
  14690. l(17);
  14691. for (var a = 0; a < 16; a++) l(q[a + 1]);
  14692. for (var s = 0; s <= 161; s++) l(K[s]);
  14693. }
  14694. function g() {
  14695. c(65498),
  14696. c(12),
  14697. l(3),
  14698. l(1),
  14699. l(0),
  14700. l(2),
  14701. l(17),
  14702. l(3),
  14703. l(17),
  14704. l(0),
  14705. l(63),
  14706. l(0);
  14707. }
  14708. function m(e, t, i, n, r) {
  14709. for (
  14710. var o,
  14711. a = r[0],
  14712. l = r[240],
  14713. c = 16,
  14714. u = 63,
  14715. d = 64,
  14716. p = h(e, t),
  14717. f = 0;
  14718. f < d;
  14719. ++f
  14720. )
  14721. L[G[f]] = p[f];
  14722. var g = L[0] - i;
  14723. (i = L[0]),
  14724. 0 == g ? s(n[0]) : ((o = 32767 + g), s(n[P[o]]), s(R[o]));
  14725. for (var m = 63; m > 0 && 0 == L[m]; m--);
  14726. if (0 == m) return s(a), i;
  14727. for (var v, A = 1; A <= m; ) {
  14728. for (var y = A; 0 == L[A] && A <= m; ++A);
  14729. var C = A - y;
  14730. if (C >= c) {
  14731. v = C >> 4;
  14732. for (var I = 1; I <= v; ++I) s(l);
  14733. C &= 15;
  14734. }
  14735. (o = 32767 + L[A]), s(r[(C << 4) + P[o]]), s(R[o]), A++;
  14736. }
  14737. return m != u && s(a), i;
  14738. }
  14739. function v() {
  14740. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  14741. k[t] = e(t);
  14742. }
  14743. function A(e) {
  14744. if ((e <= 0 && (e = 1), e > 100 && (e = 100), w != e)) {
  14745. var t = 0;
  14746. (t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  14747. i(t),
  14748. (w = e);
  14749. }
  14750. }
  14751. function y() {
  14752. var e = new Date().getTime();
  14753. t || (t = 50), v(), r(), o(), a(), A(t);
  14754. new Date().getTime() - e;
  14755. }
  14756. var C,
  14757. I,
  14758. E,
  14759. b,
  14760. w,
  14761. _ = (Math.round, Math.floor),
  14762. T = new Array(64),
  14763. x = new Array(64),
  14764. S = new Array(64),
  14765. M = new Array(64),
  14766. R = new Array(65535),
  14767. P = new Array(65535),
  14768. O = new Array(64),
  14769. L = new Array(64),
  14770. D = [],
  14771. N = 0,
  14772. B = 7,
  14773. F = new Array(64),
  14774. V = new Array(64),
  14775. U = new Array(64),
  14776. k = new Array(256),
  14777. H = new Array(2048),
  14778. G = [
  14779. 0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8,
  14780. 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19,
  14781. 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34,
  14782. 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63,
  14783. ],
  14784. z = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
  14785. W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
  14786. j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125],
  14787. Y = [
  14788. 1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113,
  14789. 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240,
  14790. 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40,
  14791. 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73,
  14792. 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104,
  14793. 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133,
  14794. 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153,
  14795. 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180,
  14796. 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200,
  14797. 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226,
  14798. 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245,
  14799. 246, 247, 248, 249, 250,
  14800. ],
  14801. X = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
  14802. Z = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
  14803. q = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119],
  14804. K = [
  14805. 0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34,
  14806. 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21,
  14807. 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38,
  14808. 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72,
  14809. 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103,
  14810. 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131,
  14811. 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151,
  14812. 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178,
  14813. 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198,
  14814. 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218,
  14815. 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245,
  14816. 246, 247, 248, 249, 250,
  14817. ];
  14818. (this.encode = function (t, i) {
  14819. var n = (new Date().getTime(), i.quality);
  14820. n && A(n),
  14821. (D = new Array()),
  14822. (N = 0),
  14823. (B = 7),
  14824. c(65496),
  14825. u(),
  14826. p(),
  14827. d(t.width, t.height),
  14828. f(),
  14829. g();
  14830. var r = 0,
  14831. o = 0,
  14832. a = 0;
  14833. (N = 0), (B = 7), (this.encode.displayName = "_encode_");
  14834. for (
  14835. var l,
  14836. h,
  14837. v,
  14838. y,
  14839. w,
  14840. _,
  14841. T,
  14842. x,
  14843. R,
  14844. P = t.data,
  14845. O = t.width,
  14846. L = t.height,
  14847. k = i.flipY,
  14848. G = 4 * O,
  14849. z = k ? L : 0,
  14850. W = k ? -8 : 8;
  14851. (k && z > 0) || (!k && z < L);
  14852. ) {
  14853. for (l = 0; l < G; ) {
  14854. for (w = G * z + l, _ = w, T = -1, x = 0, R = 0; R < 64; R++)
  14855. (x = (k ? 63 - R : R) >> 3),
  14856. (T = 4 * (7 & R)),
  14857. (_ = w + x * G + T),
  14858. z + x >= L && (_ -= G * (z + 1 + x - L)),
  14859. l + T >= G && (_ -= l + T - G + 4),
  14860. (h = P[_++]),
  14861. (v = P[_++]),
  14862. (y = P[_++]),
  14863. (F[R] =
  14864. ((H[h] + H[(v + 256) >> 0] + H[(y + 512) >> 0]) >> 16) -
  14865. 128),
  14866. (V[R] =
  14867. ((H[(h + 768) >> 0] +
  14868. H[(v + 1024) >> 0] +
  14869. H[(y + 1280) >> 0]) >>
  14870. 16) -
  14871. 128),
  14872. (U[R] =
  14873. ((H[(h + 1280) >> 0] +
  14874. H[(v + 1536) >> 0] +
  14875. H[(y + 1792) >> 0]) >>
  14876. 16) -
  14877. 128);
  14878. (r = m(F, S, r, C, E)),
  14879. (o = m(V, M, o, I, b)),
  14880. (a = m(U, M, a, I, b)),
  14881. (l += 32);
  14882. }
  14883. z += W;
  14884. }
  14885. if (B >= 0) {
  14886. var j = [];
  14887. (j[1] = B + 1), (j[0] = (1 << (B + 1)) - 1), s(j);
  14888. }
  14889. return c(65497), new e(D);
  14890. }),
  14891. y();
  14892. }
  14893. function n(e, t) {
  14894. (t = t || {}), (t.quality = t.quality || 50);
  14895. var n = t.quality,
  14896. r = new i(n),
  14897. o = r.encode(e, t);
  14898. return {
  14899. data: o,
  14900. width: e.width,
  14901. height: e.height,
  14902. };
  14903. }
  14904. t.exports.encode = n;
  14905. }).call(this, e("buffer").Buffer);
  14906. },
  14907. {
  14908. buffer: 198,
  14909. },
  14910. ],
  14911. 95: [
  14912. function (e, t, i) {
  14913. "use strict";
  14914. !(function () {
  14915. if (
  14916. ("performance" in window == !1 && (window.performance = {}),
  14917. (Date.now =
  14918. Date.now ||
  14919. function () {
  14920. return new Date().getTime();
  14921. }),
  14922. "now" in window.performance == !1)
  14923. ) {
  14924. var e = Date.now();
  14925. performance.timing &&
  14926. performance.timing.navigationStart &&
  14927. (e = performance.timing.navigationStart),
  14928. (window.performance.now = function () {
  14929. return Date.now() - e;
  14930. });
  14931. }
  14932. })();
  14933. },
  14934. {},
  14935. ],
  14936. 96: [
  14937. function (e, t, i) {
  14938. "use strict";
  14939. var n = e("three");
  14940. (n.EffectComposer = function (e, t) {
  14941. if (((this.renderer = e), void 0 === t)) {
  14942. var i = {
  14943. minFilter: n.LinearFilter,
  14944. magFilter: n.LinearFilter,
  14945. format: n.RGBAFormat,
  14946. stencilBuffer: !1,
  14947. },
  14948. r = e.getSize();
  14949. t = new n.WebGLRenderTarget(r.width, r.height, i);
  14950. }
  14951. (this.renderTarget1 = t),
  14952. (this.renderTarget2 = t.clone()),
  14953. (this.writeBuffer = this.renderTarget1),
  14954. (this.readBuffer = this.renderTarget2),
  14955. (this.passes = []),
  14956. void 0 === n.CopyShader &&
  14957. console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  14958. (this.copyPass = new n.ShaderPass(n.CopyShader));
  14959. }),
  14960. (n.EffectComposer.prototype = {
  14961. swapBuffers: function () {
  14962. var e = this.readBuffer;
  14963. (this.readBuffer = this.writeBuffer), (this.writeBuffer = e);
  14964. },
  14965. addPass: function (e) {
  14966. this.passes.push(e);
  14967. },
  14968. insertPass: function (e, t) {
  14969. this.passes.splice(t, 0, e);
  14970. },
  14971. render: function (e) {
  14972. (this.writeBuffer = this.renderTarget1),
  14973. (this.readBuffer = this.renderTarget2);
  14974. var t,
  14975. i,
  14976. r = !1,
  14977. o = this.passes.length;
  14978. for (i = 0; i < o; i++)
  14979. if (((t = this.passes[i]), t.enabled)) {
  14980. if (
  14981. (t.render(
  14982. this.renderer,
  14983. this.writeBuffer,
  14984. this.readBuffer,
  14985. e,
  14986. r
  14987. ),
  14988. t.needsSwap)
  14989. ) {
  14990. if (r) {
  14991. var a = this.renderer.context;
  14992. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  14993. this.copyPass.render(
  14994. this.renderer,
  14995. this.writeBuffer,
  14996. this.readBuffer,
  14997. e
  14998. ),
  14999. a.stencilFunc(a.EQUAL, 1, 4294967295);
  15000. }
  15001. this.swapBuffers();
  15002. }
  15003. t instanceof n.MaskPass
  15004. ? (r = !0)
  15005. : t instanceof n.ClearMaskPass && (r = !1);
  15006. }
  15007. },
  15008. reset: function (e) {
  15009. if (void 0 === e) {
  15010. var t = this.renderer.getSize();
  15011. (e = this.renderTarget1.clone()), e.setSize(t.width, t.height);
  15012. }
  15013. this.renderTarget1.dispose(),
  15014. this.renderTarget2.dispose(),
  15015. (this.renderTarget1 = e),
  15016. (this.renderTarget2 = e.clone()),
  15017. (this.writeBuffer = this.renderTarget1),
  15018. (this.readBuffer = this.renderTarget2);
  15019. },
  15020. setSize: function (e, t) {
  15021. this.renderTarget1.setSize(e, t),
  15022. this.renderTarget2.setSize(e, t);
  15023. this.passes.forEach((a) => {
  15024. //add for TransitionPass
  15025. a.setSize && a.setSize(e, t);
  15026. });
  15027. },
  15028. });
  15029. },
  15030. {
  15031. three: 217,
  15032. },
  15033. ],
  15034. 97: [
  15035. function (e, t, i) {
  15036. "use strict";
  15037. var n = e("three");
  15038. (n.MaskPass = function (e, t) {
  15039. (this.scene = e),
  15040. (this.camera = t),
  15041. (this.enabled = !0),
  15042. (this.clear = !0),
  15043. (this.needsSwap = !1),
  15044. (this.inverse = !1);
  15045. }),
  15046. (n.MaskPass.prototype = {
  15047. render: function (e, t, i, n) {
  15048. var r = e.context;
  15049. r.colorMask(!1, !1, !1, !1), r.depthMask(!1);
  15050. var o, a;
  15051. this.inverse ? ((o = 0), (a = 1)) : ((o = 1), (a = 0)),
  15052. r.enable(r.STENCIL_TEST),
  15053. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  15054. r.stencilFunc(r.ALWAYS, o, 4294967295),
  15055. r.clearStencil(a),
  15056. e.render(this.scene, this.camera, i, this.clear),
  15057. e.render(this.scene, this.camera, t, this.clear),
  15058. r.colorMask(!0, !0, !0, !0),
  15059. r.depthMask(!0),
  15060. r.stencilFunc(r.EQUAL, 1, 4294967295),
  15061. r.stencilOp(r.KEEP, r.KEEP, r.KEEP);
  15062. },
  15063. }),
  15064. (n.ClearMaskPass = function () {
  15065. this.enabled = !0;
  15066. }),
  15067. (n.ClearMaskPass.prototype = {
  15068. render: function (e, t, i, n) {
  15069. var r = e.context;
  15070. r.disable(r.STENCIL_TEST);
  15071. },
  15072. });
  15073. },
  15074. {
  15075. three: 217,
  15076. },
  15077. ],
  15078. 98: [
  15079. function (e, t, i) {
  15080. "use strict";
  15081. var n = e("three");
  15082. (n.RenderPass = function (e, t, i, r, o) {
  15083. (this.scene = e),
  15084. (this.camera = t),
  15085. (this.overrideMaterial = i),
  15086. (this.clearColor = r),
  15087. (this.clearAlpha = void 0 !== o ? o : 1),
  15088. (this.oldClearColor = new n.Color()),
  15089. (this.oldClearAlpha = 1),
  15090. (this.enabled = !0),
  15091. (this.clear = !0),
  15092. (this.needsSwap = !1);
  15093. }),
  15094. (n.RenderPass.prototype = {
  15095. render: function (e, t, i, n) {
  15096. (this.scene.overrideMaterial = this.overrideMaterial),
  15097. this.clearColor &&
  15098. (this.oldClearColor.copy(e.getClearColor()),
  15099. (this.oldClearAlpha = e.getClearAlpha()),
  15100. e.setClearColor(this.clearColor, this.clearAlpha)),
  15101. e.render(this.scene, this.camera, i, this.clear),
  15102. this.clearColor &&
  15103. e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  15104. (this.scene.overrideMaterial = null);
  15105. },
  15106. });
  15107. },
  15108. {
  15109. three: 217,
  15110. },
  15111. ],
  15112. 99: [
  15113. function (e, t, i) {
  15114. "use strict";
  15115. var n = e("three");
  15116. (n.ShaderPass = function (e, t) {
  15117. (this.textureID = void 0 !== t ? t : "tDiffuse"),
  15118. e instanceof n.ShaderMaterial
  15119. ? ((this.uniforms = e.uniforms), (this.material = e))
  15120. : e &&
  15121. ((this.uniforms = n.UniformsUtils.clone(e.uniforms)),
  15122. (this.material = new n.ShaderMaterial({
  15123. defines: e.defines || {},
  15124. uniforms: this.uniforms,
  15125. vertexShader: e.vertexShader,
  15126. fragmentShader: e.fragmentShader,
  15127. }))),
  15128. (this.renderToScreen = !1),
  15129. (this.enabled = !0),
  15130. (this.needsSwap = !0),
  15131. (this.clear = !1),
  15132. (this.camera = new n.OrthographicCamera(-1, 1, 1, -1, 0, 1)),
  15133. (this.scene = new n.Scene()),
  15134. (this.quad = new n.Mesh(new n.PlaneBufferGeometry(2, 2), null)),
  15135. this.scene.add(this.quad);
  15136. }),
  15137. (n.ShaderPass.prototype = {
  15138. render: function (e, t, i, n) {
  15139. this.uniforms[this.textureID] &&
  15140. (this.uniforms[this.textureID].value = i),
  15141. (this.quad.material = this.material),
  15142. this.renderToScreen
  15143. ? e.render(this.scene, this.camera)
  15144. : e.render(this.scene, this.camera, t, this.clear);
  15145. },
  15146. });
  15147. },
  15148. {
  15149. three: 217,
  15150. },
  15151. ],
  15152. 100: [
  15153. function (e, t, i) {
  15154. "use strict";
  15155. var n = e("three");
  15156. n.CopyShader = {
  15157. uniforms: {
  15158. tDiffuse: {
  15159. type: "t",
  15160. value: null,
  15161. },
  15162. opacity: {
  15163. type: "f",
  15164. value: 1,
  15165. },
  15166. },
  15167. vertexShader: [
  15168. "varying vec2 vUv;",
  15169. "void main() {",
  15170. "vUv = uv;",
  15171. "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
  15172. "}",
  15173. ].join("\n"),
  15174. fragmentShader: [
  15175. "uniform float opacity;",
  15176. "uniform sampler2D tDiffuse;",
  15177. "varying vec2 vUv;",
  15178. "void main() {",
  15179. "vec4 texel = texture2D( tDiffuse, vUv );",
  15180. "gl_FragColor = opacity * texel;",
  15181. "}",
  15182. ].join("\n"),
  15183. };
  15184. },
  15185. {
  15186. three: 217,
  15187. },
  15188. ],
  15189. 101: [
  15190. function (e, t, i) {
  15191. "use strict";
  15192. var n = e("three");
  15193. n.HorizontalBlurShader = {
  15194. uniforms: {
  15195. tDiffuse: {
  15196. type: "t",
  15197. value: null,
  15198. },
  15199. h: {
  15200. type: "f",
  15201. value: 1 / 512,
  15202. },
  15203. },
  15204. vertexShader: [
  15205. "varying vec2 vUv;",
  15206. "void main() {",
  15207. "vUv = uv;",
  15208. "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
  15209. "}",
  15210. ].join("\n"),
  15211. fragmentShader: [
  15212. "uniform sampler2D tDiffuse;",
  15213. "uniform float h;",
  15214. "varying vec2 vUv;",
  15215. "void main() {",
  15216. "vec4 sum = vec4( 0.0 );",
  15217. "sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;",
  15218. "sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;",
  15219. "sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;",
  15220. "sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;",
  15221. "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;",
  15222. "sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;",
  15223. "sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;",
  15224. "sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;",
  15225. "sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;",
  15226. "gl_FragColor = sum;",
  15227. "}",
  15228. ].join("\n"),
  15229. };
  15230. },
  15231. {
  15232. three: 217,
  15233. },
  15234. ],
  15235. 102: [
  15236. function (e, t, i) {
  15237. "use strict";
  15238. var n = e("three");
  15239. n.VerticalBlurShader = {
  15240. uniforms: {
  15241. tDiffuse: {
  15242. type: "t",
  15243. value: null,
  15244. },
  15245. v: {
  15246. type: "f",
  15247. value: 1 / 512,
  15248. },
  15249. },
  15250. vertexShader: [
  15251. "varying vec2 vUv;",
  15252. "void main() {",
  15253. "vUv = uv;",
  15254. "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
  15255. "}",
  15256. ].join("\n"),
  15257. fragmentShader: [
  15258. "uniform sampler2D tDiffuse;",
  15259. "uniform float v;",
  15260. "varying vec2 vUv;",
  15261. "void main() {",
  15262. "vec4 sum = vec4( 0.0 );",
  15263. "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;",
  15264. "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;",
  15265. "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;",
  15266. "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;",
  15267. "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;",
  15268. "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;",
  15269. "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;",
  15270. "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;",
  15271. "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;",
  15272. "gl_FragColor = sum;",
  15273. "}",
  15274. ].join("\n"),
  15275. };
  15276. },
  15277. {
  15278. three: 217,
  15279. },
  15280. ],
  15281. 103: [
  15282. function (e, t, i) {
  15283. "use strict";
  15284. var n = e("three");
  15285. !(function () {
  15286. if (
  15287. ("performance" in window == 0 && (window.performance = {}),
  15288. "now" in window.performance == 0)
  15289. ) {
  15290. var e = Date.now();
  15291. performance.timing &&
  15292. performance.timing.navigationStart &&
  15293. (e = performance.timing.navigationStart),
  15294. (window.performance.now = function () {
  15295. return Date.now() - e;
  15296. });
  15297. }
  15298. })(),
  15299. (n.WebGLRenderer.prototype.paramThreeToGL = function (e) {
  15300. var t,
  15301. i = this.extensions,
  15302. r = this.context;
  15303. if (e === n.RepeatWrapping) return r.REPEAT;
  15304. if (e === n.ClampToEdgeWrapping) return r.CLAMP_TO_EDGE;
  15305. if (e === n.MirroredRepeatWrapping) return r.MIRRORED_REPEAT;
  15306. if (e === n.NearestFilter) return r.NEAREST;
  15307. if (e === n.NearestMipMapNearestFilter)
  15308. return r.NEAREST_MIPMAP_NEAREST;
  15309. if (e === n.NearestMipMapLinearFilter)
  15310. return r.NEAREST_MIPMAP_LINEAR;
  15311. if (e === n.LinearFilter) return r.LINEAR;
  15312. if (e === n.LinearMipMapNearestFilter)
  15313. return r.LINEAR_MIPMAP_NEAREST;
  15314. if (e === n.LinearMipMapLinearFilter) return r.LINEAR_MIPMAP_LINEAR;
  15315. if (e === n.UnsignedByteType) return r.UNSIGNED_BYTE;
  15316. if (e === n.UnsignedShort4444Type) return r.UNSIGNED_SHORT_4_4_4_4;
  15317. if (e === n.UnsignedShort5551Type) return r.UNSIGNED_SHORT_5_5_5_1;
  15318. if (e === n.UnsignedShort565Type) return r.UNSIGNED_SHORT_5_6_5;
  15319. if (e === n.ByteType) return r.BYTE;
  15320. if (e === n.ShortType) return r.SHORT;
  15321. if (e === n.UnsignedShortType) return r.UNSIGNED_SHORT;
  15322. if (e === n.IntType) return r.INT;
  15323. if (e === n.UnsignedIntType) return r.UNSIGNED_INT;
  15324. if (e === n.FloatType) return r.FLOAT;
  15325. if (
  15326. ((t = i.get("OES_texture_half_float")),
  15327. null !== t && e === n.HalfFloatType)
  15328. )
  15329. return t.HALF_FLOAT_OES;
  15330. if (e === n.AlphaFormat) return r.ALPHA;
  15331. if (e === n.RGBFormat) return r.RGB;
  15332. if (e === n.RGBAFormat) return r.RGBA;
  15333. if (e === n.LuminanceFormat) return r.LUMINANCE;
  15334. if (e === n.LuminanceAlphaFormat) return r.LUMINANCE_ALPHA;
  15335. if (e === n.AddEquation) return r.FUNC_ADD;
  15336. if (e === n.SubtractEquation) return r.FUNC_SUBTRACT;
  15337. if (e === n.ReverseSubtractEquation) return r.FUNC_REVERSE_SUBTRACT;
  15338. if (e === n.ZeroFactor) return r.ZERO;
  15339. if (e === n.OneFactor) return r.ONE;
  15340. if (e === n.SrcColorFactor) return r.SRC_COLOR;
  15341. if (e === n.OneMinusSrcColorFactor) return r.ONE_MINUS_SRC_COLOR;
  15342. if (e === n.SrcAlphaFactor) return r.SRC_ALPHA;
  15343. if (e === n.OneMinusSrcAlphaFactor) return r.ONE_MINUS_SRC_ALPHA;
  15344. if (e === n.DstAlphaFactor) return r.DST_ALPHA;
  15345. if (e === n.OneMinusDstAlphaFactor) return r.ONE_MINUS_DST_ALPHA;
  15346. if (e === n.DstColorFactor) return r.DST_COLOR;
  15347. if (e === n.OneMinusDstColorFactor) return r.ONE_MINUS_DST_COLOR;
  15348. if (e === n.SrcAlphaSaturateFactor) return r.SRC_ALPHA_SATURATE;
  15349. if (((t = i.get("WEBGL_compressed_texture_s3tc")), null !== t)) {
  15350. if (e === n.RGB_S3TC_DXT1_Format)
  15351. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  15352. if (e === n.RGBA_S3TC_DXT1_Format)
  15353. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  15354. if (e === n.RGBA_S3TC_DXT3_Format)
  15355. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  15356. if (e === n.RGBA_S3TC_DXT5_Format)
  15357. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT;
  15358. }
  15359. if (((t = i.get("WEBGL_compressed_texture_pvrtc")), null !== t)) {
  15360. if (e === n.RGB_PVRTC_4BPPV1_Format)
  15361. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  15362. if (e === n.RGB_PVRTC_2BPPV1_Format)
  15363. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  15364. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  15365. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  15366. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  15367. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;
  15368. }
  15369. if (
  15370. ((t = i.get("WEBGL_compressed_texture_etc1")),
  15371. null !== t && e === n.RGB_ETC1_Format)
  15372. )
  15373. return t.COMPRESSED_RGB_ETC1_WEBGL;
  15374. if (((t = i.get("EXT_blend_minmax")), null !== t)) {
  15375. if (e === n.MinEquation) return t.MIN_EXT;
  15376. if (e === n.MaxEquation) return t.MAX_EXT;
  15377. }
  15378. return 0;
  15379. }),
  15380. (n.WebGLState = function (e, t, i) {
  15381. var r = this,
  15382. o = new n.Vector4(),
  15383. a = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  15384. s = new Uint8Array(a),
  15385. l = new Uint8Array(a),
  15386. c = new Uint8Array(a),
  15387. h = {},
  15388. u = null,
  15389. d = null,
  15390. p = null,
  15391. f = null,
  15392. g = null,
  15393. m = null,
  15394. v = null,
  15395. A = null,
  15396. y = !1,
  15397. C = null,
  15398. I = null,
  15399. E = null,
  15400. b = null,
  15401. w = null,
  15402. _ = null,
  15403. T = null,
  15404. x = null,
  15405. S = null,
  15406. M = null,
  15407. R = null,
  15408. P = null,
  15409. O = null,
  15410. L = null,
  15411. D = null,
  15412. N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  15413. B = void 0,
  15414. F = {},
  15415. V = new n.Vector4(),
  15416. U = null,
  15417. k = null,
  15418. H = new n.Vector4(),
  15419. G = new n.Vector4();
  15420. (this.init = function () {
  15421. this.clearColor(0, 0, 0, 1),
  15422. this.clearDepth(1),
  15423. this.clearStencil(0),
  15424. this.enable(e.DEPTH_TEST),
  15425. e.depthFunc(e.LEQUAL),
  15426. e.frontFace(e.CCW),
  15427. e.cullFace(e.BACK),
  15428. this.enable(e.CULL_FACE),
  15429. this.enable(e.BLEND),
  15430. e.blendEquation(e.FUNC_ADD),
  15431. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA);
  15432. }),
  15433. (this.initAttributes = function () {
  15434. for (var e = 0, t = s.length; e < t; e++) s[e] = 0;
  15435. }),
  15436. (this.enableAttribute = function (i) {
  15437. if (
  15438. ((s[i] = 1),
  15439. 0 === l[i] && (e.enableVertexAttribArray(i), (l[i] = 1)),
  15440. 0 !== c[i])
  15441. ) {
  15442. var n = t.get("ANGLE_instanced_arrays");
  15443. n.vertexAttribDivisorANGLE(i, 0), (c[i] = 0);
  15444. }
  15445. }),
  15446. (this.enableAttributeAndDivisor = function (t, i, n) {
  15447. (s[t] = 1),
  15448. 0 === l[t] && (e.enableVertexAttribArray(t), (l[t] = 1)),
  15449. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i), (c[t] = i));
  15450. }),
  15451. (this.disableUnusedAttributes = function () {
  15452. for (var t = 0, i = l.length; t < i; t++)
  15453. l[t] !== s[t] && (e.disableVertexAttribArray(t), (l[t] = 0));
  15454. }),
  15455. (this.enable = function (t) {
  15456. h[t] !== !0 && (e.enable(t), (h[t] = !0));
  15457. }),
  15458. (this.disable = function (t) {
  15459. h[t] !== !1 && (e.disable(t), (h[t] = !1));
  15460. }),
  15461. (this.getCompressedTextureFormats = function () {
  15462. if (
  15463. null === u &&
  15464. ((u = []),
  15465. t.get("WEBGL_compressed_texture_pvrtc") ||
  15466. t.get("WEBGL_compressed_texture_s3tc") ||
  15467. t.get("WEBGL_compressed_texture_etc1"))
  15468. )
  15469. for (
  15470. var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0;
  15471. n < i.length;
  15472. n++
  15473. )
  15474. u.push(i[n]);
  15475. return u;
  15476. }),
  15477. (this.setBlending = function (t, r, o, a, s, l, c, h) {
  15478. t === n.NoBlending
  15479. ? this.disable(e.BLEND)
  15480. : this.enable(e.BLEND),
  15481. (t === d && h === y) ||
  15482. (t === n.AdditiveBlending
  15483. ? h
  15484. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  15485. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE))
  15486. : (e.blendEquation(e.FUNC_ADD),
  15487. e.blendFunc(e.SRC_ALPHA, e.ONE))
  15488. : t === n.SubtractiveBlending
  15489. ? h
  15490. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  15491. e.blendFuncSeparate(
  15492. e.ZERO,
  15493. e.ZERO,
  15494. e.ONE_MINUS_SRC_COLOR,
  15495. e.ONE_MINUS_SRC_ALPHA
  15496. ))
  15497. : (e.blendEquation(e.FUNC_ADD),
  15498. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR))
  15499. : t === n.MultiplyBlending
  15500. ? h
  15501. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  15502. e.blendFuncSeparate(
  15503. e.ZERO,
  15504. e.ZERO,
  15505. e.SRC_COLOR,
  15506. e.SRC_ALPHA
  15507. ))
  15508. : (e.blendEquation(e.FUNC_ADD),
  15509. e.blendFunc(e.ZERO, e.SRC_COLOR))
  15510. : h
  15511. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  15512. e.blendFuncSeparate(
  15513. e.ONE,
  15514. e.ONE_MINUS_SRC_ALPHA,
  15515. e.ONE,
  15516. e.ONE_MINUS_SRC_ALPHA
  15517. ))
  15518. : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  15519. e.blendFuncSeparate(
  15520. e.SRC_ALPHA,
  15521. e.ONE_MINUS_SRC_ALPHA,
  15522. e.ONE,
  15523. e.ONE_MINUS_SRC_ALPHA
  15524. )),
  15525. (d = t),
  15526. (y = h)),
  15527. t === n.CustomBlending
  15528. ? ((s = s || r),
  15529. (l = l || o),
  15530. (c = c || a),
  15531. (r === p && s === m) ||
  15532. (e.blendEquationSeparate(i(r), i(s)), (p = r), (m = s)),
  15533. (o === f && a === g && l === v && c === A) ||
  15534. (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  15535. (f = o),
  15536. (g = a),
  15537. (v = l),
  15538. (A = c)))
  15539. : ((p = null),
  15540. (f = null),
  15541. (g = null),
  15542. (m = null),
  15543. (v = null),
  15544. (A = null));
  15545. }),
  15546. (this.setDepthFunc = function (t) {
  15547. if (C !== t) {
  15548. if (t)
  15549. switch (t) {
  15550. case n.NeverDepth:
  15551. e.depthFunc(e.NEVER);
  15552. break;
  15553. case n.AlwaysDepth:
  15554. e.depthFunc(e.ALWAYS);
  15555. break;
  15556. case n.LessDepth:
  15557. e.depthFunc(e.LESS);
  15558. break;
  15559. case n.LessEqualDepth:
  15560. e.depthFunc(e.LEQUAL);
  15561. break;
  15562. case n.EqualDepth:
  15563. e.depthFunc(e.EQUAL);
  15564. break;
  15565. case n.GreaterEqualDepth:
  15566. e.depthFunc(e.GEQUAL);
  15567. break;
  15568. case n.GreaterDepth:
  15569. e.depthFunc(e.GREATER);
  15570. break;
  15571. case n.NotEqualDepth:
  15572. e.depthFunc(e.NOTEQUAL);
  15573. break;
  15574. default:
  15575. e.depthFunc(e.LEQUAL);
  15576. }
  15577. else e.depthFunc(e.LEQUAL);
  15578. C = t;
  15579. }
  15580. }),
  15581. (this.setDepthTest = function (t) {
  15582. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST);
  15583. }),
  15584. (this.setDepthWrite = function (t) {
  15585. I !== t && (e.depthMask(t), (I = t));
  15586. }),
  15587. (this.setColorWrite = function (t) {
  15588. E !== t && (e.colorMask(t, t, t, t), (E = t));
  15589. }),
  15590. (this.setStencilFunc = function (t, i, n) {
  15591. (w === t && _ === i && T === n) ||
  15592. (e.stencilFunc(t, i, n), (w = t), (_ = i), (T = n));
  15593. }),
  15594. (this.setStencilOp = function (t, i, n) {
  15595. (x === t && S === i && M === n) ||
  15596. (e.stencilOp(t, i, n), (x = t), (S = i), (M = n));
  15597. }),
  15598. (this.setStencilTest = function (t) {
  15599. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST);
  15600. }),
  15601. (this.setStencilWrite = function (t) {
  15602. b !== t && (e.stencilMask(t), (b = t));
  15603. }),
  15604. (this.setFlipSided = function (t) {
  15605. R !== t &&
  15606. (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), (R = t));
  15607. }),
  15608. (this.setLineWidth = function (t) {
  15609. t !== P && (e.lineWidth(t), (P = t));
  15610. }),
  15611. (this.setPolygonOffset = function (t, i, n) {
  15612. t
  15613. ? this.enable(e.POLYGON_OFFSET_FILL)
  15614. : this.disable(e.POLYGON_OFFSET_FILL),
  15615. !t ||
  15616. (O === i && L === n) ||
  15617. (e.polygonOffset(i, n), (O = i), (L = n));
  15618. }),
  15619. (this.getScissorTest = function () {
  15620. return D;
  15621. }),
  15622. (this.setScissorTest = function (t) {
  15623. (D = t),
  15624. t
  15625. ? this.enable(e.SCISSOR_TEST)
  15626. : this.disable(e.SCISSOR_TEST);
  15627. }),
  15628. (this.activeTexture = function (t) {
  15629. void 0 === t && (t = e.TEXTURE0 + N - 1),
  15630. B !== t && (e.activeTexture(t), (B = t));
  15631. }),
  15632. (this.bindTexture = function (t, i) {
  15633. void 0 === B && r.activeTexture();
  15634. var n = F[B];
  15635. void 0 === n &&
  15636. ((n = {
  15637. type: void 0,
  15638. texture: void 0,
  15639. }),
  15640. (F[B] = n)),
  15641. (n.type === t && n.texture === i) ||
  15642. (e.bindTexture(t, i), (n.type = t), (n.texture = i));
  15643. }),
  15644. (this.compressedTexImage2D = function () {
  15645. try {
  15646. e.compressedTexImage2D.apply(e, arguments);
  15647. } catch (e) {
  15648. console.error(e);
  15649. }
  15650. }),
  15651. (this.texImage2D = function () {
  15652. try {
  15653. e.texImage2D.apply(e, arguments);
  15654. } catch (e) {
  15655. console.error(e);
  15656. }
  15657. }),
  15658. (this.clearColor = function (t, i, n, r) {
  15659. o.set(t, i, n, r),
  15660. V.equals(o) === !1 && (e.clearColor(t, i, n, r), V.copy(o));
  15661. }),
  15662. (this.clearDepth = function (t) {
  15663. U !== t && (e.clearDepth(t), (U = t));
  15664. }),
  15665. (this.clearStencil = function (t) {
  15666. k !== t && (e.clearStencil(t), (k = t));
  15667. }),
  15668. (this.scissor = function (t) {
  15669. H.equals(t) === !1 &&
  15670. (e.scissor(t.x, t.y, t.z, t.w), H.copy(t));
  15671. }),
  15672. (this.viewport = function (t) {
  15673. G.equals(t) === !1 &&
  15674. (e.viewport(t.x, t.y, t.z, t.w), G.copy(t));
  15675. }),
  15676. (this.reset = function () {
  15677. for (var t = 0; t < l.length; t++)
  15678. 1 === l[t] && (e.disableVertexAttribArray(t), (l[t] = 0));
  15679. (h = {}),
  15680. (u = null),
  15681. (B = void 0),
  15682. (F = {}),
  15683. (d = null),
  15684. (E = null),
  15685. (I = null),
  15686. (b = null),
  15687. (R = null);
  15688. });
  15689. });
  15690. },
  15691. {
  15692. three: 217,
  15693. },
  15694. ],
  15695. 104: [
  15696. function (e, t, i) {
  15697. (function (i, n) {
  15698. "use strict";
  15699. function r(e) {
  15700. this.urls = e;
  15701. var t = i(
  15702. "bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==",
  15703. "base64"
  15704. );
  15705. (this.builder = a.loadProto(t)),
  15706. (this.decoder = this.builder.build("binary_mesh"));
  15707. }
  15708. var o = e("three"),
  15709. a = e("protobufjs"),
  15710. s = e("../util/logger"),
  15711. l = (e("../util/common"), e("../util/ajax")),
  15712. c = e("../objects/Chunk"),
  15713. h = new s(n);
  15714. (r.prototype = {
  15715. constructor: r,
  15716. load: function (e, t, i, n) {
  15717. return (
  15718. h.time("download"),
  15719. l
  15720. .get(e, {
  15721. responseType: "arraybuffer",
  15722. })
  15723. .done(
  15724. function (r) {
  15725. h.timeEnd("download"), this.parse(r, e, t, i, n);
  15726. }.bind(this)
  15727. )
  15728. .fail(n)
  15729. );
  15730. },
  15731. parse: function (e, t, i, n, r) {
  15732. var o = this.readProtobuf(e);
  15733. if (!o) return r();
  15734. try {
  15735. h.time("convert to webgl"),
  15736. this.convertProtobufToSceneObject(o, t, i, n, r),
  15737. h.timeEnd("convert to webgl");
  15738. } catch (e) {
  15739. return h.error("failed parsing .dam"), h.error(e.message), r();
  15740. }
  15741. },
  15742. readProtobuf: function (e) {
  15743. var t;
  15744. try {
  15745. h.time("parse proto"),
  15746. (t = this.decoder.decode(e)),
  15747. h.timeEnd("parse proto");
  15748. } catch (e) {
  15749. return (
  15750. h.error("failed parsing proto for .dam"),
  15751. h.error(e.message),
  15752. null
  15753. );
  15754. }
  15755. return t;
  15756. },
  15757. convertProtobufToSceneObject: function (e, t, i, n, r) {
  15758. function a(e) {
  15759. var i = new o.BufferGeometry();
  15760. return (
  15761. i.addAttribute(
  15762. "position",
  15763. new o.BufferAttribute(
  15764. new Float32Array(e.vertices.xyz, 0, 3),
  15765. 3
  15766. )
  15767. ),
  15768. e.vertices.uv.length > 0 &&
  15769. i.addAttribute(
  15770. "uv",
  15771. new o.BufferAttribute(
  15772. new Float32Array(e.vertices.uv, 0, 2),
  15773. 2
  15774. )
  15775. ),
  15776. i.setIndex(
  15777. new o.BufferAttribute(
  15778. new Uint32Array(e.faces.faces, 0, 1),
  15779. 1
  15780. )
  15781. ),
  15782. i.applyMatrix(s),
  15783. i.computeBoundingBox(),
  15784. new c({
  15785. geometry: i,
  15786. textureName: e.material_name,
  15787. name: e.chunk_name,
  15788. meshUrl: t,
  15789. })
  15790. );
  15791. }
  15792. if (0 === e.chunk.length)
  15793. return h.warn("No chunks in damfile..."), i([]);
  15794. var s = new o.Matrix4();
  15795. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  15796. var l = e.chunk.map(a);
  15797. return l
  15798. ? i(l)
  15799. : (h.error(".dam protobuf came out with no chunks..."), r());
  15800. },
  15801. }),
  15802. (t.exports = r);
  15803. }).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js");
  15804. },
  15805. {
  15806. "../objects/Chunk": 144,
  15807. "../util/ajax": 181,
  15808. "../util/common": 185,
  15809. "../util/logger": 189,
  15810. buffer: 198,
  15811. protobufjs: 214,
  15812. three: 217,
  15813. },
  15814. ],
  15815. 105: [
  15816. function (e, t, i) {
  15817. (function (i) {
  15818. "use strict";
  15819. var n =
  15820. (e("three"),
  15821. e("../settings"),
  15822. e("../util/browser"),
  15823. e("./DamLoader")),
  15824. r = e("../util/logger"),
  15825. o = (e("../ab"), new r(i));
  15826. t.exports = {
  15827. getLoaders: function () {
  15828. return [
  15829. ["_50k", ".dam", n],
  15830. ["", ".dam", n],
  15831. ];
  15832. },
  15833. load: function (e, t, i, n, r, a) {
  15834. var s = this.getLoaders();
  15835. a = a || 0;
  15836. var l = s[a];
  15837. if (!l) return void (r && r("No suitable model file found..."));
  15838. var c = l[0],
  15839. h = l[1],
  15840. u = new l[2](t),
  15841. d = t.get(e + c + h);
  15842. d
  15843. ? (o.debug("Trying " + c + h),
  15844. u.load(
  15845. d,
  15846. i,
  15847. n,
  15848. function () {
  15849. this.load(e, t, i, n, r, ++a);
  15850. }.bind(this)
  15851. ))
  15852. : (o.debug("Skipping " + h + ", not available"),
  15853. this.load(e, t, i, n, r, ++a));
  15854. },
  15855. };
  15856. }).call(this, "/js/loaders/ModelLoader.js");
  15857. },
  15858. {
  15859. "../ab": 3,
  15860. "../settings": 166,
  15861. "../util/browser": 182,
  15862. "../util/logger": 189,
  15863. "./DamLoader": 104,
  15864. three: 217,
  15865. },
  15866. ],
  15867. 106: [
  15868. function (e, t, i) {
  15869. (function (i) {
  15870. "use strict";
  15871. var n = e("../util/common"),
  15872. r = e("../util/texture"),
  15873. o = e("../util/browser"),
  15874. a = e("../util/logger"),
  15875. s = e("../settings"),
  15876. l = new a(i);
  15877. t.exports = {
  15878. load: function (e, t) {
  15879. function i(e, i) {
  15880. e || (t.push(i), p++, d.notify(p, a), p === a && d.resolve());
  15881. }
  15882. if (!e.chunks[0] || !e.chunks[0].meshUrl) return $.when();
  15883. var a = n.countUnique(
  15884. e.chunks.map(function (e) {
  15885. return e.textureName;
  15886. })
  15887. ),
  15888. c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : "",
  15889. h = "_50k" === c ? "high" : "low";
  15890. s.minimalMemoryMode &&
  15891. "high" === h &&
  15892. (o.detectSamsungS6()
  15893. ? (l.warn(
  15894. "Galaxy S6 cannot handle large textures, turning down quality."
  15895. ),
  15896. (h = "low"))
  15897. : a > s.maxMobileTextures &&
  15898. (l.warn(
  15899. "Model probably too large for mobile, turning down quality."
  15900. ),
  15901. (h = "low")));
  15902. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/",
  15903. d = $.Deferred(),
  15904. p = 0;
  15905. return (
  15906. e.chunks.forEach(function (t) {
  15907. if (!t.material.map && t.textureName) {
  15908. var n = e.urls.get(u + t.textureName);
  15909. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))));
  15910. }
  15911. }),
  15912. d.promise()
  15913. );
  15914. },
  15915. };
  15916. }).call(this, "/js/loaders/ModelTextureLoader.js");
  15917. },
  15918. {
  15919. "../settings": 166,
  15920. "../util/browser": 182,
  15921. "../util/common": 185,
  15922. "../util/logger": 189,
  15923. "../util/texture": 194,
  15924. },
  15925. ],
  15926. 107: [
  15927. function (e, t, i) {
  15928. (function (i, n) {
  15929. "use strict";
  15930. function r(e) {
  15931. (this.model = e),
  15932. (this.modelDataPath =
  15933. this.model.urls.get("vision.modeldata") +
  15934. "?m=" +
  15935. new Date().getTime()),
  15936. (this.sweepLocationsPath = this.model.urls.get(
  15937. "sweep_locations.csv"
  15938. ));
  15939. var t = i(
  15940. "Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K",
  15941. "base64"
  15942. ),
  15943. n = o.loadProto(t);
  15944. this.decoder = n.build("VisionModeldata");
  15945. }
  15946. var o = e("protobufjs"),
  15947. a = e("../util/ajax"),
  15948. s = (e("../util/common"), e("../util/math")),
  15949. l = e("../util/logger"),
  15950. c = new l(n);
  15951. (r.prototype.load = function () {
  15952. return this.modelDataPath
  15953. ? (c.info("Using vision.modeldata"), this.loadVisionModelData())
  15954. : this.sweepLocationsPath
  15955. ? (c.warn("Using sweep_locations.csv"),
  15956. this.loadSweepLocationsCSV())
  15957. : (c.warn("No sweep file found"), $.when([]));
  15958. }),
  15959. (r.prototype.loadVisionModelData = function () {
  15960. return a
  15961. .get(this.modelDataPath, {
  15962. responseType: "arraybuffer",
  15963. })
  15964. .then(
  15965. function (e) {
  15966. var t;
  15967. try {
  15968. t = this.decoder.decode(e);
  15969. } catch (e) {
  15970. return (
  15971. c.warn(
  15972. "Could not decode vision.modeldata, trying sweep_locations.csv"
  15973. ),
  15974. this.loadSweepLocationsCSV()
  15975. );
  15976. }
  15977. var i = t.sweepLocations
  15978. .map(function (e) {
  15979. return {
  15980. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  15981. position: {
  15982. x: e.pose.translation.x,
  15983. y: e.pose.translation.y,
  15984. z: e.pose.translation.z,
  15985. },
  15986. quaternion: {
  15987. x: e.pose.rotation.x,
  15988. y: e.pose.rotation.y,
  15989. z: e.pose.rotation.z,
  15990. w: e.pose.rotation.w,
  15991. },
  15992. puck: {
  15993. x: e.puck.x,
  15994. y: e.puck.y,
  15995. z: e.puck.z,
  15996. },
  15997. floor:
  15998. window.sceneFrom == "kankan" ? e.subgroup : e.group,
  15999. neighbours: e.visibles,
  16000. alignmentType: e.alignment_type,
  16001. };
  16002. })
  16003. .map(function (e) {
  16004. return (
  16005. (e.position = s.convertVisionVector(e.position)),
  16006. (e.quaternion = s.convertVisionQuaternion(
  16007. e.quaternion
  16008. )),
  16009. (e.puck = s.convertVisionVector(e.puck)),
  16010. e
  16011. );
  16012. });
  16013. return (
  16014. i.forEach(function (e) {
  16015. e.neighbours = e.neighbours.map(function (e) {
  16016. return i[e].uuid;
  16017. });
  16018. }),
  16019. i
  16020. );
  16021. }.bind(this),
  16022. function () {
  16023. return (
  16024. c.warn(
  16025. "Could not load vision.modeldata, trying sweep_locations.csv"
  16026. ),
  16027. this.loadSweepLocationsCSV()
  16028. );
  16029. }.bind(this)
  16030. );
  16031. }),
  16032. (r.prototype.loadSweepLocationsCSV = function () {
  16033. return a
  16034. .get(this.sweepLocationsPath)
  16035. .then(function (e) {
  16036. var t = e
  16037. .split("\n")
  16038. .map(function (e) {
  16039. return e.split(", ");
  16040. })
  16041. .filter(function (e) {
  16042. return e.length > 1;
  16043. })
  16044. .map(function (e) {
  16045. return {
  16046. uuid: e[0],
  16047. position: {
  16048. x: parseFloat(e[1]),
  16049. y: parseFloat(e[2]),
  16050. z: parseFloat(e[3]),
  16051. },
  16052. quaternion: {
  16053. x: parseFloat(e[4]),
  16054. y: parseFloat(e[5]),
  16055. z: parseFloat(e[6]),
  16056. w: parseFloat(e[7]),
  16057. },
  16058. };
  16059. })
  16060. .map(function (e) {
  16061. return (
  16062. (e.position = s.convertVisionVector(e.position)),
  16063. (e.quaternion = s.convertVisionQuaternion(
  16064. e.quaternion
  16065. )),
  16066. e
  16067. );
  16068. });
  16069. return t;
  16070. })
  16071. .fail(function () {
  16072. c.warn(
  16073. "Could not load sweep_locations.csv, no sweeps loaded."
  16074. );
  16075. });
  16076. }),
  16077. (t.exports = r);
  16078. }).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js");
  16079. },
  16080. {
  16081. "../util/ajax": 181,
  16082. "../util/common": 185,
  16083. "../util/logger": 189,
  16084. "../util/math": 190,
  16085. buffer: 198,
  16086. protobufjs: 214,
  16087. },
  16088. ],
  16089. 108: [
  16090. function (e, t, i) {
  16091. (function (i) {
  16092. "use strict";
  16093. function n() {
  16094. this.locale = null;
  16095. }
  16096. var r = e("../settings"),
  16097. o = e("../util/common"),
  16098. a = e("../util/logger"),
  16099. s = e("../enum/Locale"),
  16100. l = new a(i);
  16101. (n.prototype.init = function () {
  16102. var t;
  16103. switch (r.languageTag) {
  16104. case null:
  16105. case "en":
  16106. case s.EN_US:
  16107. (this.locale = s.EN_US), (t = e("./strings-en-US"));
  16108. break;
  16109. case "es":
  16110. case s.ES_MX:
  16111. (this.locale = s.ES_MX), (t = e("./strings-es-MX"));
  16112. break;
  16113. case "fr":
  16114. case s.FR_FR:
  16115. (this.locale = s.FR_FR), (t = e("./strings-fr-FR"));
  16116. break;
  16117. case "de":
  16118. case s.DE_DE:
  16119. (this.locale = s.DE_DE), (t = e("./strings-de-DE"));
  16120. break;
  16121. case "ru":
  16122. case s.RU_RU:
  16123. (this.locale = s.RU_RU), (t = e("./strings-ru-RU"));
  16124. break;
  16125. case "cn":
  16126. case s.CN_CN:
  16127. (this.locale = s.CN_CN), (t = e("./strings-cn-CN"));
  16128. break;
  16129. case "jp":
  16130. case s.JP_JP:
  16131. (this.locale = s.JP_JP), (t = e("./strings-jp-JP"));
  16132. break;
  16133. default:
  16134. l.info("Unsupported language tag, defaulting to 'en-US'"),
  16135. (this.locale = s.EN_US),
  16136. (t = e("./strings-en-US"));
  16137. }
  16138. l.info("Using locale '" + this.locale + "'"),
  16139. o.extendObject(this, t);
  16140. }),
  16141. (n.prototype.localizeGUI = function () {
  16142. var e = document.querySelector("#gui-parent");
  16143. this.localizeTree(e), this.localizeLoadingText();
  16144. }),
  16145. (n.prototype.localizeLoadingText = function () {
  16146. // var e = document.querySelector("#loader-cont")
  16147. // , t = e.getAttribute("title");
  16148. // e.removeAttribute("title"),
  16149. // e.setAttribute("data-status", t),
  16150. // e.classList.add(this.locale),
  16151. document.querySelector("#help-dialog").classList.add(this.locale),
  16152. document
  16153. .querySelector("#interaction-modal")
  16154. .classList.add(this.locale),
  16155. document.querySelector("#gui").classList.add(this.locale);
  16156. }),
  16157. (n.prototype.localizeTree = function (e) {
  16158. var t,
  16159. i,
  16160. n = /{\[{ ?(\w+) ?}\]}/;
  16161. if (e.nodeType === Node.TEXT_NODE)
  16162. (t = e.data.match(n)),
  16163. t && ((i = t[1]), (e.data = this.localizeText(i) || i));
  16164. else if (e.nodeType === Node.ELEMENT_NODE) {
  16165. var r = e.getAttribute("title");
  16166. r &&
  16167. ((t = r.match(n)),
  16168. t &&
  16169. ((i = t[1]),
  16170. e.setAttribute("title", this.localizeText(i) || i)));
  16171. }
  16172. for (e = e.firstChild; e; )
  16173. this.localizeTree(e), (e = e.nextSibling);
  16174. }),
  16175. (n.prototype.localizeText = function (t) {
  16176. var i = this[t];
  16177. return (
  16178. i ||
  16179. this.locale === s.EN_US ||
  16180. (l.warn(
  16181. "Localization key '" +
  16182. t +
  16183. "' not available for locale '" +
  16184. this.locale +
  16185. "', defaulting to English."
  16186. ),
  16187. (i = e("./strings-en-US")[t])),
  16188. i ||
  16189. l.warn(
  16190. "Localization key '" +
  16191. t +
  16192. "' not available for locale 'en-US'"
  16193. ),
  16194. i
  16195. );
  16196. }),
  16197. (t.exports = new n());
  16198. }).call(this, "/js/localization/localize.js");
  16199. },
  16200. {
  16201. "../enum/Locale": 31,
  16202. "../settings": 166,
  16203. "../util/common": 185,
  16204. "../util/logger": 189,
  16205. "./strings-cn-CN": 109,
  16206. "./strings-de-DE": 110,
  16207. "./strings-en-US": 111,
  16208. "./strings-es-MX": 112,
  16209. "./strings-fr-FR": 113,
  16210. "./strings-jp-JP": 114,
  16211. "./strings-ru-RU": 115,
  16212. },
  16213. ],
  16214. 109: [
  16215. function (e, t, i) {
  16216. "use strict";
  16217. t.exports = {
  16218. PAGE_TITLE: "",
  16219. LOADING: "正在加载",
  16220. PRESENTED_BY_CAPS: "呈现者:",
  16221. POWERED_BY: "技术支持:",
  16222. POWERED_BY_CAPS: "技术支持:",
  16223. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  16224. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  16225. PRESENTED_BY: "呈现者:",
  16226. MORE: "更多 ",
  16227. LESS: "更少 ",
  16228. TAG_CONTENT: "tag™ 内容",
  16229. SHOW: "显示",
  16230. HIDE: "隐藏",
  16231. DOLLHOUSE: "场景屋",
  16232. FLOOR_PLAN: "楼层平面图",
  16233. OPEN_HIGHLIGHTS: "打开精彩片段",
  16234. CLOSE_HIGHLIGHTS: "关闭",
  16235. PREVIOUS: "上一个",
  16236. PLAY: "播放",
  16237. PAUSE: "暂停",
  16238. NEXT: "下一个",
  16239. EXPLORE_3D_SPACE: "探索 3D 空间",
  16240. VIEW_DOLLHOUSE: "观看场景屋",
  16241. SOCIAL_SHARING: "分享这个空间",
  16242. VIEW_IN_VR: "以 VR 观看",
  16243. VIEW_FULLSCREEN: "全屏观看",
  16244. EXIT_FULLSCREEN: " 退出全屏",
  16245. ZOOM_IN: "放大",
  16246. ZOOM_OUT: "缩小",
  16247. FLOOR_NAME: "楼层",
  16248. FLOOR_ALL: "ALL",
  16249. FLOOR_Lang: ["Floor", ""],
  16250. TERMS: "条款",
  16251. PORT_TERMS: "port 条款",
  16252. TERMS_OF_USE: "使用条款",
  16253. CLOSE_TERMS: "关闭",
  16254. TERMS_TEXT_FILE: "terms-cn-CN.html",
  16255. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  16256. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  16257. WEBVR_ENTER_WEBVR: "进入 VR",
  16258. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  16259. WEBVR_LEARN_MORE: "了解更多",
  16260. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  16261. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  16262. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  16263. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  16264. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  16265. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  16266. VR_LEARN_MORE_CAPS: "了解更多",
  16267. VR_PREVIOUS_CAPS: "上一个’,",
  16268. VR_NEXT_CAPS: "下一个",
  16269. VR_GOT_IT_CAPS: "明白了",
  16270. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  16271. VR_SHOW_UNSUPPORTED:
  16272. "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  16273. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  16274. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  16275. VR_WHAT_YOU_NEED: "关于...您需要什么",
  16276. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  16277. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  16278. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  16279. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  16280. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  16281. VR_GOOGLE_DAYDREAM: "Google Daydream",
  16282. VR_APP: "port VR 应用程序",
  16283. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  16284. VR_COMPATIBLE_IPHONES_1: "iPhones",
  16285. VR_COMPATIBLE_IPHONES_2:
  16286. "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  16287. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  16288. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  16289. VR_COMPATIBLE_ANDROID_LONG:
  16290. "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  16291. VR_ANDROID_DETAIL:
  16292. "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  16293. VR_ANDROID_DVICES: "Android 设备",
  16294. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  16295. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  16296. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  16297. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  16298. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  16299. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  16300. VR_DOWNLOAD_HERE: "在此下载",
  16301. VR_REQUIRE_HEADSET:
  16302. "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  16303. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  16304. VR_IMPROPER_EMBED:
  16305. "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  16306. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  16307. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  16308. SHARE_TO: "分享到",
  16309. SHARE_LINK: "直接链接",
  16310. SHARE_EXPLORE: "探索",
  16311. SHARE_AT: "在",
  16312. SHARE_WITH: "使用",
  16313. SHARE_3D: "以 3D",
  16314. SHARE_COPIED: "已复制!",
  16315. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  16316. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  16317. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  16318. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  16319. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  16320. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  16321. ERROR_GENERIC_ACTIONS_3: " 或",
  16322. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  16323. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  16324. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  16325. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  16326. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  16327. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  16328. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  16329. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  16330. ERROR_WEBGL_SAFARI_ACTIONS_2:
  16331. "菜单栏中的首选项 > 高级 > 显示开发菜单",
  16332. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  16333. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  16334. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  16335. ERROR_MISSING_URLS_EXPLANATION:
  16336. "这是较早的模型。网站所有者可能正在开发一种新模型。",
  16337. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  16338. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  16339. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  16340. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  16341. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  16342. LINK_TO_LOCATION: "地点链接",
  16343. MENU_COPY: "复制",
  16344. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  16345. ROTATE: "旋转",
  16346. MOVE: "移动",
  16347. INSIDE: "内部",
  16348. ZOOM: "缩放",
  16349. HELP: "小帮手",
  16350. HELP_NAVIGATION_TAB: "导航",
  16351. HELP_MORE_HELP_TAB: "更多帮助",
  16352. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  16353. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  16354. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  16355. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  16356. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  16357. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  16358. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  16359. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  16360. HELP_DESKTOP_DOLLHOUSE_1A:
  16361. "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  16362. HELP_DESKTOP_DOLLHOUSE_2A:
  16363. "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  16364. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  16365. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  16366. HELP_DESKTOP_FLOORPLAN_1A:
  16367. "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  16368. HELP_DESKTOP_FLOORPLAN_2A:
  16369. "右键单击并向左或向右拖动以旋转楼层平面图。",
  16370. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  16371. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  16372. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  16373. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  16374. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  16375. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  16376. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  16377. HELP_MOBILE_DOLLHOUSE_1:
  16378. "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  16379. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  16380. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  16381. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  16382. HELP_MORE_HLR_A: "精彩片段集锦",
  16383. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  16384. HELP_MORE_DOLLHOUSE_A: "场景屋",
  16385. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  16386. "单击以查看和旋转 3D 内整个空间的俯视图。",
  16387. HELP_MOBILE_MORE_DOLLHOUSE_B:
  16388. "点击以查看和旋转 3D 内整个空间的俯视图。",
  16389. HELP_MORE_FLOORS_A: "楼层选择器",
  16390. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  16391. HELP_MORE_TAG_A: "tag™ 贴文",
  16392. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  16393. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  16394. HELP_MORE_ZOOM_A: "缩放控件",
  16395. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  16396. HELP_MORE_TOUR_A: "导览控件",
  16397. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  16398. HELP_MORE_INSIDE_A: "内部视图",
  16399. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  16400. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  16401. HELP_MORE_VR_A: "VR 模式",
  16402. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  16403. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  16404. HELP_MORE_360_A: "360° 视图",
  16405. HELP_DESKTOP_MORE_360_B:
  16406. "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  16407. HELP_MOBILE_MORE_360_B:
  16408. "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  16409. HELP_MORE_FULLSCREEN_A: "全屏",
  16410. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  16411. CLOSE: "关闭",
  16412. };
  16413. },
  16414. {},
  16415. ],
  16416. 110: [
  16417. function (e, t, i) {
  16418. "use strict";
  16419. t.exports = {
  16420. PAGE_TITLE: "",
  16421. LOADING: "Lädt",
  16422. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  16423. POWERED_BY: "Angetrieben von",
  16424. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  16425. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  16426. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  16427. PRESENTED_BY: "Präsentiert von ",
  16428. MORE: "Mehr ",
  16429. LESS: "Weniger ",
  16430. TAG_CONTENT: "tag™ Inhalt",
  16431. SHOW: "Anzeigen",
  16432. HIDE: "Verbergen",
  16433. DOLLHOUSE: "Puppenhaus",
  16434. FLOOR_PLAN: "Grundriss",
  16435. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  16436. CLOSE_HIGHLIGHTS: "Schließen",
  16437. PREVIOUS: "Vorheriges",
  16438. PLAY: "Abspielen",
  16439. PAUSE: "Pausieren",
  16440. NEXT: "Nächstes",
  16441. EXPLORE_3D_SPACE: "Innenraum betreten",
  16442. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  16443. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  16444. VIEW_IN_VR: "In VR ansehen",
  16445. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  16446. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  16447. ZOOM_IN: "Vergrößern",
  16448. ZOOM_OUT: "Verkleinern",
  16449. FLOOR_NAME: "Etage ",
  16450. FLOOR_ALL: "Alle",
  16451. TERMS: "Bedingungen",
  16452. PORT_TERMS: "port Bedingungen",
  16453. TERMS_OF_USE: "Nutzungsbedingungen",
  16454. TERMS_TEXT_FILE: "terms-de-DE.html",
  16455. CLOSE_TERMS: "Schließen",
  16456. TERMS_FAIL:
  16457. "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  16458. HELP: "Hilfe",
  16459. HELP_NAVIGATION_TAB: "Navigation",
  16460. HELP_MORE_HELP_TAB: "Hilfe-Details",
  16461. CLOSE: "Schließen",
  16462. HELP_DESKTOP_PANORAMA_1A:
  16463. "Klicken und ziehen Sie um sich im Raum umzusehen.",
  16464. HELP_DESKTOP_PANORAMA_2A:
  16465. "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  16466. HELP_DESKTOP_PANORAMA_3A:
  16467. "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  16468. HELP_DESKTOP_PANORAMA_1B:
  16469. "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  16470. HELP_DESKTOP_PANORAMA_2B:
  16471. "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  16472. HELP_DESKTOP_PANORAMA_3B:
  16473. "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  16474. HELP_DESKTOP_360_2A:
  16475. "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  16476. HELP_DESKTOP_360_2B:
  16477. "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  16478. HELP_DESKTOP_DOLLHOUSE_1A:
  16479. "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  16480. HELP_DESKTOP_DOLLHOUSE_2A:
  16481. "Klicken mit der rechten Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Puppenhauses zu ändern.",
  16482. HELP_DESKTOP_DOLLHOUSE_3A:
  16483. "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  16484. HELP_DESKTOP_DOLLHOUSE_1B:
  16485. "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  16486. HELP_DESKTOP_FLOORPLAN_1A:
  16487. "Klicken mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Grundrisses auf zu ändern.",
  16488. HELP_DESKTOP_FLOORPLAN_2A:
  16489. "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  16490. HELP_DESKTOP_FLOORPLAN_3A:
  16491. "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  16492. HELP_DESKTOP_FLOORPLAN_2B:
  16493. "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  16494. HELP_DESKTOP_FLOORPLAN_3B:
  16495. "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  16496. HELP_MOBILE_PANORAMA_1:
  16497. "Berühren und ziehen an dem Raum um sich umzusehen.",
  16498. HELP_MOBILE_PANORAMA_2:
  16499. "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  16500. HELP_MOBILE_3:
  16501. "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  16502. HELP_MOBILE_360_2:
  16503. "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  16504. HELP_MOBILE_DOLLHOUSE_1:
  16505. "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  16506. HELP_MOBILE_DOLLHOUSE_2:
  16507. "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  16508. HELP_MOBILE_FLOORPLAN_1:
  16509. "Berühren und ziehen, um den Grundriss zu positionieren.",
  16510. HELP_MOBILE_FLOORPLAN_2:
  16511. "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  16512. HELP_MORE_HLR_A: "Liste das Highlight",
  16513. HELP_DESKTOP_MORE_HLR_B:
  16514. "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  16515. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  16516. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  16517. "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  16518. HELP_MOBILE_MORE_DOLLHOUSE_B:
  16519. "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  16520. HELP_MORE_FLOORS_A: "Etage auswählen",
  16521. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  16522. HELP_MORE_TAG_A: "tag™ Posts",
  16523. HELP_DESKTOP_MORE_TAG_B:
  16524. "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  16525. HELP_MOBILE_MORE_TAG_B:
  16526. "Tippen Sie für Informationen über die Funktionen im Raum.",
  16527. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  16528. HELP_DESKTOP_MORE_ZOOM_B:
  16529. "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  16530. HELP_MORE_TOUR_A: "Tour Steuerung",
  16531. HELP_DESKTOP_MORE_TOUR_B:
  16532. "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  16533. HELP_MORE_INSIDE_A: "Innenansicht",
  16534. HELP_DESKTOP_MORE_INSIDE_B:
  16535. "Klicken Sie hier um sich im Raum umzusehen.",
  16536. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  16537. HELP_MORE_VR_A: "VR Modus",
  16538. HELP_DESKTOP_MORE_VR_B:
  16539. "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  16540. HELP_MOBILE_MORE_VR_B:
  16541. "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  16542. HELP_MORE_360_A: "360° Views Ansicht ",
  16543. HELP_DESKTOP_MORE_360_B:
  16544. "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  16545. HELP_MOBILE_MORE_360_B:
  16546. "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  16547. HELP_MORE_FULLSCREEN_A: "Vollbild",
  16548. HELP_DESKTOP_MORE_FULLSCREEN_B:
  16549. "Erweitern Sie 3D Showcase im Vollbildmodus.",
  16550. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  16551. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  16552. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  16553. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  16554. WEBVR_LEARN_MORE: "Mehr Infos",
  16555. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  16556. WEBVR_DAYDREAM_VIEW: "Daydream View",
  16557. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  16558. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  16559. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  16560. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  16561. VR_GOOGLE_DAYDREAM: "Google Daydream",
  16562. VR_APP: "port VR App",
  16563. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  16564. VR_COMPATIBLE_ANDROID_LONG:
  16565. "Kompatibles Android Gerät mit Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  16566. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  16567. VR_APP_FOR_ANDROID: "port VR app für Android",
  16568. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  16569. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  16570. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  16571. VR_PREVIOUS_CAPS: "ZURÜCK",
  16572. VR_NEXT_CAPS: "WEITER",
  16573. VR_GOT_IT_CAPS: "VERSTANDEN",
  16574. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  16575. VR_SHOW_UNSUPPORTED:
  16576. "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  16577. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  16578. VR_SHOW_IOS_2:
  16579. "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  16580. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  16581. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  16582. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  16583. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  16584. VR_COMPATIBLE_IPHONES_1: "iPhones",
  16585. VR_COMPATIBLE_IPHONES_2:
  16586. "iPhone 5s oder neuer, mit iOS 9.1 und später",
  16587. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  16588. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  16589. VR_ANDROID_DETAIL:
  16590. "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  16591. VR_ANDROID_DVICES: "Android Geräte",
  16592. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  16593. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  16594. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  16595. VR_DOWNLOAD_HERE: "Hier runterladen",
  16596. VR_REQUIRE_HEADSET:
  16597. "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  16598. VR_REDIRECT_TO_STORE:
  16599. "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  16600. VR_IMPROPER_EMBED:
  16601. "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  16602. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  16603. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  16604. SHARE_TO: "Teilen auf",
  16605. SHARE_LINK: "Direkter Link",
  16606. SHARE_EXPLORE: "Umsehen",
  16607. SHARE_AT: "auf",
  16608. SHARE_WITH: "mit",
  16609. SHARE_3D: "in 3D",
  16610. SHARE_COPIED: "Kopiert!",
  16611. ERROR_BROWSER_SOLUTION:
  16612. "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  16613. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  16614. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  16615. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  16616. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  16617. ERROR_GENERIC_ACTIONS_2:
  16618. "Installieren Sie einen unterstützten Browser",
  16619. ERROR_GENERIC_ACTIONS_3: " oder ",
  16620. ERROR_GENERIC_ACTIONS_4:
  16621. "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  16622. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  16623. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  16624. ERROR_WEBGL_IOS_SOLUTION:
  16625. "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  16626. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  16627. ERROR_WEBGL_IOS_ACTIONS_2:
  16628. "Einstellungen > Allgemein > Softwareaktualisierung",
  16629. ERROR_WEBGL_SAFARI_PROBLEM:
  16630. "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  16631. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  16632. ERROR_WEBGL_SAFARI_ACTIONS_2:
  16633. "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  16634. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  16635. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  16636. ERROR_MISSING_URLS_PROBLEM:
  16637. "Huch, es gibt keine Panoramen für dieses Modell .",
  16638. ERROR_MISSING_URLS_EXPLANATION:
  16639. "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  16640. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  16641. ERROR_LOADING_FAILED_ACTIONS_1:
  16642. "Wenn das Problem weiterhin besteht, ",
  16643. ERROR_LOADING_FAILED_ACTIONS_2:
  16644. "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  16645. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  16646. ERROR_MAINTENANCE_SOLUTION:
  16647. "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  16648. LINK_TO_LOCATION: "Link zu",
  16649. MENU_COPY: "Kopieren",
  16650. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  16651. ROTATE: "Drehen",
  16652. INSIDE: "Drinnen",
  16653. MOVE: "Bewegen",
  16654. ZOOM: "Vergrößern",
  16655. };
  16656. },
  16657. {},
  16658. ],
  16659. 111: [
  16660. function (e, t, i) {
  16661. "use strict";
  16662. t.exports = {
  16663. PAGE_TITLE: "",
  16664. LOADING: "Loading",
  16665. PRESENTED_BY_CAPS: "PRESENTED BY",
  16666. POWERED_BY: "powered by ",
  16667. POWERED_BY_CAPS: "POWERED BY",
  16668. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  16669. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  16670. PRESENTED_BY: "Presented by ",
  16671. MORE: "More ",
  16672. LESS: "Less ",
  16673. TAG_CONTENT: "tag™ Content",
  16674. SHOW: "Show",
  16675. HIDE: "Hide",
  16676. DOLLHOUSE: "Dollhouse",
  16677. FLOOR_PLAN: "Floor plan",
  16678. OPEN_HIGHLIGHTS: "Open Highlights",
  16679. CLOSE_HIGHLIGHTS: "Close",
  16680. PREVIOUS: "Previous",
  16681. PLAY: "Play",
  16682. PAUSE: "Pause",
  16683. NEXT: "Next",
  16684. EXPLORE_3D_SPACE: "Explore 3D Space",
  16685. VIEW_DOLLHOUSE: "View dollhouse",
  16686. SOCIAL_SHARING: "Share this Space",
  16687. VIEW_IN_VR: "View in VR",
  16688. VIEW_FULLSCREEN: "全屏",
  16689. EXIT_FULLSCREEN: "退出全屏",
  16690. ZOOM_IN: "Zoom in",
  16691. ZOOM_OUT: "Zoom out",
  16692. FLOOR_NAME: "Floor ",
  16693. FLOOR_ALL: "全部",
  16694. TERMS: "Terms",
  16695. PORT_TERMS: "port terms",
  16696. TERMS_OF_USE: "Terms of Use",
  16697. TERMS_TEXT_FILE: "terms-en-US.html",
  16698. CLOSE_TERMS: "Close",
  16699. TERMS_FAIL:
  16700. "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  16701. HELP: "Help",
  16702. HELP_NAVIGATION_TAB: "Navigation",
  16703. HELP_MORE_HELP_TAB: "More Help",
  16704. CLOSE: "Close",
  16705. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  16706. HELP_DESKTOP_PANORAMA_2A:
  16707. "Click on the rings throughout the space to move around.",
  16708. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  16709. HELP_DESKTOP_PANORAMA_1B:
  16710. "Or, use the arrow keys to turn left and right.",
  16711. HELP_DESKTOP_PANORAMA_2B:
  16712. "Or, use the arrow keys to move forward and back.",
  16713. HELP_DESKTOP_PANORAMA_3B:
  16714. "Or, use the plus and minus keys to zoom in and out.",
  16715. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  16716. HELP_DESKTOP_360_2B:
  16717. "Or, press the number 1 key to enter Inside View.",
  16718. HELP_DESKTOP_DOLLHOUSE_1A:
  16719. "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  16720. HELP_DESKTOP_DOLLHOUSE_2A:
  16721. "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  16722. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  16723. HELP_DESKTOP_DOLLHOUSE_1B:
  16724. "Or, use the arrow keys to rotate the Dollhouse.",
  16725. HELP_DESKTOP_FLOORPLAN_1A:
  16726. "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  16727. HELP_DESKTOP_FLOORPLAN_2A:
  16728. "Right click and drag left or right to rotate the Floorplan.",
  16729. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  16730. HELP_DESKTOP_FLOORPLAN_2B:
  16731. "Or, use the arrow keys to rotate left or right.",
  16732. HELP_DESKTOP_FLOORPLAN_3B:
  16733. "Or, use the arrow keys to zoom in and out.",
  16734. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  16735. HELP_MOBILE_PANORAMA_2:
  16736. "Tap on the rings throughout the Space to move around.",
  16737. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  16738. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  16739. HELP_MOBILE_DOLLHOUSE_1:
  16740. "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  16741. HELP_MOBILE_DOLLHOUSE_2:
  16742. "Touch and drag with two fingers to position the Dollhouse.",
  16743. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  16744. HELP_MOBILE_FLOORPLAN_2:
  16745. "Touch and drag with two fingers to rotate the Floorplan.",
  16746. HELP_MORE_HLR_A: "Highlight Reel",
  16747. HELP_DESKTOP_MORE_HLR_B:
  16748. "Open to navigate through the Space using thumbnail images.",
  16749. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  16750. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  16751. "Click to view and rotate a top-down view of the entire Space in 3D.",
  16752. HELP_MOBILE_MORE_DOLLHOUSE_B:
  16753. "Tap to view and rotate a top-down view of the entire Space in 3D.",
  16754. HELP_MORE_FLOORS_A: "Floor Selector",
  16755. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  16756. HELP_MORE_TAG_A: "tag™ Posts",
  16757. HELP_DESKTOP_MORE_TAG_B:
  16758. "Click or hover over for information about features in the Space.",
  16759. HELP_MOBILE_MORE_TAG_B:
  16760. "Tap for information about features in the Space.",
  16761. HELP_MORE_ZOOM_A: "Zoom Controls",
  16762. HELP_DESKTOP_MORE_ZOOM_B:
  16763. "Use these controls to zoom in and out or use the scroll wheel.",
  16764. HELP_MORE_TOUR_A: "Tour Controls",
  16765. HELP_DESKTOP_MORE_TOUR_B:
  16766. "Play, pause, and navigate forward and backward through a Guided Tour.",
  16767. HELP_MORE_INSIDE_A: "Inside View",
  16768. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  16769. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  16770. HELP_MORE_VR_A: "VR Mode",
  16771. HELP_DESKTOP_MORE_VR_B:
  16772. "Click to launch the Space in virtual reality.",
  16773. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  16774. HELP_MORE_360_A: "360° Views",
  16775. HELP_DESKTOP_MORE_360_B:
  16776. "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  16777. HELP_MOBILE_MORE_360_B:
  16778. "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  16779. HELP_MORE_FULLSCREEN_A: "Full screen",
  16780. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  16781. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  16782. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  16783. WEBVR_FOR_DAYDREAM: "For Daydream View",
  16784. WEBVR_ENTER_WEBVR: "ENTER VR",
  16785. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  16786. WEBVR_LEARN_MORE: "Learn more",
  16787. WEBVR_VIEW_SPACE: "View Space in VR",
  16788. WEBVR_DAYDREAM_VIEW: "Daydream View",
  16789. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  16790. VR_VIEW_SPACE: "View Space in Virtual Reality",
  16791. VR_LEARN_MORE_CAPS: "LEARN MORE",
  16792. VR_PREVIOUS_CAPS: "PREVIOUS",
  16793. VR_NEXT_CAPS: "NEXT",
  16794. VR_GOT_IT_CAPS: "GOT IT",
  16795. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  16796. VR_SHOW_UNSUPPORTED:
  16797. "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  16798. VR_SHOW_IOS_1: "Tap to view the space in VR",
  16799. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  16800. VR_WHAT_YOU_NEED: "What You'll Need For...",
  16801. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  16802. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  16803. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  16804. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  16805. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  16806. VR_GOOGLE_DAYDREAM: "Google Daydream",
  16807. VR_APP: "port VR App",
  16808. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  16809. VR_COMPATIBLE_IPHONES_1: "iPhones",
  16810. VR_COMPATIBLE_IPHONES_2:
  16811. "iPhone 5s and newer, running iOS 9.1 and higher",
  16812. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  16813. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  16814. VR_COMPATIBLE_ANDROID_LONG:
  16815. 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  16816. VR_ANDROID_DETAIL:
  16817. 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  16818. VR_ANDROID_DVICES: "Android Devices",
  16819. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  16820. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  16821. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  16822. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  16823. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  16824. VR_APP_OPEN: "Open with the port VR app instead",
  16825. VR_DOWNLOAD_HERE: "Download here",
  16826. VR_REQUIRE_HEADSET:
  16827. "Requires a VR headset and port VR app for Android to be installed",
  16828. VR_REDIRECT_TO_STORE:
  16829. "If app is not installed, you will be redirected to the app store.",
  16830. VR_IMPROPER_EMBED:
  16831. "The port Space is not embedded properly to support VR in your web browser.",
  16832. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  16833. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  16834. SHARE_TO: "Share to",
  16835. SHARE_LINK: "Direct Link",
  16836. SHARE_EXPLORE: "Explore ",
  16837. SHARE_AT: "at",
  16838. SHARE_WITH: "with",
  16839. SHARE_3D: " in 3D",
  16840. SHARE_COPIED: "Copied!",
  16841. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  16842. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  16843. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  16844. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  16845. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  16846. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  16847. ERROR_GENERIC_ACTIONS_3: " or ",
  16848. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  16849. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  16850. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  16851. ERROR_WEBGL_IOS_SOLUTION:
  16852. "Upgrade to iOS 8 or higher to explore in 3D.",
  16853. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  16854. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  16855. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  16856. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  16857. ERROR_WEBGL_SAFARI_ACTIONS_2:
  16858. "Preferences > Advanced > Show Develop menu",
  16859. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  16860. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  16861. ERROR_MISSING_URLS_PROBLEM:
  16862. "Oops, there are no panoramas for this model.",
  16863. ERROR_MISSING_URLS_EXPLANATION:
  16864. "This is an older model. The website owner may have a new model on the way.",
  16865. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  16866. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  16867. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  16868. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  16869. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  16870. LINK_TO_LOCATION: "Link to location",
  16871. MENU_COPY: "Copy",
  16872. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  16873. ROTATE: "Rotate",
  16874. INSIDE: "Inside",
  16875. MOVE: "Move",
  16876. ZOOM: "Zoom",
  16877. };
  16878. },
  16879. {},
  16880. ],
  16881. 112: [
  16882. function (e, t, i) {
  16883. "use strict";
  16884. t.exports = {
  16885. PAGE_TITLE: "",
  16886. LOADING: "Cargando",
  16887. PRESENTED_BY_CAPS: "PRESENTADO POR",
  16888. POWERED_BY: "potenciando por ",
  16889. POWERED_BY_CAPS: "POTENCIADO POR ",
  16890. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  16891. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  16892. PRESENTED_BY: "Presentado por ",
  16893. MORE: "Más ",
  16894. LESS: "Menos ",
  16895. TAG_CONTENT: "Contenido de tag™",
  16896. SHOW: "Mostrar",
  16897. HIDE: "Ocultar",
  16898. DOLLHOUSE: "Dollhouse",
  16899. FLOOR_PLAN: "Planos",
  16900. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  16901. CLOSE_HIGHLIGHTS: "Cerrar",
  16902. PREVIOUS: "Anterior",
  16903. PLAY: "Play",
  16904. PAUSE: "Pausa",
  16905. NEXT: "Siguiente",
  16906. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  16907. VIEW_DOLLHOUSE: "Ver dollhouse",
  16908. SOCIAL_SHARING: "Compartir este espacio",
  16909. VIEW_IN_VR: "Ver en realidad virtual",
  16910. VIEW_FULLSCREEN: "Ver en pantalla completa",
  16911. EXIT_FULLSCREEN: "Salir de pantalla completa",
  16912. ZOOM_IN: "Acercar",
  16913. ZOOM_OUT: "Alejar",
  16914. FLOOR_NAME: "Piso ",
  16915. FLOOR_ALL: "Todas",
  16916. TERMS: "Condiciones",
  16917. PORT_TERMS: "port términos de uso",
  16918. TERMS_OF_USE: "Términos de uso",
  16919. TERMS_TEXT_FILE: "terms-es-MX.html",
  16920. CLOSE_TERMS: "Cerrar",
  16921. TERMS_FAIL:
  16922. "No se han podido obtener las condiciones. Asegúrese de tener una conexión a Internet para ver los términos de uso.",
  16923. HELP: "Ayuda",
  16924. HELP_NAVIGATION_TAB: "Navegación",
  16925. HELP_MORE_HELP_TAB: "Más Ayuda",
  16926. CLOSE: "Cerrar",
  16927. HELP_DESKTOP_PANORAMA_1A:
  16928. "Haga clic y arrastre para mirar alrededor del espacio.",
  16929. HELP_DESKTOP_PANORAMA_2A:
  16930. "Haga clic en los aros a lo largo del espacio para moverse.",
  16931. HELP_DESKTOP_PANORAMA_3A:
  16932. "Use la rueda de desplazamiento para acercar o alejar.",
  16933. HELP_DESKTOP_PANORAMA_1B:
  16934. "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  16935. HELP_DESKTOP_PANORAMA_2B:
  16936. "O use las teclas de dirección para adelantar o retroceder.",
  16937. HELP_DESKTOP_PANORAMA_3B:
  16938. "O use la tecla más para acercar y la tecla menos para alejar.",
  16939. HELP_DESKTOP_360_2A:
  16940. "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  16941. HELP_DESKTOP_360_2B:
  16942. "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  16943. HELP_DESKTOP_DOLLHOUSE_1A:
  16944. "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  16945. HELP_DESKTOP_DOLLHOUSE_2A:
  16946. "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  16947. HELP_DESKTOP_DOLLHOUSE_3A:
  16948. "Use la rueda de desplazamiento para acercar o alejar.",
  16949. HELP_DESKTOP_DOLLHOUSE_1B:
  16950. "O use las teclas de dirección para girar la Dollhouse.",
  16951. HELP_DESKTOP_FLOORPLAN_1A:
  16952. "Haga clic con izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición de la planta.",
  16953. HELP_DESKTOP_FLOORPLAN_2A:
  16954. "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  16955. HELP_DESKTOP_FLOORPLAN_3A:
  16956. "Use la rueda de desplazamiento para acercar o alejar.",
  16957. HELP_DESKTOP_FLOORPLAN_2B:
  16958. "O use las teclas para girar hacia la izquierda o derecha.",
  16959. HELP_DESKTOP_FLOORPLAN_3B:
  16960. "O use las teclas de dirección para acercar o alejar.",
  16961. HELP_MOBILE_PANORAMA_1:
  16962. "Toque y arrastre para mirar alrededor del espacio.",
  16963. HELP_MOBILE_PANORAMA_2:
  16964. "Toque en los aros a lo largo del espacio para moverse.",
  16965. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  16966. HELP_MOBILE_360_2:
  16967. "Toque el ícono Vista Interior para entrar en el Espacio.",
  16968. HELP_MOBILE_DOLLHOUSE_1:
  16969. "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  16970. HELP_MOBILE_DOLLHOUSE_2:
  16971. "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  16972. HELP_MOBILE_FLOORPLAN_1:
  16973. "Toque y arrastre para cambiar la posición de la planta.",
  16974. HELP_MOBILE_FLOORPLAN_2:
  16975. "Toque y arrastre con dos dedos para girar la planta.",
  16976. HELP_MORE_HLR_A: "Galería destacada",
  16977. HELP_DESKTOP_MORE_HLR_B:
  16978. "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  16979. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  16980. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  16981. "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  16982. HELP_MOBILE_MORE_DOLLHOUSE_B:
  16983. "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  16984. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  16985. HELP_DESKTOP_MORE_FLOORS_B:
  16986. "Cambie de una planta a otra en el espacio.",
  16987. HELP_MORE_TAG_A: "tag™ Posts",
  16988. HELP_DESKTOP_MORE_TAG_B:
  16989. "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  16990. HELP_MOBILE_MORE_TAG_B:
  16991. "Toque para obtener más información acerca de las características del espacio.",
  16992. HELP_MORE_ZOOM_A: "Controles de zoom",
  16993. HELP_DESKTOP_MORE_ZOOM_B:
  16994. "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  16995. HELP_MORE_TOUR_A: "Controles de recorrido",
  16996. HELP_DESKTOP_MORE_TOUR_B:
  16997. "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  16998. HELP_MORE_INSIDE_A: "Vista interior",
  16999. HELP_DESKTOP_MORE_INSIDE_B:
  17000. "Haga clic para explorar el interior del espacio.",
  17001. HELP_MOBILE_MORE_INSIDE_B:
  17002. "Toque para explorar el interior del espacio.",
  17003. HELP_MORE_VR_A: "Modo de realidad virtual",
  17004. HELP_DESKTOP_MORE_VR_B:
  17005. "Toque para ver el espacio en realidad virtual.",
  17006. HELP_MOBILE_MORE_VR_B:
  17007. "Toque para ver el espacio en realidad virtual.",
  17008. HELP_MORE_360_A: "360° Views",
  17009. HELP_DESKTOP_MORE_360_B:
  17010. "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  17011. HELP_MOBILE_MORE_360_B:
  17012. "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  17013. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  17014. HELP_DESKTOP_MORE_FULLSCREEN_B:
  17015. "Expanda el escenario 3D para verlo en pantalla completa.",
  17016. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  17017. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  17018. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  17019. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  17020. WEBVR_LEARN_MORE: "Más información",
  17021. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  17022. WEBVR_DAYDREAM_VIEW: "Daydream View",
  17023. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  17024. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  17025. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  17026. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  17027. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  17028. VR_APP: "port VR App",
  17029. VR_COMPATIBLE_ANDROID_LONG:
  17030. 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  17031. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  17032. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  17033. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  17034. VR_LEARN_MORE_CAPS: "SABER MÁS",
  17035. VR_PREVIOUS_CAPS: "ANTERIOR",
  17036. VR_NEXT_CAPS: "SIGUIENTE",
  17037. VR_GOT_IT_CAPS: "COMPRENDIDO",
  17038. VR_SHOW_SUPPORTED:
  17039. "Pulse para ver el Espacio en realidad virtual con",
  17040. VR_SHOW_UNSUPPORTED:
  17041. "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  17042. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  17043. VR_SHOW_IOS_2:
  17044. "Necesita la aplicación port VR y un iPhone compatible para ver",
  17045. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  17046. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  17047. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  17048. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  17049. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  17050. VR_COMPATIBLE_IPHONES_1: "iPhones",
  17051. VR_COMPATIBLE_IPHONES_2:
  17052. "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  17053. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  17054. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  17055. VR_ANDROID_DETAIL:
  17056. "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  17057. VR_ANDROID_DVICES: "Dispositivos Android",
  17058. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  17059. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  17060. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  17061. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  17062. VR_DOWNLOAD_HERE: "Descargar aquí",
  17063. VR_REQUIRE_HEADSET:
  17064. "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  17065. VR_REDIRECT_TO_STORE:
  17066. "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  17067. VR_IMPROPER_EMBED:
  17068. "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  17069. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  17070. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  17071. SHARE_TO: "Compartir en",
  17072. SHARE_LINK: "Enlace directo",
  17073. SHARE_EXPLORE: "Explorar ",
  17074. SHARE_AT: "en",
  17075. SHARE_WITH: "con",
  17076. SHARE_3D: " en 3D",
  17077. SHARE_COPIED: "¡Copiado!",
  17078. ERROR_BROWSER_SOLUTION:
  17079. "Instale un nuevo navegador para explorar en 3D.",
  17080. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  17081. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  17082. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  17083. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  17084. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  17085. ERROR_GENERIC_ACTIONS_3: " o ",
  17086. ERROR_GENERIC_ACTIONS_4:
  17087. "consulte nuestra guía de solución de problemas",
  17088. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  17089. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  17090. ERROR_WEBGL_IOS_SOLUTION:
  17091. "Actualice a iOS 8 o superior para explorar en 3D.",
  17092. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  17093. ERROR_WEBGL_IOS_ACTIONS_2:
  17094. "Ajustes > General > Actualización de software",
  17095. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  17096. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  17097. ERROR_WEBGL_SAFARI_ACTIONS_2:
  17098. "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  17099. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  17100. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  17101. ERROR_MISSING_URLS_PROBLEM:
  17102. "Vaya, no hay panoramas para este modelo.",
  17103. ERROR_MISSING_URLS_EXPLANATION:
  17104. "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  17105. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  17106. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  17107. ERROR_LOADING_FAILED_ACTIONS_2:
  17108. "consulte nuestra guía de solución de problemas",
  17109. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  17110. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  17111. LINK_TO_LOCATION: "Enlace a la ubicación",
  17112. MENU_COPY: "Copiar",
  17113. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  17114. ROTATE: "Girar",
  17115. INSIDE: "Interior",
  17116. MOVE: "Moverse",
  17117. ZOOM: "Acercar o alejar",
  17118. };
  17119. },
  17120. {},
  17121. ],
  17122. 113: [
  17123. function (e, t, i) {
  17124. "use strict";
  17125. t.exports = {
  17126. PAGE_TITLE: "",
  17127. LOADING: "Chargement",
  17128. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  17129. POWERED_BY: "alimenté par ",
  17130. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  17131. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  17132. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  17133. PRESENTED_BY: "Présenté par ",
  17134. MORE: "Plus ",
  17135. LESS: "Moins ",
  17136. TAG_CONTENT: "Contenu tag™",
  17137. SHOW: "Montrer",
  17138. HIDE: "Cacher",
  17139. DOLLHOUSE: "Dollhouse",
  17140. FLOOR_PLAN: "Plan de sol",
  17141. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  17142. CLOSE_HIGHLIGHTS: "Fermer",
  17143. PREVIOUS: "Précédent",
  17144. PLAY: "Lecture",
  17145. PAUSE: "Pause",
  17146. NEXT: "Suivant",
  17147. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  17148. VIEW_DOLLHOUSE: "Voir dollhouse",
  17149. SOCIAL_SHARING: "Partager cet espace",
  17150. VIEW_IN_VR: "Voir en VR",
  17151. VIEW_FULLSCREEN: "Plein écran",
  17152. EXIT_FULLSCREEN: "Fermer plein écran",
  17153. ZOOM_IN: "Zoom avant",
  17154. ZOOM_OUT: "Zoom arrière",
  17155. FLOOR_NAME: "Étage ",
  17156. FLOOR_ALL: "Tous",
  17157. TERMS: "Mentions légales",
  17158. PORT_TERMS: "port mentions légales",
  17159. TERMS_OF_USE: "Conditions d'utilisation",
  17160. TERMS_TEXT_FILE: "terms-fr-FR.html",
  17161. CLOSE_TERMS: "Fermer",
  17162. TERMS_FAIL:
  17163. "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  17164. HELP: "Aide",
  17165. HELP_NAVIGATION_TAB: "Navigation",
  17166. HELP_MORE_HELP_TAB: "Aide",
  17167. CLOSE: "Fermer",
  17168. HELP_DESKTOP_PANORAMA_1A:
  17169. "Cliquez et faites glisser pour regarder autour de l’espace.",
  17170. HELP_DESKTOP_PANORAMA_2A:
  17171. "Cliquez sur les anneaux pour vous déplacer.",
  17172. HELP_DESKTOP_PANORAMA_3A:
  17173. "Utilisez la molette de votre souris pour zoomer.",
  17174. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  17175. HELP_DESKTOP_PANORAMA_2B:
  17176. "Ou utilisez les touches pour avancer et reculer.",
  17177. HELP_DESKTOP_PANORAMA_3B:
  17178. "Ou utilisez les touches plus et moins pour zoomer.",
  17179. HELP_DESKTOP_360_2A:
  17180. "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  17181. HELP_DESKTOP_360_2B:
  17182. "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  17183. HELP_DESKTOP_DOLLHOUSE_1A:
  17184. "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  17185. HELP_DESKTOP_DOLLHOUSE_2A:
  17186. "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  17187. HELP_DESKTOP_DOLLHOUSE_3A:
  17188. "Utilisez la molette de votre souris pour zoomer.",
  17189. HELP_DESKTOP_DOLLHOUSE_1B:
  17190. "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  17191. HELP_DESKTOP_FLOORPLAN_1A:
  17192. "Faites un clic droit pour changer la position du plan sur l’écran.",
  17193. HELP_DESKTOP_FLOORPLAN_2A:
  17194. "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  17195. HELP_DESKTOP_FLOORPLAN_3A:
  17196. "Utilisez la molette de votre souris pour zoomer.",
  17197. HELP_DESKTOP_FLOORPLAN_2B:
  17198. "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  17199. HELP_DESKTOP_FLOORPLAN_3B:
  17200. "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  17201. HELP_MOBILE_PANORAMA_1:
  17202. "Touchez et faites glisser pour regarder autour de l’espace.",
  17203. HELP_MOBILE_PANORAMA_2:
  17204. "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  17205. HELP_MOBILE_3:
  17206. "Utilisez un geste de pincement pour zoomer avant/arrière.",
  17207. HELP_MOBILE_360_2:
  17208. "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  17209. HELP_MOBILE_DOLLHOUSE_1:
  17210. "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  17211. HELP_MOBILE_DOLLHOUSE_2:
  17212. "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  17213. HELP_MOBILE_FLOORPLAN_1:
  17214. "Touchez et faites glisser pour positionner le plan.",
  17215. HELP_MOBILE_FLOORPLAN_2:
  17216. "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  17217. HELP_MORE_HLR_A: "Carrousel",
  17218. HELP_DESKTOP_MORE_HLR_B:
  17219. "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  17220. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  17221. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  17222. "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  17223. HELP_MOBILE_MORE_DOLLHOUSE_B:
  17224. "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  17225. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  17226. HELP_DESKTOP_MORE_FLOORS_B:
  17227. "Basculer entre les étages dans l’espace.",
  17228. HELP_MORE_TAG_A: "tag™ Posts",
  17229. HELP_DESKTOP_MORE_TAG_B:
  17230. "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  17231. HELP_MOBILE_MORE_TAG_B:
  17232. "Tapez pour obtenir des informations sur l’espace.",
  17233. HELP_MORE_ZOOM_A: "Commandes de zoom",
  17234. HELP_DESKTOP_MORE_ZOOM_B:
  17235. "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  17236. HELP_MORE_TOUR_A: "Commandes de la visite",
  17237. HELP_DESKTOP_MORE_TOUR_B:
  17238. "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  17239. HELP_MORE_INSIDE_A: "Vue intérieure",
  17240. HELP_DESKTOP_MORE_INSIDE_B:
  17241. "Cliquez pour explorer l’intérieur de l’espace.",
  17242. HELP_MOBILE_MORE_INSIDE_B:
  17243. "Tapez pour explorer l’intérieur de l’espace.",
  17244. HELP_MORE_VR_A: "Mode RV",
  17245. HELP_DESKTOP_MORE_VR_B:
  17246. "Cliquez pour lancer l’espace en réalité virtuelle.",
  17247. HELP_MOBILE_MORE_VR_B:
  17248. "Tapez pour lancer l’espace en réalité virtuelle.",
  17249. HELP_MORE_360_A: "Vues 360°",
  17250. HELP_DESKTOP_MORE_360_B:
  17251. "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  17252. HELP_MOBILE_MORE_360_B:
  17253. "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  17254. HELP_MORE_FULLSCREEN_A: "Plein écran",
  17255. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  17256. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  17257. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  17258. WEBVR_ENTER_WEBVR: "ENTRER VR",
  17259. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  17260. WEBVR_LEARN_MORE: "En savoir plus",
  17261. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  17262. WEBVR_DAYDREAM_VIEW: "Daydream View",
  17263. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  17264. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  17265. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  17266. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  17267. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  17268. VR_NEXT_CAPS: "SUIVANT",
  17269. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  17270. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  17271. VR_SHOW_UNSUPPORTED:
  17272. "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  17273. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  17274. VR_SHOW_IOS_2:
  17275. "Nécessite l’application port VR et un iPhone compatible pour voir",
  17276. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  17277. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  17278. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  17279. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  17280. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  17281. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  17282. VR_GOOGLE_DAYDREAM: "Google Daydream",
  17283. VR_APP: "port VR App",
  17284. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  17285. VR_COMPATIBLE_IPHONES_1: "iPhones",
  17286. VR_COMPATIBLE_IPHONES_2:
  17287. "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  17288. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  17289. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  17290. VR_COMPATIBLE_ANDROID_LONG:
  17291. "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",
  17292. VR_ANDROID_DETAIL:
  17293. 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  17294. VR_ANDROID_DVICES: "Appareils Android",
  17295. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  17296. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  17297. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  17298. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  17299. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  17300. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  17301. VR_DOWNLOAD_HERE: "Télécharger ici",
  17302. VR_REQUIRE_HEADSET:
  17303. "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  17304. VR_REDIRECT_TO_STORE:
  17305. "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  17306. VR_IMPROPER_EMBED:
  17307. "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  17308. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  17309. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  17310. SHARE_TO: "Partager sur",
  17311. SHARE_LINK: "Lien direct",
  17312. SHARE_EXPLORE: "Explorer ",
  17313. SHARE_AT: "à",
  17314. SHARE_WITH: "avec",
  17315. SHARE_3D: " en 3D",
  17316. SHARE_COPIED: "Copié!",
  17317. ERROR_BROWSER_SOLUTION:
  17318. "Installer un nouveau navigateur pour explorer en 3D.",
  17319. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  17320. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  17321. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  17322. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  17323. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  17324. ERROR_GENERIC_ACTIONS_3: " ou ",
  17325. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  17326. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  17327. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  17328. ERROR_WEBGL_IOS_SOLUTION:
  17329. "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  17330. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  17331. ERROR_WEBGL_IOS_ACTIONS_2:
  17332. "Paramètres > Général > Mise à jour Software",
  17333. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  17334. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  17335. ERROR_WEBGL_SAFARI_ACTIONS_2:
  17336. "Préferences > Avancés > Voir menu développeur",
  17337. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  17338. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  17339. ERROR_MISSING_URLS_PROBLEM:
  17340. "Il n'y a pas de panoromas pour ce modèle.",
  17341. ERROR_MISSING_URLS_EXPLANATION:
  17342. "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  17343. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  17344. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  17345. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  17346. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  17347. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  17348. LINK_TO_LOCATION: "Lien vers l'emplacement",
  17349. MENU_COPY: "Copie",
  17350. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  17351. ROTATE: "Faire pivoter",
  17352. INSIDE: "Intérieure",
  17353. MOVE: "Se déplacer",
  17354. ZOOM: "Zoom",
  17355. };
  17356. },
  17357. {},
  17358. ],
  17359. 114: [
  17360. function (e, t, i) {
  17361. "use strict";
  17362. t.exports = {
  17363. PAGE_TITLE: "",
  17364. LOADING: "読み込み中",
  17365. PRESENTED_BY_CAPS: "PRESENTED BY",
  17366. POWERED_BY: "powered by",
  17367. POWERED_BY_CAPS: "POWERED BY",
  17368. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  17369. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  17370. PRESENTED_BY: "Presented by ",
  17371. MORE: "全て表示 ",
  17372. LESS: "閉じる ",
  17373. TAG_CONTENT: "tag™コンテンツ ",
  17374. SHOW: "表示",
  17375. HIDE: "非表示",
  17376. DOLLHOUSE: "ドールハウス",
  17377. FLOOR_PLAN: "フロアプラン",
  17378. OPEN_HIGHLIGHTS: "ハイライトを開く",
  17379. CLOSE_HIGHLIGHTS: "閉じる",
  17380. PREVIOUS: "前へ",
  17381. PLAY: "再生",
  17382. PAUSE: "一時停止",
  17383. NEXT: "次へ",
  17384. EXPLORE_3D_SPACE: "3DSpaceの探索",
  17385. VIEW_DOLLHOUSE: "ドールハウスの表示",
  17386. SOCIAL_SHARING: "このSpaceを共有する",
  17387. VIEW_IN_VR: "VRで表示",
  17388. VIEW_FULLSCREEN: "フルスクリーン表示",
  17389. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  17390. ZOOM_IN: "ズームイン",
  17391. ZOOM_OUT: "ズームアウト",
  17392. FLOOR_NAME: "フロア ",
  17393. FLOOR_ALL: "すべて",
  17394. TERMS: "規約",
  17395. PORT_TERMS: "port規約",
  17396. TERMS_OF_USE: "利用規約",
  17397. CLOSE_TERMS: "閉じる",
  17398. TERMS_TEXT_FILE: "terms-jp-JP.html",
  17399. TERMS_FAIL:
  17400. "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  17401. WEBVR_FOR_DAYDREAM: "Daydream View用",
  17402. WEBVR_ENTER_WEBVR: "VRに入る",
  17403. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  17404. WEBVR_LEARN_MORE: "もっと詳しく",
  17405. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  17406. WEBVR_DAYDREAM_VIEW: "Daydream View",
  17407. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  17408. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  17409. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  17410. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  17411. VR_LEARN_MORE_CAPS: "もっと詳しく",
  17412. VR_PREVIOUS_CAPS: "前へ",
  17413. VR_NEXT_CAPS: "次へ",
  17414. VR_GOT_IT_CAPS: "了解",
  17415. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  17416. VR_SHOW_UNSUPPORTED:
  17417. "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  17418. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  17419. VR_SHOW_IOS_2:
  17420. "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  17421. VR_WHAT_YOU_NEED: "必要なもの",
  17422. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  17423. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  17424. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  17425. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  17426. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  17427. VR_GOOGLE_DAYDREAM: "Google Daydream",
  17428. VR_APP: "port VRアプリ",
  17429. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  17430. VR_COMPATIBLE_IPHONES_1: "iPhone",
  17431. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  17432. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  17433. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  17434. VR_COMPATIBLE_ANDROID_LONG:
  17435. "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  17436. VR_ANDROID_DETAIL:
  17437. "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  17438. VR_ANDROID_DVICES: "Androidデバイス",
  17439. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  17440. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  17441. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  17442. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  17443. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  17444. VR_APP_OPEN: "port VRアプリで開く",
  17445. VR_DOWNLOAD_HERE: "ここからダウンロード",
  17446. VR_REQUIRE_HEADSET:
  17447. "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  17448. VR_REDIRECT_TO_STORE:
  17449. "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  17450. VR_IMPROPER_EMBED:
  17451. "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  17452. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  17453. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  17454. SHARE_TO: "共有先",
  17455. SHARE_LINK: "ダイレクトリンク",
  17456. SHARE_EXPLORE: "探索",
  17457. SHARE_AT: "場所",
  17458. SHARE_WITH: "使用アプリ",
  17459. SHARE_3D: "3Dで",
  17460. SHARE_COPIED: "コピーされました!",
  17461. ERROR_BROWSER_SOLUTION:
  17462. "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  17463. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  17464. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  17465. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  17466. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  17467. ERROR_GENERIC_ACTIONS_2:
  17468. "サポートされているブラウザをインストールしてください",
  17469. ERROR_GENERIC_ACTIONS_3: "または",
  17470. ERROR_GENERIC_ACTIONS_4:
  17471. "トラブルシューティングガイドを参照してください",
  17472. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  17473. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  17474. ERROR_WEBGL_IOS_SOLUTION:
  17475. "3D探索するには、iOS 8以降にアップグレードしてください。",
  17476. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  17477. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  17478. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  17479. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  17480. ERROR_WEBGL_SAFARI_ACTIONS_2:
  17481. "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  17482. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  17483. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  17484. ERROR_MISSING_URLS_PROBLEM:
  17485. "このモデルではパノラマを使用できません。",
  17486. ERROR_MISSING_URLS_EXPLANATION:
  17487. "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  17488. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  17489. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  17490. ERROR_LOADING_FAILED_ACTIONS_2:
  17491. "トラブルシューティングガイドを参照してください",
  17492. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  17493. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  17494. LINK_TO_LOCATION: "ロケーションへのリンク",
  17495. MENU_COPY: "コピー",
  17496. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  17497. ROTATE: "回転",
  17498. MOVE: "移動",
  17499. INSIDE: "内側",
  17500. ZOOM: "ズーム",
  17501. HELP: "ヘルプ",
  17502. HELP_NAVIGATION_TAB: "ナビゲーション",
  17503. HELP_MORE_HELP_TAB: "その他のヘルプ",
  17504. HELP_DESKTOP_PANORAMA_1A:
  17505. "Spaceを見回すには、クリックしてドラッグします。",
  17506. HELP_DESKTOP_PANORAMA_2A:
  17507. "移動するには、Space全体にあるリングをクリックします。",
  17508. HELP_DESKTOP_PANORAMA_3A:
  17509. "スクロールホイールを使用してズームイン、ズームアウトします。",
  17510. HELP_DESKTOP_PANORAMA_1B:
  17511. "または、矢印キーを使用して左右に向きを変えます。",
  17512. HELP_DESKTOP_PANORAMA_2B:
  17513. "または、矢印キーを使用して前後に向きを変えます。",
  17514. HELP_DESKTOP_PANORAMA_3B:
  17515. "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  17516. HELP_DESKTOP_360_2A:
  17517. "内側ビューアイコンをクリックしてSpaceに入ります。",
  17518. HELP_DESKTOP_360_2B:
  17519. "または、数字キー1を押して内側ビューに入ります。",
  17520. HELP_DESKTOP_DOLLHOUSE_1A:
  17521. "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  17522. HELP_DESKTOP_DOLLHOUSE_2A:
  17523. "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  17524. HELP_DESKTOP_DOLLHOUSE_3A:
  17525. "スクロールホイールを使用してズームイン、ズームアウトします。",
  17526. HELP_DESKTOP_DOLLHOUSE_1B:
  17527. "または、矢印キーを使用してドールハウスを回転します。",
  17528. HELP_DESKTOP_FLOORPLAN_1A:
  17529. "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  17530. HELP_DESKTOP_FLOORPLAN_2A:
  17531. "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  17532. HELP_DESKTOP_FLOORPLAN_3A:
  17533. "スクロールホイールを使用してズームイン、ズームアウトします。",
  17534. HELP_DESKTOP_FLOORPLAN_2B:
  17535. "または、矢印キーを使用して左右に回転します。",
  17536. HELP_DESKTOP_FLOORPLAN_3B:
  17537. "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  17538. HELP_MOBILE_PANORAMA_1:
  17539. "Spaceを見回すには、タッチしてドラッグします。",
  17540. HELP_MOBILE_PANORAMA_2:
  17541. "移動するには、Space全体にあるリングをタップします。",
  17542. HELP_MOBILE_3:
  17543. "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  17544. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  17545. HELP_MOBILE_DOLLHOUSE_1:
  17546. "タッチして上下左右にドラッグしてドールハウスを回転します。",
  17547. HELP_MOBILE_DOLLHOUSE_2:
  17548. "タッチして、2本指でドラッグしてドールハウスを配置します。",
  17549. HELP_MOBILE_FLOORPLAN_1:
  17550. "タッチ&ドラッグしてフロアプランを配置します。",
  17551. HELP_MOBILE_FLOORPLAN_2:
  17552. "タッチして、2本指でドラッグしてフロアプランを回転します。",
  17553. HELP_MORE_HLR_A: "ハイライト",
  17554. HELP_DESKTOP_MORE_HLR_B:
  17555. "サムネイル画像を使用してSpaceを移動するために開きます。",
  17556. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  17557. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  17558. "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  17559. HELP_MOBILE_MORE_DOLLHOUSE_B:
  17560. "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  17561. HELP_MORE_FLOORS_A: "フロアセレクター",
  17562. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  17563. HELP_MORE_TAG_A: "tag™ Posts",
  17564. HELP_DESKTOP_MORE_TAG_B:
  17565. "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  17566. HELP_MOBILE_MORE_TAG_B:
  17567. "タップするとSpace内の機能についての説明が表示されます。",
  17568. HELP_MORE_ZOOM_A: "ズームコントロール",
  17569. HELP_DESKTOP_MORE_ZOOM_B:
  17570. "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  17571. HELP_MORE_TOUR_A: "ツアーコントロール",
  17572. HELP_DESKTOP_MORE_TOUR_B:
  17573. "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  17574. HELP_MORE_INSIDE_A: "内側ビュー",
  17575. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  17576. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  17577. HELP_MORE_VR_A: "VRモード",
  17578. HELP_DESKTOP_MORE_VR_B:
  17579. "クリックしてバーチャルリアリティでSpaceを起動します。",
  17580. HELP_MOBILE_MORE_VR_B:
  17581. "タップしてバーチャルリアリティでSpaceを起動します。",
  17582. HELP_MORE_360_A: "360° Views",
  17583. HELP_DESKTOP_MORE_360_B:
  17584. "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  17585. HELP_MOBILE_MORE_360_B:
  17586. "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  17587. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  17588. HELP_DESKTOP_MORE_FULLSCREEN_B:
  17589. "3D Showcaseをフルスクリーン表示にします。",
  17590. CLOSE: "閉じる",
  17591. };
  17592. },
  17593. {},
  17594. ],
  17595. 115: [
  17596. function (e, t, i) {
  17597. "use strict";
  17598. t.exports = {
  17599. PAGE_TITLE: "",
  17600. LOADING: "Загрузка",
  17601. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  17602. POWERED_BY: "разработано на платформе ",
  17603. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  17604. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  17605. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  17606. PRESENTED_BY: "Представлено ",
  17607. MORE: "Больше ",
  17608. LESS: "Меньше ",
  17609. TAG_CONTENT: "tag™ Контент",
  17610. SHOW: "Показать",
  17611. HIDE: "Скрыть",
  17612. DOLLHOUSE: "Dollhouse",
  17613. FLOOR_PLAN: "Планировка",
  17614. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  17615. CLOSE_HIGHLIGHTS: "Закрыть",
  17616. PREVIOUS: "Предыдущий",
  17617. PLAY: "Воспроизвести",
  17618. PAUSE: "Пауза",
  17619. NEXT: "Следующий",
  17620. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  17621. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  17622. SOCIAL_SHARING: "Поделиться этой моделью",
  17623. VIEW_IN_VR: "Посмотреть в VR",
  17624. VIEW_FULLSCREEN: "Полный экран",
  17625. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  17626. ZOOM_IN: "Увеличить",
  17627. ZOOM_OUT: "Уменьшить",
  17628. FLOOR_NAME: "Этаж ",
  17629. FLOOR_ALL: "Все",
  17630. TERMS: "Условия",
  17631. PORT_TERMS: "Правила пользования",
  17632. TERMS_OF_USE: "Условия использования",
  17633. TERMS_TEXT_FILE: "terms-ru-RU.html",
  17634. CLOSE_TERMS: "Закрыть",
  17635. TERMS_FAIL:
  17636. "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  17637. HELP: "Помощь",
  17638. HELP_NAVIGATION_TAB: "Навигация",
  17639. HELP_MORE_HELP_TAB: "Доп. Помощь",
  17640. CLOSE: "Закрыть",
  17641. HELP_DESKTOP_PANORAMA_1A:
  17642. "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  17643. HELP_DESKTOP_PANORAMA_2A:
  17644. "Для передвижения по модели нажимайте на круги .",
  17645. HELP_DESKTOP_PANORAMA_3A:
  17646. "Используйте колесо прокрутки для увеличения и уменьшения.",
  17647. HELP_DESKTOP_PANORAMA_1B:
  17648. "Или используйте клавиши со стрелками для поворота влево и вправо.",
  17649. HELP_DESKTOP_PANORAMA_2B:
  17650. "Или используйте стрелки для перемещения вперед и назад.",
  17651. HELP_DESKTOP_PANORAMA_3B:
  17652. "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  17653. HELP_DESKTOP_360_2A:
  17654. "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  17655. HELP_DESKTOP_360_2B:
  17656. "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  17657. HELP_DESKTOP_DOLLHOUSE_1A:
  17658. "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  17659. HELP_DESKTOP_DOLLHOUSE_2A:
  17660. "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  17661. HELP_DESKTOP_DOLLHOUSE_3A:
  17662. "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  17663. HELP_DESKTOP_DOLLHOUSE_1B:
  17664. "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  17665. HELP_DESKTOP_FLOORPLAN_1A:
  17666. "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  17667. HELP_DESKTOP_FLOORPLAN_2A:
  17668. "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  17669. HELP_DESKTOP_FLOORPLAN_3A:
  17670. "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  17671. HELP_DESKTOP_FLOORPLAN_2B:
  17672. "Или используйте клавиши со стрелками для поворота влево или вправо.",
  17673. HELP_DESKTOP_FLOORPLAN_3B:
  17674. "Или используйте стрелки для увеличения и уменьшения.",
  17675. HELP_MOBILE_PANORAMA_1:
  17676. "Нажмите и перетащите, чтобы осмотреть модель.",
  17677. HELP_MOBILE_PANORAMA_2:
  17678. "Для передвижения по модели нажимайте на круги.",
  17679. HELP_MOBILE_3:
  17680. "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  17681. HELP_MOBILE_360_2:
  17682. "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  17683. HELP_MOBILE_DOLLHOUSE_1:
  17684. "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  17685. HELP_MOBILE_DOLLHOUSE_2:
  17686. "Нажмите и перетащите, чтобы расположить Dollhouse.",
  17687. HELP_MOBILE_FLOORPLAN_1:
  17688. "Нажмите и перетащите, чтобы расположить план здания.",
  17689. HELP_MOBILE_FLOORPLAN_2:
  17690. "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  17691. HELP_MORE_HLR_A: "Фотоколлаж",
  17692. HELP_DESKTOP_MORE_HLR_B:
  17693. "Откройте для перемещения по модели, используя иконки изображений.",
  17694. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  17695. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  17696. "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  17697. HELP_MOBILE_MORE_DOLLHOUSE_B:
  17698. "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  17699. HELP_MORE_FLOORS_A: "Выбор Этажа",
  17700. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  17701. HELP_MORE_TAG_A: "tag™ Posts",
  17702. HELP_DESKTOP_MORE_TAG_B:
  17703. "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  17704. HELP_MOBILE_MORE_TAG_B:
  17705. "Нажмите для получения информации о функциях.",
  17706. HELP_MORE_ZOOM_A: "Масштаб",
  17707. HELP_DESKTOP_MORE_ZOOM_B:
  17708. "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  17709. HELP_MORE_TOUR_A: "Управление Туром",
  17710. HELP_DESKTOP_MORE_TOUR_B:
  17711. "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  17712. HELP_MORE_INSIDE_A: "Вид Изнутри",
  17713. HELP_DESKTOP_MORE_INSIDE_B:
  17714. "Нажмите, чтобы просмотреть модель изнутри.",
  17715. HELP_MOBILE_MORE_INSIDE_B:
  17716. "Нажмите, чтобы просмотреть модель изнутри.",
  17717. HELP_MORE_VR_A: "Режим VR",
  17718. HELP_DESKTOP_MORE_VR_B:
  17719. "Нажмите, чтобы запустить модель в виртуальной реальности.",
  17720. HELP_MOBILE_MORE_VR_B:
  17721. "Нажмите, чтобы запустить модель в виртуальной реальности.",
  17722. HELP_MORE_360_A: "360° Views",
  17723. HELP_DESKTOP_MORE_360_B:
  17724. "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  17725. HELP_MOBILE_MORE_360_B:
  17726. "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  17727. HELP_MORE_FULLSCREEN_A: "Полный экран",
  17728. HELP_DESKTOP_MORE_FULLSCREEN_B:
  17729. "Развернуть 3D Showcase во весь экран.",
  17730. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  17731. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  17732. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  17733. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  17734. WEBVR_LEARN_MORE: "Узнать больше",
  17735. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  17736. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  17737. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  17738. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  17739. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  17740. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  17741. VR_GOOGLE_DAYDREAM: "Google Daydream",
  17742. VR_APP: "port VR App",
  17743. VR_APP_OPEN: "Или открыть через приложение port VR",
  17744. VR_COMPATIBLE_ANDROID_LONG:
  17745. 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  17746. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  17747. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  17748. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  17749. VR_VIEW_SPACE: "Запустить модель в VR",
  17750. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  17751. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  17752. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  17753. VR_GOT_IT_CAPS: "ЯСНО",
  17754. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  17755. VR_SHOW_UNSUPPORTED:
  17756. "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  17757. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  17758. VR_SHOW_IOS_2:
  17759. "Для просмотра требуется приложение port VR и совместимый iPhone",
  17760. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  17761. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  17762. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  17763. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  17764. VR_COMPATIBLE_IPHONES_1: "iPhones",
  17765. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  17766. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  17767. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  17768. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  17769. VR_ANDROID_DVICES: "Android устройства",
  17770. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  17771. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  17772. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  17773. VR_DOWNLOAD_HERE: "Скачать здесь",
  17774. VR_REQUIRE_HEADSET:
  17775. "Требуется VR-шлем и установленное приложение port VR для Android",
  17776. VR_REDIRECT_TO_STORE:
  17777. "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  17778. VR_IMPROPER_EMBED:
  17779. "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  17780. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  17781. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  17782. SHARE_TO: "Поделиться",
  17783. SHARE_LINK: "Прямая ссылка",
  17784. SHARE_EXPLORE: "просмотреть",
  17785. SHARE_AT: "на",
  17786. SHARE_WITH: "с",
  17787. SHARE_3D: "в 3D",
  17788. SHARE_COPIED: "Скопировано!",
  17789. ERROR_BROWSER_SOLUTION:
  17790. "установите новый браузер, чтобы просмотреть 3D пространство.",
  17791. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  17792. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  17793. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  17794. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  17795. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  17796. ERROR_GENERIC_ACTIONS_3: " или ",
  17797. ERROR_GENERIC_ACTIONS_4:
  17798. "смотрите наше руководство по устранению неполадок",
  17799. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  17800. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  17801. ERROR_WEBGL_IOS_SOLUTION:
  17802. "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  17803. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  17804. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  17805. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  17806. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  17807. ERROR_WEBGL_SAFARI_ACTIONS_2:
  17808. "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  17809. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  17810. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  17811. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  17812. ERROR_MISSING_URLS_EXPLANATION:
  17813. "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  17814. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  17815. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  17816. ERROR_LOADING_FAILED_ACTIONS_2:
  17817. "посмотрите наше руководство по устранению неполадок",
  17818. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  17819. ERROR_MAINTENANCE_SOLUTION:
  17820. "Пожалуйста, попробуйте снова через несколько минут.",
  17821. LINK_TO_LOCATION: "Ссылка на местоположение",
  17822. MENU_COPY: "Копировать",
  17823. LINK_ALERT_COPY:
  17824. "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  17825. ROTATE: "Вращать",
  17826. MOVE: "Передвигаться",
  17827. INSIDE: "Вид изнутри",
  17828. ZOOM: "Масштаб",
  17829. };
  17830. },
  17831. {},
  17832. ],
  17833. 116: [
  17834. function (e, t, i) {
  17835. //main.js
  17836. (function (t) {
  17837. "use strict";
  17838. var modelProgressBase = 0.4;
  17839. var progressUpdate = function (e) {
  17840. // 0 <= e <= 1
  17841. console.log("e1:" + e);
  17842. e = Math.round(modelProgressBase * e * 100);
  17843. console.log("e2:" + e);
  17844. var t = $(".progressbar");
  17845. t.find(".bar").css("width", e + "%");
  17846. t.find(".label").css("left", (t.width() * e) / 100 - 15 + "px"); //上面跟着的字的百分比
  17847. t.find(".perc").text(e + "%"); //具体数字的百分比
  17848. };
  17849. $("#gui-loading").fadeIn(200);
  17850. progressUpdate(0.1);
  17851. var fileName = g_version ? "modeldata.js" : "someData.json";
  17852. $.ajax(
  17853. g_Prefix +
  17854. "data/" +
  17855. window.number +
  17856. "/" +
  17857. fileName +
  17858. "?" +
  17859. randomTime().getTime(),
  17860. { dataType: "json" }
  17861. )
  17862. .done(function (e) {
  17863. //改
  17864. var data = matcher(e);
  17865. data.files.templates[0] =
  17866. g_Prefix +
  17867. e.files.templates[0].replace("{{number}}", window.number);
  17868. data.user = {
  17869. is_authenticated: false,
  17870. flags: [
  17871. "payment_show_past_due",
  17872. "sc_imgopt_100",
  17873. "mattertags",
  17874. "labels",
  17875. "fastly_v2_urls",
  17876. "vr",
  17877. "uhql",
  17878. "sc_segment_100",
  17879. "show_segment_metrics",
  17880. "content_distribution",
  17881. "workshop_webgl",
  17882. "show360views",
  17883. "showcase_vr",
  17884. "ws_zooming",
  17885. "model_settings",
  17886. "ws_360snapshots",
  17887. "img_multi_dl",
  17888. "vrworkshop",
  17889. "tag_links",
  17890. "ws_img_multi_dl",
  17891. "mattertag_links",
  17892. "billing_tab_hidden",
  17893. "static_cloud_ui",
  17894. "metrics",
  17895. "mattertag_media",
  17896. "img_size_download",
  17897. "show_360snapshots",
  17898. "floorplan",
  17899. "sc_tilegen_0",
  17900. "showcase_webvr",
  17901. "sc_mixpanel_0",
  17902. "show_clickbait",
  17903. "zooming",
  17904. "showcase_tiling",
  17905. "list_signed_urls_default_3",
  17906. "fastly_image_opto",
  17907. ],
  17908. };
  17909. try {
  17910. //处理一下导览数据
  17911. data.model.images = data.model.images.filter((e) => {
  17912. if (!e.locations && !e.thumbnail_signed_src) return; //旧的曾有导览数据是错误的,将它删除
  17913. if (e.locations && e.locations.length == 0) return;
  17914. return e;
  17915. });
  17916. } catch (e) {
  17917. console.log(e);
  17918. }
  17919. window.DATA = data;
  17920. data.model.summary = data.summary;
  17921. data.model.name = data.name;
  17922. for (let i in data) {
  17923. data[i] == "false" && (data[i] = false);
  17924. }
  17925. progressUpdate(0.7);
  17926. StartLoad(); //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  17927. if (data.weixinDesc) {
  17928. g_weixinObj.desc = data.weixinDesc;
  17929. }
  17930. if (data.shareImgUrl) {
  17931. g_weixinObj.imgUrl = data.shareImgUrl;
  17932. }
  17933. window.wx && manage.weixinShare();
  17934. //初始画面
  17935. data.camera_start &&
  17936. data.camera_start.thumbImg &&
  17937. E(manage.dealURL(data.camera_start.thumbImg));
  17938. function E(e) {
  17939. $("<img/>")
  17940. .attr("src", e)
  17941. .on("load", function () {
  17942. $("#gui-thumb")
  17943. .css("backgroundImage", "url(" + e + ")")
  17944. .fadeIn(500),
  17945. $(this).remove();
  17946. });
  17947. }
  17948. //背景
  17949. (settings.transparentBg =
  17950. settings.transparentBg || data.transparentBg || false),
  17951. (settings.bgImg = settings.bgImg || data.bgImg || null);
  17952. if (settings.bgImg) {
  17953. $("#player").css({
  17954. "background-image": "url(" + settings.bgImg + ")",
  17955. "background-position": "center center",
  17956. });
  17957. }
  17958. {
  17959. //初始化导览时间
  17960. if (DATA.tourBlackSpeed == void 0) DATA.tourBlackSpeed = 100;
  17961. window._settings.warp.teleportTime =
  17962. (settings.teleportTime / DATA.tourBlackSpeed) * 100;
  17963. if (DATA.tourWalkSpeed == void 0) DATA.tourWalkSpeed = 100;
  17964. if (DATA.tourRotTime == "" || DATA.tourRotTime == void 0) {
  17965. DATA.tourRotTime = settings.tourRotTime; //默认停留2秒
  17966. }
  17967. }
  17968. {
  17969. //其他
  17970. _settings.floorPlanAngle = DATA.floorPlanAngle || 0;
  17971. }
  17972. })
  17973. .fail((e) => {
  17974. alert("缺少someData文件,请检查场景码是否正确。");
  17975. });
  17976. function StartLoad() {
  17977. //当加载完data后
  17978. function i() {
  17979. var e = window.number; //Y.getModelIDFromQueryString();
  17980. if (!e) return b(null, "loading-failed");
  17981. var t = Y.parseSidUrl(e),
  17982. i = l(),
  17983. a = c(),
  17984. s = o(),
  17985. u = V.quickstart.enabled,
  17986. g = null,
  17987. m = null,
  17988. v = null,
  17989. w = null,
  17990. T = null,
  17991. x = null,
  17992. S = null,
  17993. M = null,
  17994. R = null,
  17995. P = null,
  17996. O = null,
  17997. L = null,
  17998. N = new ue();
  17999. r(s);
  18000. h({
  18001. //MP开头写法
  18002. urlBase: t.urlBase,
  18003. })
  18004. .then(function () {
  18005. return re.init(), d(t, e); //getModel and load
  18006. })
  18007. .then(function (e) {
  18008. progressUpdate(0.9);
  18009. return (
  18010. (P = e),
  18011. p(
  18012. P,
  18013. V.appConfig.segment_key,
  18014. V.appConfig.keen_write_key,
  18015. V.appConfig.keen_project_id,
  18016. {
  18017. startSource: i,
  18018. autoplay: V.autoplay,
  18019. quickstart: u,
  18020. }
  18021. ),
  18022. P.urls.init()
  18023. );
  18024. })
  18025. .then(function () {
  18026. return P.loadPanos();
  18027. })
  18028. .then(function () {
  18029. (m = X.getStartCameraOptions(P, P.panos)),
  18030. (S = A(P)),
  18031. (O = y(u, m.mode)),
  18032. (v = O.controls),
  18033. (w = O.player),
  18034. (T = O.director),
  18035. (x = O.tagManager),
  18036. (M = O.tileDownloader),
  18037. (R = O.qualityManager),
  18038. (L = O.panoRenderer),
  18039. C(P, S, O, s),
  18040. (w.director = T), //xzw add
  18041. P.supportsTiles && M.start(),
  18042. !u ||
  18043. (m.mode === D.PANORAMA && m.pano) ||
  18044. (de.warn(
  18045. "Tried to quickstart, but failed as we are not starting in inside mode."
  18046. ),
  18047. (u = !1));
  18048. var e = null;
  18049. if (u) {
  18050. de.warn("Quickstart engaged. Hold on to your knickers.");
  18051. var t = v.controls[D.PANORAMA];
  18052. (g = new ie(R, S.scene, S.camera, t, s)),
  18053. _(S, s, P),
  18054. (e = g.load(m).then(function () {
  18055. S.addComponent(g),
  18056. S.once(le.AfterRender, function () {
  18057. de.warn(
  18058. "First render after quickstart load finished."
  18059. );
  18060. });
  18061. }));
  18062. }
  18063. window.flyToFirst = function () {
  18064. //xzw add
  18065. var pano = w.model.panos.get(
  18066. "8d778e19657f433fb9cf8947d823bb70"
  18067. );
  18068. var q = new _x.Quaternion(
  18069. 0.7099827027821568,
  18070. -0.07708150183830938,
  18071. 0.6958985789714591,
  18072. 0.07555241737970636
  18073. );
  18074. var lookAtPoint = new _x.Vector3(0, 0, -1)
  18075. .applyQuaternion(q)
  18076. .add(pano.position);
  18077. w.flyToPano({ pano: pano, lookAtPoint: lookAtPoint });
  18078. };
  18079. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N));
  18080. })
  18081. .then(function () {
  18082. return f(P, U.onProgress, i, !u, a);
  18083. })
  18084. .then(function () {
  18085. if (
  18086. ((m.quickstart = u),
  18087. I(P, S, O, s),
  18088. S.started || _(S, s, P),
  18089. H.modelLoaded(P, w, v, V.autoplay),
  18090. E(w, P, m, V.autoplay).done(function () {
  18091. T.autoTour();
  18092. }),
  18093. !P.supportsTiles)
  18094. ) {
  18095. var e = new Z(P, w);
  18096. e.start();
  18097. }
  18098. u && (S.removeComponent(g), g.destroy(), m.pano.enter()),
  18099. U.init(P, T, w, v, S, m, H.getSessionId()),
  18100. U.endLoading(P, T, x),
  18101. S.once(le.AfterRender, function () {
  18102. N.setAppReadyTime();
  18103. var e = N.calcFullLoadingTime();
  18104. de.warn("Total load time: " + e / 1e3),
  18105. H.loadComplete(e),
  18106. de.warn("First render after model load finished.");
  18107. try {
  18108. window.evt && window.dispatchEvent(window.evt);
  18109. parent.postMessage(
  18110. {
  18111. cmd: "loaded",
  18112. },
  18113. "*"
  18114. );
  18115. } catch (err) {}
  18116. }),
  18117. S.on(le.MemoryUsageUpdated, n);
  18118. })
  18119. .fail(b.bind(this, e));
  18120. }
  18121. function n(e) {
  18122. ce.update(e);
  18123. }
  18124. function r(e) {
  18125. de.info("Version", "2.25.6-0-gd87e5b1"),
  18126. (q.defaultMaxListeners = 1e3),
  18127. a(e),
  18128. s();
  18129. }
  18130. function o() {
  18131. return document.getElementById("player");
  18132. }
  18133. function a(e) {
  18134. e.addEventListener("dragenter", T, !1),
  18135. e.addEventListener("dragover", T, !1);
  18136. }
  18137. function s() {
  18138. F.valueFromHash("title", !0) ||
  18139. $(document).ready(function () {
  18140. var e = $(".model-title");
  18141. e.hide();
  18142. });
  18143. }
  18144. function l() {
  18145. return F.valueFromHash("play", !1)
  18146. ? "autoplay"
  18147. : F.inIframe()
  18148. ? "click"
  18149. : "fullpage";
  18150. }
  18151. function c() {
  18152. return {
  18153. panoElementsToLoad: 6,
  18154. modelElementsToLoad: 0,
  18155. totalElementsLoaded: 0,
  18156. totalElementsToLoad: 0,
  18157. totalPercentageLoaded: 0,
  18158. progressCallback: null,
  18159. };
  18160. }
  18161. function h(e) {
  18162. return K.loadFeatureFlags(e).done(function (e) {
  18163. K.updateDependentSettings(e, V);
  18164. });
  18165. }
  18166. // function u(e) {
  18167. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  18168. // responseType: "json",
  18169. // prefetchFrom: "config"
  18170. // }).then(function(e) {
  18171. // return e ? void j.extendObject(V.appConfig, e) : {}
  18172. // }, function(e) {
  18173. // return de.warn("Failed loading runtime config, using defaults."),
  18174. // $.when({})
  18175. // })
  18176. // }
  18177. function d(e, t) {
  18178. var i = B.getModel({
  18179. url: t,
  18180. floors: F.valueFromHash("f", !0),
  18181. autoload: !1,
  18182. });
  18183. return $.when(i, n).then(null, function (e) {
  18184. return this;
  18185. });
  18186. }
  18187. function p(e, t, i, n, r) {
  18188. de.info("Model data loaded"),
  18189. de.debug("UUID: " + e.data.job.uuid),
  18190. J.init(K.getFlags()),
  18191. i &&
  18192. H.initKeen({
  18193. token: i,
  18194. appId: n,
  18195. }),
  18196. H.initSegment({
  18197. model: e.sid,
  18198. version: "2.25.6-0-gd87e5b1",
  18199. startSource: r.startSource,
  18200. token: t,
  18201. autoplay: r.autoplay,
  18202. quickstart: r.quickstart,
  18203. });
  18204. }
  18205. function f(e, t, i, n, r) {
  18206. return (
  18207. (r.progressCallback = t),
  18208. H.sessionStart(),
  18209. e.load(n).progress(g.bind(this, r))
  18210. );
  18211. }
  18212. function g(e, t) {
  18213. (e.modelElementsToLoad = t[1]), v(e), m(e);
  18214. }
  18215. function m(e) {
  18216. e.totalElementsLoaded++,
  18217. (e.totalPercentageLoaded =
  18218. e.totalElementsLoaded / e.totalElementsToLoad),
  18219. //----许钟文-----------------模型进度条向后调整
  18220. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0);
  18221. e.totalPercentageLoaded =
  18222. modelProgressBase +
  18223. (1 - modelProgressBase) * e.totalPercentageLoaded;
  18224. //console.log('pro:'+e.totalPercentageLoaded)
  18225. //---------------------------
  18226. e.progressCallback &&
  18227. e.progressCallback(100 * e.totalPercentageLoaded);
  18228. }
  18229. function v(e) {
  18230. e.totalElementsToLoad =
  18231. e.modelElementsToLoad + e.panoElementsToLoad;
  18232. }
  18233. function A(e) {
  18234. var t = new x.PerspectiveCamera();
  18235. t.layers.enable(he.PANOMARKERS),
  18236. t.layers.enable(he.RETICULE),
  18237. t.layers.enable(he.TAG);
  18238. var i = new x.Scene(),
  18239. n = new x.AmbientLight(16777215);
  18240. i.add(n),
  18241. (i.plane = new x.Mesh(
  18242. new x.PlaneBufferGeometry(1e5, 1e5),
  18243. new x.RawShaderMaterial({
  18244. side: x.DoubleSide,
  18245. })
  18246. )),
  18247. (i.plane.position.y = 0),
  18248. i.plane.rotateX(-Math.PI / 2),
  18249. (i.plane.material.visible = !1),
  18250. i.add(i.plane),
  18251. i.updateMatrixWorld(),
  18252. V.showScreenshotLocations &&
  18253. e.data.images.forEach(function (e) {
  18254. if (e.metadata && e.metadata.camera_position) {
  18255. var t = e.metadata.camera_position,
  18256. n = new x.Mesh(new x.BoxGeometry(0.3, 0.3, 0.3));
  18257. (n.position = t.clone()), i.add(n);
  18258. var r = e.metadata.camera_quaternion,
  18259. o = new x.Vector3(0, 0, -1).applyQuaternion(r);
  18260. i.add(new x.ArrowHelper(o, t.clone(), 1, 16711680));
  18261. }
  18262. }),
  18263. V.showAxis &&
  18264. (i.add(
  18265. new x.ArrowHelper(
  18266. new x.Vector3(0, 1, 0),
  18267. new x.Vector3(0, 0, 0),
  18268. 1,
  18269. 255
  18270. )
  18271. ),
  18272. i.add(
  18273. new x.ArrowHelper(
  18274. new x.Vector3(0, 0, 1),
  18275. new x.Vector3(0, 0, 0),
  18276. 1,
  18277. 16711680
  18278. )
  18279. ),
  18280. i.add(
  18281. new x.ArrowHelper(
  18282. new x.Vector3(1, 0, 0),
  18283. new x.Vector3(0, 0, 0),
  18284. 1,
  18285. 65280
  18286. )
  18287. ));
  18288. //背景
  18289. if (!settings.transparentBg && !settings.bgImg) {
  18290. i.skybox = new W();
  18291. i.add(i.skybox);
  18292. }
  18293. var r = new te(i, t, z);
  18294. return r;
  18295. }
  18296. function y(e, t) {
  18297. var i = e ? 1 : 1e3,
  18298. n = J.tilegen || J.imgopt ? 6 : 2;
  18299. n = F.valueFromHash("tileconc", n);
  18300. var r = new ne(),
  18301. o = new ae({
  18302. concurrentDownloads: n,
  18303. }),
  18304. a = new se(),
  18305. s = new P(),
  18306. l = new M(),
  18307. c = new S(t),
  18308. h = new R(),
  18309. u = new O(i),
  18310. d = new L(),
  18311. p = new oe();
  18312. return {
  18313. qualityManager: r,
  18314. panoRenderer: a,
  18315. tileDownloader: o,
  18316. player: c,
  18317. director: l,
  18318. modelManager: s,
  18319. tagManager: p,
  18320. displayController: u,
  18321. labelDisplayController: d,
  18322. controls: h,
  18323. };
  18324. }
  18325. function C(e, t, i, n) {
  18326. var r = i.controls,
  18327. o = i.qualityManager,
  18328. a = i.panoRenderer,
  18329. s = i.tileDownloader,
  18330. l = i.modelManager;
  18331. r.init(n, l),
  18332. ee.init(i.director, r, i.player, l, t),
  18333. o.init(l),
  18334. s.init(o),
  18335. a.init(t, s, o),
  18336. l.init(s, a, o),
  18337. l.addModel(e),
  18338. t.addComponent(G);
  18339. }
  18340. function I(e, t, i, n) {
  18341. var r = i.qualityManager,
  18342. o = i.panoRenderer,
  18343. a = i.tileDownloader,
  18344. s = i.modelManager,
  18345. l = i.player,
  18346. c = i.director,
  18347. h = i.tagManager,
  18348. u = i.displayController,
  18349. d = i.labelDisplayController,
  18350. p = i.controls;
  18351. t.scene.add(e), (t.qualityManager = r);
  18352. var f = {
  18353. camera: t.camera,
  18354. director: c,
  18355. modelManager: s,
  18356. tileDownloader: a,
  18357. panoRenderer: o,
  18358. qualityManager: r,
  18359. tagManager: h,
  18360. container: n,
  18361. controls: p,
  18362. };
  18363. l.init(f),
  18364. l.setScene(t.scene),
  18365. h.init(s, l),
  18366. c.init(l, s),
  18367. u.init(c, l, s, h, n),
  18368. d.init(l, s, n),
  18369. z.bindEvents(l),
  18370. t.addComponent(h),
  18371. t.addComponent(l),
  18372. t.addComponent(o),
  18373. (l.sceneRenderer = t); //xzw add 方便resize
  18374. }
  18375. function E(e, t, i, n) {
  18376. return (
  18377. de.info("Starting player in " + i.mode),
  18378. H.report(t.sid, "started-playing", n, i.quickstart),
  18379. e.start(i)
  18380. );
  18381. }
  18382. function b(e, t) {
  18383. de.error(t), k.error(t), H.report(e, "error-" + t);
  18384. }
  18385. function w(e) {
  18386. var t = F.details();
  18387. t && "Safari" === t.name && t.version > 500 && t.version < 600
  18388. ? (k.error("webgl-safari"), H.report(e, "error-webgl-safari"))
  18389. : (k.error("webgl-generic"),
  18390. H.report(e, "error-webgl-generic"));
  18391. }
  18392. function _(e, t, i) {
  18393. try {
  18394. e.start(t);
  18395. } catch (e) {
  18396. throw (de.warn(e.message), w(i.sid), e);
  18397. }
  18398. }
  18399. function T(e) {
  18400. e.stopPropagation(), e.preventDefault();
  18401. }
  18402. //czj 判断someData 有没有hoticon字段 修改热点的样式
  18403. if (window.DATA.hoticon) {
  18404. g_HotImage = {
  18405. point:
  18406. window.DATA.hoticon.default ||
  18407. "https://super.4dage.com/images/4dagePoint2.png",
  18408. point2:
  18409. window.DATA.hoticon.higt ||
  18410. "https://super.4dage.com/images/4dagePoint.png",
  18411. };
  18412. }
  18413. //czj 判断someData 有没有backgroundMusic 添加音乐
  18414. if (window.DATA.backgroundMusic) {
  18415. if (window.isLocal) {
  18416. SoundManager.setSrc(
  18417. "bgm",
  18418. manage.dealURL(window.DATA.backgroundMusic)
  18419. );
  18420. } else {
  18421. SoundManager.setSrc("bgm", window.DATA.backgroundMusic);
  18422. }
  18423. $("#volume").show();
  18424. } else if (g_version === "one") {
  18425. SoundManager.setSrc(
  18426. "bgm",
  18427. manage.dealURL(
  18428. g_Prefix +
  18429. "/audio/" +
  18430. "audio" +
  18431. window.number +
  18432. "/background.mp3"
  18433. )
  18434. );
  18435. $("#volume").show();
  18436. }
  18437. //隐藏公司logo
  18438. if (window.DATA.loadlogo) {
  18439. showLogo();
  18440. }
  18441. e("./lib/three75-shim"),
  18442. e("./lib/array-polyfill"),
  18443. e("./lib/performance-polyfill"),
  18444. e("./lib/shaders/CopyShader.js"),
  18445. e("./lib/shaders/HorizontalBlurShader.js"),
  18446. e("./lib/shaders/VerticalBlurShader.js"),
  18447. e("./lib/postprocessing/EffectComposer.js"),
  18448. e("./lib/postprocessing/RenderPass.js"),
  18449. e("./lib/postprocessing/MaskPass.js"),
  18450. e("./lib/postprocessing/ShaderPass.js"),
  18451. window.Promise || (window.Promise = e("promise-polyfill"));
  18452. var x = e("three"),
  18453. _x = e("three"),
  18454. S = (e("./util/sentry"), e("./player")),
  18455. M = e("./director"),
  18456. R = e("./controls/CameraControls"),
  18457. P = e("./model/ModelManager"),
  18458. O = e("./DisplayController"),
  18459. L = e("./label/LabelDisplayController"),
  18460. D = e("./enum/Viewmode"),
  18461. N = e("./util/logger"),
  18462. B = e("./showcase"),
  18463. F = e("./util/browser"),
  18464. V = e("./settings"),
  18465. U = e("./gui/gui"),
  18466. k = e("./gui/error"),
  18467. H = e("./analytics"),
  18468. G = e("./util/transitions"),
  18469. z = e("./effects"),
  18470. W = e("./objects/Skybox"),
  18471. j = e("./util/common"),
  18472. Y =
  18473. (e("./util/PanoramaCollection"),
  18474. e("./util/math"),
  18475. e("./util/showcase")),
  18476. X = e("./util/camera"),
  18477. Z =
  18478. (e("./objects/Panorama"),
  18479. e("./cameras/PanoramaCamera"),
  18480. e("./preloaders")),
  18481. q = e("events").EventEmitter,
  18482. K = e("./featureflags"),
  18483. Q = (e("./util/lerp"), e("./util/ajax")),
  18484. J = e("./ab"),
  18485. ee = e("./sdk/automation.js"),
  18486. te = e("./scene/SceneRenderer"),
  18487. ie = e("./scene/QuickstartManager"),
  18488. ne = e("./tile/QualityManager.js"),
  18489. re = e("./localization/localize"),
  18490. oe = e("./tag/tagManager"),
  18491. ae = e("./tile/TileDownloader"),
  18492. se = e("./tile/PanoRenderer"),
  18493. le =
  18494. (e("./enum/PanoSizeClass"),
  18495. e("./enum/PanoramaEvents"),
  18496. e("./enum/SceneRendererEvents")),
  18497. ce = e("./gui/memoryUsage"),
  18498. he = e("./enum/RenderLayers"),
  18499. ue = e("./TimingData"),
  18500. de = new N(t);
  18501. (N.level = V.logLevel), (N.consoleEnabled = V.console), i();
  18502. }
  18503. }).call(this, "/js/main.js");
  18504. },
  18505. {
  18506. "./DisplayController": 1,
  18507. "./TimingData": 2,
  18508. "./ab": 3,
  18509. "./analytics": 4,
  18510. "./cameras/PanoramaCamera": 7,
  18511. "./controls/CameraControls": 9,
  18512. "./director": 15,
  18513. "./effects": 16,
  18514. "./enum/PanoSizeClass": 36,
  18515. "./enum/PanoramaEvents": 37,
  18516. "./enum/RenderLayers": 41,
  18517. "./enum/SceneRendererEvents": 43,
  18518. "./enum/Viewmode": 51,
  18519. "./featureflags": 59,
  18520. "./gui/error": 64,
  18521. "./gui/gui": 65,
  18522. "./gui/memoryUsage": 73,
  18523. "./label/LabelDisplayController": 91,
  18524. "./lib/array-polyfill": 92,
  18525. "./lib/performance-polyfill": 95,
  18526. "./lib/postprocessing/EffectComposer.js": 96,
  18527. "./lib/postprocessing/MaskPass.js": 97,
  18528. "./lib/postprocessing/RenderPass.js": 98,
  18529. "./lib/postprocessing/ShaderPass.js": 99,
  18530. "./lib/shaders/CopyShader.js": 100,
  18531. "./lib/shaders/HorizontalBlurShader.js": 101,
  18532. "./lib/shaders/VerticalBlurShader.js": 102,
  18533. "./lib/three75-shim": 103,
  18534. "./localization/localize": 108,
  18535. "./tag/tagManager": 124,
  18536. "./model/ModelManager": 140,
  18537. "./objects/Panorama": 148,
  18538. "./objects/Skybox": 152,
  18539. "./player": 155,
  18540. "./preloaders": 156,
  18541. "./scene/QuickstartManager": 157,
  18542. "./scene/SceneRenderer": 158,
  18543. "./sdk/automation.js": 164,
  18544. "./settings": 166,
  18545. "./showcase": 168,
  18546. "./tile/PanoRenderer": 169,
  18547. "./tile/QualityManager.js": 170,
  18548. "./tile/TileDownloader": 171,
  18549. "./util/PanoramaCollection": 178,
  18550. "./util/ajax": 181,
  18551. "./util/browser": 182,
  18552. "./util/camera": 183,
  18553. "./util/common": 185,
  18554. "./util/lerp": 188,
  18555. "./util/logger": 189,
  18556. "./util/math": 190,
  18557. "./util/sentry": 192,
  18558. "./util/showcase": 193,
  18559. "./util/transitions": 195,
  18560. events: 202,
  18561. "promise-polyfill": 213,
  18562. three: 217,
  18563. },
  18564. ],
  18565. 117: [
  18566. function (e, t, i) {
  18567. "use strict";
  18568. function n(e) {
  18569. e = e || {};
  18570. r.RawShaderMaterial.call(
  18571. this,
  18572. a.extendObject(
  18573. {
  18574. fragmentShader: o.cube.fragmentShader,
  18575. vertexShader: o.cube.vertexShader,
  18576. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  18577. name: "CubemapMaterial",
  18578. },
  18579. e
  18580. )
  18581. );
  18582. }
  18583. var r = e("three"),
  18584. o = e("../shaders"),
  18585. a = e("../util/common");
  18586. (n.prototype = Object.create(r.RawShaderMaterial.prototype)),
  18587. (n.prototype.constructor = n),
  18588. (t.exports = n);
  18589. },
  18590. {
  18591. "../shaders": 167,
  18592. "../util/common": 185,
  18593. three: 217,
  18594. },
  18595. ],
  18596. 118: [
  18597. function (e, t, i) {
  18598. "use strict";
  18599. function n(e) {
  18600. e = e || {};
  18601. r.RawShaderMaterial.call(
  18602. this,
  18603. a.extendObject(
  18604. {
  18605. fragmentShader: o.model.fragmentShader,
  18606. vertexShader: o.model.vertexShader,
  18607. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  18608. name: "ModelTextureMaterial",
  18609. },
  18610. e
  18611. )
  18612. );
  18613. }
  18614. var r = e("three"),
  18615. o = e("../shaders"),
  18616. a = e("../util/common");
  18617. (n.prototype = Object.create(r.RawShaderMaterial.prototype)),
  18618. (n.prototype.constructor = n),
  18619. (n.prototype.setProjectedPanos = function (e, t, i) {
  18620. i && (this.uniforms.progress.value = 0),
  18621. e.ensureSkyboxReadyForRender(),
  18622. (this.uniforms.pano0Map.value = e.getSkyboxTexture()),
  18623. this.uniforms.pano0Position.value.copy(e.position),
  18624. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  18625. t.ensureSkyboxReadyForRender(),
  18626. (this.uniforms.pano1Map.value = t.getSkyboxTexture()),
  18627. this.uniforms.pano1Position.value.copy(t.position),
  18628. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld);
  18629. }),
  18630. /* n.prototype.setEyeDir = function(dir, pos) {//加
  18631. this.uniforms.eyeDir.value.copy(dir)
  18632. this.uniforms.eyePos.value.copy(pos)
  18633. }
  18634. n.prototype.setBendCameraQua = function(matrix) {//加
  18635. this.uniforms.cameraDeltaMatrix.value.copy(matrix)
  18636. } */
  18637. (t.exports = n);
  18638. },
  18639. {
  18640. "../shaders": 167,
  18641. "../util/common": 185,
  18642. three: 217,
  18643. },
  18644. ],
  18645. 119: [
  18646. function (e, t, i) {
  18647. (function (i) {
  18648. "use strict";
  18649. function n(e, t, i, n) {
  18650. (this.div = null),
  18651. (this.body = null),
  18652. (this.label = e),
  18653. (this.description = t),
  18654. (this.parsedDescription = []),
  18655. (this.media = i || {
  18656. type: null,
  18657. }),
  18658. (this.loadingSpinner = null),
  18659. (this.parser = new r({
  18660. supportLinks: !u.valueFromHash("mls"),
  18661. keepLinkLabels: !0,
  18662. })),
  18663. (this.state = I.CLOSED),
  18664. (this.orientation = ""),
  18665. (this.initialTransform = ""),
  18666. (this.hovering = !1),
  18667. (this.openTransition = null),
  18668. (this.closeTransition = null),
  18669. (this.openPromise = null),
  18670. (this.closePromise = null),
  18671. (this.animationTransition = null),
  18672. (this.animationScale = 0);
  18673. }
  18674. var r = e("../Parser/DescriptionParser"),
  18675. o = e("../Media/Link"),
  18676. a = e("../Media/Image"),
  18677. s = e("../Media/EmbedlyPlayer"),
  18678. l = e("../Media/EmbedlyEmbed"),
  18679. c = e("../../util/transitions"),
  18680. h = e("../../util/lerp"),
  18681. u = e("../../util/browser"),
  18682. d = e("./BillboardEvent"),
  18683. p = e("../Media/MediaEvent"),
  18684. f = e("../Parser/DescriptionChunkType"),
  18685. g = e("events").EventEmitter,
  18686. m = e("./billboardSettings"),
  18687. v = e("./overlaySettings"),
  18688. A = e("../../util/logger"),
  18689. y = new A(i),
  18690. C = document.getElementById("tag-billboards");
  18691. C.addEventListener("touchend", function (e) {
  18692. C.style.pointerEvents = "none";
  18693. }),
  18694. C.addEventListener("touchcancel", function (e) {
  18695. C.style.pointerEvents = "none";
  18696. });
  18697. var I = {
  18698. CLOSED: "closed",
  18699. OPENING: "opening",
  18700. OPEN: "open",
  18701. CLOSING: "closing",
  18702. ACTIVE: "active",
  18703. };
  18704. (n.prototype = Object.create(g.prototype)),
  18705. (n.prototype.build = function (e) {
  18706. this.parsedDescription = this.parser.parse(this.description);
  18707. var t = document.createElement("div");
  18708. (t.className = "tag-container has-hotzone"),
  18709. (this.div = t),
  18710. (this.body = document.createElement("div")),
  18711. (this.body.className = "tag-body");
  18712. var i = document.createElement("div");
  18713. i.classList.add("tag-content");
  18714. var n = document.createElement("div");
  18715. n.classList.add("tag-text-content");
  18716. var r = document.createElement("div");
  18717. (r.className = "tag-label"),
  18718. (r.textContent = this.label),
  18719. n.appendChild(r);
  18720. var o = document.createElement("div");
  18721. (o.className = "tag-desc"),
  18722. n.appendChild(o),
  18723. i.appendChild(n),
  18724. this.body.appendChild(i),
  18725. this.appendDescriptionElements(this.parsedDescription, o),
  18726. this.appendMedia(),
  18727. t.appendChild(this.body),
  18728. C.appendChild(t),
  18729. this.bindEvents(t, this.body);
  18730. }),
  18731. (n.prototype.bindEvents = function (e, t) {
  18732. var i = function (e) {
  18733. return function (t) {
  18734. if (!this.div.classList.contains("overlay")) {
  18735. var i,
  18736. n = document.getElementById("player");
  18737. try {
  18738. i = new MouseEvent(e, t);
  18739. } catch (n) {
  18740. (i = document.createEvent("MouseEvents")),
  18741. i.initMouseEvent(
  18742. e,
  18743. t.bubbles,
  18744. t.cancelable,
  18745. t.view,
  18746. t.detail,
  18747. t.screenX,
  18748. t.screenY,
  18749. t.clientX,
  18750. t.clientY,
  18751. t.ctrlKey,
  18752. t.altKey,
  18753. t.shiftKey,
  18754. t.metaKey,
  18755. t.button,
  18756. t.relatedTarget
  18757. );
  18758. }
  18759. n.dispatchEvent(i);
  18760. }
  18761. };
  18762. };
  18763. t.addEventListener("mousedown", function (e) {
  18764. e.stopPropagation();
  18765. }),
  18766. t.addEventListener("mouseup", function (e) {
  18767. e.stopPropagation();
  18768. }),
  18769. e.addEventListener("touchstart", function (e) {
  18770. C.style.pointerEvents = "auto";
  18771. }),
  18772. e.addEventListener("mousedown", i("mousedown").bind(this)),
  18773. e.addEventListener("mouseup", i("mouseup").bind(this)),
  18774. t.addEventListener(
  18775. "mouseover",
  18776. function (t) {
  18777. this.state === I.OPEN && e.classList.remove("has-hotzone");
  18778. }.bind(this)
  18779. ),
  18780. e.addEventListener(
  18781. "mouseenter",
  18782. function (e) {
  18783. this.state !== I.CLOSING &&
  18784. ((this.hovering = !0), this.emit(d.ENTER));
  18785. }.bind(this)
  18786. ),
  18787. e.addEventListener(
  18788. "mouseleave",
  18789. function (e) {
  18790. (this.hovering = !1), this.emit(d.LEAVE);
  18791. }.bind(this)
  18792. ),
  18793. e.addEventListener("gesturestart", function (e) {
  18794. e.preventDefault();
  18795. });
  18796. var n = e.querySelector(".tag-text-content"),
  18797. r = 0;
  18798. n.addEventListener("touchstart", function (e) {
  18799. r = e.changedTouches[0].clientY;
  18800. }),
  18801. n.addEventListener("touchmove", function (t) {
  18802. function i(e) {
  18803. e &&
  18804. ((0 === e.scrollTop && t.changedTouches[0].clientY > r) ||
  18805. (e.scrollTop + e.clientHeight - e.scrollHeight === 0 &&
  18806. t.changedTouches[0].clientY < r)) &&
  18807. t.preventDefault();
  18808. }
  18809. return e.classList.contains("overlay")
  18810. ? i(this.querySelector(".tag-desc"))
  18811. : void i(this);
  18812. }),
  18813. e.addEventListener("touchmove", function (e) {
  18814. 0 ===
  18815. (n.compareDocumentPosition(e.target) &
  18816. Node.DOCUMENT_POSITION_CONTAINED_BY) &&
  18817. e.preventDefault();
  18818. });
  18819. }),
  18820. (n.prototype.appendDescriptionElements = function (e, t) {
  18821. e.length > 0 && this.div.classList.add("has-text"),
  18822. e.forEach(
  18823. function (e, i) {
  18824. switch (e.type) {
  18825. case f.TEXT:
  18826. t.appendChild(this.createTextElement(e.text));
  18827. break;
  18828. case f.LINK:
  18829. t.appendChild(this.createLinkElement(e.link));
  18830. }
  18831. }.bind(this)
  18832. );
  18833. }),
  18834. (n.prototype.appendLoadingSpinner = function () {
  18835. (this.loadingSpinner = document.createElement("div")),
  18836. this.loadingSpinner.classList.add("loading-spinner");
  18837. var e = document.createElement("div");
  18838. e.classList.add("gui-spinner-icon"),
  18839. this.loadingSpinner.appendChild(e),
  18840. this.body.appendChild(this.loadingSpinner);
  18841. }),
  18842. (n.prototype.onMediaLoadFinished = function () {
  18843. this.loadingSpinner &&
  18844. (this.loadingSpinner.parentNode.removeChild(
  18845. this.loadingSpinner
  18846. ),
  18847. this.applyOrientation(this.orientation),
  18848. (this.loadingSpinner = null));
  18849. }),
  18850. (n.prototype.appendMedia = function () {
  18851. if (
  18852. this.media &&
  18853. this.media.type &&
  18854. "error" !== this.media.type &&
  18855. (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)
  18856. ) {
  18857. this.appendLoadingSpinner();
  18858. var e = document.createElement("div");
  18859. e.classList.add("tag-media-content");
  18860. var t = document.createElement("i");
  18861. switch (
  18862. (["icon", "icon-close-thin", "close"].forEach(function (e) {
  18863. t.classList.add(e);
  18864. }),
  18865. this.body.appendChild(t),
  18866. this.body.appendChild(e),
  18867. this.media.type)
  18868. ) {
  18869. case f.IMAGE:
  18870. e.appendChild(
  18871. this.createImageElement(this.media, this.body)
  18872. );
  18873. break;
  18874. case f.VIDEO:
  18875. e.appendChild(
  18876. this.createVideoElement(this.media, this.body)
  18877. );
  18878. break;
  18879. case f.RICH:
  18880. e.appendChild(
  18881. this.createEmbedElement(this.media, this.body)
  18882. );
  18883. }
  18884. }
  18885. }),
  18886. (n.prototype.createTextElement = function (e) {
  18887. var t = document.createElement("span");
  18888. return (t.textContent = e), t;
  18889. });
  18890. (n.prototype.createLinkElement = function (e) {
  18891. var t = new o(e);
  18892. return (
  18893. t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  18894. t.createDomElement()
  18895. );
  18896. }),
  18897. (n.prototype.createImageElement = function (e, t) {
  18898. function i() {
  18899. function e() {
  18900. m ||
  18901. (r.classList.remove("view-image"),
  18902. c.classList.add("overlay"),
  18903. i(),
  18904. window.addEventListener("resize", b),
  18905. c.addEventListener("click", a),
  18906. g.addEventListener("click", l),
  18907. f.addEventListener("click", s),
  18908. (m = !0),
  18909. o.emit(p.IMAGE_OPENED));
  18910. }
  18911. function i() {
  18912. t.classList.add("show-info"),
  18913. h.classList.remove("collapsible"),
  18914. (h.style.height = "");
  18915. var e = parseFloat(getComputedStyle(I).lineHeight),
  18916. i = y + e,
  18917. r = c.clientWidth - 2 * v.boundaryWidth - C,
  18918. a = c.clientHeight - 2 * v.boundaryHeight - C - i,
  18919. s = a,
  18920. l = s * n.aspect;
  18921. l > r && ((l = r), (s = l / n.aspect)),
  18922. s > a && ((s = a), (l = s * n.aspect)),
  18923. (l += C),
  18924. (s += C + i),
  18925. (t.style.width = l + "px"),
  18926. (t.style.height = s + "px"),
  18927. (u.style.paddingTop = e + C + "px"),
  18928. o.description.length > 0 &&
  18929. (h.classList.add("collapsible"),
  18930. (h.style.height = h.clientHeight + 12 + "px"),
  18931. (E.style.height =
  18932. "calc(100% - " + I.clientHeight + "px)"));
  18933. }
  18934. function a(e) {
  18935. e.target === c && s();
  18936. }
  18937. function s() {
  18938. m &&
  18939. ((m = !1),
  18940. r.classList.add("view-image"),
  18941. c.classList.remove("overlay"),
  18942. (h.style.height = ""),
  18943. (u.style.paddingTop = ""),
  18944. (t.style.width = ""),
  18945. (t.style.height = ""),
  18946. window.removeEventListener("resize", b),
  18947. c.removeEventListener("click", a),
  18948. g.removeEventListener("click", l),
  18949. f.removeEventListener("click", s),
  18950. o.emit(p.IMAGE_CLOSED),
  18951. o.close(!0));
  18952. }
  18953. function l(e) {
  18954. t.classList.toggle("show-info");
  18955. }
  18956. var c = o.div,
  18957. h = c.getElementsByClassName("tag-content")[0],
  18958. u = c.getElementsByClassName("tag-media-content")[0],
  18959. f = t.getElementsByClassName("close")[0],
  18960. g = h.getElementsByClassName("tag-label")[0];
  18961. c.classList.add("has-image"),
  18962. r.classList.add("view-image"),
  18963. c.classList.add(
  18964. n.aspect >= 1 ? "image-landscape" : "image-portrait"
  18965. ),
  18966. o.applyOrientation(o.orientation);
  18967. var m = !1,
  18968. A = getComputedStyle(h),
  18969. y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom),
  18970. C = 2 * parseFloat(getComputedStyle(u).paddingLeft),
  18971. I = h.querySelector(".tag-label"),
  18972. E = h.querySelector(".tag-desc"),
  18973. b = (function () {
  18974. var e,
  18975. t,
  18976. n = 0;
  18977. return function () {
  18978. clearInterval(e),
  18979. clearTimeout(t),
  18980. (e = setInterval(function () {
  18981. var e = c.clientHeight;
  18982. n !== e && (i(), (n = e));
  18983. }, 100)),
  18984. (t = setTimeout(clearInterval.bind(this, e), 1e3));
  18985. };
  18986. })();
  18987. n.on(p.IMAGE_OPENING, e),
  18988. o.on(d.ACTIVATE, e),
  18989. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  18990. o.on(d.CLOSING, s);
  18991. }
  18992. var n = new a(),
  18993. r = n.createDomElement();
  18994. this.once(d.OPENED, function () {
  18995. n.load(e.src)
  18996. .then(i)
  18997. .catch(function (t) {
  18998. y.warn("Failed to load image:", e.src),
  18999. y.warn("with error:", t);
  19000. })
  19001. .then(this.onMediaLoadFinished.bind(this));
  19002. });
  19003. var o = this;
  19004. return r;
  19005. }),
  19006. (n.prototype.createVideoElement = function (e, t) {
  19007. var i = new s({
  19008. autoPlay: !0,
  19009. autoResume: !0,
  19010. startMuted: !1,
  19011. loop: !1,
  19012. }),
  19013. n = i.createDomElement();
  19014. return (
  19015. this.once(
  19016. d.OPENED,
  19017. function () {
  19018. i.load(e.src)
  19019. .then(
  19020. function () {
  19021. this.div.classList.add("has-video"),
  19022. (this.state !== I.OPEN &&
  19023. this.state !== I.ACTIVE) ||
  19024. (i.show(), i.play()),
  19025. this.on(d.OPENING, i.show.bind(i)),
  19026. this.on(d.OPENED, i.play.bind(i)),
  19027. this.on(d.CLOSING, i.pause.bind(i)),
  19028. this.on(d.CLOSED, i.hide.bind(i));
  19029. }.bind(this)
  19030. )
  19031. .catch(function (t) {
  19032. y.warn("Failed to embed video:", e.src),
  19033. y.warn("with error:", t);
  19034. })
  19035. .then(this.onMediaLoadFinished.bind(this));
  19036. }.bind(this)
  19037. ),
  19038. n
  19039. );
  19040. }),
  19041. (n.prototype.createEmbedElement = function (e, t) {
  19042. var i = new l(),
  19043. n = i.createDomElement();
  19044. return (
  19045. this.once(
  19046. d.OPENED,
  19047. function () {
  19048. i.load(e.src)
  19049. .then(
  19050. function () {
  19051. this.div.classList.add("has-embed"),
  19052. (this.state !== I.OPEN &&
  19053. this.state !== I.ACTIVE) ||
  19054. i.show(),
  19055. this.applyOrientation(this.orientation),
  19056. this.on(d.OPENING, i.show.bind(i)),
  19057. this.on(d.CLOSED, i.hide.bind(i));
  19058. }.bind(this)
  19059. )
  19060. .catch(function (t) {
  19061. y.warn("Failed to embed:", e.src),
  19062. y.warn("with error:", t);
  19063. })
  19064. .then(this.onMediaLoadFinished.bind(this));
  19065. }.bind(this)
  19066. ),
  19067. n
  19068. );
  19069. }),
  19070. (n.prototype.open = function (e) {
  19071. return (
  19072. (this.openPromise = $.Deferred()),
  19073. this.state === I.ACTIVE
  19074. ? this.openPromise.resolve().promise()
  19075. : (this.hovering || this.div.classList.add("has-hotzone"),
  19076. this.openTransition
  19077. ? e && this.setActiveState()
  19078. : (this.openTransition = c.setTimeout(
  19079. function () {
  19080. this.state !== I.OPEN &&
  19081. (this.emit(d.OPENING),
  19082. e && this.emit(d.ACTIVATING),
  19083. (this.state = I.OPENING),
  19084. this.animateOpen(
  19085. function () {
  19086. e && this.setActiveState(),
  19087. this.openPromise.resolve();
  19088. }.bind(this)
  19089. ));
  19090. }.bind(this),
  19091. m.animation.openDelay
  19092. )),
  19093. c.cancel(this.closeTransition),
  19094. this.closePromise && this.closePromise.reject(),
  19095. (this.closeTransition = void 0),
  19096. this.openPromise.promise())
  19097. );
  19098. }),
  19099. (n.prototype.close = function (e) {
  19100. return (
  19101. (this.closePromise = $.Deferred()),
  19102. !e && this.hovering
  19103. ? this.closePromise.reject().promise()
  19104. : (this.closeTransition ||
  19105. (this.closeTransition = c.setTimeout(
  19106. function () {
  19107. this.state !== I.CLOSED &&
  19108. (this.emit(d.CLOSING),
  19109. (this.state = I.CLOSING),
  19110. this.animateClose());
  19111. }.bind(this),
  19112. m.animation.closeDelay
  19113. )),
  19114. c.cancel(this.openTransition),
  19115. this.openPromise && this.openPromise.reject(),
  19116. (this.openTransition = void 0),
  19117. this.closePromise.resolve(),
  19118. this.closePromise.promise())
  19119. );
  19120. }),
  19121. (n.prototype.setActiveState = function () {
  19122. this.state !== I.CLOSED &&
  19123. ((this.state = I.ACTIVE),
  19124. this.emit(d.ACTIVATE),
  19125. this.div.classList.remove("has-hotzone"));
  19126. }),
  19127. (n.prototype.animateOpen = function (e) {
  19128. if (this.state === I.OPENING) {
  19129. if (
  19130. (c.cancel(this.animationTransition), u.detectSamsungNative())
  19131. )
  19132. return (
  19133. (this.boardOrientation = null),
  19134. (this.div.style.visibility = "visible"),
  19135. this.emit(d.OPENED),
  19136. (this.state = I.OPEN),
  19137. void (e && e())
  19138. );
  19139. (this.div.style.webkitTransform = "scale(0)"),
  19140. (this.div.style.transform = "scale(0)"),
  19141. (this.div.style.visibility = "visible"),
  19142. (this.animationTransition = c.start(
  19143. h.property(this, "animationScale", 1),
  19144. m.animation.openDuration,
  19145. function () {
  19146. this.emit(d.OPENED), (this.state = I.OPEN), e && e();
  19147. }.bind(this)
  19148. ));
  19149. }
  19150. }),
  19151. (n.prototype.animateClose = function (e) {
  19152. this.state === I.CLOSING &&
  19153. (c.cancel(this.animationTransition),
  19154. (this.animationTransition = c.start(
  19155. h.property(this, "animationScale", 0),
  19156. m.animation.closeDuration,
  19157. function () {
  19158. this.emit(d.CLOSED),
  19159. (this.state = I.CLOSED),
  19160. (this.div.style.visibility = "hidden"),
  19161. this.div.classList.contains("has-hotzone") ||
  19162. this.div.classList.add("has-hotzone"),
  19163. e && e();
  19164. }.bind(this)
  19165. )));
  19166. }),
  19167. (n.prototype.needsUpdate = function () {
  19168. return this.state !== I.CLOSED;
  19169. }),
  19170. (n.prototype.update = function (e, t) {
  19171. if (this.needsUpdate()) {
  19172. var i = (this.updateOrientation(e), this.calcScale(t)),
  19173. n = {
  19174. x: ((e.x + 1) * $("#player").width()) / 2,
  19175. y: ((e.y + 1) * $("#player").height()) / 2,
  19176. };
  19177. (this.div.screenTransform =
  19178. this.initialTransform +
  19179. " translate(" +
  19180. n.x +
  19181. "px, " +
  19182. n.y +
  19183. "px) scale(" +
  19184. i * this.animationScale +
  19185. ")"),
  19186. (this.div.style.webkitTransform = this.div.screenTransform),
  19187. (this.div.style.transform = this.div.screenTransform);
  19188. }
  19189. }),
  19190. (n.prototype.getDimensions = function () {
  19191. return this.div.getBoundingClientRect();
  19192. }),
  19193. (n.prototype.calcScale = function (e) {
  19194. return Math.sqrt(e / 40) * m.boardToDiscRatio;
  19195. }),
  19196. (n.prototype.updateOrientation = function (e) {
  19197. if (this.state !== I.ACTIVE) {
  19198. var t = 1 / 3,
  19199. i = e.y < -t ? 0 : e.y < t ? 1 : 2,
  19200. n = e.x < -t ? 0 : e.x < t ? 1 : 2,
  19201. r = "";
  19202. (r += 0 === n ? "right" : 2 === n ? "left" : ""),
  19203. (r += 0 === i ? "-down" : 2 === i ? "-up" : ""),
  19204. 1 === n &&
  19205. ((r = 0 === i ? "bottom" : 2 === i ? "top" : ""),
  19206. 1 === i &&
  19207. (r =
  19208. $("#player").width() > $("#player").height()
  19209. ? e.x < 0
  19210. ? "right"
  19211. : "left"
  19212. : e.y < 0
  19213. ? "bottom"
  19214. : "top")),
  19215. (1 === n && 1 === i && r === this.orientation) ||
  19216. this.applyOrientation(r);
  19217. }
  19218. }),
  19219. (n.prototype.applyOrientation = function (e) {
  19220. (this.div.style.transform = this.div.style.webkitTransform = ""),
  19221. this.div.classList.remove("tag-container-" + this.orientation),
  19222. this.div.classList.add("tag-container-" + e);
  19223. var t = window.getComputedStyle(this.div);
  19224. (this.initialTransform = t.transform || t.webkitTransform),
  19225. "none" === this.initialTransform &&
  19226. (this.initialTransform = "");
  19227. var i = t.transform.slice(7, -1).split(","),
  19228. n = -i[4],
  19229. r = -i[5];
  19230. (this.div.style.webkitTransformOrigin = n + "px " + r + "px"),
  19231. (this.div.style.transformOrigin = n + "px " + r + "px"),
  19232. (this.orientation = e);
  19233. }),
  19234. (t.exports = n);
  19235. }).call(this, "/js/tag/Billboard/Billboard.js");
  19236. },
  19237. {
  19238. "../../util/browser": 182,
  19239. "../../util/lerp": 188,
  19240. "../../util/logger": 189,
  19241. "../../util/transitions": 195,
  19242. "../Media/EmbedlyEmbed": 125,
  19243. "../Media/EmbedlyPlayer": 126,
  19244. "../Media/Image": 128,
  19245. "../Media/Link": 129,
  19246. "../Media/MediaEvent": 131,
  19247. "../Parser/DescriptionChunkType": 133,
  19248. "../Parser/DescriptionParser": 134,
  19249. "./BillboardEvent": 120,
  19250. "./billboardSettings": 121,
  19251. "./overlaySettings": 122,
  19252. events: 202,
  19253. },
  19254. ],
  19255. 120: [
  19256. function (e, t, i) {
  19257. "use strict";
  19258. t.exports = Object.freeze({
  19259. ENTER: "billboard.enter",
  19260. LEAVE: "billboard.leave",
  19261. OPENING: "billboard.opening",
  19262. OPENED: "billboard.open",
  19263. CLOSING: "billboard.closing",
  19264. CLOSED: "billboard.closed",
  19265. ACTIVATING: "billboard.activating",
  19266. ACTIVATE: "billboard.activate",
  19267. });
  19268. },
  19269. {},
  19270. ],
  19271. 121: [
  19272. function (e, t, i) {
  19273. "use strict";
  19274. t.exports = Object.freeze({
  19275. animation: Object.freeze({
  19276. hoverOnClosing: !1,
  19277. openDelay: 100,
  19278. closeDelay: 50,
  19279. openDuration: 200,
  19280. closeDuration: 100,
  19281. }),
  19282. boardToDiscRatio: 1.2,
  19283. });
  19284. },
  19285. {},
  19286. ],
  19287. 122: [
  19288. function (e, t, i) {
  19289. "use strict";
  19290. t.exports = Object.freeze({
  19291. boundaryWidth: 30,
  19292. boundaryHeight: 0,
  19293. });
  19294. },
  19295. {},
  19296. ],
  19297. 123: [
  19298. function (e, t, i) {
  19299. //tag
  19300. (function (i) {
  19301. "use strict";
  19302. function n(e, t, i) {
  19303. var n = i.version || "0";
  19304. "0" !== n && I.info("tag defined using version " + n),
  19305. (this.model = e),
  19306. (this.sid = t),
  19307. (this.color = new r.Color().set(i.color || l.tagDefault)),
  19308. (this.hoverColor = l._darken(this.color, 0.2)),
  19309. (this.floor = null),
  19310. (this.floorIndex = i.floor),
  19311. (this.mode = s.PANORAMA),
  19312. i.preferred_camera &&
  19313. i.preferred_camera.mode &&
  19314. (this.mode = i.preferred_camera.mode),
  19315. (this.obj3d = null),
  19316. (this.disc = null),
  19317. (this.materials = {
  19318. disc: null,
  19319. pole: null,
  19320. }),
  19321. (this.position = new r.Vector3().copy(i.position)),
  19322. (this.discPosition = new r.Vector3().copy(i.stem.direction)),
  19323. (this.discWorldPosition = null),
  19324. (this.discScale = 0.05),
  19325. (this.poleEnabled = i.stem.enabled),
  19326. (this.billboard = new o(i.label, i.description, i.media, this)),
  19327. (this.visibleTransition = null),
  19328. (this.hoveringDisc = !1);
  19329. }
  19330. var r = e("three"),
  19331. o = e("./Billboard/Billboard"),
  19332. a = e("../settings"),
  19333. s = e("../enum/Viewmode"),
  19334. l = e("../enum/Colors"),
  19335. c = e("../enum/RenderLayers"),
  19336. h = e("../enum/RenderOrder"),
  19337. u = (e("../util/common"), e("../util/math")),
  19338. d = e("../util/texture"),
  19339. p = e("../objects/Panorama"),
  19340. f = e("../shaders"),
  19341. g = e("../util/transitions"),
  19342. m = e("../util/lerp"),
  19343. v = e("../util/easing"),
  19344. A = e("./Billboard/BillboardEvent"),
  19345. y = e("events").EventEmitter,
  19346. C = e("../util/logger"),
  19347. I = new C(i),
  19348. E = d.loadBase64(
  19349. "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=="
  19350. ),
  19351. b = d.loadBase64(
  19352. "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"
  19353. ),
  19354. w = new r.PlaneBufferGeometry(1, 1);
  19355. (n.prototype = Object.create(y.prototype)),
  19356. (n.raycaster = new r.Raycaster()),
  19357. (n.prototype.bindEvents = function () {
  19358. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  19359. this.billboard.on(A.LEAVE, this.setFreeState.bind(this));
  19360. }),
  19361. (n.prototype.build = function () {
  19362. return (
  19363. (this.floor =
  19364. this.model.floors.get(this.floorIndex) ||
  19365. this.model.floors.first()),
  19366. this.floor &&
  19367. (this.billboard.build(this.model.sid),
  19368. (this.obj3d = this.buildObject3D()),
  19369. this.floor.add(this.obj3d)),
  19370. this
  19371. );
  19372. }),
  19373. (n.prototype.buildObject3D = function () {
  19374. var e = new r.Object3D();
  19375. e.position.copy(this.position);
  19376. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  19377. (t.bg.value = b),
  19378. (t.mask.value = E),
  19379. t.color.value.copy(this.color),
  19380. (this.materials.disc = new r.RawShaderMaterial({
  19381. transparent: !0,
  19382. vertexShader: f.tagDisc.vertexShader,
  19383. fragmentShader: f.tagDisc.fragmentShader,
  19384. uniforms: t,
  19385. })),
  19386. (this.disc = new r.Mesh(w, this.materials.disc)),
  19387. this.disc.layers.set(c.TAG),
  19388. this.disc.position.copy(this.discPosition),
  19389. (this.disc.renderOrder = h.tagDisc),
  19390. (this.disc.tag = this);
  19391. var i = this.buildPole();
  19392. return (
  19393. i.layers.set(c.TAG),
  19394. (i.renderOrder = h.tagStem),
  19395. e.add(i),
  19396. e.layers.set(c.TAG),
  19397. e.add(this.disc)
  19398. );
  19399. }),
  19400. (n.prototype.buildPole = function () {
  19401. var e = new r.BufferGeometry(),
  19402. t = new Float32Array(6);
  19403. return (
  19404. (t[0] = t[1] = t[2] = 0),
  19405. (t[3] = this.discPosition.x),
  19406. (t[4] = this.discPosition.y),
  19407. (t[5] = this.discPosition.z),
  19408. e.addAttribute("position", new r.BufferAttribute(t, 3)),
  19409. (this.materials.pole = new r.LineBasicMaterial({
  19410. linewidth: a.tags.pole.width,
  19411. color: a.tags.pole.color,
  19412. opacity: 0,
  19413. visible: this.poleEnabled,
  19414. transparent: !0,
  19415. depthWrite: !1,
  19416. })),
  19417. new r.Line(e, this.materials.pole)
  19418. );
  19419. }),
  19420. (n.prototype.setFreeState = function (e) {
  19421. (!e && this.hoveringDisc) ||
  19422. this.billboard.close(e).then(
  19423. function () {
  19424. this.materials.disc.uniforms.color.value = this.color;
  19425. }.bind(this)
  19426. );
  19427. }),
  19428. (n.prototype.setHoverState = function (e) {
  19429. this.billboard.open(e),
  19430. (this.materials.disc.uniforms.color.value = this.hoverColor);
  19431. }),
  19432. (n.prototype.hide = function (e, t) {
  19433. var i = $.Deferred();
  19434. if (
  19435. 0 === this.materials.disc.uniforms.opacity.value &&
  19436. !g.isRunning(this.visibleTransition)
  19437. )
  19438. return i.resolve().promise();
  19439. (e = e || 0), (t = t || 0), g.cancel(this.visibleTransition);
  19440. var n =
  19441. this.materials.disc.uniforms.opacity.value /
  19442. a.tags.disc.opacity,
  19443. r = t + e,
  19444. o = t / r;
  19445. return (
  19446. (this.visibleTransition = g.start(
  19447. (function (e) {
  19448. var t = m.property(
  19449. e.materials.disc.uniforms.opacity,
  19450. "value",
  19451. 0
  19452. ),
  19453. i = m.property(e.materials.pole, "opacity", 0);
  19454. return function (n) {
  19455. t(n), e.materials.pole && i(n);
  19456. };
  19457. })(this),
  19458. r * n,
  19459. function () {
  19460. i.resolve();
  19461. },
  19462. o,
  19463. v[a.warp.blendEasing]
  19464. )),
  19465. i.promise()
  19466. );
  19467. }),
  19468. (n.prototype.show = function (e, t) {
  19469. var i = $.Deferred();
  19470. if (
  19471. this.materials.disc.uniforms.opacity.value ===
  19472. a.tags.disc.opacity &&
  19473. !g.isRunning(this.visibleTransition)
  19474. )
  19475. return i.resolve().promise();
  19476. (e = e || 0), (t = t || 0), g.cancel(this.visibleTransition);
  19477. var n =
  19478. (a.tags.disc.opacity -
  19479. this.materials.disc.uniforms.opacity.value) /
  19480. a.tags.disc.opacity,
  19481. r = t + e,
  19482. o = t / r;
  19483. return (
  19484. (this.visibleTransition = g.start(
  19485. (function (e) {
  19486. var t = m.property(
  19487. e.materials.disc.uniforms.opacity,
  19488. "value",
  19489. a.tags.disc.opacity
  19490. ),
  19491. i = m.property(
  19492. e.materials.pole,
  19493. "opacity",
  19494. a.tags.pole.opacity
  19495. );
  19496. return function (n) {
  19497. t(n), e.materials.pole && i(n);
  19498. };
  19499. })(this),
  19500. r * n,
  19501. function () {
  19502. i.resolve();
  19503. },
  19504. o,
  19505. v[a.warp.blendEasing]
  19506. )),
  19507. i.promise()
  19508. );
  19509. }),
  19510. (n.prototype.closestPanoTowardTag = function (e, t) {
  19511. var i = [],
  19512. o = [],
  19513. l = this.disc.getWorldPosition();
  19514. if (e === s.PANORAMA) {
  19515. var c = 0.5,
  19516. h = t.position.clone().sub(l).normalize();
  19517. i.push(p.filters.isPanoAligned()),
  19518. i.push(p.filters.isNeighbourPanoTo(t)),
  19519. i.push(p.filters.inPanoDirection(l, h, c)),
  19520. o.push(p.scoreFunctions.direction(l, h));
  19521. }
  19522. var u = new r.Vector3(),
  19523. d = function (e) {
  19524. u.copy(l).sub(e.position);
  19525. var t = -r.Math.radToDeg(
  19526. Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z))
  19527. ),
  19528. i = a.tags.navigate.tiltTolerance;
  19529. return (
  19530. a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  19531. );
  19532. },
  19533. f = function (e) {
  19534. return (
  19535. Math.abs(e.position.x - l.x) >
  19536. a.tags.visibility.cameraClearance ||
  19537. Math.abs(e.position.z - l.z) >
  19538. a.tags.visibility.cameraClearance
  19539. );
  19540. };
  19541. i.push(f, d), o.push(p.scoreFunctions.distanceSquared(this, -2));
  19542. var g = this.model.panos.sortByScore(i, o);
  19543. if (a.tags.navigate.lineOfSight) {
  19544. for (var m = 0; m < g.length; m++) {
  19545. var v = g[m].item,
  19546. A = v.position.distanceTo(l);
  19547. if (
  19548. !a.tags.visibility.anyDistance &&
  19549. A > a.tags.visibility.visibleDistance
  19550. )
  19551. return null;
  19552. n.raycaster.set(
  19553. v.position,
  19554. l.clone().sub(v.position).normalize()
  19555. );
  19556. var y = n.raycaster.intersectObjects(this.model.colliders);
  19557. if (0 === y.length || y[0].distance > A) return v;
  19558. }
  19559. return null;
  19560. }
  19561. return g.length > 0 && g[0].item;
  19562. }),
  19563. (n.prototype.examine = function (e) {
  19564. var t = e.mode,
  19565. i =
  19566. (a.tags.navigate.nearestPano &&
  19567. this.closestPanoTowardTag(t, e.currentPano)) ||
  19568. e.currentPano,
  19569. n = this.disc.getWorldPosition();
  19570. this.billboard.setActiveState();
  19571. var o = function () {
  19572. var t = this.billboard.getDimensions(),
  19573. n = new r.Vector3();
  19574. u.convertScreenPositionToNDC(
  19575. t.left + t.width / 2,
  19576. t.top + t.height / 2,
  19577. n
  19578. ),
  19579. n.unproject(e.camera),
  19580. e.flyToPano({
  19581. pano: i,
  19582. lookAtPoint: n,
  19583. });
  19584. }.bind(this);
  19585. if (t === s.PANORAMA)
  19586. if (i !== e.currentPano) {
  19587. var l = {
  19588. pano: i,
  19589. lookAtPoint: n,
  19590. duration: null,
  19591. maxDistanceOverride: null,
  19592. skipWarpingCheck: !1,
  19593. };
  19594. e.flyToPano(l, o);
  19595. } else
  19596. setTimeout(
  19597. function () {
  19598. this.billboard.open().then(function () {
  19599. o();
  19600. });
  19601. }.bind(this),
  19602. 0
  19603. );
  19604. else {
  19605. var c = {
  19606. pano: i,
  19607. };
  19608. if (n) {
  19609. var h = new r.Matrix4().lookAt(
  19610. i.position,
  19611. n,
  19612. new r.Vector3(0, 1, 0)
  19613. );
  19614. c.quaternion = new r.Quaternion().setFromRotationMatrix(h);
  19615. }
  19616. (c.callback = o),
  19617. (c.duration = 1500),
  19618. (c.mode = s.PANORAMA),
  19619. e.flyToNewMode(c);
  19620. }
  19621. }),
  19622. (n.prototype.update = (function (e, t) {
  19623. var i = new r.Vector3();
  19624. return function (e, t) {
  19625. (this.discWorldPosition = this.disc.getWorldPosition()),
  19626. this.updateDisc(e, t),
  19627. this.billboard.needsUpdate() &&
  19628. (i.copy(this.discWorldPosition).project(t),
  19629. i.z < 1 &&
  19630. ((i.y *= -1),
  19631. this.billboard.update(i, this.getDiscRadius(i, t))));
  19632. };
  19633. })()),
  19634. (n.prototype.updateDisc = (function (e, t) {
  19635. var i = new r.Vector3(),
  19636. o = new r.Vector3(),
  19637. l = new r.Vector3(),
  19638. c = new r.Vector3(),
  19639. h = new r.Vector3();
  19640. return function (e, t) {
  19641. var u = a.tags.visibility,
  19642. d = a.tags.disc.scale,
  19643. p =
  19644. e === s.DOLLHOUSE || e === s.FLOORPLAN
  19645. ? a.tags.visibility.visibleDistance
  19646. : t.position.distanceTo(this.discWorldPosition);
  19647. if (
  19648. ((this.obj3d.visible =
  19649. 0 !== this.disc.material.opacity &&
  19650. (u.anyDistance ||
  19651. p <= u.visibleDistance ||
  19652. e === s.TRANSITIONING) &&
  19653. (!u.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) &&
  19654. (!u.hideOffScreenDisc || !this.offScreen(this.disc, t)) &&
  19655. (!u.hideOffScreenObject || !this.offScreen(this.obj3d, t))),
  19656. this.obj3d.visible)
  19657. ) {
  19658. this.disc.quaternion.copy(t.quaternion);
  19659. var f =
  19660. d.maxSize -
  19661. (d.maxSize - d.minSize) *
  19662. r.Math.smoothstep(p, d.nearBound, d.farBound);
  19663. i.copy(this.discWorldPosition).project(t),
  19664. o
  19665. .set(
  19666. $("#player").width() / 2,
  19667. $("#player").height() / 2,
  19668. 1
  19669. )
  19670. .multiply(i),
  19671. l.set(f / 2, 0, 0).add(o),
  19672. c
  19673. .set(
  19674. 2 / $("#player").width(),
  19675. 2 / $("#player").height(),
  19676. 1
  19677. )
  19678. .multiply(l),
  19679. h.copy(c).unproject(t);
  19680. var g = h.distanceTo(this.discWorldPosition),
  19681. m =
  19682. 1 +
  19683. (a.tags.disc.scale.responsiveness / 100) *
  19684. (n.viewportScale() - 1);
  19685. (this.discScale = g * m),
  19686. this.disc.scale.set(
  19687. this.discScale,
  19688. this.discScale,
  19689. this.discScale
  19690. );
  19691. }
  19692. };
  19693. })()),
  19694. (n.prototype.getDiscRadius = (function (e, t) {
  19695. var i = new r.Vector3();
  19696. return function (e, t) {
  19697. return (
  19698. i
  19699. .set(-this.discScale / 2, 0, 0)
  19700. .applyQuaternion(t.quaternion)
  19701. .add(this.discWorldPosition)
  19702. .project(t),
  19703. Math.abs(e.x - i.x) * $("#player").width()
  19704. );
  19705. };
  19706. })()),
  19707. (n.prototype.tagVisibleOnCurrentFloor = function (e) {
  19708. return (
  19709. !(e === s.DOLLHOUSE || e === s.FLOORPLAN) ||
  19710. this.model.allFloorsVisible ||
  19711. !this.floor.hidden
  19712. );
  19713. }),
  19714. (n.prototype.offScreen = function (e, t) {
  19715. var i = e.getWorldPosition().project(t);
  19716. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1);
  19717. }),
  19718. (n.viewportScale = function () {
  19719. return (
  19720. (n.viewportWidth === $("#player").width() &&
  19721. n.viewportHeight === $("#player").height()) ||
  19722. ((n.viewportWidth = $("#player").width()),
  19723. (n.viewportHeight = $("#player").height()),
  19724. (n.currentViewportScale = Math.sqrt(
  19725. Math.min(n.viewportWidth, n.viewportHeight) /
  19726. a.tags.disc.scale.baseViewportSize
  19727. ))),
  19728. n.currentViewportScale
  19729. );
  19730. }),
  19731. (t.exports = n);
  19732. }).call(this, "/js/tag/tag.js");
  19733. },
  19734. {
  19735. "../enum/Colors": 19,
  19736. "../enum/RenderLayers": 41,
  19737. "../enum/RenderOrder": 42,
  19738. "../enum/Viewmode": 51,
  19739. "../objects/Panorama": 148,
  19740. "../settings": 166,
  19741. "../shaders": 167,
  19742. "../util/common": 185,
  19743. "../util/easing": 186,
  19744. "../util/lerp": 188,
  19745. "../util/logger": 189,
  19746. "../util/math": 190,
  19747. "../util/texture": 194,
  19748. "../util/transitions": 195,
  19749. "./Billboard/Billboard": 119,
  19750. "./Billboard/BillboardEvent": 120,
  19751. events: 202,
  19752. three: 217,
  19753. },
  19754. ],
  19755. 124: [
  19756. function (e, t, i) {
  19757. (function (i) {
  19758. "use strict";
  19759. function n() {
  19760. (this.tagState = y.IDLE),
  19761. (this.intersectTag = null),
  19762. (this.hoveredTag = null),
  19763. (this.activeTag = null),
  19764. (this.tagDiscs = []),
  19765. (this.raycaster = new r.Raycaster()),
  19766. (this.modelManager = null),
  19767. (this.player = null),
  19768. (this.totaltags = 0),
  19769. (this.navigatingViaTag = !1),
  19770. (this.enabled = !1);
  19771. }
  19772. var r = e("three"),
  19773. o = e("../util/logger"),
  19774. a = e("../util/common"),
  19775. s = e("../controls/serializer"),
  19776. l = e("../objects/Snapshot"),
  19777. c = e("../settings"),
  19778. h = e("./Billboard/BillboardEvent"),
  19779. u = e("./Media/MediaEvent"),
  19780. d = e("./Media/LinkType"),
  19781. p = e("../enum/Viewmode"),
  19782. f = e("../enum/WarpStyle"),
  19783. g = e("../enum/BlackoutStyle"),
  19784. m = e("../enum/ModelManagerEvents"),
  19785. v = e("../enum/tagEvents"),
  19786. A = e("../enum/PlayerEvents"),
  19787. y = (e("../util/lerp"), e("../enum/TagStates")),
  19788. C = e("events").EventEmitter,
  19789. I = new o(i);
  19790. a.extend(n, C),
  19791. (n.prototype.init = function (e, t) {
  19792. (this.modelManager = e),
  19793. (this.player = t),
  19794. this.updateModel(),
  19795. this.bindEvents();
  19796. }),
  19797. (n.prototype.update = function (e) {
  19798. this.updateTags(
  19799. this.player.mode,
  19800. this.player.camera,
  19801. this.player.currentPano,
  19802. this.player.flying
  19803. );
  19804. }),
  19805. (n.prototype.updateTags = function (e, t, i, n) {
  19806. for (var r in this.model.tags)
  19807. this.model.tags[r].update(e, t, i, n);
  19808. }),
  19809. (n.prototype.updateModel = function () {
  19810. (this.model = this.modelManager.getActiveModel()),
  19811. this.gettagsFromModel(),
  19812. (this.totaltags = Object.keys(this.model.tags).length);
  19813. }),
  19814. (n.prototype.gettagsFromModel = function () {
  19815. this.tagDiscs = [];
  19816. for (var e in this.model.tags) {
  19817. var t = this.model.tags[e].disc;
  19818. t && this.tagDiscs.push(t);
  19819. }
  19820. }),
  19821. (n.prototype.bindEvents = function () {
  19822. function e() {
  19823. Object.keys(this.model.tags).forEach(
  19824. function (e) {
  19825. var t = this.model.tags[e];
  19826. t.bindEvents(),
  19827. t.billboard.on(
  19828. u.LINK_CLICK,
  19829. function (e) {
  19830. e.type === d.NAVIGATION &&
  19831. this.navigateViaLink(e.url);
  19832. }.bind(this)
  19833. ),
  19834. t.billboard.on(
  19835. u.IMAGE_OPENED,
  19836. function () {
  19837. (this.tagState = y.EXAMINE),
  19838. this.emit(u.IMAGE_OPENED);
  19839. }.bind(this)
  19840. ),
  19841. t.billboard.on(
  19842. h.CLOSING,
  19843. this.dismissExaminedTag.bind(this)
  19844. );
  19845. }.bind(this)
  19846. );
  19847. }
  19848. this.modelManager.on(
  19849. m.ActiveModelChanged,
  19850. this.updateModel.bind(this)
  19851. ),
  19852. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  19853. this.player.on(
  19854. A.ModeChanging,
  19855. this.onPlayerModeChanging.bind(this)
  19856. ),
  19857. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  19858. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  19859. this.player.on(
  19860. A.FlyingEnded,
  19861. this.onPlayerFlyingEnded.bind(this)
  19862. ),
  19863. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  19864. this.player.on(
  19865. A.WarpInterrupted,
  19866. this.handleWarpInterruption.bind(this)
  19867. ),
  19868. e.call(this);
  19869. }),
  19870. (n.prototype.navigateViaLink = function (e) {
  19871. var t = s.deserialize(e);
  19872. if (t)
  19873. if (t.mode === p.PANORAMA) {
  19874. try {
  19875. this.player.model.panos.get(t.panoId);
  19876. } catch (e) {
  19877. return void I.warn(
  19878. "Unable to find panorama location",
  19879. t.panoId
  19880. );
  19881. }
  19882. this.player.warpToPanoById(
  19883. t.panoId,
  19884. t.quaternion,
  19885. null,
  19886. null,
  19887. f.BLACK
  19888. );
  19889. } else {
  19890. var i = {
  19891. cameraMode: t.mode,
  19892. position: t.position,
  19893. quaternion: t.quaternion,
  19894. scanId: t.panoId,
  19895. orthoZoom: t.zoom,
  19896. floorVisibility: t.floorVisibility,
  19897. thumbUrl: null,
  19898. name: null,
  19899. };
  19900. this.player.flyToNewMode({
  19901. mode: t.mode,
  19902. duration: c.warp.outsideTime,
  19903. warpDest: new l(i),
  19904. force: !0,
  19905. });
  19906. }
  19907. }),
  19908. (n.prototype.handleWarpStart = function (e, t, i, n) {
  19909. this.dismissExaminedTag(),
  19910. t === f.BLACK &&
  19911. ((null !== n && void 0 !== n) || (n = c.warp.teleportTime),
  19912. e && (i = g.END),
  19913. this.hideShowTagsForBlackoutStyle(i, n));
  19914. }),
  19915. (n.prototype.handleWarpInterruption = function (e, t, i) {
  19916. (null !== i && void 0 !== i) || (i = c.warp.teleportTime),
  19917. this.hideShowTagsForBlackoutStyle(t, i);
  19918. }),
  19919. (n.prototype.hideShowTagsForBlackoutStyle = function (e, t) {
  19920. var i = 0,
  19921. n = 0,
  19922. r = t / 2;
  19923. switch (((null !== e && void 0 !== e) || (e = g.MIDDLE), e)) {
  19924. case g.END:
  19925. this.hideAlltags(r);
  19926. break;
  19927. case g.BEGINNING:
  19928. this.hideAlltags().done(this.showAlltags.bind(this, r));
  19929. break;
  19930. case g.NONE:
  19931. break;
  19932. case g.MIDDLE:
  19933. (i = r),
  19934. (n = r),
  19935. this.hideAlltags(n),
  19936. setTimeout(
  19937. function () {
  19938. this.showAlltags(i);
  19939. }.bind(this),
  19940. n
  19941. );
  19942. break;
  19943. case g.FADEIN:
  19944. setTimeout(
  19945. function () {
  19946. this.showAlltags(r);
  19947. }.bind(this),
  19948. r
  19949. );
  19950. }
  19951. }),
  19952. (n.prototype.onPlayerModeChanging = function (e, t) {
  19953. t !== p.PANORAMA && this.dismissExaminedTag(),
  19954. t === p.PANORAMA &&
  19955. player.currentPano &&
  19956. !player.currentPano.isAligned() &&
  19957. (t = p.OUTDOOR);
  19958. var i = t !== p.OUTDOOR;
  19959. i !== this.model.tagsShown &&
  19960. (i
  19961. ? this.showAlltags(c.tags.startup.fadeInDuration)
  19962. : this.hideAlltags(c.tags.startup.fadeInDuration));
  19963. }),
  19964. (n.prototype.onPanoChange = function (e, t) {
  19965. var i = this.navigatingViaTag;
  19966. if (((this.navigatingViaTag = !1), !i)) {
  19967. this.dismissExaminedTag();
  19968. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA,
  19969. r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  19970. n !== r &&
  19971. (r === p.PANORAMA
  19972. ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0)
  19973. : this.hideAlltags(c.tags.startup.fadeInDuration));
  19974. }
  19975. }),
  19976. (n.prototype.onPlayerReady = function (e, t, i) {
  19977. this.startAlltags(e, t ? i : null);
  19978. }),
  19979. (n.prototype.onPlayerFlyingEnded = function (e, t) {
  19980. this.updateClosestTags(e);
  19981. }),
  19982. (n.prototype.dismissExaminedTag = function () {
  19983. this.activeTag &&
  19984. this.tagState === y.EXAMINE &&
  19985. this.dismissActiveTag(),
  19986. this.hoveredTag &&
  19987. (this.hoveredTag.setFreeState(!0), (this.hoveredTag = null));
  19988. }),
  19989. (n.prototype.startAlltags = function (e, t) {
  19990. (this.model.shouldShowtags = c.tags.enabled),
  19991. (this.enabled = !0),
  19992. e ||
  19993. (this.showAlltags(
  19994. c.tags.startup.fadeInDuration,
  19995. c.tags.startup.fadeInDelay
  19996. ),
  19997. t &&
  19998. setTimeout(
  19999. function () {
  20000. this.activateTag(this.model.getTagBySid(t));
  20001. }.bind(this),
  20002. c.tags.startup.fadeInDuration / 2
  20003. ));
  20004. }),
  20005. (n.prototype.showAlltags = function (e, t, i) {
  20006. function n() {
  20007. o++,
  20008. o === this.totaltags &&
  20009. ((this.model.tagsShown = !0), r.resolve());
  20010. }
  20011. var r = $.Deferred();
  20012. if (
  20013. (!i &&
  20014. this.player.mode === p.PANORAMA &&
  20015. this.player.currentPano &&
  20016. !this.player.currentPano.isAligned()) ||
  20017. !this.model.shouldShowtags
  20018. )
  20019. return r.resolve().promise();
  20020. var o = 0;
  20021. for (var a in this.model.tags) {
  20022. var s = this.model.tags[a];
  20023. s.show(e, t).done(n.bind(this));
  20024. }
  20025. return r.promise();
  20026. }),
  20027. (n.prototype.hideAlltags = function (e, t) {
  20028. function i() {
  20029. r++,
  20030. r === this.totaltags &&
  20031. ((this.model.tagsShown = !1), n.resolve());
  20032. }
  20033. var n = $.Deferred(),
  20034. r = 0;
  20035. for (var o in this.model.tags) {
  20036. var a = this.model.tags[o];
  20037. a.hide(e, t).done(i.bind(this)),
  20038. a === this.activeTag && this.dismissActiveTag();
  20039. }
  20040. return n.promise();
  20041. }),
  20042. (n.prototype.enableHovering = function () {
  20043. this.enabled = !0;
  20044. }),
  20045. (n.prototype.disableHovering = function () {
  20046. this.enabled = !1;
  20047. }),
  20048. (n.prototype.activateTag = function (e, t) {
  20049. (t = t || y.EXAMINE),
  20050. (this.activeTag = e),
  20051. (this.activeTag.hoveringDisc = !0),
  20052. this.activeTag.setHoverState(t === y.EXAMINE),
  20053. (this.tagState = t),
  20054. this.emit(v.TagActivated, e);
  20055. }),
  20056. (n.prototype.dismissActiveTag = function () {
  20057. (this.activeTag.hoveringDisc = !1),
  20058. this.activeTag.setFreeState(!0);
  20059. var e = this.activeTag;
  20060. (this.activeTag = null),
  20061. (this.tagState = y.IDLE),
  20062. this.emit(v.TagDismissed, e);
  20063. }),
  20064. (n.prototype.clickedOnTag = function (e) {
  20065. var t = function () {
  20066. (this.navigatingViaTag = !0),
  20067. this.activeTag.examine(this.player),
  20068. this.emit(v.TagNavigation, this.activeTag);
  20069. }.bind(this);
  20070. return this.tagState !== y.EXAMINE
  20071. ? (this.activateTag(this.intersectTag, y.EXAMINE),
  20072. (this.activeTag = this.intersectTag),
  20073. t(),
  20074. !0)
  20075. : (this.dismissActiveTag(), !1);
  20076. }),
  20077. (n.prototype.intersecttag = (function () {
  20078. var e = new r.Vector3(),
  20079. t = new r.Vector3(),
  20080. i = new r.Vector3();
  20081. return function (n, r, o) {
  20082. if (!this.enabled) return null;
  20083. var a = null,
  20084. s = this.tagDiscs.filter(function (e) {
  20085. return e.parent.visible;
  20086. });
  20087. if (s.length > 0) {
  20088. var l = this.model.floors.reduce(function (e, t) {
  20089. return t.hidden ? e : e.concat(t.collider.children);
  20090. }, s);
  20091. e.set(n.x, n.y, -1).unproject(o),
  20092. t.set(n.x, n.y, 1).unproject(o),
  20093. i.copy(t).sub(e).normalize(),
  20094. this.raycaster.set(e, i);
  20095. var c = this.raycaster.intersectObjects(l);
  20096. c.length > 0 &&
  20097. s.indexOf(c[0].object) !== -1 &&
  20098. (a = c[0].object.tag);
  20099. }
  20100. return (
  20101. (this.intersectTag = a),
  20102. r &&
  20103. (this.activeTag &&
  20104. a !== this.activeTag &&
  20105. (this.tagState === y.BROWSE ||
  20106. (this.tagState === y.EXAMINE && a)) &&
  20107. this.dismissActiveTag(),
  20108. a &&
  20109. a !== this.activeTag &&
  20110. (a.listeners(h.ENTER).length < 1 &&
  20111. (a.billboard.on(
  20112. h.ENTER,
  20113. function () {
  20114. this.hoveredTag = a;
  20115. }.bind(this)
  20116. ),
  20117. a.billboard.on(
  20118. h.LEAVE,
  20119. function () {
  20120. this.hoveredTag = null;
  20121. }.bind(this)
  20122. )),
  20123. this.activateTag(a, y.BROWSE))),
  20124. a
  20125. );
  20126. };
  20127. })()),
  20128. (n.prototype.rankedtagInDirection = (function () {
  20129. var e = [],
  20130. t = [],
  20131. i = new r.Vector3(),
  20132. n = new r.Vector3(),
  20133. o = new r.Vector3();
  20134. return function (r, a, s, l) {
  20135. var c = 0;
  20136. t.length = 0;
  20137. for (var h = 0; h < this.closesttags.length; h++) {
  20138. var u = this.closesttags[h];
  20139. n.copy(u.position),
  20140. n.add(u.discPosition),
  20141. i.copy(a),
  20142. i.sub(n).negate(),
  20143. i.normalize();
  20144. var d = i.dot(l);
  20145. if (d >= 0) {
  20146. o.copy(n), o.project(s);
  20147. var p = this.intersecttag(o, !1, s);
  20148. if (p) {
  20149. if (c >= e.length)
  20150. for (var f = 0; f < 64; f++)
  20151. e.push({
  20152. tag: u,
  20153. dot: d,
  20154. });
  20155. var g = e[c];
  20156. (g.tag = u),
  20157. (g.dot = d),
  20158. (g.position = math.projectPositionToCanvas(n, s)),
  20159. t.push(g),
  20160. c++;
  20161. }
  20162. }
  20163. }
  20164. return (
  20165. t.sort(function (e, t) {
  20166. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0;
  20167. }),
  20168. r < t.length ? t[r].tag : null
  20169. );
  20170. };
  20171. })()),
  20172. (n.prototype.updateClosestTags = (function () {
  20173. var e = new r.Vector3(),
  20174. t = 30;
  20175. return function (i) {
  20176. this.closesttags || (this.closesttags = []),
  20177. (this.closesttags.length = 0);
  20178. var n = this.model.tags;
  20179. if (n)
  20180. for (var r in n)
  20181. if (n.hasOwnProperty(r)) {
  20182. var o = n[r],
  20183. a = o.position;
  20184. e.copy(i), e.sub(a).negate();
  20185. var s = e.lengthSq();
  20186. s < t && this.closesttags.push(o);
  20187. }
  20188. };
  20189. })()),
  20190. (t.exports = n);
  20191. }).call(this, "/js/tag/tagManager.js");
  20192. },
  20193. {
  20194. "../controls/serializer": 14,
  20195. "../enum/BlackoutStyle": 18,
  20196. "../enum/tagEvents": 32,
  20197. "../enum/ModelManagerEvents": 33,
  20198. "../enum/PlayerEvents": 40,
  20199. "../enum/TagStates": 44,
  20200. "../enum/Viewmode": 51,
  20201. "../enum/WarpStyle": 52,
  20202. "../objects/Snapshot": 153,
  20203. "../settings": 166,
  20204. "../util/common": 185,
  20205. "../util/lerp": 188,
  20206. "../util/logger": 189,
  20207. "./Billboard/BillboardEvent": 120,
  20208. "./Media/LinkType": 130,
  20209. "./Media/MediaEvent": 131,
  20210. events: 202,
  20211. three: 217,
  20212. },
  20213. ],
  20214. 125: [
  20215. function (e, t, i) {
  20216. (function (i) {
  20217. "use strict";
  20218. function n() {
  20219. (this.embedWrapper = null), (this.embedElement = null);
  20220. }
  20221. var r = e("../../util/ajax"),
  20222. o = e("./mediaSettings"),
  20223. a = e("../../settings"),
  20224. s = e("../../util/logger"),
  20225. l = new s(i);
  20226. (n.prototype.createDomElement = function () {
  20227. return (
  20228. (this.embedWrapper = document.createElement("div")),
  20229. this.embedWrapper.classList.add("tag-embed"),
  20230. this.embedWrapper.classList.add("hidden"),
  20231. this.embedWrapper
  20232. );
  20233. }),
  20234. (n.prototype.load = function (e) {
  20235. var t =
  20236. "https://api.embedly.com/1/oembed?key=" +
  20237. a.appConfig.embedly_key +
  20238. "&url=" +
  20239. encodeURIComponent(e) +
  20240. "&maxwidth=" +
  20241. o.maxEmbedWidth;
  20242. return new Promise(
  20243. function (e, i) {
  20244. r.get(t).then(
  20245. function (t) {
  20246. if (
  20247. ((t = JSON.parse(t)),
  20248. t.html && t.html.indexOf("<script") === -1)
  20249. ) {
  20250. this.embedWrapper.innerHTML = t.html;
  20251. var n =
  20252. Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  20253. if (
  20254. ((this.embedWrapper.style.width = n + "px"), t.height)
  20255. ) {
  20256. var r = t.height / t.width;
  20257. this.embedWrapper.style.height = n * r + "px";
  20258. }
  20259. this.embedElement = this.embedWrapper.firstChild;
  20260. var a = [];
  20261. try {
  20262. a = [].slice.call(
  20263. this.embedElement.querySelectorAll("a")
  20264. );
  20265. } catch (e) {
  20266. l.debug(
  20267. "Error getting `a` elements for embed; was it an iframe?"
  20268. );
  20269. }
  20270. a.forEach(function (e) {
  20271. e.setAttribute("target", "_blank");
  20272. }),
  20273. this.embedElement.classList.add("hidden"),
  20274. this.embedWrapper.classList.remove("hidden"),
  20275. e();
  20276. } else i("Not a valid embed");
  20277. }.bind(this),
  20278. function (e) {
  20279. i(e.response);
  20280. }
  20281. );
  20282. }.bind(this)
  20283. );
  20284. }),
  20285. (n.prototype.show = function () {
  20286. this.embedElement && this.embedElement.classList.remove("hidden");
  20287. }),
  20288. (n.prototype.hide = function () {
  20289. this.embedElement && this.embedElement.classList.add("hidden");
  20290. }),
  20291. (t.exports = n);
  20292. }).call(this, "/js/tag/Media/EmbedlyEmbed.js");
  20293. },
  20294. {
  20295. "../../settings": 166,
  20296. "../../util/ajax": 181,
  20297. "../../util/logger": 189,
  20298. "./mediaSettings": 132,
  20299. },
  20300. ],
  20301. 126: [
  20302. function (e, t, i) {
  20303. (function (i) {
  20304. "use strict";
  20305. function n(e) {
  20306. o.call(this),
  20307. (this.options = e),
  20308. (this.playerControls = null),
  20309. (this.state = s.NOT_READY);
  20310. }
  20311. var r = e("../../util/browser"),
  20312. o = e("./EmbedlyEmbed"),
  20313. a = e("../../util/logger"),
  20314. s =
  20315. (new a(i),
  20316. Object.freeze({
  20317. NOT_READY: "player.not.ready",
  20318. CUED: "player.cued",
  20319. PLAYING: "player.playing",
  20320. PAUSED: "player.paused",
  20321. }));
  20322. (n.prototype = Object.create(o.prototype)),
  20323. (n.prototype.createDomElement = function () {
  20324. return (
  20325. (this.embedWrapper = document.createElement("div")),
  20326. this.embedWrapper.classList.add("tag-video"),
  20327. this.embedWrapper.classList.add("hidden"),
  20328. this.embedWrapper
  20329. );
  20330. }),
  20331. (n.prototype.load = function (e) {
  20332. var t = function () {
  20333. function e(e) {
  20334. (this.playerState = s.CUED),
  20335. this.options.startMuted && this.playerControls.mute();
  20336. }
  20337. function t(e) {
  20338. this.playerState = e;
  20339. }
  20340. function i(e) {
  20341. this.playerControls.setCurrentTime(0),
  20342. this.options.loop
  20343. ? this.playerControls.play()
  20344. : this.playerControls.pause();
  20345. }
  20346. (this.playerControls = new playerjs.Player(this.embedElement)),
  20347. this.playerControls.on("ready", e.bind(this)),
  20348. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  20349. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  20350. this.playerControls.on("ended", i.bind(this));
  20351. }.bind(this);
  20352. return o.prototype.load.call(this, e).then(t.bind(this));
  20353. }),
  20354. (n.prototype.play = (function () {
  20355. var e = r.isMobile();
  20356. return function () {
  20357. this.playerState !== s.NOT_READY &&
  20358. this.playerControls &&
  20359. !e &&
  20360. ((this.state === s.CUED && this.options.autoPlay) ||
  20361. this.options.autoResume) &&
  20362. this.playerControls.play();
  20363. };
  20364. })()),
  20365. (n.prototype.pause = function () {
  20366. this.playerState !== s.NOT_READY &&
  20367. this.playerControls &&
  20368. this.playerControls.pause();
  20369. }),
  20370. (t.exports = n);
  20371. }).call(this, "/js/tag/Media/EmbedlyPlayer.js");
  20372. },
  20373. {
  20374. "../../util/browser": 182,
  20375. "../../util/logger": 189,
  20376. "./EmbedlyEmbed": 125,
  20377. },
  20378. ],
  20379. 127: [
  20380. function (e, t, i) {
  20381. (function (i) {
  20382. "use strict";
  20383. function n(e) {
  20384. function t() {
  20385. return (
  20386. a.debug("requesting file from embedly:", e.href),
  20387. r
  20388. .get(e.href, {
  20389. responseType: e.responseType,
  20390. })
  20391. .then(function (t) {
  20392. return a.debug("requesting file finished:", e.href), t;
  20393. })
  20394. );
  20395. }
  20396. function i() {}
  20397. return (s = new Promise(function (e, n) {
  20398. s.catch(i).then(function () {
  20399. t().then(e, n);
  20400. });
  20401. }));
  20402. }
  20403. var r = e("../../util/ajax"),
  20404. o = (e("./mediaSettings"), e("../../util/logger")),
  20405. a = new o(i),
  20406. s = Promise.resolve();
  20407. t.exports.enqueue = n;
  20408. }).call(this, "/js/tag/Media/EmbedlyQueue.js");
  20409. },
  20410. {
  20411. "../../util/ajax": 181,
  20412. "../../util/logger": 189,
  20413. "./mediaSettings": 132,
  20414. },
  20415. ],
  20416. 128: [
  20417. function (e, t, i) {
  20418. (function (i) {
  20419. "use strict";
  20420. function n() {
  20421. (this.imageWrapper = null),
  20422. (this.width = 0),
  20423. (this.height = 0),
  20424. (this.aspect = 1);
  20425. }
  20426. var r = e("./MediaEvent"),
  20427. o = e("./EmbedlyQueue"),
  20428. a = e("events").EventEmitter,
  20429. s = e("../../util/logger"),
  20430. l = e("../../settings");
  20431. new s(i);
  20432. (n.prototype = Object.create(a.prototype)),
  20433. (n.prototype.createDomElement = function () {
  20434. return (
  20435. (this.imageWrapper = document.createElement("div")),
  20436. this.imageWrapper.classList.add("tag-image"),
  20437. this.imageWrapper.classList.add("hidden"),
  20438. this.imageWrapper.addEventListener(
  20439. "click",
  20440. function (e) {
  20441. e.stopPropagation(),
  20442. this.emit(r.IMAGE_OPENING),
  20443. (this.imageWrapper.style.pointerEvents = "none");
  20444. }.bind(this)
  20445. ),
  20446. this.imageWrapper
  20447. );
  20448. }),
  20449. (n.prototype.onClosed = function () {
  20450. this.imageWrapper.style.pointerEvents = "auto";
  20451. }),
  20452. (n.prototype.load = function (e) {
  20453. var t = Math.max(window.screen.height, window.screen.width),
  20454. i =
  20455. "https://i.embed.ly/1/display/resize?key=" +
  20456. l.appConfig.embedly_key +
  20457. "&url=" +
  20458. encodeURIComponent(e) +
  20459. "&width=" +
  20460. t +
  20461. "&height=" +
  20462. t;
  20463. return new Promise(
  20464. function (e, t) {
  20465. function n(t) {
  20466. var i = t.target;
  20467. (this.width = i.naturalWidth),
  20468. (this.height = i.naturalHeight),
  20469. (this.aspect = this.width / this.height);
  20470. var n = t.target.src;
  20471. (this.imageWrapper.style.backgroundImage =
  20472. 'url("' + n + '")'),
  20473. (this.imageWrapper.style.width = this.width + "px"),
  20474. (this.imageWrapper.style.height = this.height + "px"),
  20475. this.imageWrapper.classList.remove("hidden"),
  20476. e();
  20477. }
  20478. o.enqueue({
  20479. href: i,
  20480. responseType: "arraybuffer",
  20481. }).then(
  20482. function (e) {
  20483. var t = new Uint8Array(e),
  20484. i = new Blob([t]),
  20485. r = new window.Image();
  20486. r.addEventListener("load", n.bind(this));
  20487. var o = URL.createObjectURL(i);
  20488. r.src = o;
  20489. }.bind(this),
  20490. t
  20491. );
  20492. }.bind(this)
  20493. );
  20494. }),
  20495. (t.exports = n);
  20496. }).call(this, "/js/tag/Media/Image.js");
  20497. },
  20498. {
  20499. "../../settings": 166,
  20500. "../../util/logger": 189,
  20501. "./EmbedlyQueue": 127,
  20502. "./MediaEvent": 131,
  20503. events: 202,
  20504. },
  20505. ],
  20506. 129: [
  20507. function (e, t, i) {
  20508. "use strict";
  20509. function n(e) {
  20510. (this.label = e.label),
  20511. (this.href = e.url),
  20512. (this.type = this.updateLinkForType()),
  20513. (this.domElement = null),
  20514. (this.id = c++);
  20515. }
  20516. var r = e("./LinkType"),
  20517. o = e("./MediaEvent"),
  20518. a = e("../../util/browser"),
  20519. s = e("../../analytics"),
  20520. l = e("events").EventEmitter,
  20521. c = 0;
  20522. (n.prototype = Object.create(l.prototype)),
  20523. (n.prototype.updateLinkForType = function () {
  20524. function e(e) {
  20525. var t = new RegExp("[#&?]start=([^#&?]*)"),
  20526. i = t.exec(e);
  20527. return i[1];
  20528. }
  20529. function t(e) {
  20530. return e + "&play=1";
  20531. }
  20532. var i = a.valueFromHash("m") || a.valueFromHash("model");
  20533. return this.href.indexOf("port.com/show") !== -1 ||
  20534. this.href.indexOf(window.location.host + "/show") !== -1
  20535. ? this.href.indexOf(i) !== -1 &&
  20536. this.href.indexOf("start=") !== -1
  20537. ? ((this.href = e(this.href)), r.NAVIGATION)
  20538. : ((this.href = t(this.href)), r.MODEL)
  20539. : r.EXT_LINK;
  20540. });
  20541. var h = {};
  20542. (n.prototype.createDomElement = function () {
  20543. function e(e) {
  20544. switch (
  20545. (e.stopPropagation(),
  20546. (h[this.id] = !0),
  20547. s.trackAlways("click_tag_link", {
  20548. link_type: this.type,
  20549. link_count: c,
  20550. links_clicked: Object.keys(h).length,
  20551. }),
  20552. this.type)
  20553. ) {
  20554. case r.MODEL:
  20555. window.location.replace(this.href);
  20556. break;
  20557. case r.EXT_LINK:
  20558. window.open(this.href, "_blank");
  20559. }
  20560. this.emit(o.LINK_CLICK, {
  20561. type: this.type,
  20562. url: this.href,
  20563. });
  20564. }
  20565. if (
  20566. ((this.domElement = document.createElement("a")),
  20567. this.domElement.classList.add("tag-link"),
  20568. (this.domElement.textContent = this.label),
  20569. this.type === r.EXT_LINK)
  20570. ) {
  20571. this.domElement.textContent += " ";
  20572. var t = document.createElement("i");
  20573. t.classList.add("icon-ext-link"),
  20574. (t.title = "Link to external web site"),
  20575. this.domElement.appendChild(t);
  20576. }
  20577. return (
  20578. this.domElement.addEventListener("click", e.bind(this)),
  20579. this.domElement
  20580. );
  20581. }),
  20582. (t.exports = n);
  20583. },
  20584. {
  20585. "../../analytics": 4,
  20586. "../../util/browser": 182,
  20587. "./LinkType": 130,
  20588. "./MediaEvent": 131,
  20589. events: 202,
  20590. },
  20591. ],
  20592. 130: [
  20593. function (e, t, i) {
  20594. "use strict";
  20595. t.exports = {
  20596. NAVIGATION: "navigation",
  20597. MODEL: "model",
  20598. EXT_LINK: "ext-link",
  20599. };
  20600. },
  20601. {},
  20602. ],
  20603. 131: [
  20604. function (e, t, i) {
  20605. "use strict";
  20606. t.exports = Object.freeze({
  20607. LINK_CLICK: "mtmedia.link",
  20608. IMAGE_LOADED: "mtmedia.image.loaded",
  20609. IMAGE_OPENING: "mtmedia.image.opening",
  20610. IMAGE_OPENED: "mtmedia.image.opened",
  20611. IMAGE_CLOSING: "mtmedia.image.closing",
  20612. IMAGE_CLOSED: "mtmedia.image.closed",
  20613. VIDEO_START: "mtmedia.video.start",
  20614. VIDEO_PAUSE: "mtmedia.video.pause",
  20615. VIDEO_ENDED: "mtmedia.video.end",
  20616. });
  20617. },
  20618. {},
  20619. ],
  20620. 132: [
  20621. function (e, t, i) {
  20622. "use strict";
  20623. t.exports = Object.freeze({
  20624. maxEmbedWidth: 350,
  20625. defaultAspectRatio: 0.75,
  20626. });
  20627. },
  20628. {},
  20629. ],
  20630. 133: [
  20631. function (e, t, i) {
  20632. "use strict";
  20633. t.exports = Object.freeze({
  20634. TEXT: "text",
  20635. LINK: "link",
  20636. IMAGE: "photo",
  20637. VIDEO: "video",
  20638. RICH: "rich",
  20639. });
  20640. },
  20641. {},
  20642. ],
  20643. 134: [
  20644. function (e, t, i) {
  20645. "use strict";
  20646. function n(e) {
  20647. this.capabilities = {
  20648. links: {
  20649. enable: e.supportLinks,
  20650. keepLabels: e.keepLinkLabels,
  20651. },
  20652. };
  20653. }
  20654. var r = e("./DescriptionChunkType");
  20655. (n.prototype.parse = function (e, t) {
  20656. var i = [],
  20657. n = e.split("[").map(function (e, t) {
  20658. return 0 === t ? e : "[" + e;
  20659. });
  20660. return (
  20661. n.forEach(
  20662. function (e) {
  20663. var n = this.findMarkdown(e);
  20664. if (n) {
  20665. if (n.url.indexOf("javascript:") !== -1) return;
  20666. this.addLinkChunk(i, n, t),
  20667. this.addTextChunk(i, e.slice(n.markdown.length));
  20668. } else this.addTextChunk(i, e);
  20669. }.bind(this)
  20670. ),
  20671. i
  20672. );
  20673. }),
  20674. (n.prototype.findMarkdown = function (e) {
  20675. var t = /\[([^\]]*)\]\((.*)\)/,
  20676. i = e.match(t);
  20677. if (i) {
  20678. for (
  20679. var n = i[2], r = 1, o = 0;
  20680. o < n.length &&
  20681. ("(" === n[o] ? r++ : ")" === n[o] && r--, 0 !== r);
  20682. )
  20683. o++;
  20684. var a = n.length - o;
  20685. return {
  20686. markdown: i[0].substring(0, i[0].length - a),
  20687. label: i[1],
  20688. url: i[2].substring(0, o),
  20689. };
  20690. }
  20691. }),
  20692. (n.prototype.addTextChunk = function (e, t) {
  20693. 0 !== t.length &&
  20694. e.push({
  20695. type: r.TEXT,
  20696. text: t,
  20697. });
  20698. }),
  20699. (n.prototype.addLinkChunk = function (e, t) {
  20700. if (!this.capabilities.links.enable)
  20701. return void (
  20702. this.capabilities.links.keepLabels &&
  20703. this.addTextChunk(e, t.label)
  20704. );
  20705. var i = {
  20706. label: t.label,
  20707. url: t.url,
  20708. };
  20709. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  20710. e.push({
  20711. type: r.LINK,
  20712. link: i,
  20713. });
  20714. }),
  20715. (t.exports = n);
  20716. },
  20717. {
  20718. "./DescriptionChunkType": 133,
  20719. },
  20720. ],
  20721. 135: [
  20722. function (e, t, i) {
  20723. (function (i) {
  20724. "use strict";
  20725. var n = e("../util/logger"),
  20726. r = new n(i),
  20727. o = {
  20728. parseIdsFromChunkName: function (e, t) {
  20729. (t.floorId = o.parseFloor(e)), (t.roomId = o.parseRoom(e));
  20730. },
  20731. parseFloor: function (e) {
  20732. var t = e.match(/_group([0-9]+)/);
  20733. if (!t) return 0;
  20734. try {
  20735. return parseInt(t[1], 10);
  20736. } catch (e) {
  20737. return (
  20738. r.warn(
  20739. 'Non-int value "' +
  20740. t[1] +
  20741. '" for mesh group, defaulting to floor 0'
  20742. ),
  20743. 0
  20744. );
  20745. }
  20746. },
  20747. parseRoom: function (e) {
  20748. var t = e.match(/_sub([0-9]+)/);
  20749. if (!t) return -1;
  20750. try {
  20751. return parseInt(t[1], 10);
  20752. } catch (e) {
  20753. return (
  20754. r.warn(
  20755. 'Non-int value "' +
  20756. t[1] +
  20757. '" for mesh subgroup, defaulting to subgroup 0'
  20758. ),
  20759. 0
  20760. );
  20761. }
  20762. },
  20763. };
  20764. t.exports = o;
  20765. }).call(this, "/js/model/Chunks.js");
  20766. },
  20767. {
  20768. "../util/logger": 189,
  20769. },
  20770. ],
  20771. 136: [
  20772. function (e, t, i) {
  20773. (function (i) {
  20774. "use strict";
  20775. function n(e) {
  20776. s.call(this), (this.model = e), (this.exploded = !1);
  20777. }
  20778. var r = e("../objects/Floor"),
  20779. o = (e("../settings"), e("../util/logger")),
  20780. a = e("../util/transitions"),
  20781. s = e("../util/IndexedCollection"),
  20782. l = e("../util/common"),
  20783. c = e("../util/easing");
  20784. new o(i);
  20785. l.inherit(n, s),
  20786. (n.prototype.add = function (e) {
  20787. s.prototype.add.call(this, e), this.model.add(e);
  20788. }),
  20789. (n.prototype.getIndex = function (e) {
  20790. return e.floorIndex;
  20791. }),
  20792. (n.prototype.build = function () {
  20793. this.list.forEach(function (e) {
  20794. e.build();
  20795. });
  20796. }),
  20797. (n.prototype.size = function () {
  20798. return this.length;
  20799. }),
  20800. (n.prototype.sort = function () {
  20801. s.prototype.sort.call(this, function (e, t) {
  20802. return e.floorIndex - t.floorIndex;
  20803. });
  20804. }),
  20805. (n.prototype.nextFloor = function (e, t) {
  20806. return this.index[e.floorIndex + t] || null;
  20807. }),
  20808. (n.prototype.getFloorAtPoint = function (e) {
  20809. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  20810. var r = this.list[n],
  20811. o = r.distanceToPoint(e);
  20812. (!t || i > o) && ((i = o), (t = r));
  20813. }
  20814. return t;
  20815. }),
  20816. (n.prototype.getOrMakeFloor = function (e) {
  20817. var t = this.index[e];
  20818. return t || ((t = new r(this.model, e)), this.add(t)), t;
  20819. }),
  20820. (n.prototype.hide = function () {
  20821. this.list.forEach(function (e) {
  20822. e.hide();
  20823. });
  20824. }),
  20825. (n.prototype.show = function () {
  20826. this.list.forEach(function (e) {
  20827. e.show();
  20828. });
  20829. }),
  20830. (n.prototype.names = function () {
  20831. return this.list.reduce(function (e, t) {
  20832. return e.concat(t.name);
  20833. }, []);
  20834. }),
  20835. (n.prototype.toggleExplodeHorizontal = function () {
  20836. function e(e, t) {
  20837. r.copy(e.position),
  20838. (e.position.x = i[e.floorIndex] * t),
  20839. (e.position.y = 1 * e.floorIndex * t),
  20840. r.sub(e.position).multiplyScalar(-1),
  20841. e.panos.forEach(function (e) {
  20842. e.translate(r);
  20843. });
  20844. }
  20845. var t,
  20846. i = [],
  20847. n = 0;
  20848. this.list.forEach(function (e, r, o) {
  20849. (t =
  20850. r > 0
  20851. ? Math.max(
  20852. o[r - 1].boundingBox.max.x - e.boundingBox.min.x,
  20853. e.boundingBox.size().x / 2
  20854. )
  20855. : 0),
  20856. (n += t),
  20857. (i[r] = n);
  20858. }),
  20859. (i = i.map(function (e) {
  20860. return e - n / 2;
  20861. }));
  20862. var r = this.list[0].position.clone();
  20863. this.exploded
  20864. ? this.list.forEach(function (t) {
  20865. a.start(
  20866. function (i) {
  20867. e(t, 1 - i);
  20868. },
  20869. 1500,
  20870. null,
  20871. 0,
  20872. c.easeOutExpo
  20873. );
  20874. })
  20875. : this.list.forEach(function (t) {
  20876. a.start(
  20877. function (i) {
  20878. e(t, i);
  20879. },
  20880. 1500,
  20881. null,
  20882. 0,
  20883. c.easeOutExpo
  20884. );
  20885. }),
  20886. (this.exploded = !this.exploded);
  20887. }),
  20888. (n.prototype.toggleExplodeVertical = function () {
  20889. function e(e, i) {
  20890. var n = n.copy(e.position);
  20891. (e.position.y = (5 * e.floorIndex - t.y / 2) * i),
  20892. n.sub(e.position).multiplyScalar(-1),
  20893. e.panos.forEach(function (e) {
  20894. e.translate(n);
  20895. });
  20896. }
  20897. var t = this.model.size;
  20898. this.list[0].position.clone();
  20899. this.exploded
  20900. ? this.list.forEach(function (t) {
  20901. a.start(
  20902. function (i) {
  20903. e(t, 1 - i);
  20904. },
  20905. 1500,
  20906. null,
  20907. 0,
  20908. c.easeOutExpo
  20909. );
  20910. })
  20911. : this.list.forEach(function (t) {
  20912. a.start(
  20913. function (i) {
  20914. e(t, i);
  20915. },
  20916. 1500,
  20917. null,
  20918. 0,
  20919. c.easeOutExpo
  20920. );
  20921. }),
  20922. (this.exploded = !this.exploded);
  20923. }),
  20924. (t.exports = n);
  20925. }).call(this, "/js/model/FloorCollection.js");
  20926. },
  20927. {
  20928. "../objects/Floor": 146,
  20929. "../settings": 166,
  20930. "../util/IndexedCollection": 175,
  20931. "../util/common": 185,
  20932. "../util/easing": 186,
  20933. "../util/logger": 189,
  20934. "../util/transitions": 195,
  20935. },
  20936. ],
  20937. 137: [
  20938. function (e, t, i) {
  20939. (function (i) {
  20940. "use strict";
  20941. function n() {
  20942. c.call(this);
  20943. }
  20944. var r = e("../settings"),
  20945. o = e("../util/logger"),
  20946. a = e("../enum/Viewmode"),
  20947. s = e("../objects/Snapshot"),
  20948. l = (e("../util/math"), e("../util/common")),
  20949. c = e("../util/IndexedCollection"),
  20950. h = new o(i);
  20951. l.inherit(n, c),
  20952. (n.prototype.getImage = function (e) {
  20953. return e && this.index.hasOwnProperty(e) ? this.index[e] : null;
  20954. }),
  20955. (n.prototype.filterByModesAndReel = function (e, t) {
  20956. for (var i = [], n = 0; n < t.length; n += 1) {
  20957. var r = t[n],
  20958. o = this.index[r.sid];
  20959. o && i.push(o);
  20960. }
  20961. var s = e[a.DOLLHOUSE],
  20962. l = e[a.FLOORPLAN];
  20963. (i = i.filter(function (e) {
  20964. if (!e.metadata || void 0 === e.metadata.camera_mode) return !0;
  20965. var t;
  20966. try {
  20967. t = a.convertWorkshopModeInt(e.metadata.camera_mode);
  20968. } catch (e) {
  20969. return h.debug(e.message), !1;
  20970. }
  20971. return (
  20972. t === a.PANORAMA ||
  20973. (t === a.FLOORPLAN && l) ||
  20974. (t === a.DOLLHOUSE && s)
  20975. );
  20976. })),
  20977. i.length !== this.list.length &&
  20978. h.info(
  20979. "Disallowed " +
  20980. (this.list.length - i.length) +
  20981. " highlight images"
  20982. ),
  20983. (this.list = i),
  20984. this.reIndex();
  20985. }),
  20986. (n.prototype.getHeroLocations = function (panos) {
  20987. //改 增加二级location
  20988. if (0 === this.list.length) return [];
  20989. var locations = [];
  20990. var deal = (info, container) => {
  20991. var src = info.thumbnail_signed_src,
  20992. o = info.name || "";
  20993. if (
  20994. info.metadata &&
  20995. void 0 !== info.metadata.camera_quaternion
  20996. ) {
  20997. if (!r.show360Views.enabled && info.metadata.scan_id) {
  20998. let a = panos.get(info.metadata.scan_id);
  20999. if (a && !a.isAligned()) return;
  21000. }
  21001. var cameraMode = a.convertWorkshopModeInt(
  21002. info.metadata.camera_mode
  21003. );
  21004. if (cameraMode === a.MESH) return;
  21005. if (window.isLocal) src = manage.dealURL(src);
  21006. else
  21007. src =
  21008. "one" === g_version
  21009. ? g_Prefix + src + "?" + randomTime().getTime()
  21010. : src + "?" + randomTime().getTime();
  21011. var l = {
  21012. cameraMode: cameraMode,
  21013. position: info.metadata.camera_position,
  21014. quaternion: info.metadata.camera_quaternion,
  21015. zoom: info.metadata.zoom,
  21016. panoId: info.metadata.scan_id,
  21017. orthoZoom: info.metadata.ortho_zoom,
  21018. floorVisibility:
  21019. void 0 !== info.metadata.floor_visibility
  21020. ? info.metadata.floor_visibility.slice(0)
  21021. : [],
  21022. thumbUrl: src,
  21023. name: n.filterImageName(o),
  21024. sid: info.sid,
  21025. };
  21026. var item = new s(l);
  21027. item.momentTour = info.momentTour;
  21028. item.dontRot = info.dontRot;
  21029. item.rotTime = info.rotTime;
  21030. item.musicInfo =
  21031. info.musicInfo || g_data2.tourAudio[info.sid] || {}; //新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  21032. container.push(item);
  21033. return item;
  21034. }
  21035. };
  21036. this.list.forEach((image) => {
  21037. if (image.images) {
  21038. var folder = $.extend({}, image);
  21039. folder.heroLocations = [];
  21040. image.images.list.forEach((child) => {
  21041. deal(child, folder.heroLocations);
  21042. });
  21043. folder.musicInfo = folder.musicInfo || {};
  21044. locations.push(folder);
  21045. delete folder.images;
  21046. delete folder.locations;
  21047. } else {
  21048. var item = deal(image, locations);
  21049. }
  21050. });
  21051. return locations;
  21052. }),
  21053. (n.prototype.getIndex = function (e) {
  21054. return e.sid;
  21055. }),
  21056. (n.filterImageName = function (e) {
  21057. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e;
  21058. }),
  21059. (t.exports = n);
  21060. }).call(this, "/js/model/ImageCollection.js");
  21061. },
  21062. {
  21063. "../enum/Viewmode": 51,
  21064. "../objects/Snapshot": 153,
  21065. "../settings": 166,
  21066. "../util/IndexedCollection": 175,
  21067. "../util/common": 185,
  21068. "../util/logger": 189,
  21069. "../util/math": 190,
  21070. },
  21071. ],
  21072. 138: [
  21073. function (e, t, i) {
  21074. (function (i) {
  21075. "use strict";
  21076. function n() {
  21077. u.call(this);
  21078. }
  21079. var r = e("../label/Label"),
  21080. o = e("../settings"),
  21081. a = e("../util/logger"),
  21082. s = e("../util/math"),
  21083. l = e("../util/ajax"),
  21084. c = e("./RoomCollection"),
  21085. h = e("../util/common"),
  21086. u = e("../util/IndexedCollection");
  21087. new a(i);
  21088. h.inherit(n, u),
  21089. (n.prototype.getIndex = function (e) {
  21090. return e.labelId;
  21091. }),
  21092. (n.prototype.associateWithRooms = function (e) {
  21093. this.forEach(function (t) {
  21094. e.forEach(function (e) {
  21095. e.roomId === t.roomId && (t.room = e);
  21096. });
  21097. });
  21098. }),
  21099. (n.prototype.createFromLabelData = function (e) {
  21100. e.forEach(
  21101. function (e) {
  21102. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  21103. t = c.generateRoomId(e.floorId, t);
  21104. var i = new r(
  21105. e.sid,
  21106. e.position || e.positions[0],
  21107. e.text,
  21108. e.floorId,
  21109. t
  21110. );
  21111. (i.position = s.convertWorkshopVector(i.position)),
  21112. this.add(i),
  21113. i.build();
  21114. }.bind(this)
  21115. );
  21116. }),
  21117. (n.prototype.load = function (e, t) {
  21118. return l
  21119. .get(e, {
  21120. responseType: "json",
  21121. auth: t ? o.authorizationHeader : null,
  21122. })
  21123. .done(
  21124. function (e) {
  21125. var t = [];
  21126. for (var i in e) {
  21127. var n = e[i];
  21128. t.push(n);
  21129. }
  21130. this.createFromLabelData(t);
  21131. }.bind(this)
  21132. );
  21133. }),
  21134. (n.parseRoomIndexFromWorkshopRoomId = function (e) {
  21135. var t = -1;
  21136. if (e) {
  21137. if (typeof e == "number") {
  21138. //add
  21139. t = parseInt(e);
  21140. } else {
  21141. var i = e.split("_");
  21142. t = parseInt(i[0]);
  21143. }
  21144. }
  21145. return t;
  21146. }),
  21147. (t.exports = n);
  21148. }).call(this, "/js/model/LabelCollection.js");
  21149. },
  21150. {
  21151. "../label/Label": 90,
  21152. "../settings": 166,
  21153. "../util/IndexedCollection": 175,
  21154. "../util/ajax": 181,
  21155. "../util/common": 185,
  21156. "../util/logger": 189,
  21157. "../util/math": 190,
  21158. "./RoomCollection": 141,
  21159. },
  21160. ],
  21161. 139: [
  21162. function (e, t, i) {
  21163. (function (i) {
  21164. "use strict";
  21165. function n(e, t) {
  21166. o.Object3D.call(this);
  21167. this.sid = window.number; //t.sid,
  21168. (this.data = t),
  21169. (this.options = e),
  21170. (this.urls = new s(e.urlFiles)),
  21171. (this.isPublic = void 0 !== t.is_public && t.is_public),
  21172. //创建heroLocations
  21173. (this.images = new _(this)),
  21174. this.images.extend(t.images),
  21175. this.images.forEach((info) => {
  21176. if (info.locations) {
  21177. info.images = new _(this);
  21178. info.images.extend(info.locations);
  21179. }
  21180. });
  21181. this.heroLocations = [];
  21182. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  21183. (this.outdoorPanoLocations = []),
  21184. (this.floors = new d(this)),
  21185. (this.floorsEnabled = void 0 === e.floors || e.floors),
  21186. (this.changingFloor = !1),
  21187. (this.chunks = []),
  21188. (this.panos = new A()),
  21189. (this.colliders = []),
  21190. (this.loadPanosPromise = null),
  21191. (this.loadMeshTexturesPromise = null),
  21192. (this.auxDataPromise = null),
  21193. (this.meshTexturesLoaded = !1),
  21194. (this.meshTextures = []),
  21195. (this.tags = {}),
  21196. (this.tagsShown = !1),
  21197. (this.shouldShowtags = !1),
  21198. (this.has360Views = !1),
  21199. (this.showingLabels =
  21200. f.labels.enabled && t.player_options.labels),
  21201. (this.supportedModes = {}),
  21202. (this.supportedModes[c.PANORAMA] = !0),
  21203. (this.supportedModes[c.DOLLHOUSE] =
  21204. !t.player_options ||
  21205. (t.player_options.dollhouse && w.valueFromHash("dh", 1))),
  21206. (this.supportedModes[c.FLOORPLAN] =
  21207. !t.player_options ||
  21208. (t.player_options.floor_plan && w.valueFromHash("dh", 1))),
  21209. (this.supportedModes[c.TRANSITIONING] = !0),
  21210. (this.supportsTiles = this.configureTiling()),
  21211. // this.supportsVR = t.is_vr,
  21212. (this.supportsVR = window.DATA.supportsVR || false); //true; // 方奕卓 VR功能可配置
  21213. (this.mode = c.DOLLHOUSE),
  21214. (this.size = null),
  21215. (this.center = null),
  21216. (this.boundingBox = new o.Box3()),
  21217. (this.currentFloor = null),
  21218. (this.allFloorsVisible = !0),
  21219. (this.projectedPano0 = null),
  21220. (this.projectedPano1 = null),
  21221. this.floorsEnabled &&
  21222. t.floors &&
  21223. t.floors.indexOf(",") !== -1 &&
  21224. t.floors.split(",").forEach(
  21225. function (e, t) {
  21226. this.addFloor(new u(this, t, e.trim()));
  21227. }.bind(this)
  21228. ),
  21229. (this.waitQueue = []),
  21230. this.on(
  21231. "load",
  21232. function (e) {
  21233. 0 !== this.waitQueue.length &&
  21234. ((this.waitQueue = this.waitQueue.filter(function (e) {
  21235. return !e.isLoadedCallback();
  21236. })),
  21237. 0 === this.waitQueue.length && this.emit("waiting-done"));
  21238. }.bind(this)
  21239. ),
  21240. this.setupCustomProperties();
  21241. this.hots = {};
  21242. }
  21243. function r() {
  21244. try {
  21245. var e = document.createElement("canvas"),
  21246. t = e.getContext("webgl");
  21247. t || (t = e.getContext("experimental-webgl"));
  21248. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  21249. return i;
  21250. } catch (e) {
  21251. return 0;
  21252. }
  21253. }
  21254. var o = e("three"),
  21255. a = e("../util/ajax"),
  21256. s = e("../util/ModelUrls"),
  21257. l = e("../objects/BoundingTextureSkybox"),
  21258. c = e("../enum/Viewmode"),
  21259. h = e("../enum/RenderOrder"),
  21260. u = (e("../enum/AlignmentType"), e("../objects/Floor")),
  21261. d = e("./FloorCollection"),
  21262. p = e("../objects/Chunk"),
  21263. f =
  21264. (e("../objects/Room"),
  21265. e("../objects/Snapshot"),
  21266. e("../label/Label"),
  21267. e("../util/math"),
  21268. e("../settings")),
  21269. ss = e("../shaders"),
  21270. g = e("../util/logger"),
  21271. m = e("../tag/tag"),
  21272. v = (e("../tag/tagManager"), e("../objects/Panorama")),
  21273. A = e("../util/PanoramaCollection"),
  21274. y = e("../loaders/ModelLoader"),
  21275. C = e("../loaders/ModelTextureLoader"),
  21276. I = e("../loaders/SweepDataLoader"),
  21277. E = e("../util/transitions"),
  21278. b = e("../util/common"),
  21279. es = e("../util/easing"),
  21280. lerp = e("../util/lerp"),
  21281. tex = e("../util/texture"),
  21282. w = e("./../util/browser"),
  21283. _ = e("./ImageCollection"),
  21284. T = e("./RoomCollection"),
  21285. x = e("./LabelCollection"),
  21286. S = e("./Chunks"),
  21287. cameraLight = e("./util/cameraLight"),
  21288. M = e("./../util/showcase"),
  21289. R = e("../exception/BasicException"),
  21290. P = (e("../constants"), e("events").EventEmitter),
  21291. GLCubeFaces = e("../enum/GLCubeFaces"),
  21292. //,Hot = e("hot")
  21293. O = new g(i);
  21294. (n.prototype = Object.create(o.Object3D.prototype)),
  21295. b.extend(n, P),
  21296. (n.prototype.setupCustomProperties = function () {
  21297. var e = f.modelAlpha;
  21298. Object.defineProperty(this, "alpha", {
  21299. get: function () {
  21300. return e;
  21301. },
  21302. set: function (t) {
  21303. e = t;
  21304. //console.log(t)
  21305. this.chunks.forEach(function (chunk) {
  21306. if (chunk.material && chunk.material.uniforms.modelAlpha) {
  21307. chunk.material.uniforms.modelAlpha.value = e;
  21308. //修改一下defines,为了在不需要map时不加载map。 by xzw
  21309. /* if (e>0) {
  21310. if (!('useModelMap' in chunk.material.defines)) {
  21311. chunk.material.defines.useModelMap = ''
  21312. chunk.material.needsUpdate = true
  21313. console.log('add useModelMap')
  21314. }
  21315. } else {
  21316. if ('useModelMap' in chunk.material.defines) {
  21317. delete chunk.material.defines.useModelMap
  21318. chunk.material.needsUpdate = true
  21319. chunk.material.uniforms.map.value.dispose() //防止崩溃(但是因为这样飞出要等待时间所以被去掉了)
  21320. console.log('delete useModelMap')
  21321. }
  21322. } */
  21323. }
  21324. });
  21325. },
  21326. });
  21327. }),
  21328. (n.prototype.configureTiling = function () {
  21329. var e = r();
  21330. if (e < 2048) return !1;
  21331. O.warn("Max cube texture size: " + e);
  21332. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  21333. var i = f.tiling.tilingFlagNames[t];
  21334. if ("1" === w.valueFromHash(i, null)) return !0;
  21335. if ("0" === w.valueFromHash(i, null)) return !1;
  21336. }
  21337. //--------------------------------------------许钟文-------------------------------------------
  21338. //return true;
  21339. return !!M.modelDataPromisesTiles(this.data); //免去访问mdoeldata.json的vision_version,不明白这是什么
  21340. //--------------------------------------------e n d -------------------------------------------
  21341. }),
  21342. (n.prototype.toggleAlpha = function () {
  21343. this.alpha < 1 ? (this.alpha = 1) : (this.alpha = 0);
  21344. }),
  21345. (n.prototype.load = function (e) {
  21346. var t = function () {
  21347. return $.when(this.loadPanos(), this.loadMesh());
  21348. },
  21349. i = this.urls.init().then(t.bind(this));
  21350. return (
  21351. e
  21352. ? (i = i.then(this.loadMeshTextures.bind(this)))
  21353. : i.then(this.loadMeshTextures.bind(this)),
  21354. (this.auxDataPromise = $.when(
  21355. /*this.loadHighlightReel(), this.loadtags() */ this.loadhots(),
  21356. this.loadLabels()
  21357. )),
  21358. $.when(i, this.auxDataPromise).done(this.build.bind(this))
  21359. ); //不要另外使用active_reel文件
  21360. }),
  21361. (n.prototype.loadMesh = function () {
  21362. function e(e) {
  21363. O.error(e), n.reject("loading-failed");
  21364. }
  21365. function t(e, t) {
  21366. n.notify(e, t);
  21367. }
  21368. function i(e, t) {
  21369. if (0 === e.length) {
  21370. O.warn(
  21371. "No geometry found for model, loading faux geometry, disabling outside mode"
  21372. ),
  21373. (r.supportedModes[c.DOLLHOUSE] = !1),
  21374. (r.supportedModes[c.FLOORPLAN] = !1);
  21375. var i = new p({
  21376. geometry: new o.PlaneBufferGeometry(5, 5, 1, 1),
  21377. });
  21378. (i.material.visible = !1),
  21379. i.rotateX(-Math.PI / 2),
  21380. i.geometry.computeBoundingBox(),
  21381. (e = [i]);
  21382. }
  21383. e.forEach(function (e) {
  21384. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  21385. r.addChunk(t, e);
  21386. }),
  21387. r.floors.sort(),
  21388. n.resolve(r);
  21389. }
  21390. var n = $.Deferred(),
  21391. r = this;
  21392. return y.load(r.data.job.uuid, r.urls, i, t, e), n.promise();
  21393. }),
  21394. (n.prototype.loadMeshTextures = function () {
  21395. return this.loadTexturesPromise
  21396. ? this.loadTexturesPromise
  21397. : ((this.loadTexturesPromise = C.load(
  21398. this,
  21399. this.meshTextures
  21400. ).then(
  21401. function () {
  21402. this.meshTexturesLoaded = !0;
  21403. }.bind(this)
  21404. )),
  21405. this.loadTexturesPromise);
  21406. }),
  21407. /* n.prototype.loadtags = function() {//xzw改
  21408. var e = $.Deferred();
  21409. if (!f.tags.enabled)
  21410. return e.resolve();
  21411. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  21412. t = "data/" + this.sid + "/tags.json"
  21413. return a.get(t, {
  21414. responseType: "json",
  21415. auth: this.isPublic ? null : f.authorizationHeader
  21416. }).done(function(t) {
  21417. var i = 0
  21418. , n = 0;
  21419. for (var r in t) {
  21420. var o = t[r];
  21421. o.enabled && (n++,
  21422. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  21423. i++))
  21424. }
  21425. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  21426. e.resolve()
  21427. }
  21428. .bind(this)).fail(function() {
  21429. O.warn("Getting tags failed, not displaying tags."),
  21430. e.resolve()
  21431. }),
  21432. e
  21433. } */
  21434. (n.prototype.shineHots = function () {
  21435. //xzw
  21436. E.trigger({
  21437. func: function (e) {
  21438. var opa = e <= 0.5 ? 2 * e : -2 * e + 2;
  21439. for (var i in this.hots) {
  21440. this.hots[i].mesh.material.uniforms.opac.value = opa;
  21441. }
  21442. }.bind(this),
  21443. cycling: true,
  21444. duration: 3000,
  21445. //easing: "easeInOutQuad",
  21446. name: "hotShine",
  21447. });
  21448. }),
  21449. /* n.prototype.loadOverlays = function(overlays){
  21450. var overlays = window.data2 && window.data2.overlays
  21451. overlays && overlays.forEach((info)=>{
  21452. new Overlay(info)
  21453. })
  21454. Overlay.load()
  21455. }
  21456. */
  21457. (n.prototype.loadhots = function () {
  21458. //xzw
  21459. initHot(this);
  21460. var r = $.Deferred();
  21461. var t =
  21462. g_Prefix +
  21463. "data/" +
  21464. this.sid +
  21465. "/data2.js" +
  21466. "?" +
  21467. randomTime().getTime();
  21468. return (
  21469. a
  21470. .get(t, {
  21471. responseType: "json",
  21472. auth: this.isPublic ? null : f.authorizationHeader,
  21473. })
  21474. .done(
  21475. function (e) {
  21476. window.data2 = e;
  21477. this.roomLabels = [];
  21478. if (!e) {
  21479. console.error("data2 is null");
  21480. } else {
  21481. g_data2 = hotMatcher(e);
  21482. this.hotsCount = 0;
  21483. let create = () => {
  21484. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  21485. if (e.hots) {
  21486. var sids = Object.keys(e.hots).sort((a, b) => {
  21487. return e.hots[a].order - e.hots[b].order;
  21488. });
  21489. sids.forEach((sid) => {
  21490. e.hots[sid].sid = sid;
  21491. //if(e.hots[sid].texType == "shine" || e.hots[sid].texType == "photo" ){
  21492. //e.hots[sid].styleImg = []
  21493. new Hot(
  21494. e.hots[sid],
  21495. e.hots[sid].version != "multi" && "byHot"
  21496. );
  21497. //}
  21498. });
  21499. }
  21500. if (e.overlays) {
  21501. e.overlays.forEach((info) => {
  21502. //if(info.file.includes('m/data/762/edit/20210312_112357584.mp4') )return;
  21503. new Hot(info, "byOverlay");
  21504. });
  21505. }
  21506. Hot.createHotList();
  21507. Hot.startLoad();
  21508. if (DATA.roomLabels) {
  21509. DATA.roomLabels.forEach((data) => {
  21510. this.roomLabels.push(new RoomLabel(data));
  21511. });
  21512. }
  21513. };
  21514. if (player.currentPano) {
  21515. create();
  21516. } else {
  21517. let f = () => {
  21518. window.bus.removeEventListener(
  21519. "playerAndModelReady",
  21520. f
  21521. );
  21522. create();
  21523. };
  21524. window.bus.addEventListener("playerAndModelReady", f);
  21525. }
  21526. g_index = w.valueFromHash("m");
  21527. }
  21528. /***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
  21529. /* var dataJsPromise = $.Deferred();
  21530. var dataJsUrl = g_Prefix+"data/" + this.sid + "/hot/js/data.js" +'?'+ randomTime().getTime();
  21531. a.get(dataJsUrl,{
  21532. responseType: "json",
  21533. auth: this.isPublic ? null : f.authorizationHeader
  21534. }).done(function(data) {
  21535. window.hotData = data;
  21536. this.createHotItem(data, this.hots);
  21537. for(let i in this.hots){//add
  21538. data[i] && this.hots[i].initStyleImg(data[i]);
  21539. }
  21540. dataJsPromise.resolve();
  21541. }.bind(this)).fail(function(){
  21542. console.log('Data.js is empty');
  21543. dataJsPromise.resolve();
  21544. }) */
  21545. r.resolve();
  21546. }.bind(this)
  21547. )
  21548. .fail(function () {
  21549. console.log("没有热点");
  21550. r.resolve();
  21551. }),
  21552. r
  21553. );
  21554. }),
  21555. (n.prototype.loadPanos = function () {
  21556. if (this.loadPanosPromise) return this.loadPanosPromise;
  21557. var e = new I(this);
  21558. return (
  21559. (this.loadPanosPromise = e.load().then(
  21560. function (e) {
  21561. return (
  21562. this.data.sweeps &&
  21563. Object.keys(this.data.sweeps).length > 0 &&
  21564. (e = e.filter(
  21565. function (e) {
  21566. if (this.data.sweeps[e.uuid])
  21567. return this.data.sweeps[e.uuid].enabled;
  21568. else console.log(e.uuid);
  21569. }.bind(this)
  21570. )),
  21571. this.panos.extend(
  21572. e.map(
  21573. function (e) {
  21574. return new v(this, e.uuid, e, this.supportsTiles);
  21575. }.bind(this)
  21576. )
  21577. ),
  21578. this.panos.forEach(
  21579. function (e) {
  21580. e.neighbourUUIDs &&
  21581. (e.neighbourUUIDs.forEach(
  21582. function (t) {
  21583. var i = this.panos.get(t);
  21584. i && this.panos.setNeighbour(e, i, !0);
  21585. }.bind(this)
  21586. ),
  21587. (e.neighbourPanos =
  21588. this.panos.getNeighbours(e) ||
  21589. this.panos.setNeighbour(e, e, !0)));
  21590. }.bind(this)
  21591. ),
  21592. 0 === this.panos.length &&
  21593. (O.warn("Model has no panos, turning off inside mode"),
  21594. (this.supportedModes[c.PANORAMA] = !1)),
  21595. $.when(this)
  21596. );
  21597. }.bind(this)
  21598. )),
  21599. this.loadPanosPromise
  21600. );
  21601. }),
  21602. (n.prototype.loadHighlightReel = function () {
  21603. //xzw
  21604. var e = $.Deferred(),
  21605. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  21606. t =
  21607. this.options.urlBase +
  21608. "data/" +
  21609. this.sid +
  21610. "/active_reel.json";
  21611. return (
  21612. a
  21613. .get(t, {
  21614. responseType: "json",
  21615. auth: this.isPublic ? null : f.authorizationHeader,
  21616. })
  21617. .done(
  21618. function (t) {
  21619. t.reel
  21620. ? (O.info(
  21621. "Got highlight reel with " +
  21622. t.reel.length +
  21623. " items"
  21624. ),
  21625. this.images.filterByModesAndReel(
  21626. this.supportedModes,
  21627. t.reel
  21628. ))
  21629. : O.info("No highlight reel found"),
  21630. e.resolve();
  21631. }.bind(this)
  21632. )
  21633. .fail(function () {
  21634. O.warn(
  21635. "Getting highlight reel failed, no highlights available"
  21636. ),
  21637. e.resolve();
  21638. }),
  21639. e
  21640. );
  21641. }),
  21642. (n.prototype.waitForLoad = function (e, t) {
  21643. t() ||
  21644. (this.waitQueue.push({
  21645. object: e,
  21646. isLoadedCallback: t,
  21647. }),
  21648. 1 === this.waitQueue.length && this.emit("waiting"));
  21649. }),
  21650. (n.prototype.hide = function () {
  21651. this.floors.hide();
  21652. }),
  21653. (n.prototype.show = function () {
  21654. this.floors.show();
  21655. }),
  21656. (n.prototype.floorNames = function () {
  21657. return this.floors.names();
  21658. }),
  21659. (n.prototype.warpDestFloors = function (e, t) {
  21660. if (!e || this.floors.length !== e.length)
  21661. return void this.toggleAllFloors(!0);
  21662. var i = e.findIndex(
  21663. function (e) {
  21664. return e;
  21665. }.bind(this)
  21666. );
  21667. i !== -1 && this.setFloor(this.floors.list[i], null, t);
  21668. }),
  21669. (n.prototype.setFloor = function (e, t, i) {
  21670. this.allFloorsVisible &&
  21671. this.emit("allfloors.toggled", !1, this.currentFloor),
  21672. (this.allFloorsVisible = !1),
  21673. this._setFloor(e, t, i);
  21674. }),
  21675. (n.prototype.toggleAllFloors = function (e) {
  21676. (this.allFloorsVisible =
  21677. void 0 !== e ? e : !this.allFloorsVisible),
  21678. this.emit(
  21679. "allfloors.toggled",
  21680. this.allFloorsVisible,
  21681. this.currentFloor
  21682. ),
  21683. this._setFloor(this.currentFloor);
  21684. }),
  21685. (n.prototype._setFloor = function (e, t, i) {
  21686. (t = t || this.mode),
  21687. this.emit("floor.changed", e, t, this.currentFloor),
  21688. (this.currentFloor = e);
  21689. var n;
  21690. if (t === c.PANORAMA) {
  21691. if ((this.show(), this.shouldShowtags && this.tagsShown))
  21692. for (n in this.tags) this.tags[n].show(f.showFloorDuration);
  21693. } else if (
  21694. (t === c.FLOORPLAN || t === c.DOLLHOUSE) &&
  21695. (this.floors.list.forEach(
  21696. function (e, t) {
  21697. e.toggle(
  21698. e === this.currentFloor || this.allFloorsVisible,
  21699. i || this.allFloorsVisible
  21700. );
  21701. }.bind(this)
  21702. ),
  21703. this.shouldShowtags && this.tagsShown)
  21704. )
  21705. for (n in this.tags) {
  21706. var r = this.tags[n];
  21707. this.allFloorsVisible
  21708. ? r.show(f.showFloorDuration)
  21709. : r.floor === this.currentFloor
  21710. ? r.show(f.showFloorDuration, f.showFloorDelay)
  21711. : r.hide(f.hideFloorDuration, f.hideFloorDelay);
  21712. }
  21713. var o = this,
  21714. a = e;
  21715. E.start(
  21716. function () {},
  21717. f.showFloorDelay,
  21718. function () {
  21719. o.floors.forEach(function (e) {
  21720. e.chunks.forEach(function (t) {
  21721. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor;
  21722. });
  21723. });
  21724. }.bind(this)
  21725. );
  21726. }),
  21727. (n.prototype.toggleExplode = function () {
  21728. this.floors.toggleExplodeHorizontal();
  21729. }),
  21730. (n.prototype.toggleExplodeUp = function () {
  21731. this.floors.toggleExplodeVertical();
  21732. }),
  21733. (n.prototype.nextFloor = function (e) {
  21734. return this.floors.nextFloor(this.currentFloor, e);
  21735. }),
  21736. (n.prototype.addFloor = function (e) {
  21737. this.floors.add(e);
  21738. }),
  21739. (n.prototype.getFloorAtPoint = function (e) {
  21740. return this.floors.getFloorAtPoint(e);
  21741. }),
  21742. (n.prototype.getTagBySid = function (e) {
  21743. return this.tags[e];
  21744. }),
  21745. (n.prototype.addChunk = function (e, t) {
  21746. this.floors.getOrMakeFloor(e).addChunk(t), this.chunks.push(t);
  21747. }),
  21748. (n.prototype.setMode = function (e) {
  21749. if (!this.supportedModes[e])
  21750. throw new R("Mode not supported for this model: " + e);
  21751. this.mode = e;
  21752. this.skybox.material.transparent = e == "panorama" ? false : true; //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  21753. this.chunks.forEach(function (t) {
  21754. t.setMode(e);
  21755. });
  21756. }),
  21757. (n.prototype.build = function () {
  21758. this.heroLocations = this.images.getHeroLocations(this.panos);
  21759. var e = function () {
  21760. return (
  21761. !!(
  21762. this.heroImage &&
  21763. this.heroImage.metadata &&
  21764. this.heroImage.metadata.scan_id &&
  21765. this.panos.get(this.heroImage.metadata.scan_id)
  21766. ) &&
  21767. !this.panos.get(this.heroImage.metadata.scan_id).isAligned()
  21768. );
  21769. }.bind(this)();
  21770. (this.has360Views =
  21771. (f.show360Views.enabled &&
  21772. this.heroLocations.some(
  21773. function (e) {
  21774. return (
  21775. e.cameraMode === c.PANORAMA &&
  21776. this.panos.get(e.panoId) &&
  21777. !this.panos.get(e.panoId).isAligned()
  21778. );
  21779. }.bind(this)
  21780. )) ||
  21781. e),
  21782. null === this.heroImage && O.warn("No hero image defined."),
  21783. (this.currentFloor = this.floors.last()),
  21784. this.floors.build(),
  21785. (this.colliders = this.floors.reduce(function (e, t) {
  21786. return e.concat(t.collider.children);
  21787. }, [])),
  21788. this.panos.forEach(
  21789. function (e) {
  21790. e.build1(),
  21791. e.on(
  21792. "enter",
  21793. function () {
  21794. e.floor !== this.currentFloor &&
  21795. this.setFloor(e.floor);
  21796. }.bind(this)
  21797. );
  21798. }.bind(this)
  21799. ),
  21800. this.panos.forEach(function (e) {
  21801. e.build2();
  21802. }),
  21803. this.floors.forEach(
  21804. function (e) {
  21805. this.boundingBox.union(e.boundingBox);
  21806. }.bind(this)
  21807. ),
  21808. (this.size = this.boundingBox.size()),
  21809. (this.center = this.boundingBox.center()),
  21810. this.floors.forEach(
  21811. function (e) {
  21812. O.info(
  21813. "Floor " +
  21814. e +
  21815. ": " +
  21816. e.children.length +
  21817. " chunks, " +
  21818. e.panos.length +
  21819. " panos."
  21820. );
  21821. }.bind(this)
  21822. ),
  21823. this.panos.populate_path_graph(),
  21824. (this.skybox = new l(this.boundingBox)),
  21825. (this.skybox.matrixWorldNeedsUpdate = !0),
  21826. this.add(this.skybox);
  21827. /* setTimeout(function() {
  21828. //this.hotsCount && this.shineHots()
  21829. Hot.beginShineHot()
  21830. }
  21831. .bind(this), 1300) */
  21832. //add-----
  21833. {
  21834. let maxCount = browser.isMobile() ? 200000 : 400000;
  21835. let noVisiHots = this.hotGroup.children.filter(
  21836. (e) => !e.info.visiblePanos && e.info.texType != "shine"
  21837. ); //只看非热点的,否则数据太多
  21838. let visiHots = this.hotGroup.children.filter(
  21839. (e) => e.info.visiblePanos
  21840. );
  21841. let c =
  21842. this.panos.list.length *
  21843. this.colliders.length *
  21844. noVisiHots.length;
  21845. if (c > maxCount) {
  21846. //防止加载时间过长,分批计算
  21847. console.log("hot分批setVisiblePanos");
  21848. Hot.visiPanosCountSlice = Math.ceil(
  21849. maxCount / this.colliders.length / noVisiHots.length
  21850. );
  21851. Hot.visiEveryDurSlice = browser.isMobile() ? 25 : 16;
  21852. let dur =
  21853. Math.ceil(
  21854. this.panos.list.length / Hot.visiPanosCountSlice
  21855. ) * Hot.visiEveryDurSlice;
  21856. console.log(
  21857. Hot.visiPanosCountSlice,
  21858. Hot.visiEveryDurSlice,
  21859. dur,
  21860. Math.round(dur * noVisiHots.length)
  21861. );
  21862. if (noVisiHots.length) {
  21863. let i = 0;
  21864. let hotVisiInterval = setInterval(() => {
  21865. noVisiHots[i].setVisiblePanos(
  21866. noVisiHots[i].info.visiblePanos
  21867. );
  21868. i++;
  21869. if (i >= noVisiHots.length) {
  21870. clearInterval(hotVisiInterval);
  21871. }
  21872. }, dur);
  21873. }
  21874. }
  21875. }
  21876. //---------
  21877. this.createFloorLogo();
  21878. return (
  21879. O.debug("Done building model"),
  21880. v.raycastsDone > 0 &&
  21881. (O.warn("raycasts: " + v.raycastsDone),
  21882. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  21883. this.buildRooms(),
  21884. this.labels.associateWithRooms(this.rooms),
  21885. $.when(this)
  21886. );
  21887. }),
  21888. (n.prototype.createFloorLogo = function () {
  21889. console.log("createFloorLogo");
  21890. if (this.floorLogos || !settings.floorlogoURL) return;
  21891. var url = settings.floorlogoURL;
  21892. var map = tex.load(url); //可以追加done
  21893. this.floorLogos = [];
  21894. for (var i = 0; i < 2; i++) {
  21895. //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  21896. var material = new o.MeshBasicMaterial({
  21897. opacity: 0,
  21898. map: map,
  21899. side: o.DoubleSide,
  21900. transparent: !0,
  21901. depthWrite: !1,
  21902. depthTest: false, //改 在chunk\skybox外也可看到
  21903. });
  21904. var logo = new o.Mesh(
  21905. new o.PlaneGeometry(2, 2, 1, 1),
  21906. material
  21907. );
  21908. //var s = (Store.metadata.floorLogoSize || 100)/100;
  21909. //logo.scale.set(s,s,s);
  21910. logo.position.set(0, -1.5, 0);
  21911. logo.lookAt(logo.position.clone().add(new o.Vector3(0, 1, 0)));
  21912. logo.renderOrder = 100; //cover the videoSkybox
  21913. //logo.layers.set(0)
  21914. this.add(logo);
  21915. this.floorLogos.push(logo);
  21916. }
  21917. this.floorLogos[1].visible = false;
  21918. });
  21919. (n.prototype.adjustfloorLogoHeight = function (o) {
  21920. var h = player.currentPano.floorPosition.y + 0.01;
  21921. this.floorLogos[1].position.setY(h);
  21922. this.floorLogos[0].position.setY(h);
  21923. //publicObjectSet.player.path.currentPanoMarker.mesh.position.y = h
  21924. }),
  21925. (n.prototype.changefloorLogoOpa = function (o) {
  21926. //改 i, opacity, time, delay
  21927. if (!this.floorLogos) return;
  21928. E.cancelById("flOpa_" + o.index); //先停止之前该logo的透明度变化
  21929. if (o.from != void 0)
  21930. this.floorLogos[o.index].material.opacity = o.from; //初始透明度
  21931. if (!o.dur) {
  21932. //立刻
  21933. //this.floorLogos[o.index].material.uniforms.opacity.value = o.opa;
  21934. this.floorLogos[o.index].material.opacity = o.opa;
  21935. } else {
  21936. //E.start(lerp.uniform(this.floorLogos[o.index], "opacity", o.opa), o.dur || 0, null,
  21937. E.start(
  21938. lerp.property(
  21939. this.floorLogos[o.index].material,
  21940. "opacity",
  21941. o.opa
  21942. ),
  21943. o.dur || 0,
  21944. null,
  21945. o.delay || 0,
  21946. es["easeInQuad"],
  21947. "changefloorLogoOpa",
  21948. "flOpa_" + o.index
  21949. );
  21950. }
  21951. }),
  21952. (n.prototype.updateFloorlogo = (function () {
  21953. //xzw add 更新地标的旋转
  21954. var lastQ, lastP;
  21955. var equals = function (v1, v2, min) {
  21956. return Math.abs(v1 - v2) < min;
  21957. };
  21958. var isSame = function (now, last, k) {
  21959. //如果和上次相同就不改变
  21960. if (!last) return false;
  21961. var R = k.sceneRenderer;
  21962. //var min = R.AFPS < 38 ? 0.005 : R.AFPS < 45 ? 0.0008 : R.AFPS < 50 ? 0.0006 : 0.0003;
  21963. //暂时:
  21964. var min = 0.0008;
  21965. var same =
  21966. equals(now.x, last.x, min) &&
  21967. equals(now.y, last.y, min) &&
  21968. equals(now.z, last.z, min) &&
  21969. (now.w != void 0 ? equals(now.w, last.w, min) : true);
  21970. return same;
  21971. };
  21972. return function (Q, k) {
  21973. if (!Q) return;
  21974. /* if(Config.ifFish && window.lowFPS){
  21975. this.fLCompute++;
  21976. if(R.AFPS < 38){
  21977. if(k.flyingToTag && k.flying && k.fLCompute %4 !=1) return; //点击tag过渡
  21978. else if(k.flying && k.fLCompute%2 !=1) return;
  21979. k.fLCompute %= 4;
  21980. }else if(R.AFPS < 45){
  21981. if(k.flyingToTag && k.flying && k.fLCompute %3 !=1) return; //点击tag过渡
  21982. else if(k.flying && k.fLCompute%2 !=1) return;
  21983. k.fLCompute %= 6;
  21984. }else{
  21985. if(k.flyingToTag && k.flying && k.fLCompute %2 !=1) return;
  21986. //else if(k.flying && k.fLCompute%2 !=1) return;
  21987. k.fLCompute %= 2;
  21988. }
  21989. } */
  21990. var sameQ, sameP, quaternion, visible;
  21991. for (var i = 0; i < 2; i++) {
  21992. var logo = this.floorLogos[i];
  21993. if (
  21994. !logo.visible ||
  21995. logo.material.uniforms.opacity.value == 0
  21996. )
  21997. continue;
  21998. visible = true;
  21999. }
  22000. if (!visible) return; //如果两个都不可见,就不更改,如果有一个可见,就都改
  22001. var c = k.cameraControls.activeControl;
  22002. var sameQ = c
  22003. ? c.lat < 10
  22004. ? equals(c.lon, lastQ, 0.1)
  22005. : equals(c.lon, lastQ, 1)
  22006. : false;
  22007. sameQ || (lastQ = c ? c.lon : null); //相机旋转是否改变了
  22008. for (var i = 0; i < 2; i++) {
  22009. var logo = this.floorLogos[i];
  22010. if (!sameQ) {
  22011. if (!quaternion) {
  22012. var a = new THREE.Vector3(0, 0, -1);
  22013. a.applyQuaternion(Q);
  22014. a.setY(0);
  22015. var _ = new THREE.Matrix4().lookAt(
  22016. a,
  22017. new THREE.Vector3(),
  22018. new THREE.Vector3(0, 1, 0)
  22019. );
  22020. quaternion = new THREE.Quaternion().setFromRotationMatrix(
  22021. _
  22022. );
  22023. var a = new THREE.Quaternion(
  22024. 0,
  22025. 0.7071067811865476,
  22026. 0.7071067811865476,
  22027. 0
  22028. ); //计算得
  22029. quaternion.multiply(a);
  22030. }
  22031. logo.quaternion.copy(quaternion);
  22032. }
  22033. }
  22034. };
  22035. })());
  22036. (n.prototype.loadLabels = function () {
  22037. //xzw
  22038. this.labels = new x(this);
  22039. var e = $.Deferred();
  22040. //加载俯视图的标签 注释这个备注就会加载
  22041. //原先是labels, 改为showLabels,因为之前的somedata写的labels都是true
  22042. window.DATA.showingLabels ? (this.showingLabels = true) : "";
  22043. if (!this.showingLabels) return e.resolve();
  22044. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  22045. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  22046. return (
  22047. this.labels
  22048. .load(t, !this.isPublic)
  22049. .done(e.resolve.bind(e))
  22050. .fail(function () {
  22051. O.warn("Getting labels failed, not displaying labels."),
  22052. e.resolve();
  22053. }),
  22054. e
  22055. );
  22056. }),
  22057. (n.prototype.buildRooms = function () {
  22058. (this.rooms = new T(this)),
  22059. this.rooms.createFromChunks(this.chunks),
  22060. this.rooms.calcRoomBoundaries();
  22061. }),
  22062. (n.prototype.updateProjectedPanos = function () {
  22063. this.projectedPano0 &&
  22064. this.projectedPano1 &&
  22065. this.setProjectedPanos(
  22066. this.projectedPano0,
  22067. this.projectedPano1,
  22068. !1
  22069. );
  22070. }),
  22071. (n.prototype.setProjectedPanos = function (e, t, i) {
  22072. (void 0 !== i && null !== i) || (i = !0),
  22073. (i = !!i),
  22074. (this.projectedPano0 = e),
  22075. (this.projectedPano1 = t),
  22076. this.skybox.material.setProjectedPanos(e, t, i),
  22077. this.chunks.forEach(function (n) {
  22078. n.materialInside.setProjectedPanos(e, t, i);
  22079. });
  22080. }),
  22081. (n.prototype.setSide = function (e) {
  22082. this.floors.forEach(function (t) {
  22083. t.collider.material.side = e;
  22084. });
  22085. }),
  22086. (n.prototype.heroCount = function () {
  22087. return this.heroLocations ? this.heroLocations.length : 0;
  22088. }),
  22089. (n.prototype.getHeroDescriptorByIndex = function (e = []) {
  22090. //改 因增加了二级目录
  22091. if (e[0] < 0)
  22092. return (
  22093. O.warn(
  22094. "Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."
  22095. ),
  22096. null
  22097. );
  22098. if (this.heroCount() < 1)
  22099. return (
  22100. O.warn(
  22101. "Model.getHeroDescriptorByIndex() -> No hero locations in this model"
  22102. ),
  22103. null
  22104. );
  22105. var t = this.heroLocations[e[0]];
  22106. if (t.heroLocations && e[1] != void 0) {
  22107. t = t.heroLocations[e[1]];
  22108. }
  22109. return void 0 === t
  22110. ? (O.warn(
  22111. "Model.getHeroDescriptorByIndex() -> Index " +
  22112. e +
  22113. " is not a validindex"
  22114. ),
  22115. null)
  22116. : t;
  22117. }),
  22118. (n.prototype.findPanoramicHero = function () {
  22119. for (var e in this.heroLocations)
  22120. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  22121. return this.heroLocations[e];
  22122. return null;
  22123. }),
  22124. (n.prototype.listImagePanos = function () {
  22125. var e = [],
  22126. t = this;
  22127. return (
  22128. this.images.forEach(function (i) {
  22129. if (i.metadata && i.metadata.scan_id) {
  22130. var n = t.panos.get(i.metadata.scan_id);
  22131. n && (t.supportsTiles || n.isLoaded("high") || e.push(n));
  22132. }
  22133. }),
  22134. e
  22135. );
  22136. }),
  22137. (n.prototype.fadePanoMarkers = function (
  22138. /* e, t */ opacity,
  22139. dur,
  22140. o = {}
  22141. ) {
  22142. //改
  22143. //this.panos.fadeMarkerOpacity(e, t)
  22144. if (window.DATA.hideFloorMarker) return;
  22145. var currentPano = player.currentPano;
  22146. opacity =
  22147. void 0 == opacity ? _settings.panorama.markerOpacity : opacity; //不传opacity代表显示
  22148. var hideWhenFlyOut = () => {
  22149. var shows = [],
  22150. hides = [];
  22151. player.model.panos.forEach((pano) => {
  22152. hides.push(pano);
  22153. });
  22154. this.panos.fadeMarkerOpacity(0, dur, [
  22155. { toOp: 0, member: hides },
  22156. ]);
  22157. };
  22158. if (opacity == 0) {
  22159. hideWhenFlyOut();
  22160. } else {
  22161. if (player.mode == "panorama" && currentPano) {
  22162. var shows = [],
  22163. hides = [];
  22164. player.model.panos.forEach((pano) => {
  22165. //是邻近点就显示否则隐藏
  22166. if (currentPano.neighbourPanos[pano.id]) {
  22167. shows.push(pano);
  22168. } else {
  22169. hides.push(pano);
  22170. }
  22171. });
  22172. this.panos.fadeMarkerOpacity(opacity, dur, [
  22173. { toOp: opacity, member: shows },
  22174. { toOp: 0, member: hides },
  22175. ]);
  22176. } else if (player.modeTran.split("-")[1] != "panorama") {
  22177. //飞出后marker隐藏
  22178. hideWhenFlyOut();
  22179. }
  22180. }
  22181. }),
  22182. (n.prototype.setSweepVisibility = function (e) {
  22183. this.panos.forEach(function (t) {
  22184. t.marker && (t.marker.visible = e);
  22185. });
  22186. }),
  22187. (n.prototype.outsideAllowed = function () {
  22188. return (
  22189. this.supportedModes[c.DOLLHOUSE] &&
  22190. this.supportedModes[c.FLOORPLAN]
  22191. );
  22192. }),
  22193. (n.prototype.addHighMapCube = function () {
  22194. //创建8*8的tile cube
  22195. if (
  22196. player.qualityManager.getMaxZoomClass() == "4k" &&
  22197. player.qualityManager.maxRenderTargetSize == 2048
  22198. ) {
  22199. var geo = new THREE.PlaneGeometry(1, 1, 1, 1);
  22200. var cube = new THREE.Object3D();
  22201. cube.tiles = [];
  22202. for (var cubeIndex = 0; cubeIndex < 6; cubeIndex++) {
  22203. var face = new THREE.Object3D();
  22204. for (var i = 0; i < 8; i++) {
  22205. for (var j = 0; j < 8; j++) {
  22206. var tile = new THREE.Mesh(
  22207. geo,
  22208. new THREE.MeshBasicMaterial({ side: 2 })
  22209. );
  22210. tile.position.set(i - 3.5, j - 3.5, -4);
  22211. if (highMapAddColor) {
  22212. tile.material.opacity = 0.4;
  22213. var colorHue = Math.random();
  22214. tile.material.color = new THREE.Color().setHSL(
  22215. colorHue,
  22216. 0.6,
  22217. 0.9
  22218. );
  22219. }
  22220. tile.material.transparent = true;
  22221. tile.material.depthTest /* = tile.material.depthWrite */ = false; //防止chunk比cube近从而被遮 且能不遮住box视频和热点等
  22222. tile.visible = false;
  22223. tile.tileX = i;
  22224. tile.tileY = j;
  22225. tile.cubeFace = cubeIndex;
  22226. tile.renderOrder = 2; //RenderOrder.highTileCube
  22227. cube.tiles.push(tile);
  22228. face.add(tile);
  22229. }
  22230. }
  22231. switch (cubeIndex) {
  22232. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  22233. face.rotation.set(0, Math.PI / 2, 0);
  22234. break;
  22235. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  22236. face.rotation.set(0, -Math.PI / 2, 0);
  22237. break;
  22238. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  22239. var rot1 = new THREE.Quaternion().setFromAxisAngle(
  22240. new THREE.Vector3(0, 1, 0),
  22241. Math.PI
  22242. );
  22243. var rot2 = new THREE.Quaternion().setFromAxisAngle(
  22244. new THREE.Vector3(1, 0, 0),
  22245. Math.PI / 2
  22246. );
  22247. face.quaternion.copy(rot1).multiply(rot2);
  22248. //face.rotation.set(Math.PI/2,0,0);
  22249. break;
  22250. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22251. //face.rotation.set(-Math.PI/2,0,0);
  22252. var rot1 = new THREE.Quaternion().setFromAxisAngle(
  22253. new THREE.Vector3(0, 1, 0),
  22254. Math.PI
  22255. );
  22256. var rot2 = new THREE.Quaternion().setFromAxisAngle(
  22257. new THREE.Vector3(1, 0, 0),
  22258. -Math.PI / 2
  22259. );
  22260. face.quaternion.copy(rot1).multiply(rot2);
  22261. break;
  22262. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  22263. face.rotation.set(0, Math.PI, 0);
  22264. break;
  22265. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22266. face.rotation.set(0, 0, 0);
  22267. }
  22268. face.scale.set(1, -1, 1);
  22269. cube.add(face);
  22270. }
  22271. cube.name = "highMapCube";
  22272. this.highMapCube = cube;
  22273. this.add(cube);
  22274. cube.scale.set(0.21, 0.21, 0.21); //camera.near is 0.1
  22275. this.highMapCube.visible = false;
  22276. this.highMapCube.texLoadedCount = 0;
  22277. player.once("pano.chosen", () => {
  22278. //wait sceneRenderer
  22279. player.sceneRenderer.on("after-render", (e) => {
  22280. if (this.highMapCube.visibleTiles) {
  22281. this.updateTiles();
  22282. }
  22283. if (player && player.lastFrameChanged) {
  22284. common.intervalTool.isWaiting(
  22285. "update4kTiles",
  22286. () => {
  22287. let vectorForward = player.getDirection();
  22288. this.updateTiles(vectorForward);
  22289. },
  22290. 500
  22291. );
  22292. }
  22293. });
  22294. });
  22295. }
  22296. });
  22297. /*
  22298. highMapCube会遮住场景中所有物体, 如果一定要显示的话,只能类似potree中的那样渲染一个深度贴图出来(model无需贴图),然后其他所有物体的shader中都加入一段代码。(貌似本身已经支持了?)
  22299. */
  22300. n.prototype.isHighMapLoaded = function (cubeFace, tileX, tileY) {
  22301. var tile =
  22302. this.highMapCube.children[cubeFace].children[tileX * 8 + tileY];
  22303. return !!tile.material.map;
  22304. };
  22305. n.prototype.updateTiles = function (direction) {
  22306. if (!this.highMapCube || !this.highMapCube.visible) return;
  22307. if (this.highMapCube.tiles.filter((e) => e.image).length <= 10)
  22308. return; //加载的太少了
  22309. //performance.mark('updateTiles-start')
  22310. if (direction) {
  22311. let camera = player.cameraControls.cameras.panorama;
  22312. let hfov =
  22313. THREE.Math.degToRad(
  22314. cameraLight.getHFOVForCamera(
  22315. camera,
  22316. $("#player").width(),
  22317. $("#player").height()
  22318. )
  22319. ) / 2;
  22320. let vfov = THREE.Math.degToRad(camera.fov) / 2;
  22321. /* let hcos = Math.cos(hfov / 2)
  22322. let vcos = Math.cos(vfov / 2) */
  22323. let list = this.highMapCube.tiles;
  22324. list.forEach((e) => {
  22325. //屏幕外的不显示
  22326. let pos = e.getWorldPosition(new THREE.Vector3());
  22327. let dir = new THREE.Vector3()
  22328. .subVectors(pos, this.highMapCube.position)
  22329. .normalize();
  22330. let hcos_ = dir
  22331. .clone()
  22332. .setY(direction.y)
  22333. .normalize()
  22334. .dot(direction); //在direction的斜面上水平角度差
  22335. let hRad = Math.acos(hcos_);
  22336. let vRad = -200;
  22337. if (hRad > hfov + 0.08) {
  22338. e.score = -100;
  22339. } else {
  22340. vRad = Math.abs(Math.acos(dir.y) - Math.acos(direction.y));
  22341. if (vRad > vfov + 0.08) {
  22342. e.score = -100;
  22343. } else {
  22344. e.score = -(hRad / hfov + vRad / vfov);
  22345. }
  22346. }
  22347. e.scores = hRad.toFixed(3) + ", " + vRad.toFixed(3);
  22348. if (e.score == -100) {
  22349. this.resetTile(e);
  22350. }
  22351. });
  22352. this.highMapCube.visibleTiles = list.filter(
  22353. (e) => e.score > -100
  22354. );
  22355. /* this.highMapCube.visibleTiles.sort((e,b)=>{return e.score-b.score})
  22356. this.highMapCube.visibleTiles = this.highMapCube.visibleTiles.slice(0,10)
  22357. */
  22358. //list.forEach(e=>e.scoreLabel.setText(e.scores))
  22359. }
  22360. let needRecover = this.highMapCube.visibleTiles.filter(
  22361. (e) => !e.material.map
  22362. );
  22363. if (needRecover.length) {
  22364. let maxCount = 1; //common.getBestCount({ name: '4kmaxTileRecover', minCount: 0, maxCount: 2, durBound1: 1.5, durBound2: 6, ifLog: false, maxHistory: 2 })
  22365. let count = 0;
  22366. needRecover.forEach((e, i) => {
  22367. //只更新若干个,因为太耗时了, 其余的等下帧更新
  22368. if (count >= maxCount) return;
  22369. let r = this.recoverTile(e);
  22370. if (r) count++;
  22371. });
  22372. }
  22373. };
  22374. n.prototype.getHighImage = function (image, cubeFace, tileX, tileY) {
  22375. this.gotSomeHighImg = true; //标记,需要马上updateTiles
  22376. let tile =
  22377. this.highMapCube.children[cubeFace].children[tileX * 8 + tileY];
  22378. tile.image = image; //先记录下来
  22379. };
  22380. n.prototype.updateHighMap = function (image, cubeFace, tileX, tileY) {
  22381. let tile =
  22382. this.highMapCube.children[cubeFace].children[tileX * 8 + tileY];
  22383. if (image) tile.image = image; //先记录下来
  22384. if (tile.material.map) return;
  22385. if (
  22386. this.highMapCube.visibleTiles &&
  22387. !this.highMapCube.visibleTiles.includes(tile)
  22388. ) {
  22389. return;
  22390. }
  22391. //简易创建贴图
  22392. /* var tex = this.$app.core.get('SceneRenderer').initSizedTexture2D(512, THREE.ClampToEdgeWrapping)
  22393. //var loaded = this.$app.core.get('Player').model.isHighMapLoaded(tile.cubeFace, tile.tileX, tile.tileY)
  22394. this.$app.core.get('SceneRenderer').uploadTexture2D(image, tex, 0, 0, 512, 512) //只替换tex对应的img,不新建
  22395. */
  22396. var tex = new THREE.Texture();
  22397. tex.image = image;
  22398. tex.flipY = false;
  22399. tex.wrapS = tex.wrapT = THREE.ClampToEdgeWrapping;
  22400. tex.generateMipmaps = false;
  22401. tex.minFilter = THREE.LinearFilter;
  22402. tex.needsUpdate = true;
  22403. tile.material.map = tex;
  22404. if (highMapAddColor) {
  22405. tile.material.opacity = 1;
  22406. }
  22407. tile.visible = true;
  22408. tile.material.needsUpdate = true; //发现每次开始放大但还未放大到4k时也会把之前加载过的4k加载
  22409. //console.log( {level:1} , 'updateHighMap', cubeFace, tileX, tileY)
  22410. };
  22411. n.prototype.recoverTile = function (tile) {
  22412. if (tile.material.map) return;
  22413. if (tile.image) {
  22414. this.updateHighMap(
  22415. tile.image,
  22416. tile.cubeFace,
  22417. tile.tileX,
  22418. tile.tileY
  22419. );
  22420. return true;
  22421. } else {
  22422. //console.log('no image')
  22423. }
  22424. };
  22425. n.prototype.resetTile = function (tile, kill) {
  22426. if (kill) {
  22427. //完全消灭
  22428. tile.image = null;
  22429. }
  22430. let map = tile.material.map;
  22431. if (map) {
  22432. map.dispose(); //这句其实无效。本来可以使用three自带的deallocateTexture(texture),但因为创建的方式不是普通的new Texture,所以并没有onTextureDispose的侦听,故要自己写
  22433. map.loaded = !1;
  22434. map.version = 0;
  22435. //这两句才是真正释放贴图资源的 ,类似app.sceneRenderer.deallocateCubeTexture(tile.material.map)
  22436. var h = player.sceneRenderer.renderer.properties.get(map);
  22437. player.sceneRenderer.renderer
  22438. .getContext()
  22439. .deleteTexture(h.__webglTexture);
  22440. tile.material.map = null;
  22441. if (highMapAddColor) {
  22442. tile.material.opacity = 0.4;
  22443. }
  22444. tile.material.needsUpdate = true;
  22445. tile.visible = false;
  22446. //this.highMapCube.texLoadedCount --
  22447. //console.log({level:1},'resetTile'/* , tile.cubeFace, tile.tileX, tile.tileY */)
  22448. }
  22449. };
  22450. n.prototype.resetHighMap = function () {
  22451. if (!this.highMapCube) return;
  22452. this.highMapCube.children.forEach((e) =>
  22453. e.children.forEach((tile) => {
  22454. this.resetTile(tile, true);
  22455. })
  22456. );
  22457. //this.highMapCube.texLoadedCount = 0
  22458. this.highMapCube.visibleTiles = null;
  22459. this.hideHighMap();
  22460. };
  22461. n.prototype.setHighMap = function (pano) {
  22462. if (!this.highMapCube) return;
  22463. this.highMapCube.position.copy(pano.position);
  22464. this.highMapCube.quaternion.copy(pano.quaternion);
  22465. };
  22466. n.prototype.showHighMap = function () {
  22467. if (!this.highMapCube) return;
  22468. this.highMapCube.visible = true;
  22469. };
  22470. n.prototype.hideHighMap = function () {
  22471. if (!this.highMapCube) return;
  22472. this.highMapCube.visible = false;
  22473. };
  22474. //缩小后继续显示cube呢还是不显示? 不显示的话,就要把cube上的复制到renderTarget上……会不会又崩溃,or没加载的显示???
  22475. t.exports = n;
  22476. }).call(this, "/js/model/Model.js");
  22477. },
  22478. {
  22479. "../constants": 8,
  22480. "../enum/AlignmentType": 17,
  22481. "../enum/RenderOrder": 42,
  22482. "../enum/Viewmode": 51,
  22483. "../exception/BasicException": 55,
  22484. "../label/Label": 90,
  22485. "../loaders/ModelLoader": 105,
  22486. "../loaders/ModelTextureLoader": 106,
  22487. "../loaders/SweepDataLoader": 107,
  22488. "../tag/tag": 123,
  22489. "./util/cameraLight": 184,
  22490. "../tag/tagManager": 124,
  22491. "../objects/BoundingTextureSkybox": 143,
  22492. "../objects/Chunk": 144,
  22493. "../objects/Floor": 146,
  22494. "../objects/Panorama": 148,
  22495. "../objects/Room": 150,
  22496. "../objects/Snapshot": 153,
  22497. "../settings": 166,
  22498. "../shaders": 167,
  22499. "../util/ModelUrls": 177,
  22500. "../util/PanoramaCollection": 178,
  22501. "../util/ajax": 181,
  22502. "../util/common": 185,
  22503. "../util/easing": 186,
  22504. "../util/lerp": 188,
  22505. "../util/logger": 189,
  22506. "../util/math": 190,
  22507. "../util/texture": 194,
  22508. "../util/transitions": 195,
  22509. "./../util/browser": 182,
  22510. "./../util/showcase": 193,
  22511. "./Chunks": 135,
  22512. "./FloorCollection": 136,
  22513. "./ImageCollection": 137,
  22514. "./LabelCollection": 138,
  22515. "./RoomCollection": 141,
  22516. events: 202,
  22517. three: 217,
  22518. hot: "hot",
  22519. "../enum/GLCubeFaces": 25,
  22520. },
  22521. ],
  22522. 140: [
  22523. function (e, t, i) {
  22524. "use strict";
  22525. function n() {
  22526. (this.modelMap = {}),
  22527. (this.activeModel = null),
  22528. (this.modelCount = 0),
  22529. (this.tileDownloader = null),
  22530. (this.panoRenderer = null);
  22531. }
  22532. var r = (e("three"), e("../util/common")),
  22533. o = e("../exception/BasicException"),
  22534. a = e("../enum/ModelManagerEvents"),
  22535. s = e("../enum/PanoRendererEvents"),
  22536. l = e("events").EventEmitter;
  22537. (n.prototype.init = function (e, t, i) {
  22538. (this.tileDownloader = e),
  22539. (this.panoRenderer = t),
  22540. (this.qualityManager = i),
  22541. this.bindEvents();
  22542. }),
  22543. (n.prototype.bindEvents = function () {
  22544. this.panoRenderer.on(
  22545. s.TileRenderSuccess,
  22546. this.onTileRendered.bind(this)
  22547. );
  22548. }),
  22549. (n.prototype.onTileRendered = function (e, t, i, n) {}),
  22550. (n.prototype.addModel = function (e) {
  22551. (this.modelMap[e.sid] = e),
  22552. 0 === this.modelCount && this.activateModel(e.sid),
  22553. this.modelCount++,
  22554. this.emit(a.ModelAdded);
  22555. }),
  22556. (n.prototype.getModel = function (e) {
  22557. return this.modelMap[e];
  22558. }),
  22559. (n.prototype.activateModel = function (e) {
  22560. var t = this.modelMap[e];
  22561. if (!t) throw new o("Tried to activate invalid model!");
  22562. var i = this.activeModel;
  22563. (this.activeModel = t),
  22564. this.tileDownloader.setPanoData(
  22565. t.panos,
  22566. t.listImagePanos(),
  22567. t.sid
  22568. ),
  22569. this.tileDownloader.setUrls(t.urls),
  22570. t.panos.forEach(
  22571. function (e) {
  22572. e.attachToPanoRenderer(this.panoRenderer),
  22573. (e.tileDownloader = this.tileDownloader),
  22574. (e.qualityManager = this.qualityManager);
  22575. }.bind(this)
  22576. ),
  22577. this.emit(a.ActiveModelChanged, {
  22578. oldModel: i,
  22579. model: t,
  22580. });
  22581. }),
  22582. (n.prototype.getActiveModel = function () {
  22583. return this.activeModel;
  22584. }),
  22585. r.extend(n, l),
  22586. (t.exports = n);
  22587. },
  22588. {
  22589. "../enum/ModelManagerEvents": 33,
  22590. "../enum/PanoRendererEvents": 35,
  22591. "../exception/BasicException": 55,
  22592. "../util/common": 185,
  22593. events: 202,
  22594. three: 217,
  22595. },
  22596. ],
  22597. 141: [
  22598. function (e, t, i) {
  22599. (function (i) {
  22600. "use strict";
  22601. function n() {
  22602. s.call(this);
  22603. }
  22604. var r = e("../objects/Room"),
  22605. o = (e("../settings"), e("../util/logger")),
  22606. a =
  22607. (e("../util/transitions"),
  22608. e("../util/easing"),
  22609. e("../util/common")),
  22610. s = e("../util/IndexedCollection"),
  22611. l = e("./Chunks");
  22612. new o(i);
  22613. a.inherit(n, s),
  22614. (n.prototype.getIndex = function (e) {
  22615. return e.roomId;
  22616. }),
  22617. (n.prototype.calcRoomBoundaries = function () {
  22618. this.forEach(function (e) {
  22619. e.calcBoundaries();
  22620. });
  22621. }),
  22622. (n.prototype.createFromChunks = function (e) {
  22623. var t = {
  22624. floorId: -1,
  22625. roomId: -1,
  22626. },
  22627. i = {};
  22628. e.forEach(
  22629. function (e) {
  22630. l.parseIdsFromChunkName(e.name, t);
  22631. var o = i[t.roomId];
  22632. if (!o) {
  22633. var a = n.generateRoomId(t.floorId, t.roomId);
  22634. (o = new r(t.floorId, a)), this.add(o), (i[t.roomId] = o);
  22635. }
  22636. o.addChunk(e);
  22637. }.bind(this)
  22638. ),
  22639. this.calcRoomBoundaries();
  22640. }),
  22641. (n.generateRoomId = function (e, t) {
  22642. return e + "_" + t;
  22643. }),
  22644. (t.exports = n);
  22645. }).call(this, "/js/model/RoomCollection.js");
  22646. },
  22647. {
  22648. "../objects/Room": 150,
  22649. "../settings": 166,
  22650. "../util/IndexedCollection": 175,
  22651. "../util/common": 185,
  22652. "../util/easing": 186,
  22653. "../util/logger": 189,
  22654. "../util/transitions": 195,
  22655. "./Chunks": 135,
  22656. },
  22657. ],
  22658. 142: [
  22659. function (e, t, i) {
  22660. "use strict";
  22661. function n(e, t, i) {
  22662. e = e.clone().expandByScalar(0.01); //改
  22663. var n = e.size(),
  22664. o = new r.BoxGeometry(n.x, n.y, n.z);
  22665. (o.boundingBox = e),
  22666. r.Mesh.call(this, o, t),
  22667. this.position.copy(e.center()),
  22668. (this.frustumCulled = !1),
  22669. i && this.add(new r.WireframeHelper(this));
  22670. }
  22671. var r = e("three");
  22672. (n.prototype = Object.create(r.Mesh.prototype)),
  22673. (n.prototype.constructor = n),
  22674. (t.exports = n);
  22675. },
  22676. {
  22677. three: 217,
  22678. },
  22679. ],
  22680. 143: [
  22681. function (e, t, i) {
  22682. (function (i) {
  22683. "use strict";
  22684. function n(e) {
  22685. h.time("Computing a nice bounding cubemap");
  22686. var t = new a({
  22687. side: r.BackSide,
  22688. transparent: !0,
  22689. });
  22690. (t.uniforms.modelAlpha.value = 0),
  22691. (t.uniforms.opacity.value = 1 - s.modelAlpha),
  22692. (this.renderOrder = l.boundingSkybox),
  22693. o.call(this, e, t),
  22694. h.timeEnd("Computing a nice bounding cubemap");
  22695. }
  22696. var r = e("three"),
  22697. o = (e("../enum/Viewmode"), e("../shaders"), e("./BoundingMesh")),
  22698. a = e("../materials/ModelTextureMaterial"),
  22699. s = e("../settings"),
  22700. l = e("../enum/RenderOrder"),
  22701. c = e("../util/logger"),
  22702. h = new c(i);
  22703. (n.prototype = Object.create(o.prototype)),
  22704. (n.prototype.constructor = n),
  22705. (t.exports = n);
  22706. }).call(this, "/js/objects/BoundingTextureSkybox.js");
  22707. },
  22708. {
  22709. "../enum/RenderOrder": 42,
  22710. "../enum/Viewmode": 51,
  22711. "../materials/ModelTextureMaterial": 118,
  22712. "../settings": 166,
  22713. "../shaders": 167,
  22714. "../util/logger": 189,
  22715. "./BoundingMesh": 142,
  22716. three: 217,
  22717. },
  22718. ],
  22719. 144: [
  22720. function (e, t, i) {
  22721. "use strict";
  22722. function n(e) {
  22723. this.materialInside = new s({
  22724. side: r.DoubleSide,
  22725. });
  22726. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  22727. (this.materialOutside = new r.RawShaderMaterial({
  22728. fragmentShader: o.modelOutside.fragmentShader,
  22729. vertexShader: o.modelOutside.vertexShader,
  22730. uniforms: t,
  22731. side: r.FrontSide,
  22732. name: "chunkOut",
  22733. })),
  22734. r.Mesh.call(this, e.geometry, this.materialInside),
  22735. (this.name = e.name || ""),
  22736. (this.textureName = e.textureName),
  22737. (this.meshUrl = e.meshUrl);
  22738. }
  22739. var r = e("three"),
  22740. o = e("../shaders"),
  22741. a = e("../enum/Viewmode"),
  22742. s = e("../materials/ModelTextureMaterial");
  22743. (n.prototype = Object.create(r.Mesh.prototype)),
  22744. (n.prototype.setTextureMap = function (e) {
  22745. (this.materialInside.uniforms.map.value = e),
  22746. (this.materialOutside.uniforms.map.value = e);
  22747. }),
  22748. (n.prototype.setMode = function (e) {
  22749. var t =
  22750. e === a.DOLLHOUSE || e === a.FLOORPLAN
  22751. ? this.materialOutside
  22752. : this.materialInside;
  22753. (t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide),
  22754. (t.transparent = this.material.transparent),
  22755. (t.uniforms.opacity.value = this.material.uniforms.opacity.value),
  22756. (this.material = t);
  22757. }),
  22758. (t.exports = n);
  22759. },
  22760. {
  22761. "../enum/Viewmode": 51,
  22762. "../materials/ModelTextureMaterial": 118,
  22763. "../shaders": 167,
  22764. three: 217,
  22765. },
  22766. ],
  22767. 145: [
  22768. function (e, t, i) {
  22769. "use strict";
  22770. function n(e) {
  22771. (this.chunksize = e || 10),
  22772. (this.chunks = {}),
  22773. (this.boundingBoxes = {}),
  22774. (this.children = []),
  22775. (this.offset = new r.Vector3(0, 0.5, 0)),
  22776. (this.material = new r.MeshBasicMaterial({
  22777. color: 16777215 * Math.random(),
  22778. side: r.DoubleSide,
  22779. }));
  22780. }
  22781. var r = e("three");
  22782. e("../enum/Viewmode");
  22783. (n.prototype.add = function (e) {
  22784. var t,
  22785. i,
  22786. n,
  22787. o,
  22788. a,
  22789. s,
  22790. l,
  22791. c,
  22792. h,
  22793. u,
  22794. d,
  22795. p,
  22796. f,
  22797. g,
  22798. m = e.attributes;
  22799. m
  22800. ? ((t = m.position.array),
  22801. (i = void 0 !== e.index ? e.index.array : void 0))
  22802. : ((t = e.vertices), (n = e.faces));
  22803. var v = new r.Vector3();
  22804. if (i)
  22805. for (o = 0, a = i.length; o < a; o += 3) {
  22806. var A = 3 * i[o],
  22807. y = 3 * i[o + 1],
  22808. C = 3 * i[o + 2];
  22809. (s = (t[A] + t[y] + t[C]) / 3),
  22810. (l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3),
  22811. (c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3),
  22812. (h = Math.floor(s / this.chunksize)),
  22813. (u = Math.floor(l / this.chunksize)),
  22814. (d = Math.floor(c / this.chunksize)),
  22815. (p = h + "." + u + "." + d),
  22816. p in this.chunks
  22817. ? ((g = this.chunks[p]), (f = this.boundingBoxes[p]))
  22818. : ((g = this.chunks[p] = []),
  22819. (f = this.boundingBoxes[p] = new r.Box3())),
  22820. g.push(
  22821. t[A],
  22822. t[A + 1],
  22823. t[A + 2],
  22824. t[y],
  22825. t[y + 1],
  22826. t[y + 2],
  22827. t[C],
  22828. t[C + 1],
  22829. t[C + 2]
  22830. ),
  22831. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  22832. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  22833. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]));
  22834. }
  22835. else
  22836. for (o = 0, a = t.length; o < a; o += 9)
  22837. (s = (t[o] + t[o + 3] + t[o + 6]) / 3),
  22838. (l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3),
  22839. (c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3),
  22840. (h = Math.floor(s / this.chunksize)),
  22841. (u = Math.floor(l / this.chunksize)),
  22842. (d = Math.floor(c / this.chunksize)),
  22843. (p = h + "." + u + "." + d),
  22844. p in this.chunks
  22845. ? ((g = this.chunks[p]), (f = this.boundingBoxes[p]))
  22846. : ((g = this.chunks[p] = []),
  22847. (f = this.boundingBoxes[p] = new r.Box3())),
  22848. g.push(
  22849. t[o],
  22850. t[o + 1],
  22851. t[o + 2],
  22852. t[o + 3],
  22853. t[o + 4],
  22854. t[o + 5],
  22855. t[o + 6],
  22856. t[o + 7],
  22857. t[o + 8]
  22858. ),
  22859. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  22860. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  22861. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]));
  22862. }),
  22863. (n.prototype.build = function () {
  22864. var e = new r.Object3D();
  22865. e.material = this.material;
  22866. for (var t in this.chunks) {
  22867. var i = this.chunks[t],
  22868. n = new r.BufferGeometry();
  22869. n.addAttribute(
  22870. "position",
  22871. new r.BufferAttribute(new Float32Array(i), 3)
  22872. ),
  22873. (n.boundingBox = this.boundingBoxes[t]);
  22874. var o = new r.Mesh(n, this.material);
  22875. (o.material.visible = !1), e.add(o), (this.chunks[t] = []);
  22876. }
  22877. return e;
  22878. }),
  22879. (t.exports = n);
  22880. },
  22881. {
  22882. "../enum/Viewmode": 51,
  22883. three: 217,
  22884. },
  22885. ],
  22886. 146: [
  22887. function (e, t, i) {
  22888. "use strict";
  22889. var r = e("three"),
  22890. o = e("../settings"),
  22891. a = e("../util/common"),
  22892. s = e("../util/lerp"),
  22893. l = e("./ChunkedCollider"),
  22894. c = e("../util/transitions"),
  22895. h = e("../util/easing"),
  22896. u = (e("../objects/Panorama"), e("../enum/RenderOrder")),
  22897. d = e("../localization/localize");
  22898. function n(e, t, i) {
  22899. r.Object3D.call(this),
  22900. (this.model = e),
  22901. (this.floorIndex = t),
  22902. (this.lang = o.languageTag),
  22903. (this.name =
  22904. i || o.languageTag === "cn"
  22905. ? "Floor " + (t + 1) + ""
  22906. : "第" + (t + 1) + "层"),
  22907. (this.panos = []),
  22908. (this.chunks = []),
  22909. (this.colliderBuilder = new l(3)),
  22910. (this.collider = null),
  22911. (this.center = null),
  22912. (this.boundingBox = new r.Box3()),
  22913. (this.size = null),
  22914. (this.hidden = !1),
  22915. (this.conservativeBoundingBox = new r.Box3()),
  22916. (this.debugColor = 16777215 * Math.random()),
  22917. (this.transition = null);
  22918. }
  22919. (n.prototype = Object.create(r.Object3D.prototype)),
  22920. (n.prototype.enter = function (e) {
  22921. this.model.setFloor(this, e);
  22922. }),
  22923. (n.prototype.hide = function (e) {
  22924. if (!this.hidden || this.transition) {
  22925. this.chunks.forEach(function (e) {
  22926. e.material.transparent = !0;
  22927. }),
  22928. c.cancel(this.transition);
  22929. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay,
  22930. i = e ? 0 : o.hideFloorDelay / t;
  22931. this.transition = c.start(
  22932. s.allUniforms(this.chunks, "opacity", 0.08),
  22933. t,
  22934. function () {
  22935. this.hidden = !0;
  22936. }.bind(this),
  22937. i,
  22938. h.easeInOutQuad
  22939. );
  22940. }
  22941. }),
  22942. (n.prototype.show = function (e) {
  22943. if (this.hidden || this.transition) {
  22944. (this.hidden = !1), c.cancel(this.transition);
  22945. var t = e
  22946. ? o.showFloorDuration
  22947. : o.showFloorDuration + o.showFloorDelay,
  22948. i = e ? 0 : o.showFloorDelay / t;
  22949. this.transition = c.start(
  22950. s.allUniforms(this.chunks, "opacity", 1),
  22951. t,
  22952. function () {
  22953. this.hidden ||
  22954. this.chunks.forEach(function (e) {
  22955. e.material.transparent = !1;
  22956. });
  22957. }.bind(this),
  22958. i,
  22959. h.easeInOutQuad
  22960. );
  22961. }
  22962. }),
  22963. (n.prototype.toggle = function (e, t) {
  22964. (e = void 0 === e ? this.hidden : e),
  22965. e ? this.show(t) : this.hide(t);
  22966. }),
  22967. (n.prototype.containsPoint = function (e) {
  22968. return this.collider.children.some(function (t) {
  22969. return (
  22970. t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  22971. t.geometry.boundingBox.containsPoint(e)
  22972. );
  22973. });
  22974. }),
  22975. (n.prototype.distanceToPoint = function (e) {
  22976. var t = null,
  22977. i = 1 / 0;
  22978. return (
  22979. this.collider.children.forEach(function (n) {
  22980. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  22981. var r = n.geometry.boundingBox.distanceToPoint(e);
  22982. (!t || i > r) && ((i = r), (t = n));
  22983. }),
  22984. i
  22985. );
  22986. }),
  22987. (n.prototype.addChunk = function (e) {
  22988. (e.renderOrder = u.ghostFloor),
  22989. this.add(e),
  22990. this.chunks.push(e),
  22991. this.boundingBox.union(e.geometry.boundingBox),
  22992. (this.size = this.boundingBox.size()),
  22993. this.colliderBuilder.add(e.geometry);
  22994. }),
  22995. (n.prototype.addPano = function (e) {
  22996. this.panos.push(e),
  22997. this.add(e.skyboxMesh),
  22998. e.marker && this.add(e.marker);
  22999. if (e.neighbourUUIDs && e.neighbourUUIDs.length) {
  23000. //add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  23001. var t = new r.Vector3(1, 1, 1),
  23002. i = new r.Box3().setFromCenterAndSize(e.position, t);
  23003. this.boundingBox.union(i);
  23004. }
  23005. }),
  23006. (n.prototype.build = function () {
  23007. (this.collider = this.colliderBuilder.build(!0)),
  23008. this.add(this.collider),
  23009. (this.center = this.boundingBox.center()),
  23010. this.conservativeBoundingBox.copy(this.boundingBox),
  23011. (this.conservativeBoundingBox.min.y = a.lowerMedian(
  23012. this.collider.children.map(function (e) {
  23013. return e.geometry.boundingBox.min.y;
  23014. }),
  23015. 5
  23016. )),
  23017. (this.conservativeBoundingBox.max.y = a.lowerMedian(
  23018. this.collider.children.map(function (e) {
  23019. return e.geometry.boundingBox.max.y;
  23020. }),
  23021. 5
  23022. )),
  23023. (this.colliderBuilder = null);
  23024. }),
  23025. (n.prototype.toShortString = function () {
  23026. return a.nth(this.floorIndex + 1);
  23027. }),
  23028. (n.prototype.toString = function () {
  23029. return this.name;
  23030. }),
  23031. (t.exports = n);
  23032. },
  23033. {
  23034. "../enum/RenderOrder": 42,
  23035. "../localization/localize": 108,
  23036. "./strings-cn-CN": 109,
  23037. "../objects/Panorama": 148,
  23038. "../settings": 166,
  23039. "../util/common": 185,
  23040. "../util/easing": 186,
  23041. "../util/lerp": 188,
  23042. "../util/transitions": 195,
  23043. "./ChunkedCollider": 145,
  23044. three: 217,
  23045. },
  23046. ],
  23047. 147: [
  23048. function (e, t, i) {
  23049. "use strict";
  23050. function n(e) {
  23051. (this.player = e),
  23052. (this.obj3d = null),
  23053. (this.UP = new r.Vector3(0, 1, 0));
  23054. }
  23055. var r = e("three"),
  23056. o = e("../settings");
  23057. (n.prototype.prefs = {
  23058. linewidth: 3,
  23059. height: 0.07,
  23060. opacity: 0.45,
  23061. endScale: 0.05,
  23062. }),
  23063. (n.prototype.discard = function () {
  23064. if (this.obj3d) {
  23065. var e = this.obj3d.parent;
  23066. e && e.remove(this.obj3d);
  23067. }
  23068. this.obj3d = null;
  23069. }),
  23070. (n.prototype.draw = function () {
  23071. if ((this.discard(), o.showNeighbors)) {
  23072. var e = this.player.currentPano.floor;
  23073. this.obj3d = new r.Object3D();
  23074. var t = this.player.model.panos.getNeighbours(
  23075. this.player.currentPano
  23076. ),
  23077. i = this.player.currentPano.floorPosition
  23078. .clone()
  23079. .sub(this.player.model.position);
  23080. i.y += this.prefs.height;
  23081. var n = 0.1525,
  23082. a = 0.127,
  23083. s = 0.0127,
  23084. l = 0.1,
  23085. c = 0.19,
  23086. h = 0.2032,
  23087. u = 0.2286,
  23088. d = 0.255,
  23089. p = new r.Matrix4();
  23090. for (var f in t)
  23091. if (t[f]) {
  23092. var g = this.player.model.panos.get(f),
  23093. m =
  23094. (g.position.clone().sub(this.player.model.position),
  23095. g.position.clone().sub(g.floorPosition)),
  23096. v = g.floorPosition.clone().sub(this.player.model.position);
  23097. v.y += this.prefs.height;
  23098. var A = new r.Geometry();
  23099. A.vertices.push(
  23100. new r.Vector3(0, -s, 0),
  23101. new r.Vector3(-s, 0, 0),
  23102. new r.Vector3(0, s, 0),
  23103. new r.Vector3(s, 0, 0),
  23104. new r.Vector3(0, -s, 0)
  23105. ),
  23106. A.vertices.push(
  23107. new r.Vector3(0, -d, 0),
  23108. new r.Vector3(d, -d, 0),
  23109. new r.Vector3(d, n, 0),
  23110. new r.Vector3(-n, n, 0),
  23111. new r.Vector3(-n, a, 0),
  23112. new r.Vector3(-c, l, 0),
  23113. new r.Vector3(-c, -h, 0),
  23114. new r.Vector3(-n, -u, 0),
  23115. new r.Vector3(-n, -d, 0),
  23116. new r.Vector3(0, -d, 0)
  23117. ),
  23118. p.identity().setPosition(m),
  23119. A.applyMatrix(p),
  23120. A.vertices.push(new r.Vector3(0, -this.prefs.endScale, 0)),
  23121. A.vertices.push(
  23122. new r.Vector3(
  23123. -this.prefs.endScale,
  23124. -this.prefs.endScale,
  23125. 0
  23126. ),
  23127. new r.Vector3(
  23128. -this.prefs.endScale,
  23129. this.prefs.endScale,
  23130. 0
  23131. ),
  23132. new r.Vector3(
  23133. this.prefs.endScale,
  23134. this.prefs.endScale,
  23135. 0
  23136. ),
  23137. new r.Vector3(
  23138. this.prefs.endScale,
  23139. -this.prefs.endScale,
  23140. 0
  23141. )
  23142. ),
  23143. p.lookAt(v, i, this.UP).setPosition(v),
  23144. A.applyMatrix(p),
  23145. A.vertices.push(v, i);
  23146. var y = new r.Line(
  23147. A,
  23148. new r.LineBasicMaterial({
  23149. color: g.debugColor.getHex(),
  23150. transparent: !0,
  23151. opacity: this.prefs.opacity,
  23152. depthWrite: !1,
  23153. name: "sLine" + f,
  23154. linewidth: this.prefs.linewidth,
  23155. })
  23156. );
  23157. this.obj3d.add(y);
  23158. }
  23159. e.add(this.obj3d);
  23160. }
  23161. }),
  23162. (n.prototype.update = function () {
  23163. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld();
  23164. }),
  23165. (t.exports = n);
  23166. },
  23167. {
  23168. "../settings": 166,
  23169. three: 217,
  23170. },
  23171. ],
  23172. 148: [
  23173. function (e, t, i) {
  23174. (function (i) {
  23175. "use strict";
  23176. function n(e, t, i, n) {
  23177. (this.model = e),
  23178. (this.id = t),
  23179. (this.alignmentType = i.alignmentType || l.ALIGNED),
  23180. (this.neighbourUUIDs = i.neighbours || null),
  23181. (this.neighbourPanos = null),
  23182. (this.floor = null),
  23183. (this.floorIndex = i.floor),
  23184. (this.failedLoadingAt = 0),
  23185. (this.maxLoadRetries = 4),
  23186. (this.origin = i.position.clone()),
  23187. (this.position =
  23188. this.alignmentType === l.UNALIGNED
  23189. ? new r.Vector3(0, -5, 0)
  23190. : i.position.clone()),
  23191. (this.quaternion = i.quaternion.clone()),
  23192. (this.skyboxMesh = new r.Mesh(E)),
  23193. this.skyboxMesh.position.copy(this.position),
  23194. this.skyboxMesh.quaternion.copy(this.quaternion),
  23195. (this.skyboxMesh.name = "skybox"),
  23196. (this.skyboxMesh.visible = !1),
  23197. this.skyboxMesh.updateMatrix(),
  23198. this.skyboxMesh.updateMatrixWorld(),
  23199. (this.marker = null),
  23200. (this.showFloorMarker = !window.DATA.hideFloorMarker);
  23201. if (this.isAligned()) {
  23202. (this.marker = new r.Mesh(
  23203. b,
  23204. new r.MeshBasicMaterial({
  23205. map: w,
  23206. side: r.DoubleSide,
  23207. opacity: 0,
  23208. transparent: !0,
  23209. depthWrite: !1,
  23210. })
  23211. )),
  23212. (this.marker.visible = false); //改:先不显示,之后根据opacity显示
  23213. (this.marker.renderOrder = s.panoMarker),
  23214. (this.marker.name = "marker"),
  23215. (this.marker.pano = this),
  23216. this.marker.layers.set(v.PANOMARKERS),
  23217. this.marker.updateMatrixWorld();
  23218. if (!window.DATA.hideFloorMarker) {
  23219. //xzw
  23220. let opa = this.marker.material.opacity;
  23221. Object.defineProperty(this.marker.material, "opacity", {
  23222. get: function () {
  23223. return opa;
  23224. },
  23225. set: (o) => {
  23226. opa = o;
  23227. convertTool.updateVisible(
  23228. this.marker,
  23229. "hideWhenZeroOpa",
  23230. o > 0
  23231. );
  23232. //if(o==0)console.log('o==0',this.id,this.marker.visible)
  23233. //console.log(o,this.id,this.marker.visible)
  23234. },
  23235. });
  23236. }
  23237. a.colorMarkerOnLoad &&
  23238. this.on("load", function () {
  23239. this.marker.material.color.set(65280);
  23240. });
  23241. }
  23242. (this.debugColor = new r.Color().setHSL(
  23243. 0.06 + 0.53 * Math.random(),
  23244. 0.8 + 0.2 * Math.random(),
  23245. 0.5 + 0.2 * Math.random()
  23246. )),
  23247. (this.floorPosition = i.puck ? i.puck.clone() : null),
  23248. (this.tiled = n),
  23249. this.tiled
  23250. ? (this.solidSkybox = null)
  23251. : ((this.solidSkybox = new r.Texture([
  23252. null,
  23253. null,
  23254. null,
  23255. null,
  23256. null,
  23257. null,
  23258. ])),
  23259. (this.solidSkybox.flipY = !1),
  23260. a.minimalMemoryMode &&
  23261. ((this.solidSkybox.minFilter = r.LinearFilter),
  23262. (this.solidSkybox.magFilter = r.LinearFilter),
  23263. (this.solidSkybox.generateMipmaps = !1))),
  23264. (this.zoomed = !1),
  23265. (this.panoRenderer = null),
  23266. (this.qualityManager = null),
  23267. (this.tileDownloader = null),
  23268. (this.tiledPanoRenderTarget = null),
  23269. (this.minimumTiledPanoLoaded = !1),
  23270. (this.highestPartialTileRenderOpCompleted = 0),
  23271. (this.highestFullTileRenderOpCompleted = 0),
  23272. (this.shouldRedrawOnBaseLoaded = !1),
  23273. (this.lockUntilRenderingComplete = !1),
  23274. a.colorMarkerOnLoad &&
  23275. this.on("load", function () {
  23276. this.marker.material.color.set(65280);
  23277. });
  23278. /********************************************************************fyz改vr from徐世廷*************************************************************/
  23279. var e = new r.TextureLoader();
  23280. e.setCrossOrigin(!0);
  23281. var g = e.load("images/texture.jpg");
  23282. if (
  23283. ((this.vrMarker = new r.Mesh(
  23284. new r.OctahedronGeometry(0.1, 0),
  23285. new r.MeshLambertMaterial({
  23286. color: 16777215,
  23287. transparent: !0,
  23288. opacity: 0.75,
  23289. map: g,
  23290. })
  23291. )),
  23292. (this.vrMarker.boluoType = "vr"),
  23293. (this.vrMarker.position.z = 1),
  23294. (this.vrMarker.enabled = !0),
  23295. (this.vrMarker.visible = !1),
  23296. (window.vrMarkers = window.vrMarkers || []),
  23297. window.vrMarkers.push(this.vrMarker),
  23298. this.marker && this.marker.add(this.vrMarker),
  23299. a.showAxis &&
  23300. (this.skyboxMesh.add(
  23301. new r.ArrowHelper(
  23302. new r.Vector3(0, 1, 0),
  23303. new r.Vector3(0, 0, 0),
  23304. 1,
  23305. 255
  23306. )
  23307. ),
  23308. this.skyboxMesh.add(
  23309. new r.ArrowHelper(
  23310. new r.Vector3(0, 0, 1),
  23311. new r.Vector3(0, 0, 0),
  23312. 1,
  23313. 16711680
  23314. )
  23315. ),
  23316. this.skyboxMesh.add(
  23317. new r.ArrowHelper(
  23318. new r.Vector3(1, 0, 0),
  23319. new r.Vector3(0, 0, 0),
  23320. 1,
  23321. 65280
  23322. )
  23323. )),
  23324. this.adjustAngleEnable)
  23325. ) {
  23326. var i = new r.Quaternion();
  23327. i.setFromAxisAngle(new r.Vector3(1, 0, 0), this.adjustAngleX),
  23328. this.skyboxMesh.quaternion.multiply(i);
  23329. var m = new r.Quaternion();
  23330. m.setFromAxisAngle(new r.Vector3(0, 1, 0), this.adjustAngleY),
  23331. this.skyboxMesh.quaternion.multiply(m);
  23332. var n = new r.Quaternion();
  23333. n.setFromAxisAngle(new r.Vector3(0, 0, 1), this.adjustAngleZ),
  23334. this.skyboxMesh.quaternion.multiply(n),
  23335. this.skyboxMesh.updateMatrix(),
  23336. this.skyboxMesh.updateMatrixWorld(),
  23337. this.model.updateProjectedPanos();
  23338. }
  23339. /**************************************************************************************************************************************/
  23340. }
  23341. var r = e("three"),
  23342. o = e("../util/logger"),
  23343. a = e("../settings"),
  23344. s = (e("../enum/Viewmode"), e("../enum/RenderOrder")),
  23345. l = e("../enum/AlignmentType"),
  23346. c = (e("../util/common"), e("../util/transitions")),
  23347. h = e("../util/lerp"),
  23348. u = e("../util/ajax"),
  23349. d = e("../util/texture"),
  23350. p = e("../util/panorama"),
  23351. f =
  23352. (e("../enum/TileDownloaderEvents"), e("../enum/PanoramaEvents")),
  23353. g = e("../enum/PanoRendererEvents"),
  23354. m = e("../enum/PanoSizeClass"),
  23355. v = e("../enum/RenderLayers"),
  23356. A =
  23357. (e("../scene/SceneRenderer"),
  23358. e("../enum/GLCubeFaces"),
  23359. e("../exception/BasicException")),
  23360. y = e("../tile/TileUtils"),
  23361. C = e("events").EventEmitter,
  23362. I = new o(i),
  23363. E = new r.SphereBufferGeometry(0.1),
  23364. b = new r.PlaneBufferGeometry(0.4, 0.4, 1, 1),
  23365. w = d.load("images/marker-256x256.png");
  23366. w.anisotropy = browser.isMobile() ? 1 : 3; //add
  23367. (n.prototype = Object.create(C.prototype)),
  23368. (n.prototype.enter = (function () {
  23369. var e = null;
  23370. return function () {
  23371. this.setZoomed(!1),
  23372. this.emit("enter", {
  23373. oldPano: e,
  23374. newPano: this,
  23375. }),
  23376. (e = this);
  23377. this.model.setHighMap(this); //add
  23378. };
  23379. })()),
  23380. (n.prototype.exit = function () {
  23381. this.tiled
  23382. ? (this.clearWaitDeferreds(),
  23383. (this.minimumTiledPanoLoaded = !1),
  23384. (this.tiledPanoRenderTarget = null),
  23385. this.setZoomed(!1),
  23386. this.panoRenderer.deactivateTiledPano(this),
  23387. (this.highestPartialTileRenderOpCompleted = 0),
  23388. (this.highestFullTileRenderOpCompleted = 0))
  23389. : (this.solidSkybox.dispose(),
  23390. (this.solidSkybox.loaded = !1),
  23391. (this.solidSkybox.version = 0)),
  23392. this.emit("exit");
  23393. }),
  23394. (n.prototype.hoverOn = function (e) {
  23395. this.marker &&
  23396. (c.start(
  23397. h.property(
  23398. this.marker.material,
  23399. "opacity",
  23400. a[e].markerOpacityOnHover
  23401. ),
  23402. 250
  23403. ),
  23404. a.navigation.panoScores & a.navigation.mouseDirection &&
  23405. this.addTextSprite("HIT", 12525854));
  23406. }),
  23407. (n.prototype.hoverOff = function (e) {
  23408. this.marker &&
  23409. c.start(
  23410. h.property(
  23411. this.marker.material,
  23412. "opacity",
  23413. a[e].markerOpacity
  23414. ),
  23415. 250
  23416. );
  23417. }),
  23418. (n.prototype.build1 = function () {
  23419. (this.floor =
  23420. this.floor ||
  23421. this.model.floors.get(this.floorIndex) ||
  23422. (this.model.floors.list.length == 1
  23423. ? this.model.floors.list[0]
  23424. : this.raycastToFindFloor()) ||
  23425. this.model.getFloorAtPoint(this.position)),
  23426. this.floor.addPano(this),
  23427. (this.floorPosition =
  23428. this.floorPosition || this.raycastFloorPosition()),
  23429. (this.neighbourPanos =
  23430. this.neighbourPanos || this.findNeighourPanos()),
  23431. a.colorMarkerByFloor &&
  23432. this.marker &&
  23433. this.marker.material.color.set(this.floor.debugColor);
  23434. }),
  23435. (n.prototype.build2 = function () {
  23436. (this.floorPosition =
  23437. this.floorPosition || this.interpolateFloorPosition()),
  23438. (this.height = this.position.distanceTo(this.floorPosition)),
  23439. this.placeMarker();
  23440. }),
  23441. (n.prototype.interpolateFloorPosition = function () {
  23442. var e = this.model.panos
  23443. .filter(n.filters.isNeighbourPanoTo(this))
  23444. .filter(function (e) {
  23445. return !!e.floorPosition;
  23446. })
  23447. .sort(
  23448. function (e, t) {
  23449. return (
  23450. e.position.distanceTo(this.position) -
  23451. t.position.distanceTo(this.position)
  23452. );
  23453. }.bind(this)
  23454. ),
  23455. t = this.position.clone();
  23456. return (
  23457. e.length >= 2
  23458. ? (t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2)
  23459. : t.add(a.noMeshFloorPositionOffset),
  23460. t
  23461. );
  23462. }),
  23463. (n.prototype.raycastFloorPosition = function () {
  23464. I.warn("Performance warning: Raycasting to find floor position");
  23465. var e = new r.Raycaster(this.position, new r.Vector3(0, -1, 0)),
  23466. t = e.intersectObjects(this.model.colliders);
  23467. return t.length ? t[0].point : null;
  23468. }),
  23469. (n.prototype.raycastToFindFloor = (function () {
  23470. var e = [
  23471. new r.Vector3(0, -1, 0),
  23472. new r.Vector3(1, -1, 0),
  23473. new r.Vector3(0, -1, 1),
  23474. new r.Vector3(-1, -1, 0),
  23475. new r.Vector3(0, -1, -1),
  23476. new r.Vector3(1, 0, 0),
  23477. new r.Vector3(0, 0, 1),
  23478. new r.Vector3(-1, 0, 0),
  23479. new r.Vector3(0, 0, -1),
  23480. ];
  23481. return function () {
  23482. I.warn("Performance warning: Raycasting to find floor index");
  23483. for (var t = 0; t < e.length; t++) {
  23484. var i = new r.Raycaster(this.position.clone(), e[t].clone()),
  23485. n = i.intersectObjects(this.model.colliders);
  23486. if (n.length) return n[0].object.parent.parent;
  23487. }
  23488. return null;
  23489. };
  23490. })()),
  23491. (n.prototype.placeMarker = function () {
  23492. this.marker &&
  23493. (this.marker.position.copy(this.floorPosition),
  23494. (this.marker.position.y += 0.05),
  23495. this.marker.lookAt(
  23496. new r.Vector3(0, 1, 0).add(this.marker.position)
  23497. ));
  23498. }),
  23499. (n.prototype.translate = function (e) {
  23500. this.position.add(e), this.floorPosition.add(e);
  23501. }),
  23502. (n.prototype.findClosestMidtpointPanoTo = function (e) {
  23503. new r.Vector3()
  23504. .addVectors(this.position, e.position)
  23505. .divideScalar(2);
  23506. return this.model.panos.find(
  23507. [n.filters.notIn([this, e])],
  23508. [n.sortFunctions.distanceToPoint(point)]
  23509. );
  23510. }),
  23511. (n.prototype.attachToPanoRenderer = function (e) {
  23512. (this.panoRenderer = e),
  23513. this.panoRenderer.on(
  23514. g.TileRenderSuccess,
  23515. this.onTileRendered.bind(this)
  23516. ),
  23517. this.panoRenderer.on(
  23518. g.PanoRenderComplete,
  23519. this.onPanoRendered.bind(this)
  23520. ),
  23521. this.panoRenderer.on(
  23522. g.TileRenderFailure,
  23523. this.onTileRenderFail.bind(this)
  23524. ),
  23525. this.panoRenderer.on(
  23526. g.UploadAttemptedForAllTiles,
  23527. this.onUploadAttemptedForAllTiles.bind(this)
  23528. );
  23529. });
  23530. var _ = {};
  23531. (n.prototype.getWaitDeferred = function (e) {
  23532. var t = _[this.id];
  23533. t || ((t = {}), (_[this.id] = t));
  23534. var i = t[e];
  23535. return (
  23536. i ||
  23537. ((i = {
  23538. deferred: $.Deferred(),
  23539. active: !1,
  23540. }),
  23541. (t[e] = i)),
  23542. i
  23543. );
  23544. }),
  23545. (n.prototype.resetWaitDeferred = function (e) {
  23546. var t = this.getWaitDeferred(e);
  23547. (t.active = !1), (t.deferred = $.Deferred());
  23548. }),
  23549. (n.prototype.clearWaitDeferreds = function () {
  23550. var e = _[this.id];
  23551. e || ((e = {}), (_[this.id] = e));
  23552. for (var t in e)
  23553. if (e.hasOwnProperty(t)) {
  23554. var i = e[t];
  23555. (i.active = !1), (i.deferred = $.Deferred());
  23556. }
  23557. }),
  23558. (n.prototype.loadTiledPano = (function () {
  23559. var e = (new r.Vector3(), []),
  23560. t = [];
  23561. return function (i, n, r, o, a, s) {
  23562. (null !== o && void 0 !== o) || (o = !0),
  23563. (null !== a && void 0 !== a) || (a = !0);
  23564. var l = this.getWaitDeferred(i),
  23565. c = l.deferred,
  23566. h = null,
  23567. u = null;
  23568. if (
  23569. (r &&
  23570. ("number" == typeof r
  23571. ? (h = r)
  23572. : ((h = r.hFov), (u = r.vFov))),
  23573. !this.isLoaded(i))
  23574. ) {
  23575. if (!l.active) {
  23576. if (((l.active = !0), r)) {
  23577. var d = y.matchingTilesInDirection(this, i, n, h, u);
  23578. (e[this.id + ":" + i] = {
  23579. tileCount: 0,
  23580. targetTileCount: d,
  23581. }),
  23582. I.info(
  23583. "Loading partial pano: " +
  23584. this.id +
  23585. " with " +
  23586. d +
  23587. " tiles"
  23588. );
  23589. }
  23590. t[this.id] ||
  23591. ((t[this.id] = !0),
  23592. this.on(
  23593. f.LoadComplete,
  23594. function (e, t) {
  23595. //console.warn('点位下载完成 ', 'id:'+this.id, 'count:'+t )
  23596. var i = this.getWaitDeferred(e).deferred;
  23597. i &&
  23598. "pending" === i.state() &&
  23599. this.highestPartialTileRenderOpCompleted >= e &&
  23600. (i.resolve(e, t), this.resetWaitDeferred(e));
  23601. }.bind(this)
  23602. ),
  23603. this.on(
  23604. f.LoadFailed,
  23605. function (e) {
  23606. var t = this.getWaitDeferred(e).deferred;
  23607. t &&
  23608. "pending" === t.state() &&
  23609. this.highestPartialTileRenderOpCompleted >= e &&
  23610. (t.reject(e), this.resetWaitDeferred(e));
  23611. }.bind(this)
  23612. ),
  23613. this.on(
  23614. f.TileLoaded,
  23615. function (t, i, n) {
  23616. //console.log('tileLoaded', 'id:'+this.id, 'size:'+t, 'index:'+i )
  23617. var r = this.getWaitDeferred(t).deferred;
  23618. if (r && "pending" === r.state()) {
  23619. r.notify(t, i, n);
  23620. var o = e[this.id + ":" + t];
  23621. o &&
  23622. (o.tileCount++,
  23623. o.tileCount === o.targetTileCount &&
  23624. (this.onPanoRendered(this.id, t, n, !0),
  23625. r.resolve(t, n),
  23626. this.resetWaitDeferred(t)));
  23627. }
  23628. }.bind(this)
  23629. ));
  23630. }
  23631. this.tileDownloader.clearForceQueue(),
  23632. this.tileDownloader.forceQueueTilesForPano(
  23633. this,
  23634. i,
  23635. n,
  23636. h,
  23637. u,
  23638. s
  23639. ),
  23640. (this.tiledPanoRenderTarget =
  23641. this.panoRenderer.activateTiledPano(
  23642. this,
  23643. Math.min(2048, this.qualityManager.getMaxNavPanoSize()),
  23644. o
  23645. )), //不要超过2048否则漫游到下一个点时卡顿
  23646. this.panoRenderer.renderPanoTiles(this.id, n, a);
  23647. }
  23648. return c.promise();
  23649. };
  23650. })()),
  23651. (n.prototype.onUploadAttemptedForAllTiles = function (e, t, i) {
  23652. if (e === this.id) {
  23653. var n = this.qualityManager.getPanoSize(m.BASE);
  23654. t === n &&
  23655. this.shouldRedrawOnBaseLoaded &&
  23656. ((this.shouldRedrawOnBaseLoaded = !1),
  23657. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  23658. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0));
  23659. }
  23660. }),
  23661. (n.prototype.onTileRendered = function (e, t, i, n) {
  23662. e === this.id && this.emit(f.TileLoaded, t, i, n);
  23663. }),
  23664. (n.prototype.onPanoRendered = function (e, t, i, n) {
  23665. e === this.id &&
  23666. ((this.minimumTiledPanoLoaded = !0),
  23667. this.updateSkyboxForZoomLevel(),
  23668. t > this.highestPartialTileRenderOpCompleted &&
  23669. (this.highestPartialTileRenderOpCompleted = t),
  23670. !n &&
  23671. t > this.highestFullTileRenderOpCompleted &&
  23672. (this.highestFullTileRenderOpCompleted = t),
  23673. this.emit("load", t),
  23674. this.model.emit("load", this),
  23675. this.emit(f.LoadComplete, t, i));
  23676. }),
  23677. (n.prototype.setZoomed = function (e) {
  23678. (this.zoomed = e), this.updateSkyboxForZoomLevel();
  23679. if (e) {
  23680. //add
  23681. if (player.qualityManager.getNavZoomClass() != "1k") {
  23682. this.model.showHighMap();
  23683. }
  23684. } else {
  23685. this.model.hideHighMap();
  23686. }
  23687. }),
  23688. (n.prototype.ensureSkyboxReadyForRender = function () {
  23689. this.tiled ||
  23690. (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  23691. (this.solidSkybox.loaded = !0));
  23692. }),
  23693. (n.prototype.updateSkyboxForZoomLevel = function () {
  23694. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos();
  23695. }),
  23696. (n.prototype.getSkyboxTexture = function () {
  23697. //return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  23698. if (!this.tiled) {
  23699. return this.solidSkybox;
  23700. }
  23701. if (this.minimumTiledPanoLoaded) {
  23702. if (
  23703. this.zoomed &&
  23704. (this.qualityManager.maxRenderTargetSize >
  23705. this.qualityManager.maxNavPanoSize ||
  23706. player.qualityManager.getNavZoomClass() == "4k")
  23707. ) {
  23708. //change 如果放大后和不放大都是2k就不用这个
  23709. return this.panoRenderer.zoomRenderTarget.texture;
  23710. } else {
  23711. this.tiledPanoRenderTarget.texture.mapping = THREE.UVMapping; //add
  23712. return this.tiledPanoRenderTarget.texture;
  23713. }
  23714. } else {
  23715. return null;
  23716. }
  23717. }),
  23718. (n.prototype.onTileRenderFail = function (e, t, i) {
  23719. e === this.id && this.emit(f.LoadFailed, t);
  23720. }),
  23721. (n.prototype.isLoaded = function (e) {
  23722. if (this.tiled) {
  23723. if (e && "string" == typeof e)
  23724. throw new A(
  23725. "Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass"
  23726. );
  23727. return (
  23728. !!this.minimumTiledPanoLoaded &&
  23729. (!e || this.highestPartialTileRenderOpCompleted >= e)
  23730. );
  23731. }
  23732. if (e && "number" == typeof e)
  23733. throw new A(
  23734. "Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low."
  23735. );
  23736. return !!this.solidSkybox.high || e in this.solidSkybox;
  23737. }),
  23738. (n.prototype.loadCube = function (e) {
  23739. if (this.isLoaded(e))
  23740. return (
  23741. I.info("Skipping load of pano, already loaded"), $.when()
  23742. );
  23743. this.emit("loading", e), this.model.emit("loading", this);
  23744. var t = p.getCubemapUrls(this.model.urls, this.id, e),
  23745. i = t.filter(function (e) {
  23746. return !e;
  23747. });
  23748. "low" === e &&
  23749. i.length > 0 &&
  23750. (I.info(
  23751. "Pano",
  23752. this.id,
  23753. "not available in low res, loading high res right away"
  23754. ),
  23755. (e = "high"),
  23756. (t = p.getCubemapUrls(this.model.urls, this.id, e)));
  23757. var n = 0,
  23758. r = [0, 1, 2, 3, 4, 5].map(
  23759. function (e, i, n) {
  23760. return u.getImage(t[i]);
  23761. }.bind(this)
  23762. );
  23763. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(
  23764. function (t, i, n, r, o, a) {
  23765. return (
  23766. (this.solidSkybox[e] = [t, i, n, r, o, a]),
  23767. ("high" !== e && this.solidSkybox.high) ||
  23768. ((this.solidSkybox.image = this.solidSkybox[e]),
  23769. (this.solidSkybox.low = null)),
  23770. (this.solidSkybox.needsUpdate = !0),
  23771. this.emit("load", e),
  23772. this.model.emit("load", this),
  23773. this
  23774. );
  23775. }.bind(this),
  23776. function () {
  23777. I.error("Downloading cubemap for pano", this.id, "failed"),
  23778. (this.failedLoadingAt = Date.now());
  23779. }.bind(this),
  23780. function () {
  23781. return $.when(++n, 6);
  23782. }
  23783. );
  23784. }),
  23785. (n.raycastsSkipped = 0),
  23786. (n.raycastsDone = 0),
  23787. (n.prototype.findNeighourPanos = function () {
  23788. return (
  23789. this.model.panos.setNeighbour(this.id, this.id, !1),
  23790. this.model.panos.forEach(
  23791. function (e) {
  23792. if (
  23793. e !== this &&
  23794. (!this.model.panos.neighbourMap[this.id] ||
  23795. void 0 === this.model.panos.neighbourMap[this.id][e.id])
  23796. ) {
  23797. var t = this.position.distanceTo(e.position);
  23798. if (t > a.panoramaNeighbourMaxDistance)
  23799. return (
  23800. this.model.panos.setNeighbour(this, e, !1),
  23801. void n.raycastsSkipped++
  23802. );
  23803. var i = e.position.clone().sub(this.position).normalize(),
  23804. o = new r.Raycaster(this.position, i.clone(), 0, t),
  23805. s = o.intersectObjects(this.model.colliders);
  23806. n.raycastsDone++,
  23807. this.model.panos.setNeighbour(this, e, 0 === s.length),
  23808. a.showNeighbourRaycasts &&
  23809. (s.length
  23810. ? this.floor.model.add(
  23811. new r.ArrowHelper(
  23812. i,
  23813. this.position,
  23814. s[0].distance,
  23815. 16711680
  23816. )
  23817. )
  23818. : this.floor.model.add(
  23819. new r.ArrowHelper(
  23820. i,
  23821. this.position,
  23822. t,
  23823. 16777215,
  23824. 0,
  23825. 0
  23826. )
  23827. ));
  23828. }
  23829. }.bind(this)
  23830. ),
  23831. this.model.panos.neighbourMap[this.id]
  23832. );
  23833. }),
  23834. (n.prototype.worldPosition = function () {
  23835. return this.position;
  23836. }),
  23837. (n.prototype.addTextSprite = function (e, t) {
  23838. this.removeTextSprite();
  23839. var i = document.createElement("canvas"),
  23840. n = i.getContext("2d");
  23841. (i.width = 256), (i.height = 256);
  23842. var o = "Arial",
  23843. a = 60;
  23844. (n.font = "bold " + a + "px " + o), (n.fillStyle = "white");
  23845. var s = n.measureText(e).width;
  23846. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  23847. var l = new r.Texture(i);
  23848. l.needsUpdate = !0;
  23849. var c = new r.SpriteMaterial({
  23850. map: l,
  23851. color: t || 16428055,
  23852. });
  23853. (this.text3d = new r.Sprite(c)),
  23854. this.text3d.position.copy(this.skyboxMesh.position),
  23855. this.floor.add(this.text3d);
  23856. }),
  23857. (n.prototype.removeTextSprite = function () {
  23858. this.text3d &&
  23859. (this.floor.remove(this.text3d), (this.text3d = null));
  23860. }),
  23861. (n.prototype.isAligned = function () {
  23862. return this.alignmentType === l.ALIGNED;
  23863. }),
  23864. (n.filters = {
  23865. inDirection: function (e, t, i) {
  23866. return function (n) {
  23867. var r = n.position.clone().sub(e).normalize();
  23868. return r.dot(t) > i;
  23869. };
  23870. },
  23871. inFloorDirection: function (e, t, i) {
  23872. return function (n) {
  23873. var r = n.floorPosition.clone().sub(e).normalize();
  23874. return r.dot(t) > i;
  23875. };
  23876. },
  23877. inPanoDirection: function (e, t, i) {
  23878. return (
  23879. (i = a.navigation.panoScores
  23880. ? a.navigation.filterStrictness
  23881. : i),
  23882. function (n) {
  23883. var r = n.floorPosition.clone().sub(e).normalize(),
  23884. o = n.position.clone().sub(e).normalize();
  23885. return r.dot(t) > i || o.dot(t) > i;
  23886. }
  23887. );
  23888. },
  23889. atFloor: function (e) {
  23890. return function (t) {
  23891. return !e || t.floor === e;
  23892. };
  23893. },
  23894. not: function (e) {
  23895. return function (t) {
  23896. return t !== e;
  23897. };
  23898. },
  23899. notIn: function (e) {
  23900. return function (t) {
  23901. return e.indexOf(t) === -1;
  23902. };
  23903. },
  23904. isLoaded: function () {
  23905. return function (e) {
  23906. return e.isLoaded();
  23907. };
  23908. },
  23909. isNotLoaded: function () {
  23910. return function (e) {
  23911. return !e.isLoaded();
  23912. };
  23913. },
  23914. isCloseEnoughTo: function (e, t) {
  23915. return function (i) {
  23916. return e.distanceTo(i.floorPosition) < t;
  23917. };
  23918. },
  23919. hasMinimumHeightDifferenceTo: function (e, t) {
  23920. return function (i) {
  23921. return Math.abs(i.position.y - e.y) > t;
  23922. };
  23923. },
  23924. isNotBehindNormal: function (e, t) {
  23925. var i = new r.Vector3();
  23926. return (
  23927. (t = t.clone()),
  23928. function (n) {
  23929. var r = i.copy(n.position).sub(e).normalize();
  23930. return r.dot(t) > 0;
  23931. }
  23932. );
  23933. },
  23934. isNeighbourPanoTo: function (e) {
  23935. return function (t) {
  23936. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id];
  23937. };
  23938. },
  23939. isNeighbourOfNeighbourTo: function (e) {
  23940. return function (t) {
  23941. return (
  23942. !!e.neighbourPanos[t.id] ||
  23943. e.neighbourUUIDs.some(function (i) {
  23944. var n = e.model.panos.get(i);
  23945. return !!n && n.neighbourPanos[t.id];
  23946. })
  23947. );
  23948. };
  23949. },
  23950. isNotRecentlyFailed: function (e) {
  23951. return function (t) {
  23952. return Date.now() - t.failedLoadingAt > e;
  23953. };
  23954. },
  23955. isOnVisibleFloor: function () {
  23956. return function (e) {
  23957. return !e.floor.hidden;
  23958. };
  23959. },
  23960. isPanoAligned: function () {
  23961. return function (e) {
  23962. return e.isAligned();
  23963. };
  23964. },
  23965. }),
  23966. (n.sortFunctions = {
  23967. distanceToPoint: function (e) {
  23968. return function (t, i) {
  23969. return t.position.distanceTo(e) - i.position.distanceTo(e);
  23970. };
  23971. },
  23972. floorDistanceToPoint: function (e) {
  23973. return function (t, i) {
  23974. return (
  23975. t.floorPosition.distanceTo(e) -
  23976. i.floorPosition.distanceTo(e)
  23977. );
  23978. };
  23979. },
  23980. choose: function (e) {
  23981. return function (t, i) {
  23982. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0;
  23983. };
  23984. },
  23985. }),
  23986. (n.scoreFunctions = {
  23987. distance: function (e, t) {
  23988. return (
  23989. (t = t || a.navigation.distanceFactor),
  23990. function (i) {
  23991. return e ? e.position.distanceTo(i.position) * t : 0;
  23992. }
  23993. );
  23994. },
  23995. distanceSquared: function (e, t) {
  23996. return (
  23997. (t = t || a.navigation.distanceFactor),
  23998. function (i) {
  23999. return e ? e.position.distanceToSquared(i.position) * t : 0;
  24000. }
  24001. );
  24002. },
  24003. direction: function (e, t) {
  24004. return function (i) {
  24005. var n = i.position.clone().sub(e).normalize();
  24006. return n.dot(t) * a.navigation.directionFactor;
  24007. };
  24008. },
  24009. angle: function (e, t) {
  24010. return function (i) {
  24011. var n = i.position.clone().sub(e).normalize();
  24012. return n.angleTo(t) * a.navigation.angleFactor;
  24013. };
  24014. },
  24015. inFieldOfView: function (e, t) {
  24016. return function (i) {
  24017. var n = i.position.clone().sub(e).normalize();
  24018. return n.dot(t) > 0.75 ? 10 : -1;
  24019. };
  24020. },
  24021. optionality: function (e) {
  24022. return function (t) {
  24023. var i = t.neighbourUUIDs.filter(function (t) {
  24024. return !(t in e.neighbourUUIDs) && t !== e.id;
  24025. });
  24026. return i.length * a.navigation.optionalityFactor;
  24027. };
  24028. },
  24029. penalizeHeightDifferenceUnder: function (e, t) {
  24030. return function (i) {
  24031. return e.y - i.position.y < t ? -20 : 0;
  24032. };
  24033. },
  24034. }),
  24035. (t.exports = n);
  24036. }).call(this, "/js/objects/Panorama.js");
  24037. },
  24038. {
  24039. "../enum/AlignmentType": 17,
  24040. "../enum/GLCubeFaces": 25,
  24041. "../enum/PanoRendererEvents": 35,
  24042. "../enum/PanoSizeClass": 36,
  24043. "../enum/PanoramaEvents": 37,
  24044. "../enum/RenderLayers": 41,
  24045. "../enum/RenderOrder": 42,
  24046. "../enum/TileDownloaderEvents": 45,
  24047. "../enum/Viewmode": 51,
  24048. "../exception/BasicException": 55,
  24049. "../scene/SceneRenderer": 158,
  24050. "../settings": 166,
  24051. "../tile/TileUtils": 174,
  24052. "../util/ajax": 181,
  24053. "../util/common": 185,
  24054. "../util/lerp": 188,
  24055. "../util/logger": 189,
  24056. "../util/panorama": 191,
  24057. "../util/texture": 194,
  24058. "../util/transitions": 195,
  24059. events: 202,
  24060. three: 217,
  24061. },
  24062. ],
  24063. 149: [
  24064. function (e, t, i) {
  24065. "use strict";
  24066. function n(e) {
  24067. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  24068. (t.map.value = d),
  24069. (t.opacity.value = 0),
  24070. t.color.value.set(o.reticuleColor),
  24071. (t.showMouseMarker = !window.DATA.hideMouseMarker);
  24072. r.Mesh.call(
  24073. this,
  24074. new r.PlaneBufferGeometry(0.4, 0.4, 1, 1),
  24075. new r.RawShaderMaterial({
  24076. side: r.DoubleSide,
  24077. depthWrite: !1,
  24078. depthTest: !1,
  24079. transparent: !0,
  24080. vertexShader: c.waypoint.vertexShader,
  24081. fragmentShader: c.waypoint.fragmentShader,
  24082. uniforms: t,
  24083. name: "waypoint",
  24084. opacity: 0,
  24085. visible: t.showMouseMarker, // 显示/隐藏鼠标标志
  24086. })
  24087. ),
  24088. this.layers.set(h.RETICULE),
  24089. (this.renderOrder = u.reticule),
  24090. (this.player = e),
  24091. (this.direction = new r.Vector3()),
  24092. (this.hidden = !0),
  24093. (this.mouseLastMoveTime = Date.now());
  24094. }
  24095. var r = e("three"),
  24096. o = e("../settings"),
  24097. a = e("../util/transitions"),
  24098. s = e("../util/texture"),
  24099. l = e("../util/lerp"),
  24100. c = e("../shaders"),
  24101. h = e("../enum/RenderLayers"),
  24102. u = e("../enum/RenderOrder"),
  24103. d = s.load("images/reticule-256x256.png");
  24104. d.anisotropy = browser.isMobile() ? 1 : 4; //各向异性
  24105. (n.prototype = Object.create(r.Mesh.prototype)),
  24106. (n.prototype.move = function (e, t, i) {
  24107. (this.hidden = i), (this.mouseLastMoveTime = Date.now());
  24108. }),
  24109. (n.prototype.hide = function () {
  24110. this.hidden ||
  24111. ((this.hidden = !0),
  24112. a.start(
  24113. l.property(this.material.uniforms.opacity, "value", 0),
  24114. o.reticuleOpacityTransitionTime
  24115. ));
  24116. }),
  24117. (n.prototype.show = function () {
  24118. (this.hidden = !1),
  24119. this.material.opacity <= 0 &&
  24120. a.start(
  24121. l.property(
  24122. this.material.uniforms.opacity,
  24123. "value",
  24124. o[this.player.mode].reticuleOpacity
  24125. ),
  24126. o.reticuleOpacityTransitionTime
  24127. );
  24128. }),
  24129. (n.prototype.update = function () {
  24130. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout &&
  24131. !this.hidden &&
  24132. this.hide();
  24133. }),
  24134. (n.prototype.updatePosition = function (e, t) {
  24135. if (!this.hidden) {
  24136. if (!t) return this.hide();
  24137. var i = t.point,
  24138. n = e.distanceTo(i),
  24139. r = 1 + 0.01 * n;
  24140. n < 1 && (r -= 1 - n),
  24141. this.show(),
  24142. this.scale.set(r, r, r),
  24143. (this.direction = this.direction.multiplyScalar(0.8)),
  24144. this.direction.add(t.face.normal.clone().multiplyScalar(0.2)),
  24145. this.position
  24146. .copy(i)
  24147. .add(t.face.normal.clone().multiplyScalar(0.01)),
  24148. this.lookAt(this.position.clone().add(this.direction));
  24149. }
  24150. }),
  24151. (n.prototype.writeAstag = function () {
  24152. var e =
  24153. Math.floor(4294967296 * (1 + Math.random())).toString(16) +
  24154. Math.floor(16 * (1 + Math.random())).toString(16),
  24155. t = new Date();
  24156. this.tagCount =
  24157. "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  24158. var i = {
  24159. enabled: !0,
  24160. version: "0",
  24161. created: t.toISOString(),
  24162. created_by: "APITest",
  24163. position: this.position.clone(),
  24164. stem: {
  24165. enabled: o.tags.pole.enabled,
  24166. direction: this.direction.multiplyScalar(o.tags.pole.height),
  24167. },
  24168. label: "tag " + this.tagCount,
  24169. description: "Description " + e,
  24170. floor: (function (e) {
  24171. if (e.currentFloor) {
  24172. var t = e.floors.indexOf(e.currentFloor);
  24173. return t > -1 ? t : void 0;
  24174. }
  24175. })(this.player.model),
  24176. type: "info",
  24177. metadata: {
  24178. preferred_camera: {
  24179. mode: this.player.mode,
  24180. },
  24181. },
  24182. };
  24183. console.log("--------------------------"),
  24184. console.log(JSON.stringify(i));
  24185. var n = this.player.model.addtag(e, i).build();
  24186. n &&
  24187. (n.disc && this.player.tagDiscs.push(n.disc),
  24188. n.visible || n.show(o.tags.startup.fadeInDuration));
  24189. }),
  24190. (t.exports = n);
  24191. },
  24192. {
  24193. "../enum/RenderLayers": 41,
  24194. "../enum/RenderOrder": 42,
  24195. "../settings": 166,
  24196. "../shaders": 167,
  24197. "../util/lerp": 188,
  24198. "../util/texture": 194,
  24199. "../util/transitions": 195,
  24200. three: 217,
  24201. },
  24202. ],
  24203. 150: [
  24204. function (e, t, i) {
  24205. "use strict";
  24206. function n(e, t) {
  24207. (this.chunks = []),
  24208. (this.floorId = e),
  24209. (this.roomId = t),
  24210. (this.position = new r.Vector3());
  24211. }
  24212. var r = e("three");
  24213. (n.prototype.addChunk = function (e) {
  24214. this.chunks.push(e);
  24215. }),
  24216. (n.prototype.calcBoundaries = function () {
  24217. for (
  24218. var e = new r.Vector3(),
  24219. t = new r.Vector3(0, 0, 0),
  24220. i = new r.Vector3(0, 0, 0),
  24221. n = new r.Vector3(0, 0, 0),
  24222. o = 0,
  24223. a = 0;
  24224. a < this.chunks.length;
  24225. a++
  24226. ) {
  24227. var s = this.chunks[a],
  24228. l = s.geometry.attributes.position;
  24229. if (l)
  24230. for (var c = 0; c < l.array.length; c += 3)
  24231. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  24232. t.add(e),
  24233. 0 === c ? (i.copy(e), n.copy(e)) : (i.max(e), n.min(e)),
  24234. o++;
  24235. }
  24236. o > 0
  24237. ? (t.multiplyScalar(1 / o), (this.average = t))
  24238. : (this.average = null),
  24239. (this.boundsMax = i),
  24240. (this.boundsMin = n),
  24241. (this.center = new r.Vector3()),
  24242. this.center.copy(i).sub(n).multiplyScalar(0.5).add(n);
  24243. }),
  24244. (t.exports = n);
  24245. },
  24246. {
  24247. three: 217,
  24248. },
  24249. ],
  24250. 151: [
  24251. function (e, t, i) {
  24252. (function (i) {
  24253. "use strict";
  24254. function n(e, t, i) {
  24255. (this.obj3d = null),
  24256. (this.nodes = []),
  24257. (this.colorHull = []),
  24258. (this.shortPaths = {}),
  24259. (this.floorHull = null),
  24260. (this.cameraHull = null),
  24261. (this.floorPathDistance = 0),
  24262. (this.floorCurvePoints = null),
  24263. (this.floorCurveColors = null),
  24264. (this.camCurvePoints = null),
  24265. (this.warpDestHeroLoc = null),
  24266. (this.warpDestPano = null),
  24267. (this.warpPathPoints = null),
  24268. (this.warpPathLengths = [0]),
  24269. (this.warpLength = 0),
  24270. (this.closeWarpDistance = 4),
  24271. (this.UP = A.UP.clone()),
  24272. (this.longestStep = 0),
  24273. (this.upcomingTransType = null),
  24274. (this.burnsDir = 1), //导览在DOLLHOUSE停留时的旋转方向 1 或 -1
  24275. (this.prevNextDist = 0),
  24276. (this.nextI = 0),
  24277. (this.activeTransType = null),
  24278. (this.lastTransType = null),
  24279. (this.bunnyObj = null),
  24280. (this.director = e),
  24281. (this.player = t),
  24282. (this.playerControls = i),
  24283. (this.modelManager = t.modelManager),
  24284. this.updateModel(),
  24285. this.updateDefaultsFromModelData(),
  24286. this.bindEvents(),
  24287. (this.warping = !1),
  24288. (this.waitingToWarp = !1),
  24289. (this.warpInterrupted = !1),
  24290. (this.warpInterruptionBlackoutStyle = null),
  24291. (this.warpInterruptionTravelTime = null);
  24292. }
  24293. var r = e("three"),
  24294. o = e("../util/logger"),
  24295. a = e("../enum/Viewmode"),
  24296. s = e("../enum/RenderOrder"),
  24297. l = e("../enum/WarpStyle"),
  24298. c = e("../settings"),
  24299. h = e("../util/math"),
  24300. u = e("../util/lerp"),
  24301. d = e("../util/easing"),
  24302. p = e("../util/transitions"),
  24303. f = e("../objects/Snapshot"),
  24304. g = e("../effects"),
  24305. m = e("../shaders"),
  24306. v = (e("../gui/gui"), e("../util/texture")),
  24307. A = e("../enum/Vectors"),
  24308. y = (e("../model/ModelManager"), new o(i)),
  24309. C = e("../enum/PlayerEvents"),
  24310. I = e("../enum/BlackoutStyle"),
  24311. E = e("../enum/ModelManagerEvents"),
  24312. b = e("../constants"),
  24313. w = {
  24314. path: v.loadBase64(
  24315. "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"
  24316. ),
  24317. pathEnd: v.load("images/End.png"),
  24318. pathStart: v.loadBase64(
  24319. "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=="
  24320. ),
  24321. };
  24322. (n.prototype.setScene = function (e) {
  24323. this.createCpm(e), this.createBunnyObj(e);
  24324. }),
  24325. (n.prototype.updateModel = function () {
  24326. this.model = this.modelManager.getActiveModel();
  24327. }),
  24328. (n.prototype.bindEvents = function () {
  24329. this.modelManager.on(
  24330. E.ActiveModelChanged,
  24331. this.updateModel.bind(this)
  24332. );
  24333. }),
  24334. (n.prototype.updateDefaultsFromModelData = function () {
  24335. this.model.data;
  24336. }),
  24337. (n.prototype.pointPathDistance = function (e) {
  24338. for (var t = 0, i = 1; i < e.length; i += 1)
  24339. t += e[i - 1].distanceTo(e[i]);
  24340. return t;
  24341. }),
  24342. (n.prototype.pointPathLengths = function (e) {
  24343. for (var t = [0], i = 1; i < e.length; i += 1)
  24344. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  24345. return t;
  24346. }),
  24347. (n.prototype.interpAlongPath = function (e, t, i) {
  24348. var n,
  24349. o = new r.Vector3(),
  24350. a = t[t.length - 1];
  24351. if (i < 1) {
  24352. n = i * a;
  24353. for (var s = 1; s < t.length; s += 1)
  24354. if (t[s] > n) {
  24355. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  24356. return (
  24357. o.copy(e[s]),
  24358. o.sub(e[s - 1]),
  24359. o.multiplyScalar(l),
  24360. o.add(e[s - 1]),
  24361. o
  24362. );
  24363. }
  24364. } else o.copy(e[e.length - 1]);
  24365. return o;
  24366. }),
  24367. (n.prototype.pathHeight = function () {
  24368. return this.player.mode !== a.FLOORPLAN
  24369. ? c.path.height
  24370. : c.path.outsideHeight;
  24371. }),
  24372. (n.prototype.createBunnyObj = function (e) {
  24373. this.bunnyObj ||
  24374. ((this.bunnyObj = new r.AxisHelper(0.1)),
  24375. (this.bunnyObj.visible = c.warp.showBunny)),
  24376. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  24377. e.add(this.bunnyObj);
  24378. }),
  24379. (n.prototype.createCpm = function (e) {
  24380. if (!this.currentPanoMarker) {
  24381. var t = this.makeWaypointObj(w.pathEnd, "Current");
  24382. (t.material.uniforms.opacity.value = 0),
  24383. (this.currentPanoMarker = {
  24384. mesh: t,
  24385. placed: !1,
  24386. });
  24387. }
  24388. this.currentPanoMarker.mesh.parent &&
  24389. this.currentPanoMarker.mesh.parent.remove(
  24390. this.currentPanoMarker.mesh
  24391. ),
  24392. this.placeCpm(),
  24393. this.currentPanoMarker.mesh.parent ||
  24394. e.add(this.currentPanoMarker.mesh);
  24395. }),
  24396. (n.prototype.placeCpm = function () {
  24397. if (
  24398. c.path.mapGuides &&
  24399. this.player.currentPano &&
  24400. this.player.currentPano.isAligned()
  24401. ) {
  24402. var e = this.player.currentPano.floor;
  24403. this.currentPanoMarker.mesh.parent !==
  24404. this.player.currentPano.floor &&
  24405. (this.currentPanoMarker.mesh.parent &&
  24406. this.currentPanoMarker.mesh.parent.remove(
  24407. this.currentPanoMarker.mesh
  24408. ),
  24409. e.add(this.currentPanoMarker.mesh)),
  24410. this.currentPanoMarker.mesh.position
  24411. .copy(this.player.currentPano.floorPosition)
  24412. .sub(e.position),
  24413. (this.currentPanoMarker.mesh.position.y += this.pathHeight()),
  24414. (this.currentPanoMarker.placed = !0);
  24415. } else this.popOutCpm();
  24416. }),
  24417. (n.prototype.fadeInCpm = function (e) {
  24418. (this.player.mode === a.PANORAMA &&
  24419. this.player.currentPano &&
  24420. !this.player.currentPano.isAligned()) ||
  24421. (c.path.mapGuides &&
  24422. this.currentPanoMarker.placed &&
  24423. p.start(
  24424. u.property(
  24425. this.currentPanoMarker.mesh.material.uniforms.opacity,
  24426. "value",
  24427. 1
  24428. ),
  24429. e
  24430. ));
  24431. }),
  24432. (n.prototype.fadeOutCpm = function (e) {
  24433. p.start(
  24434. u.property(
  24435. this.currentPanoMarker.mesh.material.uniforms.opacity,
  24436. "value",
  24437. 0
  24438. ),
  24439. e
  24440. );
  24441. }),
  24442. (n.prototype.popInCpm = function () {
  24443. c.path.mapGuides &&
  24444. this.currentPanoMarker.placed &&
  24445. this.fadeInCpm(2);
  24446. }),
  24447. (n.prototype.popOutCpm = function () {
  24448. this.fadeOutCpm(2);
  24449. }),
  24450. (n.prototype.brushPrefs = {
  24451. linewidth: 7,
  24452. strokeWidth: 15,
  24453. cvSegments: 48,
  24454. paveStep: 0.1,
  24455. paveWidth: 0.2,
  24456. lookBlendDist: 3,
  24457. maxTurn: r.Math.degToRad(2),
  24458. }),
  24459. (n.prototype.panoPathDistance = function (e) {
  24460. var t = this.model.panos;
  24461. if (!e || e.length < 2) return 0;
  24462. for (var i = [], n = 0; n < e.length; n += 1)
  24463. i.push(t.get(e[n]).floorPosition);
  24464. return this.pointPathDistance(i);
  24465. }),
  24466. (n.prototype.loadTileTexture = function (e) {
  24467. var t = v.load(
  24468. e,
  24469. function (t) {
  24470. (t.wrapS = r.RepeatWrapping),
  24471. (t.wrapT = r.RepeatWrapping),
  24472. (t.needsUpdate = !0),
  24473. y.debug('path texture "' + e + '" is ready');
  24474. },
  24475. function () {
  24476. y.error('path texture "' + e + '" failed');
  24477. }
  24478. );
  24479. return (t.mapping = r.UVMapping), t;
  24480. }),
  24481. (n.prototype.buildWarpDestinationDescriptor = function (
  24482. e,
  24483. t,
  24484. i,
  24485. n,
  24486. r,
  24487. o
  24488. ) {
  24489. var a = {
  24490. cameraMode: n,
  24491. position: e,
  24492. quaternion: t,
  24493. panoId: i,
  24494. orthoZoom: o,
  24495. floorVisibility: r,
  24496. thumbUrl: null,
  24497. name: null,
  24498. };
  24499. return new f(a);
  24500. }),
  24501. (n.prototype.buildWarpDestinationDescriptorFromHero = function (e) {
  24502. return this.buildWarpDestinationDescriptor(
  24503. e.position,
  24504. e.quaternion,
  24505. this.getHeroId(e),
  24506. e.cameraMode,
  24507. e.floorVisibility,
  24508. e.orthoZoom
  24509. );
  24510. }),
  24511. (n.prototype.setWarpDestination = function (e) {
  24512. this.warpDestHeroLoc = e;
  24513. }),
  24514. (n.prototype.setWarpDestinationByHeroIndex = function (e) {
  24515. var t = this.getHeroDescriptorByHeroIndex(e);
  24516. return null !== t && (this.setWarpDestination(t), !0);
  24517. }),
  24518. (n.prototype.setWarpDestinationByPano = function (e, t) {
  24519. var i = this.model.panos.get(e.id);
  24520. return !!i && this.setWarpDestinationByPanoId(e.id, t);
  24521. }),
  24522. (n.prototype.setWarpDestinationByPanoId = function (e, t) {
  24523. var i = this.model.panos.get(e);
  24524. if (i) {
  24525. t = t || new r.Quaternion();
  24526. var n = this.buildWarpDestinationDescriptor(
  24527. i.position,
  24528. t,
  24529. i.id,
  24530. "panorama",
  24531. [],
  24532. -1
  24533. );
  24534. return this.setWarpDestination(n), !0;
  24535. }
  24536. return !1;
  24537. }),
  24538. (n.prototype.getHeroDescriptorByHeroIndex = function (e) {
  24539. var t = this.model.heroCount();
  24540. /* if (null !== this.warpDestHeroLoc && t < 2)
  24541. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  24542. this.model.getHeroDescriptorByIndex(0); */
  24543. var i = this.model.getHeroDescriptorByIndex(e);
  24544. if (i) {
  24545. var n = i.isPano() ? i.panoId : i.cameraMode;
  24546. y.debug(
  24547. 'ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' +
  24548. n +
  24549. '" out of ' +
  24550. t +
  24551. " choices."
  24552. );
  24553. }
  24554. return i;
  24555. }),
  24556. (n.prototype.getHeroDescriptorByPano = function (e) {
  24557. var t = this.model.panos.get(e.id);
  24558. return t ? this.getHeroDescriptorByPanoId(e.id) : null;
  24559. }),
  24560. (n.prototype.getHeroDescriptorByPanoId = function (e) {
  24561. var t = this.getHeroIndexFromPanoId(e);
  24562. return this.getHeroDescriptorByHeroIndex(t);
  24563. }),
  24564. (n.prototype.getHeroIndexFromPanoId = function (e) {
  24565. for (var t = 0; t < this.model.heroLocations.length; t++) {
  24566. var i = this.model.heroLocations[t],
  24567. n = this.getHeroId(i);
  24568. if (n && n === e) return t;
  24569. }
  24570. return -1;
  24571. }),
  24572. (n.prototype.getHeroPano = function (e) {
  24573. if (null === e)
  24574. return y.warn("getHeroPano(): no destination"), null;
  24575. var t = this.getHeroId(e),
  24576. i = this.model.panos.get(t);
  24577. return (
  24578. void 0 === i &&
  24579. ((i = null),
  24580. "" !== t && y.debug('unable to find pano "' + t + '"')),
  24581. i
  24582. );
  24583. }),
  24584. (n.prototype.getHeroId = function (e) {
  24585. return e.panoId;
  24586. }),
  24587. (n.prototype.setWarpDestPano = function () {
  24588. return (
  24589. (this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc)),
  24590. this.warpDestPano
  24591. );
  24592. }),
  24593. (n.prototype.brushToWarpPano = function (e, t) {
  24594. if ((this.discardPathObject(), !this.setWarpDestPano()))
  24595. return !1;
  24596. if (
  24597. (this.warpDestHeroLoc.cameraMode !== a.PANORAMA &&
  24598. y.warn("Can only brush from pano to pano"),
  24599. !this.warpDestPano)
  24600. )
  24601. return y.info("No brush"), !1;
  24602. if (!this.player.currentPano)
  24603. return y.debug("No current pano, visibility undefined"), !1;
  24604. if (!this.warpDestPano)
  24605. return y.info("No wPano, visibility undefined"), !1;
  24606. if (!this.warpDestPano.isAligned())
  24607. return y.debug("Cannot brush to unaligned pano"), !1;
  24608. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides,
  24609. n = !0;
  24610. if (this.player.currentPano.id === this.warpDestPano.id)
  24611. y.debug("Already at destination pano");
  24612. else {
  24613. (this.nodes = this.findShortestPath(
  24614. this.player.currentPano,
  24615. this.warpDestPano
  24616. )),
  24617. (n =
  24618. void 0 === this.nodes ||
  24619. null === this.nodes ||
  24620. this.nodes.length < 1),
  24621. (this.obj3d = new r.Object3D()),
  24622. y.debug(
  24623. 'Brushing from "' +
  24624. this.player.currentPano.id +
  24625. '" to "' +
  24626. this.warpDestPano.id +
  24627. '" (' +
  24628. (this.nodes ? this.nodes.length : 0) +
  24629. ")"
  24630. ),
  24631. n
  24632. ? (y.info(
  24633. 'No "walkable" route, using fall-back warp style transition'
  24634. ),
  24635. (e = t))
  24636. : (this.setPathHulls(this.nodes),
  24637. this.setFloorCurves(),
  24638. i &&
  24639. ("chevron" === c.path.style
  24640. ? this.obj3d.add(
  24641. this.drawPathPavement(this.floorCurvePoints)
  24642. )
  24643. : "ribbon" === c.path.style &&
  24644. this.obj3d.add(
  24645. this.drawPathRibbon(
  24646. this.floorCurvePoints,
  24647. this.floorCurveColors
  24648. )
  24649. ))),
  24650. this.player.currentPano.floor.add(this.obj3d);
  24651. var o =
  24652. this.player.mode === a.DOLLHOUSE ||
  24653. this.player.mode === a.FLOORPLAN,
  24654. s = e === l.STD;
  24655. if (!n && (i || s)) {
  24656. if (o) {
  24657. var h = this.makeStartMarker(
  24658. this.floorHull[0],
  24659. this.floorCurvePoints
  24660. );
  24661. this.obj3d.add(h);
  24662. }
  24663. var u = this.makeEndMarker(
  24664. this.floorHull[this.floorHull.length - 1]
  24665. );
  24666. this.obj3d.add(u);
  24667. }
  24668. this.appearSlow();
  24669. }
  24670. return (this.upcomingTransType = e), !n;
  24671. }),
  24672. (n.prototype.findShortestPath = function (e, t) {
  24673. if (!e || !t) return null;
  24674. var i = c.warp.walkExtraPanosDistance,
  24675. n = e.id + ":" + t.id + ":" + i;
  24676. if (this.shortPaths.hasOwnProperty(n))
  24677. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  24678. var r = t.id + ":" + e.id + ":" + i;
  24679. if (this.shortPaths.hasOwnProperty(r))
  24680. return this.shortPaths[r]
  24681. ? this.shortPaths[r].slice().reverse()
  24682. : null;
  24683. var o = this.model.panos.aStarSearch(e, t);
  24684. return (
  24685. this.model.panos.includeNodesNearPath(o, i),
  24686. (this.shortPaths[n] = o ? o.slice() : null),
  24687. o
  24688. );
  24689. }),
  24690. (n.prototype.makePathHulls = function (e) {
  24691. var t,
  24692. i,
  24693. n,
  24694. r,
  24695. o,
  24696. a = 0,
  24697. s = [],
  24698. l = [],
  24699. h = [],
  24700. u = this.model.panos;
  24701. (t = u.get(e[0])), (r = t.floor.floorIndex);
  24702. for (var d = 0; d < e.length; d += 1)
  24703. (t = u.get(e[d])),
  24704. (i = t.floorPosition.clone().sub(this.model.position)),
  24705. (i.y += this.pathHeight()),
  24706. s.push(i),
  24707. l.push(t.position.clone()),
  24708. (n = t.floor.floorIndex),
  24709. h.push(
  24710. n > r
  24711. ? c.path.colorUp
  24712. : n < r
  24713. ? c.path.colorDown
  24714. : c.path.color
  24715. ),
  24716. d > 0 && ((o = l[d].distanceTo(l[d - 1])), o > a && (a = o));
  24717. return (
  24718. a > this.longestStep &&
  24719. ((this.longestStep = a),
  24720. y.debug("path contains " + a + " meter segment")),
  24721. {
  24722. floor: s,
  24723. camera: l,
  24724. color: h,
  24725. }
  24726. );
  24727. }),
  24728. (n.prototype.makeFloorCurves = function (e, t, i) {
  24729. var n =
  24730. this.player.mode === a.PANORAMA
  24731. ? c.path.waypointIndoorRadius
  24732. : c.path.waypointRadius,
  24733. o = this.pointPathDistance(e) - 2 * n,
  24734. s = e.slice(0),
  24735. l = s[1].clone().sub(s[0]);
  24736. (l.y = 0),
  24737. l.normalize().multiplyScalar(n),
  24738. (s[0] = new r.Vector3().copy(s[0]).add(l)),
  24739. (l = s[s.length - 2].clone().sub(s[s.length - 1])),
  24740. (l.y = 0),
  24741. l.normalize().multiplyScalar(n),
  24742. (s[s.length - 1] = new r.Vector3()
  24743. .copy(s[s.length - 1])
  24744. .add(l));
  24745. var h = new r.CatmullRomCurve3(s),
  24746. u = Math.floor(o / i);
  24747. (u = 4 * Math.floor(u / 4)), (u = Math.max(4, u));
  24748. for (
  24749. var d,
  24750. p,
  24751. f,
  24752. g = h.getSpacedPoints(u),
  24753. m = [],
  24754. v = new r.Vector3(),
  24755. A = 0;
  24756. A < g.length;
  24757. A += 1
  24758. ) {
  24759. (f = 0), (d = g[A].distanceTo(e[0]));
  24760. for (var y = 1; y < e.length; y += 1)
  24761. v.copy(g[A]).sub(e[y]),
  24762. (v.y *= 4),
  24763. (p = v.length()),
  24764. p < d && (f = y);
  24765. m.push(t[f]);
  24766. }
  24767. return {
  24768. distance: o,
  24769. points: g,
  24770. colors: m,
  24771. };
  24772. }),
  24773. (n.prototype.makeCameraCurvePoints = function (e, t) {
  24774. var i = this.pointPathDistance(e),
  24775. n = new r.CatmullRomCurve3(e);
  24776. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)));
  24777. }),
  24778. (n.prototype.makeCameraCurveTangents = function (e, t) {
  24779. var i = this.pointPathDistance(e),
  24780. n = new r.CatmullRomCurve3(e),
  24781. o = Math.max(2, Math.floor(i / t));
  24782. o || (o = 5);
  24783. for (var a = [], s = 0; s <= o; s++)
  24784. a.push(n.getTangentAt(s / o));
  24785. return a;
  24786. }),
  24787. (n.prototype.setPathHulls = function (e) {
  24788. var t = this.makePathHulls(e);
  24789. (this.floorHull = t.floor),
  24790. (this.cameraHull = t.camera),
  24791. (this.colorHull = t.color);
  24792. }),
  24793. (n.prototype.setFloorCurves = function () {
  24794. var e = this.makeFloorCurves(
  24795. this.floorHull,
  24796. this.colorHull,
  24797. this.brushPrefs.paveStep
  24798. );
  24799. (this.floorPathDistance = e.distance),
  24800. (this.floorCurvePoints = e.points),
  24801. (this.floorCurveColors = e.colors);
  24802. }),
  24803. (n.prototype.setCameraCurvePoints = function () {
  24804. this.camCurvePoints = this.makeCameraCurvePoints(
  24805. this.cameraHull,
  24806. c.warp.stepFactor * this.brushPrefs.paveStep
  24807. );
  24808. }),
  24809. (n.prototype.chooseWarpPath = function (e) {
  24810. var t,
  24811. i,
  24812. n,
  24813. o = this.playerControls.cameras[a.PANORAMA];
  24814. if (this.player.currentPano === this.warpDestPano || !e)
  24815. return (this.warpPathPoints = null), (this.warpLength = 0), !1;
  24816. (this.nodes = this.findShortestPath(
  24817. this.player.currentPano,
  24818. this.warpDestPano
  24819. )),
  24820. void 0 === this.nodes ||
  24821. null === this.nodes ||
  24822. this.nodes.length < 1
  24823. ? (y.debug("warp path to unreachable node"),
  24824. (t = this.warpDestPano.position.clone().sub(o.position)),
  24825. (i = t.clone().negate()),
  24826. t.multiplyScalar(0.15).add(o.position),
  24827. i.multiplyScalar(0.15).add(this.warpDestPano.position),
  24828. (t.y = o.position.y),
  24829. (i.y = this.warpDestPano.position.y),
  24830. (n = new r.CubicBezierCurve3(
  24831. o.position.clone(),
  24832. t,
  24833. i,
  24834. this.warpDestPano.position.clone()
  24835. )),
  24836. (this.warpPathPoints = n.getSpacedPoints(
  24837. this.brushPrefs.cvSegments
  24838. )))
  24839. : (y.debug(
  24840. "follow warp path (path distance was " +
  24841. this.nodes.length +
  24842. " nodes, " +
  24843. this.floorPathDistance +
  24844. ")"
  24845. ),
  24846. this.setCameraCurvePoints(),
  24847. (this.warpPathPoints = this.camCurvePoints.slice(0))),
  24848. (this.warpLength = 0),
  24849. (this.warpPathLengths = [0]);
  24850. for (
  24851. var s = new r.Vector3(),
  24852. l = new r.Vector3(),
  24853. h = Math.cos(r.Math.degToRad(c.warp.minBrakeAngle)),
  24854. u = Math.cos(r.Math.degToRad(c.warp.maxBrakeAngle)),
  24855. d = 1;
  24856. d < this.warpPathPoints.length;
  24857. d += 1
  24858. ) {
  24859. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  24860. var p = s.length();
  24861. s.y *= c.warp.climbEffort;
  24862. var f = s.length() / p;
  24863. if (d > 1) {
  24864. s.setY(0).normalize(),
  24865. l
  24866. .copy(this.warpPathPoints[d - 2])
  24867. .sub(this.warpPathPoints[d - 1])
  24868. .setY(0)
  24869. .normalize();
  24870. var g = Math.min(1, s.dot(l)),
  24871. m =
  24872. 1 +
  24873. (c.warp.brakeStrength - 1) *
  24874. (1 - r.Math.smoothstep(g, u, h));
  24875. f = Math.max(m, f);
  24876. }
  24877. (this.warpLength += p * f),
  24878. (this.warpPathLengths[d] = this.warpLength);
  24879. }
  24880. return !0;
  24881. }),
  24882. (n.prototype.drawPathRibbon = function (e, t) {
  24883. this.bunnyObj.visible = c.warp.showBunny;
  24884. for (
  24885. var i = 0.6 * c.path.ribbonWidth * 0.5,
  24886. n = new r.Vector3(),
  24887. o = new r.Vector3(0, this.pathHeight(), 0),
  24888. l = new r.Geometry(),
  24889. h = new r.Vector3(),
  24890. u = 0;
  24891. u < e.length;
  24892. u += 1
  24893. ) {
  24894. h.copy(e[u]),
  24895. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  24896. h.normalize(),
  24897. n.crossVectors(h, A.UP),
  24898. n.multiplyScalar(i);
  24899. var d = new r.Vector3().copy(e[u]).add(o);
  24900. d.sub(n),
  24901. l.vertices.push(d),
  24902. (d = new r.Vector3().copy(e[u]).add(o)),
  24903. d.add(n),
  24904. l.vertices.push(d);
  24905. }
  24906. var p,
  24907. f = 0;
  24908. for (u = 0; u < e.length - 1; u += 1) {
  24909. var g = 2 * u,
  24910. v = f;
  24911. f += e[u + 1].distanceTo(e[u]);
  24912. var y = f,
  24913. C = t[u],
  24914. I = t[u + 1];
  24915. (p = new r.Face3(g, g + 1, g + 2)),
  24916. (p.vertexColors = [
  24917. new r.Color(C),
  24918. new r.Color(C),
  24919. new r.Color(I),
  24920. ]),
  24921. l.faces.push(p),
  24922. l.faceVertexUvs[0].push([
  24923. new r.Vector2(0, v),
  24924. new r.Vector2(1, v),
  24925. new r.Vector2(0, y),
  24926. ]),
  24927. (p = new r.Face3(g + 2, g + 1, g + 3)),
  24928. (p.vertexColors = [
  24929. new r.Color(I),
  24930. new r.Color(C),
  24931. new r.Color(I),
  24932. ]),
  24933. l.faces.push(p),
  24934. l.faceVertexUvs[0].push([
  24935. new r.Vector2(0, y),
  24936. new r.Vector2(1, v),
  24937. new r.Vector2(1, y),
  24938. ]);
  24939. }
  24940. l.computeFaceNormals(), l.computeVertexNormals();
  24941. var E, b;
  24942. this.player.mode === a.PANORAMA
  24943. ? ((b = r.UniformsUtils.clone(m.ribbon.uniforms)),
  24944. (b.map.value = w.path),
  24945. (b.opacity.value = 0),
  24946. b.color.value.set(c.path.color),
  24947. (E = new r.RawShaderMaterial({
  24948. side: r.DoubleSide,
  24949. depthWrite: !1,
  24950. transparent: !0,
  24951. vertexShader: m.ribbon.vertexShader,
  24952. fragmentShader: m.ribbon.fragmentShader,
  24953. uniforms: b,
  24954. name: "ribbonT",
  24955. opacity: 0,
  24956. })))
  24957. : (E = new r.MeshBasicMaterial({
  24958. color: 16777215,
  24959. side: r.DoubleSide,
  24960. name: "ribbonOut",
  24961. vertexColors: r.VertexColors,
  24962. }));
  24963. var _ = new r.Mesh(l, E);
  24964. return (
  24965. (_.name = "ribbon"),
  24966. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  24967. _
  24968. );
  24969. }),
  24970. (n.prototype.drawPathPavement = function (e) {
  24971. for (
  24972. var t,
  24973. i = 0.25,
  24974. n = new r.Vector3(),
  24975. o = new r.Geometry(),
  24976. s = new r.Vector3(),
  24977. l = 0;
  24978. l < e.length;
  24979. l += 1
  24980. )
  24981. s.copy(e[l]),
  24982. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  24983. s.normalize(),
  24984. n.crossVectors(s, A.UP),
  24985. n.multiplyScalar(this.brushPrefs.paveWidth),
  24986. (t = new r.Vector3().copy(e[l])),
  24987. t.sub(n),
  24988. o.vertices.push(t),
  24989. o.vertices.push(new r.Vector3().copy(e[l])),
  24990. (t = new r.Vector3().copy(e[l])),
  24991. t.add(n),
  24992. o.vertices.push(t);
  24993. var h, u, d;
  24994. for (l = 0; l < e.length - 1; l += 1)
  24995. (h = 3 * l + 1),
  24996. (u = l * i),
  24997. (d = u + i),
  24998. o.faces.push(new r.Face3(h - 1, h, h + 3)),
  24999. o.faceVertexUvs[0].push([
  25000. new r.Vector2(0, u),
  25001. new r.Vector2(0.5, u),
  25002. new r.Vector2(0.5, d),
  25003. ]),
  25004. o.faces.push(new r.Face3(h + 3, h + 2, h - 1)),
  25005. o.faceVertexUvs[0].push([
  25006. new r.Vector2(0.5, d),
  25007. new r.Vector2(0, d),
  25008. new r.Vector2(0, u),
  25009. ]),
  25010. o.faces.push(new r.Face3(h + 3, h, h + 1)),
  25011. o.faceVertexUvs[0].push([
  25012. new r.Vector2(0.5, d),
  25013. new r.Vector2(0.5, u),
  25014. new r.Vector2(1, u),
  25015. ]),
  25016. o.faces.push(new r.Face3(h + 3, h + 1, h + 4)),
  25017. o.faceVertexUvs[0].push([
  25018. new r.Vector2(0.5, d),
  25019. new r.Vector2(1, u),
  25020. new r.Vector2(1, d),
  25021. ]);
  25022. var p =
  25023. this.player.mode === a.PANORAMA
  25024. ? new r.MeshBasicMaterial({
  25025. color: c.path.color,
  25026. side: r.DoubleSide,
  25027. transparent: !0,
  25028. depthWrite: !1,
  25029. opacity: 0,
  25030. name: "paveT",
  25031. map: w.path,
  25032. })
  25033. : new r.MeshBasicMaterial({
  25034. color: c.path.color,
  25035. side: r.DoubleSide,
  25036. transparent: !0,
  25037. depthWrite: !1,
  25038. opacity: 1,
  25039. name: "paveO",
  25040. map: w.path,
  25041. });
  25042. return new r.Mesh(o, p);
  25043. }),
  25044. (n.prototype.hintPrefs = {
  25045. rad: 0.18,
  25046. width: 0.0125,
  25047. depth: 0.0625,
  25048. setBack: -0.04,
  25049. markRad: 0.25,
  25050. markInnerRad: 0.16,
  25051. }),
  25052. (n.prototype.makeWaypointObj = function (e, t) {
  25053. var i = new r.Geometry(),
  25054. n =
  25055. this.player.mode === a.PANORAMA
  25056. ? c.path.waypointIndoorRadius
  25057. : c.path.waypointRadius,
  25058. o = this.pathHeight();
  25059. i.vertices.push(
  25060. new r.Vector3(-n, o, n),
  25061. new r.Vector3(-n, o, -n),
  25062. new r.Vector3(n, o, -n),
  25063. new r.Vector3(n, o, n)
  25064. ),
  25065. i.faces.push(new r.Face3(0, 1, 2), new r.Face3(2, 3, 0)),
  25066. i.faceVertexUvs[0].push([
  25067. new r.Vector2(0, 0),
  25068. new r.Vector2(1, 0),
  25069. new r.Vector2(1, 1),
  25070. ]),
  25071. i.faceVertexUvs[0].push([
  25072. new r.Vector2(1, 1),
  25073. new r.Vector2(0, 1),
  25074. new r.Vector2(0, 0),
  25075. ]);
  25076. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  25077. (s.map.value = e),
  25078. (s.opacity.value = 0),
  25079. s.color.value.set(c.path.color);
  25080. var l = {
  25081. side: r.DoubleSide,
  25082. depthWrite: !1,
  25083. transparent: !0,
  25084. vertexShader: m.waypoint.vertexShader,
  25085. fragmentShader: m.waypoint.fragmentShader,
  25086. uniforms: s,
  25087. name: "waypoint",
  25088. opacity: 0,
  25089. };
  25090. this.player.mode !== a.PANORAMA &&
  25091. ((l.depthTest = !1), (l.name = "wayPtOut"));
  25092. var h = new r.RawShaderMaterial(l),
  25093. u = new r.Mesh(i, h);
  25094. return (u.name = t), u;
  25095. }),
  25096. (n.prototype.makeStartMarker = function (e, t) {
  25097. var i = new r.Vector3().copy(t[1]).sub(t[0]);
  25098. (i.y = 0), i.normalize();
  25099. var n = Math.acos(i.x),
  25100. o = this.makeWaypointObj(w.pathStart, "Start");
  25101. return (
  25102. o.rotateOnAxis(new r.Vector3(0, 1, 0), n), o.position.copy(e), o
  25103. );
  25104. }),
  25105. (n.prototype.makeEndMarker = function (e) {
  25106. var t = this.makeWaypointObj(w.pathEnd, "End"),
  25107. i = this.model.panos.get(this.nodes[0]).floor.floorIndex,
  25108. n = this.model.panos.get(this.nodes[this.nodes.length - 1])
  25109. .floor.floorIndex;
  25110. return (
  25111. i < n
  25112. ? t.material.uniforms.color.value.set(c.path.colorUp)
  25113. : i > n &&
  25114. t.material.uniforms.color.value.set(c.path.colorDown),
  25115. t.position.copy(e),
  25116. t
  25117. );
  25118. }),
  25119. (n.prototype.pathClean = function (e) {
  25120. if (e) {
  25121. for (var t in e.children) this.pathClean(e.children[t]);
  25122. e.geometry && e.geometry.dispose(),
  25123. e.material && e.material.dispose();
  25124. }
  25125. }),
  25126. (n.prototype.discardPathObject = function () {
  25127. if (this.obj3d) {
  25128. var e = this.obj3d.parent;
  25129. e && e.remove(this.obj3d), this.pathClean(this.obj3d);
  25130. }
  25131. (this.obj3d = null), this.popInCpm();
  25132. }),
  25133. (n.prototype.discardSlow = function () {
  25134. if (this.obj3d) {
  25135. if (this.player.mode !== a.PANORAMA)
  25136. return void this.discardPathObject();
  25137. for (
  25138. var e,
  25139. t = this,
  25140. i = 0,
  25141. n = function () {
  25142. this.discardPathObject();
  25143. }.bind(this),
  25144. r = 0;
  25145. r < t.obj3d.children.length;
  25146. r += 1
  25147. )
  25148. (e = t.obj3d.children[r]),
  25149. void 0 !== e.material &&
  25150. e.material.transparent === !0 &&
  25151. (void 0 !== e.material.uniforms
  25152. ? p.start(
  25153. u.property(e.material.uniforms.opacity, "value", 0),
  25154. c.path.fadeOutTime,
  25155. n,
  25156. 0,
  25157. d[c.warp.blendEasing]
  25158. )
  25159. : p.start(
  25160. u.property(e.material, "opacity", 0),
  25161. c.path.fadeOutTime,
  25162. n,
  25163. 0,
  25164. d[c.warp.blendEasing]
  25165. ),
  25166. (i += 1),
  25167. (n = null));
  25168. 0 === i && this.discardPathObject(),
  25169. this.player.mode !== a.PANORAMA &&
  25170. this.fadeInCpm(c.path.fadeInTime - 3);
  25171. }
  25172. }),
  25173. (n.prototype.appearSlow = function () {
  25174. var e,
  25175. t = this;
  25176. this.fadeOutCpm(c.path.fadeInTime);
  25177. for (
  25178. var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1,
  25179. n = 0;
  25180. n < t.obj3d.children.length;
  25181. n += 1
  25182. )
  25183. (e = t.obj3d.children[n]),
  25184. void 0 !== e.material &&
  25185. e.material.transparent === !0 &&
  25186. (void 0 !== e.material.uniforms
  25187. ? p.start(
  25188. u.property(e.material.uniforms.opacity, "value", i),
  25189. c.path.fadeInTime,
  25190. null,
  25191. 0,
  25192. d[c.warp.blendEasing]
  25193. )
  25194. : p.start(
  25195. u.property(e.material, "opacity", i),
  25196. c.path.fadeInTime,
  25197. null,
  25198. 0,
  25199. d[c.warp.blendEasing]
  25200. ));
  25201. }),
  25202. (n.prototype.update = function () {
  25203. this.obj3d && this.obj3d.updateMatrixWorld();
  25204. }),
  25205. (n.prototype.calcBurnsAmount = function (e) {
  25206. //计算导览点旋转角
  25207. var t = r.Math.degToRad(c.warp.burnsAngle);
  25208. if (this.player.mode === a.PANORAMA) {
  25209. var i = this.burnsDir * t;
  25210. if (this.upcomingTransType === l.BLACK) return i;
  25211. var n = e;
  25212. if (null === n)
  25213. return y.warn("Transition request for non-highlight"), i;
  25214. var o = this.getHeroDescriptorByHeroIndex(n);
  25215. if (null === o) return i;
  25216. if (!o.isPano()) return i;
  25217. var s = this.getHeroPano(o),
  25218. h = this.playerControls.cameras[a.PANORAMA],
  25219. u = A.FORWARD.clone()
  25220. .applyQuaternion(h.quaternion)
  25221. .setY(0)
  25222. .normalize(),
  25223. d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t),
  25224. p = function (e) {
  25225. var i = Math.acos(Math.min(1, e.dot(u))),
  25226. n = new r.Vector3().crossVectors(u, e);
  25227. return (
  25228. Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  25229. );
  25230. };
  25231. if (s === this.player.currentPano)
  25232. return (i = p(
  25233. A.FORWARD.clone()
  25234. .applyQuaternion(o.quaternion)
  25235. .setY(0)
  25236. .normalize()
  25237. ));
  25238. var f = this.findShortestPath(this.player.currentPano, s);
  25239. if (void 0 === f || null === f || f.length < 1)
  25240. return y.debug("Empty path ahead..."), i;
  25241. var g = this.makePathHulls(f),
  25242. m = new r.CatmullRomCurve3(g.camera),
  25243. v = Math.min(0.1, c.warp.lookAheadDist / m.getLength());
  25244. return (i = p(
  25245. m.getPointAt(v).clone().sub(h.position).setY(0).normalize()
  25246. ));
  25247. }
  25248. return this.player.mode === a.DOLLHOUSE
  25249. ? 0.02 * this.burnsDir
  25250. : this.burnsDir;
  25251. }),
  25252. (n.prototype.waitNextStep = function (e, t, time) {
  25253. //xzw 改时间
  25254. var i = time == void 0 ? c.warp.tourStepDelay : time;
  25255. i == void 0 &&
  25256. (i =
  25257. this.lastTransType === l.BLACK
  25258. ? b.tourStepDelaySlideShow
  25259. : b.tourStepDelayDefault);
  25260. var n = new r.Euler(),
  25261. o = new r.Vector3();
  25262. y.debug("Starting wait: " + (void 0 !== t));
  25263. var currentLocation = this.model.getHeroDescriptorByIndex(
  25264. this.director.currentItem
  25265. ); //this.model.heroLocations[this.director.currentItem[0]]
  25266. var s = currentLocation.dontRot || this.calcBurnsAmount(e),
  25267. h = function () {
  25268. this.endWarpState(),
  25269. this.player.mode === a.DOLLHOUSE &&
  25270. (this.playerControls.cameras[
  25271. a.DOLLHOUSE
  25272. ].controls.rotationAcceleration.x = 0),
  25273. t && t();
  25274. }.bind(this),
  25275. u = function (e, t) {
  25276. if (this.warpInterrupted) return h(), !0;
  25277. var r = t || 1e3 / 60;
  25278. if (c.warp.doBurns && !currentLocation.dontRot)
  25279. if (this.player.mode === a.PANORAMA) {
  25280. var l = this.playerControls.cameras[a.PANORAMA];
  25281. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  25282. var u = i == 0 ? s : (r * s) / i;
  25283. u = Math.sign(u) * Math.max(u, 0.0001); //add 如果音频长的话,使旋转可见,否则以为停住了
  25284. (n.y += u),
  25285. o.set(0, 0, -1),
  25286. o.applyEuler(n),
  25287. o.add(l.position),
  25288. l.controls.lookAt(o),
  25289. l.controls.lookVector.copy(o),
  25290. l.lookAt(o);
  25291. } else
  25292. this.player.mode === a.DOLLHOUSE
  25293. ? (this.playerControls.controls[
  25294. a.DOLLHOUSE
  25295. ].rotationAcceleration.x = s)
  25296. : (this.playerControls.controls[
  25297. a.FLOORPLAN
  25298. ].absoluteScale *= 0.9996);
  25299. }.bind(this);
  25300. this.startWarpState(),
  25301. p.start(u, i, h, 0, d.easeInOutQuad, "wait");
  25302. }),
  25303. (n.prototype.warpToNonPano = function (e) {
  25304. if (
  25305. (this.discardPathObject(),
  25306. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE ||
  25307. this.warpDestHeroLoc.cameraMode === a.FLOORPLAN)
  25308. ) {
  25309. var t = function () {
  25310. e && e();
  25311. }.bind(this);
  25312. this.player.flyToNewMode({
  25313. mode: this.warpDestHeroLoc.cameraMode,
  25314. duration: c.warp.outsideTime,
  25315. warpDest: this.warpDestHeroLoc,
  25316. callback: t,
  25317. force: !0,
  25318. });
  25319. } else y.warn("no warp destination!!!"), e && e();
  25320. }),
  25321. (n.prototype._resetWarpShaderParams = function (e) {
  25322. //
  25323. this.player.mode === a.PANORAMA &&
  25324. (void 0 !== e.material.uniforms.blackout &&
  25325. (e.material.uniforms.blackout.value = 0),
  25326. void 0 !== e.material.uniforms.modelAlpha &&
  25327. (e.material.uniforms.modelAlpha.value = 0));
  25328. /* if(momentTourBlackNewType && "newBlack" in e.material.defines){
  25329. delete e.material.defines.newBlack;
  25330. e.material.needsUpdate = true
  25331. } */
  25332. }),
  25333. (n.prototype._clearWarpShading = function () {
  25334. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  25335. this._resetWarpShaderParams(e[t]), (e[t].visible = !0);
  25336. this._resetWarpShaderParams(this.model.skybox);
  25337. }),
  25338. (n.prototype._warpStopFlying = function () {
  25339. (this.activeTransType = null), this.placeCpm();
  25340. }),
  25341. (n.prototype._wrapupTravelOnlyBits = function () {
  25342. this._warpStopFlying(),
  25343. this.warpPathPoints &&
  25344. (this.player.currentPano.exit(),
  25345. this.warpDestPano.enter(),
  25346. (this.player.currentPano = this.warpDestPano)),
  25347. this.player.spider.draw(),
  25348. this.placeCpm();
  25349. }),
  25350. (n.prototype._wrapupTravel = function (e) {
  25351. this._wrapupTravelOnlyBits(), this.warpCameraAim(e);
  25352. }),
  25353. (n.prototype._wrapupWarpShading = function (e) {
  25354. this._clearWarpShading(), this._wrapupTravel(e);
  25355. }),
  25356. (n.prototype.wrapupWarpShadingOnly = function (e, t) {
  25357. t !== I.END && this._clearWarpShading(),
  25358. this._wrapupTravelOnlyBits(),
  25359. (this.upcomingTransType = null),
  25360. e && e();
  25361. }),
  25362. (n.prototype._warpCameraAim = function (e, t) {
  25363. //到每个片段终点时转向终点朝向。
  25364. var i = this.warpDestHeroLoc.quaternion,
  25365. n = this.playerControls.cameras[a.PANORAMA],
  25366. o = new r.Vector3(0, 0, 1).applyQuaternion(i).normalize(),
  25367. s = new r.Vector3(0, 0, 1)
  25368. .applyQuaternion(n.quaternion)
  25369. .normalize(),
  25370. l = s.dot(o),
  25371. u = r.Math.radToDeg(Math.acos(l)),
  25372. f = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  25373. i,
  25374. c.warp.eOrder
  25375. ),
  25376. g = new r.Euler().setFromQuaternion(
  25377. n.quaternion,
  25378. c.warp.eOrder
  25379. ),
  25380. m = new r.Euler(f.x - g.x, f.y - g.y, f.z - g.z, c.warp.eOrder);
  25381. (m.y = h.constrainedTurn(m.y)), (this.burnsDir = Math.sign(m.y));
  25382. var v = new r.Euler(0, 0, 0, c.warp.eOrder),
  25383. A = new r.Vector3(),
  25384. C = function (e, t) {
  25385. return (
  25386. !!this.warpInterrupted ||
  25387. ((v.x = g.x + e * m.x),
  25388. (v.y = g.y + e * m.y),
  25389. (v.z = g.z + e * m.z),
  25390. A.set(0, 0, -1),
  25391. A.applyEuler(v),
  25392. A.add(n.position),
  25393. n.controls.lookAt(A),
  25394. n.controls.lookVector.copy(A),
  25395. void n.lookAt(A))
  25396. );
  25397. }.bind(this);
  25398. /* return u > c.warp.minRotation ? (p.start(C, e, t, 0, d[c.warp.movementEasing])
  25399. ,(this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  25400. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  25401. ):
  25402. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  25403. ,void (t && t())
  25404. ) */
  25405. this.warpDestHeroLoc.zoom != this.player.zoomLevel && //add 原地转向最终方位时
  25406. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom, e);
  25407. return u > c.warp.minRotation
  25408. ? p.start(C, e, t, 0, d[c.warp.movementEasing])
  25409. : (y.info(
  25410. "Aim angle only is " +
  25411. u.toPrecision(3) +
  25412. " degrees, skipping explicit re-aim"
  25413. ),
  25414. void (t && t()));
  25415. }),
  25416. (n.prototype._warpBendAim = function (e, t, i, n) {
  25417. var o = n || 0,
  25418. s = this.playerControls.cameras[a.PANORAMA],
  25419. l = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  25420. this.warpDestHeroLoc.quaternion,
  25421. c.warp.eOrder
  25422. ),
  25423. u = new r.Euler().setFromQuaternion(
  25424. s.quaternion,
  25425. c.warp.eOrder
  25426. ),
  25427. f = new r.Euler(l.x - u.x, l.y - u.y, l.z - u.z, c.warp.eOrder);
  25428. f.y = h.constrainedTurn(f.y);
  25429. var g = Math.min(
  25430. r.Math.degToRad(c.warp.softBendTilt),
  25431. Math.abs(f.x)
  25432. );
  25433. (f.x = g * Math.sign(f.x)),
  25434. (g = Math.min(
  25435. r.Math.degToRad(Math.max(0, c.warp.softBendAngle)),
  25436. g
  25437. )),
  25438. (this.burnsDir = Math.sign(f.y)),
  25439. (g *= Math.sign(f.y)),
  25440. (f.y = g);
  25441. var m = new r.Euler(0, 0, 0, c.warp.eOrder),
  25442. v = new r.Vector3(),
  25443. A = function (e, t) {
  25444. if (e < 0.5)
  25445. (m.x = u.x + e * f.x),
  25446. (m.y = u.y + e * f.y),
  25447. (m.z = u.z + e * f.z);
  25448. else {
  25449. var i = (1 - e) * c.warp.softBendEnd;
  25450. (m.x = l.x - i * f.x),
  25451. (m.y = l.y - i * f.y),
  25452. (m.z = l.z - i * f.z);
  25453. }
  25454. v.set(0, 0, -1), v.applyEuler(m), v.add(s.position);
  25455. s.controls.lookAt(v),
  25456. s.controls.lookVector.copy(v),
  25457. s.lookAt(v);
  25458. }.bind(this);
  25459. if (window.DATA.momentTourBlackNewType) {
  25460. A(1);
  25461. } else return p.start(A, t, i, o, d[c.warp.movementEasing]);
  25462. }),
  25463. (n.prototype._warpStepCameraAim = function (e, t, i) {
  25464. var n = this.playerControls.cameras[a.PANORAMA],
  25465. o = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  25466. this.warpDestHeroLoc.quaternion,
  25467. c.warp.eOrder
  25468. ),
  25469. s = new r.Euler().setFromQuaternion(
  25470. n.quaternion,
  25471. c.warp.eOrder
  25472. ),
  25473. l = new r.Euler(o.x - s.x, o.y - s.y, o.z - s.z, c.warp.eOrder);
  25474. (l.y = h.constrainedTurn(l.y)), (this.burnsDir = Math.sign(l.y));
  25475. var u = new r.Euler(0, 0, 0, c.warp.eOrder),
  25476. f = new r.Vector3(),
  25477. g = function (e, t) {
  25478. e < 0.5 ? u.copy(s) : u.copy(o),
  25479. f.set(0, 0, -1),
  25480. f.applyEuler(u),
  25481. f.add(n.position),
  25482. n.controls.lookAt(f),
  25483. n.controls.lookVector.copy(f),
  25484. n.lookAt(f);
  25485. }.bind(this);
  25486. return p.start(g, t, i, 0, d[c.warp.movementEasing]);
  25487. }),
  25488. (n.prototype.setBurnsDir = function () {
  25489. var e = this.playerControls.cameras[a.PANORAMA],
  25490. t = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  25491. this.warpDestHeroLoc.quaternion,
  25492. c.warp.eOrder
  25493. ),
  25494. i = new r.Euler().setFromQuaternion(
  25495. e.quaternion,
  25496. c.warp.eOrder
  25497. ),
  25498. n = new r.Euler(t.x - i.x, t.y - i.y, t.z - i.z, c.warp.eOrder);
  25499. (n.y = h.constrainedTurn(n.y)), (this.burnsDir = Math.sign(n.y));
  25500. }),
  25501. (n.prototype.stepWarpPath = function (firstPos, e) {
  25502. var i = this.playerControls.cameras[a.PANORAMA];
  25503. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos;
  25504. if (!n) {
  25505. return i.position.copy(this.warpDestPano.position), !0;
  25506. }
  25507. /* if (!this.warpPathPoints)
  25508. return i.position.copy(this.warpDestPano.position),
  25509. !0;
  25510. var n = this.warpPathPoints[0] */
  25511. var o = this.warpDestPano.position;
  25512. /* console.log(firstPos)
  25513. console.log(o) */
  25514. if (
  25515. null !== this.nodes &&
  25516. this.cameraHull &&
  25517. this.cameraHull.length > 1
  25518. ) {
  25519. var s = new r.Vector3();
  25520. e < 0.5
  25521. ? s
  25522. .copy(this.cameraHull[1])
  25523. .sub(n)
  25524. .normalize()
  25525. .multiplyScalar(c.warp.softPushDist * e)
  25526. .add(n)
  25527. : s
  25528. .copy(this.cameraHull[this.cameraHull.length - 2])
  25529. .sub(o)
  25530. .normalize()
  25531. .multiplyScalar(
  25532. c.warp.softPushDist * c.warp.softPushEnd * (1 - e)
  25533. )
  25534. .add(o),
  25535. i.position.copy(s);
  25536. } else e < 0.5 ? i.position.copy(n) : i.position.copy(o);
  25537. }),
  25538. (n.prototype.interruptAndFastForward = function (e, t) {
  25539. this.warping &&
  25540. ((this.warpInterrupted = !0),
  25541. (this.warpInterruptionBlackoutStyle = e),
  25542. (this.warpInterruptionTravelTime = t),
  25543. (null !== this.warpInterruptionBlackoutStyle &&
  25544. void 0 !== this.warpInterruptionBlackoutStyle) ||
  25545. (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  25546. (null !== this.warpInterruptionTravelTime &&
  25547. void 0 !== this.warpInterruptionTravelTime) ||
  25548. (this.warpInterruptionTravelTime = c.minWarpTime));
  25549. }),
  25550. (n.prototype.warpCameraAim = function (e) {
  25551. var t = c.warp.minWarpTime;
  25552. if (this.upcomingTransType === l.BLACK) t = c.warp.teleportTime;
  25553. else {
  25554. var i = this.playerControls.cameras[a.PANORAMA],
  25555. n = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  25556. this.warpDestHeroLoc.quaternion,
  25557. c.warp.eOrder
  25558. ),
  25559. o = new r.Euler().setFromQuaternion(
  25560. i.quaternion,
  25561. c.warp.eOrder
  25562. ),
  25563. s = new r.Euler(
  25564. n.x - o.x,
  25565. n.y - o.y,
  25566. n.z - o.z,
  25567. c.warp.eOrder
  25568. );
  25569. s.y = h.constrainedTurn(s.y);
  25570. var u =
  25571. (1e3 * Math.abs(s.y)) / r.Math.degToRad(c.warp.maxAimPerSec);
  25572. t = Math.max(t, u);
  25573. }
  25574. var d = function () {
  25575. this._warpStopFlying(), this.discardSlow(), e && e();
  25576. }.bind(this);
  25577. this._warpCameraAim(t, d);
  25578. }),
  25579. (n.prototype.warpCommonParameters = function (e, t, i, n) {
  25580. this.model.skybox.material.uniforms.blackout.value = n;
  25581. var r = u.uniform(this.model.skybox, "progress", 1),
  25582. o = u.allUniforms(this.model.chunks, "progress", 1),
  25583. a = !1,
  25584. s = function () {
  25585. if (this.warpInterrupted) return (a = !0), !0;
  25586. }.bind(this),
  25587. l = function (e, t) {
  25588. return i && a
  25589. ? ((this.model.skybox.material.uniforms.progress.value = 0),
  25590. !0)
  25591. : void r(e, t);
  25592. }.bind(this),
  25593. h = function (e, t) {
  25594. return i && a ? (o(0), !0) : void o(e, t);
  25595. }.bind(this);
  25596. p.start(s, e, null, t, null, "safeHaltWatch"),
  25597. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  25598. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress");
  25599. }),
  25600. (n.prototype.warpTravel_STD = function (e) {
  25601. var t,
  25602. i = Math.min(
  25603. c.warp.lookAheadMax,
  25604. c.warp.lookAheadDist / this.warpLength
  25605. ),
  25606. n = this.playerControls.cameras[a.PANORAMA],
  25607. o =
  25608. (Math.min(0.25, 3 / this.warpLength),
  25609. Math.min(0.35, 7 / this.warpLength)),
  25610. s = new r.Euler(0, 0, 0, c.warp.eOrder),
  25611. f = new r.Vector3(),
  25612. m = new r.Euler().setFromQuaternion(
  25613. n.quaternion,
  25614. c.warp.eOrder
  25615. ),
  25616. v = new r.Euler().copy(m),
  25617. C = n.position.clone(),
  25618. E = new r.Matrix4(),
  25619. b = new r.Euler(),
  25620. w = c.warp.minWarpTime;
  25621. (w += this.warpLength * c.warp.timePerMeter),
  25622. c.warp.flySpeed > 0.01 &&
  25623. (w = (1e3 * this.warpLength) / c.warp.flySpeed);
  25624. var _ = !1,
  25625. T = this.warpDestHeroLoc.quaternion,
  25626. x = new r.Vector3(0, 0, -1).applyQuaternion(T).normalize(),
  25627. S = this.warpPathPoints[this.warpPathPoints.length - 1]
  25628. .clone()
  25629. .sub(this.warpPathPoints[this.warpPathPoints.length - 2])
  25630. .normalize(),
  25631. M = S.dot(x),
  25632. R = r.Math.radToDeg(Math.acos(M)),
  25633. P = function (e) {
  25634. var t = o,
  25635. i =
  25636. r.Math.smoothstep(e, 0, t) *
  25637. (1 - r.Math.smoothstep(e, 1 - t, 1));
  25638. return i;
  25639. },
  25640. O = function () {
  25641. return (
  25642. E.lookAt(C, t, A.UP),
  25643. s.setFromRotationMatrix(E, c.warp.eOrder),
  25644. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  25645. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  25646. h.constrainedTurn(b.y)
  25647. );
  25648. }.bind(this),
  25649. L = function (e, t) {
  25650. if (this.warpInterrupted) return (_ = !0), !0;
  25651. }.bind(this),
  25652. D = function (e, t) {
  25653. return _ || !this.warpPathPoints
  25654. ? (g.blur(0), !0)
  25655. : void g.blur(e);
  25656. }.bind(this),
  25657. N = u.allUniforms(this.model.chunks, "modelAlpha", 1),
  25658. B = function (e, t) {
  25659. return _ || !this.warpPathPoints ? (N(0), !0) : void N(e, t);
  25660. }.bind(this),
  25661. F = function (e, t) {
  25662. if (!this.warpPathPoints)
  25663. return n.position.copy(this.warpDestPano.position), !0;
  25664. if (_) return !0;
  25665. var i = this.interpAlongPath(
  25666. this.warpPathPoints,
  25667. this.warpPathLengths,
  25668. e
  25669. );
  25670. n.position.copy(i),
  25671. (C = this.interpAlongPath(
  25672. this.warpPathPoints,
  25673. this.warpPathLengths,
  25674. 0.99 * e
  25675. ));
  25676. }.bind(this),
  25677. V = function (e, n) {
  25678. return this.warpPathPoints
  25679. ? !!_ ||
  25680. void (t = this.interpAlongPath(
  25681. this.warpPathPoints,
  25682. this.warpPathLengths,
  25683. Math.min(e + i, 1)
  25684. ))
  25685. : (y.debug("Lost bunny."), !0);
  25686. }.bind(this),
  25687. U = function (e, o) {
  25688. if (_)
  25689. return y.debug(">>>> Walkthrough interupted at t=" + e), !0;
  25690. if (!this.warpPathPoints) return !0;
  25691. var a = this.warpLength * e,
  25692. l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist),
  25693. u = r.Math.smoothstep(
  25694. a,
  25695. this.warpLength - this.brushPrefs.lookBlendDist,
  25696. this.warpLength
  25697. );
  25698. c.warp.matchCam && (l *= 1 - u),
  25699. E.lookAt(C, t, A.UP),
  25700. s.setFromRotationMatrix(E, c.warp.eOrder),
  25701. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  25702. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  25703. (b.y = h.constrainedTurn(b.y)),
  25704. (s.x = m.x + l * b.x),
  25705. (s.y = m.y + l * b.y),
  25706. (s.z = m.z + l * b.z),
  25707. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  25708. (b.y = h.constrainedTurn(b.y));
  25709. var d = (r.Math.degToRad(c.warp.maxTurnPerSec) * o) / 1e3;
  25710. (b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y))),
  25711. (v.x = v.x + b.x * c.warp.turnFriction),
  25712. (v.y = v.y + b.y * c.warp.turnFriction),
  25713. (v.z = v.z + b.z * c.warp.turnFriction),
  25714. (v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x));
  25715. var p = t.clone().sub(C).normalize();
  25716. if (R < c.warp.maxAimRotation && u > 0) {
  25717. var g = 1 - u;
  25718. (p.x = p.x * g + u * S.x),
  25719. (p.y = p.y * g + u * S.y),
  25720. (p.z = p.z * g + u * S.z),
  25721. p.normalize();
  25722. }
  25723. this.bunnyObj.position.copy(n.position).add(p),
  25724. f.set(0, 0, -1).applyEuler(v).normalize(),
  25725. f.multiplyScalar(8),
  25726. f.add(n.position),
  25727. (e > 1 - i && c.warp.matchCam) ||
  25728. (n.controls.lookAt(f),
  25729. n.controls.lookVector.copy(f),
  25730. n.lookAt(f));
  25731. }.bind(this),
  25732. k = function () {
  25733. _
  25734. ? (this.discardSlow(),
  25735. (this.upcomingTransType = l.BLACK),
  25736. this.warpTravel_BLACK(
  25737. -0.5,
  25738. this.warpInterruptionTravelTime,
  25739. I.BEGINNING,
  25740. e
  25741. ))
  25742. : this._wrapupWarpShading(e);
  25743. }.bind(this);
  25744. V(0);
  25745. var H =
  25746. c.warp.motionLeadTime +
  25747. (1e3 * Math.abs(O())) / r.Math.degToRad(c.warp.maxTurnPerSec);
  25748. w += H;
  25749. var G = H / w;
  25750. this.warpCommonParameters(w, G, !0, I.NONE),
  25751. p.start(L, w, null, 0, null, "_haltWatcher"),
  25752. c.warp.blur > 0 &&
  25753. ((g.blurStrength = c.warp.blur),
  25754. p.start(D, w, null, G, P, "blurring")),
  25755. p.start(B, w, null, G, P, "modelAlpha"),
  25756. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  25757. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  25758. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny");
  25759. }),
  25760. (n.prototype.warpTravel_BLACK = function (e, t, i, n) {
  25761. var r = e || 0;
  25762. (void 0 !== t && null !== t) || (t = c.warp.teleportTime);
  25763. //add
  25764. var done = () => {
  25765. Hot.updateVisibles([this.player.currentPano]); //更新热点显示
  25766. this.player.transitionPos({
  25767. type: "beforeFlytopano",
  25768. pano: this.player.currentPano,
  25769. dur: 100,
  25770. }); //add
  25771. };
  25772. if (window.DATA.momentTourBlackNewType) {
  25773. player.sceneRenderer.effects.transitionMaskPass.start(
  25774. player.sceneRenderer
  25775. );
  25776. var camera = this.playerControls.cameras[a.PANORAMA];
  25777. var end = this.warpDestHeroLoc.position;
  25778. camera.position.copy(end);
  25779. setTimeout(() => {
  25780. player.sceneRenderer.effects.transitionMaskPass.stop();
  25781. this.wrapupWarpShadingOnly(n, i);
  25782. done();
  25783. }, t);
  25784. } else {
  25785. var o = function () {
  25786. this.wrapupWarpShadingOnly(n, i);
  25787. done();
  25788. }.bind(this);
  25789. var firstPos = this.player.position.clone(); //add
  25790. p.start(
  25791. this.stepWarpPath.bind(this, firstPos),
  25792. t,
  25793. o,
  25794. r,
  25795. d[c.warp.blendEasing],
  25796. "stepMotion"
  25797. );
  25798. }
  25799. this.warpCommonParameters(t, r, !1, i);
  25800. this.model.chunks.concat(this.model.skybox).forEach(function (e) {
  25801. // 改
  25802. if (window.DATA.momentTourBlackNewType) {
  25803. e.material.uniforms.blackout.value = 5; //i 改
  25804. //e.material.defines.newBlack = ''
  25805. //e.material.needsUpdate = true
  25806. } else {
  25807. e.material.uniforms.blackout.value = i;
  25808. }
  25809. }),
  25810. this._warpBendAim(null, t, null, r);
  25811. }),
  25812. (n.prototype.flightStepWalk = (function (e, t, i) {
  25813. var n = 0.001,
  25814. o = 1,
  25815. a = 1.2,
  25816. s = new r.Vector3(),
  25817. h = new r.Vector3(),
  25818. u = function (e, t) {
  25819. //导览速度
  25820. var i = Math.min(
  25821. this.player.position.distanceTo(e.position),
  25822. c.transition.flytimeMaxDistanceThreshold
  25823. ),
  25824. // , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  25825. r = i * c.warp.flytimeDistanceMultiplier + c.warp.flyTime;
  25826. h.copy(A.FORWARD),
  25827. this.player.getDirection(h),
  25828. s.copy(t).sub(e.position).normalize();
  25829. var l = s.dot(h),
  25830. u = Math.acos(l),
  25831. d = u / r;
  25832. d > n && ((r *= d / n), u < o && (r *= a));
  25833. return (r / DATA.tourWalkSpeed) * 100; // 改
  25834. };
  25835. return function (e, t, i) {
  25836. if (this.warpInterrupted) i && i();
  25837. else if (this.activeTransType !== l.WALK)
  25838. this._clearWarpShading(),
  25839. this._warpStopFlying(),
  25840. this.player.spider.draw(),
  25841. this.placeCpm(),
  25842. i && i();
  25843. else if (this.player.currentPano !== e) {
  25844. var n = {
  25845. pano: e,
  25846. lookAtPoint: t,
  25847. duration: null,
  25848. maxDistanceOverride: c.warp.walkMaxDist,
  25849. skipWarpingCheck: !1,
  25850. constantMoveSpeed: !0,
  25851. };
  25852. if (e == this.warpDestPano) {
  25853. //到达终点前,放大到终点的zoom
  25854. n.zoomLevel = this.warpDestHeroLoc.zoom;
  25855. }
  25856. (n.duration = u.call(this, e, t)),
  25857. this.player.nonInterruptingFlyToPano(n, i);
  25858. } else i && i();
  25859. };
  25860. })()),
  25861. (n.prototype.makeWalkFlightFunc = function (e, t, i) {
  25862. return this.flightStepWalk.bind(this, e, t, i);
  25863. }),
  25864. (n.prototype.warpTravel_WALK = (function () {
  25865. var e = [];
  25866. return function (t) {
  25867. var i = this.player.model.panos;
  25868. e.length = 0;
  25869. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  25870. var s = this.nodes[a],
  25871. l = i.get(s);
  25872. a === this.nodes.length - 1;
  25873. (o =
  25874. n &&
  25875. l.position.distanceTo(n.position) < c.warp.walkMinDist),
  25876. (n && o) || (e.push(s), (n = l));
  25877. }
  25878. o &&
  25879. this.nodes.length > 1 &&
  25880. (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  25881. var h = e.length,
  25882. u = i.get(e[h - 1]),
  25883. d = new Array(h + 1);
  25884. d[d.length - 1] = function () {
  25885. t && t();
  25886. }.bind(this);
  25887. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  25888. var g = e[p];
  25889. u = i.get(g);
  25890. var m = new r.Vector3();
  25891. this.getLookAtForWalkingTourNode(e, p, m),
  25892. (d[f - 1] = this.makeWalkFlightFunc(u, m, d[f])),
  25893. p--;
  25894. }
  25895. d[0]();
  25896. };
  25897. })()),
  25898. (n.prototype.getLookAtForWalkingTourNode = (function () {
  25899. var e = new r.Vector3(),
  25900. t = new r.Vector3(),
  25901. i = new r.Vector3(),
  25902. n = new r.Vector3(),
  25903. o = new r.Vector3(),
  25904. a = 0.65,
  25905. s = 0.75,
  25906. l = 0.2,
  25907. c = 0.4,
  25908. h = 0.2,
  25909. u = 3;
  25910. return function (r, d, p) {
  25911. var f = r.length;
  25912. if (d >= f) return !1;
  25913. var g = 1,
  25914. m = 1;
  25915. t.set(0, 0, 0), o.set(0, 0, 0);
  25916. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  25917. if (
  25918. ((v = this.player.model.panos.get(r[A])),
  25919. this.getOrientationForWalkingTourNode(r, A, i),
  25920. A === d && e.copy(i),
  25921. n.copy(i),
  25922. A > d)
  25923. ) {
  25924. var y = n.dot(e) < a;
  25925. (g *= y ? l : s), (m *= y ? h : c);
  25926. }
  25927. i.multiplyScalar(g), t.add(i), o.lerp(v.position, m);
  25928. }
  25929. return t.normalize(), p.copy(o), p.add(t), !0;
  25930. };
  25931. })()),
  25932. (n.prototype.getOrientationForWalkingTourNode = function (e, t, i) {
  25933. var n = e.length;
  25934. if (t >= n) return !1;
  25935. if (t === n - 1)
  25936. i.copy(A.FORWARD).applyQuaternion(
  25937. this.warpDestHeroLoc.quaternion
  25938. );
  25939. else {
  25940. var r = this.player.model.panos.get(e[t]),
  25941. o = this.player.model.panos.get(e[t + 1]);
  25942. i.copy(o.position).sub(r.position);
  25943. }
  25944. return i.normalize(), !0;
  25945. }),
  25946. (n.prototype.warpCameraTravel = function (e, t, i, n) {
  25947. if (
  25948. ((this.activeTransType = this.upcomingTransType),
  25949. (this.lastTransType = this.activeTransType),
  25950. (this.upcomingTransType = null),
  25951. !e)
  25952. ) {
  25953. var r = function () {
  25954. this._wrapupTravel(n);
  25955. }.bind(this),
  25956. o = {
  25957. pano: this.warpDestPano,
  25958. lookAtPoint: null,
  25959. duration: null,
  25960. maxDistanceOverride: null,
  25961. skipWarpingCheck: !1,
  25962. };
  25963. return void this.player.flyToPano(o, r);
  25964. }
  25965. this.activeTransType === l.BLACK
  25966. ? this.warpTravel_BLACK(null, i, t, n)
  25967. : this.activeTransType === l.WALK
  25968. ? this.warpTravel_WALK(
  25969. function () {
  25970. this._clearWarpShading(),
  25971. this._warpStopFlying(),
  25972. this.player.spider.draw(),
  25973. this.placeCpm(),
  25974. n && n();
  25975. }.bind(this)
  25976. )
  25977. : this.warpTravel_STD(n);
  25978. }),
  25979. (n.prototype.startWarpState = function () {
  25980. (this.warping = !0),
  25981. (this.warpInterrupted = !1),
  25982. (this.warpInterruptionBlackoutStyle = null),
  25983. (this.warpInterruptionTravelTime = null);
  25984. }),
  25985. (n.prototype.endWarpState = function () {
  25986. this.warping = !1;
  25987. }),
  25988. (n.prototype.warpToPano = function (e, t, i, n) {
  25989. if (this.warping)
  25990. return void y.warn("Cannot warp when already warping");
  25991. if (
  25992. ((this.upcomingTransType = e),
  25993. (this.activeTransType = null),
  25994. !this.setWarpDestPano())
  25995. )
  25996. return (
  25997. (this.upcomingTransType = null), void this.warpToNonPano(n)
  25998. );
  25999. if (this.player.mode !== a.PANORAMA)
  26000. return (
  26001. (this.upcomingTransType = null),
  26002. this.discardSlow(),
  26003. void this.player.flyToNewMode({
  26004. mode: a.PANORAMA,
  26005. pano: this.warpDestPano,
  26006. duration: c.warp.outsideTime,
  26007. warpDest: this.warpDestHeroLoc,
  26008. callback: n,
  26009. force: !0,
  26010. })
  26011. );
  26012. if (!this.warpDestPano)
  26013. return (
  26014. y.warn("no warp destination, callback dropped"),
  26015. void (this.upcomingTransType = null)
  26016. );
  26017. var r = !(
  26018. this.model.panos.isNeighbour(
  26019. this.player.currentPano,
  26020. this.warpDestPano
  26021. ) &&
  26022. this.warpDestPano !== this.player.currentPano &&
  26023. this.warpDestPano.position.distanceTo(
  26024. this.player.currentPano.position
  26025. ) < c.warp.nearPanoDist
  26026. ),
  26027. o = this.chooseWarpPath(r);
  26028. if (o && this.upcomingTransType !== l.WALK) {
  26029. var s = function () {
  26030. (this.waitingToWarp = !1), this.warpToPano(e, t, i, n);
  26031. }.bind(this);
  26032. if (
  26033. this.player.checkAndWaitForPanoLoad(
  26034. this.warpDestPano,
  26035. "high",
  26036. "low",
  26037. this.player.basePanoSize,
  26038. s
  26039. )
  26040. )
  26041. return void (this.waitingToWarp = !0);
  26042. }
  26043. this.player.currentPano ||
  26044. (y.warn("Arrived at a very strange spot!"),
  26045. (this.player.currentPano = this.warpDestPano),
  26046. this.placeCpm(),
  26047. this.fadeOutCpm(c.path.fadeOutTime),
  26048. this.player.spider.draw()),
  26049. y.debug("Warping to pano ", this.warpDestPano.position),
  26050. this.upcomingTransType !== l.WALK &&
  26051. this.player.emit(
  26052. C.PanoChosen,
  26053. this.player.currentPano,
  26054. this.warpDestPano
  26055. ),
  26056. this.startWarpState();
  26057. var h = function () {
  26058. this.endWarpState(), n && n();
  26059. }.bind(this);
  26060. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h);
  26061. //this.player.smoothZoomToDefault(c.zoom.restoreTime);
  26062. }),
  26063. (t.exports = n);
  26064. }).call(this, "/js/objects/ShowPath.js");
  26065. },
  26066. {
  26067. "../constants": 8,
  26068. "../effects": 16,
  26069. "../enum/BlackoutStyle": 18,
  26070. "../enum/ModelManagerEvents": 33,
  26071. "../enum/PlayerEvents": 40,
  26072. "../enum/RenderOrder": 42,
  26073. "../enum/Vectors": 50,
  26074. "../enum/Viewmode": 51,
  26075. "../enum/WarpStyle": 52,
  26076. "../gui/gui": 65,
  26077. "../model/ModelManager": 140,
  26078. "../objects/Snapshot": 153,
  26079. "../settings": 166,
  26080. "../shaders": 167,
  26081. "../util/easing": 186,
  26082. "../util/lerp": 188,
  26083. "../util/logger": 189,
  26084. "../util/math": 190,
  26085. "../util/texture": 194,
  26086. "../util/transitions": 195,
  26087. three: 217,
  26088. },
  26089. ],
  26090. 152: [
  26091. function (e, t, i) {
  26092. "use strict";
  26093. function n() {
  26094. var e = new r.SphereBufferGeometry(a.skyboxRadius, 20, 5),
  26095. t = new r.RawShaderMaterial({
  26096. fragmentShader: o.skysphere.fragmentShader,
  26097. vertexShader: o.skysphere.vertexShader,
  26098. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  26099. side: r.BackSide,
  26100. name: "skysphere",
  26101. });
  26102. (t.uniforms.radius.value = e.parameters.radius),
  26103. r.Mesh.call(this, e, t);
  26104. }
  26105. var r = e("three"),
  26106. o = e("../shaders"),
  26107. a = e("../settings");
  26108. (n.prototype = Object.create(r.Mesh.prototype)),
  26109. (n.prototype.constructor = n),
  26110. (t.exports = n);
  26111. },
  26112. {
  26113. "../settings": 166,
  26114. "../shaders": 167,
  26115. three: 217,
  26116. },
  26117. ],
  26118. 153: [
  26119. function (e, t, i) {
  26120. (function (i) {
  26121. "use strict";
  26122. function n(e) {
  26123. o.call(this, e),
  26124. (this.sid = e.sid), //xzw add
  26125. (this.panoId = e.panoId),
  26126. (this.orthoZoom = e.orthoZoom),
  26127. (this.floorVisibility = e.floorVisibility),
  26128. (this.thumbUrl = e.thumbUrl),
  26129. (this.name = e.name),
  26130. (this.zoom = e.zoom);
  26131. }
  26132. var r = (e("three"), e("../util/logger")),
  26133. o =
  26134. (e("../settings"),
  26135. e("../enum/Viewmode"),
  26136. e("../util/common"),
  26137. e("../util/transitions"),
  26138. e("../util/lerp"),
  26139. e("../util/ajax"),
  26140. e("../util/texture"),
  26141. e("./View"));
  26142. e("events").EventEmitter, new r(i);
  26143. (n.prototype = Object.create(o.prototype)),
  26144. (n.prototype.isPano = function () {
  26145. return (
  26146. this.panoId && "" !== this.panoId && this.panoId != "outside"
  26147. );
  26148. }),
  26149. (t.exports = n);
  26150. }).call(this, "/js/objects/Snapshot.js");
  26151. },
  26152. {
  26153. "../enum/Viewmode": 51,
  26154. "../settings": 166,
  26155. "../util/ajax": 181,
  26156. "../util/common": 185,
  26157. "../util/lerp": 188,
  26158. "../util/logger": 189,
  26159. "../util/texture": 194,
  26160. "../util/transitions": 195,
  26161. "./View": 154,
  26162. events: 202,
  26163. three: 217,
  26164. },
  26165. ],
  26166. 154: [
  26167. function (e, t, i) {
  26168. (function (i) {
  26169. "use strict";
  26170. function n(e) {
  26171. (e = e || {}),
  26172. (this.position = new r.Vector3()),
  26173. (this.quaternion = new r.Quaternion()),
  26174. this.update(e);
  26175. }
  26176. var r = e("three"),
  26177. o = e("../util/logger"),
  26178. a =
  26179. (e("../settings"),
  26180. e("../enum/Viewmode"),
  26181. e("../util/common"),
  26182. e("../util/transitions"),
  26183. e("../util/lerp"),
  26184. e("../util/ajax"),
  26185. e("../util/texture"),
  26186. e("events").EventEmitter);
  26187. new o(i);
  26188. (n.prototype = Object.create(a.prototype)),
  26189. (n.prototype.isValid = function () {
  26190. return !!this.cameraMode;
  26191. }),
  26192. (n.prototype.update = function (e) {
  26193. return (
  26194. (this.cameraMode = e.cameraMode || this.cameraMode),
  26195. (this.pano = e.pano || this.pano),
  26196. e.position && this.position.copy(e.position),
  26197. e.quaternion && this.quaternion.copy(e.quaternion),
  26198. this
  26199. );
  26200. }),
  26201. (t.exports = n);
  26202. }).call(this, "/js/objects/View.js");
  26203. },
  26204. {
  26205. "../enum/Viewmode": 51,
  26206. "../settings": 166,
  26207. "../util/ajax": 181,
  26208. "../util/common": 185,
  26209. "../util/lerp": 188,
  26210. "../util/logger": 189,
  26211. "../util/texture": 194,
  26212. "../util/transitions": 195,
  26213. events: 202,
  26214. three: 217,
  26215. },
  26216. ],
  26217. 155: [
  26218. function (e, t, i) {
  26219. //player.js
  26220. (function (i) {
  26221. "use strict";
  26222. function n(e) {
  26223. (this.currentPano = null),
  26224. (this.nextPano = null),
  26225. (this.camera = null),
  26226. (this.paused = !1),
  26227. (this.flying = !1),
  26228. (this.sceneIntersectionPlane = null),
  26229. (this.target = new r.Vector3()),
  26230. (this.mouse = new r.Vector3(1.1, 1.1, 0.5)),
  26231. (this.mouseAtMouseDown = new r.Vector2()),
  26232. (this.mouseCouldBeClickToMove = !1),
  26233. (this.mouseLastMoveTime = Date.now()),
  26234. (this.mouseDown = !1),
  26235. (this.mouseDownTimer = null),
  26236. (this.couldBeLongTap = !1),
  26237. (this.containsMouse = !1), //
  26238. (this.isTouchEvent = !1),
  26239. (this.isPanoHover = !1),
  26240. (this.reticule = new a(this)),
  26241. (this.panoMarkers = []),
  26242. (this.spider = new h(this)),
  26243. (this.quaternion = new r.Quaternion()),
  26244. (this.position = new r.Vector3(15, 10, 15)),
  26245. (this.previousState = null),
  26246. (this.lastInsideView = new c()),
  26247. (this.last360View = new c()),
  26248. (this.raycaster = new r.Raycaster()),
  26249. (this.intersect = null),
  26250. (this.lastChangeTime = Date.now()),
  26251. (this.history = new I()),
  26252. (this.cameraControls = null),
  26253. (this.path = null),
  26254. (this.model = null),
  26255. (this.domElement = null),
  26256. (this.cachedPanoCandidates = null),
  26257. (this.basePanoSize = 0),
  26258. (this.standardPanoSize = 0),
  26259. (this.highPanoSize = 0),
  26260. (this.ultraHighPanoSize = 0),
  26261. (this.zoomLevel = 1),
  26262. (this.zooming = 0),
  26263. (this.zoomSpeed = 0.5),
  26264. (this.scrollZoomSpeed = 0.06),
  26265. (this.zoomSpeedAdjust = 0.05),
  26266. (this.defaultZoomIncrement = 0.2),
  26267. (this.baseFov = f.insideFOV),
  26268. (this.zoomFov = this.baseFov),
  26269. (this.zoomEnabled = !0),
  26270. (this.preRenderingEnabled = !1),
  26271. this.setupCustomProperties(e),
  26272. (this.zoomStats = new L());
  26273. window.player = this;
  26274. this.modeTran = "";
  26275. }
  26276. var r = e("three"),
  26277. o = e("./util/logger"),
  26278. a = e("./objects/Reticule"),
  26279. s = e("./objects/Panorama"),
  26280. l = e("./objects/ShowPath"),
  26281. c = e("./objects/View"),
  26282. h = (e("./objects/Snapshot"), e("./objects/NSpider")),
  26283. u = e("./enum/Viewmode"),
  26284. d = (e("./enum/TagStates"), e("./enum/Vectors")),
  26285. p = e("./enum/Keys"),
  26286. f = (e("./enum/AlignmentType"), e("./settings")),
  26287. g = e("./util/common"),
  26288. m = (e("./util/browser"), e("./util/math")),
  26289. v = e("./util/lerp"),
  26290. A = e("./util/easing"),
  26291. y = e("./util/transitions"),
  26292. C = e("events").EventEmitter,
  26293. I = (e("./shaders"), e("./util/history")),
  26294. E =
  26295. (e("./util/camera"),
  26296. e("./model/ModelManager"),
  26297. e("./enum/PathDiscardMode")),
  26298. b = e("./enum/PathDisplayMode"),
  26299. w = e("./enum/PlayerEvents"),
  26300. _ = e("./enum/ControlEvents"),
  26301. T = e("./enum/ModelManagerEvents"),
  26302. x = e("./enum/WarpStyle"),
  26303. S = e("./enum/BlackoutStyle"),
  26304. M = e("./exception/BasicException"),
  26305. R = e("./enum/PanoSizeClass"),
  26306. P = (e("./tile/TileDownloader"), e("./tile/TilePrioritizer")),
  26307. O = (e("./enum/PanoramaEvents"), e("./enum/ZoomEvents")),
  26308. L = e("./util/ZoomStats"),
  26309. D = e("./constants"),
  26310. N = e("./util/common"),
  26311. B = e("./util/cameraLight"),
  26312. //, Hot = e('hot')
  26313. F = new o(i),
  26314. V = Object.freeze({
  26315. FlyToPano: y.getUniqueId(),
  26316. FlyToNewMode: y.getUniqueId(),
  26317. FlyToSameMode: y.getUniqueId(),
  26318. FlyToViewFloor: y.getUniqueId(),
  26319. LookTransition: y.getUniqueId(),
  26320. ZoomTransition: y.getUniqueId(),
  26321. });
  26322. (n.prototype = Object.create(C.prototype)),
  26323. (n.prototype.init = function (e) {
  26324. (this.modelManager = e.modelManager),
  26325. (this.tileDownloader = e.tileDownloader),
  26326. (this.panoRenderer = e.panoRenderer),
  26327. (this.qualityManager = e.qualityManager),
  26328. (this.domElement = e.container),
  26329. (this.camera = e.camera),
  26330. (this.tagManager = e.tagManager),
  26331. (this.cameraControls = e.controls),
  26332. (this.path = new l(e.director, this, e.controls)),
  26333. (this.basePanoSize = this.qualityManager.getPanoSize(R.BASE)),
  26334. (this.standardPanoSize = this.qualityManager.getPanoSize(
  26335. R.STANDARD
  26336. )),
  26337. (this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH)),
  26338. (this.ultraHighPanoSize = this.qualityManager.getPanoSize(
  26339. R.ULTRAHIGH
  26340. )),
  26341. (this.tileDownloader.processPriorityQueue = !1),
  26342. (this.tileDownloader.tilePrioritizer = new P(
  26343. this.qualityManager,
  26344. this.basePanoSize,
  26345. this.standardPanoSize,
  26346. this.highPanoSize,
  26347. this.ultraHighPanoSize
  26348. )),
  26349. this.bindEvents(e.container),
  26350. this.updateModel();
  26351. });
  26352. //xzw add: 截图
  26353. function dataURLtoBlob(dataurl) {
  26354. var arr = dataurl.split(","),
  26355. mime = arr[0].match(/:(.*?);/)[1],
  26356. bstr = atob(arr[1]),
  26357. n = bstr.length,
  26358. u8arr = new Uint8Array(n);
  26359. while (n--) {
  26360. u8arr[n] = bstr.charCodeAt(n);
  26361. }
  26362. return new Blob([u8arr], { type: mime });
  26363. }
  26364. n.prototype.screenShot = function (o) {
  26365. if (this.flying || this.flyingToTag) return;
  26366. var R = this.sceneRenderer;
  26367. R.updateScreenSize(o);
  26368. for (var i in this.model.panos.index) {
  26369. if (!this.model.panos.index[i].marker) continue;
  26370. this.model.panos.index[i].marker.forceHide =
  26371. this.model.panos.index[i].marker.visible;
  26372. this.model.panos.index[i].marker.visible = false;
  26373. }
  26374. for (var i in this.model.hots) {
  26375. this.model.hots[i].mesh.visible = false;
  26376. }
  26377. this.reticule.visible = false;
  26378. this.reticule.forceUnvisible = true;
  26379. this.path.currentPanoMarker.mesh.visible = false;
  26380. setTimeout(
  26381. function () {
  26382. //因resize效用没办法立即生效(原因未知),故而延后
  26383. R.renderer.clear(true, true, true);
  26384. R.renderer.render(R.scene, R.camera);
  26385. var imgData = R.renderer.domElement.toDataURL(o.type, 0.9);
  26386. o.f && o.f(imgData);
  26387. R.updateScreenSize({ resize: true });
  26388. this.reticule.visible = true;
  26389. for (var i in this.model.hots) {
  26390. this.model.hots[i].mesh.visible = true;
  26391. }
  26392. for (var i in this.model.panos.index) {
  26393. this.model.panos.index[i].marker.visible =
  26394. this.model.panos.index[i].marker.forceHide;
  26395. }
  26396. this.path.currentPanoMarker.mesh.visible = true;
  26397. R.renderer.render(R.scene, R.camera);
  26398. }.bind(this),
  26399. 30
  26400. ); //这个数字不能太小
  26401. };
  26402. var scaleImg = e("scaleImg");
  26403. var ResizeImg = function (img, option) {
  26404. var img2; //不能直接改img 否则可能触发第二次img.onload
  26405. var compress = function (ratio, type) {
  26406. var image = img2 || img;
  26407. var c = document.createElement("canvas");
  26408. c.width = image.width;
  26409. c.height = image.height;
  26410. var ctx = c.getContext("2d");
  26411. ctx.drawImage(image, 0, 0, image.width, image.height);
  26412. img2 = scaleImg(
  26413. ratio /* option.maxSize/oldSize */,
  26414. c,
  26415. type /* option.type||"png" */
  26416. ); //最大不能超过0.8M
  26417. };
  26418. var reCom = function () {
  26419. //如果有了img2 就只需要img2 否则创造新的img2
  26420. var image = img2 || img;
  26421. var blob = dataURLtoBlob(image.src);
  26422. if (option.maxWeight && blob.size > option.maxWeight) {
  26423. compress(option.maxWeight / blob.size, "jpeg");
  26424. blob = dataURLtoBlob(image.src);
  26425. }
  26426. if (!img2) {
  26427. img2 = new Image();
  26428. }
  26429. img2.base64Src = image.src;
  26430. img2.src = window.URL.createObjectURL(blob);
  26431. };
  26432. var oldSize = Math.max(img.width, img.height);
  26433. if (option.toType != "png") {
  26434. //不是非要png的话
  26435. if (option.oldType == "jpeg") {
  26436. //jpeg先判断尺寸,然后是尺寸
  26437. if (oldSize > option.maxSize) {
  26438. compress(option.maxSize / oldSize, "jpeg");
  26439. }
  26440. reCom();
  26441. } else if (option.oldType == "png") {
  26442. //png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  26443. if (option.maxWeight && option.weight > option.maxWeight) {
  26444. //如果一开始大小不大就不压缩 还是png
  26445. compress(
  26446. oldSize > option.maxSize ? option.maxSize / oldSize : 1,
  26447. "jpeg"
  26448. );
  26449. reCom();
  26450. }
  26451. }
  26452. } else {
  26453. //?貌似png会越压缩越大?
  26454. }
  26455. return img2 || img;
  26456. };
  26457. var _fixType = function (type) {
  26458. type = type.toLowerCase().replace(/jpg/i, "jpeg");
  26459. var r = type.match(/png|jpeg|bmp|gif/)[0];
  26460. return "image/" + r;
  26461. };
  26462. var saveFile = function (data, filename) {
  26463. var save_link = document.createElementNS(
  26464. "http://www.w3.org/1999/xhtml",
  26465. "a"
  26466. );
  26467. save_link.href = data;
  26468. save_link.download = filename;
  26469. var event = document.createEvent("MouseEvents");
  26470. event.initMouseEvent(
  26471. "click",
  26472. true,
  26473. false,
  26474. window,
  26475. 0,
  26476. 0,
  26477. 0,
  26478. 0,
  26479. 0,
  26480. false,
  26481. false,
  26482. false,
  26483. false,
  26484. 0,
  26485. null
  26486. );
  26487. save_link.dispatchEvent(event);
  26488. };
  26489. (n.prototype.getWrapShot = function () {
  26490. //获取导览点截图/初始画面和信息
  26491. var info = this.getSnapAngleInfo();
  26492. var str = ",{\r\t" + info;
  26493. var arg = arguments[0];
  26494. this.screenShot({
  26495. width: g_snapShotWidth * 4,
  26496. height: g_snapShotHeight * 4,
  26497. type: "image/jpeg",
  26498. f: function (imgData) {
  26499. if (arg && arg.__callback) {
  26500. return arg.__callback(imgData, info);
  26501. }
  26502. var img = new Image();
  26503. img.src = imgData;
  26504. img.onload = function () {
  26505. var img2 = ResizeImg(this, {
  26506. maxSize: g_snapShotWidth,
  26507. oldType: "jpeg",
  26508. }); //暂定缩略图大小
  26509. img2.src.replace(
  26510. _fixType("image/jpeg"),
  26511. "image/octet-stream"
  26512. );
  26513. var filename = "snap" + new Date().getTime();
  26514. saveFile(img2.src, filename + ".jpg");
  26515. str += ',\r\t"thumbnail_signed_src":"' + filename + '.jpg",';
  26516. str += '\r\t"sid":"' + filename + '",';
  26517. str += '\r\t"name":"' + filename + '"\r}';
  26518. logData(str);
  26519. };
  26520. },
  26521. });
  26522. }),
  26523. (n.prototype.getSnapAngleInfo = function () {
  26524. var info = {};
  26525. var str = '"metadata":{';
  26526. var q = this.camera.quaternion.clone();
  26527. switch (this.mode) {
  26528. case "panorama":
  26529. info.scan_id = this.currentPano.id;
  26530. str += '"scan_id":"' + this.currentPano.id + '",';
  26531. break;
  26532. case "floorplan":
  26533. info.camera_mode = 1;
  26534. q = new r.Quaternion().setFromAxisAngle(
  26535. new r.Vector3(0, 1, 0),
  26536. r.Math.degToRad(90)
  26537. );
  26538. q.multiply(this.camera.quaternion);
  26539. str += '"camera_mode":1,';
  26540. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  26541. str +=
  26542. '"ortho_zoom":' +
  26543. m.toPrecision(
  26544. this.cameraControls.activeControl.currentScale,
  26545. 4
  26546. ) +
  26547. ",";
  26548. break;
  26549. case "dollhouse":
  26550. info.camera_mode = 2;
  26551. str += '"camera_mode":2,';
  26552. break;
  26553. }
  26554. info.camera_position = m.toPrecision(
  26555. this.camera.position.toArray(),
  26556. 4
  26557. );
  26558. console.log(info.camera_position);
  26559. if (window.screenSta === "tour") {
  26560. // fyz 导览截屏需要做额外的
  26561. /**fyz 对相机截屏的角度进行校对 */
  26562. var out = new r.Quaternion(q.x, q.y, q.z, q.w);
  26563. out.multiply(
  26564. new r.Quaternion(
  26565. Math.sqrt(2) / 2,
  26566. Math.sqrt(2) / 2,
  26567. 0,
  26568. 0
  26569. ).conjugate()
  26570. );
  26571. out.x *= -1;
  26572. out.w *= -1;
  26573. info.camera_quaternion = m.toPrecision(out.toArray(), 4);
  26574. } else {
  26575. info.camera_quaternion = m.toPrecision(q.toArray(), 4);
  26576. }
  26577. info.zoom = this.zoomLevel;
  26578. console.log(info.camera_quaternion);
  26579. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  26580. // fyz 扩展编辑页面, 加上导览点缩放值
  26581. str +=
  26582. '"camera_position":[' +
  26583. info.camera_position +
  26584. '],"camera_quaternion":[' +
  26585. info.camera_quaternion +
  26586. '], "zoom":' +
  26587. info.zoom +
  26588. "}";
  26589. return str;
  26590. });
  26591. //------end
  26592. (n.prototype.setupCustomProperties = function (e) {
  26593. var t = e || u.PANORAMA;
  26594. Object.defineProperty(this, "mode", {
  26595. get: function () {
  26596. return t;
  26597. },
  26598. set: function (e) {
  26599. var i = t;
  26600. (t = e), this.onModeUpdated(i, t);
  26601. },
  26602. });
  26603. }),
  26604. (n.prototype.isInMode = function () {
  26605. for (var e = 0; e < arguments.length; e++)
  26606. if (this.mode === arguments[e]) return !0;
  26607. return !1;
  26608. }),
  26609. (n.prototype.isOutsideMode = function (e) {
  26610. return (
  26611. (e = e || this.mode), e === u.DOLLHOUSE || e === u.FLOORPLAN
  26612. );
  26613. }),
  26614. (n.prototype.is360View = function (e, t) {
  26615. return e === u.PANORAMA && t && !t.isAligned();
  26616. }),
  26617. (n.prototype.setScene = function (e) {
  26618. (this.sceneIntersectionPlane = e.plane),
  26619. this.path.setScene(e),
  26620. this.moveReticuleToScene(e);
  26621. }),
  26622. (n.prototype.moveReticuleToScene = function (e) {
  26623. this.reticule.parent &&
  26624. this.reticule.parent.remove(this.reticule),
  26625. e.add(this.reticule);
  26626. }),
  26627. (n.prototype.updateModel = function () {
  26628. function e(e, t, n) {
  26629. this.mode === u.DOLLHOUSE &&
  26630. e !== n &&
  26631. i.call(this, e.center.y);
  26632. }
  26633. function t(e, t) {
  26634. if (this.mode === u.DOLLHOUSE) {
  26635. var n = e ? this.model.center.y : (n = t.center.y);
  26636. i.call(this, n);
  26637. }
  26638. }
  26639. function i(e) {
  26640. var t = this.cameraControls.cameras[u.DOLLHOUSE],
  26641. i = this.cameraControls.controls[u.DOLLHOUSE],
  26642. n = t.position.y + (e - i.target.y),
  26643. r = f.showFloorDuration + f.showFloorDelay;
  26644. y.start(
  26645. v.property(i.target, "y", e),
  26646. r,
  26647. null,
  26648. f.flydown.movementDelay,
  26649. A[f.flydown.movementEasing],
  26650. null,
  26651. V.FlyToViewFloor
  26652. ),
  26653. y.start(
  26654. v.property(t.position, "y", n),
  26655. r,
  26656. null,
  26657. f.flydown.movementDelay,
  26658. A[f.flydown.movementEasing],
  26659. null,
  26660. V.FlyToViewFloor
  26661. );
  26662. }
  26663. (this.model = this.modelManager.getActiveModel()),
  26664. this.model.on("floor.changed", e.bind(this)),
  26665. this.model.on("allfloors.toggled", t.bind(this)),
  26666. this.on(
  26667. w.PanoChosen,
  26668. this.model.setProjectedPanos.bind(this.model)
  26669. );
  26670. /*******************************************************************VR fyz改 from徐世廷*******************************************************************/
  26671. var e2 = this;
  26672. this.model.panos.list.forEach(function (a) {
  26673. a.vrMarker.addEventListener("click", function () {
  26674. e2.flyToPano({
  26675. pano: a,
  26676. });
  26677. });
  26678. });
  26679. /********************************************************************************************************************************************/
  26680. this.model.addHighMapCube(); //add
  26681. this.on(
  26682. w.FlyingStarted,
  26683. this.model.resetHighMap.bind(this.model)
  26684. );
  26685. }),
  26686. (n.prototype.updateModelDependentData = function () {
  26687. this.cameraControls.setModelForControls(this.model),
  26688. this.getPanoMarkersFromModel(this.model);
  26689. }),
  26690. (n.prototype.onModelChanged = function () {
  26691. this.updateModel(), this.updateModelDependentData();
  26692. }),
  26693. (n.prototype.getPanoMarkersFromModel = function (e) {
  26694. this.panoMarkers = e.panos.list.reduce(function (e, t) {
  26695. return t.marker ? e.concat(t.marker) : e;
  26696. }, []);
  26697. }),
  26698. (n.prototype.handleControlMove = function (e) {
  26699. this.emit(w.Move, e);
  26700. }),
  26701. (n.prototype.handleControlInputStart = function (e) {
  26702. this.emit(w.InputStart, e);
  26703. }),
  26704. (n.prototype.onModeUpdated = function (e, t) {
  26705. this.cameraControls.activateControls(t),
  26706. this.emit(w.ModeChanged, e, t);
  26707. }),
  26708. (n.prototype.isWarping = function () {
  26709. //是否导览缓慢走向某个点
  26710. return this.path.warping;
  26711. }),
  26712. (n.prototype.isWaitingToWarp = function () {
  26713. return this.path.waitingToWarp;
  26714. }),
  26715. (n.prototype.getLabelScaleFactor = function () {
  26716. if (this.isOutsideMode()) {
  26717. var e = 10,
  26718. t = Math.sqrt(
  26719. this.cameraControls.controls[u.FLOORPLAN].currentScale / e
  26720. );
  26721. return t;
  26722. }
  26723. return 0.5;
  26724. }),
  26725. /* n.prototype.changeMusic = function() {//xzw add
  26726. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  26727. } */
  26728. (n.prototype.bindEvents = function (e) {
  26729. e !== document && e.setAttribute("tabindex", -1),
  26730. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  26731. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  26732. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  26733. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  26734. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  26735. this.modelManager.on(
  26736. T.ActiveModelChanged,
  26737. this.onModelChanged.bind(this)
  26738. ),
  26739. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  26740. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  26741. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  26742. e.addEventListener(
  26743. "pointerdown",
  26744. this.onPointerDown.bind(this)
  26745. ),
  26746. e.addEventListener(
  26747. "pointermove",
  26748. this.onPointerMove.bind(this)
  26749. ),
  26750. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  26751. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  26752. e.addEventListener(
  26753. "pointercancel",
  26754. this.onPointerCancel.bind(this)
  26755. ),
  26756. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  26757. this.cameraControls.on(
  26758. _.Move,
  26759. this.handleControlMove.bind(this)
  26760. ),
  26761. this.cameraControls.on(
  26762. _.InputStart,
  26763. this.handleControlInputStart.bind(this)
  26764. ),
  26765. this.cameraControls.on(
  26766. _.Pinch,
  26767. this.handleControlPinch.bind(this)
  26768. ),
  26769. this.cameraControls.on(
  26770. _.Scroll,
  26771. this.handleControlScroll.bind(this)
  26772. ),
  26773. window.addEventListener(
  26774. "snapshotBegin",
  26775. this.getWrapShot.bind(this)
  26776. ), //xzw add
  26777. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  26778. // lzb
  26779. window.getSeft && getSeft(this);
  26780. }),
  26781. (n.prototype.onMouseDown = function (e) {
  26782. e.currentTarget !== document && e.currentTarget.focus(),
  26783. 0 === e.button &&
  26784. (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  26785. this.updateIntersect());
  26786. }),
  26787. (n.prototype.onMouseMove = function (e) {
  26788. (this.isTouchEvent = !1),
  26789. this.handleInputMove.call(this, e.clientX, e.clientY, !1);
  26790. }),
  26791. (n.prototype.onMouseOver = function (e) {
  26792. (this.containsMouse = !0),
  26793. !this.mouseDown ||
  26794. (0 !== e.which && 0 !== e.buttons) ||
  26795. (this.mouseDown = !1);
  26796. }),
  26797. (n.prototype.onMouseOut = function (e) {
  26798. this.containsMouse = !1;
  26799. }),
  26800. (n.prototype.onMouseUp = function (e) {
  26801. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  26802. }),
  26803. (n.prototype.onTouchStart = function (e) {
  26804. if (
  26805. (e.currentTarget !== document && e.currentTarget.focus(),
  26806. !this.mouseDown)
  26807. ) {
  26808. this.couldBeLongTap = !0;
  26809. var t = g.average(e.changedTouches, "clientX"),
  26810. i = g.average(e.changedTouches, "clientY");
  26811. this.handleInputStart.call(this, t, i, !0),
  26812. (this.mouseDownTimer = setTimeout(
  26813. function () {
  26814. this.updateIntersect(),
  26815. this.handleInputEnd.call(this, t, i, !0);
  26816. }.bind(this),
  26817. f.input.longTapThreshold
  26818. ));
  26819. }
  26820. }),
  26821. (n.prototype.onTouchMove = function (e) {
  26822. var t = g.average(e.changedTouches, "clientX"),
  26823. i = g.average(e.changedTouches, "clientY");
  26824. this.handleInputMove.call(this, t, i, !0);
  26825. }),
  26826. (n.prototype.onTouchEnd = function (e) {
  26827. if ((clearTimeout(this.mouseDownTimer), this.mouseDown)) {
  26828. (this.couldBeLongTap = !1), this.updateIntersect();
  26829. var t = g.average(e.changedTouches, "clientX"),
  26830. i = g.average(e.changedTouches, "clientY");
  26831. this.handleInputEnd.call(this, t, i, !0);
  26832. }
  26833. //add
  26834. if (this.intersectHot) this.intersectHot.setHoverState(false);
  26835. this.intersectHot = null;
  26836. Hot.mobileAutoPlay(this);
  26837. }),
  26838. (n.prototype.onPointerDown = function (e) {
  26839. return (
  26840. e.currentTarget !== document && e.currentTarget.focus(),
  26841. this.mouseDown || "mouse" === e.pointerType
  26842. ? this.onMouseDown(e)
  26843. : ((this.couldBeLongTap = !0),
  26844. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  26845. void (this.mouseDownTimer = setTimeout(
  26846. function () {
  26847. this.updateIntersect(),
  26848. this.handleInputEnd.call(
  26849. this,
  26850. e.clientX,
  26851. e.clientY,
  26852. !0
  26853. );
  26854. }.bind(this),
  26855. f.input.longTapThreshold
  26856. )))
  26857. );
  26858. }),
  26859. (n.prototype.onPointerMove = function (e) {
  26860. "mouse" !== e.pointerType
  26861. ? this.handleInputMove.call(this, e.clientX, e.clientY, !0)
  26862. : this.onMouseMove(e);
  26863. }),
  26864. (n.prototype.onPointerUp = function (e) {
  26865. return this.mouseDown && "mouse" !== e.pointerType
  26866. ? (clearTimeout(this.mouseDownTimer),
  26867. (this.couldBeLongTap = !1),
  26868. this.updateIntersect(),
  26869. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0))
  26870. : this.onMouseUp(e);
  26871. }),
  26872. (n.prototype.onPointerOut = function (e) {
  26873. this.mouseDown = !1;
  26874. }),
  26875. (n.prototype.onPointerCancel = function (e) {
  26876. this.mouseDown = !1;
  26877. }),
  26878. (n.prototype.onKeyDown = function (e) {
  26879. var t = function () {
  26880. this.cameraControls.activeControl &&
  26881. this.cameraControls.activeControl.emit(_.Move, "key");
  26882. }.bind(this),
  26883. i = e.which;
  26884. switch (i) {
  26885. case p.F:
  26886. t(), this.changeFloor(-1);
  26887. break;
  26888. case p.R:
  26889. t(), this.changeFloor(1);
  26890. }
  26891. if (this.mode === u.PANORAMA)
  26892. switch (i) {
  26893. case p.UPARROW:
  26894. case p.W:
  26895. this.flyLocalDirection(d.FORWARD.clone());
  26896. break;
  26897. case p.DOWNARROW:
  26898. case p.S:
  26899. this.flyLocalDirection(d.BACK.clone());
  26900. break;
  26901. case p.A:
  26902. this.flyLocalDirection(d.LEFT.clone());
  26903. break;
  26904. case p.D:
  26905. this.flyLocalDirection(d.RIGHT.clone());
  26906. }
  26907. }),
  26908. (n.prototype.handleScrollPinchZoom = (function () {
  26909. return function (e) {
  26910. var t = e,
  26911. i = this.zoomLevel;
  26912. this.zoomBy(t),
  26913. this.currentPano &&
  26914. this.zoomStats.addZoomAction(
  26915. i,
  26916. this.zoomLevel,
  26917. this.currentPano.id
  26918. );
  26919. };
  26920. })()),
  26921. (n.prototype.handleControlPinch = function (e) {
  26922. f.zoom.enabled
  26923. ? this.handleScrollPinchZoom(1 - e)
  26924. : this.flyLocalDirection(new r.Vector3(0, 0, e).normalize());
  26925. }),
  26926. (n.prototype.handleControlScroll = function (e) {
  26927. f.zoom.enabled
  26928. ? (e > 0
  26929. ? (e = 1 + this.scrollZoomSpeed)
  26930. : e < 0 && (e = 1 - this.scrollZoomSpeed),
  26931. 0 !== e && this.handleScrollPinchZoom(e))
  26932. : this.flyLocalDirection(new r.Vector3(0, 0, -e).normalize());
  26933. }),
  26934. (n.prototype.handleInputStart = function (e, t, i) {
  26935. //许钟文加
  26936. var pad = this.handelPadding(e, t);
  26937. e = pad.x;
  26938. t = pad.y;
  26939. (this.isTouchEvent = i),
  26940. m.convertScreenPositionToNDC(e, t, this.mouse),
  26941. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  26942. (this.mouseCouldBeClickToMove = !0),
  26943. (this.mouseDown = !0);
  26944. Hot.mobileAutoPlay(this);
  26945. }),
  26946. (n.prototype.handelPadding = function (x, y) {
  26947. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  26948. if (!this.pad)
  26949. this.pad = {
  26950. x: dom.getOffset("left", $("#player")[0]),
  26951. y: dom.getOffset("top", $("#player")[0]),
  26952. };
  26953. return {
  26954. x: x - this.pad.x,
  26955. y: y - this.pad.y,
  26956. };
  26957. });
  26958. (n.prototype.handleInputMove = function (e, t, i) {
  26959. //许钟文加
  26960. var pad = this.handelPadding(e, t);
  26961. e = pad.x;
  26962. t = pad.y;
  26963. (this.isTouchEvent = i),
  26964. m.convertScreenPositionToNDC(e, t, this.mouse),
  26965. this.mouseAtMouseDown.distanceTo(this.mouse) >
  26966. f.input.moveToleranceNDC &&
  26967. ((this.mouseCouldBeClickToMove = !1),
  26968. (this.couldBeLongTap = !1),
  26969. clearTimeout(this.mouseDownTimer)),
  26970. (this.mouseLastMoveTime = Date.now()),
  26971. this.reticule.move(e, t, i);
  26972. }),
  26973. (n.prototype.handleInputEnd = function (e, t, i) {
  26974. //xzw
  26975. if (
  26976. ((this.isTouchEvent = i),
  26977. (this.mouseDown = !1),
  26978. this.cameraControls.controls[u.PANORAMA].emit(
  26979. "interaction.direct"
  26980. ),
  26981. !i && this.couldBeLongTap)
  26982. )
  26983. return !0;
  26984. if (this.handleLongTap()) return !0;
  26985. if (this.mouseCouldBeClickToMove) {
  26986. if (this.flying)
  26987. return (
  26988. this.path.activeTransType === x.WALK &&
  26989. this.emit(
  26990. w.WarpInterruptedWithFlyTo,
  26991. this.path.activeTransType
  26992. ),
  26993. !0
  26994. );
  26995. //add----
  26996. if (this.checkHotClick())
  26997. //add
  26998. return !0;
  26999. if (this.hoveringPlane) {
  27000. this.clickOverlay(this.hoveringPlane);
  27001. return;
  27002. }
  27003. if (
  27004. (this.cameraControls.activeControl &&
  27005. this.cameraControls.activeControl.emit(
  27006. _.Move,
  27007. this.isTouchEvent ? "touch" : "mouse"
  27008. ),
  27009. this.history.invalidate(),
  27010. this.intersect)
  27011. )
  27012. return this.flyToPanoClosestToMouse();
  27013. if (this.mode === u.PANORAMA) {
  27014. var n = this.closestPanoInDirection(this.getMouseDirection());
  27015. return n
  27016. ? this.flyToPano({
  27017. pano: n,
  27018. })
  27019. : this.bump(this.getMouseDirection());
  27020. }
  27021. }
  27022. this.intersect &&
  27023. this.closestPano &&
  27024. this.closestPano.hoverOff(this.mode);
  27025. }),
  27026. (n.prototype.handleLongTap = function () {
  27027. if (
  27028. this.couldBeLongTap &&
  27029. (!this.isPanoHover || this.mode !== u.PANORAMA)
  27030. )
  27031. return (
  27032. this.cameraControls.activeControl &&
  27033. this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  27034. !0
  27035. );
  27036. }),
  27037. (n.prototype.checktagClick = function () {
  27038. if (this.tagManager.intersectTag) {
  27039. var e = this.isTouchEvent,
  27040. t = this.tagManager.clickedOnTag(e, this);
  27041. return e || t || y.cancelById(V.LookTransition), !0;
  27042. }
  27043. if (this.tagManager.activeTag)
  27044. return this.tagManager.dismissActiveTag(), !1;
  27045. }),
  27046. (n.prototype.rankedtagInDirection = function (e, t) {
  27047. return this.tagManager.rankedtagInDirection(
  27048. e,
  27049. this.position,
  27050. this.camera,
  27051. t
  27052. );
  27053. }),
  27054. (n.prototype.start = function (e) {
  27055. //-------------------
  27056. //-------------------
  27057. var t = e.mode,
  27058. i = e.pano,
  27059. n = e.position,
  27060. rr = e.quaternion,
  27061. o = e.tag,
  27062. a = e.quickstart,
  27063. s = $.Deferred();
  27064. this.updateModelDependentData(),
  27065. this.updateFromControls(),
  27066. this.findDefaultViews();
  27067. var l = this.is360View(t, i);
  27068. return (
  27069. !this.model.outsideAllowed() || l || a
  27070. ? this.startInside(i, n, rr, o, s)
  27071. : this.startOutside(e, s),
  27072. s.done(
  27073. function (e) {
  27074. this.emit(w.Ready, l, e, o);
  27075. }.bind(this)
  27076. ),
  27077. s.promise()
  27078. );
  27079. }),
  27080. (n.prototype.startOutside = function (e, t) {
  27081. var i = e.mode,
  27082. n = e.pano,
  27083. r = e.position,
  27084. o = e.quaternion,
  27085. a = e.zoom,
  27086. s = e.floorVisibility,
  27087. l = e.tag;
  27088. this.emit(w.StartOutside, f[i].transitionTime),
  27089. this.isOutsideMode(i)
  27090. ? (this.model.warpDestFloors(s, !0),
  27091. y.cancelById(V.FlyToViewFloor),
  27092. i === u.FLOORPLAN
  27093. ? this.floorplanMode(r, o, a)
  27094. : this.dollhouseMode(r, o),
  27095. t.resolve(!1))
  27096. : this.startInsideWithFlyin(n, r, o, l, t);
  27097. }),
  27098. (n.prototype.startInside = function (e, t, i, n, r) {
  27099. (r = r || $.Deferred()), (this.currentPano = e);
  27100. window.bus.dispatchEvent({ type: "playerAndModelReady" });
  27101. this.ready = true;
  27102. var o = e && !e.isAligned();
  27103. if (
  27104. ((t = o ? e.position : t || e.position),
  27105. (i = i || e.quaternion),
  27106. e)
  27107. ) {
  27108. var a = this.startInside.bind(this, e, t, i, n, r);
  27109. if (
  27110. this.checkAndWaitForPanoLoad(
  27111. e,
  27112. "high",
  27113. "low",
  27114. this.basePanoSize,
  27115. a
  27116. )
  27117. )
  27118. return;
  27119. }
  27120. //add
  27121. this.transitionPos({
  27122. type: "beforeFlytopano",
  27123. pano: this.currentPano,
  27124. dur: 0,
  27125. });
  27126. //this.updateHotVisible()
  27127. Hot.updateVisibles([this.currentPano]);
  27128. this.modeTran = "panorama-panorama";
  27129. return (
  27130. (this.mode = u.PANORAMA),
  27131. e.floor.enter(this.mode),
  27132. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  27133. this.switchCameraMode(this.mode, i),
  27134. this.emit(w.StartInside, o),
  27135. r.resolve(!0),
  27136. r
  27137. );
  27138. }),
  27139. (n.prototype.startInsideWithFlyin = function (e, t, i, n, r) {
  27140. if (((r = r || $.Deferred()), this.dollhouseMode(), !e))
  27141. return (
  27142. F.warn(
  27143. "Player.startInsideWithFlyin() -> targetPano is invalid."
  27144. ),
  27145. r.resolve(!1),
  27146. r
  27147. );
  27148. t = t || e.position;
  27149. var o = i || this.cameraControls.activeControl.camera.quaternion,
  27150. a = e.position;
  27151. return (
  27152. this.fitDollhouse(a, t, o),
  27153. setTimeout(
  27154. function (t) {
  27155. this.cameraControls.activeControl &&
  27156. (this.cameraControls.activeControl.maxDistance = t);
  27157. var n = {
  27158. mode: u.PANORAMA,
  27159. pano: e,
  27160. quaternion: i,
  27161. callback: function () {
  27162. this.emit(w.FlyinFinished), r.resolve(!0);
  27163. }.bind(this),
  27164. };
  27165. this.flyToNewMode(n);
  27166. }.bind(this, this.cameraControls.activeControl.maxDistance),
  27167. f.startupFlyinDelay
  27168. ),
  27169. r
  27170. );
  27171. }),
  27172. (n.prototype.checkAndWaitForPanoLoad = (function () {
  27173. var e = {},
  27174. t = {},
  27175. i = 5e3,
  27176. n = function () {
  27177. for (var n in e)
  27178. if (e.hasOwnProperty(n) && e[n]) {
  27179. var r = performance.now() - t[n];
  27180. if (r < i) return !0;
  27181. }
  27182. return !1;
  27183. };
  27184. return function (r, o, a, s, l, c, h, u, d, p) {
  27185. if (n()) return !0;
  27186. var f = function (t, i, n) {
  27187. N.delayOneFrame(
  27188. function () {
  27189. (e[t] = !1), l && l(i, n);
  27190. }.bind(this)
  27191. );
  27192. }.bind(this, r.id),
  27193. g = function (t, i) {
  27194. N.delayOneFrame(
  27195. function () {
  27196. (e[t] = !1), c && c(i);
  27197. }.bind(this)
  27198. );
  27199. }.bind(this, r.id);
  27200. try {
  27201. return (
  27202. (null !== u && void 0 !== u) || (u = !0),
  27203. this.model.supportsTiles
  27204. ? (e[r.id] = this.checkAndWaitForTiledPanoLoad(
  27205. r,
  27206. s,
  27207. f,
  27208. g,
  27209. h,
  27210. u,
  27211. d,
  27212. p
  27213. ))
  27214. : (e[r.id] = this.checkAndWaitForWholePanoLoad(
  27215. r,
  27216. o,
  27217. a,
  27218. f,
  27219. u
  27220. )),
  27221. e[r.id] && (t[r.id] = performance.now()),
  27222. e[r.id]
  27223. );
  27224. } catch (n) {
  27225. throw ((e[r.id] = !1), (t[r.id] = performance.now() - i), n);
  27226. }
  27227. };
  27228. })()),
  27229. (n.prototype.checkAndWaitForWholePanoLoad = function (
  27230. e,
  27231. t,
  27232. i,
  27233. n,
  27234. r
  27235. ) {
  27236. if (!e)
  27237. throw new M(
  27238. "Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano."
  27239. );
  27240. return (
  27241. r &&
  27242. this.model.waitForLoad(e, function () {
  27243. return e.isLoaded(i);
  27244. }),
  27245. !e.isLoaded(t) && (e.loadCube(t).done(n), !0)
  27246. );
  27247. }),
  27248. (n.prototype.checkAndWaitForTiledPanoLoad = (function () {
  27249. var e = new r.Vector3();
  27250. return function (t, i, n, r, o, a, s, l) {
  27251. if (!t)
  27252. throw new M(
  27253. "Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano."
  27254. );
  27255. return (
  27256. e.copy(d.FORWARD),
  27257. this.getDirection(e),
  27258. !t.isLoaded(i) &&
  27259. (a &&
  27260. this.model.waitForLoad(t, function () {
  27261. return t.isLoaded(i);
  27262. }),
  27263. t
  27264. .loadTiledPano(i, e, null, s, l)
  27265. .done(
  27266. function (e, t) {
  27267. n && n(e, t);
  27268. }.bind(this)
  27269. )
  27270. .fail(
  27271. function (e) {
  27272. r && r(e);
  27273. }.bind(this)
  27274. )
  27275. .progress(
  27276. function (e, t, i) {
  27277. o && o(e, t, i);
  27278. }.bind(this)
  27279. ),
  27280. !0)
  27281. );
  27282. };
  27283. })()),
  27284. (n.prototype.switchCameraMode = function (e, t) {
  27285. var i = this.cameraControls.controls[e],
  27286. n = i.camera;
  27287. switch (e) {
  27288. case u.PANORAMA:
  27289. n.position.copy(this.currentPano.position);
  27290. var o = t
  27291. ? d.FORWARD.clone().applyQuaternion(t)
  27292. : this.getDirection().setY(0).normalize();
  27293. i.lookAt(o.add(n.position));
  27294. break;
  27295. case u.DOLLHOUSE:
  27296. /* var a = this.position.clone();
  27297. 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),
  27298. n.position.copy(a),
  27299. i.target.copy(this.target.clone().setY(this.model.center.y));
  27300. break; */
  27301. //for多楼层 且 让模型刚好适应屏幕
  27302. var box = this.model.boundingBox.clone();
  27303. box.applyMatrix4(this.camera.matrixWorld); //将 boundingbox、也就是模型, 转换到当前相机朝向
  27304. var boxSize = box.size(); //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  27305. var fov = B.getHFOVFromVFOV(f.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  27306. var distance =
  27307. Math.abs(boxSize.x) /
  27308. 2 /
  27309. Math.tan(THREE.Math.degToRad(fov / 2)); //根据上面获得的参数得到target到相机的距离
  27310. //console.log(boxSize.x,distance, boxSize.length() / 2)
  27311. distance += boxSize.length() / 2; //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  27312. if (this.mode === u.PANORAMA) {
  27313. i.target.copy(this.model.center);
  27314. var vec = this.getDirection().negate().setY(1).normalize(); //获得朝向
  27315. } else {
  27316. i.target.copy(
  27317. this.target.clone().setY(this.model.center.y)
  27318. );
  27319. var vec = d.DOWN.clone()
  27320. .applyQuaternion(this.quaternion)
  27321. .setY(1)
  27322. .normalize();
  27323. }
  27324. vec.multiplyScalar(distance);
  27325. n.position.copy(i.target.clone().add(vec));
  27326. break;
  27327. case u.FLOORPLAN:
  27328. n.position
  27329. .copy(this.model.center)
  27330. .setY(f.floorplan.cameraHeight),
  27331. i.target.copy(this.model.center).setY(0),
  27332. i.zoomToContain(this.model.size),
  27333. i.rotateToView(this.model.size, this.getDirection());
  27334. }
  27335. i.update(0);
  27336. }),
  27337. (n.prototype.update = (function () {
  27338. var e = (new r.Vector3(), {}),
  27339. t = [];
  27340. return function (i) {
  27341. this.updatePersistentZooming(i),
  27342. this.updateFromControls(i),
  27343. this.getCurrentNodePanos(t);
  27344. this.lastFrameChanged = false;
  27345. if (this.hasChanged(e)) {
  27346. this.lastFrameChanged = e.cameraChanged3
  27347. ? "level3"
  27348. : e.cameraChanged2
  27349. ? "level2"
  27350. : e.cameraChanged
  27351. ? "level1"
  27352. : false;
  27353. (this.lastChangeTime = Date.now()),
  27354. !this.mouseDown &&
  27355. this.containsMouse &&
  27356. this.updateIntersect(),
  27357. this.emit(w.ViewChanged, e),
  27358. this.intersect &&
  27359. this.magnifier &&
  27360. this.magnifier.update(this.intersect.point);
  27361. }
  27362. if (e.cameraChanged2) {
  27363. //变化要更大些
  27364. }
  27365. if (e.cameraChanged) {
  27366. this.mode == "panorama" &&
  27367. window.cad &&
  27368. cad.setSign(
  27369. { x: this.position.x, y: this.position.z },
  27370. this.cameraControls.controls.panorama.lon
  27371. );
  27372. /* for(var i in this.model.hots){
  27373. this.model.hots[i].updateTitle(this)
  27374. } */
  27375. Hot.updateHots();
  27376. }
  27377. this.model.supportsTiles &&
  27378. (this.updateTileDownloader(t), this.updatePanoRenderer(t)),
  27379. this.updatePreRendering(t),
  27380. this.reticule.update(),
  27381. this.path.update(),
  27382. this.spider.update(),
  27383. this.cachedPanoCandidates &&
  27384. f.navigation.panoScores &&
  27385. this.model.panos.showPanoScores(this.cachedPanoCandidates),
  27386. this.updateControlLocks(),
  27387. this.model.supportsTiles && this.updateZoomPano();
  27388. };
  27389. })()),
  27390. /* n.prototype.controlVideosPlay = function() {//判断box视频是否可见 不可见就暂停
  27391. var lastMode, lastPano;
  27392. return function(){
  27393. var mode = this.mode;
  27394. var pano = mode == "panorama" ? this.currentPano : "";
  27395. if(mode != "panorama" || pano != lastPano){
  27396. overlay.noBlock = null
  27397. }
  27398. this.overlayGroup.children.forEach((overlay)=>{
  27399. if(overlay.overlayType == "video" ){
  27400. var matrix = overlay.plane.matrixWorld;
  27401. var inSight = false;
  27402. var cameraDir = this.getDirection();
  27403. var planeDir = (new r.Vector3).copy(d.FORWARD).applyQuaternion(overlay.plane.quaternion)
  27404. var vertexes = []
  27405. if(cameraDir.angleTo(planeDir)>Math.PI/2){//朝向相机视线
  27406. for(let i=0; i<4; i++){
  27407. var vertex = overlay.plane.geometry.vertices[i].clone().applyMatrix4(matrix)
  27408. vertexes.push(vertex)
  27409. if(overlay.noBlock == null){
  27410. if(!m.ifShelter(vertex)){
  27411. overlay.noBlock = true
  27412. }
  27413. inSight = true; break;
  27414. }else{
  27415. overlay.noBlock = true
  27416. }
  27417. if(m.getPos2d(vertex, this.camera, $("#player")[0]).inSight){
  27418. inSight = true; break;
  27419. }
  27420. }
  27421. }
  27422. overlay.inSight = inSight
  27423. if(!inSight)overlay.plane.material.map.image.pause()
  27424. else overlay.plane.material.map.image.play()//maybe fail
  27425. }
  27426. })
  27427. lastMode = mode, lastPano = pano
  27428. }
  27429. }() */
  27430. (n.prototype.updatePersistentZooming = function (e) {
  27431. 1 === this.zooming
  27432. ? this.zoomBy(1 + this.zoomSpeed * e)
  27433. : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e);
  27434. }),
  27435. (n.prototype.updateControlLocks = function () {
  27436. this.currentPano &&
  27437. this.model.supportsTiles &&
  27438. (this.cameraControls.controls[u.PANORAMA].locked =
  27439. !this.currentPano.highestFullTileRenderOpCompleted &&
  27440. this.currentPano.lockUntilRenderingComplete);
  27441. }),
  27442. (n.prototype.updatePanoRenderer = (function () {
  27443. var e = new r.Vector3();
  27444. return function (t) {
  27445. var i = this.nextPano || this.currentPano;
  27446. this.panoRenderer.hasQueuedTiles() &&
  27447. i &&
  27448. (e.copy(d.FORWARD),
  27449. this.getDirection(e),
  27450. this.panoRenderer.updateDirection(e));
  27451. };
  27452. })()),
  27453. (n.prototype.cleanupInactivePanos = (function () {
  27454. var e = [],
  27455. t = [];
  27456. return function () {
  27457. (e.length = 0),
  27458. e.push(this.currentPano),
  27459. this.nextPano && e.push(this.nextPano),
  27460. (t.length = 0);
  27461. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  27462. t.push(this.panoRenderer.activePanos[i]);
  27463. for (var n = 0; n < t.length; n++) {
  27464. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  27465. r.id === e[a].id && (o = !1);
  27466. o && r.exit();
  27467. }
  27468. };
  27469. })()),
  27470. (n.prototype.updatePreRendering = (function () {
  27471. var e = {};
  27472. return function (t) {
  27473. if (
  27474. 1 === f.tiling.preRenderTourPanos &&
  27475. this.preRenderingEnabled
  27476. ) {
  27477. var i = this.nextPano || this.currentPano;
  27478. if (i && t && t.length > 1) {
  27479. var n = t.findIndex(function (e) {
  27480. if (e.id === i.id) return !0;
  27481. });
  27482. if (n >= 0 && n + 1 < t.length) {
  27483. var r = t[n + 1];
  27484. r.isLoaded(this.basePanoSize) ||
  27485. e[r.id] ||
  27486. (window.setTimeout(
  27487. function (t) {
  27488. this.checkAndWaitForPanoLoad(
  27489. t,
  27490. "high",
  27491. "low",
  27492. this.basePanoSize,
  27493. null,
  27494. null,
  27495. null,
  27496. !1,
  27497. !1,
  27498. !1
  27499. ),
  27500. window.setTimeout(
  27501. function (t) {
  27502. e[t.id] = !1;
  27503. }.bind(this, t),
  27504. f.tiling.panoPreRenderRepeatDelay
  27505. );
  27506. }.bind(this, r),
  27507. f.tiling.panoPreRenderDelay
  27508. ),
  27509. (e[r.id] = !0));
  27510. }
  27511. }
  27512. }
  27513. };
  27514. })()),
  27515. (n.prototype.enablePreRendering = function () {
  27516. this.preRenderingEnabled = !0;
  27517. }),
  27518. (n.prototype.disablePreRendering = function () {
  27519. (this.preRenderingEnabled = !1), this.cleanupInactivePanos();
  27520. }),
  27521. (n.prototype.updateTileDownloader = (function () {
  27522. var e = new r.Vector3();
  27523. return function (t) {
  27524. var i = this.nextPano || this.currentPano;
  27525. i &&
  27526. (e.copy(d.FORWARD),
  27527. this.getDirection(e),
  27528. this.tileDownloader.tilePrioritizer.updateCriteria(
  27529. i,
  27530. this.position,
  27531. e,
  27532. t.length > 0 ? t : null
  27533. ),
  27534. (this.tileDownloader.processPriorityQueue = !0));
  27535. };
  27536. })()),
  27537. (n.prototype.updateFromControls = function (e) {
  27538. (null !== e && void 0 !== e) || (e = 0),
  27539. this.cameraControls.activeControl &&
  27540. (this.cameraControls.activeControl.update(e),
  27541. this.quaternion.copy(
  27542. this.cameraControls.activeControl.camera.quaternion
  27543. ),
  27544. this.position.copy(
  27545. this.cameraControls.activeControl.camera.position
  27546. ),
  27547. this.target.copy(this.cameraControls.activeControl.target),
  27548. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  27549. this.camera.projectionMatrix.copy(
  27550. this.cameraControls.activeControl.camera.projectionMatrix
  27551. )),
  27552. this.camera.position.copy(this.position),
  27553. this.camera.quaternion.copy(this.quaternion),
  27554. this.camera.updateMatrix(),
  27555. this.camera.updateMatrixWorld();
  27556. }),
  27557. (n.prototype.hasChanged = function (e) {
  27558. if (!this.previousState) {
  27559. this.previousState = {
  27560. allFloorsVisible: this.model.allFloorsVisible,
  27561. position: this.position.clone(),
  27562. quaternion: this.quaternion.clone(),
  27563. mouse: this.mouse.clone(),
  27564. //labelScaleFactor: this.getLabelScaleFactor(),
  27565. currentFloor: this.model.currentFloor,
  27566. projectionMatrix: this.camera.projectionMatrix.clone(),
  27567. worldMatrix: this.camera.matrixWorld.clone(),
  27568. mode: this.mode,
  27569. modelPosition: this.model.position.clone(),
  27570. modelCenter: this.model.center.clone(),
  27571. zoomLevel: this.zoomLevel,
  27572. };
  27573. e.cameraChanged = e.cameraChanged2 = true;
  27574. return !0;
  27575. }
  27576. //许钟文改 分成相机是否改变cameraChanged 和其他
  27577. var a =
  27578. this.position.equals(this.previousState.position) &&
  27579. this.quaternion.equals(this.previousState.quaternion) &&
  27580. this.camera.matrixWorld.equals(
  27581. this.previousState.worldMatrix
  27582. ) &&
  27583. this.camera.projectionMatrix.equals(
  27584. this.previousState.projectionMatrix
  27585. ) &&
  27586. this.mode === this.previousState.mode &&
  27587. this.zoomLevel === this.previousState.zoomLevel &&
  27588. this.model.center.equals(this.previousState.modelCenter) &&
  27589. this.model.position.equals(this.previousState.modelPosition);
  27590. var t =
  27591. a &&
  27592. this.mouse.equals(this.previousState.mouse) &&
  27593. this.model.allFloorsVisible ===
  27594. this.previousState
  27595. .allFloorsVisible /* && this.getLabelScaleFactor() === this.previousState.labelScaleFactor */ &&
  27596. this.model.currentFloor === this.previousState.currentFloor &&
  27597. null === this.nextPano;
  27598. e.cameraChanged = !a;
  27599. (e.allFloorsVisible =
  27600. this.model.allFloorsVisible !==
  27601. this.previousState.allFloorsVisible),
  27602. (e.moved = !this.position.equals(this.previousState.position)),
  27603. (e.rotated = !this.quaternion.equals(
  27604. this.previousState.quaternion
  27605. )),
  27606. (e.mouseMoved = !this.mouse.equals(this.previousState.mouse)),
  27607. // e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  27608. (e.floorChanged =
  27609. this.model.currentFloor !== this.previousState.currentFloor),
  27610. (e.cameraProjectionChanged =
  27611. !this.camera.projectionMatrix.equals(
  27612. this.previousState.projectionMatrix
  27613. )),
  27614. (e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(
  27615. this.previousState.worldMatrix
  27616. )),
  27617. (e.modeChanged = this.mode !== this.previousState.mode),
  27618. (e.modelPositionChanged = !this.model.position.equals(
  27619. this.previousState.modelPosition
  27620. )),
  27621. (e.modelCenterChanged = !this.model.center.equals(
  27622. this.previousState.modelCenter
  27623. )),
  27624. (e.nextPanoActive = null !== this.nextPano),
  27625. (e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel);
  27626. /* if(e.cameraChanged){//
  27627. 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)
  27628. }else e.cameraChanged2 = false */
  27629. if (e.cameraChanged) {
  27630. e.cameraChanged2 =
  27631. e.cameraProjectionChanged ||
  27632. !MathLight.closeTo(
  27633. this.quaternion,
  27634. this.previousState.quaternion,
  27635. 5
  27636. ) ||
  27637. !MathLight.closeTo(
  27638. this.position,
  27639. this.previousState.position,
  27640. 4
  27641. );
  27642. e.cameraChanged3 =
  27643. e.cameraProjectionChanged ||
  27644. !MathLight.closeTo(
  27645. this.quaternion,
  27646. this.previousState.quaternion,
  27647. 3
  27648. ) ||
  27649. !MathLight.closeTo(
  27650. this.position,
  27651. this.previousState.position,
  27652. 3
  27653. );
  27654. } else {
  27655. e.cameraChanged2 = false;
  27656. e.cameraChanged3 = false;
  27657. }
  27658. (this.previousState.allFloorsVisible =
  27659. this.model.allFloorsVisible),
  27660. this.previousState.position.copy(this.position),
  27661. this.previousState.quaternion.copy(this.quaternion),
  27662. this.previousState.mouse.copy(this.mouse),
  27663. //this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  27664. (this.previousState.currentFloor = this.model.currentFloor),
  27665. this.previousState.projectionMatrix.copy(
  27666. this.camera.projectionMatrix
  27667. ),
  27668. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  27669. (this.previousState.mode = this.mode),
  27670. this.previousState.modelPosition.copy(this.model.position),
  27671. this.previousState.modelCenter.copy(this.model.center),
  27672. (this.previousState.zoomLevel = this.zoomLevel);
  27673. //console.log("cameraChanged2 "+ e.cameraChanged2 + ", mouseMoved "+e.mouseMoved)
  27674. return !t;
  27675. }),
  27676. (n.prototype.updateIntersect = function () {
  27677. var e = this.flying || this.isWarping(),
  27678. t =
  27679. this.isOutsideMode() &&
  27680. this.cameraControls.controls[this.mode].isEngaged(),
  27681. i = y.getById(V.LookTransition),
  27682. n = !(
  27683. e ||
  27684. t ||
  27685. this.isTouchEvent ||
  27686. (i.length && i[0].running)
  27687. );
  27688. {
  27689. //clear:
  27690. if (this.intersectHot) this.intersectHot.setHoverState(false);
  27691. this.intersectHot = null;
  27692. $("#player").css("cursor", "");
  27693. }
  27694. var deal = () => {
  27695. if (this.intersect && this.intersect.object.visible) {
  27696. if ("hotSprite" == this.intersect.object.type) {
  27697. this.intersectHot = this.intersect.object;
  27698. while (!(this.intersectHot instanceof Hot)) {
  27699. this.intersectHot = this.intersectHot.parent;
  27700. }
  27701. $(
  27702. `.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`
  27703. ).addClass("active");
  27704. this.intersectHot.setHoverState(true);
  27705. }
  27706. }
  27707. };
  27708. if (this.model.hotGroup) {
  27709. var hots = this.model.hotGroup.children.filter(
  27710. (e) =>
  27711. e.info.actionType.examine ||
  27712. e.info.actionType.fastTran ||
  27713. e.info.actionType.openHot ||
  27714. e.info.actionType.playAndPause
  27715. );
  27716. this.intersect = this.getMouseIntersect(
  27717. null,
  27718. hots.concat(this.model.colliders)
  27719. );
  27720. if (this.intersect) {
  27721. deal();
  27722. let intersect = this.intersect;
  27723. if (this.intersectHot) {
  27724. this.intersect = null;
  27725. $("#player").css("cursor", "pointer");
  27726. } else {
  27727. if (intersect.object.parent.parent.hidden) {
  27728. //楼层已隐藏
  27729. this.intersect = null;
  27730. }
  27731. }
  27732. }
  27733. } else {
  27734. this.intersect = this.getMouseIntersect();
  27735. }
  27736. this.intersect && this.updateClosestPano(this.intersect),
  27737. this.closestPano ||
  27738. this.closestPanoInDirection(this.getMouseDirection())
  27739. ? (this.reticule.updatePosition(
  27740. this.position,
  27741. this.intersect
  27742. ),
  27743. f.navigation.panoScores &&
  27744. !f.navigation.mouseDirection &&
  27745. this.closestPanoInDirection(this.getDirection()))
  27746. : this.reticule.hide();
  27747. }),
  27748. (n.prototype.checkHotClick = function () {
  27749. if (this.intersectHot) {
  27750. if (
  27751. this.intersectHot.texType == "video" &&
  27752. this.intersectHot.info.actionType.playAndPause
  27753. ) {
  27754. this.intersectHot.switchPlay(
  27755. !!this.intersectHot.pausedByUser
  27756. );
  27757. }
  27758. this.intersectHot.examine(this);
  27759. return true;
  27760. }
  27761. }),
  27762. (n.prototype.getMouseDirection = function (e) {
  27763. e = e || this.mouse;
  27764. var t = new r.Vector3(e.x, e.y, -1).unproject(this.camera),
  27765. i = new r.Vector3(e.x, e.y, 1).unproject(this.camera);
  27766. return i.sub(t).normalize();
  27767. }),
  27768. (n.prototype.hoverOverlay = function (mesh) {
  27769. if (!mesh) {
  27770. this.hoveringPlane = null;
  27771. $("#player").css("cursor", this.currentCursor || "");
  27772. } else {
  27773. var overlay = mesh.parent;
  27774. $("#player").css("cursor", "pointer");
  27775. this.hoveringPlane = overlay;
  27776. return true;
  27777. }
  27778. }),
  27779. (n.prototype.clickOverlay = function (overlay) {
  27780. if (this.openOverlay && !overlay) return;
  27781. var plane = overlay.plane;
  27782. /* if(overlay.overlayType == "video"){
  27783. if(plane.material.map.image.paused) plane.material.map.image.play()
  27784. else plane.material.map.image.pause()
  27785. } */
  27786. if (overlay.overlayType == "video") {
  27787. overlay.switchPlay(!!overlay.pausedByUser);
  27788. }
  27789. /* if(window.EditOverlay &&EditOverlay.editing){
  27790. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  27791. $('#overlayProp').removeClass('atRight').removeClass('hide')
  27792. EditOverlay.endAddPlane();
  27793. EditOverlay.updateOverlayPanel(overlay)
  27794. EditOverlay.controlSelectOverlay(overlay)
  27795. return;
  27796. } */
  27797. }),
  27798. (n.prototype.getMouseIntersect = function (e, t) {
  27799. //xzw change
  27800. (e = e || this.mouse.clone()),
  27801. (t =
  27802. t ||
  27803. this.model.floors.reduce(
  27804. function (e, t) {
  27805. return t.hidden ? e : e.concat(t.collider.children);
  27806. },
  27807. this.mode === u.PANORAMA ? this.panoMarkers : []
  27808. ));
  27809. var i = new r.Vector3(e.x, e.y, -1).unproject(this.camera);
  27810. this.raycaster.set(i, this.getMouseDirection(e));
  27811. var n = this.raycaster.intersectObjects(t, true); //add true
  27812. var o = n[0];
  27813. if (o) {
  27814. o.face &&
  27815. ((o.normal = o.face.normal.applyQuaternion(
  27816. o.object.quaternion
  27817. )),
  27818. this.position.clone().sub(o.point).dot(o.normal) < 0 &&
  27819. o.normal.negate(),
  27820. this.currentPano
  27821. ? (o.onFloor =
  27822. o.point.y <
  27823. this.position.y - 0.5 * this.currentPano.height)
  27824. : (o.onFloor = o.point.y < this.position.y - 0.5),
  27825. (o.horizontal = 0.8 < o.normal.y));
  27826. return o;
  27827. }
  27828. }),
  27829. (n.prototype.updateClosestPano = function (e) {
  27830. var t = [s.filters.isPanoAligned()];
  27831. if (this.mode === u.PANORAMA) {
  27832. if (!this.currentPano) return;
  27833. t.push(s.filters.not(this.currentPano)),
  27834. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  27835. t.push(
  27836. s.filters.inFloorDirection(
  27837. this.currentPano.floorPosition,
  27838. this.getDirection(),
  27839. 0.25
  27840. )
  27841. ),
  27842. t.push(
  27843. s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)
  27844. ),
  27845. t.push(s.filters.isNotBehindNormal(e.point, e.normal));
  27846. } else {
  27847. t.push(s.filters.isOnVisibleFloor()),
  27848. t.push(this.checkHasNeighbor); //add
  27849. this.mode !== u.FLOORPLAN &&
  27850. t.push(
  27851. s.filters.inDirection(
  27852. this.position,
  27853. this.getDirection(),
  27854. 0.25
  27855. )
  27856. );
  27857. }
  27858. var i = this.model.panos.find(t, [
  27859. s.sortFunctions.floorDistanceToPoint(e.point),
  27860. ]);
  27861. i !== this.closestPano
  27862. ? (i && (this.isPanoHover = !0),
  27863. this.emit(
  27864. w.ClosestPanoChanging,
  27865. this.closestPano,
  27866. i,
  27867. this.mode
  27868. ),
  27869. (this.closestPano = i))
  27870. : (this.isPanoHover = !1);
  27871. }),
  27872. (n.prototype.dollhouseMode = function (e, t) {
  27873. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  27874. (this.mode = u.DOLLHOUSE),
  27875. this.cameraControls.controls[u.DOLLHOUSE].reset();
  27876. var i = new r.Vector3(
  27877. this.model.center.x,
  27878. 0,
  27879. this.model.center.z
  27880. ),
  27881. n = new r.Vector3(15, 10, 15);
  27882. if (e && t) {
  27883. var o = d.FORWARD.clone().applyQuaternion(t),
  27884. a = this.model.center.clone().sub(e),
  27885. s = a.dot(o);
  27886. s > 0
  27887. ? ((i = o.clone().multiplyScalar(s).add(e)), n.copy(e))
  27888. : F.warn(
  27889. "Tried to initiate dollhouse mode that wasn't looking at the model",
  27890. e,
  27891. t
  27892. );
  27893. }
  27894. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  27895. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  27896. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  27897. this.updateFromControls(),
  27898. (this.model.alpha = 1),
  27899. (this.model.skybox.material.uniforms.opacity.value = 0);
  27900. }),
  27901. (n.prototype.insideMode = function (e, t) {
  27902. var i = $.Deferred(),
  27903. n = t || null;
  27904. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  27905. var r = [s.filters.isPanoAligned()];
  27906. this.model.currentFloor &&
  27907. r.push(s.filters.atFloor(this.model.currentFloor)),
  27908. (e =
  27909. e ||
  27910. this.currentPano ||
  27911. this.model.panos.find(r, [
  27912. s.sortFunctions.distanceToPoint(
  27913. this.cameraControls.activeControl.target
  27914. ),
  27915. ])),
  27916. this.flyToNewMode({
  27917. mode: u.PANORAMA,
  27918. pano: e,
  27919. callback: n,
  27920. })
  27921. .done(i.resolve.bind(i))
  27922. .fail(i.reject.bind(i));
  27923. } else {
  27924. var o =
  27925. this.mode === u.PANORAMA
  27926. ? "Already in panorama mode"
  27927. : "Cannot change mode during mode transition";
  27928. i.reject(o);
  27929. }
  27930. return i.promise();
  27931. }),
  27932. (n.prototype.fitDollhouse = function (e, t, i) {
  27933. //许钟文改 飞入前寻找和初始视角最合适的位置
  27934. //if(urlHasValue('oldEntry')){
  27935. //搬自一代。
  27936. var maxY = this.model.boundingBox.max.y;
  27937. var n = d.FORWARD.clone().applyQuaternion(i),
  27938. i = n.clone().add(e);
  27939. this.cameraControls.activeControl.target.copy(i),
  27940. this.cameraControls.activeControl.camera.position
  27941. .set(0, maxY * 2.4, 0)
  27942. .add(e)
  27943. .add(n.multiplyScalar(-10));
  27944. //return;
  27945. /* //this.camera.position.copy(this.model.center);
  27946. //this.camera.updateMatrixWorld()
  27947. this.switchCameraMode("dollhouse", i) */
  27948. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  27949. //直接用一代的这个 效果和二代几乎一样,且不会甩
  27950. /* var n = d.FORWARD.clone().applyQuaternion(i);
  27951. this.cameraControls.activeControl.target.copy(n).add(e);
  27952. var o = d.RIGHT.clone().applyQuaternion(i)
  27953. , a = d.UP.clone()
  27954. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  27955. , l = this.model.boundingBox.max.clone()
  27956. , c = this.model.boundingBox.min.clone()
  27957. , 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)]
  27958. , u = 0
  27959. , p = 0
  27960. , g = 0;
  27961. h.forEach(function(e, t, i) {
  27962. var n = Math.abs(e.dot(o))
  27963. , r = e.dot(s);
  27964. n > u && (u = n,
  27965. p = r),
  27966. r > g && (g = r)
  27967. });
  27968. 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)))
  27969. , v = s.clone().multiplyScalar(p).add(t)
  27970. , A = s.clone().multiplyScalar(g).add(t);
  27971. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  27972. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  27973. p = Math.max(p, 10),
  27974. g = Math.max(g, 10);
  27975. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  27976. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  27977. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  27978. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  27979. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  27980. */
  27981. }),
  27982. (n.prototype.floorplanMode = function (e, t, i) {
  27983. this.mode = u.FLOORPLAN;
  27984. var n = this.cameraControls.controls[u.FLOORPLAN];
  27985. n.reset();
  27986. var r = e ? e : this.model.center;
  27987. if (
  27988. (n.target.copy(r).setY(0),
  27989. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  27990. i
  27991. ? ((n.currentScale =
  27992. i / ($("#player").width() / $("#player").height())),
  27993. (n.absoluteScale = n.currentScale))
  27994. : n.zoomToContain(this.model.size),
  27995. t)
  27996. ) {
  27997. var o = d.LEFT.clone().applyQuaternion(t);
  27998. n.rotateLeft(-Math.atan2(o.x, o.z));
  27999. } else n.rotateToView(this.model.size, this.getDirection());
  28000. n.update(0);
  28001. }),
  28002. (n.prototype.nonInterruptingFlyToPano = function (e, t) {
  28003. return (e.skipWarpingCheck = !0), this.flyToPano(e, t);
  28004. }),
  28005. (n.prototype.updateMarkerVisi = function () {
  28006. //加
  28007. if (this.mode != "panorama") return;
  28008. this.model.panos.list.forEach((pano) => {
  28009. if (!pano.marker) return;
  28010. pano.marker.material.visible =
  28011. !!pano.neighbourPanos[this.currentPano.id];
  28012. });
  28013. }),
  28014. /* n.prototype.updateHotVisible = function(pano){
  28015. var hots = this.model.hots;
  28016. pano = pano || this.currentPano;
  28017. for (var index in hots){
  28018. var visible;
  28019. if(this.mode != "panorama"){
  28020. visible = true;
  28021. }else{
  28022. //hots[index].mesh.material.depthTest = false;
  28023. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  28024. }
  28025. hots[index].mesh.visible = visible;
  28026. }
  28027. } */
  28028. (n.prototype.flyToPano = function (e, t) {
  28029. var i = e.pano,
  28030. aim = e.lookAtPoint,
  28031. aimQua = e.quaternion, //ADD
  28032. o = e.duration,
  28033. a = e.aimDuration,
  28034. s = e.maxDistanceOverride,
  28035. l = e.skipWarpingCheck,
  28036. c = e.constantMoveSpeed,
  28037. h = null,
  28038. p = null;
  28039. if (aim) {
  28040. var _ = new r.Matrix4().lookAt(i.position, aim, d.UP);
  28041. aimQua = new r.Quaternion().setFromRotationMatrix(_);
  28042. } else aimQua = aimQua;
  28043. var zoomLevel = e.zoomLevel || 1; //add
  28044. if (this.flying) return t && t(e);
  28045. window.specialScene &&
  28046. specialScene.special().specifySpot &&
  28047. specialScene.special().specifySpot(i);
  28048. if (
  28049. this.isWarping() &&
  28050. !l &&
  28051. (this.path.activeTransType === x.BLACK ||
  28052. this.path.activeTransType === x.STD)
  28053. )
  28054. return (
  28055. F.warn("Player.flyToPano() -> Cannot fly when warping"),
  28056. t && t(),
  28057. !1
  28058. );
  28059. if ((this.updateLastView(), this.mode !== u.PANORAMA)) {
  28060. var m;
  28061. void this.flyToNewMode({
  28062. mode: u.PANORAMA,
  28063. pano: i,
  28064. duration: o,
  28065. quaternion: aimQua,
  28066. callback: t,
  28067. });
  28068. }
  28069. if (
  28070. !i ||
  28071. ((h = g.deepExtend(e)),
  28072. (p = function () {
  28073. N.delayOneFrame(
  28074. function () {
  28075. this.flyToPano(h, t);
  28076. }.bind(this)
  28077. );
  28078. }.bind(this)),
  28079. !this.checkAndWaitForPanoLoad(
  28080. i,
  28081. "high",
  28082. "low",
  28083. this.basePanoSize,
  28084. p
  28085. ))
  28086. ) {
  28087. var C = function (e) {
  28088. t && t(e);
  28089. }.bind(this);
  28090. this.currentPano ||
  28091. ((this.currentPano = i),
  28092. this.path.placeCpm(),
  28093. this.path.fadeOutCpm(f.path.fadeOutTime),
  28094. this.spider.draw());
  28095. var I = o;
  28096. if ("number" != typeof o) {
  28097. var E = s || f.transition.flytimeMaxDistanceThreshold;
  28098. I =
  28099. Math.min(
  28100. this.currentPano.position.distanceTo(i.position),
  28101. E
  28102. ) *
  28103. f.transition.flytimeDistanceMultiplier +
  28104. f.transition.flyTime;
  28105. }
  28106. if (
  28107. (f.transition.flySpeed > 0.01 &&
  28108. (I =
  28109. (1e3 * this.currentPano.position.distanceTo(i.position)) /
  28110. f.transition.flySpeed),
  28111. zoomLevel !== this.zoomLevel)
  28112. )
  28113. switch (f.zoom.transitionStyle) {
  28114. case 1:
  28115. this.smoothZoomFovTo(
  28116. null,
  28117. zoomLevel,
  28118. zoomLevel == 1 ? I / 2 : I
  28119. ); //改
  28120. break;
  28121. case 2:
  28122. return (
  28123. (h = g.deepExtend(e)),
  28124. (p = this.flyToPano.bind(this, h, t)),
  28125. void this.smoothZoomFovTo(
  28126. null,
  28127. zoomLevel,
  28128. f.zoom.restoreTime * (this.zoomLevel - 1),
  28129. p
  28130. )
  28131. );
  28132. }
  28133. if (aimQua) {
  28134. y.cancelById(V.LookTransition),
  28135. (I *= f.transition.aimSlowFactor);
  28136. var b =
  28137. this.cameraControls.activeControl.camera.quaternion.clone(),
  28138. S = b.clone(),
  28139. M = new r.Vector3();
  28140. if (i === this.currentPano) {
  28141. var R = d.FORWARD.clone().applyQuaternion(b),
  28142. P = d.FORWARD.clone().applyQuaternion(aimQua),
  28143. O = R.angleTo(P);
  28144. return (
  28145. (void 0 !== a && null !== a) ||
  28146. (a =
  28147. ((1 * Math.sqrt(O)) /
  28148. f.tags.navigate.rotateSpeedFactor) *
  28149. 1e3),
  28150. void y.start(
  28151. function (e) {
  28152. S.copy(b),
  28153. v.quaternion(S, aimQua)(e),
  28154. M.copy(d.FORWARD)
  28155. .applyQuaternion(S)
  28156. .add(
  28157. this.cameraControls.activeControl.camera
  28158. .position
  28159. ),
  28160. this.cameraControls.activeControl.lookAt(M);
  28161. }.bind(this),
  28162. a,
  28163. C,
  28164. 0,
  28165. A[f.transition.movementEasing],
  28166. null,
  28167. V.LookTransition
  28168. )
  28169. );
  28170. }
  28171. }
  28172. if (i === this.currentPano) return void C();
  28173. this.flying = !0;
  28174. var L = this.position.clone(),
  28175. D = this.currentPano;
  28176. F.debug("Flying to pano ", i.position),
  28177. this.emit(w.PanoChosen, this.currentPano, i),
  28178. this.emit(w.FlyingStarted, i.position, L, i, D);
  28179. //---------before fly--------------- add
  28180. //this.updateHotVisible(i); //更新热点显示
  28181. this.transitionPos({
  28182. type: "beforeFlytopano",
  28183. pano: i,
  28184. dur: I,
  28185. }); //add
  28186. Hot.updateVisibles([this.currentPano, i]);
  28187. //地标变化
  28188. if (this.model.floorLogos) {
  28189. this.model.changefloorLogoOpa({
  28190. index: 0,
  28191. opa: 0,
  28192. dur: p,
  28193. delay: 0.7,
  28194. }); //this.model.floorLogoFade(0, _duration*0.5, 0.7);
  28195. this.model.floorLogos[1].position.copy(
  28196. i.floorPosition.clone().sub(this.model.position)
  28197. );
  28198. //this.model.adjustfloorLogoHeight();
  28199. this.model.floorLogos[1].material.opacity = 0; //uniforms.opacity.value = 0;
  28200. this.model.floorLogos[1].visible = true;
  28201. this.model.changefloorLogoOpa({ index: 1, opa: 1, dur: 250 }); //this.model.floorLogoShow(1,250);
  28202. }
  28203. //=======================================
  28204. this.nextPano = i;
  28205. let beginTran = () => {
  28206. aimQua &&
  28207. y.start(
  28208. function (e) {
  28209. S.copy(b),
  28210. v.quaternion(S, aimQua)(e),
  28211. M.copy(d.FORWARD)
  28212. .applyQuaternion(S)
  28213. .add(
  28214. this.cameraControls.activeControl.camera.position
  28215. ),
  28216. this.cameraControls.activeControl.lookAt(M);
  28217. }.bind(this),
  28218. I,
  28219. null,
  28220. 0,
  28221. A[f.transition.movementEasing],
  28222. null,
  28223. V.LookTransition
  28224. );
  28225. var B = c ? null : A[f.transition.movementEasing];
  28226. y.start(
  28227. v.uniform(this.model.skybox, "progress", 1),
  28228. I,
  28229. null,
  28230. 0,
  28231. A[f.transition.blendEasing],
  28232. "skyFly",
  28233. V.FlyToPano
  28234. ),
  28235. y.start(
  28236. v.allUniforms(this.model.chunks, "progress", 1),
  28237. I,
  28238. null,
  28239. 0,
  28240. A[f.transition.blendEasing],
  28241. "chunkFly",
  28242. V.FlyToPano
  28243. ),
  28244. y.start(
  28245. v.vector(
  28246. this.cameraControls.cameras[u.PANORAMA].position,
  28247. i.position
  28248. ),
  28249. I,
  28250. function (e) {
  28251. (this.flying = !1),
  28252. this.currentPano !== i && this.currentPano.exit(),
  28253. i.enter(),
  28254. (this.currentPano = i),
  28255. (this.nextPano = null),
  28256. this.path.placeCpm(),
  28257. this.path.fadeOutCpm(f.path.fadeOutTime),
  28258. this.spider.draw(),
  28259. this.emit(w.FlyingEnded, i.position, L, i, D),
  28260. this.updateMarkerVisi(), //add
  28261. C(e);
  28262. //add:
  28263. if (this.mode == "panorama") {
  28264. if (this.model.floorLogos) {
  28265. this.model.floorLogos[0].position.copy(
  28266. this.model.floorLogos[1].position
  28267. );
  28268. //this.model.adjustfloorLogoHeight()
  28269. this.model.changefloorLogoOpa({
  28270. index: 0,
  28271. opa: 1,
  28272. dur: 0,
  28273. }); //this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  28274. this.model.floorLogos[1].visible = false;
  28275. }
  28276. this.model.fadePanoMarkers(); //add
  28277. Hot.updateVisibles([this.currentPano]); //add
  28278. }
  28279. }.bind(this),
  28280. 0,
  28281. B,
  28282. "camFly",
  28283. V.FlyToPano
  28284. );
  28285. };
  28286. if (
  28287. !this.model.supportsTiles &&
  28288. i.getSkyboxTexture().image[0].width >
  28289. 1024 /* || this.qualityManager.getMaxZoomClass() == '4k' */
  28290. ) {
  28291. setTimeout(() => {
  28292. beginTran();
  28293. }, 50); //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  28294. } else {
  28295. beginTran();
  28296. }
  28297. }
  28298. }),
  28299. (n.prototype.warpToPano = function (o = {}) {});
  28300. n.prototype.blackToPano = function (o = {}) {
  28301. //add 瞬间过渡
  28302. //o.panoId = "8bc9156b288d48459e4e0f74d7051ef1"
  28303. if (this.flying || this.isWarping()) return;
  28304. let pano = o.pano || this.model.panos.index[o.panoId];
  28305. if (this.mode !== u.PANORAMA) {
  28306. var m;
  28307. void this.flyToNewMode({
  28308. mode: u.PANORAMA,
  28309. pano,
  28310. duration: o.duration,
  28311. quaternion: o.quaternion,
  28312. //callback: t
  28313. });
  28314. }
  28315. let oldPos = this.position.clone();
  28316. let oldPano = this.currentPano;
  28317. this.path.warpDestPano = pano;
  28318. var retry = () => {
  28319. (this.waitingToWarp = !1), this.blackToPano(o);
  28320. };
  28321. if (
  28322. this.checkAndWaitForPanoLoad(
  28323. pano,
  28324. "high",
  28325. "low",
  28326. this.basePanoSize,
  28327. retry
  28328. )
  28329. )
  28330. return void (this.waitingToWarp = !0);
  28331. this.emit("pano.chosen", oldPano, pano);
  28332. this.flying = true;
  28333. this.nextPano = pano; //提前加载高清图片
  28334. this.path.warpDestHeroLoc = {
  28335. panoId: o.panoId,
  28336. position: pano.position,
  28337. quaternion: o.quaternion || this.quaternion.clone(),
  28338. };
  28339. this.path.warpTravel_BLACK(null, 1500, 1, () => {
  28340. pano != this.currentPano && this.currentPano.exit();
  28341. pano.enter();
  28342. this.currentPano = pano;
  28343. this.emit("flying.ended", pano.position, oldPos, pano, oldPano);
  28344. this.flying = false;
  28345. this.nextPano = null;
  28346. this.updateMarkerVisi(); //add
  28347. });
  28348. };
  28349. window._transitionPosId = 9999;
  28350. n.prototype.transitionPos = function (o = {}) {
  28351. //渐变overlay和热点的位置
  28352. y.cancelById(_transitionPosId);
  28353. var begin = function (object, pos, qua, scale) {
  28354. if (pos) {
  28355. if (!same(object.position, pos, 0.01)) {
  28356. y.start(
  28357. v.vector(object.position, pos),
  28358. o.dur,
  28359. (e) => {},
  28360. 0,
  28361. A[f.transition.movementEasing],
  28362. "transitionPos",
  28363. _transitionPosId
  28364. );
  28365. }
  28366. if (qua && !same(object.quaternion, qua, 1e-6)) {
  28367. y.start(
  28368. v.quaternion(object.quaternion, qua),
  28369. o.dur,
  28370. (e) => {},
  28371. 0,
  28372. A[f.transition.movementEasing],
  28373. "transitionPos",
  28374. _transitionPosId
  28375. );
  28376. }
  28377. if (scale && !same(object.scale, scale, 0.001)) {
  28378. y.start(
  28379. v.vector(object.scale, scale),
  28380. o.dur,
  28381. (e) => {},
  28382. 0,
  28383. A[f.transition.movementEasing],
  28384. "transitionPos",
  28385. _transitionPosId
  28386. );
  28387. }
  28388. }
  28389. };
  28390. var same = function (vec1, vec2, diff) {
  28391. var s =
  28392. Math.abs(vec1.x - vec2.x) < diff &&
  28393. Math.abs(vec1.y - vec2.y) < diff &&
  28394. Math.abs(vec1.z - vec2.z) < diff;
  28395. if (s && vec1.w) s = Math.abs(vec1.w - vec2.w) < diff;
  28396. return s;
  28397. };
  28398. var sid = o.pano != void 0 ? o.pano.id : "outside";
  28399. for (let i in this.model.hots) {
  28400. //是否判断visible?
  28401. var hot = this.model.hots[i];
  28402. var panoData = hot.info.transformAtPanos[sid];
  28403. var useCustom = !panoData;
  28404. //if(hot.usingTransformData || !useCustom){
  28405. var pos = useCustom ? hot.info.position : panoData.pos;
  28406. begin(hot, pos /* , qua */);
  28407. //}
  28408. }
  28409. };
  28410. window._tranOutsideFocus = 4399;
  28411. n.prototype.focusPoint = function (o = {}) {
  28412. //当在外时,聚焦相机到这一点
  28413. console.log("focusPoint");
  28414. if (this.mode == "floorplan") {
  28415. var modelSize = o.modelSize || new THREE.Vector3(8, 8, 8); //可视范围
  28416. var control = this.cameraControls.controls.floorplan;
  28417. var absoluteScale = control.getDefaultAbsoluteScale(modelSize);
  28418. var currentScale = control.absoluteScale;
  28419. var currentTarget = control.target.clone();
  28420. y.cancelById(window._tranOutsideFocus, true);
  28421. y.start(
  28422. function (progress) {
  28423. control.absoluteScale =
  28424. absoluteScale * progress + currentScale * (1 - progress);
  28425. control.target = o.aim
  28426. .clone()
  28427. .multiplyScalar(progress)
  28428. .add(currentTarget.clone().multiplyScalar(1 - progress));
  28429. control.camera.position.copy(
  28430. control.target.clone().add(control.offset)
  28431. ); //维持角度
  28432. }.bind(this),
  28433. o.dur || 600,
  28434. null /* cancelFuc */,
  28435. 0,
  28436. A[f.transition.movementEasing],
  28437. "outsideFocus",
  28438. window._tranOutsideFocus,
  28439. null /* cancelFuc */
  28440. );
  28441. } else if (player.mode == "dollhouse") {
  28442. var control = player.cameraControls.controls.dollhouse;
  28443. var radius = o.radius || 8;
  28444. var currentTarget = control.target.clone();
  28445. var dir = control.offset.clone().normalize();
  28446. var currentRadius = control.offset.length();
  28447. y.cancelById(window._tranOutsideFocus, true);
  28448. y.start(
  28449. function (progress) {
  28450. control.target = o.aim
  28451. .clone()
  28452. .multiplyScalar(progress)
  28453. .add(currentTarget.clone().multiplyScalar(1 - progress));
  28454. let radius_ =
  28455. radius * progress + currentRadius * (1 - progress);
  28456. control.camera.position.copy(
  28457. control.target
  28458. .clone()
  28459. .add(dir.clone().multiplyScalar(radius_))
  28460. );
  28461. }.bind(this),
  28462. o.dur || 600,
  28463. null /* cancelFuc */,
  28464. 0,
  28465. A[f.transition.movementEasing],
  28466. "outsideFocus",
  28467. window._tranOutsideFocus,
  28468. null /* cancelFuc */
  28469. );
  28470. } else if (this.mode == "panorama") {
  28471. this.flyToPano({
  28472. lookAtPoint: o.aim.clone(),
  28473. pano: this.currentPano,
  28474. aimDuration: o.dur || 600,
  28475. });
  28476. }
  28477. };
  28478. /*
  28479. 切换到某个模式后再执行函数
  28480. */
  28481. n.prototype.FlyToMode = function (mode, f1, duration) {
  28482. var f2;
  28483. if (this.mode == mode) {
  28484. f1 && f1();
  28485. } else {
  28486. f2 = f1;
  28487. if (
  28488. this.mode == "transitioning" &&
  28489. this.modeTran.split("-")[1] != mode
  28490. ) {
  28491. //正飞向其他模式,就要先飞完再飞进来然后执行
  28492. this.afterCModeFuc = function () {
  28493. /* objects.gui.modeChange[mode](null, {
  28494. fuc: f2 这个写法会使得先添加的回调fuc取代之后添加的afterCModeFuc,所以统一改为afterCModeFuc
  28495. }); */
  28496. this.afterCModeFuc = f2;
  28497. this.flyToNewMode({
  28498. mode: mode,
  28499. pano: mode == "panorama" && this.currentPano,
  28500. //callback : f2
  28501. });
  28502. //这个fuc在trainsitioning状态下传入是无效的,所以后面得用afterCModeFuc。但是执行完afterCModeFuc,afterCModeFuc会变为null,所以里面得用fuc。。orz
  28503. }.bind(this);
  28504. } else {
  28505. if (this.afterCModeFuc)
  28506. console.log(
  28507. "已经有afterCModeFuc了!!!!!!!!!!!!!!!"
  28508. );
  28509. this.afterCModeFuc = f2; //飞入后执行
  28510. try {
  28511. //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  28512. this.flyToNewMode({
  28513. mode: mode,
  28514. pano: mode == "panorama" && this.currentPano,
  28515. duration: duration,
  28516. });
  28517. } catch (e) {
  28518. console.log("FlyToMode遇到问题?");
  28519. }
  28520. }
  28521. }
  28522. };
  28523. (n.prototype.fastForwardActivePanoFlight = function (e) {
  28524. e = e || (f.transition.fastForwardFactor / 10) * 4 + 1;
  28525. y.adjustSpeed(V.FlyToPano, e);
  28526. y.adjustSpeed(V.LookTransition, e);
  28527. }),
  28528. (n.prototype.flyToPanoClosestToMouse = function () {
  28529. if (
  28530. (Date.now() - this.mouseLastMoveTime > 50 &&
  28531. ((this.intersect = this.getMouseIntersect()),
  28532. this.intersect && this.updateClosestPano(this.intersect)),
  28533. this.closestPano)
  28534. )
  28535. return this.flyToPano({
  28536. pano: this.closestPano,
  28537. });
  28538. var e = this.getMouseDirection();
  28539. this.flyDirection(e) ||
  28540. this.flyToPano({
  28541. pano: this.currentPano,
  28542. });
  28543. }),
  28544. (n.prototype.flyLocalDirection = function (e) {
  28545. var t = this.getDirection(e),
  28546. i = 1 === e.z ? 0.4 : 0.75,
  28547. n = 1 === Math.abs(e.x);
  28548. return this.flyDirection(t, i, n);
  28549. }),
  28550. (n.prototype.flyDirection = function (e, t, i) {
  28551. Hot.closePopup(); //xzw add
  28552. var n = $.Deferred();
  28553. this.history.invalidate();
  28554. var r = this.closestPanoInDirection(e, t, i);
  28555. return (
  28556. r
  28557. ? this.flyToPano(
  28558. {
  28559. pano: r,
  28560. },
  28561. n.resolve.bind(n, !0)
  28562. )
  28563. : (this.bump(e), n.resolve(!1)),
  28564. n.promise()
  28565. );
  28566. }),
  28567. (n.prototype.closestPanoInDirection = function (e, t, i) {
  28568. return this.rankedPanoInDirection(0, e, t, i);
  28569. }),
  28570. (n.prototype.rankedPanoInDirection = (function () {
  28571. var e = {
  28572. pano: null,
  28573. candidates: [],
  28574. };
  28575. return function (t, i, n, r) {
  28576. t || (t = 0), (n = void 0 !== n ? n : 0.75);
  28577. var o = r ? "angle" : "direction";
  28578. return (
  28579. this.model.panos.findRankedByScore(
  28580. t,
  28581. [
  28582. s.filters.isPanoAligned(),
  28583. s.filters.not(this.currentPano),
  28584. s.filters.isNeighbourPanoTo(this.currentPano),
  28585. s.filters.inPanoDirection(this.position, i, n),
  28586. ],
  28587. [
  28588. s.scoreFunctions.distanceSquared(this.currentPano),
  28589. s.scoreFunctions[o](this.position, i),
  28590. ],
  28591. e
  28592. ),
  28593. (this.cachedPanoCandidates = e.candidates),
  28594. e.pano
  28595. );
  28596. };
  28597. })()),
  28598. (n.prototype.bump = function (e) {
  28599. if (
  28600. this.mode === u.PANORAMA &&
  28601. !this.flying &&
  28602. !this.isWarping()
  28603. ) {
  28604. var t,
  28605. i,
  28606. n,
  28607. r = f.transition,
  28608. o =
  28609. (r.flytimeMaxDistanceThreshold *
  28610. r.flytimeDistanceMultiplier +
  28611. r.flyTime) /
  28612. 8,
  28613. a = this.camera.getWorldDirection().dot(e),
  28614. s = Math.abs(a) > 0.5;
  28615. if (s)
  28616. (t = function () {
  28617. y.start(
  28618. v.property(
  28619. this.cameraControls.cameras[u.PANORAMA],
  28620. "zoom",
  28621. a > 0 ? 1.04 : 0.96
  28622. ),
  28623. o,
  28624. i,
  28625. 0,
  28626. A.easeInOutSine,
  28627. "bumpZStart"
  28628. );
  28629. }.bind(this)),
  28630. (i = function () {
  28631. y.start(
  28632. v.property(
  28633. this.cameraControls.cameras[u.PANORAMA],
  28634. "zoom",
  28635. 1
  28636. ),
  28637. 5 * o,
  28638. n,
  28639. 0,
  28640. A.easeInOutSine,
  28641. "bumpZRelax"
  28642. );
  28643. }.bind(this));
  28644. else {
  28645. var l = this.camera.position.clone(),
  28646. c = e.clone();
  28647. this.raycaster.set(l, c);
  28648. var h = this.model.floors.reduce(function (e, t) {
  28649. return e.concat(t.collider.children);
  28650. }, []),
  28651. d = this.raycaster.intersectObjects(h),
  28652. p = d.length > 0 ? d[0].distance / 25 : 0.04,
  28653. g = l.clone().add(c.multiplyScalar(p));
  28654. (t = function () {
  28655. y.start(
  28656. v.vector(
  28657. this.cameraControls.cameras[u.PANORAMA].position,
  28658. g
  28659. ),
  28660. o,
  28661. i,
  28662. 0,
  28663. A.easeInOutSine,
  28664. "bumpTStart"
  28665. );
  28666. }.bind(this)),
  28667. (i = function () {
  28668. y.start(
  28669. v.vector(
  28670. this.cameraControls.cameras[u.PANORAMA].position,
  28671. l
  28672. ),
  28673. 5 * o,
  28674. n,
  28675. 0,
  28676. A.easeInOutSine,
  28677. "bumpTRelax"
  28678. );
  28679. }.bind(this));
  28680. }
  28681. (n = function () {
  28682. this.flying = !1;
  28683. }.bind(this)),
  28684. (this.flying = !0),
  28685. t();
  28686. }
  28687. }),
  28688. (n.prototype.changeFloor = function (e) {
  28689. if (!this.is360View(this.mode, this.currentPano))
  28690. if (this.mode === u.PANORAMA) {
  28691. var t = this.history.reversePano(e);
  28692. t && t.isAligned()
  28693. ? this.flyToPano({
  28694. pano: t,
  28695. })
  28696. : this.changeFloorByScore(e);
  28697. } else
  28698. this.model.setFloor(
  28699. this.model.nextFloor(e) || this.model.currentFloor
  28700. );
  28701. }),
  28702. (n.prototype.changeFloorByScore = (function () {
  28703. var e = {
  28704. pano: null,
  28705. candidates: [],
  28706. };
  28707. return function (t) {
  28708. var i = this.model.nextFloor(t);
  28709. return i
  28710. ? (this.model.panos.lowestByScore(
  28711. [s.filters.atFloor(i), s.filters.isPanoAligned()],
  28712. [
  28713. s.scoreFunctions.distance(this.currentPano),
  28714. s.scoreFunctions.direction(
  28715. this.position,
  28716. new r.Vector3(0, t, 0)
  28717. ),
  28718. s.scoreFunctions.penalizeHeightDifferenceUnder(
  28719. this.position,
  28720. 0.5
  28721. ),
  28722. ],
  28723. e
  28724. ),
  28725. void (e.pano
  28726. ? ((this.cachedPanoCandidates = e.candidates),
  28727. this.history.push(t, this.currentPano),
  28728. this.flyToPano({
  28729. pano: e.pano,
  28730. }))
  28731. : F.warn(
  28732. "No pano found on selected floor, not moving there."
  28733. )))
  28734. : void F.debug(
  28735. "player.changeFloor(" + t + "): no such floor"
  28736. );
  28737. };
  28738. })()),
  28739. (n.prototype.gotoFloor = function (e) {
  28740. var t = e - this.model.currentFloor.floorIndex;
  28741. this.changeFloor(t);
  28742. }),
  28743. (n.prototype.getDirection = function (e) {
  28744. return (
  28745. (e = e ? e : new r.Vector3().copy(d.FORWARD)),
  28746. e.applyQuaternion(this.camera.quaternion)
  28747. );
  28748. }),
  28749. (n.prototype.flyToSameMode = function (e, t, i, n, o) {
  28750. if (((o = o || $.Deferred()), this.mode === u.TRANSITIONING))
  28751. return (
  28752. F.warn("should not be transitioning here"),
  28753. n && n(!1),
  28754. o.reject().promise()
  28755. );
  28756. var a = i || !1,
  28757. s = i ? i.position : this.position,
  28758. l = this.position.clone(),
  28759. c = this.currentPano;
  28760. if (
  28761. (F.debug("New pose in mode " + this.mode),
  28762. !e ||
  28763. ((retryCallback = function () {
  28764. N.delayOneFrame(
  28765. function () {
  28766. this.flyToSameMode(e, t, i, n, o);
  28767. }.bind(this)
  28768. );
  28769. }.bind(this)),
  28770. !this.checkAndWaitForPanoLoad(
  28771. e,
  28772. "high",
  28773. "low",
  28774. this.basePanoSize,
  28775. retryCallback
  28776. )))
  28777. ) {
  28778. var h = function () {
  28779. this.emit(w.FlyingEnded, s, l, e, c), n && n(!0);
  28780. }.bind(this),
  28781. d = f[this.mode],
  28782. p = void 0 !== t ? t : d.transitionTime,
  28783. g = new r.Vector3(),
  28784. C = new r.Vector3();
  28785. if (
  28786. (this.emit(w.FlyingStarted, s, l, e, c),
  28787. this.mode === u.PANORAMA)
  28788. )
  28789. F.warn("we should not be here for panorama views");
  28790. else if (this.mode === u.DOLLHOUSE)
  28791. if (a) {
  28792. var I = new r.Vector3(0, 1, 0);
  28793. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(
  28794. 1,
  28795. !0
  28796. ),
  28797. this.model.warpDestFloors(i.floorVisibility),
  28798. C.copy(i.position);
  28799. var E = new r.Vector3(0, 0, -1).applyQuaternion(
  28800. i.quaternion
  28801. ),
  28802. b = new r.Raycaster(C.clone(), E.clone(), 0, 1 / 0),
  28803. _ = b.intersectObjects(this.model.colliders),
  28804. T = 3;
  28805. _.length
  28806. ? (g.copy(_[0].point), (T = 0.75 * C.distanceTo(g)))
  28807. : (g.copy(E).multiplyScalar(3).add(C),
  28808. F.debug(
  28809. "Tried to restore dollhouse mode that did not intersect...",
  28810. i.position,
  28811. i.quaternion
  28812. ));
  28813. var x = new r.Matrix4().lookAt(C, g, I),
  28814. S = new r.Euler().setFromRotationMatrix(x, f.warp.eOrder),
  28815. M = g.distanceTo(C),
  28816. R = new r.Matrix4().lookAt(
  28817. this.cameraControls.cameras[u.DOLLHOUSE].position,
  28818. this.cameraControls.controls[u.DOLLHOUSE].target,
  28819. I
  28820. ),
  28821. P = new r.Euler().setFromRotationMatrix(R, f.warp.eOrder),
  28822. O = this.cameraControls.cameras[
  28823. u.DOLLHOUSE
  28824. ].position.distanceTo(
  28825. this.cameraControls.controls[u.DOLLHOUSE].target
  28826. );
  28827. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(
  28828. Math.min(O, T),
  28829. !0
  28830. );
  28831. var L = new r.Euler(
  28832. S.x - P.x,
  28833. S.y - P.y,
  28834. S.z - P.z,
  28835. f.warp.eOrder
  28836. );
  28837. (L.y =
  28838. L.y > Math.PI
  28839. ? (L.y -= 2 * Math.PI)
  28840. : L.y < -Math.PI
  28841. ? (L.y += 2 * Math.PI)
  28842. : L.y),
  28843. (this.path.burnsDir = Math.sign(L.y));
  28844. var D = new r.Euler(0, 0, 0, f.warp.eOrder),
  28845. B = new r.Vector3();
  28846. y.start(
  28847. v.vector(
  28848. this.cameraControls.controls[u.DOLLHOUSE].target,
  28849. g
  28850. ),
  28851. p,
  28852. null,
  28853. f.flydown.movementDelay,
  28854. A[f.flydown.movementEasing],
  28855. null,
  28856. V.FlyToSameMode
  28857. ),
  28858. y.start(
  28859. function (e, t) {
  28860. (D.x = P.x + e * L.x),
  28861. (D.y = P.y + e * L.y),
  28862. (D.z = P.z + e * L.z);
  28863. var i = O + e * (M - O);
  28864. B.set(0, 0, i)
  28865. .applyEuler(D)
  28866. .add(
  28867. this.cameraControls.controls[u.DOLLHOUSE].target
  28868. ),
  28869. this.cameraControls.cameras[u.DOLLHOUSE].position
  28870. .copy(B)
  28871. .add(this.model.position);
  28872. }.bind(this),
  28873. p,
  28874. null,
  28875. f.flydown.movementDelay,
  28876. A[f.flydown.movementEasing],
  28877. null,
  28878. V.FlyToSameMode
  28879. ),
  28880. y.start(
  28881. function (e, t) {
  28882. this.cameraControls.controls[u.DOLLHOUSE].update(),
  28883. this.quaternion.copy(
  28884. this.cameraControls.cameras[u.DOLLHOUSE]
  28885. .quaternion
  28886. ),
  28887. this.position.copy(
  28888. this.cameraControls.cameras[u.DOLLHOUSE].position
  28889. );
  28890. }.bind(this),
  28891. p,
  28892. null,
  28893. f.flydown.movementDelay,
  28894. A[f.flydown.movementEasing],
  28895. null,
  28896. V.FlyToSameMode
  28897. );
  28898. } else
  28899. F.warn(
  28900. "invalid warp destination in flyToSameMode()? ignore it then"
  28901. );
  28902. else if (
  28903. (this.path.placeCpm(),
  28904. this.path.fadeInCpm(f.path.fadeInTime),
  28905. i)
  28906. ) {
  28907. this.model.warpDestFloors(i.floorVisibility);
  28908. var U = this.cameraControls.cameras[u.FLOORPLAN],
  28909. k = this.cameraControls.controls[u.FLOORPLAN],
  28910. H = k.target.clone(),
  28911. G = i.position.clone().sub(H),
  28912. z = U.position.clone().sub(k.target),
  28913. W = z.length(),
  28914. j = new r.Vector3(-1, 0, 0)
  28915. .applyQuaternion(i.quaternion)
  28916. .normalize(),
  28917. Y = Math.atan2(k.offset.x, k.offset.z),
  28918. X = Math.atan2(j.x, j.z),
  28919. Z = k.absoluteScale,
  28920. q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  28921. y.start(
  28922. function (e, t) {
  28923. k.target.copy(G).multiplyScalar(e).add(H);
  28924. var i = Y + (X - Y) * e;
  28925. (k.offset.x = W * Math.sin(i)),
  28926. (k.offset.z = W * Math.cos(i)),
  28927. U.position.copy(k.target).add(k.offset),
  28928. (k.absoluteScale = Z + e * (q - Z)),
  28929. k.update(),
  28930. this.quaternion.copy(U.quaternion),
  28931. this.position.copy(U.position),
  28932. this.target.copy(k.target),
  28933. this.camera.projectionMatrix.copy(U.projectionMatrix);
  28934. }.bind(this),
  28935. p,
  28936. null,
  28937. 0,
  28938. A[f.flydown.movementEasing],
  28939. null,
  28940. V.FlyToSameMode
  28941. );
  28942. } else F.info("flyToSameMode() funny floorplan view? skipping");
  28943. return (
  28944. y.setTimeout(
  28945. function (e) {
  28946. (this.mode = e), h(), o.resolve(!0);
  28947. }.bind(this, this.mode),
  28948. p,
  28949. V.FlyToSameMode
  28950. ),
  28951. (this.mode = u.TRANSITIONING),
  28952. o.promise()
  28953. );
  28954. }
  28955. }),
  28956. (n.prototype.flyToNewMode = function (e, t) {
  28957. Hot.closePopup(); //xzw add
  28958. e = e || {};
  28959. var i = e.mode,
  28960. n = e.pano,
  28961. o = e.duration,
  28962. a = e.warpDest,
  28963. s = e.callback,
  28964. l = e.force,
  28965. c = e.quaternion;
  28966. if (((t = t || $.Deferred()), this.isWarping()))
  28967. return (
  28968. F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  28969. s && s(!1),
  28970. t
  28971. .reject("Cannot change mode during tour transition")
  28972. .promise()
  28973. );
  28974. if (this.mode === u.TRANSITIONING)
  28975. return (
  28976. s && s(!1),
  28977. t
  28978. .reject("Cannot change mode during mode transition")
  28979. .promise()
  28980. );
  28981. if (i === this.mode)
  28982. return l
  28983. ? (this.flyToSameMode(n, o, a, s)
  28984. .done(t.resolve.bind(t))
  28985. .fail(t.reject.bind(t)),
  28986. t.promise())
  28987. : (s && s(!1),
  28988. t.reject("Already in " + i + " mode").promise());
  28989. var h = a || !1;
  28990. F.debug("Switching mode to " + i);
  28991. var d = function () {
  28992. N.delayOneFrame(
  28993. function () {
  28994. this.flyToNewMode(e, t);
  28995. }.bind(this)
  28996. );
  28997. }.bind(this);
  28998. if (
  28999. n &&
  29000. this.checkAndWaitForPanoLoad(
  29001. n,
  29002. "low",
  29003. "low",
  29004. this.basePanoSize,
  29005. d
  29006. )
  29007. )
  29008. return t.promise();
  29009. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  29010. return (
  29011. F.info(
  29012. "Waiting for model textures to be loaded before going out to dollhouse"
  29013. ),
  29014. this.model.waitForLoad(
  29015. this.model,
  29016. function () {
  29017. return this.model.meshTexturesLoaded;
  29018. }.bind(this)
  29019. ),
  29020. this.model.loadMeshTextures().done(d),
  29021. t.promise()
  29022. );
  29023. this.history.invalidate(), this.updateLastView();
  29024. var p = this.mode,
  29025. C = this.cameraControls.cameras[i];
  29026. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  29027. var I = void 0 !== o ? o : e.transitionTime;
  29028. this.emit(w.ModeChanging, p, i, n, I),
  29029. n && (this.currentPano = n),
  29030. this.switchCameraMode(i, c),
  29031. y.cancelById(V.LookTransition);
  29032. //before fly---------------------
  29033. this.modeTran = p + "-" + i; //add
  29034. if (this.mode == "panorama") {
  29035. if (this.model.floorLogos) {
  29036. this.model.floorLogos[0].visible = false;
  29037. this.model.floorLogos[1].visible = false;
  29038. }
  29039. }
  29040. if (i == "panorama") {
  29041. this.transitionPos({ type: "beforeFlyIn", pano: n, dur: I }); //add
  29042. } else {
  29043. this.transitionPos({ type: "beforeFlyOut", dur: I / 2 }); //add
  29044. }
  29045. window.bus.dispatchEvent({ type: "playerAndModelReady" });
  29046. this.ready = true;
  29047. //------------------------------------
  29048. var beginTran = () => {
  29049. var _ = new r.Vector3().copy(this.position);
  29050. if (i === u.PANORAMA) {
  29051. this.emit(w.PanoChosen, n, n),
  29052. setTimeout(
  29053. function () {
  29054. n.floor.enter(i);
  29055. }.bind(this),
  29056. I / 2
  29057. ),
  29058. this.path.fadeOutCpm(f.path.fadeOutTime);
  29059. if (this.model.floorLogos) {
  29060. this.model.floorLogos[0].position.copy(
  29061. n.floorPosition.clone().sub(this.model.position)
  29062. ); //改
  29063. this.model.floorLogos[1].position.copy(
  29064. this.model.floorLogos[0].position
  29065. ); //for floorIcon position
  29066. }
  29067. } else if (i === u.DOLLHOUSE) {
  29068. if (
  29069. (h && (this.model.stayPut = !0),
  29070. a
  29071. ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(
  29072. 1,
  29073. !0
  29074. ),
  29075. this.model.warpDestFloors(a.floorVisibility))
  29076. : this.model.toggleAllFloors(!0),
  29077. this.path.placeCpm(),
  29078. this.path.fadeInCpm(f.path.fadeInTime),
  29079. h)
  29080. ) {
  29081. var T = new r.Vector3(
  29082. this.model.center.x,
  29083. 0,
  29084. this.model.center.z
  29085. );
  29086. _.set(15, 10, 15);
  29087. var M = new r.Vector3(0, 0, -1).applyQuaternion(
  29088. a.quaternion
  29089. ),
  29090. R = new r.Raycaster(
  29091. a.position.clone(),
  29092. M.clone(),
  29093. 0,
  29094. 1 / 0
  29095. ),
  29096. P = R.intersectObjects([this.sceneIntersectionPlane]);
  29097. P.length
  29098. ? (T.copy(P[0].point),
  29099. _.copy(a.position),
  29100. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(
  29101. 0.75 * _.distanceTo(T),
  29102. !0
  29103. ))
  29104. : (F.warn(
  29105. "Tried to restore dollhouse mode that did not intersect...",
  29106. a.position,
  29107. a.quaternion
  29108. ),
  29109. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(
  29110. 3,
  29111. !0
  29112. )),
  29113. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  29114. _.add(this.model.position),
  29115. C.position.copy(_),
  29116. this.cameraControls.controls[u.DOLLHOUSE].update();
  29117. }
  29118. } else if (
  29119. (this.path.placeCpm(),
  29120. this.path.fadeInCpm(f.path.fadeInTime),
  29121. a)
  29122. ) {
  29123. this.model.warpDestFloors(a.floorVisibility);
  29124. var O = this.cameraControls.cameras[u.FLOORPLAN],
  29125. L = this.cameraControls.controls[u.FLOORPLAN],
  29126. D = O.position.clone().sub(L.target),
  29127. B = new r.Vector3(-1, 0, 0)
  29128. .applyQuaternion(a.quaternion)
  29129. .normalize(),
  29130. U = Math.atan2(B.x, B.z);
  29131. L.target.copy(a.position);
  29132. var k = D.length();
  29133. (L.offset.x = k * Math.sin(U)),
  29134. (L.offset.y = 0),
  29135. (L.offset.z = k * Math.cos(U)),
  29136. O.position.copy(L.target).add(L.offset);
  29137. L.target.clone().sub(C.position);
  29138. C.quaternion.copy(a.quaternion),
  29139. (L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom)),
  29140. (L.absoluteScale = L.currentScale),
  29141. L.update();
  29142. } else this.model.currentFloor.enter(i);
  29143. var H = this.currentPano,
  29144. G = this.position.clone();
  29145. this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  29146. (this.flying = !0),
  29147. this.isOutsideMode(i) && this.is360View(p, H)
  29148. ? (h ||
  29149. i !== u.DOLLHOUSE ||
  29150. (C.position.set(15, 10, 15),
  29151. C.controls.target.set(
  29152. this.model.center.x,
  29153. 0,
  29154. this.model.center.z
  29155. ),
  29156. C.controls.update()),
  29157. (e.blackoutStyle = S.FADEIN),
  29158. (I = f.show360Views.transitionTime),
  29159. this.fade360View(I, C, e))
  29160. : this.isOutsideMode(p) && this.is360View(i, n)
  29161. ? (h && this.switchCameraMode(i, h.quaternion),
  29162. (this.mode = i),
  29163. this.path && this.path.popOutCpm(),
  29164. (e.blackoutStyle = S.END),
  29165. (I = f.show360Views.transitionTime),
  29166. this.fade360View(I, C, e))
  29167. : (y.start(
  29168. v.property(this.model, "alpha", e.modelAlpha, null),
  29169. I * e.modelAlphaLength,
  29170. null,
  29171. e.modelAlphaDelay,
  29172. null,
  29173. V.FlyToNewMode
  29174. ),
  29175. y.start(
  29176. v.vector(this.position, C.position),
  29177. I,
  29178. null,
  29179. f.flydown.movementDelay,
  29180. A[f.flydown.movementEasing],
  29181. null,
  29182. V.FlyToNewMode
  29183. ),
  29184. y.start(
  29185. v.quaternion(this.quaternion, C.quaternion),
  29186. I * e.rotationDuration,
  29187. null,
  29188. e.rotationDelay,
  29189. A[f.flydown.rotationEasing],
  29190. null,
  29191. V.FlyToNewMode
  29192. ),
  29193. y.start(
  29194. v.matrix4(
  29195. this.camera.projectionMatrix,
  29196. C.projectionMatrix
  29197. ),
  29198. I * e.cameraMatrixDuration,
  29199. null,
  29200. e.cameraMatrixDelay,
  29201. e.cameraMatrixEase,
  29202. null,
  29203. V.FlyToNewMode
  29204. ),
  29205. y.start(
  29206. v.uniform(
  29207. this.model.skybox,
  29208. "opacity",
  29209. e.skyboxOpacity
  29210. ),
  29211. I * e.skyboxOpacityLength,
  29212. null,
  29213. e.skyboxOpacityDelay,
  29214. null,
  29215. V.FlyToNewMode
  29216. ),
  29217. y.start(
  29218. v.property(
  29219. this.reticule.material.uniforms.opacity,
  29220. "value",
  29221. 0
  29222. ),
  29223. I,
  29224. null,
  29225. V.FlyToNewMode
  29226. )),
  29227. y.setTimeout(
  29228. function () {
  29229. (this.flying = !1),
  29230. p === u.PANORAMA && i !== u.PANORAMA
  29231. ? this.currentPano.exit()
  29232. : p !== u.PANORAMA &&
  29233. i === u.PANORAMA &&
  29234. (this.currentPano !== H && H.exit(),
  29235. this.currentPano.enter(),
  29236. this.path.placeCpm(),
  29237. this.path.fadeOutCpm(f.path.fadeOutTime),
  29238. this.spider.draw()),
  29239. p === u.DOLLHOUSE &&
  29240. this.cameraControls.controls[
  29241. u.DOLLHOUSE
  29242. ].resetRanges(),
  29243. (this.mode = i),
  29244. this.emit(w.FlyingEnded, _, G, this.currentPano, H);
  29245. //add:
  29246. this.updateMarkerVisi();
  29247. //(this.mode == u.PANORAMA) && this.updateHotVisible(),
  29248. this.mode == u.PANORAMA &&
  29249. this.model.floorLogos &&
  29250. (this.model.changefloorLogoOpa({
  29251. index: 0,
  29252. from: 0,
  29253. opa: 1,
  29254. dur: 150,
  29255. }), //this.model.floorLogoShow(0,150);
  29256. (this.model.floorLogos[0].visible = true));
  29257. if (this.afterCModeFuc) {
  29258. //手动加的函数
  29259. var cf = this.afterCModeFuc;
  29260. this.afterCModeFuc = null; //因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  29261. cf();
  29262. }
  29263. if (this.mode == u.PANORAMA) {
  29264. Hot.updateVisibles([this.currentPano]);
  29265. this.model.fadePanoMarkers();
  29266. } else {
  29267. Hot.updateVisibles(true);
  29268. this.model.hotGroup.children.forEach((overlay) => {
  29269. if (overlay.animateInfo) {
  29270. GifTexDeal.start(overlay.animation);
  29271. }
  29272. });
  29273. }
  29274. h && p !== u.PANORAMA && i === u.PANORAMA
  29275. ? this.startWarp(
  29276. b.Retain,
  29277. E.Retain,
  29278. x.BLACK,
  29279. null,
  29280. null,
  29281. s
  29282. )
  29283. : (s && s(), t.resolve());
  29284. }.bind(this),
  29285. I,
  29286. V.FlyToNewMode
  29287. );
  29288. };
  29289. if (
  29290. i == "panorama" &&
  29291. !this.model.supportsTiles &&
  29292. n.getSkyboxTexture().image[0].width > 1024
  29293. ) {
  29294. setTimeout(() => {
  29295. beginTran();
  29296. }, 16); //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  29297. } else {
  29298. beginTran();
  29299. }
  29300. this.mode = u.TRANSITIONING;
  29301. //p == "panorama" && this.updateHotVisible(),
  29302. return t.promise();
  29303. }),
  29304. (n.prototype.fade360View = function (e, t, i) {
  29305. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  29306. $(this.domElement).fadeOut(
  29307. 0.5 * e,
  29308. function () {
  29309. (this.model.skybox.material.uniforms.opacity.value =
  29310. i.skyboxOpacity),
  29311. (this.model.alpha = i.modelAlpha),
  29312. this.position.copy(t.position),
  29313. this.quaternion.copy(t.quaternion),
  29314. this.camera.projectionMatrix.copy(t.projectionMatrix),
  29315. $(this.domElement).fadeIn(0.5 * e);
  29316. }.bind(this)
  29317. );
  29318. }),
  29319. (n.prototype.findDefaultViews = function () {
  29320. this.findDefaultView(this.lastInsideView, !0),
  29321. this.findDefaultView(this.last360View, !1);
  29322. }),
  29323. (n.prototype.findDefaultView = function (e, t) {
  29324. var i,
  29325. n = this.model.heroLocations,
  29326. r = this.model.panos,
  29327. o = n.findIndex(function (e) {
  29328. if (e.cameraMode !== u.PANORAMA) return !1;
  29329. var i = r.get(e.panoId);
  29330. return i && i.isAligned() === t;
  29331. });
  29332. o >= 0
  29333. ? ((i = r.get(n[o].panoId)),
  29334. e.update({
  29335. cameraMode: u.PANORAMA,
  29336. pano: i,
  29337. position: n[o].position,
  29338. quaternion: n[o].quaternion,
  29339. }))
  29340. : ((o = r.list.findIndex(function (e) {
  29341. return e.isAligned() === t;
  29342. })),
  29343. o >= 0
  29344. ? ((i = r.list[o]),
  29345. e.update({
  29346. cameraMode: u.PANORAMA,
  29347. pano: i,
  29348. position: i.position,
  29349. }))
  29350. : F.warn(
  29351. "There are no",
  29352. t ? "inside" : "360º",
  29353. "views in this model"
  29354. ));
  29355. }),
  29356. (n.prototype.updateLastView = function () {
  29357. if (this.mode === u.PANORAMA) {
  29358. var e = this.currentPano.isAligned()
  29359. ? this.lastInsideView
  29360. : this.last360View;
  29361. e.update({
  29362. pano: this.currentPano,
  29363. position: this.position,
  29364. quaternion: this.quaternion,
  29365. });
  29366. }
  29367. }),
  29368. (n.prototype.goToLastView = function (e, t) {
  29369. var i = $.Deferred(),
  29370. n = i.resolve.bind(i),
  29371. r = i.reject.bind(i),
  29372. o = e ? this.lastInsideView : this.last360View;
  29373. return (
  29374. this.isInMode(u.PANORAMA) &&
  29375. this.currentPano.isAligned() !== e &&
  29376. this.updateLastView(),
  29377. this.isInMode(u.PANORAMA)
  29378. ? (this.path && this.path.popOutCpm(),
  29379. this.fadeToView(e, o, f.show360Views.transitionTime, t)
  29380. .done(n)
  29381. .fail(r))
  29382. : this.isOutsideMode() &&
  29383. this.flyToNewMode({
  29384. mode: o.cameraMode,
  29385. pano: o.pano,
  29386. quaternion: o.quaternion,
  29387. callback: t,
  29388. })
  29389. .done(n)
  29390. .fail(r),
  29391. i.promise()
  29392. );
  29393. }),
  29394. (n.prototype.fadeToView = function (e, t, i, n) {
  29395. var r = $.Deferred(),
  29396. o = r.resolve.bind(r),
  29397. a = r.reject.bind(r);
  29398. if (!t.isValid() || (t.cameraMode === u.PANORAMA && !t.pano))
  29399. return (
  29400. F.warn("Tried to fade to an illegal view", t.cameraMode),
  29401. a("Cannot go to illegal view"),
  29402. r.promise()
  29403. );
  29404. var s =
  29405. (f[t.cameraMode],
  29406. function () {
  29407. $(this.domElement).fadeIn(0.5 * i), n && n(), o();
  29408. }.bind(this)),
  29409. l = e ? S.FADEIN : S.END;
  29410. return (
  29411. this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  29412. $(this.domElement).fadeOut(
  29413. 0.5 * i,
  29414. function () {
  29415. this.model.fadePanoMarkers(
  29416. e ? f.panorama.markerOpacity : 0
  29417. ),
  29418. t.cameraMode === u.PANORAMA
  29419. ? this.flyToPano(
  29420. {
  29421. pano: t.pano,
  29422. lookAtPoint: d.FORWARD.clone()
  29423. .applyQuaternion(t.quaternion)
  29424. .add(t.pano.position),
  29425. duration: 0,
  29426. },
  29427. s
  29428. )
  29429. : this.flyToNewMode({
  29430. mode: t.cameraMode,
  29431. quaternion: t.quaternion,
  29432. duration: 0,
  29433. callback: s,
  29434. });
  29435. }.bind(this)
  29436. ),
  29437. r.promise()
  29438. );
  29439. }),
  29440. (n.prototype.startWarp = function (e, t, i, n, r, o) {
  29441. if (
  29442. (this.cameraControls.activeControl &&
  29443. (this.cameraControls.activeControl.enabled = !1),
  29444. this.flying)
  29445. )
  29446. return (
  29447. F.warn("Player.startWarp() -> Cannot warp when flying"),
  29448. o && o(),
  29449. !1
  29450. );
  29451. (null !== e && void 0 !== e) || (e = b.Show),
  29452. this.history.invalidate();
  29453. e !== b.Retain
  29454. ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK)
  29455. : (i = this.path.upcomingTransType);
  29456. var a =
  29457. this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  29458. return (
  29459. this.emit(w.WarpStarted, a, i, n, r),
  29460. (n = n || S.MIDDLE),
  29461. this.path.warpToPano(
  29462. i,
  29463. n,
  29464. r,
  29465. function () {
  29466. t === E.Slow
  29467. ? this.path.discardSlow()
  29468. : t === E.Standard && this.path.discardPathObject(),
  29469. this.emit(w.WarpEnded, i),
  29470. this.cameraControls.activeControl &&
  29471. (this.cameraControls.activeControl.enabled = !0),
  29472. o && o();
  29473. }.bind(this)
  29474. ),
  29475. e === b.Hide && this.path.discardPathObject(),
  29476. !0
  29477. );
  29478. }),
  29479. (n.prototype.warpToPanoById = function (e, t, i, n, r, o, a, s) {
  29480. return this.path.setWarpDestinationByPanoId(e, t)
  29481. ? this.startWarp(i, n, r, o, a, s)
  29482. : (F.warn(
  29483. "Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"
  29484. ),
  29485. s && s(),
  29486. !1);
  29487. }),
  29488. (n.prototype.warpToPanoByHeroIndex = function (
  29489. e,
  29490. t,
  29491. i,
  29492. n,
  29493. r,
  29494. o,
  29495. a
  29496. ) {
  29497. return this.path.setWarpDestinationByHeroIndex(e)
  29498. ? this.startWarp(t, i, n, r, o, a)
  29499. : (F.warn(
  29500. "Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"
  29501. ),
  29502. a && a(),
  29503. !1);
  29504. }),
  29505. (n.prototype.warpToPano = function (e, t, i, n, r, o, a, s) {
  29506. return this.warpToPanoById(e.id, t, i, n, r, o, a, s);
  29507. }),
  29508. (n.prototype.warpToNonPanoByHeroIndex = function (e, t) {
  29509. return this.path.setWarpDestinationByHeroIndex(e)
  29510. ? (this.path.warpToNonPano(t), !0)
  29511. : (F.warn(
  29512. "Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"
  29513. ),
  29514. t && t(),
  29515. !1);
  29516. }),
  29517. (n.prototype.aimTourCamera = function (e, t, i, n) {
  29518. return (
  29519. F.debug(
  29520. "player.aimTourCamera(" +
  29521. e +
  29522. ") calling warpToPanoByHeroIndex(" +
  29523. e +
  29524. ")"
  29525. ),
  29526. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  29527. );
  29528. }),
  29529. (n.prototype.showPathToHeroLocation = function (e) {
  29530. this.path.setWarpDestinationByHeroIndex(e) &&
  29531. this.path.brushToWarpPano(x.STD, x.BLACK);
  29532. }),
  29533. (n.prototype.tourInterlude = function (e, t) {
  29534. this.history.invalidate();
  29535. this.path.discardSlow();
  29536. //xzw:
  29537. var defaultRotTime = DATA.tourRotTime * 1000;
  29538. var timeEachItem =
  29539. (2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed)) * 200; //预估时间假设每个item飞的时间(如果距离远就少了)
  29540. var currentLocation = this.model.getHeroDescriptorByIndex(
  29541. this.director.currentItem
  29542. );
  29543. var currentLocation0 =
  29544. this.model.heroLocations[this.director.currentItem[0]];
  29545. //zeg 标注一下
  29546. //var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  29547. var rotTime;
  29548. if (
  29549. currentLocation.rotTime == void 0 ||
  29550. currentLocation.rotTime == ""
  29551. ) {
  29552. var restChildCount = currentLocation0.heroLocations
  29553. ? currentLocation0.heroLocations.length -
  29554. this.director.currentItem[1] -
  29555. 1
  29556. : 0;
  29557. var hasMusic =
  29558. currentLocation0 && currentLocation0.musicInfo.music;
  29559. if (hasMusic) {
  29560. var audioObj = SoundManager.list.find(
  29561. (e) => e.name == "tour"
  29562. );
  29563. var current = audioObj.audio.currentTime * 1e3; // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  29564. rotTime = currentLocation0.musicInfo.time - current;
  29565. if (restChildCount) {
  29566. //如果当前folder中还有剩下的item,平分一下时间
  29567. rotTime =
  29568. (rotTime - timeEachItem * restChildCount) /
  29569. (restChildCount + 1);
  29570. }
  29571. } else {
  29572. rotTime = defaultRotTime;
  29573. }
  29574. rotTime = Math.max(0, rotTime);
  29575. Log(
  29576. "rotTime " +
  29577. rotTime +
  29578. " at item " +
  29579. this.director.currentItem +
  29580. (hasMusic
  29581. ? ",musicCurrentTime:" +
  29582. current +
  29583. "音乐总长:" +
  29584. currentLocation0.musicInfo.time
  29585. : ""),
  29586. "#E8E"
  29587. );
  29588. } else {
  29589. rotTime = currentLocation.rotTime * 1000;
  29590. Log(
  29591. "rotTime " +
  29592. rotTime +
  29593. " at item " +
  29594. this.director.currentItem,
  29595. "#E8E"
  29596. );
  29597. }
  29598. this.path.waitNextStep(
  29599. e,
  29600. function () {
  29601. t && t();
  29602. }.bind(this),
  29603. rotTime
  29604. );
  29605. }),
  29606. (n.prototype.stopInterlude = function () {
  29607. this.interruptAndFastForward(null, 0);
  29608. }),
  29609. (n.prototype.interruptAndFastForward = function (e, t) {
  29610. //Log('interruptAndFastForward' , '#f00')
  29611. this.isWarping() &&
  29612. this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  29613. this.flying && this.emit(w.FlyingInterrupted),
  29614. this.path.interruptAndFastForward(e, t);
  29615. }),
  29616. (n.prototype.setSize = function (e, t) {
  29617. var i = e / t;
  29618. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  29619. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  29620. n > f.insideFOVMax
  29621. ? (this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t))
  29622. : (this.baseFov = f.insideFOV);
  29623. for (var r in this.cameraControls.cameras) {
  29624. var o = this.cameraControls.cameras[r];
  29625. (o.fov = this.baseFov * (1 / this.zoomLevel)),
  29626. o.updateAspect(i);
  29627. }
  29628. }),
  29629. (n.prototype.toJSON = function () {
  29630. var e = {};
  29631. return this.cameraControls.activeControl
  29632. ? ((e = this.cameraControls.activeControl.toJSON()),
  29633. (e.camera_mode = u.toInt(this.mode)),
  29634. this.isOutsideMode()
  29635. ? this.model.allFloorsVisible
  29636. ? (e.floor_visibility = [])
  29637. : (e.floor_visibility = this.model.floors.list.map(
  29638. function (e) {
  29639. return e.hidden ? 0 : 1;
  29640. }
  29641. ))
  29642. : u.PANORAMA && (e.scan_id = this.currentPano.id),
  29643. e)
  29644. : e;
  29645. }),
  29646. (n.prototype.getCurrentNodePanos = function (e) {
  29647. this.model.panos.map;
  29648. if (((e.length = 0), this.path.nodes.length)) {
  29649. var momentTour = this.director.getMomentTour(
  29650. this.director.destinationItem
  29651. );
  29652. if (momentTour == "black") {
  29653. //改 upcomingPanos如果是black的只需要起点和终点
  29654. if (this.path.nodes.length) {
  29655. e.push(this.model.panos.get(this.path.nodes[0]));
  29656. }
  29657. if (this.path.nodes.length > 1) {
  29658. e.push(
  29659. this.model.panos.get(
  29660. this.path.nodes[this.path.nodes.length - 1]
  29661. )
  29662. );
  29663. }
  29664. } else {
  29665. for (var t = 0; t < this.path.nodes.length; t++) {
  29666. var i = this.path.nodes[t];
  29667. e.push(this.model.panos.get(i));
  29668. }
  29669. }
  29670. }
  29671. }),
  29672. (n.prototype.zoomIncrementally = function (e) {
  29673. var t = this.zoomLevel;
  29674. this.zoomTo(this.zoomLevel + e),
  29675. t !== this.zoomLevel &&
  29676. this.currentPano &&
  29677. this.zoomStats.addZoomAction(
  29678. t,
  29679. this.zoomLevel,
  29680. this.currentPano.id
  29681. );
  29682. }),
  29683. (n.prototype.zoomInIncrementally = function (e) {
  29684. (e = e || this.defaultZoomIncrement), this.zoomIncrementally(e);
  29685. }),
  29686. (n.prototype.zoomOutIncrementally = function (e) {
  29687. (e = e || -this.defaultZoomIncrement), this.zoomIncrementally(e);
  29688. }),
  29689. (n.prototype.zoomBy = function (e) {
  29690. this.zoomTo(this.zoomLevel * e);
  29691. }),
  29692. (n.prototype.zoomIn = function () {
  29693. this.zoomBy(1 + this.zoomSpeed);
  29694. }),
  29695. (n.prototype.zoomOut = function () {
  29696. this.zoomBy(1 - this.zoomSpeed);
  29697. }),
  29698. (n.prototype.zoomTo = function (e, t) {
  29699. if (
  29700. t ||
  29701. (f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled)
  29702. ) {
  29703. if (
  29704. (e < f.zoom.min && (e = f.zoom.min),
  29705. e > f.zoom.max && (e = f.zoom.max),
  29706. e > this.zoomLevel
  29707. ? (this.emit(O.ZoomIn),
  29708. e === f.zoom.max && this.emit(O.ZoomMax))
  29709. : e < this.zoomLevel &&
  29710. (this.emit(O.ZoomOut),
  29711. e === f.zoom.min && this.emit(O.ZoomMin)),
  29712. this.cameraControls.activeControl)
  29713. ) {
  29714. var i = this.cameraControls.activeControl.camera;
  29715. (this.zoomLevel = e),
  29716. (i.fov = this.baseFov * (1 / this.zoomLevel)),
  29717. i.updateProjectionMatrix(),
  29718. (this.zoomFov = i.fov);
  29719. }
  29720. }
  29721. }),
  29722. (n.prototype.increaseZoomSpeed = function () {
  29723. this.zoomSpeed = this.clampZoomSpeed(
  29724. this.zoomSpeed + this.zoomSpeedAdjust
  29725. );
  29726. }),
  29727. (n.prototype.decreaseZoomSpeed = function () {
  29728. this.zoomSpeed = this.clampZoomSpeed(
  29729. this.zoomSpeed - this.zoomSpeedAdjust
  29730. );
  29731. }),
  29732. (n.prototype.clampZoomSpeed = function (e) {
  29733. return e < 0 ? 0 : e;
  29734. }),
  29735. (n.prototype.activatePersistentZooming = function (e) {
  29736. this.zooming = e ? 1 : -1;
  29737. }),
  29738. (n.prototype.deactivatePersistentZooming = function () {
  29739. this.zooming = 0;
  29740. }),
  29741. (n.prototype.zoomDefault = function () {
  29742. this.zoomTo(1, !0);
  29743. }),
  29744. (window.fovTranId = 333); //add
  29745. n.prototype.smoothZoomToDefault = function (e, t) {
  29746. y.cancelById(window.fovTranId);
  29747. var i,
  29748. n = this.zoomLevel,
  29749. r = function (e) {
  29750. e > 1 && (e = 1), (i = n * (1 - e) + e), this.zoomTo(i, !0);
  29751. }.bind(this),
  29752. o = function () {
  29753. this.zoomDefault(), t && window.setTimeout(t, 50);
  29754. }.bind(this);
  29755. y.start(
  29756. r,
  29757. e,
  29758. o,
  29759. null,
  29760. 0,
  29761. A[f.transition.blendEasing],
  29762. null,
  29763. window.fovTranId
  29764. );
  29765. };
  29766. n.prototype.smoothZoomFovTo = function (
  29767. fov,
  29768. zoomLevel,
  29769. dur,
  29770. callback
  29771. ) {
  29772. //add
  29773. y.cancelById(window.fovTranId);
  29774. console.log("smoothZoomFovTo " + zoomLevel);
  29775. var i,
  29776. n = this.zoomLevel,
  29777. aimLevel = zoomLevel || this.baseFov / fov;
  29778. if (n == aimLevel) return;
  29779. var fun = function (e) {
  29780. e > 1 && (e = 1),
  29781. (i = n * (1 - e) + e * aimLevel),
  29782. this.zoomTo(i, !0);
  29783. }.bind(this);
  29784. y.start(
  29785. fun,
  29786. dur,
  29787. callback,
  29788. null,
  29789. 0,
  29790. A[f.transition.blendEasing],
  29791. null,
  29792. window.fovTranId
  29793. );
  29794. };
  29795. n.prototype.updateZoomPano = function () {
  29796. if (
  29797. !this.panoRenderer.zoomPanoRenderingDisabled &&
  29798. this.mode === u.PANORAMA &&
  29799. this.currentPano
  29800. ) {
  29801. let navTileClass = this.qualityManager.getNavZoomClass();
  29802. let tileClass = this.qualityManager.getMaxZoomClass();
  29803. if (navTileClass == "4k") {
  29804. var r = true;
  29805. } else {
  29806. var levelThreshold1 = navTileClass == "1k" ? 1.1 : 1.5,
  29807. levelThreshold2 = 1.8; //levelThreshold2不能比zoom.max大也就是不能超过2,否则zoom.max将无法提升到3
  29808. var t = this.zoomLevel > levelThreshold1,
  29809. i =
  29810. this.flying &&
  29811. this.nextPano &&
  29812. this.nextPano !== this.currentPano,
  29813. n = !i && !this.isWarping(),
  29814. r = t; //&& n ; // 允许flying状态下加载4K图
  29815. }
  29816. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  29817. this.panoRenderer.setZoomingActive(r, this.currentPano, !0);
  29818. var o = function (pano, ifZoom) {
  29819. this.panoRenderer.resetRenderStatus(
  29820. pano.id,
  29821. !1,
  29822. !0,
  29823. this.qualityManager.getMaxNavPanoSize()
  29824. ),
  29825. this.panoRenderer.clearAllQueuedUploadsForPano(pano.id),
  29826. this.panoRenderer.renderPanoTiles(pano.id, null, !1, !1),
  29827. pano.setZoomed(ifZoom);
  29828. }.bind(this);
  29829. if (navTileClass == "4k") {
  29830. if (!this.currentPano.zoomed) {
  29831. o(this.currentPano, !0);
  29832. this.panoRenderer.enableUltraHighQualityMode(
  29833. function () {
  29834. //开启4k getMaxZoomPanoSize
  29835. this.qualityManager.useUltraHighResolutionPanos &&
  29836. (f.zoom.max = D.ultraHighQualityMaxZoom);
  29837. o(this.currentPano, !0);
  29838. }.bind(this)
  29839. );
  29840. }
  29841. } else {
  29842. let zoomLevelRes = this.qualityManager.zoomLevelResolution;
  29843. if (
  29844. r &&
  29845. (!this.currentPano.zoomed ||
  29846. (zoomLevelRes && zoomLevelRes != "4k"))
  29847. ) {
  29848. //needZoom
  29849. this.currentPano.zoomed || o(this.currentPano, !0);
  29850. if (
  29851. navTileClass == "1k" &&
  29852. tileClass != "1k" &&
  29853. this.zoomLevel < levelThreshold2
  29854. ) {
  29855. this.panoRenderer.enableHighQuality(
  29856. function () {
  29857. //开启2k
  29858. if (tileClass != "4k") {
  29859. o(this.currentPano, !0);
  29860. }
  29861. }.bind(this)
  29862. );
  29863. } else {
  29864. this.panoRenderer.enableUltraHighQualityMode(
  29865. function () {
  29866. //开启4k getMaxZoomPanoSize
  29867. this.qualityManager.useUltraHighResolutionPanos &&
  29868. !f.zoom.overridemax &&
  29869. (f.zoom.max = D.ultraHighQualityMaxZoom);
  29870. o(this.currentPano, !0);
  29871. }.bind(this)
  29872. );
  29873. }
  29874. } else {
  29875. !t && this.currentPano.zoomed && o(this.currentPano, !1);
  29876. }
  29877. //有三个级别的话,需要标记zoomLevelResolution,以便更新maxZoomPanoSize判断能下载的最高级别
  29878. if (r && navTileClass == "1k" && tileClass == "4k") {
  29879. //目前只有手机端navTileClass == '1k'
  29880. var change = (zoomedFlag) => {
  29881. this.qualityManager.updateMaximums(); //更新maxZoomPanoSize
  29882. this.panoRenderer.setupZoomRenderTarget(); //更新renderTarget
  29883. //this.currentPano.setZoomed(t);//更新uniforms贴图
  29884. if (this.qualityManager.zoomLevelResolution == "4k") {
  29885. this.model.showHighMap();
  29886. } else {
  29887. this.model.hideHighMap();
  29888. }
  29889. };
  29890. this.qualityManager.zoomLevelResolution =
  29891. this.zoomLevel >= levelThreshold2
  29892. ? "4k"
  29893. : this.zoomLevel > levelThreshold1
  29894. ? "2k"
  29895. : "1k";
  29896. if (
  29897. this.oldZoomLevel < levelThreshold2 &&
  29898. this.zoomLevel >= levelThreshold2
  29899. ) {
  29900. //1k/2k-4k
  29901. change();
  29902. o(this.currentPano, t);
  29903. } else if (
  29904. this.oldZoomLevel <= levelThreshold1 &&
  29905. this.zoomLevel > levelThreshold1
  29906. ) {
  29907. //1k-2k
  29908. change();
  29909. } else if (
  29910. this.oldZoomLevel > levelThreshold2 &&
  29911. this.zoomLevel <= levelThreshold2
  29912. ) {
  29913. //4k-2k/1k
  29914. change();
  29915. o(this.currentPano, t);
  29916. } else if (
  29917. this.oldZoomLevel > levelThreshold1 &&
  29918. this.zoomLevel <= levelThreshold1
  29919. ) {
  29920. //2k-1k
  29921. change();
  29922. }
  29923. this.oldZoomLevel = this.zoomLevel;
  29924. }
  29925. }
  29926. }
  29927. };
  29928. (n.prototype.checkHasNeighbor = function (pano) {
  29929. //add
  29930. for (var i in pano.neighbourPanos) {
  29931. if (i == pano.id) continue;
  29932. if (pano.neighbourPanos[i]) {
  29933. return true;
  29934. }
  29935. }
  29936. }),
  29937. (t.exports = n);
  29938. }).call(this, "/js/player.js");
  29939. },
  29940. {
  29941. "./constants": 8,
  29942. "./enum/AlignmentType": 17,
  29943. "./enum/BlackoutStyle": 18,
  29944. "./enum/ControlEvents": 21,
  29945. "./enum/Keys": 30,
  29946. "./enum/ModelManagerEvents": 33,
  29947. "./enum/PanoSizeClass": 36,
  29948. "./enum/PanoramaEvents": 37,
  29949. "./enum/PathDiscardMode": 38,
  29950. "./enum/PathDisplayMode": 39,
  29951. "./enum/PlayerEvents": 40,
  29952. "./enum/TagStates": 44,
  29953. "./enum/Vectors": 50,
  29954. "./enum/Viewmode": 51,
  29955. "./enum/WarpStyle": 52,
  29956. "./enum/ZoomEvents": 53,
  29957. "./exception/BasicException": 55,
  29958. "./model/ModelManager": 140,
  29959. "./objects/NSpider": 147,
  29960. "./objects/Panorama": 148,
  29961. "./objects/Reticule": 149,
  29962. "./objects/ShowPath": 151,
  29963. "./objects/Snapshot": 153,
  29964. "./objects/View": 154,
  29965. "./settings": 166,
  29966. "./shaders": 167,
  29967. "./tile/TileDownloader": 171,
  29968. "./tile/TilePrioritizer": 172,
  29969. "./util/ZoomStats": 179,
  29970. "./util/browser": 182,
  29971. "./util/camera": 183,
  29972. "./util/cameraLight": 184,
  29973. "./util/common": 185,
  29974. "./util/easing": 186,
  29975. "./util/history": 187,
  29976. "./util/lerp": 188,
  29977. "./util/logger": 189,
  29978. "./util/math": 190,
  29979. "./util/transitions": 195,
  29980. hot: "hot",
  29981. scaleImg: "scaleImg",
  29982. events: 202,
  29983. three: 217,
  29984. },
  29985. ],
  29986. scaleImg: [
  29987. function (t, e) {
  29988. // xzw
  29989. var OUTPUT = e;
  29990. (function () {
  29991. function t(t, a, i, r) {
  29992. function h() {
  29993. (B =
  29994. "object" == typeof i
  29995. ? i
  29996. : a.src || r
  29997. ? u
  29998. : document.createElement("canvas")),
  29999. (B.width = s),
  30000. (B.height = f),
  30001. (G = B.getContext("2d"));
  30002. }
  30003. function n(t) {
  30004. if (t) {
  30005. var e,
  30006. a = G.getImageData(0, 0, s, f),
  30007. i = a.data;
  30008. for (e = 0; at > e; e += 4)
  30009. (i[e] = (t[e] * it) | 0),
  30010. (i[e + 1] = (t[e + 1] * it) | 0),
  30011. (i[e + 2] = (t[e + 2] * it) | 0),
  30012. (i[e + 3] = (t[e + 3] * it) | 0);
  30013. return delete t, a;
  30014. }
  30015. return G.getImageData(0, 0, s, f);
  30016. }
  30017. function o(t, e, a, i, r) {
  30018. return (
  30019. 0.5 *
  30020. (i -
  30021. e +
  30022. (2 * e - 5 * a + 4 * i - r + (3 * (a - i) + r - e) * t) *
  30023. t) *
  30024. t +
  30025. a
  30026. );
  30027. }
  30028. a ||
  30029. ((a = t.input),
  30030. (i = t.output),
  30031. (r = t.inputRemovable),
  30032. t.scale && (t = t.scale));
  30033. var u, d;
  30034. if (a.src)
  30035. if (
  30036. ((u = document.createElement("canvas")), null != a.naturalWidth)
  30037. )
  30038. (u.width = a.naturalWidth), (u.height = a.naturalHeight);
  30039. else if (null != a.runtimeStyle) {
  30040. var l = a.runtimeStyle,
  30041. c = l.width,
  30042. g = l.height;
  30043. (l.width = "auto"),
  30044. (l.height = "auto"),
  30045. (u.width = a.width),
  30046. (u.height = a.height),
  30047. (l.width = c),
  30048. (l.height = g);
  30049. } else {
  30050. var c = a.width,
  30051. g = a.height;
  30052. a.removeAttribute &&
  30053. (a.removeAttribute("width"), a.removeAttribute("height")),
  30054. (u.width = a.width),
  30055. (u.height = a.height),
  30056. (a.width = c),
  30057. (a.height = g);
  30058. }
  30059. else u = a;
  30060. (d = u.getContext("2d")), a.src && d.drawImage(a, 0, 0);
  30061. var s,
  30062. f,
  30063. m = u.width,
  30064. w = u.height,
  30065. p = d.getImageData(0, 0, m, w).data;
  30066. if (!m || !w) return !1;
  30067. (a.src || r) && u.clearRect(0, 0, m, w),
  30068. "object" == typeof t
  30069. ? t.width
  30070. ? ((s = (t.width + 0.5) | 0), (f = (t.height + 0.5) | 0))
  30071. : ((s = (m * t.scaleX + 0.5) | 0),
  30072. (f = (w * t.scaleY + 0.5) | 0))
  30073. : ((s = (t * m + 0.5) | 0), (f = (t * w + 0.5) | 0));
  30074. var v,
  30075. b,
  30076. y,
  30077. x,
  30078. D,
  30079. I,
  30080. A,
  30081. j,
  30082. R,
  30083. k,
  30084. C,
  30085. E,
  30086. F,
  30087. L,
  30088. S,
  30089. U,
  30090. W,
  30091. H,
  30092. alpha,
  30093. X,
  30094. Y,
  30095. q,
  30096. z,
  30097. B,
  30098. G,
  30099. J,
  30100. K,
  30101. M,
  30102. N,
  30103. O,
  30104. P,
  30105. Q,
  30106. T,
  30107. V,
  30108. Z,
  30109. $ = s << 2,
  30110. _ = m << 2,
  30111. tt = 0,
  30112. et = 0,
  30113. at = $ * f,
  30114. it = 255.99 / 255,
  30115. rt = s / m,
  30116. ht = f / w,
  30117. nt = rt * ht;
  30118. if (rt > 1 || ht > 1)
  30119. for (h(), J = n(), K = J.data, x = 0; f > x; x++)
  30120. for (
  30121. b = x / ht,
  30122. R = 0 | b,
  30123. q = b - R,
  30124. N = R * _,
  30125. M = 1 > R ? N : N - _,
  30126. w - 2 > R
  30127. ? ((O = N + _), (P = (R + 2) * _))
  30128. : (O = P = R > w - 2 ? N : N + _),
  30129. y = 0;
  30130. s > y;
  30131. y++, et += 4
  30132. )
  30133. (v = y / rt),
  30134. (j = 0 | v),
  30135. (z = v - j),
  30136. (T = j << 2),
  30137. (Q = 1 > j ? T : T - 4),
  30138. m - 2 > j
  30139. ? ((V = T + 4), (Z = T + 8))
  30140. : (V = Z = j > m - 2 ? T : T + 4),
  30141. (H =
  30142. (o(
  30143. q,
  30144. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  30145. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  30146. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  30147. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  30148. ) *
  30149. it) |
  30150. 0),
  30151. ++Q,
  30152. ++T,
  30153. ++V,
  30154. ++Z,
  30155. (X =
  30156. (o(
  30157. q,
  30158. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  30159. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  30160. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  30161. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  30162. ) *
  30163. it) |
  30164. 0),
  30165. ++Q,
  30166. ++T,
  30167. ++V,
  30168. ++Z,
  30169. (Y =
  30170. (o(
  30171. q,
  30172. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  30173. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  30174. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  30175. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  30176. ) *
  30177. it) |
  30178. 0),
  30179. ++Q,
  30180. ++T,
  30181. ++V,
  30182. ++Z,
  30183. (alpha =
  30184. (o(
  30185. q,
  30186. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  30187. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  30188. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  30189. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  30190. ) *
  30191. it) |
  30192. 0),
  30193. (K[et] = H >= 0 ? (256 > H ? H : 255) : 0),
  30194. (K[et + 1] = X >= 0 ? (256 > X ? X : 255) : 0),
  30195. (K[et + 2] = Y >= 0 ? (256 > Y ? Y : 255) : 0),
  30196. (K[et + 3] = alpha >= 0 ? (256 > alpha ? alpha : 255) : 0);
  30197. else {
  30198. if (e.Float32Array) W = new Float32Array(at);
  30199. else for (W = [], et = 0; at > et; ++et) W[et] = 0;
  30200. for (b = 0; w > b; b++)
  30201. for (
  30202. x = b * ht,
  30203. A = 0 | x,
  30204. D = A * $,
  30205. U = !!((A - ((x + ht) | 0)) * (w - 1 - b)) << 1,
  30206. U && ((F = A + 1 - x), (L = x + ht - A - 1)),
  30207. v = 0;
  30208. m > v;
  30209. v++, tt += 4
  30210. )
  30211. switch (
  30212. ((y = v * rt),
  30213. (I = 0 | y),
  30214. (et = D + (I << 2)),
  30215. (S = !!((I - ((y + rt) | 0)) * (m - 1 - v))),
  30216. S && ((C = I + 1 - y), (E = y + rt - I - 1)),
  30217. (H = p[tt]),
  30218. (X = p[tt + 1]),
  30219. (Y = p[tt + 2]),
  30220. (alpha = p[tt + 3]),
  30221. S + U)
  30222. ) {
  30223. case 0:
  30224. (W[et] += H * nt),
  30225. (W[et + 1] += X * nt),
  30226. (W[et + 2] += Y * nt),
  30227. (W[et + 3] += alpha * nt);
  30228. break;
  30229. case 1:
  30230. (k = C * ht),
  30231. (W[et] += H * k),
  30232. (W[et + 1] += X * k),
  30233. (W[et + 2] += Y * k),
  30234. (W[et + 3] += alpha * k),
  30235. (k = E * ht),
  30236. (W[et + 4] += H * k),
  30237. (W[et + 5] += X * k),
  30238. (W[et + 6] += Y * k),
  30239. (W[et + 7] += alpha * k);
  30240. break;
  30241. case 2:
  30242. (k = rt * F),
  30243. (W[et] += H * k),
  30244. (W[et + 1] += X * k),
  30245. (W[et + 2] += Y * k),
  30246. (W[et + 3] += alpha * k),
  30247. (k = rt * L),
  30248. (et += $),
  30249. (W[et] += H * k),
  30250. (W[et + 1] += X * k),
  30251. (W[et + 2] += Y * k),
  30252. (W[et + 3] += alpha * k);
  30253. break;
  30254. default:
  30255. (k = C * F),
  30256. (W[et] += H * k),
  30257. (W[et + 1] += X * k),
  30258. (W[et + 2] += Y * k),
  30259. (W[et + 3] += alpha * k),
  30260. (k = E * F),
  30261. (W[et + 4] += H * k),
  30262. (W[et + 5] += X * k),
  30263. (W[et + 6] += Y * k),
  30264. (W[et + 7] += alpha * k),
  30265. (k = C * L),
  30266. (et += $),
  30267. (W[et] += H * k),
  30268. (W[et + 1] += X * k),
  30269. (W[et + 2] += Y * k),
  30270. (W[et + 3] += alpha * k),
  30271. (k = E * L),
  30272. (W[et + 4] += H * k),
  30273. (W[et + 5] += X * k),
  30274. (W[et + 6] += Y * k),
  30275. (W[et + 7] += alpha * k);
  30276. }
  30277. delete p, h(), (J = n(W));
  30278. }
  30279. if ((G.putImageData(J, 0, 0), "string" == typeof i)) {
  30280. if ("png" === i || "jpeg" === i) {
  30281. var ot;
  30282. return (
  30283. (ot = r && a.src ? a : new Image()),
  30284. (ot.width = s),
  30285. (ot.height = f),
  30286. (ot.src = B.toDataURL("image/" + i, 0.85)),
  30287. ot
  30288. );
  30289. }
  30290. if ("png-src" === i || "jpeg-src" === i)
  30291. return B.toDataURL("image/" + i.split("-")[0], 0.85);
  30292. }
  30293. return B;
  30294. }
  30295. var e = this;
  30296. "undefined" != typeof exports
  30297. ? ("undefined" != typeof module &&
  30298. module.exports &&
  30299. (exports = module.exports = t),
  30300. (exports.scale = t))
  30301. : (c = t);
  30302. }).call(this);
  30303. OUTPUT.exports = c;
  30304. },
  30305. {},
  30306. ],
  30307. 156: [
  30308. function (e, t, i) {
  30309. (function (i) {
  30310. "use strict";
  30311. function n(e, t) {
  30312. (this.model = e),
  30313. (this.panos = e.panos),
  30314. (this.player = t),
  30315. (this.imagePanos = this.listImagePanos()),
  30316. (this.retryMinimumTime = 1e4);
  30317. }
  30318. var r = (e("three"), e("./enum/Viewmode")),
  30319. o = (e("./settings"), e("./objects/Panorama")),
  30320. a = e("./util/logger"),
  30321. s = new a(i);
  30322. (n.prototype.start = function () {
  30323. this.loadNextPano(
  30324. function (e) {
  30325. e
  30326. ? this.start()
  30327. : (s.debug(
  30328. "No suitable pano loaded, waiting a little while before looking again"
  30329. ),
  30330. setTimeout(
  30331. function () {
  30332. this.start();
  30333. }.bind(this),
  30334. 1e3
  30335. ));
  30336. }.bind(this)
  30337. );
  30338. }),
  30339. (n.prototype.validLoadTarget = function (e) {
  30340. return (
  30341. e &&
  30342. !e.isLoaded("high") &&
  30343. Date.now() - e.failedLoadingAt > this.retryMinimumTime
  30344. );
  30345. }),
  30346. (n.prototype.listImagePanos = function () {
  30347. var e = [],
  30348. t = this;
  30349. return (
  30350. this.model.images.forEach(function (i) {
  30351. if (i.metadata && i.metadata.scan_id) {
  30352. var n = t.model.panos.get(i.metadata.scan_id);
  30353. n && !n.isLoaded("high") && e.push(n);
  30354. }
  30355. }),
  30356. e
  30357. );
  30358. }),
  30359. (n.prototype.nextNotLoadedImage = function () {
  30360. for (; this.imagePanos.length > 0; ) {
  30361. var e = this.imagePanos[0];
  30362. if (!e.isLoaded("high")) return e;
  30363. this.imagePanos.shift();
  30364. }
  30365. return null;
  30366. }),
  30367. (n.prototype.loadNextPano = function (e) {
  30368. var t,
  30369. i,
  30370. n = this.model.waitQueue.filter(function (e) {
  30371. return e.object instanceof o;
  30372. });
  30373. n.length > 0
  30374. ? ((t = n[0].object),
  30375. s.debug(
  30376. "Overrode pano selection: Flying to an unloaded pano " +
  30377. t.id
  30378. ))
  30379. : this.validLoadTarget(this.player.currentPano)
  30380. ? ((t = this.player.currentPano),
  30381. s.debug(
  30382. "Overrode pano selection: Currently at an unloaded pano " +
  30383. t.id
  30384. ))
  30385. : this.validLoadTarget(this.player.closestPano)
  30386. ? ((t = this.player.closestPano),
  30387. s.debug(
  30388. "Overrode pano selection: Hovering over an unloaded pano " +
  30389. t.id
  30390. ))
  30391. : this.validLoadTarget(this.nextNotLoadedImage())
  30392. ? ((i = "high"),
  30393. (t = this.imagePanos[0]),
  30394. s.debug("Overrode pano selection: Highlight image " + t.id))
  30395. : this.player.mode === r.PANORAMA &&
  30396. ((t = this.panos.lowestByScore(
  30397. [
  30398. this.validLoadTarget.bind(this),
  30399. o.filters.isNeighbourPanoTo(this.player.currentPano),
  30400. ],
  30401. [
  30402. o.scoreFunctions.distance(this.player.currentPano),
  30403. o.scoreFunctions.direction(
  30404. this.player.position,
  30405. this.player.getDirection()
  30406. ),
  30407. o.scoreFunctions.inFieldOfView(
  30408. this.player.position,
  30409. this.player.getDirection()
  30410. ),
  30411. ]
  30412. )),
  30413. t && s.debug("Normal pano selection: neighbor " + t.id)),
  30414. t
  30415. ? ((i = i || t.isLoaded("low") ? "high" : "low"),
  30416. s.debug("Preloading " + i + "-res pano " + t.id),
  30417. t
  30418. .loadCube(i)
  30419. .done(e)
  30420. .fail(function () {
  30421. s.warn(
  30422. "Failed preloading pano",
  30423. t.id,
  30424. ", marking it as failed and forgetting it for a while"
  30425. ),
  30426. e();
  30427. }))
  30428. : e && e(null);
  30429. }),
  30430. (t.exports = n);
  30431. }).call(this, "/js/preloaders.js");
  30432. },
  30433. {
  30434. "./enum/Viewmode": 51,
  30435. "./objects/Panorama": 148,
  30436. "./settings": 166,
  30437. "./util/logger": 189,
  30438. three: 217,
  30439. },
  30440. ],
  30441. 157: [
  30442. function (e, t, i) {
  30443. (function (i) {
  30444. "use strict";
  30445. function n(e, t, i, n, r) {
  30446. (this.qualityManager = e),
  30447. (this.scene = t),
  30448. (this.camera = i),
  30449. (this.container = r),
  30450. (this.controls = n),
  30451. (this.controls.enabled = !0),
  30452. (this.controls.locked = !0),
  30453. (this.quickstartCamera = n.camera),
  30454. (this.quickstartCamera.fov = h.clampVFOV(
  30455. a.insideFOV,
  30456. a.insideFOVMax,
  30457. $("#player").width(),
  30458. $("#player").height()
  30459. )),
  30460. (this.skybox = null);
  30461. }
  30462. var r = e("three"),
  30463. o = e("../util/logger"),
  30464. a = e("../constants"),
  30465. s =
  30466. (e("../util/transitions"),
  30467. e("../util/lerp"),
  30468. e("../util/easing"),
  30469. e("../enum/Vectors")),
  30470. l = e("../enum/PanoSizeClass"),
  30471. c =
  30472. (e("../materials/ModelTextureMaterial"),
  30473. e("../materials/CubemapMaterial")),
  30474. h =
  30475. (e("../cameras/PanoramaCamera"),
  30476. e("../controls/PanoramaControls"),
  30477. e("../tile/TileUtils"),
  30478. e("../util/camera"),
  30479. e("../util/cameraLight")),
  30480. u =
  30481. (e("../util/browser"),
  30482. e("../settings"),
  30483. e("../gui/helpManager"),
  30484. new o(i));
  30485. (n.prototype.load = function (e) {
  30486. e.pano.shouldRedrawOnBaseLoaded = !0;
  30487. var t,
  30488. i,
  30489. n = this,
  30490. r = s.FORWARD.clone().applyQuaternion(e.quaternion),
  30491. o = r.clone().negate();
  30492. this.controls.lookAt(r.add(this.quickstartCamera.position));
  30493. var a = this.qualityManager.getPanoSize(l.BASE),
  30494. c = this.qualityManager.getPanoSize(l.STANDARD);
  30495. if (e.pano.tiled) {
  30496. u.warn("Loading startPano, TILED", e.pano.id);
  30497. var d = h.getHFOVForCamera(
  30498. this.quickstartCamera,
  30499. $("#player").width(),
  30500. $("#player").height()
  30501. ),
  30502. p = this.quickstartCamera.fov;
  30503. u.warn(
  30504. "Quickstart loading tiles in frustum: [horizontal FOV: " +
  30505. d +
  30506. ", vertical FOV: " +
  30507. p +
  30508. "]"
  30509. ),
  30510. (t = e.pano.loadTiledPano(
  30511. c,
  30512. r,
  30513. {
  30514. hFov: d,
  30515. vFov: p,
  30516. },
  30517. !1,
  30518. !1,
  30519. !0
  30520. )),
  30521. (i = e.pano.loadTiledPano(a, o, null, !1, !1, !0));
  30522. } else
  30523. u.warn("Loading startPano", e.pano.id),
  30524. (t = e.pano.loadCube("high"));
  30525. return $.when(t).then(
  30526. function () {
  30527. n.init(e.pano, e.quaternion),
  30528. e.pano.tiled
  30529. ? i.done(
  30530. function () {
  30531. (e.pano.lockUntilRenderingComplete = !1),
  30532. (this.controls.locked = !1);
  30533. }.bind(this)
  30534. )
  30535. : (this.controls.locked = !1);
  30536. }.bind(this)
  30537. );
  30538. }),
  30539. (n.prototype.init = function (e, t) {
  30540. u.info("Quickstart done loading, adding scene objects"),
  30541. (e.lockUntilRenderingComplete = !0),
  30542. (this.skybox = new r.Mesh(
  30543. new r.CubeGeometry(1, 1, 1),
  30544. new c({
  30545. side: r.BackSide,
  30546. })
  30547. )),
  30548. (this.skybox.material.uniforms.map.value =
  30549. e.getSkyboxTexture()),
  30550. this.skybox.quaternion.copy(e.quaternion),
  30551. this.scene.add(this.skybox),
  30552. $(this.container).show();
  30553. }),
  30554. (n.prototype.update = function (e) {
  30555. this.controls.update(e), this.camera.copy(this.quickstartCamera);
  30556. }),
  30557. (n.prototype.setSize = function (e, t) {
  30558. this.quickstartCamera.updateAspect(e / t);
  30559. }),
  30560. (n.prototype.destroy = function () {
  30561. this.scene.remove(this.skybox);
  30562. }),
  30563. (t.exports = n);
  30564. }).call(this, "/js/scene/QuickstartManager.js");
  30565. },
  30566. {
  30567. "../cameras/PanoramaCamera": 7,
  30568. "../constants": 8,
  30569. "../controls/PanoramaControls": 13,
  30570. "../enum/PanoSizeClass": 36,
  30571. "../enum/Vectors": 50,
  30572. "../gui/helpManager": 68,
  30573. "../materials/CubemapMaterial": 117,
  30574. "../materials/ModelTextureMaterial": 118,
  30575. "../settings": 166,
  30576. "../tile/TileUtils": 174,
  30577. "../util/browser": 182,
  30578. "../util/camera": 183,
  30579. "../util/cameraLight": 184,
  30580. "../util/easing": 186,
  30581. "../util/lerp": 188,
  30582. "../util/logger": 189,
  30583. "../util/transitions": 195,
  30584. three: 217,
  30585. },
  30586. ],
  30587. 158: [
  30588. function (e, t, i) {
  30589. "use strict";
  30590. function n(e, t, i) {
  30591. (this.scene = e),
  30592. (this.camera = t),
  30593. (this.renderer = null),
  30594. (this.effects = i),
  30595. (this.animateCallback = null),
  30596. (this.composer = null),
  30597. (this.qualityManager = null),
  30598. (e.renderWidth = 0),
  30599. (e.renderHeight = 0),
  30600. (this.updateClock = new r.Clock()),
  30601. (this.components = []),
  30602. (this.updateListeners = []),
  30603. (this.resizeListeners = []),
  30604. (this.forceUpdateSize = !1),
  30605. (this.started = !1),
  30606. (this.textures = {}),
  30607. (this.suspendedObjects = []);
  30608. }
  30609. var r = e("three"),
  30610. o = e("../shaders"),
  30611. a = e("../enum/SceneRendererEvents"),
  30612. s = e("../enum/GLTextureType"),
  30613. l = e("../enum/GLCubeFaces"),
  30614. c = e("../exception/BasicException"),
  30615. h = e("../exception/RendererCreationException"),
  30616. /**********************************************************************fyz改 from徐世廷**********************************************************************/
  30617. m = e("../util/browser"),
  30618. /**************************************************************************************************************************************************/
  30619. u = e("../settings"),
  30620. d = e("events").EventEmitter;
  30621. (window.requestAnimationFrame =
  30622. window.requestAnimationFrame || window.webkitRequestAnimationFrame),
  30623. (n.prototype = Object.create(d.prototype)),
  30624. (n.prototype.addComponent = function (e) {
  30625. this.components.push(e),
  30626. e.update && this.updateListeners.push(e),
  30627. e.setSize &&
  30628. (this.resizeListeners.push(e), (this.forceUpdateSize = !0));
  30629. }),
  30630. (n.prototype.removeComponent = function (e) {
  30631. var t = function (t) {
  30632. return t !== e;
  30633. };
  30634. (this.components = this.components.filter(t)),
  30635. (this.updateListeners = this.updateListeners.filter(t)),
  30636. (this.resizeListeners = this.resizeListeners.filter(t));
  30637. }),
  30638. (n.prototype.start = function (e) {
  30639. if (this.started)
  30640. throw new c("Can't start SceneRenderer, already started");
  30641. this.createContext(e),
  30642. /***************************************************VR fyz改 from徐世廷**********************************************************************/
  30643. m.isMobile() && this.boluoVrInit(),
  30644. /*******************************************************************************************************************************/
  30645. this.initComposer(),
  30646. (this.started = !0),
  30647. (p = p.bind(this))();
  30648. }),
  30649. (n.prototype.createContext = function (e) {
  30650. var transparent = !!(settings.transparentBg || settings.bgImg);
  30651. try {
  30652. (this.renderer = new r.WebGLRenderer({
  30653. antialias: !m.isMobile(),
  30654. alpha: transparent,
  30655. })),
  30656. (this.renderer.autoClear = !0),
  30657. this.renderer.setPixelRatio(
  30658. window.devicePixelRatio ? window.devicePixelRatio : 1
  30659. ),
  30660. this.renderer.setSize(
  30661. $("#player").width(),
  30662. $("#player").height(),
  30663. false
  30664. ), //改
  30665. transparent && this.renderer.setClearColor(0x000000, 0); //透明
  30666. this.emit(a.ContextCreated);
  30667. } catch (e) {
  30668. throw new h("Unable to create a WebGL rendering context");
  30669. }
  30670. u.profiling.enabled && this.overrideTextures(),
  30671. e.appendChild(this.renderer.domElement);
  30672. /* window.stats = new Stats();
  30673. e.appendChild( stats.dom ); */
  30674. }),
  30675. (n.prototype.overrideTextures = function () {
  30676. var e = this.renderer.context,
  30677. t = 0,
  30678. i = e.createTexture;
  30679. e.createTexture = function () {
  30680. var n = i.call(e);
  30681. return (n.id = t++), (this.textures[n.id] = n), n;
  30682. }.bind(this);
  30683. var n = e.texImage2D;
  30684. e.texImage2D = function (t, i, r, o, a, l, c, h, u) {
  30685. var d,
  30686. p = this.getTextureTypeFromTarget(e, t);
  30687. (d =
  30688. p === s.TextureCube
  30689. ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP)
  30690. : e.getParameter(e.TEXTURE_BINDING_2D)),
  30691. void 0 !== c
  30692. ? n.call(e, t, i, r, o, a, l, c, h, u)
  30693. : ((c = o),
  30694. (h = a),
  30695. (u = l),
  30696. (o = u.naturalWidth),
  30697. (a = u.naturalHeight),
  30698. n.call(e, t, i, r, c, h, u));
  30699. var f = this.textures[d.id];
  30700. (f.width = p === s.TextureCube ? 6 * o : o), (f.height = a);
  30701. }.bind(this);
  30702. var r = e.deleteTexture;
  30703. e.deleteTexture = function (t) {
  30704. delete this.textures[t.id], r.call(e, t);
  30705. }.bind(this);
  30706. }),
  30707. (n.prototype.updateTextureMemory = (function () {
  30708. var e = null;
  30709. return function () {
  30710. var t = 0;
  30711. for (var i in this.textures) {
  30712. var n = this.textures[i];
  30713. n.width && n.height && (t += n.width * n.height * 4);
  30714. }
  30715. t !== e && this.emit(a.MemoryUsageUpdated, t), (e = t);
  30716. };
  30717. })()),
  30718. (n.prototype.getTextureTypeFromTarget = function (e, t) {
  30719. switch (t) {
  30720. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  30721. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  30722. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  30723. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  30724. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  30725. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  30726. return s.TextureCube;
  30727. case e.TEXTURE_2D:
  30728. return s.Texture2D;
  30729. default:
  30730. return null;
  30731. }
  30732. }),
  30733. (n.prototype.initComposer = function () {
  30734. (this.composer = new r.EffectComposer(this.renderer)),
  30735. this.composer.addPass(new r.RenderPass(this.scene, this.camera)),
  30736. //this.composer.addPass(this.effects.hblurPass),
  30737. //this.composer.addPass(this.effects.vblurPass)
  30738. this.composer.addPass(this.effects.transitionMaskPass); //add
  30739. }),
  30740. (n.prototype.setSize = function (e, t, devicePixelRatio) {
  30741. (this.renderWidth = e),
  30742. (this.renderHeight = t),
  30743. (this.effects.aspect = e / t),
  30744. /* this.renderer.setSize(e, t), -----MP */
  30745. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  30746. this.composer.setSize(e, t);
  30747. for (var i = 0; i < this.resizeListeners.length; i++)
  30748. this.resizeListeners[i].setSize(e, t);
  30749. }),
  30750. (n.prototype.render = function () {
  30751. //this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  30752. this.effects.transitionMaskPass.enabled
  30753. ? this.composer.render()
  30754. : this.renderer.render(this.scene, this.camera);
  30755. });
  30756. /******************************************************************************************************徐世廷**********************************************************************/
  30757. var vrPermission = {};
  30758. var vrPermissionCallBack = function (info1, info2) {
  30759. if (info1 == "reset") {
  30760. vrPermission = {};
  30761. } else {
  30762. vrPermission[info1] = info2;
  30763. if (
  30764. Object.keys(vrPermission).length == 2 &&
  30765. (vrPermission.deviceMotion != "granted" ||
  30766. vrPermission.deviceOrientation != "granted")
  30767. ) {
  30768. alert(
  30769. "运动和方向访问失败。这会导致画面视角一直固定。您需要完全关闭此应用,然后再次打开,并允许访问运动与方向。"
  30770. );
  30771. }
  30772. }
  30773. };
  30774. (n.prototype.boluoVrInit = function () {
  30775. console.log("boluoVrInit");
  30776. //webxr.init(this.renderer)
  30777. (this.isHuawei5X = m.detectHUAWEI5X()),
  30778. (this.oldRenderer = this.renderer),
  30779. (this.newRenderer = new this.vrRenderer(
  30780. this.renderer,
  30781. this,
  30782. this.camera
  30783. ));
  30784. window.panoCamera = this.camera;
  30785. var a = this;
  30786. (window._vrEnabled = !1),
  30787. Object.defineProperty(window, "vrEnabled", {
  30788. get: function () {
  30789. return window._vrEnabled;
  30790. },
  30791. set: function (b) {
  30792. //if(webxr.xrType)return webxr.enterVR()
  30793. b = !!b;
  30794. b
  30795. ? ((a.renderer = a.newRenderer),
  30796. window.vrMarkers.forEach(function (a) {
  30797. a.visible = !0;
  30798. }))
  30799. : ((a.renderer = a.oldRenderer),
  30800. window.vrMarkers.forEach(function (a) {
  30801. a.visible = !1;
  30802. })),
  30803. (a.cursor.visible = b),
  30804. a.setSize(window.innerWidth, window.innerHeight),
  30805. (window._vrEnabled = b);
  30806. if (b) {
  30807. setTimeout(function () {
  30808. console.log("orientEnable" + window.orientEnable);
  30809. if (window.vrEnabled && !window.orientEnable) {
  30810. //很可能没能触发陀螺仪事件
  30811. if (m.detectIOS() /* && m.detectSafari() */) {
  30812. var b = m.iosVersion(); //{major: 10, minor: 3, patch: 1}
  30813. console.log("开始获取权限 major" + b.major);
  30814. if (b.major == 12 && b.minor >= 2) {
  30815. if (browser.detectSafari())
  30816. alert(
  30817. "浏览器未能检测到转动。为完整体验VR效果,请打开 “设置” > “Safari” > “隐私和安全” 下的 “运动和方向访问” 开关,然后刷新此页面。"
  30818. );
  30819. else {
  30820. //app??
  30821. alert(
  30822. "浏览器未能检测到转动。请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。"
  30823. );
  30824. }
  30825. } else if (b.major >= 13) {
  30826. if (!window.location.href.includes("https://")) {
  30827. console.log("需要https");
  30828. alert(
  30829. "当前网页下,高于ios12的浏览器版本可能不支持陀螺仪开启。"
  30830. );
  30831. return;
  30832. }
  30833. var hasFailed =
  30834. window.vrPermission &&
  30835. (window.vrPermission.deviceMotion != "granted" ||
  30836. window.vrPermission.deviceOrientation !=
  30837. "granted");
  30838. setTimeout(
  30839. () => {
  30840. //如果使用了alert会阻断这个事件,报以下错requusting device orientation or motion access requires a user gesture
  30841. if (!window.vrEnabled || window.orientEnable)
  30842. return;
  30843. vrPermissionCallBack("reset");
  30844. console.log(window.DeviceMotionEvent);
  30845. if (
  30846. window.DeviceMotionEvent &&
  30847. window.DeviceMotionEvent.requestPermission &&
  30848. typeof window.DeviceMotionEvent
  30849. .requestPermission === "function"
  30850. ) {
  30851. console.log("开始获取权限1");
  30852. ///注意:需要https 本地服务器permissionState会得到denied
  30853. window.DeviceMotionEvent.requestPermission()
  30854. .then((permissionState) => {
  30855. console.log(
  30856. "permissionState1: " + permissionState
  30857. );
  30858. vrPermissionCallBack(
  30859. "deviceMotion",
  30860. permissionState
  30861. );
  30862. })
  30863. .catch(function (e) {
  30864. vrPermissionCallBack("deviceMotion", false);
  30865. console.log(e);
  30866. });
  30867. } else {
  30868. console.log(
  30869. "window.DeviceMotionEvent undefined"
  30870. );
  30871. vrPermissionCallBack("deviceMotion", false);
  30872. }
  30873. if (
  30874. window.DeviceOrientationEvent &&
  30875. window.DeviceOrientationEvent
  30876. .requestPermission &&
  30877. typeof window.DeviceOrientationEvent
  30878. .requestPermission === "function"
  30879. ) {
  30880. console.log("开始获取权限2");
  30881. window.DeviceOrientationEvent.requestPermission()
  30882. .then((permissionState) => {
  30883. console.log(
  30884. "permissionState2: " + permissionState
  30885. );
  30886. vrPermissionCallBack(
  30887. "deviceOrientation",
  30888. permissionState
  30889. );
  30890. })
  30891. .catch(function (e) {
  30892. vrPermissionCallBack(
  30893. "deviceOrientation",
  30894. false
  30895. );
  30896. console.log(e);
  30897. });
  30898. } else {
  30899. console.log(
  30900. "window.DeviceOrientationEvent undefined"
  30901. );
  30902. vrPermissionCallBack(
  30903. "deviceOrientation",
  30904. false
  30905. );
  30906. }
  30907. },
  30908. hasFailed ? 0 : 150
  30909. );
  30910. /* /* setTimeout(function(){
  30911. if(settings.vrEnabled && !window.orientEnable){
  30912. $alert("若画面视角一直固定,您需要完全关闭Safari浏览器,然后再次打开以开启运动和方向访问。")
  30913. }
  30914. },4000) */
  30915. } else
  30916. console.log(
  30917. "陀螺仪未能启用 ios " + b.major + "." + b.minor
  30918. );
  30919. } else {
  30920. //$alert("浏览器未能检测到转动", "请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  30921. }
  30922. } else {
  30923. //已经触发了
  30924. }
  30925. }, 200);
  30926. }
  30927. },
  30928. }),
  30929. this.createCursor(0.5, !1, 1, 16777215, 0);
  30930. var b = {
  30931. setSize: function (b, c) {
  30932. a.camera.aspect = b / c;
  30933. },
  30934. };
  30935. this.resizeListeners.push(b), this.vrLoadingInit();
  30936. }),
  30937. (n.prototype.vrLoadingInit = function () {
  30938. var a = function (camera) {
  30939. var a = this,
  30940. b = new r.RingGeometry(1.3, 1.5, 32, 32, 0, 1.2 * Math.PI),
  30941. c = new r.MeshBasicMaterial({
  30942. color: 4967932,
  30943. side: r.DoubleSide,
  30944. }),
  30945. d = new r.Mesh(b, c);
  30946. (this.mesh = d),
  30947. (d.position.z = -2),
  30948. d.scale.set(0.08, 0.08, 0.08),
  30949. (d.visible = !1),
  30950. camera.add(d),
  30951. //window.player.camera.add(d),
  30952. (a.enabled = !1),
  30953. (this.update = function (b) {
  30954. 1 == a.enabled && (d.rotation.z += 15 * b);
  30955. });
  30956. },
  30957. a = new a(this.camera);
  30958. (window.Loading = a), this.updateListeners.push(a);
  30959. }),
  30960. (n.prototype.createCursor = function (a, b, c, d, e) {
  30961. var g,
  30962. h = new r.SpriteMaterial({
  30963. opacity: c,
  30964. color: d,
  30965. transparent: b,
  30966. map: this.boluoGetTexture("images/cursor.png"),
  30967. needsUpdate: !0,
  30968. side: r.DoubleSide,
  30969. });
  30970. (h.map.offset = new r.Vector2((1 / 17) * e, 0)),
  30971. (h.map.repeat = new r.Vector2(1 / 17, 1)),
  30972. (h.depthTest = !1),
  30973. (h.blending = r.AdditiveBlending),
  30974. (g = new r.Sprite(h)),
  30975. // g.scale.set(a, a, a),
  30976. g.scale.set(0.3, 0.3, 0.3);
  30977. (g.position.z = -2),
  30978. (g.visible = !1),
  30979. (g.name = "cursor"),
  30980. this.camera.add(g),
  30981. this.scene.add(this.camera),
  30982. (this.cursor = g);
  30983. var i = new this.CursorAnimation(this.scene, g, this.camera);
  30984. (this.cursor.triggerTargetEvent = i.triggerTargetEvent),
  30985. this.updateListeners.push(i);
  30986. }),
  30987. (window.orientEnable = 0); //是否能触发deviceorientation
  30988. (n.prototype.CursorAnimation = function (a, b, c) {
  30989. function d() {
  30990. g.orient = r.Math.degToRad(window.orientation || 0);
  30991. }
  30992. function e(a) {
  30993. if (!window.vrEnabled && window.orientEnable) return;
  30994. window.orientEnable || (window.orientEnable = 1);
  30995. var b = r.Math.degToRad(a.alpha),
  30996. c = r.Math.degToRad(a.beta),
  30997. d = r.Math.degToRad(a.gamma);
  30998. if (
  30999. (this.isHuawei5X
  31000. ? (-1e3 === g.alpha && (g.alpha = b),
  31001. -1e3 === g.beta && (g.beta = c),
  31002. -1e3 === g.gamma && (g.gamma = d),
  31003. Math.abs(b - g.alpha) > 0.06 && (g.alpha = b),
  31004. Math.abs(c - g.beta) > 0.006 && (g.beta = c),
  31005. Math.abs(d - g.gamma) > 0.006 && (g.gamma = d))
  31006. : ((g.alpha = b), (g.beta = c), (g.gamma = d)),
  31007. n.vrDebug)
  31008. ) {
  31009. $("#info-device-orientation").css("display", "block");
  31010. var e = "";
  31011. (e += "alpha=(" + g.alpha + ")<BR/>"),
  31012. (e += "beta=(" + g.beta + ")<BR/>"),
  31013. (e += "gamma=" + g.gamma + "<BR/>"),
  31014. (document.getElementById("info-device-orientation").innerHTML =
  31015. e);
  31016. }
  31017. }
  31018. (this.cursor = b),
  31019. (this.raycaster = new r.Raycaster()),
  31020. (this.targetEventObj = {}),
  31021. (this.type = 1),
  31022. (this.tweenFlag = !0);
  31023. var g = this;
  31024. (this.target = c),
  31025. console.log(c.uuid),
  31026. (this.euler = new r.Euler()),
  31027. (this.q0 = new r.Quaternion()),
  31028. (this.q1 = new r.Quaternion(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5))),
  31029. (this.zee = new r.Vector3(0, 0, 1)),
  31030. (this.alpha = -1e3),
  31031. (this.beta = -1e3),
  31032. (this.gamma = -1e3),
  31033. (this.orient = r.Math.degToRad(window.orientation || 0)),
  31034. window.addEventListener("orientationchange", d),
  31035. window.addEventListener("deviceorientation", e),
  31036. (this.setObjectQuaternion = function (a, b, d, e, f) {
  31037. g.euler.set(d, b, -e, "YXZ"),
  31038. a.setFromEuler(g.euler),
  31039. a.multiply(g.q1),
  31040. a.multiply(g.q0.setFromAxisAngle(g.zee, -f)),
  31041. c.updateMatrixWorld();
  31042. }),
  31043. parent !== window &&
  31044. window.addEventListener("message", function (a) {
  31045. var b = JSON.parse(a.data),
  31046. c = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  31047. b &&
  31048. b.alpha &&
  31049. b.beta &&
  31050. b.gamma &&
  31051. (function (a) {
  31052. var c = r.Math.degToRad(b.alpha),
  31053. d = r.Math.degToRad(b.beta),
  31054. e = r.Math.degToRad(b.gamma);
  31055. a
  31056. ? (-1e3 === g.alpha && (g.alpha = c),
  31057. -1e3 === g.beta && (g.beta = d),
  31058. -1e3 === g.gamma && (g.gamma = e),
  31059. Math.abs(c - g.alpha) > 0.06 && (g.alpha = c),
  31060. Math.abs(d - g.beta) > 0.006 && (g.beta = d),
  31061. Math.abs(e - g.gamma) > 0.006 && (g.gamma = e))
  31062. : ((g.alpha = c), (g.beta = d), (g.gamma = e));
  31063. })(c);
  31064. }),
  31065. (this.update = function (a) {
  31066. TWEEN.update();
  31067. if (window.ifTest && window.vrEnabled)
  31068. this.triggerTargetEvent(); //测试时不根据陀螺仪来转向
  31069. else
  31070. window.vrEnabled &&
  31071. (this.setObjectQuaternion(
  31072. this.target.quaternion,
  31073. this.alpha,
  31074. this.beta,
  31075. this.gamma,
  31076. this.orient
  31077. ),
  31078. this.triggerTargetEvent());
  31079. }),
  31080. (this.triggerTargetEvent = function () {
  31081. var a = this.choseObj(),
  31082. b = a ? a.object : void 0;
  31083. (this.targetEventObj.currentObj = b),
  31084. b !== this.targetEventObj.lastObj &&
  31085. (b && this.autoCursorPosition(a),
  31086. 1 === this.type
  31087. ? (this.cursorAnimate && this.cursorAnimate.stop(),
  31088. b &&
  31089. b.enabled &&
  31090. this.startAnimate(
  31091. function () {
  31092. this.clickCallback(b);
  31093. }.bind(this)
  31094. ))
  31095. : this.type,
  31096. (this.targetEventObj.lastObj = b));
  31097. }),
  31098. (this.choseObj = function () {
  31099. this.raycaster.setFromCamera(
  31100. {
  31101. x: 0,
  31102. y: 0,
  31103. },
  31104. c
  31105. );
  31106. var a = (this.raycaster.ray, window.vrMarkers),
  31107. b = this.raycaster.intersectObjects(a);
  31108. if (b.length > 0) return b[0];
  31109. }),
  31110. (this.clickCallback = function (a) {
  31111. this.runTHREEAction(a, "onclick");
  31112. }),
  31113. (this.runTHREEAction = function (a, b) {
  31114. switch (b) {
  31115. case "onclick":
  31116. a._listeners &&
  31117. a._listeners.click &&
  31118. a._listeners.click.forEach(function (a) {
  31119. a();
  31120. });
  31121. break;
  31122. case "onhover":
  31123. a._listeners &&
  31124. a._listeners.hover &&
  31125. a._listeners.hover.forEach(function (a) {
  31126. a();
  31127. });
  31128. break;
  31129. case "onout":
  31130. a._listeners &&
  31131. a._listeners.out &&
  31132. a._listeners.out.forEach(function (a) {
  31133. a();
  31134. });
  31135. }
  31136. }),
  31137. (this.startAnimate = function (a) {
  31138. this.tweenFlag && this.initAnimation(a);
  31139. }),
  31140. (this.initAnimation = function (a) {
  31141. var b = this,
  31142. c = this.cursor.material.map.offset,
  31143. d = function (a) {
  31144. return Math.floor(17 * a) / 17;
  31145. };
  31146. (b.tweenFlag = !1),
  31147. (this.cursorAnimate = new TWEEN.Tween(c)
  31148. .to(
  31149. {
  31150. x: 1,
  31151. },
  31152. 1e3
  31153. )
  31154. .onStart(function () {
  31155. b.tweenFlag = !1;
  31156. })
  31157. .onStop(function () {
  31158. (b.tweenFlag = !0), (this.x = 0), (c.x = 0);
  31159. })
  31160. .onUpdate(function () {})
  31161. .onComplete(function () {
  31162. a(),
  31163. (c.x = 0),
  31164. setTimeout(function () {
  31165. b.tweenFlag = !0;
  31166. }, 1500);
  31167. })),
  31168. this.cursorAnimate.easing(d),
  31169. this.cursorAnimate.start();
  31170. }),
  31171. (this.autoCursorPosition = function (a) {
  31172. // var b = Math.abs(a.distance - 10);
  31173. // this.cursor.position.z = -b,
  31174. // b /= 10;
  31175. // alert(b);
  31176. // this.cursor.scale.set(b, b, b)
  31177. this.cursor.scale.set(0.3, 0.3, 0.3);
  31178. });
  31179. }),
  31180. (n.prototype.vrRenderer = function (a, b, c) {
  31181. var d = new b.vrCamera(c);
  31182. (d.bananaAspect = 0.8), this.width, this.height;
  31183. var b = this;
  31184. (this.setSize = function (c, d) {
  31185. a.setSize.call(this, c, d), (b.width = c), (b.height = d);
  31186. }),
  31187. (this.render = function (b, c, e, f) {
  31188. window.cameraQua = c.quaternion.clone();
  31189. var g, h;
  31190. if (c.__RESS__SKIP__STEREO__) return a.render(b, c, e, f);
  31191. if ("PerspectiveCamera" === c.type)
  31192. (g = d.cameraL),
  31193. (h = d.cameraR),
  31194. b.updateMatrixWorld(),
  31195. null === c.parent && c.updateMatrixWorld(),
  31196. d.vrCameraUpdate(c);
  31197. else {
  31198. if ("OrthographicCamera" !== c.type)
  31199. return (
  31200. DEBUG && console.error("Unsupported renderer: ", c.type)
  31201. );
  31202. g = h = c;
  31203. }
  31204. a.setScissorTest(!0),
  31205. a.setScissor(0, 0, this.width / 2, this.height),
  31206. a.setViewport(0, 0, this.width / 2, this.height),
  31207. a.render.call(this, b, g, e, f),
  31208. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  31209. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  31210. a.render.call(this, b, h, e, f),
  31211. a.setScissorTest(!1);
  31212. }),
  31213. (this.__proto__ = {
  31214. __proto__: a,
  31215. });
  31216. }),
  31217. (n.prototype.vrCamera = function (a) {
  31218. (this.type = "StereoCamera"),
  31219. (this._aspect = 1),
  31220. (this._overlap = 0.064),
  31221. (this.cameraL = new r.PerspectiveCamera()),
  31222. this.cameraL.layers.enable(1),
  31223. (this.cameraL.near = 0.01), //xzw add
  31224. (this.cameraL.matrixAutoUpdate = !1),
  31225. (this.cameraR = new r.PerspectiveCamera()),
  31226. this.cameraR.layers.enable(2),
  31227. (this.cameraR.near = 0.01), //xzw add
  31228. (this.cameraR.matrixAutoUpdate = !1),
  31229. (this.eyeRight = new r.Matrix4()),
  31230. (this.eyeLeft = new r.Matrix4()),
  31231. (this.vrCameraNeedsUpdate = !0),
  31232. (window.vrCameraL = this.cameraL); // fyz 记录vr相机
  31233. Object.defineProperty(this, "bananaAspect", {
  31234. get: function () {
  31235. return this._aspect;
  31236. },
  31237. set: function (a) {
  31238. this._aspect !== a && (this.vrCameraNeedsUpdate = !0),
  31239. (this._aspect = a);
  31240. },
  31241. }),
  31242. Object.defineProperty(this, "overlap", {
  31243. get: function () {
  31244. return this._overlap;
  31245. },
  31246. set: function (a) {
  31247. this._overlap !== a && (this.vrCameraNeedsUpdate = !0),
  31248. (this._overlap = a);
  31249. },
  31250. }),
  31251. (this.vrCameraUpdate = function (a) {
  31252. this.vrCameraNeedsUpdate = true;
  31253. if (
  31254. ((this.vrCameraNeedsUpdate =
  31255. this.vrCameraNeedsUpdate ||
  31256. this.bananaFov !== a.fov ||
  31257. this.bananaReal_aspect !== a.aspect * this.bananaAspect ||
  31258. this.bananaNear !== a.near ||
  31259. this.bananaFar !== a.far),
  31260. this.vrCameraNeedsUpdate)
  31261. ) {
  31262. (this.vrCameraNeedsUpdate = !1),
  31263. //console.debug("vrCameraUpdate"),
  31264. (this.bananaFocus = a.focus),
  31265. (this.bananaFov = a.fov),
  31266. (this.bananaReal_aspect = a.aspect * this.bananaAspect),
  31267. (this.bananaNear = a.near),
  31268. (this.bananaFar = a.far),
  31269. //console.debug(a.aspect),
  31270. (this.bananaFocus = 10);
  31271. var b,
  31272. c,
  31273. d = a.projectionMatrix.clone(),
  31274. e = this.overlap / 2,
  31275. f = (e * this.bananaNear) / this.bananaFocus,
  31276. g =
  31277. this.bananaNear *
  31278. Math.tan((Math.PI / 180) * this.bananaFov * 0.5);
  31279. (this.eyeLeft.elements[12] = -e),
  31280. (this.eyeRight.elements[12] = e),
  31281. (b = -g * this.bananaReal_aspect + f),
  31282. (c = g * this.bananaReal_aspect + f),
  31283. (d.elements[0] = (2 * this.bananaNear) / (c - b)),
  31284. (d.elements[8] = (c + b) / (c - b)),
  31285. this.cameraL.projectionMatrix.copy(d),
  31286. (b = -g * this.bananaReal_aspect - f),
  31287. (c = g * this.bananaReal_aspect - f),
  31288. (d.elements[0] = (2 * this.bananaNear) / (c - b)),
  31289. (d.elements[8] = (c + b) / (c - b)),
  31290. this.cameraR.projectionMatrix.copy(d);
  31291. }
  31292. this.cameraL.matrixWorld
  31293. .copy(a.matrixWorld)
  31294. .multiply(this.eyeLeft),
  31295. this.cameraR.matrixWorld
  31296. .copy(a.matrixWorld)
  31297. .multiply(this.eyeRight);
  31298. });
  31299. }),
  31300. (n.prototype.boluoGetTexture = function (a) {
  31301. var b = new r.TextureLoader();
  31302. return (b.crossOrigin = "anonymous"), b.load(a);
  31303. });
  31304. /* let webxr = {
  31305. init(renderer) {
  31306. this.renderer = renderer
  31307. renderer.xr = new THREE.WebXRManager(renderer, renderer.getContext());
  31308. renderer.xr.enabled = true
  31309. if ('xr' in navigator && 'isSessionSupported' in navigator.xr) {
  31310. //pico firefox
  31311. var mode = 'immersive-vr'
  31312. navigator.xr
  31313. .isSessionSupported(mode)
  31314. .then(supported => {
  31315. if (!supported) {
  31316. this.xrNotFound('isSessionSupported not supported')
  31317. } else {
  31318. this.xrType = 'xr' //showEnterXR();
  31319. }
  31320. })
  31321. .catch(this.xrNotFound.bind(this, 'isSessionSupported error'))
  31322. } else if ('getVRDisplays' in navigator) {
  31323. //pico 的vr browser是这个
  31324. console.log('getVRDisplays')
  31325. let setDevice = device => {
  31326. this.xrType = 'vr'
  31327. this.device = device
  31328. this.renderer.xr.setDevice(device) //新版是renderer.vr
  31329. }
  31330. window.addEventListener(
  31331. 'vrdisplayconnect',
  31332. function (event) {
  31333. setDevice(event.display)
  31334. },
  31335. false
  31336. )
  31337. window.addEventListener(
  31338. 'vrdisplaydisconnect',
  31339. function ( ) {
  31340. console.log('vrdisplaydisconnect')
  31341. window.bus.dispatchEvent({type:'exitWebXR'})
  31342. },
  31343. false
  31344. )
  31345. window.addEventListener(
  31346. 'vrdisplaypresentchange',
  31347. function (event) {
  31348. console.log('vrdisplaypresentchange', event.display.isPresenting ? 'EXIT VR' : 'ENTER VR')
  31349. event.display.isPresenting || window.bus.dispatchEvent({type:'exitWebXR'})
  31350. },
  31351. false
  31352. )
  31353. window.addEventListener(
  31354. 'vrdisplayactivate',
  31355. function (event) {
  31356. event.display.requestPresent([{ source: this.renderer.domElement }])
  31357. },
  31358. false
  31359. )
  31360. navigator
  31361. .getVRDisplays()
  31362. .then(function (displays) {
  31363. if (displays.length > 0) {
  31364. setDevice(displays[0])
  31365. } else {
  31366. this.xrNotFound('no displays')
  31367. }
  31368. })
  31369. .catch(this.xrNotFound.bind(this, 'getVRDisplays error'))
  31370. } else {
  31371. this.xrNotFound('xr not supported')
  31372. }
  31373. },
  31374. enterVR() {
  31375. if (!this.xrType) return //不支持
  31376. console.log('enterVR', this.xrType)
  31377. if (this.xrType == 'vr') {
  31378. this.device.isPresenting ? this.device.exitPresent() : this.device.requestPresent([{ source: renderer.domElement }])
  31379. } else if (this.xrType == 'xr') {
  31380. if (this.currentSession == void 0) {
  31381. console.log('this.currentSession == void 0 ')
  31382. function getXRSessionInit(mode, options) {
  31383. var space = (options || {}).referenceSpaceType || 'local-floor'
  31384. var sessionInit = (options && options.sessionInit) || {}
  31385. // Nothing to do for default features.
  31386. if (space == 'viewer') return sessionInit
  31387. if (space == 'local' && mode.startsWith('immersive')) return sessionInit
  31388. // If the user already specified the space as an optional or required feature, don't do anything.
  31389. if (sessionInit.optionalFeatures && sessionInit.optionalFeatures.includes(space)) return sessionInit
  31390. if (sessionInit.requiredFeatures && sessionInit.requiredFeatures.includes(space)) return sessionInit
  31391. // The user didn't request the reference space type as a feature. Add it to a shallow copy
  31392. // of the user-supplied sessionInit requiredFeatures (if any) to ensure it's valid to
  31393. // request it later.
  31394. var newInit = Object.assign({}, sessionInit)
  31395. newInit.requiredFeatures = [space]
  31396. if (sessionInit.requiredFeatures) {
  31397. newInit.requiredFeatures = newInit.requiredFeatures.concat(sessionInit.requiredFeatures)
  31398. }
  31399. return newInit
  31400. }
  31401. let onSessionEnded = ( ) => {
  31402. console.log('onSessionEnded')
  31403. this.currentSession.removeEventListener('end', onSessionEnded)
  31404. setTimeout(()=>{
  31405. this.renderer.xr.setSession(null)
  31406. this.currentSession = null
  31407. window.bus.dispatchEvent({type:'exitWebXR'})
  31408. },1)//延迟原因:先使THREE里的onSessionEnded执行
  31409. }
  31410. let onSessionStarted = session => {
  31411. console.log('onSessionStarted')
  31412. session.addEventListener('end', onSessionEnded)
  31413. this.renderer.xr.setSession(session)
  31414. this.currentSession = session
  31415. }
  31416. var mode = 'immersive-vr'
  31417. var sessionInit = getXRSessionInit(mode)
  31418. navigator.xr.requestSession(mode, sessionInit).then(onSessionStarted)
  31419. } else {
  31420. console.log('this.currentSession.end()', this.currentSession)
  31421. this.currentSession.end()
  31422. }
  31423. }
  31424. },
  31425. xrNotFound(text) {
  31426. console.log('xrNotFound:', text)
  31427. },
  31428. } */
  31429. /***********************************************************************************************************************************************************************************/
  31430. (n.prototype.updateScreenSize = (function () {
  31431. //xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  31432. var W, H; //当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  31433. return function (o) {
  31434. var render = false;
  31435. var ratio;
  31436. var w, h; //记录应当render的大小
  31437. if (o && !o.resize && o.width != void 0 && o.height != void 0) {
  31438. (w = o.width), (h = o.height), (render = true), (ratio = 1);
  31439. } else {
  31440. w = $("#player").width();
  31441. h = $("#player").height();
  31442. o &&
  31443. o.resize &&
  31444. ((W = this.renderWidth), (H = this.renderHeight));
  31445. (w !== W || h !== H || this.forceUpdateSize) &&
  31446. ((W = w),
  31447. (H = h),
  31448. (render = true),
  31449. (ratio = window.devicePixelRatio));
  31450. }
  31451. if (render) {
  31452. this.setSize(w, h, ratio);
  31453. this.forceUpdateSize = !1;
  31454. }
  31455. };
  31456. })()),
  31457. (n.prototype.updateComponents = function () {
  31458. for (
  31459. var e = Math.min(1, this.updateClock.getDelta()), t = 0;
  31460. t < this.updateListeners.length;
  31461. t++
  31462. )
  31463. this.updateListeners[t].update(e);
  31464. }),
  31465. (n.prototype.suspend = function () {
  31466. (this.started = !1),
  31467. (this.suspendedObjects = this.scene.children.map(
  31468. function (e) {
  31469. return this.scene.remove(e), e;
  31470. }.bind(this)
  31471. )),
  31472. this.render();
  31473. }),
  31474. (n.prototype.resume = function () {
  31475. this.suspendedObjects.forEach(
  31476. function (e) {
  31477. this.scene.add(e);
  31478. }.bind(this)
  31479. ),
  31480. (this.suspendedObjects = []),
  31481. (this.started = !0),
  31482. p();
  31483. });
  31484. var p = function () {
  31485. this.started &&
  31486. (window.requestAnimationFrame(p),
  31487. this.updateScreenSize(), // fyz resize
  31488. this.updateComponents(),
  31489. this.updateTextureMemory(),
  31490. this.render(),
  31491. window.stats && (window.fps = stats.update()),
  31492. this.emit(a.AfterRender));
  31493. };
  31494. (n.prototype.getImageData = (function () {
  31495. var e = document.createElement("canvas"),
  31496. t = e.getContext("2d");
  31497. return function (i, n, r) {
  31498. return (
  31499. (e.width === n && e.height === r) ||
  31500. ((e.width = n), (e.height = r)),
  31501. t.drawImage(i, 0, 0, n, r),
  31502. t.getImageData(0, 0, n, r)
  31503. );
  31504. };
  31505. })()),
  31506. (n.prototype.initSizedTexture2D = function (e, t, i) {
  31507. var n = this.renderer,
  31508. o = n.context,
  31509. a = n.state,
  31510. s = new r.Texture(null);
  31511. (s.flipY = !1), i !== !0 && (i = !1), (s.generateMipmaps = i);
  31512. var l = n.paramThreeToGL(s.format),
  31513. c = n.paramThreeToGL(s.type),
  31514. h = n.properties.get(s),
  31515. u = o.createTexture();
  31516. a.bindTexture(o.TEXTURE_2D, u),
  31517. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  31518. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  31519. (s.wrapS = t),
  31520. (s.wrapT = t);
  31521. var d = n.paramThreeToGL(t);
  31522. return (
  31523. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  31524. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  31525. i
  31526. ? ((s.magFilter = r.LinearFilter),
  31527. (s.minFilter = r.LinearMipMapLinearFilter),
  31528. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  31529. o.texParameteri(
  31530. o.TEXTURE_2D,
  31531. o.TEXTURE_MIN_FILTER,
  31532. o.LINEAR_MIPMAP_NEAREST
  31533. ),
  31534. o.generateMipmap(o.TEXTURE_2D))
  31535. : ((s.magFilter = r.LinearFilter),
  31536. (s.minFilter = r.LinearFilter),
  31537. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  31538. o.texParameteri(
  31539. o.TEXTURE_2D,
  31540. o.TEXTURE_MIN_FILTER,
  31541. o.LINEAR
  31542. )),
  31543. a.bindTexture(o.TEXTURE_2D, null),
  31544. (h.__webglTexture = u),
  31545. s
  31546. );
  31547. }),
  31548. (n.prototype.initSizedCubeMap = function (e, t) {
  31549. var i = this.renderer,
  31550. n = i.context,
  31551. o = i.state,
  31552. a = new r.CubeTexture([null, null, null, null, null, null]);
  31553. (a.flipY = !1), (a.generateMipmaps = t);
  31554. var s = i.paramThreeToGL(a.format),
  31555. l = i.paramThreeToGL(a.type),
  31556. c = i.properties.get(a),
  31557. h = n.createTexture();
  31558. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  31559. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  31560. for (var u = 0; u < 6; u++)
  31561. n.texImage2D(
  31562. n.TEXTURE_CUBE_MAP_POSITIVE_X + u,
  31563. 0,
  31564. s,
  31565. e,
  31566. e,
  31567. 0,
  31568. s,
  31569. l,
  31570. null
  31571. );
  31572. return (
  31573. t
  31574. ? ((a.magFilter = r.LinearFilter),
  31575. (a.minFilter = r.LinearMipMapLinearFilter),
  31576. n.texParameteri(
  31577. n.TEXTURE_CUBE_MAP,
  31578. n.TEXTURE_MAG_FILTER,
  31579. n.LINEAR
  31580. ),
  31581. n.texParameteri(
  31582. n.TEXTURE_CUBE_MAP,
  31583. n.TEXTURE_MIN_FILTER,
  31584. n.LINEAR_MIPMAP_LINEAR
  31585. ),
  31586. n.texParameteri(
  31587. n.TEXTURE_CUBE_MAP,
  31588. n.GENERATE_MIPMAP,
  31589. n.TRUE
  31590. ),
  31591. n.generateMipmap(n.TEXTURE_CUBE_MAP))
  31592. : ((a.magFilter = r.LinearFilter),
  31593. (a.minFilter = r.LinearFilter),
  31594. n.texParameteri(
  31595. n.TEXTURE_CUBE_MAP,
  31596. n.TEXTURE_MAG_FILTER,
  31597. n.LINEAR
  31598. ),
  31599. n.texParameteri(
  31600. n.TEXTURE_CUBE_MAP,
  31601. n.TEXTURE_MIN_FILTER,
  31602. n.LINEAR
  31603. )),
  31604. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  31605. (c.__image__webglTextureCube = h),
  31606. a
  31607. );
  31608. }),
  31609. (n.prototype.deallocateCubeTexture = function (e) {
  31610. var t = this.renderer,
  31611. i = t.context,
  31612. n = t.properties.get(e);
  31613. i.deleteTexture(n.__image__webglTextureCube);
  31614. }),
  31615. (n.prototype.uploadTexture2D = function (e, t, i, n, r, o) {
  31616. var a = this.renderer,
  31617. s = a.context,
  31618. l = a.state,
  31619. c = a.properties.get(t);
  31620. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  31621. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  31622. s.pixelStorei(
  31623. s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,
  31624. t.premultiplyAlpha
  31625. ),
  31626. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  31627. s.texParameteri(
  31628. s.TEXTURE_2D,
  31629. s.TEXTURE_WRAP_S,
  31630. a.paramThreeToGL(t.wrapS)
  31631. ),
  31632. s.texParameteri(
  31633. s.TEXTURE_2D,
  31634. s.TEXTURE_WRAP_T,
  31635. a.paramThreeToGL(t.wrapT)
  31636. ),
  31637. s.texParameteri(
  31638. s.TEXTURE_2D,
  31639. s.TEXTURE_MAG_FILTER,
  31640. a.paramThreeToGL(t.magFilter)
  31641. ),
  31642. s.texParameteri(
  31643. s.TEXTURE_2D,
  31644. s.TEXTURE_MIN_FILTER,
  31645. a.paramThreeToGL(t.minFilter)
  31646. ),
  31647. s.texSubImage2D(
  31648. s.TEXTURE_2D,
  31649. 0,
  31650. i,
  31651. n,
  31652. s.RGBA,
  31653. s.UNSIGNED_BYTE,
  31654. e
  31655. ),
  31656. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  31657. l.bindTexture(s.TEXTURE_2D, null);
  31658. }),
  31659. (n.prototype.uploadTexture3D = function (e, t, i, n, r, o, a) {
  31660. var s = this.renderer,
  31661. l = s.context,
  31662. c = s.state,
  31663. h = s.properties.get(t);
  31664. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  31665. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  31666. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  31667. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  31668. c.bindTexture(l.TEXTURE_CUBE_MAP, null);
  31669. }),
  31670. (n.prototype.rebuildMipMaps2D = function (e) {
  31671. var t = this.renderer,
  31672. i = t.context,
  31673. n = t.state;
  31674. t.properties.get(e);
  31675. i.generateMipmap(i.TEXTURE_2D), n.bindTexture(i.TEXTURE_2D, null);
  31676. }),
  31677. (n.prototype.rebuildMipMaps3D = function (e) {
  31678. var t = this.renderer,
  31679. i = t.context,
  31680. n = t.state,
  31681. r = t.properties.get(e);
  31682. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  31683. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  31684. n.bindTexture(i.TEXTURE_CUBE_MAP, null);
  31685. }),
  31686. (n.prototype.renderToCubeMap = (function () {
  31687. var e = !1,
  31688. t = null,
  31689. i = null,
  31690. n = null,
  31691. a = null,
  31692. s = null,
  31693. l = 1;
  31694. return function (c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  31695. var _ = this.renderer;
  31696. _.context;
  31697. e ||
  31698. ((i = new r.OrthographicCamera(
  31699. l / -2,
  31700. l / 2,
  31701. l / 2,
  31702. l / -2,
  31703. -200,
  31704. 200
  31705. )),
  31706. (i.position.z = 150),
  31707. (t = new r.Scene()),
  31708. t.add(i),
  31709. (n = new r.ShaderMaterial({
  31710. uniforms: {
  31711. tDiffuse: {
  31712. type: "t",
  31713. value: null,
  31714. },
  31715. alpha: {
  31716. type: "f",
  31717. value: 1,
  31718. },
  31719. },
  31720. vertexShader: o.basicTextured.vertexShader,
  31721. fragmentShader: o.basicTextured.fragmentShader,
  31722. depthWrite: !1,
  31723. depthTest: !1,
  31724. side: r.DoubleSide,
  31725. })),
  31726. (a = new r.PlaneBufferGeometry(l, l)),
  31727. (s = new r.Mesh(a, n)),
  31728. (s.position.z = 0),
  31729. t.add(s),
  31730. (e = !0));
  31731. var T = a.getAttribute("uv");
  31732. T.setDynamic(!0), (T.needsUpdate = !0);
  31733. var x = T.array,
  31734. S = p / u,
  31735. M = f / d,
  31736. R = g / u,
  31737. P = m / d;
  31738. (x[0] = S),
  31739. (x[1] = M + P),
  31740. (x[2] = S + R),
  31741. (x[3] = M + P),
  31742. (x[4] = S),
  31743. (x[5] = M),
  31744. (x[6] = S + R),
  31745. (x[7] = M);
  31746. var O = a.getAttribute("position");
  31747. O.setDynamic(!0), (O.needsUpdate = !0);
  31748. var L = O.array,
  31749. D = v / h.width - l / 2,
  31750. N = A / h.height - l / 2,
  31751. B = y / h.width,
  31752. F = C / h.height;
  31753. (L[0] = D),
  31754. (L[1] = N + F),
  31755. (L[3] = D + B),
  31756. (L[4] = N + F),
  31757. (L[6] = D),
  31758. (L[7] = N),
  31759. (L[9] = D + B),
  31760. (L[10] = N);
  31761. this.renderer.properties.get(c);
  31762. (n.uniforms.tDiffuse.value = c),
  31763. (n.blending = E || r.NoBlending),
  31764. (n.transparent = !!b),
  31765. (void 0 !== w && null !== w) || (w = 1),
  31766. (n.uniforms.alpha.value = w),
  31767. (n.needUpdate = !0),
  31768. (h.activeCubeFace = I),
  31769. h.viewport.set(0, 0, h.width, h.height);
  31770. var V = this.renderer.autoClear;
  31771. (this.renderer.autoClear = !1),
  31772. this.renderer.render(t, i, h, !1),
  31773. (this.renderer.autoClear = V);
  31774. };
  31775. })()),
  31776. (n.prototype.copyCubeMap = (function () {
  31777. var e = !1,
  31778. t = null,
  31779. i = null,
  31780. a = null,
  31781. s = null,
  31782. l = null,
  31783. c = new r.Euler();
  31784. new r.Vector3();
  31785. return function (h, u, d, p, f, g, m, v, A) {
  31786. if (f > this.qualityManager.maxRenderTargetSize) return; //add
  31787. this.renderer;
  31788. if (!e) {
  31789. var y = 2;
  31790. (i = new r.OrthographicCamera(
  31791. y / -2,
  31792. y / 2,
  31793. y / 2,
  31794. y / -2,
  31795. 0,
  31796. 200
  31797. )),
  31798. i.position.set(0, 0, 0),
  31799. (t = new r.Scene()),
  31800. t.add(i),
  31801. (a = new r.ShaderMaterial({
  31802. uniforms: {
  31803. tDiffuse: {
  31804. type: "t",
  31805. value: null,
  31806. },
  31807. alpha: {
  31808. type: "f",
  31809. value: 1,
  31810. },
  31811. },
  31812. vertexShader: o.copyCubeMap.vertexShader,
  31813. fragmentShader: o.copyCubeMap.fragmentShader,
  31814. depthWrite: !1,
  31815. depthTest: !1,
  31816. side: r.DoubleSide,
  31817. })),
  31818. (s = new r.BoxGeometry(y, y, y)),
  31819. (l = new r.Mesh(s, a)),
  31820. t.add(l),
  31821. (e = !0);
  31822. }
  31823. for (var C = 0; C < 6; C++)
  31824. n.getCubeOrientationForCubeFace(C, c),
  31825. l.rotation.copy(c),
  31826. (l.matrixWorldNeedsUpdate = !0),
  31827. l.updateMatrixWorld(),
  31828. (a.uniforms.tDiffuse.value = h),
  31829. (a.blending = m || r.NoBlending),
  31830. (a.transparent = !!v),
  31831. (void 0 !== A && null !== A) || (A = 1),
  31832. (a.uniforms.alpha.value = A),
  31833. (a.needUpdate = !0),
  31834. (u.activeCubeFace = C),
  31835. u.viewport.set(0, 0, f, g),
  31836. this.renderer.render(t, i, u, !1);
  31837. };
  31838. })()),
  31839. (n.getLookAtForCubeFace = function (e, t) {
  31840. switch (e) {
  31841. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  31842. t.set(1, 0, 0);
  31843. break;
  31844. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  31845. t.set(-1, 0, 0);
  31846. break;
  31847. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  31848. t.set(0, 1, 0);
  31849. break;
  31850. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  31851. t.set(0, -1, 0);
  31852. break;
  31853. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  31854. t.set(0, 0, 1);
  31855. break;
  31856. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  31857. t.set(0, 0, -1);
  31858. }
  31859. }),
  31860. (n.getCubeOrientationForCubeFace = function (e, t) {
  31861. switch (e) {
  31862. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  31863. t.set(0, -Math.PI / 2, 0);
  31864. break;
  31865. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  31866. t.set(0, Math.PI / 2, 0);
  31867. break;
  31868. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  31869. t.set(Math.PI / 2, Math.PI, 0);
  31870. break;
  31871. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  31872. t.set(-Math.PI / 2, Math.PI, 0);
  31873. break;
  31874. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  31875. t.set(0, -Math.PI, 0);
  31876. break;
  31877. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  31878. t.set(0, 0, 0);
  31879. }
  31880. }),
  31881. (t.exports = n);
  31882. },
  31883. {
  31884. "../enum/GLCubeFaces": 25,
  31885. "../enum/GLTextureType": 26,
  31886. "../enum/SceneRendererEvents": 43,
  31887. "../exception/BasicException": 55,
  31888. "../exception/RendererCreationException": 57,
  31889. "../settings": 166,
  31890. "../shaders": 167,
  31891. /********************************************************************fyz改 from徐世廷**********************************************************************/
  31892. "../util/browser": 182,
  31893. /************************************************************************************************************************************************/
  31894. events: 202,
  31895. three: 217,
  31896. },
  31897. ],
  31898. 159: [
  31899. function (e, t, i) {
  31900. "use strict";
  31901. function n(e) {
  31902. (this.messenger = new a(e)), (this.clientKey = null);
  31903. }
  31904. var r = e("../util/ajax"),
  31905. o = e("./PostMessageType"),
  31906. a = e("./postmessage"),
  31907. s = e("./VersionInfo"),
  31908. l = e("events").EventEmitter,
  31909. c = window.location.origin + "/api/v1/user/";
  31910. (n.prototype = Object.create(l.prototype)),
  31911. (n.prototype.bindEvents = function () {
  31912. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this));
  31913. }),
  31914. (n.prototype.waitForConnection = function () {
  31915. var e = new Promise(
  31916. function (e, t) {
  31917. this.messenger.on(
  31918. o.CONNECT,
  31919. function (i) {
  31920. this.onConnectionReceived(i).then(
  31921. e.bind(this, i.sdkVersion),
  31922. t.bind()
  31923. );
  31924. }.bind(this)
  31925. );
  31926. }.bind(this)
  31927. );
  31928. return e;
  31929. }),
  31930. (n.prototype.onConnectionReceived = function (e) {
  31931. return (
  31932. this.messenger.setTarget(e.source, e.origin),
  31933. this.verifyConnection(e).then(
  31934. function (t, i) {
  31935. this.messenger.send({
  31936. type: o.ACCEPT,
  31937. toId: e.fromId,
  31938. warning: i,
  31939. }),
  31940. (this.clientKey = t),
  31941. this.messenger.removeAllListeners(o.CONNECT),
  31942. this.bindEvents();
  31943. }.bind(this),
  31944. function (t) {
  31945. this.messenger.send({
  31946. type: o.REJECT,
  31947. toId: e.fromId,
  31948. reason: t,
  31949. }),
  31950. this.messenger.setTarget();
  31951. }.bind(this)
  31952. )
  31953. );
  31954. }),
  31955. (n.prototype.verifyConnection = function (e) {
  31956. return new Promise(function (t, i) {
  31957. var n;
  31958. if (s.isDeprecated(e.sdkVersion)) n = "这个版本正在被弃用";
  31959. else if (!s.isSupported(e.sdkVersion))
  31960. return i("不支持此版本的SDK");
  31961. var o = {
  31962. cache: !1,
  31963. headers: {
  31964. "X-port-Application-Key": e.applicationKey,
  31965. "X-port-Referrer": e.origin,
  31966. },
  31967. };
  31968. r.get(c, o)
  31969. .done(t.bind(this, e.applicationKey, n))
  31970. .fail(i.bind(this, "key/referrer mismatch"));
  31971. });
  31972. }),
  31973. (n.prototype.onMessageReceived = function (e) {
  31974. if (this.validateClientApplicationKey(e.applicationKey)) {
  31975. var t = this;
  31976. (e.onDone = function (i) {
  31977. (i.toId = e.fromId),
  31978. (i.uid = e.uid),
  31979. (i.type = o.RESPONSE),
  31980. t.messenger.send(i);
  31981. }),
  31982. this.emit(o.ACTION, e);
  31983. }
  31984. }),
  31985. (n.prototype.validateClientApplicationKey = function (e) {
  31986. return this.clientKey === e;
  31987. }),
  31988. (n.prototype.sendEvent = function (e, t) {
  31989. this.messenger.send({
  31990. type: o.EVENT,
  31991. eventType: e,
  31992. eventData: t,
  31993. });
  31994. }),
  31995. (t.exports = n);
  31996. },
  31997. {
  31998. "../util/ajax": 181,
  31999. "./PostMessageType": 160,
  32000. "./VersionInfo": 163,
  32001. "./postmessage": 165,
  32002. events: 202,
  32003. },
  32004. ],
  32005. 160: [
  32006. function (e, t, i) {
  32007. "use strict";
  32008. t.exports = Object.freeze({
  32009. CONNECT: "postmessage.connect",
  32010. ACCEPT: "postmessage.accept",
  32011. REJECT: "postmessage.reject",
  32012. ACTION: "postmessage.action",
  32013. RESPONSE: "postmessage.response",
  32014. EVENT: "postmessage.event",
  32015. });
  32016. },
  32017. {},
  32018. ],
  32019. 161: [
  32020. function (e, t, i) {
  32021. "use strict";
  32022. t.exports = Object.freeze({
  32023. MOVE: "sdk.move",
  32024. ENTER_PANO: "sdk.enterpano",
  32025. MODEL_LOADED: "sdk.modelloaded",
  32026. });
  32027. },
  32028. {},
  32029. ],
  32030. 162: [
  32031. function (e, t, i) {
  32032. "use strict";
  32033. t.exports = Object.freeze({
  32034. FLY: "transition.fly",
  32035. FADEOUT: "transition.fade",
  32036. INSTANT: "transition.instant",
  32037. });
  32038. },
  32039. {},
  32040. ],
  32041. 163: [
  32042. function (e, t, i) {
  32043. "use strict";
  32044. t.exports = {
  32045. current: "1.0",
  32046. supported: ["1.0"],
  32047. deprecated: [],
  32048. isSupported: function (e) {
  32049. return this.supported.indexOf(e) !== -1;
  32050. },
  32051. isDeprecated: function (e) {
  32052. return this.deprecated.indexOf(e) !== -1;
  32053. },
  32054. isValid: function (e) {
  32055. return this.isSupported(e) || this.isDeprecated(e);
  32056. },
  32057. };
  32058. },
  32059. {},
  32060. ],
  32061. 164: [
  32062. function (e, t, i) {
  32063. (function (i) {
  32064. "use strict";
  32065. function n(e, t, i) {
  32066. e && (e = e.toLowerCase().trim());
  32067. var n = new I.UP.clone(),
  32068. r = Math.PI / 3,
  32069. o = Math.PI / 2;
  32070. switch (e) {
  32071. case "left":
  32072. i.copy(t), i.applyAxisAngle(n, o);
  32073. break;
  32074. case "right":
  32075. i.copy(t), i.applyAxisAngle(n, -o);
  32076. break;
  32077. case "forwardleft":
  32078. i.copy(t), i.applyAxisAngle(n, r);
  32079. break;
  32080. case "forwardright":
  32081. i.copy(t), i.applyAxisAngle(n, -r);
  32082. break;
  32083. case "forward":
  32084. default:
  32085. i.copy(t);
  32086. }
  32087. return i;
  32088. }
  32089. function r(e, t) {
  32090. if (e) {
  32091. var i = {
  32092. pano: e,
  32093. lookAtPoint: null,
  32094. duration: null,
  32095. maxDistanceOverride: null,
  32096. skipWarpingCheck: !1,
  32097. };
  32098. this.player.flyToPano(i, function () {
  32099. t &&
  32100. t({
  32101. success: !0,
  32102. message: "Transition complete.",
  32103. });
  32104. });
  32105. } else
  32106. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  32107. t &&
  32108. t({
  32109. success: !1,
  32110. error: "Unable to find pano.",
  32111. });
  32112. }
  32113. function o(e, t) {
  32114. var i = this.findRankedPano(e, t);
  32115. return i >= 0
  32116. ? this.handleToObject[i]
  32117. : (R.warn(
  32118. "Showcase -> findRankedPanoObject: Unable to find nearby pano."
  32119. ),
  32120. null);
  32121. }
  32122. function a(e, t) {
  32123. var i = this.findRankedtag(e, t);
  32124. return i >= 0
  32125. ? this.handleToObject[i]
  32126. : (R.warn(
  32127. "Showcase -> findRankedtagObject: Unable to find nearby tag."
  32128. ),
  32129. null);
  32130. }
  32131. function s(e, t) {
  32132. t.copy(I.FORWARD), e.getDirection(t);
  32133. }
  32134. function l(e) {
  32135. function t(e) {
  32136. var t = new c.Euler().setFromQuaternion(e.quaternion, "YXZ");
  32137. return {
  32138. x: c.Math.radToDeg(t._x),
  32139. y: c.Math.radToDeg(t._y),
  32140. z: c.Math.radToDeg(t._z),
  32141. };
  32142. }
  32143. var i = function (e) {
  32144. return e.alignmentType !== m.ALIGNED
  32145. ? null
  32146. : {
  32147. x: e.position.x,
  32148. y: e.position.y,
  32149. z: e.position.z,
  32150. };
  32151. };
  32152. return {
  32153. panos: e.panos.list.map(function (n) {
  32154. var r = y.getCubemapUrls(e.urls, n.id, "high")[
  32155. C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
  32156. ];
  32157. return {
  32158. uuid: n.id,
  32159. aligned: n.alignmentType === m.ALIGNED,
  32160. neighbourUUIDs: n.neighbourUUIDs.slice(),
  32161. position: i(n),
  32162. rotation: t(n),
  32163. thumbnail: r,
  32164. };
  32165. }),
  32166. };
  32167. }
  32168. var c = e("three"),
  32169. h = e("./ApiHost"),
  32170. u = e("../util/logger"),
  32171. d = e("../util/common"),
  32172. p = e("../util/math"),
  32173. f = e("../enum/ModelManagerEvents"),
  32174. g = e("./PostMessageType"),
  32175. m = e("../enum/AlignmentType"),
  32176. v = e("../enum/Direction"),
  32177. A = e("./TransitionStyles"),
  32178. y = e("../util/panorama"),
  32179. C = e("../enum/GLCubeFaces"),
  32180. I = e("../enum/Vectors"),
  32181. E = e("../enum/Viewmode"),
  32182. b = e("../enum/WarpStyle"),
  32183. w = (e("../enum/Keys"), e("../enum/PlayerEvents")),
  32184. _ = e("../sdk/SdkEvents"),
  32185. I = e("../enum/Vectors"),
  32186. T = e("../enum/ControlEvents"),
  32187. x = e("../enum/RenderLayers"),
  32188. S = (e("../constants"), e("../settings")),
  32189. M = e("../lib/jpeg_encoder"),
  32190. R = new u(i),
  32191. P = (function () {
  32192. var e = function e() {
  32193. e.playerDirection.copy(
  32194. e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD
  32195. ),
  32196. e.player.getDirection(e.playerDirection),
  32197. e.projectVectors();
  32198. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  32199. if (
  32200. ((e.angleTravelled += Math.abs(t)),
  32201. e.angleTravelled >= Math.abs(e.angle))
  32202. ) {
  32203. if (((e.active = !1), e.onDone)) {
  32204. var i = e.onDone;
  32205. i();
  32206. }
  32207. } else
  32208. e.lastFacingDirection.copy(e.playerDirection),
  32209. window.setTimeout(e, 4);
  32210. };
  32211. return (
  32212. (e.active = !1),
  32213. (e.angle = 0),
  32214. (e.angleTravelled = 0),
  32215. (e.playerDirection = new c.Vector3()),
  32216. (e.lastFacingDirection = new c.Vector3()),
  32217. (e.onDone = null),
  32218. (e.player = null),
  32219. (e.start = function (t, i, n, r) {
  32220. (e.active = !0),
  32221. t && i && (i = 0),
  32222. (e.angle = t || i),
  32223. (e.xAngle = t),
  32224. (e.yAngle = i),
  32225. (e.angleTravelled = 0),
  32226. e.playerDirection.copy(
  32227. n.mode === E.FLOORPLAN ? I.UP : I.FORWARD
  32228. ),
  32229. n.getDirection(e.playerDirection),
  32230. e.lastFacingDirection.copy(e.playerDirection),
  32231. e.projectVectors(),
  32232. (e.onDone = r),
  32233. (e.player = n),
  32234. e();
  32235. }),
  32236. (e.projectVectors = function () {
  32237. e.xAngle &&
  32238. (e.playerDirection.projectOnPlane(I.UP),
  32239. e.lastFacingDirection.projectOnPlane(I.UP));
  32240. }),
  32241. e
  32242. );
  32243. })(),
  32244. O = (function () {
  32245. var e = new c.Vector3();
  32246. return function (t) {
  32247. t
  32248. ? (e.copy(t.position),
  32249. e.add(t.discPosition),
  32250. p.projectPositionToCanvas(e, this.player.camera, e),
  32251. this.click(e.x, e.y))
  32252. : R.warn("Showcase -> clicktagObject: Unable to find tag.");
  32253. };
  32254. })(),
  32255. L = function () {
  32256. return this.player.mode === E.PANORAMA
  32257. ? S.insideLookLimitUp
  32258. : this.player.mode === E.DOLLHOUSE
  32259. ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle)
  32260. : null;
  32261. },
  32262. D = function () {
  32263. return this.player.mode === E.PANORAMA
  32264. ? S.insideLookLimitDown
  32265. : this.player.mode === E.DOLLHOUSE
  32266. ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle)
  32267. : null;
  32268. },
  32269. N = (function (e) {
  32270. var t = new c.Vector3();
  32271. return function (e) {
  32272. var i = this.player.getDirection();
  32273. t.copy(i);
  32274. var n = t.y;
  32275. (t.y = 0), t.normalize();
  32276. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  32277. if (
  32278. this.player.mode !== E.DOLLHOUSE &&
  32279. this.player.mode !== E.PANORAMA
  32280. )
  32281. return (
  32282. 0 !== e &&
  32283. R.warn(
  32284. "Cannot rotate in y direction when in " +
  32285. this.player.mode +
  32286. " mode"
  32287. ),
  32288. 0
  32289. );
  32290. this.player.mode === E.DOLLHOUSE && (r = -r);
  32291. var o = L.call(this) - 0.1,
  32292. a = D.call(this) + 0.1,
  32293. s = r + e;
  32294. s > o ? (s = o) : s < a && (s = a);
  32295. var l = s - r;
  32296. return (
  32297. e > 0 && l < 0.01 && (l = 0), e < 0 && l > -0.01 && (l = 0), l
  32298. );
  32299. };
  32300. })(),
  32301. B = (function () {
  32302. var e = new c.Euler();
  32303. return function (t) {
  32304. return (
  32305. e.setFromQuaternion(t.quaternion, "YXZ"),
  32306. {
  32307. position: {
  32308. x: t.position.x,
  32309. y: t.position.y,
  32310. z: t.position.z,
  32311. },
  32312. rotation: {
  32313. x: c.Math.radToDeg(e.x),
  32314. y: c.Math.radToDeg(e.y),
  32315. z: 0,
  32316. },
  32317. pano: t.currentPano ? t.currentPano.id : null,
  32318. mode: t.mode,
  32319. }
  32320. );
  32321. };
  32322. })(),
  32323. F = null;
  32324. t.exports = {
  32325. init: function (e, t, i, n, r) {
  32326. V.init(e, t, i, r),
  32327. (F = new Promise(
  32328. function (e, t) {
  32329. i.on(w.Ready, function () {
  32330. e();
  32331. });
  32332. }.bind(this)
  32333. ));
  32334. var o = new h(window),
  32335. a = o.waitForConnection();
  32336. a.then(function (e) {
  32337. o.on(g.ACTION, V.onMessageReceive.bind(V));
  32338. });
  32339. var s = (function () {
  32340. var e = Date.now();
  32341. return function () {
  32342. if (!(Date.now() - e < 100)) {
  32343. var t = B(i);
  32344. o.sendEvent(_.MOVE, {
  32345. state: t,
  32346. }),
  32347. (e = Date.now());
  32348. }
  32349. };
  32350. })();
  32351. i.on(w.Move, s),
  32352. i.on(w.ViewChanged, s),
  32353. n.on(f.ActiveModelChanged, function (e) {
  32354. function t(e) {
  32355. var t,
  32356. i = e.newPano.id;
  32357. e.oldPano && (t = e.oldPano.id),
  32358. i !== t &&
  32359. o.sendEvent(_.ENTER_PANO, {
  32360. oldPano: t,
  32361. newPano: i,
  32362. });
  32363. }
  32364. var i = e.model,
  32365. n = e.oldModel;
  32366. (V.model = i),
  32367. a.then(function () {
  32368. o.sendEvent(_.MODEL_LOADED, {
  32369. metadata: l(i),
  32370. });
  32371. }),
  32372. n &&
  32373. n.panos.forEach(function (e) {
  32374. e.removeEventListener("enter", t);
  32375. }),
  32376. i.panos.forEach(function (e) {
  32377. e.on("enter", t);
  32378. });
  32379. });
  32380. },
  32381. };
  32382. var V = {
  32383. director: null,
  32384. player: null,
  32385. controls: null,
  32386. sceneRenderer: null,
  32387. model: null,
  32388. init: function (e, t, i, n) {
  32389. (this.director = e),
  32390. (this.player = i),
  32391. (this.controls = t),
  32392. (this.sceneRenderer = n);
  32393. },
  32394. handleToObject: {},
  32395. objectToHandle: {},
  32396. handleCount: 0,
  32397. onMessageReceive: function (e) {
  32398. if (e) {
  32399. var t = e.targetFunction,
  32400. i = e.params,
  32401. n = e.onDone;
  32402. t && this[t] && this[t](i, n);
  32403. }
  32404. },
  32405. waitForInit: function (e, t) {
  32406. F.then(
  32407. t.bind({
  32408. success: !0,
  32409. message: "Init complete.",
  32410. })
  32411. );
  32412. },
  32413. moveToPano: (function (e, t) {
  32414. var i = new c.Euler(0, 0, 0, "YXZ"),
  32415. n = new c.Quaternion();
  32416. return function (e, t) {
  32417. var r = e.pano,
  32418. o = e.rotation,
  32419. a = e.transition;
  32420. if (!this.model)
  32421. return t({
  32422. success: !1,
  32423. error: "The model has not been loaded yet",
  32424. });
  32425. var s = this.model.panos.get(r);
  32426. if (!s)
  32427. return t({
  32428. success: !1,
  32429. error: r + " does not exist in this model",
  32430. });
  32431. if (!o)
  32432. return t({
  32433. sucess: !1,
  32434. erorr: o + " is not a valid rotation",
  32435. });
  32436. i.set(
  32437. c.Math.degToRad(o.x || 0),
  32438. c.Math.degToRad(o.y || 0),
  32439. c.Math.degToRad(o.z || 0),
  32440. "YXZ"
  32441. ),
  32442. console.log(o.z);
  32443. var l = {
  32444. success: !0,
  32445. message: r,
  32446. };
  32447. if (a === A.FADEOUT)
  32448. n.setFromEuler(i),
  32449. this.player.warpToPano(
  32450. s,
  32451. n,
  32452. null,
  32453. null,
  32454. b.BLACK,
  32455. null,
  32456. null,
  32457. t.bind(this, l)
  32458. );
  32459. else {
  32460. var h, u;
  32461. a === A.INSTANT && ((h = 0), (u = 0));
  32462. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  32463. this.player.flyToPano(
  32464. {
  32465. pano: s,
  32466. lookAtPoint: d,
  32467. duration: h,
  32468. aimDuration: u,
  32469. },
  32470. t.bind(this, l)
  32471. );
  32472. }
  32473. };
  32474. })(),
  32475. moveInDirection: function (e, t) {
  32476. var i = e.direction;
  32477. return "undefined" == typeof v[i]
  32478. ? (R.warn(
  32479. "Showcase -> moveInDirection: Cannot move in invalid direction."
  32480. ),
  32481. void (
  32482. t &&
  32483. t({
  32484. success: !1,
  32485. error: "Invalid direction.",
  32486. })
  32487. ))
  32488. : void this.player
  32489. .flyLocalDirection(I[i].clone())
  32490. .then(function (e) {
  32491. t(
  32492. e
  32493. ? {
  32494. success: !0,
  32495. message: "moved " + i,
  32496. }
  32497. : {
  32498. success: !1,
  32499. error: "Cannot move in direction: " + i,
  32500. }
  32501. );
  32502. });
  32503. },
  32504. getPose: function (e, t) {
  32505. this.player.camera.position,
  32506. new c.Euler().setFromQuaternion(
  32507. this.player.camera.quaternion,
  32508. "YXZ"
  32509. );
  32510. return t({
  32511. success: !0,
  32512. message: B(this.player),
  32513. });
  32514. },
  32515. takeScreenShot: (function () {
  32516. var e = new c.PerspectiveCamera(),
  32517. t = new c.WebGLRenderTarget();
  32518. return function (i, n) {
  32519. if (!i.resolution)
  32520. return n({
  32521. success: !1,
  32522. error: "An invalid resolution was specified",
  32523. });
  32524. if (i.resolution.width === -1 || i.resolution.height === -1) {
  32525. var r = this.sceneRenderer.renderer.getSize();
  32526. (i.resolution.width = r.width),
  32527. (i.resolution.height = r.height);
  32528. }
  32529. e.layers.set(x.DEFAULT),
  32530. i.visibleObjects &&
  32531. (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  32532. i.visibleObjects.showPucks &&
  32533. e.layers.enable(x.PANOMARKERS),
  32534. i.visibleObjects.showReticule &&
  32535. e.layers.enable(x.RETICULE));
  32536. var o = i.resolution.width,
  32537. a = i.resolution.height,
  32538. s = o / a;
  32539. e.position.copy(this.sceneRenderer.camera.position),
  32540. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  32541. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  32542. (e.projectionMatrix.elements[0] =
  32543. this.player.camera.projectionMatrix.elements[5] / s),
  32544. t.setSize(o, a),
  32545. this.sceneRenderer.renderer.render(
  32546. this.sceneRenderer.scene,
  32547. e,
  32548. t
  32549. );
  32550. var l = new Uint8Array(o * a * 4);
  32551. this.sceneRenderer.renderer.readRenderTargetPixels(
  32552. t,
  32553. 0,
  32554. 0,
  32555. o,
  32556. a,
  32557. l
  32558. );
  32559. var c = M.encode(
  32560. {
  32561. data: l,
  32562. width: o,
  32563. height: a,
  32564. heading: 180,
  32565. pitch: 0,
  32566. },
  32567. {
  32568. quality: 75,
  32569. flipY: !0,
  32570. }
  32571. ),
  32572. h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  32573. n({
  32574. success: !0,
  32575. message: h,
  32576. });
  32577. };
  32578. })(),
  32579. findRankedPano: (function (e, t) {
  32580. var i = new c.Vector3(),
  32581. r = new c.Vector3();
  32582. return function (e, t) {
  32583. s(this.player, r), n(t, r, i);
  32584. var o = this.player.rankedPanoInDirection(e, i);
  32585. if (o) {
  32586. var a = this.objectToHandle[o.id];
  32587. return (
  32588. a ||
  32589. ((this.objectToHandle[o.id] = a = this.handleCount++),
  32590. (this.handleToObject[a] = o)),
  32591. a
  32592. );
  32593. }
  32594. return (
  32595. R.warn(
  32596. "Showcase -> findRankedPano: Unable to find nearby pano."
  32597. ),
  32598. -1
  32599. );
  32600. };
  32601. })(),
  32602. findRankedtag: (function (e, t) {
  32603. var i = new c.Vector3(),
  32604. r = new c.Vector3();
  32605. return function (e, t) {
  32606. s(this.player, r), n(t, r, i);
  32607. var o = this.player.rankedtagInDirection(e, i);
  32608. if (o) {
  32609. var a = this.objectToHandle[o.sid];
  32610. return (
  32611. a ||
  32612. ((this.objectToHandle[o.sid] = a = this.handleCount++),
  32613. (this.handleToObject[a] = o)),
  32614. a
  32615. );
  32616. }
  32617. return (
  32618. R.warn(
  32619. "Showcase -> findRankedtag: Unable to find nearby tag."
  32620. ),
  32621. -1
  32622. );
  32623. };
  32624. })(),
  32625. clickNearesttag: function (e) {
  32626. this.clickRankedtag(0, e);
  32627. },
  32628. clickRankedtag: function (e, t) {
  32629. var i = a.call(this, e, t);
  32630. i && O.call(this, i);
  32631. },
  32632. clickNearestPano: function (e, t) {
  32633. this.clickRankedPano(0, e, t);
  32634. },
  32635. clickRankedPano: function (e, t, i) {
  32636. var n = o.call(this, e, t);
  32637. n ? r.call(this, n, i) : i(null);
  32638. },
  32639. clickPano: function (e, t) {
  32640. var i = this.handleTable[e];
  32641. i ? r.call(this, i, t) : t(null);
  32642. },
  32643. rotateDirection: (function () {
  32644. return function (e, t) {
  32645. var i = e.direction,
  32646. n = e.angle;
  32647. if (!P.active) {
  32648. var r = 0,
  32649. o = 0,
  32650. a = 0,
  32651. s = 0;
  32652. if (!n || isNaN(n))
  32653. return (
  32654. R.warn(
  32655. "Showcase -> rotateDirection: Invalid rotation angle."
  32656. ),
  32657. void (
  32658. t &&
  32659. t({
  32660. success: !1,
  32661. error: "Invalid rotation angle.",
  32662. })
  32663. )
  32664. );
  32665. if (this.player.mode === E.TRANSITIONING)
  32666. return (
  32667. R.warn(
  32668. "Automation -> rotateDirection: Cannot rotate while transitioning"
  32669. ),
  32670. void (
  32671. t &&
  32672. t({
  32673. success: !1,
  32674. error: "Cannot rotate while transitioning",
  32675. })
  32676. )
  32677. );
  32678. if (i === v.RIGHT || i === v.LEFT)
  32679. i === v.RIGHT && (n = -n), (r = n > 0 ? -1 : 1), (a = n);
  32680. else {
  32681. if (i !== v.UP && i !== v.DOWN)
  32682. return (
  32683. R.warn(
  32684. "Showcase -> rotateDirection: Invalid direction for rotation: " +
  32685. i
  32686. ),
  32687. void (
  32688. t &&
  32689. t({
  32690. success: !1,
  32691. error: "Invalid direction for rotation.",
  32692. })
  32693. )
  32694. );
  32695. if (this.player.mode === E.FLOORPLAN)
  32696. return (
  32697. R.warn(
  32698. "Showcase -> rotateDirection: Cannot rotate " +
  32699. i +
  32700. " in floorplan mode"
  32701. ),
  32702. void (
  32703. t &&
  32704. t({
  32705. success: !1,
  32706. error: "Cannot rotate " + i + " in floorplan mode",
  32707. })
  32708. )
  32709. );
  32710. if (
  32711. (i === v.DOWN && (n = -n), (n = N.call(this, n)), 0 === n)
  32712. )
  32713. return (
  32714. R.warn(
  32715. "Showcase -> rotateDirection: Already at maximum rotation in direction: " +
  32716. i
  32717. ),
  32718. void (
  32719. t &&
  32720. t({
  32721. success: !1,
  32722. error:
  32723. "Already at maximum rotation in direction: " + i,
  32724. })
  32725. )
  32726. );
  32727. (o = n > 0 ? 1 : -1), (s = n);
  32728. }
  32729. var l = n;
  32730. (n = c.Math.degToRad(n)),
  32731. (a = c.Math.degToRad(a)),
  32732. (s = c.Math.degToRad(s));
  32733. var h = this.controls.activeControl,
  32734. u = function () {
  32735. h.stopRotating(!0),
  32736. t &&
  32737. t({
  32738. success: !0,
  32739. message:
  32740. "Rotated " +
  32741. l.toFixed(2) +
  32742. "° in direction: " +
  32743. e.direction,
  32744. });
  32745. };
  32746. h.startRotating(r, o), P.start(a, s, this.player, u);
  32747. }
  32748. };
  32749. })(),
  32750. rotate: (function () {
  32751. var e = new c.Vector3(),
  32752. t = new c.Vector3();
  32753. return function (i, n) {
  32754. var r = i.xAngle,
  32755. o = i.yAngle;
  32756. if (!P.active) {
  32757. if (((r = r || 0), (o = o || 0), isNaN(r) || isNaN(o)))
  32758. return (
  32759. R.warn("Showcase -> rotate: Invalid rotation angle."),
  32760. void (
  32761. n &&
  32762. n({
  32763. success: !1,
  32764. error: "Invalid rotation angle.",
  32765. })
  32766. )
  32767. );
  32768. if (this.player.mode === E.TRANSITIONING)
  32769. return (
  32770. R.warn(
  32771. "Automation -> rotate: Cannot rotate while transitioning"
  32772. ),
  32773. void (
  32774. n &&
  32775. n({
  32776. success: !1,
  32777. error: "Cannot rotate while transitioning",
  32778. })
  32779. )
  32780. );
  32781. Math.abs(r) < 0.01 && (r = 0), Math.abs(o) < 0.01 && (o = 0);
  32782. var a = o;
  32783. (o = N.call(this, o)), (r = -r);
  32784. var s = a > 0 ? "UP" : "DOWN";
  32785. if (!r && a && !o)
  32786. return (
  32787. R.warn(
  32788. "Showcase -> rotate: Already at maximum rotation in direction: " +
  32789. s
  32790. ),
  32791. void (
  32792. n &&
  32793. n({
  32794. success: !1,
  32795. error:
  32796. "Already at maximum rotation in direction: " + s,
  32797. })
  32798. )
  32799. );
  32800. a > o &&
  32801. R.warn(
  32802. "Showcase -> rotate: Reached maximum rotation in direction: " +
  32803. s
  32804. );
  32805. var l = o;
  32806. (o = c.Math.degToRad(o)),
  32807. (r = c.Math.degToRad(r)),
  32808. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  32809. this.player.getDirection(e),
  32810. t.copy(e).applyAxisAngle(I.UP, r),
  32811. t.applyAxisAngle(I.RIGHT, o);
  32812. var h = (e.angleTo(t), r > 0 ? -1 : r < 0 ? 1 : 0),
  32813. u = o > 0 ? 1 : o < 0 ? -1 : 0;
  32814. Math.abs(r) > Math.abs(o)
  32815. ? (u *= Math.abs(o / r))
  32816. : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  32817. var d = this.controls.activeControl,
  32818. p = function () {
  32819. d.stopRotating(!0),
  32820. n &&
  32821. n({
  32822. success: !0,
  32823. message:
  32824. "Rotated " +
  32825. i.xAngle.toFixed(2) +
  32826. "° horizontally, " +
  32827. l.toFixed(2) +
  32828. "° vertically",
  32829. });
  32830. };
  32831. d.startRotating(h, u), P.start(r, o, this.player, p);
  32832. }
  32833. };
  32834. })(),
  32835. panCamera: function (e, t) {
  32836. function i(e) {
  32837. switch (
  32838. (r.removeAllListeners(T.AutoPanComplete),
  32839. r.removeAllListeners(T.AutoPanInterrupt),
  32840. r.removeAllListeners(T.AutoPanClamped),
  32841. e)
  32842. ) {
  32843. case T.AutoPanInterrupt:
  32844. t({
  32845. success: !0,
  32846. message: "Camera panning interrupted.",
  32847. });
  32848. break;
  32849. case T.AutoPanClamped:
  32850. if (
  32851. r.autoPanPosition.x !== n.x ||
  32852. r.autoPanPosition.z !== n.z
  32853. ) {
  32854. if (
  32855. Math.abs(this.player.position.x - r.autoPanPosition.x) <
  32856. 0.01 &&
  32857. Math.abs(this.player.position.z - r.autoPanPosition.z) <
  32858. 0.01
  32859. )
  32860. return void t({
  32861. success: !1,
  32862. error: "Already at edge of current model bounds.",
  32863. });
  32864. var i =
  32865. "The view point is outside the bounds for the current model. ";
  32866. (i +=
  32867. "The view point was clamped to " +
  32868. o(r.target.x, r.target.z)),
  32869. console.warn(i);
  32870. }
  32871. case T.AutoPanComplete:
  32872. t({
  32873. success: !0,
  32874. message:
  32875. "Panned camera to position " +
  32876. o(r.autoPanPosition.x, r.autoPanPosition.z),
  32877. });
  32878. }
  32879. }
  32880. if (
  32881. this.player.mode !== E.DOLLHOUSE &&
  32882. this.player.mode !== E.FLOORPLAN
  32883. )
  32884. return t({
  32885. success: !1,
  32886. error:
  32887. "Camera panning is not available in the current mode: " +
  32888. this.player.mode,
  32889. });
  32890. var n = e.position,
  32891. r = this.player.control;
  32892. r.setAutoPanPosition(n.x, n.z), (r.autoPan = !0);
  32893. var o = function (e, t) {
  32894. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")";
  32895. };
  32896. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  32897. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  32898. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped));
  32899. },
  32900. click: function (e, t) {
  32901. var i = e.x,
  32902. n = e.y,
  32903. r = e.percentage;
  32904. r === !0 &&
  32905. ((i = (i / 100) * $("#player").width()),
  32906. (n = (n / 100) * $("#player").height())),
  32907. this.player.handleInputStart(i, n),
  32908. this.player.updateIntersect(),
  32909. this.player.handleInputEnd(i, n);
  32910. },
  32911. mouseOver: function (e, t) {
  32912. var i = e.x,
  32913. n = e.y,
  32914. r = e.percentage;
  32915. r === !0 &&
  32916. ((i = (i / 100) * $("#player").width()),
  32917. (n = (n / 100) * $("#player").height())),
  32918. this.player.handleInputMove(i, n),
  32919. this.player.updateIntersect();
  32920. },
  32921. moveToMode: function (e, t) {
  32922. function i(e) {
  32923. t(
  32924. e
  32925. ? {
  32926. success: !1,
  32927. error: "Failed to load new mode: " + e,
  32928. }
  32929. : {
  32930. success: !0,
  32931. message: "Moved to new mode: " + n,
  32932. }
  32933. );
  32934. }
  32935. var n = e.mode;
  32936. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN
  32937. ? this.director.changeMode(n).then(
  32938. function () {
  32939. i();
  32940. },
  32941. function (e) {
  32942. i(e);
  32943. }
  32944. )
  32945. : t({
  32946. success: !1,
  32947. error: "Invalid mode selection",
  32948. });
  32949. },
  32950. };
  32951. }).call(this, "/js/sdk/automation.js");
  32952. },
  32953. {
  32954. "../constants": 8,
  32955. "../enum/AlignmentType": 17,
  32956. "../enum/ControlEvents": 21,
  32957. "../enum/Direction": 22,
  32958. "../enum/GLCubeFaces": 25,
  32959. "../enum/Keys": 30,
  32960. "../enum/ModelManagerEvents": 33,
  32961. "../enum/PlayerEvents": 40,
  32962. "../enum/RenderLayers": 41,
  32963. "../enum/Vectors": 50,
  32964. "../enum/Viewmode": 51,
  32965. "../enum/WarpStyle": 52,
  32966. "../lib/jpeg_encoder": 94,
  32967. "../sdk/SdkEvents": 161,
  32968. "../settings": 166,
  32969. "../util/common": 185,
  32970. "../util/logger": 189,
  32971. "../util/math": 190,
  32972. "../util/panorama": 191,
  32973. "./ApiHost": 159,
  32974. "./PostMessageType": 160,
  32975. "./TransitionStyles": 162,
  32976. three: 217,
  32977. },
  32978. ],
  32979. 165: [
  32980. function (e, t, i) {
  32981. "use strict";
  32982. function n(e) {
  32983. (this.sourceWindow = e),
  32984. (this.targetWindow = null),
  32985. (this.targetOrigin = null),
  32986. (this.id = Math.floor(1e5 * Math.random())),
  32987. this.bindEvents();
  32988. }
  32989. var r = e("./PostMessageType"),
  32990. o = e("events").EventEmitter;
  32991. (n.prototype = Object.create(o.prototype)),
  32992. (n.prototype.bindEvents = function () {
  32993. this.sourceWindow.addEventListener(
  32994. "message",
  32995. this.onPostmessageReceived.bind(this)
  32996. );
  32997. }),
  32998. (n.prototype.setTarget = function (e, t) {
  32999. (this.targetWindow = e), (this.targetOrigin = t);
  33000. }),
  33001. (n.prototype.onPostmessageReceived = function (e) {
  33002. var t = e.origin || e.originalEvent.origin,
  33003. i = e.source;
  33004. switch (e.data.type) {
  33005. case r.CONNECT:
  33006. break;
  33007. case r.RESPONSE:
  33008. if (this.id !== e.data.toId) return;
  33009. default:
  33010. if (!this.validateMessageOrigin(t)) return;
  33011. }
  33012. var n = e.data;
  33013. (n.source = i),
  33014. (n.origin = t),
  33015. (n.timestamp = Date.now()),
  33016. this.emit(e.data.type, n);
  33017. }),
  33018. (n.prototype.validateMessageOrigin = function (e) {
  33019. return "*" === this.targetOrigin || e === this.targetOrigin;
  33020. }),
  33021. (n.prototype.send = function (e) {
  33022. this.targetWindow &&
  33023. this.targetOrigin &&
  33024. ((e.fromId = this.id),
  33025. this.targetWindow.postMessage(e, this.targetOrigin));
  33026. }),
  33027. (t.exports = n);
  33028. },
  33029. {
  33030. "./PostMessageType": 160,
  33031. events: 202,
  33032. },
  33033. ],
  33034. 166: [
  33035. function (e, t, i) {
  33036. "use strict";
  33037. var n = e("three"),
  33038. r = e("./util/browser"),
  33039. o = e("./enum/Viewmode"),
  33040. a = e("./enum/VROption"),
  33041. s = e("./enum/Colors"),
  33042. l = e("./enum/WarpStyle"),
  33043. c = e("./util/easing"),
  33044. h = e("./util/common"),
  33045. u = e("./util/showcase"),
  33046. d = e("./constants"),
  33047. p = {
  33048. debug: !1,
  33049. version: "2.25.6-0-gd87e5b1",
  33050. languageTag: r.valueFromHash("lang", null),
  33051. pageTitle: "四维虚拟漫游",
  33052. authorizationHeader: u.getAuthorizationHeader(),
  33053. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  33054. logLevel: r.valueFromHash("log", 2),
  33055. skyboxRadius: 2500,
  33056. modelBoundsPadding: 5,
  33057. showNeighbors: !1,
  33058. brand: r.valueFromHash("brand", !0),
  33059. showHighlights:
  33060. r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  33061. startHighlights: r.valueFromHash("hl", -1),
  33062. specialEdition: r.valueFromHash("bn", 0),
  33063. useWheel: r.valueFromHash("wh", !0),
  33064. crossOrigin: "anonymous",
  33065. fancierTransition: !1,
  33066. wireframe: !1,
  33067. skyboxWireframe: !1,
  33068. modelAlpha: 1,
  33069. highlightPanoSelection: !1,
  33070. showSweeps: !0,
  33071. showSkyboxes: !1,
  33072. showMesh: !0,
  33073. showFloors: !1,
  33074. showFloorDuration: 300,
  33075. showFloorDelay: 300,
  33076. hideFloorDuration: 300,
  33077. hideFloorDelay: 0,
  33078. reticuleOpacityTransitionTime: 250,
  33079. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue, // 方奕卓 配置鼠标标志颜色
  33080. markerOpacityTransitionTime: 500,
  33081. guiAnimationSpeed: 250,
  33082. highlightAnimationDuration: 500,
  33083. modelComponentLoadSpinnerDelay: 150,
  33084. captureErrors: !1,
  33085. maxMobileTextures: 6,
  33086. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  33087. startupFlyinDelay: 3e3,
  33088. dollhouseDefault: {
  33089. minDistance: 15,
  33090. maxDistance: 50,
  33091. minPolarAngle: n.Math.degToRad(10),
  33092. maxPolarAngle: n.Math.degToRad(90),
  33093. },
  33094. hideReticuleTimeout: 1e3,
  33095. analytics: {
  33096. inactivityThreshold: 30,
  33097. sessionTrackingRate: 0.15,
  33098. maxTrackedErrors: 20,
  33099. sessionDurationPingFrequency: 10,
  33100. sessionDurationTimeout: 15,
  33101. },
  33102. flydown: {
  33103. movementEasing: "easeInOutQuad",
  33104. movementDelay: 0.001,
  33105. rotationEasing: "easeInOutQuad",
  33106. rotationDelay: 0.5,
  33107. modelTextureDelay: 0.75,
  33108. skyboxDelay: 0.75,
  33109. },
  33110. transition: {
  33111. flySpeed: 0.001,
  33112. flyTime: 750,
  33113. flytimeMaxDistanceThreshold: 5,
  33114. flytimeDistanceMultiplier: 150,
  33115. aimTime: 1500,
  33116. aimSlowFactor: 1.5,
  33117. blur: 0.8,
  33118. movementEasing: "easeInOutQuad",
  33119. blendEasing: "easeInOutQuad",
  33120. fastForwardFactor: 4, //r.valueFromHash("mfis", 3) //快速停止导览的速度,原先是3
  33121. },
  33122. show360Views: {
  33123. enabled: !0,
  33124. transitionTime: 1e3,
  33125. },
  33126. quickstart: {
  33127. enabled:
  33128. 1 === r.valueFromHash("qust", 0) ||
  33129. 1 === r.valueFromHash("qs", 0),
  33130. animation: 1400,
  33131. showTextDelay: 500,
  33132. fadeOutDelay: 3e3,
  33133. fovChange: 10,
  33134. },
  33135. appConfig: {
  33136. webvr_version: null,
  33137. segment_key: null,
  33138. embedly_key: null,
  33139. branch_key: null,
  33140. keen_write_key: null,
  33141. keen_project_id: null,
  33142. },
  33143. vr: {
  33144. enabled: !0,
  33145. allowWebVR: !1,
  33146. option: r.valueFromHash("vr", a.CONTEXTUAL),
  33147. },
  33148. share: {
  33149. enabled:
  33150. !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0),
  33151. },
  33152. input: {
  33153. longTapThreshold: 200,
  33154. moveToleranceNDC: 0.01, //.08,
  33155. touchMoveThreshold: 25,
  33156. },
  33157. help: {
  33158. modalStayDuration: 600,
  33159. },
  33160. immersive: {
  33161. timeToShowAgain: 1250,
  33162. uiStayDuration: 600,
  33163. },
  33164. tourInteraction: {
  33165. disabled: "0" === r.valueFromHash("tourcta", null),
  33166. showPauseButton: 1e3,
  33167. showModal: 1500,
  33168. allowNextClick: 200,
  33169. largeModal: "1" === r.valueFromHash("tourcta", null),
  33170. smallModal: "2" === r.valueFromHash("tourcta", null),
  33171. },
  33172. labels: {
  33173. enabled: !1,
  33174. hideUntilStart: !0,
  33175. fadeInDuration: 250,
  33176. fadeInDelay: 250,
  33177. fadeOutDuration: 250,
  33178. fadeOutDelay: 0,
  33179. zoomHideThreshhold: {
  33180. mobile: r.isSmallScreen() ? 0.45 : 0.6,
  33181. desktop: 2,
  33182. },
  33183. zoomTruncateThreshhold: {
  33184. mobile: r.isSmallScreen() ? 0.35 : 0.45,
  33185. desktop: 0.85,
  33186. },
  33187. minLengthForTruncate: 16,
  33188. truncateLength: 12,
  33189. truncateSuffix: "...",
  33190. },
  33191. tags: {
  33192. enabled: r.valueFromHash("mt", 1),
  33193. startup: {
  33194. hideUntilStart: !0,
  33195. fadeInDuration: 500,
  33196. fadeInDelay: 100,
  33197. },
  33198. visibility: {
  33199. anyDistance: !0,
  33200. visibleDistance: 8,
  33201. cameraClearance: 0.1,
  33202. alphaTestLevel: 0.05,
  33203. hideViaFloor: !0,
  33204. hideOffScreenDisc: !1,
  33205. hideOffScreenObject: !1,
  33206. },
  33207. disc: {
  33208. opacity: 1,
  33209. disabledOpacity: 0.5,
  33210. scale: {
  33211. nearBound: 1.5,
  33212. farBound: 4.8,
  33213. linkFarBound: !1,
  33214. linkPercent: 40,
  33215. maxSize: 80,
  33216. minSize: 40,
  33217. baseViewportSize: 800,
  33218. responsiveness: 100,
  33219. },
  33220. },
  33221. pole: {
  33222. enabled: !0,
  33223. height: 0.5,
  33224. width: 2,
  33225. opacity: 0.5,
  33226. color: "white",
  33227. },
  33228. navigate: {
  33229. nearestPano: !0,
  33230. lineOfSight: !0,
  33231. reactivate: !0,
  33232. aimAt: "disc",
  33233. tiltTolerance: 25,
  33234. rotateSpeedFactor: 0.6,
  33235. },
  33236. },
  33237. path: {
  33238. color: window.DATA.floorMarkerColor || s.newBlue, // 方奕卓 配置导览标志颜色
  33239. colorUp: s._desat(s.newBlue, 0.5),
  33240. colorDown: s._darken(s.newBlue, 0.35),
  33241. opacity: 0.5,
  33242. style: "ribbon",
  33243. height: 0.025,
  33244. ribbonWidth: 0.24,
  33245. outsideHeight: 0.5,
  33246. waypointRadius: 0.5,
  33247. waypointIndoorRadius: 0.24,
  33248. waypointPulse: 1e3,
  33249. typ: l.BLACK,
  33250. meshFree: r.valueFromHash("mf", 1),
  33251. mapGuides: r.valueFromHash("guides", !0),
  33252. fadeInTime: 400,
  33253. fadeOutTime: 300,
  33254. },
  33255. warp: {
  33256. nearPanoDist: 0.1,
  33257. matchCam: !1,
  33258. blur: 0.33,
  33259. fastTime: 1500,
  33260. teleportTime: 1500, //瞬间过渡的时间
  33261. flytimeDistanceMultiplier: 150, //add
  33262. flyTime: 750, //add
  33263. outsideTime: 2e3,
  33264. lookAheadMax: 0.3,
  33265. lookAheadDist: 2.5,
  33266. softPushDist: 0.37,
  33267. softPushEnd: 0.3,
  33268. softBendAngle: 8,
  33269. softBendTilt: 4,
  33270. softBendEnd: 0.3,
  33271. doBurns: true, //r.valueFromHash("kb", !0),
  33272. burnsAngle: 8, //导览在每个点停留时的旋转角度
  33273. minBurnsAngle: 35,
  33274. minDownAngle: -35,
  33275. maxTurnPerSec: 280,
  33276. maxAimPerSec: 35,
  33277. minRotation: 12,
  33278. maxAimRotation: 33.2,
  33279. turnFriction: 0.2,
  33280. flySpeed: 0.01,
  33281. minWarpTime: 1200,
  33282. warpInterruptionRedirectTime: 500,
  33283. tourStepDelay: r.valueFromHash("st", 0),
  33284. walkDelay: 0,
  33285. walkMaxDist: 50,
  33286. walkMinDist: 0.8,
  33287. walkSlideShowThreshhold: 3000,
  33288. walkExtraPanosDistance: 0.4,
  33289. timePerMeter: 1200,
  33290. motionLeadTime: 5000,
  33291. movementEasing: "easeInOutQuad",
  33292. blendEasing: "easeInOutQuad",
  33293. showBunny: !1,
  33294. loop: r.valueFromHash("lp", !1),
  33295. auto: r.valueFromHash("ts", -1),
  33296. eOrder: "YXZ", //"YXZ",
  33297. stepFactor: 0.25,
  33298. brakeStrength: 2,
  33299. minBrakeAngle: 0.1,
  33300. maxBrakeAngle: 1.8,
  33301. climbEffort: 4,
  33302. },
  33303. rotationFriction: 0.05,
  33304. rotationAccelerationInside: 4.5,
  33305. rotationAccelerationOutside: 0.15,
  33306. rotationAfterMoveMultiplier: 40,
  33307. rotationAfterMoveHistoryCount: 5,
  33308. panFriction: 0.09,
  33309. panAccelerationOutside: 60,
  33310. onload: r.valueFromHash("onload", o.PANORAMA),
  33311. zoomNearLimit: 0.1,
  33312. zoomFarLimit: 50,
  33313. navigation: {
  33314. panoScores: !1,
  33315. mouseDirection: !0,
  33316. filterStrictness: 0.75,
  33317. angleFactor: -30,
  33318. directionFactor: 10,
  33319. distanceFactor: -1,
  33320. optionalityFactor: 3,
  33321. },
  33322. sdkInit: !1,
  33323. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  33324. console: r.valueFromHash("console", !1),
  33325. noMeshFloorPositionOffset: new n.Vector3(0, -1.2, 0),
  33326. panoramaNeighbourMaxDistance: 5,
  33327. panoFloorClickRadius: 0.35,
  33328. showScreenshotLocations: !1,
  33329. showAxis: !1,
  33330. showNeighbourRaycasts: !1,
  33331. colorMarkerOnLoad: !1,
  33332. colorMarkerByFloor: !1,
  33333. tiling: {
  33334. panoPreRenderRepeatDelay: 2500,
  33335. panoPreRenderDelay: 500,
  33336. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  33337. tilingFlagNames: ["usetiles", "tiles"],
  33338. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  33339. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  33340. overlayStyle: r.valueFromHash("tileoverlay", 0),
  33341. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  33342. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  33343. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 1 /* 2 */),
  33344. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  33345. customCompression: r.valueFromHash("tilecustcomp", 0),
  33346. // mobileHighQualityOverride: !1,
  33347. mobileHighQualityOverride: 1,
  33348. allowUltraHighResolution: true,
  33349. },
  33350. zoom: {
  33351. enabled: true,
  33352. forceOff: r.valueFromHash("nozoom", 0),
  33353. overridemax: r.valueFromHash("maxzoom", null),
  33354. overridemin: r.valueFromHash("minzoom", null),
  33355. max: d.highQualityMaxZoom,
  33356. min: 1,
  33357. transitionStyle: r.valueFromHash("zoomtrans", 1),
  33358. activationThreshold: 1.1,
  33359. restoreTime: 500,
  33360. },
  33361. profiling: {
  33362. enabled: r.valueFromHash("mem", !1),
  33363. },
  33364. };
  33365. (p = h.deepExtend(p, d, {
  33366. insideFOV: r.valueFromHash("fov", d.insideFOV),
  33367. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  33368. panorama: {
  33369. transitionTime: 1e3,
  33370. modelAlpha: 0,
  33371. modelAlphaDelay: p.flydown.modelTextureDelay,
  33372. modelAlphaLength: 1,
  33373. skyboxOpacity: 1,
  33374. skyboxOpacityDelay: p.flydown.skyboxDelay,
  33375. skyboxOpacityLength: 0.9,
  33376. fovLength: 1,
  33377. fovDelay: 0,
  33378. cameraMatrixDuration: 0.8,
  33379. cameraMatrixDelay: 0,
  33380. cameraMatrixEase: c.easeInCubic,
  33381. reticuleOpacity: 1,
  33382. markerOpacity: 0.3,
  33383. markerOpacityOnHover: 1,
  33384. },
  33385. dollhouse: {
  33386. transitionTime: 1e3,
  33387. modelAlpha: 1,
  33388. modelAlphaDelay: 0,
  33389. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  33390. skyboxOpacity: 0,
  33391. skyboxOpacityDelay: 0,
  33392. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  33393. fovLength: 1,
  33394. fovDelay: 0,
  33395. cameraMatrixDuration: 0.8,
  33396. cameraMatrixDelay: 0.3,
  33397. cameraMatrixEase: c.easeInCubic,
  33398. reticuleOpacity: 1,
  33399. markerOpacity: 0,
  33400. markerOpacityOnHover: 0,
  33401. },
  33402. floorplan: {
  33403. transitionTime: 1e3,
  33404. modelAlpha: 1,
  33405. modelAlphaDelay: 0,
  33406. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  33407. skyboxOpacity: 0,
  33408. skyboxOpacityDelay: 0,
  33409. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  33410. fovLength: 1,
  33411. fovDelay: 0,
  33412. cameraMatrixDuration: 0.5,
  33413. cameraMatrixDelay: 0,
  33414. cameraMatrixEase: c.easeOutCubic,
  33415. reticuleOpacity: 1,
  33416. markerOpacity: 0,
  33417. markerOpacityOnHover: 0,
  33418. cameraHeight: 50,
  33419. },
  33420. transitioning: {
  33421. reticuleOpacity: 0,
  33422. markerOpacity: 0.3,
  33423. markerOpacityOnHover: 1,
  33424. },
  33425. "floorplan-dollhouse": {
  33426. rotationDelay: 0,
  33427. rotationDuration: 1,
  33428. },
  33429. "floorplan-panorama": {
  33430. rotationDelay: 0.5,
  33431. rotationDuration: 1,
  33432. },
  33433. "dollhouse-panorama": {
  33434. rotationDelay: 0.5,
  33435. rotationDuration: 1,
  33436. },
  33437. "dollhouse-floorplan": {
  33438. rotationDelay: 0,
  33439. rotationDuration: 1,
  33440. cameraMatrixDuration: 1.05,
  33441. cameraMatrixDelay: 0.5,
  33442. },
  33443. "panorama-dollhouse": {
  33444. rotationDelay: 0,
  33445. rotationDuration: 0.5,
  33446. },
  33447. "panorama-floorplan": {
  33448. transitionTime: 1500,
  33449. rotationDelay: 0,
  33450. rotationDuration: 0.5,
  33451. },
  33452. })),
  33453. p.path.meshFree && (p.path.typ = l.WALK),
  33454. (p.zoom.max = p.zoom.overridemax || p.zoom.max),
  33455. (p.zoom.min = p.zoom.overridemin || p.zoom.min),
  33456. (window._settings = t.exports = p);
  33457. },
  33458. {
  33459. "./constants": 8,
  33460. "./enum/Colors": 19,
  33461. "./enum/VROption": 47,
  33462. "./enum/Viewmode": 51,
  33463. "./enum/WarpStyle": 52,
  33464. "./util/browser": 182,
  33465. "./util/common": 185,
  33466. "./util/easing": 186,
  33467. "./util/showcase": 193,
  33468. three: 217,
  33469. },
  33470. ],
  33471. 167: [
  33472. function (e, t, i) {
  33473. "use strict";
  33474. var n = e("three"),
  33475. r = e("./settings"),
  33476. o =
  33477. "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",
  33478. a =
  33479. "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  33480. t.exports = {
  33481. basicTextured: {
  33482. uniforms: {
  33483. tDiffuse: {
  33484. type: "t",
  33485. value: null,
  33486. },
  33487. alpha: {
  33488. type: "f",
  33489. value: 1,
  33490. },
  33491. },
  33492. vertexShader:
  33493. "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  33494. fragmentShader:
  33495. "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}",
  33496. },
  33497. copyCubeMap: {
  33498. uniforms: {
  33499. tDiffuse: {
  33500. type: "t",
  33501. value: null,
  33502. },
  33503. alpha: {
  33504. type: "f",
  33505. value: 1,
  33506. },
  33507. },
  33508. vertexShader:
  33509. "varying vec3 vWorldPos;\nvoid main() {\n vWorldPos = vec3(-position.x, -position.y, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  33510. fragmentShader:
  33511. "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}",
  33512. },
  33513. cube: {
  33514. uniforms: {
  33515. map: {
  33516. type: "t",
  33517. value: null,
  33518. },
  33519. opacity: {
  33520. type: "f",
  33521. value: 1,
  33522. },
  33523. },
  33524. vertexShader:
  33525. o +
  33526. "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  33527. fragmentShader:
  33528. a +
  33529. "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",
  33530. },
  33531. model: {
  33532. uniforms: {
  33533. map: {
  33534. type: "t",
  33535. value: null,
  33536. },
  33537. modelAlpha: {
  33538. type: "f",
  33539. value: r.modelAlpha,
  33540. },
  33541. opacity: {
  33542. type: "f",
  33543. value: 1,
  33544. },
  33545. progress: {
  33546. type: "f",
  33547. value: 0,
  33548. },
  33549. blackout: {
  33550. type: "i",
  33551. value: 0,
  33552. },
  33553. pano0Map: {
  33554. type: "t",
  33555. value: null,
  33556. },
  33557. pano0Position: {
  33558. type: "v3",
  33559. value: new n.Vector3(),
  33560. },
  33561. pano0Matrix: {
  33562. type: "m4",
  33563. value: new n.Matrix4(),
  33564. },
  33565. pano1Map: {
  33566. type: "t",
  33567. value: null,
  33568. },
  33569. pano1Position: {
  33570. type: "v3",
  33571. value: new n.Vector3(),
  33572. },
  33573. pano1Matrix: {
  33574. type: "m4",
  33575. value: new n.Matrix4(),
  33576. },
  33577. },
  33578. vertexShader:
  33579. o +
  33580. `uniform vec3 pano0Position;
  33581. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  33582. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  33583. varying vec3 vWorldPosition0;
  33584. varying vec3 vWorldPosition1;
  33585. uniform int blackout;
  33586. void main() {
  33587. vUv = uv;
  33588. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  33589. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  33590. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  33591. vWorldPosition0.x *= -1.0;
  33592. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  33593. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  33594. vWorldPosition1.x *= -1.0;
  33595. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  33596. }`,
  33597. fragmentShader:
  33598. a +
  33599. `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  33600. 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
  33601. void main() {
  33602. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  33603. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  33604. vec4 colorFromPanos;
  33605. if (blackout == 5){//add for TransitionPass
  33606. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  33607. }else{
  33608. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  33609. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  33610. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  33611. else if (blackout == 1) {
  33612. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  33613. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  33614. }
  33615. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  33616. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  33617. }
  33618. //#ifdef useModelMap //起不了作用为啥
  33619. if(modelAlpha>0.0){
  33620. vec4 colorFromTexture = texture2D( map, vUv );
  33621. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  33622. }
  33623. //#endif
  33624. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  33625. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  33626. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  33627. }`,
  33628. },
  33629. hot: {
  33630. uniforms: {
  33631. color: {
  33632. type: "c",
  33633. value: new n.Color(0xff2200),
  33634. },
  33635. opac: {
  33636. type: "f",
  33637. value: 0,
  33638. },
  33639. texture1: {
  33640. type: "t",
  33641. value: null,
  33642. },
  33643. texture2: {
  33644. type: "t",
  33645. value: null,
  33646. },
  33647. },
  33648. vertexShader:
  33649. "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  33650. fragmentShader:
  33651. "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",
  33652. },
  33653. modelOutside: {
  33654. uniforms: {
  33655. map: {
  33656. type: "t",
  33657. value: null,
  33658. },
  33659. opacity: {
  33660. type: "f",
  33661. value: 1,
  33662. },
  33663. },
  33664. vertexShader:
  33665. o +
  33666. "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  33667. fragmentShader:
  33668. a +
  33669. "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",
  33670. },
  33671. ribbon: {
  33672. uniforms: {
  33673. map: {
  33674. type: "t",
  33675. value: null,
  33676. },
  33677. opacity: {
  33678. type: "f",
  33679. value: 1,
  33680. },
  33681. color: {
  33682. type: "c",
  33683. value: new n.Color(r.path.color),
  33684. },
  33685. },
  33686. vertexShader:
  33687. o +
  33688. "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",
  33689. fragmentShader:
  33690. a +
  33691. "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",
  33692. },
  33693. waypoint: {
  33694. uniforms: {
  33695. map: {
  33696. type: "t",
  33697. value: null,
  33698. },
  33699. opacity: {
  33700. type: "f",
  33701. value: 1,
  33702. },
  33703. pulse: {
  33704. type: "f",
  33705. value: 1,
  33706. },
  33707. nearFade: {
  33708. type: "v2",
  33709. value: new n.Vector2(
  33710. 2 * r.insideNear,
  33711. 2 * r.path.waypointIndoorRadius
  33712. ),
  33713. },
  33714. color: {
  33715. type: "c",
  33716. value: new n.Color(r.reticuleColor),
  33717. },
  33718. },
  33719. vertexShader:
  33720. o +
  33721. "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",
  33722. fragmentShader:
  33723. a +
  33724. "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",
  33725. },
  33726. modelDebug: {
  33727. uniforms: {
  33728. map: {
  33729. type: "t",
  33730. value: null,
  33731. },
  33732. modelAlpha: {
  33733. type: "f",
  33734. value: r.modelAlpha,
  33735. },
  33736. depthmapRatio: {
  33737. type: "f",
  33738. value: 0,
  33739. },
  33740. opacity: {
  33741. type: "f",
  33742. value: 1,
  33743. },
  33744. progress: {
  33745. type: "f",
  33746. value: 0,
  33747. },
  33748. considerOcclusion: {
  33749. type: "i",
  33750. value: r.fancierTransition,
  33751. },
  33752. highlightPanoSelection: {
  33753. type: "i",
  33754. value: 0,
  33755. },
  33756. useThirdPano: {
  33757. type: "i",
  33758. value: r.useThirdPano,
  33759. },
  33760. pano0Map: {
  33761. type: "t",
  33762. value: null,
  33763. },
  33764. pano0Depth: {
  33765. type: "t",
  33766. value: null,
  33767. },
  33768. pano0Position: {
  33769. type: "v3",
  33770. value: new n.Vector3(),
  33771. },
  33772. pano0Matrix: {
  33773. type: "m4",
  33774. value: new n.Matrix4(),
  33775. },
  33776. pano0Weight: {
  33777. type: "f",
  33778. value: r.transition.pano0Weight,
  33779. },
  33780. pano1Map: {
  33781. type: "t",
  33782. value: null,
  33783. },
  33784. pano1Depth: {
  33785. type: "t",
  33786. value: null,
  33787. },
  33788. pano1Position: {
  33789. type: "v3",
  33790. value: new n.Vector3(),
  33791. },
  33792. pano1Matrix: {
  33793. type: "m4",
  33794. value: new n.Matrix4(),
  33795. },
  33796. pano1Weight: {
  33797. type: "f",
  33798. value: r.transition.pano1Weight,
  33799. },
  33800. pano2Map: {
  33801. type: "t",
  33802. value: null,
  33803. },
  33804. pano2Depth: {
  33805. type: "t",
  33806. value: null,
  33807. },
  33808. pano2Position: {
  33809. type: "v3",
  33810. value: new n.Vector3(),
  33811. },
  33812. pano2Matrix: {
  33813. type: "m4",
  33814. value: new n.Matrix4(),
  33815. },
  33816. pano2Weight: {
  33817. type: "f",
  33818. value: r.transition.pano2Weight,
  33819. },
  33820. },
  33821. vertexShader:
  33822. o +
  33823. "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",
  33824. fragmentShader:
  33825. a +
  33826. "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",
  33827. },
  33828. customDepth: {
  33829. uniforms: {
  33830. panoPosition: {
  33831. type: "v3",
  33832. value: new n.Vector3(),
  33833. },
  33834. },
  33835. vertexShader:
  33836. o +
  33837. "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",
  33838. fragmentShader:
  33839. a +
  33840. "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",
  33841. },
  33842. skysphere: {
  33843. uniforms: {
  33844. radius: {
  33845. type: "f",
  33846. value: 0,
  33847. },
  33848. },
  33849. vertexShader:
  33850. o +
  33851. "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",
  33852. fragmentShader:
  33853. a +
  33854. "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",
  33855. },
  33856. tagDisc: {
  33857. uniforms: {
  33858. opacity: {
  33859. type: "f",
  33860. value: 0,
  33861. },
  33862. color: {
  33863. type: "c",
  33864. value: new n.Color(),
  33865. },
  33866. bg: {
  33867. type: "t",
  33868. value: null,
  33869. },
  33870. mask: {
  33871. type: "t",
  33872. value: null,
  33873. },
  33874. },
  33875. vertexShader:
  33876. o +
  33877. "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  33878. fragmentShader:
  33879. a +
  33880. "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",
  33881. },
  33882. };
  33883. },
  33884. {
  33885. "./settings": 166,
  33886. three: 217,
  33887. },
  33888. ],
  33889. 168: [
  33890. function (e, t, i) {
  33891. (function (i) {
  33892. "use strict";
  33893. var n = e("three"),
  33894. r = (e("url"), e("./util/ajax")),
  33895. o = e("./settings"),
  33896. a = e("./util/logger"),
  33897. s = e("./util/math"),
  33898. l = e("./util/showcase"),
  33899. c = e("./objects/Panorama"),
  33900. h = new a(i),
  33901. u = e("./model/Model"),
  33902. d = e("./shaders"),
  33903. p = e("./util/transitions"),
  33904. f = e("./objects/Chunk"),
  33905. g = e("./objects/Reticule"),
  33906. m = e("./objects/Skybox"),
  33907. v = e("./objects/Floor"),
  33908. A = e("./cameras/DollhouseCamera"),
  33909. y = e("./cameras/FloorplanCamera"),
  33910. C = e("./cameras/PanoramaCamera"),
  33911. I = e("./controls/DollhouseControls"),
  33912. E = e("./controls/FloorplanControls"),
  33913. b = e("./controls/PanoramaControls");
  33914. (n.ImageUtils.crossOrigin = o.crossOrigin),
  33915. (t.exports = {
  33916. shaders: d,
  33917. transitions: p,
  33918. Model: u,
  33919. Chunk: f,
  33920. Floor: v,
  33921. Skybox: m,
  33922. Reticule: g,
  33923. Panorama: c,
  33924. DollhouseCamera: A,
  33925. FloorplanCamera: y,
  33926. PanoramaCamera: C,
  33927. DollhouseControls: I,
  33928. FloorplanControls: E,
  33929. PanoramaControls: b,
  33930. getModel: function (e) {
  33931. if (!e.url) throw 'getModel(): missing parameter "url"';
  33932. e.autoload = void 0 === e.autoload || e.autoload;
  33933. var t = l.parseSidUrl(e.url);
  33934. (e.urlBase = t.urlBase),
  33935. (e.urlModel = t.urlModel),
  33936. (e.urlFiles = t.urlFiles);
  33937. var i = this._getPlatformError();
  33938. return i
  33939. ? $.Deferred().reject(i).promise()
  33940. : ((this.options = e),
  33941. this._loadModel().then(this._buildModel.bind(this)));
  33942. },
  33943. _getPlatformError: function () {
  33944. return "IE" === $.ua.browser.name &&
  33945. parseInt($.ua.browser.major) < 11
  33946. ? "webgl-unsupported"
  33947. : "iOS" === $.ua.os.name &&
  33948. /^[0-7][$\.]/.test($.ua.os.version)
  33949. ? "webgl-ios"
  33950. : Modernizr.webgl
  33951. ? null
  33952. : "webgl-unsupported";
  33953. },
  33954. _loadModel: function () {
  33955. return r
  33956. .get(this.options.urlModel, {
  33957. responseType: "json",
  33958. prefetchFrom: "model",
  33959. auth: l.getAuthorizationHeader(),
  33960. })
  33961. .then(null, function () {
  33962. return (
  33963. h.warn("Model loading failed at initial metadata load"),
  33964. "loading-failed"
  33965. );
  33966. });
  33967. },
  33968. _buildModel: function (e) {
  33969. e = l.normalizeModeldata(e, s);
  33970. var t = new u(this.options, e);
  33971. return this.options.autoload ? t.load(!0) : $.when(t);
  33972. },
  33973. });
  33974. }).call(this, "/js/showcase.js");
  33975. },
  33976. {
  33977. "./cameras/DollhouseCamera": 5,
  33978. "./cameras/FloorplanCamera": 6,
  33979. "./cameras/PanoramaCamera": 7,
  33980. "./controls/DollhouseControls": 10,
  33981. "./controls/FloorplanControls": 11,
  33982. "./controls/PanoramaControls": 13,
  33983. "./model/Model": 139,
  33984. "./objects/Chunk": 144,
  33985. "./objects/Floor": 146,
  33986. "./objects/Panorama": 148,
  33987. "./objects/Reticule": 149,
  33988. "./objects/Skybox": 152,
  33989. "./settings": 166,
  33990. "./shaders": 167,
  33991. "./util/ajax": 181,
  33992. "./util/logger": 189,
  33993. "./util/math": 190,
  33994. "./util/showcase": 193,
  33995. "./util/transitions": 195,
  33996. three: 217,
  33997. url: 208,
  33998. },
  33999. ],
  34000. 169: [
  34001. function (e, t, i) {
  34002. "use strict";
  34003. function n() {
  34004. var e = {
  34005. renderTarget: null,
  34006. inUse: !1,
  34007. size: -1,
  34008. pano: null,
  34009. };
  34010. return e;
  34011. }
  34012. function r(e) {
  34013. M.push(e);
  34014. }
  34015. function o(e) {
  34016. var t = n();
  34017. return (t.inUse = !0), (t.size = e), r(t), t;
  34018. }
  34019. function a(e) {
  34020. for (var t = 0; t < M.length; t++) {
  34021. var i = M[t];
  34022. if (!i.inUse && i.size === e) return (i.inUse = !0), i;
  34023. }
  34024. return null;
  34025. }
  34026. function s(e) {
  34027. for (var t = 0; t < M.length; t++) {
  34028. var i = M[t];
  34029. if (i.renderTarget === e) return (i.inUse = !1), !0;
  34030. }
  34031. return !1;
  34032. }
  34033. function l() {
  34034. (this.tileDirectory = {}),
  34035. (this.activeRenderTargetDescriptors = {}),
  34036. (this.activePanos = []),
  34037. (this.panoLODDescriptors = {}),
  34038. (this.panoDescriptors = {}),
  34039. (this.tileTrees = {}),
  34040. (this.sceneRenderer = null),
  34041. (this.tileDownloader = null),
  34042. (this.forceQueue = []),
  34043. (this.uploadQueues = {}),
  34044. (this.uploadInterval = null),
  34045. (this.uploadIntervalCancelled = !1),
  34046. (this.usingTileOverlay = !1),
  34047. (this.overlayTilesLoaded = !1),
  34048. (this.overlayTileBase = null),
  34049. (this.overlayTilesBasic = {}),
  34050. (this.overlayTilesEnhanced = {}),
  34051. (this.zoomRenderTarget = null),
  34052. (this.zoomPano = null),
  34053. (this.zoomingActive = !1),
  34054. (this.zoomPanoId = null),
  34055. (this.zoomPanoRenderingDisabled = !1),
  34056. (this.direction = new h.Vector3()),
  34057. (this.initTime = -1),
  34058. (this.maxBaseUploadsPerFrame = x),
  34059. (this.maxNonBaseUploadsPerFrame = T);
  34060. }
  34061. function c() {
  34062. this.uploadIntervalCancelled ||
  34063. (this.overlayTilesLoaded || !this.usingTileOverlay
  34064. ? ((b = !0),
  34065. this.updateUploadQueue(
  34066. this.maxNonBaseUploadsPerFrame,
  34067. this.maxBaseUploadsPerFrame
  34068. ),
  34069. this.peekNextFromUploadQueue()
  34070. ? this.refreshUploadInterval(w)
  34071. : (this.uploadInterval = null))
  34072. : this.refreshUploadInterval(this.uploadIntervalDelay));
  34073. }
  34074. /* function c() {
  34075. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  34076. this.updateUploadQueue(1, 2),
  34077. w = 18,
  34078. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  34079. } */
  34080. var h = e("three"),
  34081. u = e("../exception/BasicException"),
  34082. d = e("../settings"),
  34083. p = e("../enum/PanoSizeClass"),
  34084. f = (e("../objects/Panorama"), e("../enum/PanoRendererEvents")),
  34085. g = e("../enum/SceneRendererEvents"),
  34086. m = e("../enum/TileDownloaderEvents"),
  34087. v = e("../enum/Vectors"),
  34088. A =
  34089. (e("../enum/GLCubeFaces"),
  34090. e("../objects/Panorama"),
  34091. e("./TileTree")),
  34092. y = (e("./TileDownloader"), e("./TilePrioritizer")),
  34093. C = e("./TileUtils"),
  34094. p = e("../enum/PanoSizeClass"),
  34095. I = (e("../util/browser"), e("../util/panorama")),
  34096. E = e("events").EventEmitter,
  34097. b = !1,
  34098. w = d.tiling.uploadIntervalDelay,
  34099. _ = d.tiling.initialIntervalDelay,
  34100. T = d.tiling.maxNonBaseUploadsPerFrame,
  34101. x = d.tiling.maxBaseUploadsPerFrame,
  34102. S = {
  34103. Base: 0,
  34104. Remaining: 1,
  34105. },
  34106. M = [];
  34107. window.targetList = M;
  34108. (l.prototype = Object.create(E.prototype)),
  34109. (l.prototype.init = function (e, t, i) {
  34110. (this.sceneRenderer = e),
  34111. (this.tileDownloader = t),
  34112. (this.qualityManager = i),
  34113. this.bindEvents(),
  34114. this.sceneRenderer.on(
  34115. g.ContextCreated,
  34116. this.loadOverlayTiles.bind(this)
  34117. ),
  34118. (this.initTime = performance.now());
  34119. }),
  34120. (l.prototype.getActivePanoTextures = function (e) {
  34121. e = e || [];
  34122. for (var t = 0; t < M.length; t++) {
  34123. var i = M[t];
  34124. i.renderTarget &&
  34125. i.renderTarget.texture &&
  34126. e.push(i.renderTarget.texture);
  34127. }
  34128. }),
  34129. (l.prototype.hasQueuedTiles = function () {
  34130. var e = this.peekNextFromUploadQueue();
  34131. return null !== e && void 0 !== e;
  34132. }),
  34133. (l.prototype.getActiveRenderTargetDescriptor = function (e) {
  34134. return this.activeRenderTargetDescriptors[e];
  34135. }),
  34136. (l.prototype.setActiveRenderTargetDescriptor = function (e, t) {
  34137. this.activeRenderTargetDescriptors[e] = t;
  34138. }),
  34139. (l.prototype.loadOverlayTiles = function () {
  34140. if (0 !== d.tiling.overlayStyle) {
  34141. var e = 0,
  34142. t = function (t, n, r) {
  34143. (t = n
  34144. ? (t[n] = this.sceneRenderer.initSizedTexture2D(
  34145. C.TILE_SIZE,
  34146. h.ClampToEdgeWrapping
  34147. ))
  34148. : (this.overlayTileBase =
  34149. this.sceneRenderer.initSizedTexture2D(
  34150. C.TILE_SIZE,
  34151. h.ClampToEdgeWrapping
  34152. ))),
  34153. this.sceneRenderer.uploadTexture2D(
  34154. r,
  34155. t,
  34156. 0,
  34157. 0,
  34158. C.TILE_SIZE,
  34159. C.TILE_SIZE
  34160. ),
  34161. e++,
  34162. e === i.length && (this.overlayTilesLoaded = !0);
  34163. }.bind(this),
  34164. i = [
  34165. [
  34166. "images/outlineBase.png",
  34167. t.bind(this, this.overlayTileBase, null),
  34168. ],
  34169. [
  34170. "images/outlineBasic512.png",
  34171. t.bind(this, this.overlayTilesBasic, 256),
  34172. ],
  34173. [
  34174. "images/outlineBasic512.png",
  34175. t.bind(this, this.overlayTilesBasic, 512),
  34176. ],
  34177. [
  34178. "images/outlineBasic1024.png",
  34179. t.bind(this, this.overlayTilesBasic, 1024),
  34180. ],
  34181. [
  34182. "images/outlineBasic2048.png",
  34183. t.bind(this, this.overlayTilesBasic, 2048),
  34184. ],
  34185. [
  34186. "images/outlineBasic4096.png",
  34187. t.bind(this, this.overlayTilesBasic, 4096),
  34188. ],
  34189. [
  34190. "images/outlineEnhanced512.png",
  34191. t.bind(this, this.overlayTilesEnhanced, 256),
  34192. ],
  34193. [
  34194. "images/outlineEnhanced512.png",
  34195. t.bind(this, this.overlayTilesEnhanced, 512),
  34196. ],
  34197. [
  34198. "images/outlineEnhanced1024.png",
  34199. t.bind(this, this.overlayTilesEnhanced, 1024),
  34200. ],
  34201. [
  34202. "images/outlineEnhanced2048.png",
  34203. t.bind(this, this.overlayTilesEnhanced, 2048),
  34204. ],
  34205. [
  34206. "images/outlineEnhanced4096.png",
  34207. t.bind(this, this.overlayTilesEnhanced, 4096),
  34208. ],
  34209. ];
  34210. i.forEach(
  34211. function (e) {
  34212. this.tileDownloader.loadImage(e[0], 0, e[1]);
  34213. }.bind(this)
  34214. ),
  34215. (this.usingTileOverlay = !0);
  34216. } else this.usingTileOverlay = !1;
  34217. }),
  34218. (l.prototype.bindEvents = function () {
  34219. this.tileDownloader.on(
  34220. m.TileDownloadSuccess,
  34221. this.onTileDownloaded.bind(this)
  34222. );
  34223. }),
  34224. (l.prototype.setupZoomRenderTarget = (function () {
  34225. var targets = {};
  34226. return function () {
  34227. if (
  34228. this.qualityManager.maxRenderTargetSize == "2k" &&
  34229. this.qualityManager.getMaxNavPanoSize() == "2k"
  34230. )
  34231. return; //不使用zoomTarget 直接用pano的tiledPanoRenderTarget,防崩溃
  34232. if (
  34233. this.qualityManager.getMaxZoomPanoSize() >=
  34234. this.qualityManager.getMaxNavPanoSize()
  34235. ) {
  34236. if (
  34237. this.zoomRenderTarget &&
  34238. this.zoomRenderTarget.width ===
  34239. this.qualityManager.getMaxZoomPanoSize()
  34240. )
  34241. return;
  34242. var e = this.zoomRenderTarget;
  34243. var size = this.qualityManager.getMaxZoomPanoSize();
  34244. if (size > this.qualityManager.maxRenderTargetSize) {
  34245. return;
  34246. }
  34247. if (targets[size]) {
  34248. this.zoomRenderTarget = targets[size];
  34249. } else {
  34250. this.zoomRenderTarget = this.initTiledPano(size, true); //放大后不使用抗锯齿,否则消耗更多内存
  34251. targets[size] = this.zoomRenderTarget;
  34252. }
  34253. if (e) {
  34254. //将旧的zoomRenderTarget渲染到新zoomRenderTarget上
  34255. var t = e.width,
  34256. i = this.zoomRenderTarget.width;
  34257. this.sceneRenderer.copyCubeMap(
  34258. e.texture,
  34259. this.zoomRenderTarget,
  34260. t,
  34261. t,
  34262. i,
  34263. i
  34264. ),
  34265. e.texture.dispose(),
  34266. (e.texture.loaded = !1),
  34267. (e.texture.version = 0),
  34268. this.sceneRenderer.deallocateCubeTexture(e.texture),
  34269. (e.texture = null);
  34270. }
  34271. this.zoomPanoRenderingDisabled = !1;
  34272. } else this.zoomPanoRenderingDisabled = !0;
  34273. };
  34274. })()),
  34275. (l.prototype.enableHighQuality = function (e) {
  34276. //xzw add 如果最多只要2k图的话enableUltraHighQualityMode替换成这个
  34277. if (!this.qualityManager.highQualityModeStarted) {
  34278. this.setupZoomRenderTarget();
  34279. e();
  34280. this.qualityManager.highQualityModeStarted = true;
  34281. }
  34282. }),
  34283. (l.prototype.enableUltraHighQualityMode = function (e) {
  34284. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  34285. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  34286. this.tileDownloader.testDownload(
  34287. t,
  34288. C.TILE_SIZE,
  34289. function (t) {
  34290. t &&
  34291. (this.qualityManager.enableUltraHighQualityMode(),
  34292. this.setupZoomRenderTarget(),
  34293. e());
  34294. }.bind(this)
  34295. );
  34296. }
  34297. }),
  34298. (l.prototype.activateTiledPano = function (e, t, i) {
  34299. i && this.clearAllQueuedUploads();
  34300. for (var n = 0; n < C.FACES_PER_PANO; n++)
  34301. this.initTileTree(
  34302. e.id,
  34303. n,
  34304. this.qualityManager.getMaxPossiblePanoSize()
  34305. );
  34306. this.linkAllTilesAndNodes(e);
  34307. var r = this.getActiveRenderTargetDescriptor(e.id),
  34308. l = t;
  34309. if (
  34310. (l > this.qualityManager.getMaxNavPanoSize() &&
  34311. (l = this.qualityManager.getMaxNavPanoSize()),
  34312. !r || l !== r.size)
  34313. ) {
  34314. if ((r && s(r.renderTarget), (r = a(l)), !r)) {
  34315. var c = this.initTiledPano(l, !browser.isMobile() /* !1 */);
  34316. (r = o(c.width)), (r.renderTarget = c);
  34317. }
  34318. (r.pano = e),
  34319. this.resetPanoDescriptor(e.id),
  34320. this.resetPanoLODDescriptors(e.id),
  34321. this.resetRenderStatus(e.id, !0, !0);
  34322. }
  34323. this.setActiveRenderTargetDescriptor(e.id, r);
  34324. var h = i ? 0 : 1;
  34325. return this.updateActivePanos(e, h), r.renderTarget;
  34326. }),
  34327. (l.prototype.deactivateTiledPano = function (e) {
  34328. var t = this.getActiveRenderTargetDescriptor(e.id);
  34329. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  34330. this.setActiveRenderTargetDescriptor(e.id, null);
  34331. var i = this.getUploadQueueForPano(e.id);
  34332. this.clearUploadQueue(i), this.updateActivePanos();
  34333. }),
  34334. (l.prototype.updateActivePanos = (function () {
  34335. var e = [];
  34336. return function (t, i) {
  34337. e.length = 0;
  34338. for (var n = 0; n < this.activePanos.length; n++) {
  34339. t && e.length === i && e.push(t);
  34340. var r = this.activePanos[n],
  34341. o = this.getActiveRenderTargetDescriptor(r.id);
  34342. (t && r.id === t.id) ||
  34343. !this.isRenderTargetDescriptorValid(o) ||
  34344. e.push(r);
  34345. }
  34346. t && i >= e.length && e.push(t),
  34347. (this.activePanos.length = 0),
  34348. this.activePanos.push.apply(this.activePanos, e);
  34349. };
  34350. })()),
  34351. (l.prototype.getActivePanoCount = function () {
  34352. return this.activePanos.length;
  34353. }),
  34354. (l.prototype.resetRenderStatus = function (e, t, i, n) {
  34355. var r = null;
  34356. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  34357. for (
  34358. var o = function (e, n, r, o) {
  34359. i && (n.tile.zoomUploaded = !1), t && (n.tile.uploaded = !1);
  34360. },
  34361. a = 0;
  34362. a < C.FACES_PER_PANO;
  34363. a++
  34364. ) {
  34365. var s = this.getTileTree(e, a);
  34366. s.breadthFirst({
  34367. callback: o.bind(this, a),
  34368. minLevel: r,
  34369. });
  34370. }
  34371. }),
  34372. (l.prototype.copyBaseRenderStatusToZoomed = function (e) {
  34373. for (
  34374. var t = A.getLevelCountForSize(
  34375. C.TILE_SIZE,
  34376. this.qualityManager.getMaxNavPanoSize()
  34377. ),
  34378. i = function (e, t, i, n) {
  34379. (t.tile.zoomUploaded = t.tile.uploaded),
  34380. (t.zoomCovered = t.covered);
  34381. },
  34382. n = 0;
  34383. n < C.FACES_PER_PANO;
  34384. n++
  34385. ) {
  34386. var r = this.getTileTree(e, n);
  34387. r.breadthFirst({
  34388. callback: i.bind(this, n),
  34389. maxLevel: t,
  34390. });
  34391. }
  34392. }),
  34393. (l.prototype.renderPanoTiles = (function () {
  34394. var e = [];
  34395. return function (t, i, n, r) {
  34396. (this.zoomRenderTarget &&
  34397. this.zoomRenderTarget.width ===
  34398. this.qualityManager.getMaxZoomPanoSize()) ||
  34399. this.zoomPanoRenderingDisabled ||
  34400. this.setupZoomRenderTarget(),
  34401. (i = i || this.direction || v.FORWARD);
  34402. var o = this.getActiveRenderTargetDescriptor(t);
  34403. if (!this.isRenderTargetDescriptorValid(o))
  34404. throw new u(
  34405. "PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated."
  34406. );
  34407. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  34408. var s = this.getTileTree(t, a);
  34409. (e.length = 0),
  34410. s.breadthFirst({
  34411. saveVisited: e,
  34412. });
  34413. for (var l = 0; l < e.length; l++) {
  34414. var c = e[l];
  34415. this.queueTileUpload(c.tile, !1, r || (0 === l && n));
  34416. }
  34417. }
  34418. this.updateDirection(i);
  34419. };
  34420. })()),
  34421. (l.prototype.isRenderTargetDescriptorValid = function (e) {
  34422. return e && e.renderTarget;
  34423. }),
  34424. (l.prototype.isPanoActive = function (e) {
  34425. var t = this.getActiveRenderTargetDescriptor(e);
  34426. return this.isRenderTargetDescriptorValid(t);
  34427. }),
  34428. (l.prototype.isPanoZoomed = function (e) {
  34429. return this.zoomingActive && this.zoomPanoId === e;
  34430. }),
  34431. (l.prototype.initTileTree = function (e, t, i) {
  34432. var n = this.tileTrees[e];
  34433. n || ((n = []), (this.tileTrees[e] = n));
  34434. var r = n[t];
  34435. if (!r) {
  34436. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  34437. (r = new A(C.TILE_SIZE, o)), (n[t] = r);
  34438. }
  34439. }),
  34440. (l.prototype.getTileTree = function (e, t) {
  34441. var i = this.tileTrees[e];
  34442. if (!i)
  34443. throw new u(
  34444. "PanoRenderer.getTileTree() -> Tree array not yet initialized!"
  34445. );
  34446. var n = i[t];
  34447. if (!n)
  34448. throw new u(
  34449. "PanoRenderer.getTileTree() -> Tree not yet initialized!"
  34450. );
  34451. return n;
  34452. }),
  34453. (l.prototype.initTiledPano = function (e, antialias) {
  34454. var i = this.sceneRenderer.renderer,
  34455. n =
  34456. (i.context,
  34457. new h.WebGLRenderTargetCube(e, e, {
  34458. stencilBuffer: !1,
  34459. })),
  34460. r = new h.CubeTexture([]);
  34461. (n.texture = r),
  34462. (r.image = [null, null, null, null, null, null]),
  34463. (r.flipY = !0),
  34464. //antialias: 如果抗锯齿的话,采用mipmap,会增加一倍的存储消耗。原版本都是不抗锯齿的。但是抗锯齿效果更柔和
  34465. antialias
  34466. ? ((r.generateMipmaps = !0),
  34467. (r.magFilter = h.LinearFilter),
  34468. (r.minFilter = h.LinearMipMapLinearFilter))
  34469. : ((r.generateMipmaps = !1),
  34470. (r.magFilter = h.LinearFilter),
  34471. (r.minFilter = h.LinearFilter)),
  34472. (r.format = h.RGBAFormat),
  34473. i.setRenderTarget(n),
  34474. i.setRenderTarget(null);
  34475. var o = i.properties.get(r);
  34476. return (o.__image__webglTextureCube = o.__webglTexture), n;
  34477. }),
  34478. (l.prototype.getUploadQueueForPano = function (e) {
  34479. var t = this.uploadQueues[e];
  34480. return t || ((t = []), (this.uploadQueues[e] = t)), t;
  34481. }),
  34482. (l.prototype.isTileUploaded = function (e) {
  34483. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded;
  34484. }),
  34485. (l.prototype.setUploaded = function (e, t) {
  34486. this.isPanoZoomed(e.panoId)
  34487. ? (e.zoomUploaded = t)
  34488. : (e.uploaded = t);
  34489. }),
  34490. (l.prototype.queueTileUpload = function (e, t, i) {
  34491. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  34492. if (
  34493. this.isRenderTargetDescriptorValid(n) &&
  34494. e.downloaded &&
  34495. !this.isTileUploaded(e) &&
  34496. (!e.uploadQueued || i) &&
  34497. (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) ||
  34498. this.zoomingActive)
  34499. ) {
  34500. var r = this.getUploadQueueForPano(e.panoId);
  34501. i
  34502. ? this.uploadTile(e, !1)
  34503. : (this.shoulPushToFrontOfQueue(e)
  34504. ? this.forceQueue.push(e)
  34505. : t && this.direction
  34506. ? y.insertSortedPanoTile(r, e, n.pano, this.direction)
  34507. : r.push(e),
  34508. (e.uploadQueued = !0),
  34509. this.uploadInterval ||
  34510. this.uploadIntervalCancelled ||
  34511. this.refreshUploadInterval(0));
  34512. }
  34513. }),
  34514. (l.prototype.shoulPushToFrontOfQueue = function (e) {
  34515. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize);
  34516. }),
  34517. (l.prototype.getTopUploadQueue = function () {
  34518. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  34519. for (var n = 0; n < this.activePanos.length; n++)
  34520. if (
  34521. ((e = this.activePanos[n]),
  34522. (t = this.getUploadQueueForPano(e.id)),
  34523. t.length > 0)
  34524. )
  34525. switch (i) {
  34526. case S.Base:
  34527. if (0 === t[0].level) return t;
  34528. break;
  34529. case S.Remaining:
  34530. return t;
  34531. }
  34532. return null;
  34533. }),
  34534. (l.prototype.getNextFromUploadQueue = (function () {
  34535. var e = function (e) {
  34536. var t = e.shift();
  34537. return (t.uploadQueued = !1), t;
  34538. };
  34539. return function () {
  34540. if (this.forceQueue.length > 0) return e(this.forceQueue);
  34541. var t = this.getTopUploadQueue();
  34542. return t && t.length > 0 ? e(t) : null;
  34543. };
  34544. })()),
  34545. (l.prototype.peekNextFromUploadQueue = function () {
  34546. if (this.forceQueue.length > 0) return this.forceQueue[0];
  34547. var e = this.getTopUploadQueue();
  34548. return e && e.length > 0 ? e[0] : null;
  34549. }),
  34550. (l.prototype.clearAllQueuedUploads = function () {
  34551. this.clearAllUploadQueues(null, 0);
  34552. }),
  34553. (l.prototype.clearAllQueuedUploadsForPano = function (e) {
  34554. this.clearAllUploadQueues(e, 0);
  34555. }),
  34556. (l.prototype.clearAllUploadQueues = function (e, t) {
  34557. if (e)
  34558. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  34559. this.clearUploadQueue(this.forceQueue, t, e);
  34560. else {
  34561. for (var i = 0; i < this.activePanos.length; i++) {
  34562. var n = this.activePanos[i];
  34563. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t);
  34564. }
  34565. this.clearUploadQueue(this.forceQueue, t);
  34566. }
  34567. }),
  34568. (l.prototype.clearUploadQueue = function (e, t, i) {
  34569. (void 0 !== t && null !== t) || (t = 0);
  34570. for (var n = 0; n < e.length; ) {
  34571. var r = e[n];
  34572. (!i || (i && i === r.tile.panoId)) && r.level >= t
  34573. ? ((r.uploadQueued = !1), e.splice(n, 1))
  34574. : n++;
  34575. }
  34576. }),
  34577. (l.prototype.refreshUploadInterval = (function () {
  34578. var e = null;
  34579. return function (t) {
  34580. this.uploadIntervalCancelled ||
  34581. (e || (e = c.bind(this)),
  34582. (null !== t && void 0 !== t) || (t = w),
  34583. b || (t = _),
  34584. (this.uploadInterval = window.setTimeout(e, t)),
  34585. (this.uploadIntervalDelay = t));
  34586. };
  34587. })()),
  34588. (l.prototype.update = (function () {
  34589. var e = performance.now(),
  34590. t = 0;
  34591. return function () {
  34592. (this.uploadIntervalCancelled = !0),
  34593. window.clearTimeout(this.uploadInterval),
  34594. (this.uploadInterval = null);
  34595. var i = performance.now() - e;
  34596. !(i > w || 0 === t) ||
  34597. (!this.overlayTilesLoaded && this.usingTileOverlay) ||
  34598. (this.updateUploadQueue(
  34599. this.maxNonBaseUploadsPerFrame,
  34600. this.maxBaseUploadsPerFrame
  34601. ),
  34602. (e = performance.now())),
  34603. t++;
  34604. };
  34605. })()),
  34606. (l.prototype.updateUploadQueue = function (e, t) {
  34607. e || (e = 1);
  34608. for (var i = 0, n = 0; ; ) {
  34609. if (n >= t || i >= e) break;
  34610. var r = this.getNextFromUploadQueue();
  34611. if (!r) break;
  34612. if (
  34613. (0 !== r.level ? i++ : n++,
  34614. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) ||
  34615. this.zoomingActive)
  34616. ) {
  34617. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  34618. this.isRenderTargetDescriptorValid(o) &&
  34619. this.uploadTile(r, r.forceUpload);
  34620. }
  34621. }
  34622. }),
  34623. (l.prototype.updateDirection = function (e) {
  34624. if ((e = e || this.direction)) {
  34625. this.direction = e;
  34626. for (var t = 0; t < this.activePanos.length; t++) {
  34627. var i = this.activePanos[t],
  34628. n = this.getUploadQueueForPano(i.id);
  34629. y.sortPanoTiles(n, i, this.direction);
  34630. }
  34631. }
  34632. }),
  34633. (l.prototype.uploadTile = (function () {
  34634. var e = {},
  34635. t = (new h.Vector4(), d.tiling.overlayStyle);
  34636. //var failHistory = {};
  34637. return function (i, n) {
  34638. var r = i.panoId,
  34639. o = i.image,
  34640. a = i.tileSize,
  34641. s = i.panoSize,
  34642. l = i.tileIndex,
  34643. c = (i.faceTileIndex, i.totalTiles),
  34644. u = (i.face, i.tileX),
  34645. d = i.tileY,
  34646. p = !0,
  34647. g = !1,
  34648. m =
  34649. (this.getPanoDescriptor(r), this.getPanoLODDescriptor(r, s)),
  34650. v = this.getActiveRenderTargetDescriptor(r),
  34651. A = v.renderTarget,
  34652. y = v.size;
  34653. if (
  34654. (this.isPanoZoomed(r) &&
  34655. ((A = this.zoomRenderTarget), (y = A.width)), //this.qualityManager.getMaxZoomPanoSize()),
  34656. this.isRenderTargetDescriptorValid(v) || ((p = !1), (g = !1)),
  34657. n ||
  34658. (this.anyUploaded(i.node) && ((p = !1), (g = !0)),
  34659. this.isTileUploaded(i) && ((p = !1), (g = !1))),
  34660. p)
  34661. ) {
  34662. /* if(failHistory[''+r+s+l]){
  34663. console.log('uploadTile retry', r, s, l)
  34664. }
  34665. console.log('uploadTile 成功', r, s, l)
  34666. */
  34667. var C = u * a,
  34668. I = d * a,
  34669. E = (a / s) * y,
  34670. b = (C / s) * y,
  34671. w = (I / s) * y;
  34672. if (s > this.qualityManager.maxRenderTargetSize) {
  34673. player.model.getHighImage(o, i.cubeFace, u, d);
  34674. } else {
  34675. e[a] ||
  34676. (e[a] = this.sceneRenderer.initSizedTexture2D(
  34677. a,
  34678. h.ClampToEdgeWrapping
  34679. ));
  34680. var _ = e[a];
  34681. this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a);
  34682. if (1 === t || 2 === t) {
  34683. var T =
  34684. 1 === t
  34685. ? this.overlayTilesBasic
  34686. : this.overlayTilesEnhanced;
  34687. this.sceneRenderer.renderToCubeMap(
  34688. _,
  34689. A,
  34690. a,
  34691. a,
  34692. 0,
  34693. 0,
  34694. a,
  34695. a,
  34696. b,
  34697. w,
  34698. E,
  34699. E,
  34700. i.cubeFace
  34701. ),
  34702. this.sceneRenderer.renderToCubeMap(
  34703. T[s],
  34704. A,
  34705. a,
  34706. a,
  34707. 0,
  34708. 0,
  34709. a,
  34710. a,
  34711. b,
  34712. w,
  34713. E,
  34714. E,
  34715. i.cubeFace,
  34716. h.NormalBlending,
  34717. !0,
  34718. 0.5
  34719. );
  34720. } else
  34721. this.sceneRenderer.renderToCubeMap(
  34722. _,
  34723. A,
  34724. a,
  34725. a,
  34726. 0,
  34727. 0,
  34728. a,
  34729. a,
  34730. b,
  34731. w,
  34732. E,
  34733. E,
  34734. i.cubeFace
  34735. );
  34736. }
  34737. m.uploadCount++,
  34738. this.emit(f.TileRenderSuccess, r, s, l, c),
  34739. m.uploadCount === c &&
  34740. this.emit(f.PanoRenderComplete, r, s, c),
  34741. this.setUploaded(i, !0),
  34742. this.addCoverageForNode(i.node);
  34743. } else {
  34744. this.setUploaded(i, !1);
  34745. //console.log('uploadTile 失败', r, s, l)
  34746. //failHistory[''+r+s+l] = true;
  34747. }
  34748. return (
  34749. i.uploadAttempted ||
  34750. (m.uploadAttempts++,
  34751. this.emit(f.TileUploadAttempted, r, s, l, c)),
  34752. (i.uploadAttempted = !0),
  34753. m.uploadAttempts === c &&
  34754. this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  34755. g
  34756. );
  34757. };
  34758. })()),
  34759. (l.prototype.linkTileAndNode = function (e, t) {
  34760. (t.tile = e), (e.node = t);
  34761. }),
  34762. (l.prototype.linkAllTilesAndNodes = function (e) {
  34763. for (
  34764. var t = function (t, i, n, r, o) {
  34765. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  34766. this.linkTileAndNode(a, n);
  34767. },
  34768. i = 0;
  34769. i < C.FACES_PER_PANO;
  34770. i++
  34771. ) {
  34772. var n = this.getTileTree(e.id, i);
  34773. n.breadthFirst({
  34774. callback: t.bind(this, n, i),
  34775. });
  34776. }
  34777. }),
  34778. (l.prototype.anyUploaded = function (e) {
  34779. if (!e) return !1;
  34780. if (e.tile && this.isTileUploaded(e.tile)) return !0;
  34781. if (e.children)
  34782. for (var t = 0; t < e.children.length; t++) {
  34783. var i = e.children[t];
  34784. if (this.anyUploaded(i)) return !0;
  34785. }
  34786. return !1;
  34787. }),
  34788. (l.prototype.setNodeCovered = function (e, t) {
  34789. this.isPanoZoomed(e.tile.panoId)
  34790. ? (e.zoomCovered = t)
  34791. : (e.covered = t);
  34792. }),
  34793. (l.prototype.isNodeCovered = function (e) {
  34794. return (
  34795. !!e &&
  34796. (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  34797. );
  34798. }),
  34799. (l.prototype.addCoverageForNode = function (e) {
  34800. if ((this.setNodeCovered(e, !0), e.parent && e.covered)) {
  34801. var t = e.parent;
  34802. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0);
  34803. }
  34804. }),
  34805. (l.prototype.calcFullCoverage = function (e) {
  34806. var t = !1;
  34807. if (e.children)
  34808. for (var i = 0; i < e.children.length; i++) {
  34809. var n = e.children[i];
  34810. t = t || this.calcFullCoverage(n);
  34811. }
  34812. e.covered = e.tile.uploaded || t;
  34813. }),
  34814. (l.prototype.nodeSubcovered = function (e) {
  34815. if (!e.children) return !1;
  34816. for (var t = 0; t < e.children.length; t++)
  34817. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  34818. return !1;
  34819. return !0;
  34820. }),
  34821. (l.prototype.resetPanoDescriptor = function (e) {
  34822. this.getPanoDescriptor(e);
  34823. }),
  34824. (l.prototype.getPanoDescriptor = function (e) {
  34825. var t = this.panoDescriptors[e];
  34826. return t || ((t = {}), (this.panoDescriptors[e] = t)), t;
  34827. }),
  34828. (l.prototype.resetPanoLODDescriptors = function (e) {
  34829. var t = this.getPanoLODDescriptors(e);
  34830. for (var i in t)
  34831. if (t.hasOwnProperty(i)) {
  34832. var n = t[i];
  34833. (n.uploadCount = 0), (n.uploadAttempts = 0);
  34834. }
  34835. }),
  34836. (l.prototype.getPanoLODDescriptor = function (e, t) {
  34837. var i = this.getPanoLODDescriptors(e),
  34838. n = i[t];
  34839. return (
  34840. n ||
  34841. ((n = {
  34842. uploadCount: 0,
  34843. uploadAttempts: 0,
  34844. }),
  34845. (i[t] = n)),
  34846. n
  34847. );
  34848. }),
  34849. (l.prototype.getPanoLODDescriptors = function (e) {
  34850. var t = this.panoLODDescriptors[e];
  34851. return t || ((t = {}), (this.panoLODDescriptors[e] = t)), t;
  34852. }),
  34853. (l.prototype.onTileDownloaded = function (e) {
  34854. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize),
  34855. i = this.getTileDirectoryEntry(
  34856. e.panoId,
  34857. e.face,
  34858. t,
  34859. e.faceTileIndex
  34860. );
  34861. if (
  34862. ((i.downloaded = !0),
  34863. (i.image = e.image),
  34864. (i.panoSize = e.panoSize),
  34865. (i.tileX = e.tileX),
  34866. (i.tileY = e.tileY),
  34867. (i.totalTiles = e.totalTiles),
  34868. (i.tileIndex = e.tileIndex),
  34869. (i.faceTileIndex = e.faceTileIndex),
  34870. (i.face = e.face),
  34871. (i.cubeFace = I.mapFaceToCubemapFace(e.face)),
  34872. (i.panoId = e.panoId),
  34873. (i.tileSize = e.tileSize),
  34874. (i.direction = new h.Vector3().copy(e.direction)),
  34875. (i.node = null),
  34876. (i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize)),
  34877. this.isPanoActive(i.panoId))
  34878. ) {
  34879. var n = this.getTileTree(i.panoId, i.face),
  34880. r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  34881. this.linkTileAndNode(i, r), this.queueTileUpload(i, !0);
  34882. }
  34883. }),
  34884. (l.prototype.getTileDirectoryEntry = function (e, t, i, n) {
  34885. var r = this.tileDirectory[e];
  34886. r || ((r = {}), (this.tileDirectory[e] = r));
  34887. var o = 16384 * t + 1024 * i + n,
  34888. a = r[o];
  34889. return (
  34890. a ||
  34891. ((a = {
  34892. downloaded: !1,
  34893. uploaded: !1,
  34894. zoomUploaded: !1,
  34895. }),
  34896. (r[o] = a)),
  34897. (a._key = e + ":" + t + ":" + i + ":" + n),
  34898. (a._tileKey = o),
  34899. a
  34900. );
  34901. }),
  34902. (l.prototype.setZoomingActive = function (e, t, i) {
  34903. this.zoomPanoRenderingDisabled ||
  34904. (e === this.zoomingActive && this.zoomPanoId === t.id) ||
  34905. ((this.zoomingActive = e),
  34906. (this.zoomPanoId = t.id),
  34907. this.zoomingActive &&
  34908. (this.zoomPanoId !== t.id || i) &&
  34909. this.updateZoomedPanoFromBase(t));
  34910. }),
  34911. (l.prototype.updateZoomedPanoFromBase = function (e) {
  34912. if (!this.zoomPanoRenderingDisabled) {
  34913. var t = this.getActiveRenderTargetDescriptor(e.id);
  34914. if (t && t.renderTarget) {
  34915. var i = Math.min(
  34916. this.qualityManager.maxRenderTargetSize,
  34917. this.qualityManager.getMaxZoomPanoSize()
  34918. ), //this.qualityManager.getMaxZoomPanoSize()
  34919. n = t.renderTarget,
  34920. r = t.size;
  34921. this.sceneRenderer.copyCubeMap(
  34922. n.texture,
  34923. this.zoomRenderTarget,
  34924. r,
  34925. r,
  34926. i,
  34927. i
  34928. ),
  34929. this.copyBaseRenderStatusToZoomed(e.id);
  34930. }
  34931. }
  34932. }),
  34933. (t.exports = l);
  34934. },
  34935. {
  34936. "../enum/GLCubeFaces": 25,
  34937. "../enum/PanoRendererEvents": 35,
  34938. "../enum/PanoSizeClass": 36,
  34939. "../enum/SceneRendererEvents": 43,
  34940. "../enum/TileDownloaderEvents": 45,
  34941. "../enum/Vectors": 50,
  34942. "../exception/BasicException": 55,
  34943. "../objects/Panorama": 148,
  34944. "../settings": 166,
  34945. "../util/browser": 182,
  34946. "../util/panorama": 191,
  34947. "./TileDownloader": 171,
  34948. "./TilePrioritizer": 172,
  34949. "./TileTree": 173,
  34950. "./TileUtils": 174,
  34951. events: 202,
  34952. three: 217,
  34953. },
  34954. ],
  34955. 170: [
  34956. function (e, t, i) {
  34957. "use strict";
  34958. function n(e, t, i) {
  34959. (this.maxNavPanoSize = -1),
  34960. (this.maxZoomPanoSize = -1),
  34961. (this.devicePixelDensity = e),
  34962. (this.deviceScreenSize = t),
  34963. (this.clientBandwidth = i),
  34964. (this.panoSizeClassMap = {}),
  34965. (this.useHighResolutionPanos = !0),
  34966. (this.useUltraHighResolutionPanos = !1),
  34967. (this.modelHasUltraHighPanos = !1);
  34968. this.maxRenderTargetSize = a.isMobile() ? 2048 : 4096; //add
  34969. }
  34970. var r = e("../enum/PanoSizeClass"),
  34971. o = e("../settings"),
  34972. a = e("../util/browser"),
  34973. s = e("../constants"),
  34974. l = e("../util/showcase"),
  34975. c = e("../enum/ModelManagerEvents");
  34976. (n.prototype.init = function (e) {
  34977. this.buildPanoSizeClassMap(
  34978. this.devicePixelDensity,
  34979. this.deviceScreenSize,
  34980. this.clientBandwidth
  34981. ),
  34982. (this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH)),
  34983. (this.highSize = this.getPanoSize(r.HIGH)),
  34984. (this.standardSize = this.getPanoSize(r.STANDARD)),
  34985. (this.baseSize = this.getPanoSize(r.BASE)),
  34986. o.tiling.maxZoomPanoQuality &&
  34987. this.ultraHighSize <= o.tiling.maxZoomPanoQuality &&
  34988. (o.tiling.allowUltraHighResolution = !0),
  34989. (this.highQualityThreshold = a.valueFromHash(
  34990. "threshold2k",
  34991. s.windowHeightHighQualityThreshold
  34992. )),
  34993. this.updateMaximums(),
  34994. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this));
  34995. }),
  34996. (n.prototype.updateFromModel = function (e) {
  34997. this.updateHighResolutionSettings(e),
  34998. this.updateUltraHighResolutionSettings(e);
  34999. }),
  35000. (n.prototype.updateHighResolutionSettings = function (e) {
  35001. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  35002. l.modelDataPromisesTiles(e.data)
  35003. ? (this.useHighResolutionPanos = !0)
  35004. : (this.useHighResolutionPanos = !1),
  35005. //this.useHighResolutionPanos = !0;
  35006. //----------------------e n d -----------------------------------------------------------------
  35007. this.updateMaximums();
  35008. }),
  35009. (n.prototype.updateUltraHighResolutionSettings = function (e) {
  35010. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos
  35011. ? (this.useUltraHighResolutionPanos = !0)
  35012. : (this.useUltraHighResolutionPanos = !1),
  35013. this.updateMaximums();
  35014. }),
  35015. (n.prototype.enableUltraHighQualityMode = function () {
  35016. (this.modelHasUltraHighPanos = !0),
  35017. this.updateUltraHighResolutionSettings(null);
  35018. }),
  35019. (n.prototype.ultraHighQualityModeEnabled = function () {
  35020. return this.modelHasUltraHighPanos;
  35021. }),
  35022. (n.prototype.onModelChanged = function (e) {
  35023. this.updateFromModel(e.model), this.updateMaximums();
  35024. }),
  35025. (n.prototype.updateMaximums = function () {
  35026. (this.maxNavPanoSize =
  35027. o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize()),
  35028. (this.maxZoomPanoSize =
  35029. o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize()),
  35030. this.maxZoomPanoSize < this.maxNavPanoSize &&
  35031. (this.maxNavPanoSize = this.maxZoomPanoSize);
  35032. }),
  35033. (n.prototype.buildPanoSizeClassMap = function () {
  35034. (this.panoSizeClassMap[r.BASE] = 512),
  35035. (this.panoSizeClassMap[r.STANDARD] = 1024),
  35036. (this.panoSizeClassMap[r.HIGH] = 2048),
  35037. (this.panoSizeClassMap[r.ULTRAHIGH] = 4096);
  35038. }),
  35039. (n.prototype.getPanoSize = function (e) {
  35040. return this.panoSizeClassMap[e];
  35041. }),
  35042. (n.prototype.getMaxPossiblePanoSize = function () {
  35043. return this.getPanoSize(r.ULTRAHIGH);
  35044. }),
  35045. (n.prototype.getMaxPanoSize = function () {
  35046. return this.maxZoomPanoSize;
  35047. }),
  35048. (n.prototype.getMaxNavPanoSize = function () {
  35049. return this.maxNavPanoSize;
  35050. }),
  35051. (n.prototype.getMaxZoomPanoSize = function () {
  35052. return this.maxZoomPanoSize;
  35053. }),
  35054. /* n.prototype.detectMaxNavPanoSizeClass = function() {
  35055. if(settings.mobileNavHigh)return r.HIGH //改
  35056. else return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  35057. } */
  35058. (n.prototype.detectDevice = function () {
  35059. //add
  35060. if (a.isMobile()) {
  35061. let area = $("#player").width() * $("#player").height();
  35062. if (area < 768 * 1024) {
  35063. //ipad mini full screen 大场景拍的质量很好默认不需要很高清
  35064. return "mobile";
  35065. } else {
  35066. return "bigMobile";
  35067. }
  35068. } else {
  35069. return "pc";
  35070. }
  35071. });
  35072. (n.prototype.detectMaxNavPanoSizeClass = function () {
  35073. //xzw 改
  35074. switch (this.getNavZoomClass()) {
  35075. case "1k":
  35076. return r.STANDARD;
  35077. break;
  35078. case "2k":
  35079. default:
  35080. return r.HIGH;
  35081. case "4k":
  35082. return r.ULTRAHIGH;
  35083. }
  35084. }),
  35085. (n.prototype.detectMaxNavPanoSize = function () {
  35086. var e = this.detectMaxNavPanoSizeClass();
  35087. return this.getPanoSize(e);
  35088. }),
  35089. (n.prototype.getMaxZoomClass = function () {
  35090. //add
  35091. let type = this.detectDevice();
  35092. let setting = settings.tileClass[type]; //见manage.js的settings
  35093. return setting.max;
  35094. });
  35095. (n.prototype.getNavZoomClass = function () {
  35096. //add
  35097. let type = this.detectDevice();
  35098. let setting = settings.tileClass[type];
  35099. return setting.nav;
  35100. }),
  35101. (n.prototype.detectMaxZoomPanoSize = function () {
  35102. //获取当前zoomRenderTarget应下载的最高级别
  35103. //若是有三个级别,每次只需要加载到当前的zoomLevel;而两级时因为有zoomed来判断是使用基本贴图还是zoomRenderTarget,所以只需要返回最大的即可
  35104. if (this.zoomLevelResolution) {
  35105. //有三个级别
  35106. if (
  35107. this.zoomLevelResolution == "4k" &&
  35108. this.useUltraHighResolutionPanos
  35109. ) {
  35110. return this.getPanoSize(r.ULTRAHIGH);
  35111. } else if (
  35112. this.zoomLevelResolution == "1k" ||
  35113. !this.useHighResolutionPanos
  35114. ) {
  35115. return this.getPanoSize(r.STANDARD);
  35116. } else {
  35117. return this.getPanoSize(r.HIGH);
  35118. }
  35119. } else {
  35120. let tileClass = this.getMaxZoomClass();
  35121. if (tileClass == "1k") return this.getPanoSize(r.STANDARD);
  35122. if (tileClass == "4k" && this.useUltraHighResolutionPanos) {
  35123. return this.getPanoSize(r.ULTRAHIGH);
  35124. } else {
  35125. //'2k'
  35126. return this.getPanoSize(r.HIGH);
  35127. }
  35128. }
  35129. }),
  35130. /* n.prototype.detectMaxZoomPanoSize = function() {
  35131. 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)
  35132. } */
  35133. (t.exports = n);
  35134. },
  35135. {
  35136. "../constants": 8,
  35137. "../enum/ModelManagerEvents": 33,
  35138. "../enum/PanoSizeClass": 36,
  35139. "../settings": 166,
  35140. "../util/browser": 182,
  35141. "../util/showcase": 193,
  35142. },
  35143. ],
  35144. 171: [
  35145. function (e, t, i) {
  35146. (function (i) {
  35147. "use strict";
  35148. function n(e) {
  35149. (this.panos = null),
  35150. (this.retryMinimumTime = 1e4),
  35151. (this.urls = null),
  35152. (this.panoLoadCallbacks = {}),
  35153. (this.downloadDescriptors = {}),
  35154. (this.priorityQueue = []),
  35155. (this.forceQueue = []),
  35156. (this.activeDownloads = []),
  35157. (this.qualityManager = null),
  35158. (this.tilePrioritizer = null),
  35159. (this.refreshInterval = null),
  35160. (this.processPriorityQueue = !1),
  35161. (this.concurrentDownloads = e.concurrentDownloads || 1),
  35162. (this.downloadTestResults = {});
  35163. }
  35164. var r = e("three"),
  35165. o = (e("../enum/Viewmode"), e("../settings")),
  35166. a = (e("../objects/Panorama"), e("../util/logger")),
  35167. s =
  35168. (e("../enum/Vectors"),
  35169. e("../enum/PanoSizeClass"),
  35170. e("../enum/TileDownloaderEvents")),
  35171. l = e("./TilePrioritizer"),
  35172. c = e("./TileUtils"),
  35173. h = (e("../enum/GLCubeFaces"), e("../enum/DownloadStatus")),
  35174. u = e("../util/panorama"),
  35175. d = e("../util/ajax"),
  35176. p = e("../ab"),
  35177. f = e("events").EventEmitter,
  35178. g =
  35179. (new a(i),
  35180. Object.freeze({
  35181. Testing: 1,
  35182. Success: 2,
  35183. Fail: 3,
  35184. }));
  35185. (n.prototype = Object.create(f.prototype)),
  35186. (n.IDLE_REFRESH_DELAY = 500),
  35187. (n.ACTIVE_REFRESH_DELAY = 16),
  35188. (n.DOWNLOAD_RETRIES = 4),
  35189. (n.prototype.init = function (e) {
  35190. this.qualityManager = e;
  35191. }),
  35192. (n.prototype.setUrls = function (e) {
  35193. this.urls = e;
  35194. }),
  35195. (n.prototype.setPanoData = function (e, t, i) {
  35196. (this.panos = e), (this.imagePanos = t), (this.panoGroupId = i);
  35197. }),
  35198. (n.prototype.start = function () {
  35199. this.refreshUpdateInterval(0);
  35200. }),
  35201. (n.prototype.stop = function () {
  35202. window.cancel(this.refreshInterval);
  35203. }),
  35204. (n.prototype.refreshUpdateInterval = function (e) {
  35205. e || (e = 0),
  35206. (this.refreshInterval = window.setTimeout(
  35207. function () {
  35208. var e = this.update();
  35209. e
  35210. ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY)
  35211. : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY);
  35212. }.bind(this),
  35213. e
  35214. ));
  35215. }),
  35216. (n.prototype.update = function () {
  35217. var e = this.forceQueue.length > 0;
  35218. return (
  35219. this.processQueueForDownloading(this.forceQueue),
  35220. this.processPriorityQueue &&
  35221. (this.queuePrioritizedTilesForPanos(this.panos),
  35222. this.priorityQueue.length > 0 && (e = !0),
  35223. this.processQueueForDownloading(this.priorityQueue)),
  35224. e
  35225. );
  35226. }),
  35227. (n.prototype.forceQueueTilesForPano = (function () {
  35228. var e = [],
  35229. t = [];
  35230. return function (i, n, r, o, a, s) {
  35231. e.length = 0;
  35232. for (
  35233. var u = this.getTileDownloadDescriptors(i, n), d = 0;
  35234. d < u.length;
  35235. d++
  35236. ) {
  35237. var p = u[d];
  35238. (p.status !== h.None && p.status !== h.Queued) || e.push(p);
  35239. }
  35240. if (r && e.length > 0) {
  35241. l.sortPanoTiles(e, i, r),
  35242. (t.length = 0),
  35243. c.matchingTilesInDirection(i, n, r, o, a, t);
  35244. for (
  35245. var f = 0,
  35246. g = function (e) {
  35247. return (
  35248. e.face === m.face &&
  35249. e.faceTileIndex === m.faceTileIndex
  35250. );
  35251. };
  35252. f < e.length;
  35253. ) {
  35254. var m = e[f],
  35255. v = t.findIndex(g);
  35256. v < 0 ? e.splice(f, 1) : f++;
  35257. }
  35258. }
  35259. for (var A = 0; A < e.length; A++) this.forceQueue.push(e[A]);
  35260. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  35261. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  35262. s && this.processQueueForDownloading(this.forceQueue, !0);
  35263. };
  35264. })()),
  35265. (n.prototype.clearForceQueue = function () {
  35266. this.clearQueue(this.forceQueue);
  35267. }),
  35268. (n.prototype.queuePrioritizedTilesForPanos = function (e) {
  35269. this.tilePrioritizer &&
  35270. (this.clearQueue(this.priorityQueue),
  35271. this.tilePrioritizer.filterAndPrioritize(
  35272. this.priorityQueue,
  35273. e,
  35274. this
  35275. ),
  35276. this.clearFromQueue(this.priorityQueue, h.None, !0),
  35277. this.setStatusOrRemoveForAllDescriptors(
  35278. this.priorityQueue,
  35279. h.Queued
  35280. ));
  35281. }),
  35282. (n.prototype.clearQueue = function (e) {
  35283. this.setStatusForAllDescriptors(e, h.None), (e.length = 0);
  35284. }),
  35285. (n.prototype.clearFromQueue = function (e, t, i) {
  35286. for (var n = 0; n < e.length; n++) {
  35287. var r = e[n];
  35288. r &&
  35289. ((t === r.status && !i) || (t !== r.status && i)) &&
  35290. (e[n] = null);
  35291. }
  35292. }),
  35293. (n.prototype.setStatusForAllDescriptors = function (e, t) {
  35294. for (var i = 0; i < e.length; i++) {
  35295. var n = e[i];
  35296. n && (n.status = t);
  35297. }
  35298. }),
  35299. (n.prototype.setStatusOrRemoveForAllDescriptors = function (e, t) {
  35300. for (var i = 0; i < e.length; i++) {
  35301. var n = e[i];
  35302. n && (n.status !== t ? (n.status = t) : (e[i] = null));
  35303. }
  35304. }),
  35305. (n.prototype.getTileDownloadDescriptors = function (e, t) {
  35306. var i = this.getAllTileDownloadDescriptorsForPano(e),
  35307. n = i[t];
  35308. return (
  35309. n ||
  35310. ((n = this.buildDownloadDescriptorArray(t)),
  35311. (i[t] = n),
  35312. this.initTileDownloadDescriptors(n, e, t)),
  35313. n
  35314. );
  35315. }),
  35316. (n.prototype.getAllTileDownloadDescriptorsForPano = function (e) {
  35317. var t = this.downloadDescriptors[e.id];
  35318. return t || ((t = {}), (this.downloadDescriptors[e.id] = t)), t;
  35319. }),
  35320. (n.prototype.processQueueForDownloading = function (e, t) {
  35321. if (
  35322. (this.cleanupActiveDownloads(),
  35323. this.activeDownloads.length < this.concurrentDownloads || t)
  35324. )
  35325. for (
  35326. var i = t
  35327. ? e.length
  35328. : this.concurrentDownloads - this.activeDownloads.length,
  35329. n = 0,
  35330. r = 0;
  35331. n < i && e.length > 0;
  35332. r++
  35333. ) {
  35334. var o = e.shift();
  35335. o && (this.startDownload(o), n++);
  35336. }
  35337. }),
  35338. (n.prototype.testDownload = function (e, t, i) {
  35339. var n = this.downloadTestResults[e];
  35340. if (n)
  35341. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  35342. this.downloadTestResults[e] = g.Testing;
  35343. var r = this.panos.list[0],
  35344. o = this.getTileUrl(r.id, e, t, 0),
  35345. a = function (t) {
  35346. (this.downloadTestResults[e] = g.Success), i(!0);
  35347. }.bind(this),
  35348. s = function () {
  35349. (this.downloadTestResults[e] = g.Fail), i(!1);
  35350. }.bind(this);
  35351. this.loadImage(o, 0, a, s);
  35352. }),
  35353. (n.prototype.startDownload = function (e) {
  35354. e.status = h.Downloading;
  35355. var t = this.getTileUrl(
  35356. e.pano.id,
  35357. e.panoSize,
  35358. e.tileSize,
  35359. e.tileIndex
  35360. );
  35361. this.activeDownloads.push(e),
  35362. this.loadImage(
  35363. t,
  35364. n.DOWNLOAD_RETRIES,
  35365. this.downloadComplete.bind(this, e),
  35366. this.downloadFailed.bind(this, e)
  35367. );
  35368. }),
  35369. (n.prototype.downloadFailed = function (e, t) {}),
  35370. (n.prototype.downloadComplete = function (e, t) {
  35371. if (e.panoGroupId === this.panoGroupId) {
  35372. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  35373. (e.status = h.Downloaded),
  35374. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  35375. var n = {
  35376. panoId: e.pano.id,
  35377. image: t,
  35378. tileSize: e.tileSize,
  35379. panoSize: e.panoSize,
  35380. tileIndex: e.tileIndex,
  35381. faceTileIndex: e.faceTileIndex,
  35382. totalTiles: e.totalTiles,
  35383. face: e.face,
  35384. tileX: e.tileX,
  35385. tileY: e.tileY,
  35386. direction: e.direction,
  35387. };
  35388. (e.image = t),
  35389. this.emit(s.TileDownloadSuccess, n),
  35390. this.isPanoDownloaded(e.pano, e.panoSize) &&
  35391. ((n = {
  35392. panoId: e.pano.id,
  35393. tileSize: e.tileSize,
  35394. panoSize: e.panoSize,
  35395. }),
  35396. this.emit(s.PanoDownloadComplete, n),
  35397. i && i.onLoad && i.onLoad(e.pano, e.panoSize));
  35398. }
  35399. }),
  35400. (n.prototype.cleanupActiveDownloads = (function () {
  35401. var e = [];
  35402. return function () {
  35403. e.length = 0;
  35404. for (var t = 0; t < this.activeDownloads.length; t++) {
  35405. var i = this.activeDownloads[t];
  35406. i.status !== h.Downloaded &&
  35407. i.status !== h.Failed &&
  35408. e.push(i);
  35409. }
  35410. (this.activeDownloads.length = 0),
  35411. this.activeDownloads.push.apply(this.activeDownloads, e);
  35412. };
  35413. })()),
  35414. (n.prototype.isPanoDownloaded = function (e, t) {
  35415. var i = this.getTileDownloadDescriptors(e, t);
  35416. if (i.length <= 0) return !1;
  35417. for (var n = 0; n < i.length; n++) {
  35418. var r = i[n];
  35419. if (r.status !== h.Downloaded) return !1;
  35420. }
  35421. return !0;
  35422. }),
  35423. (n.prototype.setPanoLoadCallbacks = function (e, t, i, n, r) {
  35424. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  35425. this.panoLoadCallbacks[o] = {
  35426. onLoad: i,
  35427. onFail: n,
  35428. onProgress: r,
  35429. };
  35430. }),
  35431. (n.prototype.getPanoLoadCallbacks = function (e, t) {
  35432. var i = e.id + ":" + t;
  35433. return this.panoLoadCallbacks[i];
  35434. }),
  35435. (n.prototype.buildDownloadDescriptorArray = function (e) {
  35436. for (
  35437. var t = c.getTileCountForSize(e), i = [], n = 0;
  35438. n < t;
  35439. n++
  35440. ) {
  35441. var r = this.buildDownloadDescriptor();
  35442. i.push(r);
  35443. }
  35444. return i;
  35445. }),
  35446. (n.prototype.buildDownloadDescriptor = function () {
  35447. var e = {
  35448. panoGroupId: null,
  35449. pano: null,
  35450. panoSize: -1,
  35451. tileSize: -1,
  35452. tileIndex: -1,
  35453. totalTiles: -1,
  35454. faceTileIndex: -1,
  35455. status: h.None,
  35456. url: null,
  35457. image: null,
  35458. direction: new r.Vector3(),
  35459. face: -1,
  35460. cubeFace: -1,
  35461. tileX: -1,
  35462. tileY: -1,
  35463. };
  35464. return e;
  35465. }),
  35466. (n.prototype.initTileDownloadDescriptors = function (e, t, i) {
  35467. for (var n = 0; n < e.length; n++) {
  35468. var r = e[n];
  35469. this.initTileDownloadDescriptor(r, t, i, n);
  35470. }
  35471. }),
  35472. (n.prototype.initTileDownloadDescriptor = function (e, t, i, n) {
  35473. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  35474. (e.face = c.getFaceForTile(i, n)),
  35475. (e.cubeFace = u.mapFaceToCubemapFace(e.face)),
  35476. (e.panoGroupId = this.panoGroupId),
  35477. (e.pano = t),
  35478. (e.panoSize = i),
  35479. (e.tileSize = r),
  35480. (e.tileIndex = n),
  35481. (e.totalTiles = c.getTileCountForSize(i)),
  35482. (e.status = h.None),
  35483. (e.image = null),
  35484. c.getTileLocation(e.panoSize, e.tileIndex, e),
  35485. c.getTileVector(
  35486. e.panoSize,
  35487. e.tileSize,
  35488. e.cubeFace,
  35489. e.tileX,
  35490. e.tileY,
  35491. c.LocationOnTile.Center,
  35492. 0,
  35493. e.direction
  35494. );
  35495. }),
  35496. (n.prototype.getTileUrl = (function () {
  35497. var e = {
  35498. 256: "256",
  35499. 512: "512",
  35500. 1024: "1k",
  35501. 2048: "2k",
  35502. 4096: "4k",
  35503. },
  35504. t = {
  35505. face: -1,
  35506. faceTileIndex: -1,
  35507. tileX: -1,
  35508. tileY: -1,
  35509. };
  35510. return function (i, n, r, a) {
  35511. c.getTileLocation(n, a, t);
  35512. var s = Math.floor(n / r),
  35513. l = s * s,
  35514. h = Math.floor(a / l),
  35515. u = "";
  35516. 1 === o.tiling.customCompression &&
  35517. (u = "_" + o.tiling["q" + e[n]]);
  35518. var d = this.urls.get(
  35519. "tiles/" +
  35520. i +
  35521. "/" +
  35522. e[n] +
  35523. u +
  35524. "_face" +
  35525. h +
  35526. "_" +
  35527. t.tileX +
  35528. "_" +
  35529. t.tileY +
  35530. ".jpg"
  35531. );
  35532. return (d = p.changeIfTileGenerating(d));
  35533. };
  35534. })()),
  35535. (n.prototype.loadImage = function (e, t, i, n) {
  35536. d.getImage(e, t)
  35537. .then(function (e) {
  35538. i(e);
  35539. })
  35540. .fail(n);
  35541. }),
  35542. (t.exports = n);
  35543. }).call(this, "/js/tile/TileDownloader.js");
  35544. },
  35545. {
  35546. "../ab": 3,
  35547. "../enum/DownloadStatus": 24,
  35548. "../enum/GLCubeFaces": 25,
  35549. "../enum/PanoSizeClass": 36,
  35550. "../enum/TileDownloaderEvents": 45,
  35551. "../enum/Vectors": 50,
  35552. "../enum/Viewmode": 51,
  35553. "../objects/Panorama": 148,
  35554. "../settings": 166,
  35555. "../util/ajax": 181,
  35556. "../util/logger": 189,
  35557. "../util/panorama": 191,
  35558. "./TilePrioritizer": 172,
  35559. "./TileUtils": 174,
  35560. events: 202,
  35561. three: 217,
  35562. },
  35563. ],
  35564. 172: [
  35565. function (e, t, i) {
  35566. (function (i) {
  35567. "use strict";
  35568. function n(e, t, i, o, a) {
  35569. (this.qualityManager = e),
  35570. (this.maxNavQuality = this.qualityManager.getMaxNavPanoSize()),
  35571. (this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()),
  35572. (this.baseSize = t),
  35573. (this.standardSize = i),
  35574. (this.highSize = o),
  35575. (this.ultraHighSize = a),
  35576. (this.priorityCriteria = new n.PriorityCriteria(
  35577. null,
  35578. new r.Vector3(0, 0, 0),
  35579. new r.Vector3(0, 0, -1),
  35580. new r.Vector3(0, 0, -1)
  35581. ));
  35582. }
  35583. var r = e("three"),
  35584. o =
  35585. (e("../enum/Viewmode"),
  35586. e("../settings"),
  35587. e("../settings"),
  35588. e("../objects/Panorama")),
  35589. a = e("../util/logger"),
  35590. s =
  35591. (e("../enum/Vectors"),
  35592. e("../enum/PanoSizeClass"),
  35593. e("../enum/ModelManagerEvents"),
  35594. e("../enum/GLCubeFaces"),
  35595. e("../enum/DownloadStatus")),
  35596. l = (e("../util/browser"), e("./TileUtils")),
  35597. c = e("../util/math"),
  35598. h =
  35599. (e("events").EventEmitter,
  35600. new a(i),
  35601. Object.freeze({
  35602. None: 0,
  35603. DirectionalFOV: 1,
  35604. }));
  35605. (n.PriorityCriteria = function (e, t, i, n, o) {
  35606. (this.pano = e),
  35607. (this.cameraPosition = new r.Vector3().copy(t)),
  35608. (this.cameraDir = new r.Vector3().copy(i)),
  35609. (this.panoSpaceDir = new r.Vector3().copy(n)),
  35610. (this.upcomingPanos = o),
  35611. (this.copy = function (e) {
  35612. (this.pano = e.pano),
  35613. this.cameraPosition.copy(e.cameraPosition),
  35614. this.cameraDir.copy(e.cameraDir),
  35615. this.panoSpaceDir.copy(e.panoSpaceDir),
  35616. (this.upcomingPanos = o);
  35617. }),
  35618. (this.zoomingActive = !1);
  35619. }),
  35620. (n.DIRECTIONAL_FOV = 180),
  35621. (n.DIRECTIONAL_FOV_NARROW = 120),
  35622. (n.MAX_SCORED_PANOS_TOCONSIDER = 6),
  35623. (n.MAX_SCORED_PANOS_TOADD = 2),
  35624. (n.MAX_UPCOMING_PANOS_TOADD = 3),
  35625. (n.DIRECTION_SCORE_STRICTNESS = 0.75),
  35626. (n.appendQueue = function (e, t) {
  35627. if (e && t) for (var i = 0; i < t.length; i++) e.push(t[i]);
  35628. }),
  35629. (n.prototype.updateCriteria = function (e, t, i, n) {
  35630. (this.priorityCriteria.pano = e),
  35631. this.priorityCriteria.cameraPosition.copy(t),
  35632. this.priorityCriteria.cameraDir.copy(i),
  35633. (this.priorityCriteria.upcomingPanos = n),
  35634. (this.maxNavQuality = this.qualityManager.getMaxNavPanoSize());
  35635. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize();
  35636. if (!player.panoRenderer.isPanoZoomed(e.id)) {
  35637. //xzw add,直到到达该点后才能下载4k,否则不会渲染到zoomRenderTarget上
  35638. this.maxNavQuality = Math.min(2048, this.maxNavQuality);
  35639. this.maxZoomQuality = Math.min(2048, this.maxZoomQuality);
  35640. }
  35641. }),
  35642. (n.prototype.filterAndPrioritize = (function () {
  35643. var e = [],
  35644. t = [],
  35645. i = [];
  35646. return function (r, o, a) {
  35647. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  35648. this.populateScoredPanos(
  35649. this.priorityCriteria.pano,
  35650. o,
  35651. t,
  35652. this.priorityCriteria.cameraDir,
  35653. n.MAX_SCORED_PANOS_TOCONSIDER
  35654. );
  35655. var s = this.baseSize,
  35656. l = this.standardSize,
  35657. c = this.highSize,
  35658. h = this.ultraHighSize;
  35659. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  35660. this.priorityCriteria.upcomingPanos &&
  35661. this.queueTilesForPanos(
  35662. r,
  35663. this.priorityCriteria.upcomingPanos,
  35664. a,
  35665. s,
  35666. n.MAX_UPCOMING_PANOS_TOADD
  35667. ),
  35668. this.priorityCriteria.upcomingPanos &&
  35669. this.queueTilesForPanos(
  35670. r,
  35671. this.priorityCriteria.upcomingPanos,
  35672. a,
  35673. 1024,
  35674. n.MAX_UPCOMING_PANOS_TOADD
  35675. ), //更清晰些
  35676. (i.length = 0),
  35677. this.canDownloadSize(l) &&
  35678. this.queueTilesInDirectionForPano(
  35679. i,
  35680. a,
  35681. this.priorityCriteria.pano,
  35682. l,
  35683. this.priorityCriteria.cameraPosition,
  35684. this.priorityCriteria.cameraDir,
  35685. n.DIRECTIONAL_FOV_NARROW
  35686. ),
  35687. n.sortPanoTiles(
  35688. i,
  35689. this.priorityCriteria.pano,
  35690. this.priorityCriteria.cameraDir
  35691. ),
  35692. n.appendQueue(r, i),
  35693. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  35694. (i.length = 0),
  35695. this.canDownloadSize(c) &&
  35696. this.queueTilesInDirectionForPano(
  35697. i,
  35698. a,
  35699. this.priorityCriteria.pano,
  35700. c,
  35701. this.priorityCriteria.cameraPosition,
  35702. this.priorityCriteria.cameraDir,
  35703. n.DIRECTIONAL_FOV_NARROW
  35704. ),
  35705. this.canDownloadSize(h) &&
  35706. this.queueTilesInDirectionForPano(
  35707. i,
  35708. a,
  35709. this.priorityCriteria.pano,
  35710. h,
  35711. this.priorityCriteria.cameraPosition,
  35712. this.priorityCriteria.cameraDir,
  35713. n.DIRECTIONAL_FOV_NARROW
  35714. ),
  35715. n.sortPanoTiles(
  35716. i,
  35717. this.priorityCriteria.pano,
  35718. this.priorityCriteria.cameraDir
  35719. ),
  35720. n.appendQueue(r, i),
  35721. (i.length = 0),
  35722. this.canDownloadSize(l) &&
  35723. this.queueTilesInDirectionForPano(
  35724. i,
  35725. a,
  35726. this.priorityCriteria.pano,
  35727. l,
  35728. this.priorityCriteria.cameraPosition,
  35729. this.priorityCriteria.cameraDir,
  35730. n.DIRECTIONAL_FOV
  35731. ),
  35732. this.canDownloadSize(c) &&
  35733. this.queueTilesInDirectionForPano(
  35734. i,
  35735. a,
  35736. this.priorityCriteria.pano,
  35737. c,
  35738. this.priorityCriteria.cameraPosition,
  35739. this.priorityCriteria.cameraDir,
  35740. n.DIRECTIONAL_FOV
  35741. ),
  35742. this.canDownloadSize(h) &&
  35743. this.queueTilesInDirectionForPano(
  35744. i,
  35745. a,
  35746. this.priorityCriteria.pano,
  35747. h,
  35748. this.priorityCriteria.cameraPosition,
  35749. this.priorityCriteria.cameraDir,
  35750. n.DIRECTIONAL_FOV
  35751. ),
  35752. n.sortPanoTiles(
  35753. i,
  35754. this.priorityCriteria.pano,
  35755. this.priorityCriteria.cameraDir
  35756. ),
  35757. n.appendQueue(r, i),
  35758. this.queueTilesForPanos(r, e, a, s);
  35759. };
  35760. })()),
  35761. (n.prototype.canDownloadSize = function (e) {
  35762. return (
  35763. this.maxNavQuality >= e ||
  35764. (this.maxZoomQuality >= e && this.zoomingActive)
  35765. );
  35766. }),
  35767. (n.prototype.populateNeighborPanos = function (e, t, i) {
  35768. (i = i || []), (i.length = 0);
  35769. var n = t.getNeighbours(e);
  35770. for (var r in n)
  35771. if (n.hasOwnProperty(r)) {
  35772. var o = t.get(r);
  35773. i.push(o);
  35774. }
  35775. return i;
  35776. }),
  35777. (n.prototype.populateScoredPanos = function (e, t, i, r, a) {
  35778. (i = i || []), (i.length = 0);
  35779. var s = [
  35780. o.filters.inPanoDirection(
  35781. e.position,
  35782. r,
  35783. n.DIRECTION_SCORE_STRICTNESS
  35784. ),
  35785. o.filters.not(e),
  35786. ],
  35787. l = [
  35788. o.scoreFunctions.distanceSquared(e),
  35789. o.scoreFunctions.direction(e.position, r),
  35790. ],
  35791. c = t.sortByScore(s, l);
  35792. if (c)
  35793. for (var h = 0; h < c.length && h < a; h++) {
  35794. var u = c[h].item;
  35795. i.push(u);
  35796. }
  35797. return i;
  35798. }),
  35799. (n.prototype.queueTilesForPanos = function (e, t, i, n, r) {
  35800. for (var o = 0, a = 0; a < t.length; a++) {
  35801. var s = t[a],
  35802. l = this.queueTilesForPano(e, i, s, n);
  35803. if (((o += l > 0 ? 1 : 0), r && o >= r)) break;
  35804. }
  35805. return o;
  35806. }),
  35807. (n.prototype.queueTilesForPano = (function () {
  35808. var e = {
  35809. filter: h.None,
  35810. };
  35811. return function (t, i, n, r) {
  35812. return this.filterAndQueueTileDownloadDescriptors(
  35813. t,
  35814. i,
  35815. n,
  35816. r,
  35817. e
  35818. );
  35819. };
  35820. })()),
  35821. (n.prototype.queueTilesForPanosInDirection = (function () {
  35822. var e = new r.Vector3();
  35823. return function (t, i, n, r, o, a, s, l) {
  35824. for (var h = 0, u = 0; u < n.length; u++) {
  35825. var d = n[u];
  35826. e.copy(d.position), e.sub(o), e.normalize();
  35827. var p = Math.max(Math.min(a.dot(e), 1), -1),
  35828. f = c.getFOVDotThreshold(s);
  35829. if (p >= f) {
  35830. var g = this.queueTilesInDirectionForPano(
  35831. t,
  35832. i,
  35833. d,
  35834. r,
  35835. o,
  35836. a,
  35837. s
  35838. );
  35839. if (((h += g > 0 ? 1 : 0), l && h >= l)) break;
  35840. }
  35841. }
  35842. return h;
  35843. };
  35844. })()),
  35845. (n.prototype.queueTilesInDirectionForPanos = function (
  35846. e,
  35847. t,
  35848. i,
  35849. n,
  35850. r,
  35851. o,
  35852. a,
  35853. s
  35854. ) {
  35855. for (var l = 0, c = 0; c < i.length; c++) {
  35856. var h = i[c],
  35857. u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  35858. if (((l += u > 0 ? 1 : 0), s && l >= s)) break;
  35859. }
  35860. return l;
  35861. }),
  35862. (n.prototype.queueTilesInDirectionForPano = (function () {
  35863. var e = {
  35864. filter: h.DirectionalFOV,
  35865. direction: new r.Vector3(),
  35866. fov: 60,
  35867. },
  35868. t = new r.Vector3();
  35869. return function (i, n, r, o, a, s, c) {
  35870. return (
  35871. t.copy(s),
  35872. l.getRelativeDirection(r.quaternion, t),
  35873. e.direction.copy(t),
  35874. (e.fov = c),
  35875. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  35876. );
  35877. };
  35878. })()),
  35879. (n.prototype.filterAndQueueTileDownloadDescriptors = (function () {
  35880. var e = [];
  35881. return function (t, i, n, r, o) {
  35882. var a = i.getTileDownloadDescriptors(n, r);
  35883. (e.length = 0), this.filterTileDownloadDescriptors(n, a, e, o);
  35884. for (var s = 0, l = 0; l < e.length; l++) {
  35885. var c = e[l];
  35886. c && (t.push(c), s++);
  35887. }
  35888. return s;
  35889. };
  35890. })()),
  35891. (n.prototype.filterTileDownloadDescriptors = (function () {
  35892. new r.Vector3();
  35893. return function (e, t, i, n) {
  35894. var r, o;
  35895. switch (n.filter) {
  35896. case h.DirectionalFOV:
  35897. for (r = 0; r < t.length; r++)
  35898. (o = t[r]),
  35899. l.isTileWithinFOV(
  35900. o.panoSize,
  35901. o.tileSize,
  35902. o.face,
  35903. o.tileX,
  35904. o.tileY,
  35905. n.direction,
  35906. n.fov
  35907. ) && i.push(o);
  35908. break;
  35909. default:
  35910. for (r = 0; r < t.length; r++) (o = t[r]), i.push(o);
  35911. }
  35912. for (r = 0; r < i.length; r++)
  35913. (o = i[r]), this.canIncludeDescriptor(o) || (i[r] = null);
  35914. };
  35915. })()),
  35916. (n.prototype.canIncludeDescriptor = function (e) {
  35917. return e.status !== s.Downloading && e.status !== s.Downloaded;
  35918. }),
  35919. (n.prototype.canIncludePano = function (e, t) {
  35920. return !e.isLoaded(t);
  35921. }),
  35922. (n.getFOVDotThreshold = function (e) {
  35923. return Math.cos(r.Math.degToRad(e / 2));
  35924. });
  35925. var u = (function () {
  35926. var e = function e(t, i) {
  35927. var n = e._panoSpaceDir,
  35928. r = e._fovThreshold,
  35929. o = e._fovThresholdNarrow,
  35930. a = Math.max(Math.min(n.dot(t.direction), 1), -1),
  35931. s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  35932. return (
  35933. (t._dot = a),
  35934. (i._dot = s),
  35935. a >= r && s < r
  35936. ? -1
  35937. : a < r && s >= r
  35938. ? 1
  35939. : a >= o && s < o
  35940. ? -1
  35941. : a < o && s >= o
  35942. ? 1
  35943. : t.panoSize > i.panoSize
  35944. ? 1
  35945. : i.panoSize > t.panoSize
  35946. ? -1
  35947. : -(a - s)
  35948. );
  35949. };
  35950. return (
  35951. (e._panoSpaceDir = new r.Vector3()),
  35952. (e._fovThreshold = -1),
  35953. (e._fovThresholdNarrow = -1),
  35954. e
  35955. );
  35956. })();
  35957. (n.sortPanoTiles = function (e, t, i) {
  35958. u._panoSpaceDir.copy(i),
  35959. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  35960. (u._fovThresholdNarrow = c.getFOVDotThreshold(
  35961. n.DIRECTIONAL_FOV_NARROW
  35962. )),
  35963. (u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV)),
  35964. e.sort(u);
  35965. }),
  35966. (n.insertSortedPanoTile = function (e, t, i, r) {
  35967. u._panoSpaceDir.copy(r),
  35968. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  35969. (u._fovThresholdNarrow = c.getFOVDotThreshold(
  35970. n.DIRECTIONAL_FOV_NARROW
  35971. )),
  35972. (u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV));
  35973. for (var o = -1, a = 0; a < e.length; a++) {
  35974. var s = u(t, e[a]);
  35975. if (s <= 0) {
  35976. o = a;
  35977. break;
  35978. }
  35979. }
  35980. if (o === -1) e[e.length] = t;
  35981. else {
  35982. for (var h = e.length; h > o; h--) e[h] = e[h - 1];
  35983. e[o] = t;
  35984. }
  35985. }),
  35986. (n.prototype.setZoomingActive = function (e) {
  35987. e !== this.zoomingActive && (this.zoomingActive = e);
  35988. }),
  35989. (t.exports = n);
  35990. }).call(this, "/js/tile/TilePrioritizer.js");
  35991. },
  35992. {
  35993. "../enum/DownloadStatus": 24,
  35994. "../enum/GLCubeFaces": 25,
  35995. "../enum/ModelManagerEvents": 33,
  35996. "../enum/PanoSizeClass": 36,
  35997. "../enum/Vectors": 50,
  35998. "../enum/Viewmode": 51,
  35999. "../objects/Panorama": 148,
  36000. "../settings": 166,
  36001. "../util/browser": 182,
  36002. "../util/logger": 189,
  36003. "../util/math": 190,
  36004. "./TileUtils": 174,
  36005. events: 202,
  36006. three: 217,
  36007. },
  36008. ],
  36009. 173: [
  36010. function (e, t, i) {
  36011. "use strict";
  36012. function n(e, t) {
  36013. (this.levels = t),
  36014. (this.tileSize = e),
  36015. (this.root = null),
  36016. (this.allNodes = []),
  36017. a(this);
  36018. }
  36019. function r(e, t) {
  36020. (this.tree = e),
  36021. (this.parent = t),
  36022. (this.children = []),
  36023. (this.id = ++u);
  36024. }
  36025. function o(e, t, i, r, a, s, l, h) {
  36026. if (e) {
  36027. l = l || n.TraversalType.PreOrder;
  36028. var u = r * c + i;
  36029. if (
  36030. (l === n.TraversalType.PreOrder &&
  36031. (a && a(e, t, u, i, r), s && s.push(e)),
  36032. e.children && 0 !== e.children.length)
  36033. ) {
  36034. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  36035. for (var g = 0; g < c; g++)
  36036. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  36037. l === n.TraversalType.PostOrder &&
  36038. (a && a(e, t, u, i, r), s && s.push(e));
  36039. }
  36040. }
  36041. }
  36042. function a(e) {
  36043. e.root = s(e, null, 0);
  36044. }
  36045. function s(e, t, i) {
  36046. if (i > e.levels) return null;
  36047. var n = new r(e, t);
  36048. e.allNodes.push(n);
  36049. for (var o = 0; o < h; o++) n.children[o] = s(e, n, i + 1);
  36050. return n;
  36051. }
  36052. function l(e, t, i, n, r) {
  36053. if (!e) return null;
  36054. if (0 === i) return e;
  36055. if (!e.children || 0 === e.children.length) return null;
  36056. var o = Math.pow(c, i),
  36057. a = o / c,
  36058. s = n % a,
  36059. h = r % a,
  36060. u = Math.floor(r / a),
  36061. d = Math.floor(n / a),
  36062. p = u * c + d,
  36063. f = e.children[p];
  36064. return l(f, t + 1, i - 1, s, h);
  36065. }
  36066. var c =
  36067. (e("three"),
  36068. e("./TileUtils"),
  36069. e("../objects/Panorama"),
  36070. e("../util/panorama"),
  36071. e("events").EventEmitter,
  36072. 2),
  36073. h = c * c;
  36074. n.TraversalType = Object.freeze({
  36075. PreOrder: 0,
  36076. PostOrder: 1,
  36077. });
  36078. var u = 0;
  36079. (n.getLevelCountForSize = function (e, t) {
  36080. var i = 0;
  36081. for (t < e && (t = e); ; ) {
  36082. if (((t /= c), t < e)) break;
  36083. i++;
  36084. }
  36085. return i;
  36086. }),
  36087. (n.getSizeForLevel = function (e, t) {
  36088. return Math.pow(c, t) * e;
  36089. }),
  36090. (n.prototype.getSubNode = function (e, t, i) {
  36091. (!t || e < this.tileSize) && (t = 0),
  36092. (!i || e < this.tileSize) && (i = 0),
  36093. e < this.tileSize && (e = this.tileSize);
  36094. var r = n.getLevelCountForSize(this.tileSize, e),
  36095. o = l(this.root, 0, r, t, i);
  36096. return o;
  36097. }),
  36098. (n.prototype.breadthFirst = function (e) {
  36099. e = e || {};
  36100. var t = !!e.nullLevelEnd,
  36101. i = e.maxLevel,
  36102. n = e.minLevel,
  36103. r = e.callback,
  36104. o = e.saveVisited,
  36105. a = [],
  36106. s = {},
  36107. l = 0,
  36108. c = 0;
  36109. for (
  36110. a.push(this.root), a.push(s);
  36111. a.length > 0 && !(i && l > i);
  36112. ) {
  36113. var h = a.shift();
  36114. if (h === s)
  36115. (!n || l >= n) && (r && t && r(null), o && t && o.push(null)),
  36116. a.length > 0 && a.push(s),
  36117. l++,
  36118. (c = 0);
  36119. else {
  36120. if (h.children)
  36121. for (var u = 0; u < h.children.length; u++) {
  36122. var d = h.children[u];
  36123. d && a.push(h.children[u]);
  36124. }
  36125. var p = this.getFaceIndexFromNode(h);
  36126. (!n || l >= n) && (r && r(h, l, p), o && o.push(h)), c++;
  36127. }
  36128. }
  36129. }),
  36130. (n.prototype.getFaceIndexFromNode = function (e) {
  36131. if (!e) return -1;
  36132. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  36133. var o = i.parent;
  36134. if (!o) break;
  36135. for (var a = -1, s = 0; s < o.children.length; s++)
  36136. o.children[s] === i && (a = s);
  36137. var l = a % c,
  36138. h = Math.floor(a / c);
  36139. (n = l * t + n), (r = h * t + r), (t *= c), (i = o);
  36140. }
  36141. return r * t + n;
  36142. }),
  36143. (n.prototype.depthFirst = function (e, t, i) {
  36144. o(this.root, 0, 0, 0, e, t, i, this.tileSize);
  36145. }),
  36146. (t.exports = n);
  36147. },
  36148. {
  36149. "../objects/Panorama": 148,
  36150. "../util/panorama": 191,
  36151. "./TileUtils": 174,
  36152. events: 202,
  36153. three: 217,
  36154. },
  36155. ],
  36156. 174: [
  36157. function (e, t, i) {
  36158. "use strict";
  36159. var n = e("../enum/GLCubeFaces"),
  36160. r = e("../util/MathLight"),
  36161. o = {};
  36162. (o.TILE_SIZE = 512),
  36163. (o.FACES_PER_PANO = 6),
  36164. (o.LocationOnTile = {
  36165. Center: 0,
  36166. UpperLeft: 1,
  36167. UpperRight: 2,
  36168. LowerRight: 3,
  36169. LowerLeft: 4,
  36170. }),
  36171. (o.getTileVector = (function () {
  36172. return function (e, t, i, a, s, l, c, h) {
  36173. l = l || o.LocationOnTile.Center;
  36174. var u = e / t,
  36175. d = a / u;
  36176. s = -s + (u - 1);
  36177. var p = s / u,
  36178. f = t / e,
  36179. g = 2 * f,
  36180. m = g / 2,
  36181. v = 2 * d - 1 + m,
  36182. A = 2 * p - 1 + m;
  36183. switch (l) {
  36184. case o.LocationOnTile.UpperLeft:
  36185. (v -= m), (A += m), (v += c * g);
  36186. break;
  36187. case o.LocationOnTile.UpperRight:
  36188. (v += m), (A += m), (A -= c * g);
  36189. break;
  36190. case o.LocationOnTile.LowerRight:
  36191. (v += m), (A -= m), (v -= c * g);
  36192. break;
  36193. case o.LocationOnTile.LowerLeft:
  36194. (v -= m), (A -= m), (A += c * g);
  36195. break;
  36196. case o.LocationOnTile.Center:
  36197. }
  36198. switch (i) {
  36199. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  36200. r.setVector(h, -1, A, -v);
  36201. break;
  36202. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  36203. r.setVector(h, 1, A, v);
  36204. break;
  36205. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  36206. r.setVector(h, -v, 1, -A);
  36207. break;
  36208. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  36209. r.setVector(h, -v, -1, A);
  36210. break;
  36211. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  36212. r.setVector(h, -v, A, 1);
  36213. break;
  36214. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  36215. r.setVector(h, v, A, -1);
  36216. }
  36217. r.normalize(h);
  36218. };
  36219. })()),
  36220. (o.getFaceForTile = function (e, t) {
  36221. var i = o.TILE_SIZE;
  36222. e < o.TILE_SIZE && (i = e);
  36223. var n = Math.floor(e / i),
  36224. r = n * n;
  36225. return Math.floor(t / r);
  36226. }),
  36227. (o.getTileLocation = function (e, t, i) {
  36228. var n = o.TILE_SIZE;
  36229. e < o.TILE_SIZE && (n = e);
  36230. var r = o.getFaceForTile(e, t),
  36231. a = Math.floor(e / n),
  36232. s = a * a,
  36233. l = t - r * s;
  36234. (i.tileX = l % a),
  36235. (i.tileY = Math.floor(l / a)),
  36236. (i.face = r),
  36237. (i.faceTileIndex = l);
  36238. }),
  36239. (o.getTileCountForSize = function (e) {
  36240. if (e <= o.TILE_SIZE) return o.FACES_PER_PANO;
  36241. var t = Math.floor(e / o.TILE_SIZE),
  36242. i = t * t,
  36243. n = i * o.FACES_PER_PANO;
  36244. return n;
  36245. }),
  36246. (o.getRelativeDirection = (function () {
  36247. var e = new r.Matrix4(),
  36248. t = new r.Quaternion();
  36249. return function (i, n) {
  36250. t.copy(i),
  36251. t.inverse(),
  36252. e.makeRotationFromQuaternion(t),
  36253. e.applyToVector3(n),
  36254. r.normalize(n);
  36255. };
  36256. })()),
  36257. (o.matchingTilesInDirection = (function () {
  36258. var e = new r.Vector3(),
  36259. t = new r.Vector3(0, 0, -1),
  36260. i = new r.Quaternion(),
  36261. n = function (e, t) {
  36262. e.push({
  36263. face: t.face,
  36264. faceTileIndex: t.faceTileIndex,
  36265. tileX: t.tileX,
  36266. tileY: t.tileY,
  36267. });
  36268. },
  36269. a = (function () {
  36270. var e = {
  36271. face: -1,
  36272. faceTileIndex: -1,
  36273. tileX: -1,
  36274. tileY: -1,
  36275. };
  36276. return function (t, i, r) {
  36277. for (
  36278. var a = o.getTileCountForSize(t), s = 0, l = 0;
  36279. l < a;
  36280. l++
  36281. )
  36282. o.getTileLocation(t, l, e),
  36283. (i && !i(e)) || (s++, r && n(r, e));
  36284. return s;
  36285. };
  36286. })();
  36287. return function (n, s, l, c, h, u) {
  36288. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  36289. o.getTileCountForSize(s);
  36290. if (!c && !h) return a(s, null, u);
  36291. var p = !!h;
  36292. if (
  36293. ((h = h || c),
  36294. (h = Math.max(0, Math.min(h, 360))),
  36295. (c = Math.max(0, Math.min(c, 360))),
  36296. r.copyVector(l, e),
  36297. o.getRelativeDirection(n.quaternion, e),
  36298. p)
  36299. ) {
  36300. i.setFromUnitVectors(e, t);
  36301. var f = function (e) {
  36302. return o.isTileWithinFrustum(
  36303. s,
  36304. d,
  36305. e.face,
  36306. e.tileX,
  36307. e.tileY,
  36308. i,
  36309. c,
  36310. h
  36311. );
  36312. };
  36313. return a(s, f, u);
  36314. }
  36315. var g = function (t) {
  36316. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c);
  36317. };
  36318. return a(s, g, u);
  36319. };
  36320. })()),
  36321. (o.isTileWithinFrustum = (function () {
  36322. var e = new r.Vector3(),
  36323. t = 1e-5;
  36324. return function (i, n, a, s, l, c, h, u) {
  36325. for (
  36326. var d = Math.tan(0.5 * u * r.RADIANS_PER_DEGREE),
  36327. p = -d,
  36328. f = Math.tan(0.5 * h * r.RADIANS_PER_DEGREE),
  36329. g = -f,
  36330. m = o.mapFaceToCubemapFace(a),
  36331. v = 0,
  36332. A = 0,
  36333. y = 0,
  36334. C = 0,
  36335. I = 0,
  36336. E = 0,
  36337. b = o.LocationOnTile.Center;
  36338. b <= o.LocationOnTile.LowerLeft;
  36339. b++
  36340. )
  36341. if (
  36342. (o.getTileVector(i, n, m, s, l, b, 0, e),
  36343. r.applyQuaternionToVector(c, e),
  36344. e.z >= -t)
  36345. )
  36346. I++;
  36347. else {
  36348. var w = -1 / e.z,
  36349. _ = e.x * w,
  36350. T = e.y * w;
  36351. T > d ? v++ : T < p && A++, _ > f ? y++ : _ < g && C++, E++;
  36352. }
  36353. return A !== E && v !== E && y !== E && C !== E;
  36354. };
  36355. })()),
  36356. (o.isTileWithinFOV = (function () {
  36357. var e = new r.Vector3(),
  36358. t = new r.Vector3(0, 1, 0),
  36359. i = new r.Vector3(1, 0, 0);
  36360. return function (n, a, s, l, c, h, u) {
  36361. var d = o.mapFaceToCubemapFace(s);
  36362. if (
  36363. (r.cross(h, t, i),
  36364. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  36365. o.isWithinFOV(e, h, u, null))
  36366. )
  36367. return !0;
  36368. for (
  36369. var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0;
  36370. m < f;
  36371. m++
  36372. ) {
  36373. for (
  36374. var v = o.LocationOnTile.UpperLeft;
  36375. v <= o.LocationOnTile.LowerLeft;
  36376. v++
  36377. )
  36378. if (
  36379. (o.getTileVector(n, a, d, l, c, v, g, e),
  36380. o.isWithinFOV(e, h, u, null))
  36381. )
  36382. return !0;
  36383. g += p;
  36384. }
  36385. return !1;
  36386. };
  36387. })()),
  36388. (o.isWithinFOV = (function () {
  36389. var e = new r.Vector3(),
  36390. t = new r.Vector3();
  36391. return function (i, n, o, a) {
  36392. if ((r.copyVector(i, t), a)) {
  36393. r.copyVector(a, e), r.normalize(e);
  36394. var s = r.dot(e, i);
  36395. (e.x *= s), (e.y *= s), (e.z *= s), r.subVector(t, e);
  36396. }
  36397. var l = (o / 2) * r.RADIANS_PER_DEGREE,
  36398. c = Math.cos(l),
  36399. h = r.dot(t, n);
  36400. return h >= c;
  36401. };
  36402. })()),
  36403. (o.mapFaceToCubemapFace = (function () {
  36404. var e = {
  36405. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  36406. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  36407. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  36408. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  36409. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  36410. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
  36411. };
  36412. return function (t) {
  36413. return e[t];
  36414. };
  36415. })()),
  36416. (t.exports = o);
  36417. },
  36418. {
  36419. "../enum/GLCubeFaces": 25,
  36420. "../util/MathLight": 176,
  36421. },
  36422. ],
  36423. 175: [
  36424. function (e, t, i) {
  36425. (function (i) {
  36426. "use strict";
  36427. function n() {
  36428. (this.list = []),
  36429. (this.index = {}),
  36430. Object.defineProperty(this, "length", {
  36431. get: function () {
  36432. return this.list.length;
  36433. },
  36434. });
  36435. }
  36436. var r = (e("./common"), e("./logger"));
  36437. new r(i);
  36438. (n.prototype.forEach = function (e) {
  36439. this.list.forEach(e);
  36440. }),
  36441. (n.prototype.add = function (e) {
  36442. this.list.push(e), (this.index[this.getIndex(e)] = e);
  36443. }),
  36444. (n.prototype.getIndex = function (e) {
  36445. throw new Error(
  36446. "IndexedCollection.getIndex not implemented in subclass."
  36447. );
  36448. }),
  36449. (n.prototype.extend = function (e) {
  36450. for (var t = 0; t < e.length; t++) this.add(e[t]);
  36451. }),
  36452. (n.prototype.get = function (e) {
  36453. return this.index[e];
  36454. }),
  36455. (n.prototype.first = function () {
  36456. return this.list[0];
  36457. }),
  36458. (n.prototype.last = function () {
  36459. return this.list[this.list.length - 1];
  36460. }),
  36461. (n.prototype.reIndex = function () {
  36462. this.index = {};
  36463. var e = this;
  36464. this.forEach(function (t) {
  36465. e.index[e.getIndex(t)] = t;
  36466. });
  36467. }),
  36468. (n.prototype.filter = function (e) {
  36469. var t = this.list.filter(e);
  36470. return this.reIndex(), t;
  36471. }),
  36472. (n.prototype.reduce = function (e, t) {
  36473. return this.list.reduce(e, t);
  36474. }),
  36475. (n.prototype.sort = function (e) {
  36476. return this.list.sort(e);
  36477. }),
  36478. (n.prototype.indexOf = function (e) {
  36479. for (var t = 0; t < this.list.length; ++t)
  36480. if (this.list[t] === e) return t;
  36481. return -1;
  36482. }),
  36483. (t.exports = n);
  36484. }).call(this, "/js/util/IndexedCollection.js");
  36485. },
  36486. {
  36487. "./common": 185,
  36488. "./logger": 189,
  36489. },
  36490. ],
  36491. 176: [
  36492. function (e, t, i) {
  36493. "use strict";
  36494. var n = e("../constants"),
  36495. r = {};
  36496. (r.RADIANS_PER_DEGREE = Math.PI / 180),
  36497. (r.DEGREES_PER_RADIAN = 180 / Math.PI),
  36498. (r.Vector3 = function (e, t, i) {
  36499. (this.x = e || 0), (this.y = t || 0), (this.z = i || 0);
  36500. }),
  36501. (r.Matrix4 = function () {
  36502. (this.elements = new Float32Array([
  36503. 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1,
  36504. ])),
  36505. arguments.length > 0 &&
  36506. console.error(
  36507. "MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead."
  36508. );
  36509. }),
  36510. (r.Matrix4.prototype = {
  36511. identity: function () {
  36512. return (
  36513. this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  36514. );
  36515. },
  36516. copy: function (e) {
  36517. return this.elements.set(e.elements), this;
  36518. },
  36519. applyToVector3: function (e) {
  36520. var t = e.x,
  36521. i = e.y,
  36522. n = e.z,
  36523. r = this.elements;
  36524. return (
  36525. (e.x = r[0] * t + r[4] * i + r[8] * n + r[12]),
  36526. (e.y = r[1] * t + r[5] * i + r[9] * n + r[13]),
  36527. (e.z = r[2] * t + r[6] * i + r[10] * n + r[14]),
  36528. this
  36529. );
  36530. },
  36531. getInverse: function (e, t) {
  36532. var i = this.elements,
  36533. n = e.elements,
  36534. r = n[0],
  36535. o = n[1],
  36536. a = n[2],
  36537. s = n[3],
  36538. l = n[4],
  36539. c = n[5],
  36540. h = n[6],
  36541. u = n[7],
  36542. d = n[8],
  36543. p = n[9],
  36544. f = n[10],
  36545. g = n[11],
  36546. m = n[12],
  36547. v = n[13],
  36548. A = n[14],
  36549. y = n[15],
  36550. C =
  36551. p * A * u -
  36552. v * f * u +
  36553. v * h * g -
  36554. c * A * g -
  36555. p * h * y +
  36556. c * f * y,
  36557. I =
  36558. m * f * u -
  36559. d * A * u -
  36560. m * h * g +
  36561. l * A * g +
  36562. d * h * y -
  36563. l * f * y,
  36564. E =
  36565. d * v * u -
  36566. m * p * u +
  36567. m * c * g -
  36568. l * v * g -
  36569. d * c * y +
  36570. l * p * y,
  36571. b =
  36572. m * p * h -
  36573. d * v * h -
  36574. m * c * f +
  36575. l * v * f +
  36576. d * c * A -
  36577. l * p * A,
  36578. w = r * C + o * I + a * E + s * b;
  36579. if (0 === w) {
  36580. var _ =
  36581. "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  36582. if (t) throw new Error(_);
  36583. return console.warn(_), this.identity();
  36584. }
  36585. var T = 1 / w;
  36586. return (
  36587. (i[0] = C * T),
  36588. (i[1] =
  36589. (v * f * s -
  36590. p * A * s -
  36591. v * a * g +
  36592. o * A * g +
  36593. p * a * y -
  36594. o * f * y) *
  36595. T),
  36596. (i[2] =
  36597. (c * A * s -
  36598. v * h * s +
  36599. v * a * u -
  36600. o * A * u -
  36601. c * a * y +
  36602. o * h * y) *
  36603. T),
  36604. (i[3] =
  36605. (p * h * s -
  36606. c * f * s -
  36607. p * a * u +
  36608. o * f * u +
  36609. c * a * g -
  36610. o * h * g) *
  36611. T),
  36612. (i[4] = I * T),
  36613. (i[5] =
  36614. (d * A * s -
  36615. m * f * s +
  36616. m * a * g -
  36617. r * A * g -
  36618. d * a * y +
  36619. r * f * y) *
  36620. T),
  36621. (i[6] =
  36622. (m * h * s -
  36623. l * A * s -
  36624. m * a * u +
  36625. r * A * u +
  36626. l * a * y -
  36627. r * h * y) *
  36628. T),
  36629. (i[7] =
  36630. (l * f * s -
  36631. d * h * s +
  36632. d * a * u -
  36633. r * f * u -
  36634. l * a * g +
  36635. r * h * g) *
  36636. T),
  36637. (i[8] = E * T),
  36638. (i[9] =
  36639. (m * p * s -
  36640. d * v * s -
  36641. m * o * g +
  36642. r * v * g +
  36643. d * o * y -
  36644. r * p * y) *
  36645. T),
  36646. (i[10] =
  36647. (l * v * s -
  36648. m * c * s +
  36649. m * o * u -
  36650. r * v * u -
  36651. l * o * y +
  36652. r * c * y) *
  36653. T),
  36654. (i[11] =
  36655. (d * c * s -
  36656. l * p * s -
  36657. d * o * u +
  36658. r * p * u +
  36659. l * o * g -
  36660. r * c * g) *
  36661. T),
  36662. (i[12] = b * T),
  36663. (i[13] =
  36664. (d * v * a -
  36665. m * p * a +
  36666. m * o * f -
  36667. r * v * f -
  36668. d * o * A +
  36669. r * p * A) *
  36670. T),
  36671. (i[14] =
  36672. (m * c * a -
  36673. l * v * a -
  36674. m * o * h +
  36675. r * v * h +
  36676. l * o * A -
  36677. r * c * A) *
  36678. T),
  36679. (i[15] =
  36680. (l * p * a -
  36681. d * c * a +
  36682. d * o * h -
  36683. r * p * h -
  36684. l * o * f +
  36685. r * c * f) *
  36686. T),
  36687. this
  36688. );
  36689. },
  36690. makeRotationFromQuaternion: function (e) {
  36691. var t = this.elements,
  36692. i = e.x,
  36693. n = e.y,
  36694. r = e.z,
  36695. o = e.w,
  36696. a = i + i,
  36697. s = n + n,
  36698. l = r + r,
  36699. c = i * a,
  36700. h = i * s,
  36701. u = i * l,
  36702. d = n * s,
  36703. p = n * l,
  36704. f = r * l,
  36705. g = o * a,
  36706. m = o * s,
  36707. v = o * l;
  36708. return (
  36709. (t[0] = 1 - (d + f)),
  36710. (t[4] = h - v),
  36711. (t[8] = u + m),
  36712. (t[1] = h + v),
  36713. (t[5] = 1 - (c + f)),
  36714. (t[9] = p - g),
  36715. (t[2] = u - m),
  36716. (t[6] = p + g),
  36717. (t[10] = 1 - (c + d)),
  36718. (t[3] = 0),
  36719. (t[7] = 0),
  36720. (t[11] = 0),
  36721. (t[12] = 0),
  36722. (t[13] = 0),
  36723. (t[14] = 0),
  36724. (t[15] = 1),
  36725. this
  36726. );
  36727. },
  36728. }),
  36729. (r.Quaternion = function (e, t, i, n) {
  36730. (this._x = e || 0),
  36731. (this._y = t || 0),
  36732. (this._z = i || 0),
  36733. (this._w = void 0 !== n ? n : 1);
  36734. }),
  36735. (r.Quaternion.prototype = {
  36736. get x() {
  36737. return this._x;
  36738. },
  36739. set x(e) {
  36740. this._x = e;
  36741. },
  36742. get y() {
  36743. return this._y;
  36744. },
  36745. set y(e) {
  36746. this._y = e;
  36747. },
  36748. get z() {
  36749. return this._z;
  36750. },
  36751. set z(e) {
  36752. this._z = e;
  36753. },
  36754. get w() {
  36755. return this._w;
  36756. },
  36757. set w(e) {
  36758. this._w = e;
  36759. },
  36760. copy: function (e) {
  36761. (this._x = e.x),
  36762. (this._y = e.y),
  36763. (this._z = e.z),
  36764. (this._w = e.w);
  36765. },
  36766. inverse: function () {
  36767. return this.conjugate().normalize();
  36768. },
  36769. conjugate: function () {
  36770. return (this._x *= -1), (this._y *= -1), (this._z *= -1), this;
  36771. },
  36772. length: function () {
  36773. return Math.sqrt(
  36774. this._x * this._x +
  36775. this._y * this._y +
  36776. this._z * this._z +
  36777. this._w * this._w
  36778. );
  36779. },
  36780. normalize: function () {
  36781. var e = this.length();
  36782. return (
  36783. 0 === e
  36784. ? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1))
  36785. : ((e = 1 / e),
  36786. (this._x = this._x * e),
  36787. (this._y = this._y * e),
  36788. (this._z = this._z * e),
  36789. (this._w = this._w * e)),
  36790. this
  36791. );
  36792. },
  36793. setFromAxisAngle: function (e, t) {
  36794. var i = t / 2,
  36795. n = Math.sin(i);
  36796. return (
  36797. (this._x = e.x * n),
  36798. (this._y = e.y * n),
  36799. (this._z = e.z * n),
  36800. (this._w = Math.cos(i)),
  36801. this
  36802. );
  36803. },
  36804. setFromUnitVectors: (function () {
  36805. var e,
  36806. t,
  36807. i = 1e-6;
  36808. return function (n, o) {
  36809. return (
  36810. void 0 === e && (e = new r.Vector3()),
  36811. (t = r.dot(n, o) + 1),
  36812. t < i
  36813. ? ((t = 0),
  36814. Math.abs(n.x) > Math.abs(n.z)
  36815. ? r.setVector(e, -n.y, n.x, 0)
  36816. : r.setVector(e, 0, -n.z, n.y))
  36817. : r.cross(n, o, e),
  36818. (this._x = e.x),
  36819. (this._y = e.y),
  36820. (this._z = e.z),
  36821. (this._w = t),
  36822. this.normalize()
  36823. );
  36824. };
  36825. })(),
  36826. multiply: function (e) {
  36827. return this.multiplyQuaternions(this, e);
  36828. },
  36829. premultiply: function (e) {
  36830. return this.multiplyQuaternions(e, this);
  36831. },
  36832. multiplyQuaternions: function (e, t) {
  36833. var i = e._x,
  36834. n = e._y,
  36835. r = e._z,
  36836. o = e._w,
  36837. a = t._x,
  36838. s = t._y,
  36839. l = t._z,
  36840. c = t._w;
  36841. return (
  36842. (this._x = i * c + o * a + n * l - r * s),
  36843. (this._y = n * c + o * s + r * a - i * l),
  36844. (this._z = r * c + o * l + i * s - n * a),
  36845. (this._w = o * c - i * a - n * s - r * l),
  36846. this
  36847. );
  36848. },
  36849. }),
  36850. (r.convertWorkshopVector = function (e) {
  36851. return new r.Vector3(-e.x, e.y, e.z);
  36852. }),
  36853. (r.convertWorkshopQuaternion = function (e) {
  36854. return new r.Quaternion(-e.x, e.y, e.z, -e.w).multiply(
  36855. new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0)
  36856. );
  36857. });
  36858. (r.convertWorkshopOrthoZoom = function (e) {
  36859. //xzw
  36860. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  36861. return e === -1
  36862. ? -1
  36863. : ((e * ($("#player").width() / $("#player").height())) /
  36864. g_snapShotWidth) *
  36865. g_snapShotHeight;
  36866. }),
  36867. (r.convertWorkshopPanoramaQuaternion = function (e) {
  36868. return new r.Quaternion(e.x, -e.y, -e.z, e.w)
  36869. .normalize()
  36870. .multiply(
  36871. new r.Quaternion().setFromAxisAngle(
  36872. new r.Vector3(0, 1, 0),
  36873. 270 * r.RADIANS_PER_DEGREE
  36874. )
  36875. );
  36876. }),
  36877. (r.normalize = function (e) {
  36878. var t = e.x * e.x + e.y * e.y + e.z * e.z,
  36879. i = Math.sqrt(t);
  36880. (e.x /= i), (e.y /= i), (e.z /= i);
  36881. }),
  36882. (r.dot = function (e, t) {
  36883. return e.x * t.x + e.y * t.y + e.z * t.z;
  36884. }),
  36885. (r.cross = function (e, t, i) {
  36886. var n = e.x,
  36887. r = e.y,
  36888. o = e.z;
  36889. (i.x = r * t.z - o * t.y),
  36890. (i.y = o * t.x - n * t.z),
  36891. (i.z = n * t.y - r * t.x);
  36892. }),
  36893. (r.setVector = function (e, t, i, n) {
  36894. (e.x = t), (e.y = i), (e.z = n);
  36895. }),
  36896. (r.copyVector = function (e, t) {
  36897. (t.x = e.x), (t.y = e.y), (t.z = e.z);
  36898. }),
  36899. (r.addVector = function (e, t) {
  36900. (e.x += t.x), (e.y += t.y), (e.z += t.z);
  36901. }),
  36902. (r.subVector = function (e, t) {
  36903. (e.x -= t.x), (e.y -= t.y), (e.z -= t.z);
  36904. }),
  36905. (r.applyQuaternionToVector = function (e, t) {
  36906. var i = t.x,
  36907. n = t.y,
  36908. r = t.z,
  36909. o = e.x,
  36910. a = e.y,
  36911. s = e.z,
  36912. l = e.w,
  36913. c = l * i + a * r - s * n,
  36914. h = l * n + s * i - o * r,
  36915. u = l * r + o * n - a * i,
  36916. d = -o * i - a * n - s * r;
  36917. (t.x = c * l + d * -o + h * -s - u * -a),
  36918. (t.y = h * l + d * -a + u * -o - c * -s),
  36919. (t.z = u * l + d * -s + c * -a - h * -o);
  36920. }),
  36921. (r.angleBetweenVectors = function (e, t) {
  36922. return Math.acos(r.dot(e, t));
  36923. }),
  36924. (t.exports = r);
  36925. },
  36926. {
  36927. "../constants": 8,
  36928. },
  36929. ],
  36930. 177: [
  36931. function (e, t, i) {
  36932. (function (i) {
  36933. "use strict";
  36934. function n(e) {
  36935. (this.cache = null), (this.expires = 0);
  36936. }
  36937. function r() {
  36938. (this.baseUrl = null), (this.cache = null), (this.expires = 0);
  36939. }
  36940. function o() {
  36941. (this.baseUrl = null), (this.expires = 0);
  36942. }
  36943. function a(e) {
  36944. (this.initialLoadingPromise = null),
  36945. (this.endpoint = e + "?type=3"),
  36946. (this.urlContainer = null),
  36947. (this.authorizationHeader = h.getAuthorizationHeader()),
  36948. (this.containerClasses = [o, r, n]);
  36949. }
  36950. var s = e("./ajax"),
  36951. l = e("./logger"),
  36952. c = e("../constants"),
  36953. h = e("./showcase"),
  36954. u = (e("../ab"), new l(i));
  36955. (n.prototype = {
  36956. version: 1,
  36957. validate: function (e) {
  36958. return "catalog.json" in e && Object.keys(e).length > 0;
  36959. },
  36960. update: function (e) {
  36961. return (
  36962. (this.cache = e),
  36963. (this.expires = Date.now() + c.signedUrlDefaultExpireTime),
  36964. $.when()
  36965. );
  36966. },
  36967. get: function (e) {
  36968. return this.cache[e];
  36969. },
  36970. }),
  36971. (r.prototype = {
  36972. version: 2,
  36973. validate: function (e) {
  36974. return (
  36975. "catalog.json" in e &&
  36976. "base.url" in e &&
  36977. Object.keys(e).length > 1
  36978. );
  36979. },
  36980. update: function (e) {
  36981. return (
  36982. (this.baseUrl = e["base.url"]),
  36983. (this.cache = e),
  36984. (this.expires = Date.now() + c.signedUrlDefaultExpireTime),
  36985. $.when()
  36986. );
  36987. },
  36988. get: function (e) {
  36989. var t = this.cache[e];
  36990. return t ? this.baseUrl.replace("{{filename}}", e) + t : null;
  36991. },
  36992. }),
  36993. (o.prototype = {
  36994. version: 3,
  36995. validate: function (e) {
  36996. return (
  36997. e.templates &&
  36998. e.catalog_file &&
  36999. (!e.expires || 1e3 * e.expires > Date.now())
  37000. );
  37001. },
  37002. update: function (e) {
  37003. return (
  37004. (this.baseUrl = e.templates[0]),
  37005. e.expires
  37006. ? (this.expires = 1e3 * e.expires)
  37007. : (this.expires =
  37008. Date.now() + c.signedUrlDefaultExpireTime),
  37009. $.when()
  37010. );
  37011. },
  37012. get: function (e) {
  37013. return this.baseUrl.replace("{{filename}}", e);
  37014. },
  37015. }),
  37016. (a.prototype = {
  37017. init: function () {
  37018. return this.initialLoadingPromise
  37019. ? this.initialLoadingPromise
  37020. : (setInterval(
  37021. function () {
  37022. var e = this.urlContainer
  37023. ? this.urlContainer.expires
  37024. : Date.now();
  37025. Date.now() + c.signedUrlRefreshBuffer > e &&
  37026. (u.debug("Refreshing urls..."),
  37027. this.refresh()
  37028. .done(function () {
  37029. u.debug("Refreshed");
  37030. })
  37031. .fail(function () {
  37032. u.error(
  37033. "Failed url refresh, urls might go stale soon"
  37034. );
  37035. }));
  37036. }.bind(this),
  37037. c.signedUrlCheckInterval
  37038. ),
  37039. (this.initialLoadingPromise = this.refresh()),
  37040. this.initialLoadingPromise);
  37041. },
  37042. refresh: function (e) {
  37043. //已经在someData.js里加载过了 不用再加载file了吧
  37044. e = e || {};
  37045. /*var t = void 0 === e.cache || e.cache;
  37046. return s.get( this.endpoint , { //file
  37047. responseType: "json",
  37048. prefetchFrom: t ? "files" : null,
  37049. cache: t,
  37050. auth: this.authorizationHeader
  37051. }).then(function(e) {
  37052. if (this.urlContainer && this.urlContainer.validate(e))
  37053. return this.urlContainer.update(e);
  37054. for (var i = 0; i < this.containerClasses.length; i++) {
  37055. var n = this.containerClasses[i]
  37056. , r = new n;
  37057. if (r.validate(e))
  37058. return u.info("Using urls version " + r.version),
  37059. this.urlContainer = r,
  37060. this.urlContainer.update(e)
  37061. }
  37062. return t ? this.refresh({
  37063. cache: !1
  37064. }) : $.Deferred().reject("missing-urls")
  37065. }
  37066. .bind(this), function(e) {
  37067. return "loading-failed"
  37068. }) */
  37069. return $.Deferred().resolve();
  37070. },
  37071. get: function (e) {
  37072. //return this.urlContainer.get(e)
  37073. return window.DATA.files.templates[0].replace(
  37074. "{{filename}}",
  37075. e
  37076. );
  37077. },
  37078. }),
  37079. (t.exports = a);
  37080. }).call(this, "/js/util/ModelUrls.js");
  37081. },
  37082. {
  37083. "../ab": 3,
  37084. "../constants": 8,
  37085. "./ajax": 181,
  37086. "./logger": 189,
  37087. "./showcase": 193,
  37088. },
  37089. ],
  37090. 178: [
  37091. function (e, t, i) {
  37092. (function (i) {
  37093. "use strict";
  37094. function n() {
  37095. u.call(this), (this.neighbourMap = {}), (this.map = null);
  37096. }
  37097. var r = e("three"),
  37098. o = e("./common"),
  37099. a = e("../settings"),
  37100. s = e("../objects/Panorama"),
  37101. a = e("../settings"),
  37102. l = e("./aStar"),
  37103. c = e("./logger"),
  37104. h = new c(i),
  37105. u = e("./IndexedCollection"),
  37106. d = e("./transitions");
  37107. o.inherit(n, u),
  37108. (n.prototype.getIndex = function (e) {
  37109. return e.id;
  37110. }),
  37111. (n.prototype.find = function (e, t) {
  37112. var i = o.filterAll(this.list, e);
  37113. return 0 === i.length
  37114. ? null
  37115. : (t &&
  37116. t.forEach(function (e) {
  37117. i = o.stableSort(i, e);
  37118. }),
  37119. i[0]);
  37120. }),
  37121. /* n.prototype.sortByScore = function(e, t) {
  37122. var i = o.filterAll(this.list, e);
  37123. return 0 === i.length ? null : i = i.map(function(e) {
  37124. return {
  37125. pano: e,
  37126. score: t.reduce(function(t, i) {
  37127. return t + i(e)
  37128. }, 0)
  37129. }
  37130. }).sort(function(e, t) {
  37131. return t.score - e.score;
  37132. })
  37133. } */
  37134. (n.prototype.sortByScore = function (request, rank) {
  37135. return common.sortByScore(this.list, request, rank);
  37136. }),
  37137. (n.prototype.lowestByScore = function (e, t, i) {
  37138. return this.findRankedByScore(0, e, t, i);
  37139. }),
  37140. (n.prototype.findRankedByScore = function (e, t, i, n) {
  37141. n && ((n.candidates = null), (n.pano = null)), e || (e = 0);
  37142. var r = this.sortByScore(t, i);
  37143. return !r || 0 === r.length || e >= r.length
  37144. ? null
  37145. : (n && ((n.candidates = r), (n.pano = r[e].item)), r[e].item);
  37146. }),
  37147. (n.prototype.showPanoScores = function (e) {
  37148. this.list.forEach(function (e) {
  37149. e.removeTextSprite();
  37150. });
  37151. var t = 6344768;
  37152. e.forEach(function (e) {
  37153. e.pano.addTextSprite(e.score.toFixed(2), t), (t = 16428055);
  37154. });
  37155. }),
  37156. (n.prototype.isNeighbour = function (e, t) {
  37157. return this.neighbourMap[e.id][t.id];
  37158. }),
  37159. (n.prototype.getNeighbours = function (e) {
  37160. return this.neighbourMap[e.id];
  37161. }),
  37162. (n.prototype.setNeighbour = function (e, t, i) {
  37163. return (
  37164. this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  37165. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  37166. (this.neighbourMap[e.id][e.id] = !0),
  37167. (this.neighbourMap[t.id][t.id] = !0),
  37168. (this.neighbourMap[e.id][t.id] = i),
  37169. (this.neighbourMap[t.id][e.id] = i),
  37170. this.neighbourMap[e.id]
  37171. );
  37172. }),
  37173. (n.prototype.findClosest = function (e, t) {
  37174. var i = [s.filters.isPanoAligned()];
  37175. return (
  37176. t && i.push(s.filters.inDirection(e, t, 0.75)),
  37177. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  37178. );
  37179. }),
  37180. (n.prototype.dualNeighbors = function (e, t) {
  37181. var i,
  37182. n = [];
  37183. for (i in this.neighbourMap[e.id])
  37184. this.neighbourMap[t.id][i] && n.push(i);
  37185. return n;
  37186. }),
  37187. (n.prototype.populate_path_graph = function () {
  37188. var e,
  37189. t,
  37190. i,
  37191. n,
  37192. o,
  37193. a,
  37194. s,
  37195. l,
  37196. c = Date.now(),
  37197. u = {},
  37198. d = 0,
  37199. p = new r.Vector3(0, 0, 0),
  37200. f = 0,
  37201. g = 0;
  37202. for (e = 0; e < this.list.length; e += 1) {
  37203. (o = this.list[e]),
  37204. (s = {}),
  37205. (l = !1),
  37206. (i = o.neighbourPanos || o.findNeighourPanos());
  37207. for (t in i)
  37208. if (i[t]) {
  37209. (a = this.index[t]),
  37210. p.copy(o.floorPosition),
  37211. p.sub(a.floorPosition);
  37212. var m = Math.sqrt(p.x * p.x + p.z * p.z),
  37213. v =
  37214. (Math.abs(p.y) / Math.max(m, 0.01),
  37215. Math.max(0, Math.abs(p.y) - 0.2));
  37216. v > 0
  37217. ? ((f += 1),
  37218. (v = Math.pow(4 * v, 2)),
  37219. (m = Math.pow(m, 2)),
  37220. (n = Math.sqrt(v * v + m * m)))
  37221. : ((g += 1), (n = p.length())),
  37222. (s[a.id] = n),
  37223. (l = !0);
  37224. }
  37225. l ? (u[o.id] = s) : (d += 1);
  37226. }
  37227. (this.map = u),
  37228. h.info(
  37229. "graph ready in " +
  37230. (Date.now() - c) +
  37231. "ms, " +
  37232. d +
  37233. " had no neighbors"
  37234. );
  37235. }),
  37236. (n.prototype.aStarSearch = function (e, t) {
  37237. var i = Date.now(),
  37238. n = new l({
  37239. start: e,
  37240. isEnd: function (e) {
  37241. return e === t;
  37242. },
  37243. neighbor: function (e) {
  37244. var t = e.neighbourPanos || e.findNeighourPanos(),
  37245. i = [];
  37246. for (var n in t) t[n] && i.push(this.index[n]); //add: t[n] &&
  37247. return i;
  37248. }.bind(this),
  37249. distance: function (e, t) {
  37250. var i = this.map[e.id],
  37251. n = i[t.id];
  37252. return n;
  37253. }.bind(this),
  37254. heuristic: function (e, t) {
  37255. return 1;
  37256. }.bind(this),
  37257. hash: function (e) {
  37258. return e.id;
  37259. },
  37260. timeout: 5e3,
  37261. });
  37262. if (
  37263. (h.debug("A* search in " + (Date.now() - i) + "ms"),
  37264. "success" !== n.status)
  37265. )
  37266. return (
  37267. h.debug("Did not find A* path from " + e + " to " + t), null
  37268. );
  37269. h.debug(
  37270. "Total cost " +
  37271. n.cost.toPrecision(3) +
  37272. ", " +
  37273. n.path.length +
  37274. " steps"
  37275. );
  37276. var r = [];
  37277. return (
  37278. n.path.forEach(function (e) {
  37279. r.push(e.id);
  37280. }),
  37281. r
  37282. );
  37283. }),
  37284. (n.prototype.includeNodesNearPath = (function () {
  37285. var e = new r.Vector3(),
  37286. t = new r.Vector3(),
  37287. i = new r.Vector3(),
  37288. n = new r.Vector3(),
  37289. o = new r.Vector3(),
  37290. a = new r.Vector3(),
  37291. s = new r.Vector3(),
  37292. l = new r.Vector3(),
  37293. c = [],
  37294. h = new r.Vector3(),
  37295. u = new r.Vector3();
  37296. return function (r, d) {
  37297. if (r)
  37298. for (
  37299. var p = function (e, t, i) {
  37300. return o.copy(t).sub(e), o.dot(i);
  37301. },
  37302. f = function (e, t) {
  37303. return p(h, e.position, i) - p(h, t.position, i);
  37304. },
  37305. g = 0;
  37306. g < r.length - 1;
  37307. ) {
  37308. var m = r[g],
  37309. v = r[g + 1],
  37310. A = this.index[m],
  37311. y = this.index[v];
  37312. h.copy(A.position),
  37313. u.copy(y.position),
  37314. (c.length = 0),
  37315. e.copy(u).sub(h),
  37316. i.copy(e).normalize();
  37317. for (var C = 0; C < this.list.length; C++) {
  37318. var I = this.list[C];
  37319. o.copy(I.position).sub(h);
  37320. var E = o.dot(i);
  37321. if (E > 0) {
  37322. s.copy(i), s.multiplyScalar(E), a.copy(o), a.sub(s);
  37323. var b = a.length();
  37324. if (b < d) {
  37325. t.copy(e).negate(),
  37326. n.copy(t).normalize(),
  37327. l.copy(I.position).sub(u);
  37328. var w = l.dot(n);
  37329. w > 0 && c.push(I);
  37330. }
  37331. }
  37332. }
  37333. if (c.length > 0) {
  37334. c.sort(f);
  37335. for (
  37336. var _ = r.length + c.length - 1;
  37337. _ >= g + c.length;
  37338. _--
  37339. )
  37340. r[_] = r[_ - c.length];
  37341. for (var T = 0; T < c.length; T++) r[T + g + 1] = c[T].id;
  37342. }
  37343. g += c.length + 1;
  37344. }
  37345. };
  37346. })()),
  37347. /* n.prototype. = function(e, t) {
  37348. var i = void 0 === e ? a.panorama.markerOpacity : e
  37349. , n = this.list.findIndex(function(e) {
  37350. return e.marker
  37351. });
  37352. if (!(n < 0)) {
  37353. var r = this.list[n].marker.material.opacity;
  37354. if (r !== e) {
  37355. var o = i - r;
  37356. d.trigger({
  37357. func: function(e, t) {
  37358. var i = r + e * o;
  37359. this.forEach(function(e) {
  37360. e.marker && (e.marker.material.opacity = i)
  37361. })
  37362. }
  37363. .bind(this),
  37364. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  37365. name: "_fpm"
  37366. })
  37367. }
  37368. }
  37369. } */
  37370. (n.prototype.fadeMarkerOpacity = function (e, t, gr) {
  37371. d.cancelById("fadeMarkerOpacity");
  37372. var n = this.list.findIndex(function (e) {
  37373. //why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  37374. return e.marker;
  37375. });
  37376. if (n < 0) {
  37377. //logger.info('marker findIndex<0')
  37378. return;
  37379. }
  37380. var group;
  37381. var tran = function (list, index) {
  37382. list.member = list.member.filter(function (m) {
  37383. return m.marker && m.marker.material.opacity != list.toOp;
  37384. });
  37385. transitions.trigger({
  37386. func: function (e, t) {
  37387. //e:0-1
  37388. list.member.forEach(function (m) {
  37389. var o = m.marker.oldOpacity;
  37390. var i = o + e * (list.toOp - o);
  37391. m.marker && (m.marker.material.opacity = i);
  37392. });
  37393. }.bind(this),
  37394. duration: void 0 == t ? a.markerOpacityTransitionTime : t,
  37395. name: "_fpm_" + index,
  37396. id: "fadeMarkerOpacity",
  37397. });
  37398. };
  37399. this.forEach(function (e) {
  37400. //先记录旧的opacity
  37401. e.marker && (e.marker.oldOpacity = e.marker.material.opacity);
  37402. });
  37403. group = gr;
  37404. /* if (e > 0 && gr) {
  37405. group = gr
  37406. } else {
  37407. group = [
  37408. {
  37409. member: this.list,
  37410. toOp: 0,
  37411. },
  37412. ]
  37413. } */
  37414. for (var i = 0; i < group.length; i++) {
  37415. tran(group[i], i);
  37416. }
  37417. }),
  37418. (t.exports = n);
  37419. }).call(this, "/js/util/PanoramaCollection.js");
  37420. },
  37421. {
  37422. "../objects/Panorama": 148,
  37423. "../settings": 166,
  37424. "./IndexedCollection": 175,
  37425. "./aStar": 180,
  37426. "./common": 185,
  37427. "./logger": 189,
  37428. "./transitions": 195,
  37429. three: 217,
  37430. },
  37431. ],
  37432. 179: [
  37433. function (e, t, i) {
  37434. "use strict";
  37435. function n() {
  37436. (this.actionSequence = []), (this.actionSequenceInProgress = !1);
  37437. }
  37438. function r(e, t, i, n) {
  37439. s.trackAlways("zoom_" + e, {
  37440. from: t,
  37441. to: i,
  37442. pano: n,
  37443. });
  37444. }
  37445. function o(e, t) {
  37446. r("initial", 1, e, t);
  37447. }
  37448. function a(e, t, i) {
  37449. r("followup", e, t, i);
  37450. }
  37451. var s = e("../analytics");
  37452. (n.prototype.reset = function (e) {
  37453. (this.actionSequenceInProgress = !1),
  37454. (this.actionSequence.length = 0);
  37455. }),
  37456. (n.prototype.addZoomAction = (function () {
  37457. var e = null,
  37458. t = null,
  37459. i = !1,
  37460. n = function () {
  37461. if (((e = null), this.actionSequence.length > 0)) {
  37462. var i = this.actionSequence[0].start,
  37463. n = this.actionSequence[this.actionSequence.length - 1].end;
  37464. 1 === i ? o(n, t) : a(i, n, t);
  37465. }
  37466. this.reset();
  37467. };
  37468. return function (r, o, a) {
  37469. if (r !== o) {
  37470. i || ((n = n.bind(this)), (i = !0)),
  37471. e && (window.clearTimeout(e), (e = null)),
  37472. (a === t && this.actionSequenceInProgress) ||
  37473. (this.reset(), (t = a)),
  37474. (this.actionSequenceInProgress = !0);
  37475. var s = {
  37476. start: r,
  37477. end: o,
  37478. };
  37479. this.actionSequence.push(s), (e = window.setTimeout(n, 150));
  37480. }
  37481. };
  37482. })()),
  37483. (t.exports = n);
  37484. },
  37485. {
  37486. "../analytics": 4,
  37487. },
  37488. ],
  37489. 180: [
  37490. function (e, t, i) {
  37491. "use strict";
  37492. function n(e) {
  37493. void 0 === e.timeout && (e.timeout = 1 / 0);
  37494. var t = e.hash || o,
  37495. i = {
  37496. data: e.start,
  37497. g: 0,
  37498. h: e.heuristic(e.start),
  37499. },
  37500. n = i;
  37501. i.f = i.h;
  37502. var h = new s(),
  37503. u = new l(a),
  37504. d = c();
  37505. u.push(i), d.set(t(i.data), i);
  37506. for (var p = new Date(); u.size(); ) {
  37507. if (new Date() - p > e.timeout)
  37508. return {
  37509. status: "timeout",
  37510. cost: n.g,
  37511. path: r(n),
  37512. };
  37513. var f = u.pop();
  37514. if ((d.delete(t(f.data)), e.isEnd(f.data)))
  37515. return {
  37516. status: "success",
  37517. cost: f.g,
  37518. path: r(f),
  37519. };
  37520. h.add(t(f.data));
  37521. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  37522. var v = g[m];
  37523. if (!h.contains(t(v))) {
  37524. var A = f.g + e.distance(f.data, v),
  37525. y = d.get(t(v)),
  37526. C = !1;
  37527. if (void 0 === y)
  37528. (y = {
  37529. data: v,
  37530. }),
  37531. d.set(t(v), y);
  37532. else {
  37533. if (y.g < A) continue;
  37534. C = !0;
  37535. }
  37536. (y.parent = f),
  37537. (y.g = A),
  37538. (y.h = e.heuristic(v)),
  37539. (y.f = A + y.h),
  37540. y.h < n.h && (n = y),
  37541. C ? u.heapify() : u.push(y);
  37542. }
  37543. }
  37544. }
  37545. return {
  37546. status: "noPath",
  37547. cost: n.g,
  37548. path: r(n),
  37549. };
  37550. }
  37551. function r(e) {
  37552. if (void 0 !== e.parent) {
  37553. var t = r(e.parent);
  37554. return t.push(e.data), t;
  37555. }
  37556. return [e.data];
  37557. }
  37558. function o(e) {
  37559. return e.toString();
  37560. }
  37561. function a(e, t) {
  37562. return e.f - t.f;
  37563. }
  37564. var s = e("Set"),
  37565. l = e("heap"),
  37566. c = e("dict");
  37567. t.exports = n;
  37568. },
  37569. {
  37570. Set: 196,
  37571. dict: 210,
  37572. heap: 211,
  37573. },
  37574. ],
  37575. 181: [
  37576. function (e, t, i) {
  37577. (function (i) {
  37578. "use strict";
  37579. function n(e, t, i) {
  37580. var n = new XMLHttpRequest();
  37581. if (i && "withCredentials" in n) n.open(e, t, i);
  37582. else if ("undefined" != typeof XDomainRequest)
  37583. (n = new XDomainRequest()), n.open(e, t);
  37584. else {
  37585. if (i) throw "Browser does not support CORS!";
  37586. n.open(e, t);
  37587. }
  37588. return n;
  37589. }
  37590. function r(e, t, i) {
  37591. function o() {
  37592. u.warn("Retrying ", t),
  37593. r(e, t, i)
  37594. .done(c.resolve.bind(c))
  37595. .progress(c.notify.bind(c))
  37596. .fail(c.reject.bind(c));
  37597. }
  37598. function a(e, t) {
  37599. var i = e.response;
  37600. if ("json" === t && "object" != typeof i)
  37601. try {
  37602. i = JSON.parse(e.responseText);
  37603. } catch (e) {
  37604. return void c.reject({
  37605. error: "Failed parsing JSON",
  37606. });
  37607. }
  37608. else if ("image/jpeg" === t) {
  37609. var n = new Uint8Array(e.response),
  37610. r = new Blob([n], {
  37611. type: "image/jpeg",
  37612. }),
  37613. o = URL.createObjectURL(r);
  37614. (i = new Image()),
  37615. (i.src = o),
  37616. (i.crossOrigin = "Anonymous"),
  37617. (i.onload = function () {
  37618. URL.revokeObjectURL(o);
  37619. });
  37620. }
  37621. return i;
  37622. }
  37623. var s = n(e, t, !1);
  37624. if (
  37625. ((i = i || {}),
  37626. (i.retries = void 0 !== i.retries ? i.retries : 0),
  37627. (i.retry =
  37628. void 0 !== i.retry ? i.retry : "get" === e.toLowerCase()),
  37629. i.responseType)
  37630. )
  37631. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  37632. s.responseType = i.responseType;
  37633. else {
  37634. if ("image/jpeg" !== i.responseType)
  37635. throw new Error(
  37636. 'reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"'
  37637. );
  37638. s.responseType = "arraybuffer";
  37639. }
  37640. if (
  37641. ("json" === i.responseType &&
  37642. s.setRequestHeader("Accept", "application/json"),
  37643. i.auth && s.setRequestHeader("Authorization", i.auth),
  37644. "object" == typeof i.data &&
  37645. ((i.data = JSON.stringify(i.data)),
  37646. s.setRequestHeader("Content-Type", "application/json")),
  37647. "object" == typeof i.headers)
  37648. )
  37649. for (var l in i.headers) s.setRequestHeader(l, i.headers[l]);
  37650. var c = $.Deferred();
  37651. return (
  37652. (s.onreadystatechange = function (e) {
  37653. if (4 === this.readyState)
  37654. if (
  37655. this.status >= 500 &&
  37656. this.status <= 600 &&
  37657. i.retry &&
  37658. i.retries < 3
  37659. )
  37660. i.retries++, setTimeout(o, 1e3);
  37661. else if (200 === this.status) {
  37662. var t = a(this, i.responseType);
  37663. c.resolve(t);
  37664. } else c.reject(this);
  37665. }),
  37666. (s.onprogress = function (e) {
  37667. c.notify(e);
  37668. }),
  37669. s.send(i.data),
  37670. c.promise()
  37671. );
  37672. }
  37673. function o(e) {
  37674. return Object.keys(e)
  37675. .sort()
  37676. .map(function (t) {
  37677. return {
  37678. key: t,
  37679. value: e[t],
  37680. };
  37681. });
  37682. }
  37683. function a(e, t) {
  37684. var i = t.responseType || null,
  37685. n = t.auth || null,
  37686. r = t.prefetchFrom || null,
  37687. a = e + "__" + i + "__" + n + "__" + r;
  37688. return (
  37689. t.headers &&
  37690. o(t.headers).forEach(function (e) {
  37691. a += "__" + e.key + ":" + e.value;
  37692. }),
  37693. a
  37694. );
  37695. }
  37696. function s(e, t) {
  37697. return window.MP_REQUEST_CACHE
  37698. ? window.MP_REQUEST_CACHE[a(e, t)]
  37699. : null;
  37700. }
  37701. function l(e, t, i) {
  37702. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i);
  37703. }
  37704. var c = e("./logger"),
  37705. h = e("../ab"),
  37706. u = new c(i);
  37707. (window.URL = window.URL || window.webkitURL),
  37708. (window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {}),
  37709. (window.DATA = window.DATA || {}),
  37710. /* setTimeout(function() {//MP-- xzw delete
  37711. window.MP_REQUEST_CACHE = null,
  37712. window.DATA = {}
  37713. }, 6e4),
  37714. window.onpageshow = function(e) {
  37715. e.persisted && (window.MP_REQUEST_CACHE = null,
  37716. window.DATA = {})
  37717. } */
  37718. (t.exports = {
  37719. get: function (e, t) {
  37720. t = t || {};
  37721. var i = void 0 === t.cache || t.cache;
  37722. if (i) {
  37723. var n = s(e, t);
  37724. if (n) return n;
  37725. }
  37726. var o;
  37727. return (
  37728. (o =
  37729. t.prefetchFrom && window.DATA[t.prefetchFrom]
  37730. ? $.when(window.DATA[t.prefetchFrom])
  37731. : r("GET", e, t)),
  37732. i && l(e, t, o),
  37733. o
  37734. );
  37735. },
  37736. post: function (e, t) {
  37737. return r("POST", e, t);
  37738. },
  37739. patch: function (e, t) {
  37740. return r("PATCH", e, t);
  37741. },
  37742. getImage: function (e, t) {
  37743. function i() {
  37744. u.warn("Retrying ", e),
  37745. o
  37746. .getImage(e, t - 1)
  37747. .done(n.resolve.bind(n))
  37748. .progress(n.notify.bind(n))
  37749. .fail(n.reject.bind(n));
  37750. }
  37751. var n = $.Deferred(),
  37752. r = new Image(),
  37753. o = this;
  37754. return (
  37755. (e = h.changeIfImageOptimzing(e)),
  37756. (null !== t && void 0 !== t) || (t = 3),
  37757. (r.onerror = function () {
  37758. t > 0 ? setTimeout(i, 1e3) : n.reject();
  37759. }),
  37760. (r.onload = function () {
  37761. n.resolve(r);
  37762. }),
  37763. (r.crossOrigin = "anonymous"),
  37764. (r.src = e),
  37765. n
  37766. );
  37767. },
  37768. });
  37769. }).call(this, "/js/util/ajax.js");
  37770. },
  37771. {
  37772. "../ab": 3,
  37773. "./logger": 189,
  37774. },
  37775. ],
  37776. 182: [
  37777. function (e, t, i) {
  37778. "use strict";
  37779. function n(e, t) {
  37780. var i = window.navigator.userAgent,
  37781. n = i.match(e);
  37782. return (
  37783. (n = n ? n[1].split(t) : []),
  37784. {
  37785. major: parseInt(n[0]) || 0,
  37786. minor: parseInt(n[1]) || 0,
  37787. patch: parseInt(n[2]) || 0,
  37788. }
  37789. );
  37790. }
  37791. var r = e("../exception/DeviceMismatchException");
  37792. t.exports = {
  37793. supportsFullscreen: function () {
  37794. return (
  37795. document.fullscreenEnabled ||
  37796. document.mozFullscreenEnabled ||
  37797. document.mozFullScreenEnabled ||
  37798. document.webkitFullscreenEnabled ||
  37799. document.msFullscreenEnabled
  37800. );
  37801. },
  37802. isPointerLocked: function () {
  37803. return (
  37804. document.pointerLockElement ||
  37805. document.mozPointerLockElement ||
  37806. document.webkitPointerLockElement
  37807. );
  37808. },
  37809. requestFullscreen: function (e, t) {
  37810. e.requestFullscreen
  37811. ? e.requestFullscreen()
  37812. : e.mozRequestFullScreen
  37813. ? e.mozRequestFullScreen()
  37814. : e.webkitRequestFullscreen
  37815. ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)
  37816. : e.msRequestFullscreen && e.msRequestFullscreen(),
  37817. t &&
  37818. $(document).on(
  37819. "fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange",
  37820. browser.requestPointerLock
  37821. );
  37822. },
  37823. requestPointerLock: function () {
  37824. var e;
  37825. if (document.fullscreenElement) e = document.fullscreenElement();
  37826. else if (document.mozFullscreenElement)
  37827. e = document.mozFullscreenElement();
  37828. else if (document.mozFullScreenElement)
  37829. e = document.mozFullScreenElement();
  37830. else {
  37831. if (!document.webkitFullscreenElement) return;
  37832. e = document.webkitFullscreenElement();
  37833. }
  37834. (e.requestPointerLock =
  37835. e.requestPointerLock ||
  37836. e.mozRequestPointerLock ||
  37837. e.webkitRequestPointerLock),
  37838. e.requestPointerLock(),
  37839. $(document).off(
  37840. "fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange",
  37841. this
  37842. );
  37843. },
  37844. exitPointerLock: function () {
  37845. (document.exitPointerLock =
  37846. document.exitPointerLock ||
  37847. document.mozExitPointerLock ||
  37848. document.webkitExitPointerLock),
  37849. document.exitPointerLock();
  37850. },
  37851. exitFullscreen: function () {
  37852. document.exitFullscreen
  37853. ? document.exitFullscreen()
  37854. : document.msExitFullscreen
  37855. ? document.msExitFullscreen()
  37856. : document.mozCancelFullScreen
  37857. ? document.mozCancelFullScreen()
  37858. : document.webkitExitFullscreen &&
  37859. document.webkitExitFullscreen();
  37860. },
  37861. details: function () {
  37862. var e = navigator.userAgent.match(
  37863. "(Firefox|Chrome|Safari)/([\\d]+)"
  37864. );
  37865. return e
  37866. ? {
  37867. name: e[1],
  37868. version: parseInt(e[2]),
  37869. platform: navigator.platform,
  37870. }
  37871. : {};
  37872. },
  37873. is: function (e) {
  37874. return this.details() && this.details().name === e;
  37875. },
  37876. inIframe: function () {
  37877. return window.parent !== window;
  37878. },
  37879. aspectRatio: function () {
  37880. var e = $("#player").width() / $("#player").height();
  37881. return isFinite(e) ? e : 0;
  37882. },
  37883. userAgent: function () {
  37884. return window.navigator.userAgent;
  37885. },
  37886. isLandscape: function () {
  37887. return this.isMobile && this.aspectRatio() > 1;
  37888. },
  37889. isSmallScreen: function () {
  37890. var e = screen.width / window.devicePixelRatio;
  37891. return e < 240;
  37892. },
  37893. detectIE: function () {
  37894. var e = window.navigator.userAgent,
  37895. t = e.indexOf("MSIE ");
  37896. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./);
  37897. },
  37898. detectSafari: function () {
  37899. var e = window.navigator.userAgent,
  37900. t = e.indexOf("Safari");
  37901. return t !== -1 && !this.detectChrome();
  37902. },
  37903. detectFirefox: function () {
  37904. var e = window.navigator.userAgent;
  37905. return e.indexOf("Firefox") !== -1;
  37906. },
  37907. detectChrome: function () {
  37908. var e = window.navigator.userAgent;
  37909. return e.indexOf("Chrome") !== -1 && !this.detectOpera();
  37910. },
  37911. detectOpera: function () {
  37912. var e = window.navigator.userAgent;
  37913. return e.indexOf("OPR") !== -1;
  37914. },
  37915. detectIOS: function () {
  37916. return (
  37917. this.detectIPhone() || this.detectIPad() || this.detectIPod()
  37918. );
  37919. },
  37920. detectIPad: function () {
  37921. var e = window.navigator.userAgent,
  37922. t = /iPad/;
  37923. return t.test(e);
  37924. },
  37925. detectIPod: function () {
  37926. var e = window.navigator.userAgent,
  37927. t = /iPod/;
  37928. return t.test(e);
  37929. },
  37930. detectIPhone: function () {
  37931. var e = window.navigator.userAgent,
  37932. t = /iPhone/;
  37933. return t.test(e);
  37934. },
  37935. detectAndroid: function () {
  37936. var e = window.navigator.userAgent;
  37937. return e.indexOf("Android") !== -1;
  37938. },
  37939. detectAndroidMobile: function () {
  37940. var e = window.navigator.userAgent;
  37941. return this.detectAndroid() && e.indexOf("Mobile") !== -1;
  37942. },
  37943. detectSamsungNative: function () {
  37944. var e = window.navigator.userAgent;
  37945. return (
  37946. e.indexOf("SM-G900H") !== -1 ||
  37947. e.indexOf("GT-I9500") !== -1 ||
  37948. e.indexOf("SM-N900") !== -1
  37949. );
  37950. },
  37951. detectSamsungS6: function () {
  37952. var e = window.navigator.userAgent;
  37953. return e.indexOf("SM-G92") !== -1;
  37954. },
  37955. /************************************************************fyz改from徐世廷*************************************************************/
  37956. detectHUAWEI5X: function () {
  37957. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  37958. },
  37959. /*******************************************************************************************************************************/
  37960. detectWebVR: function () {
  37961. return !(!window.navigator.getVRDisplays || !window.VRDisplay);
  37962. },
  37963. getVRDisplay: function () {
  37964. var e = $.Deferred();
  37965. return this.detectWebVR()
  37966. ? (navigator.getVRDisplays().then(function (t) {
  37967. t.length >= 1 && e.resolve(t[0]), e.reject(null);
  37968. }),
  37969. e)
  37970. : e.reject(null);
  37971. },
  37972. iosVersion: function () {
  37973. if (!this.detectIOS()) throw new r("Did not detect an iDevice");
  37974. var e = /((?:\d+\_?){1,3}) like Mac OS/,
  37975. t = "_";
  37976. return n(e, t);
  37977. },
  37978. androidVersion: function () {
  37979. if (!this.detectAndroid())
  37980. throw new r("Did not detect an Android based device");
  37981. var e = /Android ((?:\d+\.?){1,3})/,
  37982. t = ".";
  37983. return n(e, t);
  37984. },
  37985. valueFromCookie: function (e, t) {
  37986. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  37987. if (!i) return t;
  37988. var n = i[1];
  37989. return "boolean" == typeof t
  37990. ? "true" === n || "1" === n
  37991. : "number" == typeof t
  37992. ? parseFloat(n)
  37993. : n;
  37994. },
  37995. valueFromHash: function (e, t) {
  37996. var i = new RegExp("[#&?]" + e + "=([^#&?]*)"),
  37997. n = i.exec(window.location.href);
  37998. if (!n) return t;
  37999. var r = n[1];
  38000. return "boolean" == typeof t
  38001. ? "true" === r || "1" === r
  38002. : "number" == typeof t
  38003. ? parseFloat(r)
  38004. : window.decodeURIComponent(r);
  38005. },
  38006. };
  38007. Object.assign(window.browser, t.exports);
  38008. t.exports = window.browser;
  38009. changeLog();
  38010. },
  38011. {
  38012. "../exception/DeviceMismatchException": 56,
  38013. },
  38014. ],
  38015. 183: [
  38016. function (e, t, i) {
  38017. (function (i) {
  38018. "use strict";
  38019. function n(e, t) {
  38020. var i = r(t);
  38021. var replaceAll = function (str, f, e) {
  38022. //f全部替换成e
  38023. var reg = new RegExp(f, "g"); //创建正则RegExp对象
  38024. return str.replace(reg, e);
  38025. };
  38026. var urlFirstView = c.valueFromHash("firstView");
  38027. if (urlFirstView) {
  38028. //&firstView=pano:e98808cfdb894f33851c3b3d7d0a2679,qua:-0.015155019941222028,0.3253822291629593,0.005215708110435864,0.945446737862511&qs=1
  38029. try {
  38030. urlFirstView = replaceAll(urlFirstView, "pano:", '"pano":"');
  38031. if (urlFirstView.includes("qua")) {
  38032. urlFirstView = replaceAll(urlFirstView, ",qua:", '","qua":[');
  38033. urlFirstView += "]";
  38034. } else {
  38035. urlFirstView += '"';
  38036. }
  38037. urlFirstView = "{" + urlFirstView + "}";
  38038. let info = JSON.parse(urlFirstView);
  38039. i.pano = t.index[info.pano]; //panos.get(info.pano)
  38040. if (!i.pano) {
  38041. urlFirstView = false;
  38042. console.error("检测到firstView但是 找不到该pano");
  38043. } else {
  38044. if (info.qua) {
  38045. i.quaternion = new THREE.Quaternion().fromArray(info.qua);
  38046. } else {
  38047. i.quaternion = new THREE.Quaternion();
  38048. }
  38049. i.zoom = -1;
  38050. i.mode = "panorama";
  38051. i.setByUrl = true;
  38052. }
  38053. } catch (e) {
  38054. urlFirstView = false;
  38055. console.error("检测到firstView但是解析出错" + e);
  38056. }
  38057. }
  38058. if (Object.keys(i).length > 0) return i;
  38059. if (e.heroImage) i = o(e, t);
  38060. else if (window.DATA.camera_start) {
  38061. var n = window.DATA.camera_start;
  38062. try {
  38063. Object.keys(n).length > 0 &&
  38064. !l.isEmptyQuaternion(n.camera.quaternion) &&
  38065. ((i.mode = h.convertWorkshopModeInt(n.mode)),
  38066. (i.position = n.camera.position),
  38067. //i.quaternion = n.camera.quaternion,
  38068. (i.quaternion = new th.Quaternion().fromArray(
  38069. n.camera.quaternion
  38070. )), //xzw
  38071. (i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom)),
  38072. n.pano &&
  38073. ((i.pano = t.get(n.pano.uuid) || t.findClosest(i.position)),
  38074. d.debug("Using camera_start"),
  38075. d.debug("Modeldata pano: ", i.pano.quaternion),
  38076. d.debug("Camera start pano: ", n.pano.quaternion)),
  38077. i.mode !== h.PANORAMA &&
  38078. (i.floorVisibility =
  38079. e.heroImage.metadata.floor_visibility));
  38080. } catch (e) {
  38081. d.warn(e.message);
  38082. if (i.mode == "panorama" && !i.pano) i.pano = t.list[0];
  38083. }
  38084. }
  38085. if (
  38086. (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  38087. i.mode === h.MESH &&
  38088. i.position &&
  38089. ((i.mode = h.PANORAMA),
  38090. (i.pano = t.findClosest(i.position)),
  38091. (i.quaternion = i.pano.quaternion)),
  38092. 0 === Object.keys(i).length)
  38093. ) {
  38094. var a = t.list[0];
  38095. a &&
  38096. ((i.mode = h.PANORAMA),
  38097. (i.pano = a),
  38098. (i.position = a.position),
  38099. (i.quaternion = a.quaternion),
  38100. d.info("Starting at 1st pano " + a.id));
  38101. }
  38102. return (i.mode = i.mode || h.DOLLHOUSE), i;
  38103. }
  38104. function r(e) {
  38105. var t = c.valueFromHash("start", ""),
  38106. i = {};
  38107. if ("" !== t) {
  38108. d.debug("Start override found in parameters, trying to parse..."),
  38109. (i = a(t) || {});
  38110. var n = c.valueFromHash("tag", null);
  38111. n && (i.tag = n), i.panoId && (i.pano = e.get(i.panoId));
  38112. }
  38113. return i;
  38114. }
  38115. function o(e, t) {
  38116. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  38117. return {};
  38118. var i = {},
  38119. n = e.heroImage.metadata;
  38120. d.debug("Using start position from thumbnail image"),
  38121. (i.position = n.camera_position),
  38122. (i.quaternion = n.camera_quaternion);
  38123. try {
  38124. (i.mode = h.convertWorkshopModeInt(n.camera_mode)),
  38125. i.mode === h.PANORAMA
  38126. ? (i.pano = t.get(n.scan_id))
  38127. : (i.floorVisibility = n.floor_visibility);
  38128. } catch (e) {
  38129. d.debug(e.message);
  38130. }
  38131. return i;
  38132. }
  38133. function a(e) {
  38134. return s.deserialize(e);
  38135. }
  38136. var s = e("../controls/serializer"),
  38137. l = e("../util/math"),
  38138. c = e("./browser"),
  38139. h = e("../enum/Viewmode"),
  38140. u = e("../util/logger"),
  38141. th = e("three"), //xzw
  38142. d = new u(i);
  38143. t.exports = {
  38144. getStartCameraOptions: n,
  38145. };
  38146. }).call(this, "/js/util/camera.js");
  38147. },
  38148. {
  38149. "../controls/serializer": 14,
  38150. "../enum/Viewmode": 51,
  38151. "../util/logger": 189,
  38152. "../util/math": 190,
  38153. "./browser": 182,
  38154. three: 217,
  38155. },
  38156. ],
  38157. 184: [
  38158. function (e, t, i) {
  38159. "use strict";
  38160. function n(e, t, i) {
  38161. return o(e.fov, t, i);
  38162. }
  38163. var r = e("./MathLight"),
  38164. o = function (e, t, i) {
  38165. var n = t,
  38166. o = i,
  38167. a =
  38168. 2 *
  38169. Math.atan(Math.tan((e * r.RADIANS_PER_DEGREE) / 2) * (n / o)) *
  38170. r.DEGREES_PER_RADIAN;
  38171. return a;
  38172. },
  38173. a = function (e, t, i) {
  38174. var n = t,
  38175. o = i,
  38176. a =
  38177. 2 *
  38178. Math.atan(Math.tan((e * r.RADIANS_PER_DEGREE) / 2) * (o / n)) *
  38179. r.DEGREES_PER_RADIAN;
  38180. return a;
  38181. },
  38182. s = function (e, t, i, n) {
  38183. var r = o(e, i, n);
  38184. return r > t ? a(t, i, n) : e;
  38185. };
  38186. t.exports = {
  38187. clampVFOV: s,
  38188. getHFOVForCamera: n,
  38189. getHFOVFromVFOV: o,
  38190. getVFOVFromHFOV: a,
  38191. };
  38192. window.MathLight = t.exports;
  38193. MathLight.closeTo = function (e1, e2, precision) {
  38194. //xzw add 判断e1,e2是否接近
  38195. var prec = Math.pow(10, -(precision || 4));
  38196. var s1 =
  38197. Math.abs(e1.x - e2.x) < prec &&
  38198. Math.abs(e1.y - e2.y) < prec &&
  38199. Math.abs(e1.z - e2.z) < prec;
  38200. if (e1.w) {
  38201. return s1 && Math.abs(e1.w - e2.w) < prec;
  38202. } else return s1;
  38203. };
  38204. },
  38205. {
  38206. "./MathLight": 176,
  38207. },
  38208. ],
  38209. 185: [
  38210. function (e, t, i) {
  38211. "use strict";
  38212. var n = e("three");
  38213. (t.exports = {
  38214. delayOneFrame: function (e) {
  38215. window.setTimeout(e, 1);
  38216. },
  38217. normalizeUrl: function (e) {
  38218. return e.replace("https://", "http://");
  38219. },
  38220. domainFromUrl: function (e) {
  38221. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  38222. return t ? t[3] : e;
  38223. },
  38224. average: function (e, t) {
  38225. if (0 === e.length) return null;
  38226. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  38227. var o = t ? e[r][t] : e[r];
  38228. (i += o), n++;
  38229. }
  38230. return i / n;
  38231. },
  38232. countUnique: function (e) {
  38233. for (var t = {}, i = 0; i < e.length; i++)
  38234. t[e[i]] = 1 + (t[e[i]] || 0);
  38235. return Object.keys(t).length;
  38236. },
  38237. averageVectors: function (e, t) {
  38238. var i = new n.Vector3();
  38239. if (0 === e.length) return i;
  38240. for (var r = 0, o = 0; o < e.length; o++) {
  38241. var a = t ? e[o][t] : e[o];
  38242. i.add(a), r++;
  38243. }
  38244. return i.divideScalar(r);
  38245. },
  38246. equalLists: function (e, t) {
  38247. if (e.length !== t.length) return !1;
  38248. for (var i = 0; i < e.length; i++) if (e[i] !== t[i]) return !1;
  38249. return !0;
  38250. },
  38251. lowerMedian: function (e, t) {
  38252. if (0 === e.length) return null;
  38253. (t = t || 2),
  38254. e.sort(function (e, t) {
  38255. return e - t;
  38256. });
  38257. var i = Math.floor(e.length / t);
  38258. return e[i];
  38259. },
  38260. stableSort: function (e, t) {
  38261. return e
  38262. .map(function (e, t) {
  38263. return {
  38264. value: e,
  38265. index: t,
  38266. };
  38267. })
  38268. .sort(function (e, i) {
  38269. var n = t(e.value, i.value);
  38270. return 0 !== n ? n : e.index - i.index;
  38271. })
  38272. .map(function (e) {
  38273. return e.value;
  38274. });
  38275. },
  38276. filterAll: function (e, t) {
  38277. return e.filter(function (e) {
  38278. return t.every(function (t) {
  38279. return t(e);
  38280. });
  38281. });
  38282. },
  38283. formatDate: function (e) {
  38284. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-");
  38285. },
  38286. formatDatetime: function (e) {
  38287. return [
  38288. e.getFullYear(),
  38289. e.getMonth() + 1,
  38290. e.getDate(),
  38291. e.getHours(),
  38292. e.getMinutes(),
  38293. ].join("-");
  38294. },
  38295. randomString: function (e) {
  38296. for (
  38297. var t = "",
  38298. i =
  38299. "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
  38300. n = 0;
  38301. n < e;
  38302. n++
  38303. )
  38304. t += i.charAt(Math.floor(Math.random() * i.length));
  38305. return t;
  38306. },
  38307. uint8ToBase64: function (e, t) {
  38308. (t && "number" == typeof t) || (t = 8192);
  38309. for (var i = [], n = 0; n < e.length; n += t)
  38310. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  38311. return btoa(i.join(""));
  38312. },
  38313. uuid4: function e(t) {
  38314. return t
  38315. ? (t ^ ((16 * Math.random()) >> (t / 4))).toString(16)
  38316. : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e);
  38317. },
  38318. nth: function (e) {
  38319. return (
  38320. (e %= 10),
  38321. 1 === e
  38322. ? e + "st"
  38323. : 2 === e
  38324. ? e + "nd"
  38325. : 3 === e
  38326. ? e + "rd"
  38327. : e + "th"
  38328. );
  38329. },
  38330. extendObject: function (e, t) {
  38331. return (
  38332. Object.keys(t).forEach(function (i) {
  38333. e[i] = t[i];
  38334. }),
  38335. e
  38336. );
  38337. },
  38338. deepExtend: function e(t) {
  38339. t = t || {};
  38340. for (var i = 1; i < arguments.length; i++) {
  38341. var n = arguments[i];
  38342. if (n)
  38343. for (var r in n)
  38344. n.hasOwnProperty(r) &&
  38345. ("object" == typeof n[r]
  38346. ? (t[r] = e(t[r], n[r]))
  38347. : (t[r] = n[r]));
  38348. }
  38349. return t;
  38350. },
  38351. inherit: function (e, t) {
  38352. (e.prototype = Object.create(t.prototype)),
  38353. (e.prototype.constructor = e);
  38354. },
  38355. extend: function (e, t) {
  38356. for (var i in t.prototype) e.prototype[i] = t.prototype[i];
  38357. },
  38358. getFileNameFromUrl: function (url) {
  38359. return url.split("/").pop();
  38360. },
  38361. }),
  38362. (Math.sign = function (e) {
  38363. return e < 0 ? -1 : 1;
  38364. });
  38365. window.common = t.exports;
  38366. expandCommon(common);
  38367. },
  38368. {
  38369. three: 217,
  38370. },
  38371. ],
  38372. 186: [
  38373. function (e, t, i) {
  38374. "use strict";
  38375. var n = {};
  38376. (n.linearTween = function (e, t, i, n) {
  38377. return (i * e) / n + t;
  38378. }),
  38379. (n.easeInQuad = function (e, t, i, n) {
  38380. return (e /= n), i * e * e + t;
  38381. }),
  38382. (n.easeOutQuad = function (e, t, i, n) {
  38383. return (e /= n), -i * e * (e - 2) + t;
  38384. }),
  38385. (n.easeInOutQuad = function (e, t, i, n) {
  38386. return (
  38387. (e /= n / 2),
  38388. e < 1
  38389. ? (i / 2) * e * e + t
  38390. : (e--, (-i / 2) * (e * (e - 2) - 1) + t)
  38391. );
  38392. }),
  38393. (n.easeInCubic = function (e, t, i, n) {
  38394. return (e /= n), i * e * e * e + t;
  38395. }),
  38396. (n.easeOutCubic = function (e, t, i, n) {
  38397. return (e /= n), e--, i * (e * e * e + 1) + t;
  38398. }),
  38399. (n.easeInOutCubic = function (e, t, i, n) {
  38400. return (
  38401. (e /= n / 2),
  38402. e < 1
  38403. ? (i / 2) * e * e * e + t
  38404. : ((e -= 2), (i / 2) * (e * e * e + 2) + t)
  38405. );
  38406. }),
  38407. (n.easeInQuart = function (e, t, i, n) {
  38408. return (e /= n), i * e * e * e * e + t;
  38409. }),
  38410. (n.easeOutQuart = function (e, t, i, n) {
  38411. return (e /= n), e--, -i * (e * e * e * e - 1) + t;
  38412. }),
  38413. (n.easeInOutQuart = function (e, t, i, n) {
  38414. return (
  38415. (e /= n / 2),
  38416. e < 1
  38417. ? (i / 2) * e * e * e * e + t
  38418. : ((e -= 2), (-i / 2) * (e * e * e * e - 2) + t)
  38419. );
  38420. }),
  38421. (n.easeInQuint = function (e, t, i, n) {
  38422. return (e /= n), i * e * e * e * e * e + t;
  38423. }),
  38424. (n.easeOutQuint = function (e, t, i, n) {
  38425. return (e /= n), e--, i * (e * e * e * e * e + 1) + t;
  38426. }),
  38427. (n.easeInOutQuint = function (e, t, i, n) {
  38428. return (
  38429. (e /= n / 2),
  38430. e < 1
  38431. ? (i / 2) * e * e * e * e * e + t
  38432. : ((e -= 2), (i / 2) * (e * e * e * e * e + 2) + t)
  38433. );
  38434. }),
  38435. (n.easeInSine = function (e, t, i, n) {
  38436. return -i * Math.cos((e / n) * (Math.PI / 2)) + i + t;
  38437. }),
  38438. (n.easeOutSine = function (e, t, i, n) {
  38439. return i * Math.sin((e / n) * (Math.PI / 2)) + t;
  38440. }),
  38441. (n.easeInOutSine = function (e, t, i, n) {
  38442. return (-i / 2) * (Math.cos((Math.PI * e) / n) - 1) + t;
  38443. }),
  38444. (n.easeInExpo = function (e, t, i, n) {
  38445. return i * Math.pow(2, 10 * (e / n - 1)) + t;
  38446. }),
  38447. (n.easeOutExpo = function (e, t, i, n) {
  38448. return i * (-Math.pow(2, (-10 * e) / n) + 1) + t;
  38449. }),
  38450. (n.easeInOutExpo = function (e, t, i, n) {
  38451. return (
  38452. (e /= n / 2),
  38453. e < 1
  38454. ? (i / 2) * Math.pow(2, 10 * (e - 1)) + t
  38455. : (e--, (i / 2) * (-Math.pow(2, -10 * e) + 2) + t)
  38456. );
  38457. }),
  38458. (n.easeInCirc = function (e, t, i, n) {
  38459. return (e /= n), -i * (Math.sqrt(1 - e * e) - 1) + t;
  38460. }),
  38461. (n.easeOutCirc = function (e, t, i, n) {
  38462. return (e /= n), e--, i * Math.sqrt(1 - e * e) + t;
  38463. }),
  38464. (n.easeInOutCirc = function (e, t, i, n) {
  38465. return (
  38466. (e /= n / 2),
  38467. e < 1
  38468. ? (-i / 2) * (Math.sqrt(1 - e * e) - 1) + t
  38469. : ((e -= 2), (i / 2) * (Math.sqrt(1 - e * e) + 1) + t)
  38470. );
  38471. }),
  38472. (n.easeInElastic = function (e, t, i, n) {
  38473. var r = 1.70158,
  38474. o = 0,
  38475. a = i;
  38476. return 0 === e
  38477. ? t
  38478. : 1 === (e /= n)
  38479. ? t + i
  38480. : (o || (o = 0.3 * n),
  38481. a < Math.abs(i)
  38482. ? ((a = i), (r = o / 4))
  38483. : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  38484. -(
  38485. a *
  38486. Math.pow(2, 10 * (e -= 1)) *
  38487. Math.sin(((e * n - r) * (2 * Math.PI)) / o)
  38488. ) + t);
  38489. }),
  38490. (n.easeOutElastic = function (e, t, i, n) {
  38491. var r = 1.70158,
  38492. o = 0,
  38493. a = i;
  38494. return 0 === e
  38495. ? t
  38496. : 1 === (e /= n)
  38497. ? t + i
  38498. : (o || (o = 0.3 * n),
  38499. a < Math.abs(i)
  38500. ? ((a = i), (r = o / 4))
  38501. : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  38502. a *
  38503. Math.pow(2, -10 * e) *
  38504. Math.sin(((e * n - r) * (2 * Math.PI)) / o) +
  38505. i +
  38506. t);
  38507. }),
  38508. (n.easeInOutElastic = function (e, t, i, n) {
  38509. var r = 1.70158,
  38510. o = 0,
  38511. a = i;
  38512. return 0 === e
  38513. ? t
  38514. : 2 === (e /= n / 2)
  38515. ? t + i
  38516. : (o || (o = n * (0.3 * 1.5)),
  38517. a < Math.abs(i)
  38518. ? ((a = i), (r = o / 4))
  38519. : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  38520. e < 1
  38521. ? -0.5 *
  38522. (a *
  38523. Math.pow(2, 10 * (e -= 1)) *
  38524. Math.sin(((e * n - r) * (2 * Math.PI)) / o)) +
  38525. t
  38526. : a *
  38527. Math.pow(2, -10 * (e -= 1)) *
  38528. Math.sin(((e * n - r) * (2 * Math.PI)) / o) *
  38529. 0.5 +
  38530. i +
  38531. t);
  38532. }),
  38533. (n.easeInBack = function (e, t, i, n, r) {
  38534. return (
  38535. void 0 === r && (r = 1.70158),
  38536. i * (e /= n) * e * ((r + 1) * e - r) + t
  38537. );
  38538. }),
  38539. (n.easeOutBack = function (e, t, i, n, r) {
  38540. return (
  38541. void 0 === r && (r = 1.70158),
  38542. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  38543. );
  38544. }),
  38545. (n.easeInOutBack = function (e, t, i, n, r) {
  38546. return (
  38547. void 0 === r && (r = 1.70158),
  38548. (e /= n / 2) < 1
  38549. ? (i / 2) * (e * e * (((r *= 1.525) + 1) * e - r)) + t
  38550. : (i / 2) * ((e -= 2) * e * (((r *= 1.525) + 1) * e + r) + 2) +
  38551. t
  38552. );
  38553. }),
  38554. (n.easeOutBounce = function (e, t, i, n) {
  38555. return (e /= n) < 1 / 2.75
  38556. ? i * (7.5625 * e * e) + t
  38557. : e < 2 / 2.75
  38558. ? i * (7.5625 * (e -= 1.5 / 2.75) * e + 0.75) + t
  38559. : e < 2.5 / 2.75
  38560. ? i * (7.5625 * (e -= 2.25 / 2.75) * e + 0.9375) + t
  38561. : i * (7.5625 * (e -= 2.625 / 2.75) * e + 0.984375) + t;
  38562. }),
  38563. (n.easeInBounce = function (e, t, i, r) {
  38564. return i - n.easeOutBounce(r - e, 0, i, r) + t;
  38565. }),
  38566. (n.easeInOutBounce = function (e, t, i, r) {
  38567. return e < r / 2
  38568. ? 0.5 * n.easeInBounce(2 * e, 0, i, r) + t
  38569. : 0.5 * n.easeOutBounce(x, 2 * e - r, 0, i, r) + 0.5 * i + t;
  38570. }),
  38571. (t.exports = n);
  38572. window.easing = n;
  38573. },
  38574. {},
  38575. ],
  38576. 187: [
  38577. function (e, t, i) {
  38578. "use strict";
  38579. function n() {
  38580. (this.events = []), (this.valid = !1);
  38581. }
  38582. var r = e("../enum/Joystick");
  38583. (n.prototype.push = function (e, t) {
  38584. this.events.push({
  38585. direction: e,
  38586. pano: t,
  38587. }),
  38588. (this.valid = !0);
  38589. }),
  38590. (n.prototype.pop = function (e) {
  38591. var t = this.events.pop();
  38592. return this.events.length < 1 && (this.valid = !1), t;
  38593. }),
  38594. (n.prototype.peek = function () {
  38595. return this.events.length
  38596. ? this.events[this.events.length - 1]
  38597. : {
  38598. direction: null,
  38599. pano: null,
  38600. };
  38601. }),
  38602. (n.prototype.invalidate = function () {
  38603. (this.events = []), (this.valid = !1);
  38604. }),
  38605. (n.prototype.reversePano = function (e) {
  38606. if (!this.valid) return null;
  38607. var t = this.peek();
  38608. return r.opposite(e) === t.direction ? (this.pop(), t.pano) : null;
  38609. }),
  38610. (t.exports = n);
  38611. },
  38612. {
  38613. "../enum/Joystick": 29,
  38614. },
  38615. ],
  38616. 188: [
  38617. function (e, t, i) {
  38618. "use strict";
  38619. window.lerp = t.exports = {
  38620. vector: function (e, t) {
  38621. var i = e.clone();
  38622. return (
  38623. (t = t.clone()),
  38624. function (n) {
  38625. e.set(
  38626. i.x * (1 - n) + t.x * n,
  38627. i.y * (1 - n) + t.y * n,
  38628. i.z * (1 - n) + t.z * n
  38629. );
  38630. }
  38631. );
  38632. },
  38633. quaternion: function (e, t) {
  38634. var i = e.clone();
  38635. return function (n) {
  38636. e.copy(i).slerp(t, n);
  38637. };
  38638. },
  38639. property: function (e, t, i, n) {
  38640. var r = e[t];
  38641. return function (o) {
  38642. (e[t] = r * (1 - o) + i * o), n && n(e[t]);
  38643. };
  38644. },
  38645. uniform: function (e, t, i) {
  38646. var n = e.material.uniforms[t].value;
  38647. return function (r) {
  38648. e.material.uniforms[t] &&
  38649. (e.material.uniforms[t].value = n * (1 - r) + i * r);
  38650. };
  38651. },
  38652. matrix4: function (e, t) {
  38653. var i = e.clone();
  38654. return function (n) {
  38655. for (
  38656. var r = e.elements, o = i.elements, a = t.elements, s = 0;
  38657. s < 16;
  38658. s++
  38659. )
  38660. r[s] = o[s] * (1 - n) + a[s] * n;
  38661. };
  38662. },
  38663. allUniforms: function (e, t, i) {
  38664. var n = e.map(
  38665. function (e) {
  38666. return this.uniform(e, t, i);
  38667. }.bind(this)
  38668. );
  38669. return function (e) {
  38670. n.forEach(function (t) {
  38671. t(e);
  38672. });
  38673. };
  38674. },
  38675. };
  38676. },
  38677. {},
  38678. ],
  38679. 189: [
  38680. function (e, t, i) {
  38681. "use strict";
  38682. function n(e) {
  38683. var t,
  38684. i,
  38685. o,
  38686. a,
  38687. s = e.split("/"),
  38688. l = "[" + s[s.length - 1].replace(".js", "") + "]",
  38689. c = {};
  38690. if (n.consoleEnabled) {
  38691. var h = function (e) {
  38692. $("#debug-console").append("<p>" + e + "</p>"),
  38693. ($("#debug-console")[0].scrollTop =
  38694. $("#debug-console")[0].scrollHeight);
  38695. };
  38696. (t = function (e) {
  38697. h(Array.prototype.slice.call(arguments).join(" "));
  38698. }),
  38699. (i = function (e) {
  38700. h(Array.prototype.slice.call(arguments).join(" "));
  38701. }),
  38702. (o = function (e) {
  38703. h("WARN: " + Array.prototype.slice.call(arguments).join(" "));
  38704. }),
  38705. (a = function (e) {
  38706. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "));
  38707. });
  38708. } else
  38709. console.log
  38710. ? ((t = console.log),
  38711. (i = console.info ? console.info : console.log),
  38712. (o = console.warn ? console.warn : console.log),
  38713. (a = console.error ? console.error : console.log))
  38714. : (t = i = o = a = function () {});
  38715. var u = function (e) {
  38716. return [l, n.timestamp()].concat(Array.prototype.slice.call(e));
  38717. },
  38718. d = function (t, i) {
  38719. if (r) {
  38720. var o = Array.prototype.slice.call(t).join(" ");
  38721. r.captureMessage(o, {
  38722. level: i,
  38723. path: e,
  38724. timestamp: n.timestamp(),
  38725. });
  38726. }
  38727. },
  38728. p = function (t, i) {
  38729. if (r) {
  38730. var o = Array.prototype.slice.call(t).join(" ");
  38731. r.captureException(new Error(o), {
  38732. level: i,
  38733. path: e,
  38734. timestamp: n.timestamp(),
  38735. });
  38736. }
  38737. };
  38738. return {
  38739. debug: function () {
  38740. n.level >= n.levels.debug && t.apply(console, u(arguments));
  38741. },
  38742. info: function () {
  38743. n.level >= n.levels.info && i.apply(console, u(arguments));
  38744. },
  38745. warn: function () {
  38746. d(arguments, "warn"),
  38747. n.level >= n.levels.warn && o.apply(console, u(arguments));
  38748. },
  38749. error: function () {
  38750. p(arguments, "error"),
  38751. n.level >= n.levels.error && a.apply(console, u(arguments));
  38752. },
  38753. v3str: function (e, t) {
  38754. var i = void 0 === t ? 2 : t;
  38755. return (
  38756. "(" +
  38757. e.x.toPrecision(i) +
  38758. ", " +
  38759. e.y.toPrecision(i) +
  38760. ", " +
  38761. e.z.toPrecision(i) +
  38762. ")"
  38763. );
  38764. },
  38765. eulstr: function (e, t) {
  38766. var i = void 0 === t ? 2 : t;
  38767. return (
  38768. "(" +
  38769. THREE.Math.radToDeg(e.x).toPrecision(i) +
  38770. ", " +
  38771. THREE.Math.radToDeg(e.y).toPrecision(i) +
  38772. ", " +
  38773. THREE.Math.radToDeg(e.z).toPrecision(i) +
  38774. ' "' +
  38775. e.order +
  38776. '")'
  38777. );
  38778. },
  38779. time: function (e) {
  38780. n.level >= n.levels.debug && (c[e] = Date.now());
  38781. },
  38782. timeEnd: function (e) {
  38783. if (n.level >= n.levels.debug) {
  38784. var t = c[e];
  38785. if (!t) return;
  38786. var i = (Date.now() - t) / 1e3;
  38787. this.debug(e, i + "s");
  38788. }
  38789. },
  38790. };
  38791. }
  38792. var r = window.Raven;
  38793. (n.timestamp = function () {
  38794. return (Date.now() - window.navigationStart) / 1e3 + "s";
  38795. }),
  38796. (n.levels = {
  38797. debug: 3,
  38798. info: 2,
  38799. warn: 1,
  38800. error: 0,
  38801. }),
  38802. (n.level = n.levels.info),
  38803. (t.exports = n);
  38804. },
  38805. {},
  38806. ],
  38807. 190: [
  38808. function (e, t, i) {
  38809. "use strict";
  38810. var n = e("three"),
  38811. r = e("../enum/GLCubeFaces"),
  38812. o = e("../constants");
  38813. t.exports = {
  38814. convertVisionVector: function (e) {
  38815. return new n.Vector3(e.x, e.z, -e.y);
  38816. },
  38817. convertVisionQuaternion: function (e) {
  38818. return new n.Quaternion(e.x, e.z, -e.y, e.w).multiply(
  38819. new n.Quaternion().setFromAxisAngle(
  38820. new n.Vector3(0, 1, 0),
  38821. n.Math.degToRad(90)
  38822. )
  38823. );
  38824. },
  38825. convertWorkshopVector: function (e) {
  38826. return new n.Vector3(-e.x, e.y, e.z);
  38827. },
  38828. convertWorkshopQuaternion: function (e) {
  38829. return new n.Quaternion(-e.x, e.y, e.z, -e.w).multiply(
  38830. new n.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0)
  38831. );
  38832. },
  38833. convertWorkshopPanoramaQuaternion: function (e) {
  38834. return new n.Quaternion(e.x, -e.y, -e.z, e.w)
  38835. .normalize()
  38836. .multiply(
  38837. new n.Quaternion().setFromAxisAngle(
  38838. new n.Vector3(0, 1, 0),
  38839. n.Math.degToRad(270)
  38840. )
  38841. );
  38842. },
  38843. convertWorkshopOrthoZoom: function (e) {
  38844. // xzw
  38845. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  38846. //return e;
  38847. return e === -1
  38848. ? -1
  38849. : ((e * ($("#player").width() / $("#player").height())) /
  38850. g_snapShotWidth) *
  38851. g_snapShotHeight;
  38852. },
  38853. toPrecision: function (e, t) {
  38854. //xzw change
  38855. var f = function (e, t) {
  38856. var i = Math.pow(10, t);
  38857. return Math.round(e * i) / i;
  38858. };
  38859. if (e instanceof Array) {
  38860. for (var s = 0; s < e.length; s++) {
  38861. e[s] = f(e[s], t);
  38862. }
  38863. return e;
  38864. } else return f(e, t);
  38865. },
  38866. isEmptyQuaternion: function (e) {
  38867. return (
  38868. 0 === Math.abs(e.x) &&
  38869. 0 === Math.abs(e.y) &&
  38870. 0 === Math.abs(e.z) &&
  38871. 0 === Math.abs(e.w)
  38872. );
  38873. },
  38874. projectPositionToCanvas: function (e, t, i) {
  38875. (i = i || new n.Vector3()), i.copy(e);
  38876. var r = 0.5 * $("#player").width(),
  38877. o = 0.5 * $("#player").height();
  38878. return i.project(t), (i.x = i.x * r + r), (i.y = -(i.y * o) + o), i;
  38879. },
  38880. convertScreenPositionToNDC: function (e, t, i) {
  38881. return (
  38882. (i = i || new n.Vector2()),
  38883. (i.x = (e / $("#player").width()) * 2 - 1),
  38884. (i.y = 2 * -(t / $("#player").height()) + 1),
  38885. i
  38886. );
  38887. },
  38888. constrainedTurn: function (e) {
  38889. var t = e % (2 * Math.PI);
  38890. return (t =
  38891. t > Math.PI
  38892. ? (t -= 2 * Math.PI)
  38893. : t < -Math.PI
  38894. ? (t += 2 * Math.PI)
  38895. : t);
  38896. },
  38897. getFOVDotThreshold: function (e) {
  38898. return Math.cos(n.Math.degToRad(e / 2));
  38899. },
  38900. transform2DForwardVectorByCubeFace: function (e, t, i, n) {
  38901. switch (e) {
  38902. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  38903. i.set(1, t.y, t.x);
  38904. break;
  38905. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  38906. i.set(-1, t.y, -t.x);
  38907. break;
  38908. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  38909. i.set(-t.x, 1, -t.y);
  38910. break;
  38911. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  38912. i.set(-t.x, -1, t.y);
  38913. break;
  38914. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  38915. i.set(-t.x, t.y, 1);
  38916. break;
  38917. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  38918. i.set(t.x, t.y, -1);
  38919. }
  38920. n && i.normalize();
  38921. },
  38922. //add:
  38923. getPos2d: function (point, camera, dom) {
  38924. var camera = camera;
  38925. var dom = dom;
  38926. 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);
  38927. var x, y;
  38928. x = ((pos.x + 1) / 2) * dom.clientWidth;
  38929. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  38930. var inSight =
  38931. x <= dom.clientWidth && x >= 0 && y <= dom.clientHeight && y >= 0;
  38932. return {
  38933. pos: new THREE.Vector2(x, y),
  38934. vector: pos,
  38935. trueSide: pos.z < 1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  38936. inSight: inSight, //在屏幕范围内可见
  38937. };
  38938. },
  38939. getDirByLonLat: function (lon, lat) {
  38940. var dir = new THREE.Vector3();
  38941. var phi = THREE.Math.degToRad(90 - lat);
  38942. var theta = THREE.Math.degToRad(lon);
  38943. dir.x = Math.sin(phi) * Math.cos(theta);
  38944. dir.y = Math.cos(phi);
  38945. dir.z = Math.sin(phi) * Math.sin(theta);
  38946. return dir.negate();
  38947. },
  38948. };
  38949. window.math = t.exports;
  38950. },
  38951. {
  38952. "../constants": 8,
  38953. "../enum/GLCubeFaces": 25,
  38954. three: 217,
  38955. },
  38956. ],
  38957. 191: [
  38958. function (e, t, i) {
  38959. "use strict";
  38960. function n(e, t, i) {
  38961. return a.map(
  38962. function (n, o) {
  38963. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg");
  38964. }.bind(this)
  38965. );
  38966. }
  38967. function r(e) {
  38968. return s[e];
  38969. }
  38970. var o = e("../enum/GLCubeFaces"),
  38971. a = [0, 1, 2, 3, 4, 5],
  38972. s = {
  38973. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  38974. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  38975. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  38976. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  38977. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  38978. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
  38979. };
  38980. t.exports = {
  38981. mapFaceToCubemapFace: r,
  38982. getCubemapUrls: n,
  38983. };
  38984. },
  38985. {
  38986. "../enum/GLCubeFaces": 25,
  38987. },
  38988. ],
  38989. 192: [
  38990. function (e, t, i) {
  38991. "use strict";
  38992. t.exports = {
  38993. captureErrors: function (e, t, i) {
  38994. if ("Raven" in window) {
  38995. Raven.config(e, t).install(), i && Raven.setTagsContext(i);
  38996. var n = console.warn,
  38997. r = console.error;
  38998. (console.warn = function () {
  38999. var e = Array.prototype.slice.call(arguments);
  39000. Raven.captureMessage(e.join(" "), {
  39001. level: "warning",
  39002. }),
  39003. n.apply(console, e);
  39004. }),
  39005. (console.error = function () {
  39006. var e = Array.prototype.slice.call(arguments);
  39007. Raven.captureException(new Error(e.join(" ")), {
  39008. level: "error",
  39009. }),
  39010. r.apply(console, e);
  39011. });
  39012. } else console.error("Raven not found, not capturing errors.");
  39013. },
  39014. };
  39015. },
  39016. {},
  39017. ],
  39018. 193: [
  39019. function (e, t, i) {
  39020. (function (i) {
  39021. "use strict";
  39022. var n = e("./browser"),
  39023. r = e("../constants"),
  39024. o = e("url"),
  39025. a = e("./logger"),
  39026. ss = e("three"),
  39027. s = new a(i),
  39028. l = {
  39029. getAuthorizationHeader: function () {
  39030. var e = n.valueFromHash("auth");
  39031. if (e) return e.replace(",", " ");
  39032. var t = n.valueFromCookie("token");
  39033. return t ? "Token " + t : null;
  39034. },
  39035. parseSidUrl: function (e) {
  39036. var t, i;
  39037. t = g_Prefix;
  39038. if (((e = e || ""), e.match(/^https?/))) {
  39039. var n = o.parse(e);
  39040. (t = g_Prefix), (i = e);
  39041. } else {
  39042. //xzw 原先的不能用
  39043. //t = window.location.protocol + "//" + window.location.host, //MP
  39044. t = g_Prefix;
  39045. //i = t + "/api/player/models/" + e; //MP
  39046. i = t + "data/" + e;
  39047. }
  39048. return {
  39049. urlBase: t,
  39050. urlModel: i,
  39051. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  39052. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb"),
  39053. };
  39054. },
  39055. getModelIDFromQueryString: function () {
  39056. return n.valueFromHash("model") || n.valueFromHash("m");
  39057. },
  39058. /* normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  39059. e = JSON.parse(JSON.stringify(e));
  39060. var i = null;
  39061. if (e.images.forEach(function(n) {
  39062. if(!n.metadata) return;
  39063. if ("string" == typeof n.metadata)
  39064. try {
  39065. n.metadata = JSON.parse(n.metadata)
  39066. } catch (e) {
  39067. s.warn("Unable to parse image metadata"),
  39068. n.metadata = null
  39069. }
  39070. else{
  39071. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  39072. }
  39073. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  39074. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  39075. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  39076. }else{
  39077. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  39078. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  39079. n.metadata.zoom = n.metadata.zoom || 1;
  39080. }
  39081. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  39082. }),
  39083. //icon初始视角的:
  39084. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  39085. var n = {};
  39086. n.pano = {
  39087. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  39088. position: t.convertWorkshopVector(i.scan_position),
  39089. uuid: i.scan_id
  39090. },
  39091. n.camera = {
  39092. quaternion: i.camera_quaternion,
  39093. position: i.camera_position
  39094. },
  39095. e.startPano = n
  39096. }
  39097. return e
  39098. },
  39099. */
  39100. normalizeModeldata: function (e, t) {
  39101. //xzw 修改导览images数据
  39102. e = JSON.parse(JSON.stringify(e));
  39103. var i = null;
  39104. var deal = function (n) {
  39105. if (!n.metadata) return;
  39106. if ("string" == typeof n.metadata)
  39107. try {
  39108. n.metadata = JSON.parse(n.metadata);
  39109. } catch (e) {
  39110. s.warn("Unable to parse image metadata"),
  39111. (n.metadata = null);
  39112. }
  39113. else {
  39114. "object" == typeof n.metadata &&
  39115. s.debug("image.metadata already a JSON object");
  39116. }
  39117. if (n.metadata.camera_position instanceof Array) {
  39118. //xzw 改的格式
  39119. n.metadata.camera_position = new ss.Vector3().fromArray(
  39120. n.metadata.camera_position
  39121. );
  39122. n.metadata.camera_quaternion =
  39123. new ss.Quaternion().fromArray(
  39124. n.metadata.camera_quaternion
  39125. );
  39126. } else {
  39127. n.metadata.camera_position = new ss.Vector3().copy(
  39128. n.metadata.camera_position
  39129. );
  39130. n.metadata.camera_quaternion = new ss.Quaternion().copy(
  39131. n.metadata.camera_quaternion
  39132. );
  39133. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  39134. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  39135. }
  39136. !i && e.icon && e.icon === n.sid && (i = n.metadata);
  39137. };
  39138. //改
  39139. e.images.forEach((info) => {
  39140. if (info.locations) {
  39141. info.locations.forEach((a) => deal(a));
  39142. } else {
  39143. deal(info);
  39144. }
  39145. });
  39146. //icon初始视角的:
  39147. if (
  39148. i &&
  39149. i.camera_quaternion &&
  39150. i.camera_position &&
  39151. i.scan_position &&
  39152. i.scan_quaternion
  39153. ) {
  39154. var n = {};
  39155. (n.pano = {
  39156. quaternion: t.convertWorkshopPanoramaQuaternion(
  39157. i.scan_quaternion
  39158. ),
  39159. position: t.convertWorkshopVector(i.scan_position),
  39160. uuid: i.scan_id,
  39161. }),
  39162. (n.camera = {
  39163. quaternion: i.camera_quaternion,
  39164. position: i.camera_position,
  39165. }),
  39166. (e.startPano = n);
  39167. }
  39168. return e;
  39169. },
  39170. visionVersionToInt: (function () {
  39171. var e = new RegExp(
  39172. ["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")
  39173. );
  39174. return function (t) {
  39175. if (!t) throw new Error("Vision version is required");
  39176. var i = e.exec(t);
  39177. if (null === i)
  39178. throw new Error("String is not a vision version: " + t);
  39179. return parseInt(i[1]);
  39180. };
  39181. })(),
  39182. modelDataPromisesTiles: function (e) {
  39183. var vision_version =
  39184. e.vision_version || window.DATA.vision_version;
  39185. if (vision_version)
  39186. try {
  39187. return (
  39188. l.visionVersionToInt(vision_version) >=
  39189. l.visionVersionToInt(r.visionTilingStartVersion)
  39190. );
  39191. } catch (t) {
  39192. s.warn("Invalid vision version: " + vision_version);
  39193. }
  39194. // var t = e.created ? new Date(e.created) : null;
  39195. // return t && t >= r.visionTilingStartDate
  39196. return false;
  39197. },
  39198. };
  39199. t.exports = l;
  39200. }).call(this, "/js/util/showcase.js");
  39201. },
  39202. {
  39203. "../constants": 8,
  39204. "./browser": 182,
  39205. "./logger": 189,
  39206. three: 217,
  39207. url: 208,
  39208. },
  39209. ],
  39210. 194: [
  39211. function (e, t, i) {
  39212. "use strict";
  39213. var n = e("../util/ajax"),
  39214. r = e("three"),
  39215. o = e("../settings"),
  39216. a = {};
  39217. t.exports = {
  39218. load: function (e, t, i) {
  39219. var s = a[e];
  39220. return s
  39221. ? (t &&
  39222. setTimeout(function () {
  39223. t(s);
  39224. }, 1),
  39225. s)
  39226. : ((s = new r.Texture()),
  39227. o.minimalMemoryMode &&
  39228. ((s.minFilter = r.LinearFilter),
  39229. (s.magFilter = r.LinearFilter),
  39230. (s.generateMipmaps = !1)),
  39231. (s.sourceFile = e),
  39232. (a[e] = s),
  39233. n
  39234. .getImage(e)
  39235. .then(function (e) {
  39236. (s.image = e), (s.needsUpdate = !0), t && t(s);
  39237. })
  39238. .fail(i),
  39239. s);
  39240. },
  39241. loadBase64: function (e, t) {
  39242. t = t || "png";
  39243. var i = new r.Texture();
  39244. return (
  39245. (i.image = document.createElement("img")),
  39246. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  39247. o.minimalMemoryMode &&
  39248. ((i.minFilter = r.LinearFilter),
  39249. (i.magFilter = r.LinearFilter),
  39250. (i.generateMipmaps = !1)),
  39251. (i.needsUpdate = !0),
  39252. i
  39253. );
  39254. },
  39255. isLoaded: function (e) {
  39256. return !!a[e];
  39257. },
  39258. };
  39259. window.Texture = t.exports;
  39260. },
  39261. {
  39262. "../settings": 166,
  39263. "../util/ajax": 181,
  39264. three: 217,
  39265. },
  39266. ],
  39267. 195: [
  39268. function (e, t, i) {
  39269. "use strict";
  39270. var n = e("./easing");
  39271. window.transitions = t.exports = {
  39272. globalDone: null,
  39273. funcs: [],
  39274. counter: 0,
  39275. uniqueID: 0,
  39276. start: function (e, t, i, r, o, a, s) {
  39277. return (
  39278. (r = r || 0),
  39279. this.funcs.push({
  39280. func: e,
  39281. current: -r * Math.abs(t),
  39282. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  39283. done: i,
  39284. easing: o || n.linearTween,
  39285. cycling: t < 0,
  39286. running: !0,
  39287. debug: r < 0,
  39288. name: a || "T" + this.counter,
  39289. id: void 0 === s ? this.counter : s,
  39290. paused: !1,
  39291. }),
  39292. e(0, 16),
  39293. (this.counter += 1),
  39294. e
  39295. );
  39296. },
  39297. trigger: function (e) {
  39298. var t = void 0 === e.delayRatio ? 0 : e.delayRatio,
  39299. i = e.func || function () {},
  39300. r = void 0 === e.duration ? 0 : e.duration;
  39301. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  39302. var o = e.done || null,
  39303. a = e.easing || n.linearTween,
  39304. s = e.name || "R" + this.counter,
  39305. l = void 0 === e.id ? this.counter : e.id;
  39306. return this.start(i, r, o, t, a, s, l);
  39307. },
  39308. setTimeout: function (e, t, i) {
  39309. var n = void 0 === i ? this.counter : i;
  39310. return this.trigger({
  39311. done: e,
  39312. duration: void 0 === t ? 0 : t,
  39313. name: "O" + this.counter,
  39314. id: n,
  39315. });
  39316. },
  39317. pause: function () {
  39318. this.paused = !0;
  39319. },
  39320. resume: function () {
  39321. this.paused = !1;
  39322. },
  39323. update: function (e) {
  39324. this.funcs.forEach(function (t) {
  39325. if (!(t.paused || ((t.current += 1e3 * e), t.current < 0)))
  39326. if (t.current >= t.duration && !t.cycling) {
  39327. var i = t.easing(1, 0, 1, 1);
  39328. t.func(i, 1e3 * e), t.done && t.done(), (t.running = !1);
  39329. } else {
  39330. var n = t.easing(
  39331. (t.current % t.duration) / t.duration,
  39332. 0,
  39333. 1,
  39334. 1
  39335. ),
  39336. r = t.func(n, 1e3 * e) || !1;
  39337. r && (t.done && t.done(), (t.running = !1));
  39338. }
  39339. });
  39340. var t = this.funcs.length;
  39341. this.funcs = this.funcs.filter(function (e) {
  39342. return e.running;
  39343. });
  39344. var i = this.funcs.length;
  39345. if (t > 0 && 0 === i && this.globalDone) {
  39346. var n = this.globalDone;
  39347. (this.globalDone = null), n();
  39348. }
  39349. },
  39350. adjustSpeed: function (e, t) {
  39351. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  39352. var r = i[n];
  39353. (r.duration /= t), (r.current /= t);
  39354. }
  39355. },
  39356. getById: function (e) {
  39357. return this.funcs.filter(function (t) {
  39358. return e === t.id;
  39359. });
  39360. },
  39361. get: function (e) {
  39362. for (var t = 0; t < this.funcs.length; t += 1)
  39363. if (this.funcs[t].func === e) return this.funcs[t];
  39364. return null;
  39365. },
  39366. isRunning: function (e) {
  39367. var t = this.get(e);
  39368. return null !== t && t.running;
  39369. },
  39370. countActive: function () {
  39371. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  39372. e += this.funcs[t].running;
  39373. return e;
  39374. },
  39375. listActive: function () {
  39376. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  39377. this.funcs[t].running && e.push(this.funcs[t].name);
  39378. return e;
  39379. },
  39380. done: function (e) {
  39381. this.globalDone = e;
  39382. },
  39383. cancelById: function (e) {
  39384. var t = void 0 === e ? 0 : e;
  39385. this.funcs = this.funcs.filter(function (e) {
  39386. return e.id !== t;
  39387. });
  39388. },
  39389. cancel: function (e) {
  39390. this.funcs = this.funcs.filter(function (t) {
  39391. return t.func !== e;
  39392. });
  39393. },
  39394. getUniqueId: function () {
  39395. return (this.uniqueID -= 1), this.uniqueID;
  39396. },
  39397. };
  39398. },
  39399. {
  39400. "./easing": 186,
  39401. },
  39402. ],
  39403. 196: [
  39404. function (e, t, i) {
  39405. function n(e) {
  39406. if (
  39407. ((this.set = {}),
  39408. (this.infContains = function () {
  39409. return !0;
  39410. }),
  39411. "object" == typeof e)
  39412. )
  39413. if (e instanceof Array)
  39414. for (var t = 0; t < e.length; t++) this.set[e[t]] = !0;
  39415. else this.set = e;
  39416. else if ("function" == typeof e) this.infContains = e;
  39417. else if ("undefined" != typeof e)
  39418. throw new Error("set must be either an array or an object.");
  39419. }
  39420. (t.exports = n),
  39421. (n.prototype.contains = function (e) {
  39422. return !!this.set[e];
  39423. }),
  39424. (n.prototype.has = n.prototype.contains),
  39425. (n.prototype.add = function (e) {
  39426. if (1 == arguments.length) this.set[e] = !0;
  39427. else
  39428. for (var t = 0; t < arguments.length; t++)
  39429. this.set[arguments[t]] = !0;
  39430. }),
  39431. (n.prototype.addAll = function (e) {
  39432. if ("object" != typeof e && !(e instanceof Array))
  39433. throw new Error("arr must be an array.");
  39434. for (var t = 0; t < e.length; t++) this.add(e[t]);
  39435. }),
  39436. (n.prototype.remove = function (e) {
  39437. if (1 == arguments.length) delete this.set[e];
  39438. else
  39439. for (var t = 0; t < arguments.length; t++)
  39440. delete this.set[arguments[t]];
  39441. }),
  39442. (n.prototype.delete = n.prototype.remove),
  39443. (n.prototype.clear = function () {
  39444. this.set = {};
  39445. }),
  39446. (n.prototype.size = function () {
  39447. return Object.keys(this.set).length;
  39448. }),
  39449. (n.prototype.toString = function () {
  39450. return "{" + Object.keys(this.set).toString() + "}";
  39451. }),
  39452. (n.prototype.toArray = function () {
  39453. return "undefined" == typeof this.set ? [] : Object.keys(this.set);
  39454. }),
  39455. (n.prototype["*values"] = n.prototype.toArray);
  39456. },
  39457. {},
  39458. ],
  39459. 197: [function (e, t, i) {}, {}],
  39460. 198: [
  39461. function (e, t, i) {
  39462. (function (t) {
  39463. "use strict";
  39464. function n() {
  39465. try {
  39466. var e = new Uint8Array(1);
  39467. return (
  39468. (e.__proto__ = {
  39469. __proto__: Uint8Array.prototype,
  39470. foo: function () {
  39471. return 42;
  39472. },
  39473. }),
  39474. 42 === e.foo() &&
  39475. "function" == typeof e.subarray &&
  39476. 0 === e.subarray(1, 1).byteLength
  39477. );
  39478. } catch (e) {
  39479. return !1;
  39480. }
  39481. }
  39482. function r() {
  39483. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
  39484. }
  39485. function o(e, t) {
  39486. if (r() < t) throw new RangeError("Invalid typed array length");
  39487. return (
  39488. a.TYPED_ARRAY_SUPPORT
  39489. ? ((e = new Uint8Array(t)), (e.__proto__ = a.prototype))
  39490. : (null === e && (e = new a(t)), (e.length = t)),
  39491. e
  39492. );
  39493. }
  39494. function a(e, t, i) {
  39495. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  39496. return new a(e, t, i);
  39497. if ("number" == typeof e) {
  39498. if ("string" == typeof t)
  39499. throw new Error(
  39500. "If encoding is specified then the first argument must be a string"
  39501. );
  39502. return h(this, e);
  39503. }
  39504. return s(this, e, t, i);
  39505. }
  39506. function s(e, t, i, n) {
  39507. if ("number" == typeof t)
  39508. throw new TypeError('"value" argument must not be a number');
  39509. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer
  39510. ? p(e, t, i, n)
  39511. : "string" == typeof t
  39512. ? u(e, t, i)
  39513. : f(e, t);
  39514. }
  39515. function l(e) {
  39516. if ("number" != typeof e)
  39517. throw new TypeError('"size" argument must be a number');
  39518. if (e < 0)
  39519. throw new RangeError('"size" argument must not be negative');
  39520. }
  39521. function c(e, t, i, n) {
  39522. return (
  39523. l(t),
  39524. t <= 0
  39525. ? o(e, t)
  39526. : void 0 !== i
  39527. ? "string" == typeof n
  39528. ? o(e, t).fill(i, n)
  39529. : o(e, t).fill(i)
  39530. : o(e, t)
  39531. );
  39532. }
  39533. function h(e, t) {
  39534. if (
  39535. (l(t), (e = o(e, t < 0 ? 0 : 0 | g(t))), !a.TYPED_ARRAY_SUPPORT)
  39536. )
  39537. for (var i = 0; i < t; ++i) e[i] = 0;
  39538. return e;
  39539. }
  39540. function u(e, t, i) {
  39541. if (
  39542. (("string" == typeof i && "" !== i) || (i = "utf8"),
  39543. !a.isEncoding(i))
  39544. )
  39545. throw new TypeError('"encoding" must be a valid string encoding');
  39546. var n = 0 | v(t, i);
  39547. e = o(e, n);
  39548. var r = e.write(t, i);
  39549. return r !== n && (e = e.slice(0, r)), e;
  39550. }
  39551. function d(e, t) {
  39552. var i = t.length < 0 ? 0 : 0 | g(t.length);
  39553. e = o(e, i);
  39554. for (var n = 0; n < i; n += 1) e[n] = 255 & t[n];
  39555. return e;
  39556. }
  39557. function p(e, t, i, n) {
  39558. if ((t.byteLength, i < 0 || t.byteLength < i))
  39559. throw new RangeError("'offset' is out of bounds");
  39560. if (t.byteLength < i + (n || 0))
  39561. throw new RangeError("'length' is out of bounds");
  39562. return (
  39563. (t =
  39564. void 0 === i && void 0 === n
  39565. ? new Uint8Array(t)
  39566. : void 0 === n
  39567. ? new Uint8Array(t, i)
  39568. : new Uint8Array(t, i, n)),
  39569. a.TYPED_ARRAY_SUPPORT
  39570. ? ((e = t), (e.__proto__ = a.prototype))
  39571. : (e = d(e, t)),
  39572. e
  39573. );
  39574. }
  39575. function f(e, t) {
  39576. if (a.isBuffer(t)) {
  39577. var i = 0 | g(t.length);
  39578. return (
  39579. (e = o(e, i)), 0 === e.length ? e : (t.copy(e, 0, 0, i), e)
  39580. );
  39581. }
  39582. if (t) {
  39583. if (
  39584. ("undefined" != typeof ArrayBuffer &&
  39585. t.buffer instanceof ArrayBuffer) ||
  39586. "length" in t
  39587. )
  39588. return "number" != typeof t.length || K(t.length)
  39589. ? o(e, 0)
  39590. : d(e, t);
  39591. if ("Buffer" === t.type && $(t.data)) return d(e, t.data);
  39592. }
  39593. throw new TypeError(
  39594. "First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object."
  39595. );
  39596. }
  39597. function g(e) {
  39598. if (e >= r())
  39599. throw new RangeError(
  39600. "Attempt to allocate Buffer larger than maximum size: 0x" +
  39601. r().toString(16) +
  39602. " bytes"
  39603. );
  39604. return 0 | e;
  39605. }
  39606. function m(e) {
  39607. return +e != e && (e = 0), a.alloc(+e);
  39608. }
  39609. function v(e, t) {
  39610. if (a.isBuffer(e)) return e.length;
  39611. if (
  39612. "undefined" != typeof ArrayBuffer &&
  39613. "function" == typeof ArrayBuffer.isView &&
  39614. (ArrayBuffer.isView(e) || e instanceof ArrayBuffer)
  39615. )
  39616. return e.byteLength;
  39617. "string" != typeof e && (e = "" + e);
  39618. var i = e.length;
  39619. if (0 === i) return 0;
  39620. for (var n = !1; ; )
  39621. switch (t) {
  39622. case "ascii":
  39623. case "latin1":
  39624. case "binary":
  39625. return i;
  39626. case "utf8":
  39627. case "utf-8":
  39628. case void 0:
  39629. return j(e).length;
  39630. case "ucs2":
  39631. case "ucs-2":
  39632. case "utf16le":
  39633. case "utf-16le":
  39634. return 2 * i;
  39635. case "hex":
  39636. return i >>> 1;
  39637. case "base64":
  39638. return Z(e).length;
  39639. default:
  39640. if (n) return j(e).length;
  39641. (t = ("" + t).toLowerCase()), (n = !0);
  39642. }
  39643. }
  39644. function A(e, t, i) {
  39645. var n = !1;
  39646. if (((void 0 === t || t < 0) && (t = 0), t > this.length))
  39647. return "";
  39648. if (
  39649. ((void 0 === i || i > this.length) && (i = this.length), i <= 0)
  39650. )
  39651. return "";
  39652. if (((i >>>= 0), (t >>>= 0), i <= t)) return "";
  39653. for (e || (e = "utf8"); ; )
  39654. switch (e) {
  39655. case "hex":
  39656. return L(this, t, i);
  39657. case "utf8":
  39658. case "utf-8":
  39659. return M(this, t, i);
  39660. case "ascii":
  39661. return P(this, t, i);
  39662. case "latin1":
  39663. case "binary":
  39664. return O(this, t, i);
  39665. case "base64":
  39666. return S(this, t, i);
  39667. case "ucs2":
  39668. case "ucs-2":
  39669. case "utf16le":
  39670. case "utf-16le":
  39671. return D(this, t, i);
  39672. default:
  39673. if (n) throw new TypeError("Unknown encoding: " + e);
  39674. (e = (e + "").toLowerCase()), (n = !0);
  39675. }
  39676. }
  39677. function y(e, t, i) {
  39678. var n = e[t];
  39679. (e[t] = e[i]), (e[i] = n);
  39680. }
  39681. function C(e, t, i, n, r) {
  39682. if (0 === e.length) return -1;
  39683. if (
  39684. ("string" == typeof i
  39685. ? ((n = i), (i = 0))
  39686. : i > 2147483647
  39687. ? (i = 2147483647)
  39688. : i < -2147483648 && (i = -2147483648),
  39689. (i = +i),
  39690. isNaN(i) && (i = r ? 0 : e.length - 1),
  39691. i < 0 && (i = e.length + i),
  39692. i >= e.length)
  39693. ) {
  39694. if (r) return -1;
  39695. i = e.length - 1;
  39696. } else if (i < 0) {
  39697. if (!r) return -1;
  39698. i = 0;
  39699. }
  39700. if (("string" == typeof t && (t = a.from(t, n)), a.isBuffer(t)))
  39701. return 0 === t.length ? -1 : I(e, t, i, n, r);
  39702. if ("number" == typeof t)
  39703. return (
  39704. (t &= 255),
  39705. a.TYPED_ARRAY_SUPPORT &&
  39706. "function" == typeof Uint8Array.prototype.indexOf
  39707. ? r
  39708. ? Uint8Array.prototype.indexOf.call(e, t, i)
  39709. : Uint8Array.prototype.lastIndexOf.call(e, t, i)
  39710. : I(e, [t], i, n, r)
  39711. );
  39712. throw new TypeError("val must be string, number or Buffer");
  39713. }
  39714. function I(e, t, i, n, r) {
  39715. function o(e, t) {
  39716. return 1 === a ? e[t] : e.readUInt16BE(t * a);
  39717. }
  39718. var a = 1,
  39719. s = e.length,
  39720. l = t.length;
  39721. if (
  39722. void 0 !== n &&
  39723. ((n = String(n).toLowerCase()),
  39724. "ucs2" === n ||
  39725. "ucs-2" === n ||
  39726. "utf16le" === n ||
  39727. "utf-16le" === n)
  39728. ) {
  39729. if (e.length < 2 || t.length < 2) return -1;
  39730. (a = 2), (s /= 2), (l /= 2), (i /= 2);
  39731. }
  39732. var c;
  39733. if (r) {
  39734. var h = -1;
  39735. for (c = i; c < s; c++)
  39736. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  39737. if ((h === -1 && (h = c), c - h + 1 === l)) return h * a;
  39738. } else h !== -1 && (c -= c - h), (h = -1);
  39739. } else
  39740. for (i + l > s && (i = s - l), c = i; c >= 0; c--) {
  39741. for (var u = !0, d = 0; d < l; d++)
  39742. if (o(e, c + d) !== o(t, d)) {
  39743. u = !1;
  39744. break;
  39745. }
  39746. if (u) return c;
  39747. }
  39748. return -1;
  39749. }
  39750. function E(e, t, i, n) {
  39751. i = Number(i) || 0;
  39752. var r = e.length - i;
  39753. n ? ((n = Number(n)), n > r && (n = r)) : (n = r);
  39754. var o = t.length;
  39755. if (o % 2 !== 0) throw new TypeError("Invalid hex string");
  39756. n > o / 2 && (n = o / 2);
  39757. for (var a = 0; a < n; ++a) {
  39758. var s = parseInt(t.substr(2 * a, 2), 16);
  39759. if (isNaN(s)) return a;
  39760. e[i + a] = s;
  39761. }
  39762. return a;
  39763. }
  39764. function b(e, t, i, n) {
  39765. return q(j(t, e.length - i), e, i, n);
  39766. }
  39767. function w(e, t, i, n) {
  39768. return q(Y(t), e, i, n);
  39769. }
  39770. function _(e, t, i, n) {
  39771. return w(e, t, i, n);
  39772. }
  39773. function T(e, t, i, n) {
  39774. return q(Z(t), e, i, n);
  39775. }
  39776. function x(e, t, i, n) {
  39777. return q(X(t, e.length - i), e, i, n);
  39778. }
  39779. function S(e, t, i) {
  39780. return 0 === t && i === e.length
  39781. ? Q.fromByteArray(e)
  39782. : Q.fromByteArray(e.slice(t, i));
  39783. }
  39784. function M(e, t, i) {
  39785. i = Math.min(e.length, i);
  39786. for (var n = [], r = t; r < i; ) {
  39787. var o = e[r],
  39788. a = null,
  39789. s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  39790. if (r + s <= i) {
  39791. var l, c, h, u;
  39792. switch (s) {
  39793. case 1:
  39794. o < 128 && (a = o);
  39795. break;
  39796. case 2:
  39797. (l = e[r + 1]),
  39798. 128 === (192 & l) &&
  39799. ((u = ((31 & o) << 6) | (63 & l)), u > 127 && (a = u));
  39800. break;
  39801. case 3:
  39802. (l = e[r + 1]),
  39803. (c = e[r + 2]),
  39804. 128 === (192 & l) &&
  39805. 128 === (192 & c) &&
  39806. ((u = ((15 & o) << 12) | ((63 & l) << 6) | (63 & c)),
  39807. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  39808. break;
  39809. case 4:
  39810. (l = e[r + 1]),
  39811. (c = e[r + 2]),
  39812. (h = e[r + 3]),
  39813. 128 === (192 & l) &&
  39814. 128 === (192 & c) &&
  39815. 128 === (192 & h) &&
  39816. ((u =
  39817. ((15 & o) << 18) |
  39818. ((63 & l) << 12) |
  39819. ((63 & c) << 6) |
  39820. (63 & h)),
  39821. u > 65535 && u < 1114112 && (a = u));
  39822. }
  39823. }
  39824. null === a
  39825. ? ((a = 65533), (s = 1))
  39826. : a > 65535 &&
  39827. ((a -= 65536),
  39828. n.push(((a >>> 10) & 1023) | 55296),
  39829. (a = 56320 | (1023 & a))),
  39830. n.push(a),
  39831. (r += s);
  39832. }
  39833. return R(n);
  39834. }
  39835. function R(e) {
  39836. var t = e.length;
  39837. if (t <= ee) return String.fromCharCode.apply(String, e);
  39838. for (var i = "", n = 0; n < t; )
  39839. i += String.fromCharCode.apply(String, e.slice(n, (n += ee)));
  39840. return i;
  39841. }
  39842. function P(e, t, i) {
  39843. var n = "";
  39844. i = Math.min(e.length, i);
  39845. for (var r = t; r < i; ++r) n += String.fromCharCode(127 & e[r]);
  39846. return n;
  39847. }
  39848. function O(e, t, i) {
  39849. var n = "";
  39850. i = Math.min(e.length, i);
  39851. for (var r = t; r < i; ++r) n += String.fromCharCode(e[r]);
  39852. return n;
  39853. }
  39854. function L(e, t, i) {
  39855. var n = e.length;
  39856. (!t || t < 0) && (t = 0), (!i || i < 0 || i > n) && (i = n);
  39857. for (var r = "", o = t; o < i; ++o) r += W(e[o]);
  39858. return r;
  39859. }
  39860. function D(e, t, i) {
  39861. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  39862. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  39863. return r;
  39864. }
  39865. function N(e, t, i) {
  39866. if (e % 1 !== 0 || e < 0)
  39867. throw new RangeError("offset is not uint");
  39868. if (e + t > i)
  39869. throw new RangeError("Trying to access beyond buffer length");
  39870. }
  39871. function B(e, t, i, n, r, o) {
  39872. if (!a.isBuffer(e))
  39873. throw new TypeError(
  39874. '"buffer" argument must be a Buffer instance'
  39875. );
  39876. if (t > r || t < o)
  39877. throw new RangeError('"value" argument is out of bounds');
  39878. if (i + n > e.length) throw new RangeError("Index out of range");
  39879. }
  39880. function F(e, t, i, n) {
  39881. t < 0 && (t = 65535 + t + 1);
  39882. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  39883. e[i + r] =
  39884. (t & (255 << (8 * (n ? r : 1 - r)))) >>> (8 * (n ? r : 1 - r));
  39885. }
  39886. function V(e, t, i, n) {
  39887. t < 0 && (t = 4294967295 + t + 1);
  39888. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  39889. e[i + r] = (t >>> (8 * (n ? r : 3 - r))) & 255;
  39890. }
  39891. function U(e, t, i, n, r, o) {
  39892. if (i + n > e.length) throw new RangeError("Index out of range");
  39893. if (i < 0) throw new RangeError("Index out of range");
  39894. }
  39895. function k(e, t, i, n, r) {
  39896. return (
  39897. r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  39898. J.write(e, t, i, n, 23, 4),
  39899. i + 4
  39900. );
  39901. }
  39902. function H(e, t, i, n, r) {
  39903. return (
  39904. r ||
  39905. U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  39906. J.write(e, t, i, n, 52, 8),
  39907. i + 8
  39908. );
  39909. }
  39910. function G(e) {
  39911. if (((e = z(e).replace(te, "")), e.length < 2)) return "";
  39912. for (; e.length % 4 !== 0; ) e += "=";
  39913. return e;
  39914. }
  39915. function z(e) {
  39916. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "");
  39917. }
  39918. function W(e) {
  39919. return e < 16 ? "0" + e.toString(16) : e.toString(16);
  39920. }
  39921. function j(e, t) {
  39922. t = t || 1 / 0;
  39923. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  39924. if (((i = e.charCodeAt(a)), i > 55295 && i < 57344)) {
  39925. if (!r) {
  39926. if (i > 56319) {
  39927. (t -= 3) > -1 && o.push(239, 191, 189);
  39928. continue;
  39929. }
  39930. if (a + 1 === n) {
  39931. (t -= 3) > -1 && o.push(239, 191, 189);
  39932. continue;
  39933. }
  39934. r = i;
  39935. continue;
  39936. }
  39937. if (i < 56320) {
  39938. (t -= 3) > -1 && o.push(239, 191, 189), (r = i);
  39939. continue;
  39940. }
  39941. i = (((r - 55296) << 10) | (i - 56320)) + 65536;
  39942. } else r && (t -= 3) > -1 && o.push(239, 191, 189);
  39943. if (((r = null), i < 128)) {
  39944. if ((t -= 1) < 0) break;
  39945. o.push(i);
  39946. } else if (i < 2048) {
  39947. if ((t -= 2) < 0) break;
  39948. o.push((i >> 6) | 192, (63 & i) | 128);
  39949. } else if (i < 65536) {
  39950. if ((t -= 3) < 0) break;
  39951. o.push((i >> 12) | 224, ((i >> 6) & 63) | 128, (63 & i) | 128);
  39952. } else {
  39953. if (!(i < 1114112)) throw new Error("Invalid code point");
  39954. if ((t -= 4) < 0) break;
  39955. o.push(
  39956. (i >> 18) | 240,
  39957. ((i >> 12) & 63) | 128,
  39958. ((i >> 6) & 63) | 128,
  39959. (63 & i) | 128
  39960. );
  39961. }
  39962. }
  39963. return o;
  39964. }
  39965. function Y(e) {
  39966. for (var t = [], i = 0; i < e.length; ++i)
  39967. t.push(255 & e.charCodeAt(i));
  39968. return t;
  39969. }
  39970. function X(e, t) {
  39971. for (
  39972. var i, n, r, o = [], a = 0;
  39973. a < e.length && !((t -= 2) < 0);
  39974. ++a
  39975. )
  39976. (i = e.charCodeAt(a)),
  39977. (n = i >> 8),
  39978. (r = i % 256),
  39979. o.push(r),
  39980. o.push(n);
  39981. return o;
  39982. }
  39983. function Z(e) {
  39984. return Q.toByteArray(G(e));
  39985. }
  39986. function q(e, t, i, n) {
  39987. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  39988. t[r + i] = e[r];
  39989. return r;
  39990. }
  39991. function K(e) {
  39992. return e !== e;
  39993. }
  39994. var Q = e("base64-js"),
  39995. J = e("ieee754"),
  39996. $ = e("isarray");
  39997. (i.Buffer = a),
  39998. (i.SlowBuffer = m),
  39999. (i.INSPECT_MAX_BYTES = 50),
  40000. (a.TYPED_ARRAY_SUPPORT =
  40001. void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n()),
  40002. (i.kMaxLength = r()),
  40003. (a.poolSize = 8192),
  40004. (a._augment = function (e) {
  40005. return (e.__proto__ = a.prototype), e;
  40006. }),
  40007. (a.from = function (e, t, i) {
  40008. return s(null, e, t, i);
  40009. }),
  40010. a.TYPED_ARRAY_SUPPORT &&
  40011. ((a.prototype.__proto__ = Uint8Array.prototype),
  40012. (a.__proto__ = Uint8Array),
  40013. "undefined" != typeof Symbol &&
  40014. Symbol.species &&
  40015. a[Symbol.species] === a &&
  40016. Object.defineProperty(a, Symbol.species, {
  40017. value: null,
  40018. configurable: !0,
  40019. })),
  40020. (a.alloc = function (e, t, i) {
  40021. return c(null, e, t, i);
  40022. }),
  40023. (a.allocUnsafe = function (e) {
  40024. return h(null, e);
  40025. }),
  40026. (a.allocUnsafeSlow = function (e) {
  40027. return h(null, e);
  40028. }),
  40029. (a.isBuffer = function (e) {
  40030. return !(null == e || !e._isBuffer);
  40031. }),
  40032. (a.compare = function (e, t) {
  40033. if (!a.isBuffer(e) || !a.isBuffer(t))
  40034. throw new TypeError("Arguments must be Buffers");
  40035. if (e === t) return 0;
  40036. for (
  40037. var i = e.length, n = t.length, r = 0, o = Math.min(i, n);
  40038. r < o;
  40039. ++r
  40040. )
  40041. if (e[r] !== t[r]) {
  40042. (i = e[r]), (n = t[r]);
  40043. break;
  40044. }
  40045. return i < n ? -1 : n < i ? 1 : 0;
  40046. }),
  40047. (a.isEncoding = function (e) {
  40048. switch (String(e).toLowerCase()) {
  40049. case "hex":
  40050. case "utf8":
  40051. case "utf-8":
  40052. case "ascii":
  40053. case "latin1":
  40054. case "binary":
  40055. case "base64":
  40056. case "ucs2":
  40057. case "ucs-2":
  40058. case "utf16le":
  40059. case "utf-16le":
  40060. return !0;
  40061. default:
  40062. return !1;
  40063. }
  40064. }),
  40065. (a.concat = function (e, t) {
  40066. if (!$(e))
  40067. throw new TypeError(
  40068. '"list" argument must be an Array of Buffers'
  40069. );
  40070. if (0 === e.length) return a.alloc(0);
  40071. var i;
  40072. if (void 0 === t)
  40073. for (t = 0, i = 0; i < e.length; ++i) t += e[i].length;
  40074. var n = a.allocUnsafe(t),
  40075. r = 0;
  40076. for (i = 0; i < e.length; ++i) {
  40077. var o = e[i];
  40078. if (!a.isBuffer(o))
  40079. throw new TypeError(
  40080. '"list" argument must be an Array of Buffers'
  40081. );
  40082. o.copy(n, r), (r += o.length);
  40083. }
  40084. return n;
  40085. }),
  40086. (a.byteLength = v),
  40087. (a.prototype._isBuffer = !0),
  40088. (a.prototype.swap16 = function () {
  40089. var e = this.length;
  40090. if (e % 2 !== 0)
  40091. throw new RangeError(
  40092. "Buffer size must be a multiple of 16-bits"
  40093. );
  40094. for (var t = 0; t < e; t += 2) y(this, t, t + 1);
  40095. return this;
  40096. }),
  40097. (a.prototype.swap32 = function () {
  40098. var e = this.length;
  40099. if (e % 4 !== 0)
  40100. throw new RangeError(
  40101. "Buffer size must be a multiple of 32-bits"
  40102. );
  40103. for (var t = 0; t < e; t += 4)
  40104. y(this, t, t + 3), y(this, t + 1, t + 2);
  40105. return this;
  40106. }),
  40107. (a.prototype.swap64 = function () {
  40108. var e = this.length;
  40109. if (e % 8 !== 0)
  40110. throw new RangeError(
  40111. "Buffer size must be a multiple of 64-bits"
  40112. );
  40113. for (var t = 0; t < e; t += 8)
  40114. y(this, t, t + 7),
  40115. y(this, t + 1, t + 6),
  40116. y(this, t + 2, t + 5),
  40117. y(this, t + 3, t + 4);
  40118. return this;
  40119. }),
  40120. (a.prototype.toString = function () {
  40121. var e = 0 | this.length;
  40122. return 0 === e
  40123. ? ""
  40124. : 0 === arguments.length
  40125. ? M(this, 0, e)
  40126. : A.apply(this, arguments);
  40127. }),
  40128. (a.prototype.equals = function (e) {
  40129. if (!a.isBuffer(e))
  40130. throw new TypeError("Argument must be a Buffer");
  40131. return this === e || 0 === a.compare(this, e);
  40132. }),
  40133. (a.prototype.inspect = function () {
  40134. var e = "",
  40135. t = i.INSPECT_MAX_BYTES;
  40136. return (
  40137. this.length > 0 &&
  40138. ((e = this.toString("hex", 0, t).match(/.{2}/g).join(" ")),
  40139. this.length > t && (e += " ... ")),
  40140. "<Buffer " + e + ">"
  40141. );
  40142. }),
  40143. (a.prototype.compare = function (e, t, i, n, r) {
  40144. if (!a.isBuffer(e))
  40145. throw new TypeError("Argument must be a Buffer");
  40146. if (
  40147. (void 0 === t && (t = 0),
  40148. void 0 === i && (i = e ? e.length : 0),
  40149. void 0 === n && (n = 0),
  40150. void 0 === r && (r = this.length),
  40151. t < 0 || i > e.length || n < 0 || r > this.length)
  40152. )
  40153. throw new RangeError("out of range index");
  40154. if (n >= r && t >= i) return 0;
  40155. if (n >= r) return -1;
  40156. if (t >= i) return 1;
  40157. if (((t >>>= 0), (i >>>= 0), (n >>>= 0), (r >>>= 0), this === e))
  40158. return 0;
  40159. for (
  40160. var o = r - n,
  40161. s = i - t,
  40162. l = Math.min(o, s),
  40163. c = this.slice(n, r),
  40164. h = e.slice(t, i),
  40165. u = 0;
  40166. u < l;
  40167. ++u
  40168. )
  40169. if (c[u] !== h[u]) {
  40170. (o = c[u]), (s = h[u]);
  40171. break;
  40172. }
  40173. return o < s ? -1 : s < o ? 1 : 0;
  40174. }),
  40175. (a.prototype.includes = function (e, t, i) {
  40176. return this.indexOf(e, t, i) !== -1;
  40177. }),
  40178. (a.prototype.indexOf = function (e, t, i) {
  40179. return C(this, e, t, i, !0);
  40180. }),
  40181. (a.prototype.lastIndexOf = function (e, t, i) {
  40182. return C(this, e, t, i, !1);
  40183. }),
  40184. (a.prototype.write = function (e, t, i, n) {
  40185. if (void 0 === t) (n = "utf8"), (i = this.length), (t = 0);
  40186. else if (void 0 === i && "string" == typeof t)
  40187. (n = t), (i = this.length), (t = 0);
  40188. else {
  40189. if (!isFinite(t))
  40190. throw new Error(
  40191. "Buffer.write(string, encoding, offset[, length]) is no longer supported"
  40192. );
  40193. (t |= 0),
  40194. isFinite(i)
  40195. ? ((i |= 0), void 0 === n && (n = "utf8"))
  40196. : ((n = i), (i = void 0));
  40197. }
  40198. var r = this.length - t;
  40199. if (
  40200. ((void 0 === i || i > r) && (i = r),
  40201. (e.length > 0 && (i < 0 || t < 0)) || t > this.length)
  40202. )
  40203. throw new RangeError("Attempt to write outside buffer bounds");
  40204. n || (n = "utf8");
  40205. for (var o = !1; ; )
  40206. switch (n) {
  40207. case "hex":
  40208. return E(this, e, t, i);
  40209. case "utf8":
  40210. case "utf-8":
  40211. return b(this, e, t, i);
  40212. case "ascii":
  40213. return w(this, e, t, i);
  40214. case "latin1":
  40215. case "binary":
  40216. return _(this, e, t, i);
  40217. case "base64":
  40218. return T(this, e, t, i);
  40219. case "ucs2":
  40220. case "ucs-2":
  40221. case "utf16le":
  40222. case "utf-16le":
  40223. return x(this, e, t, i);
  40224. default:
  40225. if (o) throw new TypeError("Unknown encoding: " + n);
  40226. (n = ("" + n).toLowerCase()), (o = !0);
  40227. }
  40228. }),
  40229. (a.prototype.toJSON = function () {
  40230. return {
  40231. type: "Buffer",
  40232. data: Array.prototype.slice.call(this._arr || this, 0),
  40233. };
  40234. });
  40235. var ee = 4096;
  40236. (a.prototype.slice = function (e, t) {
  40237. var i = this.length;
  40238. (e = ~~e),
  40239. (t = void 0 === t ? i : ~~t),
  40240. e < 0 ? ((e += i), e < 0 && (e = 0)) : e > i && (e = i),
  40241. t < 0 ? ((t += i), t < 0 && (t = 0)) : t > i && (t = i),
  40242. t < e && (t = e);
  40243. var n;
  40244. if (a.TYPED_ARRAY_SUPPORT)
  40245. (n = this.subarray(e, t)), (n.__proto__ = a.prototype);
  40246. else {
  40247. var r = t - e;
  40248. n = new a(r, void 0);
  40249. for (var o = 0; o < r; ++o) n[o] = this[o + e];
  40250. }
  40251. return n;
  40252. }),
  40253. (a.prototype.readUIntLE = function (e, t, i) {
  40254. (e |= 0), (t |= 0), i || N(e, t, this.length);
  40255. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  40256. n += this[e + o] * r;
  40257. return n;
  40258. }),
  40259. (a.prototype.readUIntBE = function (e, t, i) {
  40260. (e |= 0), (t |= 0), i || N(e, t, this.length);
  40261. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  40262. n += this[e + --t] * r;
  40263. return n;
  40264. }),
  40265. (a.prototype.readUInt8 = function (e, t) {
  40266. return t || N(e, 1, this.length), this[e];
  40267. }),
  40268. (a.prototype.readUInt16LE = function (e, t) {
  40269. return t || N(e, 2, this.length), this[e] | (this[e + 1] << 8);
  40270. }),
  40271. (a.prototype.readUInt16BE = function (e, t) {
  40272. return t || N(e, 2, this.length), (this[e] << 8) | this[e + 1];
  40273. }),
  40274. (a.prototype.readUInt32LE = function (e, t) {
  40275. return (
  40276. t || N(e, 4, this.length),
  40277. (this[e] | (this[e + 1] << 8) | (this[e + 2] << 16)) +
  40278. 16777216 * this[e + 3]
  40279. );
  40280. }),
  40281. (a.prototype.readUInt32BE = function (e, t) {
  40282. return (
  40283. t || N(e, 4, this.length),
  40284. 16777216 * this[e] +
  40285. ((this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3])
  40286. );
  40287. }),
  40288. (a.prototype.readIntLE = function (e, t, i) {
  40289. (e |= 0), (t |= 0), i || N(e, t, this.length);
  40290. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  40291. n += this[e + o] * r;
  40292. return (r *= 128), n >= r && (n -= Math.pow(2, 8 * t)), n;
  40293. }),
  40294. (a.prototype.readIntBE = function (e, t, i) {
  40295. (e |= 0), (t |= 0), i || N(e, t, this.length);
  40296. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  40297. o += this[e + --n] * r;
  40298. return (r *= 128), o >= r && (o -= Math.pow(2, 8 * t)), o;
  40299. }),
  40300. (a.prototype.readInt8 = function (e, t) {
  40301. return (
  40302. t || N(e, 1, this.length),
  40303. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  40304. );
  40305. }),
  40306. (a.prototype.readInt16LE = function (e, t) {
  40307. t || N(e, 2, this.length);
  40308. var i = this[e] | (this[e + 1] << 8);
  40309. return 32768 & i ? 4294901760 | i : i;
  40310. }),
  40311. (a.prototype.readInt16BE = function (e, t) {
  40312. t || N(e, 2, this.length);
  40313. var i = this[e + 1] | (this[e] << 8);
  40314. return 32768 & i ? 4294901760 | i : i;
  40315. }),
  40316. (a.prototype.readInt32LE = function (e, t) {
  40317. return (
  40318. t || N(e, 4, this.length),
  40319. this[e] |
  40320. (this[e + 1] << 8) |
  40321. (this[e + 2] << 16) |
  40322. (this[e + 3] << 24)
  40323. );
  40324. }),
  40325. (a.prototype.readInt32BE = function (e, t) {
  40326. return (
  40327. t || N(e, 4, this.length),
  40328. (this[e] << 24) |
  40329. (this[e + 1] << 16) |
  40330. (this[e + 2] << 8) |
  40331. this[e + 3]
  40332. );
  40333. }),
  40334. (a.prototype.readFloatLE = function (e, t) {
  40335. return t || N(e, 4, this.length), J.read(this, e, !0, 23, 4);
  40336. }),
  40337. (a.prototype.readFloatBE = function (e, t) {
  40338. return t || N(e, 4, this.length), J.read(this, e, !1, 23, 4);
  40339. }),
  40340. (a.prototype.readDoubleLE = function (e, t) {
  40341. return t || N(e, 8, this.length), J.read(this, e, !0, 52, 8);
  40342. }),
  40343. (a.prototype.readDoubleBE = function (e, t) {
  40344. return t || N(e, 8, this.length), J.read(this, e, !1, 52, 8);
  40345. }),
  40346. (a.prototype.writeUIntLE = function (e, t, i, n) {
  40347. if (((e = +e), (t |= 0), (i |= 0), !n)) {
  40348. var r = Math.pow(2, 8 * i) - 1;
  40349. B(this, e, t, i, r, 0);
  40350. }
  40351. var o = 1,
  40352. a = 0;
  40353. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  40354. this[t + a] = (e / o) & 255;
  40355. return t + i;
  40356. }),
  40357. (a.prototype.writeUIntBE = function (e, t, i, n) {
  40358. if (((e = +e), (t |= 0), (i |= 0), !n)) {
  40359. var r = Math.pow(2, 8 * i) - 1;
  40360. B(this, e, t, i, r, 0);
  40361. }
  40362. var o = i - 1,
  40363. a = 1;
  40364. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  40365. this[t + o] = (e / a) & 255;
  40366. return t + i;
  40367. }),
  40368. (a.prototype.writeUInt8 = function (e, t, i) {
  40369. return (
  40370. (e = +e),
  40371. (t |= 0),
  40372. i || B(this, e, t, 1, 255, 0),
  40373. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  40374. (this[t] = 255 & e),
  40375. t + 1
  40376. );
  40377. }),
  40378. (a.prototype.writeUInt16LE = function (e, t, i) {
  40379. return (
  40380. (e = +e),
  40381. (t |= 0),
  40382. i || B(this, e, t, 2, 65535, 0),
  40383. a.TYPED_ARRAY_SUPPORT
  40384. ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8))
  40385. : F(this, e, t, !0),
  40386. t + 2
  40387. );
  40388. }),
  40389. (a.prototype.writeUInt16BE = function (e, t, i) {
  40390. return (
  40391. (e = +e),
  40392. (t |= 0),
  40393. i || B(this, e, t, 2, 65535, 0),
  40394. a.TYPED_ARRAY_SUPPORT
  40395. ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e))
  40396. : F(this, e, t, !1),
  40397. t + 2
  40398. );
  40399. }),
  40400. (a.prototype.writeUInt32LE = function (e, t, i) {
  40401. return (
  40402. (e = +e),
  40403. (t |= 0),
  40404. i || B(this, e, t, 4, 4294967295, 0),
  40405. a.TYPED_ARRAY_SUPPORT
  40406. ? ((this[t + 3] = e >>> 24),
  40407. (this[t + 2] = e >>> 16),
  40408. (this[t + 1] = e >>> 8),
  40409. (this[t] = 255 & e))
  40410. : V(this, e, t, !0),
  40411. t + 4
  40412. );
  40413. }),
  40414. (a.prototype.writeUInt32BE = function (e, t, i) {
  40415. return (
  40416. (e = +e),
  40417. (t |= 0),
  40418. i || B(this, e, t, 4, 4294967295, 0),
  40419. a.TYPED_ARRAY_SUPPORT
  40420. ? ((this[t] = e >>> 24),
  40421. (this[t + 1] = e >>> 16),
  40422. (this[t + 2] = e >>> 8),
  40423. (this[t + 3] = 255 & e))
  40424. : V(this, e, t, !1),
  40425. t + 4
  40426. );
  40427. }),
  40428. (a.prototype.writeIntLE = function (e, t, i, n) {
  40429. if (((e = +e), (t |= 0), !n)) {
  40430. var r = Math.pow(2, 8 * i - 1);
  40431. B(this, e, t, i, r - 1, -r);
  40432. }
  40433. var o = 0,
  40434. a = 1,
  40435. s = 0;
  40436. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  40437. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  40438. (this[t + o] = (((e / a) >> 0) - s) & 255);
  40439. return t + i;
  40440. }),
  40441. (a.prototype.writeIntBE = function (e, t, i, n) {
  40442. if (((e = +e), (t |= 0), !n)) {
  40443. var r = Math.pow(2, 8 * i - 1);
  40444. B(this, e, t, i, r - 1, -r);
  40445. }
  40446. var o = i - 1,
  40447. a = 1,
  40448. s = 0;
  40449. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  40450. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  40451. (this[t + o] = (((e / a) >> 0) - s) & 255);
  40452. return t + i;
  40453. }),
  40454. (a.prototype.writeInt8 = function (e, t, i) {
  40455. return (
  40456. (e = +e),
  40457. (t |= 0),
  40458. i || B(this, e, t, 1, 127, -128),
  40459. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  40460. e < 0 && (e = 255 + e + 1),
  40461. (this[t] = 255 & e),
  40462. t + 1
  40463. );
  40464. }),
  40465. (a.prototype.writeInt16LE = function (e, t, i) {
  40466. return (
  40467. (e = +e),
  40468. (t |= 0),
  40469. i || B(this, e, t, 2, 32767, -32768),
  40470. a.TYPED_ARRAY_SUPPORT
  40471. ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8))
  40472. : F(this, e, t, !0),
  40473. t + 2
  40474. );
  40475. }),
  40476. (a.prototype.writeInt16BE = function (e, t, i) {
  40477. return (
  40478. (e = +e),
  40479. (t |= 0),
  40480. i || B(this, e, t, 2, 32767, -32768),
  40481. a.TYPED_ARRAY_SUPPORT
  40482. ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e))
  40483. : F(this, e, t, !1),
  40484. t + 2
  40485. );
  40486. }),
  40487. (a.prototype.writeInt32LE = function (e, t, i) {
  40488. return (
  40489. (e = +e),
  40490. (t |= 0),
  40491. i || B(this, e, t, 4, 2147483647, -2147483648),
  40492. a.TYPED_ARRAY_SUPPORT
  40493. ? ((this[t] = 255 & e),
  40494. (this[t + 1] = e >>> 8),
  40495. (this[t + 2] = e >>> 16),
  40496. (this[t + 3] = e >>> 24))
  40497. : V(this, e, t, !0),
  40498. t + 4
  40499. );
  40500. }),
  40501. (a.prototype.writeInt32BE = function (e, t, i) {
  40502. return (
  40503. (e = +e),
  40504. (t |= 0),
  40505. i || B(this, e, t, 4, 2147483647, -2147483648),
  40506. e < 0 && (e = 4294967295 + e + 1),
  40507. a.TYPED_ARRAY_SUPPORT
  40508. ? ((this[t] = e >>> 24),
  40509. (this[t + 1] = e >>> 16),
  40510. (this[t + 2] = e >>> 8),
  40511. (this[t + 3] = 255 & e))
  40512. : V(this, e, t, !1),
  40513. t + 4
  40514. );
  40515. }),
  40516. (a.prototype.writeFloatLE = function (e, t, i) {
  40517. return k(this, e, t, !0, i);
  40518. }),
  40519. (a.prototype.writeFloatBE = function (e, t, i) {
  40520. return k(this, e, t, !1, i);
  40521. }),
  40522. (a.prototype.writeDoubleLE = function (e, t, i) {
  40523. return H(this, e, t, !0, i);
  40524. }),
  40525. (a.prototype.writeDoubleBE = function (e, t, i) {
  40526. return H(this, e, t, !1, i);
  40527. }),
  40528. (a.prototype.copy = function (e, t, i, n) {
  40529. if (
  40530. (i || (i = 0),
  40531. n || 0 === n || (n = this.length),
  40532. t >= e.length && (t = e.length),
  40533. t || (t = 0),
  40534. n > 0 && n < i && (n = i),
  40535. n === i)
  40536. )
  40537. return 0;
  40538. if (0 === e.length || 0 === this.length) return 0;
  40539. if (t < 0) throw new RangeError("targetStart out of bounds");
  40540. if (i < 0 || i >= this.length)
  40541. throw new RangeError("sourceStart out of bounds");
  40542. if (n < 0) throw new RangeError("sourceEnd out of bounds");
  40543. n > this.length && (n = this.length),
  40544. e.length - t < n - i && (n = e.length - t + i);
  40545. var r,
  40546. o = n - i;
  40547. if (this === e && i < t && t < n)
  40548. for (r = o - 1; r >= 0; --r) e[r + t] = this[r + i];
  40549. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  40550. for (r = 0; r < o; ++r) e[r + t] = this[r + i];
  40551. else Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  40552. return o;
  40553. }),
  40554. (a.prototype.fill = function (e, t, i, n) {
  40555. if ("string" == typeof e) {
  40556. if (
  40557. ("string" == typeof t
  40558. ? ((n = t), (t = 0), (i = this.length))
  40559. : "string" == typeof i && ((n = i), (i = this.length)),
  40560. 1 === e.length)
  40561. ) {
  40562. var r = e.charCodeAt(0);
  40563. r < 256 && (e = r);
  40564. }
  40565. if (void 0 !== n && "string" != typeof n)
  40566. throw new TypeError("encoding must be a string");
  40567. if ("string" == typeof n && !a.isEncoding(n))
  40568. throw new TypeError("Unknown encoding: " + n);
  40569. } else "number" == typeof e && (e &= 255);
  40570. if (t < 0 || this.length < t || this.length < i)
  40571. throw new RangeError("Out of range index");
  40572. if (i <= t) return this;
  40573. (t >>>= 0),
  40574. (i = void 0 === i ? this.length : i >>> 0),
  40575. e || (e = 0);
  40576. var o;
  40577. if ("number" == typeof e) for (o = t; o < i; ++o) this[o] = e;
  40578. else {
  40579. var s = a.isBuffer(e) ? e : j(new a(e, n).toString()),
  40580. l = s.length;
  40581. for (o = 0; o < i - t; ++o) this[o + t] = s[o % l];
  40582. }
  40583. return this;
  40584. });
  40585. var te = /[^+\/0-9A-Za-z-_]/g;
  40586. }).call(
  40587. this,
  40588. "undefined" != typeof global
  40589. ? global
  40590. : "undefined" != typeof self
  40591. ? self
  40592. : "undefined" != typeof window
  40593. ? window
  40594. : {}
  40595. );
  40596. },
  40597. {
  40598. "base64-js": 199,
  40599. ieee754: 200,
  40600. isarray: 201,
  40601. },
  40602. ],
  40603. 199: [
  40604. function (e, t, i) {
  40605. "use strict";
  40606. function n(e) {
  40607. var t = e.length;
  40608. if (t % 4 > 0)
  40609. throw new Error("Invalid string. Length must be a multiple of 4");
  40610. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0;
  40611. }
  40612. function r(e) {
  40613. return (3 * e.length) / 4 - n(e);
  40614. }
  40615. function o(e) {
  40616. var t,
  40617. i,
  40618. r,
  40619. o,
  40620. a,
  40621. s,
  40622. l = e.length;
  40623. (a = n(e)), (s = new u((3 * l) / 4 - a)), (r = a > 0 ? l - 4 : l);
  40624. var c = 0;
  40625. for (t = 0, i = 0; t < r; t += 4, i += 3)
  40626. (o =
  40627. (h[e.charCodeAt(t)] << 18) |
  40628. (h[e.charCodeAt(t + 1)] << 12) |
  40629. (h[e.charCodeAt(t + 2)] << 6) |
  40630. h[e.charCodeAt(t + 3)]),
  40631. (s[c++] = (o >> 16) & 255),
  40632. (s[c++] = (o >> 8) & 255),
  40633. (s[c++] = 255 & o);
  40634. return (
  40635. 2 === a
  40636. ? ((o =
  40637. (h[e.charCodeAt(t)] << 2) | (h[e.charCodeAt(t + 1)] >> 4)),
  40638. (s[c++] = 255 & o))
  40639. : 1 === a &&
  40640. ((o =
  40641. (h[e.charCodeAt(t)] << 10) |
  40642. (h[e.charCodeAt(t + 1)] << 4) |
  40643. (h[e.charCodeAt(t + 2)] >> 2)),
  40644. (s[c++] = (o >> 8) & 255),
  40645. (s[c++] = 255 & o)),
  40646. s
  40647. );
  40648. }
  40649. function a(e) {
  40650. return (
  40651. c[(e >> 18) & 63] + c[(e >> 12) & 63] + c[(e >> 6) & 63] + c[63 & e]
  40652. );
  40653. }
  40654. function s(e, t, i) {
  40655. for (var n, r = [], o = t; o < i; o += 3)
  40656. (n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2]), r.push(a(n));
  40657. return r.join("");
  40658. }
  40659. function l(e) {
  40660. for (
  40661. var t,
  40662. i = e.length,
  40663. n = i % 3,
  40664. r = "",
  40665. o = [],
  40666. a = 16383,
  40667. l = 0,
  40668. h = i - n;
  40669. l < h;
  40670. l += a
  40671. )
  40672. o.push(s(e, l, l + a > h ? h : l + a));
  40673. return (
  40674. 1 === n
  40675. ? ((t = e[i - 1]),
  40676. (r += c[t >> 2]),
  40677. (r += c[(t << 4) & 63]),
  40678. (r += "=="))
  40679. : 2 === n &&
  40680. ((t = (e[i - 2] << 8) + e[i - 1]),
  40681. (r += c[t >> 10]),
  40682. (r += c[(t >> 4) & 63]),
  40683. (r += c[(t << 2) & 63]),
  40684. (r += "=")),
  40685. o.push(r),
  40686. o.join("")
  40687. );
  40688. }
  40689. (i.byteLength = r), (i.toByteArray = o), (i.fromByteArray = l);
  40690. for (
  40691. var c = [],
  40692. h = [],
  40693. u = "undefined" != typeof Uint8Array ? Uint8Array : Array,
  40694. d =
  40695. "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
  40696. p = 0,
  40697. f = d.length;
  40698. p < f;
  40699. ++p
  40700. )
  40701. (c[p] = d[p]), (h[d.charCodeAt(p)] = p);
  40702. (h["-".charCodeAt(0)] = 62), (h["_".charCodeAt(0)] = 63);
  40703. },
  40704. {},
  40705. ],
  40706. 200: [
  40707. function (e, t, i) {
  40708. (i.read = function (e, t, i, n, r) {
  40709. var o,
  40710. a,
  40711. s = 8 * r - n - 1,
  40712. l = (1 << s) - 1,
  40713. c = l >> 1,
  40714. h = -7,
  40715. u = i ? r - 1 : 0,
  40716. d = i ? -1 : 1,
  40717. p = e[t + u];
  40718. for (
  40719. u += d, o = p & ((1 << -h) - 1), p >>= -h, h += s;
  40720. h > 0;
  40721. o = 256 * o + e[t + u], u += d, h -= 8
  40722. );
  40723. for (
  40724. a = o & ((1 << -h) - 1), o >>= -h, h += n;
  40725. h > 0;
  40726. a = 256 * a + e[t + u], u += d, h -= 8
  40727. );
  40728. if (0 === o) o = 1 - c;
  40729. else {
  40730. if (o === l) return a ? NaN : (p ? -1 : 1) * (1 / 0);
  40731. (a += Math.pow(2, n)), (o -= c);
  40732. }
  40733. return (p ? -1 : 1) * a * Math.pow(2, o - n);
  40734. }),
  40735. (i.write = function (e, t, i, n, r, o) {
  40736. var a,
  40737. s,
  40738. l,
  40739. c = 8 * o - r - 1,
  40740. h = (1 << c) - 1,
  40741. u = h >> 1,
  40742. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  40743. p = n ? 0 : o - 1,
  40744. f = n ? 1 : -1,
  40745. g = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0;
  40746. for (
  40747. t = Math.abs(t),
  40748. isNaN(t) || t === 1 / 0
  40749. ? ((s = isNaN(t) ? 1 : 0), (a = h))
  40750. : ((a = Math.floor(Math.log(t) / Math.LN2)),
  40751. t * (l = Math.pow(2, -a)) < 1 && (a--, (l *= 2)),
  40752. (t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u)),
  40753. t * l >= 2 && (a++, (l /= 2)),
  40754. a + u >= h
  40755. ? ((s = 0), (a = h))
  40756. : a + u >= 1
  40757. ? ((s = (t * l - 1) * Math.pow(2, r)), (a += u))
  40758. : ((s = t * Math.pow(2, u - 1) * Math.pow(2, r)),
  40759. (a = 0)));
  40760. r >= 8;
  40761. e[i + p] = 255 & s, p += f, s /= 256, r -= 8
  40762. );
  40763. for (
  40764. a = (a << r) | s, c += r;
  40765. c > 0;
  40766. e[i + p] = 255 & a, p += f, a /= 256, c -= 8
  40767. );
  40768. e[i + p - f] |= 128 * g;
  40769. });
  40770. },
  40771. {},
  40772. ],
  40773. 201: [
  40774. function (e, t, i) {
  40775. var n = {}.toString;
  40776. t.exports =
  40777. Array.isArray ||
  40778. function (e) {
  40779. return "[object Array]" == n.call(e);
  40780. };
  40781. },
  40782. {},
  40783. ],
  40784. 202: [
  40785. function (e, t, i) {
  40786. function n() {
  40787. (this._events = this._events || {}),
  40788. (this._maxListeners = this._maxListeners || void 0);
  40789. }
  40790. function r(e) {
  40791. return "function" == typeof e;
  40792. }
  40793. function o(e) {
  40794. return "number" == typeof e;
  40795. }
  40796. function a(e) {
  40797. return "object" == typeof e && null !== e;
  40798. }
  40799. function s(e) {
  40800. return void 0 === e;
  40801. }
  40802. (t.exports = n),
  40803. (n.EventEmitter = n),
  40804. (n.prototype._events = void 0),
  40805. (n.prototype._maxListeners = void 0),
  40806. (n.defaultMaxListeners = 10),
  40807. (n.prototype.setMaxListeners = function (e) {
  40808. if (!o(e) || e < 0 || isNaN(e))
  40809. throw TypeError("n must be a positive number");
  40810. return (this._maxListeners = e), this;
  40811. }),
  40812. (n.prototype.emit = function (e) {
  40813. var t, i, n, o, l, c;
  40814. if (
  40815. (this._events || (this._events = {}),
  40816. "error" === e &&
  40817. (!this._events.error ||
  40818. (a(this._events.error) && !this._events.error.length)))
  40819. ) {
  40820. if (((t = arguments[1]), t instanceof Error)) throw t;
  40821. var h = new Error(
  40822. 'Uncaught, unspecified "error" event. (' + t + ")"
  40823. );
  40824. throw ((h.context = t), h);
  40825. }
  40826. if (((i = this._events[e]), s(i))) return !1;
  40827. if (r(i))
  40828. switch (arguments.length) {
  40829. case 1:
  40830. i.call(this);
  40831. break;
  40832. case 2:
  40833. i.call(this, arguments[1]);
  40834. break;
  40835. case 3:
  40836. i.call(this, arguments[1], arguments[2]);
  40837. break;
  40838. default:
  40839. (o = Array.prototype.slice.call(arguments, 1)),
  40840. i.apply(this, o);
  40841. }
  40842. else if (a(i))
  40843. for (
  40844. o = Array.prototype.slice.call(arguments, 1),
  40845. c = i.slice(),
  40846. n = c.length,
  40847. l = 0;
  40848. l < n;
  40849. l++
  40850. )
  40851. c[l].apply(this, o);
  40852. return !0;
  40853. }),
  40854. (n.prototype.addListener = function (e, t) {
  40855. var i;
  40856. if (!r(t)) throw TypeError("listener must be a function");
  40857. return (
  40858. this._events || (this._events = {}),
  40859. this._events.newListener &&
  40860. this.emit("newListener", e, r(t.listener) ? t.listener : t),
  40861. this._events[e]
  40862. ? a(this._events[e])
  40863. ? this._events[e].push(t)
  40864. : (this._events[e] = [this._events[e], t])
  40865. : (this._events[e] = t),
  40866. a(this._events[e]) &&
  40867. !this._events[e].warned &&
  40868. ((i = s(this._maxListeners)
  40869. ? n.defaultMaxListeners
  40870. : this._maxListeners),
  40871. i &&
  40872. i > 0 &&
  40873. this._events[e].length > i &&
  40874. ((this._events[e].warned = !0),
  40875. console.error(
  40876. "(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",
  40877. this._events[e].length
  40878. ),
  40879. "function" == typeof console.trace && console.trace())),
  40880. this
  40881. );
  40882. }),
  40883. (n.prototype.on = n.prototype.addListener),
  40884. (n.prototype.once = function (e, t) {
  40885. function i() {
  40886. this.removeListener(e, i),
  40887. n || ((n = !0), t.apply(this, arguments));
  40888. }
  40889. if (!r(t)) throw TypeError("listener must be a function");
  40890. var n = !1;
  40891. return (i.listener = t), this.on(e, i), this;
  40892. }),
  40893. (n.prototype.removeListener = function (e, t) {
  40894. var i, n, o, s;
  40895. if (!r(t)) throw TypeError("listener must be a function");
  40896. if (!this._events || !this._events[e]) return this;
  40897. if (
  40898. ((i = this._events[e]),
  40899. (o = i.length),
  40900. (n = -1),
  40901. i === t || (r(i.listener) && i.listener === t))
  40902. )
  40903. delete this._events[e],
  40904. this._events.removeListener &&
  40905. this.emit("removeListener", e, t);
  40906. else if (a(i)) {
  40907. for (s = o; s-- > 0; )
  40908. if (i[s] === t || (i[s].listener && i[s].listener === t)) {
  40909. n = s;
  40910. break;
  40911. }
  40912. if (n < 0) return this;
  40913. 1 === i.length
  40914. ? ((i.length = 0), delete this._events[e])
  40915. : i.splice(n, 1),
  40916. this._events.removeListener &&
  40917. this.emit("removeListener", e, t);
  40918. }
  40919. return this;
  40920. }),
  40921. (n.prototype.removeAllListeners = function (e) {
  40922. var t, i;
  40923. if (!this._events) return this;
  40924. if (!this._events.removeListener)
  40925. return (
  40926. 0 === arguments.length
  40927. ? (this._events = {})
  40928. : this._events[e] && delete this._events[e],
  40929. this
  40930. );
  40931. if (0 === arguments.length) {
  40932. for (t in this._events)
  40933. "removeListener" !== t && this.removeAllListeners(t);
  40934. return (
  40935. this.removeAllListeners("removeListener"),
  40936. (this._events = {}),
  40937. this
  40938. );
  40939. }
  40940. if (((i = this._events[e]), r(i))) this.removeListener(e, i);
  40941. else if (i)
  40942. for (; i.length; ) this.removeListener(e, i[i.length - 1]);
  40943. return delete this._events[e], this;
  40944. }),
  40945. (n.prototype.listeners = function (e) {
  40946. var t;
  40947. return (t =
  40948. this._events && this._events[e]
  40949. ? r(this._events[e])
  40950. ? [this._events[e]]
  40951. : this._events[e].slice()
  40952. : []);
  40953. }),
  40954. (n.prototype.listenerCount = function (e) {
  40955. if (this._events) {
  40956. var t = this._events[e];
  40957. if (r(t)) return 1;
  40958. if (t) return t.length;
  40959. }
  40960. return 0;
  40961. }),
  40962. (n.listenerCount = function (e, t) {
  40963. return e.listenerCount(t);
  40964. });
  40965. },
  40966. {},
  40967. ],
  40968. 203: [
  40969. function (e, t, i) {
  40970. function n() {
  40971. throw new Error("setTimeout has not been defined");
  40972. }
  40973. function r() {
  40974. throw new Error("clearTimeout has not been defined");
  40975. }
  40976. function o(e) {
  40977. if (u === setTimeout) return setTimeout(e, 0);
  40978. if ((u === n || !u) && setTimeout)
  40979. return (u = setTimeout), setTimeout(e, 0);
  40980. try {
  40981. return u(e, 0);
  40982. } catch (t) {
  40983. try {
  40984. return u.call(null, e, 0);
  40985. } catch (t) {
  40986. return u.call(this, e, 0);
  40987. }
  40988. }
  40989. }
  40990. function a(e) {
  40991. if (d === clearTimeout) return clearTimeout(e);
  40992. if ((d === r || !d) && clearTimeout)
  40993. return (d = clearTimeout), clearTimeout(e);
  40994. try {
  40995. return d(e);
  40996. } catch (t) {
  40997. try {
  40998. return d.call(null, e);
  40999. } catch (t) {
  41000. return d.call(this, e);
  41001. }
  41002. }
  41003. }
  41004. function s() {
  41005. m &&
  41006. f &&
  41007. ((m = !1),
  41008. f.length ? (g = f.concat(g)) : (v = -1),
  41009. g.length && l());
  41010. }
  41011. function l() {
  41012. if (!m) {
  41013. var e = o(s);
  41014. m = !0;
  41015. for (var t = g.length; t; ) {
  41016. for (f = g, g = []; ++v < t; ) f && f[v].run();
  41017. (v = -1), (t = g.length);
  41018. }
  41019. (f = null), (m = !1), a(e);
  41020. }
  41021. }
  41022. function c(e, t) {
  41023. (this.fun = e), (this.array = t);
  41024. }
  41025. function h() {}
  41026. var u,
  41027. d,
  41028. p = (t.exports = {});
  41029. !(function () {
  41030. try {
  41031. u = "function" == typeof setTimeout ? setTimeout : n;
  41032. } catch (e) {
  41033. u = n;
  41034. }
  41035. try {
  41036. d = "function" == typeof clearTimeout ? clearTimeout : r;
  41037. } catch (e) {
  41038. d = r;
  41039. }
  41040. })();
  41041. var f,
  41042. g = [],
  41043. m = !1,
  41044. v = -1;
  41045. (p.nextTick = function (e) {
  41046. var t = new Array(arguments.length - 1);
  41047. if (arguments.length > 1)
  41048. for (var i = 1; i < arguments.length; i++) t[i - 1] = arguments[i];
  41049. g.push(new c(e, t)), 1 !== g.length || m || o(l);
  41050. }),
  41051. (c.prototype.run = function () {
  41052. this.fun.apply(null, this.array);
  41053. }),
  41054. (p.title = "browser"),
  41055. (p.browser = !0),
  41056. (p.env = {}),
  41057. (p.argv = []),
  41058. (p.version = ""),
  41059. (p.versions = {}),
  41060. (p.on = h),
  41061. (p.addListener = h),
  41062. (p.once = h),
  41063. (p.off = h),
  41064. (p.removeListener = h),
  41065. (p.removeAllListeners = h),
  41066. (p.emit = h),
  41067. (p.binding = function (e) {
  41068. throw new Error("process.binding is not supported");
  41069. }),
  41070. (p.cwd = function () {
  41071. return "/";
  41072. }),
  41073. (p.chdir = function (e) {
  41074. throw new Error("process.chdir is not supported");
  41075. }),
  41076. (p.umask = function () {
  41077. return 0;
  41078. });
  41079. },
  41080. {},
  41081. ],
  41082. 204: [
  41083. function (e, t, i) {
  41084. (function (e) {
  41085. !(function (n) {
  41086. function r(e) {
  41087. throw new RangeError(L[e]);
  41088. }
  41089. function o(e, t) {
  41090. for (var i = e.length, n = []; i--; ) n[i] = t(e[i]);
  41091. return n;
  41092. }
  41093. function a(e, t) {
  41094. var i = e.split("@"),
  41095. n = "";
  41096. i.length > 1 && ((n = i[0] + "@"), (e = i[1])),
  41097. (e = e.replace(O, "."));
  41098. var r = e.split("."),
  41099. a = o(r, t).join(".");
  41100. return n + a;
  41101. }
  41102. function s(e) {
  41103. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  41104. (t = e.charCodeAt(r++)),
  41105. t >= 55296 && t <= 56319 && r < o
  41106. ? ((i = e.charCodeAt(r++)),
  41107. 56320 == (64512 & i)
  41108. ? n.push(((1023 & t) << 10) + (1023 & i) + 65536)
  41109. : (n.push(t), r--))
  41110. : n.push(t);
  41111. return n;
  41112. }
  41113. function l(e) {
  41114. return o(e, function (e) {
  41115. var t = "";
  41116. return (
  41117. e > 65535 &&
  41118. ((e -= 65536),
  41119. (t += B(((e >>> 10) & 1023) | 55296)),
  41120. (e = 56320 | (1023 & e))),
  41121. (t += B(e))
  41122. );
  41123. }).join("");
  41124. }
  41125. function c(e) {
  41126. return e - 48 < 10
  41127. ? e - 22
  41128. : e - 65 < 26
  41129. ? e - 65
  41130. : e - 97 < 26
  41131. ? e - 97
  41132. : E;
  41133. }
  41134. function h(e, t) {
  41135. return e + 22 + 75 * (e < 26) - ((0 != t) << 5);
  41136. }
  41137. function u(e, t, i) {
  41138. var n = 0;
  41139. for (
  41140. e = i ? N(e / T) : e >> 1, e += N(e / t);
  41141. e > (D * w) >> 1;
  41142. n += E
  41143. )
  41144. e = N(e / D);
  41145. return N(n + ((D + 1) * e) / (e + _));
  41146. }
  41147. function d(e) {
  41148. var t,
  41149. i,
  41150. n,
  41151. o,
  41152. a,
  41153. s,
  41154. h,
  41155. d,
  41156. p,
  41157. f,
  41158. g = [],
  41159. m = e.length,
  41160. v = 0,
  41161. A = S,
  41162. y = x;
  41163. for (i = e.lastIndexOf(M), i < 0 && (i = 0), n = 0; n < i; ++n)
  41164. e.charCodeAt(n) >= 128 && r("not-basic"),
  41165. g.push(e.charCodeAt(n));
  41166. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  41167. for (
  41168. a = v, s = 1, h = E;
  41169. o >= m && r("invalid-input"),
  41170. (d = c(e.charCodeAt(o++))),
  41171. (d >= E || d > N((I - v) / s)) && r("overflow"),
  41172. (v += d * s),
  41173. (p = h <= y ? b : h >= y + w ? w : h - y),
  41174. !(d < p);
  41175. h += E
  41176. )
  41177. (f = E - p), s > N(I / f) && r("overflow"), (s *= f);
  41178. (t = g.length + 1),
  41179. (y = u(v - a, t, 0 == a)),
  41180. N(v / t) > I - A && r("overflow"),
  41181. (A += N(v / t)),
  41182. (v %= t),
  41183. g.splice(v++, 0, A);
  41184. }
  41185. return l(g);
  41186. }
  41187. function p(e) {
  41188. var t,
  41189. i,
  41190. n,
  41191. o,
  41192. a,
  41193. l,
  41194. c,
  41195. d,
  41196. p,
  41197. f,
  41198. g,
  41199. m,
  41200. v,
  41201. A,
  41202. y,
  41203. C = [];
  41204. for (
  41205. e = s(e), m = e.length, t = S, i = 0, a = x, l = 0;
  41206. l < m;
  41207. ++l
  41208. )
  41209. (g = e[l]), g < 128 && C.push(B(g));
  41210. for (n = o = C.length, o && C.push(M); n < m; ) {
  41211. for (c = I, l = 0; l < m; ++l)
  41212. (g = e[l]), g >= t && g < c && (c = g);
  41213. for (
  41214. v = n + 1,
  41215. c - t > N((I - i) / v) && r("overflow"),
  41216. i += (c - t) * v,
  41217. t = c,
  41218. l = 0;
  41219. l < m;
  41220. ++l
  41221. )
  41222. if (((g = e[l]), g < t && ++i > I && r("overflow"), g == t)) {
  41223. for (
  41224. d = i, p = E;
  41225. (f = p <= a ? b : p >= a + w ? w : p - a), !(d < f);
  41226. p += E
  41227. )
  41228. (y = d - f),
  41229. (A = E - f),
  41230. C.push(B(h(f + (y % A), 0))),
  41231. (d = N(y / A));
  41232. C.push(B(h(d, 0))), (a = u(i, v, n == o)), (i = 0), ++n;
  41233. }
  41234. ++i, ++t;
  41235. }
  41236. return C.join("");
  41237. }
  41238. function f(e) {
  41239. return a(e, function (e) {
  41240. return R.test(e) ? d(e.slice(4).toLowerCase()) : e;
  41241. });
  41242. }
  41243. function g(e) {
  41244. return a(e, function (e) {
  41245. return P.test(e) ? "xn--" + p(e) : e;
  41246. });
  41247. }
  41248. var m = "object" == typeof i && i && !i.nodeType && i,
  41249. v = "object" == typeof t && t && !t.nodeType && t,
  41250. A = "object" == typeof e && e;
  41251. (A.global !== A && A.window !== A && A.self !== A) || (n = A);
  41252. var y,
  41253. C,
  41254. I = 2147483647,
  41255. E = 36,
  41256. b = 1,
  41257. w = 26,
  41258. _ = 38,
  41259. T = 700,
  41260. x = 72,
  41261. S = 128,
  41262. M = "-",
  41263. R = /^xn--/,
  41264. P = /[^\x20-\x7E]/,
  41265. O = /[\x2E\u3002\uFF0E\uFF61]/g,
  41266. L = {
  41267. overflow: "Overflow: input needs wider integers to process",
  41268. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  41269. "invalid-input": "Invalid input",
  41270. },
  41271. D = E - b,
  41272. N = Math.floor,
  41273. B = String.fromCharCode;
  41274. if (
  41275. ((y = {
  41276. version: "1.4.1",
  41277. ucs2: {
  41278. decode: s,
  41279. encode: l,
  41280. },
  41281. decode: d,
  41282. encode: p,
  41283. toASCII: g,
  41284. toUnicode: f,
  41285. }),
  41286. "function" == typeof define &&
  41287. "object" == typeof define.amd &&
  41288. define.amd)
  41289. )
  41290. define("punycode", function () {
  41291. return y;
  41292. });
  41293. else if (m && v)
  41294. if (t.exports == m) v.exports = y;
  41295. else for (C in y) y.hasOwnProperty(C) && (m[C] = y[C]);
  41296. else n.punycode = y;
  41297. })(this);
  41298. }).call(
  41299. this,
  41300. "undefined" != typeof global
  41301. ? global
  41302. : "undefined" != typeof self
  41303. ? self
  41304. : "undefined" != typeof window
  41305. ? window
  41306. : {}
  41307. );
  41308. },
  41309. {},
  41310. ],
  41311. 205: [
  41312. function (e, t, i) {
  41313. "use strict";
  41314. function n(e, t) {
  41315. return Object.prototype.hasOwnProperty.call(e, t);
  41316. }
  41317. t.exports = function (e, t, i, o) {
  41318. (t = t || "&"), (i = i || "=");
  41319. var a = {};
  41320. if ("string" != typeof e || 0 === e.length) return a;
  41321. var s = /\+/g;
  41322. e = e.split(t);
  41323. var l = 1e3;
  41324. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  41325. var c = e.length;
  41326. l > 0 && c > l && (c = l);
  41327. for (var h = 0; h < c; ++h) {
  41328. var u,
  41329. d,
  41330. p,
  41331. f,
  41332. g = e[h].replace(s, "%20"),
  41333. m = g.indexOf(i);
  41334. m >= 0
  41335. ? ((u = g.substr(0, m)), (d = g.substr(m + 1)))
  41336. : ((u = g), (d = "")),
  41337. (p = decodeURIComponent(u)),
  41338. (f = decodeURIComponent(d)),
  41339. n(a, p)
  41340. ? r(a[p])
  41341. ? a[p].push(f)
  41342. : (a[p] = [a[p], f])
  41343. : (a[p] = f);
  41344. }
  41345. return a;
  41346. };
  41347. var r =
  41348. Array.isArray ||
  41349. function (e) {
  41350. return "[object Array]" === Object.prototype.toString.call(e);
  41351. };
  41352. },
  41353. {},
  41354. ],
  41355. 206: [
  41356. function (e, t, i) {
  41357. "use strict";
  41358. function n(e, t) {
  41359. if (e.map) return e.map(t);
  41360. for (var i = [], n = 0; n < e.length; n++) i.push(t(e[n], n));
  41361. return i;
  41362. }
  41363. var r = function (e) {
  41364. switch (typeof e) {
  41365. case "string":
  41366. return e;
  41367. case "boolean":
  41368. return e ? "true" : "false";
  41369. case "number":
  41370. return isFinite(e) ? e : "";
  41371. default:
  41372. return "";
  41373. }
  41374. };
  41375. t.exports = function (e, t, i, s) {
  41376. return (
  41377. (t = t || "&"),
  41378. (i = i || "="),
  41379. null === e && (e = void 0),
  41380. "object" == typeof e
  41381. ? n(a(e), function (a) {
  41382. var s = encodeURIComponent(r(a)) + i;
  41383. return o(e[a])
  41384. ? n(e[a], function (e) {
  41385. return s + encodeURIComponent(r(e));
  41386. }).join(t)
  41387. : s + encodeURIComponent(r(e[a]));
  41388. }).join(t)
  41389. : s
  41390. ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e))
  41391. : ""
  41392. );
  41393. };
  41394. var o =
  41395. Array.isArray ||
  41396. function (e) {
  41397. return "[object Array]" === Object.prototype.toString.call(e);
  41398. },
  41399. a =
  41400. Object.keys ||
  41401. function (e) {
  41402. var t = [];
  41403. for (var i in e)
  41404. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  41405. return t;
  41406. };
  41407. },
  41408. {},
  41409. ],
  41410. 207: [
  41411. function (e, t, i) {
  41412. "use strict";
  41413. (i.decode = i.parse = e("./decode")),
  41414. (i.encode = i.stringify = e("./encode"));
  41415. },
  41416. {
  41417. "./decode": 205,
  41418. "./encode": 206,
  41419. },
  41420. ],
  41421. 208: [
  41422. function (e, t, i) {
  41423. "use strict";
  41424. function n() {
  41425. (this.protocol = null),
  41426. (this.slashes = null),
  41427. (this.auth = null),
  41428. (this.host = null),
  41429. (this.port = null),
  41430. (this.hostname = null),
  41431. (this.hash = null),
  41432. (this.search = null),
  41433. (this.query = null),
  41434. (this.pathname = null),
  41435. (this.path = null),
  41436. (this.href = null);
  41437. }
  41438. function r(e, t, i) {
  41439. if (e && c.isObject(e) && e instanceof n) return e;
  41440. var r = new n();
  41441. return r.parse(e, t, i), r;
  41442. }
  41443. function o(e) {
  41444. return (
  41445. c.isString(e) && (e = r(e)),
  41446. e instanceof n ? e.format() : n.prototype.format.call(e)
  41447. );
  41448. }
  41449. function a(e, t) {
  41450. return r(e, !1, !0).resolve(t);
  41451. }
  41452. function s(e, t) {
  41453. return e ? r(e, !1, !0).resolveObject(t) : t;
  41454. }
  41455. var l = e("punycode"),
  41456. c = e("./util");
  41457. (i.parse = r),
  41458. (i.resolve = a),
  41459. (i.resolveObject = s),
  41460. (i.format = o),
  41461. (i.Url = n);
  41462. var h = /^([a-z0-9.+-]+:)/i,
  41463. u = /:[0-9]*$/,
  41464. d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
  41465. p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"],
  41466. f = ["{", "}", "|", "\\", "^", "`"].concat(p),
  41467. g = ["'"].concat(f),
  41468. m = ["%", "/", "?", ";", "#"].concat(g),
  41469. v = ["/", "?", "#"],
  41470. A = 255,
  41471. y = /^[+a-z0-9A-Z_-]{0,63}$/,
  41472. C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
  41473. I = {
  41474. javascript: !0,
  41475. "javascript:": !0,
  41476. },
  41477. E = {
  41478. javascript: !0,
  41479. "javascript:": !0,
  41480. },
  41481. b = {
  41482. http: !0,
  41483. https: !0,
  41484. ftp: !0,
  41485. gopher: !0,
  41486. file: !0,
  41487. "http:": !0,
  41488. "https:": !0,
  41489. "ftp:": !0,
  41490. "gopher:": !0,
  41491. "file:": !0,
  41492. },
  41493. w = e("querystring");
  41494. (n.prototype.parse = function (e, t, i) {
  41495. if (!c.isString(e))
  41496. throw new TypeError(
  41497. "Parameter 'url' must be a string, not " + typeof e
  41498. );
  41499. var n = e.indexOf("?"),
  41500. r = n !== -1 && n < e.indexOf("#") ? "?" : "#",
  41501. o = e.split(r),
  41502. a = /\\/g;
  41503. (o[0] = o[0].replace(a, "/")), (e = o.join(r));
  41504. var s = e;
  41505. if (((s = s.trim()), !i && 1 === e.split("#").length)) {
  41506. var u = d.exec(s);
  41507. if (u)
  41508. return (
  41509. (this.path = s),
  41510. (this.href = s),
  41511. (this.pathname = u[1]),
  41512. u[2]
  41513. ? ((this.search = u[2]),
  41514. t
  41515. ? (this.query = w.parse(this.search.substr(1)))
  41516. : (this.query = this.search.substr(1)))
  41517. : t && ((this.search = ""), (this.query = {})),
  41518. this
  41519. );
  41520. }
  41521. var p = h.exec(s);
  41522. if (p) {
  41523. p = p[0];
  41524. var f = p.toLowerCase();
  41525. (this.protocol = f), (s = s.substr(p.length));
  41526. }
  41527. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  41528. var _ = "//" === s.substr(0, 2);
  41529. !_ || (p && E[p]) || ((s = s.substr(2)), (this.slashes = !0));
  41530. }
  41531. if (!E[p] && (_ || (p && !b[p]))) {
  41532. for (var T = -1, x = 0; x < v.length; x++) {
  41533. var S = s.indexOf(v[x]);
  41534. S !== -1 && (T === -1 || S < T) && (T = S);
  41535. }
  41536. var M, R;
  41537. (R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T)),
  41538. R !== -1 &&
  41539. ((M = s.slice(0, R)),
  41540. (s = s.slice(R + 1)),
  41541. (this.auth = decodeURIComponent(M))),
  41542. (T = -1);
  41543. for (var x = 0; x < m.length; x++) {
  41544. var S = s.indexOf(m[x]);
  41545. S !== -1 && (T === -1 || S < T) && (T = S);
  41546. }
  41547. T === -1 && (T = s.length),
  41548. (this.host = s.slice(0, T)),
  41549. (s = s.slice(T)),
  41550. this.parseHost(),
  41551. (this.hostname = this.hostname || "");
  41552. var P =
  41553. "[" === this.hostname[0] &&
  41554. "]" === this.hostname[this.hostname.length - 1];
  41555. if (!P)
  41556. for (
  41557. var O = this.hostname.split(/\./), x = 0, L = O.length;
  41558. x < L;
  41559. x++
  41560. ) {
  41561. var D = O[x];
  41562. if (D && !D.match(y)) {
  41563. for (var N = "", B = 0, F = D.length; B < F; B++)
  41564. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  41565. if (!N.match(y)) {
  41566. var V = O.slice(0, x),
  41567. U = O.slice(x + 1),
  41568. k = D.match(C);
  41569. k && (V.push(k[1]), U.unshift(k[2])),
  41570. U.length && (s = "/" + U.join(".") + s),
  41571. (this.hostname = V.join("."));
  41572. break;
  41573. }
  41574. }
  41575. }
  41576. this.hostname.length > A
  41577. ? (this.hostname = "")
  41578. : (this.hostname = this.hostname.toLowerCase()),
  41579. P || (this.hostname = l.toASCII(this.hostname));
  41580. var H = this.port ? ":" + this.port : "",
  41581. G = this.hostname || "";
  41582. (this.host = G + H),
  41583. (this.href += this.host),
  41584. P &&
  41585. ((this.hostname = this.hostname.substr(
  41586. 1,
  41587. this.hostname.length - 2
  41588. )),
  41589. "/" !== s[0] && (s = "/" + s));
  41590. }
  41591. if (!I[f])
  41592. for (var x = 0, L = g.length; x < L; x++) {
  41593. var z = g[x];
  41594. if (s.indexOf(z) !== -1) {
  41595. var W = encodeURIComponent(z);
  41596. W === z && (W = escape(z)), (s = s.split(z).join(W));
  41597. }
  41598. }
  41599. var j = s.indexOf("#");
  41600. j !== -1 && ((this.hash = s.substr(j)), (s = s.slice(0, j)));
  41601. var Y = s.indexOf("?");
  41602. if (
  41603. (Y !== -1
  41604. ? ((this.search = s.substr(Y)),
  41605. (this.query = s.substr(Y + 1)),
  41606. t && (this.query = w.parse(this.query)),
  41607. (s = s.slice(0, Y)))
  41608. : t && ((this.search = ""), (this.query = {})),
  41609. s && (this.pathname = s),
  41610. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  41611. this.pathname || this.search)
  41612. ) {
  41613. var H = this.pathname || "",
  41614. X = this.search || "";
  41615. this.path = H + X;
  41616. }
  41617. return (this.href = this.format()), this;
  41618. }),
  41619. (n.prototype.format = function () {
  41620. var e = this.auth || "";
  41621. e &&
  41622. ((e = encodeURIComponent(e)),
  41623. (e = e.replace(/%3A/i, ":")),
  41624. (e += "@"));
  41625. var t = this.protocol || "",
  41626. i = this.pathname || "",
  41627. n = this.hash || "",
  41628. r = !1,
  41629. o = "";
  41630. this.host
  41631. ? (r = e + this.host)
  41632. : this.hostname &&
  41633. ((r =
  41634. e +
  41635. (this.hostname.indexOf(":") === -1
  41636. ? this.hostname
  41637. : "[" + this.hostname + "]")),
  41638. this.port && (r += ":" + this.port)),
  41639. this.query &&
  41640. c.isObject(this.query) &&
  41641. Object.keys(this.query).length &&
  41642. (o = w.stringify(this.query));
  41643. var a = this.search || (o && "?" + o) || "";
  41644. return (
  41645. t && ":" !== t.substr(-1) && (t += ":"),
  41646. this.slashes || ((!t || b[t]) && r !== !1)
  41647. ? ((r = "//" + (r || "")),
  41648. i && "/" !== i.charAt(0) && (i = "/" + i))
  41649. : r || (r = ""),
  41650. n && "#" !== n.charAt(0) && (n = "#" + n),
  41651. a && "?" !== a.charAt(0) && (a = "?" + a),
  41652. (i = i.replace(/[?#]/g, function (e) {
  41653. return encodeURIComponent(e);
  41654. })),
  41655. (a = a.replace("#", "%23")),
  41656. t + r + i + a + n
  41657. );
  41658. }),
  41659. (n.prototype.resolve = function (e) {
  41660. return this.resolveObject(r(e, !1, !0)).format();
  41661. }),
  41662. (n.prototype.resolveObject = function (e) {
  41663. if (c.isString(e)) {
  41664. var t = new n();
  41665. t.parse(e, !1, !0), (e = t);
  41666. }
  41667. for (
  41668. var i = new n(), r = Object.keys(this), o = 0;
  41669. o < r.length;
  41670. o++
  41671. ) {
  41672. var a = r[o];
  41673. i[a] = this[a];
  41674. }
  41675. if (((i.hash = e.hash), "" === e.href))
  41676. return (i.href = i.format()), i;
  41677. if (e.slashes && !e.protocol) {
  41678. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  41679. var h = s[l];
  41680. "protocol" !== h && (i[h] = e[h]);
  41681. }
  41682. return (
  41683. b[i.protocol] &&
  41684. i.hostname &&
  41685. !i.pathname &&
  41686. (i.path = i.pathname = "/"),
  41687. (i.href = i.format()),
  41688. i
  41689. );
  41690. }
  41691. if (e.protocol && e.protocol !== i.protocol) {
  41692. if (!b[e.protocol]) {
  41693. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  41694. var p = u[d];
  41695. i[p] = e[p];
  41696. }
  41697. return (i.href = i.format()), i;
  41698. }
  41699. if (((i.protocol = e.protocol), e.host || E[e.protocol]))
  41700. i.pathname = e.pathname;
  41701. else {
  41702. for (
  41703. var f = (e.pathname || "").split("/");
  41704. f.length && !(e.host = f.shift());
  41705. );
  41706. e.host || (e.host = ""),
  41707. e.hostname || (e.hostname = ""),
  41708. "" !== f[0] && f.unshift(""),
  41709. f.length < 2 && f.unshift(""),
  41710. (i.pathname = f.join("/"));
  41711. }
  41712. if (
  41713. ((i.search = e.search),
  41714. (i.query = e.query),
  41715. (i.host = e.host || ""),
  41716. (i.auth = e.auth),
  41717. (i.hostname = e.hostname || e.host),
  41718. (i.port = e.port),
  41719. i.pathname || i.search)
  41720. ) {
  41721. var g = i.pathname || "",
  41722. m = i.search || "";
  41723. i.path = g + m;
  41724. }
  41725. return (
  41726. (i.slashes = i.slashes || e.slashes), (i.href = i.format()), i
  41727. );
  41728. }
  41729. var v = i.pathname && "/" === i.pathname.charAt(0),
  41730. A = e.host || (e.pathname && "/" === e.pathname.charAt(0)),
  41731. y = A || v || (i.host && e.pathname),
  41732. C = y,
  41733. I = (i.pathname && i.pathname.split("/")) || [],
  41734. f = (e.pathname && e.pathname.split("/")) || [],
  41735. w = i.protocol && !b[i.protocol];
  41736. if (
  41737. (w &&
  41738. ((i.hostname = ""),
  41739. (i.port = null),
  41740. i.host && ("" === I[0] ? (I[0] = i.host) : I.unshift(i.host)),
  41741. (i.host = ""),
  41742. e.protocol &&
  41743. ((e.hostname = null),
  41744. (e.port = null),
  41745. e.host && ("" === f[0] ? (f[0] = e.host) : f.unshift(e.host)),
  41746. (e.host = null)),
  41747. (y = y && ("" === f[0] || "" === I[0]))),
  41748. A)
  41749. )
  41750. (i.host = e.host || "" === e.host ? e.host : i.host),
  41751. (i.hostname =
  41752. e.hostname || "" === e.hostname ? e.hostname : i.hostname),
  41753. (i.search = e.search),
  41754. (i.query = e.query),
  41755. (I = f);
  41756. else if (f.length)
  41757. I || (I = []),
  41758. I.pop(),
  41759. (I = I.concat(f)),
  41760. (i.search = e.search),
  41761. (i.query = e.query);
  41762. else if (!c.isNullOrUndefined(e.search)) {
  41763. if (w) {
  41764. i.hostname = i.host = I.shift();
  41765. var _ =
  41766. !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  41767. _ && ((i.auth = _.shift()), (i.host = i.hostname = _.shift()));
  41768. }
  41769. return (
  41770. (i.search = e.search),
  41771. (i.query = e.query),
  41772. (c.isNull(i.pathname) && c.isNull(i.search)) ||
  41773. (i.path =
  41774. (i.pathname ? i.pathname : "") +
  41775. (i.search ? i.search : "")),
  41776. (i.href = i.format()),
  41777. i
  41778. );
  41779. }
  41780. if (!I.length)
  41781. return (
  41782. (i.pathname = null),
  41783. i.search ? (i.path = "/" + i.search) : (i.path = null),
  41784. (i.href = i.format()),
  41785. i
  41786. );
  41787. for (
  41788. var T = I.slice(-1)[0],
  41789. x =
  41790. ((i.host || e.host || I.length > 1) &&
  41791. ("." === T || ".." === T)) ||
  41792. "" === T,
  41793. S = 0,
  41794. M = I.length;
  41795. M >= 0;
  41796. M--
  41797. )
  41798. (T = I[M]),
  41799. "." === T
  41800. ? I.splice(M, 1)
  41801. : ".." === T
  41802. ? (I.splice(M, 1), S++)
  41803. : S && (I.splice(M, 1), S--);
  41804. if (!y && !C) for (; S--; S) I.unshift("..");
  41805. !y ||
  41806. "" === I[0] ||
  41807. (I[0] && "/" === I[0].charAt(0)) ||
  41808. I.unshift(""),
  41809. x && "/" !== I.join("/").substr(-1) && I.push("");
  41810. var R = "" === I[0] || (I[0] && "/" === I[0].charAt(0));
  41811. if (w) {
  41812. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  41813. var _ =
  41814. !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  41815. _ && ((i.auth = _.shift()), (i.host = i.hostname = _.shift()));
  41816. }
  41817. return (
  41818. (y = y || (i.host && I.length)),
  41819. y && !R && I.unshift(""),
  41820. I.length
  41821. ? (i.pathname = I.join("/"))
  41822. : ((i.pathname = null), (i.path = null)),
  41823. (c.isNull(i.pathname) && c.isNull(i.search)) ||
  41824. (i.path =
  41825. (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  41826. (i.auth = e.auth || i.auth),
  41827. (i.slashes = i.slashes || e.slashes),
  41828. (i.href = i.format()),
  41829. i
  41830. );
  41831. }),
  41832. (n.prototype.parseHost = function () {
  41833. var e = this.host,
  41834. t = u.exec(e);
  41835. t &&
  41836. ((t = t[0]),
  41837. ":" !== t && (this.port = t.substr(1)),
  41838. (e = e.substr(0, e.length - t.length))),
  41839. e && (this.hostname = e);
  41840. });
  41841. },
  41842. {
  41843. "./util": 209,
  41844. punycode: 204,
  41845. querystring: 207,
  41846. },
  41847. ],
  41848. 209: [
  41849. function (e, t, i) {
  41850. "use strict";
  41851. t.exports = {
  41852. isString: function (e) {
  41853. return "string" == typeof e;
  41854. },
  41855. isObject: function (e) {
  41856. return "object" == typeof e && null !== e;
  41857. },
  41858. isNull: function (e) {
  41859. return null === e;
  41860. },
  41861. isNullOrUndefined: function (e) {
  41862. return null == e;
  41863. },
  41864. };
  41865. },
  41866. {},
  41867. ],
  41868. 210: [
  41869. function (e, t, i) {
  41870. "use strict";
  41871. function n(e) {
  41872. return l + e;
  41873. }
  41874. function r(e) {
  41875. return e.substring(l.length);
  41876. }
  41877. function o(e, t) {
  41878. for (var i in t)
  41879. Object.defineProperty(e, i, {
  41880. value: t[i],
  41881. configurable: !0,
  41882. writable: !0,
  41883. });
  41884. }
  41885. function a(e) {
  41886. if ("string" != typeof e)
  41887. throw new TypeError("key must be a string.");
  41888. }
  41889. var s = Object.prototype.hasOwnProperty,
  41890. l = "~";
  41891. t.exports = function (e) {
  41892. var t = Object.create(null),
  41893. i = 0,
  41894. l = {};
  41895. return (
  41896. o(l, {
  41897. get: function (e, i) {
  41898. a(e);
  41899. var r = n(e);
  41900. return r in t ? t[r] : i;
  41901. },
  41902. set: function (e, r) {
  41903. a(e);
  41904. var o = n(e);
  41905. return o in t || ++i, (t[o] = r);
  41906. },
  41907. has: function (e) {
  41908. return a(e), n(e) in t;
  41909. },
  41910. delete: function (e) {
  41911. a(e);
  41912. var r = n(e);
  41913. return r in t && (--i, delete t[r], !0);
  41914. },
  41915. clear: function () {
  41916. (t = Object.create(null)), (i = 0);
  41917. },
  41918. forEach: function (e, i) {
  41919. if ("function" != typeof e)
  41920. throw new TypeError("`callback` must be a function");
  41921. for (var n in t)
  41922. if (s.call(t, n)) {
  41923. var o = r(n),
  41924. a = t[n];
  41925. e.call(i, a, o, l);
  41926. }
  41927. },
  41928. }),
  41929. Object.defineProperty(l, "size", {
  41930. get: function () {
  41931. return i;
  41932. },
  41933. configurable: !0,
  41934. }),
  41935. "object" == typeof e &&
  41936. null !== e &&
  41937. Object.keys(e).forEach(function (t) {
  41938. l.set(t, e[t]);
  41939. }),
  41940. l
  41941. );
  41942. };
  41943. },
  41944. {},
  41945. ],
  41946. 211: [
  41947. function (e, t, i) {
  41948. t.exports = e("./lib/heap");
  41949. },
  41950. {
  41951. "./lib/heap": 212,
  41952. },
  41953. ],
  41954. 212: [
  41955. function (e, t, i) {
  41956. (function () {
  41957. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  41958. (r = Math.floor),
  41959. (u = Math.min),
  41960. (n = function (e, t) {
  41961. return e < t ? -1 : e > t ? 1 : 0;
  41962. }),
  41963. (h = function (e, t, i, o, a) {
  41964. var s;
  41965. if ((null == i && (i = 0), null == a && (a = n), i < 0))
  41966. throw new Error("lo must be non-negative");
  41967. for (null == o && (o = e.length); i < o; )
  41968. (s = r((i + o) / 2)), a(t, e[s]) < 0 ? (o = s) : (i = s + 1);
  41969. return [].splice.apply(e, [i, i - i].concat(t)), t;
  41970. }),
  41971. (s = function (e, t, i) {
  41972. return null == i && (i = n), e.push(t), g(e, 0, e.length - 1, i);
  41973. }),
  41974. (a = function (e, t) {
  41975. var i, r;
  41976. return (
  41977. null == t && (t = n),
  41978. (i = e.pop()),
  41979. e.length ? ((r = e[0]), (e[0] = i), m(e, 0, t)) : (r = i),
  41980. r
  41981. );
  41982. }),
  41983. (c = function (e, t, i) {
  41984. var r;
  41985. return (
  41986. null == i && (i = n), (r = e[0]), (e[0] = t), m(e, 0, i), r
  41987. );
  41988. }),
  41989. (l = function (e, t, i) {
  41990. var r;
  41991. return (
  41992. null == i && (i = n),
  41993. e.length &&
  41994. i(e[0], t) < 0 &&
  41995. ((r = [e[0], t]), (t = r[0]), (e[0] = r[1]), m(e, 0, i)),
  41996. t
  41997. );
  41998. }),
  41999. (o = function (e, t) {
  42000. var i, o, a, s, l, c;
  42001. for (
  42002. null == t && (t = n),
  42003. s = function () {
  42004. c = [];
  42005. for (
  42006. var t = 0, i = r(e.length / 2);
  42007. 0 <= i ? t < i : t > i;
  42008. 0 <= i ? t++ : t--
  42009. )
  42010. c.push(t);
  42011. return c;
  42012. }
  42013. .apply(this)
  42014. .reverse(),
  42015. l = [],
  42016. o = 0,
  42017. a = s.length;
  42018. o < a;
  42019. o++
  42020. )
  42021. (i = s[o]), l.push(m(e, i, t));
  42022. return l;
  42023. }),
  42024. (f = function (e, t, i) {
  42025. var r;
  42026. if ((null == i && (i = n), (r = e.indexOf(t)), r !== -1))
  42027. return g(e, 0, r, i), m(e, r, i);
  42028. }),
  42029. (d = function (e, t, i) {
  42030. var r, a, s, c, h;
  42031. if ((null == i && (i = n), (a = e.slice(0, t)), !a.length))
  42032. return a;
  42033. for (o(a, i), h = e.slice(t), s = 0, c = h.length; s < c; s++)
  42034. (r = h[s]), l(a, r, i);
  42035. return a.sort(i).reverse();
  42036. }),
  42037. (p = function (e, t, i) {
  42038. var r, s, l, c, d, p, f, g, m, v;
  42039. if ((null == i && (i = n), 10 * t <= e.length)) {
  42040. if (((c = e.slice(0, t).sort(i)), !c.length)) return c;
  42041. for (
  42042. l = c[c.length - 1], g = e.slice(t), d = 0, f = g.length;
  42043. d < f;
  42044. d++
  42045. )
  42046. (r = g[d]),
  42047. i(r, l) < 0 &&
  42048. (h(c, r, 0, null, i), c.pop(), (l = c[c.length - 1]));
  42049. return c;
  42050. }
  42051. for (
  42052. o(e, i), v = [], s = p = 0, m = u(t, e.length);
  42053. 0 <= m ? p < m : p > m;
  42054. s = 0 <= m ? ++p : --p
  42055. )
  42056. v.push(a(e, i));
  42057. return v;
  42058. }),
  42059. (g = function (e, t, i, r) {
  42060. var o, a, s;
  42061. for (
  42062. null == r && (r = n), o = e[i];
  42063. i > t && ((s = (i - 1) >> 1), (a = e[s]), r(o, a) < 0);
  42064. )
  42065. (e[i] = a), (i = s);
  42066. return (e[i] = o);
  42067. }),
  42068. (m = function (e, t, i) {
  42069. var r, o, a, s, l;
  42070. for (
  42071. null == i && (i = n),
  42072. o = e.length,
  42073. l = t,
  42074. a = e[t],
  42075. r = 2 * t + 1;
  42076. r < o;
  42077. )
  42078. (s = r + 1),
  42079. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  42080. (e[t] = e[r]),
  42081. (t = r),
  42082. (r = 2 * t + 1);
  42083. return (e[t] = a), g(e, l, t, i);
  42084. }),
  42085. (e = (function () {
  42086. function e(e) {
  42087. (this.cmp = null != e ? e : n), (this.nodes = []);
  42088. }
  42089. return (
  42090. (e.push = s),
  42091. (e.pop = a),
  42092. (e.replace = c),
  42093. (e.pushpop = l),
  42094. (e.heapify = o),
  42095. (e.updateItem = f),
  42096. (e.nlargest = d),
  42097. (e.nsmallest = p),
  42098. (e.prototype.push = function (e) {
  42099. return s(this.nodes, e, this.cmp);
  42100. }),
  42101. (e.prototype.pop = function () {
  42102. return a(this.nodes, this.cmp);
  42103. }),
  42104. (e.prototype.peek = function () {
  42105. return this.nodes[0];
  42106. }),
  42107. (e.prototype.contains = function (e) {
  42108. return this.nodes.indexOf(e) !== -1;
  42109. }),
  42110. (e.prototype.replace = function (e) {
  42111. return c(this.nodes, e, this.cmp);
  42112. }),
  42113. (e.prototype.pushpop = function (e) {
  42114. return l(this.nodes, e, this.cmp);
  42115. }),
  42116. (e.prototype.heapify = function () {
  42117. return o(this.nodes, this.cmp);
  42118. }),
  42119. (e.prototype.updateItem = function (e) {
  42120. return f(this.nodes, e, this.cmp);
  42121. }),
  42122. (e.prototype.clear = function () {
  42123. return (this.nodes = []);
  42124. }),
  42125. (e.prototype.empty = function () {
  42126. return 0 === this.nodes.length;
  42127. }),
  42128. (e.prototype.size = function () {
  42129. return this.nodes.length;
  42130. }),
  42131. (e.prototype.clone = function () {
  42132. var t;
  42133. return (t = new e()), (t.nodes = this.nodes.slice(0)), t;
  42134. }),
  42135. (e.prototype.toArray = function () {
  42136. return this.nodes.slice(0);
  42137. }),
  42138. (e.prototype.insert = e.prototype.push),
  42139. (e.prototype.top = e.prototype.peek),
  42140. (e.prototype.front = e.prototype.peek),
  42141. (e.prototype.has = e.prototype.contains),
  42142. (e.prototype.copy = e.prototype.clone),
  42143. e
  42144. );
  42145. })()),
  42146. (function (e, n) {
  42147. return "function" == typeof define && define.amd
  42148. ? define([], n)
  42149. : "object" == typeof i
  42150. ? (t.exports = n())
  42151. : (e.Heap = n());
  42152. })(this, function () {
  42153. return e;
  42154. });
  42155. }).call(this);
  42156. },
  42157. {},
  42158. ],
  42159. 213: [
  42160. function (e, t, i) {
  42161. !(function (e) {
  42162. function i() {}
  42163. function n(e, t) {
  42164. return function () {
  42165. e.apply(t, arguments);
  42166. };
  42167. }
  42168. function r(e) {
  42169. if ("object" != typeof this)
  42170. throw new TypeError("Promises must be constructed via new");
  42171. if ("function" != typeof e) throw new TypeError("not a function");
  42172. (this._state = 0),
  42173. (this._handled = !1),
  42174. (this._value = void 0),
  42175. (this._deferreds = []),
  42176. h(e, this);
  42177. }
  42178. function o(e, t) {
  42179. for (; 3 === e._state; ) e = e._value;
  42180. return 0 === e._state
  42181. ? void e._deferreds.push(t)
  42182. : ((e._handled = !0),
  42183. void r._immediateFn(function () {
  42184. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  42185. if (null === i)
  42186. return void (1 === e._state ? a : s)(t.promise, e._value);
  42187. var n;
  42188. try {
  42189. n = i(e._value);
  42190. } catch (e) {
  42191. return void s(t.promise, e);
  42192. }
  42193. a(t.promise, n);
  42194. }));
  42195. }
  42196. function a(e, t) {
  42197. try {
  42198. if (t === e)
  42199. throw new TypeError(
  42200. "A promise cannot be resolved with itself."
  42201. );
  42202. if (t && ("object" == typeof t || "function" == typeof t)) {
  42203. var i = t.then;
  42204. if (t instanceof r)
  42205. return (e._state = 3), (e._value = t), void l(e);
  42206. if ("function" == typeof i) return void h(n(i, t), e);
  42207. }
  42208. (e._state = 1), (e._value = t), l(e);
  42209. } catch (t) {
  42210. s(e, t);
  42211. }
  42212. }
  42213. function s(e, t) {
  42214. (e._state = 2), (e._value = t), l(e);
  42215. }
  42216. function l(e) {
  42217. 2 === e._state &&
  42218. 0 === e._deferreds.length &&
  42219. r._immediateFn(function () {
  42220. e._handled || r._unhandledRejectionFn(e._value);
  42221. });
  42222. for (var t = 0, i = e._deferreds.length; t < i; t++)
  42223. o(e, e._deferreds[t]);
  42224. e._deferreds = null;
  42225. }
  42226. function c(e, t, i) {
  42227. (this.onFulfilled = "function" == typeof e ? e : null),
  42228. (this.onRejected = "function" == typeof t ? t : null),
  42229. (this.promise = i);
  42230. }
  42231. function h(e, t) {
  42232. var i = !1;
  42233. try {
  42234. e(
  42235. function (e) {
  42236. i || ((i = !0), a(t, e));
  42237. },
  42238. function (e) {
  42239. i || ((i = !0), s(t, e));
  42240. }
  42241. );
  42242. } catch (e) {
  42243. if (i) return;
  42244. (i = !0), s(t, e);
  42245. }
  42246. }
  42247. var u = setTimeout;
  42248. (r.prototype.catch = function (e) {
  42249. return this.then(null, e);
  42250. }),
  42251. (r.prototype.then = function (e, t) {
  42252. var n = new this.constructor(i);
  42253. return o(this, new c(e, t, n)), n;
  42254. }),
  42255. (r.all = function (e) {
  42256. var t = Array.prototype.slice.call(e);
  42257. return new r(function (e, i) {
  42258. function n(o, a) {
  42259. try {
  42260. if (a && ("object" == typeof a || "function" == typeof a)) {
  42261. var s = a.then;
  42262. if ("function" == typeof s)
  42263. return void s.call(
  42264. a,
  42265. function (e) {
  42266. n(o, e);
  42267. },
  42268. i
  42269. );
  42270. }
  42271. (t[o] = a), 0 === --r && e(t);
  42272. } catch (e) {
  42273. i(e);
  42274. }
  42275. }
  42276. if (0 === t.length) return e([]);
  42277. for (var r = t.length, o = 0; o < t.length; o++) n(o, t[o]);
  42278. });
  42279. }),
  42280. (r.resolve = function (e) {
  42281. return e && "object" == typeof e && e.constructor === r
  42282. ? e
  42283. : new r(function (t) {
  42284. t(e);
  42285. });
  42286. }),
  42287. (r.reject = function (e) {
  42288. return new r(function (t, i) {
  42289. i(e);
  42290. });
  42291. }),
  42292. (r.race = function (e) {
  42293. return new r(function (t, i) {
  42294. for (var n = 0, r = e.length; n < r; n++) e[n].then(t, i);
  42295. });
  42296. }),
  42297. (r._immediateFn =
  42298. ("function" == typeof setImmediate &&
  42299. function (e) {
  42300. setImmediate(e);
  42301. }) ||
  42302. function (e) {
  42303. u(e, 0);
  42304. }),
  42305. (r._unhandledRejectionFn = function (e) {
  42306. "undefined" != typeof console &&
  42307. console &&
  42308. console.warn("Possible Unhandled Promise Rejection:", e);
  42309. }),
  42310. (r._setImmediateFn = function (e) {
  42311. r._immediateFn = e;
  42312. }),
  42313. (r._setUnhandledRejectionFn = function (e) {
  42314. r._unhandledRejectionFn = e;
  42315. }),
  42316. "undefined" != typeof t && t.exports
  42317. ? (t.exports = r)
  42318. : e.Promise || (e.Promise = r);
  42319. })(this);
  42320. },
  42321. {},
  42322. ],
  42323. 214: [
  42324. function (e, t, i) {
  42325. (function (i) {
  42326. !(function (i, n) {
  42327. "function" == typeof define && define.amd
  42328. ? define(["bytebuffer"], n)
  42329. : "function" == typeof e && "object" == typeof t && t && t.exports
  42330. ? (t.exports = n(e("bytebuffer"), !0))
  42331. : ((i.dcodeIO = i.dcodeIO || {}).ProtoBuf = n(
  42332. i.dcodeIO.ByteBuffer
  42333. ));
  42334. })(this, function (t, n) {
  42335. "use strict";
  42336. var r = {};
  42337. return (
  42338. (r.ByteBuffer = t),
  42339. (r.Long = t.Long || null),
  42340. (r.VERSION = "5.0.1"),
  42341. (r.WIRE_TYPES = {}),
  42342. (r.WIRE_TYPES.VARINT = 0),
  42343. (r.WIRE_TYPES.BITS64 = 1),
  42344. (r.WIRE_TYPES.LDELIM = 2),
  42345. (r.WIRE_TYPES.STARTGROUP = 3),
  42346. (r.WIRE_TYPES.ENDGROUP = 4),
  42347. (r.WIRE_TYPES.BITS32 = 5),
  42348. (r.PACKABLE_WIRE_TYPES = [
  42349. r.WIRE_TYPES.VARINT,
  42350. r.WIRE_TYPES.BITS64,
  42351. r.WIRE_TYPES.BITS32,
  42352. ]),
  42353. (r.TYPES = {
  42354. int32: {
  42355. name: "int32",
  42356. wireType: r.WIRE_TYPES.VARINT,
  42357. defaultValue: 0,
  42358. },
  42359. uint32: {
  42360. name: "uint32",
  42361. wireType: r.WIRE_TYPES.VARINT,
  42362. defaultValue: 0,
  42363. },
  42364. sint32: {
  42365. name: "sint32",
  42366. wireType: r.WIRE_TYPES.VARINT,
  42367. defaultValue: 0,
  42368. },
  42369. int64: {
  42370. name: "int64",
  42371. wireType: r.WIRE_TYPES.VARINT,
  42372. defaultValue: r.Long ? r.Long.ZERO : void 0,
  42373. },
  42374. uint64: {
  42375. name: "uint64",
  42376. wireType: r.WIRE_TYPES.VARINT,
  42377. defaultValue: r.Long ? r.Long.UZERO : void 0,
  42378. },
  42379. sint64: {
  42380. name: "sint64",
  42381. wireType: r.WIRE_TYPES.VARINT,
  42382. defaultValue: r.Long ? r.Long.ZERO : void 0,
  42383. },
  42384. bool: {
  42385. name: "bool",
  42386. wireType: r.WIRE_TYPES.VARINT,
  42387. defaultValue: !1,
  42388. },
  42389. double: {
  42390. name: "double",
  42391. wireType: r.WIRE_TYPES.BITS64,
  42392. defaultValue: 0,
  42393. },
  42394. string: {
  42395. name: "string",
  42396. wireType: r.WIRE_TYPES.LDELIM,
  42397. defaultValue: "",
  42398. },
  42399. bytes: {
  42400. name: "bytes",
  42401. wireType: r.WIRE_TYPES.LDELIM,
  42402. defaultValue: null,
  42403. },
  42404. fixed32: {
  42405. name: "fixed32",
  42406. wireType: r.WIRE_TYPES.BITS32,
  42407. defaultValue: 0,
  42408. },
  42409. sfixed32: {
  42410. name: "sfixed32",
  42411. wireType: r.WIRE_TYPES.BITS32,
  42412. defaultValue: 0,
  42413. },
  42414. fixed64: {
  42415. name: "fixed64",
  42416. wireType: r.WIRE_TYPES.BITS64,
  42417. defaultValue: r.Long ? r.Long.UZERO : void 0,
  42418. },
  42419. sfixed64: {
  42420. name: "sfixed64",
  42421. wireType: r.WIRE_TYPES.BITS64,
  42422. defaultValue: r.Long ? r.Long.ZERO : void 0,
  42423. },
  42424. float: {
  42425. name: "float",
  42426. wireType: r.WIRE_TYPES.BITS32,
  42427. defaultValue: 0,
  42428. },
  42429. enum: {
  42430. name: "enum",
  42431. wireType: r.WIRE_TYPES.VARINT,
  42432. defaultValue: 0,
  42433. },
  42434. message: {
  42435. name: "message",
  42436. wireType: r.WIRE_TYPES.LDELIM,
  42437. defaultValue: null,
  42438. },
  42439. group: {
  42440. name: "group",
  42441. wireType: r.WIRE_TYPES.STARTGROUP,
  42442. defaultValue: null,
  42443. },
  42444. }),
  42445. (r.MAP_KEY_TYPES = [
  42446. r.TYPES.int32,
  42447. r.TYPES.sint32,
  42448. r.TYPES.sfixed32,
  42449. r.TYPES.uint32,
  42450. r.TYPES.fixed32,
  42451. r.TYPES.int64,
  42452. r.TYPES.sint64,
  42453. r.TYPES.sfixed64,
  42454. r.TYPES.uint64,
  42455. r.TYPES.fixed64,
  42456. r.TYPES.bool,
  42457. r.TYPES.string,
  42458. r.TYPES.bytes,
  42459. ]),
  42460. (r.ID_MIN = 1),
  42461. (r.ID_MAX = 536870911),
  42462. (r.convertFieldsToCamelCase = !1),
  42463. (r.populateAccessors = !0),
  42464. (r.populateDefaults = !0),
  42465. (r.Util = (function () {
  42466. var t = {};
  42467. return (
  42468. (t.IS_NODE = !(
  42469. "object" != typeof i ||
  42470. i + "" != "[object process]" ||
  42471. i.browser
  42472. )),
  42473. (t.XHR = function () {
  42474. for (
  42475. var e = [
  42476. function () {
  42477. return new XMLHttpRequest();
  42478. },
  42479. function () {
  42480. return new ActiveXObject("Msxml2.XMLHTTP");
  42481. },
  42482. function () {
  42483. return new ActiveXObject("Msxml3.XMLHTTP");
  42484. },
  42485. function () {
  42486. return new ActiveXObject("Microsoft.XMLHTTP");
  42487. },
  42488. ],
  42489. t = null,
  42490. i = 0;
  42491. i < e.length;
  42492. i++
  42493. ) {
  42494. try {
  42495. t = e[i]();
  42496. } catch (e) {
  42497. continue;
  42498. }
  42499. break;
  42500. }
  42501. if (!t) throw Error("XMLHttpRequest is not supported");
  42502. return t;
  42503. }),
  42504. (t.fetch = function (i, n) {
  42505. if (
  42506. (n && "function" != typeof n && (n = null), t.IS_NODE)
  42507. ) {
  42508. var r = e("fs");
  42509. if (n)
  42510. r.readFile(i, function (e, t) {
  42511. n(e ? null : "" + t);
  42512. });
  42513. else
  42514. try {
  42515. return r.readFileSync(i);
  42516. } catch (e) {
  42517. return null;
  42518. }
  42519. } else {
  42520. var o = t.XHR();
  42521. if (
  42522. (o.open("GET", i, !!n),
  42523. o.setRequestHeader("Accept", "text/plain"),
  42524. "function" == typeof o.overrideMimeType &&
  42525. o.overrideMimeType("text/plain"),
  42526. !n)
  42527. )
  42528. return (
  42529. o.send(null),
  42530. 200 == o.status ||
  42531. (0 == o.status && "string" == typeof o.responseText)
  42532. ? o.responseText
  42533. : null
  42534. );
  42535. if (
  42536. ((o.onreadystatechange = function () {
  42537. 4 == o.readyState &&
  42538. n(
  42539. 200 == o.status ||
  42540. (0 == o.status &&
  42541. "string" == typeof o.responseText)
  42542. ? o.responseText
  42543. : null
  42544. );
  42545. }),
  42546. 4 == o.readyState)
  42547. )
  42548. return;
  42549. o.send(null);
  42550. }
  42551. }),
  42552. (t.toCamelCase = function (e) {
  42553. return e.replace(/_([a-zA-Z])/g, function (e, t) {
  42554. return t.toUpperCase();
  42555. });
  42556. }),
  42557. t
  42558. );
  42559. })()),
  42560. (r.Lang = {
  42561. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  42562. RULE: /^(?:required|optional|repeated|map)$/,
  42563. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  42564. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  42565. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  42566. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  42567. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  42568. NUMBER:
  42569. /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  42570. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  42571. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  42572. NUMBER_OCT: /^0[0-7]+$/,
  42573. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  42574. BOOL: /^(?:true|false)$/i,
  42575. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  42576. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  42577. WHITESPACE: /\s/,
  42578. STRING:
  42579. /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  42580. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  42581. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  42582. }),
  42583. (r.DotProto = (function (e, t) {
  42584. function i(e, i) {
  42585. var n = -1,
  42586. r = 1;
  42587. if (
  42588. ("-" == e.charAt(0) && ((r = -1), (e = e.substring(1))),
  42589. t.NUMBER_DEC.test(e))
  42590. )
  42591. n = parseInt(e);
  42592. else if (t.NUMBER_HEX.test(e))
  42593. n = parseInt(e.substring(2), 16);
  42594. else {
  42595. if (!t.NUMBER_OCT.test(e))
  42596. throw Error(
  42597. "illegal id value: " + (r < 0 ? "-" : "") + e
  42598. );
  42599. n = parseInt(e.substring(1), 8);
  42600. }
  42601. if (((n = (r * n) | 0), !i && n < 0))
  42602. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  42603. return n;
  42604. }
  42605. function n(e) {
  42606. var i = 1;
  42607. if (
  42608. ("-" == e.charAt(0) && ((i = -1), (e = e.substring(1))),
  42609. t.NUMBER_DEC.test(e))
  42610. )
  42611. return i * parseInt(e, 10);
  42612. if (t.NUMBER_HEX.test(e))
  42613. return i * parseInt(e.substring(2), 16);
  42614. if (t.NUMBER_OCT.test(e))
  42615. return i * parseInt(e.substring(1), 8);
  42616. if ("inf" === e) return i * (1 / 0);
  42617. if ("nan" === e) return NaN;
  42618. if (t.NUMBER_FLT.test(e)) return i * parseFloat(e);
  42619. throw Error(
  42620. "illegal number value: " + (i < 0 ? "-" : "") + e
  42621. );
  42622. }
  42623. function r(e, t, i) {
  42624. "undefined" == typeof e[t]
  42625. ? (e[t] = i)
  42626. : (Array.isArray(e[t]) || (e[t] = [e[t]]), e[t].push(i));
  42627. }
  42628. var o = {},
  42629. a = function (e) {
  42630. (this.source = e + ""),
  42631. (this.index = 0),
  42632. (this.line = 1),
  42633. (this.stack = []),
  42634. (this._stringOpen = null);
  42635. },
  42636. s = a.prototype;
  42637. (s._readString = function () {
  42638. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  42639. e.lastIndex = this.index - 1;
  42640. var i = e.exec(this.source);
  42641. if (!i) throw Error("unterminated string");
  42642. return (
  42643. (this.index = e.lastIndex),
  42644. this.stack.push(this._stringOpen),
  42645. (this._stringOpen = null),
  42646. i[1]
  42647. );
  42648. }),
  42649. (s.next = function () {
  42650. if (this.stack.length > 0) return this.stack.shift();
  42651. if (this.index >= this.source.length) return null;
  42652. if (null !== this._stringOpen) return this._readString();
  42653. var e, i, n;
  42654. do {
  42655. for (
  42656. e = !1;
  42657. t.WHITESPACE.test((n = this.source.charAt(this.index)));
  42658. )
  42659. if (
  42660. ("\n" === n && ++this.line,
  42661. ++this.index === this.source.length)
  42662. )
  42663. return null;
  42664. if ("/" === this.source.charAt(this.index))
  42665. if (
  42666. (++this.index, "/" === this.source.charAt(this.index))
  42667. ) {
  42668. for (; "\n" !== this.source.charAt(++this.index); )
  42669. if (this.index == this.source.length) return null;
  42670. ++this.index, ++this.line, (e = !0);
  42671. } else {
  42672. if ("*" !== (n = this.source.charAt(this.index)))
  42673. return "/";
  42674. do {
  42675. if (
  42676. ("\n" === n && ++this.line,
  42677. ++this.index === this.source.length)
  42678. )
  42679. return null;
  42680. (i = n), (n = this.source.charAt(this.index));
  42681. } while ("*" !== i || "/" !== n);
  42682. ++this.index, (e = !0);
  42683. }
  42684. } while (e);
  42685. if (this.index === this.source.length) return null;
  42686. var r = this.index;
  42687. t.DELIM.lastIndex = 0;
  42688. var o = t.DELIM.test(this.source.charAt(r++));
  42689. if (!o)
  42690. for (
  42691. ;
  42692. r < this.source.length &&
  42693. !t.DELIM.test(this.source.charAt(r));
  42694. )
  42695. ++r;
  42696. var a = this.source.substring(this.index, (this.index = r));
  42697. return (
  42698. ('"' !== a && "'" !== a) || (this._stringOpen = a), a
  42699. );
  42700. }),
  42701. (s.peek = function () {
  42702. if (0 === this.stack.length) {
  42703. var e = this.next();
  42704. if (null === e) return null;
  42705. this.stack.push(e);
  42706. }
  42707. return this.stack[0];
  42708. }),
  42709. (s.skip = function (e) {
  42710. var t = this.next();
  42711. if (t !== e)
  42712. throw Error("illegal '" + t + "', '" + e + "' expected");
  42713. }),
  42714. (s.omit = function (e) {
  42715. return this.peek() === e && (this.next(), !0);
  42716. }),
  42717. (s.toString = function () {
  42718. return (
  42719. "Tokenizer (" +
  42720. this.index +
  42721. "/" +
  42722. this.source.length +
  42723. " at line " +
  42724. this.line +
  42725. ")"
  42726. );
  42727. }),
  42728. (o.Tokenizer = a);
  42729. var l = function (e) {
  42730. (this.tn = new a(e)), (this.proto3 = !1);
  42731. },
  42732. c = l.prototype;
  42733. return (
  42734. (c.parse = function () {
  42735. var e,
  42736. i,
  42737. n = {
  42738. name: "[ROOT]",
  42739. package: null,
  42740. messages: [],
  42741. enums: [],
  42742. imports: [],
  42743. options: {},
  42744. services: [],
  42745. },
  42746. r = !0;
  42747. try {
  42748. for (; (e = this.tn.next()); )
  42749. switch (e) {
  42750. case "package":
  42751. if (!r || null !== n.package)
  42752. throw Error("unexpected 'package'");
  42753. if (((e = this.tn.next()), !t.TYPEREF.test(e)))
  42754. throw Error("illegal package name: " + e);
  42755. this.tn.skip(";"), (n.package = e);
  42756. break;
  42757. case "import":
  42758. if (!r) throw Error("unexpected 'import'");
  42759. (e = this.tn.peek()),
  42760. ("public" === e || (i = "weak" === e)) &&
  42761. this.tn.next(),
  42762. (e = this._readString()),
  42763. this.tn.skip(";"),
  42764. i || n.imports.push(e);
  42765. break;
  42766. case "syntax":
  42767. if (!r) throw Error("unexpected 'syntax'");
  42768. this.tn.skip("="),
  42769. "proto3" === (n.syntax = this._readString()) &&
  42770. (this.proto3 = !0),
  42771. this.tn.skip(";");
  42772. break;
  42773. case "message":
  42774. this._parseMessage(n, null), (r = !1);
  42775. break;
  42776. case "enum":
  42777. this._parseEnum(n), (r = !1);
  42778. break;
  42779. case "option":
  42780. this._parseOption(n);
  42781. break;
  42782. case "service":
  42783. this._parseService(n);
  42784. break;
  42785. case "extend":
  42786. this._parseExtend(n);
  42787. break;
  42788. default:
  42789. throw Error("unexpected '" + e + "'");
  42790. }
  42791. } catch (e) {
  42792. throw (
  42793. ((e.message =
  42794. "Parse error at line " +
  42795. this.tn.line +
  42796. ": " +
  42797. e.message),
  42798. e)
  42799. );
  42800. }
  42801. return delete n.name, n;
  42802. }),
  42803. (l.parse = function (e) {
  42804. return new l(e).parse();
  42805. }),
  42806. (c._readString = function () {
  42807. var e,
  42808. t,
  42809. i = "";
  42810. do {
  42811. if (((t = this.tn.next()), "'" !== t && '"' !== t))
  42812. throw Error("illegal string delimiter: " + t);
  42813. (i += this.tn.next()),
  42814. this.tn.skip(t),
  42815. (e = this.tn.peek());
  42816. } while ('"' === e || '"' === e);
  42817. return i;
  42818. }),
  42819. (c._readValue = function (e) {
  42820. var i = this.tn.peek();
  42821. if ('"' === i || "'" === i) return this._readString();
  42822. if ((this.tn.next(), t.NUMBER.test(i))) return n(i);
  42823. if (t.BOOL.test(i)) return "true" === i.toLowerCase();
  42824. if (e && t.TYPEREF.test(i)) return i;
  42825. throw Error("illegal value: " + i);
  42826. }),
  42827. (c._parseOption = function (e, i) {
  42828. var n = this.tn.next(),
  42829. r = !1;
  42830. if (
  42831. ("(" === n && ((r = !0), (n = this.tn.next())),
  42832. !t.TYPEREF.test(n))
  42833. )
  42834. throw Error("illegal option name: " + n);
  42835. var o = n;
  42836. r &&
  42837. (this.tn.skip(")"),
  42838. (o = "(" + o + ")"),
  42839. (n = this.tn.peek()),
  42840. t.FQTYPEREF.test(n) && ((o += n), this.tn.next())),
  42841. this.tn.skip("="),
  42842. this._parseOptionValue(e, o),
  42843. i || this.tn.skip(";");
  42844. }),
  42845. (c._parseOptionValue = function (e, i) {
  42846. var n = this.tn.peek();
  42847. if ("{" !== n) r(e.options, i, this._readValue(!0));
  42848. else
  42849. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  42850. if (!t.NAME.test(n))
  42851. throw Error("illegal option name: " + i + "." + n);
  42852. this.tn.omit(":")
  42853. ? r(e.options, i + "." + n, this._readValue(!0))
  42854. : this._parseOptionValue(e, i + "." + n);
  42855. }
  42856. }),
  42857. (c._parseService = function (e) {
  42858. var i = this.tn.next();
  42859. if (!t.NAME.test(i))
  42860. throw Error(
  42861. "illegal service name at line " +
  42862. this.tn.line +
  42863. ": " +
  42864. i
  42865. );
  42866. var n = i,
  42867. r = {
  42868. name: n,
  42869. rpc: {},
  42870. options: {},
  42871. };
  42872. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  42873. if ("option" === i) this._parseOption(r);
  42874. else {
  42875. if ("rpc" !== i)
  42876. throw Error("illegal service token: " + i);
  42877. this._parseServiceRPC(r);
  42878. }
  42879. this.tn.omit(";"), e.services.push(r);
  42880. }),
  42881. (c._parseServiceRPC = function (e) {
  42882. var i = "rpc",
  42883. n = this.tn.next();
  42884. if (!t.NAME.test(n))
  42885. throw Error("illegal rpc service method name: " + n);
  42886. var r = n,
  42887. o = {
  42888. request: null,
  42889. response: null,
  42890. request_stream: !1,
  42891. response_stream: !1,
  42892. options: {},
  42893. };
  42894. if (
  42895. (this.tn.skip("("),
  42896. (n = this.tn.next()),
  42897. "stream" === n.toLowerCase() &&
  42898. ((o.request_stream = !0), (n = this.tn.next())),
  42899. !t.TYPEREF.test(n))
  42900. )
  42901. throw Error("illegal rpc service request type: " + n);
  42902. if (
  42903. ((o.request = n),
  42904. this.tn.skip(")"),
  42905. (n = this.tn.next()),
  42906. "returns" !== n.toLowerCase())
  42907. )
  42908. throw Error(
  42909. "illegal rpc service request type delimiter: " + n
  42910. );
  42911. if (
  42912. (this.tn.skip("("),
  42913. (n = this.tn.next()),
  42914. "stream" === n.toLowerCase() &&
  42915. ((o.response_stream = !0), (n = this.tn.next())),
  42916. (o.response = n),
  42917. this.tn.skip(")"),
  42918. (n = this.tn.peek()),
  42919. "{" === n)
  42920. ) {
  42921. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  42922. if ("option" !== n)
  42923. throw Error("illegal rpc service token: " + n);
  42924. this._parseOption(o);
  42925. }
  42926. this.tn.omit(";");
  42927. } else this.tn.skip(";");
  42928. "undefined" == typeof e[i] && (e[i] = {}), (e[i][r] = o);
  42929. }),
  42930. (c._parseMessage = function (e, n) {
  42931. var r = !!n,
  42932. o = this.tn.next(),
  42933. a = {
  42934. name: "",
  42935. fields: [],
  42936. enums: [],
  42937. messages: [],
  42938. options: {},
  42939. services: [],
  42940. oneofs: {},
  42941. };
  42942. if (!t.NAME.test(o))
  42943. throw Error(
  42944. "illegal " + (r ? "group" : "message") + " name: " + o
  42945. );
  42946. for (
  42947. a.name = o,
  42948. r &&
  42949. (this.tn.skip("="),
  42950. (n.id = i(this.tn.next())),
  42951. (a.isGroup = !0)),
  42952. o = this.tn.peek(),
  42953. "[" === o && n && this._parseFieldOptions(n),
  42954. this.tn.skip("{");
  42955. "}" !== (o = this.tn.next());
  42956. )
  42957. if (t.RULE.test(o)) this._parseMessageField(a, o);
  42958. else if ("oneof" === o) this._parseMessageOneOf(a);
  42959. else if ("enum" === o) this._parseEnum(a);
  42960. else if ("message" === o) this._parseMessage(a);
  42961. else if ("option" === o) this._parseOption(a);
  42962. else if ("service" === o) this._parseService(a);
  42963. else if ("extensions" === o)
  42964. a.extensions = this._parseExtensionRanges();
  42965. else if ("reserved" === o) this._parseIgnored();
  42966. else if ("extend" === o) this._parseExtend(a);
  42967. else {
  42968. if (!t.TYPEREF.test(o))
  42969. throw Error("illegal message token: " + o);
  42970. if (!this.proto3)
  42971. throw Error("illegal field rule: " + o);
  42972. this._parseMessageField(a, "optional", o);
  42973. }
  42974. return this.tn.omit(";"), e.messages.push(a), a;
  42975. }),
  42976. (c._parseIgnored = function () {
  42977. for (; ";" !== this.tn.peek(); ) this.tn.next();
  42978. this.tn.skip(";");
  42979. }),
  42980. (c._parseMessageField = function (e, n, r) {
  42981. if (!t.RULE.test(n))
  42982. throw Error("illegal message field rule: " + n);
  42983. var o,
  42984. a = {
  42985. rule: n,
  42986. type: "",
  42987. name: "",
  42988. options: {},
  42989. id: 0,
  42990. };
  42991. if ("map" === n) {
  42992. if (r) throw Error("illegal type: " + r);
  42993. if (
  42994. (this.tn.skip("<"),
  42995. (o = this.tn.next()),
  42996. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  42997. )
  42998. throw Error("illegal message field type: " + o);
  42999. if (
  43000. ((a.keytype = o),
  43001. this.tn.skip(","),
  43002. (o = this.tn.next()),
  43003. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  43004. )
  43005. throw Error("illegal message field: " + o);
  43006. if (
  43007. ((a.type = o),
  43008. this.tn.skip(">"),
  43009. (o = this.tn.next()),
  43010. !t.NAME.test(o))
  43011. )
  43012. throw Error("illegal message field name: " + o);
  43013. (a.name = o),
  43014. this.tn.skip("="),
  43015. (a.id = i(this.tn.next())),
  43016. (o = this.tn.peek()),
  43017. "[" === o && this._parseFieldOptions(a),
  43018. this.tn.skip(";");
  43019. } else if (
  43020. ((r = "undefined" != typeof r ? r : this.tn.next()),
  43021. "group" === r)
  43022. ) {
  43023. var s = this._parseMessage(e, a);
  43024. if (!/^[A-Z]/.test(s.name))
  43025. throw Error("illegal group name: " + s.name);
  43026. (a.type = s.name),
  43027. (a.name = s.name.toLowerCase()),
  43028. this.tn.omit(";");
  43029. } else {
  43030. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  43031. throw Error("illegal message field type: " + r);
  43032. if (((a.type = r), (o = this.tn.next()), !t.NAME.test(o)))
  43033. throw Error("illegal message field name: " + o);
  43034. (a.name = o),
  43035. this.tn.skip("="),
  43036. (a.id = i(this.tn.next())),
  43037. (o = this.tn.peek()),
  43038. "[" === o && this._parseFieldOptions(a),
  43039. this.tn.skip(";");
  43040. }
  43041. return e.fields.push(a), a;
  43042. }),
  43043. (c._parseMessageOneOf = function (e) {
  43044. var i = this.tn.next();
  43045. if (!t.NAME.test(i))
  43046. throw Error("illegal oneof name: " + i);
  43047. var n,
  43048. r = i,
  43049. o = [];
  43050. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  43051. (n = this._parseMessageField(e, "optional", i)),
  43052. (n.oneof = r),
  43053. o.push(n.id);
  43054. this.tn.omit(";"), (e.oneofs[r] = o);
  43055. }),
  43056. (c._parseFieldOptions = function (e) {
  43057. this.tn.skip("[");
  43058. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  43059. i || this.tn.skip(","),
  43060. this._parseOption(e, !0),
  43061. (i = !1);
  43062. this.tn.next();
  43063. }),
  43064. (c._parseEnum = function (e) {
  43065. var n = {
  43066. name: "",
  43067. values: [],
  43068. options: {},
  43069. },
  43070. r = this.tn.next();
  43071. if (!t.NAME.test(r)) throw Error("illegal name: " + r);
  43072. for (
  43073. n.name = r, this.tn.skip("{");
  43074. "}" !== (r = this.tn.next());
  43075. )
  43076. if ("option" === r) this._parseOption(n);
  43077. else {
  43078. if (!t.NAME.test(r)) throw Error("illegal name: " + r);
  43079. this.tn.skip("=");
  43080. var o = {
  43081. name: r,
  43082. id: i(this.tn.next(), !0),
  43083. };
  43084. (r = this.tn.peek()),
  43085. "[" === r &&
  43086. this._parseFieldOptions({
  43087. options: {},
  43088. }),
  43089. this.tn.skip(";"),
  43090. n.values.push(o);
  43091. }
  43092. this.tn.omit(";"), e.enums.push(n);
  43093. }),
  43094. (c._parseExtensionRanges = function () {
  43095. var t,
  43096. i,
  43097. r,
  43098. o = [];
  43099. do {
  43100. for (i = []; ; ) {
  43101. switch ((t = this.tn.next())) {
  43102. case "min":
  43103. r = e.ID_MIN;
  43104. break;
  43105. case "max":
  43106. r = e.ID_MAX;
  43107. break;
  43108. default:
  43109. r = n(t);
  43110. }
  43111. if ((i.push(r), 2 === i.length)) break;
  43112. if ("to" !== this.tn.peek()) {
  43113. i.push(r);
  43114. break;
  43115. }
  43116. this.tn.next();
  43117. }
  43118. o.push(i);
  43119. } while (this.tn.omit(","));
  43120. return this.tn.skip(";"), o;
  43121. }),
  43122. (c._parseExtend = function (e) {
  43123. var i = this.tn.next();
  43124. if (!t.TYPEREF.test(i))
  43125. throw Error("illegal extend reference: " + i);
  43126. var n = {
  43127. ref: i,
  43128. fields: [],
  43129. };
  43130. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  43131. if (t.RULE.test(i)) this._parseMessageField(n, i);
  43132. else {
  43133. if (!t.TYPEREF.test(i))
  43134. throw Error("illegal extend token: " + i);
  43135. if (!this.proto3)
  43136. throw Error("illegal field rule: " + i);
  43137. this._parseMessageField(n, "optional", i);
  43138. }
  43139. return this.tn.omit(";"), e.messages.push(n), n;
  43140. }),
  43141. (c.toString = function () {
  43142. return "Parser at line " + this.tn.line;
  43143. }),
  43144. (o.Parser = l),
  43145. o
  43146. );
  43147. })(r, r.Lang)),
  43148. (r.Reflect = (function (e) {
  43149. function i(i) {
  43150. if (
  43151. ("string" == typeof i && (i = e.TYPES[i]),
  43152. "undefined" == typeof i.defaultValue)
  43153. )
  43154. throw Error(
  43155. "default value for type " + i.name + " is not supported"
  43156. );
  43157. return i == e.TYPES.bytes ? new t(0) : i.defaultValue;
  43158. }
  43159. function n(t, i) {
  43160. if (
  43161. t &&
  43162. "number" == typeof t.low &&
  43163. "number" == typeof t.high &&
  43164. "boolean" == typeof t.unsigned &&
  43165. t.low === t.low &&
  43166. t.high === t.high
  43167. )
  43168. return new e.Long(
  43169. t.low,
  43170. t.high,
  43171. "undefined" == typeof i ? t.unsigned : i
  43172. );
  43173. if ("string" == typeof t)
  43174. return e.Long.fromString(t, i || !1, 10);
  43175. if ("number" == typeof t)
  43176. return e.Long.fromNumber(t, i || !1);
  43177. throw Error("not convertible to Long");
  43178. }
  43179. function r(t, i) {
  43180. var n = i.readVarint32(),
  43181. o = 7 & n,
  43182. a = n >>> 3;
  43183. switch (o) {
  43184. case e.WIRE_TYPES.VARINT:
  43185. do n = i.readUint8();
  43186. while (128 === (128 & n));
  43187. break;
  43188. case e.WIRE_TYPES.BITS64:
  43189. i.offset += 8;
  43190. break;
  43191. case e.WIRE_TYPES.LDELIM:
  43192. (n = i.readVarint32()), (i.offset += n);
  43193. break;
  43194. case e.WIRE_TYPES.STARTGROUP:
  43195. r(a, i);
  43196. break;
  43197. case e.WIRE_TYPES.ENDGROUP:
  43198. if (a === t) return !1;
  43199. throw Error(
  43200. "Illegal GROUPEND after unknown group: " +
  43201. a +
  43202. " (" +
  43203. t +
  43204. " expected)"
  43205. );
  43206. case e.WIRE_TYPES.BITS32:
  43207. i.offset += 4;
  43208. break;
  43209. default:
  43210. throw Error(
  43211. "Illegal wire type in unknown group " + t + ": " + o
  43212. );
  43213. }
  43214. return !0;
  43215. }
  43216. var o = {},
  43217. a = function (e, t, i) {
  43218. (this.builder = e),
  43219. (this.parent = t),
  43220. (this.name = i),
  43221. this.className;
  43222. },
  43223. s = a.prototype;
  43224. (s.fqn = function () {
  43225. for (var e = this.name, t = this; ; ) {
  43226. if (((t = t.parent), null == t)) break;
  43227. e = t.name + "." + e;
  43228. }
  43229. return e;
  43230. }),
  43231. (s.toString = function (e) {
  43232. return (e ? this.className + " " : "") + this.fqn();
  43233. }),
  43234. (s.build = function () {
  43235. throw Error(
  43236. this.toString(!0) + " cannot be built directly"
  43237. );
  43238. }),
  43239. (o.T = a);
  43240. var l = function (e, t, i, n, r) {
  43241. a.call(this, e, t, i),
  43242. (this.className = "Namespace"),
  43243. (this.children = []),
  43244. (this.options = n || {}),
  43245. (this.syntax = r || "proto2");
  43246. },
  43247. c = (l.prototype = Object.create(a.prototype));
  43248. (c.getChildren = function (e) {
  43249. if (((e = e || null), null == e))
  43250. return this.children.slice();
  43251. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  43252. this.children[i] instanceof e && t.push(this.children[i]);
  43253. return t;
  43254. }),
  43255. (c.addChild = function (e) {
  43256. var t;
  43257. if ((t = this.getChild(e.name)))
  43258. if (
  43259. t instanceof d.Field &&
  43260. t.name !== t.originalName &&
  43261. null === this.getChild(t.originalName)
  43262. )
  43263. t.name = t.originalName;
  43264. else {
  43265. if (
  43266. !(
  43267. e instanceof d.Field &&
  43268. e.name !== e.originalName &&
  43269. null === this.getChild(e.originalName)
  43270. )
  43271. )
  43272. throw Error(
  43273. "Duplicate name in namespace " +
  43274. this.toString(!0) +
  43275. ": " +
  43276. e.name
  43277. );
  43278. e.name = e.originalName;
  43279. }
  43280. this.children.push(e);
  43281. }),
  43282. (c.getChild = function (e) {
  43283. for (
  43284. var t = "number" == typeof e ? "id" : "name",
  43285. i = 0,
  43286. n = this.children.length;
  43287. i < n;
  43288. ++i
  43289. )
  43290. if (this.children[i][t] === e) return this.children[i];
  43291. return null;
  43292. }),
  43293. (c.resolve = function (e, t) {
  43294. var i = "string" == typeof e ? e.split(".") : e,
  43295. n = this,
  43296. r = 0;
  43297. if ("" === i[r]) {
  43298. for (; null !== n.parent; ) n = n.parent;
  43299. r++;
  43300. }
  43301. var a;
  43302. do {
  43303. do {
  43304. if (!(n instanceof o.Namespace)) {
  43305. n = null;
  43306. break;
  43307. }
  43308. if (
  43309. ((a = n.getChild(i[r])),
  43310. !a ||
  43311. !(a instanceof o.T) ||
  43312. (t && !(a instanceof o.Namespace)))
  43313. ) {
  43314. n = null;
  43315. break;
  43316. }
  43317. (n = a), r++;
  43318. } while (r < i.length);
  43319. if (null != n) break;
  43320. if (null !== this.parent)
  43321. return this.parent.resolve(e, t);
  43322. } while (null != n);
  43323. return n;
  43324. }),
  43325. (c.qn = function (e) {
  43326. var t = [],
  43327. i = e;
  43328. do t.unshift(i.name), (i = i.parent);
  43329. while (null !== i);
  43330. for (var n = 1; n <= t.length; n++) {
  43331. var r = t.slice(t.length - n);
  43332. if (e === this.resolve(r, e instanceof o.Namespace))
  43333. return r.join(".");
  43334. }
  43335. return e.fqn();
  43336. }),
  43337. (c.build = function () {
  43338. for (
  43339. var e, t = {}, i = this.children, n = 0, r = i.length;
  43340. n < r;
  43341. ++n
  43342. )
  43343. (e = i[n]), e instanceof l && (t[e.name] = e.build());
  43344. return (
  43345. Object.defineProperty &&
  43346. Object.defineProperty(t, "$options", {
  43347. value: this.buildOpt(),
  43348. }),
  43349. t
  43350. );
  43351. }),
  43352. (c.buildOpt = function () {
  43353. for (
  43354. var e = {},
  43355. t = Object.keys(this.options),
  43356. i = 0,
  43357. n = t.length;
  43358. i < n;
  43359. ++i
  43360. ) {
  43361. var r = t[i],
  43362. o = this.options[t[i]];
  43363. e[r] = o;
  43364. }
  43365. return e;
  43366. }),
  43367. (c.getOption = function (e) {
  43368. return "undefined" == typeof e
  43369. ? this.options
  43370. : "undefined" != typeof this.options[e]
  43371. ? this.options[e]
  43372. : null;
  43373. }),
  43374. (o.Namespace = l);
  43375. var h = function (t, i, n, r) {
  43376. if (
  43377. ((this.type = t),
  43378. (this.resolvedType = i),
  43379. (this.isMapKey = n),
  43380. (this.syntax = r),
  43381. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  43382. )
  43383. throw Error("Invalid map key type: " + t.name);
  43384. },
  43385. u = h.prototype;
  43386. (h.defaultFieldValue = i),
  43387. (u.verifyValue = function (i) {
  43388. function r(e, t) {
  43389. throw Error(
  43390. "Illegal value for " +
  43391. o.toString(!0) +
  43392. " of type " +
  43393. o.type.name +
  43394. ": " +
  43395. e +
  43396. " (" +
  43397. t +
  43398. ")"
  43399. );
  43400. }
  43401. var o = this;
  43402. switch (this.type) {
  43403. case e.TYPES.int32:
  43404. case e.TYPES.sint32:
  43405. case e.TYPES.sfixed32:
  43406. return (
  43407. ("number" != typeof i || (i === i && i % 1 !== 0)) &&
  43408. r(typeof i, "not an integer"),
  43409. i > 4294967295 ? 0 | i : i
  43410. );
  43411. case e.TYPES.uint32:
  43412. case e.TYPES.fixed32:
  43413. return (
  43414. ("number" != typeof i || (i === i && i % 1 !== 0)) &&
  43415. r(typeof i, "not an integer"),
  43416. i < 0 ? i >>> 0 : i
  43417. );
  43418. case e.TYPES.int64:
  43419. case e.TYPES.sint64:
  43420. case e.TYPES.sfixed64:
  43421. if (e.Long)
  43422. try {
  43423. return n(i, !1);
  43424. } catch (e) {
  43425. r(typeof i, e.message);
  43426. }
  43427. else r(typeof i, "requires Long.js");
  43428. case e.TYPES.uint64:
  43429. case e.TYPES.fixed64:
  43430. if (e.Long)
  43431. try {
  43432. return n(i, !0);
  43433. } catch (e) {
  43434. r(typeof i, e.message);
  43435. }
  43436. else r(typeof i, "requires Long.js");
  43437. case e.TYPES.bool:
  43438. return (
  43439. "boolean" != typeof i && r(typeof i, "not a boolean"),
  43440. i
  43441. );
  43442. case e.TYPES.float:
  43443. case e.TYPES.double:
  43444. return (
  43445. "number" != typeof i && r(typeof i, "not a number"), i
  43446. );
  43447. case e.TYPES.string:
  43448. return (
  43449. "string" == typeof i ||
  43450. (i && i instanceof String) ||
  43451. r(typeof i, "not a string"),
  43452. "" + i
  43453. );
  43454. case e.TYPES.bytes:
  43455. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  43456. case e.TYPES.enum:
  43457. var a = this.resolvedType.getChildren(
  43458. e.Reflect.Enum.Value
  43459. );
  43460. for (l = 0; l < a.length; l++) {
  43461. if (a[l].name == i) return a[l].id;
  43462. if (a[l].id == i) return a[l].id;
  43463. }
  43464. if ("proto3" === this.syntax)
  43465. return (
  43466. ("number" != typeof i ||
  43467. (i === i && i % 1 !== 0)) &&
  43468. r(typeof i, "not an integer"),
  43469. (i > 4294967295 || i < 0) &&
  43470. r(typeof i, "not in range for uint32"),
  43471. i
  43472. );
  43473. r(i, "not a valid enum value");
  43474. case e.TYPES.group:
  43475. case e.TYPES.message:
  43476. if (
  43477. ((i && "object" == typeof i) ||
  43478. r(typeof i, "object expected"),
  43479. i instanceof this.resolvedType.clazz)
  43480. )
  43481. return i;
  43482. if (i instanceof e.Builder.Message) {
  43483. var s = {};
  43484. for (var l in i) i.hasOwnProperty(l) && (s[l] = i[l]);
  43485. i = s;
  43486. }
  43487. return new this.resolvedType.clazz(i);
  43488. }
  43489. throw Error(
  43490. "[INTERNAL] Illegal value for " +
  43491. this.toString(!0) +
  43492. ": " +
  43493. i +
  43494. " (undefined type " +
  43495. this.type +
  43496. ")"
  43497. );
  43498. }),
  43499. (u.calculateLength = function (i, n) {
  43500. if (null === n) return 0;
  43501. var r;
  43502. switch (this.type) {
  43503. case e.TYPES.int32:
  43504. return n < 0
  43505. ? t.calculateVarint64(n)
  43506. : t.calculateVarint32(n);
  43507. case e.TYPES.uint32:
  43508. return t.calculateVarint32(n);
  43509. case e.TYPES.sint32:
  43510. return t.calculateVarint32(t.zigZagEncode32(n));
  43511. case e.TYPES.fixed32:
  43512. case e.TYPES.sfixed32:
  43513. case e.TYPES.float:
  43514. return 4;
  43515. case e.TYPES.int64:
  43516. case e.TYPES.uint64:
  43517. return t.calculateVarint64(n);
  43518. case e.TYPES.sint64:
  43519. return t.calculateVarint64(t.zigZagEncode64(n));
  43520. case e.TYPES.fixed64:
  43521. case e.TYPES.sfixed64:
  43522. return 8;
  43523. case e.TYPES.bool:
  43524. return 1;
  43525. case e.TYPES.enum:
  43526. return t.calculateVarint32(n);
  43527. case e.TYPES.double:
  43528. return 8;
  43529. case e.TYPES.string:
  43530. return (
  43531. (r = t.calculateUTF8Bytes(n)),
  43532. t.calculateVarint32(r) + r
  43533. );
  43534. case e.TYPES.bytes:
  43535. if (n.remaining() < 0)
  43536. throw Error(
  43537. "Illegal value for " +
  43538. this.toString(!0) +
  43539. ": " +
  43540. n.remaining() +
  43541. " bytes remaining"
  43542. );
  43543. return (
  43544. t.calculateVarint32(n.remaining()) + n.remaining()
  43545. );
  43546. case e.TYPES.message:
  43547. return (
  43548. (r = this.resolvedType.calculate(n)),
  43549. t.calculateVarint32(r) + r
  43550. );
  43551. case e.TYPES.group:
  43552. return (
  43553. (r = this.resolvedType.calculate(n)),
  43554. r +
  43555. t.calculateVarint32(
  43556. (i << 3) | e.WIRE_TYPES.ENDGROUP
  43557. )
  43558. );
  43559. }
  43560. throw Error(
  43561. "[INTERNAL] Illegal value to encode in " +
  43562. this.toString(!0) +
  43563. ": " +
  43564. n +
  43565. " (unknown type)"
  43566. );
  43567. }),
  43568. (u.encodeValue = function (i, n, r) {
  43569. if (null === n) return r;
  43570. switch (this.type) {
  43571. case e.TYPES.int32:
  43572. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  43573. break;
  43574. case e.TYPES.uint32:
  43575. r.writeVarint32(n);
  43576. break;
  43577. case e.TYPES.sint32:
  43578. r.writeVarint32ZigZag(n);
  43579. break;
  43580. case e.TYPES.fixed32:
  43581. r.writeUint32(n);
  43582. break;
  43583. case e.TYPES.sfixed32:
  43584. r.writeInt32(n);
  43585. break;
  43586. case e.TYPES.int64:
  43587. case e.TYPES.uint64:
  43588. r.writeVarint64(n);
  43589. break;
  43590. case e.TYPES.sint64:
  43591. r.writeVarint64ZigZag(n);
  43592. break;
  43593. case e.TYPES.fixed64:
  43594. r.writeUint64(n);
  43595. break;
  43596. case e.TYPES.sfixed64:
  43597. r.writeInt64(n);
  43598. break;
  43599. case e.TYPES.bool:
  43600. "string" == typeof n
  43601. ? r.writeVarint32(
  43602. "false" === n.toLowerCase() ? 0 : !!n
  43603. )
  43604. : r.writeVarint32(n ? 1 : 0);
  43605. break;
  43606. case e.TYPES.enum:
  43607. r.writeVarint32(n);
  43608. break;
  43609. case e.TYPES.float:
  43610. r.writeFloat32(n);
  43611. break;
  43612. case e.TYPES.double:
  43613. r.writeFloat64(n);
  43614. break;
  43615. case e.TYPES.string:
  43616. r.writeVString(n);
  43617. break;
  43618. case e.TYPES.bytes:
  43619. if (n.remaining() < 0)
  43620. throw Error(
  43621. "Illegal value for " +
  43622. this.toString(!0) +
  43623. ": " +
  43624. n.remaining() +
  43625. " bytes remaining"
  43626. );
  43627. var o = n.offset;
  43628. r.writeVarint32(n.remaining()),
  43629. r.append(n),
  43630. (n.offset = o);
  43631. break;
  43632. case e.TYPES.message:
  43633. var a = new t().LE();
  43634. this.resolvedType.encode(n, a),
  43635. r.writeVarint32(a.offset),
  43636. r.append(a.flip());
  43637. break;
  43638. case e.TYPES.group:
  43639. this.resolvedType.encode(n, r),
  43640. r.writeVarint32((i << 3) | e.WIRE_TYPES.ENDGROUP);
  43641. break;
  43642. default:
  43643. throw Error(
  43644. "[INTERNAL] Illegal value to encode in " +
  43645. this.toString(!0) +
  43646. ": " +
  43647. n +
  43648. " (unknown type)"
  43649. );
  43650. }
  43651. return r;
  43652. }),
  43653. (u.decode = function (t, i, n) {
  43654. if (i != this.type.wireType)
  43655. throw Error("Unexpected wire type for element");
  43656. var r, o;
  43657. switch (this.type) {
  43658. case e.TYPES.int32:
  43659. return 0 | t.readVarint32();
  43660. case e.TYPES.uint32:
  43661. return t.readVarint32() >>> 0;
  43662. case e.TYPES.sint32:
  43663. return 0 | t.readVarint32ZigZag();
  43664. case e.TYPES.fixed32:
  43665. return t.readUint32() >>> 0;
  43666. case e.TYPES.sfixed32:
  43667. return 0 | t.readInt32();
  43668. case e.TYPES.int64:
  43669. return t.readVarint64();
  43670. case e.TYPES.uint64:
  43671. return t.readVarint64().toUnsigned();
  43672. case e.TYPES.sint64:
  43673. return t.readVarint64ZigZag();
  43674. case e.TYPES.fixed64:
  43675. return t.readUint64();
  43676. case e.TYPES.sfixed64:
  43677. return t.readInt64();
  43678. case e.TYPES.bool:
  43679. return !!t.readVarint32();
  43680. case e.TYPES.enum:
  43681. return t.readVarint32();
  43682. case e.TYPES.float:
  43683. return t.readFloat();
  43684. case e.TYPES.double:
  43685. return t.readDouble();
  43686. case e.TYPES.string:
  43687. return t.readVString();
  43688. case e.TYPES.bytes:
  43689. if (((o = t.readVarint32()), t.remaining() < o))
  43690. throw Error(
  43691. "Illegal number of bytes for " +
  43692. this.toString(!0) +
  43693. ": " +
  43694. o +
  43695. " required but got only " +
  43696. t.remaining()
  43697. );
  43698. return (
  43699. (r = t.clone()),
  43700. (r.limit = r.offset + o),
  43701. (t.offset += o),
  43702. r
  43703. );
  43704. case e.TYPES.message:
  43705. return (
  43706. (o = t.readVarint32()), this.resolvedType.decode(t, o)
  43707. );
  43708. case e.TYPES.group:
  43709. return this.resolvedType.decode(t, -1, n);
  43710. }
  43711. throw Error("[INTERNAL] Illegal decode type");
  43712. }),
  43713. (u.valueFromString = function (i) {
  43714. if (!this.isMapKey)
  43715. throw Error(
  43716. "valueFromString() called on non-map-key element"
  43717. );
  43718. switch (this.type) {
  43719. case e.TYPES.int32:
  43720. case e.TYPES.sint32:
  43721. case e.TYPES.sfixed32:
  43722. case e.TYPES.uint32:
  43723. case e.TYPES.fixed32:
  43724. return this.verifyValue(parseInt(i));
  43725. case e.TYPES.int64:
  43726. case e.TYPES.sint64:
  43727. case e.TYPES.sfixed64:
  43728. case e.TYPES.uint64:
  43729. case e.TYPES.fixed64:
  43730. return this.verifyValue(i);
  43731. case e.TYPES.bool:
  43732. return "true" === i;
  43733. case e.TYPES.string:
  43734. return this.verifyValue(i);
  43735. case e.TYPES.bytes:
  43736. return t.fromBinary(i);
  43737. }
  43738. }),
  43739. (u.valueToString = function (t) {
  43740. if (!this.isMapKey)
  43741. throw Error(
  43742. "valueToString() called on non-map-key element"
  43743. );
  43744. return this.type === e.TYPES.bytes
  43745. ? t.toString("binary")
  43746. : t.toString();
  43747. }),
  43748. (o.Element = h);
  43749. var d = function (e, t, i, n, r, o) {
  43750. l.call(this, e, t, i, n, o),
  43751. (this.className = "Message"),
  43752. (this.extensions = void 0),
  43753. (this.clazz = null),
  43754. (this.isGroup = !!r),
  43755. (this._fields = null),
  43756. (this._fieldsById = null),
  43757. (this._fieldsByName = null);
  43758. },
  43759. p = (d.prototype = Object.create(l.prototype));
  43760. (p.build = function (i) {
  43761. if (this.clazz && !i) return this.clazz;
  43762. var n = (function (e, i) {
  43763. function n(i, r, o, a) {
  43764. if (null === i || "object" != typeof i) {
  43765. if (a && a instanceof e.Reflect.Enum) {
  43766. var s = e.Reflect.Enum.getName(a.object, i);
  43767. if (null !== s) return s;
  43768. }
  43769. return i;
  43770. }
  43771. if (t.isByteBuffer(i))
  43772. return r ? i.toBase64() : i.toBuffer();
  43773. if (e.Long.isLong(i))
  43774. return o ? i.toString() : e.Long.fromValue(i);
  43775. var l;
  43776. if (Array.isArray(i))
  43777. return (
  43778. (l = []),
  43779. i.forEach(function (e, t) {
  43780. l[t] = n(e, r, o, a);
  43781. }),
  43782. l
  43783. );
  43784. if (((l = {}), i instanceof e.Map)) {
  43785. for (
  43786. var c = i.entries(), h = c.next();
  43787. !h.done;
  43788. h = c.next()
  43789. )
  43790. l[i.keyElem.valueToString(h.value[0])] = n(
  43791. h.value[1],
  43792. r,
  43793. o,
  43794. i.valueElem.resolvedType
  43795. );
  43796. return l;
  43797. }
  43798. var u = i.$type,
  43799. d = void 0;
  43800. for (var p in i)
  43801. i.hasOwnProperty(p) &&
  43802. (u && (d = u.getChild(p))
  43803. ? (l[p] = n(i[p], r, o, d.resolvedType))
  43804. : (l[p] = n(i[p], r, o)));
  43805. return l;
  43806. }
  43807. var r = i.getChildren(e.Reflect.Message.Field),
  43808. o = i.getChildren(e.Reflect.Message.OneOf),
  43809. a = function (n, s) {
  43810. e.Builder.Message.call(this);
  43811. for (var l = 0, c = o.length; l < c; ++l)
  43812. this[o[l].name] = null;
  43813. for (l = 0, c = r.length; l < c; ++l) {
  43814. var h = r[l];
  43815. (this[h.name] = h.repeated
  43816. ? []
  43817. : h.map
  43818. ? new e.Map(h)
  43819. : null),
  43820. (!h.required && "proto3" !== i.syntax) ||
  43821. null === h.defaultValue ||
  43822. (this[h.name] = h.defaultValue);
  43823. }
  43824. if (arguments.length > 0) {
  43825. var u;
  43826. if (
  43827. 1 !== arguments.length ||
  43828. null === n ||
  43829. "object" != typeof n ||
  43830. !(
  43831. "function" != typeof n.encode || n instanceof a
  43832. ) ||
  43833. Array.isArray(n) ||
  43834. n instanceof e.Map ||
  43835. t.isByteBuffer(n) ||
  43836. n instanceof ArrayBuffer ||
  43837. (e.Long && n instanceof e.Long)
  43838. )
  43839. for (l = 0, c = arguments.length; l < c; ++l)
  43840. "undefined" != typeof (u = arguments[l]) &&
  43841. this.$set(r[l].name, u);
  43842. else this.$set(n);
  43843. }
  43844. },
  43845. s = (a.prototype = Object.create(
  43846. e.Builder.Message.prototype
  43847. ));
  43848. (s.add = function (t, n, r) {
  43849. var o = i._fieldsByName[t];
  43850. if (!r) {
  43851. if (!o) throw Error(this + "#" + t + " is undefined");
  43852. if (!(o instanceof e.Reflect.Message.Field))
  43853. throw Error(
  43854. this +
  43855. "#" +
  43856. t +
  43857. " is not a field: " +
  43858. o.toString(!0)
  43859. );
  43860. if (!o.repeated)
  43861. throw Error(
  43862. this + "#" + t + " is not a repeated field"
  43863. );
  43864. n = o.verifyValue(n, !0);
  43865. }
  43866. return (
  43867. null === this[t] && (this[t] = []),
  43868. this[t].push(n),
  43869. this
  43870. );
  43871. }),
  43872. (s.$add = s.add),
  43873. (s.set = function (t, n, r) {
  43874. if (t && "object" == typeof t) {
  43875. r = n;
  43876. for (var o in t)
  43877. t.hasOwnProperty(o) &&
  43878. "undefined" != typeof (n = t[o]) &&
  43879. this.$set(o, n, r);
  43880. return this;
  43881. }
  43882. var a = i._fieldsByName[t];
  43883. if (r) this[t] = n;
  43884. else {
  43885. if (!a)
  43886. throw Error(
  43887. this + "#" + t + " is not a field: undefined"
  43888. );
  43889. if (!(a instanceof e.Reflect.Message.Field))
  43890. throw Error(
  43891. this +
  43892. "#" +
  43893. t +
  43894. " is not a field: " +
  43895. a.toString(!0)
  43896. );
  43897. this[a.name] = n = a.verifyValue(n);
  43898. }
  43899. if (a && a.oneof) {
  43900. var s = this[a.oneof.name];
  43901. null !== n
  43902. ? (null !== s && s !== a.name && (this[s] = null),
  43903. (this[a.oneof.name] = a.name))
  43904. : s === t && (this[a.oneof.name] = null);
  43905. }
  43906. return this;
  43907. }),
  43908. (s.$set = s.set),
  43909. (s.get = function (t, n) {
  43910. if (n) return this[t];
  43911. var r = i._fieldsByName[t];
  43912. if (!(r && r instanceof e.Reflect.Message.Field))
  43913. throw Error(
  43914. this + "#" + t + " is not a field: undefined"
  43915. );
  43916. if (!(r instanceof e.Reflect.Message.Field))
  43917. throw Error(
  43918. this +
  43919. "#" +
  43920. t +
  43921. " is not a field: " +
  43922. r.toString(!0)
  43923. );
  43924. return this[r.name];
  43925. }),
  43926. (s.$get = s.get);
  43927. for (var l = 0; l < r.length; l++) {
  43928. var c = r[l];
  43929. c instanceof e.Reflect.Message.ExtensionField ||
  43930. (i.builder.options.populateAccessors &&
  43931. (function (e) {
  43932. var t = e.originalName.replace(
  43933. /(_[a-zA-Z])/g,
  43934. function (e) {
  43935. return e.toUpperCase().replace("_", "");
  43936. }
  43937. );
  43938. t =
  43939. t.substring(0, 1).toUpperCase() + t.substring(1);
  43940. var n = e.originalName.replace(
  43941. /([A-Z])/g,
  43942. function (e) {
  43943. return "_" + e;
  43944. }
  43945. ),
  43946. r = function (t, i) {
  43947. return (
  43948. (this[e.name] = i ? t : e.verifyValue(t)),
  43949. this
  43950. );
  43951. },
  43952. o = function () {
  43953. return this[e.name];
  43954. };
  43955. null === i.getChild("set" + t) &&
  43956. (s["set" + t] = r),
  43957. null === i.getChild("set_" + n) &&
  43958. (s["set_" + n] = r),
  43959. null === i.getChild("get" + t) &&
  43960. (s["get" + t] = o),
  43961. null === i.getChild("get_" + n) &&
  43962. (s["get_" + n] = o);
  43963. })(c));
  43964. }
  43965. (s.encode = function (e, n) {
  43966. "boolean" == typeof e && ((n = e), (e = void 0));
  43967. var r = !1;
  43968. e || ((e = new t()), (r = !0));
  43969. var o = e.littleEndian;
  43970. try {
  43971. return (
  43972. i.encode(this, e.LE(), n), (r ? e.flip() : e).LE(o)
  43973. );
  43974. } catch (t) {
  43975. throw (e.LE(o), t);
  43976. }
  43977. }),
  43978. (a.encode = function (e, t, i) {
  43979. return new a(e).encode(t, i);
  43980. }),
  43981. (s.calculate = function () {
  43982. return i.calculate(this);
  43983. }),
  43984. (s.encodeDelimited = function (e, n) {
  43985. var r = !1;
  43986. e || ((e = new t()), (r = !0));
  43987. var o = new t().LE();
  43988. return (
  43989. i.encode(this, o, n).flip(),
  43990. e.writeVarint32(o.remaining()),
  43991. e.append(o),
  43992. r ? e.flip() : e
  43993. );
  43994. }),
  43995. (s.encodeAB = function () {
  43996. try {
  43997. return this.encode().toArrayBuffer();
  43998. } catch (e) {
  43999. throw (
  44000. (e.encoded &&
  44001. (e.encoded = e.encoded.toArrayBuffer()),
  44002. e)
  44003. );
  44004. }
  44005. }),
  44006. (s.toArrayBuffer = s.encodeAB),
  44007. (s.encodeNB = function () {
  44008. try {
  44009. return this.encode().toBuffer();
  44010. } catch (e) {
  44011. throw (
  44012. (e.encoded && (e.encoded = e.encoded.toBuffer()), e)
  44013. );
  44014. }
  44015. }),
  44016. (s.toBuffer = s.encodeNB),
  44017. (s.encode64 = function () {
  44018. try {
  44019. return this.encode().toBase64();
  44020. } catch (e) {
  44021. throw (
  44022. (e.encoded && (e.encoded = e.encoded.toBase64()), e)
  44023. );
  44024. }
  44025. }),
  44026. (s.toBase64 = s.encode64),
  44027. (s.encodeHex = function () {
  44028. try {
  44029. return this.encode().toHex();
  44030. } catch (e) {
  44031. throw (
  44032. (e.encoded && (e.encoded = e.encoded.toHex()), e)
  44033. );
  44034. }
  44035. }),
  44036. (s.toHex = s.encodeHex),
  44037. (s.toRaw = function (e, t) {
  44038. return n(this, !!e, !!t, this.$type);
  44039. }),
  44040. (s.encodeJSON = function () {
  44041. return JSON.stringify(n(this, !0, !0, this.$type));
  44042. }),
  44043. (a.decode = function (e, n, r) {
  44044. "string" == typeof n && ((r = n), (n = -1)),
  44045. "string" == typeof e &&
  44046. (e = t.wrap(e, r ? r : "base64")),
  44047. (e = t.isByteBuffer(e) ? e : t.wrap(e));
  44048. var o = e.littleEndian;
  44049. try {
  44050. var a = i.decode(e.LE());
  44051. return e.LE(o), a;
  44052. } catch (t) {
  44053. throw (e.LE(o), t);
  44054. }
  44055. }),
  44056. (a.decodeDelimited = function (e, n) {
  44057. if (
  44058. ("string" == typeof e &&
  44059. (e = t.wrap(e, n ? n : "base64")),
  44060. (e = t.isByteBuffer(e) ? e : t.wrap(e)),
  44061. e.remaining() < 1)
  44062. )
  44063. return null;
  44064. var r = e.offset,
  44065. o = e.readVarint32();
  44066. if (e.remaining() < o) return (e.offset = r), null;
  44067. try {
  44068. var a = i.decode(
  44069. e.slice(e.offset, e.offset + o).LE()
  44070. );
  44071. return (e.offset += o), a;
  44072. } catch (t) {
  44073. throw ((e.offset += o), t);
  44074. }
  44075. }),
  44076. (a.decode64 = function (e) {
  44077. return a.decode(e, "base64");
  44078. }),
  44079. (a.decodeHex = function (e) {
  44080. return a.decode(e, "hex");
  44081. }),
  44082. (a.decodeJSON = function (e) {
  44083. return new a(JSON.parse(e));
  44084. }),
  44085. (s.toString = function () {
  44086. return i.toString();
  44087. });
  44088. return (
  44089. Object.defineProperty &&
  44090. (Object.defineProperty(a, "$options", {
  44091. value: i.buildOpt(),
  44092. }),
  44093. Object.defineProperty(s, "$options", {
  44094. value: a.$options,
  44095. }),
  44096. Object.defineProperty(a, "$type", {
  44097. value: i,
  44098. }),
  44099. Object.defineProperty(s, "$type", {
  44100. value: i,
  44101. })),
  44102. a
  44103. );
  44104. })(e, this);
  44105. (this._fields = []),
  44106. (this._fieldsById = {}),
  44107. (this._fieldsByName = {});
  44108. for (var r, o = 0, a = this.children.length; o < a; o++)
  44109. if (
  44110. ((r = this.children[o]),
  44111. r instanceof A || r instanceof d || r instanceof E)
  44112. ) {
  44113. if (n.hasOwnProperty(r.name))
  44114. throw Error(
  44115. "Illegal reflect child of " +
  44116. this.toString(!0) +
  44117. ": " +
  44118. r.toString(!0) +
  44119. " cannot override static property '" +
  44120. r.name +
  44121. "'"
  44122. );
  44123. n[r.name] = r.build();
  44124. } else if (r instanceof d.Field)
  44125. r.build(),
  44126. this._fields.push(r),
  44127. (this._fieldsById[r.id] = r),
  44128. (this._fieldsByName[r.name] = r);
  44129. else if (!(r instanceof d.OneOf || r instanceof I))
  44130. throw Error(
  44131. "Illegal reflect child of " +
  44132. this.toString(!0) +
  44133. ": " +
  44134. this.children[o].toString(!0)
  44135. );
  44136. return (this.clazz = n);
  44137. }),
  44138. (p.encode = function (e, t, i) {
  44139. for (
  44140. var n, r, o = null, a = 0, s = this._fields.length;
  44141. a < s;
  44142. ++a
  44143. )
  44144. (n = this._fields[a]),
  44145. (r = e[n.name]),
  44146. n.required && null === r
  44147. ? null === o && (o = n)
  44148. : n.encode(i ? r : n.verifyValue(r), t, e);
  44149. if (null !== o) {
  44150. var l = Error(
  44151. "Missing at least one required field for " +
  44152. this.toString(!0) +
  44153. ": " +
  44154. o
  44155. );
  44156. throw ((l.encoded = t), l);
  44157. }
  44158. return t;
  44159. }),
  44160. (p.calculate = function (e) {
  44161. for (
  44162. var t, i, n = 0, r = 0, o = this._fields.length;
  44163. r < o;
  44164. ++r
  44165. ) {
  44166. if (
  44167. ((t = this._fields[r]),
  44168. (i = e[t.name]),
  44169. t.required && null === i)
  44170. )
  44171. throw Error(
  44172. "Missing at least one required field for " +
  44173. this.toString(!0) +
  44174. ": " +
  44175. t
  44176. );
  44177. n += t.calculate(i, e);
  44178. }
  44179. return n;
  44180. }),
  44181. (p.decode = function (t, i, n) {
  44182. i = "number" == typeof i ? i : -1;
  44183. for (
  44184. var o, a, s, l, c = t.offset, h = new this.clazz();
  44185. t.offset < c + i || (i === -1 && t.remaining() > 0);
  44186. ) {
  44187. if (
  44188. ((o = t.readVarint32()),
  44189. (a = 7 & o),
  44190. (s = o >>> 3),
  44191. a === e.WIRE_TYPES.ENDGROUP)
  44192. ) {
  44193. if (s !== n)
  44194. throw Error(
  44195. "Illegal group end indicator for " +
  44196. this.toString(!0) +
  44197. ": " +
  44198. s +
  44199. " (" +
  44200. (n ? n + " expected" : "not a group") +
  44201. ")"
  44202. );
  44203. break;
  44204. }
  44205. if ((l = this._fieldsById[s])) {
  44206. if (l.repeated && !l.options.packed)
  44207. h[l.name].push(l.decode(a, t));
  44208. else if (l.map) {
  44209. var u = l.decode(a, t);
  44210. h[l.name].set(u[0], u[1]);
  44211. } else if (((h[l.name] = l.decode(a, t)), l.oneof)) {
  44212. var d = h[l.oneof.name];
  44213. null !== d && d !== l.name && (h[d] = null),
  44214. (h[l.oneof.name] = l.name);
  44215. }
  44216. } else
  44217. switch (a) {
  44218. case e.WIRE_TYPES.VARINT:
  44219. t.readVarint32();
  44220. break;
  44221. case e.WIRE_TYPES.BITS32:
  44222. t.offset += 4;
  44223. break;
  44224. case e.WIRE_TYPES.BITS64:
  44225. t.offset += 8;
  44226. break;
  44227. case e.WIRE_TYPES.LDELIM:
  44228. var p = t.readVarint32();
  44229. t.offset += p;
  44230. break;
  44231. case e.WIRE_TYPES.STARTGROUP:
  44232. for (; r(s, t); );
  44233. break;
  44234. default:
  44235. throw Error(
  44236. "Illegal wire type for unknown field " +
  44237. s +
  44238. " in " +
  44239. this.toString(!0) +
  44240. "#decode: " +
  44241. a
  44242. );
  44243. }
  44244. }
  44245. for (var f = 0, g = this._fields.length; f < g; ++f)
  44246. if (((l = this._fields[f]), null === h[l.name]))
  44247. if ("proto3" === this.syntax)
  44248. h[l.name] = l.defaultValue;
  44249. else {
  44250. if (l.required) {
  44251. var m = Error(
  44252. "Missing at least one required field for " +
  44253. this.toString(!0) +
  44254. ": " +
  44255. l.name
  44256. );
  44257. throw ((m.decoded = h), m);
  44258. }
  44259. e.populateDefaults &&
  44260. null !== l.defaultValue &&
  44261. (h[l.name] = l.defaultValue);
  44262. }
  44263. return h;
  44264. }),
  44265. (o.Message = d);
  44266. var f = function (t, i, n, r, o, s, l, c, h, u) {
  44267. a.call(this, t, i, s),
  44268. (this.className = "Message.Field"),
  44269. (this.required = "required" === n),
  44270. (this.repeated = "repeated" === n),
  44271. (this.map = "map" === n),
  44272. (this.keyType = r || null),
  44273. (this.type = o),
  44274. (this.resolvedType = null),
  44275. (this.id = l),
  44276. (this.options = c || {}),
  44277. (this.defaultValue = null),
  44278. (this.oneof = h || null),
  44279. (this.syntax = u || "proto2"),
  44280. (this.originalName = this.name),
  44281. (this.element = null),
  44282. (this.keyElement = null),
  44283. !this.builder.options.convertFieldsToCamelCase ||
  44284. this instanceof d.ExtensionField ||
  44285. (this.name = e.Util.toCamelCase(this.name));
  44286. },
  44287. g = (f.prototype = Object.create(a.prototype));
  44288. (g.build = function () {
  44289. (this.element = new h(
  44290. this.type,
  44291. this.resolvedType,
  44292. !1,
  44293. this.syntax
  44294. )),
  44295. this.map &&
  44296. (this.keyElement = new h(
  44297. this.keyType,
  44298. void 0,
  44299. !0,
  44300. this.syntax
  44301. )),
  44302. "proto3" !== this.syntax || this.repeated || this.map
  44303. ? "undefined" != typeof this.options.default &&
  44304. (this.defaultValue = this.verifyValue(
  44305. this.options.default
  44306. ))
  44307. : (this.defaultValue = h.defaultFieldValue(this.type));
  44308. }),
  44309. (g.verifyValue = function (t, i) {
  44310. function n(e, t) {
  44311. throw Error(
  44312. "Illegal value for " +
  44313. r.toString(!0) +
  44314. " of type " +
  44315. r.type.name +
  44316. ": " +
  44317. e +
  44318. " (" +
  44319. t +
  44320. ")"
  44321. );
  44322. }
  44323. i = i || !1;
  44324. var r = this;
  44325. if (null === t)
  44326. return (
  44327. this.required && n(typeof t, "required"),
  44328. "proto3" === this.syntax &&
  44329. this.type !== e.TYPES.message &&
  44330. n(
  44331. typeof t,
  44332. "proto3 field without field presence cannot be null"
  44333. ),
  44334. null
  44335. );
  44336. var o;
  44337. if (this.repeated && !i) {
  44338. Array.isArray(t) || (t = [t]);
  44339. var a = [];
  44340. for (o = 0; o < t.length; o++)
  44341. a.push(this.element.verifyValue(t[o]));
  44342. return a;
  44343. }
  44344. return this.map && !i
  44345. ? t instanceof e.Map
  44346. ? t
  44347. : (t instanceof Object ||
  44348. n(
  44349. typeof t,
  44350. "expected ProtoBuf.Map or raw object for map field"
  44351. ),
  44352. new e.Map(this, t))
  44353. : (!this.repeated &&
  44354. Array.isArray(t) &&
  44355. n(typeof t, "no array expected"),
  44356. this.element.verifyValue(t));
  44357. }),
  44358. (g.hasWirePresence = function (t, i) {
  44359. if ("proto3" !== this.syntax) return null !== t;
  44360. if (this.oneof && i[this.oneof.name] === this.name)
  44361. return !0;
  44362. switch (this.type) {
  44363. case e.TYPES.int32:
  44364. case e.TYPES.sint32:
  44365. case e.TYPES.sfixed32:
  44366. case e.TYPES.uint32:
  44367. case e.TYPES.fixed32:
  44368. return 0 !== t;
  44369. case e.TYPES.int64:
  44370. case e.TYPES.sint64:
  44371. case e.TYPES.sfixed64:
  44372. case e.TYPES.uint64:
  44373. case e.TYPES.fixed64:
  44374. return 0 !== t.low || 0 !== t.high;
  44375. case e.TYPES.bool:
  44376. return t;
  44377. case e.TYPES.float:
  44378. case e.TYPES.double:
  44379. return 0 !== t;
  44380. case e.TYPES.string:
  44381. return t.length > 0;
  44382. case e.TYPES.bytes:
  44383. return t.remaining() > 0;
  44384. case e.TYPES.enum:
  44385. return 0 !== t;
  44386. case e.TYPES.message:
  44387. return null !== t;
  44388. default:
  44389. return !0;
  44390. }
  44391. }),
  44392. (g.encode = function (i, n, r) {
  44393. if (null === this.type || "object" != typeof this.type)
  44394. throw Error(
  44395. "[INTERNAL] Unresolved type in " +
  44396. this.toString(!0) +
  44397. ": " +
  44398. this.type
  44399. );
  44400. if (null === i || (this.repeated && 0 == i.length))
  44401. return n;
  44402. try {
  44403. if (this.repeated) {
  44404. var o;
  44405. if (
  44406. this.options.packed &&
  44407. e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0
  44408. ) {
  44409. n.writeVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM),
  44410. n.ensureCapacity((n.offset += 1));
  44411. var a = n.offset;
  44412. for (o = 0; o < i.length; o++)
  44413. this.element.encodeValue(this.id, i[o], n);
  44414. var s = n.offset - a,
  44415. l = t.calculateVarint32(s);
  44416. if (l > 1) {
  44417. var c = n.slice(a, n.offset);
  44418. (a += l - 1), (n.offset = a), n.append(c);
  44419. }
  44420. n.writeVarint32(s, a - l);
  44421. } else
  44422. for (o = 0; o < i.length; o++)
  44423. n.writeVarint32(
  44424. (this.id << 3) | this.type.wireType
  44425. ),
  44426. this.element.encodeValue(this.id, i[o], n);
  44427. } else
  44428. this.map
  44429. ? i.forEach(function (i, r, o) {
  44430. var a =
  44431. t.calculateVarint32(8 | this.keyType.wireType) +
  44432. this.keyElement.calculateLength(1, r) +
  44433. t.calculateVarint32(16 | this.type.wireType) +
  44434. this.element.calculateLength(2, i);
  44435. n.writeVarint32(
  44436. (this.id << 3) | e.WIRE_TYPES.LDELIM
  44437. ),
  44438. n.writeVarint32(a),
  44439. n.writeVarint32(8 | this.keyType.wireType),
  44440. this.keyElement.encodeValue(1, r, n),
  44441. n.writeVarint32(16 | this.type.wireType),
  44442. this.element.encodeValue(2, i, n);
  44443. }, this)
  44444. : this.hasWirePresence(i, r) &&
  44445. (n.writeVarint32(
  44446. (this.id << 3) | this.type.wireType
  44447. ),
  44448. this.element.encodeValue(this.id, i, n));
  44449. } catch (e) {
  44450. throw Error(
  44451. "Illegal value for " +
  44452. this.toString(!0) +
  44453. ": " +
  44454. i +
  44455. " (" +
  44456. e +
  44457. ")"
  44458. );
  44459. }
  44460. return n;
  44461. }),
  44462. (g.calculate = function (i, n) {
  44463. if (
  44464. ((i = this.verifyValue(i)),
  44465. null === this.type || "object" != typeof this.type)
  44466. )
  44467. throw Error(
  44468. "[INTERNAL] Unresolved type in " +
  44469. this.toString(!0) +
  44470. ": " +
  44471. this.type
  44472. );
  44473. if (null === i || (this.repeated && 0 == i.length))
  44474. return 0;
  44475. var r = 0;
  44476. try {
  44477. if (this.repeated) {
  44478. var o, a;
  44479. if (
  44480. this.options.packed &&
  44481. e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0
  44482. ) {
  44483. for (
  44484. r += t.calculateVarint32(
  44485. (this.id << 3) | e.WIRE_TYPES.LDELIM
  44486. ),
  44487. a = 0,
  44488. o = 0;
  44489. o < i.length;
  44490. o++
  44491. )
  44492. a += this.element.calculateLength(this.id, i[o]);
  44493. (r += t.calculateVarint32(a)), (r += a);
  44494. } else
  44495. for (o = 0; o < i.length; o++)
  44496. (r += t.calculateVarint32(
  44497. (this.id << 3) | this.type.wireType
  44498. )),
  44499. (r += this.element.calculateLength(
  44500. this.id,
  44501. i[o]
  44502. ));
  44503. } else
  44504. this.map
  44505. ? i.forEach(function (i, n, o) {
  44506. var a =
  44507. t.calculateVarint32(8 | this.keyType.wireType) +
  44508. this.keyElement.calculateLength(1, n) +
  44509. t.calculateVarint32(16 | this.type.wireType) +
  44510. this.element.calculateLength(2, i);
  44511. (r += t.calculateVarint32(
  44512. (this.id << 3) | e.WIRE_TYPES.LDELIM
  44513. )),
  44514. (r += t.calculateVarint32(a)),
  44515. (r += a);
  44516. }, this)
  44517. : this.hasWirePresence(i, n) &&
  44518. ((r += t.calculateVarint32(
  44519. (this.id << 3) | this.type.wireType
  44520. )),
  44521. (r += this.element.calculateLength(this.id, i)));
  44522. } catch (e) {
  44523. throw Error(
  44524. "Illegal value for " +
  44525. this.toString(!0) +
  44526. ": " +
  44527. i +
  44528. " (" +
  44529. e +
  44530. ")"
  44531. );
  44532. }
  44533. return r;
  44534. }),
  44535. (g.decode = function (t, i, n) {
  44536. var r,
  44537. o,
  44538. a =
  44539. (!this.map && t == this.type.wireType) ||
  44540. (!n &&
  44541. this.repeated &&
  44542. this.options.packed &&
  44543. t == e.WIRE_TYPES.LDELIM) ||
  44544. (this.map && t == e.WIRE_TYPES.LDELIM);
  44545. if (!a)
  44546. throw Error(
  44547. "Illegal wire type for field " +
  44548. this.toString(!0) +
  44549. ": " +
  44550. t +
  44551. " (" +
  44552. this.type.wireType +
  44553. " expected)"
  44554. );
  44555. if (
  44556. t == e.WIRE_TYPES.LDELIM &&
  44557. this.repeated &&
  44558. this.options.packed &&
  44559. e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 &&
  44560. !n
  44561. ) {
  44562. (o = i.readVarint32()), (o = i.offset + o);
  44563. for (var s = []; i.offset < o; )
  44564. s.push(this.decode(this.type.wireType, i, !0));
  44565. return s;
  44566. }
  44567. if (this.map) {
  44568. var l = h.defaultFieldValue(this.keyType);
  44569. if (
  44570. ((r = h.defaultFieldValue(this.type)),
  44571. (o = i.readVarint32()),
  44572. i.remaining() < o)
  44573. )
  44574. throw Error(
  44575. "Illegal number of bytes for " +
  44576. this.toString(!0) +
  44577. ": " +
  44578. o +
  44579. " required but got only " +
  44580. i.remaining()
  44581. );
  44582. var c = i.clone();
  44583. for (
  44584. c.limit = c.offset + o, i.offset += o;
  44585. c.remaining() > 0;
  44586. ) {
  44587. var u = c.readVarint32();
  44588. t = 7 & u;
  44589. var d = u >>> 3;
  44590. if (1 === d) l = this.keyElement.decode(c, t, d);
  44591. else {
  44592. if (2 !== d)
  44593. throw Error(
  44594. "Unexpected tag in map field key/value submessage"
  44595. );
  44596. r = this.element.decode(c, t, d);
  44597. }
  44598. }
  44599. return [l, r];
  44600. }
  44601. return this.element.decode(i, t, this.id);
  44602. }),
  44603. (o.Message.Field = f);
  44604. var m = function (e, t, i, n, r, o, a) {
  44605. f.call(this, e, t, i, null, n, r, o, a), this.extension;
  44606. };
  44607. (m.prototype = Object.create(f.prototype)),
  44608. (o.Message.ExtensionField = m);
  44609. var v = function (e, t, i) {
  44610. a.call(this, e, t, i), (this.fields = []);
  44611. };
  44612. o.Message.OneOf = v;
  44613. var A = function (e, t, i, n, r) {
  44614. l.call(this, e, t, i, n, r),
  44615. (this.className = "Enum"),
  44616. (this.object = null);
  44617. };
  44618. A.getName = function (e, t) {
  44619. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  44620. if (e[(i = n[r])] === t) return i;
  44621. return null;
  44622. };
  44623. var y = (A.prototype = Object.create(l.prototype));
  44624. (y.build = function (t) {
  44625. if (this.object && !t) return this.object;
  44626. for (
  44627. var i = new e.Builder.Enum(),
  44628. n = this.getChildren(A.Value),
  44629. r = 0,
  44630. o = n.length;
  44631. r < o;
  44632. ++r
  44633. )
  44634. i[n[r].name] = n[r].id;
  44635. return (
  44636. Object.defineProperty &&
  44637. Object.defineProperty(i, "$options", {
  44638. value: this.buildOpt(),
  44639. enumerable: !1,
  44640. }),
  44641. (this.object = i)
  44642. );
  44643. }),
  44644. (o.Enum = A);
  44645. var C = function (e, t, i, n) {
  44646. a.call(this, e, t, i),
  44647. (this.className = "Enum.Value"),
  44648. (this.id = n);
  44649. };
  44650. (C.prototype = Object.create(a.prototype)), (o.Enum.Value = C);
  44651. var I = function (e, t, i, n) {
  44652. a.call(this, e, t, i), (this.field = n);
  44653. };
  44654. (I.prototype = Object.create(a.prototype)), (o.Extension = I);
  44655. var E = function (e, t, i, n) {
  44656. l.call(this, e, t, i, n),
  44657. (this.className = "Service"),
  44658. (this.clazz = null);
  44659. },
  44660. b = (E.prototype = Object.create(l.prototype));
  44661. (b.build = function (i) {
  44662. return this.clazz && !i
  44663. ? this.clazz
  44664. : (this.clazz = (function (e, i) {
  44665. for (
  44666. var n = function (t) {
  44667. e.Builder.Service.call(this),
  44668. (this.rpcImpl =
  44669. t ||
  44670. function (e, t, i) {
  44671. setTimeout(
  44672. i.bind(
  44673. this,
  44674. Error(
  44675. "Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services"
  44676. )
  44677. ),
  44678. 0
  44679. );
  44680. });
  44681. },
  44682. r = (n.prototype = Object.create(
  44683. e.Builder.Service.prototype
  44684. )),
  44685. o = i.getChildren(e.Reflect.Service.RPCMethod),
  44686. a = 0;
  44687. a < o.length;
  44688. a++
  44689. )
  44690. !(function (e) {
  44691. (r[e.name] = function (n, r) {
  44692. try {
  44693. try {
  44694. n = e.resolvedRequestType.clazz.decode(
  44695. t.wrap(n)
  44696. );
  44697. } catch (e) {
  44698. if (!(e instanceof TypeError)) throw e;
  44699. }
  44700. if (null === n || "object" != typeof n)
  44701. throw Error("Illegal arguments");
  44702. n instanceof e.resolvedRequestType.clazz ||
  44703. (n = new e.resolvedRequestType.clazz(n)),
  44704. this.rpcImpl(e.fqn(), n, function (t, n) {
  44705. if (t) return void r(t);
  44706. null === n && (n = "");
  44707. try {
  44708. n =
  44709. e.resolvedResponseType.clazz.decode(n);
  44710. } catch (e) {}
  44711. return n &&
  44712. n instanceof e.resolvedResponseType.clazz
  44713. ? void r(null, n)
  44714. : void r(
  44715. Error(
  44716. "Illegal response type received in service method " +
  44717. i.name +
  44718. "#" +
  44719. e.name
  44720. )
  44721. );
  44722. });
  44723. } catch (e) {
  44724. setTimeout(r.bind(this, e), 0);
  44725. }
  44726. }),
  44727. (n[e.name] = function (t, i, r) {
  44728. new n(t)[e.name](i, r);
  44729. }),
  44730. Object.defineProperty &&
  44731. (Object.defineProperty(n[e.name], "$options", {
  44732. value: e.buildOpt(),
  44733. }),
  44734. Object.defineProperty(r[e.name], "$options", {
  44735. value: n[e.name].$options,
  44736. }));
  44737. })(o[a]);
  44738. return (
  44739. Object.defineProperty &&
  44740. (Object.defineProperty(n, "$options", {
  44741. value: i.buildOpt(),
  44742. }),
  44743. Object.defineProperty(r, "$options", {
  44744. value: n.$options,
  44745. }),
  44746. Object.defineProperty(n, "$type", {
  44747. value: i,
  44748. }),
  44749. Object.defineProperty(r, "$type", {
  44750. value: i,
  44751. })),
  44752. n
  44753. );
  44754. })(e, this));
  44755. }),
  44756. (o.Service = E);
  44757. var w = function (e, t, i, n) {
  44758. a.call(this, e, t, i),
  44759. (this.className = "Service.Method"),
  44760. (this.options = n || {});
  44761. },
  44762. _ = (w.prototype = Object.create(a.prototype));
  44763. (_.buildOpt = c.buildOpt), (o.Service.Method = w);
  44764. var T = function (e, t, i, n, r, o, a, s) {
  44765. w.call(this, e, t, i, s),
  44766. (this.className = "Service.RPCMethod"),
  44767. (this.requestName = n),
  44768. (this.responseName = r),
  44769. (this.requestStream = o),
  44770. (this.responseStream = a),
  44771. (this.resolvedRequestType = null),
  44772. (this.resolvedResponseType = null);
  44773. };
  44774. return (
  44775. (T.prototype = Object.create(w.prototype)),
  44776. (o.Service.RPCMethod = T),
  44777. o
  44778. );
  44779. })(r)),
  44780. (r.Builder = (function (t, i, n) {
  44781. function r(e) {
  44782. e.messages &&
  44783. e.messages.forEach(function (t) {
  44784. (t.syntax = e.syntax), r(t);
  44785. }),
  44786. e.enums &&
  44787. e.enums.forEach(function (t) {
  44788. t.syntax = e.syntax;
  44789. });
  44790. }
  44791. var o = function (e) {
  44792. (this.ns = new n.Namespace(this, null, "")),
  44793. (this.ptr = this.ns),
  44794. (this.resolved = !1),
  44795. (this.result = null),
  44796. (this.files = {}),
  44797. (this.importRoot = null),
  44798. (this.options = e || {});
  44799. },
  44800. a = o.prototype;
  44801. return (
  44802. (o.isMessage = function (e) {
  44803. return (
  44804. "string" == typeof e.name &&
  44805. "undefined" == typeof e.values &&
  44806. "undefined" == typeof e.rpc
  44807. );
  44808. }),
  44809. (o.isMessageField = function (e) {
  44810. return (
  44811. "string" == typeof e.rule &&
  44812. "string" == typeof e.name &&
  44813. "string" == typeof e.type &&
  44814. "undefined" != typeof e.id
  44815. );
  44816. }),
  44817. (o.isEnum = function (e) {
  44818. return (
  44819. "string" == typeof e.name &&
  44820. !(
  44821. "undefined" == typeof e.values ||
  44822. !Array.isArray(e.values) ||
  44823. 0 === e.values.length
  44824. )
  44825. );
  44826. }),
  44827. (o.isService = function (e) {
  44828. return !(
  44829. "string" != typeof e.name ||
  44830. "object" != typeof e.rpc ||
  44831. !e.rpc
  44832. );
  44833. }),
  44834. (o.isExtend = function (e) {
  44835. return "string" == typeof e.ref;
  44836. }),
  44837. (a.reset = function () {
  44838. return (this.ptr = this.ns), this;
  44839. }),
  44840. (a.define = function (e) {
  44841. if ("string" != typeof e || !i.TYPEREF.test(e))
  44842. throw Error("illegal namespace: " + e);
  44843. return (
  44844. e.split(".").forEach(function (e) {
  44845. var t = this.ptr.getChild(e);
  44846. null === t &&
  44847. this.ptr.addChild(
  44848. (t = new n.Namespace(this, this.ptr, e))
  44849. ),
  44850. (this.ptr = t);
  44851. }, this),
  44852. this
  44853. );
  44854. }),
  44855. (a.create = function (e) {
  44856. if (!e) return this;
  44857. if (Array.isArray(e)) {
  44858. if (0 === e.length) return this;
  44859. e = e.slice();
  44860. } else e = [e];
  44861. for (var i = [e]; i.length > 0; ) {
  44862. if (((e = i.pop()), !Array.isArray(e)))
  44863. throw Error(
  44864. "not a valid namespace: " + JSON.stringify(e)
  44865. );
  44866. for (; e.length > 0; ) {
  44867. var r = e.shift();
  44868. if (o.isMessage(r)) {
  44869. var a = new n.Message(
  44870. this,
  44871. this.ptr,
  44872. r.name,
  44873. r.options,
  44874. r.isGroup,
  44875. r.syntax
  44876. ),
  44877. s = {};
  44878. r.oneofs &&
  44879. Object.keys(r.oneofs).forEach(function (e) {
  44880. a.addChild(
  44881. (s[e] = new n.Message.OneOf(this, a, e))
  44882. );
  44883. }, this),
  44884. r.fields &&
  44885. r.fields.forEach(function (e) {
  44886. if (null !== a.getChild(0 | e.id))
  44887. throw Error(
  44888. "duplicate or invalid field id in " +
  44889. a.name +
  44890. ": " +
  44891. e.id
  44892. );
  44893. if (e.options && "object" != typeof e.options)
  44894. throw Error(
  44895. "illegal field options in " +
  44896. a.name +
  44897. "#" +
  44898. e.name
  44899. );
  44900. var t = null;
  44901. if (
  44902. "string" == typeof e.oneof &&
  44903. !(t = s[e.oneof])
  44904. )
  44905. throw Error(
  44906. "illegal oneof in " +
  44907. a.name +
  44908. "#" +
  44909. e.name +
  44910. ": " +
  44911. e.oneof
  44912. );
  44913. (e = new n.Message.Field(
  44914. this,
  44915. a,
  44916. e.rule,
  44917. e.keytype,
  44918. e.type,
  44919. e.name,
  44920. e.id,
  44921. e.options,
  44922. t,
  44923. r.syntax
  44924. )),
  44925. t && t.fields.push(e),
  44926. a.addChild(e);
  44927. }, this);
  44928. var l = [];
  44929. if (
  44930. (r.enums &&
  44931. r.enums.forEach(function (e) {
  44932. l.push(e);
  44933. }),
  44934. r.messages &&
  44935. r.messages.forEach(function (e) {
  44936. l.push(e);
  44937. }),
  44938. r.services &&
  44939. r.services.forEach(function (e) {
  44940. l.push(e);
  44941. }),
  44942. r.extensions &&
  44943. ("number" == typeof r.extensions[0]
  44944. ? (a.extensions = [r.extensions])
  44945. : (a.extensions = r.extensions)),
  44946. this.ptr.addChild(a),
  44947. l.length > 0)
  44948. ) {
  44949. i.push(e),
  44950. (e = l),
  44951. (l = null),
  44952. (this.ptr = a),
  44953. (a = null);
  44954. continue;
  44955. }
  44956. l = null;
  44957. } else if (o.isEnum(r))
  44958. (a = new n.Enum(
  44959. this,
  44960. this.ptr,
  44961. r.name,
  44962. r.options,
  44963. r.syntax
  44964. )),
  44965. r.values.forEach(function (e) {
  44966. a.addChild(
  44967. new n.Enum.Value(this, a, e.name, e.id)
  44968. );
  44969. }, this),
  44970. this.ptr.addChild(a);
  44971. else if (o.isService(r))
  44972. (a = new n.Service(
  44973. this,
  44974. this.ptr,
  44975. r.name,
  44976. r.options
  44977. )),
  44978. Object.keys(r.rpc).forEach(function (e) {
  44979. var t = r.rpc[e];
  44980. a.addChild(
  44981. new n.Service.RPCMethod(
  44982. this,
  44983. a,
  44984. e,
  44985. t.request,
  44986. t.response,
  44987. !!t.request_stream,
  44988. !!t.response_stream,
  44989. t.options
  44990. )
  44991. );
  44992. }, this),
  44993. this.ptr.addChild(a);
  44994. else {
  44995. if (!o.isExtend(r))
  44996. throw Error(
  44997. "not a valid definition: " + JSON.stringify(r)
  44998. );
  44999. if ((a = this.ptr.resolve(r.ref, !0)))
  45000. r.fields.forEach(function (e) {
  45001. if (null !== a.getChild(0 | e.id))
  45002. throw Error(
  45003. "duplicate extended field id in " +
  45004. a.name +
  45005. ": " +
  45006. e.id
  45007. );
  45008. if (a.extensions) {
  45009. var i = !1;
  45010. if (
  45011. (a.extensions.forEach(function (t) {
  45012. e.id >= t[0] && e.id <= t[1] && (i = !0);
  45013. }),
  45014. !i)
  45015. )
  45016. throw Error(
  45017. "illegal extended field id in " +
  45018. a.name +
  45019. ": " +
  45020. e.id +
  45021. " (not within valid ranges)"
  45022. );
  45023. }
  45024. var r = e.name;
  45025. this.options.convertFieldsToCamelCase &&
  45026. (r = t.Util.toCamelCase(r));
  45027. var o = new n.Message.ExtensionField(
  45028. this,
  45029. a,
  45030. e.rule,
  45031. e.type,
  45032. this.ptr.fqn() + "." + r,
  45033. e.id,
  45034. e.options
  45035. ),
  45036. s = new n.Extension(this, this.ptr, e.name, o);
  45037. (o.extension = s),
  45038. this.ptr.addChild(s),
  45039. a.addChild(o);
  45040. }, this);
  45041. else if (!/\.?google\.protobuf\./.test(r.ref))
  45042. throw Error(
  45043. "extended message " + r.ref + " is not defined"
  45044. );
  45045. }
  45046. (r = null), (a = null);
  45047. }
  45048. (e = null), (this.ptr = this.ptr.parent);
  45049. }
  45050. return (this.resolved = !1), (this.result = null), this;
  45051. }),
  45052. (a.import = function (i, n) {
  45053. var o = "/";
  45054. if ("string" == typeof n) {
  45055. if (
  45056. (t.Util.IS_NODE && (n = e("path").resolve(n)),
  45057. this.files[n] === !0)
  45058. )
  45059. return this.reset();
  45060. this.files[n] = !0;
  45061. } else if ("object" == typeof n) {
  45062. var a = n.root;
  45063. t.Util.IS_NODE && (a = e("path").resolve(a)),
  45064. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) &&
  45065. (o = "\\");
  45066. var s = a + o + n.file;
  45067. if (this.files[s] === !0) return this.reset();
  45068. this.files[s] = !0;
  45069. }
  45070. if (i.imports && i.imports.length > 0) {
  45071. var l,
  45072. c = !1;
  45073. "object" == typeof n
  45074. ? ((this.importRoot = n.root),
  45075. (c = !0),
  45076. (l = this.importRoot),
  45077. (n = n.file),
  45078. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) &&
  45079. (o = "\\"))
  45080. : "string" == typeof n
  45081. ? this.importRoot
  45082. ? (l = this.importRoot)
  45083. : n.indexOf("/") >= 0
  45084. ? ((l = n.replace(/\/[^\/]*$/, "")),
  45085. "" === l && (l = "/"))
  45086. : n.indexOf("\\") >= 0
  45087. ? ((l = n.replace(/\\[^\\]*$/, "")), (o = "\\"))
  45088. : (l = ".")
  45089. : (l = null);
  45090. for (var h = 0; h < i.imports.length; h++)
  45091. if ("string" == typeof i.imports[h]) {
  45092. if (!l) throw Error("cannot determine import root");
  45093. var u = i.imports[h];
  45094. if ("google/protobuf/descriptor.proto" === u)
  45095. continue;
  45096. if (((u = l + o + u), this.files[u] === !0)) continue;
  45097. /\.proto$/i.test(u) &&
  45098. !t.DotProto &&
  45099. (u = u.replace(/\.proto$/, ".json"));
  45100. var d = t.Util.fetch(u);
  45101. if (null === d)
  45102. throw Error(
  45103. "failed to import '" +
  45104. u +
  45105. "' in '" +
  45106. n +
  45107. "': file not found"
  45108. );
  45109. /\.json$/i.test(u)
  45110. ? this.import(JSON.parse(d + ""), u)
  45111. : this.import(t.DotProto.Parser.parse(d), u);
  45112. } else
  45113. n
  45114. ? /\.(\w+)$/.test(n)
  45115. ? this.import(
  45116. i.imports[h],
  45117. n.replace(
  45118. /^(.+)\.(\w+)$/,
  45119. function (e, t, i) {
  45120. return t + "_import" + h + "." + i;
  45121. }
  45122. )
  45123. )
  45124. : this.import(i.imports[h], n + "_import" + h)
  45125. : this.import(i.imports[h]);
  45126. c && (this.importRoot = null);
  45127. }
  45128. i.package && this.define(i.package), i.syntax && r(i);
  45129. var p = this.ptr;
  45130. return (
  45131. i.options &&
  45132. Object.keys(i.options).forEach(function (e) {
  45133. p.options[e] = i.options[e];
  45134. }),
  45135. i.messages && (this.create(i.messages), (this.ptr = p)),
  45136. i.enums && (this.create(i.enums), (this.ptr = p)),
  45137. i.services && (this.create(i.services), (this.ptr = p)),
  45138. i.extends && this.create(i.extends),
  45139. this.reset()
  45140. );
  45141. }),
  45142. (a.resolveAll = function () {
  45143. var e;
  45144. if (null == this.ptr || "object" == typeof this.ptr.type)
  45145. return this;
  45146. if (this.ptr instanceof n.Namespace)
  45147. this.ptr.children.forEach(function (e) {
  45148. (this.ptr = e), this.resolveAll();
  45149. }, this);
  45150. else if (this.ptr instanceof n.Message.Field) {
  45151. if (i.TYPE.test(this.ptr.type))
  45152. this.ptr.type = t.TYPES[this.ptr.type];
  45153. else {
  45154. if (!i.TYPEREF.test(this.ptr.type))
  45155. throw Error(
  45156. "illegal type reference in " +
  45157. this.ptr.toString(!0) +
  45158. ": " +
  45159. this.ptr.type
  45160. );
  45161. if (
  45162. ((e = (
  45163. this.ptr instanceof n.Message.ExtensionField
  45164. ? this.ptr.extension.parent
  45165. : this.ptr.parent
  45166. ).resolve(this.ptr.type, !0)),
  45167. !e)
  45168. )
  45169. throw Error(
  45170. "unresolvable type reference in " +
  45171. this.ptr.toString(!0) +
  45172. ": " +
  45173. this.ptr.type
  45174. );
  45175. if (
  45176. ((this.ptr.resolvedType = e), e instanceof n.Enum)
  45177. ) {
  45178. if (
  45179. ((this.ptr.type = t.TYPES.enum),
  45180. "proto3" === this.ptr.syntax &&
  45181. "proto3" !== e.syntax)
  45182. )
  45183. throw Error(
  45184. "proto3 message cannot reference proto2 enum"
  45185. );
  45186. } else {
  45187. if (!(e instanceof n.Message))
  45188. throw Error(
  45189. "illegal type reference in " +
  45190. this.ptr.toString(!0) +
  45191. ": " +
  45192. this.ptr.type
  45193. );
  45194. this.ptr.type = e.isGroup
  45195. ? t.TYPES.group
  45196. : t.TYPES.message;
  45197. }
  45198. }
  45199. if (this.ptr.map) {
  45200. if (!i.TYPE.test(this.ptr.keyType))
  45201. throw Error(
  45202. "illegal key type for map field in " +
  45203. this.ptr.toString(!0) +
  45204. ": " +
  45205. this.ptr.keyType
  45206. );
  45207. this.ptr.keyType = t.TYPES[this.ptr.keyType];
  45208. }
  45209. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  45210. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  45211. throw Error(
  45212. "illegal service type in " + this.ptr.toString(!0)
  45213. );
  45214. if (
  45215. ((e = this.ptr.parent.resolve(
  45216. this.ptr.requestName,
  45217. !0
  45218. )),
  45219. !(e && e instanceof t.Reflect.Message))
  45220. )
  45221. throw Error(
  45222. "Illegal type reference in " +
  45223. this.ptr.toString(!0) +
  45224. ": " +
  45225. this.ptr.requestName
  45226. );
  45227. if (
  45228. ((this.ptr.resolvedRequestType = e),
  45229. (e = this.ptr.parent.resolve(
  45230. this.ptr.responseName,
  45231. !0
  45232. )),
  45233. !(e && e instanceof t.Reflect.Message))
  45234. )
  45235. throw Error(
  45236. "Illegal type reference in " +
  45237. this.ptr.toString(!0) +
  45238. ": " +
  45239. this.ptr.responseName
  45240. );
  45241. this.ptr.resolvedResponseType = e;
  45242. } else if (
  45243. !(
  45244. this.ptr instanceof t.Reflect.Message.OneOf ||
  45245. this.ptr instanceof t.Reflect.Extension ||
  45246. this.ptr instanceof t.Reflect.Enum.Value
  45247. )
  45248. )
  45249. throw Error(
  45250. "illegal object in namespace: " +
  45251. typeof this.ptr +
  45252. ": " +
  45253. this.ptr
  45254. );
  45255. return this.reset();
  45256. }),
  45257. (a.build = function (e) {
  45258. if (
  45259. (this.reset(),
  45260. this.resolved ||
  45261. (this.resolveAll(),
  45262. (this.resolved = !0),
  45263. (this.result = null)),
  45264. null === this.result && (this.result = this.ns.build()),
  45265. !e)
  45266. )
  45267. return this.result;
  45268. for (
  45269. var t = "string" == typeof e ? e.split(".") : e,
  45270. i = this.result,
  45271. n = 0;
  45272. n < t.length;
  45273. n++
  45274. ) {
  45275. if (!i[t[n]]) {
  45276. i = null;
  45277. break;
  45278. }
  45279. i = i[t[n]];
  45280. }
  45281. return i;
  45282. }),
  45283. (a.lookup = function (e, t) {
  45284. return e ? this.ns.resolve(e, t) : this.ns;
  45285. }),
  45286. (a.toString = function () {
  45287. return "Builder";
  45288. }),
  45289. (o.Message = function () {}),
  45290. (o.Enum = function () {}),
  45291. (o.Service = function () {}),
  45292. o
  45293. );
  45294. })(r, r.Lang, r.Reflect)),
  45295. (r.Map = (function (e, t) {
  45296. function i(e) {
  45297. var t = 0;
  45298. return {
  45299. next: function () {
  45300. return t < e.length
  45301. ? {
  45302. done: !1,
  45303. value: e[t++],
  45304. }
  45305. : {
  45306. done: !0,
  45307. };
  45308. },
  45309. };
  45310. }
  45311. var n = function (e, i) {
  45312. if (!e.map) throw Error("field is not a map");
  45313. if (
  45314. ((this.field = e),
  45315. (this.keyElem = new t.Element(
  45316. e.keyType,
  45317. null,
  45318. !0,
  45319. e.syntax
  45320. )),
  45321. (this.valueElem = new t.Element(
  45322. e.type,
  45323. e.resolvedType,
  45324. !1,
  45325. e.syntax
  45326. )),
  45327. (this.map = {}),
  45328. Object.defineProperty(this, "size", {
  45329. get: function () {
  45330. return Object.keys(this.map).length;
  45331. },
  45332. }),
  45333. i)
  45334. )
  45335. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  45336. var o = this.keyElem.valueFromString(n[r]),
  45337. a = this.valueElem.verifyValue(i[n[r]]);
  45338. this.map[this.keyElem.valueToString(o)] = {
  45339. key: o,
  45340. value: a,
  45341. };
  45342. }
  45343. },
  45344. r = n.prototype;
  45345. return (
  45346. (r.clear = function () {
  45347. this.map = {};
  45348. }),
  45349. (r.delete = function (e) {
  45350. var t = this.keyElem.valueToString(
  45351. this.keyElem.verifyValue(e)
  45352. ),
  45353. i = t in this.map;
  45354. return delete this.map[t], i;
  45355. }),
  45356. (r.entries = function () {
  45357. for (
  45358. var e, t = [], n = Object.keys(this.map), r = 0;
  45359. r < n.length;
  45360. r++
  45361. )
  45362. t.push([(e = this.map[n[r]]).key, e.value]);
  45363. return i(t);
  45364. }),
  45365. (r.keys = function () {
  45366. for (
  45367. var e = [], t = Object.keys(this.map), n = 0;
  45368. n < t.length;
  45369. n++
  45370. )
  45371. e.push(this.map[t[n]].key);
  45372. return i(e);
  45373. }),
  45374. (r.values = function () {
  45375. for (
  45376. var e = [], t = Object.keys(this.map), n = 0;
  45377. n < t.length;
  45378. n++
  45379. )
  45380. e.push(this.map[t[n]].value);
  45381. return i(e);
  45382. }),
  45383. (r.forEach = function (e, t) {
  45384. for (
  45385. var i, n = Object.keys(this.map), r = 0;
  45386. r < n.length;
  45387. r++
  45388. )
  45389. e.call(t, (i = this.map[n[r]]).value, i.key, this);
  45390. }),
  45391. (r.set = function (e, t) {
  45392. var i = this.keyElem.verifyValue(e),
  45393. n = this.valueElem.verifyValue(t);
  45394. return (
  45395. (this.map[this.keyElem.valueToString(i)] = {
  45396. key: i,
  45397. value: n,
  45398. }),
  45399. this
  45400. );
  45401. }),
  45402. (r.get = function (e) {
  45403. var t = this.keyElem.valueToString(
  45404. this.keyElem.verifyValue(e)
  45405. );
  45406. if (t in this.map) return this.map[t].value;
  45407. }),
  45408. (r.has = function (e) {
  45409. var t = this.keyElem.valueToString(
  45410. this.keyElem.verifyValue(e)
  45411. );
  45412. return t in this.map;
  45413. }),
  45414. n
  45415. );
  45416. })(r, r.Reflect)),
  45417. (r.loadProto = function (e, t, i) {
  45418. return (
  45419. ("string" == typeof t ||
  45420. (t &&
  45421. "string" == typeof t.file &&
  45422. "string" == typeof t.root)) &&
  45423. ((i = t), (t = void 0)),
  45424. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  45425. );
  45426. }),
  45427. (r.protoFromString = r.loadProto),
  45428. (r.loadProtoFile = function (e, t, i) {
  45429. if (
  45430. (t && "object" == typeof t
  45431. ? ((i = t), (t = null))
  45432. : (t && "function" == typeof t) || (t = null),
  45433. t)
  45434. )
  45435. return r.Util.fetch(
  45436. "string" == typeof e ? e : e.root + "/" + e.file,
  45437. function (n) {
  45438. if (null === n)
  45439. return void t(Error("Failed to fetch file"));
  45440. try {
  45441. t(null, r.loadProto(n, i, e));
  45442. } catch (e) {
  45443. t(e);
  45444. }
  45445. }
  45446. );
  45447. var n = r.Util.fetch(
  45448. "object" == typeof e ? e.root + "/" + e.file : e
  45449. );
  45450. return null === n ? null : r.loadProto(n, i, e);
  45451. }),
  45452. (r.protoFromFile = r.loadProtoFile),
  45453. (r.newBuilder = function (e) {
  45454. return (
  45455. (e = e || {}),
  45456. "undefined" == typeof e.convertFieldsToCamelCase &&
  45457. (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  45458. "undefined" == typeof e.populateAccessors &&
  45459. (e.populateAccessors = r.populateAccessors),
  45460. new r.Builder(e)
  45461. );
  45462. }),
  45463. (r.loadJson = function (e, t, i) {
  45464. return (
  45465. ("string" == typeof t ||
  45466. (t &&
  45467. "string" == typeof t.file &&
  45468. "string" == typeof t.root)) &&
  45469. ((i = t), (t = null)),
  45470. (t && "object" == typeof t) || (t = r.newBuilder()),
  45471. "string" == typeof e && (e = JSON.parse(e)),
  45472. t.import(e, i),
  45473. t.resolveAll(),
  45474. t
  45475. );
  45476. }),
  45477. (r.loadJsonFile = function (e, t, i) {
  45478. if (
  45479. (t && "object" == typeof t
  45480. ? ((i = t), (t = null))
  45481. : (t && "function" == typeof t) || (t = null),
  45482. t)
  45483. )
  45484. return r.Util.fetch(
  45485. "string" == typeof e ? e : e.root + "/" + e.file,
  45486. function (n) {
  45487. if (null === n)
  45488. return void t(Error("Failed to fetch file"));
  45489. try {
  45490. t(null, r.loadJson(JSON.parse(n), i, e));
  45491. } catch (e) {
  45492. t(e);
  45493. }
  45494. }
  45495. );
  45496. var n = r.Util.fetch(
  45497. "object" == typeof e ? e.root + "/" + e.file : e
  45498. );
  45499. return null === n ? null : r.loadJson(JSON.parse(n), i, e);
  45500. }),
  45501. r
  45502. );
  45503. });
  45504. }).call(this, e("_process"));
  45505. },
  45506. {
  45507. _process: 203,
  45508. bytebuffer: 215,
  45509. fs: 197,
  45510. path: 197,
  45511. },
  45512. ],
  45513. 215: [
  45514. function (e, t, i) {
  45515. !(function (i, n) {
  45516. "function" == typeof define && define.amd
  45517. ? define(["long"], n)
  45518. : "function" == typeof e && "object" == typeof t && t && t.exports
  45519. ? (t.exports = (function () {
  45520. var t;
  45521. try {
  45522. t = e("long");
  45523. } catch (e) {}
  45524. return n(t);
  45525. })())
  45526. : ((i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long));
  45527. })(this, function (e) {
  45528. "use strict";
  45529. function t(e) {
  45530. var t = 0;
  45531. return function () {
  45532. return t < e.length ? e.charCodeAt(t++) : null;
  45533. };
  45534. }
  45535. function i() {
  45536. var e = [],
  45537. t = [];
  45538. return function () {
  45539. return 0 === arguments.length
  45540. ? t.join("") + l.apply(String, e)
  45541. : (e.length + arguments.length > 1024 &&
  45542. (t.push(l.apply(String, e)), (e.length = 0)),
  45543. void Array.prototype.push.apply(e, arguments));
  45544. };
  45545. }
  45546. function n(e, t, i, n, r) {
  45547. var o,
  45548. a,
  45549. s = 8 * r - n - 1,
  45550. l = (1 << s) - 1,
  45551. c = l >> 1,
  45552. h = -7,
  45553. u = i ? r - 1 : 0,
  45554. d = i ? -1 : 1,
  45555. p = e[t + u];
  45556. for (
  45557. u += d, o = p & ((1 << -h) - 1), p >>= -h, h += s;
  45558. h > 0;
  45559. o = 256 * o + e[t + u], u += d, h -= 8
  45560. );
  45561. for (
  45562. a = o & ((1 << -h) - 1), o >>= -h, h += n;
  45563. h > 0;
  45564. a = 256 * a + e[t + u], u += d, h -= 8
  45565. );
  45566. if (0 === o) o = 1 - c;
  45567. else {
  45568. if (o === l) return a ? NaN : (p ? -1 : 1) * (1 / 0);
  45569. (a += Math.pow(2, n)), (o -= c);
  45570. }
  45571. return (p ? -1 : 1) * a * Math.pow(2, o - n);
  45572. }
  45573. function r(e, t, i, n, r, o) {
  45574. var a,
  45575. s,
  45576. l,
  45577. c = 8 * o - r - 1,
  45578. h = (1 << c) - 1,
  45579. u = h >> 1,
  45580. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  45581. p = n ? 0 : o - 1,
  45582. f = n ? 1 : -1,
  45583. g = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0;
  45584. for (
  45585. t = Math.abs(t),
  45586. isNaN(t) || t === 1 / 0
  45587. ? ((s = isNaN(t) ? 1 : 0), (a = h))
  45588. : ((a = Math.floor(Math.log(t) / Math.LN2)),
  45589. t * (l = Math.pow(2, -a)) < 1 && (a--, (l *= 2)),
  45590. (t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u)),
  45591. t * l >= 2 && (a++, (l /= 2)),
  45592. a + u >= h
  45593. ? ((s = 0), (a = h))
  45594. : a + u >= 1
  45595. ? ((s = (t * l - 1) * Math.pow(2, r)), (a += u))
  45596. : ((s = t * Math.pow(2, u - 1) * Math.pow(2, r)),
  45597. (a = 0)));
  45598. r >= 8;
  45599. e[i + p] = 255 & s, p += f, s /= 256, r -= 8
  45600. );
  45601. for (
  45602. a = (a << r) | s, c += r;
  45603. c > 0;
  45604. e[i + p] = 255 & a, p += f, a /= 256, c -= 8
  45605. );
  45606. e[i + p - f] |= 128 * g;
  45607. }
  45608. var o = function (e, t, i) {
  45609. if (
  45610. ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  45611. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  45612. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  45613. !i)
  45614. ) {
  45615. if (((e |= 0), e < 0)) throw RangeError("Illegal capacity");
  45616. (t = !!t), (i = !!i);
  45617. }
  45618. (this.buffer = 0 === e ? s : new ArrayBuffer(e)),
  45619. (this.view = 0 === e ? null : new Uint8Array(this.buffer)),
  45620. (this.offset = 0),
  45621. (this.markedOffset = -1),
  45622. (this.limit = e),
  45623. (this.littleEndian = t),
  45624. (this.noAssert = i);
  45625. };
  45626. (o.VERSION = "5.0.1"),
  45627. (o.LITTLE_ENDIAN = !0),
  45628. (o.BIG_ENDIAN = !1),
  45629. (o.DEFAULT_CAPACITY = 16),
  45630. (o.DEFAULT_ENDIAN = o.BIG_ENDIAN),
  45631. (o.DEFAULT_NOASSERT = !1),
  45632. (o.Long = e || null);
  45633. var a = o.prototype;
  45634. a.__isByteBuffer__,
  45635. Object.defineProperty(a, "__isByteBuffer__", {
  45636. value: !0,
  45637. enumerable: !1,
  45638. configurable: !1,
  45639. });
  45640. var s = new ArrayBuffer(0),
  45641. l = String.fromCharCode;
  45642. (o.accessor = function () {
  45643. return Uint8Array;
  45644. }),
  45645. (o.allocate = function (e, t, i) {
  45646. return new o(e, t, i);
  45647. }),
  45648. (o.concat = function (e, t, i, n) {
  45649. ("boolean" != typeof t && "string" == typeof t) ||
  45650. ((n = i), (i = t), (t = void 0));
  45651. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  45652. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  45653. (r = e[s].limit - e[s].offset),
  45654. r > 0 && (a += r);
  45655. if (0 === a) return new o(0, i, n);
  45656. var c,
  45657. h = new o(a, i, n);
  45658. for (s = 0; s < l; )
  45659. (c = e[s++]),
  45660. (r = c.limit - c.offset),
  45661. r <= 0 ||
  45662. (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  45663. (h.offset += r));
  45664. return (h.limit = h.offset), (h.offset = 0), h;
  45665. }),
  45666. (o.isByteBuffer = function (e) {
  45667. return (e && e.__isByteBuffer__) === !0;
  45668. }),
  45669. (o.type = function () {
  45670. return ArrayBuffer;
  45671. }),
  45672. (o.wrap = function (e, t, i, n) {
  45673. if (
  45674. ("string" != typeof t && ((n = i), (i = t), (t = void 0)),
  45675. "string" == typeof e)
  45676. )
  45677. switch (("undefined" == typeof t && (t = "utf8"), t)) {
  45678. case "base64":
  45679. return o.fromBase64(e, i);
  45680. case "hex":
  45681. return o.fromHex(e, i);
  45682. case "binary":
  45683. return o.fromBinary(e, i);
  45684. case "utf8":
  45685. return o.fromUTF8(e, i);
  45686. case "debug":
  45687. return o.fromDebug(e, i);
  45688. default:
  45689. throw Error("Unsupported encoding: " + t);
  45690. }
  45691. if (null === e || "object" != typeof e)
  45692. throw TypeError("Illegal buffer");
  45693. var r;
  45694. if (o.isByteBuffer(e))
  45695. return (r = a.clone.call(e)), (r.markedOffset = -1), r;
  45696. if (e instanceof Uint8Array)
  45697. (r = new o(0, i, n)),
  45698. e.length > 0 &&
  45699. ((r.buffer = e.buffer),
  45700. (r.offset = e.byteOffset),
  45701. (r.limit = e.byteOffset + e.byteLength),
  45702. (r.view = new Uint8Array(e.buffer)));
  45703. else if (e instanceof ArrayBuffer)
  45704. (r = new o(0, i, n)),
  45705. e.byteLength > 0 &&
  45706. ((r.buffer = e),
  45707. (r.offset = 0),
  45708. (r.limit = e.byteLength),
  45709. (r.view = e.byteLength > 0 ? new Uint8Array(e) : null));
  45710. else {
  45711. if ("[object Array]" !== Object.prototype.toString.call(e))
  45712. throw TypeError("Illegal buffer");
  45713. (r = new o(e.length, i, n)), (r.limit = e.length);
  45714. for (var s = 0; s < e.length; ++s) r.view[s] = e[s];
  45715. }
  45716. return r;
  45717. }),
  45718. (a.writeBitSet = function (e, t) {
  45719. var i = "undefined" == typeof t;
  45720. if ((i && (t = this.offset), !this.noAssert)) {
  45721. if (!(e instanceof Array))
  45722. throw TypeError("Illegal BitSet: Not an array");
  45723. if ("number" != typeof t || t % 1 !== 0)
  45724. throw TypeError("Illegal offset: " + t + " (not an integer)");
  45725. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  45726. throw RangeError(
  45727. "Illegal offset: 0 <= " +
  45728. t +
  45729. " (+0) <= " +
  45730. this.buffer.byteLength
  45731. );
  45732. }
  45733. var n,
  45734. r = t,
  45735. o = e.length,
  45736. a = o >> 3,
  45737. s = 0;
  45738. for (t += this.writeVarint32(o, t); a--; )
  45739. (n =
  45740. (1 & !!e[s++]) |
  45741. ((1 & !!e[s++]) << 1) |
  45742. ((1 & !!e[s++]) << 2) |
  45743. ((1 & !!e[s++]) << 3) |
  45744. ((1 & !!e[s++]) << 4) |
  45745. ((1 & !!e[s++]) << 5) |
  45746. ((1 & !!e[s++]) << 6) |
  45747. ((1 & !!e[s++]) << 7)),
  45748. this.writeByte(n, t++);
  45749. if (s < o) {
  45750. var l = 0;
  45751. for (n = 0; s < o; ) n |= (1 & !!e[s++]) << l++;
  45752. this.writeByte(n, t++);
  45753. }
  45754. return i ? ((this.offset = t), this) : t - r;
  45755. }),
  45756. (a.readBitSet = function (e) {
  45757. var t = "undefined" == typeof e;
  45758. t && (e = this.offset);
  45759. var i,
  45760. n = this.readVarint32(e),
  45761. r = n.value,
  45762. o = r >> 3,
  45763. a = 0,
  45764. s = [];
  45765. for (e += n.length; o--; )
  45766. (i = this.readByte(e++)),
  45767. (s[a++] = !!(1 & i)),
  45768. (s[a++] = !!(2 & i)),
  45769. (s[a++] = !!(4 & i)),
  45770. (s[a++] = !!(8 & i)),
  45771. (s[a++] = !!(16 & i)),
  45772. (s[a++] = !!(32 & i)),
  45773. (s[a++] = !!(64 & i)),
  45774. (s[a++] = !!(128 & i));
  45775. if (a < r) {
  45776. var l = 0;
  45777. for (i = this.readByte(e++); a < r; )
  45778. s[a++] = !!((i >> l++) & 1);
  45779. }
  45780. return t && (this.offset = e), s;
  45781. }),
  45782. (a.readBytes = function (e, t) {
  45783. var i = "undefined" == typeof t;
  45784. if ((i && (t = this.offset), !this.noAssert)) {
  45785. if ("number" != typeof t || t % 1 !== 0)
  45786. throw TypeError("Illegal offset: " + t + " (not an integer)");
  45787. if (((t >>>= 0), t < 0 || t + e > this.buffer.byteLength))
  45788. throw RangeError(
  45789. "Illegal offset: 0 <= " +
  45790. t +
  45791. " (+" +
  45792. e +
  45793. ") <= " +
  45794. this.buffer.byteLength
  45795. );
  45796. }
  45797. var n = this.slice(t, t + e);
  45798. return i && (this.offset += e), n;
  45799. }),
  45800. (a.writeBytes = a.append),
  45801. (a.writeInt8 = function (e, t) {
  45802. var i = "undefined" == typeof t;
  45803. if ((i && (t = this.offset), !this.noAssert)) {
  45804. if ("number" != typeof e || e % 1 !== 0)
  45805. throw TypeError("Illegal value: " + e + " (not an integer)");
  45806. if (((e |= 0), "number" != typeof t || t % 1 !== 0))
  45807. throw TypeError("Illegal offset: " + t + " (not an integer)");
  45808. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  45809. throw RangeError(
  45810. "Illegal offset: 0 <= " +
  45811. t +
  45812. " (+0) <= " +
  45813. this.buffer.byteLength
  45814. );
  45815. }
  45816. t += 1;
  45817. var n = this.buffer.byteLength;
  45818. return (
  45819. t > n && this.resize((n *= 2) > t ? n : t),
  45820. (t -= 1),
  45821. (this.view[t] = e),
  45822. i && (this.offset += 1),
  45823. this
  45824. );
  45825. }),
  45826. (a.writeByte = a.writeInt8),
  45827. (a.readInt8 = function (e) {
  45828. var t = "undefined" == typeof e;
  45829. if ((t && (e = this.offset), !this.noAssert)) {
  45830. if ("number" != typeof e || e % 1 !== 0)
  45831. throw TypeError("Illegal offset: " + e + " (not an integer)");
  45832. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  45833. throw RangeError(
  45834. "Illegal offset: 0 <= " +
  45835. e +
  45836. " (+1) <= " +
  45837. this.buffer.byteLength
  45838. );
  45839. }
  45840. var i = this.view[e];
  45841. return (
  45842. 128 === (128 & i) && (i = -(255 - i + 1)),
  45843. t && (this.offset += 1),
  45844. i
  45845. );
  45846. }),
  45847. (a.readByte = a.readInt8),
  45848. (a.writeUint8 = function (e, t) {
  45849. var i = "undefined" == typeof t;
  45850. if ((i && (t = this.offset), !this.noAssert)) {
  45851. if ("number" != typeof e || e % 1 !== 0)
  45852. throw TypeError("Illegal value: " + e + " (not an integer)");
  45853. if (((e >>>= 0), "number" != typeof t || t % 1 !== 0))
  45854. throw TypeError("Illegal offset: " + t + " (not an integer)");
  45855. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  45856. throw RangeError(
  45857. "Illegal offset: 0 <= " +
  45858. t +
  45859. " (+0) <= " +
  45860. this.buffer.byteLength
  45861. );
  45862. }
  45863. t += 1;
  45864. var n = this.buffer.byteLength;
  45865. return (
  45866. t > n && this.resize((n *= 2) > t ? n : t),
  45867. (t -= 1),
  45868. (this.view[t] = e),
  45869. i && (this.offset += 1),
  45870. this
  45871. );
  45872. }),
  45873. (a.writeUInt8 = a.writeUint8),
  45874. (a.readUint8 = function (e) {
  45875. var t = "undefined" == typeof e;
  45876. if ((t && (e = this.offset), !this.noAssert)) {
  45877. if ("number" != typeof e || e % 1 !== 0)
  45878. throw TypeError("Illegal offset: " + e + " (not an integer)");
  45879. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  45880. throw RangeError(
  45881. "Illegal offset: 0 <= " +
  45882. e +
  45883. " (+1) <= " +
  45884. this.buffer.byteLength
  45885. );
  45886. }
  45887. var i = this.view[e];
  45888. return t && (this.offset += 1), i;
  45889. }),
  45890. (a.readUInt8 = a.readUint8),
  45891. (a.writeInt16 = function (e, t) {
  45892. var i = "undefined" == typeof t;
  45893. if ((i && (t = this.offset), !this.noAssert)) {
  45894. if ("number" != typeof e || e % 1 !== 0)
  45895. throw TypeError("Illegal value: " + e + " (not an integer)");
  45896. if (((e |= 0), "number" != typeof t || t % 1 !== 0))
  45897. throw TypeError("Illegal offset: " + t + " (not an integer)");
  45898. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  45899. throw RangeError(
  45900. "Illegal offset: 0 <= " +
  45901. t +
  45902. " (+0) <= " +
  45903. this.buffer.byteLength
  45904. );
  45905. }
  45906. t += 2;
  45907. var n = this.buffer.byteLength;
  45908. return (
  45909. t > n && this.resize((n *= 2) > t ? n : t),
  45910. (t -= 2),
  45911. this.littleEndian
  45912. ? ((this.view[t + 1] = (65280 & e) >>> 8),
  45913. (this.view[t] = 255 & e))
  45914. : ((this.view[t] = (65280 & e) >>> 8),
  45915. (this.view[t + 1] = 255 & e)),
  45916. i && (this.offset += 2),
  45917. this
  45918. );
  45919. }),
  45920. (a.writeShort = a.writeInt16),
  45921. (a.readInt16 = function (e) {
  45922. var t = "undefined" == typeof e;
  45923. if ((t && (e = this.offset), !this.noAssert)) {
  45924. if ("number" != typeof e || e % 1 !== 0)
  45925. throw TypeError("Illegal offset: " + e + " (not an integer)");
  45926. if (((e >>>= 0), e < 0 || e + 2 > this.buffer.byteLength))
  45927. throw RangeError(
  45928. "Illegal offset: 0 <= " +
  45929. e +
  45930. " (+2) <= " +
  45931. this.buffer.byteLength
  45932. );
  45933. }
  45934. var i = 0;
  45935. return (
  45936. this.littleEndian
  45937. ? ((i = this.view[e]), (i |= this.view[e + 1] << 8))
  45938. : ((i = this.view[e] << 8), (i |= this.view[e + 1])),
  45939. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  45940. t && (this.offset += 2),
  45941. i
  45942. );
  45943. }),
  45944. (a.readShort = a.readInt16),
  45945. (a.writeUint16 = function (e, t) {
  45946. var i = "undefined" == typeof t;
  45947. if ((i && (t = this.offset), !this.noAssert)) {
  45948. if ("number" != typeof e || e % 1 !== 0)
  45949. throw TypeError("Illegal value: " + e + " (not an integer)");
  45950. if (((e >>>= 0), "number" != typeof t || t % 1 !== 0))
  45951. throw TypeError("Illegal offset: " + t + " (not an integer)");
  45952. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  45953. throw RangeError(
  45954. "Illegal offset: 0 <= " +
  45955. t +
  45956. " (+0) <= " +
  45957. this.buffer.byteLength
  45958. );
  45959. }
  45960. t += 2;
  45961. var n = this.buffer.byteLength;
  45962. return (
  45963. t > n && this.resize((n *= 2) > t ? n : t),
  45964. (t -= 2),
  45965. this.littleEndian
  45966. ? ((this.view[t + 1] = (65280 & e) >>> 8),
  45967. (this.view[t] = 255 & e))
  45968. : ((this.view[t] = (65280 & e) >>> 8),
  45969. (this.view[t + 1] = 255 & e)),
  45970. i && (this.offset += 2),
  45971. this
  45972. );
  45973. }),
  45974. (a.writeUInt16 = a.writeUint16),
  45975. (a.readUint16 = function (e) {
  45976. var t = "undefined" == typeof e;
  45977. if ((t && (e = this.offset), !this.noAssert)) {
  45978. if ("number" != typeof e || e % 1 !== 0)
  45979. throw TypeError("Illegal offset: " + e + " (not an integer)");
  45980. if (((e >>>= 0), e < 0 || e + 2 > this.buffer.byteLength))
  45981. throw RangeError(
  45982. "Illegal offset: 0 <= " +
  45983. e +
  45984. " (+2) <= " +
  45985. this.buffer.byteLength
  45986. );
  45987. }
  45988. var i = 0;
  45989. return (
  45990. this.littleEndian
  45991. ? ((i = this.view[e]), (i |= this.view[e + 1] << 8))
  45992. : ((i = this.view[e] << 8), (i |= this.view[e + 1])),
  45993. t && (this.offset += 2),
  45994. i
  45995. );
  45996. }),
  45997. (a.readUInt16 = a.readUint16),
  45998. (a.writeInt32 = function (e, t) {
  45999. var i = "undefined" == typeof t;
  46000. if ((i && (t = this.offset), !this.noAssert)) {
  46001. if ("number" != typeof e || e % 1 !== 0)
  46002. throw TypeError("Illegal value: " + e + " (not an integer)");
  46003. if (((e |= 0), "number" != typeof t || t % 1 !== 0))
  46004. throw TypeError("Illegal offset: " + t + " (not an integer)");
  46005. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  46006. throw RangeError(
  46007. "Illegal offset: 0 <= " +
  46008. t +
  46009. " (+0) <= " +
  46010. this.buffer.byteLength
  46011. );
  46012. }
  46013. t += 4;
  46014. var n = this.buffer.byteLength;
  46015. return (
  46016. t > n && this.resize((n *= 2) > t ? n : t),
  46017. (t -= 4),
  46018. this.littleEndian
  46019. ? ((this.view[t + 3] = (e >>> 24) & 255),
  46020. (this.view[t + 2] = (e >>> 16) & 255),
  46021. (this.view[t + 1] = (e >>> 8) & 255),
  46022. (this.view[t] = 255 & e))
  46023. : ((this.view[t] = (e >>> 24) & 255),
  46024. (this.view[t + 1] = (e >>> 16) & 255),
  46025. (this.view[t + 2] = (e >>> 8) & 255),
  46026. (this.view[t + 3] = 255 & e)),
  46027. i && (this.offset += 4),
  46028. this
  46029. );
  46030. }),
  46031. (a.writeInt = a.writeInt32),
  46032. (a.readInt32 = function (e) {
  46033. var t = "undefined" == typeof e;
  46034. if ((t && (e = this.offset), !this.noAssert)) {
  46035. if ("number" != typeof e || e % 1 !== 0)
  46036. throw TypeError("Illegal offset: " + e + " (not an integer)");
  46037. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  46038. throw RangeError(
  46039. "Illegal offset: 0 <= " +
  46040. e +
  46041. " (+4) <= " +
  46042. this.buffer.byteLength
  46043. );
  46044. }
  46045. var i = 0;
  46046. return (
  46047. this.littleEndian
  46048. ? ((i = this.view[e + 2] << 16),
  46049. (i |= this.view[e + 1] << 8),
  46050. (i |= this.view[e]),
  46051. (i += (this.view[e + 3] << 24) >>> 0))
  46052. : ((i = this.view[e + 1] << 16),
  46053. (i |= this.view[e + 2] << 8),
  46054. (i |= this.view[e + 3]),
  46055. (i += (this.view[e] << 24) >>> 0)),
  46056. (i |= 0),
  46057. t && (this.offset += 4),
  46058. i
  46059. );
  46060. }),
  46061. (a.readInt = a.readInt32),
  46062. (a.writeUint32 = function (e, t) {
  46063. var i = "undefined" == typeof t;
  46064. if ((i && (t = this.offset), !this.noAssert)) {
  46065. if ("number" != typeof e || e % 1 !== 0)
  46066. throw TypeError("Illegal value: " + e + " (not an integer)");
  46067. if (((e >>>= 0), "number" != typeof t || t % 1 !== 0))
  46068. throw TypeError("Illegal offset: " + t + " (not an integer)");
  46069. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  46070. throw RangeError(
  46071. "Illegal offset: 0 <= " +
  46072. t +
  46073. " (+0) <= " +
  46074. this.buffer.byteLength
  46075. );
  46076. }
  46077. t += 4;
  46078. var n = this.buffer.byteLength;
  46079. return (
  46080. t > n && this.resize((n *= 2) > t ? n : t),
  46081. (t -= 4),
  46082. this.littleEndian
  46083. ? ((this.view[t + 3] = (e >>> 24) & 255),
  46084. (this.view[t + 2] = (e >>> 16) & 255),
  46085. (this.view[t + 1] = (e >>> 8) & 255),
  46086. (this.view[t] = 255 & e))
  46087. : ((this.view[t] = (e >>> 24) & 255),
  46088. (this.view[t + 1] = (e >>> 16) & 255),
  46089. (this.view[t + 2] = (e >>> 8) & 255),
  46090. (this.view[t + 3] = 255 & e)),
  46091. i && (this.offset += 4),
  46092. this
  46093. );
  46094. }),
  46095. (a.writeUInt32 = a.writeUint32),
  46096. (a.readUint32 = function (e) {
  46097. var t = "undefined" == typeof e;
  46098. if ((t && (e = this.offset), !this.noAssert)) {
  46099. if ("number" != typeof e || e % 1 !== 0)
  46100. throw TypeError("Illegal offset: " + e + " (not an integer)");
  46101. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  46102. throw RangeError(
  46103. "Illegal offset: 0 <= " +
  46104. e +
  46105. " (+4) <= " +
  46106. this.buffer.byteLength
  46107. );
  46108. }
  46109. var i = 0;
  46110. return (
  46111. this.littleEndian
  46112. ? ((i = this.view[e + 2] << 16),
  46113. (i |= this.view[e + 1] << 8),
  46114. (i |= this.view[e]),
  46115. (i += (this.view[e + 3] << 24) >>> 0))
  46116. : ((i = this.view[e + 1] << 16),
  46117. (i |= this.view[e + 2] << 8),
  46118. (i |= this.view[e + 3]),
  46119. (i += (this.view[e] << 24) >>> 0)),
  46120. t && (this.offset += 4),
  46121. i
  46122. );
  46123. }),
  46124. (a.readUInt32 = a.readUint32),
  46125. e &&
  46126. ((a.writeInt64 = function (t, i) {
  46127. var n = "undefined" == typeof i;
  46128. if ((n && (i = this.offset), !this.noAssert)) {
  46129. if ("number" == typeof t) t = e.fromNumber(t);
  46130. else if ("string" == typeof t) t = e.fromString(t);
  46131. else if (!(t && t instanceof e))
  46132. throw TypeError(
  46133. "Illegal value: " + t + " (not an integer or Long)"
  46134. );
  46135. if ("number" != typeof i || i % 1 !== 0)
  46136. throw TypeError(
  46137. "Illegal offset: " + i + " (not an integer)"
  46138. );
  46139. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  46140. throw RangeError(
  46141. "Illegal offset: 0 <= " +
  46142. i +
  46143. " (+0) <= " +
  46144. this.buffer.byteLength
  46145. );
  46146. }
  46147. "number" == typeof t
  46148. ? (t = e.fromNumber(t))
  46149. : "string" == typeof t && (t = e.fromString(t)),
  46150. (i += 8);
  46151. var r = this.buffer.byteLength;
  46152. i > r && this.resize((r *= 2) > i ? r : i), (i -= 8);
  46153. var o = t.low,
  46154. a = t.high;
  46155. return (
  46156. this.littleEndian
  46157. ? ((this.view[i + 3] = (o >>> 24) & 255),
  46158. (this.view[i + 2] = (o >>> 16) & 255),
  46159. (this.view[i + 1] = (o >>> 8) & 255),
  46160. (this.view[i] = 255 & o),
  46161. (i += 4),
  46162. (this.view[i + 3] = (a >>> 24) & 255),
  46163. (this.view[i + 2] = (a >>> 16) & 255),
  46164. (this.view[i + 1] = (a >>> 8) & 255),
  46165. (this.view[i] = 255 & a))
  46166. : ((this.view[i] = (a >>> 24) & 255),
  46167. (this.view[i + 1] = (a >>> 16) & 255),
  46168. (this.view[i + 2] = (a >>> 8) & 255),
  46169. (this.view[i + 3] = 255 & a),
  46170. (i += 4),
  46171. (this.view[i] = (o >>> 24) & 255),
  46172. (this.view[i + 1] = (o >>> 16) & 255),
  46173. (this.view[i + 2] = (o >>> 8) & 255),
  46174. (this.view[i + 3] = 255 & o)),
  46175. n && (this.offset += 8),
  46176. this
  46177. );
  46178. }),
  46179. (a.writeLong = a.writeInt64),
  46180. (a.readInt64 = function (t) {
  46181. var i = "undefined" == typeof t;
  46182. if ((i && (t = this.offset), !this.noAssert)) {
  46183. if ("number" != typeof t || t % 1 !== 0)
  46184. throw TypeError(
  46185. "Illegal offset: " + t + " (not an integer)"
  46186. );
  46187. if (((t >>>= 0), t < 0 || t + 8 > this.buffer.byteLength))
  46188. throw RangeError(
  46189. "Illegal offset: 0 <= " +
  46190. t +
  46191. " (+8) <= " +
  46192. this.buffer.byteLength
  46193. );
  46194. }
  46195. var n = 0,
  46196. r = 0;
  46197. this.littleEndian
  46198. ? ((n = this.view[t + 2] << 16),
  46199. (n |= this.view[t + 1] << 8),
  46200. (n |= this.view[t]),
  46201. (n += (this.view[t + 3] << 24) >>> 0),
  46202. (t += 4),
  46203. (r = this.view[t + 2] << 16),
  46204. (r |= this.view[t + 1] << 8),
  46205. (r |= this.view[t]),
  46206. (r += (this.view[t + 3] << 24) >>> 0))
  46207. : ((r = this.view[t + 1] << 16),
  46208. (r |= this.view[t + 2] << 8),
  46209. (r |= this.view[t + 3]),
  46210. (r += (this.view[t] << 24) >>> 0),
  46211. (t += 4),
  46212. (n = this.view[t + 1] << 16),
  46213. (n |= this.view[t + 2] << 8),
  46214. (n |= this.view[t + 3]),
  46215. (n += (this.view[t] << 24) >>> 0));
  46216. var o = new e(n, r, !1);
  46217. return i && (this.offset += 8), o;
  46218. }),
  46219. (a.readLong = a.readInt64),
  46220. (a.writeUint64 = function (t, i) {
  46221. var n = "undefined" == typeof i;
  46222. if ((n && (i = this.offset), !this.noAssert)) {
  46223. if ("number" == typeof t) t = e.fromNumber(t);
  46224. else if ("string" == typeof t) t = e.fromString(t);
  46225. else if (!(t && t instanceof e))
  46226. throw TypeError(
  46227. "Illegal value: " + t + " (not an integer or Long)"
  46228. );
  46229. if ("number" != typeof i || i % 1 !== 0)
  46230. throw TypeError(
  46231. "Illegal offset: " + i + " (not an integer)"
  46232. );
  46233. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  46234. throw RangeError(
  46235. "Illegal offset: 0 <= " +
  46236. i +
  46237. " (+0) <= " +
  46238. this.buffer.byteLength
  46239. );
  46240. }
  46241. "number" == typeof t
  46242. ? (t = e.fromNumber(t))
  46243. : "string" == typeof t && (t = e.fromString(t)),
  46244. (i += 8);
  46245. var r = this.buffer.byteLength;
  46246. i > r && this.resize((r *= 2) > i ? r : i), (i -= 8);
  46247. var o = t.low,
  46248. a = t.high;
  46249. return (
  46250. this.littleEndian
  46251. ? ((this.view[i + 3] = (o >>> 24) & 255),
  46252. (this.view[i + 2] = (o >>> 16) & 255),
  46253. (this.view[i + 1] = (o >>> 8) & 255),
  46254. (this.view[i] = 255 & o),
  46255. (i += 4),
  46256. (this.view[i + 3] = (a >>> 24) & 255),
  46257. (this.view[i + 2] = (a >>> 16) & 255),
  46258. (this.view[i + 1] = (a >>> 8) & 255),
  46259. (this.view[i] = 255 & a))
  46260. : ((this.view[i] = (a >>> 24) & 255),
  46261. (this.view[i + 1] = (a >>> 16) & 255),
  46262. (this.view[i + 2] = (a >>> 8) & 255),
  46263. (this.view[i + 3] = 255 & a),
  46264. (i += 4),
  46265. (this.view[i] = (o >>> 24) & 255),
  46266. (this.view[i + 1] = (o >>> 16) & 255),
  46267. (this.view[i + 2] = (o >>> 8) & 255),
  46268. (this.view[i + 3] = 255 & o)),
  46269. n && (this.offset += 8),
  46270. this
  46271. );
  46272. }),
  46273. (a.writeUInt64 = a.writeUint64),
  46274. (a.readUint64 = function (t) {
  46275. var i = "undefined" == typeof t;
  46276. if ((i && (t = this.offset), !this.noAssert)) {
  46277. if ("number" != typeof t || t % 1 !== 0)
  46278. throw TypeError(
  46279. "Illegal offset: " + t + " (not an integer)"
  46280. );
  46281. if (((t >>>= 0), t < 0 || t + 8 > this.buffer.byteLength))
  46282. throw RangeError(
  46283. "Illegal offset: 0 <= " +
  46284. t +
  46285. " (+8) <= " +
  46286. this.buffer.byteLength
  46287. );
  46288. }
  46289. var n = 0,
  46290. r = 0;
  46291. this.littleEndian
  46292. ? ((n = this.view[t + 2] << 16),
  46293. (n |= this.view[t + 1] << 8),
  46294. (n |= this.view[t]),
  46295. (n += (this.view[t + 3] << 24) >>> 0),
  46296. (t += 4),
  46297. (r = this.view[t + 2] << 16),
  46298. (r |= this.view[t + 1] << 8),
  46299. (r |= this.view[t]),
  46300. (r += (this.view[t + 3] << 24) >>> 0))
  46301. : ((r = this.view[t + 1] << 16),
  46302. (r |= this.view[t + 2] << 8),
  46303. (r |= this.view[t + 3]),
  46304. (r += (this.view[t] << 24) >>> 0),
  46305. (t += 4),
  46306. (n = this.view[t + 1] << 16),
  46307. (n |= this.view[t + 2] << 8),
  46308. (n |= this.view[t + 3]),
  46309. (n += (this.view[t] << 24) >>> 0));
  46310. var o = new e(n, r, !0);
  46311. return i && (this.offset += 8), o;
  46312. }),
  46313. (a.readUInt64 = a.readUint64)),
  46314. (a.writeFloat32 = function (e, t) {
  46315. var i = "undefined" == typeof t;
  46316. if ((i && (t = this.offset), !this.noAssert)) {
  46317. if ("number" != typeof e)
  46318. throw TypeError("Illegal value: " + e + " (not a number)");
  46319. if ("number" != typeof t || t % 1 !== 0)
  46320. throw TypeError("Illegal offset: " + t + " (not an integer)");
  46321. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  46322. throw RangeError(
  46323. "Illegal offset: 0 <= " +
  46324. t +
  46325. " (+0) <= " +
  46326. this.buffer.byteLength
  46327. );
  46328. }
  46329. t += 4;
  46330. var n = this.buffer.byteLength;
  46331. return (
  46332. t > n && this.resize((n *= 2) > t ? n : t),
  46333. (t -= 4),
  46334. r(this.view, e, t, this.littleEndian, 23, 4),
  46335. i && (this.offset += 4),
  46336. this
  46337. );
  46338. }),
  46339. (a.writeFloat = a.writeFloat32),
  46340. (a.readFloat32 = function (e) {
  46341. var t = "undefined" == typeof e;
  46342. if ((t && (e = this.offset), !this.noAssert)) {
  46343. if ("number" != typeof e || e % 1 !== 0)
  46344. throw TypeError("Illegal offset: " + e + " (not an integer)");
  46345. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  46346. throw RangeError(
  46347. "Illegal offset: 0 <= " +
  46348. e +
  46349. " (+4) <= " +
  46350. this.buffer.byteLength
  46351. );
  46352. }
  46353. var i = n(this.view, e, this.littleEndian, 23, 4);
  46354. return t && (this.offset += 4), i;
  46355. }),
  46356. (a.readFloat = a.readFloat32),
  46357. (a.writeFloat64 = function (e, t) {
  46358. var i = "undefined" == typeof t;
  46359. if ((i && (t = this.offset), !this.noAssert)) {
  46360. if ("number" != typeof e)
  46361. throw TypeError("Illegal value: " + e + " (not a number)");
  46362. if ("number" != typeof t || t % 1 !== 0)
  46363. throw TypeError("Illegal offset: " + t + " (not an integer)");
  46364. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  46365. throw RangeError(
  46366. "Illegal offset: 0 <= " +
  46367. t +
  46368. " (+0) <= " +
  46369. this.buffer.byteLength
  46370. );
  46371. }
  46372. t += 8;
  46373. var n = this.buffer.byteLength;
  46374. return (
  46375. t > n && this.resize((n *= 2) > t ? n : t),
  46376. (t -= 8),
  46377. r(this.view, e, t, this.littleEndian, 52, 8),
  46378. i && (this.offset += 8),
  46379. this
  46380. );
  46381. }),
  46382. (a.writeDouble = a.writeFloat64),
  46383. (a.readFloat64 = function (e) {
  46384. var t = "undefined" == typeof e;
  46385. if ((t && (e = this.offset), !this.noAssert)) {
  46386. if ("number" != typeof e || e % 1 !== 0)
  46387. throw TypeError("Illegal offset: " + e + " (not an integer)");
  46388. if (((e >>>= 0), e < 0 || e + 8 > this.buffer.byteLength))
  46389. throw RangeError(
  46390. "Illegal offset: 0 <= " +
  46391. e +
  46392. " (+8) <= " +
  46393. this.buffer.byteLength
  46394. );
  46395. }
  46396. var i = n(this.view, e, this.littleEndian, 52, 8);
  46397. return t && (this.offset += 8), i;
  46398. }),
  46399. (a.readDouble = a.readFloat64),
  46400. (o.MAX_VARINT32_BYTES = 5),
  46401. (o.calculateVarint32 = function (e) {
  46402. return (
  46403. (e >>>= 0),
  46404. e < 128
  46405. ? 1
  46406. : e < 16384
  46407. ? 2
  46408. : e < 1 << 21
  46409. ? 3
  46410. : e < 1 << 28
  46411. ? 4
  46412. : 5
  46413. );
  46414. }),
  46415. (o.zigZagEncode32 = function (e) {
  46416. return (((e |= 0) << 1) ^ (e >> 31)) >>> 0;
  46417. }),
  46418. (o.zigZagDecode32 = function (e) {
  46419. return ((e >>> 1) ^ -(1 & e)) | 0;
  46420. }),
  46421. (a.writeVarint32 = function (e, t) {
  46422. var i = "undefined" == typeof t;
  46423. if ((i && (t = this.offset), !this.noAssert)) {
  46424. if ("number" != typeof e || e % 1 !== 0)
  46425. throw TypeError("Illegal value: " + e + " (not an integer)");
  46426. if (((e |= 0), "number" != typeof t || t % 1 !== 0))
  46427. throw TypeError("Illegal offset: " + t + " (not an integer)");
  46428. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  46429. throw RangeError(
  46430. "Illegal offset: 0 <= " +
  46431. t +
  46432. " (+0) <= " +
  46433. this.buffer.byteLength
  46434. );
  46435. }
  46436. var n,
  46437. r = o.calculateVarint32(e);
  46438. t += r;
  46439. var a = this.buffer.byteLength;
  46440. for (
  46441. t > a && this.resize((a *= 2) > t ? a : t), t -= r, e >>>= 0;
  46442. e >= 128;
  46443. )
  46444. (n = (127 & e) | 128), (this.view[t++] = n), (e >>>= 7);
  46445. return (this.view[t++] = e), i ? ((this.offset = t), this) : r;
  46446. }),
  46447. (a.writeVarint32ZigZag = function (e, t) {
  46448. return this.writeVarint32(o.zigZagEncode32(e), t);
  46449. }),
  46450. (a.readVarint32 = function (e) {
  46451. var t = "undefined" == typeof e;
  46452. if ((t && (e = this.offset), !this.noAssert)) {
  46453. if ("number" != typeof e || e % 1 !== 0)
  46454. throw TypeError("Illegal offset: " + e + " (not an integer)");
  46455. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  46456. throw RangeError(
  46457. "Illegal offset: 0 <= " +
  46458. e +
  46459. " (+1) <= " +
  46460. this.buffer.byteLength
  46461. );
  46462. }
  46463. var i,
  46464. n = 0,
  46465. r = 0;
  46466. do {
  46467. if (!this.noAssert && e > this.limit) {
  46468. var o = Error("Truncated");
  46469. throw ((o.truncated = !0), o);
  46470. }
  46471. (i = this.view[e++]), n < 5 && (r |= (127 & i) << (7 * n)), ++n;
  46472. } while (0 !== (128 & i));
  46473. return (
  46474. (r |= 0),
  46475. t
  46476. ? ((this.offset = e), r)
  46477. : {
  46478. value: r,
  46479. length: n,
  46480. }
  46481. );
  46482. }),
  46483. (a.readVarint32ZigZag = function (e) {
  46484. var t = this.readVarint32(e);
  46485. return (
  46486. "object" == typeof t
  46487. ? (t.value = o.zigZagDecode32(t.value))
  46488. : (t = o.zigZagDecode32(t)),
  46489. t
  46490. );
  46491. }),
  46492. e &&
  46493. ((o.MAX_VARINT64_BYTES = 10),
  46494. (o.calculateVarint64 = function (t) {
  46495. "number" == typeof t
  46496. ? (t = e.fromNumber(t))
  46497. : "string" == typeof t && (t = e.fromString(t));
  46498. var i = t.toInt() >>> 0,
  46499. n = t.shiftRightUnsigned(28).toInt() >>> 0,
  46500. r = t.shiftRightUnsigned(56).toInt() >>> 0;
  46501. return 0 == r
  46502. ? 0 == n
  46503. ? i < 16384
  46504. ? i < 128
  46505. ? 1
  46506. : 2
  46507. : i < 1 << 21
  46508. ? 3
  46509. : 4
  46510. : n < 16384
  46511. ? n < 128
  46512. ? 5
  46513. : 6
  46514. : n < 1 << 21
  46515. ? 7
  46516. : 8
  46517. : r < 128
  46518. ? 9
  46519. : 10;
  46520. }),
  46521. (o.zigZagEncode64 = function (t) {
  46522. return (
  46523. "number" == typeof t
  46524. ? (t = e.fromNumber(t, !1))
  46525. : "string" == typeof t
  46526. ? (t = e.fromString(t, !1))
  46527. : t.unsigned !== !1 && (t = t.toSigned()),
  46528. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  46529. );
  46530. }),
  46531. (o.zigZagDecode64 = function (t) {
  46532. return (
  46533. "number" == typeof t
  46534. ? (t = e.fromNumber(t, !1))
  46535. : "string" == typeof t
  46536. ? (t = e.fromString(t, !1))
  46537. : t.unsigned !== !1 && (t = t.toSigned()),
  46538. t
  46539. .shiftRightUnsigned(1)
  46540. .xor(t.and(e.ONE).toSigned().negate())
  46541. .toSigned()
  46542. );
  46543. }),
  46544. (a.writeVarint64 = function (t, i) {
  46545. var n = "undefined" == typeof i;
  46546. if ((n && (i = this.offset), !this.noAssert)) {
  46547. if ("number" == typeof t) t = e.fromNumber(t);
  46548. else if ("string" == typeof t) t = e.fromString(t);
  46549. else if (!(t && t instanceof e))
  46550. throw TypeError(
  46551. "Illegal value: " + t + " (not an integer or Long)"
  46552. );
  46553. if ("number" != typeof i || i % 1 !== 0)
  46554. throw TypeError(
  46555. "Illegal offset: " + i + " (not an integer)"
  46556. );
  46557. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  46558. throw RangeError(
  46559. "Illegal offset: 0 <= " +
  46560. i +
  46561. " (+0) <= " +
  46562. this.buffer.byteLength
  46563. );
  46564. }
  46565. "number" == typeof t
  46566. ? (t = e.fromNumber(t, !1))
  46567. : "string" == typeof t
  46568. ? (t = e.fromString(t, !1))
  46569. : t.unsigned !== !1 && (t = t.toSigned());
  46570. var r = o.calculateVarint64(t),
  46571. a = t.toInt() >>> 0,
  46572. s = t.shiftRightUnsigned(28).toInt() >>> 0,
  46573. l = t.shiftRightUnsigned(56).toInt() >>> 0;
  46574. i += r;
  46575. var c = this.buffer.byteLength;
  46576. switch (
  46577. (i > c && this.resize((c *= 2) > i ? c : i), (i -= r), r)
  46578. ) {
  46579. case 10:
  46580. this.view[i + 9] = (l >>> 7) & 1;
  46581. case 9:
  46582. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  46583. case 8:
  46584. this.view[i + 7] =
  46585. 8 !== r ? (s >>> 21) | 128 : (s >>> 21) & 127;
  46586. case 7:
  46587. this.view[i + 6] =
  46588. 7 !== r ? (s >>> 14) | 128 : (s >>> 14) & 127;
  46589. case 6:
  46590. this.view[i + 5] =
  46591. 6 !== r ? (s >>> 7) | 128 : (s >>> 7) & 127;
  46592. case 5:
  46593. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  46594. case 4:
  46595. this.view[i + 3] =
  46596. 4 !== r ? (a >>> 21) | 128 : (a >>> 21) & 127;
  46597. case 3:
  46598. this.view[i + 2] =
  46599. 3 !== r ? (a >>> 14) | 128 : (a >>> 14) & 127;
  46600. case 2:
  46601. this.view[i + 1] =
  46602. 2 !== r ? (a >>> 7) | 128 : (a >>> 7) & 127;
  46603. case 1:
  46604. this.view[i] = 1 !== r ? 128 | a : 127 & a;
  46605. }
  46606. return n ? ((this.offset += r), this) : r;
  46607. }),
  46608. (a.writeVarint64ZigZag = function (e, t) {
  46609. return this.writeVarint64(o.zigZagEncode64(e), t);
  46610. }),
  46611. (a.readVarint64 = function (t) {
  46612. var i = "undefined" == typeof t;
  46613. if ((i && (t = this.offset), !this.noAssert)) {
  46614. if ("number" != typeof t || t % 1 !== 0)
  46615. throw TypeError(
  46616. "Illegal offset: " + t + " (not an integer)"
  46617. );
  46618. if (((t >>>= 0), t < 0 || t + 1 > this.buffer.byteLength))
  46619. throw RangeError(
  46620. "Illegal offset: 0 <= " +
  46621. t +
  46622. " (+1) <= " +
  46623. this.buffer.byteLength
  46624. );
  46625. }
  46626. var n = t,
  46627. r = 0,
  46628. o = 0,
  46629. a = 0,
  46630. s = 0;
  46631. if (
  46632. ((s = this.view[t++]),
  46633. (r = 127 & s),
  46634. 128 & s &&
  46635. ((s = this.view[t++]),
  46636. (r |= (127 & s) << 7),
  46637. (128 & s || (this.noAssert && "undefined" == typeof s)) &&
  46638. ((s = this.view[t++]),
  46639. (r |= (127 & s) << 14),
  46640. (128 & s || (this.noAssert && "undefined" == typeof s)) &&
  46641. ((s = this.view[t++]),
  46642. (r |= (127 & s) << 21),
  46643. (128 & s ||
  46644. (this.noAssert && "undefined" == typeof s)) &&
  46645. ((s = this.view[t++]),
  46646. (o = 127 & s),
  46647. (128 & s ||
  46648. (this.noAssert && "undefined" == typeof s)) &&
  46649. ((s = this.view[t++]),
  46650. (o |= (127 & s) << 7),
  46651. (128 & s ||
  46652. (this.noAssert && "undefined" == typeof s)) &&
  46653. ((s = this.view[t++]),
  46654. (o |= (127 & s) << 14),
  46655. (128 & s ||
  46656. (this.noAssert && "undefined" == typeof s)) &&
  46657. ((s = this.view[t++]),
  46658. (o |= (127 & s) << 21),
  46659. (128 & s ||
  46660. (this.noAssert && "undefined" == typeof s)) &&
  46661. ((s = this.view[t++]),
  46662. (a = 127 & s),
  46663. (128 & s ||
  46664. (this.noAssert &&
  46665. "undefined" == typeof s)) &&
  46666. ((s = this.view[t++]),
  46667. (a |= (127 & s) << 7),
  46668. 128 & s ||
  46669. (this.noAssert &&
  46670. "undefined" == typeof s)))))))))))
  46671. )
  46672. throw Error("Buffer overrun");
  46673. var l = e.fromBits(r | (o << 28), (o >>> 4) | (a << 24), !1);
  46674. return i
  46675. ? ((this.offset = t), l)
  46676. : {
  46677. value: l,
  46678. length: t - n,
  46679. };
  46680. }),
  46681. (a.readVarint64ZigZag = function (t) {
  46682. var i = this.readVarint64(t);
  46683. return (
  46684. i && i.value instanceof e
  46685. ? (i.value = o.zigZagDecode64(i.value))
  46686. : (i = o.zigZagDecode64(i)),
  46687. i
  46688. );
  46689. })),
  46690. (a.writeCString = function (e, i) {
  46691. var n = "undefined" == typeof i;
  46692. n && (i = this.offset);
  46693. var r,
  46694. o = e.length;
  46695. if (!this.noAssert) {
  46696. if ("string" != typeof e)
  46697. throw TypeError("Illegal str: Not a string");
  46698. for (r = 0; r < o; ++r)
  46699. if (0 === e.charCodeAt(r))
  46700. throw RangeError("Illegal str: Contains NULL-characters");
  46701. if ("number" != typeof i || i % 1 !== 0)
  46702. throw TypeError("Illegal offset: " + i + " (not an integer)");
  46703. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  46704. throw RangeError(
  46705. "Illegal offset: 0 <= " +
  46706. i +
  46707. " (+0) <= " +
  46708. this.buffer.byteLength
  46709. );
  46710. }
  46711. (o = h.calculateUTF16asUTF8(t(e))[1]), (i += o + 1);
  46712. var a = this.buffer.byteLength;
  46713. return (
  46714. i > a && this.resize((a *= 2) > i ? a : i),
  46715. (i -= o + 1),
  46716. h.encodeUTF16toUTF8(
  46717. t(e),
  46718. function (e) {
  46719. this.view[i++] = e;
  46720. }.bind(this)
  46721. ),
  46722. (this.view[i++] = 0),
  46723. n ? ((this.offset = i), this) : o
  46724. );
  46725. }),
  46726. (a.readCString = function (e) {
  46727. var t = "undefined" == typeof e;
  46728. if ((t && (e = this.offset), !this.noAssert)) {
  46729. if ("number" != typeof e || e % 1 !== 0)
  46730. throw TypeError("Illegal offset: " + e + " (not an integer)");
  46731. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  46732. throw RangeError(
  46733. "Illegal offset: 0 <= " +
  46734. e +
  46735. " (+1) <= " +
  46736. this.buffer.byteLength
  46737. );
  46738. }
  46739. var n,
  46740. r = e,
  46741. o = -1;
  46742. return (
  46743. h.decodeUTF8toUTF16(
  46744. function () {
  46745. if (0 === o) return null;
  46746. if (e >= this.limit)
  46747. throw RangeError(
  46748. "Illegal range: Truncated data, " +
  46749. e +
  46750. " < " +
  46751. this.limit
  46752. );
  46753. return (o = this.view[e++]), 0 === o ? null : o;
  46754. }.bind(this),
  46755. (n = i()),
  46756. !0
  46757. ),
  46758. t
  46759. ? ((this.offset = e), n())
  46760. : {
  46761. string: n(),
  46762. length: e - r,
  46763. }
  46764. );
  46765. }),
  46766. (a.writeIString = function (e, i) {
  46767. var n = "undefined" == typeof i;
  46768. if ((n && (i = this.offset), !this.noAssert)) {
  46769. if ("string" != typeof e)
  46770. throw TypeError("Illegal str: Not a string");
  46771. if ("number" != typeof i || i % 1 !== 0)
  46772. throw TypeError("Illegal offset: " + i + " (not an integer)");
  46773. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  46774. throw RangeError(
  46775. "Illegal offset: 0 <= " +
  46776. i +
  46777. " (+0) <= " +
  46778. this.buffer.byteLength
  46779. );
  46780. }
  46781. var r,
  46782. o = i;
  46783. (r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1]),
  46784. (i += 4 + r);
  46785. var a = this.buffer.byteLength;
  46786. if (
  46787. (i > a && this.resize((a *= 2) > i ? a : i),
  46788. (i -= 4 + r),
  46789. this.littleEndian
  46790. ? ((this.view[i + 3] = (r >>> 24) & 255),
  46791. (this.view[i + 2] = (r >>> 16) & 255),
  46792. (this.view[i + 1] = (r >>> 8) & 255),
  46793. (this.view[i] = 255 & r))
  46794. : ((this.view[i] = (r >>> 24) & 255),
  46795. (this.view[i + 1] = (r >>> 16) & 255),
  46796. (this.view[i + 2] = (r >>> 8) & 255),
  46797. (this.view[i + 3] = 255 & r)),
  46798. (i += 4),
  46799. h.encodeUTF16toUTF8(
  46800. t(e),
  46801. function (e) {
  46802. this.view[i++] = e;
  46803. }.bind(this)
  46804. ),
  46805. i !== o + 4 + r)
  46806. )
  46807. throw RangeError(
  46808. "Illegal range: Truncated data, " + i + " == " + (i + 4 + r)
  46809. );
  46810. return n ? ((this.offset = i), this) : i - o;
  46811. }),
  46812. (a.readIString = function (e) {
  46813. var t = "undefined" == typeof e;
  46814. if ((t && (e = this.offset), !this.noAssert)) {
  46815. if ("number" != typeof e || e % 1 !== 0)
  46816. throw TypeError("Illegal offset: " + e + " (not an integer)");
  46817. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  46818. throw RangeError(
  46819. "Illegal offset: 0 <= " +
  46820. e +
  46821. " (+4) <= " +
  46822. this.buffer.byteLength
  46823. );
  46824. }
  46825. var i = e,
  46826. n = this.readUint32(e),
  46827. r = this.readUTF8String(n, o.METRICS_BYTES, (e += 4));
  46828. return (
  46829. (e += r.length),
  46830. t
  46831. ? ((this.offset = e), r.string)
  46832. : {
  46833. string: r.string,
  46834. length: e - i,
  46835. }
  46836. );
  46837. }),
  46838. (o.METRICS_CHARS = "c"),
  46839. (o.METRICS_BYTES = "b"),
  46840. (a.writeUTF8String = function (e, i) {
  46841. var n = "undefined" == typeof i;
  46842. if ((n && (i = this.offset), !this.noAssert)) {
  46843. if ("number" != typeof i || i % 1 !== 0)
  46844. throw TypeError("Illegal offset: " + i + " (not an integer)");
  46845. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  46846. throw RangeError(
  46847. "Illegal offset: 0 <= " +
  46848. i +
  46849. " (+0) <= " +
  46850. this.buffer.byteLength
  46851. );
  46852. }
  46853. var r,
  46854. o = i;
  46855. (r = h.calculateUTF16asUTF8(t(e))[1]), (i += r);
  46856. var a = this.buffer.byteLength;
  46857. return (
  46858. i > a && this.resize((a *= 2) > i ? a : i),
  46859. (i -= r),
  46860. h.encodeUTF16toUTF8(
  46861. t(e),
  46862. function (e) {
  46863. this.view[i++] = e;
  46864. }.bind(this)
  46865. ),
  46866. n ? ((this.offset = i), this) : i - o
  46867. );
  46868. }),
  46869. (a.writeString = a.writeUTF8String),
  46870. (o.calculateUTF8Chars = function (e) {
  46871. return h.calculateUTF16asUTF8(t(e))[0];
  46872. }),
  46873. (o.calculateUTF8Bytes = function (e) {
  46874. return h.calculateUTF16asUTF8(t(e))[1];
  46875. }),
  46876. (o.calculateString = o.calculateUTF8Bytes),
  46877. (a.readUTF8String = function (e, t, n) {
  46878. "number" == typeof t && ((n = t), (t = void 0));
  46879. var r = "undefined" == typeof n;
  46880. if (
  46881. (r && (n = this.offset),
  46882. "undefined" == typeof t && (t = o.METRICS_CHARS),
  46883. !this.noAssert)
  46884. ) {
  46885. if ("number" != typeof e || e % 1 !== 0)
  46886. throw TypeError("Illegal length: " + e + " (not an integer)");
  46887. if (((e |= 0), "number" != typeof n || n % 1 !== 0))
  46888. throw TypeError("Illegal offset: " + n + " (not an integer)");
  46889. if (((n >>>= 0), n < 0 || n + 0 > this.buffer.byteLength))
  46890. throw RangeError(
  46891. "Illegal offset: 0 <= " +
  46892. n +
  46893. " (+0) <= " +
  46894. this.buffer.byteLength
  46895. );
  46896. }
  46897. var a,
  46898. s = 0,
  46899. l = n;
  46900. if (t === o.METRICS_CHARS) {
  46901. if (
  46902. ((a = i()),
  46903. h.decodeUTF8(
  46904. function () {
  46905. return s < e && n < this.limit ? this.view[n++] : null;
  46906. }.bind(this),
  46907. function (e) {
  46908. ++s, h.UTF8toUTF16(e, a);
  46909. }
  46910. ),
  46911. s !== e)
  46912. )
  46913. throw RangeError(
  46914. "Illegal range: Truncated data, " + s + " == " + e
  46915. );
  46916. return r
  46917. ? ((this.offset = n), a())
  46918. : {
  46919. string: a(),
  46920. length: n - l,
  46921. };
  46922. }
  46923. if (t === o.METRICS_BYTES) {
  46924. if (!this.noAssert) {
  46925. if ("number" != typeof n || n % 1 !== 0)
  46926. throw TypeError(
  46927. "Illegal offset: " + n + " (not an integer)"
  46928. );
  46929. if (((n >>>= 0), n < 0 || n + e > this.buffer.byteLength))
  46930. throw RangeError(
  46931. "Illegal offset: 0 <= " +
  46932. n +
  46933. " (+" +
  46934. e +
  46935. ") <= " +
  46936. this.buffer.byteLength
  46937. );
  46938. }
  46939. var c = n + e;
  46940. if (
  46941. (h.decodeUTF8toUTF16(
  46942. function () {
  46943. return n < c ? this.view[n++] : null;
  46944. }.bind(this),
  46945. (a = i()),
  46946. this.noAssert
  46947. ),
  46948. n !== c)
  46949. )
  46950. throw RangeError(
  46951. "Illegal range: Truncated data, " + n + " == " + c
  46952. );
  46953. return r
  46954. ? ((this.offset = n), a())
  46955. : {
  46956. string: a(),
  46957. length: n - l,
  46958. };
  46959. }
  46960. throw TypeError("Unsupported metrics: " + t);
  46961. }),
  46962. (a.readString = a.readUTF8String),
  46963. (a.writeVString = function (e, i) {
  46964. var n = "undefined" == typeof i;
  46965. if ((n && (i = this.offset), !this.noAssert)) {
  46966. if ("string" != typeof e)
  46967. throw TypeError("Illegal str: Not a string");
  46968. if ("number" != typeof i || i % 1 !== 0)
  46969. throw TypeError("Illegal offset: " + i + " (not an integer)");
  46970. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  46971. throw RangeError(
  46972. "Illegal offset: 0 <= " +
  46973. i +
  46974. " (+0) <= " +
  46975. this.buffer.byteLength
  46976. );
  46977. }
  46978. var r,
  46979. a,
  46980. s = i;
  46981. (r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1]),
  46982. (a = o.calculateVarint32(r)),
  46983. (i += a + r);
  46984. var l = this.buffer.byteLength;
  46985. if (
  46986. (i > l && this.resize((l *= 2) > i ? l : i),
  46987. (i -= a + r),
  46988. (i += this.writeVarint32(r, i)),
  46989. h.encodeUTF16toUTF8(
  46990. t(e),
  46991. function (e) {
  46992. this.view[i++] = e;
  46993. }.bind(this)
  46994. ),
  46995. i !== s + r + a)
  46996. )
  46997. throw RangeError(
  46998. "Illegal range: Truncated data, " + i + " == " + (i + r + a)
  46999. );
  47000. return n ? ((this.offset = i), this) : i - s;
  47001. }),
  47002. (a.readVString = function (e) {
  47003. var t = "undefined" == typeof e;
  47004. if ((t && (e = this.offset), !this.noAssert)) {
  47005. if ("number" != typeof e || e % 1 !== 0)
  47006. throw TypeError("Illegal offset: " + e + " (not an integer)");
  47007. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  47008. throw RangeError(
  47009. "Illegal offset: 0 <= " +
  47010. e +
  47011. " (+1) <= " +
  47012. this.buffer.byteLength
  47013. );
  47014. }
  47015. var i = e,
  47016. n = this.readVarint32(e),
  47017. r = this.readUTF8String(
  47018. n.value,
  47019. o.METRICS_BYTES,
  47020. (e += n.length)
  47021. );
  47022. return (
  47023. (e += r.length),
  47024. t
  47025. ? ((this.offset = e), r.string)
  47026. : {
  47027. string: r.string,
  47028. length: e - i,
  47029. }
  47030. );
  47031. }),
  47032. (a.append = function (e, t, i) {
  47033. ("number" != typeof t && "string" == typeof t) ||
  47034. ((i = t), (t = void 0));
  47035. var n = "undefined" == typeof i;
  47036. if ((n && (i = this.offset), !this.noAssert)) {
  47037. if ("number" != typeof i || i % 1 !== 0)
  47038. throw TypeError("Illegal offset: " + i + " (not an integer)");
  47039. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  47040. throw RangeError(
  47041. "Illegal offset: 0 <= " +
  47042. i +
  47043. " (+0) <= " +
  47044. this.buffer.byteLength
  47045. );
  47046. }
  47047. e instanceof o || (e = o.wrap(e, t));
  47048. var r = e.limit - e.offset;
  47049. if (r <= 0) return this;
  47050. i += r;
  47051. var a = this.buffer.byteLength;
  47052. return (
  47053. i > a && this.resize((a *= 2) > i ? a : i),
  47054. (i -= r),
  47055. this.view.set(e.view.subarray(e.offset, e.limit), i),
  47056. (e.offset += r),
  47057. n && (this.offset += r),
  47058. this
  47059. );
  47060. }),
  47061. (a.appendTo = function (e, t) {
  47062. return e.append(this, t), this;
  47063. }),
  47064. (a.assert = function (e) {
  47065. return (this.noAssert = !e), this;
  47066. }),
  47067. (a.capacity = function () {
  47068. return this.buffer.byteLength;
  47069. }),
  47070. (a.clear = function () {
  47071. return (
  47072. (this.offset = 0),
  47073. (this.limit = this.buffer.byteLength),
  47074. (this.markedOffset = -1),
  47075. this
  47076. );
  47077. }),
  47078. (a.clone = function (e) {
  47079. var t = new o(0, this.littleEndian, this.noAssert);
  47080. return (
  47081. e
  47082. ? ((t.buffer = new ArrayBuffer(this.buffer.byteLength)),
  47083. (t.view = new Uint8Array(t.buffer)))
  47084. : ((t.buffer = this.buffer), (t.view = this.view)),
  47085. (t.offset = this.offset),
  47086. (t.markedOffset = this.markedOffset),
  47087. (t.limit = this.limit),
  47088. t
  47089. );
  47090. }),
  47091. (a.compact = function (e, t) {
  47092. if (
  47093. ("undefined" == typeof e && (e = this.offset),
  47094. "undefined" == typeof t && (t = this.limit),
  47095. !this.noAssert)
  47096. ) {
  47097. if ("number" != typeof e || e % 1 !== 0)
  47098. throw TypeError("Illegal begin: Not an integer");
  47099. if (((e >>>= 0), "number" != typeof t || t % 1 !== 0))
  47100. throw TypeError("Illegal end: Not an integer");
  47101. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  47102. throw RangeError(
  47103. "Illegal range: 0 <= " +
  47104. e +
  47105. " <= " +
  47106. t +
  47107. " <= " +
  47108. this.buffer.byteLength
  47109. );
  47110. }
  47111. if (0 === e && t === this.buffer.byteLength) return this;
  47112. var i = t - e;
  47113. if (0 === i)
  47114. return (
  47115. (this.buffer = s),
  47116. (this.view = null),
  47117. this.markedOffset >= 0 && (this.markedOffset -= e),
  47118. (this.offset = 0),
  47119. (this.limit = 0),
  47120. this
  47121. );
  47122. var n = new ArrayBuffer(i),
  47123. r = new Uint8Array(n);
  47124. return (
  47125. r.set(this.view.subarray(e, t)),
  47126. (this.buffer = n),
  47127. (this.view = r),
  47128. this.markedOffset >= 0 && (this.markedOffset -= e),
  47129. (this.offset = 0),
  47130. (this.limit = i),
  47131. this
  47132. );
  47133. }),
  47134. (a.copy = function (e, t) {
  47135. if (
  47136. ("undefined" == typeof e && (e = this.offset),
  47137. "undefined" == typeof t && (t = this.limit),
  47138. !this.noAssert)
  47139. ) {
  47140. if ("number" != typeof e || e % 1 !== 0)
  47141. throw TypeError("Illegal begin: Not an integer");
  47142. if (((e >>>= 0), "number" != typeof t || t % 1 !== 0))
  47143. throw TypeError("Illegal end: Not an integer");
  47144. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  47145. throw RangeError(
  47146. "Illegal range: 0 <= " +
  47147. e +
  47148. " <= " +
  47149. t +
  47150. " <= " +
  47151. this.buffer.byteLength
  47152. );
  47153. }
  47154. if (e === t) return new o(0, this.littleEndian, this.noAssert);
  47155. var i = t - e,
  47156. n = new o(i, this.littleEndian, this.noAssert);
  47157. return (
  47158. (n.offset = 0),
  47159. (n.limit = i),
  47160. n.markedOffset >= 0 && (n.markedOffset -= e),
  47161. this.copyTo(n, 0, e, t),
  47162. n
  47163. );
  47164. }),
  47165. (a.copyTo = function (e, t, i, n) {
  47166. var r, a;
  47167. if (!this.noAssert && !o.isByteBuffer(e))
  47168. throw TypeError("Illegal target: Not a ByteBuffer");
  47169. if (
  47170. ((t = (a = "undefined" == typeof t) ? e.offset : 0 | t),
  47171. (i = (r = "undefined" == typeof i) ? this.offset : 0 | i),
  47172. (n = "undefined" == typeof n ? this.limit : 0 | n),
  47173. t < 0 || t > e.buffer.byteLength)
  47174. )
  47175. throw RangeError(
  47176. "Illegal target range: 0 <= " +
  47177. t +
  47178. " <= " +
  47179. e.buffer.byteLength
  47180. );
  47181. if (i < 0 || n > this.buffer.byteLength)
  47182. throw RangeError(
  47183. "Illegal source range: 0 <= " +
  47184. i +
  47185. " <= " +
  47186. this.buffer.byteLength
  47187. );
  47188. var s = n - i;
  47189. return 0 === s
  47190. ? e
  47191. : (e.ensureCapacity(t + s),
  47192. e.view.set(this.view.subarray(i, n), t),
  47193. r && (this.offset += s),
  47194. a && (e.offset += s),
  47195. this);
  47196. }),
  47197. (a.ensureCapacity = function (e) {
  47198. var t = this.buffer.byteLength;
  47199. return t < e ? this.resize((t *= 2) > e ? t : e) : this;
  47200. }),
  47201. (a.fill = function (e, t, i) {
  47202. var n = "undefined" == typeof t;
  47203. if (
  47204. (n && (t = this.offset),
  47205. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  47206. "undefined" == typeof t && (t = this.offset),
  47207. "undefined" == typeof i && (i = this.limit),
  47208. !this.noAssert)
  47209. ) {
  47210. if ("number" != typeof e || e % 1 !== 0)
  47211. throw TypeError("Illegal value: " + e + " (not an integer)");
  47212. if (((e |= 0), "number" != typeof t || t % 1 !== 0))
  47213. throw TypeError("Illegal begin: Not an integer");
  47214. if (((t >>>= 0), "number" != typeof i || i % 1 !== 0))
  47215. throw TypeError("Illegal end: Not an integer");
  47216. if (((i >>>= 0), t < 0 || t > i || i > this.buffer.byteLength))
  47217. throw RangeError(
  47218. "Illegal range: 0 <= " +
  47219. t +
  47220. " <= " +
  47221. i +
  47222. " <= " +
  47223. this.buffer.byteLength
  47224. );
  47225. }
  47226. if (t >= i) return this;
  47227. for (; t < i; ) this.view[t++] = e;
  47228. return n && (this.offset = t), this;
  47229. }),
  47230. (a.flip = function () {
  47231. return (this.limit = this.offset), (this.offset = 0), this;
  47232. }),
  47233. (a.mark = function (e) {
  47234. if (
  47235. ((e = "undefined" == typeof e ? this.offset : e),
  47236. !this.noAssert)
  47237. ) {
  47238. if ("number" != typeof e || e % 1 !== 0)
  47239. throw TypeError("Illegal offset: " + e + " (not an integer)");
  47240. if (((e >>>= 0), e < 0 || e + 0 > this.buffer.byteLength))
  47241. throw RangeError(
  47242. "Illegal offset: 0 <= " +
  47243. e +
  47244. " (+0) <= " +
  47245. this.buffer.byteLength
  47246. );
  47247. }
  47248. return (this.markedOffset = e), this;
  47249. }),
  47250. (a.order = function (e) {
  47251. if (!this.noAssert && "boolean" != typeof e)
  47252. throw TypeError("Illegal littleEndian: Not a boolean");
  47253. return (this.littleEndian = !!e), this;
  47254. }),
  47255. (a.LE = function (e) {
  47256. return (this.littleEndian = "undefined" == typeof e || !!e), this;
  47257. }),
  47258. (a.BE = function (e) {
  47259. return (this.littleEndian = "undefined" != typeof e && !e), this;
  47260. }),
  47261. (a.prepend = function (e, t, i) {
  47262. ("number" != typeof t && "string" == typeof t) ||
  47263. ((i = t), (t = void 0));
  47264. var n = "undefined" == typeof i;
  47265. if ((n && (i = this.offset), !this.noAssert)) {
  47266. if ("number" != typeof i || i % 1 !== 0)
  47267. throw TypeError("Illegal offset: " + i + " (not an integer)");
  47268. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  47269. throw RangeError(
  47270. "Illegal offset: 0 <= " +
  47271. i +
  47272. " (+0) <= " +
  47273. this.buffer.byteLength
  47274. );
  47275. }
  47276. e instanceof o || (e = o.wrap(e, t));
  47277. var r = e.limit - e.offset;
  47278. if (r <= 0) return this;
  47279. var a = r - i;
  47280. if (a > 0) {
  47281. var s = new ArrayBuffer(this.buffer.byteLength + a),
  47282. l = new Uint8Array(s);
  47283. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  47284. (this.buffer = s),
  47285. (this.view = l),
  47286. (this.offset += a),
  47287. this.markedOffset >= 0 && (this.markedOffset += a),
  47288. (this.limit += a),
  47289. (i += a);
  47290. } else {
  47291. new Uint8Array(this.buffer);
  47292. }
  47293. return (
  47294. this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  47295. (e.offset = e.limit),
  47296. n && (this.offset -= r),
  47297. this
  47298. );
  47299. }),
  47300. (a.prependTo = function (e, t) {
  47301. return e.prepend(this, t), this;
  47302. }),
  47303. (a.printDebug = function (e) {
  47304. "function" != typeof e && (e = console.log.bind(console)),
  47305. e(
  47306. this.toString() +
  47307. "\n-------------------------------------------------------------------\n" +
  47308. this.toDebug(!0)
  47309. );
  47310. }),
  47311. (a.remaining = function () {
  47312. return this.limit - this.offset;
  47313. }),
  47314. (a.reset = function () {
  47315. return (
  47316. this.markedOffset >= 0
  47317. ? ((this.offset = this.markedOffset),
  47318. (this.markedOffset = -1))
  47319. : (this.offset = 0),
  47320. this
  47321. );
  47322. }),
  47323. (a.resize = function (e) {
  47324. if (!this.noAssert) {
  47325. if ("number" != typeof e || e % 1 !== 0)
  47326. throw TypeError(
  47327. "Illegal capacity: " + e + " (not an integer)"
  47328. );
  47329. if (((e |= 0), e < 0))
  47330. throw RangeError("Illegal capacity: 0 <= " + e);
  47331. }
  47332. if (this.buffer.byteLength < e) {
  47333. var t = new ArrayBuffer(e),
  47334. i = new Uint8Array(t);
  47335. i.set(this.view), (this.buffer = t), (this.view = i);
  47336. }
  47337. return this;
  47338. }),
  47339. (a.reverse = function (e, t) {
  47340. if (
  47341. ("undefined" == typeof e && (e = this.offset),
  47342. "undefined" == typeof t && (t = this.limit),
  47343. !this.noAssert)
  47344. ) {
  47345. if ("number" != typeof e || e % 1 !== 0)
  47346. throw TypeError("Illegal begin: Not an integer");
  47347. if (((e >>>= 0), "number" != typeof t || t % 1 !== 0))
  47348. throw TypeError("Illegal end: Not an integer");
  47349. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  47350. throw RangeError(
  47351. "Illegal range: 0 <= " +
  47352. e +
  47353. " <= " +
  47354. t +
  47355. " <= " +
  47356. this.buffer.byteLength
  47357. );
  47358. }
  47359. return e === t
  47360. ? this
  47361. : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  47362. this);
  47363. }),
  47364. (a.skip = function (e) {
  47365. if (!this.noAssert) {
  47366. if ("number" != typeof e || e % 1 !== 0)
  47367. throw TypeError("Illegal length: " + e + " (not an integer)");
  47368. e |= 0;
  47369. }
  47370. var t = this.offset + e;
  47371. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  47372. throw RangeError(
  47373. "Illegal length: 0 <= " +
  47374. this.offset +
  47375. " + " +
  47376. e +
  47377. " <= " +
  47378. this.buffer.byteLength
  47379. );
  47380. return (this.offset = t), this;
  47381. }),
  47382. (a.slice = function (e, t) {
  47383. if (
  47384. ("undefined" == typeof e && (e = this.offset),
  47385. "undefined" == typeof t && (t = this.limit),
  47386. !this.noAssert)
  47387. ) {
  47388. if ("number" != typeof e || e % 1 !== 0)
  47389. throw TypeError("Illegal begin: Not an integer");
  47390. if (((e >>>= 0), "number" != typeof t || t % 1 !== 0))
  47391. throw TypeError("Illegal end: Not an integer");
  47392. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  47393. throw RangeError(
  47394. "Illegal range: 0 <= " +
  47395. e +
  47396. " <= " +
  47397. t +
  47398. " <= " +
  47399. this.buffer.byteLength
  47400. );
  47401. }
  47402. var i = this.clone();
  47403. return (i.offset = e), (i.limit = t), i;
  47404. }),
  47405. (a.toBuffer = function (e) {
  47406. var t = this.offset,
  47407. i = this.limit;
  47408. if (!this.noAssert) {
  47409. if ("number" != typeof t || t % 1 !== 0)
  47410. throw TypeError("Illegal offset: Not an integer");
  47411. if (((t >>>= 0), "number" != typeof i || i % 1 !== 0))
  47412. throw TypeError("Illegal limit: Not an integer");
  47413. if (((i >>>= 0), t < 0 || t > i || i > this.buffer.byteLength))
  47414. throw RangeError(
  47415. "Illegal range: 0 <= " +
  47416. t +
  47417. " <= " +
  47418. i +
  47419. " <= " +
  47420. this.buffer.byteLength
  47421. );
  47422. }
  47423. if (!e && 0 === t && i === this.buffer.byteLength)
  47424. return this.buffer;
  47425. if (t === i) return s;
  47426. var n = new ArrayBuffer(i - t);
  47427. return (
  47428. new Uint8Array(n).set(
  47429. new Uint8Array(this.buffer).subarray(t, i),
  47430. 0
  47431. ),
  47432. n
  47433. );
  47434. }),
  47435. (a.toArrayBuffer = a.toBuffer),
  47436. (a.toString = function (e, t, i) {
  47437. if ("undefined" == typeof e)
  47438. return (
  47439. "ByteBufferAB(offset=" +
  47440. this.offset +
  47441. ",markedOffset=" +
  47442. this.markedOffset +
  47443. ",limit=" +
  47444. this.limit +
  47445. ",capacity=" +
  47446. this.capacity() +
  47447. ")"
  47448. );
  47449. switch (
  47450. ("number" == typeof e && ((e = "utf8"), (t = e), (i = t)), e)
  47451. ) {
  47452. case "utf8":
  47453. return this.toUTF8(t, i);
  47454. case "base64":
  47455. return this.toBase64(t, i);
  47456. case "hex":
  47457. return this.toHex(t, i);
  47458. case "binary":
  47459. return this.toBinary(t, i);
  47460. case "debug":
  47461. return this.toDebug();
  47462. case "columns":
  47463. return this.toColumns();
  47464. default:
  47465. throw Error("Unsupported encoding: " + e);
  47466. }
  47467. });
  47468. var c = (function () {
  47469. for (
  47470. var e = {},
  47471. t = [
  47472. 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  47473. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100,
  47474. 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
  47475. 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50,
  47476. 51, 52, 53, 54, 55, 56, 57, 43, 47,
  47477. ],
  47478. i = [],
  47479. n = 0,
  47480. r = t.length;
  47481. n < r;
  47482. ++n
  47483. )
  47484. i[t[n]] = n;
  47485. return (
  47486. (e.encode = function (e, i) {
  47487. for (var n, r; null !== (n = e()); )
  47488. i(t[(n >> 2) & 63]),
  47489. (r = (3 & n) << 4),
  47490. null !== (n = e())
  47491. ? ((r |= (n >> 4) & 15),
  47492. i(t[63 & (r | ((n >> 4) & 15))]),
  47493. (r = (15 & n) << 2),
  47494. null !== (n = e())
  47495. ? (i(t[63 & (r | ((n >> 6) & 3))]), i(t[63 & n]))
  47496. : (i(t[63 & r]), i(61)))
  47497. : (i(t[63 & r]), i(61), i(61));
  47498. }),
  47499. (e.decode = function (e, t) {
  47500. function n(e) {
  47501. throw Error("Illegal character code: " + e);
  47502. }
  47503. for (var r, o, a; null !== (r = e()); )
  47504. if (
  47505. ((o = i[r]),
  47506. "undefined" == typeof o && n(r),
  47507. null !== (r = e()) &&
  47508. ((a = i[r]),
  47509. "undefined" == typeof a && n(r),
  47510. t(((o << 2) >>> 0) | ((48 & a) >> 4)),
  47511. null !== (r = e())))
  47512. ) {
  47513. if (((o = i[r]), "undefined" == typeof o)) {
  47514. if (61 === r) break;
  47515. n(r);
  47516. }
  47517. if (
  47518. (t((((15 & a) << 4) >>> 0) | ((60 & o) >> 2)),
  47519. null !== (r = e()))
  47520. ) {
  47521. if (((a = i[r]), "undefined" == typeof a)) {
  47522. if (61 === r) break;
  47523. n(r);
  47524. }
  47525. t((((3 & o) << 6) >>> 0) | a);
  47526. }
  47527. }
  47528. }),
  47529. (e.test = function (e) {
  47530. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(
  47531. e
  47532. );
  47533. }),
  47534. e
  47535. );
  47536. })();
  47537. (a.toBase64 = function (e, t) {
  47538. if (
  47539. ("undefined" == typeof e && (e = this.offset),
  47540. "undefined" == typeof t && (t = this.limit),
  47541. (e |= 0),
  47542. (t |= 0),
  47543. e < 0 || t > this.capacity || e > t)
  47544. )
  47545. throw RangeError("begin, end");
  47546. var n;
  47547. return (
  47548. c.encode(
  47549. function () {
  47550. return e < t ? this.view[e++] : null;
  47551. }.bind(this),
  47552. (n = i())
  47553. ),
  47554. n()
  47555. );
  47556. }),
  47557. (o.fromBase64 = function (e, i) {
  47558. if ("string" != typeof e) throw TypeError("str");
  47559. var n = new o((e.length / 4) * 3, i),
  47560. r = 0;
  47561. return (
  47562. c.decode(t(e), function (e) {
  47563. n.view[r++] = e;
  47564. }),
  47565. (n.limit = r),
  47566. n
  47567. );
  47568. }),
  47569. (o.btoa = function (e) {
  47570. return o.fromBinary(e).toBase64();
  47571. }),
  47572. (o.atob = function (e) {
  47573. return o.fromBase64(e).toBinary();
  47574. }),
  47575. (a.toBinary = function (e, t) {
  47576. if (
  47577. ("undefined" == typeof e && (e = this.offset),
  47578. "undefined" == typeof t && (t = this.limit),
  47579. (e |= 0),
  47580. (t |= 0),
  47581. e < 0 || t > this.capacity() || e > t)
  47582. )
  47583. throw RangeError("begin, end");
  47584. if (e === t) return "";
  47585. for (var i = [], n = []; e < t; )
  47586. i.push(this.view[e++]),
  47587. i.length >= 1024 &&
  47588. (n.push(String.fromCharCode.apply(String, i)), (i = []));
  47589. return n.join("") + String.fromCharCode.apply(String, i);
  47590. }),
  47591. (o.fromBinary = function (e, t) {
  47592. if ("string" != typeof e) throw TypeError("str");
  47593. for (var i, n = 0, r = e.length, a = new o(r, t); n < r; ) {
  47594. if (((i = e.charCodeAt(n)), i > 255))
  47595. throw RangeError("illegal char code: " + i);
  47596. a.view[n++] = i;
  47597. }
  47598. return (a.limit = r), a;
  47599. }),
  47600. (a.toDebug = function (e) {
  47601. for (
  47602. var t,
  47603. i = -1,
  47604. n = this.buffer.byteLength,
  47605. r = "",
  47606. o = "",
  47607. a = "";
  47608. i < n;
  47609. ) {
  47610. if (
  47611. (i !== -1 &&
  47612. ((t = this.view[i]),
  47613. (r +=
  47614. t < 16
  47615. ? "0" + t.toString(16).toUpperCase()
  47616. : t.toString(16).toUpperCase()),
  47617. e &&
  47618. (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  47619. ++i,
  47620. e && i > 0 && i % 16 === 0 && i !== n)
  47621. ) {
  47622. for (; r.length < 51; ) r += " ";
  47623. (a += r + o + "\n"), (r = o = "");
  47624. }
  47625. r +=
  47626. i === this.offset && i === this.limit
  47627. ? i === this.markedOffset
  47628. ? "!"
  47629. : "|"
  47630. : i === this.offset
  47631. ? i === this.markedOffset
  47632. ? "["
  47633. : "<"
  47634. : i === this.limit
  47635. ? i === this.markedOffset
  47636. ? "]"
  47637. : ">"
  47638. : i === this.markedOffset
  47639. ? "'"
  47640. : e || (0 !== i && i !== n)
  47641. ? " "
  47642. : "";
  47643. }
  47644. if (e && " " !== r) {
  47645. for (; r.length < 51; ) r += " ";
  47646. a += r + o + "\n";
  47647. }
  47648. return e ? a : r;
  47649. }),
  47650. (o.fromDebug = function (e, t, i) {
  47651. for (
  47652. var n,
  47653. r,
  47654. a = e.length,
  47655. s = new o(((a + 1) / 3) | 0, t, i),
  47656. l = 0,
  47657. c = 0,
  47658. h = !1,
  47659. u = !1,
  47660. d = !1,
  47661. p = !1,
  47662. f = !1;
  47663. l < a;
  47664. ) {
  47665. switch ((n = e.charAt(l++))) {
  47666. case "!":
  47667. if (!i) {
  47668. if (u || d || p) {
  47669. f = !0;
  47670. break;
  47671. }
  47672. u = d = p = !0;
  47673. }
  47674. (s.offset = s.markedOffset = s.limit = c), (h = !1);
  47675. break;
  47676. case "|":
  47677. if (!i) {
  47678. if (u || p) {
  47679. f = !0;
  47680. break;
  47681. }
  47682. u = p = !0;
  47683. }
  47684. (s.offset = s.limit = c), (h = !1);
  47685. break;
  47686. case "[":
  47687. if (!i) {
  47688. if (u || d) {
  47689. f = !0;
  47690. break;
  47691. }
  47692. u = d = !0;
  47693. }
  47694. (s.offset = s.markedOffset = c), (h = !1);
  47695. break;
  47696. case "<":
  47697. if (!i) {
  47698. if (u) {
  47699. f = !0;
  47700. break;
  47701. }
  47702. u = !0;
  47703. }
  47704. (s.offset = c), (h = !1);
  47705. break;
  47706. case "]":
  47707. if (!i) {
  47708. if (p || d) {
  47709. f = !0;
  47710. break;
  47711. }
  47712. p = d = !0;
  47713. }
  47714. (s.limit = s.markedOffset = c), (h = !1);
  47715. break;
  47716. case ">":
  47717. if (!i) {
  47718. if (p) {
  47719. f = !0;
  47720. break;
  47721. }
  47722. p = !0;
  47723. }
  47724. (s.limit = c), (h = !1);
  47725. break;
  47726. case "'":
  47727. if (!i) {
  47728. if (d) {
  47729. f = !0;
  47730. break;
  47731. }
  47732. d = !0;
  47733. }
  47734. (s.markedOffset = c), (h = !1);
  47735. break;
  47736. case " ":
  47737. h = !1;
  47738. break;
  47739. default:
  47740. if (!i && h) {
  47741. f = !0;
  47742. break;
  47743. }
  47744. if (
  47745. ((r = parseInt(n + e.charAt(l++), 16)),
  47746. !i && (isNaN(r) || r < 0 || r > 255))
  47747. )
  47748. throw TypeError(
  47749. "Illegal str: Not a debug encoded string"
  47750. );
  47751. (s.view[c++] = r), (h = !0);
  47752. }
  47753. if (f) throw TypeError("Illegal str: Invalid symbol at " + l);
  47754. }
  47755. if (!i) {
  47756. if (!u || !p)
  47757. throw TypeError("Illegal str: Missing offset or limit");
  47758. if (c < s.buffer.byteLength)
  47759. throw TypeError(
  47760. "Illegal str: Not a debug encoded string (is it hex?) " +
  47761. c +
  47762. " < " +
  47763. a
  47764. );
  47765. }
  47766. return s;
  47767. }),
  47768. (a.toHex = function (e, t) {
  47769. if (
  47770. ((e = "undefined" == typeof e ? this.offset : e),
  47771. (t = "undefined" == typeof t ? this.limit : t),
  47772. !this.noAssert)
  47773. ) {
  47774. if ("number" != typeof e || e % 1 !== 0)
  47775. throw TypeError("Illegal begin: Not an integer");
  47776. if (((e >>>= 0), "number" != typeof t || t % 1 !== 0))
  47777. throw TypeError("Illegal end: Not an integer");
  47778. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  47779. throw RangeError(
  47780. "Illegal range: 0 <= " +
  47781. e +
  47782. " <= " +
  47783. t +
  47784. " <= " +
  47785. this.buffer.byteLength
  47786. );
  47787. }
  47788. for (var i, n = new Array(t - e); e < t; )
  47789. (i = this.view[e++]),
  47790. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  47791. return n.join("");
  47792. }),
  47793. (o.fromHex = function (e, t, i) {
  47794. if (!i) {
  47795. if ("string" != typeof e)
  47796. throw TypeError("Illegal str: Not a string");
  47797. if (e.length % 2 !== 0)
  47798. throw TypeError("Illegal str: Length not a multiple of 2");
  47799. }
  47800. for (
  47801. var n, r = e.length, a = new o((r / 2) | 0, t), s = 0, l = 0;
  47802. s < r;
  47803. s += 2
  47804. ) {
  47805. if (
  47806. ((n = parseInt(e.substring(s, s + 2), 16)),
  47807. !i && (!isFinite(n) || n < 0 || n > 255))
  47808. )
  47809. throw TypeError("Illegal str: Contains non-hex characters");
  47810. a.view[l++] = n;
  47811. }
  47812. return (a.limit = l), a;
  47813. });
  47814. var h = (function () {
  47815. var e = {};
  47816. return (
  47817. (e.MAX_CODEPOINT = 1114111),
  47818. (e.encodeUTF8 = function (e, t) {
  47819. var i = null;
  47820. for (
  47821. "number" == typeof e &&
  47822. ((i = e),
  47823. (e = function () {
  47824. return null;
  47825. }));
  47826. null !== i || null !== (i = e());
  47827. )
  47828. i < 128
  47829. ? t(127 & i)
  47830. : i < 2048
  47831. ? (t(((i >> 6) & 31) | 192), t((63 & i) | 128))
  47832. : i < 65536
  47833. ? (t(((i >> 12) & 15) | 224),
  47834. t(((i >> 6) & 63) | 128),
  47835. t((63 & i) | 128))
  47836. : (t(((i >> 18) & 7) | 240),
  47837. t(((i >> 12) & 63) | 128),
  47838. t(((i >> 6) & 63) | 128),
  47839. t((63 & i) | 128)),
  47840. (i = null);
  47841. }),
  47842. (e.decodeUTF8 = function (e, t) {
  47843. for (
  47844. var i,
  47845. n,
  47846. r,
  47847. o,
  47848. a = function (e) {
  47849. e = e.slice(0, e.indexOf(null));
  47850. var t = Error(e.toString());
  47851. throw ((t.name = "TruncatedError"), (t.bytes = e), t);
  47852. };
  47853. null !== (i = e());
  47854. )
  47855. if (0 === (128 & i)) t(i);
  47856. else if (192 === (224 & i))
  47857. null === (n = e()) && a([i, n]),
  47858. t(((31 & i) << 6) | (63 & n));
  47859. else if (224 === (240 & i))
  47860. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  47861. t(((15 & i) << 12) | ((63 & n) << 6) | (63 & r));
  47862. else {
  47863. if (240 !== (248 & i))
  47864. throw RangeError("Illegal starting byte: " + i);
  47865. (null === (n = e()) ||
  47866. null === (r = e()) ||
  47867. null === (o = e())) &&
  47868. a([i, n, r, o]),
  47869. t(
  47870. ((7 & i) << 18) |
  47871. ((63 & n) << 12) |
  47872. ((63 & r) << 6) |
  47873. (63 & o)
  47874. );
  47875. }
  47876. }),
  47877. (e.UTF16toUTF8 = function (e, t) {
  47878. for (var i, n = null; ; ) {
  47879. if (null === (i = null !== n ? n : e())) break;
  47880. i >= 55296 &&
  47881. i <= 57343 &&
  47882. null !== (n = e()) &&
  47883. n >= 56320 &&
  47884. n <= 57343
  47885. ? (t(1024 * (i - 55296) + n - 56320 + 65536), (n = null))
  47886. : t(i);
  47887. }
  47888. null !== n && t(n);
  47889. }),
  47890. (e.UTF8toUTF16 = function (e, t) {
  47891. var i = null;
  47892. for (
  47893. "number" == typeof e &&
  47894. ((i = e),
  47895. (e = function () {
  47896. return null;
  47897. }));
  47898. null !== i || null !== (i = e());
  47899. )
  47900. i <= 65535
  47901. ? t(i)
  47902. : ((i -= 65536),
  47903. t((i >> 10) + 55296),
  47904. t((i % 1024) + 56320)),
  47905. (i = null);
  47906. }),
  47907. (e.encodeUTF16toUTF8 = function (t, i) {
  47908. e.UTF16toUTF8(t, function (t) {
  47909. e.encodeUTF8(t, i);
  47910. });
  47911. }),
  47912. (e.decodeUTF8toUTF16 = function (t, i) {
  47913. e.decodeUTF8(t, function (t) {
  47914. e.UTF8toUTF16(t, i);
  47915. });
  47916. }),
  47917. (e.calculateCodePoint = function (e) {
  47918. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4;
  47919. }),
  47920. (e.calculateUTF8 = function (e) {
  47921. for (var t, i = 0; null !== (t = e()); )
  47922. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  47923. return i;
  47924. }),
  47925. (e.calculateUTF16asUTF8 = function (t) {
  47926. var i = 0,
  47927. n = 0;
  47928. return (
  47929. e.UTF16toUTF8(t, function (e) {
  47930. ++i, (n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4);
  47931. }),
  47932. [i, n]
  47933. );
  47934. }),
  47935. e
  47936. );
  47937. })();
  47938. return (
  47939. (a.toUTF8 = function (e, t) {
  47940. if (
  47941. ("undefined" == typeof e && (e = this.offset),
  47942. "undefined" == typeof t && (t = this.limit),
  47943. !this.noAssert)
  47944. ) {
  47945. if ("number" != typeof e || e % 1 !== 0)
  47946. throw TypeError("Illegal begin: Not an integer");
  47947. if (((e >>>= 0), "number" != typeof t || t % 1 !== 0))
  47948. throw TypeError("Illegal end: Not an integer");
  47949. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  47950. throw RangeError(
  47951. "Illegal range: 0 <= " +
  47952. e +
  47953. " <= " +
  47954. t +
  47955. " <= " +
  47956. this.buffer.byteLength
  47957. );
  47958. }
  47959. var n;
  47960. try {
  47961. h.decodeUTF8toUTF16(
  47962. function () {
  47963. return e < t ? this.view[e++] : null;
  47964. }.bind(this),
  47965. (n = i())
  47966. );
  47967. } catch (i) {
  47968. if (e !== t)
  47969. throw RangeError(
  47970. "Illegal range: Truncated data, " + e + " != " + t
  47971. );
  47972. }
  47973. return n();
  47974. }),
  47975. (o.fromUTF8 = function (e, i, n) {
  47976. if (!n && "string" != typeof e)
  47977. throw TypeError("Illegal str: Not a string");
  47978. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1], i, n),
  47979. a = 0;
  47980. return (
  47981. h.encodeUTF16toUTF8(t(e), function (e) {
  47982. r.view[a++] = e;
  47983. }),
  47984. (r.limit = a),
  47985. r
  47986. );
  47987. }),
  47988. o
  47989. );
  47990. });
  47991. },
  47992. {
  47993. long: 216,
  47994. },
  47995. ],
  47996. 216: [
  47997. function (e, t, i) {
  47998. !(function (i, n) {
  47999. "function" == typeof define && define.amd
  48000. ? define([], n)
  48001. : "function" == typeof e && "object" == typeof t && t && t.exports
  48002. ? (t.exports = n())
  48003. : ((i.dcodeIO = i.dcodeIO || {}).Long = n());
  48004. })(this, function () {
  48005. "use strict";
  48006. function e(e, t, i) {
  48007. (this.low = 0 | e), (this.high = 0 | t), (this.unsigned = !!i);
  48008. }
  48009. function t(e) {
  48010. return (e && e.__isLong__) === !0;
  48011. }
  48012. function i(e, t) {
  48013. var i, n, o;
  48014. return t
  48015. ? ((e >>>= 0),
  48016. (o = 0 <= e && e < 256) && (n = l[e])
  48017. ? n
  48018. : ((i = r(e, (0 | e) < 0 ? -1 : 0, !0)), o && (l[e] = i), i))
  48019. : ((e |= 0),
  48020. (o = -128 <= e && e < 128) && (n = s[e])
  48021. ? n
  48022. : ((i = r(e, e < 0 ? -1 : 0, !1)), o && (s[e] = i), i));
  48023. }
  48024. function n(e, t) {
  48025. if (isNaN(e) || !isFinite(e)) return t ? m : g;
  48026. if (t) {
  48027. if (e < 0) return m;
  48028. if (e >= d) return I;
  48029. } else {
  48030. if (e <= -p) return E;
  48031. if (e + 1 >= p) return C;
  48032. }
  48033. return e < 0 ? n(-e, t).neg() : r(e % u | 0, (e / u) | 0, t);
  48034. }
  48035. function r(t, i, n) {
  48036. return new e(t, i, n);
  48037. }
  48038. function o(e, t, i) {
  48039. if (0 === e.length) throw Error("empty string");
  48040. if (
  48041. "NaN" === e ||
  48042. "Infinity" === e ||
  48043. "+Infinity" === e ||
  48044. "-Infinity" === e
  48045. )
  48046. return g;
  48047. if (
  48048. ("number" == typeof t ? ((i = t), (t = !1)) : (t = !!t),
  48049. (i = i || 10),
  48050. i < 2 || 36 < i)
  48051. )
  48052. throw RangeError("radix");
  48053. var r;
  48054. if ((r = e.indexOf("-")) > 0) throw Error("interior hyphen");
  48055. if (0 === r) return o(e.substring(1), t, i).neg();
  48056. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  48057. var h = Math.min(8, e.length - l),
  48058. u = parseInt(e.substring(l, l + h), i);
  48059. if (h < 8) {
  48060. var d = n(c(i, h));
  48061. s = s.mul(d).add(n(u));
  48062. } else (s = s.mul(a)), (s = s.add(n(u)));
  48063. }
  48064. return (s.unsigned = t), s;
  48065. }
  48066. function a(t) {
  48067. return t instanceof e
  48068. ? t
  48069. : "number" == typeof t
  48070. ? n(t)
  48071. : "string" == typeof t
  48072. ? o(t)
  48073. : r(t.low, t.high, t.unsigned);
  48074. }
  48075. e.prototype.__isLong__,
  48076. Object.defineProperty(e.prototype, "__isLong__", {
  48077. value: !0,
  48078. enumerable: !1,
  48079. configurable: !1,
  48080. }),
  48081. (e.isLong = t);
  48082. var s = {},
  48083. l = {};
  48084. (e.fromInt = i), (e.fromNumber = n), (e.fromBits = r);
  48085. var c = Math.pow;
  48086. (e.fromString = o), (e.fromValue = a);
  48087. var h = 1 << 24,
  48088. u = 4294967296,
  48089. d = 0x10000000000000000,
  48090. p = d / 2,
  48091. f = i(h),
  48092. g = i(0);
  48093. e.ZERO = g;
  48094. var m = i(0, !0);
  48095. e.UZERO = m;
  48096. var v = i(1);
  48097. e.ONE = v;
  48098. var A = i(1, !0);
  48099. e.UONE = A;
  48100. var y = i(-1);
  48101. e.NEG_ONE = y;
  48102. var C = r(-1, 2147483647, !1);
  48103. e.MAX_VALUE = C;
  48104. var I = r(-1, -1, !0);
  48105. e.MAX_UNSIGNED_VALUE = I;
  48106. var E = r(0, -2147483648, !1);
  48107. e.MIN_VALUE = E;
  48108. var b = e.prototype;
  48109. return (
  48110. (b.toInt = function () {
  48111. return this.unsigned ? this.low >>> 0 : this.low;
  48112. }),
  48113. (b.toNumber = function () {
  48114. return this.unsigned
  48115. ? (this.high >>> 0) * u + (this.low >>> 0)
  48116. : this.high * u + (this.low >>> 0);
  48117. }),
  48118. (b.toString = function (e) {
  48119. if (((e = e || 10), e < 2 || 36 < e)) throw RangeError("radix");
  48120. if (this.isZero()) return "0";
  48121. if (this.isNegative()) {
  48122. if (this.eq(E)) {
  48123. var t = n(e),
  48124. i = this.div(t),
  48125. r = i.mul(t).sub(this);
  48126. return i.toString(e) + r.toInt().toString(e);
  48127. }
  48128. return "-" + this.neg().toString(e);
  48129. }
  48130. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  48131. var l = a.div(o),
  48132. h = a.sub(l.mul(o)).toInt() >>> 0,
  48133. u = h.toString(e);
  48134. if (((a = l), a.isZero())) return u + s;
  48135. for (; u.length < 6; ) u = "0" + u;
  48136. s = "" + u + s;
  48137. }
  48138. }),
  48139. (b.getHighBits = function () {
  48140. return this.high;
  48141. }),
  48142. (b.getHighBitsUnsigned = function () {
  48143. return this.high >>> 0;
  48144. }),
  48145. (b.getLowBits = function () {
  48146. return this.low;
  48147. }),
  48148. (b.getLowBitsUnsigned = function () {
  48149. return this.low >>> 0;
  48150. }),
  48151. (b.getNumBitsAbs = function () {
  48152. if (this.isNegative())
  48153. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  48154. for (
  48155. var e = 0 != this.high ? this.high : this.low, t = 31;
  48156. t > 0 && 0 == (e & (1 << t));
  48157. t--
  48158. );
  48159. return 0 != this.high ? t + 33 : t + 1;
  48160. }),
  48161. (b.isZero = function () {
  48162. return 0 === this.high && 0 === this.low;
  48163. }),
  48164. (b.isNegative = function () {
  48165. return !this.unsigned && this.high < 0;
  48166. }),
  48167. (b.isPositive = function () {
  48168. return this.unsigned || this.high >= 0;
  48169. }),
  48170. (b.isOdd = function () {
  48171. return 1 === (1 & this.low);
  48172. }),
  48173. (b.isEven = function () {
  48174. return 0 === (1 & this.low);
  48175. }),
  48176. (b.equals = function (e) {
  48177. return (
  48178. t(e) || (e = a(e)),
  48179. (this.unsigned === e.unsigned ||
  48180. this.high >>> 31 !== 1 ||
  48181. e.high >>> 31 !== 1) &&
  48182. this.high === e.high &&
  48183. this.low === e.low
  48184. );
  48185. }),
  48186. (b.eq = b.equals),
  48187. (b.notEquals = function (e) {
  48188. return !this.eq(e);
  48189. }),
  48190. (b.neq = b.notEquals),
  48191. (b.lessThan = function (e) {
  48192. return this.comp(e) < 0;
  48193. }),
  48194. (b.lt = b.lessThan),
  48195. (b.lessThanOrEqual = function (e) {
  48196. return this.comp(e) <= 0;
  48197. }),
  48198. (b.lte = b.lessThanOrEqual),
  48199. (b.greaterThan = function (e) {
  48200. return this.comp(e) > 0;
  48201. }),
  48202. (b.gt = b.greaterThan),
  48203. (b.greaterThanOrEqual = function (e) {
  48204. return this.comp(e) >= 0;
  48205. }),
  48206. (b.gte = b.greaterThanOrEqual),
  48207. (b.compare = function (e) {
  48208. if ((t(e) || (e = a(e)), this.eq(e))) return 0;
  48209. var i = this.isNegative(),
  48210. n = e.isNegative();
  48211. return i && !n
  48212. ? -1
  48213. : !i && n
  48214. ? 1
  48215. : this.unsigned
  48216. ? e.high >>> 0 > this.high >>> 0 ||
  48217. (e.high === this.high && e.low >>> 0 > this.low >>> 0)
  48218. ? -1
  48219. : 1
  48220. : this.sub(e).isNegative()
  48221. ? -1
  48222. : 1;
  48223. }),
  48224. (b.comp = b.compare),
  48225. (b.negate = function () {
  48226. return !this.unsigned && this.eq(E) ? E : this.not().add(v);
  48227. }),
  48228. (b.neg = b.negate),
  48229. (b.add = function (e) {
  48230. t(e) || (e = a(e));
  48231. var i = this.high >>> 16,
  48232. n = 65535 & this.high,
  48233. o = this.low >>> 16,
  48234. s = 65535 & this.low,
  48235. l = e.high >>> 16,
  48236. c = 65535 & e.high,
  48237. h = e.low >>> 16,
  48238. u = 65535 & e.low,
  48239. d = 0,
  48240. p = 0,
  48241. f = 0,
  48242. g = 0;
  48243. return (
  48244. (g += s + u),
  48245. (f += g >>> 16),
  48246. (g &= 65535),
  48247. (f += o + h),
  48248. (p += f >>> 16),
  48249. (f &= 65535),
  48250. (p += n + c),
  48251. (d += p >>> 16),
  48252. (p &= 65535),
  48253. (d += i + l),
  48254. (d &= 65535),
  48255. r((f << 16) | g, (d << 16) | p, this.unsigned)
  48256. );
  48257. }),
  48258. (b.subtract = function (e) {
  48259. return t(e) || (e = a(e)), this.add(e.neg());
  48260. }),
  48261. (b.sub = b.subtract),
  48262. (b.multiply = function (e) {
  48263. if (this.isZero()) return g;
  48264. if ((t(e) || (e = a(e)), e.isZero())) return g;
  48265. if (this.eq(E)) return e.isOdd() ? E : g;
  48266. if (e.eq(E)) return this.isOdd() ? E : g;
  48267. if (this.isNegative())
  48268. return e.isNegative()
  48269. ? this.neg().mul(e.neg())
  48270. : this.neg().mul(e).neg();
  48271. if (e.isNegative()) return this.mul(e.neg()).neg();
  48272. if (this.lt(f) && e.lt(f))
  48273. return n(this.toNumber() * e.toNumber(), this.unsigned);
  48274. var i = this.high >>> 16,
  48275. o = 65535 & this.high,
  48276. s = this.low >>> 16,
  48277. l = 65535 & this.low,
  48278. c = e.high >>> 16,
  48279. h = 65535 & e.high,
  48280. u = e.low >>> 16,
  48281. d = 65535 & e.low,
  48282. p = 0,
  48283. m = 0,
  48284. v = 0,
  48285. A = 0;
  48286. return (
  48287. (A += l * d),
  48288. (v += A >>> 16),
  48289. (A &= 65535),
  48290. (v += s * d),
  48291. (m += v >>> 16),
  48292. (v &= 65535),
  48293. (v += l * u),
  48294. (m += v >>> 16),
  48295. (v &= 65535),
  48296. (m += o * d),
  48297. (p += m >>> 16),
  48298. (m &= 65535),
  48299. (m += s * u),
  48300. (p += m >>> 16),
  48301. (m &= 65535),
  48302. (m += l * h),
  48303. (p += m >>> 16),
  48304. (m &= 65535),
  48305. (p += i * d + o * u + s * h + l * c),
  48306. (p &= 65535),
  48307. r((v << 16) | A, (p << 16) | m, this.unsigned)
  48308. );
  48309. }),
  48310. (b.mul = b.multiply),
  48311. (b.divide = function (e) {
  48312. if ((t(e) || (e = a(e)), e.isZero()))
  48313. throw Error("division by zero");
  48314. if (this.isZero()) return this.unsigned ? m : g;
  48315. var i, r, o;
  48316. if (this.unsigned) {
  48317. if ((e.unsigned || (e = e.toUnsigned()), e.gt(this))) return m;
  48318. if (e.gt(this.shru(1))) return A;
  48319. o = m;
  48320. } else {
  48321. if (this.eq(E)) {
  48322. if (e.eq(v) || e.eq(y)) return E;
  48323. if (e.eq(E)) return v;
  48324. var s = this.shr(1);
  48325. return (
  48326. (i = s.div(e).shl(1)),
  48327. i.eq(g)
  48328. ? e.isNegative()
  48329. ? v
  48330. : y
  48331. : ((r = this.sub(e.mul(i))), (o = i.add(r.div(e))))
  48332. );
  48333. }
  48334. if (e.eq(E)) return this.unsigned ? m : g;
  48335. if (this.isNegative())
  48336. return e.isNegative()
  48337. ? this.neg().div(e.neg())
  48338. : this.neg().div(e).neg();
  48339. if (e.isNegative()) return this.div(e.neg()).neg();
  48340. o = g;
  48341. }
  48342. for (r = this; r.gte(e); ) {
  48343. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  48344. for (
  48345. var l = Math.ceil(Math.log(i) / Math.LN2),
  48346. h = l <= 48 ? 1 : c(2, l - 48),
  48347. u = n(i),
  48348. d = u.mul(e);
  48349. d.isNegative() || d.gt(r);
  48350. )
  48351. (i -= h), (u = n(i, this.unsigned)), (d = u.mul(e));
  48352. u.isZero() && (u = v), (o = o.add(u)), (r = r.sub(d));
  48353. }
  48354. return o;
  48355. }),
  48356. (b.div = b.divide),
  48357. (b.modulo = function (e) {
  48358. return t(e) || (e = a(e)), this.sub(this.div(e).mul(e));
  48359. }),
  48360. (b.mod = b.modulo),
  48361. (b.not = function () {
  48362. return r(~this.low, ~this.high, this.unsigned);
  48363. }),
  48364. (b.and = function (e) {
  48365. return (
  48366. t(e) || (e = a(e)),
  48367. r(this.low & e.low, this.high & e.high, this.unsigned)
  48368. );
  48369. }),
  48370. (b.or = function (e) {
  48371. return (
  48372. t(e) || (e = a(e)),
  48373. r(this.low | e.low, this.high | e.high, this.unsigned)
  48374. );
  48375. }),
  48376. (b.xor = function (e) {
  48377. return (
  48378. t(e) || (e = a(e)),
  48379. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  48380. );
  48381. }),
  48382. (b.shiftLeft = function (e) {
  48383. return (
  48384. t(e) && (e = e.toInt()),
  48385. 0 === (e &= 63)
  48386. ? this
  48387. : e < 32
  48388. ? r(
  48389. this.low << e,
  48390. (this.high << e) | (this.low >>> (32 - e)),
  48391. this.unsigned
  48392. )
  48393. : r(0, this.low << (e - 32), this.unsigned)
  48394. );
  48395. }),
  48396. (b.shl = b.shiftLeft),
  48397. (b.shiftRight = function (e) {
  48398. return (
  48399. t(e) && (e = e.toInt()),
  48400. 0 === (e &= 63)
  48401. ? this
  48402. : e < 32
  48403. ? r(
  48404. (this.low >>> e) | (this.high << (32 - e)),
  48405. this.high >> e,
  48406. this.unsigned
  48407. )
  48408. : r(
  48409. this.high >> (e - 32),
  48410. this.high >= 0 ? 0 : -1,
  48411. this.unsigned
  48412. )
  48413. );
  48414. }),
  48415. (b.shr = b.shiftRight),
  48416. (b.shiftRightUnsigned = function (e) {
  48417. if ((t(e) && (e = e.toInt()), (e &= 63), 0 === e)) return this;
  48418. var i = this.high;
  48419. if (e < 32) {
  48420. var n = this.low;
  48421. return r((n >>> e) | (i << (32 - e)), i >>> e, this.unsigned);
  48422. }
  48423. return 32 === e
  48424. ? r(i, 0, this.unsigned)
  48425. : r(i >>> (e - 32), 0, this.unsigned);
  48426. }),
  48427. (b.shru = b.shiftRightUnsigned),
  48428. (b.toSigned = function () {
  48429. return this.unsigned ? r(this.low, this.high, !1) : this;
  48430. }),
  48431. (b.toUnsigned = function () {
  48432. return this.unsigned ? this : r(this.low, this.high, !0);
  48433. }),
  48434. (b.toBytes = function (e) {
  48435. return e ? this.toBytesLE() : this.toBytesBE();
  48436. }),
  48437. (b.toBytesLE = function () {
  48438. var e = this.high,
  48439. t = this.low;
  48440. return [
  48441. 255 & t,
  48442. (t >>> 8) & 255,
  48443. (t >>> 16) & 255,
  48444. (t >>> 24) & 255,
  48445. 255 & e,
  48446. (e >>> 8) & 255,
  48447. (e >>> 16) & 255,
  48448. (e >>> 24) & 255,
  48449. ];
  48450. }),
  48451. (b.toBytesBE = function () {
  48452. var e = this.high,
  48453. t = this.low;
  48454. return [
  48455. (e >>> 24) & 255,
  48456. (e >>> 16) & 255,
  48457. (e >>> 8) & 255,
  48458. 255 & e,
  48459. (t >>> 24) & 255,
  48460. (t >>> 16) & 255,
  48461. (t >>> 8) & 255,
  48462. 255 & t,
  48463. ];
  48464. }),
  48465. e
  48466. );
  48467. });
  48468. },
  48469. {},
  48470. ],
  48471. 217: [
  48472. function (e, t, i) {
  48473. var n = {
  48474. REVISION: "75",
  48475. };
  48476. "function" == typeof define && define.amd
  48477. ? define("three", n)
  48478. : "undefined" != typeof i &&
  48479. "undefined" != typeof t &&
  48480. (t.exports = n),
  48481. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  48482. void 0 === Math.sign &&
  48483. (Math.sign = function (e) {
  48484. return e < 0 ? -1 : e > 0 ? 1 : +e;
  48485. }),
  48486. void 0 === Function.prototype.name &&
  48487. void 0 !== Object.defineProperty &&
  48488. Object.defineProperty(Function.prototype, "name", {
  48489. get: function () {
  48490. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1];
  48491. },
  48492. }),
  48493. void 0 === Object.assign &&
  48494. Object.defineProperty(Object, "assign", {
  48495. writable: !0,
  48496. configurable: !0,
  48497. value: function (e) {
  48498. "use strict";
  48499. if (void 0 === e || null === e)
  48500. throw new TypeError(
  48501. "Cannot convert first argument to object"
  48502. );
  48503. for (
  48504. var t = Object(e), i = 1, n = arguments.length;
  48505. i !== n;
  48506. ++i
  48507. ) {
  48508. var r = arguments[i];
  48509. if (void 0 !== r && null !== r) {
  48510. r = Object(r);
  48511. for (
  48512. var o = Object.keys(r), a = 0, s = o.length;
  48513. a !== s;
  48514. ++a
  48515. ) {
  48516. var l = o[a],
  48517. c = Object.getOwnPropertyDescriptor(r, l);
  48518. void 0 !== c && c.enumerable && (t[l] = r[l]);
  48519. }
  48520. }
  48521. }
  48522. return t;
  48523. },
  48524. }),
  48525. (n.MOUSE = {
  48526. LEFT: 0,
  48527. MIDDLE: 1,
  48528. RIGHT: 2,
  48529. }),
  48530. (n.CullFaceNone = 0),
  48531. (n.CullFaceBack = 1),
  48532. (n.CullFaceFront = 2),
  48533. (n.CullFaceFrontBack = 3),
  48534. (n.FrontFaceDirectionCW = 0),
  48535. (n.FrontFaceDirectionCCW = 1),
  48536. (n.BasicShadowMap = 0),
  48537. (n.PCFShadowMap = 1),
  48538. (n.PCFSoftShadowMap = 2),
  48539. (n.FrontSide = 0),
  48540. (n.BackSide = 1),
  48541. (n.DoubleSide = 2),
  48542. (n.FlatShading = 1),
  48543. (n.SmoothShading = 2),
  48544. (n.NoColors = 0),
  48545. (n.FaceColors = 1),
  48546. (n.VertexColors = 2),
  48547. (n.NoBlending = 0),
  48548. (n.NormalBlending = 1),
  48549. (n.AdditiveBlending = 2),
  48550. (n.SubtractiveBlending = 3),
  48551. (n.MultiplyBlending = 4),
  48552. (n.CustomBlending = 5),
  48553. (n.AddEquation = 100),
  48554. (n.SubtractEquation = 101),
  48555. (n.ReverseSubtractEquation = 102),
  48556. (n.MinEquation = 103),
  48557. (n.MaxEquation = 104),
  48558. (n.ZeroFactor = 200),
  48559. (n.OneFactor = 201),
  48560. (n.SrcColorFactor = 202),
  48561. (n.OneMinusSrcColorFactor = 203),
  48562. (n.SrcAlphaFactor = 204),
  48563. (n.OneMinusSrcAlphaFactor = 205),
  48564. (n.DstAlphaFactor = 206),
  48565. (n.OneMinusDstAlphaFactor = 207),
  48566. (n.DstColorFactor = 208),
  48567. (n.OneMinusDstColorFactor = 209),
  48568. (n.SrcAlphaSaturateFactor = 210),
  48569. (n.NeverDepth = 0),
  48570. (n.AlwaysDepth = 1),
  48571. (n.LessDepth = 2),
  48572. (n.LessEqualDepth = 3),
  48573. (n.EqualDepth = 4),
  48574. (n.GreaterEqualDepth = 5),
  48575. (n.GreaterDepth = 6),
  48576. (n.NotEqualDepth = 7),
  48577. (n.MultiplyOperation = 0),
  48578. (n.MixOperation = 1),
  48579. (n.AddOperation = 2),
  48580. (n.NoToneMapping = 0),
  48581. (n.LinearToneMapping = 1),
  48582. (n.ReinhardToneMapping = 2),
  48583. (n.Uncharted2ToneMapping = 3),
  48584. (n.CineonToneMapping = 4),
  48585. (n.UVMapping = 300),
  48586. (n.CubeReflectionMapping = 301),
  48587. (n.CubeRefractionMapping = 302),
  48588. (n.EquirectangularReflectionMapping = 303),
  48589. (n.EquirectangularRefractionMapping = 304),
  48590. (n.SphericalReflectionMapping = 305),
  48591. (n.CubeUVReflectionMapping = 306),
  48592. (n.CubeUVRefractionMapping = 307),
  48593. (n.RepeatWrapping = 1e3),
  48594. (n.ClampToEdgeWrapping = 1001),
  48595. (n.MirroredRepeatWrapping = 1002),
  48596. (n.NearestFilter = 1003),
  48597. (n.NearestMipMapNearestFilter = 1004),
  48598. (n.NearestMipMapLinearFilter = 1005),
  48599. (n.LinearFilter = 1006),
  48600. (n.LinearMipMapNearestFilter = 1007),
  48601. (n.LinearMipMapLinearFilter = 1008),
  48602. (n.UnsignedByteType = 1009),
  48603. (n.ByteType = 1010),
  48604. (n.ShortType = 1011),
  48605. (n.UnsignedShortType = 1012),
  48606. (n.IntType = 1013),
  48607. (n.UnsignedIntType = 1014),
  48608. (n.FloatType = 1015),
  48609. (n.HalfFloatType = 1025),
  48610. (n.UnsignedShort4444Type = 1016),
  48611. (n.UnsignedShort5551Type = 1017),
  48612. (n.UnsignedShort565Type = 1018),
  48613. (n.AlphaFormat = 1019),
  48614. (n.RGBFormat = 1020),
  48615. (n.RGBAFormat = 1021),
  48616. (n.LuminanceFormat = 1022),
  48617. (n.LuminanceAlphaFormat = 1023),
  48618. (n.RGBEFormat = n.RGBAFormat),
  48619. (n.RGB_S3TC_DXT1_Format = 2001),
  48620. (n.RGBA_S3TC_DXT1_Format = 2002),
  48621. (n.RGBA_S3TC_DXT3_Format = 2003),
  48622. (n.RGBA_S3TC_DXT5_Format = 2004),
  48623. (n.RGB_PVRTC_4BPPV1_Format = 2100),
  48624. (n.RGB_PVRTC_2BPPV1_Format = 2101),
  48625. (n.RGBA_PVRTC_4BPPV1_Format = 2102),
  48626. (n.RGBA_PVRTC_2BPPV1_Format = 2103),
  48627. (n.RGB_ETC1_Format = 2151),
  48628. (n.LoopOnce = 2200),
  48629. (n.LoopRepeat = 2201),
  48630. (n.LoopPingPong = 2202),
  48631. (n.InterpolateDiscrete = 2300),
  48632. (n.InterpolateLinear = 2301),
  48633. (n.InterpolateSmooth = 2302),
  48634. (n.ZeroCurvatureEnding = 2400),
  48635. (n.ZeroSlopeEnding = 2401),
  48636. (n.WrapAroundEnding = 2402),
  48637. (n.TrianglesDrawMode = 0),
  48638. (n.TriangleStripDrawMode = 1),
  48639. (n.TriangleFanDrawMode = 2),
  48640. (n.LinearEncoding = 3e3),
  48641. (n.sRGBEncoding = 3001),
  48642. (n.GammaEncoding = 3007),
  48643. (n.RGBEEncoding = 3002),
  48644. (n.LogLuvEncoding = 3003),
  48645. (n.RGBM7Encoding = 3004),
  48646. (n.RGBM16Encoding = 3005),
  48647. (n.RGBDEncoding = 3006),
  48648. (n.Color = function (e) {
  48649. return 3 === arguments.length
  48650. ? this.fromArray(arguments)
  48651. : this.set(e);
  48652. }),
  48653. (n.Color.prototype = {
  48654. constructor: n.Color,
  48655. r: 1,
  48656. g: 1,
  48657. b: 1,
  48658. set: function (e) {
  48659. return (
  48660. e instanceof n.Color
  48661. ? this.copy(e)
  48662. : "number" == typeof e
  48663. ? this.setHex(e)
  48664. : "string" == typeof e && this.setStyle(e),
  48665. this
  48666. );
  48667. },
  48668. setScalar: function (e) {
  48669. (this.r = e), (this.g = e), (this.b = e);
  48670. },
  48671. setHex: function (e) {
  48672. return (
  48673. (e = Math.floor(e)),
  48674. (this.r = ((e >> 16) & 255) / 255),
  48675. (this.g = ((e >> 8) & 255) / 255),
  48676. (this.b = (255 & e) / 255),
  48677. this
  48678. );
  48679. },
  48680. setRGB: function (e, t, i) {
  48681. return (this.r = e), (this.g = t), (this.b = i), this;
  48682. },
  48683. setHSL: (function () {
  48684. function e(e, t, i) {
  48685. return (
  48686. i < 0 && (i += 1),
  48687. i > 1 && (i -= 1),
  48688. i < 1 / 6
  48689. ? e + 6 * (t - e) * i
  48690. : i < 0.5
  48691. ? t
  48692. : i < 2 / 3
  48693. ? e + 6 * (t - e) * (2 / 3 - i)
  48694. : e
  48695. );
  48696. }
  48697. return function (t, i, r) {
  48698. if (
  48699. ((t = n.Math.euclideanModulo(t, 1)),
  48700. (i = n.Math.clamp(i, 0, 1)),
  48701. (r = n.Math.clamp(r, 0, 1)),
  48702. 0 === i)
  48703. )
  48704. this.r = this.g = this.b = r;
  48705. else {
  48706. var o = r <= 0.5 ? r * (1 + i) : r + i - r * i,
  48707. a = 2 * r - o;
  48708. (this.r = e(a, o, t + 1 / 3)),
  48709. (this.g = e(a, o, t)),
  48710. (this.b = e(a, o, t - 1 / 3));
  48711. }
  48712. return this;
  48713. };
  48714. })(),
  48715. setStyle: function (e) {
  48716. function t(t) {
  48717. void 0 !== t &&
  48718. parseFloat(t) < 1 &&
  48719. console.warn(
  48720. "THREE.Color: Alpha component of " + e + " will be ignored."
  48721. );
  48722. }
  48723. var i;
  48724. if ((i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e))) {
  48725. var r,
  48726. o = i[1],
  48727. a = i[2];
  48728. switch (o) {
  48729. case "rgb":
  48730. case "rgba":
  48731. if (
  48732. (r =
  48733. /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(
  48734. a
  48735. ))
  48736. )
  48737. return (
  48738. (this.r = Math.min(255, parseInt(r[1], 10)) / 255),
  48739. (this.g = Math.min(255, parseInt(r[2], 10)) / 255),
  48740. (this.b = Math.min(255, parseInt(r[3], 10)) / 255),
  48741. t(r[5]),
  48742. this
  48743. );
  48744. if (
  48745. (r =
  48746. /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(
  48747. a
  48748. ))
  48749. )
  48750. return (
  48751. (this.r = Math.min(100, parseInt(r[1], 10)) / 100),
  48752. (this.g = Math.min(100, parseInt(r[2], 10)) / 100),
  48753. (this.b = Math.min(100, parseInt(r[3], 10)) / 100),
  48754. t(r[5]),
  48755. this
  48756. );
  48757. break;
  48758. case "hsl":
  48759. case "hsla":
  48760. if (
  48761. (r =
  48762. /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(
  48763. a
  48764. ))
  48765. ) {
  48766. var s = parseFloat(r[1]) / 360,
  48767. l = parseInt(r[2], 10) / 100,
  48768. c = parseInt(r[3], 10) / 100;
  48769. return t(r[5]), this.setHSL(s, l, c);
  48770. }
  48771. }
  48772. } else if ((i = /^\#([A-Fa-f0-9]+)$/.exec(e))) {
  48773. var h = i[1],
  48774. u = h.length;
  48775. if (3 === u)
  48776. return (
  48777. (this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255),
  48778. (this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255),
  48779. (this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255),
  48780. this
  48781. );
  48782. if (6 === u)
  48783. return (
  48784. (this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255),
  48785. (this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255),
  48786. (this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255),
  48787. this
  48788. );
  48789. }
  48790. if (e && e.length > 0) {
  48791. var h = n.ColorKeywords[e];
  48792. void 0 !== h
  48793. ? this.setHex(h)
  48794. : console.warn("THREE.Color: Unknown color " + e);
  48795. }
  48796. return this;
  48797. },
  48798. clone: function () {
  48799. return new this.constructor(this.r, this.g, this.b);
  48800. },
  48801. copy: function (e) {
  48802. return (this.r = e.r), (this.g = e.g), (this.b = e.b), this;
  48803. },
  48804. copyGammaToLinear: function (e, t) {
  48805. return (
  48806. void 0 === t && (t = 2),
  48807. (this.r = Math.pow(e.r, t)),
  48808. (this.g = Math.pow(e.g, t)),
  48809. (this.b = Math.pow(e.b, t)),
  48810. this
  48811. );
  48812. },
  48813. copyLinearToGamma: function (e, t) {
  48814. void 0 === t && (t = 2);
  48815. var i = t > 0 ? 1 / t : 1;
  48816. return (
  48817. (this.r = Math.pow(e.r, i)),
  48818. (this.g = Math.pow(e.g, i)),
  48819. (this.b = Math.pow(e.b, i)),
  48820. this
  48821. );
  48822. },
  48823. convertGammaToLinear: function () {
  48824. var e = this.r,
  48825. t = this.g,
  48826. i = this.b;
  48827. return (this.r = e * e), (this.g = t * t), (this.b = i * i), this;
  48828. },
  48829. convertLinearToGamma: function () {
  48830. return (
  48831. (this.r = Math.sqrt(this.r)),
  48832. (this.g = Math.sqrt(this.g)),
  48833. (this.b = Math.sqrt(this.b)),
  48834. this
  48835. );
  48836. },
  48837. getHex: function () {
  48838. return (
  48839. ((255 * this.r) << 16) ^
  48840. ((255 * this.g) << 8) ^
  48841. ((255 * this.b) << 0)
  48842. );
  48843. },
  48844. getHexString: function () {
  48845. return ("000000" + this.getHex().toString(16)).slice(-6);
  48846. },
  48847. getHSL: function (e) {
  48848. var t,
  48849. i,
  48850. n = e || {
  48851. h: 0,
  48852. s: 0,
  48853. l: 0,
  48854. },
  48855. r = this.r,
  48856. o = this.g,
  48857. a = this.b,
  48858. s = Math.max(r, o, a),
  48859. l = Math.min(r, o, a),
  48860. c = (l + s) / 2;
  48861. if (l === s) (t = 0), (i = 0);
  48862. else {
  48863. var h = s - l;
  48864. switch (((i = c <= 0.5 ? h / (s + l) : h / (2 - s - l)), s)) {
  48865. case r:
  48866. t = (o - a) / h + (o < a ? 6 : 0);
  48867. break;
  48868. case o:
  48869. t = (a - r) / h + 2;
  48870. break;
  48871. case a:
  48872. t = (r - o) / h + 4;
  48873. }
  48874. t /= 6;
  48875. }
  48876. return (n.h = t), (n.s = i), (n.l = c), n;
  48877. },
  48878. getStyle: function () {
  48879. return (
  48880. "rgb(" +
  48881. ((255 * this.r) | 0) +
  48882. "," +
  48883. ((255 * this.g) | 0) +
  48884. "," +
  48885. ((255 * this.b) | 0) +
  48886. ")"
  48887. );
  48888. },
  48889. offsetHSL: function (e, t, i) {
  48890. var n = this.getHSL();
  48891. return (
  48892. (n.h += e),
  48893. (n.s += t),
  48894. (n.l += i),
  48895. this.setHSL(n.h, n.s, n.l),
  48896. this
  48897. );
  48898. },
  48899. add: function (e) {
  48900. return (this.r += e.r), (this.g += e.g), (this.b += e.b), this;
  48901. },
  48902. addColors: function (e, t) {
  48903. return (
  48904. (this.r = e.r + t.r),
  48905. (this.g = e.g + t.g),
  48906. (this.b = e.b + t.b),
  48907. this
  48908. );
  48909. },
  48910. addScalar: function (e) {
  48911. return (this.r += e), (this.g += e), (this.b += e), this;
  48912. },
  48913. multiply: function (e) {
  48914. return (this.r *= e.r), (this.g *= e.g), (this.b *= e.b), this;
  48915. },
  48916. multiplyScalar: function (e) {
  48917. return (this.r *= e), (this.g *= e), (this.b *= e), this;
  48918. },
  48919. lerp: function (e, t) {
  48920. return (
  48921. (this.r += (e.r - this.r) * t),
  48922. (this.g += (e.g - this.g) * t),
  48923. (this.b += (e.b - this.b) * t),
  48924. this
  48925. );
  48926. },
  48927. equals: function (e) {
  48928. return e.r === this.r && e.g === this.g && e.b === this.b;
  48929. },
  48930. fromArray: function (e, t) {
  48931. return (
  48932. void 0 === t && (t = 0),
  48933. (this.r = e[t]),
  48934. (this.g = e[t + 1]),
  48935. (this.b = e[t + 2]),
  48936. this
  48937. );
  48938. },
  48939. toArray: function (e, t) {
  48940. return (
  48941. void 0 === e && (e = []),
  48942. void 0 === t && (t = 0),
  48943. (e[t] = this.r),
  48944. (e[t + 1] = this.g),
  48945. (e[t + 2] = this.b),
  48946. e
  48947. );
  48948. },
  48949. }),
  48950. (n.ColorKeywords = {
  48951. aliceblue: 15792383,
  48952. antiquewhite: 16444375,
  48953. aqua: 65535,
  48954. aquamarine: 8388564,
  48955. azure: 15794175,
  48956. beige: 16119260,
  48957. bisque: 16770244,
  48958. black: 0,
  48959. blanchedalmond: 16772045,
  48960. blue: 255,
  48961. blueviolet: 9055202,
  48962. brown: 10824234,
  48963. burlywood: 14596231,
  48964. cadetblue: 6266528,
  48965. chartreuse: 8388352,
  48966. chocolate: 13789470,
  48967. coral: 16744272,
  48968. cornflowerblue: 6591981,
  48969. cornsilk: 16775388,
  48970. crimson: 14423100,
  48971. cyan: 65535,
  48972. darkblue: 139,
  48973. darkcyan: 35723,
  48974. darkgoldenrod: 12092939,
  48975. darkgray: 11119017,
  48976. darkgreen: 25600,
  48977. darkgrey: 11119017,
  48978. darkkhaki: 12433259,
  48979. darkmagenta: 9109643,
  48980. darkolivegreen: 5597999,
  48981. darkorange: 16747520,
  48982. darkorchid: 10040012,
  48983. darkred: 9109504,
  48984. darksalmon: 15308410,
  48985. darkseagreen: 9419919,
  48986. darkslateblue: 4734347,
  48987. darkslategray: 3100495,
  48988. darkslategrey: 3100495,
  48989. darkturquoise: 52945,
  48990. darkviolet: 9699539,
  48991. deeppink: 16716947,
  48992. deepskyblue: 49151,
  48993. dimgray: 6908265,
  48994. dimgrey: 6908265,
  48995. dodgerblue: 2003199,
  48996. firebrick: 11674146,
  48997. floralwhite: 16775920,
  48998. forestgreen: 2263842,
  48999. fuchsia: 16711935,
  49000. gainsboro: 14474460,
  49001. ghostwhite: 16316671,
  49002. gold: 16766720,
  49003. goldenrod: 14329120,
  49004. gray: 8421504,
  49005. green: 32768,
  49006. greenyellow: 11403055,
  49007. grey: 8421504,
  49008. honeydew: 15794160,
  49009. hotpink: 16738740,
  49010. indianred: 13458524,
  49011. indigo: 4915330,
  49012. ivory: 16777200,
  49013. khaki: 15787660,
  49014. lavender: 15132410,
  49015. lavenderblush: 16773365,
  49016. lawngreen: 8190976,
  49017. lemonchiffon: 16775885,
  49018. lightblue: 11393254,
  49019. lightcoral: 15761536,
  49020. lightcyan: 14745599,
  49021. lightgoldenrodyellow: 16448210,
  49022. lightgray: 13882323,
  49023. lightgreen: 9498256,
  49024. lightgrey: 13882323,
  49025. lightpink: 16758465,
  49026. lightsalmon: 16752762,
  49027. lightseagreen: 2142890,
  49028. lightskyblue: 8900346,
  49029. lightslategray: 7833753,
  49030. lightslategrey: 7833753,
  49031. lightsteelblue: 11584734,
  49032. lightyellow: 16777184,
  49033. lime: 65280,
  49034. limegreen: 3329330,
  49035. linen: 16445670,
  49036. magenta: 16711935,
  49037. maroon: 8388608,
  49038. mediumaquamarine: 6737322,
  49039. mediumblue: 205,
  49040. mediumorchid: 12211667,
  49041. mediumpurple: 9662683,
  49042. mediumseagreen: 3978097,
  49043. mediumslateblue: 8087790,
  49044. mediumspringgreen: 64154,
  49045. mediumturquoise: 4772300,
  49046. mediumvioletred: 13047173,
  49047. midnightblue: 1644912,
  49048. mintcream: 16121850,
  49049. mistyrose: 16770273,
  49050. moccasin: 16770229,
  49051. navajowhite: 16768685,
  49052. navy: 128,
  49053. oldlace: 16643558,
  49054. olive: 8421376,
  49055. olivedrab: 7048739,
  49056. orange: 16753920,
  49057. orangered: 16729344,
  49058. orchid: 14315734,
  49059. palegoldenrod: 15657130,
  49060. palegreen: 10025880,
  49061. paleturquoise: 11529966,
  49062. palevioletred: 14381203,
  49063. papayawhip: 16773077,
  49064. peachpuff: 16767673,
  49065. peru: 13468991,
  49066. pink: 16761035,
  49067. plum: 14524637,
  49068. powderblue: 11591910,
  49069. purple: 8388736,
  49070. red: 16711680,
  49071. rosybrown: 12357519,
  49072. royalblue: 4286945,
  49073. saddlebrown: 9127187,
  49074. salmon: 16416882,
  49075. sandybrown: 16032864,
  49076. seagreen: 3050327,
  49077. seashell: 16774638,
  49078. sienna: 10506797,
  49079. silver: 12632256,
  49080. skyblue: 8900331,
  49081. slateblue: 6970061,
  49082. slategray: 7372944,
  49083. slategrey: 7372944,
  49084. snow: 16775930,
  49085. springgreen: 65407,
  49086. steelblue: 4620980,
  49087. tan: 13808780,
  49088. teal: 32896,
  49089. thistle: 14204888,
  49090. tomato: 16737095,
  49091. turquoise: 4251856,
  49092. violet: 15631086,
  49093. wheat: 16113331,
  49094. white: 16777215,
  49095. whitesmoke: 16119285,
  49096. yellow: 16776960,
  49097. yellowgreen: 10145074,
  49098. }),
  49099. (n.Quaternion = function (e, t, i, n) {
  49100. (this._x = e || 0),
  49101. (this._y = t || 0),
  49102. (this._z = i || 0),
  49103. (this._w = void 0 !== n ? n : 1);
  49104. }),
  49105. (n.Quaternion.prototype = {
  49106. constructor: n.Quaternion,
  49107. get x() {
  49108. return this._x;
  49109. },
  49110. set x(e) {
  49111. (this._x = e), this.onChangeCallback();
  49112. },
  49113. get y() {
  49114. return this._y;
  49115. },
  49116. set y(e) {
  49117. (this._y = e), this.onChangeCallback();
  49118. },
  49119. get z() {
  49120. return this._z;
  49121. },
  49122. set z(e) {
  49123. (this._z = e), this.onChangeCallback();
  49124. },
  49125. get w() {
  49126. return this._w;
  49127. },
  49128. set w(e) {
  49129. (this._w = e), this.onChangeCallback();
  49130. },
  49131. set: function (e, t, i, n) {
  49132. return (
  49133. (this._x = e),
  49134. (this._y = t),
  49135. (this._z = i),
  49136. (this._w = n),
  49137. this.onChangeCallback(),
  49138. this
  49139. );
  49140. },
  49141. clone: function () {
  49142. return new this.constructor(this._x, this._y, this._z, this._w);
  49143. },
  49144. copy: function (e) {
  49145. return (
  49146. (this._x = e.x),
  49147. (this._y = e.y),
  49148. (this._z = e.z),
  49149. (this._w = e.w),
  49150. this.onChangeCallback(),
  49151. this
  49152. );
  49153. },
  49154. setFromEuler: function (e, t) {
  49155. if (e instanceof n.Euler == !1)
  49156. throw new Error(
  49157. "THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order."
  49158. );
  49159. var i = Math.cos(e._x / 2),
  49160. r = Math.cos(e._y / 2),
  49161. o = Math.cos(e._z / 2),
  49162. a = Math.sin(e._x / 2),
  49163. s = Math.sin(e._y / 2),
  49164. l = Math.sin(e._z / 2),
  49165. c = e.order;
  49166. return (
  49167. "XYZ" === c
  49168. ? ((this._x = a * r * o + i * s * l),
  49169. (this._y = i * s * o - a * r * l),
  49170. (this._z = i * r * l + a * s * o),
  49171. (this._w = i * r * o - a * s * l))
  49172. : "YXZ" === c
  49173. ? ((this._x = a * r * o + i * s * l),
  49174. (this._y = i * s * o - a * r * l),
  49175. (this._z = i * r * l - a * s * o),
  49176. (this._w = i * r * o + a * s * l))
  49177. : "ZXY" === c
  49178. ? ((this._x = a * r * o - i * s * l),
  49179. (this._y = i * s * o + a * r * l),
  49180. (this._z = i * r * l + a * s * o),
  49181. (this._w = i * r * o - a * s * l))
  49182. : "ZYX" === c
  49183. ? ((this._x = a * r * o - i * s * l),
  49184. (this._y = i * s * o + a * r * l),
  49185. (this._z = i * r * l - a * s * o),
  49186. (this._w = i * r * o + a * s * l))
  49187. : "YZX" === c
  49188. ? ((this._x = a * r * o + i * s * l),
  49189. (this._y = i * s * o + a * r * l),
  49190. (this._z = i * r * l - a * s * o),
  49191. (this._w = i * r * o - a * s * l))
  49192. : "XZY" === c &&
  49193. ((this._x = a * r * o - i * s * l),
  49194. (this._y = i * s * o - a * r * l),
  49195. (this._z = i * r * l + a * s * o),
  49196. (this._w = i * r * o + a * s * l)),
  49197. t !== !1 && this.onChangeCallback(),
  49198. this
  49199. );
  49200. },
  49201. setFromAxisAngle: function (e, t) {
  49202. var i = t / 2,
  49203. n = Math.sin(i);
  49204. return (
  49205. (this._x = e.x * n),
  49206. (this._y = e.y * n),
  49207. (this._z = e.z * n),
  49208. (this._w = Math.cos(i)),
  49209. this.onChangeCallback(),
  49210. this
  49211. );
  49212. },
  49213. setFromRotationMatrix: function (e) {
  49214. var t,
  49215. i = e.elements,
  49216. n = i[0],
  49217. r = i[4],
  49218. o = i[8],
  49219. a = i[1],
  49220. s = i[5],
  49221. l = i[9],
  49222. c = i[2],
  49223. h = i[6],
  49224. u = i[10],
  49225. d = n + s + u;
  49226. return (
  49227. d > 0
  49228. ? ((t = 0.5 / Math.sqrt(d + 1)),
  49229. (this._w = 0.25 / t),
  49230. (this._x = (h - l) * t),
  49231. (this._y = (o - c) * t),
  49232. (this._z = (a - r) * t))
  49233. : n > s && n > u
  49234. ? ((t = 2 * Math.sqrt(1 + n - s - u)),
  49235. (this._w = (h - l) / t),
  49236. (this._x = 0.25 * t),
  49237. (this._y = (r + a) / t),
  49238. (this._z = (o + c) / t))
  49239. : s > u
  49240. ? ((t = 2 * Math.sqrt(1 + s - n - u)),
  49241. (this._w = (o - c) / t),
  49242. (this._x = (r + a) / t),
  49243. (this._y = 0.25 * t),
  49244. (this._z = (l + h) / t))
  49245. : ((t = 2 * Math.sqrt(1 + u - n - s)),
  49246. (this._w = (a - r) / t),
  49247. (this._x = (o + c) / t),
  49248. (this._y = (l + h) / t),
  49249. (this._z = 0.25 * t)),
  49250. this.onChangeCallback(),
  49251. this
  49252. );
  49253. },
  49254. setFromUnitVectors: (function () {
  49255. var e,
  49256. t,
  49257. i = 1e-6;
  49258. return function (r, o) {
  49259. return (
  49260. void 0 === e && (e = new n.Vector3()),
  49261. (t = r.dot(o) + 1),
  49262. t < i
  49263. ? ((t = 0),
  49264. Math.abs(r.x) > Math.abs(r.z)
  49265. ? e.set(-r.y, r.x, 0)
  49266. : e.set(0, -r.z, r.y))
  49267. : e.crossVectors(r, o),
  49268. (this._x = e.x),
  49269. (this._y = e.y),
  49270. (this._z = e.z),
  49271. (this._w = t),
  49272. this.normalize(),
  49273. this
  49274. );
  49275. };
  49276. })(),
  49277. inverse: function () {
  49278. return this.conjugate().normalize(), this;
  49279. },
  49280. conjugate: function () {
  49281. return (
  49282. (this._x *= -1),
  49283. (this._y *= -1),
  49284. (this._z *= -1),
  49285. this.onChangeCallback(),
  49286. this
  49287. );
  49288. },
  49289. dot: function (e) {
  49290. return (
  49291. this._x * e._x +
  49292. this._y * e._y +
  49293. this._z * e._z +
  49294. this._w * e._w
  49295. );
  49296. },
  49297. lengthSq: function () {
  49298. return (
  49299. this._x * this._x +
  49300. this._y * this._y +
  49301. this._z * this._z +
  49302. this._w * this._w
  49303. );
  49304. },
  49305. length: function () {
  49306. return Math.sqrt(
  49307. this._x * this._x +
  49308. this._y * this._y +
  49309. this._z * this._z +
  49310. this._w * this._w
  49311. );
  49312. },
  49313. normalize: function () {
  49314. var e = this.length();
  49315. return (
  49316. 0 === e
  49317. ? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1))
  49318. : ((e = 1 / e),
  49319. (this._x = this._x * e),
  49320. (this._y = this._y * e),
  49321. (this._z = this._z * e),
  49322. (this._w = this._w * e)),
  49323. this.onChangeCallback(),
  49324. this
  49325. );
  49326. },
  49327. multiply: function (e, t) {
  49328. return void 0 !== t
  49329. ? (console.warn(
  49330. "THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."
  49331. ),
  49332. this.multiplyQuaternions(e, t))
  49333. : this.multiplyQuaternions(this, e);
  49334. },
  49335. multiplyQuaternions: function (e, t) {
  49336. var i = e._x,
  49337. n = e._y,
  49338. r = e._z,
  49339. o = e._w,
  49340. a = t._x,
  49341. s = t._y,
  49342. l = t._z,
  49343. c = t._w;
  49344. return (
  49345. (this._x = i * c + o * a + n * l - r * s),
  49346. (this._y = n * c + o * s + r * a - i * l),
  49347. (this._z = r * c + o * l + i * s - n * a),
  49348. (this._w = o * c - i * a - n * s - r * l),
  49349. this.onChangeCallback(),
  49350. this
  49351. );
  49352. },
  49353. slerp: function (e, t) {
  49354. if (0 === t) return this;
  49355. if (1 === t) return this.copy(e);
  49356. var i = this._x,
  49357. n = this._y,
  49358. r = this._z,
  49359. o = this._w,
  49360. a = o * e._w + i * e._x + n * e._y + r * e._z;
  49361. if (
  49362. (a < 0
  49363. ? ((this._w = -e._w),
  49364. (this._x = -e._x),
  49365. (this._y = -e._y),
  49366. (this._z = -e._z),
  49367. (a = -a))
  49368. : this.copy(e),
  49369. a >= 1)
  49370. )
  49371. return (
  49372. (this._w = o),
  49373. (this._x = i),
  49374. (this._y = n),
  49375. (this._z = r),
  49376. this
  49377. );
  49378. var s = Math.sqrt(1 - a * a);
  49379. if (Math.abs(s) < 0.001)
  49380. return (
  49381. (this._w = 0.5 * (o + this._w)),
  49382. (this._x = 0.5 * (i + this._x)),
  49383. (this._y = 0.5 * (n + this._y)),
  49384. (this._z = 0.5 * (r + this._z)),
  49385. this
  49386. );
  49387. var l = Math.atan2(s, a),
  49388. c = Math.sin((1 - t) * l) / s,
  49389. h = Math.sin(t * l) / s;
  49390. return (
  49391. (this._w = o * c + this._w * h),
  49392. (this._x = i * c + this._x * h),
  49393. (this._y = n * c + this._y * h),
  49394. (this._z = r * c + this._z * h),
  49395. this.onChangeCallback(),
  49396. this
  49397. );
  49398. },
  49399. equals: function (e) {
  49400. return (
  49401. e._x === this._x &&
  49402. e._y === this._y &&
  49403. e._z === this._z &&
  49404. e._w === this._w
  49405. );
  49406. },
  49407. fromArray: function (e, t) {
  49408. return (
  49409. void 0 === t && (t = 0),
  49410. (this._x = e[t]),
  49411. (this._y = e[t + 1]),
  49412. (this._z = e[t + 2]),
  49413. (this._w = e[t + 3]),
  49414. this.onChangeCallback(),
  49415. this
  49416. );
  49417. },
  49418. toArray: function (e, t) {
  49419. return (
  49420. void 0 === e && (e = []),
  49421. void 0 === t && (t = 0),
  49422. (e[t] = this._x),
  49423. (e[t + 1] = this._y),
  49424. (e[t + 2] = this._z),
  49425. (e[t + 3] = this._w),
  49426. e
  49427. );
  49428. },
  49429. onChange: function (e) {
  49430. return (this.onChangeCallback = e), this;
  49431. },
  49432. onChangeCallback: function () {},
  49433. }),
  49434. Object.assign(n.Quaternion, {
  49435. slerp: function (e, t, i, n) {
  49436. return i.copy(e).slerp(t, n);
  49437. },
  49438. slerpFlat: function (e, t, i, n, r, o, a) {
  49439. var s = i[n + 0],
  49440. l = i[n + 1],
  49441. c = i[n + 2],
  49442. h = i[n + 3],
  49443. u = r[o + 0],
  49444. d = r[o + 1],
  49445. p = r[o + 2],
  49446. f = r[o + 3];
  49447. if (h !== f || s !== u || l !== d || c !== p) {
  49448. var g = 1 - a,
  49449. m = s * u + l * d + c * p + h * f,
  49450. v = m >= 0 ? 1 : -1,
  49451. A = 1 - m * m;
  49452. if (A > Number.EPSILON) {
  49453. var y = Math.sqrt(A),
  49454. C = Math.atan2(y, m * v);
  49455. (g = Math.sin(g * C) / y), (a = Math.sin(a * C) / y);
  49456. }
  49457. var I = a * v;
  49458. if (
  49459. ((s = s * g + u * I),
  49460. (l = l * g + d * I),
  49461. (c = c * g + p * I),
  49462. (h = h * g + f * I),
  49463. g === 1 - a)
  49464. ) {
  49465. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  49466. (s *= E), (l *= E), (c *= E), (h *= E);
  49467. }
  49468. }
  49469. (e[t] = s), (e[t + 1] = l), (e[t + 2] = c), (e[t + 3] = h);
  49470. },
  49471. }),
  49472. (n.Vector2 = function (e, t) {
  49473. (this.x = e || 0), (this.y = t || 0);
  49474. }),
  49475. (n.Vector2.prototype = {
  49476. constructor: n.Vector2,
  49477. get width() {
  49478. return this.x;
  49479. },
  49480. set width(e) {
  49481. this.x = e;
  49482. },
  49483. get height() {
  49484. return this.y;
  49485. },
  49486. set height(e) {
  49487. this.y = e;
  49488. },
  49489. set: function (e, t) {
  49490. return (this.x = e), (this.y = t), this;
  49491. },
  49492. setScalar: function (e) {
  49493. return (this.x = e), (this.y = e), this;
  49494. },
  49495. setX: function (e) {
  49496. return (this.x = e), this;
  49497. },
  49498. setY: function (e) {
  49499. return (this.y = e), this;
  49500. },
  49501. setComponent: function (e, t) {
  49502. switch (e) {
  49503. case 0:
  49504. this.x = t;
  49505. break;
  49506. case 1:
  49507. this.y = t;
  49508. break;
  49509. default:
  49510. throw new Error("index is out of range: " + e);
  49511. }
  49512. },
  49513. getComponent: function (e) {
  49514. switch (e) {
  49515. case 0:
  49516. return this.x;
  49517. case 1:
  49518. return this.y;
  49519. default:
  49520. throw new Error("index is out of range: " + e);
  49521. }
  49522. },
  49523. clone: function () {
  49524. return new this.constructor(this.x, this.y);
  49525. },
  49526. copy: function (e) {
  49527. return (this.x = e.x), (this.y = e.y), this;
  49528. },
  49529. add: function (e, t) {
  49530. return void 0 !== t
  49531. ? (console.warn(
  49532. "THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."
  49533. ),
  49534. this.addVectors(e, t))
  49535. : ((this.x += e.x), (this.y += e.y), this);
  49536. },
  49537. addScalar: function (e) {
  49538. return (this.x += e), (this.y += e), this;
  49539. },
  49540. addVectors: function (e, t) {
  49541. return (this.x = e.x + t.x), (this.y = e.y + t.y), this;
  49542. },
  49543. addScaledVector: function (e, t) {
  49544. return (this.x += e.x * t), (this.y += e.y * t), this;
  49545. },
  49546. sub: function (e, t) {
  49547. return void 0 !== t
  49548. ? (console.warn(
  49549. "THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."
  49550. ),
  49551. this.subVectors(e, t))
  49552. : ((this.x -= e.x), (this.y -= e.y), this);
  49553. },
  49554. subScalar: function (e) {
  49555. return (this.x -= e), (this.y -= e), this;
  49556. },
  49557. subVectors: function (e, t) {
  49558. return (this.x = e.x - t.x), (this.y = e.y - t.y), this;
  49559. },
  49560. multiply: function (e) {
  49561. return (this.x *= e.x), (this.y *= e.y), this;
  49562. },
  49563. multiplyScalar: function (e) {
  49564. return (
  49565. isFinite(e)
  49566. ? ((this.x *= e), (this.y *= e))
  49567. : ((this.x = 0), (this.y = 0)),
  49568. this
  49569. );
  49570. },
  49571. divide: function (e) {
  49572. return (this.x /= e.x), (this.y /= e.y), this;
  49573. },
  49574. divideScalar: function (e) {
  49575. return this.multiplyScalar(1 / e);
  49576. },
  49577. min: function (e) {
  49578. return (
  49579. (this.x = Math.min(this.x, e.x)),
  49580. (this.y = Math.min(this.y, e.y)),
  49581. this
  49582. );
  49583. },
  49584. max: function (e) {
  49585. return (
  49586. (this.x = Math.max(this.x, e.x)),
  49587. (this.y = Math.max(this.y, e.y)),
  49588. this
  49589. );
  49590. },
  49591. clamp: function (e, t) {
  49592. return (
  49593. (this.x = Math.max(e.x, Math.min(t.x, this.x))),
  49594. (this.y = Math.max(e.y, Math.min(t.y, this.y))),
  49595. this
  49596. );
  49597. },
  49598. clampScalar: (function () {
  49599. var e, t;
  49600. return function (i, r) {
  49601. return (
  49602. void 0 === e &&
  49603. ((e = new n.Vector2()), (t = new n.Vector2())),
  49604. e.set(i, i),
  49605. t.set(r, r),
  49606. this.clamp(e, t)
  49607. );
  49608. };
  49609. })(),
  49610. clampLength: function (e, t) {
  49611. var i = this.length();
  49612. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i), this;
  49613. },
  49614. floor: function () {
  49615. return (
  49616. (this.x = Math.floor(this.x)),
  49617. (this.y = Math.floor(this.y)),
  49618. this
  49619. );
  49620. },
  49621. ceil: function () {
  49622. return (
  49623. (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), this
  49624. );
  49625. },
  49626. round: function () {
  49627. return (
  49628. (this.x = Math.round(this.x)),
  49629. (this.y = Math.round(this.y)),
  49630. this
  49631. );
  49632. },
  49633. roundToZero: function () {
  49634. return (
  49635. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  49636. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  49637. this
  49638. );
  49639. },
  49640. negate: function () {
  49641. return (this.x = -this.x), (this.y = -this.y), this;
  49642. },
  49643. dot: function (e) {
  49644. return this.x * e.x + this.y * e.y;
  49645. },
  49646. lengthSq: function () {
  49647. return this.x * this.x + this.y * this.y;
  49648. },
  49649. length: function () {
  49650. return Math.sqrt(this.x * this.x + this.y * this.y);
  49651. },
  49652. lengthManhattan: function () {
  49653. return Math.abs(this.x) + Math.abs(this.y);
  49654. },
  49655. normalize: function () {
  49656. return this.divideScalar(this.length());
  49657. },
  49658. angle: function () {
  49659. var e = Math.atan2(this.y, this.x);
  49660. return e < 0 && (e += 2 * Math.PI), e;
  49661. },
  49662. distanceTo: function (e) {
  49663. return Math.sqrt(this.distanceToSquared(e));
  49664. },
  49665. distanceToSquared: function (e) {
  49666. var t = this.x - e.x,
  49667. i = this.y - e.y;
  49668. return t * t + i * i;
  49669. },
  49670. setLength: function (e) {
  49671. return this.multiplyScalar(e / this.length());
  49672. },
  49673. lerp: function (e, t) {
  49674. return (
  49675. (this.x += (e.x - this.x) * t),
  49676. (this.y += (e.y - this.y) * t),
  49677. this
  49678. );
  49679. },
  49680. lerpVectors: function (e, t, i) {
  49681. return this.subVectors(t, e).multiplyScalar(i).add(e), this;
  49682. },
  49683. equals: function (e) {
  49684. return e.x === this.x && e.y === this.y;
  49685. },
  49686. fromArray: function (e, t) {
  49687. return (
  49688. void 0 === t && (t = 0),
  49689. (this.x = e[t]),
  49690. (this.y = e[t + 1]),
  49691. this
  49692. );
  49693. },
  49694. toArray: function (e, t) {
  49695. return (
  49696. void 0 === e && (e = []),
  49697. void 0 === t && (t = 0),
  49698. (e[t] = this.x),
  49699. (e[t + 1] = this.y),
  49700. e
  49701. );
  49702. },
  49703. fromAttribute: function (e, t, i) {
  49704. return (
  49705. void 0 === i && (i = 0),
  49706. (t = t * e.itemSize + i),
  49707. (this.x = e.array[t]),
  49708. (this.y = e.array[t + 1]),
  49709. this
  49710. );
  49711. },
  49712. rotateAround: function (e, t) {
  49713. var i = Math.cos(t),
  49714. n = Math.sin(t),
  49715. r = this.x - e.x,
  49716. o = this.y - e.y;
  49717. return (
  49718. (this.x = r * i - o * n + e.x),
  49719. (this.y = r * n + o * i + e.y),
  49720. this
  49721. );
  49722. },
  49723. }),
  49724. (n.Vector3 = function (e, t, i) {
  49725. (this.x = e || 0), (this.y = t || 0), (this.z = i || 0);
  49726. }),
  49727. (n.Vector3.prototype = {
  49728. constructor: n.Vector3,
  49729. set: function (e, t, i) {
  49730. return (this.x = e), (this.y = t), (this.z = i), this;
  49731. },
  49732. setScalar: function (e) {
  49733. return (this.x = e), (this.y = e), (this.z = e), this;
  49734. },
  49735. setX: function (e) {
  49736. return (this.x = e), this;
  49737. },
  49738. setY: function (e) {
  49739. return (this.y = e), this;
  49740. },
  49741. setZ: function (e) {
  49742. return (this.z = e), this;
  49743. },
  49744. setComponent: function (e, t) {
  49745. switch (e) {
  49746. case 0:
  49747. this.x = t;
  49748. break;
  49749. case 1:
  49750. this.y = t;
  49751. break;
  49752. case 2:
  49753. this.z = t;
  49754. break;
  49755. default:
  49756. throw new Error("index is out of range: " + e);
  49757. }
  49758. },
  49759. getComponent: function (e) {
  49760. switch (e) {
  49761. case 0:
  49762. return this.x;
  49763. case 1:
  49764. return this.y;
  49765. case 2:
  49766. return this.z;
  49767. default:
  49768. throw new Error("index is out of range: " + e);
  49769. }
  49770. },
  49771. clone: function () {
  49772. return new this.constructor(this.x, this.y, this.z);
  49773. },
  49774. copy: function (e) {
  49775. return (this.x = e.x), (this.y = e.y), (this.z = e.z), this;
  49776. },
  49777. add: function (e, t) {
  49778. return void 0 !== t
  49779. ? (console.warn(
  49780. "THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."
  49781. ),
  49782. this.addVectors(e, t))
  49783. : ((this.x += e.x), (this.y += e.y), (this.z += e.z), this);
  49784. },
  49785. addScalar: function (e) {
  49786. return (this.x += e), (this.y += e), (this.z += e), this;
  49787. },
  49788. addVectors: function (e, t) {
  49789. return (
  49790. (this.x = e.x + t.x),
  49791. (this.y = e.y + t.y),
  49792. (this.z = e.z + t.z),
  49793. this
  49794. );
  49795. },
  49796. addScaledVector: function (e, t) {
  49797. return (
  49798. (this.x += e.x * t),
  49799. (this.y += e.y * t),
  49800. (this.z += e.z * t),
  49801. this
  49802. );
  49803. },
  49804. sub: function (e, t) {
  49805. return void 0 !== t
  49806. ? (console.warn(
  49807. "THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."
  49808. ),
  49809. this.subVectors(e, t))
  49810. : ((this.x -= e.x), (this.y -= e.y), (this.z -= e.z), this);
  49811. },
  49812. subScalar: function (e) {
  49813. return (this.x -= e), (this.y -= e), (this.z -= e), this;
  49814. },
  49815. subVectors: function (e, t) {
  49816. return (
  49817. (this.x = e.x - t.x),
  49818. (this.y = e.y - t.y),
  49819. (this.z = e.z - t.z),
  49820. this
  49821. );
  49822. },
  49823. multiply: function (e, t) {
  49824. return void 0 !== t
  49825. ? (console.warn(
  49826. "THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."
  49827. ),
  49828. this.multiplyVectors(e, t))
  49829. : ((this.x *= e.x), (this.y *= e.y), (this.z *= e.z), this);
  49830. },
  49831. multiplyScalar: function (e) {
  49832. return (
  49833. isFinite(e)
  49834. ? ((this.x *= e), (this.y *= e), (this.z *= e))
  49835. : ((this.x = 0), (this.y = 0), (this.z = 0)),
  49836. this
  49837. );
  49838. },
  49839. multiplyVectors: function (e, t) {
  49840. return (
  49841. (this.x = e.x * t.x),
  49842. (this.y = e.y * t.y),
  49843. (this.z = e.z * t.z),
  49844. this
  49845. );
  49846. },
  49847. applyEuler: (function () {
  49848. var e;
  49849. return function (t) {
  49850. return (
  49851. t instanceof n.Euler == !1 &&
  49852. console.error(
  49853. "THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."
  49854. ),
  49855. void 0 === e && (e = new n.Quaternion()),
  49856. this.applyQuaternion(e.setFromEuler(t)),
  49857. this
  49858. );
  49859. };
  49860. })(),
  49861. applyAxisAngle: (function () {
  49862. var e;
  49863. return function (t, i) {
  49864. return (
  49865. void 0 === e && (e = new n.Quaternion()),
  49866. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  49867. this
  49868. );
  49869. };
  49870. })(),
  49871. applyMatrix3: function (e) {
  49872. var t = this.x,
  49873. i = this.y,
  49874. n = this.z,
  49875. r = e.elements;
  49876. return (
  49877. (this.x = r[0] * t + r[3] * i + r[6] * n),
  49878. (this.y = r[1] * t + r[4] * i + r[7] * n),
  49879. (this.z = r[2] * t + r[5] * i + r[8] * n),
  49880. this
  49881. );
  49882. },
  49883. applyMatrix4: function (e) {
  49884. var t = this.x,
  49885. i = this.y,
  49886. n = this.z,
  49887. r = e.elements;
  49888. return (
  49889. (this.x = r[0] * t + r[4] * i + r[8] * n + r[12]),
  49890. (this.y = r[1] * t + r[5] * i + r[9] * n + r[13]),
  49891. (this.z = r[2] * t + r[6] * i + r[10] * n + r[14]),
  49892. this
  49893. );
  49894. },
  49895. applyProjection: function (e) {
  49896. var t = this.x,
  49897. i = this.y,
  49898. n = this.z,
  49899. r = e.elements,
  49900. o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  49901. return (
  49902. (this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o),
  49903. (this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o),
  49904. (this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o),
  49905. this
  49906. );
  49907. },
  49908. applyQuaternion: function (e) {
  49909. var t = this.x,
  49910. i = this.y,
  49911. n = this.z,
  49912. r = e.x,
  49913. o = e.y,
  49914. a = e.z,
  49915. s = e.w,
  49916. l = s * t + o * n - a * i,
  49917. c = s * i + a * t - r * n,
  49918. h = s * n + r * i - o * t,
  49919. u = -r * t - o * i - a * n;
  49920. return (
  49921. (this.x = l * s + u * -r + c * -a - h * -o),
  49922. (this.y = c * s + u * -o + h * -r - l * -a),
  49923. (this.z = h * s + u * -a + l * -o - c * -r),
  49924. this
  49925. );
  49926. },
  49927. project: (function () {
  49928. var e;
  49929. return function (t) {
  49930. return (
  49931. void 0 === e && (e = new n.Matrix4()),
  49932. e.multiplyMatrices(
  49933. t.projectionMatrix,
  49934. e.getInverse(t.matrixWorld)
  49935. ),
  49936. this.applyProjection(e)
  49937. );
  49938. };
  49939. })(),
  49940. unproject: (function () {
  49941. var e;
  49942. return function (t) {
  49943. return (
  49944. void 0 === e && (e = new n.Matrix4()),
  49945. e.multiplyMatrices(
  49946. t.matrixWorld,
  49947. e.getInverse(t.projectionMatrix)
  49948. ),
  49949. this.applyProjection(e)
  49950. );
  49951. };
  49952. })(),
  49953. transformDirection: function (e) {
  49954. var t = this.x,
  49955. i = this.y,
  49956. n = this.z,
  49957. r = e.elements;
  49958. return (
  49959. (this.x = r[0] * t + r[4] * i + r[8] * n),
  49960. (this.y = r[1] * t + r[5] * i + r[9] * n),
  49961. (this.z = r[2] * t + r[6] * i + r[10] * n),
  49962. this.normalize(),
  49963. this
  49964. );
  49965. },
  49966. divide: function (e) {
  49967. return (this.x /= e.x), (this.y /= e.y), (this.z /= e.z), this;
  49968. },
  49969. divideScalar: function (e) {
  49970. return this.multiplyScalar(1 / e);
  49971. },
  49972. min: function (e) {
  49973. return (
  49974. (this.x = Math.min(this.x, e.x)),
  49975. (this.y = Math.min(this.y, e.y)),
  49976. (this.z = Math.min(this.z, e.z)),
  49977. this
  49978. );
  49979. },
  49980. max: function (e) {
  49981. return (
  49982. (this.x = Math.max(this.x, e.x)),
  49983. (this.y = Math.max(this.y, e.y)),
  49984. (this.z = Math.max(this.z, e.z)),
  49985. this
  49986. );
  49987. },
  49988. clamp: function (e, t) {
  49989. return (
  49990. (this.x = Math.max(e.x, Math.min(t.x, this.x))),
  49991. (this.y = Math.max(e.y, Math.min(t.y, this.y))),
  49992. (this.z = Math.max(e.z, Math.min(t.z, this.z))),
  49993. this
  49994. );
  49995. },
  49996. clampScalar: (function () {
  49997. var e, t;
  49998. return function (i, r) {
  49999. return (
  50000. void 0 === e &&
  50001. ((e = new n.Vector3()), (t = new n.Vector3())),
  50002. e.set(i, i, i),
  50003. t.set(r, r, r),
  50004. this.clamp(e, t)
  50005. );
  50006. };
  50007. })(),
  50008. clampLength: function (e, t) {
  50009. var i = this.length();
  50010. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i), this;
  50011. },
  50012. floor: function () {
  50013. return (
  50014. (this.x = Math.floor(this.x)),
  50015. (this.y = Math.floor(this.y)),
  50016. (this.z = Math.floor(this.z)),
  50017. this
  50018. );
  50019. },
  50020. ceil: function () {
  50021. return (
  50022. (this.x = Math.ceil(this.x)),
  50023. (this.y = Math.ceil(this.y)),
  50024. (this.z = Math.ceil(this.z)),
  50025. this
  50026. );
  50027. },
  50028. round: function () {
  50029. return (
  50030. (this.x = Math.round(this.x)),
  50031. (this.y = Math.round(this.y)),
  50032. (this.z = Math.round(this.z)),
  50033. this
  50034. );
  50035. },
  50036. roundToZero: function () {
  50037. return (
  50038. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  50039. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  50040. (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
  50041. this
  50042. );
  50043. },
  50044. negate: function () {
  50045. return (
  50046. (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), this
  50047. );
  50048. },
  50049. dot: function (e) {
  50050. return this.x * e.x + this.y * e.y + this.z * e.z;
  50051. },
  50052. lengthSq: function () {
  50053. return this.x * this.x + this.y * this.y + this.z * this.z;
  50054. },
  50055. length: function () {
  50056. return Math.sqrt(
  50057. this.x * this.x + this.y * this.y + this.z * this.z
  50058. );
  50059. },
  50060. lengthManhattan: function () {
  50061. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);
  50062. },
  50063. normalize: function () {
  50064. return this.divideScalar(this.length());
  50065. },
  50066. setLength: function (e) {
  50067. return this.multiplyScalar(e / this.length());
  50068. },
  50069. lerp: function (e, t) {
  50070. return (
  50071. (this.x += (e.x - this.x) * t),
  50072. (this.y += (e.y - this.y) * t),
  50073. (this.z += (e.z - this.z) * t),
  50074. this
  50075. );
  50076. },
  50077. lerpVectors: function (e, t, i) {
  50078. return this.subVectors(t, e).multiplyScalar(i).add(e), this;
  50079. },
  50080. cross: function (e, t) {
  50081. if (void 0 !== t)
  50082. return (
  50083. console.warn(
  50084. "THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."
  50085. ),
  50086. this.crossVectors(e, t)
  50087. );
  50088. var i = this.x,
  50089. n = this.y,
  50090. r = this.z;
  50091. return (
  50092. (this.x = n * e.z - r * e.y),
  50093. (this.y = r * e.x - i * e.z),
  50094. (this.z = i * e.y - n * e.x),
  50095. this
  50096. );
  50097. },
  50098. crossVectors: function (e, t) {
  50099. var i = e.x,
  50100. n = e.y,
  50101. r = e.z,
  50102. o = t.x,
  50103. a = t.y,
  50104. s = t.z;
  50105. return (
  50106. (this.x = n * s - r * a),
  50107. (this.y = r * o - i * s),
  50108. (this.z = i * a - n * o),
  50109. this
  50110. );
  50111. },
  50112. projectOnVector: (function () {
  50113. var e, t;
  50114. return function (i) {
  50115. return (
  50116. void 0 === e && (e = new n.Vector3()),
  50117. e.copy(i).normalize(),
  50118. (t = this.dot(e)),
  50119. this.copy(e).multiplyScalar(t)
  50120. );
  50121. };
  50122. })(),
  50123. projectOnPlane: (function () {
  50124. var e;
  50125. return function (t) {
  50126. return (
  50127. void 0 === e && (e = new n.Vector3()),
  50128. e.copy(this).projectOnVector(t),
  50129. this.sub(e)
  50130. );
  50131. };
  50132. })(),
  50133. reflect: (function () {
  50134. var e;
  50135. return function (t) {
  50136. return (
  50137. void 0 === e && (e = new n.Vector3()),
  50138. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  50139. );
  50140. };
  50141. })(),
  50142. angleTo: function (e) {
  50143. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  50144. return Math.acos(n.Math.clamp(t, -1, 1));
  50145. },
  50146. distanceTo: function (e) {
  50147. return Math.sqrt(this.distanceToSquared(e));
  50148. },
  50149. distanceToSquared: function (e) {
  50150. var t = this.x - e.x,
  50151. i = this.y - e.y,
  50152. n = this.z - e.z;
  50153. return t * t + i * i + n * n;
  50154. },
  50155. setFromSpherical: function (e) {
  50156. var t = Math.sin(e.phi) * e.radius;
  50157. return (
  50158. (this.x = t * Math.sin(e.theta)),
  50159. (this.y = Math.cos(e.phi) * e.radius),
  50160. (this.z = t * Math.cos(e.theta)),
  50161. this
  50162. );
  50163. },
  50164. setFromMatrixPosition: function (e) {
  50165. return this.setFromMatrixColumn(e, 3);
  50166. },
  50167. setFromMatrixScale: function (e) {
  50168. var t = this.setFromMatrixColumn(e, 0).length(),
  50169. i = this.setFromMatrixColumn(e, 1).length(),
  50170. n = this.setFromMatrixColumn(e, 2).length();
  50171. return (this.x = t), (this.y = i), (this.z = n), this;
  50172. },
  50173. setFromMatrixColumn: function (e, t) {
  50174. return (
  50175. "number" == typeof e &&
  50176. (console.warn(
  50177. "THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."
  50178. ),
  50179. (e = arguments[1]),
  50180. (t = arguments[0])),
  50181. this.fromArray(e.elements, 4 * t)
  50182. );
  50183. },
  50184. equals: function (e) {
  50185. return e.x === this.x && e.y === this.y && e.z === this.z;
  50186. },
  50187. fromArray: function (e, t) {
  50188. return (
  50189. void 0 === t && (t = 0),
  50190. (this.x = e[t]),
  50191. (this.y = e[t + 1]),
  50192. (this.z = e[t + 2]),
  50193. this
  50194. );
  50195. },
  50196. toArray: function (e, t) {
  50197. return (
  50198. void 0 === e && (e = []),
  50199. void 0 === t && (t = 0),
  50200. (e[t] = this.x),
  50201. (e[t + 1] = this.y),
  50202. (e[t + 2] = this.z),
  50203. e
  50204. );
  50205. },
  50206. fromAttribute: function (e, t, i) {
  50207. return (
  50208. void 0 === i && (i = 0),
  50209. (t = t * e.itemSize + i),
  50210. (this.x = e.array[t]),
  50211. (this.y = e.array[t + 1]),
  50212. (this.z = e.array[t + 2]),
  50213. this
  50214. );
  50215. },
  50216. }),
  50217. (n.Vector4 = function (e, t, i, n) {
  50218. (this.x = e || 0),
  50219. (this.y = t || 0),
  50220. (this.z = i || 0),
  50221. (this.w = void 0 !== n ? n : 1);
  50222. }),
  50223. (n.Vector4.prototype = {
  50224. constructor: n.Vector4,
  50225. set: function (e, t, i, n) {
  50226. return (
  50227. (this.x = e), (this.y = t), (this.z = i), (this.w = n), this
  50228. );
  50229. },
  50230. setScalar: function (e) {
  50231. return (
  50232. (this.x = e), (this.y = e), (this.z = e), (this.w = e), this
  50233. );
  50234. },
  50235. setX: function (e) {
  50236. return (this.x = e), this;
  50237. },
  50238. setY: function (e) {
  50239. return (this.y = e), this;
  50240. },
  50241. setZ: function (e) {
  50242. return (this.z = e), this;
  50243. },
  50244. setW: function (e) {
  50245. return (this.w = e), this;
  50246. },
  50247. setComponent: function (e, t) {
  50248. switch (e) {
  50249. case 0:
  50250. this.x = t;
  50251. break;
  50252. case 1:
  50253. this.y = t;
  50254. break;
  50255. case 2:
  50256. this.z = t;
  50257. break;
  50258. case 3:
  50259. this.w = t;
  50260. break;
  50261. default:
  50262. throw new Error("index is out of range: " + e);
  50263. }
  50264. },
  50265. getComponent: function (e) {
  50266. switch (e) {
  50267. case 0:
  50268. return this.x;
  50269. case 1:
  50270. return this.y;
  50271. case 2:
  50272. return this.z;
  50273. case 3:
  50274. return this.w;
  50275. default:
  50276. throw new Error("index is out of range: " + e);
  50277. }
  50278. },
  50279. clone: function () {
  50280. return new this.constructor(this.x, this.y, this.z, this.w);
  50281. },
  50282. copy: function (e) {
  50283. return (
  50284. (this.x = e.x),
  50285. (this.y = e.y),
  50286. (this.z = e.z),
  50287. (this.w = void 0 !== e.w ? e.w : 1),
  50288. this
  50289. );
  50290. },
  50291. add: function (e, t) {
  50292. return void 0 !== t
  50293. ? (console.warn(
  50294. "THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."
  50295. ),
  50296. this.addVectors(e, t))
  50297. : ((this.x += e.x),
  50298. (this.y += e.y),
  50299. (this.z += e.z),
  50300. (this.w += e.w),
  50301. this);
  50302. },
  50303. addScalar: function (e) {
  50304. return (
  50305. (this.x += e), (this.y += e), (this.z += e), (this.w += e), this
  50306. );
  50307. },
  50308. addVectors: function (e, t) {
  50309. return (
  50310. (this.x = e.x + t.x),
  50311. (this.y = e.y + t.y),
  50312. (this.z = e.z + t.z),
  50313. (this.w = e.w + t.w),
  50314. this
  50315. );
  50316. },
  50317. addScaledVector: function (e, t) {
  50318. return (
  50319. (this.x += e.x * t),
  50320. (this.y += e.y * t),
  50321. (this.z += e.z * t),
  50322. (this.w += e.w * t),
  50323. this
  50324. );
  50325. },
  50326. sub: function (e, t) {
  50327. return void 0 !== t
  50328. ? (console.warn(
  50329. "THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."
  50330. ),
  50331. this.subVectors(e, t))
  50332. : ((this.x -= e.x),
  50333. (this.y -= e.y),
  50334. (this.z -= e.z),
  50335. (this.w -= e.w),
  50336. this);
  50337. },
  50338. subScalar: function (e) {
  50339. return (
  50340. (this.x -= e), (this.y -= e), (this.z -= e), (this.w -= e), this
  50341. );
  50342. },
  50343. subVectors: function (e, t) {
  50344. return (
  50345. (this.x = e.x - t.x),
  50346. (this.y = e.y - t.y),
  50347. (this.z = e.z - t.z),
  50348. (this.w = e.w - t.w),
  50349. this
  50350. );
  50351. },
  50352. multiplyScalar: function (e) {
  50353. return (
  50354. isFinite(e)
  50355. ? ((this.x *= e), (this.y *= e), (this.z *= e), (this.w *= e))
  50356. : ((this.x = 0), (this.y = 0), (this.z = 0), (this.w = 0)),
  50357. this
  50358. );
  50359. },
  50360. applyMatrix4: function (e) {
  50361. var t = this.x,
  50362. i = this.y,
  50363. n = this.z,
  50364. r = this.w,
  50365. o = e.elements;
  50366. return (
  50367. (this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r),
  50368. (this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r),
  50369. (this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r),
  50370. (this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r),
  50371. this
  50372. );
  50373. },
  50374. divideScalar: function (e) {
  50375. return this.multiplyScalar(1 / e);
  50376. },
  50377. setAxisAngleFromQuaternion: function (e) {
  50378. this.w = 2 * Math.acos(e.w);
  50379. var t = Math.sqrt(1 - e.w * e.w);
  50380. return (
  50381. t < 1e-4
  50382. ? ((this.x = 1), (this.y = 0), (this.z = 0))
  50383. : ((this.x = e.x / t),
  50384. (this.y = e.y / t),
  50385. (this.z = e.z / t)),
  50386. this
  50387. );
  50388. },
  50389. setAxisAngleFromRotationMatrix: function (e) {
  50390. var t,
  50391. i,
  50392. n,
  50393. r,
  50394. o = 0.01,
  50395. a = 0.1,
  50396. s = e.elements,
  50397. l = s[0],
  50398. c = s[4],
  50399. h = s[8],
  50400. u = s[1],
  50401. d = s[5],
  50402. p = s[9],
  50403. f = s[2],
  50404. g = s[6],
  50405. m = s[10];
  50406. if (
  50407. Math.abs(c - u) < o &&
  50408. Math.abs(h - f) < o &&
  50409. Math.abs(p - g) < o
  50410. ) {
  50411. if (
  50412. Math.abs(c + u) < a &&
  50413. Math.abs(h + f) < a &&
  50414. Math.abs(p + g) < a &&
  50415. Math.abs(l + d + m - 3) < a
  50416. )
  50417. return this.set(1, 0, 0, 0), this;
  50418. t = Math.PI;
  50419. var v = (l + 1) / 2,
  50420. A = (d + 1) / 2,
  50421. y = (m + 1) / 2,
  50422. C = (c + u) / 4,
  50423. I = (h + f) / 4,
  50424. E = (p + g) / 4;
  50425. return (
  50426. v > A && v > y
  50427. ? v < o
  50428. ? ((i = 0), (n = 0.707106781), (r = 0.707106781))
  50429. : ((i = Math.sqrt(v)), (n = C / i), (r = I / i))
  50430. : A > y
  50431. ? A < o
  50432. ? ((i = 0.707106781), (n = 0), (r = 0.707106781))
  50433. : ((n = Math.sqrt(A)), (i = C / n), (r = E / n))
  50434. : y < o
  50435. ? ((i = 0.707106781), (n = 0.707106781), (r = 0))
  50436. : ((r = Math.sqrt(y)), (i = I / r), (n = E / r)),
  50437. this.set(i, n, r, t),
  50438. this
  50439. );
  50440. }
  50441. var b = Math.sqrt(
  50442. (g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c)
  50443. );
  50444. return (
  50445. Math.abs(b) < 0.001 && (b = 1),
  50446. (this.x = (g - p) / b),
  50447. (this.y = (h - f) / b),
  50448. (this.z = (u - c) / b),
  50449. (this.w = Math.acos((l + d + m - 1) / 2)),
  50450. this
  50451. );
  50452. },
  50453. min: function (e) {
  50454. return (
  50455. (this.x = Math.min(this.x, e.x)),
  50456. (this.y = Math.min(this.y, e.y)),
  50457. (this.z = Math.min(this.z, e.z)),
  50458. (this.w = Math.min(this.w, e.w)),
  50459. this
  50460. );
  50461. },
  50462. max: function (e) {
  50463. return (
  50464. (this.x = Math.max(this.x, e.x)),
  50465. (this.y = Math.max(this.y, e.y)),
  50466. (this.z = Math.max(this.z, e.z)),
  50467. (this.w = Math.max(this.w, e.w)),
  50468. this
  50469. );
  50470. },
  50471. clamp: function (e, t) {
  50472. return (
  50473. (this.x = Math.max(e.x, Math.min(t.x, this.x))),
  50474. (this.y = Math.max(e.y, Math.min(t.y, this.y))),
  50475. (this.z = Math.max(e.z, Math.min(t.z, this.z))),
  50476. (this.w = Math.max(e.w, Math.min(t.w, this.w))),
  50477. this
  50478. );
  50479. },
  50480. clampScalar: (function () {
  50481. var e, t;
  50482. return function (i, r) {
  50483. return (
  50484. void 0 === e &&
  50485. ((e = new n.Vector4()), (t = new n.Vector4())),
  50486. e.set(i, i, i, i),
  50487. t.set(r, r, r, r),
  50488. this.clamp(e, t)
  50489. );
  50490. };
  50491. })(),
  50492. floor: function () {
  50493. return (
  50494. (this.x = Math.floor(this.x)),
  50495. (this.y = Math.floor(this.y)),
  50496. (this.z = Math.floor(this.z)),
  50497. (this.w = Math.floor(this.w)),
  50498. this
  50499. );
  50500. },
  50501. ceil: function () {
  50502. return (
  50503. (this.x = Math.ceil(this.x)),
  50504. (this.y = Math.ceil(this.y)),
  50505. (this.z = Math.ceil(this.z)),
  50506. (this.w = Math.ceil(this.w)),
  50507. this
  50508. );
  50509. },
  50510. round: function () {
  50511. return (
  50512. (this.x = Math.round(this.x)),
  50513. (this.y = Math.round(this.y)),
  50514. (this.z = Math.round(this.z)),
  50515. (this.w = Math.round(this.w)),
  50516. this
  50517. );
  50518. },
  50519. roundToZero: function () {
  50520. return (
  50521. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  50522. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  50523. (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
  50524. (this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w)),
  50525. this
  50526. );
  50527. },
  50528. negate: function () {
  50529. return (
  50530. (this.x = -this.x),
  50531. (this.y = -this.y),
  50532. (this.z = -this.z),
  50533. (this.w = -this.w),
  50534. this
  50535. );
  50536. },
  50537. dot: function (e) {
  50538. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w;
  50539. },
  50540. lengthSq: function () {
  50541. return (
  50542. this.x * this.x +
  50543. this.y * this.y +
  50544. this.z * this.z +
  50545. this.w * this.w
  50546. );
  50547. },
  50548. length: function () {
  50549. return Math.sqrt(
  50550. this.x * this.x +
  50551. this.y * this.y +
  50552. this.z * this.z +
  50553. this.w * this.w
  50554. );
  50555. },
  50556. lengthManhattan: function () {
  50557. return (
  50558. Math.abs(this.x) +
  50559. Math.abs(this.y) +
  50560. Math.abs(this.z) +
  50561. Math.abs(this.w)
  50562. );
  50563. },
  50564. normalize: function () {
  50565. return this.divideScalar(this.length());
  50566. },
  50567. setLength: function (e) {
  50568. return this.multiplyScalar(e / this.length());
  50569. },
  50570. lerp: function (e, t) {
  50571. return (
  50572. (this.x += (e.x - this.x) * t),
  50573. (this.y += (e.y - this.y) * t),
  50574. (this.z += (e.z - this.z) * t),
  50575. (this.w += (e.w - this.w) * t),
  50576. this
  50577. );
  50578. },
  50579. lerpVectors: function (e, t, i) {
  50580. return this.subVectors(t, e).multiplyScalar(i).add(e), this;
  50581. },
  50582. equals: function (e) {
  50583. return (
  50584. e.x === this.x &&
  50585. e.y === this.y &&
  50586. e.z === this.z &&
  50587. e.w === this.w
  50588. );
  50589. },
  50590. fromArray: function (e, t) {
  50591. return (
  50592. void 0 === t && (t = 0),
  50593. (this.x = e[t]),
  50594. (this.y = e[t + 1]),
  50595. (this.z = e[t + 2]),
  50596. (this.w = e[t + 3]),
  50597. this
  50598. );
  50599. },
  50600. toArray: function (e, t) {
  50601. return (
  50602. void 0 === e && (e = []),
  50603. void 0 === t && (t = 0),
  50604. (e[t] = this.x),
  50605. (e[t + 1] = this.y),
  50606. (e[t + 2] = this.z),
  50607. (e[t + 3] = this.w),
  50608. e
  50609. );
  50610. },
  50611. fromAttribute: function (e, t, i) {
  50612. return (
  50613. void 0 === i && (i = 0),
  50614. (t = t * e.itemSize + i),
  50615. (this.x = e.array[t]),
  50616. (this.y = e.array[t + 1]),
  50617. (this.z = e.array[t + 2]),
  50618. (this.w = e.array[t + 3]),
  50619. this
  50620. );
  50621. },
  50622. }),
  50623. (n.Euler = function (e, t, i, r) {
  50624. (this._x = e || 0),
  50625. (this._y = t || 0),
  50626. (this._z = i || 0),
  50627. (this._order = r || n.Euler.DefaultOrder);
  50628. }),
  50629. (n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"]),
  50630. (n.Euler.DefaultOrder = "XYZ"),
  50631. (n.Euler.prototype = {
  50632. constructor: n.Euler,
  50633. get x() {
  50634. return this._x;
  50635. },
  50636. set x(e) {
  50637. (this._x = e), this.onChangeCallback();
  50638. },
  50639. get y() {
  50640. return this._y;
  50641. },
  50642. set y(e) {
  50643. (this._y = e), this.onChangeCallback();
  50644. },
  50645. get z() {
  50646. return this._z;
  50647. },
  50648. set z(e) {
  50649. (this._z = e), this.onChangeCallback();
  50650. },
  50651. get order() {
  50652. return this._order;
  50653. },
  50654. set order(e) {
  50655. (this._order = e), this.onChangeCallback();
  50656. },
  50657. set: function (e, t, i, n) {
  50658. return (
  50659. (this._x = e),
  50660. (this._y = t),
  50661. (this._z = i),
  50662. (this._order = n || this._order),
  50663. this.onChangeCallback(),
  50664. this
  50665. );
  50666. },
  50667. clone: function () {
  50668. return new this.constructor(
  50669. this._x,
  50670. this._y,
  50671. this._z,
  50672. this._order
  50673. );
  50674. },
  50675. copy: function (e) {
  50676. return (
  50677. (this._x = e._x),
  50678. (this._y = e._y),
  50679. (this._z = e._z),
  50680. (this._order = e._order),
  50681. this.onChangeCallback(),
  50682. this
  50683. );
  50684. },
  50685. setFromRotationMatrix: function (e, t, i) {
  50686. var r = n.Math.clamp,
  50687. o = e.elements,
  50688. a = o[0],
  50689. s = o[4],
  50690. l = o[8],
  50691. c = o[1],
  50692. h = o[5],
  50693. u = o[9],
  50694. d = o[2],
  50695. p = o[6],
  50696. f = o[10];
  50697. return (
  50698. (t = t || this._order),
  50699. "XYZ" === t
  50700. ? ((this._y = Math.asin(r(l, -1, 1))),
  50701. Math.abs(l) < 0.99999
  50702. ? ((this._x = Math.atan2(-u, f)),
  50703. (this._z = Math.atan2(-s, a)))
  50704. : ((this._x = Math.atan2(p, h)), (this._z = 0)))
  50705. : "YXZ" === t
  50706. ? ((this._x = Math.asin(-r(u, -1, 1))),
  50707. Math.abs(u) < 0.99999
  50708. ? ((this._y = Math.atan2(l, f)),
  50709. (this._z = Math.atan2(c, h)))
  50710. : ((this._y = Math.atan2(-d, a)), (this._z = 0)))
  50711. : "ZXY" === t
  50712. ? ((this._x = Math.asin(r(p, -1, 1))),
  50713. Math.abs(p) < 0.99999
  50714. ? ((this._y = Math.atan2(-d, f)),
  50715. (this._z = Math.atan2(-s, h)))
  50716. : ((this._y = 0), (this._z = Math.atan2(c, a))))
  50717. : "ZYX" === t
  50718. ? ((this._y = Math.asin(-r(d, -1, 1))),
  50719. Math.abs(d) < 0.99999
  50720. ? ((this._x = Math.atan2(p, f)),
  50721. (this._z = Math.atan2(c, a)))
  50722. : ((this._x = 0), (this._z = Math.atan2(-s, h))))
  50723. : "YZX" === t
  50724. ? ((this._z = Math.asin(r(c, -1, 1))),
  50725. Math.abs(c) < 0.99999
  50726. ? ((this._x = Math.atan2(-u, h)),
  50727. (this._y = Math.atan2(-d, a)))
  50728. : ((this._x = 0), (this._y = Math.atan2(l, f))))
  50729. : "XZY" === t
  50730. ? ((this._z = Math.asin(-r(s, -1, 1))),
  50731. Math.abs(s) < 0.99999
  50732. ? ((this._x = Math.atan2(p, h)),
  50733. (this._y = Math.atan2(l, a)))
  50734. : ((this._x = Math.atan2(-u, f)), (this._y = 0)))
  50735. : console.warn(
  50736. "THREE.Euler: .setFromRotationMatrix() given unsupported order: " +
  50737. t
  50738. ),
  50739. (this._order = t),
  50740. i !== !1 && this.onChangeCallback(),
  50741. this
  50742. );
  50743. },
  50744. setFromQuaternion: (function () {
  50745. var e;
  50746. return function (t, i, r) {
  50747. return (
  50748. void 0 === e && (e = new n.Matrix4()),
  50749. e.makeRotationFromQuaternion(t),
  50750. this.setFromRotationMatrix(e, i, r),
  50751. this
  50752. );
  50753. };
  50754. })(),
  50755. setFromVector3: function (e, t) {
  50756. return this.set(e.x, e.y, e.z, t || this._order);
  50757. },
  50758. reorder: (function () {
  50759. var e = new n.Quaternion();
  50760. return function (t) {
  50761. e.setFromEuler(this), this.setFromQuaternion(e, t);
  50762. };
  50763. })(),
  50764. equals: function (e) {
  50765. return (
  50766. e._x === this._x &&
  50767. e._y === this._y &&
  50768. e._z === this._z &&
  50769. e._order === this._order
  50770. );
  50771. },
  50772. fromArray: function (e) {
  50773. return (
  50774. (this._x = e[0]),
  50775. (this._y = e[1]),
  50776. (this._z = e[2]),
  50777. void 0 !== e[3] && (this._order = e[3]),
  50778. this.onChangeCallback(),
  50779. this
  50780. );
  50781. },
  50782. toArray: function (e, t) {
  50783. return (
  50784. void 0 === e && (e = []),
  50785. void 0 === t && (t = 0),
  50786. (e[t] = this._x),
  50787. (e[t + 1] = this._y),
  50788. (e[t + 2] = this._z),
  50789. (e[t + 3] = this._order),
  50790. e
  50791. );
  50792. },
  50793. toVector3: function (e) {
  50794. return e
  50795. ? e.set(this._x, this._y, this._z)
  50796. : new n.Vector3(this._x, this._y, this._z);
  50797. },
  50798. onChange: function (e) {
  50799. return (this.onChangeCallback = e), this;
  50800. },
  50801. onChangeCallback: function () {},
  50802. }),
  50803. (n.Line3 = function (e, t) {
  50804. (this.start = void 0 !== e ? e : new n.Vector3()),
  50805. (this.end = void 0 !== t ? t : new n.Vector3());
  50806. }),
  50807. (n.Line3.prototype = {
  50808. constructor: n.Line3,
  50809. set: function (e, t) {
  50810. return this.start.copy(e), this.end.copy(t), this;
  50811. },
  50812. clone: function () {
  50813. return new this.constructor().copy(this);
  50814. },
  50815. copy: function (e) {
  50816. return this.start.copy(e.start), this.end.copy(e.end), this;
  50817. },
  50818. center: function (e) {
  50819. var t = e || new n.Vector3();
  50820. return t.addVectors(this.start, this.end).multiplyScalar(0.5);
  50821. },
  50822. delta: function (e) {
  50823. var t = e || new n.Vector3();
  50824. return t.subVectors(this.end, this.start);
  50825. },
  50826. distanceSq: function () {
  50827. return this.start.distanceToSquared(this.end);
  50828. },
  50829. distance: function () {
  50830. return this.start.distanceTo(this.end);
  50831. },
  50832. at: function (e, t) {
  50833. var i = t || new n.Vector3();
  50834. return this.delta(i).multiplyScalar(e).add(this.start);
  50835. },
  50836. closestPointToPointParameter: (function () {
  50837. var e = new n.Vector3(),
  50838. t = new n.Vector3();
  50839. return function (i, r) {
  50840. e.subVectors(i, this.start), t.subVectors(this.end, this.start);
  50841. var o = t.dot(t),
  50842. a = t.dot(e),
  50843. s = a / o;
  50844. return r && (s = n.Math.clamp(s, 0, 1)), s;
  50845. };
  50846. })(),
  50847. closestPointToPoint: function (e, t, i) {
  50848. var r = this.closestPointToPointParameter(e, t),
  50849. o = i || new n.Vector3();
  50850. return this.delta(o).multiplyScalar(r).add(this.start);
  50851. },
  50852. applyMatrix4: function (e) {
  50853. return this.start.applyMatrix4(e), this.end.applyMatrix4(e), this;
  50854. },
  50855. equals: function (e) {
  50856. return e.start.equals(this.start) && e.end.equals(this.end);
  50857. },
  50858. }),
  50859. (n.Box2 = function (e, t) {
  50860. (this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0), +(1 / 0))),
  50861. (this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0), -(1 / 0)));
  50862. }),
  50863. (n.Box2.prototype = {
  50864. constructor: n.Box2,
  50865. set: function (e, t) {
  50866. return this.min.copy(e), this.max.copy(t), this;
  50867. },
  50868. setFromPoints: function (e) {
  50869. this.makeEmpty();
  50870. for (var t = 0, i = e.length; t < i; t++)
  50871. this.expandByPoint(e[t]);
  50872. return this;
  50873. },
  50874. setFromCenterAndSize: (function () {
  50875. var e = new n.Vector2();
  50876. return function (t, i) {
  50877. var n = e.copy(i).multiplyScalar(0.5);
  50878. return this.min.copy(t).sub(n), this.max.copy(t).add(n), this;
  50879. };
  50880. })(),
  50881. clone: function () {
  50882. return new this.constructor().copy(this);
  50883. },
  50884. copy: function (e) {
  50885. return this.min.copy(e.min), this.max.copy(e.max), this;
  50886. },
  50887. makeEmpty: function () {
  50888. return (
  50889. (this.min.x = this.min.y = +(1 / 0)),
  50890. (this.max.x = this.max.y = -(1 / 0)),
  50891. this
  50892. );
  50893. },
  50894. isEmpty: function () {
  50895. return this.max.x < this.min.x || this.max.y < this.min.y;
  50896. },
  50897. center: function (e) {
  50898. var t = e || new n.Vector2();
  50899. return t.addVectors(this.min, this.max).multiplyScalar(0.5);
  50900. },
  50901. size: function (e) {
  50902. var t = e || new n.Vector2();
  50903. return t.subVectors(this.max, this.min);
  50904. },
  50905. expandByPoint: function (e) {
  50906. return this.min.min(e), this.max.max(e), this;
  50907. },
  50908. expandByVector: function (e) {
  50909. return this.min.sub(e), this.max.add(e), this;
  50910. },
  50911. expandByScalar: function (e) {
  50912. return this.min.addScalar(-e), this.max.addScalar(e), this;
  50913. },
  50914. containsPoint: function (e) {
  50915. return !(
  50916. e.x < this.min.x ||
  50917. e.x > this.max.x ||
  50918. e.y < this.min.y ||
  50919. e.y > this.max.y
  50920. );
  50921. },
  50922. containsBox: function (e) {
  50923. return (
  50924. this.min.x <= e.min.x &&
  50925. e.max.x <= this.max.x &&
  50926. this.min.y <= e.min.y &&
  50927. e.max.y <= this.max.y
  50928. );
  50929. },
  50930. getParameter: function (e, t) {
  50931. var i = t || new n.Vector2();
  50932. return i.set(
  50933. (e.x - this.min.x) / (this.max.x - this.min.x),
  50934. (e.y - this.min.y) / (this.max.y - this.min.y)
  50935. );
  50936. },
  50937. intersectsBox: function (e) {
  50938. return !(
  50939. e.max.x < this.min.x ||
  50940. e.min.x > this.max.x ||
  50941. e.max.y < this.min.y ||
  50942. e.min.y > this.max.y
  50943. );
  50944. },
  50945. clampPoint: function (e, t) {
  50946. var i = t || new n.Vector2();
  50947. return i.copy(e).clamp(this.min, this.max);
  50948. },
  50949. distanceToPoint: (function () {
  50950. var e = new n.Vector2();
  50951. return function (t) {
  50952. var i = e.copy(t).clamp(this.min, this.max);
  50953. return i.sub(t).length();
  50954. };
  50955. })(),
  50956. intersect: function (e) {
  50957. return this.min.max(e.min), this.max.min(e.max), this;
  50958. },
  50959. union: function (e) {
  50960. return this.min.min(e.min), this.max.max(e.max), this;
  50961. },
  50962. translate: function (e) {
  50963. return this.min.add(e), this.max.add(e), this;
  50964. },
  50965. equals: function (e) {
  50966. return e.min.equals(this.min) && e.max.equals(this.max);
  50967. },
  50968. }),
  50969. (n.Box3 = function (e, t) {
  50970. (this.min =
  50971. void 0 !== e ? e : new n.Vector3(+(1 / 0), +(1 / 0), +(1 / 0))),
  50972. (this.max =
  50973. void 0 !== t ? t : new n.Vector3(-(1 / 0), -(1 / 0), -(1 / 0)));
  50974. }),
  50975. (n.Box3.prototype = {
  50976. constructor: n.Box3,
  50977. set: function (e, t) {
  50978. return this.min.copy(e), this.max.copy(t), this;
  50979. },
  50980. setFromArray: function (e) {
  50981. this.makeEmpty();
  50982. for (
  50983. var t = +(1 / 0),
  50984. i = +(1 / 0),
  50985. n = +(1 / 0),
  50986. r = -(1 / 0),
  50987. o = -(1 / 0),
  50988. a = -(1 / 0),
  50989. s = 0,
  50990. l = e.length;
  50991. s < l;
  50992. s += 3
  50993. ) {
  50994. var c = e[s],
  50995. h = e[s + 1],
  50996. u = e[s + 2];
  50997. c < t && (t = c),
  50998. h < i && (i = h),
  50999. u < n && (n = u),
  51000. c > r && (r = c),
  51001. h > o && (o = h),
  51002. u > a && (a = u);
  51003. }
  51004. this.min.set(t, i, n), this.max.set(r, o, a);
  51005. },
  51006. setFromPoints: function (e) {
  51007. this.makeEmpty();
  51008. for (var t = 0, i = e.length; t < i; t++)
  51009. this.expandByPoint(e[t]);
  51010. return this;
  51011. },
  51012. setFromCenterAndSize: (function () {
  51013. var e = new n.Vector3();
  51014. return function (t, i) {
  51015. var n = e.copy(i).multiplyScalar(0.5);
  51016. return this.min.copy(t).sub(n), this.max.copy(t).add(n), this;
  51017. };
  51018. })(),
  51019. setFromObject: (function () {
  51020. var e;
  51021. return function (t) {
  51022. void 0 === e && (e = new n.Box3());
  51023. var i = this;
  51024. return (
  51025. this.makeEmpty(),
  51026. t.updateMatrixWorld(!0),
  51027. t.traverse(function (t) {
  51028. var n = t.geometry;
  51029. void 0 !== n &&
  51030. (null === n.boundingBox && n.computeBoundingBox(),
  51031. n.boundingBox.isEmpty() === !1 &&
  51032. (e.copy(n.boundingBox),
  51033. e.applyMatrix4(t.matrixWorld),
  51034. i.union(e)));
  51035. }),
  51036. this
  51037. );
  51038. };
  51039. })(),
  51040. clone: function () {
  51041. return new this.constructor().copy(this);
  51042. },
  51043. copy: function (e) {
  51044. return this.min.copy(e.min), this.max.copy(e.max), this;
  51045. },
  51046. makeEmpty: function () {
  51047. return (
  51048. (this.min.x = this.min.y = this.min.z = +(1 / 0)),
  51049. (this.max.x = this.max.y = this.max.z = -(1 / 0)),
  51050. this
  51051. );
  51052. },
  51053. isEmpty: function () {
  51054. return (
  51055. this.max.x < this.min.x ||
  51056. this.max.y < this.min.y ||
  51057. this.max.z < this.min.z
  51058. );
  51059. },
  51060. center: function (e) {
  51061. var t = e || new n.Vector3();
  51062. return t.addVectors(this.min, this.max).multiplyScalar(0.5);
  51063. },
  51064. size: function (e) {
  51065. var t = e || new n.Vector3();
  51066. return t.subVectors(this.max, this.min);
  51067. },
  51068. expandByPoint: function (e) {
  51069. return this.min.min(e), this.max.max(e), this;
  51070. },
  51071. expandByVector: function (e) {
  51072. return this.min.sub(e), this.max.add(e), this;
  51073. },
  51074. expandByScalar: function (e) {
  51075. return this.min.addScalar(-e), this.max.addScalar(e), this;
  51076. },
  51077. containsPoint: function (e) {
  51078. return !(
  51079. e.x < this.min.x ||
  51080. e.x > this.max.x ||
  51081. e.y < this.min.y ||
  51082. e.y > this.max.y ||
  51083. e.z < this.min.z ||
  51084. e.z > this.max.z
  51085. );
  51086. },
  51087. containsBox: function (e) {
  51088. return (
  51089. this.min.x <= e.min.x &&
  51090. e.max.x <= this.max.x &&
  51091. this.min.y <= e.min.y &&
  51092. e.max.y <= this.max.y &&
  51093. this.min.z <= e.min.z &&
  51094. e.max.z <= this.max.z
  51095. );
  51096. },
  51097. getParameter: function (e, t) {
  51098. var i = t || new n.Vector3();
  51099. return i.set(
  51100. (e.x - this.min.x) / (this.max.x - this.min.x),
  51101. (e.y - this.min.y) / (this.max.y - this.min.y),
  51102. (e.z - this.min.z) / (this.max.z - this.min.z)
  51103. );
  51104. },
  51105. intersectsBox: function (e) {
  51106. return !(
  51107. e.max.x < this.min.x ||
  51108. e.min.x > this.max.x ||
  51109. e.max.y < this.min.y ||
  51110. e.min.y > this.max.y ||
  51111. e.max.z < this.min.z ||
  51112. e.min.z > this.max.z
  51113. );
  51114. },
  51115. intersectsSphere: (function () {
  51116. var e;
  51117. return function (t) {
  51118. return (
  51119. void 0 === e && (e = new n.Vector3()),
  51120. this.clampPoint(t.center, e),
  51121. e.distanceToSquared(t.center) <= t.radius * t.radius
  51122. );
  51123. };
  51124. })(),
  51125. intersectsPlane: function (e) {
  51126. var t, i;
  51127. return (
  51128. e.normal.x > 0
  51129. ? ((t = e.normal.x * this.min.x),
  51130. (i = e.normal.x * this.max.x))
  51131. : ((t = e.normal.x * this.max.x),
  51132. (i = e.normal.x * this.min.x)),
  51133. e.normal.y > 0
  51134. ? ((t += e.normal.y * this.min.y),
  51135. (i += e.normal.y * this.max.y))
  51136. : ((t += e.normal.y * this.max.y),
  51137. (i += e.normal.y * this.min.y)),
  51138. e.normal.z > 0
  51139. ? ((t += e.normal.z * this.min.z),
  51140. (i += e.normal.z * this.max.z))
  51141. : ((t += e.normal.z * this.max.z),
  51142. (i += e.normal.z * this.min.z)),
  51143. t <= e.constant && i >= e.constant
  51144. );
  51145. },
  51146. clampPoint: function (e, t) {
  51147. var i = t || new n.Vector3();
  51148. return i.copy(e).clamp(this.min, this.max);
  51149. },
  51150. distanceToPoint: (function () {
  51151. var e = new n.Vector3();
  51152. return function (t) {
  51153. var i = e.copy(t).clamp(this.min, this.max);
  51154. return i.sub(t).length();
  51155. };
  51156. })(),
  51157. getBoundingSphere: (function () {
  51158. var e = new n.Vector3();
  51159. return function (t) {
  51160. var i = t || new n.Sphere();
  51161. return (
  51162. (i.center = this.center()),
  51163. (i.radius = 0.5 * this.size(e).length()),
  51164. i
  51165. );
  51166. };
  51167. })(),
  51168. intersect: function (e) {
  51169. return this.min.max(e.min), this.max.min(e.max), this;
  51170. },
  51171. union: function (e) {
  51172. return this.min.min(e.min), this.max.max(e.max), this;
  51173. },
  51174. applyMatrix4: (function () {
  51175. var e = [
  51176. new n.Vector3(),
  51177. new n.Vector3(),
  51178. new n.Vector3(),
  51179. new n.Vector3(),
  51180. new n.Vector3(),
  51181. new n.Vector3(),
  51182. new n.Vector3(),
  51183. new n.Vector3(),
  51184. ];
  51185. return function (t) {
  51186. return (
  51187. e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  51188. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  51189. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  51190. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  51191. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  51192. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  51193. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  51194. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  51195. this.makeEmpty(),
  51196. this.setFromPoints(e),
  51197. this
  51198. );
  51199. };
  51200. })(),
  51201. translate: function (e) {
  51202. return this.min.add(e), this.max.add(e), this;
  51203. },
  51204. equals: function (e) {
  51205. return e.min.equals(this.min) && e.max.equals(this.max);
  51206. },
  51207. }),
  51208. (n.Matrix3 = function () {
  51209. (this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1])),
  51210. arguments.length > 0 &&
  51211. console.error(
  51212. "THREE.Matrix3: the constructor no longer reads arguments. use .set() instead."
  51213. );
  51214. }),
  51215. (n.Matrix3.prototype = {
  51216. constructor: n.Matrix3,
  51217. set: function (e, t, i, n, r, o, a, s, l) {
  51218. var c = this.elements;
  51219. return (
  51220. (c[0] = e),
  51221. (c[1] = n),
  51222. (c[2] = a),
  51223. (c[3] = t),
  51224. (c[4] = r),
  51225. (c[5] = s),
  51226. (c[6] = i),
  51227. (c[7] = o),
  51228. (c[8] = l),
  51229. this
  51230. );
  51231. },
  51232. identity: function () {
  51233. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this;
  51234. },
  51235. clone: function () {
  51236. return new this.constructor().fromArray(this.elements);
  51237. },
  51238. copy: function (e) {
  51239. var t = e.elements;
  51240. return (
  51241. this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  51242. this
  51243. );
  51244. },
  51245. setFromMatrix4: function (e) {
  51246. var t = e.elements;
  51247. return (
  51248. this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  51249. this
  51250. );
  51251. },
  51252. applyToVector3Array: (function () {
  51253. var e;
  51254. return function (t, i, r) {
  51255. void 0 === e && (e = new n.Vector3()),
  51256. void 0 === i && (i = 0),
  51257. void 0 === r && (r = t.length);
  51258. for (var o = 0, a = i; o < r; o += 3, a += 3)
  51259. e.fromArray(t, a), e.applyMatrix3(this), e.toArray(t, a);
  51260. return t;
  51261. };
  51262. })(),
  51263. applyToBuffer: (function () {
  51264. var e;
  51265. return function (t, i, r) {
  51266. void 0 === e && (e = new n.Vector3()),
  51267. void 0 === i && (i = 0),
  51268. void 0 === r && (r = t.length / t.itemSize);
  51269. for (var o = 0, a = i; o < r; o++, a++)
  51270. (e.x = t.getX(a)),
  51271. (e.y = t.getY(a)),
  51272. (e.z = t.getZ(a)),
  51273. e.applyMatrix3(this),
  51274. t.setXYZ(e.x, e.y, e.z);
  51275. return t;
  51276. };
  51277. })(),
  51278. multiplyScalar: function (e) {
  51279. var t = this.elements;
  51280. return (
  51281. (t[0] *= e),
  51282. (t[3] *= e),
  51283. (t[6] *= e),
  51284. (t[1] *= e),
  51285. (t[4] *= e),
  51286. (t[7] *= e),
  51287. (t[2] *= e),
  51288. (t[5] *= e),
  51289. (t[8] *= e),
  51290. this
  51291. );
  51292. },
  51293. determinant: function () {
  51294. var e = this.elements,
  51295. t = e[0],
  51296. i = e[1],
  51297. n = e[2],
  51298. r = e[3],
  51299. o = e[4],
  51300. a = e[5],
  51301. s = e[6],
  51302. l = e[7],
  51303. c = e[8];
  51304. return (
  51305. t * o * c -
  51306. t * a * l -
  51307. i * r * c +
  51308. i * a * s +
  51309. n * r * l -
  51310. n * o * s
  51311. );
  51312. },
  51313. getInverse: function (e, t) {
  51314. e instanceof n.Matrix4 &&
  51315. console.warn(
  51316. "THREE.Matrix3.getInverse no longer takes a Matrix4 argument."
  51317. );
  51318. var i = e.elements,
  51319. r = this.elements,
  51320. o = i[0],
  51321. a = i[1],
  51322. s = i[2],
  51323. l = i[3],
  51324. c = i[4],
  51325. h = i[5],
  51326. u = i[6],
  51327. d = i[7],
  51328. p = i[8],
  51329. f = p * c - h * d,
  51330. g = h * u - p * l,
  51331. m = d * l - c * u,
  51332. v = o * f + a * g + s * m;
  51333. if (0 === v) {
  51334. var A =
  51335. "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  51336. if (t) throw new Error(A);
  51337. return console.warn(A), this.identity();
  51338. }
  51339. return (
  51340. (r[0] = f),
  51341. (r[1] = s * d - p * a),
  51342. (r[2] = h * a - s * c),
  51343. (r[3] = g),
  51344. (r[4] = p * o - s * u),
  51345. (r[5] = s * l - h * o),
  51346. (r[6] = m),
  51347. (r[7] = a * u - d * o),
  51348. (r[8] = c * o - a * l),
  51349. this.multiplyScalar(1 / v)
  51350. );
  51351. },
  51352. transpose: function () {
  51353. var e,
  51354. t = this.elements;
  51355. return (
  51356. (e = t[1]),
  51357. (t[1] = t[3]),
  51358. (t[3] = e),
  51359. (e = t[2]),
  51360. (t[2] = t[6]),
  51361. (t[6] = e),
  51362. (e = t[5]),
  51363. (t[5] = t[7]),
  51364. (t[7] = e),
  51365. this
  51366. );
  51367. },
  51368. flattenToArrayOffset: function (e, t) {
  51369. var i = this.elements;
  51370. return (
  51371. (e[t] = i[0]),
  51372. (e[t + 1] = i[1]),
  51373. (e[t + 2] = i[2]),
  51374. (e[t + 3] = i[3]),
  51375. (e[t + 4] = i[4]),
  51376. (e[t + 5] = i[5]),
  51377. (e[t + 6] = i[6]),
  51378. (e[t + 7] = i[7]),
  51379. (e[t + 8] = i[8]),
  51380. e
  51381. );
  51382. },
  51383. getNormalMatrix: function (e) {
  51384. return this.setFromMatrix4(e).getInverse(this).transpose();
  51385. },
  51386. transposeIntoArray: function (e) {
  51387. var t = this.elements;
  51388. return (
  51389. (e[0] = t[0]),
  51390. (e[1] = t[3]),
  51391. (e[2] = t[6]),
  51392. (e[3] = t[1]),
  51393. (e[4] = t[4]),
  51394. (e[5] = t[7]),
  51395. (e[6] = t[2]),
  51396. (e[7] = t[5]),
  51397. (e[8] = t[8]),
  51398. this
  51399. );
  51400. },
  51401. fromArray: function (e) {
  51402. return this.elements.set(e), this;
  51403. },
  51404. toArray: function () {
  51405. var e = this.elements;
  51406. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]];
  51407. },
  51408. }),
  51409. (n.Matrix4 = function () {
  51410. (this.elements = new Float32Array([
  51411. 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1,
  51412. ])),
  51413. arguments.length > 0 &&
  51414. console.error(
  51415. "THREE.Matrix4: the constructor no longer reads arguments. use .set() instead."
  51416. );
  51417. }),
  51418. (n.Matrix4.prototype = {
  51419. constructor: n.Matrix4,
  51420. set: function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  51421. var m = this.elements;
  51422. return (
  51423. (m[0] = e),
  51424. (m[4] = t),
  51425. (m[8] = i),
  51426. (m[12] = n),
  51427. (m[1] = r),
  51428. (m[5] = o),
  51429. (m[9] = a),
  51430. (m[13] = s),
  51431. (m[2] = l),
  51432. (m[6] = c),
  51433. (m[10] = h),
  51434. (m[14] = u),
  51435. (m[3] = d),
  51436. (m[7] = p),
  51437. (m[11] = f),
  51438. (m[15] = g),
  51439. this
  51440. );
  51441. },
  51442. identity: function () {
  51443. return (
  51444. this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  51445. );
  51446. },
  51447. clone: function () {
  51448. return new n.Matrix4().fromArray(this.elements);
  51449. },
  51450. copy: function (e) {
  51451. return this.elements.set(e.elements), this;
  51452. },
  51453. copyPosition: function (e) {
  51454. var t = this.elements,
  51455. i = e.elements;
  51456. return (t[12] = i[12]), (t[13] = i[13]), (t[14] = i[14]), this;
  51457. },
  51458. extractBasis: function (e, t, i) {
  51459. return (
  51460. e.setFromMatrixColumn(this, 0),
  51461. t.setFromMatrixColumn(this, 1),
  51462. i.setFromMatrixColumn(this, 2),
  51463. this
  51464. );
  51465. },
  51466. makeBasis: function (e, t, i) {
  51467. return (
  51468. this.set(
  51469. e.x,
  51470. t.x,
  51471. i.x,
  51472. 0,
  51473. e.y,
  51474. t.y,
  51475. i.y,
  51476. 0,
  51477. e.z,
  51478. t.z,
  51479. i.z,
  51480. 0,
  51481. 0,
  51482. 0,
  51483. 0,
  51484. 1
  51485. ),
  51486. this
  51487. );
  51488. },
  51489. extractRotation: (function () {
  51490. var e;
  51491. return function (t) {
  51492. void 0 === e && (e = new n.Vector3());
  51493. var i = this.elements,
  51494. r = t.elements,
  51495. o = 1 / e.setFromMatrixColumn(t, 0).length(),
  51496. a = 1 / e.setFromMatrixColumn(t, 1).length(),
  51497. s = 1 / e.setFromMatrixColumn(t, 2).length();
  51498. return (
  51499. (i[0] = r[0] * o),
  51500. (i[1] = r[1] * o),
  51501. (i[2] = r[2] * o),
  51502. (i[4] = r[4] * a),
  51503. (i[5] = r[5] * a),
  51504. (i[6] = r[6] * a),
  51505. (i[8] = r[8] * s),
  51506. (i[9] = r[9] * s),
  51507. (i[10] = r[10] * s),
  51508. this
  51509. );
  51510. };
  51511. })(),
  51512. makeRotationFromEuler: function (e) {
  51513. e instanceof n.Euler == !1 &&
  51514. console.error(
  51515. "THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order."
  51516. );
  51517. var t = this.elements,
  51518. i = e.x,
  51519. r = e.y,
  51520. o = e.z,
  51521. a = Math.cos(i),
  51522. s = Math.sin(i),
  51523. l = Math.cos(r),
  51524. c = Math.sin(r),
  51525. h = Math.cos(o),
  51526. u = Math.sin(o);
  51527. if ("XYZ" === e.order) {
  51528. var d = a * h,
  51529. p = a * u,
  51530. f = s * h,
  51531. g = s * u;
  51532. (t[0] = l * h),
  51533. (t[4] = -l * u),
  51534. (t[8] = c),
  51535. (t[1] = p + f * c),
  51536. (t[5] = d - g * c),
  51537. (t[9] = -s * l),
  51538. (t[2] = g - d * c),
  51539. (t[6] = f + p * c),
  51540. (t[10] = a * l);
  51541. } else if ("YXZ" === e.order) {
  51542. var m = l * h,
  51543. v = l * u,
  51544. A = c * h,
  51545. y = c * u;
  51546. (t[0] = m + y * s),
  51547. (t[4] = A * s - v),
  51548. (t[8] = a * c),
  51549. (t[1] = a * u),
  51550. (t[5] = a * h),
  51551. (t[9] = -s),
  51552. (t[2] = v * s - A),
  51553. (t[6] = y + m * s),
  51554. (t[10] = a * l);
  51555. } else if ("ZXY" === e.order) {
  51556. var m = l * h,
  51557. v = l * u,
  51558. A = c * h,
  51559. y = c * u;
  51560. (t[0] = m - y * s),
  51561. (t[4] = -a * u),
  51562. (t[8] = A + v * s),
  51563. (t[1] = v + A * s),
  51564. (t[5] = a * h),
  51565. (t[9] = y - m * s),
  51566. (t[2] = -a * c),
  51567. (t[6] = s),
  51568. (t[10] = a * l);
  51569. } else if ("ZYX" === e.order) {
  51570. var d = a * h,
  51571. p = a * u,
  51572. f = s * h,
  51573. g = s * u;
  51574. (t[0] = l * h),
  51575. (t[4] = f * c - p),
  51576. (t[8] = d * c + g),
  51577. (t[1] = l * u),
  51578. (t[5] = g * c + d),
  51579. (t[9] = p * c - f),
  51580. (t[2] = -c),
  51581. (t[6] = s * l),
  51582. (t[10] = a * l);
  51583. } else if ("YZX" === e.order) {
  51584. var C = a * l,
  51585. I = a * c,
  51586. E = s * l,
  51587. b = s * c;
  51588. (t[0] = l * h),
  51589. (t[4] = b - C * u),
  51590. (t[8] = E * u + I),
  51591. (t[1] = u),
  51592. (t[5] = a * h),
  51593. (t[9] = -s * h),
  51594. (t[2] = -c * h),
  51595. (t[6] = I * u + E),
  51596. (t[10] = C - b * u);
  51597. } else if ("XZY" === e.order) {
  51598. var C = a * l,
  51599. I = a * c,
  51600. E = s * l,
  51601. b = s * c;
  51602. (t[0] = l * h),
  51603. (t[4] = -u),
  51604. (t[8] = c * h),
  51605. (t[1] = C * u + b),
  51606. (t[5] = a * h),
  51607. (t[9] = I * u - E),
  51608. (t[2] = E * u - I),
  51609. (t[6] = s * h),
  51610. (t[10] = b * u + C);
  51611. }
  51612. return (
  51613. (t[3] = 0),
  51614. (t[7] = 0),
  51615. (t[11] = 0),
  51616. (t[12] = 0),
  51617. (t[13] = 0),
  51618. (t[14] = 0),
  51619. (t[15] = 1),
  51620. this
  51621. );
  51622. },
  51623. makeRotationFromQuaternion: function (e) {
  51624. var t = this.elements,
  51625. i = e.x,
  51626. n = e.y,
  51627. r = e.z,
  51628. o = e.w,
  51629. a = i + i,
  51630. s = n + n,
  51631. l = r + r,
  51632. c = i * a,
  51633. h = i * s,
  51634. u = i * l,
  51635. d = n * s,
  51636. p = n * l,
  51637. f = r * l,
  51638. g = o * a,
  51639. m = o * s,
  51640. v = o * l;
  51641. return (
  51642. (t[0] = 1 - (d + f)),
  51643. (t[4] = h - v),
  51644. (t[8] = u + m),
  51645. (t[1] = h + v),
  51646. (t[5] = 1 - (c + f)),
  51647. (t[9] = p - g),
  51648. (t[2] = u - m),
  51649. (t[6] = p + g),
  51650. (t[10] = 1 - (c + d)),
  51651. (t[3] = 0),
  51652. (t[7] = 0),
  51653. (t[11] = 0),
  51654. (t[12] = 0),
  51655. (t[13] = 0),
  51656. (t[14] = 0),
  51657. (t[15] = 1),
  51658. this
  51659. );
  51660. },
  51661. lookAt: (function () {
  51662. var e, t, i;
  51663. return function (r, o, a) {
  51664. void 0 === e && (e = new n.Vector3()),
  51665. void 0 === t && (t = new n.Vector3()),
  51666. void 0 === i && (i = new n.Vector3());
  51667. var s = this.elements;
  51668. return (
  51669. i.subVectors(r, o).normalize(),
  51670. 0 === i.lengthSq() && (i.z = 1),
  51671. e.crossVectors(a, i).normalize(),
  51672. 0 === e.lengthSq() &&
  51673. ((i.x += 1e-4), e.crossVectors(a, i).normalize()),
  51674. t.crossVectors(i, e),
  51675. (s[0] = e.x),
  51676. (s[4] = t.x),
  51677. (s[8] = i.x),
  51678. (s[1] = e.y),
  51679. (s[5] = t.y),
  51680. (s[9] = i.y),
  51681. (s[2] = e.z),
  51682. (s[6] = t.z),
  51683. (s[10] = i.z),
  51684. this
  51685. );
  51686. };
  51687. })(),
  51688. multiply: function (e, t) {
  51689. return void 0 !== t
  51690. ? (console.warn(
  51691. "THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."
  51692. ),
  51693. this.multiplyMatrices(e, t))
  51694. : this.multiplyMatrices(this, e);
  51695. },
  51696. multiplyMatrices: function (e, t) {
  51697. var i = e.elements,
  51698. n = t.elements,
  51699. r = this.elements,
  51700. o = i[0],
  51701. a = i[4],
  51702. s = i[8],
  51703. l = i[12],
  51704. c = i[1],
  51705. h = i[5],
  51706. u = i[9],
  51707. d = i[13],
  51708. p = i[2],
  51709. f = i[6],
  51710. g = i[10],
  51711. m = i[14],
  51712. v = i[3],
  51713. A = i[7],
  51714. y = i[11],
  51715. C = i[15],
  51716. I = n[0],
  51717. E = n[4],
  51718. b = n[8],
  51719. w = n[12],
  51720. _ = n[1],
  51721. T = n[5],
  51722. x = n[9],
  51723. S = n[13],
  51724. M = n[2],
  51725. R = n[6],
  51726. P = n[10],
  51727. O = n[14],
  51728. L = n[3],
  51729. D = n[7],
  51730. N = n[11],
  51731. B = n[15];
  51732. return (
  51733. (r[0] = o * I + a * _ + s * M + l * L),
  51734. (r[4] = o * E + a * T + s * R + l * D),
  51735. (r[8] = o * b + a * x + s * P + l * N),
  51736. (r[12] = o * w + a * S + s * O + l * B),
  51737. (r[1] = c * I + h * _ + u * M + d * L),
  51738. (r[5] = c * E + h * T + u * R + d * D),
  51739. (r[9] = c * b + h * x + u * P + d * N),
  51740. (r[13] = c * w + h * S + u * O + d * B),
  51741. (r[2] = p * I + f * _ + g * M + m * L),
  51742. (r[6] = p * E + f * T + g * R + m * D),
  51743. (r[10] = p * b + f * x + g * P + m * N),
  51744. (r[14] = p * w + f * S + g * O + m * B),
  51745. (r[3] = v * I + A * _ + y * M + C * L),
  51746. (r[7] = v * E + A * T + y * R + C * D),
  51747. (r[11] = v * b + A * x + y * P + C * N),
  51748. (r[15] = v * w + A * S + y * O + C * B),
  51749. this
  51750. );
  51751. },
  51752. multiplyToArray: function (e, t, i) {
  51753. var n = this.elements;
  51754. return (
  51755. this.multiplyMatrices(e, t),
  51756. (i[0] = n[0]),
  51757. (i[1] = n[1]),
  51758. (i[2] = n[2]),
  51759. (i[3] = n[3]),
  51760. (i[4] = n[4]),
  51761. (i[5] = n[5]),
  51762. (i[6] = n[6]),
  51763. (i[7] = n[7]),
  51764. (i[8] = n[8]),
  51765. (i[9] = n[9]),
  51766. (i[10] = n[10]),
  51767. (i[11] = n[11]),
  51768. (i[12] = n[12]),
  51769. (i[13] = n[13]),
  51770. (i[14] = n[14]),
  51771. (i[15] = n[15]),
  51772. this
  51773. );
  51774. },
  51775. multiplyScalar: function (e) {
  51776. var t = this.elements;
  51777. return (
  51778. (t[0] *= e),
  51779. (t[4] *= e),
  51780. (t[8] *= e),
  51781. (t[12] *= e),
  51782. (t[1] *= e),
  51783. (t[5] *= e),
  51784. (t[9] *= e),
  51785. (t[13] *= e),
  51786. (t[2] *= e),
  51787. (t[6] *= e),
  51788. (t[10] *= e),
  51789. (t[14] *= e),
  51790. (t[3] *= e),
  51791. (t[7] *= e),
  51792. (t[11] *= e),
  51793. (t[15] *= e),
  51794. this
  51795. );
  51796. },
  51797. applyToVector3Array: (function () {
  51798. var e;
  51799. return function (t, i, r) {
  51800. void 0 === e && (e = new n.Vector3()),
  51801. void 0 === i && (i = 0),
  51802. void 0 === r && (r = t.length);
  51803. for (var o = 0, a = i; o < r; o += 3, a += 3)
  51804. e.fromArray(t, a), e.applyMatrix4(this), e.toArray(t, a);
  51805. return t;
  51806. };
  51807. })(),
  51808. applyToBuffer: (function () {
  51809. var e;
  51810. return function (t, i, r) {
  51811. void 0 === e && (e = new n.Vector3()),
  51812. void 0 === i && (i = 0),
  51813. void 0 === r && (r = t.length / t.itemSize);
  51814. for (var o = 0, a = i; o < r; o++, a++)
  51815. (e.x = t.getX(a)),
  51816. (e.y = t.getY(a)),
  51817. (e.z = t.getZ(a)),
  51818. e.applyMatrix4(this),
  51819. t.setXYZ(e.x, e.y, e.z);
  51820. return t;
  51821. };
  51822. })(),
  51823. determinant: function () {
  51824. var e = this.elements,
  51825. t = e[0],
  51826. i = e[4],
  51827. n = e[8],
  51828. r = e[12],
  51829. o = e[1],
  51830. a = e[5],
  51831. s = e[9],
  51832. l = e[13],
  51833. c = e[2],
  51834. h = e[6],
  51835. u = e[10],
  51836. d = e[14],
  51837. p = e[3],
  51838. f = e[7],
  51839. g = e[11],
  51840. m = e[15];
  51841. return (
  51842. p *
  51843. (+r * s * h -
  51844. n * l * h -
  51845. r * a * u +
  51846. i * l * u +
  51847. n * a * d -
  51848. i * s * d) +
  51849. f *
  51850. (+t * s * d -
  51851. t * l * u +
  51852. r * o * u -
  51853. n * o * d +
  51854. n * l * c -
  51855. r * s * c) +
  51856. g *
  51857. (+t * l * h -
  51858. t * a * d -
  51859. r * o * h +
  51860. i * o * d +
  51861. r * a * c -
  51862. i * l * c) +
  51863. m *
  51864. (-n * a * c -
  51865. t * s * h +
  51866. t * a * u +
  51867. n * o * h -
  51868. i * o * u +
  51869. i * s * c)
  51870. );
  51871. },
  51872. transpose: function () {
  51873. var e,
  51874. t = this.elements;
  51875. return (
  51876. (e = t[1]),
  51877. (t[1] = t[4]),
  51878. (t[4] = e),
  51879. (e = t[2]),
  51880. (t[2] = t[8]),
  51881. (t[8] = e),
  51882. (e = t[6]),
  51883. (t[6] = t[9]),
  51884. (t[9] = e),
  51885. (e = t[3]),
  51886. (t[3] = t[12]),
  51887. (t[12] = e),
  51888. (e = t[7]),
  51889. (t[7] = t[13]),
  51890. (t[13] = e),
  51891. (e = t[11]),
  51892. (t[11] = t[14]),
  51893. (t[14] = e),
  51894. this
  51895. );
  51896. },
  51897. flattenToArrayOffset: function (e, t) {
  51898. var i = this.elements;
  51899. return (
  51900. (e[t] = i[0]),
  51901. (e[t + 1] = i[1]),
  51902. (e[t + 2] = i[2]),
  51903. (e[t + 3] = i[3]),
  51904. (e[t + 4] = i[4]),
  51905. (e[t + 5] = i[5]),
  51906. (e[t + 6] = i[6]),
  51907. (e[t + 7] = i[7]),
  51908. (e[t + 8] = i[8]),
  51909. (e[t + 9] = i[9]),
  51910. (e[t + 10] = i[10]),
  51911. (e[t + 11] = i[11]),
  51912. (e[t + 12] = i[12]),
  51913. (e[t + 13] = i[13]),
  51914. (e[t + 14] = i[14]),
  51915. (e[t + 15] = i[15]),
  51916. e
  51917. );
  51918. },
  51919. getPosition: (function () {
  51920. var e;
  51921. return function () {
  51922. return (
  51923. void 0 === e && (e = new n.Vector3()),
  51924. console.warn(
  51925. "THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."
  51926. ),
  51927. e.setFromMatrixColumn(this, 3)
  51928. );
  51929. };
  51930. })(),
  51931. setPosition: function (e) {
  51932. var t = this.elements;
  51933. return (t[12] = e.x), (t[13] = e.y), (t[14] = e.z), this;
  51934. },
  51935. getInverse: function (e, t) {
  51936. var i = this.elements,
  51937. n = e.elements,
  51938. r = n[0],
  51939. o = n[1],
  51940. a = n[2],
  51941. s = n[3],
  51942. l = n[4],
  51943. c = n[5],
  51944. h = n[6],
  51945. u = n[7],
  51946. d = n[8],
  51947. p = n[9],
  51948. f = n[10],
  51949. g = n[11],
  51950. m = n[12],
  51951. v = n[13],
  51952. A = n[14],
  51953. y = n[15],
  51954. C =
  51955. p * A * u -
  51956. v * f * u +
  51957. v * h * g -
  51958. c * A * g -
  51959. p * h * y +
  51960. c * f * y,
  51961. I =
  51962. m * f * u -
  51963. d * A * u -
  51964. m * h * g +
  51965. l * A * g +
  51966. d * h * y -
  51967. l * f * y,
  51968. E =
  51969. d * v * u -
  51970. m * p * u +
  51971. m * c * g -
  51972. l * v * g -
  51973. d * c * y +
  51974. l * p * y,
  51975. b =
  51976. m * p * h -
  51977. d * v * h -
  51978. m * c * f +
  51979. l * v * f +
  51980. d * c * A -
  51981. l * p * A,
  51982. w = r * C + o * I + a * E + s * b;
  51983. if (0 === w) {
  51984. var _ =
  51985. "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  51986. if (t) throw new Error(_);
  51987. return console.warn(_), this.identity();
  51988. }
  51989. return (
  51990. (i[0] = C),
  51991. (i[1] =
  51992. v * f * s -
  51993. p * A * s -
  51994. v * a * g +
  51995. o * A * g +
  51996. p * a * y -
  51997. o * f * y),
  51998. (i[2] =
  51999. c * A * s -
  52000. v * h * s +
  52001. v * a * u -
  52002. o * A * u -
  52003. c * a * y +
  52004. o * h * y),
  52005. (i[3] =
  52006. p * h * s -
  52007. c * f * s -
  52008. p * a * u +
  52009. o * f * u +
  52010. c * a * g -
  52011. o * h * g),
  52012. (i[4] = I),
  52013. (i[5] =
  52014. d * A * s -
  52015. m * f * s +
  52016. m * a * g -
  52017. r * A * g -
  52018. d * a * y +
  52019. r * f * y),
  52020. (i[6] =
  52021. m * h * s -
  52022. l * A * s -
  52023. m * a * u +
  52024. r * A * u +
  52025. l * a * y -
  52026. r * h * y),
  52027. (i[7] =
  52028. l * f * s -
  52029. d * h * s +
  52030. d * a * u -
  52031. r * f * u -
  52032. l * a * g +
  52033. r * h * g),
  52034. (i[8] = E),
  52035. (i[9] =
  52036. m * p * s -
  52037. d * v * s -
  52038. m * o * g +
  52039. r * v * g +
  52040. d * o * y -
  52041. r * p * y),
  52042. (i[10] =
  52043. l * v * s -
  52044. m * c * s +
  52045. m * o * u -
  52046. r * v * u -
  52047. l * o * y +
  52048. r * c * y),
  52049. (i[11] =
  52050. d * c * s -
  52051. l * p * s -
  52052. d * o * u +
  52053. r * p * u +
  52054. l * o * g -
  52055. r * c * g),
  52056. (i[12] = b),
  52057. (i[13] =
  52058. d * v * a -
  52059. m * p * a +
  52060. m * o * f -
  52061. r * v * f -
  52062. d * o * A +
  52063. r * p * A),
  52064. (i[14] =
  52065. m * c * a -
  52066. l * v * a -
  52067. m * o * h +
  52068. r * v * h +
  52069. l * o * A -
  52070. r * c * A),
  52071. (i[15] =
  52072. l * p * a -
  52073. d * c * a +
  52074. d * o * h -
  52075. r * p * h -
  52076. l * o * f +
  52077. r * c * f),
  52078. this.multiplyScalar(1 / w)
  52079. );
  52080. },
  52081. scale: function (e) {
  52082. var t = this.elements,
  52083. i = e.x,
  52084. n = e.y,
  52085. r = e.z;
  52086. return (
  52087. (t[0] *= i),
  52088. (t[4] *= n),
  52089. (t[8] *= r),
  52090. (t[1] *= i),
  52091. (t[5] *= n),
  52092. (t[9] *= r),
  52093. (t[2] *= i),
  52094. (t[6] *= n),
  52095. (t[10] *= r),
  52096. (t[3] *= i),
  52097. (t[7] *= n),
  52098. (t[11] *= r),
  52099. this
  52100. );
  52101. },
  52102. getMaxScaleOnAxis: function () {
  52103. var e = this.elements,
  52104. t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2],
  52105. i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6],
  52106. n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  52107. return Math.sqrt(Math.max(t, i, n));
  52108. },
  52109. makeTranslation: function (e, t, i) {
  52110. return (
  52111. this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1), this
  52112. );
  52113. },
  52114. makeRotationX: function (e) {
  52115. var t = Math.cos(e),
  52116. i = Math.sin(e);
  52117. return (
  52118. this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1), this
  52119. );
  52120. },
  52121. makeRotationY: function (e) {
  52122. var t = Math.cos(e),
  52123. i = Math.sin(e);
  52124. return (
  52125. this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1), this
  52126. );
  52127. },
  52128. makeRotationZ: function (e) {
  52129. var t = Math.cos(e),
  52130. i = Math.sin(e);
  52131. return (
  52132. this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  52133. );
  52134. },
  52135. makeRotationAxis: function (e, t) {
  52136. var i = Math.cos(t),
  52137. n = Math.sin(t),
  52138. r = 1 - i,
  52139. o = e.x,
  52140. a = e.y,
  52141. s = e.z,
  52142. l = r * o,
  52143. c = r * a;
  52144. return (
  52145. this.set(
  52146. l * o + i,
  52147. l * a - n * s,
  52148. l * s + n * a,
  52149. 0,
  52150. l * a + n * s,
  52151. c * a + i,
  52152. c * s - n * o,
  52153. 0,
  52154. l * s - n * a,
  52155. c * s + n * o,
  52156. r * s * s + i,
  52157. 0,
  52158. 0,
  52159. 0,
  52160. 0,
  52161. 1
  52162. ),
  52163. this
  52164. );
  52165. },
  52166. makeScale: function (e, t, i) {
  52167. return (
  52168. this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1), this
  52169. );
  52170. },
  52171. compose: function (e, t, i) {
  52172. return (
  52173. this.makeRotationFromQuaternion(t),
  52174. this.scale(i),
  52175. this.setPosition(e),
  52176. this
  52177. );
  52178. },
  52179. decompose: (function () {
  52180. var e, t;
  52181. return function (i, r, o) {
  52182. void 0 === e && (e = new n.Vector3()),
  52183. void 0 === t && (t = new n.Matrix4());
  52184. var a = this.elements,
  52185. s = e.set(a[0], a[1], a[2]).length(),
  52186. l = e.set(a[4], a[5], a[6]).length(),
  52187. c = e.set(a[8], a[9], a[10]).length(),
  52188. h = this.determinant();
  52189. h < 0 && (s = -s),
  52190. (i.x = a[12]),
  52191. (i.y = a[13]),
  52192. (i.z = a[14]),
  52193. t.elements.set(this.elements);
  52194. var u = 1 / s,
  52195. d = 1 / l,
  52196. p = 1 / c;
  52197. return (
  52198. (t.elements[0] *= u),
  52199. (t.elements[1] *= u),
  52200. (t.elements[2] *= u),
  52201. (t.elements[4] *= d),
  52202. (t.elements[5] *= d),
  52203. (t.elements[6] *= d),
  52204. (t.elements[8] *= p),
  52205. (t.elements[9] *= p),
  52206. (t.elements[10] *= p),
  52207. r.setFromRotationMatrix(t),
  52208. (o.x = s),
  52209. (o.y = l),
  52210. (o.z = c),
  52211. this
  52212. );
  52213. };
  52214. })(),
  52215. makeFrustum: function (e, t, i, n, r, o) {
  52216. var a = this.elements,
  52217. s = (2 * r) / (t - e),
  52218. l = (2 * r) / (n - i),
  52219. c = (t + e) / (t - e),
  52220. h = (n + i) / (n - i),
  52221. u = -(o + r) / (o - r),
  52222. d = (-2 * o * r) / (o - r);
  52223. return (
  52224. (a[0] = s),
  52225. (a[4] = 0),
  52226. (a[8] = c),
  52227. (a[12] = 0),
  52228. (a[1] = 0),
  52229. (a[5] = l),
  52230. (a[9] = h),
  52231. (a[13] = 0),
  52232. (a[2] = 0),
  52233. (a[6] = 0),
  52234. (a[10] = u),
  52235. (a[14] = d),
  52236. (a[3] = 0),
  52237. (a[7] = 0),
  52238. (a[11] = -1),
  52239. (a[15] = 0),
  52240. this
  52241. );
  52242. },
  52243. makePerspective: function (e, t, i, r) {
  52244. var o = i * Math.tan(n.Math.degToRad(0.5 * e)),
  52245. a = -o,
  52246. s = a * t,
  52247. l = o * t;
  52248. return this.makeFrustum(s, l, a, o, i, r);
  52249. },
  52250. makeOrthographic: function (e, t, i, n, r, o) {
  52251. var a = this.elements,
  52252. s = 1 / (t - e),
  52253. l = 1 / (i - n),
  52254. c = 1 / (o - r),
  52255. h = (t + e) * s,
  52256. u = (i + n) * l,
  52257. d = (o + r) * c;
  52258. return (
  52259. (a[0] = 2 * s),
  52260. (a[4] = 0),
  52261. (a[8] = 0),
  52262. (a[12] = -h),
  52263. (a[1] = 0),
  52264. (a[5] = 2 * l),
  52265. (a[9] = 0),
  52266. (a[13] = -u),
  52267. (a[2] = 0),
  52268. (a[6] = 0),
  52269. (a[10] = -2 * c),
  52270. (a[14] = -d),
  52271. (a[3] = 0),
  52272. (a[7] = 0),
  52273. (a[11] = 0),
  52274. (a[15] = 1),
  52275. this
  52276. );
  52277. },
  52278. equals: function (e) {
  52279. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  52280. if (t[n] !== i[n]) return !1;
  52281. return !0;
  52282. },
  52283. fromArray: function (e) {
  52284. return this.elements.set(e), this;
  52285. },
  52286. toArray: function () {
  52287. var e = this.elements;
  52288. return [
  52289. e[0],
  52290. e[1],
  52291. e[2],
  52292. e[3],
  52293. e[4],
  52294. e[5],
  52295. e[6],
  52296. e[7],
  52297. e[8],
  52298. e[9],
  52299. e[10],
  52300. e[11],
  52301. e[12],
  52302. e[13],
  52303. e[14],
  52304. e[15],
  52305. ];
  52306. },
  52307. }),
  52308. (n.Ray = function (e, t) {
  52309. (this.origin = void 0 !== e ? e : new n.Vector3()),
  52310. (this.direction = void 0 !== t ? t : new n.Vector3());
  52311. }),
  52312. (n.Ray.prototype = {
  52313. constructor: n.Ray,
  52314. set: function (e, t) {
  52315. return this.origin.copy(e), this.direction.copy(t), this;
  52316. },
  52317. clone: function () {
  52318. return new this.constructor().copy(this);
  52319. },
  52320. copy: function (e) {
  52321. return (
  52322. this.origin.copy(e.origin),
  52323. this.direction.copy(e.direction),
  52324. this
  52325. );
  52326. },
  52327. at: function (e, t) {
  52328. var i = t || new n.Vector3();
  52329. return i.copy(this.direction).multiplyScalar(e).add(this.origin);
  52330. },
  52331. lookAt: function (e) {
  52332. this.direction.copy(e).sub(this.origin).normalize();
  52333. },
  52334. recast: (function () {
  52335. var e = new n.Vector3();
  52336. return function (t) {
  52337. return this.origin.copy(this.at(t, e)), this;
  52338. };
  52339. })(),
  52340. closestPointToPoint: function (e, t) {
  52341. var i = t || new n.Vector3();
  52342. i.subVectors(e, this.origin);
  52343. var r = i.dot(this.direction);
  52344. return r < 0
  52345. ? i.copy(this.origin)
  52346. : i.copy(this.direction).multiplyScalar(r).add(this.origin);
  52347. },
  52348. distanceToPoint: function (e) {
  52349. return Math.sqrt(this.distanceSqToPoint(e));
  52350. },
  52351. distanceSqToPoint: (function () {
  52352. var e = new n.Vector3();
  52353. return function (t) {
  52354. var i = e.subVectors(t, this.origin).dot(this.direction);
  52355. return i < 0
  52356. ? this.origin.distanceToSquared(t)
  52357. : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  52358. e.distanceToSquared(t));
  52359. };
  52360. })(),
  52361. distanceSqToSegment: (function () {
  52362. var e = new n.Vector3(),
  52363. t = new n.Vector3(),
  52364. i = new n.Vector3();
  52365. return function (n, r, o, a) {
  52366. e.copy(n).add(r).multiplyScalar(0.5),
  52367. t.copy(r).sub(n).normalize(),
  52368. i.copy(this.origin).sub(e);
  52369. var s,
  52370. l,
  52371. c,
  52372. h,
  52373. u = 0.5 * n.distanceTo(r),
  52374. d = -this.direction.dot(t),
  52375. p = i.dot(this.direction),
  52376. f = -i.dot(t),
  52377. g = i.lengthSq(),
  52378. m = Math.abs(1 - d * d);
  52379. if (m > 0)
  52380. if (((s = d * f - p), (l = d * p - f), (h = u * m), s >= 0))
  52381. if (l >= -h)
  52382. if (l <= h) {
  52383. var v = 1 / m;
  52384. (s *= v),
  52385. (l *= v),
  52386. (c =
  52387. s * (s + d * l + 2 * p) +
  52388. l * (d * s + l + 2 * f) +
  52389. g);
  52390. } else
  52391. (l = u),
  52392. (s = Math.max(0, -(d * l + p))),
  52393. (c = -s * s + l * (l + 2 * f) + g);
  52394. else
  52395. (l = -u),
  52396. (s = Math.max(0, -(d * l + p))),
  52397. (c = -s * s + l * (l + 2 * f) + g);
  52398. else
  52399. l <= -h
  52400. ? ((s = Math.max(0, -(-d * u + p))),
  52401. (l = s > 0 ? -u : Math.min(Math.max(-u, -f), u)),
  52402. (c = -s * s + l * (l + 2 * f) + g))
  52403. : l <= h
  52404. ? ((s = 0),
  52405. (l = Math.min(Math.max(-u, -f), u)),
  52406. (c = l * (l + 2 * f) + g))
  52407. : ((s = Math.max(0, -(d * u + p))),
  52408. (l = s > 0 ? u : Math.min(Math.max(-u, -f), u)),
  52409. (c = -s * s + l * (l + 2 * f) + g));
  52410. else
  52411. (l = d > 0 ? -u : u),
  52412. (s = Math.max(0, -(d * l + p))),
  52413. (c = -s * s + l * (l + 2 * f) + g);
  52414. return (
  52415. o &&
  52416. o.copy(this.direction).multiplyScalar(s).add(this.origin),
  52417. a && a.copy(t).multiplyScalar(l).add(e),
  52418. c
  52419. );
  52420. };
  52421. })(),
  52422. intersectSphere: (function () {
  52423. var e = new n.Vector3();
  52424. return function (t, i) {
  52425. e.subVectors(t.center, this.origin);
  52426. var n = e.dot(this.direction),
  52427. r = e.dot(e) - n * n,
  52428. o = t.radius * t.radius;
  52429. if (r > o) return null;
  52430. var a = Math.sqrt(o - r),
  52431. s = n - a,
  52432. l = n + a;
  52433. return s < 0 && l < 0
  52434. ? null
  52435. : s < 0
  52436. ? this.at(l, i)
  52437. : this.at(s, i);
  52438. };
  52439. })(),
  52440. intersectsSphere: function (e) {
  52441. return this.distanceToPoint(e.center) <= e.radius;
  52442. },
  52443. distanceToPlane: function (e) {
  52444. var t = e.normal.dot(this.direction);
  52445. if (0 === t)
  52446. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  52447. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  52448. return i >= 0 ? i : null;
  52449. },
  52450. intersectPlane: function (e, t) {
  52451. var i = this.distanceToPlane(e);
  52452. return null === i ? null : this.at(i, t);
  52453. },
  52454. intersectsPlane: function (e) {
  52455. var t = e.distanceToPoint(this.origin);
  52456. if (0 === t) return !0;
  52457. var i = e.normal.dot(this.direction);
  52458. return i * t < 0;
  52459. },
  52460. intersectBox: function (e, t) {
  52461. var i,
  52462. n,
  52463. r,
  52464. o,
  52465. a,
  52466. s,
  52467. l = 1 / this.direction.x,
  52468. c = 1 / this.direction.y,
  52469. h = 1 / this.direction.z,
  52470. u = this.origin;
  52471. return (
  52472. l >= 0
  52473. ? ((i = (e.min.x - u.x) * l), (n = (e.max.x - u.x) * l))
  52474. : ((i = (e.max.x - u.x) * l), (n = (e.min.x - u.x) * l)),
  52475. c >= 0
  52476. ? ((r = (e.min.y - u.y) * c), (o = (e.max.y - u.y) * c))
  52477. : ((r = (e.max.y - u.y) * c), (o = (e.min.y - u.y) * c)),
  52478. i > o || r > n
  52479. ? null
  52480. : ((r > i || i !== i) && (i = r),
  52481. (o < n || n !== n) && (n = o),
  52482. h >= 0
  52483. ? ((a = (e.min.z - u.z) * h), (s = (e.max.z - u.z) * h))
  52484. : ((a = (e.max.z - u.z) * h), (s = (e.min.z - u.z) * h)),
  52485. i > s || a > n
  52486. ? null
  52487. : ((a > i || i !== i) && (i = a),
  52488. (s < n || n !== n) && (n = s),
  52489. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  52490. );
  52491. },
  52492. intersectsBox: (function () {
  52493. var e = new n.Vector3();
  52494. return function (t) {
  52495. return null !== this.intersectBox(t, e);
  52496. };
  52497. })(),
  52498. intersectTriangle: (function () {
  52499. var e = new n.Vector3(),
  52500. t = new n.Vector3(),
  52501. i = new n.Vector3(),
  52502. r = new n.Vector3();
  52503. return function (n, o, a, s, l) {
  52504. t.subVectors(o, n), i.subVectors(a, n), r.crossVectors(t, i);
  52505. var c,
  52506. h = this.direction.dot(r);
  52507. if (h > 0) {
  52508. if (s) return null;
  52509. c = 1;
  52510. } else {
  52511. if (!(h < 0)) return null;
  52512. (c = -1), (h = -h);
  52513. }
  52514. e.subVectors(this.origin, n);
  52515. var u = c * this.direction.dot(i.crossVectors(e, i));
  52516. if (u < 0) return null;
  52517. var d = c * this.direction.dot(t.cross(e));
  52518. if (d < 0) return null;
  52519. if (u + d > h) return null;
  52520. var p = -c * e.dot(r);
  52521. return p < 0 ? null : this.at(p / h, l);
  52522. };
  52523. })(),
  52524. applyMatrix4: function (e) {
  52525. return (
  52526. this.direction.add(this.origin).applyMatrix4(e),
  52527. this.origin.applyMatrix4(e),
  52528. this.direction.sub(this.origin),
  52529. this.direction.normalize(),
  52530. this
  52531. );
  52532. },
  52533. equals: function (e) {
  52534. return (
  52535. e.origin.equals(this.origin) &&
  52536. e.direction.equals(this.direction)
  52537. );
  52538. },
  52539. }),
  52540. (n.Sphere = function (e, t) {
  52541. (this.center = void 0 !== e ? e : new n.Vector3()),
  52542. (this.radius = void 0 !== t ? t : 0);
  52543. }),
  52544. (n.Sphere.prototype = {
  52545. constructor: n.Sphere,
  52546. set: function (e, t) {
  52547. return this.center.copy(e), (this.radius = t), this;
  52548. },
  52549. setFromPoints: (function () {
  52550. var e = new n.Box3();
  52551. return function (t, i) {
  52552. var n = this.center;
  52553. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  52554. for (var r = 0, o = 0, a = t.length; o < a; o++)
  52555. r = Math.max(r, n.distanceToSquared(t[o]));
  52556. return (this.radius = Math.sqrt(r)), this;
  52557. };
  52558. })(),
  52559. clone: function () {
  52560. return new this.constructor().copy(this);
  52561. },
  52562. copy: function (e) {
  52563. return this.center.copy(e.center), (this.radius = e.radius), this;
  52564. },
  52565. empty: function () {
  52566. return this.radius <= 0;
  52567. },
  52568. containsPoint: function (e) {
  52569. return (
  52570. e.distanceToSquared(this.center) <= this.radius * this.radius
  52571. );
  52572. },
  52573. distanceToPoint: function (e) {
  52574. return e.distanceTo(this.center) - this.radius;
  52575. },
  52576. intersectsSphere: function (e) {
  52577. var t = this.radius + e.radius;
  52578. return e.center.distanceToSquared(this.center) <= t * t;
  52579. },
  52580. intersectsBox: function (e) {
  52581. return e.intersectsSphere(this);
  52582. },
  52583. intersectsPlane: function (e) {
  52584. return (
  52585. Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  52586. );
  52587. },
  52588. clampPoint: function (e, t) {
  52589. var i = this.center.distanceToSquared(e),
  52590. r = t || new n.Vector3();
  52591. return (
  52592. r.copy(e),
  52593. i > this.radius * this.radius &&
  52594. (r.sub(this.center).normalize(),
  52595. r.multiplyScalar(this.radius).add(this.center)),
  52596. r
  52597. );
  52598. },
  52599. getBoundingBox: function (e) {
  52600. var t = e || new n.Box3();
  52601. return (
  52602. t.set(this.center, this.center),
  52603. t.expandByScalar(this.radius),
  52604. t
  52605. );
  52606. },
  52607. applyMatrix4: function (e) {
  52608. return (
  52609. this.center.applyMatrix4(e),
  52610. (this.radius = this.radius * e.getMaxScaleOnAxis()),
  52611. this
  52612. );
  52613. },
  52614. translate: function (e) {
  52615. return this.center.add(e), this;
  52616. },
  52617. equals: function (e) {
  52618. return e.center.equals(this.center) && e.radius === this.radius;
  52619. },
  52620. }),
  52621. (n.Frustum = function (e, t, i, r, o, a) {
  52622. this.planes = [
  52623. void 0 !== e ? e : new n.Plane(),
  52624. void 0 !== t ? t : new n.Plane(),
  52625. void 0 !== i ? i : new n.Plane(),
  52626. void 0 !== r ? r : new n.Plane(),
  52627. void 0 !== o ? o : new n.Plane(),
  52628. void 0 !== a ? a : new n.Plane(),
  52629. ];
  52630. }),
  52631. (n.Frustum.prototype = {
  52632. constructor: n.Frustum,
  52633. set: function (e, t, i, n, r, o) {
  52634. var a = this.planes;
  52635. return (
  52636. a[0].copy(e),
  52637. a[1].copy(t),
  52638. a[2].copy(i),
  52639. a[3].copy(n),
  52640. a[4].copy(r),
  52641. a[5].copy(o),
  52642. this
  52643. );
  52644. },
  52645. clone: function () {
  52646. return new this.constructor().copy(this);
  52647. },
  52648. copy: function (e) {
  52649. for (var t = this.planes, i = 0; i < 6; i++)
  52650. t[i].copy(e.planes[i]);
  52651. return this;
  52652. },
  52653. setFromMatrix: function (e) {
  52654. var t = this.planes,
  52655. i = e.elements,
  52656. n = i[0],
  52657. r = i[1],
  52658. o = i[2],
  52659. a = i[3],
  52660. s = i[4],
  52661. l = i[5],
  52662. c = i[6],
  52663. h = i[7],
  52664. u = i[8],
  52665. d = i[9],
  52666. p = i[10],
  52667. f = i[11],
  52668. g = i[12],
  52669. m = i[13],
  52670. v = i[14],
  52671. A = i[15];
  52672. return (
  52673. t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  52674. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  52675. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  52676. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  52677. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  52678. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  52679. this
  52680. );
  52681. },
  52682. intersectsObject: (function () {
  52683. var e = new n.Sphere();
  52684. return function (t) {
  52685. var i = t.geometry;
  52686. return (
  52687. null === i.boundingSphere && i.computeBoundingSphere(),
  52688. e.copy(i.boundingSphere),
  52689. e.applyMatrix4(t.matrixWorld),
  52690. this.intersectsSphere(e)
  52691. );
  52692. };
  52693. })(),
  52694. intersectsSphere: function (e) {
  52695. for (
  52696. var t = this.planes, i = e.center, n = -e.radius, r = 0;
  52697. r < 6;
  52698. r++
  52699. ) {
  52700. var o = t[r].distanceToPoint(i);
  52701. if (o < n) return !1;
  52702. }
  52703. return !0;
  52704. },
  52705. intersectsBox: (function () {
  52706. var e = new n.Vector3(),
  52707. t = new n.Vector3();
  52708. return function (i) {
  52709. for (var n = this.planes, r = 0; r < 6; r++) {
  52710. var o = n[r];
  52711. (e.x = o.normal.x > 0 ? i.min.x : i.max.x),
  52712. (t.x = o.normal.x > 0 ? i.max.x : i.min.x),
  52713. (e.y = o.normal.y > 0 ? i.min.y : i.max.y),
  52714. (t.y = o.normal.y > 0 ? i.max.y : i.min.y),
  52715. (e.z = o.normal.z > 0 ? i.min.z : i.max.z),
  52716. (t.z = o.normal.z > 0 ? i.max.z : i.min.z);
  52717. var a = o.distanceToPoint(e),
  52718. s = o.distanceToPoint(t);
  52719. if (a < 0 && s < 0) return !1;
  52720. }
  52721. return !0;
  52722. };
  52723. })(),
  52724. containsPoint: function (e) {
  52725. for (var t = this.planes, i = 0; i < 6; i++)
  52726. if (t[i].distanceToPoint(e) < 0) return !1;
  52727. return !0;
  52728. },
  52729. }),
  52730. (n.Plane = function (e, t) {
  52731. (this.normal = void 0 !== e ? e : new n.Vector3(1, 0, 0)),
  52732. (this.constant = void 0 !== t ? t : 0);
  52733. }),
  52734. (n.Plane.prototype = {
  52735. constructor: n.Plane,
  52736. set: function (e, t) {
  52737. return this.normal.copy(e), (this.constant = t), this;
  52738. },
  52739. setComponents: function (e, t, i, n) {
  52740. return this.normal.set(e, t, i), (this.constant = n), this;
  52741. },
  52742. setFromNormalAndCoplanarPoint: function (e, t) {
  52743. return (
  52744. this.normal.copy(e), (this.constant = -t.dot(this.normal)), this
  52745. );
  52746. },
  52747. setFromCoplanarPoints: (function () {
  52748. var e = new n.Vector3(),
  52749. t = new n.Vector3();
  52750. return function (i, n, r) {
  52751. var o = e
  52752. .subVectors(r, n)
  52753. .cross(t.subVectors(i, n))
  52754. .normalize();
  52755. return this.setFromNormalAndCoplanarPoint(o, i), this;
  52756. };
  52757. })(),
  52758. clone: function () {
  52759. return new this.constructor().copy(this);
  52760. },
  52761. copy: function (e) {
  52762. return (
  52763. this.normal.copy(e.normal), (this.constant = e.constant), this
  52764. );
  52765. },
  52766. normalize: function () {
  52767. var e = 1 / this.normal.length();
  52768. return this.normal.multiplyScalar(e), (this.constant *= e), this;
  52769. },
  52770. negate: function () {
  52771. return (this.constant *= -1), this.normal.negate(), this;
  52772. },
  52773. distanceToPoint: function (e) {
  52774. return this.normal.dot(e) + this.constant;
  52775. },
  52776. distanceToSphere: function (e) {
  52777. return this.distanceToPoint(e.center) - e.radius;
  52778. },
  52779. projectPoint: function (e, t) {
  52780. return this.orthoPoint(e, t).sub(e).negate();
  52781. },
  52782. orthoPoint: function (e, t) {
  52783. var i = this.distanceToPoint(e),
  52784. r = t || new n.Vector3();
  52785. return r.copy(this.normal).multiplyScalar(i);
  52786. },
  52787. intersectLine: (function () {
  52788. var e = new n.Vector3();
  52789. return function (t, i) {
  52790. var r = i || new n.Vector3(),
  52791. o = t.delta(e),
  52792. a = this.normal.dot(o);
  52793. if (0 !== a) {
  52794. var s = -(t.start.dot(this.normal) + this.constant) / a;
  52795. if (!(s < 0 || s > 1))
  52796. return r.copy(o).multiplyScalar(s).add(t.start);
  52797. } else if (0 === this.distanceToPoint(t.start))
  52798. return r.copy(t.start);
  52799. };
  52800. })(),
  52801. intersectsLine: function (e) {
  52802. var t = this.distanceToPoint(e.start),
  52803. i = this.distanceToPoint(e.end);
  52804. return (t < 0 && i > 0) || (i < 0 && t > 0);
  52805. },
  52806. intersectsBox: function (e) {
  52807. return e.intersectsPlane(this);
  52808. },
  52809. intersectsSphere: function (e) {
  52810. return e.intersectsPlane(this);
  52811. },
  52812. coplanarPoint: function (e) {
  52813. var t = e || new n.Vector3();
  52814. return t.copy(this.normal).multiplyScalar(-this.constant);
  52815. },
  52816. applyMatrix4: (function () {
  52817. var e = new n.Vector3(),
  52818. t = new n.Vector3(),
  52819. i = new n.Matrix3();
  52820. return function (n, r) {
  52821. var o = r || i.getNormalMatrix(n),
  52822. a = e.copy(this.normal).applyMatrix3(o),
  52823. s = this.coplanarPoint(t);
  52824. return (
  52825. s.applyMatrix4(n),
  52826. this.setFromNormalAndCoplanarPoint(a, s),
  52827. this
  52828. );
  52829. };
  52830. })(),
  52831. translate: function (e) {
  52832. return (this.constant = this.constant - e.dot(this.normal)), this;
  52833. },
  52834. equals: function (e) {
  52835. return (
  52836. e.normal.equals(this.normal) && e.constant === this.constant
  52837. );
  52838. },
  52839. }),
  52840. (n.Spherical = function (e, t, i) {
  52841. return (
  52842. (this.radius = void 0 !== e ? e : 1),
  52843. (this.phi = void 0 !== t ? t : 0),
  52844. (this.theta = void 0 !== i ? i : 0),
  52845. this
  52846. );
  52847. }),
  52848. (n.Spherical.prototype = {
  52849. constructor: n.Spherical,
  52850. set: function (e, t, i) {
  52851. (this.radius = e), (this.phi = t), (this.theta = i);
  52852. },
  52853. clone: function () {
  52854. return new this.constructor().copy(this);
  52855. },
  52856. copy: function (e) {
  52857. return (
  52858. this.radius.copy(e.radius),
  52859. this.phi.copy(e.phi),
  52860. this.theta.copy(e.theta),
  52861. this
  52862. );
  52863. },
  52864. makeSafe: function () {
  52865. var e = 1e-6;
  52866. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi));
  52867. },
  52868. setFromVector3: function (e) {
  52869. return (
  52870. (this.radius = e.length()),
  52871. 0 === this.radius
  52872. ? ((this.theta = 0), (this.phi = 0))
  52873. : ((this.theta = Math.atan2(e.x, e.z)),
  52874. (this.phi = Math.acos(
  52875. n.Math.clamp(e.y / this.radius, -1, 1)
  52876. ))),
  52877. this
  52878. );
  52879. },
  52880. }),
  52881. (n.Math = {
  52882. generateUUID: (function () {
  52883. var e,
  52884. t =
  52885. "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(
  52886. ""
  52887. ),
  52888. i = new Array(36),
  52889. n = 0;
  52890. return function () {
  52891. for (var r = 0; r < 36; r++)
  52892. 8 === r || 13 === r || 18 === r || 23 === r
  52893. ? (i[r] = "-")
  52894. : 14 === r
  52895. ? (i[r] = "4")
  52896. : (n <= 2 &&
  52897. (n = (33554432 + 16777216 * Math.random()) | 0),
  52898. (e = 15 & n),
  52899. (n >>= 4),
  52900. (i[r] = t[19 === r ? (3 & e) | 8 : e]));
  52901. return i.join("");
  52902. };
  52903. })(),
  52904. clamp: function (e, t, i) {
  52905. return Math.max(t, Math.min(i, e));
  52906. },
  52907. euclideanModulo: function (e, t) {
  52908. return ((e % t) + t) % t;
  52909. },
  52910. mapLinear: function (e, t, i, n, r) {
  52911. return n + ((e - t) * (r - n)) / (i - t);
  52912. },
  52913. smoothstep: function (e, t, i) {
  52914. return e <= t
  52915. ? 0
  52916. : e >= i
  52917. ? 1
  52918. : ((e = (e - t) / (i - t)), e * e * (3 - 2 * e));
  52919. },
  52920. smootherstep: function (e, t, i) {
  52921. return e <= t
  52922. ? 0
  52923. : e >= i
  52924. ? 1
  52925. : ((e = (e - t) / (i - t)),
  52926. e * e * e * (e * (6 * e - 15) + 10));
  52927. },
  52928. random16: function () {
  52929. return (
  52930. console.warn(
  52931. "THREE.Math.random16() has been deprecated. Use Math.random() instead."
  52932. ),
  52933. Math.random()
  52934. );
  52935. },
  52936. randInt: function (e, t) {
  52937. return e + Math.floor(Math.random() * (t - e + 1));
  52938. },
  52939. randFloat: function (e, t) {
  52940. return e + Math.random() * (t - e);
  52941. },
  52942. randFloatSpread: function (e) {
  52943. return e * (0.5 - Math.random());
  52944. },
  52945. degToRad: (function () {
  52946. var e = Math.PI / 180;
  52947. return function (t) {
  52948. return t * e;
  52949. };
  52950. })(),
  52951. radToDeg: (function () {
  52952. var e = 180 / Math.PI;
  52953. return function (t) {
  52954. return t * e;
  52955. };
  52956. })(),
  52957. isPowerOfTwo: function (e) {
  52958. return 0 === (e & (e - 1)) && 0 !== e;
  52959. },
  52960. nearestPowerOfTwo: function (e) {
  52961. return Math.pow(2, Math.round(Math.log(e) / Math.LN2));
  52962. },
  52963. nextPowerOfTwo: function (e) {
  52964. return (
  52965. e--,
  52966. (e |= e >> 1),
  52967. (e |= e >> 2),
  52968. (e |= e >> 4),
  52969. (e |= e >> 8),
  52970. (e |= e >> 16),
  52971. e++,
  52972. e
  52973. );
  52974. },
  52975. }),
  52976. (n.Spline = function (e) {
  52977. function t(e, t, i, n, r, o, a) {
  52978. var s = 0.5 * (i - e),
  52979. l = 0.5 * (n - t);
  52980. return (
  52981. (2 * (t - i) + s + l) * a +
  52982. (-3 * (t - i) - 2 * s - l) * o +
  52983. s * r +
  52984. t
  52985. );
  52986. }
  52987. this.points = e;
  52988. var i,
  52989. r,
  52990. o,
  52991. a,
  52992. s,
  52993. l,
  52994. c,
  52995. h,
  52996. u,
  52997. d = [],
  52998. p = {
  52999. x: 0,
  53000. y: 0,
  53001. z: 0,
  53002. };
  53003. (this.initFromArray = function (e) {
  53004. this.points = [];
  53005. for (var t = 0; t < e.length; t++)
  53006. this.points[t] = {
  53007. x: e[t][0],
  53008. y: e[t][1],
  53009. z: e[t][2],
  53010. };
  53011. }),
  53012. (this.getPoint = function (e) {
  53013. return (
  53014. (i = (this.points.length - 1) * e),
  53015. (r = Math.floor(i)),
  53016. (o = i - r),
  53017. (d[0] = 0 === r ? r : r - 1),
  53018. (d[1] = r),
  53019. (d[2] =
  53020. r > this.points.length - 2
  53021. ? this.points.length - 1
  53022. : r + 1),
  53023. (d[3] =
  53024. r > this.points.length - 3
  53025. ? this.points.length - 1
  53026. : r + 2),
  53027. (l = this.points[d[0]]),
  53028. (c = this.points[d[1]]),
  53029. (h = this.points[d[2]]),
  53030. (u = this.points[d[3]]),
  53031. (a = o * o),
  53032. (s = o * a),
  53033. (p.x = t(l.x, c.x, h.x, u.x, o, a, s)),
  53034. (p.y = t(l.y, c.y, h.y, u.y, o, a, s)),
  53035. (p.z = t(l.z, c.z, h.z, u.z, o, a, s)),
  53036. p
  53037. );
  53038. }),
  53039. (this.getControlPointsArray = function () {
  53040. var e,
  53041. t,
  53042. i = this.points.length,
  53043. n = [];
  53044. for (e = 0; e < i; e++)
  53045. (t = this.points[e]), (n[e] = [t.x, t.y, t.z]);
  53046. return n;
  53047. }),
  53048. (this.getLength = function (e) {
  53049. var t,
  53050. i,
  53051. r,
  53052. o,
  53053. a = 0,
  53054. s = 0,
  53055. l = 0,
  53056. c = new n.Vector3(),
  53057. h = new n.Vector3(),
  53058. u = [],
  53059. d = 0;
  53060. for (
  53061. u[0] = 0,
  53062. e || (e = 100),
  53063. r = this.points.length * e,
  53064. c.copy(this.points[0]),
  53065. t = 1;
  53066. t < r;
  53067. t++
  53068. )
  53069. (i = t / r),
  53070. (o = this.getPoint(i)),
  53071. h.copy(o),
  53072. (d += h.distanceTo(c)),
  53073. c.copy(o),
  53074. (a = (this.points.length - 1) * i),
  53075. (s = Math.floor(a)),
  53076. s !== l && ((u[s] = d), (l = s));
  53077. return (
  53078. (u[u.length] = d),
  53079. {
  53080. chunks: u,
  53081. total: d,
  53082. }
  53083. );
  53084. }),
  53085. (this.reparametrizeByArcLength = function (e) {
  53086. var t,
  53087. i,
  53088. r,
  53089. o,
  53090. a,
  53091. s,
  53092. l,
  53093. c,
  53094. h = [],
  53095. u = new n.Vector3(),
  53096. d = this.getLength();
  53097. for (
  53098. h.push(u.copy(this.points[0]).clone()), t = 1;
  53099. t < this.points.length;
  53100. t++
  53101. ) {
  53102. for (
  53103. s = d.chunks[t] - d.chunks[t - 1],
  53104. l = Math.ceil((e * s) / d.total),
  53105. o = (t - 1) / (this.points.length - 1),
  53106. a = t / (this.points.length - 1),
  53107. i = 1;
  53108. i < l - 1;
  53109. i++
  53110. )
  53111. (r = o + i * (1 / l) * (a - o)),
  53112. (c = this.getPoint(r)),
  53113. h.push(u.copy(c).clone());
  53114. h.push(u.copy(this.points[t]).clone());
  53115. }
  53116. this.points = h;
  53117. });
  53118. }),
  53119. (n.Triangle = function (e, t, i) {
  53120. (this.a = void 0 !== e ? e : new n.Vector3()),
  53121. (this.b = void 0 !== t ? t : new n.Vector3()),
  53122. (this.c = void 0 !== i ? i : new n.Vector3());
  53123. }),
  53124. (n.Triangle.normal = (function () {
  53125. var e = new n.Vector3();
  53126. return function (t, i, r, o) {
  53127. var a = o || new n.Vector3();
  53128. a.subVectors(r, i), e.subVectors(t, i), a.cross(e);
  53129. var s = a.lengthSq();
  53130. return s > 0
  53131. ? a.multiplyScalar(1 / Math.sqrt(s))
  53132. : a.set(0, 0, 0);
  53133. };
  53134. })()),
  53135. (n.Triangle.barycoordFromPoint = (function () {
  53136. var e = new n.Vector3(),
  53137. t = new n.Vector3(),
  53138. i = new n.Vector3();
  53139. return function (r, o, a, s, l) {
  53140. e.subVectors(s, o), t.subVectors(a, o), i.subVectors(r, o);
  53141. var c = e.dot(e),
  53142. h = e.dot(t),
  53143. u = e.dot(i),
  53144. d = t.dot(t),
  53145. p = t.dot(i),
  53146. f = c * d - h * h,
  53147. g = l || new n.Vector3();
  53148. if (0 === f) return g.set(-2, -1, -1);
  53149. var m = 1 / f,
  53150. v = (d * u - h * p) * m,
  53151. A = (c * p - h * u) * m;
  53152. return g.set(1 - v - A, A, v);
  53153. };
  53154. })()),
  53155. (n.Triangle.containsPoint = (function () {
  53156. var e = new n.Vector3();
  53157. return function (t, i, r, o) {
  53158. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  53159. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1;
  53160. };
  53161. })()),
  53162. (n.Triangle.prototype = {
  53163. constructor: n.Triangle,
  53164. set: function (e, t, i) {
  53165. return this.a.copy(e), this.b.copy(t), this.c.copy(i), this;
  53166. },
  53167. setFromPointsAndIndices: function (e, t, i, n) {
  53168. return (
  53169. this.a.copy(e[t]), this.b.copy(e[i]), this.c.copy(e[n]), this
  53170. );
  53171. },
  53172. clone: function () {
  53173. return new this.constructor().copy(this);
  53174. },
  53175. copy: function (e) {
  53176. return this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this;
  53177. },
  53178. area: (function () {
  53179. var e = new n.Vector3(),
  53180. t = new n.Vector3();
  53181. return function () {
  53182. return (
  53183. e.subVectors(this.c, this.b),
  53184. t.subVectors(this.a, this.b),
  53185. 0.5 * e.cross(t).length()
  53186. );
  53187. };
  53188. })(),
  53189. midpoint: function (e) {
  53190. var t = e || new n.Vector3();
  53191. return t
  53192. .addVectors(this.a, this.b)
  53193. .add(this.c)
  53194. .multiplyScalar(1 / 3);
  53195. },
  53196. normal: function (e) {
  53197. return n.Triangle.normal(this.a, this.b, this.c, e);
  53198. },
  53199. plane: function (e) {
  53200. var t = e || new n.Plane();
  53201. return t.setFromCoplanarPoints(this.a, this.b, this.c);
  53202. },
  53203. barycoordFromPoint: function (e, t) {
  53204. return n.Triangle.barycoordFromPoint(
  53205. e,
  53206. this.a,
  53207. this.b,
  53208. this.c,
  53209. t
  53210. );
  53211. },
  53212. containsPoint: function (e) {
  53213. return n.Triangle.containsPoint(e, this.a, this.b, this.c);
  53214. },
  53215. equals: function (e) {
  53216. return (
  53217. e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  53218. );
  53219. },
  53220. }),
  53221. (n.Interpolant = function (e, t, i, n) {
  53222. (this.parameterPositions = e),
  53223. (this._cachedIndex = 0),
  53224. (this.resultBuffer = void 0 !== n ? n : new t.constructor(i)),
  53225. (this.sampleValues = t),
  53226. (this.valueSize = i);
  53227. }),
  53228. (n.Interpolant.prototype = {
  53229. constructor: n.Interpolant,
  53230. evaluate: function (e) {
  53231. var t = this.parameterPositions,
  53232. i = this._cachedIndex,
  53233. n = t[i],
  53234. r = t[i - 1];
  53235. e: {
  53236. t: {
  53237. var o;
  53238. i: {
  53239. n: if (!(e < n)) {
  53240. for (var a = i + 2; ; ) {
  53241. if (void 0 === n) {
  53242. if (e < r) break n;
  53243. return (
  53244. (i = t.length),
  53245. (this._cachedIndex = i),
  53246. this.afterEnd_(i - 1, e, r)
  53247. );
  53248. }
  53249. if (i === a) break;
  53250. if (((r = n), (n = t[++i]), e < n)) break t;
  53251. }
  53252. o = t.length;
  53253. break i;
  53254. }
  53255. {
  53256. if (e >= r) break e;
  53257. var s = t[1];
  53258. e < s && ((i = 2), (r = s));
  53259. for (var a = i - 2; ; ) {
  53260. if (void 0 === r)
  53261. return (
  53262. (this._cachedIndex = 0), this.beforeStart_(0, e, n)
  53263. );
  53264. if (i === a) break;
  53265. if (((n = r), (r = t[--i - 1]), e >= r)) break t;
  53266. }
  53267. (o = i), (i = 0);
  53268. }
  53269. }
  53270. for (; i < o; ) {
  53271. var l = (i + o) >>> 1;
  53272. e < t[l] ? (o = l) : (i = l + 1);
  53273. }
  53274. if (((n = t[i]), (r = t[i - 1]), void 0 === r))
  53275. return (this._cachedIndex = 0), this.beforeStart_(0, e, n);
  53276. if (void 0 === n)
  53277. return (
  53278. (i = t.length),
  53279. (this._cachedIndex = i),
  53280. this.afterEnd_(i - 1, r, e)
  53281. );
  53282. }
  53283. (this._cachedIndex = i), this.intervalChanged_(i, r, n);
  53284. }
  53285. return this.interpolate_(i, r, e, n);
  53286. },
  53287. settings: null,
  53288. DefaultSettings_: {},
  53289. getSettings_: function () {
  53290. return this.settings || this.DefaultSettings_;
  53291. },
  53292. copySampleValue_: function (e) {
  53293. for (
  53294. var t = this.resultBuffer,
  53295. i = this.sampleValues,
  53296. n = this.valueSize,
  53297. r = e * n,
  53298. o = 0;
  53299. o !== n;
  53300. ++o
  53301. )
  53302. t[o] = i[r + o];
  53303. return t;
  53304. },
  53305. interpolate_: function (e, t, i, n) {
  53306. throw new Error("call to abstract method");
  53307. },
  53308. intervalChanged_: function (e, t, i) {},
  53309. }),
  53310. Object.assign(n.Interpolant.prototype, {
  53311. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  53312. afterEnd_: n.Interpolant.prototype.copySampleValue_,
  53313. }),
  53314. (n.CubicInterpolant = function (e, t, i, r) {
  53315. n.Interpolant.call(this, e, t, i, r),
  53316. (this._weightPrev = -0),
  53317. (this._offsetPrev = -0),
  53318. (this._weightNext = -0),
  53319. (this._offsetNext = -0);
  53320. }),
  53321. (n.CubicInterpolant.prototype = Object.assign(
  53322. Object.create(n.Interpolant.prototype),
  53323. {
  53324. constructor: n.CubicInterpolant,
  53325. DefaultSettings_: {
  53326. endingStart: n.ZeroCurvatureEnding,
  53327. endingEnd: n.ZeroCurvatureEnding,
  53328. },
  53329. intervalChanged_: function (e, t, i) {
  53330. var r = this.parameterPositions,
  53331. o = e - 2,
  53332. a = e + 1,
  53333. s = r[o],
  53334. l = r[a];
  53335. if (void 0 === s)
  53336. switch (this.getSettings_().endingStart) {
  53337. case n.ZeroSlopeEnding:
  53338. (o = e), (s = 2 * t - i);
  53339. break;
  53340. case n.WrapAroundEnding:
  53341. (o = r.length - 2), (s = t + r[o] - r[o + 1]);
  53342. break;
  53343. default:
  53344. (o = e), (s = i);
  53345. }
  53346. if (void 0 === l)
  53347. switch (this.getSettings_().endingEnd) {
  53348. case n.ZeroSlopeEnding:
  53349. (a = e), (l = 2 * i - t);
  53350. break;
  53351. case n.WrapAroundEnding:
  53352. (a = 1), (l = i + r[1] - r[0]);
  53353. break;
  53354. default:
  53355. (a = e - 1), (l = t);
  53356. }
  53357. var c = 0.5 * (i - t),
  53358. h = this.valueSize;
  53359. (this._weightPrev = c / (t - s)),
  53360. (this._weightNext = c / (l - i)),
  53361. (this._offsetPrev = o * h),
  53362. (this._offsetNext = a * h);
  53363. },
  53364. interpolate_: function (e, t, i, n) {
  53365. for (
  53366. var r = this.resultBuffer,
  53367. o = this.sampleValues,
  53368. a = this.valueSize,
  53369. s = e * a,
  53370. l = s - a,
  53371. c = this._offsetPrev,
  53372. h = this._offsetNext,
  53373. u = this._weightPrev,
  53374. d = this._weightNext,
  53375. p = (i - t) / (n - t),
  53376. f = p * p,
  53377. g = f * p,
  53378. m = -u * g + 2 * u * f - u * p,
  53379. v = (1 + u) * g + (-1.5 - 2 * u) * f + (-0.5 + u) * p + 1,
  53380. A = (-1 - d) * g + (1.5 + d) * f + 0.5 * p,
  53381. y = d * g - d * f,
  53382. C = 0;
  53383. C !== a;
  53384. ++C
  53385. )
  53386. r[C] =
  53387. m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  53388. return r;
  53389. },
  53390. }
  53391. )),
  53392. (n.DiscreteInterpolant = function (e, t, i, r) {
  53393. n.Interpolant.call(this, e, t, i, r);
  53394. }),
  53395. (n.DiscreteInterpolant.prototype = Object.assign(
  53396. Object.create(n.Interpolant.prototype),
  53397. {
  53398. constructor: n.DiscreteInterpolant,
  53399. interpolate_: function (e, t, i, n) {
  53400. return this.copySampleValue_(e - 1);
  53401. },
  53402. }
  53403. )),
  53404. (n.LinearInterpolant = function (e, t, i, r) {
  53405. n.Interpolant.call(this, e, t, i, r);
  53406. }),
  53407. (n.LinearInterpolant.prototype = Object.assign(
  53408. Object.create(n.Interpolant.prototype),
  53409. {
  53410. constructor: n.LinearInterpolant,
  53411. interpolate_: function (e, t, i, n) {
  53412. for (
  53413. var r = this.resultBuffer,
  53414. o = this.sampleValues,
  53415. a = this.valueSize,
  53416. s = e * a,
  53417. l = s - a,
  53418. c = (i - t) / (n - t),
  53419. h = 1 - c,
  53420. u = 0;
  53421. u !== a;
  53422. ++u
  53423. )
  53424. r[u] = o[l + u] * h + o[s + u] * c;
  53425. return r;
  53426. },
  53427. }
  53428. )),
  53429. (n.QuaternionLinearInterpolant = function (e, t, i, r) {
  53430. n.Interpolant.call(this, e, t, i, r);
  53431. }),
  53432. (n.QuaternionLinearInterpolant.prototype = Object.assign(
  53433. Object.create(n.Interpolant.prototype),
  53434. {
  53435. constructor: n.QuaternionLinearInterpolant,
  53436. interpolate_: function (e, t, i, r) {
  53437. for (
  53438. var o = this.resultBuffer,
  53439. a = this.sampleValues,
  53440. s = this.valueSize,
  53441. l = e * s,
  53442. c = (i - t) / (r - t),
  53443. h = l + s;
  53444. l !== h;
  53445. l += 4
  53446. )
  53447. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  53448. return o;
  53449. },
  53450. }
  53451. )),
  53452. (n.Clock = function (e) {
  53453. (this.autoStart = void 0 === e || e),
  53454. (this.startTime = 0),
  53455. (this.oldTime = 0),
  53456. (this.elapsedTime = 0),
  53457. (this.running = !1);
  53458. }),
  53459. (n.Clock.prototype = {
  53460. constructor: n.Clock,
  53461. start: function () {
  53462. (this.startTime = performance.now()),
  53463. (this.oldTime = this.startTime),
  53464. (this.running = !0);
  53465. },
  53466. stop: function () {
  53467. this.getElapsedTime(), (this.running = !1);
  53468. },
  53469. getElapsedTime: function () {
  53470. return this.getDelta(), this.elapsedTime;
  53471. },
  53472. getDelta: function () {
  53473. var e = 0;
  53474. if (
  53475. (this.autoStart && !this.running && this.start(), this.running)
  53476. ) {
  53477. var t = performance.now();
  53478. (e = 0.001 * (t - this.oldTime)),
  53479. (this.oldTime = t),
  53480. (this.elapsedTime += e);
  53481. }
  53482. return e;
  53483. },
  53484. }),
  53485. (n.EventDispatcher = function () {}),
  53486. (n.EventDispatcher.prototype = {
  53487. constructor: n.EventDispatcher,
  53488. apply: function (e) {
  53489. (e.addEventListener =
  53490. n.EventDispatcher.prototype.addEventListener),
  53491. (e.hasEventListener =
  53492. n.EventDispatcher.prototype.hasEventListener),
  53493. (e.removeEventListener =
  53494. n.EventDispatcher.prototype.removeEventListener),
  53495. (e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent);
  53496. },
  53497. addEventListener: function (e, t) {
  53498. void 0 === this._listeners && (this._listeners = {});
  53499. var i = this._listeners;
  53500. void 0 === i[e] && (i[e] = []),
  53501. i[e].indexOf(t) === -1 && i[e].push(t);
  53502. },
  53503. hasEventListener: function (e, t) {
  53504. if (void 0 === this._listeners) return !1;
  53505. var i = this._listeners;
  53506. return void 0 !== i[e] && i[e].indexOf(t) !== -1;
  53507. },
  53508. removeEventListener: function (e, t) {
  53509. if (void 0 !== this._listeners) {
  53510. var i = this._listeners,
  53511. n = i[e];
  53512. if (void 0 !== n) {
  53513. var r = n.indexOf(t);
  53514. r !== -1 && n.splice(r, 1);
  53515. }
  53516. }
  53517. },
  53518. dispatchEvent: function (e) {
  53519. if (void 0 !== this._listeners) {
  53520. var t = this._listeners,
  53521. i = t[e.type];
  53522. if (void 0 !== i) {
  53523. e.target = this;
  53524. for (var n = [], r = i.length, o = 0; o < r; o++) n[o] = i[o];
  53525. for (var o = 0; o < r; o++) n[o].call(this, e);
  53526. }
  53527. }
  53528. },
  53529. }),
  53530. (n.Layers = function () {
  53531. this.mask = 1;
  53532. }),
  53533. (n.Layers.prototype = {
  53534. constructor: n.Layers,
  53535. set: function (e) {
  53536. this.mask = 1 << e;
  53537. },
  53538. enable: function (e) {
  53539. this.mask |= 1 << e;
  53540. },
  53541. toggle: function (e) {
  53542. this.mask ^= 1 << e;
  53543. },
  53544. disable: function (e) {
  53545. this.mask &= ~(1 << e);
  53546. },
  53547. test: function (e) {
  53548. return 0 !== (this.mask & e.mask);
  53549. },
  53550. }),
  53551. (function (e) {
  53552. function t(e, t) {
  53553. return e.distance - t.distance;
  53554. }
  53555. function i(e, t, n, r) {
  53556. if (e.visible !== !1 && (e.raycast(t, n), r === !0))
  53557. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  53558. i(o[a], t, n, !0);
  53559. }
  53560. (e.Raycaster = function (t, i, n, r) {
  53561. (this.ray = new e.Ray(t, i)),
  53562. (this.near = n || 0),
  53563. (this.far = r || 1 / 0),
  53564. (this.params = {
  53565. Mesh: {},
  53566. Line: {},
  53567. LOD: {},
  53568. Points: {
  53569. threshold: 1,
  53570. },
  53571. Sprite: {},
  53572. }),
  53573. Object.defineProperties(this.params, {
  53574. PointCloud: {
  53575. get: function () {
  53576. return (
  53577. console.warn(
  53578. "THREE.Raycaster: params.PointCloud has been renamed to params.Points."
  53579. ),
  53580. this.Points
  53581. );
  53582. },
  53583. },
  53584. });
  53585. }),
  53586. (e.Raycaster.prototype = {
  53587. constructor: e.Raycaster,
  53588. linePrecision: 1,
  53589. set: function (e, t) {
  53590. this.ray.set(e, t);
  53591. },
  53592. setFromCamera: function (t, i) {
  53593. i instanceof e.PerspectiveCamera
  53594. ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  53595. this.ray.direction
  53596. .set(t.x, t.y, 0.5)
  53597. .unproject(i)
  53598. .sub(this.ray.origin)
  53599. .normalize())
  53600. : i instanceof e.OrthographicCamera
  53601. ? (this.ray.origin.set(t.x, t.y, -1).unproject(i),
  53602. this.ray.direction
  53603. .set(0, 0, -1)
  53604. .transformDirection(i.matrixWorld))
  53605. : console.error(
  53606. "THREE.Raycaster: Unsupported camera type."
  53607. );
  53608. },
  53609. intersectObject: function (e, n) {
  53610. var r = [];
  53611. return i(e, this, r, n), r.sort(t), r;
  53612. },
  53613. intersectObjects: function (e, n) {
  53614. var r = [];
  53615. if (Array.isArray(e) === !1)
  53616. return (
  53617. console.warn(
  53618. "THREE.Raycaster.intersectObjects: objects is not an Array."
  53619. ),
  53620. r
  53621. );
  53622. for (var o = 0, a = e.length; o < a; o++) i(e[o], this, r, n);
  53623. return r.sort(t), r;
  53624. },
  53625. });
  53626. })(n),
  53627. (n.Object3D = function () {
  53628. function e() {
  53629. o.setFromEuler(r, !1);
  53630. }
  53631. function t() {
  53632. r.setFromQuaternion(o, void 0, !1);
  53633. }
  53634. Object.defineProperty(this, "id", {
  53635. value: n.Object3DIdCount++,
  53636. }),
  53637. (this.uuid = n.Math.generateUUID()),
  53638. (this.name = ""),
  53639. (this.type = "Object3D"),
  53640. (this.parent = null),
  53641. (this.children = []),
  53642. (this.up = n.Object3D.DefaultUp.clone());
  53643. var i = new n.Vector3(),
  53644. r = new n.Euler(),
  53645. o = new n.Quaternion(),
  53646. a = new n.Vector3(1, 1, 1);
  53647. r.onChange(e),
  53648. o.onChange(t),
  53649. Object.defineProperties(this, {
  53650. position: {
  53651. enumerable: !0,
  53652. value: i,
  53653. },
  53654. rotation: {
  53655. enumerable: !0,
  53656. value: r,
  53657. },
  53658. quaternion: {
  53659. enumerable: !0,
  53660. value: o,
  53661. },
  53662. scale: {
  53663. enumerable: !0,
  53664. value: a,
  53665. },
  53666. modelViewMatrix: {
  53667. value: new n.Matrix4(),
  53668. },
  53669. normalMatrix: {
  53670. value: new n.Matrix3(),
  53671. },
  53672. }),
  53673. (this.rotationAutoUpdate = !0),
  53674. (this.matrix = new n.Matrix4()),
  53675. (this.matrixWorld = new n.Matrix4()),
  53676. (this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate),
  53677. (this.matrixWorldNeedsUpdate = !1),
  53678. (this.layers = new n.Layers()),
  53679. (this.visible = !0),
  53680. (this.castShadow = !1),
  53681. (this.receiveShadow = !1),
  53682. (this.frustumCulled = !0),
  53683. (this.renderOrder = 0),
  53684. (this.userData = {});
  53685. }),
  53686. (n.Object3D.DefaultUp = new n.Vector3(0, 1, 0)),
  53687. (n.Object3D.DefaultMatrixAutoUpdate = !0),
  53688. (n.Object3D.prototype = {
  53689. constructor: n.Object3D,
  53690. applyMatrix: function (e) {
  53691. this.matrix.multiplyMatrices(e, this.matrix),
  53692. this.matrix.decompose(
  53693. this.position,
  53694. this.quaternion,
  53695. this.scale
  53696. );
  53697. },
  53698. setRotationFromAxisAngle: function (e, t) {
  53699. this.quaternion.setFromAxisAngle(e, t);
  53700. },
  53701. setRotationFromEuler: function (e) {
  53702. this.quaternion.setFromEuler(e, !0);
  53703. },
  53704. setRotationFromMatrix: function (e) {
  53705. this.quaternion.setFromRotationMatrix(e);
  53706. },
  53707. setRotationFromQuaternion: function (e) {
  53708. this.quaternion.copy(e);
  53709. },
  53710. rotateOnAxis: (function () {
  53711. var e = new n.Quaternion();
  53712. return function (t, i) {
  53713. return (
  53714. e.setFromAxisAngle(t, i), this.quaternion.multiply(e), this
  53715. );
  53716. };
  53717. })(),
  53718. rotateX: (function () {
  53719. var e = new n.Vector3(1, 0, 0);
  53720. return function (t) {
  53721. return this.rotateOnAxis(e, t);
  53722. };
  53723. })(),
  53724. rotateY: (function () {
  53725. var e = new n.Vector3(0, 1, 0);
  53726. return function (t) {
  53727. return this.rotateOnAxis(e, t);
  53728. };
  53729. })(),
  53730. rotateZ: (function () {
  53731. var e = new n.Vector3(0, 0, 1);
  53732. return function (t) {
  53733. return this.rotateOnAxis(e, t);
  53734. };
  53735. })(),
  53736. translateOnAxis: (function () {
  53737. var e = new n.Vector3();
  53738. return function (t, i) {
  53739. return (
  53740. e.copy(t).applyQuaternion(this.quaternion),
  53741. this.position.add(e.multiplyScalar(i)),
  53742. this
  53743. );
  53744. };
  53745. })(),
  53746. translateX: (function () {
  53747. var e = new n.Vector3(1, 0, 0);
  53748. return function (t) {
  53749. return this.translateOnAxis(e, t);
  53750. };
  53751. })(),
  53752. translateY: (function () {
  53753. var e = new n.Vector3(0, 1, 0);
  53754. return function (t) {
  53755. return this.translateOnAxis(e, t);
  53756. };
  53757. })(),
  53758. translateZ: (function () {
  53759. var e = new n.Vector3(0, 0, 1);
  53760. return function (t) {
  53761. return this.translateOnAxis(e, t);
  53762. };
  53763. })(),
  53764. localToWorld: function (e) {
  53765. return e.applyMatrix4(this.matrixWorld);
  53766. },
  53767. worldToLocal: (function () {
  53768. var e = new n.Matrix4();
  53769. return function (t) {
  53770. return t.applyMatrix4(e.getInverse(this.matrixWorld));
  53771. };
  53772. })(),
  53773. lookAt: (function () {
  53774. var e = new n.Matrix4();
  53775. return function (t) {
  53776. e.lookAt(t, this.position, this.up),
  53777. this.quaternion.setFromRotationMatrix(e);
  53778. };
  53779. })(),
  53780. add: function (e) {
  53781. if (arguments.length > 1) {
  53782. for (var t = 0; t < arguments.length; t++)
  53783. this.add(arguments[t]);
  53784. return this;
  53785. }
  53786. return e === this
  53787. ? (console.error(
  53788. "THREE.Object3D.add: object can't be added as a child of itself.",
  53789. e
  53790. ),
  53791. this)
  53792. : (e instanceof n.Object3D
  53793. ? (null !== e.parent && e.parent.remove(e),
  53794. (e.parent = this),
  53795. e.dispatchEvent({
  53796. type: "added",
  53797. }),
  53798. this.children.push(e))
  53799. : console.error(
  53800. "THREE.Object3D.add: object not an instance of THREE.Object3D.",
  53801. e
  53802. ),
  53803. this);
  53804. },
  53805. remove: function (e) {
  53806. if (arguments.length > 1)
  53807. for (var t = 0; t < arguments.length; t++)
  53808. this.remove(arguments[t]);
  53809. var i = this.children.indexOf(e);
  53810. i !== -1 &&
  53811. ((e.parent = null),
  53812. e.dispatchEvent({
  53813. type: "removed",
  53814. }),
  53815. this.children.splice(i, 1));
  53816. },
  53817. getObjectById: function (e) {
  53818. return this.getObjectByProperty("id", e);
  53819. },
  53820. getObjectByName: function (e) {
  53821. return this.getObjectByProperty("name", e);
  53822. },
  53823. getObjectByProperty: function (e, t) {
  53824. if (this[e] === t) return this;
  53825. for (var i = 0, n = this.children.length; i < n; i++) {
  53826. var r = this.children[i],
  53827. o = r.getObjectByProperty(e, t);
  53828. if (void 0 !== o) return o;
  53829. }
  53830. },
  53831. getWorldPosition: function (e) {
  53832. var t = e || new n.Vector3();
  53833. return (
  53834. this.updateMatrixWorld(!0),
  53835. t.setFromMatrixPosition(this.matrixWorld)
  53836. );
  53837. },
  53838. getWorldQuaternion: (function () {
  53839. var e = new n.Vector3(),
  53840. t = new n.Vector3();
  53841. return function (i) {
  53842. var r = i || new n.Quaternion();
  53843. return (
  53844. this.updateMatrixWorld(!0),
  53845. this.matrixWorld.decompose(e, r, t),
  53846. r
  53847. );
  53848. };
  53849. })(),
  53850. getWorldRotation: (function () {
  53851. var e = new n.Quaternion();
  53852. return function (t) {
  53853. var i = t || new n.Euler();
  53854. return (
  53855. this.getWorldQuaternion(e),
  53856. i.setFromQuaternion(e, this.rotation.order, !1)
  53857. );
  53858. };
  53859. })(),
  53860. getWorldScale: (function () {
  53861. var e = new n.Vector3(),
  53862. t = new n.Quaternion();
  53863. return function (i) {
  53864. var r = i || new n.Vector3();
  53865. return (
  53866. this.updateMatrixWorld(!0),
  53867. this.matrixWorld.decompose(e, t, r),
  53868. r
  53869. );
  53870. };
  53871. })(),
  53872. getWorldDirection: (function () {
  53873. var e = new n.Quaternion();
  53874. return function (t) {
  53875. var i = t || new n.Vector3();
  53876. return (
  53877. this.getWorldQuaternion(e), i.set(0, 0, 1).applyQuaternion(e)
  53878. );
  53879. };
  53880. })(),
  53881. raycast: function () {},
  53882. traverse: function (e) {
  53883. e(this);
  53884. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  53885. t[i].traverse(e);
  53886. },
  53887. traverseVisible: function (e) {
  53888. if (this.visible !== !1) {
  53889. e(this);
  53890. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  53891. t[i].traverseVisible(e);
  53892. }
  53893. },
  53894. traverseAncestors: function (e) {
  53895. var t = this.parent;
  53896. null !== t && (e(t), t.traverseAncestors(e));
  53897. },
  53898. updateMatrix: function () {
  53899. this.matrix.compose(this.position, this.quaternion, this.scale),
  53900. (this.matrixWorldNeedsUpdate = !0);
  53901. },
  53902. updateMatrixWorld: function (e) {
  53903. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  53904. (this.matrixWorldNeedsUpdate !== !0 && e !== !0) ||
  53905. (null === this.parent
  53906. ? this.matrixWorld.copy(this.matrix)
  53907. : this.matrixWorld.multiplyMatrices(
  53908. this.parent.matrixWorld,
  53909. this.matrix
  53910. ),
  53911. (this.matrixWorldNeedsUpdate = !1),
  53912. (e = !0));
  53913. for (var t = 0, i = this.children.length; t < i; t++)
  53914. this.children[t].updateMatrixWorld(e);
  53915. },
  53916. toJSON: function (e) {
  53917. function t(e) {
  53918. var t = [];
  53919. for (var i in e) {
  53920. var n = e[i];
  53921. delete n.metadata, t.push(n);
  53922. }
  53923. return t;
  53924. }
  53925. var i = void 0 === e,
  53926. n = {};
  53927. i &&
  53928. ((e = {
  53929. geometries: {},
  53930. materials: {},
  53931. textures: {},
  53932. images: {},
  53933. }),
  53934. (n.metadata = {
  53935. version: 4.4,
  53936. type: "Object",
  53937. generator: "Object3D.toJSON",
  53938. }));
  53939. var r = {};
  53940. if (
  53941. ((r.uuid = this.uuid),
  53942. (r.type = this.type),
  53943. "" !== this.name && (r.name = this.name),
  53944. "{}" !== JSON.stringify(this.userData) &&
  53945. (r.userData = this.userData),
  53946. this.castShadow === !0 && (r.castShadow = !0),
  53947. this.receiveShadow === !0 && (r.receiveShadow = !0),
  53948. this.visible === !1 && (r.visible = !1),
  53949. (r.matrix = this.matrix.toArray()),
  53950. void 0 !== this.geometry &&
  53951. (void 0 === e.geometries[this.geometry.uuid] &&
  53952. (e.geometries[this.geometry.uuid] =
  53953. this.geometry.toJSON(e)),
  53954. (r.geometry = this.geometry.uuid)),
  53955. void 0 !== this.material &&
  53956. (void 0 === e.materials[this.material.uuid] &&
  53957. (e.materials[this.material.uuid] = this.material.toJSON(e)),
  53958. (r.material = this.material.uuid)),
  53959. this.children.length > 0)
  53960. ) {
  53961. r.children = [];
  53962. for (var o = 0; o < this.children.length; o++)
  53963. r.children.push(this.children[o].toJSON(e).object);
  53964. }
  53965. if (i) {
  53966. var a = t(e.geometries),
  53967. s = t(e.materials),
  53968. l = t(e.textures),
  53969. c = t(e.images);
  53970. a.length > 0 && (n.geometries = a),
  53971. s.length > 0 && (n.materials = s),
  53972. l.length > 0 && (n.textures = l),
  53973. c.length > 0 && (n.images = c);
  53974. }
  53975. return (n.object = r), n;
  53976. },
  53977. clone: function (e) {
  53978. return new this.constructor().copy(this, e);
  53979. },
  53980. copy: function (e, t) {
  53981. if (
  53982. (void 0 === t && (t = !0),
  53983. (this.name = e.name),
  53984. this.up.copy(e.up),
  53985. this.position.copy(e.position),
  53986. this.quaternion.copy(e.quaternion),
  53987. this.scale.copy(e.scale),
  53988. (this.rotationAutoUpdate = e.rotationAutoUpdate),
  53989. this.matrix.copy(e.matrix),
  53990. this.matrixWorld.copy(e.matrixWorld),
  53991. (this.matrixAutoUpdate = e.matrixAutoUpdate),
  53992. (this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate),
  53993. (this.visible = e.visible),
  53994. (this.castShadow = e.castShadow),
  53995. (this.receiveShadow = e.receiveShadow),
  53996. (this.frustumCulled = e.frustumCulled),
  53997. (this.renderOrder = e.renderOrder),
  53998. (this.userData = JSON.parse(JSON.stringify(e.userData))),
  53999. t === !0)
  54000. )
  54001. for (var i = 0; i < e.children.length; i++) {
  54002. var n = e.children[i];
  54003. this.add(n.clone());
  54004. }
  54005. return this;
  54006. },
  54007. }),
  54008. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  54009. (n.Object3DIdCount = 0),
  54010. (n.Face3 = function (e, t, i, r, o, a) {
  54011. (this.a = e),
  54012. (this.b = t),
  54013. (this.c = i),
  54014. (this.normal = r instanceof n.Vector3 ? r : new n.Vector3()),
  54015. (this.vertexNormals = Array.isArray(r) ? r : []),
  54016. (this.color = o instanceof n.Color ? o : new n.Color()),
  54017. (this.vertexColors = Array.isArray(o) ? o : []),
  54018. (this.materialIndex = void 0 !== a ? a : 0);
  54019. }),
  54020. (n.Face3.prototype = {
  54021. constructor: n.Face3,
  54022. clone: function () {
  54023. return new this.constructor().copy(this);
  54024. },
  54025. copy: function (e) {
  54026. (this.a = e.a),
  54027. (this.b = e.b),
  54028. (this.c = e.c),
  54029. this.normal.copy(e.normal),
  54030. this.color.copy(e.color),
  54031. (this.materialIndex = e.materialIndex);
  54032. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  54033. this.vertexNormals[t] = e.vertexNormals[t].clone();
  54034. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  54035. this.vertexColors[t] = e.vertexColors[t].clone();
  54036. return this;
  54037. },
  54038. }),
  54039. (n.BufferAttribute = function (e, t) {
  54040. (this.uuid = n.Math.generateUUID()),
  54041. (this.array = e),
  54042. (this.itemSize = t),
  54043. (this.dynamic = !1),
  54044. (this.updateRange = {
  54045. offset: 0,
  54046. count: -1,
  54047. }),
  54048. (this.version = 0);
  54049. }),
  54050. (n.BufferAttribute.prototype = {
  54051. constructor: n.BufferAttribute,
  54052. get count() {
  54053. return this.array.length / this.itemSize;
  54054. },
  54055. set needsUpdate(e) {
  54056. e === !0 && this.version++;
  54057. },
  54058. setDynamic: function (e) {
  54059. return (this.dynamic = e), this;
  54060. },
  54061. copy: function (e) {
  54062. return (
  54063. (this.array = new e.array.constructor(e.array)),
  54064. (this.itemSize = e.itemSize),
  54065. (this.dynamic = e.dynamic),
  54066. this
  54067. );
  54068. },
  54069. copyAt: function (e, t, i) {
  54070. (e *= this.itemSize), (i *= t.itemSize);
  54071. for (var n = 0, r = this.itemSize; n < r; n++)
  54072. this.array[e + n] = t.array[i + n];
  54073. return this;
  54074. },
  54075. copyArray: function (e) {
  54076. return this.array.set(e), this;
  54077. },
  54078. copyColorsArray: function (e) {
  54079. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  54080. var a = e[r];
  54081. void 0 === a &&
  54082. (console.warn(
  54083. "THREE.BufferAttribute.copyColorsArray(): color is undefined",
  54084. r
  54085. ),
  54086. (a = new n.Color())),
  54087. (t[i++] = a.r),
  54088. (t[i++] = a.g),
  54089. (t[i++] = a.b);
  54090. }
  54091. return this;
  54092. },
  54093. copyIndicesArray: function (e) {
  54094. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  54095. var o = e[n];
  54096. (t[i++] = o.a), (t[i++] = o.b), (t[i++] = o.c);
  54097. }
  54098. return this;
  54099. },
  54100. copyVector2sArray: function (e) {
  54101. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  54102. var a = e[r];
  54103. void 0 === a &&
  54104. (console.warn(
  54105. "THREE.BufferAttribute.copyVector2sArray(): vector is undefined",
  54106. r
  54107. ),
  54108. (a = new n.Vector2())),
  54109. (t[i++] = a.x),
  54110. (t[i++] = a.y);
  54111. }
  54112. return this;
  54113. },
  54114. copyVector3sArray: function (e) {
  54115. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  54116. var a = e[r];
  54117. void 0 === a &&
  54118. (console.warn(
  54119. "THREE.BufferAttribute.copyVector3sArray(): vector is undefined",
  54120. r
  54121. ),
  54122. (a = new n.Vector3())),
  54123. (t[i++] = a.x),
  54124. (t[i++] = a.y),
  54125. (t[i++] = a.z);
  54126. }
  54127. return this;
  54128. },
  54129. copyVector4sArray: function (e) {
  54130. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  54131. var a = e[r];
  54132. void 0 === a &&
  54133. (console.warn(
  54134. "THREE.BufferAttribute.copyVector4sArray(): vector is undefined",
  54135. r
  54136. ),
  54137. (a = new n.Vector4())),
  54138. (t[i++] = a.x),
  54139. (t[i++] = a.y),
  54140. (t[i++] = a.z),
  54141. (t[i++] = a.w);
  54142. }
  54143. return this;
  54144. },
  54145. set: function (e, t) {
  54146. return void 0 === t && (t = 0), this.array.set(e, t), this;
  54147. },
  54148. getX: function (e) {
  54149. return this.array[e * this.itemSize];
  54150. },
  54151. setX: function (e, t) {
  54152. return (this.array[e * this.itemSize] = t), this;
  54153. },
  54154. getY: function (e) {
  54155. return this.array[e * this.itemSize + 1];
  54156. },
  54157. setY: function (e, t) {
  54158. return (this.array[e * this.itemSize + 1] = t), this;
  54159. },
  54160. getZ: function (e) {
  54161. return this.array[e * this.itemSize + 2];
  54162. },
  54163. setZ: function (e, t) {
  54164. return (this.array[e * this.itemSize + 2] = t), this;
  54165. },
  54166. getW: function (e) {
  54167. return this.array[e * this.itemSize + 3];
  54168. },
  54169. setW: function (e, t) {
  54170. return (this.array[e * this.itemSize + 3] = t), this;
  54171. },
  54172. setXY: function (e, t, i) {
  54173. return (
  54174. (e *= this.itemSize),
  54175. (this.array[e + 0] = t),
  54176. (this.array[e + 1] = i),
  54177. this
  54178. );
  54179. },
  54180. setXYZ: function (e, t, i, n) {
  54181. return (
  54182. (e *= this.itemSize),
  54183. (this.array[e + 0] = t),
  54184. (this.array[e + 1] = i),
  54185. (this.array[e + 2] = n),
  54186. this
  54187. );
  54188. },
  54189. setXYZW: function (e, t, i, n, r) {
  54190. return (
  54191. (e *= this.itemSize),
  54192. (this.array[e + 0] = t),
  54193. (this.array[e + 1] = i),
  54194. (this.array[e + 2] = n),
  54195. (this.array[e + 3] = r),
  54196. this
  54197. );
  54198. },
  54199. clone: function () {
  54200. return new this.constructor().copy(this);
  54201. },
  54202. }),
  54203. (n.Int8Attribute = function (e, t) {
  54204. return new n.BufferAttribute(new Int8Array(e), t);
  54205. }),
  54206. (n.Uint8Attribute = function (e, t) {
  54207. return new n.BufferAttribute(new Uint8Array(e), t);
  54208. }),
  54209. (n.Uint8ClampedAttribute = function (e, t) {
  54210. return new n.BufferAttribute(new Uint8ClampedArray(e), t);
  54211. }),
  54212. (n.Int16Attribute = function (e, t) {
  54213. return new n.BufferAttribute(new Int16Array(e), t);
  54214. }),
  54215. (n.Uint16Attribute = function (e, t) {
  54216. return new n.BufferAttribute(new Uint16Array(e), t);
  54217. });
  54218. n.Int32Attribute = function (e, t) {
  54219. return new n.BufferAttribute(new Int32Array(e), t);
  54220. };
  54221. (n.Uint32Attribute = function (e, t) {
  54222. return new n.BufferAttribute(new Uint32Array(e), t);
  54223. }),
  54224. (n.Float32Attribute = function (e, t) {
  54225. return new n.BufferAttribute(new Float32Array(e), t);
  54226. }),
  54227. (n.Float64Attribute = function (e, t) {
  54228. return new n.BufferAttribute(new Float64Array(e), t);
  54229. }),
  54230. (n.DynamicBufferAttribute = function (e, t) {
  54231. return (
  54232. console.warn(
  54233. "THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."
  54234. ),
  54235. new n.BufferAttribute(e, t).setDynamic(!0)
  54236. );
  54237. }),
  54238. (n.InstancedBufferAttribute = function (e, t, i) {
  54239. n.BufferAttribute.call(this, e, t),
  54240. (this.meshPerAttribute = i || 1);
  54241. }),
  54242. (n.InstancedBufferAttribute.prototype = Object.create(
  54243. n.BufferAttribute.prototype
  54244. )),
  54245. (n.InstancedBufferAttribute.prototype.constructor =
  54246. n.InstancedBufferAttribute),
  54247. (n.InstancedBufferAttribute.prototype.copy = function (e) {
  54248. return (
  54249. n.BufferAttribute.prototype.copy.call(this, e),
  54250. (this.meshPerAttribute = e.meshPerAttribute),
  54251. this
  54252. );
  54253. }),
  54254. (n.InterleavedBuffer = function (e, t) {
  54255. (this.uuid = n.Math.generateUUID()),
  54256. (this.array = e),
  54257. (this.stride = t),
  54258. (this.dynamic = !1),
  54259. (this.updateRange = {
  54260. offset: 0,
  54261. count: -1,
  54262. }),
  54263. (this.version = 0);
  54264. }),
  54265. (n.InterleavedBuffer.prototype = {
  54266. constructor: n.InterleavedBuffer,
  54267. get length() {
  54268. return this.array.length;
  54269. },
  54270. get count() {
  54271. return this.array.length / this.stride;
  54272. },
  54273. set needsUpdate(e) {
  54274. e === !0 && this.version++;
  54275. },
  54276. setDynamic: function (e) {
  54277. return (this.dynamic = e), this;
  54278. },
  54279. copy: function (e) {
  54280. return (
  54281. (this.array = new e.array.constructor(e.array)),
  54282. (this.stride = e.stride),
  54283. (this.dynamic = e.dynamic),
  54284. this
  54285. );
  54286. },
  54287. copyAt: function (e, t, i) {
  54288. (e *= this.stride), (i *= t.stride);
  54289. for (var n = 0, r = this.stride; n < r; n++)
  54290. this.array[e + n] = t.array[i + n];
  54291. return this;
  54292. },
  54293. set: function (e, t) {
  54294. return void 0 === t && (t = 0), this.array.set(e, t), this;
  54295. },
  54296. clone: function () {
  54297. return new this.constructor().copy(this);
  54298. },
  54299. }),
  54300. (n.InstancedInterleavedBuffer = function (e, t, i) {
  54301. n.InterleavedBuffer.call(this, e, t),
  54302. (this.meshPerAttribute = i || 1);
  54303. }),
  54304. (n.InstancedInterleavedBuffer.prototype = Object.create(
  54305. n.InterleavedBuffer.prototype
  54306. )),
  54307. (n.InstancedInterleavedBuffer.prototype.constructor =
  54308. n.InstancedInterleavedBuffer),
  54309. (n.InstancedInterleavedBuffer.prototype.copy = function (e) {
  54310. return (
  54311. n.InterleavedBuffer.prototype.copy.call(this, e),
  54312. (this.meshPerAttribute = e.meshPerAttribute),
  54313. this
  54314. );
  54315. }),
  54316. (n.InterleavedBufferAttribute = function (e, t, i) {
  54317. (this.uuid = n.Math.generateUUID()),
  54318. (this.data = e),
  54319. (this.itemSize = t),
  54320. (this.offset = i);
  54321. }),
  54322. (n.InterleavedBufferAttribute.prototype = {
  54323. constructor: n.InterleavedBufferAttribute,
  54324. get length() {
  54325. return (
  54326. console.warn(
  54327. "THREE.BufferAttribute: .length has been deprecated. Please use .count."
  54328. ),
  54329. this.array.length
  54330. );
  54331. },
  54332. get count() {
  54333. return this.data.count;
  54334. },
  54335. setX: function (e, t) {
  54336. return (
  54337. (this.data.array[e * this.data.stride + this.offset] = t), this
  54338. );
  54339. },
  54340. setY: function (e, t) {
  54341. return (
  54342. (this.data.array[e * this.data.stride + this.offset + 1] = t),
  54343. this
  54344. );
  54345. },
  54346. setZ: function (e, t) {
  54347. return (
  54348. (this.data.array[e * this.data.stride + this.offset + 2] = t),
  54349. this
  54350. );
  54351. },
  54352. setW: function (e, t) {
  54353. return (
  54354. (this.data.array[e * this.data.stride + this.offset + 3] = t),
  54355. this
  54356. );
  54357. },
  54358. getX: function (e) {
  54359. return this.data.array[e * this.data.stride + this.offset];
  54360. },
  54361. getY: function (e) {
  54362. return this.data.array[e * this.data.stride + this.offset + 1];
  54363. },
  54364. getZ: function (e) {
  54365. return this.data.array[e * this.data.stride + this.offset + 2];
  54366. },
  54367. getW: function (e) {
  54368. return this.data.array[e * this.data.stride + this.offset + 3];
  54369. },
  54370. setXY: function (e, t, i) {
  54371. return (
  54372. (e = e * this.data.stride + this.offset),
  54373. (this.data.array[e + 0] = t),
  54374. (this.data.array[e + 1] = i),
  54375. this
  54376. );
  54377. },
  54378. setXYZ: function (e, t, i, n) {
  54379. return (
  54380. (e = e * this.data.stride + this.offset),
  54381. (this.data.array[e + 0] = t),
  54382. (this.data.array[e + 1] = i),
  54383. (this.data.array[e + 2] = n),
  54384. this
  54385. );
  54386. },
  54387. setXYZW: function (e, t, i, n, r) {
  54388. return (
  54389. (e = e * this.data.stride + this.offset),
  54390. (this.data.array[e + 0] = t),
  54391. (this.data.array[e + 1] = i),
  54392. (this.data.array[e + 2] = n),
  54393. (this.data.array[e + 3] = r),
  54394. this
  54395. );
  54396. },
  54397. }),
  54398. (n.Geometry = function () {
  54399. Object.defineProperty(this, "id", {
  54400. value: n.GeometryIdCount++,
  54401. }),
  54402. (this.uuid = n.Math.generateUUID()),
  54403. (this.name = ""),
  54404. (this.type = "Geometry"),
  54405. (this.vertices = []),
  54406. (this.colors = []),
  54407. (this.faces = []),
  54408. (this.faceVertexUvs = [[]]),
  54409. (this.morphTargets = []),
  54410. (this.morphNormals = []),
  54411. (this.skinWeights = []),
  54412. (this.skinIndices = []),
  54413. (this.lineDistances = []),
  54414. (this.boundingBox = null),
  54415. (this.boundingSphere = null),
  54416. (this.verticesNeedUpdate = !1),
  54417. (this.elementsNeedUpdate = !1),
  54418. (this.uvsNeedUpdate = !1),
  54419. (this.normalsNeedUpdate = !1),
  54420. (this.colorsNeedUpdate = !1),
  54421. (this.lineDistancesNeedUpdate = !1),
  54422. (this.groupsNeedUpdate = !1);
  54423. }),
  54424. (n.Geometry.prototype = {
  54425. constructor: n.Geometry,
  54426. applyMatrix: function (e) {
  54427. for (
  54428. var t = new n.Matrix3().getNormalMatrix(e),
  54429. i = 0,
  54430. r = this.vertices.length;
  54431. i < r;
  54432. i++
  54433. ) {
  54434. var o = this.vertices[i];
  54435. o.applyMatrix4(e);
  54436. }
  54437. for (var i = 0, r = this.faces.length; i < r; i++) {
  54438. var a = this.faces[i];
  54439. a.normal.applyMatrix3(t).normalize();
  54440. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  54441. a.vertexNormals[s].applyMatrix3(t).normalize();
  54442. }
  54443. return (
  54444. null !== this.boundingBox && this.computeBoundingBox(),
  54445. null !== this.boundingSphere && this.computeBoundingSphere(),
  54446. (this.verticesNeedUpdate = !0),
  54447. (this.normalsNeedUpdate = !0),
  54448. this
  54449. );
  54450. },
  54451. rotateX: (function () {
  54452. var e;
  54453. return function (t) {
  54454. return (
  54455. void 0 === e && (e = new n.Matrix4()),
  54456. e.makeRotationX(t),
  54457. this.applyMatrix(e),
  54458. this
  54459. );
  54460. };
  54461. })(),
  54462. rotateY: (function () {
  54463. var e;
  54464. return function (t) {
  54465. return (
  54466. void 0 === e && (e = new n.Matrix4()),
  54467. e.makeRotationY(t),
  54468. this.applyMatrix(e),
  54469. this
  54470. );
  54471. };
  54472. })(),
  54473. rotateZ: (function () {
  54474. var e;
  54475. return function (t) {
  54476. return (
  54477. void 0 === e && (e = new n.Matrix4()),
  54478. e.makeRotationZ(t),
  54479. this.applyMatrix(e),
  54480. this
  54481. );
  54482. };
  54483. })(),
  54484. translate: (function () {
  54485. var e;
  54486. return function (t, i, r) {
  54487. return (
  54488. void 0 === e && (e = new n.Matrix4()),
  54489. e.makeTranslation(t, i, r),
  54490. this.applyMatrix(e),
  54491. this
  54492. );
  54493. };
  54494. })(),
  54495. scale: (function () {
  54496. var e;
  54497. return function (t, i, r) {
  54498. return (
  54499. void 0 === e && (e = new n.Matrix4()),
  54500. e.makeScale(t, i, r),
  54501. this.applyMatrix(e),
  54502. this
  54503. );
  54504. };
  54505. })(),
  54506. lookAt: (function () {
  54507. var e;
  54508. return function (t) {
  54509. void 0 === e && (e = new n.Object3D()),
  54510. e.lookAt(t),
  54511. e.updateMatrix(),
  54512. this.applyMatrix(e.matrix);
  54513. };
  54514. })(),
  54515. fromBufferGeometry: function (e) {
  54516. function t(e, t, r, o) {
  54517. var a =
  54518. void 0 !== s
  54519. ? [u[e].clone(), u[t].clone(), u[r].clone()]
  54520. : [],
  54521. f =
  54522. void 0 !== l
  54523. ? [
  54524. i.colors[e].clone(),
  54525. i.colors[t].clone(),
  54526. i.colors[r].clone(),
  54527. ]
  54528. : [],
  54529. g = new n.Face3(e, t, r, a, f, o);
  54530. i.faces.push(g),
  54531. void 0 !== c &&
  54532. i.faceVertexUvs[0].push([
  54533. d[e].clone(),
  54534. d[t].clone(),
  54535. d[r].clone(),
  54536. ]),
  54537. void 0 !== h &&
  54538. i.faceVertexUvs[1].push([
  54539. p[e].clone(),
  54540. p[t].clone(),
  54541. p[r].clone(),
  54542. ]);
  54543. }
  54544. var i = this,
  54545. r = null !== e.index ? e.index.array : void 0,
  54546. o = e.attributes,
  54547. a = o.position.array,
  54548. s = void 0 !== o.normal ? o.normal.array : void 0,
  54549. l = void 0 !== o.color ? o.color.array : void 0,
  54550. c = void 0 !== o.uv ? o.uv.array : void 0,
  54551. h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  54552. void 0 !== h && (this.faceVertexUvs[1] = []);
  54553. for (
  54554. var u = [], d = [], p = [], f = 0, g = 0;
  54555. f < a.length;
  54556. f += 3, g += 2
  54557. )
  54558. i.vertices.push(new n.Vector3(a[f], a[f + 1], a[f + 2])),
  54559. void 0 !== s &&
  54560. u.push(new n.Vector3(s[f], s[f + 1], s[f + 2])),
  54561. void 0 !== l &&
  54562. i.colors.push(new n.Color(l[f], l[f + 1], l[f + 2])),
  54563. void 0 !== c && d.push(new n.Vector2(c[g], c[g + 1])),
  54564. void 0 !== h && p.push(new n.Vector2(h[g], h[g + 1]));
  54565. if (void 0 !== r) {
  54566. var m = e.groups;
  54567. if (m.length > 0)
  54568. for (var f = 0; f < m.length; f++)
  54569. for (
  54570. var v = m[f], A = v.start, y = v.count, g = A, C = A + y;
  54571. g < C;
  54572. g += 3
  54573. )
  54574. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  54575. else
  54576. for (var f = 0; f < r.length; f += 3)
  54577. t(r[f], r[f + 1], r[f + 2]);
  54578. } else
  54579. for (var f = 0; f < a.length / 3; f += 3) t(f, f + 1, f + 2);
  54580. return (
  54581. this.computeFaceNormals(),
  54582. null !== e.boundingBox &&
  54583. (this.boundingBox = e.boundingBox.clone()),
  54584. null !== e.boundingSphere &&
  54585. (this.boundingSphere = e.boundingSphere.clone()),
  54586. this
  54587. );
  54588. },
  54589. center: function () {
  54590. this.computeBoundingBox();
  54591. var e = this.boundingBox.center().negate();
  54592. return this.translate(e.x, e.y, e.z), e;
  54593. },
  54594. normalize: function () {
  54595. this.computeBoundingSphere();
  54596. var e = this.boundingSphere.center,
  54597. t = this.boundingSphere.radius,
  54598. i = 0 === t ? 1 : 1 / t,
  54599. r = new n.Matrix4();
  54600. return (
  54601. r.set(
  54602. i,
  54603. 0,
  54604. 0,
  54605. -i * e.x,
  54606. 0,
  54607. i,
  54608. 0,
  54609. -i * e.y,
  54610. 0,
  54611. 0,
  54612. i,
  54613. -i * e.z,
  54614. 0,
  54615. 0,
  54616. 0,
  54617. 1
  54618. ),
  54619. this.applyMatrix(r),
  54620. this
  54621. );
  54622. },
  54623. computeFaceNormals: function () {
  54624. for (
  54625. var e = new n.Vector3(),
  54626. t = new n.Vector3(),
  54627. i = 0,
  54628. r = this.faces.length;
  54629. i < r;
  54630. i++
  54631. ) {
  54632. var o = this.faces[i],
  54633. a = this.vertices[o.a],
  54634. s = this.vertices[o.b],
  54635. l = this.vertices[o.c];
  54636. e.subVectors(l, s),
  54637. t.subVectors(a, s),
  54638. e.cross(t),
  54639. e.normalize(),
  54640. o.normal.copy(e);
  54641. }
  54642. },
  54643. computeVertexNormals: function (e) {
  54644. void 0 === e && (e = !0);
  54645. var t, i, r, o, a, s;
  54646. for (
  54647. s = new Array(this.vertices.length),
  54648. t = 0,
  54649. i = this.vertices.length;
  54650. t < i;
  54651. t++
  54652. )
  54653. s[t] = new n.Vector3();
  54654. if (e) {
  54655. var l,
  54656. c,
  54657. h,
  54658. u = new n.Vector3(),
  54659. d = new n.Vector3();
  54660. for (r = 0, o = this.faces.length; r < o; r++)
  54661. (a = this.faces[r]),
  54662. (l = this.vertices[a.a]),
  54663. (c = this.vertices[a.b]),
  54664. (h = this.vertices[a.c]),
  54665. u.subVectors(h, c),
  54666. d.subVectors(l, c),
  54667. u.cross(d),
  54668. s[a.a].add(u),
  54669. s[a.b].add(u),
  54670. s[a.c].add(u);
  54671. } else
  54672. for (r = 0, o = this.faces.length; r < o; r++)
  54673. (a = this.faces[r]),
  54674. s[a.a].add(a.normal),
  54675. s[a.b].add(a.normal),
  54676. s[a.c].add(a.normal);
  54677. for (t = 0, i = this.vertices.length; t < i; t++)
  54678. s[t].normalize();
  54679. for (r = 0, o = this.faces.length; r < o; r++) {
  54680. a = this.faces[r];
  54681. var p = a.vertexNormals;
  54682. 3 === p.length
  54683. ? (p[0].copy(s[a.a]), p[1].copy(s[a.b]), p[2].copy(s[a.c]))
  54684. : ((p[0] = s[a.a].clone()),
  54685. (p[1] = s[a.b].clone()),
  54686. (p[2] = s[a.c].clone()));
  54687. }
  54688. this.faces.length > 0 && (this.normalsNeedUpdate = !0);
  54689. },
  54690. computeMorphNormals: function () {
  54691. var e, t, i, r, o;
  54692. for (i = 0, r = this.faces.length; i < r; i++)
  54693. for (
  54694. o = this.faces[i],
  54695. o.__originalFaceNormal
  54696. ? o.__originalFaceNormal.copy(o.normal)
  54697. : (o.__originalFaceNormal = o.normal.clone()),
  54698. o.__originalVertexNormals ||
  54699. (o.__originalVertexNormals = []),
  54700. e = 0,
  54701. t = o.vertexNormals.length;
  54702. e < t;
  54703. e++
  54704. )
  54705. o.__originalVertexNormals[e]
  54706. ? o.__originalVertexNormals[e].copy(o.vertexNormals[e])
  54707. : (o.__originalVertexNormals[e] =
  54708. o.vertexNormals[e].clone());
  54709. var a = new n.Geometry();
  54710. for (
  54711. a.faces = this.faces, e = 0, t = this.morphTargets.length;
  54712. e < t;
  54713. e++
  54714. ) {
  54715. if (!this.morphNormals[e]) {
  54716. (this.morphNormals[e] = {}),
  54717. (this.morphNormals[e].faceNormals = []),
  54718. (this.morphNormals[e].vertexNormals = []);
  54719. var s,
  54720. l,
  54721. c = this.morphNormals[e].faceNormals,
  54722. h = this.morphNormals[e].vertexNormals;
  54723. for (i = 0, r = this.faces.length; i < r; i++)
  54724. (s = new n.Vector3()),
  54725. (l = {
  54726. a: new n.Vector3(),
  54727. b: new n.Vector3(),
  54728. c: new n.Vector3(),
  54729. }),
  54730. c.push(s),
  54731. h.push(l);
  54732. }
  54733. var u = this.morphNormals[e];
  54734. (a.vertices = this.morphTargets[e].vertices),
  54735. a.computeFaceNormals(),
  54736. a.computeVertexNormals();
  54737. var s, l;
  54738. for (i = 0, r = this.faces.length; i < r; i++)
  54739. (o = this.faces[i]),
  54740. (s = u.faceNormals[i]),
  54741. (l = u.vertexNormals[i]),
  54742. s.copy(o.normal),
  54743. l.a.copy(o.vertexNormals[0]),
  54744. l.b.copy(o.vertexNormals[1]),
  54745. l.c.copy(o.vertexNormals[2]);
  54746. }
  54747. for (i = 0, r = this.faces.length; i < r; i++)
  54748. (o = this.faces[i]),
  54749. (o.normal = o.__originalFaceNormal),
  54750. (o.vertexNormals = o.__originalVertexNormals);
  54751. },
  54752. computeTangents: function () {
  54753. console.warn(
  54754. "THREE.Geometry: .computeTangents() has been removed."
  54755. );
  54756. },
  54757. computeLineDistances: function () {
  54758. for (
  54759. var e = 0, t = this.vertices, i = 0, n = t.length;
  54760. i < n;
  54761. i++
  54762. )
  54763. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  54764. (this.lineDistances[i] = e);
  54765. },
  54766. computeBoundingBox: function () {
  54767. null === this.boundingBox && (this.boundingBox = new n.Box3()),
  54768. this.boundingBox.setFromPoints(this.vertices);
  54769. },
  54770. computeBoundingSphere: function () {
  54771. null === this.boundingSphere &&
  54772. (this.boundingSphere = new n.Sphere()),
  54773. this.boundingSphere.setFromPoints(this.vertices);
  54774. },
  54775. merge: function (e, t, i) {
  54776. if (e instanceof n.Geometry == !1)
  54777. return void console.error(
  54778. "THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",
  54779. e
  54780. );
  54781. var r,
  54782. o = this.vertices.length,
  54783. a = this.vertices,
  54784. s = e.vertices,
  54785. l = this.faces,
  54786. c = e.faces,
  54787. h = this.faceVertexUvs[0],
  54788. u = e.faceVertexUvs[0];
  54789. void 0 === i && (i = 0),
  54790. void 0 !== t && (r = new n.Matrix3().getNormalMatrix(t));
  54791. for (var d = 0, p = s.length; d < p; d++) {
  54792. var f = s[d],
  54793. g = f.clone();
  54794. void 0 !== t && g.applyMatrix4(t), a.push(g);
  54795. }
  54796. for (d = 0, p = c.length; d < p; d++) {
  54797. var m,
  54798. v,
  54799. A,
  54800. y = c[d],
  54801. C = y.vertexNormals,
  54802. I = y.vertexColors;
  54803. (m = new n.Face3(y.a + o, y.b + o, y.c + o)),
  54804. m.normal.copy(y.normal),
  54805. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  54806. for (var E = 0, b = C.length; E < b; E++)
  54807. (v = C[E].clone()),
  54808. void 0 !== r && v.applyMatrix3(r).normalize(),
  54809. m.vertexNormals.push(v);
  54810. m.color.copy(y.color);
  54811. for (var E = 0, b = I.length; E < b; E++)
  54812. (A = I[E]), m.vertexColors.push(A.clone());
  54813. (m.materialIndex = y.materialIndex + i), l.push(m);
  54814. }
  54815. for (d = 0, p = u.length; d < p; d++) {
  54816. var w = u[d],
  54817. _ = [];
  54818. if (void 0 !== w) {
  54819. for (var E = 0, b = w.length; E < b; E++)
  54820. _.push(w[E].clone());
  54821. h.push(_);
  54822. }
  54823. }
  54824. },
  54825. mergeMesh: function (e) {
  54826. return e instanceof n.Mesh == !1
  54827. ? void console.error(
  54828. "THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",
  54829. e
  54830. )
  54831. : (e.matrixAutoUpdate && e.updateMatrix(),
  54832. void this.merge(e.geometry, e.matrix));
  54833. },
  54834. mergeVertices: function () {
  54835. var e,
  54836. t,
  54837. i,
  54838. n,
  54839. r,
  54840. o,
  54841. a,
  54842. s,
  54843. l = {},
  54844. c = [],
  54845. h = [],
  54846. u = 4,
  54847. d = Math.pow(10, u);
  54848. for (i = 0, n = this.vertices.length; i < n; i++)
  54849. (e = this.vertices[i]),
  54850. (t =
  54851. Math.round(e.x * d) +
  54852. "_" +
  54853. Math.round(e.y * d) +
  54854. "_" +
  54855. Math.round(e.z * d)),
  54856. void 0 === l[t]
  54857. ? ((l[t] = i),
  54858. c.push(this.vertices[i]),
  54859. (h[i] = c.length - 1))
  54860. : (h[i] = h[l[t]]);
  54861. var p = [];
  54862. for (i = 0, n = this.faces.length; i < n; i++) {
  54863. (r = this.faces[i]),
  54864. (r.a = h[r.a]),
  54865. (r.b = h[r.b]),
  54866. (r.c = h[r.c]),
  54867. (o = [r.a, r.b, r.c]);
  54868. for (var f = -1, g = 0; g < 3; g++)
  54869. if (o[g] === o[(g + 1) % 3]) {
  54870. (f = g), p.push(i);
  54871. break;
  54872. }
  54873. }
  54874. for (i = p.length - 1; i >= 0; i--) {
  54875. var m = p[i];
  54876. for (
  54877. this.faces.splice(m, 1), a = 0, s = this.faceVertexUvs.length;
  54878. a < s;
  54879. a++
  54880. )
  54881. this.faceVertexUvs[a].splice(m, 1);
  54882. }
  54883. var v = this.vertices.length - c.length;
  54884. return (this.vertices = c), v;
  54885. },
  54886. sortFacesByMaterialIndex: function () {
  54887. function e(e, t) {
  54888. return e.materialIndex - t.materialIndex;
  54889. }
  54890. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  54891. t[n]._id = n;
  54892. t.sort(e);
  54893. var r,
  54894. o,
  54895. a = this.faceVertexUvs[0],
  54896. s = this.faceVertexUvs[1];
  54897. a && a.length === i && (r = []), s && s.length === i && (o = []);
  54898. for (var n = 0; n < i; n++) {
  54899. var l = t[n]._id;
  54900. r && r.push(a[l]), o && o.push(s[l]);
  54901. }
  54902. r && (this.faceVertexUvs[0] = r),
  54903. o && (this.faceVertexUvs[1] = o);
  54904. },
  54905. toJSON: function () {
  54906. function e(e, t, i) {
  54907. return i ? e | (1 << t) : e & ~(1 << t);
  54908. }
  54909. function t(e) {
  54910. var t = e.x.toString() + e.y.toString() + e.z.toString();
  54911. return void 0 !== d[t]
  54912. ? d[t]
  54913. : ((d[t] = u.length / 3), u.push(e.x, e.y, e.z), d[t]);
  54914. }
  54915. function i(e) {
  54916. var t = e.r.toString() + e.g.toString() + e.b.toString();
  54917. return void 0 !== f[t]
  54918. ? f[t]
  54919. : ((f[t] = p.length), p.push(e.getHex()), f[t]);
  54920. }
  54921. function n(e) {
  54922. var t = e.x.toString() + e.y.toString();
  54923. return void 0 !== m[t]
  54924. ? m[t]
  54925. : ((m[t] = g.length / 2), g.push(e.x, e.y), m[t]);
  54926. }
  54927. var r = {
  54928. metadata: {
  54929. version: 4.4,
  54930. type: "Geometry",
  54931. generator: "Geometry.toJSON",
  54932. },
  54933. };
  54934. if (
  54935. ((r.uuid = this.uuid),
  54936. (r.type = this.type),
  54937. "" !== this.name && (r.name = this.name),
  54938. void 0 !== this.parameters)
  54939. ) {
  54940. var o = this.parameters;
  54941. for (var a in o) void 0 !== o[a] && (r[a] = o[a]);
  54942. return r;
  54943. }
  54944. for (var s = [], l = 0; l < this.vertices.length; l++) {
  54945. var c = this.vertices[l];
  54946. s.push(c.x, c.y, c.z);
  54947. }
  54948. for (
  54949. var h = [],
  54950. u = [],
  54951. d = {},
  54952. p = [],
  54953. f = {},
  54954. g = [],
  54955. m = {},
  54956. l = 0;
  54957. l < this.faces.length;
  54958. l++
  54959. ) {
  54960. var v = this.faces[l],
  54961. A = !0,
  54962. y = !1,
  54963. C = void 0 !== this.faceVertexUvs[0][l],
  54964. I = v.normal.length() > 0,
  54965. E = v.vertexNormals.length > 0,
  54966. b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b,
  54967. w = v.vertexColors.length > 0,
  54968. _ = 0;
  54969. if (
  54970. ((_ = e(_, 0, 0)),
  54971. (_ = e(_, 1, A)),
  54972. (_ = e(_, 2, y)),
  54973. (_ = e(_, 3, C)),
  54974. (_ = e(_, 4, I)),
  54975. (_ = e(_, 5, E)),
  54976. (_ = e(_, 6, b)),
  54977. (_ = e(_, 7, w)),
  54978. h.push(_),
  54979. h.push(v.a, v.b, v.c),
  54980. h.push(v.materialIndex),
  54981. C)
  54982. ) {
  54983. var T = this.faceVertexUvs[0][l];
  54984. h.push(n(T[0]), n(T[1]), n(T[2]));
  54985. }
  54986. if ((I && h.push(t(v.normal)), E)) {
  54987. var x = v.vertexNormals;
  54988. h.push(t(x[0]), t(x[1]), t(x[2]));
  54989. }
  54990. if ((b && h.push(i(v.color)), w)) {
  54991. var S = v.vertexColors;
  54992. h.push(i(S[0]), i(S[1]), i(S[2]));
  54993. }
  54994. }
  54995. return (
  54996. (r.data = {}),
  54997. (r.data.vertices = s),
  54998. (r.data.normals = u),
  54999. p.length > 0 && (r.data.colors = p),
  55000. g.length > 0 && (r.data.uvs = [g]),
  55001. (r.data.faces = h),
  55002. r
  55003. );
  55004. },
  55005. clone: function () {
  55006. return new n.Geometry().copy(this);
  55007. },
  55008. copy: function (e) {
  55009. (this.vertices = []),
  55010. (this.faces = []),
  55011. (this.faceVertexUvs = [[]]);
  55012. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  55013. this.vertices.push(t[i].clone());
  55014. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  55015. this.faces.push(r[i].clone());
  55016. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  55017. var o = e.faceVertexUvs[i];
  55018. void 0 === this.faceVertexUvs[i] &&
  55019. (this.faceVertexUvs[i] = []);
  55020. for (var a = 0, s = o.length; a < s; a++) {
  55021. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  55022. var d = l[h];
  55023. c.push(d.clone());
  55024. }
  55025. this.faceVertexUvs[i].push(c);
  55026. }
  55027. }
  55028. return this;
  55029. },
  55030. dispose: function () {
  55031. this.dispatchEvent({
  55032. type: "dispose",
  55033. });
  55034. },
  55035. }),
  55036. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  55037. (n.GeometryIdCount = 0),
  55038. (n.DirectGeometry = function () {
  55039. Object.defineProperty(this, "id", {
  55040. value: n.GeometryIdCount++,
  55041. }),
  55042. (this.uuid = n.Math.generateUUID()),
  55043. (this.name = ""),
  55044. (this.type = "DirectGeometry"),
  55045. (this.indices = []),
  55046. (this.vertices = []),
  55047. (this.normals = []),
  55048. (this.colors = []),
  55049. (this.uvs = []),
  55050. (this.uvs2 = []),
  55051. (this.groups = []),
  55052. (this.morphTargets = {}),
  55053. (this.skinWeights = []),
  55054. (this.skinIndices = []),
  55055. (this.boundingBox = null),
  55056. (this.boundingSphere = null),
  55057. (this.verticesNeedUpdate = !1),
  55058. (this.normalsNeedUpdate = !1),
  55059. (this.colorsNeedUpdate = !1),
  55060. (this.uvsNeedUpdate = !1),
  55061. (this.groupsNeedUpdate = !1);
  55062. }),
  55063. (n.DirectGeometry.prototype = {
  55064. constructor: n.DirectGeometry,
  55065. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  55066. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  55067. computeFaceNormals: function () {
  55068. console.warn(
  55069. "THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry."
  55070. );
  55071. },
  55072. computeVertexNormals: function () {
  55073. console.warn(
  55074. "THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry."
  55075. );
  55076. },
  55077. computeGroups: function (e) {
  55078. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  55079. var a = r[o];
  55080. a.materialIndex !== i &&
  55081. ((i = a.materialIndex),
  55082. void 0 !== t && ((t.count = 3 * o - t.start), n.push(t)),
  55083. (t = {
  55084. start: 3 * o,
  55085. materialIndex: i,
  55086. }));
  55087. }
  55088. void 0 !== t && ((t.count = 3 * o - t.start), n.push(t)),
  55089. (this.groups = n);
  55090. },
  55091. fromGeometry: function (e) {
  55092. var t,
  55093. i = e.faces,
  55094. r = e.vertices,
  55095. o = e.faceVertexUvs,
  55096. a = o[0] && o[0].length > 0,
  55097. s = o[1] && o[1].length > 0,
  55098. l = e.morphTargets,
  55099. c = l.length;
  55100. if (c > 0) {
  55101. t = [];
  55102. for (var h = 0; h < c; h++) t[h] = [];
  55103. this.morphTargets.position = t;
  55104. }
  55105. var u,
  55106. d = e.morphNormals,
  55107. p = d.length;
  55108. if (p > 0) {
  55109. u = [];
  55110. for (var h = 0; h < p; h++) u[h] = [];
  55111. this.morphTargets.normal = u;
  55112. }
  55113. for (
  55114. var f = e.skinIndices,
  55115. g = e.skinWeights,
  55116. m = f.length === r.length,
  55117. v = g.length === r.length,
  55118. h = 0;
  55119. h < i.length;
  55120. h++
  55121. ) {
  55122. var A = i[h];
  55123. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  55124. var y = A.vertexNormals;
  55125. if (3 === y.length) this.normals.push(y[0], y[1], y[2]);
  55126. else {
  55127. var C = A.normal;
  55128. this.normals.push(C, C, C);
  55129. }
  55130. var I = A.vertexColors;
  55131. if (3 === I.length) this.colors.push(I[0], I[1], I[2]);
  55132. else {
  55133. var E = A.color;
  55134. this.colors.push(E, E, E);
  55135. }
  55136. if (a === !0) {
  55137. var b = o[0][h];
  55138. void 0 !== b
  55139. ? this.uvs.push(b[0], b[1], b[2])
  55140. : (console.warn(
  55141. "THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",
  55142. h
  55143. ),
  55144. this.uvs.push(
  55145. new n.Vector2(),
  55146. new n.Vector2(),
  55147. new n.Vector2()
  55148. ));
  55149. }
  55150. if (s === !0) {
  55151. var b = o[1][h];
  55152. void 0 !== b
  55153. ? this.uvs2.push(b[0], b[1], b[2])
  55154. : (console.warn(
  55155. "THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",
  55156. h
  55157. ),
  55158. this.uvs2.push(
  55159. new n.Vector2(),
  55160. new n.Vector2(),
  55161. new n.Vector2()
  55162. ));
  55163. }
  55164. for (var w = 0; w < c; w++) {
  55165. var _ = l[w].vertices;
  55166. t[w].push(_[A.a], _[A.b], _[A.c]);
  55167. }
  55168. for (var w = 0; w < p; w++) {
  55169. var T = d[w].vertexNormals[h];
  55170. u[w].push(T.a, T.b, T.c);
  55171. }
  55172. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  55173. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c]);
  55174. }
  55175. return (
  55176. this.computeGroups(e),
  55177. (this.verticesNeedUpdate = e.verticesNeedUpdate),
  55178. (this.normalsNeedUpdate = e.normalsNeedUpdate),
  55179. (this.colorsNeedUpdate = e.colorsNeedUpdate),
  55180. (this.uvsNeedUpdate = e.uvsNeedUpdate),
  55181. (this.groupsNeedUpdate = e.groupsNeedUpdate),
  55182. this
  55183. );
  55184. },
  55185. dispose: function () {
  55186. this.dispatchEvent({
  55187. type: "dispose",
  55188. });
  55189. },
  55190. }),
  55191. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  55192. (n.BufferGeometry = function () {
  55193. Object.defineProperty(this, "id", {
  55194. value: n.GeometryIdCount++,
  55195. }),
  55196. (this.uuid = n.Math.generateUUID()),
  55197. (this.name = ""),
  55198. (this.type = "BufferGeometry"),
  55199. (this.index = null),
  55200. (this.attributes = {}),
  55201. (this.morphAttributes = {}),
  55202. (this.groups = []),
  55203. (this.boundingBox = null),
  55204. (this.boundingSphere = null),
  55205. (this.drawRange = {
  55206. start: 0,
  55207. count: 1 / 0,
  55208. });
  55209. }),
  55210. (n.BufferGeometry.prototype = {
  55211. constructor: n.BufferGeometry,
  55212. getIndex: function () {
  55213. return this.index;
  55214. },
  55215. setIndex: function (e) {
  55216. this.index = e;
  55217. },
  55218. addAttribute: function (e, t) {
  55219. return t instanceof n.BufferAttribute == !1 &&
  55220. t instanceof n.InterleavedBufferAttribute == !1
  55221. ? (console.warn(
  55222. "THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."
  55223. ),
  55224. void this.addAttribute(
  55225. e,
  55226. new n.BufferAttribute(arguments[1], arguments[2])
  55227. ))
  55228. : "index" === e
  55229. ? (console.warn(
  55230. "THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."
  55231. ),
  55232. void this.setIndex(t))
  55233. : ((this.attributes[e] = t), this);
  55234. },
  55235. getAttribute: function (e) {
  55236. return this.attributes[e];
  55237. },
  55238. removeAttribute: function (e) {
  55239. return delete this.attributes[e], this;
  55240. },
  55241. addGroup: function (e, t, i) {
  55242. this.groups.push({
  55243. start: e,
  55244. count: t,
  55245. materialIndex: void 0 !== i ? i : 0,
  55246. });
  55247. },
  55248. clearGroups: function () {
  55249. this.groups = [];
  55250. },
  55251. setDrawRange: function (e, t) {
  55252. (this.drawRange.start = e), (this.drawRange.count = t);
  55253. },
  55254. applyMatrix: function (e) {
  55255. var t = this.attributes.position;
  55256. void 0 !== t &&
  55257. (e.applyToVector3Array(t.array), (t.needsUpdate = !0));
  55258. var i = this.attributes.normal;
  55259. if (void 0 !== i) {
  55260. var r = new n.Matrix3().getNormalMatrix(e);
  55261. r.applyToVector3Array(i.array), (i.needsUpdate = !0);
  55262. }
  55263. return (
  55264. null !== this.boundingBox && this.computeBoundingBox(),
  55265. null !== this.boundingSphere && this.computeBoundingSphere(),
  55266. this
  55267. );
  55268. },
  55269. rotateX: (function () {
  55270. var e;
  55271. return function (t) {
  55272. return (
  55273. void 0 === e && (e = new n.Matrix4()),
  55274. e.makeRotationX(t),
  55275. this.applyMatrix(e),
  55276. this
  55277. );
  55278. };
  55279. })(),
  55280. rotateY: (function () {
  55281. var e;
  55282. return function (t) {
  55283. return (
  55284. void 0 === e && (e = new n.Matrix4()),
  55285. e.makeRotationY(t),
  55286. this.applyMatrix(e),
  55287. this
  55288. );
  55289. };
  55290. })(),
  55291. rotateZ: (function () {
  55292. var e;
  55293. return function (t) {
  55294. return (
  55295. void 0 === e && (e = new n.Matrix4()),
  55296. e.makeRotationZ(t),
  55297. this.applyMatrix(e),
  55298. this
  55299. );
  55300. };
  55301. })(),
  55302. translate: (function () {
  55303. var e;
  55304. return function (t, i, r) {
  55305. return (
  55306. void 0 === e && (e = new n.Matrix4()),
  55307. e.makeTranslation(t, i, r),
  55308. this.applyMatrix(e),
  55309. this
  55310. );
  55311. };
  55312. })(),
  55313. scale: (function () {
  55314. var e;
  55315. return function (t, i, r) {
  55316. return (
  55317. void 0 === e && (e = new n.Matrix4()),
  55318. e.makeScale(t, i, r),
  55319. this.applyMatrix(e),
  55320. this
  55321. );
  55322. };
  55323. })(),
  55324. lookAt: (function () {
  55325. var e;
  55326. return function (t) {
  55327. void 0 === e && (e = new n.Object3D()),
  55328. e.lookAt(t),
  55329. e.updateMatrix(),
  55330. this.applyMatrix(e.matrix);
  55331. };
  55332. })(),
  55333. center: function () {
  55334. this.computeBoundingBox();
  55335. var e = this.boundingBox.center().negate();
  55336. return this.translate(e.x, e.y, e.z), e;
  55337. },
  55338. setFromObject: function (e) {
  55339. var t = e.geometry;
  55340. if (e instanceof n.Points || e instanceof n.Line) {
  55341. var i = new n.Float32Attribute(3 * t.vertices.length, 3),
  55342. r = new n.Float32Attribute(3 * t.colors.length, 3);
  55343. if (
  55344. (this.addAttribute(
  55345. "position",
  55346. i.copyVector3sArray(t.vertices)
  55347. ),
  55348. this.addAttribute("color", r.copyColorsArray(t.colors)),
  55349. t.lineDistances &&
  55350. t.lineDistances.length === t.vertices.length)
  55351. ) {
  55352. var o = new n.Float32Attribute(t.lineDistances.length, 1);
  55353. this.addAttribute(
  55354. "lineDistance",
  55355. o.copyArray(t.lineDistances)
  55356. );
  55357. }
  55358. null !== t.boundingSphere &&
  55359. (this.boundingSphere = t.boundingSphere.clone()),
  55360. null !== t.boundingBox &&
  55361. (this.boundingBox = t.boundingBox.clone());
  55362. } else
  55363. e instanceof n.Mesh &&
  55364. t instanceof n.Geometry &&
  55365. this.fromGeometry(t);
  55366. return this;
  55367. },
  55368. updateFromObject: function (e) {
  55369. var t = e.geometry;
  55370. if (e instanceof n.Mesh) {
  55371. var i = t.__directGeometry;
  55372. if (void 0 === i) return this.fromGeometry(t);
  55373. (i.verticesNeedUpdate = t.verticesNeedUpdate),
  55374. (i.normalsNeedUpdate = t.normalsNeedUpdate),
  55375. (i.colorsNeedUpdate = t.colorsNeedUpdate),
  55376. (i.uvsNeedUpdate = t.uvsNeedUpdate),
  55377. (i.groupsNeedUpdate = t.groupsNeedUpdate),
  55378. (t.verticesNeedUpdate = !1),
  55379. (t.normalsNeedUpdate = !1),
  55380. (t.colorsNeedUpdate = !1),
  55381. (t.uvsNeedUpdate = !1),
  55382. (t.groupsNeedUpdate = !1),
  55383. (t = i);
  55384. }
  55385. if (t.verticesNeedUpdate === !0) {
  55386. var r = this.attributes.position;
  55387. void 0 !== r &&
  55388. (r.copyVector3sArray(t.vertices), (r.needsUpdate = !0)),
  55389. (t.verticesNeedUpdate = !1);
  55390. }
  55391. if (t.normalsNeedUpdate === !0) {
  55392. var r = this.attributes.normal;
  55393. void 0 !== r &&
  55394. (r.copyVector3sArray(t.normals), (r.needsUpdate = !0)),
  55395. (t.normalsNeedUpdate = !1);
  55396. }
  55397. if (t.colorsNeedUpdate === !0) {
  55398. var r = this.attributes.color;
  55399. void 0 !== r &&
  55400. (r.copyColorsArray(t.colors), (r.needsUpdate = !0)),
  55401. (t.colorsNeedUpdate = !1);
  55402. }
  55403. if (t.uvsNeedUpdate) {
  55404. var r = this.attributes.uv;
  55405. void 0 !== r &&
  55406. (r.copyVector2sArray(t.uvs), (r.needsUpdate = !0)),
  55407. (t.uvsNeedUpdate = !1);
  55408. }
  55409. if (t.lineDistancesNeedUpdate) {
  55410. var r = this.attributes.lineDistance;
  55411. void 0 !== r &&
  55412. (r.copyArray(t.lineDistances), (r.needsUpdate = !0)),
  55413. (t.lineDistancesNeedUpdate = !1);
  55414. }
  55415. return (
  55416. t.groupsNeedUpdate &&
  55417. (t.computeGroups(e.geometry),
  55418. (this.groups = t.groups),
  55419. (t.groupsNeedUpdate = !1)),
  55420. this
  55421. );
  55422. },
  55423. fromGeometry: function (e) {
  55424. return (
  55425. (e.__directGeometry = new n.DirectGeometry().fromGeometry(e)),
  55426. this.fromDirectGeometry(e.__directGeometry)
  55427. );
  55428. },
  55429. fromDirectGeometry: function (e) {
  55430. var t = new Float32Array(3 * e.vertices.length);
  55431. if (
  55432. (this.addAttribute(
  55433. "position",
  55434. new n.BufferAttribute(t, 3).copyVector3sArray(e.vertices)
  55435. ),
  55436. e.normals.length > 0)
  55437. ) {
  55438. var i = new Float32Array(3 * e.normals.length);
  55439. this.addAttribute(
  55440. "normal",
  55441. new n.BufferAttribute(i, 3).copyVector3sArray(e.normals)
  55442. );
  55443. }
  55444. if (e.colors.length > 0) {
  55445. var r = new Float32Array(3 * e.colors.length);
  55446. this.addAttribute(
  55447. "color",
  55448. new n.BufferAttribute(r, 3).copyColorsArray(e.colors)
  55449. );
  55450. }
  55451. if (e.uvs.length > 0) {
  55452. var o = new Float32Array(2 * e.uvs.length);
  55453. this.addAttribute(
  55454. "uv",
  55455. new n.BufferAttribute(o, 2).copyVector2sArray(e.uvs)
  55456. );
  55457. }
  55458. if (e.uvs2.length > 0) {
  55459. var a = new Float32Array(2 * e.uvs2.length);
  55460. this.addAttribute(
  55461. "uv2",
  55462. new n.BufferAttribute(a, 2).copyVector2sArray(e.uvs2)
  55463. );
  55464. }
  55465. if (e.indices.length > 0) {
  55466. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array,
  55467. l = new s(3 * e.indices.length);
  55468. this.setIndex(
  55469. new n.BufferAttribute(l, 1).copyIndicesArray(e.indices)
  55470. );
  55471. }
  55472. this.groups = e.groups;
  55473. for (var c in e.morphTargets) {
  55474. for (
  55475. var h = [], u = e.morphTargets[c], d = 0, p = u.length;
  55476. d < p;
  55477. d++
  55478. ) {
  55479. var f = u[d],
  55480. g = new n.Float32Attribute(3 * f.length, 3);
  55481. h.push(g.copyVector3sArray(f));
  55482. }
  55483. this.morphAttributes[c] = h;
  55484. }
  55485. if (e.skinIndices.length > 0) {
  55486. var m = new n.Float32Attribute(4 * e.skinIndices.length, 4);
  55487. this.addAttribute(
  55488. "skinIndex",
  55489. m.copyVector4sArray(e.skinIndices)
  55490. );
  55491. }
  55492. if (e.skinWeights.length > 0) {
  55493. var v = new n.Float32Attribute(4 * e.skinWeights.length, 4);
  55494. this.addAttribute(
  55495. "skinWeight",
  55496. v.copyVector4sArray(e.skinWeights)
  55497. );
  55498. }
  55499. return (
  55500. null !== e.boundingSphere &&
  55501. (this.boundingSphere = e.boundingSphere.clone()),
  55502. null !== e.boundingBox &&
  55503. (this.boundingBox = e.boundingBox.clone()),
  55504. this
  55505. );
  55506. },
  55507. computeBoundingBox: (function () {
  55508. new n.Vector3();
  55509. return function () {
  55510. null === this.boundingBox && (this.boundingBox = new n.Box3());
  55511. var e = this.attributes.position.array;
  55512. e && this.boundingBox.setFromArray(e),
  55513. (void 0 !== e && 0 !== e.length) ||
  55514. (this.boundingBox.min.set(0, 0, 0),
  55515. this.boundingBox.max.set(0, 0, 0)),
  55516. (isNaN(this.boundingBox.min.x) ||
  55517. isNaN(this.boundingBox.min.y) ||
  55518. isNaN(this.boundingBox.min.z)) &&
  55519. console.error(
  55520. 'THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',
  55521. this
  55522. );
  55523. };
  55524. })(),
  55525. computeBoundingSphere: (function () {
  55526. var e = new n.Box3(),
  55527. t = new n.Vector3();
  55528. return function () {
  55529. null === this.boundingSphere &&
  55530. (this.boundingSphere = new n.Sphere());
  55531. var i = this.attributes.position.array;
  55532. if (i) {
  55533. var r = this.boundingSphere.center;
  55534. e.setFromArray(i), e.center(r);
  55535. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  55536. t.fromArray(i, a),
  55537. (o = Math.max(o, r.distanceToSquared(t)));
  55538. (this.boundingSphere.radius = Math.sqrt(o)),
  55539. isNaN(this.boundingSphere.radius) &&
  55540. console.error(
  55541. 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
  55542. this
  55543. );
  55544. }
  55545. };
  55546. })(),
  55547. computeFaceNormals: function () {},
  55548. computeVertexNormals: function () {
  55549. var e = this.index,
  55550. t = this.attributes,
  55551. i = this.groups;
  55552. if (t.position) {
  55553. var r = t.position.array;
  55554. if (void 0 === t.normal)
  55555. this.addAttribute(
  55556. "normal",
  55557. new n.BufferAttribute(new Float32Array(r.length), 3)
  55558. );
  55559. else
  55560. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  55561. o[a] = 0;
  55562. var l,
  55563. c,
  55564. h,
  55565. u = t.normal.array,
  55566. d = new n.Vector3(),
  55567. p = new n.Vector3(),
  55568. f = new n.Vector3(),
  55569. g = new n.Vector3(),
  55570. m = new n.Vector3();
  55571. if (e) {
  55572. var v = e.array;
  55573. 0 === i.length && this.addGroup(0, v.length);
  55574. for (var A = 0, y = i.length; A < y; ++A)
  55575. for (
  55576. var C = i[A], I = C.start, E = C.count, a = I, s = I + E;
  55577. a < s;
  55578. a += 3
  55579. )
  55580. (l = 3 * v[a + 0]),
  55581. (c = 3 * v[a + 1]),
  55582. (h = 3 * v[a + 2]),
  55583. d.fromArray(r, l),
  55584. p.fromArray(r, c),
  55585. f.fromArray(r, h),
  55586. g.subVectors(f, p),
  55587. m.subVectors(d, p),
  55588. g.cross(m),
  55589. (u[l] += g.x),
  55590. (u[l + 1] += g.y),
  55591. (u[l + 2] += g.z),
  55592. (u[c] += g.x),
  55593. (u[c + 1] += g.y),
  55594. (u[c + 2] += g.z),
  55595. (u[h] += g.x),
  55596. (u[h + 1] += g.y),
  55597. (u[h + 2] += g.z);
  55598. } else
  55599. for (var a = 0, s = r.length; a < s; a += 9)
  55600. d.fromArray(r, a),
  55601. p.fromArray(r, a + 3),
  55602. f.fromArray(r, a + 6),
  55603. g.subVectors(f, p),
  55604. m.subVectors(d, p),
  55605. g.cross(m),
  55606. (u[a] = g.x),
  55607. (u[a + 1] = g.y),
  55608. (u[a + 2] = g.z),
  55609. (u[a + 3] = g.x),
  55610. (u[a + 4] = g.y),
  55611. (u[a + 5] = g.z),
  55612. (u[a + 6] = g.x),
  55613. (u[a + 7] = g.y),
  55614. (u[a + 8] = g.z);
  55615. this.normalizeNormals(), (t.normal.needsUpdate = !0);
  55616. }
  55617. },
  55618. merge: function (e, t) {
  55619. if (e instanceof n.BufferGeometry == !1)
  55620. return void console.error(
  55621. "THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",
  55622. e
  55623. );
  55624. void 0 === t && (t = 0);
  55625. var i = this.attributes;
  55626. for (var r in i)
  55627. if (void 0 !== e.attributes[r])
  55628. for (
  55629. var o = i[r],
  55630. a = o.array,
  55631. s = e.attributes[r],
  55632. l = s.array,
  55633. c = s.itemSize,
  55634. h = 0,
  55635. u = c * t;
  55636. h < l.length;
  55637. h++, u++
  55638. )
  55639. a[u] = l[h];
  55640. return this;
  55641. },
  55642. normalizeNormals: function () {
  55643. for (
  55644. var e,
  55645. t,
  55646. i,
  55647. n,
  55648. r = this.attributes.normal.array,
  55649. o = 0,
  55650. a = r.length;
  55651. o < a;
  55652. o += 3
  55653. )
  55654. (e = r[o]),
  55655. (t = r[o + 1]),
  55656. (i = r[o + 2]),
  55657. (n = 1 / Math.sqrt(e * e + t * t + i * i)),
  55658. (r[o] *= n),
  55659. (r[o + 1] *= n),
  55660. (r[o + 2] *= n);
  55661. },
  55662. toNonIndexed: function () {
  55663. if (null === this.index)
  55664. return (
  55665. console.warn(
  55666. "THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."
  55667. ),
  55668. this
  55669. );
  55670. var e = new n.BufferGeometry(),
  55671. t = this.index.array,
  55672. i = this.attributes;
  55673. for (var r in i) {
  55674. for (
  55675. var o = i[r],
  55676. a = o.array,
  55677. s = o.itemSize,
  55678. l = new a.constructor(t.length * s),
  55679. c = 0,
  55680. h = 0,
  55681. u = 0,
  55682. d = t.length;
  55683. u < d;
  55684. u++
  55685. ) {
  55686. c = t[u] * s;
  55687. for (var p = 0; p < s; p++) l[h++] = a[c++];
  55688. }
  55689. e.addAttribute(r, new n.BufferAttribute(l, s));
  55690. }
  55691. return e;
  55692. },
  55693. toJSON: function () {
  55694. var e = {
  55695. metadata: {
  55696. version: 4.4,
  55697. type: "BufferGeometry",
  55698. generator: "BufferGeometry.toJSON",
  55699. },
  55700. };
  55701. if (
  55702. ((e.uuid = this.uuid),
  55703. (e.type = this.type),
  55704. "" !== this.name && (e.name = this.name),
  55705. void 0 !== this.parameters)
  55706. ) {
  55707. var t = this.parameters;
  55708. for (var i in t) void 0 !== t[i] && (e[i] = t[i]);
  55709. return e;
  55710. }
  55711. e.data = {
  55712. attributes: {},
  55713. };
  55714. var n = this.index;
  55715. if (null !== n) {
  55716. var r = Array.prototype.slice.call(n.array);
  55717. e.data.index = {
  55718. type: n.array.constructor.name,
  55719. array: r,
  55720. };
  55721. }
  55722. var o = this.attributes;
  55723. for (var i in o) {
  55724. var a = o[i],
  55725. r = Array.prototype.slice.call(a.array);
  55726. e.data.attributes[i] = {
  55727. itemSize: a.itemSize,
  55728. type: a.array.constructor.name,
  55729. array: r,
  55730. };
  55731. }
  55732. var s = this.groups;
  55733. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  55734. var l = this.boundingSphere;
  55735. return (
  55736. null !== l &&
  55737. (e.data.boundingSphere = {
  55738. center: l.center.toArray(),
  55739. radius: l.radius,
  55740. }),
  55741. e
  55742. );
  55743. },
  55744. clone: function () {
  55745. return new n.BufferGeometry().copy(this);
  55746. },
  55747. copy: function (e) {
  55748. var t = e.index;
  55749. null !== t && this.setIndex(t.clone());
  55750. var i = e.attributes;
  55751. for (var n in i) {
  55752. var r = i[n];
  55753. this.addAttribute(n, r.clone());
  55754. }
  55755. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  55756. var l = o[a];
  55757. this.addGroup(l.start, l.count);
  55758. }
  55759. return this;
  55760. },
  55761. dispose: function () {
  55762. this.dispatchEvent({
  55763. type: "dispose",
  55764. });
  55765. },
  55766. }),
  55767. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  55768. (n.BufferGeometry.MaxIndex = 65535),
  55769. (n.InstancedBufferGeometry = function () {
  55770. n.BufferGeometry.call(this),
  55771. (this.type = "InstancedBufferGeometry"),
  55772. (this.maxInstancedCount = void 0);
  55773. }),
  55774. (n.InstancedBufferGeometry.prototype = Object.create(
  55775. n.BufferGeometry.prototype
  55776. )),
  55777. (n.InstancedBufferGeometry.prototype.constructor =
  55778. n.InstancedBufferGeometry),
  55779. (n.InstancedBufferGeometry.prototype.addGroup = function (e, t, i) {
  55780. this.groups.push({
  55781. start: e,
  55782. count: t,
  55783. instances: i,
  55784. });
  55785. }),
  55786. (n.InstancedBufferGeometry.prototype.copy = function (e) {
  55787. var t = e.index;
  55788. null !== t && this.setIndex(t.clone());
  55789. var i = e.attributes;
  55790. for (var n in i) {
  55791. var r = i[n];
  55792. this.addAttribute(n, r.clone());
  55793. }
  55794. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  55795. var l = o[a];
  55796. this.addGroup(l.start, l.count, l.instances);
  55797. }
  55798. return this;
  55799. }),
  55800. n.EventDispatcher.prototype.apply(
  55801. n.InstancedBufferGeometry.prototype
  55802. ),
  55803. (n.Uniform = function (e, t) {
  55804. (this.type = e), (this.value = t), (this.dynamic = !1);
  55805. }),
  55806. (n.Uniform.prototype = {
  55807. constructor: n.Uniform,
  55808. onUpdate: function (e) {
  55809. return (this.dynamic = !0), (this.onUpdateCallback = e), this;
  55810. },
  55811. }),
  55812. (n.AnimationClip = function (e, t, i) {
  55813. (this.name = e || n.Math.generateUUID()),
  55814. (this.tracks = i),
  55815. (this.duration = void 0 !== t ? t : -1),
  55816. this.duration < 0 && this.resetDuration(),
  55817. this.trim(),
  55818. this.optimize();
  55819. }),
  55820. (n.AnimationClip.prototype = {
  55821. constructor: n.AnimationClip,
  55822. resetDuration: function () {
  55823. for (
  55824. var e = this.tracks, t = 0, i = 0, n = e.length;
  55825. i !== n;
  55826. ++i
  55827. ) {
  55828. var r = this.tracks[i];
  55829. t = Math.max(t, r.times[r.times.length - 1]);
  55830. }
  55831. this.duration = t;
  55832. },
  55833. trim: function () {
  55834. for (var e = 0; e < this.tracks.length; e++)
  55835. this.tracks[e].trim(0, this.duration);
  55836. return this;
  55837. },
  55838. optimize: function () {
  55839. for (var e = 0; e < this.tracks.length; e++)
  55840. this.tracks[e].optimize();
  55841. return this;
  55842. },
  55843. }),
  55844. Object.assign(n.AnimationClip, {
  55845. parse: function (e) {
  55846. for (
  55847. var t = [],
  55848. i = e.tracks,
  55849. r = 1 / (e.fps || 1),
  55850. o = 0,
  55851. a = i.length;
  55852. o !== a;
  55853. ++o
  55854. )
  55855. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  55856. return new n.AnimationClip(e.name, e.duration, t);
  55857. },
  55858. toJSON: function (e) {
  55859. for (
  55860. var t = [],
  55861. i = e.tracks,
  55862. r = {
  55863. name: e.name,
  55864. duration: e.duration,
  55865. tracks: t,
  55866. },
  55867. o = 0,
  55868. a = i.length;
  55869. o !== a;
  55870. ++o
  55871. )
  55872. t.push(n.KeyframeTrack.toJSON(i[o]));
  55873. return r;
  55874. },
  55875. CreateFromMorphTargetSequence: function (e, t, i) {
  55876. for (var r = t.length, o = [], a = 0; a < r; a++) {
  55877. var s = [],
  55878. l = [];
  55879. s.push((a + r - 1) % r, a, (a + 1) % r), l.push(0, 1, 0);
  55880. var c = n.AnimationUtils.getKeyframeOrder(s);
  55881. (s = n.AnimationUtils.sortedArray(s, 1, c)),
  55882. (l = n.AnimationUtils.sortedArray(l, 1, c)),
  55883. 0 === s[0] && (s.push(r), l.push(l[0])),
  55884. o.push(
  55885. new n.NumberKeyframeTrack(
  55886. ".morphTargetInfluences[" + t[a].name + "]",
  55887. s,
  55888. l
  55889. ).scale(1 / i)
  55890. );
  55891. }
  55892. return new n.AnimationClip(e, -1, o);
  55893. },
  55894. findByName: function (e, t) {
  55895. for (var i = 0; i < e.length; i++)
  55896. if (e[i].name === t) return e[i];
  55897. return null;
  55898. },
  55899. CreateClipsFromMorphTargetSequences: function (e, t) {
  55900. for (
  55901. var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length;
  55902. o < a;
  55903. o++
  55904. ) {
  55905. var s = e[o],
  55906. l = s.name.match(r);
  55907. if (l && l.length > 1) {
  55908. var c = l[1],
  55909. h = i[c];
  55910. h || (i[c] = h = []), h.push(s);
  55911. }
  55912. }
  55913. var u = [];
  55914. for (var c in i)
  55915. u.push(
  55916. n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t)
  55917. );
  55918. return u;
  55919. },
  55920. parseAnimation: function (e, t, i) {
  55921. if (!e)
  55922. return console.error(" no animation in JSONLoader data"), null;
  55923. for (
  55924. var r = function (e, t, i, r, o) {
  55925. if (0 !== i.length) {
  55926. var a = [],
  55927. s = [];
  55928. n.AnimationUtils.flattenJSON(i, a, s, r),
  55929. 0 !== a.length && o.push(new e(t, a, s));
  55930. }
  55931. },
  55932. o = [],
  55933. a = e.name || "default",
  55934. s = e.length || -1,
  55935. l = e.fps || 30,
  55936. c = e.hierarchy || [],
  55937. h = 0;
  55938. h < c.length;
  55939. h++
  55940. ) {
  55941. var u = c[h].keys;
  55942. if (u && 0 != u.length)
  55943. if (u[0].morphTargets) {
  55944. for (var d = {}, p = 0; p < u.length; p++)
  55945. if (u[p].morphTargets)
  55946. for (var f = 0; f < u[p].morphTargets.length; f++)
  55947. d[u[p].morphTargets[f]] = -1;
  55948. for (var g in d) {
  55949. for (
  55950. var m = [], v = [], f = 0;
  55951. f !== u[p].morphTargets.length;
  55952. ++f
  55953. ) {
  55954. var A = u[p];
  55955. m.push(A.time), v.push(A.morphTarget === g ? 1 : 0);
  55956. }
  55957. o.push(
  55958. new n.NumberKeyframeTrack(
  55959. ".morphTargetInfluence[" + g + "]",
  55960. m,
  55961. v
  55962. )
  55963. );
  55964. }
  55965. s = d.length * (l || 1);
  55966. } else {
  55967. var y = ".bones[" + t[h].name + "]";
  55968. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  55969. r(
  55970. n.QuaternionKeyframeTrack,
  55971. y + ".quaternion",
  55972. u,
  55973. "rot",
  55974. o
  55975. ),
  55976. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o);
  55977. }
  55978. }
  55979. if (0 === o.length) return null;
  55980. var C = new n.AnimationClip(a, s, o);
  55981. return C;
  55982. },
  55983. }),
  55984. (n.AnimationMixer = function (e) {
  55985. (this._root = e),
  55986. this._initMemoryManager(),
  55987. (this._accuIndex = 0),
  55988. (this.time = 0),
  55989. (this.timeScale = 1);
  55990. }),
  55991. (n.AnimationMixer.prototype = {
  55992. constructor: n.AnimationMixer,
  55993. clipAction: function (e, t) {
  55994. var i,
  55995. r = t || this._root,
  55996. o = r.uuid,
  55997. a = "string" == typeof e ? e : e.name,
  55998. s = e !== a ? e : null,
  55999. l = this._actionsByClip[a];
  56000. if (void 0 !== l) {
  56001. var c = l.actionByRoot[o];
  56002. if (void 0 !== c) return c;
  56003. if (
  56004. ((i = l.knownActions[0]), (s = i._clip), e !== a && e !== s)
  56005. )
  56006. throw new Error(
  56007. "Different clips with the same name detected!"
  56008. );
  56009. }
  56010. if (null === s) return null;
  56011. var h = new n.AnimationMixer._Action(this, s, t);
  56012. return (
  56013. this._bindAction(h, i), this._addInactiveAction(h, a, o), h
  56014. );
  56015. },
  56016. existingAction: function (e, t) {
  56017. var i = t || this._root,
  56018. n = i.uuid,
  56019. r = "string" == typeof e ? e : e.name,
  56020. o = this._actionsByClip[r];
  56021. return void 0 !== o ? o.actionByRoot[n] || null : null;
  56022. },
  56023. stopAllAction: function () {
  56024. var e = this._actions,
  56025. t = this._nActiveActions,
  56026. i = this._bindings,
  56027. n = this._nActiveBindings;
  56028. (this._nActiveActions = 0), (this._nActiveBindings = 0);
  56029. for (var r = 0; r !== t; ++r) e[r].reset();
  56030. for (var r = 0; r !== n; ++r) i[r].useCount = 0;
  56031. return this;
  56032. },
  56033. update: function (e) {
  56034. e *= this.timeScale;
  56035. for (
  56036. var t = this._actions,
  56037. i = this._nActiveActions,
  56038. n = (this.time += e),
  56039. r = Math.sign(e),
  56040. o = (this._accuIndex ^= 1),
  56041. a = 0;
  56042. a !== i;
  56043. ++a
  56044. ) {
  56045. var s = t[a];
  56046. s.enabled && s._update(n, e, r, o);
  56047. }
  56048. for (
  56049. var l = this._bindings, c = this._nActiveBindings, a = 0;
  56050. a !== c;
  56051. ++a
  56052. )
  56053. l[a].apply(o);
  56054. return this;
  56055. },
  56056. getRoot: function () {
  56057. return this._root;
  56058. },
  56059. uncacheClip: function (e) {
  56060. var t = this._actions,
  56061. i = e.name,
  56062. n = this._actionsByClip,
  56063. r = n[i];
  56064. if (void 0 !== r) {
  56065. for (
  56066. var o = r.knownActions, a = 0, s = o.length;
  56067. a !== s;
  56068. ++a
  56069. ) {
  56070. var l = o[a];
  56071. this._deactivateAction(l);
  56072. var c = l._cacheIndex,
  56073. h = t[t.length - 1];
  56074. (l._cacheIndex = null),
  56075. (l._byClipCacheIndex = null),
  56076. (h._cacheIndex = c),
  56077. (t[c] = h),
  56078. t.pop(),
  56079. this._removeInactiveBindingsForAction(l);
  56080. }
  56081. delete n[i];
  56082. }
  56083. },
  56084. uncacheRoot: function (e) {
  56085. var t = e.uuid,
  56086. i = this._actionsByClip;
  56087. for (var n in i) {
  56088. var r = i[n].actionByRoot,
  56089. o = r[t];
  56090. void 0 !== o &&
  56091. (this._deactivateAction(o), this._removeInactiveAction(o));
  56092. }
  56093. var a = this._bindingsByRootAndName,
  56094. s = a[t];
  56095. if (void 0 !== s)
  56096. for (var l in s) {
  56097. var c = s[l];
  56098. c.restoreOriginalState(), this._removeInactiveBinding(c);
  56099. }
  56100. },
  56101. uncacheAction: function (e, t) {
  56102. var i = this.existingAction(e, t);
  56103. null !== i &&
  56104. (this._deactivateAction(i), this._removeInactiveAction(i));
  56105. },
  56106. }),
  56107. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  56108. (n.AnimationMixer._Action = function (e, t, i) {
  56109. (this._mixer = e), (this._clip = t), (this._localRoot = i || null);
  56110. for (
  56111. var r = t.tracks,
  56112. o = r.length,
  56113. a = new Array(o),
  56114. s = {
  56115. endingStart: n.ZeroCurvatureEnding,
  56116. endingEnd: n.ZeroCurvatureEnding,
  56117. },
  56118. l = 0;
  56119. l !== o;
  56120. ++l
  56121. ) {
  56122. var c = r[l].createInterpolant(null);
  56123. (a[l] = c), (c.settings = s);
  56124. }
  56125. (this._interpolantSettings = s),
  56126. (this._interpolants = a),
  56127. (this._propertyBindings = new Array(o)),
  56128. (this._cacheIndex = null),
  56129. (this._byClipCacheIndex = null),
  56130. (this._timeScaleInterpolant = null),
  56131. (this._weightInterpolant = null),
  56132. (this.loop = n.LoopRepeat),
  56133. (this._loopCount = -1),
  56134. (this._startTime = null),
  56135. (this.time = 0),
  56136. (this.timeScale = 1),
  56137. (this._effectiveTimeScale = 1),
  56138. (this.weight = 1),
  56139. (this._effectiveWeight = 1),
  56140. (this.repetitions = 1 / 0),
  56141. (this.paused = !1),
  56142. (this.enabled = !0),
  56143. (this.clampWhenFinished = !1),
  56144. (this.zeroSlopeAtStart = !0),
  56145. (this.zeroSlopeAtEnd = !0);
  56146. }),
  56147. (n.AnimationMixer._Action.prototype = {
  56148. constructor: n.AnimationMixer._Action,
  56149. play: function () {
  56150. return this._mixer._activateAction(this), this;
  56151. },
  56152. stop: function () {
  56153. return this._mixer._deactivateAction(this), this.reset();
  56154. },
  56155. reset: function () {
  56156. return (
  56157. (this.paused = !1),
  56158. (this.enabled = !0),
  56159. (this.time = 0),
  56160. (this._loopCount = -1),
  56161. (this._startTime = null),
  56162. this.stopFading().stopWarping()
  56163. );
  56164. },
  56165. isRunning: function () {
  56166. this._startTime;
  56167. return (
  56168. this.enabled &&
  56169. !this.paused &&
  56170. 0 !== this.timeScale &&
  56171. null === this._startTime &&
  56172. this._mixer._isActiveAction(this)
  56173. );
  56174. },
  56175. isScheduled: function () {
  56176. return this._mixer._isActiveAction(this);
  56177. },
  56178. startAt: function (e) {
  56179. return (this._startTime = e), this;
  56180. },
  56181. setLoop: function (e, t) {
  56182. return (this.loop = e), (this.repetitions = t), this;
  56183. },
  56184. setEffectiveWeight: function (e) {
  56185. return (
  56186. (this.weight = e),
  56187. (this._effectiveWeight = this.enabled ? e : 0),
  56188. this.stopFading()
  56189. );
  56190. },
  56191. getEffectiveWeight: function () {
  56192. return this._effectiveWeight;
  56193. },
  56194. fadeIn: function (e) {
  56195. return this._scheduleFading(e, 0, 1);
  56196. },
  56197. fadeOut: function (e) {
  56198. return this._scheduleFading(e, 1, 0);
  56199. },
  56200. crossFadeFrom: function (e, t, i) {
  56201. this._mixer;
  56202. if ((e.fadeOut(t), this.fadeIn(t), i)) {
  56203. var n = this._clip.duration,
  56204. r = e._clip.duration,
  56205. o = r / n,
  56206. a = n / r;
  56207. e.warp(1, o, t), this.warp(a, 1, t);
  56208. }
  56209. return this;
  56210. },
  56211. crossFadeTo: function (e, t, i) {
  56212. return e.crossFadeFrom(this, t, i);
  56213. },
  56214. stopFading: function () {
  56215. var e = this._weightInterpolant;
  56216. return (
  56217. null !== e &&
  56218. ((this._weightInterpolant = null),
  56219. this._mixer._takeBackControlInterpolant(e)),
  56220. this
  56221. );
  56222. },
  56223. setEffectiveTimeScale: function (e) {
  56224. return (
  56225. (this.timeScale = e),
  56226. (this._effectiveTimeScale = this.paused ? 0 : e),
  56227. this.stopWarping()
  56228. );
  56229. },
  56230. getEffectiveTimeScale: function () {
  56231. return this._effectiveTimeScale;
  56232. },
  56233. setDuration: function (e) {
  56234. return (
  56235. (this.timeScale = this._clip.duration / e), this.stopWarping()
  56236. );
  56237. },
  56238. syncWith: function (e) {
  56239. return (
  56240. (this.time = e.time),
  56241. (this.timeScale = e.timeScale),
  56242. this.stopWarping()
  56243. );
  56244. },
  56245. halt: function (e) {
  56246. return this.warp(this._currentTimeScale, 0, e);
  56247. },
  56248. warp: function (e, t, i) {
  56249. var n = this._mixer,
  56250. r = n.time,
  56251. o = this._timeScaleInterpolant,
  56252. a = this.timeScale;
  56253. null === o &&
  56254. ((o = n._lendControlInterpolant()),
  56255. (this._timeScaleInterpolant = o));
  56256. var s = o.parameterPositions,
  56257. l = o.sampleValues;
  56258. return (
  56259. (s[0] = r), (s[1] = r + i), (l[0] = e / a), (l[1] = t / a), this
  56260. );
  56261. },
  56262. stopWarping: function () {
  56263. var e = this._timeScaleInterpolant;
  56264. return (
  56265. null !== e &&
  56266. ((this._timeScaleInterpolant = null),
  56267. this._mixer._takeBackControlInterpolant(e)),
  56268. this
  56269. );
  56270. },
  56271. getMixer: function () {
  56272. return this._mixer;
  56273. },
  56274. getClip: function () {
  56275. return this._clip;
  56276. },
  56277. getRoot: function () {
  56278. return this._localRoot || this._mixer._root;
  56279. },
  56280. _update: function (e, t, i, n) {
  56281. var r = this._startTime;
  56282. if (null !== r) {
  56283. var o = (e - r) * i;
  56284. if (o < 0 || 0 === i) return;
  56285. (this._startTime = null), (t = i * o);
  56286. }
  56287. t *= this._updateTimeScale(e);
  56288. var a = this._updateTime(t),
  56289. s = this._updateWeight(e);
  56290. if (s > 0)
  56291. for (
  56292. var l = this._interpolants,
  56293. c = this._propertyBindings,
  56294. h = 0,
  56295. u = l.length;
  56296. h !== u;
  56297. ++h
  56298. )
  56299. l[h].evaluate(a), c[h].accumulate(n, s);
  56300. },
  56301. _updateWeight: function (e) {
  56302. var t = 0;
  56303. if (this.enabled) {
  56304. t = this.weight;
  56305. var i = this._weightInterpolant;
  56306. if (null !== i) {
  56307. var n = i.evaluate(e)[0];
  56308. (t *= n),
  56309. e > i.parameterPositions[1] &&
  56310. (this.stopFading(), 0 === n && (this.enabled = !1));
  56311. }
  56312. }
  56313. return (this._effectiveWeight = t), t;
  56314. },
  56315. _updateTimeScale: function (e) {
  56316. var t = 0;
  56317. if (!this.paused) {
  56318. t = this.timeScale;
  56319. var i = this._timeScaleInterpolant;
  56320. if (null !== i) {
  56321. var n = i.evaluate(e)[0];
  56322. (t *= n),
  56323. e > i.parameterPositions[1] &&
  56324. (this.stopWarping(),
  56325. 0 === t ? (this.pause = !0) : (this.timeScale = t));
  56326. }
  56327. }
  56328. return (this._effectiveTimeScale = t), t;
  56329. },
  56330. _updateTime: function (e) {
  56331. var t = this.time + e;
  56332. if (0 === e) return t;
  56333. var i = this._clip.duration,
  56334. r = this.loop,
  56335. o = this._loopCount,
  56336. a = !1;
  56337. switch (r) {
  56338. case n.LoopOnce:
  56339. if (
  56340. (o === -1 &&
  56341. ((this.loopCount = 0), this._setEndings(!0, !0, !1)),
  56342. t >= i)
  56343. )
  56344. t = i;
  56345. else {
  56346. if (!(t < 0)) break;
  56347. t = 0;
  56348. }
  56349. this.clampWhenFinished
  56350. ? (this.pause = !0)
  56351. : (this.enabled = !1),
  56352. this._mixer.dispatchEvent({
  56353. type: "finished",
  56354. action: this,
  56355. direction: e < 0 ? -1 : 1,
  56356. });
  56357. break;
  56358. case n.LoopPingPong:
  56359. a = !0;
  56360. case n.LoopRepeat:
  56361. if (
  56362. (o === -1 &&
  56363. (e > 0
  56364. ? ((o = 0),
  56365. this._setEndings(!0, 0 === this.repetitions, a))
  56366. : this._setEndings(0 === this.repetitions, !0, a)),
  56367. t >= i || t < 0)
  56368. ) {
  56369. var s = Math.floor(t / i);
  56370. (t -= i * s), (o += Math.abs(s));
  56371. var l = this.repetitions - o;
  56372. if (l < 0) {
  56373. this.clampWhenFinished
  56374. ? (this.paused = !0)
  56375. : (this.enabled = !1),
  56376. (t = e > 0 ? i : 0),
  56377. this._mixer.dispatchEvent({
  56378. type: "finished",
  56379. action: this,
  56380. direction: e > 0 ? 1 : -1,
  56381. });
  56382. break;
  56383. }
  56384. if (0 === l) {
  56385. var c = e < 0;
  56386. this._setEndings(c, !c, a);
  56387. } else this._setEndings(!1, !1, a);
  56388. (this._loopCount = o),
  56389. this._mixer.dispatchEvent({
  56390. type: "loop",
  56391. action: this,
  56392. loopDelta: s,
  56393. });
  56394. }
  56395. if (r === n.LoopPingPong && 1 === (1 & o))
  56396. return (this.time = t), i - t;
  56397. }
  56398. return (this.time = t), t;
  56399. },
  56400. _setEndings: function (e, t, i) {
  56401. var r = this._interpolantSettings;
  56402. i
  56403. ? ((r.endingStart = n.ZeroSlopeEnding),
  56404. (r.endingEnd = n.ZeroSlopeEnding))
  56405. : (e
  56406. ? (r.endingStart = this.zeroSlopeAtStart
  56407. ? n.ZeroSlopeEnding
  56408. : n.ZeroCurvatureEnding)
  56409. : (r.endingStart = n.WrapAroundEnding),
  56410. t
  56411. ? (r.endingEnd = this.zeroSlopeAtEnd
  56412. ? n.ZeroSlopeEnding
  56413. : n.ZeroCurvatureEnding)
  56414. : (r.endingEnd = n.WrapAroundEnding));
  56415. },
  56416. _scheduleFading: function (e, t, i) {
  56417. var n = this._mixer,
  56418. r = n.time,
  56419. o = this._weightInterpolant;
  56420. null === o &&
  56421. ((o = n._lendControlInterpolant()),
  56422. (this._weightInterpolant = o));
  56423. var a = o.parameterPositions,
  56424. s = o.sampleValues;
  56425. return (a[0] = r), (s[0] = t), (a[1] = r + e), (s[1] = i), this;
  56426. },
  56427. }),
  56428. Object.assign(n.AnimationMixer.prototype, {
  56429. _bindAction: function (e, t) {
  56430. var i = e._localRoot || this._root,
  56431. r = e._clip.tracks,
  56432. o = r.length,
  56433. a = e._propertyBindings,
  56434. s = e._interpolants,
  56435. l = i.uuid,
  56436. c = this._bindingsByRootAndName,
  56437. h = c[l];
  56438. void 0 === h && ((h = {}), (c[l] = h));
  56439. for (var u = 0; u !== o; ++u) {
  56440. var d = r[u],
  56441. p = d.name,
  56442. f = h[p];
  56443. if (void 0 !== f) a[u] = f;
  56444. else {
  56445. if (((f = a[u]), void 0 !== f)) {
  56446. null === f._cacheIndex &&
  56447. (++f.referenceCount, this._addInactiveBinding(f, l, p));
  56448. continue;
  56449. }
  56450. var g = t && t._propertyBindings[u].binding.parsedPath;
  56451. (f = new n.PropertyMixer(
  56452. n.PropertyBinding.create(i, p, g),
  56453. d.ValueTypeName,
  56454. d.getValueSize()
  56455. )),
  56456. ++f.referenceCount,
  56457. this._addInactiveBinding(f, l, p),
  56458. (a[u] = f);
  56459. }
  56460. s[u].resultBuffer = f.buffer;
  56461. }
  56462. },
  56463. _activateAction: function (e) {
  56464. if (!this._isActiveAction(e)) {
  56465. if (null === e._cacheIndex) {
  56466. var t = (e._localRoot || this._root).uuid,
  56467. i = e._clip.name,
  56468. n = this._actionsByClip[i];
  56469. this._bindAction(e, n && n.knownActions[0]),
  56470. this._addInactiveAction(e, i, t);
  56471. }
  56472. for (
  56473. var r = e._propertyBindings, o = 0, a = r.length;
  56474. o !== a;
  56475. ++o
  56476. ) {
  56477. var s = r[o];
  56478. 0 === s.useCount++ &&
  56479. (this._lendBinding(s), s.saveOriginalState());
  56480. }
  56481. this._lendAction(e);
  56482. }
  56483. },
  56484. _deactivateAction: function (e) {
  56485. if (this._isActiveAction(e)) {
  56486. for (
  56487. var t = e._propertyBindings, i = 0, n = t.length;
  56488. i !== n;
  56489. ++i
  56490. ) {
  56491. var r = t[i];
  56492. 0 === --r.useCount &&
  56493. (r.restoreOriginalState(), this._takeBackBinding(r));
  56494. }
  56495. this._takeBackAction(e);
  56496. }
  56497. },
  56498. _initMemoryManager: function () {
  56499. (this._actions = []),
  56500. (this._nActiveActions = 0),
  56501. (this._actionsByClip = {}),
  56502. (this._bindings = []),
  56503. (this._nActiveBindings = 0),
  56504. (this._bindingsByRootAndName = {}),
  56505. (this._controlInterpolants = []),
  56506. (this._nActiveControlInterpolants = 0);
  56507. var e = this;
  56508. this.stats = {
  56509. actions: {
  56510. get total() {
  56511. return e._actions.length;
  56512. },
  56513. get inUse() {
  56514. return e._nActiveActions;
  56515. },
  56516. },
  56517. bindings: {
  56518. get total() {
  56519. return e._bindings.length;
  56520. },
  56521. get inUse() {
  56522. return e._nActiveBindings;
  56523. },
  56524. },
  56525. controlInterpolants: {
  56526. get total() {
  56527. return e._controlInterpolants.length;
  56528. },
  56529. get inUse() {
  56530. return e._nActiveControlInterpolants;
  56531. },
  56532. },
  56533. };
  56534. },
  56535. _isActiveAction: function (e) {
  56536. var t = e._cacheIndex;
  56537. return null !== t && t < this._nActiveActions;
  56538. },
  56539. _addInactiveAction: function (e, t, i) {
  56540. var n = this._actions,
  56541. r = this._actionsByClip,
  56542. o = r[t];
  56543. if (void 0 === o)
  56544. (o = {
  56545. knownActions: [e],
  56546. actionByRoot: {},
  56547. }),
  56548. (e._byClipCacheIndex = 0),
  56549. (r[t] = o);
  56550. else {
  56551. var a = o.knownActions;
  56552. (e._byClipCacheIndex = a.length), a.push(e);
  56553. }
  56554. (e._cacheIndex = n.length), n.push(e), (o.actionByRoot[i] = e);
  56555. },
  56556. _removeInactiveAction: function (e) {
  56557. var t = this._actions,
  56558. i = t[t.length - 1],
  56559. n = e._cacheIndex;
  56560. (i._cacheIndex = n), (t[n] = i), t.pop(), (e._cacheIndex = null);
  56561. var r = e._clip.name,
  56562. o = this._actionsByClip,
  56563. a = o[r],
  56564. s = a.knownActions,
  56565. l = s[s.length - 1],
  56566. c = e._byClipCacheIndex;
  56567. (l._byClipCacheIndex = c),
  56568. (s[c] = l),
  56569. s.pop(),
  56570. (e._byClipCacheIndex = null);
  56571. var h = a.actionByRoot,
  56572. u = (t._localRoot || this._root).uuid;
  56573. delete h[u],
  56574. 0 === s.length && delete o[r],
  56575. this._removeInactiveBindingsForAction(e);
  56576. },
  56577. _removeInactiveBindingsForAction: function (e) {
  56578. for (
  56579. var t = e._propertyBindings, i = 0, n = t.length;
  56580. i !== n;
  56581. ++i
  56582. ) {
  56583. var r = t[i];
  56584. 0 === --r.referenceCount && this._removeInactiveBinding(r);
  56585. }
  56586. },
  56587. _lendAction: function (e) {
  56588. var t = this._actions,
  56589. i = e._cacheIndex,
  56590. n = this._nActiveActions++,
  56591. r = t[n];
  56592. (e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r);
  56593. },
  56594. _takeBackAction: function (e) {
  56595. var t = this._actions,
  56596. i = e._cacheIndex,
  56597. n = --this._nActiveActions,
  56598. r = t[n];
  56599. (e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r);
  56600. },
  56601. _addInactiveBinding: function (e, t, i) {
  56602. var n = this._bindingsByRootAndName,
  56603. r = n[t],
  56604. o = this._bindings;
  56605. void 0 === r && ((r = {}), (n[t] = r)),
  56606. (r[i] = e),
  56607. (e._cacheIndex = o.length),
  56608. o.push(e);
  56609. },
  56610. _removeInactiveBinding: function (e) {
  56611. var t = this._bindings,
  56612. i = e.binding,
  56613. n = i.rootNode.uuid,
  56614. r = i.path,
  56615. o = this._bindingsByRootAndName,
  56616. a = o[n],
  56617. s = t[t.length - 1],
  56618. l = e._cacheIndex;
  56619. (s._cacheIndex = l), (t[l] = s), t.pop(), delete a[r];
  56620. e: {
  56621. for (var c in a) break e;
  56622. delete o[n];
  56623. }
  56624. },
  56625. _lendBinding: function (e) {
  56626. var t = this._bindings,
  56627. i = e._cacheIndex,
  56628. n = this._nActiveBindings++,
  56629. r = t[n];
  56630. (e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r);
  56631. },
  56632. _takeBackBinding: function (e) {
  56633. var t = this._bindings,
  56634. i = e._cacheIndex,
  56635. n = --this._nActiveBindings,
  56636. r = t[n];
  56637. (e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r);
  56638. },
  56639. _lendControlInterpolant: function () {
  56640. var e = this._controlInterpolants,
  56641. t = this._nActiveControlInterpolants++,
  56642. i = e[t];
  56643. return (
  56644. void 0 === i &&
  56645. ((i = new n.LinearInterpolant(
  56646. new Float32Array(2),
  56647. new Float32Array(2),
  56648. 1,
  56649. this._controlInterpolantsResultBuffer
  56650. )),
  56651. (i.__cacheIndex = t),
  56652. (e[t] = i)),
  56653. i
  56654. );
  56655. },
  56656. _takeBackControlInterpolant: function (e) {
  56657. var t = this._controlInterpolants,
  56658. i = e.__cacheIndex,
  56659. n = --this._nActiveControlInterpolants,
  56660. r = t[n];
  56661. (e.__cacheIndex = n),
  56662. (t[n] = e),
  56663. (r.__cacheIndex = i),
  56664. (t[i] = r);
  56665. },
  56666. _controlInterpolantsResultBuffer: new Float32Array(1),
  56667. }),
  56668. (n.AnimationObjectGroup = function (e) {
  56669. (this.uuid = n.Math.generateUUID()),
  56670. (this._objects = Array.prototype.slice.call(arguments)),
  56671. (this.nCachedObjects_ = 0);
  56672. var t = {};
  56673. this._indicesByUUID = t;
  56674. for (var i = 0, r = arguments.length; i !== r; ++i)
  56675. t[arguments[i].uuid] = i;
  56676. (this._paths = []),
  56677. (this._parsedPaths = []),
  56678. (this._bindings = []),
  56679. (this._bindingsIndicesByPath = {});
  56680. var o = this;
  56681. this.stats = {
  56682. objects: {
  56683. get total() {
  56684. return o._objects.length;
  56685. },
  56686. get inUse() {
  56687. return this.total - o.nCachedObjects_;
  56688. },
  56689. },
  56690. get bindingsPerObject() {
  56691. return o._bindings.length;
  56692. },
  56693. };
  56694. }),
  56695. (n.AnimationObjectGroup.prototype = {
  56696. constructor: n.AnimationObjectGroup,
  56697. add: function (e) {
  56698. for (
  56699. var t = this._objects,
  56700. i = t.length,
  56701. r = this.nCachedObjects_,
  56702. o = this._indicesByUUID,
  56703. a = this._paths,
  56704. s = this._parsedPaths,
  56705. l = this._bindings,
  56706. c = l.length,
  56707. h = 0,
  56708. u = arguments.length;
  56709. h !== u;
  56710. ++h
  56711. ) {
  56712. var d = arguments[h],
  56713. p = d.uuid,
  56714. f = o[p];
  56715. if (void 0 === f) {
  56716. (f = i++), (o[p] = f), t.push(d);
  56717. for (var g = 0, m = c; g !== m; ++g)
  56718. l[g].push(new n.PropertyBinding(d, a[g], s[g]));
  56719. } else if (f < r) {
  56720. var v = t[f],
  56721. A = --r,
  56722. y = t[A];
  56723. (o[y.uuid] = f), (t[f] = y), (o[p] = A), (t[A] = d);
  56724. for (var g = 0, m = c; g !== m; ++g) {
  56725. var C = l[g],
  56726. I = C[A],
  56727. E = C[f];
  56728. (C[f] = I),
  56729. void 0 === E &&
  56730. (E = new n.PropertyBinding(d, a[g], s[g])),
  56731. (C[A] = E);
  56732. }
  56733. } else
  56734. t[f] !== v &&
  56735. console.error(
  56736. "Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes..."
  56737. );
  56738. }
  56739. this.nCachedObjects_ = r;
  56740. },
  56741. remove: function (e) {
  56742. for (
  56743. var t = this._objects,
  56744. i = (t.length, this.nCachedObjects_),
  56745. n = this._indicesByUUID,
  56746. r = this._bindings,
  56747. o = r.length,
  56748. a = 0,
  56749. s = arguments.length;
  56750. a !== s;
  56751. ++a
  56752. ) {
  56753. var l = arguments[a],
  56754. c = l.uuid,
  56755. h = n[c];
  56756. if (void 0 !== h && h >= i) {
  56757. var u = i++,
  56758. d = t[u];
  56759. (n[d.uuid] = h), (t[h] = d), (n[c] = u), (t[u] = l);
  56760. for (var p = 0, f = o; p !== f; ++p) {
  56761. var g = r[p],
  56762. m = g[u],
  56763. v = g[h];
  56764. (g[h] = m), (g[u] = v);
  56765. }
  56766. }
  56767. }
  56768. this.nCachedObjects_ = i;
  56769. },
  56770. uncache: function (e) {
  56771. for (
  56772. var t = this._objects,
  56773. i = t.length,
  56774. n = this.nCachedObjects_,
  56775. r = this._indicesByUUID,
  56776. o = this._bindings,
  56777. a = o.length,
  56778. s = 0,
  56779. l = arguments.length;
  56780. s !== l;
  56781. ++s
  56782. ) {
  56783. var c = arguments[s],
  56784. h = c.uuid,
  56785. u = r[h];
  56786. if (void 0 !== u)
  56787. if ((delete r[h], u < n)) {
  56788. var d = --n,
  56789. p = t[d],
  56790. f = --i,
  56791. g = t[f];
  56792. (r[p.uuid] = u),
  56793. (t[u] = p),
  56794. (r[g.uuid] = d),
  56795. (t[d] = g),
  56796. t.pop();
  56797. for (var m = 0, v = a; m !== v; ++m) {
  56798. var A = o[m],
  56799. y = A[d],
  56800. C = A[f];
  56801. (A[u] = y), (A[d] = C), A.pop();
  56802. }
  56803. } else {
  56804. var f = --i,
  56805. g = t[f];
  56806. (r[g.uuid] = u), (t[u] = g), t.pop();
  56807. for (var m = 0, v = a; m !== v; ++m) {
  56808. var A = o[m];
  56809. (A[u] = A[f]), A.pop();
  56810. }
  56811. }
  56812. }
  56813. this.nCachedObjects_ = n;
  56814. },
  56815. subscribe_: function (e, t) {
  56816. var i = this._bindingsIndicesByPath,
  56817. r = i[e],
  56818. o = this._bindings;
  56819. if (void 0 !== r) return o[r];
  56820. var a = this._paths,
  56821. s = this._parsedPaths,
  56822. l = this._objects,
  56823. c = l.length,
  56824. h = this.nCachedObjects_,
  56825. u = new Array(c);
  56826. (r = o.length), (i[e] = r), a.push(e), s.push(t), o.push(u);
  56827. for (var d = h, p = l.length; d !== p; ++d) {
  56828. var f = l[d];
  56829. u[d] = new n.PropertyBinding(f, e, t);
  56830. }
  56831. return u;
  56832. },
  56833. unsubscribe_: function (e) {
  56834. var t = this._bindingsIndicesByPath,
  56835. i = t[e];
  56836. if (void 0 !== i) {
  56837. var n = this._paths,
  56838. r = this._parsedPaths,
  56839. o = this._bindings,
  56840. a = o.length - 1,
  56841. s = o[a],
  56842. l = e[a];
  56843. (t[l] = i),
  56844. (o[i] = s),
  56845. o.pop(),
  56846. (r[i] = r[a]),
  56847. r.pop(),
  56848. (n[i] = n[a]),
  56849. n.pop();
  56850. }
  56851. },
  56852. }),
  56853. (n.AnimationUtils = {
  56854. arraySlice: function (e, t, i) {
  56855. return n.AnimationUtils.isTypedArray(e)
  56856. ? new e.constructor(e.subarray(t, i))
  56857. : e.slice(t, i);
  56858. },
  56859. convertArray: function (e, t, i) {
  56860. return !e || (!i && e.constructor === t)
  56861. ? e
  56862. : "number" == typeof t.BYTES_PER_ELEMENT
  56863. ? new t(e)
  56864. : Array.prototype.slice.call(e);
  56865. },
  56866. isTypedArray: function (e) {
  56867. return ArrayBuffer.isView(e) && !(e instanceof DataView);
  56868. },
  56869. getKeyframeOrder: function (e) {
  56870. function t(t, i) {
  56871. return e[t] - e[i];
  56872. }
  56873. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  56874. n[r] = r;
  56875. return n.sort(t), n;
  56876. },
  56877. sortedArray: function (e, t, i) {
  56878. for (
  56879. var n = e.length, r = new e.constructor(n), o = 0, a = 0;
  56880. a !== n;
  56881. ++o
  56882. )
  56883. for (var s = i[o] * t, l = 0; l !== t; ++l) r[a++] = e[s + l];
  56884. return r;
  56885. },
  56886. flattenJSON: function (e, t, i, n) {
  56887. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  56888. o = e[r++];
  56889. if (void 0 !== o) {
  56890. var a = o[n];
  56891. if (void 0 !== a)
  56892. if (Array.isArray(a)) {
  56893. do
  56894. (a = o[n]),
  56895. void 0 !== a && (t.push(o.time), i.push.apply(i, a)),
  56896. (o = e[r++]);
  56897. while (void 0 !== o);
  56898. } else if (void 0 !== a.toArray) {
  56899. do
  56900. (a = o[n]),
  56901. void 0 !== a &&
  56902. (t.push(o.time), a.toArray(i, i.length)),
  56903. (o = e[r++]);
  56904. while (void 0 !== o);
  56905. } else
  56906. do
  56907. (a = o[n]),
  56908. void 0 !== a && (t.push(o.time), i.push(a)),
  56909. (o = e[r++]);
  56910. while (void 0 !== o);
  56911. }
  56912. },
  56913. }),
  56914. (n.KeyframeTrack = function (e, t, i, r) {
  56915. if (void 0 === e) throw new Error("track name is undefined");
  56916. if (void 0 === t || 0 === t.length)
  56917. throw new Error("no keyframes in track named " + e);
  56918. (this.name = e),
  56919. (this.times = n.AnimationUtils.convertArray(
  56920. t,
  56921. this.TimeBufferType
  56922. )),
  56923. (this.values = n.AnimationUtils.convertArray(
  56924. i,
  56925. this.ValueBufferType
  56926. )),
  56927. this.setInterpolation(r || this.DefaultInterpolation),
  56928. this.validate(),
  56929. this.optimize();
  56930. }),
  56931. (n.KeyframeTrack.prototype = {
  56932. constructor: n.KeyframeTrack,
  56933. TimeBufferType: Float32Array,
  56934. ValueBufferType: Float32Array,
  56935. DefaultInterpolation: n.InterpolateLinear,
  56936. InterpolantFactoryMethodDiscrete: function (e) {
  56937. return new n.DiscreteInterpolant(
  56938. this.times,
  56939. this.values,
  56940. this.getValueSize(),
  56941. e
  56942. );
  56943. },
  56944. InterpolantFactoryMethodLinear: function (e) {
  56945. return new n.LinearInterpolant(
  56946. this.times,
  56947. this.values,
  56948. this.getValueSize(),
  56949. e
  56950. );
  56951. },
  56952. InterpolantFactoryMethodSmooth: function (e) {
  56953. return new n.CubicInterpolant(
  56954. this.times,
  56955. this.values,
  56956. this.getValueSize(),
  56957. e
  56958. );
  56959. },
  56960. setInterpolation: function (e) {
  56961. var t = void 0;
  56962. switch (e) {
  56963. case n.InterpolateDiscrete:
  56964. t = this.InterpolantFactoryMethodDiscrete;
  56965. break;
  56966. case n.InterpolateLinear:
  56967. t = this.InterpolantFactoryMethodLinear;
  56968. break;
  56969. case n.InterpolateSmooth:
  56970. t = this.InterpolantFactoryMethodSmooth;
  56971. }
  56972. if (void 0 === t) {
  56973. var i =
  56974. "unsupported interpolation for " +
  56975. this.ValueTypeName +
  56976. " keyframe track named " +
  56977. this.name;
  56978. if (void 0 === this.createInterpolant) {
  56979. if (e === this.DefaultInterpolation) throw new Error(i);
  56980. this.setInterpolation(this.DefaultInterpolation);
  56981. }
  56982. return void console.warn(i);
  56983. }
  56984. this.createInterpolant = t;
  56985. },
  56986. getInterpolation: function () {
  56987. switch (this.createInterpolant) {
  56988. case this.InterpolantFactoryMethodDiscrete:
  56989. return n.InterpolateDiscrete;
  56990. case this.InterpolantFactoryMethodLinear:
  56991. return n.InterpolateLinear;
  56992. case this.InterpolantFactoryMethodSmooth:
  56993. return n.InterpolateSmooth;
  56994. }
  56995. },
  56996. getValueSize: function () {
  56997. return this.values.length / this.times.length;
  56998. },
  56999. shift: function (e) {
  57000. if (0 !== e)
  57001. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  57002. t[i] += e;
  57003. return this;
  57004. },
  57005. scale: function (e) {
  57006. if (1 !== e)
  57007. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  57008. t[i] *= e;
  57009. return this;
  57010. },
  57011. trim: function (e, t) {
  57012. for (
  57013. var i = this.times, r = i.length, o = 0, a = r - 1;
  57014. o !== r && i[o] < e;
  57015. )
  57016. ++o;
  57017. for (; a !== -1 && i[a] > t; ) --a;
  57018. if ((++a, 0 !== o || a !== r)) {
  57019. o >= a && ((a = Math.max(a, 1)), (o = a - 1));
  57020. var s = this.getValueSize();
  57021. (this.times = n.AnimationUtils.arraySlice(i, o, a)),
  57022. (this.values = n.AnimationUtils.arraySlice(
  57023. this.values,
  57024. o * s,
  57025. a * s
  57026. ));
  57027. }
  57028. return this;
  57029. },
  57030. validate: function () {
  57031. var e = !0,
  57032. t = this.getValueSize();
  57033. t - Math.floor(t) !== 0 &&
  57034. (console.error("invalid value size in track", this), (e = !1));
  57035. var i = this.times,
  57036. r = this.values,
  57037. o = i.length;
  57038. 0 === o && (console.error("track is empty", this), (e = !1));
  57039. for (var a = null, s = 0; s !== o; s++) {
  57040. var l = i[s];
  57041. if ("number" == typeof l && isNaN(l)) {
  57042. console.error("time is not a valid number", this, s, l),
  57043. (e = !1);
  57044. break;
  57045. }
  57046. if (null !== a && a > l) {
  57047. console.error("out of order keys", this, s, l, a), (e = !1);
  57048. break;
  57049. }
  57050. a = l;
  57051. }
  57052. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  57053. for (var s = 0, c = r.length; s !== c; ++s) {
  57054. var h = r[s];
  57055. if (isNaN(h)) {
  57056. console.error("value is not a valid number", this, s, h),
  57057. (e = !1);
  57058. break;
  57059. }
  57060. }
  57061. return e;
  57062. },
  57063. optimize: function () {
  57064. for (
  57065. var e = this.times,
  57066. t = this.values,
  57067. i = this.getValueSize(),
  57068. r = 1,
  57069. o = 1,
  57070. a = e.length - 1;
  57071. o <= a;
  57072. ++o
  57073. ) {
  57074. var s = !1,
  57075. l = e[o],
  57076. c = e[o + 1];
  57077. if (l !== c && (1 !== o || l !== l[0]))
  57078. for (
  57079. var h = o * i, u = h - i, d = h + i, p = 0;
  57080. p !== i;
  57081. ++p
  57082. ) {
  57083. var f = t[h + p];
  57084. if (f !== t[u + p] || f !== t[d + p]) {
  57085. s = !0;
  57086. break;
  57087. }
  57088. }
  57089. if (s) {
  57090. if (o !== r) {
  57091. e[r] = e[o];
  57092. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  57093. t[m + p] = t[g + p];
  57094. }
  57095. ++r;
  57096. }
  57097. }
  57098. return (
  57099. r !== e.length &&
  57100. ((this.times = n.AnimationUtils.arraySlice(e, 0, r)),
  57101. (this.values = n.AnimationUtils.arraySlice(t, 0, r * i))),
  57102. this
  57103. );
  57104. },
  57105. }),
  57106. Object.assign(n.KeyframeTrack, {
  57107. parse: function (e) {
  57108. if (void 0 === e.type)
  57109. throw new Error("track type undefined, can not parse");
  57110. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  57111. if (void 0 === e.times) {
  57112. console.warn("legacy JSON format detected, converting");
  57113. var i = [],
  57114. r = [];
  57115. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  57116. (e.times = i),
  57117. (e.values = r);
  57118. }
  57119. return void 0 !== t.parse
  57120. ? t.parse(e)
  57121. : new t(e.name, e.times, e.values, e.interpolation);
  57122. },
  57123. toJSON: function (e) {
  57124. var t,
  57125. i = e.constructor;
  57126. if (void 0 !== i.toJSON) t = i.toJSON(e);
  57127. else {
  57128. t = {
  57129. name: e.name,
  57130. times: n.AnimationUtils.convertArray(e.times, Array),
  57131. values: n.AnimationUtils.convertArray(e.values, Array),
  57132. };
  57133. var r = e.getInterpolation();
  57134. r !== e.DefaultInterpolation && (t.interpolation = r);
  57135. }
  57136. return (t.type = e.ValueTypeName), t;
  57137. },
  57138. _getTrackTypeForValueTypeName: function (e) {
  57139. switch (e.toLowerCase()) {
  57140. case "scalar":
  57141. case "double":
  57142. case "float":
  57143. case "number":
  57144. case "integer":
  57145. return n.NumberKeyframeTrack;
  57146. case "vector":
  57147. case "vector2":
  57148. case "vector3":
  57149. case "vector4":
  57150. return n.VectorKeyframeTrack;
  57151. case "color":
  57152. return n.ColorKeyframeTrack;
  57153. case "quaternion":
  57154. return n.QuaternionKeyframeTrack;
  57155. case "bool":
  57156. case "boolean":
  57157. return n.BooleanKeyframeTrack;
  57158. case "string":
  57159. return n.StringKeyframeTrack;
  57160. }
  57161. throw new Error("Unsupported typeName: " + e);
  57162. },
  57163. }),
  57164. (n.PropertyBinding = function (e, t, i) {
  57165. (this.path = t),
  57166. (this.parsedPath = i || n.PropertyBinding.parseTrackName(t)),
  57167. (this.node =
  57168. n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e),
  57169. (this.rootNode = e);
  57170. }),
  57171. (n.PropertyBinding.prototype = {
  57172. constructor: n.PropertyBinding,
  57173. getValue: function (e, t) {
  57174. this.bind(), this.getValue(e, t);
  57175. },
  57176. setValue: function (e, t) {
  57177. this.bind(), this.setValue(e, t);
  57178. },
  57179. bind: function () {
  57180. var e = this.node,
  57181. t = this.parsedPath,
  57182. i = t.objectName,
  57183. r = t.propertyName,
  57184. o = t.propertyIndex;
  57185. if (
  57186. (e ||
  57187. ((e =
  57188. n.PropertyBinding.findNode(this.rootNode, t.nodeName) ||
  57189. this.rootNode),
  57190. (this.node = e)),
  57191. (this.getValue = this._getValue_unavailable),
  57192. (this.setValue = this._setValue_unavailable),
  57193. !e)
  57194. )
  57195. return void console.error(
  57196. " trying to update node for track: " +
  57197. this.path +
  57198. " but it wasn't found."
  57199. );
  57200. if (i) {
  57201. var a = t.objectIndex;
  57202. switch (i) {
  57203. case "materials":
  57204. if (!e.material)
  57205. return void console.error(
  57206. " can not bind to material as node does not have a material",
  57207. this
  57208. );
  57209. if (!e.material.materials)
  57210. return void console.error(
  57211. " can not bind to material.materials as node.material does not have a materials array",
  57212. this
  57213. );
  57214. e = e.material.materials;
  57215. break;
  57216. case "bones":
  57217. if (!e.skeleton)
  57218. return void console.error(
  57219. " can not bind to bones as node does not have a skeleton",
  57220. this
  57221. );
  57222. e = e.skeleton.bones;
  57223. for (var s = 0; s < e.length; s++)
  57224. if (e[s].name === a) {
  57225. a = s;
  57226. break;
  57227. }
  57228. break;
  57229. default:
  57230. if (void 0 === e[i])
  57231. return void console.error(
  57232. " can not bind to objectName of node, undefined",
  57233. this
  57234. );
  57235. e = e[i];
  57236. }
  57237. if (void 0 !== a) {
  57238. if (void 0 === e[a])
  57239. return void console.error(
  57240. " trying to bind to objectIndex of objectName, but is undefined:",
  57241. this,
  57242. e
  57243. );
  57244. e = e[a];
  57245. }
  57246. }
  57247. var l = e[r];
  57248. if (!l) {
  57249. var c = t.nodeName;
  57250. return void console.error(
  57251. " trying to update property for track: " +
  57252. c +
  57253. "." +
  57254. r +
  57255. " but it wasn't found.",
  57256. e
  57257. );
  57258. }
  57259. var h = this.Versioning.None;
  57260. void 0 !== e.needsUpdate
  57261. ? ((h = this.Versioning.NeedsUpdate), (this.targetObject = e))
  57262. : void 0 !== e.matrixWorldNeedsUpdate &&
  57263. ((h = this.Versioning.MatrixWorldNeedsUpdate),
  57264. (this.targetObject = e));
  57265. var u = this.BindingType.Direct;
  57266. if (void 0 !== o) {
  57267. if ("morphTargetInfluences" === r) {
  57268. if (!e.geometry)
  57269. return void console.error(
  57270. " can not bind to morphTargetInfluences becasuse node does not have a geometry",
  57271. this
  57272. );
  57273. if (!e.geometry.morphTargets)
  57274. return void console.error(
  57275. " can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets",
  57276. this
  57277. );
  57278. for (
  57279. var s = 0;
  57280. s < this.node.geometry.morphTargets.length;
  57281. s++
  57282. )
  57283. if (e.geometry.morphTargets[s].name === o) {
  57284. o = s;
  57285. break;
  57286. }
  57287. }
  57288. (u = this.BindingType.ArrayElement),
  57289. (this.resolvedProperty = l),
  57290. (this.propertyIndex = o);
  57291. } else
  57292. void 0 !== l.fromArray && void 0 !== l.toArray
  57293. ? ((u = this.BindingType.HasFromToArray),
  57294. (this.resolvedProperty = l))
  57295. : void 0 !== l.length
  57296. ? ((u = this.BindingType.EntireArray),
  57297. (this.resolvedProperty = l))
  57298. : (this.propertyName = r);
  57299. (this.getValue = this.GetterByBindingType[u]),
  57300. (this.setValue = this.SetterByBindingTypeAndVersioning[u][h]);
  57301. },
  57302. unbind: function () {
  57303. (this.node = null),
  57304. (this.getValue = this._getValue_unbound),
  57305. (this.setValue = this._setValue_unbound);
  57306. },
  57307. }),
  57308. Object.assign(n.PropertyBinding.prototype, {
  57309. _getValue_unavailable: function () {},
  57310. _setValue_unavailable: function () {},
  57311. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  57312. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  57313. BindingType: {
  57314. Direct: 0,
  57315. EntireArray: 1,
  57316. ArrayElement: 2,
  57317. HasFromToArray: 3,
  57318. },
  57319. Versioning: {
  57320. None: 0,
  57321. NeedsUpdate: 1,
  57322. MatrixWorldNeedsUpdate: 2,
  57323. },
  57324. GetterByBindingType: [
  57325. function (e, t) {
  57326. e[t] = this.node[this.propertyName];
  57327. },
  57328. function (e, t) {
  57329. for (
  57330. var i = this.resolvedProperty, n = 0, r = i.length;
  57331. n !== r;
  57332. ++n
  57333. )
  57334. e[t++] = i[n];
  57335. },
  57336. function (e, t) {
  57337. e[t] = this.resolvedProperty[this.propertyIndex];
  57338. },
  57339. function (e, t) {
  57340. this.resolvedProperty.toArray(e, t);
  57341. },
  57342. ],
  57343. SetterByBindingTypeAndVersioning: [
  57344. [
  57345. function (e, t) {
  57346. this.node[this.propertyName] = e[t];
  57347. },
  57348. function (e, t) {
  57349. (this.node[this.propertyName] = e[t]),
  57350. (this.targetObject.needsUpdate = !0);
  57351. },
  57352. function (e, t) {
  57353. (this.node[this.propertyName] = e[t]),
  57354. (this.targetObject.matrixWorldNeedsUpdate = !0);
  57355. },
  57356. ],
  57357. [
  57358. function (e, t) {
  57359. for (
  57360. var i = this.resolvedProperty, n = 0, r = i.length;
  57361. n !== r;
  57362. ++n
  57363. )
  57364. i[n] = e[t++];
  57365. },
  57366. function (e, t) {
  57367. for (
  57368. var i = this.resolvedProperty, n = 0, r = i.length;
  57369. n !== r;
  57370. ++n
  57371. )
  57372. i[n] = e[t++];
  57373. this.targetObject.needsUpdate = !0;
  57374. },
  57375. function (e, t) {
  57376. for (
  57377. var i = this.resolvedProperty, n = 0, r = i.length;
  57378. n !== r;
  57379. ++n
  57380. )
  57381. i[n] = e[t++];
  57382. this.targetObject.matrixWorldNeedsUpdate = !0;
  57383. },
  57384. ],
  57385. [
  57386. function (e, t) {
  57387. this.resolvedProperty[this.propertyIndex] = e[t];
  57388. },
  57389. function (e, t) {
  57390. (this.resolvedProperty[this.propertyIndex] = e[t]),
  57391. (this.targetObject.needsUpdate = !0);
  57392. },
  57393. function (e, t) {
  57394. (this.resolvedProperty[this.propertyIndex] = e[t]),
  57395. (this.targetObject.matrixWorldNeedsUpdate = !0);
  57396. },
  57397. ],
  57398. [
  57399. function (e, t) {
  57400. this.resolvedProperty.fromArray(e, t);
  57401. },
  57402. function (e, t) {
  57403. this.resolvedProperty.fromArray(e, t),
  57404. (this.targetObject.needsUpdate = !0);
  57405. },
  57406. function (e, t) {
  57407. this.resolvedProperty.fromArray(e, t),
  57408. (this.targetObject.matrixWorldNeedsUpdate = !0);
  57409. },
  57410. ],
  57411. ],
  57412. }),
  57413. (n.PropertyBinding.Composite = function (e, t, i) {
  57414. var r = i || n.PropertyBinding.parseTrackName(t);
  57415. (this._targetGroup = e), (this._bindings = e.subscribe_(t, r));
  57416. }),
  57417. (n.PropertyBinding.Composite.prototype = {
  57418. constructor: n.PropertyBinding.Composite,
  57419. getValue: function (e, t) {
  57420. this.bind();
  57421. var i = this._targetGroup.nCachedObjects_,
  57422. n = this._bindings[i];
  57423. void 0 !== n && n.getValue(e, t);
  57424. },
  57425. setValue: function (e, t) {
  57426. for (
  57427. var i = this._bindings,
  57428. n = this._targetGroup.nCachedObjects_,
  57429. r = i.length;
  57430. n !== r;
  57431. ++n
  57432. )
  57433. i[n].setValue(e, t);
  57434. },
  57435. bind: function () {
  57436. for (
  57437. var e = this._bindings,
  57438. t = this._targetGroup.nCachedObjects_,
  57439. i = e.length;
  57440. t !== i;
  57441. ++t
  57442. )
  57443. e[t].bind();
  57444. },
  57445. unbind: function () {
  57446. for (
  57447. var e = this._bindings,
  57448. t = this._targetGroup.nCachedObjects_,
  57449. i = e.length;
  57450. t !== i;
  57451. ++t
  57452. )
  57453. e[t].unbind();
  57454. },
  57455. }),
  57456. (n.PropertyBinding.create = function (e, t, i) {
  57457. return e instanceof n.AnimationObjectGroup
  57458. ? new n.PropertyBinding.Composite(e, t, i)
  57459. : new n.PropertyBinding(e, t, i);
  57460. }),
  57461. (n.PropertyBinding.parseTrackName = function (e) {
  57462. var t =
  57463. /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/,
  57464. i = t.exec(e);
  57465. if (!i) throw new Error("cannot parse trackName at all: " + e);
  57466. i.index === t.lastIndex && t.lastIndex++;
  57467. var n = {
  57468. nodeName: i[3],
  57469. objectName: i[5],
  57470. objectIndex: i[7],
  57471. propertyName: i[9],
  57472. propertyIndex: i[11],
  57473. };
  57474. if (null === n.propertyName || 0 === n.propertyName.length)
  57475. throw new Error(
  57476. "can not parse propertyName from trackName: " + e
  57477. );
  57478. return n;
  57479. }),
  57480. (n.PropertyBinding.findNode = function (e, t) {
  57481. if (
  57482. !t ||
  57483. "" === t ||
  57484. "root" === t ||
  57485. "." === t ||
  57486. t === -1 ||
  57487. t === e.name ||
  57488. t === e.uuid
  57489. )
  57490. return e;
  57491. if (e.skeleton) {
  57492. var i = function (e) {
  57493. for (var i = 0; i < e.bones.length; i++) {
  57494. var n = e.bones[i];
  57495. if (n.name === t) return n;
  57496. }
  57497. return null;
  57498. },
  57499. n = i(e.skeleton);
  57500. if (n) return n;
  57501. }
  57502. if (e.children) {
  57503. var r = function (e) {
  57504. for (var i = 0; i < e.length; i++) {
  57505. var n = e[i];
  57506. if (n.name === t || n.uuid === t) return n;
  57507. var o = r(n.children);
  57508. if (o) return o;
  57509. }
  57510. return null;
  57511. },
  57512. o = r(e.children);
  57513. if (o) return o;
  57514. }
  57515. return null;
  57516. }),
  57517. (n.PropertyMixer = function (e, t, i) {
  57518. (this.binding = e), (this.valueSize = i);
  57519. var n,
  57520. r = Float64Array;
  57521. switch (t) {
  57522. case "quaternion":
  57523. n = this._slerp;
  57524. break;
  57525. case "string":
  57526. case "bool":
  57527. (r = Array), (n = this._select);
  57528. break;
  57529. default:
  57530. n = this._lerp;
  57531. }
  57532. (this.buffer = new r(4 * i)),
  57533. (this._mixBufferRegion = n),
  57534. (this.cumulativeWeight = 0),
  57535. (this.useCount = 0),
  57536. (this.referenceCount = 0);
  57537. }),
  57538. (n.PropertyMixer.prototype = {
  57539. constructor: n.PropertyMixer,
  57540. accumulate: function (e, t) {
  57541. var i = this.buffer,
  57542. n = this.valueSize,
  57543. r = e * n + n,
  57544. o = this.cumulativeWeight;
  57545. if (0 === o) {
  57546. for (var a = 0; a !== n; ++a) i[r + a] = i[a];
  57547. o = t;
  57548. } else {
  57549. o += t;
  57550. var s = t / o;
  57551. this._mixBufferRegion(i, r, 0, s, n);
  57552. }
  57553. this.cumulativeWeight = o;
  57554. },
  57555. apply: function (e) {
  57556. var t = this.valueSize,
  57557. i = this.buffer,
  57558. n = e * t + t,
  57559. r = this.cumulativeWeight,
  57560. o = this.binding;
  57561. if (((this.cumulativeWeight = 0), r < 1)) {
  57562. var a = 3 * t;
  57563. this._mixBufferRegion(i, n, a, 1 - r, t);
  57564. }
  57565. for (var s = t, l = t + t; s !== l; ++s)
  57566. if (i[s] !== i[s + t]) {
  57567. o.setValue(i, n);
  57568. break;
  57569. }
  57570. },
  57571. saveOriginalState: function () {
  57572. var e = this.binding,
  57573. t = this.buffer,
  57574. i = this.valueSize,
  57575. n = 3 * i;
  57576. e.getValue(t, n);
  57577. for (var r = i, o = n; r !== o; ++r) t[r] = t[n + (r % i)];
  57578. this.cumulativeWeight = 0;
  57579. },
  57580. restoreOriginalState: function () {
  57581. var e = 3 * this.valueSize;
  57582. this.binding.setValue(this.buffer, e);
  57583. },
  57584. _select: function (e, t, i, n, r) {
  57585. if (n >= 0.5) for (var o = 0; o !== r; ++o) e[t + o] = e[i + o];
  57586. },
  57587. _slerp: function (e, t, i, r, o) {
  57588. n.Quaternion.slerpFlat(e, t, e, t, e, i, r);
  57589. },
  57590. _lerp: function (e, t, i, n, r) {
  57591. for (var o = 1 - n, a = 0; a !== r; ++a) {
  57592. var s = t + a;
  57593. e[s] = e[s] * o + e[i + a] * n;
  57594. }
  57595. },
  57596. }),
  57597. (n.BooleanKeyframeTrack = function (e, t, i) {
  57598. n.KeyframeTrack.call(this, e, t, i);
  57599. }),
  57600. (n.BooleanKeyframeTrack.prototype = Object.assign(
  57601. Object.create(n.KeyframeTrack.prototype),
  57602. {
  57603. constructor: n.BooleanKeyframeTrack,
  57604. ValueTypeName: "bool",
  57605. ValueBufferType: Array,
  57606. DefaultInterpolation: n.IntepolateDiscrete,
  57607. InterpolantFactoryMethodLinear: void 0,
  57608. InterpolantFactoryMethodSmooth: void 0,
  57609. }
  57610. )),
  57611. (n.NumberKeyframeTrack = function (e, t, i, r) {
  57612. n.KeyframeTrack.call(this, e, t, i, r);
  57613. }),
  57614. (n.NumberKeyframeTrack.prototype = Object.assign(
  57615. Object.create(n.KeyframeTrack.prototype),
  57616. {
  57617. constructor: n.NumberKeyframeTrack,
  57618. ValueTypeName: "number",
  57619. }
  57620. )),
  57621. (n.QuaternionKeyframeTrack = function (e, t, i, r) {
  57622. n.KeyframeTrack.call(this, e, t, i, r);
  57623. }),
  57624. (n.QuaternionKeyframeTrack.prototype = Object.assign(
  57625. Object.create(n.KeyframeTrack.prototype),
  57626. {
  57627. constructor: n.QuaternionKeyframeTrack,
  57628. ValueTypeName: "quaternion",
  57629. DefaultInterpolation: n.InterpolateLinear,
  57630. InterpolantFactoryMethodLinear: function (e) {
  57631. return new n.QuaternionLinearInterpolant(
  57632. this.times,
  57633. this.values,
  57634. this.getValueSize(),
  57635. e
  57636. );
  57637. },
  57638. InterpolantFactoryMethodSmooth: void 0,
  57639. }
  57640. )),
  57641. (n.StringKeyframeTrack = function (e, t, i, r) {
  57642. n.KeyframeTrack.call(this, e, t, i, r);
  57643. }),
  57644. (n.StringKeyframeTrack.prototype = Object.assign(
  57645. Object.create(n.KeyframeTrack.prototype),
  57646. {
  57647. constructor: n.StringKeyframeTrack,
  57648. ValueTypeName: "string",
  57649. ValueBufferType: Array,
  57650. DefaultInterpolation: n.IntepolateDiscrete,
  57651. InterpolantFactoryMethodLinear: void 0,
  57652. InterpolantFactoryMethodSmooth: void 0,
  57653. }
  57654. )),
  57655. (n.VectorKeyframeTrack = function (e, t, i, r) {
  57656. n.KeyframeTrack.call(this, e, t, i, r);
  57657. }),
  57658. (n.VectorKeyframeTrack.prototype = Object.assign(
  57659. Object.create(n.KeyframeTrack.prototype),
  57660. {
  57661. constructor: n.VectorKeyframeTrack,
  57662. ValueTypeName: "vector",
  57663. }
  57664. )),
  57665. (n.Audio = function (e) {
  57666. n.Object3D.call(this),
  57667. (this.type = "Audio"),
  57668. (this.context = e.context),
  57669. (this.source = this.context.createBufferSource()),
  57670. (this.source.onended = this.onEnded.bind(this)),
  57671. (this.gain = this.context.createGain()),
  57672. this.gain.connect(e.getInput()),
  57673. (this.autoplay = !1),
  57674. (this.startTime = 0),
  57675. (this.playbackRate = 1),
  57676. (this.isPlaying = !1),
  57677. (this.hasPlaybackControl = !0),
  57678. (this.sourceType = "empty"),
  57679. (this.filter = null);
  57680. }),
  57681. (n.Audio.prototype = Object.create(n.Object3D.prototype)),
  57682. (n.Audio.prototype.constructor = n.Audio),
  57683. (n.Audio.prototype.getOutput = function () {
  57684. return this.gain;
  57685. }),
  57686. (n.Audio.prototype.load = function (e) {
  57687. var t = new n.AudioBuffer(this.context);
  57688. return t.load(e), this.setBuffer(t), this;
  57689. }),
  57690. (n.Audio.prototype.setNodeSource = function (e) {
  57691. return (
  57692. (this.hasPlaybackControl = !1),
  57693. (this.sourceType = "audioNode"),
  57694. (this.source = e),
  57695. this.connect(),
  57696. this
  57697. );
  57698. }),
  57699. (n.Audio.prototype.setBuffer = function (e) {
  57700. var t = this;
  57701. return (
  57702. e.onReady(function (e) {
  57703. (t.source.buffer = e),
  57704. (t.sourceType = "buffer"),
  57705. t.autoplay && t.play();
  57706. }),
  57707. this
  57708. );
  57709. }),
  57710. (n.Audio.prototype.play = function () {
  57711. if (this.isPlaying === !0)
  57712. return void console.warn(
  57713. "THREE.Audio: Audio is already playing."
  57714. );
  57715. if (this.hasPlaybackControl === !1)
  57716. return void console.warn(
  57717. "THREE.Audio: this Audio has no playback control."
  57718. );
  57719. var e = this.context.createBufferSource();
  57720. (e.buffer = this.source.buffer),
  57721. (e.loop = this.source.loop),
  57722. (e.onended = this.source.onended),
  57723. e.start(0, this.startTime),
  57724. (e.playbackRate.value = this.playbackRate),
  57725. (this.isPlaying = !0),
  57726. (this.source = e),
  57727. this.connect();
  57728. }),
  57729. (n.Audio.prototype.pause = function () {
  57730. return this.hasPlaybackControl === !1
  57731. ? void console.warn(
  57732. "THREE.Audio: this Audio has no playback control."
  57733. )
  57734. : (this.source.stop(),
  57735. void (this.startTime = this.context.currentTime));
  57736. }),
  57737. (n.Audio.prototype.stop = function () {
  57738. return this.hasPlaybackControl === !1
  57739. ? void console.warn(
  57740. "THREE.Audio: this Audio has no playback control."
  57741. )
  57742. : (this.source.stop(), void (this.startTime = 0));
  57743. }),
  57744. (n.Audio.prototype.connect = function () {
  57745. null !== this.filter
  57746. ? (this.source.connect(this.filter),
  57747. this.filter.connect(this.getOutput()))
  57748. : this.source.connect(this.getOutput());
  57749. }),
  57750. (n.Audio.prototype.disconnect = function () {
  57751. null !== this.filter
  57752. ? (this.source.disconnect(this.filter),
  57753. this.filter.disconnect(this.getOutput()))
  57754. : this.source.disconnect(this.getOutput());
  57755. }),
  57756. (n.Audio.prototype.getFilter = function () {
  57757. return this.filter;
  57758. }),
  57759. (n.Audio.prototype.setFilter = function (e) {
  57760. void 0 === e && (e = null),
  57761. this.isPlaying === !0
  57762. ? (this.disconnect(), (this.filter = e), this.connect())
  57763. : (this.filter = e);
  57764. }),
  57765. (n.Audio.prototype.setPlaybackRate = function (e) {
  57766. return this.hasPlaybackControl === !1
  57767. ? void console.warn(
  57768. "THREE.Audio: this Audio has no playback control."
  57769. )
  57770. : ((this.playbackRate = e),
  57771. void (
  57772. this.isPlaying === !0 &&
  57773. (this.source.playbackRate.value = this.playbackRate)
  57774. ));
  57775. }),
  57776. (n.Audio.prototype.getPlaybackRate = function () {
  57777. return this.playbackRate;
  57778. }),
  57779. (n.Audio.prototype.onEnded = function () {
  57780. this.isPlaying = !1;
  57781. }),
  57782. (n.Audio.prototype.setLoop = function (e) {
  57783. return this.hasPlaybackControl === !1
  57784. ? void console.warn(
  57785. "THREE.Audio: this Audio has no playback control."
  57786. )
  57787. : void (this.source.loop = e);
  57788. }),
  57789. (n.Audio.prototype.getLoop = function () {
  57790. return this.hasPlaybackControl === !1
  57791. ? (console.warn(
  57792. "THREE.Audio: this Audio has no playback control."
  57793. ),
  57794. !1)
  57795. : this.source.loop;
  57796. }),
  57797. (n.Audio.prototype.setVolume = function (e) {
  57798. this.gain.gain.value = e;
  57799. }),
  57800. (n.Audio.prototype.getVolume = function () {
  57801. return this.gain.gain.value;
  57802. }),
  57803. (n.AudioAnalyser = function (e, t) {
  57804. (this.analyser = e.context.createAnalyser()),
  57805. (this.analyser.fftSize = void 0 !== t ? t : 2048),
  57806. (this.data = new Uint8Array(this.analyser.frequencyBinCount)),
  57807. e.getOutput().connect(this.analyser);
  57808. }),
  57809. (n.AudioAnalyser.prototype = {
  57810. constructor: n.AudioAnalyser,
  57811. getData: function () {
  57812. return this.analyser.getByteFrequencyData(this.data), this.data;
  57813. },
  57814. }),
  57815. (n.AudioBuffer = function (e) {
  57816. (this.context = e), (this.ready = !1), (this.readyCallbacks = []);
  57817. }),
  57818. (n.AudioBuffer.prototype.load = function (e) {
  57819. var t = this,
  57820. i = new XMLHttpRequest();
  57821. return (
  57822. i.open("GET", e, !0),
  57823. (i.responseType = "arraybuffer"),
  57824. (i.onload = function (e) {
  57825. t.context.decodeAudioData(this.response, function (e) {
  57826. (t.buffer = e), (t.ready = !0);
  57827. for (var i = 0; i < t.readyCallbacks.length; i++)
  57828. t.readyCallbacks[i](t.buffer);
  57829. t.readyCallbacks = [];
  57830. });
  57831. }),
  57832. i.send(),
  57833. this
  57834. );
  57835. }),
  57836. (n.AudioBuffer.prototype.onReady = function (e) {
  57837. this.ready ? e(this.buffer) : this.readyCallbacks.push(e);
  57838. }),
  57839. (n.PositionalAudio = function (e) {
  57840. n.Audio.call(this, e),
  57841. (this.panner = this.context.createPanner()),
  57842. this.panner.connect(this.gain);
  57843. }),
  57844. (n.PositionalAudio.prototype = Object.create(n.Audio.prototype)),
  57845. (n.PositionalAudio.prototype.constructor = n.PositionalAudio),
  57846. (n.PositionalAudio.prototype.getOutput = function () {
  57847. return this.panner;
  57848. }),
  57849. (n.PositionalAudio.prototype.setRefDistance = function (e) {
  57850. this.panner.refDistance = e;
  57851. }),
  57852. (n.PositionalAudio.prototype.getRefDistance = function () {
  57853. return this.panner.refDistance;
  57854. }),
  57855. (n.PositionalAudio.prototype.setRolloffFactor = function (e) {
  57856. this.panner.rolloffFactor = e;
  57857. }),
  57858. (n.PositionalAudio.prototype.getRolloffFactor = function () {
  57859. return this.panner.rolloffFactor;
  57860. }),
  57861. (n.PositionalAudio.prototype.setDistanceModel = function (e) {
  57862. this.panner.distanceModel = e;
  57863. }),
  57864. (n.PositionalAudio.prototype.getDistanceModel = function () {
  57865. return this.panner.distanceModel;
  57866. }),
  57867. (n.PositionalAudio.prototype.setMaxDistance = function (e) {
  57868. this.panner.maxDistance = e;
  57869. }),
  57870. (n.PositionalAudio.prototype.getMaxDistance = function () {
  57871. return this.panner.maxDistance;
  57872. }),
  57873. (n.PositionalAudio.prototype.updateMatrixWorld = (function () {
  57874. var e = new n.Vector3();
  57875. return function (t) {
  57876. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  57877. e.setFromMatrixPosition(this.matrixWorld),
  57878. this.panner.setPosition(e.x, e.y, e.z);
  57879. };
  57880. })()),
  57881. (n.AudioListener = function () {
  57882. n.Object3D.call(this),
  57883. (this.type = "AudioListener"),
  57884. (this.context = new (window.AudioContext ||
  57885. window.webkitAudioContext)()),
  57886. (this.gain = this.context.createGain()),
  57887. this.gain.connect(this.context.destination),
  57888. (this.filter = null);
  57889. }),
  57890. (n.AudioListener.prototype = Object.create(n.Object3D.prototype)),
  57891. (n.AudioListener.prototype.constructor = n.AudioListener),
  57892. (n.AudioListener.prototype.getInput = function () {
  57893. return this.gain;
  57894. }),
  57895. (n.AudioListener.prototype.removeFilter = function () {
  57896. null !== this.filter &&
  57897. (this.gain.disconnect(this.filter),
  57898. this.filter.disconnect(this.context.destination),
  57899. this.gain.connect(this.context.destination),
  57900. (this.filter = null));
  57901. }),
  57902. (n.AudioListener.prototype.setFilter = function (e) {
  57903. null !== this.filter
  57904. ? (this.gain.disconnect(this.filter),
  57905. this.filter.disconnect(this.context.destination))
  57906. : this.gain.disconnect(this.context.destination),
  57907. (this.filter = e),
  57908. this.gain.connect(this.filter),
  57909. this.filter.connect(this.context.destination);
  57910. }),
  57911. (n.AudioListener.prototype.getFilter = function () {
  57912. return this.filter;
  57913. }),
  57914. (n.AudioListener.prototype.setMasterVolume = function (e) {
  57915. this.gain.gain.value = e;
  57916. }),
  57917. (n.AudioListener.prototype.getMasterVolume = function () {
  57918. return this.gain.gain.value;
  57919. }),
  57920. (n.AudioListener.prototype.updateMatrixWorld = (function () {
  57921. var e = new n.Vector3(),
  57922. t = new n.Quaternion(),
  57923. i = new n.Vector3(),
  57924. r = new n.Vector3();
  57925. return function (o) {
  57926. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  57927. var a = this.context.listener,
  57928. s = this.up;
  57929. this.matrixWorld.decompose(e, t, i),
  57930. r.set(0, 0, -1).applyQuaternion(t),
  57931. a.setPosition(e.x, e.y, e.z),
  57932. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z);
  57933. };
  57934. })()),
  57935. (n.Camera = function () {
  57936. n.Object3D.call(this),
  57937. (this.type = "Camera"),
  57938. (this.matrixWorldInverse = new n.Matrix4()),
  57939. (this.projectionMatrix = new n.Matrix4());
  57940. }),
  57941. (n.Camera.prototype = Object.create(n.Object3D.prototype)),
  57942. (n.Camera.prototype.constructor = n.Camera),
  57943. (n.Camera.prototype.getWorldDirection = (function () {
  57944. var e = new n.Quaternion();
  57945. return function (t) {
  57946. var i = t || new n.Vector3();
  57947. return (
  57948. this.getWorldQuaternion(e), i.set(0, 0, -1).applyQuaternion(e)
  57949. );
  57950. };
  57951. })()),
  57952. (n.Camera.prototype.lookAt = (function () {
  57953. var e = new n.Matrix4();
  57954. return function (t) {
  57955. e.lookAt(this.position, t, this.up),
  57956. this.quaternion.setFromRotationMatrix(e);
  57957. };
  57958. })()),
  57959. (n.Camera.prototype.clone = function () {
  57960. return new this.constructor().copy(this);
  57961. }),
  57962. (n.Camera.prototype.copy = function (e) {
  57963. return (
  57964. n.Object3D.prototype.copy.call(this, e),
  57965. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  57966. this.projectionMatrix.copy(e.projectionMatrix),
  57967. this
  57968. );
  57969. }),
  57970. (n.CubeCamera = function (e, t, i) {
  57971. n.Object3D.call(this), (this.type = "CubeCamera");
  57972. var r = 90,
  57973. o = 1,
  57974. a = new n.PerspectiveCamera(r, o, e, t);
  57975. a.up.set(0, -1, 0), a.lookAt(new n.Vector3(1, 0, 0)), this.add(a);
  57976. var s = new n.PerspectiveCamera(r, o, e, t);
  57977. s.up.set(0, -1, 0), s.lookAt(new n.Vector3(-1, 0, 0)), this.add(s);
  57978. var l = new n.PerspectiveCamera(r, o, e, t);
  57979. l.up.set(0, 0, 1), l.lookAt(new n.Vector3(0, 1, 0)), this.add(l);
  57980. var c = new n.PerspectiveCamera(r, o, e, t);
  57981. c.up.set(0, 0, -1), c.lookAt(new n.Vector3(0, -1, 0)), this.add(c);
  57982. var h = new n.PerspectiveCamera(r, o, e, t);
  57983. h.up.set(0, -1, 0), h.lookAt(new n.Vector3(0, 0, 1)), this.add(h);
  57984. var u = new n.PerspectiveCamera(r, o, e, t);
  57985. u.up.set(0, -1, 0), u.lookAt(new n.Vector3(0, 0, -1)), this.add(u);
  57986. var d = {
  57987. format: n.RGBFormat,
  57988. magFilter: n.LinearFilter,
  57989. minFilter: n.LinearFilter,
  57990. };
  57991. (this.renderTarget = new n.WebGLRenderTargetCube(i, i, d)),
  57992. (this.updateCubeMap = function (e, t) {
  57993. null === this.parent && this.updateMatrixWorld();
  57994. var i = this.renderTarget,
  57995. n = i.texture.generateMipmaps;
  57996. (i.texture.generateMipmaps = !1),
  57997. (i.activeCubeFace = 0),
  57998. e.render(t, a, i),
  57999. (i.activeCubeFace = 1),
  58000. e.render(t, s, i),
  58001. (i.activeCubeFace = 2),
  58002. e.render(t, l, i),
  58003. (i.activeCubeFace = 3),
  58004. e.render(t, c, i),
  58005. (i.activeCubeFace = 4),
  58006. e.render(t, h, i),
  58007. (i.texture.generateMipmaps = n),
  58008. (i.activeCubeFace = 5),
  58009. e.render(t, u, i),
  58010. e.setRenderTarget(null);
  58011. });
  58012. }),
  58013. (n.CubeCamera.prototype = Object.create(n.Object3D.prototype)),
  58014. (n.CubeCamera.prototype.constructor = n.CubeCamera),
  58015. (n.OrthographicCamera = function (e, t, i, r, o, a) {
  58016. n.Camera.call(this),
  58017. (this.type = "OrthographicCamera"),
  58018. (this.zoom = 1),
  58019. (this.left = e),
  58020. (this.right = t),
  58021. (this.top = i),
  58022. (this.bottom = r),
  58023. (this.near = void 0 !== o ? o : 0.1),
  58024. (this.far = void 0 !== a ? a : 2e3),
  58025. this.updateProjectionMatrix();
  58026. }),
  58027. (n.OrthographicCamera.prototype = Object.create(n.Camera.prototype)),
  58028. (n.OrthographicCamera.prototype.constructor = n.OrthographicCamera),
  58029. (n.OrthographicCamera.prototype.updateProjectionMatrix = function () {
  58030. var e = (this.right - this.left) / (2 * this.zoom),
  58031. t = (this.top - this.bottom) / (2 * this.zoom),
  58032. i = (this.right + this.left) / 2,
  58033. n = (this.top + this.bottom) / 2;
  58034. this.projectionMatrix.makeOrthographic(
  58035. i - e,
  58036. i + e,
  58037. n + t,
  58038. n - t,
  58039. this.near,
  58040. this.far
  58041. );
  58042. }),
  58043. (n.OrthographicCamera.prototype.copy = function (e) {
  58044. return (
  58045. n.Camera.prototype.copy.call(this, e),
  58046. (this.left = e.left),
  58047. (this.right = e.right),
  58048. (this.top = e.top),
  58049. (this.bottom = e.bottom),
  58050. (this.near = e.near),
  58051. (this.far = e.far),
  58052. (this.zoom = e.zoom),
  58053. this
  58054. );
  58055. }),
  58056. (n.OrthographicCamera.prototype.toJSON = function (e) {
  58057. var t = n.Object3D.prototype.toJSON.call(this, e);
  58058. return (
  58059. (t.object.zoom = this.zoom),
  58060. (t.object.left = this.left),
  58061. (t.object.right = this.right),
  58062. (t.object.top = this.top),
  58063. (t.object.bottom = this.bottom),
  58064. (t.object.near = this.near),
  58065. (t.object.far = this.far),
  58066. t
  58067. );
  58068. }),
  58069. (n.PerspectiveCamera = function (e, t, i, r) {
  58070. n.Camera.call(this),
  58071. (this.type = "PerspectiveCamera"),
  58072. (this.focalLength = 10),
  58073. (this.zoom = 1),
  58074. (this.fov = void 0 !== e ? e : 50),
  58075. (this.aspect = void 0 !== t ? t : 1),
  58076. (this.near = void 0 !== i ? i : 0.1),
  58077. (this.far = void 0 !== r ? r : 2e3),
  58078. this.updateProjectionMatrix();
  58079. }),
  58080. (n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype)),
  58081. (n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera),
  58082. (n.PerspectiveCamera.prototype.setLens = function (e, t) {
  58083. void 0 === t && (t = 24),
  58084. (this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e)))),
  58085. this.updateProjectionMatrix();
  58086. }),
  58087. (n.PerspectiveCamera.prototype.setViewOffset = function (
  58088. e,
  58089. t,
  58090. i,
  58091. n,
  58092. r,
  58093. o
  58094. ) {
  58095. (this.fullWidth = e),
  58096. (this.fullHeight = t),
  58097. (this.x = i),
  58098. (this.y = n),
  58099. (this.width = r),
  58100. (this.height = o),
  58101. this.updateProjectionMatrix();
  58102. }),
  58103. (n.PerspectiveCamera.prototype.updateProjectionMatrix = function () {
  58104. var e = n.Math.radToDeg(
  58105. 2 *
  58106. Math.atan(Math.tan(0.5 * n.Math.degToRad(this.fov)) / this.zoom)
  58107. );
  58108. if (this.fullWidth) {
  58109. var t = this.fullWidth / this.fullHeight,
  58110. i = Math.tan(n.Math.degToRad(0.5 * e)) * this.near,
  58111. r = -i,
  58112. o = t * r,
  58113. a = t * i,
  58114. s = Math.abs(a - o),
  58115. l = Math.abs(i - r);
  58116. this.projectionMatrix.makeFrustum(
  58117. o + (this.x * s) / this.fullWidth,
  58118. o + ((this.x + this.width) * s) / this.fullWidth,
  58119. i - ((this.y + this.height) * l) / this.fullHeight,
  58120. i - (this.y * l) / this.fullHeight,
  58121. this.near,
  58122. this.far
  58123. );
  58124. } else
  58125. this.projectionMatrix.makePerspective(
  58126. e,
  58127. this.aspect,
  58128. this.near,
  58129. this.far
  58130. );
  58131. }),
  58132. (n.PerspectiveCamera.prototype.copy = function (e) {
  58133. return (
  58134. n.Camera.prototype.copy.call(this, e),
  58135. (this.focalLength = e.focalLength),
  58136. (this.zoom = e.zoom),
  58137. (this.fov = e.fov),
  58138. (this.aspect = e.aspect),
  58139. (this.near = e.near),
  58140. (this.far = e.far),
  58141. this
  58142. );
  58143. }),
  58144. (n.PerspectiveCamera.prototype.toJSON = function (e) {
  58145. var t = n.Object3D.prototype.toJSON.call(this, e);
  58146. return (
  58147. (t.object.focalLength = this.focalLength),
  58148. (t.object.zoom = this.zoom),
  58149. (t.object.fov = this.fov),
  58150. (t.object.aspect = this.aspect),
  58151. (t.object.near = this.near),
  58152. (t.object.far = this.far),
  58153. t
  58154. );
  58155. }),
  58156. (n.StereoCamera = function () {
  58157. (this.type = "StereoCamera"),
  58158. (this.aspect = 1),
  58159. (this.cameraL = new n.PerspectiveCamera()),
  58160. this.cameraL.layers.enable(1),
  58161. (this.cameraL.matrixAutoUpdate = !1),
  58162. (this.cameraR = new n.PerspectiveCamera()),
  58163. this.cameraR.layers.enable(2),
  58164. (this.cameraR.matrixAutoUpdate = !1);
  58165. }),
  58166. (n.StereoCamera.prototype = {
  58167. constructor: n.StereoCamera,
  58168. update: (function () {
  58169. var e,
  58170. t,
  58171. i,
  58172. r,
  58173. o,
  58174. a = new n.Matrix4(),
  58175. s = new n.Matrix4();
  58176. return function (l) {
  58177. var c =
  58178. e !== l.focalLength ||
  58179. t !== l.fov ||
  58180. i !== l.aspect * this.aspect ||
  58181. r !== l.near ||
  58182. o !== l.far;
  58183. if (c) {
  58184. (e = l.focalLength),
  58185. (t = l.fov),
  58186. (i = l.aspect * this.aspect),
  58187. (r = l.near),
  58188. (o = l.far);
  58189. var h,
  58190. u,
  58191. d = l.projectionMatrix.clone(),
  58192. p = 0.032,
  58193. f = (p * r) / e,
  58194. g = r * Math.tan(n.Math.degToRad(0.5 * t));
  58195. (s.elements[12] = -p),
  58196. (a.elements[12] = p),
  58197. (h = -g * i + f),
  58198. (u = g * i + f),
  58199. (d.elements[0] = (2 * r) / (u - h)),
  58200. (d.elements[8] = (u + h) / (u - h)),
  58201. this.cameraL.projectionMatrix.copy(d),
  58202. (h = -g * i - f),
  58203. (u = g * i - f),
  58204. (d.elements[0] = (2 * r) / (u - h)),
  58205. (d.elements[8] = (u + h) / (u - h)),
  58206. this.cameraR.projectionMatrix.copy(d);
  58207. }
  58208. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  58209. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a);
  58210. };
  58211. })(),
  58212. }),
  58213. (n.Light = function (e, t) {
  58214. n.Object3D.call(this),
  58215. (this.type = "Light"),
  58216. (this.color = new n.Color(e)),
  58217. (this.intensity = void 0 !== t ? t : 1),
  58218. (this.receiveShadow = void 0);
  58219. }),
  58220. (n.Light.prototype = Object.create(n.Object3D.prototype)),
  58221. (n.Light.prototype.constructor = n.Light),
  58222. (n.Light.prototype.copy = function (e) {
  58223. return (
  58224. n.Object3D.prototype.copy.call(this, e),
  58225. this.color.copy(e.color),
  58226. (this.intensity = e.intensity),
  58227. this
  58228. );
  58229. }),
  58230. (n.Light.prototype.toJSON = function (e) {
  58231. var t = n.Object3D.prototype.toJSON.call(this, e);
  58232. return (
  58233. (t.object.color = this.color.getHex()),
  58234. (t.object.intensity = this.intensity),
  58235. void 0 !== this.groundColor &&
  58236. (t.object.groundColor = this.groundColor.getHex()),
  58237. void 0 !== this.distance && (t.object.distance = this.distance),
  58238. void 0 !== this.angle && (t.object.angle = this.angle),
  58239. void 0 !== this.decay && (t.object.decay = this.decay),
  58240. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  58241. t
  58242. );
  58243. }),
  58244. (n.LightShadow = function (e) {
  58245. (this.camera = e),
  58246. (this.bias = 0),
  58247. (this.radius = 1),
  58248. (this.mapSize = new n.Vector2(512, 512)),
  58249. (this.map = null),
  58250. (this.matrix = new n.Matrix4());
  58251. }),
  58252. (n.LightShadow.prototype = {
  58253. constructor: n.LightShadow,
  58254. copy: function (e) {
  58255. return (
  58256. (this.camera = e.camera.clone()),
  58257. (this.bias = e.bias),
  58258. (this.radius = e.radius),
  58259. this.mapSize.copy(e.mapSize),
  58260. this
  58261. );
  58262. },
  58263. clone: function () {
  58264. return new this.constructor().copy(this);
  58265. },
  58266. }),
  58267. (n.AmbientLight = function (e, t) {
  58268. n.Light.call(this, e, t),
  58269. (this.type = "AmbientLight"),
  58270. (this.castShadow = void 0);
  58271. }),
  58272. (n.AmbientLight.prototype = Object.create(n.Light.prototype)),
  58273. (n.AmbientLight.prototype.constructor = n.AmbientLight),
  58274. (n.DirectionalLight = function (e, t) {
  58275. n.Light.call(this, e, t),
  58276. (this.type = "DirectionalLight"),
  58277. this.position.set(0, 1, 0),
  58278. this.updateMatrix(),
  58279. (this.target = new n.Object3D()),
  58280. (this.shadow = new n.LightShadow(
  58281. new n.OrthographicCamera(-5, 5, 5, -5, 0.5, 500)
  58282. ));
  58283. }),
  58284. (n.DirectionalLight.prototype = Object.create(n.Light.prototype)),
  58285. (n.DirectionalLight.prototype.constructor = n.DirectionalLight),
  58286. (n.DirectionalLight.prototype.copy = function (e) {
  58287. return (
  58288. n.Light.prototype.copy.call(this, e),
  58289. (this.target = e.target.clone()),
  58290. (this.shadow = e.shadow.clone()),
  58291. this
  58292. );
  58293. }),
  58294. (n.HemisphereLight = function (e, t, i) {
  58295. n.Light.call(this, e, i),
  58296. (this.type = "HemisphereLight"),
  58297. (this.castShadow = void 0),
  58298. this.position.set(0, 1, 0),
  58299. this.updateMatrix(),
  58300. (this.groundColor = new n.Color(t));
  58301. }),
  58302. (n.HemisphereLight.prototype = Object.create(n.Light.prototype)),
  58303. (n.HemisphereLight.prototype.constructor = n.HemisphereLight),
  58304. (n.HemisphereLight.prototype.copy = function (e) {
  58305. return (
  58306. n.Light.prototype.copy.call(this, e),
  58307. this.groundColor.copy(e.groundColor),
  58308. this
  58309. );
  58310. }),
  58311. (n.PointLight = function (e, t, i, r) {
  58312. n.Light.call(this, e, t),
  58313. (this.type = "PointLight"),
  58314. (this.distance = void 0 !== i ? i : 0),
  58315. (this.decay = void 0 !== r ? r : 1),
  58316. (this.shadow = new n.LightShadow(
  58317. new n.PerspectiveCamera(90, 1, 0.5, 500)
  58318. ));
  58319. }),
  58320. (n.PointLight.prototype = Object.create(n.Light.prototype)),
  58321. (n.PointLight.prototype.constructor = n.PointLight),
  58322. Object.defineProperty(n.PointLight.prototype, "power", {
  58323. get: function () {
  58324. return 4 * this.intensity * Math.PI;
  58325. },
  58326. set: function (e) {
  58327. this.intensity = e / (4 * Math.PI);
  58328. },
  58329. }),
  58330. (n.PointLight.prototype.copy = function (e) {
  58331. return (
  58332. n.Light.prototype.copy.call(this, e),
  58333. (this.distance = e.distance),
  58334. (this.decay = e.decay),
  58335. (this.shadow = e.shadow.clone()),
  58336. this
  58337. );
  58338. }),
  58339. (n.SpotLight = function (e, t, i, r, o, a) {
  58340. n.Light.call(this, e, t),
  58341. (this.type = "SpotLight"),
  58342. this.position.set(0, 1, 0),
  58343. this.updateMatrix(),
  58344. (this.target = new n.Object3D()),
  58345. (this.distance = void 0 !== i ? i : 0),
  58346. (this.angle = void 0 !== r ? r : Math.PI / 3),
  58347. (this.penumbra = void 0 !== o ? o : 0),
  58348. (this.decay = void 0 !== a ? a : 1),
  58349. (this.shadow = new n.LightShadow(
  58350. new n.PerspectiveCamera(50, 1, 0.5, 500)
  58351. ));
  58352. }),
  58353. (n.SpotLight.prototype = Object.create(n.Light.prototype)),
  58354. (n.SpotLight.prototype.constructor = n.SpotLight),
  58355. Object.defineProperty(n.SpotLight.prototype, "power", {
  58356. get: function () {
  58357. return this.intensity * Math.PI;
  58358. },
  58359. set: function (e) {
  58360. this.intensity = e / Math.PI;
  58361. },
  58362. }),
  58363. (n.SpotLight.prototype.copy = function (e) {
  58364. return (
  58365. n.Light.prototype.copy.call(this, e),
  58366. (this.distance = e.distance),
  58367. (this.angle = e.angle),
  58368. (this.penumbra = e.penumbra),
  58369. (this.decay = e.decay),
  58370. (this.target = e.target.clone()),
  58371. (this.shadow = e.shadow.clone()),
  58372. this
  58373. );
  58374. }),
  58375. (n.Cache = {
  58376. enabled: !1,
  58377. files: {},
  58378. add: function (e, t) {
  58379. this.enabled !== !1 && (this.files[e] = t);
  58380. },
  58381. get: function (e) {
  58382. if (this.enabled !== !1) return this.files[e];
  58383. },
  58384. remove: function (e) {
  58385. delete this.files[e];
  58386. },
  58387. clear: function () {
  58388. this.files = {};
  58389. },
  58390. }),
  58391. (n.Loader = function () {
  58392. (this.onLoadStart = function () {}),
  58393. (this.onLoadProgress = function () {}),
  58394. (this.onLoadComplete = function () {});
  58395. }),
  58396. (n.Loader.prototype = {
  58397. constructor: n.Loader,
  58398. crossOrigin: void 0,
  58399. extractUrlBase: function (e) {
  58400. var t = e.split("/");
  58401. return 1 === t.length ? "./" : (t.pop(), t.join("/") + "/");
  58402. },
  58403. initMaterials: function (e, t, i) {
  58404. for (var n = [], r = 0; r < e.length; ++r)
  58405. n[r] = this.createMaterial(e[r], t, i);
  58406. return n;
  58407. },
  58408. createMaterial: (function () {
  58409. var e, t, i;
  58410. return function (r, o, a) {
  58411. function s(e, i, r, s, c) {
  58412. var h,
  58413. u = o + e,
  58414. d = n.Loader.Handlers.get(u);
  58415. null !== d
  58416. ? (h = d.load(u))
  58417. : (t.setCrossOrigin(a), (h = t.load(u))),
  58418. void 0 !== i &&
  58419. (h.repeat.fromArray(i),
  58420. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  58421. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  58422. void 0 !== r && h.offset.fromArray(r),
  58423. void 0 !== s &&
  58424. ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  58425. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  58426. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  58427. "mirror" === s[1] &&
  58428. (h.wrapT = n.MirroredRepeatWrapping)),
  58429. void 0 !== c && (h.anisotropy = c);
  58430. var p = n.Math.generateUUID();
  58431. return (l[p] = h), p;
  58432. }
  58433. void 0 === e && (e = new n.Color()),
  58434. void 0 === t && (t = new n.TextureLoader()),
  58435. void 0 === i && (i = new n.MaterialLoader());
  58436. var l = {},
  58437. c = {
  58438. uuid: n.Math.generateUUID(),
  58439. type: "MeshLambertMaterial",
  58440. };
  58441. for (var h in r) {
  58442. var u = r[h];
  58443. switch (h) {
  58444. case "DbgColor":
  58445. case "DbgIndex":
  58446. case "opticalDensity":
  58447. case "illumination":
  58448. break;
  58449. case "DbgName":
  58450. c.name = u;
  58451. break;
  58452. case "blending":
  58453. c.blending = n[u];
  58454. break;
  58455. case "colorAmbient":
  58456. case "mapAmbient":
  58457. console.warn(
  58458. "THREE.Loader.createMaterial:",
  58459. h,
  58460. "is no longer supported."
  58461. );
  58462. break;
  58463. case "colorDiffuse":
  58464. c.color = e.fromArray(u).getHex();
  58465. break;
  58466. case "colorSpecular":
  58467. c.specular = e.fromArray(u).getHex();
  58468. break;
  58469. case "colorEmissive":
  58470. c.emissive = e.fromArray(u).getHex();
  58471. break;
  58472. case "specularCoef":
  58473. c.shininess = u;
  58474. break;
  58475. case "shading":
  58476. "basic" === u.toLowerCase() &&
  58477. (c.type = "MeshBasicMaterial"),
  58478. "phong" === u.toLowerCase() &&
  58479. (c.type = "MeshPhongMaterial");
  58480. break;
  58481. case "mapDiffuse":
  58482. c.map = s(
  58483. u,
  58484. r.mapDiffuseRepeat,
  58485. r.mapDiffuseOffset,
  58486. r.mapDiffuseWrap,
  58487. r.mapDiffuseAnisotropy
  58488. );
  58489. break;
  58490. case "mapDiffuseRepeat":
  58491. case "mapDiffuseOffset":
  58492. case "mapDiffuseWrap":
  58493. case "mapDiffuseAnisotropy":
  58494. break;
  58495. case "mapLight":
  58496. c.lightMap = s(
  58497. u,
  58498. r.mapLightRepeat,
  58499. r.mapLightOffset,
  58500. r.mapLightWrap,
  58501. r.mapLightAnisotropy
  58502. );
  58503. break;
  58504. case "mapLightRepeat":
  58505. case "mapLightOffset":
  58506. case "mapLightWrap":
  58507. case "mapLightAnisotropy":
  58508. break;
  58509. case "mapAO":
  58510. c.aoMap = s(
  58511. u,
  58512. r.mapAORepeat,
  58513. r.mapAOOffset,
  58514. r.mapAOWrap,
  58515. r.mapAOAnisotropy
  58516. );
  58517. break;
  58518. case "mapAORepeat":
  58519. case "mapAOOffset":
  58520. case "mapAOWrap":
  58521. case "mapAOAnisotropy":
  58522. break;
  58523. case "mapBump":
  58524. c.bumpMap = s(
  58525. u,
  58526. r.mapBumpRepeat,
  58527. r.mapBumpOffset,
  58528. r.mapBumpWrap,
  58529. r.mapBumpAnisotropy
  58530. );
  58531. break;
  58532. case "mapBumpScale":
  58533. c.bumpScale = u;
  58534. break;
  58535. case "mapBumpRepeat":
  58536. case "mapBumpOffset":
  58537. case "mapBumpWrap":
  58538. case "mapBumpAnisotropy":
  58539. break;
  58540. case "mapNormal":
  58541. c.normalMap = s(
  58542. u,
  58543. r.mapNormalRepeat,
  58544. r.mapNormalOffset,
  58545. r.mapNormalWrap,
  58546. r.mapNormalAnisotropy
  58547. );
  58548. break;
  58549. case "mapNormalFactor":
  58550. c.normalScale = [u, u];
  58551. break;
  58552. case "mapNormalRepeat":
  58553. case "mapNormalOffset":
  58554. case "mapNormalWrap":
  58555. case "mapNormalAnisotropy":
  58556. break;
  58557. case "mapSpecular":
  58558. c.specularMap = s(
  58559. u,
  58560. r.mapSpecularRepeat,
  58561. r.mapSpecularOffset,
  58562. r.mapSpecularWrap,
  58563. r.mapSpecularAnisotropy
  58564. );
  58565. break;
  58566. case "mapSpecularRepeat":
  58567. case "mapSpecularOffset":
  58568. case "mapSpecularWrap":
  58569. case "mapSpecularAnisotropy":
  58570. break;
  58571. case "mapAlpha":
  58572. c.alphaMap = s(
  58573. u,
  58574. r.mapAlphaRepeat,
  58575. r.mapAlphaOffset,
  58576. r.mapAlphaWrap,
  58577. r.mapAlphaAnisotropy
  58578. );
  58579. break;
  58580. case "mapAlphaRepeat":
  58581. case "mapAlphaOffset":
  58582. case "mapAlphaWrap":
  58583. case "mapAlphaAnisotropy":
  58584. break;
  58585. case "flipSided":
  58586. c.side = n.BackSide;
  58587. break;
  58588. case "doubleSided":
  58589. c.side = n.DoubleSide;
  58590. break;
  58591. case "transparency":
  58592. console.warn(
  58593. "THREE.Loader.createMaterial: transparency has been renamed to opacity"
  58594. ),
  58595. (c.opacity = u);
  58596. break;
  58597. case "depthTest":
  58598. case "depthWrite":
  58599. case "colorWrite":
  58600. case "opacity":
  58601. case "reflectivity":
  58602. case "transparent":
  58603. case "visible":
  58604. case "wireframe":
  58605. c[h] = u;
  58606. break;
  58607. case "vertexColors":
  58608. u === !0 && (c.vertexColors = n.VertexColors),
  58609. "face" === u && (c.vertexColors = n.FaceColors);
  58610. break;
  58611. default:
  58612. console.error(
  58613. "THREE.Loader.createMaterial: Unsupported",
  58614. h,
  58615. u
  58616. );
  58617. }
  58618. }
  58619. return (
  58620. "MeshBasicMaterial" === c.type && delete c.emissive,
  58621. "MeshPhongMaterial" !== c.type && delete c.specular,
  58622. c.opacity < 1 && (c.transparent = !0),
  58623. i.setTextures(l),
  58624. i.parse(c)
  58625. );
  58626. };
  58627. })(),
  58628. }),
  58629. (n.Loader.Handlers = {
  58630. handlers: [],
  58631. add: function (e, t) {
  58632. this.handlers.push(e, t);
  58633. },
  58634. get: function (e) {
  58635. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  58636. var r = t[i],
  58637. o = t[i + 1];
  58638. if (r.test(e)) return o;
  58639. }
  58640. return null;
  58641. },
  58642. }),
  58643. (n.XHRLoader = function (e) {
  58644. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  58645. }),
  58646. (n.XHRLoader.prototype = {
  58647. constructor: n.XHRLoader,
  58648. load: function (e, t, i, r) {
  58649. void 0 !== this.path && (e = this.path + e);
  58650. var o = this,
  58651. a = n.Cache.get(e);
  58652. if (void 0 !== a)
  58653. return (
  58654. t &&
  58655. setTimeout(function () {
  58656. t(a);
  58657. }, 0),
  58658. a
  58659. );
  58660. var s = new XMLHttpRequest();
  58661. return (
  58662. s.overrideMimeType("text/plain"),
  58663. s.open("GET", e, !0),
  58664. s.addEventListener(
  58665. "load",
  58666. function (i) {
  58667. var a = i.target.response;
  58668. n.Cache.add(e, a),
  58669. 200 === this.status
  58670. ? (t && t(a), o.manager.itemEnd(e))
  58671. : 0 === this.status
  58672. ? (console.warn(
  58673. "THREE.XHRLoader: HTTP Status 0 received."
  58674. ),
  58675. t && t(a),
  58676. o.manager.itemEnd(e))
  58677. : (r && r(i), o.manager.itemError(e));
  58678. },
  58679. !1
  58680. ),
  58681. void 0 !== i &&
  58682. s.addEventListener(
  58683. "progress",
  58684. function (e) {
  58685. i(e);
  58686. },
  58687. !1
  58688. ),
  58689. s.addEventListener(
  58690. "error",
  58691. function (t) {
  58692. r && r(t), o.manager.itemError(e);
  58693. },
  58694. !1
  58695. ),
  58696. void 0 !== this.responseType &&
  58697. (s.responseType = this.responseType),
  58698. void 0 !== this.withCredentials &&
  58699. (s.withCredentials = this.withCredentials),
  58700. s.send(null),
  58701. o.manager.itemStart(e),
  58702. s
  58703. );
  58704. },
  58705. setPath: function (e) {
  58706. this.path = e;
  58707. },
  58708. setResponseType: function (e) {
  58709. this.responseType = e;
  58710. },
  58711. setWithCredentials: function (e) {
  58712. this.withCredentials = e;
  58713. },
  58714. }),
  58715. (n.FontLoader = function (e) {
  58716. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  58717. }),
  58718. (n.FontLoader.prototype = {
  58719. constructor: n.FontLoader,
  58720. load: function (e, t, i, r) {
  58721. var o = new n.XHRLoader(this.manager);
  58722. o.load(
  58723. e,
  58724. function (e) {
  58725. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))));
  58726. },
  58727. i,
  58728. r
  58729. );
  58730. },
  58731. }),
  58732. (n.ImageLoader = function (e) {
  58733. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  58734. }),
  58735. (n.ImageLoader.prototype = {
  58736. constructor: n.ImageLoader,
  58737. load: function (e, t, i, r) {
  58738. void 0 !== this.path && (e = this.path + e);
  58739. var o = this,
  58740. a = n.Cache.get(e);
  58741. if (void 0 !== a)
  58742. return (
  58743. o.manager.itemStart(e),
  58744. t
  58745. ? setTimeout(function () {
  58746. t(a), o.manager.itemEnd(e);
  58747. }, 0)
  58748. : o.manager.itemEnd(e),
  58749. a
  58750. );
  58751. var s = document.createElement("img");
  58752. return (
  58753. s.addEventListener(
  58754. "load",
  58755. function (i) {
  58756. n.Cache.add(e, this), t && t(this), o.manager.itemEnd(e);
  58757. },
  58758. !1
  58759. ),
  58760. void 0 !== i &&
  58761. s.addEventListener(
  58762. "progress",
  58763. function (e) {
  58764. i(e);
  58765. },
  58766. !1
  58767. ),
  58768. s.addEventListener(
  58769. "error",
  58770. function (t) {
  58771. r && r(t), o.manager.itemError(e);
  58772. },
  58773. !1
  58774. ),
  58775. void 0 !== this.crossOrigin &&
  58776. (s.crossOrigin = this.crossOrigin),
  58777. o.manager.itemStart(e),
  58778. (s.src = e),
  58779. s
  58780. );
  58781. },
  58782. setCrossOrigin: function (e) {
  58783. this.crossOrigin = e;
  58784. },
  58785. setPath: function (e) {
  58786. this.path = e;
  58787. },
  58788. }),
  58789. (n.JSONLoader = function (e) {
  58790. "boolean" == typeof e &&
  58791. (console.warn(
  58792. "THREE.JSONLoader: showStatus parameter has been removed from constructor."
  58793. ),
  58794. (e = void 0)),
  58795. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager),
  58796. (this.withCredentials = !1);
  58797. }),
  58798. (n.JSONLoader.prototype = {
  58799. constructor: n.JSONLoader,
  58800. get statusDomElement() {
  58801. return (
  58802. void 0 === this._statusDomElement &&
  58803. (this._statusDomElement = document.createElement("div")),
  58804. console.warn(
  58805. "THREE.JSONLoader: .statusDomElement has been removed."
  58806. ),
  58807. this._statusDomElement
  58808. );
  58809. },
  58810. load: function (e, t, i, r) {
  58811. var o = this,
  58812. a =
  58813. this.texturePath && "string" == typeof this.texturePath
  58814. ? this.texturePath
  58815. : n.Loader.prototype.extractUrlBase(e),
  58816. s = new n.XHRLoader(this.manager);
  58817. s.setWithCredentials(this.withCredentials),
  58818. s.load(
  58819. e,
  58820. function (i) {
  58821. var n = JSON.parse(i),
  58822. r = n.metadata;
  58823. if (void 0 !== r) {
  58824. var s = r.type;
  58825. if (void 0 !== s) {
  58826. if ("object" === s.toLowerCase())
  58827. return void console.error(
  58828. "THREE.JSONLoader: " +
  58829. e +
  58830. " should be loaded with THREE.ObjectLoader instead."
  58831. );
  58832. if ("scene" === s.toLowerCase())
  58833. return void console.error(
  58834. "THREE.JSONLoader: " +
  58835. e +
  58836. " should be loaded with THREE.SceneLoader instead."
  58837. );
  58838. }
  58839. }
  58840. var l = o.parse(n, a);
  58841. t(l.geometry, l.materials);
  58842. },
  58843. i,
  58844. r
  58845. );
  58846. },
  58847. setTexturePath: function (e) {
  58848. this.texturePath = e;
  58849. },
  58850. parse: function (e, t) {
  58851. function i(t) {
  58852. function i(e, t) {
  58853. return e & (1 << t);
  58854. }
  58855. var r,
  58856. o,
  58857. a,
  58858. l,
  58859. c,
  58860. h,
  58861. u,
  58862. d,
  58863. p,
  58864. f,
  58865. g,
  58866. m,
  58867. v,
  58868. A,
  58869. y,
  58870. C,
  58871. I,
  58872. E,
  58873. b,
  58874. w,
  58875. _,
  58876. T,
  58877. x,
  58878. S,
  58879. M,
  58880. R,
  58881. P,
  58882. O = e.faces,
  58883. L = e.vertices,
  58884. D = e.normals,
  58885. N = e.colors,
  58886. B = 0;
  58887. if (void 0 !== e.uvs) {
  58888. for (r = 0; r < e.uvs.length; r++) e.uvs[r].length && B++;
  58889. for (r = 0; r < B; r++) s.faceVertexUvs[r] = [];
  58890. }
  58891. for (l = 0, c = L.length; l < c; )
  58892. (E = new n.Vector3()),
  58893. (E.x = L[l++] * t),
  58894. (E.y = L[l++] * t),
  58895. (E.z = L[l++] * t),
  58896. s.vertices.push(E);
  58897. for (l = 0, c = O.length; l < c; )
  58898. if (
  58899. ((f = O[l++]),
  58900. (g = i(f, 0)),
  58901. (m = i(f, 1)),
  58902. (v = i(f, 3)),
  58903. (A = i(f, 4)),
  58904. (y = i(f, 5)),
  58905. (C = i(f, 6)),
  58906. (I = i(f, 7)),
  58907. g)
  58908. ) {
  58909. if (
  58910. ((w = new n.Face3()),
  58911. (w.a = O[l]),
  58912. (w.b = O[l + 1]),
  58913. (w.c = O[l + 3]),
  58914. (_ = new n.Face3()),
  58915. (_.a = O[l + 1]),
  58916. (_.b = O[l + 2]),
  58917. (_.c = O[l + 3]),
  58918. (l += 4),
  58919. m &&
  58920. ((p = O[l++]),
  58921. (w.materialIndex = p),
  58922. (_.materialIndex = p)),
  58923. (a = s.faces.length),
  58924. v)
  58925. )
  58926. for (r = 0; r < B; r++)
  58927. for (
  58928. S = e.uvs[r],
  58929. s.faceVertexUvs[r][a] = [],
  58930. s.faceVertexUvs[r][a + 1] = [],
  58931. o = 0;
  58932. o < 4;
  58933. o++
  58934. )
  58935. (d = O[l++]),
  58936. (R = S[2 * d]),
  58937. (P = S[2 * d + 1]),
  58938. (M = new n.Vector2(R, P)),
  58939. 2 !== o && s.faceVertexUvs[r][a].push(M),
  58940. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  58941. if (
  58942. (A &&
  58943. ((u = 3 * O[l++]),
  58944. w.normal.set(D[u++], D[u++], D[u]),
  58945. _.normal.copy(w.normal)),
  58946. y)
  58947. )
  58948. for (r = 0; r < 4; r++)
  58949. (u = 3 * O[l++]),
  58950. (x = new n.Vector3(D[u++], D[u++], D[u])),
  58951. 2 !== r && w.vertexNormals.push(x),
  58952. 0 !== r && _.vertexNormals.push(x);
  58953. if (
  58954. (C &&
  58955. ((h = O[l++]),
  58956. (T = N[h]),
  58957. w.color.setHex(T),
  58958. _.color.setHex(T)),
  58959. I)
  58960. )
  58961. for (r = 0; r < 4; r++)
  58962. (h = O[l++]),
  58963. (T = N[h]),
  58964. 2 !== r && w.vertexColors.push(new n.Color(T)),
  58965. 0 !== r && _.vertexColors.push(new n.Color(T));
  58966. s.faces.push(w), s.faces.push(_);
  58967. } else {
  58968. if (
  58969. ((b = new n.Face3()),
  58970. (b.a = O[l++]),
  58971. (b.b = O[l++]),
  58972. (b.c = O[l++]),
  58973. m && ((p = O[l++]), (b.materialIndex = p)),
  58974. (a = s.faces.length),
  58975. v)
  58976. )
  58977. for (r = 0; r < B; r++)
  58978. for (
  58979. S = e.uvs[r], s.faceVertexUvs[r][a] = [], o = 0;
  58980. o < 3;
  58981. o++
  58982. )
  58983. (d = O[l++]),
  58984. (R = S[2 * d]),
  58985. (P = S[2 * d + 1]),
  58986. (M = new n.Vector2(R, P)),
  58987. s.faceVertexUvs[r][a].push(M);
  58988. if (
  58989. (A &&
  58990. ((u = 3 * O[l++]), b.normal.set(D[u++], D[u++], D[u])),
  58991. y)
  58992. )
  58993. for (r = 0; r < 3; r++)
  58994. (u = 3 * O[l++]),
  58995. (x = new n.Vector3(D[u++], D[u++], D[u])),
  58996. b.vertexNormals.push(x);
  58997. if ((C && ((h = O[l++]), b.color.setHex(N[h])), I))
  58998. for (r = 0; r < 3; r++)
  58999. (h = O[l++]), b.vertexColors.push(new n.Color(N[h]));
  59000. s.faces.push(b);
  59001. }
  59002. }
  59003. function r() {
  59004. var t =
  59005. void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  59006. if (e.skinWeights)
  59007. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  59008. var o = e.skinWeights[i],
  59009. a = t > 1 ? e.skinWeights[i + 1] : 0,
  59010. l = t > 2 ? e.skinWeights[i + 2] : 0,
  59011. c = t > 3 ? e.skinWeights[i + 3] : 0;
  59012. s.skinWeights.push(new n.Vector4(o, a, l, c));
  59013. }
  59014. if (e.skinIndices)
  59015. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  59016. var h = e.skinIndices[i],
  59017. u = t > 1 ? e.skinIndices[i + 1] : 0,
  59018. d = t > 2 ? e.skinIndices[i + 2] : 0,
  59019. p = t > 3 ? e.skinIndices[i + 3] : 0;
  59020. s.skinIndices.push(new n.Vector4(h, u, d, p));
  59021. }
  59022. (s.bones = e.bones),
  59023. s.bones &&
  59024. s.bones.length > 0 &&
  59025. (s.skinWeights.length !== s.skinIndices.length ||
  59026. s.skinIndices.length !== s.vertices.length) &&
  59027. console.warn(
  59028. "When skinning, number of vertices (" +
  59029. s.vertices.length +
  59030. "), skinIndices (" +
  59031. s.skinIndices.length +
  59032. "), and skinWeights (" +
  59033. s.skinWeights.length +
  59034. ") should match."
  59035. );
  59036. }
  59037. function o(t) {
  59038. if (void 0 !== e.morphTargets)
  59039. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  59040. (s.morphTargets[i] = {}),
  59041. (s.morphTargets[i].name = e.morphTargets[i].name),
  59042. (s.morphTargets[i].vertices = []);
  59043. for (
  59044. var o = s.morphTargets[i].vertices,
  59045. a = e.morphTargets[i].vertices,
  59046. l = 0,
  59047. c = a.length;
  59048. l < c;
  59049. l += 3
  59050. ) {
  59051. var h = new n.Vector3();
  59052. (h.x = a[l] * t),
  59053. (h.y = a[l + 1] * t),
  59054. (h.z = a[l + 2] * t),
  59055. o.push(h);
  59056. }
  59057. }
  59058. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  59059. console.warn(
  59060. 'THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.'
  59061. );
  59062. for (
  59063. var u = s.faces,
  59064. d = e.morphColors[0].colors,
  59065. i = 0,
  59066. r = u.length;
  59067. i < r;
  59068. i++
  59069. )
  59070. u[i].color.fromArray(d, 3 * i);
  59071. }
  59072. }
  59073. function a() {
  59074. var t = [],
  59075. i = [];
  59076. void 0 !== e.animation && i.push(e.animation),
  59077. void 0 !== e.animations &&
  59078. (e.animations.length
  59079. ? (i = i.concat(e.animations))
  59080. : i.push(e.animations));
  59081. for (var r = 0; r < i.length; r++) {
  59082. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  59083. o && t.push(o);
  59084. }
  59085. if (s.morphTargets) {
  59086. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(
  59087. s.morphTargets,
  59088. 10
  59089. );
  59090. t = t.concat(a);
  59091. }
  59092. t.length > 0 && (s.animations = t);
  59093. }
  59094. var s = new n.Geometry(),
  59095. l = void 0 !== e.scale ? 1 / e.scale : 1;
  59096. if (
  59097. (i(l),
  59098. r(),
  59099. o(l),
  59100. a(),
  59101. s.computeFaceNormals(),
  59102. s.computeBoundingSphere(),
  59103. void 0 === e.materials || 0 === e.materials.length)
  59104. )
  59105. return {
  59106. geometry: s,
  59107. };
  59108. var c = n.Loader.prototype.initMaterials(
  59109. e.materials,
  59110. t,
  59111. this.crossOrigin
  59112. );
  59113. return {
  59114. geometry: s,
  59115. materials: c,
  59116. };
  59117. },
  59118. }),
  59119. (n.LoadingManager = function (e, t, i) {
  59120. var n = this,
  59121. r = !1,
  59122. o = 0,
  59123. a = 0;
  59124. (this.onStart = void 0),
  59125. (this.onLoad = e),
  59126. (this.onProgress = t),
  59127. (this.onError = i),
  59128. (this.itemStart = function (e) {
  59129. a++,
  59130. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  59131. (r = !0);
  59132. }),
  59133. (this.itemEnd = function (e) {
  59134. o++,
  59135. void 0 !== n.onProgress && n.onProgress(e, o, a),
  59136. o === a && ((r = !1), void 0 !== n.onLoad && n.onLoad());
  59137. }),
  59138. (this.itemError = function (e) {
  59139. void 0 !== n.onError && n.onError(e);
  59140. });
  59141. }),
  59142. (n.DefaultLoadingManager = new n.LoadingManager()),
  59143. (n.BufferGeometryLoader = function (e) {
  59144. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  59145. }),
  59146. (n.BufferGeometryLoader.prototype = {
  59147. constructor: n.BufferGeometryLoader,
  59148. load: function (e, t, i, r) {
  59149. var o = this,
  59150. a = new n.XHRLoader(o.manager);
  59151. a.load(
  59152. e,
  59153. function (e) {
  59154. t(o.parse(JSON.parse(e)));
  59155. },
  59156. i,
  59157. r
  59158. );
  59159. },
  59160. parse: function (e) {
  59161. var t = new n.BufferGeometry(),
  59162. i = e.data.index,
  59163. r = {
  59164. Int8Array: Int8Array,
  59165. Uint8Array: Uint8Array,
  59166. Uint8ClampedArray: Uint8ClampedArray,
  59167. Int16Array: Int16Array,
  59168. Uint16Array: Uint16Array,
  59169. Int32Array: Int32Array,
  59170. Uint32Array: Uint32Array,
  59171. Float32Array: Float32Array,
  59172. Float64Array: Float64Array,
  59173. };
  59174. if (void 0 !== i) {
  59175. var o = new r[i.type](i.array);
  59176. t.setIndex(new n.BufferAttribute(o, 1));
  59177. }
  59178. var a = e.data.attributes;
  59179. for (var s in a) {
  59180. var l = a[s],
  59181. o = new r[l.type](l.array);
  59182. t.addAttribute(s, new n.BufferAttribute(o, l.itemSize));
  59183. }
  59184. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  59185. if (void 0 !== c)
  59186. for (var h = 0, u = c.length; h !== u; ++h) {
  59187. var d = c[h];
  59188. t.addGroup(d.start, d.count, d.materialIndex);
  59189. }
  59190. var p = e.data.boundingSphere;
  59191. if (void 0 !== p) {
  59192. var f = new n.Vector3();
  59193. void 0 !== p.center && f.fromArray(p.center),
  59194. (t.boundingSphere = new n.Sphere(f, p.radius));
  59195. }
  59196. return t;
  59197. },
  59198. }),
  59199. (n.MaterialLoader = function (e) {
  59200. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager),
  59201. (this.textures = {});
  59202. }),
  59203. (n.MaterialLoader.prototype = {
  59204. constructor: n.MaterialLoader,
  59205. load: function (e, t, i, r) {
  59206. var o = this,
  59207. a = new n.XHRLoader(o.manager);
  59208. a.load(
  59209. e,
  59210. function (e) {
  59211. t(o.parse(JSON.parse(e)));
  59212. },
  59213. i,
  59214. r
  59215. );
  59216. },
  59217. setTextures: function (e) {
  59218. this.textures = e;
  59219. },
  59220. getTexture: function (e) {
  59221. var t = this.textures;
  59222. return (
  59223. void 0 === t[e] &&
  59224. console.warn("THREE.MaterialLoader: Undefined texture", e),
  59225. t[e]
  59226. );
  59227. },
  59228. parse: function (e) {
  59229. var t = new n[e.type]();
  59230. if (
  59231. (void 0 !== e.uuid && (t.uuid = e.uuid),
  59232. void 0 !== e.name && (t.name = e.name),
  59233. void 0 !== e.color && t.color.setHex(e.color),
  59234. void 0 !== e.roughness && (t.roughness = e.roughness),
  59235. void 0 !== e.metalness && (t.metalness = e.metalness),
  59236. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  59237. void 0 !== e.specular && t.specular.setHex(e.specular),
  59238. void 0 !== e.shininess && (t.shininess = e.shininess),
  59239. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  59240. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  59241. void 0 !== e.fragmentShader &&
  59242. (t.fragmentShader = e.fragmentShader),
  59243. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  59244. void 0 !== e.shading && (t.shading = e.shading),
  59245. void 0 !== e.blending && (t.blending = e.blending),
  59246. void 0 !== e.side && (t.side = e.side),
  59247. void 0 !== e.opacity && (t.opacity = e.opacity),
  59248. void 0 !== e.transparent && (t.transparent = e.transparent),
  59249. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  59250. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  59251. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  59252. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  59253. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  59254. void 0 !== e.wireframeLinewidth &&
  59255. (t.wireframeLinewidth = e.wireframeLinewidth),
  59256. void 0 !== e.size && (t.size = e.size),
  59257. void 0 !== e.sizeAttenuation &&
  59258. (t.sizeAttenuation = e.sizeAttenuation),
  59259. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  59260. void 0 !== e.alphaMap &&
  59261. ((t.alphaMap = this.getTexture(e.alphaMap)),
  59262. (t.transparent = !0)),
  59263. void 0 !== e.bumpMap &&
  59264. (t.bumpMap = this.getTexture(e.bumpMap)),
  59265. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  59266. void 0 !== e.normalMap &&
  59267. (t.normalMap = this.getTexture(e.normalMap)),
  59268. void 0 !== e.normalScale)
  59269. ) {
  59270. var i = e.normalScale;
  59271. Array.isArray(i) === !1 && (i = [i, i]),
  59272. (t.normalScale = new n.Vector2().fromArray(i));
  59273. }
  59274. if (
  59275. (void 0 !== e.displacementMap &&
  59276. (t.displacementMap = this.getTexture(e.displacementMap)),
  59277. void 0 !== e.displacementScale &&
  59278. (t.displacementScale = e.displacementScale),
  59279. void 0 !== e.displacementBias &&
  59280. (t.displacementBias = e.displacementBias),
  59281. void 0 !== e.roughnessMap &&
  59282. (t.roughnessMap = this.getTexture(e.roughnessMap)),
  59283. void 0 !== e.metalnessMap &&
  59284. (t.metalnessMap = this.getTexture(e.metalnessMap)),
  59285. void 0 !== e.emissiveMap &&
  59286. (t.emissiveMap = this.getTexture(e.emissiveMap)),
  59287. void 0 !== e.emissiveIntensity &&
  59288. (t.emissiveIntensity = e.emissiveIntensity),
  59289. void 0 !== e.specularMap &&
  59290. (t.specularMap = this.getTexture(e.specularMap)),
  59291. void 0 !== e.envMap &&
  59292. ((t.envMap = this.getTexture(e.envMap)),
  59293. (t.combine = n.MultiplyOperation)),
  59294. e.reflectivity && (t.reflectivity = e.reflectivity),
  59295. void 0 !== e.lightMap &&
  59296. (t.lightMap = this.getTexture(e.lightMap)),
  59297. void 0 !== e.lightMapIntensity &&
  59298. (t.lightMapIntensity = e.lightMapIntensity),
  59299. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  59300. void 0 !== e.aoMapIntensity &&
  59301. (t.aoMapIntensity = e.aoMapIntensity),
  59302. void 0 !== e.materials)
  59303. )
  59304. for (var r = 0, o = e.materials.length; r < o; r++)
  59305. t.materials.push(this.parse(e.materials[r]));
  59306. return t;
  59307. },
  59308. }),
  59309. (n.ObjectLoader = function (e) {
  59310. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager),
  59311. (this.texturePath = "");
  59312. }),
  59313. (n.ObjectLoader.prototype = {
  59314. constructor: n.ObjectLoader,
  59315. load: function (e, t, i, r) {
  59316. "" === this.texturePath &&
  59317. (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  59318. var o = this,
  59319. a = new n.XHRLoader(o.manager);
  59320. a.load(
  59321. e,
  59322. function (e) {
  59323. o.parse(JSON.parse(e), t);
  59324. },
  59325. i,
  59326. r
  59327. );
  59328. },
  59329. setTexturePath: function (e) {
  59330. this.texturePath = e;
  59331. },
  59332. setCrossOrigin: function (e) {
  59333. this.crossOrigin = e;
  59334. },
  59335. parse: function (e, t) {
  59336. var i = this.parseGeometries(e.geometries),
  59337. n = this.parseImages(e.images, function () {
  59338. void 0 !== t && t(a);
  59339. }),
  59340. r = this.parseTextures(e.textures, n),
  59341. o = this.parseMaterials(e.materials, r),
  59342. a = this.parseObject(e.object, i, o);
  59343. return (
  59344. e.animations &&
  59345. (a.animations = this.parseAnimations(e.animations)),
  59346. (void 0 !== e.images && 0 !== e.images.length) ||
  59347. (void 0 !== t && t(a)),
  59348. a
  59349. );
  59350. },
  59351. parseGeometries: function (e) {
  59352. var t = {};
  59353. if (void 0 !== e)
  59354. for (
  59355. var i = new n.JSONLoader(),
  59356. r = new n.BufferGeometryLoader(),
  59357. o = 0,
  59358. a = e.length;
  59359. o < a;
  59360. o++
  59361. ) {
  59362. var s,
  59363. l = e[o];
  59364. switch (l.type) {
  59365. case "PlaneGeometry":
  59366. case "PlaneBufferGeometry":
  59367. s = new n[l.type](
  59368. l.width,
  59369. l.height,
  59370. l.widthSegments,
  59371. l.heightSegments
  59372. );
  59373. break;
  59374. case "BoxGeometry":
  59375. case "BoxBufferGeometry":
  59376. case "CubeGeometry":
  59377. s = new n[l.type](
  59378. l.width,
  59379. l.height,
  59380. l.depth,
  59381. l.widthSegments,
  59382. l.heightSegments,
  59383. l.depthSegments
  59384. );
  59385. break;
  59386. case "CircleGeometry":
  59387. case "CircleBufferGeometry":
  59388. s = new n[l.type](
  59389. l.radius,
  59390. l.segments,
  59391. l.thetaStart,
  59392. l.thetaLength
  59393. );
  59394. break;
  59395. case "CylinderGeometry":
  59396. case "CylinderBufferGeometry":
  59397. s = new n[l.type](
  59398. l.radiusTop,
  59399. l.radiusBottom,
  59400. l.height,
  59401. l.radialSegments,
  59402. l.heightSegments,
  59403. l.openEnded,
  59404. l.thetaStart,
  59405. l.thetaLength
  59406. );
  59407. break;
  59408. case "SphereGeometry":
  59409. case "SphereBufferGeometry":
  59410. s = new n[l.type](
  59411. l.radius,
  59412. l.widthSegments,
  59413. l.heightSegments,
  59414. l.phiStart,
  59415. l.phiLength,
  59416. l.thetaStart,
  59417. l.thetaLength
  59418. );
  59419. break;
  59420. case "DodecahedronGeometry":
  59421. s = new n.DodecahedronGeometry(l.radius, l.detail);
  59422. break;
  59423. case "IcosahedronGeometry":
  59424. s = new n.IcosahedronGeometry(l.radius, l.detail);
  59425. break;
  59426. case "OctahedronGeometry":
  59427. s = new n.OctahedronGeometry(l.radius, l.detail);
  59428. break;
  59429. case "TetrahedronGeometry":
  59430. s = new n.TetrahedronGeometry(l.radius, l.detail);
  59431. break;
  59432. case "RingGeometry":
  59433. case "RingBufferGeometry":
  59434. s = new n[l.type](
  59435. l.innerRadius,
  59436. l.outerRadius,
  59437. l.thetaSegments,
  59438. l.phiSegments,
  59439. l.thetaStart,
  59440. l.thetaLength
  59441. );
  59442. break;
  59443. case "TorusGeometry":
  59444. case "TorusBufferGeometry":
  59445. s = new n[l.type](
  59446. l.radius,
  59447. l.tube,
  59448. l.radialSegments,
  59449. l.tubularSegments,
  59450. l.arc
  59451. );
  59452. break;
  59453. case "TorusKnotGeometry":
  59454. case "TorusKnotBufferGeometry":
  59455. s = new n[l.type](
  59456. l.radius,
  59457. l.tube,
  59458. l.tubularSegments,
  59459. l.radialSegments,
  59460. l.p,
  59461. l.q
  59462. );
  59463. break;
  59464. case "LatheGeometry":
  59465. s = new n.LatheGeometry(
  59466. l.points,
  59467. l.segments,
  59468. l.phiStart,
  59469. l.phiLength
  59470. );
  59471. break;
  59472. case "BufferGeometry":
  59473. s = r.parse(l);
  59474. break;
  59475. case "Geometry":
  59476. s = i.parse(l.data, this.texturePath).geometry;
  59477. break;
  59478. default:
  59479. console.warn(
  59480. 'THREE.ObjectLoader: Unsupported geometry type "' +
  59481. l.type +
  59482. '"'
  59483. );
  59484. continue;
  59485. }
  59486. (s.uuid = l.uuid),
  59487. void 0 !== l.name && (s.name = l.name),
  59488. (t[l.uuid] = s);
  59489. }
  59490. return t;
  59491. },
  59492. parseMaterials: function (e, t) {
  59493. var i = {};
  59494. if (void 0 !== e) {
  59495. var r = new n.MaterialLoader();
  59496. r.setTextures(t);
  59497. for (var o = 0, a = e.length; o < a; o++) {
  59498. var s = r.parse(e[o]);
  59499. i[s.uuid] = s;
  59500. }
  59501. }
  59502. return i;
  59503. },
  59504. parseAnimations: function (e) {
  59505. for (var t = [], i = 0; i < e.length; i++) {
  59506. var r = n.AnimationClip.parse(e[i]);
  59507. t.push(r);
  59508. }
  59509. return t;
  59510. },
  59511. parseImages: function (e, t) {
  59512. function i(e) {
  59513. return (
  59514. r.manager.itemStart(e),
  59515. s.load(e, function () {
  59516. r.manager.itemEnd(e);
  59517. })
  59518. );
  59519. }
  59520. var r = this,
  59521. o = {};
  59522. if (void 0 !== e && e.length > 0) {
  59523. var a = new n.LoadingManager(t),
  59524. s = new n.ImageLoader(a);
  59525. s.setCrossOrigin(this.crossOrigin);
  59526. for (var l = 0, c = e.length; l < c; l++) {
  59527. var h = e[l],
  59528. u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url)
  59529. ? h.url
  59530. : r.texturePath + h.url;
  59531. o[h.uuid] = i(u);
  59532. }
  59533. }
  59534. return o;
  59535. },
  59536. parseTextures: function (e, t) {
  59537. function i(e) {
  59538. return "number" == typeof e
  59539. ? e
  59540. : (console.warn(
  59541. "THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",
  59542. e
  59543. ),
  59544. n[e]);
  59545. }
  59546. var r = {};
  59547. if (void 0 !== e)
  59548. for (var o = 0, a = e.length; o < a; o++) {
  59549. var s = e[o];
  59550. void 0 === s.image &&
  59551. console.warn(
  59552. 'THREE.ObjectLoader: No "image" specified for',
  59553. s.uuid
  59554. ),
  59555. void 0 === t[s.image] &&
  59556. console.warn(
  59557. "THREE.ObjectLoader: Undefined image",
  59558. s.image
  59559. );
  59560. var l = new n.Texture(t[s.image]);
  59561. (l.needsUpdate = !0),
  59562. (l.uuid = s.uuid),
  59563. void 0 !== s.name && (l.name = s.name),
  59564. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  59565. void 0 !== s.offset &&
  59566. (l.offset = new n.Vector2(s.offset[0], s.offset[1])),
  59567. void 0 !== s.repeat &&
  59568. (l.repeat = new n.Vector2(s.repeat[0], s.repeat[1])),
  59569. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  59570. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  59571. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  59572. Array.isArray(s.wrap) &&
  59573. ((l.wrapS = i(s.wrap[0])), (l.wrapT = i(s.wrap[1]))),
  59574. (r[s.uuid] = l);
  59575. }
  59576. return r;
  59577. },
  59578. parseObject: (function () {
  59579. var e = new n.Matrix4();
  59580. return function (t, i, r) {
  59581. function o(e) {
  59582. return (
  59583. void 0 === i[e] &&
  59584. console.warn("THREE.ObjectLoader: Undefined geometry", e),
  59585. i[e]
  59586. );
  59587. }
  59588. function a(e) {
  59589. if (void 0 !== e)
  59590. return (
  59591. void 0 === r[e] &&
  59592. console.warn(
  59593. "THREE.ObjectLoader: Undefined material",
  59594. e
  59595. ),
  59596. r[e]
  59597. );
  59598. }
  59599. var s;
  59600. switch (t.type) {
  59601. case "Scene":
  59602. s = new n.Scene();
  59603. break;
  59604. case "PerspectiveCamera":
  59605. s = new n.PerspectiveCamera(t.fov, t.aspect, t.near, t.far);
  59606. break;
  59607. case "OrthographicCamera":
  59608. s = new n.OrthographicCamera(
  59609. t.left,
  59610. t.right,
  59611. t.top,
  59612. t.bottom,
  59613. t.near,
  59614. t.far
  59615. );
  59616. break;
  59617. case "AmbientLight":
  59618. s = new n.AmbientLight(t.color, t.intensity);
  59619. break;
  59620. case "DirectionalLight":
  59621. s = new n.DirectionalLight(t.color, t.intensity);
  59622. break;
  59623. case "PointLight":
  59624. s = new n.PointLight(
  59625. t.color,
  59626. t.intensity,
  59627. t.distance,
  59628. t.decay
  59629. );
  59630. break;
  59631. case "SpotLight":
  59632. s = new n.SpotLight(
  59633. t.color,
  59634. t.intensity,
  59635. t.distance,
  59636. t.angle,
  59637. t.penumbra,
  59638. t.decay
  59639. );
  59640. break;
  59641. case "HemisphereLight":
  59642. s = new n.HemisphereLight(
  59643. t.color,
  59644. t.groundColor,
  59645. t.intensity
  59646. );
  59647. break;
  59648. case "Mesh":
  59649. var l = o(t.geometry),
  59650. c = a(t.material);
  59651. s =
  59652. l.bones && l.bones.length > 0
  59653. ? new n.SkinnedMesh(l, c)
  59654. : new n.Mesh(l, c);
  59655. break;
  59656. case "LOD":
  59657. s = new n.LOD();
  59658. break;
  59659. case "Line":
  59660. s = new n.Line(o(t.geometry), a(t.material), t.mode);
  59661. break;
  59662. case "PointCloud":
  59663. case "Points":
  59664. s = new n.Points(o(t.geometry), a(t.material));
  59665. break;
  59666. case "Sprite":
  59667. s = new n.Sprite(a(t.material));
  59668. break;
  59669. case "Group":
  59670. s = new n.Group();
  59671. break;
  59672. default:
  59673. s = new n.Object3D();
  59674. }
  59675. if (
  59676. ((s.uuid = t.uuid),
  59677. void 0 !== t.name && (s.name = t.name),
  59678. void 0 !== t.matrix
  59679. ? (e.fromArray(t.matrix),
  59680. e.decompose(s.position, s.quaternion, s.scale))
  59681. : (void 0 !== t.position &&
  59682. s.position.fromArray(t.position),
  59683. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  59684. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  59685. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  59686. void 0 !== t.receiveShadow &&
  59687. (s.receiveShadow = t.receiveShadow),
  59688. void 0 !== t.visible && (s.visible = t.visible),
  59689. void 0 !== t.userData && (s.userData = t.userData),
  59690. void 0 !== t.children)
  59691. )
  59692. for (var h in t.children)
  59693. s.add(this.parseObject(t.children[h], i, r));
  59694. if ("LOD" === t.type)
  59695. for (var u = t.levels, d = 0; d < u.length; d++) {
  59696. var p = u[d],
  59697. h = s.getObjectByProperty("uuid", p.object);
  59698. void 0 !== h && s.addLevel(h, p.distance);
  59699. }
  59700. return s;
  59701. };
  59702. })(),
  59703. }),
  59704. (n.TextureLoader = function (e) {
  59705. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  59706. }),
  59707. (n.TextureLoader.prototype = {
  59708. constructor: n.TextureLoader,
  59709. load: function (e, t, i, r) {
  59710. var o = new n.Texture(),
  59711. a = new n.ImageLoader(this.manager);
  59712. return (
  59713. a.setCrossOrigin(this.crossOrigin),
  59714. a.setPath(this.path),
  59715. a.load(
  59716. e,
  59717. function (e) {
  59718. (o.image = e), (o.needsUpdate = !0), void 0 !== t && t(o);
  59719. },
  59720. i,
  59721. r
  59722. ),
  59723. o
  59724. );
  59725. },
  59726. setCrossOrigin: function (e) {
  59727. this.crossOrigin = e;
  59728. },
  59729. setPath: function (e) {
  59730. this.path = e;
  59731. },
  59732. }),
  59733. (n.CubeTextureLoader = function (e) {
  59734. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  59735. }),
  59736. (n.CubeTextureLoader.prototype = {
  59737. constructor: n.CubeTextureLoader,
  59738. load: function (e, t, i, r) {
  59739. function o(i) {
  59740. s.load(
  59741. e[i],
  59742. function (e) {
  59743. (a.images[i] = e),
  59744. l++,
  59745. 6 === l && ((a.needsUpdate = !0), t && t(a));
  59746. },
  59747. void 0,
  59748. r
  59749. );
  59750. }
  59751. var a = new n.CubeTexture(),
  59752. s = new n.ImageLoader(this.manager);
  59753. s.setCrossOrigin(this.crossOrigin), s.setPath(this.path);
  59754. for (var l = 0, c = 0; c < e.length; ++c) o(c);
  59755. return a;
  59756. },
  59757. setCrossOrigin: function (e) {
  59758. this.crossOrigin = e;
  59759. },
  59760. setPath: function (e) {
  59761. this.path = e;
  59762. },
  59763. }),
  59764. (n.DataTextureLoader = n.BinaryTextureLoader =
  59765. function (e) {
  59766. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager),
  59767. (this._parser = null);
  59768. }),
  59769. (n.BinaryTextureLoader.prototype = {
  59770. constructor: n.BinaryTextureLoader,
  59771. load: function (e, t, i, r) {
  59772. var o = this,
  59773. a = new n.DataTexture(),
  59774. s = new n.XHRLoader(this.manager);
  59775. return (
  59776. s.setResponseType("arraybuffer"),
  59777. s.load(
  59778. e,
  59779. function (e) {
  59780. var i = o._parser(e);
  59781. i &&
  59782. (void 0 !== i.image
  59783. ? (a.image = i.image)
  59784. : void 0 !== i.data &&
  59785. ((a.image.width = i.width),
  59786. (a.image.height = i.height),
  59787. (a.image.data = i.data)),
  59788. (a.wrapS =
  59789. void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping),
  59790. (a.wrapT =
  59791. void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping),
  59792. (a.magFilter =
  59793. void 0 !== i.magFilter ? i.magFilter : n.LinearFilter),
  59794. (a.minFilter =
  59795. void 0 !== i.minFilter
  59796. ? i.minFilter
  59797. : n.LinearMipMapLinearFilter),
  59798. (a.anisotropy =
  59799. void 0 !== i.anisotropy ? i.anisotropy : 1),
  59800. void 0 !== i.format && (a.format = i.format),
  59801. void 0 !== i.type && (a.type = i.type),
  59802. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  59803. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  59804. (a.needsUpdate = !0),
  59805. t && t(a, i));
  59806. },
  59807. i,
  59808. r
  59809. ),
  59810. a
  59811. );
  59812. },
  59813. }),
  59814. (n.CompressedTextureLoader = function (e) {
  59815. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager),
  59816. (this._parser = null);
  59817. });
  59818. n.CompressedTextureLoader.prototype = {
  59819. constructor: n.CompressedTextureLoader,
  59820. load: function (e, t, i, r) {
  59821. function o(o) {
  59822. c.load(
  59823. e[o],
  59824. function (e) {
  59825. var i = a._parser(e, !0);
  59826. (s[o] = {
  59827. width: i.width,
  59828. height: i.height,
  59829. format: i.format,
  59830. mipmaps: i.mipmaps,
  59831. }),
  59832. (h += 1),
  59833. 6 === h &&
  59834. (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  59835. (l.format = i.format),
  59836. (l.needsUpdate = !0),
  59837. t && t(l));
  59838. },
  59839. i,
  59840. r
  59841. );
  59842. }
  59843. var a = this,
  59844. s = [],
  59845. l = new n.CompressedTexture();
  59846. l.image = s;
  59847. var c = new n.XHRLoader(this.manager);
  59848. if (
  59849. (c.setPath(this.path),
  59850. c.setResponseType("arraybuffer"),
  59851. Array.isArray(e))
  59852. )
  59853. for (var h = 0, u = 0, d = e.length; u < d; ++u) o(u);
  59854. else
  59855. c.load(
  59856. e,
  59857. function (e) {
  59858. var i = a._parser(e, !0);
  59859. if (i.isCubemap)
  59860. for (
  59861. var r = i.mipmaps.length / i.mipmapCount, o = 0;
  59862. o < r;
  59863. o++
  59864. ) {
  59865. s[o] = {
  59866. mipmaps: [],
  59867. };
  59868. for (var c = 0; c < i.mipmapCount; c++)
  59869. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  59870. (s[o].format = i.format),
  59871. (s[o].width = i.width),
  59872. (s[o].height = i.height);
  59873. }
  59874. else
  59875. (l.image.width = i.width),
  59876. (l.image.height = i.height),
  59877. (l.mipmaps = i.mipmaps);
  59878. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  59879. (l.format = i.format),
  59880. (l.needsUpdate = !0),
  59881. t && t(l);
  59882. },
  59883. i,
  59884. r
  59885. );
  59886. return l;
  59887. },
  59888. setPath: function (e) {
  59889. this.path = e;
  59890. },
  59891. };
  59892. (n.Material = function () {
  59893. Object.defineProperty(this, "id", {
  59894. value: n.MaterialIdCount++,
  59895. }),
  59896. (this.uuid = n.Math.generateUUID()),
  59897. (this.name = ""),
  59898. (this.type = "Material"),
  59899. (this.side = n.FrontSide),
  59900. (this.opacity = 1),
  59901. (this.transparent = !1),
  59902. (this.blending = n.NormalBlending),
  59903. (this.blendSrc = n.SrcAlphaFactor),
  59904. (this.blendDst = n.OneMinusSrcAlphaFactor),
  59905. (this.blendEquation = n.AddEquation),
  59906. (this.blendSrcAlpha = null),
  59907. (this.blendDstAlpha = null),
  59908. (this.blendEquationAlpha = null),
  59909. (this.depthFunc = n.LessEqualDepth),
  59910. (this.depthTest = !0),
  59911. (this.depthWrite = !0),
  59912. (this.colorWrite = !0),
  59913. (this.precision = null),
  59914. (this.polygonOffset = !1),
  59915. (this.polygonOffsetFactor = 0),
  59916. (this.polygonOffsetUnits = 0),
  59917. (this.alphaTest = 0),
  59918. (this.premultipliedAlpha = !1),
  59919. (this.overdraw = 0),
  59920. (this.visible = !0),
  59921. (this._needsUpdate = !0);
  59922. }),
  59923. (n.Material.prototype = {
  59924. constructor: n.Material,
  59925. get needsUpdate() {
  59926. return this._needsUpdate;
  59927. },
  59928. set needsUpdate(e) {
  59929. e === !0 && this.update(), (this._needsUpdate = e);
  59930. },
  59931. setValues: function (e) {
  59932. if (void 0 !== e)
  59933. for (var t in e) {
  59934. var i = e[t];
  59935. if (void 0 !== i) {
  59936. var r = this[t];
  59937. void 0 !== r
  59938. ? r instanceof n.Color
  59939. ? r.set(i)
  59940. : r instanceof n.Vector3 && i instanceof n.Vector3
  59941. ? r.copy(i)
  59942. : "overdraw" === t
  59943. ? (this[t] = Number(i))
  59944. : (this[t] = i)
  59945. : console.warn(
  59946. "THREE." +
  59947. this.type +
  59948. ": '" +
  59949. t +
  59950. "' is not a property of this material."
  59951. );
  59952. } else
  59953. console.warn(
  59954. "THREE.Material: '" + t + "' parameter is undefined."
  59955. );
  59956. }
  59957. },
  59958. toJSON: function (e) {
  59959. function t(e) {
  59960. var t = [];
  59961. for (var i in e) {
  59962. var n = e[i];
  59963. delete n.metadata, t.push(n);
  59964. }
  59965. return t;
  59966. }
  59967. var i = void 0 === e;
  59968. i &&
  59969. (e = {
  59970. textures: {},
  59971. images: {},
  59972. });
  59973. var r = {
  59974. metadata: {
  59975. version: 4.4,
  59976. type: "Material",
  59977. generator: "Material.toJSON",
  59978. },
  59979. };
  59980. if (
  59981. ((r.uuid = this.uuid),
  59982. (r.type = this.type),
  59983. "" !== this.name && (r.name = this.name),
  59984. this.color instanceof n.Color &&
  59985. (r.color = this.color.getHex()),
  59986. 0.5 !== this.roughness && (r.roughness = this.roughness),
  59987. 0.5 !== this.metalness && (r.metalness = this.metalness),
  59988. this.emissive instanceof n.Color &&
  59989. (r.emissive = this.emissive.getHex()),
  59990. this.specular instanceof n.Color &&
  59991. (r.specular = this.specular.getHex()),
  59992. void 0 !== this.shininess && (r.shininess = this.shininess),
  59993. this.map instanceof n.Texture &&
  59994. (r.map = this.map.toJSON(e).uuid),
  59995. this.alphaMap instanceof n.Texture &&
  59996. (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  59997. this.lightMap instanceof n.Texture &&
  59998. (r.lightMap = this.lightMap.toJSON(e).uuid),
  59999. this.bumpMap instanceof n.Texture &&
  60000. ((r.bumpMap = this.bumpMap.toJSON(e).uuid),
  60001. (r.bumpScale = this.bumpScale)),
  60002. this.normalMap instanceof n.Texture &&
  60003. ((r.normalMap = this.normalMap.toJSON(e).uuid),
  60004. (r.normalScale = this.normalScale.toArray())),
  60005. this.displacementMap instanceof n.Texture &&
  60006. ((r.displacementMap = this.displacementMap.toJSON(e).uuid),
  60007. (r.displacementScale = this.displacementScale),
  60008. (r.displacementBias = this.displacementBias)),
  60009. this.roughnessMap instanceof n.Texture &&
  60010. (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  60011. this.metalnessMap instanceof n.Texture &&
  60012. (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  60013. this.emissiveMap instanceof n.Texture &&
  60014. (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  60015. this.specularMap instanceof n.Texture &&
  60016. (r.specularMap = this.specularMap.toJSON(e).uuid),
  60017. this.envMap instanceof n.Texture &&
  60018. ((r.envMap = this.envMap.toJSON(e).uuid),
  60019. (r.reflectivity = this.reflectivity)),
  60020. void 0 !== this.size && (r.size = this.size),
  60021. void 0 !== this.sizeAttenuation &&
  60022. (r.sizeAttenuation = this.sizeAttenuation),
  60023. void 0 !== this.vertexColors &&
  60024. this.vertexColors !== n.NoColors &&
  60025. (r.vertexColors = this.vertexColors),
  60026. void 0 !== this.shading &&
  60027. this.shading !== n.SmoothShading &&
  60028. (r.shading = this.shading),
  60029. void 0 !== this.blending &&
  60030. this.blending !== n.NormalBlending &&
  60031. (r.blending = this.blending),
  60032. void 0 !== this.side &&
  60033. this.side !== n.FrontSide &&
  60034. (r.side = this.side),
  60035. this.opacity < 1 && (r.opacity = this.opacity),
  60036. this.transparent === !0 && (r.transparent = this.transparent),
  60037. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  60038. this.premultipliedAlpha === !0 &&
  60039. (r.premultipliedAlpha = this.premultipliedAlpha),
  60040. this.wireframe === !0 && (r.wireframe = this.wireframe),
  60041. this.wireframeLinewidth > 1 &&
  60042. (r.wireframeLinewidth = this.wireframeLinewidth),
  60043. i)
  60044. ) {
  60045. var o = t(e.textures),
  60046. a = t(e.images);
  60047. o.length > 0 && (r.textures = o),
  60048. a.length > 0 && (r.images = a);
  60049. }
  60050. return r;
  60051. },
  60052. clone: function () {
  60053. return new this.constructor().copy(this);
  60054. },
  60055. copy: function (e) {
  60056. return (
  60057. (this.name = e.name),
  60058. (this.side = e.side),
  60059. (this.opacity = e.opacity),
  60060. (this.transparent = e.transparent),
  60061. (this.blending = e.blending),
  60062. (this.blendSrc = e.blendSrc),
  60063. (this.blendDst = e.blendDst),
  60064. (this.blendEquation = e.blendEquation),
  60065. (this.blendSrcAlpha = e.blendSrcAlpha),
  60066. (this.blendDstAlpha = e.blendDstAlpha),
  60067. (this.blendEquationAlpha = e.blendEquationAlpha),
  60068. (this.depthFunc = e.depthFunc),
  60069. (this.depthTest = e.depthTest),
  60070. (this.depthWrite = e.depthWrite),
  60071. (this.colorWrite = e.colorWrite),
  60072. (this.precision = e.precision),
  60073. (this.polygonOffset = e.polygonOffset),
  60074. (this.polygonOffsetFactor = e.polygonOffsetFactor),
  60075. (this.polygonOffsetUnits = e.polygonOffsetUnits),
  60076. (this.alphaTest = e.alphaTest),
  60077. (this.premultipliedAlpha = e.premultipliedAlpha),
  60078. (this.overdraw = e.overdraw),
  60079. (this.visible = e.visible),
  60080. this
  60081. );
  60082. },
  60083. update: function () {
  60084. this.dispatchEvent({
  60085. type: "update",
  60086. });
  60087. },
  60088. dispose: function () {
  60089. this.dispatchEvent({
  60090. type: "dispose",
  60091. });
  60092. },
  60093. }),
  60094. n.EventDispatcher.prototype.apply(n.Material.prototype),
  60095. (n.MaterialIdCount = 0),
  60096. (n.LineBasicMaterial = function (e) {
  60097. n.Material.call(this),
  60098. (this.type = "LineBasicMaterial"),
  60099. (this.color = new n.Color(16777215)),
  60100. (this.linewidth = 1),
  60101. (this.linecap = "round"),
  60102. (this.linejoin = "round"),
  60103. (this.blending = n.NormalBlending),
  60104. (this.vertexColors = n.NoColors),
  60105. (this.fog = !0),
  60106. this.setValues(e);
  60107. }),
  60108. (n.LineBasicMaterial.prototype = Object.create(n.Material.prototype)),
  60109. (n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial),
  60110. (n.LineBasicMaterial.prototype.copy = function (e) {
  60111. return (
  60112. n.Material.prototype.copy.call(this, e),
  60113. this.color.copy(e.color),
  60114. (this.linewidth = e.linewidth),
  60115. (this.linecap = e.linecap),
  60116. (this.linejoin = e.linejoin),
  60117. (this.vertexColors = e.vertexColors),
  60118. (this.fog = e.fog),
  60119. this
  60120. );
  60121. }),
  60122. (n.LineDashedMaterial = function (e) {
  60123. n.Material.call(this),
  60124. (this.type = "LineDashedMaterial"),
  60125. (this.color = new n.Color(16777215)),
  60126. (this.linewidth = 1),
  60127. (this.scale = 1),
  60128. (this.dashSize = 3),
  60129. (this.gapSize = 1),
  60130. (this.blending = n.NormalBlending),
  60131. (this.vertexColors = n.NoColors),
  60132. (this.fog = !0),
  60133. this.setValues(e);
  60134. }),
  60135. (n.LineDashedMaterial.prototype = Object.create(
  60136. n.Material.prototype
  60137. )),
  60138. (n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial),
  60139. (n.LineDashedMaterial.prototype.copy = function (e) {
  60140. return (
  60141. n.Material.prototype.copy.call(this, e),
  60142. this.color.copy(e.color),
  60143. (this.linewidth = e.linewidth),
  60144. (this.scale = e.scale),
  60145. (this.dashSize = e.dashSize),
  60146. (this.gapSize = e.gapSize),
  60147. (this.vertexColors = e.vertexColors),
  60148. (this.fog = e.fog),
  60149. this
  60150. );
  60151. }),
  60152. (n.MeshBasicMaterial = function (e) {
  60153. n.Material.call(this),
  60154. (this.type = "MeshBasicMaterial"),
  60155. (this.color = new n.Color(16777215)),
  60156. (this.map = null),
  60157. (this.aoMap = null),
  60158. (this.aoMapIntensity = 1),
  60159. (this.specularMap = null),
  60160. (this.alphaMap = null),
  60161. (this.envMap = null),
  60162. (this.combine = n.MultiplyOperation),
  60163. (this.reflectivity = 1),
  60164. (this.refractionRatio = 0.98),
  60165. (this.fog = !0),
  60166. (this.shading = n.SmoothShading),
  60167. (this.blending = n.NormalBlending),
  60168. (this.wireframe = !1),
  60169. (this.wireframeLinewidth = 1),
  60170. (this.wireframeLinecap = "round"),
  60171. (this.wireframeLinejoin = "round"),
  60172. (this.vertexColors = n.NoColors),
  60173. (this.skinning = !1),
  60174. (this.morphTargets = !1),
  60175. this.setValues(e);
  60176. }),
  60177. (n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype)),
  60178. (n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial),
  60179. (n.MeshBasicMaterial.prototype.copy = function (e) {
  60180. return (
  60181. n.Material.prototype.copy.call(this, e),
  60182. this.color.copy(e.color),
  60183. (this.map = e.map),
  60184. (this.aoMap = e.aoMap),
  60185. (this.aoMapIntensity = e.aoMapIntensity),
  60186. (this.specularMap = e.specularMap),
  60187. (this.alphaMap = e.alphaMap),
  60188. (this.envMap = e.envMap),
  60189. (this.combine = e.combine),
  60190. (this.reflectivity = e.reflectivity),
  60191. (this.refractionRatio = e.refractionRatio),
  60192. (this.fog = e.fog),
  60193. (this.shading = e.shading),
  60194. (this.wireframe = e.wireframe),
  60195. (this.wireframeLinewidth = e.wireframeLinewidth),
  60196. (this.wireframeLinecap = e.wireframeLinecap),
  60197. (this.wireframeLinejoin = e.wireframeLinejoin),
  60198. (this.vertexColors = e.vertexColors),
  60199. (this.skinning = e.skinning),
  60200. (this.morphTargets = e.morphTargets),
  60201. this
  60202. );
  60203. }),
  60204. (n.MeshLambertMaterial = function (e) {
  60205. n.Material.call(this),
  60206. (this.type = "MeshLambertMaterial"),
  60207. (this.color = new n.Color(16777215)),
  60208. (this.map = null),
  60209. (this.lightMap = null),
  60210. (this.lightMapIntensity = 1),
  60211. (this.aoMap = null),
  60212. (this.aoMapIntensity = 1),
  60213. (this.emissive = new n.Color(0)),
  60214. (this.emissiveIntensity = 1),
  60215. (this.emissiveMap = null),
  60216. (this.specularMap = null),
  60217. (this.alphaMap = null),
  60218. (this.envMap = null),
  60219. (this.combine = n.MultiplyOperation),
  60220. (this.reflectivity = 1),
  60221. (this.refractionRatio = 0.98),
  60222. (this.fog = !0),
  60223. (this.blending = n.NormalBlending),
  60224. (this.wireframe = !1),
  60225. (this.wireframeLinewidth = 1),
  60226. (this.wireframeLinecap = "round"),
  60227. (this.wireframeLinejoin = "round"),
  60228. (this.vertexColors = n.NoColors),
  60229. (this.skinning = !1),
  60230. (this.morphTargets = !1),
  60231. (this.morphNormals = !1),
  60232. this.setValues(e);
  60233. }),
  60234. (n.MeshLambertMaterial.prototype = Object.create(
  60235. n.Material.prototype
  60236. )),
  60237. (n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial),
  60238. (n.MeshLambertMaterial.prototype.copy = function (e) {
  60239. return (
  60240. n.Material.prototype.copy.call(this, e),
  60241. this.color.copy(e.color),
  60242. (this.map = e.map),
  60243. (this.lightMap = e.lightMap),
  60244. (this.lightMapIntensity = e.lightMapIntensity),
  60245. (this.aoMap = e.aoMap),
  60246. (this.aoMapIntensity = e.aoMapIntensity),
  60247. this.emissive.copy(e.emissive),
  60248. (this.emissiveMap = e.emissiveMap),
  60249. (this.emissiveIntensity = e.emissiveIntensity),
  60250. (this.specularMap = e.specularMap),
  60251. (this.alphaMap = e.alphaMap),
  60252. (this.envMap = e.envMap),
  60253. (this.combine = e.combine),
  60254. (this.reflectivity = e.reflectivity),
  60255. (this.refractionRatio = e.refractionRatio),
  60256. (this.fog = e.fog),
  60257. (this.wireframe = e.wireframe),
  60258. (this.wireframeLinewidth = e.wireframeLinewidth),
  60259. (this.wireframeLinecap = e.wireframeLinecap),
  60260. (this.wireframeLinejoin = e.wireframeLinejoin),
  60261. (this.vertexColors = e.vertexColors),
  60262. (this.skinning = e.skinning),
  60263. (this.morphTargets = e.morphTargets),
  60264. (this.morphNormals = e.morphNormals),
  60265. this
  60266. );
  60267. }),
  60268. (n.MeshPhongMaterial = function (e) {
  60269. n.Material.call(this),
  60270. (this.type = "MeshPhongMaterial"),
  60271. (this.color = new n.Color(16777215)),
  60272. (this.specular = new n.Color(1118481)),
  60273. (this.shininess = 30),
  60274. (this.map = null),
  60275. (this.lightMap = null),
  60276. (this.lightMapIntensity = 1),
  60277. (this.aoMap = null),
  60278. (this.aoMapIntensity = 1),
  60279. (this.emissive = new n.Color(0)),
  60280. (this.emissiveIntensity = 1),
  60281. (this.emissiveMap = null),
  60282. (this.bumpMap = null),
  60283. (this.bumpScale = 1),
  60284. (this.normalMap = null),
  60285. (this.normalScale = new n.Vector2(1, 1)),
  60286. (this.displacementMap = null),
  60287. (this.displacementScale = 1),
  60288. (this.displacementBias = 0),
  60289. (this.specularMap = null),
  60290. (this.alphaMap = null),
  60291. (this.envMap = null),
  60292. (this.combine = n.MultiplyOperation),
  60293. (this.reflectivity = 1),
  60294. (this.refractionRatio = 0.98),
  60295. (this.fog = !0),
  60296. (this.shading = n.SmoothShading),
  60297. (this.blending = n.NormalBlending),
  60298. (this.wireframe = !1),
  60299. (this.wireframeLinewidth = 1),
  60300. (this.wireframeLinecap = "round"),
  60301. (this.wireframeLinejoin = "round"),
  60302. (this.vertexColors = n.NoColors),
  60303. (this.skinning = !1),
  60304. (this.morphTargets = !1),
  60305. (this.morphNormals = !1),
  60306. this.setValues(e);
  60307. }),
  60308. (n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype)),
  60309. (n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial),
  60310. (n.MeshPhongMaterial.prototype.copy = function (e) {
  60311. return (
  60312. n.Material.prototype.copy.call(this, e),
  60313. this.color.copy(e.color),
  60314. this.specular.copy(e.specular),
  60315. (this.shininess = e.shininess),
  60316. (this.map = e.map),
  60317. (this.lightMap = e.lightMap),
  60318. (this.lightMapIntensity = e.lightMapIntensity),
  60319. (this.aoMap = e.aoMap),
  60320. (this.aoMapIntensity = e.aoMapIntensity),
  60321. this.emissive.copy(e.emissive),
  60322. (this.emissiveMap = e.emissiveMap),
  60323. (this.emissiveIntensity = e.emissiveIntensity),
  60324. (this.bumpMap = e.bumpMap),
  60325. (this.bumpScale = e.bumpScale),
  60326. (this.normalMap = e.normalMap),
  60327. this.normalScale.copy(e.normalScale),
  60328. (this.displacementMap = e.displacementMap),
  60329. (this.displacementScale = e.displacementScale),
  60330. (this.displacementBias = e.displacementBias),
  60331. (this.specularMap = e.specularMap),
  60332. (this.alphaMap = e.alphaMap),
  60333. (this.envMap = e.envMap),
  60334. (this.combine = e.combine),
  60335. (this.reflectivity = e.reflectivity),
  60336. (this.refractionRatio = e.refractionRatio),
  60337. (this.fog = e.fog),
  60338. (this.shading = e.shading),
  60339. (this.wireframe = e.wireframe),
  60340. (this.wireframeLinewidth = e.wireframeLinewidth),
  60341. (this.wireframeLinecap = e.wireframeLinecap),
  60342. (this.wireframeLinejoin = e.wireframeLinejoin),
  60343. (this.vertexColors = e.vertexColors),
  60344. (this.skinning = e.skinning),
  60345. (this.morphTargets = e.morphTargets),
  60346. (this.morphNormals = e.morphNormals),
  60347. this
  60348. );
  60349. }),
  60350. (n.MeshStandardMaterial = function (e) {
  60351. n.Material.call(this),
  60352. (this.type = "MeshStandardMaterial"),
  60353. (this.color = new n.Color(16777215)),
  60354. (this.roughness = 0.5),
  60355. (this.metalness = 0.5),
  60356. (this.map = null),
  60357. (this.lightMap = null),
  60358. (this.lightMapIntensity = 1),
  60359. (this.aoMap = null),
  60360. (this.aoMapIntensity = 1),
  60361. (this.emissive = new n.Color(0)),
  60362. (this.emissiveIntensity = 1),
  60363. (this.emissiveMap = null),
  60364. (this.bumpMap = null),
  60365. (this.bumpScale = 1),
  60366. (this.normalMap = null),
  60367. (this.normalScale = new n.Vector2(1, 1)),
  60368. (this.displacementMap = null),
  60369. (this.displacementScale = 1),
  60370. (this.displacementBias = 0),
  60371. (this.roughnessMap = null),
  60372. (this.metalnessMap = null),
  60373. (this.alphaMap = null),
  60374. (this.envMap = null),
  60375. (this.envMapIntensity = 1),
  60376. (this.refractionRatio = 0.98),
  60377. (this.fog = !0),
  60378. (this.shading = n.SmoothShading),
  60379. (this.blending = n.NormalBlending),
  60380. (this.wireframe = !1),
  60381. (this.wireframeLinewidth = 1),
  60382. (this.wireframeLinecap = "round"),
  60383. (this.wireframeLinejoin = "round"),
  60384. (this.vertexColors = n.NoColors),
  60385. (this.skinning = !1),
  60386. (this.morphTargets = !1),
  60387. (this.morphNormals = !1),
  60388. this.setValues(e);
  60389. }),
  60390. (n.MeshStandardMaterial.prototype = Object.create(
  60391. n.Material.prototype
  60392. )),
  60393. (n.MeshStandardMaterial.prototype.constructor =
  60394. n.MeshStandardMaterial),
  60395. (n.MeshStandardMaterial.prototype.copy = function (e) {
  60396. return (
  60397. n.Material.prototype.copy.call(this, e),
  60398. this.color.copy(e.color),
  60399. (this.roughness = e.roughness),
  60400. (this.metalness = e.metalness),
  60401. (this.map = e.map),
  60402. (this.lightMap = e.lightMap),
  60403. (this.lightMapIntensity = e.lightMapIntensity),
  60404. (this.aoMap = e.aoMap),
  60405. (this.aoMapIntensity = e.aoMapIntensity),
  60406. this.emissive.copy(e.emissive),
  60407. (this.emissiveMap = e.emissiveMap),
  60408. (this.emissiveIntensity = e.emissiveIntensity),
  60409. (this.bumpMap = e.bumpMap),
  60410. (this.bumpScale = e.bumpScale),
  60411. (this.normalMap = e.normalMap),
  60412. this.normalScale.copy(e.normalScale),
  60413. (this.displacementMap = e.displacementMap),
  60414. (this.displacementScale = e.displacementScale),
  60415. (this.displacementBias = e.displacementBias),
  60416. (this.roughnessMap = e.roughnessMap),
  60417. (this.metalnessMap = e.metalnessMap),
  60418. (this.alphaMap = e.alphaMap),
  60419. (this.envMap = e.envMap),
  60420. (this.envMapIntensity = e.envMapIntensity),
  60421. (this.refractionRatio = e.refractionRatio),
  60422. (this.fog = e.fog),
  60423. (this.shading = e.shading),
  60424. (this.wireframe = e.wireframe),
  60425. (this.wireframeLinewidth = e.wireframeLinewidth),
  60426. (this.wireframeLinecap = e.wireframeLinecap),
  60427. (this.wireframeLinejoin = e.wireframeLinejoin),
  60428. (this.vertexColors = e.vertexColors),
  60429. (this.skinning = e.skinning),
  60430. (this.morphTargets = e.morphTargets),
  60431. (this.morphNormals = e.morphNormals),
  60432. this
  60433. );
  60434. }),
  60435. (n.MeshDepthMaterial = function (e) {
  60436. n.Material.call(this),
  60437. (this.type = "MeshDepthMaterial"),
  60438. (this.morphTargets = !1),
  60439. (this.wireframe = !1),
  60440. (this.wireframeLinewidth = 1),
  60441. this.setValues(e);
  60442. }),
  60443. (n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype)),
  60444. (n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial),
  60445. (n.MeshDepthMaterial.prototype.copy = function (e) {
  60446. return (
  60447. n.Material.prototype.copy.call(this, e),
  60448. (this.wireframe = e.wireframe),
  60449. (this.wireframeLinewidth = e.wireframeLinewidth),
  60450. this
  60451. );
  60452. }),
  60453. (n.MeshNormalMaterial = function (e) {
  60454. n.Material.call(this, e),
  60455. (this.type = "MeshNormalMaterial"),
  60456. (this.wireframe = !1),
  60457. (this.wireframeLinewidth = 1),
  60458. (this.morphTargets = !1),
  60459. this.setValues(e);
  60460. }),
  60461. (n.MeshNormalMaterial.prototype = Object.create(
  60462. n.Material.prototype
  60463. )),
  60464. (n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial),
  60465. (n.MeshNormalMaterial.prototype.copy = function (e) {
  60466. return (
  60467. n.Material.prototype.copy.call(this, e),
  60468. (this.wireframe = e.wireframe),
  60469. (this.wireframeLinewidth = e.wireframeLinewidth),
  60470. this
  60471. );
  60472. }),
  60473. (n.MultiMaterial = function (e) {
  60474. (this.uuid = n.Math.generateUUID()),
  60475. (this.type = "MultiMaterial"),
  60476. (this.materials = e instanceof Array ? e : []),
  60477. (this.visible = !0);
  60478. }),
  60479. (n.MultiMaterial.prototype = {
  60480. constructor: n.MultiMaterial,
  60481. toJSON: function (e) {
  60482. for (
  60483. var t = {
  60484. metadata: {
  60485. version: 4.2,
  60486. type: "material",
  60487. generator: "MaterialExporter",
  60488. },
  60489. uuid: this.uuid,
  60490. type: this.type,
  60491. materials: [],
  60492. },
  60493. i = this.materials,
  60494. n = 0,
  60495. r = i.length;
  60496. n < r;
  60497. n++
  60498. ) {
  60499. var o = i[n].toJSON(e);
  60500. delete o.metadata, t.materials.push(o);
  60501. }
  60502. return (t.visible = this.visible), t;
  60503. },
  60504. clone: function () {
  60505. for (
  60506. var e = new this.constructor(), t = 0;
  60507. t < this.materials.length;
  60508. t++
  60509. )
  60510. e.materials.push(this.materials[t].clone());
  60511. return (e.visible = this.visible), e;
  60512. },
  60513. }),
  60514. (n.PointsMaterial = function (e) {
  60515. n.Material.call(this),
  60516. (this.type = "PointsMaterial"),
  60517. (this.color = new n.Color(16777215)),
  60518. (this.map = null),
  60519. (this.size = 1),
  60520. (this.sizeAttenuation = !0),
  60521. (this.blending = n.NormalBlending),
  60522. (this.vertexColors = n.NoColors),
  60523. (this.fog = !0),
  60524. this.setValues(e);
  60525. }),
  60526. (n.PointsMaterial.prototype = Object.create(n.Material.prototype)),
  60527. (n.PointsMaterial.prototype.constructor = n.PointsMaterial),
  60528. (n.PointsMaterial.prototype.copy = function (e) {
  60529. return (
  60530. n.Material.prototype.copy.call(this, e),
  60531. this.color.copy(e.color),
  60532. (this.map = e.map),
  60533. (this.size = e.size),
  60534. (this.sizeAttenuation = e.sizeAttenuation),
  60535. (this.vertexColors = e.vertexColors),
  60536. (this.fog = e.fog),
  60537. this
  60538. );
  60539. }),
  60540. (n.ShaderMaterial = function (e) {
  60541. n.Material.call(this),
  60542. (this.type = "ShaderMaterial"),
  60543. (this.defines = {}),
  60544. (this.uniforms = {}),
  60545. (this.vertexShader =
  60546. "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}"),
  60547. (this.fragmentShader =
  60548. "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}"),
  60549. (this.shading = n.SmoothShading),
  60550. (this.linewidth = 1),
  60551. (this.wireframe = !1),
  60552. (this.wireframeLinewidth = 1),
  60553. (this.fog = !1),
  60554. (this.lights = !1),
  60555. (this.vertexColors = n.NoColors),
  60556. (this.skinning = !1),
  60557. (this.morphTargets = !1),
  60558. (this.morphNormals = !1),
  60559. (this.extensions = {
  60560. derivatives: !1,
  60561. fragDepth: !1,
  60562. drawBuffers: !1,
  60563. shaderTextureLOD: !1,
  60564. }),
  60565. (this.defaultAttributeValues = {
  60566. color: [1, 1, 1],
  60567. uv: [0, 0],
  60568. uv2: [0, 0],
  60569. }),
  60570. (this.index0AttributeName = void 0),
  60571. void 0 !== e &&
  60572. (void 0 !== e.attributes &&
  60573. console.error(
  60574. "THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."
  60575. ),
  60576. this.setValues(e));
  60577. }),
  60578. (n.ShaderMaterial.prototype = Object.create(n.Material.prototype)),
  60579. (n.ShaderMaterial.prototype.constructor = n.ShaderMaterial),
  60580. (n.ShaderMaterial.prototype.copy = function (e) {
  60581. return (
  60582. n.Material.prototype.copy.call(this, e),
  60583. (this.fragmentShader = e.fragmentShader),
  60584. (this.vertexShader = e.vertexShader),
  60585. (this.uniforms = n.UniformsUtils.clone(e.uniforms)),
  60586. (this.defines = e.defines),
  60587. (this.shading = e.shading),
  60588. (this.wireframe = e.wireframe),
  60589. (this.wireframeLinewidth = e.wireframeLinewidth),
  60590. (this.fog = e.fog),
  60591. (this.lights = e.lights),
  60592. (this.vertexColors = e.vertexColors),
  60593. (this.skinning = e.skinning),
  60594. (this.morphTargets = e.morphTargets),
  60595. (this.morphNormals = e.morphNormals),
  60596. (this.extensions = e.extensions),
  60597. this
  60598. );
  60599. }),
  60600. (n.ShaderMaterial.prototype.toJSON = function (e) {
  60601. var t = n.Material.prototype.toJSON.call(this, e);
  60602. return (
  60603. (t.uniforms = this.uniforms),
  60604. (t.vertexShader = this.vertexShader),
  60605. (t.fragmentShader = this.fragmentShader),
  60606. t
  60607. );
  60608. }),
  60609. (n.RawShaderMaterial = function (e) {
  60610. n.ShaderMaterial.call(this, e), (this.type = "RawShaderMaterial");
  60611. }),
  60612. (n.RawShaderMaterial.prototype = Object.create(
  60613. n.ShaderMaterial.prototype
  60614. )),
  60615. (n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial),
  60616. (n.SpriteMaterial = function (e) {
  60617. n.Material.call(this),
  60618. (this.type = "SpriteMaterial"),
  60619. (this.color = new n.Color(16777215)),
  60620. (this.map = null),
  60621. (this.rotation = 0),
  60622. (this.fog = !1),
  60623. this.setValues(e);
  60624. }),
  60625. (n.SpriteMaterial.prototype = Object.create(n.Material.prototype)),
  60626. (n.SpriteMaterial.prototype.constructor = n.SpriteMaterial),
  60627. (n.SpriteMaterial.prototype.copy = function (e) {
  60628. return (
  60629. n.Material.prototype.copy.call(this, e),
  60630. this.color.copy(e.color),
  60631. (this.map = e.map),
  60632. (this.rotation = e.rotation),
  60633. (this.fog = e.fog),
  60634. this
  60635. );
  60636. }),
  60637. (n.Texture = function (e, t, i, r, o, a, s, l, c) {
  60638. Object.defineProperty(this, "id", {
  60639. value: n.TextureIdCount++,
  60640. }),
  60641. (this.uuid = n.Math.generateUUID()),
  60642. (this.name = ""),
  60643. (this.sourceFile = ""),
  60644. (this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE),
  60645. (this.mipmaps = []),
  60646. (this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING),
  60647. (this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping),
  60648. (this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping),
  60649. (this.magFilter = void 0 !== o ? o : n.LinearFilter),
  60650. (this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter),
  60651. (this.anisotropy = void 0 !== c ? c : 1),
  60652. (this.format = void 0 !== s ? s : n.RGBAFormat),
  60653. (this.type = void 0 !== l ? l : n.UnsignedByteType),
  60654. (this.offset = new n.Vector2(0, 0)),
  60655. (this.repeat = new n.Vector2(1, 1)),
  60656. (this.generateMipmaps = !0),
  60657. (this.premultiplyAlpha = !1),
  60658. (this.flipY = !0),
  60659. (this.unpackAlignment = 4),
  60660. (this.encoding = n.LinearEncoding),
  60661. (this.version = 0),
  60662. (this.onUpdate = null);
  60663. }),
  60664. (n.Texture.DEFAULT_IMAGE = void 0),
  60665. (n.Texture.DEFAULT_MAPPING = n.UVMapping),
  60666. (n.Texture.prototype = {
  60667. constructor: n.Texture,
  60668. set needsUpdate(e) {
  60669. e === !0 && this.version++;
  60670. },
  60671. clone: function () {
  60672. return new this.constructor().copy(this);
  60673. },
  60674. copy: function (e) {
  60675. return (
  60676. (this.image = e.image),
  60677. (this.mipmaps = e.mipmaps.slice(0)),
  60678. (this.mapping = e.mapping),
  60679. (this.wrapS = e.wrapS),
  60680. (this.wrapT = e.wrapT),
  60681. (this.magFilter = e.magFilter),
  60682. (this.minFilter = e.minFilter),
  60683. (this.anisotropy = e.anisotropy),
  60684. (this.format = e.format),
  60685. (this.type = e.type),
  60686. this.offset.copy(e.offset),
  60687. this.repeat.copy(e.repeat),
  60688. (this.generateMipmaps = e.generateMipmaps),
  60689. (this.premultiplyAlpha = e.premultiplyAlpha),
  60690. (this.flipY = e.flipY),
  60691. (this.unpackAlignment = e.unpackAlignment),
  60692. (this.encoding = e.encoding),
  60693. this
  60694. );
  60695. },
  60696. toJSON: function (e) {
  60697. function t(e) {
  60698. var t;
  60699. return (
  60700. void 0 !== e.toDataURL
  60701. ? (t = e)
  60702. : ((t = document.createElement("canvas")),
  60703. (t.width = e.width),
  60704. (t.height = e.height),
  60705. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  60706. t.width > 2048 || t.height > 2048
  60707. ? t.toDataURL("image/jpeg", 0.6)
  60708. : t.toDataURL("image/png")
  60709. );
  60710. }
  60711. if (void 0 !== e.textures[this.uuid])
  60712. return e.textures[this.uuid];
  60713. var i = {
  60714. metadata: {
  60715. version: 4.4,
  60716. type: "Texture",
  60717. generator: "Texture.toJSON",
  60718. },
  60719. uuid: this.uuid,
  60720. name: this.name,
  60721. mapping: this.mapping,
  60722. repeat: [this.repeat.x, this.repeat.y],
  60723. offset: [this.offset.x, this.offset.y],
  60724. wrap: [this.wrapS, this.wrapT],
  60725. minFilter: this.minFilter,
  60726. magFilter: this.magFilter,
  60727. anisotropy: this.anisotropy,
  60728. };
  60729. if (void 0 !== this.image) {
  60730. var r = this.image;
  60731. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  60732. void 0 === e.images[r.uuid] &&
  60733. (e.images[r.uuid] = {
  60734. uuid: r.uuid,
  60735. url: t(r),
  60736. }),
  60737. (i.image = r.uuid);
  60738. }
  60739. return (e.textures[this.uuid] = i), i;
  60740. },
  60741. dispose: function () {
  60742. this.dispatchEvent({
  60743. type: "dispose",
  60744. });
  60745. },
  60746. transformUv: function (e) {
  60747. if (this.mapping === n.UVMapping) {
  60748. if (
  60749. (e.multiply(this.repeat),
  60750. e.add(this.offset),
  60751. e.x < 0 || e.x > 1)
  60752. )
  60753. switch (this.wrapS) {
  60754. case n.RepeatWrapping:
  60755. e.x = e.x - Math.floor(e.x);
  60756. break;
  60757. case n.ClampToEdgeWrapping:
  60758. e.x = e.x < 0 ? 0 : 1;
  60759. break;
  60760. case n.MirroredRepeatWrapping:
  60761. 1 === Math.abs(Math.floor(e.x) % 2)
  60762. ? (e.x = Math.ceil(e.x) - e.x)
  60763. : (e.x = e.x - Math.floor(e.x));
  60764. }
  60765. if (e.y < 0 || e.y > 1)
  60766. switch (this.wrapT) {
  60767. case n.RepeatWrapping:
  60768. e.y = e.y - Math.floor(e.y);
  60769. break;
  60770. case n.ClampToEdgeWrapping:
  60771. e.y = e.y < 0 ? 0 : 1;
  60772. break;
  60773. case n.MirroredRepeatWrapping:
  60774. 1 === Math.abs(Math.floor(e.y) % 2)
  60775. ? (e.y = Math.ceil(e.y) - e.y)
  60776. : (e.y = e.y - Math.floor(e.y));
  60777. }
  60778. this.flipY && (e.y = 1 - e.y);
  60779. }
  60780. },
  60781. }),
  60782. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  60783. (n.TextureIdCount = 0),
  60784. (n.CanvasTexture = function (e, t, i, r, o, a, s, l, c) {
  60785. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  60786. (this.needsUpdate = !0);
  60787. }),
  60788. (n.CanvasTexture.prototype = Object.create(n.Texture.prototype)),
  60789. (n.CanvasTexture.prototype.constructor = n.CanvasTexture),
  60790. (n.CubeTexture = function (e, t, i, r, o, a, s, l, c) {
  60791. (e = void 0 !== e ? e : []),
  60792. (t = void 0 !== t ? t : n.CubeReflectionMapping),
  60793. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  60794. (this.flipY = !1);
  60795. }),
  60796. (n.CubeTexture.prototype = Object.create(n.Texture.prototype)),
  60797. (n.CubeTexture.prototype.constructor = n.CubeTexture),
  60798. Object.defineProperty(n.CubeTexture.prototype, "images", {
  60799. get: function () {
  60800. return this.image;
  60801. },
  60802. set: function (e) {
  60803. this.image = e;
  60804. },
  60805. }),
  60806. (n.CompressedTexture = function (e, t, i, r, o, a, s, l, c, h, u) {
  60807. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  60808. (this.image = {
  60809. width: t,
  60810. height: i,
  60811. }),
  60812. (this.mipmaps = e),
  60813. (this.flipY = !1),
  60814. (this.generateMipmaps = !1);
  60815. }),
  60816. (n.CompressedTexture.prototype = Object.create(n.Texture.prototype)),
  60817. (n.CompressedTexture.prototype.constructor = n.CompressedTexture),
  60818. (n.DataTexture = function (e, t, i, r, o, a, s, l, c, h, u) {
  60819. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  60820. (this.image = {
  60821. data: e,
  60822. width: t,
  60823. height: i,
  60824. }),
  60825. (this.magFilter = void 0 !== c ? c : n.NearestFilter),
  60826. (this.minFilter = void 0 !== h ? h : n.NearestFilter),
  60827. (this.flipY = !1),
  60828. (this.generateMipmaps = !1);
  60829. }),
  60830. (n.DataTexture.prototype = Object.create(n.Texture.prototype)),
  60831. (n.DataTexture.prototype.constructor = n.DataTexture),
  60832. (n.VideoTexture = function (e, t, i, r, o, a, s, l, c) {
  60833. function h() {
  60834. requestAnimationFrame(h);
  60835. if (!e.paused && e.readyState === e.HAVE_ENOUGH_DATA) {
  60836. //改 add !e.paused
  60837. u.needsUpdate = !0;
  60838. }
  60839. }
  60840. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  60841. (this.generateMipmaps = !1);
  60842. var u = this;
  60843. h();
  60844. }),
  60845. (n.VideoTexture.prototype = Object.create(n.Texture.prototype)),
  60846. (n.VideoTexture.prototype.constructor = n.VideoTexture),
  60847. (n.Group = function () {
  60848. n.Object3D.call(this), (this.type = "Group");
  60849. }),
  60850. (n.Group.prototype = Object.create(n.Object3D.prototype)),
  60851. (n.Group.prototype.constructor = n.Group),
  60852. (n.Points = function (e, t) {
  60853. n.Object3D.call(this),
  60854. (this.type = "Points"),
  60855. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  60856. (this.material =
  60857. void 0 !== t
  60858. ? t
  60859. : new n.PointsMaterial({
  60860. color: 16777215 * Math.random(),
  60861. }));
  60862. }),
  60863. (n.Points.prototype = Object.create(n.Object3D.prototype)),
  60864. (n.Points.prototype.constructor = n.Points),
  60865. (n.Points.prototype.raycast = (function () {
  60866. var e = new n.Matrix4(),
  60867. t = new n.Ray(),
  60868. i = new n.Sphere();
  60869. return function (r, o) {
  60870. function a(e, i) {
  60871. var n = t.distanceSqToPoint(e);
  60872. if (n < d) {
  60873. var a = t.closestPointToPoint(e);
  60874. a.applyMatrix4(c);
  60875. var l = r.ray.origin.distanceTo(a);
  60876. if (l < r.near || l > r.far) return;
  60877. o.push({
  60878. distance: l,
  60879. distanceToRay: Math.sqrt(n),
  60880. point: a.clone(),
  60881. index: i,
  60882. face: null,
  60883. object: s,
  60884. });
  60885. }
  60886. }
  60887. var s = this,
  60888. l = this.geometry,
  60889. c = this.matrixWorld,
  60890. h = r.params.Points.threshold;
  60891. if (
  60892. (null === l.boundingSphere && l.computeBoundingSphere(),
  60893. i.copy(l.boundingSphere),
  60894. i.applyMatrix4(c),
  60895. r.ray.intersectsSphere(i) !== !1)
  60896. ) {
  60897. e.getInverse(c), t.copy(r.ray).applyMatrix4(e);
  60898. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3),
  60899. d = u * u,
  60900. p = new n.Vector3();
  60901. if (l instanceof n.BufferGeometry) {
  60902. var f = l.index,
  60903. g = l.attributes,
  60904. m = g.position.array;
  60905. if (null !== f)
  60906. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  60907. var C = v[A];
  60908. p.fromArray(m, 3 * C), a(p, C);
  60909. }
  60910. else
  60911. for (var A = 0, I = m.length / 3; A < I; A++)
  60912. p.fromArray(m, 3 * A), a(p, A);
  60913. } else
  60914. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  60915. a(E[A], A);
  60916. }
  60917. };
  60918. })()),
  60919. (n.Points.prototype.clone = function () {
  60920. return new this.constructor(this.geometry, this.material).copy(
  60921. this
  60922. );
  60923. }),
  60924. (n.Line = function (e, t, i) {
  60925. return 1 === i
  60926. ? (console.warn(
  60927. "THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."
  60928. ),
  60929. new n.LineSegments(e, t))
  60930. : (n.Object3D.call(this),
  60931. (this.type = "Line"),
  60932. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  60933. void (this.material =
  60934. void 0 !== t
  60935. ? t
  60936. : new n.LineBasicMaterial({
  60937. color: 16777215 * Math.random(),
  60938. })));
  60939. }),
  60940. (n.Line.prototype = Object.create(n.Object3D.prototype)),
  60941. (n.Line.prototype.constructor = n.Line),
  60942. (n.Line.prototype.raycast = (function () {
  60943. var e = new n.Matrix4(),
  60944. t = new n.Ray(),
  60945. i = new n.Sphere();
  60946. return function (r, o) {
  60947. var a = r.linePrecision,
  60948. s = a * a,
  60949. l = this.geometry,
  60950. c = this.matrixWorld;
  60951. if (
  60952. (null === l.boundingSphere && l.computeBoundingSphere(),
  60953. i.copy(l.boundingSphere),
  60954. i.applyMatrix4(c),
  60955. r.ray.intersectsSphere(i) !== !1)
  60956. ) {
  60957. e.getInverse(c), t.copy(r.ray).applyMatrix4(e);
  60958. var h = new n.Vector3(),
  60959. u = new n.Vector3(),
  60960. d = new n.Vector3(),
  60961. p = new n.Vector3(),
  60962. f = this instanceof n.LineSegments ? 2 : 1;
  60963. if (l instanceof n.BufferGeometry) {
  60964. var g = l.index,
  60965. m = l.attributes,
  60966. v = m.position.array;
  60967. if (null !== g)
  60968. for (
  60969. var A = g.array, y = 0, C = A.length - 1;
  60970. y < C;
  60971. y += f
  60972. ) {
  60973. var I = A[y],
  60974. E = A[y + 1];
  60975. h.fromArray(v, 3 * I), u.fromArray(v, 3 * E);
  60976. var b = t.distanceSqToSegment(h, u, p, d);
  60977. if (!(b > s)) {
  60978. p.applyMatrix4(this.matrixWorld);
  60979. var w = r.ray.origin.distanceTo(p);
  60980. w < r.near ||
  60981. w > r.far ||
  60982. o.push({
  60983. distance: w,
  60984. point: d.clone().applyMatrix4(this.matrixWorld),
  60985. index: y,
  60986. face: null,
  60987. faceIndex: null,
  60988. object: this,
  60989. });
  60990. }
  60991. }
  60992. else
  60993. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  60994. h.fromArray(v, 3 * y), u.fromArray(v, 3 * y + 3);
  60995. var b = t.distanceSqToSegment(h, u, p, d);
  60996. if (!(b > s)) {
  60997. p.applyMatrix4(this.matrixWorld);
  60998. var w = r.ray.origin.distanceTo(p);
  60999. w < r.near ||
  61000. w > r.far ||
  61001. o.push({
  61002. distance: w,
  61003. point: d.clone().applyMatrix4(this.matrixWorld),
  61004. index: y,
  61005. face: null,
  61006. faceIndex: null,
  61007. object: this,
  61008. });
  61009. }
  61010. }
  61011. } else if (l instanceof n.Geometry)
  61012. for (
  61013. var _ = l.vertices, T = _.length, y = 0;
  61014. y < T - 1;
  61015. y += f
  61016. ) {
  61017. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  61018. if (!(b > s)) {
  61019. p.applyMatrix4(this.matrixWorld);
  61020. var w = r.ray.origin.distanceTo(p);
  61021. w < r.near ||
  61022. w > r.far ||
  61023. o.push({
  61024. distance: w,
  61025. point: d.clone().applyMatrix4(this.matrixWorld),
  61026. index: y,
  61027. face: null,
  61028. faceIndex: null,
  61029. object: this,
  61030. });
  61031. }
  61032. }
  61033. }
  61034. };
  61035. })()),
  61036. (n.Line.prototype.clone = function () {
  61037. return new this.constructor(this.geometry, this.material).copy(
  61038. this
  61039. );
  61040. }),
  61041. (n.LineStrip = 0),
  61042. (n.LinePieces = 1),
  61043. (n.LineSegments = function (e, t) {
  61044. n.Line.call(this, e, t), (this.type = "LineSegments");
  61045. }),
  61046. (n.LineSegments.prototype = Object.create(n.Line.prototype)),
  61047. (n.LineSegments.prototype.constructor = n.LineSegments),
  61048. (n.Mesh = function (e, t) {
  61049. n.Object3D.call(this),
  61050. (this.type = "Mesh"),
  61051. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  61052. (this.material =
  61053. void 0 !== t
  61054. ? t
  61055. : new n.MeshBasicMaterial({
  61056. color: 16777215 * Math.random(),
  61057. })),
  61058. (this.drawMode = n.TrianglesDrawMode),
  61059. this.updateMorphTargets();
  61060. }),
  61061. (n.Mesh.prototype = Object.create(n.Object3D.prototype)),
  61062. (n.Mesh.prototype.constructor = n.Mesh),
  61063. (n.Mesh.prototype.setDrawMode = function (e) {
  61064. this.drawMode = e;
  61065. }),
  61066. (n.Mesh.prototype.updateMorphTargets = function () {
  61067. if (
  61068. void 0 !== this.geometry.morphTargets &&
  61069. this.geometry.morphTargets.length > 0
  61070. ) {
  61071. (this.morphTargetBase = -1),
  61072. (this.morphTargetInfluences = []),
  61073. (this.morphTargetDictionary = {});
  61074. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  61075. this.morphTargetInfluences.push(0),
  61076. (this.morphTargetDictionary[
  61077. this.geometry.morphTargets[e].name
  61078. ] = e);
  61079. }
  61080. }),
  61081. (n.Mesh.prototype.getMorphTargetIndexByName = function (e) {
  61082. return void 0 !== this.morphTargetDictionary[e]
  61083. ? this.morphTargetDictionary[e]
  61084. : (console.warn(
  61085. "THREE.Mesh.getMorphTargetIndexByName: morph target " +
  61086. e +
  61087. " does not exist. Returning 0."
  61088. ),
  61089. 0);
  61090. }),
  61091. (n.Mesh.prototype.raycast = (function () {
  61092. function e(e, t, i, r, o, a, s) {
  61093. return (
  61094. n.Triangle.barycoordFromPoint(e, t, i, r, m),
  61095. o.multiplyScalar(m.x),
  61096. a.multiplyScalar(m.y),
  61097. s.multiplyScalar(m.z),
  61098. o.add(a).add(s),
  61099. o.clone()
  61100. );
  61101. }
  61102. function t(e, t, i, r, o, a, s) {
  61103. var l,
  61104. c = e.material;
  61105. if (
  61106. ((l =
  61107. c.side === n.BackSide
  61108. ? i.intersectTriangle(a, o, r, !0, s)
  61109. : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s)),
  61110. null === l)
  61111. )
  61112. return null;
  61113. A.copy(s), A.applyMatrix4(e.matrixWorld);
  61114. var h = t.ray.origin.distanceTo(A);
  61115. return h < t.near || h > t.far
  61116. ? null
  61117. : {
  61118. distance: h,
  61119. point: A.clone(),
  61120. object: e,
  61121. };
  61122. }
  61123. function i(i, r, o, a, h, u, d, m) {
  61124. s.fromArray(a, 3 * u),
  61125. l.fromArray(a, 3 * d),
  61126. c.fromArray(a, 3 * m);
  61127. var A = t(i, r, o, s, l, c, v);
  61128. return (
  61129. A &&
  61130. (h &&
  61131. (p.fromArray(h, 2 * u),
  61132. f.fromArray(h, 2 * d),
  61133. g.fromArray(h, 2 * m),
  61134. (A.uv = e(v, s, l, c, p, f, g))),
  61135. (A.face = new n.Face3(u, d, m, n.Triangle.normal(s, l, c))),
  61136. (A.faceIndex = u)),
  61137. A
  61138. );
  61139. }
  61140. var r = new n.Matrix4(),
  61141. o = new n.Ray(),
  61142. a = new n.Sphere(),
  61143. s = new n.Vector3(),
  61144. l = new n.Vector3(),
  61145. c = new n.Vector3(),
  61146. h = new n.Vector3(),
  61147. u = new n.Vector3(),
  61148. d = new n.Vector3(),
  61149. p = new n.Vector2(),
  61150. f = new n.Vector2(),
  61151. g = new n.Vector2(),
  61152. m = new n.Vector3(),
  61153. v = new n.Vector3(),
  61154. A = new n.Vector3();
  61155. return function (m, A) {
  61156. var y = this.geometry,
  61157. C = this.material,
  61158. I = this.matrixWorld;
  61159. if (
  61160. void 0 !== C &&
  61161. (null === y.boundingSphere && y.computeBoundingSphere(),
  61162. a.copy(y.boundingSphere),
  61163. a.applyMatrix4(I),
  61164. m.ray.intersectsSphere(a) !== !1 &&
  61165. (r.getInverse(I),
  61166. o.copy(m.ray).applyMatrix4(r),
  61167. null === y.boundingBox ||
  61168. o.intersectsBox(y.boundingBox) !== !1))
  61169. ) {
  61170. var E, b;
  61171. if (y instanceof n.BufferGeometry) {
  61172. var w,
  61173. _,
  61174. T,
  61175. x = y.index,
  61176. S = y.attributes,
  61177. M = S.position.array;
  61178. if ((void 0 !== S.uv && (E = S.uv.array), null !== x))
  61179. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  61180. (w = R[P]),
  61181. (_ = R[P + 1]),
  61182. (T = R[P + 2]),
  61183. (b = i(this, m, o, M, E, w, _, T)),
  61184. b && ((b.faceIndex = Math.floor(P / 3)), A.push(b));
  61185. else
  61186. for (var P = 0, O = M.length; P < O; P += 9)
  61187. (w = P / 3),
  61188. (_ = w + 1),
  61189. (T = w + 2),
  61190. (b = i(this, m, o, M, E, w, _, T)),
  61191. b && ((b.index = w), A.push(b));
  61192. } else if (y instanceof n.Geometry) {
  61193. var L,
  61194. D,
  61195. N,
  61196. B = C instanceof n.MultiMaterial,
  61197. F = B === !0 ? C.materials : null,
  61198. V = y.vertices,
  61199. U = y.faces,
  61200. k = y.faceVertexUvs[0];
  61201. k.length > 0 && (E = k);
  61202. for (var H = 0, G = U.length; H < G; H++) {
  61203. var z = U[H],
  61204. W = B === !0 ? F[z.materialIndex] : C;
  61205. if (void 0 !== W) {
  61206. if (
  61207. ((L = V[z.a]),
  61208. (D = V[z.b]),
  61209. (N = V[z.c]),
  61210. W.morphTargets === !0)
  61211. ) {
  61212. var j = y.morphTargets,
  61213. Y = this.morphTargetInfluences;
  61214. s.set(0, 0, 0), l.set(0, 0, 0), c.set(0, 0, 0);
  61215. for (var X = 0, Z = j.length; X < Z; X++) {
  61216. var q = Y[X];
  61217. if (0 !== q) {
  61218. var K = j[X].vertices;
  61219. s.addScaledVector(h.subVectors(K[z.a], L), q),
  61220. l.addScaledVector(u.subVectors(K[z.b], D), q),
  61221. c.addScaledVector(d.subVectors(K[z.c], N), q);
  61222. }
  61223. }
  61224. s.add(L), l.add(D), c.add(N), (L = s), (D = l), (N = c);
  61225. }
  61226. if ((b = t(this, m, o, L, D, N, v))) {
  61227. if (E) {
  61228. var Q = E[H];
  61229. p.copy(Q[0]),
  61230. f.copy(Q[1]),
  61231. g.copy(Q[2]),
  61232. (b.uv = e(v, L, D, N, p, f, g));
  61233. }
  61234. (b.face = z), (b.faceIndex = H), A.push(b);
  61235. }
  61236. }
  61237. }
  61238. }
  61239. }
  61240. };
  61241. })()),
  61242. (n.Mesh.prototype.clone = function () {
  61243. return new this.constructor(this.geometry, this.material).copy(
  61244. this
  61245. );
  61246. }),
  61247. (n.Bone = function (e) {
  61248. n.Object3D.call(this), (this.type = "Bone"), (this.skin = e);
  61249. }),
  61250. (n.Bone.prototype = Object.create(n.Object3D.prototype)),
  61251. (n.Bone.prototype.constructor = n.Bone),
  61252. (n.Bone.prototype.copy = function (e) {
  61253. return (
  61254. n.Object3D.prototype.copy.call(this, e),
  61255. (this.skin = e.skin),
  61256. this
  61257. );
  61258. }),
  61259. (n.Skeleton = function (e, t, i) {
  61260. if (
  61261. ((this.useVertexTexture = void 0 === i || i),
  61262. (this.identityMatrix = new n.Matrix4()),
  61263. (e = e || []),
  61264. (this.bones = e.slice(0)),
  61265. this.useVertexTexture)
  61266. ) {
  61267. var r = Math.sqrt(4 * this.bones.length);
  61268. (r = n.Math.nextPowerOfTwo(Math.ceil(r))),
  61269. (r = Math.max(r, 4)),
  61270. (this.boneTextureWidth = r),
  61271. (this.boneTextureHeight = r),
  61272. (this.boneMatrices = new Float32Array(
  61273. this.boneTextureWidth * this.boneTextureHeight * 4
  61274. )),
  61275. (this.boneTexture = new n.DataTexture(
  61276. this.boneMatrices,
  61277. this.boneTextureWidth,
  61278. this.boneTextureHeight,
  61279. n.RGBAFormat,
  61280. n.FloatType
  61281. ));
  61282. } else this.boneMatrices = new Float32Array(16 * this.bones.length);
  61283. if (void 0 === t) this.calculateInverses();
  61284. else if (this.bones.length === t.length)
  61285. this.boneInverses = t.slice(0);
  61286. else {
  61287. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  61288. (this.boneInverses = []);
  61289. for (var o = 0, a = this.bones.length; o < a; o++)
  61290. this.boneInverses.push(new n.Matrix4());
  61291. }
  61292. }),
  61293. (n.Skeleton.prototype.calculateInverses = function () {
  61294. this.boneInverses = [];
  61295. for (var e = 0, t = this.bones.length; e < t; e++) {
  61296. var i = new n.Matrix4();
  61297. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  61298. this.boneInverses.push(i);
  61299. }
  61300. }),
  61301. (n.Skeleton.prototype.pose = function () {
  61302. for (var e, t = 0, i = this.bones.length; t < i; t++)
  61303. (e = this.bones[t]),
  61304. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  61305. for (var t = 0, i = this.bones.length; t < i; t++)
  61306. (e = this.bones[t]),
  61307. e &&
  61308. (e.parent
  61309. ? (e.matrix.getInverse(e.parent.matrixWorld),
  61310. e.matrix.multiply(e.matrixWorld))
  61311. : e.matrix.copy(e.matrixWorld),
  61312. e.matrix.decompose(e.position, e.quaternion, e.scale));
  61313. }),
  61314. (n.Skeleton.prototype.update = (function () {
  61315. var e = new n.Matrix4();
  61316. return function () {
  61317. for (var t = 0, i = this.bones.length; t < i; t++) {
  61318. var n = this.bones[t]
  61319. ? this.bones[t].matrixWorld
  61320. : this.identityMatrix;
  61321. e.multiplyMatrices(n, this.boneInverses[t]),
  61322. e.flattenToArrayOffset(this.boneMatrices, 16 * t);
  61323. }
  61324. this.useVertexTexture && (this.boneTexture.needsUpdate = !0);
  61325. };
  61326. })()),
  61327. (n.Skeleton.prototype.clone = function () {
  61328. return new n.Skeleton(
  61329. this.bones,
  61330. this.boneInverses,
  61331. this.useVertexTexture
  61332. );
  61333. }),
  61334. (n.SkinnedMesh = function (e, t, i) {
  61335. n.Mesh.call(this, e, t),
  61336. (this.type = "SkinnedMesh"),
  61337. (this.bindMode = "attached"),
  61338. (this.bindMatrix = new n.Matrix4()),
  61339. (this.bindMatrixInverse = new n.Matrix4());
  61340. var r = [];
  61341. if (this.geometry && void 0 !== this.geometry.bones) {
  61342. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  61343. (a = this.geometry.bones[s]),
  61344. (o = new n.Bone(this)),
  61345. r.push(o),
  61346. (o.name = a.name),
  61347. o.position.fromArray(a.pos),
  61348. o.quaternion.fromArray(a.rotq),
  61349. void 0 !== a.scl && o.scale.fromArray(a.scl);
  61350. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  61351. (a = this.geometry.bones[s]),
  61352. a.parent !== -1 && null !== a.parent
  61353. ? r[a.parent].add(r[s])
  61354. : this.add(r[s]);
  61355. }
  61356. this.normalizeSkinWeights(),
  61357. this.updateMatrixWorld(!0),
  61358. this.bind(new n.Skeleton(r, void 0, i), this.matrixWorld);
  61359. }),
  61360. (n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype)),
  61361. (n.SkinnedMesh.prototype.constructor = n.SkinnedMesh),
  61362. (n.SkinnedMesh.prototype.bind = function (e, t) {
  61363. (this.skeleton = e),
  61364. void 0 === t &&
  61365. (this.updateMatrixWorld(!0),
  61366. this.skeleton.calculateInverses(),
  61367. (t = this.matrixWorld)),
  61368. this.bindMatrix.copy(t),
  61369. this.bindMatrixInverse.getInverse(t);
  61370. }),
  61371. (n.SkinnedMesh.prototype.pose = function () {
  61372. this.skeleton.pose();
  61373. }),
  61374. (n.SkinnedMesh.prototype.normalizeSkinWeights = function () {
  61375. if (this.geometry instanceof n.Geometry)
  61376. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  61377. var t = this.geometry.skinWeights[e],
  61378. i = 1 / t.lengthManhattan();
  61379. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0);
  61380. }
  61381. else if (this.geometry instanceof n.BufferGeometry)
  61382. for (
  61383. var r = new n.Vector4(),
  61384. o = this.geometry.attributes.skinWeight,
  61385. e = 0;
  61386. e < o.count;
  61387. e++
  61388. ) {
  61389. (r.x = o.getX(e)),
  61390. (r.y = o.getY(e)),
  61391. (r.z = o.getZ(e)),
  61392. (r.w = o.getW(e));
  61393. var i = 1 / r.lengthManhattan();
  61394. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  61395. o.setXYZW(e, r.x, r.y, r.z, r.w);
  61396. }
  61397. }),
  61398. (n.SkinnedMesh.prototype.updateMatrixWorld = function (e) {
  61399. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  61400. "attached" === this.bindMode
  61401. ? this.bindMatrixInverse.getInverse(this.matrixWorld)
  61402. : "detached" === this.bindMode
  61403. ? this.bindMatrixInverse.getInverse(this.bindMatrix)
  61404. : console.warn(
  61405. "THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode
  61406. );
  61407. }),
  61408. (n.SkinnedMesh.prototype.clone = function () {
  61409. return new this.constructor(
  61410. this.geometry,
  61411. this.material,
  61412. this.useVertexTexture
  61413. ).copy(this);
  61414. }),
  61415. (n.LOD = function () {
  61416. n.Object3D.call(this),
  61417. (this.type = "LOD"),
  61418. Object.defineProperties(this, {
  61419. levels: {
  61420. enumerable: !0,
  61421. value: [],
  61422. },
  61423. objects: {
  61424. get: function () {
  61425. return (
  61426. console.warn(
  61427. "THREE.LOD: .objects has been renamed to .levels."
  61428. ),
  61429. this.levels
  61430. );
  61431. },
  61432. },
  61433. });
  61434. }),
  61435. (n.LOD.prototype = Object.create(n.Object3D.prototype)),
  61436. (n.LOD.prototype.constructor = n.LOD),
  61437. (n.LOD.prototype.addLevel = function (e, t) {
  61438. void 0 === t && (t = 0), (t = Math.abs(t));
  61439. for (
  61440. var i = this.levels, n = 0;
  61441. n < i.length && !(t < i[n].distance);
  61442. n++
  61443. );
  61444. i.splice(n, 0, {
  61445. distance: t,
  61446. object: e,
  61447. }),
  61448. this.add(e);
  61449. }),
  61450. (n.LOD.prototype.getObjectForDistance = function (e) {
  61451. for (
  61452. var t = this.levels, i = 1, n = t.length;
  61453. i < n && !(e < t[i].distance);
  61454. i++
  61455. );
  61456. return t[i - 1].object;
  61457. }),
  61458. (n.LOD.prototype.raycast = (function () {
  61459. var e = new n.Vector3();
  61460. return function (t, i) {
  61461. e.setFromMatrixPosition(this.matrixWorld);
  61462. var n = t.ray.origin.distanceTo(e);
  61463. this.getObjectForDistance(n).raycast(t, i);
  61464. };
  61465. })()),
  61466. (n.LOD.prototype.update = (function () {
  61467. var e = new n.Vector3(),
  61468. t = new n.Vector3();
  61469. return function (i) {
  61470. var n = this.levels;
  61471. if (n.length > 1) {
  61472. e.setFromMatrixPosition(i.matrixWorld),
  61473. t.setFromMatrixPosition(this.matrixWorld);
  61474. var r = e.distanceTo(t);
  61475. n[0].object.visible = !0;
  61476. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  61477. (n[o - 1].object.visible = !1), (n[o].object.visible = !0);
  61478. for (; o < a; o++) n[o].object.visible = !1;
  61479. }
  61480. };
  61481. })()),
  61482. (n.LOD.prototype.copy = function (e) {
  61483. n.Object3D.prototype.copy.call(this, e, !1);
  61484. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  61485. var o = t[i];
  61486. this.addLevel(o.object.clone(), o.distance);
  61487. }
  61488. return this;
  61489. }),
  61490. (n.LOD.prototype.toJSON = function (e) {
  61491. var t = n.Object3D.prototype.toJSON.call(this, e);
  61492. t.object.levels = [];
  61493. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  61494. var a = i[r];
  61495. t.object.levels.push({
  61496. object: a.object.uuid,
  61497. distance: a.distance,
  61498. });
  61499. }
  61500. return t;
  61501. }),
  61502. (n.Sprite = (function () {
  61503. var e = new Uint16Array([0, 1, 2, 0, 2, 3]),
  61504. t = new Float32Array([
  61505. -0.5, -0.5, 0, 0.5, -0.5, 0, 0.5, 0.5, 0, -0.5, 0.5, 0,
  61506. ]),
  61507. i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  61508. r = new n.BufferGeometry();
  61509. return (
  61510. r.setIndex(new n.BufferAttribute(e, 1)),
  61511. r.addAttribute("position", new n.BufferAttribute(t, 3)),
  61512. r.addAttribute("uv", new n.BufferAttribute(i, 2)),
  61513. function (e) {
  61514. n.Object3D.call(this),
  61515. (this.type = "Sprite"),
  61516. (this.geometry = r),
  61517. (this.material = void 0 !== e ? e : new n.SpriteMaterial());
  61518. }
  61519. );
  61520. })()),
  61521. (n.Sprite.prototype = Object.create(n.Object3D.prototype)),
  61522. (n.Sprite.prototype.constructor = n.Sprite),
  61523. (n.Sprite.prototype.raycast = (function () {
  61524. var e = new n.Vector3();
  61525. return function (t, i) {
  61526. e.setFromMatrixPosition(this.matrixWorld);
  61527. var n = t.ray.distanceSqToPoint(e),
  61528. r = this.scale.x * this.scale.y;
  61529. n > r ||
  61530. i.push({
  61531. distance: Math.sqrt(n),
  61532. point: this.position,
  61533. face: null,
  61534. object: this,
  61535. });
  61536. };
  61537. })()),
  61538. (n.Sprite.prototype.clone = function () {
  61539. return new this.constructor(this.material).copy(this);
  61540. }),
  61541. (n.Particle = n.Sprite),
  61542. (n.LensFlare = function (e, t, i, r, o) {
  61543. n.Object3D.call(this),
  61544. (this.lensFlares = []),
  61545. (this.positionScreen = new n.Vector3()),
  61546. (this.customUpdateCallback = void 0),
  61547. void 0 !== e && this.add(e, t, i, r, o);
  61548. }),
  61549. (n.LensFlare.prototype = Object.create(n.Object3D.prototype)),
  61550. (n.LensFlare.prototype.constructor = n.LensFlare),
  61551. (n.LensFlare.prototype.add = function (e, t, i, r, o, a) {
  61552. void 0 === t && (t = -1),
  61553. void 0 === i && (i = 0),
  61554. void 0 === a && (a = 1),
  61555. void 0 === o && (o = new n.Color(16777215)),
  61556. void 0 === r && (r = n.NormalBlending),
  61557. (i = Math.min(i, Math.max(0, i))),
  61558. this.lensFlares.push({
  61559. texture: e,
  61560. size: t,
  61561. distance: i,
  61562. x: 0,
  61563. y: 0,
  61564. z: 0,
  61565. scale: 1,
  61566. rotation: 0,
  61567. opacity: a,
  61568. color: o,
  61569. blending: r,
  61570. });
  61571. }),
  61572. (n.LensFlare.prototype.updateLensFlares = function () {
  61573. var e,
  61574. t,
  61575. i = this.lensFlares.length,
  61576. n = 2 * -this.positionScreen.x,
  61577. r = 2 * -this.positionScreen.y;
  61578. for (e = 0; e < i; e++)
  61579. (t = this.lensFlares[e]),
  61580. (t.x = this.positionScreen.x + n * t.distance),
  61581. (t.y = this.positionScreen.y + r * t.distance),
  61582. (t.wantedRotation = t.x * Math.PI * 0.25),
  61583. (t.rotation += 0.25 * (t.wantedRotation - t.rotation));
  61584. }),
  61585. (n.LensFlare.prototype.copy = function (e) {
  61586. n.Object3D.prototype.copy.call(this, e),
  61587. this.positionScreen.copy(e.positionScreen),
  61588. (this.customUpdateCallback = e.customUpdateCallback);
  61589. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  61590. this.lensFlares.push(e.lensFlares[t]);
  61591. return this;
  61592. }),
  61593. (n.Scene = function () {
  61594. n.Object3D.call(this),
  61595. (this.type = "Scene"),
  61596. (this.fog = null),
  61597. (this.overrideMaterial = null),
  61598. (this.autoUpdate = !0);
  61599. }),
  61600. (n.Scene.prototype = Object.create(n.Object3D.prototype)),
  61601. (n.Scene.prototype.constructor = n.Scene),
  61602. (n.Scene.prototype.copy = function (e, t) {
  61603. return (
  61604. n.Object3D.prototype.copy.call(this, e, t),
  61605. null !== e.fog && (this.fog = e.fog.clone()),
  61606. null !== e.overrideMaterial &&
  61607. (this.overrideMaterial = e.overrideMaterial.clone()),
  61608. (this.autoUpdate = e.autoUpdate),
  61609. (this.matrixAutoUpdate = e.matrixAutoUpdate),
  61610. this
  61611. );
  61612. }),
  61613. (n.Fog = function (e, t, i) {
  61614. (this.name = ""),
  61615. (this.color = new n.Color(e)),
  61616. (this.near = void 0 !== t ? t : 1),
  61617. (this.far = void 0 !== i ? i : 1e3);
  61618. }),
  61619. (n.Fog.prototype.clone = function () {
  61620. return new n.Fog(this.color.getHex(), this.near, this.far);
  61621. }),
  61622. (n.FogExp2 = function (e, t) {
  61623. (this.name = ""),
  61624. (this.color = new n.Color(e)),
  61625. (this.density = void 0 !== t ? t : 25e-5);
  61626. }),
  61627. (n.FogExp2.prototype.clone = function () {
  61628. return new n.FogExp2(this.color.getHex(), this.density);
  61629. }),
  61630. (n.ShaderChunk = {}),
  61631. (n.ShaderChunk.alphamap_fragment =
  61632. "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n"),
  61633. (n.ShaderChunk.alphamap_pars_fragment =
  61634. "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n"),
  61635. (n.ShaderChunk.alphatest_fragment =
  61636. "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n"),
  61637. (n.ShaderChunk.aomap_fragment =
  61638. "#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"),
  61639. (n.ShaderChunk.aomap_pars_fragment =
  61640. "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif"),
  61641. (n.ShaderChunk.begin_vertex =
  61642. "\nvec3 transformed = vec3( position );\n"),
  61643. (n.ShaderChunk.beginnormal_vertex =
  61644. "\nvec3 objectNormal = vec3( normal );\n"),
  61645. (n.ShaderChunk.bsdfs =
  61646. "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"),
  61647. (n.ShaderChunk.bumpmap_pars_fragment =
  61648. "#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"),
  61649. (n.ShaderChunk.color_fragment =
  61650. "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif"),
  61651. (n.ShaderChunk.color_pars_fragment =
  61652. "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n"),
  61653. (n.ShaderChunk.color_pars_vertex =
  61654. "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif"),
  61655. (n.ShaderChunk.color_vertex =
  61656. "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif"),
  61657. (n.ShaderChunk.common =
  61658. "#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"),
  61659. (n.ShaderChunk.cube_uv_reflection_fragment =
  61660. "#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"),
  61661. (n.ShaderChunk.defaultnormal_vertex =
  61662. "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n"),
  61663. (n.ShaderChunk.displacementmap_vertex =
  61664. "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n"),
  61665. (n.ShaderChunk.displacementmap_pars_vertex =
  61666. "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n"),
  61667. (n.ShaderChunk.emissivemap_fragment =
  61668. "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n"),
  61669. (n.ShaderChunk.emissivemap_pars_fragment =
  61670. "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n"),
  61671. (n.ShaderChunk.encodings_pars_fragment =
  61672. "\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"),
  61673. (n.ShaderChunk.encodings_fragment =
  61674. " gl_FragColor = linearToOutputTexel( gl_FragColor );\n"),
  61675. (n.ShaderChunk.envmap_fragment =
  61676. "#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"),
  61677. (n.ShaderChunk.envmap_pars_fragment =
  61678. "#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"),
  61679. (n.ShaderChunk.envmap_pars_vertex =
  61680. "#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"),
  61681. (n.ShaderChunk.envmap_vertex =
  61682. "#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"),
  61683. (n.ShaderChunk.fog_fragment =
  61684. "#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"),
  61685. (n.ShaderChunk.fog_pars_fragment =
  61686. "#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"),
  61687. (n.ShaderChunk.lightmap_fragment =
  61688. "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n"),
  61689. (n.ShaderChunk.lightmap_pars_fragment =
  61690. "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif"),
  61691. (n.ShaderChunk.lights_lambert_vertex =
  61692. "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"),
  61693. (n.ShaderChunk.lights_pars =
  61694. "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"),
  61695. (n.ShaderChunk.lights_phong_fragment =
  61696. "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n"),
  61697. (n.ShaderChunk.lights_phong_pars_fragment =
  61698. "#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"),
  61699. (n.ShaderChunk.lights_phong_pars_vertex =
  61700. "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n"),
  61701. (n.ShaderChunk.lights_phong_vertex =
  61702. "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n"),
  61703. (n.ShaderChunk.lights_standard_fragment =
  61704. "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"),
  61705. (n.ShaderChunk.lights_standard_pars_fragment =
  61706. "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"),
  61707. (n.ShaderChunk.lights_template =
  61708. "\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"),
  61709. (n.ShaderChunk.logdepthbuf_fragment =
  61710. "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif"),
  61711. (n.ShaderChunk.logdepthbuf_pars_fragment =
  61712. "#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n"),
  61713. (n.ShaderChunk.logdepthbuf_pars_vertex =
  61714. "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif"),
  61715. (n.ShaderChunk.logdepthbuf_vertex =
  61716. "#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"),
  61717. (n.ShaderChunk.map_fragment =
  61718. "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n"),
  61719. (n.ShaderChunk.map_pars_fragment =
  61720. "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n"),
  61721. (n.ShaderChunk.map_particle_fragment =
  61722. "#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"),
  61723. (n.ShaderChunk.map_particle_pars_fragment =
  61724. "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n"),
  61725. (n.ShaderChunk.metalnessmap_fragment =
  61726. "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n"),
  61727. (n.ShaderChunk.metalnessmap_pars_fragment =
  61728. "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif"),
  61729. (n.ShaderChunk.morphnormal_vertex =
  61730. "#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"),
  61731. (n.ShaderChunk.morphtarget_pars_vertex =
  61732. "#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");
  61733. n.ShaderChunk.morphtarget_vertex =
  61734. "#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";
  61735. (n.ShaderChunk.normal_fragment =
  61736. "#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"),
  61737. (n.ShaderChunk.normalmap_pars_fragment =
  61738. "#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"),
  61739. (n.ShaderChunk.premultiplied_alpha_fragment =
  61740. "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n"),
  61741. (n.ShaderChunk.project_vertex =
  61742. "#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"),
  61743. (n.ShaderChunk.roughnessmap_fragment =
  61744. "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n"),
  61745. (n.ShaderChunk.roughnessmap_pars_fragment =
  61746. "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif"),
  61747. (n.ShaderChunk.shadowmap_pars_fragment =
  61748. "#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"),
  61749. (n.ShaderChunk.shadowmap_pars_vertex =
  61750. "#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"),
  61751. (n.ShaderChunk.shadowmap_vertex =
  61752. "#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"),
  61753. (n.ShaderChunk.shadowmask_pars_fragment =
  61754. "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"),
  61755. (n.ShaderChunk.skinbase_vertex =
  61756. "#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"),
  61757. (n.ShaderChunk.skinning_pars_vertex =
  61758. "#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"),
  61759. (n.ShaderChunk.skinning_vertex =
  61760. "#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"),
  61761. (n.ShaderChunk.skinnormal_vertex =
  61762. "#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"),
  61763. (n.ShaderChunk.specularmap_fragment =
  61764. "float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif"),
  61765. (n.ShaderChunk.specularmap_pars_fragment =
  61766. "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif"),
  61767. (n.ShaderChunk.tonemapping_fragment =
  61768. "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n"),
  61769. (n.ShaderChunk.tonemapping_pars_fragment =
  61770. "#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"),
  61771. (n.ShaderChunk.uv2_pars_fragment =
  61772. "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif"),
  61773. (n.ShaderChunk.uv2_pars_vertex =
  61774. "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif"),
  61775. (n.ShaderChunk.uv2_vertex =
  61776. "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif"),
  61777. (n.ShaderChunk.uv_pars_fragment =
  61778. "#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"),
  61779. (n.ShaderChunk.uv_pars_vertex =
  61780. "#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"),
  61781. (n.ShaderChunk.uv_vertex =
  61782. "#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"),
  61783. (n.ShaderChunk.worldpos_vertex =
  61784. "#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"),
  61785. (n.UniformsUtils = {
  61786. merge: function (e) {
  61787. for (var t = {}, i = 0; i < e.length; i++) {
  61788. var n = this.clone(e[i]);
  61789. for (var r in n) t[r] = n[r];
  61790. }
  61791. return t;
  61792. },
  61793. clone: function (e) {
  61794. var t = {};
  61795. for (var i in e) {
  61796. t[i] = {};
  61797. for (var r in e[i]) {
  61798. var o = e[i][r];
  61799. o instanceof n.Color ||
  61800. o instanceof n.Vector2 ||
  61801. o instanceof n.Vector3 ||
  61802. o instanceof n.Vector4 ||
  61803. o instanceof n.Matrix3 ||
  61804. o instanceof n.Matrix4 ||
  61805. o instanceof n.Texture
  61806. ? (t[i][r] = o.clone())
  61807. : Array.isArray(o)
  61808. ? (t[i][r] = o.slice())
  61809. : (t[i][r] = o);
  61810. }
  61811. }
  61812. return t;
  61813. },
  61814. }),
  61815. (n.UniformsLib = {
  61816. common: {
  61817. diffuse: {
  61818. type: "c",
  61819. value: new n.Color(15658734),
  61820. },
  61821. opacity: {
  61822. type: "f",
  61823. value: 1,
  61824. },
  61825. map: {
  61826. type: "t",
  61827. value: null,
  61828. },
  61829. offsetRepeat: {
  61830. type: "v4",
  61831. value: new n.Vector4(0, 0, 1, 1),
  61832. },
  61833. specularMap: {
  61834. type: "t",
  61835. value: null,
  61836. },
  61837. alphaMap: {
  61838. type: "t",
  61839. value: null,
  61840. },
  61841. envMap: {
  61842. type: "t",
  61843. value: null,
  61844. },
  61845. flipEnvMap: {
  61846. type: "f",
  61847. value: -1,
  61848. },
  61849. reflectivity: {
  61850. type: "f",
  61851. value: 1,
  61852. },
  61853. refractionRatio: {
  61854. type: "f",
  61855. value: 0.98,
  61856. },
  61857. },
  61858. aomap: {
  61859. aoMap: {
  61860. type: "t",
  61861. value: null,
  61862. },
  61863. aoMapIntensity: {
  61864. type: "f",
  61865. value: 1,
  61866. },
  61867. },
  61868. lightmap: {
  61869. lightMap: {
  61870. type: "t",
  61871. value: null,
  61872. },
  61873. lightMapIntensity: {
  61874. type: "f",
  61875. value: 1,
  61876. },
  61877. },
  61878. emissivemap: {
  61879. emissiveMap: {
  61880. type: "t",
  61881. value: null,
  61882. },
  61883. },
  61884. bumpmap: {
  61885. bumpMap: {
  61886. type: "t",
  61887. value: null,
  61888. },
  61889. bumpScale: {
  61890. type: "f",
  61891. value: 1,
  61892. },
  61893. },
  61894. normalmap: {
  61895. normalMap: {
  61896. type: "t",
  61897. value: null,
  61898. },
  61899. normalScale: {
  61900. type: "v2",
  61901. value: new n.Vector2(1, 1),
  61902. },
  61903. },
  61904. displacementmap: {
  61905. displacementMap: {
  61906. type: "t",
  61907. value: null,
  61908. },
  61909. displacementScale: {
  61910. type: "f",
  61911. value: 1,
  61912. },
  61913. displacementBias: {
  61914. type: "f",
  61915. value: 0,
  61916. },
  61917. },
  61918. roughnessmap: {
  61919. roughnessMap: {
  61920. type: "t",
  61921. value: null,
  61922. },
  61923. },
  61924. metalnessmap: {
  61925. metalnessMap: {
  61926. type: "t",
  61927. value: null,
  61928. },
  61929. },
  61930. fog: {
  61931. fogDensity: {
  61932. type: "f",
  61933. value: 25e-5,
  61934. },
  61935. fogNear: {
  61936. type: "f",
  61937. value: 1,
  61938. },
  61939. fogFar: {
  61940. type: "f",
  61941. value: 2e3,
  61942. },
  61943. fogColor: {
  61944. type: "c",
  61945. value: new n.Color(16777215),
  61946. },
  61947. },
  61948. lights: {
  61949. ambientLightColor: {
  61950. type: "fv",
  61951. value: [],
  61952. },
  61953. directionalLights: {
  61954. type: "sa",
  61955. value: [],
  61956. properties: {
  61957. direction: {
  61958. type: "v3",
  61959. },
  61960. color: {
  61961. type: "c",
  61962. },
  61963. shadow: {
  61964. type: "i",
  61965. },
  61966. shadowBias: {
  61967. type: "f",
  61968. },
  61969. shadowRadius: {
  61970. type: "f",
  61971. },
  61972. shadowMapSize: {
  61973. type: "v2",
  61974. },
  61975. },
  61976. },
  61977. directionalShadowMap: {
  61978. type: "tv",
  61979. value: [],
  61980. },
  61981. directionalShadowMatrix: {
  61982. type: "m4v",
  61983. value: [],
  61984. },
  61985. spotLights: {
  61986. type: "sa",
  61987. value: [],
  61988. properties: {
  61989. color: {
  61990. type: "c",
  61991. },
  61992. position: {
  61993. type: "v3",
  61994. },
  61995. direction: {
  61996. type: "v3",
  61997. },
  61998. distance: {
  61999. type: "f",
  62000. },
  62001. coneCos: {
  62002. type: "f",
  62003. },
  62004. penumbraCos: {
  62005. type: "f",
  62006. },
  62007. decay: {
  62008. type: "f",
  62009. },
  62010. shadow: {
  62011. type: "i",
  62012. },
  62013. shadowBias: {
  62014. type: "f",
  62015. },
  62016. shadowRadius: {
  62017. type: "f",
  62018. },
  62019. shadowMapSize: {
  62020. type: "v2",
  62021. },
  62022. },
  62023. },
  62024. spotShadowMap: {
  62025. type: "tv",
  62026. value: [],
  62027. },
  62028. spotShadowMatrix: {
  62029. type: "m4v",
  62030. value: [],
  62031. },
  62032. pointLights: {
  62033. type: "sa",
  62034. value: [],
  62035. properties: {
  62036. color: {
  62037. type: "c",
  62038. },
  62039. position: {
  62040. type: "v3",
  62041. },
  62042. decay: {
  62043. type: "f",
  62044. },
  62045. distance: {
  62046. type: "f",
  62047. },
  62048. shadow: {
  62049. type: "i",
  62050. },
  62051. shadowBias: {
  62052. type: "f",
  62053. },
  62054. shadowRadius: {
  62055. type: "f",
  62056. },
  62057. shadowMapSize: {
  62058. type: "v2",
  62059. },
  62060. },
  62061. },
  62062. pointShadowMap: {
  62063. type: "tv",
  62064. value: [],
  62065. },
  62066. pointShadowMatrix: {
  62067. type: "m4v",
  62068. value: [],
  62069. },
  62070. hemisphereLights: {
  62071. type: "sa",
  62072. value: [],
  62073. properties: {
  62074. direction: {
  62075. type: "v3",
  62076. },
  62077. skyColor: {
  62078. type: "c",
  62079. },
  62080. groundColor: {
  62081. type: "c",
  62082. },
  62083. },
  62084. },
  62085. },
  62086. points: {
  62087. diffuse: {
  62088. type: "c",
  62089. value: new n.Color(15658734),
  62090. },
  62091. opacity: {
  62092. type: "f",
  62093. value: 1,
  62094. },
  62095. size: {
  62096. type: "f",
  62097. value: 1,
  62098. },
  62099. scale: {
  62100. type: "f",
  62101. value: 1,
  62102. },
  62103. map: {
  62104. type: "t",
  62105. value: null,
  62106. },
  62107. offsetRepeat: {
  62108. type: "v4",
  62109. value: new n.Vector4(0, 0, 1, 1),
  62110. },
  62111. },
  62112. }),
  62113. (n.ShaderChunk.cube_frag =
  62114. "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"),
  62115. (n.ShaderChunk.cube_vert =
  62116. "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"),
  62117. (n.ShaderChunk.depth_frag =
  62118. "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"),
  62119. (n.ShaderChunk.depth_vert =
  62120. "#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"),
  62121. (n.ShaderChunk.depthRGBA_frag =
  62122. "#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"),
  62123. (n.ShaderChunk.depthRGBA_vert =
  62124. "#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"),
  62125. (n.ShaderChunk.distanceRGBA_frag =
  62126. "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"),
  62127. (n.ShaderChunk.distanceRGBA_vert =
  62128. "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"),
  62129. (n.ShaderChunk.equirect_frag =
  62130. "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"),
  62131. (n.ShaderChunk.equirect_vert =
  62132. "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"),
  62133. (n.ShaderChunk.linedashed_frag =
  62134. "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"),
  62135. (n.ShaderChunk.linedashed_vert =
  62136. "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"),
  62137. (n.ShaderChunk.meshbasic_frag =
  62138. "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"),
  62139. (n.ShaderChunk.meshbasic_vert =
  62140. "#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"),
  62141. (n.ShaderChunk.meshlambert_frag =
  62142. "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"),
  62143. (n.ShaderChunk.meshlambert_vert =
  62144. "#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"),
  62145. (n.ShaderChunk.meshphong_frag =
  62146. "#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"),
  62147. (n.ShaderChunk.meshphong_vert =
  62148. "#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"),
  62149. (n.ShaderChunk.meshstandard_frag =
  62150. "#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"),
  62151. (n.ShaderChunk.meshstandard_vert =
  62152. "#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"),
  62153. (n.ShaderChunk.normal_frag =
  62154. "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"),
  62155. (n.ShaderChunk.normal_vert =
  62156. "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"),
  62157. (n.ShaderChunk.points_frag =
  62158. "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"),
  62159. (n.ShaderChunk.points_vert =
  62160. "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"),
  62161. (n.ShaderLib = {
  62162. basic: {
  62163. uniforms: n.UniformsUtils.merge([
  62164. n.UniformsLib.common,
  62165. n.UniformsLib.aomap,
  62166. n.UniformsLib.fog,
  62167. ]),
  62168. vertexShader: n.ShaderChunk.meshbasic_vert,
  62169. fragmentShader: n.ShaderChunk.meshbasic_frag,
  62170. },
  62171. lambert: {
  62172. uniforms: n.UniformsUtils.merge([
  62173. n.UniformsLib.common,
  62174. n.UniformsLib.aomap,
  62175. n.UniformsLib.lightmap,
  62176. n.UniformsLib.emissivemap,
  62177. n.UniformsLib.fog,
  62178. n.UniformsLib.lights,
  62179. {
  62180. emissive: {
  62181. type: "c",
  62182. value: new n.Color(0),
  62183. },
  62184. },
  62185. ]),
  62186. vertexShader: n.ShaderChunk.meshlambert_vert,
  62187. fragmentShader: n.ShaderChunk.meshlambert_frag,
  62188. },
  62189. phong: {
  62190. uniforms: n.UniformsUtils.merge([
  62191. n.UniformsLib.common,
  62192. n.UniformsLib.aomap,
  62193. n.UniformsLib.lightmap,
  62194. n.UniformsLib.emissivemap,
  62195. n.UniformsLib.bumpmap,
  62196. n.UniformsLib.normalmap,
  62197. n.UniformsLib.displacementmap,
  62198. n.UniformsLib.fog,
  62199. n.UniformsLib.lights,
  62200. {
  62201. emissive: {
  62202. type: "c",
  62203. value: new n.Color(0),
  62204. },
  62205. specular: {
  62206. type: "c",
  62207. value: new n.Color(1118481),
  62208. },
  62209. shininess: {
  62210. type: "f",
  62211. value: 30,
  62212. },
  62213. },
  62214. ]),
  62215. vertexShader: n.ShaderChunk.meshphong_vert,
  62216. fragmentShader: n.ShaderChunk.meshphong_frag,
  62217. },
  62218. standard: {
  62219. uniforms: n.UniformsUtils.merge([
  62220. n.UniformsLib.common,
  62221. n.UniformsLib.aomap,
  62222. n.UniformsLib.lightmap,
  62223. n.UniformsLib.emissivemap,
  62224. n.UniformsLib.bumpmap,
  62225. n.UniformsLib.normalmap,
  62226. n.UniformsLib.displacementmap,
  62227. n.UniformsLib.roughnessmap,
  62228. n.UniformsLib.metalnessmap,
  62229. n.UniformsLib.fog,
  62230. n.UniformsLib.lights,
  62231. {
  62232. emissive: {
  62233. type: "c",
  62234. value: new n.Color(0),
  62235. },
  62236. roughness: {
  62237. type: "f",
  62238. value: 0.5,
  62239. },
  62240. metalness: {
  62241. type: "f",
  62242. value: 0,
  62243. },
  62244. envMapIntensity: {
  62245. type: "f",
  62246. value: 1,
  62247. },
  62248. },
  62249. ]),
  62250. vertexShader: n.ShaderChunk.meshstandard_vert,
  62251. fragmentShader: n.ShaderChunk.meshstandard_frag,
  62252. },
  62253. points: {
  62254. uniforms: n.UniformsUtils.merge([
  62255. n.UniformsLib.points,
  62256. n.UniformsLib.fog,
  62257. ]),
  62258. vertexShader: n.ShaderChunk.points_vert,
  62259. fragmentShader: n.ShaderChunk.points_frag,
  62260. },
  62261. dashed: {
  62262. uniforms: n.UniformsUtils.merge([
  62263. n.UniformsLib.common,
  62264. n.UniformsLib.fog,
  62265. {
  62266. scale: {
  62267. type: "f",
  62268. value: 1,
  62269. },
  62270. dashSize: {
  62271. type: "f",
  62272. value: 1,
  62273. },
  62274. totalSize: {
  62275. type: "f",
  62276. value: 2,
  62277. },
  62278. },
  62279. ]),
  62280. vertexShader: n.ShaderChunk.linedashed_vert,
  62281. fragmentShader: n.ShaderChunk.linedashed_frag,
  62282. },
  62283. depth: {
  62284. uniforms: {
  62285. mNear: {
  62286. type: "f",
  62287. value: 1,
  62288. },
  62289. mFar: {
  62290. type: "f",
  62291. value: 2e3,
  62292. },
  62293. opacity: {
  62294. type: "f",
  62295. value: 1,
  62296. },
  62297. },
  62298. vertexShader: n.ShaderChunk.depth_vert,
  62299. fragmentShader: n.ShaderChunk.depth_frag,
  62300. },
  62301. normal: {
  62302. uniforms: {
  62303. opacity: {
  62304. type: "f",
  62305. value: 1,
  62306. },
  62307. },
  62308. vertexShader: n.ShaderChunk.normal_vert,
  62309. fragmentShader: n.ShaderChunk.normal_frag,
  62310. },
  62311. cube: {
  62312. uniforms: {
  62313. tCube: {
  62314. type: "t",
  62315. value: null,
  62316. },
  62317. tFlip: {
  62318. type: "f",
  62319. value: -1,
  62320. },
  62321. },
  62322. vertexShader: n.ShaderChunk.cube_vert,
  62323. fragmentShader: n.ShaderChunk.cube_frag,
  62324. },
  62325. equirect: {
  62326. uniforms: {
  62327. tEquirect: {
  62328. type: "t",
  62329. value: null,
  62330. },
  62331. tFlip: {
  62332. type: "f",
  62333. value: -1,
  62334. },
  62335. },
  62336. vertexShader: n.ShaderChunk.equirect_vert,
  62337. fragmentShader: n.ShaderChunk.equirect_frag,
  62338. },
  62339. depthRGBA: {
  62340. uniforms: {},
  62341. vertexShader: n.ShaderChunk.depthRGBA_vert,
  62342. fragmentShader: n.ShaderChunk.depthRGBA_frag,
  62343. },
  62344. distanceRGBA: {
  62345. uniforms: {
  62346. lightPos: {
  62347. type: "v3",
  62348. value: new n.Vector3(0, 0, 0),
  62349. },
  62350. },
  62351. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  62352. fragmentShader: n.ShaderChunk.distanceRGBA_frag,
  62353. },
  62354. }),
  62355. (n.WebGLRenderer = function (e) {
  62356. function t() {
  62357. return null === ye ? Oe : 1;
  62358. }
  62359. function i(e, t, i, n) {
  62360. se === !0 && ((e *= n), (t *= n), (i *= n)),
  62361. Ye.clearColor(e, t, i, n);
  62362. }
  62363. function r() {
  62364. Ye.init(),
  62365. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  62366. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  62367. i(Se.r, Se.g, Se.b, Me);
  62368. }
  62369. function o() {
  62370. (Ae = null), (be = null), (Ee = ""), (Ie = -1), Ye.reset();
  62371. }
  62372. function a(e) {
  62373. e.preventDefault(), o(), r(), Xe.clear();
  62374. }
  62375. function s(e) {
  62376. var t = e.target;
  62377. t.removeEventListener("dispose", s), h(t), ke.textures--;
  62378. }
  62379. function l(e) {
  62380. var t = e.target;
  62381. t.removeEventListener("dispose", l), u(t), ke.textures--;
  62382. }
  62383. function c(e) {
  62384. var t = e.target;
  62385. t.removeEventListener("dispose", c), d(t);
  62386. }
  62387. function h(e) {
  62388. var t = Xe.get(e);
  62389. if (e.image && t.__image__webglTextureCube)
  62390. Ge.deleteTexture(t.__image__webglTextureCube);
  62391. else {
  62392. if (void 0 === t.__webglInit) return;
  62393. Ge.deleteTexture(t.__webglTexture);
  62394. }
  62395. Xe.delete(e);
  62396. }
  62397. function u(e) {
  62398. var t = Xe.get(e),
  62399. i = Xe.get(e.texture);
  62400. if (e && void 0 !== i.__webglTexture) {
  62401. if (
  62402. (Ge.deleteTexture(i.__webglTexture),
  62403. e instanceof n.WebGLRenderTargetCube)
  62404. )
  62405. for (var r = 0; r < 6; r++)
  62406. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  62407. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  62408. else
  62409. Ge.deleteFramebuffer(t.__webglFramebuffer),
  62410. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  62411. Xe.delete(e.texture), Xe.delete(e);
  62412. }
  62413. }
  62414. function d(e) {
  62415. p(e), Xe.delete(e);
  62416. }
  62417. function p(e) {
  62418. var t = Xe.get(e).program;
  62419. (e.program = void 0), void 0 !== t && qe.releaseProgram(t);
  62420. }
  62421. function f(e, t, i, r) {
  62422. var o;
  62423. if (
  62424. i instanceof n.InstancedBufferGeometry &&
  62425. ((o = We.get("ANGLE_instanced_arrays")), null === o)
  62426. )
  62427. return void console.error(
  62428. "THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."
  62429. );
  62430. void 0 === r && (r = 0), Ye.initAttributes();
  62431. var a = i.attributes,
  62432. s = t.getAttributes(),
  62433. l = e.defaultAttributeValues;
  62434. for (var c in s) {
  62435. var h = s[c];
  62436. if (h >= 0) {
  62437. var u = a[c];
  62438. if (void 0 !== u) {
  62439. var d = u.itemSize,
  62440. p = Ze.getAttributeBuffer(u);
  62441. if (u instanceof n.InterleavedBufferAttribute) {
  62442. var f = u.data,
  62443. g = f.stride,
  62444. m = u.offset;
  62445. f instanceof n.InstancedInterleavedBuffer
  62446. ? (Ye.enableAttributeAndDivisor(
  62447. h,
  62448. f.meshPerAttribute,
  62449. o
  62450. ),
  62451. void 0 === i.maxInstancedCount &&
  62452. (i.maxInstancedCount =
  62453. f.meshPerAttribute * f.count))
  62454. : Ye.enableAttribute(h),
  62455. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  62456. Ge.vertexAttribPointer(
  62457. h,
  62458. d,
  62459. Ge.FLOAT,
  62460. !1,
  62461. g * f.array.BYTES_PER_ELEMENT,
  62462. (r * g + m) * f.array.BYTES_PER_ELEMENT
  62463. );
  62464. } else
  62465. u instanceof n.InstancedBufferAttribute
  62466. ? (Ye.enableAttributeAndDivisor(
  62467. h,
  62468. u.meshPerAttribute,
  62469. o
  62470. ),
  62471. void 0 === i.maxInstancedCount &&
  62472. (i.maxInstancedCount =
  62473. u.meshPerAttribute * u.count))
  62474. : Ye.enableAttribute(h),
  62475. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  62476. Ge.vertexAttribPointer(
  62477. h,
  62478. d,
  62479. Ge.FLOAT,
  62480. !1,
  62481. 0,
  62482. r * d * 4
  62483. );
  62484. } else if (void 0 !== l) {
  62485. var v = l[c];
  62486. if (void 0 !== v)
  62487. switch (v.length) {
  62488. case 2:
  62489. Ge.vertexAttrib2fv(h, v);
  62490. break;
  62491. case 3:
  62492. Ge.vertexAttrib3fv(h, v);
  62493. break;
  62494. case 4:
  62495. Ge.vertexAttrib4fv(h, v);
  62496. break;
  62497. default:
  62498. Ge.vertexAttrib1fv(h, v);
  62499. }
  62500. }
  62501. }
  62502. }
  62503. Ye.disableUnusedAttributes();
  62504. }
  62505. function g(e, t) {
  62506. return Math.abs(t[0]) - Math.abs(e[0]);
  62507. }
  62508. function m(e, t) {
  62509. return e.object.renderOrder !== t.object.renderOrder
  62510. ? e.object.renderOrder - t.object.renderOrder
  62511. : e.material.id !== t.material.id
  62512. ? e.material.id - t.material.id
  62513. : e.z !== t.z
  62514. ? e.z - t.z
  62515. : e.id - t.id;
  62516. }
  62517. function v(e, t) {
  62518. return e.object.renderOrder !== t.object.renderOrder
  62519. ? e.object.renderOrder - t.object.renderOrder
  62520. : e.z !== t.z
  62521. ? t.z - e.z
  62522. : e.id - t.id;
  62523. }
  62524. function A(e, t, i, n, r) {
  62525. var o, a;
  62526. i.transparent ? ((o = de), (a = ++pe)) : ((o = he), (a = ++ue));
  62527. var s = o[a];
  62528. void 0 !== s
  62529. ? ((s.id = e.id),
  62530. (s.object = e),
  62531. (s.geometry = t),
  62532. (s.material = i),
  62533. (s.z = Ve.z),
  62534. (s.group = r))
  62535. : ((s = {
  62536. id: e.id,
  62537. object: e,
  62538. geometry: t,
  62539. material: i,
  62540. z: Ve.z,
  62541. group: r,
  62542. }),
  62543. o.push(s));
  62544. }
  62545. function y(e, t) {
  62546. if (e.visible !== !1) {
  62547. if (e.layers.test(t.layers))
  62548. if (e instanceof n.Light) ce.push(e);
  62549. else if (e instanceof n.Sprite)
  62550. (e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0) ||
  62551. ge.push(e);
  62552. else if (e instanceof n.LensFlare) me.push(e);
  62553. else if (e instanceof n.ImmediateRenderObject)
  62554. ve.sortObjects === !0 &&
  62555. (Ve.setFromMatrixPosition(e.matrixWorld),
  62556. Ve.applyProjection(Fe)),
  62557. A(e, null, e.material, Ve.z, null);
  62558. else if (
  62559. (e instanceof n.Mesh ||
  62560. e instanceof n.Line ||
  62561. e instanceof n.Points) &&
  62562. (e instanceof n.SkinnedMesh && e.skeleton.update(),
  62563. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)
  62564. ) {
  62565. var i = e.material;
  62566. if (i.visible === !0) {
  62567. ve.sortObjects === !0 &&
  62568. (Ve.setFromMatrixPosition(e.matrixWorld),
  62569. Ve.applyProjection(Fe));
  62570. var r = Ze.update(e);
  62571. if (i instanceof n.MultiMaterial)
  62572. for (
  62573. var o = r.groups,
  62574. a = i.materials,
  62575. s = 0,
  62576. l = o.length;
  62577. s < l;
  62578. s++
  62579. ) {
  62580. var c = o[s],
  62581. h = a[c.materialIndex];
  62582. h.visible === !0 && A(e, r, h, Ve.z, c);
  62583. }
  62584. else A(e, r, i, Ve.z, null);
  62585. }
  62586. }
  62587. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  62588. y(u[s], t);
  62589. }
  62590. }
  62591. function C(e, t, i, r) {
  62592. for (var o = 0, a = e.length; o < a; o++) {
  62593. var s = e[o],
  62594. l = s.object,
  62595. c = s.geometry,
  62596. h = void 0 === r ? s.material : r,
  62597. u = s.group;
  62598. if (
  62599. (l.modelViewMatrix.multiplyMatrices(
  62600. t.matrixWorldInverse,
  62601. l.matrixWorld
  62602. ),
  62603. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  62604. l instanceof n.ImmediateRenderObject)
  62605. ) {
  62606. E(h);
  62607. var d = w(t, i, h, l);
  62608. (Ee = ""),
  62609. l.render(function (e) {
  62610. ve.renderBufferImmediate(e, d, h);
  62611. });
  62612. } else ve.renderBufferDirect(t, i, c, h, l, u);
  62613. }
  62614. }
  62615. function I(e, t, i) {
  62616. var r = Xe.get(e),
  62617. o = qe.getParameters(e, Ue, t, i),
  62618. a = qe.getProgramCode(e, o),
  62619. s = r.program,
  62620. l = !0;
  62621. if (void 0 === s) e.addEventListener("dispose", c);
  62622. else if (s.code !== a) p(e);
  62623. else {
  62624. if (void 0 !== o.shaderID) return;
  62625. l = !1;
  62626. }
  62627. if (l) {
  62628. if (o.shaderID) {
  62629. var h = n.ShaderLib[o.shaderID];
  62630. r.__webglShader = {
  62631. name: e.type,
  62632. uniforms: n.UniformsUtils.clone(h.uniforms),
  62633. vertexShader: h.vertexShader,
  62634. fragmentShader: h.fragmentShader,
  62635. };
  62636. } else
  62637. r.__webglShader = {
  62638. name: e.type,
  62639. uniforms: e.uniforms,
  62640. vertexShader: e.vertexShader,
  62641. fragmentShader: e.fragmentShader,
  62642. };
  62643. (e.__webglShader = r.__webglShader),
  62644. (s = qe.acquireProgram(e, o, a)),
  62645. (r.program = s),
  62646. (e.program = s);
  62647. }
  62648. var u = s.getAttributes();
  62649. if (e.morphTargets) {
  62650. e.numSupportedMorphTargets = 0;
  62651. for (var d = 0; d < ve.maxMorphTargets; d++)
  62652. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++;
  62653. }
  62654. if (e.morphNormals) {
  62655. e.numSupportedMorphNormals = 0;
  62656. for (var d = 0; d < ve.maxMorphNormals; d++)
  62657. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++;
  62658. }
  62659. r.uniformsList = [];
  62660. var f = r.__webglShader.uniforms,
  62661. g = r.program.getUniforms();
  62662. for (var m in f) {
  62663. var v = g[m];
  62664. v && r.uniformsList.push([r.__webglShader.uniforms[m], v]);
  62665. }
  62666. (e instanceof n.MeshPhongMaterial ||
  62667. e instanceof n.MeshLambertMaterial ||
  62668. e instanceof n.MeshStandardMaterial ||
  62669. e.lights) &&
  62670. ((r.lightsHash = Ue.hash),
  62671. (f.ambientLightColor.value = Ue.ambient),
  62672. (f.directionalLights.value = Ue.directional),
  62673. (f.spotLights.value = Ue.spot),
  62674. (f.pointLights.value = Ue.point),
  62675. (f.hemisphereLights.value = Ue.hemi),
  62676. (f.directionalShadowMap.value = Ue.directionalShadowMap),
  62677. (f.directionalShadowMatrix.value = Ue.directionalShadowMatrix),
  62678. (f.spotShadowMap.value = Ue.spotShadowMap),
  62679. (f.spotShadowMatrix.value = Ue.spotShadowMatrix),
  62680. (f.pointShadowMap.value = Ue.pointShadowMap),
  62681. (f.pointShadowMatrix.value = Ue.pointShadowMatrix)),
  62682. (r.hasDynamicUniforms = !1);
  62683. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  62684. var C = r.uniformsList[A][0];
  62685. if (C.dynamic === !0) {
  62686. r.hasDynamicUniforms = !0;
  62687. break;
  62688. }
  62689. }
  62690. }
  62691. function E(e) {
  62692. b(e),
  62693. e.transparent === !0
  62694. ? Ye.setBlending(
  62695. e.blending,
  62696. e.blendEquation,
  62697. e.blendSrc,
  62698. e.blendDst,
  62699. e.blendEquationAlpha,
  62700. e.blendSrcAlpha,
  62701. e.blendDstAlpha,
  62702. e.premultipliedAlpha
  62703. )
  62704. : Ye.setBlending(n.NoBlending),
  62705. Ye.setDepthFunc(e.depthFunc),
  62706. Ye.setDepthTest(e.depthTest),
  62707. Ye.setDepthWrite(e.depthWrite),
  62708. Ye.setColorWrite(e.colorWrite),
  62709. Ye.setPolygonOffset(
  62710. e.polygonOffset,
  62711. e.polygonOffsetFactor,
  62712. e.polygonOffsetUnits
  62713. );
  62714. }
  62715. function b(e) {
  62716. e.side !== n.DoubleSide
  62717. ? Ye.enable(Ge.CULL_FACE)
  62718. : Ye.disable(Ge.CULL_FACE),
  62719. Ye.setFlipSided(e.side === n.BackSide);
  62720. }
  62721. function w(e, t, i, r) {
  62722. xe = 0;
  62723. var o = Xe.get(i);
  62724. void 0 === o.program && (i.needsUpdate = !0),
  62725. void 0 !== o.lightsHash &&
  62726. o.lightsHash !== Ue.hash &&
  62727. (i.needsUpdate = !0),
  62728. i.needsUpdate && (I(i, t, r), (i.needsUpdate = !1));
  62729. var a = !1,
  62730. s = !1,
  62731. l = !1,
  62732. c = o.program,
  62733. h = c.getUniforms(),
  62734. u = o.__webglShader.uniforms;
  62735. if (
  62736. (c.id !== Ae &&
  62737. (Ge.useProgram(c.program),
  62738. (Ae = c.id),
  62739. (a = !0),
  62740. (s = !0),
  62741. (l = !0)),
  62742. i.id !== Ie && ((Ie = i.id), (s = !0)),
  62743. (a || e !== be) &&
  62744. (Ge.uniformMatrix4fv(
  62745. h.projectionMatrix,
  62746. !1,
  62747. e.projectionMatrix.elements
  62748. ),
  62749. je.logarithmicDepthBuffer &&
  62750. Ge.uniform1f(
  62751. h.logDepthBufFC,
  62752. 2 / (Math.log(e.far + 1) / Math.LN2)
  62753. ),
  62754. e !== be && ((be = e), (s = !0), (l = !0)),
  62755. (i instanceof n.ShaderMaterial ||
  62756. i instanceof n.MeshPhongMaterial ||
  62757. i instanceof n.MeshStandardMaterial ||
  62758. i.envMap) &&
  62759. void 0 !== h.cameraPosition &&
  62760. (Ve.setFromMatrixPosition(e.matrixWorld),
  62761. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  62762. (i instanceof n.MeshPhongMaterial ||
  62763. i instanceof n.MeshLambertMaterial ||
  62764. i instanceof n.MeshBasicMaterial ||
  62765. i instanceof n.MeshStandardMaterial ||
  62766. i instanceof n.ShaderMaterial ||
  62767. i.skinning) &&
  62768. void 0 !== h.viewMatrix &&
  62769. Ge.uniformMatrix4fv(
  62770. h.viewMatrix,
  62771. !1,
  62772. e.matrixWorldInverse.elements
  62773. ),
  62774. void 0 !== h.toneMappingExposure &&
  62775. Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  62776. void 0 !== h.toneMappingWhitePoint &&
  62777. Ge.uniform1f(
  62778. h.toneMappingWhitePoint,
  62779. ve.toneMappingWhitePoint
  62780. )),
  62781. i.skinning)
  62782. )
  62783. if (
  62784. (r.bindMatrix &&
  62785. void 0 !== h.bindMatrix &&
  62786. Ge.uniformMatrix4fv(
  62787. h.bindMatrix,
  62788. !1,
  62789. r.bindMatrix.elements
  62790. ),
  62791. r.bindMatrixInverse &&
  62792. void 0 !== h.bindMatrixInverse &&
  62793. Ge.uniformMatrix4fv(
  62794. h.bindMatrixInverse,
  62795. !1,
  62796. r.bindMatrixInverse.elements
  62797. ),
  62798. je.floatVertexTextures &&
  62799. r.skeleton &&
  62800. r.skeleton.useVertexTexture)
  62801. ) {
  62802. if (void 0 !== h.boneTexture) {
  62803. var d = B();
  62804. Ge.uniform1i(h.boneTexture, d),
  62805. ve.setTexture(r.skeleton.boneTexture, d);
  62806. }
  62807. void 0 !== h.boneTextureWidth &&
  62808. Ge.uniform1i(
  62809. h.boneTextureWidth,
  62810. r.skeleton.boneTextureWidth
  62811. ),
  62812. void 0 !== h.boneTextureHeight &&
  62813. Ge.uniform1i(
  62814. h.boneTextureHeight,
  62815. r.skeleton.boneTextureHeight
  62816. );
  62817. } else
  62818. r.skeleton &&
  62819. r.skeleton.boneMatrices &&
  62820. void 0 !== h.boneGlobalMatrices &&
  62821. Ge.uniformMatrix4fv(
  62822. h.boneGlobalMatrices,
  62823. !1,
  62824. r.skeleton.boneMatrices
  62825. );
  62826. return (
  62827. s &&
  62828. ((i instanceof n.MeshPhongMaterial ||
  62829. i instanceof n.MeshLambertMaterial ||
  62830. i instanceof n.MeshStandardMaterial ||
  62831. i.lights) &&
  62832. D(u, l),
  62833. t && i.fog && R(u, t),
  62834. (i instanceof n.MeshBasicMaterial ||
  62835. i instanceof n.MeshLambertMaterial ||
  62836. i instanceof n.MeshPhongMaterial ||
  62837. i instanceof n.MeshStandardMaterial) &&
  62838. T(u, i),
  62839. i instanceof n.LineBasicMaterial
  62840. ? x(u, i)
  62841. : i instanceof n.LineDashedMaterial
  62842. ? (x(u, i), S(u, i))
  62843. : i instanceof n.PointsMaterial
  62844. ? M(u, i)
  62845. : i instanceof n.MeshLambertMaterial
  62846. ? P(u, i)
  62847. : i instanceof n.MeshPhongMaterial
  62848. ? O(u, i)
  62849. : i instanceof n.MeshStandardMaterial
  62850. ? L(u, i)
  62851. : i instanceof n.MeshDepthMaterial
  62852. ? ((u.mNear.value = e.near),
  62853. (u.mFar.value = e.far),
  62854. (u.opacity.value = i.opacity))
  62855. : i instanceof n.MeshNormalMaterial &&
  62856. (u.opacity.value = i.opacity),
  62857. V(o.uniformsList)),
  62858. N(h, r),
  62859. void 0 !== h.modelMatrix &&
  62860. Ge.uniformMatrix4fv(
  62861. h.modelMatrix,
  62862. !1,
  62863. r.matrixWorld.elements
  62864. ),
  62865. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  62866. c
  62867. );
  62868. }
  62869. function _(e, t, i) {
  62870. for (var n = [], r = 0, o = e.length; r < o; r++) {
  62871. var a = e[r][0],
  62872. s = a.onUpdateCallback;
  62873. void 0 !== s && (s.bind(a)(t, i), n.push(e[r]));
  62874. }
  62875. V(n);
  62876. }
  62877. function T(e, t) {
  62878. (e.opacity.value = t.opacity),
  62879. (e.diffuse.value = t.color),
  62880. t.emissive &&
  62881. e.emissive.value
  62882. .copy(t.emissive)
  62883. .multiplyScalar(t.emissiveIntensity),
  62884. (e.map.value = t.map),
  62885. (e.specularMap.value = t.specularMap),
  62886. (e.alphaMap.value = t.alphaMap),
  62887. t.aoMap &&
  62888. ((e.aoMap.value = t.aoMap),
  62889. (e.aoMapIntensity.value = t.aoMapIntensity));
  62890. var i;
  62891. if (
  62892. (t.map
  62893. ? (i = t.map)
  62894. : t.specularMap
  62895. ? (i = t.specularMap)
  62896. : t.displacementMap
  62897. ? (i = t.displacementMap)
  62898. : t.normalMap
  62899. ? (i = t.normalMap)
  62900. : t.bumpMap
  62901. ? (i = t.bumpMap)
  62902. : t.roughnessMap
  62903. ? (i = t.roughnessMap)
  62904. : t.metalnessMap
  62905. ? (i = t.metalnessMap)
  62906. : t.alphaMap
  62907. ? (i = t.alphaMap)
  62908. : t.emissiveMap && (i = t.emissiveMap),
  62909. void 0 !== i)
  62910. ) {
  62911. i instanceof n.WebGLRenderTarget && (i = i.texture);
  62912. var r = i.offset,
  62913. o = i.repeat;
  62914. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y);
  62915. }
  62916. (e.envMap.value = t.envMap),
  62917. (e.flipEnvMap.value =
  62918. t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1),
  62919. (e.reflectivity.value = t.reflectivity),
  62920. (e.refractionRatio.value = t.refractionRatio);
  62921. }
  62922. function x(e, t) {
  62923. (e.diffuse.value = t.color), (e.opacity.value = t.opacity);
  62924. }
  62925. function S(e, t) {
  62926. (e.dashSize.value = t.dashSize),
  62927. (e.totalSize.value = t.dashSize + t.gapSize),
  62928. (e.scale.value = t.scale);
  62929. }
  62930. function M(e, t) {
  62931. if (
  62932. ((e.diffuse.value = t.color),
  62933. (e.opacity.value = t.opacity),
  62934. (e.size.value = t.size * Oe),
  62935. (e.scale.value = te.clientHeight / 2),
  62936. (e.map.value = t.map),
  62937. null !== t.map)
  62938. ) {
  62939. var i = t.map.offset,
  62940. n = t.map.repeat;
  62941. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y);
  62942. }
  62943. }
  62944. function R(e, t) {
  62945. (e.fogColor.value = t.color),
  62946. t instanceof n.Fog
  62947. ? ((e.fogNear.value = t.near), (e.fogFar.value = t.far))
  62948. : t instanceof n.FogExp2 && (e.fogDensity.value = t.density);
  62949. }
  62950. function P(e, t) {
  62951. t.lightMap &&
  62952. ((e.lightMap.value = t.lightMap),
  62953. (e.lightMapIntensity.value = t.lightMapIntensity)),
  62954. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap);
  62955. }
  62956. function O(e, t) {
  62957. (e.specular.value = t.specular),
  62958. (e.shininess.value = Math.max(t.shininess, 1e-4)),
  62959. t.lightMap &&
  62960. ((e.lightMap.value = t.lightMap),
  62961. (e.lightMapIntensity.value = t.lightMapIntensity)),
  62962. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  62963. t.bumpMap &&
  62964. ((e.bumpMap.value = t.bumpMap),
  62965. (e.bumpScale.value = t.bumpScale)),
  62966. t.normalMap &&
  62967. ((e.normalMap.value = t.normalMap),
  62968. e.normalScale.value.copy(t.normalScale)),
  62969. t.displacementMap &&
  62970. ((e.displacementMap.value = t.displacementMap),
  62971. (e.displacementScale.value = t.displacementScale),
  62972. (e.displacementBias.value = t.displacementBias));
  62973. }
  62974. function L(e, t) {
  62975. (e.roughness.value = t.roughness),
  62976. (e.metalness.value = t.metalness),
  62977. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  62978. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  62979. t.lightMap &&
  62980. ((e.lightMap.value = t.lightMap),
  62981. (e.lightMapIntensity.value = t.lightMapIntensity)),
  62982. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  62983. t.bumpMap &&
  62984. ((e.bumpMap.value = t.bumpMap),
  62985. (e.bumpScale.value = t.bumpScale)),
  62986. t.normalMap &&
  62987. ((e.normalMap.value = t.normalMap),
  62988. e.normalScale.value.copy(t.normalScale)),
  62989. t.displacementMap &&
  62990. ((e.displacementMap.value = t.displacementMap),
  62991. (e.displacementScale.value = t.displacementScale),
  62992. (e.displacementBias.value = t.displacementBias)),
  62993. t.envMap && (e.envMapIntensity.value = t.envMapIntensity);
  62994. }
  62995. function D(e, t) {
  62996. (e.ambientLightColor.needsUpdate = t),
  62997. (e.directionalLights.needsUpdate = t),
  62998. (e.pointLights.needsUpdate = t),
  62999. (e.spotLights.needsUpdate = t),
  63000. (e.hemisphereLights.needsUpdate = t);
  63001. }
  63002. function N(e, t) {
  63003. Ge.uniformMatrix4fv(
  63004. e.modelViewMatrix,
  63005. !1,
  63006. t.modelViewMatrix.elements
  63007. ),
  63008. e.normalMatrix &&
  63009. Ge.uniformMatrix3fv(
  63010. e.normalMatrix,
  63011. !1,
  63012. t.normalMatrix.elements
  63013. );
  63014. }
  63015. function B() {
  63016. var e = xe;
  63017. return (
  63018. e >= je.maxTextures &&
  63019. console.warn(
  63020. "WebGLRenderer: trying to use " +
  63021. e +
  63022. " texture units while this GPU supports only " +
  63023. je.maxTextures
  63024. ),
  63025. (xe += 1),
  63026. e
  63027. );
  63028. }
  63029. function F(e, t, i, r) {
  63030. var o, a;
  63031. if ("1i" === t) Ge.uniform1i(i, r);
  63032. else if ("1f" === t) Ge.uniform1f(i, r);
  63033. else if ("2f" === t) Ge.uniform2f(i, r[0], r[1]);
  63034. else if ("3f" === t) Ge.uniform3f(i, r[0], r[1], r[2]);
  63035. else if ("4f" === t) Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  63036. else if ("1iv" === t) Ge.uniform1iv(i, r);
  63037. else if ("3iv" === t) Ge.uniform3iv(i, r);
  63038. else if ("1fv" === t) Ge.uniform1fv(i, r);
  63039. else if ("2fv" === t) Ge.uniform2fv(i, r);
  63040. else if ("3fv" === t) Ge.uniform3fv(i, r);
  63041. else if ("4fv" === t) Ge.uniform4fv(i, r);
  63042. else if ("Matrix2fv" === t) Ge.uniformMatrix2fv(i, !1, r);
  63043. else if ("Matrix3fv" === t) Ge.uniformMatrix3fv(i, !1, r);
  63044. else if ("Matrix4fv" === t) Ge.uniformMatrix4fv(i, !1, r);
  63045. else if ("i" === t) Ge.uniform1i(i, r);
  63046. else if ("f" === t) Ge.uniform1f(i, r);
  63047. else if ("v2" === t) Ge.uniform2f(i, r.x, r.y);
  63048. else if ("v3" === t) Ge.uniform3f(i, r.x, r.y, r.z);
  63049. else if ("v4" === t) Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  63050. else if ("c" === t) Ge.uniform3f(i, r.r, r.g, r.b);
  63051. else if ("s" === t) {
  63052. var s = e.properties;
  63053. for (var l in s) {
  63054. var c = s[l],
  63055. h = i[l],
  63056. u = r[l];
  63057. F(c, c.type, h, u);
  63058. }
  63059. } else if ("sa" === t)
  63060. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  63061. for (var l in s) {
  63062. var c = s[l],
  63063. h = i[d][l],
  63064. u = r[d][l];
  63065. F(c, c.type, h, u);
  63066. }
  63067. else if ("iv1" === t) Ge.uniform1iv(i, r);
  63068. else if ("iv" === t) Ge.uniform3iv(i, r);
  63069. else if ("fv1" === t) Ge.uniform1fv(i, r);
  63070. else if ("fv" === t) Ge.uniform3fv(i, r);
  63071. else if ("v2v" === t) {
  63072. void 0 === e._array &&
  63073. (e._array = new Float32Array(2 * r.length));
  63074. for (var d = 0, f = 0, g = r.length; d < g; d++, f += 2)
  63075. (e._array[f + 0] = r[d].x), (e._array[f + 1] = r[d].y);
  63076. Ge.uniform2fv(i, e._array);
  63077. } else if ("v3v" === t) {
  63078. void 0 === e._array &&
  63079. (e._array = new Float32Array(3 * r.length));
  63080. for (var d = 0, m = 0, g = r.length; d < g; d++, m += 3)
  63081. (e._array[m + 0] = r[d].x),
  63082. (e._array[m + 1] = r[d].y),
  63083. (e._array[m + 2] = r[d].z);
  63084. Ge.uniform3fv(i, e._array);
  63085. } else if ("v4v" === t) {
  63086. void 0 === e._array &&
  63087. (e._array = new Float32Array(4 * r.length));
  63088. for (var d = 0, v = 0, g = r.length; d < g; d++, v += 4)
  63089. (e._array[v + 0] = r[d].x),
  63090. (e._array[v + 1] = r[d].y),
  63091. (e._array[v + 2] = r[d].z),
  63092. (e._array[v + 3] = r[d].w);
  63093. Ge.uniform4fv(i, e._array);
  63094. } else if ("m2" === t) Ge.uniformMatrix2fv(i, !1, r.elements);
  63095. else if ("m3" === t) Ge.uniformMatrix3fv(i, !1, r.elements);
  63096. else if ("m3v" === t) {
  63097. void 0 === e._array &&
  63098. (e._array = new Float32Array(9 * r.length));
  63099. for (var d = 0, g = r.length; d < g; d++)
  63100. r[d].flattenToArrayOffset(e._array, 9 * d);
  63101. Ge.uniformMatrix3fv(i, !1, e._array);
  63102. } else if ("m4" === t) Ge.uniformMatrix4fv(i, !1, r.elements);
  63103. else if ("m4v" === t) {
  63104. void 0 === e._array &&
  63105. (e._array = new Float32Array(16 * r.length));
  63106. for (var d = 0, g = r.length; d < g; d++)
  63107. r[d].flattenToArrayOffset(e._array, 16 * d);
  63108. Ge.uniformMatrix4fv(i, !1, e._array);
  63109. } else if ("t" === t) {
  63110. if (((o = r), (a = B()), Ge.uniform1i(i, a), !o)) return;
  63111. o instanceof n.CubeTexture ||
  63112. (Array.isArray(o.image) && 6 === o.image.length)
  63113. ? Y(o, a)
  63114. : o instanceof n.WebGLRenderTargetCube
  63115. ? X(o.texture, a)
  63116. : o instanceof n.WebGLRenderTarget
  63117. ? ve.setTexture(o.texture, a)
  63118. : ve.setTexture(o, a);
  63119. } else if ("tv" === t) {
  63120. void 0 === e._array && (e._array = []);
  63121. for (var d = 0, g = e.value.length; d < g; d++)
  63122. e._array[d] = B();
  63123. Ge.uniform1iv(i, e._array);
  63124. for (var d = 0, g = e.value.length; d < g; d++)
  63125. (o = e.value[d]),
  63126. (a = e._array[d]),
  63127. o &&
  63128. (o instanceof n.CubeTexture ||
  63129. (o.image instanceof Array && 6 === o.image.length)
  63130. ? Y(o, a)
  63131. : o instanceof n.WebGLRenderTarget
  63132. ? ve.setTexture(o.texture, a)
  63133. : o instanceof n.WebGLRenderTargetCube
  63134. ? X(o.texture, a)
  63135. : ve.setTexture(o, a));
  63136. } else
  63137. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t);
  63138. }
  63139. function V(e) {
  63140. for (var t = 0, i = e.length; t < i; t++) {
  63141. var n = e[t][0];
  63142. if (n.needsUpdate !== !1) {
  63143. var r = n.type,
  63144. o = e[t][1],
  63145. a = n.value;
  63146. F(n, r, o, a);
  63147. }
  63148. }
  63149. }
  63150. function U(e, t) {
  63151. var i,
  63152. r,
  63153. o,
  63154. a,
  63155. s,
  63156. l,
  63157. c = 0,
  63158. h = 0,
  63159. u = 0,
  63160. d = t.matrixWorldInverse,
  63161. p = 0,
  63162. f = 0,
  63163. g = 0,
  63164. m = 0,
  63165. v = 0;
  63166. for (Ue.shadowsPointLight = 0, i = 0, r = e.length; i < r; i++)
  63167. if (
  63168. ((o = e[i]),
  63169. (a = o.color),
  63170. (s = o.intensity),
  63171. (l = o.distance),
  63172. o instanceof n.AmbientLight)
  63173. )
  63174. (c += a.r * s), (h += a.g * s), (u += a.b * s);
  63175. else if (o instanceof n.DirectionalLight) {
  63176. var A = Ke.get(o);
  63177. A.color.copy(o.color).multiplyScalar(o.intensity),
  63178. A.direction.setFromMatrixPosition(o.matrixWorld),
  63179. Ve.setFromMatrixPosition(o.target.matrixWorld),
  63180. A.direction.sub(Ve),
  63181. A.direction.transformDirection(d),
  63182. (A.shadow = o.castShadow),
  63183. o.castShadow &&
  63184. ((A.shadowBias = o.shadow.bias),
  63185. (A.shadowRadius = o.shadow.radius),
  63186. (A.shadowMapSize = o.shadow.mapSize),
  63187. (Ue.shadows[v++] = o)),
  63188. (Ue.directionalShadowMap[p] = o.shadow.map),
  63189. (Ue.directionalShadowMatrix[p] = o.shadow.matrix),
  63190. (Ue.directional[p++] = A);
  63191. } else if (o instanceof n.SpotLight) {
  63192. var A = Ke.get(o);
  63193. A.position.setFromMatrixPosition(o.matrixWorld),
  63194. A.position.applyMatrix4(d),
  63195. A.color.copy(a).multiplyScalar(s),
  63196. (A.distance = l),
  63197. A.direction.setFromMatrixPosition(o.matrixWorld),
  63198. Ve.setFromMatrixPosition(o.target.matrixWorld),
  63199. A.direction.sub(Ve),
  63200. A.direction.transformDirection(d),
  63201. (A.coneCos = Math.cos(o.angle)),
  63202. (A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra))),
  63203. (A.decay = 0 === o.distance ? 0 : o.decay),
  63204. (A.shadow = o.castShadow),
  63205. o.castShadow &&
  63206. ((A.shadowBias = o.shadow.bias),
  63207. (A.shadowRadius = o.shadow.radius),
  63208. (A.shadowMapSize = o.shadow.mapSize),
  63209. (Ue.shadows[v++] = o)),
  63210. (Ue.spotShadowMap[g] = o.shadow.map),
  63211. (Ue.spotShadowMatrix[g] = o.shadow.matrix),
  63212. (Ue.spot[g++] = A);
  63213. } else if (o instanceof n.PointLight) {
  63214. var A = Ke.get(o);
  63215. A.position.setFromMatrixPosition(o.matrixWorld),
  63216. A.position.applyMatrix4(d),
  63217. A.color.copy(o.color).multiplyScalar(o.intensity),
  63218. (A.distance = o.distance),
  63219. (A.decay = 0 === o.distance ? 0 : o.decay),
  63220. (A.shadow = o.castShadow),
  63221. o.castShadow &&
  63222. ((A.shadowBias = o.shadow.bias),
  63223. (A.shadowRadius = o.shadow.radius),
  63224. (A.shadowMapSize = o.shadow.mapSize),
  63225. (Ue.shadows[v++] = o)),
  63226. (Ue.pointShadowMap[f] = o.shadow.map),
  63227. void 0 === Ue.pointShadowMatrix[f] &&
  63228. (Ue.pointShadowMatrix[f] = new n.Matrix4()),
  63229. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  63230. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  63231. (Ue.point[f++] = A);
  63232. } else if (o instanceof n.HemisphereLight) {
  63233. var A = Ke.get(o);
  63234. A.direction.setFromMatrixPosition(o.matrixWorld),
  63235. A.direction.transformDirection(d),
  63236. A.direction.normalize(),
  63237. A.skyColor.copy(o.color).multiplyScalar(s),
  63238. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  63239. (Ue.hemi[m++] = A);
  63240. }
  63241. (Ue.ambient[0] = c),
  63242. (Ue.ambient[1] = h),
  63243. (Ue.ambient[2] = u),
  63244. (Ue.directional.length = p),
  63245. (Ue.spot.length = g),
  63246. (Ue.point.length = f),
  63247. (Ue.hemi.length = m),
  63248. (Ue.shadows.length = v),
  63249. (Ue.hash = p + "," + f + "," + g + "," + m + "," + v);
  63250. }
  63251. function k(e, t, i) {
  63252. var r;
  63253. if (
  63254. (i
  63255. ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  63256. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  63257. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  63258. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter)))
  63259. : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  63260. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  63261. (t.wrapS === n.ClampToEdgeWrapping &&
  63262. t.wrapT === n.ClampToEdgeWrapping) ||
  63263. console.warn(
  63264. "THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",
  63265. t
  63266. ),
  63267. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  63268. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  63269. t.minFilter !== n.NearestFilter &&
  63270. t.minFilter !== n.LinearFilter &&
  63271. console.warn(
  63272. "THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",
  63273. t
  63274. )),
  63275. (r = We.get("EXT_texture_filter_anisotropic")))
  63276. ) {
  63277. if (
  63278. t.type === n.FloatType &&
  63279. null === We.get("OES_texture_float_linear")
  63280. )
  63281. return;
  63282. if (
  63283. t.type === n.HalfFloatType &&
  63284. null === We.get("OES_texture_half_float_linear")
  63285. )
  63286. return;
  63287. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) &&
  63288. (Ge.texParameterf(
  63289. e,
  63290. r.TEXTURE_MAX_ANISOTROPY_EXT,
  63291. Math.min(t.anisotropy, ve.getMaxAnisotropy())
  63292. ),
  63293. (Xe.get(t).__currentAnisotropy = t.anisotropy));
  63294. }
  63295. }
  63296. function H(e, t, i) {
  63297. void 0 === e.__webglInit &&
  63298. ((e.__webglInit = !0),
  63299. t.addEventListener("dispose", s),
  63300. (e.__webglTexture = Ge.createTexture()),
  63301. ke.textures++),
  63302. Ye.activeTexture(Ge.TEXTURE0 + i),
  63303. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  63304. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  63305. Ge.pixelStorei(
  63306. Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL,
  63307. t.premultiplyAlpha
  63308. ),
  63309. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  63310. var r = G(t.image, je.maxTextureSize);
  63311. W(t) && z(r) === !1 && (r = j(r));
  63312. var o = z(r),
  63313. a = ee(t.format),
  63314. l = ee(t.type);
  63315. k(Ge.TEXTURE_2D, t, o);
  63316. var c,
  63317. h = t.mipmaps;
  63318. if (t instanceof n.DataTexture)
  63319. if (h.length > 0 && o) {
  63320. for (var u = 0, d = h.length; u < d; u++)
  63321. (c = h[u]),
  63322. Ye.texImage2D(
  63323. Ge.TEXTURE_2D,
  63324. u,
  63325. a,
  63326. c.width,
  63327. c.height,
  63328. 0,
  63329. a,
  63330. l,
  63331. c.data
  63332. );
  63333. t.generateMipmaps = !1;
  63334. } else
  63335. Ye.texImage2D(
  63336. Ge.TEXTURE_2D,
  63337. 0,
  63338. a,
  63339. r.width,
  63340. r.height,
  63341. 0,
  63342. a,
  63343. l,
  63344. r.data
  63345. );
  63346. else if (t instanceof n.CompressedTexture)
  63347. for (var u = 0, d = h.length; u < d; u++)
  63348. (c = h[u]),
  63349. t.format !== n.RGBAFormat && t.format !== n.RGBFormat
  63350. ? Ye.getCompressedTextureFormats().indexOf(a) > -1
  63351. ? Ye.compressedTexImage2D(
  63352. Ge.TEXTURE_2D,
  63353. u,
  63354. a,
  63355. c.width,
  63356. c.height,
  63357. 0,
  63358. c.data
  63359. )
  63360. : console.warn(
  63361. "THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"
  63362. )
  63363. : Ye.texImage2D(
  63364. Ge.TEXTURE_2D,
  63365. u,
  63366. a,
  63367. c.width,
  63368. c.height,
  63369. 0,
  63370. a,
  63371. l,
  63372. c.data
  63373. );
  63374. else if (h.length > 0 && o) {
  63375. for (var u = 0, d = h.length; u < d; u++)
  63376. (c = h[u]), Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  63377. t.generateMipmaps = !1;
  63378. } else Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  63379. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  63380. (e.__version = t.version),
  63381. t.onUpdate && t.onUpdate(t);
  63382. }
  63383. function G(e, t) {
  63384. if (e.width > t || e.height > t) {
  63385. var i = t / Math.max(e.width, e.height),
  63386. n = document.createElement("canvas");
  63387. (n.width = Math.floor(e.width * i)),
  63388. (n.height = Math.floor(e.height * i));
  63389. var r = n.getContext("2d");
  63390. return (
  63391. r.drawImage(
  63392. e,
  63393. 0,
  63394. 0,
  63395. e.width,
  63396. e.height,
  63397. 0,
  63398. 0,
  63399. n.width,
  63400. n.height
  63401. ),
  63402. console.warn(
  63403. "THREE.WebGLRenderer: image is too big (" +
  63404. e.width +
  63405. "x" +
  63406. e.height +
  63407. "). Resized to " +
  63408. n.width +
  63409. "x" +
  63410. n.height,
  63411. e
  63412. ),
  63413. n
  63414. );
  63415. }
  63416. return e;
  63417. }
  63418. function z(e) {
  63419. return (
  63420. n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  63421. );
  63422. }
  63423. function W(e) {
  63424. return (
  63425. e.wrapS !== n.ClampToEdgeWrapping ||
  63426. e.wrapT !== n.ClampToEdgeWrapping ||
  63427. (e.minFilter !== n.NearestFilter &&
  63428. e.minFilter !== n.LinearFilter)
  63429. );
  63430. }
  63431. function j(e) {
  63432. if (
  63433. e instanceof HTMLImageElement ||
  63434. e instanceof HTMLCanvasElement
  63435. ) {
  63436. var t = document.createElement("canvas");
  63437. (t.width = n.Math.nearestPowerOfTwo(e.width)),
  63438. (t.height = n.Math.nearestPowerOfTwo(e.height));
  63439. var i = t.getContext("2d");
  63440. return (
  63441. i.drawImage(e, 0, 0, t.width, t.height),
  63442. console.warn(
  63443. "THREE.WebGLRenderer: image is not power of two (" +
  63444. e.width +
  63445. "x" +
  63446. e.height +
  63447. "). Resized to " +
  63448. t.width +
  63449. "x" +
  63450. t.height,
  63451. e
  63452. ),
  63453. t
  63454. );
  63455. }
  63456. return e;
  63457. }
  63458. function Y(e, t) {
  63459. var i = Xe.get(e);
  63460. if (6 === e.image.length)
  63461. if (e.version > 0 && i.__version !== e.version) {
  63462. i.__image__webglTextureCube ||
  63463. (e.addEventListener("dispose", s),
  63464. (i.__image__webglTextureCube = Ge.createTexture()),
  63465. ke.textures++),
  63466. Ye.activeTexture(Ge.TEXTURE0 + t),
  63467. Ye.bindTexture(
  63468. Ge.TEXTURE_CUBE_MAP,
  63469. i.__image__webglTextureCube
  63470. ),
  63471. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  63472. for (
  63473. var r = e instanceof n.CompressedTexture,
  63474. o = e.image[0] instanceof n.DataTexture,
  63475. a = [],
  63476. l = 0;
  63477. l < 6;
  63478. l++
  63479. )
  63480. !ve.autoScaleCubemaps || r || o
  63481. ? (a[l] = o ? e.image[l].image : e.image[l])
  63482. : (a[l] = G(e.image[l], je.maxCubemapSize));
  63483. var c = a[0],
  63484. h = z(c),
  63485. u = ee(e.format),
  63486. d = ee(e.type);
  63487. k(Ge.TEXTURE_CUBE_MAP, e, h);
  63488. for (var l = 0; l < 6; l++)
  63489. if (r)
  63490. for (
  63491. var p, f = a[l].mipmaps, g = 0, m = f.length;
  63492. g < m;
  63493. g++
  63494. )
  63495. (p = f[g]),
  63496. e.format !== n.RGBAFormat && e.format !== n.RGBFormat
  63497. ? Ye.getCompressedTextureFormats().indexOf(u) > -1
  63498. ? Ye.compressedTexImage2D(
  63499. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l,
  63500. g,
  63501. u,
  63502. p.width,
  63503. p.height,
  63504. 0,
  63505. p.data
  63506. )
  63507. : console.warn(
  63508. "THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"
  63509. )
  63510. : Ye.texImage2D(
  63511. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l,
  63512. g,
  63513. u,
  63514. p.width,
  63515. p.height,
  63516. 0,
  63517. u,
  63518. d,
  63519. p.data
  63520. );
  63521. else
  63522. o
  63523. ? Ye.texImage2D(
  63524. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l,
  63525. 0,
  63526. u,
  63527. a[l].width,
  63528. a[l].height,
  63529. 0,
  63530. u,
  63531. d,
  63532. a[l].data
  63533. )
  63534. : Ye.texImage2D(
  63535. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l,
  63536. 0,
  63537. u,
  63538. u,
  63539. d,
  63540. a[l]
  63541. );
  63542. e.generateMipmaps &&
  63543. h &&
  63544. Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  63545. (i.__version = e.version),
  63546. e.onUpdate && e.onUpdate(e);
  63547. } else
  63548. Ye.activeTexture(Ge.TEXTURE0 + t),
  63549. Ye.bindTexture(
  63550. Ge.TEXTURE_CUBE_MAP,
  63551. i.__image__webglTextureCube
  63552. );
  63553. }
  63554. function X(e, t) {
  63555. Ye.activeTexture(Ge.TEXTURE0 + t),
  63556. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture);
  63557. }
  63558. function Z(e, t, i, n) {
  63559. var r = ee(t.texture.format),
  63560. o = ee(t.texture.type);
  63561. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  63562. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  63563. Ge.framebufferTexture2D(
  63564. Ge.FRAMEBUFFER,
  63565. i,
  63566. n,
  63567. Xe.get(t.texture).__webglTexture,
  63568. 0
  63569. ),
  63570. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null);
  63571. }
  63572. function q(e, t) {
  63573. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  63574. t.depthBuffer && !t.stencilBuffer
  63575. ? (Ge.renderbufferStorage(
  63576. Ge.RENDERBUFFER,
  63577. Ge.DEPTH_COMPONENT16,
  63578. t.width,
  63579. t.height
  63580. ),
  63581. Ge.framebufferRenderbuffer(
  63582. Ge.FRAMEBUFFER,
  63583. Ge.DEPTH_ATTACHMENT,
  63584. Ge.RENDERBUFFER,
  63585. e
  63586. ))
  63587. : t.depthBuffer && t.stencilBuffer
  63588. ? (Ge.renderbufferStorage(
  63589. Ge.RENDERBUFFER,
  63590. Ge.DEPTH_STENCIL,
  63591. t.width,
  63592. t.height
  63593. ),
  63594. Ge.framebufferRenderbuffer(
  63595. Ge.FRAMEBUFFER,
  63596. Ge.DEPTH_STENCIL_ATTACHMENT,
  63597. Ge.RENDERBUFFER,
  63598. e
  63599. ))
  63600. : Ge.renderbufferStorage(
  63601. Ge.RENDERBUFFER,
  63602. Ge.RGBA4,
  63603. t.width,
  63604. t.height
  63605. ),
  63606. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null);
  63607. }
  63608. function K(e) {
  63609. var t = Xe.get(e),
  63610. i = e instanceof n.WebGLRenderTargetCube;
  63611. if (i) {
  63612. t.__webglDepthbuffer = [];
  63613. for (var r = 0; r < 6; r++)
  63614. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  63615. (t.__webglDepthbuffer[r] = Ge.createRenderbuffer()),
  63616. q(t.__webglDepthbuffer[r], e);
  63617. } else
  63618. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  63619. (t.__webglDepthbuffer = Ge.createRenderbuffer()),
  63620. q(t.__webglDepthbuffer, e);
  63621. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null);
  63622. }
  63623. function Q(e) {
  63624. var t = Xe.get(e),
  63625. i = Xe.get(e.texture);
  63626. e.addEventListener("dispose", l),
  63627. (i.__webglTexture = Ge.createTexture()),
  63628. ke.textures++;
  63629. var r = e instanceof n.WebGLRenderTargetCube,
  63630. o =
  63631. n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  63632. if (r) {
  63633. t.__webglFramebuffer = [];
  63634. for (var a = 0; a < 6; a++)
  63635. t.__webglFramebuffer[a] = Ge.createFramebuffer();
  63636. } else t.__webglFramebuffer = Ge.createFramebuffer();
  63637. if (r) {
  63638. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  63639. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  63640. for (var a = 0; a < 6; a++)
  63641. Z(
  63642. t.__webglFramebuffer[a],
  63643. e,
  63644. Ge.COLOR_ATTACHMENT0,
  63645. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a
  63646. );
  63647. e.texture.generateMipmaps &&
  63648. o &&
  63649. Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  63650. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null);
  63651. } else
  63652. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  63653. k(Ge.TEXTURE_2D, e.texture, o),
  63654. Z(
  63655. t.__webglFramebuffer,
  63656. e,
  63657. Ge.COLOR_ATTACHMENT0,
  63658. Ge.TEXTURE_2D
  63659. ),
  63660. e.texture.generateMipmaps &&
  63661. o &&
  63662. Ge.generateMipmap(Ge.TEXTURE_2D),
  63663. Ye.bindTexture(Ge.TEXTURE_2D, null);
  63664. e.depthBuffer && K(e);
  63665. }
  63666. function J(e) {
  63667. var t =
  63668. e instanceof n.WebGLRenderTargetCube
  63669. ? Ge.TEXTURE_CUBE_MAP
  63670. : Ge.TEXTURE_2D,
  63671. i = Xe.get(e.texture).__webglTexture;
  63672. Ye.bindTexture(t, i),
  63673. Ge.generateMipmap(t),
  63674. Ye.bindTexture(t, null);
  63675. }
  63676. function $(e) {
  63677. return e === n.NearestFilter ||
  63678. e === n.NearestMipMapNearestFilter ||
  63679. e === n.NearestMipMapLinearFilter
  63680. ? Ge.NEAREST
  63681. : Ge.LINEAR;
  63682. }
  63683. function ee(e) {
  63684. var t;
  63685. if (e === n.RepeatWrapping) return Ge.REPEAT;
  63686. if (e === n.ClampToEdgeWrapping) return Ge.CLAMP_TO_EDGE;
  63687. if (e === n.MirroredRepeatWrapping) return Ge.MIRRORED_REPEAT;
  63688. if (e === n.NearestFilter) return Ge.NEAREST;
  63689. if (e === n.NearestMipMapNearestFilter)
  63690. return Ge.NEAREST_MIPMAP_NEAREST;
  63691. if (e === n.NearestMipMapLinearFilter)
  63692. return Ge.NEAREST_MIPMAP_LINEAR;
  63693. if (e === n.LinearFilter) return Ge.LINEAR;
  63694. if (e === n.LinearMipMapNearestFilter)
  63695. return Ge.LINEAR_MIPMAP_NEAREST;
  63696. if (e === n.LinearMipMapLinearFilter)
  63697. return Ge.LINEAR_MIPMAP_LINEAR;
  63698. if (e === n.UnsignedByteType) return Ge.UNSIGNED_BYTE;
  63699. if (e === n.UnsignedShort4444Type)
  63700. return Ge.UNSIGNED_SHORT_4_4_4_4;
  63701. if (e === n.UnsignedShort5551Type)
  63702. return Ge.UNSIGNED_SHORT_5_5_5_1;
  63703. if (e === n.UnsignedShort565Type) return Ge.UNSIGNED_SHORT_5_6_5;
  63704. if (e === n.ByteType) return Ge.BYTE;
  63705. if (e === n.ShortType) return Ge.SHORT;
  63706. if (e === n.UnsignedShortType) return Ge.UNSIGNED_SHORT;
  63707. if (e === n.IntType) return Ge.INT;
  63708. if (e === n.UnsignedIntType) return Ge.UNSIGNED_INT;
  63709. if (e === n.FloatType) return Ge.FLOAT;
  63710. if (
  63711. ((t = We.get("OES_texture_half_float")),
  63712. null !== t && e === n.HalfFloatType)
  63713. )
  63714. return t.HALF_FLOAT_OES;
  63715. if (e === n.AlphaFormat) return Ge.ALPHA;
  63716. if (e === n.RGBFormat) return Ge.RGB;
  63717. if (e === n.RGBAFormat) return Ge.RGBA;
  63718. if (e === n.LuminanceFormat) return Ge.LUMINANCE;
  63719. if (e === n.LuminanceAlphaFormat) return Ge.LUMINANCE_ALPHA;
  63720. if (e === n.AddEquation) return Ge.FUNC_ADD;
  63721. if (e === n.SubtractEquation) return Ge.FUNC_SUBTRACT;
  63722. if (e === n.ReverseSubtractEquation)
  63723. return Ge.FUNC_REVERSE_SUBTRACT;
  63724. if (e === n.ZeroFactor) return Ge.ZERO;
  63725. if (e === n.OneFactor) return Ge.ONE;
  63726. if (e === n.SrcColorFactor) return Ge.SRC_COLOR;
  63727. if (e === n.OneMinusSrcColorFactor) return Ge.ONE_MINUS_SRC_COLOR;
  63728. if (e === n.SrcAlphaFactor) return Ge.SRC_ALPHA;
  63729. if (e === n.OneMinusSrcAlphaFactor) return Ge.ONE_MINUS_SRC_ALPHA;
  63730. if (e === n.DstAlphaFactor) return Ge.DST_ALPHA;
  63731. if (e === n.OneMinusDstAlphaFactor) return Ge.ONE_MINUS_DST_ALPHA;
  63732. if (e === n.DstColorFactor) return Ge.DST_COLOR;
  63733. if (e === n.OneMinusDstColorFactor) return Ge.ONE_MINUS_DST_COLOR;
  63734. if (e === n.SrcAlphaSaturateFactor) return Ge.SRC_ALPHA_SATURATE;
  63735. if (((t = We.get("WEBGL_compressed_texture_s3tc")), null !== t)) {
  63736. if (e === n.RGB_S3TC_DXT1_Format)
  63737. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  63738. if (e === n.RGBA_S3TC_DXT1_Format)
  63739. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  63740. if (e === n.RGBA_S3TC_DXT3_Format)
  63741. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  63742. if (e === n.RGBA_S3TC_DXT5_Format)
  63743. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT;
  63744. }
  63745. if (
  63746. ((t = We.get("WEBGL_compressed_texture_pvrtc")), null !== t)
  63747. ) {
  63748. if (e === n.RGB_PVRTC_4BPPV1_Format)
  63749. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  63750. if (e === n.RGB_PVRTC_2BPPV1_Format)
  63751. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  63752. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  63753. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  63754. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  63755. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;
  63756. }
  63757. if (
  63758. ((t = We.get("WEBGL_compressed_texture_etc1")),
  63759. null !== t && e === n.RGB_ETC1_Format)
  63760. )
  63761. return t.COMPRESSED_RGB_ETC1_WEBGL;
  63762. if (((t = We.get("EXT_blend_minmax")), null !== t)) {
  63763. if (e === n.MinEquation) return t.MIN_EXT;
  63764. if (e === n.MaxEquation) return t.MAX_EXT;
  63765. }
  63766. return 0;
  63767. }
  63768. console.log("THREE.WebGLRenderer", n.REVISION), (e = e || {});
  63769. var te =
  63770. void 0 !== e.canvas
  63771. ? e.canvas
  63772. : document.createElement("canvas"),
  63773. ie = void 0 !== e.context ? e.context : null,
  63774. ne = void 0 !== e.alpha && e.alpha,
  63775. re = void 0 === e.depth || e.depth,
  63776. oe = void 0 === e.stencil || e.stencil,
  63777. ae = void 0 !== e.antialias && e.antialias,
  63778. se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha,
  63779. le =
  63780. void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer,
  63781. ce = [],
  63782. he = [],
  63783. ue = -1,
  63784. de = [],
  63785. pe = -1,
  63786. fe = new Float32Array(8),
  63787. ge = [],
  63788. me = [];
  63789. (this.domElement = te),
  63790. (this.context = null),
  63791. (this.autoClear = !0),
  63792. (this.autoClearColor = !0),
  63793. (this.autoClearDepth = !0),
  63794. (this.autoClearStencil = !0),
  63795. (this.sortObjects = !0),
  63796. (this.gammaFactor = 2),
  63797. (this.gammaInput = !1),
  63798. (this.gammaOutput = !1),
  63799. (this.physicallyCorrectLights = !1),
  63800. (this.toneMapping = n.LinearToneMapping),
  63801. (this.toneMappingExposure = 1),
  63802. (this.toneMappingWhitePoint = 1),
  63803. (this.maxMorphTargets = 8),
  63804. (this.maxMorphNormals = 4),
  63805. (this.autoScaleCubemaps = !0);
  63806. var ve = this,
  63807. Ae = null,
  63808. ye = null,
  63809. Ce = null,
  63810. Ie = -1,
  63811. Ee = "",
  63812. be = null,
  63813. we = new n.Vector4(),
  63814. _e = null,
  63815. Te = new n.Vector4(),
  63816. xe = 0,
  63817. Se = new n.Color(0),
  63818. Me = 0,
  63819. Re = te.width,
  63820. Pe = te.height,
  63821. Oe = 1,
  63822. Le = new n.Vector4(0, 0, Re, Pe),
  63823. De = !1,
  63824. Ne = new n.Vector4(0, 0, Re, Pe),
  63825. Be = new n.Frustum(),
  63826. Fe = new n.Matrix4(),
  63827. Ve = new n.Vector3(),
  63828. Ue = {
  63829. hash: "",
  63830. ambient: [0, 0, 0],
  63831. directional: [],
  63832. directionalShadowMap: [],
  63833. directionalShadowMatrix: [],
  63834. spot: [],
  63835. spotShadowMap: [],
  63836. spotShadowMatrix: [],
  63837. point: [],
  63838. pointShadowMap: [],
  63839. pointShadowMatrix: [],
  63840. hemi: [],
  63841. shadows: [],
  63842. shadowsPointLight: 0,
  63843. },
  63844. ke = {
  63845. geometries: 0,
  63846. textures: 0,
  63847. },
  63848. He = {
  63849. calls: 0,
  63850. vertices: 0,
  63851. faces: 0,
  63852. points: 0,
  63853. };
  63854. this.info = {
  63855. render: He,
  63856. memory: ke,
  63857. programs: null,
  63858. };
  63859. var Ge;
  63860. try {
  63861. var ze = {
  63862. alpha: ne,
  63863. depth: re,
  63864. stencil: oe,
  63865. antialias: ae,
  63866. premultipliedAlpha: se,
  63867. preserveDrawingBuffer: le,
  63868. };
  63869. if (
  63870. ((Ge =
  63871. ie ||
  63872. te.getContext("webgl", ze) ||
  63873. te.getContext("experimental-webgl", ze)),
  63874. null === Ge)
  63875. )
  63876. throw null !== te.getContext("webgl")
  63877. ? "Error creating WebGL context with your selected attributes."
  63878. : "Error creating WebGL context.";
  63879. void 0 === Ge.getShaderPrecisionFormat &&
  63880. (Ge.getShaderPrecisionFormat = function () {
  63881. return {
  63882. rangeMin: 1,
  63883. rangeMax: 1,
  63884. precision: 1,
  63885. };
  63886. }),
  63887. te.addEventListener("webglcontextlost", a, !1);
  63888. } catch (e) {
  63889. console.error("THREE.WebGLRenderer: " + e);
  63890. }
  63891. var We = new n.WebGLExtensions(Ge);
  63892. We.get("OES_texture_float"),
  63893. We.get("OES_texture_float_linear"),
  63894. We.get("OES_texture_half_float"),
  63895. We.get("OES_texture_half_float_linear"),
  63896. We.get("OES_standard_derivatives"),
  63897. We.get("ANGLE_instanced_arrays"),
  63898. We.get("OES_element_index_uint") &&
  63899. (n.BufferGeometry.MaxIndex = 4294967296);
  63900. var je = new n.WebGLCapabilities(Ge, We, e),
  63901. Ye = new n.WebGLState(Ge, We, ee),
  63902. Xe = new n.WebGLProperties(),
  63903. Ze = new n.WebGLObjects(Ge, Xe, this.info),
  63904. qe = new n.WebGLPrograms(this, je),
  63905. Ke = new n.WebGLLights();
  63906. this.info.programs = qe.programs;
  63907. var Qe = new n.WebGLBufferRenderer(Ge, We, He),
  63908. Je = new n.WebGLIndexedBufferRenderer(Ge, We, He);
  63909. r(),
  63910. (this.context = Ge),
  63911. (this.capabilities = je),
  63912. (this.extensions = We),
  63913. (this.properties = Xe),
  63914. (this.state = Ye);
  63915. var $e = new n.WebGLShadowMap(this, Ue, Ze);
  63916. this.shadowMap = $e;
  63917. var et = new n.SpritePlugin(this, ge),
  63918. tt = new n.LensFlarePlugin(this, me);
  63919. (this.getContext = function () {
  63920. return Ge;
  63921. }),
  63922. (this.getContextAttributes = function () {
  63923. return Ge.getContextAttributes();
  63924. }),
  63925. (this.forceContextLoss = function () {
  63926. We.get("WEBGL_lose_context").loseContext();
  63927. }),
  63928. (this.getMaxAnisotropy = (function () {
  63929. var e;
  63930. return function () {
  63931. if (void 0 !== e) return e;
  63932. var t = We.get("EXT_texture_filter_anisotropic");
  63933. return (e =
  63934. null !== t
  63935. ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT)
  63936. : 0);
  63937. };
  63938. })()),
  63939. (this.getPrecision = function () {
  63940. return je.precision;
  63941. }),
  63942. (this.getPixelRatio = function () {
  63943. return Oe;
  63944. }),
  63945. (this.setPixelRatio = function (e) {
  63946. void 0 !== e && ((Oe = e), this.setSize(Ne.z, Ne.w, !1));
  63947. }),
  63948. (this.getSize = function () {
  63949. return {
  63950. width: Re,
  63951. height: Pe,
  63952. };
  63953. }),
  63954. (this.setSize = function (e, t, i, devicePixelRatio) {
  63955. if (devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  63956. (Re = e),
  63957. (Pe = t),
  63958. (te.width = e * Oe),
  63959. (te.height = t * Oe),
  63960. i !== !1 &&
  63961. ((te.style.width = e + "px"), (te.style.height = t + "px")),
  63962. this.setViewport(0, 0, e, t);
  63963. }),
  63964. (this.setViewport = function (e, t, i, n) {
  63965. Ye.viewport(Ne.set(e, t, i, n));
  63966. }),
  63967. (this.setScissor = function (e, t, i, n) {
  63968. Ye.scissor(Le.set(e, t, i, n));
  63969. }),
  63970. (this.setScissorTest = function (e) {
  63971. Ye.setScissorTest((De = e));
  63972. }),
  63973. (this.getClearColor = function () {
  63974. return Se;
  63975. }),
  63976. (this.setClearColor = function (e, t) {
  63977. Se.set(e), (Me = void 0 !== t ? t : 1), i(Se.r, Se.g, Se.b, Me);
  63978. }),
  63979. (this.getClearAlpha = function () {
  63980. return Me;
  63981. }),
  63982. (this.setClearAlpha = function (e) {
  63983. (Me = e), i(Se.r, Se.g, Se.b, Me);
  63984. }),
  63985. (this.clear = function (e, t, i) {
  63986. var n = 0;
  63987. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  63988. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  63989. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  63990. Ge.clear(n);
  63991. }),
  63992. (this.clearColor = function () {
  63993. this.clear(!0, !1, !1);
  63994. }),
  63995. (this.clearDepth = function () {
  63996. this.clear(!1, !0, !1);
  63997. }),
  63998. (this.clearStencil = function () {
  63999. this.clear(!1, !1, !0);
  64000. }),
  64001. (this.clearTarget = function (e, t, i, n) {
  64002. this.setRenderTarget(e), this.clear(t, i, n);
  64003. }),
  64004. (this.resetGLState = o),
  64005. (this.dispose = function () {
  64006. te.removeEventListener("webglcontextlost", a, !1);
  64007. }),
  64008. (this.renderBufferImmediate = function (e, t, i) {
  64009. Ye.initAttributes();
  64010. var r = Xe.get(e);
  64011. e.hasPositions &&
  64012. !r.position &&
  64013. (r.position = Ge.createBuffer()),
  64014. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  64015. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  64016. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  64017. var o = t.getAttributes();
  64018. if (
  64019. (e.hasPositions &&
  64020. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  64021. Ge.bufferData(
  64022. Ge.ARRAY_BUFFER,
  64023. e.positionArray,
  64024. Ge.DYNAMIC_DRAW
  64025. ),
  64026. Ye.enableAttribute(o.position),
  64027. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  64028. e.hasNormals)
  64029. ) {
  64030. if (
  64031. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  64032. "MeshPhongMaterial" !== i.type &&
  64033. "MeshStandardMaterial" !== i.type &&
  64034. i.shading === n.FlatShading)
  64035. )
  64036. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  64037. var l = e.normalArray,
  64038. c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3,
  64039. h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3,
  64040. u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  64041. (l[a + 0] = c),
  64042. (l[a + 1] = h),
  64043. (l[a + 2] = u),
  64044. (l[a + 3] = c),
  64045. (l[a + 4] = h),
  64046. (l[a + 5] = u),
  64047. (l[a + 6] = c),
  64048. (l[a + 7] = h),
  64049. (l[a + 8] = u);
  64050. }
  64051. Ge.bufferData(
  64052. Ge.ARRAY_BUFFER,
  64053. e.normalArray,
  64054. Ge.DYNAMIC_DRAW
  64055. ),
  64056. Ye.enableAttribute(o.normal),
  64057. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0);
  64058. }
  64059. e.hasUvs &&
  64060. i.map &&
  64061. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  64062. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  64063. Ye.enableAttribute(o.uv),
  64064. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  64065. e.hasColors &&
  64066. i.vertexColors !== n.NoColors &&
  64067. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  64068. Ge.bufferData(
  64069. Ge.ARRAY_BUFFER,
  64070. e.colorArray,
  64071. Ge.DYNAMIC_DRAW
  64072. ),
  64073. Ye.enableAttribute(o.color),
  64074. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  64075. Ye.disableUnusedAttributes(),
  64076. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  64077. (e.count = 0);
  64078. }),
  64079. (this.renderBufferDirect = function (e, i, r, o, a, s) {
  64080. E(o);
  64081. var l = w(e, i, o, a),
  64082. c = !1,
  64083. h = r.id + "_" + l.id + "_" + o.wireframe;
  64084. h !== Ee && ((Ee = h), (c = !0));
  64085. var u = a.morphTargetInfluences;
  64086. if (void 0 !== u) {
  64087. for (var d = [], p = 0, m = u.length; p < m; p++) {
  64088. var v = u[p];
  64089. d.push([v, p]);
  64090. }
  64091. d.sort(g), d.length > 8 && (d.length = 8);
  64092. for (
  64093. var A = r.morphAttributes, p = 0, m = d.length;
  64094. p < m;
  64095. p++
  64096. ) {
  64097. var v = d[p];
  64098. if (((fe[p] = v[0]), 0 !== v[0])) {
  64099. var y = v[1];
  64100. o.morphTargets === !0 &&
  64101. A.position &&
  64102. r.addAttribute("morphTarget" + p, A.position[y]),
  64103. o.morphNormals === !0 &&
  64104. A.normal &&
  64105. r.addAttribute("morphNormal" + p, A.normal[y]);
  64106. } else
  64107. o.morphTargets === !0 &&
  64108. r.removeAttribute("morphTarget" + p),
  64109. o.morphNormals === !0 &&
  64110. r.removeAttribute("morphNormal" + p);
  64111. }
  64112. var C = l.getUniforms();
  64113. null !== C.morphTargetInfluences &&
  64114. Ge.uniform1fv(C.morphTargetInfluences, fe),
  64115. (c = !0);
  64116. }
  64117. var y = r.index,
  64118. I = r.attributes.position;
  64119. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  64120. var b;
  64121. null !== y ? ((b = Je), b.setIndex(y)) : (b = Qe),
  64122. c &&
  64123. (f(o, l, r),
  64124. null !== y &&
  64125. Ge.bindBuffer(
  64126. Ge.ELEMENT_ARRAY_BUFFER,
  64127. Ze.getAttributeBuffer(y)
  64128. ));
  64129. var _ = 0,
  64130. T = 1 / 0;
  64131. null !== y ? (T = y.count) : void 0 !== I && (T = I.count);
  64132. var x = r.drawRange.start,
  64133. S = r.drawRange.count,
  64134. M = null !== s ? s.start : 0,
  64135. R = null !== s ? s.count : 1 / 0,
  64136. P = Math.max(_, x, M),
  64137. O = Math.min(_ + T, x + S, M + R) - 1,
  64138. L = Math.max(0, O - P + 1);
  64139. if (a instanceof n.Mesh)
  64140. if (o.wireframe === !0)
  64141. Ye.setLineWidth(o.wireframeLinewidth * t()),
  64142. b.setMode(Ge.LINES);
  64143. else
  64144. switch (a.drawMode) {
  64145. case n.TrianglesDrawMode:
  64146. b.setMode(Ge.TRIANGLES);
  64147. break;
  64148. case n.TriangleStripDrawMode:
  64149. b.setMode(Ge.TRIANGLE_STRIP);
  64150. break;
  64151. case n.TriangleFanDrawMode:
  64152. b.setMode(Ge.TRIANGLE_FAN);
  64153. }
  64154. else if (a instanceof n.Line) {
  64155. var D = o.linewidth;
  64156. void 0 === D && (D = 1),
  64157. Ye.setLineWidth(D * t()),
  64158. a instanceof n.LineSegments
  64159. ? b.setMode(Ge.LINES)
  64160. : b.setMode(Ge.LINE_STRIP);
  64161. } else a instanceof n.Points && b.setMode(Ge.POINTS);
  64162. r instanceof n.InstancedBufferGeometry
  64163. ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L)
  64164. : b.render(P, L);
  64165. }),
  64166. (this.render = function (e, t, i, r) {
  64167. if (t instanceof n.Camera == !1)
  64168. return void console.error(
  64169. "THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera."
  64170. );
  64171. var o = e.fog;
  64172. if (
  64173. ((Ee = ""),
  64174. (Ie = -1),
  64175. (be = null),
  64176. e.autoUpdate === !0 && e.updateMatrixWorld(),
  64177. null === t.parent && t.updateMatrixWorld(),
  64178. t.matrixWorldInverse.getInverse(t.matrixWorld),
  64179. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  64180. Be.setFromMatrix(Fe),
  64181. (ce.length = 0),
  64182. (ue = -1),
  64183. (pe = -1),
  64184. (ge.length = 0),
  64185. (me.length = 0),
  64186. y(e, t),
  64187. (he.length = ue + 1),
  64188. (de.length = pe + 1),
  64189. ve.sortObjects === !0 && (he.sort(m), de.sort(v)),
  64190. U(ce, t),
  64191. $e.render(e, t),
  64192. (He.calls = 0),
  64193. (He.vertices = 0),
  64194. (He.faces = 0),
  64195. (He.points = 0),
  64196. void 0 === i && (i = null),
  64197. this.setRenderTarget(i),
  64198. (this.autoClear || r) &&
  64199. this.clear(
  64200. this.autoClearColor,
  64201. this.autoClearDepth,
  64202. this.autoClearStencil
  64203. ),
  64204. e.overrideMaterial)
  64205. ) {
  64206. var a = e.overrideMaterial;
  64207. C(he, t, o, a), C(de, t, o, a);
  64208. } else Ye.setBlending(n.NoBlending), C(he, t, o), C(de, t, o);
  64209. if ((et.render(e, t), tt.render(e, t, Te), i)) {
  64210. var s = i.texture;
  64211. s.generateMipmaps &&
  64212. z(i) &&
  64213. s.minFilter !== n.NearestFilter &&
  64214. s.minFilter !== n.LinearFilter &&
  64215. J(i);
  64216. }
  64217. Ye.setDepthTest(!0), Ye.setDepthWrite(!0), Ye.setColorWrite(!0);
  64218. }),
  64219. (this.setFaceCulling = function (e, t) {
  64220. e === n.CullFaceNone
  64221. ? Ye.disable(Ge.CULL_FACE)
  64222. : (t === n.FrontFaceDirectionCW
  64223. ? Ge.frontFace(Ge.CW)
  64224. : Ge.frontFace(Ge.CCW),
  64225. e === n.CullFaceBack
  64226. ? Ge.cullFace(Ge.BACK)
  64227. : e === n.CullFaceFront
  64228. ? Ge.cullFace(Ge.FRONT)
  64229. : Ge.cullFace(Ge.FRONT_AND_BACK),
  64230. Ye.enable(Ge.CULL_FACE));
  64231. }),
  64232. (this.setTexture = function (e, t) {
  64233. var i = Xe.get(e);
  64234. if (e.version > 0 && i.__version !== e.version) {
  64235. var n = e.image;
  64236. return void 0 === n
  64237. ? void console.warn(
  64238. "THREE.WebGLRenderer: Texture marked for update but image is undefined",
  64239. e
  64240. )
  64241. : n.complete === !1
  64242. ? void console.warn(
  64243. "THREE.WebGLRenderer: Texture marked for update but image is incomplete",
  64244. e
  64245. )
  64246. : void H(i, e, t);
  64247. }
  64248. Ye.activeTexture(Ge.TEXTURE0 + t),
  64249. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture);
  64250. }),
  64251. (this.getCurrentRenderTarget = function () {
  64252. return ye;
  64253. }),
  64254. (this.setRenderTargetFramebuffer = function (
  64255. renderTarget,
  64256. defaultFramebuffer
  64257. ) {
  64258. //add
  64259. const renderTargetProperties = Xe.get(renderTarget);
  64260. renderTargetProperties.__webglFramebuffer = defaultFramebuffer;
  64261. renderTargetProperties.__useDefaultFramebuffer =
  64262. defaultFramebuffer === undefined;
  64263. }),
  64264. (this.setFramebuffer = function (value) {
  64265. //add
  64266. if (Ce !== value && ye === null)
  64267. Ge.bindFramebuffer(36160, value);
  64268. Ce = value;
  64269. }),
  64270. (this.setRenderTarget = function (e) {
  64271. (ye = e), e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  64272. var t,
  64273. i = e instanceof n.WebGLRenderTargetCube;
  64274. if (e) {
  64275. var r = Xe.get(e);
  64276. (t = i
  64277. ? r.__webglFramebuffer[e.activeCubeFace]
  64278. : r.__webglFramebuffer),
  64279. we.copy(e.scissor),
  64280. (_e = e.scissorTest),
  64281. Te.copy(e.viewport);
  64282. } else
  64283. (t = null),
  64284. we.copy(Le).multiplyScalar(Oe),
  64285. (_e = De),
  64286. Te.copy(Ne).multiplyScalar(Oe);
  64287. if (
  64288. (Ce !== t &&
  64289. (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t), (Ce = t)),
  64290. Ye.scissor(we),
  64291. Ye.setScissorTest(_e),
  64292. Ye.viewport(Te),
  64293. i)
  64294. ) {
  64295. var o = Xe.get(e.texture);
  64296. Ge.framebufferTexture2D(
  64297. Ge.FRAMEBUFFER,
  64298. Ge.COLOR_ATTACHMENT0,
  64299. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace,
  64300. o.__webglTexture,
  64301. e.activeMipMapLevel
  64302. );
  64303. }
  64304. }),
  64305. (this.readRenderTargetPixels = function (e, t, i, r, o, a) {
  64306. if (e instanceof n.WebGLRenderTarget == !1)
  64307. return void console.error(
  64308. "THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget."
  64309. );
  64310. var s = Xe.get(e).__webglFramebuffer;
  64311. if (s) {
  64312. var l = !1;
  64313. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s), (l = !0));
  64314. try {
  64315. var c = e.texture;
  64316. if (
  64317. c.format !== n.RGBAFormat &&
  64318. ee(c.format) !==
  64319. Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT)
  64320. )
  64321. return void console.error(
  64322. "THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."
  64323. );
  64324. if (
  64325. !(
  64326. c.type === n.UnsignedByteType ||
  64327. ee(c.type) ===
  64328. Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_TYPE) ||
  64329. (c.type === n.FloatType &&
  64330. We.get("WEBGL_color_buffer_float")) ||
  64331. (c.type === n.HalfFloatType &&
  64332. We.get("EXT_color_buffer_half_float"))
  64333. )
  64334. )
  64335. return void console.error(
  64336. "THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type."
  64337. );
  64338. Ge.checkFramebufferStatus(Ge.FRAMEBUFFER) ===
  64339. Ge.FRAMEBUFFER_COMPLETE
  64340. ? Ge.readPixels(t, i, r, o, ee(c.format), ee(c.type), a)
  64341. : console.error(
  64342. "THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."
  64343. );
  64344. } finally {
  64345. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce);
  64346. }
  64347. }
  64348. });
  64349. }),
  64350. (n.WebGLRenderTarget = function (e, t, i) {
  64351. (this.uuid = n.Math.generateUUID()),
  64352. (this.width = e),
  64353. (this.height = t),
  64354. (this.scissor = new n.Vector4(0, 0, e, t)),
  64355. (this.scissorTest = !1),
  64356. (this.viewport = new n.Vector4(0, 0, e, t)),
  64357. (i = i || {}),
  64358. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  64359. (this.texture = new n.Texture(
  64360. void 0,
  64361. void 0,
  64362. i.wrapS,
  64363. i.wrapT,
  64364. i.magFilter,
  64365. i.minFilter,
  64366. i.format,
  64367. i.type,
  64368. i.anisotropy
  64369. )),
  64370. (this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer),
  64371. (this.stencilBuffer =
  64372. void 0 === i.stencilBuffer || i.stencilBuffer);
  64373. }),
  64374. (n.WebGLRenderTarget.prototype = {
  64375. constructor: n.WebGLRenderTarget,
  64376. setSize: function (e, t) {
  64377. (this.width === e && this.height === t) ||
  64378. ((this.width = e), (this.height = t), this.dispose()),
  64379. this.viewport.set(0, 0, e, t),
  64380. this.scissor.set(0, 0, e, t);
  64381. },
  64382. clone: function () {
  64383. return new this.constructor().copy(this);
  64384. },
  64385. copy: function (e) {
  64386. return (
  64387. (this.width = e.width),
  64388. (this.height = e.height),
  64389. this.viewport.copy(e.viewport),
  64390. (this.texture = e.texture.clone()),
  64391. (this.depthBuffer = e.depthBuffer),
  64392. (this.stencilBuffer = e.stencilBuffer),
  64393. this
  64394. );
  64395. },
  64396. dispose: function () {
  64397. this.dispatchEvent({
  64398. type: "dispose",
  64399. });
  64400. },
  64401. }),
  64402. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  64403. (n.WebGLRenderTargetCube = function (e, t, i) {
  64404. n.WebGLRenderTarget.call(this, e, t, i),
  64405. (this.activeCubeFace = 0),
  64406. (this.activeMipMapLevel = 0);
  64407. }),
  64408. (n.WebGLRenderTargetCube.prototype = Object.create(
  64409. n.WebGLRenderTarget.prototype
  64410. )),
  64411. (n.WebGLRenderTargetCube.prototype.constructor =
  64412. n.WebGLRenderTargetCube),
  64413. (n.WebGLBufferRenderer = function (e, t, i) {
  64414. function r(e) {
  64415. s = e;
  64416. }
  64417. function o(t, n) {
  64418. e.drawArrays(s, t, n),
  64419. i.calls++,
  64420. (i.vertices += n),
  64421. s === e.TRIANGLES && (i.faces += n / 3);
  64422. }
  64423. function a(r) {
  64424. var o = t.get("ANGLE_instanced_arrays");
  64425. if (null === o)
  64426. return void console.error(
  64427. "THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."
  64428. );
  64429. var a = r.attributes.position,
  64430. l = 0;
  64431. a instanceof n.InterleavedBufferAttribute
  64432. ? ((l = a.data.count),
  64433. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount))
  64434. : ((l = a.count),
  64435. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  64436. i.calls++,
  64437. (i.vertices += l * r.maxInstancedCount),
  64438. s === e.TRIANGLES && (i.faces += (r.maxInstancedCount * l) / 3);
  64439. }
  64440. var s;
  64441. (this.setMode = r), (this.render = o), (this.renderInstances = a);
  64442. }),
  64443. (n.WebGLIndexedBufferRenderer = function (e, t, i) {
  64444. function n(e) {
  64445. s = e;
  64446. }
  64447. function r(i) {
  64448. i.array instanceof Uint32Array && t.get("OES_element_index_uint")
  64449. ? ((l = e.UNSIGNED_INT), (c = 4))
  64450. : ((l = e.UNSIGNED_SHORT), (c = 2));
  64451. }
  64452. function o(t, n) {
  64453. e.drawElements(s, n, l, t * c),
  64454. i.calls++,
  64455. (i.vertices += n),
  64456. s === e.TRIANGLES && (i.faces += n / 3);
  64457. }
  64458. function a(n, r, o) {
  64459. var a = t.get("ANGLE_instanced_arrays");
  64460. return null === a
  64461. ? void console.error(
  64462. "THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."
  64463. )
  64464. : (a.drawElementsInstancedANGLE(
  64465. s,
  64466. o,
  64467. l,
  64468. r * c,
  64469. n.maxInstancedCount
  64470. ),
  64471. i.calls++,
  64472. (i.vertices += o * n.maxInstancedCount),
  64473. void (
  64474. s === e.TRIANGLES &&
  64475. (i.faces += (n.maxInstancedCount * o) / 3)
  64476. ));
  64477. }
  64478. var s, l, c;
  64479. (this.setMode = n),
  64480. (this.setIndex = r),
  64481. (this.render = o),
  64482. (this.renderInstances = a);
  64483. }),
  64484. (n.WebGLExtensions = function (e) {
  64485. var t = {};
  64486. this.get = function (i) {
  64487. if (void 0 !== t[i]) return t[i];
  64488. var n;
  64489. switch (i) {
  64490. case "EXT_texture_filter_anisotropic":
  64491. n =
  64492. e.getExtension("EXT_texture_filter_anisotropic") ||
  64493. e.getExtension("MOZ_EXT_texture_filter_anisotropic") ||
  64494. e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  64495. break;
  64496. case "WEBGL_compressed_texture_s3tc":
  64497. n =
  64498. e.getExtension("WEBGL_compressed_texture_s3tc") ||
  64499. e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") ||
  64500. e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  64501. break;
  64502. case "WEBGL_compressed_texture_pvrtc":
  64503. n =
  64504. e.getExtension("WEBGL_compressed_texture_pvrtc") ||
  64505. e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  64506. break;
  64507. case "WEBGL_compressed_texture_etc1":
  64508. n = e.getExtension("WEBGL_compressed_texture_etc1");
  64509. break;
  64510. default:
  64511. n = e.getExtension(i);
  64512. }
  64513. return (
  64514. null === n &&
  64515. console.warn(
  64516. "THREE.WebGLRenderer: " + i + " extension not supported."
  64517. ),
  64518. (t[i] = n),
  64519. n
  64520. );
  64521. };
  64522. }),
  64523. (n.WebGLCapabilities = function (e, t, i) {
  64524. function n(t) {
  64525. if ("highp" === t) {
  64526. if (
  64527. e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT)
  64528. .precision > 0 &&
  64529. e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT)
  64530. .precision > 0
  64531. )
  64532. return "highp";
  64533. t = "mediump";
  64534. }
  64535. return "mediump" === t &&
  64536. e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT)
  64537. .precision > 0 &&
  64538. e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT)
  64539. .precision > 0
  64540. ? "mediump"
  64541. : "lowp";
  64542. }
  64543. (this.getMaxPrecision = n),
  64544. (this.precision = void 0 !== i.precision ? i.precision : "highp"),
  64545. (this.logarithmicDepthBuffer =
  64546. void 0 !== i.logarithmicDepthBuffer &&
  64547. i.logarithmicDepthBuffer),
  64548. (this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),
  64549. (this.maxVertexTextures = e.getParameter(
  64550. e.MAX_VERTEX_TEXTURE_IMAGE_UNITS
  64551. )),
  64552. (this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE)),
  64553. (this.maxCubemapSize = e.getParameter(
  64554. e.MAX_CUBE_MAP_TEXTURE_SIZE
  64555. )),
  64556. (this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS)),
  64557. (this.maxVertexUniforms = e.getParameter(
  64558. e.MAX_VERTEX_UNIFORM_VECTORS
  64559. )),
  64560. (this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS)),
  64561. (this.maxFragmentUniforms = e.getParameter(
  64562. e.MAX_FRAGMENT_UNIFORM_VECTORS
  64563. )),
  64564. (this.vertexTextures = this.maxVertexTextures > 0),
  64565. (this.floatFragmentTextures = !!t.get("OES_texture_float")),
  64566. (this.floatVertexTextures =
  64567. this.vertexTextures && this.floatFragmentTextures);
  64568. var r = n(this.precision);
  64569. r !== this.precision &&
  64570. (console.warn(
  64571. "THREE.WebGLRenderer:",
  64572. this.precision,
  64573. "not supported, using",
  64574. r,
  64575. "instead."
  64576. ),
  64577. (this.precision = r)),
  64578. this.logarithmicDepthBuffer &&
  64579. (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"));
  64580. }),
  64581. (n.WebGLGeometries = function (e, t, i) {
  64582. function r(e) {
  64583. var t = e.geometry;
  64584. if (void 0 !== h[t.id]) return h[t.id];
  64585. t.addEventListener("dispose", o);
  64586. var r;
  64587. return (
  64588. t instanceof n.BufferGeometry
  64589. ? (r = t)
  64590. : t instanceof n.Geometry &&
  64591. (void 0 === t._bufferGeometry &&
  64592. (t._bufferGeometry = new n.BufferGeometry().setFromObject(
  64593. e
  64594. )),
  64595. (r = t._bufferGeometry)),
  64596. (h[t.id] = r),
  64597. i.memory.geometries++,
  64598. r
  64599. );
  64600. }
  64601. function o(e) {
  64602. var n = e.target,
  64603. r = h[n.id];
  64604. null !== r.index && s(r.index),
  64605. l(r.attributes),
  64606. n.removeEventListener("dispose", o),
  64607. delete h[n.id];
  64608. var a = t.get(n);
  64609. a.wireframe && s(a.wireframe), t.delete(n);
  64610. var c = t.get(r);
  64611. c.wireframe && s(c.wireframe), t.delete(r), i.memory.geometries--;
  64612. }
  64613. function a(e) {
  64614. return e instanceof n.InterleavedBufferAttribute
  64615. ? t.get(e.data).__webglBuffer
  64616. : t.get(e).__webglBuffer;
  64617. }
  64618. function s(t) {
  64619. var i = a(t);
  64620. void 0 !== i && (e.deleteBuffer(i), c(t));
  64621. }
  64622. function l(e) {
  64623. for (var t in e) s(e[t]);
  64624. }
  64625. function c(e) {
  64626. e instanceof n.InterleavedBufferAttribute
  64627. ? t.delete(e.data)
  64628. : t.delete(e);
  64629. }
  64630. var h = {};
  64631. this.get = r;
  64632. }),
  64633. (n.WebGLLights = function () {
  64634. var e = {};
  64635. this.get = function (t) {
  64636. if (void 0 !== e[t.id]) return e[t.id];
  64637. var i;
  64638. switch (t.type) {
  64639. case "DirectionalLight":
  64640. i = {
  64641. direction: new n.Vector3(),
  64642. color: new n.Color(),
  64643. shadow: !1,
  64644. shadowBias: 0,
  64645. shadowRadius: 1,
  64646. shadowMapSize: new n.Vector2(),
  64647. };
  64648. break;
  64649. case "SpotLight":
  64650. i = {
  64651. position: new n.Vector3(),
  64652. direction: new n.Vector3(),
  64653. color: new n.Color(),
  64654. distance: 0,
  64655. coneCos: 0,
  64656. penumbraCos: 0,
  64657. decay: 0,
  64658. shadow: !1,
  64659. shadowBias: 0,
  64660. shadowRadius: 1,
  64661. shadowMapSize: new n.Vector2(),
  64662. };
  64663. break;
  64664. case "PointLight":
  64665. i = {
  64666. position: new n.Vector3(),
  64667. color: new n.Color(),
  64668. distance: 0,
  64669. decay: 0,
  64670. shadow: !1,
  64671. shadowBias: 0,
  64672. shadowRadius: 1,
  64673. shadowMapSize: new n.Vector2(),
  64674. };
  64675. break;
  64676. case "HemisphereLight":
  64677. i = {
  64678. direction: new n.Vector3(),
  64679. skyColor: new n.Color(),
  64680. groundColor: new n.Color(),
  64681. };
  64682. }
  64683. return (e[t.id] = i), i;
  64684. };
  64685. }),
  64686. (n.WebGLObjects = function (e, t, i) {
  64687. function r(t) {
  64688. var i = u.get(t);
  64689. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  64690. var r = i.index,
  64691. a = i.attributes;
  64692. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  64693. for (var s in a) o(a[s], e.ARRAY_BUFFER);
  64694. var l = i.morphAttributes;
  64695. for (var s in l)
  64696. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  64697. o(c[h], e.ARRAY_BUFFER);
  64698. return i;
  64699. }
  64700. function o(e, i) {
  64701. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e,
  64702. o = t.get(r);
  64703. void 0 === o.__webglBuffer
  64704. ? a(o, r, i)
  64705. : o.version !== r.version && s(o, r, i);
  64706. }
  64707. function a(t, i, n) {
  64708. (t.__webglBuffer = e.createBuffer()),
  64709. e.bindBuffer(n, t.__webglBuffer);
  64710. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  64711. e.bufferData(n, i.array, r), (t.version = i.version);
  64712. }
  64713. function s(t, i, n) {
  64714. e.bindBuffer(n, t.__webglBuffer),
  64715. i.dynamic === !1 || i.updateRange.count === -1
  64716. ? e.bufferSubData(n, 0, i.array)
  64717. : 0 === i.updateRange.count
  64718. ? console.error(
  64719. "THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."
  64720. )
  64721. : (e.bufferSubData(
  64722. n,
  64723. i.updateRange.offset * i.array.BYTES_PER_ELEMENT,
  64724. i.array.subarray(
  64725. i.updateRange.offset,
  64726. i.updateRange.offset + i.updateRange.count
  64727. )
  64728. ),
  64729. (i.updateRange.count = 0)),
  64730. (t.version = i.version);
  64731. }
  64732. function l(e) {
  64733. return e instanceof n.InterleavedBufferAttribute
  64734. ? t.get(e.data).__webglBuffer
  64735. : t.get(e).__webglBuffer;
  64736. }
  64737. function c(i) {
  64738. var r = t.get(i);
  64739. if (void 0 !== r.wireframe) return r.wireframe;
  64740. var a = [],
  64741. s = i.index,
  64742. l = i.attributes,
  64743. c = l.position;
  64744. if (null !== s)
  64745. for (
  64746. var u = {}, d = s.array, p = 0, f = d.length;
  64747. p < f;
  64748. p += 3
  64749. ) {
  64750. var g = d[p + 0],
  64751. m = d[p + 1],
  64752. v = d[p + 2];
  64753. h(u, g, m) && a.push(g, m),
  64754. h(u, m, v) && a.push(m, v),
  64755. h(u, v, g) && a.push(v, g);
  64756. }
  64757. else
  64758. for (
  64759. var d = l.position.array, p = 0, f = d.length / 3 - 1;
  64760. p < f;
  64761. p += 3
  64762. ) {
  64763. var g = p + 0,
  64764. m = p + 1,
  64765. v = p + 2;
  64766. a.push(g, m, m, v, v, g);
  64767. }
  64768. var A = c.count > 65535 ? Uint32Array : Uint16Array,
  64769. y = new n.BufferAttribute(new A(a), 1);
  64770. return o(y, e.ELEMENT_ARRAY_BUFFER), (r.wireframe = y), y;
  64771. }
  64772. function h(e, t, i) {
  64773. if (t > i) {
  64774. var n = t;
  64775. (t = i), (i = n);
  64776. }
  64777. var r = e[t];
  64778. return void 0 === r
  64779. ? ((e[t] = [i]), !0)
  64780. : r.indexOf(i) === -1 && (r.push(i), !0);
  64781. }
  64782. var u = new n.WebGLGeometries(e, t, i);
  64783. (this.getAttributeBuffer = l),
  64784. (this.getWireframeAttribute = c),
  64785. (this.update = r);
  64786. }),
  64787. (n.WebGLProgram = (function () {
  64788. function e(e) {
  64789. switch (e) {
  64790. case n.LinearEncoding:
  64791. return ["Linear", "( value )"];
  64792. case n.sRGBEncoding:
  64793. return ["sRGB", "( value )"];
  64794. case n.RGBEEncoding:
  64795. return ["RGBE", "( value )"];
  64796. case n.RGBM7Encoding:
  64797. return ["RGBM", "( value, 7.0 )"];
  64798. case n.RGBM16Encoding:
  64799. return ["RGBM", "( value, 16.0 )"];
  64800. case n.RGBDEncoding:
  64801. return ["RGBD", "( value, 256.0 )"];
  64802. case n.GammaEncoding:
  64803. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  64804. default:
  64805. throw new Error("unsupported encoding: " + e);
  64806. }
  64807. }
  64808. function t(t, i) {
  64809. var n = e(i);
  64810. return (
  64811. "vec4 " +
  64812. t +
  64813. "( vec4 value ) { return " +
  64814. n[0] +
  64815. "ToLinear" +
  64816. n[1] +
  64817. "; }"
  64818. );
  64819. }
  64820. function i(t, i) {
  64821. var n = e(i);
  64822. return (
  64823. "vec4 " +
  64824. t +
  64825. "( vec4 value ) { return LinearTo" +
  64826. n[0] +
  64827. n[1] +
  64828. "; }"
  64829. );
  64830. }
  64831. function r(e, t) {
  64832. var i;
  64833. switch (t) {
  64834. case n.LinearToneMapping:
  64835. i = "Linear";
  64836. break;
  64837. case n.ReinhardToneMapping:
  64838. i = "Reinhard";
  64839. break;
  64840. case n.Uncharted2ToneMapping:
  64841. i = "Uncharted2";
  64842. break;
  64843. case n.CineonToneMapping:
  64844. i = "OptimizedCineon";
  64845. break;
  64846. default:
  64847. throw new Error("unsupported toneMapping: " + t);
  64848. }
  64849. return (
  64850. "vec3 " +
  64851. e +
  64852. "( vec3 color ) { return " +
  64853. i +
  64854. "ToneMapping( color ); }"
  64855. );
  64856. }
  64857. function o(e, t, i) {
  64858. e = e || {};
  64859. var n = [
  64860. e.derivatives ||
  64861. t.envMapCubeUV ||
  64862. t.bumpMap ||
  64863. t.normalMap ||
  64864. t.flatShading
  64865. ? "#extension GL_OES_standard_derivatives : enable"
  64866. : "",
  64867. (e.fragDepth || t.logarithmicDepthBuffer) &&
  64868. i.get("EXT_frag_depth")
  64869. ? "#extension GL_EXT_frag_depth : enable"
  64870. : "",
  64871. e.drawBuffers && i.get("WEBGL_draw_buffers")
  64872. ? "#extension GL_EXT_draw_buffers : require"
  64873. : "",
  64874. (e.shaderTextureLOD || t.envMap) &&
  64875. i.get("EXT_shader_texture_lod")
  64876. ? "#extension GL_EXT_shader_texture_lod : enable"
  64877. : "",
  64878. ];
  64879. return n.filter(c).join("\n");
  64880. }
  64881. function a(e) {
  64882. var t = [];
  64883. for (var i in e) {
  64884. var n = e[i];
  64885. n !== !1 && t.push("#define " + i + " " + n);
  64886. }
  64887. return t.join("\n");
  64888. }
  64889. function s(e, t, i) {
  64890. for (
  64891. var n = {},
  64892. r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS),
  64893. o = 0;
  64894. o < r;
  64895. o++
  64896. ) {
  64897. var a = e.getActiveUniform(t, o),
  64898. s = a.name,
  64899. l = e.getUniformLocation(t, s),
  64900. c = f.exec(s);
  64901. if (c) {
  64902. var h = c[1],
  64903. u = c[2],
  64904. d = n[h];
  64905. d || (d = n[h] = {}), (d[u] = l);
  64906. } else if ((c = g.exec(s))) {
  64907. var p = c[1],
  64908. v = c[2],
  64909. A = c[3],
  64910. y = n[p];
  64911. y || (y = n[p] = []);
  64912. var C = y[v];
  64913. C || (C = y[v] = {}), (C[A] = l);
  64914. } else if ((c = m.exec(s))) {
  64915. var p = c[1];
  64916. n[p] = l;
  64917. } else n[s] = l;
  64918. }
  64919. return n;
  64920. }
  64921. function l(e, t, i) {
  64922. for (
  64923. var n = {},
  64924. r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES),
  64925. o = 0;
  64926. o < r;
  64927. o++
  64928. ) {
  64929. var a = e.getActiveAttrib(t, o),
  64930. s = a.name;
  64931. n[s] = e.getAttribLocation(t, s);
  64932. }
  64933. return n;
  64934. }
  64935. function c(e) {
  64936. return "" !== e;
  64937. }
  64938. function h(e, t) {
  64939. return e
  64940. .replace(/NUM_DIR_LIGHTS/g, t.numDirLights)
  64941. .replace(/NUM_SPOT_LIGHTS/g, t.numSpotLights)
  64942. .replace(/NUM_POINT_LIGHTS/g, t.numPointLights)
  64943. .replace(/NUM_HEMI_LIGHTS/g, t.numHemiLights);
  64944. }
  64945. function u(e) {
  64946. function t(e, t) {
  64947. var i = n.ShaderChunk[t];
  64948. if (void 0 === i)
  64949. throw new Error("Can not resolve #include <" + t + ">");
  64950. return u(i);
  64951. }
  64952. var i = /#include +<([\w\d.]+)>/g;
  64953. return e.replace(i, t);
  64954. }
  64955. function d(e) {
  64956. function t(e, t, i, n) {
  64957. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  64958. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  64959. return r;
  64960. }
  64961. var i =
  64962. /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  64963. return e.replace(i, t);
  64964. }
  64965. var p = 0,
  64966. f = /^([\w\d_]+)\.([\w\d_]+)$/,
  64967. g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  64968. m = /^([\w\d_]+)\[0\]$/;
  64969. return function (e, f, g, m) {
  64970. var v = e.context,
  64971. A = g.extensions,
  64972. y = g.defines,
  64973. C = g.__webglShader.vertexShader,
  64974. I = g.__webglShader.fragmentShader,
  64975. E = "SHADOWMAP_TYPE_BASIC";
  64976. m.shadowMapType === n.PCFShadowMap
  64977. ? (E = "SHADOWMAP_TYPE_PCF")
  64978. : m.shadowMapType === n.PCFSoftShadowMap &&
  64979. (E = "SHADOWMAP_TYPE_PCF_SOFT");
  64980. var b = "ENVMAP_TYPE_CUBE",
  64981. w = "ENVMAP_MODE_REFLECTION",
  64982. _ = "ENVMAP_BLENDING_MULTIPLY";
  64983. if (m.envMap) {
  64984. switch (g.envMap.mapping) {
  64985. case n.CubeReflectionMapping:
  64986. case n.CubeRefractionMapping:
  64987. b = "ENVMAP_TYPE_CUBE";
  64988. break;
  64989. case n.CubeUVReflectionMapping:
  64990. case n.CubeUVRefractionMapping:
  64991. b = "ENVMAP_TYPE_CUBE_UV";
  64992. break;
  64993. case n.EquirectangularReflectionMapping:
  64994. case n.EquirectangularRefractionMapping:
  64995. b = "ENVMAP_TYPE_EQUIREC";
  64996. break;
  64997. case n.SphericalReflectionMapping:
  64998. b = "ENVMAP_TYPE_SPHERE";
  64999. }
  65000. switch (g.envMap.mapping) {
  65001. case n.CubeRefractionMapping:
  65002. case n.EquirectangularRefractionMapping:
  65003. w = "ENVMAP_MODE_REFRACTION";
  65004. }
  65005. switch (g.combine) {
  65006. case n.MultiplyOperation:
  65007. _ = "ENVMAP_BLENDING_MULTIPLY";
  65008. break;
  65009. case n.MixOperation:
  65010. _ = "ENVMAP_BLENDING_MIX";
  65011. break;
  65012. case n.AddOperation:
  65013. _ = "ENVMAP_BLENDING_ADD";
  65014. }
  65015. }
  65016. var T,
  65017. x,
  65018. S = e.gammaFactor > 0 ? e.gammaFactor : 1,
  65019. M = o(A, m, e.extensions),
  65020. R = a(y),
  65021. P = v.createProgram();
  65022. g instanceof n.RawShaderMaterial
  65023. ? ((T = ""), (x = ""))
  65024. : ((T = [
  65025. "precision " + m.precision + " float;",
  65026. "precision " + m.precision + " int;",
  65027. "#define SHADER_NAME " + g.__webglShader.name,
  65028. R,
  65029. m.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "",
  65030. "#define GAMMA_FACTOR " + S,
  65031. "#define MAX_BONES " + m.maxBones,
  65032. m.map ? "#define USE_MAP" : "",
  65033. m.envMap ? "#define USE_ENVMAP" : "",
  65034. m.envMap ? "#define " + w : "",
  65035. m.lightMap ? "#define USE_LIGHTMAP" : "",
  65036. m.aoMap ? "#define USE_AOMAP" : "",
  65037. m.emissiveMap ? "#define USE_EMISSIVEMAP" : "",
  65038. m.bumpMap ? "#define USE_BUMPMAP" : "",
  65039. m.normalMap ? "#define USE_NORMALMAP" : "",
  65040. m.displacementMap && m.supportsVertexTextures
  65041. ? "#define USE_DISPLACEMENTMAP"
  65042. : "",
  65043. m.specularMap ? "#define USE_SPECULARMAP" : "",
  65044. m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "",
  65045. m.metalnessMap ? "#define USE_METALNESSMAP" : "",
  65046. m.alphaMap ? "#define USE_ALPHAMAP" : "",
  65047. m.vertexColors ? "#define USE_COLOR" : "",
  65048. m.flatShading ? "#define FLAT_SHADED" : "",
  65049. m.skinning ? "#define USE_SKINNING" : "",
  65050. m.useVertexTexture ? "#define BONE_TEXTURE" : "",
  65051. m.morphTargets ? "#define USE_MORPHTARGETS" : "",
  65052. m.morphNormals && m.flatShading === !1
  65053. ? "#define USE_MORPHNORMALS"
  65054. : "",
  65055. m.doubleSided ? "#define DOUBLE_SIDED" : "",
  65056. m.flipSided ? "#define FLIP_SIDED" : "",
  65057. m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "",
  65058. m.shadowMapEnabled ? "#define " + E : "",
  65059. m.pointLightShadows > 0
  65060. ? "#define POINT_LIGHT_SHADOWS"
  65061. : "",
  65062. m.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "",
  65063. m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "",
  65064. m.logarithmicDepthBuffer &&
  65065. e.extensions.get("EXT_frag_depth")
  65066. ? "#define USE_LOGDEPTHBUF_EXT"
  65067. : "",
  65068. "uniform mat4 modelMatrix;",
  65069. "uniform mat4 modelViewMatrix;",
  65070. "uniform mat4 projectionMatrix;",
  65071. "uniform mat4 viewMatrix;",
  65072. "uniform mat3 normalMatrix;",
  65073. "uniform vec3 cameraPosition;",
  65074. "attribute vec3 position;",
  65075. "attribute vec3 normal;",
  65076. "attribute vec2 uv;",
  65077. "#ifdef USE_COLOR",
  65078. "\tattribute vec3 color;",
  65079. "#endif",
  65080. "#ifdef USE_MORPHTARGETS",
  65081. "\tattribute vec3 morphTarget0;",
  65082. "\tattribute vec3 morphTarget1;",
  65083. "\tattribute vec3 morphTarget2;",
  65084. "\tattribute vec3 morphTarget3;",
  65085. "\t#ifdef USE_MORPHNORMALS",
  65086. "\t\tattribute vec3 morphNormal0;",
  65087. "\t\tattribute vec3 morphNormal1;",
  65088. "\t\tattribute vec3 morphNormal2;",
  65089. "\t\tattribute vec3 morphNormal3;",
  65090. "\t#else",
  65091. "\t\tattribute vec3 morphTarget4;",
  65092. "\t\tattribute vec3 morphTarget5;",
  65093. "\t\tattribute vec3 morphTarget6;",
  65094. "\t\tattribute vec3 morphTarget7;",
  65095. "\t#endif",
  65096. "#endif",
  65097. "#ifdef USE_SKINNING",
  65098. "\tattribute vec4 skinIndex;",
  65099. "\tattribute vec4 skinWeight;",
  65100. "#endif",
  65101. "\n",
  65102. ]
  65103. .filter(c)
  65104. .join("\n")),
  65105. (x = [
  65106. M,
  65107. "precision " + m.precision + " float;",
  65108. "precision " + m.precision + " int;",
  65109. "#define SHADER_NAME " + g.__webglShader.name,
  65110. R,
  65111. m.alphaTest ? "#define ALPHATEST " + m.alphaTest : "",
  65112. "#define GAMMA_FACTOR " + S,
  65113. m.useFog && m.fog ? "#define USE_FOG" : "",
  65114. m.useFog && m.fogExp ? "#define FOG_EXP2" : "",
  65115. m.map ? "#define USE_MAP" : "",
  65116. m.envMap ? "#define USE_ENVMAP" : "",
  65117. m.envMap ? "#define " + b : "",
  65118. m.envMap ? "#define " + w : "",
  65119. m.envMap ? "#define " + _ : "",
  65120. m.lightMap ? "#define USE_LIGHTMAP" : "",
  65121. m.aoMap ? "#define USE_AOMAP" : "",
  65122. m.emissiveMap ? "#define USE_EMISSIVEMAP" : "",
  65123. m.bumpMap ? "#define USE_BUMPMAP" : "",
  65124. m.normalMap ? "#define USE_NORMALMAP" : "",
  65125. m.specularMap ? "#define USE_SPECULARMAP" : "",
  65126. m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "",
  65127. m.metalnessMap ? "#define USE_METALNESSMAP" : "",
  65128. m.alphaMap ? "#define USE_ALPHAMAP" : "",
  65129. m.vertexColors ? "#define USE_COLOR" : "",
  65130. m.flatShading ? "#define FLAT_SHADED" : "",
  65131. m.doubleSided ? "#define DOUBLE_SIDED" : "",
  65132. m.flipSided ? "#define FLIP_SIDED" : "",
  65133. m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "",
  65134. m.shadowMapEnabled ? "#define " + E : "",
  65135. m.pointLightShadows > 0
  65136. ? "#define POINT_LIGHT_SHADOWS"
  65137. : "",
  65138. m.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "",
  65139. m.physicallyCorrectLights
  65140. ? "#define PHYSICALLY_CORRECT_LIGHTS"
  65141. : "",
  65142. m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "",
  65143. m.logarithmicDepthBuffer &&
  65144. e.extensions.get("EXT_frag_depth")
  65145. ? "#define USE_LOGDEPTHBUF_EXT"
  65146. : "",
  65147. m.envMap && e.extensions.get("EXT_shader_texture_lod")
  65148. ? "#define TEXTURE_LOD_EXT"
  65149. : "",
  65150. "uniform mat4 viewMatrix;",
  65151. "uniform vec3 cameraPosition;",
  65152. m.toneMapping !== n.NoToneMapping
  65153. ? "#define TONE_MAPPING"
  65154. : "",
  65155. m.toneMapping !== n.NoToneMapping
  65156. ? n.ShaderChunk.tonemapping_pars_fragment
  65157. : "",
  65158. m.toneMapping !== n.NoToneMapping
  65159. ? r("toneMapping", m.toneMapping)
  65160. : "",
  65161. m.outputEncoding ||
  65162. m.mapEncoding ||
  65163. m.envMapEncoding ||
  65164. m.emissiveMapEncoding
  65165. ? n.ShaderChunk.encodings_pars_fragment
  65166. : "",
  65167. m.mapEncoding ? t("mapTexelToLinear", m.mapEncoding) : "",
  65168. m.envMapEncoding
  65169. ? t("envMapTexelToLinear", m.envMapEncoding)
  65170. : "",
  65171. m.emissiveMapEncoding
  65172. ? t("emissiveMapTexelToLinear", m.emissiveMapEncoding)
  65173. : "",
  65174. m.outputEncoding
  65175. ? i("linearToOutputTexel", m.outputEncoding)
  65176. : "",
  65177. "\n",
  65178. ]
  65179. .filter(c)
  65180. .join("\n"))),
  65181. (C = u(C, m)),
  65182. (C = h(C, m)),
  65183. (I = u(I, m)),
  65184. (I = h(I, m)),
  65185. g instanceof n.ShaderMaterial == !1 && ((C = d(C)), (I = d(I)));
  65186. var O = T + C,
  65187. L = x + I,
  65188. D = n.WebGLShader(v, v.VERTEX_SHADER, O),
  65189. N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  65190. v.attachShader(P, D),
  65191. v.attachShader(P, N),
  65192. void 0 !== g.index0AttributeName
  65193. ? v.bindAttribLocation(P, 0, g.index0AttributeName)
  65194. : m.morphTargets === !0 &&
  65195. v.bindAttribLocation(P, 0, "position"),
  65196. v.linkProgram(P);
  65197. var B = v.getProgramInfoLog(P),
  65198. F = v.getShaderInfoLog(D),
  65199. V = v.getShaderInfoLog(N),
  65200. U = !0,
  65201. k = !0;
  65202. v.getProgramParameter(P, v.LINK_STATUS) === !1
  65203. ? ((U = !1),
  65204. console.error(
  65205. "THREE.WebGLProgram: shader error: ",
  65206. v.getError(),
  65207. "gl.VALIDATE_STATUS",
  65208. v.getProgramParameter(P, v.VALIDATE_STATUS),
  65209. "gl.getProgramInfoLog",
  65210. B,
  65211. F,
  65212. V
  65213. ))
  65214. : "" !== B
  65215. ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", B)
  65216. : ("" !== F && "" !== V) || (k = !1),
  65217. k &&
  65218. (this.diagnostics = {
  65219. runnable: U,
  65220. material: g,
  65221. programLog: B,
  65222. vertexShader: {
  65223. log: F,
  65224. prefix: T,
  65225. },
  65226. fragmentShader: {
  65227. log: V,
  65228. prefix: x,
  65229. },
  65230. }),
  65231. v.deleteShader(D),
  65232. v.deleteShader(N);
  65233. var H;
  65234. this.getUniforms = function () {
  65235. return void 0 === H && (H = s(v, P)), H;
  65236. };
  65237. var G;
  65238. return (
  65239. (this.getAttributes = function () {
  65240. return void 0 === G && (G = l(v, P)), G;
  65241. }),
  65242. (this.destroy = function () {
  65243. v.deleteProgram(P), (this.program = void 0);
  65244. }),
  65245. Object.defineProperties(this, {
  65246. uniforms: {
  65247. get: function () {
  65248. return (
  65249. console.warn(
  65250. "THREE.WebGLProgram: .uniforms is now .getUniforms()."
  65251. ),
  65252. this.getUniforms()
  65253. );
  65254. },
  65255. },
  65256. attributes: {
  65257. get: function () {
  65258. return (
  65259. console.warn(
  65260. "THREE.WebGLProgram: .attributes is now .getAttributes()."
  65261. ),
  65262. this.getAttributes()
  65263. );
  65264. },
  65265. },
  65266. }),
  65267. (this.id = p++),
  65268. (this.code = f),
  65269. (this.usedTimes = 1),
  65270. (this.program = P),
  65271. (this.vertexShader = D),
  65272. (this.fragmentShader = N),
  65273. this
  65274. );
  65275. };
  65276. })()),
  65277. (n.WebGLPrograms = function (e, t) {
  65278. function i(e) {
  65279. if (
  65280. t.floatVertexTextures &&
  65281. e &&
  65282. e.skeleton &&
  65283. e.skeleton.useVertexTexture
  65284. )
  65285. return 1024;
  65286. var i = t.maxVertexUniforms,
  65287. r = Math.floor((i - 20) / 4),
  65288. o = r;
  65289. return (
  65290. void 0 !== e &&
  65291. e instanceof n.SkinnedMesh &&
  65292. ((o = Math.min(e.skeleton.bones.length, o)),
  65293. o < e.skeleton.bones.length &&
  65294. console.warn(
  65295. "WebGLRenderer: too many bones - " +
  65296. e.skeleton.bones.length +
  65297. ", this GPU supports just " +
  65298. o +
  65299. " (try OpenGL instead of ANGLE)"
  65300. )),
  65301. o
  65302. );
  65303. }
  65304. function r(e, t) {
  65305. var i;
  65306. return (
  65307. e
  65308. ? e instanceof n.Texture
  65309. ? (i = e.encoding)
  65310. : e instanceof n.WebGLRenderTarget &&
  65311. (i = e.texture.encoding)
  65312. : (i = n.LinearEncoding),
  65313. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  65314. i
  65315. );
  65316. }
  65317. var o = [],
  65318. a = {
  65319. MeshDepthMaterial: "depth",
  65320. MeshNormalMaterial: "normal",
  65321. MeshBasicMaterial: "basic",
  65322. MeshLambertMaterial: "lambert",
  65323. MeshPhongMaterial: "phong",
  65324. MeshStandardMaterial: "standard",
  65325. LineBasicMaterial: "basic",
  65326. LineDashedMaterial: "dashed",
  65327. PointsMaterial: "points",
  65328. },
  65329. s = [
  65330. "precision",
  65331. "supportsVertexTextures",
  65332. "map",
  65333. "mapEncoding",
  65334. "envMap",
  65335. "envMapMode",
  65336. "envMapEncoding",
  65337. "lightMap",
  65338. "aoMap",
  65339. "emissiveMap",
  65340. "emissiveMapEncoding",
  65341. "bumpMap",
  65342. "normalMap",
  65343. "displacementMap",
  65344. "specularMap",
  65345. "roughnessMap",
  65346. "metalnessMap",
  65347. "alphaMap",
  65348. "combine",
  65349. "vertexColors",
  65350. "fog",
  65351. "useFog",
  65352. "fogExp",
  65353. "flatShading",
  65354. "sizeAttenuation",
  65355. "logarithmicDepthBuffer",
  65356. "skinning",
  65357. "maxBones",
  65358. "useVertexTexture",
  65359. "morphTargets",
  65360. "morphNormals",
  65361. "maxMorphTargets",
  65362. "maxMorphNormals",
  65363. "premultipliedAlpha",
  65364. "numDirLights",
  65365. "numPointLights",
  65366. "numSpotLights",
  65367. "numHemiLights",
  65368. "shadowMapEnabled",
  65369. "pointLightShadows",
  65370. "toneMapping",
  65371. "physicallyCorrectLights",
  65372. "shadowMapType",
  65373. "alphaTest",
  65374. "doubleSided",
  65375. "flipSided",
  65376. ];
  65377. (this.getParameters = function (o, s, l, c) {
  65378. var h = a[o.type],
  65379. u = i(c),
  65380. d = e.getPrecision();
  65381. null !== o.precision &&
  65382. ((d = t.getMaxPrecision(o.precision)),
  65383. d !== o.precision &&
  65384. console.warn(
  65385. "THREE.WebGLProgram.getParameters:",
  65386. o.precision,
  65387. "not supported, using",
  65388. d,
  65389. "instead."
  65390. ));
  65391. var p = {
  65392. shaderID: h,
  65393. precision: d,
  65394. supportsVertexTextures: t.vertexTextures,
  65395. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  65396. map: !!o.map,
  65397. mapEncoding: r(o.map, e.gammaInput),
  65398. envMap: !!o.envMap,
  65399. envMapMode: o.envMap && o.envMap.mapping,
  65400. envMapEncoding: r(o.envMap, e.gammaInput),
  65401. envMapCubeUV:
  65402. !!o.envMap &&
  65403. (o.envMap.mapping === n.CubeUVReflectionMapping ||
  65404. o.envMap.mapping === n.CubeUVRefractionMapping),
  65405. lightMap: !!o.lightMap,
  65406. aoMap: !!o.aoMap,
  65407. emissiveMap: !!o.emissiveMap,
  65408. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  65409. bumpMap: !!o.bumpMap,
  65410. normalMap: !!o.normalMap,
  65411. displacementMap: !!o.displacementMap,
  65412. roughnessMap: !!o.roughnessMap,
  65413. metalnessMap: !!o.metalnessMap,
  65414. specularMap: !!o.specularMap,
  65415. alphaMap: !!o.alphaMap,
  65416. combine: o.combine,
  65417. vertexColors: o.vertexColors,
  65418. fog: l,
  65419. useFog: o.fog,
  65420. fogExp: l instanceof n.FogExp2,
  65421. flatShading: o.shading === n.FlatShading,
  65422. sizeAttenuation: o.sizeAttenuation,
  65423. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  65424. skinning: o.skinning,
  65425. maxBones: u,
  65426. useVertexTexture:
  65427. t.floatVertexTextures &&
  65428. c &&
  65429. c.skeleton &&
  65430. c.skeleton.useVertexTexture,
  65431. morphTargets: o.morphTargets,
  65432. morphNormals: o.morphNormals,
  65433. maxMorphTargets: e.maxMorphTargets,
  65434. maxMorphNormals: e.maxMorphNormals,
  65435. numDirLights: s.directional.length,
  65436. numPointLights: s.point.length,
  65437. numSpotLights: s.spot.length,
  65438. numHemiLights: s.hemi.length,
  65439. pointLightShadows: s.shadowsPointLight,
  65440. shadowMapEnabled:
  65441. e.shadowMap.enabled &&
  65442. c.receiveShadow &&
  65443. s.shadows.length > 0,
  65444. shadowMapType: e.shadowMap.type,
  65445. toneMapping: e.toneMapping,
  65446. physicallyCorrectLights: e.physicallyCorrectLights,
  65447. premultipliedAlpha: o.premultipliedAlpha,
  65448. alphaTest: o.alphaTest,
  65449. doubleSided: o.side === n.DoubleSide,
  65450. flipSided: o.side === n.BackSide,
  65451. };
  65452. return p;
  65453. }),
  65454. (this.getProgramCode = function (e, t) {
  65455. var i = [];
  65456. if (
  65457. (t.shaderID
  65458. ? i.push(t.shaderID)
  65459. : (i.push(e.fragmentShader), i.push(e.vertexShader)),
  65460. void 0 !== e.defines)
  65461. )
  65462. for (var n in e.defines) i.push(n), i.push(e.defines[n]);
  65463. for (var r = 0; r < s.length; r++) {
  65464. var o = s[r];
  65465. i.push(o), i.push(t[o]);
  65466. }
  65467. return i.join();
  65468. }),
  65469. (this.acquireProgram = function (t, i, r) {
  65470. for (var a, s = 0, l = o.length; s < l; s++) {
  65471. var c = o[s];
  65472. if (c.code === r) {
  65473. (a = c), ++a.usedTimes;
  65474. break;
  65475. }
  65476. }
  65477. return (
  65478. void 0 === a &&
  65479. ((a = new n.WebGLProgram(e, r, t, i)), o.push(a)),
  65480. a
  65481. );
  65482. }),
  65483. (this.releaseProgram = function (e) {
  65484. if (0 === --e.usedTimes) {
  65485. var t = o.indexOf(e);
  65486. (o[t] = o[o.length - 1]), o.pop(), e.destroy();
  65487. }
  65488. }),
  65489. (this.programs = o);
  65490. }),
  65491. (n.WebGLProperties = function () {
  65492. var e = {};
  65493. (this.get = function (t) {
  65494. var i = t.uuid,
  65495. n = e[i];
  65496. return void 0 === n && ((n = {}), (e[i] = n)), n;
  65497. }),
  65498. (this.delete = function (t) {
  65499. delete e[t.uuid];
  65500. }),
  65501. (this.clear = function () {
  65502. e = {};
  65503. });
  65504. }),
  65505. (n.WebGLShader = (function () {
  65506. function e(e) {
  65507. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  65508. t[i] = i + 1 + ": " + t[i];
  65509. return t.join("\n");
  65510. }
  65511. return function (t, i, n) {
  65512. var r = t.createShader(i);
  65513. return (
  65514. t.shaderSource(r, n),
  65515. t.compileShader(r),
  65516. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 &&
  65517. console.error("THREE.WebGLShader: Shader couldn't compile."),
  65518. "" !== t.getShaderInfoLog(r) &&
  65519. console.warn(
  65520. "THREE.WebGLShader: gl.getShaderInfoLog()",
  65521. i === t.VERTEX_SHADER ? "vertex" : "fragment",
  65522. t.getShaderInfoLog(r),
  65523. e(n)
  65524. ),
  65525. r
  65526. );
  65527. };
  65528. })()),
  65529. (n.WebGLShadowMap = function (e, t, i) {
  65530. function r(e, t, i, r) {
  65531. var o = e.geometry,
  65532. a = null,
  65533. s = v,
  65534. l = e.customDepthMaterial;
  65535. if ((i && ((s = A), (l = e.customDistanceMaterial)), l)) a = l;
  65536. else {
  65537. var c =
  65538. void 0 !== o.morphTargets &&
  65539. o.morphTargets.length > 0 &&
  65540. t.morphTargets,
  65541. h = e instanceof n.SkinnedMesh && t.skinning,
  65542. u = 0;
  65543. c && (u |= f), h && (u |= g), (a = s[u]);
  65544. }
  65545. return (
  65546. (a.visible = t.visible),
  65547. (a.wireframe = t.wireframe),
  65548. (a.wireframeLinewidth = t.wireframeLinewidth),
  65549. i &&
  65550. void 0 !== a.uniforms.lightPos &&
  65551. a.uniforms.lightPos.value.copy(r),
  65552. a
  65553. );
  65554. }
  65555. function o(e, t, i) {
  65556. if (e.visible !== !1) {
  65557. if (
  65558. e.layers.test(t.layers) &&
  65559. (e instanceof n.Mesh ||
  65560. e instanceof n.Line ||
  65561. e instanceof n.Points) &&
  65562. e.castShadow &&
  65563. (e.frustumCulled === !1 || l.intersectsObject(e) === !0)
  65564. ) {
  65565. var r = e.material;
  65566. r.visible === !0 &&
  65567. (e.modelViewMatrix.multiplyMatrices(
  65568. i.matrixWorldInverse,
  65569. e.matrixWorld
  65570. ),
  65571. p.push(e));
  65572. }
  65573. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  65574. o(a[s], t, i);
  65575. }
  65576. }
  65577. for (
  65578. var a = e.context,
  65579. s = e.state,
  65580. l = new n.Frustum(),
  65581. c = new n.Matrix4(),
  65582. h = new n.Vector2(),
  65583. u = new n.Vector3(),
  65584. d = new n.Vector3(),
  65585. p = [],
  65586. f = 1,
  65587. g = 2,
  65588. m = (f | g) + 1,
  65589. v = new Array(m),
  65590. A = new Array(m),
  65591. y = [
  65592. new n.Vector3(1, 0, 0),
  65593. new n.Vector3(-1, 0, 0),
  65594. new n.Vector3(0, 0, 1),
  65595. new n.Vector3(0, 0, -1),
  65596. new n.Vector3(0, 1, 0),
  65597. new n.Vector3(0, -1, 0),
  65598. ],
  65599. C = [
  65600. new n.Vector3(0, 1, 0),
  65601. new n.Vector3(0, 1, 0),
  65602. new n.Vector3(0, 1, 0),
  65603. new n.Vector3(0, 1, 0),
  65604. new n.Vector3(0, 0, 1),
  65605. new n.Vector3(0, 0, -1),
  65606. ],
  65607. I = [
  65608. new n.Vector4(),
  65609. new n.Vector4(),
  65610. new n.Vector4(),
  65611. new n.Vector4(),
  65612. new n.Vector4(),
  65613. new n.Vector4(),
  65614. ],
  65615. E = n.ShaderLib.depthRGBA,
  65616. b = n.UniformsUtils.clone(E.uniforms),
  65617. w = n.ShaderLib.distanceRGBA,
  65618. _ = n.UniformsUtils.clone(w.uniforms),
  65619. T = 0;
  65620. T !== m;
  65621. ++T
  65622. ) {
  65623. var x = 0 !== (T & f),
  65624. S = 0 !== (T & g),
  65625. M = new n.ShaderMaterial({
  65626. uniforms: b,
  65627. vertexShader: E.vertexShader,
  65628. fragmentShader: E.fragmentShader,
  65629. morphTargets: x,
  65630. skinning: S,
  65631. });
  65632. v[T] = M;
  65633. var R = new n.ShaderMaterial({
  65634. defines: {
  65635. USE_SHADOWMAP: "",
  65636. },
  65637. uniforms: _,
  65638. vertexShader: w.vertexShader,
  65639. fragmentShader: w.fragmentShader,
  65640. morphTargets: x,
  65641. skinning: S,
  65642. });
  65643. A[T] = R;
  65644. }
  65645. var P = this;
  65646. (this.enabled = !1),
  65647. (this.autoUpdate = !0),
  65648. (this.needsUpdate = !1),
  65649. (this.type = n.PCFShadowMap),
  65650. (this.cullFace = n.CullFaceFront),
  65651. (this.render = function (f, g) {
  65652. var m,
  65653. v,
  65654. A = t.shadows;
  65655. if (
  65656. 0 !== A.length &&
  65657. P.enabled !== !1 &&
  65658. (P.autoUpdate !== !1 || P.needsUpdate !== !1)
  65659. ) {
  65660. s.clearColor(1, 1, 1, 1),
  65661. s.disable(a.BLEND),
  65662. s.enable(a.CULL_FACE),
  65663. a.frontFace(a.CCW),
  65664. a.cullFace(
  65665. P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK
  65666. ),
  65667. s.setDepthTest(!0),
  65668. s.setScissorTest(!1);
  65669. for (var E = 0, b = A.length; E < b; E++) {
  65670. var w = A[E],
  65671. _ = w.shadow,
  65672. T = _.camera;
  65673. if ((h.copy(_.mapSize), w instanceof n.PointLight)) {
  65674. (m = 6), (v = !0);
  65675. var x = h.x,
  65676. S = h.y;
  65677. I[0].set(2 * x, S, x, S),
  65678. I[1].set(0, S, x, S),
  65679. I[2].set(3 * x, S, x, S),
  65680. I[3].set(x, S, x, S),
  65681. I[4].set(3 * x, 0, x, S),
  65682. I[5].set(x, 0, x, S),
  65683. (h.x *= 4),
  65684. (h.y *= 2);
  65685. } else (m = 1), (v = !1);
  65686. if (null === _.map) {
  65687. var M = {
  65688. minFilter: n.NearestFilter,
  65689. magFilter: n.NearestFilter,
  65690. format: n.RGBAFormat,
  65691. };
  65692. (_.map = new n.WebGLRenderTarget(h.x, h.y, M)),
  65693. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  65694. T.updateProjectionMatrix();
  65695. }
  65696. var R = _.map,
  65697. O = _.matrix;
  65698. d.setFromMatrixPosition(w.matrixWorld),
  65699. T.position.copy(d),
  65700. e.setRenderTarget(R),
  65701. e.clear();
  65702. for (var L = 0; L < m; L++) {
  65703. if (v) {
  65704. u.copy(T.position),
  65705. u.add(y[L]),
  65706. T.up.copy(C[L]),
  65707. T.lookAt(u);
  65708. var D = I[L];
  65709. s.viewport(D);
  65710. } else
  65711. u.setFromMatrixPosition(w.target.matrixWorld),
  65712. T.lookAt(u);
  65713. T.updateMatrixWorld(),
  65714. T.matrixWorldInverse.getInverse(T.matrixWorld),
  65715. O.set(
  65716. 0.5,
  65717. 0,
  65718. 0,
  65719. 0.5,
  65720. 0,
  65721. 0.5,
  65722. 0,
  65723. 0.5,
  65724. 0,
  65725. 0,
  65726. 0.5,
  65727. 0.5,
  65728. 0,
  65729. 0,
  65730. 0,
  65731. 1
  65732. ),
  65733. O.multiply(T.projectionMatrix),
  65734. O.multiply(T.matrixWorldInverse),
  65735. c.multiplyMatrices(
  65736. T.projectionMatrix,
  65737. T.matrixWorldInverse
  65738. ),
  65739. l.setFromMatrix(c),
  65740. (p.length = 0),
  65741. o(f, g, T);
  65742. for (var N = 0, B = p.length; N < B; N++) {
  65743. var F = p[N],
  65744. V = i.update(F),
  65745. U = F.material;
  65746. if (U instanceof n.MultiMaterial)
  65747. for (
  65748. var k = V.groups,
  65749. H = U.materials,
  65750. G = 0,
  65751. z = k.length;
  65752. G < z;
  65753. G++
  65754. ) {
  65755. var W = k[G],
  65756. j = H[W.materialIndex];
  65757. if (j.visible === !0) {
  65758. var Y = r(F, j, v, d);
  65759. e.renderBufferDirect(T, null, V, Y, F, W);
  65760. }
  65761. }
  65762. else {
  65763. var Y = r(F, U, v, d);
  65764. e.renderBufferDirect(T, null, V, Y, F, null);
  65765. }
  65766. }
  65767. }
  65768. }
  65769. var X = e.getClearColor(),
  65770. Z = e.getClearAlpha();
  65771. e.setClearColor(X, Z),
  65772. s.enable(a.BLEND),
  65773. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  65774. (P.needsUpdate = !1);
  65775. }
  65776. });
  65777. }),
  65778. (n.WebGLState = function (e, t, i) {
  65779. var r = this,
  65780. o = new n.Vector4(),
  65781. a = new Uint8Array(16),
  65782. s = new Uint8Array(16),
  65783. l = new Uint8Array(16),
  65784. c = {},
  65785. h = null,
  65786. u = null,
  65787. d = null,
  65788. p = null,
  65789. f = null,
  65790. g = null,
  65791. m = null,
  65792. v = null,
  65793. A = !1,
  65794. y = null,
  65795. C = null,
  65796. I = null,
  65797. E = null,
  65798. b = null,
  65799. w = null,
  65800. _ = null,
  65801. T = null,
  65802. x = null,
  65803. S = null,
  65804. M = null,
  65805. R = null,
  65806. P = null,
  65807. O = null,
  65808. L = null,
  65809. D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  65810. N = void 0,
  65811. B = {},
  65812. F = new n.Vector4(),
  65813. V = null,
  65814. U = null,
  65815. k = new n.Vector4(),
  65816. H = new n.Vector4(),
  65817. G = e.createTexture();
  65818. e.bindTexture(e.TEXTURE_2D, G),
  65819. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  65820. e.texImage2D(
  65821. e.TEXTURE_2D,
  65822. 0,
  65823. e.RGB,
  65824. 1,
  65825. 1,
  65826. 0,
  65827. e.RGB,
  65828. e.UNSIGNED_BYTE,
  65829. new Uint8Array(3)
  65830. ),
  65831. (this.init = function () {
  65832. this.clearColor(0, 0, 0, 1),
  65833. this.clearDepth(1),
  65834. this.clearStencil(0),
  65835. this.enable(e.DEPTH_TEST),
  65836. e.depthFunc(e.LEQUAL),
  65837. e.frontFace(e.CCW),
  65838. e.cullFace(e.BACK),
  65839. this.enable(e.CULL_FACE),
  65840. this.enable(e.BLEND),
  65841. e.blendEquation(e.FUNC_ADD),
  65842. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA);
  65843. }),
  65844. (this.initAttributes = function () {
  65845. for (var e = 0, t = a.length; e < t; e++) a[e] = 0;
  65846. }),
  65847. (this.enableAttribute = function (i) {
  65848. if (
  65849. ((a[i] = 1),
  65850. 0 === s[i] && (e.enableVertexAttribArray(i), (s[i] = 1)),
  65851. 0 !== l[i])
  65852. ) {
  65853. var n = t.get("ANGLE_instanced_arrays");
  65854. n.vertexAttribDivisorANGLE(i, 0), (l[i] = 0);
  65855. }
  65856. }),
  65857. (this.enableAttributeAndDivisor = function (t, i, n) {
  65858. (a[t] = 1),
  65859. 0 === s[t] && (e.enableVertexAttribArray(t), (s[t] = 1)),
  65860. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i), (l[t] = i));
  65861. }),
  65862. (this.disableUnusedAttributes = function () {
  65863. for (var t = 0, i = s.length; t < i; t++)
  65864. s[t] !== a[t] && (e.disableVertexAttribArray(t), (s[t] = 0));
  65865. }),
  65866. (this.enable = function (t) {
  65867. c[t] !== !0 && (e.enable(t), (c[t] = !0));
  65868. }),
  65869. (this.disable = function (t) {
  65870. c[t] !== !1 && (e.disable(t), (c[t] = !1));
  65871. }),
  65872. (this.getCompressedTextureFormats = function () {
  65873. if (
  65874. null === h &&
  65875. ((h = []),
  65876. t.get("WEBGL_compressed_texture_pvrtc") ||
  65877. t.get("WEBGL_compressed_texture_s3tc") ||
  65878. t.get("WEBGL_compressed_texture_etc1"))
  65879. )
  65880. for (
  65881. var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0;
  65882. n < i.length;
  65883. n++
  65884. )
  65885. h.push(i[n]);
  65886. return h;
  65887. }),
  65888. (this.setBlending = function (t, r, o, a, s, l, c, h) {
  65889. t === n.NoBlending
  65890. ? this.disable(e.BLEND)
  65891. : this.enable(e.BLEND),
  65892. (t === u && h === A) ||
  65893. (t === n.AdditiveBlending
  65894. ? h
  65895. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  65896. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE))
  65897. : (e.blendEquation(e.FUNC_ADD),
  65898. e.blendFunc(e.SRC_ALPHA, e.ONE))
  65899. : t === n.SubtractiveBlending
  65900. ? h
  65901. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  65902. e.blendFuncSeparate(
  65903. e.ZERO,
  65904. e.ZERO,
  65905. e.ONE_MINUS_SRC_COLOR,
  65906. e.ONE_MINUS_SRC_ALPHA
  65907. ))
  65908. : (e.blendEquation(e.FUNC_ADD),
  65909. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR))
  65910. : t === n.MultiplyBlending
  65911. ? h
  65912. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  65913. e.blendFuncSeparate(
  65914. e.ZERO,
  65915. e.ZERO,
  65916. e.SRC_COLOR,
  65917. e.SRC_ALPHA
  65918. ))
  65919. : (e.blendEquation(e.FUNC_ADD),
  65920. e.blendFunc(e.ZERO, e.SRC_COLOR))
  65921. : h
  65922. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  65923. e.blendFuncSeparate(
  65924. e.ONE,
  65925. e.ONE_MINUS_SRC_ALPHA,
  65926. e.ONE,
  65927. e.ONE_MINUS_SRC_ALPHA
  65928. ))
  65929. : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  65930. e.blendFuncSeparate(
  65931. e.SRC_ALPHA,
  65932. e.ONE_MINUS_SRC_ALPHA,
  65933. e.ONE,
  65934. e.ONE_MINUS_SRC_ALPHA
  65935. )),
  65936. (u = t),
  65937. (A = h)),
  65938. t === n.CustomBlending
  65939. ? ((s = s || r),
  65940. (l = l || o),
  65941. (c = c || a),
  65942. (r === d && s === g) ||
  65943. (e.blendEquationSeparate(i(r), i(s)), (d = r), (g = s)),
  65944. (o === p && a === f && l === m && c === v) ||
  65945. (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  65946. (p = o),
  65947. (f = a),
  65948. (m = l),
  65949. (v = c)))
  65950. : ((d = null),
  65951. (p = null),
  65952. (f = null),
  65953. (g = null),
  65954. (m = null),
  65955. (v = null));
  65956. }),
  65957. (this.setDepthFunc = function (t) {
  65958. if (y !== t) {
  65959. if (t)
  65960. switch (t) {
  65961. case n.NeverDepth:
  65962. e.depthFunc(e.NEVER);
  65963. break;
  65964. case n.AlwaysDepth:
  65965. e.depthFunc(e.ALWAYS);
  65966. break;
  65967. case n.LessDepth:
  65968. e.depthFunc(e.LESS);
  65969. break;
  65970. case n.LessEqualDepth:
  65971. e.depthFunc(e.LEQUAL);
  65972. break;
  65973. case n.EqualDepth:
  65974. e.depthFunc(e.EQUAL);
  65975. break;
  65976. case n.GreaterEqualDepth:
  65977. e.depthFunc(e.GEQUAL);
  65978. break;
  65979. case n.GreaterDepth:
  65980. e.depthFunc(e.GREATER);
  65981. break;
  65982. case n.NotEqualDepth:
  65983. e.depthFunc(e.NOTEQUAL);
  65984. break;
  65985. default:
  65986. e.depthFunc(e.LEQUAL);
  65987. }
  65988. else e.depthFunc(e.LEQUAL);
  65989. y = t;
  65990. }
  65991. }),
  65992. (this.setDepthTest = function (t) {
  65993. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST);
  65994. }),
  65995. (this.setDepthWrite = function (t) {
  65996. C !== t && (e.depthMask(t), (C = t));
  65997. }),
  65998. (this.setColorWrite = function (t) {
  65999. I !== t && (e.colorMask(t, t, t, t), (I = t));
  66000. }),
  66001. (this.setStencilFunc = function (t, i, n) {
  66002. (b === t && w === i && _ === n) ||
  66003. (e.stencilFunc(t, i, n), (b = t), (w = i), (_ = n));
  66004. }),
  66005. (this.setStencilOp = function (t, i, n) {
  66006. (T === t && x === i && S === n) ||
  66007. (e.stencilOp(t, i, n), (T = t), (x = i), (S = n));
  66008. }),
  66009. (this.setStencilTest = function (t) {
  66010. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST);
  66011. }),
  66012. (this.setStencilWrite = function (t) {
  66013. E !== t && (e.stencilMask(t), (E = t));
  66014. }),
  66015. (this.setFlipSided = function (t) {
  66016. M !== t &&
  66017. (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), (M = t));
  66018. }),
  66019. (this.setLineWidth = function (t) {
  66020. t !== R && (e.lineWidth(t), (R = t));
  66021. }),
  66022. (this.setPolygonOffset = function (t, i, n) {
  66023. t
  66024. ? this.enable(e.POLYGON_OFFSET_FILL)
  66025. : this.disable(e.POLYGON_OFFSET_FILL),
  66026. !t ||
  66027. (P === i && O === n) ||
  66028. (e.polygonOffset(i, n), (P = i), (O = n));
  66029. }),
  66030. (this.getScissorTest = function () {
  66031. return L;
  66032. }),
  66033. (this.setScissorTest = function (t) {
  66034. (L = t),
  66035. t
  66036. ? this.enable(e.SCISSOR_TEST)
  66037. : this.disable(e.SCISSOR_TEST);
  66038. }),
  66039. (this.activeTexture = function (t) {
  66040. void 0 === t && (t = e.TEXTURE0 + D - 1),
  66041. N !== t && (e.activeTexture(t), (N = t));
  66042. }),
  66043. (this.bindTexture = function (t, i) {
  66044. void 0 === N && r.activeTexture();
  66045. var n = B[N];
  66046. void 0 === n &&
  66047. ((n = {
  66048. type: void 0,
  66049. texture: void 0,
  66050. }),
  66051. (B[N] = n)),
  66052. (n.type === t && n.texture === i) ||
  66053. (e.bindTexture(t, i || G), (n.type = t), (n.texture = i));
  66054. }),
  66055. (this.compressedTexImage2D = function () {
  66056. try {
  66057. e.compressedTexImage2D.apply(e, arguments);
  66058. } catch (e) {
  66059. console.error(e);
  66060. }
  66061. }),
  66062. (this.texImage2D = function () {
  66063. try {
  66064. e.texImage2D.apply(e, arguments);
  66065. } catch (e) {
  66066. console.error(e);
  66067. }
  66068. }),
  66069. (this.clearColor = function (t, i, n, r) {
  66070. o.set(t, i, n, r),
  66071. F.equals(o) === !1 && (e.clearColor(t, i, n, r), F.copy(o));
  66072. }),
  66073. (this.clearDepth = function (t) {
  66074. V !== t && (e.clearDepth(t), (V = t));
  66075. }),
  66076. (this.clearStencil = function (t) {
  66077. U !== t && (e.clearStencil(t), (U = t));
  66078. }),
  66079. (this.scissor = function (t) {
  66080. k.equals(t) === !1 &&
  66081. (e.scissor(t.x, t.y, t.z, t.w), k.copy(t));
  66082. }),
  66083. (this.viewport = function (t) {
  66084. H.equals(t) === !1 &&
  66085. (e.viewport(t.x, t.y, t.z, t.w), H.copy(t));
  66086. }),
  66087. (this.reset = function () {
  66088. for (var t = 0; t < s.length; t++)
  66089. 1 === s[t] && (e.disableVertexAttribArray(t), (s[t] = 0));
  66090. (c = {}),
  66091. (h = null),
  66092. (N = void 0),
  66093. (B = {}),
  66094. (u = null),
  66095. (I = null),
  66096. (C = null),
  66097. (E = null),
  66098. (M = null);
  66099. });
  66100. }),
  66101. (n.LensFlarePlugin = function (e, t) {
  66102. function i() {
  66103. var e = new Float32Array([
  66104. -1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1,
  66105. ]),
  66106. t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  66107. (o = p.createBuffer()),
  66108. (a = p.createBuffer()),
  66109. p.bindBuffer(p.ARRAY_BUFFER, o),
  66110. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  66111. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  66112. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  66113. (u = p.createTexture()),
  66114. (d = p.createTexture()),
  66115. f.bindTexture(p.TEXTURE_2D, u),
  66116. p.texImage2D(
  66117. p.TEXTURE_2D,
  66118. 0,
  66119. p.RGB,
  66120. 16,
  66121. 16,
  66122. 0,
  66123. p.RGB,
  66124. p.UNSIGNED_BYTE,
  66125. null
  66126. ),
  66127. p.texParameteri(
  66128. p.TEXTURE_2D,
  66129. p.TEXTURE_WRAP_S,
  66130. p.CLAMP_TO_EDGE
  66131. ),
  66132. p.texParameteri(
  66133. p.TEXTURE_2D,
  66134. p.TEXTURE_WRAP_T,
  66135. p.CLAMP_TO_EDGE
  66136. ),
  66137. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  66138. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  66139. f.bindTexture(p.TEXTURE_2D, d),
  66140. p.texImage2D(
  66141. p.TEXTURE_2D,
  66142. 0,
  66143. p.RGBA,
  66144. 16,
  66145. 16,
  66146. 0,
  66147. p.RGBA,
  66148. p.UNSIGNED_BYTE,
  66149. null
  66150. ),
  66151. p.texParameteri(
  66152. p.TEXTURE_2D,
  66153. p.TEXTURE_WRAP_S,
  66154. p.CLAMP_TO_EDGE
  66155. ),
  66156. p.texParameteri(
  66157. p.TEXTURE_2D,
  66158. p.TEXTURE_WRAP_T,
  66159. p.CLAMP_TO_EDGE
  66160. ),
  66161. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  66162. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  66163. (h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0);
  66164. var i;
  66165. (i = h
  66166. ? {
  66167. vertexShader: [
  66168. "uniform lowp int renderType;",
  66169. "uniform vec3 screenPosition;",
  66170. "uniform vec2 scale;",
  66171. "uniform float rotation;",
  66172. "uniform sampler2D occlusionMap;",
  66173. "attribute vec2 position;",
  66174. "attribute vec2 uv;",
  66175. "varying vec2 vUV;",
  66176. "varying float vVisibility;",
  66177. "void main() {",
  66178. "vUV = uv;",
  66179. "vec2 pos = position;",
  66180. "if ( renderType == 2 ) {",
  66181. "vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );",
  66182. "visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );",
  66183. "visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );",
  66184. "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );",
  66185. "visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );",
  66186. "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );",
  66187. "visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );",
  66188. "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );",
  66189. "visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );",
  66190. "vVisibility = visibility.r / 9.0;",
  66191. "vVisibility *= 1.0 - visibility.g / 9.0;",
  66192. "vVisibility *= visibility.b / 9.0;",
  66193. "vVisibility *= 1.0 - visibility.a / 9.0;",
  66194. "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;",
  66195. "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;",
  66196. "}",
  66197. "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );",
  66198. "}",
  66199. ].join("\n"),
  66200. fragmentShader: [
  66201. "uniform lowp int renderType;",
  66202. "uniform sampler2D map;",
  66203. "uniform float opacity;",
  66204. "uniform vec3 color;",
  66205. "varying vec2 vUV;",
  66206. "varying float vVisibility;",
  66207. "void main() {",
  66208. "if ( renderType == 0 ) {",
  66209. "gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );",
  66210. "} else if ( renderType == 1 ) {",
  66211. "gl_FragColor = texture2D( map, vUV );",
  66212. "} else {",
  66213. "vec4 texture = texture2D( map, vUV );",
  66214. "texture.a *= opacity * vVisibility;",
  66215. "gl_FragColor = texture;",
  66216. "gl_FragColor.rgb *= color;",
  66217. "}",
  66218. "}",
  66219. ].join("\n"),
  66220. }
  66221. : {
  66222. vertexShader: [
  66223. "uniform lowp int renderType;",
  66224. "uniform vec3 screenPosition;",
  66225. "uniform vec2 scale;",
  66226. "uniform float rotation;",
  66227. "attribute vec2 position;",
  66228. "attribute vec2 uv;",
  66229. "varying vec2 vUV;",
  66230. "void main() {",
  66231. "vUV = uv;",
  66232. "vec2 pos = position;",
  66233. "if ( renderType == 2 ) {",
  66234. "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;",
  66235. "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;",
  66236. "}",
  66237. "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );",
  66238. "}",
  66239. ].join("\n"),
  66240. fragmentShader: [
  66241. "precision mediump float;",
  66242. "uniform lowp int renderType;",
  66243. "uniform sampler2D map;",
  66244. "uniform sampler2D occlusionMap;",
  66245. "uniform float opacity;",
  66246. "uniform vec3 color;",
  66247. "varying vec2 vUV;",
  66248. "void main() {",
  66249. "if ( renderType == 0 ) {",
  66250. "gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );",
  66251. "} else if ( renderType == 1 ) {",
  66252. "gl_FragColor = texture2D( map, vUV );",
  66253. "} else {",
  66254. "float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;",
  66255. "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;",
  66256. "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;",
  66257. "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;",
  66258. "visibility = ( 1.0 - visibility / 4.0 );",
  66259. "vec4 texture = texture2D( map, vUV );",
  66260. "texture.a *= opacity * visibility;",
  66261. "gl_FragColor = texture;",
  66262. "gl_FragColor.rgb *= color;",
  66263. "}",
  66264. "}",
  66265. ].join("\n"),
  66266. }),
  66267. (s = r(i)),
  66268. (l = {
  66269. vertex: p.getAttribLocation(s, "position"),
  66270. uv: p.getAttribLocation(s, "uv"),
  66271. }),
  66272. (c = {
  66273. renderType: p.getUniformLocation(s, "renderType"),
  66274. map: p.getUniformLocation(s, "map"),
  66275. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  66276. opacity: p.getUniformLocation(s, "opacity"),
  66277. color: p.getUniformLocation(s, "color"),
  66278. scale: p.getUniformLocation(s, "scale"),
  66279. rotation: p.getUniformLocation(s, "rotation"),
  66280. screenPosition: p.getUniformLocation(s, "screenPosition"),
  66281. });
  66282. }
  66283. function r(t) {
  66284. var i = p.createProgram(),
  66285. n = p.createShader(p.FRAGMENT_SHADER),
  66286. r = p.createShader(p.VERTEX_SHADER),
  66287. o = "precision " + e.getPrecision() + " float;\n";
  66288. return (
  66289. p.shaderSource(n, o + t.fragmentShader),
  66290. p.shaderSource(r, o + t.vertexShader),
  66291. p.compileShader(n),
  66292. p.compileShader(r),
  66293. p.attachShader(i, n),
  66294. p.attachShader(i, r),
  66295. p.linkProgram(i),
  66296. i
  66297. );
  66298. }
  66299. var o,
  66300. a,
  66301. s,
  66302. l,
  66303. c,
  66304. h,
  66305. u,
  66306. d,
  66307. p = e.context,
  66308. f = e.state;
  66309. this.render = function (r, g, m) {
  66310. if (0 !== t.length) {
  66311. var v = new n.Vector3(),
  66312. A = m.w / m.z,
  66313. y = 0.5 * m.z,
  66314. C = 0.5 * m.w,
  66315. I = 16 / m.w,
  66316. E = new n.Vector2(I * A, I),
  66317. b = new n.Vector3(1, 1, 0),
  66318. w = new n.Vector2(1, 1);
  66319. void 0 === s && i(),
  66320. p.useProgram(s),
  66321. f.initAttributes(),
  66322. f.enableAttribute(l.vertex),
  66323. f.enableAttribute(l.uv),
  66324. f.disableUnusedAttributes(),
  66325. p.uniform1i(c.occlusionMap, 0),
  66326. p.uniform1i(c.map, 1),
  66327. p.bindBuffer(p.ARRAY_BUFFER, o),
  66328. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  66329. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  66330. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  66331. f.disable(p.CULL_FACE),
  66332. f.setDepthWrite(!1);
  66333. for (var _ = 0, T = t.length; _ < T; _++) {
  66334. (I = 16 / m.w), E.set(I * A, I);
  66335. var x = t[_];
  66336. if (
  66337. (v.set(
  66338. x.matrixWorld.elements[12],
  66339. x.matrixWorld.elements[13],
  66340. x.matrixWorld.elements[14]
  66341. ),
  66342. v.applyMatrix4(g.matrixWorldInverse),
  66343. v.applyProjection(g.projectionMatrix),
  66344. b.copy(v),
  66345. (w.x = b.x * y + y),
  66346. (w.y = b.y * C + C),
  66347. h || (w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w))
  66348. ) {
  66349. f.activeTexture(p.TEXTURE0),
  66350. f.bindTexture(p.TEXTURE_2D, null),
  66351. f.activeTexture(p.TEXTURE1),
  66352. f.bindTexture(p.TEXTURE_2D, u),
  66353. p.copyTexImage2D(
  66354. p.TEXTURE_2D,
  66355. 0,
  66356. p.RGB,
  66357. m.x + w.x - 8,
  66358. m.y + w.y - 8,
  66359. 16,
  66360. 16,
  66361. 0
  66362. ),
  66363. p.uniform1i(c.renderType, 0),
  66364. p.uniform2f(c.scale, E.x, E.y),
  66365. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  66366. f.disable(p.BLEND),
  66367. f.enable(p.DEPTH_TEST),
  66368. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  66369. f.activeTexture(p.TEXTURE0),
  66370. f.bindTexture(p.TEXTURE_2D, d),
  66371. p.copyTexImage2D(
  66372. p.TEXTURE_2D,
  66373. 0,
  66374. p.RGBA,
  66375. m.x + w.x - 8,
  66376. m.y + w.y - 8,
  66377. 16,
  66378. 16,
  66379. 0
  66380. ),
  66381. p.uniform1i(c.renderType, 1),
  66382. f.disable(p.DEPTH_TEST),
  66383. f.activeTexture(p.TEXTURE1),
  66384. f.bindTexture(p.TEXTURE_2D, u),
  66385. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  66386. x.positionScreen.copy(b),
  66387. x.customUpdateCallback
  66388. ? x.customUpdateCallback(x)
  66389. : x.updateLensFlares(),
  66390. p.uniform1i(c.renderType, 2),
  66391. f.enable(p.BLEND);
  66392. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  66393. var R = x.lensFlares[S];
  66394. R.opacity > 0.001 &&
  66395. R.scale > 0.001 &&
  66396. ((b.x = R.x),
  66397. (b.y = R.y),
  66398. (b.z = R.z),
  66399. (I = (R.size * R.scale) / m.w),
  66400. (E.x = I * A),
  66401. (E.y = I),
  66402. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  66403. p.uniform2f(c.scale, E.x, E.y),
  66404. p.uniform1f(c.rotation, R.rotation),
  66405. p.uniform1f(c.opacity, R.opacity),
  66406. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  66407. f.setBlending(
  66408. R.blending,
  66409. R.blendEquation,
  66410. R.blendSrc,
  66411. R.blendDst
  66412. ),
  66413. e.setTexture(R.texture, 1),
  66414. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0));
  66415. }
  66416. }
  66417. }
  66418. f.enable(p.CULL_FACE),
  66419. f.enable(p.DEPTH_TEST),
  66420. f.setDepthWrite(!0),
  66421. e.resetGLState();
  66422. }
  66423. };
  66424. }),
  66425. (n.SpritePlugin = function (e, t) {
  66426. function i() {
  66427. var e = new Float32Array([
  66428. -0.5, -0.5, 0, 0, 0.5, -0.5, 1, 0, 0.5, 0.5, 1, 1, -0.5, 0.5,
  66429. 0, 1,
  66430. ]),
  66431. t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  66432. (a = d.createBuffer()),
  66433. (s = d.createBuffer()),
  66434. d.bindBuffer(d.ARRAY_BUFFER, a),
  66435. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  66436. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  66437. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  66438. (l = r()),
  66439. (c = {
  66440. position: d.getAttribLocation(l, "position"),
  66441. uv: d.getAttribLocation(l, "uv"),
  66442. }),
  66443. (h = {
  66444. uvOffset: d.getUniformLocation(l, "uvOffset"),
  66445. uvScale: d.getUniformLocation(l, "uvScale"),
  66446. rotation: d.getUniformLocation(l, "rotation"),
  66447. scale: d.getUniformLocation(l, "scale"),
  66448. color: d.getUniformLocation(l, "color"),
  66449. map: d.getUniformLocation(l, "map"),
  66450. opacity: d.getUniformLocation(l, "opacity"),
  66451. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  66452. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  66453. fogType: d.getUniformLocation(l, "fogType"),
  66454. fogDensity: d.getUniformLocation(l, "fogDensity"),
  66455. fogNear: d.getUniformLocation(l, "fogNear"),
  66456. fogFar: d.getUniformLocation(l, "fogFar"),
  66457. fogColor: d.getUniformLocation(l, "fogColor"),
  66458. alphaTest: d.getUniformLocation(l, "alphaTest"),
  66459. });
  66460. var i = document.createElement("canvas");
  66461. (i.width = 8), (i.height = 8);
  66462. var o = i.getContext("2d");
  66463. (o.fillStyle = "white"),
  66464. o.fillRect(0, 0, 8, 8),
  66465. (u = new n.Texture(i)),
  66466. (u.needsUpdate = !0);
  66467. }
  66468. function r() {
  66469. var t = d.createProgram(),
  66470. i = d.createShader(d.VERTEX_SHADER),
  66471. n = d.createShader(d.FRAGMENT_SHADER);
  66472. return (
  66473. d.shaderSource(
  66474. i,
  66475. [
  66476. "precision " + e.getPrecision() + " float;",
  66477. "uniform mat4 modelViewMatrix;",
  66478. "uniform mat4 projectionMatrix;",
  66479. "uniform float rotation;",
  66480. "uniform vec2 scale;",
  66481. "uniform vec2 uvOffset;",
  66482. "uniform vec2 uvScale;",
  66483. "attribute vec2 position;",
  66484. "attribute vec2 uv;",
  66485. "varying vec2 vUV;",
  66486. "void main() {",
  66487. "vUV = uvOffset + uv * uvScale;",
  66488. "vec2 alignedPosition = position * scale;",
  66489. "vec2 rotatedPosition;",
  66490. "rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;",
  66491. "rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;",
  66492. "vec4 finalPosition;",
  66493. "finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );",
  66494. "finalPosition.xy += rotatedPosition;",
  66495. "finalPosition = projectionMatrix * finalPosition;",
  66496. "gl_Position = finalPosition;",
  66497. "}",
  66498. ].join("\n")
  66499. ),
  66500. d.shaderSource(
  66501. n,
  66502. [
  66503. "precision " + e.getPrecision() + " float;",
  66504. "uniform vec3 color;",
  66505. "uniform sampler2D map;",
  66506. "uniform float opacity;",
  66507. "uniform int fogType;",
  66508. "uniform vec3 fogColor;",
  66509. "uniform float fogDensity;",
  66510. "uniform float fogNear;",
  66511. "uniform float fogFar;",
  66512. "uniform float alphaTest;",
  66513. "varying vec2 vUV;",
  66514. "void main() {",
  66515. "vec4 texture = texture2D( map, vUV );",
  66516. "if ( texture.a < alphaTest ) discard;",
  66517. "gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );",
  66518. "if ( fogType > 0 ) {",
  66519. "float depth = gl_FragCoord.z / gl_FragCoord.w;",
  66520. "float fogFactor = 0.0;",
  66521. "if ( fogType == 1 ) {",
  66522. "fogFactor = smoothstep( fogNear, fogFar, depth );",
  66523. "} else {",
  66524. "const float LOG2 = 1.442695;",
  66525. "fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );",
  66526. "fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );",
  66527. "}",
  66528. "gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );",
  66529. "}",
  66530. "}",
  66531. ].join("\n")
  66532. ),
  66533. d.compileShader(i),
  66534. d.compileShader(n),
  66535. d.attachShader(t, i),
  66536. d.attachShader(t, n),
  66537. d.linkProgram(t),
  66538. t
  66539. );
  66540. }
  66541. function o(e, t) {
  66542. return e.renderOrder !== t.renderOrder
  66543. ? e.renderOrder - t.renderOrder
  66544. : e.z !== t.z
  66545. ? t.z - e.z
  66546. : t.id - e.id;
  66547. }
  66548. var a,
  66549. s,
  66550. l,
  66551. c,
  66552. h,
  66553. u,
  66554. d = e.context,
  66555. p = e.state,
  66556. f = new n.Vector3(),
  66557. g = new n.Quaternion(),
  66558. m = new n.Vector3();
  66559. this.render = function (r, v) {
  66560. if (0 !== t.length) {
  66561. void 0 === l && i(),
  66562. d.useProgram(l),
  66563. p.initAttributes(),
  66564. p.enableAttribute(c.position),
  66565. p.enableAttribute(c.uv),
  66566. p.disableUnusedAttributes(),
  66567. p.disable(d.CULL_FACE),
  66568. p.enable(d.BLEND),
  66569. d.bindBuffer(d.ARRAY_BUFFER, a),
  66570. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  66571. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  66572. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  66573. d.uniformMatrix4fv(
  66574. h.projectionMatrix,
  66575. !1,
  66576. v.projectionMatrix.elements
  66577. ),
  66578. p.activeTexture(d.TEXTURE0),
  66579. d.uniform1i(h.map, 0);
  66580. var A = 0,
  66581. y = 0,
  66582. C = r.fog;
  66583. C
  66584. ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  66585. C instanceof n.Fog
  66586. ? (d.uniform1f(h.fogNear, C.near),
  66587. d.uniform1f(h.fogFar, C.far),
  66588. d.uniform1i(h.fogType, 1),
  66589. (A = 1),
  66590. (y = 1))
  66591. : C instanceof n.FogExp2 &&
  66592. (d.uniform1f(h.fogDensity, C.density),
  66593. d.uniform1i(h.fogType, 2),
  66594. (A = 2),
  66595. (y = 2)))
  66596. : (d.uniform1i(h.fogType, 0), (A = 0), (y = 0));
  66597. for (var I = 0, E = t.length; I < E; I++) {
  66598. var b = t[I];
  66599. b.modelViewMatrix.multiplyMatrices(
  66600. v.matrixWorldInverse,
  66601. b.matrixWorld
  66602. ),
  66603. (b.z = -b.modelViewMatrix.elements[14]);
  66604. }
  66605. t.sort(o);
  66606. for (var w = [], I = 0, E = t.length; I < E; I++) {
  66607. var b = t[I],
  66608. _ = b.material;
  66609. d.uniform1f(h.alphaTest, _.alphaTest),
  66610. d.uniformMatrix4fv(
  66611. h.modelViewMatrix,
  66612. !1,
  66613. b.modelViewMatrix.elements
  66614. ),
  66615. b.matrixWorld.decompose(f, g, m),
  66616. (w[0] = m.x),
  66617. (w[1] = m.y);
  66618. var T = 0;
  66619. r.fog && _.fog && (T = y),
  66620. A !== T && (d.uniform1i(h.fogType, T), (A = T)),
  66621. null !== _.map
  66622. ? (d.uniform2f(
  66623. h.uvOffset,
  66624. _.map.offset.x,
  66625. _.map.offset.y
  66626. ),
  66627. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y))
  66628. : (d.uniform2f(h.uvOffset, 0, 0),
  66629. d.uniform2f(h.uvScale, 1, 1)),
  66630. d.uniform1f(h.opacity, _.opacity),
  66631. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  66632. d.uniform1f(h.rotation, _.rotation),
  66633. d.uniform2fv(h.scale, w),
  66634. p.setBlending(
  66635. _.blending,
  66636. _.blendEquation,
  66637. _.blendSrc,
  66638. _.blendDst
  66639. ),
  66640. p.setDepthTest(_.depthTest),
  66641. p.setDepthWrite(_.depthWrite),
  66642. _.map && _.map.image && _.map.image.width
  66643. ? e.setTexture(_.map, 0)
  66644. : e.setTexture(u, 0),
  66645. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0);
  66646. }
  66647. p.enable(d.CULL_FACE), e.resetGLState();
  66648. }
  66649. };
  66650. }),
  66651. Object.defineProperties(n.Box2.prototype, {
  66652. empty: {
  66653. value: function () {
  66654. return (
  66655. console.warn(
  66656. "THREE.Box2: .empty() has been renamed to .isEmpty()."
  66657. ),
  66658. this.isEmpty()
  66659. );
  66660. },
  66661. },
  66662. isIntersectionBox: {
  66663. value: function (e) {
  66664. return (
  66665. console.warn(
  66666. "THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."
  66667. ),
  66668. this.intersectsBox(e)
  66669. );
  66670. },
  66671. },
  66672. }),
  66673. Object.defineProperties(n.Box3.prototype, {
  66674. empty: {
  66675. value: function () {
  66676. return (
  66677. console.warn(
  66678. "THREE.Box3: .empty() has been renamed to .isEmpty()."
  66679. ),
  66680. this.isEmpty()
  66681. );
  66682. },
  66683. },
  66684. isIntersectionBox: {
  66685. value: function (e) {
  66686. return (
  66687. console.warn(
  66688. "THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."
  66689. ),
  66690. this.intersectsBox(e)
  66691. );
  66692. },
  66693. },
  66694. isIntersectionSphere: {
  66695. value: function (e) {
  66696. return (
  66697. console.warn(
  66698. "THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."
  66699. ),
  66700. this.intersectsSphere(e)
  66701. );
  66702. },
  66703. },
  66704. }),
  66705. Object.defineProperties(n.Matrix3.prototype, {
  66706. multiplyVector3: {
  66707. value: function (e) {
  66708. return (
  66709. console.warn(
  66710. "THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."
  66711. ),
  66712. e.applyMatrix3(this)
  66713. );
  66714. },
  66715. },
  66716. multiplyVector3Array: {
  66717. value: function (e) {
  66718. return (
  66719. console.warn(
  66720. "THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."
  66721. ),
  66722. this.applyToVector3Array(e)
  66723. );
  66724. },
  66725. },
  66726. }),
  66727. Object.defineProperties(n.Matrix4.prototype, {
  66728. extractPosition: {
  66729. value: function (e) {
  66730. return (
  66731. console.warn(
  66732. "THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."
  66733. ),
  66734. this.copyPosition(e)
  66735. );
  66736. },
  66737. },
  66738. setRotationFromQuaternion: {
  66739. value: function (e) {
  66740. return (
  66741. console.warn(
  66742. "THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."
  66743. ),
  66744. this.makeRotationFromQuaternion(e)
  66745. );
  66746. },
  66747. },
  66748. multiplyVector3: {
  66749. value: function (e) {
  66750. return (
  66751. console.warn(
  66752. "THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."
  66753. ),
  66754. e.applyProjection(this)
  66755. );
  66756. },
  66757. },
  66758. multiplyVector4: {
  66759. value: function (e) {
  66760. return (
  66761. console.warn(
  66762. "THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."
  66763. ),
  66764. e.applyMatrix4(this)
  66765. );
  66766. },
  66767. },
  66768. multiplyVector3Array: {
  66769. value: function (e) {
  66770. return (
  66771. console.warn(
  66772. "THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."
  66773. ),
  66774. this.applyToVector3Array(e)
  66775. );
  66776. },
  66777. },
  66778. rotateAxis: {
  66779. value: function (e) {
  66780. console.warn(
  66781. "THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."
  66782. ),
  66783. e.transformDirection(this);
  66784. },
  66785. },
  66786. crossVector: {
  66787. value: function (e) {
  66788. return (
  66789. console.warn(
  66790. "THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."
  66791. ),
  66792. e.applyMatrix4(this)
  66793. );
  66794. },
  66795. },
  66796. translate: {
  66797. value: function (e) {
  66798. console.error("THREE.Matrix4: .translate() has been removed.");
  66799. },
  66800. },
  66801. rotateX: {
  66802. value: function (e) {
  66803. console.error("THREE.Matrix4: .rotateX() has been removed.");
  66804. },
  66805. },
  66806. rotateY: {
  66807. value: function (e) {
  66808. console.error("THREE.Matrix4: .rotateY() has been removed.");
  66809. },
  66810. },
  66811. rotateZ: {
  66812. value: function (e) {
  66813. console.error("THREE.Matrix4: .rotateZ() has been removed.");
  66814. },
  66815. },
  66816. rotateByAxis: {
  66817. value: function (e, t) {
  66818. console.error(
  66819. "THREE.Matrix4: .rotateByAxis() has been removed."
  66820. );
  66821. },
  66822. },
  66823. }),
  66824. Object.defineProperties(n.Plane.prototype, {
  66825. isIntersectionLine: {
  66826. value: function (e) {
  66827. return (
  66828. console.warn(
  66829. "THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."
  66830. ),
  66831. this.intersectsLine(e)
  66832. );
  66833. },
  66834. },
  66835. }),
  66836. Object.defineProperties(n.Quaternion.prototype, {
  66837. multiplyVector3: {
  66838. value: function (e) {
  66839. return (
  66840. console.warn(
  66841. "THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."
  66842. ),
  66843. e.applyQuaternion(this)
  66844. );
  66845. },
  66846. },
  66847. }),
  66848. Object.defineProperties(n.Ray.prototype, {
  66849. isIntersectionBox: {
  66850. value: function (e) {
  66851. return (
  66852. console.warn(
  66853. "THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."
  66854. ),
  66855. this.intersectsBox(e)
  66856. );
  66857. },
  66858. },
  66859. isIntersectionPlane: {
  66860. value: function (e) {
  66861. return (
  66862. console.warn(
  66863. "THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."
  66864. ),
  66865. this.intersectsPlane(e)
  66866. );
  66867. },
  66868. },
  66869. isIntersectionSphere: {
  66870. value: function (e) {
  66871. return (
  66872. console.warn(
  66873. "THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."
  66874. ),
  66875. this.intersectsSphere(e)
  66876. );
  66877. },
  66878. },
  66879. }),
  66880. Object.defineProperties(n.Vector3.prototype, {
  66881. setEulerFromRotationMatrix: {
  66882. value: function () {
  66883. console.error(
  66884. "THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead."
  66885. );
  66886. },
  66887. },
  66888. setEulerFromQuaternion: {
  66889. value: function () {
  66890. console.error(
  66891. "THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead."
  66892. );
  66893. },
  66894. },
  66895. getPositionFromMatrix: {
  66896. value: function (e) {
  66897. return (
  66898. console.warn(
  66899. "THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."
  66900. ),
  66901. this.setFromMatrixPosition(e)
  66902. );
  66903. },
  66904. },
  66905. getScaleFromMatrix: {
  66906. value: function (e) {
  66907. return (
  66908. console.warn(
  66909. "THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."
  66910. ),
  66911. this.setFromMatrixScale(e)
  66912. );
  66913. },
  66914. },
  66915. getColumnFromMatrix: {
  66916. value: function (e, t) {
  66917. return (
  66918. console.warn(
  66919. "THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."
  66920. ),
  66921. this.setFromMatrixColumn(e, t)
  66922. );
  66923. },
  66924. },
  66925. }),
  66926. (n.Face4 = function (e, t, i, r, o, a, s) {
  66927. return (
  66928. console.warn(
  66929. "THREE.Face4 has been removed. A THREE.Face3 will be created instead."
  66930. ),
  66931. new n.Face3(e, t, i, o, a, s)
  66932. );
  66933. }),
  66934. (n.Vertex = function (e, t, i) {
  66935. return (
  66936. console.warn(
  66937. "THREE.Vertex has been removed. Use THREE.Vector3 instead."
  66938. ),
  66939. new n.Vector3(e, t, i)
  66940. );
  66941. }),
  66942. Object.defineProperties(n.Object3D.prototype, {
  66943. eulerOrder: {
  66944. get: function () {
  66945. return (
  66946. console.warn(
  66947. "THREE.Object3D: .eulerOrder is now .rotation.order."
  66948. ),
  66949. this.rotation.order
  66950. );
  66951. },
  66952. set: function (e) {
  66953. console.warn(
  66954. "THREE.Object3D: .eulerOrder is now .rotation.order."
  66955. ),
  66956. (this.rotation.order = e);
  66957. },
  66958. },
  66959. getChildByName: {
  66960. value: function (e) {
  66961. return (
  66962. console.warn(
  66963. "THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."
  66964. ),
  66965. this.getObjectByName(e)
  66966. );
  66967. },
  66968. },
  66969. renderDepth: {
  66970. set: function (e) {
  66971. console.warn(
  66972. "THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead."
  66973. );
  66974. },
  66975. },
  66976. translate: {
  66977. value: function (e, t) {
  66978. return (
  66979. console.warn(
  66980. "THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."
  66981. ),
  66982. this.translateOnAxis(t, e)
  66983. );
  66984. },
  66985. },
  66986. useQuaternion: {
  66987. get: function () {
  66988. console.warn(
  66989. "THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default."
  66990. );
  66991. },
  66992. set: function (e) {
  66993. console.warn(
  66994. "THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default."
  66995. );
  66996. },
  66997. },
  66998. }),
  66999. Object.defineProperties(n, {
  67000. PointCloud: {
  67001. value: function (e, t) {
  67002. return (
  67003. console.warn(
  67004. "THREE.PointCloud has been renamed to THREE.Points."
  67005. ),
  67006. new n.Points(e, t)
  67007. );
  67008. },
  67009. },
  67010. ParticleSystem: {
  67011. value: function (e, t) {
  67012. return (
  67013. console.warn(
  67014. "THREE.ParticleSystem has been renamed to THREE.Points."
  67015. ),
  67016. new n.Points(e, t)
  67017. );
  67018. },
  67019. },
  67020. }),
  67021. Object.defineProperties(n.Light.prototype, {
  67022. onlyShadow: {
  67023. set: function (e) {
  67024. console.warn("THREE.Light: .onlyShadow has been removed.");
  67025. },
  67026. },
  67027. shadowCameraFov: {
  67028. set: function (e) {
  67029. console.warn(
  67030. "THREE.Light: .shadowCameraFov is now .shadow.camera.fov."
  67031. ),
  67032. (this.shadow.camera.fov = e);
  67033. },
  67034. },
  67035. shadowCameraLeft: {
  67036. set: function (e) {
  67037. console.warn(
  67038. "THREE.Light: .shadowCameraLeft is now .shadow.camera.left."
  67039. ),
  67040. (this.shadow.camera.left = e);
  67041. },
  67042. },
  67043. shadowCameraRight: {
  67044. set: function (e) {
  67045. console.warn(
  67046. "THREE.Light: .shadowCameraRight is now .shadow.camera.right."
  67047. ),
  67048. (this.shadow.camera.right = e);
  67049. },
  67050. },
  67051. shadowCameraTop: {
  67052. set: function (e) {
  67053. console.warn(
  67054. "THREE.Light: .shadowCameraTop is now .shadow.camera.top."
  67055. ),
  67056. (this.shadow.camera.top = e);
  67057. },
  67058. },
  67059. shadowCameraBottom: {
  67060. set: function (e) {
  67061. console.warn(
  67062. "THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."
  67063. ),
  67064. (this.shadow.camera.bottom = e);
  67065. },
  67066. },
  67067. shadowCameraNear: {
  67068. set: function (e) {
  67069. console.warn(
  67070. "THREE.Light: .shadowCameraNear is now .shadow.camera.near."
  67071. ),
  67072. (this.shadow.camera.near = e);
  67073. },
  67074. },
  67075. shadowCameraFar: {
  67076. set: function (e) {
  67077. console.warn(
  67078. "THREE.Light: .shadowCameraFar is now .shadow.camera.far."
  67079. ),
  67080. (this.shadow.camera.far = e);
  67081. },
  67082. },
  67083. shadowCameraVisible: {
  67084. set: function (e) {
  67085. console.warn(
  67086. "THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead."
  67087. );
  67088. },
  67089. },
  67090. shadowBias: {
  67091. set: function (e) {
  67092. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  67093. (this.shadow.bias = e);
  67094. },
  67095. },
  67096. shadowDarkness: {
  67097. set: function (e) {
  67098. console.warn("THREE.Light: .shadowDarkness has been removed.");
  67099. },
  67100. },
  67101. shadowMapWidth: {
  67102. set: function (e) {
  67103. console.warn(
  67104. "THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."
  67105. ),
  67106. (this.shadow.mapSize.width = e);
  67107. },
  67108. },
  67109. shadowMapHeight: {
  67110. set: function (e) {
  67111. console.warn(
  67112. "THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."
  67113. ),
  67114. (this.shadow.mapSize.height = e);
  67115. },
  67116. },
  67117. }),
  67118. Object.defineProperties(n.BufferAttribute.prototype, {
  67119. length: {
  67120. get: function () {
  67121. return (
  67122. console.warn(
  67123. "THREE.BufferAttribute: .length has been deprecated. Please use .count."
  67124. ),
  67125. this.array.length
  67126. );
  67127. },
  67128. },
  67129. }),
  67130. Object.defineProperties(n.BufferGeometry.prototype, {
  67131. drawcalls: {
  67132. get: function () {
  67133. return (
  67134. console.error(
  67135. "THREE.BufferGeometry: .drawcalls has been renamed to .groups."
  67136. ),
  67137. this.groups
  67138. );
  67139. },
  67140. },
  67141. offsets: {
  67142. get: function () {
  67143. return (
  67144. console.warn(
  67145. "THREE.BufferGeometry: .offsets has been renamed to .groups."
  67146. ),
  67147. this.groups
  67148. );
  67149. },
  67150. },
  67151. addIndex: {
  67152. value: function (e) {
  67153. console.warn(
  67154. "THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."
  67155. ),
  67156. this.setIndex(e);
  67157. },
  67158. },
  67159. addDrawCall: {
  67160. value: function (e, t, i) {
  67161. void 0 !== i &&
  67162. console.warn(
  67163. "THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."
  67164. ),
  67165. console.warn(
  67166. "THREE.BufferGeometry: .addDrawCall() is now .addGroup()."
  67167. ),
  67168. this.addGroup(e, t);
  67169. },
  67170. },
  67171. clearDrawCalls: {
  67172. value: function () {
  67173. console.warn(
  67174. "THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."
  67175. ),
  67176. this.clearGroups();
  67177. },
  67178. },
  67179. computeTangents: {
  67180. value: function () {
  67181. console.warn(
  67182. "THREE.BufferGeometry: .computeTangents() has been removed."
  67183. );
  67184. },
  67185. },
  67186. computeOffsets: {
  67187. value: function () {
  67188. console.warn(
  67189. "THREE.BufferGeometry: .computeOffsets() has been removed."
  67190. );
  67191. },
  67192. },
  67193. }),
  67194. Object.defineProperties(n.Material.prototype, {
  67195. wrapAround: {
  67196. get: function () {
  67197. console.warn(
  67198. "THREE." + this.type + ": .wrapAround has been removed."
  67199. );
  67200. },
  67201. set: function (e) {
  67202. console.warn(
  67203. "THREE." + this.type + ": .wrapAround has been removed."
  67204. );
  67205. },
  67206. },
  67207. wrapRGB: {
  67208. get: function () {
  67209. return (
  67210. console.warn(
  67211. "THREE." + this.type + ": .wrapRGB has been removed."
  67212. ),
  67213. new n.Color()
  67214. );
  67215. },
  67216. },
  67217. }),
  67218. Object.defineProperties(n, {
  67219. PointCloudMaterial: {
  67220. value: function (e) {
  67221. return (
  67222. console.warn(
  67223. "THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."
  67224. ),
  67225. new n.PointsMaterial(e)
  67226. );
  67227. },
  67228. },
  67229. ParticleBasicMaterial: {
  67230. value: function (e) {
  67231. return (
  67232. console.warn(
  67233. "THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."
  67234. ),
  67235. new n.PointsMaterial(e)
  67236. );
  67237. },
  67238. },
  67239. ParticleSystemMaterial: {
  67240. value: function (e) {
  67241. return (
  67242. console.warn(
  67243. "THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."
  67244. ),
  67245. new n.PointsMaterial(e)
  67246. );
  67247. },
  67248. },
  67249. }),
  67250. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  67251. metal: {
  67252. get: function () {
  67253. return (
  67254. console.warn(
  67255. "THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."
  67256. ),
  67257. !1
  67258. );
  67259. },
  67260. set: function (e) {
  67261. console.warn(
  67262. "THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead"
  67263. );
  67264. },
  67265. },
  67266. }),
  67267. Object.defineProperties(n.ShaderMaterial.prototype, {
  67268. derivatives: {
  67269. get: function () {
  67270. return (
  67271. console.warn(
  67272. "THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."
  67273. ),
  67274. this.extensions.derivatives
  67275. );
  67276. },
  67277. set: function (e) {
  67278. console.warn(
  67279. "THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."
  67280. ),
  67281. (this.extensions.derivatives = e);
  67282. },
  67283. },
  67284. }),
  67285. Object.defineProperties(n.WebGLRenderer.prototype, {
  67286. supportsFloatTextures: {
  67287. value: function () {
  67288. return (
  67289. console.warn(
  67290. "THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."
  67291. ),
  67292. this.extensions.get("OES_texture_float")
  67293. );
  67294. },
  67295. },
  67296. supportsHalfFloatTextures: {
  67297. value: function () {
  67298. return (
  67299. console.warn(
  67300. "THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."
  67301. ),
  67302. this.extensions.get("OES_texture_half_float")
  67303. );
  67304. },
  67305. },
  67306. supportsStandardDerivatives: {
  67307. value: function () {
  67308. return (
  67309. console.warn(
  67310. "THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."
  67311. ),
  67312. this.extensions.get("OES_standard_derivatives")
  67313. );
  67314. },
  67315. },
  67316. supportsCompressedTextureS3TC: {
  67317. value: function () {
  67318. return (
  67319. console.warn(
  67320. "THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."
  67321. ),
  67322. this.extensions.get("WEBGL_compressed_texture_s3tc")
  67323. );
  67324. },
  67325. },
  67326. supportsCompressedTexturePVRTC: {
  67327. value: function () {
  67328. return (
  67329. console.warn(
  67330. "THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."
  67331. ),
  67332. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  67333. );
  67334. },
  67335. },
  67336. supportsBlendMinMax: {
  67337. value: function () {
  67338. return (
  67339. console.warn(
  67340. "THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."
  67341. ),
  67342. this.extensions.get("EXT_blend_minmax")
  67343. );
  67344. },
  67345. },
  67346. supportsVertexTextures: {
  67347. value: function () {
  67348. return this.capabilities.vertexTextures;
  67349. },
  67350. },
  67351. supportsInstancedArrays: {
  67352. value: function () {
  67353. return (
  67354. console.warn(
  67355. "THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."
  67356. ),
  67357. this.extensions.get("ANGLE_instanced_arrays")
  67358. );
  67359. },
  67360. },
  67361. enableScissorTest: {
  67362. value: function (e) {
  67363. console.warn(
  67364. "THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."
  67365. ),
  67366. this.setScissorTest(e);
  67367. },
  67368. },
  67369. initMaterial: {
  67370. value: function () {
  67371. console.warn(
  67372. "THREE.WebGLRenderer: .initMaterial() has been removed."
  67373. );
  67374. },
  67375. },
  67376. addPrePlugin: {
  67377. value: function () {
  67378. console.warn(
  67379. "THREE.WebGLRenderer: .addPrePlugin() has been removed."
  67380. );
  67381. },
  67382. },
  67383. addPostPlugin: {
  67384. value: function () {
  67385. console.warn(
  67386. "THREE.WebGLRenderer: .addPostPlugin() has been removed."
  67387. );
  67388. },
  67389. },
  67390. updateShadowMap: {
  67391. value: function () {
  67392. console.warn(
  67393. "THREE.WebGLRenderer: .updateShadowMap() has been removed."
  67394. );
  67395. },
  67396. },
  67397. shadowMapEnabled: {
  67398. get: function () {
  67399. return this.shadowMap.enabled;
  67400. },
  67401. set: function (e) {
  67402. console.warn(
  67403. "THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."
  67404. ),
  67405. (this.shadowMap.enabled = e);
  67406. },
  67407. },
  67408. shadowMapType: {
  67409. get: function () {
  67410. return this.shadowMap.type;
  67411. },
  67412. set: function (e) {
  67413. console.warn(
  67414. "THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."
  67415. ),
  67416. (this.shadowMap.type = e);
  67417. },
  67418. },
  67419. shadowMapCullFace: {
  67420. get: function () {
  67421. return this.shadowMap.cullFace;
  67422. },
  67423. set: function (e) {
  67424. console.warn(
  67425. "THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."
  67426. ),
  67427. (this.shadowMap.cullFace = e);
  67428. },
  67429. },
  67430. }),
  67431. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  67432. wrapS: {
  67433. get: function () {
  67434. return (
  67435. console.warn(
  67436. "THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."
  67437. ),
  67438. this.texture.wrapS
  67439. );
  67440. },
  67441. set: function (e) {
  67442. console.warn(
  67443. "THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."
  67444. ),
  67445. (this.texture.wrapS = e);
  67446. },
  67447. },
  67448. wrapT: {
  67449. get: function () {
  67450. return (
  67451. console.warn(
  67452. "THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."
  67453. ),
  67454. this.texture.wrapT
  67455. );
  67456. },
  67457. set: function (e) {
  67458. console.warn(
  67459. "THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."
  67460. ),
  67461. (this.texture.wrapT = e);
  67462. },
  67463. },
  67464. magFilter: {
  67465. get: function () {
  67466. return (
  67467. console.warn(
  67468. "THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."
  67469. ),
  67470. this.texture.magFilter
  67471. );
  67472. },
  67473. set: function (e) {
  67474. console.warn(
  67475. "THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."
  67476. ),
  67477. (this.texture.magFilter = e);
  67478. },
  67479. },
  67480. minFilter: {
  67481. get: function () {
  67482. return (
  67483. console.warn(
  67484. "THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."
  67485. ),
  67486. this.texture.minFilter
  67487. );
  67488. },
  67489. set: function (e) {
  67490. console.warn(
  67491. "THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."
  67492. ),
  67493. (this.texture.minFilter = e);
  67494. },
  67495. },
  67496. anisotropy: {
  67497. get: function () {
  67498. return (
  67499. console.warn(
  67500. "THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."
  67501. ),
  67502. this.texture.anisotropy
  67503. );
  67504. },
  67505. set: function (e) {
  67506. console.warn(
  67507. "THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."
  67508. ),
  67509. (this.texture.anisotropy = e);
  67510. },
  67511. },
  67512. offset: {
  67513. get: function () {
  67514. return (
  67515. console.warn(
  67516. "THREE.WebGLRenderTarget: .offset is now .texture.offset."
  67517. ),
  67518. this.texture.offset
  67519. );
  67520. },
  67521. set: function (e) {
  67522. console.warn(
  67523. "THREE.WebGLRenderTarget: .offset is now .texture.offset."
  67524. ),
  67525. (this.texture.offset = e);
  67526. },
  67527. },
  67528. repeat: {
  67529. get: function () {
  67530. return (
  67531. console.warn(
  67532. "THREE.WebGLRenderTarget: .repeat is now .texture.repeat."
  67533. ),
  67534. this.texture.repeat
  67535. );
  67536. },
  67537. set: function (e) {
  67538. console.warn(
  67539. "THREE.WebGLRenderTarget: .repeat is now .texture.repeat."
  67540. ),
  67541. (this.texture.repeat = e);
  67542. },
  67543. },
  67544. format: {
  67545. get: function () {
  67546. return (
  67547. console.warn(
  67548. "THREE.WebGLRenderTarget: .format is now .texture.format."
  67549. ),
  67550. this.texture.format
  67551. );
  67552. },
  67553. set: function (e) {
  67554. console.warn(
  67555. "THREE.WebGLRenderTarget: .format is now .texture.format."
  67556. ),
  67557. (this.texture.format = e);
  67558. },
  67559. },
  67560. type: {
  67561. get: function () {
  67562. return (
  67563. console.warn(
  67564. "THREE.WebGLRenderTarget: .type is now .texture.type."
  67565. ),
  67566. this.texture.type
  67567. );
  67568. },
  67569. set: function (e) {
  67570. console.warn(
  67571. "THREE.WebGLRenderTarget: .type is now .texture.type."
  67572. ),
  67573. (this.texture.type = e);
  67574. },
  67575. },
  67576. generateMipmaps: {
  67577. get: function () {
  67578. return (
  67579. console.warn(
  67580. "THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."
  67581. ),
  67582. this.texture.generateMipmaps
  67583. );
  67584. },
  67585. set: function (e) {
  67586. console.warn(
  67587. "THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."
  67588. ),
  67589. (this.texture.generateMipmaps = e);
  67590. },
  67591. },
  67592. }),
  67593. (n.GeometryUtils = {
  67594. merge: function (e, t, i) {
  67595. console.warn(
  67596. "THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."
  67597. );
  67598. var r;
  67599. t instanceof n.Mesh &&
  67600. (t.matrixAutoUpdate && t.updateMatrix(),
  67601. (r = t.matrix),
  67602. (t = t.geometry)),
  67603. e.merge(t, r, i);
  67604. },
  67605. center: function (e) {
  67606. return (
  67607. console.warn(
  67608. "THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."
  67609. ),
  67610. e.center()
  67611. );
  67612. },
  67613. }),
  67614. (n.ImageUtils = {
  67615. crossOrigin: void 0,
  67616. loadTexture: function (e, t, i, r) {
  67617. console.warn(
  67618. "THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead."
  67619. );
  67620. var o = new n.TextureLoader();
  67621. o.setCrossOrigin(this.crossOrigin);
  67622. var a = o.load(e, i, void 0, r);
  67623. return t && (a.mapping = t), a;
  67624. },
  67625. loadTextureCube: function (e, t, i, r) {
  67626. console.warn(
  67627. "THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead."
  67628. );
  67629. var o = new n.CubeTextureLoader();
  67630. o.setCrossOrigin(this.crossOrigin);
  67631. var a = o.load(e, i, void 0, r);
  67632. return t && (a.mapping = t), a;
  67633. },
  67634. loadCompressedTexture: function () {
  67635. console.error(
  67636. "THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead."
  67637. );
  67638. },
  67639. loadCompressedTextureCube: function () {
  67640. console.error(
  67641. "THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead."
  67642. );
  67643. },
  67644. }),
  67645. (n.Projector = function () {
  67646. console.error(
  67647. "THREE.Projector has been moved to /examples/js/renderers/Projector.js."
  67648. ),
  67649. (this.projectVector = function (e, t) {
  67650. console.warn(
  67651. "THREE.Projector: .projectVector() is now vector.project()."
  67652. ),
  67653. e.project(t);
  67654. }),
  67655. (this.unprojectVector = function (e, t) {
  67656. console.warn(
  67657. "THREE.Projector: .unprojectVector() is now vector.unproject()."
  67658. ),
  67659. e.unproject(t);
  67660. }),
  67661. (this.pickingRay = function (e, t) {
  67662. console.error(
  67663. "THREE.Projector: .pickingRay() is now raycaster.setFromCamera()."
  67664. );
  67665. });
  67666. }),
  67667. (n.CanvasRenderer = function () {
  67668. console.error(
  67669. "THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"
  67670. ),
  67671. (this.domElement = document.createElement("canvas")),
  67672. (this.clear = function () {}),
  67673. (this.render = function () {}),
  67674. (this.setClearColor = function () {}),
  67675. (this.setSize = function () {});
  67676. }),
  67677. (n.MeshFaceMaterial = n.MultiMaterial),
  67678. (n.CurveUtils = {
  67679. tangentQuadraticBezier: function (e, t, i, n) {
  67680. return 2 * (1 - e) * (i - t) + 2 * e * (n - i);
  67681. },
  67682. tangentCubicBezier: function (e, t, i, n, r) {
  67683. return (
  67684. -3 * t * (1 - e) * (1 - e) +
  67685. 3 * i * (1 - e) * (1 - e) -
  67686. 6 * e * i * (1 - e) +
  67687. 6 * e * n * (1 - e) -
  67688. 3 * e * e * n +
  67689. 3 * e * e * r
  67690. );
  67691. },
  67692. tangentSpline: function (e, t, i, n, r) {
  67693. var o = 6 * e * e - 6 * e,
  67694. a = 3 * e * e - 4 * e + 1,
  67695. s = -6 * e * e + 6 * e,
  67696. l = 3 * e * e - 2 * e;
  67697. return o + a + s + l;
  67698. },
  67699. interpolate: function (e, t, i, n, r) {
  67700. var o = 0.5 * (i - e),
  67701. a = 0.5 * (n - t),
  67702. s = r * r,
  67703. l = r * s;
  67704. return (
  67705. (2 * t - 2 * i + o + a) * l +
  67706. (-3 * t + 3 * i - 2 * o - a) * s +
  67707. o * r +
  67708. t
  67709. );
  67710. },
  67711. }),
  67712. (n.SceneUtils = {
  67713. createMultiMaterialObject: function (e, t) {
  67714. for (var i = new n.Group(), r = 0, o = t.length; r < o; r++)
  67715. i.add(new n.Mesh(e, t[r]));
  67716. return i;
  67717. },
  67718. detach: function (e, t, i) {
  67719. e.applyMatrix(t.matrixWorld), t.remove(e), i.add(e);
  67720. },
  67721. attach: function (e, t, i) {
  67722. var r = new n.Matrix4();
  67723. r.getInverse(i.matrixWorld),
  67724. e.applyMatrix(r),
  67725. t.remove(e),
  67726. i.add(e);
  67727. },
  67728. }),
  67729. (n.ShapeUtils = {
  67730. area: function (e) {
  67731. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  67732. i += e[n].x * e[r].y - e[r].x * e[n].y;
  67733. return 0.5 * i;
  67734. },
  67735. triangulate: (function () {
  67736. function e(e, t, i, n, r, o) {
  67737. var a, s, l, c, h, u, d, p, f;
  67738. if (
  67739. ((s = e[o[t]].x),
  67740. (l = e[o[t]].y),
  67741. (c = e[o[i]].x),
  67742. (h = e[o[i]].y),
  67743. (u = e[o[n]].x),
  67744. (d = e[o[n]].y),
  67745. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  67746. )
  67747. return !1;
  67748. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  67749. for (
  67750. g = u - c,
  67751. m = d - h,
  67752. v = s - u,
  67753. A = l - d,
  67754. y = c - s,
  67755. C = h - l,
  67756. a = 0;
  67757. a < r;
  67758. a++
  67759. )
  67760. if (
  67761. ((p = e[o[a]].x),
  67762. (f = e[o[a]].y),
  67763. !(
  67764. (p === s && f === l) ||
  67765. (p === c && f === h) ||
  67766. (p === u && f === d)
  67767. ) &&
  67768. ((I = p - s),
  67769. (E = f - l),
  67770. (b = p - c),
  67771. (w = f - h),
  67772. (_ = p - u),
  67773. (T = f - d),
  67774. (M = g * w - m * b),
  67775. (x = y * E - C * I),
  67776. (S = v * T - A * _),
  67777. M >= -Number.EPSILON &&
  67778. S >= -Number.EPSILON &&
  67779. x >= -Number.EPSILON))
  67780. )
  67781. return !1;
  67782. return !0;
  67783. }
  67784. return function (t, i) {
  67785. var r = t.length;
  67786. if (r < 3) return null;
  67787. var o,
  67788. a,
  67789. s,
  67790. l = [],
  67791. c = [],
  67792. h = [];
  67793. if (n.ShapeUtils.area(t) > 0) for (a = 0; a < r; a++) c[a] = a;
  67794. else for (a = 0; a < r; a++) c[a] = r - 1 - a;
  67795. var u = r,
  67796. d = 2 * u;
  67797. for (a = u - 1; u > 2; ) {
  67798. if (d-- <= 0)
  67799. return (
  67800. console.warn(
  67801. "THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"
  67802. ),
  67803. i ? h : l
  67804. );
  67805. if (
  67806. ((o = a),
  67807. u <= o && (o = 0),
  67808. (a = o + 1),
  67809. u <= a && (a = 0),
  67810. (s = a + 1),
  67811. u <= s && (s = 0),
  67812. e(t, o, a, s, u, c))
  67813. ) {
  67814. var p, f, g, m, v;
  67815. for (
  67816. p = c[o],
  67817. f = c[a],
  67818. g = c[s],
  67819. l.push([t[p], t[f], t[g]]),
  67820. h.push([c[o], c[a], c[s]]),
  67821. m = a,
  67822. v = a + 1;
  67823. v < u;
  67824. m++, v++
  67825. )
  67826. c[m] = c[v];
  67827. u--, (d = 2 * u);
  67828. }
  67829. }
  67830. return i ? h : l;
  67831. };
  67832. })(),
  67833. triangulateShape: function (e, t) {
  67834. function i(e, t, i) {
  67835. return e.x !== t.x
  67836. ? e.x < t.x
  67837. ? e.x <= i.x && i.x <= t.x
  67838. : t.x <= i.x && i.x <= e.x
  67839. : e.y < t.y
  67840. ? e.y <= i.y && i.y <= t.y
  67841. : t.y <= i.y && i.y <= e.y;
  67842. }
  67843. function r(e, t, n, r, o) {
  67844. var a = t.x - e.x,
  67845. s = t.y - e.y,
  67846. l = r.x - n.x,
  67847. c = r.y - n.y,
  67848. h = e.x - n.x,
  67849. u = e.y - n.y,
  67850. d = s * l - a * c,
  67851. p = s * h - a * u;
  67852. if (Math.abs(d) > Number.EPSILON) {
  67853. var f;
  67854. if (d > 0) {
  67855. if (p < 0 || p > d) return [];
  67856. if (((f = c * h - l * u), f < 0 || f > d)) return [];
  67857. } else {
  67858. if (p > 0 || p < d) return [];
  67859. if (((f = c * h - l * u), f > 0 || f < d)) return [];
  67860. }
  67861. if (0 === f) return !o || (0 !== p && p !== d) ? [e] : [];
  67862. if (f === d) return !o || (0 !== p && p !== d) ? [t] : [];
  67863. if (0 === p) return [n];
  67864. if (p === d) return [r];
  67865. var g = f / d;
  67866. return [
  67867. {
  67868. x: e.x + g * a,
  67869. y: e.y + g * s,
  67870. },
  67871. ];
  67872. }
  67873. if (0 !== p || c * h !== l * u) return [];
  67874. var m = 0 === a && 0 === s,
  67875. v = 0 === l && 0 === c;
  67876. if (m && v) return e.x !== n.x || e.y !== n.y ? [] : [e];
  67877. if (m) return i(n, r, e) ? [e] : [];
  67878. if (v) return i(e, t, n) ? [n] : [];
  67879. var A, y, C, I, E, b, w, _;
  67880. return (
  67881. 0 !== a
  67882. ? (e.x < t.x
  67883. ? ((A = e), (C = e.x), (y = t), (I = t.x))
  67884. : ((A = t), (C = t.x), (y = e), (I = e.x)),
  67885. n.x < r.x
  67886. ? ((E = n), (w = n.x), (b = r), (_ = r.x))
  67887. : ((E = r), (w = r.x), (b = n), (_ = n.x)))
  67888. : (e.y < t.y
  67889. ? ((A = e), (C = e.y), (y = t), (I = t.y))
  67890. : ((A = t), (C = t.y), (y = e), (I = e.y)),
  67891. n.y < r.y
  67892. ? ((E = n), (w = n.y), (b = r), (_ = r.y))
  67893. : ((E = r), (w = r.y), (b = n), (_ = n.y))),
  67894. C <= w
  67895. ? I < w
  67896. ? []
  67897. : I === w
  67898. ? o
  67899. ? []
  67900. : [E]
  67901. : I <= _
  67902. ? [E, y]
  67903. : [E, b]
  67904. : C > _
  67905. ? []
  67906. : C === _
  67907. ? o
  67908. ? []
  67909. : [A]
  67910. : I <= _
  67911. ? [A, y]
  67912. : [A, b]
  67913. );
  67914. }
  67915. function o(e, t, i, n) {
  67916. var r = t.x - e.x,
  67917. o = t.y - e.y,
  67918. a = i.x - e.x,
  67919. s = i.y - e.y,
  67920. l = n.x - e.x,
  67921. c = n.y - e.y,
  67922. h = r * s - o * a,
  67923. u = r * c - o * l;
  67924. if (Math.abs(h) > Number.EPSILON) {
  67925. var d = l * s - c * a;
  67926. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0;
  67927. }
  67928. return u > 0;
  67929. }
  67930. function a(e, t) {
  67931. function i(e, t) {
  67932. var i = A.length - 1,
  67933. n = e - 1;
  67934. n < 0 && (n = i);
  67935. var r = e + 1;
  67936. r > i && (r = 0);
  67937. var a = o(A[e], A[n], A[r], s[t]);
  67938. if (!a) return !1;
  67939. var l = s.length - 1,
  67940. c = t - 1;
  67941. c < 0 && (c = l);
  67942. var h = t + 1;
  67943. return h > l && (h = 0), (a = o(s[t], s[c], s[h], A[e])), !!a;
  67944. }
  67945. function n(e, t) {
  67946. var i, n, o;
  67947. for (i = 0; i < A.length; i++)
  67948. if (
  67949. ((n = i + 1),
  67950. (n %= A.length),
  67951. (o = r(e, t, A[i], A[n], !0)),
  67952. o.length > 0)
  67953. )
  67954. return !0;
  67955. return !1;
  67956. }
  67957. function a(e, i) {
  67958. var n, o, a, s, l;
  67959. for (n = 0; n < y.length; n++)
  67960. for (o = t[y[n]], a = 0; a < o.length; a++)
  67961. if (
  67962. ((s = a + 1),
  67963. (s %= o.length),
  67964. (l = r(e, i, o[a], o[s], !0)),
  67965. l.length > 0)
  67966. )
  67967. return !0;
  67968. return !1;
  67969. }
  67970. for (
  67971. var s,
  67972. l,
  67973. c,
  67974. h,
  67975. u,
  67976. d,
  67977. p,
  67978. f,
  67979. g,
  67980. m,
  67981. v,
  67982. A = e.concat(),
  67983. y = [],
  67984. C = [],
  67985. I = 0,
  67986. E = t.length;
  67987. I < E;
  67988. I++
  67989. )
  67990. y.push(I);
  67991. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  67992. if ((w--, w < 0)) {
  67993. console.log(
  67994. "Infinite Loop! Holes left:" +
  67995. y.length +
  67996. ", Probably Hole outside Shape!"
  67997. );
  67998. break;
  67999. }
  68000. for (c = b; c < A.length; c++) {
  68001. (h = A[c]), (l = -1);
  68002. for (var I = 0; I < y.length; I++)
  68003. if (
  68004. ((d = y[I]),
  68005. (p = h.x + ":" + h.y + ":" + d),
  68006. void 0 === C[p])
  68007. ) {
  68008. s = t[d];
  68009. for (var _ = 0; _ < s.length; _++)
  68010. if (((u = s[_]), i(c, _) && !n(h, u) && !a(h, u))) {
  68011. (l = _),
  68012. y.splice(I, 1),
  68013. (f = A.slice(0, c + 1)),
  68014. (g = A.slice(c)),
  68015. (m = s.slice(l)),
  68016. (v = s.slice(0, l + 1)),
  68017. (A = f.concat(m).concat(v).concat(g)),
  68018. (b = c);
  68019. break;
  68020. }
  68021. if (l >= 0) break;
  68022. C[p] = !0;
  68023. }
  68024. if (l >= 0) break;
  68025. }
  68026. }
  68027. return A;
  68028. }
  68029. for (
  68030. var s,
  68031. l,
  68032. c,
  68033. h,
  68034. u,
  68035. d,
  68036. p = {},
  68037. f = e.concat(),
  68038. g = 0,
  68039. m = t.length;
  68040. g < m;
  68041. g++
  68042. )
  68043. Array.prototype.push.apply(f, t[g]);
  68044. for (s = 0, l = f.length; s < l; s++)
  68045. (u = f[s].x + ":" + f[s].y),
  68046. void 0 !== p[u] &&
  68047. console.warn("THREE.Shape: Duplicate point", u),
  68048. (p[u] = s);
  68049. var v = a(e, t),
  68050. A = n.ShapeUtils.triangulate(v, !1);
  68051. for (s = 0, l = A.length; s < l; s++)
  68052. for (h = A[s], c = 0; c < 3; c++)
  68053. (u = h[c].x + ":" + h[c].y),
  68054. (d = p[u]),
  68055. void 0 !== d && (h[c] = d);
  68056. return A.concat();
  68057. },
  68058. isClockWise: function (e) {
  68059. return n.ShapeUtils.area(e) < 0;
  68060. },
  68061. b2: (function () {
  68062. function e(e, t) {
  68063. var i = 1 - e;
  68064. return i * i * t;
  68065. }
  68066. function t(e, t) {
  68067. return 2 * (1 - e) * e * t;
  68068. }
  68069. function i(e, t) {
  68070. return e * e * t;
  68071. }
  68072. return function (n, r, o, a) {
  68073. return e(n, r) + t(n, o) + i(n, a);
  68074. };
  68075. })(),
  68076. b3: (function () {
  68077. function e(e, t) {
  68078. var i = 1 - e;
  68079. return i * i * i * t;
  68080. }
  68081. function t(e, t) {
  68082. var i = 1 - e;
  68083. return 3 * i * i * e * t;
  68084. }
  68085. function i(e, t) {
  68086. var i = 1 - e;
  68087. return 3 * i * e * e * t;
  68088. }
  68089. function n(e, t) {
  68090. return e * e * e * t;
  68091. }
  68092. return function (r, o, a, s, l) {
  68093. return e(r, o) + t(r, a) + i(r, s) + n(r, l);
  68094. };
  68095. })(),
  68096. }),
  68097. (n.Curve = function () {}),
  68098. (n.Curve.prototype = {
  68099. constructor: n.Curve,
  68100. getPoint: function (e) {
  68101. return (
  68102. console.warn(
  68103. "THREE.Curve: Warning, getPoint() not implemented!"
  68104. ),
  68105. null
  68106. );
  68107. },
  68108. getPointAt: function (e) {
  68109. var t = this.getUtoTmapping(e);
  68110. return this.getPoint(t);
  68111. },
  68112. getPoints: function (e) {
  68113. e || (e = 5);
  68114. var t,
  68115. i = [];
  68116. for (t = 0; t <= e; t++) i.push(this.getPoint(t / e));
  68117. return i;
  68118. },
  68119. getSpacedPoints: function (e) {
  68120. e || (e = 5);
  68121. var t,
  68122. i = [];
  68123. for (t = 0; t <= e; t++) i.push(this.getPointAt(t / e));
  68124. return i;
  68125. },
  68126. getLength: function () {
  68127. var e = this.getLengths();
  68128. return e[e.length - 1];
  68129. },
  68130. getLengths: function (e) {
  68131. if (
  68132. (e ||
  68133. (e = this.__arcLengthDivisions
  68134. ? this.__arcLengthDivisions
  68135. : 200),
  68136. this.cacheArcLengths &&
  68137. this.cacheArcLengths.length === e + 1 &&
  68138. !this.needsUpdate)
  68139. )
  68140. return this.cacheArcLengths;
  68141. this.needsUpdate = !1;
  68142. var t,
  68143. i,
  68144. n = [],
  68145. r = this.getPoint(0),
  68146. o = 0;
  68147. for (n.push(0), i = 1; i <= e; i++)
  68148. (t = this.getPoint(i / e)),
  68149. (o += t.distanceTo(r)),
  68150. n.push(o),
  68151. (r = t);
  68152. return (this.cacheArcLengths = n), n;
  68153. },
  68154. updateArcLengths: function () {
  68155. (this.needsUpdate = !0), this.getLengths();
  68156. },
  68157. getUtoTmapping: function (e, t) {
  68158. var i,
  68159. n = this.getLengths(),
  68160. r = 0,
  68161. o = n.length;
  68162. i = t ? t : e * n[o - 1];
  68163. for (var a, s = 0, l = o - 1; s <= l; )
  68164. if (((r = Math.floor(s + (l - s) / 2)), (a = n[r] - i), a < 0))
  68165. s = r + 1;
  68166. else {
  68167. if (!(a > 0)) {
  68168. l = r;
  68169. break;
  68170. }
  68171. l = r - 1;
  68172. }
  68173. if (((r = l), n[r] === i)) {
  68174. var c = r / (o - 1);
  68175. return c;
  68176. }
  68177. var h = n[r],
  68178. u = n[r + 1],
  68179. d = u - h,
  68180. p = (i - h) / d,
  68181. c = (r + p) / (o - 1);
  68182. return c;
  68183. },
  68184. getTangent: function (e) {
  68185. var t = 1e-4,
  68186. i = e - t,
  68187. n = e + t;
  68188. i < 0 && (i = 0), n > 1 && (n = 1);
  68189. var r = this.getPoint(i),
  68190. o = this.getPoint(n),
  68191. a = o.clone().sub(r);
  68192. return a.normalize();
  68193. },
  68194. getTangentAt: function (e) {
  68195. var t = this.getUtoTmapping(e);
  68196. return this.getTangent(t);
  68197. },
  68198. }),
  68199. (n.Curve.create = function (e, t) {
  68200. return (
  68201. (e.prototype = Object.create(n.Curve.prototype)),
  68202. (e.prototype.constructor = e),
  68203. (e.prototype.getPoint = t),
  68204. e
  68205. );
  68206. }),
  68207. (n.CurvePath = function () {
  68208. (this.curves = []), (this.autoClose = !1);
  68209. }),
  68210. (n.CurvePath.prototype = Object.create(n.Curve.prototype)),
  68211. (n.CurvePath.prototype.constructor = n.CurvePath),
  68212. (n.CurvePath.prototype.add = function (e) {
  68213. this.curves.push(e);
  68214. }),
  68215. (n.CurvePath.prototype.closePath = function () {
  68216. var e = this.curves[0].getPoint(0),
  68217. t = this.curves[this.curves.length - 1].getPoint(1);
  68218. e.equals(t) || this.curves.push(new n.LineCurve(t, e));
  68219. }),
  68220. (n.CurvePath.prototype.getPoint = function (e) {
  68221. for (
  68222. var t = e * this.getLength(), i = this.getCurveLengths(), n = 0;
  68223. n < i.length;
  68224. ) {
  68225. if (i[n] >= t) {
  68226. var r = i[n] - t,
  68227. o = this.curves[n],
  68228. a = 1 - r / o.getLength();
  68229. return o.getPointAt(a);
  68230. }
  68231. n++;
  68232. }
  68233. return null;
  68234. }),
  68235. (n.CurvePath.prototype.getLength = function () {
  68236. var e = this.getCurveLengths();
  68237. return e[e.length - 1];
  68238. }),
  68239. (n.CurvePath.prototype.getCurveLengths = function () {
  68240. if (
  68241. this.cacheLengths &&
  68242. this.cacheLengths.length === this.curves.length
  68243. )
  68244. return this.cacheLengths;
  68245. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  68246. (t += this.curves[i].getLength()), e.push(t);
  68247. return (this.cacheLengths = e), e;
  68248. }),
  68249. (n.CurvePath.prototype.createPointsGeometry = function (e) {
  68250. var t = this.getPoints(e);
  68251. return this.createGeometry(t);
  68252. }),
  68253. (n.CurvePath.prototype.createSpacedPointsGeometry = function (e) {
  68254. var t = this.getSpacedPoints(e);
  68255. return this.createGeometry(t);
  68256. }),
  68257. (n.CurvePath.prototype.createGeometry = function (e) {
  68258. for (var t = new n.Geometry(), i = 0, r = e.length; i < r; i++) {
  68259. var o = e[i];
  68260. t.vertices.push(new n.Vector3(o.x, o.y, o.z || 0));
  68261. }
  68262. return t;
  68263. }),
  68264. (n.Font = function (e) {
  68265. this.data = e;
  68266. }),
  68267. (n.Font.prototype = {
  68268. constructor: n.Font,
  68269. generateShapes: function (e, t, i) {
  68270. function r(e) {
  68271. for (
  68272. var i = String(e).split(""),
  68273. n = t / a.resolution,
  68274. r = 0,
  68275. s = [],
  68276. l = 0;
  68277. l < i.length;
  68278. l++
  68279. ) {
  68280. var c = o(i[l], n, r);
  68281. (r += c.offset), s.push(c.path);
  68282. }
  68283. return s;
  68284. }
  68285. function o(e, t, r) {
  68286. var o = a.glyphs[e] || a.glyphs["?"];
  68287. if (o) {
  68288. var s,
  68289. l,
  68290. c,
  68291. h,
  68292. u,
  68293. d,
  68294. p,
  68295. f,
  68296. g,
  68297. m,
  68298. v,
  68299. A = new n.Path(),
  68300. y = [],
  68301. C = n.ShapeUtils.b2,
  68302. I = n.ShapeUtils.b3;
  68303. if (o.o)
  68304. for (
  68305. var E =
  68306. o._cachedOutline ||
  68307. (o._cachedOutline = o.o.split(" ")),
  68308. b = 0,
  68309. w = E.length;
  68310. b < w;
  68311. ) {
  68312. var _ = E[b++];
  68313. switch (_) {
  68314. case "m":
  68315. (s = E[b++] * t + r),
  68316. (l = E[b++] * t),
  68317. A.moveTo(s, l);
  68318. break;
  68319. case "l":
  68320. (s = E[b++] * t + r),
  68321. (l = E[b++] * t),
  68322. A.lineTo(s, l);
  68323. break;
  68324. case "q":
  68325. if (
  68326. ((c = E[b++] * t + r),
  68327. (h = E[b++] * t),
  68328. (p = E[b++] * t + r),
  68329. (f = E[b++] * t),
  68330. A.quadraticCurveTo(p, f, c, h),
  68331. (v = y[y.length - 1]))
  68332. ) {
  68333. (u = v.x), (d = v.y);
  68334. for (var T = 1; T <= i; T++) {
  68335. var x = T / i;
  68336. C(x, u, p, c), C(x, d, f, h);
  68337. }
  68338. }
  68339. break;
  68340. case "b":
  68341. if (
  68342. ((c = E[b++] * t + r),
  68343. (h = E[b++] * t),
  68344. (p = E[b++] * t + r),
  68345. (f = E[b++] * t),
  68346. (g = E[b++] * t + r),
  68347. (m = E[b++] * t),
  68348. A.bezierCurveTo(p, f, g, m, c, h),
  68349. (v = y[y.length - 1]))
  68350. ) {
  68351. (u = v.x), (d = v.y);
  68352. for (var T = 1; T <= i; T++) {
  68353. var x = T / i;
  68354. I(x, u, p, g, c), I(x, d, f, m, h);
  68355. }
  68356. }
  68357. }
  68358. }
  68359. return {
  68360. offset: o.ha * t,
  68361. path: A,
  68362. };
  68363. }
  68364. }
  68365. void 0 === t && (t = 100), void 0 === i && (i = 4);
  68366. for (
  68367. var a = this.data, s = r(e), l = [], c = 0, h = s.length;
  68368. c < h;
  68369. c++
  68370. )
  68371. Array.prototype.push.apply(l, s[c].toShapes());
  68372. return l;
  68373. },
  68374. }),
  68375. (n.Path = function (e) {
  68376. n.CurvePath.call(this),
  68377. (this.actions = []),
  68378. e && this.fromPoints(e);
  68379. }),
  68380. (n.Path.prototype = Object.create(n.CurvePath.prototype)),
  68381. (n.Path.prototype.constructor = n.Path),
  68382. (n.Path.prototype.fromPoints = function (e) {
  68383. this.moveTo(e[0].x, e[0].y);
  68384. for (var t = 1, i = e.length; t < i; t++)
  68385. this.lineTo(e[t].x, e[t].y);
  68386. }),
  68387. (n.Path.prototype.moveTo = function (e, t) {
  68388. this.actions.push({
  68389. action: "moveTo",
  68390. args: [e, t],
  68391. });
  68392. }),
  68393. (n.Path.prototype.lineTo = function (e, t) {
  68394. var i = this.actions[this.actions.length - 1].args,
  68395. r = i[i.length - 2],
  68396. o = i[i.length - 1],
  68397. a = new n.LineCurve(new n.Vector2(r, o), new n.Vector2(e, t));
  68398. this.curves.push(a),
  68399. this.actions.push({
  68400. action: "lineTo",
  68401. args: [e, t],
  68402. });
  68403. }),
  68404. (n.Path.prototype.quadraticCurveTo = function (e, t, i, r) {
  68405. var o = this.actions[this.actions.length - 1].args,
  68406. a = o[o.length - 2],
  68407. s = o[o.length - 1],
  68408. l = new n.QuadraticBezierCurve(
  68409. new n.Vector2(a, s),
  68410. new n.Vector2(e, t),
  68411. new n.Vector2(i, r)
  68412. );
  68413. this.curves.push(l),
  68414. this.actions.push({
  68415. action: "quadraticCurveTo",
  68416. args: [e, t, i, r],
  68417. });
  68418. }),
  68419. (n.Path.prototype.bezierCurveTo = function (e, t, i, r, o, a) {
  68420. var s = this.actions[this.actions.length - 1].args,
  68421. l = s[s.length - 2],
  68422. c = s[s.length - 1],
  68423. h = new n.CubicBezierCurve(
  68424. new n.Vector2(l, c),
  68425. new n.Vector2(e, t),
  68426. new n.Vector2(i, r),
  68427. new n.Vector2(o, a)
  68428. );
  68429. this.curves.push(h),
  68430. this.actions.push({
  68431. action: "bezierCurveTo",
  68432. args: [e, t, i, r, o, a],
  68433. });
  68434. }),
  68435. (n.Path.prototype.splineThru = function (e) {
  68436. var t = Array.prototype.slice.call(arguments),
  68437. i = this.actions[this.actions.length - 1].args,
  68438. r = i[i.length - 2],
  68439. o = i[i.length - 1],
  68440. a = [new n.Vector2(r, o)];
  68441. Array.prototype.push.apply(a, e);
  68442. var s = new n.SplineCurve(a);
  68443. this.curves.push(s),
  68444. this.actions.push({
  68445. action: "splineThru",
  68446. args: t,
  68447. });
  68448. }),
  68449. (n.Path.prototype.arc = function (e, t, i, n, r, o) {
  68450. var a = this.actions[this.actions.length - 1].args,
  68451. s = a[a.length - 2],
  68452. l = a[a.length - 1];
  68453. this.absarc(e + s, t + l, i, n, r, o);
  68454. }),
  68455. (n.Path.prototype.absarc = function (e, t, i, n, r, o) {
  68456. this.absellipse(e, t, i, i, n, r, o);
  68457. }),
  68458. (n.Path.prototype.ellipse = function (e, t, i, n, r, o, a, s) {
  68459. var l = this.actions[this.actions.length - 1].args,
  68460. c = l[l.length - 2],
  68461. h = l[l.length - 1];
  68462. this.absellipse(e + c, t + h, i, n, r, o, a, s);
  68463. }),
  68464. (n.Path.prototype.absellipse = function (e, t, i, r, o, a, s, l) {
  68465. var c = [e, t, i, r, o, a, s, l || 0],
  68466. h = new n.EllipseCurve(e, t, i, r, o, a, s, l);
  68467. this.curves.push(h);
  68468. var u = h.getPoint(1);
  68469. c.push(u.x),
  68470. c.push(u.y),
  68471. this.actions.push({
  68472. action: "ellipse",
  68473. args: c,
  68474. });
  68475. }),
  68476. (n.Path.prototype.getSpacedPoints = function (e) {
  68477. e || (e = 40);
  68478. for (var t = [], i = 0; i < e; i++) t.push(this.getPoint(i / e));
  68479. return this.autoClose && t.push(t[0]), t;
  68480. }),
  68481. (n.Path.prototype.getPoints = function (e) {
  68482. e = e || 12;
  68483. for (
  68484. var t,
  68485. i,
  68486. r,
  68487. o,
  68488. a,
  68489. s,
  68490. l,
  68491. c,
  68492. h,
  68493. u,
  68494. d,
  68495. p = n.ShapeUtils.b2,
  68496. f = n.ShapeUtils.b3,
  68497. g = [],
  68498. m = 0,
  68499. v = this.actions.length;
  68500. m < v;
  68501. m++
  68502. ) {
  68503. var A = this.actions[m],
  68504. y = A.action,
  68505. C = A.args;
  68506. switch (y) {
  68507. case "moveTo":
  68508. g.push(new n.Vector2(C[0], C[1]));
  68509. break;
  68510. case "lineTo":
  68511. g.push(new n.Vector2(C[0], C[1]));
  68512. break;
  68513. case "quadraticCurveTo":
  68514. (t = C[2]),
  68515. (i = C[3]),
  68516. (a = C[0]),
  68517. (s = C[1]),
  68518. g.length > 0
  68519. ? ((h = g[g.length - 1]), (l = h.x), (c = h.y))
  68520. : ((h = this.actions[m - 1].args),
  68521. (l = h[h.length - 2]),
  68522. (c = h[h.length - 1]));
  68523. for (var I = 1; I <= e; I++) {
  68524. var E = I / e;
  68525. (u = p(E, l, a, t)),
  68526. (d = p(E, c, s, i)),
  68527. g.push(new n.Vector2(u, d));
  68528. }
  68529. break;
  68530. case "bezierCurveTo":
  68531. (t = C[4]),
  68532. (i = C[5]),
  68533. (a = C[0]),
  68534. (s = C[1]),
  68535. (r = C[2]),
  68536. (o = C[3]),
  68537. g.length > 0
  68538. ? ((h = g[g.length - 1]), (l = h.x), (c = h.y))
  68539. : ((h = this.actions[m - 1].args),
  68540. (l = h[h.length - 2]),
  68541. (c = h[h.length - 1]));
  68542. for (var I = 1; I <= e; I++) {
  68543. var E = I / e;
  68544. (u = f(E, l, a, r, t)),
  68545. (d = f(E, c, s, o, i)),
  68546. g.push(new n.Vector2(u, d));
  68547. }
  68548. break;
  68549. case "splineThru":
  68550. h = this.actions[m - 1].args;
  68551. var b = new n.Vector2(h[h.length - 2], h[h.length - 1]),
  68552. w = [b],
  68553. _ = e * C[0].length;
  68554. w = w.concat(C[0]);
  68555. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  68556. g.push(T.getPointAt(I / _));
  68557. break;
  68558. case "arc":
  68559. for (
  68560. var x,
  68561. S = C[0],
  68562. M = C[1],
  68563. R = C[2],
  68564. P = C[3],
  68565. O = C[4],
  68566. L = !!C[5],
  68567. D = O - P,
  68568. N = 2 * e,
  68569. I = 1;
  68570. I <= N;
  68571. I++
  68572. ) {
  68573. var E = I / N;
  68574. L || (E = 1 - E),
  68575. (x = P + E * D),
  68576. (u = S + R * Math.cos(x)),
  68577. (d = M + R * Math.sin(x)),
  68578. g.push(new n.Vector2(u, d));
  68579. }
  68580. break;
  68581. case "ellipse":
  68582. var x,
  68583. B,
  68584. F,
  68585. S = C[0],
  68586. M = C[1],
  68587. V = C[2],
  68588. U = C[3],
  68589. P = C[4],
  68590. O = C[5],
  68591. L = !!C[6],
  68592. k = C[7],
  68593. D = O - P,
  68594. N = 2 * e;
  68595. 0 !== k && ((B = Math.cos(k)), (F = Math.sin(k)));
  68596. for (var I = 1; I <= N; I++) {
  68597. var E = I / N;
  68598. if (
  68599. (L || (E = 1 - E),
  68600. (x = P + E * D),
  68601. (u = S + V * Math.cos(x)),
  68602. (d = M + U * Math.sin(x)),
  68603. 0 !== k)
  68604. ) {
  68605. var H = u,
  68606. G = d;
  68607. (u = (H - S) * B - (G - M) * F + S),
  68608. (d = (H - S) * F + (G - M) * B + M);
  68609. }
  68610. g.push(new n.Vector2(u, d));
  68611. }
  68612. }
  68613. }
  68614. var z = g[g.length - 1];
  68615. return (
  68616. Math.abs(z.x - g[0].x) < Number.EPSILON &&
  68617. Math.abs(z.y - g[0].y) < Number.EPSILON &&
  68618. g.splice(g.length - 1, 1),
  68619. this.autoClose && g.push(g[0]),
  68620. g
  68621. );
  68622. }),
  68623. (n.Path.prototype.toShapes = function (e, t) {
  68624. function i(e) {
  68625. for (
  68626. var t = [], i = new n.Path(), r = 0, o = e.length;
  68627. r < o;
  68628. r++
  68629. ) {
  68630. var a = e[r],
  68631. s = a.args,
  68632. l = a.action;
  68633. "moveTo" === l &&
  68634. 0 !== i.actions.length &&
  68635. (t.push(i), (i = new n.Path())),
  68636. i[l].apply(i, s);
  68637. }
  68638. return 0 !== i.actions.length && t.push(i), t;
  68639. }
  68640. function r(e) {
  68641. for (var t = [], i = 0, r = e.length; i < r; i++) {
  68642. var o = e[i],
  68643. a = new n.Shape();
  68644. (a.actions = o.actions), (a.curves = o.curves), t.push(a);
  68645. }
  68646. return t;
  68647. }
  68648. function o(e, t) {
  68649. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  68650. var a = t[r],
  68651. s = t[o],
  68652. l = s.x - a.x,
  68653. c = s.y - a.y;
  68654. if (Math.abs(c) > Number.EPSILON) {
  68655. if (
  68656. (c < 0 && ((a = t[o]), (l = -l), (s = t[r]), (c = -c)),
  68657. e.y < a.y || e.y > s.y)
  68658. )
  68659. continue;
  68660. if (e.y === a.y) {
  68661. if (e.x === a.x) return !0;
  68662. } else {
  68663. var h = c * (e.x - a.x) - l * (e.y - a.y);
  68664. if (0 === h) return !0;
  68665. if (h < 0) continue;
  68666. n = !n;
  68667. }
  68668. } else {
  68669. if (e.y !== a.y) continue;
  68670. if ((s.x <= e.x && e.x <= a.x) || (a.x <= e.x && e.x <= s.x))
  68671. return !0;
  68672. }
  68673. }
  68674. return n;
  68675. }
  68676. var a = n.ShapeUtils.isClockWise,
  68677. s = i(this.actions);
  68678. if (0 === s.length) return [];
  68679. if (t === !0) return r(s);
  68680. var l,
  68681. c,
  68682. h,
  68683. u = [];
  68684. if (1 === s.length)
  68685. return (
  68686. (c = s[0]),
  68687. (h = new n.Shape()),
  68688. (h.actions = c.actions),
  68689. (h.curves = c.curves),
  68690. u.push(h),
  68691. u
  68692. );
  68693. var d = !a(s[0].getPoints());
  68694. d = e ? !d : d;
  68695. var p,
  68696. f = [],
  68697. g = [],
  68698. m = [],
  68699. v = 0;
  68700. (g[v] = void 0), (m[v] = []);
  68701. for (var A = 0, y = s.length; A < y; A++)
  68702. (c = s[A]),
  68703. (p = c.getPoints()),
  68704. (l = a(p)),
  68705. (l = e ? !l : l),
  68706. l
  68707. ? (!d && g[v] && v++,
  68708. (g[v] = {
  68709. s: new n.Shape(),
  68710. p: p,
  68711. }),
  68712. (g[v].s.actions = c.actions),
  68713. (g[v].s.curves = c.curves),
  68714. d && v++,
  68715. (m[v] = []))
  68716. : m[v].push({
  68717. h: c,
  68718. p: p[0],
  68719. });
  68720. if (!g[0]) return r(s);
  68721. if (g.length > 1) {
  68722. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  68723. f[E] = [];
  68724. for (var E = 0, b = g.length; E < b; E++)
  68725. for (var w = m[E], _ = 0; _ < w.length; _++) {
  68726. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  68727. o(T.p, g[S].p) &&
  68728. (E !== S &&
  68729. I.push({
  68730. froms: E,
  68731. tos: S,
  68732. hole: _,
  68733. }),
  68734. x ? ((x = !1), f[S].push(T)) : (C = !0));
  68735. x && f[E].push(T);
  68736. }
  68737. I.length > 0 && (C || (m = f));
  68738. }
  68739. for (var M, A = 0, R = g.length; A < R; A++) {
  68740. (h = g[A].s), u.push(h), (M = m[A]);
  68741. for (var P = 0, O = M.length; P < O; P++) h.holes.push(M[P].h);
  68742. }
  68743. return u;
  68744. }),
  68745. (n.Shape = function () {
  68746. n.Path.apply(this, arguments), (this.holes = []);
  68747. }),
  68748. (n.Shape.prototype = Object.create(n.Path.prototype)),
  68749. (n.Shape.prototype.constructor = n.Shape),
  68750. (n.Shape.prototype.extrude = function (e) {
  68751. return new n.ExtrudeGeometry(this, e);
  68752. }),
  68753. (n.Shape.prototype.makeGeometry = function (e) {
  68754. return new n.ShapeGeometry(this, e);
  68755. }),
  68756. (n.Shape.prototype.getPointsHoles = function (e) {
  68757. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  68758. t[i] = this.holes[i].getPoints(e);
  68759. return t;
  68760. }),
  68761. (n.Shape.prototype.extractAllPoints = function (e) {
  68762. return {
  68763. shape: this.getPoints(e),
  68764. holes: this.getPointsHoles(e),
  68765. };
  68766. }),
  68767. (n.Shape.prototype.extractPoints = function (e) {
  68768. return this.extractAllPoints(e);
  68769. }),
  68770. (n.LineCurve = function (e, t) {
  68771. (this.v1 = e), (this.v2 = t);
  68772. }),
  68773. (n.LineCurve.prototype = Object.create(n.Curve.prototype)),
  68774. (n.LineCurve.prototype.constructor = n.LineCurve),
  68775. (n.LineCurve.prototype.getPoint = function (e) {
  68776. var t = this.v2.clone().sub(this.v1);
  68777. return t.multiplyScalar(e).add(this.v1), t;
  68778. }),
  68779. (n.LineCurve.prototype.getPointAt = function (e) {
  68780. return this.getPoint(e);
  68781. }),
  68782. (n.LineCurve.prototype.getTangent = function (e) {
  68783. var t = this.v2.clone().sub(this.v1);
  68784. return t.normalize();
  68785. }),
  68786. (n.QuadraticBezierCurve = function (e, t, i) {
  68787. (this.v0 = e), (this.v1 = t), (this.v2 = i);
  68788. }),
  68789. (n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype)),
  68790. (n.QuadraticBezierCurve.prototype.constructor =
  68791. n.QuadraticBezierCurve),
  68792. (n.QuadraticBezierCurve.prototype.getPoint = function (e) {
  68793. var t = n.ShapeUtils.b2;
  68794. return new n.Vector2(
  68795. t(e, this.v0.x, this.v1.x, this.v2.x),
  68796. t(e, this.v0.y, this.v1.y, this.v2.y)
  68797. );
  68798. }),
  68799. (n.QuadraticBezierCurve.prototype.getTangent = function (e) {
  68800. var t = n.CurveUtils.tangentQuadraticBezier;
  68801. return new n.Vector2(
  68802. t(e, this.v0.x, this.v1.x, this.v2.x),
  68803. t(e, this.v0.y, this.v1.y, this.v2.y)
  68804. ).normalize();
  68805. }),
  68806. (n.CubicBezierCurve = function (e, t, i, n) {
  68807. (this.v0 = e), (this.v1 = t), (this.v2 = i), (this.v3 = n);
  68808. }),
  68809. (n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype)),
  68810. (n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve),
  68811. (n.CubicBezierCurve.prototype.getPoint = function (e) {
  68812. var t = n.ShapeUtils.b3;
  68813. return new n.Vector2(
  68814. t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),
  68815. t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)
  68816. );
  68817. }),
  68818. (n.CubicBezierCurve.prototype.getTangent = function (e) {
  68819. var t = n.CurveUtils.tangentCubicBezier;
  68820. return new n.Vector2(
  68821. t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),
  68822. t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)
  68823. ).normalize();
  68824. }),
  68825. (n.SplineCurve = function (e) {
  68826. this.points = void 0 == e ? [] : e;
  68827. }),
  68828. (n.SplineCurve.prototype = Object.create(n.Curve.prototype)),
  68829. (n.SplineCurve.prototype.constructor = n.SplineCurve),
  68830. (n.SplineCurve.prototype.getPoint = function (e) {
  68831. var t = this.points,
  68832. i = (t.length - 1) * e,
  68833. r = Math.floor(i),
  68834. o = i - r,
  68835. a = t[0 === r ? r : r - 1],
  68836. s = t[r],
  68837. l = t[r > t.length - 2 ? t.length - 1 : r + 1],
  68838. c = t[r > t.length - 3 ? t.length - 1 : r + 2],
  68839. h = n.CurveUtils.interpolate;
  68840. return new n.Vector2(
  68841. h(a.x, s.x, l.x, c.x, o),
  68842. h(a.y, s.y, l.y, c.y, o)
  68843. );
  68844. }),
  68845. (n.EllipseCurve = function (e, t, i, n, r, o, a, s) {
  68846. (this.aX = e),
  68847. (this.aY = t),
  68848. (this.xRadius = i),
  68849. (this.yRadius = n),
  68850. (this.aStartAngle = r),
  68851. (this.aEndAngle = o),
  68852. (this.aClockwise = a),
  68853. (this.aRotation = s || 0);
  68854. }),
  68855. (n.EllipseCurve.prototype = Object.create(n.Curve.prototype)),
  68856. (n.EllipseCurve.prototype.constructor = n.EllipseCurve),
  68857. (n.EllipseCurve.prototype.getPoint = function (e) {
  68858. var t = this.aEndAngle - this.aStartAngle;
  68859. t < 0 && (t += 2 * Math.PI), t > 2 * Math.PI && (t -= 2 * Math.PI);
  68860. var i;
  68861. i =
  68862. this.aClockwise === !0
  68863. ? this.aEndAngle + (1 - e) * (2 * Math.PI - t)
  68864. : this.aStartAngle + e * t;
  68865. var r = this.aX + this.xRadius * Math.cos(i),
  68866. o = this.aY + this.yRadius * Math.sin(i);
  68867. if (0 !== this.aRotation) {
  68868. var a = Math.cos(this.aRotation),
  68869. s = Math.sin(this.aRotation),
  68870. l = r,
  68871. c = o;
  68872. (r = (l - this.aX) * a - (c - this.aY) * s + this.aX),
  68873. (o = (l - this.aX) * s + (c - this.aY) * a + this.aY);
  68874. }
  68875. return new n.Vector2(r, o);
  68876. }),
  68877. (n.ArcCurve = function (e, t, i, r, o, a) {
  68878. n.EllipseCurve.call(this, e, t, i, i, r, o, a);
  68879. }),
  68880. (n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype)),
  68881. (n.ArcCurve.prototype.constructor = n.ArcCurve),
  68882. (n.LineCurve3 = n.Curve.create(
  68883. function (e, t) {
  68884. (this.v1 = e), (this.v2 = t);
  68885. },
  68886. function (e) {
  68887. var t = new n.Vector3();
  68888. return (
  68889. t.subVectors(this.v2, this.v1),
  68890. t.multiplyScalar(e),
  68891. t.add(this.v1),
  68892. t
  68893. );
  68894. }
  68895. )),
  68896. (n.QuadraticBezierCurve3 = n.Curve.create(
  68897. function (e, t, i) {
  68898. (this.v0 = e), (this.v1 = t), (this.v2 = i);
  68899. },
  68900. function (e) {
  68901. var t = n.ShapeUtils.b2;
  68902. return new n.Vector3(
  68903. t(e, this.v0.x, this.v1.x, this.v2.x),
  68904. t(e, this.v0.y, this.v1.y, this.v2.y),
  68905. t(e, this.v0.z, this.v1.z, this.v2.z)
  68906. );
  68907. }
  68908. )),
  68909. (n.CubicBezierCurve3 = n.Curve.create(
  68910. function (e, t, i, n) {
  68911. (this.v0 = e), (this.v1 = t), (this.v2 = i), (this.v3 = n);
  68912. },
  68913. function (e) {
  68914. var t = n.ShapeUtils.b3;
  68915. return new n.Vector3(
  68916. t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),
  68917. t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y),
  68918. t(e, this.v0.z, this.v1.z, this.v2.z, this.v3.z)
  68919. );
  68920. }
  68921. )),
  68922. (n.SplineCurve3 = n.Curve.create(
  68923. function (e) {
  68924. console.warn(
  68925. "THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"
  68926. ),
  68927. (this.points = void 0 == e ? [] : e);
  68928. },
  68929. function (e) {
  68930. var t = this.points,
  68931. i = (t.length - 1) * e,
  68932. r = Math.floor(i),
  68933. o = i - r,
  68934. a = t[0 == r ? r : r - 1],
  68935. s = t[r],
  68936. l = t[r > t.length - 2 ? t.length - 1 : r + 1],
  68937. c = t[r > t.length - 3 ? t.length - 1 : r + 2],
  68938. h = n.CurveUtils.interpolate;
  68939. return new n.Vector3(
  68940. h(a.x, s.x, l.x, c.x, o),
  68941. h(a.y, s.y, l.y, c.y, o),
  68942. h(a.z, s.z, l.z, c.z, o)
  68943. );
  68944. }
  68945. )),
  68946. (n.CatmullRomCurve3 = (function () {
  68947. function e() {}
  68948. var t = new n.Vector3(),
  68949. i = new e(),
  68950. r = new e(),
  68951. o = new e();
  68952. return (
  68953. (e.prototype.init = function (e, t, i, n) {
  68954. (this.c0 = e),
  68955. (this.c1 = i),
  68956. (this.c2 = -3 * e + 3 * t - 2 * i - n),
  68957. (this.c3 = 2 * e - 2 * t + i + n);
  68958. }),
  68959. (e.prototype.initNonuniformCatmullRom = function (
  68960. e,
  68961. t,
  68962. i,
  68963. n,
  68964. r,
  68965. o,
  68966. a
  68967. ) {
  68968. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o,
  68969. l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  68970. (s *= o), (l *= o), this.init(t, i, s, l);
  68971. }),
  68972. (e.prototype.initCatmullRom = function (e, t, i, n, r) {
  68973. this.init(t, i, r * (i - e), r * (n - t));
  68974. }),
  68975. (e.prototype.calc = function (e) {
  68976. var t = e * e,
  68977. i = t * e;
  68978. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i;
  68979. }),
  68980. n.Curve.create(
  68981. function (e) {
  68982. (this.points = e || []), (this.closed = !1);
  68983. },
  68984. function (e) {
  68985. var a,
  68986. s,
  68987. l,
  68988. c,
  68989. h = this.points;
  68990. (c = h.length),
  68991. c < 2 && console.log("duh, you need at least 2 points"),
  68992. (a = (c - (this.closed ? 0 : 1)) * e),
  68993. (s = Math.floor(a)),
  68994. (l = a - s),
  68995. this.closed
  68996. ? (s +=
  68997. s > 0
  68998. ? 0
  68999. : (Math.floor(Math.abs(s) / h.length) + 1) *
  69000. h.length)
  69001. : 0 === l && s === c - 1 && ((s = c - 2), (l = 1));
  69002. var u, d, p, f;
  69003. if (
  69004. (this.closed || s > 0
  69005. ? (u = h[(s - 1) % c])
  69006. : (t.subVectors(h[0], h[1]).add(h[0]), (u = t)),
  69007. (d = h[s % c]),
  69008. (p = h[(s + 1) % c]),
  69009. this.closed || s + 2 < c
  69010. ? (f = h[(s + 2) % c])
  69011. : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  69012. (f = t)),
  69013. void 0 === this.type ||
  69014. "centripetal" === this.type ||
  69015. "chordal" === this.type)
  69016. ) {
  69017. var g = "chordal" === this.type ? 0.5 : 0.25,
  69018. m = Math.pow(u.distanceToSquared(d), g),
  69019. v = Math.pow(d.distanceToSquared(p), g),
  69020. A = Math.pow(p.distanceToSquared(f), g);
  69021. v < 1e-4 && (v = 1),
  69022. m < 1e-4 && (m = v),
  69023. A < 1e-4 && (A = v),
  69024. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  69025. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  69026. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A);
  69027. } else if ("catmullrom" === this.type) {
  69028. var y = void 0 !== this.tension ? this.tension : 0.5;
  69029. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  69030. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  69031. o.initCatmullRom(u.z, d.z, p.z, f.z, y);
  69032. }
  69033. var C = new n.Vector3(i.calc(l), r.calc(l), o.calc(l));
  69034. return C;
  69035. }
  69036. )
  69037. );
  69038. })()),
  69039. (n.ClosedSplineCurve3 = function (e) {
  69040. console.warn(
  69041. "THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."
  69042. ),
  69043. n.CatmullRomCurve3.call(this, e),
  69044. (this.type = "catmullrom"),
  69045. (this.closed = !0);
  69046. }),
  69047. (n.ClosedSplineCurve3.prototype = Object.create(
  69048. n.CatmullRomCurve3.prototype
  69049. )),
  69050. (n.BoxGeometry = function (e, t, i, r, o, a) {
  69051. n.Geometry.call(this),
  69052. (this.type = "BoxGeometry"),
  69053. (this.parameters = {
  69054. width: e,
  69055. height: t,
  69056. depth: i,
  69057. widthSegments: r,
  69058. heightSegments: o,
  69059. depthSegments: a,
  69060. }),
  69061. this.fromBufferGeometry(
  69062. new n.BoxBufferGeometry(e, t, i, r, o, a)
  69063. ),
  69064. this.mergeVertices();
  69065. }),
  69066. (n.BoxGeometry.prototype = Object.create(n.Geometry.prototype)),
  69067. (n.BoxGeometry.prototype.constructor = n.BoxGeometry),
  69068. (n.CubeGeometry = n.BoxGeometry),
  69069. (n.BoxBufferGeometry = function (e, t, i, r, o, a) {
  69070. function s(e, t, i) {
  69071. var n = 0;
  69072. return (
  69073. (n += e * t * 2), (n += e * i * 2), (n += i * t * 2), 4 * n
  69074. );
  69075. }
  69076. function l(e, t, i, r, o, a, s, l, h, u, I) {
  69077. for (
  69078. var E = a / h,
  69079. b = s / u,
  69080. w = a / 2,
  69081. _ = s / 2,
  69082. T = l / 2,
  69083. x = h + 1,
  69084. S = u + 1,
  69085. M = 0,
  69086. R = 0,
  69087. P = new n.Vector3(),
  69088. O = 0;
  69089. O < S;
  69090. O++
  69091. )
  69092. for (var L = O * b - _, D = 0; D < x; D++) {
  69093. var N = D * E - w;
  69094. (P[e] = N * r),
  69095. (P[t] = L * o),
  69096. (P[i] = T),
  69097. (p[m] = P.x),
  69098. (p[m + 1] = P.y),
  69099. (p[m + 2] = P.z),
  69100. (P[e] = 0),
  69101. (P[t] = 0),
  69102. (P[i] = l > 0 ? 1 : -1),
  69103. (f[m] = P.x),
  69104. (f[m + 1] = P.y),
  69105. (f[m + 2] = P.z),
  69106. (g[v] = D / h),
  69107. (g[v + 1] = 1 - O / u),
  69108. (m += 3),
  69109. (v += 2),
  69110. (M += 1);
  69111. }
  69112. for (O = 0; O < u; O++)
  69113. for (D = 0; D < h; D++) {
  69114. var B = y + D + x * O,
  69115. F = y + D + x * (O + 1),
  69116. V = y + (D + 1) + x * (O + 1),
  69117. U = y + (D + 1) + x * O;
  69118. (d[A] = B),
  69119. (d[A + 1] = F),
  69120. (d[A + 2] = U),
  69121. (d[A + 3] = F),
  69122. (d[A + 4] = V),
  69123. (d[A + 5] = U),
  69124. (A += 6),
  69125. (R += 6);
  69126. }
  69127. c.addGroup(C, R, I), (C += R), (y += M);
  69128. }
  69129. n.BufferGeometry.call(this),
  69130. (this.type = "BoxBufferGeometry"),
  69131. (this.parameters = {
  69132. width: e,
  69133. height: t,
  69134. depth: i,
  69135. widthSegments: r,
  69136. heightSegments: o,
  69137. depthSegments: a,
  69138. });
  69139. var c = this;
  69140. (r = Math.floor(r) || 1),
  69141. (o = Math.floor(o) || 1),
  69142. (a = Math.floor(a) || 1);
  69143. var h = s(r, o, a),
  69144. u = (h / 4) * 6,
  69145. d = new (u > 65535 ? Uint32Array : Uint16Array)(u),
  69146. p = new Float32Array(3 * h),
  69147. f = new Float32Array(3 * h),
  69148. g = new Float32Array(2 * h),
  69149. m = 0,
  69150. v = 0,
  69151. A = 0,
  69152. y = 0,
  69153. C = 0;
  69154. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  69155. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  69156. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  69157. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  69158. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  69159. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  69160. this.setIndex(new n.BufferAttribute(d, 1)),
  69161. this.addAttribute("position", new n.BufferAttribute(p, 3)),
  69162. this.addAttribute("normal", new n.BufferAttribute(f, 3)),
  69163. this.addAttribute("uv", new n.BufferAttribute(g, 2));
  69164. }),
  69165. (n.BoxBufferGeometry.prototype = Object.create(
  69166. n.BufferGeometry.prototype
  69167. )),
  69168. (n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry),
  69169. (n.CircleGeometry = function (e, t, i, r) {
  69170. n.Geometry.call(this),
  69171. (this.type = "CircleGeometry"),
  69172. (this.parameters = {
  69173. radius: e,
  69174. segments: t,
  69175. thetaStart: i,
  69176. thetaLength: r,
  69177. }),
  69178. this.fromBufferGeometry(new n.CircleBufferGeometry(e, t, i, r));
  69179. }),
  69180. (n.CircleGeometry.prototype = Object.create(n.Geometry.prototype)),
  69181. (n.CircleGeometry.prototype.constructor = n.CircleGeometry),
  69182. (n.CircleBufferGeometry = function (e, t, i, r) {
  69183. n.BufferGeometry.call(this),
  69184. (this.type = "CircleBufferGeometry"),
  69185. (this.parameters = {
  69186. radius: e,
  69187. segments: t,
  69188. thetaStart: i,
  69189. thetaLength: r,
  69190. }),
  69191. (e = e || 50),
  69192. (t = void 0 !== t ? Math.max(3, t) : 8),
  69193. (i = void 0 !== i ? i : 0),
  69194. (r = void 0 !== r ? r : 2 * Math.PI);
  69195. var o = t + 2,
  69196. a = new Float32Array(3 * o),
  69197. s = new Float32Array(3 * o),
  69198. l = new Float32Array(2 * o);
  69199. (s[2] = 1), (l[0] = 0.5), (l[1] = 0.5);
  69200. for (var c = 0, h = 3, u = 2; c <= t; c++, h += 3, u += 2) {
  69201. var d = i + (c / t) * r;
  69202. (a[h] = e * Math.cos(d)),
  69203. (a[h + 1] = e * Math.sin(d)),
  69204. (s[h + 2] = 1),
  69205. (l[u] = (a[h] / e + 1) / 2),
  69206. (l[u + 1] = (a[h + 1] / e + 1) / 2);
  69207. }
  69208. for (var p = [], h = 1; h <= t; h++) p.push(h, h + 1, 0);
  69209. this.setIndex(new n.BufferAttribute(new Uint16Array(p), 1)),
  69210. this.addAttribute("position", new n.BufferAttribute(a, 3)),
  69211. this.addAttribute("normal", new n.BufferAttribute(s, 3)),
  69212. this.addAttribute("uv", new n.BufferAttribute(l, 2)),
  69213. (this.boundingSphere = new n.Sphere(new n.Vector3(), e));
  69214. }),
  69215. (n.CircleBufferGeometry.prototype = Object.create(
  69216. n.BufferGeometry.prototype
  69217. )),
  69218. (n.CircleBufferGeometry.prototype.constructor =
  69219. n.CircleBufferGeometry),
  69220. (n.CylinderBufferGeometry = function (e, t, i, r, o, a, s, l) {
  69221. function c() {
  69222. var e = (r + 1) * (o + 1);
  69223. return a === !1 && (e += 2 * (r + 1) + 2 * r), e;
  69224. }
  69225. function h() {
  69226. var e = r * o * 2 * 3;
  69227. return a === !1 && (e += 2 * r * 3), e;
  69228. }
  69229. function u() {
  69230. var a,
  69231. c,
  69232. h = new n.Vector3(),
  69233. u = new n.Vector3(),
  69234. d = (t - e) / i;
  69235. for (c = 0; c <= o; c++) {
  69236. var p = [],
  69237. f = c / o,
  69238. b = f * (t - e) + e;
  69239. for (a = 0; a <= r; a++) {
  69240. var w = a / r;
  69241. (u.x = b * Math.sin(w * l + s)),
  69242. (u.y = -f * i + E),
  69243. (u.z = b * Math.cos(w * l + s)),
  69244. m.setXYZ(y, u.x, u.y, u.z),
  69245. h.copy(u),
  69246. ((0 === e && 0 === c) || (0 === t && c === o)) &&
  69247. ((h.x = Math.sin(w * l + s)),
  69248. (h.z = Math.cos(w * l + s))),
  69249. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  69250. v.setXYZ(y, h.x, h.y, h.z),
  69251. A.setXY(y, w, 1 - f),
  69252. p.push(y),
  69253. y++;
  69254. }
  69255. I.push(p);
  69256. }
  69257. for (a = 0; a < r; a++)
  69258. for (c = 0; c < o; c++) {
  69259. var _ = I[c][a],
  69260. T = I[c + 1][a],
  69261. x = I[c + 1][a + 1],
  69262. S = I[c][a + 1];
  69263. g.setX(C, _),
  69264. C++,
  69265. g.setX(C, T),
  69266. C++,
  69267. g.setX(C, S),
  69268. C++,
  69269. g.setX(C, T),
  69270. C++,
  69271. g.setX(C, x),
  69272. C++,
  69273. g.setX(C, S),
  69274. C++;
  69275. }
  69276. }
  69277. function d(i) {
  69278. var o,
  69279. a,
  69280. c,
  69281. h = new n.Vector2(),
  69282. u = new n.Vector3(),
  69283. d = i === !0 ? e : t,
  69284. p = i === !0 ? 1 : -1;
  69285. for (a = y, o = 1; o <= r; o++)
  69286. m.setXYZ(y, 0, E * p, 0),
  69287. v.setXYZ(y, 0, p, 0),
  69288. i === !0
  69289. ? ((h.x = o / r), (h.y = 0))
  69290. : ((h.x = (o - 1) / r), (h.y = 1)),
  69291. A.setXY(y, h.x, h.y),
  69292. y++;
  69293. for (c = y, o = 0; o <= r; o++) {
  69294. var f = o / r;
  69295. (u.x = d * Math.sin(f * l + s)),
  69296. (u.y = E * p),
  69297. (u.z = d * Math.cos(f * l + s)),
  69298. m.setXYZ(y, u.x, u.y, u.z),
  69299. v.setXYZ(y, 0, p, 0),
  69300. A.setXY(y, f, i === !0 ? 1 : 0),
  69301. y++;
  69302. }
  69303. for (o = 0; o < r; o++) {
  69304. var I = a + o,
  69305. b = c + o;
  69306. i === !0
  69307. ? (g.setX(C, b),
  69308. C++,
  69309. g.setX(C, b + 1),
  69310. C++,
  69311. g.setX(C, I),
  69312. C++)
  69313. : (g.setX(C, b + 1),
  69314. C++,
  69315. g.setX(C, b),
  69316. C++,
  69317. g.setX(C, I),
  69318. C++);
  69319. }
  69320. }
  69321. n.BufferGeometry.call(this),
  69322. (this.type = "CylinderBufferGeometry"),
  69323. (this.parameters = {
  69324. radiusTop: e,
  69325. radiusBottom: t,
  69326. height: i,
  69327. radialSegments: r,
  69328. heightSegments: o,
  69329. openEnded: a,
  69330. thetaStart: s,
  69331. thetaLength: l,
  69332. }),
  69333. (e = void 0 !== e ? e : 20),
  69334. (t = void 0 !== t ? t : 20),
  69335. (i = void 0 !== i ? i : 100),
  69336. (r = Math.floor(r) || 8),
  69337. (o = Math.floor(o) || 1),
  69338. (a = void 0 !== a && a),
  69339. (s = void 0 !== s ? s : 0),
  69340. (l = void 0 !== l ? l : 2 * Math.PI);
  69341. var p = c(),
  69342. f = h(),
  69343. g = new n.BufferAttribute(
  69344. new (f > 65535 ? Uint32Array : Uint16Array)(f),
  69345. 1
  69346. ),
  69347. m = new n.BufferAttribute(new Float32Array(3 * p), 3),
  69348. v = new n.BufferAttribute(new Float32Array(3 * p), 3),
  69349. A = new n.BufferAttribute(new Float32Array(2 * p), 2),
  69350. y = 0,
  69351. C = 0,
  69352. I = [],
  69353. E = i / 2;
  69354. u(),
  69355. a === !1 && (e > 0 && d(!0), t > 0 && d(!1)),
  69356. this.setIndex(g),
  69357. this.addAttribute("position", m),
  69358. this.addAttribute("normal", v),
  69359. this.addAttribute("uv", A);
  69360. }),
  69361. (n.CylinderBufferGeometry.prototype = Object.create(
  69362. n.BufferGeometry.prototype
  69363. )),
  69364. (n.CylinderBufferGeometry.prototype.constructor =
  69365. n.CylinderBufferGeometry),
  69366. (n.CylinderGeometry = function (e, t, i, r, o, a, s, l) {
  69367. n.Geometry.call(this),
  69368. (this.type = "CylinderGeometry"),
  69369. (this.parameters = {
  69370. radiusTop: e,
  69371. radiusBottom: t,
  69372. height: i,
  69373. radialSegments: r,
  69374. heightSegments: o,
  69375. openEnded: a,
  69376. thetaStart: s,
  69377. thetaLength: l,
  69378. }),
  69379. this.fromBufferGeometry(
  69380. new n.CylinderBufferGeometry(e, t, i, r, o, a, s, l)
  69381. ),
  69382. this.mergeVertices();
  69383. }),
  69384. (n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype)),
  69385. (n.CylinderGeometry.prototype.constructor = n.CylinderGeometry),
  69386. (n.EdgesGeometry = function (e, t) {
  69387. function i(e, t) {
  69388. return e - t;
  69389. }
  69390. n.BufferGeometry.call(this), (t = void 0 !== t ? t : 1);
  69391. var r,
  69392. o = Math.cos(n.Math.degToRad(t)),
  69393. a = [0, 0],
  69394. s = {},
  69395. l = ["a", "b", "c"];
  69396. e instanceof n.BufferGeometry
  69397. ? ((r = new n.Geometry()), r.fromBufferGeometry(e))
  69398. : (r = e.clone()),
  69399. r.mergeVertices(),
  69400. r.computeFaceNormals();
  69401. for (
  69402. var c = r.vertices, h = r.faces, u = 0, d = h.length;
  69403. u < d;
  69404. u++
  69405. )
  69406. for (var p = h[u], f = 0; f < 3; f++) {
  69407. (a[0] = p[l[f]]), (a[1] = p[l[(f + 1) % 3]]), a.sort(i);
  69408. var g = a.toString();
  69409. void 0 === s[g]
  69410. ? (s[g] = {
  69411. vert1: a[0],
  69412. vert2: a[1],
  69413. face1: u,
  69414. face2: void 0,
  69415. })
  69416. : (s[g].face2 = u);
  69417. }
  69418. var m = [];
  69419. for (var g in s) {
  69420. var v = s[g];
  69421. if (
  69422. void 0 === v.face2 ||
  69423. h[v.face1].normal.dot(h[v.face2].normal) <= o
  69424. ) {
  69425. var A = c[v.vert1];
  69426. m.push(A.x),
  69427. m.push(A.y),
  69428. m.push(A.z),
  69429. (A = c[v.vert2]),
  69430. m.push(A.x),
  69431. m.push(A.y),
  69432. m.push(A.z);
  69433. }
  69434. }
  69435. this.addAttribute(
  69436. "position",
  69437. new n.BufferAttribute(new Float32Array(m), 3)
  69438. );
  69439. }),
  69440. (n.EdgesGeometry.prototype = Object.create(
  69441. n.BufferGeometry.prototype
  69442. )),
  69443. (n.EdgesGeometry.prototype.constructor = n.EdgesGeometry),
  69444. (n.ExtrudeGeometry = function (e, t) {
  69445. return "undefined" == typeof e
  69446. ? void (e = [])
  69447. : (n.Geometry.call(this),
  69448. (this.type = "ExtrudeGeometry"),
  69449. (e = Array.isArray(e) ? e : [e]),
  69450. this.addShapeList(e, t),
  69451. void this.computeFaceNormals());
  69452. });
  69453. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  69454. (n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry),
  69455. (n.ExtrudeGeometry.prototype.addShapeList = function (e, t) {
  69456. for (var i = e.length, n = 0; n < i; n++) {
  69457. var r = e[n];
  69458. this.addShape(r, t);
  69459. }
  69460. }),
  69461. (n.ExtrudeGeometry.prototype.addShape = function (e, t) {
  69462. function i(e, t, i) {
  69463. return (
  69464. t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  69465. t.clone().multiplyScalar(i).add(e)
  69466. );
  69467. }
  69468. function r(e, t, i) {
  69469. var r,
  69470. o,
  69471. a = 1,
  69472. s = e.x - t.x,
  69473. l = e.y - t.y,
  69474. c = i.x - e.x,
  69475. h = i.y - e.y,
  69476. u = s * s + l * l,
  69477. d = s * h - l * c;
  69478. if (Math.abs(d) > Number.EPSILON) {
  69479. var p = Math.sqrt(u),
  69480. f = Math.sqrt(c * c + h * h),
  69481. g = t.x - l / p,
  69482. m = t.y + s / p,
  69483. v = i.x - h / f,
  69484. A = i.y + c / f,
  69485. y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  69486. (r = g + s * y - e.x), (o = m + l * y - e.y);
  69487. var C = r * r + o * o;
  69488. if (C <= 2) return new n.Vector2(r, o);
  69489. a = Math.sqrt(C / 2);
  69490. } else {
  69491. var I = !1;
  69492. s > Number.EPSILON
  69493. ? c > Number.EPSILON && (I = !0)
  69494. : s < -Number.EPSILON
  69495. ? c < -Number.EPSILON && (I = !0)
  69496. : Math.sign(l) === Math.sign(h) && (I = !0),
  69497. I
  69498. ? ((r = -l), (o = s), (a = Math.sqrt(u)))
  69499. : ((r = s), (o = l), (a = Math.sqrt(u / 2)));
  69500. }
  69501. return new n.Vector2(r / a, o / a);
  69502. }
  69503. function o() {
  69504. if (C) {
  69505. var e = 0,
  69506. t = z * e;
  69507. for (Y = 0; Y < W; Y++)
  69508. (G = N[Y]), c(G[2] + t, G[1] + t, G[0] + t);
  69509. for (e = E + 2 * y, t = z * e, Y = 0; Y < W; Y++)
  69510. (G = N[Y]), c(G[0] + t, G[1] + t, G[2] + t);
  69511. } else {
  69512. for (Y = 0; Y < W; Y++) (G = N[Y]), c(G[2], G[1], G[0]);
  69513. for (Y = 0; Y < W; Y++)
  69514. (G = N[Y]), c(G[0] + z * E, G[1] + z * E, G[2] + z * E);
  69515. }
  69516. }
  69517. function a() {
  69518. var e = 0;
  69519. for (s(B, e), e += B.length, x = 0, S = L.length; x < S; x++)
  69520. (T = L[x]), s(T, e), (e += T.length);
  69521. }
  69522. function s(e, t) {
  69523. var i, n;
  69524. for (Y = e.length; --Y >= 0; ) {
  69525. (i = Y), (n = Y - 1), n < 0 && (n = e.length - 1);
  69526. var r = 0,
  69527. o = E + 2 * y;
  69528. for (r = 0; r < o; r++) {
  69529. var a = z * r,
  69530. s = z * (r + 1),
  69531. l = t + i + a,
  69532. c = t + n + a,
  69533. u = t + n + s,
  69534. d = t + i + s;
  69535. h(l, c, u, d, e, r, o, i, n);
  69536. }
  69537. }
  69538. }
  69539. function l(e, t, i) {
  69540. M.vertices.push(new n.Vector3(e, t, i));
  69541. }
  69542. function c(e, t, i) {
  69543. (e += R),
  69544. (t += R),
  69545. (i += R),
  69546. M.faces.push(new n.Face3(e, t, i, null, null, 0));
  69547. var r = _.generateTopUV(M, e, t, i);
  69548. M.faceVertexUvs[0].push(r);
  69549. }
  69550. function h(e, t, i, r, o, a, s, l, c) {
  69551. (e += R),
  69552. (t += R),
  69553. (i += R),
  69554. (r += R),
  69555. M.faces.push(new n.Face3(e, t, r, null, null, 1)),
  69556. M.faces.push(new n.Face3(t, i, r, null, null, 1));
  69557. var h = _.generateSideWallUV(M, e, t, i, r);
  69558. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  69559. M.faceVertexUvs[0].push([h[1], h[2], h[3]]);
  69560. }
  69561. var u,
  69562. d,
  69563. p,
  69564. f,
  69565. g,
  69566. m = void 0 !== t.amount ? t.amount : 100,
  69567. v = void 0 !== t.bevelThickness ? t.bevelThickness : 6,
  69568. A = void 0 !== t.bevelSize ? t.bevelSize : v - 2,
  69569. y = void 0 !== t.bevelSegments ? t.bevelSegments : 3,
  69570. C = void 0 === t.bevelEnabled || t.bevelEnabled,
  69571. I = void 0 !== t.curveSegments ? t.curveSegments : 12,
  69572. E = void 0 !== t.steps ? t.steps : 1,
  69573. b = t.extrudePath,
  69574. w = !1,
  69575. _ =
  69576. void 0 !== t.UVGenerator
  69577. ? t.UVGenerator
  69578. : n.ExtrudeGeometry.WorldUVGenerator;
  69579. b &&
  69580. ((u = b.getSpacedPoints(E)),
  69581. (w = !0),
  69582. (C = !1),
  69583. (d =
  69584. void 0 !== t.frames
  69585. ? t.frames
  69586. : new n.TubeGeometry.FrenetFrames(b, E, !1)),
  69587. (p = new n.Vector3()),
  69588. (f = new n.Vector3()),
  69589. (g = new n.Vector3())),
  69590. C || ((y = 0), (v = 0), (A = 0));
  69591. var T,
  69592. x,
  69593. S,
  69594. M = this,
  69595. R = this.vertices.length,
  69596. P = e.extractPoints(I),
  69597. O = P.shape,
  69598. L = P.holes,
  69599. D = !n.ShapeUtils.isClockWise(O);
  69600. if (D) {
  69601. for (O = O.reverse(), x = 0, S = L.length; x < S; x++)
  69602. (T = L[x]), n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  69603. D = !1;
  69604. }
  69605. var N = n.ShapeUtils.triangulateShape(O, L),
  69606. B = O;
  69607. for (x = 0, S = L.length; x < S; x++) (T = L[x]), (O = O.concat(T));
  69608. for (
  69609. var F,
  69610. V,
  69611. U,
  69612. k,
  69613. H,
  69614. G,
  69615. z = O.length,
  69616. W = N.length,
  69617. j = [],
  69618. Y = 0,
  69619. X = B.length,
  69620. Z = X - 1,
  69621. q = Y + 1;
  69622. Y < X;
  69623. Y++, Z++, q++
  69624. )
  69625. Z === X && (Z = 0),
  69626. q === X && (q = 0),
  69627. (j[Y] = r(B[Y], B[Z], B[q]));
  69628. var K,
  69629. Q = [],
  69630. J = j.concat();
  69631. for (x = 0, S = L.length; x < S; x++) {
  69632. for (
  69633. T = L[x], K = [], Y = 0, X = T.length, Z = X - 1, q = Y + 1;
  69634. Y < X;
  69635. Y++, Z++, q++
  69636. )
  69637. Z === X && (Z = 0),
  69638. q === X && (q = 0),
  69639. (K[Y] = r(T[Y], T[Z], T[q]));
  69640. Q.push(K), (J = J.concat(K));
  69641. }
  69642. for (F = 0; F < y; F++) {
  69643. for (
  69644. U = F / y,
  69645. k = v * (1 - U),
  69646. V = A * Math.sin((U * Math.PI) / 2),
  69647. Y = 0,
  69648. X = B.length;
  69649. Y < X;
  69650. Y++
  69651. )
  69652. (H = i(B[Y], j[Y], V)), l(H.x, H.y, -k);
  69653. for (x = 0, S = L.length; x < S; x++)
  69654. for (T = L[x], K = Q[x], Y = 0, X = T.length; Y < X; Y++)
  69655. (H = i(T[Y], K[Y], V)), l(H.x, H.y, -k);
  69656. }
  69657. for (V = A, Y = 0; Y < z; Y++)
  69658. (H = C ? i(O[Y], J[Y], V) : O[Y]),
  69659. w
  69660. ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  69661. p.copy(d.binormals[0]).multiplyScalar(H.y),
  69662. g.copy(u[0]).add(f).add(p),
  69663. l(g.x, g.y, g.z))
  69664. : l(H.x, H.y, 0);
  69665. var $;
  69666. for ($ = 1; $ <= E; $++)
  69667. for (Y = 0; Y < z; Y++)
  69668. (H = C ? i(O[Y], J[Y], V) : O[Y]),
  69669. w
  69670. ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  69671. p.copy(d.binormals[$]).multiplyScalar(H.y),
  69672. g.copy(u[$]).add(f).add(p),
  69673. l(g.x, g.y, g.z))
  69674. : l(H.x, H.y, (m / E) * $);
  69675. for (F = y - 1; F >= 0; F--) {
  69676. for (
  69677. U = F / y,
  69678. k = v * (1 - U),
  69679. V = A * Math.sin((U * Math.PI) / 2),
  69680. Y = 0,
  69681. X = B.length;
  69682. Y < X;
  69683. Y++
  69684. )
  69685. (H = i(B[Y], j[Y], V)), l(H.x, H.y, m + k);
  69686. for (x = 0, S = L.length; x < S; x++)
  69687. for (T = L[x], K = Q[x], Y = 0, X = T.length; Y < X; Y++)
  69688. (H = i(T[Y], K[Y], V)),
  69689. w
  69690. ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k)
  69691. : l(H.x, H.y, m + k);
  69692. }
  69693. o(), a();
  69694. }),
  69695. (n.ExtrudeGeometry.WorldUVGenerator = {
  69696. generateTopUV: function (e, t, i, r) {
  69697. var o = e.vertices,
  69698. a = o[t],
  69699. s = o[i],
  69700. l = o[r];
  69701. return [
  69702. new n.Vector2(a.x, a.y),
  69703. new n.Vector2(s.x, s.y),
  69704. new n.Vector2(l.x, l.y),
  69705. ];
  69706. },
  69707. generateSideWallUV: function (e, t, i, r, o) {
  69708. var a = e.vertices,
  69709. s = a[t],
  69710. l = a[i],
  69711. c = a[r],
  69712. h = a[o];
  69713. return Math.abs(s.y - l.y) < 0.01
  69714. ? [
  69715. new n.Vector2(s.x, 1 - s.z),
  69716. new n.Vector2(l.x, 1 - l.z),
  69717. new n.Vector2(c.x, 1 - c.z),
  69718. new n.Vector2(h.x, 1 - h.z),
  69719. ]
  69720. : [
  69721. new n.Vector2(s.y, 1 - s.z),
  69722. new n.Vector2(l.y, 1 - l.z),
  69723. new n.Vector2(c.y, 1 - c.z),
  69724. new n.Vector2(h.y, 1 - h.z),
  69725. ];
  69726. },
  69727. }),
  69728. (n.ShapeGeometry = function (e, t) {
  69729. n.Geometry.call(this),
  69730. (this.type = "ShapeGeometry"),
  69731. Array.isArray(e) === !1 && (e = [e]),
  69732. this.addShapeList(e, t),
  69733. this.computeFaceNormals();
  69734. }),
  69735. (n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype)),
  69736. (n.ShapeGeometry.prototype.constructor = n.ShapeGeometry),
  69737. (n.ShapeGeometry.prototype.addShapeList = function (e, t) {
  69738. for (var i = 0, n = e.length; i < n; i++) this.addShape(e[i], t);
  69739. return this;
  69740. }),
  69741. (n.ShapeGeometry.prototype.addShape = function (e, t) {
  69742. void 0 === t && (t = {});
  69743. var i,
  69744. r,
  69745. o,
  69746. a = void 0 !== t.curveSegments ? t.curveSegments : 12,
  69747. s = t.material,
  69748. l =
  69749. void 0 === t.UVGenerator
  69750. ? n.ExtrudeGeometry.WorldUVGenerator
  69751. : t.UVGenerator,
  69752. c = this.vertices.length,
  69753. h = e.extractPoints(a),
  69754. u = h.shape,
  69755. d = h.holes,
  69756. p = !n.ShapeUtils.isClockWise(u);
  69757. if (p) {
  69758. for (u = u.reverse(), i = 0, r = d.length; i < r; i++)
  69759. (o = d[i]), n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  69760. p = !1;
  69761. }
  69762. var f = n.ShapeUtils.triangulateShape(u, d);
  69763. for (i = 0, r = d.length; i < r; i++) (o = d[i]), (u = u.concat(o));
  69764. var g,
  69765. m,
  69766. v = u.length,
  69767. A = f.length;
  69768. for (i = 0; i < v; i++)
  69769. (g = u[i]), this.vertices.push(new n.Vector3(g.x, g.y, 0));
  69770. for (i = 0; i < A; i++) {
  69771. m = f[i];
  69772. var y = m[0] + c,
  69773. C = m[1] + c,
  69774. I = m[2] + c;
  69775. this.faces.push(new n.Face3(y, C, I, null, null, s)),
  69776. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I));
  69777. }
  69778. }),
  69779. (n.LatheBufferGeometry = function (e, t, i, r) {
  69780. n.BufferGeometry.call(this),
  69781. (this.type = "LatheBufferGeometry"),
  69782. (this.parameters = {
  69783. points: e,
  69784. segments: t,
  69785. phiStart: i,
  69786. phiLength: r,
  69787. }),
  69788. (t = Math.floor(t) || 12),
  69789. (i = i || 0),
  69790. (r = r || 2 * Math.PI),
  69791. (r = n.Math.clamp(r, 0, 2 * Math.PI));
  69792. var o,
  69793. a,
  69794. s,
  69795. l = (t + 1) * e.length,
  69796. c = t * e.length * 2 * 3,
  69797. h = new n.BufferAttribute(
  69798. new (c > 65535 ? Uint32Array : Uint16Array)(c),
  69799. 1
  69800. ),
  69801. u = new n.BufferAttribute(new Float32Array(3 * l), 3),
  69802. d = new n.BufferAttribute(new Float32Array(2 * l), 2),
  69803. p = 0,
  69804. f = 0,
  69805. g = (1 / (e.length - 1), 1 / t),
  69806. m = new n.Vector3(),
  69807. v = new n.Vector2();
  69808. for (a = 0; a <= t; a++) {
  69809. var A = i + a * g * r,
  69810. y = Math.sin(A),
  69811. C = Math.cos(A);
  69812. for (s = 0; s <= e.length - 1; s++)
  69813. (m.x = e[s].x * y),
  69814. (m.y = e[s].y),
  69815. (m.z = e[s].x * C),
  69816. u.setXYZ(p, m.x, m.y, m.z),
  69817. (v.x = a / t),
  69818. (v.y = s / (e.length - 1)),
  69819. d.setXY(p, v.x, v.y),
  69820. p++;
  69821. }
  69822. for (a = 0; a < t; a++)
  69823. for (s = 0; s < e.length - 1; s++) {
  69824. o = s + a * e.length;
  69825. var I = o,
  69826. E = o + e.length,
  69827. b = o + e.length + 1,
  69828. w = o + 1;
  69829. h.setX(f, I),
  69830. f++,
  69831. h.setX(f, E),
  69832. f++,
  69833. h.setX(f, w),
  69834. f++,
  69835. h.setX(f, E),
  69836. f++,
  69837. h.setX(f, b),
  69838. f++,
  69839. h.setX(f, w),
  69840. f++;
  69841. }
  69842. if (
  69843. (this.setIndex(h),
  69844. this.addAttribute("position", u),
  69845. this.addAttribute("uv", d),
  69846. this.computeVertexNormals(),
  69847. r === 2 * Math.PI)
  69848. ) {
  69849. var _ = this.attributes.normal.array,
  69850. T = new n.Vector3(),
  69851. x = new n.Vector3(),
  69852. S = new n.Vector3();
  69853. for (
  69854. o = t * e.length * 3, a = 0, s = 0;
  69855. a < e.length;
  69856. a++, s += 3
  69857. )
  69858. (T.x = _[s + 0]),
  69859. (T.y = _[s + 1]),
  69860. (T.z = _[s + 2]),
  69861. (x.x = _[o + s + 0]),
  69862. (x.y = _[o + s + 1]),
  69863. (x.z = _[o + s + 2]),
  69864. S.addVectors(T, x).normalize(),
  69865. (_[s + 0] = _[o + s + 0] = S.x),
  69866. (_[s + 1] = _[o + s + 1] = S.y),
  69867. (_[s + 2] = _[o + s + 2] = S.z);
  69868. }
  69869. }),
  69870. (n.LatheBufferGeometry.prototype = Object.create(
  69871. n.BufferGeometry.prototype
  69872. )),
  69873. (n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry),
  69874. (n.LatheGeometry = function (e, t, i, r) {
  69875. n.Geometry.call(this),
  69876. (this.type = "LatheGeometry"),
  69877. (this.parameters = {
  69878. points: e,
  69879. segments: t,
  69880. phiStart: i,
  69881. phiLength: r,
  69882. }),
  69883. this.fromBufferGeometry(new n.LatheBufferGeometry(e, t, i, r)),
  69884. this.mergeVertices();
  69885. }),
  69886. (n.LatheGeometry.prototype = Object.create(n.Geometry.prototype)),
  69887. (n.LatheGeometry.prototype.constructor = n.LatheGeometry),
  69888. (n.PlaneGeometry = function (e, t, i, r) {
  69889. n.Geometry.call(this),
  69890. (this.type = "PlaneGeometry"),
  69891. (this.parameters = {
  69892. width: e,
  69893. height: t,
  69894. widthSegments: i,
  69895. heightSegments: r,
  69896. }),
  69897. this.fromBufferGeometry(new n.PlaneBufferGeometry(e, t, i, r));
  69898. }),
  69899. (n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype)),
  69900. (n.PlaneGeometry.prototype.constructor = n.PlaneGeometry),
  69901. (n.PlaneBufferGeometry = function (e, t, i, r) {
  69902. n.BufferGeometry.call(this),
  69903. (this.type = "PlaneBufferGeometry"),
  69904. (this.parameters = {
  69905. width: e,
  69906. height: t,
  69907. widthSegments: i,
  69908. heightSegments: r,
  69909. });
  69910. for (
  69911. var o = e / 2,
  69912. a = t / 2,
  69913. s = Math.floor(i) || 1,
  69914. l = Math.floor(r) || 1,
  69915. c = s + 1,
  69916. h = l + 1,
  69917. u = e / s,
  69918. d = t / l,
  69919. p = new Float32Array(c * h * 3),
  69920. f = new Float32Array(c * h * 3),
  69921. g = new Float32Array(c * h * 2),
  69922. m = 0,
  69923. v = 0,
  69924. A = 0;
  69925. A < h;
  69926. A++
  69927. )
  69928. for (var y = A * d - a, C = 0; C < c; C++) {
  69929. var I = C * u - o;
  69930. (p[m] = I),
  69931. (p[m + 1] = -y),
  69932. (f[m + 2] = 1),
  69933. (g[v] = C / s),
  69934. (g[v + 1] = 1 - A / l),
  69935. (m += 3),
  69936. (v += 2);
  69937. }
  69938. m = 0;
  69939. for (
  69940. var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(
  69941. s * l * 6
  69942. ),
  69943. A = 0;
  69944. A < l;
  69945. A++
  69946. )
  69947. for (var C = 0; C < s; C++) {
  69948. var b = C + c * A,
  69949. w = C + c * (A + 1),
  69950. _ = C + 1 + c * (A + 1),
  69951. T = C + 1 + c * A;
  69952. (E[m] = b),
  69953. (E[m + 1] = w),
  69954. (E[m + 2] = T),
  69955. (E[m + 3] = w),
  69956. (E[m + 4] = _),
  69957. (E[m + 5] = T),
  69958. (m += 6);
  69959. }
  69960. this.setIndex(new n.BufferAttribute(E, 1)),
  69961. this.addAttribute("position", new n.BufferAttribute(p, 3)),
  69962. this.addAttribute("normal", new n.BufferAttribute(f, 3)),
  69963. this.addAttribute("uv", new n.BufferAttribute(g, 2));
  69964. }),
  69965. (n.PlaneBufferGeometry.prototype = Object.create(
  69966. n.BufferGeometry.prototype
  69967. )),
  69968. (n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry),
  69969. (n.RingBufferGeometry = function (e, t, i, r, o, a) {
  69970. n.BufferGeometry.call(this),
  69971. (this.type = "RingBufferGeometry"),
  69972. (this.parameters = {
  69973. innerRadius: e,
  69974. outerRadius: t,
  69975. thetaSegments: i,
  69976. phiSegments: r,
  69977. thetaStart: o,
  69978. thetaLength: a,
  69979. }),
  69980. (e = e || 20),
  69981. (t = t || 50),
  69982. (o = void 0 !== o ? o : 0),
  69983. (a = void 0 !== a ? a : 2 * Math.PI),
  69984. (i = void 0 !== i ? Math.max(3, i) : 8),
  69985. (r = void 0 !== r ? Math.max(1, r) : 1);
  69986. var s,
  69987. l,
  69988. c,
  69989. h = (i + 1) * (r + 1),
  69990. u = i * r * 2 * 3,
  69991. d = new n.BufferAttribute(
  69992. new (u > 65535 ? Uint32Array : Uint16Array)(u),
  69993. 1
  69994. ),
  69995. p = new n.BufferAttribute(new Float32Array(3 * h), 3),
  69996. f = new n.BufferAttribute(new Float32Array(3 * h), 3),
  69997. g = new n.BufferAttribute(new Float32Array(2 * h), 2),
  69998. m = 0,
  69999. v = 0,
  70000. A = e,
  70001. y = (t - e) / r,
  70002. C = new n.Vector3(),
  70003. I = new n.Vector2();
  70004. for (l = 0; l <= r; l++) {
  70005. for (c = 0; c <= i; c++)
  70006. (s = o + (c / i) * a),
  70007. (C.x = A * Math.cos(s)),
  70008. (C.y = A * Math.sin(s)),
  70009. p.setXYZ(m, C.x, C.y, C.z),
  70010. f.setXYZ(m, 0, 0, 1),
  70011. (I.x = (C.x / t + 1) / 2),
  70012. (I.y = (C.y / t + 1) / 2),
  70013. g.setXY(m, I.x, I.y),
  70014. m++;
  70015. A += y;
  70016. }
  70017. for (l = 0; l < r; l++) {
  70018. var E = l * (i + 1);
  70019. for (c = 0; c < i; c++) {
  70020. s = c + E;
  70021. var b = s,
  70022. w = s + i + 1,
  70023. _ = s + i + 2,
  70024. T = s + 1;
  70025. d.setX(v, b),
  70026. v++,
  70027. d.setX(v, w),
  70028. v++,
  70029. d.setX(v, _),
  70030. v++,
  70031. d.setX(v, b),
  70032. v++,
  70033. d.setX(v, _),
  70034. v++,
  70035. d.setX(v, T),
  70036. v++;
  70037. }
  70038. }
  70039. this.setIndex(d),
  70040. this.addAttribute("position", p),
  70041. this.addAttribute("normal", f),
  70042. this.addAttribute("uv", g);
  70043. }),
  70044. (n.RingBufferGeometry.prototype = Object.create(
  70045. n.BufferGeometry.prototype
  70046. )),
  70047. (n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry),
  70048. (n.RingGeometry = function (e, t, i, r, o, a) {
  70049. n.Geometry.call(this),
  70050. (this.type = "RingGeometry"),
  70051. (this.parameters = {
  70052. innerRadius: e,
  70053. outerRadius: t,
  70054. thetaSegments: i,
  70055. phiSegments: r,
  70056. thetaStart: o,
  70057. thetaLength: a,
  70058. }),
  70059. this.fromBufferGeometry(
  70060. new n.RingBufferGeometry(e, t, i, r, o, a)
  70061. );
  70062. }),
  70063. (n.RingGeometry.prototype = Object.create(n.Geometry.prototype)),
  70064. (n.RingGeometry.prototype.constructor = n.RingGeometry),
  70065. (n.SphereGeometry = function (e, t, i, r, o, a, s) {
  70066. n.Geometry.call(this),
  70067. (this.type = "SphereGeometry"),
  70068. (this.parameters = {
  70069. radius: e,
  70070. widthSegments: t,
  70071. heightSegments: i,
  70072. phiStart: r,
  70073. phiLength: o,
  70074. thetaStart: a,
  70075. thetaLength: s,
  70076. }),
  70077. this.fromBufferGeometry(
  70078. new n.SphereBufferGeometry(e, t, i, r, o, a, s)
  70079. );
  70080. }),
  70081. (n.SphereGeometry.prototype = Object.create(n.Geometry.prototype)),
  70082. (n.SphereGeometry.prototype.constructor = n.SphereGeometry),
  70083. (n.SphereBufferGeometry = function (e, t, i, r, o, a, s) {
  70084. n.BufferGeometry.call(this),
  70085. (this.type = "SphereBufferGeometry"),
  70086. (this.parameters = {
  70087. radius: e,
  70088. widthSegments: t,
  70089. heightSegments: i,
  70090. phiStart: r,
  70091. phiLength: o,
  70092. thetaStart: a,
  70093. thetaLength: s,
  70094. }),
  70095. (e = e || 50),
  70096. (t = Math.max(3, Math.floor(t) || 8)),
  70097. (i = Math.max(2, Math.floor(i) || 6)),
  70098. (r = void 0 !== r ? r : 0),
  70099. (o = void 0 !== o ? o : 2 * Math.PI),
  70100. (a = void 0 !== a ? a : 0),
  70101. (s = void 0 !== s ? s : Math.PI);
  70102. for (
  70103. var l = a + s,
  70104. c = (t + 1) * (i + 1),
  70105. h = new n.BufferAttribute(new Float32Array(3 * c), 3),
  70106. u = new n.BufferAttribute(new Float32Array(3 * c), 3),
  70107. d = new n.BufferAttribute(new Float32Array(2 * c), 2),
  70108. p = 0,
  70109. f = [],
  70110. g = new n.Vector3(),
  70111. m = 0;
  70112. m <= i;
  70113. m++
  70114. ) {
  70115. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  70116. var C = y / t,
  70117. I = -e * Math.cos(r + C * o) * Math.sin(a + A * s),
  70118. E = e * Math.cos(a + A * s),
  70119. b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  70120. g.set(I, E, b).normalize(),
  70121. h.setXYZ(p, I, E, b),
  70122. u.setXYZ(p, g.x, g.y, g.z),
  70123. d.setXY(p, C, 1 - A),
  70124. v.push(p),
  70125. p++;
  70126. }
  70127. f.push(v);
  70128. }
  70129. for (var w = [], m = 0; m < i; m++)
  70130. for (var y = 0; y < t; y++) {
  70131. var _ = f[m][y + 1],
  70132. T = f[m][y],
  70133. x = f[m + 1][y],
  70134. S = f[m + 1][y + 1];
  70135. (0 !== m || a > 0) && w.push(_, T, S),
  70136. (m !== i - 1 || l < Math.PI) && w.push(T, x, S);
  70137. }
  70138. this.setIndex(
  70139. new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(
  70140. w,
  70141. 1
  70142. )
  70143. ),
  70144. this.addAttribute("position", h),
  70145. this.addAttribute("normal", u),
  70146. this.addAttribute("uv", d),
  70147. (this.boundingSphere = new n.Sphere(new n.Vector3(), e));
  70148. }),
  70149. (n.SphereBufferGeometry.prototype = Object.create(
  70150. n.BufferGeometry.prototype
  70151. )),
  70152. (n.SphereBufferGeometry.prototype.constructor =
  70153. n.SphereBufferGeometry),
  70154. (n.TextGeometry = function (e, t) {
  70155. t = t || {};
  70156. var i = t.font;
  70157. if (i instanceof n.Font == !1)
  70158. return (
  70159. console.error(
  70160. "THREE.TextGeometry: font parameter is not an instance of THREE.Font."
  70161. ),
  70162. new n.Geometry()
  70163. );
  70164. var r = i.generateShapes(e, t.size, t.curveSegments);
  70165. (t.amount = void 0 !== t.height ? t.height : 50),
  70166. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  70167. void 0 === t.bevelSize && (t.bevelSize = 8),
  70168. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  70169. n.ExtrudeGeometry.call(this, r, t),
  70170. (this.type = "TextGeometry");
  70171. }),
  70172. (n.TextGeometry.prototype = Object.create(
  70173. n.ExtrudeGeometry.prototype
  70174. )),
  70175. (n.TextGeometry.prototype.constructor = n.TextGeometry),
  70176. (n.TorusBufferGeometry = function (e, t, i, r, o) {
  70177. n.BufferGeometry.call(this),
  70178. (this.type = "TorusBufferGeometry"),
  70179. (this.parameters = {
  70180. radius: e,
  70181. tube: t,
  70182. radialSegments: i,
  70183. tubularSegments: r,
  70184. arc: o,
  70185. }),
  70186. (e = e || 100),
  70187. (t = t || 40),
  70188. (i = Math.floor(i) || 8),
  70189. (r = Math.floor(r) || 6),
  70190. (o = o || 2 * Math.PI);
  70191. var a,
  70192. s,
  70193. l = (i + 1) * (r + 1),
  70194. c = i * r * 2 * 3,
  70195. h = new (c > 65535 ? Uint32Array : Uint16Array)(c),
  70196. u = new Float32Array(3 * l),
  70197. d = new Float32Array(3 * l),
  70198. p = new Float32Array(2 * l),
  70199. f = 0,
  70200. g = 0,
  70201. m = 0,
  70202. v = new n.Vector3(),
  70203. A = new n.Vector3(),
  70204. y = new n.Vector3();
  70205. for (a = 0; a <= i; a++)
  70206. for (s = 0; s <= r; s++) {
  70207. var C = (s / r) * o,
  70208. I = (a / i) * Math.PI * 2;
  70209. (A.x = (e + t * Math.cos(I)) * Math.cos(C)),
  70210. (A.y = (e + t * Math.cos(I)) * Math.sin(C)),
  70211. (A.z = t * Math.sin(I)),
  70212. (u[f] = A.x),
  70213. (u[f + 1] = A.y),
  70214. (u[f + 2] = A.z),
  70215. (v.x = e * Math.cos(C)),
  70216. (v.y = e * Math.sin(C)),
  70217. y.subVectors(A, v).normalize(),
  70218. (d[f] = y.x),
  70219. (d[f + 1] = y.y),
  70220. (d[f + 2] = y.z),
  70221. (p[g] = s / r),
  70222. (p[g + 1] = a / i),
  70223. (f += 3),
  70224. (g += 2);
  70225. }
  70226. for (a = 1; a <= i; a++)
  70227. for (s = 1; s <= r; s++) {
  70228. var E = (r + 1) * a + s - 1,
  70229. b = (r + 1) * (a - 1) + s - 1,
  70230. w = (r + 1) * (a - 1) + s,
  70231. _ = (r + 1) * a + s;
  70232. (h[m] = E),
  70233. (h[m + 1] = b),
  70234. (h[m + 2] = _),
  70235. (h[m + 3] = b),
  70236. (h[m + 4] = w),
  70237. (h[m + 5] = _),
  70238. (m += 6);
  70239. }
  70240. this.setIndex(new n.BufferAttribute(h, 1)),
  70241. this.addAttribute("position", new n.BufferAttribute(u, 3)),
  70242. this.addAttribute("normal", new n.BufferAttribute(d, 3)),
  70243. this.addAttribute("uv", new n.BufferAttribute(p, 2));
  70244. }),
  70245. (n.TorusBufferGeometry.prototype = Object.create(
  70246. n.BufferGeometry.prototype
  70247. )),
  70248. (n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry),
  70249. (n.TorusGeometry = function (e, t, i, r, o) {
  70250. n.Geometry.call(this),
  70251. (this.type = "TorusGeometry"),
  70252. (this.parameters = {
  70253. radius: e,
  70254. tube: t,
  70255. radialSegments: i,
  70256. tubularSegments: r,
  70257. arc: o,
  70258. }),
  70259. this.fromBufferGeometry(new n.TorusBufferGeometry(e, t, i, r, o));
  70260. }),
  70261. (n.TorusGeometry.prototype = Object.create(n.Geometry.prototype)),
  70262. (n.TorusGeometry.prototype.constructor = n.TorusGeometry),
  70263. (n.TorusKnotBufferGeometry = function (e, t, i, r, o, a) {
  70264. function s(e, t, i, n, r) {
  70265. var o = Math.cos(e),
  70266. a = Math.sin(e),
  70267. s = (i / t) * e,
  70268. l = Math.cos(s);
  70269. (r.x = n * (2 + l) * 0.5 * o),
  70270. (r.y = n * (2 + l) * a * 0.5),
  70271. (r.z = n * Math.sin(s) * 0.5);
  70272. }
  70273. n.BufferGeometry.call(this),
  70274. (this.type = "TorusKnotBufferGeometry"),
  70275. (this.parameters = {
  70276. radius: e,
  70277. tube: t,
  70278. tubularSegments: i,
  70279. radialSegments: r,
  70280. p: o,
  70281. q: a,
  70282. }),
  70283. (e = e || 100),
  70284. (t = t || 40),
  70285. (i = Math.floor(i) || 64),
  70286. (r = Math.floor(r) || 8),
  70287. (o = o || 2),
  70288. (a = a || 3);
  70289. var l,
  70290. c,
  70291. h = (r + 1) * (i + 1),
  70292. u = r * i * 2 * 3,
  70293. d = new n.BufferAttribute(
  70294. new (u > 65535 ? Uint32Array : Uint16Array)(u),
  70295. 1
  70296. ),
  70297. p = new n.BufferAttribute(new Float32Array(3 * h), 3),
  70298. f = new n.BufferAttribute(new Float32Array(3 * h), 3),
  70299. g = new n.BufferAttribute(new Float32Array(2 * h), 2),
  70300. m = 0,
  70301. v = 0,
  70302. A = new n.Vector3(),
  70303. y = new n.Vector3(),
  70304. C = new n.Vector2(),
  70305. I = new n.Vector3(),
  70306. E = new n.Vector3(),
  70307. b = new n.Vector3(),
  70308. w = new n.Vector3(),
  70309. _ = new n.Vector3();
  70310. for (l = 0; l <= i; ++l) {
  70311. var T = (l / i) * o * Math.PI * 2;
  70312. for (
  70313. s(T, o, a, e, I),
  70314. s(T + 0.01, o, a, e, E),
  70315. w.subVectors(E, I),
  70316. _.addVectors(E, I),
  70317. b.crossVectors(w, _),
  70318. _.crossVectors(b, w),
  70319. b.normalize(),
  70320. _.normalize(),
  70321. c = 0;
  70322. c <= r;
  70323. ++c
  70324. ) {
  70325. var x = (c / r) * Math.PI * 2,
  70326. S = -t * Math.cos(x),
  70327. M = t * Math.sin(x);
  70328. (A.x = I.x + (S * _.x + M * b.x)),
  70329. (A.y = I.y + (S * _.y + M * b.y)),
  70330. (A.z = I.z + (S * _.z + M * b.z)),
  70331. p.setXYZ(m, A.x, A.y, A.z),
  70332. y.subVectors(A, I).normalize(),
  70333. f.setXYZ(m, y.x, y.y, y.z),
  70334. (C.x = l / i),
  70335. (C.y = c / r),
  70336. g.setXY(m, C.x, C.y),
  70337. m++;
  70338. }
  70339. }
  70340. for (c = 1; c <= i; c++)
  70341. for (l = 1; l <= r; l++) {
  70342. var R = (r + 1) * (c - 1) + (l - 1),
  70343. P = (r + 1) * c + (l - 1),
  70344. O = (r + 1) * c + l,
  70345. L = (r + 1) * (c - 1) + l;
  70346. d.setX(v, R),
  70347. v++,
  70348. d.setX(v, P),
  70349. v++,
  70350. d.setX(v, L),
  70351. v++,
  70352. d.setX(v, P),
  70353. v++,
  70354. d.setX(v, O),
  70355. v++,
  70356. d.setX(v, L),
  70357. v++;
  70358. }
  70359. this.setIndex(d),
  70360. this.addAttribute("position", p),
  70361. this.addAttribute("normal", f),
  70362. this.addAttribute("uv", g);
  70363. }),
  70364. (n.TorusKnotBufferGeometry.prototype = Object.create(
  70365. n.BufferGeometry.prototype
  70366. )),
  70367. (n.TorusKnotBufferGeometry.prototype.constructor =
  70368. n.TorusKnotBufferGeometry),
  70369. (n.TorusKnotGeometry = function (e, t, i, r, o, a, s) {
  70370. n.Geometry.call(this),
  70371. (this.type = "TorusKnotGeometry"),
  70372. (this.parameters = {
  70373. radius: e,
  70374. tube: t,
  70375. tubularSegments: i,
  70376. radialSegments: r,
  70377. p: o,
  70378. q: a,
  70379. }),
  70380. void 0 !== s &&
  70381. console.warn(
  70382. "THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."
  70383. ),
  70384. this.fromBufferGeometry(
  70385. new n.TorusKnotBufferGeometry(e, t, i, r, o, a)
  70386. ),
  70387. this.mergeVertices();
  70388. }),
  70389. (n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype)),
  70390. (n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry),
  70391. (n.TubeGeometry = function (e, t, i, r, o, a) {
  70392. function s(e, t, i) {
  70393. return R.vertices.push(new n.Vector3(e, t, i)) - 1;
  70394. }
  70395. n.Geometry.call(this),
  70396. (this.type = "TubeGeometry"),
  70397. (this.parameters = {
  70398. path: e,
  70399. segments: t,
  70400. radius: i,
  70401. radialSegments: r,
  70402. closed: o,
  70403. taper: a,
  70404. }),
  70405. (t = t || 64),
  70406. (i = i || 1),
  70407. (r = r || 8),
  70408. (o = o || !1),
  70409. (a = a || n.TubeGeometry.NoTaper);
  70410. var l,
  70411. c,
  70412. h,
  70413. u,
  70414. d,
  70415. p,
  70416. f,
  70417. g,
  70418. m,
  70419. v,
  70420. A,
  70421. y,
  70422. C,
  70423. I,
  70424. E,
  70425. b,
  70426. w,
  70427. _,
  70428. T,
  70429. x,
  70430. S,
  70431. M = [],
  70432. R = this,
  70433. P = t + 1,
  70434. O = new n.Vector3(),
  70435. L = new n.TubeGeometry.FrenetFrames(e, t, o),
  70436. D = L.tangents,
  70437. N = L.normals,
  70438. B = L.binormals;
  70439. for (
  70440. this.tangents = D, this.normals = N, this.binormals = B, v = 0;
  70441. v < P;
  70442. v++
  70443. )
  70444. for (
  70445. M[v] = [],
  70446. u = v / (P - 1),
  70447. m = e.getPointAt(u),
  70448. l = D[v],
  70449. c = N[v],
  70450. h = B[v],
  70451. p = i * a(u),
  70452. A = 0;
  70453. A < r;
  70454. A++
  70455. )
  70456. (d = (A / r) * 2 * Math.PI),
  70457. (f = -p * Math.cos(d)),
  70458. (g = p * Math.sin(d)),
  70459. O.copy(m),
  70460. (O.x += f * c.x + g * h.x),
  70461. (O.y += f * c.y + g * h.y),
  70462. (O.z += f * c.z + g * h.z),
  70463. (M[v][A] = s(O.x, O.y, O.z));
  70464. for (v = 0; v < t; v++)
  70465. for (A = 0; A < r; A++)
  70466. (y = o ? (v + 1) % t : v + 1),
  70467. (C = (A + 1) % r),
  70468. (I = M[v][A]),
  70469. (E = M[y][A]),
  70470. (b = M[y][C]),
  70471. (w = M[v][C]),
  70472. (_ = new n.Vector2(v / t, A / r)),
  70473. (T = new n.Vector2((v + 1) / t, A / r)),
  70474. (x = new n.Vector2((v + 1) / t, (A + 1) / r)),
  70475. (S = new n.Vector2(v / t, (A + 1) / r)),
  70476. this.faces.push(new n.Face3(I, E, w)),
  70477. this.faceVertexUvs[0].push([_, T, S]),
  70478. this.faces.push(new n.Face3(E, b, w)),
  70479. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  70480. this.computeFaceNormals(), this.computeVertexNormals();
  70481. }),
  70482. (n.TubeGeometry.prototype = Object.create(n.Geometry.prototype)),
  70483. (n.TubeGeometry.prototype.constructor = n.TubeGeometry),
  70484. (n.TubeGeometry.NoTaper = function (e) {
  70485. return 1;
  70486. }),
  70487. (n.TubeGeometry.SinusoidalTaper = function (e) {
  70488. return Math.sin(Math.PI * e);
  70489. }),
  70490. (n.TubeGeometry.FrenetFrames = function (e, t, i) {
  70491. function r() {
  70492. (f[0] = new n.Vector3()),
  70493. (g[0] = new n.Vector3()),
  70494. (a = Number.MAX_VALUE),
  70495. (s = Math.abs(p[0].x)),
  70496. (l = Math.abs(p[0].y)),
  70497. (c = Math.abs(p[0].z)),
  70498. s <= a && ((a = s), d.set(1, 0, 0)),
  70499. l <= a && ((a = l), d.set(0, 1, 0)),
  70500. c <= a && d.set(0, 0, 1),
  70501. m.crossVectors(p[0], d).normalize(),
  70502. f[0].crossVectors(p[0], m),
  70503. g[0].crossVectors(p[0], f[0]);
  70504. }
  70505. var o,
  70506. a,
  70507. s,
  70508. l,
  70509. c,
  70510. h,
  70511. u,
  70512. d = new n.Vector3(),
  70513. p = [],
  70514. f = [],
  70515. g = [],
  70516. m = new n.Vector3(),
  70517. v = new n.Matrix4(),
  70518. A = t + 1;
  70519. for (
  70520. this.tangents = p, this.normals = f, this.binormals = g, h = 0;
  70521. h < A;
  70522. h++
  70523. )
  70524. (u = h / (A - 1)), (p[h] = e.getTangentAt(u)), p[h].normalize();
  70525. for (r(), h = 1; h < A; h++)
  70526. (f[h] = f[h - 1].clone()),
  70527. (g[h] = g[h - 1].clone()),
  70528. m.crossVectors(p[h - 1], p[h]),
  70529. m.length() > Number.EPSILON &&
  70530. (m.normalize(),
  70531. (o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1))),
  70532. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  70533. g[h].crossVectors(p[h], f[h]);
  70534. if (i)
  70535. for (
  70536. o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  70537. o /= A - 1,
  70538. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  70539. h = 1;
  70540. h < A;
  70541. h++
  70542. )
  70543. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  70544. g[h].crossVectors(p[h], f[h]);
  70545. }),
  70546. (n.PolyhedronGeometry = function (e, t, i, r) {
  70547. function o(e) {
  70548. var t = e.normalize().clone();
  70549. t.index = u.vertices.push(t) - 1;
  70550. var i = l(e) / 2 / Math.PI + 0.5,
  70551. r = c(e) / Math.PI + 0.5;
  70552. return (t.uv = new n.Vector2(i, 1 - r)), t;
  70553. }
  70554. function a(e, t, i, r) {
  70555. var o = new n.Face3(
  70556. e.index,
  70557. t.index,
  70558. i.index,
  70559. [e.clone(), t.clone(), i.clone()],
  70560. void 0,
  70561. r
  70562. );
  70563. u.faces.push(o), C.copy(e).add(t).add(i).divideScalar(3);
  70564. var a = l(C);
  70565. u.faceVertexUvs[0].push([
  70566. h(e.uv, e, a),
  70567. h(t.uv, t, a),
  70568. h(i.uv, i, a),
  70569. ]);
  70570. }
  70571. function s(e, t) {
  70572. for (
  70573. var i = Math.pow(2, t),
  70574. n = o(u.vertices[e.a]),
  70575. r = o(u.vertices[e.b]),
  70576. s = o(u.vertices[e.c]),
  70577. l = [],
  70578. c = e.materialIndex,
  70579. h = 0;
  70580. h <= i;
  70581. h++
  70582. ) {
  70583. l[h] = [];
  70584. for (
  70585. var d = o(n.clone().lerp(s, h / i)),
  70586. p = o(r.clone().lerp(s, h / i)),
  70587. f = i - h,
  70588. g = 0;
  70589. g <= f;
  70590. g++
  70591. )
  70592. 0 === g && h === i
  70593. ? (l[h][g] = d)
  70594. : (l[h][g] = o(d.clone().lerp(p, g / f)));
  70595. }
  70596. for (var h = 0; h < i; h++)
  70597. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  70598. var m = Math.floor(g / 2);
  70599. g % 2 === 0
  70600. ? a(l[h][m + 1], l[h + 1][m], l[h][m], c)
  70601. : a(l[h][m + 1], l[h + 1][m + 1], l[h + 1][m], c);
  70602. }
  70603. }
  70604. function l(e) {
  70605. return Math.atan2(e.z, -e.x);
  70606. }
  70607. function c(e) {
  70608. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z));
  70609. }
  70610. function h(e, t, i) {
  70611. return (
  70612. i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1, e.y)),
  70613. 0 === t.x &&
  70614. 0 === t.z &&
  70615. (e = new n.Vector2(i / 2 / Math.PI + 0.5, e.y)),
  70616. e.clone()
  70617. );
  70618. }
  70619. n.Geometry.call(this),
  70620. (this.type = "PolyhedronGeometry"),
  70621. (this.parameters = {
  70622. vertices: e,
  70623. indices: t,
  70624. radius: i,
  70625. detail: r,
  70626. }),
  70627. (i = i || 1),
  70628. (r = r || 0);
  70629. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  70630. o(new n.Vector3(e[d], e[d + 1], e[d + 2]));
  70631. for (
  70632. var f = this.vertices, g = [], d = 0, m = 0, p = t.length;
  70633. d < p;
  70634. d += 3, m++
  70635. ) {
  70636. var v = f[t[d]],
  70637. A = f[t[d + 1]],
  70638. y = f[t[d + 2]];
  70639. g[m] = new n.Face3(
  70640. v.index,
  70641. A.index,
  70642. y.index,
  70643. [v.clone(), A.clone(), y.clone()],
  70644. void 0,
  70645. m
  70646. );
  70647. }
  70648. for (var C = new n.Vector3(), d = 0, p = g.length; d < p; d++)
  70649. s(g[d], r);
  70650. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  70651. var I = this.faceVertexUvs[0][d],
  70652. E = I[0].x,
  70653. b = I[1].x,
  70654. w = I[2].x,
  70655. _ = Math.max(E, b, w),
  70656. T = Math.min(E, b, w);
  70657. _ > 0.9 &&
  70658. T < 0.1 &&
  70659. (E < 0.2 && (I[0].x += 1),
  70660. b < 0.2 && (I[1].x += 1),
  70661. w < 0.2 && (I[2].x += 1));
  70662. }
  70663. for (var d = 0, p = this.vertices.length; d < p; d++)
  70664. this.vertices[d].multiplyScalar(i);
  70665. this.mergeVertices(),
  70666. this.computeFaceNormals(),
  70667. (this.boundingSphere = new n.Sphere(new n.Vector3(), i));
  70668. }),
  70669. (n.PolyhedronGeometry.prototype = Object.create(
  70670. n.Geometry.prototype
  70671. )),
  70672. (n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry),
  70673. (n.DodecahedronGeometry = function (e, t) {
  70674. var i = (1 + Math.sqrt(5)) / 2,
  70675. r = 1 / i,
  70676. o = [
  70677. -1,
  70678. -1,
  70679. -1,
  70680. -1,
  70681. -1,
  70682. 1,
  70683. -1,
  70684. 1,
  70685. -1,
  70686. -1,
  70687. 1,
  70688. 1,
  70689. 1,
  70690. -1,
  70691. -1,
  70692. 1,
  70693. -1,
  70694. 1,
  70695. 1,
  70696. 1,
  70697. -1,
  70698. 1,
  70699. 1,
  70700. 1,
  70701. 0,
  70702. -r,
  70703. -i,
  70704. 0,
  70705. -r,
  70706. i,
  70707. 0,
  70708. r,
  70709. -i,
  70710. 0,
  70711. r,
  70712. i,
  70713. -r,
  70714. -i,
  70715. 0,
  70716. -r,
  70717. i,
  70718. 0,
  70719. r,
  70720. -i,
  70721. 0,
  70722. r,
  70723. i,
  70724. 0,
  70725. -i,
  70726. 0,
  70727. -r,
  70728. i,
  70729. 0,
  70730. -r,
  70731. -i,
  70732. 0,
  70733. r,
  70734. i,
  70735. 0,
  70736. r,
  70737. ],
  70738. a = [
  70739. 3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15,
  70740. 17, 4, 8, 17, 8, 10, 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0,
  70741. 12, 1, 0, 1, 18, 0, 18, 16, 6, 10, 2, 6, 2, 13, 6, 13, 15, 2,
  70742. 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4,
  70743. 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19,
  70744. 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9,
  70745. ];
  70746. n.PolyhedronGeometry.call(this, o, a, e, t),
  70747. (this.type = "DodecahedronGeometry"),
  70748. (this.parameters = {
  70749. radius: e,
  70750. detail: t,
  70751. });
  70752. }),
  70753. (n.DodecahedronGeometry.prototype = Object.create(
  70754. n.PolyhedronGeometry.prototype
  70755. )),
  70756. (n.DodecahedronGeometry.prototype.constructor =
  70757. n.DodecahedronGeometry),
  70758. (n.IcosahedronGeometry = function (e, t) {
  70759. var i = (1 + Math.sqrt(5)) / 2,
  70760. r = [
  70761. -1,
  70762. i,
  70763. 0,
  70764. 1,
  70765. i,
  70766. 0,
  70767. -1,
  70768. -i,
  70769. 0,
  70770. 1,
  70771. -i,
  70772. 0,
  70773. 0,
  70774. -1,
  70775. i,
  70776. 0,
  70777. 1,
  70778. i,
  70779. 0,
  70780. -1,
  70781. -i,
  70782. 0,
  70783. 1,
  70784. -i,
  70785. i,
  70786. 0,
  70787. -1,
  70788. i,
  70789. 0,
  70790. 1,
  70791. -i,
  70792. 0,
  70793. -1,
  70794. -i,
  70795. 0,
  70796. 1,
  70797. ],
  70798. o = [
  70799. 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11,
  70800. 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3,
  70801. 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1,
  70802. ];
  70803. n.PolyhedronGeometry.call(this, r, o, e, t),
  70804. (this.type = "IcosahedronGeometry"),
  70805. (this.parameters = {
  70806. radius: e,
  70807. detail: t,
  70808. });
  70809. }),
  70810. (n.IcosahedronGeometry.prototype = Object.create(
  70811. n.PolyhedronGeometry.prototype
  70812. )),
  70813. (n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry),
  70814. (n.OctahedronGeometry = function (e, t) {
  70815. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1],
  70816. r = [
  70817. 0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4,
  70818. 1, 4, 2,
  70819. ];
  70820. n.PolyhedronGeometry.call(this, i, r, e, t),
  70821. (this.type = "OctahedronGeometry"),
  70822. (this.parameters = {
  70823. radius: e,
  70824. detail: t,
  70825. });
  70826. }),
  70827. (n.OctahedronGeometry.prototype = Object.create(
  70828. n.PolyhedronGeometry.prototype
  70829. )),
  70830. (n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry),
  70831. (n.TetrahedronGeometry = function (e, t) {
  70832. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1],
  70833. r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  70834. n.PolyhedronGeometry.call(this, i, r, e, t),
  70835. (this.type = "TetrahedronGeometry"),
  70836. (this.parameters = {
  70837. radius: e,
  70838. detail: t,
  70839. });
  70840. }),
  70841. (n.TetrahedronGeometry.prototype = Object.create(
  70842. n.PolyhedronGeometry.prototype
  70843. )),
  70844. (n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry),
  70845. (n.ParametricGeometry = function (e, t, i) {
  70846. n.Geometry.call(this),
  70847. (this.type = "ParametricGeometry"),
  70848. (this.parameters = {
  70849. func: e,
  70850. slices: t,
  70851. stacks: i,
  70852. });
  70853. var r,
  70854. o,
  70855. a,
  70856. s,
  70857. l,
  70858. c = this.vertices,
  70859. h = this.faces,
  70860. u = this.faceVertexUvs[0],
  70861. d = t + 1;
  70862. for (r = 0; r <= i; r++)
  70863. for (l = r / i, o = 0; o <= t; o++)
  70864. (s = o / t), (a = e(s, l)), c.push(a);
  70865. var p, f, g, m, v, A, y, C;
  70866. for (r = 0; r < i; r++)
  70867. for (o = 0; o < t; o++)
  70868. (p = r * d + o),
  70869. (f = r * d + o + 1),
  70870. (g = (r + 1) * d + o + 1),
  70871. (m = (r + 1) * d + o),
  70872. (v = new n.Vector2(o / t, r / i)),
  70873. (A = new n.Vector2((o + 1) / t, r / i)),
  70874. (y = new n.Vector2((o + 1) / t, (r + 1) / i)),
  70875. (C = new n.Vector2(o / t, (r + 1) / i)),
  70876. h.push(new n.Face3(p, f, m)),
  70877. u.push([v, A, C]),
  70878. h.push(new n.Face3(f, g, m)),
  70879. u.push([A.clone(), y, C.clone()]);
  70880. this.computeFaceNormals(), this.computeVertexNormals();
  70881. }),
  70882. (n.ParametricGeometry.prototype = Object.create(
  70883. n.Geometry.prototype
  70884. )),
  70885. (n.ParametricGeometry.prototype.constructor = n.ParametricGeometry),
  70886. (n.WireframeGeometry = function (e) {
  70887. function t(e, t) {
  70888. return e - t;
  70889. }
  70890. n.BufferGeometry.call(this);
  70891. var i = [0, 0],
  70892. r = {},
  70893. o = ["a", "b", "c"];
  70894. if (e instanceof n.Geometry) {
  70895. for (
  70896. var a = e.vertices,
  70897. s = e.faces,
  70898. l = 0,
  70899. c = new Uint32Array(6 * s.length),
  70900. h = 0,
  70901. u = s.length;
  70902. h < u;
  70903. h++
  70904. )
  70905. for (var d = s[h], p = 0; p < 3; p++) {
  70906. (i[0] = d[o[p]]), (i[1] = d[o[(p + 1) % 3]]), i.sort(t);
  70907. var f = i.toString();
  70908. void 0 === r[f] &&
  70909. ((c[2 * l] = i[0]),
  70910. (c[2 * l + 1] = i[1]),
  70911. (r[f] = !0),
  70912. l++);
  70913. }
  70914. for (
  70915. var g = new Float32Array(2 * l * 3), h = 0, u = l;
  70916. h < u;
  70917. h++
  70918. )
  70919. for (var p = 0; p < 2; p++) {
  70920. var m = a[c[2 * h + p]],
  70921. v = 6 * h + 3 * p;
  70922. (g[v + 0] = m.x), (g[v + 1] = m.y), (g[v + 2] = m.z);
  70923. }
  70924. this.addAttribute("position", new n.BufferAttribute(g, 3));
  70925. } else if (e instanceof n.BufferGeometry)
  70926. if (null !== e.index) {
  70927. var A = e.index.array,
  70928. a = e.attributes.position,
  70929. y = e.groups,
  70930. l = 0;
  70931. 0 === y.length && e.addGroup(0, A.length);
  70932. for (
  70933. var c = new Uint32Array(2 * A.length), C = 0, I = y.length;
  70934. C < I;
  70935. ++C
  70936. )
  70937. for (
  70938. var E = y[C], b = E.start, w = E.count, h = b, _ = b + w;
  70939. h < _;
  70940. h += 3
  70941. )
  70942. for (var p = 0; p < 3; p++) {
  70943. (i[0] = A[h + p]),
  70944. (i[1] = A[h + ((p + 1) % 3)]),
  70945. i.sort(t);
  70946. var f = i.toString();
  70947. void 0 === r[f] &&
  70948. ((c[2 * l] = i[0]),
  70949. (c[2 * l + 1] = i[1]),
  70950. (r[f] = !0),
  70951. l++);
  70952. }
  70953. for (
  70954. var g = new Float32Array(2 * l * 3), h = 0, u = l;
  70955. h < u;
  70956. h++
  70957. )
  70958. for (var p = 0; p < 2; p++) {
  70959. var v = 6 * h + 3 * p,
  70960. T = c[2 * h + p];
  70961. (g[v + 0] = a.getX(T)),
  70962. (g[v + 1] = a.getY(T)),
  70963. (g[v + 2] = a.getZ(T));
  70964. }
  70965. this.addAttribute("position", new n.BufferAttribute(g, 3));
  70966. } else {
  70967. for (
  70968. var a = e.attributes.position.array,
  70969. l = a.length / 3,
  70970. x = l / 3,
  70971. g = new Float32Array(2 * l * 3),
  70972. h = 0,
  70973. u = x;
  70974. h < u;
  70975. h++
  70976. )
  70977. for (var p = 0; p < 3; p++) {
  70978. var v = 18 * h + 6 * p,
  70979. S = 9 * h + 3 * p;
  70980. (g[v + 0] = a[S]),
  70981. (g[v + 1] = a[S + 1]),
  70982. (g[v + 2] = a[S + 2]);
  70983. var T = 9 * h + 3 * ((p + 1) % 3);
  70984. (g[v + 3] = a[T]),
  70985. (g[v + 4] = a[T + 1]),
  70986. (g[v + 5] = a[T + 2]);
  70987. }
  70988. this.addAttribute("position", new n.BufferAttribute(g, 3));
  70989. }
  70990. }),
  70991. (n.WireframeGeometry.prototype = Object.create(
  70992. n.BufferGeometry.prototype
  70993. )),
  70994. (n.WireframeGeometry.prototype.constructor = n.WireframeGeometry),
  70995. (n.AxisHelper = function (e) {
  70996. e = e || 1;
  70997. var t = new Float32Array([
  70998. 0,
  70999. 0,
  71000. 0,
  71001. e,
  71002. 0,
  71003. 0,
  71004. 0,
  71005. 0,
  71006. 0,
  71007. 0,
  71008. e,
  71009. 0,
  71010. 0,
  71011. 0,
  71012. 0,
  71013. 0,
  71014. 0,
  71015. e,
  71016. ]),
  71017. i = new Float32Array([
  71018. 1, 0, 0, 1, 0.6, 0, 0, 1, 0, 0.6, 1, 0, 0, 0, 1, 0, 0.6, 1,
  71019. ]),
  71020. r = new n.BufferGeometry();
  71021. r.addAttribute("position", new n.BufferAttribute(t, 3)),
  71022. r.addAttribute("color", new n.BufferAttribute(i, 3));
  71023. var o = new n.LineBasicMaterial({
  71024. vertexColors: n.VertexColors,
  71025. });
  71026. n.LineSegments.call(this, r, o);
  71027. }),
  71028. (n.AxisHelper.prototype = Object.create(n.LineSegments.prototype)),
  71029. (n.AxisHelper.prototype.constructor = n.AxisHelper),
  71030. (n.ArrowHelper = (function () {
  71031. var e = new n.Geometry();
  71032. e.vertices.push(new n.Vector3(0, 0, 0), new n.Vector3(0, 1, 0));
  71033. var t = new n.CylinderGeometry(0, 0.5, 1, 5, 1);
  71034. return (
  71035. t.translate(0, -0.5, 0),
  71036. function (i, r, o, a, s, l) {
  71037. n.Object3D.call(this),
  71038. void 0 === a && (a = 16776960),
  71039. void 0 === o && (o = 1),
  71040. void 0 === s && (s = 0.2 * o),
  71041. void 0 === l && (l = 0.2 * s),
  71042. this.position.copy(r),
  71043. (this.line = new n.Line(
  71044. e,
  71045. new n.LineBasicMaterial({
  71046. color: a,
  71047. })
  71048. )),
  71049. (this.line.matrixAutoUpdate = !1),
  71050. this.add(this.line),
  71051. (this.cone = new n.Mesh(
  71052. t,
  71053. new n.MeshBasicMaterial({
  71054. color: a,
  71055. })
  71056. )),
  71057. (this.cone.matrixAutoUpdate = !1),
  71058. this.add(this.cone),
  71059. this.setDirection(i),
  71060. this.setLength(o, s, l);
  71061. }
  71062. );
  71063. })()),
  71064. (n.ArrowHelper.prototype = Object.create(n.Object3D.prototype)),
  71065. (n.ArrowHelper.prototype.constructor = n.ArrowHelper),
  71066. (n.ArrowHelper.prototype.setDirection = (function () {
  71067. var e,
  71068. t = new n.Vector3();
  71069. return function (i) {
  71070. i.y > 0.99999
  71071. ? this.quaternion.set(0, 0, 0, 1)
  71072. : i.y < -0.99999
  71073. ? this.quaternion.set(1, 0, 0, 0)
  71074. : (t.set(i.z, 0, -i.x).normalize(),
  71075. (e = Math.acos(i.y)),
  71076. this.quaternion.setFromAxisAngle(t, e));
  71077. };
  71078. })()),
  71079. (n.ArrowHelper.prototype.setLength = function (e, t, i) {
  71080. void 0 === t && (t = 0.2 * e),
  71081. void 0 === i && (i = 0.2 * t),
  71082. this.line.scale.set(1, Math.max(0, e - t), 1),
  71083. this.line.updateMatrix(),
  71084. this.cone.scale.set(i, t, i),
  71085. (this.cone.position.y = e),
  71086. this.cone.updateMatrix();
  71087. }),
  71088. (n.ArrowHelper.prototype.setColor = function (e) {
  71089. this.line.material.color.set(e), this.cone.material.color.set(e);
  71090. }),
  71091. (n.BoxHelper = function (e) {
  71092. var t = new Uint16Array([
  71093. 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2,
  71094. 6, 3, 7,
  71095. ]),
  71096. i = new Float32Array(24),
  71097. r = new n.BufferGeometry();
  71098. r.setIndex(new n.BufferAttribute(t, 1)),
  71099. r.addAttribute("position", new n.BufferAttribute(i, 3)),
  71100. n.LineSegments.call(
  71101. this,
  71102. r,
  71103. new n.LineBasicMaterial({
  71104. color: 16776960,
  71105. })
  71106. ),
  71107. void 0 !== e && this.update(e);
  71108. }),
  71109. (n.BoxHelper.prototype = Object.create(n.LineSegments.prototype)),
  71110. (n.BoxHelper.prototype.constructor = n.BoxHelper),
  71111. (n.BoxHelper.prototype.update = (function () {
  71112. var e = new n.Box3();
  71113. return function (t) {
  71114. if ((e.setFromObject(t), !e.isEmpty())) {
  71115. var i = e.min,
  71116. n = e.max,
  71117. r = this.geometry.attributes.position,
  71118. o = r.array;
  71119. (o[0] = n.x),
  71120. (o[1] = n.y),
  71121. (o[2] = n.z),
  71122. (o[3] = i.x),
  71123. (o[4] = n.y),
  71124. (o[5] = n.z),
  71125. (o[6] = i.x),
  71126. (o[7] = i.y),
  71127. (o[8] = n.z),
  71128. (o[9] = n.x),
  71129. (o[10] = i.y),
  71130. (o[11] = n.z),
  71131. (o[12] = n.x),
  71132. (o[13] = n.y),
  71133. (o[14] = i.z),
  71134. (o[15] = i.x),
  71135. (o[16] = n.y),
  71136. (o[17] = i.z),
  71137. (o[18] = i.x),
  71138. (o[19] = i.y),
  71139. (o[20] = i.z),
  71140. (o[21] = n.x),
  71141. (o[22] = i.y),
  71142. (o[23] = i.z),
  71143. (r.needsUpdate = !0),
  71144. this.geometry.computeBoundingSphere();
  71145. }
  71146. };
  71147. })()),
  71148. (n.BoundingBoxHelper = function (e, t) {
  71149. var i = void 0 !== t ? t : 8947848;
  71150. (this.object = e),
  71151. (this.box = new n.Box3()),
  71152. n.Mesh.call(
  71153. this,
  71154. new n.BoxGeometry(1, 1, 1),
  71155. new n.MeshBasicMaterial({
  71156. color: i,
  71157. wireframe: !0,
  71158. })
  71159. );
  71160. }),
  71161. (n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype)),
  71162. (n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper),
  71163. (n.BoundingBoxHelper.prototype.update = function () {
  71164. this.box.setFromObject(this.object),
  71165. this.box.size(this.scale),
  71166. this.box.center(this.position);
  71167. }),
  71168. (n.CameraHelper = function (e) {
  71169. function t(e, t, n) {
  71170. i(e, n), i(t, n);
  71171. }
  71172. function i(e, t) {
  71173. r.vertices.push(new n.Vector3()),
  71174. r.colors.push(new n.Color(t)),
  71175. void 0 === a[e] && (a[e] = []),
  71176. a[e].push(r.vertices.length - 1);
  71177. }
  71178. var r = new n.Geometry(),
  71179. o = new n.LineBasicMaterial({
  71180. color: 16777215,
  71181. vertexColors: n.FaceColors,
  71182. }),
  71183. a = {},
  71184. s = 16755200,
  71185. l = 16711680,
  71186. c = 43775,
  71187. h = 16777215,
  71188. u = 3355443;
  71189. t("n1", "n2", s),
  71190. t("n2", "n4", s),
  71191. t("n4", "n3", s),
  71192. t("n3", "n1", s),
  71193. t("f1", "f2", s),
  71194. t("f2", "f4", s),
  71195. t("f4", "f3", s),
  71196. t("f3", "f1", s),
  71197. t("n1", "f1", s),
  71198. t("n2", "f2", s),
  71199. t("n3", "f3", s),
  71200. t("n4", "f4", s),
  71201. t("p", "n1", l),
  71202. t("p", "n2", l),
  71203. t("p", "n3", l),
  71204. t("p", "n4", l),
  71205. t("u1", "u2", c),
  71206. t("u2", "u3", c),
  71207. t("u3", "u1", c),
  71208. t("c", "t", h),
  71209. t("p", "c", u),
  71210. t("cn1", "cn2", u),
  71211. t("cn3", "cn4", u),
  71212. t("cf1", "cf2", u),
  71213. t("cf3", "cf4", u),
  71214. n.LineSegments.call(this, r, o),
  71215. (this.camera = e),
  71216. this.camera.updateProjectionMatrix(),
  71217. (this.matrix = e.matrixWorld),
  71218. (this.matrixAutoUpdate = !1),
  71219. (this.pointMap = a),
  71220. this.update();
  71221. }),
  71222. (n.CameraHelper.prototype = Object.create(n.LineSegments.prototype)),
  71223. (n.CameraHelper.prototype.constructor = n.CameraHelper),
  71224. (n.CameraHelper.prototype.update = (function () {
  71225. function e(e, n, a, s) {
  71226. r.set(n, a, s).unproject(o);
  71227. var l = i[e];
  71228. if (void 0 !== l)
  71229. for (var c = 0, h = l.length; c < h; c++)
  71230. t.vertices[l[c]].copy(r);
  71231. }
  71232. var t,
  71233. i,
  71234. r = new n.Vector3(),
  71235. o = new n.Camera();
  71236. return function () {
  71237. (t = this.geometry), (i = this.pointMap);
  71238. var n = 1,
  71239. r = 1;
  71240. o.projectionMatrix.copy(this.camera.projectionMatrix),
  71241. e("c", 0, 0, -1),
  71242. e("t", 0, 0, 1),
  71243. e("n1", -n, -r, -1),
  71244. e("n2", n, -r, -1),
  71245. e("n3", -n, r, -1),
  71246. e("n4", n, r, -1),
  71247. e("f1", -n, -r, 1),
  71248. e("f2", n, -r, 1),
  71249. e("f3", -n, r, 1),
  71250. e("f4", n, r, 1),
  71251. e("u1", 0.7 * n, 1.1 * r, -1),
  71252. e("u2", 0.7 * -n, 1.1 * r, -1),
  71253. e("u3", 0, 2 * r, -1),
  71254. e("cf1", -n, 0, 1),
  71255. e("cf2", n, 0, 1),
  71256. e("cf3", 0, -r, 1),
  71257. e("cf4", 0, r, 1),
  71258. e("cn1", -n, 0, -1),
  71259. e("cn2", n, 0, -1),
  71260. e("cn3", 0, -r, -1),
  71261. e("cn4", 0, r, -1),
  71262. (t.verticesNeedUpdate = !0);
  71263. };
  71264. })()),
  71265. (n.DirectionalLightHelper = function (e, t) {
  71266. n.Object3D.call(this),
  71267. (this.light = e),
  71268. this.light.updateMatrixWorld(),
  71269. (this.matrix = e.matrixWorld),
  71270. (this.matrixAutoUpdate = !1),
  71271. (t = t || 1);
  71272. var i = new n.Geometry();
  71273. i.vertices.push(
  71274. new n.Vector3(-t, t, 0),
  71275. new n.Vector3(t, t, 0),
  71276. new n.Vector3(t, -t, 0),
  71277. new n.Vector3(-t, -t, 0),
  71278. new n.Vector3(-t, t, 0)
  71279. );
  71280. var r = new n.LineBasicMaterial({
  71281. fog: !1,
  71282. });
  71283. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  71284. (this.lightPlane = new n.Line(i, r)),
  71285. this.add(this.lightPlane),
  71286. (i = new n.Geometry()),
  71287. i.vertices.push(new n.Vector3(), new n.Vector3()),
  71288. (r = new n.LineBasicMaterial({
  71289. fog: !1,
  71290. })),
  71291. r.color
  71292. .copy(this.light.color)
  71293. .multiplyScalar(this.light.intensity),
  71294. (this.targetLine = new n.Line(i, r)),
  71295. this.add(this.targetLine),
  71296. this.update();
  71297. }),
  71298. (n.DirectionalLightHelper.prototype = Object.create(
  71299. n.Object3D.prototype
  71300. )),
  71301. (n.DirectionalLightHelper.prototype.constructor =
  71302. n.DirectionalLightHelper),
  71303. (n.DirectionalLightHelper.prototype.dispose = function () {
  71304. this.lightPlane.geometry.dispose(),
  71305. this.lightPlane.material.dispose(),
  71306. this.targetLine.geometry.dispose(),
  71307. this.targetLine.material.dispose();
  71308. }),
  71309. (n.DirectionalLightHelper.prototype.update = (function () {
  71310. var e = new n.Vector3(),
  71311. t = new n.Vector3(),
  71312. i = new n.Vector3();
  71313. return function () {
  71314. e.setFromMatrixPosition(this.light.matrixWorld),
  71315. t.setFromMatrixPosition(this.light.target.matrixWorld),
  71316. i.subVectors(t, e),
  71317. this.lightPlane.lookAt(i),
  71318. this.lightPlane.material.color
  71319. .copy(this.light.color)
  71320. .multiplyScalar(this.light.intensity),
  71321. this.targetLine.geometry.vertices[1].copy(i),
  71322. (this.targetLine.geometry.verticesNeedUpdate = !0),
  71323. this.targetLine.material.color.copy(
  71324. this.lightPlane.material.color
  71325. );
  71326. };
  71327. })()),
  71328. (n.EdgesHelper = function (e, t, i) {
  71329. var r = void 0 !== t ? t : 16777215;
  71330. n.LineSegments.call(
  71331. this,
  71332. new n.EdgesGeometry(e.geometry, i),
  71333. new n.LineBasicMaterial({
  71334. color: r,
  71335. })
  71336. ),
  71337. (this.matrix = e.matrixWorld),
  71338. (this.matrixAutoUpdate = !1);
  71339. }),
  71340. (n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype)),
  71341. (n.EdgesHelper.prototype.constructor = n.EdgesHelper),
  71342. (n.FaceNormalsHelper = function (e, t, i, r) {
  71343. (this.object = e), (this.size = void 0 !== t ? t : 1);
  71344. var o = void 0 !== i ? i : 16776960,
  71345. a = void 0 !== r ? r : 1,
  71346. s = 0,
  71347. l = this.object.geometry;
  71348. l instanceof n.Geometry
  71349. ? (s = l.faces.length)
  71350. : console.warn(
  71351. "THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead."
  71352. );
  71353. var c = new n.BufferGeometry(),
  71354. h = new n.Float32Attribute(2 * s * 3, 3);
  71355. c.addAttribute("position", h),
  71356. n.LineSegments.call(
  71357. this,
  71358. c,
  71359. new n.LineBasicMaterial({
  71360. color: o,
  71361. linewidth: a,
  71362. })
  71363. ),
  71364. (this.matrixAutoUpdate = !1),
  71365. this.update();
  71366. }),
  71367. (n.FaceNormalsHelper.prototype = Object.create(
  71368. n.LineSegments.prototype
  71369. )),
  71370. (n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper),
  71371. (n.FaceNormalsHelper.prototype.update = (function () {
  71372. var e = new n.Vector3(),
  71373. t = new n.Vector3(),
  71374. i = new n.Matrix3();
  71375. return function () {
  71376. this.object.updateMatrixWorld(!0),
  71377. i.getNormalMatrix(this.object.matrixWorld);
  71378. for (
  71379. var n = this.object.matrixWorld,
  71380. r = this.geometry.attributes.position,
  71381. o = this.object.geometry,
  71382. a = o.vertices,
  71383. s = o.faces,
  71384. l = 0,
  71385. c = 0,
  71386. h = s.length;
  71387. c < h;
  71388. c++
  71389. ) {
  71390. var u = s[c],
  71391. d = u.normal;
  71392. e
  71393. .copy(a[u.a])
  71394. .add(a[u.b])
  71395. .add(a[u.c])
  71396. .divideScalar(3)
  71397. .applyMatrix4(n),
  71398. t
  71399. .copy(d)
  71400. .applyMatrix3(i)
  71401. .normalize()
  71402. .multiplyScalar(this.size)
  71403. .add(e),
  71404. r.setXYZ(l, e.x, e.y, e.z),
  71405. (l += 1),
  71406. r.setXYZ(l, t.x, t.y, t.z),
  71407. (l += 1);
  71408. }
  71409. return (r.needsUpdate = !0), this;
  71410. };
  71411. })()),
  71412. (n.GridHelper = function (e, t) {
  71413. var i = new n.Geometry(),
  71414. r = new n.LineBasicMaterial({
  71415. vertexColors: n.VertexColors,
  71416. });
  71417. (this.color1 = new n.Color(4473924)),
  71418. (this.color2 = new n.Color(8947848));
  71419. for (var o = -e; o <= e; o += t) {
  71420. i.vertices.push(
  71421. new n.Vector3(-e, 0, o),
  71422. new n.Vector3(e, 0, o),
  71423. new n.Vector3(o, 0, -e),
  71424. new n.Vector3(o, 0, e)
  71425. );
  71426. var a = 0 === o ? this.color1 : this.color2;
  71427. i.colors.push(a, a, a, a);
  71428. }
  71429. n.LineSegments.call(this, i, r);
  71430. }),
  71431. (n.GridHelper.prototype = Object.create(n.LineSegments.prototype)),
  71432. (n.GridHelper.prototype.constructor = n.GridHelper),
  71433. (n.GridHelper.prototype.setColors = function (e, t) {
  71434. this.color1.set(e),
  71435. this.color2.set(t),
  71436. (this.geometry.colorsNeedUpdate = !0);
  71437. }),
  71438. (n.HemisphereLightHelper = function (e, t) {
  71439. n.Object3D.call(this),
  71440. (this.light = e),
  71441. this.light.updateMatrixWorld(),
  71442. (this.matrix = e.matrixWorld),
  71443. (this.matrixAutoUpdate = !1),
  71444. (this.colors = [new n.Color(), new n.Color()]);
  71445. var i = new n.SphereGeometry(t, 4, 2);
  71446. i.rotateX(-Math.PI / 2);
  71447. for (var r = 0, o = 8; r < o; r++)
  71448. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  71449. var a = new n.MeshBasicMaterial({
  71450. vertexColors: n.FaceColors,
  71451. wireframe: !0,
  71452. });
  71453. (this.lightSphere = new n.Mesh(i, a)),
  71454. this.add(this.lightSphere),
  71455. this.update();
  71456. }),
  71457. (n.HemisphereLightHelper.prototype = Object.create(
  71458. n.Object3D.prototype
  71459. )),
  71460. (n.HemisphereLightHelper.prototype.constructor =
  71461. n.HemisphereLightHelper),
  71462. (n.HemisphereLightHelper.prototype.dispose = function () {
  71463. this.lightSphere.geometry.dispose(),
  71464. this.lightSphere.material.dispose();
  71465. }),
  71466. (n.HemisphereLightHelper.prototype.update = (function () {
  71467. var e = new n.Vector3();
  71468. return function () {
  71469. this.colors[0]
  71470. .copy(this.light.color)
  71471. .multiplyScalar(this.light.intensity),
  71472. this.colors[1]
  71473. .copy(this.light.groundColor)
  71474. .multiplyScalar(this.light.intensity),
  71475. this.lightSphere.lookAt(
  71476. e.setFromMatrixPosition(this.light.matrixWorld).negate()
  71477. ),
  71478. (this.lightSphere.geometry.colorsNeedUpdate = !0);
  71479. };
  71480. })()),
  71481. (n.PointLightHelper = function (e, t) {
  71482. (this.light = e), this.light.updateMatrixWorld();
  71483. var i = new n.SphereGeometry(t, 4, 2),
  71484. r = new n.MeshBasicMaterial({
  71485. wireframe: !0,
  71486. fog: !1,
  71487. });
  71488. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  71489. n.Mesh.call(this, i, r),
  71490. (this.matrix = this.light.matrixWorld),
  71491. (this.matrixAutoUpdate = !1);
  71492. }),
  71493. (n.PointLightHelper.prototype = Object.create(n.Mesh.prototype)),
  71494. (n.PointLightHelper.prototype.constructor = n.PointLightHelper),
  71495. (n.PointLightHelper.prototype.dispose = function () {
  71496. this.geometry.dispose(), this.material.dispose();
  71497. }),
  71498. (n.PointLightHelper.prototype.update = function () {
  71499. this.material.color
  71500. .copy(this.light.color)
  71501. .multiplyScalar(this.light.intensity);
  71502. }),
  71503. (n.SkeletonHelper = function (e) {
  71504. this.bones = this.getBoneList(e);
  71505. for (var t = new n.Geometry(), i = 0; i < this.bones.length; i++) {
  71506. var r = this.bones[i];
  71507. r.parent instanceof n.Bone &&
  71508. (t.vertices.push(new n.Vector3()),
  71509. t.vertices.push(new n.Vector3()),
  71510. t.colors.push(new n.Color(0, 0, 1)),
  71511. t.colors.push(new n.Color(0, 1, 0)));
  71512. }
  71513. t.dynamic = !0;
  71514. var o = new n.LineBasicMaterial({
  71515. vertexColors: n.VertexColors,
  71516. depthTest: !1,
  71517. depthWrite: !1,
  71518. transparent: !0,
  71519. });
  71520. n.LineSegments.call(this, t, o),
  71521. (this.root = e),
  71522. (this.matrix = e.matrixWorld),
  71523. (this.matrixAutoUpdate = !1),
  71524. this.update();
  71525. }),
  71526. (n.SkeletonHelper.prototype = Object.create(
  71527. n.LineSegments.prototype
  71528. )),
  71529. (n.SkeletonHelper.prototype.constructor = n.SkeletonHelper),
  71530. (n.SkeletonHelper.prototype.getBoneList = function (e) {
  71531. var t = [];
  71532. e instanceof n.Bone && t.push(e);
  71533. for (var i = 0; i < e.children.length; i++)
  71534. t.push.apply(t, this.getBoneList(e.children[i]));
  71535. return t;
  71536. }),
  71537. (n.SkeletonHelper.prototype.update = function () {
  71538. for (
  71539. var e = this.geometry,
  71540. t = new n.Matrix4().getInverse(this.root.matrixWorld),
  71541. i = new n.Matrix4(),
  71542. r = 0,
  71543. o = 0;
  71544. o < this.bones.length;
  71545. o++
  71546. ) {
  71547. var a = this.bones[o];
  71548. a.parent instanceof n.Bone &&
  71549. (i.multiplyMatrices(t, a.matrixWorld),
  71550. e.vertices[r].setFromMatrixPosition(i),
  71551. i.multiplyMatrices(t, a.parent.matrixWorld),
  71552. e.vertices[r + 1].setFromMatrixPosition(i),
  71553. (r += 2));
  71554. }
  71555. (e.verticesNeedUpdate = !0), e.computeBoundingSphere();
  71556. }),
  71557. (n.SpotLightHelper = function (e) {
  71558. n.Object3D.call(this),
  71559. (this.light = e),
  71560. this.light.updateMatrixWorld(),
  71561. (this.matrix = e.matrixWorld),
  71562. (this.matrixAutoUpdate = !1);
  71563. var t = new n.CylinderGeometry(0, 1, 1, 8, 1, !0);
  71564. t.translate(0, -0.5, 0), t.rotateX(-Math.PI / 2);
  71565. var i = new n.MeshBasicMaterial({
  71566. wireframe: !0,
  71567. fog: !1,
  71568. });
  71569. (this.cone = new n.Mesh(t, i)), this.add(this.cone), this.update();
  71570. }),
  71571. (n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype)),
  71572. (n.SpotLightHelper.prototype.constructor = n.SpotLightHelper),
  71573. (n.SpotLightHelper.prototype.dispose = function () {
  71574. this.cone.geometry.dispose(), this.cone.material.dispose();
  71575. }),
  71576. (n.SpotLightHelper.prototype.update = (function () {
  71577. var e = new n.Vector3(),
  71578. t = new n.Vector3();
  71579. return function () {
  71580. var i = this.light.distance ? this.light.distance : 1e4,
  71581. n = i * Math.tan(this.light.angle);
  71582. this.cone.scale.set(n, n, i),
  71583. e.setFromMatrixPosition(this.light.matrixWorld),
  71584. t.setFromMatrixPosition(this.light.target.matrixWorld),
  71585. this.cone.lookAt(t.sub(e)),
  71586. this.cone.material.color
  71587. .copy(this.light.color)
  71588. .multiplyScalar(this.light.intensity);
  71589. };
  71590. })()),
  71591. (n.VertexNormalsHelper = function (e, t, i, r) {
  71592. (this.object = e), (this.size = void 0 !== t ? t : 1);
  71593. var o = void 0 !== i ? i : 16711680,
  71594. a = void 0 !== r ? r : 1,
  71595. s = 0,
  71596. l = this.object.geometry;
  71597. l instanceof n.Geometry
  71598. ? (s = 3 * l.faces.length)
  71599. : l instanceof n.BufferGeometry &&
  71600. (s = l.attributes.normal.count);
  71601. var c = new n.BufferGeometry(),
  71602. h = new n.Float32Attribute(2 * s * 3, 3);
  71603. c.addAttribute("position", h),
  71604. n.LineSegments.call(
  71605. this,
  71606. c,
  71607. new n.LineBasicMaterial({
  71608. color: o,
  71609. linewidth: a,
  71610. })
  71611. ),
  71612. (this.matrixAutoUpdate = !1),
  71613. this.update();
  71614. }),
  71615. (n.VertexNormalsHelper.prototype = Object.create(
  71616. n.LineSegments.prototype
  71617. )),
  71618. (n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper),
  71619. (n.VertexNormalsHelper.prototype.update = (function () {
  71620. var e = new n.Vector3(),
  71621. t = new n.Vector3(),
  71622. i = new n.Matrix3();
  71623. return function () {
  71624. var r = ["a", "b", "c"];
  71625. this.object.updateMatrixWorld(!0),
  71626. i.getNormalMatrix(this.object.matrixWorld);
  71627. var o = this.object.matrixWorld,
  71628. a = this.geometry.attributes.position,
  71629. s = this.object.geometry;
  71630. if (s instanceof n.Geometry)
  71631. for (
  71632. var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length;
  71633. u < d;
  71634. u++
  71635. )
  71636. for (
  71637. var p = c[u], f = 0, g = p.vertexNormals.length;
  71638. f < g;
  71639. f++
  71640. ) {
  71641. var m = l[p[r[f]]],
  71642. v = p.vertexNormals[f];
  71643. e.copy(m).applyMatrix4(o),
  71644. t
  71645. .copy(v)
  71646. .applyMatrix3(i)
  71647. .normalize()
  71648. .multiplyScalar(this.size)
  71649. .add(e),
  71650. a.setXYZ(h, e.x, e.y, e.z),
  71651. (h += 1),
  71652. a.setXYZ(h, t.x, t.y, t.z),
  71653. (h += 1);
  71654. }
  71655. else if (s instanceof n.BufferGeometry)
  71656. for (
  71657. var A = s.attributes.position,
  71658. y = s.attributes.normal,
  71659. h = 0,
  71660. f = 0,
  71661. g = A.count;
  71662. f < g;
  71663. f++
  71664. )
  71665. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  71666. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  71667. t
  71668. .applyMatrix3(i)
  71669. .normalize()
  71670. .multiplyScalar(this.size)
  71671. .add(e),
  71672. a.setXYZ(h, e.x, e.y, e.z),
  71673. (h += 1),
  71674. a.setXYZ(h, t.x, t.y, t.z),
  71675. (h += 1);
  71676. return (a.needsUpdate = !0), this;
  71677. };
  71678. })()),
  71679. (n.WireframeHelper = function (e, t) {
  71680. var i = void 0 !== t ? t : 16777215;
  71681. n.LineSegments.call(
  71682. this,
  71683. new n.WireframeGeometry(e.geometry),
  71684. new n.LineBasicMaterial({
  71685. color: i,
  71686. })
  71687. ),
  71688. (this.matrix = e.matrixWorld),
  71689. (this.matrixAutoUpdate = !1);
  71690. }),
  71691. (n.WireframeHelper.prototype = Object.create(
  71692. n.LineSegments.prototype
  71693. )),
  71694. (n.WireframeHelper.prototype.constructor = n.WireframeHelper),
  71695. (n.ImmediateRenderObject = function (e) {
  71696. n.Object3D.call(this),
  71697. (this.material = e),
  71698. (this.render = function (e) {});
  71699. }),
  71700. (n.ImmediateRenderObject.prototype = Object.create(
  71701. n.Object3D.prototype
  71702. )),
  71703. (n.ImmediateRenderObject.prototype.constructor =
  71704. n.ImmediateRenderObject),
  71705. (n.MorphBlendMesh = function (e, t) {
  71706. n.Mesh.call(this, e, t),
  71707. (this.animationsMap = {}),
  71708. (this.animationsList = []);
  71709. var i = this.geometry.morphTargets.length,
  71710. r = "__default",
  71711. o = 0,
  71712. a = i - 1,
  71713. s = i / 1;
  71714. this.createAnimation(r, o, a, s), this.setAnimationWeight(r, 1);
  71715. }),
  71716. (n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype)),
  71717. (n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh),
  71718. (n.MorphBlendMesh.prototype.createAnimation = function (e, t, i, n) {
  71719. var r = {
  71720. start: t,
  71721. end: i,
  71722. length: i - t + 1,
  71723. fps: n,
  71724. duration: (i - t) / n,
  71725. lastFrame: 0,
  71726. currentFrame: 0,
  71727. active: !1,
  71728. time: 0,
  71729. direction: 1,
  71730. weight: 1,
  71731. directionBackwards: !1,
  71732. mirroredLoop: !1,
  71733. };
  71734. (this.animationsMap[e] = r), this.animationsList.push(r);
  71735. }),
  71736. (n.MorphBlendMesh.prototype.autoCreateAnimations = function (e) {
  71737. for (
  71738. var t,
  71739. i = /([a-z]+)_?(\d+)/i,
  71740. n = {},
  71741. r = this.geometry,
  71742. o = 0,
  71743. a = r.morphTargets.length;
  71744. o < a;
  71745. o++
  71746. ) {
  71747. var s = r.morphTargets[o],
  71748. l = s.name.match(i);
  71749. if (l && l.length > 1) {
  71750. var c = l[1];
  71751. n[c] ||
  71752. (n[c] = {
  71753. start: 1 / 0,
  71754. end: -(1 / 0),
  71755. });
  71756. var h = n[c];
  71757. o < h.start && (h.start = o),
  71758. o > h.end && (h.end = o),
  71759. t || (t = c);
  71760. }
  71761. }
  71762. for (var c in n) {
  71763. var h = n[c];
  71764. this.createAnimation(c, h.start, h.end, e);
  71765. }
  71766. this.firstAnimation = t;
  71767. }),
  71768. (n.MorphBlendMesh.prototype.setAnimationDirectionForward = function (
  71769. e
  71770. ) {
  71771. var t = this.animationsMap[e];
  71772. t && ((t.direction = 1), (t.directionBackwards = !1));
  71773. }),
  71774. (n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function (
  71775. e
  71776. ) {
  71777. var t = this.animationsMap[e];
  71778. t && ((t.direction = -1), (t.directionBackwards = !0));
  71779. }),
  71780. (n.MorphBlendMesh.prototype.setAnimationFPS = function (e, t) {
  71781. var i = this.animationsMap[e];
  71782. i && ((i.fps = t), (i.duration = (i.end - i.start) / i.fps));
  71783. }),
  71784. (n.MorphBlendMesh.prototype.setAnimationDuration = function (e, t) {
  71785. var i = this.animationsMap[e];
  71786. i && ((i.duration = t), (i.fps = (i.end - i.start) / i.duration));
  71787. }),
  71788. (n.MorphBlendMesh.prototype.setAnimationWeight = function (e, t) {
  71789. var i = this.animationsMap[e];
  71790. i && (i.weight = t);
  71791. }),
  71792. (n.MorphBlendMesh.prototype.setAnimationTime = function (e, t) {
  71793. var i = this.animationsMap[e];
  71794. i && (i.time = t);
  71795. }),
  71796. (n.MorphBlendMesh.prototype.getAnimationTime = function (e) {
  71797. var t = 0,
  71798. i = this.animationsMap[e];
  71799. return i && (t = i.time), t;
  71800. }),
  71801. (n.MorphBlendMesh.prototype.getAnimationDuration = function (e) {
  71802. var t = -1,
  71803. i = this.animationsMap[e];
  71804. return i && (t = i.duration), t;
  71805. }),
  71806. (n.MorphBlendMesh.prototype.playAnimation = function (e) {
  71807. var t = this.animationsMap[e];
  71808. t
  71809. ? ((t.time = 0), (t.active = !0))
  71810. : console.warn(
  71811. "THREE.MorphBlendMesh: animation[" +
  71812. e +
  71813. "] undefined in .playAnimation()"
  71814. );
  71815. }),
  71816. (n.MorphBlendMesh.prototype.stopAnimation = function (e) {
  71817. var t = this.animationsMap[e];
  71818. t && (t.active = !1);
  71819. }),
  71820. (n.MorphBlendMesh.prototype.update = function (e) {
  71821. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  71822. var r = this.animationsList[t];
  71823. if (r.active) {
  71824. var o = r.duration / r.length;
  71825. (r.time += r.direction * e),
  71826. r.mirroredLoop
  71827. ? (r.time > r.duration || r.time < 0) &&
  71828. ((r.direction *= -1),
  71829. r.time > r.duration &&
  71830. ((r.time = r.duration), (r.directionBackwards = !0)),
  71831. r.time < 0 && ((r.time = 0), (r.directionBackwards = !1)))
  71832. : ((r.time = r.time % r.duration),
  71833. r.time < 0 && (r.time += r.duration));
  71834. var a =
  71835. r.start +
  71836. n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1),
  71837. s = r.weight;
  71838. a !== r.currentFrame &&
  71839. ((this.morphTargetInfluences[r.lastFrame] = 0),
  71840. (this.morphTargetInfluences[r.currentFrame] = 1 * s),
  71841. (this.morphTargetInfluences[a] = 0),
  71842. (r.lastFrame = r.currentFrame),
  71843. (r.currentFrame = a));
  71844. var l = (r.time % o) / o;
  71845. r.directionBackwards && (l = 1 - l),
  71846. r.currentFrame !== r.lastFrame
  71847. ? ((this.morphTargetInfluences[r.currentFrame] = l * s),
  71848. (this.morphTargetInfluences[r.lastFrame] = (1 - l) * s))
  71849. : (this.morphTargetInfluences[r.currentFrame] = s);
  71850. }
  71851. }
  71852. }),
  71853. "undefined" != typeof i
  71854. ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  71855. (i.THREE = n))
  71856. : (this.THREE = n);
  71857. window.THREE = n;
  71858. getObjLoader();
  71859. initByTHREE(THREE);
  71860. //getWebXRManager()
  71861. },
  71862. {},
  71863. ],
  71864. },
  71865. {},
  71866. [116]
  71867. );
  71868. /*
  71869. function getWebXRManager(){
  71870. class ArrayCamera extends THREE.PerspectiveCamera {
  71871. constructor(array = []) {
  71872. super();
  71873. this.isArrayCamera = true;
  71874. this.cameras = array;
  71875. }
  71876. }
  71877. function WebGLAnimation() {
  71878. let context = null;
  71879. let isAnimating = false;
  71880. let animationLoop = null;
  71881. let requestId = null;
  71882. function onAnimationFrame(time, frame) {
  71883. animationLoop(time, frame);
  71884. requestId = context.requestAnimationFrame(onAnimationFrame);
  71885. }
  71886. return {
  71887. start: function () {
  71888. if (isAnimating === true) return;
  71889. if (animationLoop === null) return;
  71890. requestId = context.requestAnimationFrame(onAnimationFrame);
  71891. isAnimating = true;
  71892. },
  71893. stop: function () {
  71894. context.cancelAnimationFrame(requestId);
  71895. isAnimating = false;
  71896. },
  71897. setAnimationLoop: function (callback) {
  71898. animationLoop = callback;
  71899. },
  71900. setContext: function (value) {
  71901. context = value;
  71902. }
  71903. };
  71904. }
  71905. function WebXRManager( renderer, gl ) {
  71906. var scope = this;
  71907. var session = null;
  71908. // var framebufferScaleFactor = 1.0;
  71909. var referenceSpace = null;
  71910. var referenceSpaceType = 'local-floor';
  71911. var pose = null;
  71912. var controllers = [];
  71913. var sortedInputSources = [];
  71914. function isPresenting() {
  71915. return session !== null && referenceSpace !== null;
  71916. }
  71917. //
  71918. var cameraL = new THREE.PerspectiveCamera();
  71919. cameraL.layers.enable( 1 );
  71920. cameraL.viewport = new THREE.Vector4();
  71921. var cameraR = new THREE.PerspectiveCamera();
  71922. cameraR.layers.enable( 2 );
  71923. cameraR.viewport = new THREE.Vector4();
  71924. var cameraVR = new ArrayCamera( [ cameraL, cameraR ] );
  71925. cameraVR.layers.enable( 1 );
  71926. cameraVR.layers.enable( 2 );
  71927. //
  71928. this.enabled = false;
  71929. this.getController = function ( id ) {
  71930. var controller = controllers[ id ];
  71931. if ( controller === undefined ) {
  71932. controller = new THREE.Group();
  71933. controller.matrixAutoUpdate = false;
  71934. controller.visible = false;
  71935. controllers[ id ] = controller;
  71936. }
  71937. return controller;
  71938. };
  71939. //
  71940. function onSessionEvent( event ) {
  71941. for ( var i = 0; i < controllers.length; i ++ ) {
  71942. if ( sortedInputSources[ i ] === event.inputSource ) {
  71943. controllers[ i ].dispatchEvent( { type: event.type } );
  71944. }
  71945. }
  71946. }
  71947. function onSessionEnd() {
  71948. renderer.setFramebuffer( null );
  71949. renderer.setRenderTarget( renderer.getRenderTarget() ); // Hack #15830
  71950. animation.stop();
  71951. scope.dispatchEvent( { type: 'sessionend' } );
  71952. }
  71953. function onRequestReferenceSpace( value ) {
  71954. referenceSpace = value;
  71955. animation.setContext( session );
  71956. animation.start();
  71957. scope.dispatchEvent( { type: 'sessionstart' } );
  71958. }
  71959. this.setFramebufferScaleFactor = function ( ) {
  71960. // framebufferScaleFactor = value;
  71961. };
  71962. this.setReferenceSpaceType = function ( value ) {
  71963. referenceSpaceType = value;
  71964. };
  71965. this.getSession = function () {
  71966. return session;
  71967. };
  71968. this.setSession = function ( value ) {
  71969. session = value;
  71970. if ( session !== null ) {
  71971. session.addEventListener( 'select', onSessionEvent );
  71972. session.addEventListener( 'selectstart', onSessionEvent );
  71973. session.addEventListener( 'selectend', onSessionEvent );
  71974. session.addEventListener( 'end', onSessionEnd );
  71975. // eslint-disable-next-line no-undef
  71976. session.updateRenderState( { baseLayer: new XRWebGLLayer( session, gl, { antialias: false } ) } );
  71977. session.requestReferenceSpace( referenceSpaceType ).then( onRequestReferenceSpace );
  71978. //
  71979. session.addEventListener( 'inputsourceschange', updateInputSources );
  71980. updateInputSources();
  71981. }
  71982. };
  71983. function updateInputSources() {
  71984. for ( var i = 0; i < controllers.length; i ++ ) {
  71985. sortedInputSources[ i ] = findInputSource( i );
  71986. }
  71987. }
  71988. function findInputSource( id ) {
  71989. var inputSources = session.inputSources;
  71990. for ( var i = 0; i < inputSources.length; i ++ ) {
  71991. var inputSource = inputSources[ i ];
  71992. var handedness = inputSource.handedness;
  71993. if ( id === 0 && ( handedness === 'none' || handedness === 'right' ) ) return inputSource;
  71994. if ( id === 1 && ( handedness === 'left' ) ) return inputSource;
  71995. }
  71996. }
  71997. //
  71998. function updateCamera( camera, parent ) {
  71999. if ( parent === null ) {
  72000. camera.matrixWorld.copy( camera.matrix );
  72001. } else {
  72002. camera.matrixWorld.multiplyMatrices( parent.matrixWorld, camera.matrix );
  72003. }
  72004. camera.matrixWorldInverse.getInverse( camera.matrixWorld );
  72005. }
  72006. this.getCamera = function ( camera ) {
  72007. if ( isPresenting() ) {
  72008. var parent = camera.parent;
  72009. var cameras = cameraVR.cameras;
  72010. updateCamera( cameraVR, parent );
  72011. for ( var i = 0; i < cameras.length; i ++ ) {
  72012. updateCamera( cameras[ i ], parent );
  72013. }
  72014. // update camera and its children
  72015. camera.matrixWorld.copy( cameraVR.matrixWorld );
  72016. var children = camera.children;
  72017. for ( var i = 0, l = children.length; i < l; i ++ ) {
  72018. children[ i ].updateMatrixWorld( true );
  72019. }
  72020. setProjectionFromUnion( cameraVR, cameraL, cameraR );
  72021. return cameraVR;
  72022. }
  72023. return camera;
  72024. };
  72025. this.isPresenting = isPresenting;
  72026. // Animation Loop
  72027. var onAnimationFrameCallback = null;
  72028. function onAnimationFrame( time, frame ) {
  72029. pose = frame.getViewerPose( referenceSpace );
  72030. if ( pose !== null ) {
  72031. var views = pose.views;
  72032. var baseLayer = session.renderState.baseLayer;
  72033. renderer.setFramebuffer( baseLayer.framebuffer );
  72034. for ( var i = 0; i < views.length; i ++ ) {
  72035. var view = views[ i ];
  72036. var viewport = baseLayer.getViewport( view );
  72037. var viewMatrix = view.transform.inverse.matrix;
  72038. var camera = cameraVR.cameras[ i ];
  72039. camera.matrix.fromArray( viewMatrix ).getInverse( camera.matrix );
  72040. camera.projectionMatrix.fromArray( view.projectionMatrix );
  72041. camera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height );
  72042. if ( i === 0 ) {
  72043. cameraVR.matrix.copy( camera.matrix );
  72044. }
  72045. }
  72046. }
  72047. //
  72048. for ( var i = 0; i < controllers.length; i ++ ) {
  72049. var controller = controllers[ i ];
  72050. var inputSource = sortedInputSources[ i ];
  72051. if ( inputSource ) {
  72052. var inputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace );
  72053. if ( inputPose !== null ) {
  72054. controller.matrix.fromArray( inputPose.transform.matrix );
  72055. controller.matrix.decompose( controller.position, controller.rotation, controller.scale );
  72056. controller.visible = true;
  72057. continue;
  72058. }
  72059. }
  72060. controller.visible = false;
  72061. }
  72062. if ( onAnimationFrameCallback ) onAnimationFrameCallback( time );
  72063. }
  72064. var animation = new WebGLAnimation();
  72065. animation.setAnimationLoop( onAnimationFrame );
  72066. this.setAnimationLoop = function ( callback ) {
  72067. onAnimationFrameCallback = callback;
  72068. };
  72069. this.dispose = function () {};
  72070. // DEPRECATED
  72071. this.getStandingMatrix = function () {
  72072. console.warn( 'THREE.WebXRManager: getStandingMatrix() is no longer needed.' );
  72073. return new THREE.Matrix4();
  72074. };
  72075. this.getDevice = function () {
  72076. console.warn( 'THREE.WebXRManager: getDevice() has been deprecated.' );
  72077. };
  72078. this.setDevice = function () {
  72079. console.warn( 'THREE.WebXRManager: setDevice() has been deprecated.' );
  72080. };
  72081. this.setFrameOfReferenceType = function () {
  72082. console.warn( 'THREE.WebXRManager: setFrameOfReferenceType() has been deprecated.' );
  72083. };
  72084. this.submitFrame = function () {};
  72085. }
  72086. Object.assign( WebXRManager.prototype, THREE.EventDispatcher.prototype );
  72087. THREE.WebXRManager = WebXRManager
  72088. }
  72089. function getWebXRManager(){
  72090. class ArrayCamera extends THREE.PerspectiveCamera {
  72091. constructor(array = []) {
  72092. super();
  72093. this.isArrayCamera = true;
  72094. this.cameras = array;
  72095. }
  72096. }
  72097. class WebXRController {
  72098. constructor() {
  72099. this._targetRay = null;
  72100. this._grip = null;
  72101. this._hand = null;
  72102. }
  72103. getHandSpace() {
  72104. if (this._hand === null) {
  72105. this._hand = new THREE.Group();
  72106. this._hand.matrixAutoUpdate = false;
  72107. this._hand.visible = false;
  72108. this._hand.joints = {};
  72109. this._hand.inputState = {
  72110. pinching: false
  72111. };
  72112. }
  72113. return this._hand;
  72114. }
  72115. getTargetRaySpace() {
  72116. if (this._targetRay === null) {
  72117. this._targetRay = new THREE.Group();
  72118. this._targetRay.matrixAutoUpdate = false;
  72119. this._targetRay.visible = false;
  72120. this._targetRay.hasLinearVelocity = false;
  72121. this._targetRay.linearVelocity = new THREE.Vector3();
  72122. this._targetRay.hasAngularVelocity = false;
  72123. this._targetRay.angularVelocity = new THREE.Vector3();
  72124. }
  72125. return this._targetRay;
  72126. }
  72127. getGripSpace() {
  72128. if (this._grip === null) {
  72129. this._grip = new THREE.Group();
  72130. this._grip.matrixAutoUpdate = false;
  72131. this._grip.visible = false;
  72132. this._grip.hasLinearVelocity = false;
  72133. this._grip.linearVelocity = new THREE.Vector3();
  72134. this._grip.hasAngularVelocity = false;
  72135. this._grip.angularVelocity = new THREE.Vector3();
  72136. }
  72137. return this._grip;
  72138. }
  72139. dispatchEvent(event) {
  72140. if (this._targetRay !== null) {
  72141. this._targetRay.dispatchEvent(event);
  72142. }
  72143. if (this._grip !== null) {
  72144. this._grip.dispatchEvent(event);
  72145. }
  72146. if (this._hand !== null) {
  72147. this._hand.dispatchEvent(event);
  72148. }
  72149. return this;
  72150. }
  72151. disconnect(inputSource) {
  72152. this.dispatchEvent({
  72153. type: 'disconnected',
  72154. data: inputSource
  72155. });
  72156. if (this._targetRay !== null) {
  72157. this._targetRay.visible = false;
  72158. }
  72159. if (this._grip !== null) {
  72160. this._grip.visible = false;
  72161. }
  72162. if (this._hand !== null) {
  72163. this._hand.visible = false;
  72164. }
  72165. return this;
  72166. }
  72167. update(inputSource, frame, referenceSpace) {
  72168. let inputPose = null;
  72169. let gripPose = null;
  72170. let handPose = null;
  72171. const targetRay = this._targetRay;
  72172. const grip = this._grip;
  72173. const hand = this._hand;
  72174. if (inputSource && frame.session.visibilityState !== 'visible-blurred') {
  72175. if (hand && inputSource.hand) {
  72176. handPose = true;
  72177. for (const inputjoint of inputSource.hand.values()) {
  72178. // Update the joints groups with the XRJoint poses
  72179. const jointPose = frame.getJointPose(inputjoint, referenceSpace);
  72180. if (hand.joints[inputjoint.jointName] === undefined) {
  72181. // The transform of this joint will be updated with the joint pose on each frame
  72182. const joint = new THREE.Group();
  72183. joint.matrixAutoUpdate = false;
  72184. joint.visible = false;
  72185. hand.joints[inputjoint.jointName] = joint; // ??
  72186. hand.add(joint);
  72187. }
  72188. const joint = hand.joints[inputjoint.jointName];
  72189. if (jointPose !== null) {
  72190. joint.matrix.fromArray(jointPose.transform.matrix);
  72191. joint.matrix.decompose(joint.position, joint.rotation, joint.scale);
  72192. joint.jointRadius = jointPose.radius;
  72193. }
  72194. joint.visible = jointPose !== null;
  72195. } // Custom events
  72196. // Check pinchz
  72197. const indexTip = hand.joints['index-finger-tip'];
  72198. const thumbTip = hand.joints['thumb-tip'];
  72199. const distance = indexTip.position.distanceTo(thumbTip.position);
  72200. const distanceToPinch = 0.02;
  72201. const threshold = 0.005;
  72202. if (hand.inputState.pinching && distance > distanceToPinch + threshold) {
  72203. hand.inputState.pinching = false;
  72204. this.dispatchEvent({
  72205. type: 'pinchend',
  72206. handedness: inputSource.handedness,
  72207. target: this
  72208. });
  72209. } else if (!hand.inputState.pinching && distance <= distanceToPinch - threshold) {
  72210. hand.inputState.pinching = true;
  72211. this.dispatchEvent({
  72212. type: 'pinchstart',
  72213. handedness: inputSource.handedness,
  72214. target: this
  72215. });
  72216. }
  72217. } else {
  72218. if (grip !== null && inputSource.gripSpace) {
  72219. gripPose = frame.getPose(inputSource.gripSpace, referenceSpace);
  72220. if (gripPose !== null) {
  72221. grip.matrix.fromArray(gripPose.transform.matrix);
  72222. grip.matrix.decompose(grip.position, grip.rotation, grip.scale);
  72223. if (gripPose.linearVelocity) {
  72224. grip.hasLinearVelocity = true;
  72225. grip.linearVelocity.copy(gripPose.linearVelocity);
  72226. } else {
  72227. grip.hasLinearVelocity = false;
  72228. }
  72229. if (gripPose.angularVelocity) {
  72230. grip.hasAngularVelocity = true;
  72231. grip.angularVelocity.copy(gripPose.angularVelocity);
  72232. } else {
  72233. grip.hasAngularVelocity = false;
  72234. }
  72235. }
  72236. }
  72237. }
  72238. if (targetRay !== null) {
  72239. 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
  72240. if (inputPose === null && gripPose !== null) {
  72241. inputPose = gripPose;
  72242. }
  72243. if (inputPose !== null) {
  72244. targetRay.matrix.fromArray(inputPose.transform.matrix);
  72245. targetRay.matrix.decompose(targetRay.position, targetRay.rotation, targetRay.scale);
  72246. if (inputPose.linearVelocity) {
  72247. targetRay.hasLinearVelocity = true;
  72248. targetRay.linearVelocity.copy(inputPose.linearVelocity);
  72249. } else {
  72250. targetRay.hasLinearVelocity = false;
  72251. }
  72252. if (inputPose.angularVelocity) {
  72253. targetRay.hasAngularVelocity = true;
  72254. targetRay.angularVelocity.copy(inputPose.angularVelocity);
  72255. } else {
  72256. targetRay.hasAngularVelocity = false;
  72257. }
  72258. this.dispatchEvent(_moveEvent);
  72259. }
  72260. }
  72261. }
  72262. if (targetRay !== null) {
  72263. targetRay.visible = inputPose !== null;
  72264. }
  72265. if (grip !== null) {
  72266. grip.visible = gripPose !== null;
  72267. }
  72268. if (hand !== null) {
  72269. hand.visible = handPose !== null;
  72270. }
  72271. return this;
  72272. }
  72273. }
  72274. function WebGLAnimation() {
  72275. let context = null;
  72276. let isAnimating = false;
  72277. let animationLoop = null;
  72278. let requestId = null;
  72279. function onAnimationFrame(time, frame) {
  72280. animationLoop(time, frame);
  72281. requestId = context.requestAnimationFrame(onAnimationFrame);
  72282. }
  72283. return {
  72284. start: function () {
  72285. if (isAnimating === true) return;
  72286. if (animationLoop === null) return;
  72287. requestId = context.requestAnimationFrame(onAnimationFrame);
  72288. isAnimating = true;
  72289. },
  72290. stop: function () {
  72291. context.cancelAnimationFrame(requestId);
  72292. isAnimating = false;
  72293. },
  72294. setAnimationLoop: function (callback) {
  72295. animationLoop = callback;
  72296. },
  72297. setContext: function (value) {
  72298. context = value;
  72299. }
  72300. };
  72301. }
  72302. class WebXRManager extends THREE.EventDispatcher {
  72303. constructor(renderer, gl) {
  72304. super();
  72305. const scope = this;
  72306. let session = null;
  72307. let framebufferScaleFactor = 1.0;
  72308. let referenceSpace = null;
  72309. let referenceSpaceType = 'local-floor';
  72310. let customReferenceSpace = null;
  72311. let pose = null;
  72312. let glBinding = null;
  72313. let glProjLayer = null;
  72314. let glBaseLayer = null;
  72315. let xrFrame = null;
  72316. const attributes = gl.getContextAttributes();
  72317. let initialRenderTarget = null;
  72318. let newRenderTarget = null;
  72319. const controllers = [];
  72320. const controllerInputSources = []; //
  72321. const cameraL = new THREE.PerspectiveCamera();
  72322. cameraL.layers.enable(1);
  72323. cameraL.viewport = new THREE.Vector4();
  72324. const cameraR = new THREE.PerspectiveCamera();
  72325. cameraR.layers.enable(2);
  72326. cameraR.viewport = new THREE.Vector4();
  72327. const cameras = [cameraL, cameraR];
  72328. const cameraVR = new ArrayCamera();
  72329. cameraVR.layers.enable(1);
  72330. cameraVR.layers.enable(2);
  72331. let _currentDepthNear = null;
  72332. let _currentDepthFar = null; //
  72333. this.cameraAutoUpdate = true;
  72334. this.enabled = false;
  72335. this.isPresenting = false;
  72336. this.getController = function (index) {
  72337. let controller = controllers[index];
  72338. if (controller === undefined) {
  72339. controller = new WebXRController();
  72340. controllers[index] = controller;
  72341. }
  72342. return controller.getTargetRaySpace();
  72343. };
  72344. this.getControllerGrip = function (index) {
  72345. let controller = controllers[index];
  72346. if (controller === undefined) {
  72347. controller = new WebXRController();
  72348. controllers[index] = controller;
  72349. }
  72350. return controller.getGripSpace();
  72351. };
  72352. this.getHand = function (index) {
  72353. let controller = controllers[index];
  72354. if (controller === undefined) {
  72355. controller = new WebXRController();
  72356. controllers[index] = controller;
  72357. }
  72358. return controller.getHandSpace();
  72359. }; //
  72360. function onSessionEvent(event) {
  72361. const controllerIndex = controllerInputSources.indexOf(event.inputSource);
  72362. if (controllerIndex === -1) {
  72363. return;
  72364. }
  72365. const controller = controllers[controllerIndex];
  72366. if (controller !== undefined) {
  72367. controller.dispatchEvent({
  72368. type: event.type,
  72369. data: event.inputSource
  72370. });
  72371. }
  72372. }
  72373. function onSessionEnd() {
  72374. session.removeEventListener('select', onSessionEvent);
  72375. session.removeEventListener('selectstart', onSessionEvent);
  72376. session.removeEventListener('selectend', onSessionEvent);
  72377. session.removeEventListener('squeeze', onSessionEvent);
  72378. session.removeEventListener('squeezestart', onSessionEvent);
  72379. session.removeEventListener('squeezeend', onSessionEvent);
  72380. session.removeEventListener('end', onSessionEnd);
  72381. session.removeEventListener('inputsourceschange', onInputSourcesChange);
  72382. for (let i = 0; i < controllers.length; i++) {
  72383. const inputSource = controllerInputSources[i];
  72384. if (inputSource === null) continue;
  72385. controllerInputSources[i] = null;
  72386. controllers[i].disconnect(inputSource);
  72387. }
  72388. _currentDepthNear = null;
  72389. _currentDepthFar = null; // restore framebuffer/rendering state
  72390. renderer.setRenderTarget(initialRenderTarget);
  72391. glBaseLayer = null;
  72392. glProjLayer = null;
  72393. glBinding = null;
  72394. session = null;
  72395. newRenderTarget = null; //
  72396. animation.stop();
  72397. scope.isPresenting = false;
  72398. scope.dispatchEvent({
  72399. type: 'sessionend'
  72400. });
  72401. }
  72402. this.setFramebufferScaleFactor = function (value) {
  72403. framebufferScaleFactor = value;
  72404. if (scope.isPresenting === true) {
  72405. console.warn('THREE.WebXRManager: Cannot change framebuffer scale while presenting.');
  72406. }
  72407. };
  72408. this.setReferenceSpaceType = function (value) {
  72409. referenceSpaceType = value;
  72410. if (scope.isPresenting === true) {
  72411. console.warn('THREE.WebXRManager: Cannot change reference space type while presenting.');
  72412. }
  72413. };
  72414. this.getReferenceSpace = function () {
  72415. return customReferenceSpace || referenceSpace;
  72416. };
  72417. this.setReferenceSpace = function (space) {
  72418. customReferenceSpace = space;
  72419. };
  72420. this.getBaseLayer = function () {
  72421. return glProjLayer !== null ? glProjLayer : glBaseLayer;
  72422. };
  72423. this.getBinding = function () {
  72424. return glBinding;
  72425. };
  72426. this.getFrame = function () {
  72427. return xrFrame;
  72428. };
  72429. this.getSession = function () {
  72430. return session;
  72431. };
  72432. this.setSession = async function (value) {
  72433. session = value;
  72434. if (session !== null) {
  72435. initialRenderTarget = renderer.getCurrentRenderTarget();
  72436. session.addEventListener('select', onSessionEvent);
  72437. session.addEventListener('selectstart', onSessionEvent);
  72438. session.addEventListener('selectend', onSessionEvent);
  72439. session.addEventListener('squeeze', onSessionEvent);
  72440. session.addEventListener('squeezestart', onSessionEvent);
  72441. session.addEventListener('squeezeend', onSessionEvent);
  72442. session.addEventListener('end', onSessionEnd);
  72443. session.addEventListener('inputsourceschange', onInputSourcesChange);
  72444. if (attributes.xrCompatible !== true) {
  72445. await gl.makeXRCompatible();
  72446. }
  72447. if (session.renderState.layers === undefined || renderer.capabilities.isWebGL2 === false) {
  72448. const layerInit = {
  72449. antialias: session.renderState.layers === undefined ? attributes.antialias : true,
  72450. alpha: attributes.alpha,
  72451. depth: attributes.depth,
  72452. stencil: attributes.stencil,
  72453. framebufferScaleFactor: framebufferScaleFactor
  72454. };
  72455. glBaseLayer = new XRWebGLLayer(session, gl, layerInit);
  72456. session.updateRenderState({
  72457. baseLayer: glBaseLayer
  72458. });
  72459. newRenderTarget = new THREE.WebGLRenderTarget(glBaseLayer.framebufferWidth, glBaseLayer.framebufferHeight, {
  72460. format: THREE.RGBAFormat,
  72461. type: THREE.UnsignedByteType,
  72462. encoding: renderer.outputEncoding
  72463. });
  72464. } else {
  72465. let depthFormat = null;
  72466. let depthType = null;
  72467. let glDepthFormat = null;
  72468. if (attributes.depth) {
  72469. glDepthFormat = attributes.stencil ? gl.DEPTH24_STENCIL8 : gl.DEPTH_COMPONENT24;
  72470. depthFormat = attributes.stencil ? DepthStencilFormat : DepthFormat;
  72471. depthType = attributes.stencil ? UnsignedInt248Type : UnsignedIntType;
  72472. }
  72473. const projectionlayerInit = {
  72474. colorFormat: gl.RGBA8,
  72475. depthFormat: glDepthFormat,
  72476. scaleFactor: framebufferScaleFactor
  72477. };
  72478. glBinding = new XRWebGLBinding(session, gl);
  72479. glProjLayer = glBinding.createProjectionLayer(projectionlayerInit);
  72480. session.updateRenderState({
  72481. layers: [glProjLayer]
  72482. });
  72483. newRenderTarget = new THREE.WebGLRenderTarget(glProjLayer.textureWidth, glProjLayer.textureHeight, {
  72484. format: THREE.RGBAFormat,
  72485. type: THREE.UnsignedByteType,
  72486. depthTexture: new THREE.DepthTexture(glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat),
  72487. stencilBuffer: attributes.stencil,
  72488. encoding: renderer.outputEncoding,
  72489. samples: attributes.antialias ? 4 : 0
  72490. });
  72491. const renderTargetProperties = renderer.properties.get(newRenderTarget);
  72492. renderTargetProperties.__ignoreDepthValues = glProjLayer.ignoreDepthValues;
  72493. }
  72494. newRenderTarget.isXRRenderTarget = true; // TODO Remove this when possible, see #23278
  72495. // Set foveation to maximum.
  72496. this.setFoveation(1.0);
  72497. customReferenceSpace = null;
  72498. referenceSpace = await session.requestReferenceSpace(referenceSpaceType);
  72499. animation.setContext(session);
  72500. animation.start();
  72501. scope.isPresenting = true;
  72502. scope.dispatchEvent({
  72503. type: 'sessionstart'
  72504. });
  72505. }
  72506. };
  72507. function onInputSourcesChange(event) {
  72508. // Notify disconnected
  72509. for (let i = 0; i < event.removed.length; i++) {
  72510. const inputSource = event.removed[i];
  72511. const index = controllerInputSources.indexOf(inputSource);
  72512. if (index >= 0) {
  72513. controllerInputSources[index] = null;
  72514. controllers[index].dispatchEvent({
  72515. type: 'disconnected',
  72516. data: inputSource
  72517. });
  72518. }
  72519. } // Notify connected
  72520. for (let i = 0; i < event.added.length; i++) {
  72521. const inputSource = event.added[i];
  72522. let controllerIndex = controllerInputSources.indexOf(inputSource);
  72523. if (controllerIndex === -1) {
  72524. // Assign input source a controller that currently has no input source
  72525. for (let i = 0; i < controllers.length; i++) {
  72526. if (i >= controllerInputSources.length) {
  72527. controllerInputSources.push(inputSource);
  72528. controllerIndex = i;
  72529. break;
  72530. } else if (controllerInputSources[i] === null) {
  72531. controllerInputSources[i] = inputSource;
  72532. controllerIndex = i;
  72533. break;
  72534. }
  72535. } // If all controllers do currently receive input we ignore new ones
  72536. if (controllerIndex === -1) break;
  72537. }
  72538. const controller = controllers[controllerIndex];
  72539. if (controller) {
  72540. controller.dispatchEvent({
  72541. type: 'connected',
  72542. data: inputSource
  72543. });
  72544. }
  72545. }
  72546. } //
  72547. const cameraLPos = new THREE.Vector3();
  72548. const cameraRPos = new THREE.Vector3();
  72549. function setProjectionFromUnion(camera, cameraL, cameraR) {
  72550. cameraLPos.setFromMatrixPosition(cameraL.matrixWorld);
  72551. cameraRPos.setFromMatrixPosition(cameraR.matrixWorld);
  72552. const ipd = cameraLPos.distanceTo(cameraRPos);
  72553. const projL = cameraL.projectionMatrix.elements;
  72554. const projR = cameraR.projectionMatrix.elements; // VR systems will have identical far and near planes, and
  72555. // most likely identical top and bottom frustum extents.
  72556. // Use the left camera for these values.
  72557. const near = projL[14] / (projL[10] - 1);
  72558. const far = projL[14] / (projL[10] + 1);
  72559. const topFov = (projL[9] + 1) / projL[5];
  72560. const bottomFov = (projL[9] - 1) / projL[5];
  72561. const leftFov = (projL[8] - 1) / projL[0];
  72562. const rightFov = (projR[8] + 1) / projR[0];
  72563. const left = near * leftFov;
  72564. const right = near * rightFov; // Calculate the new camera's position offset from the
  72565. // left camera. xOffset should be roughly half `ipd`.
  72566. const zOffset = ipd / (-leftFov + rightFov);
  72567. const xOffset = zOffset * -leftFov; // TODO: Better way to apply this offset?
  72568. cameraL.matrixWorld.decompose(camera.position, camera.quaternion, camera.scale);
  72569. camera.translateX(xOffset);
  72570. camera.translateZ(zOffset);
  72571. camera.matrixWorld.compose(camera.position, camera.quaternion, camera.scale);
  72572. camera.matrixWorldInverse.copy(camera.matrixWorld).invert(); // Find the union of the frustum values of the cameras and scale
  72573. // the values so that the near plane's position does not change in world space,
  72574. // although must now be relative to the new union camera.
  72575. const near2 = near + zOffset;
  72576. const far2 = far + zOffset;
  72577. const left2 = left - xOffset;
  72578. const right2 = right + (ipd - xOffset);
  72579. const top2 = topFov * far / far2 * near2;
  72580. const bottom2 = bottomFov * far / far2 * near2;
  72581. camera.projectionMatrix.makePerspective(left2, right2, top2, bottom2, near2, far2);
  72582. }
  72583. function updateCamera(camera, parent) {
  72584. if (parent === null) {
  72585. camera.matrixWorld.copy(camera.matrix);
  72586. } else {
  72587. camera.matrixWorld.multiplyMatrices(parent.matrixWorld, camera.matrix);
  72588. }
  72589. camera.matrixWorldInverse.copy(camera.matrixWorld).invert();
  72590. }
  72591. this.updateCamera = function (camera) {
  72592. if (session === null) return;
  72593. cameraVR.near = cameraR.near = cameraL.near = camera.near;
  72594. cameraVR.far = cameraR.far = cameraL.far = camera.far;
  72595. if (_currentDepthNear !== cameraVR.near || _currentDepthFar !== cameraVR.far) {
  72596. // Note that the new renderState won't apply until the next frame. See #18320
  72597. session.updateRenderState({
  72598. depthNear: cameraVR.near,
  72599. depthFar: cameraVR.far
  72600. });
  72601. _currentDepthNear = cameraVR.near;
  72602. _currentDepthFar = cameraVR.far;
  72603. }
  72604. const parent = camera.parent;
  72605. const cameras = cameraVR.cameras;
  72606. updateCamera(cameraVR, parent);
  72607. for (let i = 0; i < cameras.length; i++) {
  72608. updateCamera(cameras[i], parent);
  72609. }
  72610. cameraVR.matrixWorld.decompose(cameraVR.position, cameraVR.quaternion, cameraVR.scale); // update user camera and its children
  72611. camera.position.copy(cameraVR.position);
  72612. camera.quaternion.copy(cameraVR.quaternion);
  72613. camera.scale.copy(cameraVR.scale);
  72614. camera.matrix.copy(cameraVR.matrix);
  72615. camera.matrixWorld.copy(cameraVR.matrixWorld);
  72616. const children = camera.children;
  72617. for (let i = 0, l = children.length; i < l; i++) {
  72618. children[i].updateMatrixWorld(true);
  72619. } // update projection matrix for proper view frustum culling
  72620. if (cameras.length === 2) {
  72621. setProjectionFromUnion(cameraVR, cameraL, cameraR);
  72622. } else {
  72623. // assume single camera setup (AR)
  72624. cameraVR.projectionMatrix.copy(cameraL.projectionMatrix);
  72625. }
  72626. };
  72627. this.getCamera = function () {
  72628. return cameraVR;
  72629. };
  72630. this.getFoveation = function () {
  72631. if (glProjLayer !== null) {
  72632. return glProjLayer.fixedFoveation;
  72633. }
  72634. if (glBaseLayer !== null) {
  72635. return glBaseLayer.fixedFoveation;
  72636. }
  72637. return undefined;
  72638. };
  72639. this.setFoveation = function (foveation) {
  72640. // 0 = no foveation = full resolution
  72641. // 1 = maximum foveation = the edges render at lower resolution
  72642. if (glProjLayer !== null) {
  72643. glProjLayer.fixedFoveation = foveation;
  72644. }
  72645. if (glBaseLayer !== null && glBaseLayer.fixedFoveation !== undefined) {
  72646. glBaseLayer.fixedFoveation = foveation;
  72647. }
  72648. }; // Animation Loop
  72649. let onAnimationFrameCallback = null;
  72650. function onAnimationFrame(time, frame) {
  72651. pose = frame.getViewerPose(customReferenceSpace || referenceSpace);
  72652. xrFrame = frame;
  72653. if (pose !== null) {
  72654. const views = pose.views;
  72655. if (glBaseLayer !== null) {
  72656. renderer.setRenderTargetFramebuffer(newRenderTarget, glBaseLayer.framebuffer);
  72657. renderer.setRenderTarget(newRenderTarget);
  72658. }
  72659. let cameraVRNeedsUpdate = false; // check if it's necessary to rebuild cameraVR's camera list
  72660. if (views.length !== cameraVR.cameras.length) {
  72661. cameraVR.cameras.length = 0;
  72662. cameraVRNeedsUpdate = true;
  72663. }
  72664. for (let i = 0; i < views.length; i++) {
  72665. const view = views[i];
  72666. let viewport = null;
  72667. if (glBaseLayer !== null) {
  72668. viewport = glBaseLayer.getViewport(view);
  72669. } else {
  72670. const glSubImage = glBinding.getViewSubImage(glProjLayer, view);
  72671. viewport = glSubImage.viewport; // For side-by-side projection, we only produce a single texture for both eyes.
  72672. if (i === 0) {
  72673. renderer.setRenderTargetTextures(newRenderTarget, glSubImage.colorTexture, glProjLayer.ignoreDepthValues ? undefined : glSubImage.depthStencilTexture);
  72674. renderer.setRenderTarget(newRenderTarget);
  72675. }
  72676. }
  72677. let camera = cameras[i];
  72678. if (camera === undefined) {
  72679. camera = new THREE.PerspectiveCamera();
  72680. camera.layers.enable(i);
  72681. camera.viewport = new THREE.Vector4();
  72682. cameras[i] = camera;
  72683. }
  72684. camera.matrix.fromArray(view.transform.matrix);
  72685. camera.projectionMatrix.fromArray(view.projectionMatrix);
  72686. camera.viewport.set(viewport.x, viewport.y, viewport.width, viewport.height);
  72687. if (i === 0) {
  72688. cameraVR.matrix.copy(camera.matrix);
  72689. }
  72690. if (cameraVRNeedsUpdate === true) {
  72691. cameraVR.cameras.push(camera);
  72692. }
  72693. }
  72694. } //
  72695. for (let i = 0; i < controllers.length; i++) {
  72696. const inputSource = controllerInputSources[i];
  72697. const controller = controllers[i];
  72698. if (inputSource !== null && controller !== undefined) {
  72699. controller.update(inputSource, frame, customReferenceSpace || referenceSpace);
  72700. }
  72701. }
  72702. if (onAnimationFrameCallback) onAnimationFrameCallback(time, frame);
  72703. xrFrame = null;
  72704. }
  72705. const animation = new WebGLAnimation();
  72706. animation.setAnimationLoop(onAnimationFrame);
  72707. this.setAnimationLoop = function (callback) {
  72708. onAnimationFrameCallback = callback;
  72709. };
  72710. this.dispose = function () {};
  72711. }
  72712. }
  72713. THREE.WebXRManager = WebXRManager
  72714. } */
  72715. /*
  72716. var addMagnifier = function(){
  72717. class Magnifier extends THREE.Object3D {
  72718. constructor () {
  72719. super()
  72720. let circleGeo = new THREE.CircleGeometry(0.1, 100);
  72721. this.camera = new THREE.PerspectiveCamera(50, 1, 0.1, 1); //fov aspect near far
  72722. this.renderTarget = new THREE.WebGLRenderTarget(256,256, {
  72723. minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter,
  72724. format: THREE.RGBAFormat ,
  72725. //type: THREE.FloatType,
  72726. //minFilter: THREE.NearestFilter,
  72727. //magFilter: THREE.NearestFilter,
  72728. } )
  72729. this.mesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  72730. side: THREE.DoubleSide ,
  72731. map: this.renderTarget.texture ,
  72732. transparent:true,
  72733. depthTest: !1,
  72734. depthWrite: !1,
  72735. }))
  72736. this.overlayMesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  72737. side: THREE.DoubleSide ,
  72738. map: Texture.load('images/crosshair.png') ,
  72739. transparent:true,
  72740. depthTest: !1,
  72741. depthWrite: !1,
  72742. }))
  72743. this.add(this.mesh)
  72744. this.add(this.overlayMesh)
  72745. player.model.add(this);
  72746. player.magnifier = this;
  72747. }
  72748. update(aimPos){
  72749. const magDistance_ = 0.3;
  72750. var playerPos = player.position
  72751. var vec = playerPos.clone().sub(aimPos).normalize().multiplyScalar(magDistance_)
  72752. this.camera.position.copy(aimPos.clone().add(vec))
  72753. this.camera.lookAt(aimPos)
  72754. var playerCamera = player.camera
  72755. this.quaternion.copy(playerCamera.quaternion);
  72756. var pos2d = player.mouse.clone();
  72757. var shift = 400;
  72758. var clientHeight = player.domElement.clientHeight
  72759. var clientY = - (pos2d.y - 1) * clientHeight / 2;
  72760. pos2d.y = clientY < 300 ? pos2d.y - shift/clientHeight : pos2d.y + shift/clientHeight
  72761. let newPos = new THREE.Vector3(pos2d.x,pos2d.y,0.7).unproject(playerCamera);
  72762. this.position.copy(newPos)
  72763. var renderer = player.sceneRenderer.renderer
  72764. var oldAutoClear = renderer.autoClear
  72765. renderer.autoClear = false
  72766. //renderer.clear( true, true, true );
  72767. renderer.render(player.sceneRenderer.scene, this.camera, this.renderTarget, true)
  72768. renderer.autoClear = oldAutoClear
  72769. }
  72770. }
  72771. new Magnifier()
  72772. }
  72773. */
  72774. /*
  72775. 笔记:
  72776. 导览缩放的几处: 1 搜索smoothZoomFovTo 2 flightStepWalk里
  72777. {
  72778. //到导览中某个点位(假设点位不重复)
  72779. var id = 73
  72780. var p = player.model.heroLocations.find(e=>e.heroLocations && e.heroLocations.find(e=>e.panoId == id))
  72781. var i = player.model.heroLocations.indexOf(p)
  72782. var p1 = p.heroLocations.find(e=>e.panoId == id)
  72783. var j = p.heroLocations.indexOf(p1)
  72784. player.director.goToHighlight([i,j])
  72785. }
  72786. 展示版导览改为就近导览,所以一开始并非第一个。如果在最后一个点上会自动从头开始
  72787. 关于pc-nav 4k
  72788. 两种选择,1 按照正常流程,因为nav为4k所以直接使用4k的tiledPanoRenderTarget, 但useUltraHighResolutionPanos需要开启才能达到4k,否则是2k。这样的话第一个点位需要手动重新替换tiledPanoRenderTarget,所以废弃
  72789. 2 使zoomed一直为true,直接使用zoomRenderTarget。 参考之前写过的三屏的本地4k。 且创建的tiledPanoRenderTarget不能超过2048否则过渡卡顿;且直到到达该点后才能下载4k,否则不会渲染到zoomRenderTarget上
  72790. */