main_2020_edit.js 2.5 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494
  1. if (
  2. ((function () {
  3. 'use strict'
  4. function o(e, t) {
  5. return typeof e === t
  6. }
  7. function a(e, t) {
  8. return e instanceof t
  9. }
  10. function s(e) {
  11. return e && e.nodeType
  12. }
  13. function l(e) {
  14. return s(e) ? e : a(e, y) ? e[0] : void 0
  15. }
  16. function e(e, i, n) {
  17. return (
  18. y.each(e, function (e, t) {
  19. n = i.call(t, n, e, t)
  20. }),
  21. n
  22. )
  23. }
  24. function t(e, t, i) {
  25. var n, r, o
  26. if (e === t) return !0
  27. if (!e || !t || e.constructor !== t.constructor) return !1
  28. for (n = 0, r = i.length; n < r; n += 1) {
  29. if (e[(o = i[n])] && E(e[o].equals) && !e[o].equals(t[o])) return !1
  30. if (e[o] !== t[o]) return !1
  31. }
  32. return !0
  33. }
  34. function c(e, t, i, n) {
  35. ;(this.left = w(e)), (this.top = w(t)), (this.width = w(i)), (this.height = w(n)), (this.right = this.left + this.width), (this.bottom = this.top + this.height)
  36. }
  37. function h(e, t, i, n) {
  38. ;(this.visible = e || 0), (this.viewport = t || 0), (this.possible = i || 0), (this.rects = (n && I({}, n)) || null)
  39. }
  40. function r(e, t) {
  41. ;(this.els = e), (this.viewport = t)
  42. }
  43. function n(e, t) {
  44. return e.val - t.val
  45. }
  46. function u(e, t) {
  47. return t.val - e.val
  48. }
  49. function d(e) {
  50. var t = c.ofContent(e, !0),
  51. i = c.ofViewport(e, !0),
  52. n = t.width - i.width,
  53. r = t.height - i.height
  54. ;(this.content = t),
  55. (this.viewport = i),
  56. (this.width = n <= 0 ? null : i.left / n),
  57. (this.height = r <= 0 ? null : i.top / r),
  58. (this.left = i.left),
  59. (this.top = i.top),
  60. (this.right = t.right - i.right),
  61. (this.bottom = t.bottom - i.bottom)
  62. }
  63. function p(e) {
  64. this.el = e || window
  65. }
  66. function f(e, t) {
  67. ;(this.context = e), (this.viewport = t), this.init()
  68. }
  69. function g(e, t, i, n) {
  70. ;(this.context = new r(e, t)), (this.property = i), (this.descending = n), this.init()
  71. }
  72. function m(e) {
  73. e && e !== window && e !== document ? ((this.context = e), (this.$autoTarget = y(e))) : (this.context = window), this.init()
  74. }
  75. var i,
  76. v,
  77. y = jQuery,
  78. A = y(window),
  79. C = y(document),
  80. I = y.extend,
  81. E = y.isFunction,
  82. _ = Math.max,
  83. b = Math.min,
  84. w = Math.round,
  85. T =
  86. ((i = {}),
  87. (v = 1),
  88. function (e) {
  89. return e ? (i[e] || ((i[e] = v), (v += 1)), i[e]) : 0
  90. })
  91. I(c.prototype, {
  92. equals: function (e) {
  93. return t(this, e, ['left', 'top', 'width', 'height'])
  94. },
  95. area: function () {
  96. return this.width * this.height
  97. },
  98. relativeTo: function (e) {
  99. return new c(this.left - e.left, this.top - e.top, this.width, this.height)
  100. },
  101. intersection: function (e) {
  102. if (!a(e, c)) return null
  103. var t = _(this.left, e.left),
  104. i = b(this.right, e.right),
  105. n = _(this.top, e.top),
  106. r = i - t,
  107. o = b(this.bottom, e.bottom) - n
  108. return 0 <= r && 0 <= o ? new c(t, n, r, o) : null
  109. },
  110. envelope: function (e) {
  111. if (!a(e, c)) return this
  112. var t = b(this.left, e.left),
  113. i = _(this.right, e.right),
  114. n = b(this.top, e.top)
  115. return new c(t, n, i - t, _(this.bottom, e.bottom) - n)
  116. }
  117. }),
  118. I(c, {
  119. ofContent: function (e, t) {
  120. return e && e !== document && e !== window
  121. ? t
  122. ? new c(0, 0, e.scrollWidth, e.scrollHeight)
  123. : new c(e.offsetLeft - e.scrollLeft, e.offsetTop - e.scrollTop, e.scrollWidth, e.scrollHeight)
  124. : new c(0, 0, C.width(), C.height())
  125. },
  126. ofViewport: function (e, t) {
  127. return e && e !== document && e !== window
  128. ? t
  129. ? new c(e.scrollLeft, e.scrollTop, e.clientWidth, e.clientHeight)
  130. : new c(e.offsetLeft, e.offsetTop, e.clientWidth, e.clientHeight)
  131. : new c(A.scrollLeft(), A.scrollTop(), A.width(), A.height())
  132. },
  133. ofElement: function (e) {
  134. var t = y(e)
  135. if (!t.is(':visible')) return null
  136. var i = t.offset()
  137. return new c(i.left, i.top, t.outerWidth(), t.outerHeight())
  138. }
  139. }),
  140. I(h.prototype, {
  141. equals: function (e) {
  142. return this.fracsEqual(e) && this.rectsEqual(e)
  143. },
  144. fracsEqual: function (e) {
  145. return t(this, e, ['visible', 'viewport', 'possible'])
  146. },
  147. rectsEqual: function (e) {
  148. return t(this.rects, e.rects, ['document', 'element', 'viewport'])
  149. }
  150. }),
  151. I(h, {
  152. of: function (e, t) {
  153. var i, n, r
  154. return (
  155. (e = (s(e) && c.ofElement(e)) || e),
  156. (t = (s(t) && c.ofViewport(t)) || t || c.ofViewport()),
  157. e instanceof c && (i = e.intersection(t))
  158. ? ((n = i.area()),
  159. (r = b(e.width, t.width) * b(e.height, t.height)),
  160. new h(n / e.area(), n / t.area(), n / r, {
  161. document: i,
  162. element: i.relativeTo(e),
  163. viewport: i.relativeTo(t)
  164. }))
  165. : new h()
  166. )
  167. }
  168. })
  169. var x = ['width', 'height', 'left', 'right', 'top', 'bottom'],
  170. S = ['possible', 'visible', 'viewport']
  171. I(r.prototype, {
  172. sorted: function (t, e) {
  173. var i = this.viewport
  174. return y
  175. .map(this.els, function (e) {
  176. return {
  177. el: e,
  178. val: (function (e, t, i) {
  179. var n
  180. return 0 <= y.inArray(i, x) ? (n = c.ofElement(e)) : 0 <= y.inArray(i, S) && (n = h.of(e, t)), n ? n[i] : 0
  181. })(e, i, t)
  182. }
  183. })
  184. .sort(e ? u : n)
  185. },
  186. best: function (e, t) {
  187. return this.els.length ? this.sorted(e, t)[0] : null
  188. }
  189. }),
  190. I(d.prototype, {
  191. equals: function (e) {
  192. return t(this, e, ['width', 'height', 'left', 'top', 'right', 'bottom', 'content', 'viewport'])
  193. }
  194. }),
  195. I(p.prototype, {
  196. equals: function (e) {
  197. return t(this, e, ['el'])
  198. },
  199. scrollState: function () {
  200. return new d(this.el)
  201. },
  202. scrollTo: function (e, t, i) {
  203. var n = y(this.el === window ? 'html,body' : this.el)
  204. ;(e = e || 0),
  205. (t = t || 0),
  206. (i = isNaN(i) ? 1e3 : i),
  207. n.stop(!0).animate(
  208. {
  209. scrollLeft: e,
  210. scrollTop: t
  211. },
  212. i
  213. )
  214. },
  215. scroll: function (e, t, i) {
  216. var n = this.el === window ? A : y(this.el)
  217. ;(e = e || 0), (t = t || 0), this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
  218. },
  219. scrollToRect: function (e, t, i, n) {
  220. ;(t = t || 0), (i = i || 0), this.scrollTo(e.left - t, e.top - i, n)
  221. },
  222. scrollToElement: function (e, t, i, n) {
  223. var r = c.ofElement(e).relativeTo(c.ofContent(this.el))
  224. this.scrollToRect(r, t, i, n)
  225. }
  226. })
  227. var M = {
  228. init: function () {
  229. ;(this.callbacks = y.Callbacks('memory unique')), (this.currVal = null), (this.prevVal = null), (this.checkProxy = y.proxy(this.check, this)), this.autoCheck()
  230. },
  231. bind: function (e) {
  232. this.callbacks.add(e)
  233. },
  234. unbind: function (e) {
  235. e ? this.callbacks.remove(e) : this.callbacks.empty()
  236. },
  237. trigger: function () {
  238. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  239. },
  240. check: function (e) {
  241. var t = this.updatedValue(e)
  242. return void 0 !== t && ((this.prevVal = this.currVal), (this.currVal = t), this.trigger(), !0)
  243. },
  244. $autoTarget: A,
  245. autoEvents: 'load resize scroll',
  246. autoCheck: function (e) {
  247. this.$autoTarget[!1 === e ? 'off' : 'on'](this.autoEvents, this.checkProxy)
  248. }
  249. }
  250. I(f.prototype, M, {
  251. updatedValue: function () {
  252. var e = h.of(this.context, this.viewport)
  253. return this.currVal && this.currVal.equals(e) ? void 0 : e
  254. }
  255. }),
  256. I(g.prototype, M, {
  257. updatedValue: function () {
  258. var e = this.context.best(this.property, this.descending)
  259. return e && ((e = 0 < e.val ? e.el : null), this.currVal !== e) ? e : void 0
  260. }
  261. }),
  262. I(m.prototype, M, {
  263. updatedValue: function () {
  264. var e = new d(this.context)
  265. return this.currVal && this.currVal.equals(e) ? void 0 : e
  266. }
  267. })
  268. var R,
  269. P,
  270. O,
  271. L,
  272. D,
  273. N,
  274. F,
  275. B,
  276. V,
  277. k,
  278. U = 'fracs'
  279. function H(e, t, i, n) {
  280. return (i = N(i) ? i.apply(e, t) : i), N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
  281. }
  282. ;(R = U),
  283. (P = {
  284. statics: {
  285. version: '0.15.0',
  286. Rect: c,
  287. Fractions: h,
  288. Group: r,
  289. ScrollState: d,
  290. Viewport: p,
  291. FracsCallbacks: f,
  292. GroupCallbacks: g,
  293. ScrollStateCallbacks: m,
  294. fracs: function (e, t) {
  295. return h.of(e, t)
  296. }
  297. },
  298. methods: {
  299. content: function (e) {
  300. return this.length ? c.ofContent(this[0], e) : null
  301. },
  302. envelope: function () {
  303. return e(this, function (e) {
  304. var t = c.ofElement(this)
  305. return e ? e.envelope(t) : t
  306. })
  307. },
  308. fracs: function (e, i, n) {
  309. o(e, 'string') || ((n = i), (i = e), (e = null)), E(i) || ((n = i), (i = null)), (n = l(n))
  310. var r = U + '.fracs.' + T(n)
  311. return 'unbind' === e
  312. ? this.each(function () {
  313. var e = y(this).data(r)
  314. e && e.unbind(i)
  315. })
  316. : 'check' === e
  317. ? this.each(function () {
  318. var e = y(this).data(r)
  319. e && e.check()
  320. })
  321. : E(i)
  322. ? this.each(function () {
  323. var e = y(this),
  324. t = e.data(r)
  325. t || ((t = new f(this, n)), e.data(r, t)), t.bind(i)
  326. })
  327. : this.length
  328. ? h.of(this[0], n)
  329. : null
  330. },
  331. intersection: function () {
  332. return e(this, function (e) {
  333. var t = c.ofElement(this)
  334. return e ? e.intersection(t) : t
  335. })
  336. },
  337. max: function (e, t, i) {
  338. return E(t) || ((i = t), (t = null)), (i = l(i)), t ? (new g(this, i, e, !0).bind(t), this) : this.pushStack(new r(this, i).best(e, !0).el)
  339. },
  340. min: function (e, t, i) {
  341. return E(t) || ((i = t), (t = null)), (i = l(i)), t ? (new g(this, i, e).bind(t), this) : this.pushStack(new r(this, i).best(e).el)
  342. },
  343. rect: function () {
  344. return this.length ? c.ofElement(this[0]) : null
  345. },
  346. scrollState: function (e, i) {
  347. var n = U + '.scrollState'
  348. return (
  349. o(e, 'string') || ((i = e), (e = null)),
  350. 'unbind' === e
  351. ? this.each(function () {
  352. var e = y(this).data(n)
  353. e && e.unbind(i)
  354. })
  355. : 'check' === e
  356. ? this.each(function () {
  357. var e = y(this).data(n)
  358. e && e.check()
  359. })
  360. : E(i)
  361. ? this.each(function () {
  362. var e = y(this),
  363. t = e.data(n)
  364. t || ((t = new m(this)), e.data(n, t)), t.bind(i)
  365. })
  366. : this.length
  367. ? new d(this[0])
  368. : null
  369. )
  370. },
  371. scroll: function (e, t, i) {
  372. return this.each(function () {
  373. new p(this).scroll(e, t, i)
  374. })
  375. },
  376. scrollTo: function (e, t, i, n) {
  377. return (
  378. y.isNumeric(e) && ((n = i), (i = t), (t = e), (e = null)),
  379. (e = l(e)),
  380. this.each(function () {
  381. e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
  382. })
  383. )
  384. },
  385. scrollToThis: function (e, t, i, n) {
  386. return (n = new p(l(n))).scrollToElement(this[0], e, t, i), this
  387. },
  388. softLink: function (t, i, n, r) {
  389. return (
  390. (r = new p(l(r))),
  391. this.filter('a[href^=#]').each(function () {
  392. var e = y(this)
  393. e.on('click', function () {
  394. r.scrollToElement(y(e.attr('href'))[0], t, i, n)
  395. })
  396. })
  397. )
  398. },
  399. sort: function (e, t, i) {
  400. return (
  401. o(t, 'boolean') || ((i = t), (t = null)),
  402. (i = l(i)),
  403. this.pushStack(
  404. y.map(new r(this, i).sorted(e, !t), function (e) {
  405. return e.el
  406. })
  407. )
  408. )
  409. },
  410. viewport: function (e) {
  411. return this.length ? c.ofViewport(this[0], e) : null
  412. }
  413. },
  414. defaultStatic: 'fracs',
  415. defaultMethod: 'fracs'
  416. }),
  417. (O = [].slice),
  418. (L = jQuery),
  419. (D = L.extend),
  420. (N = L.isFunction),
  421. (F = D({}, P)),
  422. (B = function () {
  423. return H(this, O.call(arguments), F.defaultStatic, B)
  424. }),
  425. (V = function (e) {
  426. return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
  427. }),
  428. ((k = function (e) {
  429. e && (D(B, e.statics), D(V, e.methods)), (B.modplug = k)
  430. }).prev = {
  431. statics: L[R],
  432. methods: L.fn[R]
  433. }),
  434. k(P),
  435. (L[R] = B),
  436. (L.fn[R] = V)
  437. })(),
  438. 'undefined' == typeof jQuery)
  439. )
  440. throw new Error("Bootstrap's JavaScript requires jQuery")
  441. !(function (m) {
  442. 'use strict'
  443. function r(e, t) {
  444. ;(this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null), this.init('tooltip', e, t)
  445. }
  446. ;(r.VERSION = '3.2.0'),
  447. (r.DEFAULTS = {
  448. animation: !0,
  449. placement: 'top',
  450. selector: !1,
  451. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  452. trigger: 'hover focus',
  453. title: '',
  454. delay: 0,
  455. html: !1,
  456. container: !1,
  457. viewport: {
  458. selector: 'body',
  459. padding: 0
  460. }
  461. }),
  462. (r.prototype.init = function (e, t, i) {
  463. ;(this.enabled = !0),
  464. (this.type = e),
  465. (this.$element = m(t)),
  466. (this.options = this.getOptions(i)),
  467. (this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport))
  468. for (var n = this.options.trigger.split(' '), r = n.length; r--; ) {
  469. var o = n[r]
  470. if ('click' == o) this.$element.on('click.' + this.type, this.options.selector, m.proxy(this.toggle, this))
  471. else if ('manual' != o) {
  472. var a = 'hover' == o ? 'mouseenter' : 'focusin',
  473. s = 'hover' == o ? 'mouseleave' : 'focusout'
  474. this.$element.on(a + '.' + this.type, this.options.selector, m.proxy(this.enter, this)), this.$element.on(s + '.' + this.type, this.options.selector, m.proxy(this.leave, this))
  475. }
  476. }
  477. this.options.selector
  478. ? (this._options = m.extend({}, this.options, {
  479. trigger: 'manual',
  480. selector: ''
  481. }))
  482. : this.fixTitle()
  483. }),
  484. (r.prototype.getDefaults = function () {
  485. return r.DEFAULTS
  486. }),
  487. (r.prototype.getOptions = function (e) {
  488. return (
  489. (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay &&
  490. 'number' == typeof e.delay &&
  491. (e.delay = {
  492. show: e.delay,
  493. hide: e.delay
  494. }),
  495. e
  496. )
  497. }),
  498. (r.prototype.getDelegateOptions = function () {
  499. var i = {},
  500. n = this.getDefaults()
  501. return (
  502. this._options &&
  503. m.each(this._options, function (e, t) {
  504. n[e] != t && (i[e] = t)
  505. }),
  506. i
  507. )
  508. }),
  509. (r.prototype.enter = function (e) {
  510. var t = e instanceof this.constructor ? e : m(e.currentTarget).data('bs.' + this.type)
  511. return (
  512. t || ((t = new this.constructor(e.currentTarget, this.getDelegateOptions())), m(e.currentTarget).data('bs.' + this.type, t)),
  513. clearTimeout(t.timeout),
  514. (t.hoverState = 'in'),
  515. t.options.delay && t.options.delay.show ? void (t.timeout = setTimeout(function () {}, t.options.delay.show)) : t.show()
  516. )
  517. }),
  518. (r.prototype.leave = function (e) {
  519. var t = e instanceof this.constructor ? e : m(e.currentTarget).data('bs.' + this.type)
  520. return (
  521. t || ((t = new this.constructor(e.currentTarget, this.getDelegateOptions())), m(e.currentTarget).data('bs.' + this.type, t)),
  522. clearTimeout(t.timeout),
  523. (t.hoverState = 'out'),
  524. t.options.delay && t.options.delay.hide
  525. ? void (t.timeout = setTimeout(function () {
  526. 'out' == t.hoverState && t.hide()
  527. }, t.options.delay.hide))
  528. : t.hide()
  529. )
  530. }),
  531. (r.prototype.show = function () {
  532. var e = m.Event('show.bs.' + this.type)
  533. if (this.hasContent() && this.enabled) {
  534. this.$element.trigger(e)
  535. var t = m.contains(document.documentElement, this.$element[0])
  536. if (e.isDefaultPrevented() || !t) return
  537. var i = this,
  538. n = this.tip(),
  539. r = this.getUID(this.type)
  540. this.setContent(), n.attr('id', r), this.$element.attr('aria-describedby', r), this.options.animation && n.addClass('fade')
  541. var o = 'function' == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement,
  542. a = /\s?auto?\s?/i,
  543. s = a.test(o)
  544. s && (o = o.replace(a, '') || 'top'),
  545. n
  546. .detach()
  547. .css({
  548. top: 0,
  549. left: 0,
  550. display: 'block'
  551. })
  552. .addClass(o)
  553. .data('bs.' + this.type, this),
  554. this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element)
  555. var l = this.getPosition(),
  556. c = n[0].offsetWidth,
  557. h = n[0].offsetHeight
  558. if (s) {
  559. var u = o,
  560. d = this.$element.parent(),
  561. p = this.getPosition(d)
  562. ;(o =
  563. 'bottom' == o && l.top + l.height + h - p.scroll > p.height
  564. ? 'top'
  565. : 'top' == o && l.top - p.scroll - h < 0
  566. ? 'bottom'
  567. : 'right' == o && l.right + c > p.width
  568. ? 'left'
  569. : 'left' == o && l.left - c < p.left
  570. ? 'right'
  571. : o),
  572. n.removeClass(u).addClass(o)
  573. }
  574. var f = this.getCalculatedOffset(o, l, c, h)
  575. this.applyPlacement(f, o)
  576. var g = function () {
  577. i.$element.trigger('shown.bs.' + i.type), (i.hoverState = null)
  578. }
  579. m.support.transition && this.$tip.hasClass('fade') ? n.one('bsTransitionEnd', g).emulateTransitionEnd(150) : g()
  580. }
  581. }),
  582. (r.prototype.applyPlacement = function (e, t) {
  583. var i = this.tip(),
  584. n = i[0].offsetWidth,
  585. r = i[0].offsetHeight,
  586. o = parseInt(i.css('margin-top'), 10),
  587. a = parseInt(i.css('margin-left'), 10)
  588. isNaN(o) && (o = 0),
  589. isNaN(a) && (a = 0),
  590. (e.top = e.top + o),
  591. (e.left = e.left + a),
  592. m.offset.setOffset(
  593. i[0],
  594. m.extend(
  595. {
  596. using: function (e) {
  597. i.css({
  598. top: Math.round(e.top),
  599. left: Math.round(e.left)
  600. })
  601. }
  602. },
  603. e
  604. ),
  605. 0
  606. ),
  607. i.addClass('in')
  608. var s = i[0].offsetWidth,
  609. l = i[0].offsetHeight
  610. 'top' == t && l != r && (e.top = e.top + r - l)
  611. var c = this.getViewportAdjustedDelta(t, e, s, l)
  612. c.left ? (e.left += c.left) : (e.top += c.top)
  613. var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l,
  614. u = c.left ? 'left' : 'top',
  615. d = c.left ? 'offsetWidth' : 'offsetHeight'
  616. i.offset(e), this.replaceArrow(h, i[0][d], u)
  617. }),
  618. (r.prototype.replaceArrow = function (e, t, i) {
  619. this.arrow().css(i, e ? 50 * (1 - e / t) + '%' : '')
  620. }),
  621. (r.prototype.setContent = function () {
  622. var e = this.tip(),
  623. t = this.getTitle()
  624. e.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](t), e.removeClass('fade in top bottom left right')
  625. }),
  626. (r.prototype.hide = function () {
  627. function e() {
  628. 'in' != t.hoverState && i.detach(), t.$element.trigger('hidden.bs.' + t.type)
  629. }
  630. var t = this,
  631. i = this.tip(),
  632. n = m.Event('hide.bs.' + this.type)
  633. if ((this.$element.removeAttr('aria-describedby'), this.$element.trigger(n), !n.isDefaultPrevented()))
  634. return i.removeClass('in'), m.support.transition && this.$tip.hasClass('fade') ? i.one('bsTransitionEnd', e).emulateTransitionEnd(150) : e(), (this.hoverState = null), this
  635. }),
  636. (r.prototype.fixTitle = function () {
  637. var e = this.$element
  638. ;(!e.attr('title') && 'string' == typeof e.attr('data-original-title')) || e.attr('data-original-title', e.attr('title') || '').attr('title', '')
  639. }),
  640. (r.prototype.hasContent = function () {
  641. return this.getTitle()
  642. }),
  643. (r.prototype.getPosition = function (e) {
  644. var t = (e = e || this.$element)[0],
  645. i = 'BODY' == t.tagName
  646. return m.extend(
  647. {},
  648. 'function' == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null,
  649. {
  650. scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  651. width: i ? m(window).width() : e.outerWidth(),
  652. height: i ? m(window).height() : e.outerHeight()
  653. },
  654. i
  655. ? {
  656. top: 0,
  657. left: 0
  658. }
  659. : e.offset()
  660. )
  661. }),
  662. (r.prototype.getCalculatedOffset = function (e, t, i, n) {
  663. return 'bottom' == e
  664. ? {
  665. top: t.top + t.height,
  666. left: t.left + t.width / 2 - i / 2
  667. }
  668. : 'top' == e
  669. ? {
  670. top: t.top - n,
  671. left: t.left + t.width / 2 - i / 2
  672. }
  673. : 'left' == e
  674. ? {
  675. top: t.top + t.height / 2 - n / 2,
  676. left: t.left - i
  677. }
  678. : {
  679. top: t.top + t.height / 2 - n / 2,
  680. left: t.left + t.width
  681. }
  682. }),
  683. (r.prototype.getViewportAdjustedDelta = function (e, t, i, n) {
  684. var r = {
  685. top: 0,
  686. left: 0
  687. }
  688. if (!this.$viewport) return r
  689. var o = (this.options.viewport && this.options.viewport.padding) || 0,
  690. a = this.getPosition(this.$viewport)
  691. if (/right|left/.test(e)) {
  692. var s = t.top - o - a.scroll,
  693. l = t.top + o - a.scroll + n
  694. s < a.top ? (r.top = a.top - s) : l > a.top + a.height && (r.top = a.top + a.height - l)
  695. } else {
  696. var c = t.left - o,
  697. h = t.left + o + i
  698. c < a.left ? (r.left = a.left - c) : h > a.width && (r.left = a.left + a.width - h)
  699. }
  700. return r
  701. }),
  702. (r.prototype.getTitle = function () {
  703. var e = this.$element,
  704. t = this.options
  705. return e.attr('data-original-title') || ('function' == typeof t.title ? t.title.call(e[0]) : t.title)
  706. }),
  707. (r.prototype.getUID = function (e) {
  708. for (; (e += ~~(1e6 * Math.random())), document.getElementById(e); );
  709. return e
  710. }),
  711. (r.prototype.tip = function () {
  712. return (this.$tip = this.$tip || m(this.options.template))
  713. }),
  714. (r.prototype.arrow = function () {
  715. return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
  716. }),
  717. (r.prototype.validate = function () {
  718. this.$element[0].parentNode || (this.hide(), (this.$element = null), (this.options = null))
  719. }),
  720. (r.prototype.enable = function () {
  721. this.enabled = !0
  722. }),
  723. (r.prototype.disable = function () {
  724. this.enabled = !1
  725. }),
  726. (r.prototype.toggleEnabled = function () {
  727. this.enabled = !this.enabled
  728. }),
  729. (r.prototype.toggle = function (e) {
  730. var t = this
  731. e && ((t = m(e.currentTarget).data('bs.' + this.type)) || ((t = new this.constructor(e.currentTarget, this.getDelegateOptions())), m(e.currentTarget).data('bs.' + this.type, t))),
  732. t.tip().hasClass('in') ? t.leave(t) : t.enter(t)
  733. }),
  734. (r.prototype.destroy = function () {
  735. clearTimeout(this.timeout),
  736. this.hide()
  737. .$element.off('.' + this.type)
  738. .removeData('bs.' + this.type)
  739. })
  740. var e = m.fn.tooltip
  741. ;(m.fn.tooltip = function (n) {
  742. return this.each(function () {
  743. var e = m(this),
  744. t = e.data('bs.tooltip'),
  745. i = 'object' == typeof n && n
  746. ;(!t && 'destroy' == n) || (t || e.data('bs.tooltip', (t = new r(this, i))), 'string' == typeof n && t[n]())
  747. })
  748. }),
  749. (m.fn.tooltip.Constructor = r),
  750. (m.fn.tooltip.noConflict = function () {
  751. return (m.fn.tooltip = e), this
  752. })
  753. })(jQuery),
  754. (function (e, t, i) {
  755. 'undefined' != typeof module && module.exports ? (module.exports = i()) : 'function' == typeof define && define.amd ? define(i) : (t.Keen = i())
  756. })(0, this, function () {
  757. 'use strict'
  758. function Keen() {
  759. return _init.apply(this, arguments)
  760. }
  761. function _init(e) {
  762. if (_isUndefined(e)) throw new Error('Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/')
  763. if (_isUndefined(e.projectId) || 'String' !== _type(e.projectId) || e.projectId.length < 1) throw new Error('Please provide a projectId')
  764. this.configure(e)
  765. }
  766. function _extend(e) {
  767. for (var t = 1; t < arguments.length; t++) for (var i in arguments[t]) e[i] = arguments[t][i]
  768. return e
  769. }
  770. function _isUndefined(e) {
  771. return void 0 === e
  772. }
  773. function _type(e) {
  774. var t = e && e.constructor ? e.constructor.toString() : void 0
  775. return t ? t.match(/function (.*)\(/)[1] : 'Null'
  776. }
  777. function _each(e, t, i) {
  778. var n
  779. if (!e) return 0
  780. if (((i = i || e), 'array' === _type(e))) {
  781. for (n = 0; n < e.length; n++) if (!1 === t.call(i, e[n], n, e)) return 0
  782. } else for (n in e) if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e)) return 0
  783. return 1
  784. }
  785. function _parse_params(e) {
  786. for (
  787. var t,
  788. i = {},
  789. n = /\+/g,
  790. r = /([^&=]+)=?([^&]*)/g,
  791. o = function (e) {
  792. return decodeURIComponent(e.replace(n, ' '))
  793. },
  794. a = e.split('?')[1];
  795. (t = r.exec(a));
  796. )
  797. i[o(t[1])] = o(t[2])
  798. return i
  799. }
  800. function _set_protocol(e) {
  801. switch (e) {
  802. case 'http':
  803. return 'http'
  804. case 'auto':
  805. return location.protocol.replace(/:/g, '')
  806. case 'https':
  807. case void 0:
  808. default:
  809. return 'https'
  810. }
  811. }
  812. function _set_request_type(e) {
  813. var t = e || 'jsonp',
  814. i = !1
  815. return ('Object' === _type(XMLHttpRequest) || 'Function' === _type(XMLHttpRequest)) && 'withCredentials' in new XMLHttpRequest() && (i = !0), null == t || 'xhr' == t ? (i ? 'xhr' : 'jsonp') : t
  816. }
  817. function _build_url(e) {
  818. return this.client.endpoint + '/projects/' + this.client.projectId + e
  819. }
  820. function _uploadEvent(e, t, i, n, r) {
  821. var o = _build_url.apply(this, ['/events/' + e]),
  822. a = {}
  823. for (var s in ((i = !1 !== i), this.client.globalProperties && (a = this.client.globalProperties(e)), t)) t.hasOwnProperty(s) && (a[s] = t[s])
  824. switch (this.client.requestType) {
  825. case 'xhr':
  826. _request.xhr.apply(this, ['POST', o, null, a, this.client.writeKey, i, n, r])
  827. break
  828. case 'jsonp':
  829. var l = JSON.stringify(a),
  830. c = Keen.Base64.encode(l)
  831. ;(o = (o = (o = o + '?api_key=' + this.client.writeKey) + '&data=' + c) + '&modified=' + new Date().getTime()), _request.jsonp.apply(this, [o, this.client.writeKey, n, r])
  832. break
  833. case 'beacon':
  834. ;(l = JSON.stringify(a)), (c = Keen.Base64.encode(l))
  835. ;(o = (o = (o = o + '?api_key=' + encodeURIComponent(this.client.writeKey)) + '&data=' + encodeURIComponent(c)) + '&modified=' + encodeURIComponent(new Date().getTime())),
  836. (o += '&c=clv1'),
  837. _request.beacon.apply(this, [o, null, n, r])
  838. }
  839. }
  840. Keen.prototype.configure = function (e) {
  841. return (
  842. (e.host = _isUndefined(e.host) ? 'api.keen.io/3.0' : e.host.replace(/.*?:\/\//g, '')),
  843. (e.protocol = _set_protocol(e.protocol)),
  844. (e.requestType = _set_request_type(e.requestType)),
  845. (this.client = {
  846. projectId: e.projectId,
  847. writeKey: e.writeKey,
  848. readKey: e.readKey,
  849. globalProperties: null,
  850. endpoint: e.protocol + '://' + e.host,
  851. requestType: e.requestType
  852. }),
  853. Keen.trigger('client', this, e),
  854. this.trigger('ready'),
  855. this
  856. )
  857. }
  858. var _request = {
  859. xhr: function (e, t, i, n, r, o, a, s) {
  860. if (!r) return Keen.log('Please provide a writeKey for https://keen.io/project/' + this.client.projectId)
  861. var l = new XMLHttpRequest()
  862. if (
  863. ((l.onreadystatechange = function () {
  864. if (4 == l.readyState)
  865. if (200 <= l.status && l.status < 300) {
  866. var e
  867. try {
  868. e = JSON.parse(l.responseText)
  869. } catch (e) {
  870. Keen.log('Could not JSON parse HTTP response: ' + l.responseText), s && s(l, e)
  871. }
  872. a && e && a(e)
  873. } else Keen.log('HTTP request failed.'), s && s(l, null)
  874. }),
  875. l.open(e, t, o),
  876. r && l.setRequestHeader('Authorization', r),
  877. n && l.setRequestHeader('Content-Type', 'application/json'),
  878. i)
  879. )
  880. for (var c in i) i.hasOwnProperty(c) && l.setRequestHeader(c, i[c])
  881. var h = n ? JSON.stringify(n) : null
  882. l.send(h)
  883. },
  884. jsonp: function (e, t, i, n) {
  885. if (!t) return Keen.log('Please provide a writeKey for https://keen.io/project/' + this.client.projectId)
  886. if (t && e.indexOf('api_key') < 0) {
  887. var r = 0 < e.indexOf('?') ? '&' : '?'
  888. e = e + r + 'api_key=' + t
  889. }
  890. for (var o = 'keenJSONPCallback' + new Date().getTime(); o in window; ) o += 'a'
  891. var a = !1
  892. ;(window[o] = function (e) {
  893. ;(a = !0), i && e && i(e), (window[o] = void 0)
  894. }),
  895. (e = e + '&jsonp=' + o)
  896. var s = document.createElement('script')
  897. ;(s.id = 'keen-jsonp'),
  898. (s.src = e),
  899. document.getElementsByTagName('head')[0].appendChild(s),
  900. (s.onreadystatechange = function () {
  901. !1 === a && 'loaded' === this.readyState && ((a = !0), n && n())
  902. }),
  903. (s.onerror = function () {
  904. !1 === a && ((a = !0), n && n())
  905. })
  906. },
  907. beacon: function (e, t, i, n) {
  908. if (t && e.indexOf('api_key') < 0) {
  909. var r = 0 < e.indexOf('?') ? '&' : '?'
  910. e = e + r + 'api_key=' + t
  911. }
  912. var o = document.createElement('img')
  913. ;(o.onload = function () {
  914. if ((!0, 'naturalHeight' in this)) {
  915. if (this.naturalHeight + this.naturalWidth === 0) return void this.onerror()
  916. } else if (this.width + this.height === 0) return void this.onerror()
  917. i &&
  918. i({
  919. created: !0
  920. })
  921. }),
  922. (o.onerror = function () {
  923. !0, n && n()
  924. }),
  925. (o.src = e)
  926. }
  927. },
  928. Events = (Keen.Events = {
  929. on: function (e, t) {
  930. return (
  931. this.listeners || (this.listeners = {}),
  932. (this.listeners[e] || (this.listeners[e] = [])).push({
  933. callback: t
  934. }),
  935. this
  936. )
  937. },
  938. off: function (e, t) {
  939. if (!e && !t) return (this.listeners = void 0), delete this.listeners, this
  940. for (var i = this.listeners[e] || [], n = i.length; n--; )
  941. t && t == i[n].callback && this.listeners[e].splice(n, 1), (t && 0 != i.length) || ((this.listeners[e] = void 0), delete this.listeners[e])
  942. return this
  943. },
  944. trigger: function (e) {
  945. if (!this.listeners) return this
  946. for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++) i[n].callback.apply(this, t)
  947. return this
  948. }
  949. })
  950. _extend(Keen.prototype, Events),
  951. _extend(Keen, Events),
  952. (Keen.loaded = !0),
  953. (Keen.utils = {
  954. each: _each,
  955. extend: _extend,
  956. parseParams: _parse_params
  957. }),
  958. (Keen.ready = function (e) {
  959. Keen.loaded ? e() : Keen.on('ready', e)
  960. }),
  961. (Keen.log = function (e) {
  962. 'object' == typeof console && console.log('[Keen IO]', e)
  963. })
  964. var Plugins = (Keen.Plugins = {}),
  965. Hh,
  966. Ih
  967. ;(Keen.prototype.addEvent = function () {
  968. _uploadEvent.apply(this, arguments)
  969. }),
  970. (Keen.prototype.addEventSync = function (e, t, i, n) {
  971. _uploadEvent.apply(this, [e, t, !1, i, n])
  972. }),
  973. (Keen.prototype.trackExternalLink = function (e, t, i, n, r) {
  974. var o = e,
  975. a = o.metaKey,
  976. s = o.target,
  977. l = !1,
  978. c = function () {}
  979. return (
  980. void 0 === n && (n = 500),
  981. 'A' === s.nodeName
  982. ? (c = function () {
  983. a || l || ((l = !0), (window.location = s.href))
  984. })
  985. : 'FORM' === s.nodeName &&
  986. (c = function () {
  987. l || ((l = !0), s.submit())
  988. }),
  989. r &&
  990. (c = function () {
  991. l || ((l = !0), r())
  992. }),
  993. _uploadEvent.call(this, t, i, c, c),
  994. setTimeout(function () {
  995. c()
  996. }, n),
  997. !!a && void 0
  998. )
  999. }),
  1000. (Keen.prototype.setGlobalProperties = function (e) {
  1001. if (!this.client) return Keen.log('Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/')
  1002. if (!e || 'function' != typeof e) throw new Error('Invalid value for global properties: ' + e)
  1003. this.client.globalProperties = e
  1004. }),
  1005. (Keen.Base64 = {
  1006. map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
  1007. encode: function (e) {
  1008. var t,
  1009. i,
  1010. n,
  1011. r,
  1012. o,
  1013. a,
  1014. s,
  1015. l = '',
  1016. c = 0,
  1017. h = this.map
  1018. for (e = this.utf8.encode(e); c < e.length; )
  1019. (t = e.charCodeAt(c++)),
  1020. (i = e.charCodeAt(c++)),
  1021. (n = e.charCodeAt(c++)),
  1022. (r = t >> 2),
  1023. (o = ((3 & t) << 4) | (i >> 4)),
  1024. (a = isNaN(i) ? 64 : ((15 & i) << 2) | (n >> 6)),
  1025. (s = isNaN(i) || isNaN(n) ? 64 : 63 & n),
  1026. (l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s))
  1027. return l
  1028. },
  1029. decode: function (e) {
  1030. var t,
  1031. i,
  1032. n,
  1033. r,
  1034. o,
  1035. a,
  1036. s = '',
  1037. l = 0,
  1038. c = this.map,
  1039. h = String.fromCharCode
  1040. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ''); l < e.length; )
  1041. (t = c.indexOf(e.charAt(l++))),
  1042. (o = ((15 & (i = c.indexOf(e.charAt(l++)))) << 4) | ((n = c.indexOf(e.charAt(l++))) >> 2)),
  1043. (a = ((3 & n) << 6) | (r = c.indexOf(e.charAt(l++)))),
  1044. (s = s + (h((t << 2) | (i >> 4)) + (64 != n ? h(o) : '')) + (64 != r ? h(a) : ''))
  1045. return this.utf8.decode(s)
  1046. },
  1047. utf8: {
  1048. encode: function (e) {
  1049. for (var t, i = '', n = 0, r = String.fromCharCode; n < e.length; )
  1050. i += (t = e.charCodeAt(n++)) < 128 ? r(t) : 127 < t && t < 2048 ? r((t >> 6) | 192) + r((63 & t) | 128) : r((t >> 12) | 224) + r(((t >> 6) & 63) | 128) + r((63 & t) | 128)
  1051. return i
  1052. },
  1053. decode: function (e) {
  1054. for (var t, i = '', n = 0, r = String.fromCharCode; n < e.length; )
  1055. i +=
  1056. (t = e.charCodeAt(n)) < 128
  1057. ? [r(t), n++][0]
  1058. : 191 < t && t < 224
  1059. ? [r(((31 & t) << 6) | (63 & e.charCodeAt(n + 1))), (n += 2)][0]
  1060. : [r(((15 & t) << 12) | ((63 & e.charCodeAt(n + 1)) << 6) | (63 & (c3 = e.charCodeAt(n + 2)))), (n += 3)][0]
  1061. return i
  1062. }
  1063. }
  1064. }),
  1065. 'object' != typeof JSON && (JSON = {}),
  1066. (function () {
  1067. function f(e) {
  1068. return e < 10 ? '0' + e : e
  1069. }
  1070. function quote(e) {
  1071. return (
  1072. (escapable.lastIndex = 0),
  1073. escapable.test(e)
  1074. ? '"' +
  1075. e.replace(escapable, function (e) {
  1076. var t = meta[e]
  1077. return 'string' == typeof t ? t : '\\u' + ('0000' + e.charCodeAt(0).toString(16)).slice(-4)
  1078. }) +
  1079. '"'
  1080. : '"' + e + '"'
  1081. )
  1082. }
  1083. function str(e, t) {
  1084. var i,
  1085. n,
  1086. r,
  1087. o,
  1088. a,
  1089. s = gap,
  1090. l = t[e]
  1091. switch ((l && 'object' == typeof l && 'function' == typeof l.toJSON && (l = l.toJSON(e)), 'function' == typeof rep && (l = rep.call(t, e, l)), typeof l)) {
  1092. case 'string':
  1093. return quote(l)
  1094. case 'number':
  1095. return isFinite(l) ? String(l) : 'null'
  1096. case 'boolean':
  1097. case 'null':
  1098. return String(l)
  1099. case 'object':
  1100. if (!l) return 'null'
  1101. if (((gap += indent), (a = []), '[object Array]' === Object.prototype.toString.apply(l))) {
  1102. for (o = l.length, i = 0; i < o; i += 1) a[i] = str(i, l) || 'null'
  1103. return (r = 0 === a.length ? '[]' : gap ? '[\n' + gap + a.join(',\n' + gap) + '\n' + s + ']' : '[' + a.join(',') + ']'), (gap = s), r
  1104. }
  1105. if (rep && 'object' == typeof rep) for (o = rep.length, i = 0; i < o; i += 1) 'string' == typeof rep[i] && (r = str((n = rep[i]), l)) && a.push(quote(n) + (gap ? ': ' : ':') + r)
  1106. else for (n in l) Object.prototype.hasOwnProperty.call(l, n) && (r = str(n, l)) && a.push(quote(n) + (gap ? ': ' : ':') + r)
  1107. return (r = 0 === a.length ? '{}' : gap ? '{\n' + gap + a.join(',\n' + gap) + '\n' + s + '}' : '{' + a.join(',') + '}'), (gap = s), r
  1108. }
  1109. }
  1110. 'function' != typeof Date.prototype.toJSON &&
  1111. ((Date.prototype.toJSON = function () {
  1112. return isFinite(this.valueOf())
  1113. ? this.getUTCFullYear() + '-' + f(this.getUTCMonth() + 1) + '-' + f(this.getUTCDate()) + 'T' + f(this.getUTCHours()) + ':' + f(this.getUTCMinutes()) + ':' + f(this.getUTCSeconds()) + 'Z'
  1114. : null
  1115. }),
  1116. (String.prototype.toJSON =
  1117. Number.prototype.toJSON =
  1118. Boolean.prototype.toJSON =
  1119. function () {
  1120. return this.valueOf()
  1121. }))
  1122. var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  1123. escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  1124. gap,
  1125. indent,
  1126. meta = {
  1127. '\b': '\\b',
  1128. '\t': '\\t',
  1129. '\n': '\\n',
  1130. '\f': '\\f',
  1131. '\r': '\\r',
  1132. '"': '\\"',
  1133. '\\': '\\\\'
  1134. },
  1135. rep
  1136. 'function' != typeof JSON.stringify &&
  1137. (JSON.stringify = function (e, t, i) {
  1138. var n
  1139. if (((indent = gap = ''), 'number' == typeof i)) for (n = 0; n < i; n += 1) indent += ' '
  1140. else 'string' == typeof i && (indent = i)
  1141. if ((rep = t) && 'function' != typeof t && ('object' != typeof t || 'number' != typeof t.length)) throw new Error('JSON.stringify')
  1142. return str('', {
  1143. '': e
  1144. })
  1145. }),
  1146. 'function' != typeof JSON.parse &&
  1147. (JSON.parse = function (text, reviver) {
  1148. function walk(e, t) {
  1149. var i,
  1150. n,
  1151. r = e[t]
  1152. if (r && 'object' == typeof r) for (i in r) Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? (r[i] = n) : delete r[i])
  1153. return reviver.call(e, t, r)
  1154. }
  1155. var j
  1156. if (
  1157. ((text = String(text)),
  1158. (cx.lastIndex = 0),
  1159. cx.test(text) &&
  1160. (text = text.replace(cx, function (e) {
  1161. return '\\u' + ('0000' + e.charCodeAt(0).toString(16)).slice(-4)
  1162. })),
  1163. /^[\],:{}\s]*$/.test(
  1164. text
  1165. .replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
  1166. .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
  1167. .replace(/(?:^|:|,)(?:\s*\[)+/g, '')
  1168. ))
  1169. )
  1170. return (
  1171. (j = eval('(' + text + ')')),
  1172. 'function' == typeof reviver
  1173. ? walk(
  1174. {
  1175. '': j
  1176. },
  1177. ''
  1178. )
  1179. : j
  1180. )
  1181. throw new SyntaxError('JSON.parse')
  1182. })
  1183. })(),
  1184. (Hh = Keen.utils),
  1185. (Ih = function (i) {
  1186. function e(e) {
  1187. for (u = 1; (e = n.shift()); ) e()
  1188. }
  1189. var t,
  1190. n = [],
  1191. r = document,
  1192. o = r.documentElement,
  1193. a = o.doScroll,
  1194. s = 'DOMContentLoaded',
  1195. l = 'addEventListener',
  1196. c = 'onreadystatechange',
  1197. h = 'readyState',
  1198. u = (a ? /^loaded|^c/ : /^loaded|c/).test(r[h])
  1199. return (
  1200. r[l] &&
  1201. r[l](
  1202. s,
  1203. (t = function () {
  1204. r.removeEventListener(s, t, !1), e()
  1205. }),
  1206. !1
  1207. ),
  1208. a &&
  1209. r.attachEvent(
  1210. c,
  1211. (t = function () {
  1212. ;/^c/.test(r[h]) && (r.detachEvent(c, t), e())
  1213. })
  1214. ),
  1215. (i = a
  1216. ? function (t) {
  1217. self != top
  1218. ? u
  1219. ? t()
  1220. : n.push(t)
  1221. : (function () {
  1222. try {
  1223. o.doScroll('left')
  1224. } catch (e) {
  1225. return setTimeout(function () {
  1226. i(t)
  1227. }, 50)
  1228. }
  1229. t()
  1230. })()
  1231. }
  1232. : function (e) {
  1233. u ? e() : n.push(e)
  1234. })
  1235. )
  1236. }),
  1237. 'undefined' != typeof module && module.exports ? (module.exports = Ih()) : 'function' == typeof define && define.amd ? define(Ih) : (Hh.domready = Ih())
  1238. var loaded = window.Keen,
  1239. cached = window._Keen || {},
  1240. clients,
  1241. ready
  1242. if (loaded && cached) {
  1243. for (var instance in ((clients = cached.clients || {}), (ready = cached.ready || []), clients))
  1244. if (clients.hasOwnProperty(instance)) {
  1245. var client = clients[instance]
  1246. for (var method in Keen.prototype) Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method])
  1247. if (
  1248. ((loaded.Query = Keen.Query ? Keen.Query : function () {}),
  1249. (loaded.Visualization = Keen.Visualization ? Keen.Visualization : function () {}),
  1250. client._config && (client.configure.call(client, client._config), delete client._config),
  1251. client._setGlobalProperties)
  1252. ) {
  1253. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++) client.setGlobalProperties.apply(client, globals[i])
  1254. delete client._setGlobalProperties
  1255. }
  1256. if (client._addEvent) {
  1257. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++) client.addEvent.apply(client, queue[i])
  1258. delete client._addEvent
  1259. }
  1260. var callback = client._on || []
  1261. if (client._on) {
  1262. for (var i = 0; i < callback.length; i++) client.on.apply(client, callback[i])
  1263. client.trigger('ready'), delete client._on
  1264. }
  1265. }
  1266. for (var i = 0; i < ready.length; i++) {
  1267. var callback = ready[i]
  1268. Keen.on('ready', function () {
  1269. callback()
  1270. })
  1271. }
  1272. }
  1273. return (
  1274. Keen.loaded &&
  1275. setTimeout(function () {
  1276. Keen.utils.domready(function () {
  1277. Keen.trigger('ready')
  1278. })
  1279. }, 0),
  1280. Keen
  1281. )
  1282. }),
  1283. (function () {
  1284. var i = (window.analytics = window.analytics || [])
  1285. if (!i.initialize) {
  1286. if (i.invoked) return window.console && console.error && console.error('Segment snippet included twice.')
  1287. ;(i.invoked = !0),
  1288. (i.methods = ['trackSubmit', 'trackClick', 'trackLink', 'trackForm', 'pageview', 'identify', 'reset', 'group', 'track', 'ready', 'alias', 'debug', 'page', 'once', 'off', 'on']),
  1289. (i.factory = function (t) {
  1290. return function () {
  1291. var e = Array.prototype.slice.call(arguments)
  1292. return e.unshift(t), i.push(e), i
  1293. }
  1294. })
  1295. for (var e = 0; e < i.methods.length; e++) {
  1296. var t = i.methods[e]
  1297. i[t] = i.factory(t)
  1298. }
  1299. ;(i.load = function (e) {
  1300. var t = document.createElement('script')
  1301. ;(t.type = 'text/javascript'), (t.async = !0), (t.src = ('https:' === document.location.protocol ? 'https://' : 'http://') + 'cdn.segment.com/analytics.js/v1/' + e + '/analytics.min.js')
  1302. var i = document.getElementsByTagName('script')[0]
  1303. i.parentNode.insertBefore(t, i)
  1304. }),
  1305. (i.SNIPPET_VERSION = '4.0.0')
  1306. }
  1307. })(),
  1308. (function (i, u) {
  1309. 'use strict'
  1310. var d = 'function',
  1311. p = 'undefined',
  1312. f = 'object',
  1313. e = 'major',
  1314. t = 'model',
  1315. n = 'name',
  1316. r = 'type',
  1317. o = 'vendor',
  1318. a = 'version',
  1319. s = 'architecture',
  1320. l = 'console',
  1321. c = 'mobile',
  1322. h = 'tablet',
  1323. g = {
  1324. has: function (e, t) {
  1325. return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
  1326. },
  1327. lowerize: function (e) {
  1328. return e.toLowerCase()
  1329. }
  1330. },
  1331. m = {
  1332. rgx: function () {
  1333. for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
  1334. var c = l[s],
  1335. h = l[s + 1]
  1336. if (typeof e == p) for (n in ((e = {}), h)) typeof (r = h[n]) == f ? (e[r[0]] = u) : (e[r] = u)
  1337. for (t = i = 0; t < c.length; t++)
  1338. if ((o = c[t].exec(this.getUA()))) {
  1339. for (n = 0; n < h.length; n++)
  1340. (a = o[++i]),
  1341. typeof (r = h[n]) == f && 0 < r.length
  1342. ? 2 == r.length
  1343. ? typeof r[1] == d
  1344. ? (e[r[0]] = r[1].call(this, a))
  1345. : (e[r[0]] = r[1])
  1346. : 3 == r.length
  1347. ? typeof r[1] != d || (r[1].exec && r[1].test)
  1348. ? (e[r[0]] = a ? a.replace(r[1], r[2]) : u)
  1349. : (e[r[0]] = a ? r[1].call(this, a, r[2]) : u)
  1350. : 4 == r.length && (e[r[0]] = a ? r[3].call(this, a.replace(r[1], r[2])) : u)
  1351. : (e[r] = a || u)
  1352. break
  1353. }
  1354. if (o) break
  1355. }
  1356. return e
  1357. },
  1358. str: function (e, t) {
  1359. for (var i in t)
  1360. if (typeof t[i] == f && 0 < t[i].length) {
  1361. for (var n = 0; n < t[i].length; n++) if (g.has(t[i][n], e)) return '?' === i ? u : i
  1362. } else if (g.has(t[i], e)) return '?' === i ? u : i
  1363. return e
  1364. }
  1365. },
  1366. v = {
  1367. browser: {
  1368. oldsafari: {
  1369. major: {
  1370. 1: ['/8', '/1', '/3'],
  1371. 2: '/4',
  1372. '?': '/'
  1373. },
  1374. version: {
  1375. '1.0': '/8',
  1376. 1.2: '/1',
  1377. 1.3: '/3',
  1378. '2.0': '/412',
  1379. '2.0.2': '/416',
  1380. '2.0.3': '/417',
  1381. '2.0.4': '/419',
  1382. '?': '/'
  1383. }
  1384. }
  1385. },
  1386. device: {
  1387. sprint: {
  1388. model: {
  1389. 'Evo Shift 4G': '7373KT'
  1390. },
  1391. vendor: {
  1392. HTC: 'APA',
  1393. Sprint: 'Sprint'
  1394. }
  1395. }
  1396. },
  1397. os: {
  1398. windows: {
  1399. version: {
  1400. ME: '4.90',
  1401. 'NT 3.11': 'NT3.51',
  1402. 'NT 4.0': 'NT4.0',
  1403. 2e3: 'NT 5.0',
  1404. XP: ['NT 5.1', 'NT 5.2'],
  1405. Vista: 'NT 6.0',
  1406. 7: 'NT 6.1',
  1407. 8: 'NT 6.2',
  1408. 8.1: 'NT 6.3',
  1409. RT: 'ARM'
  1410. }
  1411. }
  1412. }
  1413. },
  1414. y = {
  1415. browser: [
  1416. [/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i],
  1417. [n, a, e],
  1418. [/\s(opr)\/((\d+)?[\w\.]+)/i],
  1419. [[n, 'Opera'], a, e],
  1420. [
  1421. /(kindle)\/((\d+)?[\w\.]+)/i,
  1422. /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i,
  1423. /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i,
  1424. /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i,
  1425. /(rekonq)((?:\/)[\w\.]+)*/i,
  1426. /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i
  1427. ],
  1428. [n, a, e],
  1429. [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i],
  1430. [[n, 'IE'], a, e],
  1431. [/(yabrowser)\/((\d+)?[\w\.]+)/i],
  1432. [[n, 'Yandex'], a, e],
  1433. [/(comodo_dragon)\/((\d+)?[\w\.]+)/i],
  1434. [[n, /_/g, ' '], a, e],
  1435. [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i],
  1436. [n, a, e],
  1437. [/(dolfin)\/((\d+)?[\w\.]+)/i],
  1438. [[n, 'Dolphin'], a, e],
  1439. [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i],
  1440. [[n, 'Chrome'], a, e],
  1441. [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i],
  1442. [a, e, [n, 'Mobile Safari']],
  1443. [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i],
  1444. [a, e, n],
  1445. [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i],
  1446. [n, [e, m.str, v.browser.oldsafari.major], [a, m.str, v.browser.oldsafari.version]],
  1447. [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i],
  1448. [n, a, e],
  1449. [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i],
  1450. [[n, 'Netscape'], a, e],
  1451. [
  1452. /(swiftfox)/i,
  1453. /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i,
  1454. /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i,
  1455. /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i,
  1456. /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i,
  1457. /(links)\s\(((\d+)?[\w\.]+)/i,
  1458. /(gobrowser)\/?((\d+)?[\w\.]+)*/i,
  1459. /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i,
  1460. /(mosaic)[\/\s]((\d+)?[\w\.]+)/i
  1461. ],
  1462. [n, a, e],
  1463. [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i],
  1464. [n, a, e],
  1465. [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i],
  1466. [n, a],
  1467. [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i],
  1468. [n, a, e],
  1469. [
  1470. /(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i,
  1471. /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i,
  1472. /(lg player|nexplayer)\s((\d+)[\d\.]+)/i,
  1473. /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i
  1474. ],
  1475. [n, a, e],
  1476. [/(nexplayer)\s((\d+)[\w\.-]+)/i],
  1477. [n, a, e],
  1478. [/(flrp)\/((\d+)[\w\.-]+)/i],
  1479. [[n, 'Flip Player'], a, e],
  1480. [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i],
  1481. [n],
  1482. [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i],
  1483. [n, a, e],
  1484. [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i],
  1485. [n, a, e],
  1486. [/(htc_one_s)\/((\d+)[\d\.]+)/i],
  1487. [[n, /_/g, ' '], a, e],
  1488. [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i],
  1489. [n, a],
  1490. [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i],
  1491. [n, a, e],
  1492. [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i],
  1493. [n],
  1494. [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i],
  1495. [n, a, e],
  1496. [/(nokia\d+)\/((\d+)[\w\.-]+)/i],
  1497. [n, a, e],
  1498. [/\s(songbird)\/((\d+)[\w\.-]+)/i],
  1499. [n, a, e],
  1500. [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i],
  1501. [n, a, e],
  1502. [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i],
  1503. [n],
  1504. [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i],
  1505. [n, a, e],
  1506. [/(smp)((\d+)[\d\.]+)/i],
  1507. [n, a, e],
  1508. [/(vlc) media player - version ((\d+)[\w\.]+)/i, /(vlc)\/((\d+)[\w\.-]+)/i, /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, /(foobar2000)\/((\d+)[\d\.]+)/i, /(itunes)\/((\d+)[\d\.]+)/i],
  1509. [n, a, e],
  1510. [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i],
  1511. [[n, /-/g, ' '], a, e],
  1512. [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i],
  1513. [a, e, [n, 'Windows']],
  1514. [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i],
  1515. [n, a, e],
  1516. [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i],
  1517. [[n, 'rad.io'], a, e]
  1518. ],
  1519. cpu: [
  1520. [/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],
  1521. [[s, 'amd64']],
  1522. [/(ia32(?=;))/i],
  1523. [[s, g.lowerize]],
  1524. [/((?:i[346]|x)86)[;\)]/i],
  1525. [[s, 'ia32']],
  1526. [/windows\s(ce|mobile);\sppc;/i],
  1527. [[s, 'arm']],
  1528. [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],
  1529. [[s, /ower/, '', g.lowerize]],
  1530. [/(sun4\w)[;\)]/i],
  1531. [[s, 'sparc']],
  1532. [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],
  1533. [s, g.lowerize]
  1534. ],
  1535. device: [
  1536. [/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],
  1537. [t, o, [r, h]],
  1538. [/applecoremedia\/[\w\.]+ \((ipad)/],
  1539. [t, [o, 'Apple'], [r, h]],
  1540. [/(apple\s{0,1}tv)/i],
  1541. [
  1542. [t, 'Apple TV'],
  1543. [o, 'Apple']
  1544. ],
  1545. [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i],
  1546. [o, t, [r, h]],
  1547. [/\((ip[honed|\s\w*]+);.+(apple)/i],
  1548. [t, o, [r, c]],
  1549. [/\((ip[honed|\s\w*]+);/i],
  1550. [t, [o, 'Apple'], [r, c]],
  1551. [/(blackberry)[\s-]?(\w+)/i, /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i],
  1552. [o, t, [r, c]],
  1553. [/\((bb10);\s(\w+)/i],
  1554. [[o, 'BlackBerry'], t, [r, c]],
  1555. [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i],
  1556. [[o, 'Asus'], t, [r, h]],
  1557. [/(sony)\s(tablet\s[ps])/i],
  1558. [o, t, [r, h]],
  1559. [/(nintendo)\s([wids3u]+)/i],
  1560. [o, t, [r, l]],
  1561. [/((playstation)\s[3portablevi]+)/i],
  1562. [[o, 'Sony'], t, [r, l]],
  1563. [/(sprint\s(\w+))/i],
  1564. [
  1565. [o, m.str, v.device.sprint.vendor],
  1566. [t, m.str, v.device.sprint.model],
  1567. [r, c]
  1568. ],
  1569. [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i],
  1570. [o, [t, /_/g, ' '], [r, c]],
  1571. [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i],
  1572. [[o, 'Motorola'], t, [r, c]],
  1573. [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i],
  1574. [[o, 'Motorola'], t, [r, h]],
  1575. [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i],
  1576. [[o, 'Samsung'], t, [r, h]],
  1577. [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i],
  1578. [[o, 'Samsung'], t, [r, c]],
  1579. [/(sie)-(\w+)*/i],
  1580. [[o, 'Siemens'], t, [r, c]],
  1581. [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i],
  1582. [[o, 'Nokia'], t, [r, c]],
  1583. [/android\s3\.[\s\w-;]{10}((a\d{3}))/i],
  1584. [[o, 'Acer'], t, [r, h]],
  1585. [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i],
  1586. [[o, 'LG'], t, [r, h]],
  1587. [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i],
  1588. [[o, 'LG'], t, [r, c]],
  1589. [/android.+((ideatab[a-z0-9\-\s]+))/i],
  1590. [[o, 'Lenovo'], t, [r, h]],
  1591. [/(lg) netcast\.tv/i],
  1592. [o, [r, 'smarttv']],
  1593. [/(mobile|tablet);.+rv\:.+gecko\//i],
  1594. [r, o, t]
  1595. ],
  1596. engine: [
  1597. [/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i],
  1598. [n, a],
  1599. [/rv\:([\w\.]+).*(gecko)/i],
  1600. [a, n]
  1601. ],
  1602. os: [
  1603. [/microsoft\s(windows)\s(vista|xp)/i],
  1604. [n, a],
  1605. [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],
  1606. [n, [a, m.str, v.os.windows.version]],
  1607. [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],
  1608. [
  1609. [n, 'Windows'],
  1610. [a, m.str, v.os.windows.version]
  1611. ],
  1612. [/\((bb)(10);/i],
  1613. [[n, 'BlackBerry'], a],
  1614. [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i],
  1615. [n, a],
  1616. [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],
  1617. [[n, 'Symbian'], a],
  1618. [/mozilla.+\(mobile;.+gecko.+firefox/i],
  1619. [[n, 'Firefox OS'], a],
  1620. [
  1621. /(nintendo|playstation)\s([wids3portablevu]+)/i,
  1622. /(mint)[\/\s\(]?(\w+)*/i,
  1623. /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i,
  1624. /(hurd|linux)\s?([\w\.]+)*/i,
  1625. /(gnu)\s?([\w\.]+)*/i
  1626. ],
  1627. [n, a],
  1628. [/(cros)\s[\w]+\s([\w\.]+\w)/i],
  1629. [[n, 'Chromium OS'], a],
  1630. [/(sunos)\s?([\w\.]+\d)*/i],
  1631. [[n, 'Solaris'], a],
  1632. [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],
  1633. [n, a],
  1634. [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],
  1635. [
  1636. [n, 'iOS'],
  1637. [a, /_/g, '.']
  1638. ],
  1639. [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i],
  1640. [n, [a, /_/g, '.']],
  1641. [/(haiku)\s(\w+)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, /(unix)\s?([\w\.]+)*/i],
  1642. [n, a]
  1643. ]
  1644. },
  1645. A = function (e) {
  1646. var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : '')
  1647. return this instanceof A
  1648. ? ((this.getBrowser = function () {
  1649. return m.rgx.apply(this, y.browser)
  1650. }),
  1651. (this.getCPU = function () {
  1652. return m.rgx.apply(this, y.cpu)
  1653. }),
  1654. (this.getDevice = function () {
  1655. return m.rgx.apply(this, y.device)
  1656. }),
  1657. (this.getEngine = function () {
  1658. return m.rgx.apply(this, y.engine)
  1659. }),
  1660. (this.getOS = function () {
  1661. return m.rgx.apply(this, y.os)
  1662. }),
  1663. (this.getResult = function () {
  1664. return {
  1665. ua: this.getUA(),
  1666. browser: this.getBrowser(),
  1667. engine: this.getEngine(),
  1668. os: this.getOS(),
  1669. device: this.getDevice(),
  1670. cpu: this.getCPU()
  1671. }
  1672. }),
  1673. (this.getUA = function () {
  1674. return t
  1675. }),
  1676. (this.setUA = function (e) {
  1677. return (t = e), this
  1678. }),
  1679. void this.setUA(t))
  1680. : new A(e).getResult()
  1681. }
  1682. if (typeof exports != p) typeof module != p && module.exports && (exports = module.exports = A), (exports.UAParser = A)
  1683. else if (
  1684. ((i.UAParser = A),
  1685. typeof define == d &&
  1686. define.amd &&
  1687. define(function () {
  1688. return A
  1689. }),
  1690. typeof i.jQuery != p)
  1691. ) {
  1692. var C = i.jQuery,
  1693. I = new A()
  1694. ;(C.ua = I.getResult()),
  1695. (C.ua.get = function () {
  1696. return I.getUA()
  1697. }),
  1698. (C.ua.set = function (e) {
  1699. I.setUA(e)
  1700. var t = I.getResult()
  1701. for (var i in t) C.ua[i] = t[i]
  1702. })
  1703. }
  1704. })(this),
  1705. (window.Modernizr = (function (e, t) {
  1706. function i(e, t) {
  1707. return typeof e === t
  1708. }
  1709. var n,
  1710. r,
  1711. o,
  1712. a = {},
  1713. s = t.documentElement,
  1714. l = t.createElement('modernizr'),
  1715. c = l.style,
  1716. h = {},
  1717. u = [],
  1718. d = u.slice,
  1719. p = {}.hasOwnProperty
  1720. for (var f in ((r =
  1721. i(p, 'undefined') || i(p.call, 'undefined')
  1722. ? function (e, t) {
  1723. return t in e && i(e.constructor.prototype[t], 'undefined')
  1724. }
  1725. : function (e, t) {
  1726. return p.call(e, t)
  1727. }),
  1728. Function.prototype.bind ||
  1729. (Function.prototype.bind = function (n) {
  1730. var r = this
  1731. if ('function' != typeof r) throw new TypeError()
  1732. var o = d.call(arguments, 1),
  1733. a = function () {
  1734. if (this instanceof a) {
  1735. function e() {}
  1736. e.prototype = r.prototype
  1737. var t = new e(),
  1738. i = r.apply(t, o.concat(d.call(arguments)))
  1739. return Object(i) === i ? i : t
  1740. }
  1741. return r.apply(n, o.concat(d.call(arguments)))
  1742. }
  1743. return a
  1744. }),
  1745. (h.webgl = function () {
  1746. return !!e.WebGLRenderingContext
  1747. }),
  1748. h))
  1749. r(h, f) && ((n = f.toLowerCase()), (a[n] = h[f]()), u.push((a[n] ? '' : 'no-') + n))
  1750. return (
  1751. (a.addTest = function (e, t) {
  1752. if ('object' == typeof e) for (var i in e) r(e, i) && a.addTest(i, e[i])
  1753. else {
  1754. if (((e = e.toLowerCase()), void 0 !== a[e])) return a
  1755. ;(t = 'function' == typeof t ? t() : t), 'undefined' != typeof enableClasses && enableClasses && (s.className += ' ' + (t ? '' : 'no-') + e), (a[e] = t)
  1756. }
  1757. return a
  1758. }),
  1759. (o = ''),
  1760. (c.cssText = o),
  1761. (l = null),
  1762. (a._version = '2.8.2'),
  1763. a
  1764. )
  1765. })(this, this.document)),
  1766. (function (xe, e, Se) {
  1767. 'use strict'
  1768. function Me(s, e, n) {
  1769. function a(e) {
  1770. var t = Q.length
  1771. if (
  1772. ((G.old = xe.extend({}, G)),
  1773. (H = V ? 0 : k[F.horizontal ? 'width' : 'height']()),
  1774. (Y = W[F.horizontal ? 'width' : 'height']()),
  1775. (z = V ? s : U[F.horizontal ? 'outerWidth' : 'outerHeight']()),
  1776. (Q.length = 0),
  1777. (G.start = 0),
  1778. (G.end = nt(z - H, 0)),
  1779. le)
  1780. ) {
  1781. $.length, (J = U.children(F.itemSelector)), ($.length = 0)
  1782. var h,
  1783. u = Ne(U, F.horizontal ? 'paddingLeft' : 'paddingTop'),
  1784. d = Ne(U, F.horizontal ? 'paddingRight' : 'paddingBottom'),
  1785. i = 'border-box' === xe(J).css('boxSizing'),
  1786. p = 'none' !== J.css('float'),
  1787. f = 0,
  1788. g = J.length - 1
  1789. ;(z = 0),
  1790. J.each(function (e, t) {
  1791. var i = xe(t),
  1792. n = t.getBoundingClientRect(),
  1793. r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top),
  1794. o = Ne(i, F.horizontal ? 'marginLeft' : 'marginTop'),
  1795. a = Ne(i, F.horizontal ? 'marginRight' : 'marginBottom'),
  1796. s = r + o + a,
  1797. l = !o || !a,
  1798. c = {}
  1799. ;(c.el = t),
  1800. (c.size = l ? r : s),
  1801. (c.half = c.size / 2),
  1802. (c.start = z + (l ? o : 0)),
  1803. (c.center = c.start - it(H / 2 - c.size / 2)),
  1804. (c.end = c.start - H + c.size),
  1805. e || (z += u),
  1806. (z += s),
  1807. F.horizontal || p || (a && o && 0 < e && (z -= rt(o, a))),
  1808. e === g && ((c.end += d), (z += d), (f = l ? a : 0)),
  1809. $.push(c),
  1810. (h = c)
  1811. }),
  1812. (U[0].style[F.horizontal ? 'width' : 'height'] = (i ? z : z - u - d) + 'px'),
  1813. (z -= f),
  1814. $.length ? ((G.start = $[0][ae ? 'center' : 'start']), (G.end = ae ? h.center : H < z ? h.end : G.start)) : (G.start = G.end = 0)
  1815. }
  1816. if (
  1817. ((G.center = it(G.end / 2 + G.start / 2)),
  1818. v(),
  1819. j.length &&
  1820. 0 < Y &&
  1821. (F.dynamicHandle
  1822. ? ((q = Fe((q = G.start === G.end ? Y : it((Y * H) / z)), F.minHandleSize, Y)), (j[0].style[F.horizontal ? 'width' : 'height'] = q + 'px'))
  1823. : (q = j[F.horizontal ? 'outerWidth' : 'outerHeight']()),
  1824. (X.end = Y - q),
  1825. _e || c()),
  1826. !V && 0 < H)
  1827. ) {
  1828. var n = G.start,
  1829. r = ''
  1830. if (le)
  1831. xe.each($, function (e, t) {
  1832. ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && ((n = t.start), Q.push(n), (n += H) > G.end && n < G.end + H && Q.push(G.end))
  1833. })
  1834. else for (; n - H < G.end; ) Q.push(n), (n += H)
  1835. if (Z[0] && t !== Q.length) {
  1836. for (var o = 0; o < Q.length; o++) r += F.pageBuilder.call(B, o)
  1837. ;(K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
  1838. }
  1839. }
  1840. if (((ee.slideeSize = z), (ee.frameSize = H), (ee.sbSize = Y), (ee.handleSize = q), le)) {
  1841. e && null != F.startAt && (m(F.startAt), B[se ? 'toCenter' : 'toStart'](F.startAt))
  1842. var a = $[ee.activeItem]
  1843. l(se && a ? a.center : Fe(G.dest, G.start, G.end))
  1844. } else e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end))
  1845. L('load')
  1846. }
  1847. function l(e, t, i) {
  1848. if (le && Ie.released && !i) {
  1849. var n = d(e),
  1850. r = e > G.start && e < G.end
  1851. se ? (r && (e = $[n.centerItem].center), ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
  1852. }
  1853. Ie.init && Ie.slidee && F.elasticBounds ? (e > G.end ? (e = G.end + (e - G.end) / 6) : e < G.start && (e = G.start + (e - G.start) / 6)) : (e = Fe(e, G.start, G.end)),
  1854. (Ae.start = +new Date()),
  1855. (Ae.time = 0),
  1856. (Ae.from = G.cur),
  1857. (Ae.to = e),
  1858. (Ae.delta = e - G.cur),
  1859. (Ae.tweesing = Ie.tweese || (Ie.init && !Ie.slidee)),
  1860. (Ae.immediate = !Ae.tweesing && (t || (Ie.init && Ie.slidee) || !F.speed)),
  1861. (Ie.tweese = 0),
  1862. e !== G.dest && ((G.dest = e), L('change'), _e || o()),
  1863. g(),
  1864. v(),
  1865. p(),
  1866. K[0] && ye.page !== ee.activePage && ((ye.page = ee.activePage), K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass), L('activePage', ye.page))
  1867. }
  1868. function o() {
  1869. if (B.initialized) {
  1870. if (!_e) return (_e = Ge(o)), void (Ie.released && L('moveStart'))
  1871. Ae.immediate
  1872. ? (G.cur = Ae.to)
  1873. : Ae.tweesing
  1874. ? ((Ae.tweeseDelta = Ae.to - G.cur), $e(Ae.tweeseDelta) < 0.1 ? (G.cur = Ae.to) : (G.cur += Ae.tweeseDelta * (Ie.released ? F.swingSpeed : F.syncSpeed)))
  1875. : ((Ae.time = rt(+new Date() - Ae.start, F.speed)), (G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed))),
  1876. Ae.to === G.cur ? ((G.cur = Ae.to), (Ie.tweese = _e = 0)) : (_e = Ge(o)),
  1877. L('move'),
  1878. V || (Ve ? (U[0].style[Ve] = ke + (F.horizontal ? 'translateX' : 'translateY') + '(' + -G.cur + 'px)') : (U[0].style[F.horizontal ? 'left' : 'top'] = -it(G.cur) + 'px')),
  1879. !_e && Ie.released && L('moveEnd'),
  1880. c()
  1881. }
  1882. }
  1883. function c() {
  1884. j.length &&
  1885. ((X.cur = G.start === G.end ? 0 : (((Ie.init && !Ie.slidee ? G.dest : G.cur) - G.start) / (G.end - G.start)) * X.end),
  1886. (X.cur = Fe(it(X.cur), X.start, X.end)),
  1887. ye.hPos !== X.cur &&
  1888. ((ye.hPos = X.cur), Ve ? (j[0].style[Ve] = ke + (F.horizontal ? 'translateX' : 'translateY') + '(' + X.cur + 'px)') : (j[0].style[F.horizontal ? 'left' : 'top'] = X.cur + 'px')))
  1889. }
  1890. function t() {
  1891. ;(Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start)) || B.stop(),
  1892. (Te = Ie.init ? Ge(t) : 0),
  1893. (Ce.now = +new Date()),
  1894. (Ce.pos = G.cur + ((Ce.now - Ce.lastTime) / 1e3) * Ce.speed),
  1895. l(Ie.init ? Ce.pos : it(Ce.pos)),
  1896. Ie.init || G.cur !== G.dest || L('moveEnd'),
  1897. (Ce.lastTime = Ce.now)
  1898. }
  1899. function i(e, t, i) {
  1900. if (('boolean' === Re(t) && ((i = t), (t = Se)), t === Se)) l(G[e], i)
  1901. else {
  1902. if (se && 'center' !== e) return
  1903. var n = B.getPos(t)
  1904. n && l(n[e], i, !se)
  1905. }
  1906. }
  1907. function h(e) {
  1908. return null != e ? (De(e) ? (0 <= e && e < $.length ? e : -1) : J.index(e)) : -1
  1909. }
  1910. function u(e) {
  1911. return h(De(e) && e < 0 ? e + $.length : e)
  1912. }
  1913. function m(e, t) {
  1914. var i = h(e)
  1915. return (
  1916. !(!le || i < 0) && ((ye.active === i && !t) || (J.eq(ee.activeItem).removeClass(F.activeClass), J.eq(i).addClass(F.activeClass), (ye.active = ee.activeItem = i), p(), L('active', i)), i)
  1917. )
  1918. }
  1919. function d(e) {
  1920. e = Fe(De(e) ? e : G.dest, G.start, G.end)
  1921. var t = {},
  1922. i = ae ? 0 : H / 2
  1923. if (!V)
  1924. for (var n = 0, r = Q.length; n < r; n++) {
  1925. if (e >= G.end || n === Q.length - 1) {
  1926. t.activePage = Q.length - 1
  1927. break
  1928. }
  1929. if (e <= Q[n] + i) {
  1930. t.activePage = n
  1931. break
  1932. }
  1933. }
  1934. if (le) {
  1935. for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
  1936. if ((!1 === o && e <= $[l].start + $[l].half && (o = l), !1 === s && e <= $[l].center + $[l].half && (s = l), l === c - 1 || e <= $[l].end + $[l].half)) {
  1937. a = l
  1938. break
  1939. }
  1940. ;(t.firstItem = De(o) ? o : 0), (t.centerItem = De(s) ? s : t.firstItem), (t.lastItem = De(a) ? a : t.centerItem)
  1941. }
  1942. return t
  1943. }
  1944. function v(e) {
  1945. xe.extend(ee, d(e))
  1946. }
  1947. function p() {
  1948. var e = G.dest <= G.start,
  1949. t = G.dest >= G.end,
  1950. i = (e ? 1 : 0) | (t ? 2 : 0)
  1951. if (
  1952. (ye.slideePosState !== i &&
  1953. ((ye.slideePosState = i),
  1954. ge.is('button,input') && ge.prop('disabled', e),
  1955. me.is('button,input') && me.prop('disabled', t),
  1956. ge.add(de)[e ? 'addClass' : 'removeClass'](F.disabledClass),
  1957. me.add(ue)[t ? 'addClass' : 'removeClass'](F.disabledClass)),
  1958. ye.fwdbwdState !== i && Ie.released && ((ye.fwdbwdState = i), de.is('button,input') && de.prop('disabled', e), ue.is('button,input') && ue.prop('disabled', t)),
  1959. le && null != ee.activeItem)
  1960. ) {
  1961. var n = 0 === ee.activeItem,
  1962. r = ee.activeItem >= $.length - 1,
  1963. o = (n ? 1 : 0) | (r ? 2 : 0)
  1964. ye.itemsButtonState !== o &&
  1965. ((ye.itemsButtonState = o),
  1966. pe.is('button,input') && pe.prop('disabled', n),
  1967. fe.is('button,input') && fe.prop('disabled', r),
  1968. pe[n ? 'addClass' : 'removeClass'](F.disabledClass),
  1969. fe[r ? 'addClass' : 'removeClass'](F.disabledClass))
  1970. }
  1971. }
  1972. function r(e, t, i) {
  1973. if (((e = u(e)), (t = u(t)), -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1))) {
  1974. J.eq(e)[i ? 'insertAfter' : 'insertBefore']($[t].el)
  1975. var n = e < t ? e : i ? t : t - 1,
  1976. r = t < e ? e : i ? t + 1 : t,
  1977. o = t < e
  1978. null != ee.activeItem &&
  1979. (e === ee.activeItem ? (ye.active = ee.activeItem = i ? (o ? t + 1 : t) : o ? t : t - 1) : ee.activeItem > n && ee.activeItem < r && (ye.active = ee.activeItem += o ? 1 : -1)),
  1980. a()
  1981. }
  1982. }
  1983. function f(e, t) {
  1984. for (var i = 0, n = ve[e].length; i < n; i++) if (ve[e][i] === t) return i
  1985. return -1
  1986. }
  1987. function g() {
  1988. Ie.released && !B.isPaused && B.resume()
  1989. }
  1990. function y(e) {
  1991. return it((Fe(e, X.start, X.end) / X.end) * (G.end - G.start)) + G.start
  1992. }
  1993. function A() {
  1994. ;(Ie.history[0] = Ie.history[1]), (Ie.history[1] = Ie.history[2]), (Ie.history[2] = Ie.history[3]), (Ie.history[3] = Ie.delta)
  1995. }
  1996. function C(e) {
  1997. ;(Ie.released = 0), (Ie.source = e), (Ie.slidee = 'slidee' === e)
  1998. }
  1999. function I(e) {
  2000. var t = 'touchstart' === e.type,
  2001. i = e.data.source,
  2002. n = 'slidee' === i
  2003. Ie.init ||
  2004. (!t && b(e.target)) ||
  2005. !('handle' !== i || (F.dragHandle && X.start !== X.end)) ||
  2006. (n && !(t ? F.touchDragging : F.mouseDragging && e.which < 2)) ||
  2007. (t || Pe(e),
  2008. C(i),
  2009. (Ie.init = 0),
  2010. (Ie.$source = xe(e.target)),
  2011. (Ie.touch = t),
  2012. (Ie.pointer = t ? e.originalEvent.touches[0] : e),
  2013. (Ie.initX = Ie.pointer.pageX),
  2014. (Ie.initY = Ie.pointer.pageY),
  2015. (Ie.initPos = n ? G.cur : X.cur),
  2016. (Ie.start = +new Date()),
  2017. (Ie.time = 0),
  2018. (Ie.path = 0),
  2019. (Ie.delta = 0),
  2020. (Ie.locked = 0),
  2021. (Ie.history = [0, 0, 0, 0]),
  2022. (Ie.pathToLock = n ? (t ? 30 : 10) : 0),
  2023. We.on(t ? qe : Ye, E),
  2024. B.pause(1),
  2025. (n ? U : j).addClass(F.draggedClass),
  2026. L('moveStart'),
  2027. n && (be = setInterval(A, 10)))
  2028. }
  2029. function E(e) {
  2030. if (
  2031. ((Ie.released = 'mouseup' === e.type || 'touchend' === e.type),
  2032. (Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? 'changedTouches' : 'touches'][0] : e),
  2033. (Ie.pathX = Ie.pointer.pageX - Ie.initX),
  2034. (Ie.pathY = Ie.pointer.pageY - Ie.initY),
  2035. (Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2))),
  2036. (Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY),
  2037. Ie.released || !(Ie.path < 1))
  2038. ) {
  2039. if (!Ie.init) {
  2040. if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY))) return _()
  2041. Ie.init = 1
  2042. }
  2043. Pe(e),
  2044. !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && ((Ie.locked = 1), Ie.$source.on(Ze, Oe)),
  2045. Ie.released && (_(), F.releaseSwing && Ie.slidee && ((Ie.swing = ((Ie.delta - Ie.history[0]) / 40) * 300), (Ie.delta += Ie.swing), (Ie.tweese = 10 < $e(Ie.swing)))),
  2046. l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
  2047. }
  2048. }
  2049. function _() {
  2050. clearInterval(be),
  2051. (Ie.released = !0),
  2052. We.off(Ie.touch ? qe : Ye, E),
  2053. (Ie.slidee ? U : j).removeClass(F.draggedClass),
  2054. setTimeout(function () {
  2055. Ie.$source.off(Ze, Oe)
  2056. }),
  2057. G.cur === G.dest && Ie.init && L('moveEnd'),
  2058. B.resume(1),
  2059. (Ie.init = 0)
  2060. }
  2061. function b(e) {
  2062. return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
  2063. }
  2064. function w() {
  2065. B.stop(), We.off('mouseup', w)
  2066. }
  2067. function T(e) {
  2068. switch ((Pe(e), this)) {
  2069. case ue[0]:
  2070. case de[0]:
  2071. B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy), We.on('mouseup', w)
  2072. break
  2073. case pe[0]:
  2074. B.prev()
  2075. break
  2076. case fe[0]:
  2077. B.next()
  2078. break
  2079. case ge[0]:
  2080. B.prevPage()
  2081. break
  2082. case me[0]:
  2083. B.nextPage()
  2084. }
  2085. }
  2086. function x(e) {
  2087. e.originalEvent[He] = B
  2088. var t = +new Date()
  2089. if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window) ot = t
  2090. else if (F.scrollBy && G.start !== G.end) {
  2091. var i = (function (e) {
  2092. return (
  2093. (Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta),
  2094. (Ee.curDelta /= 1 === e.deltaMode ? 3 : 100),
  2095. le
  2096. ? ((Ue = +new Date()),
  2097. Ee.last < Ue - Ee.resetTime && (Ee.delta = 0),
  2098. (Ee.last = Ue),
  2099. (Ee.delta += Ee.curDelta),
  2100. $e(Ee.delta) < 1 ? (Ee.finalDelta = 0) : ((Ee.finalDelta = it(Ee.delta / 1)), (Ee.delta %= 1)),
  2101. Ee.finalDelta)
  2102. : Ee.curDelta
  2103. )
  2104. })(e.originalEvent)
  2105. ;(F.scrollTrap || (0 < i && G.dest < G.end) || (i < 0 && G.dest > G.start)) && Pe(e, 1), B.slideBy(F.scrollBy * i)
  2106. }
  2107. }
  2108. function S(e) {
  2109. F.clickBar && e.target === W[0] && (Pe(e), l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
  2110. }
  2111. function M(e) {
  2112. if (F.keyboardNavBy)
  2113. switch (e.which) {
  2114. case F.horizontal ? 37 : 38:
  2115. Pe(e), B['pages' === F.keyboardNavBy ? 'prevPage' : 'prev']()
  2116. break
  2117. case F.horizontal ? 39 : 40:
  2118. Pe(e), B['pages' === F.keyboardNavBy ? 'nextPage' : 'next']()
  2119. }
  2120. }
  2121. function R(e) {
  2122. return b(this) ? void (e.originalEvent[He + 'ignore'] = !0) : void (this.parentNode !== U[0] || e.originalEvent[He + 'ignore'] || B.activate(this))
  2123. }
  2124. function P() {
  2125. this.parentNode === Z[0] && B.activatePage(K.index(this))
  2126. }
  2127. function O(e) {
  2128. F.pauseOnHover && B['mouseenter' === e.type ? 'pause' : 'resume'](2)
  2129. }
  2130. function L(e, t) {
  2131. if (ve[e]) {
  2132. for (N = ve[e].length, Je.length = 0, D = 0; D < N; D++) Je.push(ve[e][D])
  2133. for (D = 0; D < N; D++) Je[D].call(B, e, t)
  2134. }
  2135. }
  2136. var D,
  2137. N,
  2138. F = xe.extend({}, Me.defaults, e),
  2139. B = this,
  2140. V = De(s),
  2141. k = xe(s),
  2142. U = F.slidee ? xe(F.slidee).eq(0) : k.children().eq(0),
  2143. H = 0,
  2144. z = 0,
  2145. G = {
  2146. start: 0,
  2147. center: 0,
  2148. end: 0,
  2149. cur: 0,
  2150. dest: 0
  2151. },
  2152. W = xe(F.scrollBar).eq(0),
  2153. j = W.children().eq(0),
  2154. Y = 0,
  2155. q = 0,
  2156. X = {
  2157. start: 0,
  2158. end: 0,
  2159. cur: 0
  2160. },
  2161. Z = xe(F.pagesBar),
  2162. K = 0,
  2163. Q = [],
  2164. J = 0,
  2165. $ = [],
  2166. ee = {
  2167. firstItem: 0,
  2168. lastItem: 0,
  2169. centerItem: 0,
  2170. activeItem: null,
  2171. activePage: 0
  2172. },
  2173. te = new Be(k[0]),
  2174. ie = new Be(U[0]),
  2175. ne = new Be(W[0]),
  2176. re = new Be(j[0]),
  2177. oe = 'basic' === F.itemNav,
  2178. ae = 'forceCentered' === F.itemNav,
  2179. se = 'centered' === F.itemNav || ae,
  2180. le = !V && (oe || se || ae),
  2181. ce = F.scrollSource ? xe(F.scrollSource) : k,
  2182. he = F.dragSource ? xe(F.dragSource) : k,
  2183. ue = xe(F.forward),
  2184. de = xe(F.backward),
  2185. pe = xe(F.prev),
  2186. fe = xe(F.next),
  2187. ge = xe(F.prevPage),
  2188. me = xe(F.nextPage),
  2189. ve = {},
  2190. ye = {},
  2191. Ae = {},
  2192. Ce = {},
  2193. Ie = {
  2194. released: 1
  2195. },
  2196. Ee = {
  2197. last: 0,
  2198. delta: 0,
  2199. resetTime: 200
  2200. },
  2201. _e = 0,
  2202. be = 0,
  2203. we = 0,
  2204. Te = 0
  2205. V || (s = k[0]),
  2206. (B.initialized = 0),
  2207. (B.frame = s),
  2208. (B.slidee = U[0]),
  2209. (B.pos = G),
  2210. (B.rel = ee),
  2211. (B.items = $),
  2212. (B.pages = Q),
  2213. (B.isPaused = 0),
  2214. (B.options = F),
  2215. (B.dragging = Ie),
  2216. (B.reload = function () {
  2217. a()
  2218. }),
  2219. (B.getPos = function (e) {
  2220. if (le) {
  2221. var t = h(e)
  2222. return -1 !== t && $[t]
  2223. }
  2224. var i = U.find(e).eq(0)
  2225. if (i[0]) {
  2226. var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top,
  2227. r = i[F.horizontal ? 'outerWidth' : 'outerHeight']()
  2228. return {
  2229. start: n,
  2230. center: n - H / 2 + r / 2,
  2231. end: n - H + r,
  2232. size: r
  2233. }
  2234. }
  2235. return !1
  2236. }),
  2237. (B.moveBy = function (e) {
  2238. ;(Ce.speed = e),
  2239. !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && ((Ce.lastTime = +new Date()), (Ce.startPos = G.cur), C('button'), (Ie.init = 1), L('moveStart'), ze(Te), t())
  2240. }),
  2241. (B.stop = function () {
  2242. 'button' === Ie.source && ((Ie.init = 0), (Ie.released = 1))
  2243. }),
  2244. (B.prev = function () {
  2245. B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
  2246. }),
  2247. (B.next = function () {
  2248. B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
  2249. }),
  2250. (B.prevPage = function () {
  2251. B.activatePage(ee.activePage - 1)
  2252. }),
  2253. (B.nextPage = function () {
  2254. B.activatePage(ee.activePage + 1)
  2255. }),
  2256. (B.slideBy = function (e, t) {
  2257. e && (le ? B[se ? 'toCenter' : 'toStart'](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
  2258. }),
  2259. (B.slideTo = function (e, t) {
  2260. l(e, t)
  2261. }),
  2262. (B.toStart = function (e, t) {
  2263. i('start', e, t)
  2264. }),
  2265. (B.toEnd = function (e, t) {
  2266. i('end', e, t)
  2267. }),
  2268. (B.toCenter = function (e, t) {
  2269. i('center', e, t)
  2270. }),
  2271. (B.getIndex = h),
  2272. (B.activate = function (e, t) {
  2273. var i = m(e)
  2274. F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
  2275. }),
  2276. (B.activatePage = function (e, t) {
  2277. De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
  2278. }),
  2279. (B.resume = function (e) {
  2280. F.cycleBy &&
  2281. F.cycleInterval &&
  2282. ('items' !== F.cycleBy || ($[0] && null != ee.activeItem)) &&
  2283. !(e < B.isPaused) &&
  2284. ((B.isPaused = 0),
  2285. we ? (we = clearTimeout(we)) : L('resume'),
  2286. (we = setTimeout(function () {
  2287. switch ((L('cycle'), F.cycleBy)) {
  2288. case 'items':
  2289. B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1)
  2290. break
  2291. case 'pages':
  2292. B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
  2293. }
  2294. }, F.cycleInterval)))
  2295. }),
  2296. (B.pause = function (e) {
  2297. e < B.isPaused || ((B.isPaused = e || 100), we && ((we = clearTimeout(we)), L('pause')))
  2298. }),
  2299. (B.toggle = function () {
  2300. B[we ? 'pause' : 'resume']()
  2301. }),
  2302. (B.set = function (e, t) {
  2303. xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
  2304. }),
  2305. (B.add = function (e, t) {
  2306. var i = xe(e)
  2307. le
  2308. ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el), null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length))
  2309. : U.append(i),
  2310. a()
  2311. }),
  2312. (B.remove = function (e) {
  2313. if (le) {
  2314. var t = u(e)
  2315. if (-1 < t) {
  2316. J.eq(t).remove()
  2317. var i = t === ee.activeItem
  2318. null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem), a(), i && ((ye.active = null), B.activate(ee.activeItem))
  2319. }
  2320. } else xe(e).remove(), a()
  2321. }),
  2322. (B.moveAfter = function (e, t) {
  2323. r(e, t, 1)
  2324. }),
  2325. (B.moveBefore = function (e, t) {
  2326. r(e, t)
  2327. }),
  2328. (B.on = function (e, t) {
  2329. if ('object' === Re(e)) for (var i in e) e.hasOwnProperty(i) && B.on(i, e[i])
  2330. else if ('function' === Re(t)) for (var n = e.split(' '), r = 0, o = n.length; r < o; r++) (ve[n[r]] = ve[n[r]] || []), -1 === f(n[r], t) && ve[n[r]].push(t)
  2331. else if ('array' === Re(t)) for (var a = 0, s = t.length; a < s; a++) B.on(e, t[a])
  2332. }),
  2333. (B.one = function (t, i) {
  2334. B.on(t, function e() {
  2335. i.apply(B, arguments), B.off(t, e)
  2336. })
  2337. }),
  2338. (B.off = function (e, t) {
  2339. if (t instanceof Array) for (var i = 0, n = t.length; i < n; i++) B.off(e, t[i])
  2340. else
  2341. for (var r = e.split(' '), o = 0, a = r.length; o < a; o++)
  2342. if (((ve[r[o]] = ve[r[o]] || []), null == t)) ve[r[o]].length = 0
  2343. else {
  2344. var s = f(r[o], t)
  2345. ;-1 !== s && ve[r[o]].splice(s, 1)
  2346. }
  2347. }),
  2348. (B.destroy = function () {
  2349. return (
  2350. ce
  2351. .add(j)
  2352. .add(W)
  2353. .add(Z)
  2354. .add(ue)
  2355. .add(de)
  2356. .add(pe)
  2357. .add(fe)
  2358. .add(ge)
  2359. .add(me)
  2360. .off('.' + He),
  2361. We.off('keydown', M),
  2362. pe.add(fe).add(ge).add(me).removeClass(F.disabledClass),
  2363. J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass),
  2364. Z.empty(),
  2365. V || (k.off('.' + He), te.restore(), ie.restore(), ne.restore(), re.restore(), xe.removeData(s, He)),
  2366. ($.length = Q.length = 0),
  2367. (ye = {}),
  2368. (B.initialized = 0),
  2369. B
  2370. )
  2371. }),
  2372. (B.init = function () {
  2373. if (!B.initialized) {
  2374. B.on(n)
  2375. var e = ['overflow', 'position'],
  2376. t = ['position', 'webkitTransform', 'msTransform', 'transform', 'left', 'top', 'width', 'height']
  2377. te.save.apply(te, e), ne.save.apply(ne, e), ie.save.apply(ie, t), re.save.apply(re, t)
  2378. var i = j
  2379. return (
  2380. V || ((i = i.add(U)), k.css('overflow', 'hidden'), Ve || 'static' !== k.css('position') || k.css('position', 'relative')),
  2381. Ve
  2382. ? ke && i.css(Ve, ke)
  2383. : ('static' === W.css('position') && W.css('position', 'relative'),
  2384. i.css({
  2385. position: 'absolute'
  2386. })),
  2387. F.forward && ue.on(Ke, T),
  2388. F.backward && de.on(Ke, T),
  2389. F.prev && pe.on(Ze, T),
  2390. F.next && fe.on(Ze, T),
  2391. F.prevPage && ge.on(Ze, T),
  2392. F.nextPage && me.on(Ze, T),
  2393. ce.on(Xe, x),
  2394. W[0] && W.on(Ze, S),
  2395. le && F.activateOn && k.on(F.activateOn + '.' + He, '*', R),
  2396. Z[0] && F.activatePageOn && Z.on(F.activatePageOn + '.' + He, '*', P),
  2397. he.on(
  2398. je,
  2399. {
  2400. source: 'slidee'
  2401. },
  2402. I
  2403. ),
  2404. j &&
  2405. j.on(
  2406. je,
  2407. {
  2408. source: 'handle'
  2409. },
  2410. I
  2411. ),
  2412. We.on('keydown', M),
  2413. V || (k.on('mouseenter.' + He + ' mouseleave.' + He, O), k.on('scroll.' + He, Le)),
  2414. (B.initialized = 1),
  2415. a(!0),
  2416. F.cycleBy && !V && B[F.startPaused ? 'pause' : 'resume'](),
  2417. B
  2418. )
  2419. }
  2420. })
  2421. }
  2422. function Re(e) {
  2423. return null == e
  2424. ? String(e)
  2425. : 'object' == typeof e || 'function' == typeof e
  2426. ? Object.prototype.toString
  2427. .call(e)
  2428. .match(/\s([a-z]+)/i)[1]
  2429. .toLowerCase() || 'object'
  2430. : typeof e
  2431. }
  2432. function Pe(e, t) {
  2433. e.preventDefault(), t && e.stopPropagation()
  2434. }
  2435. function Oe(e) {
  2436. Pe(e, 1), xe(this).off(e.type, Oe)
  2437. }
  2438. function Le() {
  2439. ;(this.scrollLeft = 0), (this.scrollTop = 0)
  2440. }
  2441. function De(e) {
  2442. return !isNaN(parseFloat(e)) && isFinite(e)
  2443. }
  2444. function Ne(e, t) {
  2445. return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ''))
  2446. }
  2447. function Fe(e, t, i) {
  2448. return e < t ? t : i < e ? i : e
  2449. }
  2450. function Be(t) {
  2451. var i = {
  2452. style: {},
  2453. save: function () {
  2454. if (t && t.nodeType) {
  2455. for (var e = 0; e < arguments.length; e++) i.style[arguments[e]] = t.style[arguments[e]]
  2456. return i
  2457. }
  2458. },
  2459. restore: function () {
  2460. if (t && t.nodeType) {
  2461. for (var e in i.style) i.style.hasOwnProperty(e) && (t.style[e] = i.style[e])
  2462. return i
  2463. }
  2464. }
  2465. }
  2466. return i
  2467. }
  2468. var Ve,
  2469. ke,
  2470. Ue,
  2471. r,
  2472. o,
  2473. He = 'sly',
  2474. ze = e.cancelAnimationFrame || e.cancelRequestAnimationFrame,
  2475. Ge = e.requestAnimationFrame,
  2476. We = xe(document),
  2477. je = 'touchstart.' + He + ' mousedown.' + He,
  2478. Ye = 'mousemove.' + He + ' mouseup.' + He,
  2479. qe = 'touchmove.' + He + ' touchend.' + He,
  2480. Xe = (document.implementation.hasFeature('Event.wheel', '3.0') ? 'wheel.' : 'mousewheel.') + He,
  2481. Ze = 'click.' + He,
  2482. Ke = 'mousedown.' + He,
  2483. Qe = ['INPUT', 'SELECT', 'BUTTON', 'TEXTAREA'],
  2484. Je = [],
  2485. $e = Math.abs,
  2486. et = Math.sqrt,
  2487. tt = Math.pow,
  2488. it = Math.round,
  2489. nt = Math.max,
  2490. rt = Math.min,
  2491. ot = 0
  2492. function t(e) {
  2493. for (var t = 0, i = r.length; t < i; t++) {
  2494. var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e
  2495. if (null != o.style[n]) return n
  2496. }
  2497. }
  2498. We.on(Xe, function (e) {
  2499. var t = e.originalEvent[He],
  2500. i = +new Date()
  2501. ;(!t || t.options.scrollHijack < i - ot) && (ot = i)
  2502. }),
  2503. (function (t) {
  2504. Ge =
  2505. t.requestAnimationFrame ||
  2506. t.webkitRequestAnimationFrame ||
  2507. function (e) {
  2508. var t = new Date().getTime(),
  2509. i = Math.max(0, 16 - (t - r)),
  2510. n = setTimeout(e, i)
  2511. return (r = t), n
  2512. }
  2513. var r = new Date().getTime(),
  2514. i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout
  2515. ze = function (e) {
  2516. i.call(t, e)
  2517. }
  2518. })(window),
  2519. (r = ['', 'webkit', 'moz', 'ms', 'o']),
  2520. (o = document.createElement('div')),
  2521. (Ve = t('transform')),
  2522. (ke = t('perspective') ? 'translateZ(0) ' : ''),
  2523. (e.Sly = Me),
  2524. (xe.fn.sly = function (n, r) {
  2525. var o, a
  2526. return (
  2527. xe.isPlainObject(n) || (('string' !== Re(n) && !1 !== n) || ((o = !1 === n ? 'destroy' : n), (a = Array.prototype.slice.call(arguments, 1))), (n = {})),
  2528. this.each(function (e, t) {
  2529. var i = xe.data(t, He)
  2530. i || o ? i && o && i[o] && i[o].apply(i, a) : (i = xe.data(t, He, new Me(t, n, r).init()))
  2531. })
  2532. )
  2533. }),
  2534. (Me.defaults = {
  2535. slidee: null,
  2536. horizontal: !1,
  2537. itemNav: null,
  2538. itemSelector: null,
  2539. smart: !1,
  2540. activateOn: null,
  2541. activateMiddle: !1,
  2542. scrollSource: null,
  2543. scrollBy: 0,
  2544. scrollHijack: 300,
  2545. scrollTrap: !1,
  2546. dragSource: null,
  2547. mouseDragging: !1,
  2548. touchDragging: !1,
  2549. releaseSwing: !1,
  2550. swingSpeed: 0.2,
  2551. elasticBounds: !1,
  2552. interactive: null,
  2553. scrollBar: null,
  2554. dragHandle: !1,
  2555. dynamicHandle: !1,
  2556. minHandleSize: 50,
  2557. clickBar: !1,
  2558. syncSpeed: 0.5,
  2559. pagesBar: null,
  2560. activatePageOn: null,
  2561. pageBuilder: function (e) {
  2562. return '<li>' + (e + 1) + '</li>'
  2563. },
  2564. forward: null,
  2565. backward: null,
  2566. prev: null,
  2567. next: null,
  2568. prevPage: null,
  2569. nextPage: null,
  2570. cycleBy: null,
  2571. cycleInterval: 5e3,
  2572. pauseOnHover: !1,
  2573. startPaused: !1,
  2574. moveBy: 300,
  2575. speed: 0,
  2576. easing: 'swing',
  2577. startAt: null,
  2578. keyboardNavBy: null,
  2579. draggedClass: 'dragged',
  2580. activeClass: 'active',
  2581. disabledClass: 'disabled'
  2582. })
  2583. })(jQuery, window),
  2584. (function o(a, s, l) {
  2585. function c(i, e) {
  2586. if (!s[i]) {
  2587. if (!a[i]) {
  2588. var t = 'function' == typeof require && require
  2589. if (!e && t) return t(i, !0)
  2590. if (h) return h(i, !0)
  2591. var n = new Error("Cannot find module '" + i + "'")
  2592. throw ((n.code = 'MODULE_NOT_FOUND'), n)
  2593. }
  2594. var r = (s[i] = {
  2595. exports: {}
  2596. })
  2597. a[i][0].call(
  2598. r.exports,
  2599. function (e) {
  2600. var t = a[i][1][e]
  2601. return c(t || e)
  2602. },
  2603. r,
  2604. r.exports,
  2605. o,
  2606. a,
  2607. s,
  2608. l
  2609. )
  2610. }
  2611. return s[i].exports
  2612. }
  2613. for (var h = 'function' == typeof require && require, e = 0; e < l.length; e++) c(l[e])
  2614. return c
  2615. })(
  2616. {
  2617. 1: [
  2618. function (p, f, e) {
  2619. ;(function (e) {
  2620. 'use strict'
  2621. function t(e) {
  2622. ;(this.player = null),
  2623. (this.director = null),
  2624. (this.modelManager = null),
  2625. (this.container = null),
  2626. (this.tagManager = null),
  2627. (this.fadeInSpeed = e),
  2628. (null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed) || (this.fadeInSpeed = 0)
  2629. }
  2630. var r = p('three'),
  2631. i = p('./util/logger'),
  2632. n = (p('./util/common'), p('./enum/PlayerEvents')),
  2633. o = p('./enum/DirectorEvents'),
  2634. a = p('./settings'),
  2635. s = p('./enum/Viewmode'),
  2636. l = (p('./enum/WarpStyle'), p('./enum/BlackoutStyle'), p('./enum/ModelManagerEvents')),
  2637. c = p('./enum/tagEvents'),
  2638. h = p('./util/transitions'),
  2639. u = p('./util/lerp'),
  2640. d = new i(e)
  2641. ;(t.prototype.init = function (e, t, i, n, r) {
  2642. ;((window.app = this).player = t), (this.director = e), (this.modelManager = i), (this.tagManager = n), (this.container = r), this.updateModel(), this.bindEvents()
  2643. }),
  2644. (t.prototype.bindEvents = function () {
  2645. this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)),
  2646. this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2647. this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2648. this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2649. this.player.on(n.StartInside, this.handleStartInside.bind(this)),
  2650. this.player.on(n.StartOutside, this.handleStartOutside.bind(this)),
  2651. this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)),
  2652. this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2653. this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)),
  2654. this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
  2655. }),
  2656. (t.prototype.updateModel = function () {
  2657. this.model = this.modelManager.getActiveModel()
  2658. }),
  2659. (t.prototype.handleWarpStarted = function () {
  2660. this.hidePlayerReticule()
  2661. }),
  2662. (t.prototype.ontagActivated = function () {
  2663. this.hidePlayerReticule()
  2664. }),
  2665. (t.prototype.onNavigationTotag = function () {
  2666. this.hidePlayerReticule()
  2667. }),
  2668. (t.prototype.handlePlayerModeChanging = function (e, t, i) {
  2669. var n = this.modelManager.getActiveModel(),
  2670. r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity
  2671. n.fadePanoMarkers(r), n.setMode(t)
  2672. }),
  2673. (t.prototype.handlePlayerModeChanged = function (e, t) {
  2674. var i = this.modelManager.getActiveModel(),
  2675. n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide
  2676. i.setSide(n), i.setMode(t)
  2677. }),
  2678. (t.prototype.handleClosestPanoChanging = function (e, t, i) {
  2679. i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i), t && !this.director.tourIsPlaying && t.hoverOn(i))
  2680. }),
  2681. (t.prototype.handleActionInterruption = function () {}),
  2682. (t.prototype.handleStartInside = function (e) {
  2683. var t = a[this.player.mode],
  2684. i = e ? 0 : t.transitionTime * t.skyboxOpacityLength
  2685. this.fadeIn(this.fadeInSpeed), (this.model.alpha = 0), (this.model.skybox.material.uniforms.opacity.value = 1), this.model.fadePanoMarkers(e ? 0 : t.markerOpacity)
  2686. var n = this.player.reticule
  2687. h.start(u.property(n.material, 'opacity', 0), i, null, 0, null, 'retReOpac')
  2688. }),
  2689. (t.prototype.handleStartOutside = function (e) {
  2690. this.fadeIn(e)
  2691. }),
  2692. (t.prototype.fadeIn = function (e) {
  2693. null != e || ((e = 2e3), d.warn('DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.')), $(this.container).fadeIn(e)
  2694. }),
  2695. (t.prototype.hidePlayerReticule = function () {
  2696. this.player.reticule.hide()
  2697. }),
  2698. (f.exports = t)
  2699. }).call(this, '/js/DisplayController.js')
  2700. },
  2701. {
  2702. './enum/BlackoutStyle': 18,
  2703. './enum/DirectorEvents': 23,
  2704. './enum/tagEvents': 32,
  2705. './enum/ModelManagerEvents': 33,
  2706. './enum/PlayerEvents': 40,
  2707. './enum/Viewmode': 51,
  2708. './enum/WarpStyle': 52,
  2709. './settings': 166,
  2710. './util/common': 185,
  2711. './util/lerp': 188,
  2712. './util/logger': 189,
  2713. './util/transitions': 195,
  2714. three: 217
  2715. }
  2716. ],
  2717. 2: [
  2718. function (e, t, i) {
  2719. 'use strict'
  2720. function n() {
  2721. ;(this.baseStartTime = performance.timing.navigationStart), (this.loadingStartTime = null), (this.waitingStartTime = null), (this.appReadyTime = null)
  2722. }
  2723. ;(n.prototype.setBaseStartTime = function (e) {
  2724. this.baseStartTime = e || Date.now()
  2725. }),
  2726. (n.prototype.setWaitingStartTime = function (e) {
  2727. this.waitingStartTime = e || Date.now()
  2728. }),
  2729. (n.prototype.setLoadingStartTime = function (e) {
  2730. this.loadingStartTime = e || Date.now()
  2731. }),
  2732. (n.prototype.setAppReadyTime = function (e) {
  2733. this.appReadyTime = e || Date.now()
  2734. }),
  2735. (n.prototype.calcFullLoadingTime = function () {
  2736. var e = this.appReadyTime - this.baseStartTime
  2737. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime), e
  2738. }),
  2739. (t.exports = n)
  2740. },
  2741. {}
  2742. ],
  2743. 3: [
  2744. function (i, n, e) {
  2745. ;(function (e) {
  2746. 'use strict'
  2747. function a() {
  2748. return 100 * Math.random()
  2749. }
  2750. var t = i('./util/logger'),
  2751. s = i('./util/browser'),
  2752. l = new t(e),
  2753. c = (window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2754. initialized: !1,
  2755. init: function (e, t) {
  2756. if (((t = t || {}), !this.initialized)) {
  2757. for (var i in ((this.initialized = !0),
  2758. s.valueFromHash('tilegen') && (t.tilegen = 1 === s.valueFromHash('tilegen', 0)),
  2759. s.valueFromHash('imgopt') && (t.imgopt = 1 === s.valueFromHash('imgopt', 0)),
  2760. e)) {
  2761. var n = i.match('^sc_tilegen_([0-9]+)$')
  2762. n && (c.tilegen = a() < parseInt(n[1]))
  2763. var r = i.match('^sc_imgopt_([0-9]+)$')
  2764. r && (c.imgopt = a() < parseInt(r[1]))
  2765. }
  2766. for (var o in t) (c[o] = t[o]), l.debug('A/B override:', o, c[o])
  2767. }
  2768. },
  2769. changeIfTileGenerating: function (e) {
  2770. return c.tilegen && ((e += -1 === e.indexOf('?') ? '?' : '&'), (e += '')), e
  2771. },
  2772. changeIfImageOptimzing: function (e) {
  2773. if (e.includes('blob:http')) return e //add
  2774. return c.imgopt && -1 === e.indexOf('imgopt=1') && ((e += -1 === e.indexOf('?') ? '?' : '&'), (e += '')), e
  2775. },
  2776. tilegen: !1,
  2777. imgopt: !1
  2778. })
  2779. n.exports = c
  2780. }).call(this, '/js/ab.js')
  2781. },
  2782. {
  2783. './util/browser': 182,
  2784. './util/logger': 189
  2785. }
  2786. ],
  2787. 4: [
  2788. function (u, d, e) {
  2789. ;(function (e) {
  2790. 'use strict'
  2791. function r(n, e, t, i) {
  2792. function r(e) {
  2793. a[e.sid] = !0
  2794. var t = e.billboard.media && e.billboard.media.type,
  2795. i = {
  2796. tag_id: e.sid,
  2797. tags_visited: Object.keys(a).length,
  2798. tag_count: Object.keys(n.tags).length,
  2799. tag_view_count: ++d,
  2800. has_media: !!t
  2801. }
  2802. t && (i.media_type = t), g('tag_opened', i)
  2803. }
  2804. var o,
  2805. a = {},
  2806. s = Date.now() - P,
  2807. l = null
  2808. i && (l = Date.now() - window.navigationStart)
  2809. try {
  2810. o = /* n.data.player_options.highlight_reel && */ 0 < n.heroLocations.length
  2811. } catch (n) {
  2812. o = !1
  2813. }
  2814. var c,
  2815. h = n.supportsVR
  2816. h ||
  2817. ((c = 'VR disabled at the model/account level'),
  2818. y.valueFromHash('vr') === w.NONE
  2819. ? (c = 'VR disabled, using &vr=0')
  2820. : y.detectAndroid()
  2821. ? _.isDeviceSupported(b.Android) || (c = 'VR disabled, unsupported Android version')
  2822. : y.detectIOS() && (_.isDeviceSupported(b.IOS) || (c = 'VR disabled, unsupported iOS version'))),
  2823. g('model_loaded', {
  2824. duration: s,
  2825. duration_from_navigation_start: l,
  2826. has_hlr: o,
  2827. has_vr: h,
  2828. vr_reason: c
  2829. })
  2830. var u = 0
  2831. n.panos.forEach(function (e) {
  2832. e.on('enter', function () {
  2833. f('pano_viewed', {
  2834. pano_id: e.id,
  2835. pano_view_count: ++u,
  2836. alignment_type: e.alignmentType,
  2837. interaction_source: R,
  2838. navigation_source: v
  2839. })
  2840. })
  2841. })
  2842. var d = 0
  2843. for (var p in n.tags) n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]))
  2844. e.on('tour_auto', function (e) {
  2845. v = 'tour_' + e
  2846. }),
  2847. e.on('tour_manual', function (e) {
  2848. ;(R = 'gui-' + e), (v = 'tour_manual')
  2849. }),
  2850. t.on(C.InteractionKey, function () {
  2851. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
  2852. }),
  2853. t.on(C.InteractionDirect, function () {
  2854. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
  2855. }),
  2856. (function (t) {
  2857. I.on(T.OPENED, function () {
  2858. f('showcase_share_intent', {
  2859. pano_id: t.currentPano && t.currentPano.id
  2860. })
  2861. }),
  2862. I.on(T.LINK_CLICKED, function (e) {
  2863. f('showcase_share_action', {
  2864. channel: e.channel,
  2865. pano_id: t.currentPano && t.currentPano.id
  2866. })
  2867. }),
  2868. E.on(x.ORIGIN_LINK_CLICKED, function () {
  2869. f('showcase_share_origin_link_clicked')
  2870. })
  2871. })(e),
  2872. (function () {
  2873. _.on(
  2874. S.OPENED,
  2875. f.bind(this, 'showcase_gui', {
  2876. gui_action: 'click_vr_button'
  2877. })
  2878. ),
  2879. _.on(S.LAUNCH, function (e) {
  2880. f('showcase_gui', {
  2881. gui_action: 'launch_vr',
  2882. vr_platform: e.vr_platform,
  2883. vr_app: e.vr_app
  2884. })
  2885. }),
  2886. _.on(
  2887. S.PREV,
  2888. f.bind(this, 'showcase_gui', {
  2889. gui_action: 'vr_modal_prev'
  2890. })
  2891. ),
  2892. _.on(S.NEXT, function (e) {
  2893. f('showcase_gui', {
  2894. gui_action: e.nextAction
  2895. })
  2896. }),
  2897. _.on(
  2898. S.CLOSED,
  2899. f.bind(this, 'showcase_gui', {
  2900. gui_action: 'vr_modal_close'
  2901. })
  2902. ),
  2903. _.on(S.falseICECHOSEN, function (e) {
  2904. f('showcase_gui', {
  2905. gui_action: e.name + ' '
  2906. })
  2907. }),
  2908. _.on(S.STORE, function (e) {
  2909. f('showcase_gui', {
  2910. gui_action: 'launch_store',
  2911. store: e
  2912. })
  2913. })
  2914. })()
  2915. }
  2916. function f(e, t) {
  2917. if (((t = t || {}), i))
  2918. try {
  2919. window.analytics.track(e, s.extendObject(t, c), {
  2920. context: {
  2921. app: {
  2922. name: 'showcase',
  2923. version: '2.25.6-0-gd87e5b1'
  2924. },
  2925. screen: {
  2926. width: window.screen.width,
  2927. height: window.screen.height,
  2928. density: window.devicePixelRatio
  2929. }
  2930. }
  2931. })
  2932. } catch (t) {
  2933. console.warn('Failed to send data to segment for ' + e)
  2934. }
  2935. }
  2936. function g(e, t) {
  2937. f(e, (t = t || {}))
  2938. }
  2939. function m(e, t) {
  2940. ;(R = e === C.InteractionGui ? 'gui-' + t : e), (v = 'self_guided')
  2941. }
  2942. var v,
  2943. o,
  2944. a = (u('three'), u('./util/ajax'), u('./ab')),
  2945. y = u('./util/browser'),
  2946. s = u('./util/common'),
  2947. t = u('./settings'),
  2948. A = (u('./localization/localize'), u('./enum/Viewmode')),
  2949. C = u('./enum/ControlEvents'),
  2950. I = u('./gui/sharing/modal'),
  2951. E = u('./gui/title/titleBar'),
  2952. _ = u('./gui/vr/vrModal'),
  2953. b = u('./enum/VRPlatforms'),
  2954. w = u('./enum/VROption'),
  2955. T = u('./gui/sharing/ShareEvents'),
  2956. x = u('./gui/title/TitleEvents'),
  2957. S = u('./gui/vr/vrEvent'),
  2958. M = u('./tag/Billboard/BillboardEvent'),
  2959. l = new (u('./util/logger'))(e),
  2960. R = (u('./enum/PlayerEvents'), 'direct'),
  2961. i = null,
  2962. n = !1,
  2963. P = null,
  2964. c = null,
  2965. h = s.uuid4()
  2966. d.exports = {
  2967. report: function (e, t, i, n) {
  2968. !(function (e, t) {
  2969. if (o)
  2970. try {
  2971. o.addEvent(
  2972. e,
  2973. s.extendObject(
  2974. {
  2975. host: window.location.host,
  2976. keen: {
  2977. addons: [
  2978. {
  2979. name: 'keen:ua_parser',
  2980. input: {
  2981. ua_string: 'user_agent'
  2982. },
  2983. output: 'parsed_user_agent'
  2984. }
  2985. ]
  2986. },
  2987. user_agent: '${keen.user_agent}',
  2988. referrer: {
  2989. url: s.normalizeUrl(document.referrer),
  2990. domain: s.domainFromUrl(document.referrer),
  2991. url_original: document.referrer
  2992. },
  2993. embedded: y.inIframe(),
  2994. is_mobile: y.isMobile(),
  2995. version: '2.25.6-0-gd87e5b1'
  2996. },
  2997. t
  2998. )
  2999. )
  3000. } catch (e) {
  3001. l.warn('analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: ' + e)
  3002. }
  3003. })('Session starts', {
  3004. model: e,
  3005. status: t,
  3006. loadtime: Date.now() - (P || Date.now()),
  3007. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  3008. autoplay: i,
  3009. quickstart: n,
  3010. ab_tilegen: a.tilegen,
  3011. ab_imgopt: a.imgopt
  3012. })
  3013. },
  3014. impression: function (e) {
  3015. g('impression', {
  3016. visible: void 0 === (e = e || {}).isVisible || e.isVisible,
  3017. url_params: (void 0 !== e.immediate && e.immediate, window.location.search.substr(1).split('&'))
  3018. })
  3019. },
  3020. initKeen: function (e) {
  3021. return e.token && e.appId
  3022. ? void (o = new Keen({
  3023. projectId: e.appId,
  3024. writeKey: e.token,
  3025. readKey: '',
  3026. requestType: 'xhr'
  3027. }))
  3028. : void l.warn('no keen token/appId')
  3029. },
  3030. initSegment: function (e) {
  3031. return e.token
  3032. ? ((i = e.token),
  3033. window.analytics.load(e.token),
  3034. (c = {
  3035. model_id: e.model,
  3036. start_source: e.startSource,
  3037. autoplay: e.autoplay,
  3038. quickstart: e.quickstart,
  3039. language_tag: t.languageTag,
  3040. is_mobile: y.isMobile(),
  3041. iframe: y.inIframe(),
  3042. aspect_ratio: y.aspectRatio(),
  3043. session_id: h,
  3044. window: {
  3045. width: $('#player').width(),
  3046. height: $('#player').height()
  3047. },
  3048. platform: {
  3049. browser: {
  3050. name: $.ua.browser.name,
  3051. major: $.ua.browser.major,
  3052. version: $.ua.browser.version
  3053. },
  3054. os: {
  3055. name: $.ua.os.name,
  3056. version: $.ua.os.version
  3057. },
  3058. device: {
  3059. vendor: $.ua.device.vendor,
  3060. model: $.ua.device.model,
  3061. type: $.ua.device.type
  3062. }
  3063. }
  3064. }),
  3065. (n = Math.random() < t.analytics.sessionTrackingRate),
  3066. l.debug('tracking sample rate = ' + t.analytics.sessionTrackingRate),
  3067. void l.debug('tracking this session = ' + n))
  3068. : void l.warn('no segment token')
  3069. },
  3070. sessionStart: function (e) {
  3071. l.debug('analytics user_session_start'),
  3072. f('session_started'),
  3073. (P = Date.now()),
  3074. window.addEventListener('unload', function () {
  3075. !(function (e, t) {
  3076. if (((t = t || {}), navigator.sendBeacon && i))
  3077. try {
  3078. navigator.sendBeacon(
  3079. 'https://api.segment.io/v1/t',
  3080. JSON.stringify({
  3081. event: e,
  3082. anonymousId: window.analytics.user().anonymousId(),
  3083. properties: s.extendObject(t, c),
  3084. writeKey: i,
  3085. sentAt: Date.now(),
  3086. type: 'track',
  3087. context: {
  3088. userAgent: y.userAgent(),
  3089. library: {
  3090. name: 'showcase-beacon',
  3091. version: '2.25.6-0-gd87e5b1'
  3092. },
  3093. app: {
  3094. name: 'showcase',
  3095. version: '2.25.6-0-gd87e5b1'
  3096. }
  3097. }
  3098. })
  3099. )
  3100. } catch (e) {
  3101. console.warn('Failed to send async segment request')
  3102. }
  3103. })('session_ended', {
  3104. duration: Date.now() - P
  3105. })
  3106. })
  3107. },
  3108. modelLoaded: function (e, t, i, n) {
  3109. r(e, t, i, n)
  3110. },
  3111. loadComplete: function (e) {
  3112. f('load_times', {
  3113. time_to_app_start: e
  3114. })
  3115. },
  3116. track: function (e, t) {
  3117. n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + ' )'), f(e, t))
  3118. },
  3119. trackAlways: function (e, t) {
  3120. l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + ' )'), f(e, t)
  3121. },
  3122. getSessionId: function () {
  3123. return h
  3124. },
  3125. updateInteraction: m
  3126. }
  3127. }).call(this, '/js/analytics.js')
  3128. },
  3129. {
  3130. './ab': 3,
  3131. './enum/ControlEvents': 21,
  3132. './enum/PlayerEvents': 40,
  3133. './enum/VROption': 47,
  3134. './enum/VRPlatforms': 49,
  3135. './enum/Viewmode': 51,
  3136. './gui/sharing/ShareEvents': 76,
  3137. './gui/sharing/modal': 77,
  3138. './gui/title/TitleEvents': 80,
  3139. './gui/title/titleBar': 82,
  3140. './gui/vr/vrEvent': 85,
  3141. './gui/vr/vrModal': 87,
  3142. './localization/localize': 108,
  3143. './tag/Billboard/BillboardEvent': 120,
  3144. './settings': 166,
  3145. './util/ajax': 181,
  3146. './util/browser': 182,
  3147. './util/common': 185,
  3148. './util/logger': 189,
  3149. three: 217
  3150. }
  3151. ],
  3152. 5: [
  3153. function (e, t, i) {
  3154. 'use strict'
  3155. function n() {
  3156. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $('#player').width() / $('#player').height(), o.dollhouseNear, o.dollhouseFar), (this.controls = null)
  3157. }
  3158. var r = e('three'),
  3159. o = e('../constants'),
  3160. a = e('../util/cameraLight')
  3161. ;((n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function (e) {
  3162. ;(this.aspect = e), this.updateProjectionMatrix()
  3163. }),
  3164. (t.exports = n)
  3165. },
  3166. {
  3167. '../constants': 8,
  3168. '../util/cameraLight': 184,
  3169. three: 217
  3170. }
  3171. ],
  3172. 6: [
  3173. function (e, t, i) {
  3174. 'use strict'
  3175. function n() {
  3176. var e = $('#player').width() / $('#player').height()
  3177. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar), (this.controls = null), this.updateAspect(e)
  3178. }
  3179. var r = e('three'),
  3180. o = e('../constants')
  3181. ;((n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function (e) {
  3182. ;(this.aspect = e), (this.top = o.orthoBase / e), (this.bottom = -o.orthoBase / e), this.updateProjectionMatrix()
  3183. }),
  3184. (t.exports = n)
  3185. },
  3186. {
  3187. '../constants': 8,
  3188. three: 217
  3189. }
  3190. ],
  3191. 7: [
  3192. function (e, t, i) {
  3193. 'use strict'
  3194. function n() {
  3195. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $('#player').width() / $('#player').height(), o.insideNear, o.insideFar), (this.controls = null)
  3196. }
  3197. var r = e('three'),
  3198. o = e('../settings'),
  3199. a = e('../util/cameraLight')
  3200. ;((n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function (e) {
  3201. ;(this.aspect = e), this.updateProjectionMatrix()
  3202. }),
  3203. (t.exports = n)
  3204. },
  3205. {
  3206. '../settings': 166,
  3207. '../util/cameraLight': 184,
  3208. three: 217
  3209. }
  3210. ],
  3211. 8: [
  3212. function (e, t, i) {
  3213. 'use strict'
  3214. t.exports = {
  3215. signedUrlDefaultExpireTime: 24e4,
  3216. signedUrlCheckInterval: 1e4,
  3217. signedUrlRefreshBuffer: 15e3,
  3218. dollhouseFOV: 70,
  3219. dollhouseNear: 0.1, //1,
  3220. dollhouseFar: 5e3,
  3221. insideFOV: 70,
  3222. insideFOVMax: 120,
  3223. insideNear: 0.01, //.1,
  3224. insideFar: 5e3,
  3225. insideLookSpeed: 0.12,
  3226. insideLookLimitUp: 40,
  3227. insideLookLimitDown: -40,
  3228. orthoNear: 1,
  3229. orthoFar: 5e3,
  3230. orthoBase: 10,
  3231. narrowLandscapeHeight: 290,
  3232. reallyNarrowLandscapeHeight: 250,
  3233. visionTilingStartDate: new Date('8/26/2016'),
  3234. visionTilingStartVersion: '1.1.407.13667',
  3235. windowHeightHighQualityThreshold: 900,
  3236. tourStepDelayDefault: 3500,
  3237. tourStepDelaySlideShow: 5e3,
  3238. workshopApsect: 9 / 16,
  3239. highQualityMaxZoom: 2,
  3240. ultraHighQualityMaxZoom: 3
  3241. }
  3242. },
  3243. {}
  3244. ],
  3245. 9: [
  3246. function (e, t, i) {
  3247. 'use strict'
  3248. function n() {
  3249. ;(this.activeControl = null), (this.controls = {}), (this.cameras = {})
  3250. }
  3251. var a = e('./PanoramaControls'),
  3252. s = e('./DollhouseControls'),
  3253. l = e('./FloorplanControls'),
  3254. c = e('../cameras/PanoramaCamera'),
  3255. h = e('../cameras/DollhouseCamera'),
  3256. u = e('../cameras/FloorplanCamera'),
  3257. r = e('events').EventEmitter,
  3258. d = e('../enum/ControlEvents'),
  3259. o = e('../enum/ModelManagerEvents'),
  3260. p = e('../enum/Viewmode'),
  3261. f = e('../settings')
  3262. ;((n.prototype = Object.create(r.prototype)).init = function (e, t) {
  3263. this.setUpControls(), this.bindEvents(e, t)
  3264. }),
  3265. (n.prototype.activateControls = function (e) {
  3266. this.activeControl && (this.activeControl.reset(), (this.activeControl.enabled = !1)), this.controls[e] && (this.controls[e].enabled = !0), (this.activeControl = this.controls[e])
  3267. }),
  3268. (n.prototype.setUpControls = function () {
  3269. var i = {},
  3270. n = {},
  3271. e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN],
  3272. r = [c, h, u],
  3273. o = [a, s, l]
  3274. e.forEach(
  3275. function (e, t) {
  3276. ;(i[e] = new r[t]()),
  3277. (n[e] = new o[t](i[e])),
  3278. n[e].on(d.Move, this.emit.bind(this, d.Move)),
  3279. n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)),
  3280. n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)),
  3281. n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)),
  3282. n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)),
  3283. n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
  3284. }.bind(this)
  3285. ),
  3286. (this.controls = n),
  3287. (this.cameras = i)
  3288. }),
  3289. (n.prototype.bindEvents = function (e, t) {
  3290. e.addEventListener('mousemove', this.onMouseMove.bind(this)),
  3291. e.addEventListener('mousedown', this.onMouseDown.bind(this)),
  3292. e.addEventListener('mouseup', this.onMouseUp.bind(this)),
  3293. e.addEventListener('mouseover', this.onMouseOver.bind(this)),
  3294. f.useWheel &&
  3295. (e.addEventListener('mousewheel', this.onMouseWheel.bind(this), {
  3296. passive: !1
  3297. }),
  3298. e.addEventListener('DOMMouseScroll', this.onMouseWheel.bind(this))),
  3299. e.addEventListener('touchstart', this.onTouchStart.bind(this)),
  3300. e.addEventListener('touchmove', this.onTouchMove.bind(this)),
  3301. e.addEventListener('touchend', this.onTouchEnd.bind(this)),
  3302. e.addEventListener('contextmenu', function (e) {
  3303. e.preventDefault()
  3304. }),
  3305. e.addEventListener('pointerdown', this.onPointerDown.bind(this)),
  3306. e.addEventListener('pointermove', this.onPointerMove.bind(this)),
  3307. e.addEventListener('pointerup', this.onPointerUp.bind(this)),
  3308. e.addEventListener('pointerout', this.onPointerCancel.bind(this)),
  3309. e.addEventListener('pointercancel', this.onPointerCancel.bind(this)),
  3310. document.addEventListener('keydown', this.onKeyDown.bind(this)),
  3311. document.addEventListener('keyup', this.onKeyUp.bind(this)),
  3312. t.on(
  3313. o.ActiveModelChanged,
  3314. function (e) {
  3315. this.setModelForControls(e.model)
  3316. }.bind(this)
  3317. )
  3318. }),
  3319. (n.prototype.setModelForControls = function (e) {
  3320. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox)
  3321. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding)
  3322. ;[p.DOLLHOUSE, p.FLOORPLAN].forEach(
  3323. function (e) {
  3324. this.controls[e].setBounds(t)
  3325. }.bind(this)
  3326. )
  3327. }),
  3328. (n.prototype.onMouseDown = function (e) {
  3329. e.preventDefault(), this.activeControl && this.activeControl.onMouseDown(e)
  3330. }),
  3331. (n.prototype.onMouseMove = function (e) {
  3332. e.preventDefault(), this.activeControl && this.activeControl.onMouseMove(e)
  3333. }),
  3334. (n.prototype.onMouseUp = function (e) {
  3335. e.preventDefault(), this.activeControl && this.activeControl.onMouseUp(e)
  3336. }),
  3337. (n.prototype.onMouseOver = function (e) {
  3338. e.preventDefault(), this.activeControl && this.activeControl.onMouseOver(e)
  3339. }),
  3340. (n.prototype.onMouseWheel = function (e) {
  3341. e.preventDefault(), this.activeControl && this.activeControl.onMouseWheel(e)
  3342. }),
  3343. (n.prototype.onTouchStart = function (e) {
  3344. e.preventDefault(),
  3345. this.activeControl && this.activeControl.onTouchStart(e),
  3346. $('#hotListWrap')[0].classList.remove('hotListActive'),
  3347. $('#hotListContent ul .active').removeClass('active'),
  3348. $('#hotList')[0].classList.remove('active')
  3349. }),
  3350. (n.prototype.onTouchMove = function (e) {
  3351. e.preventDefault(), this.activeControl && this.activeControl.onTouchMove(e)
  3352. }),
  3353. (n.prototype.onTouchEnd = function (e) {
  3354. e.preventDefault(), this.activeControl && this.activeControl.onTouchEnd(e)
  3355. }),
  3356. (n.prototype.onPointerDown = function (e) {
  3357. if ((e.preventDefault(), this.activeControl))
  3358. switch (e.pointerType) {
  3359. case 'mouse':
  3360. this.activeControl.onMouseDown(e)
  3361. break
  3362. default:
  3363. this.activeControl.onPointerDown(e)
  3364. }
  3365. }),
  3366. (n.prototype.onPointerMove = function (e) {
  3367. if ((e.preventDefault(), this.activeControl))
  3368. switch (e.pointerType) {
  3369. case 'mouse':
  3370. this.activeControl.onMouseMove(e)
  3371. break
  3372. default:
  3373. this.activeControl.onPointerMove(e)
  3374. }
  3375. }),
  3376. (n.prototype.onPointerUp = function (e) {
  3377. if ((e.preventDefault(), this.activeControl))
  3378. switch (e.pointerType) {
  3379. case 'mouse':
  3380. this.activeControl.onMouseUp(e)
  3381. break
  3382. default:
  3383. this.activeControl.onPointerUp(e)
  3384. }
  3385. }),
  3386. (n.prototype.onPointerCancel = function (e) {
  3387. e.preventDefault(), this.activeControl && 'mouse' !== e.pointerType && this.activeControl.onPointerUp(e)
  3388. }),
  3389. (n.prototype.onKeyDown = function (e) {
  3390. e.metaKey || e.ctrlKey || (e.preventDefault(), this.activeControl && this.activeControl.onKeyDown(e))
  3391. }),
  3392. (n.prototype.onKeyUp = function (e) {
  3393. e.preventDefault(), this.activeControl && this.activeControl.onKeyUp(e)
  3394. }),
  3395. (t.exports = n)
  3396. },
  3397. {
  3398. '../cameras/DollhouseCamera': 5,
  3399. '../cameras/FloorplanCamera': 6,
  3400. '../cameras/PanoramaCamera': 7,
  3401. '../enum/ControlEvents': 21,
  3402. '../enum/ModelManagerEvents': 33,
  3403. '../enum/Viewmode': 51,
  3404. '../settings': 166,
  3405. './DollhouseControls': 10,
  3406. './FloorplanControls': 11,
  3407. './PanoramaControls': 13,
  3408. events: 202
  3409. }
  3410. ],
  3411. 10: [
  3412. function (e, t, i) {
  3413. 'use strict'
  3414. function n(e) {
  3415. a.call(this, e),
  3416. (this.minPolarAngle = o.dollhouseDefault.minPolarAngle),
  3417. (this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle),
  3418. (this.minDistance = o.dollhouseDefault.minDistance),
  3419. (this.maxDistance = o.dollhouseDefault.maxDistance),
  3420. (this.adjustedMinDistance = this.minDistance),
  3421. (this.adjustedMaxDistance = this.maxDistance)
  3422. }
  3423. var r = e('three'),
  3424. o = e('../settings'),
  3425. a = e('./OutsideControls')
  3426. ;((n.prototype = Object.create(a.prototype)).pan = function (e, t) {
  3427. this.camera.updateMatrix()
  3428. var i = this.camera.position.clone().sub(this.target).length()
  3429. ;(i *= Math.tan(((this.camera.fov / 2) * Math.PI) / 180)), this.panLeft((2 * e * i) / $('#player').height()), this.panUp((-2 * t * i) / $('#player').height())
  3430. }),
  3431. (n.prototype.updateZoom = function () {
  3432. return this.offset.length() * this.scale
  3433. }),
  3434. (n.prototype.setZoomBounds = function (e) {
  3435. var t = e.min.distanceTo(e.max)
  3436. ;(this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0)),
  3437. (this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius)),
  3438. (this.minDistance = this.adjustedMinDistance),
  3439. (this.maxDistance = this.adjustedMaxDistance)
  3440. }),
  3441. (n.prototype.resetRanges = function (e, t) {
  3442. e
  3443. ? ((this.minDistance = Math.min(e, this.minDistance)), (this.maxDistance = Math.max(e, this.maxDistance)))
  3444. : ((this.minDistance = this.adjustedMinDistance), (this.maxDistance = this.adjustedMaxDistance)),
  3445. t
  3446. ? ((this.minPolarAngle = r.Math.degToRad(-15)), (this.maxPolarAngle = r.Math.degToRad(89.9)))
  3447. : ((this.minPolarAngle = o.dollhouseDefault.minPolarAngle), (this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle))
  3448. }),
  3449. (n.prototype.toJSON = function () {
  3450. return a.prototype.toJSON.call(this)
  3451. }),
  3452. (t.exports = n)
  3453. },
  3454. {
  3455. '../settings': 166,
  3456. './OutsideControls': 12,
  3457. three: 217
  3458. }
  3459. ],
  3460. 11: [
  3461. function (e, t, i) {
  3462. 'use strict'
  3463. function n(e) {
  3464. c.call(this, e),
  3465. (this.minDistance = 15),
  3466. (this.maxDistance = 50),
  3467. (this.noRotateUpDown = !0),
  3468. (this.minPolarAngle = 0),
  3469. (this.maxPolarAngle = 0),
  3470. (this.mouseActions[u.LEFT] = h.PAN),
  3471. (this.mouseActions[u.MIDDLE] = h.DOLLY),
  3472. (this.mouseActions[u.RIGHT] = h.ROTATE),
  3473. (this.touchActions[1] = h.PAN),
  3474. (this.touchActions[2] = h.ROTATE_DOLLY),
  3475. (this.absoluteScale = 1),
  3476. (this.currentScale = 1)
  3477. }
  3478. var r,
  3479. o,
  3480. a,
  3481. s = e('three'),
  3482. l = e('../settings'),
  3483. c = e('./OutsideControls'),
  3484. h = e('../enum/ControlActions'),
  3485. u = e('../enum/MouseButton'),
  3486. d = e('../util/math'),
  3487. p = e('../util/browser')
  3488. ;((n.prototype = Object.create(c.prototype)).zoomToContain = function (e) {
  3489. this.absoluteScale = this.getDefaultAbsoluteScale(e)
  3490. this.currentScale = this.absoluteScale
  3491. }),
  3492. /* n.prototype.getDefaultAbsoluteScale = function(modelSize) {
  3493. var t = Math.max(modelSize.x, modelSize.z)
  3494. , i = Math.min(modelSize.x, modelSize.z)
  3495. , n = Math.max(t, i * this.camera.aspect)
  3496. , r = Math.max(i, t * this.camera.aspect);
  3497. var absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2
  3498. return absoluteScale
  3499. }, */
  3500. (n.prototype.getDefaultAbsoluteScale = function (modelSize, ratio) {
  3501. let defaultRatio = 1.2,
  3502. absoluteScale
  3503. if (_settings.floorPlanAngle) {
  3504. //指定了角度的话,就和browser.aspectRatio()无关,总使用纵向
  3505. var angle = parseFloat(_settings.floorPlanAngle)
  3506. modelSize = modelSize.clone().applyEuler(new THREE.Euler(0, angle, 0))
  3507. var n = Math.max(Math.abs(modelSize.x), Math.abs(modelSize.z) * this.camera.aspect) //视口宽高比 >= 1 情况下,模型所占最大视口尺寸
  3508. var screenSize = Math.min($('#player').width(), $('#player').height())
  3509. var maxSize = 800 //模型最大占据像素
  3510. ratio = ratio != void 0 ? ratio : Math.max((screenSize * defaultRatio) / maxSize, defaultRatio)
  3511. absoluteScale = (n / 2 / l.orthoBase) * ratio //根据模型所占最大视口尺寸调整缩放
  3512. } else {
  3513. var t = Math.max(modelSize.x, modelSize.z),
  3514. i = Math.min(modelSize.x, modelSize.z),
  3515. n = Math.max(t, i * this.camera.aspect),
  3516. r = Math.max(i, t * this.camera.aspect)
  3517. absoluteScale = ((p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase) * defaultRatio
  3518. }
  3519. return absoluteScale
  3520. }),
  3521. (n.prototype.rotateToView = function (modelSize, direction) {
  3522. let i = 0,
  3523. n = p.aspectRatio() < 1 //是否模型尺寸显“细长”
  3524. if (_settings.floorPlanAngle) {
  3525. //规定了cadImage旋转值的话 (0是无效的,将不设置)
  3526. i = parseFloat(_settings.floorPlanAngle)
  3527. } else {
  3528. let r = modelSize.x < modelSize.z //是否视口为“窄屏”
  3529. if (n === r) {
  3530. //“细长” 且 “窄屏”,说明模型尺寸比例与视口比例匹配,相机坐标只需要调转“前”“后”
  3531. if (direction.z > 0) {
  3532. //(第一种情况)相机是否位于背面。 注:在默认情况下webgl的相机朝向-z, direction.z > 0 说明相机视野已经偏向+z,说明相机位于模型“背面”
  3533. i = Math.PI //经度上做180度轨道角位移,使相机移到静止模型的“前面”
  3534. }
  3535. //(第二种情况) 不做处理
  3536. } else if (direction.x > 0) {
  3537. i = Math.PI / 2
  3538. } else {
  3539. i = -Math.PI / 2
  3540. }
  3541. }
  3542. this.rotateLeft(i)
  3543. this.update(0)
  3544. }),
  3545. (n.prototype.rotateToAngle = function (angle) {
  3546. //add 旋转到特定角度
  3547. this.rotateLeft(angle + this.lon)
  3548. this.update(0)
  3549. }),
  3550. (n.prototype.pan = function (e, t) {
  3551. this.camera.updateMatrix(),
  3552. this.panLeft((e * (this.camera.right - this.camera.left)) / $('#player').width()),
  3553. this.panUp((-t * (this.camera.top - this.camera.bottom)) / $('#player').height())
  3554. }),
  3555. (n.prototype.updateZoom = function () {
  3556. return (
  3557. (this.absoluteScale *= this.scale - 0.03 * this.keyboardZoomSpeed),
  3558. (this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit))),
  3559. (this.currentScale = 0.8 * this.currentScale + 0.2 * this.absoluteScale),
  3560. (this.camera.left = -l.orthoBase * this.currentScale),
  3561. (this.camera.right = l.orthoBase * this.currentScale),
  3562. (this.camera.top = (l.orthoBase * this.currentScale) / this.camera.aspect),
  3563. (this.camera.bottom = (-l.orthoBase * this.currentScale) / this.camera.aspect),
  3564. this.camera.updateProjectionMatrix(),
  3565. this.offset.length()
  3566. )
  3567. }),
  3568. (n.prototype.toJSON =
  3569. ((r = new s.Quaternion()),
  3570. (o = new s.Quaternion().setFromAxisAngle(new s.Vector3(0, 1, 0), s.Math.degToRad(90))),
  3571. (a = new s.Quaternion()),
  3572. function () {
  3573. var e = c.prototype.toJSON.call(this)
  3574. return (
  3575. r.copy(e.camera_quaternion),
  3576. a.copy(o),
  3577. a.multiply(r),
  3578. (e.camera_quaternion.x = d.toPrecision(a.x, 4)),
  3579. (e.camera_quaternion.y = d.toPrecision(a.y, 4)),
  3580. (e.camera_quaternion.z = d.toPrecision(a.z, 4)),
  3581. (e.camera_quaternion.w = d.toPrecision(a.w, 4)),
  3582. (e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4)),
  3583. e
  3584. )
  3585. })),
  3586. (t.exports = n)
  3587. },
  3588. {
  3589. '../enum/ControlActions': 20,
  3590. '../enum/MouseButton': 34,
  3591. '../settings': 166,
  3592. '../util/browser': 182,
  3593. '../util/math': 190,
  3594. './OutsideControls': 12,
  3595. three: 217
  3596. }
  3597. ],
  3598. 12: [
  3599. function (e, t, i) {
  3600. 'use strict'
  3601. function n(e) {
  3602. ;(this.camera = e),
  3603. ((this.camera.controls = this).enabled = !1),
  3604. (this.target = new a.Vector3()),
  3605. (this.targetBounds = new a.Box3()),
  3606. (this.zoomSpeed = 2), //编辑时缩放快一些
  3607. (this.minDistance = 0),
  3608. (this.maxDistance = 1 / 0),
  3609. (this.noRotateUpDown = !1),
  3610. (this.rotateSpeed = 1),
  3611. (this.keyboardZoomSpeed = 0),
  3612. (this.keyPanSpeed = 7),
  3613. (this.autoRotate = !1),
  3614. (this.autoRotateSpeed = 2),
  3615. (this.autoPan = !1),
  3616. (this.autoPanPosition = new a.Vector3()),
  3617. (this.minPolarAngle = a.Math.degToRad(25)),
  3618. (this.maxPolarAngle = a.Math.degToRad(65)),
  3619. (this.rotationAcceleration = new a.Vector2()),
  3620. (this.rotationSpeed = new a.Vector2()),
  3621. (this.panAcceleration = new a.Vector2()),
  3622. (this.panSpeed = new a.Vector2()),
  3623. (this.rotateStart = new a.Vector2()),
  3624. (this.rotateEnd = new a.Vector2()),
  3625. (this.rotateDelta = new a.Vector2()),
  3626. (this.panStart = new a.Vector2()),
  3627. (this.panEnd = new a.Vector2()),
  3628. (this.panDelta = new a.Vector2()),
  3629. (this.panOffset = new a.Vector3()),
  3630. (this.offset = new a.Vector3()),
  3631. (this.dollyStart = new a.Vector2()),
  3632. (this.dollyEnd = new a.Vector2()),
  3633. (this.dollyDelta = new a.Vector2()),
  3634. (this.phiDelta = 0),
  3635. (this.thetaDelta = 0),
  3636. (this.scale = 1),
  3637. (this.panVector = new a.Vector3()),
  3638. (this.lastPosition = new a.Vector3()),
  3639. (this.state = u.NONE),
  3640. (this.mouseActions = {}),
  3641. (this.mouseActions[d.LEFT] = u.ROTATE),
  3642. (this.mouseActions[d.MIDDLE] = u.DOLLY),
  3643. (this.mouseActions[d.RIGHT] = u.PAN),
  3644. (this.touchActions = {}),
  3645. (this.touchActions[1] = u.ROTATE),
  3646. (this.touchActions[2] = u.PAN_DOLLY),
  3647. (this.lastMoveTime = 0),
  3648. (this.pointersLimit = 2),
  3649. (this.pointers = [])
  3650. }
  3651. var r,
  3652. o,
  3653. a = e('three'),
  3654. c = e('../settings'),
  3655. h = e('../util/common'),
  3656. s = e('../util/math'),
  3657. l = e('../enum/Vectors'),
  3658. u = e('../enum/ControlActions'),
  3659. d = e('../enum/MouseButton'),
  3660. p = e('../enum/Keys'),
  3661. f = e('../enum/ControlEvents'),
  3662. g = e('events').EventEmitter
  3663. ;((n.prototype = Object.create(g.prototype)).setBounds = function (e) {
  3664. this.targetBounds = e
  3665. }),
  3666. (n.prototype.isEngaged = function () {
  3667. return this.state !== u.NONE
  3668. }),
  3669. (n.prototype.rotateLeft = function (e) {
  3670. void 0 === e && (e = this.getAutoRotationAngle()), (this.thetaDelta -= e)
  3671. }),
  3672. (n.prototype.rotateUp = function (e) {
  3673. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()), (this.phiDelta -= e))
  3674. }),
  3675. (n.prototype.panLeft = function (e) {
  3676. var t = this.camera.matrix.elements
  3677. this.panOffset.set(t[0], 0, t[2]).normalize(), this.panOffset.multiplyScalar(-e), this.panVector.add(this.panOffset)
  3678. }),
  3679. (n.prototype.panUp = function (e) {
  3680. var t = this.camera.matrix.elements
  3681. this.panOffset.set(t[4], 0, t[6]).normalize(), this.panOffset.multiplyScalar(-e), this.panVector.add(this.panOffset)
  3682. }),
  3683. (n.prototype.startRotating = function (e, t) {
  3684. e && this.navRotationAcc('x', e), t && this.navRotationAcc('y', t)
  3685. }),
  3686. (n.prototype.stopRotating = function (e) {
  3687. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0), this.navRotationAcc('x', 0), this.navRotationAcc('y', 0)
  3688. }),
  3689. (n.prototype.setAutoPanPosition =
  3690. ((r = new a.Vector3()),
  3691. (o = new a.Vector3()),
  3692. function (e, t) {
  3693. r.copy(this.camera.position), (void 0 === e && null === e) || r.setX(e), (void 0 === t && null === t) || r.setZ(t)
  3694. var i = this.camera.position.distanceTo(this.target),
  3695. n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion)
  3696. ;(this.targetClamped = !1),
  3697. o.copy(r).addScaledVector(n, i),
  3698. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o), r.copy(o).addScaledVector(n, -i), (this.targetClamped = !0)),
  3699. (this.autoPanPosition.x = r.x),
  3700. (this.autoPanPosition.z = r.z),
  3701. this.autoPan && this.stopAutoPanning()
  3702. })),
  3703. (n.prototype.stopAutoPanning = function () {
  3704. var e = this.autoPan
  3705. ;(this.autoPan = !1), this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3706. }),
  3707. (n.prototype.dollyIn = function (e) {
  3708. void 0 === e && (e = this.getZoomScale()), (this.scale /= e)
  3709. }),
  3710. (n.prototype.dollyOut = function (e) {
  3711. void 0 === e && (e = this.getZoomScale()), (this.scale *= e)
  3712. }),
  3713. (n.prototype.updatePan = function (e) {
  3714. if ((this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e), this.pan(-this.panSpeed.x, this.panSpeed.y), this.autoPan)) {
  3715. var t = new a.Vector3().copy(this.autoPanPosition).sub(this.camera.position)
  3716. t.setY(0).clampLength(0, 50 * e),
  3717. this.target.add(t),
  3718. this.camera.position.add(t),
  3719. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && ((this.autoPan = !1), this.stopAutoPanning())
  3720. }
  3721. }),
  3722. (n.prototype.update = function (e) {
  3723. ;(e = e || 1 / 60),
  3724. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3725. this.rotateLeft(-this.rotationSpeed.x),
  3726. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3727. this.updatePan(e)
  3728. var t = this.camera.position
  3729. this.offset.copy(t).sub(this.target)
  3730. var i = Math.atan2(this.offset.x, this.offset.z),
  3731. n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y)
  3732. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3733. (i += this.thetaDelta),
  3734. (n += this.phiDelta),
  3735. (n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n))),
  3736. (n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n)))
  3737. ;(this.lon = i), (this.lat = n) //add
  3738. var r = this.updateZoom()
  3739. ;(r = Math.max(this.minDistance, Math.min(this.maxDistance, r))),
  3740. this.target.add(this.panVector),
  3741. this.targetBounds.clampPoint(this.target, this.target),
  3742. (this.offset.x = r * Math.sin(n) * Math.sin(i)),
  3743. (this.offset.y = r * Math.cos(n)),
  3744. (this.offset.z = r * Math.sin(n) * Math.cos(i)),
  3745. t.copy(this.target).add(this.offset),
  3746. this.camera.lookAt(this.target),
  3747. (this.thetaDelta = 0),
  3748. (this.phiDelta = 0),
  3749. (this.scale = 1),
  3750. this.panVector.set(0, 0, 0),
  3751. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3752. }),
  3753. (n.prototype.getAutoRotationAngle = function () {
  3754. return ((2 * Math.PI) / 60 / 60) * this.autoRotateSpeed
  3755. }),
  3756. (n.prototype.getZoomScale = function () {
  3757. return Math.pow(0.95, this.zoomSpeed)
  3758. }),
  3759. (n.prototype.onMouseDown = function (e) {
  3760. if (this.enabled) {
  3761. switch ((e.preventDefault(), this.stopAutoPanning(), (this.mouseDown = !0), (this.state = this.mouseActions[e.button]), this.state)) {
  3762. case u.ROTATE:
  3763. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY), this.rotationSpeed.set(0, 0)
  3764. break
  3765. case u.DOLLY:
  3766. this.dollyStart.set(e.clientX, e.clientY)
  3767. break
  3768. case u.PAN:
  3769. this.panStart.set(e.clientX, e.clientY)
  3770. }
  3771. this.emit(f.InputStart, 'mouse')
  3772. }
  3773. }),
  3774. (n.prototype.onMouseMove = function (e) {
  3775. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3776. switch ((e.preventDefault(), this.state)) {
  3777. case u.ROTATE:
  3778. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3779. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3780. this.rotateLeft(((2 * Math.PI * this.rotateDelta.x) / $('#player').width()) * this.rotateSpeed),
  3781. this.rotateUp(((2 * Math.PI * this.rotateDelta.y) / $('#player').height()) * this.rotateSpeed),
  3782. this.rotateStart.copy(this.rotateEnd)
  3783. break
  3784. case u.DOLLY:
  3785. this.dollyEnd.set(e.clientX, e.clientY),
  3786. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3787. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3788. this.dollyStart.copy(this.dollyEnd)
  3789. break
  3790. case u.PAN:
  3791. this.panEnd.set(e.clientX, e.clientY), this.panDelta.subVectors(this.panEnd, this.panStart), this.pan(this.panDelta.x, this.panDelta.y), this.panStart.copy(this.panEnd)
  3792. }
  3793. this.emit(f.Move, 'mouse'), (this.lastMoveTime = e.timeStamp), this.update()
  3794. }
  3795. }),
  3796. (n.prototype.onMouseUp = function (e) {
  3797. this.enabled &&
  3798. ((this.mouseDown = !1),
  3799. (this.state = u.NONE),
  3800. 'mouseover' !== e.type &&
  3801. (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3802. this.update(),
  3803. this.rotationAcceleration.set(0, 0),
  3804. this.rotateDelta.set(0, 0)))
  3805. }),
  3806. (n.prototype.onMouseOver = function (e) {
  3807. ;(0 !== e.which && 0 !== e.buttons) || this.onMouseUp(e)
  3808. }),
  3809. (n.prototype.onMouseWheel = function (e) {
  3810. this.enabled && c.useWheel && (this.emit(f.Move, 'wheel'), (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this), this.update())
  3811. }),
  3812. (n.prototype.onKeyDown = function (e) {
  3813. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(), this.handleKeyDown(e.which)))
  3814. }),
  3815. (n.prototype.navRotationAcc = function (e, t) {
  3816. 'y' === e ? (this.noRotateUpDown ? (this.keyboardZoomSpeed = t) : (this.rotationAcceleration.y = t)) : (this.rotationAcceleration.x = t)
  3817. }),
  3818. (n.prototype.navPanAcc = function (e, t) {
  3819. this.stopAutoPanning(), (this.panAcceleration[e] = t)
  3820. }),
  3821. (n.prototype.handleKeyDown = function (e) {
  3822. var t = !0
  3823. switch (e) {
  3824. case p.UPARROW:
  3825. case p.I:
  3826. this.navRotationAcc('y', 1)
  3827. break
  3828. case p.DOWNARROW:
  3829. case p.K:
  3830. this.navRotationAcc('y', -1)
  3831. break
  3832. case p.LEFTARROW:
  3833. case p.J:
  3834. this.navRotationAcc('x', -1)
  3835. break
  3836. case p.RIGHTARROW:
  3837. case p.L:
  3838. this.navRotationAcc('x', 1)
  3839. break
  3840. case p.W:
  3841. this.navPanAcc('y', 1)
  3842. break
  3843. case p.S:
  3844. this.navPanAcc('y', -1)
  3845. break
  3846. case p.A:
  3847. this.navPanAcc('x', -1)
  3848. break
  3849. case p.D:
  3850. this.navPanAcc('x', 1)
  3851. break
  3852. default:
  3853. t = !1
  3854. }
  3855. t && this.emit(f.Move, 'key')
  3856. }),
  3857. (n.prototype.onKeyUp = function (e) {
  3858. this.enabled && (e.preventDefault(), e.stopPropagation(), this.handleKeyUp(e.which))
  3859. }),
  3860. (n.prototype.handleKeyUp = function (e) {
  3861. switch (e) {
  3862. case p.I:
  3863. case p.K:
  3864. case p.UPARROW:
  3865. case p.DOWNARROW:
  3866. ;(this.keyboardZoomSpeed = 0), (this.rotationAcceleration.y = 0)
  3867. break
  3868. case p.J:
  3869. case p.L:
  3870. case p.LEFTARROW:
  3871. case p.RIGHTARROW:
  3872. this.rotationAcceleration.x = 0
  3873. break
  3874. case p.S:
  3875. case p.W:
  3876. this.panAcceleration.y = 0
  3877. break
  3878. case p.A:
  3879. case p.D:
  3880. this.panAcceleration.x = 0
  3881. }
  3882. }),
  3883. (n.prototype.onTouchStart = function (i) {
  3884. if (this.enabled || this.state === u.NONE) {
  3885. i.preventDefault(), i.stopPropagation(), this.stopAutoPanning()
  3886. var e = function () {
  3887. if (2 === i.touches.length) {
  3888. var e = i.touches[0].pageX - i.touches[1].pageX,
  3889. t = i.touches[0].pageY - i.touches[1].pageY
  3890. this.dollyStart.set(e, t)
  3891. }
  3892. }.bind(this),
  3893. t = function () {
  3894. this.panStart.set(h.average(i.touches, 'pageX'), h.average(i.touches, 'pageY'))
  3895. }.bind(this),
  3896. n = function () {
  3897. this.rotateStart.set(h.average(i.touches, 'pageX'), h.average(i.touches, 'pageY'))
  3898. }.bind(this)
  3899. switch (((this.state = this.touchActions[i.touches.length]), this.state)) {
  3900. case u.PAN_DOLLY:
  3901. e()
  3902. case u.PAN:
  3903. t()
  3904. break
  3905. case u.ROTATE_DOLLY:
  3906. e()
  3907. case u.ROTATE:
  3908. n()
  3909. }
  3910. this.rotationSpeed.set(0, 0), this.emit(f.InputStart, 'touch')
  3911. }
  3912. }),
  3913. (n.prototype.onTouchMove = function (a) {
  3914. if (this.enabled && this.state !== u.NONE) {
  3915. a.preventDefault(), a.stopPropagation()
  3916. var s = function () {
  3917. var e = a.touches[0].pageX - a.touches[1].pageX,
  3918. t = a.touches[0].pageY - a.touches[1].pageY
  3919. this.dollyEnd.set(e, t)
  3920. var i = this.dollyStart.length() - this.dollyEnd.length()
  3921. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500), this.dollyStart.copy(this.dollyEnd)
  3922. }.bind(this),
  3923. e = function () {
  3924. this.panEnd.set(h.average(a.touches, 'pageX'), h.average(a.touches, 'pageY')),
  3925. this.panDelta.subVectors(this.panEnd, this.panStart),
  3926. this.pan(this.panDelta.x, this.panDelta.y),
  3927. this.panStart.copy(this.panEnd),
  3928. this.rotateDelta.set(0, 0)
  3929. }.bind(this),
  3930. l = function () {
  3931. this.rotateEnd.set(h.average(a.touches, 'pageX'), h.average(a.touches, 'pageY')),
  3932. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3933. this.rotateLeft(((2 * Math.PI * this.rotateDelta.x) / $('#player').width()) * this.rotateSpeed),
  3934. this.rotateUp(((2 * Math.PI * this.rotateDelta.y) / $('#player').height()) * this.rotateSpeed),
  3935. this.rotateStart.copy(this.rotateEnd)
  3936. }.bind(this),
  3937. t = function () {
  3938. if (2 === a.touches.length) {
  3939. var e = window.devicePixelRatio || 1,
  3940. t = a.touches[1].pageX - a.touches[0].pageX,
  3941. i = a.touches[1].pageY - a.touches[0].pageY,
  3942. n = Math.sqrt(t * t + i * i)
  3943. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e) (this.state = u.DOLLY), s()
  3944. else {
  3945. var r = h.average(a.touches, 'pageX'),
  3946. o = h.average(a.touches, 'pageY')
  3947. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && ((this.state = u.ROTATE), this.rotateStart.set(r, o), l())
  3948. }
  3949. }
  3950. }.bind(this)
  3951. switch (this.state) {
  3952. case u.PAN_DOLLY:
  3953. s()
  3954. case u.PAN:
  3955. e()
  3956. break
  3957. case u.ROTATE_DOLLY:
  3958. t()
  3959. break
  3960. case u.DOLLY:
  3961. s()
  3962. break
  3963. case u.ROTATE:
  3964. l()
  3965. break
  3966. default:
  3967. this.state = u.NONE
  3968. }
  3969. ;(this.lastMoveTime = a.timeStamp), this.emit(f.Move, 'touch')
  3970. }
  3971. }),
  3972. (n.prototype.onTouchEnd = function (e) {
  3973. this.enabled &&
  3974. (this.state === u.ROTATE &&
  3975. (e.timeStamp > this.lastMoveTime + 100
  3976. ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0))
  3977. : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3978. (this.state = u.NONE),
  3979. this.update(),
  3980. this.rotationAcceleration.set(0, 0),
  3981. this.rotateDelta.set(0, 0))
  3982. }),
  3983. (n.prototype.onPointerDown = function (e) {
  3984. this.enabled &&
  3985. ('touch' === e.pointerType &&
  3986. (this.pointers.length < this.pointersLimit &&
  3987. this.pointers.push({
  3988. id: e.pointerId,
  3989. pageX: e.pageX,
  3990. pageY: e.pageY
  3991. }),
  3992. (e.touches = this.pointers),
  3993. this.onTouchStart(e)),
  3994. this.emit(f.InputStart, 'pointer'))
  3995. }),
  3996. (n.prototype.onPointerMove = function (t) {
  3997. this.enabled &&
  3998. 'touch' === t.pointerType &&
  3999. (this.pointers.forEach(function (e) {
  4000. t.pointerId === e.id && ((e.pageX = t.pageX), (e.pageY = t.pageY))
  4001. }),
  4002. (t.touches = this.pointers),
  4003. this.onTouchMove(t))
  4004. }),
  4005. (n.prototype.onPointerUp = function (i) {
  4006. this.enabled &&
  4007. 'touch' === i.pointerType &&
  4008. (this.pointers.forEach(
  4009. function (e, t) {
  4010. i.pointerId === e.id && this.pointers.splice(t, 1)
  4011. }.bind(this)
  4012. ),
  4013. (i.touches = this.pointers),
  4014. this.onTouchEnd(i))
  4015. }),
  4016. (n.prototype.reset = function () {
  4017. ;(this.state = u.NONE), this.stopAutoPanning(), this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0), this.panSpeed.set(0, 0), this.panAcceleration.set(0, 0)
  4018. }),
  4019. (n.prototype.toJSON = function () {
  4020. return {
  4021. camera_position: {
  4022. x: s.toPrecision(this.camera.position.x, 4),
  4023. y: s.toPrecision(this.camera.position.y, 4),
  4024. z: s.toPrecision(this.camera.position.z, 4)
  4025. },
  4026. camera_quaternion: {
  4027. x: s.toPrecision(this.camera.quaternion.x, 4),
  4028. y: s.toPrecision(this.camera.quaternion.y, 4),
  4029. z: s.toPrecision(this.camera.quaternion.z, 4),
  4030. w: s.toPrecision(this.camera.quaternion.w, 4)
  4031. }
  4032. }
  4033. }),
  4034. (t.exports = n)
  4035. },
  4036. {
  4037. '../enum/ControlActions': 20,
  4038. '../enum/ControlEvents': 21,
  4039. '../enum/Keys': 30,
  4040. '../enum/MouseButton': 34,
  4041. '../enum/Vectors': 50,
  4042. '../settings': 166,
  4043. '../util/common': 185,
  4044. '../util/math': 190,
  4045. events: 202,
  4046. three: 217
  4047. }
  4048. ],
  4049. 13: [
  4050. function (u, d, e) {
  4051. ;(function (e) {
  4052. 'use strict'
  4053. function t(e) {
  4054. ;(this.camera = e),
  4055. ((this.camera.controls = this).target = new s.Vector3(0, 0, 0)),
  4056. (this.lookVector = new s.Vector3()),
  4057. (this.lookSpeed = 0.05),
  4058. (this.rotationAcc = new s.Vector2()),
  4059. (this.rotationSpeed = new s.Vector2()),
  4060. (this.lat = 0),
  4061. (this.lon = 0),
  4062. (this.phi = 0),
  4063. (this.theta = 0),
  4064. (this.enabled = !1),
  4065. (this.locked = !1),
  4066. (this.pointer = new s.Vector2(0, 0)),
  4067. (this.rotationHistory = []),
  4068. (this.rotationDifference = new s.Vector2()),
  4069. (this.pointerDragOn = !1),
  4070. (this.pointerDragStart = new s.Vector2(0, 0)),
  4071. (this.pinchDistance = 0),
  4072. (this.moveStart = new s.Vector2()),
  4073. (this.moveTolerance = 0.01),
  4074. (this.pointersLimit = 2),
  4075. (this.pointers = [])
  4076. //watch(this, 'enabled', this.enabled)
  4077. }
  4078. var s = u('three'),
  4079. i = u('../util/logger'),
  4080. n = u('../settings'),
  4081. r = u('../util/common'),
  4082. o = u('../util/math'),
  4083. a = (u('../enum/Vectors'), u('../enum/MouseButton')),
  4084. l = u('../enum/Keys'),
  4085. c = u('../enum/ControlEvents'),
  4086. h = u('events').EventEmitter
  4087. new i(e),
  4088. ((t.prototype = Object.create(h.prototype)).usable = function () {
  4089. return this.enabled && !this.locked
  4090. }),
  4091. /* t.prototype.lookAt = function(e) {
  4092. var t = this.camera.position.clone().sub(e)
  4093. , i = Math.atan(t.z / t.x);
  4094. i += t.x < 0 ? Math.PI : 0,
  4095. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  4096. this.lon = s.Math.radToDeg(i) + 180;
  4097. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4098. , r = Math.atan(t.y / n);
  4099. this.lat = -s.Math.radToDeg(r)
  4100. } */
  4101. (t.prototype.lookAt = function (aim, dir) {
  4102. var t = dir || this.camera.position.clone().sub(aim) //aim所指点的笛卡尔坐标系
  4103. var i = Math.atan(t.z / t.x)
  4104. i += t.x < 0 ? Math.PI : 0
  4105. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0
  4106. this.lon = s.Math.radToDeg(i) + 180
  4107. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  4108. o = Math.atan(t.y / n)
  4109. this.lat = -s.Math.radToDeg(o)
  4110. }),
  4111. (t.prototype.startRotationFrom = function (e, t) {
  4112. o.convertScreenPositionToNDC(e, t, this.pointer),
  4113. (this.pointerDragOn = !0),
  4114. this.pointerDragStart.copy(this.pointer),
  4115. this.moveStart.copy(this.pointer),
  4116. (this.rotationHistory = []),
  4117. this.rotationSpeed.set(0, 0)
  4118. }),
  4119. (t.prototype.onMouseOver = function (e) {
  4120. !this.pointerDragOn || (0 !== e.which && 0 !== e.buttons) || this.onMouseUp(e)
  4121. }),
  4122. (t.prototype.onTouchStart = function (e) {
  4123. if (this.usable()) {
  4124. switch ((e.preventDefault(), e.stopPropagation(), e.touches.length)) {
  4125. case 1:
  4126. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY)
  4127. break
  4128. case 2:
  4129. var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width(),
  4130. i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height()
  4131. this.pinchDistance = Math.sqrt(t * t + i * i)
  4132. }
  4133. this.emit(c.InputStart, 'touch')
  4134. }
  4135. }),
  4136. (t.prototype.onPointerDown = function (e) {
  4137. this.usable() &&
  4138. 'touch' === e.pointerType &&
  4139. (this.pointers.length < this.pointersLimit &&
  4140. this.pointers.push({
  4141. id: e.pointerId,
  4142. clientX: e.clientX,
  4143. clientY: e.clientY
  4144. }),
  4145. (e.touches = this.pointers),
  4146. this.onTouchStart(e),
  4147. this.emit(c.InputStart, 'pointer'))
  4148. }),
  4149. (t.prototype.onMouseDown = function (e) {
  4150. if (this.usable()) {
  4151. switch ((e.preventDefault(), e.stopPropagation(), e.button)) {
  4152. case a.LEFT:
  4153. this.startRotationFrom(e.clientX, e.clientY)
  4154. }
  4155. this.emit(c.InputStart, 'mouse')
  4156. }
  4157. }),
  4158. (t.prototype.updateRotation = function () {
  4159. if (this.usable() && this.pointerDragOn) {
  4160. var e = new s.Vector3(this.pointerDragStart.x, this.pointerDragStart.y, -1).unproject(this.camera),
  4161. t = new s.Vector3(this.pointer.x, this.pointer.y, -1).unproject(this.camera),
  4162. i = Math.sqrt(e.x * e.x + e.z * e.z),
  4163. n = Math.sqrt(t.x * t.x + t.z * t.z),
  4164. r = Math.atan2(e.y, i),
  4165. o = Math.atan2(t.y, n)
  4166. ;(this.rotationDifference.y = s.Math.radToDeg(r - o)), (e.y = 0), (t.y = 0)
  4167. var a = Math.acos(e.dot(t) / e.length() / t.length())
  4168. isNaN(a) || ((this.rotationDifference.x = s.Math.radToDeg(a)), this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4169. this.pointerDragStart.copy(this.pointer)
  4170. }
  4171. }),
  4172. (t.prototype.onMouseMove = function (e) {
  4173. this.usable() &&
  4174. (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4175. this.pointerDragOn &&
  4176. (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) &&
  4177. this.emit(c.Move, 'mouse'))
  4178. }),
  4179. (t.prototype.onTouchMove = function (e) {
  4180. if (this.usable())
  4181. switch ((this.emit(c.Move, 'touch'), e.touches.length)) {
  4182. case 1:
  4183. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer)
  4184. break
  4185. case 2:
  4186. var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width(),
  4187. i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height(),
  4188. n = this.pinchDistance - Math.sqrt(t * t + i * i)
  4189. 0.01 < Math.abs(n) && (this.emit(c.InteractionDirect), this.emit(c.Pinch, n), (this.pinchDistance -= n))
  4190. }
  4191. }),
  4192. (t.prototype.onPointerMove = function (t) {
  4193. this.usable() &&
  4194. 'touch' === t.pointerType &&
  4195. (this.pointers.forEach(function (e) {
  4196. t.pointerId === e.id && ((e.clientX = t.clientX), (e.clientY = t.clientY))
  4197. }),
  4198. (t.touches = this.pointers),
  4199. this.onTouchMove(t))
  4200. }),
  4201. (t.prototype.endRotation = function () {
  4202. this.pointerDragOn = !1
  4203. var e = r.averageVectors(this.rotationHistory)
  4204. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4205. }),
  4206. (t.prototype.onTouchEnd = function (e) {
  4207. this.usable() && (e.preventDefault(), e.stopPropagation(), this.endRotation())
  4208. }),
  4209. (t.prototype.onMouseUp = function (e) {
  4210. this.usable() && (e.preventDefault(), e.stopPropagation(), this.endRotation())
  4211. }),
  4212. (t.prototype.onPointerUp = function (i) {
  4213. this.usable() &&
  4214. 'touch' === i.pointerType &&
  4215. (this.pointers.forEach(
  4216. function (e, t) {
  4217. i.pointerId === e.id && this.pointers.splice(t, 1)
  4218. }.bind(this)
  4219. ),
  4220. (i.touches = this.pointers),
  4221. this.onTouchEnd(i))
  4222. }),
  4223. (t.prototype.update = function (e) {
  4224. for (this.lon, this.lat, this.updateRotation(), this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4225. this.rotationHistory.shift()
  4226. ;(this.lon += this.rotationDifference.x),
  4227. (this.lat += this.rotationDifference.y),
  4228. this.rotationDifference.set(0, 0),
  4229. (this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside),
  4230. (this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside),
  4231. (this.lon += this.rotationSpeed.x * e),
  4232. (this.lat += this.rotationSpeed.y * e)
  4233. let insideLookLimitDown = this.insideLookLimitDown != void 0 ? this.insideLookLimitDown : n.insideLookLimitDown
  4234. let insideLookLimitUp = this.insideLookLimitUp != void 0 ? this.insideLookLimitUp : n.insideLookLimitUp
  4235. insideLookLimitDown = insideLookLimitDown - n.insideFOV / 2 + this.camera.fov / 2
  4236. insideLookLimitUp = insideLookLimitUp + n.insideFOV / 2 - this.camera.fov / 2
  4237. this.lat = Math.max(insideLookLimitDown, Math.min(insideLookLimitUp, this.lat)) //通过预定义的俯仰角最大最小范围(insideLookLimitUp、insideLookLimitDown)来限制俯仰角。 注:这种数学计算很常见,因此API也很常见(clamp),等价于 this.lat = THREE.Math.clamp( this.lat, settings.insideLookLimitDown, settings.insideLookLimitUp );
  4238. //this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4239. ;(this.phi = s.Math.degToRad(90 - this.lat)),
  4240. (this.theta = s.Math.degToRad(this.lon)),
  4241. (this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta)),
  4242. (this.lookVector.y = Math.cos(this.phi)),
  4243. (this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta)),
  4244. this.target.copy(this.lookVector).add(this.camera.position),
  4245. this.camera.lookAt(this.target)
  4246. }),
  4247. (t.prototype.onMouseWheel = function (e) {
  4248. if (this.usable()) {
  4249. var t = e.wheelDelta || -e.detail
  4250. this.emit(c.InteractionDirect), this.emit(c.Scroll, t)
  4251. }
  4252. }),
  4253. (t.prototype.onKeyDown = function (e) {
  4254. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(), this.handleKeyDown(e.which)))
  4255. }),
  4256. (t.prototype.handleKeyDown = function (e) {
  4257. var t = function (e, t) {
  4258. this.rotationAcc[e] = t
  4259. }.bind(this)
  4260. this.emit(c.InteractionKey)
  4261. var i = !0
  4262. switch (e) {
  4263. case l.LEFTARROW:
  4264. case l.J:
  4265. t('x', -1)
  4266. break
  4267. case l.RIGHTARROW:
  4268. case l.L:
  4269. t('x', 1)
  4270. break
  4271. case l.I:
  4272. t('y', 1)
  4273. break
  4274. case l.K:
  4275. t('y', -1)
  4276. break
  4277. default:
  4278. i = !1
  4279. }
  4280. i && this.emit(c.Move, 'key')
  4281. }),
  4282. (t.prototype.onKeyUp = function (e) {
  4283. this.usable() && (e.preventDefault(), e.stopPropagation(), this.handleKeyUp(e.which))
  4284. }),
  4285. (t.prototype.handleKeyUp = function (e) {
  4286. switch (e) {
  4287. case l.LEFTARROW:
  4288. case l.J:
  4289. case l.RIGHTARROW:
  4290. case l.L:
  4291. this.rotationAcc.x = 0
  4292. break
  4293. case l.I:
  4294. case l.K:
  4295. this.rotationAcc.y = 0
  4296. }
  4297. }),
  4298. (t.prototype.startRotating = function (e, t) {
  4299. e && (this.rotationAcc.x = e), t && (this.rotationAcc.y = t)
  4300. }),
  4301. (t.prototype.stopRotating = function (e) {
  4302. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0), this.rotationAcc.set(0, 0)
  4303. }),
  4304. (t.prototype.reset = function () {
  4305. ;(this.pointerDragOn = !1), this.rotationAcc.set(0, 0), this.rotationSpeed.set(0, 0), (this.pointers = [])
  4306. }),
  4307. (t.prototype.toJSON = function () {
  4308. return {
  4309. camera_position: {
  4310. x: o.toPrecision(this.camera.position.x, 4),
  4311. y: o.toPrecision(this.camera.position.y, 4),
  4312. z: o.toPrecision(this.camera.position.z, 4)
  4313. },
  4314. camera_quaternion: {
  4315. x: o.toPrecision(this.camera.quaternion.x, 4),
  4316. y: o.toPrecision(this.camera.quaternion.y, 4),
  4317. z: o.toPrecision(this.camera.quaternion.z, 4),
  4318. w: o.toPrecision(this.camera.quaternion.w, 4)
  4319. }
  4320. }
  4321. }),
  4322. (t.prototype.setStateFromJSON = function (e) {
  4323. this.camera.position.copy(e.camera_position), this.camera.quaternion.copy(e.camera_quaternion)
  4324. }),
  4325. (d.exports = t)
  4326. }).call(this, '/js/controls/PanoramaControls.js')
  4327. },
  4328. {
  4329. '../enum/ControlEvents': 21,
  4330. '../enum/Keys': 30,
  4331. '../enum/MouseButton': 34,
  4332. '../enum/Vectors': 50,
  4333. '../settings': 166,
  4334. '../util/common': 185,
  4335. '../util/logger': 189,
  4336. '../util/math': 190,
  4337. events: 202,
  4338. three: 217
  4339. }
  4340. ],
  4341. 14: [
  4342. function (t, i, e) {
  4343. ;(function (e) {
  4344. 'use strict'
  4345. var c = t('three'),
  4346. h = t('../enum/Viewmode'),
  4347. u = new (t('../util/logger'))(e)
  4348. i.exports = {
  4349. serialize: function (e) {
  4350. return encodeURI(JSON.stringify(e))
  4351. },
  4352. deserialize: function (e) {
  4353. function t(e) {
  4354. return e.reduce(function (e, t) {
  4355. return e && 'number' == typeof t && !isNaN(t)
  4356. }, !0)
  4357. }
  4358. try {
  4359. var i = JSON.parse(decodeURI(e)),
  4360. n = {
  4361. mode: h.fromInt(i.camera_mode),
  4362. panoId: i.scan_id,
  4363. position: new c.Vector3().copy(i.camera_position),
  4364. quaternion: new c.Quaternion().copy(i.camera_quaternion),
  4365. zoom: i.ortho_zoom,
  4366. floorVisibility: i.floor_visibility
  4367. },
  4368. r = n.position
  4369. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0)
  4370. var o = n.quaternion
  4371. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1), n
  4372. } catch (i) {
  4373. u.debug('Not able to parse start location as JSON; falling back to old array style parsing')
  4374. try {
  4375. var a = e.split(','),
  4376. s = {
  4377. x: parseFloat(a[2]),
  4378. y: parseFloat(a[3]),
  4379. z: parseFloat(a[4])
  4380. },
  4381. l = {
  4382. x: parseFloat(a[5]),
  4383. y: parseFloat(a[6]),
  4384. z: parseFloat(a[7]),
  4385. w: parseFloat(a[8])
  4386. }
  4387. return (
  4388. t([s.x, s.y, s.z]) || ((s.x = 0), (s.y = 0), (s.z = 0)),
  4389. t([l.x, l.y, l.z, l.w]) || ((l.x = 0), (l.y = 0), (l.z = 0), (l.w = 1)),
  4390. {
  4391. mode: h.fromInt(a[0]),
  4392. panoId: a[1],
  4393. position: new c.Vector3().copy(s),
  4394. quaternion: new c.Quaternion().copy(l)
  4395. }
  4396. )
  4397. } catch (t) {
  4398. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4399. }
  4400. }
  4401. return null
  4402. }
  4403. }
  4404. }).call(this, '/js/controls/serializer.js')
  4405. },
  4406. {
  4407. '../enum/Viewmode': 51,
  4408. '../util/logger': 189,
  4409. three: 217
  4410. }
  4411. ],
  4412. 15: [
  4413. function (C, I, e) {
  4414. ;(function (e) {
  4415. 'use strict'
  4416. function t() {
  4417. ;(this.endlessLoop = r.warp.loop),
  4418. (this.clock = new i.Clock(!0)),
  4419. (this.model = null),
  4420. (this.player = null),
  4421. (this.currentItem = null),
  4422. (this.destinationItem = null),
  4423. (this.tourIsPlaying = !1),
  4424. (this.transitionStage = v.None),
  4425. (this.nextFunc = null),
  4426. (this.onTheBus = !1),
  4427. (this.tourInProgress = !1),
  4428. (this.reachSource = null),
  4429. (this.interrupted = !1),
  4430. (this.nItems = 0),
  4431. (this.walkingSectionPaused = !1)
  4432. }
  4433. var i = C('three'),
  4434. n = C('./util/logger'),
  4435. r = C('./settings'),
  4436. o = C('./util/transitions'),
  4437. a = C('events').EventEmitter,
  4438. s = C('./enum/Viewmode'),
  4439. l = C('./analytics'),
  4440. c = C('./enum/WarpStyle'),
  4441. h = ((o = C('./util/transitions')), C('./model/ModelManager'), C('./enum/ModelManagerEvents')),
  4442. u = C('./enum/DirectorEvents'),
  4443. d = C('./enum/PlayerEvents'),
  4444. p = (C('./enum/ControlEvents'), C('./enum/BlackoutStyle')),
  4445. f = C('./enum/PathDiscardMode'),
  4446. g = C('./enum/PathDisplayMode'),
  4447. m = (C('./player'), new n(e)),
  4448. v = Object.freeze({
  4449. None: 0,
  4450. Moving: 1,
  4451. Aiming: 2,
  4452. Interlude: 3
  4453. }),
  4454. y = Object.freeze({
  4455. Forward: 1,
  4456. NoChange: 0,
  4457. Backwards: -1
  4458. }),
  4459. A = o.getUniqueId()
  4460. ;((t.prototype = Object.create(a.prototype)).init = function (e, t) {
  4461. ;(this.player = e), (this.modelManager = t), this.updateModel(), this.resetAll(), this.bindEvents()
  4462. }),
  4463. (t.prototype.resetAll = function () {
  4464. if (
  4465. ((this.currentItem = null),
  4466. (this.destinationItem = null),
  4467. (this.tourIsPlaying = !1),
  4468. //this.bgmReplay(),
  4469. (this.transitionStage = v.None),
  4470. (this.nextFunc = null),
  4471. (this.onTheBus = !1),
  4472. (this.reachSource = null),
  4473. (this.interrupted = !1),
  4474. this.model)
  4475. ) {
  4476. var e = r.path.typ === c.WALK ? c.WALK : c.STD
  4477. this.defaultWarpStyle = this.model.data.hasOwnProperty('player_options') && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4478. } else (this.defaultWarpStyle = c.BLACK), m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions')
  4479. this.resetSpecialTransition()
  4480. }),
  4481. (t.prototype.updateModel = function () {
  4482. ;(this.model = this.modelManager.getActiveModel()), (this.nItems = this.model.heroLocations.length)
  4483. }),
  4484. (t.prototype.bindEvents = function () {
  4485. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4486. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4487. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4488. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4489. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4490. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4491. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4492. this.player.once(d.Move, function () {
  4493. o.cancelById(A)
  4494. })
  4495. }),
  4496. (t.prototype.checkAndHandleWalkingtourInterruption = function (e) {
  4497. //快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
  4498. return /* e === c.WALK && ( */ this.interrupt(p.NONE), this.pauseWalkingSection(), this.player.fastForwardActivePanoFlight(), !0 /* ) */
  4499. }),
  4500. (t.prototype.handlePlayerMove = function (e) {
  4501. this.transitionStage === v.Interlude && this.interrupt(p.NONE), this.emit('update.controls')
  4502. }),
  4503. (t.prototype.handlePlayerPanoChosen = function (e, t) {
  4504. this.intermediateState() || e.id === t.id || ((this.onTheBus = !1), this.emit('update.controls'))
  4505. }),
  4506. (t.prototype.handlePlayerModeChanged = function (e, t) {
  4507. this.intermediateState() || e === t || ((this.onTheBus = !1), this.emit('update.controls'))
  4508. }),
  4509. (t.prototype.handlePlayerInputStart = function (e) {
  4510. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4511. }),
  4512. (t.prototype.handlePlayerFlyingStarted = function () {
  4513. this.clearWalkingSectionPaused()
  4514. }),
  4515. (t.prototype.describe = function () {
  4516. return {
  4517. nItems: this.nItems,
  4518. currentItem: this.currentItem,
  4519. destinationItem: this.destinationItem,
  4520. tourIsPlaying: this.tourIsPlaying,
  4521. onTheBus: this.onTheBus,
  4522. endlessLoop: this.endlessLoop,
  4523. viewMode: this.player.mode,
  4524. inTransition: this._inTransition(),
  4525. transitionStage: this.transitionStage,
  4526. tourInProgress: this.tourInProgress
  4527. }
  4528. }),
  4529. (t.prototype._inTransition = function () {
  4530. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4531. }),
  4532. (t.prototype.bounceable = function () {
  4533. var e = this.clock.getDelta()
  4534. return this.isInterrupted() || (e < 0.9 && 0.01 < e) || (this.player.flying && !this.player.isWarping())
  4535. }),
  4536. (t.prototype.itemCompare = function (item1, item2, type) {
  4537. //add
  4538. if (type == 'equal') {
  4539. //==
  4540. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4541. } else if (type == 'less') {
  4542. //<
  4543. return (item1 && item2 && item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4544. }
  4545. })
  4546. ;(t.prototype.currentMoveDirection = function () {
  4547. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4548. return null === this.currentItem || void 0 === this.currentItem
  4549. ? y.Forward
  4550. : this.itemCompare(this.destinationItem, this.currentItem, 'equal')
  4551. ? y.NoChange
  4552. : this.itemCompare(this.currentItem, this.destinationItem, 'less')
  4553. ? y.Forward
  4554. : y.Backwards
  4555. }),
  4556. (t.prototype.clearPath = function () {
  4557. this._inTransition() || this.player.path.discardPathObject()
  4558. }),
  4559. (t.prototype.allFloors = function () {
  4560. this.model.toggleAllFloors()
  4561. }),
  4562. (t.prototype.actionComplete = function (e) {
  4563. if (
  4564. ((this.interrupted = !1),
  4565. (this.transitionStage = v.None),
  4566. this.resetSpecialTransition(),
  4567. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4568. this.tourIsPlaying || (this.player.disablePreRendering(), this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4569. this.emit('update.controls'),
  4570. this.nextFunc)
  4571. ) {
  4572. var t = this.nextFunc
  4573. ;(this.nextFunc = null), t()
  4574. }
  4575. }),
  4576. (t.prototype.awaitCompletion = function (e, t) {
  4577. ;(this.nextFunc = t), e()
  4578. }),
  4579. (t.prototype.updateSuccessFunction = function (e) {
  4580. this.nextFunc = e
  4581. }),
  4582. (t.prototype.interrupt = function (e, t) {
  4583. return (
  4584. !!this.wouldInterrupt() &&
  4585. (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4586. (this.tourIsPlaying = !1),
  4587. //this.bgmReplay(),
  4588. (this.interrupted = !0),
  4589. (this.nextFunc = null),
  4590. this.emit(u.ActionInterrupted),
  4591. null != e || (e = p.BEGINNING),
  4592. this.player.interruptAndFastForward(e, t),
  4593. !0)
  4594. )
  4595. }),
  4596. (t.prototype.wouldInterrupt = function () {
  4597. return this.transitionStage !== v.None
  4598. }),
  4599. (t.prototype.intermediateState = function () {
  4600. return this.transitionStage !== v.None
  4601. }),
  4602. (t.prototype.isInterrupted = function () {
  4603. return this.interrupted
  4604. }),
  4605. (t.prototype.pauseWalkingSection = function () {
  4606. this.walkingSectionPaused = !0
  4607. }),
  4608. (t.prototype.clearWalkingSectionPaused = function () {
  4609. this.walkingSectionPaused = !1
  4610. }),
  4611. (t.prototype.autoTour = function () {
  4612. var i = Date.now()
  4613. this.model.auxDataPromise.then(
  4614. function () {
  4615. i = Date.now() - i
  4616. var e = r.warp.auto,
  4617. t = this.model.data && this.model.data.player_options /* && this.model.data.player_options.highlight_reel */
  4618. 0 <= e &&
  4619. 1 < this.model.heroCount() &&
  4620. t &&
  4621. o.trigger({
  4622. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4623. done: function () {
  4624. this.playTour()
  4625. }.bind(this),
  4626. name: '_atr',
  4627. id: A
  4628. })
  4629. }.bind(this)
  4630. )
  4631. }),
  4632. (t.prototype.atDestinationPano = function () {
  4633. if (!this.player.currentPano || null === this.destinationItem) return !1
  4634. var e = this.player.currentPano.id
  4635. if (void 0 === e) return !1
  4636. var t = this.model.heroLocations
  4637. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4638. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4639. return destination && destination.panoId == e
  4640. }),
  4641. (t.prototype.redirectToItem = function (e, t) {
  4642. if (null != e)
  4643. if (this.wouldInterrupt())
  4644. if (this.player.mode !== s.TRANSITIONING) {
  4645. m.debug('Director.redirectToItem() -> Redirecting to ' + e + ' via ' + t)
  4646. var i = function () {
  4647. o.setTimeout(
  4648. function () {
  4649. this.setDestinationItem(e), this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4650. }.bind(this),
  4651. 0
  4652. )
  4653. }.bind(this)
  4654. this.interrupt(p.END, 0), this.updateSuccessFunction(i)
  4655. } else m.debug('Director.redirectToItem() -> Cannot redirect while transitioning.')
  4656. else m.warn('Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.')
  4657. else m.warn('Director.redirectToItem() -> Redirecting to null item.')
  4658. }),
  4659. (t.prototype.useSpecialTransition = function (e) {
  4660. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug('useSpecialTransition(): ' + e), (this.nextWarpStyle = c.BLACK)
  4661. }),
  4662. (t.prototype.resetSpecialTransition = function () {
  4663. this.nextWarpStyle = this.defaultWarpStyle
  4664. }),
  4665. (t.prototype.arrivedAtDestination = function (e) {
  4666. if (this.player.flying || this.player.isWarping()) m.warn('Cannot advance to interlude or aiming while player is flying or warping.')
  4667. else {
  4668. this.transitionStage = v.Aiming
  4669. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null
  4670. this.player.model.fadePanoMarkers(0),
  4671. this.awaitCompletion(
  4672. function () {
  4673. this.resetSpecialTransition(), e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4674. }.bind(this),
  4675. t
  4676. )
  4677. }
  4678. }),
  4679. (t.prototype.goToDestination = function (e, t, i, n) {
  4680. //音频
  4681. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo //只有外层有音乐
  4682. if (musicInfo && musicInfo.music) {
  4683. let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music
  4684. let audioObj = SoundManager.list.find(e => e.name == 'tour')
  4685. let audioSrc1 = common.getFileNameFromUrl(audioObj.src)
  4686. let audioSrc2 = common.getFileNameFromUrl(src)
  4687. if (audioSrc1 == audioSrc2) {
  4688. //应该是继续播放该folder
  4689. if (this.destinationItem[1] == 0) {
  4690. //从头开始播放 因为可能暂停后然后再点该缩略图播
  4691. SoundManager.play('tour', null, 0) // currentTime = 0;
  4692. } else if (audioObj.audio.paused && audioObj.audio.currentTime < audioObj.audio.duration) {
  4693. //未播完
  4694. SoundManager.play('tour') //继续播。 如果不是< 说明播完了,item[1]不为0应该是继续播放就不需要从头
  4695. }
  4696. } else {
  4697. //很可能是该folder的起始
  4698. SoundManager.play('tour', manage.dealURL(src))
  4699. }
  4700. }
  4701. if (((this.onTheBus = !0), this.emit('update.controls'), this.player.updateLastView(), n || !this.atDestinationPano())) {
  4702. if (this.player.flying || this.player.isWarping()) m.warn('Cannot go to new destination while player is flying or warping.')
  4703. else {
  4704. var a = this.model.getHeroDescriptorByIndex(this.destinationItem),
  4705. s = null,
  4706. l = null
  4707. if (a.isPano()) {
  4708. var o1 = e ? 'black' : this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
  4709. ;(l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o1, !0, i, this.actionComplete.bind(this))),
  4710. (s = this.arrivedAtDestination.bind(this, !0))
  4711. //add
  4712. if (o1 == 'black' && a.zoom && a.zoom != this.player.zoomLevel) {
  4713. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4714. }
  4715. } else {
  4716. ;(l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this))), (s = this.arrivedAtDestination.bind(this, !1))
  4717. }
  4718. ;(this.transitionStage = v.Moving),
  4719. this.model.fadePanoMarkers(0),
  4720. this.awaitCompletion(
  4721. function () {
  4722. l()
  4723. }.bind(this),
  4724. s
  4725. ),
  4726. this.emit('update.controls')
  4727. }
  4728. } else {
  4729. //add 原地旋转时, 写到_warpCameraAim里,因那有时间
  4730. /* var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4731. if(a.zoom && a.zoom != this.player.zoomLevel){
  4732. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4733. } */
  4734. this.arrivedAtDestination(!0)
  4735. }
  4736. }),
  4737. (t.prototype.tourInterlude = function () {
  4738. if (
  4739. (l.trackAlways('reach_highlight', {
  4740. reach_source: this.reachSource
  4741. }),
  4742. this.model.fadePanoMarkers(0),
  4743. this.emit('update.controls'),
  4744. this.tourIsPlaying)
  4745. )
  4746. return this.atEndOfTour() && !this.endlessLoop
  4747. ? ((this.tourInProgress = !1), this.stopTour(), this.emit(u.TourEnd), void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity)))
  4748. : void this.awaitCompletion(
  4749. function () {
  4750. ;(this.transitionStage = v.Interlude), this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4751. }.bind(this),
  4752. this.goNext.bind(this)
  4753. )
  4754. }),
  4755. (t.prototype.playTour = function () {
  4756. if (!this.bounceable())
  4757. return this.tourIsPlaying
  4758. ? void m.info('tour is already playing')
  4759. : void (
  4760. this.wouldInterrupt() ||
  4761. (this.player.emit('tour_auto', this.defaultWarpStyle),
  4762. (this.tourInProgress = !0),
  4763. (this.reachSource = 'play'),
  4764. (this.tourIsPlaying = !0),
  4765. (this.wasZoomEnabled = this.player.zoomEnabled),
  4766. (this.player.zoomEnabled = !1),
  4767. this.resetSpecialTransition(),
  4768. this.emit('update.controls'),
  4769. this.emit(u.TourStart),
  4770. this.player.enablePreRendering(),
  4771. this.walkingSectionPaused
  4772. ? (this.clearWalkingSectionPaused(), this.goToDestination())
  4773. : /* this.goNext() */ this.atEndOfTour()
  4774. ? this.goNext()
  4775. : (this.tourAdvance(0), this.goToDestination()))
  4776. ) //xzw: 不要直接跳到下一个点开始,从当前点开始,否则当一段区域内只有一个导览时播放会立刻跳到下一个缩略图进行。
  4777. }),
  4778. (t.prototype.stopTour = function (isAutoStop) {
  4779. //停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4780. this.isInterrupted() ||
  4781. (this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle)) ||
  4782. (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4783. (this.tourIsPlaying = !1),
  4784. //(!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  4785. this.interrupt(),
  4786. this.clearWalkingSectionPaused(),
  4787. this.resetSpecialTransition(),
  4788. this.emit('update.controls'))
  4789. }),
  4790. (t.prototype.endTourProgress = function () {
  4791. ;(this.tourInProgress = !1), this.emit('update.controls'), this.emit(u.TourEnd)
  4792. }),
  4793. (t.prototype.goToHighlight = function (e) {
  4794. if (this.wouldInterrupt()) this.itemCompare(this.destinationItem, e, 'equal') ? this.interrupt() : this.redirectToItem(e, 'goToHighlight')
  4795. else {
  4796. if ((m.debug('<tour.goto ' + e + '>'), this.isInterrupted())) return
  4797. this.clearWalkingSectionPaused(),
  4798. this.setDestinationItem(e),
  4799. this.useSpecialTransition('Hilight'),
  4800. this.goToDestination(true), //add true
  4801. l.trackAlways('reach_highlight', {
  4802. reach_source: 'thumb'
  4803. })
  4804. }
  4805. }),
  4806. (t.prototype.prevHighlight = function () {
  4807. this.bounceable() ||
  4808. (this.player.emit('tour_manual', 'prev'), this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(), (this.reachSource = 'prev'), this.goPrev()))
  4809. }),
  4810. (t.prototype.nextHighlight = function () {
  4811. this.bounceable() ||
  4812. (this.player.emit('tour_manual', 'next'), this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(), (this.reachSource = 'next'), this.goNext()))
  4813. }),
  4814. (t.prototype.changeMode = function (e) {
  4815. var t = $.Deferred(),
  4816. i = t.resolve.bind(t),
  4817. n = t.reject.bind(t)
  4818. if (
  4819. (this.emit(u.StartModeChange),
  4820. !function () {
  4821. return this.clearWalkingSectionPaused(), !!this.wouldInterrupt() && (this.interrupt(), !0)
  4822. }.bind(this)())
  4823. ) {
  4824. switch (e) {
  4825. case s.PANORAMA:
  4826. this.player.mode === s.PANORAMA
  4827. ? this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(i).fail(n)
  4828. : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n)
  4829. break
  4830. case s.DOLLHOUSE:
  4831. case s.FLOORPLAN:
  4832. this.player
  4833. .flyToNewMode({
  4834. mode: e
  4835. })
  4836. .done(i)
  4837. .fail(n)
  4838. break
  4839. case s.OUTDOOR:
  4840. this.player.model.has360Views &&
  4841. (this.player.mode !== s.PANORAMA || (this.player.mode === s.PANORAMA && this.player.currentPano.isAligned())) &&
  4842. this.player.goToLastView(!1).done(i).fail(n)
  4843. }
  4844. return t.promise()
  4845. }
  4846. }),
  4847. (t.prototype.atEndOfTour = function (item) {
  4848. //return this.currentItem >= this.nItems - 1
  4849. var end = this.currentItem && this.currentItem[0] >= this.nItems - 1
  4850. if (end) {
  4851. var heroLocations = this.model.heroLocations[this.nItems - 1].heroLocations
  4852. if (heroLocations) {
  4853. end = this.currentItem[1] >= heroLocations.length - 1
  4854. }
  4855. }
  4856. return end
  4857. }),
  4858. (t.prototype.firstDestination = function () {
  4859. //return 0 < this.nItems ? 0 : null
  4860. return 0 < this.nItems ? [0, 0] : null
  4861. }),
  4862. (t.prototype.finalDestination = function () {
  4863. //return 0 < this.nItems ? this.nItems - 1 : null
  4864. return 0 < this.nItems ? [this.nItems - 1, 0] : null
  4865. }),
  4866. (t.prototype.goPrev = function () {
  4867. this.tourAdvance(-1)
  4868. }),
  4869. (t.prototype.goNext = function () {
  4870. this.tourAdvance(1)
  4871. }),
  4872. (t.prototype.setDestinationItem = function (e) {
  4873. ;(this.destinationItem = e), this.emit('update.controls')
  4874. }),
  4875. (t.prototype.setCurrentItem = function (e) {
  4876. ;(this.currentItem = e), this.emit('update.controls')
  4877. }),
  4878. (t.prototype.nextItem = function (currentItem) {
  4879. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4880. if (currentItem == void 0) return this.firstDestination()
  4881. var currentLocation = this.model.heroLocations[currentItem[0]]
  4882. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4883. var item
  4884. if (this.currentItem[1] >= currentChildNum - 1) {
  4885. //子目录中最后一个
  4886. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  4887. } else {
  4888. item = [currentItem[0], currentItem[1] + 1]
  4889. }
  4890. if (item[0] >= this.nItems) {
  4891. item = this.firstDestination()
  4892. }
  4893. return item
  4894. //暂时不理会endlessLoop,默认为false
  4895. }),
  4896. (t.prototype.prevItem = function (currentItem) {
  4897. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4898. if (currentItem == void 0) return this.firstDestination() //finalDestination?
  4899. var item
  4900. var lastLocation = this.model.heroLocations[currentItem[0] - 1]
  4901. if (!lastLocation) return this.finalDestination() //[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  4902. else {
  4903. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  4904. if (this.currentItem[1] == 0) {
  4905. //子目录中第一个
  4906. return [currentItem[0] - 1, lastChildNum - 1]
  4907. } else {
  4908. return [currentItem[0], currentItem[1] - 1]
  4909. }
  4910. }
  4911. }),
  4912. (t.prototype.tourAdvance = function (e) {
  4913. //e是1或-1或0
  4914. m.debug('tourAdvance(' + e + ')')
  4915. if (null === this.currentItem || void 0 === this.currentItem) {
  4916. this.setDestinationItem(this.firstDestination())
  4917. } else {
  4918. var item = this.currentItem
  4919. if (e == 1) {
  4920. item = this.nextItem(this.currentItem)
  4921. } else if (e == -1) {
  4922. item = this.prevItem(this.currentItem)
  4923. }
  4924. this.setDestinationItem(item)
  4925. }
  4926. if (this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0) {
  4927. this.useSpecialTransition('reverse-looping to end')
  4928. } else if (this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')) {
  4929. this.useSpecialTransition('looping back to start')
  4930. }
  4931. /* if(this.destinationItem[0] < 0 ){
  4932. this.setDestinationItem(this.finalDestination())
  4933. this.useSpecialTransition("reverse-looping to end")
  4934. }else{
  4935. this.destinationItem[0] >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4936. this.useSpecialTransition("looping back to start"))
  4937. } */
  4938. /* var momentTour = this.getMomentTour(this.destinationItem);
  4939. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  4940. var i = this.player.zoomLevel;
  4941. this.player.zoomEnabled = !0;
  4942. var t = function(e, t) {
  4943. this.player.zoomTo((1 - e) * i, !0)
  4944. }
  4945. .bind(this);
  4946. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  4947. } */
  4948. this.goToDestination()
  4949. }),
  4950. (t.prototype.getMomentTour = function (destinationItem) {
  4951. //add
  4952. var wholeMomentTour = window.DATA.momentTour || 'walk' //最外层
  4953. if (!destinationItem) return wholeMomentTour
  4954. else {
  4955. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem) //最内层。 如果有使用最内层
  4956. if (currentLocation.momentTour) return currentLocation.momentTour
  4957. var currentLocation_ = this.model.heroLocations[destinationItem[0]]
  4958. return currentLocation_.momentTour || wholeMomentTour //若中间层或最内层有就使用,否则使用最外层
  4959. }
  4960. }),
  4961. (I.exports = t)
  4962. }).call(this, '/js/director.js')
  4963. },
  4964. {
  4965. './analytics': 4,
  4966. './enum/BlackoutStyle': 18,
  4967. './enum/ControlEvents': 21,
  4968. './enum/DirectorEvents': 23,
  4969. './enum/ModelManagerEvents': 33,
  4970. './enum/PathDiscardMode': 38,
  4971. './enum/PathDisplayMode': 39,
  4972. './enum/PlayerEvents': 40,
  4973. './enum/Viewmode': 51,
  4974. './enum/WarpStyle': 52,
  4975. './model/ModelManager': 140,
  4976. './player': 155,
  4977. './settings': 166,
  4978. './util/logger': 189,
  4979. './util/transitions': 195,
  4980. events: 202,
  4981. three: 217
  4982. }
  4983. ],
  4984. 16: [
  4985. function (e, t, i) {
  4986. 'use strict'
  4987. var n = e('three'),
  4988. r = e('./enum/Viewmode'),
  4989. o = (e('./settings'), e('./util/transitions')),
  4990. a = e('./enum/PlayerEvents'),
  4991. s = new n.ShaderPass(n.HorizontalBlurShader),
  4992. l = new n.ShaderPass(n.VerticalBlurShader)
  4993. l.renderToScreen = !0
  4994. var c = $('#player').width() / $('#player').height()
  4995. isNaN(c) && (c = 1)
  4996. //initTransitionPass(n)
  4997. var h = {
  4998. currentBlur: 0,
  4999. aspect: c,
  5000. blurStrength: 1,
  5001. hblurPass: s,
  5002. vblurPass: l,
  5003. fastTranMaskPass: new n.TransitionPass(),
  5004. bindEvents: function (e) {
  5005. e.on(a.ModeChanged, function (e, t) {
  5006. e === r.PANORAMA && (o.cancel(h.blur), o.cancel(h.addBlur), o.start(h.removeBlur, 500, null, 0, null, 'deblur'))
  5007. })
  5008. },
  5009. blur: function (e) {
  5010. var t = (h.currentBlur = e) * h.blurStrength
  5011. ;(l.uniforms.v.value = (t / 512) * h.aspect), (s.uniforms.h.value = t / 512)
  5012. },
  5013. addBlur: function (e) {
  5014. ;(e = Math.max(e, h.currentBlur)), h.blur(e)
  5015. },
  5016. removeBlur: function (e) {
  5017. ;(e = Math.min(1 - e, h.currentBlur)), h.blur(e)
  5018. }
  5019. }
  5020. h.blur(0), (t.exports = h)
  5021. },
  5022. {
  5023. './enum/PlayerEvents': 40,
  5024. './enum/Viewmode': 51,
  5025. './settings': 166,
  5026. './util/transitions': 195,
  5027. three: 217
  5028. }
  5029. ],
  5030. 17: [
  5031. function (e, t, i) {
  5032. 'use strict'
  5033. t.exports = {
  5034. UNKNOWN: 0,
  5035. ALIGNED: 1,
  5036. UNALIGNED: 2,
  5037. PLACED: 3
  5038. }
  5039. },
  5040. {}
  5041. ],
  5042. 18: [
  5043. function (e, t, i) {
  5044. 'use strict'
  5045. t.exports = {
  5046. NONE: 0,
  5047. MIDDLE: 1,
  5048. END: 2,
  5049. BEGINNING: 3,
  5050. FADEIN: 4
  5051. }
  5052. },
  5053. {}
  5054. ],
  5055. 19: [
  5056. function (e, t, i) {
  5057. 'use strict'
  5058. var r = e('three')
  5059. t.exports = {
  5060. newBlue: new r.Color(4967932),
  5061. altBlue: new r.Color(47355),
  5062. tagDefault: new r.Color(223357),
  5063. classicBlue: new r.Color(53759),
  5064. mpYellow: new r.Color(16502016),
  5065. mpOrange: new r.Color(16428055),
  5066. mpBlue: new r.Color(12096),
  5067. mpLtGrey: new r.Color(13751252),
  5068. mpDkGrey: new r.Color(10000019),
  5069. mpRed: new r.Color(12525854),
  5070. mpOrangeDesat: new r.Color(16764529),
  5071. mpBlueDesat: new r.Color(4034734),
  5072. mpRedDesat: new r.Color(14705505),
  5073. white: new r.Color(16777215),
  5074. black: new r.Color(0),
  5075. _desat: function (e, t) {
  5076. var i = t || 0.3,
  5077. n = new r.Color().copy(e).getHSL()
  5078. return new r.Color().setHSL(n.h, n.s * (1 - i), n.l)
  5079. },
  5080. _darken: function (e, t) {
  5081. var i = t || 0.2,
  5082. n = e.getHSL()
  5083. return new r.Color().setHSL(n.h, n.s, n.l * (1 - i))
  5084. }
  5085. }
  5086. },
  5087. {
  5088. three: 217
  5089. }
  5090. ],
  5091. 20: [
  5092. function (e, t, i) {
  5093. 'use strict'
  5094. t.exports = {
  5095. NONE: -1,
  5096. ROTATE: 0,
  5097. DOLLY: 1,
  5098. PAN: 2,
  5099. ROTATE_DOLLY: 3,
  5100. PAN_DOLLY: 4
  5101. }
  5102. },
  5103. {}
  5104. ],
  5105. 21: [
  5106. function (e, t, i) {
  5107. 'use strict'
  5108. t.exports = {
  5109. Move: 'move',
  5110. InteractionDirect: 'interaction.direct',
  5111. InteractionKey: 'interaction.key',
  5112. InteractionGui: 'interaction.gui',
  5113. FlyInDirection: 'fly.direction',
  5114. InputStart: 'input.start',
  5115. Pinch: 'input.pinch',
  5116. Scroll: 'input.scroll',
  5117. AutoPanInterrupt: 'autopan.interrupt',
  5118. AutoPanComplete: 'autopan.complete',
  5119. AutoPanClamped: 'autopan.clamped',
  5120. LongTap: 'longtap'
  5121. }
  5122. },
  5123. {}
  5124. ],
  5125. 22: [
  5126. function (e, t, i) {
  5127. 'use strict'
  5128. t.exports = Object.freeze({
  5129. FORWARD: 'FORWARD',
  5130. LEFT: 'LEFT',
  5131. RIGHT: 'RIGHT',
  5132. BACK: 'BACK',
  5133. UP: 'UP',
  5134. DOWN: 'DOWN'
  5135. })
  5136. },
  5137. {}
  5138. ],
  5139. 23: [
  5140. function (e, t, i) {
  5141. 'use strict'
  5142. t.exports = {
  5143. ActionInterrupted: 'action.interrupted',
  5144. TourStart: 'tour.start',
  5145. TourEnd: 'tour.end',
  5146. StartModeChange: 'mode.startChange'
  5147. }
  5148. },
  5149. {}
  5150. ],
  5151. 24: [
  5152. function (e, t, i) {
  5153. 'use strict'
  5154. t.exports = Object.freeze({
  5155. None: 0,
  5156. Queued: 1,
  5157. ForceQueued: 2,
  5158. Downloading: 3,
  5159. Downloaded: 4,
  5160. DownloadFailed: 5
  5161. })
  5162. },
  5163. {}
  5164. ],
  5165. 25: [
  5166. function (e, t, i) {
  5167. 'use strict'
  5168. t.exports = {
  5169. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5170. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5171. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5172. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5173. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5174. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5175. }
  5176. },
  5177. {}
  5178. ],
  5179. 26: [
  5180. function (e, t, i) {
  5181. 'use strict'
  5182. t.exports = {
  5183. Texture2D: 0,
  5184. TextureCube: 1
  5185. }
  5186. },
  5187. {}
  5188. ],
  5189. 27: [
  5190. function (e, t, i) {
  5191. 'use strict'
  5192. t.exports = {
  5193. SMALL: 'small',
  5194. LARGE: 'large'
  5195. }
  5196. },
  5197. {}
  5198. ],
  5199. 28: [
  5200. function (e, t, i) {
  5201. 'use strict'
  5202. var n = e('./Viewmode'),
  5203. r = {
  5204. LANDING: {},
  5205. NAVIGATION: 'navigation',
  5206. MORE_HELP: 'moreHelp',
  5207. TOUR_INTERACTION: {}
  5208. }
  5209. ;(r.LANDING[n.PANORAMA] = 'panorama.landing'),
  5210. (r.LANDING[n.OUTDOOR] = 'outdoor.landing'),
  5211. (r.LANDING[n.DOLLHOUSE] = 'dollhouse.landing'),
  5212. (r.LANDING[n.FLOORPLAN] = 'floorplan.landing'),
  5213. (r.TOUR_INTERACTION.standard = 'standard.tour'),
  5214. (r.TOUR_INTERACTION[n.OUTDOOR] = 'outdoor.tour'),
  5215. (r.TOUR_INTERACTION[n.FLOORPLAN] = 'floorplan.tour'),
  5216. (t.exports = r)
  5217. },
  5218. {
  5219. './Viewmode': 51
  5220. }
  5221. ],
  5222. 29: [
  5223. function (e, t, i) {
  5224. 'use strict'
  5225. var n = {
  5226. UP: 1,
  5227. DOWN: -1,
  5228. LEFT: 'L',
  5229. RIGHT: 'R',
  5230. FORWARD: 'F',
  5231. BACK: 'B',
  5232. reverse: {},
  5233. opposite: function (e) {
  5234. return this.reverse[e.toString()]
  5235. }
  5236. }
  5237. ;(n.reverse[n.UP] = n.DOWN),
  5238. (n.reverse[n.DOWN] = n.UP),
  5239. (n.reverse[n.LEFT] = n.RIGHT),
  5240. (n.reverse[n.RIGHT] = n.LEFT),
  5241. (n.reverse[n.FORWARD] = n.BACK),
  5242. (n.reverse[n.BACK] = n.FORWARD),
  5243. (t.exports = n)
  5244. },
  5245. {}
  5246. ],
  5247. 30: [
  5248. function (e, t, i) {
  5249. 'use strict'
  5250. var n = {
  5251. ZERO: 48,
  5252. ONE: 49,
  5253. TWO: 50,
  5254. THREE: 51,
  5255. FOUR: 52,
  5256. FIVE: 53,
  5257. SIX: 54,
  5258. SEVEN: 55,
  5259. EIGHT: 56,
  5260. NINE: 57,
  5261. LEFTARROW: 37,
  5262. UPARROW: 38,
  5263. RIGHTARROW: 39,
  5264. DOWNARROW: 40,
  5265. A: 65,
  5266. B: 66,
  5267. C: 67,
  5268. D: 68,
  5269. E: 69,
  5270. F: 70,
  5271. G: 71,
  5272. H: 72,
  5273. I: 73,
  5274. J: 74,
  5275. K: 75,
  5276. L: 76,
  5277. M: 77,
  5278. N: 78,
  5279. O: 79,
  5280. P: 80,
  5281. Q: 81,
  5282. R: 82,
  5283. S: 83,
  5284. T: 84,
  5285. U: 85,
  5286. V: 86,
  5287. W: 87,
  5288. X: 88,
  5289. Y: 89,
  5290. Z: 90,
  5291. SPACE: 32,
  5292. RETURN: 13,
  5293. SEMICOLON: 186,
  5294. PLUSEQUALS: 187,
  5295. DASHUNDERSCORE: 189,
  5296. OPENBRACKET: 219
  5297. }
  5298. e('../util/browser').detectFirefox() && ((n.SEMICOLON = 59), (n.PLUSEQUALS = 61), (n.DASHUNDERSCORE = 173)), (t.exports = n)
  5299. },
  5300. {
  5301. '../util/browser': 182
  5302. }
  5303. ],
  5304. 31: [
  5305. function (e, t, i) {
  5306. 'use strict'
  5307. t.exports = {
  5308. EN_US: 'en-US',
  5309. ES_MX: 'es-MX',
  5310. FR_FR: 'fr-FR',
  5311. DE_DE: 'de-DE',
  5312. RU_RU: 'ru-RU',
  5313. CN_CN: 'cn-CN',
  5314. JP_JP: 'jp-JP'
  5315. }
  5316. },
  5317. {}
  5318. ],
  5319. 32: [
  5320. function (e, t, i) {
  5321. 'use strict'
  5322. t.exports = {
  5323. TagActivated: 'tag.activated',
  5324. TagDismissed: 'tag.dismissed',
  5325. TagNavigation: 'tag.navigation'
  5326. }
  5327. },
  5328. {}
  5329. ],
  5330. 33: [
  5331. function (e, t, i) {
  5332. 'use strict'
  5333. t.exports = {
  5334. ModelAdded: 'model-added',
  5335. ActiveModelChanged: 'active-model-changed'
  5336. }
  5337. },
  5338. {}
  5339. ],
  5340. 34: [
  5341. function (e, t, i) {
  5342. 'use strict'
  5343. t.exports = {
  5344. LEFT: 0,
  5345. MIDDLE: 1,
  5346. RIGHT: 2
  5347. }
  5348. },
  5349. {}
  5350. ],
  5351. 35: [
  5352. function (e, t, i) {
  5353. 'use strict'
  5354. t.exports = {
  5355. PanoRenderComplete: 'panorama.render.complete',
  5356. TileRenderFailure: 'panorama.tile.render.failed',
  5357. TileRenderSuccess: 'panorama.tile.render.success',
  5358. TileUploadAttempted: 'panorama.tile.upload.attempted',
  5359. UploadAttemptedForAllTiles: 'panorama.upload.attempted.all.tiles',
  5360. ZoomLevelRenderStarted: 'panorama.zoom.render.started'
  5361. }
  5362. },
  5363. {}
  5364. ],
  5365. 36: [
  5366. function (e, t, i) {
  5367. 'use strict'
  5368. t.exports = {
  5369. BASE: 1,
  5370. STANDARD: 2,
  5371. HIGH: 3,
  5372. ULTRAHIGH: 4
  5373. }
  5374. },
  5375. {}
  5376. ],
  5377. 37: [
  5378. function (e, t, i) {
  5379. 'use strict'
  5380. t.exports = {
  5381. LoadComplete: 'panorama.load.complete',
  5382. LoadFailed: 'panorama.load.failed',
  5383. TileLoaded: 'panorama.tile.loaded'
  5384. }
  5385. },
  5386. {}
  5387. ],
  5388. 38: [
  5389. function (e, t, i) {
  5390. 'use strict'
  5391. t.exports = Object.freeze({
  5392. Standard: 0,
  5393. Slow: 1,
  5394. Retain: 2
  5395. })
  5396. },
  5397. {}
  5398. ],
  5399. 39: [
  5400. function (e, t, i) {
  5401. 'use strict'
  5402. t.exports = Object.freeze({
  5403. Show: 0,
  5404. Hide: 1,
  5405. Retain: 2
  5406. })
  5407. },
  5408. {}
  5409. ],
  5410. 40: [
  5411. function (e, t, i) {
  5412. 'use strict'
  5413. t.exports = {
  5414. Move: 'move',
  5415. MoveComplete: 'move.complete',
  5416. ModeChanged: 'mode.changed',
  5417. ModeChanging: 'mode.changing',
  5418. PanoChosen: 'pano.chosen',
  5419. ClosestPanoChanging: 'closest.pano.changing',
  5420. WarpStarted: 'warp.started',
  5421. WarpInterrupted: 'warp.interrupted',
  5422. WarpEnded: 'warp.ended',
  5423. FlyinFinished: 'flyin.finished',
  5424. FlyingStarted: 'flying.started',
  5425. FlyingInterrupted: 'flying.interrupted',
  5426. FlyingEnded: 'flying.ended',
  5427. Ready: 'ready',
  5428. StartInside: 'start.inside',
  5429. StartOutside: 'start.outside',
  5430. ViewChanged: 'view.changed',
  5431. WarpInterruptedWithFlyTo: 'warp.interrupted.flyto',
  5432. InputStart: 'input.start'
  5433. }
  5434. },
  5435. {}
  5436. ],
  5437. 41: [
  5438. function (e, t, i) {
  5439. 'use strict'
  5440. t.exports = Object.freeze({
  5441. DEFAULT: 0,
  5442. PANOMARKERS: 1,
  5443. RETICULE: 2,
  5444. TAG: 3
  5445. })
  5446. },
  5447. {}
  5448. ],
  5449. 42: [
  5450. function (e, t, i) {
  5451. 'use strict'
  5452. t.exports = {
  5453. visibleFloor: 1,
  5454. ghostFloor: 3,
  5455. boundingSkybox: 1,
  5456. panoMarker: 2,
  5457. reticule: 3,
  5458. tagStem: 4,
  5459. tagDisc: 5,
  5460. ribbon: 100
  5461. }
  5462. },
  5463. {}
  5464. ],
  5465. 43: [
  5466. function (e, t, i) {
  5467. 'use strict'
  5468. t.exports = {
  5469. ContextCreated: 'scene-renderer-context-created',
  5470. AfterRender: 'after-render',
  5471. MemoryUsageUpdated: 'scene-renderer-memory-usage-updated'
  5472. }
  5473. },
  5474. {}
  5475. ],
  5476. 44: [
  5477. function (e, t, i) {
  5478. 'use strict'
  5479. t.exports = {
  5480. IDLE: 'idle',
  5481. BROWSE: 'browse',
  5482. EXAMINE: 'examine'
  5483. }
  5484. },
  5485. {}
  5486. ],
  5487. 45: [
  5488. function (e, t, i) {
  5489. 'use strict'
  5490. t.exports = {
  5491. TileDownloadSuccess: 'tiledownloader.download.success',
  5492. TileDownloadFailure: 'tiledownloader.download.failure',
  5493. PanoDownloadComplete: 'tiledownloader.pano.download.complete'
  5494. }
  5495. },
  5496. {}
  5497. ],
  5498. 46: [
  5499. function (e, t, i) {
  5500. 'use strict'
  5501. t.exports = {
  5502. CardboardAndroid: 'googlevr',
  5503. GearVR: 'gearvr',
  5504. CardboardIOS: 'googlevrios',
  5505. Cardboard: 'googlevr'
  5506. }
  5507. },
  5508. {}
  5509. ],
  5510. 47: [
  5511. function (e, t, i) {
  5512. 'use strict'
  5513. t.exports = {
  5514. NONE: 0,
  5515. CONTEXTUAL: 1,
  5516. ANDROID: 2
  5517. }
  5518. },
  5519. {}
  5520. ],
  5521. 48: [
  5522. function (e, t, i) {
  5523. 'use strict'
  5524. var n = {
  5525. Title: 0,
  5526. Cardboard: 1
  5527. },
  5528. r = {
  5529. Title: 0,
  5530. Cardboard: 1,
  5531. Gear: 2
  5532. }
  5533. ;[n, r].forEach(function (e) {
  5534. e.pageCount = Object.keys(e).length
  5535. }),
  5536. (t.exports.ios = n),
  5537. (t.exports.standard = r)
  5538. },
  5539. {}
  5540. ],
  5541. 49: [
  5542. function (e, t, i) {
  5543. 'use strict'
  5544. t.exports = {
  5545. Android: 'android',
  5546. IOS: 'ios',
  5547. Desktop: 'desktop',
  5548. UnsupportedAndroid: 'android-unsupported'
  5549. }
  5550. },
  5551. {}
  5552. ],
  5553. 50: [
  5554. function (e, t, i) {
  5555. 'use strict'
  5556. var n = e('three')
  5557. t.exports = {
  5558. UP: new n.Vector3(0, 1, 0),
  5559. DOWN: new n.Vector3(0, -1, 0),
  5560. LEFT: new n.Vector3(-1, 0, 0),
  5561. RIGHT: new n.Vector3(1, 0, 0),
  5562. FORWARD: new n.Vector3(0, 0, -1),
  5563. BACK: new n.Vector3(0, 0, 1)
  5564. }
  5565. },
  5566. {
  5567. three: 217
  5568. }
  5569. ],
  5570. 51: [
  5571. function (e, t, i) {
  5572. 'use strict'
  5573. var n = e('../exception/ViewmodeConvertException'),
  5574. r = e('./coreViewmodes'),
  5575. o = {
  5576. MESH: 'mesh',
  5577. OUTDOOR: 'outdoor',
  5578. TRANSITIONING: 'transitioning',
  5579. toInt: function (e) {
  5580. switch (e) {
  5581. case this.PANORAMA:
  5582. return 1
  5583. case this.DOLLHOUSE:
  5584. return 2
  5585. case this.FLOORPLAN:
  5586. return 3
  5587. case this.OUTDOOR:
  5588. return 4
  5589. case this.TRANSITIONING:
  5590. return -1
  5591. }
  5592. throw new n('No known conversion for Viewmode to int for mode: ' + e)
  5593. },
  5594. fromInt: function (e) {
  5595. switch (e) {
  5596. case '1':
  5597. case 1:
  5598. return this.PANORAMA
  5599. case '2':
  5600. case 2:
  5601. return this.DOLLHOUSE
  5602. case '3':
  5603. case 3:
  5604. return this.FLOORPLAN
  5605. case '4':
  5606. case 4:
  5607. return this.OUTDOOR
  5608. }
  5609. throw new n('No known conversion for int to viewmode for int: ' + e)
  5610. },
  5611. convertWorkshopModeInt: function (e) {
  5612. switch (e) {
  5613. case '0':
  5614. case 0:
  5615. case void 0:
  5616. return this.PANORAMA
  5617. case '1':
  5618. case 1:
  5619. return this.FLOORPLAN
  5620. case '2':
  5621. case 2:
  5622. return this.DOLLHOUSE
  5623. case '3':
  5624. case 3:
  5625. return this.MESH
  5626. }
  5627. throw new n('No known conversion for Workshop int to viewmode for int: ' + e)
  5628. }
  5629. }
  5630. e('../util/common').extendObject(o, r), (t.exports = o)
  5631. },
  5632. {
  5633. '../exception/ViewmodeConvertException': 58,
  5634. '../util/common': 185,
  5635. './coreViewmodes': 54
  5636. }
  5637. ],
  5638. 52: [
  5639. function (e, t, i) {
  5640. 'use strict'
  5641. t.exports = {
  5642. BLACK: 'black',
  5643. STD: 'std',
  5644. WALK: 'walk'
  5645. }
  5646. },
  5647. {}
  5648. ],
  5649. 53: [
  5650. function (e, t, i) {
  5651. 'use strict'
  5652. t.exports = {
  5653. ZoomIn: 'zoom.in',
  5654. ZoomOut: 'zoom.out',
  5655. ZoomMax: 'zoom.max',
  5656. ZoomMin: 'zoom.min'
  5657. }
  5658. },
  5659. {}
  5660. ],
  5661. 54: [
  5662. function (e, t, i) {
  5663. 'use strict'
  5664. t.exports = {
  5665. PANORAMA: 'panorama',
  5666. DOLLHOUSE: 'dollhouse',
  5667. FLOORPLAN: 'floorplan'
  5668. }
  5669. },
  5670. {}
  5671. ],
  5672. 55: [
  5673. function (e, t, i) {
  5674. 'use strict'
  5675. t.exports = function (e) {
  5676. this.message = e
  5677. }
  5678. },
  5679. {}
  5680. ],
  5681. 56: [
  5682. function (e, t, i) {
  5683. 'use strict'
  5684. function n(e) {
  5685. r.call(this, e)
  5686. }
  5687. var r = e('./BasicException')
  5688. ;(n.prototype = Object.create(r.prototype)), (t.exports = n)
  5689. },
  5690. {
  5691. './BasicException': 55
  5692. }
  5693. ],
  5694. 57: [
  5695. function (e, t, i) {
  5696. 'use strict'
  5697. function n(e) {
  5698. r.call(this, e)
  5699. }
  5700. var r = e('./BasicException')
  5701. ;(n.prototype = Object.create(r.prototype)), (t.exports = n)
  5702. },
  5703. {
  5704. './BasicException': 55
  5705. }
  5706. ],
  5707. 58: [
  5708. function (e, t, i) {
  5709. 'use strict'
  5710. function n(e) {
  5711. r.call(this, e)
  5712. }
  5713. var r = e('./BasicException')
  5714. ;(n.prototype = Object.create(r.prototype)), (t.exports = n)
  5715. },
  5716. {
  5717. './BasicException': 55
  5718. }
  5719. ],
  5720. 59: [
  5721. function (a, s, e) {
  5722. ;(function (e) {
  5723. 'use strict'
  5724. var i = a('./util/ajax'),
  5725. n = a('./util/showcase'),
  5726. t = a('./util/logger'),
  5727. r = new t(e),
  5728. o = {}
  5729. s.exports = {
  5730. loadFeatureFlags: function (e) {
  5731. var t = $.Deferred()
  5732. return (
  5733. i
  5734. .get(e.urlBase + '', {
  5735. responseType: 'json',
  5736. prefetchFrom: 'user',
  5737. auth: n.getAuthorizationHeader()
  5738. })
  5739. .done(function (e) {
  5740. ;(o = (function (e) {
  5741. var t = {}
  5742. if (e) {
  5743. var i = e.flags
  5744. if (i) for (var n in i) i.hasOwnProperty(n) && (t[i[n]] = !0)
  5745. return t
  5746. }
  5747. return r.debug('Feature flags -> parseFeatureFlags: rawData is null.'), null
  5748. })(e))
  5749. ? t.resolve(o)
  5750. : t.reject('loading-failed')
  5751. })
  5752. .fail(function () {
  5753. r.debug('Retrieval of feature flags failed.'), t.reject('loading-failed')
  5754. }),
  5755. t.promise()
  5756. )
  5757. },
  5758. getFlags: function () {
  5759. return o
  5760. },
  5761. updateDependentSettings: function (e, t) {
  5762. ;(e = e || o).labels && (t.labels.enabled = !0),
  5763. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5764. e.showcase_sdk && (t.sdkInit = !0),
  5765. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5766. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5767. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5768. e.hide_sc_sharing && (t.share.enabled = !1)
  5769. }
  5770. }
  5771. }).call(this, '/js/featureflags.js')
  5772. },
  5773. {
  5774. './util/ajax': 181,
  5775. './util/logger': 189,
  5776. './util/showcase': 193
  5777. }
  5778. ],
  5779. 60: [
  5780. function (e, t, i) {
  5781. 'use strict'
  5782. var n =
  5783. (e('../util/common'),
  5784. {
  5785. status: 0,
  5786. set: function (e) {
  5787. if (isNaN(e)) return !1
  5788. var t = $('.progressbar')
  5789. e < 0 && (e = 0), 100 < e && (e = 100)
  5790. var i = e * (parseInt(t.css('width').replace('px', '')) / 100),
  5791. n = Math.round(e),
  5792. r = parseInt(i) - 15
  5793. t.find('.bar').css('width', i), t.find('.label').css('left', r), t.find('.perc').text(n + '%'), (this.status = e)
  5794. },
  5795. done: function (e) {
  5796. return e || this.status ? ((this.status = null), this.set(100)) : this
  5797. }
  5798. })
  5799. t.exports.circleLoader = n
  5800. },
  5801. {
  5802. '../util/common': 185
  5803. }
  5804. ],
  5805. 61: [
  5806. function (e, t, i) {
  5807. 'use strict'
  5808. t.exports = Object.freeze({
  5809. CLOSE: 'modal.closer.close'
  5810. })
  5811. },
  5812. {}
  5813. ],
  5814. 62: [
  5815. function (e, t, i) {
  5816. 'use strict'
  5817. function n(t, e) {
  5818. function i() {
  5819. var e = t.offsetHeight >= $('#player').height() && t.offsetWidth >= $('#player').width()
  5820. e !== p && ((p = e) ? (t.classList.add('closeByFooter'), c.classList.add('closeByFooter')) : (t.classList.remove('closeByFooter'), c.classList.remove('closeByFooter')))
  5821. }
  5822. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5823. }
  5824. var r = e('../../settings'),
  5825. o = (e('../../tag/Media/MediaEvent'), e('../../util/browser')),
  5826. a = e('../../util/common'),
  5827. s = e('./ModalCloserEvent'),
  5828. l = e('events').EventEmitter,
  5829. c = document.getElementsByClassName('footer')[0],
  5830. h = c.querySelectorAll('.close')[0],
  5831. u = null,
  5832. d = null,
  5833. p = null,
  5834. f =
  5835. (o.isMobile(),
  5836. {
  5837. open: function (e) {
  5838. e &&
  5839. (n(e),
  5840. u && h.removeEventListener('click', u, !0),
  5841. (u = function (e, t) {
  5842. t && (t.stopPropagation(), t.preventDefault()), e && this.emit(s.CLOSE, e), f.reset()
  5843. }.bind(this, e.id)),
  5844. h.addEventListener('click', u, !0),
  5845. d && window.removeEventListener('resize', d, !0),
  5846. (d = n.bind(this, e)),
  5847. window.addEventListener('resize', d, !0))
  5848. },
  5849. reset: function () {
  5850. c.classList.remove('closeByFooter'), h.removeEventListener('click', u, !0), window.removeEventListener('resize', d, !0), (u = d = p = null)
  5851. }
  5852. })
  5853. a.extendObject(f, l.prototype), (t.exports = f)
  5854. },
  5855. {
  5856. '../../tag/Media/MediaEvent': 131,
  5857. '../../settings': 166,
  5858. '../../util/browser': 182,
  5859. '../../util/common': 185,
  5860. './ModalCloserEvent': 61,
  5861. events: 202
  5862. }
  5863. ],
  5864. 63: [
  5865. function (e, t, i) {
  5866. 'use strict'
  5867. var A = e('../lib/dat.gui'),
  5868. C = e('three'),
  5869. I = e('../util/easing'),
  5870. E = e('../enum/Viewmode'),
  5871. _ = e('../enum/Colors'),
  5872. b = e('../enum/WarpStyle'),
  5873. w = e('../settings')
  5874. e('../tag/tag'),
  5875. (A.GUI.prototype.removeFolder = function (e) {
  5876. var t = this.__folders[e]
  5877. t && (t.close(), this.__ul.removeChild(t.domElement.parentNode), delete this.__folders[e], this.onResize())
  5878. }),
  5879. (t.exports.toggle = function (t, e, i) {
  5880. var n = new A.GUI({
  5881. width: 400
  5882. }),
  5883. r = n.addFolder('Flydown from Dollhouse')
  5884. r.add(w.flydown, 'movementEasing', Object.keys(I)),
  5885. r.add(w.flydown, 'movementDelay', 0, 1).step(0.01),
  5886. r.add(w.flydown, 'rotationEasing', Object.keys(I)),
  5887. r.add(w.flydown, 'rotationDelay', 0, 1).step(0.01),
  5888. r.add(w.flydown, 'modelTextureDelay', 0, 1).step(0.01),
  5889. r.add(w.flydown, 'skyboxDelay', 0, 1).step(0.01),
  5890. r.add(w.dollhouseDefault, 'minPolarAngle', 0, C.Math.degToRad(50)),
  5891. r.add(w.dollhouseDefault, 'maxPolarAngle', C.Math.degToRad(50), C.Math.degToRad(170))
  5892. var o = n.addFolder('Transition between panos')
  5893. o.add(w.transition, 'blur', 0, 10).onFinishChange(function () {}),
  5894. o
  5895. .add(w.transition, 'flySpeed', 0, 10)
  5896. .step(0.01)
  5897. .onFinishChange(function () {
  5898. ;(w.transition.flyTime = 0),
  5899. o.__controllers.forEach(function (e) {
  5900. e.updateDisplay()
  5901. })
  5902. }),
  5903. o.add(w.transition, 'flyTime', 0, 5e3).onFinishChange(function () {
  5904. ;(w.transition.flySpeed = 0),
  5905. o.__controllers.forEach(function (e) {
  5906. e.updateDisplay()
  5907. })
  5908. }),
  5909. o.add(w.transition, 'aimTime', 500, 2500).step(50),
  5910. o.add(w.transition, 'aimSlowFactor', 1, 3).step(0.1),
  5911. o.add(w.transition, 'movementEasing', Object.keys(I))
  5912. var a = n.addFolder('Path Display')
  5913. a
  5914. .add(w.path, 'opacity', 0, 1)
  5915. .step(0.01)
  5916. .onFinishChange(function () {}),
  5917. a
  5918. .add(w.path, 'height', 0, 0.2)
  5919. .step(0.01)
  5920. .onFinishChange(function () {}),
  5921. a
  5922. .add(w.path, 'outsideHeight', 0, 2)
  5923. .step(0.01)
  5924. .onFinishChange(function () {}),
  5925. a
  5926. .add(w.path, 'ribbonWidth', 0.01, 0.35)
  5927. .step(0.01)
  5928. .onFinishChange(function () {}),
  5929. a
  5930. .add(w.path, 'waypointRadius', 0.01, 1.2)
  5931. .step(0.01)
  5932. .onFinishChange(function () {}),
  5933. a
  5934. .add(w.path, 'waypointPulse', 0, 3600)
  5935. .step(20)
  5936. .onFinishChange(function () {}),
  5937. a
  5938. .add(w.path, 'waypointIndoorRadius', 0.01, 1.2)
  5939. .step(0.01)
  5940. .onFinishChange(function () {}),
  5941. a
  5942. .add(w.path, 'fadeInTime', 0, 1200)
  5943. .step(10)
  5944. .onFinishChange(function () {}),
  5945. a
  5946. .add(w.path, 'fadeOutTime', 0, 1200)
  5947. .step(10)
  5948. .onFinishChange(function () {}),
  5949. a.add(w.path, 'color', Object.keys(_)).onFinishChange(function () {
  5950. ;(w.path.color = _[w.path.color]), (w.path.colorUp = _._desat(w.path.color)), (w.path.colorDown = _.darken(w.path.color))
  5951. }),
  5952. a.add(w, 'reticuleColor', Object.keys(_)).onFinishChange(function () {
  5953. w.reticuleColor = _[w.reticuleColor]
  5954. })
  5955. var s = n.addFolder('Warping'),
  5956. l = s.addFolder('Warp/Teleport')
  5957. l.add(w.warp, 'softPushDist', 0, 2).onFinishChange(function () {}),
  5958. l
  5959. .add(w.warp, 'softPushEnd', 0, 1)
  5960. .step(0.01)
  5961. .onFinishChange(function () {}),
  5962. l.add(w.warp, 'softBendAngle', 0, 45).onFinishChange(function () {}),
  5963. l.add(w.warp, 'softBendTilt', 0, 45).onFinishChange(function () {}),
  5964. l
  5965. .add(w.warp, 'softBendEnd', 0, 1)
  5966. .step(0.01)
  5967. .onFinishChange(function () {}),
  5968. l.add(w.warp, 'burnsAngle', 0, 30).onFinishChange(function () {}),
  5969. l.add(w.warp, 'minBurnsAngle', 0, 10).onFinishChange(function () {}),
  5970. l.add(w.warp, 'brakeStrength', 1, 8).onFinishChange(function () {}),
  5971. l
  5972. .add(w.warp, 'minBrakeAngle', 0, 5)
  5973. .step(0.01)
  5974. .onFinishChange(function () {}),
  5975. l
  5976. .add(w.warp, 'maxBrakeAngle', 0, 5)
  5977. .step(0.01)
  5978. .onFinishChange(function () {}),
  5979. l.add(w.path, 'mapGuides').onFinishChange(function () {}),
  5980. l
  5981. .add(w.warp, 'teleportTime', 0, 5e3)
  5982. .step(10)
  5983. .onFinishChange(function () {}),
  5984. l
  5985. .add(w.warp, 'outsideTime', 0, 5e3)
  5986. .step(10)
  5987. .onFinishChange(function () {}),
  5988. l.add(w.path, 'typ', Object.keys(b)).onFinishChange(function () {
  5989. w.path.typ = b[w.path.typ]
  5990. }),
  5991. l
  5992. .add(w.warp, 'loop')
  5993. .onChange(function () {})
  5994. .onFinishChange(function () {
  5995. e.endlessLoop = w.warp.loop
  5996. }),
  5997. l
  5998. .add(w.warp, 'walkSlideShowThreshhold', 1, 1e4)
  5999. .step(1)
  6000. .onFinishChange(function () {}),
  6001. l
  6002. .add(w.warp, 'walkExtraPanosDistance', 0, 3)
  6003. .step(0.1)
  6004. .onFinishChange(function () {}),
  6005. l
  6006. .add(w.transition, 'fastForwardFactor', 1, 10)
  6007. .step(1)
  6008. .onFinishChange(function () {})
  6009. var c = s.addFolder('Long Warp Only')
  6010. c
  6011. .add(w.warp, 'minWarpTime', 0, 5e3)
  6012. .step(10)
  6013. .onFinishChange(function () {
  6014. ;(w.warp.flySpeed = 0),
  6015. c.__controllers.forEach(function (e) {
  6016. e.updateDisplay()
  6017. })
  6018. }),
  6019. c
  6020. .add(w.warp, 'timePerMeter', 0, 5e3)
  6021. .step(10)
  6022. .onFinishChange(function () {}),
  6023. c
  6024. .add(w.warp, 'lookAheadMax', 0.01, 1)
  6025. .step(0.01)
  6026. .onFinishChange(function () {}),
  6027. c
  6028. .add(w.warp, 'lookAheadDist', 0.01, 4)
  6029. .step(0.01)
  6030. .onFinishChange(function () {}),
  6031. c
  6032. .add(w.warp, 'maxTurnPerSec', 0, 720)
  6033. .step(1)
  6034. .onFinishChange(function () {}),
  6035. c
  6036. .add(w.warp, 'maxAimPerSec', 0, 720)
  6037. .step(1)
  6038. .onFinishChange(function () {}),
  6039. c
  6040. .add(w.warp, 'turnFriction', 0, 1)
  6041. .step(0.01)
  6042. .onFinishChange(function () {}),
  6043. c
  6044. .add(w.warp, 'walkDelay', 0, 2e3)
  6045. .step(10)
  6046. .onFinishChange(function () {}),
  6047. c
  6048. .add(w.transition, 'flytimeMaxDistanceThreshold', 0, 25)
  6049. .step(10)
  6050. .onFinishChange(function () {}),
  6051. c
  6052. .add(w.warp, 'walkMaxDist', 0, 100)
  6053. .step(1)
  6054. .onFinishChange(function () {})
  6055. var h = n.addFolder('Warp Esoterica')
  6056. h
  6057. .add(w.warp, 'nearPanoDist', 0.01, 12)
  6058. .step(0)
  6059. .onFinishChange(function () {}),
  6060. h.add(w.warp, 'blur', 0.01, 1).onFinishChange(function () {}),
  6061. h
  6062. .add(w.warp, 'flySpeed', 0, 10)
  6063. .step(0.01)
  6064. .onFinishChange(function () {
  6065. ;(w.warp.minWarpTime = 0),
  6066. h.__controllers.forEach(function (e) {
  6067. e.updateDisplay()
  6068. })
  6069. }),
  6070. h.add(w.warp, 'showBunny').onFinishChange(function () {}),
  6071. h
  6072. .add(w.warp, 'fastTime', 0, 2500)
  6073. .step(10)
  6074. .onFinishChange(function () {}),
  6075. h.add(w.warp, 'movementEasing', Object.keys(I))
  6076. var u = n.addFolder('Misc')
  6077. u.add(w, 'dollhouseFOV', 10, 180).onChange(function () {
  6078. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  6079. }),
  6080. u.add(w, 'insideFOV', 10, 180).onChange(function () {
  6081. i.cameras[E.PANORAMA].fov = w.insideFOV
  6082. }),
  6083. u
  6084. .add(w, 'insideLookSpeed', 0.01, 0.3)
  6085. .step(0.01)
  6086. .onChange(function () {}),
  6087. u
  6088. .add(w, 'rotationAccelerationInside', 0.1, 10)
  6089. .step(0.1)
  6090. .onChange(function () {}),
  6091. u
  6092. .add(w, 'rotationAccelerationOutside', 0.1, 10)
  6093. .step(0.1)
  6094. .onChange(function () {})
  6095. var d = n.addFolder('Navigation')
  6096. d.add(w.navigation, 'panoScores').onFinishChange(function () {
  6097. w.navigation.panoScores ||
  6098. t.panos.forEach(function (e) {
  6099. e.floor.remove(e.text3d), (e.text3d = null)
  6100. })
  6101. }),
  6102. d.add(w.navigation, 'mouseDirection'),
  6103. d.add(w.navigation, 'filterStrictness', 0, 1),
  6104. d.add(w.navigation, 'angleFactor', -60, 0),
  6105. d.add(w.navigation, 'directionFactor', 1, 20),
  6106. d.add(w.navigation, 'distanceFactor', -5, 5),
  6107. d.add(w.navigation, 'optionalityFactor', 0.1, 10)
  6108. var p = n.addFolder('tags'),
  6109. f = p.addFolder('Tag Creation')
  6110. f.add(w.tags.pole, 'enabled').name('poleEnabled'),
  6111. f.add(w.tags.pole, 'height', 0, 2.5).step(0.01).name('poleHeight'),
  6112. f.add(w.tags.pole, 'width', 1, 10).step(1).name('poleWidth'),
  6113. f.add(w.tags.pole, 'opacity', 0.1, 1).step(0.1).name('poleOpacity')
  6114. var g = p.addFolder('Visibility')
  6115. g.add(w.tags.visibility, 'anyDistance'),
  6116. g.add(w.tags.visibility, 'visibleDistance', 0.1, 30).step(0.1),
  6117. g.add(w.tags.visibility, 'cameraClearance', 0, 1).step(0.01),
  6118. g.add(w.tags.visibility, 'hideViaFloor'),
  6119. g.add(w.tags.visibility, 'hideOffScreenDisc').name('hideEdgeDisc'),
  6120. g.add(w.tags.visibility, 'hideOffScreenObject').name('hideEdgeObject')
  6121. var m = p.addFolder('Disc Parameters')
  6122. m.add(w.tags.disc.scale, 'nearBound', 0.1, 10).step(0.1),
  6123. m.add(w.tags.disc.scale, 'farBound', 0.1, 20).step(0.1).listen(),
  6124. m.add(w.tags.disc.scale, 'linkFarBound').onChange(function (e) {
  6125. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  6126. }),
  6127. m
  6128. .add(w.tags.disc.scale, 'linkPercent', 0, 100)
  6129. .step(1)
  6130. .onChange(function (e) {
  6131. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  6132. }),
  6133. m.add(w.tags.disc.scale, 'maxSize', 40, 200).step(1),
  6134. m.add(w.tags.disc.scale, 'minSize', 20, 100).step(1),
  6135. m.add(w.tags.disc.scale, 'responsiveness', 0, 100).step(1)
  6136. var v = p.addFolder('Navigate')
  6137. v.add(w.tags.navigate, 'nearestPano').name('nearestPano'),
  6138. v.add(w.tags.navigate, 'lineOfSight').name('lineOfSight'),
  6139. v.add(w.tags.navigate, 'reactivate').name('reactivate'),
  6140. v.add(w.tags.navigate, 'aimAt', ['disc', 'object', 'pole', 'nothing']).name('aim at'),
  6141. v.add(w.tags.navigate, 'tiltTolerance', 0, 50).step(1),
  6142. v.add(w.tags.navigate, 'rotateSpeedFactor', 0, 5).step(0.1)
  6143. var y = n.addFolder('Debug')
  6144. y.add(w, 'wireframe').onFinishChange(function () {
  6145. t.chunks.forEach(function (e) {
  6146. e.material &&
  6147. (e.wireframeTwin ||
  6148. ((e.wireframeTwin = new C.WireframeHelper(e)),
  6149. (e.wireframeTwin.material.depthWrite = !1),
  6150. (e.wireframeTwin.material.depthTest = !1),
  6151. (e.wireframeTwin.material.opacity = 0.5),
  6152. (e.wireframeTwin.material.transparent = !0)),
  6153. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  6154. })
  6155. }),
  6156. y.add(w, 'skyboxWireframe').onFinishChange(function () {
  6157. w.skyboxWireframe ? ((t.skybox.wireframe = new C.WireframeHelper(t.skybox)), t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe), (t.skybox.wireframe = null))
  6158. }),
  6159. y.add(w, 'showSweeps').onFinishChange(function () {
  6160. t.setSweepVisibility(w.showSweeps)
  6161. }),
  6162. y.add(w, 'showMesh').onFinishChange(function () {
  6163. t.chunks.forEach(function (e) {
  6164. e.visible = w.showMesh
  6165. })
  6166. }),
  6167. y.add(w, 'showFloors').onFinishChange(function () {
  6168. t.floors.forEach(function (e) {
  6169. e.collider.children.forEach(function (e) {
  6170. e.material.visible = w.showFloors
  6171. })
  6172. })
  6173. }),
  6174. y.add(w, 'showSkyboxes').onFinishChange(function () {
  6175. t.panos.forEach(function (e) {
  6176. e.skyboxMesh.visible = w.showSkyboxes
  6177. })
  6178. }),
  6179. y.add(w, 'showNeighbors').onChange(function () {}),
  6180. y.add(t, 'alpha', 0, 1)
  6181. })
  6182. },
  6183. {
  6184. '../enum/Colors': 19,
  6185. '../enum/Viewmode': 51,
  6186. '../enum/WarpStyle': 52,
  6187. '../lib/dat.gui': 93,
  6188. '../tag/tag': 123,
  6189. '../settings': 166,
  6190. '../util/easing': 186,
  6191. three: 217
  6192. }
  6193. ],
  6194. 64: [
  6195. function (c, h, e) {
  6196. ;(function (e) {
  6197. 'use strict'
  6198. function i(e, t, i, n) {
  6199. $('.gui-error .error-problem-text').text(e),
  6200. $('.gui-error .error-solution-text').text(t),
  6201. $('.gui-error .error-explanation').text(i),
  6202. $('.gui-error .error-actions').html(n),
  6203. $(window).resize(),
  6204. $('.gui-error').fadeIn(),
  6205. $('#bottom-logo').fadeIn()
  6206. }
  6207. function n(e) {
  6208. var t = [
  6209. '<div class="browser-tiles">',
  6210. '<div class="tile">',
  6211. '<a href="https://www.google.com/chrome/browser/" target="_blank">',
  6212. '<img class="icon" src="images/icon_Google_Chrome_2011.png" ',
  6213. 'rel="tiletip" title="Chrome"></a>',
  6214. '</div>',
  6215. '<div class="tile">',
  6216. '<a href="https://www.mozilla.org/en-US/firefox/new/" target="_blank">',
  6217. '<img class="icon" src="images/icon_Mozilla_Firefox.png" ',
  6218. 'rel="tiletip" title="Firefox"></a>',
  6219. '</div>',
  6220. '<div class="tile">',
  6221. '<a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie" target="_blank">',
  6222. '<img class="icon" src="images/icon_Internet_Explorer_10.png" ',
  6223. 'rel="tiletip" title="Internet Explorer"></a>',
  6224. '</div>',
  6225. '<div class="tile">',
  6226. '<a href="https://support.apple.com/en-us/HT204416" target="_blank">',
  6227. '<img class="icon" src="images/icon_MacOSX_Safari.png" ',
  6228. 'rel="tiletip" title="Safari"></a>',
  6229. '</div>',
  6230. '</div>'
  6231. ].join('')
  6232. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  6233. r.isMobile() ||
  6234. $('[rel=tiletip]').tooltip({
  6235. placement: 'bottom',
  6236. delay: {
  6237. show: 50,
  6238. hide: 0
  6239. },
  6240. trigger: 'hover',
  6241. viewport: {
  6242. selector: 'body',
  6243. padding: 10
  6244. }
  6245. })
  6246. }
  6247. function t() {
  6248. var e = r.isMobile() ? '' : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + '</span>' + s.ERROR_GENERIC_ACTIONS_3,
  6249. t = [s.ERROR_GENERIC_ACTIONS_1, e].join('')
  6250. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, '', t),
  6251. r.isMobile() ||
  6252. $('.install-browser').on('click touchstart', function (e) {
  6253. e.preventDefault(), e.stopPropagation(), n(' ')
  6254. })
  6255. }
  6256. var r = c('./../util/browser'),
  6257. o = c('./../analytics'),
  6258. a = c('./../settings'),
  6259. s = c('../localization/localize'),
  6260. l = new (c('./../util/logger'))(e)
  6261. h.exports.error = function (e) {
  6262. if (
  6263. ($('head title').text(a.pageTitle),
  6264. $('#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo').hide(),
  6265. $('#gui-loading').fadeOut(250),
  6266. $('#quick-blackout').hide(),
  6267. o.track('showcase_error', {
  6268. error_key: e
  6269. }),
  6270. s.locale || s.init(),
  6271. 'webgl-unsupported' === e)
  6272. )
  6273. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM)
  6274. else if ('webgl-ios' === e) i(s.ERROR_WEBGL_IOS_PROBLEM, s.ERROR_WEBGL_IOS_SOLUTION, '', s.ERROR_WEBGL_IOS_ACTIONS_1 + '<strong>' + s.ERROR_WEBGL_IOS_ACTIONS_2 + '</strong>.')
  6275. else if ('webgl-safari' === e)
  6276. i(
  6277. s.ERROR_WEBGL_SAFARI_PROBLEM,
  6278. '',
  6279. '',
  6280. s.ERROR_WEBGL_SAFARI_ACTIONS_1 +
  6281. '<strong>' +
  6282. s.ERROR_WEBGL_SAFARI_ACTIONS_2 +
  6283. '</strong>. ' +
  6284. s.ERROR_WEBGL_SAFARI_ACTIONS_3 +
  6285. '<strong>' +
  6286. s.ERROR_WEBGL_SAFARI_ACTIONS_4 +
  6287. '</strong>.'
  6288. )
  6289. else if ('webgl-generic' === e) t()
  6290. else if ('missing-urls' === e) i(s.ERROR_MISSING_URLS_PROBLEM, '', s.ERROR_MISSING_URLS_EXPLANATION)
  6291. else if ('loading-failed' === e)
  6292. i(
  6293. s.ERROR_LOADING_FAILED_PROBLEM,
  6294. '',
  6295. '',
  6296. s.ERROR_LOADING_FAILED_ACTIONS_1 + '<a class="link" target="_blank" href="https://support.port.com/hc/articles/208220058">' + s.ERROR_LOADING_FAILED_ACTIONS_2 + '</a>.'
  6297. )
  6298. else {
  6299. if ('loading-failed-maintenance' !== e) return void l.error('Unhandled error: ' + e)
  6300. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  6301. }
  6302. }
  6303. }).call(this, '/js/gui/error.js')
  6304. },
  6305. {
  6306. '../localization/localize': 108,
  6307. './../analytics': 4,
  6308. './../settings': 166,
  6309. './../util/browser': 182,
  6310. './../util/logger': 189
  6311. }
  6312. ],
  6313. 65: [
  6314. function (Oe, Le, e) {
  6315. ;(function (e) {
  6316. 'use strict'
  6317. function c() {
  6318. for (var e in Ce)
  6319. if (Ce.hasOwnProperty(e)) {
  6320. var t = Ce[e]
  6321. if (!t.visible) for (var i = 0; i < t.elements.length; i++) $(t.elements[i]).hide()
  6322. }
  6323. Ce.highlight.visible && $('.pinBottom').addClass('highlightExists'),
  6324. !1 === Ce.tourControls.visible && $('#drawer').addClass('fullWidth'),
  6325. (ge = []),
  6326. Ce.floors.visible && ge.push('.gui-floor', '.gui-floor-title'),
  6327. ge.push('.hideTarget', '.pinTop.right')
  6328. }
  6329. function v(e, t) {
  6330. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying
  6331. $('#gui-zoomin').toggle(i), $('#gui-zoomout').toggle(i)
  6332. }
  6333. function l() {
  6334. n(),
  6335. $('.pinBottom').toggleClass('open'),
  6336. $('#drawer').toggleClass('open'),
  6337. $('.footer').toggleClass('open'),
  6338. $('#drawer').hasClass('open')
  6339. ? ($('#pullTab .icon').attr('data-original-title', se.CLOSE_HIGHLIGHTS), _e('highlights'))
  6340. : ($('#pullTab .icon').attr('data-original-title', se.OPEN_HIGHLIGHTS), O.resetDrawer()),
  6341. setTimeout(
  6342. function () {
  6343. $('#pullTab').toggleClass('opened')
  6344. },
  6345. $('#drawer').hasClass('open') ? 0 : M.highlightAnimationDuration
  6346. ),
  6347. $('.pinBottom').hasClass('open') && t($('.vr-popup')) && $('.vr-popup').is(':visible') && X.dismiss()
  6348. }
  6349. function t(e) {
  6350. var t
  6351. return (
  6352. 'none' !== e.css('display')
  6353. ? (t = e.position().top + e.outerHeight())
  6354. : (e.attr('style', 'visibility: hidden'), (t = e.position().top + e.outerHeight()), e.attr('style', 'display: none')),
  6355. $('#player').outerHeight() - 130 < t + 25
  6356. )
  6357. }
  6358. function y(e) {
  6359. 'touchstart' === e.type && e.preventDefault(), e.stopPropagation()
  6360. }
  6361. function n() {
  6362. w && (w.reload(), w.init())
  6363. }
  6364. function r() {
  6365. $('#gui-spinner').stop(!0, !0), $('#gui-spinner').fadeOut(1e3), !(Ae = !0)
  6366. }
  6367. function A(e, t) {
  6368. var i = e.mode,
  6369. n = t || e.currentPano
  6370. $('#gui-modes-dollhouse').toggleClass('active', i === ie.DOLLHOUSE),
  6371. $('#gui-modes-floorplan').toggleClass('active', i === ie.FLOORPLAN),
  6372. $('#gui-modes-inside').toggleClass('active', i === ie.PANORAMA),
  6373. i === ie.PANORAMA
  6374. ? ($('#view-controllers').slideUp(500),
  6375. M.show360Views.enabled && !n.isAligned()
  6376. ? ($('.gui-floor').addClass('hidden'), $('#gui-modes-outside').addClass('desktop-only'))
  6377. : ($('.gui-floor').removeClass('hidden'), $('#gui-modes-outside').removeClass('desktop-only')),
  6378. $('#gui-modes-outside').removeClass('hidden'))
  6379. : i !== ie.TRANSITIONING &&
  6380. (r(),
  6381. (pe = i),
  6382. $('#gui-modes-outside').addClass('hidden'),
  6383. e.model.has360Views && $('.gui-floor').removeClass('hidden'),
  6384. $('#view-controllers').is(':visible') || $('#view-controllers').slideDown(M.guiAnimationSpeed))
  6385. }
  6386. function C(t, i) {
  6387. function e() {
  6388. document.getElementById('vr').classList.remove('hidden'),
  6389. M.vr.allowWebVR
  6390. ? S.getVRDisplay().then(
  6391. function (e) {
  6392. S.supportsFullscreen()
  6393. ? (function (e) {
  6394. ue.info(e.displayName + ' detected, VR button activates WebVR experience'),
  6395. Q.init(t.data, i, e, x),
  6396. Q.on(J.OPENED, _e.bind(gui, 'vr')),
  6397. Q.on(J.SHOW_TERMS, W.show.bind(W))
  6398. })(e)
  6399. : (ue.warn('Unable to use WebVR when full screen is not supported'), $('.improper-embed').toggleClass('hidden', !1), n())
  6400. },
  6401. function (e) {
  6402. n()
  6403. }
  6404. )
  6405. : n()
  6406. }
  6407. function n() {
  6408. var e
  6409. ue.info('WebVR support not found, VR button activates native app VR modal'),
  6410. X.init(t.data, x),
  6411. X.on(
  6412. Z.OPENED,
  6413. ((e = document.getElementById('vr-modal')),
  6414. function () {
  6415. _e('vr'), V.open(e)
  6416. })
  6417. ),
  6418. X.on(Z.CLOSED, V.reset)
  6419. }
  6420. if (M.vr.enabled && t.supportsVR && !S.valueFromHash('mls', 0))
  6421. switch (M.vr.option) {
  6422. case le.CONTEXTUAL:
  6423. e()
  6424. break
  6425. case le.ANDROID:
  6426. S.detectAndroid() && e()
  6427. break
  6428. case le.NONE:
  6429. }
  6430. }
  6431. function h(e, i) {
  6432. for (var n = $('.gui-floor'), t = 0; t < e.floors.length; t++)
  6433. if ('372' !== getQueryVariable('m')) {
  6434. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name)
  6435. $('.gui-floor').find('.container').prepend(r)
  6436. }
  6437. n.find('.container').prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + '</div>'),
  6438. n.on('click', function (e) {
  6439. y(e), _e('floor'), n.toggleClass('open')
  6440. }),
  6441. $('.floorChoice').on('click', function (e) {
  6442. y(e)
  6443. var t = $(this).data('index')
  6444. 'all' !== t
  6445. ? (R.updateInteraction(oe.InteractionGui, 'floor-control'),
  6446. i.player.gotoFloor(t),
  6447. R.track('showcase_gui', {
  6448. gui_action: 'click_floor_select_button',
  6449. interaction_source: 'gui'
  6450. }))
  6451. : (R.updateInteraction(oe.InteractionGui, 'floor-control'),
  6452. _e('move'),
  6453. i.allFloors(),
  6454. R.track('showcase_gui', {
  6455. gui_action: 'click_toggle_all_floors_button',
  6456. interaction_source: 'gui'
  6457. })),
  6458. n.removeClass('open')
  6459. })
  6460. }
  6461. function I(e, t) {
  6462. e &&
  6463. (t === ie.DOLLHOUSE || t === ie.FLOORPLAN
  6464. ? ($('.allFloorBtn').show(), $('.gui-floor-icon').hide(), $('.gui-floor-title').show())
  6465. : ($('.allFloorBtn').hide(), $('.gui-floor-icon').show(), $('.gui-floor-title').hide()),
  6466. e.model.allFloorsVisible
  6467. ? ($('.gui-floor-title').text(se.FLOOR_ALL),
  6468. $('.gui-floor-number').text(se.FLOOR_ALL),
  6469. $('.floorChoice').removeClass('active'),
  6470. $('.floorChoice[data-index="all"]').addClass('active'))
  6471. : ($('.gui-floor-title').text(e.name),
  6472. $('.gui-floor-number').text(' ' + (e.floorIndex + 1)),
  6473. $('.floorChoice').removeClass('active'),
  6474. $('.floorChoice[data-index=' + e.floorIndex + ']').addClass('active')))
  6475. }
  6476. function E() {
  6477. var e = $('#player').width() - 20,
  6478. t = $('#scroller'),
  6479. i = $('#drawer'),
  6480. n = $('.pinBottom')
  6481. $('#player').width() < 488 || $('#player').height() < 488
  6482. ? (t.addClass('hidden'), i.addClass('noScroll'), n.addClass('noScroll'))
  6483. : e < T != !i.hasClass('noScroll') && (t.toggleClass('hidden'), i.toggleClass('noScroll'), n.toggleClass('noScroll'))
  6484. }
  6485. function _(e) {
  6486. e.waitQueue.length <= 0
  6487. ? r()
  6488. : ye ||
  6489. (function (e) {
  6490. ;(e = e || 0),
  6491. (Ae = !1),
  6492. window.setTimeout(
  6493. function () {
  6494. Ae || (!0, $('#gui-spinner').stop(!0, !0).show())
  6495. }.bind(this),
  6496. e
  6497. )
  6498. })(M.modelComponentLoadSpinnerDelay)
  6499. }
  6500. function b(e, t) {
  6501. for (var i = []; e; ) i.push(e), (e = e.parentNode)
  6502. for (; t && -1 === i.indexOf(t); ) t = t.parentNode
  6503. return t
  6504. }
  6505. var w,
  6506. T,
  6507. o,
  6508. a,
  6509. x,
  6510. i,
  6511. s,
  6512. u,
  6513. d,
  6514. p,
  6515. f,
  6516. g,
  6517. S = (Oe('three'), Oe('../util/ajax'), Oe('../util/browser')),
  6518. M = Oe('../settings'),
  6519. R = Oe('../analytics'),
  6520. m = (Oe('../util/transitions'), Oe('../util/camera'), Oe('../util/logger')),
  6521. P = (Oe('../objects/Snapshot'), Oe('./helpManager')),
  6522. O = Oe('./immersiveMode'),
  6523. L = Oe('./loadingScreen'),
  6524. D = Oe('./landingScreen'),
  6525. N = Oe('./playButton'),
  6526. F = Oe('./populateModal'),
  6527. B = Oe('./memoryUsage'),
  6528. V = Oe('./closer/modalCloser'),
  6529. k = Oe('./closer/ModalCloserEvent'),
  6530. U = Oe('./help/help'),
  6531. H = Oe('./help/HelpEvent'),
  6532. z = Oe('./title/titleBar'),
  6533. G = Oe('./title/TitleEvents'),
  6534. W = Oe('./terms/terms'),
  6535. j = Oe('./terms/TermsEvent'),
  6536. Y = Oe('./title/tagToggle'),
  6537. q = Oe('./tourInteraction'),
  6538. X = Oe('./vr/vrModal'),
  6539. Z = Oe('./vr/vrEvent'),
  6540. K = Oe('./sharing/modal'),
  6541. Q = Oe('./webvr/webVRgui'),
  6542. J = Oe('./webvr/WebVrEvent'),
  6543. ee = Oe('../controls/serializer'),
  6544. te = Oe('../enum/Keys'),
  6545. ie = Oe('../enum/Viewmode'),
  6546. ne = (Oe('../enum/BlackoutStyle'), Oe('../tag/Media/MediaEvent')),
  6547. re = (Oe('../enum/PathDiscardMode'), Oe('../enum/PathDisplayMode'), Oe('../enum/DirectorEvents'), Oe('../enum/PlayerEvents')),
  6548. oe = Oe('../enum/ControlEvents'),
  6549. ae = Oe('./sharing/ShareEvents'),
  6550. se = Oe('../localization/localize'),
  6551. le = (Oe('../enum/Vectors'), Oe('../enum/WarpStyle'), Oe('../enum/AlignmentType'), Oe('../enum/VROption')),
  6552. ce = Oe('./konami'),
  6553. he = Oe('../lib/dat.gui'),
  6554. ue = new m(e),
  6555. de = (Oe('../util/showcase'), Oe('../enum/ZoomEvents')),
  6556. pe = ie.DOLLHOUSE,
  6557. fe = 0,
  6558. ge = ['.hideTarget'],
  6559. me = null,
  6560. ve = null,
  6561. ye = !1,
  6562. Ae = !1,
  6563. Ce = {
  6564. coBrand: {
  6565. visible: !0,
  6566. elements: ['.co-brand', '#loaderCoBrand']
  6567. },
  6568. help: {
  6569. visible: !0,
  6570. elements: ['.nav-help', '#nav-help']
  6571. },
  6572. tourControls: {
  6573. visible: !0,
  6574. elements: ['.next', '.previous', '#play']
  6575. },
  6576. highlight: {
  6577. visible: !0,
  6578. elements: ['#drawer', '#pullTab']
  6579. },
  6580. share: {
  6581. visible: !0,
  6582. elements: ['.socialButton', '#share']
  6583. },
  6584. fullScreen: {
  6585. visible: !0,
  6586. elements: ['#gui-fullscreen']
  6587. },
  6588. floors: {
  6589. visible: !0,
  6590. elements: ['.gui-floor']
  6591. }
  6592. },
  6593. Ie =
  6594. ((g = document.getElementById('drawer')),
  6595. function () {
  6596. $('#player').height() < 400 && g.classList.contains('open') && l()
  6597. }),
  6598. Ee =
  6599. ((f = document.getElementById('meta-info')),
  6600. function () {
  6601. $('#player').height() < 400 && f.classList.contains('expand') && z.toggleMeta(!0)
  6602. }),
  6603. _e =
  6604. ((i = document.getElementById('meta-info')),
  6605. (s = document.getElementById('interaction-modal')),
  6606. (u = $('#drawer').eq(0)),
  6607. (d = $('.gui-floor').eq(0)),
  6608. (p = $('.vr-popup').eq(0)),
  6609. function (e) {
  6610. switch (e) {
  6611. case 'info':
  6612. we(), Te(), Ie(), Me(), Re(), xe(), Pe()
  6613. break
  6614. case 'terms':
  6615. be(), Te(), Se(), Me(), Re(), xe(), Pe()
  6616. break
  6617. case 'help':
  6618. be(), we(), Me(), Re(), xe(), Pe()
  6619. break
  6620. case 'vr':
  6621. be(), we(), Me(), Re(), Te(), Pe(), t(p) && Se()
  6622. break
  6623. case 'highlights':
  6624. Ee(), we(), Me(), Re()
  6625. break
  6626. case 'share':
  6627. be(), we(), Te(), Re(), xe(), Pe()
  6628. break
  6629. case 'floor':
  6630. we(), Me(), xe()
  6631. break
  6632. case 'view':
  6633. Re(), Me(), we(), xe()
  6634. break
  6635. case 'tour':
  6636. case 'move':
  6637. we(), Me(), Re(), xe()
  6638. break
  6639. case 'resize':
  6640. be(), Ie(), Re()
  6641. break
  6642. case 'tag':
  6643. we(), Te(), Me(), Re(), xe()
  6644. }
  6645. })
  6646. function be() {
  6647. i.classList.contains('expand') && z.toggleMeta(!0)
  6648. }
  6649. function we() {
  6650. W.hide()
  6651. }
  6652. function Te() {
  6653. U.close()
  6654. }
  6655. function xe() {
  6656. X.dismiss()
  6657. }
  6658. function Se() {
  6659. u.hasClass('open') && l()
  6660. }
  6661. function Me() {
  6662. K.hide()
  6663. }
  6664. function Re() {
  6665. d.hasClass('open') && d.removeClass('open')
  6666. }
  6667. function Pe() {
  6668. s.classList.contains('fadeIn') && (s.classList.contains('landing') ? D.dismissModal() : s.classList.contains('tour') && q.dismissModal())
  6669. }
  6670. $(document).on('fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange', function (e) {
  6671. $('#gui-fullscreen').toggle(!S.isFullscreen()),
  6672. $('#gui-fullscreen-exit').toggle(!!S.isFullscreen()),
  6673. setTimeout(function () {
  6674. $('.icon:visible').hide().show(0)
  6675. }, 100)
  6676. }),
  6677. $('#gui-fullscreen')
  6678. .find('a')
  6679. .on('click', function (e) {
  6680. y(e),
  6681. S.requestFullscreen($('body')[0]),
  6682. R.track('showcase_gui', {
  6683. gui_action: 'click_enter_fullscreen',
  6684. interaction_source: 'gui'
  6685. })
  6686. }),
  6687. $('#gui-fullscreen-exit')
  6688. .find('a')
  6689. .on('click', function (e) {
  6690. y(e),
  6691. S.exitFullscreen(),
  6692. R.track('showcase_gui', {
  6693. gui_action: 'click_exit_fullscreen',
  6694. interaction_source: 'gui'
  6695. })
  6696. }),
  6697. $(window)
  6698. .on('resize', function (e) {
  6699. var t = e.target.innerHeight,
  6700. i = e.target.innerWidth
  6701. ;(t === o && i === a) || (Ce.highlight.visible && E(), _e('resize'), $('.pinTop.right').removeClass('hideUnderMeta'), n(), (o = t), (a = i))
  6702. })
  6703. .resize(),
  6704. S.supportsFullscreen() || $('#gui-fullscreen').hide(),
  6705. $('#pullTab').on('click', function (e) {
  6706. y(e),
  6707. $('#drawer').hasClass('open')
  6708. ? (R.trackAlways('showcase_gui', {
  6709. gui_action: 'hide_highlight_reel'
  6710. }),
  6711. $(this).addClass('open').children('img').attr('src', 'images/auto.png'))
  6712. : (R.trackAlways('showcase_gui', {
  6713. gui_action: 'show_highlight_reel'
  6714. }),
  6715. $(this).removeClass('open').children('img').attr('src', 'images/auto-suspend.png')),
  6716. l()
  6717. }),
  6718. window.DATA.showHotListSta &&
  6719. ($('#hotList').css('display', ''),
  6720. $('#hotList').on('click', function (e) {
  6721. y(e)
  6722. var t = $('#hotListWrap')[0]
  6723. t.classList.contains('hotListActive') ? (t.classList.remove('hotListActive'), this.classList.remove('active')) : (t.classList.add('hotListActive'), this.classList.add('active'))
  6724. }),
  6725. $('#hotListContent ul').on('mouseover', function (e) {
  6726. y(e)
  6727. var t = e.target,
  6728. i = document.getElementById('hotListWrap')
  6729. if ('SPAN' === t.tagName) {
  6730. var n = t.parentElement.parentElement
  6731. t.offsetWidth + 116 >= n.clientWidth ? (i.style.width = t.offsetWidth + 116 + 'px') : (i.style.width = '')
  6732. } else if ('LI' === t.tagName) {
  6733. n = t.parentElement
  6734. t.children[0].offsetWidth + 116 >= n.clientWidth ? (i.style.width = t.children[0].offsetWidth + 116 + 'px') : (i.style.width = '')
  6735. } else i.style.width = ''
  6736. }),
  6737. $('#hotListContent ul').on('click', function (e) {
  6738. y(e),
  6739. this.preElem && this.preElem.classList.remove('active'),
  6740. 'SPAN' === e.target.tagName
  6741. ? (e.target.parentElement.classList.add('active'), e.target.parentElement.hot && e.target.parentElement.hot.examine(!0), (this.preElem = e.target.parentElement))
  6742. : (e.target.classList.add('active'), e.target.hot && e.target.hot.examine(!0), (this.preElem = e.target))
  6743. }),
  6744. $('#hotListClose').on('click', function (e) {
  6745. y(e), $('#hotListWrap')[0].classList.remove('hotListActive'), $('#hotListContent ul .active').removeClass('active'), $('#hotList')[0].classList.remove('active')
  6746. })),
  6747. 'true' === window.DATA.supportsVR && $('#vr').css('display', ''),
  6748. $('#more-menu-button').on('click', function (e) {
  6749. y(e), $('#more-menu').toggleClass('open')
  6750. }),
  6751. (Le.exports.init = function (s, l, c, e, t, i, n) {
  6752. var r
  6753. ;(x = n),
  6754. s.outsideAllowed() || $('#gui-modes-outside').addClass('invisible'),
  6755. s.supportedModes[ie.PANORAMA] || $('#gui-modes-inside').addClass('invisible'),
  6756. F.init(),
  6757. D.init(s, i),
  6758. ce.init(s, l, e),
  6759. $('.icon').on('mouseover', function () {
  6760. l.player && l.player.reticule.hide()
  6761. }),
  6762. (function (e, t) {
  6763. var i = t.player
  6764. $('#gui-modes-inside').on('mousedown touchstart', function (e) {
  6765. y(e),
  6766. R.updateInteraction(oe.InteractionGui, 'inside-button'),
  6767. R.track('USER', {
  6768. event_type: 'showcase_gui',
  6769. gui_action: 'click_inside_mode_button'
  6770. }),
  6771. t.changeMode(ie.PANORAMA)
  6772. }),
  6773. $('#gui-modes-outside')
  6774. .find('a')
  6775. .on('click', function (e) {
  6776. y(e),
  6777. R.track('showcase_gui', {
  6778. gui_action: 'click_outside_mode_button'
  6779. }),
  6780. t.changeMode(pe)
  6781. }),
  6782. $('#gui-modes-floorplan').on('click', function (e) {
  6783. y(e),
  6784. i.mode !== ie.FLOORPLAN &&
  6785. (R.track('showcase_gui', {
  6786. gui_action: 'click_floorplan_mode_button'
  6787. }),
  6788. t.changeMode(ie.FLOORPLAN))
  6789. }),
  6790. $('#gui-modes-dollhouse').on('click', function (e) {
  6791. y(e),
  6792. i.mode !== ie.DOLLHOUSE &&
  6793. (R.track('showcase_gui', {
  6794. gui_action: 'click_dollhouse_mode_button'
  6795. }),
  6796. t.changeMode(ie.DOLLHOUSE))
  6797. })
  6798. })(0, l),
  6799. (function (e, t) {
  6800. $('#play').on('mousedown touchstart', function (e) {
  6801. y(e),
  6802. _e('tour'),
  6803. q.play(),
  6804. R.trackAlways('showcase_gui', {
  6805. gui_action: 'play_highlights'
  6806. })
  6807. }),
  6808. (window.startAndPlay = function (e) {
  6809. _e('tour'),
  6810. q.play(),
  6811. R.trackAlways('showcase_gui', {
  6812. gui_action: 'play_highlights'
  6813. })
  6814. }),
  6815. $('#pause').on('mousedown touchstart', function (e) {
  6816. y(e),
  6817. q.pause(),
  6818. R.trackAlways('showcase_gui', {
  6819. gui_action: 'pause_highlights'
  6820. })
  6821. }),
  6822. $('#gui-zoomin')
  6823. .find('a')
  6824. .on('click', function (e) {
  6825. y(e), t.player.zoomInIncrementally()
  6826. }),
  6827. $('#gui-zoomout')
  6828. .find('a')
  6829. .on('click', function (e) {
  6830. y(e), t.player.zoomOutIncrementally()
  6831. })
  6832. })(0, l),
  6833. s.data.enable_social_sharing &&
  6834. s.data.is_public &&
  6835. M.share.enabled &&
  6836. (K.init(DATA.name /* s.data.name */),
  6837. K.on(
  6838. ae.OPENED,
  6839. ((r = document.getElementById('share-modal')),
  6840. function () {
  6841. _e('share'), V.open(r)
  6842. })
  6843. ),
  6844. K.on(ae.CLOSED, V.reset)),
  6845. 0 < s.heroLocations.length
  6846. ? (function (e, i, t) {
  6847. var n = 100 / (fe = e.heroLocations.length) + '%',
  6848. r = $('#thumb-container'),
  6849. o = $('#progressBar')
  6850. $('#status').find('.totalSteps').text(fe)
  6851. for (var a = 0; a < fe; a++) {
  6852. var s = e.heroLocations[a],
  6853. l = $('<li class="thumbImg" data-index=""><img src=""></li>')
  6854. if (s.heroLocations) {
  6855. //有子项,选第一张截图
  6856. var tmp = s.heroLocations[0].thumbUrl.replace('https://', '').replace('http://', '')
  6857. } else {
  6858. var tmp = s.thumbUrl.replace('https://', '').replace('http://', '')
  6859. }
  6860. if (
  6861. (l.attr('data-index', a),
  6862. //Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6863. Ce.highlight.visible && l.find('img').attr('src', 'http://' + tmp), // xzw改 导览图片 https在某些服务器打不开
  6864. s.name)
  6865. ) {
  6866. var c = $('<div class="overlay"></div>').text(s.name)
  6867. l.prepend(c)
  6868. }
  6869. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6870. var h = e.panos.get(s.panoId),
  6871. u =
  6872. h && !h.isAligned()
  6873. ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>'
  6874. : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>'
  6875. l.prepend(u)
  6876. }
  6877. r.append(l), o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6878. }
  6879. ;(T = 144 * fe),
  6880. 111 * fe,
  6881. $('.thumbImg').on('mouseover', function () {
  6882. !(function (e) {
  6883. return e.describe().inTransition
  6884. })(i) && t.showPathToHeroLocation([$(this).data('index'), 0]) //改
  6885. }),
  6886. $('.thumbImg').on('mouseout', function () {
  6887. i.clearPath()
  6888. }),
  6889. $('.thumbImg').on('click', function (e) {
  6890. y(e)
  6891. var t = $(this)
  6892. R.updateInteraction(oe.InteractionGui, 'thumbnail'),
  6893. R.trackAlways('showcase_gui', {
  6894. gui_action: 'click_highlight'
  6895. }),
  6896. i.goToHighlight([t.data('index'), 0]) //改
  6897. }),
  6898. $('.previous')
  6899. .find('a')
  6900. .on('click', function (e) {
  6901. y(e),
  6902. R.trackAlways('showcase_gui', {
  6903. gui_action: 'prev_highlight'
  6904. }),
  6905. i.prevHighlight()
  6906. }),
  6907. $('.next')
  6908. .find('a')
  6909. .on('click', function (e) {
  6910. y(e),
  6911. R.trackAlways('showcase_gui', {
  6912. gui_action: 'next_highlight'
  6913. }),
  6914. i.nextHighlight()
  6915. }),
  6916. $('#drawer').on('mouseleave', function (t) {
  6917. var i
  6918. y(t)
  6919. try {
  6920. i = new MouseEvent('mouseup', {
  6921. clientX: t.clientX,
  6922. clientY: t.clientY,
  6923. screenX: t.screenX,
  6924. screenY: t.screenY
  6925. })
  6926. } catch (e) {
  6927. ;(i = document.createEvent('MouseEvents')).initMouseEvent(
  6928. 'mouseup',
  6929. t.bubbles,
  6930. t.cancelable,
  6931. t.view,
  6932. t.detail,
  6933. t.screenX,
  6934. t.screenY,
  6935. t.clientX,
  6936. t.clientY,
  6937. t.ctrlKey,
  6938. t.altKey,
  6939. t.shiftKey,
  6940. t.metaKey,
  6941. t.button,
  6942. t.relatedTarget
  6943. )
  6944. }
  6945. document.dispatchEvent(i)
  6946. }),
  6947. (w = new Sly($('#scrollFrame'), {
  6948. horizontal: !0,
  6949. itemNav: 'centered',
  6950. smart: !0,
  6951. scrollTrap: !0,
  6952. scrollBy: 1,
  6953. mouseDragging: !0,
  6954. touchDragging: !0,
  6955. speed: 300,
  6956. dragHandle: !0,
  6957. dynamicHandle: !0,
  6958. clickBar: !0,
  6959. scrollBar: $('#scroller'),
  6960. activateOn: null
  6961. }).init()).on('active', function (e, t) {
  6962. t,
  6963. _e('tour'),
  6964. $('.step').removeClass('active'),
  6965. $('#status')
  6966. .find('.curIdx')
  6967. .text(t + 1)
  6968. for (var i = 0; i <= t; i++)
  6969. $('#progressBar')
  6970. .find("[data-idx='" + i + "']")
  6971. .addClass('active')
  6972. }),
  6973. E()
  6974. //add :
  6975. let scrollFrame = $(w.frame)
  6976. scrollFrame.on('wheel.sly', function () {
  6977. lastMoveScrollTime = Date.now()
  6978. })
  6979. let dragstart
  6980. /* scrollFrame.on("pointerdown", function() {
  6981. dragstart = true
  6982. })
  6983. scrollFrame.on("pointerup", function() {
  6984. dragstart = false
  6985. }) */
  6986. scrollFrame.on('pointermove', function () {
  6987. //if(dragstart){
  6988. lastMoveScrollTime = Date.now()
  6989. //}
  6990. })
  6991. })(s, l, c)
  6992. : ((Ce.highlight.visible = !1), (Ce.tourControls.visible = !1)),
  6993. z.on(G.OPEN_INFO, _e.bind(this, 'info')),
  6994. (function () {
  6995. var n
  6996. document.body.addEventListener(
  6997. 'mousedown',
  6998. function (e) {
  6999. n = 0 === e.button || 1 === e.which ? e.target : null
  7000. },
  7001. !0
  7002. ),
  7003. document.body.addEventListener(
  7004. 'mouseup',
  7005. function (t) {
  7006. n !== t.target && (n = b(n, t.target))
  7007. var e = document.getElementById('gui-parent')
  7008. if ((b(e, n) !== e && (n = null), n)) {
  7009. var i
  7010. try {
  7011. i = new MouseEvent('click', t)
  7012. } catch (e) {
  7013. ;(i = document.createEvent('MouseEvents')).initMouseEvent(
  7014. 'click',
  7015. t.bubbles,
  7016. t.cancelable,
  7017. t.view,
  7018. t.detail,
  7019. t.screenX,
  7020. t.screenY,
  7021. t.clientX,
  7022. t.clientY,
  7023. t.ctrlKey,
  7024. t.altKey,
  7025. t.shiftKey,
  7026. t.metaKey,
  7027. t.button,
  7028. t.relatedTarget
  7029. )
  7030. }
  7031. ;(i.syntheticClick = !0), n.dispatchEvent(i), (n = null)
  7032. }
  7033. },
  7034. !0
  7035. ),
  7036. document.getElementById('gui-parent').addEventListener(
  7037. 'click',
  7038. function (e) {
  7039. e.syntheticClick || (e.stopPropagation(), 'A' === e.target.nodeName && e.preventDefault())
  7040. },
  7041. !0
  7042. )
  7043. })(),
  7044. A(c),
  7045. C(s, t),
  7046. s.on('floor.changed', I),
  7047. s.on(
  7048. 'waiting',
  7049. function (e) {
  7050. _(e)
  7051. }.bind(this, s)
  7052. ),
  7053. s.on(
  7054. 'waiting-done',
  7055. function (e) {
  7056. _(e)
  7057. }.bind(this, s)
  7058. ),
  7059. c.on(re.ModeChanged, function (e, t) {
  7060. A(c), v(l, c), t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR), U.updateMode(t)
  7061. }),
  7062. e.on(oe.Move, _e.bind(this, 'move')),
  7063. c.on(re.Ready, function () {
  7064. O.init(e, c, c.tagManager, l),
  7065. c.on(re.ModeChanged, function (e, t) {
  7066. e !== t && $('.vr-popup').is(':visible') && X.dismiss()
  7067. })
  7068. }),
  7069. c.on(re.PanoChosen, function (e, t) {
  7070. A(c, t), U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  7071. }),
  7072. V.on(k.CLOSE, function (e) {
  7073. switch (e) {
  7074. case 'vr-modal':
  7075. X.dismiss()
  7076. break
  7077. case 'share-modal':
  7078. K.hide()
  7079. break
  7080. case 'terms-modal':
  7081. W.hide()
  7082. }
  7083. })
  7084. var lastMoveScrollTime = 0 //add
  7085. var o,
  7086. h = $('#play').eq(0),
  7087. u = $('#pause').eq(0),
  7088. d = $('.pinBottom').toArray(),
  7089. p = $('#drawer').eq(0),
  7090. f = $('#playHead').eq(0),
  7091. a = $('#progressBar').eq(0),
  7092. g = $('#thumb-container').eq(0).children(),
  7093. m = a.children()
  7094. l.on('update.controls', function () {
  7095. var e,
  7096. t,
  7097. i,
  7098. n = l.describe()
  7099. if (
  7100. (n.tourIsPlaying || c.isWarping()
  7101. ? (Ce.tourControls.visible && (h.hide(), u.show()),
  7102. n.tourInProgress &&
  7103. (d.forEach(function (e) {
  7104. e.classList.add('playing')
  7105. }),
  7106. p.addClass('playing'),
  7107. f.addClass('playing')))
  7108. : (Ce.tourControls.visible && (h.show(), u.hide()),
  7109. n.tourInProgress ||
  7110. (q.stopTour(),
  7111. d.forEach(function (e) {
  7112. e.classList.remove('playing')
  7113. }),
  7114. p.removeClass('playing'),
  7115. f.removeClass('playing'))),
  7116. null !== n.currentItem)
  7117. ) {
  7118. var r, o
  7119. $('#status')
  7120. .find('.curIdx')
  7121. .text(n.currentItem[0] + 1),
  7122. n.onTheBus ? ((r = 'active'), (o = 'recent')) : ((o = 'active'), (r = 'recent'))
  7123. var a = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0]
  7124. for (e = 0; e < s.heroLocations.length; e += 1)
  7125. (i = g.eq(e)),
  7126. (t = m.eq(e)),
  7127. i.removeClass(o),
  7128. t.removeClass(o),
  7129. n.onTheBus && e === n.destinationItem[0]
  7130. ? (i.addClass(r),
  7131. t.addClass(r),
  7132. // 如果一段时间内用户不拖拽滚动scroll,才focus回这个item
  7133. Date.now() - lastMoveScrollTime > 2000 && w.activate(e))
  7134. : n.onTheBus && a && e === n.currentItem[0]
  7135. ? (i.addClass(r), t.addClass(r))
  7136. : (i.removeClass(r), t.removeClass(r))
  7137. } else for (e = 0; e < s.heroLocations.length; e += 1) (i = g.eq(e)), (t = m.eq(e)), i.removeClass('active recent'), t.removeClass('active recent')
  7138. v(l, c)
  7139. }),
  7140. document.addEventListener(
  7141. 'keydown',
  7142. function (e) {
  7143. switch ((R.updateInteraction(oe.InteractionKey), e.which)) {
  7144. case te.ZERO:
  7145. M.debug && s.toggleAlpha()
  7146. break
  7147. case te.NINE:
  7148. M.debug && B.toggle()
  7149. break
  7150. case te.ONE:
  7151. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA)
  7152. break
  7153. case te.TWO:
  7154. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE)
  7155. break
  7156. case te.THREE:
  7157. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN)
  7158. break
  7159. case te.FOUR:
  7160. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR)
  7161. break
  7162. case te.SPACE:
  7163. Ce.tourControls.visible && ($('#playHead').hasClass('playing') || _e('tour'))
  7164. break
  7165. case te.RETURN:
  7166. M.debug && s.toggleExplodeUp()
  7167. break
  7168. case te.P:
  7169. !(function (e) {
  7170. me.gui ||
  7171. (me.gui = (function (e) {
  7172. var t = new he.GUI()
  7173. return (
  7174. t
  7175. .add(M, 'showSweeps')
  7176. .name('Show sweeps')
  7177. .onFinishChange(function () {
  7178. e.setSweepVisibility(M.showSweeps)
  7179. }),
  7180. t.add(M, 'rotationAccelerationInside', 0.1, 10).name('Rotation speed').step(0.1),
  7181. t
  7182. .add(M.transition, 'flyTime', 0, 5e3)
  7183. .name('Transition time')
  7184. .onFinishChange(function () {
  7185. ;(M.transition.flySpeed = 0),
  7186. t.__controllers.forEach(function (e) {
  7187. e.updateDisplay()
  7188. })
  7189. }),
  7190. t.add(M.path, 'opacity', 0, 1).name('Path opacity'),
  7191. $(t.__closeButton).hide(),
  7192. t
  7193. )
  7194. })(me.model)),
  7195. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  7196. })(!me.visible)
  7197. break
  7198. case te.U:
  7199. !(function (e) {
  7200. ve.gui ||
  7201. (ve.gui = (function (t, i) {
  7202. function e() {
  7203. var e = i.toJSON()
  7204. ;(n.linkToLocation = window.location.protocol + '//' + window.location.host + window.location.pathname + '?m=' + t.sid + '&start=' + ee.serialize(e)),
  7205. i.tagManager.activeTag && (n.linkToLocation += '&tag=' + i.tagManager.activeTag.sid)
  7206. }
  7207. var n = {},
  7208. r = new he.GUI({
  7209. autoPlace: !0,
  7210. width: '60%'
  7211. })
  7212. return (
  7213. e(),
  7214. i.on(re.ViewChanged, e),
  7215. r.add(n, 'linkToLocation').name(se.LINK_TO_LOCATION).listen(),
  7216. (r.domElement.id = 'datLinks'),
  7217. [].slice.call(r.domElement.querySelectorAll('.property-name')).forEach(function (e) {
  7218. if (!S.detectSafari()) {
  7219. var t = document.createElement('button')
  7220. t.classList.add('btn-deep-link'), (t.innerText = se.MENU_COPY), e.nextSibling.appendChild(t)
  7221. var n = function () {
  7222. alert(se.LINK_ALERT_COPY), t.hide()
  7223. }
  7224. t.addEventListener('click', function (e) {
  7225. try {
  7226. var t = e.target.parentNode.childNodes[0]
  7227. t.select()
  7228. var i = document.execCommand('copy')
  7229. t.blur(), i || n()
  7230. } catch (e) {
  7231. n()
  7232. }
  7233. })
  7234. }
  7235. }),
  7236. $(r.__closeButton).hide(),
  7237. r
  7238. )
  7239. })(ve.model, ve.player)),
  7240. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  7241. })(!ve.visible)
  7242. break
  7243. case te.X:
  7244. M.debug && s.toggleExplode()
  7245. break
  7246. case te.PLUSEQUALS:
  7247. l.player.activatePersistentZooming(!0), O.hideUi()
  7248. break
  7249. case te.DASHUNDERSCORE:
  7250. l.player.activatePersistentZooming(!1), O.hideUi()
  7251. break
  7252. case te.SEVEN:
  7253. ue.info('Zoom level: ' + l.player.zoomLevel + ', FOV: ' + l.player.zoomFov)
  7254. break
  7255. case te.EIGHT:
  7256. l.player.decreaseZoomSpeed()
  7257. break
  7258. case te.NINE:
  7259. l.player.increaseZoomSpeed()
  7260. }
  7261. return c && c.reticule.hide(), !0
  7262. }.bind(this)
  7263. ),
  7264. document.addEventListener(
  7265. 'keyup',
  7266. function (e) {
  7267. switch (e.which) {
  7268. case te.PLUSEQUALS:
  7269. l.player.deactivatePersistentZooming()
  7270. break
  7271. case te.DASHUNDERSCORE:
  7272. l.player.deactivatePersistentZooming()
  7273. }
  7274. }.bind(this)
  7275. ),
  7276. (function (e) {
  7277. me = {
  7278. gui: null,
  7279. visible: !1,
  7280. model: e
  7281. }
  7282. })(s),
  7283. (function (e, t) {
  7284. ve = {
  7285. gui: null,
  7286. visible: !1,
  7287. model: e,
  7288. player: t
  7289. }
  7290. })(s, l.player),
  7291. (function (e) {
  7292. function t(e, i) {
  7293. $(e)
  7294. .find('a')
  7295. .each(function (e, t) {
  7296. i ? $(t).removeClass('buttonZoomDisabled').addClass('buttonZoomEnabled') : $(t).addClass('buttonZoomDisabled').removeClass('buttonZoomEnabled'),
  7297. (t.style.pointerEvents = i ? 'auto' : 'none')
  7298. })
  7299. }
  7300. e.on(de.ZoomMax, function () {
  7301. t('#gui-zoomin', !1), t('#gui-zoomout', !0)
  7302. }),
  7303. e.on(de.ZoomMin, function () {
  7304. t('#gui-zoomin', !0), t('#gui-zoomout', !1)
  7305. }),
  7306. e.on(de.ZoomIn, function () {
  7307. t('#gui-zoomout', !0)
  7308. }),
  7309. e.on(de.ZoomOut, function () {
  7310. t('#gui-zoomin', !0)
  7311. }),
  7312. e.zoomLevel >= M.zoom.max ? t('#gui-zoomin', !1) : t('#gui-zoomin', !0),
  7313. e.zoomLevel <= M.zoom.min ? t('#gui-zoomout', !1) : t('#gui-zoomout', !0)
  7314. })(c),
  7315. P.setAutoPlay(s.heroCount()),
  7316. U.init(c, i.mode),
  7317. U.on(H.OPENED, _e.bind(this, 'help')),
  7318. W.init(),
  7319. W.on(
  7320. j.OPENED,
  7321. ((o = document.getElementById('terms-modal')),
  7322. function () {
  7323. _e('terms'), V.open(o)
  7324. })
  7325. ),
  7326. W.on(j.CLOSED, V.reset),
  7327. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  7328. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  7329. M.profiling.enabled && B.show(),
  7330. q.init(l)
  7331. }),
  7332. (Le.exports.startLoading = function (e, t, i, n, r, o) {
  7333. function a() {
  7334. o.setLoadingStartTime(),
  7335. (function () {
  7336. function e(e) {
  7337. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  7338. }
  7339. $('body').css('touch-action', 'none'),
  7340. $('#gui-parent')
  7341. .find('*:not(#tag-billboards)')
  7342. .on('touchmove', function (e) {})
  7343. var t = document.getElementById('terms-text'),
  7344. i = document.getElementById('more-help-wrapper'),
  7345. n = (document.getElementById('navigation-help-wrapper'), document.getElementById('help-dialog'), document.getElementById('tag-billboards'))
  7346. M.useWheel &&
  7347. (document.body.addEventListener('mousewheel', e, {
  7348. passive: !1
  7349. }),
  7350. document.body.addEventListener('DOMMouseScroll', e)),
  7351. $('#terms-text, #more-help-wrapper, #navigation-help-wrapper')
  7352. .off('touchmove')
  7353. .on('touchmove', function (e) {
  7354. e.stopPropagation()
  7355. })
  7356. })(),
  7357. r
  7358. ? (D.showMessage(t, i, Ce.coBrand.visible), l())
  7359. : (function (e) {
  7360. L.show(e), c()
  7361. })(l)
  7362. }
  7363. var s = $.Deferred(),
  7364. l = s.resolve.bind(s)
  7365. ;(ye = !0), _(e)
  7366. e.data.player_options &&
  7367. (function (e) {
  7368. Ce.tourControls.visible = true //e.tour_buttons && S.valueFromHash("gt", 1),
  7369. ;(Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash('mls', !1)),
  7370. (Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights)
  7371. })(e.data.player_options),
  7372. 1 === M.specialEdition && $('body').addClass('specialEdition')
  7373. se.localizeGUI()
  7374. !(function (i) {
  7375. function e(e, t) {
  7376. return !!i.player_options[e] && i[t || e]
  7377. }
  7378. $('.model-title').text(i.name)
  7379. var t = M.pageTitle
  7380. 2 !== S.valueFromHash('mls', 0) && i.name && (t = i.name),
  7381. (document.title = t),
  7382. S.isMobile()
  7383. ? $('#gui-fullscreen').css('display', 'none')
  7384. : ($('[rel=tooltip]').tooltip({
  7385. delay: {
  7386. show: 50,
  7387. hide: 0
  7388. },
  7389. trigger: 'hover',
  7390. html: !1,
  7391. viewport: {
  7392. selector: 'body',
  7393. padding: 10
  7394. }
  7395. }),
  7396. S.inIframe() && document.getElementsByClassName('pinBottom-container')[0].classList.add('embed')),
  7397. z.populate({
  7398. name: e('model_name', 'name'),
  7399. coBrand: e('presented_by'),
  7400. description: e('model_summary', 'summary') || '暂无内容',
  7401. contactName: e('contact_name'),
  7402. address: e('address'),
  7403. phone: e('contact_phone'),
  7404. formattedPhone: i.formatted_contact_phone,
  7405. email: e('contact_email'),
  7406. url: e('external_url'),
  7407. socialSharing: i.enable_social_sharing && i.is_public
  7408. })
  7409. })(e.data)
  7410. r || $('.quick').addClass('hidden')
  7411. n ? (R.impression(), a()) : (o.setWaitingStartTime(), N.show(r, a))
  7412. return s
  7413. }),
  7414. (Le.exports.endLoading = function (e, t, i) {
  7415. var n = t.player
  7416. function r() {
  7417. i.dismissExaminedTag(), i.disableHovering()
  7418. }
  7419. $('#gui-thumb').fadeOut(2500),
  7420. L.hide(function () {
  7421. ye = !1
  7422. }),
  7423. Y.init(e, i),
  7424. z.finishSetup(Object.keys(e.tags).length),
  7425. i.on(ne.IMAGE_OPENED, _e.bind(this, 'tag')),
  7426. X.on(Z.OPENED, r),
  7427. K.on(ae.OPENED, r),
  7428. U.on(H.OPENED, r),
  7429. W.on(j.OPENED, r)
  7430. var o = i.enableHovering.bind(i)
  7431. if (
  7432. (X.on(Z.CLOSED, o),
  7433. K.on(ae.CLOSED, o),
  7434. U.on(H.CLOSED, o),
  7435. W.on(j.CLOSED, o),
  7436. M.labels.enabled && Object.keys(e.labels).length,
  7437. e.floors.length <= 1 || !Ce.floors.visible ? (Ce.floors.visible = !1) : (h(e, t), I(e.currentFloor, n.mode)),
  7438. '372' === getQueryVariable('m') && ((Ce.floors.visible = 1), h(e, t)),
  7439. c(),
  7440. v(t, t.player),
  7441. $('#gui').fadeIn(1500),
  7442. Ce.highlight.visible &&
  7443. (2 !== M.startHighlights || e.has360Views) &&
  7444. setTimeout(function () {
  7445. l(), ((!e.has360Views && 1 !== M.startHighlights) || (e.has360Views && 0 === M.startHighlights)) && setTimeout(l, 2e3)
  7446. }, 2e3),
  7447. !S.isMobile())
  7448. )
  7449. for (var a = ['a', '#title-toggle', '.next-button', '.prev-button', '.gui-floor', '.meta-toggle', '.thumbImg', 'logo-button'], s = 0; s < a.length; s++) $(a[s]).addClass('hasHover')
  7450. _(e),
  7451. z.setupToggling(),
  7452. window.editHotPanel && editHotPanel(),
  7453. (function () {
  7454. var i = $('#pullTab'),
  7455. e = {
  7456. bottom: {
  7457. 'border-bottom-left-radius': '10px',
  7458. 'border-bottom-right-radius': '10px'
  7459. },
  7460. top: {
  7461. 'border-top-left-radius': '10px',
  7462. 'border-top-right-radius': '10px'
  7463. }
  7464. },
  7465. t = {
  7466. bottom: {
  7467. 'border-top-right-radius': '10px',
  7468. 'border-bottom-right-radius': '10px'
  7469. },
  7470. top: {
  7471. 'border-bottom-left-radius': '10px',
  7472. 'border-top-left-radius': '10px'
  7473. }
  7474. }
  7475. function n(e, t) {
  7476. $('#gui-modes-map > div:visible:last').css(e), i.is(':visible') ? $('.viewContainer > div:visible:first').css(t) : $('#gui-modes-map > div:visible:first').css(t)
  7477. }
  7478. ;/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top)
  7479. ;(window.DATA.model.special || 'true' === window.DATA.special) && window.specialScene && specialScene.special().afterImplement()
  7480. })()
  7481. $('.toolRight a').removeClass('hasHover')
  7482. }),
  7483. (Le.exports.onProgress = function (e) {
  7484. L.progress(e)
  7485. })
  7486. }).call(this, '/js/gui/gui.js')
  7487. },
  7488. {
  7489. '../analytics': 4,
  7490. '../controls/serializer': 14,
  7491. '../enum/AlignmentType': 17,
  7492. '../enum/BlackoutStyle': 18,
  7493. '../enum/ControlEvents': 21,
  7494. '../enum/DirectorEvents': 23,
  7495. '../enum/Keys': 30,
  7496. '../enum/PathDiscardMode': 38,
  7497. '../enum/PathDisplayMode': 39,
  7498. '../enum/PlayerEvents': 40,
  7499. '../enum/VROption': 47,
  7500. '../enum/Vectors': 50,
  7501. '../enum/Viewmode': 51,
  7502. '../enum/WarpStyle': 52,
  7503. '../enum/ZoomEvents': 53,
  7504. '../lib/dat.gui': 93,
  7505. '../localization/localize': 108,
  7506. '../tag/Media/MediaEvent': 131,
  7507. '../objects/Snapshot': 153,
  7508. '../settings': 166,
  7509. '../util/ajax': 181,
  7510. '../util/browser': 182,
  7511. '../util/camera': 183,
  7512. '../util/logger': 189,
  7513. '../util/showcase': 193,
  7514. '../util/transitions': 195,
  7515. './closer/ModalCloserEvent': 61,
  7516. './closer/modalCloser': 62,
  7517. './help/HelpEvent': 66,
  7518. './help/help': 67,
  7519. './helpManager': 68,
  7520. './immersiveMode': 69,
  7521. './konami': 70,
  7522. './landingScreen': 71,
  7523. './loadingScreen': 72,
  7524. './memoryUsage': 73,
  7525. './playButton': 74,
  7526. './populateModal': 75,
  7527. './sharing/ShareEvents': 76,
  7528. './sharing/modal': 77,
  7529. './terms/TermsEvent': 78,
  7530. './terms/terms': 79,
  7531. './title/TitleEvents': 80,
  7532. './title/tagToggle': 81,
  7533. './title/titleBar': 82,
  7534. './tourInteraction': 84,
  7535. './vr/vrEvent': 85,
  7536. './vr/vrModal': 87,
  7537. './webvr/WebVrEvent': 88,
  7538. './webvr/webVRgui': 89,
  7539. three: 217
  7540. }
  7541. ],
  7542. 66: [
  7543. function (e, t, i) {
  7544. 'use strict'
  7545. t.exports = Object.freeze({
  7546. OPENED: 'help.opened',
  7547. CLOSED: 'help.closed'
  7548. })
  7549. },
  7550. {}
  7551. ],
  7552. 67: [
  7553. function (e, t, i) {
  7554. 'use strict'
  7555. function n() {
  7556. p.on('click', function (e) {
  7557. T &&
  7558. T !== a.TRANSITIONING &&
  7559. (0 < window.getComputedStyle(v).getPropertyValue('opacity') && !x
  7560. ? S.close()
  7561. : T &&
  7562. T !== a.TRANSITIONING &&
  7563. ((x = !0),
  7564. setTimeout(function () {
  7565. x = !1
  7566. }, h.help.modalStayDuration),
  7567. S.emit(l.OPENED),
  7568. f.addClass('open ' + T),
  7569. p.addClass('open'),
  7570. o(),
  7571. r(),
  7572. v.style.removeProperty ? v.style.removeProperty('display') : v.style.removeAttribute('display'),
  7573. v.classList.add('fadeIn')))
  7574. }),
  7575. E.on('click', function (e) {
  7576. S.close()
  7577. }),
  7578. C.on('click', function (e) {
  7579. T && T !== a.TRANSITIONING && (o(), r())
  7580. }),
  7581. I.on('click', function (e) {
  7582. o(), I.addClass('underline-tab'), c.fill(b, s.MORE_HELP), f.addClass('more-help')
  7583. })
  7584. }
  7585. function r() {
  7586. C.addClass('underline-tab'), c.fill(_, s.NAVIGATION, T), f.addClass(T)
  7587. }
  7588. function o() {
  7589. f.removeClass('more-help ' + a.PANORAMA + ' ' + a.DOLLHOUSE + ' ' + a.FLOORPLAN + ' ' + a.OUTDOOR),
  7590. A.forEach(function (e) {
  7591. e.classList.remove('underline-tab')
  7592. })
  7593. }
  7594. var a = e('../../enum/Viewmode'),
  7595. s = e('../../enum/HelpModalType'),
  7596. l = e('./HelpEvent'),
  7597. c = (e('../helpManager'), e('./../populateModal')),
  7598. h = e('../../settings'),
  7599. u = e('../../util/common'),
  7600. d = e('events').EventEmitter,
  7601. p = $('.footer-help').eq(0),
  7602. f = $('#help-dialog').eq(0),
  7603. g = document.querySelector('#quick-logo'),
  7604. m = document.querySelector('#loaderCoBrand'),
  7605. v = document.querySelector('#help-dialog'),
  7606. y = document.querySelector('.footer'),
  7607. A = $('.help-tabs').children().toArray(),
  7608. C = $('.navigation-tab').eq(0),
  7609. I = $('.more-help-tab').eq(0),
  7610. E = ($('#interaction-modal').eq(0).find('.interaction').toArray(), f.find('.close').eq(0)),
  7611. _ = f.find('.interactions').toArray(),
  7612. b = f.find('.ui-instructions').toArray(),
  7613. w = a.PANORAMA,
  7614. T = a.PANORAMA,
  7615. x = !1,
  7616. S = {
  7617. init: function (e, t) {
  7618. ;(w = T = t),
  7619. [v, m, g, y].forEach(function (e) {
  7620. e.classList.add(c.deviceType)
  7621. }),
  7622. n()
  7623. },
  7624. close: function () {
  7625. if (f.hasClass('open') && (this.emit(l.CLOSED), p.removeClass('open'), f.removeClass('open'), v.classList.contains('fadeIn'))) {
  7626. v.classList.remove('fadeIn')
  7627. var e = T === a.TRANSITIONING ? w : T
  7628. c.clear(_, s.NAVIGATION, e)
  7629. }
  7630. },
  7631. updateMode: function (e) {
  7632. ;(w = T), (T = e)
  7633. }
  7634. }
  7635. u.extendObject(S, d.prototype), (t.exports = S)
  7636. },
  7637. {
  7638. '../../enum/HelpModalType': 28,
  7639. '../../enum/Viewmode': 51,
  7640. '../../settings': 166,
  7641. '../../util/common': 185,
  7642. '../helpManager': 68,
  7643. './../populateModal': 75,
  7644. './HelpEvent': 66,
  7645. events: 202
  7646. }
  7647. ],
  7648. 68: [
  7649. function (s, l, e) {
  7650. ;(function (e) {
  7651. 'use strict'
  7652. var t = s('../util/browser'),
  7653. i = s('./../util/logger'),
  7654. n = s('./../settings'),
  7655. r = new i(e),
  7656. o = (function () {
  7657. var t
  7658. try {
  7659. return (t = window.localStorage.getItem('visitCount') || '0'), (t = (parseFloat(t) + 1).toString()), window.localStorage.setItem('visitCount', t), r.debug('visitCount = ' + t), t
  7660. } catch (e) {
  7661. ;(t = '1'), r.debug("couldn't set local storage")
  7662. }
  7663. })(),
  7664. a = !1
  7665. l.exports = {
  7666. isHelpDisabled: function () {
  7667. return '0' === t.valueFromHash('help', null) || a
  7668. },
  7669. isLargeHelpEnabled: function () {
  7670. return ('1' === o || '1' === t.valueFromHash('help', null)) && !this.isHelpDisabled()
  7671. },
  7672. isSmallHelpEnabled: function () {
  7673. return '2' === t.valueFromHash('help', null) && !this.isHelpDisabled()
  7674. },
  7675. isHelpEnabled: function () {
  7676. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7677. },
  7678. setAutoPlay: function (e) {
  7679. a = 0 <= n.warp.auto && 1 < e
  7680. }
  7681. }
  7682. }).call(this, '/js/gui/helpManager.js')
  7683. },
  7684. {
  7685. '../util/browser': 182,
  7686. './../settings': 166,
  7687. './../util/logger': 189
  7688. }
  7689. ],
  7690. 69: [
  7691. function (e, t, i) {
  7692. 'use strict'
  7693. function r(e) {
  7694. M ||
  7695. (n(e) && C.hasClass('playing')) ||
  7696. (clearTimeout(x),
  7697. (T = !0),
  7698. h.close(),
  7699. (function (e) {
  7700. !n(e) && S
  7701. ? v.forEach(function (e) {
  7702. e.classList.remove('drawerOpen'), e.classList.add('duringTour')
  7703. })
  7704. : C.hasClass('open')
  7705. ? v.forEach(function (e) {
  7706. e.classList.remove('duringTour'), e.classList.add('drawerOpen')
  7707. })
  7708. : P ||
  7709. R === g.FLOORPLAN ||
  7710. R === g.DOLLHOUSE ||
  7711. v.forEach(function (e) {
  7712. e.classList.add('fadeOut')
  7713. })
  7714. })(e),
  7715. R !== g.DOLLHOUSE &&
  7716. R !== g.FLOORPLAN &&
  7717. ((E.hasClass('expand') && !_.hasClass('closed')) || l.valueFromHash('title', 1),
  7718. C.hasClass('playing') ||
  7719. (y.forEach(function (e) {
  7720. e.classList.add('detectHover')
  7721. }),
  7722. (x = setTimeout(a, c.immersive.timeToShowAgain)))))
  7723. }
  7724. function o() {
  7725. C.hasClass('playing') || (clearTimeout(x), (x = setTimeout(a, c.immersive.timeToShowAgain)))
  7726. }
  7727. function a() {
  7728. clearTimeout(x),
  7729. (T = !1),
  7730. m.forEach(function (e) {
  7731. e.classList.remove('drawerOpen')
  7732. }),
  7733. S ||
  7734. v.forEach(function (e) {
  7735. e.classList.remove('duringTour')
  7736. }),
  7737. y.forEach(function (e) {
  7738. e.classList.remove('detectHover')
  7739. })
  7740. }
  7741. function s() {
  7742. T ? a() : r(),
  7743. (M = !0),
  7744. setTimeout(function () {
  7745. M = !1
  7746. }, c.immersive.uiStayDuration)
  7747. }
  7748. function n(e) {
  7749. return 'mouse' === e || 'touch' === e || 'key' === e || 'gui' === e
  7750. }
  7751. var l = e('../util/browser'),
  7752. c = e('../settings'),
  7753. h = e('./help/help'),
  7754. u = e('../enum/tagEvents'),
  7755. d = e('../enum/ControlEvents'),
  7756. p = e('../enum/PlayerEvents'),
  7757. f = e('../enum/DirectorEvents'),
  7758. g = ((p = e('../enum/PlayerEvents')), e('../enum/Viewmode')),
  7759. m = $('.pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer').toArray(),
  7760. v = $('.pinBottom-container, #drawer-container, .footer').toArray(),
  7761. y = $('#hover-bottom, #hover-top').toArray(),
  7762. A = ($('#pullTab').eq(0), $('#playHead').eq(0), $('.pinBottom-container').eq(0)),
  7763. C = $('#drawer').eq(0),
  7764. I = $('#drawer-container').eq(0),
  7765. E = $('#meta-info').eq(0),
  7766. _ = $('.pinTop.left').eq(0),
  7767. b = $('#player').eq(0),
  7768. w = document.getElementById('pullTab'),
  7769. T = !1,
  7770. x = null,
  7771. S = !1,
  7772. M = !1,
  7773. R = null,
  7774. P = !1
  7775. ;(t.exports.init = function (e, t, i, n) {
  7776. ;(function (t, i, e, n) {
  7777. ;[g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function (e) {
  7778. t.controls[e].on(d.Move, r), t.controls[e].on(d.LongTap, s)
  7779. }),
  7780. b.on('mousewheel DOMMouseScroll', r),
  7781. e.on(u.TagActivated, r),
  7782. e.on(u.TagNavigation, r),
  7783. i.on(p.FlyingEnded, o),
  7784. i.on(p.ModeChanging, function (e, t) {
  7785. P = t !== g.PANORAMA && e !== g.PANORAMA
  7786. }),
  7787. i.on(p.ModeChanged, function (e, t) {
  7788. ;(R = i.mode), t !== g.TRANSITIONING ? a() : r('modeChange')
  7789. }),
  7790. n.on(f.TourStart, function () {
  7791. ;(S = !0), r()
  7792. }),
  7793. n.on(f.TourEnd, function () {
  7794. ;(S = !1), a()
  7795. }),
  7796. n.on(f.ActionInterrupted, function () {
  7797. S = !1
  7798. }),
  7799. w.addEventListener(
  7800. 'touchend',
  7801. function () {
  7802. $('#pullTab').hasClass('opened') && !S && a()
  7803. },
  7804. !0
  7805. )
  7806. })(e, t, i, n),
  7807. l.isMobile()
  7808. ? (y.forEach(function (e) {
  7809. e.classList.add('mobile')
  7810. }),
  7811. A.click(a))
  7812. : (y.forEach(function (e) {
  7813. e.addEventListener(
  7814. 'mouseleave',
  7815. function () {
  7816. !b.is(':hover') && y[0].classList.contains('detectHover') && a()
  7817. },
  7818. !0
  7819. )
  7820. }),
  7821. b.mouseleave(function () {
  7822. y[0].classList.contains('detectHover') && a()
  7823. })),
  7824. (R = t.mode)
  7825. }),
  7826. (t.exports.hideUi = r),
  7827. (t.exports.resetDrawer = function () {
  7828. I.hasClass('duringTour') || ((S = !1), r('gui'), a())
  7829. })
  7830. },
  7831. {
  7832. '../enum/ControlEvents': 21,
  7833. '../enum/DirectorEvents': 23,
  7834. '../enum/tagEvents': 32,
  7835. '../enum/PlayerEvents': 40,
  7836. '../enum/Viewmode': 51,
  7837. '../settings': 166,
  7838. '../util/browser': 182,
  7839. './help/help': 67
  7840. }
  7841. ],
  7842. 70: [
  7843. function (i, n, e) {
  7844. ;(function (e) {
  7845. 'use strict'
  7846. var t = i('./../util/logger'),
  7847. o = i('./../settings'),
  7848. a = i('./debug'),
  7849. s = i('./../util/common'),
  7850. l = (i('./gui'), new t(e))
  7851. o.console && $('body').append('<div id="debug-console"></div>'),
  7852. (n.exports.init = function (i, n, r) {
  7853. l.debug('konami has the modelInstance')
  7854. var t = []
  7855. $(window).on('keydown', function (e) {
  7856. t.push(e.which), t.length > o.secretPanelWord.length && t.shift(), s.equalLists(t, o.secretPanelWord) && (l.debug('Developer mode active.'), (o.debug = !0))
  7857. }),
  7858. $(window).on('keydown', function e(t) {
  7859. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r), $(window).off('keydown', e)) : console.warn("sorry we're not ready yet"))
  7860. })
  7861. })
  7862. }).call(this, '/js/gui/konami.js')
  7863. },
  7864. {
  7865. './../settings': 166,
  7866. './../util/common': 185,
  7867. './../util/logger': 189,
  7868. './debug': 63,
  7869. './gui': 65
  7870. }
  7871. ],
  7872. 71: [
  7873. function (e, t, i) {
  7874. 'use strict'
  7875. function r() {
  7876. s.clear(m, l.LANDING[v]), g.removeClass('fadeIn')
  7877. }
  7878. var o = e('../settings'),
  7879. a = (e('./help/help'), e('./helpManager')),
  7880. s = e('./populateModal'),
  7881. l = e('../enum/HelpModalType'),
  7882. n = e('../enum/Viewmode'),
  7883. c = e('../enum/DirectorEvents'),
  7884. h = e('../enum/PlayerEvents'),
  7885. u = $('#quick-blackout').eq(0),
  7886. d = $('#quick-logo').eq(0),
  7887. p = $('.quick-brand').toArray(),
  7888. f = $('#loaderCoBrand').eq(0),
  7889. g = $('#interaction-modal').eq(0),
  7890. m = g.find('.interaction').toArray(),
  7891. v = ($('#model-title, .pinBottom-container, #drawer-container, #drawer, .footer').toArray(), '')
  7892. ;(t.exports.delayLanding = function (e) {
  7893. var t = $.Deferred()
  7894. e || t.resolve()
  7895. var i = o.startupFlyinDelay
  7896. return e === n.PANORAMA && (i += o.dollhouse.transitionTime), setTimeout(t.resolve.bind(t), i), t
  7897. }),
  7898. (t.exports.showMessage = function (e, t, i) {
  7899. var n = 0
  7900. o.quickstart.enabled &&
  7901. ((function (e) {
  7902. /* e && (f.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7903. d.before(f),
  7904. p = $(".quick-brand").toArray()), */
  7905. u.addClass('fadeOut')
  7906. /* setTimeout(function() {
  7907. p.forEach(function(e) {
  7908. e.classList.add("fadeIn")
  7909. })
  7910. }, o.quickstart.showTextDelay),
  7911. setTimeout(function() {
  7912. p.forEach(function(e) {
  7913. e.classList.add("fadeOut")
  7914. })
  7915. }, o.quickstart.fadeOutDelay) */
  7916. })(i),
  7917. (n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay)),
  7918. (function (e, t) {
  7919. setTimeout(function () {
  7920. if (a.isHelpEnabled()) {
  7921. if ((t(), s.init(), g.addClass('fadeIn landing ' + s.deviceType), a.isSmallHelpEnabled())) return void g.addClass('small')
  7922. s.fill(m, l.LANDING[v]), g.addClass(v)
  7923. }
  7924. }, e)
  7925. var i = {
  7926. pc: ['images/pc_step1.png', 'images/pc_step2.png', 'images/pc_step3.png'],
  7927. mobile: ['images/phone_step1.png', 'images/phone_step2.png', 'images/phone_step3.png']
  7928. },
  7929. n = $('.nav-icon .icon')
  7930. ;/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr('src', i.mobile[0])
  7931. function r(e) {
  7932. e.on('click', function () {
  7933. var e = null
  7934. if (((e = 'plus' == $(this).attr('data-id') ? +n.attr('data-page') + 1 : +n.attr('data-page') - 1), i.length < e || e < 1)) return !1
  7935. ;/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)
  7936. ? n.attr({
  7937. 'data-page': e,
  7938. src: i.mobile[e - 1]
  7939. })
  7940. : n.attr({
  7941. 'data-page': e,
  7942. src: i.pc[e - 1]
  7943. })
  7944. })
  7945. }
  7946. r($('.next-button')), r($('.prev-button'))
  7947. })(n, function () {
  7948. e.once(h.Move, r), t.once(c.TourStart, r)
  7949. })
  7950. }),
  7951. (t.exports.init = function (e, t) {
  7952. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7953. }),
  7954. (t.exports.dismissModal = r)
  7955. },
  7956. {
  7957. '../enum/DirectorEvents': 23,
  7958. '../enum/HelpModalType': 28,
  7959. '../enum/PlayerEvents': 40,
  7960. '../enum/Viewmode': 51,
  7961. '../settings': 166,
  7962. './help/help': 67,
  7963. './helpManager': 68,
  7964. './populateModal': 75
  7965. }
  7966. ],
  7967. 72: [
  7968. function (e, t, i) {
  7969. 'use strict'
  7970. var n = e('./circleLoader').circleLoader
  7971. t.exports = {
  7972. element: $('#gui-loading'),
  7973. hide: function (e) {
  7974. n.done(), this.element.fadeOut(1500, e)
  7975. },
  7976. show: function (e) {
  7977. this.element.fadeIn(
  7978. 500,
  7979. function () {
  7980. this.element.css('display', 'table'), e && e()
  7981. }.bind(this)
  7982. )
  7983. },
  7984. progress: function (e) {
  7985. n.set(e)
  7986. }
  7987. }
  7988. },
  7989. {
  7990. './circleLoader': 60
  7991. }
  7992. ],
  7993. 73: [
  7994. function (e, t, i) {
  7995. 'use strict'
  7996. var n = e('../settings'),
  7997. r = $('#memory-info'),
  7998. o = r.find('#memory-gpu'),
  7999. a = !1
  8000. t.exports = {
  8001. show: function () {
  8002. n.profiling.enabled && (r.show(), (a = !0))
  8003. },
  8004. hide: function () {
  8005. r.hide(), (a = !1)
  8006. },
  8007. toggle: function () {
  8008. a ? this.hide() : this.show()
  8009. },
  8010. update: function (e) {
  8011. n.profiling.enabled && o.text(Math.floor(e / 1e6) + 'MB')
  8012. }
  8013. }
  8014. },
  8015. {
  8016. '../settings': 166
  8017. }
  8018. ],
  8019. 74: [
  8020. function (e, t, i) {
  8021. 'use strict'
  8022. e('../util/browser'), e('../analytics')
  8023. e('../settings'),
  8024. (t.exports = {
  8025. show: function (e, t) {
  8026. $('#gui-message').fadeOut(500, function () {
  8027. t()
  8028. })
  8029. }
  8030. })
  8031. },
  8032. {
  8033. '../analytics': 4,
  8034. '../settings': 166,
  8035. '../util/browser': 182
  8036. }
  8037. ],
  8038. 75: [
  8039. function (e, t, i) {
  8040. 'use strict'
  8041. function n(e, t, i, n) {
  8042. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  8043. }
  8044. var r = e('../util/browser'),
  8045. o = e('../localization/localize'),
  8046. a = e('../enum/HelpModalType'),
  8047. s = (e('../enum/HelpModalSize'), e('../enum/Viewmode'))
  8048. t.exports = {
  8049. init: function () {
  8050. if (!this.hasInitialized) {
  8051. ;(this.hasInitialized = !0),
  8052. (this.deviceType = r.isMobile() ? 'mobile' : 'desktop'),
  8053. (this.assets = {}),
  8054. (this.assets[a.LANDING[s.PANORAMA]] = {
  8055. desktop: {
  8056. left: {
  8057. 'top-info': o.ROTATE,
  8058. 'big-image': 'images/nav_help_mouse_drag_left.png',
  8059. keyboard: 'images/nav_help_keyboard_left_right.png'
  8060. },
  8061. middle: {
  8062. 'top-info': o.MOVE,
  8063. 'big-image': 'images/nav_help_mouse_click.png',
  8064. keyboard: 'images/nav_help_keyboard_up_down.png'
  8065. },
  8066. right: {
  8067. 'top-info': o.ZOOM,
  8068. 'big-image': 'images/nav_help_mouse_zoom.png',
  8069. keyboard: 'images/nav_help_zoom_keys.png'
  8070. }
  8071. },
  8072. mobile: {
  8073. left: {
  8074. 'top-info': o.ROTATE,
  8075. 'big-image': 'images/nav_help_gesture_drag.png'
  8076. },
  8077. middle: {
  8078. 'top-info': o.MOVE,
  8079. 'big-image': 'images/nav_help_gesture_tap.png'
  8080. },
  8081. right: {
  8082. 'top-info': o.ZOOM,
  8083. 'big-image': 'images/nav_help_gesture_pinch.png'
  8084. }
  8085. }
  8086. }),
  8087. (this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]]))),
  8088. (this.assets[a.LANDING[s.DOLLHOUSE]] = {
  8089. desktop: {
  8090. left: {
  8091. 'top-info': o.ROTATE,
  8092. 'big-image': 'images/nav_help_mouse_drag_left.png',
  8093. keyboard: 'images/nav_help_keyboard_left_right.png'
  8094. },
  8095. middle: {
  8096. 'top-info': o.MOVE,
  8097. 'big-image': 'images/nav_help_mouse_position_right.png'
  8098. }
  8099. },
  8100. mobile: {
  8101. left: {
  8102. 'top-info': o.ROTATE,
  8103. 'big-image': 'images/nav_help_gesture_drag.png'
  8104. },
  8105. middle: {
  8106. 'top-info': o.MOVE,
  8107. 'big-image': 'images/nav_help_gesture_position_two_finger.png'
  8108. }
  8109. }
  8110. }),
  8111. (this.assets[a.LANDING[s.FLOORPLAN]] = {
  8112. desktop: {
  8113. left: {
  8114. 'top-info': o.MOVE,
  8115. 'big-image': 'images/nav_help_mouse_position_left.png'
  8116. },
  8117. middle: {
  8118. 'top-info': o.ROTATE,
  8119. 'big-image': 'images/nav_help_mouse_drag_right.png',
  8120. keyboard: 'images/nav_help_keyboard_left_right.png'
  8121. }
  8122. },
  8123. mobile: {
  8124. left: {
  8125. 'top-info': o.MOVE,
  8126. 'big-image': 'images/nav_help_gesture_position.png'
  8127. },
  8128. middle: {
  8129. 'top-info': o.ROTATE,
  8130. 'big-image': 'images/nav_help_gesture_drag_two_finger.png'
  8131. }
  8132. }
  8133. })
  8134. var e = {
  8135. 'top-info': o.INSIDE,
  8136. 'big-image': 'images/nav_help_click_inside.png',
  8137. keyboard: 'images/nav_help_inside_key.png'
  8138. }
  8139. ;(this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e), (this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e), (this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e)
  8140. var t = {
  8141. 'top-info': o.INSIDE,
  8142. 'big-image': 'images/nav_help_tap_inside.png'
  8143. }
  8144. ;(this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t),
  8145. (this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t),
  8146. (this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t),
  8147. (this.assets[a.NAVIGATION] = {}),
  8148. (this.assets[a.NAVIGATION][s.PANORAMA] = {
  8149. desktop: {
  8150. left: {
  8151. 'top-info': o.HELP_DESKTOP_PANORAMA_1A,
  8152. 'bottom-info': o.HELP_DESKTOP_PANORAMA_1B,
  8153. 'big-image': 'images/nav_help_mouse_drag_left.png',
  8154. keyboard: 'images/nav_help_keyboard_left_right.png'
  8155. },
  8156. middle: {
  8157. 'top-info': o.HELP_DESKTOP_PANORAMA_2A,
  8158. 'bottom-info': o.HELP_DESKTOP_PANORAMA_2B,
  8159. 'big-image': 'images/nav_help_mouse_click.png',
  8160. keyboard: 'images/nav_help_keyboard_up_down.png'
  8161. },
  8162. right: {
  8163. 'top-info': o.HELP_DESKTOP_PANORAMA_3A,
  8164. 'bottom-info': o.HELP_DESKTOP_PANORAMA_3B,
  8165. 'big-image': 'images/nav_help_mouse_zoom.png',
  8166. keyboard: 'images/nav_help_zoom_keys.png'
  8167. }
  8168. },
  8169. mobile: {
  8170. left: {
  8171. 'top-info': o.HELP_MOBILE_PANORAMA_1,
  8172. 'big-image': 'images/nav_help_gesture_drag.png'
  8173. },
  8174. middle: {
  8175. 'top-info': o.HELP_MOBILE_PANORAMA_2,
  8176. 'big-image': 'images/nav_help_gesture_tap.png'
  8177. },
  8178. right: {
  8179. 'top-info': o.HELP_MOBILE_3,
  8180. 'big-image': 'images/nav_help_gesture_pinch.png'
  8181. }
  8182. }
  8183. }),
  8184. (this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  8185. desktop: {
  8186. left: {
  8187. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_1A,
  8188. 'bottom-info': o.HELP_DESKTOP_DOLLHOUSE_1B,
  8189. 'big-image': 'images/nav_help_mouse_drag_left.png',
  8190. keyboard: 'images/nav_help_keyboard_all.png'
  8191. },
  8192. middle: {
  8193. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_2A,
  8194. 'big-image': 'images/nav_help_mouse_position_right.png'
  8195. },
  8196. right: {
  8197. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_3A,
  8198. 'big-image': 'images/nav_help_mouse_zoom.png'
  8199. }
  8200. },
  8201. mobile: {
  8202. left: {
  8203. 'top-info': o.HELP_MOBILE_DOLLHOUSE_1,
  8204. 'big-image': 'images/nav_help_gesture_drag.png'
  8205. },
  8206. middle: {
  8207. 'top-info': o.HELP_MOBILE_DOLLHOUSE_2,
  8208. 'big-image': 'images/nav_help_gesture_position_two_finger.png'
  8209. },
  8210. right: {
  8211. 'top-info': o.HELP_MOBILE_3,
  8212. 'big-image': 'images/nav_help_gesture_pinch.png'
  8213. }
  8214. }
  8215. }),
  8216. (this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8217. desktop: {
  8218. left: {
  8219. 'top-info': o.HELP_DESKTOP_FLOORPLAN_1A,
  8220. 'big-image': 'images/nav_help_mouse_position_left.png'
  8221. },
  8222. middle: {
  8223. 'top-info': o.HELP_DESKTOP_FLOORPLAN_2A,
  8224. 'bottom-info': o.HELP_DESKTOP_FLOORPLAN_2B,
  8225. 'big-image': 'images/nav_help_mouse_drag_right.png',
  8226. keyboard: 'images/nav_help_keyboard_left_right.png'
  8227. },
  8228. right: {
  8229. 'top-info': o.HELP_DESKTOP_FLOORPLAN_3A,
  8230. 'bottom-info': o.HELP_DESKTOP_FLOORPLAN_3B,
  8231. 'big-image': 'images/nav_help_mouse_zoom.png',
  8232. keyboard: 'images/nav_help_keyboard_up_down.png'
  8233. }
  8234. },
  8235. mobile: {
  8236. left: {
  8237. 'top-info': o.HELP_MOBILE_FLOORPLAN_1,
  8238. 'big-image': 'images/nav_help_gesture_position.png'
  8239. },
  8240. middle: {
  8241. 'top-info': o.HELP_MOBILE_FLOORPLAN_2,
  8242. 'big-image': 'images/nav_help_gesture_drag_two_finger.png'
  8243. },
  8244. right: {
  8245. 'top-info': o.HELP_MOBILE_3,
  8246. 'big-image': 'images/nav_help_gesture_pinch.png'
  8247. }
  8248. }
  8249. }),
  8250. (this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA]))),
  8251. (this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8252. 'top-info': o.HELP_DESKTOP_360_2A,
  8253. 'bottom-info': o.HELP_DESKTOP_360_2B,
  8254. 'big-image': 'images/nav_help_click_inside.png',
  8255. keyboard: 'images/nav_help_inside_key.png'
  8256. }),
  8257. (this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8258. 'top-info': o.HELP_MOBILE_360_2,
  8259. 'big-image': 'images/nav_help_tap_inside.png'
  8260. }),
  8261. (this.assets[a.MORE_HELP] = {
  8262. desktop: {
  8263. 'more-help-hlr': {
  8264. 'top-info': o.HELP_MORE_HLR_A,
  8265. 'big-image': 'images/nav_help_expand.svg',
  8266. 'bottom-info': o.HELP_DESKTOP_MORE_HLR_B
  8267. },
  8268. 'more-help-dollhouse': {
  8269. 'top-info': o.HELP_MORE_DOLLHOUSE_A,
  8270. 'big-image': 'images/nav_help_dollhouse.svg',
  8271. 'bottom-info': o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8272. },
  8273. 'more-help-floors': {
  8274. 'top-info': o.HELP_MORE_FLOORS_A,
  8275. 'big-image': 'images/nav_help_floor picker.svg',
  8276. 'bottom-info': o.HELP_DESKTOP_MORE_FLOORS_B
  8277. },
  8278. 'more-help-tag': {
  8279. 'top-info': o.HELP_MORE_TAG_A,
  8280. 'big-image': 'images/nav_help_tag.svg',
  8281. 'bottom-info': o.HELP_DESKTOP_MORE_TAG_B
  8282. },
  8283. 'more-help-zoom': {
  8284. 'top-info': o.HELP_MORE_ZOOM_A,
  8285. 'big-image': 'images/nav_help_zoom.svg',
  8286. 'bottom-info': o.HELP_DESKTOP_MORE_ZOOM_B
  8287. },
  8288. 'more-help-tour': {
  8289. 'top-info': o.HELP_MORE_TOUR_A,
  8290. 'big-image': 'images/nav_help_play.png',
  8291. 'bottom-info': o.HELP_DESKTOP_MORE_TOUR_B
  8292. },
  8293. 'more-help-inside': {
  8294. 'top-info': o.HELP_MORE_INSIDE_A,
  8295. 'big-image': 'images/nav_help_inside.svg',
  8296. 'bottom-info': o.HELP_DESKTOP_MORE_INSIDE_B
  8297. },
  8298. 'more-help-vr': {
  8299. 'top-info': o.HELP_MORE_VR_A,
  8300. 'big-image': 'images/nav_help_vr.svg',
  8301. 'bottom-info': o.HELP_DESKTOP_MORE_VR_B
  8302. },
  8303. 'more-help-360': {
  8304. 'top-info': o.HELP_MORE_360_A,
  8305. 'big-image': 'images/nav_help_360.svg',
  8306. 'bottom-info': o.HELP_DESKTOP_MORE_360_B
  8307. },
  8308. 'more-help-fullscreen': {
  8309. 'top-info': o.HELP_MORE_FULLSCREEN_A,
  8310. 'big-image': 'images/nav_help_fullscreen.svg',
  8311. 'bottom-info': o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8312. }
  8313. },
  8314. mobile: {
  8315. 'more-help-hlr': {
  8316. 'top-info': o.HELP_MORE_HLR_A,
  8317. 'big-image': 'images/nav_help_expand.svg',
  8318. 'bottom-info': o.HELP_DESKTOP_MORE_HLR_B
  8319. },
  8320. 'more-help-dollhouse': {
  8321. 'top-info': o.HELP_MORE_DOLLHOUSE_A,
  8322. 'big-image': 'images/nav_help_dollhouse.svg',
  8323. 'bottom-info': o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8324. },
  8325. 'more-help-floors': {
  8326. 'top-info': o.HELP_MORE_FLOORS_A,
  8327. 'big-image': 'images/nav_help_floor picker.svg',
  8328. 'bottom-info': o.HELP_DESKTOP_MORE_FLOORS_B
  8329. },
  8330. 'more-help-tag': {
  8331. 'top-info': o.HELP_MORE_TAG_A,
  8332. 'big-image': 'images/nav_help_tag.svg',
  8333. 'bottom-info': o.HELP_MOBILE_MORE_TAG_B
  8334. },
  8335. 'more-help-tour': {
  8336. 'top-info': o.HELP_MORE_TOUR_A,
  8337. 'big-image': 'images/nav_help_play.png',
  8338. 'bottom-info': o.HELP_DESKTOP_MORE_TOUR_B
  8339. },
  8340. 'more-help-inside': {
  8341. 'top-info': o.HELP_MORE_INSIDE_A,
  8342. 'big-image': 'images/nav_help_inside.svg',
  8343. 'bottom-info': o.HELP_MOBILE_MORE_INSIDE_B
  8344. },
  8345. 'more-help-vr': {
  8346. 'top-info': o.HELP_MORE_VR_A,
  8347. 'big-image': 'images/webvr.svg',
  8348. 'bottom-info': o.HELP_MOBILE_MORE_VR_B
  8349. },
  8350. 'more-help-360': {
  8351. 'top-info': o.HELP_MORE_360_A,
  8352. 'big-image': 'images/nav_help_360.svg',
  8353. 'bottom-info': o.HELP_MOBILE_MORE_360_B
  8354. }
  8355. }
  8356. }),
  8357. (this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8358. desktop: {
  8359. left: {
  8360. 'top-info': o.ROTATE,
  8361. 'big-image': 'images/nav_help_mouse_drag_left.png',
  8362. keyboard: 'images/nav_help_keyboard_left_right.png'
  8363. },
  8364. middle: {
  8365. 'top-info': o.MOVE,
  8366. 'big-image': 'images/nav_help_mouse_click.png',
  8367. keyboard: 'images/nav_help_keyboard_up_down.png'
  8368. },
  8369. right: {
  8370. 'top-info': o.PLAY,
  8371. 'big-image': 'images/Desktop-help-play-button.svg',
  8372. keyboard: 'images/Desktop-help-spacebar-2.svg'
  8373. }
  8374. },
  8375. mobile: {
  8376. left: {
  8377. 'top-info': o.ROTATE,
  8378. 'big-image': 'images/nav_help_gesture_drag.png'
  8379. },
  8380. middle: {
  8381. 'top-info': o.MOVE,
  8382. 'big-image': 'images/nav_help_gesture_tap.png'
  8383. },
  8384. right: {
  8385. 'top-info': o.PLAY,
  8386. 'big-image': 'images/mobile-help-play-button.svg'
  8387. }
  8388. }
  8389. }),
  8390. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]]))),
  8391. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle),
  8392. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle),
  8393. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]]))),
  8394. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left),
  8395. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left)
  8396. }
  8397. },
  8398. fill: function (e, t, i) {
  8399. n.call(this, e, t, i, !0)
  8400. },
  8401. clear: function (e, t, i) {
  8402. n.call(this, e, t, i, !1)
  8403. }
  8404. }
  8405. },
  8406. {
  8407. '../enum/HelpModalSize': 27,
  8408. '../enum/HelpModalType': 28,
  8409. '../enum/Viewmode': 51,
  8410. '../localization/localize': 108,
  8411. '../util/browser': 182
  8412. }
  8413. ],
  8414. 76: [
  8415. function (e, t, i) {
  8416. 'use strict'
  8417. t.exports = Object.freeze({
  8418. OPENED: 'share.open',
  8419. CLOSED: 'share.closed',
  8420. LINK_CLICKED: 'share.linked'
  8421. })
  8422. },
  8423. {}
  8424. ],
  8425. 77: [
  8426. function (e, t, i) {
  8427. 'use strict'
  8428. function n(n) {
  8429. function e(e, t) {
  8430. var i = 'top=' + (window.screenY + ($('#player').height() - t) / 2) + ',left=' + (window.screenX + ($('#player').width() - e) / 2) + ',width=' + e + ',height=' + t
  8431. I.emit(l.LINK_CLICKED, {
  8432. channel: n
  8433. }),
  8434. window.open(C[n], 'shareWindow', i)
  8435. }
  8436. switch (n) {
  8437. case A.FACEBOOK:
  8438. e(580, 420)
  8439. break
  8440. case A.TWITTER:
  8441. e(550, 440)
  8442. break
  8443. case A.MAIL:
  8444. I.emit(l.LINK_CLICKED, {
  8445. channel: 'email'
  8446. }),
  8447. window.open(C[n], '_blank')
  8448. break
  8449. case A.LINKEDIN:
  8450. }
  8451. }
  8452. function r(e) {
  8453. I.emit(l.LINK_CLICKED, {
  8454. channel: 'copylink'
  8455. })
  8456. var t = document.createRange()
  8457. t.selectNodeContents(v)
  8458. var i = window.getSelection()
  8459. i.removeAllRanges(), i.addRange(t), document.execCommand('copy'), y.classList.remove('hidden'), v.classList.add('highlighted')
  8460. }
  8461. function o(e) {
  8462. ;(e && (e.stopPropagation(), e.target === v)) || (window.getSelection().removeAllRanges(), v.classList.remove('highlighted'), y.classList.add('hidden'))
  8463. }
  8464. var a = e('../../util/browser'),
  8465. s = e('../../localization/localize'),
  8466. l = e('./ShareEvents'),
  8467. c = e('../../util/common'),
  8468. h = e('events').EventEmitter,
  8469. u = document.getElementById('sharing'),
  8470. d = document.getElementById('share-modal'),
  8471. p = document.getElementById('share-close'),
  8472. f = document.getElementById('facebook-share'),
  8473. g = document.getElementById('twitter-share'),
  8474. m = document.getElementById('mail-share'),
  8475. v = document.getElementById('share-url-text'),
  8476. y = document.getElementById('copy-success'),
  8477. A = Object.freeze({
  8478. FACEBOOK: 'facebook',
  8479. TWITTER: 'twitter',
  8480. MAIL: 'mail',
  8481. LINKEDIN: 'linkedin'
  8482. }),
  8483. C = {}
  8484. ;(C[A.FACEBOOK] = 'http://www.facebook.com/sharer.php?u=' + encodeURIComponent(window.location.href + '&utm_source=1') + '&t='),
  8485. (C[A.TWITTER] = 'http://twitter.com/intent/tweet?text='),
  8486. (C[A.MAIL] = 'mailto:?subject=')
  8487. var I = {
  8488. init: function (e) {
  8489. var t = encodeURIComponent(s.SHARE_EXPLORE + e + ' ' + s.SHARE_AT + ' ')
  8490. ;(C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + '&utm_source=1')),
  8491. (C[A.TWITTER] += t + encodeURIComponent(window.location.href + '&utm_source=2 ' + s.SHARE_WITH + ' #port')),
  8492. (C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + '&body=' + t + encodeURIComponent(window.location.href + '&utm_source=3')),
  8493. u.addEventListener('click', this.toggle.bind(this)),
  8494. p.addEventListener('click', this.hide.bind(this)),
  8495. v.addEventListener('click', r),
  8496. d.addEventListener('click', o),
  8497. f.addEventListener('click', n.bind(this, A.FACEBOOK)),
  8498. g.addEventListener('click', n.bind(this, A.TWITTER)),
  8499. m.addEventListener('click', n.bind(this, A.MAIL)),
  8500. (v.textContent = window.location.href + '&utm_source=4'),
  8501. d.classList.add(a.isMobile() ? 'mobile' : 'desktop'),
  8502. u.classList.remove('hidden')
  8503. },
  8504. show: function () {
  8505. this.emit(l.OPENED), d.classList.add('fadeIn')
  8506. },
  8507. hide: function () {
  8508. d.classList.contains('fadeIn') && (this.emit(l.CLOSED), document.selection && document.selection.empty(), window.getSelection().removeAllRanges(), o(), d.classList.remove('fadeIn'))
  8509. },
  8510. toggle: function () {
  8511. d.classList.contains('fadeIn') ? this.hide() : this.show()
  8512. }
  8513. }
  8514. c.extendObject(I, h.prototype), (t.exports = I)
  8515. },
  8516. {
  8517. '../../localization/localize': 108,
  8518. '../../util/browser': 182,
  8519. '../../util/common': 185,
  8520. './ShareEvents': 76,
  8521. events: 202
  8522. }
  8523. ],
  8524. 78: [
  8525. function (e, t, i) {
  8526. 'use strict'
  8527. t.exports = Object.freeze({
  8528. OPENED: 'terms.opened',
  8529. CLOSED: 'terms.closed'
  8530. })
  8531. },
  8532. {}
  8533. ],
  8534. 79: [
  8535. function (e, t, i) {
  8536. 'use strict'
  8537. var n = e('./TermsEvent'),
  8538. r = e('../../localization/localize'),
  8539. o = e('../../analytics'),
  8540. a = e('../../util/ajax'),
  8541. s = e('../../util/common'),
  8542. l = e('events').EventEmitter,
  8543. c = document.getElementById('terms-modal'),
  8544. h = {
  8545. init: function () {
  8546. $('.footer-terms').on(
  8547. 'click',
  8548. function (e) {
  8549. e.preventDefault(), this.show()
  8550. }.bind(this)
  8551. ),
  8552. $('#terms-modal .close').on('click', this.hide.bind(this))
  8553. },
  8554. show: function () {
  8555. this.emit(n.OPENED),
  8556. a
  8557. .get('static/' + r.TERMS_TEXT_FILE)
  8558. .done(function (e) {
  8559. var t = $('#terms-text').html(e)
  8560. o.track('showcase_gui', {
  8561. gui_action: 'click_terms_button',
  8562. interaction_source: 'gui'
  8563. }),
  8564. t.find('a').attr('target', '_blank')
  8565. })
  8566. .fail(function () {
  8567. $('#terms-text').html('<h1>' + r.TERMS_OF_USE + '</h1><p>' + r.TERMS_FAIL)
  8568. }),
  8569. c.classList.add('fadeIn')
  8570. },
  8571. hide: function (e) {
  8572. e && e.preventDefault(), c.classList.contains('fadeIn') && this.emit(n.CLOSED), c.classList.remove('fadeIn')
  8573. }
  8574. }
  8575. s.extendObject(h, l.prototype), (t.exports = h)
  8576. },
  8577. {
  8578. '../../analytics': 4,
  8579. '../../localization/localize': 108,
  8580. '../../util/ajax': 181,
  8581. '../../util/common': 185,
  8582. './TermsEvent': 78,
  8583. events: 202
  8584. }
  8585. ],
  8586. 80: [
  8587. function (e, t, i) {
  8588. 'use strict'
  8589. t.exports = Object.freeze({
  8590. OPEN_INFO: 'title.open.info',
  8591. CLOSE_INFO: 'title.close.info',
  8592. SHOW_INFO: 'title.show.info',
  8593. HIDE_INFO: 'title.hide.info',
  8594. LINK_CLICKED: 'title.link.click',
  8595. CONTACT_LINK_CLICKED: 'title.contact.click',
  8596. ORIGIN_LINK_CLICKED: 'title.origin.click'
  8597. })
  8598. },
  8599. {}
  8600. ],
  8601. 81: [
  8602. function (e, t, i) {
  8603. 'use strict'
  8604. var o = e('../../settings')
  8605. t.exports.init = function (e, t) {
  8606. o.tags.enabled &&
  8607. 0 !== Object.keys(e.tags).length &&
  8608. (function (t, i) {
  8609. function e(e) {
  8610. ;(t.shouldShowtags = 'show' === this.value), t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8611. }
  8612. document.getElementById('tag-toggles').classList.remove('hidden'), (document.getElementById('radio-tag-show').checked = !0)
  8613. for (var n = document.getElementById('tag-inputs').querySelectorAll('input'), r = 0; r < n.length; r++) n[r].addEventListener('change', e)
  8614. })(e, t)
  8615. }
  8616. },
  8617. {
  8618. '../../settings': 166
  8619. }
  8620. ],
  8621. 82: [
  8622. function (S, M, e) {
  8623. ;(function (e) {
  8624. 'use strict'
  8625. function i(e) {
  8626. return !(
  8627. !e ||
  8628. (l.inIframe() && document.referrer === e) ||
  8629. (E.classList.remove('hidden'),
  8630. (_.innerHTML = r.WEBVR_LEARN_MORE + ': '),
  8631. _.appendChild(
  8632. (function (e) {
  8633. var t = document.createElement('a')
  8634. return (t.id = 'url'), (t.target = '_blank'), (t.href = e), (t.innerText = e), t.addEventListener('click', x.emit.bind(x, a.ORIGIN_LINK_CLICKED)), t
  8635. })(e)
  8636. ),
  8637. b.forEach(function (e) {
  8638. e.classList.add('share-link')
  8639. }),
  8640. 0)
  8641. )
  8642. }
  8643. function s(e, t) {
  8644. var i = e,
  8645. n = t
  8646. return function (e, t) {
  8647. i.push(t || n, e)
  8648. }
  8649. }
  8650. var l = S('../../util/browser'),
  8651. t = S('../../util/common'),
  8652. n = S('../../util/logger'),
  8653. r = S('../../localization/localize'),
  8654. o = S('./titleBarSettings'),
  8655. c = S('../../settings'),
  8656. a = S('./TitleEvents'),
  8657. h = S('events').EventEmitter,
  8658. u = new n(e),
  8659. d = document.querySelector('.pinTop.left'),
  8660. p = document.getElementsByClassName('title-container')[0],
  8661. f = document.getElementById('title-toggle').querySelector('i'),
  8662. g = document.getElementById('meta-info-wrapper'),
  8663. m = document.getElementById('meta-info'),
  8664. v = document.getElementById('meta-description'),
  8665. y = document.getElementsByClassName('contact-info')[0],
  8666. A = document.getElementById('contact-data'),
  8667. C = document.getElementById('addressTxt'),
  8668. I = document.getElementById('tag-toggles'),
  8669. E = document.getElementById('share-origin'),
  8670. _ = document.getElementById('share-link-wrapper'),
  8671. b = [m, g, p],
  8672. w = !1,
  8673. T = !1,
  8674. x = {
  8675. populate: function (e) {
  8676. if (
  8677. (function (e, t) {
  8678. return e && l.valueFromHash('title', 1) && 2 !== l.valueFromHash('mls', 0)
  8679. ? ((document.getElementsByClassName('titleText')[0].innerText = e),
  8680. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute('data-original-title', e),
  8681. t && 1 !== c.specialEdition && c.brand && !c.mls
  8682. ? (document.getElementById('cobrandTitle').innerText = t)
  8683. : (document.getElementsByClassName('co-brand')[0].classList.add('hidden'),
  8684. document.getElementById('gui-name').classList.add('noCoBrand'),
  8685. document.getElementById('cobrandTitle').classList.add('hidden')),
  8686. !0)
  8687. : (document.getElementById('model-title').classList.add('hidden'), !1)
  8688. })(DATA.name, e.coBrand)
  8689. ) {
  8690. if (
  8691. ((function (e) {
  8692. e ? ((w = !0), (v.innerHTML = e)) : v.classList.add('hidden')
  8693. })(e.description),
  8694. (function (e, t, i, n) {
  8695. if ((e || t || i) && c.brand && !l.valueFromHash('mls', !1)) {
  8696. w = !0
  8697. var r = [],
  8698. o = s(r, '<br>')
  8699. if ((e && o('<span id="contactName">' + e + '</span>'), t)) {
  8700. var a = n || t
  8701. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + '</a>' : '<span>' + a + '</span>')
  8702. }
  8703. i && o('<a id="email" href="mailTo:' + i + '">' + i + '</a>'), (r[0] = ''), (A.innerHTML = r.join(''))
  8704. } else y.classList.add('hidden')
  8705. })(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8706. (function (e) {
  8707. if ('string' == typeof e)
  8708. try {
  8709. e = JSON.parse(e)
  8710. } catch (e) {
  8711. return u.warn('Unable to parse address data'), C.parentElement.classList.add('hidden')
  8712. }
  8713. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8714. w = !0
  8715. var t = [],
  8716. i = s(t, ' ')
  8717. e.address_1 && i(e.address_1),
  8718. e.address_2 && i(e.address_2),
  8719. e.city && i(e.city, ', '),
  8720. e.state && i(e.state, ', '),
  8721. e.zip && i(e.zip, e.state ? ' ' : ', '),
  8722. (t[0] = ''),
  8723. (C.innerText = t.join(''))
  8724. } else C.parentElement.classList.add('hidden')
  8725. })(e.address),
  8726. w)
  8727. ) {
  8728. var t = document.createElement('br')
  8729. I.insertBefore(t, I.firstElementChild)
  8730. }
  8731. e.socialSharing && c.share.enabled && (T = i(e.url))
  8732. }
  8733. },
  8734. finishSetup: function (e) {
  8735. ;(w = w || !!e),
  8736. document.getElementById('title-toggle').addEventListener('click', x.toggleTitle.bind(x)),
  8737. w && p.addEventListener('click', x.toggleMeta.bind(x, !1)),
  8738. [].slice.call(v.querySelectorAll('a')).forEach(function (e) {
  8739. e.addEventListener('click', x.emit.bind(x, a.LINK_CLICKED))
  8740. }),
  8741. [].slice.call(y.querySelectorAll('a')).forEach(function (e) {
  8742. e.addEventListener(
  8743. 'click',
  8744. x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8745. contact_type: e.getAttribute('id')
  8746. })
  8747. )
  8748. }),
  8749. w || (T ? p.classList.add('share-only') : p.classList.add('no-meta'))
  8750. },
  8751. toggleMeta: function (e, t) {
  8752. var i = document.getElementById('model-title')
  8753. t && t.preventDefault()
  8754. var n = m.classList.contains('expand')
  8755. ;(e && !n) ||
  8756. (n
  8757. ? (b.forEach(function (e) {
  8758. e.classList.remove('expand')
  8759. }),
  8760. this.emit(a.CLOSE_INFO),
  8761. i.classList.remove('expand'))
  8762. : (b.forEach(function (e) {
  8763. e.classList.add('expand')
  8764. }),
  8765. i.classList.add('expand'),
  8766. this.emit(a.OPEN_INFO)))
  8767. },
  8768. setupToggling: function () {
  8769. ;(g.style.height = m.offsetHeight + 'px'),
  8770. m.addEventListener('transitionend', function () {
  8771. g.style.height = m.offsetHeight + 'px'
  8772. })
  8773. },
  8774. toggleTitle: function (e) {
  8775. e && e.preventDefault(),
  8776. d.classList.contains('closed')
  8777. ? (d.classList.add('open'),
  8778. f.classList.remove('icon-dpad-right'),
  8779. f.classList.add('icon-dpad-left'),
  8780. this.emit(a.SHOW_INFO),
  8781. setTimeout(function () {
  8782. d.classList.remove('closed'), d.classList.remove('open')
  8783. }, o.removeAnimationClasses))
  8784. : (d.classList.add('closed'), f.classList.remove('icon-dpad-left'), f.classList.add('icon-dpad-right'), this.emit(a.HIDE_INFO))
  8785. }
  8786. }
  8787. t.extendObject(x, h.prototype), (M.exports = x)
  8788. }).call(this, '/js/gui/title/titleBar.js')
  8789. },
  8790. {
  8791. '../../localization/localize': 108,
  8792. '../../settings': 166,
  8793. '../../util/browser': 182,
  8794. '../../util/common': 185,
  8795. '../../util/logger': 189,
  8796. './TitleEvents': 80,
  8797. './titleBarSettings': 83,
  8798. events: 202
  8799. }
  8800. ],
  8801. 83: [
  8802. function (e, t, i) {
  8803. 'use strict'
  8804. t.exports = Object.freeze({
  8805. minTooltipCharacters: 19,
  8806. removeAnimationClasses: 500
  8807. })
  8808. },
  8809. {}
  8810. ],
  8811. 84: [
  8812. function (e, t, i) {
  8813. 'use strict'
  8814. function n() {
  8815. //v.playTourNearBy(),
  8816. v.playTour(), y && clearTimeout(y), c(), E.removeClass('fadeIn')
  8817. }
  8818. function r() {
  8819. A.classList.contains('playing') &&
  8820. (v.stopTour(),
  8821. E.addClass('fadeIn'),
  8822. setTimeout(function () {
  8823. E.removeClass('fadeIn')
  8824. }, h.tourInteraction.showPauseButton),
  8825. M || (clearTimeout(y), (y = setTimeout(s, h.tourInteraction.showModal))),
  8826. setTimeout(function () {
  8827. A.classList.remove('playing')
  8828. }, h.tourInteraction.allowNextClick))
  8829. }
  8830. function o() {
  8831. v.tourInProgress && (v.stopTour(), v.endTourProgress(), A.classList.remove('playing'))
  8832. }
  8833. function a() {
  8834. _.is(':visible') ? n() : r()
  8835. }
  8836. function s() {
  8837. //去掉导览结束时的提示
  8838. /* if (!h.tourInteraction.disabled) {
  8839. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8840. T.addClass("fadeIn tour " + p.deviceType);
  8841. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8842. if (!h.tourInteraction.smallModal)
  8843. e = v.player.mode === d.PANORAMA && !v.player.currentPano.isAligned() || v.player.mode === d.DOLLHOUSE ? d.OUTDOOR : v.player.mode === d.FLOORPLAN ? d.FLOORPLAN : d.PANORAMA,
  8844. p.fill(x, g.TOUR_INTERACTION[e]),
  8845. T.addClass(e);
  8846. T.addClass(t)
  8847. } */
  8848. }
  8849. function l(e, t) {
  8850. if (t) {
  8851. if ($.contains($('.toolRight')[0], t.target)) return //add 防止编辑时input 空格开始导览
  8852. var i = 'keydown' === t.type,
  8853. n = t.which === u.SPACE || v.tourIsPlaying
  8854. ;(i && n) || e || (M = !0), v.atEndOfTour() && c(), !v.tourIsPlaying && v.tourInProgress && (E.removeClass('fadeIn'), c(), t.which !== u.SPACE && o()), i && n && a()
  8855. }
  8856. }
  8857. function c() {
  8858. T.removeClass('fadeIn')
  8859. }
  8860. var h = (e('../util/browser'), e('../settings')),
  8861. u = e('../enum/Keys'),
  8862. d = e('../enum/Viewmode'),
  8863. p = (e('./helpManager'), e('./populateModal')),
  8864. f = e('../enum/DirectorEvents'),
  8865. g = e('../enum/HelpModalType'),
  8866. m = e('../enum/HelpModalSize'),
  8867. v = null,
  8868. y = null,
  8869. A = document.getElementById('pause-overlay'),
  8870. C = document.getElementById('player'),
  8871. I = document.getElementById('gui'),
  8872. E = $('#pause-icon').eq(0),
  8873. _ = $('#play').eq(0),
  8874. b = $('#playHead').eq(0),
  8875. w = $('.rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan').toArray(),
  8876. T = $('#interaction-modal').eq(0),
  8877. x = $('#interaction-modal .interaction').toArray(),
  8878. S = ['touchstart', 'mousedown', 'pointerdown'],
  8879. M = !1
  8880. ;(t.exports.init = function (e) {
  8881. ;(v = e),
  8882. S.forEach(function (t) {
  8883. C.addEventListener(t, l.bind(this, !1), !0),
  8884. I.addEventListener(t, l.bind(this, !0), !0),
  8885. A.addEventListener(t, r, !0),
  8886. w.forEach(function (e) {
  8887. e.addEventListener(t, o, !0)
  8888. }),
  8889. $('#drawer img').on(t, o)
  8890. }),
  8891. document.addEventListener('keydown', l.bind(this, !1), !0),
  8892. v.on(f.TourStart, function () {
  8893. A.classList.add('playing')
  8894. })
  8895. }),
  8896. (t.exports.play = n),
  8897. (t.exports.pause = r),
  8898. (t.exports.pauseWithoutCTA = o),
  8899. (t.exports.togglePlay = a),
  8900. (t.exports.stopTour = function () {
  8901. b.hasClass('playing') && (clearTimeout(y), v.atEndOfTour() ? (A.classList.remove('playing'), s()) : E.removeClass('fadeIn'))
  8902. }),
  8903. (t.exports.dismissModal = c)
  8904. },
  8905. {
  8906. '../enum/DirectorEvents': 23,
  8907. '../enum/HelpModalSize': 27,
  8908. '../enum/HelpModalType': 28,
  8909. '../enum/Keys': 30,
  8910. '../enum/Viewmode': 51,
  8911. '../settings': 166,
  8912. '../util/browser': 182,
  8913. './helpManager': 68,
  8914. './populateModal': 75
  8915. }
  8916. ],
  8917. 85: [
  8918. function (e, t, i) {
  8919. 'use strict'
  8920. t.exports = Object.freeze({
  8921. OPENED: 'vr.modal.opened',
  8922. LAUNCH: 'vr.modal.launch',
  8923. CLOSED: 'vr.modal.closed',
  8924. NEXT: 'vr.modal.next',
  8925. PREV: 'vr.modal.prev',
  8926. STORE: 'vr.modal.store',
  8927. falseICECHOSEN: 'vr.modal.device'
  8928. })
  8929. },
  8930. {}
  8931. ],
  8932. 86: [
  8933. function (e, t, i) {
  8934. 'use strict'
  8935. var h = e('../../util/browser'),
  8936. u = e('../../enum/VRApps'),
  8937. n = e('../../enum/VRPlatforms'),
  8938. d = e('../../util/ajax'),
  8939. p = e('../../settings'),
  8940. r = {}
  8941. for (var o in ((r[u.CardboardAndroid] = 'https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri='),
  8942. (r[u.CardboardIOS] = 'https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri='),
  8943. (r[u.GearVR] = 'https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri='),
  8944. u)) {
  8945. var a = u[o]
  8946. r[a] += encodeURIComponent(document.referrer + '&display=' + a)
  8947. }
  8948. var s,
  8949. f = {},
  8950. g = (-1 === (s = window.location.host).indexOf('.port.com') && -1 === s.indexOf('localhost') && (s = 'my.port.com'), 'https://' + s)
  8951. ;(t.exports.init = function (e, t, o) {
  8952. function a(e, t, i, n) {
  8953. function r() {
  8954. return '&utm_medium=' + (h.inIframe() ? 'embed' : 'direct') + ('&utm_source=' + s) + ('&utm_showcase_session_id=' + o)
  8955. }
  8956. return h.valueFromHash('vrcoll', !1)
  8957. ? l + '&sids=' + t + '&lsid=' + t + '&ln=' + encodeURIComponent(i) + '&ld=' + encodeURIComponent(n) + '&display=' + e + r()
  8958. : c + '&m=' + t + '&display=' + e + r()
  8959. }
  8960. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href),
  8961. l = g + '/vr/dlist/?ret=' + s,
  8962. c = g + '/vr/show/?ret=' + s
  8963. switch (e) {
  8964. case n.IOS:
  8965. !(function (t, e, i, n) {
  8966. var r = a(t, e, i, n),
  8967. o = {
  8968. responseType: 'json',
  8969. data: {
  8970. branch_key: p.appConfig.branch_key,
  8971. data: {
  8972. m: e,
  8973. full_url: r,
  8974. $desktop_url: '',
  8975. $og_app_id: '331853976762864119',
  8976. $og_title: i,
  8977. $og_description: n,
  8978. $og_image_url: location.origin + '/api/v1/player/models/' + e + '/thumb',
  8979. $canonical_url: window.location.href
  8980. }
  8981. }
  8982. }
  8983. d.post('https://api.branch.io/v1/url', o)
  8984. .done(function (e) {
  8985. f[t] = e.url
  8986. })
  8987. .fail(
  8988. function (e) {
  8989. f[t] = e
  8990. }.bind(this, r)
  8991. )
  8992. })(u.CardboardIOS, t.sid, t.name, t.summary)
  8993. break
  8994. default:
  8995. !(function (e, t, i) {
  8996. for (var n in u) {
  8997. var r = u[n],
  8998. o = a(r, e, t, i)
  8999. f[r] = o
  9000. }
  9001. })(t.sid, t.name, t.summary)
  9002. }
  9003. }),
  9004. (t.exports.launch = function (e) {
  9005. var t = f[e]
  9006. window.open(t, '_blank')
  9007. }),
  9008. (t.exports.launchStore = function (e) {
  9009. var t = r[e]
  9010. window.open(t, '_blank')
  9011. })
  9012. },
  9013. {
  9014. '../../enum/VRApps': 46,
  9015. '../../enum/VRPlatforms': 49,
  9016. '../../settings': 166,
  9017. '../../util/ajax': 181,
  9018. '../../util/browser': 182
  9019. }
  9020. ],
  9021. 87: [
  9022. function (e, t, i) {
  9023. 'use strict'
  9024. function c(e) {
  9025. var t
  9026. switch (e) {
  9027. case y.IOS:
  9028. return 9 < (t = g.iosVersion()).major || (9 === t.major && 1 <= t.minor)
  9029. case y.Android:
  9030. return 4 < (t = g.androidVersion()).major || (4 === t.major && 4 < t.minor) || (4 === t.major && 4 === t.minor && 4 <= t.patch)
  9031. }
  9032. return !1
  9033. }
  9034. function h(e) {
  9035. switch (e) {
  9036. case y.Android:
  9037. x.filter('.cardboard').off().on('click', q.cardboardAndroid), x.filter('.gearvr').off().on('click', q.gear), n(k, U, 'logo-button', 'same-line')
  9038. break
  9039. case y.UnsupportedAndroid:
  9040. n('', H, '', '')
  9041. break
  9042. case y.IOS:
  9043. x.filter('.cardboard').off().on('click', q.cardboardIOS), n(k, '', 'logo-button', '')
  9044. break
  9045. case y.Desktop:
  9046. x.filter('.cardboard').off().on('click', r.bind(this, null, N, B)), x.filter('.gearvr').off().on('click', r.bind(this, U, F, null)), n(k, U, 'logo-button', 'same-line'), Q.cardboard()
  9047. }
  9048. }
  9049. function u(e) {
  9050. $('.p1, .p2, .p3').hide(),
  9051. l.insertAfter(T),
  9052. w.removeClass('front-page'),
  9053. w.removeClass('details-page'),
  9054. w.removeClass('lastPage'),
  9055. x.removeClass('logo-button'),
  9056. x.removeClass('same-line'),
  9057. T.removeClass('headsetOptions'),
  9058. S.attr('src', ''),
  9059. S.filter('.second').removeClass('gear'),
  9060. S.css('display', 'inline-block'),
  9061. S.off(),
  9062. M.filter('.second').css('display', ''),
  9063. O.css('display', 'none'),
  9064. $('.p' + (e + 1) + _).show(),
  9065. S.filter('.third').insertBefore(M.filter('.third'))
  9066. }
  9067. function n(e, t, i, n) {
  9068. w.addClass('front-page'),
  9069. S.filter('.first').attr('src', e),
  9070. S.filter('.second').attr('src', t),
  9071. x.filter('.first').addClass(i),
  9072. x.filter('.second').addClass(i),
  9073. x.addClass(n),
  9074. '.show-desktop' === _ && T.insertAfter(l)
  9075. }
  9076. function r(e, t, i) {
  9077. T.addClass('headsetOptions'),
  9078. x.off(),
  9079. S.filter('.second').attr('src', t),
  9080. O.css('display', 'block'),
  9081. M.filter('.second').css('display', 'none'),
  9082. O.on('click', function () {
  9083. u(b.Title), h(y.Desktop)
  9084. }),
  9085. e &&
  9086. (X.emit(C.falseICECHOSEN, {
  9087. name: v.GearVR
  9088. }),
  9089. S.filter('.first').attr('src', e),
  9090. S.filter('.second').addClass('gear'),
  9091. S.filter('.second').on('click', m.launchStore.bind(this, v.GearVR)),
  9092. Q.gearvr()),
  9093. i &&
  9094. (X.emit(C.falseICECHOSEN, {
  9095. name: v.Cardboard
  9096. }),
  9097. S.filter('.third').attr('src', i),
  9098. S.filter('.third').show(),
  9099. S.filter('.third').insertAfter(S.filter('.second')),
  9100. S.filter('.third').addClass('link'),
  9101. S.filter('.second').addClass('link'),
  9102. S.filter('.second').on('click', m.launchStore.bind(this, v.CardboardIOS)),
  9103. S.filter('.third').on('click', m.launchStore.bind(this, v.CardboardAndroid)),
  9104. Q.cardboard())
  9105. }
  9106. function d(e, t) {
  9107. switch (t) {
  9108. case y.IOS:
  9109. ;(j = W), (Y = G)
  9110. break
  9111. case y.Desktop:
  9112. e === b.Cardboard
  9113. ? ((j = N), (Y = B), S.filter('.second').on('click', m.launchStore.bind(this, v.CardboardIOS)), S.filter('.third').on('click', m.launchStore.bind(this, v.CardboardAndroid)))
  9114. : ((j = F), S.filter('.second').on('click', m.launchStore.bind(this, v.GearVR)), (Y = ''))
  9115. break
  9116. default:
  9117. Y = e === b.Cardboard ? ((j = H), G) : ((j = V), z)
  9118. }
  9119. }
  9120. function p(e, t, i) {
  9121. w.find('.inner').addClass('details-page'), w.addClass('details-page'), S.filter('.first').attr('src', e), S.filter('.second').attr('src', t), S.filter('.third').attr('src', i)
  9122. }
  9123. function f() {
  9124. var e = 1 < g.aspectRatio() && g.isMobile()
  9125. w.toggleClass('landscape', e).toggleClass('portrait', !e),
  9126. w.toggleClass('tiny', $('#player').height() <= o.narrowLandscapeHeight),
  9127. w.toggleClass('tinier', $('#player').height() <= o.reallyNarrowLandscapeHeight)
  9128. }
  9129. var g = e('../../util/browser'),
  9130. m = e('./vrLink'),
  9131. v = e('../../enum/VRApps'),
  9132. y = e('../../enum/VRPlatforms'),
  9133. A = e('../../enum/VRPages'),
  9134. C = e('./vrEvent'),
  9135. o = (e('../../settings'), e('../../constants')),
  9136. I = e('../../localization/localize'),
  9137. a = e('../../util/common'),
  9138. s = e('events').EventEmitter,
  9139. E = 0,
  9140. _ = null,
  9141. b = A.standard,
  9142. w = $('.vr-popup'),
  9143. l = w.find('.vr-popup-body'),
  9144. T = w.find('.vr-images'),
  9145. x = w.find('.img-container'),
  9146. S = w.find('.vr-sm-image'),
  9147. M = x.find('.vr-img-caption'),
  9148. R = $('.vr-buttons').find('.prev-button'),
  9149. P = $('.vr-buttons').find('.next-button'),
  9150. O = T.find('.front-close'),
  9151. L = $('.vr-page'),
  9152. D = w.find('img'),
  9153. N = 'images/apple-store.png',
  9154. F = 'images/badge-oculus.png',
  9155. B = 'images/badge-cardboard.png',
  9156. V = 'images/logo-samsung.png',
  9157. k = 'images/headset-cardboard.png',
  9158. U = 'images/headset-gearvr.png',
  9159. H = 'images/ico-android-robot.png',
  9160. z = 'images/ico-gearvr.png',
  9161. G = 'images/ico-vr.png',
  9162. W = 'images/apple-logo-white.svg',
  9163. j = null,
  9164. Y = null,
  9165. q = {},
  9166. X = {
  9167. init: function (e, t) {
  9168. function i(e) {
  9169. X.emit(C.STORE, {
  9170. type: e
  9171. }),
  9172. m.launchStore(e)
  9173. }
  9174. function n(e) {
  9175. switch ((e !== b.pageCount && (u(e), L.text(e + 1 + ' / ' + b.pageCount)), e)) {
  9176. case b.Title:
  9177. R.css('display', 'none'), P.text(a[e]), h(r)
  9178. break
  9179. case b.Cardboard:
  9180. R.css('display', 'block'), P.text(a[e]), x.filter('.cardboard').off(), x.filter('.gearvr').off(), d(e, r), p(k, j, Y)
  9181. break
  9182. case b.Gear:
  9183. P.text(a[e]), d(e, r), w.addClass('lastPage'), p(U, j, Y)
  9184. break
  9185. case b.pageCount:
  9186. w.removeClass('fadeIn'), X.emit(C.CLOSED)
  9187. }
  9188. D.filter("[src='']").hide()
  9189. }
  9190. var r = g.detectAndroid()
  9191. ? g.detectAndroidMobile() && c(y.Android)
  9192. ? (w.addClass('supported'), (_ = '.show-supported'), y.Android)
  9193. : (w.addClass('unsupported'), (_ = '.show-unsupported'), y.UnsupportedAndroid)
  9194. : g.detectIPhone() || g.detectIPod()
  9195. ? (w.addClass('ios'), (_ = '.show-ios'), (b = A.ios), y.IOS)
  9196. : (w.addClass('desktop'), (_ = '.show-desktop'), y.Desktop)
  9197. function o(e) {
  9198. X.emit(C.LAUNCH, {
  9199. vr_platform: r,
  9200. vr_app: e
  9201. }),
  9202. m.launch(e)
  9203. }
  9204. m.init(r, e, t),
  9205. r !== y.Desktop && w.addClass('mobile'),
  9206. (q.cardboardAndroid = o.bind(this, v.CardboardAndroid)),
  9207. (q.gear = o.bind(this, v.GearVR)),
  9208. (q.cardboardIOS = o.bind(this, v.CardboardIOS)),
  9209. f(),
  9210. $('.show-supported, .show-unsupported, .show-ios, .show-desktop').hide(),
  9211. $(_).show()
  9212. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS],
  9213. s = ['vr_modal_learn_more', 'vr_modal_next', 'vr_modal_done']
  9214. r === y.IOS && (a.splice(1, 1), s.splice(1, 1)),
  9215. $('#vr').on('click', function (e) {
  9216. e.preventDefault(),
  9217. window.vrEnabled ||
  9218. ((window.vrEnabled = !0),
  9219. this.classList.add('active'),
  9220. $('#gui div').not('#vrOff').addClass('vrHide'),
  9221. $('#vrOffImg').css({
  9222. display: 'inline-block'
  9223. }))
  9224. }),
  9225. $('#vrOff').on('click', function () {
  9226. ;(window.vrEnabled = !1),
  9227. $('#gui div').not('#vrOff').removeClass('vrHide'),
  9228. $('#vrOffImg').css({
  9229. display: 'none'
  9230. }),
  9231. $('#player canvas').css({
  9232. width: '',
  9233. height: ''
  9234. }),
  9235. $('#vr').removeClass('active')
  9236. })
  9237. var l = 'https://my.port.com/vr/show/?m=' + e.sid
  9238. r === y.IOS ? $('.cardboardLink').on('click', i.bind(this, v.CardboardIOS)) : $('.cardboardLink').on('click', i.bind(this, v.CardboardAndroid)),
  9239. $('.gearLink').on('click', i.bind(this, v.GearVR)),
  9240. $('span.modelLink').text(l),
  9241. R.on('click', function (e) {
  9242. X.emit(C.PREV), n(--E)
  9243. }),
  9244. P.on('click', function (e) {
  9245. P.text(),
  9246. X.emit(C.NEXT, {
  9247. nextAction: s[E]
  9248. }),
  9249. n(++E)
  9250. }),
  9251. w.find('.close').on('click', X.dismiss)
  9252. },
  9253. dismiss: function () {
  9254. w.hasClass('fadeIn') && (w.removeClass('fadeIn'), X.emit(C.CLOSED))
  9255. },
  9256. isDeviceSupported: c
  9257. }
  9258. a.extendObject(X, s.prototype), $(window).resize(f)
  9259. var Z,
  9260. K,
  9261. Q =
  9262. ((Z = M.filter('.first').find('.cardboard')),
  9263. (K = M.filter('.first').find('.gearvr')),
  9264. {
  9265. cardboard: function () {
  9266. K.addClass('hidden'), Z.removeClass('hidden')
  9267. },
  9268. gearvr: function () {
  9269. Z.addClass('hidden'), K.removeClass('hidden')
  9270. }
  9271. })
  9272. t.exports = X
  9273. },
  9274. {
  9275. '../../constants': 8,
  9276. '../../enum/VRApps': 46,
  9277. '../../enum/VRPages': 48,
  9278. '../../enum/VRPlatforms': 49,
  9279. '../../localization/localize': 108,
  9280. '../../settings': 166,
  9281. '../../util/browser': 182,
  9282. '../../util/common': 185,
  9283. './vrEvent': 85,
  9284. './vrLink': 86,
  9285. events: 202
  9286. }
  9287. ],
  9288. 88: [
  9289. function (e, t, i) {
  9290. 'use strict'
  9291. t.exports = Object.freeze({
  9292. OPENED: 'webvr.modal.opened',
  9293. SHOW_TERMS: 'webvr.footer.show.terms'
  9294. })
  9295. },
  9296. {}
  9297. ],
  9298. 89: [
  9299. function (B, V, e) {
  9300. ;(function (e) {
  9301. 'use strict'
  9302. function a() {
  9303. function t() {
  9304. p.isPresenting ||
  9305. (r.info('exiting webVR'),
  9306. c('webvr_exit_app'),
  9307. -1 === window.location.search.indexOf('&qs=1') ? (window.location = window.location + '&qs=1') : (window.location = window.location),
  9308. window.removeEventListener('vrdisplaypresentchange', t))
  9309. }
  9310. r.info('Headset mounted'), u.suspend()
  9311. var e = document.createElement('canvas')
  9312. for (e.getContext('webgl'), e.className = 'webvr-canvas', document.bgColor = '#000', document.body.style.backgroundColor = '#000'; document.body.firstChild; )
  9313. document.body.removeChild(document.body.firstChild)
  9314. document.body.appendChild(e),
  9315. c('webvr_enter_app'),
  9316. p
  9317. .requestPresent([
  9318. {
  9319. source: e,
  9320. predistorted: !0
  9321. }
  9322. ])
  9323. .catch(function (e) {
  9324. r.error('Failed to present: ' + e), c('webvr_exit_calibrate'), t()
  9325. }),
  9326. d.then(function () {
  9327. window.dispatchEvent(new Event('vrapp-start'))
  9328. }),
  9329. window.addEventListener('vrdisplaypresentchange', t)
  9330. }
  9331. function s() {
  9332. c('webvr_modal_close'),
  9333. _.find('.enter-button').off('click', a),
  9334. E.fadeOut(g.guiAnimationSpeed, function () {
  9335. _.toggleClass('hidden', !1), b.toggleClass('hidden', !0), f.exitFullscreen()
  9336. }),
  9337. I.fadeIn(g.guiAnimationSpeed)
  9338. }
  9339. function t() {
  9340. M.toggleClass('hidden', !0), S.toggleClass('hidden', !1)
  9341. }
  9342. function l() {
  9343. _.toggleClass('hidden'), b.toggleClass('hidden')
  9344. }
  9345. function c(e) {
  9346. var t = f.isLandscape() ? 'landscape' : 'portrait'
  9347. i.trackAlways('showcase_gui', {
  9348. gui_action: e,
  9349. orientation: t
  9350. })
  9351. }
  9352. function h() {
  9353. var e = f.isLandscape()
  9354. E.toggleClass('landscape', e).toggleClass('portrait', !e)
  9355. }
  9356. var u,
  9357. d,
  9358. p,
  9359. f = B('../../util/browser'),
  9360. g = B('../../settings'),
  9361. m = (B('./../gui'), B('../../enum/VRPlatforms')),
  9362. v = B('../../enum/VRApps'),
  9363. y = B('./../vr/vrLink'),
  9364. A = B('./WebVrEvent'),
  9365. i = B('../../analytics'),
  9366. C = (B('../../constants'), B('../../localization/localize')),
  9367. n = B('../../util/common'),
  9368. r = new (B('../../util/logger'))(e),
  9369. o = B('events').EventEmitter,
  9370. I = $('#gui'),
  9371. E = $('.webvr-popup'),
  9372. _ = $('.webvr-popup .page.p1'),
  9373. b = $('.webvr-popup .page.p2'),
  9374. w = E.find('.image'),
  9375. T = $('.webvr-popup .detail.headset'),
  9376. x = $('.webvr-popup .detail.phone'),
  9377. S = $('.webvr-popup .tab-content.webvr'),
  9378. M = $('.webvr-popup .tab-content.native'),
  9379. R = 'images/headset-cardboard.png',
  9380. P = 'https://madeby.google.com/vr/',
  9381. O = 'webvr_daydream_link',
  9382. L = P,
  9383. D = O,
  9384. N = {
  9385. init: function (e, t, i, n) {
  9386. function r(e) {
  9387. e.preventDefault(), o(e.currentTarget.id)
  9388. }
  9389. function o(i) {
  9390. F[i](),
  9391. Object.keys(F).map(function (e, t) {
  9392. $('#' + e).toggleClass('tabs-underlined', e === i)
  9393. })
  9394. }
  9395. ;(p = i),
  9396. (u = t),
  9397. y.init(m.Android, e, n),
  9398. h(),
  9399. new RegExp('daydream', 'i').test(p.displayName)
  9400. ? (o('tabdaydream'), w.filter('.device-headset-side').attr('src', 'images/device-daydream-side.png'), _.find('.title').text(C.localizeText('WEBVR_FOR_DAYDREAM')))
  9401. : (o('tabcardboard'), w.filter('.device-headset-side').attr('src', R), _.find('.title').text(C.localizeText('WEBVR_FOR_CARDBOARD'))),
  9402. $('#vr').on('click', function (e) {
  9403. e.preventDefault(),
  9404. c('click_webvr_button'),
  9405. E.is(':hidden') &&
  9406. (N.emit(A.OPENED),
  9407. I.fadeOut(g.guiAnimationSpeed),
  9408. E.fadeIn(g.guiAnimationSpeed),
  9409. (function () {
  9410. if (!d) {
  9411. var n = 'https://static.port.com/webvr/' + (f.valueFromHash('webvr') || g.appConfig.webvr_version) + '/js/main.js'
  9412. d = new Promise(function (e, t) {
  9413. var i = document.createElement('script')
  9414. ;(i.type = 'text/javascript'), (i.src = n), (i.onload = e), document.head.appendChild(i)
  9415. })
  9416. }
  9417. _.find('.enter-button').on('click', a)
  9418. })())
  9419. }),
  9420. $('.webvr-popup .close').on('click', function (e) {
  9421. e.preventDefault(), _.hasClass('hidden') ? (c('webvr_help_close'), l()) : s()
  9422. }),
  9423. $('#tabcardboard').on('click', r),
  9424. $('#tabdaydream').on('click', r),
  9425. $('#tabnative').on('click', r),
  9426. $('.webvr-popup .open-with-app').on('click', function (e) {
  9427. e.preventDefault(), c('webvr_learn_more'), o('tabnative'), l()
  9428. }),
  9429. $('.webvr-popup .help').on('click', function (e) {
  9430. e.preventDefault(), c(_.hasClass('hidden') ? 'webvr_help_close' : 'webvr_help_show'), l()
  9431. }),
  9432. $('.webvr-popup .terms').on('click', function (e) {
  9433. e.preventDefault(), c('webvr_click_terms'), s(), N.emit(A.SHOW_TERMS)
  9434. }),
  9435. T.on('click', function (e) {
  9436. e.preventDefault(), c(D), window.open(L, '_blank')
  9437. }),
  9438. x.on('click', function (e) {
  9439. e.preventDefault(), c('webvr_phone_link'), window.open('https://vr.google.com/daydream/phones/', '_blank')
  9440. }),
  9441. $('.webvr-popup .badge-cardboard').on('click', function (e) {
  9442. e.preventDefault(), c('webvr_cardboard_link'), y.launch(v.CardboardAndroid)
  9443. }),
  9444. $('.webvr-popup .badge-oculus').on('click', function (e) {
  9445. e.preventDefault(), c('webvr_oculus_link'), y.launch(v.GearVR)
  9446. })
  9447. }
  9448. },
  9449. F = {
  9450. tabcardboard: function () {
  9451. w.filter('.device-headset').attr('src', R),
  9452. w.filter('.device-phone').attr('src', 'images/ico-android-robot.png'),
  9453. (L = 'https://vr.google.com/cardboard/get-cardboard/'),
  9454. (D = 'webvr_cardboard_link'),
  9455. T.text(C.localizeText('VR_GOOGLE_CARDBOARD')),
  9456. x.text(C.localizeText('VR_COMPATIBLE_ANDROID_LONG')),
  9457. $('.webvr-popup .detail.daydream-label').toggleClass('hidden', !0),
  9458. t()
  9459. },
  9460. tabdaydream: function () {
  9461. w.filter('.device-headset').attr('src', 'images/device-daydream.png'),
  9462. w.filter('.device-phone').attr('src', 'images/device-pixel.png'),
  9463. (L = P),
  9464. (D = O),
  9465. T.text(C.localizeText('WEBVR_DAYDREAM_VIEW')),
  9466. x.text(C.localizeText('VR_NEED_DAYDREAM_PHONE')),
  9467. $('.webvr-popup .detail.daydream-label').toggleClass('hidden', !1),
  9468. t()
  9469. },
  9470. tabnative: function () {
  9471. w.filter('.badge-cardboard').attr('src', 'images/badge-cardboard.png'),
  9472. w.filter('.badge-oculus').attr('src', 'images/badge-oculus.png'),
  9473. M.toggleClass('hidden', !1),
  9474. S.toggleClass('hidden', !0)
  9475. }
  9476. }
  9477. n.extendObject(N, o.prototype), $(window).resize(h), (V.exports = N)
  9478. }).call(this, '/js/gui/webvr/webVRgui.js')
  9479. },
  9480. {
  9481. '../../analytics': 4,
  9482. '../../constants': 8,
  9483. '../../enum/VRApps': 46,
  9484. '../../enum/VRPlatforms': 49,
  9485. '../../localization/localize': 108,
  9486. '../../settings': 166,
  9487. '../../util/browser': 182,
  9488. '../../util/common': 185,
  9489. '../../util/logger': 189,
  9490. './../gui': 65,
  9491. './../vr/vrLink': 86,
  9492. './WebVrEvent': 88,
  9493. events: 202
  9494. }
  9495. ],
  9496. 90: [
  9497. function (e, t, i) {
  9498. 'use strict'
  9499. function n(e, t, i, n, r) {
  9500. ;(this.floorId = n || 0 === n ? n : -1), (this.roomId = r || ''), (this.labelId = e), (this.position = new o.Vector3().copy(t)), (this.text = i)
  9501. }
  9502. var o = e('three'),
  9503. r = e('../util/browser')
  9504. ;(n.prototype.build = function () {
  9505. var e = window.document.createElement('div')
  9506. r.isMobile() ? e.setAttribute('class', 'gui-floorplan-label gui-floorplan-label-mobile') : e.setAttribute('class', 'gui-floorplan-label')
  9507. var t = window.document.createElement('div')
  9508. t.setAttribute('class', 'gui-floorplan-label-text')
  9509. var i = window.document.createTextNode(this.text)
  9510. t.appendChild(i), e.appendChild(t), window.document.body.appendChild(e), (this.labelGui = e), (this.textBlock = t), $(this.labelGui).hide()
  9511. var n = window.getComputedStyle(this.labelGui)
  9512. this.initialTransform = n.transform || n.webkitTransform
  9513. }),
  9514. (t.exports = n)
  9515. },
  9516. {
  9517. '../util/browser': 182,
  9518. three: 217
  9519. }
  9520. ],
  9521. 91: [
  9522. function (e, t, i) {
  9523. 'use strict'
  9524. function n() {
  9525. ;(this.player = null), (this.modelManager = null), (this.container = null)
  9526. }
  9527. var c,
  9528. o,
  9529. r = e('three'),
  9530. a = (e('../util/common'), e('../enum/PlayerEvents')),
  9531. s = (e('../enum/DirectorEvents'), e('../enum/ModelManagerEvents')),
  9532. l = e('../settings'),
  9533. h = e('../enum/Viewmode'),
  9534. u = (e('../enum/WarpStyle'), e('../util/transitions'), e('../util/lerp'), e('../util/browser'))
  9535. ;(n.prototype.init = function (e, t, i) {
  9536. ;(this.player = e), (this.modelManager = t), (this.container = i), this.updateModel(), this.bindEvents()
  9537. }),
  9538. (n.prototype.bindEvents = function () {
  9539. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9540. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9541. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9542. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9543. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9544. }),
  9545. (n.prototype.updateModel = function () {
  9546. this.model = this.modelManager.getActiveModel()
  9547. }),
  9548. (n.prototype.handlePlayerViewChanged = function () {
  9549. this.updateLabelVisibility(), this.updateLabelDisplay()
  9550. }),
  9551. (n.prototype.getLabelsForFloor = function (t, i) {
  9552. return (
  9553. ((i = i || []).length = 0),
  9554. this.model.labels.forEach(
  9555. function (e) {
  9556. this.labelVisibleForFloor(e, t) && i.push(e)
  9557. }.bind(this)
  9558. ),
  9559. i
  9560. )
  9561. }),
  9562. (n.prototype.getLabelsForCurrentFloor = function (e) {
  9563. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9564. }),
  9565. (n.prototype.labelVisibleForFloor = function (e, t) {
  9566. var i =
  9567. (u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile) || (!u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop)
  9568. if (!this.model.showingLabels || !e.labelGui || !i) return !1
  9569. var n = e.floorId === this.model.floors.size() - 1
  9570. return this.model.allFloorsVisible ? n : e.floorId === t
  9571. }),
  9572. (n.prototype.updateLabelVisibility = function (e) {
  9573. this.model.labels.forEach(
  9574. function (e) {
  9575. this.supportedMode() && this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex)
  9576. ? this.showLabel(e, l.labels.fadeInDelay, l.labels.fadeInDuration)
  9577. : this.hideLabel(e, l.labels.fadeOutDelay, l.labels.fadeOutDuration)
  9578. }.bind(this)
  9579. )
  9580. }),
  9581. (n.prototype.showAllLabels = function (t, i) {
  9582. this.model.labels.forEach(
  9583. function (e) {
  9584. this.showLabel(e, t, i)
  9585. }.bind(this)
  9586. )
  9587. }),
  9588. (n.prototype.hideAllLabels = function (t, i) {
  9589. this.model.labels.forEach(
  9590. function (e) {
  9591. this.hideLabel(e, t, i)
  9592. }.bind(this)
  9593. )
  9594. }),
  9595. (n.prototype.showLabel = function (e, t, i) {
  9596. this.model.showingLabels && (e.visible || ((e.visible = !0), (e.labelGui.style.display = 'block'), (e.labelGui.style.opacity = 0), $(e.labelGui).delay(t).fadeTo(i, 1)))
  9597. }),
  9598. (n.prototype.hideLabel = function (e, t, i) {
  9599. e.visible && ((e.visible = !1), u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9600. }),
  9601. (n.prototype.supportedMode = function () {
  9602. return this.player.mode === h.FLOORPLAN
  9603. }),
  9604. (n.prototype.updateLabelDisplay =
  9605. (new r.Vector3(),
  9606. new r.Vector3(),
  9607. (o = []),
  9608. function () {
  9609. var e = this.player.getLabelScaleFactor(),
  9610. t = 1.2 * (1 - e) + 0.6,
  9611. i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop
  9612. this.getLabelsForCurrentFloor(o)
  9613. for (var n = 0; n < o.length; n++) {
  9614. var r = o[n]
  9615. this.supportedMode() &&
  9616. r.labelGui &&
  9617. (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9618. i <= e && r.text.length >= l.labels.minLengthForTruncate
  9619. ? (r.textBlock.innerText = r.text.substring(0, l.labels.truncateLength) + l.labels.truncateSuffix)
  9620. : (r.textBlock.innerText = r.text))
  9621. }
  9622. })),
  9623. (n.prototype.updateProjectedGuiElement =
  9624. ((c = new r.Vector3()),
  9625. new r.Vector3(),
  9626. function (e, t, i, n, r) {
  9627. t.style.fontSize = 100 * r + '%'
  9628. var o = 0.5 * $('#player').width(),
  9629. a = 0.5 * $('#player').height()
  9630. c.copy(i), c.project(this.player.camera)
  9631. var s = c.x * o + o,
  9632. l = -c.y * a + a
  9633. ;(s -= e.offsetWidth / 2), (l -= e.offsetHeight / 2), (e.style.left = s + 'px'), (e.style.top = l + 'px')
  9634. })),
  9635. (n.prototype.handleStartInside = function (e) {
  9636. this.updateLabelVisibility()
  9637. }),
  9638. (n.prototype.handleStartOutside = function () {
  9639. this.updateLabelVisibility()
  9640. }),
  9641. (t.exports = n)
  9642. },
  9643. {
  9644. '../enum/DirectorEvents': 23,
  9645. '../enum/ModelManagerEvents': 33,
  9646. '../enum/PlayerEvents': 40,
  9647. '../enum/Viewmode': 51,
  9648. '../enum/WarpStyle': 52,
  9649. '../settings': 166,
  9650. '../util/browser': 182,
  9651. '../util/common': 185,
  9652. '../util/lerp': 188,
  9653. '../util/transitions': 195,
  9654. three: 217
  9655. }
  9656. ],
  9657. 92: [
  9658. function (e, t, i) {
  9659. 'use strict'
  9660. Array.prototype.findIndex ||
  9661. (Array.prototype.findIndex = function (e) {
  9662. if (null == this) throw new TypeError('Array.prototype.findIndex called on null or undefined')
  9663. if ('function' != typeof e) throw new TypeError('predicate must be a function')
  9664. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++) if (((t = i[o]), e.call(r, t, o, i))) return o
  9665. return -1
  9666. }),
  9667. Array.prototype.find ||
  9668. Object.defineProperty(Array.prototype, 'find', {
  9669. value: function (e) {
  9670. if (null == this) throw new TypeError('"this" is null or not defined')
  9671. var t = Object(this),
  9672. i = t.length >>> 0
  9673. if ('function' != typeof e) throw new TypeError('predicate must be a function')
  9674. for (var n = arguments[1], r = 0; r < i; ) {
  9675. var o = t[r]
  9676. if (e.call(n, o, r, t)) return o
  9677. r++
  9678. }
  9679. }
  9680. })
  9681. },
  9682. {}
  9683. ],
  9684. 93: [
  9685. function (e, t, i) {
  9686. 'use strict'
  9687. var n,
  9688. r,
  9689. o,
  9690. a,
  9691. s,
  9692. l,
  9693. c,
  9694. h,
  9695. u,
  9696. d,
  9697. p,
  9698. f,
  9699. g,
  9700. m,
  9701. v,
  9702. y,
  9703. A,
  9704. C,
  9705. I,
  9706. E,
  9707. _,
  9708. b,
  9709. w,
  9710. T,
  9711. x,
  9712. S,
  9713. M,
  9714. R,
  9715. P,
  9716. O,
  9717. L,
  9718. D,
  9719. N,
  9720. F,
  9721. B,
  9722. V,
  9723. k,
  9724. U,
  9725. H,
  9726. z,
  9727. G,
  9728. W,
  9729. j,
  9730. Y,
  9731. q,
  9732. X,
  9733. Z,
  9734. K,
  9735. Q,
  9736. J,
  9737. ee = ee || {}
  9738. function te() {
  9739. ;(this.backgroundElement = document.createElement('div')),
  9740. r.extend(this.backgroundElement.style, {
  9741. backgroundColor: 'rgba(0,0,0,0.8)',
  9742. top: 0,
  9743. left: 0,
  9744. display: 'none',
  9745. zIndex: '1000',
  9746. opacity: 0,
  9747. WebkitTransition: 'opacity 0.2s linear'
  9748. }),
  9749. n.makeFullscreen(this.backgroundElement),
  9750. (this.backgroundElement.style.position = 'fixed'),
  9751. (this.domElement = document.createElement('div')),
  9752. r.extend(this.domElement.style, {
  9753. position: 'fixed',
  9754. display: 'none',
  9755. zIndex: '1001',
  9756. opacity: 0,
  9757. WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear'
  9758. }),
  9759. document.body.appendChild(this.backgroundElement),
  9760. document.body.appendChild(this.domElement)
  9761. var e = this
  9762. n.bind(this.backgroundElement, 'click', function () {
  9763. e.hide()
  9764. })
  9765. }
  9766. function ie(e, t, i) {
  9767. Object.defineProperty(e, t, {
  9768. get: function () {
  9769. return 'RGB' === this.__state.space || re(this, t, i), this.__state[t]
  9770. },
  9771. set: function (e) {
  9772. 'RGB' !== this.__state.space && (re(this, t, i), (this.__state.space = 'RGB')), (this.__state[t] = e)
  9773. }
  9774. })
  9775. }
  9776. function ne(e, t) {
  9777. Object.defineProperty(e, t, {
  9778. get: function () {
  9779. return 'HSV' === this.__state.space || oe(this), this.__state[t]
  9780. },
  9781. set: function (e) {
  9782. 'HSV' !== this.__state.space && (oe(this), (this.__state.space = 'HSV')), (this.__state[t] = e)
  9783. }
  9784. })
  9785. }
  9786. function re(e, t, i) {
  9787. if ('HEX' === e.__state.space) e.__state[t] = a.component_from_hex(e.__state.hex, i)
  9788. else {
  9789. if ('HSV' !== e.__state.space) throw 'Corrupted color state'
  9790. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9791. }
  9792. }
  9793. function oe(e) {
  9794. var t = a.rgb_to_hsv(e.r, e.g, e.b)
  9795. l.extend(e.__state, {
  9796. s: t.s,
  9797. v: t.v
  9798. }),
  9799. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : (e.__state.h = t.h)
  9800. }
  9801. function ae() {
  9802. if (((this.__state = o.apply(this, arguments)), !1 === this.__state)) throw 'Failed to interpret color arguments'
  9803. this.__state.a = this.__state.a || 1
  9804. }
  9805. function se(e) {
  9806. return -1 < (e = e.toString()).indexOf('.') ? e.length - e.indexOf('.') - 1 : 0
  9807. }
  9808. function le(e, t) {
  9809. ;(this.initialValue = e[t]), (this.domElement = document.createElement('div')), (this.object = e), (this.property = t), (this.__onChange = void 0), (this.__onFinishChange = void 0)
  9810. }
  9811. ;((t.exports = ee).gui = ee.gui || {}),
  9812. (ee.utils = ee.utils || {}),
  9813. (ee.controllers = ee.controllers || {}),
  9814. (ee.dom = ee.dom || {}),
  9815. (ee.color = ee.color || {}),
  9816. (ee.utils.css = {
  9817. load: function (e, t) {
  9818. var i = (t = t || document).createElement('link')
  9819. ;(i.type = 'text/css'), (i.rel = 'stylesheet'), (i.href = e), t.getElementsByTagName('head')[0].appendChild(i)
  9820. },
  9821. inject: function (e, t) {
  9822. t = t || document
  9823. var i = document.createElement('style')
  9824. ;(i.type = 'text/css'), (i.innerHTML = e), t.getElementsByTagName('head')[0].appendChild(i)
  9825. }
  9826. }),
  9827. (ee.utils.common =
  9828. ((Q = Array.prototype.forEach),
  9829. (J = Array.prototype.slice),
  9830. {
  9831. BREAK: {},
  9832. extend: function (i) {
  9833. return (
  9834. this.each(
  9835. J.call(arguments, 1),
  9836. function (e) {
  9837. for (var t in e) this.isUndefined(e[t]) || (i[t] = e[t])
  9838. },
  9839. this
  9840. ),
  9841. i
  9842. )
  9843. },
  9844. defaults: function (i) {
  9845. return (
  9846. this.each(
  9847. J.call(arguments, 1),
  9848. function (e) {
  9849. for (var t in e) this.isUndefined(i[t]) && (i[t] = e[t])
  9850. },
  9851. this
  9852. ),
  9853. i
  9854. )
  9855. },
  9856. compose: function () {
  9857. var i = J.call(arguments)
  9858. return function () {
  9859. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--) e = [i[t].apply(this, e)]
  9860. return e[0]
  9861. }
  9862. },
  9863. each: function (e, t, i) {
  9864. if (e)
  9865. if (Q && e.forEach && e.forEach === Q) e.forEach(t, i)
  9866. else if (e.length === e.length + 0) {
  9867. for (var n = 0, r = e.length; n < r; n++) if (n in e && t.call(i, e[n], n) === this.BREAK) return
  9868. } else for (var n in e) if (t.call(i, e[n], n) === this.BREAK) return
  9869. },
  9870. defer: function (e) {
  9871. setTimeout(e, 0)
  9872. },
  9873. toArray: function (e) {
  9874. return e.toArray ? e.toArray() : J.call(e)
  9875. },
  9876. isUndefined: function (e) {
  9877. return void 0 === e
  9878. },
  9879. isNull: function (e) {
  9880. return null === e
  9881. },
  9882. isNaN: function (e) {
  9883. return e != e
  9884. },
  9885. isArray:
  9886. Array.isArray ||
  9887. function (e) {
  9888. return e.constructor === Array
  9889. },
  9890. isObject: function (e) {
  9891. return e === Object(e)
  9892. },
  9893. isNumber: function (e) {
  9894. return e === e + 0
  9895. },
  9896. isString: function (e) {
  9897. return e === e + ''
  9898. },
  9899. isBoolean: function (e) {
  9900. return !1 === e || !0 === e
  9901. },
  9902. isFunction: function (e) {
  9903. return '[object Function]' === Object.prototype.toString.call(e)
  9904. }
  9905. })),
  9906. (ee.controllers.Controller =
  9907. (ee.utils.common.extend(le.prototype, {
  9908. onChange: function (e) {
  9909. return (this.__onChange = e), this
  9910. },
  9911. onFinishChange: function (e) {
  9912. return (this.__onFinishChange = e), this
  9913. },
  9914. setValue: function (e) {
  9915. return (this.object[this.property] = e), this.__onChange && this.__onChange.call(this, e), this.updateDisplay(), this
  9916. },
  9917. getValue: function () {
  9918. return this.object[this.property]
  9919. },
  9920. updateDisplay: function () {
  9921. return this
  9922. },
  9923. isModified: function () {
  9924. return this.initialValue !== this.getValue()
  9925. }
  9926. }),
  9927. le)),
  9928. (ee.dom.dom = (function (c) {
  9929. function i(e) {
  9930. if ('0' === e || c.isUndefined(e)) return 0
  9931. var t = e.match(n)
  9932. return c.isNull(t) ? 0 : parseFloat(t[1])
  9933. }
  9934. var h = {}
  9935. c.each(
  9936. {
  9937. HTMLEvents: ['change'],
  9938. MouseEvents: ['click', 'mousemove', 'mousedown', 'mouseup', 'mouseover'],
  9939. KeyboardEvents: ['keydown']
  9940. },
  9941. function (e, t) {
  9942. c.each(e, function (e) {
  9943. h[e] = t
  9944. })
  9945. }
  9946. )
  9947. var n = /(\d+(\.\d+)?)px/,
  9948. r = {
  9949. makeSelectable: function (e, t) {
  9950. void 0 !== e &&
  9951. void 0 !== e.style &&
  9952. ((e.onselectstart = t
  9953. ? function () {
  9954. return !1
  9955. }
  9956. : function () {}),
  9957. (e.style.MozUserSelect = t ? 'auto' : 'none'),
  9958. (e.style.KhtmlUserSelect = t ? 'auto' : 'none'),
  9959. (e.unselectable = t ? 'on' : 'off'))
  9960. },
  9961. makeFullscreen: function (e, t, i) {
  9962. c.isUndefined(t) && (t = !0),
  9963. c.isUndefined(i) && (i = !0),
  9964. (e.style.position = 'absolute'),
  9965. t && ((e.style.left = 0), (e.style.right = 0)),
  9966. i && ((e.style.top = 0), (e.style.bottom = 0))
  9967. },
  9968. fakeEvent: function (e, t, i, n) {
  9969. i = i || {}
  9970. var r = h[t]
  9971. if (!r) throw new Error('Event type ' + t + ' not supported.')
  9972. var o = document.createEvent(r)
  9973. switch (r) {
  9974. case 'MouseEvents':
  9975. var a = i.x || i.clientX || 0,
  9976. s = i.y || i.clientY || 0
  9977. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null)
  9978. break
  9979. case 'KeyboardEvents':
  9980. var l = o.initKeyboardEvent || o.initKeyEvent
  9981. c.defaults(i, {
  9982. cancelable: !0,
  9983. ctrlKey: !1,
  9984. altKey: !1,
  9985. shiftKey: !1,
  9986. metaKey: !1,
  9987. keyCode: void 0,
  9988. charCode: void 0
  9989. }),
  9990. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode)
  9991. break
  9992. default:
  9993. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9994. }
  9995. c.defaults(o, n), e.dispatchEvent(o)
  9996. },
  9997. bind: function (e, t, i, n) {
  9998. return (n = n || !1), e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent('on' + t, i), r
  9999. },
  10000. unbind: function (e, t, i, n) {
  10001. return (n = n || !1), e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent('on' + t, i), r
  10002. },
  10003. addClass: function (e, t) {
  10004. if (void 0 === e.className) e.className = t
  10005. else if (e.className !== t) {
  10006. var i = e.className.split(/ +/)
  10007. ;-1 == i.indexOf(t) && (i.push(t), (e.className = i.join(' ').replace(/^\s+/, '').replace(/\s+$/, '')))
  10008. }
  10009. return r
  10010. },
  10011. removeClass: function (e, t) {
  10012. if (t)
  10013. if (void 0 === e.className);
  10014. else if (e.className === t) e.removeAttribute('class')
  10015. else {
  10016. var i = e.className.split(/ +/),
  10017. n = i.indexOf(t)
  10018. ;-1 != n && (i.splice(n, 1), (e.className = i.join(' ')))
  10019. }
  10020. else e.className = void 0
  10021. return r
  10022. },
  10023. hasClass: function (e, t) {
  10024. return new RegExp('(?:^|\\s+)' + t + '(?:\\s+|$)').test(e.className) || !1
  10025. },
  10026. getWidth: function (e) {
  10027. var t = getComputedStyle(e)
  10028. return i(t['border-left-width']) + i(t['border-right-width']) + i(t['padding-left']) + i(t['padding-right']) + i(t.width)
  10029. },
  10030. getHeight: function (e) {
  10031. var t = getComputedStyle(e)
  10032. return i(t['border-top-width']) + i(t['border-bottom-width']) + i(t['padding-top']) + i(t['padding-bottom']) + i(t.height)
  10033. },
  10034. getOffset: function (e) {
  10035. var t = {
  10036. left: 0,
  10037. top: 0
  10038. }
  10039. if (e.offsetParent) for (; (t.left += e.offsetLeft), (t.top += e.offsetTop), (e = e.offsetParent); );
  10040. return t
  10041. },
  10042. isActive: function (e) {
  10043. return e === document.activeElement && (e.type || e.href)
  10044. }
  10045. }
  10046. return r
  10047. })(ee.utils.common)),
  10048. (ee.controllers.OptionController =
  10049. ((q = ee.controllers.Controller),
  10050. (X = ee.dom.dom),
  10051. (Z = ee.utils.common),
  10052. ((K = function (e, t, i) {
  10053. K.superclass.call(this, e, t)
  10054. var n = this
  10055. if (((this.__select = document.createElement('select')), Z.isArray(i))) {
  10056. var r = {}
  10057. Z.each(i, function (e) {
  10058. r[e] = e
  10059. }),
  10060. (i = r)
  10061. }
  10062. Z.each(i, function (e, t) {
  10063. var i = document.createElement('option')
  10064. ;(i.innerHTML = t), i.setAttribute('value', e), n.__select.appendChild(i)
  10065. }),
  10066. this.updateDisplay(),
  10067. X.bind(this.__select, 'change', function () {
  10068. var e = this.options[this.selectedIndex].value
  10069. n.setValue(e)
  10070. }),
  10071. this.domElement.appendChild(this.__select)
  10072. }).superclass = q),
  10073. Z.extend(K.prototype, q.prototype, {
  10074. setValue: function (e) {
  10075. var t = K.superclass.prototype.setValue.call(this, e)
  10076. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), t
  10077. },
  10078. updateDisplay: function () {
  10079. return (this.__select.value = this.getValue()), K.superclass.prototype.updateDisplay.call(this)
  10080. }
  10081. }),
  10082. K)),
  10083. (ee.controllers.NumberController =
  10084. ((W = ee.controllers.Controller),
  10085. (j = ee.utils.common),
  10086. ((Y = function (e, t, i) {
  10087. Y.superclass.call(this, e, t),
  10088. (i = i || {}),
  10089. (this.__min = i.min),
  10090. (this.__max = i.max),
  10091. (this.__step = i.step),
  10092. j.isUndefined(this.__step)
  10093. ? 0 == this.initialValue
  10094. ? (this.__impliedStep = 1)
  10095. : (this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10)
  10096. : (this.__impliedStep = this.__step),
  10097. (this.__precision = se(this.__impliedStep))
  10098. }).superclass = W),
  10099. j.extend(Y.prototype, W.prototype, {
  10100. setValue: function (e) {
  10101. return (
  10102. void 0 !== this.__min && e < this.__min ? (e = this.__min) : void 0 !== this.__max && e > this.__max && (e = this.__max),
  10103. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  10104. Y.superclass.prototype.setValue.call(this, e)
  10105. )
  10106. },
  10107. min: function (e) {
  10108. return (this.__min = e), this
  10109. },
  10110. max: function (e) {
  10111. return (this.__max = e), this
  10112. },
  10113. step: function (e) {
  10114. return (this.__step = e), (this.__impliedStep = e), (this.__precision = se(e)), this
  10115. }
  10116. }),
  10117. Y)),
  10118. (ee.controllers.NumberControllerBox =
  10119. ((U = ee.controllers.NumberController),
  10120. (H = ee.dom.dom),
  10121. (z = ee.utils.common),
  10122. ((G = function (e, t, i) {
  10123. function n() {
  10124. var e = parseFloat(s.__input.value)
  10125. z.isNaN(e) || s.setValue(e)
  10126. }
  10127. function r(e) {
  10128. var t = a - e.clientY
  10129. s.setValue(s.getValue() + t * s.__impliedStep), (a = e.clientY)
  10130. }
  10131. function o() {
  10132. H.unbind(window, 'mousemove', r), H.unbind(window, 'mouseup', o)
  10133. }
  10134. ;(this.__truncationSuspended = !1), G.superclass.call(this, e, t, i)
  10135. var a,
  10136. s = this
  10137. ;(this.__input = document.createElement('input')),
  10138. this.__input.setAttribute('type', 'text'),
  10139. H.bind(this.__input, 'change', n),
  10140. H.bind(this.__input, 'blur', function () {
  10141. n(), s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  10142. }),
  10143. H.bind(this.__input, 'mousedown', function (e) {
  10144. H.bind(window, 'mousemove', r), H.bind(window, 'mouseup', o), (a = e.clientY)
  10145. }),
  10146. H.bind(this.__input, 'keydown', function (e) {
  10147. 13 === e.keyCode && ((s.__truncationSuspended = !0), this.blur(), (s.__truncationSuspended = !1))
  10148. }),
  10149. this.updateDisplay(),
  10150. this.domElement.appendChild(this.__input)
  10151. }).superclass = U),
  10152. z.extend(G.prototype, U.prototype, {
  10153. updateDisplay: function () {
  10154. return (
  10155. (this.__input.value = this.__truncationSuspended
  10156. ? this.getValue()
  10157. : (function (e, t) {
  10158. var i = Math.pow(10, t)
  10159. return Math.round(e * i) / i
  10160. })(this.getValue(), this.__precision)),
  10161. G.superclass.prototype.updateDisplay.call(this)
  10162. )
  10163. }
  10164. }),
  10165. G)),
  10166. (ee.controllers.NumberControllerSlider =
  10167. ((N = ee.controllers.NumberController),
  10168. (F = ee.dom.dom),
  10169. (B = ee.utils.css),
  10170. (V = ee.utils.common),
  10171. ((k = function (e, t, i, n, r) {
  10172. function o(e) {
  10173. e.preventDefault()
  10174. var t = F.getOffset(s.__background),
  10175. i = F.getWidth(s.__background)
  10176. return (
  10177. s.setValue(
  10178. (function (e, t, i, n, r) {
  10179. return n + ((e - t) / (i - t)) * (r - n)
  10180. })(e.clientX, t.left, t.left + i, s.__min, s.__max)
  10181. ),
  10182. !1
  10183. )
  10184. }
  10185. function a() {
  10186. F.unbind(window, 'mousemove', o), F.unbind(window, 'mouseup', a), s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  10187. }
  10188. k.superclass.call(this, e, t, {
  10189. min: i,
  10190. max: n,
  10191. step: r
  10192. })
  10193. var s = this
  10194. ;(this.__background = document.createElement('div')),
  10195. (this.__foreground = document.createElement('div')),
  10196. F.bind(this.__background, 'mousedown', function (e) {
  10197. F.bind(window, 'mousemove', o), F.bind(window, 'mouseup', a), o(e)
  10198. }),
  10199. F.addClass(this.__background, 'slider'),
  10200. F.addClass(this.__foreground, 'slider-fg'),
  10201. this.updateDisplay(),
  10202. this.__background.appendChild(this.__foreground),
  10203. this.domElement.appendChild(this.__background)
  10204. }).superclass = N),
  10205. (k.useDefaultStyles = function () {
  10206. B.inject(
  10207. '/**\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}'
  10208. )
  10209. }),
  10210. V.extend(k.prototype, N.prototype, {
  10211. updateDisplay: function () {
  10212. var e = (this.getValue() - this.__min) / (this.__max - this.__min)
  10213. return (this.__foreground.style.width = 100 * e + '%'), k.superclass.prototype.updateDisplay.call(this)
  10214. }
  10215. }),
  10216. k)),
  10217. (ee.controllers.FunctionController =
  10218. ((P = ee.controllers.Controller),
  10219. (O = ee.dom.dom),
  10220. (L = ee.utils.common),
  10221. ((D = function (e, t, i) {
  10222. D.superclass.call(this, e, t)
  10223. var n = this
  10224. ;(this.__button = document.createElement('div')),
  10225. (this.__button.innerHTML = void 0 === i ? 'Fire' : i),
  10226. O.bind(this.__button, 'click', function (e) {
  10227. return e.preventDefault(), n.fire(), !1
  10228. }),
  10229. O.addClass(this.__button, 'button'),
  10230. this.domElement.appendChild(this.__button)
  10231. }).superclass = P),
  10232. L.extend(D.prototype, P.prototype, {
  10233. fire: function () {
  10234. this.__onChange && this.__onChange.call(this), this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), this.getValue().call(this.object)
  10235. }
  10236. }),
  10237. D)),
  10238. (ee.controllers.BooleanController =
  10239. ((x = ee.controllers.Controller),
  10240. (S = ee.dom.dom),
  10241. (M = ee.utils.common),
  10242. ((R = function (e, t) {
  10243. R.superclass.call(this, e, t)
  10244. var i = this
  10245. ;(this.__prev = this.getValue()),
  10246. (this.__checkbox = document.createElement('input')),
  10247. this.__checkbox.setAttribute('type', 'checkbox'),
  10248. S.bind(
  10249. this.__checkbox,
  10250. 'change',
  10251. function () {
  10252. i.setValue(!i.__prev)
  10253. },
  10254. !1
  10255. ),
  10256. this.domElement.appendChild(this.__checkbox),
  10257. this.updateDisplay()
  10258. }).superclass = x),
  10259. M.extend(R.prototype, x.prototype, {
  10260. setValue: function (e) {
  10261. var t = R.superclass.prototype.setValue.call(this, e)
  10262. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), (this.__prev = this.getValue()), t
  10263. },
  10264. updateDisplay: function () {
  10265. return (
  10266. !0 === this.getValue() ? (this.__checkbox.setAttribute('checked', 'checked'), (this.__checkbox.checked = !0)) : (this.__checkbox.checked = !1),
  10267. R.superclass.prototype.updateDisplay.call(this)
  10268. )
  10269. }
  10270. }),
  10271. R)),
  10272. (ee.color.toString =
  10273. ((T = ee.utils.common),
  10274. function (e) {
  10275. if (1 == e.a || T.isUndefined(e.a)) {
  10276. for (var t = e.hex.toString(16); t.length < 6; ) t = '0' + t
  10277. return '#' + t
  10278. }
  10279. return 'rgba(' + Math.round(e.r) + ',' + Math.round(e.g) + ',' + Math.round(e.b) + ',' + e.a + ')'
  10280. })),
  10281. (ee.color.interpret =
  10282. ((I = ee.color.toString),
  10283. (E = ee.utils.common),
  10284. (w = [
  10285. {
  10286. litmus: E.isString,
  10287. conversions: {
  10288. THREE_CHAR_HEX: {
  10289. read: function (e) {
  10290. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i)
  10291. return (
  10292. null !== t && {
  10293. space: 'HEX',
  10294. hex: parseInt('0x' + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10295. }
  10296. )
  10297. },
  10298. write: I
  10299. },
  10300. SIX_CHAR_HEX: {
  10301. read: function (e) {
  10302. var t = e.match(/^#([A-F0-9]{6})$/i)
  10303. return (
  10304. null !== t && {
  10305. space: 'HEX',
  10306. hex: parseInt('0x' + t[1].toString())
  10307. }
  10308. )
  10309. },
  10310. write: I
  10311. },
  10312. CSS_RGB: {
  10313. read: function (e) {
  10314. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/)
  10315. return (
  10316. null !== t && {
  10317. space: 'RGB',
  10318. r: parseFloat(t[1]),
  10319. g: parseFloat(t[2]),
  10320. b: parseFloat(t[3])
  10321. }
  10322. )
  10323. },
  10324. write: I
  10325. },
  10326. CSS_RGBA: {
  10327. read: function (e) {
  10328. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/)
  10329. return (
  10330. null !== t && {
  10331. space: 'RGB',
  10332. r: parseFloat(t[1]),
  10333. g: parseFloat(t[2]),
  10334. b: parseFloat(t[3]),
  10335. a: parseFloat(t[4])
  10336. }
  10337. )
  10338. },
  10339. write: I
  10340. }
  10341. }
  10342. },
  10343. {
  10344. litmus: E.isNumber,
  10345. conversions: {
  10346. HEX: {
  10347. read: function (e) {
  10348. return {
  10349. space: 'HEX',
  10350. hex: e,
  10351. conversionName: 'HEX'
  10352. }
  10353. },
  10354. write: function (e) {
  10355. return e.hex
  10356. }
  10357. }
  10358. }
  10359. },
  10360. {
  10361. litmus: E.isArray,
  10362. conversions: {
  10363. RGB_ARRAY: {
  10364. read: function (e) {
  10365. return (
  10366. 3 == e.length && {
  10367. space: 'RGB',
  10368. r: e[0],
  10369. g: e[1],
  10370. b: e[2]
  10371. }
  10372. )
  10373. },
  10374. write: function (e) {
  10375. return [e.r, e.g, e.b]
  10376. }
  10377. },
  10378. RGBA_ARRAY: {
  10379. read: function (e) {
  10380. return (
  10381. 4 == e.length && {
  10382. space: 'RGB',
  10383. r: e[0],
  10384. g: e[1],
  10385. b: e[2],
  10386. a: e[3]
  10387. }
  10388. )
  10389. },
  10390. write: function (e) {
  10391. return [e.r, e.g, e.b, e.a]
  10392. }
  10393. }
  10394. }
  10395. },
  10396. {
  10397. litmus: E.isObject,
  10398. conversions: {
  10399. RGBA_OBJ: {
  10400. read: function (e) {
  10401. return (
  10402. !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  10403. space: 'RGB',
  10404. r: e.r,
  10405. g: e.g,
  10406. b: e.b,
  10407. a: e.a
  10408. }
  10409. )
  10410. },
  10411. write: function (e) {
  10412. return {
  10413. r: e.r,
  10414. g: e.g,
  10415. b: e.b,
  10416. a: e.a
  10417. }
  10418. }
  10419. },
  10420. RGB_OBJ: {
  10421. read: function (e) {
  10422. return (
  10423. !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  10424. space: 'RGB',
  10425. r: e.r,
  10426. g: e.g,
  10427. b: e.b
  10428. }
  10429. )
  10430. },
  10431. write: function (e) {
  10432. return {
  10433. r: e.r,
  10434. g: e.g,
  10435. b: e.b
  10436. }
  10437. }
  10438. },
  10439. HSVA_OBJ: {
  10440. read: function (e) {
  10441. return (
  10442. !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  10443. space: 'HSV',
  10444. h: e.h,
  10445. s: e.s,
  10446. v: e.v,
  10447. a: e.a
  10448. }
  10449. )
  10450. },
  10451. write: function (e) {
  10452. return {
  10453. h: e.h,
  10454. s: e.s,
  10455. v: e.v,
  10456. a: e.a
  10457. }
  10458. }
  10459. },
  10460. HSV_OBJ: {
  10461. read: function (e) {
  10462. return (
  10463. !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  10464. space: 'HSV',
  10465. h: e.h,
  10466. s: e.s,
  10467. v: e.v
  10468. }
  10469. )
  10470. },
  10471. write: function (e) {
  10472. return {
  10473. h: e.h,
  10474. s: e.s,
  10475. v: e.v
  10476. }
  10477. }
  10478. }
  10479. }
  10480. }
  10481. ]),
  10482. function () {
  10483. b = !1
  10484. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0]
  10485. return (
  10486. E.each(w, function (e) {
  10487. if (e.litmus(i))
  10488. return (
  10489. E.each(e.conversions, function (e, t) {
  10490. if (((_ = e.read(i)), !1 === b && !1 !== _)) return ((b = _).conversionName = t), (_.conversion = e), E.BREAK
  10491. }),
  10492. E.BREAK
  10493. )
  10494. }),
  10495. b
  10496. )
  10497. })),
  10498. (ee.GUI = ee.gui.GUI =
  10499. (function (e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10500. function y(e, t, i, n) {
  10501. if (void 0 === t[i]) throw new Error('Object ' + t + ' has no property "' + i + '"')
  10502. var r
  10503. if (n.color) r = new g(t, i)
  10504. else {
  10505. var o = [t, i].concat(n.factoryArgs)
  10506. r = c.apply(e, o)
  10507. }
  10508. n.before instanceof h && (n.before = n.before.__li), C(e, r), m.addClass(r.domElement, 'c')
  10509. var a = document.createElement('span')
  10510. m.addClass(a, 'property-name'), (a.innerHTML = r.property)
  10511. var s = document.createElement('div')
  10512. s.appendChild(a), s.appendChild(r.domElement)
  10513. var l = A(e, s, n.before)
  10514. return (
  10515. m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10516. m.addClass(l, typeof r.getValue()),
  10517. (function (t, i, n) {
  10518. if (
  10519. ((n.__li = i),
  10520. (n.__gui = t),
  10521. v.extend(n, {
  10522. options: function (e) {
  10523. return 1 < arguments.length
  10524. ? (n.remove(),
  10525. y(t, n.object, n.property, {
  10526. before: n.__li.nextElementSibling,
  10527. factoryArgs: [v.toArray(arguments)]
  10528. }))
  10529. : v.isArray(e) || v.isObject(e)
  10530. ? (n.remove(),
  10531. y(t, n.object, n.property, {
  10532. before: n.__li.nextElementSibling,
  10533. factoryArgs: [e]
  10534. }))
  10535. : void 0
  10536. },
  10537. name: function (e) {
  10538. return (n.__li.firstElementChild.firstElementChild.innerHTML = e), n
  10539. },
  10540. listen: function () {
  10541. return n.__gui.listen(n), n
  10542. },
  10543. remove: function () {
  10544. return n.__gui.remove(n), n
  10545. }
  10546. }),
  10547. n instanceof f)
  10548. ) {
  10549. var r = new p(n.object, n.property, {
  10550. min: n.__min,
  10551. max: n.__max,
  10552. step: n.__step
  10553. })
  10554. v.each(['updateDisplay', 'onChange', 'onFinishChange'], function (e) {
  10555. var t = n[e],
  10556. i = r[e]
  10557. n[e] = r[e] = function () {
  10558. var e = Array.prototype.slice.call(arguments)
  10559. return t.apply(n, e), i.apply(r, e)
  10560. }
  10561. }),
  10562. m.addClass(i, 'has-slider'),
  10563. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10564. } else if (n instanceof p) {
  10565. var e = function (e) {
  10566. return v.isNumber(n.__min) && v.isNumber(n.__max)
  10567. ? (n.remove(),
  10568. y(t, n.object, n.property, {
  10569. before: n.__li.nextElementSibling,
  10570. factoryArgs: [n.__min, n.__max, n.__step]
  10571. }))
  10572. : e
  10573. }
  10574. ;(n.min = v.compose(e, n.min)), (n.max = v.compose(e, n.max))
  10575. } else
  10576. n instanceof u
  10577. ? (m.bind(i, 'click', function () {
  10578. m.fakeEvent(n.__checkbox, 'click')
  10579. }),
  10580. m.bind(n.__checkbox, 'click', function (e) {
  10581. e.stopPropagation()
  10582. }))
  10583. : n instanceof d
  10584. ? (m.bind(i, 'click', function () {
  10585. m.fakeEvent(n.__button, 'click')
  10586. }),
  10587. m.bind(i, 'mouseover', function () {
  10588. m.addClass(n.__button, 'hover')
  10589. }),
  10590. m.bind(i, 'mouseout', function () {
  10591. m.removeClass(n.__button, 'hover')
  10592. }))
  10593. : n instanceof g &&
  10594. (m.addClass(i, 'color'),
  10595. (n.updateDisplay = v.compose(function (e) {
  10596. return (i.style.borderLeftColor = n.__color.toString()), e
  10597. }, n.updateDisplay)),
  10598. n.updateDisplay())
  10599. n.setValue = v.compose(function (e) {
  10600. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0), e
  10601. }, n.setValue)
  10602. })(e, l, r),
  10603. e.__controllers.push(r),
  10604. r
  10605. )
  10606. }
  10607. function A(e, t, i) {
  10608. var n = document.createElement('li')
  10609. return t && n.appendChild(t), i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n), e.onResize(), n
  10610. }
  10611. function C(e, t) {
  10612. var i = e.getRoot(),
  10613. n = i.__rememberedObjects.indexOf(t.object)
  10614. if (-1 != n) {
  10615. var r = i.__rememberedObjectIndecesToControllers[n]
  10616. if ((void 0 === r && ((r = {}), (i.__rememberedObjectIndecesToControllers[n] = r)), (r[t.property] = t), i.load && i.load.remembered)) {
  10617. var o,
  10618. a = i.load.remembered
  10619. if (a[e.preset]) o = a[e.preset]
  10620. else {
  10621. if (!a[T]) return
  10622. o = a[T]
  10623. }
  10624. if (o[n] && void 0 !== o[n][t.property]) {
  10625. var s = o[n][t.property]
  10626. ;(t.initialValue = s), t.setValue(s)
  10627. }
  10628. }
  10629. }
  10630. }
  10631. function I(e, t) {
  10632. return document.location.href + '.' + t
  10633. }
  10634. function l(e, t) {
  10635. ;(e.domElement.style.width = t + 'px'), e.__save_row && e.autoPlace && (e.__save_row.style.width = t + 'px'), e.__closeButton && (e.__closeButton.style.width = t + 'px')
  10636. }
  10637. function a(r, o) {
  10638. var a = {}
  10639. return (
  10640. v.each(r.__rememberedObjects, function (e, t) {
  10641. var i = {},
  10642. n = r.__rememberedObjectIndecesToControllers[t]
  10643. v.each(n, function (e, t) {
  10644. i[t] = o ? e.initialValue : e.getValue()
  10645. }),
  10646. (a[t] = i)
  10647. }),
  10648. a
  10649. )
  10650. }
  10651. function E(e, t, i) {
  10652. var n = document.createElement('option')
  10653. ;(n.innerHTML = t), (n.value = t), e.__preset_select.appendChild(n), i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10654. }
  10655. function _(e, t) {
  10656. var i = e.__preset_select[e.__preset_select.selectedIndex]
  10657. i.innerHTML = t ? i.value + '*' : i.value
  10658. }
  10659. e.inject(
  10660. ".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"
  10661. )
  10662. var b,
  10663. w,
  10664. T = 'Default',
  10665. x = (function () {
  10666. try {
  10667. return 'localStorage' in window && null !== window.localStorage
  10668. } catch (e) {
  10669. return !1
  10670. }
  10671. })(),
  10672. S = !0,
  10673. s = !1,
  10674. M = [],
  10675. R = function (t) {
  10676. var i = this
  10677. ;(this.domElement = document.createElement('div')),
  10678. (this.__ul = document.createElement('ul')),
  10679. this.domElement.appendChild(this.__ul),
  10680. m.addClass(this.domElement, 'dg'),
  10681. (this.__folders = {}),
  10682. (this.__controllers = []),
  10683. (this.__rememberedObjects = []),
  10684. (this.__rememberedObjectIndecesToControllers = []),
  10685. (this.__listening = []),
  10686. (t = t || {}),
  10687. (t = v.defaults(t, {
  10688. autoPlace: !0,
  10689. width: R.DEFAULT_WIDTH
  10690. })),
  10691. (t = v.defaults(t, {
  10692. resizable: t.autoPlace,
  10693. hideable: t.autoPlace
  10694. })),
  10695. v.isUndefined(t.load)
  10696. ? (t.load = {
  10697. preset: T
  10698. })
  10699. : t.preset && (t.load.preset = t.preset),
  10700. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10701. (t.resizable = v.isUndefined(t.parent) && t.resizable),
  10702. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0)
  10703. var n,
  10704. e,
  10705. r = x && 'true' === localStorage.getItem(I(0, 'isLocal'))
  10706. if (
  10707. (Object.defineProperties(this, {
  10708. parent: {
  10709. get: function () {
  10710. return t.parent
  10711. }
  10712. },
  10713. scrollable: {
  10714. get: function () {
  10715. return t.scrollable
  10716. }
  10717. },
  10718. autoPlace: {
  10719. get: function () {
  10720. return t.autoPlace
  10721. }
  10722. },
  10723. preset: {
  10724. get: function () {
  10725. return i.parent ? i.getRoot().preset : t.load.preset
  10726. },
  10727. set: function (e) {
  10728. i.parent ? (i.getRoot().preset = e) : (t.load.preset = e),
  10729. (function (e) {
  10730. for (var t = 0; t < e.__preset_select.length; t++) e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10731. })(this),
  10732. i.revert()
  10733. }
  10734. },
  10735. width: {
  10736. get: function () {
  10737. return t.width
  10738. },
  10739. set: function (e) {
  10740. ;(t.width = e), l(i, e)
  10741. }
  10742. },
  10743. name: {
  10744. get: function () {
  10745. return t.name
  10746. },
  10747. set: function (e) {
  10748. ;(t.name = e), a && (a.innerHTML = t.name)
  10749. }
  10750. },
  10751. closed: {
  10752. get: function () {
  10753. return t.closed
  10754. },
  10755. set: function (e) {
  10756. ;(t.closed = e),
  10757. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10758. this.onResize(),
  10759. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10760. }
  10761. },
  10762. load: {
  10763. get: function () {
  10764. return t.load
  10765. }
  10766. },
  10767. useLocalStorage: {
  10768. get: function () {
  10769. return r
  10770. },
  10771. set: function (e) {
  10772. x && ((r = e) ? m.bind(window, 'unload', n) : m.unbind(window, 'unload', n), localStorage.setItem(I(0, 'isLocal'), e))
  10773. }
  10774. }
  10775. }),
  10776. v.isUndefined(t.parent))
  10777. ) {
  10778. if (((t.closed = !1), m.addClass(this.domElement, R.CLASS_MAIN), m.makeSelectable(this.domElement, !1), x && r)) {
  10779. i.useLocalStorage = !0
  10780. var o = localStorage.getItem(I(0, 'gui'))
  10781. o && (t.load = JSON.parse(o))
  10782. }
  10783. ;(this.__closeButton = document.createElement('div')),
  10784. (this.__closeButton.innerHTML = R.TEXT_CLOSED),
  10785. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10786. this.domElement.appendChild(this.__closeButton),
  10787. m.bind(this.__closeButton, 'click', function () {
  10788. i.closed = !i.closed
  10789. })
  10790. } else {
  10791. void 0 === t.closed && (t.closed = !0)
  10792. var a = document.createTextNode(t.name)
  10793. m.addClass(a, 'controller-name')
  10794. var s = A(i, a)
  10795. m.addClass(this.__ul, R.CLASS_CLOSED),
  10796. m.addClass(s, 'title'),
  10797. m.bind(s, 'click', function (e) {
  10798. return e.preventDefault(), (i.closed = !i.closed), !1
  10799. }),
  10800. t.closed || (this.closed = !1)
  10801. }
  10802. t.autoPlace &&
  10803. (v.isUndefined(t.parent) &&
  10804. (S && ((w = document.createElement('div')), m.addClass(w, 'dg'), m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER), document.body.appendChild(w), (S = !1)),
  10805. w.appendChild(this.domElement),
  10806. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10807. this.parent || l(i, t.width)),
  10808. m.bind(window, 'resize', function () {
  10809. i.onResize()
  10810. }),
  10811. m.bind(this.__ul, 'webkitTransitionEnd', function () {
  10812. i.onResize()
  10813. }),
  10814. m.bind(this.__ul, 'transitionend', function () {
  10815. i.onResize()
  10816. }),
  10817. m.bind(this.__ul, 'oTransitionEnd', function () {
  10818. i.onResize()
  10819. }),
  10820. this.onResize(),
  10821. t.resizable &&
  10822. (function (t) {
  10823. function e(e) {
  10824. return e.preventDefault(), (r = e.clientX), m.addClass(t.__closeButton, R.CLASS_DRAG), m.bind(window, 'mousemove', i), m.bind(window, 'mouseup', n), !1
  10825. }
  10826. function i(e) {
  10827. return e.preventDefault(), (t.width += r - e.clientX), t.onResize(), (r = e.clientX), !1
  10828. }
  10829. function n() {
  10830. m.removeClass(t.__closeButton, R.CLASS_DRAG), m.unbind(window, 'mousemove', i), m.unbind(window, 'mouseup', n)
  10831. }
  10832. var r
  10833. ;(t.__resize_handle = document.createElement('div')),
  10834. v.extend(t.__resize_handle.style, {
  10835. width: '6px',
  10836. marginLeft: '-3px',
  10837. height: '200px',
  10838. cursor: 'ew-resize',
  10839. position: 'absolute'
  10840. }),
  10841. m.bind(t.__resize_handle, 'mousedown', e),
  10842. m.bind(t.__closeButton, 'mousedown', e),
  10843. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10844. })(this),
  10845. (n = function () {
  10846. x && 'true' === localStorage.getItem(I(0, 'isLocal')) && localStorage.setItem(I(0, 'gui'), JSON.stringify(i.getSaveObject()))
  10847. }),
  10848. (this.saveToLocalStorageIfPossible = n),
  10849. i.getRoot(),
  10850. t.parent ||
  10851. (((e = i.getRoot()).width += 1),
  10852. v.defer(function () {
  10853. e.width -= 1
  10854. }))
  10855. }
  10856. return (
  10857. (R.toggleHide = function () {
  10858. ;(s = !s),
  10859. v.each(M, function (e) {
  10860. ;(e.domElement.style.zIndex = s ? -999 : 999), (e.domElement.style.opacity = s ? 0 : 1)
  10861. })
  10862. }),
  10863. (R.CLASS_AUTO_PLACE = 'a'),
  10864. (R.CLASS_AUTO_PLACE_CONTAINER = 'ac'),
  10865. (R.CLASS_MAIN = 'main'),
  10866. (R.CLASS_CONTROLLER_ROW = 'cr'),
  10867. (R.CLASS_TOO_TALL = 'taller-than-window'),
  10868. (R.CLASS_CLOSED = 'closed'),
  10869. (R.CLASS_CLOSE_BUTTON = 'close-button'),
  10870. (R.CLASS_DRAG = 'drag'),
  10871. (R.DEFAULT_WIDTH = 245),
  10872. (R.TEXT_CLOSED = 'Close Controls'),
  10873. (R.TEXT_OPEN = 'Open Controls'),
  10874. m.bind(
  10875. window,
  10876. 'keydown',
  10877. function (e) {
  10878. 'text' === document.activeElement.type || (72 !== e.which && 72 != e.keyCode) || R.toggleHide()
  10879. },
  10880. !1
  10881. ),
  10882. v.extend(R.prototype, {
  10883. add: function (e, t) {
  10884. return y(this, e, t, {
  10885. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10886. })
  10887. },
  10888. addColor: function (e, t) {
  10889. return y(this, e, t, {
  10890. color: !0
  10891. })
  10892. },
  10893. remove: function (e) {
  10894. this.__ul.removeChild(e.__li), this.__controllers.slice(this.__controllers.indexOf(e), 1)
  10895. var t = this
  10896. v.defer(function () {
  10897. t.onResize()
  10898. })
  10899. },
  10900. destroy: function () {
  10901. this.autoPlace && w.removeChild(this.domElement)
  10902. },
  10903. addFolder: function (e) {
  10904. if (void 0 !== this.__folders[e]) throw new Error('You already have a folder in this GUI by the name "' + e + '"')
  10905. var t = {
  10906. name: e,
  10907. parent: this
  10908. }
  10909. ;(t.autoPlace = this.autoPlace), this.load && this.load.folders && this.load.folders[e] && ((t.closed = this.load.folders[e].closed), (t.load = this.load.folders[e]))
  10910. var i = new R(t)
  10911. this.__folders[e] = i
  10912. var n = A(this, i.domElement)
  10913. return m.addClass(n, 'folder'), i
  10914. },
  10915. open: function () {
  10916. this.closed = !1
  10917. },
  10918. close: function () {
  10919. this.closed = !0
  10920. },
  10921. onResize: function () {
  10922. var t = this.getRoot()
  10923. if (t.scrollable) {
  10924. var e = m.getOffset(t.__ul).top,
  10925. i = 0
  10926. v.each(t.__ul.childNodes, function (e) {
  10927. ;(t.autoPlace && e === t.__save_row) || (i += m.getHeight(e))
  10928. }),
  10929. $('#player').height() - e - 20 < i
  10930. ? (m.addClass(t.domElement, R.CLASS_TOO_TALL), (t.__ul.style.height = $('#player').height() - e - 20 + 'px'))
  10931. : (m.removeClass(t.domElement, R.CLASS_TOO_TALL), (t.__ul.style.height = 'auto'))
  10932. }
  10933. t.__resize_handle &&
  10934. v.defer(function () {
  10935. t.__resize_handle.style.height = t.__ul.offsetHeight + 'px'
  10936. }),
  10937. t.__closeButton && (t.__closeButton.style.width = t.width + 'px')
  10938. },
  10939. remember: function () {
  10940. if (
  10941. (v.isUndefined(b) &&
  10942. ((b = new o()).domElement.innerHTML =
  10943. '<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>'),
  10944. this.parent)
  10945. )
  10946. throw new Error('You can only call remember on a top level GUI.')
  10947. var t = this
  10948. v.each(Array.prototype.slice.call(arguments), function (e) {
  10949. 0 == t.__rememberedObjects.length &&
  10950. (function (i) {
  10951. var e = (i.__save_row = document.createElement('li'))
  10952. m.addClass(i.domElement, 'has-save'), i.__ul.insertBefore(e, i.__ul.firstChild), m.addClass(e, 'save-row')
  10953. var t = document.createElement('span')
  10954. ;(t.innerHTML = '&nbsp;'), m.addClass(t, 'button gears')
  10955. var n = document.createElement('span')
  10956. ;(n.innerHTML = 'Save'), m.addClass(n, 'button'), m.addClass(n, 'save')
  10957. var r = document.createElement('span')
  10958. ;(r.innerHTML = 'New'), m.addClass(r, 'button'), m.addClass(r, 'save-as')
  10959. var o = document.createElement('span')
  10960. ;(o.innerHTML = 'Revert'), m.addClass(o, 'button'), m.addClass(o, 'revert')
  10961. var a = (i.__preset_select = document.createElement('select'))
  10962. if (
  10963. (i.load && i.load.remembered
  10964. ? v.each(i.load.remembered, function (e, t) {
  10965. E(i, t, t == i.preset)
  10966. })
  10967. : E(i, T, !1),
  10968. m.bind(a, 'change', function () {
  10969. for (var e = 0; e < i.__preset_select.length; e++) i.__preset_select[e].innerHTML = i.__preset_select[e].value
  10970. i.preset = this.value
  10971. }),
  10972. e.appendChild(a),
  10973. e.appendChild(t),
  10974. e.appendChild(n),
  10975. e.appendChild(r),
  10976. e.appendChild(o),
  10977. x)
  10978. ) {
  10979. var s = document.getElementById('dg-save-locally'),
  10980. l = document.getElementById('dg-local-explain')
  10981. s.style.display = 'block'
  10982. var c = document.getElementById('dg-local-storage')
  10983. 'true' === localStorage.getItem(I(0, 'isLocal')) && c.setAttribute('checked', 'checked')
  10984. var h = function () {
  10985. l.style.display = i.useLocalStorage ? 'block' : 'none'
  10986. }
  10987. h(),
  10988. m.bind(c, 'change', function () {
  10989. ;(i.useLocalStorage = !i.useLocalStorage), h()
  10990. })
  10991. }
  10992. var u = document.getElementById('dg-new-constructor')
  10993. m.bind(u, 'keydown', function (e) {
  10994. !e.metaKey || (67 !== e.which && 67 != e.keyCode) || b.hide()
  10995. }),
  10996. m.bind(t, 'click', function () {
  10997. ;(u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2)), b.show(), u.focus(), u.select()
  10998. }),
  10999. m.bind(n, 'click', function () {
  11000. i.save()
  11001. }),
  11002. m.bind(r, 'click', function () {
  11003. var e = prompt('Enter a new preset name.')
  11004. e && i.saveAs(e)
  11005. }),
  11006. m.bind(o, 'click', function () {
  11007. i.revert()
  11008. })
  11009. })(t),
  11010. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  11011. }),
  11012. this.autoPlace && l(this, this.width)
  11013. },
  11014. getRoot: function () {
  11015. for (var e = this; e.parent; ) e = e.parent
  11016. return e
  11017. },
  11018. getSaveObject: function () {
  11019. var i = this.load
  11020. return (
  11021. (i.closed = this.closed),
  11022. 0 < this.__rememberedObjects.length && ((i.preset = this.preset), i.remembered || (i.remembered = {}), (i.remembered[this.preset] = a(this))),
  11023. (i.folders = {}),
  11024. v.each(this.__folders, function (e, t) {
  11025. i.folders[t] = e.getSaveObject()
  11026. }),
  11027. i
  11028. )
  11029. },
  11030. save: function () {
  11031. this.load.remembered || (this.load.remembered = {}), (this.load.remembered[this.preset] = a(this)), _(this, !1), this.saveToLocalStorageIfPossible()
  11032. },
  11033. saveAs: function (e) {
  11034. this.load.remembered || ((this.load.remembered = {}), (this.load.remembered[T] = a(this, !0))),
  11035. (this.load.remembered[e] = a(this)),
  11036. (this.preset = e),
  11037. E(this, e, !0),
  11038. this.saveToLocalStorageIfPossible()
  11039. },
  11040. revert: function (t) {
  11041. v.each(
  11042. this.__controllers,
  11043. function (e) {
  11044. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  11045. },
  11046. this
  11047. ),
  11048. v.each(this.__folders, function (e) {
  11049. e.revert(e)
  11050. }),
  11051. t || _(this.getRoot(), !1)
  11052. },
  11053. listen: function (e) {
  11054. var t = 0 == this.__listening.length
  11055. this.__listening.push(e),
  11056. t &&
  11057. (function e(t) {
  11058. 0 != t.length &&
  11059. r(function () {
  11060. e(t)
  11061. }),
  11062. v.each(t, function (e) {
  11063. e.updateDisplay()
  11064. })
  11065. })(this.__listening)
  11066. }
  11067. }),
  11068. R
  11069. )
  11070. })(
  11071. ee.utils.css,
  11072. 0,
  11073. 0,
  11074. (ee.controllers.factory =
  11075. ((h = ee.controllers.OptionController),
  11076. (u = ee.controllers.NumberControllerBox),
  11077. (d = ee.controllers.NumberControllerSlider),
  11078. (p = ee.controllers.StringController =
  11079. ((v = ee.controllers.Controller),
  11080. (y = ee.dom.dom),
  11081. (A = ee.utils.common),
  11082. ((C = function (e, t) {
  11083. function i() {
  11084. n.setValue(n.__input.value)
  11085. }
  11086. C.superclass.call(this, e, t)
  11087. var n = this
  11088. ;(this.__input = document.createElement('input')),
  11089. this.__input.setAttribute('type', 'text'),
  11090. y.bind(this.__input, 'keyup', i),
  11091. y.bind(this.__input, 'change', i),
  11092. y.bind(this.__input, 'blur', function () {
  11093. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  11094. }),
  11095. y.bind(this.__input, 'keydown', function (e) {
  11096. 13 === e.keyCode && this.blur()
  11097. }),
  11098. this.updateDisplay(),
  11099. this.domElement.appendChild(this.__input)
  11100. }).superclass = v),
  11101. A.extend(C.prototype, v.prototype, {
  11102. updateDisplay: function () {
  11103. return y.isActive(this.__input) || (this.__input.value = this.getValue()), C.superclass.prototype.updateDisplay.call(this)
  11104. }
  11105. }),
  11106. C)),
  11107. (f = ee.controllers.FunctionController),
  11108. (g = ee.controllers.BooleanController),
  11109. (m = ee.utils.common),
  11110. function (e, t) {
  11111. var i = e[t]
  11112. return m.isArray(arguments[2]) || m.isObject(arguments[2])
  11113. ? new h(e, t, arguments[2])
  11114. : m.isNumber(i)
  11115. ? m.isNumber(arguments[2]) && m.isNumber(arguments[3])
  11116. ? new d(e, t, arguments[2], arguments[3])
  11117. : new u(e, t, {
  11118. min: arguments[2],
  11119. max: arguments[3]
  11120. })
  11121. : m.isString(i)
  11122. ? new p(e, t)
  11123. : m.isFunction(i)
  11124. ? new f(e, t, '')
  11125. : m.isBoolean(i)
  11126. ? new g(e, t)
  11127. : void 0
  11128. })),
  11129. ee.controllers.Controller,
  11130. ee.controllers.BooleanController,
  11131. ee.controllers.FunctionController,
  11132. ee.controllers.NumberControllerBox,
  11133. ee.controllers.NumberControllerSlider,
  11134. ee.controllers.OptionController,
  11135. (ee.controllers.ColorController = (function (e, h, u, d, p) {
  11136. function f(t, i, n, r) {
  11137. ;(t.style.background = ''),
  11138. p.each(o, function (e) {
  11139. t.style.cssText += 'background: ' + e + 'linear-gradient(' + i + ', ' + n + ' 0%, ' + r + ' 100%); '
  11140. })
  11141. }
  11142. var g = function (e, t) {
  11143. function i(e) {
  11144. a(e), h.bind(window, 'mousemove', a), h.bind(window, 'mouseup', n)
  11145. }
  11146. function n() {
  11147. h.unbind(window, 'mousemove', a), h.unbind(window, 'mouseup', n)
  11148. }
  11149. function r() {
  11150. var e = d(this.value)
  11151. !1 !== e ? ((l.__color.__state = e), l.setValue(l.__color.toOriginal())) : (this.value = l.__color.toString())
  11152. }
  11153. function o() {
  11154. h.unbind(window, 'mousemove', s), h.unbind(window, 'mouseup', o)
  11155. }
  11156. function a(e) {
  11157. e.preventDefault()
  11158. var t = h.getWidth(l.__saturation_field),
  11159. i = h.getOffset(l.__saturation_field),
  11160. n = (e.clientX - i.left + document.body.scrollLeft) / t,
  11161. r = 1 - (e.clientY - i.top + document.body.scrollTop) / t
  11162. return 1 < r ? (r = 1) : r < 0 && (r = 0), 1 < n ? (n = 1) : n < 0 && (n = 0), (l.__color.v = r), (l.__color.s = n), l.setValue(l.__color.toOriginal()), !1
  11163. }
  11164. function s(e) {
  11165. e.preventDefault()
  11166. var t = h.getHeight(l.__hue_field),
  11167. i = h.getOffset(l.__hue_field),
  11168. n = 1 - (e.clientY - i.top + document.body.scrollTop) / t
  11169. return 1 < n ? (n = 1) : n < 0 && (n = 0), (l.__color.h = 360 * n), l.setValue(l.__color.toOriginal()), !1
  11170. }
  11171. g.superclass.call(this, e, t), (this.__color = new u(this.getValue())), (this.__temp = new u(0))
  11172. var l = this
  11173. ;(this.domElement = document.createElement('div')),
  11174. h.makeSelectable(this.domElement, !1),
  11175. (this.__selector = document.createElement('div')),
  11176. (this.__selector.className = 'selector'),
  11177. (this.__saturation_field = document.createElement('div')),
  11178. (this.__saturation_field.className = 'saturation-field'),
  11179. (this.__field_knob = document.createElement('div')),
  11180. (this.__field_knob.className = 'field-knob'),
  11181. (this.__field_knob_border = '2px solid '),
  11182. (this.__hue_knob = document.createElement('div')),
  11183. (this.__hue_knob.className = 'hue-knob'),
  11184. (this.__hue_field = document.createElement('div')),
  11185. (this.__hue_field.className = 'hue-field'),
  11186. (this.__input = document.createElement('input')),
  11187. (this.__input.type = 'text'),
  11188. (this.__input_textShadow = '0 1px 1px '),
  11189. h.bind(this.__input, 'keydown', function (e) {
  11190. 13 === e.keyCode && r.call(this)
  11191. }),
  11192. h.bind(this.__input, 'blur', r),
  11193. h.bind(this.__selector, 'mousedown', function (e) {
  11194. h.addClass(this, 'drag').bind(window, 'mouseup', function (e) {
  11195. h.removeClass(l.__selector, 'drag')
  11196. })
  11197. })
  11198. var c = document.createElement('div')
  11199. p.extend(this.__selector.style, {
  11200. width: '122px',
  11201. height: '102px',
  11202. padding: '3px',
  11203. backgroundColor: '#222',
  11204. boxShadow: '0px 1px 3px rgba(0,0,0,0.3)'
  11205. }),
  11206. p.extend(this.__field_knob.style, {
  11207. position: 'absolute',
  11208. width: '12px',
  11209. height: '12px',
  11210. border: this.__field_knob_border + (this.__color.v < 0.5 ? '#fff' : '#000'),
  11211. boxShadow: '0px 1px 3px rgba(0,0,0,0.5)',
  11212. borderRadius: '12px',
  11213. zIndex: 1
  11214. }),
  11215. p.extend(this.__hue_knob.style, {
  11216. position: 'absolute',
  11217. width: '15px',
  11218. height: '2px',
  11219. borderRight: '4px solid #fff',
  11220. zIndex: 1
  11221. }),
  11222. p.extend(this.__saturation_field.style, {
  11223. width: '100px',
  11224. height: '100px',
  11225. border: '1px solid #555',
  11226. marginRight: '3px',
  11227. display: 'inline-block',
  11228. cursor: 'pointer'
  11229. }),
  11230. p.extend(c.style, {
  11231. width: '100%',
  11232. height: '100%',
  11233. background: 'none'
  11234. }),
  11235. f(c, 'top', 'rgba(0,0,0,0)', '#000'),
  11236. p.extend(this.__hue_field.style, {
  11237. width: '15px',
  11238. height: '100px',
  11239. display: 'inline-block',
  11240. border: '1px solid #555',
  11241. cursor: 'ns-resize'
  11242. }),
  11243. (function (e) {
  11244. ;(e.style.background = ''),
  11245. (e.style.cssText += 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);'),
  11246. (e.style.cssText += 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  11247. (e.style.cssText += 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  11248. (e.style.cssText += 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  11249. (e.style.cssText += 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);')
  11250. })(this.__hue_field),
  11251. p.extend(this.__input.style, {
  11252. outline: 'none',
  11253. textAlign: 'center',
  11254. color: '#fff',
  11255. border: 0,
  11256. fontWeight: 'bold',
  11257. textShadow: this.__input_textShadow + 'rgba(0,0,0,0.7)'
  11258. }),
  11259. h.bind(this.__saturation_field, 'mousedown', i),
  11260. h.bind(this.__field_knob, 'mousedown', i),
  11261. h.bind(this.__hue_field, 'mousedown', function (e) {
  11262. s(e), h.bind(window, 'mousemove', s), h.bind(window, 'mouseup', o)
  11263. }),
  11264. this.__saturation_field.appendChild(c),
  11265. this.__selector.appendChild(this.__field_knob),
  11266. this.__selector.appendChild(this.__saturation_field),
  11267. this.__selector.appendChild(this.__hue_field),
  11268. this.__hue_field.appendChild(this.__hue_knob),
  11269. this.domElement.appendChild(this.__input),
  11270. this.domElement.appendChild(this.__selector),
  11271. this.updateDisplay()
  11272. }
  11273. ;(g.superclass = e),
  11274. p.extend(g.prototype, e.prototype, {
  11275. updateDisplay: function () {
  11276. var t = d(this.getValue())
  11277. if (!1 !== t) {
  11278. var i = !1
  11279. p.each(
  11280. u.COMPONENTS,
  11281. function (e) {
  11282. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e]) return (i = !0), {}
  11283. },
  11284. this
  11285. ),
  11286. i && p.extend(this.__color.__state, t)
  11287. }
  11288. p.extend(this.__temp.__state, this.__color.__state), (this.__temp.a = 1)
  11289. var e = this.__color.v < 0.5 || 0.5 < this.__color.s ? 255 : 0,
  11290. n = 255 - e
  11291. p.extend(this.__field_knob.style, {
  11292. marginLeft: 100 * this.__color.s - 7 + 'px',
  11293. marginTop: 100 * (1 - this.__color.v) - 7 + 'px',
  11294. backgroundColor: this.__temp.toString(),
  11295. border: this.__field_knob_border + 'rgb(' + e + ',' + e + ',' + e + ')'
  11296. }),
  11297. (this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + 'px'),
  11298. (this.__temp.s = 1),
  11299. (this.__temp.v = 1),
  11300. f(this.__saturation_field, 'left', '#fff', this.__temp.toString()),
  11301. p.extend(this.__input.style, {
  11302. backgroundColor: (this.__input.value = this.__color.toString()),
  11303. color: 'rgb(' + e + ',' + e + ',' + e + ')',
  11304. textShadow: this.__input_textShadow + 'rgba(' + n + ',' + n + ',' + n + ',.7)'
  11305. })
  11306. }
  11307. })
  11308. var o = ['-moz-', '-o-', '-webkit-', '-ms-', '']
  11309. return g
  11310. })(
  11311. ee.controllers.Controller,
  11312. ee.dom.dom,
  11313. (ee.color.Color =
  11314. ((o = ee.color.interpret),
  11315. (a = ee.color.math =
  11316. {
  11317. hsv_to_rgb: function (e, t, i) {
  11318. var n = Math.floor(e / 60) % 6,
  11319. r = e / 60 - Math.floor(e / 60),
  11320. o = i * (1 - t),
  11321. a = i * (1 - r * t),
  11322. s = i * (1 - (1 - r) * t),
  11323. l = [
  11324. [i, s, o],
  11325. [a, i, o],
  11326. [o, i, s],
  11327. [o, a, i],
  11328. [s, o, i],
  11329. [i, o, a]
  11330. ][n]
  11331. return {
  11332. r: 255 * l[0],
  11333. g: 255 * l[1],
  11334. b: 255 * l[2]
  11335. }
  11336. },
  11337. rgb_to_hsv: function (e, t, i) {
  11338. var n,
  11339. r = Math.min(e, t, i),
  11340. o = Math.max(e, t, i),
  11341. a = o - r
  11342. return 0 == o
  11343. ? {
  11344. h: NaN,
  11345. s: 0,
  11346. v: 0
  11347. }
  11348. : ((n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a),
  11349. (n /= 6) < 0 && (n += 1),
  11350. {
  11351. h: 360 * n,
  11352. s: a / o,
  11353. v: o / 255
  11354. })
  11355. },
  11356. rgb_to_hex: function (e, t, i) {
  11357. var n = this.hex_with_component(0, 2, e)
  11358. return (n = this.hex_with_component(n, 1, t)), this.hex_with_component(n, 0, i)
  11359. },
  11360. component_from_hex: function (e, t) {
  11361. return (e >> (8 * t)) & 255
  11362. },
  11363. hex_with_component: function (e, t, i) {
  11364. return (i << (c = 8 * t)) | (e & ~(255 << c))
  11365. }
  11366. }),
  11367. (s = ee.color.toString),
  11368. (l = ee.utils.common),
  11369. (ae.COMPONENTS = ['r', 'g', 'b', 'h', 's', 'v', 'hex', 'a']),
  11370. l.extend(ae.prototype, {
  11371. toString: function () {
  11372. return s(this)
  11373. },
  11374. toOriginal: function () {
  11375. return this.__state.conversion.write(this)
  11376. }
  11377. }),
  11378. ie(ae.prototype, 'r', 2),
  11379. ie(ae.prototype, 'g', 1),
  11380. ie(ae.prototype, 'b', 0),
  11381. ne(ae.prototype, 'h'),
  11382. ne(ae.prototype, 's'),
  11383. ne(ae.prototype, 'v'),
  11384. Object.defineProperty(ae.prototype, 'a', {
  11385. get: function () {
  11386. return this.__state.a
  11387. },
  11388. set: function (e) {
  11389. this.__state.a = e
  11390. }
  11391. }),
  11392. Object.defineProperty(ae.prototype, 'hex', {
  11393. get: function () {
  11394. return 'HEX' !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)), this.__state.hex
  11395. },
  11396. set: function (e) {
  11397. ;(this.__state.space = 'HEX'), (this.__state.hex = e)
  11398. }
  11399. }),
  11400. ae)),
  11401. ee.color.interpret,
  11402. ee.utils.common
  11403. )),
  11404. (ee.utils.requestAnimationFrame =
  11405. window.requestAnimationFrame ||
  11406. window.webkitRequestAnimationFrame ||
  11407. window.mozRequestAnimationFrame ||
  11408. window.oRequestAnimationFrame ||
  11409. window.msRequestAnimationFrame ||
  11410. function (e, t) {
  11411. window.setTimeout(e, 1e3 / 60)
  11412. }),
  11413. (ee.dom.CenteredDiv =
  11414. ((n = ee.dom.dom),
  11415. (r = ee.utils.common),
  11416. (te.prototype.show = function () {
  11417. var e = this
  11418. ;(this.backgroundElement.style.display = 'block'),
  11419. (this.domElement.style.display = 'block'),
  11420. (this.domElement.style.opacity = 0),
  11421. (this.domElement.style.webkitTransform = 'scale(1.1)'),
  11422. this.layout(),
  11423. r.defer(function () {
  11424. ;(e.backgroundElement.style.opacity = 1), (e.domElement.style.opacity = 1), (e.domElement.style.webkitTransform = 'scale(1)')
  11425. })
  11426. }),
  11427. (te.prototype.hide = function () {
  11428. var e = this,
  11429. t = function () {
  11430. ;(e.domElement.style.display = 'none'),
  11431. (e.backgroundElement.style.display = 'none'),
  11432. n.unbind(e.domElement, 'webkitTransitionEnd', t),
  11433. n.unbind(e.domElement, 'transitionend', t),
  11434. n.unbind(e.domElement, 'oTransitionEnd', t)
  11435. }
  11436. n.bind(this.domElement, 'webkitTransitionEnd', t),
  11437. n.bind(this.domElement, 'transitionend', t),
  11438. n.bind(this.domElement, 'oTransitionEnd', t),
  11439. (this.backgroundElement.style.opacity = 0),
  11440. (this.domElement.style.opacity = 0),
  11441. (this.domElement.style.webkitTransform = 'scale(1.1)')
  11442. }),
  11443. (te.prototype.layout = function () {
  11444. ;(this.domElement.style.left = $('#player').width() / 2 - n.getWidth(this.domElement) / 2 + 'px'),
  11445. (this.domElement.style.top = $('#player').height() / 2 - n.getHeight(this.domElement) / 2 + 'px')
  11446. }),
  11447. te)),
  11448. ee.dom.dom,
  11449. ee.utils.common
  11450. ))
  11451. },
  11452. {}
  11453. ],
  11454. 94: [
  11455. function (e, t, i) {
  11456. ;(function (J) {
  11457. 'use strict'
  11458. function i(e) {
  11459. function t(e, t) {
  11460. for (var i = 0, n = 0, r = new Array(), o = 1; o <= 16; o++) {
  11461. for (var a = 1; a <= e[o]; a++) (r[t[n]] = []), (r[t[n]][0] = i), (r[t[n]][1] = o), n++, i++
  11462. i *= 2
  11463. }
  11464. return r
  11465. }
  11466. function _(e) {
  11467. for (var t = e[0], i = e[1] - 1; 0 <= i; ) t & (1 << i) && (B |= 1 << V), i--, --V < 0 && (255 == B ? (b(255), b(0)) : b(B), (V = 7), (B = 0))
  11468. }
  11469. function b(e) {
  11470. F.push(e)
  11471. }
  11472. function w(e) {
  11473. b((e >> 8) & 255), b(255 & e)
  11474. }
  11475. function T(e, t, i, n, r) {
  11476. for (
  11477. var o,
  11478. a = r[0],
  11479. s = r[240],
  11480. l = (function (e, t) {
  11481. var i,
  11482. n,
  11483. r,
  11484. o,
  11485. a,
  11486. s,
  11487. l,
  11488. c,
  11489. h,
  11490. u,
  11491. d = 0
  11492. for (h = 0; h < 8; ++h) {
  11493. ;(i = e[d]), (n = e[d + 1]), (r = e[d + 2]), (o = e[d + 3]), (a = e[d + 4]), (s = e[d + 5]), (l = e[d + 6])
  11494. var p = i + (c = e[d + 7]),
  11495. f = i - c,
  11496. g = n + l,
  11497. m = n - l,
  11498. v = r + s,
  11499. y = r - s,
  11500. A = o + a,
  11501. C = o - a,
  11502. I = p + A,
  11503. E = p - A,
  11504. _ = g + v,
  11505. b = g - v
  11506. ;(e[d] = I + _), (e[d + 4] = I - _)
  11507. var w = 0.707106781 * (b + E)
  11508. ;(e[d + 2] = E + w), (e[d + 6] = E - w)
  11509. var T = 0.382683433 * ((I = C + y) - (b = m + f)),
  11510. x = 0.5411961 * I + T,
  11511. S = 1.306562965 * b + T,
  11512. M = 0.707106781 * (_ = y + m),
  11513. R = f + M,
  11514. P = f - M
  11515. ;(e[d + 5] = P + x), (e[d + 3] = P - x), (e[d + 1] = R + S), (e[d + 7] = R - S), (d += 8)
  11516. }
  11517. for (h = d = 0; h < 8; ++h) {
  11518. ;(i = e[d]), (n = e[d + 8]), (r = e[d + 16]), (o = e[d + 24]), (a = e[d + 32]), (s = e[d + 40]), (l = e[d + 48])
  11519. var O = i + (c = e[d + 56]),
  11520. L = i - c,
  11521. D = n + l,
  11522. N = n - l,
  11523. F = r + s,
  11524. B = r - s,
  11525. V = o + a,
  11526. k = o - a,
  11527. U = O + V,
  11528. H = O - V,
  11529. z = D + F,
  11530. G = D - F
  11531. ;(e[d] = U + z), (e[d + 32] = U - z)
  11532. var W = 0.707106781 * (G + H)
  11533. ;(e[d + 16] = H + W), (e[d + 48] = H - W)
  11534. var j = 0.382683433 * ((U = k + B) - (G = N + L)),
  11535. Y = 0.5411961 * U + j,
  11536. q = 1.306562965 * G + j,
  11537. X = 0.707106781 * (z = B + N),
  11538. Z = L + X,
  11539. K = L - X
  11540. ;(e[d + 40] = K + Y), (e[d + 24] = K - Y), (e[d + 8] = Z + q), (e[d + 56] = Z - q), d++
  11541. }
  11542. for (h = 0; h < 64; ++h) (u = e[h] * t[h]), (Q[h] = 0 < u ? (0.5 + u) | 0 : (u - 0.5) | 0)
  11543. return Q
  11544. })(e, t),
  11545. c = 0;
  11546. c < 64;
  11547. ++c
  11548. )
  11549. A[C[c]] = l[c]
  11550. var h = A[0] - i
  11551. ;(i = A[0]), 0 == h ? _(n[0]) : (_(n[y[(o = 32767 + h)]]), _(v[o]))
  11552. for (var u = 63; 0 < u && 0 == A[u]; u--);
  11553. if (0 == u) return _(a), i
  11554. for (var d, p = 1; p <= u; ) {
  11555. for (var f = p; 0 == A[p] && p <= u; ++p);
  11556. var g = p - f
  11557. if (16 <= g) {
  11558. d = g >> 4
  11559. for (var m = 1; m <= d; ++m) _(s)
  11560. g &= 15
  11561. }
  11562. ;(o = 32767 + A[p]), _(r[(g << 4) + y[o]]), _(v[o]), p++
  11563. }
  11564. return 63 != u && _(a), i
  11565. }
  11566. function x(e) {
  11567. if ((e <= 0 && (e = 1), 100 < e && (e = 100), i != e)) {
  11568. ;(function (e) {
  11569. for (
  11570. var t = [
  11571. 16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55,
  11572. 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99
  11573. ],
  11574. i = 0;
  11575. i < 64;
  11576. i++
  11577. ) {
  11578. var n = u((t[i] * e + 50) / 100)
  11579. n < 1 ? (n = 1) : 255 < n && (n = 255), (O[C[i]] = n)
  11580. }
  11581. for (
  11582. var r = [
  11583. 17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
  11584. 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99
  11585. ],
  11586. o = 0;
  11587. o < 64;
  11588. o++
  11589. ) {
  11590. var a = u((r[o] * e + 50) / 100)
  11591. a < 1 ? (a = 1) : 255 < a && (a = 255), (L[C[o]] = a)
  11592. }
  11593. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958, 0.5411961, 0.275899379], l = 0, c = 0; c < 8; c++)
  11594. for (var h = 0; h < 8; h++) (D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8)), (N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8)), l++
  11595. })(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11596. (i = e)
  11597. }
  11598. }
  11599. var S,
  11600. M,
  11601. R,
  11602. P,
  11603. i,
  11604. u = (Math.round, Math.floor),
  11605. O = new Array(64),
  11606. L = new Array(64),
  11607. D = new Array(64),
  11608. N = new Array(64),
  11609. v = new Array(65535),
  11610. y = new Array(65535),
  11611. Q = new Array(64),
  11612. A = new Array(64),
  11613. F = [],
  11614. B = 0,
  11615. V = 7,
  11616. k = new Array(64),
  11617. U = new Array(64),
  11618. H = new Array(64),
  11619. n = new Array(256),
  11620. z = new Array(2048),
  11621. C = [
  11622. 0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60,
  11623. 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63
  11624. ],
  11625. G = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
  11626. W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
  11627. j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125],
  11628. Y = [
  11629. 1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37,
  11630. 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120,
  11631. 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185,
  11632. 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247,
  11633. 248, 249, 250
  11634. ],
  11635. q = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
  11636. X = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
  11637. Z = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119],
  11638. K = [
  11639. 0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24,
  11640. 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119,
  11641. 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183,
  11642. 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247,
  11643. 248, 249, 250
  11644. ]
  11645. ;(this.encode = function (e, t) {
  11646. var i = (new Date().getTime(), t.quality)
  11647. i && x(i),
  11648. (F = new Array()),
  11649. (B = 0),
  11650. (V = 7),
  11651. w(65496),
  11652. w(65504),
  11653. w(16),
  11654. b(74),
  11655. b(70),
  11656. b(73),
  11657. b(70),
  11658. b(0),
  11659. b(1),
  11660. b(1),
  11661. b(0),
  11662. w(1),
  11663. w(1),
  11664. b(0),
  11665. b(0),
  11666. (function () {
  11667. w(65499), w(132), b(0)
  11668. for (var e = 0; e < 64; e++) b(O[e])
  11669. b(1)
  11670. for (var t = 0; t < 64; t++) b(L[t])
  11671. })(),
  11672. (function (e, t) {
  11673. w(65472), w(17), b(8), w(t), w(e), b(3), b(1), b(17), b(0), b(2), b(17), b(1), b(3), b(17), b(1)
  11674. })(e.width, e.height),
  11675. (function () {
  11676. w(65476), w(418), b(0)
  11677. for (var e = 0; e < 16; e++) b(G[e + 1])
  11678. for (var t = 0; t <= 11; t++) b(W[t])
  11679. b(16)
  11680. for (var i = 0; i < 16; i++) b(j[i + 1])
  11681. for (var n = 0; n <= 161; n++) b(Y[n])
  11682. b(1)
  11683. for (var r = 0; r < 16; r++) b(q[r + 1])
  11684. for (var o = 0; o <= 11; o++) b(X[o])
  11685. b(17)
  11686. for (var a = 0; a < 16; a++) b(Z[a + 1])
  11687. for (var s = 0; s <= 161; s++) b(K[s])
  11688. })(),
  11689. w(65498),
  11690. w(12),
  11691. b(3),
  11692. b(1),
  11693. b(0),
  11694. b(2),
  11695. b(17),
  11696. b(3),
  11697. b(17),
  11698. b(0),
  11699. b(63),
  11700. b(0)
  11701. var n = 0,
  11702. r = 0,
  11703. o = 0
  11704. ;(B = 0), (V = 7), (this.encode.displayName = '_encode_')
  11705. for (var a, s, l, c, h, u, d, p, f, g = e.data, m = e.width, v = e.height, y = t.flipY, A = 4 * m, C = y ? v : 0, I = y ? -8 : 8; (y && 0 < C) || (!y && C < v); ) {
  11706. for (a = 0; a < A; ) {
  11707. for (u = h = A * C + a, d = -1, f = p = 0; f < 64; f++)
  11708. (u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f))),
  11709. v <= C + p && (u -= A * (C + 1 + p - v)),
  11710. A <= a + d && (u -= a + d - A + 4),
  11711. (s = g[u++]),
  11712. (l = g[u++]),
  11713. (c = g[u++]),
  11714. (k[f] = ((z[s] + z[(l + 256) >> 0] + z[(c + 512) >> 0]) >> 16) - 128),
  11715. (U[f] = ((z[(s + 768) >> 0] + z[(l + 1024) >> 0] + z[(c + 1280) >> 0]) >> 16) - 128),
  11716. (H[f] = ((z[(s + 1280) >> 0] + z[(l + 1536) >> 0] + z[(c + 1792) >> 0]) >> 16) - 128)
  11717. ;(n = T(k, D, n, S, R)), (r = T(U, N, r, M, P)), (o = T(H, N, o, M, P)), (a += 32)
  11718. }
  11719. C += I
  11720. }
  11721. if (0 <= V) {
  11722. var E = []
  11723. ;(E[1] = V + 1), (E[0] = (1 << (V + 1)) - 1), _(E)
  11724. }
  11725. return w(65497), new J(F)
  11726. }),
  11727. new Date().getTime(),
  11728. (e = e || 50),
  11729. (function () {
  11730. for (var e = String.fromCharCode, t = 0; t < 256; t++) n[t] = e(t)
  11731. })(),
  11732. (S = t(G, W)),
  11733. (M = t(q, X)),
  11734. (R = t(j, Y)),
  11735. (P = t(Z, K)),
  11736. (function () {
  11737. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11738. for (var n = e; n < t; n++) (y[32767 + n] = i), (v[32767 + n] = []), (v[32767 + n][1] = i), (v[32767 + n][0] = n)
  11739. for (var r = -(t - 1); r <= -e; r++) (y[32767 + r] = i), (v[32767 + r] = []), (v[32767 + r][1] = i), (v[32767 + r][0] = t - 1 + r)
  11740. ;(e <<= 1), (t <<= 1)
  11741. }
  11742. })(),
  11743. (function () {
  11744. for (var e = 0; e < 256; e++)
  11745. (z[e] = 19595 * e),
  11746. (z[(e + 256) >> 0] = 38470 * e),
  11747. (z[(e + 512) >> 0] = 7471 * e + 32768),
  11748. (z[(e + 768) >> 0] = -11059 * e),
  11749. (z[(e + 1024) >> 0] = -21709 * e),
  11750. (z[(e + 1280) >> 0] = 32768 * e + 8421375),
  11751. (z[(e + 1536) >> 0] = -27439 * e),
  11752. (z[(e + 1792) >> 0] = -5329 * e)
  11753. })(),
  11754. x(e),
  11755. new Date().getTime()
  11756. }
  11757. t.exports.encode = function (e, t) {
  11758. return (
  11759. ((t = t || {}).quality = t.quality || 50),
  11760. {
  11761. data: new i(t.quality).encode(e, t),
  11762. width: e.width,
  11763. height: e.height
  11764. }
  11765. )
  11766. }
  11767. }).call(this, e('buffer').Buffer)
  11768. },
  11769. {
  11770. buffer: 198
  11771. }
  11772. ],
  11773. 95: [
  11774. function (e, t, i) {
  11775. 'use strict'
  11776. !(function () {
  11777. if (
  11778. ('performance' in window == 0 && (window.performance = {}),
  11779. (Date.now =
  11780. Date.now ||
  11781. function () {
  11782. return new Date().getTime()
  11783. }),
  11784. 'now' in window.performance == 0)
  11785. ) {
  11786. var e = Date.now()
  11787. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11788. (window.performance.now = function () {
  11789. return Date.now() - e
  11790. })
  11791. }
  11792. })()
  11793. },
  11794. {}
  11795. ],
  11796. 96: [
  11797. function (e, t, i) {
  11798. 'use strict'
  11799. var a = e('three')
  11800. ;(a.EffectComposer = function (e, t) {
  11801. if (((this.renderer = e), void 0 === t)) {
  11802. var i = {
  11803. minFilter: a.LinearFilter,
  11804. magFilter: a.LinearFilter,
  11805. format: a.RGBAFormat,
  11806. stencilBuffer: !1
  11807. },
  11808. n = e.getSize()
  11809. t = new a.WebGLRenderTarget(n.width, n.height, i)
  11810. }
  11811. ;(this.renderTarget1 = t),
  11812. (this.renderTarget2 = t.clone()),
  11813. (this.writeBuffer = this.renderTarget1),
  11814. (this.readBuffer = this.renderTarget2),
  11815. (this.passes = []),
  11816. void 0 === a.CopyShader && console.error('THREE.EffectComposer relies on THREE.CopyShader'),
  11817. (this.copyPass = new a.ShaderPass(a.CopyShader))
  11818. }),
  11819. (a.EffectComposer.prototype = {
  11820. swapBuffers: function () {
  11821. var e = this.readBuffer
  11822. ;(this.readBuffer = this.writeBuffer), (this.writeBuffer = e)
  11823. },
  11824. addPass: function (e) {
  11825. this.passes.push(e)
  11826. },
  11827. insertPass: function (e, t) {
  11828. this.passes.splice(t, 0, e)
  11829. },
  11830. render: function (e) {
  11831. ;(this.writeBuffer = this.renderTarget1), (this.readBuffer = this.renderTarget2)
  11832. var t,
  11833. i,
  11834. n = !1,
  11835. r = this.passes.length
  11836. for (i = 0; i < r; i++)
  11837. if ((t = this.passes[i]).enabled) {
  11838. if ((t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n), t.needsSwap)) {
  11839. if (n) {
  11840. var o = this.renderer.context
  11841. o.stencilFunc(o.NOTEQUAL, 1, 4294967295), this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e), o.stencilFunc(o.EQUAL, 1, 4294967295)
  11842. }
  11843. this.swapBuffers()
  11844. }
  11845. t instanceof a.MaskPass ? (n = !0) : t instanceof a.ClearMaskPass && (n = !1)
  11846. }
  11847. },
  11848. reset: function (e) {
  11849. if (void 0 === e) {
  11850. var t = this.renderer.getSize()
  11851. ;(e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11852. }
  11853. this.renderTarget1.dispose(),
  11854. this.renderTarget2.dispose(),
  11855. (this.renderTarget1 = e),
  11856. (this.renderTarget2 = e.clone()),
  11857. (this.writeBuffer = this.renderTarget1),
  11858. (this.readBuffer = this.renderTarget2)
  11859. },
  11860. setSize: function (e, t) {
  11861. this.renderTarget1.setSize(e, t), this.renderTarget2.setSize(e, t)
  11862. this.passes.forEach(a => {
  11863. //add for TransitionPass
  11864. a.setSize && a.setSize(e, t)
  11865. })
  11866. }
  11867. })
  11868. },
  11869. {
  11870. three: 217
  11871. }
  11872. ],
  11873. 97: [
  11874. function (e, t, i) {
  11875. 'use strict'
  11876. var n = e('three')
  11877. ;(n.MaskPass = function (e, t) {
  11878. ;(this.scene = e), (this.camera = t), (this.enabled = !0), (this.clear = !0), (this.needsSwap = !1), (this.inverse = !1)
  11879. }),
  11880. (n.MaskPass.prototype = {
  11881. render: function (e, t, i, n) {
  11882. var r,
  11883. o,
  11884. a = e.context
  11885. a.colorMask(!1, !1, !1, !1),
  11886. a.depthMask(!1),
  11887. (o = this.inverse ? ((r = 0), 1) : ((r = 1), 0)),
  11888. a.enable(a.STENCIL_TEST),
  11889. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11890. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11891. a.clearStencil(o),
  11892. e.render(this.scene, this.camera, i, this.clear),
  11893. e.render(this.scene, this.camera, t, this.clear),
  11894. a.colorMask(!0, !0, !0, !0),
  11895. a.depthMask(!0),
  11896. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11897. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11898. }
  11899. }),
  11900. (n.ClearMaskPass = function () {
  11901. this.enabled = !0
  11902. }),
  11903. (n.ClearMaskPass.prototype = {
  11904. render: function (e, t, i, n) {
  11905. var r = e.context
  11906. r.disable(r.STENCIL_TEST)
  11907. }
  11908. })
  11909. },
  11910. {
  11911. three: 217
  11912. }
  11913. ],
  11914. 98: [
  11915. function (e, t, i) {
  11916. 'use strict'
  11917. var o = e('three')
  11918. ;(o.RenderPass = function (e, t, i, n, r) {
  11919. ;(this.scene = e),
  11920. (this.camera = t),
  11921. (this.overrideMaterial = i),
  11922. (this.clearColor = n),
  11923. (this.clearAlpha = void 0 !== r ? r : 1),
  11924. (this.oldClearColor = new o.Color()),
  11925. (this.oldClearAlpha = 1),
  11926. (this.enabled = !0),
  11927. (this.clear = !0),
  11928. (this.needsSwap = !1)
  11929. }),
  11930. (o.RenderPass.prototype = {
  11931. render: function (e, t, i, n) {
  11932. ;(this.scene.overrideMaterial = this.overrideMaterial),
  11933. this.clearColor && (this.oldClearColor.copy(e.getClearColor()), (this.oldClearAlpha = e.getClearAlpha()), e.setClearColor(this.clearColor, this.clearAlpha)),
  11934. e.render(this.scene, this.camera, i, this.clear),
  11935. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11936. (this.scene.overrideMaterial = null)
  11937. }
  11938. })
  11939. },
  11940. {
  11941. three: 217
  11942. }
  11943. ],
  11944. 99: [
  11945. function (e, t, i) {
  11946. 'use strict'
  11947. var n = e('three')
  11948. ;(n.ShaderPass = function (e, t) {
  11949. ;(this.textureID = void 0 !== t ? t : 'tDiffuse'),
  11950. e instanceof n.ShaderMaterial
  11951. ? ((this.uniforms = e.uniforms), (this.material = e))
  11952. : e &&
  11953. ((this.uniforms = n.UniformsUtils.clone(e.uniforms)),
  11954. (this.material = new n.ShaderMaterial({
  11955. defines: e.defines || {},
  11956. uniforms: this.uniforms,
  11957. vertexShader: e.vertexShader,
  11958. fragmentShader: e.fragmentShader
  11959. }))),
  11960. (this.renderToScreen = !1),
  11961. (this.enabled = !0),
  11962. (this.needsSwap = !0),
  11963. (this.clear = !1),
  11964. (this.camera = new n.OrthographicCamera(-1, 1, 1, -1, 0, 1)),
  11965. (this.scene = new n.Scene()),
  11966. (this.quad = new n.Mesh(new n.PlaneBufferGeometry(2, 2), null)),
  11967. this.scene.add(this.quad)
  11968. }),
  11969. (n.ShaderPass.prototype = {
  11970. render: function (e, t, i, n) {
  11971. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11972. (this.quad.material = this.material),
  11973. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11974. }
  11975. })
  11976. },
  11977. {
  11978. three: 217
  11979. }
  11980. ],
  11981. 100: [
  11982. function (e, t, i) {
  11983. 'use strict'
  11984. e('three').CopyShader = {
  11985. uniforms: {
  11986. tDiffuse: {
  11987. type: 't',
  11988. value: null
  11989. },
  11990. opacity: {
  11991. type: 'f',
  11992. value: 1
  11993. }
  11994. },
  11995. vertexShader: ['varying vec2 vUv;', 'void main() {', 'vUv = uv;', 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );', '}'].join('\n'),
  11996. fragmentShader: [
  11997. 'uniform float opacity;',
  11998. 'uniform sampler2D tDiffuse;',
  11999. 'varying vec2 vUv;',
  12000. 'void main() {',
  12001. 'vec4 texel = texture2D( tDiffuse, vUv );',
  12002. 'gl_FragColor = opacity * texel;',
  12003. '}'
  12004. ].join('\n')
  12005. }
  12006. },
  12007. {
  12008. three: 217
  12009. }
  12010. ],
  12011. 101: [
  12012. function (e, t, i) {
  12013. 'use strict'
  12014. e('three').HorizontalBlurShader = {
  12015. uniforms: {
  12016. tDiffuse: {
  12017. type: 't',
  12018. value: null
  12019. },
  12020. h: {
  12021. type: 'f',
  12022. value: 1 / 512
  12023. }
  12024. },
  12025. vertexShader: ['varying vec2 vUv;', 'void main() {', 'vUv = uv;', 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );', '}'].join('\n'),
  12026. fragmentShader: [
  12027. 'uniform sampler2D tDiffuse;',
  12028. 'uniform float h;',
  12029. 'varying vec2 vUv;',
  12030. 'void main() {',
  12031. 'vec4 sum = vec4( 0.0 );',
  12032. 'sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;',
  12033. 'sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;',
  12034. 'sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;',
  12035. 'sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;',
  12036. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;',
  12037. 'sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;',
  12038. 'sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;',
  12039. 'sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;',
  12040. 'sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;',
  12041. 'gl_FragColor = sum;',
  12042. '}'
  12043. ].join('\n')
  12044. }
  12045. },
  12046. {
  12047. three: 217
  12048. }
  12049. ],
  12050. 102: [
  12051. function (e, t, i) {
  12052. 'use strict'
  12053. e('three').VerticalBlurShader = {
  12054. uniforms: {
  12055. tDiffuse: {
  12056. type: 't',
  12057. value: null
  12058. },
  12059. v: {
  12060. type: 'f',
  12061. value: 1 / 512
  12062. }
  12063. },
  12064. vertexShader: ['varying vec2 vUv;', 'void main() {', 'vUv = uv;', 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );', '}'].join('\n'),
  12065. fragmentShader: [
  12066. 'uniform sampler2D tDiffuse;',
  12067. 'uniform float v;',
  12068. 'varying vec2 vUv;',
  12069. 'void main() {',
  12070. 'vec4 sum = vec4( 0.0 );',
  12071. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;',
  12072. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;',
  12073. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;',
  12074. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;',
  12075. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;',
  12076. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;',
  12077. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;',
  12078. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;',
  12079. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;',
  12080. 'gl_FragColor = sum;',
  12081. '}'
  12082. ].join('\n')
  12083. }
  12084. },
  12085. {
  12086. three: 217
  12087. }
  12088. ],
  12089. 103: [
  12090. function (e, t, i) {
  12091. 'use strict'
  12092. var z = e('three')
  12093. !(function () {
  12094. if (('performance' in window == 0 && (window.performance = {}), 'now' in window.performance == 0)) {
  12095. var e = Date.now()
  12096. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12097. (window.performance.now = function () {
  12098. return Date.now() - e
  12099. })
  12100. }
  12101. })(),
  12102. (z.WebGLRenderer.prototype.paramThreeToGL = function (e) {
  12103. var t,
  12104. i = this.extensions,
  12105. n = this.context
  12106. if (e === z.RepeatWrapping) return n.REPEAT
  12107. if (e === z.ClampToEdgeWrapping) return n.CLAMP_TO_EDGE
  12108. if (e === z.MirroredRepeatWrapping) return n.MIRRORED_REPEAT
  12109. if (e === z.NearestFilter) return n.NEAREST
  12110. if (e === z.NearestMipMapNearestFilter) return n.NEAREST_MIPMAP_NEAREST
  12111. if (e === z.NearestMipMapLinearFilter) return n.NEAREST_MIPMAP_LINEAR
  12112. if (e === z.LinearFilter) return n.LINEAR
  12113. if (e === z.LinearMipMapNearestFilter) return n.LINEAR_MIPMAP_NEAREST
  12114. if (e === z.LinearMipMapLinearFilter) return n.LINEAR_MIPMAP_LINEAR
  12115. if (e === z.UnsignedByteType) return n.UNSIGNED_BYTE
  12116. if (e === z.UnsignedShort4444Type) return n.UNSIGNED_SHORT_4_4_4_4
  12117. if (e === z.UnsignedShort5551Type) return n.UNSIGNED_SHORT_5_5_5_1
  12118. if (e === z.UnsignedShort565Type) return n.UNSIGNED_SHORT_5_6_5
  12119. if (e === z.ByteType) return n.BYTE
  12120. if (e === z.ShortType) return n.SHORT
  12121. if (e === z.UnsignedShortType) return n.UNSIGNED_SHORT
  12122. if (e === z.IntType) return n.INT
  12123. if (e === z.UnsignedIntType) return n.UNSIGNED_INT
  12124. if (e === z.FloatType) return n.FLOAT
  12125. if (null !== (t = i.get('OES_texture_half_float')) && e === z.HalfFloatType) return t.HALF_FLOAT_OES
  12126. if (e === z.AlphaFormat) return n.ALPHA
  12127. if (e === z.RGBFormat) return n.RGB
  12128. if (e === z.RGBAFormat) return n.RGBA
  12129. if (e === z.LuminanceFormat) return n.LUMINANCE
  12130. if (e === z.LuminanceAlphaFormat) return n.LUMINANCE_ALPHA
  12131. if (e === z.AddEquation) return n.FUNC_ADD
  12132. if (e === z.SubtractEquation) return n.FUNC_SUBTRACT
  12133. if (e === z.ReverseSubtractEquation) return n.FUNC_REVERSE_SUBTRACT
  12134. if (e === z.ZeroFactor) return n.ZERO
  12135. if (e === z.OneFactor) return n.ONE
  12136. if (e === z.SrcColorFactor) return n.SRC_COLOR
  12137. if (e === z.OneMinusSrcColorFactor) return n.ONE_MINUS_SRC_COLOR
  12138. if (e === z.SrcAlphaFactor) return n.SRC_ALPHA
  12139. if (e === z.OneMinusSrcAlphaFactor) return n.ONE_MINUS_SRC_ALPHA
  12140. if (e === z.DstAlphaFactor) return n.DST_ALPHA
  12141. if (e === z.OneMinusDstAlphaFactor) return n.ONE_MINUS_DST_ALPHA
  12142. if (e === z.DstColorFactor) return n.DST_COLOR
  12143. if (e === z.OneMinusDstColorFactor) return n.ONE_MINUS_DST_COLOR
  12144. if (e === z.SrcAlphaSaturateFactor) return n.SRC_ALPHA_SATURATE
  12145. if (null !== (t = i.get('WEBGL_compressed_texture_s3tc'))) {
  12146. if (e === z.RGB_S3TC_DXT1_Format) return t.COMPRESSED_RGB_S3TC_DXT1_EXT
  12147. if (e === z.RGBA_S3TC_DXT1_Format) return t.COMPRESSED_RGBA_S3TC_DXT1_EXT
  12148. if (e === z.RGBA_S3TC_DXT3_Format) return t.COMPRESSED_RGBA_S3TC_DXT3_EXT
  12149. if (e === z.RGBA_S3TC_DXT5_Format) return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12150. }
  12151. if (null !== (t = i.get('WEBGL_compressed_texture_pvrtc'))) {
  12152. if (e === z.RGB_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG
  12153. if (e === z.RGB_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG
  12154. if (e === z.RGBA_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
  12155. if (e === z.RGBA_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12156. }
  12157. if (null !== (t = i.get('WEBGL_compressed_texture_etc1')) && e === z.RGB_ETC1_Format) return t.COMPRESSED_RGB_ETC1_WEBGL
  12158. if (null !== (t = i.get('EXT_blend_minmax'))) {
  12159. if (e === z.MinEquation) return t.MIN_EXT
  12160. if (e === z.MaxEquation) return t.MAX_EXT
  12161. }
  12162. return 0
  12163. }),
  12164. (z.WebGLState = function (l, i, c) {
  12165. var n = this,
  12166. r = new z.Vector4(),
  12167. e = l.getParameter(l.MAX_VERTEX_ATTRIBS),
  12168. o = new Uint8Array(e),
  12169. a = new Uint8Array(e),
  12170. s = new Uint8Array(e),
  12171. t = {},
  12172. h = null,
  12173. u = null,
  12174. d = null,
  12175. p = null,
  12176. f = null,
  12177. g = null,
  12178. m = null,
  12179. v = null,
  12180. y = !1,
  12181. A = null,
  12182. C = null,
  12183. I = null,
  12184. E = null,
  12185. _ = null,
  12186. b = null,
  12187. w = null,
  12188. T = null,
  12189. x = null,
  12190. S = null,
  12191. M = null,
  12192. R = null,
  12193. P = null,
  12194. O = null,
  12195. L = null,
  12196. D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),
  12197. N = void 0,
  12198. F = {},
  12199. B = new z.Vector4(),
  12200. V = null,
  12201. k = null,
  12202. U = new z.Vector4(),
  12203. H = new z.Vector4()
  12204. ;(this.init = function () {
  12205. this.clearColor(0, 0, 0, 1),
  12206. this.clearDepth(1),
  12207. this.clearStencil(0),
  12208. this.enable(l.DEPTH_TEST),
  12209. l.depthFunc(l.LEQUAL),
  12210. l.frontFace(l.CCW),
  12211. l.cullFace(l.BACK),
  12212. this.enable(l.CULL_FACE),
  12213. this.enable(l.BLEND),
  12214. l.blendEquation(l.FUNC_ADD),
  12215. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  12216. }),
  12217. (this.initAttributes = function () {
  12218. for (var e = 0, t = o.length; e < t; e++) o[e] = 0
  12219. }),
  12220. (this.enableAttribute = function (e) {
  12221. ;(o[e] = 1), 0 === a[e] && (l.enableVertexAttribArray(e), (a[e] = 1)), 0 !== s[e] && (i.get('ANGLE_instanced_arrays').vertexAttribDivisorANGLE(e, 0), (s[e] = 0))
  12222. }),
  12223. (this.enableAttributeAndDivisor = function (e, t, i) {
  12224. ;(o[e] = 1), 0 === a[e] && (l.enableVertexAttribArray(e), (a[e] = 1)), s[e] !== t && (i.vertexAttribDivisorANGLE(e, t), (s[e] = t))
  12225. }),
  12226. (this.disableUnusedAttributes = function () {
  12227. for (var e = 0, t = a.length; e < t; e++) a[e] !== o[e] && (l.disableVertexAttribArray(e), (a[e] = 0))
  12228. }),
  12229. (this.enable = function (e) {
  12230. !0 !== t[e] && (l.enable(e), (t[e] = !0))
  12231. }),
  12232. (this.disable = function (e) {
  12233. !1 !== t[e] && (l.disable(e), (t[e] = !1))
  12234. }),
  12235. (this.getCompressedTextureFormats = function () {
  12236. if (null === h && ((h = []), i.get('WEBGL_compressed_texture_pvrtc') || i.get('WEBGL_compressed_texture_s3tc') || i.get('WEBGL_compressed_texture_etc1')))
  12237. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++) h.push(e[t])
  12238. return h
  12239. }),
  12240. (this.setBlending = function (e, t, i, n, r, o, a, s) {
  12241. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  12242. (e === u && s === y) ||
  12243. (e === z.AdditiveBlending
  12244. ? s
  12245. ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE))
  12246. : (l.blendEquation(l.FUNC_ADD), l.blendFunc(l.SRC_ALPHA, l.ONE))
  12247. : e === z.SubtractiveBlending
  12248. ? s
  12249. ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA))
  12250. : (l.blendEquation(l.FUNC_ADD), l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR))
  12251. : e === z.MultiplyBlending
  12252. ? s
  12253. ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA))
  12254. : (l.blendEquation(l.FUNC_ADD), l.blendFunc(l.ZERO, l.SRC_COLOR))
  12255. : s
  12256. ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA))
  12257. : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  12258. (u = e),
  12259. (y = s)),
  12260. e === z.CustomBlending
  12261. ? ((r = r || t),
  12262. (o = o || i),
  12263. (a = a || n),
  12264. (t === d && r === g) || (l.blendEquationSeparate(c(t), c(r)), (d = t), (g = r)),
  12265. (i === p && n === f && o === m && a === v) || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)), (p = i), (f = n), (m = o), (v = a)))
  12266. : (v = m = g = f = p = d = null)
  12267. }),
  12268. (this.setDepthFunc = function (e) {
  12269. if (A !== e) {
  12270. if (e)
  12271. switch (e) {
  12272. case z.NeverDepth:
  12273. l.depthFunc(l.NEVER)
  12274. break
  12275. case z.AlwaysDepth:
  12276. l.depthFunc(l.ALWAYS)
  12277. break
  12278. case z.LessDepth:
  12279. l.depthFunc(l.LESS)
  12280. break
  12281. case z.LessEqualDepth:
  12282. l.depthFunc(l.LEQUAL)
  12283. break
  12284. case z.EqualDepth:
  12285. l.depthFunc(l.EQUAL)
  12286. break
  12287. case z.GreaterEqualDepth:
  12288. l.depthFunc(l.GEQUAL)
  12289. break
  12290. case z.GreaterDepth:
  12291. l.depthFunc(l.GREATER)
  12292. break
  12293. case z.NotEqualDepth:
  12294. l.depthFunc(l.NOTEQUAL)
  12295. break
  12296. default:
  12297. l.depthFunc(l.LEQUAL)
  12298. }
  12299. else l.depthFunc(l.LEQUAL)
  12300. A = e
  12301. }
  12302. }),
  12303. (this.setDepthTest = function (e) {
  12304. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  12305. }),
  12306. (this.setDepthWrite = function (e) {
  12307. C !== e && (l.depthMask(e), (C = e))
  12308. }),
  12309. (this.setColorWrite = function (e) {
  12310. I !== e && (l.colorMask(e, e, e, e), (I = e))
  12311. }),
  12312. (this.setStencilFunc = function (e, t, i) {
  12313. ;(_ === e && b === t && w === i) || (l.stencilFunc(e, t, i), (_ = e), (b = t), (w = i))
  12314. }),
  12315. (this.setStencilOp = function (e, t, i) {
  12316. ;(T === e && x === t && S === i) || (l.stencilOp(e, t, i), (T = e), (x = t), (S = i))
  12317. }),
  12318. (this.setStencilTest = function (e) {
  12319. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  12320. }),
  12321. (this.setStencilWrite = function (e) {
  12322. E !== e && (l.stencilMask(e), (E = e))
  12323. }),
  12324. (this.setFlipSided = function (e) {
  12325. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW), (M = e))
  12326. }),
  12327. (this.setLineWidth = function (e) {
  12328. e !== R && (l.lineWidth(e), (R = e))
  12329. }),
  12330. (this.setPolygonOffset = function (e, t, i) {
  12331. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL), !e || (P === t && O === i) || (l.polygonOffset(t, i), (P = t), (O = i))
  12332. }),
  12333. (this.getScissorTest = function () {
  12334. return L
  12335. }),
  12336. (this.setScissorTest = function (e) {
  12337. ;(L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  12338. }),
  12339. (this.activeTexture = function (e) {
  12340. void 0 === e && (e = l.TEXTURE0 + D - 1), N !== e && (l.activeTexture(e), (N = e))
  12341. }),
  12342. (this.bindTexture = function (e, t) {
  12343. void 0 === N && n.activeTexture()
  12344. var i = F[N]
  12345. void 0 === i &&
  12346. ((i = {
  12347. type: void 0,
  12348. texture: void 0
  12349. }),
  12350. (F[N] = i)),
  12351. (i.type === e && i.texture === t) || (l.bindTexture(e, t), (i.type = e), (i.texture = t))
  12352. }),
  12353. (this.compressedTexImage2D = function () {
  12354. try {
  12355. l.compressedTexImage2D.apply(l, arguments)
  12356. } catch (e) {
  12357. console.error(e)
  12358. }
  12359. }),
  12360. (this.texImage2D = function () {
  12361. try {
  12362. l.texImage2D.apply(l, arguments)
  12363. } catch (e) {
  12364. console.error(e)
  12365. }
  12366. }),
  12367. (this.clearColor = function (e, t, i, n) {
  12368. r.set(e, t, i, n), !1 === B.equals(r) && (l.clearColor(e, t, i, n), B.copy(r))
  12369. }),
  12370. (this.clearDepth = function (e) {
  12371. V !== e && (l.clearDepth(e), (V = e))
  12372. }),
  12373. (this.clearStencil = function (e) {
  12374. k !== e && (l.clearStencil(e), (k = e))
  12375. }),
  12376. (this.scissor = function (e) {
  12377. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w), U.copy(e))
  12378. }),
  12379. (this.viewport = function (e) {
  12380. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w), H.copy(e))
  12381. }),
  12382. (this.reset = function () {
  12383. for (var e = 0; e < a.length; e++) 1 === a[e] && (l.disableVertexAttribArray(e), (a[e] = 0))
  12384. ;(t = {}), (N = void 0), (F = {}), (M = E = C = I = u = h = null)
  12385. })
  12386. })
  12387. },
  12388. {
  12389. three: 217
  12390. }
  12391. ],
  12392. 104: [
  12393. function (a, h, e) {
  12394. ;(function (i, e) {
  12395. 'use strict'
  12396. function t(e) {
  12397. this.urls = e
  12398. var t = i(
  12399. 'bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==',
  12400. 'base64'
  12401. )
  12402. ;(this.builder = n.loadProto(t)), (this.decoder = this.builder.build('binary_mesh'))
  12403. }
  12404. var s = a('three'),
  12405. n = a('protobufjs'),
  12406. r = a('../util/logger'),
  12407. o = (a('../util/common'), a('../util/ajax')),
  12408. l = a('../objects/Chunk'),
  12409. c = new r(e)
  12410. ;(t.prototype = {
  12411. constructor: t,
  12412. load: function (t, i, n, r) {
  12413. return (
  12414. c.time('download'),
  12415. o
  12416. .get(t, {
  12417. responseType: 'arraybuffer'
  12418. })
  12419. .done(
  12420. function (e) {
  12421. c.timeEnd('download'), this.parse(e, t, i, n, r)
  12422. }.bind(this)
  12423. )
  12424. .fail(r)
  12425. )
  12426. },
  12427. parse: function (e, t, i, n, r) {
  12428. var o = this.readProtobuf(e)
  12429. if (!o) return r()
  12430. try {
  12431. c.time('convert to webgl'), this.convertProtobufToSceneObject(o, t, i, n, r), c.timeEnd('convert to webgl')
  12432. } catch (e) {
  12433. return c.error('failed parsing .dam'), c.error(e.message), r()
  12434. }
  12435. },
  12436. readProtobuf: function (e) {
  12437. var t
  12438. try {
  12439. c.time('parse proto'), (t = this.decoder.decode(e)), c.timeEnd('parse proto')
  12440. } catch (e) {
  12441. return c.error('failed parsing proto for .dam'), c.error(e.message), null
  12442. }
  12443. return t
  12444. },
  12445. convertProtobufToSceneObject: function (e, i, t, n, r) {
  12446. if (0 === e.chunk.length) return c.warn('No chunks in damfile...'), t([])
  12447. var o = new s.Matrix4()
  12448. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1)
  12449. var a = e.chunk.map(function (e) {
  12450. var t = new s.BufferGeometry()
  12451. return (
  12452. t.addAttribute('position', new s.BufferAttribute(new Float32Array(e.vertices.xyz, 0, 3), 3)),
  12453. 0 < e.vertices.uv.length && t.addAttribute('uv', new s.BufferAttribute(new Float32Array(e.vertices.uv, 0, 2), 2)),
  12454. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces, 0, 1), 1)),
  12455. t.applyMatrix(o),
  12456. t.computeBoundingBox(),
  12457. new l({
  12458. geometry: t,
  12459. textureName: e.material_name,
  12460. name: e.chunk_name,
  12461. meshUrl: i
  12462. })
  12463. )
  12464. })
  12465. return a ? t(a) : (c.error('.dam protobuf came out with no chunks...'), r())
  12466. }
  12467. }),
  12468. (h.exports = t)
  12469. }).call(this, a('buffer').Buffer, '/js/loaders/DamLoader.js')
  12470. },
  12471. {
  12472. '../objects/Chunk': 144,
  12473. '../util/ajax': 181,
  12474. '../util/common': 185,
  12475. '../util/logger': 189,
  12476. buffer: 198,
  12477. protobufjs: 214,
  12478. three: 217
  12479. }
  12480. ],
  12481. 105: [
  12482. function (n, r, e) {
  12483. ;(function (e) {
  12484. 'use strict'
  12485. var t = (n('three'), n('../settings'), n('../util/browser'), n('./DamLoader')),
  12486. i = n('../util/logger'),
  12487. u = (n('../ab'), new i(e))
  12488. r.exports = {
  12489. getLoaders: function () {
  12490. return [
  12491. ['_50k', '.dam', t],
  12492. ['', '.dam', t]
  12493. ]
  12494. },
  12495. load: function (e, t, i, n, r, o) {
  12496. var a = this.getLoaders()[(o = o || 0)]
  12497. if (a) {
  12498. var s = a[0],
  12499. l = a[1],
  12500. c = new a[2](t),
  12501. h = t.get(e + s + l)
  12502. h
  12503. ? (u.debug('Trying ' + s + l),
  12504. c.load(
  12505. h,
  12506. i,
  12507. n,
  12508. function () {
  12509. this.load(e, t, i, n, r, ++o)
  12510. }.bind(this)
  12511. ))
  12512. : (u.debug('Skipping ' + l + ', not available'), this.load(e, t, i, n, r, ++o))
  12513. } else r && r('No suitable model file found...')
  12514. }
  12515. }
  12516. }).call(this, '/js/loaders/ModelLoader.js')
  12517. },
  12518. {
  12519. '../ab': 3,
  12520. '../settings': 166,
  12521. '../util/browser': 182,
  12522. '../util/logger': 189,
  12523. './DamLoader': 104,
  12524. three: 217
  12525. }
  12526. ],
  12527. 106: [
  12528. function (i, n, e) {
  12529. ;(function (e) {
  12530. 'use strict'
  12531. var l = i('../util/common'),
  12532. c = i('../util/texture'),
  12533. h = i('../util/browser'),
  12534. t = i('../util/logger'),
  12535. u = i('../settings'),
  12536. d = new t(e)
  12537. n.exports = {
  12538. load: function (i, n) {
  12539. if (!i.chunks[0] || !i.chunks[0].meshUrl) return $.when()
  12540. var r = l.countUnique(
  12541. i.chunks.map(function (e) {
  12542. return e.textureName
  12543. })
  12544. ),
  12545. e = -1 !== i.chunks[0].meshUrl.indexOf('_50k') ? '_50k' : '',
  12546. t = '_50k' == e ? 'high' : 'low'
  12547. u.minimalMemoryMode &&
  12548. 'high' === t &&
  12549. (h.detectSamsungS6()
  12550. ? (d.warn('Galaxy S6 cannot handle large textures, turning down quality.'), (t = 'low'))
  12551. : r > u.maxMobileTextures && (d.warn('Model probably too large for mobile, turning down quality.'), (t = 'low')))
  12552. var o = i.data.job.uuid + e + '_texture_jpg_' + t + '/',
  12553. a = $.Deferred(),
  12554. s = 0
  12555. return (
  12556. i.chunks.forEach(function (e) {
  12557. if (!e.material.map && e.textureName) {
  12558. var t = i.urls.get(o + e.textureName)
  12559. e.setTextureMap(
  12560. c.load(
  12561. t,
  12562. function (e, t) {
  12563. e || (n.push(t), s++, a.notify(s, r), s === r && a.resolve())
  12564. }.bind(this, c.isLoaded(t))
  12565. )
  12566. )
  12567. }
  12568. }),
  12569. a.promise()
  12570. )
  12571. }
  12572. }
  12573. }).call(this, '/js/loaders/ModelTextureLoader.js')
  12574. },
  12575. {
  12576. '../settings': 166,
  12577. '../util/browser': 182,
  12578. '../util/common': 185,
  12579. '../util/logger': 189,
  12580. '../util/texture': 194
  12581. }
  12582. ],
  12583. 107: [
  12584. function (s, l, e) {
  12585. ;(function (n, e) {
  12586. 'use strict'
  12587. function t(e) {
  12588. ;(this.model = e), (this.modelDataPath = this.model.urls.get('vision.modeldata') + '?m=' + new Date().getTime()), (this.sweepLocationsPath = this.model.urls.get('sweep_locations.csv'))
  12589. var t = n(
  12590. 'Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K',
  12591. 'base64'
  12592. ),
  12593. i = r.loadProto(t)
  12594. this.decoder = i.build('VisionModeldata')
  12595. }
  12596. var r = s('protobufjs'),
  12597. i = s('../util/ajax'),
  12598. o = (s('../util/common'), s('../util/math')),
  12599. a = new (s('../util/logger'))(e)
  12600. ;(t.prototype.load = function () {
  12601. return this.modelDataPath
  12602. ? (a.info('Using vision.modeldata'), this.loadVisionModelData())
  12603. : this.sweepLocationsPath
  12604. ? (a.warn('Using sweep_locations.csv'), this.loadSweepLocationsCSV())
  12605. : (a.warn('No sweep file found'), $.when([]))
  12606. }),
  12607. (t.prototype.loadVisionModelData = function () {
  12608. return i
  12609. .get(this.modelDataPath, {
  12610. responseType: 'arraybuffer'
  12611. })
  12612. .then(
  12613. function (e) {
  12614. var t
  12615. try {
  12616. t = this.decoder.decode(e)
  12617. } catch (e) {
  12618. return a.warn('Could not decode vision.modeldata, trying sweep_locations.csv'), this.loadSweepLocationsCSV()
  12619. }
  12620. var i = t.sweepLocations
  12621. .map(function (e) {
  12622. return {
  12623. uuid: e.uuid.toUTF8().replace(/-/g, ''),
  12624. position: {
  12625. x: e.pose.translation.x,
  12626. y: e.pose.translation.y,
  12627. z: e.pose.translation.z
  12628. },
  12629. quaternion: {
  12630. x: e.pose.rotation.x,
  12631. y: e.pose.rotation.y,
  12632. z: e.pose.rotation.z,
  12633. w: e.pose.rotation.w
  12634. },
  12635. puck: {
  12636. x: e.puck.x,
  12637. y: e.puck.y,
  12638. z: e.puck.z
  12639. },
  12640. floor: window.sceneFrom == 'kankan' ? e.subgroup : e.group,
  12641. neighbours: e.visibles,
  12642. alignmentType: e.alignment_type
  12643. }
  12644. })
  12645. .map(function (e) {
  12646. return (e.position = o.convertVisionVector(e.position)), (e.quaternion = o.convertVisionQuaternion(e.quaternion)), (e.puck = o.convertVisionVector(e.puck)), e
  12647. })
  12648. return (
  12649. i.forEach(function (e) {
  12650. /* if(e.neighbours.find(a=>a==-1)){
  12651. console.log('%c neighbours 存在-1 ' +e.uuid ,"color:#f00")
  12652. } */
  12653. e.neighbours = e.neighbours.filter(e => i[e])
  12654. e.neighbours = e.neighbours.map(function (e) {
  12655. return i[e].uuid
  12656. })
  12657. }),
  12658. i
  12659. )
  12660. }.bind(this),
  12661. function () {
  12662. return a.warn('Could not load vision.modeldata, trying sweep_locations.csv'), this.loadSweepLocationsCSV()
  12663. }.bind(this)
  12664. )
  12665. }),
  12666. (t.prototype.loadSweepLocationsCSV = function () {
  12667. return i
  12668. .get(this.sweepLocationsPath)
  12669. .then(function (e) {
  12670. return e
  12671. .split('\n')
  12672. .map(function (e) {
  12673. return e.split(', ')
  12674. })
  12675. .filter(function (e) {
  12676. return 1 < e.length
  12677. })
  12678. .map(function (e) {
  12679. return {
  12680. uuid: e[0],
  12681. position: {
  12682. x: parseFloat(e[1]),
  12683. y: parseFloat(e[2]),
  12684. z: parseFloat(e[3])
  12685. },
  12686. quaternion: {
  12687. x: parseFloat(e[4]),
  12688. y: parseFloat(e[5]),
  12689. z: parseFloat(e[6]),
  12690. w: parseFloat(e[7])
  12691. }
  12692. }
  12693. })
  12694. .map(function (e) {
  12695. return (e.position = o.convertVisionVector(e.position)), (e.quaternion = o.convertVisionQuaternion(e.quaternion)), e
  12696. })
  12697. })
  12698. .fail(function () {
  12699. a.warn('Could not load sweep_locations.csv, no sweeps loaded.')
  12700. })
  12701. }),
  12702. (l.exports = t)
  12703. }).call(this, s('buffer').Buffer, '/js/loaders/SweepDataLoader.js')
  12704. },
  12705. {
  12706. '../util/ajax': 181,
  12707. '../util/common': 185,
  12708. '../util/logger': 189,
  12709. '../util/math': 190,
  12710. buffer: 198,
  12711. protobufjs: 214
  12712. }
  12713. ],
  12714. 108: [
  12715. function (s, l, e) {
  12716. ;(function (e) {
  12717. 'use strict'
  12718. function t() {
  12719. this.locale = null
  12720. }
  12721. var i = s('../settings'),
  12722. n = s('../util/common'),
  12723. r = s('../util/logger'),
  12724. o = s('../enum/Locale'),
  12725. a = new r(e)
  12726. ;(t.prototype.init = function () {
  12727. var e
  12728. switch (i.languageTag) {
  12729. case null:
  12730. case 'en':
  12731. case o.EN_US:
  12732. ;(this.locale = o.EN_US), (e = s('./strings-en-US'))
  12733. break
  12734. case 'es':
  12735. case o.ES_MX:
  12736. ;(this.locale = o.ES_MX), (e = s('./strings-es-MX'))
  12737. break
  12738. case 'fr':
  12739. case o.FR_FR:
  12740. ;(this.locale = o.FR_FR), (e = s('./strings-fr-FR'))
  12741. break
  12742. case 'de':
  12743. case o.DE_DE:
  12744. ;(this.locale = o.DE_DE), (e = s('./strings-de-DE'))
  12745. break
  12746. case 'ru':
  12747. case o.RU_RU:
  12748. ;(this.locale = o.RU_RU), (e = s('./strings-ru-RU'))
  12749. break
  12750. case 'cn':
  12751. case o.CN_CN:
  12752. ;(this.locale = o.CN_CN), (e = s('./strings-cn-CN'))
  12753. break
  12754. case 'jp':
  12755. case o.JP_JP:
  12756. ;(this.locale = o.JP_JP), (e = s('./strings-jp-JP'))
  12757. break
  12758. default:
  12759. a.info("Unsupported language tag, defaulting to 'en-US'"), (this.locale = o.EN_US), (e = s('./strings-en-US'))
  12760. }
  12761. a.info("Using locale '" + this.locale + "'"), n.extendObject(this, e)
  12762. }),
  12763. (t.prototype.localizeGUI = function () {
  12764. var e = document.querySelector('#gui-parent')
  12765. this.localizeTree(e), this.localizeLoadingText()
  12766. }),
  12767. (t.prototype.localizeLoadingText = function () {
  12768. document.querySelector('#help-dialog').classList.add(this.locale),
  12769. document.querySelector('#interaction-modal').classList.add(this.locale),
  12770. document.querySelector('#gui').classList.add(this.locale)
  12771. }),
  12772. (t.prototype.localizeTree = function (e) {
  12773. var t,
  12774. i,
  12775. n = /{\[{ ?(\w+) ?}\]}/
  12776. if (e.nodeType === Node.TEXT_NODE) (t = e.data.match(n)) && ((i = t[1]), (e.data = this.localizeText(i) || i))
  12777. else if (e.nodeType === Node.ELEMENT_NODE) {
  12778. var r = e.getAttribute('title')
  12779. r && (t = r.match(n)) && ((i = t[1]), e.setAttribute('title', this.localizeText(i) || i))
  12780. }
  12781. for (e = e.firstChild; e; ) this.localizeTree(e), (e = e.nextSibling)
  12782. }),
  12783. (t.prototype.localizeText = function (e) {
  12784. var t = this[e]
  12785. return (
  12786. t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."), (t = s('./strings-en-US')[e])),
  12787. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12788. t
  12789. )
  12790. }),
  12791. (l.exports = new t())
  12792. }).call(this, '/js/localization/localize.js')
  12793. },
  12794. {
  12795. '../enum/Locale': 31,
  12796. '../settings': 166,
  12797. '../util/common': 185,
  12798. '../util/logger': 189,
  12799. './strings-cn-CN': 109,
  12800. './strings-de-DE': 110,
  12801. './strings-en-US': 111,
  12802. './strings-es-MX': 112,
  12803. './strings-fr-FR': 113,
  12804. './strings-jp-JP': 114,
  12805. './strings-ru-RU': 115
  12806. }
  12807. ],
  12808. 109: [
  12809. function (e, t, i) {
  12810. 'use strict'
  12811. t.exports = {
  12812. PAGE_TITLE: '',
  12813. LOADING: '正在加载',
  12814. PRESENTED_BY_CAPS: '呈现者:',
  12815. POWERED_BY: '技术支持:',
  12816. POWERED_BY_CAPS: '技术支持:',
  12817. DESKTOP_SHORT_CTA: '点击一次以探索这个 3D 空间。',
  12818. MOBILE_SHORT_CTA: '点击一次以探索这个 3D 空间。',
  12819. PRESENTED_BY: '呈现者:',
  12820. MORE: '更多 ',
  12821. LESS: '更少 ',
  12822. TAG_CONTENT: 'tag™ 内容',
  12823. SHOW: '显示',
  12824. HIDE: '隐藏',
  12825. DOLLHOUSE: '场景屋',
  12826. FLOOR_PLAN: '楼层平面图',
  12827. OPEN_HIGHLIGHTS: '打开精彩片段',
  12828. CLOSE_HIGHLIGHTS: '关闭',
  12829. PREVIOUS: '上一个',
  12830. PLAY: '播放',
  12831. PAUSE: '暂停',
  12832. NEXT: '下一个',
  12833. EXPLORE_3D_SPACE: '探索 3D 空间',
  12834. VIEW_DOLLHOUSE: '观看场景屋',
  12835. SOCIAL_SHARING: '分享这个空间',
  12836. VIEW_IN_VR: '以 VR 观看',
  12837. VIEW_FULLSCREEN: '全屏观看',
  12838. EXIT_FULLSCREEN: ' 退出全屏',
  12839. ZOOM_IN: '放大',
  12840. ZOOM_OUT: '缩小',
  12841. FLOOR_NAME: '楼层',
  12842. FLOOR_ALL: 'ALL',
  12843. FLOOR_Lang: ['Floor', ''],
  12844. TERMS: '条款',
  12845. PORT_TERMS: 'port 条款',
  12846. TERMS_OF_USE: '使用条款',
  12847. CLOSE_TERMS: '关闭',
  12848. TERMS_TEXT_FILE: 'terms-cn-CN.html',
  12849. TERMS_FAIL: '无法获取条款。请确保您有互联网连接以查看使用条款。',
  12850. WEBVR_FOR_DAYDREAM: '用于 Daydream 视图',
  12851. WEBVR_ENTER_WEBVR: '进入 VR',
  12852. WEBVR_DIFFERENT_HEADSET: '有其他耳机吗?',
  12853. WEBVR_LEARN_MORE: '了解更多',
  12854. WEBVR_VIEW_SPACE: '在 VR 中观看空间',
  12855. WEBVR_DAYDREAM_VIEW: 'Daydream 视图',
  12856. WEBVR_DAYDREAM_PHONE: '支持 Daydream 的手机',
  12857. WEBVR_FOR_CARDBOARD: '用于 Google Cardboard',
  12858. WEBVR_VIEW_CARDBOARD: '或在 Google Cardboard 上观看',
  12859. VR_VIEW_SPACE: '在虚拟现实中观看空间',
  12860. VR_LEARN_MORE_CAPS: '了解更多',
  12861. VR_PREVIOUS_CAPS: '上一个’,',
  12862. VR_NEXT_CAPS: '下一个',
  12863. VR_GOT_IT_CAPS: '明白了',
  12864. VR_SHOW_SUPPORTED: '点击以使用 VR 观看空间',
  12865. VR_SHOW_UNSUPPORTED: '很遗憾,您的设备不符合在 VR 中观看空间的最低要求。',
  12866. VR_SHOW_IOS_1: '点击以使用 VR 观看空间',
  12867. VR_SHOW_IOS_2: '需要有 port VR 应用程序和兼容的 iPhone 才能观看',
  12868. VR_WHAT_YOU_NEED: '关于...您需要什么',
  12869. VR_NEED_CARDBOARD: '您使用 Google Cardboard 时需要什么',
  12870. VR_NEED_SAMSUNG: '您使用 Samsung Gear VR 时需要什么',
  12871. VR_NEED_DAYDREAM: '需要事先与 DAYDREAM VIEW 配对',
  12872. VR_NEED_DAYDREAM_PHONE: '支持 Daydream 的手机',
  12873. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  12874. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  12875. VR_APP: 'port VR 应用程序',
  12876. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  12877. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  12878. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本',
  12879. VR_COMPATIBLE_IPHONES_3: '兼容的 iPhone',
  12880. VR_COMPATIBLE_ANDROID: '兼容的 Android 设备',
  12881. VR_COMPATIBLE_ANDROID_LONG: '4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏',
  12882. VR_ANDROID_DETAIL: '4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏',
  12883. VR_ANDROID_DVICES: 'Android 设备',
  12884. VR_COMPATIBLE_SAMSUNG: '兼容的 Samsung 设备',
  12885. VR_SAMSUNG_DETAIL: 'Galaxy S6 和更高版本',
  12886. VR_APP_FOR_CARDBOARD: '用于 Google Cardboard 的 port VR 应用程序',
  12887. VR_APP_FOR_SAMSUNG: '用于 Gear VR 的 port VR 应用程序',
  12888. VR_APP_FOR_ANDROID: '用于 Android 手机的 port VR 应用程序',
  12889. VR_APP_OPEN: '请使用 port VR 应用程序打开',
  12890. VR_DOWNLOAD_HERE: '在此下载',
  12891. VR_REQUIRE_HEADSET: '需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序',
  12892. VR_REDIRECT_TO_STORE: '如果未安装应用程序,您将跳转到应用程序商店。',
  12893. VR_IMPROPER_EMBED: 'port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。',
  12894. VR_OPEN_ANDROID_LINK: '在您的手机上打开链接',
  12895. VR_ANDROID_OPTIONS: '可用的 VR 耳机选项',
  12896. SHARE_TO: '分享到',
  12897. SHARE_LINK: '直接链接',
  12898. SHARE_EXPLORE: '探索',
  12899. SHARE_AT: '在',
  12900. SHARE_WITH: '使用',
  12901. SHARE_3D: '以 3D',
  12902. SHARE_COPIED: '已复制!',
  12903. ERROR_BROWSER_SOLUTION: '安装更新的浏览器以探索 3D。',
  12904. ERROR_BROWSER_EXPLANATION: 'WebGL 需要现代的浏览器。',
  12905. ERROR_GENERIC_PROBLEM: '糟糕,出现问题。',
  12906. ERROR_GENERIC_SOLUTION: '重新启动您的浏览器。',
  12907. ERROR_GENERIC_ACTIONS_1: '如果问题仍然存在,',
  12908. ERROR_GENERIC_ACTIONS_2: '请安装支持的浏览器',
  12909. ERROR_GENERIC_ACTIONS_3: ' 或',
  12910. ERROR_GENERIC_ACTIONS_4: '查看我们的故障排除指南',
  12911. ERROR_WEBGL_UNSUPPORTED_PROBLEM: '浏览器不受支持。',
  12912. ERROR_WEBGL_IOS_PROBLEM: 'iOS 版本不受支持。',
  12913. ERROR_WEBGL_IOS_SOLUTION: '升级到 iOS 8 或更高版本以在 3D 中探索。',
  12914. ERROR_WEBGL_IOS_ACTIONS_1: '点击 ',
  12915. ERROR_WEBGL_IOS_ACTIONS_2: '设置 > 通用 > 软件更新',
  12916. ERROR_WEBGL_SAFARI_PROBLEM: '启用 WebGL 以在 3D 中探索。',
  12917. ERROR_WEBGL_SAFARI_ACTIONS_1: '单击',
  12918. ERROR_WEBGL_SAFARI_ACTIONS_2: '菜单栏中的首选项 > 高级 > 显示开发菜单',
  12919. ERROR_WEBGL_SAFARI_ACTIONS_3: '然后单击',
  12920. ERROR_WEBGL_SAFARI_ACTIONS_4: '开发 > 启用 WebGL',
  12921. ERROR_MISSING_URLS_PROBLEM: '糟糕,没有此模型的全景。',
  12922. ERROR_MISSING_URLS_EXPLANATION: '这是较早的模型。网站所有者可能正在开发一种新模型。',
  12923. ERROR_LOADING_FAILED_PROBLEM: '糟糕,模式不可用。',
  12924. ERROR_LOADING_FAILED_ACTIONS_1: '如果问题仍然存在,',
  12925. ERROR_LOADING_FAILED_ACTIONS_2: '查看我们的故障排除指南',
  12926. ERROR_MAINTENANCE_PROBLEM: '正在进行维护',
  12927. ERROR_MAINTENANCE_SOLUTION: '请过几分钟再来。',
  12928. LINK_TO_LOCATION: '地点链接',
  12929. MENU_COPY: '复制',
  12930. LINK_ALERT_COPY: '请使用 CTRL/CMD + C 复制。',
  12931. ROTATE: '旋转',
  12932. MOVE: '移动',
  12933. INSIDE: '内部',
  12934. ZOOM: '缩放',
  12935. HELP: '小帮手',
  12936. HELP_NAVIGATION_TAB: '导航',
  12937. HELP_MORE_HELP_TAB: '更多帮助',
  12938. HELP_DESKTOP_PANORAMA_1A: '单击并拖动以环顾空间。',
  12939. HELP_DESKTOP_PANORAMA_2A: '单击整个空间内的圆环以四处移动。',
  12940. HELP_DESKTOP_PANORAMA_3A: '使用鼠标滚轮来放大和缩小。',
  12941. HELP_DESKTOP_PANORAMA_1B: '或者,使用箭头键向左向右转。',
  12942. HELP_DESKTOP_PANORAMA_2B: '或者,使用箭头键向前移动和向后移动。',
  12943. HELP_DESKTOP_PANORAMA_3B: '或者,使用加号和减号键来放大和缩小。',
  12944. HELP_DESKTOP_360_2A: '单击内部视图图标以进入空间。',
  12945. HELP_DESKTOP_360_2B: '或者,按 1 号键进入内部视图。 ',
  12946. HELP_DESKTOP_DOLLHOUSE_1A: '左键单击并向左、向右、向上和向下拖动以旋转场景屋。',
  12947. HELP_DESKTOP_DOLLHOUSE_2A: '右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。',
  12948. HELP_DESKTOP_DOLLHOUSE_3A: '使用鼠标滚轮来放大和缩小。',
  12949. HELP_DESKTOP_DOLLHOUSE_1B: '或者,使用箭头键来旋转场景屋。',
  12950. HELP_DESKTOP_FLOORPLAN_1A: '左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。',
  12951. HELP_DESKTOP_FLOORPLAN_2A: '右键单击并向左或向右拖动以旋转楼层平面图。',
  12952. HELP_DESKTOP_FLOORPLAN_3A: '使用鼠标滚轮来放大和缩小。',
  12953. HELP_DESKTOP_FLOORPLAN_2B: '或者,使用箭头键以向左或向右旋转。',
  12954. HELP_DESKTOP_FLOORPLAN_3B: '或者,使用箭头键来放大和缩小。',
  12955. HELP_MOBILE_PANORAMA_1: '触摸并拖动以环顾空间。',
  12956. HELP_MOBILE_PANORAMA_2: '点击整个空间内的圆环以四处移动。',
  12957. HELP_MOBILE_3: '使用捏合手势来放大和缩小。',
  12958. HELP_MOBILE_360_2: '点击内部视图图标以进入空间。',
  12959. HELP_MOBILE_DOLLHOUSE_1: '触摸并向上、向下、向左和向右拖动以旋转场景屋。',
  12960. HELP_MOBILE_DOLLHOUSE_2: '用两指触摸并拖动以定位场景屋。',
  12961. HELP_MOBILE_FLOORPLAN_1: '触摸并拖动以定位楼层平面图。',
  12962. HELP_MOBILE_FLOORPLAN_2: '用两指触摸并拖动以旋转楼层平面图。',
  12963. HELP_MORE_HLR_A: '精彩片段集锦',
  12964. HELP_DESKTOP_MORE_HLR_B: '打开以使用缩略图图像在空间中流览。',
  12965. HELP_MORE_DOLLHOUSE_A: '场景屋',
  12966. HELP_DESKTOP_MORE_DOLLHOUSE_B: '单击以查看和旋转 3D 内整个空间的俯视图。',
  12967. HELP_MOBILE_MORE_DOLLHOUSE_B: '点击以查看和旋转 3D 内整个空间的俯视图。',
  12968. HELP_MORE_FLOORS_A: '楼层选择器',
  12969. HELP_DESKTOP_MORE_FLOORS_B: '在空间中的楼层之间切换。',
  12970. HELP_MORE_TAG_A: 'tag™ 贴文',
  12971. HELP_DESKTOP_MORE_TAG_B: '单击或悬停鼠标以查看空间中的功能信息。',
  12972. HELP_MOBILE_MORE_TAG_B: '点击以查看空间中的功能信息。',
  12973. HELP_MORE_ZOOM_A: '缩放控件',
  12974. HELP_DESKTOP_MORE_ZOOM_B: '使用这些控件来放大和缩小或使用滚轮。',
  12975. HELP_MORE_TOUR_A: '导览控件',
  12976. HELP_DESKTOP_MORE_TOUR_B: '通过导览播放、暂停以及向前和向后流览。',
  12977. HELP_MORE_INSIDE_A: '内部视图',
  12978. HELP_DESKTOP_MORE_INSIDE_B: '单击以探索空间内部。',
  12979. HELP_MOBILE_MORE_INSIDE_B: '点击以探索空间内部。',
  12980. HELP_MORE_VR_A: 'VR 模式',
  12981. HELP_DESKTOP_MORE_VR_B: '单击以在虚拟现实中启动空间。',
  12982. HELP_MOBILE_MORE_VR_B: '点击以在虚拟现实中启动空间。',
  12983. HELP_MORE_360_A: '360° 视图',
  12984. HELP_DESKTOP_MORE_360_B: '单击精彩片段集锦中的 360 视图中以观看室外场景。',
  12985. HELP_MOBILE_MORE_360_B: '点击精彩片段集锦中的 360 视图中以观看室外场景。',
  12986. HELP_MORE_FULLSCREEN_A: '全屏',
  12987. HELP_DESKTOP_MORE_FULLSCREEN_B: '将 3D Showcase 扩展到全屏。',
  12988. CLOSE: '关闭'
  12989. }
  12990. },
  12991. {}
  12992. ],
  12993. 110: [
  12994. function (e, t, i) {
  12995. 'use strict'
  12996. t.exports = {
  12997. PAGE_TITLE: '',
  12998. LOADING: 'Lädt',
  12999. PRESENTED_BY_CAPS: 'PRÄSENTIERT VON',
  13000. POWERED_BY: 'Angetrieben von',
  13001. POWERED_BY_CAPS: 'ANGETRIEBEN VON',
  13002. DESKTOP_SHORT_CTA: 'Sehen sie sich in diesem 3D Raum um.',
  13003. MOBILE_SHORT_CTA: 'Sehen sie sich in diesem 3D Raum um.',
  13004. PRESENTED_BY: 'Präsentiert von ',
  13005. MORE: 'Mehr ',
  13006. LESS: 'Weniger ',
  13007. TAG_CONTENT: 'tag™ Inhalt',
  13008. SHOW: 'Anzeigen',
  13009. HIDE: 'Verbergen',
  13010. DOLLHOUSE: 'Puppenhaus',
  13011. FLOOR_PLAN: 'Grundriss',
  13012. OPEN_HIGHLIGHTS: 'Highlights anzeigen',
  13013. CLOSE_HIGHLIGHTS: 'Schließen',
  13014. PREVIOUS: 'Vorheriges',
  13015. PLAY: 'Abspielen',
  13016. PAUSE: 'Pausieren',
  13017. NEXT: 'Nächstes',
  13018. EXPLORE_3D_SPACE: 'Innenraum betreten',
  13019. VIEW_DOLLHOUSE: 'Puppenhaus ansehen',
  13020. SOCIAL_SHARING: 'Teilen Sie diesen Raum',
  13021. VIEW_IN_VR: 'In VR ansehen',
  13022. VIEW_FULLSCREEN: 'Ansicht im Vollbildmodus',
  13023. EXIT_FULLSCREEN: 'Beenden des Vollbildmodus',
  13024. ZOOM_IN: 'Vergrößern',
  13025. ZOOM_OUT: 'Verkleinern',
  13026. FLOOR_NAME: 'Etage ',
  13027. FLOOR_ALL: 'Alle',
  13028. TERMS: 'Bedingungen',
  13029. PORT_TERMS: 'port Bedingungen',
  13030. TERMS_OF_USE: 'Nutzungsbedingungen',
  13031. TERMS_TEXT_FILE: 'terms-de-DE.html',
  13032. CLOSE_TERMS: 'Schließen',
  13033. TERMS_FAIL: 'Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.',
  13034. HELP: 'Hilfe',
  13035. HELP_NAVIGATION_TAB: 'Navigation',
  13036. HELP_MORE_HELP_TAB: 'Hilfe-Details',
  13037. CLOSE: 'Schließen',
  13038. HELP_DESKTOP_PANORAMA_1A: 'Klicken und ziehen Sie um sich im Raum umzusehen.',
  13039. HELP_DESKTOP_PANORAMA_2A: 'Klicken Sie auf die Ringe im Raum um sich zu bewegen.',
  13040. HELP_DESKTOP_PANORAMA_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  13041. HELP_DESKTOP_PANORAMA_1B: 'Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.',
  13042. HELP_DESKTOP_PANORAMA_2B: 'Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.',
  13043. HELP_DESKTOP_PANORAMA_3B: 'Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.',
  13044. HELP_DESKTOP_360_2A: 'Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .',
  13045. HELP_DESKTOP_360_2B: 'Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.',
  13046. HELP_DESKTOP_DOLLHOUSE_1A: 'Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.',
  13047. HELP_DESKTOP_DOLLHOUSE_2A: 'Klicken mit der rechten Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Puppenhauses zu ändern.',
  13048. HELP_DESKTOP_DOLLHOUSE_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  13049. HELP_DESKTOP_DOLLHOUSE_1B: 'Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.',
  13050. HELP_DESKTOP_FLOORPLAN_1A: 'Klicken mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Grundrisses auf zu ändern.',
  13051. HELP_DESKTOP_FLOORPLAN_2A: 'Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.',
  13052. HELP_DESKTOP_FLOORPLAN_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  13053. HELP_DESKTOP_FLOORPLAN_2B: 'Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.',
  13054. HELP_DESKTOP_FLOORPLAN_3B: 'Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.',
  13055. HELP_MOBILE_PANORAMA_1: 'Berühren und ziehen an dem Raum um sich umzusehen.',
  13056. HELP_MOBILE_PANORAMA_2: 'Klicken Sie auf die Ringe im Raum, um sich zu bewegen.',
  13057. HELP_MOBILE_3: 'Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.',
  13058. HELP_MOBILE_360_2: 'Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.',
  13059. HELP_MOBILE_DOLLHOUSE_1: 'Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.',
  13060. HELP_MOBILE_DOLLHOUSE_2: 'Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.',
  13061. HELP_MOBILE_FLOORPLAN_1: 'Berühren und ziehen, um den Grundriss zu positionieren.',
  13062. HELP_MOBILE_FLOORPLAN_2: 'Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.',
  13063. HELP_MORE_HLR_A: 'Liste das Highlight',
  13064. HELP_DESKTOP_MORE_HLR_B: 'Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.',
  13065. HELP_MORE_DOLLHOUSE_A: 'Puppenhaus Ansicht',
  13066. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.',
  13067. HELP_MOBILE_MORE_DOLLHOUSE_B: 'Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.',
  13068. HELP_MORE_FLOORS_A: 'Etage auswählen',
  13069. HELP_DESKTOP_MORE_FLOORS_B: 'Zwischen den Etagen im Raum wechseln.',
  13070. HELP_MORE_TAG_A: 'tag™ Posts',
  13071. HELP_DESKTOP_MORE_TAG_B: 'Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.',
  13072. HELP_MOBILE_MORE_TAG_B: 'Tippen Sie für Informationen über die Funktionen im Raum.',
  13073. HELP_MORE_ZOOM_A: 'Zoom Steuerung',
  13074. HELP_DESKTOP_MORE_ZOOM_B: 'Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.',
  13075. HELP_MORE_TOUR_A: 'Tour Steuerung',
  13076. HELP_DESKTOP_MORE_TOUR_B: 'Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.',
  13077. HELP_MORE_INSIDE_A: 'Innenansicht',
  13078. HELP_DESKTOP_MORE_INSIDE_B: 'Klicken Sie hier um sich im Raum umzusehen.',
  13079. HELP_MOBILE_MORE_INSIDE_B: 'Sehen Sie sich in diesen 3D Raum um.',
  13080. HELP_MORE_VR_A: 'VR Modus',
  13081. HELP_DESKTOP_MORE_VR_B: 'Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.',
  13082. HELP_MOBILE_MORE_VR_B: 'Tippen Sie um den Raum in der virtuellen Realität zu starten.',
  13083. HELP_MORE_360_A: '360° Views Ansicht ',
  13084. HELP_DESKTOP_MORE_360_B: 'Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.',
  13085. HELP_MOBILE_MORE_360_B: 'Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.',
  13086. HELP_MORE_FULLSCREEN_A: 'Vollbild',
  13087. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Erweitern Sie 3D Showcase im Vollbildmodus.',
  13088. WEBVR_FOR_CARDBOARD: 'Für Google Cardboard',
  13089. WEBVR_FOR_DAYDREAM: 'Für Daydream View',
  13090. WEBVR_ENTER_WEBVR: 'Starten Sie VR',
  13091. WEBVR_DIFFERENT_HEADSET: 'Haben Sie anderes Headset?',
  13092. WEBVR_LEARN_MORE: 'Mehr Infos',
  13093. WEBVR_VIEW_SPACE: 'Ansicht des Raumes in VR',
  13094. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  13095. WEBVR_DAYDREAM_PHONE: 'Daydream-fähiges Handy',
  13096. WEBVR_VIEW_CARDBOARD: 'Oder mit Google Cardboard ansehen',
  13097. VR_WHAT_YOU_NEED: 'Was Sie dafür brauchen...',
  13098. VR_NEED_DAYDREAM_PHONE: 'Daydream-fähiges Handy',
  13099. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  13100. VR_APP: 'port VR App',
  13101. VR_APP_OPEN: 'Oder öffnen Sie die port VR App',
  13102. VR_COMPATIBLE_ANDROID_LONG: 'Kompatibles Android Gerät mit Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer',
  13103. VR_SAMSUNG_DETAIL: 'Galaxy S6 und neuer',
  13104. VR_APP_FOR_ANDROID: 'port VR app für Android',
  13105. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13106. VR_VIEW_SPACE: 'Ansicht des Raumes in VR',
  13107. VR_LEARN_MORE_CAPS: 'MEHR INFOS',
  13108. VR_PREVIOUS_CAPS: 'ZURÜCK',
  13109. VR_NEXT_CAPS: 'WEITER',
  13110. VR_GOT_IT_CAPS: 'VERSTANDEN',
  13111. VR_SHOW_SUPPORTED: 'Tippen Sie um den Raum in VR zu sehen',
  13112. VR_SHOW_UNSUPPORTED: 'Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.',
  13113. VR_SHOW_IOS_1: 'Tippen Sie um den Raum in VR zu sehen',
  13114. VR_SHOW_IOS_2: 'port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen',
  13115. VR_NEED_CARDBOARD: 'Was Sie dafür brauchen ist Google Cardboard',
  13116. VR_NEED_SAMSUNG: 'Was Sie dafür brauchen ist Samsung Gear VR',
  13117. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  13118. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  13119. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  13120. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s oder neuer, mit iOS 9.1 und später',
  13121. VR_COMPATIBLE_IPHONES_3: 'Kompatibles iPhones',
  13122. VR_COMPATIBLE_ANDROID: 'Kompatibles Android Gerät',
  13123. VR_ANDROID_DETAIL: 'Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer',
  13124. VR_ANDROID_DVICES: 'Android Geräte',
  13125. VR_COMPATIBLE_SAMSUNG: 'Kompatible Samsung Geräte',
  13126. VR_APP_FOR_CARDBOARD: 'port VR App für Google Cardboard',
  13127. VR_APP_FOR_SAMSUNG: 'port VR App für Gear VR',
  13128. VR_DOWNLOAD_HERE: 'Hier runterladen',
  13129. VR_REQUIRE_HEADSET: 'Benötigt das ein VR-Headset und port VR App für Android installiert wird',
  13130. VR_REDIRECT_TO_STORE: 'Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.',
  13131. VR_IMPROPER_EMBED: 'Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.',
  13132. VR_OPEN_ANDROID_LINK: 'Öffnen Sie den Link auf Ihrem Handy',
  13133. VR_ANDROID_OPTIONS: 'VR Headset Optionen',
  13134. SHARE_TO: 'Teilen auf',
  13135. SHARE_LINK: 'Direkter Link',
  13136. SHARE_EXPLORE: 'Umsehen',
  13137. SHARE_AT: 'auf',
  13138. SHARE_WITH: 'mit',
  13139. SHARE_3D: 'in 3D',
  13140. SHARE_COPIED: 'Kopiert!',
  13141. ERROR_BROWSER_SOLUTION: 'Installieren Sie einen neueren Browser um sich in 3D umzusehen.',
  13142. ERROR_BROWSER_EXPLANATION: 'WebGL benötigt einen modernen Browser.',
  13143. ERROR_GENERIC_PROBLEM: 'Huch, etwas ist schief gelaufen.',
  13144. ERROR_GENERIC_SOLUTION: 'Starten Sie Ihren Browser neu.',
  13145. ERROR_GENERIC_ACTIONS_1: 'Wenn das Problem weiterhin besteht, ',
  13146. ERROR_GENERIC_ACTIONS_2: 'Installieren Sie einen unterstützten Browser',
  13147. ERROR_GENERIC_ACTIONS_3: ' oder ',
  13148. ERROR_GENERIC_ACTIONS_4: 'Sehen Sie unseren Leitfaden zur Fehlerbehebung',
  13149. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Browser wird nicht unterstützt.',
  13150. ERROR_WEBGL_IOS_PROBLEM: 'iOS-Version wird nicht unterstützt.',
  13151. ERROR_WEBGL_IOS_SOLUTION: 'Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.',
  13152. ERROR_WEBGL_IOS_ACTIONS_1: 'Tippen ',
  13153. ERROR_WEBGL_IOS_ACTIONS_2: 'Einstellungen > Allgemein > Softwareaktualisierung',
  13154. ERROR_WEBGL_SAFARI_PROBLEM: 'Aktivieren Sie WebVR um sich in 3D umzusehen.',
  13155. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Klicken ',
  13156. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen',
  13157. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Klicken Sie dann ',
  13158. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Entwickler > WebGL Aktivieren',
  13159. ERROR_MISSING_URLS_PROBLEM: 'Huch, es gibt keine Panoramen für dieses Modell .',
  13160. ERROR_MISSING_URLS_EXPLANATION: 'Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.',
  13161. ERROR_LOADING_FAILED_PROBLEM: 'Huch, das Modell ist nicht verfügbar.',
  13162. ERROR_LOADING_FAILED_ACTIONS_1: 'Wenn das Problem weiterhin besteht, ',
  13163. ERROR_LOADING_FAILED_ACTIONS_2: 'sehen Sie unseren Leitfaden zur Fehlerbehebung',
  13164. ERROR_MAINTENANCE_PROBLEM: 'Wartung im Gange.',
  13165. ERROR_MAINTENANCE_SOLUTION: 'Bitte versuchen Sie es in ein paar Minuten nochmal.',
  13166. LINK_TO_LOCATION: 'Link zu',
  13167. MENU_COPY: 'Kopieren',
  13168. LINK_ALERT_COPY: 'Bitte benutzen Sie CTRL/CMD + C zum kopieren.',
  13169. ROTATE: 'Drehen',
  13170. INSIDE: 'Drinnen',
  13171. MOVE: 'Bewegen',
  13172. ZOOM: 'Vergrößern'
  13173. }
  13174. },
  13175. {}
  13176. ],
  13177. 111: [
  13178. function (e, t, i) {
  13179. 'use strict'
  13180. t.exports = {
  13181. PAGE_TITLE: '',
  13182. LOADING: 'Loading',
  13183. PRESENTED_BY_CAPS: 'PRESENTED BY',
  13184. POWERED_BY: 'powered by ',
  13185. POWERED_BY_CAPS: 'POWERED BY',
  13186. DESKTOP_SHORT_CTA: 'Click to explore this 3D space.',
  13187. MOBILE_SHORT_CTA: 'Tap to explore this 3D space.',
  13188. PRESENTED_BY: 'Presented by ',
  13189. MORE: 'More ',
  13190. LESS: 'Less ',
  13191. TAG_CONTENT: 'tag™ Content',
  13192. SHOW: 'Show',
  13193. HIDE: 'Hide',
  13194. DOLLHOUSE: 'Dollhouse',
  13195. FLOOR_PLAN: 'Floor plan',
  13196. OPEN_HIGHLIGHTS: 'Open Highlights',
  13197. CLOSE_HIGHLIGHTS: 'Close',
  13198. PREVIOUS: 'Previous',
  13199. PLAY: 'Play',
  13200. PAUSE: 'Pause',
  13201. NEXT: 'Next',
  13202. EXPLORE_3D_SPACE: 'Explore 3D Space',
  13203. VIEW_DOLLHOUSE: 'View dollhouse',
  13204. SOCIAL_SHARING: 'Share this Space',
  13205. VIEW_IN_VR: 'View in VR',
  13206. VIEW_FULLSCREEN: '全屏',
  13207. EXIT_FULLSCREEN: '退出全屏',
  13208. ZOOM_IN: 'Zoom in',
  13209. ZOOM_OUT: 'Zoom out',
  13210. FLOOR_NAME: 'Floor ',
  13211. FLOOR_ALL: '全部',
  13212. TERMS: 'Terms',
  13213. PORT_TERMS: 'port terms',
  13214. TERMS_OF_USE: 'Terms of Use',
  13215. TERMS_TEXT_FILE: 'terms-en-US.html',
  13216. CLOSE_TERMS: 'Close',
  13217. TERMS_FAIL: 'Could not fetch terms. Please make sure you have an internet connection to view the terms of use.',
  13218. HELP: 'Help',
  13219. HELP_NAVIGATION_TAB: 'Navigation',
  13220. HELP_MORE_HELP_TAB: 'More Help',
  13221. CLOSE: 'Close',
  13222. HELP_DESKTOP_PANORAMA_1A: 'Click and Drag to look around the Space.',
  13223. HELP_DESKTOP_PANORAMA_2A: 'Click on the rings throughout the space to move around.',
  13224. HELP_DESKTOP_PANORAMA_3A: 'Use the scroll wheel to zoom in and out.',
  13225. HELP_DESKTOP_PANORAMA_1B: 'Or, use the arrow keys to turn left and right.',
  13226. HELP_DESKTOP_PANORAMA_2B: 'Or, use the arrow keys to move forward and back.',
  13227. HELP_DESKTOP_PANORAMA_3B: 'Or, use the plus and minus keys to zoom in and out.',
  13228. HELP_DESKTOP_360_2A: 'Click the Inside View icon to enter the Space.',
  13229. HELP_DESKTOP_360_2B: 'Or, press the number 1 key to enter Inside View.',
  13230. HELP_DESKTOP_DOLLHOUSE_1A: 'Left click and drag left, right, up, and down to rotate the Dollhouse.',
  13231. HELP_DESKTOP_DOLLHOUSE_2A: 'Right click and drag left, right, up, and down to change the Dollhouse position on screen.',
  13232. HELP_DESKTOP_DOLLHOUSE_3A: 'Use the scroll wheel to zoom in and out.',
  13233. HELP_DESKTOP_DOLLHOUSE_1B: 'Or, use the arrow keys to rotate the Dollhouse.',
  13234. HELP_DESKTOP_FLOORPLAN_1A: 'Left click and drag left, right, up, and down to change the Floorplan position on screen.',
  13235. HELP_DESKTOP_FLOORPLAN_2A: 'Right click and drag left or right to rotate the Floorplan.',
  13236. HELP_DESKTOP_FLOORPLAN_3A: 'Use the scroll wheel to zoom in and out.',
  13237. HELP_DESKTOP_FLOORPLAN_2B: 'Or, use the arrow keys to rotate left or right.',
  13238. HELP_DESKTOP_FLOORPLAN_3B: 'Or, use the arrow keys to zoom in and out.',
  13239. HELP_MOBILE_PANORAMA_1: 'Touch and Drag to look around the Space.',
  13240. HELP_MOBILE_PANORAMA_2: 'Tap on the rings throughout the Space to move around.',
  13241. HELP_MOBILE_3: 'Use a pinch gesture to zoom in and out.',
  13242. HELP_MOBILE_360_2: 'Tap the Inside View icon to enter the Space.',
  13243. HELP_MOBILE_DOLLHOUSE_1: 'Touch and drag up, down, left, and right to rotate the Dollhouse.',
  13244. HELP_MOBILE_DOLLHOUSE_2: 'Touch and drag with two fingers to position the Dollhouse.',
  13245. HELP_MOBILE_FLOORPLAN_1: 'Touch and drag to position the Floorplan.',
  13246. HELP_MOBILE_FLOORPLAN_2: 'Touch and drag with two fingers to rotate the Floorplan.',
  13247. HELP_MORE_HLR_A: 'Highlight Reel',
  13248. HELP_DESKTOP_MORE_HLR_B: 'Open to navigate through the Space using thumbnail images.',
  13249. HELP_MORE_DOLLHOUSE_A: 'Dollhouse View',
  13250. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'Click to view and rotate a top-down view of the entire Space in 3D.',
  13251. HELP_MOBILE_MORE_DOLLHOUSE_B: 'Tap to view and rotate a top-down view of the entire Space in 3D.',
  13252. HELP_MORE_FLOORS_A: 'Floor Selector',
  13253. HELP_DESKTOP_MORE_FLOORS_B: 'Switch between floors in the Space.',
  13254. HELP_MORE_TAG_A: 'tag™ Posts',
  13255. HELP_DESKTOP_MORE_TAG_B: 'Click or hover over for information about features in the Space.',
  13256. HELP_MOBILE_MORE_TAG_B: 'Tap for information about features in the Space.',
  13257. HELP_MORE_ZOOM_A: 'Zoom Controls',
  13258. HELP_DESKTOP_MORE_ZOOM_B: 'Use these controls to zoom in and out or use the scroll wheel.',
  13259. HELP_MORE_TOUR_A: 'Tour Controls',
  13260. HELP_DESKTOP_MORE_TOUR_B: 'Play, pause, and navigate forward and backward through a Guided Tour.',
  13261. HELP_MORE_INSIDE_A: 'Inside View',
  13262. HELP_DESKTOP_MORE_INSIDE_B: 'Click to explore inside the Space.',
  13263. HELP_MOBILE_MORE_INSIDE_B: 'Tap to explore inside the Space.',
  13264. HELP_MORE_VR_A: 'VR Mode',
  13265. HELP_DESKTOP_MORE_VR_B: 'Click to launch the Space in virtual reality.',
  13266. HELP_MOBILE_MORE_VR_B: 'Tap to launch the Space in virtual reality.',
  13267. HELP_MORE_360_A: '360° Views',
  13268. HELP_DESKTOP_MORE_360_B: 'Click 360 Views in the Highlight Reel to view outdoor scenes.',
  13269. HELP_MOBILE_MORE_360_B: 'Tap 360 Views in the Highlight Reel to view outdoor scenes.',
  13270. HELP_MORE_FULLSCREEN_A: 'Full screen',
  13271. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Expand 3D Showcase to full screen.',
  13272. WEBVR_FOR_CARDBOARD: 'For Google Cardboard',
  13273. WEBVR_VIEW_CARDBOARD: 'Or View on Google Cardboard',
  13274. WEBVR_FOR_DAYDREAM: 'For Daydream View',
  13275. WEBVR_ENTER_WEBVR: 'ENTER VR',
  13276. WEBVR_DIFFERENT_HEADSET: 'Have a different headset?',
  13277. WEBVR_LEARN_MORE: 'Learn more',
  13278. WEBVR_VIEW_SPACE: 'View Space in VR',
  13279. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  13280. WEBVR_DAYDREAM_PHONE: 'Daydream-ready phone',
  13281. VR_VIEW_SPACE: 'View Space in Virtual Reality',
  13282. VR_LEARN_MORE_CAPS: 'LEARN MORE',
  13283. VR_PREVIOUS_CAPS: 'PREVIOUS',
  13284. VR_NEXT_CAPS: 'NEXT',
  13285. VR_GOT_IT_CAPS: 'GOT IT',
  13286. VR_SHOW_SUPPORTED: 'Tap to view the Space in VR with',
  13287. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13288. VR_SHOW_IOS_1: 'Tap to view the space in VR',
  13289. VR_SHOW_IOS_2: 'Requires port VR app and compatible iPhone to view',
  13290. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13291. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13292. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13293. VR_NEED_DAYDREAM: 'NEEDS PRIOR PAIRING WITH DAYDREAM VIEW',
  13294. VR_NEED_DAYDREAM_PHONE: 'Daydream-ready phone',
  13295. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  13296. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  13297. VR_APP: 'port VR App',
  13298. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  13299. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  13300. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s and newer, running iOS 9.1 and higher',
  13301. VR_COMPATIBLE_IPHONES_3: 'Compatible iPhones',
  13302. VR_COMPATIBLE_ANDROID: 'Compatible Android Devices',
  13303. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13304. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13305. VR_ANDROID_DVICES: 'Android Devices',
  13306. VR_COMPATIBLE_SAMSUNG: 'Compatible Samsung Devices',
  13307. VR_SAMSUNG_DETAIL: 'Galaxy S6 and Above',
  13308. VR_APP_FOR_CARDBOARD: 'port VR app for Google Cardboard',
  13309. VR_APP_FOR_SAMSUNG: 'port VR app for Gear VR',
  13310. VR_APP_FOR_ANDROID: 'port VR app for Android Phones',
  13311. VR_APP_OPEN: 'Open with the port VR app instead',
  13312. VR_DOWNLOAD_HERE: 'Download here',
  13313. VR_REQUIRE_HEADSET: 'Requires a VR headset and port VR app for Android to be installed',
  13314. VR_REDIRECT_TO_STORE: 'If app is not installed, you will be redirected to the app store.',
  13315. VR_IMPROPER_EMBED: 'The port Space is not embedded properly to support VR in your web browser.',
  13316. VR_OPEN_ANDROID_LINK: 'Open the Link on Your Mobile Phone',
  13317. VR_ANDROID_OPTIONS: 'Available VR Headset Options',
  13318. SHARE_TO: 'Share to',
  13319. SHARE_LINK: 'Direct Link',
  13320. SHARE_EXPLORE: 'Explore ',
  13321. SHARE_AT: 'at',
  13322. SHARE_WITH: 'with',
  13323. SHARE_3D: ' in 3D',
  13324. SHARE_COPIED: 'Copied!',
  13325. ERROR_BROWSER_SOLUTION: 'Install a new browser to explore in 3D.',
  13326. ERROR_BROWSER_EXPLANATION: 'WebGL requires a modern browser.',
  13327. ERROR_GENERIC_PROBLEM: 'Oops, something went wrong.',
  13328. ERROR_GENERIC_SOLUTION: 'Restart your browser.',
  13329. ERROR_GENERIC_ACTIONS_1: 'If the problem persists, ',
  13330. ERROR_GENERIC_ACTIONS_2: 'install a supported browser',
  13331. ERROR_GENERIC_ACTIONS_3: ' or ',
  13332. ERROR_GENERIC_ACTIONS_4: 'see our troubleshooting guide',
  13333. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Browser not supported.',
  13334. ERROR_WEBGL_IOS_PROBLEM: 'iOS version not supported.',
  13335. ERROR_WEBGL_IOS_SOLUTION: 'Upgrade to iOS 8 or higher to explore in 3D.',
  13336. ERROR_WEBGL_IOS_ACTIONS_1: 'Tap ',
  13337. ERROR_WEBGL_IOS_ACTIONS_2: 'Settings > General > Software Update',
  13338. ERROR_WEBGL_SAFARI_PROBLEM: 'Enable WebGL to explore in 3D.',
  13339. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Click ',
  13340. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Preferences > Advanced > Show Develop menu',
  13341. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Then click ',
  13342. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Develop > Enable WebGL',
  13343. ERROR_MISSING_URLS_PROBLEM: 'Oops, there are no panoramas for this model.',
  13344. ERROR_MISSING_URLS_EXPLANATION: 'This is an older model. The website owner may have a new model on the way.',
  13345. ERROR_LOADING_FAILED_PROBLEM: '模型不可用.',
  13346. ERROR_LOADING_FAILED_ACTIONS_1: 'If the problem persists, ',
  13347. ERROR_LOADING_FAILED_ACTIONS_2: 'see our troubleshooting guide',
  13348. ERROR_MAINTENANCE_PROBLEM: 'Maintenance in progress.',
  13349. ERROR_MAINTENANCE_SOLUTION: 'Please come back in a few minutes.',
  13350. LINK_TO_LOCATION: 'Link to location',
  13351. MENU_COPY: 'Copy',
  13352. LINK_ALERT_COPY: 'Please use CTRL/CMD + C to copy.',
  13353. ROTATE: 'Rotate',
  13354. INSIDE: 'Inside',
  13355. MOVE: 'Move',
  13356. ZOOM: 'Zoom'
  13357. }
  13358. },
  13359. {}
  13360. ],
  13361. 112: [
  13362. function (e, t, i) {
  13363. 'use strict'
  13364. t.exports = {
  13365. PAGE_TITLE: '',
  13366. LOADING: 'Cargando',
  13367. PRESENTED_BY_CAPS: 'PRESENTADO POR',
  13368. POWERED_BY: 'potenciando por ',
  13369. POWERED_BY_CAPS: 'POTENCIADO POR ',
  13370. DESKTOP_SHORT_CTA: 'Haga clic para explorar este Espacio 3D.',
  13371. MOBILE_SHORT_CTA: 'Pulse para explorar este Espacio 3D.',
  13372. PRESENTED_BY: 'Presentado por ',
  13373. MORE: 'Más ',
  13374. LESS: 'Menos ',
  13375. TAG_CONTENT: 'Contenido de tag™',
  13376. SHOW: 'Mostrar',
  13377. HIDE: 'Ocultar',
  13378. DOLLHOUSE: 'Dollhouse',
  13379. FLOOR_PLAN: 'Planos',
  13380. OPEN_HIGHLIGHTS: 'Aspectos Destacados',
  13381. CLOSE_HIGHLIGHTS: 'Cerrar',
  13382. PREVIOUS: 'Anterior',
  13383. PLAY: 'Play',
  13384. PAUSE: 'Pausa',
  13385. NEXT: 'Siguiente',
  13386. EXPLORE_3D_SPACE: 'Explorar el Espacio 3D',
  13387. VIEW_DOLLHOUSE: 'Ver dollhouse',
  13388. SOCIAL_SHARING: 'Compartir este espacio',
  13389. VIEW_IN_VR: 'Ver en realidad virtual',
  13390. VIEW_FULLSCREEN: 'Ver en pantalla completa',
  13391. EXIT_FULLSCREEN: 'Salir de pantalla completa',
  13392. ZOOM_IN: 'Acercar',
  13393. ZOOM_OUT: 'Alejar',
  13394. FLOOR_NAME: 'Piso ',
  13395. FLOOR_ALL: 'Todas',
  13396. TERMS: 'Condiciones',
  13397. PORT_TERMS: 'port términos de uso',
  13398. TERMS_OF_USE: 'Términos de uso',
  13399. TERMS_TEXT_FILE: 'terms-es-MX.html',
  13400. CLOSE_TERMS: 'Cerrar',
  13401. TERMS_FAIL: 'No se han podido obtener las condiciones. Asegúrese de tener una conexión a Internet para ver los términos de uso.',
  13402. HELP: 'Ayuda',
  13403. HELP_NAVIGATION_TAB: 'Navegación',
  13404. HELP_MORE_HELP_TAB: 'Más Ayuda',
  13405. CLOSE: 'Cerrar',
  13406. HELP_DESKTOP_PANORAMA_1A: 'Haga clic y arrastre para mirar alrededor del espacio.',
  13407. HELP_DESKTOP_PANORAMA_2A: 'Haga clic en los aros a lo largo del espacio para moverse.',
  13408. HELP_DESKTOP_PANORAMA_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  13409. HELP_DESKTOP_PANORAMA_1B: 'O use las teclas de flecha para girar a la izquierda y a la derecha.',
  13410. HELP_DESKTOP_PANORAMA_2B: 'O use las teclas de dirección para adelantar o retroceder.',
  13411. HELP_DESKTOP_PANORAMA_3B: 'O use la tecla más para acercar y la tecla menos para alejar.',
  13412. HELP_DESKTOP_360_2A: 'Haga clic en el icono Vista Interior para ingresar al Espacio.',
  13413. HELP_DESKTOP_360_2B: 'O bien, presione la tecla numero 1 para entrar en la Vista Interior.',
  13414. HELP_DESKTOP_DOLLHOUSE_1A: 'Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.',
  13415. HELP_DESKTOP_DOLLHOUSE_2A: 'Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.',
  13416. HELP_DESKTOP_DOLLHOUSE_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  13417. HELP_DESKTOP_DOLLHOUSE_1B: 'O use las teclas de dirección para girar la Dollhouse.',
  13418. HELP_DESKTOP_FLOORPLAN_1A: 'Haga clic con izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición de la planta.',
  13419. HELP_DESKTOP_FLOORPLAN_2A: 'Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.',
  13420. HELP_DESKTOP_FLOORPLAN_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  13421. HELP_DESKTOP_FLOORPLAN_2B: 'O use las teclas para girar hacia la izquierda o derecha.',
  13422. HELP_DESKTOP_FLOORPLAN_3B: 'O use las teclas de dirección para acercar o alejar.',
  13423. HELP_MOBILE_PANORAMA_1: 'Toque y arrastre para mirar alrededor del espacio.',
  13424. HELP_MOBILE_PANORAMA_2: 'Toque en los aros a lo largo del espacio para moverse.',
  13425. HELP_MOBILE_3: 'Use el gesto de pellizcar para acercar o alejar.',
  13426. HELP_MOBILE_360_2: 'Toque el ícono Vista Interior para entrar en el Espacio.',
  13427. HELP_MOBILE_DOLLHOUSE_1: 'Toque y arrastre con dos dedos para cambiar la posición della dollhouse.',
  13428. HELP_MOBILE_DOLLHOUSE_2: 'Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.',
  13429. HELP_MOBILE_FLOORPLAN_1: 'Toque y arrastre para cambiar la posición de la planta.',
  13430. HELP_MOBILE_FLOORPLAN_2: 'Toque y arrastre con dos dedos para girar la planta.',
  13431. HELP_MORE_HLR_A: 'Galería destacada',
  13432. HELP_DESKTOP_MORE_HLR_B: 'Abra para navegar a través del espacio utilizando imágenes en miniatura.',
  13433. HELP_MORE_DOLLHOUSE_A: 'Vista aérea por pisos',
  13434. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'Haga clic para ver y girar la Dollhouse del espacio completo en 3D.',
  13435. HELP_MOBILE_MORE_DOLLHOUSE_B: 'Toque para ver y girar la vista Dollhouse del espacio completo en 3D.',
  13436. HELP_MORE_FLOORS_A: 'Seleccionador de plantas',
  13437. HELP_DESKTOP_MORE_FLOORS_B: 'Cambie de una planta a otra en el espacio.',
  13438. HELP_MORE_TAG_A: 'tag™ Posts',
  13439. HELP_DESKTOP_MORE_TAG_B: 'Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.',
  13440. HELP_MOBILE_MORE_TAG_B: 'Toque para obtener más información acerca de las características del espacio.',
  13441. HELP_MORE_ZOOM_A: 'Controles de zoom',
  13442. HELP_DESKTOP_MORE_ZOOM_B: 'Use estos controles o la rueda de desplazamiento para acercar o alejar.',
  13443. HELP_MORE_TOUR_A: 'Controles de recorrido',
  13444. HELP_DESKTOP_MORE_TOUR_B: 'Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.',
  13445. HELP_MORE_INSIDE_A: 'Vista interior',
  13446. HELP_DESKTOP_MORE_INSIDE_B: 'Haga clic para explorar el interior del espacio.',
  13447. HELP_MOBILE_MORE_INSIDE_B: 'Toque para explorar el interior del espacio.',
  13448. HELP_MORE_VR_A: 'Modo de realidad virtual',
  13449. HELP_DESKTOP_MORE_VR_B: 'Toque para ver el espacio en realidad virtual.',
  13450. HELP_MOBILE_MORE_VR_B: 'Toque para ver el espacio en realidad virtual.',
  13451. HELP_MORE_360_A: '360° Views',
  13452. HELP_DESKTOP_MORE_360_B: 'Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.',
  13453. HELP_MOBILE_MORE_360_B: 'Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.',
  13454. HELP_MORE_FULLSCREEN_A: 'Pantalla completa',
  13455. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Expanda el escenario 3D para verlo en pantalla completa.',
  13456. WEBVR_FOR_CARDBOARD: 'Para Google Cardboard',
  13457. WEBVR_FOR_DAYDREAM: 'Para Daydream View',
  13458. WEBVR_ENTER_WEBVR: 'ENTRAR VR',
  13459. WEBVR_DIFFERENT_HEADSET: '¿Tiene un auricular diferente?',
  13460. WEBVR_LEARN_MORE: 'Más información',
  13461. WEBVR_VIEW_SPACE: 'Ver Espacio en VR',
  13462. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  13463. WEBVR_DAYDREAM_PHONE: 'Daydream Teléfono listos',
  13464. WEBVR_VIEW_CARDBOARD: 'O Ver en Google Cardboard',
  13465. VR_NEED_DAYDREAM: 'Necesidades antes de acoplarse con Daydream View',
  13466. VR_NEED_DAYDREAM_PHONE: 'Teléfono listo para Daydream',
  13467. VR_GOOGLE_DAYDREAM: 'Daydream de Google',
  13468. VR_APP: 'port VR App',
  13469. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13470. VR_APP_FOR_ANDROID: 'Aplicación port VR para Teléfonos Android',
  13471. VR_APP_OPEN: 'Abrir con la aplicación port VR en su lugar',
  13472. VR_VIEW_SPACE: 'Ver Espacio en realidad virtual',
  13473. VR_LEARN_MORE_CAPS: 'SABER MÁS',
  13474. VR_PREVIOUS_CAPS: 'ANTERIOR',
  13475. VR_NEXT_CAPS: 'SIGUIENTE',
  13476. VR_GOT_IT_CAPS: 'COMPRENDIDO',
  13477. VR_SHOW_SUPPORTED: 'Pulse para ver el Espacio en realidad virtual con',
  13478. VR_SHOW_UNSUPPORTED: 'Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.',
  13479. VR_SHOW_IOS_1: 'Pulse para ver el Espacio en realidad virtual',
  13480. VR_SHOW_IOS_2: 'Necesita la aplicación port VR y un iPhone compatible para ver',
  13481. VR_WHAT_YOU_NEED: 'Lo que necesitaras...',
  13482. VR_NEED_CARDBOARD: 'Lo que necesitaras con Google Cardboard',
  13483. VR_NEED_SAMSUNG: 'Lo que necesitaras con el Samsung Gear VR',
  13484. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  13485. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  13486. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  13487. VR_COMPATIBLE_IPHONES_2: 'Compatible con iPhone 6S o superior y con iOS 9.1 en adelante',
  13488. VR_COMPATIBLE_IPHONES_3: 'iPhones compatibles',
  13489. VR_COMPATIBLE_ANDROID: 'Dispositivos Android compatibles',
  13490. VR_ANDROID_DETAIL: 'Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante',
  13491. VR_ANDROID_DVICES: 'Dispositivos Android',
  13492. VR_COMPATIBLE_SAMSUNG: 'Dispositivos compatibles del Samsung',
  13493. VR_SAMSUNG_DETAIL: 'Galaxy S5 en adelante',
  13494. VR_APP_FOR_CARDBOARD: 'Aplicación port VR para Google Cardboard',
  13495. VR_APP_FOR_SAMSUNG: 'Aplicación port VR para Gear VR',
  13496. VR_DOWNLOAD_HERE: 'Descargar aquí',
  13497. VR_REQUIRE_HEADSET: 'Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android',
  13498. VR_REDIRECT_TO_STORE: 'Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.',
  13499. VR_IMPROPER_EMBED: 'El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.',
  13500. VR_OPEN_ANDROID_LINK: 'Abre el enlace en tu teléfono móvil',
  13501. VR_ANDROID_OPTIONS: 'Opciones de auriculares en RV disponibles',
  13502. SHARE_TO: 'Compartir en',
  13503. SHARE_LINK: 'Enlace directo',
  13504. SHARE_EXPLORE: 'Explorar ',
  13505. SHARE_AT: 'en',
  13506. SHARE_WITH: 'con',
  13507. SHARE_3D: ' en 3D',
  13508. SHARE_COPIED: '¡Copiado!',
  13509. ERROR_BROWSER_SOLUTION: 'Instale un nuevo navegador para explorar en 3D.',
  13510. ERROR_BROWSER_EXPLANATION: 'WebGL requiere un navegador moderno.',
  13511. ERROR_GENERIC_PROBLEM: 'Vaya, algo ha ido mal.',
  13512. ERROR_GENERIC_SOLUTION: 'Reinicie su navegador.',
  13513. ERROR_GENERIC_ACTIONS_1: 'Si el problema persiste, ',
  13514. ERROR_GENERIC_ACTIONS_2: 'instale un navegador compatible',
  13515. ERROR_GENERIC_ACTIONS_3: ' o ',
  13516. ERROR_GENERIC_ACTIONS_4: 'consulte nuestra guía de solución de problemas',
  13517. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Navegador no compatible.',
  13518. ERROR_WEBGL_IOS_PROBLEM: 'Versión de iOS no compatible.',
  13519. ERROR_WEBGL_IOS_SOLUTION: 'Actualice a iOS 8 o superior para explorar en 3D.',
  13520. ERROR_WEBGL_IOS_ACTIONS_1: 'Pulse ',
  13521. ERROR_WEBGL_IOS_ACTIONS_2: 'Ajustes > General > Actualización de software',
  13522. ERROR_WEBGL_SAFARI_PROBLEM: 'Habilite WebGL para explorar en 3D.',
  13523. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Haga clic en ',
  13524. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Preferencias > Avanzado > Mostrar el menú Desarrollar',
  13525. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Después, haga clic en ',
  13526. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Desarrollar > Habilitar WebGL',
  13527. ERROR_MISSING_URLS_PROBLEM: 'Vaya, no hay panoramas para este modelo.',
  13528. ERROR_MISSING_URLS_EXPLANATION: 'Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.',
  13529. ERROR_LOADING_FAILED_PROBLEM: 'Vaya, modelo no disponible.',
  13530. ERROR_LOADING_FAILED_ACTIONS_1: 'Si el problema persiste, ',
  13531. ERROR_LOADING_FAILED_ACTIONS_2: 'consulte nuestra guía de solución de problemas',
  13532. ERROR_MAINTENANCE_PROBLEM: 'Mantenimiento en progreso.',
  13533. ERROR_MAINTENANCE_SOLUTION: 'Regrese en unos minutos.',
  13534. LINK_TO_LOCATION: 'Enlace a la ubicación',
  13535. MENU_COPY: 'Copiar',
  13536. LINK_ALERT_COPY: 'Utilice CTRL/CMD + C para copiar.',
  13537. ROTATE: 'Girar',
  13538. INSIDE: 'Interior',
  13539. MOVE: 'Moverse',
  13540. ZOOM: 'Acercar o alejar'
  13541. }
  13542. },
  13543. {}
  13544. ],
  13545. 113: [
  13546. function (e, t, i) {
  13547. 'use strict'
  13548. t.exports = {
  13549. PAGE_TITLE: '',
  13550. LOADING: 'Chargement',
  13551. PRESENTED_BY_CAPS: 'PRÉSENTÉ PAR',
  13552. POWERED_BY: 'alimenté par ',
  13553. POWERED_BY_CAPS: 'ALIMENTÉ PAR',
  13554. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13555. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13556. PRESENTED_BY: 'Présenté par ',
  13557. MORE: 'Plus ',
  13558. LESS: 'Moins ',
  13559. TAG_CONTENT: 'Contenu tag™',
  13560. SHOW: 'Montrer',
  13561. HIDE: 'Cacher',
  13562. DOLLHOUSE: 'Dollhouse',
  13563. FLOOR_PLAN: 'Plan de sol',
  13564. OPEN_HIGHLIGHTS: 'Ouvrir les faits saillants',
  13565. CLOSE_HIGHLIGHTS: 'Fermer',
  13566. PREVIOUS: 'Précédent',
  13567. PLAY: 'Lecture',
  13568. PAUSE: 'Pause',
  13569. NEXT: 'Suivant',
  13570. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13571. VIEW_DOLLHOUSE: 'Voir dollhouse',
  13572. SOCIAL_SHARING: 'Partager cet espace',
  13573. VIEW_IN_VR: 'Voir en VR',
  13574. VIEW_FULLSCREEN: 'Plein écran',
  13575. EXIT_FULLSCREEN: 'Fermer plein écran',
  13576. ZOOM_IN: 'Zoom avant',
  13577. ZOOM_OUT: 'Zoom arrière',
  13578. FLOOR_NAME: 'Étage ',
  13579. FLOOR_ALL: 'Tous',
  13580. TERMS: 'Mentions légales',
  13581. PORT_TERMS: 'port mentions légales',
  13582. TERMS_OF_USE: "Conditions d'utilisation",
  13583. TERMS_TEXT_FILE: 'terms-fr-FR.html',
  13584. CLOSE_TERMS: 'Fermer',
  13585. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13586. HELP: 'Aide',
  13587. HELP_NAVIGATION_TAB: 'Navigation',
  13588. HELP_MORE_HELP_TAB: 'Aide',
  13589. CLOSE: 'Fermer',
  13590. HELP_DESKTOP_PANORAMA_1A: 'Cliquez et faites glisser pour regarder autour de l’espace.',
  13591. HELP_DESKTOP_PANORAMA_2A: 'Cliquez sur les anneaux pour vous déplacer.',
  13592. HELP_DESKTOP_PANORAMA_3A: 'Utilisez la molette de votre souris pour zoomer.',
  13593. HELP_DESKTOP_PANORAMA_1B: 'Ou utilisez les touches pour tourner.',
  13594. HELP_DESKTOP_PANORAMA_2B: 'Ou utilisez les touches pour avancer et reculer.',
  13595. HELP_DESKTOP_PANORAMA_3B: 'Ou utilisez les touches plus et moins pour zoomer.',
  13596. HELP_DESKTOP_360_2A: 'Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.',
  13597. HELP_DESKTOP_360_2B: 'Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.',
  13598. HELP_DESKTOP_DOLLHOUSE_1A: 'Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.',
  13599. HELP_DESKTOP_DOLLHOUSE_2A: 'Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.',
  13600. HELP_DESKTOP_DOLLHOUSE_3A: 'Utilisez la molette de votre souris pour zoomer.',
  13601. HELP_DESKTOP_DOLLHOUSE_1B: 'Ou utilisez les touches pour faire pivoter la vue Dollhouse.',
  13602. HELP_DESKTOP_FLOORPLAN_1A: 'Faites un clic droit pour changer la position du plan sur l’écran.',
  13603. HELP_DESKTOP_FLOORPLAN_2A: 'Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.',
  13604. HELP_DESKTOP_FLOORPLAN_3A: 'Utilisez la molette de votre souris pour zoomer.',
  13605. HELP_DESKTOP_FLOORPLAN_2B: 'Ou utilisez les touches pour faire pivoter à gauche ou à droite.',
  13606. HELP_DESKTOP_FLOORPLAN_3B: 'Ou utilisez les touches pour effectuer un zoom avant ou arrière.',
  13607. HELP_MOBILE_PANORAMA_1: 'Touchez et faites glisser pour regarder autour de l’espace.',
  13608. HELP_MOBILE_PANORAMA_2: 'Tapez sur les anneaux dans tout l’espace pour vous déplacer.',
  13609. HELP_MOBILE_3: 'Utilisez un geste de pincement pour zoomer avant/arrière.',
  13610. HELP_MOBILE_360_2: 'Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.',
  13611. HELP_MOBILE_DOLLHOUSE_1: 'Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.',
  13612. HELP_MOBILE_DOLLHOUSE_2: 'Touchez et faites glisser avec deux doigts pour positionner vue en coupe.',
  13613. HELP_MOBILE_FLOORPLAN_1: 'Touchez et faites glisser pour positionner le plan.',
  13614. HELP_MOBILE_FLOORPLAN_2: 'Touchez et faites glisser avec deux doigts pour faire pivoter le plan.',
  13615. HELP_MORE_HLR_A: 'Carrousel',
  13616. HELP_DESKTOP_MORE_HLR_B: 'Ouvrez pour naviguer dans l’espace en utilisant les vignettes.',
  13617. HELP_MORE_DOLLHOUSE_A: 'Vue en coupe',
  13618. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'Cliquez pour afficher et faire pivoter l’espace entier en 3D.',
  13619. HELP_MOBILE_MORE_DOLLHOUSE_B: 'Tapez pour afficher et faire pivoter l’espace entier en 3D.',
  13620. HELP_MORE_FLOORS_A: 'Sélecteur d’étage',
  13621. HELP_DESKTOP_MORE_FLOORS_B: 'Basculer entre les étages dans l’espace.',
  13622. HELP_MORE_TAG_A: 'tag™ Posts',
  13623. HELP_DESKTOP_MORE_TAG_B: 'Cliquez ou survolez pour obtenir des informations sur l’espace.',
  13624. HELP_MOBILE_MORE_TAG_B: 'Tapez pour obtenir des informations sur l’espace.',
  13625. HELP_MORE_ZOOM_A: 'Commandes de zoom',
  13626. HELP_DESKTOP_MORE_ZOOM_B: 'Utilisez votre clavier ou la molette de votre souris pour zoomer.',
  13627. HELP_MORE_TOUR_A: 'Commandes de la visite',
  13628. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13629. HELP_MORE_INSIDE_A: 'Vue intérieure',
  13630. HELP_DESKTOP_MORE_INSIDE_B: 'Cliquez pour explorer l’intérieur de l’espace.',
  13631. HELP_MOBILE_MORE_INSIDE_B: 'Tapez pour explorer l’intérieur de l’espace.',
  13632. HELP_MORE_VR_A: 'Mode RV',
  13633. HELP_DESKTOP_MORE_VR_B: 'Cliquez pour lancer l’espace en réalité virtuelle.',
  13634. HELP_MOBILE_MORE_VR_B: 'Tapez pour lancer l’espace en réalité virtuelle.',
  13635. HELP_MORE_360_A: 'Vues 360°',
  13636. HELP_DESKTOP_MORE_360_B: 'Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.',
  13637. HELP_MOBILE_MORE_360_B: 'Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.',
  13638. HELP_MORE_FULLSCREEN_A: 'Plein écran',
  13639. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Voir 3D Showcase en plein écran.',
  13640. WEBVR_FOR_CARDBOARD: 'Pour Google Cardboard',
  13641. WEBVR_FOR_DAYDREAM: 'Pour Daydream View',
  13642. WEBVR_ENTER_WEBVR: 'ENTRER VR',
  13643. WEBVR_DIFFERENT_HEADSET: 'Avez-vous un casque différent?',
  13644. WEBVR_LEARN_MORE: 'En savoir plus',
  13645. WEBVR_VIEW_SPACE: 'Voir Espace en VR',
  13646. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  13647. WEBVR_DAYDREAM_PHONE: 'Téléphone compatibles Daydream',
  13648. WEBVR_VIEW_CARDBOARD: 'Ou Afficher sur Google Cardboard',
  13649. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13650. VR_LEARN_MORE_CAPS: 'EN SAVOIR PLUS',
  13651. VR_PREVIOUS_CAPS: 'PRÉCÉDENT',
  13652. VR_NEXT_CAPS: 'SUIVANT',
  13653. VR_GOT_IT_CAPS: 'BIEN COMPRIS',
  13654. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13655. VR_SHOW_UNSUPPORTED: 'Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.',
  13656. VR_SHOW_IOS_1: 'Taper pour voir l’Espace en Realité Virtuelle',
  13657. VR_SHOW_IOS_2: 'Nécessite l’application port VR et un iPhone compatible pour voir',
  13658. VR_WHAT_YOU_NEED: 'Ce dont vous aurez besoin pour...',
  13659. VR_NEED_CARDBOARD: 'Ce dont vous aurez besoin avec Google Cardboard',
  13660. VR_NEED_SAMSUNG: 'Ce dont vous aurez besoin avec Samsung Gear VR',
  13661. VR_NEED_DAYDREAM: 'BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW',
  13662. VR_NEED_DAYDREAM_PHONE: 'Téléphone compatible avec Daydream',
  13663. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  13664. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  13665. VR_APP: 'port VR App',
  13666. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  13667. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  13668. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s et plus récent, avec iOS 9.1 et plus récent',
  13669. VR_COMPATIBLE_IPHONES_3: 'iPhones compatibles',
  13670. VR_COMPATIBLE_ANDROID: 'Appareils Android compatibles',
  13671. VR_COMPATIBLE_ANDROID_LONG: 'Compatible avec les écrans des appareils Android de 11,5 à 14 cm (4,5 à 5,5 po) fonctionnant sous Android OS 4.4.4 et plus',
  13672. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13673. VR_ANDROID_DVICES: 'Appareils Android',
  13674. VR_COMPATIBLE_SAMSUNG: 'Appareils Samsung Compatibles',
  13675. VR_SAMSUNG_DETAIL: 'Galaxy S6 et plus récents',
  13676. VR_APP_FOR_CARDBOARD: 'Application port VR pour Google Cardboard',
  13677. VR_APP_FOR_SAMSUNG: 'Application port VR pour Gear VR',
  13678. VR_APP_FOR_ANDROID: 'Application port VR pour téléphones Android',
  13679. VR_APP_OPEN: 'Ouvrir plutôt avec l’application port VR',
  13680. VR_DOWNLOAD_HERE: 'Télécharger ici',
  13681. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13682. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13683. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13684. VR_OPEN_ANDROID_LINK: 'Ouvrez ce lien avec votre appareil mobile',
  13685. VR_ANDROID_OPTIONS: 'Options disponibles pour casque VR sous',
  13686. SHARE_TO: 'Partager sur',
  13687. SHARE_LINK: 'Lien direct',
  13688. SHARE_EXPLORE: 'Explorer ',
  13689. SHARE_AT: 'à',
  13690. SHARE_WITH: 'avec',
  13691. SHARE_3D: ' en 3D',
  13692. SHARE_COPIED: 'Copié!',
  13693. ERROR_BROWSER_SOLUTION: 'Installer un nouveau navigateur pour explorer en 3D.',
  13694. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13695. ERROR_GENERIC_PROBLEM: 'Il y eu un problème.',
  13696. ERROR_GENERIC_SOLUTION: 'Redémarrer votre navigateur.',
  13697. ERROR_GENERIC_ACTIONS_1: 'Si le problème persiste, ',
  13698. ERROR_GENERIC_ACTIONS_2: 'installez un navigateur plus récent',
  13699. ERROR_GENERIC_ACTIONS_3: ' ou ',
  13700. ERROR_GENERIC_ACTIONS_4: 'voir notre guide de dépannage',
  13701. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Navigateur non-supporté.',
  13702. ERROR_WEBGL_IOS_PROBLEM: 'Version iOS non-supportée.',
  13703. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13704. ERROR_WEBGL_IOS_ACTIONS_1: 'Tapez ',
  13705. ERROR_WEBGL_IOS_ACTIONS_2: 'Paramètres > Général > Mise à jour Software',
  13706. ERROR_WEBGL_SAFARI_PROBLEM: 'Activez WegGL pour explorer en 3D.',
  13707. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Cliquez ',
  13708. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Préferences > Avancés > Voir menu développeur',
  13709. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Puis cliquez ',
  13710. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Développe > Activé WebGL',
  13711. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13712. ERROR_MISSING_URLS_EXPLANATION: 'Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.',
  13713. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13714. ERROR_LOADING_FAILED_ACTIONS_1: 'Si le problème persiste, ',
  13715. ERROR_LOADING_FAILED_ACTIONS_2: 'voir notre guide de dépannage',
  13716. ERROR_MAINTENANCE_PROBLEM: 'Maintenance en cours.',
  13717. ERROR_MAINTENANCE_SOLUTION: 'Revenez dans quelques instants.',
  13718. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13719. MENU_COPY: 'Copie',
  13720. LINK_ALERT_COPY: 'Utiliser CTRL+CMD C pour copier.',
  13721. ROTATE: 'Faire pivoter',
  13722. INSIDE: 'Intérieure',
  13723. MOVE: 'Se déplacer',
  13724. ZOOM: 'Zoom'
  13725. }
  13726. },
  13727. {}
  13728. ],
  13729. 114: [
  13730. function (e, t, i) {
  13731. 'use strict'
  13732. t.exports = {
  13733. PAGE_TITLE: '',
  13734. LOADING: '読み込み中',
  13735. PRESENTED_BY_CAPS: 'PRESENTED BY',
  13736. POWERED_BY: 'powered by',
  13737. POWERED_BY_CAPS: 'POWERED BY',
  13738. DESKTOP_SHORT_CTA: 'クリックしてこの3D Spaceを探索',
  13739. MOBILE_SHORT_CTA: 'タップしてこの3D Spaceを探索',
  13740. PRESENTED_BY: 'Presented by ',
  13741. MORE: '全て表示 ',
  13742. LESS: '閉じる ',
  13743. TAG_CONTENT: 'tag™コンテンツ ',
  13744. SHOW: '表示',
  13745. HIDE: '非表示',
  13746. DOLLHOUSE: 'ドールハウス',
  13747. FLOOR_PLAN: 'フロアプラン',
  13748. OPEN_HIGHLIGHTS: 'ハイライトを開く',
  13749. CLOSE_HIGHLIGHTS: '閉じる',
  13750. PREVIOUS: '前へ',
  13751. PLAY: '再生',
  13752. PAUSE: '一時停止',
  13753. NEXT: '次へ',
  13754. EXPLORE_3D_SPACE: '3DSpaceの探索',
  13755. VIEW_DOLLHOUSE: 'ドールハウスの表示',
  13756. SOCIAL_SHARING: 'このSpaceを共有する',
  13757. VIEW_IN_VR: 'VRで表示',
  13758. VIEW_FULLSCREEN: 'フルスクリーン表示',
  13759. EXIT_FULLSCREEN: 'フルスクリーン表示を終了',
  13760. ZOOM_IN: 'ズームイン',
  13761. ZOOM_OUT: 'ズームアウト',
  13762. FLOOR_NAME: 'フロア ',
  13763. FLOOR_ALL: 'すべて',
  13764. TERMS: '規約',
  13765. PORT_TERMS: 'port規約',
  13766. TERMS_OF_USE: '利用規約',
  13767. CLOSE_TERMS: '閉じる',
  13768. TERMS_TEXT_FILE: 'terms-jp-JP.html',
  13769. TERMS_FAIL: '規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。',
  13770. WEBVR_FOR_DAYDREAM: 'Daydream View用',
  13771. WEBVR_ENTER_WEBVR: 'VRに入る',
  13772. WEBVR_DIFFERENT_HEADSET: '別のヘッドセットをお持ちですか?',
  13773. WEBVR_LEARN_MORE: 'もっと詳しく',
  13774. WEBVR_VIEW_SPACE: 'VRでSpaceを表示',
  13775. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  13776. WEBVR_DAYDREAM_PHONE: 'Daydream対応スマホ',
  13777. WEBVR_FOR_CARDBOARD: 'Google Cardboard用',
  13778. WEBVR_VIEW_CARDBOARD: 'またはGoogle Cardboardで表示',
  13779. VR_VIEW_SPACE: 'バーチャルリアリティでSpaceを表示',
  13780. VR_LEARN_MORE_CAPS: 'もっと詳しく',
  13781. VR_PREVIOUS_CAPS: '前へ',
  13782. VR_NEXT_CAPS: '次へ',
  13783. VR_GOT_IT_CAPS: '了解',
  13784. VR_SHOW_SUPPORTED: 'タップして次を使用してVRでSpaceを表示: ',
  13785. VR_SHOW_UNSUPPORTED: 'お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません',
  13786. VR_SHOW_IOS_1: 'タップしてVRでSpaceを表示',
  13787. VR_SHOW_IOS_2: '表示するにはport VRアプリと互換性のあるiPhoneが必要です',
  13788. VR_WHAT_YOU_NEED: '必要なもの',
  13789. VR_NEED_CARDBOARD: 'Google Cardboardに必要なもの',
  13790. VR_NEED_SAMSUNG: 'Samsung Gear VRに必要なもの',
  13791. VR_NEED_DAYDREAM: '事前にDaydream Viewとのペアリングが必要です',
  13792. VR_NEED_DAYDREAM_PHONE: 'Daydream対応スマホ',
  13793. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  13794. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  13795. VR_APP: 'port VRアプリ',
  13796. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  13797. VR_COMPATIBLE_IPHONES_1: 'iPhone',
  13798. VR_COMPATIBLE_IPHONES_2: 'iOS 9.1以降で動作するiPhone 5s以降のモデル',
  13799. VR_COMPATIBLE_IPHONES_3: '互換性のあるiPhone',
  13800. VR_COMPATIBLE_ANDROID: '互換性のあるAndroidデバイス',
  13801. VR_COMPATIBLE_ANDROID_LONG: 'Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ',
  13802. VR_ANDROID_DETAIL: 'Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ',
  13803. VR_ANDROID_DVICES: 'Androidデバイス',
  13804. VR_COMPATIBLE_SAMSUNG: '互換性のあるSamsungデバイス',
  13805. VR_SAMSUNG_DETAIL: 'Galaxy S5以降のモデル',
  13806. VR_APP_FOR_CARDBOARD: 'Google Cardboard用のport VRアプリ',
  13807. VR_APP_FOR_SAMSUNG: 'Gear VR 用のport VRアプリ',
  13808. VR_APP_FOR_ANDROID: 'Androidフォン用のport VRアプリ',
  13809. VR_APP_OPEN: 'port VRアプリで開く',
  13810. VR_DOWNLOAD_HERE: 'ここからダウンロード',
  13811. VR_REQUIRE_HEADSET: 'Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります',
  13812. VR_REDIRECT_TO_STORE: 'アプリがインストールされていない場合、App Storeにリダイレクトされます',
  13813. VR_IMPROPER_EMBED: 'お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。',
  13814. VR_OPEN_ANDROID_LINK: 'お使いの携帯電話でリンクを開いてください',
  13815. VR_ANDROID_OPTIONS: '利用可能なVRヘッドセットオプション',
  13816. SHARE_TO: '共有先',
  13817. SHARE_LINK: 'ダイレクトリンク',
  13818. SHARE_EXPLORE: '探索',
  13819. SHARE_AT: '場所',
  13820. SHARE_WITH: '使用アプリ',
  13821. SHARE_3D: '3Dで',
  13822. SHARE_COPIED: 'コピーされました!',
  13823. ERROR_BROWSER_SOLUTION: '3D探索するには、新しいバージョンのブラウザをインストールしてください',
  13824. ERROR_BROWSER_EXPLANATION: 'WebGLにはモダンブラウザが必要です。',
  13825. ERROR_GENERIC_PROBLEM: '問題が発生しました。',
  13826. ERROR_GENERIC_SOLUTION: 'ブラウザを再起動してください。',
  13827. ERROR_GENERIC_ACTIONS_1: '問題が解決しない場合は、',
  13828. ERROR_GENERIC_ACTIONS_2: 'サポートされているブラウザをインストールしてください',
  13829. ERROR_GENERIC_ACTIONS_3: 'または',
  13830. ERROR_GENERIC_ACTIONS_4: 'トラブルシューティングガイドを参照してください',
  13831. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'ブラウザがサポートされていません。',
  13832. ERROR_WEBGL_IOS_PROBLEM: 'サポートされていないiOSバージョンです。',
  13833. ERROR_WEBGL_IOS_SOLUTION: '3D探索するには、iOS 8以降にアップグレードしてください。',
  13834. ERROR_WEBGL_IOS_ACTIONS_1: '以下の順にタップします:',
  13835. ERROR_WEBGL_IOS_ACTIONS_2: '設定 > 全般 > ソフトウェアの更新',
  13836. ERROR_WEBGL_SAFARI_PROBLEM: 'WebGLを有効にして3Dで探索します。',
  13837. ERROR_WEBGL_SAFARI_ACTIONS_1: '以下の順にクリックします:',
  13838. ERROR_WEBGL_SAFARI_ACTIONS_2: '環境設定 > 詳細 > メニューバーに開発メニューを表示',
  13839. ERROR_WEBGL_SAFARI_ACTIONS_3: 'その後、以下の順にクリックします:',
  13840. ERROR_WEBGL_SAFARI_ACTIONS_4: '開発 > WebGLを有効にする',
  13841. ERROR_MISSING_URLS_PROBLEM: 'このモデルではパノラマを使用できません。',
  13842. ERROR_MISSING_URLS_EXPLANATION: 'これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。',
  13843. ERROR_LOADING_FAILED_PROBLEM: 'モデルは利用できません。',
  13844. ERROR_LOADING_FAILED_ACTIONS_1: '問題が解決しない場合は、',
  13845. ERROR_LOADING_FAILED_ACTIONS_2: 'トラブルシューティングガイドを参照してください',
  13846. ERROR_MAINTENANCE_PROBLEM: 'メンテナンスは進行中です。',
  13847. ERROR_MAINTENANCE_SOLUTION: 'しばらくしてからやり直し てください。',
  13848. LINK_TO_LOCATION: 'ロケーションへのリンク',
  13849. MENU_COPY: 'コピー',
  13850. LINK_ALERT_COPY: 'コピーするにはCTRL/CMD + Cを使用してください。',
  13851. ROTATE: '回転',
  13852. MOVE: '移動',
  13853. INSIDE: '内側',
  13854. ZOOM: 'ズーム',
  13855. HELP: 'ヘルプ',
  13856. HELP_NAVIGATION_TAB: 'ナビゲーション',
  13857. HELP_MORE_HELP_TAB: 'その他のヘルプ',
  13858. HELP_DESKTOP_PANORAMA_1A: 'Spaceを見回すには、クリックしてドラッグします。',
  13859. HELP_DESKTOP_PANORAMA_2A: '移動するには、Space全体にあるリングをクリックします。',
  13860. HELP_DESKTOP_PANORAMA_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  13861. HELP_DESKTOP_PANORAMA_1B: 'または、矢印キーを使用して左右に向きを変えます。',
  13862. HELP_DESKTOP_PANORAMA_2B: 'または、矢印キーを使用して前後に向きを変えます。',
  13863. HELP_DESKTOP_PANORAMA_3B: 'あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。',
  13864. HELP_DESKTOP_360_2A: '内側ビューアイコンをクリックしてSpaceに入ります。',
  13865. HELP_DESKTOP_360_2B: 'または、数字キー1を押して内側ビューに入ります。',
  13866. HELP_DESKTOP_DOLLHOUSE_1A: '左クリックと左右、上下のドラッグでドールハウスを回転します。',
  13867. HELP_DESKTOP_DOLLHOUSE_2A: '右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。',
  13868. HELP_DESKTOP_DOLLHOUSE_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  13869. HELP_DESKTOP_DOLLHOUSE_1B: 'または、矢印キーを使用してドールハウスを回転します。',
  13870. HELP_DESKTOP_FLOORPLAN_1A: '左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。',
  13871. HELP_DESKTOP_FLOORPLAN_2A: '右ボタンを押しながら左右にドラッグして、フロアプランを回転します。',
  13872. HELP_DESKTOP_FLOORPLAN_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  13873. HELP_DESKTOP_FLOORPLAN_2B: 'または、矢印キーを使用して左右に回転します。',
  13874. HELP_DESKTOP_FLOORPLAN_3B: 'または、矢印キーを使用して、ズームイン、ズームアウトします。',
  13875. HELP_MOBILE_PANORAMA_1: 'Spaceを見回すには、タッチしてドラッグします。',
  13876. HELP_MOBILE_PANORAMA_2: '移動するには、Space全体にあるリングをタップします。',
  13877. HELP_MOBILE_3: 'ピンチジェスチャーを使用してズームイン、ズームアウトします。',
  13878. HELP_MOBILE_360_2: '内側ビューアイコンをタップしてSpaceに入ります。',
  13879. HELP_MOBILE_DOLLHOUSE_1: 'タッチして上下左右にドラッグしてドールハウスを回転します。',
  13880. HELP_MOBILE_DOLLHOUSE_2: 'タッチして、2本指でドラッグしてドールハウスを配置します。',
  13881. HELP_MOBILE_FLOORPLAN_1: 'タッチ&ドラッグしてフロアプランを配置します。',
  13882. HELP_MOBILE_FLOORPLAN_2: 'タッチして、2本指でドラッグしてフロアプランを回転します。',
  13883. HELP_MORE_HLR_A: 'ハイライト',
  13884. HELP_DESKTOP_MORE_HLR_B: 'サムネイル画像を使用してSpaceを移動するために開きます。',
  13885. HELP_MORE_DOLLHOUSE_A: 'ドールハウス',
  13886. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'クリックして3DでSpace全体のトップダウンビューを表示して回転します。',
  13887. HELP_MOBILE_MORE_DOLLHOUSE_B: 'タップして3DでSpace全体のトップダウンビューを表示して回転します。',
  13888. HELP_MORE_FLOORS_A: 'フロアセレクター',
  13889. HELP_DESKTOP_MORE_FLOORS_B: 'Space内のフロアを切り替えます。',
  13890. HELP_MORE_TAG_A: 'tag™ Posts',
  13891. HELP_DESKTOP_MORE_TAG_B: 'クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。',
  13892. HELP_MOBILE_MORE_TAG_B: 'タップするとSpace内の機能についての説明が表示されます。',
  13893. HELP_MORE_ZOOM_A: 'ズームコントロール',
  13894. HELP_DESKTOP_MORE_ZOOM_B: 'これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。',
  13895. HELP_MORE_TOUR_A: 'ツアーコントロール',
  13896. HELP_DESKTOP_MORE_TOUR_B: 'ガイド付きツアー中に再生、一時停止、前方・後方に移動します。',
  13897. HELP_MORE_INSIDE_A: '内側ビュー',
  13898. HELP_DESKTOP_MORE_INSIDE_B: 'クリックしてSpace内を探索します。',
  13899. HELP_MOBILE_MORE_INSIDE_B: 'タップしてSpace内を探索します。',
  13900. HELP_MORE_VR_A: 'VRモード',
  13901. HELP_DESKTOP_MORE_VR_B: 'クリックしてバーチャルリアリティでSpaceを起動します。',
  13902. HELP_MOBILE_MORE_VR_B: 'タップしてバーチャルリアリティでSpaceを起動します。',
  13903. HELP_MORE_360_A: '360° Views',
  13904. HELP_DESKTOP_MORE_360_B: 'Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。',
  13905. HELP_MOBILE_MORE_360_B: 'Highlight Reelの360° Viewsをタップして屋外シーンを表示します。',
  13906. HELP_MORE_FULLSCREEN_A: 'フルスクリーン',
  13907. HELP_DESKTOP_MORE_FULLSCREEN_B: '3D Showcaseをフルスクリーン表示にします。',
  13908. CLOSE: '閉じる'
  13909. }
  13910. },
  13911. {}
  13912. ],
  13913. 115: [
  13914. function (e, t, i) {
  13915. 'use strict'
  13916. t.exports = {
  13917. PAGE_TITLE: '',
  13918. LOADING: 'Загрузка',
  13919. PRESENTED_BY_CAPS: 'ПРЕДСТАВЛЕНО',
  13920. POWERED_BY: 'разработано на платформе ',
  13921. POWERED_BY_CAPS: 'РАЗРАБОТАНО НА ПЛАТФОРМЕ',
  13922. DESKTOP_SHORT_CTA: 'Нажмите для просмотра.',
  13923. MOBILE_SHORT_CTA: 'Нажмите для просмотра.',
  13924. PRESENTED_BY: 'Представлено ',
  13925. MORE: 'Больше ',
  13926. LESS: 'Меньше ',
  13927. TAG_CONTENT: 'tag™ Контент',
  13928. SHOW: 'Показать',
  13929. HIDE: 'Скрыть',
  13930. DOLLHOUSE: 'Dollhouse',
  13931. FLOOR_PLAN: 'Планировка',
  13932. OPEN_HIGHLIGHTS: 'Открыть Фотоколлаж',
  13933. CLOSE_HIGHLIGHTS: 'Закрыть',
  13934. PREVIOUS: 'Предыдущий',
  13935. PLAY: 'Воспроизвести',
  13936. PAUSE: 'Пауза',
  13937. NEXT: 'Следующий',
  13938. EXPLORE_3D_SPACE: 'Просмотреть 3D модель',
  13939. VIEW_DOLLHOUSE: 'Посмотреть Dollhouse',
  13940. SOCIAL_SHARING: 'Поделиться этой моделью',
  13941. VIEW_IN_VR: 'Посмотреть в VR',
  13942. VIEW_FULLSCREEN: 'Полный экран',
  13943. EXIT_FULLSCREEN: 'Выйти из полноэкранного режима',
  13944. ZOOM_IN: 'Увеличить',
  13945. ZOOM_OUT: 'Уменьшить',
  13946. FLOOR_NAME: 'Этаж ',
  13947. FLOOR_ALL: 'Все',
  13948. TERMS: 'Условия',
  13949. PORT_TERMS: 'Правила пользования',
  13950. TERMS_OF_USE: 'Условия использования',
  13951. TERMS_TEXT_FILE: 'terms-ru-RU.html',
  13952. CLOSE_TERMS: 'Закрыть',
  13953. TERMS_FAIL: 'Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.',
  13954. HELP: 'Помощь',
  13955. HELP_NAVIGATION_TAB: 'Навигация',
  13956. HELP_MORE_HELP_TAB: 'Доп. Помощь',
  13957. CLOSE: 'Закрыть',
  13958. HELP_DESKTOP_PANORAMA_1A: 'Нажмите и перетащите, чтобы осмотреть пространство вокруг.',
  13959. HELP_DESKTOP_PANORAMA_2A: 'Для передвижения по модели нажимайте на круги .',
  13960. HELP_DESKTOP_PANORAMA_3A: 'Используйте колесо прокрутки для увеличения и уменьшения.',
  13961. HELP_DESKTOP_PANORAMA_1B: 'Или используйте клавиши со стрелками для поворота влево и вправо.',
  13962. HELP_DESKTOP_PANORAMA_2B: 'Или используйте стрелки для перемещения вперед и назад.',
  13963. HELP_DESKTOP_PANORAMA_3B: 'Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.',
  13964. HELP_DESKTOP_360_2A: 'Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.',
  13965. HELP_DESKTOP_360_2B: 'или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.',
  13966. HELP_DESKTOP_DOLLHOUSE_1A: 'Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.',
  13967. HELP_DESKTOP_DOLLHOUSE_2A: 'Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.',
  13968. HELP_DESKTOP_DOLLHOUSE_3A: 'Используйте колесо прокрутки чтобы увеличить и уменьшить.',
  13969. HELP_DESKTOP_DOLLHOUSE_1B: 'Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.',
  13970. HELP_DESKTOP_FLOORPLAN_1A: 'Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.',
  13971. HELP_DESKTOP_FLOORPLAN_2A: 'Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.',
  13972. HELP_DESKTOP_FLOORPLAN_3A: 'Используйте колесо прокрутки чтобы увеличить и уменьшить.',
  13973. HELP_DESKTOP_FLOORPLAN_2B: 'Или используйте клавиши со стрелками для поворота влево или вправо.',
  13974. HELP_DESKTOP_FLOORPLAN_3B: 'Или используйте стрелки для увеличения и уменьшения.',
  13975. HELP_MOBILE_PANORAMA_1: 'Нажмите и перетащите, чтобы осмотреть модель.',
  13976. HELP_MOBILE_PANORAMA_2: 'Для передвижения по модели нажимайте на круги.',
  13977. HELP_MOBILE_3: 'Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.',
  13978. HELP_MOBILE_360_2: 'Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.',
  13979. HELP_MOBILE_DOLLHOUSE_1: 'Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.',
  13980. HELP_MOBILE_DOLLHOUSE_2: 'Нажмите и перетащите, чтобы расположить Dollhouse.',
  13981. HELP_MOBILE_FLOORPLAN_1: 'Нажмите и перетащите, чтобы расположить план здания.',
  13982. HELP_MOBILE_FLOORPLAN_2: 'Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.',
  13983. HELP_MORE_HLR_A: 'Фотоколлаж',
  13984. HELP_DESKTOP_MORE_HLR_B: 'Откройте для перемещения по модели, используя иконки изображений.',
  13985. HELP_MORE_DOLLHOUSE_A: 'Dollhouse',
  13986. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.',
  13987. HELP_MOBILE_MORE_DOLLHOUSE_B: 'Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.',
  13988. HELP_MORE_FLOORS_A: 'Выбор Этажа',
  13989. HELP_DESKTOP_MORE_FLOORS_B: 'Переключение между этажами.',
  13990. HELP_MORE_TAG_A: 'tag™ Posts',
  13991. HELP_DESKTOP_MORE_TAG_B: 'Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.',
  13992. HELP_MOBILE_MORE_TAG_B: 'Нажмите для получения информации о функциях.',
  13993. HELP_MORE_ZOOM_A: 'Масштаб',
  13994. HELP_DESKTOP_MORE_ZOOM_B: 'Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.',
  13995. HELP_MORE_TOUR_A: 'Управление Туром',
  13996. HELP_DESKTOP_MORE_TOUR_B: 'Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.',
  13997. HELP_MORE_INSIDE_A: 'Вид Изнутри',
  13998. HELP_DESKTOP_MORE_INSIDE_B: 'Нажмите, чтобы просмотреть модель изнутри.',
  13999. HELP_MOBILE_MORE_INSIDE_B: 'Нажмите, чтобы просмотреть модель изнутри.',
  14000. HELP_MORE_VR_A: 'Режим VR',
  14001. HELP_DESKTOP_MORE_VR_B: 'Нажмите, чтобы запустить модель в виртуальной реальности.',
  14002. HELP_MOBILE_MORE_VR_B: 'Нажмите, чтобы запустить модель в виртуальной реальности.',
  14003. HELP_MORE_360_A: '360° Views',
  14004. HELP_DESKTOP_MORE_360_B: 'Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.',
  14005. HELP_MOBILE_MORE_360_B: 'Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.',
  14006. HELP_MORE_FULLSCREEN_A: 'Полный экран',
  14007. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Развернуть 3D Showcase во весь экран.',
  14008. WEBVR_FOR_CARDBOARD: 'Для Google Cardboard',
  14009. WEBVR_FOR_DAYDREAM: 'Для просмотра в Daydream',
  14010. WEBVR_ENTER_WEBVR: 'ВОЙТИ В VR ',
  14011. WEBVR_DIFFERENT_HEADSET: 'Есть другой VR-шлем?',
  14012. WEBVR_LEARN_MORE: 'Узнать больше',
  14013. WEBVR_VIEW_SPACE: 'Запустить модель в VR',
  14014. WEBVR_DAYDREAM_VIEW: 'Посмотреть в Daydream',
  14015. WEBVR_DAYDREAM_PHONE: 'Daydream-готовый телефон',
  14016. WEBVR_VIEW_CARDBOARD: 'Или просмотреть в Google Cardboard',
  14017. VR_WHAT_YOU_NEED: 'Что Вам потребуется...',
  14018. VR_NEED_DAYDREAM_PHONE: 'Daydream-готовый телефон',
  14019. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  14020. VR_APP: 'port VR App',
  14021. VR_APP_OPEN: 'Или открыть через приложение port VR',
  14022. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  14023. VR_SAMSUNG_DETAIL: 'Galaxy S6 и выше',
  14024. VR_APP_FOR_ANDROID: 'Приложение port VR для Android',
  14025. VR_NEED_DAYDREAM: 'Необходимо для соединением с Daydream',
  14026. VR_VIEW_SPACE: 'Запустить модель в VR',
  14027. VR_LEARN_MORE_CAPS: 'УЗНАТЬ БОЛЬШЕ',
  14028. VR_PREVIOUS_CAPS: 'ПРЕДЫДУЩИЙ',
  14029. VR_NEXT_CAPS: 'СЛЕДУЮЩИЙ',
  14030. VR_GOT_IT_CAPS: 'ЯСНО',
  14031. VR_SHOW_SUPPORTED: 'Нажмите, чтобы просмотреть модель в VR с помощью',
  14032. VR_SHOW_UNSUPPORTED: 'Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.',
  14033. VR_SHOW_IOS_1: 'Нажмите, чтобы просмотреть модель в VR',
  14034. VR_SHOW_IOS_2: 'Для просмотра требуется приложение port VR и совместимый iPhone',
  14035. VR_NEED_CARDBOARD: 'Что Вам потребуется для Google Cardboard',
  14036. VR_NEED_SAMSUNG: 'Что Вам потребуется для Samsung Gear VR',
  14037. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  14038. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  14039. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  14040. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s или новее с iOS 9.1 и выше',
  14041. VR_COMPATIBLE_IPHONES_3: 'Совместимые модели iPhone',
  14042. VR_COMPATIBLE_ANDROID: 'Совместимые Android устройства',
  14043. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  14044. VR_ANDROID_DVICES: 'Android устройства',
  14045. VR_COMPATIBLE_SAMSUNG: 'Совместимые Samsung устройства',
  14046. VR_APP_FOR_CARDBOARD: 'Приложение port VR для Google Cardboard',
  14047. VR_APP_FOR_SAMSUNG: 'Приложение port VR для Gear VR',
  14048. VR_DOWNLOAD_HERE: 'Скачать здесь',
  14049. VR_REQUIRE_HEADSET: 'Требуется VR-шлем и установленное приложение port VR для Android',
  14050. VR_REDIRECT_TO_STORE: 'Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.',
  14051. VR_IMPROPER_EMBED: 'port модель не встроена должным образом для поддержки VR в вашем веб-браузере.',
  14052. VR_OPEN_ANDROID_LINK: 'Откройте ссылку на Вашем мобильном телефоне',
  14053. VR_ANDROID_OPTIONS: 'Доступные опции VR-шлемов',
  14054. SHARE_TO: 'Поделиться',
  14055. SHARE_LINK: 'Прямая ссылка',
  14056. SHARE_EXPLORE: 'просмотреть',
  14057. SHARE_AT: 'на',
  14058. SHARE_WITH: 'с',
  14059. SHARE_3D: 'в 3D',
  14060. SHARE_COPIED: 'Скопировано!',
  14061. ERROR_BROWSER_SOLUTION: 'установите новый браузер, чтобы просмотреть 3D пространство.',
  14062. ERROR_BROWSER_EXPLANATION: 'WebGL требует современный браузер.',
  14063. ERROR_GENERIC_PROBLEM: 'Ой, что-то пошло не так.',
  14064. ERROR_GENERIC_SOLUTION: 'Перезапустите браузер.',
  14065. ERROR_GENERIC_ACTIONS_1: 'Если проблема не устранена, ',
  14066. ERROR_GENERIC_ACTIONS_2: 'установите поддерживаемый браузер',
  14067. ERROR_GENERIC_ACTIONS_3: ' или ',
  14068. ERROR_GENERIC_ACTIONS_4: 'смотрите наше руководство по устранению неполадок',
  14069. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Браузер не поддерживается.',
  14070. ERROR_WEBGL_IOS_PROBLEM: 'iOS-версия не поддерживается.',
  14071. ERROR_WEBGL_IOS_SOLUTION: 'Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.',
  14072. ERROR_WEBGL_IOS_ACTIONS_1: 'Нажмите ',
  14073. ERROR_WEBGL_IOS_ACTIONS_2: 'Настройки > Общие > Обновление ПО',
  14074. ERROR_WEBGL_SAFARI_PROBLEM: 'Включите WebGL для 3D-просмотра.',
  14075. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Нажмите ',
  14076. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Настойки > Дополнения > Показывать меню “Разработка” в строке меню',
  14077. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Затем нажмите ',
  14078. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Разработка > Разрешить WebGL',
  14079. ERROR_MISSING_URLS_PROBLEM: 'Ой, для этой модели нет панорамы.',
  14080. ERROR_MISSING_URLS_EXPLANATION: 'Эта модель устарела. У владельца веб-сайта может быть новая модель.',
  14081. ERROR_LOADING_FAILED_PROBLEM: 'Ой, модель недоступна.',
  14082. ERROR_LOADING_FAILED_ACTIONS_1: 'Если проблема не устранена, ',
  14083. ERROR_LOADING_FAILED_ACTIONS_2: 'посмотрите наше руководство по устранению неполадок',
  14084. ERROR_MAINTENANCE_PROBLEM: 'Выполняется техническое обслуживание.',
  14085. ERROR_MAINTENANCE_SOLUTION: 'Пожалуйста, попробуйте снова через несколько минут.',
  14086. LINK_TO_LOCATION: 'Ссылка на местоположение',
  14087. MENU_COPY: 'Копировать',
  14088. LINK_ALERT_COPY: 'Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.',
  14089. ROTATE: 'Вращать',
  14090. MOVE: 'Передвигаться',
  14091. INSIDE: 'Вид изнутри',
  14092. ZOOM: 'Масштаб'
  14093. }
  14094. },
  14095. {}
  14096. ],
  14097. 116: [
  14098. function (r, e, t) {
  14099. ;(function (i) {
  14100. 'use strict'
  14101. function re(e) {
  14102. console.log('e1:' + e), (e = Math.round(0.4 * e * 100)), console.log('e2:' + e)
  14103. var t = $('.progressbar')
  14104. t.find('.bar').css('width', e + '%'), t.find('.label').css('left', (t.width() * e) / 100 - 15 + 'px'), t.find('.perc').text(e + '%')
  14105. }
  14106. $('#gui-loading').fadeIn(200), re(0.1)
  14107. var e = g_version ? 'modeldata.js' : 'someData.json'
  14108. $.ajax(g_Prefix + 'data1/' + window.number + '/' + e + '?' + randomTime().getTime(), {
  14109. dataType: 'json'
  14110. })
  14111. .done(function (e) {
  14112. var t = matcher(e)
  14113. ;(t.files.templates[0] = g_Prefix + e.files.templates[0].replace('{{number}}', window.number)),
  14114. (t.user = {
  14115. is_authenticated: !1,
  14116. flags: [
  14117. 'payment_show_past_due',
  14118. 'sc_imgopt_100',
  14119. 'mattertags',
  14120. 'labels',
  14121. 'fastly_v2_urls',
  14122. 'vr',
  14123. 'uhql',
  14124. 'sc_segment_100',
  14125. 'show_segment_metrics',
  14126. 'content_distribution',
  14127. 'workshop_webgl',
  14128. 'show360views',
  14129. 'showcase_vr',
  14130. 'ws_zooming',
  14131. 'model_settings',
  14132. 'ws_360snapshots',
  14133. 'img_multi_dl',
  14134. 'vrworkshop',
  14135. 'tag_links',
  14136. 'ws_img_multi_dl',
  14137. 'mattertag_links',
  14138. 'billing_tab_hidden',
  14139. 'static_cloud_ui',
  14140. 'metrics',
  14141. 'mattertag_media',
  14142. 'img_size_download',
  14143. 'show_360snapshots',
  14144. 'floorplan',
  14145. 'sc_tilegen_0',
  14146. 'showcase_webvr',
  14147. 'sc_mixpanel_0',
  14148. 'show_clickbait',
  14149. 'zooming',
  14150. 'showcase_tiling',
  14151. 'list_signed_urls_default_3',
  14152. 'fastly_image_opto'
  14153. ]
  14154. })
  14155. try {
  14156. //处理一下导览数据
  14157. t.model.images = t.model.images.filter(e => {
  14158. if (!e.locations && !e.thumbnail_signed_src) return //旧的曾有导览数据是错误的,将它删除
  14159. if (e.locations) e.locations = e.locations.filter(e => e)
  14160. if (e.locations && e.locations.length == 0) return
  14161. return e
  14162. })
  14163. } catch (e) {
  14164. console.log(e)
  14165. }
  14166. window.editTool = new EditTools()
  14167. t.hotIconScale = parseFloat(t.hotIconScale || 1)
  14168. window.DATA = t
  14169. t.model.summary = t.summary
  14170. t.model.name = t.name
  14171. for (let i in t) {
  14172. t[i] == 'false' && (t[i] = false)
  14173. }
  14174. re(0.7),
  14175. (function () {
  14176. function y(e) {
  14177. t.update(e)
  14178. }
  14179. function A(e, t) {
  14180. ne.error(t), n.error(t), N.report(e, 'error-' + t)
  14181. }
  14182. function C(e, t, i) {
  14183. try {
  14184. e.start(t)
  14185. } catch (e) {
  14186. throw (
  14187. (ne.warn(e.message),
  14188. (function (e) {
  14189. var t = O.details()
  14190. t && 'Safari' === t.name && 500 < t.version && t.version < 600
  14191. ? (n.error('webgl-safari'), N.report(e, 'error-webgl-safari'))
  14192. : (n.error('webgl-generic'), N.report(e, 'error-webgl-generic'))
  14193. })(i.sid),
  14194. e)
  14195. )
  14196. }
  14197. }
  14198. function I(e) {
  14199. e.stopPropagation(), e.preventDefault()
  14200. }
  14201. window.DATA.hoticon &&
  14202. (g_HotImage = {
  14203. point: window.DATA.hoticon.default || 'https://super.4dage.com/images/4dagePoint2.png',
  14204. point2: window.DATA.hoticon.higt || 'https://super.4dage.com/images/4dagePoint.png'
  14205. })
  14206. if (window.DATA.backgroundMusic) {
  14207. if (window.isLocal) {
  14208. SoundManager.setSrc('bgm', manage.dealURL(window.DATA.backgroundMusic))
  14209. } else {
  14210. SoundManager.setSrc('bgm', window.DATA.backgroundMusic)
  14211. }
  14212. $('#volume').show()
  14213. } else if (g_version === 'one') {
  14214. SoundManager.setSrc('bgm', manage.dealURL(g_Prefix + '/audio/' + 'audio' + window.number + '/background.mp3'))
  14215. $('#volume').show()
  14216. }
  14217. //隐藏公司logo
  14218. window.DATA.loadlogo && showLogo()
  14219. r('./lib/three75-shim'),
  14220. r('./lib/array-polyfill'),
  14221. r('./lib/performance-polyfill'),
  14222. r('./lib/shaders/CopyShader.js'),
  14223. r('./lib/shaders/HorizontalBlurShader.js'),
  14224. r('./lib/shaders/VerticalBlurShader.js'),
  14225. r('./lib/postprocessing/EffectComposer.js'),
  14226. r('./lib/postprocessing/RenderPass.js'),
  14227. r('./lib/postprocessing/MaskPass.js'),
  14228. r('./lib/postprocessing/ShaderPass.js'),
  14229. window.Promise || (window.Promise = r('promise-polyfill'))
  14230. var E = r('three'),
  14231. _ = r('three'),
  14232. b = (r('./util/sentry'), r('./player')),
  14233. w = r('./director'),
  14234. T = r('./controls/CameraControls'),
  14235. x = r('./model/ModelManager'),
  14236. S = r('./DisplayController'),
  14237. M = r('./label/LabelDisplayController'),
  14238. R = r('./enum/Viewmode'),
  14239. e = r('./util/logger'),
  14240. P = r('./showcase'),
  14241. O = r('./util/browser'),
  14242. L = r('./settings'),
  14243. D = r('./gui/gui'),
  14244. n = r('./gui/error'),
  14245. N = r('./analytics'),
  14246. F = r('./util/transitions'),
  14247. B = r('./effects'),
  14248. V = r('./objects/Skybox'),
  14249. k = (r('./util/common'), r('./util/PanoramaCollection'), r('./util/math'), r('./util/showcase')),
  14250. U = r('./util/camera'),
  14251. H = (r('./objects/Panorama'), r('./cameras/PanoramaCamera'), r('./preloaders')),
  14252. z = r('events').EventEmitter,
  14253. G = r('./featureflags'),
  14254. W = (r('./util/lerp'), r('./util/ajax'), r('./ab')),
  14255. j = r('./sdk/automation.js'),
  14256. Y = r('./scene/SceneRenderer'),
  14257. q = r('./scene/QuickstartManager'),
  14258. X = r('./tile/QualityManager.js'),
  14259. Z = r('./localization/localize'),
  14260. K = r('./tag/tagManager'),
  14261. Q = r('./tile/TileDownloader'),
  14262. J = r('./tile/PanoRenderer'),
  14263. ee = (r('./enum/PanoSizeClass'), r('./enum/PanoramaEvents'), r('./enum/SceneRendererEvents')),
  14264. t = r('./gui/memoryUsage'),
  14265. te = r('./enum/RenderLayers'),
  14266. ie = r('./TimingData'),
  14267. ne = new e(i)
  14268. ;(e.level = L.logLevel),
  14269. (e.consoleEnabled = L.console),
  14270. (function () {
  14271. var e = window.number //k.getModelIDFromQueryString();
  14272. if (!e) return A(null, 'loading-failed')
  14273. var t = k.parseSidUrl(e),
  14274. i = O.valueFromHash('play', !1) ? 'autoplay' : O.inIframe() ? 'click' : 'fullpage',
  14275. n = {
  14276. panoElementsToLoad: 6,
  14277. modelElementsToLoad: 0,
  14278. totalElementsLoaded: 0,
  14279. totalElementsToLoad: 0,
  14280. totalPercentageLoaded: 0,
  14281. progressCallback: null
  14282. },
  14283. r = document.getElementById('player'),
  14284. o = L.quickstart.enabled,
  14285. a = null,
  14286. s = null,
  14287. l = null,
  14288. c = null,
  14289. h = null,
  14290. u = null,
  14291. d = null,
  14292. p = null,
  14293. f = null,
  14294. g = null,
  14295. m = null,
  14296. v = new ie()
  14297. !(function (e) {
  14298. ne.info('Version', '2.25.6-0-gd87e5b1'),
  14299. (z.defaultMaxListeners = 1e3),
  14300. (function (e) {
  14301. e.addEventListener('dragenter', I, !1), e.addEventListener('dragover', I, !1)
  14302. })(e),
  14303. O.valueFromHash('title', !0) ||
  14304. $(document).ready(function () {
  14305. $('.model-title').hide()
  14306. })
  14307. })(r),
  14308. (function (e) {
  14309. return G.loadFeatureFlags(e).done(function (e) {
  14310. G.updateDependentSettings(e, L)
  14311. })
  14312. })({
  14313. urlBase: t.urlBase
  14314. })
  14315. .then(function () {
  14316. return (
  14317. Z.init(),
  14318. (function (e, t) {
  14319. var i = P.getModel({
  14320. url: t,
  14321. floors: O.valueFromHash('f', !0),
  14322. autoload: !1
  14323. })
  14324. return $.when(i, y).then(null, function (e) {
  14325. return this
  14326. })
  14327. })(0, e)
  14328. )
  14329. })
  14330. .then(function (e) {
  14331. return (
  14332. re(0.9),
  14333. (function (e, t, i, n, r) {
  14334. ne.info('Model data loaded'),
  14335. ne.debug('UUID: ' + e.data.job.uuid),
  14336. W.init(G.getFlags()),
  14337. i &&
  14338. N.initKeen({
  14339. token: i,
  14340. appId: n
  14341. }),
  14342. N.initSegment({
  14343. model: e.sid,
  14344. version: '2.25.6-0-gd87e5b1',
  14345. startSource: r.startSource,
  14346. token: t,
  14347. autoplay: r.autoplay,
  14348. quickstart: r.quickstart
  14349. })
  14350. })((g = e), L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  14351. startSource: i,
  14352. autoplay: L.autoplay,
  14353. quickstart: o
  14354. }),
  14355. g.urls.init()
  14356. )
  14357. })
  14358. .then(function () {
  14359. return g.loadPanos()
  14360. })
  14361. .then(function () {
  14362. s = U.getStartCameraOptions(g, g.panos)
  14363. //初始画面
  14364. window.DATA.camera_start &&
  14365. window.DATA.camera_start.thumbImg &&
  14366. (function (e) {
  14367. $('<img/>')
  14368. .attr('src', e)
  14369. .on('load', function () {
  14370. $('#gui-thumb')
  14371. .css('backgroundImage', 'url(' + e + ')')
  14372. .fadeIn(500),
  14373. $(this).remove()
  14374. $('.screen .shotImg.innerBtn')
  14375. .removeClass('blank')
  14376. .css('background-image', 'url(' + e + ')')
  14377. })
  14378. })(window.DATA.camera_start.thumbImg)
  14379. {
  14380. //初始化导览时间
  14381. if (DATA.tourBlackSpeed == void 0) DATA.tourBlackSpeed = 100
  14382. window._settings.warp.teleportTime = (settings.teleportTime / DATA.tourBlackSpeed) * 100
  14383. if (DATA.tourWalkSpeed == void 0) DATA.tourWalkSpeed = 100
  14384. /* if(DATA.tourWalkSpeed!=void 0){
  14385. let r = 100 / DATA.tourWalkSpeed;
  14386. window._settings.warp.flytimeDistanceMultiplier = settings.flytimeDistanceMultiplier * r
  14387. window._settings.warp.flyTime = settings.flyTime * r
  14388. }else{
  14389. window._settings.warp.flyTime = settings.flyTime
  14390. } */
  14391. if (DATA.tourRotTime == '' || DATA.tourRotTime == void 0) {
  14392. DATA.tourRotTime = settings.tourRotTime //默认停留2秒
  14393. }
  14394. }
  14395. {
  14396. //其他
  14397. _settings.floorPlanAngle = DATA.floorPlanAngle || 0
  14398. }
  14399. ;(d = (function (e) {
  14400. var t = new E.PerspectiveCamera()
  14401. t.layers.enable(te.PANOMARKERS), t.layers.enable(te.RETICULE), t.layers.enable(te.TAG)
  14402. var o = new E.Scene(),
  14403. i = new E.AmbientLight(16777215)
  14404. return (
  14405. o.add(i),
  14406. (o.skybox = new V()),
  14407. o.add(o.skybox),
  14408. (o.plane = new E.Mesh(
  14409. new E.PlaneBufferGeometry(1e5, 1e5),
  14410. new E.RawShaderMaterial({
  14411. side: E.DoubleSide
  14412. })
  14413. )),
  14414. (o.plane.position.y = 0),
  14415. o.plane.rotateX(-Math.PI / 2),
  14416. (o.plane.material.visible = !1),
  14417. o.add(o.plane),
  14418. o.updateMatrixWorld(),
  14419. L.showScreenshotLocations &&
  14420. e.data.images.forEach(function (e) {
  14421. if (e.metadata && e.metadata.camera_position) {
  14422. var t = e.metadata.camera_position,
  14423. i = new E.Mesh(new E.BoxGeometry(0.3, 0.3, 0.3))
  14424. ;(i.position = t.clone()), o.add(i)
  14425. var n = e.metadata.camera_quaternion,
  14426. r = new E.Vector3(0, 0, -1).applyQuaternion(n)
  14427. o.add(new E.ArrowHelper(r, t.clone(), 1, 16711680))
  14428. }
  14429. }),
  14430. L.showAxis &&
  14431. (o.add(new E.ArrowHelper(new E.Vector3(0, 1, 0), new E.Vector3(0, 0, 0), 1, 255)),
  14432. o.add(new E.ArrowHelper(new E.Vector3(0, 0, 1), new E.Vector3(0, 0, 0), 1, 16711680)),
  14433. o.add(new E.ArrowHelper(new E.Vector3(1, 0, 0), new E.Vector3(0, 0, 0), 1, 65280))),
  14434. new Y(o, t, B)
  14435. )
  14436. })(g)),
  14437. (m = (function (e, t) {
  14438. var i = e ? 1 : 1e3,
  14439. n = W.tilegen || W.imgopt ? 6 : 2
  14440. n = O.valueFromHash('tileconc', n)
  14441. var r = new X(),
  14442. o = new Q({
  14443. concurrentDownloads: n
  14444. }),
  14445. a = new J(),
  14446. s = new x(),
  14447. l = new w(),
  14448. c = new b(t),
  14449. h = new T(),
  14450. u = new S(i),
  14451. d = new M(),
  14452. p = new K()
  14453. return {
  14454. qualityManager: r,
  14455. panoRenderer: a,
  14456. tileDownloader: o,
  14457. player: c,
  14458. director: l,
  14459. modelManager: s,
  14460. tagManager: p,
  14461. displayController: u,
  14462. labelDisplayController: d,
  14463. controls: h
  14464. }
  14465. })(o, s.mode)),
  14466. (l = m.controls),
  14467. (c = m.player),
  14468. (h = m.director),
  14469. (u = m.tagManager),
  14470. (p = m.tileDownloader),
  14471. (f = m.qualityManager),
  14472. m.panoRenderer,
  14473. (function (e, t, i, n) {
  14474. var r = i.controls,
  14475. o = i.qualityManager,
  14476. a = i.panoRenderer,
  14477. s = i.tileDownloader,
  14478. l = i.modelManager
  14479. r.init(n, l), j.init(i.director, r, i.player, l, t), o.init(l), s.init(o), a.init(t, s, o), l.init(s, a, o), l.addModel(e), t.addComponent(F)
  14480. })(g, d, m, r),
  14481. (c.director = h),
  14482. g.supportsTiles && p.start(),
  14483. !o || (s.mode === R.PANORAMA && s.pano) || (ne.warn('Tried to quickstart, but failed as we are not starting in inside mode.'), (o = !1))
  14484. var e = null
  14485. if (o) {
  14486. ne.warn('Quickstart engaged. Hold on to your knickers.')
  14487. var t = l.controls[R.PANORAMA]
  14488. ;(a = new q(f, d.scene, d.camera, t, r)),
  14489. C(d, r, g),
  14490. (e = a.load(s).then(function () {
  14491. d.addComponent(a),
  14492. d.once(ee.AfterRender, function () {
  14493. ne.warn('First render after quickstart load finished.')
  14494. })
  14495. }))
  14496. }
  14497. return (
  14498. (window.flyToFirst = function () {
  14499. var e = c.model.panos.get('8d778e19657f433fb9cf8947d823bb70'),
  14500. t = new _.Quaternion(0.7099827027821568, -0.07708150183830938, 0.6958985789714591, 0.07555241737970636),
  14501. i = new _.Vector3(0, 0, -1).applyQuaternion(t).add(e.position)
  14502. c.flyToPano({
  14503. pano: e,
  14504. lookAtPoint: i
  14505. })
  14506. }),
  14507. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14508. )
  14509. })
  14510. .then(function () {
  14511. return (function (e, t, i, n, r) {
  14512. return (
  14513. (r.progressCallback = t),
  14514. N.sessionStart(),
  14515. e.load(n).progress(
  14516. function (e, t) {
  14517. ;(e.modelElementsToLoad = t[1]),
  14518. (function (e) {
  14519. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14520. })(e),
  14521. (function (e) {
  14522. e.totalElementsLoaded++,
  14523. (e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad),
  14524. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14525. (e.totalPercentageLoaded = 0.4 + 0.6 * e.totalPercentageLoaded),
  14526. console.log('pro:' + e.totalPercentageLoaded),
  14527. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14528. })(e)
  14529. }.bind(this, r)
  14530. )
  14531. )
  14532. })(g, D.onProgress, 0, !o, n)
  14533. })
  14534. .then(function () {
  14535. ;(s.quickstart = o),
  14536. (function (e, t, i, n) {
  14537. var r = i.qualityManager,
  14538. o = i.panoRenderer,
  14539. a = i.tileDownloader,
  14540. s = i.modelManager,
  14541. l = i.player,
  14542. c = i.director,
  14543. h = i.tagManager,
  14544. u = i.displayController,
  14545. d = i.labelDisplayController,
  14546. p = i.controls
  14547. t.scene.add(e), (t.qualityManager = r)
  14548. var f = {
  14549. camera: t.camera,
  14550. director: c,
  14551. modelManager: s,
  14552. tileDownloader: a,
  14553. panoRenderer: o,
  14554. qualityManager: r,
  14555. tagManager: h,
  14556. container: n,
  14557. controls: p
  14558. }
  14559. l.init(f),
  14560. l.setScene(t.scene),
  14561. h.init(s, l),
  14562. c.init(l, s),
  14563. u.init(c, l, s, h, n),
  14564. d.init(l, s, n),
  14565. B.bindEvents(l),
  14566. t.addComponent(h),
  14567. t.addComponent(l),
  14568. t.addComponent(o),
  14569. (l.sceneRenderer = t)
  14570. })(g, d, m, r),
  14571. d.started || C(d, r, g),
  14572. N.modelLoaded(g, c, l, L.autoplay),
  14573. (function (e, t, i, n) {
  14574. return ne.info('Starting player in ' + i.mode), N.report(t.sid, 'started-playing', n, i.quickstart), e.start(i)
  14575. })(c, g, s, L.autoplay).done(function () {
  14576. h.autoTour()
  14577. }),
  14578. g.supportsTiles || new H(g, c).start()
  14579. o && (d.removeComponent(a), a.destroy(), s.pano.enter()),
  14580. D.init(g, h, c, l, d, s, N.getSessionId()),
  14581. D.endLoading(g, h, u),
  14582. d.once(ee.AfterRender, function () {
  14583. v.setAppReadyTime()
  14584. var e = v.calcFullLoadingTime()
  14585. ne.warn('Total load time: ' + e / 1e3), N.loadComplete(e), ne.warn('First render after model load finished.')
  14586. editTool.loadDone('data', window.DATA)
  14587. }),
  14588. d.on(ee.MemoryUsageUpdated, y)
  14589. })
  14590. .fail(A.bind(this, e))
  14591. })()
  14592. })()
  14593. })
  14594. .fail(e => {
  14595. alert('缺少someData文件,请检查场景码是否正确。')
  14596. })
  14597. }).call(this, '/js/main.js')
  14598. },
  14599. {
  14600. './DisplayController': 1,
  14601. './TimingData': 2,
  14602. './ab': 3,
  14603. './analytics': 4,
  14604. './cameras/PanoramaCamera': 7,
  14605. './controls/CameraControls': 9,
  14606. './director': 15,
  14607. './effects': 16,
  14608. './enum/PanoSizeClass': 36,
  14609. './enum/PanoramaEvents': 37,
  14610. './enum/RenderLayers': 41,
  14611. './enum/SceneRendererEvents': 43,
  14612. './enum/Viewmode': 51,
  14613. './featureflags': 59,
  14614. './gui/error': 64,
  14615. './gui/gui': 65,
  14616. './gui/memoryUsage': 73,
  14617. './label/LabelDisplayController': 91,
  14618. './lib/array-polyfill': 92,
  14619. './lib/performance-polyfill': 95,
  14620. './lib/postprocessing/EffectComposer.js': 96,
  14621. './lib/postprocessing/MaskPass.js': 97,
  14622. './lib/postprocessing/RenderPass.js': 98,
  14623. './lib/postprocessing/ShaderPass.js': 99,
  14624. './lib/shaders/CopyShader.js': 100,
  14625. './lib/shaders/HorizontalBlurShader.js': 101,
  14626. './lib/shaders/VerticalBlurShader.js': 102,
  14627. './lib/three75-shim': 103,
  14628. './localization/localize': 108,
  14629. './tag/tagManager': 124,
  14630. './model/ModelManager': 140,
  14631. './objects/Panorama': 148,
  14632. './objects/Skybox': 152,
  14633. './player': 155,
  14634. './preloaders': 156,
  14635. './scene/QuickstartManager': 157,
  14636. './scene/SceneRenderer': 158,
  14637. './sdk/automation.js': 164,
  14638. './settings': 166,
  14639. './showcase': 168,
  14640. './tile/PanoRenderer': 169,
  14641. './tile/QualityManager.js': 170,
  14642. './tile/TileDownloader': 171,
  14643. './util/PanoramaCollection': 178,
  14644. './util/ajax': 181,
  14645. './util/browser': 182,
  14646. './util/camera': 183,
  14647. './util/common': 185,
  14648. './util/lerp': 188,
  14649. './util/logger': 189,
  14650. './util/math': 190,
  14651. './util/sentry': 192,
  14652. './util/showcase': 193,
  14653. './util/transitions': 195,
  14654. events: 202,
  14655. 'promise-polyfill': 213,
  14656. three: 217
  14657. }
  14658. ],
  14659. 117: [
  14660. function (e, t, i) {
  14661. 'use strict'
  14662. function n(e) {
  14663. ;(e = e || {}),
  14664. r.RawShaderMaterial.call(
  14665. this,
  14666. a.extendObject(
  14667. {
  14668. fragmentShader: o.cube.fragmentShader,
  14669. vertexShader: o.cube.vertexShader,
  14670. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14671. name: 'CubemapMaterial'
  14672. },
  14673. e
  14674. )
  14675. )
  14676. }
  14677. var r = e('three'),
  14678. o = e('../shaders'),
  14679. a = e('../util/common')
  14680. ;((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n), (t.exports = n)
  14681. },
  14682. {
  14683. '../shaders': 167,
  14684. '../util/common': 185,
  14685. three: 217
  14686. }
  14687. ],
  14688. 118: [
  14689. function (e, t, i) {
  14690. 'use strict'
  14691. function n(e) {
  14692. ;(e = e || {}),
  14693. r.RawShaderMaterial.call(
  14694. this,
  14695. a.extendObject(
  14696. {
  14697. fragmentShader: o.model.fragmentShader,
  14698. vertexShader: o.model.vertexShader,
  14699. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14700. name: 'ModelTextureMaterial'
  14701. },
  14702. e
  14703. )
  14704. )
  14705. }
  14706. var r = e('three'),
  14707. o = e('../shaders'),
  14708. a = e('../util/common')
  14709. ;(((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function (e, t, i) {
  14710. i && (this.uniforms.progress.value = 0),
  14711. e.ensureSkyboxReadyForRender(),
  14712. (this.uniforms.pano0Map.value = e.getSkyboxTexture()),
  14713. this.uniforms.pano0Position.value.copy(e.position),
  14714. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14715. t.ensureSkyboxReadyForRender(),
  14716. (this.uniforms.pano1Map.value = t.getSkyboxTexture()),
  14717. this.uniforms.pano1Position.value.copy(t.position),
  14718. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14719. }),
  14720. (t.exports = n)
  14721. },
  14722. {
  14723. '../shaders': 167,
  14724. '../util/common': 185,
  14725. three: 217
  14726. }
  14727. ],
  14728. 119: [
  14729. function (m, v, e) {
  14730. ;(function (e) {
  14731. 'use strict'
  14732. function t(e, t, i, n) {
  14733. ;(this.div = null),
  14734. (this.body = null),
  14735. (this.label = e),
  14736. (this.description = t),
  14737. (this.parsedDescription = []),
  14738. (this.media = i || {
  14739. type: null
  14740. }),
  14741. (this.loadingSpinner = null),
  14742. (this.parser = new r({
  14743. supportLinks: !c.valueFromHash('mls'),
  14744. keepLinkLabels: !0
  14745. })),
  14746. (this.state = g.CLOSED),
  14747. (this.orientation = ''),
  14748. (this.initialTransform = ''),
  14749. (this.hovering = !1),
  14750. (this.openTransition = null),
  14751. (this.closeTransition = null),
  14752. (this.openPromise = null),
  14753. (this.closePromise = null),
  14754. (this.animationTransition = null),
  14755. (this.animationScale = 0)
  14756. }
  14757. var r = m('../Parser/DescriptionParser'),
  14758. i = m('../Media/Link'),
  14759. n = m('../Media/Image'),
  14760. o = m('../Media/EmbedlyPlayer'),
  14761. a = m('../Media/EmbedlyEmbed'),
  14762. s = m('../../util/transitions'),
  14763. l = m('../../util/lerp'),
  14764. c = m('../../util/browser'),
  14765. b = m('./BillboardEvent'),
  14766. w = m('../Media/MediaEvent'),
  14767. h = m('../Parser/DescriptionChunkType'),
  14768. u = m('events').EventEmitter,
  14769. d = m('./billboardSettings'),
  14770. T = m('./overlaySettings'),
  14771. p = new (m('../../util/logger'))(e),
  14772. f = document.getElementById('tag-billboards')
  14773. f.addEventListener('touchend', function (e) {
  14774. f.style.pointerEvents = 'none'
  14775. }),
  14776. f.addEventListener('touchcancel', function (e) {
  14777. f.style.pointerEvents = 'none'
  14778. })
  14779. var g = {
  14780. CLOSED: 'closed',
  14781. OPENING: 'opening',
  14782. OPEN: 'open',
  14783. CLOSING: 'closing',
  14784. ACTIVE: 'active'
  14785. }
  14786. ;((t.prototype = Object.create(u.prototype)).build = function (e) {
  14787. this.parsedDescription = this.parser.parse(this.description)
  14788. var t = document.createElement('div')
  14789. ;(t.className = 'tag-container has-hotzone'), (this.div = t), (this.body = document.createElement('div')), (this.body.className = 'tag-body')
  14790. var i = document.createElement('div')
  14791. i.classList.add('tag-content')
  14792. var n = document.createElement('div')
  14793. n.classList.add('tag-text-content')
  14794. var r = document.createElement('div')
  14795. ;(r.className = 'tag-label'), (r.textContent = this.label), n.appendChild(r)
  14796. var o = document.createElement('div')
  14797. ;(o.className = 'tag-desc'),
  14798. n.appendChild(o),
  14799. i.appendChild(n),
  14800. this.body.appendChild(i),
  14801. this.appendDescriptionElements(this.parsedDescription, o),
  14802. this.appendMedia(),
  14803. t.appendChild(this.body),
  14804. f.appendChild(t),
  14805. this.bindEvents(t, this.body)
  14806. }),
  14807. (t.prototype.bindEvents = function (i, e) {
  14808. function t(n) {
  14809. return function (e) {
  14810. if (!this.div.classList.contains('overlay')) {
  14811. var t,
  14812. i = document.getElementById('player')
  14813. try {
  14814. t = new MouseEvent(n, e)
  14815. } catch (i) {
  14816. ;(t = document.createEvent('MouseEvents')).initMouseEvent(
  14817. n,
  14818. e.bubbles,
  14819. e.cancelable,
  14820. e.view,
  14821. e.detail,
  14822. e.screenX,
  14823. e.screenY,
  14824. e.clientX,
  14825. e.clientY,
  14826. e.ctrlKey,
  14827. e.altKey,
  14828. e.shiftKey,
  14829. e.metaKey,
  14830. e.button,
  14831. e.relatedTarget
  14832. )
  14833. }
  14834. i.dispatchEvent(t)
  14835. }
  14836. }
  14837. }
  14838. e.addEventListener('mousedown', function (e) {
  14839. e.stopPropagation()
  14840. }),
  14841. e.addEventListener('mouseup', function (e) {
  14842. e.stopPropagation()
  14843. }),
  14844. i.addEventListener('touchstart', function (e) {
  14845. f.style.pointerEvents = 'auto'
  14846. }),
  14847. i.addEventListener('mousedown', t('mousedown').bind(this)),
  14848. i.addEventListener('mouseup', t('mouseup').bind(this)),
  14849. e.addEventListener(
  14850. 'mouseover',
  14851. function (e) {
  14852. this.state === g.OPEN && i.classList.remove('has-hotzone')
  14853. }.bind(this)
  14854. ),
  14855. i.addEventListener(
  14856. 'mouseenter',
  14857. function (e) {
  14858. this.state !== g.CLOSING && ((this.hovering = !0), this.emit(b.ENTER))
  14859. }.bind(this)
  14860. ),
  14861. i.addEventListener(
  14862. 'mouseleave',
  14863. function (e) {
  14864. ;(this.hovering = !1), this.emit(b.LEAVE)
  14865. }.bind(this)
  14866. ),
  14867. i.addEventListener('gesturestart', function (e) {
  14868. e.preventDefault()
  14869. })
  14870. var n = i.querySelector('.tag-text-content'),
  14871. r = 0
  14872. n.addEventListener('touchstart', function (e) {
  14873. r = e.changedTouches[0].clientY
  14874. }),
  14875. n.addEventListener('touchmove', function (t) {
  14876. function e(e) {
  14877. e && ((0 === e.scrollTop && t.changedTouches[0].clientY > r) || (e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r)) && t.preventDefault()
  14878. }
  14879. return i.classList.contains('overlay') ? e(this.querySelector('.tag-desc')) : void e(this)
  14880. }),
  14881. i.addEventListener('touchmove', function (e) {
  14882. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14883. })
  14884. }),
  14885. (t.prototype.appendDescriptionElements = function (e, i) {
  14886. 0 < e.length && this.div.classList.add('has-text'),
  14887. e.forEach(
  14888. function (e, t) {
  14889. switch (e.type) {
  14890. case h.TEXT:
  14891. i.appendChild(this.createTextElement(e.text))
  14892. break
  14893. case h.LINK:
  14894. i.appendChild(this.createLinkElement(e.link))
  14895. }
  14896. }.bind(this)
  14897. )
  14898. }),
  14899. (t.prototype.appendLoadingSpinner = function () {
  14900. ;(this.loadingSpinner = document.createElement('div')), this.loadingSpinner.classList.add('loading-spinner')
  14901. var e = document.createElement('div')
  14902. e.classList.add('gui-spinner-icon'), this.loadingSpinner.appendChild(e), this.body.appendChild(this.loadingSpinner)
  14903. }),
  14904. (t.prototype.onMediaLoadFinished = function () {
  14905. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner), this.applyOrientation(this.orientation), (this.loadingSpinner = null))
  14906. }),
  14907. (t.prototype.appendMedia = function () {
  14908. if (this.media && this.media.type && 'error' !== this.media.type && (!c.valueFromHash('mls', 0) || this.media.type === h.IMAGE)) {
  14909. this.appendLoadingSpinner()
  14910. var e = document.createElement('div')
  14911. e.classList.add('tag-media-content')
  14912. var t = document.createElement('i')
  14913. switch (
  14914. (['icon', 'icon-close-thin', 'close'].forEach(function (e) {
  14915. t.classList.add(e)
  14916. }),
  14917. this.body.appendChild(t),
  14918. this.body.appendChild(e),
  14919. this.media.type)
  14920. ) {
  14921. case h.IMAGE:
  14922. e.appendChild(this.createImageElement(this.media, this.body))
  14923. break
  14924. case h.VIDEO:
  14925. e.appendChild(this.createVideoElement(this.media, this.body))
  14926. break
  14927. case h.RICH:
  14928. e.appendChild(this.createEmbedElement(this.media, this.body))
  14929. }
  14930. }
  14931. }),
  14932. (t.prototype.createTextElement = function (e) {
  14933. var t = document.createElement('span')
  14934. return (t.textContent = e), t
  14935. }),
  14936. (t.prototype.createLinkElement = function (e) {
  14937. var t = new i(e)
  14938. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)), t.createDomElement()
  14939. }),
  14940. (t.prototype.createImageElement = function (t, C) {
  14941. function e() {
  14942. function e() {
  14943. p ||
  14944. (E.classList.remove('view-image'),
  14945. a.classList.add('overlay'),
  14946. t(),
  14947. window.addEventListener('resize', A),
  14948. a.addEventListener('click', i),
  14949. c.addEventListener('click', r),
  14950. o.addEventListener('click', n),
  14951. (p = !0),
  14952. _.emit(w.IMAGE_OPENED))
  14953. }
  14954. function t() {
  14955. C.classList.add('show-info'), s.classList.remove('collapsible'), (s.style.height = '')
  14956. var e = parseFloat(getComputedStyle(v).lineHeight),
  14957. t = g + e,
  14958. i = a.clientWidth - 2 * T.boundaryWidth - m,
  14959. n = a.clientHeight - 2 * T.boundaryHeight - m - t,
  14960. r = n,
  14961. o = r * I.aspect
  14962. i < o && (r = (o = i) / I.aspect),
  14963. n < r && (o = (r = n) * I.aspect),
  14964. (o += m),
  14965. (r += m + t),
  14966. (C.style.width = o + 'px'),
  14967. (C.style.height = r + 'px'),
  14968. (l.style.paddingTop = e + m + 'px'),
  14969. 0 < _.description.length && (s.classList.add('collapsible'), (s.style.height = s.clientHeight + 12 + 'px'), (y.style.height = 'calc(100% - ' + v.clientHeight + 'px)'))
  14970. }
  14971. function i(e) {
  14972. e.target === a && n()
  14973. }
  14974. function n() {
  14975. p &&
  14976. ((p = !1),
  14977. E.classList.add('view-image'),
  14978. a.classList.remove('overlay'),
  14979. (s.style.height = ''),
  14980. (l.style.paddingTop = ''),
  14981. (C.style.width = ''),
  14982. (C.style.height = ''),
  14983. window.removeEventListener('resize', A),
  14984. a.removeEventListener('click', i),
  14985. c.removeEventListener('click', r),
  14986. o.removeEventListener('click', n),
  14987. _.emit(w.IMAGE_CLOSED),
  14988. _.close(!0))
  14989. }
  14990. function r(e) {
  14991. C.classList.toggle('show-info')
  14992. }
  14993. var a = _.div,
  14994. s = a.getElementsByClassName('tag-content')[0],
  14995. l = a.getElementsByClassName('tag-media-content')[0],
  14996. o = C.getElementsByClassName('close')[0],
  14997. c = s.getElementsByClassName('tag-label')[0]
  14998. a.classList.add('has-image'), E.classList.add('view-image'), a.classList.add(1 <= I.aspect ? 'image-landscape' : 'image-portrait'), _.applyOrientation(_.orientation)
  14999. var h,
  15000. u,
  15001. d,
  15002. p = !1,
  15003. f = getComputedStyle(s),
  15004. g = parseFloat(f.paddingTop) + parseFloat(f.paddingBottom),
  15005. m = 2 * parseFloat(getComputedStyle(l).paddingLeft),
  15006. v = s.querySelector('.tag-label'),
  15007. y = s.querySelector('.tag-desc'),
  15008. A =
  15009. ((d = 0),
  15010. function () {
  15011. clearInterval(h),
  15012. clearTimeout(u),
  15013. (h = setInterval(function () {
  15014. var e = a.clientHeight
  15015. d !== e && (t(), (d = e))
  15016. }, 100)),
  15017. (u = setTimeout(clearInterval.bind(this, h), 1e3))
  15018. })
  15019. I.on(w.IMAGE_OPENING, e), _.on(b.ACTIVATE, e), _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)), _.on(b.CLOSING, n)
  15020. }
  15021. var I = new n(),
  15022. E = I.createDomElement()
  15023. this.once(b.OPENED, function () {
  15024. I.load(t.src)
  15025. .then(e)
  15026. .catch(function (e) {
  15027. p.warn('Failed to load image:', t.src), p.warn('with error:', e)
  15028. })
  15029. .then(this.onMediaLoadFinished.bind(this))
  15030. })
  15031. var _ = this
  15032. return E
  15033. }),
  15034. (t.prototype.createVideoElement = function (t, e) {
  15035. var i = new o({
  15036. autoPlay: !0,
  15037. autoResume: !0,
  15038. startMuted: !1,
  15039. loop: !1
  15040. }),
  15041. n = i.createDomElement()
  15042. return (
  15043. this.once(
  15044. b.OPENED,
  15045. function () {
  15046. i.load(t.src)
  15047. .then(
  15048. function () {
  15049. this.div.classList.add('has-video'),
  15050. (this.state !== g.OPEN && this.state !== g.ACTIVE) || (i.show(), i.play()),
  15051. this.on(b.OPENING, i.show.bind(i)),
  15052. this.on(b.OPENED, i.play.bind(i)),
  15053. this.on(b.CLOSING, i.pause.bind(i)),
  15054. this.on(b.CLOSED, i.hide.bind(i))
  15055. }.bind(this)
  15056. )
  15057. .catch(function (e) {
  15058. p.warn('Failed to embed video:', t.src), p.warn('with error:', e)
  15059. })
  15060. .then(this.onMediaLoadFinished.bind(this))
  15061. }.bind(this)
  15062. ),
  15063. n
  15064. )
  15065. }),
  15066. (t.prototype.createEmbedElement = function (t, e) {
  15067. var i = new a(),
  15068. n = i.createDomElement()
  15069. return (
  15070. this.once(
  15071. b.OPENED,
  15072. function () {
  15073. i.load(t.src)
  15074. .then(
  15075. function () {
  15076. this.div.classList.add('has-embed'),
  15077. (this.state !== g.OPEN && this.state !== g.ACTIVE) || i.show(),
  15078. this.applyOrientation(this.orientation),
  15079. this.on(b.OPENING, i.show.bind(i)),
  15080. this.on(b.CLOSED, i.hide.bind(i))
  15081. }.bind(this)
  15082. )
  15083. .catch(function (e) {
  15084. p.warn('Failed to embed:', t.src), p.warn('with error:', e)
  15085. })
  15086. .then(this.onMediaLoadFinished.bind(this))
  15087. }.bind(this)
  15088. ),
  15089. n
  15090. )
  15091. }),
  15092. (t.prototype.open = function (e) {
  15093. return (
  15094. (this.openPromise = $.Deferred()),
  15095. this.state === g.ACTIVE
  15096. ? this.openPromise.resolve().promise()
  15097. : (this.hovering || this.div.classList.add('has-hotzone'),
  15098. this.openTransition
  15099. ? e && this.setActiveState()
  15100. : (this.openTransition = s.setTimeout(
  15101. function () {
  15102. this.state !== g.OPEN &&
  15103. (this.emit(b.OPENING),
  15104. e && this.emit(b.ACTIVATING),
  15105. (this.state = g.OPENING),
  15106. this.animateOpen(
  15107. function () {
  15108. e && this.setActiveState(), this.openPromise.resolve()
  15109. }.bind(this)
  15110. ))
  15111. }.bind(this),
  15112. d.animation.openDelay
  15113. )),
  15114. s.cancel(this.closeTransition),
  15115. this.closePromise && this.closePromise.reject(),
  15116. (this.closeTransition = void 0),
  15117. this.openPromise.promise())
  15118. )
  15119. }),
  15120. (t.prototype.close = function (e) {
  15121. return (
  15122. (this.closePromise = $.Deferred()),
  15123. !e && this.hovering
  15124. ? this.closePromise.reject().promise()
  15125. : (this.closeTransition ||
  15126. (this.closeTransition = s.setTimeout(
  15127. function () {
  15128. this.state !== g.CLOSED && (this.emit(b.CLOSING), (this.state = g.CLOSING), this.animateClose())
  15129. }.bind(this),
  15130. d.animation.closeDelay
  15131. )),
  15132. s.cancel(this.openTransition),
  15133. this.openPromise && this.openPromise.reject(),
  15134. (this.openTransition = void 0),
  15135. this.closePromise.resolve(),
  15136. this.closePromise.promise())
  15137. )
  15138. }),
  15139. (t.prototype.setActiveState = function () {
  15140. this.state !== g.CLOSED && ((this.state = g.ACTIVE), this.emit(b.ACTIVATE), this.div.classList.remove('has-hotzone'))
  15141. }),
  15142. (t.prototype.animateOpen = function (e) {
  15143. if (this.state === g.OPENING) {
  15144. if ((s.cancel(this.animationTransition), c.detectSamsungNative()))
  15145. return (this.boardOrientation = null), (this.div.style.visibility = 'visible'), this.emit(b.OPENED), (this.state = g.OPEN), void (e && e())
  15146. ;(this.div.style.webkitTransform = 'scale(0)'),
  15147. (this.div.style.transform = 'scale(0)'),
  15148. (this.div.style.visibility = 'visible'),
  15149. (this.animationTransition = s.start(
  15150. l.property(this, 'animationScale', 1),
  15151. d.animation.openDuration,
  15152. function () {
  15153. this.emit(b.OPENED), (this.state = g.OPEN), e && e()
  15154. }.bind(this)
  15155. ))
  15156. }
  15157. }),
  15158. (t.prototype.animateClose = function (e) {
  15159. this.state === g.CLOSING &&
  15160. (s.cancel(this.animationTransition),
  15161. (this.animationTransition = s.start(
  15162. l.property(this, 'animationScale', 0),
  15163. d.animation.closeDuration,
  15164. function () {
  15165. this.emit(b.CLOSED),
  15166. (this.state = g.CLOSED),
  15167. (this.div.style.visibility = 'hidden'),
  15168. this.div.classList.contains('has-hotzone') || this.div.classList.add('has-hotzone'),
  15169. e && e()
  15170. }.bind(this)
  15171. )))
  15172. }),
  15173. (t.prototype.needsUpdate = function () {
  15174. return this.state !== g.CLOSED
  15175. }),
  15176. (t.prototype.update = function (e, t) {
  15177. if (this.needsUpdate()) {
  15178. var i = (this.updateOrientation(e), this.calcScale(t)),
  15179. n = {
  15180. x: ((e.x + 1) * $('#player').width()) / 2,
  15181. y: ((e.y + 1) * $('#player').height()) / 2
  15182. }
  15183. ;(this.div.screenTransform = this.initialTransform + ' translate(' + n.x + 'px, ' + n.y + 'px) scale(' + i * this.animationScale + ')'),
  15184. (this.div.style.webkitTransform = this.div.screenTransform),
  15185. (this.div.style.transform = this.div.screenTransform)
  15186. }
  15187. }),
  15188. (t.prototype.getDimensions = function () {
  15189. return this.div.getBoundingClientRect()
  15190. }),
  15191. (t.prototype.calcScale = function (e) {
  15192. return Math.sqrt(e / 40) * d.boardToDiscRatio
  15193. }),
  15194. (t.prototype.updateOrientation = function (e) {
  15195. if (this.state !== g.ACTIVE) {
  15196. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2,
  15197. i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2,
  15198. n = ''
  15199. ;(n += 0 == i ? 'right' : 2 == i ? 'left' : ''),
  15200. (n += 0 == t ? '-down' : 2 == t ? '-up' : ''),
  15201. 1 == i && ((n = 0 == t ? 'bottom' : 2 == t ? 'top' : ''), 1 == t && (n = $('#player').width() > $('#player').height() ? (e.x < 0 ? 'right' : 'left') : e.y < 0 ? 'bottom' : 'top')),
  15202. (1 == i && 1 == t && n === this.orientation) || this.applyOrientation(n)
  15203. }
  15204. }),
  15205. (t.prototype.applyOrientation = function (e) {
  15206. ;(this.div.style.transform = this.div.style.webkitTransform = ''), this.div.classList.remove('tag-container-' + this.orientation), this.div.classList.add('tag-container-' + e)
  15207. var t = window.getComputedStyle(this.div)
  15208. ;(this.initialTransform = t.transform || t.webkitTransform), 'none' === this.initialTransform && (this.initialTransform = '')
  15209. var i = t.transform.slice(7, -1).split(','),
  15210. n = -i[4],
  15211. r = -i[5]
  15212. ;(this.div.style.webkitTransformOrigin = n + 'px ' + r + 'px'), (this.div.style.transformOrigin = n + 'px ' + r + 'px'), (this.orientation = e)
  15213. }),
  15214. (v.exports = t)
  15215. }).call(this, '/js/tag/Billboard/Billboard.js')
  15216. },
  15217. {
  15218. '../../util/browser': 182,
  15219. '../../util/lerp': 188,
  15220. '../../util/logger': 189,
  15221. '../../util/transitions': 195,
  15222. '../Media/EmbedlyEmbed': 125,
  15223. '../Media/EmbedlyPlayer': 126,
  15224. '../Media/Image': 128,
  15225. '../Media/Link': 129,
  15226. '../Media/MediaEvent': 131,
  15227. '../Parser/DescriptionChunkType': 133,
  15228. '../Parser/DescriptionParser': 134,
  15229. './BillboardEvent': 120,
  15230. './billboardSettings': 121,
  15231. './overlaySettings': 122,
  15232. events: 202
  15233. }
  15234. ],
  15235. 120: [
  15236. function (e, t, i) {
  15237. 'use strict'
  15238. t.exports = Object.freeze({
  15239. ENTER: 'billboard.enter',
  15240. LEAVE: 'billboard.leave',
  15241. OPENING: 'billboard.opening',
  15242. OPENED: 'billboard.open',
  15243. CLOSING: 'billboard.closing',
  15244. CLOSED: 'billboard.closed',
  15245. ACTIVATING: 'billboard.activating',
  15246. ACTIVATE: 'billboard.activate'
  15247. })
  15248. },
  15249. {}
  15250. ],
  15251. 121: [
  15252. function (e, t, i) {
  15253. 'use strict'
  15254. t.exports = Object.freeze({
  15255. animation: Object.freeze({
  15256. hoverOnClosing: !1,
  15257. openDelay: 100,
  15258. closeDelay: 50,
  15259. openDuration: 200,
  15260. closeDuration: 100
  15261. }),
  15262. boardToDiscRatio: 1.2
  15263. })
  15264. },
  15265. {}
  15266. ],
  15267. 122: [
  15268. function (e, t, i) {
  15269. 'use strict'
  15270. t.exports = Object.freeze({
  15271. boundaryWidth: 30,
  15272. boundaryHeight: 0
  15273. })
  15274. },
  15275. {}
  15276. ],
  15277. 123: [
  15278. function (M, R, e) {
  15279. ;(function (e) {
  15280. 'use strict'
  15281. function d(e, t, i) {
  15282. var n = i.version || '0'
  15283. '0' !== n && w.info('tag defined using version ' + n),
  15284. (this.model = e),
  15285. (this.sid = t),
  15286. (this.color = new f.Color().set(i.color || o.tagDefault)),
  15287. (this.hoverColor = o._darken(this.color, 0.2)),
  15288. (this.floor = null),
  15289. (this.floorIndex = i.floor),
  15290. (this.mode = m.PANORAMA),
  15291. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15292. (this.obj3d = null),
  15293. (this.disc = null),
  15294. (this.materials = {
  15295. disc: null,
  15296. pole: null
  15297. }),
  15298. (this.position = new f.Vector3().copy(i.position)),
  15299. (this.discPosition = new f.Vector3().copy(i.stem.direction)),
  15300. (this.discWorldPosition = null),
  15301. (this.discScale = 0.05),
  15302. (this.poleEnabled = i.stem.enabled),
  15303. (this.billboard = new r(i.label, i.description, i.media, this)),
  15304. (this.visibleTransition = null),
  15305. (this.hoveringDisc = !1)
  15306. }
  15307. var i,
  15308. l,
  15309. c,
  15310. h,
  15311. u,
  15312. p,
  15313. n,
  15314. f = M('three'),
  15315. r = M('./Billboard/Billboard'),
  15316. g = M('../settings'),
  15317. m = M('../enum/Viewmode'),
  15318. o = M('../enum/Colors'),
  15319. a = M('../enum/RenderLayers'),
  15320. s = M('../enum/RenderOrder'),
  15321. v = (M('../util/common'), M('../util/math')),
  15322. t = M('../util/texture'),
  15323. y = M('../objects/Panorama'),
  15324. A = M('../shaders'),
  15325. C = M('../util/transitions'),
  15326. I = M('../util/lerp'),
  15327. E = M('../util/easing'),
  15328. _ = M('./Billboard/BillboardEvent'),
  15329. b = M('events').EventEmitter,
  15330. w = new (M('../util/logger'))(e),
  15331. T = t.loadBase64(
  15332. '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=='
  15333. ),
  15334. x = t.loadBase64(
  15335. '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'
  15336. ),
  15337. S = new f.PlaneBufferGeometry(1, 1)
  15338. ;(d.prototype = Object.create(b.prototype)),
  15339. (d.raycaster = new f.Raycaster()),
  15340. (d.prototype.bindEvents = function () {
  15341. this.billboard.on(_.ENTER, this.setHoverState.bind(this)), this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  15342. }),
  15343. (d.prototype.build = function () {
  15344. return (
  15345. (this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first()),
  15346. this.floor && (this.billboard.build(this.model.sid), (this.obj3d = this.buildObject3D()), this.floor.add(this.obj3d)),
  15347. this
  15348. )
  15349. }),
  15350. (d.prototype.buildObject3D = function () {
  15351. var e = new f.Object3D()
  15352. e.position.copy(this.position)
  15353. var t = f.UniformsUtils.clone(A.tagDisc.uniforms)
  15354. ;(t.bg.value = x),
  15355. (t.mask.value = T),
  15356. t.color.value.copy(this.color),
  15357. (this.materials.disc = new f.RawShaderMaterial({
  15358. transparent: !0,
  15359. vertexShader: A.tagDisc.vertexShader,
  15360. fragmentShader: A.tagDisc.fragmentShader,
  15361. uniforms: t
  15362. })),
  15363. (this.disc = new f.Mesh(S, this.materials.disc)),
  15364. this.disc.layers.set(a.TAG),
  15365. this.disc.position.copy(this.discPosition),
  15366. (this.disc.renderOrder = s.tagDisc)
  15367. var i = (this.disc.tag = this).buildPole()
  15368. return i.layers.set(a.TAG), (i.renderOrder = s.tagStem), e.add(i), e.layers.set(a.TAG), e.add(this.disc)
  15369. }),
  15370. (d.prototype.buildPole = function () {
  15371. var e = new f.BufferGeometry(),
  15372. t = new Float32Array(6)
  15373. return (
  15374. (t[0] = t[1] = t[2] = 0),
  15375. (t[3] = this.discPosition.x),
  15376. (t[4] = this.discPosition.y),
  15377. (t[5] = this.discPosition.z),
  15378. e.addAttribute('position', new f.BufferAttribute(t, 3)),
  15379. (this.materials.pole = new f.LineBasicMaterial({
  15380. linewidth: g.tags.pole.width,
  15381. color: g.tags.pole.color,
  15382. opacity: 0,
  15383. visible: this.poleEnabled,
  15384. transparent: !0,
  15385. depthWrite: !1
  15386. })),
  15387. new f.Line(e, this.materials.pole)
  15388. )
  15389. }),
  15390. (d.prototype.setFreeState = function (e) {
  15391. ;(!e && this.hoveringDisc) ||
  15392. this.billboard.close(e).then(
  15393. function () {
  15394. this.materials.disc.uniforms.color.value = this.color
  15395. }.bind(this)
  15396. )
  15397. }),
  15398. (d.prototype.setHoverState = function (e) {
  15399. this.billboard.open(e), (this.materials.disc.uniforms.color.value = this.hoverColor)
  15400. }),
  15401. (d.prototype.hide = function (e, t) {
  15402. var i = $.Deferred()
  15403. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition)) return i.resolve().promise()
  15404. ;(e = e || 0), (t = t || 0), C.cancel(this.visibleTransition)
  15405. var n,
  15406. r,
  15407. o,
  15408. a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity,
  15409. s = t + e,
  15410. l = t / s
  15411. return (
  15412. (this.visibleTransition = C.start(
  15413. ((n = this),
  15414. (r = I.property(n.materials.disc.uniforms.opacity, 'value', 0)),
  15415. (o = I.property(n.materials.pole, 'opacity', 0)),
  15416. function (e) {
  15417. r(e), n.materials.pole && o(e)
  15418. }),
  15419. s * a,
  15420. function () {
  15421. i.resolve()
  15422. },
  15423. l,
  15424. E[g.warp.blendEasing]
  15425. )),
  15426. i.promise()
  15427. )
  15428. }),
  15429. (d.prototype.show = function (e, t) {
  15430. var i = $.Deferred()
  15431. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition)) return i.resolve().promise()
  15432. ;(e = e || 0), (t = t || 0), C.cancel(this.visibleTransition)
  15433. var n,
  15434. r,
  15435. o,
  15436. a = (g.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / g.tags.disc.opacity,
  15437. s = t + e,
  15438. l = t / s
  15439. return (
  15440. (this.visibleTransition = C.start(
  15441. ((n = this),
  15442. (r = I.property(n.materials.disc.uniforms.opacity, 'value', g.tags.disc.opacity)),
  15443. (o = I.property(n.materials.pole, 'opacity', g.tags.pole.opacity)),
  15444. function (e) {
  15445. r(e), n.materials.pole && o(e)
  15446. }),
  15447. s * a,
  15448. function () {
  15449. i.resolve()
  15450. },
  15451. l,
  15452. E[g.warp.blendEasing]
  15453. )),
  15454. i.promise()
  15455. )
  15456. }),
  15457. (d.prototype.closestPanoTowardTag = function (e, t) {
  15458. var i = [],
  15459. n = [],
  15460. r = this.disc.getWorldPosition()
  15461. if (e === m.PANORAMA) {
  15462. var o = t.position.clone().sub(r).normalize()
  15463. i.push(y.filters.isPanoAligned()), i.push(y.filters.isNeighbourPanoTo(t)), i.push(y.filters.inPanoDirection(r, o, 0.5)), n.push(y.scoreFunctions.direction(r, o))
  15464. }
  15465. var a = new f.Vector3()
  15466. i.push(
  15467. function (e) {
  15468. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15469. },
  15470. function (e) {
  15471. a.copy(r).sub(e.position)
  15472. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z))),
  15473. i = g.tags.navigate.tiltTolerance
  15474. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15475. }
  15476. ),
  15477. n.push(y.scoreFunctions.distanceSquared(this, -2))
  15478. var s = this.model.panos.sortByScore(i, n)
  15479. if (g.tags.navigate.lineOfSight) {
  15480. for (var l = 0; l < s.length; l++) {
  15481. var c = s[l].item,
  15482. h = c.position.distanceTo(r)
  15483. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance) return null
  15484. d.raycaster.set(c.position, r.clone().sub(c.position).normalize())
  15485. var u = d.raycaster.intersectObjects(this.model.colliders)
  15486. if (0 === u.length || u[0].distance > h) return c
  15487. }
  15488. return null
  15489. }
  15490. return 0 < s.length && s[0].pano
  15491. }),
  15492. (d.prototype.examine = function (i) {
  15493. if (!player.currentPano) return
  15494. var e = i.mode,
  15495. n = (g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano)) || i.currentPano,
  15496. t = this.disc.getWorldPosition()
  15497. this.billboard.setActiveState()
  15498. var r = function () {
  15499. var e = this.billboard.getDimensions(),
  15500. t = new f.Vector3()
  15501. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15502. t.unproject(i.camera),
  15503. i.flyToPano({
  15504. pano: n,
  15505. lookAtPoint: t
  15506. })
  15507. }.bind(this)
  15508. if (e === m.PANORAMA)
  15509. if (n !== i.currentPano) {
  15510. var o = {
  15511. pano: n,
  15512. lookAtPoint: t,
  15513. duration: null,
  15514. maxDistanceOverride: null,
  15515. skipWarpingCheck: !1
  15516. }
  15517. i.flyToPano(o, r)
  15518. } else
  15519. setTimeout(
  15520. function () {
  15521. this.billboard.open().then(function () {
  15522. r()
  15523. })
  15524. }.bind(this),
  15525. 0
  15526. )
  15527. else {
  15528. var a = {
  15529. pano: n
  15530. }
  15531. if (t) {
  15532. var s = new f.Matrix4().lookAt(n.position, t, new f.Vector3(0, 1, 0))
  15533. a.quaternion = new f.Quaternion().setFromRotationMatrix(s)
  15534. }
  15535. ;(a.callback = r), (a.duration = 1500), (a.mode = m.PANORAMA), i.flyToNewMode(a)
  15536. }
  15537. }),
  15538. (d.prototype.update =
  15539. ((n = new f.Vector3()),
  15540. function (e, t) {
  15541. ;(this.discWorldPosition = this.disc.getWorldPosition()),
  15542. this.updateDisc(e, t),
  15543. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t), n.z < 1 && ((n.y *= -1), this.billboard.update(n, this.getDiscRadius(n, t))))
  15544. })),
  15545. (d.prototype.updateDisc =
  15546. ((l = new f.Vector3()),
  15547. (c = new f.Vector3()),
  15548. (h = new f.Vector3()),
  15549. (u = new f.Vector3()),
  15550. (p = new f.Vector3()),
  15551. function (e, t) {
  15552. var i = g.tags.visibility,
  15553. n = g.tags.disc.scale,
  15554. r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition)
  15555. if (
  15556. ((this.obj3d.visible =
  15557. 0 !== this.disc.material.opacity &&
  15558. (i.anyDistance || r <= i.visibleDistance || e === m.TRANSITIONING) &&
  15559. (!i.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) &&
  15560. (!i.hideOffScreenDisc || !this.offScreen(this.disc, t)) &&
  15561. (!i.hideOffScreenObject || !this.offScreen(this.obj3d, t))),
  15562. this.obj3d.visible)
  15563. ) {
  15564. this.disc.quaternion.copy(t.quaternion)
  15565. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound)
  15566. l.copy(this.discWorldPosition).project(t),
  15567. c.set($('#player').width() / 2, $('#player').height() / 2, 1).multiply(l),
  15568. h.set(o / 2, 0, 0).add(c),
  15569. u.set(2 / $('#player').width(), 2 / $('#player').height(), 1).multiply(h),
  15570. p.copy(u).unproject(t)
  15571. var a = p.distanceTo(this.discWorldPosition),
  15572. s = 1 + (g.tags.disc.scale.responsiveness / 100) * (d.viewportScale() - 1)
  15573. ;(this.discScale = a * s), this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15574. }
  15575. })),
  15576. (d.prototype.getDiscRadius =
  15577. ((i = new f.Vector3()),
  15578. function (e, t) {
  15579. return (
  15580. i
  15581. .set(-this.discScale / 2, 0, 0)
  15582. .applyQuaternion(t.quaternion)
  15583. .add(this.discWorldPosition)
  15584. .project(t),
  15585. Math.abs(e.x - i.x) * $('#player').width()
  15586. )
  15587. })),
  15588. (d.prototype.tagVisibleOnCurrentFloor = function (e) {
  15589. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15590. }),
  15591. (d.prototype.offScreen = function (e, t) {
  15592. var i = e.getWorldPosition().project(t)
  15593. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15594. }),
  15595. (d.viewportScale = function () {
  15596. return (
  15597. (d.viewportWidth === $('#player').width() && d.viewportHeight === $('#player').height()) ||
  15598. ((d.viewportWidth = $('#player').width()),
  15599. (d.viewportHeight = $('#player').height()),
  15600. (d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize))),
  15601. d.currentViewportScale
  15602. )
  15603. }),
  15604. (R.exports = d)
  15605. }).call(this, '/js/tag/tag.js')
  15606. },
  15607. {
  15608. '../enum/Colors': 19,
  15609. '../enum/RenderLayers': 41,
  15610. '../enum/RenderOrder': 42,
  15611. '../enum/Viewmode': 51,
  15612. '../objects/Panorama': 148,
  15613. '../settings': 166,
  15614. '../shaders': 167,
  15615. '../util/common': 185,
  15616. '../util/easing': 186,
  15617. '../util/lerp': 188,
  15618. '../util/logger': 189,
  15619. '../util/math': 190,
  15620. '../util/texture': 194,
  15621. '../util/transitions': 195,
  15622. './Billboard/Billboard': 119,
  15623. './Billboard/BillboardEvent': 120,
  15624. events: 202,
  15625. three: 217
  15626. }
  15627. ],
  15628. 124: [
  15629. function (M, R, e) {
  15630. ;(function (e) {
  15631. 'use strict'
  15632. function t() {
  15633. ;(this.tagState = T.IDLE),
  15634. (this.intersectTag = null),
  15635. (this.hoveredTag = null),
  15636. (this.activeTag = null),
  15637. (this.tagDiscs = []),
  15638. (this.raycaster = new i.Raycaster()),
  15639. (this.modelManager = null),
  15640. (this.player = null),
  15641. (this.totaltags = 0),
  15642. (this.navigatingViaTag = !1),
  15643. (this.enabled = !1)
  15644. }
  15645. var o,
  15646. h,
  15647. u,
  15648. d,
  15649. p,
  15650. f,
  15651. s,
  15652. l,
  15653. c,
  15654. i = M('three'),
  15655. n = M('../util/logger'),
  15656. r = M('../util/common'),
  15657. a = M('../controls/serializer'),
  15658. g = M('../objects/Snapshot'),
  15659. m = M('../settings'),
  15660. v = M('./Billboard/BillboardEvent'),
  15661. y = M('./Media/MediaEvent'),
  15662. A = M('./Media/LinkType'),
  15663. C = M('../enum/Viewmode'),
  15664. I = M('../enum/WarpStyle'),
  15665. E = M('../enum/BlackoutStyle'),
  15666. _ = M('../enum/ModelManagerEvents'),
  15667. b = M('../enum/tagEvents'),
  15668. w = M('../enum/PlayerEvents'),
  15669. T = (M('../util/lerp'), M('../enum/TagStates')),
  15670. x = M('events').EventEmitter,
  15671. S = new n(e)
  15672. r.extend(t, x),
  15673. (t.prototype.init = function (e, t) {
  15674. ;(this.modelManager = e), (this.player = t), this.updateModel(), this.bindEvents()
  15675. }),
  15676. (t.prototype.update = function (e) {
  15677. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15678. }),
  15679. (t.prototype.updateTags = function (e, t, i, n) {
  15680. for (var r in this.model.tags) this.model.tags[r].update(e, t, i, n)
  15681. }),
  15682. (t.prototype.updateModel = function () {
  15683. ;(this.model = this.modelManager.getActiveModel()), this.gettagsFromModel(), (this.totaltags = Object.keys(this.model.tags).length)
  15684. }),
  15685. (t.prototype.gettagsFromModel = function () {
  15686. for (var e in ((this.tagDiscs = []), this.model.tags)) {
  15687. var t = this.model.tags[e].disc
  15688. t && this.tagDiscs.push(t)
  15689. }
  15690. }),
  15691. (t.prototype.bindEvents = function () {
  15692. function e() {
  15693. Object.keys(this.model.tags).forEach(
  15694. function (e) {
  15695. var t = this.model.tags[e]
  15696. t.bindEvents(),
  15697. t.billboard.on(
  15698. y.LINK_CLICK,
  15699. function (e) {
  15700. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15701. }.bind(this)
  15702. ),
  15703. t.billboard.on(
  15704. y.IMAGE_OPENED,
  15705. function () {
  15706. ;(this.tagState = T.EXAMINE), this.emit(y.IMAGE_OPENED)
  15707. }.bind(this)
  15708. ),
  15709. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15710. }.bind(this)
  15711. )
  15712. }
  15713. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15714. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15715. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15716. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15717. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15718. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15719. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15720. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15721. e.call(this)
  15722. }),
  15723. (t.prototype.navigateViaLink = function (e) {
  15724. var t = a.deserialize(e)
  15725. if (t)
  15726. if (t.mode === C.PANORAMA) {
  15727. try {
  15728. this.player.model.panos.get(t.panoId)
  15729. } catch (e) {
  15730. return void S.warn('Unable to find panorama location', t.panoId)
  15731. }
  15732. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15733. } else {
  15734. var i = {
  15735. cameraMode: t.mode,
  15736. position: t.position,
  15737. quaternion: t.quaternion,
  15738. scanId: t.panoId,
  15739. orthoZoom: t.zoom,
  15740. floorVisibility: t.floorVisibility,
  15741. thumbUrl: null,
  15742. name: null
  15743. }
  15744. this.player.flyToNewMode({
  15745. mode: t.mode,
  15746. duration: m.warp.outsideTime,
  15747. warpDest: new g(i),
  15748. force: !0
  15749. })
  15750. }
  15751. }),
  15752. (t.prototype.handleWarpStart = function (e, t, i, n) {
  15753. this.dismissExaminedTag(), t === I.BLACK && (null != n || (n = m.warp.teleportTime), e && (i = E.END), this.hideShowTagsForBlackoutStyle(i, n))
  15754. }),
  15755. (t.prototype.handleWarpInterruption = function (e, t, i) {
  15756. null != i || (i = m.warp.teleportTime), this.hideShowTagsForBlackoutStyle(t, i)
  15757. }),
  15758. (t.prototype.hideShowTagsForBlackoutStyle = function (e, t) {
  15759. var i = 0,
  15760. n = 0,
  15761. r = t / 2
  15762. switch ((null != e || (e = E.MIDDLE), e)) {
  15763. case E.END:
  15764. this.hideAlltags(r)
  15765. break
  15766. case E.BEGINNING:
  15767. this.hideAlltags().done(this.showAlltags.bind(this, r))
  15768. break
  15769. case E.NONE:
  15770. break
  15771. case E.MIDDLE:
  15772. ;(n = i = r),
  15773. this.hideAlltags(n),
  15774. setTimeout(
  15775. function () {
  15776. this.showAlltags(i)
  15777. }.bind(this),
  15778. n
  15779. )
  15780. break
  15781. case E.FADEIN:
  15782. setTimeout(
  15783. function () {
  15784. this.showAlltags(r)
  15785. }.bind(this),
  15786. r
  15787. )
  15788. }
  15789. }),
  15790. (t.prototype.onPlayerModeChanging = function (e, t) {
  15791. t !== C.PANORAMA && this.dismissExaminedTag(), t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR)
  15792. var i = t !== C.OUTDOOR
  15793. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15794. }),
  15795. (t.prototype.onPanoChange = function (e, t) {
  15796. var i = this.navigatingViaTag
  15797. if (((this.navigatingViaTag = !1), !i)) {
  15798. this.dismissExaminedTag()
  15799. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA,
  15800. r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA
  15801. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15802. }
  15803. }),
  15804. (t.prototype.onPlayerReady = function (e, t, i) {
  15805. this.startAlltags(e, t ? i : null)
  15806. }),
  15807. (t.prototype.onPlayerFlyingEnded = function (e, t) {
  15808. this.updateClosestTags(e)
  15809. }),
  15810. (t.prototype.dismissExaminedTag = function () {
  15811. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(), this.hoveredTag && (this.hoveredTag.setFreeState(!0), (this.hoveredTag = null))
  15812. }),
  15813. (t.prototype.startAlltags = function (e, t) {
  15814. ;(this.model.shouldShowtags = m.tags.enabled),
  15815. (this.enabled = !0),
  15816. e ||
  15817. (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  15818. t &&
  15819. setTimeout(
  15820. function () {
  15821. this.activateTag(this.model.getTagBySid(t))
  15822. }.bind(this),
  15823. m.tags.startup.fadeInDuration / 2
  15824. ))
  15825. }),
  15826. (t.prototype.showAlltags = function (e, t, i) {
  15827. function n() {
  15828. ++o === this.totaltags && ((this.model.tagsShown = !0), r.resolve())
  15829. }
  15830. var r = $.Deferred()
  15831. if ((!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned()) || !this.model.shouldShowtags) return r.resolve().promise()
  15832. var o = 0
  15833. for (var a in this.model.tags) {
  15834. this.model.tags[a].show(e, t).done(n.bind(this))
  15835. }
  15836. return r.promise()
  15837. }),
  15838. (t.prototype.hideAlltags = function (e, t) {
  15839. function i() {
  15840. ++r === this.totaltags && ((this.model.tagsShown = !1), n.resolve())
  15841. }
  15842. var n = $.Deferred(),
  15843. r = 0
  15844. for (var o in this.model.tags) {
  15845. var a = this.model.tags[o]
  15846. a.hide(e, t).done(i.bind(this)), a === this.activeTag && this.dismissActiveTag()
  15847. }
  15848. return n.promise()
  15849. }),
  15850. (t.prototype.enableHovering = function () {
  15851. this.enabled = !0
  15852. }),
  15853. (t.prototype.disableHovering = function () {
  15854. this.enabled = !1
  15855. }),
  15856. (t.prototype.activateTag = function (e, t) {
  15857. ;(t = t || T.EXAMINE), (this.activeTag = e), (this.activeTag.hoveringDisc = !0), this.activeTag.setHoverState(t === T.EXAMINE), (this.tagState = t), this.emit(b.TagActivated, e)
  15858. }),
  15859. (t.prototype.dismissActiveTag = function () {
  15860. ;(this.activeTag.hoveringDisc = !1), this.activeTag.setFreeState(!0)
  15861. var e = this.activeTag
  15862. ;(this.activeTag = null), (this.tagState = T.IDLE), this.emit(b.TagDismissed, e)
  15863. }),
  15864. (t.prototype.clickedOnTag = function (e) {
  15865. var t = function () {
  15866. ;(this.navigatingViaTag = !0), this.activeTag.examine(this.player), this.emit(b.TagNavigation, this.activeTag)
  15867. }.bind(this)
  15868. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE), (this.activeTag = this.intersectTag), t(), !0) : (this.dismissActiveTag(), !1)
  15869. }),
  15870. (t.prototype.intersecttag =
  15871. ((s = new i.Vector3()),
  15872. (l = new i.Vector3()),
  15873. (c = new i.Vector3()),
  15874. function (e, t, i) {
  15875. if (!this.enabled) return null
  15876. var n = null,
  15877. r = this.tagDiscs.filter(function (e) {
  15878. return e.parent.visible
  15879. })
  15880. if (0 < r.length) {
  15881. var o = this.model.floors.reduce(function (e, t) {
  15882. return t.hidden ? e : e.concat(t.collider.children)
  15883. }, r)
  15884. s.set(e.x, e.y, -1).unproject(i), l.set(e.x, e.y, 1).unproject(i), c.copy(l).sub(s).normalize(), this.raycaster.set(s, c)
  15885. var a = this.raycaster.intersectObjects(o)
  15886. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  15887. }
  15888. return (
  15889. (this.intersectTag = n),
  15890. t &&
  15891. (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || (this.tagState === T.EXAMINE && n)) && this.dismissActiveTag(),
  15892. n &&
  15893. n !== this.activeTag &&
  15894. (n.listeners(v.ENTER).length < 1 &&
  15895. (n.billboard.on(
  15896. v.ENTER,
  15897. function () {
  15898. this.hoveredTag = n
  15899. }.bind(this)
  15900. ),
  15901. n.billboard.on(
  15902. v.LEAVE,
  15903. function () {
  15904. this.hoveredTag = null
  15905. }.bind(this)
  15906. )),
  15907. this.activateTag(n, T.BROWSE))),
  15908. n
  15909. )
  15910. })),
  15911. (t.prototype.rankedtagInDirection =
  15912. ((h = []),
  15913. (u = []),
  15914. (d = new i.Vector3()),
  15915. (p = new i.Vector3()),
  15916. (f = new i.Vector3()),
  15917. function (e, t, i, n) {
  15918. for (var r = 0, o = (u.length = 0); o < this.closesttags.length; o++) {
  15919. var a = this.closesttags[o]
  15920. p.copy(a.position), p.add(a.discPosition), d.copy(t), d.sub(p).negate(), d.normalize()
  15921. var s = d.dot(n)
  15922. if (0 <= s && (f.copy(p), f.project(i), this.intersecttag(f, !1, i))) {
  15923. if (r >= h.length)
  15924. for (var l = 0; l < 64; l++)
  15925. h.push({
  15926. tag: a,
  15927. dot: s
  15928. })
  15929. var c = h[r]
  15930. ;(c.tag = a), (c.dot = s), (c.position = math.projectPositionToCanvas(p, i)), u.push(c), r++
  15931. }
  15932. }
  15933. return (
  15934. u.sort(function (e, t) {
  15935. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  15936. }),
  15937. e < u.length ? u[e].tag : null
  15938. )
  15939. })),
  15940. (t.prototype.updateClosestTags =
  15941. ((o = new i.Vector3()),
  15942. function (e) {
  15943. this.closesttags || (this.closesttags = []), (this.closesttags.length = 0)
  15944. var t = this.model.tags
  15945. if (t)
  15946. for (var i in t)
  15947. if (t.hasOwnProperty(i)) {
  15948. var n = t[i],
  15949. r = n.position
  15950. o.copy(e), o.sub(r).negate(), o.lengthSq() < 30 && this.closesttags.push(n)
  15951. }
  15952. })),
  15953. (R.exports = t)
  15954. }).call(this, '/js/tag/tagManager.js')
  15955. },
  15956. {
  15957. '../controls/serializer': 14,
  15958. '../enum/BlackoutStyle': 18,
  15959. '../enum/tagEvents': 32,
  15960. '../enum/ModelManagerEvents': 33,
  15961. '../enum/PlayerEvents': 40,
  15962. '../enum/TagStates': 44,
  15963. '../enum/Viewmode': 51,
  15964. '../enum/WarpStyle': 52,
  15965. '../objects/Snapshot': 153,
  15966. '../settings': 166,
  15967. '../util/common': 185,
  15968. '../util/lerp': 188,
  15969. '../util/logger': 189,
  15970. './Billboard/BillboardEvent': 120,
  15971. './Media/LinkType': 130,
  15972. './Media/MediaEvent': 131,
  15973. events: 202,
  15974. three: 217
  15975. }
  15976. ],
  15977. 125: [
  15978. function (r, o, e) {
  15979. ;(function (e) {
  15980. 'use strict'
  15981. function t() {
  15982. ;(this.embedWrapper = null), (this.embedElement = null)
  15983. }
  15984. var i = r('../../util/ajax'),
  15985. a = r('./mediaSettings'),
  15986. n = r('../../settings'),
  15987. s = new (r('../../util/logger'))(e)
  15988. ;(t.prototype.createDomElement = function () {
  15989. return (this.embedWrapper = document.createElement('div')), this.embedWrapper.classList.add('tag-embed'), this.embedWrapper.classList.add('hidden'), this.embedWrapper
  15990. }),
  15991. (t.prototype.load = function (e) {
  15992. var t = 'https://api.embedly.com/1/oembed?key=' + n.appConfig.embedly_key + '&url=' + encodeURIComponent(e) + '&maxwidth=' + a.maxEmbedWidth
  15993. return new Promise(
  15994. function (r, o) {
  15995. i.get(t).then(
  15996. function (e) {
  15997. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf('<script')) {
  15998. this.embedWrapper.innerHTML = e.html
  15999. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth
  16000. if (((this.embedWrapper.style.width = t + 'px'), e.height)) {
  16001. var i = e.height / e.width
  16002. this.embedWrapper.style.height = t * i + 'px'
  16003. }
  16004. this.embedElement = this.embedWrapper.firstChild
  16005. var n = []
  16006. try {
  16007. n = [].slice.call(this.embedElement.querySelectorAll('a'))
  16008. } catch (e) {
  16009. s.debug('Error getting `a` elements for embed; was it an iframe?')
  16010. }
  16011. n.forEach(function (e) {
  16012. e.setAttribute('target', '_blank')
  16013. }),
  16014. this.embedElement.classList.add('hidden'),
  16015. this.embedWrapper.classList.remove('hidden'),
  16016. r()
  16017. } else o('Not a valid embed')
  16018. }.bind(this),
  16019. function (e) {
  16020. o(e.response)
  16021. }
  16022. )
  16023. }.bind(this)
  16024. )
  16025. }),
  16026. (t.prototype.show = function () {
  16027. this.embedElement && this.embedElement.classList.remove('hidden')
  16028. }),
  16029. (t.prototype.hide = function () {
  16030. this.embedElement && this.embedElement.classList.add('hidden')
  16031. }),
  16032. (o.exports = t)
  16033. }).call(this, '/js/tag/Media/EmbedlyEmbed.js')
  16034. },
  16035. {
  16036. '../../settings': 166,
  16037. '../../util/ajax': 181,
  16038. '../../util/logger': 189,
  16039. './mediaSettings': 132
  16040. }
  16041. ],
  16042. 126: [
  16043. function (a, s, e) {
  16044. ;(function (e) {
  16045. 'use strict'
  16046. function t(e) {
  16047. r.call(this), (this.options = e), (this.playerControls = null), (this.state = o.NOT_READY)
  16048. }
  16049. var i,
  16050. n = a('../../util/browser'),
  16051. r = a('./EmbedlyEmbed'),
  16052. o =
  16053. (new (a('../../util/logger'))(e),
  16054. Object.freeze({
  16055. NOT_READY: 'player.not.ready',
  16056. CUED: 'player.cued',
  16057. PLAYING: 'player.playing',
  16058. PAUSED: 'player.paused'
  16059. }))
  16060. ;((t.prototype = Object.create(r.prototype)).createDomElement = function () {
  16061. return (this.embedWrapper = document.createElement('div')), this.embedWrapper.classList.add('tag-video'), this.embedWrapper.classList.add('hidden'), this.embedWrapper
  16062. }),
  16063. (t.prototype.load = function (e) {
  16064. var t = function () {
  16065. function e(e) {
  16066. this.playerState = e
  16067. }
  16068. ;(this.playerControls = new playerjs.Player(this.embedElement)),
  16069. this.playerControls.on(
  16070. 'ready',
  16071. function (e) {
  16072. ;(this.playerState = o.CUED), this.options.startMuted && this.playerControls.mute()
  16073. }.bind(this)
  16074. ),
  16075. this.playerControls.on('play', e.bind(this, o.PLAYING)),
  16076. this.playerControls.on('pause', e.bind(this, o.PAUSED)),
  16077. this.playerControls.on(
  16078. 'ended',
  16079. function (e) {
  16080. this.playerControls.setCurrentTime(0), this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16081. }.bind(this)
  16082. )
  16083. }.bind(this)
  16084. return r.prototype.load.call(this, e).then(t.bind(this))
  16085. }),
  16086. (t.prototype.play =
  16087. ((i = n.isMobile()),
  16088. function () {
  16089. this.playerState !== o.NOT_READY && this.playerControls && !i && ((this.state === o.CUED && this.options.autoPlay) || this.options.autoResume) && this.playerControls.play()
  16090. })),
  16091. (t.prototype.pause = function () {
  16092. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  16093. }),
  16094. (s.exports = t)
  16095. }).call(this, '/js/tag/Media/EmbedlyPlayer.js')
  16096. },
  16097. {
  16098. '../../util/browser': 182,
  16099. '../../util/logger': 189,
  16100. './EmbedlyEmbed': 125
  16101. }
  16102. ],
  16103. 127: [
  16104. function (t, i, e) {
  16105. ;(function (e) {
  16106. 'use strict'
  16107. var r = t('../../util/ajax'),
  16108. o = new (t('./mediaSettings'), t('../../util/logger'))(e),
  16109. a = Promise.resolve()
  16110. i.exports.enqueue = function (i) {
  16111. function n() {}
  16112. return (a = new Promise(function (e, t) {
  16113. a.catch(n).then(function () {
  16114. ;(o.debug('requesting file from embedly:', i.href),
  16115. r
  16116. .get(i.href, {
  16117. responseType: i.responseType
  16118. })
  16119. .then(function (e) {
  16120. return o.debug('requesting file finished:', i.href), e
  16121. })).then(e, t)
  16122. })
  16123. }))
  16124. }
  16125. }).call(this, '/js/tag/Media/EmbedlyQueue.js')
  16126. },
  16127. {
  16128. '../../util/ajax': 181,
  16129. '../../util/logger': 189,
  16130. './mediaSettings': 132
  16131. }
  16132. ],
  16133. 128: [
  16134. function (s, l, e) {
  16135. ;(function (e) {
  16136. 'use strict'
  16137. function t() {
  16138. ;(this.imageWrapper = null), (this.width = 0), (this.height = 0), (this.aspect = 1)
  16139. }
  16140. var i = s('./MediaEvent'),
  16141. n = s('./EmbedlyQueue'),
  16142. r = s('events').EventEmitter,
  16143. o = s('../../util/logger'),
  16144. a = s('../../settings')
  16145. new o(e),
  16146. ((t.prototype = Object.create(r.prototype)).createDomElement = function () {
  16147. return (
  16148. (this.imageWrapper = document.createElement('div')),
  16149. this.imageWrapper.classList.add('tag-image'),
  16150. this.imageWrapper.classList.add('hidden'),
  16151. this.imageWrapper.addEventListener(
  16152. 'click',
  16153. function (e) {
  16154. e.stopPropagation(), this.emit(i.IMAGE_OPENING), (this.imageWrapper.style.pointerEvents = 'none')
  16155. }.bind(this)
  16156. ),
  16157. this.imageWrapper
  16158. )
  16159. }),
  16160. (t.prototype.onClosed = function () {
  16161. this.imageWrapper.style.pointerEvents = 'auto'
  16162. }),
  16163. (t.prototype.load = function (e) {
  16164. var t = Math.max(window.screen.height, window.screen.width),
  16165. i = 'https://i.embed.ly/1/display/resize?key=' + a.appConfig.embedly_key + '&url=' + encodeURIComponent(e) + '&width=' + t + '&height=' + t
  16166. return new Promise(
  16167. function (o, e) {
  16168. n.enqueue({
  16169. href: i,
  16170. responseType: 'arraybuffer'
  16171. }).then(
  16172. function (e) {
  16173. var t = new Uint8Array(e),
  16174. i = new Blob([t]),
  16175. n = new window.Image()
  16176. n.addEventListener(
  16177. 'load',
  16178. function (e) {
  16179. var t = e.target
  16180. ;(this.width = t.naturalWidth), (this.height = t.naturalHeight), (this.aspect = this.width / this.height)
  16181. var i = e.target.src
  16182. ;(this.imageWrapper.style.backgroundImage = 'url("' + i + '")'),
  16183. (this.imageWrapper.style.width = this.width + 'px'),
  16184. (this.imageWrapper.style.height = this.height + 'px'),
  16185. this.imageWrapper.classList.remove('hidden'),
  16186. o()
  16187. }.bind(this)
  16188. )
  16189. var r = URL.createObjectURL(i)
  16190. n.src = r
  16191. }.bind(this),
  16192. e
  16193. )
  16194. }.bind(this)
  16195. )
  16196. }),
  16197. (l.exports = t)
  16198. }).call(this, '/js/tag/Media/Image.js')
  16199. },
  16200. {
  16201. '../../settings': 166,
  16202. '../../util/logger': 189,
  16203. './EmbedlyQueue': 127,
  16204. './MediaEvent': 131,
  16205. events: 202
  16206. }
  16207. ],
  16208. 129: [
  16209. function (e, t, i) {
  16210. 'use strict'
  16211. function n(e) {
  16212. ;(this.label = e.label), (this.href = e.url), (this.type = this.updateLinkForType()), (this.domElement = null), (this.id = c++)
  16213. }
  16214. var r = e('./LinkType'),
  16215. o = e('./MediaEvent'),
  16216. a = e('../../util/browser'),
  16217. s = e('../../analytics'),
  16218. l = e('events').EventEmitter,
  16219. c = 0
  16220. ;(n.prototype = Object.create(l.prototype)).updateLinkForType = function () {
  16221. var e,
  16222. t = a.valueFromHash('m') || a.valueFromHash('model')
  16223. return -1 !== this.href.indexOf('port.com/show') || -1 !== this.href.indexOf(window.location.host + '/show')
  16224. ? -1 !== this.href.indexOf(t) && -1 !== this.href.indexOf('start=')
  16225. ? ((this.href = ((e = this.href), new RegExp('[#&?]start=([^#&?]*)').exec(e)[1])), r.NAVIGATION)
  16226. : ((this.href = this.href + '&play=1'), r.MODEL)
  16227. : r.EXT_LINK
  16228. }
  16229. var h = {}
  16230. ;(n.prototype.createDomElement = function () {
  16231. if (((this.domElement = document.createElement('a')), this.domElement.classList.add('tag-link'), (this.domElement.textContent = this.label), this.type === r.EXT_LINK)) {
  16232. this.domElement.textContent += ' '
  16233. var e = document.createElement('i')
  16234. e.classList.add('icon-ext-link'), (e.title = 'Link to external web site'), this.domElement.appendChild(e)
  16235. }
  16236. return (
  16237. this.domElement.addEventListener(
  16238. 'click',
  16239. function (e) {
  16240. switch (
  16241. (e.stopPropagation(),
  16242. (h[this.id] = !0),
  16243. s.trackAlways('click_tag_link', {
  16244. link_type: this.type,
  16245. link_count: c,
  16246. links_clicked: Object.keys(h).length
  16247. }),
  16248. this.type)
  16249. ) {
  16250. case r.MODEL:
  16251. window.location.replace(this.href)
  16252. break
  16253. case r.EXT_LINK:
  16254. window.open(this.href, '_blank')
  16255. }
  16256. this.emit(o.LINK_CLICK, {
  16257. type: this.type,
  16258. url: this.href
  16259. })
  16260. }.bind(this)
  16261. ),
  16262. this.domElement
  16263. )
  16264. }),
  16265. (t.exports = n)
  16266. },
  16267. {
  16268. '../../analytics': 4,
  16269. '../../util/browser': 182,
  16270. './LinkType': 130,
  16271. './MediaEvent': 131,
  16272. events: 202
  16273. }
  16274. ],
  16275. 130: [
  16276. function (e, t, i) {
  16277. 'use strict'
  16278. t.exports = {
  16279. NAVIGATION: 'navigation',
  16280. MODEL: 'model',
  16281. EXT_LINK: 'ext-link'
  16282. }
  16283. },
  16284. {}
  16285. ],
  16286. 131: [
  16287. function (e, t, i) {
  16288. 'use strict'
  16289. t.exports = Object.freeze({
  16290. LINK_CLICK: 'mtmedia.link',
  16291. IMAGE_LOADED: 'mtmedia.image.loaded',
  16292. IMAGE_OPENING: 'mtmedia.image.opening',
  16293. IMAGE_OPENED: 'mtmedia.image.opened',
  16294. IMAGE_CLOSING: 'mtmedia.image.closing',
  16295. IMAGE_CLOSED: 'mtmedia.image.closed',
  16296. VIDEO_START: 'mtmedia.video.start',
  16297. VIDEO_PAUSE: 'mtmedia.video.pause',
  16298. VIDEO_ENDED: 'mtmedia.video.end'
  16299. })
  16300. },
  16301. {}
  16302. ],
  16303. 132: [
  16304. function (e, t, i) {
  16305. 'use strict'
  16306. t.exports = Object.freeze({
  16307. maxEmbedWidth: 350,
  16308. defaultAspectRatio: 0.75
  16309. })
  16310. },
  16311. {}
  16312. ],
  16313. 133: [
  16314. function (e, t, i) {
  16315. 'use strict'
  16316. t.exports = Object.freeze({
  16317. TEXT: 'text',
  16318. LINK: 'link',
  16319. IMAGE: 'photo',
  16320. VIDEO: 'video',
  16321. RICH: 'rich'
  16322. })
  16323. },
  16324. {}
  16325. ],
  16326. 134: [
  16327. function (e, t, i) {
  16328. 'use strict'
  16329. function n(e) {
  16330. this.capabilities = {
  16331. links: {
  16332. enable: e.supportLinks,
  16333. keepLabels: e.keepLinkLabels
  16334. }
  16335. }
  16336. }
  16337. var r = e('./DescriptionChunkType')
  16338. ;(n.prototype.parse = function (e, i) {
  16339. var n = []
  16340. return (
  16341. e
  16342. .split('[')
  16343. .map(function (e, t) {
  16344. return 0 === t ? e : '[' + e
  16345. })
  16346. .forEach(
  16347. function (e) {
  16348. var t = this.findMarkdown(e)
  16349. if (t) {
  16350. if (-1 !== t.url.indexOf('javascript:')) return
  16351. this.addLinkChunk(n, t, i), this.addTextChunk(n, e.slice(t.markdown.length))
  16352. } else this.addTextChunk(n, e)
  16353. }.bind(this)
  16354. ),
  16355. n
  16356. )
  16357. }),
  16358. (n.prototype.findMarkdown = function (e) {
  16359. var t = e.match(/\[([^\]]*)\]\((.*)\)/)
  16360. if (t) {
  16361. for (var i = t[2], n = 1, r = 0; r < i.length && ('(' === i[r] ? n++ : ')' === i[r] && n--, 0 !== n); ) r++
  16362. var o = i.length - r
  16363. return {
  16364. markdown: t[0].substring(0, t[0].length - o),
  16365. label: t[1],
  16366. url: t[2].substring(0, r)
  16367. }
  16368. }
  16369. }),
  16370. (n.prototype.addTextChunk = function (e, t) {
  16371. 0 !== t.length &&
  16372. e.push({
  16373. type: r.TEXT,
  16374. text: t
  16375. })
  16376. }),
  16377. (n.prototype.addLinkChunk = function (e, t) {
  16378. if (this.capabilities.links.enable) {
  16379. var i = {
  16380. label: t.label,
  16381. url: t.url
  16382. }
  16383. ;-1 === i.url.indexOf('://') && (i.url = 'http://' + i.url),
  16384. e.push({
  16385. type: r.LINK,
  16386. link: i
  16387. })
  16388. } else this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16389. }),
  16390. (t.exports = n)
  16391. },
  16392. {
  16393. './DescriptionChunkType': 133
  16394. }
  16395. ],
  16396. 135: [
  16397. function (t, r, e) {
  16398. ;(function (e) {
  16399. 'use strict'
  16400. var i = new (t('../util/logger'))(e),
  16401. n = {
  16402. parseIdsFromChunkName: function (e, t) {
  16403. ;(t.floorId = n.parseFloor(e)), (t.roomId = n.parseRoom(e))
  16404. },
  16405. parseFloor: function (e) {
  16406. var t = e.match(/_group([0-9]+)/)
  16407. if (!t) return 0
  16408. try {
  16409. return parseInt(t[1], 10)
  16410. } catch (e) {
  16411. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'), 0
  16412. }
  16413. },
  16414. parseRoom: function (e) {
  16415. var t = e.match(/_sub([0-9]+)/)
  16416. if (!t) return -1
  16417. try {
  16418. return parseInt(t[1], 10)
  16419. } catch (e) {
  16420. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'), 0
  16421. }
  16422. }
  16423. }
  16424. r.exports = n
  16425. }).call(this, '/js/model/Chunks.js')
  16426. },
  16427. {
  16428. '../util/logger': 189
  16429. }
  16430. ],
  16431. 136: [
  16432. function (a, c, e) {
  16433. ;(function (e) {
  16434. 'use strict'
  16435. function t(e) {
  16436. r.call(this), (this.model = e), (this.exploded = !1)
  16437. }
  16438. var i = a('../objects/Floor'),
  16439. n = (a('../settings'), a('../util/logger')),
  16440. s = a('../util/transitions'),
  16441. r = a('../util/IndexedCollection'),
  16442. o = a('../util/common'),
  16443. l = a('../util/easing')
  16444. new n(e),
  16445. o.inherit(t, r),
  16446. (t.prototype.add = function (e) {
  16447. r.prototype.add.call(this, e), this.model.add(e)
  16448. }),
  16449. (t.prototype.getIndex = function (e) {
  16450. return e.floorIndex
  16451. }),
  16452. (t.prototype.build = function () {
  16453. this.list.forEach(function (e) {
  16454. e.build()
  16455. })
  16456. }),
  16457. (t.prototype.size = function () {
  16458. return this.length
  16459. }),
  16460. (t.prototype.sort = function () {
  16461. r.prototype.sort.call(this, function (e, t) {
  16462. return e.floorIndex - t.floorIndex
  16463. })
  16464. }),
  16465. (t.prototype.nextFloor = function (e, t) {
  16466. return this.index[e.floorIndex + t] || null
  16467. }),
  16468. (t.prototype.getFloorAtPoint = function (e) {
  16469. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16470. var r = this.list[n],
  16471. o = r.distanceToPoint(e)
  16472. ;(!t || o < i) && ((i = o), (t = r))
  16473. }
  16474. return t
  16475. }),
  16476. (t.prototype.getOrMakeFloor = function (e) {
  16477. var t = this.index[e]
  16478. return t || ((t = new i(this.model, e)), this.add(t)), t
  16479. }),
  16480. (t.prototype.hide = function () {
  16481. this.list.forEach(function (e) {
  16482. e.hide()
  16483. })
  16484. }),
  16485. (t.prototype.show = function () {
  16486. this.list.forEach(function (e) {
  16487. e.show()
  16488. })
  16489. }),
  16490. (t.prototype.names = function () {
  16491. return this.list.reduce(function (e, t) {
  16492. return e.concat(t.name)
  16493. }, [])
  16494. }),
  16495. (t.prototype.toggleExplodeHorizontal = function () {
  16496. function i(e, t) {
  16497. a.copy(e.position),
  16498. (e.position.x = r[e.floorIndex] * t),
  16499. (e.position.y = 1 * e.floorIndex * t),
  16500. a.sub(e.position).multiplyScalar(-1),
  16501. e.panos.forEach(function (e) {
  16502. e.translate(a)
  16503. })
  16504. }
  16505. var n,
  16506. r = [],
  16507. o = 0
  16508. this.list.forEach(function (e, t, i) {
  16509. ;(n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0), (o += n), (r[t] = o)
  16510. }),
  16511. (r = r.map(function (e) {
  16512. return e - o / 2
  16513. }))
  16514. var a = this.list[0].position.clone()
  16515. this.exploded
  16516. ? this.list.forEach(function (t) {
  16517. s.start(
  16518. function (e) {
  16519. i(t, 1 - e)
  16520. },
  16521. 1500,
  16522. null,
  16523. 0,
  16524. l.easeOutExpo
  16525. )
  16526. })
  16527. : this.list.forEach(function (t) {
  16528. s.start(
  16529. function (e) {
  16530. i(t, e)
  16531. },
  16532. 1500,
  16533. null,
  16534. 0,
  16535. l.easeOutExpo
  16536. )
  16537. }),
  16538. (this.exploded = !this.exploded)
  16539. }),
  16540. (t.prototype.toggleExplodeVertical = function () {
  16541. function i(e, t) {
  16542. var i = i.copy(e.position)
  16543. ;(e.position.y = (5 * e.floorIndex - n.y / 2) * t),
  16544. i.sub(e.position).multiplyScalar(-1),
  16545. e.panos.forEach(function (e) {
  16546. e.translate(i)
  16547. })
  16548. }
  16549. var n = this.model.size
  16550. this.list[0].position.clone(),
  16551. this.exploded
  16552. ? this.list.forEach(function (t) {
  16553. s.start(
  16554. function (e) {
  16555. i(t, 1 - e)
  16556. },
  16557. 1500,
  16558. null,
  16559. 0,
  16560. l.easeOutExpo
  16561. )
  16562. })
  16563. : this.list.forEach(function (t) {
  16564. s.start(
  16565. function (e) {
  16566. i(t, e)
  16567. },
  16568. 1500,
  16569. null,
  16570. 0,
  16571. l.easeOutExpo
  16572. )
  16573. }),
  16574. (this.exploded = !this.exploded)
  16575. }),
  16576. (c.exports = t)
  16577. }).call(this, '/js/model/FloorCollection.js')
  16578. },
  16579. {
  16580. '../objects/Floor': 146,
  16581. '../settings': 166,
  16582. '../util/IndexedCollection': 175,
  16583. '../util/common': 185,
  16584. '../util/easing': 186,
  16585. '../util/logger': 189,
  16586. '../util/transitions': 195
  16587. }
  16588. ],
  16589. 137: [
  16590. function (r, o, e) {
  16591. ;(function (e) {
  16592. 'use strict'
  16593. function h() {
  16594. n.call(this)
  16595. }
  16596. var u = r('../settings'),
  16597. t = r('../util/logger'),
  16598. d = r('../enum/Viewmode'),
  16599. p = r('../objects/Snapshot'),
  16600. i = (r('../util/math'), r('../util/common')),
  16601. n = r('../util/IndexedCollection'),
  16602. l = new t(e)
  16603. i.inherit(h, n),
  16604. (h.prototype.getImage = function (e) {
  16605. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16606. }),
  16607. (h.prototype.filterByModesAndReel = function (e, t) {
  16608. for (var i = [], n = 0; n < t.length; n += 1) {
  16609. var r = t[n],
  16610. o = this.index[r.sid]
  16611. o && i.push(o)
  16612. }
  16613. var a = e[d.DOLLHOUSE],
  16614. s = e[d.FLOORPLAN]
  16615. ;(i = i.filter(function (e) {
  16616. if (!e.metadata || void 0 === e.metadata.camera_mode) return !0
  16617. var t
  16618. try {
  16619. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16620. } catch (e) {
  16621. return l.debug(e.message), !1
  16622. }
  16623. return t === d.PANORAMA || (t === d.FLOORPLAN && s) || (t === d.DOLLHOUSE && a)
  16624. })).length !== this.list.length && l.info('Disallowed ' + (this.list.length - i.length) + ' highlight images'),
  16625. (this.list = i),
  16626. this.reIndex()
  16627. }),
  16628. (h.prototype.getHeroLocations = function (panos) {
  16629. //改 增加二级location
  16630. if (0 === this.list.length) return []
  16631. var locations = []
  16632. var deal = (n, container) => {
  16633. var r = n.thumbnail_signed_src,
  16634. o = n.name || ''
  16635. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16636. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16637. var a = panos.get(n.metadata.scan_id)
  16638. if (a && !a.isAligned()) return
  16639. }
  16640. var s = d.convertWorkshopModeInt(n.metadata.camera_mode)
  16641. if (s === d.MESH) return
  16642. if (window.isLocal) var src = manage.dealURL(r)
  16643. else var src = 'one' === g_version ? g_Prefix + r + '?' + randomTime().getTime() : r + '?' + randomTime().getTime()
  16644. var l = {
  16645. cameraMode: s,
  16646. position: n.metadata.camera_position,
  16647. quaternion: n.metadata.camera_quaternion,
  16648. zoom: n.metadata.zoom,
  16649. panoId: n.metadata.scan_id,
  16650. orthoZoom: n.metadata.ortho_zoom,
  16651. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16652. thumbUrl: src,
  16653. name: h.filterImageName(o),
  16654. sid: n.sid
  16655. }
  16656. var item = new p(l)
  16657. item.momentTour = n.momentTour
  16658. item.dontRot = n.dontRot
  16659. item.rotTime = n.rotTime
  16660. container.push(item)
  16661. return item
  16662. }
  16663. }
  16664. this.list.forEach(image => {
  16665. if (image.images) {
  16666. var folder = $.extend({}, image)
  16667. folder.heroLocations = []
  16668. image.images.list.forEach(child => {
  16669. deal(child, folder.heroLocations)
  16670. })
  16671. folder.musicInfo = folder.musicInfo || {}
  16672. locations.push(folder)
  16673. delete folder.images
  16674. delete folder.locations
  16675. } else {
  16676. var item = deal(image, locations)
  16677. item.musicInfo = image.musicInfo || g_data2.tourAudio[item.sid] || {} //新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  16678. }
  16679. })
  16680. return locations
  16681. }),
  16682. (h.prototype.getIndex = function (e) {
  16683. return e.sid
  16684. }),
  16685. (h.filterImageName = function (e) {
  16686. return '' === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16687. }),
  16688. (o.exports = h)
  16689. }).call(this, '/js/model/ImageCollection.js')
  16690. },
  16691. {
  16692. '../enum/Viewmode': 51,
  16693. '../objects/Snapshot': 153,
  16694. '../settings': 166,
  16695. '../util/IndexedCollection': 175,
  16696. '../util/common': 185,
  16697. '../util/logger': 189,
  16698. '../util/math': 190
  16699. }
  16700. ],
  16701. 138: [
  16702. function (h, u, e) {
  16703. ;(function (e) {
  16704. 'use strict'
  16705. function n() {
  16706. c.call(this)
  16707. }
  16708. var r = h('../label/Label'),
  16709. i = h('../settings'),
  16710. t = h('../util/logger'),
  16711. o = h('../util/math'),
  16712. a = h('../util/ajax'),
  16713. s = h('./RoomCollection'),
  16714. l = h('../util/common'),
  16715. c = h('../util/IndexedCollection')
  16716. new t(e),
  16717. l.inherit(n, c),
  16718. (n.prototype.getIndex = function (e) {
  16719. return e.labelId
  16720. }),
  16721. (n.prototype.associateWithRooms = function (e) {
  16722. this.forEach(function (t) {
  16723. e.forEach(function (e) {
  16724. e.roomId === t.roomId && (t.room = e)
  16725. })
  16726. })
  16727. }),
  16728. (n.prototype.createFromLabelData = function (e) {
  16729. e.forEach(
  16730. function (e) {
  16731. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId)
  16732. t = s.generateRoomId(e.floorId, t)
  16733. var i = new r(e.sid, e.position || e.positions[0], e.text, e.floorId, t)
  16734. ;(i.position = o.convertWorkshopVector(i.position)), this.add(i), i.build()
  16735. }.bind(this)
  16736. )
  16737. }),
  16738. (n.prototype.load = function (e, t) {
  16739. return a
  16740. .get(e, {
  16741. responseType: 'json',
  16742. auth: t ? i.authorizationHeader : null
  16743. })
  16744. .done(
  16745. function (e) {
  16746. var t = []
  16747. for (var i in e) {
  16748. var n = e[i]
  16749. t.push(n)
  16750. }
  16751. this.createFromLabelData(t)
  16752. }.bind(this)
  16753. )
  16754. }),
  16755. (n.parseRoomIndexFromWorkshopRoomId = function (e) {
  16756. var t = -1
  16757. if (e) {
  16758. if (typeof e == 'number') {
  16759. t = parseInt(e)
  16760. } else {
  16761. var i = e.split('_')
  16762. t = parseInt(i[0])
  16763. }
  16764. }
  16765. return t
  16766. }),
  16767. (u.exports = n)
  16768. }).call(this, '/js/model/LabelCollection.js')
  16769. },
  16770. {
  16771. '../label/Label': 90,
  16772. '../settings': 166,
  16773. '../util/IndexedCollection': 175,
  16774. '../util/ajax': 181,
  16775. '../util/common': 185,
  16776. '../util/logger': 189,
  16777. '../util/math': 190,
  16778. './RoomCollection': 141
  16779. }
  16780. ],
  16781. 139: [
  16782. function (P, O, e) {
  16783. ;(function (e) {
  16784. 'use strict'
  16785. function t(e, t) {
  16786. o.Object3D.call(this), (this.sid = window.number) //t.sid,
  16787. ;(this.data = t),
  16788. (this.options = e),
  16789. (this.urls = new i(e.urlFiles)),
  16790. (this.isPublic = void 0 !== t.is_public && t.is_public),
  16791. //创建heroLocations
  16792. (this.images = new E(this)),
  16793. this.images.extend(t.images),
  16794. this.images.forEach(info => {
  16795. if (info.locations) {
  16796. info.images = new E(this)
  16797. info.images.extend(info.locations)
  16798. }
  16799. })
  16800. this.heroLocations = []
  16801. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  16802. ;(this.outdoorPanoLocations = []),
  16803. (this.floors = new c(this)),
  16804. (this.floorsEnabled = void 0 === e.floors || e.floors),
  16805. (this.changingFloor = !1),
  16806. (this.chunks = []),
  16807. (this.panos = new g()),
  16808. (this.colliders = []),
  16809. (this.loadPanosPromise = null),
  16810. (this.loadMeshTexturesPromise = null),
  16811. (this.auxDataPromise = null),
  16812. (this.meshTexturesLoaded = !1),
  16813. (this.meshTextures = []),
  16814. (this.tags = {}),
  16815. (this.tagsShown = !1),
  16816. (this.shouldShowtags = !1),
  16817. (this.has360Views = !1),
  16818. (this.showingLabels = u.labels.enabled && t.player_options.labels),
  16819. (this.supportedModes = {}),
  16820. (this.supportedModes[s.PANORAMA] = !0),
  16821. (this.supportedModes[s.DOLLHOUSE] = !t.player_options || (t.player_options.dollhouse && I.valueFromHash('dh', 1))),
  16822. (this.supportedModes[s.FLOORPLAN] = !t.player_options || (t.player_options.floor_plan && I.valueFromHash('dh', 1))),
  16823. (this.supportedModes[s.TRANSITIONING] = !0),
  16824. (this.supportsTiles = this.configureTiling()),
  16825. (this.supportsVR = window.DATA.supportsVR || false) //!0,
  16826. ;(this.mode = s.DOLLHOUSE),
  16827. (this.size = null),
  16828. (this.center = null),
  16829. (this.boundingBox = new o.Box3()),
  16830. (this.currentFloor = null),
  16831. (this.allFloorsVisible = !0),
  16832. (this.projectedPano0 = null),
  16833. (this.projectedPano1 = null),
  16834. this.floorsEnabled &&
  16835. t.floors &&
  16836. -1 !== t.floors.indexOf(',') &&
  16837. t.floors.split(',').forEach(
  16838. function (e, t) {
  16839. this.addFloor(new r(this, t, e.trim()))
  16840. }.bind(this)
  16841. ),
  16842. (this.waitQueue = []),
  16843. this.on(
  16844. 'load',
  16845. function (e) {
  16846. 0 !== this.waitQueue.length &&
  16847. ((this.waitQueue = this.waitQueue.filter(function (e) {
  16848. return !e.isLoadedCallback()
  16849. })),
  16850. 0 === this.waitQueue.length && this.emit('waiting-done'))
  16851. }.bind(this)
  16852. ),
  16853. this.setupCustomProperties(),
  16854. (this.hots = {})
  16855. }
  16856. var o = P('three'),
  16857. a = P('../util/ajax'),
  16858. i = P('../util/ModelUrls'),
  16859. n = P('../objects/BoundingTextureSkybox'),
  16860. s = P('../enum/Viewmode'),
  16861. l = P('../enum/RenderOrder'),
  16862. r = (P('../enum/AlignmentType'), P('../objects/Floor')),
  16863. c = P('./FloorCollection'),
  16864. h = P('../objects/Chunk'),
  16865. u = (P('../objects/Room'), P('../objects/Snapshot'), P('../label/Label'), P('../util/math'), P('../settings')),
  16866. d = P('../shaders'),
  16867. p = P('../util/logger'),
  16868. f = (P('../tag/tag'), P('../tag/tagManager'), P('../objects/Panorama')),
  16869. g = P('../util/PanoramaCollection'),
  16870. m = P('../loaders/ModelLoader'),
  16871. v = P('../loaders/ModelTextureLoader'),
  16872. y = P('../loaders/SweepDataLoader'),
  16873. A = P('../util/transitions'),
  16874. C = (P('../util/easing'), P('../util/lerp'), P('../util/common')),
  16875. I = (P('../util/texture'), P('./../util/browser')),
  16876. E = P('./ImageCollection'),
  16877. _ = P('./RoomCollection'),
  16878. b = P('./LabelCollection'),
  16879. w = P('./Chunks'),
  16880. T = P('./../util/showcase'),
  16881. x = P('../exception/BasicException'),
  16882. S = (P('../constants'), P('events').EventEmitter),
  16883. // , M = P("hot")
  16884. R = new p(e)
  16885. ;(t.prototype = Object.create(o.Object3D.prototype)),
  16886. C.extend(t, S),
  16887. (t.prototype.setupCustomProperties = function () {
  16888. var t = u.modelAlpha
  16889. Object.defineProperty(this, 'alpha', {
  16890. get: function () {
  16891. return t
  16892. },
  16893. set: function (e) {
  16894. ;(t = e),
  16895. this.chunks.forEach(function (e) {
  16896. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  16897. })
  16898. }
  16899. })
  16900. }),
  16901. (t.prototype.configureTiling = function () {
  16902. var e = (function () {
  16903. try {
  16904. var e = document.createElement('canvas'),
  16905. t = e.getContext('webgl')
  16906. return (t = t || e.getContext('experimental-webgl')).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  16907. } catch (e) {
  16908. return 0
  16909. }
  16910. })()
  16911. if (e < 2048) return !1
  16912. R.warn('Max cube texture size: ' + e)
  16913. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  16914. var i = u.tiling.tilingFlagNames[t]
  16915. if ('1' === I.valueFromHash(i, null)) return !0
  16916. if ('0' === I.valueFromHash(i, null)) return !1
  16917. }
  16918. return !!T.modelDataPromisesTiles(this.data)
  16919. }),
  16920. (t.prototype.toggleAlpha = function () {
  16921. this.alpha < 1 ? (this.alpha = 1) : (this.alpha = 0)
  16922. }),
  16923. (t.prototype.load = function (e) {
  16924. var t = this.urls.init().then(
  16925. function () {
  16926. return $.when(this.loadPanos(), this.loadMesh())
  16927. }.bind(this)
  16928. )
  16929. return (
  16930. e ? (t = t.then(this.loadMeshTextures.bind(this))) : t.then(this.loadMeshTextures.bind(this)),
  16931. (this.auxDataPromise = $.when(this.loadhots(), this.loadLabels())),
  16932. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  16933. )
  16934. }),
  16935. (t.prototype.loadMesh = function () {
  16936. var n = $.Deferred(),
  16937. r = this
  16938. return (
  16939. m.load(
  16940. r.data.job.uuid,
  16941. r.urls,
  16942. function (e, t) {
  16943. if (0 === e.length) {
  16944. R.warn('No geometry found for model, loading faux geometry, disabling outside mode'), (r.supportedModes[s.DOLLHOUSE] = !1), (r.supportedModes[s.FLOORPLAN] = !1)
  16945. var i = new h({
  16946. geometry: new o.PlaneBufferGeometry(5, 5, 1, 1)
  16947. })
  16948. ;(i.material.visible = !1), i.rotateX(-Math.PI / 2), i.geometry.computeBoundingBox(), (e = [i])
  16949. }
  16950. e.forEach(function (e) {
  16951. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0
  16952. r.addChunk(t, e)
  16953. }),
  16954. r.floors.sort(),
  16955. n.resolve(r)
  16956. },
  16957. function (e, t) {
  16958. n.notify(e, t)
  16959. },
  16960. function (e) {
  16961. R.error(e), n.reject('loading-failed')
  16962. }
  16963. ),
  16964. n.promise()
  16965. )
  16966. }),
  16967. (t.prototype.loadMeshTextures = function () {
  16968. return (
  16969. this.loadTexturesPromise ||
  16970. (this.loadTexturesPromise = v.load(this, this.meshTextures).then(
  16971. function () {
  16972. this.meshTexturesLoaded = !0
  16973. }.bind(this)
  16974. )),
  16975. this.loadTexturesPromise
  16976. )
  16977. }),
  16978. (t.prototype.loadhots = function () {
  16979. initHot(this)
  16980. var r = $.Deferred(),
  16981. e = g_Prefix + 'data1/' + this.sid + '/data2.js?' + randomTime().getTime()
  16982. return (
  16983. a
  16984. .get(e, {
  16985. responseType: 'json',
  16986. auth: this.isPublic ? null : u.authorizationHeader
  16987. })
  16988. .done(
  16989. function (e) {
  16990. window.data2 = e
  16991. this.roomLabels = []
  16992. editTool.loadDone('data2', e)
  16993. if (!e) {
  16994. console.error('data2 is null')
  16995. } else {
  16996. g_data2 = hotMatcher(e)
  16997. this.hotsCount = 0
  16998. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  16999. //window.hotData = {}
  17000. /* if(e.hots){
  17001. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  17002. sids.forEach((sid)=>{
  17003. this.hotsCount++,
  17004. this.hots[sid] = new M(sid,e.hots[sid] ,this);
  17005. //e.hots[sid].infoAttribute || (e.hots[sid].infoAttribute = {})
  17006. //this.hots[sid].initStyleImg(e.hots[sid].infoAttribute);
  17007. window.hotData[sid] = e.hots[sid];
  17008. })
  17009. }*/
  17010. if (e.hots) {
  17011. var sids = Object.keys(e.hots).sort((a, b) => {
  17012. return e.hots[a].order - e.hots[b].order
  17013. })
  17014. sids.forEach(sid => {
  17015. e.hots[sid].sid = sid
  17016. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && 'byHot')
  17017. })
  17018. }
  17019. if (e.overlays) {
  17020. e.overlays.forEach(info => {
  17021. new Hot(info, 'byOverlay')
  17022. })
  17023. }
  17024. Hot.createHotList()
  17025. if (DATA.roomLabels) {
  17026. DATA.roomLabels.forEach(data => {
  17027. this.roomLabels.push(new RoomLabel(data))
  17028. })
  17029. }
  17030. /* if(e.multiOverlays){
  17031. e.multiOverlays.forEach((info)=>{
  17032. new Hot(info)
  17033. })
  17034. }) */
  17035. Hot.startLoad()
  17036. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc)
  17037. }
  17038. r.resolve()
  17039. }.bind(this)
  17040. )
  17041. .fail(function () {
  17042. console.log('没有热点'), editTool.loadDone('data2', null)
  17043. r.resolve()
  17044. }),
  17045. r
  17046. )
  17047. }),
  17048. (t.prototype.loadPanos = function () {
  17049. if (this.loadPanosPromise) return this.loadPanosPromise
  17050. var e = new y(this)
  17051. return (
  17052. (this.loadPanosPromise = e.load().then(
  17053. function (e) {
  17054. window.panoListOriData = e.map(a => a.uuid) //包括!enabled的点
  17055. return (
  17056. this.data.sweeps &&
  17057. 0 < Object.keys(this.data.sweeps).length &&
  17058. (e = e.filter(
  17059. function (e) {
  17060. if (this.data.sweeps[e.uuid]) return this.data.sweeps[e.uuid].enabled
  17061. else console.log(e.uuid)
  17062. //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
  17063. }.bind(this)
  17064. )),
  17065. this.panos.extend(
  17066. e.map(
  17067. function (e) {
  17068. return new f(this, e.uuid, e, this.supportsTiles)
  17069. }.bind(this)
  17070. )
  17071. ),
  17072. this.panos.forEach(
  17073. function (i) {
  17074. i.neighbourUUIDs &&
  17075. (i.neighbourUUIDs.forEach(
  17076. function (e) {
  17077. var t = this.panos.get(e)
  17078. t && this.panos.setNeighbour(i, t, !0)
  17079. }.bind(this)
  17080. ),
  17081. (i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0)))
  17082. }.bind(this)
  17083. ),
  17084. 0 === this.panos.length && (R.warn('Model has no panos, turning off inside mode'), (this.supportedModes[s.PANORAMA] = !1)),
  17085. $.when(this)
  17086. )
  17087. }.bind(this)
  17088. )),
  17089. this.loadPanosPromise
  17090. )
  17091. }),
  17092. (t.prototype.loadHighlightReel = function () {
  17093. var t = $.Deferred(),
  17094. e = this.options.urlBase + 'data1/' + this.sid + '/active_reel.json'
  17095. return (
  17096. a
  17097. .get(e, {
  17098. responseType: 'json',
  17099. auth: this.isPublic ? null : u.authorizationHeader
  17100. })
  17101. .done(
  17102. function (e) {
  17103. e.reel ? (R.info('Got highlight reel with ' + e.reel.length + ' items'), this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info('No highlight reel found'),
  17104. t.resolve()
  17105. }.bind(this)
  17106. )
  17107. .fail(function () {
  17108. R.warn('Getting highlight reel failed, no highlights available'), t.resolve()
  17109. }),
  17110. t
  17111. )
  17112. }),
  17113. (t.prototype.waitForLoad = function (e, t) {
  17114. t() ||
  17115. (this.waitQueue.push({
  17116. object: e,
  17117. isLoadedCallback: t
  17118. }),
  17119. 1 === this.waitQueue.length && this.emit('waiting'))
  17120. }),
  17121. (t.prototype.hide = function () {
  17122. this.floors.hide()
  17123. }),
  17124. (t.prototype.show = function () {
  17125. this.floors.show()
  17126. }),
  17127. (t.prototype.floorNames = function () {
  17128. return this.floors.names()
  17129. }),
  17130. (t.prototype.warpDestFloors = function (e, t) {
  17131. if (e && this.floors.length === e.length) {
  17132. var i = e.findIndex(
  17133. function (e) {
  17134. return e
  17135. }.bind(this)
  17136. )
  17137. ;-1 !== i && this.setFloor(this.floors.list[i], null, t)
  17138. } else this.toggleAllFloors(!0)
  17139. }),
  17140. (t.prototype.setFloor = function (e, t, i) {
  17141. this.allFloorsVisible && this.emit('allfloors.toggled', !1, this.currentFloor), (this.allFloorsVisible = !1), this._setFloor(e, t, i)
  17142. }),
  17143. (t.prototype.toggleAllFloors = function (e) {
  17144. ;(this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible), this.emit('allfloors.toggled', this.allFloorsVisible, this.currentFloor), this._setFloor(this.currentFloor)
  17145. }),
  17146. (t.prototype._setFloor = function (e, t, i) {
  17147. var n
  17148. if (((t = t || this.mode), this.emit('floor.changed', e, t, this.currentFloor), (this.currentFloor = e), t === s.PANORAMA)) {
  17149. if ((this.show(), this.shouldShowtags && this.tagsShown)) for (n in this.tags) this.tags[n].show(u.showFloorDuration)
  17150. } else if (
  17151. (t === s.FLOORPLAN || t === s.DOLLHOUSE) &&
  17152. (this.floors.list.forEach(
  17153. function (e, t) {
  17154. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17155. }.bind(this)
  17156. ),
  17157. this.shouldShowtags && this.tagsShown)
  17158. )
  17159. for (n in this.tags) {
  17160. var r = this.tags[n]
  17161. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  17162. }
  17163. var o = this,
  17164. a = e
  17165. A.start(
  17166. function () {},
  17167. u.showFloorDelay,
  17168. function () {
  17169. o.floors.forEach(function (t) {
  17170. t.chunks.forEach(function (e) {
  17171. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  17172. })
  17173. })
  17174. }.bind(this)
  17175. )
  17176. }),
  17177. (t.prototype.toggleExplode = function () {
  17178. this.floors.toggleExplodeHorizontal()
  17179. }),
  17180. (t.prototype.toggleExplodeUp = function () {
  17181. this.floors.toggleExplodeVertical()
  17182. }),
  17183. (t.prototype.nextFloor = function (e) {
  17184. return this.floors.nextFloor(this.currentFloor, e)
  17185. }),
  17186. (t.prototype.addFloor = function (e) {
  17187. this.floors.add(e)
  17188. }),
  17189. (t.prototype.getFloorAtPoint = function (e) {
  17190. return this.floors.getFloorAtPoint(e)
  17191. }),
  17192. (t.prototype.getTagBySid = function (e) {
  17193. return this.tags[e]
  17194. }),
  17195. (t.prototype.addChunk = function (e, t) {
  17196. this.floors.getOrMakeFloor(e).addChunk(t), this.chunks.push(t)
  17197. }),
  17198. (t.prototype.setMode = function (t) {
  17199. if (!this.supportedModes[t]) throw new x('Mode not supported for this model: ' + t)
  17200. this.mode = t
  17201. this.skybox.material.transparent = t == 'panorama' ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17202. this.chunks.forEach(function (e) {
  17203. e.setMode(t)
  17204. })
  17205. }),
  17206. (t.prototype.build = function () {
  17207. this.heroLocations = this.images.getHeroLocations(this.panos)
  17208. var e = function () {
  17209. return (
  17210. !!(this.heroImage && this.heroImage.metadata && this.heroImage.metadata.scan_id && this.panos.get(this.heroImage.metadata.scan_id)) &&
  17211. !this.panos.get(this.heroImage.metadata.scan_id).isAligned()
  17212. )
  17213. }.bind(this)()
  17214. ;(this.has360Views =
  17215. (u.show360Views.enabled &&
  17216. this.heroLocations.some(
  17217. function (e) {
  17218. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17219. }.bind(this)
  17220. )) ||
  17221. e),
  17222. null === this.heroImage && R.warn('No hero image defined.'),
  17223. (this.currentFloor = this.floors.last()),
  17224. this.floors.build(),
  17225. (this.colliders = this.floors.reduce(function (e, t) {
  17226. return e.concat(t.collider.children)
  17227. }, [])),
  17228. this.panos.forEach(
  17229. function (e) {
  17230. e.build1(),
  17231. e.on(
  17232. 'enter',
  17233. function () {
  17234. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17235. }.bind(this)
  17236. )
  17237. }.bind(this)
  17238. )
  17239. let downVec = new THREE.Vector3(0, -1, 0)
  17240. this.panos.forEach(pano => {
  17241. player.raycaster.set(pano.position, downVec)
  17242. let collider = pano.floor.collider.children
  17243. let n = player.raycaster.intersectObjects(collider, true) //add true
  17244. if (n && n[0]) {
  17245. if (n[0].point.y - pano.floorPosition.y > 0.03) {
  17246. //console.error(`${pano.id}, 探测高度${n[0].point.y.toPrecision(5)} 原高度 ${pano.floorPosition.y.toPrecision(5)}, 相差 ${(n[0].point.y - pano.floorPosition.y).toPrecision(5)}`)
  17247. pano.originFloorY = pano.floorPosition.y
  17248. pano.floorPosition.y = n[0].point.y
  17249. }
  17250. }
  17251. //是否需要排除一下相差过高的?因为可能探测到的是长椅这样的
  17252. })
  17253. this.panos.forEach(function (e) {
  17254. e.build2()
  17255. }),
  17256. this.floors.forEach(
  17257. function (e) {
  17258. this.boundingBox.union(e.boundingBox)
  17259. }.bind(this)
  17260. ),
  17261. (this.size = this.boundingBox.size()),
  17262. (this.center = this.boundingBox.center()),
  17263. this.floors.forEach(
  17264. function (e) {
  17265. R.info('Floor ' + e + ': ' + e.children.length + ' chunks, ' + e.panos.length + ' panos.')
  17266. }.bind(this)
  17267. ),
  17268. this.panos.populate_path_graph(),
  17269. (this.skybox = new n(this.boundingBox)),
  17270. (this.skybox.matrixWorldNeedsUpdate = !0),
  17271. this.add(this.skybox)
  17272. /* setTimeout(function() {
  17273. //this.hotsCount && this.shineHots()
  17274. Hot.beginShineHot()
  17275. }
  17276. .bind(this), 1300), */
  17277. //add-----
  17278. console.log('计算visiblePanos开始,可能需要一段时间')
  17279. for (let i in this.hots) {
  17280. this.hots[i].setVisiblePanos(this.hots[i].info.visiblePanos)
  17281. }
  17282. console.log('计算visiblePanos完毕')
  17283. //---------
  17284. return (
  17285. R.debug('Done building model'),
  17286. 0 < f.raycastsDone && (R.warn('raycasts: ' + f.raycastsDone), R.warn('raycasts skipped: ' + f.raycastsSkipped)),
  17287. this.buildRooms(),
  17288. this.labels.associateWithRooms(this.rooms),
  17289. $.when(this)
  17290. )
  17291. }),
  17292. (t.prototype.loadLabels = function () {
  17293. this.labels = new b(this)
  17294. var e = $.Deferred()
  17295. window.DATA.showingLabels ? (this.showingLabels = true) : ''
  17296. if (!this.showingLabels) return e.resolve()
  17297. var t = g_Prefix + 'data1/' + this.sid + '/labels.json'
  17298. return (
  17299. this.labels
  17300. .load(t, !this.isPublic)
  17301. .done(e.resolve.bind(e))
  17302. .fail(function () {
  17303. R.warn('Getting labels failed, not displaying labels.'), e.resolve()
  17304. }),
  17305. e
  17306. )
  17307. }),
  17308. (t.prototype.buildRooms = function () {
  17309. ;(this.rooms = new _(this)), this.rooms.createFromChunks(this.chunks), this.rooms.calcRoomBoundaries()
  17310. }),
  17311. (t.prototype.updateProjectedPanos = function () {
  17312. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17313. }),
  17314. (t.prototype.setProjectedPanos = function (t, i, n) {
  17315. null != n || (n = !0),
  17316. (n = !!n),
  17317. (this.projectedPano0 = t),
  17318. (this.projectedPano1 = i),
  17319. this.skybox.material.setProjectedPanos(t, i, n),
  17320. this.chunks.forEach(function (e) {
  17321. e.materialInside.setProjectedPanos(t, i, n)
  17322. })
  17323. }),
  17324. (t.prototype.setSide = function (t) {
  17325. this.floors.forEach(function (e) {
  17326. e.collider.material.side = t
  17327. })
  17328. }),
  17329. (t.prototype.heroCount = function () {
  17330. return this.heroLocations ? this.heroLocations.length : 0
  17331. }),
  17332. (t.prototype.getHeroDescriptorByIndex = function (e = []) {
  17333. //改 因增加了二级目录
  17334. if (e[0] < 0) return R.warn('Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0.'), null
  17335. if (this.heroCount() < 1) return R.warn('Model.getHeroDescriptorByIndex() -> No hero locations in this model'), null
  17336. var t = this.heroLocations[e[0]]
  17337. if (t.heroLocations && e[1] != void 0) {
  17338. t = t.heroLocations[e[1]]
  17339. }
  17340. return void 0 === t ? (R.warn('Model.getHeroDescriptorByIndex() -> Index ' + e + ' is not a validindex'), null) : t
  17341. }),
  17342. (t.prototype.findPanoramicHero = function () {
  17343. for (var e in this.heroLocations) if (this.heroLocations[e].cameraMode === s.PANORAMA) return this.heroLocations[e]
  17344. return null
  17345. }),
  17346. (t.prototype.listImagePanos = function () {
  17347. var i = [],
  17348. n = this
  17349. return (
  17350. this.images.forEach(function (e) {
  17351. if (e.metadata && e.metadata.scan_id) {
  17352. var t = n.panos.get(e.metadata.scan_id)
  17353. t && (n.supportsTiles || t.isLoaded('high') || i.push(t))
  17354. }
  17355. }),
  17356. i
  17357. )
  17358. }),
  17359. (t.prototype.fadePanoMarkers = function (/* e, t */ opacity, dur, o = {}) {
  17360. //改
  17361. if (window.DATA.hideFloorMarker) return
  17362. var currentPano = player.currentPano
  17363. opacity = void 0 == opacity ? _settings.panorama.markerOpacity : opacity //不传opacity代表显示
  17364. var hideWhenFlyOut = () => {
  17365. var shows = [],
  17366. hides = []
  17367. player.model.panos.forEach(pano => {
  17368. hides.push(pano)
  17369. })
  17370. this.panos.fadeMarkerOpacity(0, dur, [{ toOp: 0, member: hides }])
  17371. }
  17372. if (opacity == 0) {
  17373. hideWhenFlyOut()
  17374. } else {
  17375. if (player.mode == 'panorama' && currentPano) {
  17376. var shows = [],
  17377. hides = []
  17378. player.model.panos.forEach(pano => {
  17379. //是邻近点就显示否则隐藏
  17380. if (currentPano.neighbourPanos[pano.id]) {
  17381. shows.push(pano)
  17382. } else {
  17383. hides.push(pano)
  17384. }
  17385. })
  17386. this.panos.fadeMarkerOpacity(opacity, dur, [
  17387. { toOp: opacity, member: shows },
  17388. { toOp: 0, member: hides }
  17389. ])
  17390. } else if (player.modeTran.split('-')[1] != 'panorama') {
  17391. //飞出后marker隐藏
  17392. hideWhenFlyOut()
  17393. }
  17394. }
  17395. }),
  17396. (t.prototype.setSweepVisibility = function (t) {
  17397. this.panos.forEach(function (e) {
  17398. e.marker && (e.marker.visible = t)
  17399. })
  17400. }),
  17401. (t.prototype.outsideAllowed = function () {
  17402. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  17403. }),
  17404. (O.exports = t)
  17405. }).call(this, '/js/model/Model.js')
  17406. },
  17407. {
  17408. '../constants': 8,
  17409. '../enum/AlignmentType': 17,
  17410. '../enum/RenderOrder': 42,
  17411. '../enum/Viewmode': 51,
  17412. '../exception/BasicException': 55,
  17413. '../label/Label': 90,
  17414. '../loaders/ModelLoader': 105,
  17415. '../loaders/ModelTextureLoader': 106,
  17416. '../loaders/SweepDataLoader': 107,
  17417. '../tag/tag': 123,
  17418. '../tag/tagManager': 124,
  17419. '../objects/BoundingTextureSkybox': 143,
  17420. '../objects/Chunk': 144,
  17421. '../objects/Floor': 146,
  17422. '../objects/Panorama': 148,
  17423. '../objects/Room': 150,
  17424. '../objects/Snapshot': 153,
  17425. '../settings': 166,
  17426. '../shaders': 167,
  17427. '../util/ModelUrls': 177,
  17428. '../util/PanoramaCollection': 178,
  17429. '../util/ajax': 181,
  17430. '../util/common': 185,
  17431. '../util/easing': 186,
  17432. '../util/lerp': 188,
  17433. '../util/logger': 189,
  17434. '../util/math': 190,
  17435. '../util/texture': 194,
  17436. '../util/transitions': 195,
  17437. './../util/browser': 182,
  17438. './../util/showcase': 193,
  17439. './Chunks': 135,
  17440. './FloorCollection': 136,
  17441. './ImageCollection': 137,
  17442. './LabelCollection': 138,
  17443. './RoomCollection': 141,
  17444. events: 202,
  17445. three: 217
  17446. //hot: "hot"
  17447. }
  17448. ],
  17449. 140: [
  17450. function (e, t, i) {
  17451. 'use strict'
  17452. function n() {
  17453. ;(this.modelMap = {}), (this.activeModel = null), (this.modelCount = 0), (this.tileDownloader = null), (this.panoRenderer = null)
  17454. }
  17455. var r = (e('three'), e('../util/common')),
  17456. o = e('../exception/BasicException'),
  17457. a = e('../enum/ModelManagerEvents'),
  17458. s = e('../enum/PanoRendererEvents'),
  17459. l = e('events').EventEmitter
  17460. ;(n.prototype.init = function (e, t, i) {
  17461. ;(this.tileDownloader = e), (this.panoRenderer = t), (this.qualityManager = i), this.bindEvents()
  17462. }),
  17463. (n.prototype.bindEvents = function () {
  17464. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17465. }),
  17466. (n.prototype.onTileRendered = function (e, t, i, n) {}),
  17467. (n.prototype.addModel = function (e) {
  17468. ;(this.modelMap[e.sid] = e), 0 === this.modelCount && this.activateModel(e.sid), this.modelCount++, this.emit(a.ModelAdded)
  17469. }),
  17470. (n.prototype.getModel = function (e) {
  17471. return this.modelMap[e]
  17472. }),
  17473. (n.prototype.activateModel = function (e) {
  17474. var t = this.modelMap[e]
  17475. if (!t) throw new o('Tried to activate invalid model!')
  17476. var i = this.activeModel
  17477. ;(this.activeModel = t),
  17478. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17479. this.tileDownloader.setUrls(t.urls),
  17480. t.panos.forEach(
  17481. function (e) {
  17482. e.attachToPanoRenderer(this.panoRenderer), (e.tileDownloader = this.tileDownloader), (e.qualityManager = this.qualityManager)
  17483. }.bind(this)
  17484. ),
  17485. this.emit(a.ActiveModelChanged, {
  17486. oldModel: i,
  17487. model: t
  17488. })
  17489. }),
  17490. (n.prototype.getActiveModel = function () {
  17491. return this.activeModel
  17492. }),
  17493. r.extend(n, l),
  17494. (t.exports = n)
  17495. },
  17496. {
  17497. '../enum/ModelManagerEvents': 33,
  17498. '../enum/PanoRendererEvents': 35,
  17499. '../exception/BasicException': 55,
  17500. '../util/common': 185,
  17501. events: 202,
  17502. three: 217
  17503. }
  17504. ],
  17505. 141: [
  17506. function (r, l, e) {
  17507. ;(function (e) {
  17508. 'use strict'
  17509. function o() {
  17510. n.call(this)
  17511. }
  17512. var a = r('../objects/Room'),
  17513. t = (r('../settings'), r('../util/logger')),
  17514. i = (r('../util/transitions'), r('../util/easing'), r('../util/common')),
  17515. n = r('../util/IndexedCollection'),
  17516. s = r('./Chunks')
  17517. new t(e),
  17518. i.inherit(o, n),
  17519. (o.prototype.getIndex = function (e) {
  17520. return e.roomId
  17521. }),
  17522. (o.prototype.calcRoomBoundaries = function () {
  17523. this.forEach(function (e) {
  17524. e.calcBoundaries()
  17525. })
  17526. }),
  17527. (o.prototype.createFromChunks = function (e) {
  17528. var n = {
  17529. floorId: -1,
  17530. roomId: -1
  17531. },
  17532. r = {}
  17533. e.forEach(
  17534. function (e) {
  17535. s.parseIdsFromChunkName(e.name, n)
  17536. var t = r[n.roomId]
  17537. if (!t) {
  17538. var i = o.generateRoomId(n.floorId, n.roomId)
  17539. ;(t = new a(n.floorId, i)), this.add(t), (r[n.roomId] = t)
  17540. }
  17541. t.addChunk(e)
  17542. }.bind(this)
  17543. ),
  17544. this.calcRoomBoundaries()
  17545. }),
  17546. (o.generateRoomId = function (e, t) {
  17547. return e + '_' + t
  17548. }),
  17549. (l.exports = o)
  17550. }).call(this, '/js/model/RoomCollection.js')
  17551. },
  17552. {
  17553. '../objects/Room': 150,
  17554. '../settings': 166,
  17555. '../util/IndexedCollection': 175,
  17556. '../util/common': 185,
  17557. '../util/easing': 186,
  17558. '../util/logger': 189,
  17559. '../util/transitions': 195,
  17560. './Chunks': 135
  17561. }
  17562. ],
  17563. 142: [
  17564. function (e, t, i) {
  17565. 'use strict'
  17566. function n(e, t, i) {
  17567. var n = (e = e.clone().expandByScalar(0.01)).size(),
  17568. r = new o.BoxGeometry(n.x, n.y, n.z)
  17569. ;(r.boundingBox = e), o.Mesh.call(this, r, t), this.position.copy(e.center()), (this.frustumCulled = !1), i && this.add(new o.WireframeHelper(this))
  17570. }
  17571. var o = e('three')
  17572. ;((n.prototype = Object.create(o.Mesh.prototype)).constructor = n), (t.exports = n)
  17573. },
  17574. {
  17575. three: 217
  17576. }
  17577. ],
  17578. 143: [
  17579. function (l, c, e) {
  17580. ;(function (e) {
  17581. 'use strict'
  17582. function t(e) {
  17583. s.time('Computing a nice bounding cubemap')
  17584. var t = new r({
  17585. side: i.BackSide,
  17586. transparent: !0
  17587. })
  17588. ;(t.uniforms.modelAlpha.value = 0),
  17589. (t.uniforms.opacity.value = 1 - o.modelAlpha),
  17590. (this.renderOrder = a.boundingSkybox),
  17591. n.call(this, e, t),
  17592. s.timeEnd('Computing a nice bounding cubemap')
  17593. }
  17594. var i = l('three'),
  17595. n = (l('../enum/Viewmode'), l('../shaders'), l('./BoundingMesh')),
  17596. r = l('../materials/ModelTextureMaterial'),
  17597. o = l('../settings'),
  17598. a = l('../enum/RenderOrder'),
  17599. s = new (l('../util/logger'))(e)
  17600. ;((t.prototype = Object.create(n.prototype)).constructor = t), (c.exports = t)
  17601. }).call(this, '/js/objects/BoundingTextureSkybox.js')
  17602. },
  17603. {
  17604. '../enum/RenderOrder': 42,
  17605. '../enum/Viewmode': 51,
  17606. '../materials/ModelTextureMaterial': 118,
  17607. '../settings': 166,
  17608. '../shaders': 167,
  17609. '../util/logger': 189,
  17610. './BoundingMesh': 142,
  17611. three: 217
  17612. }
  17613. ],
  17614. 144: [
  17615. function (e, t, i) {
  17616. 'use strict'
  17617. function n(e) {
  17618. this.materialInside = new s({
  17619. side: r.DoubleSide
  17620. })
  17621. var t = r.UniformsUtils.clone(o.modelOutside.uniforms)
  17622. ;(this.materialOutside = new r.RawShaderMaterial({
  17623. fragmentShader: o.modelOutside.fragmentShader,
  17624. vertexShader: o.modelOutside.vertexShader,
  17625. uniforms: t,
  17626. side: r.FrontSide,
  17627. name: 'chunkOut'
  17628. })),
  17629. r.Mesh.call(this, e.geometry, this.materialInside),
  17630. (this.name = e.name || ''),
  17631. (this.textureName = e.textureName),
  17632. (this.meshUrl = e.meshUrl)
  17633. }
  17634. var r = e('three'),
  17635. o = e('../shaders'),
  17636. a = e('../enum/Viewmode'),
  17637. s = e('../materials/ModelTextureMaterial')
  17638. ;((n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function (e) {
  17639. ;(this.materialInside.uniforms.map.value = e), (this.materialOutside.uniforms.map.value = e)
  17640. }),
  17641. (n.prototype.setMode = function (e) {
  17642. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside
  17643. ;(t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide), (t.transparent = this.material.transparent), (t.uniforms.opacity.value = this.material.uniforms.opacity.value)
  17644. this.material = t
  17645. }),
  17646. (t.exports = n)
  17647. },
  17648. {
  17649. '../enum/Viewmode': 51,
  17650. '../materials/ModelTextureMaterial': 118,
  17651. '../shaders': 167,
  17652. three: 217
  17653. }
  17654. ],
  17655. 145: [
  17656. function (e, t, i) {
  17657. 'use strict'
  17658. function n(e) {
  17659. ;(this.chunksize = e || 10),
  17660. (this.chunks = {}),
  17661. (this.boundingBoxes = {}),
  17662. (this.children = []),
  17663. (this.offset = new m.Vector3(0, 0.5, 0)),
  17664. (this.material = new m.MeshBasicMaterial({
  17665. color: 16777215 * Math.random(),
  17666. side: m.DoubleSide
  17667. }))
  17668. }
  17669. var m = e('three')
  17670. e('../enum/Viewmode'),
  17671. (n.prototype.add = function (e) {
  17672. var t,
  17673. i,
  17674. n,
  17675. r,
  17676. o,
  17677. a,
  17678. s,
  17679. l,
  17680. c,
  17681. h,
  17682. u = e.attributes
  17683. u ? ((t = u.position.array), (i = void 0 !== e.index ? e.index.array : void 0)) : ((t = e.vertices), e.faces)
  17684. var d = new m.Vector3()
  17685. if (i)
  17686. for (n = 0, r = i.length; n < r; n += 3) {
  17687. var p = 3 * i[n],
  17688. f = 3 * i[n + 1],
  17689. g = 3 * i[n + 2]
  17690. ;(o = (t[p] + t[f] + t[g]) / 3),
  17691. (a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3),
  17692. (s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3),
  17693. (c =
  17694. (l = Math.floor(o / this.chunksize) + '.' + Math.floor(a / this.chunksize) + '.' + Math.floor(s / this.chunksize)) in this.chunks
  17695. ? ((h = this.chunks[l]), this.boundingBoxes[l])
  17696. : ((h = this.chunks[l] = []), (this.boundingBoxes[l] = new m.Box3()))),
  17697. h.push(t[p], t[1 + p], t[2 + p], t[f], t[1 + f], t[2 + f], t[g], t[1 + g], t[2 + g]),
  17698. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17699. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17700. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17701. }
  17702. else
  17703. for (n = 0, r = t.length; n < r; n += 9)
  17704. (o = (t[n] + t[n + 3] + t[n + 6]) / 3),
  17705. (a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3),
  17706. (s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3),
  17707. (c =
  17708. (l = Math.floor(o / this.chunksize) + '.' + Math.floor(a / this.chunksize) + '.' + Math.floor(s / this.chunksize)) in this.chunks
  17709. ? ((h = this.chunks[l]), this.boundingBoxes[l])
  17710. : ((h = this.chunks[l] = []), (this.boundingBoxes[l] = new m.Box3()))),
  17711. h.push(t[n], t[n + 1], t[n + 2], t[n + 3], t[n + 4], t[n + 5], t[n + 6], t[n + 7], t[n + 8]),
  17712. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17713. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17714. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17715. }),
  17716. (n.prototype.build = function () {
  17717. var e = new m.Object3D()
  17718. for (var t in ((e.material = this.material), this.chunks)) {
  17719. var i = this.chunks[t],
  17720. n = new m.BufferGeometry()
  17721. n.addAttribute('position', new m.BufferAttribute(new Float32Array(i), 3)), (n.boundingBox = this.boundingBoxes[t])
  17722. var r = new m.Mesh(n, this.material)
  17723. ;(r.material.visible = !1), e.add(r), (this.chunks[t] = [])
  17724. }
  17725. return e
  17726. }),
  17727. (t.exports = n)
  17728. },
  17729. {
  17730. '../enum/Viewmode': 51,
  17731. three: 217
  17732. }
  17733. ],
  17734. 146: [
  17735. function (e, t, i) {
  17736. 'use strict'
  17737. var n = e('three'),
  17738. r = e('../settings'),
  17739. o = e('../util/common'),
  17740. a = e('../util/lerp'),
  17741. s = e('./ChunkedCollider'),
  17742. l = e('../util/transitions'),
  17743. c = e('../util/easing'),
  17744. h = (e('../objects/Panorama'), e('../enum/RenderOrder'))
  17745. e('../localization/localize')
  17746. function u(e, t, i) {
  17747. n.Object3D.call(this),
  17748. (this.model = e),
  17749. (this.floorIndex = t),
  17750. (this.lang = r.languageTag),
  17751. (this.name = i || 'cn' === r.languageTag ? 'Floor ' + (t + 1) : '第' + (t + 1) + '层'),
  17752. (this.panos = []),
  17753. (this.chunks = []),
  17754. (this.colliderBuilder = new s(3)),
  17755. (this.collider = null),
  17756. (this.center = null),
  17757. (this.boundingBox = new n.Box3()),
  17758. (this.size = null),
  17759. (this.hidden = !1),
  17760. (this.conservativeBoundingBox = new n.Box3()),
  17761. (this.debugColor = 16777215 * Math.random()),
  17762. (this.transition = null)
  17763. }
  17764. ;((u.prototype = Object.create(n.Object3D.prototype)).enter = function (e) {
  17765. this.model.setFloor(this, e)
  17766. }),
  17767. (u.prototype.hide = function (e) {
  17768. if (!this.hidden || this.transition) {
  17769. this.chunks.forEach(function (e) {
  17770. e.material.transparent = !0
  17771. }),
  17772. l.cancel(this.transition)
  17773. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay,
  17774. i = e ? 0 : r.hideFloorDelay / t
  17775. this.transition = l.start(
  17776. a.allUniforms(this.chunks, 'opacity', 0.08),
  17777. t,
  17778. function () {
  17779. this.hidden = !0
  17780. }.bind(this),
  17781. i,
  17782. c.easeInOutQuad
  17783. )
  17784. }
  17785. }),
  17786. (u.prototype.show = function (e) {
  17787. if (this.hidden || this.transition) {
  17788. ;(this.hidden = !1), l.cancel(this.transition)
  17789. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay,
  17790. i = e ? 0 : r.showFloorDelay / t
  17791. this.transition = l.start(
  17792. a.allUniforms(this.chunks, 'opacity', 1),
  17793. t,
  17794. function () {
  17795. this.hidden ||
  17796. this.chunks.forEach(function (e) {
  17797. e.material.transparent = !1
  17798. })
  17799. }.bind(this),
  17800. i,
  17801. c.easeInOutQuad
  17802. )
  17803. }
  17804. }),
  17805. (u.prototype.toggle = function (e, t) {
  17806. ;(e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  17807. }),
  17808. (u.prototype.containsPoint = function (t) {
  17809. return this.collider.children.some(function (e) {
  17810. return e.geometry.boundingBox || e.geometry.computeBoundingBox(), e.geometry.boundingBox.containsPoint(t)
  17811. })
  17812. }),
  17813. (u.prototype.distanceToPoint = function (i) {
  17814. var n = null,
  17815. r = 1 / 0
  17816. return (
  17817. this.collider.children.forEach(function (e) {
  17818. e.geometry.boundingBox || e.geometry.computeBoundingBox()
  17819. var t = e.geometry.boundingBox.distanceToPoint(i)
  17820. ;(!n || t < r) && ((r = t), (n = e))
  17821. }),
  17822. r
  17823. )
  17824. }),
  17825. (u.prototype.addChunk = function (e) {
  17826. ;(e.renderOrder = h.ghostFloor),
  17827. this.add(e),
  17828. this.chunks.push(e),
  17829. this.boundingBox.union(e.geometry.boundingBox),
  17830. (this.size = this.boundingBox.size()),
  17831. this.colliderBuilder.add(e.geometry)
  17832. }),
  17833. (u.prototype.addPano = function (e) {
  17834. this.panos.push(e), this.add(e.skyboxMesh), e.marker && this.add(e.marker)
  17835. if (e.neighbourUUIDs && e.neighbourUUIDs.length) {
  17836. //add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  17837. var t = new n.Vector3(1, 1, 1),
  17838. i = new n.Box3().setFromCenterAndSize(e.position, t)
  17839. this.boundingBox.union(i)
  17840. }
  17841. }),
  17842. (u.prototype.build = function () {
  17843. ;(this.collider = this.colliderBuilder.build(!0)),
  17844. this.add(this.collider),
  17845. (this.center = this.boundingBox.center()),
  17846. this.conservativeBoundingBox.copy(this.boundingBox),
  17847. (this.conservativeBoundingBox.min.y = o.lowerMedian(
  17848. this.collider.children.map(function (e) {
  17849. return e.geometry.boundingBox.min.y
  17850. }),
  17851. 5
  17852. )),
  17853. (this.conservativeBoundingBox.max.y = o.lowerMedian(
  17854. this.collider.children.map(function (e) {
  17855. return e.geometry.boundingBox.max.y
  17856. }),
  17857. 5
  17858. )),
  17859. (this.colliderBuilder = null)
  17860. }),
  17861. (u.prototype.toShortString = function () {
  17862. return o.nth(this.floorIndex + 1)
  17863. }),
  17864. (u.prototype.toString = function () {
  17865. return this.name
  17866. }),
  17867. (t.exports = u)
  17868. },
  17869. {
  17870. '../enum/RenderOrder': 42,
  17871. '../localization/localize': 108,
  17872. './strings-cn-CN': 109,
  17873. '../objects/Panorama': 148,
  17874. '../settings': 166,
  17875. '../util/common': 185,
  17876. '../util/easing': 186,
  17877. '../util/lerp': 188,
  17878. '../util/transitions': 195,
  17879. './ChunkedCollider': 145,
  17880. three: 217
  17881. }
  17882. ],
  17883. 147: [
  17884. function (e, t, i) {
  17885. 'use strict'
  17886. function n(e) {
  17887. ;(this.player = e), (this.obj3d = null), (this.UP = new u.Vector3(0, 1, 0))
  17888. }
  17889. var u = e('three'),
  17890. d = e('../settings')
  17891. ;(n.prototype.prefs = {
  17892. linewidth: 3,
  17893. height: 0.07,
  17894. opacity: 0.45,
  17895. endScale: 0.05
  17896. }),
  17897. (n.prototype.discard = function () {
  17898. if (this.obj3d) {
  17899. var e = this.obj3d.parent
  17900. e && e.remove(this.obj3d)
  17901. }
  17902. this.obj3d = null
  17903. }),
  17904. (n.prototype.draw = function () {
  17905. if ((this.discard(), d.showNeighbors)) {
  17906. var e = this.player.currentPano.floor
  17907. this.obj3d = new u.Object3D()
  17908. var t = this.player.model.panos.getNeighbours(this.player.currentPano),
  17909. i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position)
  17910. i.y += this.prefs.height
  17911. var n = 0.1525,
  17912. r = new u.Matrix4()
  17913. for (var o in t)
  17914. if (t[o]) {
  17915. var a = this.player.model.panos.get(o),
  17916. s = (a.position.clone().sub(this.player.model.position), a.position.clone().sub(a.floorPosition)),
  17917. l = a.floorPosition.clone().sub(this.player.model.position)
  17918. l.y += this.prefs.height
  17919. var c = new u.Geometry()
  17920. c.vertices.push(new u.Vector3(0, -0.0127, 0), new u.Vector3(-0.0127, 0, 0), new u.Vector3(0, 0.0127, 0), new u.Vector3(0.0127, 0, 0), new u.Vector3(0, -0.0127, 0)),
  17921. c.vertices.push(
  17922. new u.Vector3(0, -0.255, 0),
  17923. new u.Vector3(0.255, -0.255, 0),
  17924. new u.Vector3(0.255, n, 0),
  17925. new u.Vector3(-n, n, 0),
  17926. new u.Vector3(-n, 0.127, 0),
  17927. new u.Vector3(-0.19, 0.1, 0),
  17928. new u.Vector3(-0.19, -0.2032, 0),
  17929. new u.Vector3(-n, -0.2286, 0),
  17930. new u.Vector3(-n, -0.255, 0),
  17931. new u.Vector3(0, -0.255, 0)
  17932. ),
  17933. r.identity().setPosition(s),
  17934. c.applyMatrix(r),
  17935. c.vertices.push(new u.Vector3(0, -this.prefs.endScale, 0)),
  17936. c.vertices.push(
  17937. new u.Vector3(-this.prefs.endScale, -this.prefs.endScale, 0),
  17938. new u.Vector3(-this.prefs.endScale, this.prefs.endScale, 0),
  17939. new u.Vector3(this.prefs.endScale, this.prefs.endScale, 0),
  17940. new u.Vector3(this.prefs.endScale, -this.prefs.endScale, 0)
  17941. ),
  17942. r.lookAt(l, i, this.UP).setPosition(l),
  17943. c.applyMatrix(r),
  17944. c.vertices.push(l, i)
  17945. var h = new u.Line(
  17946. c,
  17947. new u.LineBasicMaterial({
  17948. color: a.debugColor.getHex(),
  17949. transparent: !0,
  17950. opacity: this.prefs.opacity,
  17951. depthWrite: !1,
  17952. name: 'sLine' + o,
  17953. linewidth: this.prefs.linewidth
  17954. })
  17955. )
  17956. this.obj3d.add(h)
  17957. }
  17958. e.add(this.obj3d)
  17959. }
  17960. }),
  17961. (n.prototype.update = function () {
  17962. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  17963. }),
  17964. (t.exports = n)
  17965. },
  17966. {
  17967. '../settings': 166,
  17968. three: 217
  17969. }
  17970. ],
  17971. 148: [
  17972. function (S, M, e) {
  17973. ;(function (e) {
  17974. 'use strict'
  17975. function r(e, t, i, n) {
  17976. ;(this.model = e),
  17977. (this.id = t),
  17978. (this.alignmentType = i.alignmentType || c.ALIGNED),
  17979. (this.neighbourUUIDs = i.neighbours),
  17980. (this.neighbourPanos = null),
  17981. (this.floor = null),
  17982. (this.floorIndex = i.floor),
  17983. (this.failedLoadingAt = 0),
  17984. (this.maxLoadRetries = 4),
  17985. (this.origin = i.position.clone()),
  17986. (this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0, -5, 0) : i.position.clone()),
  17987. (this.quaternion = i.quaternion.clone()),
  17988. (this.skyboxMesh = new s.Mesh(E)),
  17989. this.skyboxMesh.position.copy(this.position),
  17990. this.skyboxMesh.quaternion.copy(this.quaternion),
  17991. (this.skyboxMesh.name = 'skybox'),
  17992. (this.skyboxMesh.visible = !1),
  17993. this.skyboxMesh.updateMatrix(),
  17994. this.skyboxMesh.updateMatrixWorld(),
  17995. (this.marker = null),
  17996. (this.showFloorMarker = this.showFloorMarker = !window.DATA.hideFloorMarker)
  17997. if (this.isAligned()) {
  17998. ;(this.marker = new s.Mesh(
  17999. _,
  18000. new s.MeshBasicMaterial({
  18001. map: b,
  18002. side: s.DoubleSide,
  18003. opacity: 0,
  18004. transparent: !0,
  18005. depthWrite: !1
  18006. })
  18007. )),
  18008. (this.marker.visible = false) //改:先不显示,之后根据opacity显示
  18009. ;(this.marker.renderOrder = l.panoMarker), (this.marker.name = 'marker'), (this.marker.pano = this).marker.layers.set(v.PANOMARKERS), this.marker.updateMatrixWorld()
  18010. if (!window.DATA.hideFloorMarker) {
  18011. //xzw
  18012. let opa = this.marker.material.opacity
  18013. Object.defineProperty(this.marker.material, 'opacity', {
  18014. get: function () {
  18015. return opa
  18016. },
  18017. set: o => {
  18018. opa = o
  18019. //if(o>0)console.log('o>0',this.pano.id)
  18020. convertTool.updateVisible(this.marker, 'hideWhenZeroOpa', o != 0)
  18021. }
  18022. })
  18023. }
  18024. a.colorMarkerOnLoad &&
  18025. this.on('load', function () {
  18026. this.marker.material.color.set(65280)
  18027. })
  18028. }
  18029. ;(this.debugColor = new s.Color().setHSL(0.06 + 0.53 * Math.random(), 0.8 + 0.2 * Math.random(), 0.5 + 0.2 * Math.random())),
  18030. (this.floorPosition = i.puck ? i.puck.clone() : null),
  18031. (this.tiled = n),
  18032. this.tiled
  18033. ? (this.solidSkybox = null)
  18034. : ((this.solidSkybox = new s.Texture([null, null, null, null, null, null])),
  18035. (this.solidSkybox.flipY = !1),
  18036. a.minimalMemoryMode && ((this.solidSkybox.minFilter = s.LinearFilter), (this.solidSkybox.magFilter = s.LinearFilter), (this.solidSkybox.generateMipmaps = !1))),
  18037. (this.zoomed = !1),
  18038. (this.panoRenderer = null),
  18039. (this.qualityManager = null),
  18040. (this.tileDownloader = null),
  18041. (this.tiledPanoRenderTarget = null),
  18042. (this.minimumTiledPanoLoaded = !1),
  18043. (this.highestPartialTileRenderOpCompleted = 0),
  18044. (this.highestFullTileRenderOpCompleted = 0),
  18045. (this.shouldRedrawOnBaseLoaded = !1),
  18046. (this.lockUntilRenderingComplete = !1),
  18047. a.colorMarkerOnLoad &&
  18048. this.on('load', function () {
  18049. this.marker.material.color.set(65280)
  18050. }),
  18051. (e = new s.TextureLoader()).setCrossOrigin(!0)
  18052. var r = e.load('images/texture.jpg')
  18053. if (
  18054. ((this.vrMarker = new s.Mesh(
  18055. new s.OctahedronGeometry(0.1, 0),
  18056. new s.MeshLambertMaterial({
  18057. color: 16777215,
  18058. transparent: !0,
  18059. opacity: 0.75,
  18060. map: r
  18061. })
  18062. )),
  18063. (this.vrMarker.boluoType = 'vr'),
  18064. (this.vrMarker.position.z = 1),
  18065. (this.vrMarker.enabled = !0),
  18066. (this.vrMarker.visible = !1),
  18067. (window.vrMarkers = window.vrMarkers || []),
  18068. window.vrMarkers.push(this.vrMarker),
  18069. this.marker && this.marker.add(this.vrMarker),
  18070. a.showAxis &&
  18071. (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0, 1, 0), new s.Vector3(0, 0, 0), 1, 255)),
  18072. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0, 0, 1), new s.Vector3(0, 0, 0), 1, 16711680)),
  18073. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1, 0, 0), new s.Vector3(0, 0, 0), 1, 65280))),
  18074. this.adjustAngleEnable)
  18075. ) {
  18076. ;(i = new s.Quaternion()).setFromAxisAngle(new s.Vector3(1, 0, 0), this.adjustAngleX), this.skyboxMesh.quaternion.multiply(i)
  18077. var o = new s.Quaternion()
  18078. o.setFromAxisAngle(new s.Vector3(0, 1, 0), this.adjustAngleY),
  18079. this.skyboxMesh.quaternion.multiply(o),
  18080. (n = new s.Quaternion()).setFromAxisAngle(new s.Vector3(0, 0, 1), this.adjustAngleZ),
  18081. this.skyboxMesh.quaternion.multiply(n),
  18082. this.skyboxMesh.updateMatrix(),
  18083. this.skyboxMesh.updateMatrixWorld(),
  18084. this.model.updateProjectedPanos()
  18085. }
  18086. }
  18087. var i,
  18088. t,
  18089. s = S('three'),
  18090. n = S('../util/logger'),
  18091. a = S('../settings'),
  18092. l = (S('../enum/Viewmode'), S('../enum/RenderOrder')),
  18093. c = S('../enum/AlignmentType'),
  18094. o = (S('../util/common'), S('../util/transitions')),
  18095. h = S('../util/lerp'),
  18096. u = S('../util/ajax'),
  18097. d = S('../util/texture'),
  18098. p = S('../util/panorama'),
  18099. f = (S('../enum/TileDownloaderEvents'), S('../enum/PanoramaEvents')),
  18100. g = S('../enum/PanoRendererEvents'),
  18101. m = S('../enum/PanoSizeClass'),
  18102. v = S('../enum/RenderLayers'),
  18103. y = (S('../scene/SceneRenderer'), S('../enum/GLCubeFaces'), S('../exception/BasicException')),
  18104. A = S('../tile/TileUtils'),
  18105. C = S('events').EventEmitter,
  18106. I = new n(e),
  18107. E = new s.SphereBufferGeometry(0.1),
  18108. _ = new s.PlaneBufferGeometry(0.35, 0.35, 1, 1),
  18109. b = d.load('images/marker.png')
  18110. b.anisotropy = 4 //add
  18111. ;((r.prototype = Object.create(C.prototype)).enter =
  18112. ((t = null),
  18113. function () {
  18114. this.setZoomed(!1),
  18115. this.emit('enter', {
  18116. oldPano: t,
  18117. newPano: this
  18118. }),
  18119. (t = this)
  18120. })),
  18121. (r.prototype.exit = function () {
  18122. this.tiled
  18123. ? (this.clearWaitDeferreds(),
  18124. (this.minimumTiledPanoLoaded = !1),
  18125. (this.tiledPanoRenderTarget = null),
  18126. this.setZoomed(!1),
  18127. this.panoRenderer.deactivateTiledPano(this),
  18128. (this.highestPartialTileRenderOpCompleted = 0),
  18129. (this.highestFullTileRenderOpCompleted = 0))
  18130. : (this.solidSkybox.dispose(), (this.solidSkybox.loaded = !1), (this.solidSkybox.version = 0)),
  18131. this.emit('exit')
  18132. }),
  18133. (r.prototype.hoverOn = function (e) {
  18134. this.marker &&
  18135. (o.start(h.property(this.marker.material, 'opacity', a[e].markerOpacityOnHover), 250), a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite('HIT', 12525854))
  18136. }),
  18137. (r.prototype.hoverOff = function (e) {
  18138. this.marker && o.start(h.property(this.marker.material, 'opacity', a[e].markerOpacity), 250)
  18139. }),
  18140. (r.prototype.build1 = function () {
  18141. ;(this.floor =
  18142. this.floor ||
  18143. this.model.floors.get(this.floorIndex) ||
  18144. (this.model.floors.list.length == 1 ? this.model.floors.list[0] : this.raycastToFindFloor()) ||
  18145. this.model.getFloorAtPoint(this.position)), //改
  18146. this.floor.addPano(this)
  18147. ;(this.floorPosition = this.floorPosition || this.raycastFloorPosition()),
  18148. (this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos()),
  18149. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  18150. this.neighbourUUIDs = this.neighbourUUIDs || [] //add
  18151. }),
  18152. (r.prototype.build2 = function () {
  18153. ;(this.floorPosition = this.floorPosition || this.interpolateFloorPosition()), (this.height = this.position.distanceTo(this.floorPosition)), this.placeMarker()
  18154. }),
  18155. (r.prototype.interpolateFloorPosition = function () {
  18156. var e = this.model.panos
  18157. .filter(r.filters.isNeighbourPanoTo(this))
  18158. .filter(function (e) {
  18159. return !!e.floorPosition
  18160. })
  18161. .sort(
  18162. function (e, t) {
  18163. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  18164. }.bind(this)
  18165. ),
  18166. t = this.position.clone()
  18167. return 2 <= e.length ? (t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2) : t.add(a.noMeshFloorPositionOffset), t
  18168. }),
  18169. (r.prototype.raycastFloorPosition = function () {
  18170. I.warn('Performance warning: Raycasting to find floor position')
  18171. var e = new s.Raycaster(this.position, new s.Vector3(0, -1, 0)).intersectObjects(this.model.colliders)
  18172. return e.length ? e[0].point : null
  18173. }),
  18174. (r.prototype.raycastToFindFloor =
  18175. ((i = [
  18176. new s.Vector3(0, -1, 0),
  18177. new s.Vector3(1, -1, 0),
  18178. new s.Vector3(0, -1, 1),
  18179. new s.Vector3(-1, -1, 0),
  18180. new s.Vector3(0, -1, -1),
  18181. new s.Vector3(1, 0, 0),
  18182. new s.Vector3(0, 0, 1),
  18183. new s.Vector3(-1, 0, 0),
  18184. new s.Vector3(0, 0, -1)
  18185. ]),
  18186. function () {
  18187. I.warn('Performance warning: Raycasting to find floor index')
  18188. for (var e = 0; e < i.length; e++) {
  18189. var t = new s.Raycaster(this.position.clone(), i[e].clone()).intersectObjects(this.model.colliders)
  18190. if (t.length) return t[0].object.parent.parent
  18191. }
  18192. return null
  18193. })),
  18194. (r.prototype.placeMarker = function () {
  18195. this.marker &&
  18196. (this.marker.position.copy(this.floorPosition),
  18197. (this.marker.position.y += 0.1), //经常有marker比地面低,所以多往上调5cm
  18198. this.marker.lookAt(new s.Vector3(0, 1, 0).add(this.marker.position)))
  18199. }),
  18200. (r.prototype.translate = function (e) {
  18201. this.position.add(e), this.floorPosition.add(e)
  18202. }),
  18203. (r.prototype.findClosestMidtpointPanoTo = function (e) {
  18204. return new s.Vector3().addVectors(this.position, e.position).divideScalar(2), this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  18205. }),
  18206. (r.prototype.attachToPanoRenderer = function (e) {
  18207. ;(this.panoRenderer = e),
  18208. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  18209. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  18210. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  18211. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  18212. })
  18213. var w,
  18214. T,
  18215. x = {}
  18216. ;(r.prototype.getWaitDeferred = function (e) {
  18217. var t = x[this.id]
  18218. t || ((t = {}), (x[this.id] = t))
  18219. var i = t[e]
  18220. return (
  18221. i ||
  18222. ((i = {
  18223. deferred: $.Deferred(),
  18224. active: !1
  18225. }),
  18226. (t[e] = i)),
  18227. i
  18228. )
  18229. }),
  18230. (r.prototype.resetWaitDeferred = function (e) {
  18231. var t = this.getWaitDeferred(e)
  18232. ;(t.active = !1), (t.deferred = $.Deferred())
  18233. }),
  18234. (r.prototype.clearWaitDeferreds = function () {
  18235. var e = x[this.id]
  18236. for (var t in (e || ((e = {}), (x[this.id] = e)), e))
  18237. if (e.hasOwnProperty(t)) {
  18238. var i = e[t]
  18239. ;(i.active = !1), (i.deferred = $.Deferred())
  18240. }
  18241. }),
  18242. (r.prototype.loadTiledPano =
  18243. (new s.Vector3(),
  18244. (w = []),
  18245. (T = []),
  18246. function (e, t, i, n, r, o) {
  18247. null != n || (n = !0), null != r || (r = !0)
  18248. var a = this.getWaitDeferred(e),
  18249. s = a.deferred,
  18250. l = null,
  18251. c = null
  18252. if ((i && ('number' == typeof i ? (l = i) : ((l = i.hFov), (c = i.vFov))), !this.isLoaded(e))) {
  18253. if (!a.active) {
  18254. if (((a.active = !0), i)) {
  18255. var h = A.matchingTilesInDirection(this, e, t, l, c)
  18256. ;(w[this.id + ':' + e] = {
  18257. tileCount: 0,
  18258. targetTileCount: h
  18259. }),
  18260. I.info('Loading partial pano: ' + this.id + ' with ' + h + ' tiles')
  18261. }
  18262. T[this.id] ||
  18263. ((T[this.id] = !0),
  18264. this.on(
  18265. f.LoadComplete,
  18266. function (e, t) {
  18267. var i = this.getWaitDeferred(e).deferred
  18268. i && 'pending' === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t), this.resetWaitDeferred(e))
  18269. }.bind(this)
  18270. ),
  18271. this.on(
  18272. f.LoadFailed,
  18273. function (e) {
  18274. var t = this.getWaitDeferred(e).deferred
  18275. t && 'pending' === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e), this.resetWaitDeferred(e))
  18276. }.bind(this)
  18277. ),
  18278. this.on(
  18279. f.TileLoaded,
  18280. function (e, t, i) {
  18281. var n = this.getWaitDeferred(e).deferred
  18282. if (n && 'pending' === n.state()) {
  18283. n.notify(e, t, i)
  18284. var r = w[this.id + ':' + e]
  18285. r && (r.tileCount++, r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0), n.resolve(e, i), this.resetWaitDeferred(e)))
  18286. }
  18287. }.bind(this)
  18288. ))
  18289. }
  18290. this.tileDownloader.clearForceQueue(),
  18291. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  18292. (this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n)),
  18293. this.panoRenderer.renderPanoTiles(this.id, t, r)
  18294. }
  18295. return s.promise()
  18296. })),
  18297. (r.prototype.onUploadAttemptedForAllTiles = function (e, t, i) {
  18298. e === this.id &&
  18299. t === this.qualityManager.getPanoSize(m.BASE) &&
  18300. this.shouldRedrawOnBaseLoaded &&
  18301. ((this.shouldRedrawOnBaseLoaded = !1), this.panoRenderer.resetRenderStatus(this.id, !0, !1), this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18302. }),
  18303. (r.prototype.onTileRendered = function (e, t, i, n) {
  18304. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18305. }),
  18306. (r.prototype.onPanoRendered = function (e, t, i, n) {
  18307. e === this.id &&
  18308. ((this.minimumTiledPanoLoaded = !0),
  18309. this.updateSkyboxForZoomLevel(),
  18310. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18311. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18312. this.emit('load', t),
  18313. this.model.emit('load', this),
  18314. this.emit(f.LoadComplete, t, i))
  18315. }),
  18316. (r.prototype.setZoomed = function (e) {
  18317. ;(this.zoomed = e), this.updateSkyboxForZoomLevel()
  18318. }),
  18319. (r.prototype.ensureSkyboxReadyForRender = function () {
  18320. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0), (this.solidSkybox.loaded = !0))
  18321. }),
  18322. (r.prototype.updateSkyboxForZoomLevel = function () {
  18323. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18324. }),
  18325. (r.prototype.getSkyboxTexture = function () {
  18326. return this.tiled ? (this.minimumTiledPanoLoaded ? (this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture) : null) : this.solidSkybox
  18327. }),
  18328. (r.prototype.onTileRenderFail = function (e, t, i) {
  18329. e === this.id && this.emit(f.LoadFailed, t)
  18330. }),
  18331. (r.prototype.isLoaded = function (e) {
  18332. if (this.tiled) {
  18333. if (e && 'string' == typeof e) throw new y('Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass')
  18334. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18335. }
  18336. if (e && 'number' == typeof e) throw new y('Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.')
  18337. return !!this.solidSkybox.high || e in this.solidSkybox
  18338. }),
  18339. (r.prototype.loadCube = function (a) {
  18340. if (this.isLoaded(a)) return I.info('Skipping load of pano, already loaded'), $.when()
  18341. this.emit('loading', a), this.model.emit('loading', this)
  18342. var n = p.getCubemapUrls(this.model.urls, this.id, a),
  18343. e = n.filter(function (e) {
  18344. return !e
  18345. })
  18346. 'low' === a && 0 < e.length && (I.info('Pano', this.id, 'not available in low res, loading high res right away'), (a = 'high'), (n = p.getCubemapUrls(this.model.urls, this.id, a)))
  18347. var t = 0,
  18348. i = [0, 1, 2, 3, 4, 5].map(
  18349. function (e, t, i) {
  18350. return u.getImage(n[t])
  18351. }.bind(this)
  18352. )
  18353. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(
  18354. function (e, t, i, n, r, o) {
  18355. return (
  18356. (this.solidSkybox[a] = [e, t, i, n, r, o]),
  18357. ('high' !== a && this.solidSkybox.high) || ((this.solidSkybox.image = this.solidSkybox[a]), (this.solidSkybox.low = null)),
  18358. (this.solidSkybox.needsUpdate = !0),
  18359. this.emit('load', a),
  18360. this.model.emit('load', this),
  18361. this
  18362. )
  18363. }.bind(this),
  18364. function () {
  18365. I.error('Downloading cubemap for pano', this.id, 'failed'), (this.failedLoadingAt = Date.now())
  18366. }.bind(this),
  18367. function () {
  18368. return $.when(++t, 6)
  18369. }
  18370. )
  18371. }),
  18372. (r.raycastsSkipped = 0),
  18373. (r.raycastsDone = 0),
  18374. (r.prototype.findNeighourPanos = function () {
  18375. return (
  18376. this.model.panos.setNeighbour(this.id, this.id, !1),
  18377. this.model.panos.forEach(
  18378. function (e) {
  18379. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18380. var t = this.position.distanceTo(e.position)
  18381. if (t > a.panoramaNeighbourMaxDistance) return this.model.panos.setNeighbour(this, e, !1), void r.raycastsSkipped++
  18382. var i = e.position.clone().sub(this.position).normalize(),
  18383. n = new s.Raycaster(this.position, i.clone(), 0, t).intersectObjects(this.model.colliders)
  18384. r.raycastsDone++,
  18385. this.model.panos.setNeighbour(this, e, 0 === n.length),
  18386. a.showNeighbourRaycasts &&
  18387. (n.length
  18388. ? this.floor.model.add(new s.ArrowHelper(i, this.position, n[0].distance, 16711680))
  18389. : this.floor.model.add(new s.ArrowHelper(i, this.position, t, 16777215, 0, 0)))
  18390. }
  18391. }.bind(this)
  18392. ),
  18393. this.model.panos.neighbourMap[this.id]
  18394. )
  18395. }),
  18396. (r.prototype.worldPosition = function () {
  18397. return this.position
  18398. }),
  18399. (r.prototype.addTextSprite = function (e, color, parent) {
  18400. this.removeTextSprite()
  18401. var ratio = 16
  18402. var i = document.createElement('canvas'),
  18403. n = i.getContext('2d')
  18404. ;(i.width = 1024), (i.height = i.width / ratio)
  18405. ;(n.font = ' 30px Arial'), (n.fillStyle = 'white')
  18406. var r = n.measureText(e).width
  18407. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2)
  18408. var o = new s.Texture(i)
  18409. o.needsUpdate = !0
  18410. var a = new s.SpriteMaterial({
  18411. map: o,
  18412. color: color || 16428055,
  18413. depthTest: false
  18414. })
  18415. this.text3d = new s.Sprite(a)
  18416. if (parent) {
  18417. parent.add(this.text3d)
  18418. } else {
  18419. this.text3d.position.copy(this.skyboxMesh.position)
  18420. this.floor.add(this.text3d)
  18421. }
  18422. var scale = 5
  18423. this.text3d.scale.y = scale / ratio
  18424. this.text3d.scale.x = scale
  18425. }),
  18426. (r.prototype.removeTextSprite = function () {
  18427. this.text3d && (this.text3d.parent.remove(this.text3d), this.text3d.material.map.dispose(), (this.text3d = null))
  18428. }),
  18429. (r.prototype.isAligned = function () {
  18430. return this.alignmentType === c.ALIGNED
  18431. }),
  18432. (r.filters = {
  18433. inDirection: function (t, i, n) {
  18434. return function (e) {
  18435. return e.position.clone().sub(t).normalize().dot(i) > n
  18436. }
  18437. },
  18438. inFloorDirection: function (t, i, n) {
  18439. return function (e) {
  18440. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18441. }
  18442. },
  18443. inPanoDirection: function (n, r, o) {
  18444. return (
  18445. (o = a.navigation.panoScores ? a.navigation.filterStrictness : o),
  18446. function (e) {
  18447. var t = e.floorPosition.clone().sub(n).normalize(),
  18448. i = e.position.clone().sub(n).normalize()
  18449. return t.dot(r) > o || i.dot(r) > o
  18450. }
  18451. )
  18452. },
  18453. atFloor: function (t) {
  18454. return function (e) {
  18455. return !t || e.floor === t
  18456. }
  18457. },
  18458. not: function (t) {
  18459. return function (e) {
  18460. return e !== t
  18461. }
  18462. },
  18463. notIn: function (t) {
  18464. return function (e) {
  18465. return -1 === t.indexOf(e)
  18466. }
  18467. },
  18468. isLoaded: function () {
  18469. return function (e) {
  18470. return e.isLoaded()
  18471. }
  18472. },
  18473. isNotLoaded: function () {
  18474. return function (e) {
  18475. return !e.isLoaded()
  18476. }
  18477. },
  18478. isCloseEnoughTo: function (t, i) {
  18479. return function (e) {
  18480. return t.distanceTo(e.floorPosition) < i
  18481. }
  18482. },
  18483. hasMinimumHeightDifferenceTo: function (t, i) {
  18484. return function (e) {
  18485. return Math.abs(e.position.y - t.y) > i
  18486. }
  18487. },
  18488. isNotBehindNormal: function (t, i) {
  18489. var n = new s.Vector3()
  18490. return (
  18491. (i = i.clone()),
  18492. function (e) {
  18493. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18494. }
  18495. )
  18496. },
  18497. isNeighbourPanoTo: function (t) {
  18498. return function (e) {
  18499. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18500. }
  18501. },
  18502. isNeighbourOfNeighbourTo: function (n) {
  18503. return function (i) {
  18504. return (
  18505. !!n.neighbourPanos[i.id] ||
  18506. n.neighbourUUIDs.some(function (e) {
  18507. var t = n.model.panos.get(e)
  18508. return !!t && t.neighbourPanos[i.id]
  18509. })
  18510. )
  18511. }
  18512. },
  18513. isNotRecentlyFailed: function (t) {
  18514. return function (e) {
  18515. return Date.now() - e.failedLoadingAt > t
  18516. }
  18517. },
  18518. isOnVisibleFloor: function () {
  18519. return function (e) {
  18520. return !e.floor.hidden
  18521. }
  18522. },
  18523. isPanoAligned: function () {
  18524. return function (e) {
  18525. return e.isAligned()
  18526. }
  18527. }
  18528. }),
  18529. (r.sortFunctions = {
  18530. distanceToPoint: function (i) {
  18531. return function (e, t) {
  18532. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18533. }
  18534. },
  18535. floorDistanceToPoint: function (i) {
  18536. return function (e, t) {
  18537. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18538. }
  18539. },
  18540. choose: function (i) {
  18541. return function (e, t) {
  18542. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18543. }
  18544. }
  18545. }),
  18546. (r.scoreFunctions = {
  18547. distance: function (t, i) {
  18548. return (
  18549. (i = i || a.navigation.distanceFactor),
  18550. function (e) {
  18551. return t ? t.position.distanceTo(e.position) * i : 0
  18552. }
  18553. )
  18554. },
  18555. distanceSquared: function (t, i) {
  18556. return (
  18557. (i = i || a.navigation.distanceFactor),
  18558. function (e) {
  18559. return t ? t.position.distanceToSquared(e.position) * i : 0
  18560. }
  18561. )
  18562. },
  18563. direction: function (t, i) {
  18564. return function (e) {
  18565. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18566. }
  18567. },
  18568. angle: function (t, i) {
  18569. return function (e) {
  18570. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18571. }
  18572. },
  18573. inFieldOfView: function (t, i) {
  18574. return function (e) {
  18575. return 0.75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18576. }
  18577. },
  18578. optionality: function (t) {
  18579. return function (e) {
  18580. return (
  18581. e.neighbourUUIDs.filter(function (e) {
  18582. return !(e in t.neighbourUUIDs) && e !== t.id
  18583. }).length * a.navigation.optionalityFactor
  18584. )
  18585. }
  18586. },
  18587. penalizeHeightDifferenceUnder: function (t, i) {
  18588. return function (e) {
  18589. return t.y - e.position.y < i ? -20 : 0
  18590. }
  18591. }
  18592. }),
  18593. (M.exports = r)
  18594. }).call(this, '/js/objects/Panorama.js')
  18595. },
  18596. {
  18597. '../enum/AlignmentType': 17,
  18598. '../enum/GLCubeFaces': 25,
  18599. '../enum/PanoRendererEvents': 35,
  18600. '../enum/PanoSizeClass': 36,
  18601. '../enum/PanoramaEvents': 37,
  18602. '../enum/RenderLayers': 41,
  18603. '../enum/RenderOrder': 42,
  18604. '../enum/TileDownloaderEvents': 45,
  18605. '../enum/Viewmode': 51,
  18606. '../exception/BasicException': 55,
  18607. '../scene/SceneRenderer': 158,
  18608. '../settings': 166,
  18609. '../tile/TileUtils': 174,
  18610. '../util/ajax': 181,
  18611. '../util/common': 185,
  18612. '../util/lerp': 188,
  18613. '../util/logger': 189,
  18614. '../util/panorama': 191,
  18615. '../util/texture': 194,
  18616. '../util/transitions': 195,
  18617. events: 202,
  18618. three: 217
  18619. }
  18620. ],
  18621. 149: [
  18622. function (e, t, i) {
  18623. 'use strict'
  18624. function n(e) {
  18625. var t = r.UniformsUtils.clone(c.waypoint.uniforms)
  18626. ;(t.map.value = d), (t.opacity.value = 0), t.color.value.set(o.reticuleColor), (t.showMouseMarker = !window.DATA.hideMouseMarker)
  18627. r.Mesh.call(
  18628. this,
  18629. new r.PlaneBufferGeometry(0.4, 0.4, 1, 1),
  18630. new r.RawShaderMaterial({
  18631. side: r.DoubleSide,
  18632. depthWrite: !1,
  18633. depthTest: !1,
  18634. transparent: !0,
  18635. vertexShader: c.waypoint.vertexShader,
  18636. fragmentShader: c.waypoint.fragmentShader,
  18637. uniforms: t,
  18638. name: 'waypoint',
  18639. opacity: 0,
  18640. visible: t.showMouseMarker
  18641. })
  18642. ),
  18643. this.layers.set(h.RETICULE),
  18644. (this.renderOrder = u.reticule),
  18645. (this.player = e),
  18646. (this.direction = new r.Vector3()),
  18647. (this.hidden = !0),
  18648. (this.mouseLastMoveTime = Date.now())
  18649. }
  18650. var r = e('three'),
  18651. o = e('../settings'),
  18652. a = e('../util/transitions'),
  18653. s = e('../util/texture'),
  18654. l = e('../util/lerp'),
  18655. c = e('../shaders'),
  18656. h = e('../enum/RenderLayers'),
  18657. u = e('../enum/RenderOrder'),
  18658. d = s.load('images/reticule.png')
  18659. d.anisotropy = 4 //各向异性
  18660. ;((n.prototype = Object.create(r.Mesh.prototype)).move = function (e, t, i) {
  18661. ;(this.hidden = i), (this.mouseLastMoveTime = Date.now())
  18662. }),
  18663. (n.prototype.hide = function () {
  18664. this.hidden || ((this.hidden = !0), a.start(l.property(this.material.uniforms.opacity, 'value', 0), o.reticuleOpacityTransitionTime))
  18665. }),
  18666. (n.prototype.show = function () {
  18667. ;(this.hidden = !1), this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, 'value', o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18668. }),
  18669. (n.prototype.update = function () {
  18670. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18671. }),
  18672. (n.prototype.updatePosition = function (e, t) {
  18673. if (!this.hidden) {
  18674. if (!t) return this.hide()
  18675. var i = t.point,
  18676. n = e.distanceTo(i),
  18677. r = 1 + 0.01 * n
  18678. n < 1 && (r -= 1 - n),
  18679. this.show(),
  18680. this.scale.set(r, r, r),
  18681. (this.direction = this.direction.multiplyScalar(0.8)),
  18682. this.direction.add(t.face.normal.clone().multiplyScalar(0.2)),
  18683. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(0.01)),
  18684. this.lookAt(this.position.clone().add(this.direction))
  18685. }
  18686. }),
  18687. (n.prototype.writeAstag = function () {
  18688. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16),
  18689. t = new Date()
  18690. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1
  18691. var i = {
  18692. enabled: !0,
  18693. version: '0',
  18694. created: t.toISOString(),
  18695. created_by: 'APITest',
  18696. position: this.position.clone(),
  18697. stem: {
  18698. enabled: o.tags.pole.enabled,
  18699. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18700. },
  18701. label: 'tag ' + this.tagCount,
  18702. description: 'Description ' + e,
  18703. floor: (function (e) {
  18704. if (e.currentFloor) {
  18705. var t = e.floors.indexOf(e.currentFloor)
  18706. return -1 < t ? t : void 0
  18707. }
  18708. })(this.player.model),
  18709. type: 'info',
  18710. metadata: {
  18711. preferred_camera: {
  18712. mode: this.player.mode
  18713. }
  18714. }
  18715. }
  18716. console.log('--------------------------'), console.log(JSON.stringify(i))
  18717. var n = this.player.model.addtag(e, i).build()
  18718. n && (n.disc && this.player.tagDiscs.push(n.disc), n.visible || n.show(o.tags.startup.fadeInDuration))
  18719. }),
  18720. (t.exports = n)
  18721. },
  18722. {
  18723. '../enum/RenderLayers': 41,
  18724. '../enum/RenderOrder': 42,
  18725. '../settings': 166,
  18726. '../shaders': 167,
  18727. '../util/lerp': 188,
  18728. '../util/texture': 194,
  18729. '../util/transitions': 195,
  18730. three: 217
  18731. }
  18732. ],
  18733. 150: [
  18734. function (e, t, i) {
  18735. 'use strict'
  18736. function n(e, t) {
  18737. ;(this.chunks = []), (this.floorId = e), (this.roomId = t), (this.position = new l.Vector3())
  18738. }
  18739. var l = e('three')
  18740. ;(n.prototype.addChunk = function (e) {
  18741. this.chunks.push(e)
  18742. }),
  18743. (n.prototype.calcBoundaries = function () {
  18744. for (var e = new l.Vector3(), t = new l.Vector3(0, 0, 0), i = new l.Vector3(0, 0, 0), n = new l.Vector3(0, 0, 0), r = 0, o = 0; o < this.chunks.length; o++) {
  18745. var a = this.chunks[o].geometry.attributes.position
  18746. if (a) for (var s = 0; s < a.array.length; s += 3) e.set(a.array[s], a.array[s + 1], a.array[s + 2]), t.add(e), 0 === s ? (i.copy(e), n.copy(e)) : (i.max(e), n.min(e)), r++
  18747. }
  18748. 0 < r ? (t.multiplyScalar(1 / r), (this.average = t)) : (this.average = null),
  18749. (this.boundsMax = i),
  18750. (this.boundsMin = n),
  18751. (this.center = new l.Vector3()),
  18752. this.center.copy(i).sub(n).multiplyScalar(0.5).add(n)
  18753. }),
  18754. (t.exports = n)
  18755. },
  18756. {
  18757. three: 217
  18758. }
  18759. ],
  18760. 151: [
  18761. function (o, v, e) {
  18762. ;(function (e) {
  18763. 'use strict'
  18764. function t(e, t, i) {
  18765. ;(this.obj3d = null),
  18766. (this.nodes = []),
  18767. (this.colorHull = []),
  18768. (this.shortPaths = {}),
  18769. (this.floorHull = null),
  18770. (this.cameraHull = null),
  18771. (this.floorPathDistance = 0),
  18772. (this.floorCurvePoints = null),
  18773. (this.floorCurveColors = null),
  18774. (this.camCurvePoints = null),
  18775. (this.warpDestHeroLoc = null),
  18776. (this.warpDestPano = null),
  18777. (this.warpPathPoints = null),
  18778. (this.warpPathLengths = [0]),
  18779. (this.warpLength = 0),
  18780. (this.closeWarpDistance = 4),
  18781. (this.UP = U.UP.clone()),
  18782. (this.longestStep = 0),
  18783. (this.upcomingTransType = null),
  18784. (this.burnsDir = 1),
  18785. (this.prevNextDist = 0),
  18786. (this.nextI = 0),
  18787. (this.activeTransType = null),
  18788. (this.lastTransType = null),
  18789. (this.bunnyObj = null),
  18790. (this.director = e),
  18791. (this.player = t),
  18792. (this.playerControls = i),
  18793. (this.modelManager = t.modelManager),
  18794. this.updateModel(),
  18795. this.updateDefaultsFromModelData(),
  18796. this.bindEvents(),
  18797. (this.warping = !1),
  18798. (this.waitingToWarp = !1),
  18799. (this.warpInterrupted = !1),
  18800. (this.warpInterruptionBlackoutStyle = null),
  18801. (this.warpInterruptionTravelTime = null)
  18802. }
  18803. var c,
  18804. h,
  18805. u,
  18806. d,
  18807. p,
  18808. f,
  18809. a,
  18810. s,
  18811. P = o('three'),
  18812. i = o('../util/logger'),
  18813. O = o('../enum/Viewmode'),
  18814. A = o('../enum/RenderOrder'),
  18815. L = o('../enum/WarpStyle'),
  18816. D = o('../settings'),
  18817. N = o('../util/math'),
  18818. F = o('../util/lerp'),
  18819. B = o('../util/easing'),
  18820. V = o('../util/transitions'),
  18821. l = o('../objects/Snapshot'),
  18822. k = o('../effects'),
  18823. C = o('../shaders'),
  18824. n = (o('../gui/gui'), o('../util/texture')),
  18825. U = o('../enum/Vectors'),
  18826. H = (o('../model/ModelManager'), new i(e)),
  18827. g = o('../enum/PlayerEvents'),
  18828. z = o('../enum/BlackoutStyle'),
  18829. r = o('../enum/ModelManagerEvents'),
  18830. m = o('../constants'),
  18831. I = {
  18832. path: n.loadBase64(
  18833. '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'
  18834. ),
  18835. pathEnd: n.load('images/End.png'),
  18836. pathStart: n.loadBase64(
  18837. '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=='
  18838. )
  18839. }
  18840. ;(t.prototype.setScene = function (e) {
  18841. this.createCpm(e), this.createBunnyObj(e)
  18842. }),
  18843. (t.prototype.updateModel = function () {
  18844. this.model = this.modelManager.getActiveModel()
  18845. }),
  18846. (t.prototype.bindEvents = function () {
  18847. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  18848. }),
  18849. (t.prototype.updateDefaultsFromModelData = function () {
  18850. this.model.data
  18851. }),
  18852. (t.prototype.pointPathDistance = function (e) {
  18853. for (var t = 0, i = 1; i < e.length; i += 1) t += e[i - 1].distanceTo(e[i])
  18854. return t
  18855. }),
  18856. (t.prototype.pointPathLengths = function (e) {
  18857. for (var t = [0], i = 1; i < e.length; i += 1) t.push(t[i - 1] + e[i - 1].distanceTo(e[i]))
  18858. return t
  18859. }),
  18860. (t.prototype.interpAlongPath = function (e, t, i) {
  18861. var n,
  18862. r = new P.Vector3(),
  18863. o = t[t.length - 1]
  18864. if (i < 1) {
  18865. n = i * o
  18866. for (var a = 1; a < t.length; a += 1)
  18867. if (t[a] > n) {
  18868. var s = (n - t[a - 1]) / (t[a] - t[a - 1])
  18869. return r.copy(e[a]), r.sub(e[a - 1]), r.multiplyScalar(s), r.add(e[a - 1]), r
  18870. }
  18871. } else r.copy(e[e.length - 1])
  18872. return r
  18873. }),
  18874. (t.prototype.pathHeight = function () {
  18875. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  18876. }),
  18877. (t.prototype.createBunnyObj = function (e) {
  18878. this.bunnyObj || ((this.bunnyObj = new P.AxisHelper(0.1)), (this.bunnyObj.visible = D.warp.showBunny)),
  18879. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18880. e.add(this.bunnyObj)
  18881. }),
  18882. (t.prototype.createCpm = function (e) {
  18883. if (!this.currentPanoMarker) {
  18884. var t = this.makeWaypointObj(I.pathEnd, 'Current')
  18885. ;(t.material.uniforms.opacity.value = 0),
  18886. (this.currentPanoMarker = {
  18887. mesh: t,
  18888. placed: !1
  18889. })
  18890. }
  18891. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18892. this.placeCpm(),
  18893. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18894. }),
  18895. (t.prototype.placeCpm = function () {
  18896. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18897. var e = this.player.currentPano.floor
  18898. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor &&
  18899. (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh), e.add(this.currentPanoMarker.mesh)),
  18900. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18901. (this.currentPanoMarker.mesh.position.y += this.pathHeight()),
  18902. (this.currentPanoMarker.placed = !0)
  18903. } else this.popOutCpm()
  18904. }),
  18905. (t.prototype.fadeInCpm = function (e) {
  18906. ;(this.player.mode === O.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned()) ||
  18907. (D.path.mapGuides && this.currentPanoMarker.placed && V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, 'value', 1), e))
  18908. }),
  18909. (t.prototype.fadeOutCpm = function (e) {
  18910. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, 'value', 0), e)
  18911. }),
  18912. (t.prototype.popInCpm = function () {
  18913. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  18914. }),
  18915. (t.prototype.popOutCpm = function () {
  18916. this.fadeOutCpm(2)
  18917. }),
  18918. (t.prototype.brushPrefs = {
  18919. linewidth: 7,
  18920. strokeWidth: 15,
  18921. cvSegments: 48,
  18922. paveStep: 0.1,
  18923. paveWidth: 0.2,
  18924. lookBlendDist: 3,
  18925. maxTurn: P.Math.degToRad(2)
  18926. }),
  18927. (t.prototype.panoPathDistance = function (e) {
  18928. var t = this.model.panos
  18929. if (!e || e.length < 2) return 0
  18930. for (var i = [], n = 0; n < e.length; n += 1) i.push(t.get(e[n]).floorPosition)
  18931. return this.pointPathDistance(i)
  18932. }),
  18933. (t.prototype.loadTileTexture = function (t) {
  18934. var e = n.load(
  18935. t,
  18936. function (e) {
  18937. ;(e.wrapS = P.RepeatWrapping), (e.wrapT = P.RepeatWrapping), (e.needsUpdate = !0), H.debug('path texture "' + t + '" is ready')
  18938. },
  18939. function () {
  18940. H.error('path texture "' + t + '" failed')
  18941. }
  18942. )
  18943. return (e.mapping = P.UVMapping), e
  18944. }),
  18945. (t.prototype.buildWarpDestinationDescriptor = function (e, t, i, n, r, o) {
  18946. return new l({
  18947. cameraMode: n,
  18948. position: e,
  18949. quaternion: t,
  18950. panoId: i,
  18951. orthoZoom: o,
  18952. floorVisibility: r,
  18953. thumbUrl: null,
  18954. name: null
  18955. })
  18956. }),
  18957. (t.prototype.buildWarpDestinationDescriptorFromHero = function (e) {
  18958. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  18959. }),
  18960. (t.prototype.setWarpDestination = function (e) {
  18961. this.warpDestHeroLoc = e
  18962. }),
  18963. (t.prototype.setWarpDestinationByHeroIndex = function (e) {
  18964. var t = this.getHeroDescriptorByHeroIndex(e)
  18965. return null !== t && (this.setWarpDestination(t), !0)
  18966. }),
  18967. (t.prototype.setWarpDestinationByPano = function (e, t) {
  18968. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  18969. }),
  18970. (t.prototype.setWarpDestinationByPanoId = function (e, t) {
  18971. var i = this.model.panos.get(e)
  18972. if (i) {
  18973. t = t || new P.Quaternion()
  18974. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, 'panorama', [], -1)
  18975. return this.setWarpDestination(n), !0
  18976. }
  18977. return !1
  18978. }),
  18979. (t.prototype.getHeroDescriptorByHeroIndex = function (e) {
  18980. var t = this.model.heroCount()
  18981. if (null !== this.warpDestHeroLoc && t < 1) return H.info('ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available.'), this.model.getHeroDescriptorByIndex(0)
  18982. var i = this.model.getHeroDescriptorByIndex(e)
  18983. if (i) {
  18984. var n = i.isPano() ? i.panoId : i.cameraMode
  18985. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + ' choices.')
  18986. }
  18987. return i
  18988. }),
  18989. (t.prototype.getHeroDescriptorByPano = function (e) {
  18990. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  18991. }),
  18992. (t.prototype.getHeroDescriptorByPanoId = function (e) {
  18993. var t = this.getHeroIndexFromPanoId(e)
  18994. return this.getHeroDescriptorByHeroIndex(t)
  18995. }),
  18996. (t.prototype.getHeroIndexFromPanoId = function (e) {
  18997. for (var t = 0; t < this.model.heroLocations.length; t++) {
  18998. var i = this.model.heroLocations[t],
  18999. n = this.getHeroId(i)
  19000. if (n && n === e) return t
  19001. }
  19002. return -1
  19003. }),
  19004. (t.prototype.getHeroPano = function (e) {
  19005. if (null === e) return H.warn('getHeroPano(): no destination'), null
  19006. var t = this.getHeroId(e),
  19007. i = this.model.panos.get(t)
  19008. return void 0 === i && ((i = null), '' !== t && H.debug('unable to find pano "' + t + '"')), i
  19009. }),
  19010. (t.prototype.getHeroId = function (e) {
  19011. return e.panoId
  19012. }),
  19013. (t.prototype.setWarpDestPano = function () {
  19014. return (this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc)), this.warpDestPano
  19015. }),
  19016. (t.prototype.brushToWarpPano = function (e, t) {
  19017. if ((this.discardPathObject(), !this.setWarpDestPano())) return !1
  19018. if ((this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn('Can only brush from pano to pano'), !this.warpDestPano)) return H.info('No brush'), !1
  19019. if (!this.player.currentPano) return H.debug('No current pano, visibility undefined'), !1
  19020. if (!this.warpDestPano) return H.info('No wPano, visibility undefined'), !1
  19021. if (!this.warpDestPano.isAligned()) return H.debug('Cannot brush to unaligned pano'), !1
  19022. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides,
  19023. n = !0
  19024. if (this.player.currentPano.id === this.warpDestPano.id) H.debug('Already at destination pano')
  19025. else {
  19026. ;(this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano)),
  19027. (n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1),
  19028. (this.obj3d = new P.Object3D()),
  19029. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ')'),
  19030. n
  19031. ? (H.info('No "walkable" route, using fall-back warp style transition'), (e = t))
  19032. : (this.setPathHulls(this.nodes),
  19033. this.setFloorCurves(),
  19034. i &&
  19035. ('chevron' === D.path.style
  19036. ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints))
  19037. : 'ribbon' === D.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))),
  19038. this.player.currentPano.floor.add(this.obj3d)
  19039. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN,
  19040. o = e === L.STD
  19041. if (!n && (i || o)) {
  19042. if (r) {
  19043. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints)
  19044. this.obj3d.add(a)
  19045. }
  19046. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1])
  19047. this.obj3d.add(s)
  19048. }
  19049. this.appearSlow()
  19050. }
  19051. return (this.upcomingTransType = e), !n
  19052. }),
  19053. (t.prototype.findShortestPath = function (e, t) {
  19054. if (!e || !t) return null
  19055. var i = D.warp.walkExtraPanosDistance,
  19056. n = e.id + ':' + t.id + ':' + i
  19057. if (this.shortPaths.hasOwnProperty(n)) return this.shortPaths[n] ? this.shortPaths[n].slice() : null
  19058. var r = t.id + ':' + e.id + ':' + i
  19059. if (this.shortPaths.hasOwnProperty(r)) return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null
  19060. var o = this.model.panos.aStarSearch(e, t)
  19061. return this.model.panos.includeNodesNearPath(o, i), (this.shortPaths[n] = o ? o.slice() : null), o
  19062. }),
  19063. (t.prototype.makePathHulls = function (e) {
  19064. var t,
  19065. i,
  19066. n,
  19067. r,
  19068. o,
  19069. a = 0,
  19070. s = [],
  19071. l = [],
  19072. c = [],
  19073. h = this.model.panos
  19074. r = (t = h.get(e[0])).floor.floorIndex
  19075. for (var u = 0; u < e.length; u += 1)
  19076. ((i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight()),
  19077. s.push(i),
  19078. l.push(t.position.clone()),
  19079. (n = t.floor.floorIndex),
  19080. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  19081. 0 < u && a < (o = l[u].distanceTo(l[u - 1])) && (a = o)
  19082. return (
  19083. a > this.longestStep && ((this.longestStep = a), H.debug('path contains ' + a + ' meter segment')),
  19084. {
  19085. floor: s,
  19086. camera: l,
  19087. color: c
  19088. }
  19089. )
  19090. }),
  19091. (t.prototype.makeFloorCurves = function (e, t, i) {
  19092. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius,
  19093. r = this.pointPathDistance(e) - 2 * n,
  19094. o = e.slice(0),
  19095. a = o[1].clone().sub(o[0])
  19096. ;(a.y = 0),
  19097. a.normalize().multiplyScalar(n),
  19098. (o[0] = new P.Vector3().copy(o[0]).add(a)),
  19099. ((a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0),
  19100. a.normalize().multiplyScalar(n),
  19101. (o[o.length - 1] = new P.Vector3().copy(o[o.length - 1]).add(a))
  19102. var s = new P.CatmullRomCurve3(o),
  19103. l = Math.floor(r / i)
  19104. ;(l = 4 * Math.floor(l / 4)), (l = Math.max(4, l))
  19105. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3(), f = 0; f < u.length; f += 1) {
  19106. ;(h = 0), (c = u[f].distanceTo(e[0]))
  19107. for (var g = 1; g < e.length; g += 1) p.copy(u[f]).sub(e[g]), (p.y *= 4), p.length() < c && (h = g)
  19108. d.push(t[h])
  19109. }
  19110. return {
  19111. distance: r,
  19112. points: u,
  19113. colors: d
  19114. }
  19115. }),
  19116. (t.prototype.makeCameraCurvePoints = function (e, t) {
  19117. var i = this.pointPathDistance(e)
  19118. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  19119. }),
  19120. (t.prototype.makeCameraCurveTangents = function (e, t) {
  19121. var i = this.pointPathDistance(e),
  19122. n = new P.CatmullRomCurve3(e),
  19123. r = Math.max(2, Math.floor(i / t))
  19124. r = r || 5
  19125. for (var o = [], a = 0; a <= r; a++) o.push(n.getTangentAt(a / r))
  19126. return o
  19127. }),
  19128. (t.prototype.setPathHulls = function (e) {
  19129. var t = this.makePathHulls(e)
  19130. ;(this.floorHull = t.floor), (this.cameraHull = t.camera), (this.colorHull = t.color)
  19131. }),
  19132. (t.prototype.setFloorCurves = function () {
  19133. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep)
  19134. ;(this.floorPathDistance = e.distance), (this.floorCurvePoints = e.points), (this.floorCurveColors = e.colors)
  19135. }),
  19136. (t.prototype.setCameraCurvePoints = function () {
  19137. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  19138. }),
  19139. (t.prototype.chooseWarpPath = function (e) {
  19140. var t,
  19141. i,
  19142. n,
  19143. r = this.playerControls.cameras[O.PANORAMA]
  19144. if (this.player.currentPano === this.warpDestPano || !e) return (this.warpPathPoints = null), (this.warpLength = 0), !1
  19145. ;(this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano)),
  19146. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1
  19147. ? (H.debug('warp path to unreachable node'),
  19148. (i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate()),
  19149. t.multiplyScalar(0.15).add(r.position),
  19150. i.multiplyScalar(0.15).add(this.warpDestPano.position),
  19151. (t.y = r.position.y),
  19152. (i.y = this.warpDestPano.position.y),
  19153. (n = new P.CubicBezierCurve3(r.position.clone(), t, i, this.warpDestPano.position.clone())),
  19154. (this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)))
  19155. : (H.debug('follow warp path (path distance was ' + this.nodes.length + ' nodes, ' + this.floorPathDistance + ')'),
  19156. this.setCameraCurvePoints(),
  19157. (this.warpPathPoints = this.camCurvePoints.slice(0))),
  19158. (this.warpLength = 0),
  19159. (this.warpPathLengths = [0])
  19160. for (
  19161. var o = new P.Vector3(), a = new P.Vector3(), s = Math.cos(P.Math.degToRad(D.warp.minBrakeAngle)), l = Math.cos(P.Math.degToRad(D.warp.maxBrakeAngle)), c = 1;
  19162. c < this.warpPathPoints.length;
  19163. c += 1
  19164. ) {
  19165. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c])
  19166. var h = o.length()
  19167. o.y *= D.warp.climbEffort
  19168. var u = o.length() / h
  19169. if (1 < c) {
  19170. o.setY(0).normalize(),
  19171. a
  19172. .copy(this.warpPathPoints[c - 2])
  19173. .sub(this.warpPathPoints[c - 1])
  19174. .setY(0)
  19175. .normalize()
  19176. var d = Math.min(1, o.dot(a)),
  19177. p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s))
  19178. u = Math.max(p, u)
  19179. }
  19180. ;(this.warpLength += h * u), (this.warpPathLengths[c] = this.warpLength)
  19181. }
  19182. return !0
  19183. }),
  19184. (t.prototype.drawPathRibbon = function (e, t) {
  19185. this.bunnyObj.visible = D.warp.showBunny
  19186. for (var i = 0.6 * D.path.ribbonWidth * 0.5, n = new P.Vector3(), r = new P.Vector3(0, this.pathHeight(), 0), o = new P.Geometry(), a = new P.Vector3(), s = 0; s < e.length; s += 1) {
  19187. a.copy(e[s]), 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(), a.normalize(), n.crossVectors(a, U.UP), n.multiplyScalar(i)
  19188. var l = new P.Vector3().copy(e[s]).add(r)
  19189. l.sub(n), o.vertices.push(l), (l = new P.Vector3().copy(e[s]).add(r)).add(n), o.vertices.push(l)
  19190. }
  19191. var c,
  19192. h,
  19193. u,
  19194. d = 0
  19195. for (s = 0; s < e.length - 1; s += 1) {
  19196. var p = 2 * s,
  19197. f = d,
  19198. g = (d += e[s + 1].distanceTo(e[s])),
  19199. m = t[s],
  19200. v = t[s + 1]
  19201. ;((c = new P.Face3(p, 1 + p, 2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)]),
  19202. o.faces.push(c),
  19203. o.faceVertexUvs[0].push([new P.Vector2(0, f), new P.Vector2(1, f), new P.Vector2(0, g)]),
  19204. ((c = new P.Face3(2 + p, 1 + p, 3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)]),
  19205. o.faces.push(c),
  19206. o.faceVertexUvs[0].push([new P.Vector2(0, g), new P.Vector2(1, f), new P.Vector2(1, g)])
  19207. }
  19208. o.computeFaceNormals(),
  19209. o.computeVertexNormals(),
  19210. (h =
  19211. this.player.mode === O.PANORAMA
  19212. ? (((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path),
  19213. (u.opacity.value = 0),
  19214. u.color.value.set(D.path.color),
  19215. new P.RawShaderMaterial({
  19216. side: P.DoubleSide,
  19217. depthWrite: !1,
  19218. transparent: !0,
  19219. vertexShader: C.ribbon.vertexShader,
  19220. fragmentShader: C.ribbon.fragmentShader,
  19221. uniforms: u,
  19222. name: 'ribbonT',
  19223. opacity: 0
  19224. }))
  19225. : new P.MeshBasicMaterial({
  19226. color: 16777215,
  19227. side: P.DoubleSide,
  19228. name: 'ribbonOut',
  19229. vertexColors: P.VertexColors
  19230. }))
  19231. var y = new P.Mesh(o, h)
  19232. return (y.name = 'ribbon'), this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon), y
  19233. }),
  19234. (t.prototype.drawPathPavement = function (e) {
  19235. for (var t, i = new P.Vector3(), n = new P.Geometry(), r = new P.Vector3(), o = 0; o < e.length; o += 1)
  19236. r.copy(e[o]),
  19237. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  19238. r.normalize(),
  19239. i.crossVectors(r, U.UP),
  19240. i.multiplyScalar(this.brushPrefs.paveWidth),
  19241. (t = new P.Vector3().copy(e[o])).sub(i),
  19242. n.vertices.push(t),
  19243. n.vertices.push(new P.Vector3().copy(e[o])),
  19244. (t = new P.Vector3().copy(e[o])).add(i),
  19245. n.vertices.push(t)
  19246. var a, s, l
  19247. for (o = 0; o < e.length - 1; o += 1)
  19248. (a = 3 * o + 1),
  19249. (l = 0.25 + (s = 0.25 * o)),
  19250. n.faces.push(new P.Face3(a - 1, a, 3 + a)),
  19251. n.faceVertexUvs[0].push([new P.Vector2(0, s), new P.Vector2(0.5, s), new P.Vector2(0.5, l)]),
  19252. n.faces.push(new P.Face3(3 + a, 2 + a, a - 1)),
  19253. n.faceVertexUvs[0].push([new P.Vector2(0.5, l), new P.Vector2(0, l), new P.Vector2(0, s)]),
  19254. n.faces.push(new P.Face3(3 + a, a, 1 + a)),
  19255. n.faceVertexUvs[0].push([new P.Vector2(0.5, l), new P.Vector2(0.5, s), new P.Vector2(1, s)]),
  19256. n.faces.push(new P.Face3(3 + a, 1 + a, 4 + a)),
  19257. n.faceVertexUvs[0].push([new P.Vector2(0.5, l), new P.Vector2(1, s), new P.Vector2(1, l)])
  19258. var c =
  19259. this.player.mode === O.PANORAMA
  19260. ? new P.MeshBasicMaterial({
  19261. color: D.path.color,
  19262. side: P.DoubleSide,
  19263. transparent: !0,
  19264. depthWrite: !1,
  19265. opacity: 0,
  19266. name: 'paveT',
  19267. map: I.path
  19268. })
  19269. : new P.MeshBasicMaterial({
  19270. color: D.path.color,
  19271. side: P.DoubleSide,
  19272. transparent: !0,
  19273. depthWrite: !1,
  19274. opacity: 1,
  19275. name: 'paveO',
  19276. map: I.path
  19277. })
  19278. return new P.Mesh(n, c)
  19279. }),
  19280. (t.prototype.hintPrefs = {
  19281. rad: 0.18,
  19282. width: 0.0125,
  19283. depth: 0.0625,
  19284. setBack: -0.04,
  19285. markRad: 0.25,
  19286. markInnerRad: 0.16
  19287. }),
  19288. (t.prototype.makeWaypointObj = function (e, t) {
  19289. var i = new P.Geometry(),
  19290. n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius,
  19291. r = this.pathHeight()
  19292. i.vertices.push(new P.Vector3(-n, r, n), new P.Vector3(-n, r, -n), new P.Vector3(n, r, -n), new P.Vector3(n, r, n)),
  19293. i.faces.push(new P.Face3(0, 1, 2), new P.Face3(2, 3, 0)),
  19294. i.faceVertexUvs[0].push([new P.Vector2(0, 0), new P.Vector2(1, 0), new P.Vector2(1, 1)]),
  19295. i.faceVertexUvs[0].push([new P.Vector2(1, 1), new P.Vector2(0, 1), new P.Vector2(0, 0)])
  19296. var o = P.UniformsUtils.clone(C.waypoint.uniforms)
  19297. ;(o.map.value = e), (o.opacity.value = 0), o.color.value.set(D.path.color)
  19298. var a = {
  19299. side: P.DoubleSide,
  19300. depthWrite: !1,
  19301. transparent: !0,
  19302. vertexShader: C.waypoint.vertexShader,
  19303. fragmentShader: C.waypoint.fragmentShader,
  19304. uniforms: o,
  19305. name: 'waypoint',
  19306. opacity: 0
  19307. }
  19308. this.player.mode !== O.PANORAMA && ((a.depthTest = !1), (a.name = 'wayPtOut'))
  19309. var s = new P.RawShaderMaterial(a),
  19310. l = new P.Mesh(i, s)
  19311. return (l.name = t), l
  19312. }),
  19313. (t.prototype.makeStartMarker = function (e, t) {
  19314. var i = new P.Vector3().copy(t[1]).sub(t[0])
  19315. ;(i.y = 0), i.normalize()
  19316. var n = Math.acos(i.x),
  19317. r = this.makeWaypointObj(I.pathStart, 'Start')
  19318. return r.rotateOnAxis(new P.Vector3(0, 1, 0), n), r.position.copy(e), r
  19319. }),
  19320. (t.prototype.makeEndMarker = function (e) {
  19321. var t = this.makeWaypointObj(I.pathEnd, 'End'),
  19322. i = this.model.panos.get(this.nodes[0]).floor.floorIndex,
  19323. n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex
  19324. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown), t.position.copy(e), t
  19325. }),
  19326. (t.prototype.pathClean = function (e) {
  19327. if (e) {
  19328. for (var t in e.children) this.pathClean(e.children[t])
  19329. e.geometry && e.geometry.dispose(), e.material && e.material.dispose()
  19330. }
  19331. }),
  19332. (t.prototype.discardPathObject = function () {
  19333. if (this.obj3d) {
  19334. var e = this.obj3d.parent
  19335. e && e.remove(this.obj3d), this.pathClean(this.obj3d)
  19336. }
  19337. ;(this.obj3d = null), this.popInCpm()
  19338. }),
  19339. (t.prototype.discardSlow = function () {
  19340. if (this.obj3d) {
  19341. if (this.player.mode !== O.PANORAMA) return void this.discardPathObject()
  19342. for (
  19343. var e,
  19344. t = 0,
  19345. i = function () {
  19346. this.discardPathObject()
  19347. }.bind(this),
  19348. n = 0;
  19349. n < this.obj3d.children.length;
  19350. n += 1
  19351. )
  19352. void 0 !== (e = this.obj3d.children[n]).material &&
  19353. !0 === e.material.transparent &&
  19354. (void 0 !== e.material.uniforms
  19355. ? V.start(F.property(e.material.uniforms.opacity, 'value', 0), D.path.fadeOutTime, i, 0, B[D.warp.blendEasing])
  19356. : V.start(F.property(e.material, 'opacity', 0), D.path.fadeOutTime, i, 0, B[D.warp.blendEasing]),
  19357. (t += 1),
  19358. (i = null))
  19359. 0 === t && this.discardPathObject(), this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  19360. }
  19361. }),
  19362. (t.prototype.appearSlow = function () {
  19363. var e
  19364. this.fadeOutCpm(D.path.fadeInTime)
  19365. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  19366. void 0 !== (e = this.obj3d.children[i]).material &&
  19367. !0 === e.material.transparent &&
  19368. (void 0 !== e.material.uniforms
  19369. ? V.start(F.property(e.material.uniforms.opacity, 'value', t), D.path.fadeInTime, null, 0, B[D.warp.blendEasing])
  19370. : V.start(F.property(e.material, 'opacity', t), D.path.fadeInTime, null, 0, B[D.warp.blendEasing]))
  19371. }),
  19372. (t.prototype.update = function () {
  19373. this.obj3d && this.obj3d.updateMatrixWorld()
  19374. }),
  19375. (t.prototype.calcBurnsAmount = function (e) {
  19376. var n = P.Math.degToRad(D.warp.burnsAngle)
  19377. if (this.player.mode !== O.PANORAMA) return this.player.mode === O.DOLLHOUSE ? 0.02 * this.burnsDir : this.burnsDir
  19378. var t = this.burnsDir * n
  19379. if (this.upcomingTransType === L.BLACK) return t
  19380. var i = e
  19381. if (null === i) return H.warn('Transition request for non-highlight'), t
  19382. var r = this.getHeroDescriptorByHeroIndex(i)
  19383. if (null === r) return t
  19384. if (!r.isPano()) return t
  19385. function o(e) {
  19386. var t = Math.acos(Math.min(1, e.dot(l))),
  19387. i = new P.Vector3().crossVectors(l, e)
  19388. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19389. }
  19390. var a = this.getHeroPano(r),
  19391. s = this.playerControls.cameras[O.PANORAMA],
  19392. l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize(),
  19393. c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n)
  19394. if (a === this.player.currentPano) return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize())
  19395. var h = this.findShortestPath(this.player.currentPano, a)
  19396. if (null == h || h.length < 1) return H.debug('Empty path ahead...'), t
  19397. var u = this.makePathHulls(h),
  19398. d = new P.CatmullRomCurve3(u.camera),
  19399. p = Math.min(0.1, D.warp.lookAheadDist / d.getLength())
  19400. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19401. }),
  19402. (t.prototype.waitNextStep = function (e, t, i) {
  19403. var o = null == i ? D.warp.tourStepDelay : i
  19404. o = o != void 0 ? o : this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault
  19405. var a = new P.Euler(),
  19406. s = new P.Vector3()
  19407. H.debug('Starting wait: ' + (void 0 !== t))
  19408. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem) //this.model.heroLocations[this.director.currentItem[0]]
  19409. var l = currentLocation.dontRot || this.calcBurnsAmount(e),
  19410. c = function () {
  19411. this.endWarpState(), this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0), t && t()
  19412. }.bind(this),
  19413. n = function (e, t) {
  19414. if (this.warpInterrupted) return c(), !0
  19415. var i = t || 1e3 / 60
  19416. if (D.warp.doBurns && !currentLocation.dontRot)
  19417. if (this.player.mode === O.PANORAMA) {
  19418. var n = this.playerControls.cameras[O.PANORAMA]
  19419. a.setFromQuaternion(n.quaternion, D.warp.eOrder)
  19420. var r = o == 0 ? l : (i * l) / o
  19421. r = Math.sign(r) * Math.max(r, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  19422. ;(a.y += r), s.set(0, 0, -1), s.applyEuler(a), s.add(n.position), n.controls.lookAt(s), n.controls.lookVector.copy(s), n.lookAt(s)
  19423. } else
  19424. this.player.mode === O.DOLLHOUSE ? (this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l) : (this.playerControls.controls[O.FLOORPLAN].absoluteScale *= 0.9996)
  19425. }.bind(this)
  19426. this.startWarpState(), V.start(n, o, c, 0, B.easeInOutQuad, 'wait')
  19427. }),
  19428. (t.prototype.warpToNonPano = function (e) {
  19429. if ((this.discardPathObject(), this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN)) {
  19430. var t = function () {
  19431. e && e()
  19432. }.bind(this)
  19433. this.player.flyToNewMode({
  19434. mode: this.warpDestHeroLoc.cameraMode,
  19435. duration: D.warp.outsideTime,
  19436. warpDest: this.warpDestHeroLoc,
  19437. callback: t,
  19438. force: !0
  19439. })
  19440. } else H.warn('no warp destination!!!'), e && e()
  19441. }),
  19442. (t.prototype._resetWarpShaderParams = function (e) {
  19443. this.player.mode === O.PANORAMA &&
  19444. (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0), void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19445. }),
  19446. (t.prototype._clearWarpShading = function () {
  19447. for (var e = this.model.chunks, t = 0; t < e.length; t += 1) this._resetWarpShaderParams(e[t]), (e[t].visible = !0)
  19448. this._resetWarpShaderParams(this.model.skybox)
  19449. }),
  19450. (t.prototype._warpStopFlying = function () {
  19451. ;(this.activeTransType = null), this.placeCpm()
  19452. }),
  19453. (t.prototype._wrapupTravelOnlyBits = function () {
  19454. this._warpStopFlying(),
  19455. this.warpPathPoints && (this.player.currentPano.exit(), this.warpDestPano.enter(), (this.player.currentPano = this.warpDestPano)),
  19456. this.player.spider.draw(),
  19457. this.placeCpm()
  19458. }),
  19459. (t.prototype._wrapupTravel = function (e) {
  19460. this._wrapupTravelOnlyBits(), this.warpCameraAim(e)
  19461. }),
  19462. (t.prototype._wrapupWarpShading = function (e) {
  19463. this._clearWarpShading(), this._wrapupTravel(e)
  19464. }),
  19465. (t.prototype.wrapupWarpShadingOnly = function (e, t) {
  19466. t !== z.END && this._clearWarpShading(), this._wrapupTravelOnlyBits(), (this.upcomingTransType = null), e && e()
  19467. }),
  19468. (t.prototype._warpCameraAim = function (e, t) {
  19469. var i = this.warpDestHeroLoc.quaternion,
  19470. n = this.playerControls.cameras[O.PANORAMA],
  19471. r = new P.Vector3(0, 0, 1).applyQuaternion(i).normalize(),
  19472. o = new P.Vector3(0, 0, 1).applyQuaternion(n.quaternion).normalize().dot(r),
  19473. a = P.Math.radToDeg(Math.acos(o)),
  19474. s = new P.Euler(0, 0, 0, D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder),
  19475. l = new P.Euler().setFromQuaternion(n.quaternion, D.warp.eOrder),
  19476. c = new P.Euler(s.x - l.x, s.y - l.y, s.z - l.z, D.warp.eOrder)
  19477. ;(c.y = N.constrainedTurn(c.y)), (this.burnsDir = Math.sign(c.y))
  19478. var h = new P.Euler(0, 0, 0, D.warp.eOrder),
  19479. u = new P.Vector3(),
  19480. d = function (e, t) {
  19481. return (
  19482. !!this.warpInterrupted ||
  19483. ((h.x = l.x + e * c.x),
  19484. (h.y = l.y + e * c.y),
  19485. (h.z = l.z + e * c.z),
  19486. u.set(0, 0, -1),
  19487. u.applyEuler(h),
  19488. u.add(n.position),
  19489. n.controls.lookAt(u),
  19490. n.controls.lookVector.copy(u),
  19491. void n.lookAt(u))
  19492. )
  19493. }.bind(this)
  19494. /* return a > D.warp.minRotation ? (V.start(d, e, t, 0, B[D.warp.movementEasing])
  19495. , (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19496. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19497. )
  19498. : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19499. void (t && t())) */
  19500. this.warpDestHeroLoc.zoom != this.player.zoomLevel && //add 原地转向最终方位时
  19501. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom, e)
  19502. return a > D.warp.minRotation
  19503. ? V.start(d, e, t, 0, B[D.warp.movementEasing])
  19504. : /* H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim") ,*/
  19505. void (t && t())
  19506. }),
  19507. (t.prototype._warpBendAim = function (e, t, i, n) {
  19508. var r = n || 0,
  19509. o = this.playerControls.cameras[O.PANORAMA],
  19510. a = new P.Euler(0, 0, 0, D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder),
  19511. s = new P.Euler().setFromQuaternion(o.quaternion, D.warp.eOrder),
  19512. l = new P.Euler(a.x - s.x, a.y - s.y, a.z - s.z, D.warp.eOrder)
  19513. l.y = N.constrainedTurn(l.y)
  19514. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x))
  19515. ;(l.x = c * Math.sign(l.x)), (c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c)), (this.burnsDir = Math.sign(l.y)), (c *= Math.sign(l.y)), (l.y = c)
  19516. var h = new P.Euler(0, 0, 0, D.warp.eOrder),
  19517. u = new P.Vector3(),
  19518. d = function (e, t) {
  19519. if (e < 0.5) (h.x = s.x + e * l.x), (h.y = s.y + e * l.y), (h.z = s.z + e * l.z)
  19520. else {
  19521. var i = (1 - e) * D.warp.softBendEnd
  19522. ;(h.x = a.x - i * l.x), (h.y = a.y - i * l.y), (h.z = a.z - i * l.z)
  19523. }
  19524. u.set(0, 0, -1), u.applyEuler(h), u.add(o.position), o.controls.lookAt(u), o.controls.lookVector.copy(u), o.lookAt(u)
  19525. }.bind(this)
  19526. if (window.DATA.momentTourBlackNewType) {
  19527. d(1)
  19528. } else return V.start(d, t, i, r, B[D.warp.movementEasing])
  19529. }),
  19530. (t.prototype._warpStepCameraAim = function (e, t, i) {
  19531. var n = this.playerControls.cameras[O.PANORAMA],
  19532. r = new P.Euler(0, 0, 0, D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder),
  19533. o = new P.Euler().setFromQuaternion(n.quaternion, D.warp.eOrder),
  19534. a = new P.Euler(r.x - o.x, r.y - o.y, r.z - o.z, D.warp.eOrder)
  19535. ;(a.y = N.constrainedTurn(a.y)), (this.burnsDir = Math.sign(a.y))
  19536. var s = new P.Euler(0, 0, 0, D.warp.eOrder),
  19537. l = new P.Vector3(),
  19538. c = function (e, t) {
  19539. e < 0.5 ? s.copy(o) : s.copy(r), l.set(0, 0, -1), l.applyEuler(s), l.add(n.position), n.controls.lookAt(l), n.controls.lookVector.copy(l), n.lookAt(l)
  19540. }.bind(this)
  19541. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19542. }),
  19543. (t.prototype.setBurnsDir = function () {
  19544. var e = this.playerControls.cameras[O.PANORAMA],
  19545. t = new P.Euler(0, 0, 0, D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder),
  19546. i = new P.Euler().setFromQuaternion(e.quaternion, D.warp.eOrder),
  19547. n = new P.Euler(t.x - i.x, t.y - i.y, t.z - i.z, D.warp.eOrder)
  19548. ;(n.y = N.constrainedTurn(n.y)), (this.burnsDir = Math.sign(n.y))
  19549. }),
  19550. (t.prototype.stepWarpPath = function (firstPos, e) {
  19551. var i = this.playerControls.cameras[O.PANORAMA]
  19552. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  19553. if (!n) {
  19554. return i.position.copy(this.warpDestPano.position), !0
  19555. }
  19556. /* if (!this.warpPathPoints)
  19557. return i.position.copy(this.warpDestPano.position),
  19558. !0;
  19559. var n = this.warpPathPoints[0] */
  19560. var r = this.warpDestPano.position
  19561. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  19562. var o = new P.Vector3()
  19563. e < 0.5
  19564. ? o
  19565. .copy(this.cameraHull[1])
  19566. .sub(n)
  19567. .normalize()
  19568. .multiplyScalar(D.warp.softPushDist * e)
  19569. .add(n)
  19570. : o
  19571. .copy(this.cameraHull[this.cameraHull.length - 2])
  19572. .sub(r)
  19573. .normalize()
  19574. .multiplyScalar(D.warp.softPushDist * D.warp.softPushEnd * (1 - e))
  19575. .add(r),
  19576. i.position.copy(o)
  19577. } else e < 0.5 ? i.position.copy(n) : i.position.copy(r)
  19578. }),
  19579. (t.prototype.interruptAndFastForward = function (e, t) {
  19580. this.warping &&
  19581. ((this.warpInterrupted = !0),
  19582. (this.warpInterruptionBlackoutStyle = e),
  19583. (this.warpInterruptionTravelTime = t),
  19584. (null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle) || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19585. (null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime) || (this.warpInterruptionTravelTime = D.minWarpTime))
  19586. }),
  19587. (t.prototype.warpCameraAim = function (e) {
  19588. var t = D.warp.minWarpTime
  19589. if (this.upcomingTransType === L.BLACK) t = D.warp.teleportTime
  19590. else {
  19591. var i = this.playerControls.cameras[O.PANORAMA],
  19592. n = new P.Euler(0, 0, 0, D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder),
  19593. r = new P.Euler().setFromQuaternion(i.quaternion, D.warp.eOrder),
  19594. o = new P.Euler(n.x - r.x, n.y - r.y, n.z - r.z, D.warp.eOrder)
  19595. o.y = N.constrainedTurn(o.y)
  19596. var a = (1e3 * Math.abs(o.y)) / P.Math.degToRad(D.warp.maxAimPerSec)
  19597. t = Math.max(t, a)
  19598. }
  19599. var s = function () {
  19600. this._warpStopFlying(), this.discardSlow(), e && e()
  19601. }.bind(this)
  19602. this._warpCameraAim(t, s)
  19603. }),
  19604. (t.prototype.warpCommonParameters = function (e, t, i, n) {
  19605. this.model.skybox.material.uniforms.blackout.value = n
  19606. var r = F.uniform(this.model.skybox, 'progress', 1),
  19607. o = F.allUniforms(this.model.chunks, 'progress', 1),
  19608. a = !1,
  19609. s = function () {
  19610. if (this.warpInterrupted) return (a = !0)
  19611. }.bind(this),
  19612. l = function (e, t) {
  19613. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19614. }.bind(this),
  19615. c = function (e, t) {
  19616. return i && a ? (o(0), !0) : void o(e, t)
  19617. }.bind(this)
  19618. V.start(s, e, null, t, null, 'safeHaltWatch'), V.start(l, e, null, t, B[D.warp.blendEasing], 'skyboxProgress'), V.start(c, e, null, t, B[D.warp.blendEasing], 'chunkProgress')
  19619. }),
  19620. (t.prototype.warpTravel_STD = function (e) {
  19621. var l,
  19622. c = Math.min(D.warp.lookAheadMax, D.warp.lookAheadDist / this.warpLength),
  19623. h = this.playerControls.cameras[O.PANORAMA],
  19624. i = (Math.min(0.25, 3 / this.warpLength), Math.min(0.35, 7 / this.warpLength)),
  19625. u = new P.Euler(0, 0, 0, D.warp.eOrder),
  19626. d = new P.Vector3(),
  19627. p = new P.Euler().setFromQuaternion(h.quaternion, D.warp.eOrder),
  19628. f = new P.Euler().copy(p),
  19629. g = h.position.clone(),
  19630. m = new P.Matrix4(),
  19631. v = new P.Euler(),
  19632. t = D.warp.minWarpTime
  19633. ;(t += this.warpLength * D.warp.timePerMeter), 0.01 < D.warp.flySpeed && (t = (1e3 * this.warpLength) / D.warp.flySpeed)
  19634. function n(e) {
  19635. var t = i
  19636. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19637. }
  19638. var y = !1,
  19639. r = this.warpDestHeroLoc.quaternion,
  19640. o = new P.Vector3(0, 0, -1).applyQuaternion(r).normalize(),
  19641. A = this.warpPathPoints[this.warpPathPoints.length - 1]
  19642. .clone()
  19643. .sub(this.warpPathPoints[this.warpPathPoints.length - 2])
  19644. .normalize(),
  19645. a = A.dot(o),
  19646. C = P.Math.radToDeg(Math.acos(a)),
  19647. s = function () {
  19648. return (
  19649. m.lookAt(g, l, U.UP),
  19650. u.setFromRotationMatrix(m, D.warp.eOrder),
  19651. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19652. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19653. N.constrainedTurn(v.y)
  19654. )
  19655. }.bind(this),
  19656. I = function (e, t) {
  19657. if (this.warpInterrupted) return (y = !0)
  19658. }.bind(this),
  19659. E = function (e, t) {
  19660. return y || !this.warpPathPoints ? (k.blur(0), !0) : void k.blur(e)
  19661. }.bind(this),
  19662. _ = F.allUniforms(this.model.chunks, 'modelAlpha', 1),
  19663. b = function (e, t) {
  19664. return y || !this.warpPathPoints ? (_(0), !0) : void _(e, t)
  19665. }.bind(this),
  19666. w = function (e, t) {
  19667. if (!this.warpPathPoints) return h.position.copy(this.warpDestPano.position), !0
  19668. if (y) return !0
  19669. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e)
  19670. h.position.copy(i), (g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, 0.99 * e))
  19671. }.bind(this),
  19672. T = function (e, t) {
  19673. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug('Lost bunny.'), !0)
  19674. }.bind(this),
  19675. x = function (e, t) {
  19676. if (y) return H.debug('>>>> Walkthrough interupted at t=' + e), !0
  19677. if (!this.warpPathPoints) return !0
  19678. var i = this.warpLength * e,
  19679. n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist),
  19680. r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength)
  19681. D.warp.matchCam && (n *= 1 - r),
  19682. m.lookAt(g, l, U.UP),
  19683. u.setFromRotationMatrix(m, D.warp.eOrder),
  19684. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19685. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19686. (v.y = N.constrainedTurn(v.y)),
  19687. (u.x = p.x + n * v.x),
  19688. (u.y = p.y + n * v.y),
  19689. (u.z = p.z + n * v.z),
  19690. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  19691. (v.y = N.constrainedTurn(v.y))
  19692. var o = (P.Math.degToRad(D.warp.maxTurnPerSec) * t) / 1e3
  19693. ;(v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y))),
  19694. (f.x = f.x + v.x * D.warp.turnFriction),
  19695. (f.y = f.y + v.y * D.warp.turnFriction),
  19696. (f.z = f.z + v.z * D.warp.turnFriction),
  19697. (f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x))
  19698. var a = l.clone().sub(g).normalize()
  19699. if (C < D.warp.maxAimRotation && 0 < r) {
  19700. var s = 1 - r
  19701. ;(a.x = a.x * s + r * A.x), (a.y = a.y * s + r * A.y), (a.z = a.z * s + r * A.z), a.normalize()
  19702. }
  19703. this.bunnyObj.position.copy(h.position).add(a),
  19704. d.set(0, 0, -1).applyEuler(f).normalize(),
  19705. d.multiplyScalar(8),
  19706. d.add(h.position),
  19707. (1 - c < e && D.warp.matchCam) || (h.controls.lookAt(d), h.controls.lookVector.copy(d), h.lookAt(d))
  19708. }.bind(this),
  19709. S = function () {
  19710. y ? (this.discardSlow(), (this.upcomingTransType = L.BLACK), this.warpTravel_BLACK(-0.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  19711. }.bind(this)
  19712. T(0)
  19713. var M = D.warp.motionLeadTime + (1e3 * Math.abs(s())) / P.Math.degToRad(D.warp.maxTurnPerSec),
  19714. R = M / (t += M)
  19715. this.warpCommonParameters(t, R, !0, z.NONE),
  19716. V.start(I, t, null, 0, null, '_haltWatcher'),
  19717. 0 < D.warp.blur && ((k.blurStrength = D.warp.blur), V.start(E, t, null, R, n, 'blurring')),
  19718. V.start(b, t, null, R, n, 'modelAlpha'),
  19719. V.start(w, t, null, R, B[D.warp.blendEasing], 'followPath'),
  19720. V.start(T, t, null, R, B[D.warp.blendEasing], 'goBunny'),
  19721. V.start(x, t, S, 0, B[D.warp.blendEasing], 'lookAtBunny')
  19722. }),
  19723. (t.prototype.warpTravel_BLACK = function (e, t, i, n) {
  19724. var r = e || 0
  19725. null != t || (t = D.warp.teleportTime)
  19726. //add
  19727. var done = () => {
  19728. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  19729. this.player.transitionPos({ type: 'beforeFlytopano', pano: this.player.currentPano, dur: 100 }) //add
  19730. }
  19731. if (window.DATA.momentTourBlackNewType) {
  19732. player.sceneRenderer.effects.fastTranMaskPass.start(player.sceneRenderer)
  19733. var camera = this.playerControls.cameras['panorama']
  19734. var end = this.warpDestHeroLoc.position
  19735. camera.position.copy(end)
  19736. setTimeout(() => {
  19737. player.sceneRenderer.effects.fastTranMaskPass.stop()
  19738. this.wrapupWarpShadingOnly(n, i)
  19739. done()
  19740. }, t)
  19741. } else {
  19742. var o = function () {
  19743. this.wrapupWarpShadingOnly(n, i)
  19744. done()
  19745. }.bind(this)
  19746. var firstPos = this.player.position.clone() //add
  19747. V.start(this.stepWarpPath.bind(this, firstPos), t, o, r, B[D.warp.blendEasing], 'stepMotion')
  19748. }
  19749. this.warpCommonParameters(t, r, !1, i)
  19750. this.model.chunks.concat(this.model.skybox).forEach(function (e) {
  19751. // 改
  19752. if (window.DATA.momentTourBlackNewType) {
  19753. e.material.uniforms.blackout.value = 5 //i 改
  19754. //e.material.defines.newBlack = ''
  19755. //e.material.needsUpdate = true
  19756. } else {
  19757. e.material.uniforms.blackout.value = i
  19758. }
  19759. }),
  19760. this._warpBendAim(null, t, null, r)
  19761. /* this.warpCommonParameters(t, r, !1, i)
  19762. this.model.chunks.forEach(function(e) {
  19763. e.material.uniforms.blackout.value = i
  19764. }),
  19765. this._warpBendAim(null, t, null, r);
  19766. //add
  19767. var done = ()=>{
  19768. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  19769. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:100})//add
  19770. }
  19771. var o = function() {
  19772. this.wrapupWarpShadingOnly(n, i)
  19773. done()
  19774. }
  19775. .bind(this);
  19776. var firstPos = this.player.position.clone()//add
  19777. V.start(this.stepWarpPath.bind(this, firstPos), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19778. */
  19779. }),
  19780. (t.prototype.flightStepWalk =
  19781. ((a = new P.Vector3()),
  19782. (s = new P.Vector3()),
  19783. function (e, t, i) {
  19784. if (this.warpInterrupted) i && i()
  19785. else if (this.activeTransType !== L.WALK) this._clearWarpShading(), this._warpStopFlying(), this.player.spider.draw(), this.placeCpm(), i && i()
  19786. else if (this.player.currentPano !== e) {
  19787. var n = {
  19788. pano: e,
  19789. lookAtPoint: t,
  19790. duration: null,
  19791. maxDistanceOverride: D.warp.walkMaxDist,
  19792. skipWarpingCheck: !1,
  19793. constantMoveSpeed: !0
  19794. }
  19795. if (e == this.warpDestPano) {
  19796. //到达终点前,放大到终点的zoom
  19797. n.zoomLevel = this.warpDestHeroLoc.zoom
  19798. }
  19799. ;(n.duration = function (e, t) {
  19800. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime
  19801. s.copy(U.FORWARD), this.player.getDirection(s), a.copy(t).sub(e.position).normalize()
  19802. var n = a.dot(s),
  19803. r = Math.acos(n),
  19804. o = r / i
  19805. 0.001 < o &&
  19806. ((i *= o / 0.001), //-----这是什么????
  19807. r < 1 && (i *= 1.2))
  19808. return (i / DATA.tourWalkSpeed) * 100
  19809. }.call(this, e, t)),
  19810. this.player.nonInterruptingFlyToPano(n, i)
  19811. } else i && i()
  19812. })),
  19813. (t.prototype.makeWalkFlightFunc = function (e, t, i) {
  19814. return this.flightStepWalk.bind(this, e, t, i)
  19815. }),
  19816. (t.prototype.warpTravel_WALK =
  19817. ((f = []),
  19818. function (e) {
  19819. for (var t = this.player.model.panos, i = null, n = !1, r = (f.length = 0); r < this.nodes.length; r++) {
  19820. var o = this.nodes[r],
  19821. a = t.get(o)
  19822. this.nodes.length, (n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist), (i && n) || (f.push(o), (i = a))
  19823. }
  19824. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1])
  19825. var s = f.length,
  19826. l = t.get(f[s - 1]),
  19827. c = new Array(s + 1)
  19828. c[c.length - 1] = function () {
  19829. e && e()
  19830. }.bind(this)
  19831. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  19832. var d = f[h]
  19833. l = t.get(d)
  19834. var p = new P.Vector3()
  19835. this.getLookAtForWalkingTourNode(f, h, p), (c[u - 1] = this.makeWalkFlightFunc(l, p, c[u])), h--
  19836. }
  19837. c[0]()
  19838. })),
  19839. (t.prototype.getLookAtForWalkingTourNode =
  19840. ((c = new P.Vector3()),
  19841. (h = new P.Vector3()),
  19842. (u = new P.Vector3()),
  19843. (d = new P.Vector3()),
  19844. (p = new P.Vector3()),
  19845. function (e, t, i) {
  19846. var n = e.length
  19847. if (n <= t) return !1
  19848. var r = 1,
  19849. o = 1
  19850. h.set(0, 0, 0), p.set(0, 0, 0)
  19851. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  19852. if (((a = this.player.model.panos.get(e[s])), this.getOrientationForWalkingTourNode(e, s, u), s === t && c.copy(u), d.copy(u), t < s)) {
  19853. var l = d.dot(c) < 0.65
  19854. ;(r *= l ? 0.2 : 0.75), (o *= l ? 0.2 : 0.4)
  19855. }
  19856. u.multiplyScalar(r), h.add(u), p.lerp(a.position, o)
  19857. }
  19858. return h.normalize(), i.copy(p), i.add(h), !0
  19859. })),
  19860. (t.prototype.getOrientationForWalkingTourNode = function (e, t, i) {
  19861. var n = e.length
  19862. if (n <= t) return !1
  19863. if (t === n - 1) i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion)
  19864. else {
  19865. var r = this.player.model.panos.get(e[t]),
  19866. o = this.player.model.panos.get(e[t + 1])
  19867. i.copy(o.position).sub(r.position)
  19868. }
  19869. return i.normalize(), !0
  19870. }),
  19871. (t.prototype.warpCameraTravel = function (e, t, i, n) {
  19872. if (((this.activeTransType = this.upcomingTransType), (this.lastTransType = this.activeTransType), (this.upcomingTransType = null), e))
  19873. this.activeTransType === L.BLACK
  19874. ? this.warpTravel_BLACK(null, i, t, n)
  19875. : this.activeTransType === L.WALK
  19876. ? this.warpTravel_WALK(
  19877. function () {
  19878. this._clearWarpShading(), this._warpStopFlying(), this.player.spider.draw(), this.placeCpm(), n && n()
  19879. }.bind(this)
  19880. )
  19881. : this.warpTravel_STD(n)
  19882. else {
  19883. var r = function () {
  19884. this._wrapupTravel(n)
  19885. }.bind(this),
  19886. o = {
  19887. pano: this.warpDestPano,
  19888. lookAtPoint: null,
  19889. duration: null,
  19890. maxDistanceOverride: null,
  19891. skipWarpingCheck: !1
  19892. }
  19893. this.player.flyToPano(o, r)
  19894. }
  19895. }),
  19896. (t.prototype.startWarpState = function () {
  19897. ;(this.warping = !0), (this.warpInterrupted = !1), (this.warpInterruptionBlackoutStyle = null), (this.warpInterruptionTravelTime = null)
  19898. }),
  19899. (t.prototype.endWarpState = function () {
  19900. this.warping = !1
  19901. }),
  19902. (t.prototype.warpToPano = function (e, t, i, n) {
  19903. if (this.warping) H.warn('Cannot warp when already warping')
  19904. else {
  19905. if (((this.upcomingTransType = e), (this.activeTransType = null), !this.setWarpDestPano())) return (this.upcomingTransType = null), void this.warpToNonPano(n)
  19906. if (this.player.mode !== O.PANORAMA)
  19907. return (
  19908. (this.upcomingTransType = null),
  19909. this.discardSlow(),
  19910. void this.player.flyToNewMode({
  19911. mode: O.PANORAMA,
  19912. pano: this.warpDestPano,
  19913. duration: D.warp.outsideTime,
  19914. warpDest: this.warpDestHeroLoc,
  19915. callback: n,
  19916. force: !0
  19917. })
  19918. )
  19919. if (!this.warpDestPano) return H.warn('no warp destination, callback dropped'), void (this.upcomingTransType = null)
  19920. var r = !(
  19921. this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) &&
  19922. this.warpDestPano !== this.player.currentPano &&
  19923. this.warpDestPano.position.distanceTo(this.player.currentPano.position) < D.warp.nearPanoDist
  19924. ),
  19925. o = this.chooseWarpPath(r)
  19926. if (o && this.upcomingTransType !== L.WALK) {
  19927. var a = function () {
  19928. ;(this.waitingToWarp = !1), this.warpToPano(e, t, i, n)
  19929. }.bind(this)
  19930. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, 'high', 'low', this.player.basePanoSize, a)) return void (this.waitingToWarp = !0)
  19931. }
  19932. this.player.currentPano ||
  19933. (H.warn('Arrived at a very strange spot!'), (this.player.currentPano = this.warpDestPano), this.placeCpm(), this.fadeOutCpm(D.path.fadeOutTime), this.player.spider.draw()),
  19934. H.debug('Warping to pano ', this.warpDestPano.position),
  19935. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  19936. this.startWarpState()
  19937. var s = function () {
  19938. this.endWarpState(), n && n()
  19939. }.bind(this)
  19940. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  19941. }
  19942. }),
  19943. (v.exports = t)
  19944. }).call(this, '/js/objects/ShowPath.js')
  19945. },
  19946. {
  19947. '../constants': 8,
  19948. '../effects': 16,
  19949. '../enum/BlackoutStyle': 18,
  19950. '../enum/ModelManagerEvents': 33,
  19951. '../enum/PlayerEvents': 40,
  19952. '../enum/RenderOrder': 42,
  19953. '../enum/Vectors': 50,
  19954. '../enum/Viewmode': 51,
  19955. '../enum/WarpStyle': 52,
  19956. '../gui/gui': 65,
  19957. '../model/ModelManager': 140,
  19958. '../objects/Snapshot': 153,
  19959. '../settings': 166,
  19960. '../shaders': 167,
  19961. '../util/easing': 186,
  19962. '../util/lerp': 188,
  19963. '../util/logger': 189,
  19964. '../util/math': 190,
  19965. '../util/texture': 194,
  19966. '../util/transitions': 195,
  19967. three: 217
  19968. }
  19969. ],
  19970. 152: [
  19971. function (e, t, i) {
  19972. 'use strict'
  19973. function n() {
  19974. var e = new r.SphereBufferGeometry(a.skyboxRadius, 20, 5),
  19975. t = new r.RawShaderMaterial({
  19976. fragmentShader: o.skysphere.fragmentShader,
  19977. vertexShader: o.skysphere.vertexShader,
  19978. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  19979. side: r.BackSide,
  19980. name: 'skysphere'
  19981. })
  19982. ;(t.uniforms.radius.value = e.parameters.radius), r.Mesh.call(this, e, t)
  19983. }
  19984. var r = e('three'),
  19985. o = e('../shaders'),
  19986. a = e('../settings')
  19987. ;((n.prototype = Object.create(r.Mesh.prototype)).constructor = n), (t.exports = n)
  19988. },
  19989. {
  19990. '../settings': 166,
  19991. '../shaders': 167,
  19992. three: 217
  19993. }
  19994. ],
  19995. 153: [
  19996. function (r, o, e) {
  19997. ;(function (e) {
  19998. 'use strict'
  19999. function t(e) {
  20000. n.call(this, e),
  20001. (this.sid = e.sid),
  20002. (this.panoId = e.panoId),
  20003. (this.orthoZoom = e.orthoZoom),
  20004. (this.floorVisibility = e.floorVisibility),
  20005. (this.thumbUrl = e.thumbUrl),
  20006. (this.name = e.name),
  20007. (this.zoom = e.zoom)
  20008. }
  20009. var i = (r('three'), r('../util/logger')),
  20010. n = (r('../settings'), r('../enum/Viewmode'), r('../util/common'), r('../util/transitions'), r('../util/lerp'), r('../util/ajax'), r('../util/texture'), r('./View'))
  20011. r('events').EventEmitter,
  20012. new i(e),
  20013. ((t.prototype = Object.create(n.prototype)).isPano = function () {
  20014. return this.panoId && '' !== this.panoId && this.panoId != 'outside'
  20015. }),
  20016. (o.exports = t)
  20017. }).call(this, '/js/objects/Snapshot.js')
  20018. },
  20019. {
  20020. '../enum/Viewmode': 51,
  20021. '../settings': 166,
  20022. '../util/ajax': 181,
  20023. '../util/common': 185,
  20024. '../util/lerp': 188,
  20025. '../util/logger': 189,
  20026. '../util/texture': 194,
  20027. '../util/transitions': 195,
  20028. './View': 154,
  20029. events: 202,
  20030. three: 217
  20031. }
  20032. ],
  20033. 154: [
  20034. function (o, a, e) {
  20035. ;(function (e) {
  20036. 'use strict'
  20037. function t(e) {
  20038. ;(e = e || {}), (this.position = new i.Vector3()), (this.quaternion = new i.Quaternion()), this.update(e)
  20039. }
  20040. var i = o('three'),
  20041. n = o('../util/logger'),
  20042. r = (o('../settings'), o('../enum/Viewmode'), o('../util/common'), o('../util/transitions'), o('../util/lerp'), o('../util/ajax'), o('../util/texture'), o('events').EventEmitter)
  20043. new n(e),
  20044. ((t.prototype = Object.create(r.prototype)).isValid = function () {
  20045. return !!this.cameraMode
  20046. }),
  20047. (t.prototype.update = function (e) {
  20048. return (
  20049. (this.cameraMode = e.cameraMode || this.cameraMode),
  20050. (this.pano = e.pano || this.pano),
  20051. e.position && this.position.copy(e.position),
  20052. e.quaternion && this.quaternion.copy(e.quaternion),
  20053. this
  20054. )
  20055. }),
  20056. (a.exports = t)
  20057. }).call(this, '/js/objects/View.js')
  20058. },
  20059. {
  20060. '../enum/Viewmode': 51,
  20061. '../settings': 166,
  20062. '../util/ajax': 181,
  20063. '../util/common': 185,
  20064. '../util/lerp': 188,
  20065. '../util/logger': 189,
  20066. '../util/texture': 194,
  20067. '../util/transitions': 195,
  20068. events: 202,
  20069. three: 217
  20070. }
  20071. ],
  20072. 155: [
  20073. function (J, ee, e) {
  20074. ;(function (e) {
  20075. 'use strict'
  20076. function t(e) {
  20077. ;(this.currentPano = null),
  20078. (this.nextPano = null),
  20079. (this.camera = null),
  20080. (this.paused = !1),
  20081. (this.flying = !1),
  20082. (this.sceneIntersectionPlane = null),
  20083. (this.target = new B.Vector3()),
  20084. (this.mouse = new B.Vector3(1.1, 1.1, 0.5)),
  20085. (this.mouseAtMouseDown = new B.Vector2()),
  20086. (this.mouseCouldBeClickToMove = !1),
  20087. (this.mouseLastMoveTime = Date.now()),
  20088. (this.mouseDown = !1),
  20089. (this.mouseDownTimer = null),
  20090. (this.couldBeLongTap = !1),
  20091. (this.containsMouse = !0),
  20092. (this.isTouchEvent = !1),
  20093. (this.isPanoHover = !1),
  20094. (this.reticule = new n(this)),
  20095. (this.panoMarkers = []),
  20096. (this.spider = new s(this)),
  20097. (this.quaternion = new B.Quaternion()),
  20098. (this.position = new B.Vector3(15, 10, 15)),
  20099. (this.previousState = null),
  20100. (this.lastInsideView = new o()),
  20101. (this.last360View = new o()),
  20102. (this.raycaster = new B.Raycaster()),
  20103. (this.intersect = null),
  20104. (this.lastChangeTime = Date.now()),
  20105. (this.history = new h()),
  20106. (this.cameraControls = null),
  20107. (this.path = null),
  20108. (this.model = null),
  20109. (this.domElement = null),
  20110. (this.cachedPanoCandidates = null),
  20111. (this.basePanoSize = 0),
  20112. (this.standardPanoSize = 0),
  20113. (this.highPanoSize = 0),
  20114. (this.ultraHighPanoSize = 0),
  20115. (this.zoomLevel = 1),
  20116. (this.zooming = 0),
  20117. (this.zoomSpeed = 0.5),
  20118. (this.scrollZoomSpeed = 0.06),
  20119. (this.zoomSpeedAdjust = 0.05),
  20120. (this.defaultZoomIncrement = 0.2),
  20121. (this.baseFov = k.insideFOV),
  20122. (this.zoomFov = this.baseFov),
  20123. (this.zoomEnabled = !0),
  20124. (this.preRenderingEnabled = !1),
  20125. this.setupCustomProperties(e),
  20126. (this.zoomStats = new v()),
  20127. (this.modeTran = '') //'dollhouse-panorama'
  20128. this.currentCursor = ''
  20129. window.player = this
  20130. }
  20131. var B = J('three'),
  20132. i = J('./util/logger'),
  20133. n = J('./objects/Reticule'),
  20134. a = J('./objects/Panorama'),
  20135. r = J('./objects/ShowPath'),
  20136. o = J('./objects/View'),
  20137. s = (J('./objects/Snapshot'), J('./objects/NSpider')),
  20138. V = J('./enum/Viewmode'),
  20139. T = (J('./enum/TagStates'), J('./enum/Vectors')),
  20140. l = J('./enum/Keys'),
  20141. k = (J('./enum/AlignmentType'), J('./settings')),
  20142. x = J('./util/common'),
  20143. U = (J('./util/browser'), J('./util/math')),
  20144. H = J('./util/lerp'),
  20145. z = J('./util/easing'),
  20146. G = J('./util/transitions'),
  20147. c = J('events').EventEmitter,
  20148. h = (J('./shaders'), J('./util/history')),
  20149. S = (J('./util/camera'), J('./model/ModelManager'), J('./enum/PathDiscardMode')),
  20150. M = J('./enum/PathDisplayMode'),
  20151. W = J('./enum/PlayerEvents'),
  20152. u = J('./enum/ControlEvents'),
  20153. d = J('./enum/ModelManagerEvents'),
  20154. R = J('./enum/WarpStyle'),
  20155. P = J('./enum/BlackoutStyle'),
  20156. p = J('./exception/BasicException'),
  20157. f = J('./enum/PanoSizeClass'),
  20158. g = (J('./tile/TileDownloader'), J('./tile/TilePrioritizer')),
  20159. m = (J('./enum/PanoramaEvents'), J('./enum/ZoomEvents')),
  20160. v = J('./util/ZoomStats'),
  20161. y = J('./constants'),
  20162. j = J('./util/common'),
  20163. A = J('./util/cameraLight'),
  20164. //, C = J("hot")
  20165. Y = new i(e),
  20166. q = Object.freeze({
  20167. FlyToPano: G.getUniqueId(),
  20168. FlyToNewMode: G.getUniqueId(),
  20169. FlyToSameMode: G.getUniqueId(),
  20170. FlyToViewFloor: G.getUniqueId(),
  20171. LookTransition: G.getUniqueId(),
  20172. ZoomTransition: G.getUniqueId()
  20173. })
  20174. function I(e) {
  20175. for (var t = e.split(','), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; ) o[r] = n.charCodeAt(r)
  20176. return new Blob([o], {
  20177. type: i
  20178. })
  20179. }
  20180. ;((t.prototype = Object.create(c.prototype)).init = function (e) {
  20181. ;(this.modelManager = e.modelManager),
  20182. (this.tileDownloader = e.tileDownloader),
  20183. (this.panoRenderer = e.panoRenderer),
  20184. (this.qualityManager = e.qualityManager),
  20185. (this.domElement = e.container),
  20186. (this.camera = e.camera),
  20187. (this.tagManager = e.tagManager),
  20188. (this.cameraControls = e.controls),
  20189. (this.path = new r(e.director, this, e.controls)),
  20190. (this.basePanoSize = this.qualityManager.getPanoSize(f.BASE)),
  20191. (this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD)),
  20192. (this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH)),
  20193. (this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH)),
  20194. (this.tileDownloader.processPriorityQueue = !1),
  20195. (this.tileDownloader.tilePrioritizer = new g(this.qualityManager, this.basePanoSize, this.standardPanoSize, this.highPanoSize, this.ultraHighPanoSize)),
  20196. this.bindEvents(e.container),
  20197. this.updateModel()
  20198. //add
  20199. this.raycaster.linePrecision = 0.1
  20200. }),
  20201. (t.prototype.screenShot = function (i) {
  20202. if (!this.flying && !this.flyingToTag) {
  20203. var n = this.sceneRenderer
  20204. n.updateScreenSize(i)
  20205. this.model.panos.forEach(e => {
  20206. if (e.marker) {
  20207. e.marker.forceHide = e.marker.visible
  20208. e.marker.visible = !1
  20209. }
  20210. })
  20211. /* for (var e in this.model.hots)
  20212. this.model.hots[e].mesh.visible = !1; */
  20213. player.model.hotGroup.visible = false
  20214. ;(this.reticule.visible = !1),
  20215. (this.reticule.forceUnvisible = !0),
  20216. (this.path.currentPanoMarker.mesh.visible = !1),
  20217. setTimeout(
  20218. function () {
  20219. n.renderer.clear(!0, !0, !0), n.renderer.render(n.scene, n.camera)
  20220. var e = n.renderer.domElement.toDataURL(i.type, 0.9)
  20221. i.f && i.f(e)
  20222. n.updateScreenSize({
  20223. resize: !0
  20224. })
  20225. this.reticule.visible = !0
  20226. player.model.hotGroup.visible = true
  20227. this.model.panos.forEach(e => {
  20228. e.marker && (e.marker.visible = e.marker.forceHide)
  20229. })
  20230. ;(this.path.currentPanoMarker.mesh.visible = !0), n.renderer.render(n.scene, n.camera)
  20231. }.bind(this),
  20232. 30
  20233. )
  20234. }
  20235. })
  20236. var E,
  20237. _,
  20238. b,
  20239. w,
  20240. O,
  20241. L,
  20242. D,
  20243. N,
  20244. F,
  20245. X,
  20246. Z,
  20247. K,
  20248. Q = J('scaleImg')
  20249. t.prototype.getWrapShot = function () {
  20250. var i = this.getSnapAngleInfo(),
  20251. n = ',{\r\t' + i,
  20252. r = arguments[0]
  20253. this.screenShot({
  20254. width: g_snapShotWidth,
  20255. height: g_snapShotHeight,
  20256. type: 'image/jpeg',
  20257. f: function (e) {
  20258. if (r && r.__callback) return r.__callback(e, i)
  20259. var t = new Image()
  20260. ;(t.src = e),
  20261. (t.onload = function () {
  20262. var e = (function (r, i) {
  20263. function n(e, t) {
  20264. var i = o || r,
  20265. n = document.createElement('canvas')
  20266. ;(n.width = i.width), (n.height = i.height), n.getContext('2d').drawImage(i, 0, 0, i.width, i.height), (o = Q(e, n, t))
  20267. }
  20268. function e() {
  20269. var e = o || r,
  20270. t = I(e.src)
  20271. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, 'jpeg'), (t = I(e.src))), ((o = o || new Image()).base64Src = e.src), (o.src = window.URL.createObjectURL(t))
  20272. }
  20273. var o,
  20274. t = Math.max(r.width, r.height)
  20275. return (
  20276. 'png' != i.toType &&
  20277. ('jpeg' == i.oldType
  20278. ? (t > i.maxSize && n(i.maxSize / t, 'jpeg'), e())
  20279. : 'png' == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, 'jpeg'), e())),
  20280. o || r
  20281. )
  20282. })(this, {
  20283. maxSize: g_snapShotWidth,
  20284. oldType: 'jpeg'
  20285. })
  20286. e.src.replace(
  20287. (function (e) {
  20288. return 'image/' + (e = e.toLowerCase().replace(/jpg/i, 'jpeg')).match(/png|jpeg|bmp|gif/)[0]
  20289. })('image/jpeg'),
  20290. 'image/octet-stream'
  20291. )
  20292. var t = 'snap' + new Date().getTime()
  20293. !(function (e, t) {
  20294. var i = document.createElementNS('http://www.w3.org/1999/xhtml', 'a')
  20295. ;(i.href = e), (i.download = t)
  20296. var n = document.createEvent('MouseEvents')
  20297. n.initMouseEvent('click', !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), i.dispatchEvent(n)
  20298. })(e.src, t + '.jpg'),
  20299. (n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",'),
  20300. (n += '\r\t"sid":"' + t + '",'),
  20301. (n += '\r\t"name":"' + t + '"\r}'),
  20302. logData(n)
  20303. })
  20304. }
  20305. })
  20306. }
  20307. /* ,
  20308. t.prototype.getSnapAngleInfo = function() {
  20309. var e = {}
  20310. , t = '"metadata":{'
  20311. , i = this.camera.quaternion.clone();
  20312. switch (this.mode) {
  20313. case "panorama":
  20314. e.scan_id = this.currentPano.id,
  20315. t += '"scan_id":"' + this.currentPano.id + '",';
  20316. break;
  20317. case "floorplan":
  20318. e.camera_mode = 1,
  20319. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20320. t += '"camera_mode":1,',
  20321. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20322. break;
  20323. case "dollhouse":
  20324. e.camera_mode = 2,
  20325. t += '"camera_mode":2,'
  20326. }
  20327. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20328. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20329. n.x *= -1,
  20330. n.w *= -1,
  20331. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20332. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20333. e.zoom = this.zoomLevel,
  20334. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20335. }
  20336. , */
  20337. ;(t.prototype.getSnapAngleInfo = function () {
  20338. var info = {}
  20339. var str = '"metadata":{'
  20340. var q = this.camera.quaternion.clone()
  20341. switch (this.mode) {
  20342. case 'panorama':
  20343. info.scan_id = this.currentPano.id
  20344. str += '"scan_id":"' + this.currentPano.id + '",'
  20345. break
  20346. case 'floorplan':
  20347. info.camera_mode = 1
  20348. q = new B.Quaternion().setFromAxisAngle(new B.Vector3(0, 1, 0), B.Math.degToRad(90))
  20349. q.multiply(this.camera.quaternion)
  20350. str += '"camera_mode":1,'
  20351. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20352. str += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ','
  20353. break
  20354. case 'dollhouse':
  20355. info.camera_mode = 2
  20356. str += '"camera_mode":2,'
  20357. break
  20358. }
  20359. info.camera_position = U.toPrecision(this.camera.position.toArray(), 4)
  20360. //console.log(info.camera_position)
  20361. info.camera_quaternion = U.toPrecision(q.toArray(), 4)
  20362. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20363. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20364. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20365. out.x *= -1;
  20366. out.w *= -1;
  20367. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20368. }else{
  20369. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20370. } */
  20371. info.zoom = this.zoomLevel
  20372. //console.log(info.camera_quaternion)
  20373. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20374. // fyz 扩展编辑页面, 加上导览点缩放值
  20375. str += '"camera_position":[' + info.camera_position + '],"camera_quaternion":[' + info.camera_quaternion + '], "zoom":' + info.zoom + '}'
  20376. console.log(str)
  20377. return str
  20378. }),
  20379. //------end
  20380. (t.prototype.setupCustomProperties = function (e) {
  20381. var i = e || V.PANORAMA
  20382. Object.defineProperty(this, 'mode', {
  20383. get: function () {
  20384. return i
  20385. },
  20386. set: function (e) {
  20387. var t = i
  20388. ;(i = e), this.onModeUpdated(t, i)
  20389. }
  20390. })
  20391. }),
  20392. (t.prototype.isInMode = function () {
  20393. for (var e = 0; e < arguments.length; e++) if (this.mode === arguments[e]) return !0
  20394. return !1
  20395. }),
  20396. (t.prototype.isOutsideMode = function (e) {
  20397. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20398. }),
  20399. (t.prototype.is360View = function (e, t) {
  20400. return e === V.PANORAMA && t && !t.isAligned()
  20401. }),
  20402. (t.prototype.setScene = function (e) {
  20403. ;(this.sceneIntersectionPlane = e.plane), this.path.setScene(e), this.moveReticuleToScene(e)
  20404. }),
  20405. (t.prototype.moveReticuleToScene = function (e) {
  20406. this.reticule.parent && this.reticule.parent.remove(this.reticule), e.add(this.reticule)
  20407. }),
  20408. (t.prototype.updateModel = function () {
  20409. function n(e) {
  20410. var t = this.cameraControls.cameras[V.DOLLHOUSE],
  20411. i = this.cameraControls.controls[V.DOLLHOUSE],
  20412. n = t.position.y + (e - i.target.y),
  20413. r = k.showFloorDuration + k.showFloorDelay
  20414. G.start(H.property(i.target, 'y', e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20415. G.start(H.property(t.position, 'y', n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20416. }
  20417. ;(this.model = this.modelManager.getActiveModel()),
  20418. this.model.on(
  20419. 'floor.changed',
  20420. function (e, t, i) {
  20421. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20422. }.bind(this)
  20423. ),
  20424. this.model.on(
  20425. 'allfloors.toggled',
  20426. function (e, t) {
  20427. if (this.mode === V.DOLLHOUSE) {
  20428. var i = e ? this.model.center.y : (i = t.center.y)
  20429. n.call(this, i)
  20430. }
  20431. }.bind(this)
  20432. ),
  20433. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model))
  20434. var t = this
  20435. this.model.panos.list.forEach(function (e) {
  20436. e.vrMarker.addEventListener('click', function () {
  20437. t.flyToPano({
  20438. pano: e
  20439. })
  20440. })
  20441. })
  20442. }),
  20443. (t.prototype.updateModelDependentData = function () {
  20444. this.cameraControls.setModelForControls(this.model), this.getPanoMarkersFromModel(this.model)
  20445. }),
  20446. (t.prototype.onModelChanged = function () {
  20447. this.updateModel(), this.updateModelDependentData()
  20448. }),
  20449. (t.prototype.getPanoMarkersFromModel = function (e) {
  20450. this.panoMarkers = e.panos.list.reduce(function (e, t) {
  20451. return t.marker ? e.concat(t.marker) : e
  20452. }, [])
  20453. }),
  20454. (t.prototype.handleControlMove = function (e) {
  20455. this.emit(W.Move, e)
  20456. }),
  20457. (t.prototype.handleControlInputStart = function (e) {
  20458. this.emit(W.InputStart, e)
  20459. }),
  20460. (t.prototype.onModeUpdated = function (e, t) {
  20461. this.cameraControls.activateControls(t), this.emit(W.ModeChanged, e, t)
  20462. }),
  20463. (t.prototype.isWarping = function () {
  20464. return this.path.warping
  20465. }),
  20466. (t.prototype.isWaitingToWarp = function () {
  20467. return this.path.waitingToWarp
  20468. }),
  20469. (t.prototype.getLabelScaleFactor = function () {
  20470. if (this.isOutsideMode()) {
  20471. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20472. }
  20473. return 0.5
  20474. }),
  20475. (t.prototype.bindEvents = function (e) {
  20476. e !== document && e.setAttribute('tabindex', -1),
  20477. e.addEventListener('mousedown', this.onMouseDown.bind(this)),
  20478. e.addEventListener('mousemove', this.onMouseMove.bind(this)),
  20479. e.addEventListener('mouseover', this.onMouseOver.bind(this)),
  20480. e.addEventListener('mouseout', this.onMouseOut.bind(this)),
  20481. e.addEventListener('mouseup', this.onMouseUp.bind(this)),
  20482. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20483. e.addEventListener('touchstart', this.onTouchStart.bind(this)),
  20484. e.addEventListener('touchmove', this.onTouchMove.bind(this)),
  20485. e.addEventListener('touchend', this.onTouchEnd.bind(this)),
  20486. e.addEventListener('pointerdown', this.onPointerDown.bind(this)),
  20487. e.addEventListener('pointermove', this.onPointerMove.bind(this)),
  20488. e.addEventListener('pointerup', this.onPointerUp.bind(this)),
  20489. document.addEventListener('pointerup', () => {
  20490. //add
  20491. window.transformControls && transformControls.onPointerUp()
  20492. }),
  20493. e.addEventListener('pointerout', this.onPointerOut.bind(this)),
  20494. e.addEventListener('pointercancel', this.onPointerCancel.bind(this)),
  20495. document.addEventListener('keydown', this.onKeyDown.bind(this)),
  20496. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20497. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20498. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20499. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20500. window.addEventListener('snapshotBegin', this.getWrapShot.bind(this)),
  20501. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20502. window.getSeft && getSeft(this)
  20503. }),
  20504. (t.prototype.onMouseDown = function (e) {
  20505. e.currentTarget !== document && e.currentTarget.focus(), 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1), this.updateIntersect())
  20506. }),
  20507. (t.prototype.onMouseMove = function (e) {
  20508. ;(this.isTouchEvent = !1), this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20509. }),
  20510. (t.prototype.onMouseOver = function (e) {
  20511. ;(this.containsMouse = !0), !this.mouseDown || (0 !== e.which && 0 !== e.buttons) || (this.mouseDown = !1)
  20512. }),
  20513. (t.prototype.onMouseOut = function (e) {
  20514. this.containsMouse = !1
  20515. }),
  20516. (t.prototype.onMouseUp = function (e) {
  20517. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20518. }),
  20519. (t.prototype.onTouchStart = function (e) {
  20520. if ((e.currentTarget !== document && e.currentTarget.focus(), !this.mouseDown)) {
  20521. this.couldBeLongTap = !0
  20522. var t = x.average(e.changedTouches, 'clientX'),
  20523. i = x.average(e.changedTouches, 'clientY')
  20524. this.handleInputStart.call(this, t, i, !0),
  20525. (this.mouseDownTimer = setTimeout(
  20526. function () {
  20527. this.updateIntersect(), this.handleInputEnd.call(this, t, i, !0)
  20528. }.bind(this),
  20529. k.input.longTapThreshold
  20530. ))
  20531. }
  20532. }),
  20533. (t.prototype.onTouchMove = function (e) {
  20534. var t = x.average(e.changedTouches, 'clientX'),
  20535. i = x.average(e.changedTouches, 'clientY')
  20536. this.handleInputMove.call(this, t, i, !0)
  20537. }),
  20538. (t.prototype.onTouchEnd = function (e) {
  20539. if ((clearTimeout(this.mouseDownTimer), this.mouseDown)) {
  20540. ;(this.couldBeLongTap = !1), this.updateIntersect()
  20541. var t = x.average(e.changedTouches, 'clientX'),
  20542. i = x.average(e.changedTouches, 'clientY')
  20543. this.handleInputEnd.call(this, t, i, !0)
  20544. }
  20545. }),
  20546. (t.prototype.onPointerDown = function (e) {
  20547. return (
  20548. e.currentTarget !== document && e.currentTarget.focus(),
  20549. this.mouseDown || 'mouse' === e.pointerType
  20550. ? this.onMouseDown(e)
  20551. : ((this.couldBeLongTap = !0),
  20552. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20553. void (this.mouseDownTimer = setTimeout(
  20554. function () {
  20555. this.updateIntersect(), this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20556. }.bind(this),
  20557. k.input.longTapThreshold
  20558. )))
  20559. )
  20560. }),
  20561. (t.prototype.onPointerMove = function (e) {
  20562. 'mouse' !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20563. }),
  20564. (t.prototype.onPointerUp = function (e) {
  20565. return this.mouseDown && 'mouse' !== e.pointerType
  20566. ? (clearTimeout(this.mouseDownTimer), (this.couldBeLongTap = !1), this.updateIntersect(), void this.handleInputEnd.call(this, e.clientX, e.clientY, !0))
  20567. : this.onMouseUp(e)
  20568. }),
  20569. (t.prototype.onPointerOut = function (e) {
  20570. this.mouseDown = !1
  20571. }),
  20572. (t.prototype.onPointerCancel = function (e) {
  20573. this.mouseDown = !1
  20574. }),
  20575. (t.prototype.onKeyDown = function (e) {
  20576. var t = function () {
  20577. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, 'key')
  20578. }.bind(this),
  20579. i = e.which
  20580. switch (i) {
  20581. case l.F:
  20582. t(), this.changeFloor(-1)
  20583. break
  20584. case l.R:
  20585. t(), this.changeFloor(1)
  20586. }
  20587. if (this.mode === V.PANORAMA)
  20588. switch (i) {
  20589. case l.UPARROW:
  20590. case l.W:
  20591. this.flyLocalDirection(T.FORWARD.clone())
  20592. break
  20593. case l.DOWNARROW:
  20594. case l.S:
  20595. this.flyLocalDirection(T.BACK.clone())
  20596. break
  20597. case l.A:
  20598. this.flyLocalDirection(T.LEFT.clone())
  20599. break
  20600. case l.D:
  20601. this.flyLocalDirection(T.RIGHT.clone())
  20602. }
  20603. }),
  20604. (t.prototype.handleScrollPinchZoom = function (e) {
  20605. var t = e,
  20606. i = this.zoomLevel
  20607. this.zoomBy(t), this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20608. }),
  20609. (t.prototype.handleControlPinch = function (e) {
  20610. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0, 0, e).normalize())
  20611. }),
  20612. (t.prototype.handleControlScroll = function (e) {
  20613. k.zoom.enabled
  20614. ? (0 < e ? (e = 1 + this.scrollZoomSpeed) : e < 0 && (e = 1 - this.scrollZoomSpeed), 0 !== e && this.handleScrollPinchZoom(e))
  20615. : this.flyLocalDirection(new B.Vector3(0, 0, -e).normalize())
  20616. }),
  20617. (t.prototype.handleInputStart = function (e, t, i) {
  20618. var n = this.handelPadding(e, t)
  20619. ;(e = n.x),
  20620. (t = n.y),
  20621. (this.isTouchEvent = i),
  20622. U.convertScreenPositionToNDC(e, t, this.mouse),
  20623. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20624. (this.mouseCouldBeClickToMove = !0),
  20625. (this.mouseDown = !0)
  20626. //this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  20627. this.mouseCouldBeClickToMove && editTool.hotpoint.addHot()
  20628. window.transformControls && transformControls.onPointerDown()
  20629. }),
  20630. (t.prototype.handelPadding = function (e, t) {
  20631. return (
  20632. this.pad ||
  20633. (this.pad = {
  20634. x: dom.getOffset('left', $('#player')[0]),
  20635. y: dom.getOffset('top', $('#player')[0])
  20636. }),
  20637. {
  20638. x: e - this.pad.x,
  20639. y: t - this.pad.y
  20640. }
  20641. )
  20642. }),
  20643. (t.prototype.handleInputMove = function (e, t, i) {
  20644. var n = this.handelPadding(e, t)
  20645. ;(e = n.x), (t = n.y), (this.isTouchEvent = i), U.convertScreenPositionToNDC(e, t, this.mouse)
  20646. var moveToleranceNDC = window.transformControls && transformControls.visible ? 0.0000001 : k.input.moveToleranceNDC
  20647. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && ((this.mouseCouldBeClickToMove = !1), (this.couldBeLongTap = !1), clearTimeout(this.mouseDownTimer)),
  20648. (this.mouseLastMoveTime = Date.now()),
  20649. this.reticule.move(e, t, i)
  20650. window.transformControls && transformControls.onPointerMove()
  20651. }),
  20652. (t.prototype.handleInputEnd = function (e, t, i) {
  20653. if (((this.isTouchEvent = i), (this.mouseDown = !1), this.cameraControls.controls[V.PANORAMA].emit('interaction.direct'), !i && this.couldBeLongTap)) return !0
  20654. if (this.handleLongTap()) return !0
  20655. window.transformControls && transformControls.onPointerUp()
  20656. if (this.mouseCouldBeClickToMove) {
  20657. if (this.flying) return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType), !0
  20658. //add----
  20659. if (this.checkHotClick()) return !0
  20660. if (window.VisiSet && VisiSet.setPanoVisible) {
  20661. //正在设置漫游可行
  20662. this.intersect && this.intersect.object.visible && VisiSet.dealPanoVisible(this.intersect.object.name)
  20663. return
  20664. }
  20665. if (window.VisiSet && VisiSet.setTagVisible) {
  20666. VisiSet.tagVsetting && this.intersect && this.intersect.object.visible && VisiSet.dealTagVisible(VisiSet.tagVsetting, this.intersect.object.name)
  20667. return
  20668. }
  20669. if (window.VisiSet && VisiSet.setPanoLog) {
  20670. this.intersect && this.intersect.object.visible && VisiSet.dealPanoLogClick(this.intersect.object)
  20671. return
  20672. }
  20673. if (window.VisiSet && VisiSet.setRoute) {
  20674. this.intersect && this.intersect.object.visible && VisiSet.dealRouteClick(this.intersect.object)
  20675. return
  20676. }
  20677. if (this.hoveringPlane) {
  20678. this.clickOverlay(this.hoveringPlane)
  20679. return
  20680. }
  20681. if (window.EditOverlay && EditOverlay.objCursorType == 'overlay') {
  20682. return EditOverlay.addPlane({ intersect: this.intersect })
  20683. }
  20684. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  20685. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  20686. else if(objects.mainDesign.editType == "addOverlay")return !0;
  20687. } */
  20688. //----------
  20689. if (this.intersect) {
  20690. // for cad add door etc.
  20691. let result = {}
  20692. this.emit('getIntersect', this.intersect, state => {
  20693. //consume
  20694. result.consume = true
  20695. })
  20696. if (result.consume) return //有效使用了,就return
  20697. }
  20698. if ((this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? 'touch' : 'mouse'), this.history.invalidate(), this.intersect))
  20699. return this.flyToPanoClosestToMouse()
  20700. if (this.mode === V.PANORAMA) {
  20701. var n = this.closestPanoInDirection(this.getMouseDirection())
  20702. return n
  20703. ? this.flyToPano({
  20704. pano: n
  20705. })
  20706. : this.bump(this.getMouseDirection())
  20707. }
  20708. }
  20709. //this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20710. }),
  20711. (t.prototype.handleLongTap = function () {
  20712. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA)) return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, 'touch'), !0
  20713. }),
  20714. (t.prototype.checktagClick = function () {
  20715. if (this.tagManager.intersectTag) {
  20716. var e = this.isTouchEvent,
  20717. t = this.tagManager.clickedOnTag(e, this)
  20718. return e || t || G.cancelById(q.LookTransition), !0
  20719. }
  20720. if (this.tagManager.activeTag) return this.tagManager.dismissActiveTag(), !1
  20721. }),
  20722. (t.prototype.rankedtagInDirection = function (e, t) {
  20723. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20724. }),
  20725. (t.prototype.start = function (e) {
  20726. $('.toolLeft').removeClass('unable')
  20727. $('.toolTop').removeClass('unable')
  20728. //-------------------
  20729. window.initTransformCtl(B)
  20730. //this.model.loadOverlays()
  20731. //window.EditOverlay && window.EditOverlay.init(B);
  20732. window.VisiSet && VisiSet.init()
  20733. //-------------------
  20734. var t = e.mode,
  20735. i = e.pano,
  20736. n = e.position,
  20737. r = e.quaternion,
  20738. o = e.tag,
  20739. a = e.quickstart,
  20740. s = $.Deferred()
  20741. this.updateModelDependentData(), this.updateFromControls(), this.findDefaultViews()
  20742. var l = this.is360View(t, i)
  20743. return (
  20744. !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20745. s.done(
  20746. function (e) {
  20747. this.emit(W.Ready, l, e, o)
  20748. }.bind(this)
  20749. ),
  20750. s.promise()
  20751. )
  20752. }),
  20753. (t.prototype.startOutside = function (e, t) {
  20754. var i = e.mode,
  20755. n = e.pano,
  20756. r = e.position,
  20757. o = e.quaternion,
  20758. a = e.zoom,
  20759. s = e.floorVisibility,
  20760. l = e.tag
  20761. this.emit(W.StartOutside, k[i].transitionTime),
  20762. this.isOutsideMode(i)
  20763. ? (this.model.warpDestFloors(s, !0), G.cancelById(q.FlyToViewFloor), i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o), t.resolve(!1))
  20764. : this.startInsideWithFlyin(n, r, o, l, t)
  20765. }),
  20766. (t.prototype.startInside = function (e, t, i, n, r) {
  20767. r = r || $.Deferred()
  20768. var o = (this.currentPano = e) && !e.isAligned()
  20769. window.bus.dispatchEvent({ type: 'playerAndModelReady' })
  20770. this.ready = true
  20771. if (((t = o ? e.position : t || e.position), (i = i || e.quaternion), e)) {
  20772. var a = this.startInside.bind(this, e, t, i, n, r)
  20773. if (this.checkAndWaitForPanoLoad(e, 'high', 'low', this.basePanoSize, a)) return
  20774. }
  20775. //add
  20776. this.transitionPos({ type: 'beforeFlytopano', pano: this.currentPano, dur: 0 })
  20777. //this.updateHotVisible()
  20778. //EditOverlay.updatePano()
  20779. editTool.hotpoint.updatePano()
  20780. Hot.updateVisibles([this.currentPano])
  20781. return (
  20782. (this.mode = V.PANORAMA),
  20783. e.floor.enter(this.mode),
  20784. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  20785. this.switchCameraMode(this.mode, i),
  20786. this.emit(W.StartInside, o),
  20787. r.resolve(!0),
  20788. r
  20789. )
  20790. }),
  20791. (t.prototype.startInsideWithFlyin = function (i, e, n, t, r) {
  20792. if (((r = r || $.Deferred()), this.dollhouseMode(), !i)) return Y.warn('Player.startInsideWithFlyin() -> targetPano is invalid.'), r.resolve(!1), r
  20793. e = e || i.position
  20794. var o = n || this.cameraControls.activeControl.camera.quaternion,
  20795. a = i.position
  20796. return (
  20797. this.fitDollhouse(a, e, o),
  20798. setTimeout(
  20799. function (e) {
  20800. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e)
  20801. var t = {
  20802. mode: V.PANORAMA,
  20803. pano: i,
  20804. quaternion: n,
  20805. callback: function () {
  20806. this.emit(W.FlyinFinished), r.resolve(!0)
  20807. }.bind(this)
  20808. }
  20809. this.flyToNewMode(t)
  20810. }.bind(this, this.cameraControls.activeControl.maxDistance),
  20811. k.startupFlyinDelay
  20812. ),
  20813. r
  20814. )
  20815. }),
  20816. (t.prototype.checkAndWaitForPanoLoad =
  20817. ((Z = {}),
  20818. (K = {}),
  20819. function (t, e, i, n, r, o, a, s, l, c) {
  20820. if (
  20821. (function () {
  20822. for (var e in Z) if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3) return !0
  20823. return !1
  20824. })()
  20825. )
  20826. return !0
  20827. var h = function (e, t, i) {
  20828. j.delayOneFrame(
  20829. function () {
  20830. ;(Z[e] = !1), r && r(t, i)
  20831. }.bind(this)
  20832. )
  20833. }.bind(this, t.id),
  20834. u = function (e, t) {
  20835. j.delayOneFrame(
  20836. function () {
  20837. ;(Z[e] = !1), o && o(t)
  20838. }.bind(this)
  20839. )
  20840. }.bind(this, t.id)
  20841. try {
  20842. return (
  20843. null != s || (s = !0),
  20844. this.model.supportsTiles ? (Z[t.id] = this.checkAndWaitForTiledPanoLoad(t, n, h, u, a, s, l, c)) : (Z[t.id] = this.checkAndWaitForWholePanoLoad(t, e, i, h, s)),
  20845. Z[t.id] && (K[t.id] = performance.now()),
  20846. Z[t.id]
  20847. )
  20848. } catch (e) {
  20849. throw ((Z[t.id] = !1), (K[t.id] = performance.now() - 5e3), e)
  20850. }
  20851. })),
  20852. (t.prototype.checkAndWaitForWholePanoLoad = function (e, t, i, n, r) {
  20853. if (!e) throw new p('Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.')
  20854. return (
  20855. r &&
  20856. this.model.waitForLoad(e, function () {
  20857. return e.isLoaded(i)
  20858. }),
  20859. !e.isLoaded(t) && (e.loadCube(t).done(n), !0)
  20860. )
  20861. }),
  20862. (t.prototype.checkAndWaitForTiledPanoLoad =
  20863. ((X = new B.Vector3()),
  20864. function (e, t, i, n, r, o, a, s) {
  20865. if (!e) throw new p('Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.')
  20866. return (
  20867. X.copy(T.FORWARD),
  20868. this.getDirection(X),
  20869. !e.isLoaded(t) &&
  20870. (o &&
  20871. this.model.waitForLoad(e, function () {
  20872. return e.isLoaded(t)
  20873. }),
  20874. e
  20875. .loadTiledPano(t, X, null, a, s)
  20876. .done(
  20877. function (e, t) {
  20878. i && i(e, t)
  20879. }.bind(this)
  20880. )
  20881. .fail(
  20882. function (e) {
  20883. n && n(e)
  20884. }.bind(this)
  20885. )
  20886. .progress(
  20887. function (e, t, i) {
  20888. r && r(e, t, i)
  20889. }.bind(this)
  20890. ),
  20891. !0)
  20892. )
  20893. })),
  20894. (t.prototype.switchCameraMode = function (mode, quaternion, target, position, { currentScale, fitBoundSize } = {}) {
  20895. var control = this.cameraControls.controls[mode],
  20896. camera = control.camera
  20897. if (mode == V.PANORAMA) {
  20898. camera.position.copy(this.currentPano.position)
  20899. var r = quaternion ? T.FORWARD.clone().applyQuaternion(quaternion) : this.getDirection().setY(0).normalize()
  20900. control.lookAt(r.add(camera.position))
  20901. } else {
  20902. if (target) {
  20903. control.target.copy(target)
  20904. }
  20905. if (position) {
  20906. camera.position.copy(position)
  20907. }
  20908. if (mode == V.DOLLHOUSE) {
  20909. var o = this.position.clone()
  20910. this.mode === V.PANORAMA
  20911. ? o.add(new B.Vector3(0, 6, 0)).add(this.getDirection().multiplyScalar(-10))
  20912. : o.add(T.DOWN.clone().applyQuaternion(this.quaternion).multiplyScalar(6)).setY(6),
  20913. camera.position.copy(o),
  20914. control.target.copy(this.target.clone().setY(this.model.center.y))
  20915. //for多楼层 且 让模型刚好适应屏幕
  20916. /* var box = this.model.boundingBox.clone();
  20917. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  20918. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  20919. var fov = A.getHFOVFromVFOV(k.insideFOV, camera.aspect, 1); //获得在当前窗口的横向的fov
  20920. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  20921. console.log(boxSize.x,distance, boxSize.length() / 2)
  20922. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  20923. if(this.mode === V.PANORAMA){
  20924. control.target.copy(this.model.center);
  20925. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  20926. }else{
  20927. control.target.copy(this.target.clone().setY(this.model.center.y))
  20928. var vec = T.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  20929. }
  20930. vec.multiplyScalar(distance )
  20931. camera.position.copy(control.target.clone().add(vec)) */
  20932. }
  20933. if (mode == V.FLOORPLAN) {
  20934. if (!target) {
  20935. control.target.copy(this.model.center).setY(0)
  20936. }
  20937. if (!position) {
  20938. camera.position.copy(control.target).setY(k.floorplan.cameraHeight), control.rotateToView(this.model.size, this.getDirection())
  20939. }
  20940. if (currentScale) {
  20941. control.currentScale = control.absoluteScale = currentScale
  20942. } else if (fitBoundSize) {
  20943. control.zoomToContain(fitBoundSize)
  20944. } else {
  20945. control.zoomToContain(this.model.size)
  20946. }
  20947. }
  20948. }
  20949. control.update(0)
  20950. }),
  20951. (t.prototype.update =
  20952. (new B.Vector3(),
  20953. (N = {}),
  20954. (F = []),
  20955. function (e) {
  20956. this.updatePersistentZooming(e), this.updateFromControls(e), this.getCurrentNodePanos(F)
  20957. if (this.hasChanged(N)) {
  20958. ;(this.lastChangeTime = Date.now()), !this.mouseDown && this.containsMouse && this.updateIntersect()
  20959. this.emit(W.ViewChanged, N)
  20960. //add:
  20961. if (N.cameraChanged) {
  20962. Hot.updateHots()
  20963. this.mode == 'panorama' && window.cad && cad.setSign({ x: this.position.x, y: this.position.z }, this.cameraControls.controls.panorama.lon)
  20964. }
  20965. }
  20966. this.model.supportsTiles && (this.updateTileDownloader(F), this.updatePanoRenderer(F)),
  20967. this.updatePreRendering(F),
  20968. this.reticule.update(),
  20969. this.path.update(),
  20970. this.spider.update(),
  20971. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  20972. this.updateControlLocks(),
  20973. this.model.supportsTiles && this.updateZoomPano()
  20974. })),
  20975. (t.prototype.updatePersistentZooming = function (e) {
  20976. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  20977. }),
  20978. (t.prototype.updateControlLocks = function () {
  20979. this.currentPano &&
  20980. this.model.supportsTiles &&
  20981. (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  20982. }),
  20983. (t.prototype.updatePanoRenderer =
  20984. ((D = new B.Vector3()),
  20985. function (e) {
  20986. var t = this.nextPano || this.currentPano
  20987. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD), this.getDirection(D), this.panoRenderer.updateDirection(D))
  20988. })),
  20989. (t.prototype.cleanupInactivePanos =
  20990. ((O = []),
  20991. (L = []),
  20992. function () {
  20993. ;(O.length = 0), O.push(this.currentPano), this.nextPano && O.push(this.nextPano)
  20994. for (var e = (L.length = 0); e < this.panoRenderer.activePanos.length; e++) L.push(this.panoRenderer.activePanos[e])
  20995. for (var t = 0; t < L.length; t++) {
  20996. for (var i = L[t], n = !0, r = 0; r < O.length; r++) i.id === O[r].id && (n = !1)
  20997. n && i.exit()
  20998. }
  20999. })),
  21000. (t.prototype.updatePreRendering =
  21001. ((w = {}),
  21002. function (e) {
  21003. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  21004. var t = this.nextPano || this.currentPano
  21005. if (t && e && 1 < e.length) {
  21006. var i = e.findIndex(function (e) {
  21007. if (e.id === t.id) return !0
  21008. })
  21009. if (0 <= i && i + 1 < e.length) {
  21010. var n = e[i + 1]
  21011. n.isLoaded(this.basePanoSize) ||
  21012. w[n.id] ||
  21013. (window.setTimeout(
  21014. function (e) {
  21015. this.checkAndWaitForPanoLoad(e, 'high', 'low', this.basePanoSize, null, null, null, !1, !1, !1),
  21016. window.setTimeout(
  21017. function (e) {
  21018. w[e.id] = !1
  21019. }.bind(this, e),
  21020. k.tiling.panoPreRenderRepeatDelay
  21021. )
  21022. }.bind(this, n),
  21023. k.tiling.panoPreRenderDelay
  21024. ),
  21025. (w[n.id] = !0))
  21026. }
  21027. }
  21028. }
  21029. })),
  21030. (t.prototype.enablePreRendering = function () {
  21031. this.preRenderingEnabled = !0
  21032. }),
  21033. (t.prototype.disablePreRendering = function () {
  21034. ;(this.preRenderingEnabled = !1), this.cleanupInactivePanos()
  21035. }),
  21036. (t.prototype.updateTileDownloader =
  21037. ((b = new B.Vector3()),
  21038. function (e) {
  21039. var t = this.nextPano || this.currentPano
  21040. t &&
  21041. (b.copy(T.FORWARD),
  21042. this.getDirection(b),
  21043. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  21044. (this.tileDownloader.processPriorityQueue = !0))
  21045. })),
  21046. (t.prototype.updateFromControls = function (e) {
  21047. null != e || (e = 0),
  21048. this.cameraControls.activeControl &&
  21049. (this.cameraControls.activeControl.update(e),
  21050. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21051. this.position.copy(this.cameraControls.activeControl.camera.position),
  21052. this.target.copy(this.cameraControls.activeControl.target),
  21053. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21054. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21055. this.camera.position.copy(this.position),
  21056. this.camera.quaternion.copy(this.quaternion),
  21057. this.camera.updateMatrix(),
  21058. this.camera.updateMatrixWorld()
  21059. }),
  21060. (t.prototype.hasChanged = function (e) {
  21061. if (!this.previousState) {
  21062. e.cameraChanged = true
  21063. return (
  21064. (this.previousState = {
  21065. allFloorsVisible: this.model.allFloorsVisible,
  21066. position: this.position.clone(),
  21067. quaternion: this.quaternion.clone(),
  21068. mouse: this.mouse.clone(),
  21069. labelScaleFactor: this.getLabelScaleFactor(),
  21070. currentFloor: this.model.currentFloor,
  21071. projectionMatrix: this.camera.projectionMatrix.clone(),
  21072. worldMatrix: this.camera.matrixWorld.clone(),
  21073. mode: this.mode,
  21074. modelPosition: this.model.position.clone(),
  21075. modelCenter: this.model.center.clone(),
  21076. zoomLevel: this.zoomLevel
  21077. }),
  21078. !0
  21079. )
  21080. }
  21081. //许钟文改 分成相机是否改变cameraChanged 和其他
  21082. var a =
  21083. this.position.equals(this.previousState.position) &&
  21084. this.quaternion.equals(this.previousState.quaternion) &&
  21085. this.camera.matrixWorld.equals(this.previousState.worldMatrix) &&
  21086. this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) &&
  21087. this.mode === this.previousState.mode &&
  21088. this.zoomLevel === this.previousState.zoomLevel &&
  21089. this.model.center.equals(this.previousState.modelCenter) &&
  21090. this.model.position.equals(this.previousState.modelPosition)
  21091. var t =
  21092. a &&
  21093. this.mouse.equals(this.previousState.mouse) &&
  21094. this.model.allFloorsVisible === this.previousState.allFloorsVisible /* && this.getLabelScaleFactor() === this.previousState.labelScaleFactor */ &&
  21095. this.model.currentFloor === this.previousState.currentFloor &&
  21096. null === this.nextPano
  21097. e.cameraChanged = !a
  21098. //var t = this.model.allFloorsVisible === this.previousState.allFloorsVisible && this.position.equals(this.previousState.position) && this.quaternion.equals(this.previousState.quaternion) && this.mouse.equals(this.previousState.mouse) && this.getLabelScaleFactor() === this.previousState.labelScaleFactor && this.model.currentFloor === this.previousState.currentFloor && this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) && this.camera.matrixWorld.equals(this.previousState.worldMatrix) && this.mode === this.previousState.mode && this.model.position.equals(this.previousState.modelPosition) && this.model.center.equals(this.previousState.modelCenter) && null === this.nextPano && this.zoomLevel === this.previousState.zoomLevel;
  21099. return (
  21100. (e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible),
  21101. (e.moved = !this.position.equals(this.previousState.position)),
  21102. (e.rotated = !this.quaternion.equals(this.previousState.quaternion)),
  21103. (e.mouseMoved = !this.mouse.equals(this.previousState.mouse)),
  21104. (e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor),
  21105. (e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor),
  21106. (e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix)),
  21107. (e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix)),
  21108. (e.modeChanged = this.mode !== this.previousState.mode),
  21109. (e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition)),
  21110. (e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter)),
  21111. (e.nextPanoActive = null !== this.nextPano),
  21112. (e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel),
  21113. (this.previousState.allFloorsVisible = this.model.allFloorsVisible),
  21114. this.previousState.position.copy(this.position),
  21115. this.previousState.quaternion.copy(this.quaternion),
  21116. this.previousState.mouse.copy(this.mouse),
  21117. (this.previousState.labelScaleFactor = this.getLabelScaleFactor()),
  21118. (this.previousState.currentFloor = this.model.currentFloor),
  21119. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21120. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21121. (this.previousState.mode = this.mode),
  21122. this.previousState.modelPosition.copy(this.model.position),
  21123. this.previousState.modelCenter.copy(this.model.center),
  21124. (this.previousState.zoomLevel = this.zoomLevel),
  21125. !t
  21126. )
  21127. }),
  21128. (t.prototype.updateIntersect = function () {
  21129. var e = this.flying || this.isWarping(),
  21130. t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged(),
  21131. i = G.getById(q.LookTransition)
  21132. e || t || this.isTouchEvent || (i.length && i[0].running)
  21133. {
  21134. //clear:
  21135. //if(this.intersectHot) this.intersectHot.hideTitle()
  21136. if (this.intersectHot) this.intersectHot.setHoverState(false)
  21137. this.intersectHot = null
  21138. //$("#player").css("cursor", "")
  21139. CursorDeal.remove('hoverFootIcon')
  21140. CursorDeal.remove('hoverRouteLine')
  21141. CursorDeal.remove('hoverHot')
  21142. $('.toolRight .spotList ul li').removeClass('active')
  21143. }
  21144. var deal = () => {
  21145. if (this.intersect && this.intersect.object.visible) {
  21146. if ('hotSprite' == this.intersect.object.type) {
  21147. this.intersectHot = this.intersect.object
  21148. while (!(this.intersectHot instanceof Hot)) {
  21149. this.intersectHot = this.intersectHot.parent
  21150. }
  21151. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass('active')
  21152. this.intersectHot.setHoverState(true)
  21153. }
  21154. }
  21155. }
  21156. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog || VisiSet.setRoute)) {
  21157. let meshes = this.model.hotGroup.children.slice()
  21158. if (VisiSet.routeInfo?.operation == 'removeLink') {
  21159. meshes.push(...VisiSet.meshGroup.children.filter(e => e.name.includes('routeLine:')))
  21160. } else {
  21161. meshes.push(...VisiSet.footIcons)
  21162. }
  21163. this.intersect = this.getMouseIntersect(null, meshes)
  21164. deal()
  21165. if (this.intersect) {
  21166. if (VisiSet.routeInfo?.operation == 'removeLink') {
  21167. CursorDeal.add('hoverRouteLine')
  21168. } else {
  21169. CursorDeal.add('hoverFootIcon') //$("#player").css("cursor", "pointer");
  21170. }
  21171. }
  21172. if (this.intersectHot) {
  21173. this.intersect = null
  21174. }
  21175. return
  21176. } else if (g_HotStatus) {
  21177. //加热点
  21178. this.intersect = this.getMouseIntersect(null, this.model.colliders.concat(this.model.skybox))
  21179. if (this.intersect) {
  21180. //$("#player").css("cursor", "cell")
  21181. CursorDeal.remove('noIntersect')
  21182. } else {
  21183. //$("#player").css("cursor", "not-allowed")
  21184. CursorDeal.add('noIntersect')
  21185. }
  21186. return
  21187. } else {
  21188. if (this.model.hotGroup) {
  21189. if (editTool.atPanel == 'hotpoint') {
  21190. var hots = this.model.hotGroup.children
  21191. } else {
  21192. var hots = this.model.hotGroup.children.filter(e => e.info.actionType.examine || e.info.actionType.fastTran || e.info.actionType.openHot || e.info.actionType.playAndPause)
  21193. }
  21194. let colliders = this.model.floors.reduce(
  21195. function (e, t) {
  21196. return t.hidden ? e : e.concat(t.collider.children)
  21197. },
  21198. this.mode === 'panorama' ? this.panoMarkers : []
  21199. )
  21200. this.intersect = this.getMouseIntersect(null, hots.concat(colliders))
  21201. if (this.intersect) {
  21202. deal()
  21203. this.intersectHot && CursorDeal.add('hoverHot') //$("#player").css("cursor", "pointer");
  21204. if (this.intersect) {
  21205. deal()
  21206. let intersect = this.intersect
  21207. if (this.intersectHot) {
  21208. this.intersect = null
  21209. $('#player').css('cursor', 'pointer')
  21210. } else {
  21211. if (intersect.object.parent.parent.hidden) {
  21212. //楼层已隐藏
  21213. this.intersect = null
  21214. }
  21215. }
  21216. }
  21217. }
  21218. } else {
  21219. this.intersect = this.getMouseIntersect()
  21220. }
  21221. }
  21222. this.intersect && this.updateClosestPano(this.intersect),
  21223. this.closestPano || this.closestPanoInDirection(this.getMouseDirection())
  21224. ? (this.reticule.updatePosition(this.position, this.intersect), k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection()))
  21225. : this.reticule.hide()
  21226. }),
  21227. (t.prototype.checkHotClick = function () {
  21228. if (this.intersectHot) {
  21229. if (window.VisiSet && VisiSet.setTagVisible) {
  21230. VisiSet.SetOneTagVisible(this.intersectHot) //设置这个热点的可见性
  21231. return
  21232. } else if (editTool.atPanel == 'hotpoint') {
  21233. let f = () => {
  21234. editTool.hotpoint.editHot(this.intersectHot)
  21235. }
  21236. if (editTool.hotpoint.editSpot && this.intersectHot != editTool.hotpoint.editSpot) {
  21237. editTool.hotpoint.unsaveWarn(f)
  21238. } else {
  21239. f()
  21240. }
  21241. } else {
  21242. if (this.intersectHot.texType == 'video' && this.intersectHot.info.actionType.playAndPause) {
  21243. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  21244. }
  21245. this.intersectHot.examine()
  21246. }
  21247. return !0
  21248. }
  21249. }),
  21250. (t.prototype.getMouseDirection = function (e) {
  21251. e = e || this.mouse
  21252. var t = new B.Vector3(e.x, e.y, -1).unproject(this.camera)
  21253. return new B.Vector3(e.x, e.y, 1).unproject(this.camera).sub(t).normalize()
  21254. }),
  21255. /* t.prototype.hoverOverlay = function(mesh){
  21256. if(!mesh){
  21257. this.hoveringPlane = null;
  21258. $("#player").css("cursor",this.currentCursor || "" );
  21259. }else{
  21260. var overlay = mesh.parent;
  21261. $("#player").css("cursor","pointer");
  21262. this.hoveringPlane = overlay;
  21263. return true;
  21264. }
  21265. }, */
  21266. (t.prototype.clickOverlay = function (overlay) {
  21267. if (this.openOverlay && !overlay) return
  21268. var plane = overlay.plane
  21269. if (overlay.texType == 'video') {
  21270. overlay.switchPlay(!!overlay.pausedByUser)
  21271. }
  21272. if (window.EditOverlay && EditOverlay.editing) {
  21273. if (EditOverlay.editPlane && overlay != EditOverlay.editPlane) {
  21274. var sure = confirm('是否保存当前展览?')
  21275. if (sure) {
  21276. $('#overlayProp button.submit').click()
  21277. } else {
  21278. EditOverlay.closeOverlayPanel('cancel')
  21279. }
  21280. }
  21281. EditOverlay.beginEdit(overlay)
  21282. return
  21283. }
  21284. }),
  21285. (t.prototype.getMouseIntersect = function (e, t1) {
  21286. e = e || this.mouse.clone()
  21287. var t =
  21288. t1 ||
  21289. this.model.floors.reduce(
  21290. function (e, t) {
  21291. return t.hidden ? e : e.concat(t.collider.children)
  21292. },
  21293. this.mode === V.PANORAMA ? this.panoMarkers : []
  21294. ),
  21295. t = t.slice(0)
  21296. i = new B.Vector3(e.x, e.y, -1).unproject(this.camera)
  21297. this.raycaster.set(i, this.getMouseDirection(e))
  21298. var n = this.raycaster.intersectObjects(t, true) //add true
  21299. var o = n[0]
  21300. if (o) {
  21301. o.face &&
  21302. ((o.normal = o.face.normal.applyQuaternion(o.object.quaternion)),
  21303. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  21304. this.currentPano ? (o.onFloor = o.point.y < this.position.y - 0.5 * this.currentPano.height) : (o.onFloor = o.point.y < this.position.y - 0.5),
  21305. (o.horizontal = 0.8 < o.normal.y))
  21306. return o
  21307. }
  21308. }),
  21309. (t.prototype.updateClosestPano = function (e) {
  21310. var t = [a.filters.isPanoAligned()]
  21311. if (this.mode === V.PANORAMA) {
  21312. if (!this.currentPano) return
  21313. t.push(a.filters.not(this.currentPano)),
  21314. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  21315. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), 0.25)),
  21316. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  21317. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  21318. } else {
  21319. t.push(a.filters.isOnVisibleFloor()), t.push(this.checkHasNeighbor) //add
  21320. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), 0.25))
  21321. }
  21322. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)])
  21323. i !== this.closestPano
  21324. ? (i && (this.isPanoHover = !0),
  21325. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  21326. (this.closestPano = i),
  21327. this.closestPano && this.mode == 'panorama'
  21328. ? CursorDeal.add('hoverPano') /*, this.reticule.visible = false */
  21329. : CursorDeal.remove('hoverPano') /*, this.reticule.visible = true */)
  21330. : (this.isPanoHover = !1)
  21331. }),
  21332. (t.prototype.dollhouseMode = function (e, t) {
  21333. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE), (this.mode = V.DOLLHOUSE), this.cameraControls.controls[V.DOLLHOUSE].reset()
  21334. var i = new B.Vector3(this.model.center.x, 0, this.model.center.z),
  21335. n = new B.Vector3(15, 10, 15)
  21336. if (e && t) {
  21337. var r = T.FORWARD.clone().applyQuaternion(t),
  21338. o = this.model.center.clone().sub(e).dot(r)
  21339. 0 < o ? ((i = r.clone().multiplyScalar(o).add(e)), n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21340. }
  21341. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  21342. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21343. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21344. this.updateFromControls(),
  21345. (this.model.alpha = 1),
  21346. (this.model.skybox.material.uniforms.opacity.value = 0)
  21347. }),
  21348. (t.prototype.insideMode = function (e, t) {
  21349. var i = $.Deferred(),
  21350. n = t || null
  21351. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21352. var r = [a.filters.isPanoAligned()]
  21353. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21354. (e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)])),
  21355. this.flyToNewMode({
  21356. mode: V.PANORAMA,
  21357. pano: e,
  21358. callback: n
  21359. })
  21360. .done(i.resolve.bind(i))
  21361. .fail(i.reject.bind(i))
  21362. } else {
  21363. var o = this.mode === V.PANORAMA ? 'Already in panorama mode' : 'Cannot change mode during mode transition'
  21364. i.reject(o)
  21365. }
  21366. return i.promise()
  21367. }),
  21368. (t.prototype.fitDollhouse = function (e, t, i) {
  21369. var maxY = this.model.boundingBox.max.y //add
  21370. var n = T.FORWARD.clone().applyQuaternion(i)
  21371. i = n.clone().add(e)
  21372. this.cameraControls.activeControl.target.copy(i),
  21373. this.cameraControls.activeControl.camera.position
  21374. .set(0, maxY * 2.4, 0)
  21375. .add(e)
  21376. .add(n.multiplyScalar(-10))
  21377. }),
  21378. (t.prototype.floorplanMode = function (e, t, i) {
  21379. this.mode = V.FLOORPLAN
  21380. var n = this.cameraControls.controls[V.FLOORPLAN]
  21381. n.reset()
  21382. var r = e || this.model.center
  21383. if (
  21384. (n.target.copy(r).setY(0),
  21385. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21386. i ? ((n.currentScale = i / ($('#player').width() / $('#player').height())), (n.absoluteScale = n.currentScale)) : n.zoomToContain(this.model.size),
  21387. t)
  21388. ) {
  21389. var o = T.LEFT.clone().applyQuaternion(t)
  21390. n.rotateLeft(-Math.atan2(o.x, o.z))
  21391. } else n.rotateToView(this.model.size, this.getDirection())
  21392. n.update(0)
  21393. }),
  21394. (t.prototype.nonInterruptingFlyToPano = function (e, t) {
  21395. return (e.skipWarpingCheck = !0), this.flyToPano(e, t)
  21396. }),
  21397. (t.prototype.updateMarkerVisi = function () {
  21398. //加
  21399. if (this.mode != 'panorama') return
  21400. this.model.panos.list.forEach(pano => {
  21401. if (!pano.marker) return
  21402. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id]
  21403. })
  21404. }),
  21405. /* t.prototype.updateHotVisible = function(pano){
  21406. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setPanoLog))return
  21407. var hots = this.model.hots;
  21408. pano = pano || this.currentPano;
  21409. for (var index in hots){
  21410. var visible;
  21411. if(this.mode != "panorama"){
  21412. visible = true;
  21413. }else{
  21414. //hots[index].mesh.material.depthTest = false;
  21415. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  21416. }
  21417. hots[index].mesh.visible = visible;
  21418. }
  21419. }
  21420. */
  21421. (t.prototype.flyToPano = function (e, t) {
  21422. var i,
  21423. n = e.pano,
  21424. aim = e.lookAtPoint,
  21425. aimQua = e.quaternion, //ADD
  21426. o = e.duration,
  21427. a = e.aimDuration,
  21428. s = e.maxDistanceOverride,
  21429. l = e.skipWarpingCheck,
  21430. c = e.constantMoveSpeed,
  21431. h = null,
  21432. u = null
  21433. if (aim) {
  21434. var m = new B.Matrix4().lookAt(n.position, aim, T.UP)
  21435. aimQua = new B.Quaternion().setFromRotationMatrix(m)
  21436. } else aimQua = aimQua
  21437. var zoomLevel = e.zoomLevel || 1 //add
  21438. if (this.flying) return t && t(e)
  21439. if (
  21440. (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21441. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21442. )
  21443. return Y.warn('Player.flyToPano() -> Cannot fly when warping'), t && t(), !1
  21444. this.updateLastView()
  21445. if (this.mode !== V.PANORAMA)
  21446. return void this.flyToNewMode({
  21447. mode: V.PANORAMA,
  21448. pano: n,
  21449. duration: o,
  21450. quaternion: aimQua,
  21451. callback: t
  21452. })
  21453. if (
  21454. !n ||
  21455. ((h = x.deepExtend(e)),
  21456. (u = function () {
  21457. j.delayOneFrame(
  21458. function () {
  21459. this.flyToPano(h, t)
  21460. }.bind(this)
  21461. )
  21462. }.bind(this)),
  21463. !this.checkAndWaitForPanoLoad(n, 'high', 'low', this.basePanoSize, u))
  21464. ) {
  21465. var d = function (e) {
  21466. t && t(e)
  21467. }.bind(this)
  21468. this.currentPano || ((this.currentPano = n), this.path.placeCpm(), this.path.fadeOutCpm(k.path.fadeOutTime), this.spider.draw())
  21469. var p = o
  21470. if ('number' != typeof o) {
  21471. var f = s || k.transition.flytimeMaxDistanceThreshold
  21472. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21473. }
  21474. if ((0.01 < k.transition.flySpeed && (p = (1e3 * this.currentPano.position.distanceTo(n.position)) / k.transition.flySpeed), zoomLevel !== this.zoomLevel))
  21475. switch (k.zoom.transitionStyle) {
  21476. case 1:
  21477. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? p / 2 : p) //改
  21478. break
  21479. case 2:
  21480. return (h = x.deepExtend(e)), (u = this.flyToPano.bind(this, h, t)), void this.smoothZoomFovTo(null, zoomLevel, k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21481. }
  21482. if (aimQua) {
  21483. G.cancelById(q.LookTransition), (p *= k.transition.aimSlowFactor)
  21484. var g = this.cameraControls.activeControl.camera.quaternion.clone(),
  21485. y = g.clone(),
  21486. A = new B.Vector3()
  21487. if (n === this.currentPano) {
  21488. var C = T.FORWARD.clone().applyQuaternion(g),
  21489. I = T.FORWARD.clone().applyQuaternion(aimQua),
  21490. E = C.angleTo(I)
  21491. return (
  21492. null != a || (a = ((1 * Math.sqrt(E)) / k.tags.navigate.rotateSpeedFactor) * 1e3),
  21493. void G.start(
  21494. function (e) {
  21495. y.copy(g),
  21496. H.quaternion(y, aimQua)(e),
  21497. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21498. this.cameraControls.activeControl.lookAt(A)
  21499. }.bind(this),
  21500. a,
  21501. d,
  21502. 0,
  21503. z[k.transition.movementEasing],
  21504. null,
  21505. q.LookTransition
  21506. )
  21507. )
  21508. }
  21509. }
  21510. if (n === this.currentPano) return void d()
  21511. this.flying = !0
  21512. var _ = this.position.clone(),
  21513. b = this.currentPano
  21514. Y.debug('Flying to pano ', n.position)
  21515. this.emit(W.PanoChosen, this.currentPano, n)
  21516. this.emit(W.FlyingStarted, n.position, _, n, b)
  21517. this.transitionPos({ type: 'beforeFlytopano', pano: n, dur: p }) //add
  21518. Hot.updateVisibles([this.currentPano, n], 'every')
  21519. aimQua &&
  21520. G.start(
  21521. function (e) {
  21522. y.copy(g), H.quaternion(y, aimQua)(e), A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position), this.cameraControls.activeControl.lookAt(A)
  21523. }.bind(this),
  21524. p,
  21525. null,
  21526. 0,
  21527. z[k.transition.movementEasing],
  21528. null,
  21529. q.LookTransition
  21530. )
  21531. var w = c ? null : z[k.transition.movementEasing]
  21532. this.nextPano = n
  21533. G.start(H.uniform(this.model.skybox, 'progress', 1), p, null, 0, z[k.transition.blendEasing], 'skyFly', q.FlyToPano),
  21534. G.start(H.allUniforms(this.model.chunks, 'progress', 1), p, null, 0, z[k.transition.blendEasing], 'chunkFly', q.FlyToPano),
  21535. G.start(
  21536. H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position),
  21537. p,
  21538. function (e) {
  21539. ;(this.flying = !1),
  21540. this.currentPano !== n && this.currentPano.exit(),
  21541. n.enter(),
  21542. (this.currentPano = n),
  21543. (this.nextPano = null),
  21544. this.path.placeCpm(),
  21545. this.path.fadeOutCpm(k.path.fadeOutTime),
  21546. this.spider.draw(),
  21547. this.emit(W.FlyingEnded, n.position, _, n, b),
  21548. this.updateMarkerVisi() //add
  21549. d(e)
  21550. if (this.mode == 'panorama') {
  21551. //EditOverlay.updatePano()
  21552. editTool.hotpoint.updatePano()
  21553. Hot.updateVisibles([this.currentPano])
  21554. this.model.fadePanoMarkers() //add
  21555. }
  21556. }.bind(this),
  21557. 0,
  21558. w,
  21559. 'camFly',
  21560. q.FlyToPano
  21561. )
  21562. }
  21563. }),
  21564. (t.prototype.blackToPano = function (o = {}) {
  21565. //add 瞬间过渡
  21566. if (this.flying || this.isWarping()) return
  21567. let pano = o.pano || this.model.panos.index[o.panoId]
  21568. if (this.mode != 'panorama') {
  21569. return this.flyToNewMode({
  21570. mode: 'panorama',
  21571. pano,
  21572. quaternion: o.quaternion
  21573. })
  21574. }
  21575. let oldPos = this.position.clone()
  21576. let oldPano = this.currentPano
  21577. this.path.warpDestPano = pano
  21578. var retry = () => {
  21579. ;(this.waitingToWarp = !1), this.blackToPano(o)
  21580. }
  21581. if (this.checkAndWaitForPanoLoad(pano, 'high', 'low', this.basePanoSize, retry)) return void (this.waitingToWarp = !0)
  21582. this.emit('pano.chosen', oldPano, pano)
  21583. console.log('blackToPano')
  21584. this.flying = true
  21585. this.nextPano = pano //提前加载高清图片
  21586. this.path.warpDestHeroLoc = {
  21587. panoId: o.panoId,
  21588. position: pano.position,
  21589. quaternion: o.quaternion || this.quaternion.clone()
  21590. }
  21591. this.path.warpTravel_BLACK(null, 1500, 1, () => {
  21592. pano != this.currentPano && this.currentPano.exit()
  21593. pano.enter()
  21594. this.currentPano = pano
  21595. this.emit('flying.ended', pano.position, oldPos, pano, oldPano)
  21596. this.flying = false
  21597. this.nextPano = null
  21598. this.updateMarkerVisi() //add
  21599. console.log('blackToPano end')
  21600. })
  21601. })
  21602. window._transitionPosId = 9999
  21603. t.prototype.transitionPos = function (o = {}) {
  21604. //渐变overlay和热点的位置
  21605. G.cancelById(_transitionPosId)
  21606. var begin = function (object, pos, qua, scale) {
  21607. if (pos) {
  21608. if (!same(object.position, pos, 0.01)) {
  21609. G.start(H.vector(object.position, pos), o.dur, e => {}, 0, z[k.transition.movementEasing], 'transitionPos', _transitionPosId)
  21610. }
  21611. if (qua && !same(object.quaternion, qua, 1e-6)) {
  21612. G.start(H.quaternion(object.quaternion, qua), o.dur, e => {}, 0, z[k.transition.movementEasing], 'transitionPos', _transitionPosId)
  21613. }
  21614. if (scale && !same(object.scale, scale, 0.001)) {
  21615. G.start(H.vector(object.scale, scale), o.dur, e => {}, 0, z[k.transition.movementEasing], 'transitionPos', _transitionPosId)
  21616. }
  21617. }
  21618. }
  21619. var same = function (vec1, vec2, diff) {
  21620. var s = Math.abs(vec1.x - vec2.x) < diff && Math.abs(vec1.y - vec2.y) < diff && Math.abs(vec1.z - vec2.z) < diff
  21621. if (s && vec1.w) s = Math.abs(vec1.w - vec2.w) < diff
  21622. return s
  21623. }
  21624. var sid = o.pano != void 0 ? o.pano.id : 'outside'
  21625. /* this.model.hotGroup.children.forEach(overlay=>{
  21626. var panoData = overlay.transformAtPanos[sid]
  21627. var useCustom = !panoData
  21628. //if(overlay.usingTransformData || !useCustom){
  21629. var pos = useCustom ? overlay.posCustom : panoData.pos;
  21630. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  21631. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  21632. overlay.getScaleBySize(panoData.width , panoData.height)
  21633. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  21634. begin(overlay, pos, qua, scale )
  21635. //}
  21636. overlay.usingTransformData = !useCustom
  21637. }) */
  21638. for (let i in this.model.hots) {
  21639. //是否判断visible?
  21640. var hot = this.model.hots[i]
  21641. var panoData = hot.info.transformAtPanos[sid]
  21642. var useCustom = !panoData
  21643. //if(hot.usingTransformData || !useCustom){
  21644. var pos = useCustom ? hot.info.position : panoData.pos
  21645. var qua = hot.isSprite ? null : useCustom ? hot.info.quaternion : panoData.qua
  21646. var scale = useCustom ? hot.info.scale : panoData.scale
  21647. begin(hot, pos, qua, scale)
  21648. //}
  21649. //hot.usingTransformData = !useCustom;
  21650. }
  21651. }
  21652. window._tranOutsideFocus = 4399
  21653. t.prototype.focusPoint = function (o = {}) {
  21654. //当在外时,聚焦相机到这一点
  21655. //console.log("focusPoint")
  21656. if (this.mode == 'floorplan') {
  21657. var modelSize = o.modelSize || new THREE.Vector3(8, 8, 8) //可视范围
  21658. var control = player.cameraControls.controls.floorplan
  21659. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  21660. var currentScale = control.absoluteScale
  21661. var currentTarget = control.target.clone()
  21662. G.cancelById(window._tranOutsideFocus, true)
  21663. G.start(
  21664. function (progress) {
  21665. control.absoluteScale = absoluteScale * progress + currentScale * (1 - progress)
  21666. control.target = o.aim
  21667. .clone()
  21668. .multiplyScalar(progress)
  21669. .add(currentTarget.clone().multiplyScalar(1 - progress))
  21670. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  21671. }.bind(this),
  21672. o.dur || 600,
  21673. null /* cancelFuc */,
  21674. 0,
  21675. z[k.transition.movementEasing],
  21676. 'outsideFocus',
  21677. window._tranOutsideFocus,
  21678. null /* cancelFuc */
  21679. )
  21680. } else if (player.mode == 'dollhouse') {
  21681. var control = player.cameraControls.controls.dollhouse
  21682. var radius = o.radius || 8
  21683. var currentTarget = control.target.clone()
  21684. var dir = control.offset.clone().normalize()
  21685. var currentRadius = control.offset.length()
  21686. G.cancelById(window._tranOutsideFocus, true)
  21687. G.start(
  21688. function (progress) {
  21689. control.target = o.aim
  21690. .clone()
  21691. .multiplyScalar(progress)
  21692. .add(currentTarget.clone().multiplyScalar(1 - progress))
  21693. let radius_ = radius * progress + currentRadius * (1 - progress)
  21694. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  21695. }.bind(this),
  21696. o.dur || 600,
  21697. null /* cancelFuc */,
  21698. 0,
  21699. z[k.transition.movementEasing],
  21700. 'outsideFocus',
  21701. window._tranOutsideFocus,
  21702. null /* cancelFuc */
  21703. )
  21704. } else if (this.mode == 'panorama') {
  21705. this.flyToPano({
  21706. lookAtPoint: o.aim.clone(),
  21707. pano: this.currentPano,
  21708. aimDuration: o.dur || 600
  21709. })
  21710. }
  21711. }
  21712. ;(t.prototype.fastForwardActivePanoFlight = function (e) {
  21713. ;(e = e || (k.transition.fastForwardFactor / 10) * 4 + 1), G.adjustSpeed(q.FlyToPano, e), G.adjustSpeed(q.LookTransition, e)
  21714. }),
  21715. (t.prototype.flyToPanoClosestToMouse = function () {
  21716. if ((50 < Date.now() - this.mouseLastMoveTime && ((this.intersect = this.getMouseIntersect()), this.intersect && this.updateClosestPano(this.intersect)), this.closestPano))
  21717. return this.flyToPano({
  21718. pano: this.closestPano
  21719. })
  21720. var e = this.getMouseDirection()
  21721. this.flyDirection(e) ||
  21722. this.flyToPano({
  21723. pano: this.currentPano
  21724. })
  21725. }),
  21726. (t.prototype.flyLocalDirection = function (e) {
  21727. var t = this.getDirection(e),
  21728. i = 1 === e.z ? 0.4 : 0.75,
  21729. n = 1 === Math.abs(e.x)
  21730. return this.flyDirection(t, i, n)
  21731. }),
  21732. (t.prototype.flyDirection = function (e, t, i) {
  21733. Hot.closePopup() //xzw add
  21734. var n = $.Deferred()
  21735. this.history.invalidate()
  21736. var r = this.closestPanoInDirection(e, t, i)
  21737. return (
  21738. r
  21739. ? this.flyToPano(
  21740. {
  21741. pano: r
  21742. },
  21743. n.resolve.bind(n, !0)
  21744. )
  21745. : (this.bump(e), n.resolve(!1)),
  21746. n.promise()
  21747. )
  21748. }),
  21749. (t.prototype.closestPanoInDirection = function (e, t, i) {
  21750. return this.rankedPanoInDirection(0, e, t, i)
  21751. }),
  21752. (t.prototype.rankedPanoInDirection =
  21753. ((_ = {
  21754. pano: null,
  21755. candidates: []
  21756. }),
  21757. function (e, t, i, n) {
  21758. ;(e = e || 0), (i = void 0 !== i ? i : 0.75)
  21759. var r = n ? 'angle' : 'direction'
  21760. return (
  21761. this.model.panos.findRankedByScore(
  21762. e,
  21763. [a.filters.isPanoAligned(), a.filters.not(this.currentPano), a.filters.isNeighbourPanoTo(this.currentPano), a.filters.inPanoDirection(this.position, t, i)],
  21764. [a.scoreFunctions.distanceSquared(this.currentPano), a.scoreFunctions[r](this.position, t)],
  21765. _
  21766. ),
  21767. (this.cachedPanoCandidates = _.candidates),
  21768. _.pano
  21769. )
  21770. })),
  21771. (t.prototype.bump = function (e) {
  21772. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  21773. var t,
  21774. i,
  21775. n,
  21776. r = k.transition,
  21777. o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8,
  21778. a = this.camera.getWorldDirection().dot(e)
  21779. if (0.5 < Math.abs(a))
  21780. (t = function () {
  21781. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], 'zoom', 0 < a ? 1.04 : 0.96), o, i, 0, z.easeInOutSine, 'bumpZStart')
  21782. }.bind(this)),
  21783. (i = function () {
  21784. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], 'zoom', 1), 5 * o, n, 0, z.easeInOutSine, 'bumpZRelax')
  21785. }.bind(this))
  21786. else {
  21787. var s = this.camera.position.clone(),
  21788. l = e.clone()
  21789. this.raycaster.set(s, l)
  21790. var c = this.model.floors.reduce(function (e, t) {
  21791. return e.concat(t.collider.children)
  21792. }, []),
  21793. h = this.raycaster.intersectObjects(c),
  21794. u = 0 < h.length ? h[0].distance / 25 : 0.04,
  21795. d = s.clone().add(l.multiplyScalar(u))
  21796. ;(t = function () {
  21797. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, 'bumpTStart')
  21798. }.bind(this)),
  21799. (i = function () {
  21800. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, 'bumpTRelax')
  21801. }.bind(this))
  21802. }
  21803. ;(n = function () {
  21804. this.flying = !1
  21805. }.bind(this)),
  21806. (this.flying = !0),
  21807. t()
  21808. }
  21809. }),
  21810. (t.prototype.changeFloor = function (e) {
  21811. if (!this.is360View(this.mode, this.currentPano))
  21812. if (this.mode === V.PANORAMA) {
  21813. var t = this.history.reversePano(e)
  21814. t && t.isAligned()
  21815. ? this.flyToPano({
  21816. pano: t
  21817. })
  21818. : this.changeFloorByScore(e)
  21819. } else this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21820. }),
  21821. (t.prototype.changeFloorByScore =
  21822. ((E = {
  21823. pano: null,
  21824. candidates: []
  21825. }),
  21826. function (e) {
  21827. var t = this.model.nextFloor(e)
  21828. return t
  21829. ? (this.model.panos.lowestByScore(
  21830. [a.filters.atFloor(t), a.filters.isPanoAligned()],
  21831. [
  21832. a.scoreFunctions.distance(this.currentPano),
  21833. a.scoreFunctions.direction(this.position, new B.Vector3(0, e, 0)),
  21834. a.scoreFunctions.penalizeHeightDifferenceUnder(this.position, 0.5)
  21835. ],
  21836. E
  21837. ),
  21838. void (E.pano
  21839. ? ((this.cachedPanoCandidates = E.candidates),
  21840. this.history.push(e, this.currentPano),
  21841. this.flyToPano({
  21842. pano: E.pano
  21843. }))
  21844. : Y.warn('No pano found on selected floor, not moving there.')))
  21845. : void Y.debug('player.changeFloor(' + e + '): no such floor')
  21846. })),
  21847. (t.prototype.gotoFloor = function (e) {
  21848. var t = e - this.model.currentFloor.floorIndex
  21849. this.changeFloor(t)
  21850. }),
  21851. (t.prototype.getDirection = function (e) {
  21852. return (e = e || new B.Vector3().copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  21853. }),
  21854. (t.prototype.flyToSameMode = function (e, t, i, n, r) {
  21855. if (((r = r || $.Deferred()), this.mode === V.TRANSITIONING)) return Y.warn('should not be transitioning here'), n && n(!1), r.reject().promise()
  21856. var o = i || !1,
  21857. a = i ? i.position : this.position,
  21858. s = this.position.clone(),
  21859. l = this.currentPano
  21860. if (
  21861. (Y.debug('New pose in mode ' + this.mode),
  21862. !e ||
  21863. ((retryCallback = function () {
  21864. j.delayOneFrame(
  21865. function () {
  21866. this.flyToSameMode(e, t, i, n, r)
  21867. }.bind(this)
  21868. )
  21869. }.bind(this)),
  21870. !this.checkAndWaitForPanoLoad(e, 'high', 'low', this.basePanoSize, retryCallback)))
  21871. ) {
  21872. var c = function () {
  21873. this.emit(W.FlyingEnded, a, s, e, l), n && n(!0)
  21874. }.bind(this),
  21875. h = k[this.mode],
  21876. u = void 0 !== t ? t : h.transitionTime,
  21877. d = new B.Vector3(),
  21878. p = new B.Vector3()
  21879. if ((this.emit(W.FlyingStarted, a, s, e, l), this.mode === V.PANORAMA)) Y.warn('we should not be here for panorama views')
  21880. else if (this.mode === V.DOLLHOUSE)
  21881. if (o) {
  21882. var f = new B.Vector3(0, 1, 0)
  21883. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0), this.model.warpDestFloors(i.floorVisibility), p.copy(i.position)
  21884. var g = new B.Vector3(0, 0, -1).applyQuaternion(i.quaternion),
  21885. m = new B.Raycaster(p.clone(), g.clone(), 0, 1 / 0).intersectObjects(this.model.colliders),
  21886. v = 3
  21887. m.length
  21888. ? (d.copy(m[0].point), (v = 0.75 * p.distanceTo(d)))
  21889. : (d.copy(g).multiplyScalar(3).add(p), Y.debug('Tried to restore dollhouse mode that did not intersect...', i.position, i.quaternion))
  21890. var y = new B.Matrix4().lookAt(p, d, f),
  21891. A = new B.Euler().setFromRotationMatrix(y, k.warp.eOrder),
  21892. C = d.distanceTo(p),
  21893. I = new B.Matrix4().lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f),
  21894. E = new B.Euler().setFromRotationMatrix(I, k.warp.eOrder),
  21895. _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target)
  21896. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0)
  21897. var b = new B.Euler(A.x - E.x, A.y - E.y, A.z - E.z, k.warp.eOrder)
  21898. ;(b.y = b.y > Math.PI ? (b.y -= 2 * Math.PI) : b.y < -Math.PI ? (b.y += 2 * Math.PI) : b.y), (this.path.burnsDir = Math.sign(b.y))
  21899. var w = new B.Euler(0, 0, 0, k.warp.eOrder),
  21900. T = new B.Vector3()
  21901. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21902. G.start(
  21903. function (e, t) {
  21904. ;(w.x = E.x + e * b.x), (w.y = E.y + e * b.y), (w.z = E.z + e * b.z)
  21905. var i = _ + e * (C - _)
  21906. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target), this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  21907. }.bind(this),
  21908. u,
  21909. null,
  21910. k.flydown.movementDelay,
  21911. z[k.flydown.movementEasing],
  21912. null,
  21913. q.FlyToSameMode
  21914. ),
  21915. G.start(
  21916. function (e, t) {
  21917. this.cameraControls.controls[V.DOLLHOUSE].update(),
  21918. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  21919. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  21920. }.bind(this),
  21921. u,
  21922. null,
  21923. k.flydown.movementDelay,
  21924. z[k.flydown.movementEasing],
  21925. null,
  21926. q.FlyToSameMode
  21927. )
  21928. } else Y.warn('invalid warp destination in flyToSameMode()? ignore it then')
  21929. else if ((this.path.placeCpm(), this.path.fadeInCpm(k.path.fadeInTime), i)) {
  21930. this.model.warpDestFloors(i.floorVisibility)
  21931. var x = this.cameraControls.cameras[V.FLOORPLAN],
  21932. S = this.cameraControls.controls[V.FLOORPLAN],
  21933. M = S.target.clone(),
  21934. R = i.position.clone().sub(M),
  21935. P = x.position.clone().sub(S.target).length(),
  21936. O = new B.Vector3(-1, 0, 0).applyQuaternion(i.quaternion).normalize(),
  21937. L = Math.atan2(S.offset.x, S.offset.z),
  21938. D = Math.atan2(O.x, O.z),
  21939. N = S.absoluteScale,
  21940. F = U.convertWorkshopOrthoZoom(i.orthoZoom)
  21941. G.start(
  21942. function (e, t) {
  21943. S.target.copy(R).multiplyScalar(e).add(M)
  21944. var i = L + (D - L) * e
  21945. ;(S.offset.x = P * Math.sin(i)),
  21946. (S.offset.z = P * Math.cos(i)),
  21947. x.position.copy(S.target).add(S.offset),
  21948. (S.absoluteScale = N + e * (F - N)),
  21949. S.update(),
  21950. this.quaternion.copy(x.quaternion),
  21951. this.position.copy(x.position),
  21952. this.target.copy(S.target),
  21953. this.camera.projectionMatrix.copy(x.projectionMatrix)
  21954. }.bind(this),
  21955. u,
  21956. null,
  21957. 0,
  21958. z[k.flydown.movementEasing],
  21959. null,
  21960. q.FlyToSameMode
  21961. )
  21962. } else Y.info('flyToSameMode() funny floorplan view? skipping')
  21963. return (
  21964. G.setTimeout(
  21965. function (e) {
  21966. ;(this.mode = e), c(), r.resolve(!0)
  21967. }.bind(this, this.mode),
  21968. u,
  21969. q.FlyToSameMode
  21970. ),
  21971. (this.mode = V.TRANSITIONING),
  21972. r.promise()
  21973. )
  21974. }
  21975. }),
  21976. (t.prototype.flyToNewMode = function (e, t) {
  21977. Hot.closePopup() //xzw add
  21978. var i = (e = e || {}).mode,
  21979. n = e.pano,
  21980. r = e.duration,
  21981. o = e.warpDest,
  21982. a = e.callback,
  21983. s = e.force,
  21984. l = e.quaternion
  21985. if (((t = t || $.Deferred()), this.isWarping()))
  21986. return Y.warn('Player.flyToNewMode() -> Cannot fly when warping'), a && a(!1), t.reject('Cannot change mode during tour transition').promise()
  21987. if (this.mode === V.TRANSITIONING) return a && a(!1), t.reject('Cannot change mode during mode transition').promise()
  21988. if (i === this.mode)
  21989. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)), t.promise()) : (a && a(!1), t.reject('Already in ' + i + ' mode').promise())
  21990. var c = o || !1
  21991. Y.debug('Switching mode to ' + i)
  21992. var h = function () {
  21993. j.delayOneFrame(
  21994. function () {
  21995. this.flyToNewMode(e, t)
  21996. }.bind(this)
  21997. )
  21998. }.bind(this)
  21999. if (n && this.checkAndWaitForPanoLoad(n, 'low', 'low', this.basePanoSize, h)) return t.promise()
  22000. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i)) {
  22001. return (
  22002. Y.info('Waiting for model textures to be loaded before going out to dollhouse'),
  22003. this.model.waitForLoad(
  22004. this.model,
  22005. function () {
  22006. return this.model.meshTexturesLoaded
  22007. }.bind(this)
  22008. ),
  22009. this.model.loadMeshTextures().done(h),
  22010. t.promise()
  22011. )
  22012. }
  22013. this.history.invalidate()
  22014. this.updateLastView()
  22015. var u = this.mode,
  22016. d = this.cameraControls.cameras[i]
  22017. e = x.deepExtend({}, k[i], k[u + '-' + i])
  22018. var p = void 0 !== r ? r : e.transitionTime
  22019. this.emit(W.ModeChanging, u, i, n, p)
  22020. n && (this.currentPano = n)
  22021. //----------改----------
  22022. let target, position, currentScale, fitBoundSize
  22023. if (editTool.hotpoint.editSpot) {
  22024. //focus
  22025. target = editTool.hotpoint.editSpot.position.clone()
  22026. let bound = editTool.hotpoint.editSpot.info.modelBound?.bound
  22027. if (bound) {
  22028. bound = new THREE.Box3().copy(bound).applyMatrix4(editTool.hotpoint.editSpot.children[0].matrixWorld)
  22029. fitBoundSize = bound.size()
  22030. } else {
  22031. fitBoundSize = new THREE.Vector3(5, 5, 5)
  22032. }
  22033. }
  22034. this.switchCameraMode(i, l, target, position, { currentScale, fitBoundSize })
  22035. //----------------------
  22036. G.cancelById(q.LookTransition)
  22037. var f = new B.Vector3().copy(this.position)
  22038. this.modeTran = this.mode + '-' + i
  22039. /* if(editTool.atPanel == "screen"){
  22040. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  22041. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  22042. } */
  22043. if (i == 'panorama') {
  22044. this.transitionPos({ type: 'beforeFlyIn', pano: n, dur: p }) //add
  22045. } else {
  22046. this.transitionPos({ type: 'beforeFlyOut', dur: p / 2 }) //add
  22047. }
  22048. window.bus.dispatchEvent({ type: 'playerAndModelReady' })
  22049. this.ready = true
  22050. if (i === V.PANORAMA)
  22051. this.emit(W.PanoChosen, n, n),
  22052. setTimeout(
  22053. function () {
  22054. n.floor.enter(i)
  22055. }.bind(this),
  22056. p / 2
  22057. ),
  22058. this.path.fadeOutCpm(k.path.fadeOutTime)
  22059. else if (i === V.DOLLHOUSE) {
  22060. if (
  22061. (c && (this.model.stayPut = !0),
  22062. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0), this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  22063. this.path.placeCpm(),
  22064. this.path.fadeInCpm(k.path.fadeInTime),
  22065. c)
  22066. ) {
  22067. var g = new B.Vector3(this.model.center.x, 0, this.model.center.z)
  22068. f.set(15, 10, 15)
  22069. var m = new B.Vector3(0, 0, -1).applyQuaternion(o.quaternion),
  22070. v = new B.Raycaster(o.position.clone(), m.clone(), 0, 1 / 0).intersectObjects([this.sceneIntersectionPlane])
  22071. v.length
  22072. ? (g.copy(v[0].point), f.copy(o.position), this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0.75 * f.distanceTo(g), !0))
  22073. : (Y.warn('Tried to restore dollhouse mode that did not intersect...', o.position, o.quaternion), this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  22074. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  22075. f.add(this.model.position),
  22076. d.position.copy(f),
  22077. this.cameraControls.controls[V.DOLLHOUSE].update()
  22078. }
  22079. } else if ((this.path.placeCpm(), this.path.fadeInCpm(k.path.fadeInTime), o)) {
  22080. this.model.warpDestFloors(o.floorVisibility)
  22081. var y = this.cameraControls.cameras[V.FLOORPLAN],
  22082. A = this.cameraControls.controls[V.FLOORPLAN],
  22083. C = y.position.clone().sub(A.target),
  22084. I = new B.Vector3(-1, 0, 0).applyQuaternion(o.quaternion).normalize(),
  22085. E = Math.atan2(I.x, I.z)
  22086. A.target.copy(o.position)
  22087. var _ = C.length()
  22088. ;(A.offset.x = _ * Math.sin(E)),
  22089. (A.offset.y = 0),
  22090. (A.offset.z = _ * Math.cos(E)),
  22091. y.position.copy(A.target).add(A.offset),
  22092. A.target.clone().sub(d.position),
  22093. d.quaternion.copy(o.quaternion),
  22094. (A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom)),
  22095. (A.absoluteScale = A.currentScale),
  22096. A.update()
  22097. } else this.model.currentFloor.enter(i)
  22098. var b = this.currentPano,
  22099. w = this.position.clone()
  22100. return (
  22101. this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  22102. (this.flying = !0),
  22103. this.isOutsideMode(i) && this.is360View(u, b)
  22104. ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15), d.controls.target.set(this.model.center.x, 0, this.model.center.z), d.controls.update()),
  22105. (e.blackoutStyle = P.FADEIN),
  22106. (p = k.show360Views.transitionTime),
  22107. this.fade360View(p, d, e))
  22108. : this.isOutsideMode(u) && this.is360View(i, n)
  22109. ? (c && this.switchCameraMode(i, c.quaternion),
  22110. (this.mode = i),
  22111. this.path && this.path.popOutCpm(),
  22112. (e.blackoutStyle = P.END),
  22113. (p = k.show360Views.transitionTime),
  22114. this.fade360View(p, d, e))
  22115. : (G.start(H.property(this.model, 'alpha', e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  22116. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  22117. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  22118. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  22119. G.start(H.uniform(this.model.skybox, 'opacity', e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  22120. G.start(H.property(this.reticule.material.uniforms.opacity, 'value', 0), p, null, q.FlyToNewMode)),
  22121. G.setTimeout(
  22122. function () {
  22123. ;(this.flying = !1),
  22124. u === V.PANORAMA && i !== V.PANORAMA
  22125. ? this.currentPano.exit()
  22126. : u !== V.PANORAMA &&
  22127. i === V.PANORAMA &&
  22128. (this.currentPano !== b && b.exit(), this.currentPano.enter(), this.path.placeCpm(), this.path.fadeOutCpm(k.path.fadeOutTime), this.spider.draw()),
  22129. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  22130. (this.mode = i),
  22131. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  22132. if (this.afterCModeFuc) {
  22133. //手动加的函数
  22134. var cf = this.afterCModeFuc
  22135. this.afterCModeFuc = null //因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  22136. cf()
  22137. }
  22138. this.updateMarkerVisi() //add
  22139. //(this.mode == u.PANORAMA) && this.updateHotVisible()//add
  22140. if (this.mode == V.PANORAMA) {
  22141. //EditOverlay.updatePano()
  22142. editTool.hotpoint.updatePano()
  22143. this.model.fadePanoMarkers()
  22144. Hot.updateVisibles([this.currentPano])
  22145. } else {
  22146. Hot.updateVisibles(true)
  22147. this.model.hotGroup.children.forEach(overlay => {
  22148. if (overlay.animateInfo) {
  22149. GifTexDeal.start(overlay.animation)
  22150. }
  22151. })
  22152. }
  22153. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(), t.resolve())
  22154. }.bind(this),
  22155. p,
  22156. q.FlyToNewMode
  22157. ),
  22158. (this.mode = V.TRANSITIONING),
  22159. //EditOverlay.updatePano(),//add
  22160. editTool.hotpoint.updatePano(), //add
  22161. //u == "panorama" && this.updateHotVisible(),
  22162. t.promise()
  22163. )
  22164. }),
  22165. (t.prototype.fade360View = function (e, t, i) {
  22166. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  22167. $(this.domElement).fadeOut(
  22168. 0.5 * e,
  22169. function () {
  22170. ;(this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity),
  22171. (this.model.alpha = i.modelAlpha),
  22172. this.position.copy(t.position),
  22173. this.quaternion.copy(t.quaternion),
  22174. this.camera.projectionMatrix.copy(t.projectionMatrix),
  22175. $(this.domElement).fadeIn(0.5 * e)
  22176. }.bind(this)
  22177. )
  22178. }),
  22179. (t.prototype.findDefaultViews = function () {
  22180. this.findDefaultView(this.lastInsideView, !0), this.findDefaultView(this.last360View, !1)
  22181. }),
  22182. (t.prototype.findDefaultView = function (e, i) {
  22183. var t,
  22184. n = this.model.heroLocations,
  22185. r = this.model.panos,
  22186. o = n.findIndex(function (e) {
  22187. if (e.cameraMode !== V.PANORAMA) return !1
  22188. var t = r.get(e.panoId)
  22189. return t && t.isAligned() === i
  22190. })
  22191. 0 <= o
  22192. ? ((t = r.get(n[o].panoId)),
  22193. e.update({
  22194. cameraMode: V.PANORAMA,
  22195. pano: t,
  22196. position: n[o].position,
  22197. quaternion: n[o].quaternion
  22198. }))
  22199. : 0 <=
  22200. (o = r.list.findIndex(function (e) {
  22201. return e.isAligned() === i
  22202. }))
  22203. ? ((t = r.list[o]),
  22204. e.update({
  22205. cameraMode: V.PANORAMA,
  22206. pano: t,
  22207. position: t.position
  22208. }))
  22209. : Y.warn('There are no', i ? 'inside' : '360º', 'views in this model')
  22210. }),
  22211. (t.prototype.updateLastView = function () {
  22212. this.mode === V.PANORAMA &&
  22213. (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  22214. pano: this.currentPano,
  22215. position: this.position,
  22216. quaternion: this.quaternion
  22217. })
  22218. }),
  22219. (t.prototype.goToLastView = function (e, t) {
  22220. var i = $.Deferred(),
  22221. n = i.resolve.bind(i),
  22222. r = i.reject.bind(i),
  22223. o = e ? this.lastInsideView : this.last360View
  22224. return (
  22225. this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  22226. this.isInMode(V.PANORAMA)
  22227. ? (this.path && this.path.popOutCpm(), this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r))
  22228. : this.isOutsideMode() &&
  22229. this.flyToNewMode({
  22230. mode: o.cameraMode,
  22231. pano: o.pano,
  22232. quaternion: o.quaternion,
  22233. callback: t
  22234. })
  22235. .done(n)
  22236. .fail(r),
  22237. i.promise()
  22238. )
  22239. }),
  22240. (t.prototype.fadeToView = function (e, t, i, n) {
  22241. var r = $.Deferred(),
  22242. o = r.resolve.bind(r),
  22243. a = r.reject.bind(r)
  22244. if (!t.isValid() || (t.cameraMode === V.PANORAMA && !t.pano)) return Y.warn('Tried to fade to an illegal view', t.cameraMode), a('Cannot go to illegal view'), r.promise()
  22245. var s =
  22246. (k[t.cameraMode],
  22247. function () {
  22248. $(this.domElement).fadeIn(0.5 * i), n && n(), o()
  22249. }.bind(this)),
  22250. l = e ? P.FADEIN : P.END
  22251. return (
  22252. this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  22253. $(this.domElement).fadeOut(
  22254. 0.5 * i,
  22255. function () {
  22256. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  22257. t.cameraMode === V.PANORAMA
  22258. ? this.flyToPano(
  22259. {
  22260. pano: t.pano,
  22261. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  22262. duration: 0
  22263. },
  22264. s
  22265. )
  22266. : this.flyToNewMode({
  22267. mode: t.cameraMode,
  22268. quaternion: t.quaternion,
  22269. duration: 0,
  22270. callback: s
  22271. })
  22272. }.bind(this)
  22273. ),
  22274. r.promise()
  22275. )
  22276. }),
  22277. (t.prototype.startWarp = function (e, t, i, n, r, o) {
  22278. if ((this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1), this.flying)) return Y.warn('Player.startWarp() -> Cannot warp when flying'), o && o(), !1
  22279. null != e || (e = M.Show), this.history.invalidate(), e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : (i = this.path.upcomingTransType)
  22280. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned()
  22281. return (
  22282. this.emit(W.WarpStarted, a, i, n, r),
  22283. (n = n || P.MIDDLE),
  22284. this.path.warpToPano(
  22285. i,
  22286. n,
  22287. r,
  22288. function () {
  22289. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  22290. this.emit(W.WarpEnded, i),
  22291. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  22292. o && o()
  22293. }.bind(this)
  22294. ),
  22295. e === M.Hide && this.path.discardPathObject(),
  22296. !0
  22297. )
  22298. }),
  22299. (t.prototype.warpToPanoById = function (e, t, i, n, r, o, a, s) {
  22300. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn('Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()'), s && s(), !1)
  22301. }),
  22302. (t.prototype.warpToPanoByHeroIndex = function (e, t, i, n, r, o, a) {
  22303. return this.path.setWarpDestinationByHeroIndex(e)
  22304. ? this.startWarp(t, i, n, r, o, a)
  22305. : (Y.warn('Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()'), a && a(), !1)
  22306. }),
  22307. (t.prototype.warpToPano = function (e, t, i, n, r, o, a, s) {
  22308. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22309. }),
  22310. (t.prototype.warpToNonPanoByHeroIndex = function (e, t) {
  22311. return this.path.setWarpDestinationByHeroIndex(e)
  22312. ? (this.path.warpToNonPano(t), !0)
  22313. : (Y.warn('Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()'), t && t(), !1)
  22314. }),
  22315. (t.prototype.aimTourCamera = function (e, t, i, n) {
  22316. return Y.debug('player.aimTourCamera(' + e + ') calling warpToPanoByHeroIndex(' + e + ')'), this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22317. }),
  22318. (t.prototype.showPathToHeroLocation = function (e) {
  22319. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  22320. }),
  22321. (t.prototype.tourInterlude = function (e, t) {
  22322. this.history.invalidate(), this.path.discardSlow()
  22323. var defaultRotTime = DATA.tourRotTime * 1000
  22324. var timeEachItem = (2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed)) * 200 //预估时间假设每个item飞的时间(如果距离远就少了)
  22325. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)
  22326. var currentLocation0 = this.model.heroLocations[this.director.currentItem[0]]
  22327. var rotTime
  22328. if (currentLocation.rotTime == void 0 || currentLocation.rotTime == '') {
  22329. var restChildCount = currentLocation0.heroLocations ? currentLocation0.heroLocations.length - this.director.currentItem[1] - 1 : 0
  22330. var hasMusic = currentLocation0.musicInfo && currentLocation0.musicInfo.music
  22331. if (hasMusic) {
  22332. var audioObj = SoundManager.list.find(e => e.name == 'tour')
  22333. var current = audioObj.audio.currentTime * 1e3 // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  22334. rotTime = currentLocation0.musicInfo.time - current
  22335. if (restChildCount) {
  22336. //如果当前folder中还有剩下的item,平分一下时间
  22337. rotTime = (rotTime - timeEachItem * restChildCount) / (restChildCount + 1)
  22338. }
  22339. } else {
  22340. rotTime = defaultRotTime
  22341. }
  22342. rotTime = Math.max(0, rotTime)
  22343. console.log('rotTime ' + rotTime + ' at item ' + this.director.currentItem + (hasMusic ? ',musicCurrentTime:' + current + '音乐总长:' + currentLocation0.musicInfo.time : ''))
  22344. } else {
  22345. rotTime = currentLocation.rotTime * 1000
  22346. console.log('rotTime ' + rotTime + ' at item ' + this.director.currentItem)
  22347. }
  22348. this.path.waitNextStep(
  22349. e,
  22350. function () {
  22351. //等待音乐播放一段时间再下一步,此时镜头会缓慢旋转
  22352. t && t()
  22353. }.bind(this),
  22354. rotTime
  22355. )
  22356. }),
  22357. (t.prototype.stopInterlude = function () {
  22358. this.interruptAndFastForward(null, 0)
  22359. }),
  22360. (t.prototype.interruptAndFastForward = function (e, t) {
  22361. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t), this.flying && this.emit(W.FlyingInterrupted), this.path.interruptAndFastForward(e, t)
  22362. }),
  22363. (t.prototype.setSize = function (e, t) {
  22364. var i = e / t
  22365. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t)
  22366. var n = A.getHFOVFromVFOV(k.insideFOV, e, t)
  22367. for (var r in (n > k.insideFOVMax ? (this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t)) : (this.baseFov = k.insideFOV), this.cameraControls.cameras)) {
  22368. var o = this.cameraControls.cameras[r]
  22369. ;(o.fov = this.baseFov * (1 / this.zoomLevel)), o.updateAspect(i)
  22370. }
  22371. }),
  22372. (t.prototype.toJSON = function () {
  22373. var e = {}
  22374. return (
  22375. this.cameraControls.activeControl &&
  22376. (((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode)),
  22377. this.isOutsideMode()
  22378. ? this.model.allFloorsVisible
  22379. ? (e.floor_visibility = [])
  22380. : (e.floor_visibility = this.model.floors.list.map(function (e) {
  22381. return e.hidden ? 0 : 1
  22382. }))
  22383. : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  22384. e
  22385. )
  22386. }),
  22387. (t.prototype.getCurrentNodePanos = function (e) {
  22388. if ((this.model.panos.map, (e.length = 0), this.path.nodes))
  22389. for (var t = 0; t < this.path.nodes.length; t++) {
  22390. var i = this.path.nodes[t]
  22391. e.push(this.model.panos.get(i))
  22392. }
  22393. }),
  22394. (t.prototype.zoomIncrementally = function (e) {
  22395. var t = this.zoomLevel
  22396. this.zoomTo(this.zoomLevel + e), t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22397. }),
  22398. (t.prototype.zoomInIncrementally = function (e) {
  22399. ;(e = e || this.defaultZoomIncrement), this.zoomIncrementally(e)
  22400. }),
  22401. (t.prototype.zoomOutIncrementally = function (e) {
  22402. ;(e = e || -this.defaultZoomIncrement), this.zoomIncrementally(e)
  22403. }),
  22404. (t.prototype.zoomBy = function (e) {
  22405. this.zoomTo(this.zoomLevel * e)
  22406. }),
  22407. (t.prototype.zoomIn = function () {
  22408. this.zoomBy(1 + this.zoomSpeed)
  22409. }),
  22410. (t.prototype.zoomOut = function () {
  22411. this.zoomBy(1 - this.zoomSpeed)
  22412. }),
  22413. (t.prototype.zoomTo = function (e, t) {
  22414. if (
  22415. (t || (k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled)) &&
  22416. (e < k.zoom.min && (e = k.zoom.min),
  22417. e > k.zoom.max && (e = k.zoom.max),
  22418. e > this.zoomLevel ? (this.emit(m.ZoomIn), e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut), e === k.zoom.min && this.emit(m.ZoomMin)),
  22419. this.cameraControls.activeControl)
  22420. ) {
  22421. var i = this.cameraControls.activeControl.camera
  22422. ;(this.zoomLevel = e), (i.fov = this.baseFov * (1 / this.zoomLevel)), i.updateProjectionMatrix(), (this.zoomFov = i.fov)
  22423. }
  22424. }),
  22425. (t.prototype.increaseZoomSpeed = function () {
  22426. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22427. }),
  22428. (t.prototype.decreaseZoomSpeed = function () {
  22429. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22430. }),
  22431. (t.prototype.clampZoomSpeed = function (e) {
  22432. return e < 0 ? 0 : e
  22433. }),
  22434. (t.prototype.activatePersistentZooming = function (e) {
  22435. this.zooming = e ? 1 : -1
  22436. }),
  22437. (t.prototype.deactivatePersistentZooming = function () {
  22438. this.zooming = 0
  22439. }),
  22440. (t.prototype.zoomDefault = function () {
  22441. this.zoomTo(1, !0)
  22442. })
  22443. window.fovTranId = 333 //add
  22444. ;(t.prototype.smoothZoomToDefault = function (e, t) {
  22445. G.cancelById(window.fovTranId)
  22446. var i,
  22447. n = this.zoomLevel,
  22448. r = function (e) {
  22449. 1 < e && (e = 1), (i = n * (1 - e) + e), this.zoomTo(i, !0)
  22450. }.bind(this),
  22451. o = function () {
  22452. this.zoomDefault(), t && window.setTimeout(t, 50)
  22453. }.bind(this)
  22454. G.start(r, e, o, null, 0, z[k.transition.blendEasing], null, window.fovTranId)
  22455. }),
  22456. (t.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {
  22457. //add
  22458. G.cancelById(window.fovTranId)
  22459. var i,
  22460. n = this.zoomLevel,
  22461. aimLevel = zoomLevel || this.baseFov / fov
  22462. if (n == aimLevel) return
  22463. var fun = function (e) {
  22464. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel), this.zoomTo(i, !0)
  22465. }.bind(this)
  22466. G.start(fun, dur, callback, null, 0, z[k.transition.easeInCubic], null, window.fovTranId)
  22467. }),
  22468. (t.prototype.updateZoomPano = function () {
  22469. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  22470. var e = this.currentPano
  22471. if (e) {
  22472. var t = this.zoomLevel > k.zoom.activationThreshold,
  22473. i = ((this.flying && this.nextPano && this.nextPano !== this.currentPano) || this.isWarping(), t)
  22474. this.tileDownloader.tilePrioritizer.setZoomingActive(i), this.panoRenderer.setZoomingActive(i, e, !0)
  22475. var n = function (e, t) {
  22476. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22477. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22478. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22479. e.setZoomed(t)
  22480. }.bind(this)
  22481. i && !e.zoomed
  22482. ? (n(e, !0),
  22483. this.panoRenderer.enableUltraHighQualityMode(
  22484. function () {
  22485. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom), i && n(e, !0)
  22486. }.bind(this)
  22487. ))
  22488. : !t && e.zoomed && n(e, !1)
  22489. }
  22490. }
  22491. }),
  22492. //--------
  22493. (t.prototype.flyToMode = function (mode, f1) {
  22494. //飞到某个模式后再执行f1函数
  22495. var f2
  22496. if (this.mode == mode) {
  22497. f1 && f1()
  22498. } else {
  22499. f2 = f1
  22500. if (this.mode == 'transitioning' && this.modeTran.split('-')[1] != mode) {
  22501. //正飞向其他模式,就要先飞完再飞进来然后执行
  22502. this.afterCModeFuc = function () {
  22503. this.afterCModeFuc = f2
  22504. this.flyToNewMode({ mode: mode, pano: mode == 'panorama' && this.currentPano })
  22505. }.bind(this)
  22506. } else {
  22507. this.afterCModeFuc = f2 //飞入后执行
  22508. try {
  22509. //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22510. this.flyToNewMode({ mode: mode, pano: mode == 'panorama' && this.currentPano })
  22511. } catch (e) {}
  22512. }
  22513. }
  22514. }),
  22515. (t.prototype.checkHasNeighbor = function (pano) {
  22516. //add
  22517. for (var i in pano.neighbourPanos) {
  22518. if (i == pano.id) continue
  22519. if (pano.neighbourPanos[i]) {
  22520. return true
  22521. }
  22522. }
  22523. }),
  22524. (ee.exports = t)
  22525. }).call(this, '/js/player.js')
  22526. },
  22527. {
  22528. './constants': 8,
  22529. './enum/AlignmentType': 17,
  22530. './enum/BlackoutStyle': 18,
  22531. './enum/ControlEvents': 21,
  22532. './enum/Keys': 30,
  22533. './enum/ModelManagerEvents': 33,
  22534. './enum/PanoSizeClass': 36,
  22535. './enum/PanoramaEvents': 37,
  22536. './enum/PathDiscardMode': 38,
  22537. './enum/PathDisplayMode': 39,
  22538. './enum/PlayerEvents': 40,
  22539. './enum/TagStates': 44,
  22540. './enum/Vectors': 50,
  22541. './enum/Viewmode': 51,
  22542. './enum/WarpStyle': 52,
  22543. './enum/ZoomEvents': 53,
  22544. './exception/BasicException': 55,
  22545. './model/ModelManager': 140,
  22546. './objects/NSpider': 147,
  22547. './objects/Panorama': 148,
  22548. './objects/Reticule': 149,
  22549. './objects/ShowPath': 151,
  22550. './objects/Snapshot': 153,
  22551. './objects/View': 154,
  22552. './settings': 166,
  22553. './shaders': 167,
  22554. './tile/TileDownloader': 171,
  22555. './tile/TilePrioritizer': 172,
  22556. './util/ZoomStats': 179,
  22557. './util/browser': 182,
  22558. './util/camera': 183,
  22559. './util/cameraLight': 184,
  22560. './util/common': 185,
  22561. './util/easing': 186,
  22562. './util/history': 187,
  22563. './util/lerp': 188,
  22564. './util/logger': 189,
  22565. './util/math': 190,
  22566. './util/transitions': 195,
  22567. // hot: "hot",
  22568. scaleImg: 'scaleImg',
  22569. events: 202,
  22570. three: 217
  22571. }
  22572. ],
  22573. scaleImg: [
  22574. function (e, t) {
  22575. var i = t
  22576. ;(function () {
  22577. function e(e, t, i, n) {
  22578. function r() {
  22579. ;((U = 'object' == typeof i ? i : t.src || n ? s : document.createElement('canvas')).width = d), (U.height = p), (H = U.getContext('2d'))
  22580. }
  22581. function o(e) {
  22582. if (e) {
  22583. var t,
  22584. i = H.getImageData(0, 0, d, p),
  22585. n = i.data
  22586. for (t = 0; t < ie; t += 4) (n[t] = (e[t] * ne) | 0), (n[t + 1] = (e[t + 1] * ne) | 0), (n[t + 2] = (e[t + 2] * ne) | 0), (n[t + 3] = (e[t + 3] * ne) | 0)
  22587. return delete e, i
  22588. }
  22589. return H.getImageData(0, 0, d, p)
  22590. }
  22591. function a(e, t, i, n, r) {
  22592. return 0.5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  22593. }
  22594. var s, l
  22595. if ((t || ((t = e.input), (i = e.output), (n = e.inputRemovable), e.scale && (e = e.scale)), t.src))
  22596. if (((s = document.createElement('canvas')), null != t.naturalWidth)) (s.width = t.naturalWidth), (s.height = t.naturalHeight)
  22597. else if (null != t.runtimeStyle) {
  22598. var c = t.runtimeStyle,
  22599. h = c.width,
  22600. u = c.height
  22601. ;(c.width = 'auto'), (c.height = 'auto'), (s.width = t.width), (s.height = t.height), (c.width = h), (c.height = u)
  22602. } else {
  22603. ;(h = t.width), (u = t.height)
  22604. t.removeAttribute && (t.removeAttribute('width'), t.removeAttribute('height')), (s.width = t.width), (s.height = t.height), (t.width = h), (t.height = u)
  22605. }
  22606. else s = t
  22607. ;(l = s.getContext('2d')), t.src && l.drawImage(t, 0, 0)
  22608. var d,
  22609. p,
  22610. f = s.width,
  22611. g = s.height,
  22612. m = l.getImageData(0, 0, f, g).data
  22613. if (!f || !g) return !1
  22614. ;(t.src || n) && s.clearRect(0, 0, f, g),
  22615. (p =
  22616. 'object' == typeof e
  22617. ? e.width
  22618. ? ((d = (e.width + 0.5) | 0), (e.height + 0.5) | 0)
  22619. : ((d = (f * e.scaleX + 0.5) | 0), (g * e.scaleY + 0.5) | 0)
  22620. : ((d = (e * f + 0.5) | 0), (e * g + 0.5) | 0))
  22621. var v,
  22622. y,
  22623. A,
  22624. C,
  22625. I,
  22626. E,
  22627. _,
  22628. b,
  22629. w,
  22630. T,
  22631. x,
  22632. S,
  22633. M,
  22634. R,
  22635. P,
  22636. O,
  22637. L,
  22638. D,
  22639. N,
  22640. F,
  22641. B,
  22642. V,
  22643. k,
  22644. U,
  22645. H,
  22646. z,
  22647. G,
  22648. W,
  22649. j,
  22650. Y,
  22651. q,
  22652. X,
  22653. Z,
  22654. K,
  22655. Q,
  22656. J = d << 2,
  22657. $ = f << 2,
  22658. ee = 0,
  22659. te = 0,
  22660. ie = J * p,
  22661. ne = 255.99 / 255,
  22662. re = d / f,
  22663. oe = p / g,
  22664. ae = re * oe
  22665. if (1 < re || 1 < oe)
  22666. for (r(), G = (z = o()).data, C = 0; C < p; C++)
  22667. for (V = (y = C / oe) - (w = 0 | y), j = w * $, W = w < 1 ? j : j - $, w < g - 2 ? ((Y = j + $), (q = (2 + w) * $)) : (Y = q = g - 2 < w ? j : j + $), A = 0; A < d; A++, te += 4)
  22668. (Z = (b = 0 | (v = A / re)) << 2),
  22669. b < f - 2 ? ((K = Z + 4), (Q = Z + 8)) : (K = Q = f - 2 < b ? Z : Z + 4),
  22670. (D =
  22671. (a(
  22672. V,
  22673. a((k = v - b), m[W + (X = b < 1 ? Z : Z - 4)], m[W + Z], m[W + K], m[W + Q]),
  22674. a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]),
  22675. a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]),
  22676. a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])
  22677. ) *
  22678. ne) |
  22679. 0),
  22680. ++Z,
  22681. ++K,
  22682. ++Q,
  22683. (F =
  22684. (a(
  22685. V,
  22686. a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]),
  22687. a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]),
  22688. a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]),
  22689. a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])
  22690. ) *
  22691. ne) |
  22692. 0),
  22693. ++Z,
  22694. ++K,
  22695. ++Q,
  22696. (B =
  22697. (a(
  22698. V,
  22699. a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]),
  22700. a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]),
  22701. a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]),
  22702. a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])
  22703. ) *
  22704. ne) |
  22705. 0),
  22706. ++Z,
  22707. ++K,
  22708. ++Q,
  22709. (N =
  22710. (a(
  22711. V,
  22712. a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]),
  22713. a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]),
  22714. a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]),
  22715. a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])
  22716. ) *
  22717. ne) |
  22718. 0),
  22719. (G[te] = 0 <= D ? (D < 256 ? D : 255) : 0),
  22720. (G[te + 1] = 0 <= F ? (F < 256 ? F : 255) : 0),
  22721. (G[te + 2] = 0 <= B ? (B < 256 ? B : 255) : 0),
  22722. (G[te + 3] = 0 <= N ? (N < 256 ? N : 255) : 0)
  22723. else {
  22724. if (le.Float32Array) L = new Float32Array(ie)
  22725. else for (L = [], te = 0; te < ie; ++te) L[te] = 0
  22726. for (y = 0; y < g; y++)
  22727. for (I = (_ = 0 | (C = y * oe)) * J, (O = !!((_ - ((C + oe) | 0)) * (g - 1 - y)) << 1) && ((M = 1 + _ - C), (R = C + oe - _ - 1)), v = 0; v < f; v++, ee += 4)
  22728. switch (
  22729. ((A = v * re),
  22730. (E = 0 | A),
  22731. (te = I + (E << 2)),
  22732. (P = !!((E - ((A + re) | 0)) * (f - 1 - v))),
  22733. P && ((x = 1 + E - A), (S = A + re - E - 1)),
  22734. (D = m[ee]),
  22735. (F = m[ee + 1]),
  22736. (B = m[ee + 2]),
  22737. (N = m[ee + 3]),
  22738. P + O)
  22739. ) {
  22740. case 0:
  22741. ;(L[te] += D * ae), (L[te + 1] += F * ae), (L[te + 2] += B * ae), (L[te + 3] += N * ae)
  22742. break
  22743. case 1:
  22744. ;(T = x * oe),
  22745. (L[te] += D * T),
  22746. (L[te + 1] += F * T),
  22747. (L[te + 2] += B * T),
  22748. (L[te + 3] += N * T),
  22749. (T = S * oe),
  22750. (L[te + 4] += D * T),
  22751. (L[te + 5] += F * T),
  22752. (L[te + 6] += B * T),
  22753. (L[te + 7] += N * T)
  22754. break
  22755. case 2:
  22756. ;(T = re * M),
  22757. (L[te] += D * T),
  22758. (L[te + 1] += F * T),
  22759. (L[te + 2] += B * T),
  22760. (L[te + 3] += N * T),
  22761. (T = re * R),
  22762. (L[(te += J)] += D * T),
  22763. (L[te + 1] += F * T),
  22764. (L[te + 2] += B * T),
  22765. (L[te + 3] += N * T)
  22766. break
  22767. default:
  22768. ;(T = x * M),
  22769. (L[te] += D * T),
  22770. (L[te + 1] += F * T),
  22771. (L[te + 2] += B * T),
  22772. (L[te + 3] += N * T),
  22773. (T = S * M),
  22774. (L[te + 4] += D * T),
  22775. (L[te + 5] += F * T),
  22776. (L[te + 6] += B * T),
  22777. (L[te + 7] += N * T),
  22778. (T = x * R),
  22779. (L[(te += J)] += D * T),
  22780. (L[te + 1] += F * T),
  22781. (L[te + 2] += B * T),
  22782. (L[te + 3] += N * T),
  22783. (T = S * R),
  22784. (L[te + 4] += D * T),
  22785. (L[te + 5] += F * T),
  22786. (L[te + 6] += B * T),
  22787. (L[te + 7] += N * T)
  22788. }
  22789. delete m, r(), (z = o(L))
  22790. }
  22791. if ((H.putImageData(z, 0, 0), 'string' == typeof i)) {
  22792. var se
  22793. if ('png' === i || 'jpeg' === i) return ((se = n && t.src ? t : new Image()).width = d), (se.height = p), (se.src = U.toDataURL('image/' + i, 0.85)), se
  22794. if ('png-src' === i || 'jpeg-src' === i) return U.toDataURL('image/' + i.split('-')[0], 0.85)
  22795. }
  22796. return U
  22797. }
  22798. var le = this
  22799. 'undefined' != typeof exports ? ('undefined' != typeof module && module.exports && (exports = module.exports = e), (exports.scale = e)) : (c = e)
  22800. }).call(this),
  22801. (i.exports = c)
  22802. },
  22803. {}
  22804. ],
  22805. 156: [
  22806. function (i, n, e) {
  22807. ;(function (e) {
  22808. 'use strict'
  22809. function t(e, t) {
  22810. ;(this.model = e), (this.panos = e.panos), (this.player = t), (this.imagePanos = this.listImagePanos()), (this.retryMinimumTime = 1e4)
  22811. }
  22812. var r = (i('three'), i('./enum/Viewmode')),
  22813. o = (i('./settings'), i('./objects/Panorama')),
  22814. a = new (i('./util/logger'))(e)
  22815. ;(t.prototype.start = function () {
  22816. this.loadNextPano(
  22817. function (e) {
  22818. e
  22819. ? this.start()
  22820. : (a.debug('No suitable pano loaded, waiting a little while before looking again'),
  22821. setTimeout(
  22822. function () {
  22823. this.start()
  22824. }.bind(this),
  22825. 1e3
  22826. ))
  22827. }.bind(this)
  22828. )
  22829. }),
  22830. (t.prototype.validLoadTarget = function (e) {
  22831. return e && !e.isLoaded('high') && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22832. }),
  22833. (t.prototype.listImagePanos = function () {
  22834. var i = [],
  22835. n = this
  22836. return (
  22837. this.model.images.forEach(function (e) {
  22838. if (e.metadata && e.metadata.scan_id) {
  22839. var t = n.model.panos.get(e.metadata.scan_id)
  22840. t && !t.isLoaded('high') && i.push(t)
  22841. }
  22842. }),
  22843. i
  22844. )
  22845. }),
  22846. (t.prototype.nextNotLoadedImage = function () {
  22847. for (; 0 < this.imagePanos.length; ) {
  22848. var e = this.imagePanos[0]
  22849. if (!e.isLoaded('high')) return e
  22850. this.imagePanos.shift()
  22851. }
  22852. return null
  22853. }),
  22854. (t.prototype.loadNextPano = function (e) {
  22855. var t,
  22856. i,
  22857. n = this.model.waitQueue.filter(function (e) {
  22858. return e.object instanceof o
  22859. })
  22860. 0 < n.length
  22861. ? ((t = n[0].object), a.debug('Overrode pano selection: Flying to an unloaded pano ' + t.id))
  22862. : this.validLoadTarget(this.player.currentPano)
  22863. ? ((t = this.player.currentPano), a.debug('Overrode pano selection: Currently at an unloaded pano ' + t.id))
  22864. : this.validLoadTarget(this.player.closestPano)
  22865. ? ((t = this.player.closestPano), a.debug('Overrode pano selection: Hovering over an unloaded pano ' + t.id))
  22866. : this.validLoadTarget(this.nextNotLoadedImage())
  22867. ? ((i = 'high'), (t = this.imagePanos[0]), a.debug('Overrode pano selection: Highlight image ' + t.id))
  22868. : this.player.mode !== r.PANORAMA ||
  22869. ((t = this.panos.lowestByScore(
  22870. [this.validLoadTarget.bind(this), o.filters.isNeighbourPanoTo(this.player.currentPano)],
  22871. [
  22872. o.scoreFunctions.distance(this.player.currentPano),
  22873. o.scoreFunctions.direction(this.player.position, this.player.getDirection()),
  22874. o.scoreFunctions.inFieldOfView(this.player.position, this.player.getDirection())
  22875. ]
  22876. )) &&
  22877. a.debug('Normal pano selection: neighbor ' + t.id)),
  22878. t
  22879. ? ((i = i || t.isLoaded('low') ? 'high' : 'low'),
  22880. a.debug('Preloading ' + i + '-res pano ' + t.id),
  22881. t
  22882. .loadCube(i)
  22883. .done(e)
  22884. .fail(function () {
  22885. a.warn('Failed preloading pano', t.id, ', marking it as failed and forgetting it for a while'), e()
  22886. }))
  22887. : e && e(null)
  22888. }),
  22889. (n.exports = t)
  22890. }).call(this, '/js/preloaders.js')
  22891. },
  22892. {
  22893. './enum/Viewmode': 51,
  22894. './objects/Panorama': 148,
  22895. './settings': 166,
  22896. './util/logger': 189,
  22897. three: 217
  22898. }
  22899. ],
  22900. 157: [
  22901. function (a, s, e) {
  22902. ;(function (e) {
  22903. 'use strict'
  22904. function t(e, t, i, n, r) {
  22905. ;(this.qualityManager = e),
  22906. (this.scene = t),
  22907. (this.camera = i),
  22908. (this.container = r),
  22909. (this.controls = n),
  22910. (this.controls.enabled = !0),
  22911. (this.controls.locked = !0),
  22912. (this.quickstartCamera = n.camera),
  22913. (this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $('#player').width(), $('#player').height())),
  22914. (this.skybox = null)
  22915. }
  22916. var i = a('three'),
  22917. n = a('../util/logger'),
  22918. o = a('../constants'),
  22919. h = (a('../util/transitions'), a('../util/lerp'), a('../util/easing'), a('../enum/Vectors')),
  22920. u = a('../enum/PanoSizeClass'),
  22921. r = (a('../materials/ModelTextureMaterial'), a('../materials/CubemapMaterial')),
  22922. d = (a('../cameras/PanoramaCamera'), a('../controls/PanoramaControls'), a('../tile/TileUtils'), a('../util/camera'), a('../util/cameraLight')),
  22923. p = (a('../util/browser'), a('../settings'), a('../gui/helpManager'), new n(e))
  22924. ;(t.prototype.load = function (e) {
  22925. e.pano.shouldRedrawOnBaseLoaded = !0
  22926. var t,
  22927. i,
  22928. n = this,
  22929. r = h.FORWARD.clone().applyQuaternion(e.quaternion),
  22930. o = r.clone().negate()
  22931. this.controls.lookAt(r.add(this.quickstartCamera.position))
  22932. var a = this.qualityManager.getPanoSize(u.BASE),
  22933. s = this.qualityManager.getPanoSize(u.STANDARD)
  22934. if (e.pano.tiled) {
  22935. p.warn('Loading startPano, TILED', e.pano.id)
  22936. var l = d.getHFOVForCamera(this.quickstartCamera, $('#player').width(), $('#player').height()),
  22937. c = this.quickstartCamera.fov
  22938. p.warn('Quickstart loading tiles in frustum: [horizontal FOV: ' + l + ', vertical FOV: ' + c + ']'),
  22939. (t = e.pano.loadTiledPano(
  22940. s,
  22941. r,
  22942. {
  22943. hFov: l,
  22944. vFov: c
  22945. },
  22946. !1,
  22947. !1,
  22948. !0
  22949. )),
  22950. (i = e.pano.loadTiledPano(a, o, null, !1, !1, !0))
  22951. } else p.warn('Loading startPano', e.pano.id), (t = e.pano.loadCube('high'))
  22952. return $.when(t).then(
  22953. function () {
  22954. n.init(e.pano, e.quaternion),
  22955. e.pano.tiled
  22956. ? i.done(
  22957. function () {
  22958. ;(e.pano.lockUntilRenderingComplete = !1), (this.controls.locked = !1)
  22959. }.bind(this)
  22960. )
  22961. : (this.controls.locked = !1)
  22962. }.bind(this)
  22963. )
  22964. }),
  22965. (t.prototype.init = function (e, t) {
  22966. p.info('Quickstart done loading, adding scene objects'),
  22967. (e.lockUntilRenderingComplete = !0),
  22968. (this.skybox = new i.Mesh(
  22969. new i.CubeGeometry(1, 1, 1),
  22970. new r({
  22971. side: i.BackSide
  22972. })
  22973. )),
  22974. (this.skybox.material.uniforms.map.value = e.getSkyboxTexture()),
  22975. this.skybox.quaternion.copy(e.quaternion),
  22976. this.scene.add(this.skybox),
  22977. $(this.container).show()
  22978. }),
  22979. (t.prototype.update = function (e) {
  22980. this.controls.update(e), this.camera.copy(this.quickstartCamera)
  22981. }),
  22982. (t.prototype.setSize = function (e, t) {
  22983. this.quickstartCamera.updateAspect(e / t)
  22984. }),
  22985. (t.prototype.destroy = function () {
  22986. this.scene.remove(this.skybox)
  22987. }),
  22988. (s.exports = t)
  22989. }).call(this, '/js/scene/QuickstartManager.js')
  22990. },
  22991. {
  22992. '../cameras/PanoramaCamera': 7,
  22993. '../constants': 8,
  22994. '../controls/PanoramaControls': 13,
  22995. '../enum/PanoSizeClass': 36,
  22996. '../enum/Vectors': 50,
  22997. '../gui/helpManager': 68,
  22998. '../materials/CubemapMaterial': 117,
  22999. '../materials/ModelTextureMaterial': 118,
  23000. '../settings': 166,
  23001. '../tile/TileUtils': 174,
  23002. '../util/browser': 182,
  23003. '../util/camera': 183,
  23004. '../util/cameraLight': 184,
  23005. '../util/easing': 186,
  23006. '../util/lerp': 188,
  23007. '../util/logger': 189,
  23008. '../util/transitions': 195,
  23009. three: 217
  23010. }
  23011. ],
  23012. 158: [
  23013. function (e, t, i) {
  23014. 'use strict'
  23015. function h(e, t, i) {
  23016. ;(this.scene = e),
  23017. (this.camera = t),
  23018. (this.renderer = null),
  23019. (this.effects = i),
  23020. (this.animateCallback = null),
  23021. (this.composer = null),
  23022. (this.qualityManager = null),
  23023. (e.renderWidth = 0),
  23024. (e.renderHeight = 0),
  23025. (this.updateClock = new M.Clock()),
  23026. (this.components = []),
  23027. (this.updateListeners = []),
  23028. (this.resizeListeners = []),
  23029. (this.forceUpdateSize = !1),
  23030. (this.started = !1),
  23031. (this.textures = {}),
  23032. (this.suspendedObjects = [])
  23033. }
  23034. var o,
  23035. a,
  23036. n,
  23037. M = e('three'),
  23038. R = e('../shaders'),
  23039. r = e('../enum/SceneRendererEvents'),
  23040. f = e('../enum/GLTextureType'),
  23041. s = e('../enum/GLCubeFaces'),
  23042. l = e('../exception/BasicException'),
  23043. c = e('../exception/RendererCreationException'),
  23044. u = e('../util/browser'),
  23045. d = e('../settings'),
  23046. p = e('events').EventEmitter
  23047. ;(window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame),
  23048. ((h.prototype = Object.create(p.prototype)).addComponent = function (e) {
  23049. this.components.push(e), e.update && this.updateListeners.push(e), e.setSize && (this.resizeListeners.push(e), (this.forceUpdateSize = !0))
  23050. }),
  23051. (h.prototype.removeComponent = function (t) {
  23052. function e(e) {
  23053. return e !== t
  23054. }
  23055. ;(this.components = this.components.filter(e)), (this.updateListeners = this.updateListeners.filter(e)), (this.resizeListeners = this.resizeListeners.filter(e))
  23056. }),
  23057. (h.prototype.start = function (e) {
  23058. if (this.started) throw new l("Can't start SceneRenderer, already started")
  23059. this.createContext(e),
  23060. //u.isMobile() && this.boluoVrInit(),
  23061. this.initComposer(),
  23062. (this.started = !0),
  23063. (b = b.bind(this))()
  23064. }),
  23065. (h.prototype.createContext = function (e) {
  23066. try {
  23067. ;(this.renderer = new M.WebGLRenderer({ antialias: !u.isMobile() })),
  23068. (this.renderer.autoClear = !0),
  23069. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  23070. this.renderer.setSize($('#player').width(), $('#player').height(), !1),
  23071. this.emit(r.ContextCreated)
  23072. } catch (e) {
  23073. throw new c('Unable to create a WebGL rendering context')
  23074. }
  23075. d.profiling.enabled && this.overrideTextures(), e.appendChild(this.renderer.domElement)
  23076. }),
  23077. (h.prototype.overrideTextures = function () {
  23078. var d = this.renderer.context,
  23079. t = 0,
  23080. i = d.createTexture
  23081. d.createTexture = function () {
  23082. var e = i.call(d)
  23083. return (e.id = t++), (this.textures[e.id] = e)
  23084. }.bind(this)
  23085. var p = d.texImage2D
  23086. d.texImage2D = function (e, t, i, n, r, o, a, s, l) {
  23087. var c,
  23088. h = this.getTextureTypeFromTarget(d, e)
  23089. ;(c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D)),
  23090. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : ((a = n), (s = r), (n = (l = o).naturalWidth), (r = l.naturalHeight), p.call(d, e, t, i, a, s, l))
  23091. var u = this.textures[c.id]
  23092. ;(u.width = h === f.TextureCube ? 6 * n : n), (u.height = r)
  23093. }.bind(this)
  23094. var n = d.deleteTexture
  23095. d.deleteTexture = function (e) {
  23096. delete this.textures[e.id], n.call(d, e)
  23097. }.bind(this)
  23098. }),
  23099. (h.prototype.updateTextureMemory =
  23100. ((n = null),
  23101. function () {
  23102. var e = 0
  23103. for (var t in this.textures) {
  23104. var i = this.textures[t]
  23105. i.width && i.height && (e += i.width * i.height * 4)
  23106. }
  23107. e !== n && this.emit(r.MemoryUsageUpdated, e), (n = e)
  23108. })),
  23109. (h.prototype.getTextureTypeFromTarget = function (e, t) {
  23110. switch (t) {
  23111. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  23112. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  23113. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  23114. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23115. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  23116. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23117. return f.TextureCube
  23118. case e.TEXTURE_2D:
  23119. return f.Texture2D
  23120. default:
  23121. return null
  23122. }
  23123. }),
  23124. (h.prototype.initComposer = function () {
  23125. ;(this.composer = new M.EffectComposer(this.renderer)),
  23126. this.composer.addPass(new M.RenderPass(this.scene, this.camera)),
  23127. /* this.composer.addPass(this.effects.hblurPass),
  23128. this.composer.addPass(this.effects.vblurPass) */
  23129. this.composer.addPass(this.effects.fastTranMaskPass) //add
  23130. }),
  23131. (h.prototype.setSize = function (e, t, i) {
  23132. ;(this.renderWidth = e), (this.renderHeight = t), (this.effects.aspect = e / t), this.renderer.setSize(e, t, !1, i), this.composer.setSize(e, t)
  23133. for (var n = 0; n < this.resizeListeners.length; n++) this.resizeListeners[n].setSize(e, t)
  23134. }),
  23135. (h.prototype.render = function () {
  23136. this.effects.fastTranMaskPass.enabled ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  23137. }),
  23138. (h.prototype.boluoVrInit = function () {
  23139. console.log('boluoVrInit'),
  23140. (this.isHuawei5X = u.detectHUAWEI5X()),
  23141. (this.oldRenderer = this.renderer),
  23142. (this.newRenderer = new this.vrRenderer(this.renderer, this, this.camera)),
  23143. (window.panoCamera = this.camera)
  23144. var i = this
  23145. ;(window._vrEnabled = !1),
  23146. Object.defineProperty(window, 'vrEnabled', {
  23147. get: function () {
  23148. return window._vrEnabled
  23149. },
  23150. set: function (e) {
  23151. ;(e = !!e)
  23152. ? ((i.renderer = i.newRenderer),
  23153. window.vrMarkers.forEach(function (e) {
  23154. e.visible = !0
  23155. }))
  23156. : ((i.renderer = i.oldRenderer),
  23157. window.vrMarkers.forEach(function (e) {
  23158. e.visible = !1
  23159. })),
  23160. (i.cursor.visible = e),
  23161. i.setSize($('#player').width(), $('#player').height()),
  23162. (window._vrEnabled = e),
  23163. setTimeout(function () {
  23164. console.log(player.cameraControls.activeControl.camera.fov)
  23165. }, 500)
  23166. }
  23167. }),
  23168. this.createCursor(0.5, !1, 1, 16777215, 0)
  23169. var e = {
  23170. setSize: function (e, t) {
  23171. i.camera.aspect = e / t
  23172. }
  23173. }
  23174. this.resizeListeners.push(e), this.vrLoadingInit()
  23175. }),
  23176. (h.prototype.vrLoadingInit = function () {
  23177. var e = new (e = function (camera) {
  23178. var t = this,
  23179. e = new M.RingGeometry(1.3, 1.5, 32, 32, 0, 1.2 * Math.PI),
  23180. i = new M.MeshBasicMaterial({
  23181. color: 4967932,
  23182. side: M.DoubleSide
  23183. }),
  23184. n = new M.Mesh(e, i)
  23185. ;((this.mesh = n).position.z = -2),
  23186. n.scale.set(0.08, 0.08, 0.08),
  23187. (n.visible = !1),
  23188. //window.player.camera.add(n),
  23189. camera.add(n),
  23190. (t.enabled = !1),
  23191. (this.update = function (e) {
  23192. 1 == t.enabled && (n.rotation.z += 15 * e)
  23193. })
  23194. })(this.camera)
  23195. ;(window.Loading = e), this.updateListeners.push(e)
  23196. }),
  23197. (h.prototype.createCursor = function (e, t, i, n, r) {
  23198. var o,
  23199. a = new M.SpriteMaterial({
  23200. opacity: i,
  23201. color: n,
  23202. transparent: t,
  23203. map: this.boluoGetTexture('images/cursor.png'),
  23204. needsUpdate: !0,
  23205. side: M.DoubleSide
  23206. })
  23207. ;(a.map.offset = new M.Vector2((1 / 17) * r, 0)),
  23208. (a.map.repeat = new M.Vector2(1 / 17, 1)),
  23209. (a.depthTest = !1),
  23210. (a.blending = M.AdditiveBlending),
  23211. (o = new M.Sprite(a)).scale.set(0.3, 0.3, 0.3),
  23212. (o.position.z = -2),
  23213. (o.visible = !1),
  23214. (o.name = 'cursor'),
  23215. this.camera.add(o),
  23216. this.scene.add(this.camera),
  23217. (this.cursor = o)
  23218. var s = new this.CursorAnimation(this.scene, o, this.camera)
  23219. ;(this.cursor.triggerTargetEvent = s.triggerTargetEvent), this.updateListeners.push(s)
  23220. }),
  23221. (h.prototype.CursorAnimation = function (e, t, o) {
  23222. ;(this.cursor = t), (this.raycaster = new M.Raycaster()), (this.targetEventObj = {}), (this.type = 1), (this.tweenFlag = !0)
  23223. var s = this
  23224. ;(this.target = o),
  23225. console.log(o.uuid),
  23226. (this.euler = new M.Euler()),
  23227. (this.q0 = new M.Quaternion()),
  23228. (this.q1 = new M.Quaternion(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5))),
  23229. (this.zee = new M.Vector3(0, 0, 1)),
  23230. (this.alpha = -1e3),
  23231. (this.beta = -1e3),
  23232. (this.gamma = -1e3),
  23233. (this.orient = M.Math.degToRad(window.orientation || 0)),
  23234. window.addEventListener('orientationchange', function () {
  23235. s.orient = M.Math.degToRad(window.orientation || 0)
  23236. }),
  23237. window.addEventListener('deviceorientation', function (e) {
  23238. var t = M.Math.degToRad(e.alpha),
  23239. i = M.Math.degToRad(e.beta),
  23240. n = M.Math.degToRad(e.gamma)
  23241. if (
  23242. (this.isHuawei5X
  23243. ? (-1e3 === s.alpha && (s.alpha = t),
  23244. -1e3 === s.beta && (s.beta = i),
  23245. -1e3 === s.gamma && (s.gamma = n),
  23246. 0.06 < Math.abs(t - s.alpha) && (s.alpha = t),
  23247. 0.006 < Math.abs(i - s.beta) && (s.beta = i),
  23248. 0.006 < Math.abs(n - s.gamma) && (s.gamma = n))
  23249. : ((s.alpha = t), (s.beta = i), (s.gamma = n)),
  23250. h.vrDebug)
  23251. ) {
  23252. $('#info-device-orientation').css('display', 'block')
  23253. var r = ''
  23254. ;(r += 'alpha=(' + s.alpha + ')<BR/>'), (r += 'beta=(' + s.beta + ')<BR/>'), (r += 'gamma=' + s.gamma + '<BR/>'), (document.getElementById('info-device-orientation').innerHTML = r)
  23255. }
  23256. }),
  23257. (this.setObjectQuaternion = function (e, t, i, n, r) {
  23258. s.euler.set(i, t, -n, 'YXZ'), e.setFromEuler(s.euler), e.multiply(s.q1), e.multiply(s.q0.setFromAxisAngle(s.zee, -r)), o.updateMatrixWorld()
  23259. }),
  23260. parent !== window &&
  23261. window.addEventListener('message', function (e) {
  23262. var t,
  23263. i,
  23264. n,
  23265. r,
  23266. o = JSON.parse(e.data),
  23267. a = -1 !== window.navigator.userAgent.indexOf('KIW-TL00H')
  23268. o &&
  23269. o.alpha &&
  23270. o.beta &&
  23271. o.gamma &&
  23272. ((t = a),
  23273. (i = M.Math.degToRad(o.alpha)),
  23274. (n = M.Math.degToRad(o.beta)),
  23275. (r = M.Math.degToRad(o.gamma)),
  23276. t
  23277. ? (-1e3 === s.alpha && (s.alpha = i),
  23278. -1e3 === s.beta && (s.beta = n),
  23279. -1e3 === s.gamma && (s.gamma = r),
  23280. 0.06 < Math.abs(i - s.alpha) && (s.alpha = i),
  23281. 0.006 < Math.abs(n - s.beta) && (s.beta = n),
  23282. 0.006 < Math.abs(r - s.gamma) && (s.gamma = r))
  23283. : ((s.alpha = i), (s.beta = n), (s.gamma = r)))
  23284. }),
  23285. (this.update = function (e) {
  23286. TWEEN.update(), window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient), this.triggerTargetEvent())
  23287. }),
  23288. (this.triggerTargetEvent = function () {
  23289. var e = this.choseObj(),
  23290. t = e ? e.object : void 0
  23291. ;(this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj &&
  23292. (t && this.autoCursorPosition(e),
  23293. 1 === this.type
  23294. ? (this.cursorAnimate && this.cursorAnimate.stop(),
  23295. t &&
  23296. t.enabled &&
  23297. this.startAnimate(
  23298. function () {
  23299. this.clickCallback(t)
  23300. }.bind(this)
  23301. ))
  23302. : this.type,
  23303. (this.targetEventObj.lastObj = t))
  23304. }),
  23305. (this.choseObj = function () {
  23306. this.raycaster.setFromCamera(
  23307. {
  23308. x: 0,
  23309. y: 0
  23310. },
  23311. o
  23312. )
  23313. var e = (this.raycaster.ray, window.vrMarkers),
  23314. t = this.raycaster.intersectObjects(e)
  23315. if (0 < t.length) return t[0]
  23316. }),
  23317. (this.clickCallback = function (e) {
  23318. this.runTHREEAction(e, 'onclick')
  23319. }),
  23320. (this.runTHREEAction = function (e, t) {
  23321. switch (t) {
  23322. case 'onclick':
  23323. e._listeners &&
  23324. e._listeners.click &&
  23325. e._listeners.click.forEach(function (e) {
  23326. e()
  23327. })
  23328. break
  23329. case 'onhover':
  23330. e._listeners &&
  23331. e._listeners.hover &&
  23332. e._listeners.hover.forEach(function (e) {
  23333. e()
  23334. })
  23335. break
  23336. case 'onout':
  23337. e._listeners &&
  23338. e._listeners.out &&
  23339. e._listeners.out.forEach(function (e) {
  23340. e()
  23341. })
  23342. }
  23343. }),
  23344. (this.startAnimate = function (e) {
  23345. this.tweenFlag && this.initAnimation(e)
  23346. }),
  23347. (this.initAnimation = function (e) {
  23348. var t = this,
  23349. i = this.cursor.material.map.offset
  23350. ;(t.tweenFlag = !1),
  23351. (this.cursorAnimate = new TWEEN.Tween(i)
  23352. .to(
  23353. {
  23354. x: 1
  23355. },
  23356. 1e3
  23357. )
  23358. .onStart(function () {
  23359. t.tweenFlag = !1
  23360. })
  23361. .onStop(function () {
  23362. ;(t.tweenFlag = !0), (this.x = 0), (i.x = 0)
  23363. })
  23364. .onUpdate(function () {})
  23365. .onComplete(function () {
  23366. e(),
  23367. (i.x = 0),
  23368. setTimeout(function () {
  23369. t.tweenFlag = !0
  23370. }, 1500)
  23371. })),
  23372. this.cursorAnimate.easing(function (e) {
  23373. return Math.floor(17 * e) / 17
  23374. }),
  23375. this.cursorAnimate.start()
  23376. }),
  23377. (this.autoCursorPosition = function (e) {
  23378. this.cursor.scale.set(0.3, 0.3, 0.3)
  23379. })
  23380. }),
  23381. (h.prototype.vrRenderer = function (a, i, e) {
  23382. var s = new i.vrCamera(e)
  23383. ;(s.bananaAspect = 0.8), this.width, this.height
  23384. i = this
  23385. ;(this.setSize = function (e, t) {
  23386. a.setSize.call(this, e, t), (i.width = e), (i.height = t)
  23387. }),
  23388. (this.render = function (e, t, i, n) {
  23389. var r, o
  23390. if (((window.cameraQua = t.quaternion.clone()), t.__RESS__SKIP__STEREO__)) return a.render(e, t, i, n)
  23391. if ('PerspectiveCamera' === t.type) (r = s.cameraL), (o = s.cameraR), e.updateMatrixWorld(), null === t.parent && t.updateMatrixWorld(), s.vrCameraUpdate(t)
  23392. else {
  23393. if ('OrthographicCamera' !== t.type) return DEBUG && console.error('Unsupported renderer: ', t.type)
  23394. r = o = t
  23395. }
  23396. a.setScissorTest(!0),
  23397. a.setScissor(0, 0, this.width / 2, this.height),
  23398. a.setViewport(0, 0, this.width / 2, this.height),
  23399. a.render.call(this, e, r, i, n),
  23400. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  23401. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  23402. a.render.call(this, e, o, i, n),
  23403. a.setScissorTest(!1)
  23404. }),
  23405. (this.__proto__ = {
  23406. __proto__: a
  23407. })
  23408. }),
  23409. (h.prototype.vrCamera = function (e) {
  23410. ;(this.type = 'StereoCamera'),
  23411. (this._aspect = 1),
  23412. (this._overlap = 0.064),
  23413. (this.cameraL = new M.PerspectiveCamera()),
  23414. this.cameraL.layers.enable(1),
  23415. (this.cameraL.matrixAutoUpdate = !1),
  23416. (this.cameraR = new M.PerspectiveCamera()),
  23417. this.cameraR.layers.enable(2),
  23418. (this.cameraR.matrixAutoUpdate = !1),
  23419. (this.eyeRight = new M.Matrix4()),
  23420. (this.eyeLeft = new M.Matrix4()),
  23421. (this.vrCameraNeedsUpdate = !0),
  23422. (window.vrCameraL = this.cameraL),
  23423. Object.defineProperty(this, 'bananaAspect', {
  23424. get: function () {
  23425. return this._aspect
  23426. },
  23427. set: function (e) {
  23428. this._aspect !== e && (this.vrCameraNeedsUpdate = !0), (this._aspect = e)
  23429. }
  23430. }),
  23431. Object.defineProperty(this, 'overlap', {
  23432. get: function () {
  23433. return this._overlap
  23434. },
  23435. set: function (e) {
  23436. this._overlap !== e && (this.vrCameraNeedsUpdate = !0), (this._overlap = e)
  23437. }
  23438. }),
  23439. (this.vrCameraUpdate = function (e) {
  23440. if (
  23441. ((this.vrCameraNeedsUpdate = !0),
  23442. (this.vrCameraNeedsUpdate =
  23443. this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far),
  23444. this.vrCameraNeedsUpdate)
  23445. ) {
  23446. ;(this.vrCameraNeedsUpdate = !1),
  23447. console.debug('vrCameraUpdate'),
  23448. (this.bananaFocus = e.focus),
  23449. (this.bananaFov = e.fov),
  23450. (this.bananaReal_aspect = e.aspect * this.bananaAspect),
  23451. (this.bananaNear = e.near),
  23452. (this.bananaFar = e.far),
  23453. console.debug(e.aspect),
  23454. (this.bananaFocus = 10)
  23455. var t,
  23456. i,
  23457. n = e.projectionMatrix.clone(),
  23458. r = this.overlap / 2,
  23459. o = (r * this.bananaNear) / this.bananaFocus,
  23460. a = this.bananaNear * Math.tan((Math.PI / 180) * this.bananaFov * 0.5)
  23461. ;(this.eyeLeft.elements[12] = -r),
  23462. (this.eyeRight.elements[12] = r),
  23463. (t = -a * this.bananaReal_aspect + o),
  23464. (i = a * this.bananaReal_aspect + o),
  23465. (n.elements[0] = (2 * this.bananaNear) / (i - t)),
  23466. (n.elements[8] = (i + t) / (i - t)),
  23467. this.cameraL.projectionMatrix.copy(n),
  23468. (t = -a * this.bananaReal_aspect - o),
  23469. (i = a * this.bananaReal_aspect - o),
  23470. (n.elements[0] = (2 * this.bananaNear) / (i - t)),
  23471. (n.elements[8] = (i + t) / (i - t)),
  23472. this.cameraR.projectionMatrix.copy(n)
  23473. }
  23474. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft), this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  23475. })
  23476. }),
  23477. (h.prototype.boluoGetTexture = function (e) {
  23478. var t = new M.TextureLoader()
  23479. return (t.crossOrigin = 'anonymous'), t.load(e)
  23480. }),
  23481. (h.prototype.updateScreenSize = function (e) {
  23482. var t,
  23483. i,
  23484. n,
  23485. r = !1
  23486. e && !e.resize && null != e.width && null != e.height
  23487. ? ((i = e.width), (n = e.height), (r = !0), (t = 1))
  23488. : ((i = $('#player').width()),
  23489. (n = $('#player').height()),
  23490. e && e.resize && ((o = this.renderWidth), (a = this.renderHeight)),
  23491. (i === o && n === a && !this.forceUpdateSize) || ((o = i), (a = n), (r = !0), (t = window.devicePixelRatio))),
  23492. r && (this.setSize(i, n, t), (this.forceUpdateSize = !1))
  23493. }),
  23494. (h.prototype.updateComponents = function () {
  23495. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++) this.updateListeners[t].update(e)
  23496. }),
  23497. (h.prototype.suspend = function () {
  23498. ;(this.started = !1),
  23499. (this.suspendedObjects = this.scene.children.map(
  23500. function (e) {
  23501. return this.scene.remove(e), e
  23502. }.bind(this)
  23503. )),
  23504. this.render()
  23505. }),
  23506. (h.prototype.resume = function () {
  23507. this.suspendedObjects.forEach(
  23508. function (e) {
  23509. this.scene.add(e)
  23510. }.bind(this)
  23511. ),
  23512. (this.suspendedObjects = []),
  23513. (this.started = !0),
  23514. b()
  23515. })
  23516. var g,
  23517. m,
  23518. v,
  23519. y,
  23520. A,
  23521. C,
  23522. I,
  23523. P,
  23524. O,
  23525. L,
  23526. D,
  23527. N,
  23528. F,
  23529. E,
  23530. _,
  23531. b = function () {
  23532. this.started && (window.requestAnimationFrame(b), this.updateScreenSize(), this.updateComponents(), this.updateTextureMemory(), this.render(), this.emit(r.AfterRender))
  23533. }
  23534. ;(h.prototype.getImageData =
  23535. ((E = document.createElement('canvas')),
  23536. (_ = E.getContext('2d')),
  23537. function (e, t, i) {
  23538. return (E.width === t && E.height === i) || ((E.width = t), (E.height = i)), _.drawImage(e, 0, 0, t, i), _.getImageData(0, 0, t, i)
  23539. })),
  23540. (h.prototype.initSizedTexture2D = function (e, t, i) {
  23541. var n = this.renderer,
  23542. r = n.context,
  23543. o = n.state,
  23544. a = new M.Texture(null)
  23545. !(a.flipY = !1) !== i && (i = !1), (a.generateMipmaps = i)
  23546. var s = n.paramThreeToGL(a.format),
  23547. l = n.paramThreeToGL(a.type),
  23548. c = n.properties.get(a),
  23549. h = r.createTexture()
  23550. o.bindTexture(r.TEXTURE_2D, h), r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY), r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null), (a.wrapS = t), (a.wrapT = t)
  23551. var u = n.paramThreeToGL(t)
  23552. return (
  23553. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  23554. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  23555. i
  23556. ? ((a.magFilter = M.LinearFilter),
  23557. (a.minFilter = M.LinearMipMapLinearFilter),
  23558. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23559. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  23560. r.generateMipmap(r.TEXTURE_2D))
  23561. : ((a.magFilter = M.LinearFilter),
  23562. (a.minFilter = M.LinearFilter),
  23563. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23564. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  23565. o.bindTexture(r.TEXTURE_2D, null),
  23566. (c.__webglTexture = h),
  23567. a
  23568. )
  23569. }),
  23570. (h.prototype.initSizedCubeMap = function (e, t) {
  23571. var i = this.renderer,
  23572. n = i.context,
  23573. r = i.state,
  23574. o = new M.CubeTexture([null, null, null, null, null, null])
  23575. ;(o.flipY = !1), (o.generateMipmaps = t)
  23576. var a = i.paramThreeToGL(o.format),
  23577. s = i.paramThreeToGL(o.type),
  23578. l = i.properties.get(o),
  23579. c = n.createTexture()
  23580. r.bindTexture(n.TEXTURE_CUBE_MAP, c), n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY)
  23581. for (var h = 0; h < 6; h++) n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null)
  23582. return (
  23583. t
  23584. ? ((o.magFilter = M.LinearFilter),
  23585. (o.minFilter = M.LinearMipMapLinearFilter),
  23586. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23587. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  23588. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  23589. n.generateMipmap(n.TEXTURE_CUBE_MAP))
  23590. : ((o.magFilter = M.LinearFilter),
  23591. (o.minFilter = M.LinearFilter),
  23592. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23593. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  23594. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  23595. (l.__image__webglTextureCube = c),
  23596. o
  23597. )
  23598. }),
  23599. (h.prototype.deallocateCubeTexture = function (e) {
  23600. var t = this.renderer,
  23601. i = t.context,
  23602. n = t.properties.get(e)
  23603. i.deleteTexture(n.__image__webglTextureCube)
  23604. }),
  23605. (h.prototype.uploadTexture2D = function (e, t, i, n, r, o) {
  23606. var a = this.renderer,
  23607. s = a.context,
  23608. l = a.state,
  23609. c = a.properties.get(t)
  23610. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23611. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23612. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23613. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23614. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23615. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23616. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23617. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23618. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23619. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23620. l.bindTexture(s.TEXTURE_2D, null)
  23621. }),
  23622. (h.prototype.uploadTexture3D = function (e, t, i, n, r, o, a) {
  23623. var s = this.renderer,
  23624. l = s.context,
  23625. c = s.state,
  23626. h = s.properties.get(t)
  23627. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23628. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23629. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23630. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23631. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23632. }),
  23633. (h.prototype.rebuildMipMaps2D = function (e) {
  23634. var t = this.renderer,
  23635. i = t.context,
  23636. n = t.state
  23637. t.properties.get(e), i.generateMipmap(i.TEXTURE_2D), n.bindTexture(i.TEXTURE_2D, null)
  23638. }),
  23639. (h.prototype.rebuildMipMaps3D = function (e) {
  23640. var t = this.renderer,
  23641. i = t.context,
  23642. n = t.state,
  23643. r = t.properties.get(e)
  23644. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube), i.generateMipmap(i.TEXTURE_CUBE_MAP), n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23645. }),
  23646. (h.prototype.renderToCubeMap =
  23647. ((P = !1),
  23648. (F = N = D = L = O = null),
  23649. function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23650. this.renderer.context,
  23651. P ||
  23652. (((L = new M.OrthographicCamera(-0.5, 0.5, 0.5, -0.5, -200, 200)).position.z = 150),
  23653. (O = new M.Scene()).add(L),
  23654. (D = new M.ShaderMaterial({
  23655. uniforms: {
  23656. tDiffuse: {
  23657. type: 't',
  23658. value: null
  23659. },
  23660. alpha: {
  23661. type: 'f',
  23662. value: 1
  23663. }
  23664. },
  23665. vertexShader: R.basicTextured.vertexShader,
  23666. fragmentShader: R.basicTextured.fragmentShader,
  23667. depthWrite: !1,
  23668. depthTest: !1,
  23669. side: M.DoubleSide
  23670. })),
  23671. (N = new M.PlaneBufferGeometry(1, 1)),
  23672. ((F = new M.Mesh(N, D)).position.z = 0),
  23673. O.add(F),
  23674. (P = !0))
  23675. var m = N.getAttribute('uv')
  23676. m.setDynamic(!0), (m.needsUpdate = !0)
  23677. var v = m.array,
  23678. y = r / i,
  23679. A = o / n,
  23680. C = a / i,
  23681. I = s / n
  23682. ;(v[0] = y), (v[1] = A + I), (v[2] = y + C), (v[3] = A + I), (v[4] = y), (v[5] = A), (v[6] = y + C), (v[7] = A)
  23683. var E = N.getAttribute('position')
  23684. E.setDynamic(!0), (E.needsUpdate = !0)
  23685. var _ = E.array,
  23686. b = l / t.width - 0.5,
  23687. w = c / t.height - 0.5,
  23688. T = h / t.width,
  23689. x = u / t.height
  23690. ;(_[0] = b),
  23691. (_[1] = w + x),
  23692. (_[3] = b + T),
  23693. (_[4] = w + x),
  23694. (_[6] = b),
  23695. (_[7] = w),
  23696. (_[9] = b + T),
  23697. (_[10] = w),
  23698. this.renderer.properties.get(e),
  23699. (D.uniforms.tDiffuse.value = e),
  23700. (D.blending = p || M.NoBlending),
  23701. (D.transparent = !!f),
  23702. null != g || (g = 1),
  23703. (D.uniforms.alpha.value = g),
  23704. (D.needUpdate = !0),
  23705. (t.activeCubeFace = d),
  23706. t.viewport.set(0, 0, t.width, t.height)
  23707. var S = this.renderer.autoClear
  23708. ;(this.renderer.autoClear = !1), this.renderer.render(O, L, t, !1), (this.renderer.autoClear = S)
  23709. })),
  23710. (h.prototype.copyCubeMap =
  23711. ((g = !1),
  23712. (C = A = y = v = m = null),
  23713. (I = new M.Euler()),
  23714. new M.Vector3(),
  23715. function (e, t, i, n, r, o, a, s, l) {
  23716. this.renderer,
  23717. g ||
  23718. ((v = new M.OrthographicCamera(-1, 1, 1, -1, 0, 200)).position.set(0, 0, 0),
  23719. (m = new M.Scene()).add(v),
  23720. (y = new M.ShaderMaterial({
  23721. uniforms: {
  23722. tDiffuse: {
  23723. type: 't',
  23724. value: null
  23725. },
  23726. alpha: {
  23727. type: 'f',
  23728. value: 1
  23729. }
  23730. },
  23731. vertexShader: R.copyCubeMap.vertexShader,
  23732. fragmentShader: R.copyCubeMap.fragmentShader,
  23733. depthWrite: !1,
  23734. depthTest: !1,
  23735. side: M.DoubleSide
  23736. })),
  23737. (A = new M.BoxGeometry(2, 2, 2)),
  23738. (C = new M.Mesh(A, y)),
  23739. m.add(C),
  23740. (g = !0))
  23741. for (var c = 0; c < 6; c++)
  23742. h.getCubeOrientationForCubeFace(c, I),
  23743. C.rotation.copy(I),
  23744. (C.matrixWorldNeedsUpdate = !0),
  23745. C.updateMatrixWorld(),
  23746. (y.uniforms.tDiffuse.value = e),
  23747. (y.blending = a || M.NoBlending),
  23748. (y.transparent = !!s),
  23749. null != l || (l = 1),
  23750. (y.uniforms.alpha.value = l),
  23751. (y.needUpdate = !0),
  23752. (t.activeCubeFace = c),
  23753. t.viewport.set(0, 0, r, o),
  23754. this.renderer.render(m, v, t, !1)
  23755. })),
  23756. (h.getLookAtForCubeFace = function (e, t) {
  23757. switch (e) {
  23758. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23759. t.set(1, 0, 0)
  23760. break
  23761. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23762. t.set(-1, 0, 0)
  23763. break
  23764. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23765. t.set(0, 1, 0)
  23766. break
  23767. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23768. t.set(0, -1, 0)
  23769. break
  23770. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23771. t.set(0, 0, 1)
  23772. break
  23773. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23774. t.set(0, 0, -1)
  23775. }
  23776. }),
  23777. (h.getCubeOrientationForCubeFace = function (e, t) {
  23778. switch (e) {
  23779. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23780. t.set(0, -Math.PI / 2, 0)
  23781. break
  23782. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23783. t.set(0, Math.PI / 2, 0)
  23784. break
  23785. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23786. t.set(Math.PI / 2, Math.PI, 0)
  23787. break
  23788. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23789. t.set(-Math.PI / 2, Math.PI, 0)
  23790. break
  23791. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23792. t.set(0, -Math.PI, 0)
  23793. break
  23794. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23795. t.set(0, 0, 0)
  23796. }
  23797. }),
  23798. (t.exports = h)
  23799. },
  23800. {
  23801. '../enum/GLCubeFaces': 25,
  23802. '../enum/GLTextureType': 26,
  23803. '../enum/SceneRendererEvents': 43,
  23804. '../exception/BasicException': 55,
  23805. '../exception/RendererCreationException': 57,
  23806. '../settings': 166,
  23807. '../shaders': 167,
  23808. '../util/browser': 182,
  23809. events: 202,
  23810. three: 217
  23811. }
  23812. ],
  23813. 159: [
  23814. function (e, t, i) {
  23815. 'use strict'
  23816. function n(e) {
  23817. ;(this.messenger = new a(e)), (this.clientKey = null)
  23818. }
  23819. var o = e('../util/ajax'),
  23820. r = e('./PostMessageType'),
  23821. a = e('./postmessage'),
  23822. s = e('./VersionInfo'),
  23823. l = e('events').EventEmitter,
  23824. c = window.location.origin + '/api/v1/user/'
  23825. ;((n.prototype = Object.create(l.prototype)).bindEvents = function () {
  23826. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  23827. }),
  23828. (n.prototype.waitForConnection = function () {
  23829. return new Promise(
  23830. function (t, i) {
  23831. this.messenger.on(
  23832. r.CONNECT,
  23833. function (e) {
  23834. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  23835. }.bind(this)
  23836. )
  23837. }.bind(this)
  23838. )
  23839. }),
  23840. (n.prototype.onConnectionReceived = function (i) {
  23841. return (
  23842. this.messenger.setTarget(i.source, i.origin),
  23843. this.verifyConnection(i).then(
  23844. function (e, t) {
  23845. this.messenger.send({
  23846. type: r.ACCEPT,
  23847. toId: i.fromId,
  23848. warning: t
  23849. }),
  23850. (this.clientKey = e),
  23851. this.messenger.removeAllListeners(r.CONNECT),
  23852. this.bindEvents()
  23853. }.bind(this),
  23854. function (e) {
  23855. this.messenger.send({
  23856. type: r.REJECT,
  23857. toId: i.fromId,
  23858. reason: e
  23859. }),
  23860. this.messenger.setTarget()
  23861. }.bind(this)
  23862. )
  23863. )
  23864. }),
  23865. (n.prototype.verifyConnection = function (r) {
  23866. return new Promise(function (e, t) {
  23867. var i
  23868. if (s.isDeprecated(r.sdkVersion)) i = '这个版本正在被弃用'
  23869. else if (!s.isSupported(r.sdkVersion)) return t('不支持此版本的SDK')
  23870. var n = {
  23871. cache: !1,
  23872. headers: {
  23873. 'X-port-Application-Key': r.applicationKey,
  23874. 'X-port-Referrer': r.origin
  23875. }
  23876. }
  23877. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, 'key/referrer mismatch'))
  23878. })
  23879. }),
  23880. (n.prototype.onMessageReceived = function (t) {
  23881. if (this.validateClientApplicationKey(t.applicationKey)) {
  23882. var i = this
  23883. ;(t.onDone = function (e) {
  23884. ;(e.toId = t.fromId), (e.uid = t.uid), (e.type = r.RESPONSE), i.messenger.send(e)
  23885. }),
  23886. this.emit(r.ACTION, t)
  23887. }
  23888. }),
  23889. (n.prototype.validateClientApplicationKey = function (e) {
  23890. return this.clientKey === e
  23891. }),
  23892. (n.prototype.sendEvent = function (e, t) {
  23893. this.messenger.send({
  23894. type: r.EVENT,
  23895. eventType: e,
  23896. eventData: t
  23897. })
  23898. }),
  23899. (t.exports = n)
  23900. },
  23901. {
  23902. '../util/ajax': 181,
  23903. './PostMessageType': 160,
  23904. './VersionInfo': 163,
  23905. './postmessage': 165,
  23906. events: 202
  23907. }
  23908. ],
  23909. 160: [
  23910. function (e, t, i) {
  23911. 'use strict'
  23912. t.exports = Object.freeze({
  23913. CONNECT: 'postmessage.connect',
  23914. ACCEPT: 'postmessage.accept',
  23915. REJECT: 'postmessage.reject',
  23916. ACTION: 'postmessage.action',
  23917. RESPONSE: 'postmessage.response',
  23918. EVENT: 'postmessage.event'
  23919. })
  23920. },
  23921. {}
  23922. ],
  23923. 161: [
  23924. function (e, t, i) {
  23925. 'use strict'
  23926. t.exports = Object.freeze({
  23927. MOVE: 'sdk.move',
  23928. ENTER_PANO: 'sdk.enterpano',
  23929. MODEL_LOADED: 'sdk.modelloaded'
  23930. })
  23931. },
  23932. {}
  23933. ],
  23934. 162: [
  23935. function (e, t, i) {
  23936. 'use strict'
  23937. t.exports = Object.freeze({
  23938. FLY: 'transition.fly',
  23939. FADEOUT: 'transition.fade',
  23940. INSTANT: 'transition.instant'
  23941. })
  23942. },
  23943. {}
  23944. ],
  23945. 163: [
  23946. function (e, t, i) {
  23947. 'use strict'
  23948. t.exports = {
  23949. current: '1.0',
  23950. supported: ['1.0'],
  23951. deprecated: [],
  23952. isSupported: function (e) {
  23953. return -1 !== this.supported.indexOf(e)
  23954. },
  23955. isDeprecated: function (e) {
  23956. return -1 !== this.deprecated.indexOf(e)
  23957. },
  23958. isValid: function (e) {
  23959. return this.isSupported(e) || this.isDeprecated(e)
  23960. }
  23961. }
  23962. },
  23963. {}
  23964. ],
  23965. 164: [
  23966. function (q, X, e) {
  23967. ;(function (e) {
  23968. 'use strict'
  23969. function r(e, t, i) {
  23970. e = e && e.toLowerCase().trim()
  23971. var n = new C.UP.clone(),
  23972. r = Math.PI / 3,
  23973. o = Math.PI / 2
  23974. switch (e) {
  23975. case 'left':
  23976. i.copy(t), i.applyAxisAngle(n, o)
  23977. break
  23978. case 'right':
  23979. i.copy(t), i.applyAxisAngle(n, -o)
  23980. break
  23981. case 'forwardleft':
  23982. i.copy(t), i.applyAxisAngle(n, r)
  23983. break
  23984. case 'forwardright':
  23985. i.copy(t), i.applyAxisAngle(n, -r)
  23986. break
  23987. case 'forward':
  23988. default:
  23989. i.copy(t)
  23990. }
  23991. return i
  23992. }
  23993. function o(e, t) {
  23994. if (e) {
  23995. var i = {
  23996. pano: e,
  23997. lookAtPoint: null,
  23998. duration: null,
  23999. maxDistanceOverride: null,
  24000. skipWarpingCheck: !1
  24001. }
  24002. this.player.flyToPano(i, function () {
  24003. t &&
  24004. t({
  24005. success: !0,
  24006. message: 'Transition complete.'
  24007. })
  24008. })
  24009. } else
  24010. M.warn('Showcase -> clickPanoObject: Unable to find pano.'),
  24011. t &&
  24012. t({
  24013. success: !1,
  24014. error: 'Unable to find pano.'
  24015. })
  24016. }
  24017. function a(e, t) {
  24018. t.copy(C.FORWARD), e.getDirection(t)
  24019. }
  24020. function c(i) {
  24021. return {
  24022. panos: i.panos.list.map(function (e) {
  24023. var t = y.getCubemapUrls(i.urls, e.id, 'high')[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z]
  24024. return {
  24025. uuid: e.id,
  24026. aligned: e.alignmentType === g.ALIGNED,
  24027. neighbourUUIDs: e.neighbourUUIDs.slice(),
  24028. position: (function (e) {
  24029. return e.alignmentType !== g.ALIGNED
  24030. ? null
  24031. : {
  24032. x: e.position.x,
  24033. y: e.position.y,
  24034. z: e.position.z
  24035. }
  24036. })(e),
  24037. rotation: (function (e) {
  24038. var t = new h.Euler().setFromQuaternion(e.quaternion, 'YXZ')
  24039. return {
  24040. x: h.Math.radToDeg(t._x),
  24041. y: h.Math.radToDeg(t._y),
  24042. z: h.Math.radToDeg(t._z)
  24043. }
  24044. })(e),
  24045. thumbnail: t
  24046. }
  24047. })
  24048. }
  24049. }
  24050. var t,
  24051. l,
  24052. i,
  24053. h = q('three'),
  24054. u = q('./ApiHost'),
  24055. n = q('../util/logger'),
  24056. d = q('../util/common'),
  24057. s = q('../util/math'),
  24058. p = q('../enum/ModelManagerEvents'),
  24059. f = q('./PostMessageType'),
  24060. g = q('../enum/AlignmentType'),
  24061. m = q('../enum/Direction'),
  24062. v = q('./TransitionStyles'),
  24063. y = q('../util/panorama'),
  24064. A = q('../enum/GLCubeFaces'),
  24065. C = q('../enum/Vectors'),
  24066. I = q('../enum/Viewmode'),
  24067. E = q('../enum/WarpStyle'),
  24068. _ = (q('../enum/Keys'), q('../enum/PlayerEvents')),
  24069. b = q('../sdk/SdkEvents'),
  24070. w = ((C = q('../enum/Vectors')), q('../enum/ControlEvents')),
  24071. T = q('../enum/RenderLayers'),
  24072. x = (q('../constants'), q('../settings')),
  24073. S = q('../lib/jpeg_encoder'),
  24074. M = new n(e),
  24075. R =
  24076. ((N.active = !1),
  24077. (N.angle = 0),
  24078. (N.angleTravelled = 0),
  24079. (N.playerDirection = new h.Vector3()),
  24080. (N.lastFacingDirection = new h.Vector3()),
  24081. (N.onDone = null),
  24082. (N.player = null),
  24083. (N.start = function (e, t, i, n) {
  24084. ;(N.active = !0),
  24085. e && t && (t = 0),
  24086. (N.angle = e || t),
  24087. (N.xAngle = e),
  24088. (N.yAngle = t),
  24089. (N.angleTravelled = 0),
  24090. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24091. i.getDirection(N.playerDirection),
  24092. N.lastFacingDirection.copy(N.playerDirection),
  24093. N.projectVectors(),
  24094. (N.onDone = n),
  24095. (N.player = i),
  24096. N()
  24097. }),
  24098. (N.projectVectors = function () {
  24099. N.xAngle && (N.playerDirection.projectOnPlane(C.UP), N.lastFacingDirection.projectOnPlane(C.UP))
  24100. }),
  24101. N),
  24102. P =
  24103. ((i = new h.Vector3()),
  24104. function (e) {
  24105. e ? (i.copy(e.position), i.add(e.discPosition), s.projectPositionToCanvas(i, this.player.camera, i), this.click(i.x, i.y)) : M.warn('Showcase -> clicktagObject: Unable to find tag.')
  24106. }),
  24107. O =
  24108. ((l = new h.Vector3()),
  24109. function (e) {
  24110. var t = this.player.getDirection()
  24111. l.copy(t)
  24112. var i = l.y
  24113. ;(l.y = 0), l.normalize()
  24114. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1)
  24115. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA) return 0 !== e && M.warn('Cannot rotate in y direction when in ' + this.player.mode + ' mode'), 0
  24116. this.player.mode === I.DOLLHOUSE && (n = -n)
  24117. var r =
  24118. function () {
  24119. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  24120. }.call(this) - 0.1,
  24121. o =
  24122. function () {
  24123. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  24124. }.call(this) + 0.1,
  24125. a = n + e
  24126. r < a ? (a = r) : a < o && (a = o)
  24127. var s = a - n
  24128. return 0 < e && s < 0.01 && (s = 0), e < 0 && -0.01 < s && (s = 0), s
  24129. }),
  24130. L =
  24131. ((t = new h.Euler()),
  24132. function (e) {
  24133. return (
  24134. t.setFromQuaternion(e.quaternion, 'YXZ'),
  24135. {
  24136. position: {
  24137. x: e.position.x,
  24138. y: e.position.y,
  24139. z: e.position.z
  24140. },
  24141. rotation: {
  24142. x: h.Math.radToDeg(t.x),
  24143. y: h.Math.radToDeg(t.y),
  24144. z: 0
  24145. },
  24146. pano: e.currentPano ? e.currentPano.id : null,
  24147. mode: e.mode
  24148. }
  24149. )
  24150. }),
  24151. D = null
  24152. function N() {
  24153. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD), N.player.getDirection(N.playerDirection), N.projectVectors()
  24154. var e = N.playerDirection.angleTo(N.lastFacingDirection)
  24155. ;(N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? ((N.active = !1), N.onDone && (0, N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection), window.setTimeout(N, 4))
  24156. }
  24157. X.exports = {
  24158. init: function (e, t, i, n, r) {
  24159. Y.init(e, t, i, r),
  24160. (D = new Promise(
  24161. function (e, t) {
  24162. i.on(_.Ready, function () {
  24163. e()
  24164. })
  24165. }.bind(this)
  24166. ))
  24167. var o = new u(window),
  24168. a = o.waitForConnection()
  24169. a.then(function (e) {
  24170. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  24171. })
  24172. var s,
  24173. l =
  24174. ((s = Date.now()),
  24175. function () {
  24176. if (!(Date.now() - s < 100)) {
  24177. var e = L(i)
  24178. o.sendEvent(b.MOVE, {
  24179. state: e
  24180. }),
  24181. (s = Date.now())
  24182. }
  24183. })
  24184. i.on(_.Move, l),
  24185. i.on(_.ViewChanged, l),
  24186. n.on(p.ActiveModelChanged, function (e) {
  24187. function t(e) {
  24188. var t,
  24189. i = e.newPano.id
  24190. e.oldPano && (t = e.oldPano.id),
  24191. i !== t &&
  24192. o.sendEvent(b.ENTER_PANO, {
  24193. oldPano: t,
  24194. newPano: i
  24195. })
  24196. }
  24197. var i = e.model,
  24198. n = e.oldModel
  24199. ;(Y.model = i),
  24200. a.then(function () {
  24201. o.sendEvent(b.MODEL_LOADED, {
  24202. metadata: c(i)
  24203. })
  24204. }),
  24205. n &&
  24206. n.panos.forEach(function (e) {
  24207. e.removeEventListener('enter', t)
  24208. }),
  24209. i.panos.forEach(function (e) {
  24210. e.on('enter', t)
  24211. })
  24212. })
  24213. }
  24214. }
  24215. var F,
  24216. B,
  24217. V,
  24218. k,
  24219. U,
  24220. H,
  24221. z,
  24222. G,
  24223. W,
  24224. j,
  24225. Y = {
  24226. director: null,
  24227. player: null,
  24228. controls: null,
  24229. sceneRenderer: null,
  24230. model: null,
  24231. init: function (e, t, i, n) {
  24232. ;(this.director = e), (this.player = i), (this.controls = t), (this.sceneRenderer = n)
  24233. },
  24234. handleToObject: {},
  24235. objectToHandle: {},
  24236. handleCount: 0,
  24237. onMessageReceive: function (e) {
  24238. if (e) {
  24239. var t = e.targetFunction,
  24240. i = e.params,
  24241. n = e.onDone
  24242. t && this[t] && this[t](i, n)
  24243. }
  24244. },
  24245. waitForInit: function (e, t) {
  24246. D.then(
  24247. t.bind({
  24248. success: !0,
  24249. message: 'Init complete.'
  24250. })
  24251. )
  24252. },
  24253. moveToPano:
  24254. ((W = new h.Euler(0, 0, 0, 'YXZ')),
  24255. (j = new h.Quaternion()),
  24256. function (e, t) {
  24257. var i = e.pano,
  24258. n = e.rotation,
  24259. r = e.transition
  24260. if (!this.model)
  24261. return t({
  24262. success: !1,
  24263. error: 'The model has not been loaded yet'
  24264. })
  24265. var o = this.model.panos.get(i)
  24266. if (!o)
  24267. return t({
  24268. success: !1,
  24269. error: i + ' does not exist in this model'
  24270. })
  24271. if (!n)
  24272. return t({
  24273. sucess: !1,
  24274. erorr: n + ' is not a valid rotation'
  24275. })
  24276. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), 'YXZ'), console.log(n.z)
  24277. var a = {
  24278. success: !0,
  24279. message: i
  24280. }
  24281. if (r === v.FADEOUT) j.setFromEuler(W), this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a))
  24282. else {
  24283. var s, l
  24284. r === v.INSTANT && (l = s = 0)
  24285. var c = C.FORWARD.clone().applyEuler(W).add(o.position)
  24286. this.player.flyToPano(
  24287. {
  24288. pano: o,
  24289. lookAtPoint: c,
  24290. duration: s,
  24291. aimDuration: l
  24292. },
  24293. t.bind(this, a)
  24294. )
  24295. }
  24296. }),
  24297. moveInDirection: function (e, t) {
  24298. var i = e.direction
  24299. return void 0 === m[i]
  24300. ? (M.warn('Showcase -> moveInDirection: Cannot move in invalid direction.'),
  24301. void (
  24302. t &&
  24303. t({
  24304. success: !1,
  24305. error: 'Invalid direction.'
  24306. })
  24307. ))
  24308. : void this.player.flyLocalDirection(C[i].clone()).then(function (e) {
  24309. t(
  24310. e
  24311. ? {
  24312. success: !0,
  24313. message: 'moved ' + i
  24314. }
  24315. : {
  24316. success: !1,
  24317. error: 'Cannot move in direction: ' + i
  24318. }
  24319. )
  24320. })
  24321. },
  24322. getPose: function (e, t) {
  24323. return (
  24324. this.player.camera.position,
  24325. new h.Euler().setFromQuaternion(this.player.camera.quaternion, 'YXZ'),
  24326. t({
  24327. success: !0,
  24328. message: L(this.player)
  24329. })
  24330. )
  24331. },
  24332. takeScreenShot:
  24333. ((z = new h.PerspectiveCamera()),
  24334. (G = new h.WebGLRenderTarget()),
  24335. function (e, t) {
  24336. if (!e.resolution)
  24337. return t({
  24338. success: !1,
  24339. error: 'An invalid resolution was specified'
  24340. })
  24341. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  24342. var i = this.sceneRenderer.renderer.getSize()
  24343. ;(e.resolution.width = i.width), (e.resolution.height = i.height)
  24344. }
  24345. z.layers.set(T.DEFAULT),
  24346. e.visibleObjects &&
  24347. (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  24348. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  24349. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE))
  24350. var n = e.resolution.width,
  24351. r = e.resolution.height,
  24352. o = n / r
  24353. z.position.copy(this.sceneRenderer.camera.position),
  24354. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  24355. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  24356. (z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o),
  24357. G.setSize(n, r),
  24358. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G)
  24359. var a = new Uint8Array(n * r * 4)
  24360. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a)
  24361. var s = S.encode(
  24362. {
  24363. data: a,
  24364. width: n,
  24365. height: r,
  24366. heading: 180,
  24367. pitch: 0
  24368. },
  24369. {
  24370. quality: 75,
  24371. flipY: !0
  24372. }
  24373. )
  24374. t({
  24375. success: !0,
  24376. message: 'data:image/jpg;base64,' + d.uint8ToBase64(s.data)
  24377. })
  24378. }),
  24379. findRankedPano:
  24380. ((U = new h.Vector3()),
  24381. (H = new h.Vector3()),
  24382. function (e, t) {
  24383. a(this.player, H), r(t, H, U)
  24384. var i = this.player.rankedPanoInDirection(e, U)
  24385. if (i) {
  24386. var n = this.objectToHandle[i.id]
  24387. return n || ((this.objectToHandle[i.id] = n = this.handleCount++), (this.handleToObject[n] = i)), n
  24388. }
  24389. return M.warn('Showcase -> findRankedPano: Unable to find nearby pano.'), -1
  24390. }),
  24391. findRankedtag:
  24392. ((V = new h.Vector3()),
  24393. (k = new h.Vector3()),
  24394. function (e, t) {
  24395. a(this.player, k), r(t, k, V)
  24396. var i = this.player.rankedtagInDirection(e, V)
  24397. if (i) {
  24398. var n = this.objectToHandle[i.sid]
  24399. return n || ((this.objectToHandle[i.sid] = n = this.handleCount++), (this.handleToObject[n] = i)), n
  24400. }
  24401. return M.warn('Showcase -> findRankedtag: Unable to find nearby tag.'), -1
  24402. }),
  24403. clickNearesttag: function (e) {
  24404. this.clickRankedtag(0, e)
  24405. },
  24406. clickRankedtag: function (e, t) {
  24407. var i = function (e, t) {
  24408. var i = this.findRankedtag(e, t)
  24409. return 0 <= i ? this.handleToObject[i] : (M.warn('Showcase -> findRankedtagObject: Unable to find nearby tag.'), null)
  24410. }.call(this, e, t)
  24411. i && P.call(this, i)
  24412. },
  24413. clickNearestPano: function (e, t) {
  24414. this.clickRankedPano(0, e, t)
  24415. },
  24416. clickRankedPano: function (e, t, i) {
  24417. var n = function (e, t) {
  24418. var i = this.findRankedPano(e, t)
  24419. return 0 <= i ? this.handleToObject[i] : (M.warn('Showcase -> findRankedPanoObject: Unable to find nearby pano.'), null)
  24420. }.call(this, e, t)
  24421. n ? o.call(this, n, i) : i(null)
  24422. },
  24423. clickPano: function (e, t) {
  24424. var i = this.handleTable[e]
  24425. i ? o.call(this, i, t) : t(null)
  24426. },
  24427. rotateDirection: function (e, t) {
  24428. var i = e.direction,
  24429. n = e.angle
  24430. if (!R.active) {
  24431. var r = 0,
  24432. o = 0,
  24433. a = 0,
  24434. s = 0
  24435. if (!n || isNaN(n))
  24436. return (
  24437. M.warn('Showcase -> rotateDirection: Invalid rotation angle.'),
  24438. void (
  24439. t &&
  24440. t({
  24441. success: !1,
  24442. error: 'Invalid rotation angle.'
  24443. })
  24444. )
  24445. )
  24446. if (this.player.mode === I.TRANSITIONING)
  24447. return (
  24448. M.warn('Automation -> rotateDirection: Cannot rotate while transitioning'),
  24449. void (
  24450. t &&
  24451. t({
  24452. success: !1,
  24453. error: 'Cannot rotate while transitioning'
  24454. })
  24455. )
  24456. )
  24457. if (i === m.RIGHT || i === m.LEFT) i === m.RIGHT && (n = -n), (r = 0 < n ? -1 : 1), (a = n)
  24458. else {
  24459. if (i !== m.UP && i !== m.DOWN)
  24460. return (
  24461. M.warn('Showcase -> rotateDirection: Invalid direction for rotation: ' + i),
  24462. void (
  24463. t &&
  24464. t({
  24465. success: !1,
  24466. error: 'Invalid direction for rotation.'
  24467. })
  24468. )
  24469. )
  24470. if (this.player.mode === I.FLOORPLAN)
  24471. return (
  24472. M.warn('Showcase -> rotateDirection: Cannot rotate ' + i + ' in floorplan mode'),
  24473. void (
  24474. t &&
  24475. t({
  24476. success: !1,
  24477. error: 'Cannot rotate ' + i + ' in floorplan mode'
  24478. })
  24479. )
  24480. )
  24481. if ((i === m.DOWN && (n = -n), 0 === (n = O.call(this, n))))
  24482. return (
  24483. M.warn('Showcase -> rotateDirection: Already at maximum rotation in direction: ' + i),
  24484. void (
  24485. t &&
  24486. t({
  24487. success: !1,
  24488. error: 'Already at maximum rotation in direction: ' + i
  24489. })
  24490. )
  24491. )
  24492. ;(o = 0 < n ? 1 : -1), (s = n)
  24493. }
  24494. var l = n
  24495. ;(n = h.Math.degToRad(n)), (a = h.Math.degToRad(a)), (s = h.Math.degToRad(s))
  24496. var c = this.controls.activeControl
  24497. c.startRotating(r, o),
  24498. R.start(a, s, this.player, function () {
  24499. c.stopRotating(!0),
  24500. t &&
  24501. t({
  24502. success: !0,
  24503. message: 'Rotated ' + l.toFixed(2) + '° in direction: ' + e.direction
  24504. })
  24505. })
  24506. }
  24507. },
  24508. rotate:
  24509. ((F = new h.Vector3()),
  24510. (B = new h.Vector3()),
  24511. function (e, t) {
  24512. var i = e.xAngle,
  24513. n = e.yAngle
  24514. if (!R.active) {
  24515. if (((i = i || 0), (n = n || 0), isNaN(i) || isNaN(n)))
  24516. return (
  24517. M.warn('Showcase -> rotate: Invalid rotation angle.'),
  24518. void (
  24519. t &&
  24520. t({
  24521. success: !1,
  24522. error: 'Invalid rotation angle.'
  24523. })
  24524. )
  24525. )
  24526. if (this.player.mode === I.TRANSITIONING)
  24527. return (
  24528. M.warn('Automation -> rotate: Cannot rotate while transitioning'),
  24529. void (
  24530. t &&
  24531. t({
  24532. success: !1,
  24533. error: 'Cannot rotate while transitioning'
  24534. })
  24535. )
  24536. )
  24537. Math.abs(i) < 0.01 && (i = 0), Math.abs(n) < 0.01 && (n = 0)
  24538. var r = n
  24539. n = O.call(this, n)
  24540. var o = 0 < r ? 'UP' : 'DOWN'
  24541. if (!(i = -i) && r && !n)
  24542. return (
  24543. M.warn('Showcase -> rotate: Already at maximum rotation in direction: ' + o),
  24544. void (
  24545. t &&
  24546. t({
  24547. success: !1,
  24548. error: 'Already at maximum rotation in direction: ' + o
  24549. })
  24550. )
  24551. )
  24552. n < r && M.warn('Showcase -> rotate: Reached maximum rotation in direction: ' + o)
  24553. var a = n
  24554. ;(n = h.Math.degToRad(n)),
  24555. (i = h.Math.degToRad(i)),
  24556. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24557. this.player.getDirection(F),
  24558. B.copy(F).applyAxisAngle(C.UP, i),
  24559. B.applyAxisAngle(C.RIGHT, n)
  24560. var s = (F.angleTo(B), 0 < i ? -1 : i < 0 ? 1 : 0),
  24561. l = 0 < n ? 1 : n < 0 ? -1 : 0
  24562. Math.abs(i) > Math.abs(n) ? (l *= Math.abs(n / i)) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n))
  24563. var c = this.controls.activeControl
  24564. c.startRotating(s, l),
  24565. R.start(i, n, this.player, function () {
  24566. c.stopRotating(!0),
  24567. t &&
  24568. t({
  24569. success: !0,
  24570. message: 'Rotated ' + e.xAngle.toFixed(2) + '° horizontally, ' + a.toFixed(2) + '° vertically'
  24571. })
  24572. })
  24573. }
  24574. }),
  24575. panCamera: function (e, i) {
  24576. function t(e) {
  24577. switch ((r.removeAllListeners(w.AutoPanComplete), r.removeAllListeners(w.AutoPanInterrupt), r.removeAllListeners(w.AutoPanClamped), e)) {
  24578. case w.AutoPanInterrupt:
  24579. i({
  24580. success: !0,
  24581. message: 'Camera panning interrupted.'
  24582. })
  24583. break
  24584. case w.AutoPanClamped:
  24585. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24586. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < 0.01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < 0.01)
  24587. return void i({
  24588. success: !1,
  24589. error: 'Already at edge of current model bounds.'
  24590. })
  24591. var t = 'The view point is outside the bounds for the current model. '
  24592. ;(t += 'The view point was clamped to ' + o(r.target.x, r.target.z)), console.warn(t)
  24593. }
  24594. case w.AutoPanComplete:
  24595. i({
  24596. success: !0,
  24597. message: 'Panned camera to position ' + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24598. })
  24599. }
  24600. }
  24601. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  24602. return i({
  24603. success: !1,
  24604. error: 'Camera panning is not available in the current mode: ' + this.player.mode
  24605. })
  24606. var n = e.position,
  24607. r = this.player.control
  24608. r.setAutoPanPosition(n.x, n.z), (r.autoPan = !0)
  24609. var o = function (e, t) {
  24610. return '(' + e.toFixed(2) + ', ' + t.toFixed(2) + ')'
  24611. }
  24612. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)), r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)), r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  24613. },
  24614. click: function (e, t) {
  24615. var i = e.x,
  24616. n = e.y
  24617. !0 === e.percentage && ((i = (i / 100) * $('#player').width()), (n = (n / 100) * $('#player').height())),
  24618. this.player.handleInputStart(i, n),
  24619. this.player.updateIntersect(),
  24620. this.player.handleInputEnd(i, n)
  24621. },
  24622. mouseOver: function (e, t) {
  24623. var i = e.x,
  24624. n = e.y
  24625. !0 === e.percentage && ((i = (i / 100) * $('#player').width()), (n = (n / 100) * $('#player').height())), this.player.handleInputMove(i, n), this.player.updateIntersect()
  24626. },
  24627. moveToMode: function (e, t) {
  24628. function i(e) {
  24629. t(
  24630. e
  24631. ? {
  24632. success: !1,
  24633. error: 'Failed to load new mode: ' + e
  24634. }
  24635. : {
  24636. success: !0,
  24637. message: 'Moved to new mode: ' + n
  24638. }
  24639. )
  24640. }
  24641. var n = e.mode
  24642. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN
  24643. ? this.director.changeMode(n).then(
  24644. function () {
  24645. i()
  24646. },
  24647. function (e) {
  24648. i(e)
  24649. }
  24650. )
  24651. : t({
  24652. success: !1,
  24653. error: 'Invalid mode selection'
  24654. })
  24655. }
  24656. }
  24657. }).call(this, '/js/sdk/automation.js')
  24658. },
  24659. {
  24660. '../constants': 8,
  24661. '../enum/AlignmentType': 17,
  24662. '../enum/ControlEvents': 21,
  24663. '../enum/Direction': 22,
  24664. '../enum/GLCubeFaces': 25,
  24665. '../enum/Keys': 30,
  24666. '../enum/ModelManagerEvents': 33,
  24667. '../enum/PlayerEvents': 40,
  24668. '../enum/RenderLayers': 41,
  24669. '../enum/Vectors': 50,
  24670. '../enum/Viewmode': 51,
  24671. '../enum/WarpStyle': 52,
  24672. '../lib/jpeg_encoder': 94,
  24673. '../sdk/SdkEvents': 161,
  24674. '../settings': 166,
  24675. '../util/common': 185,
  24676. '../util/logger': 189,
  24677. '../util/math': 190,
  24678. '../util/panorama': 191,
  24679. './ApiHost': 159,
  24680. './PostMessageType': 160,
  24681. './TransitionStyles': 162,
  24682. three: 217
  24683. }
  24684. ],
  24685. 165: [
  24686. function (e, t, i) {
  24687. 'use strict'
  24688. function n(e) {
  24689. ;(this.sourceWindow = e), (this.targetWindow = null), (this.targetOrigin = null), (this.id = Math.floor(1e5 * Math.random())), this.bindEvents()
  24690. }
  24691. var r = e('./PostMessageType'),
  24692. o = e('events').EventEmitter
  24693. ;((n.prototype = Object.create(o.prototype)).bindEvents = function () {
  24694. this.sourceWindow.addEventListener('message', this.onPostmessageReceived.bind(this))
  24695. }),
  24696. (n.prototype.setTarget = function (e, t) {
  24697. ;(this.targetWindow = e), (this.targetOrigin = t)
  24698. }),
  24699. (n.prototype.onPostmessageReceived = function (e) {
  24700. var t = e.origin || e.originalEvent.origin,
  24701. i = e.source
  24702. switch (e.data.type) {
  24703. case r.CONNECT:
  24704. break
  24705. case r.RESPONSE:
  24706. if (this.id !== e.data.toId) return
  24707. default:
  24708. if (!this.validateMessageOrigin(t)) return
  24709. }
  24710. var n = e.data
  24711. ;(n.source = i), (n.origin = t), (n.timestamp = Date.now()), this.emit(e.data.type, n)
  24712. }),
  24713. (n.prototype.validateMessageOrigin = function (e) {
  24714. return '*' === this.targetOrigin || e === this.targetOrigin
  24715. }),
  24716. (n.prototype.send = function (e) {
  24717. this.targetWindow && this.targetOrigin && ((e.fromId = this.id), this.targetWindow.postMessage(e, this.targetOrigin))
  24718. }),
  24719. (t.exports = n)
  24720. },
  24721. {
  24722. './PostMessageType': 160,
  24723. events: 202
  24724. }
  24725. ],
  24726. 166: [
  24727. function (e, t, i) {
  24728. 'use strict'
  24729. var n = e('three'),
  24730. r = e('./util/browser'),
  24731. o = e('./enum/Viewmode'),
  24732. a = e('./enum/VROption'),
  24733. s = e('./enum/Colors'),
  24734. l = e('./enum/WarpStyle'),
  24735. c = e('./util/easing'),
  24736. h = e('./util/common'),
  24737. u = e('./util/showcase'),
  24738. d = e('./constants'),
  24739. p = {
  24740. debug: !1,
  24741. version: '2.25.6-0-gd87e5b1',
  24742. languageTag: r.valueFromHash('lang', null),
  24743. pageTitle: '四维虚拟漫游',
  24744. authorizationHeader: u.getAuthorizationHeader(),
  24745. autoplay: r.valueFromHash('play', !1) || !r.inIframe(),
  24746. logLevel: r.valueFromHash('log', 2),
  24747. skyboxRadius: 2500,
  24748. modelBoundsPadding: 5,
  24749. showNeighbors: !1,
  24750. brand: r.valueFromHash('brand', !0),
  24751. showHighlights: r.valueFromHash('hhl', !0) && r.valueFromHash('hr', 1),
  24752. startHighlights: r.valueFromHash('hl', -1),
  24753. specialEdition: r.valueFromHash('bn', 0),
  24754. useWheel: r.valueFromHash('wh', !0),
  24755. crossOrigin: 'anonymous',
  24756. fancierTransition: !1,
  24757. wireframe: !1,
  24758. skyboxWireframe: !1,
  24759. modelAlpha: 1,
  24760. highlightPanoSelection: !1,
  24761. showSweeps: !0,
  24762. showSkyboxes: !1,
  24763. showMesh: !0,
  24764. showFloors: !1,
  24765. showFloorDuration: 300,
  24766. showFloorDelay: 300,
  24767. hideFloorDuration: 300,
  24768. hideFloorDelay: 0,
  24769. reticuleOpacityTransitionTime: 250,
  24770. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue,
  24771. markerOpacityTransitionTime: 500,
  24772. guiAnimationSpeed: 250,
  24773. highlightAnimationDuration: 500,
  24774. modelComponentLoadSpinnerDelay: 150,
  24775. captureErrors: !1,
  24776. maxMobileTextures: 6,
  24777. minimalMemoryMode: r.valueFromHash('m3', r.isMobile()),
  24778. startupFlyinDelay: 3e3,
  24779. dollhouseDefault: {
  24780. minDistance: 1, //15, //编辑页面给近一些
  24781. maxDistance: 50,
  24782. minPolarAngle: n.Math.degToRad(10),
  24783. maxPolarAngle: n.Math.degToRad(90)
  24784. },
  24785. hideReticuleTimeout: 1e3,
  24786. analytics: {
  24787. inactivityThreshold: 30,
  24788. sessionTrackingRate: 0.15,
  24789. maxTrackedErrors: 20,
  24790. sessionDurationPingFrequency: 10,
  24791. sessionDurationTimeout: 15
  24792. },
  24793. flydown: {
  24794. movementEasing: 'easeInOutQuad',
  24795. movementDelay: 0.001,
  24796. rotationEasing: 'easeInOutQuad',
  24797. rotationDelay: 0.5,
  24798. modelTextureDelay: 0.75,
  24799. skyboxDelay: 0.75
  24800. },
  24801. transition: {
  24802. flySpeed: 0.001,
  24803. flyTime: 750,
  24804. flytimeMaxDistanceThreshold: 5,
  24805. flytimeDistanceMultiplier: 150,
  24806. aimTime: 1500,
  24807. aimSlowFactor: 1.5,
  24808. blur: 0.8,
  24809. movementEasing: 'easeInOutQuad',
  24810. blendEasing: 'easeInOutQuad',
  24811. fastForwardFactor: 4
  24812. },
  24813. show360Views: {
  24814. enabled: !0,
  24815. transitionTime: 1e3
  24816. },
  24817. quickstart: {
  24818. enabled: 1 === r.valueFromHash('qust', 0) || 1 === r.valueFromHash('qs', 0),
  24819. animation: 1400,
  24820. showTextDelay: 500,
  24821. fadeOutDelay: 3e3,
  24822. fovChange: 10
  24823. },
  24824. appConfig: {
  24825. webvr_version: null,
  24826. segment_key: null,
  24827. embedly_key: null,
  24828. branch_key: null,
  24829. keen_write_key: null,
  24830. keen_project_id: null
  24831. },
  24832. vr: {
  24833. enabled: !0,
  24834. allowWebVR: !1,
  24835. option: r.valueFromHash('vr', a.CONTEXTUAL)
  24836. },
  24837. share: {
  24838. enabled: !r.valueFromHash('mls', 0) && r.valueFromHash('brand', !0)
  24839. },
  24840. input: {
  24841. longTapThreshold: 200,
  24842. moveToleranceNDC: 0.01, //.08,
  24843. touchMoveThreshold: 25
  24844. },
  24845. help: {
  24846. modalStayDuration: 600
  24847. },
  24848. immersive: {
  24849. timeToShowAgain: 1250,
  24850. uiStayDuration: 600
  24851. },
  24852. tourInteraction: {
  24853. disabled: '0' === r.valueFromHash('tourcta', null),
  24854. showPauseButton: 1e3,
  24855. showModal: 1500,
  24856. allowNextClick: 200,
  24857. largeModal: '1' === r.valueFromHash('tourcta', null),
  24858. smallModal: '2' === r.valueFromHash('tourcta', null)
  24859. },
  24860. labels: {
  24861. enabled: !1,
  24862. hideUntilStart: !0,
  24863. fadeInDuration: 250,
  24864. fadeInDelay: 250,
  24865. fadeOutDuration: 250,
  24866. fadeOutDelay: 0,
  24867. zoomHideThreshhold: {
  24868. mobile: r.isSmallScreen() ? 0.45 : 0.6,
  24869. desktop: 2
  24870. },
  24871. zoomTruncateThreshhold: {
  24872. mobile: r.isSmallScreen() ? 0.35 : 0.45,
  24873. desktop: 0.85
  24874. },
  24875. minLengthForTruncate: 16,
  24876. truncateLength: 12,
  24877. truncateSuffix: '...'
  24878. },
  24879. tags: {
  24880. enabled: r.valueFromHash('mt', 1),
  24881. startup: {
  24882. hideUntilStart: !0,
  24883. fadeInDuration: 500,
  24884. fadeInDelay: 100
  24885. },
  24886. visibility: {
  24887. anyDistance: !0,
  24888. visibleDistance: 8,
  24889. cameraClearance: 0.1,
  24890. alphaTestLevel: 0.05,
  24891. hideViaFloor: !0,
  24892. hideOffScreenDisc: !1,
  24893. hideOffScreenObject: !1
  24894. },
  24895. disc: {
  24896. opacity: 1,
  24897. disabledOpacity: 0.5,
  24898. scale: {
  24899. nearBound: 1.5,
  24900. farBound: 4.8,
  24901. linkFarBound: !1,
  24902. linkPercent: 40,
  24903. maxSize: 80,
  24904. minSize: 40,
  24905. baseViewportSize: 800,
  24906. responsiveness: 100
  24907. }
  24908. },
  24909. pole: {
  24910. enabled: !0,
  24911. height: 0.5,
  24912. width: 2,
  24913. opacity: 0.5,
  24914. color: 'white'
  24915. },
  24916. navigate: {
  24917. nearestPano: !0,
  24918. lineOfSight: !0,
  24919. reactivate: !0,
  24920. aimAt: 'disc',
  24921. tiltTolerance: 25,
  24922. rotateSpeedFactor: 0.6
  24923. }
  24924. },
  24925. path: {
  24926. color: window.DATA.floorMarkerColor || s.newBlue,
  24927. colorUp: s._desat(s.newBlue, 0.5),
  24928. colorDown: s._darken(s.newBlue, 0.35),
  24929. opacity: 0.5,
  24930. style: 'ribbon',
  24931. height: 0.025,
  24932. ribbonWidth: 0.24,
  24933. outsideHeight: 0.5,
  24934. waypointRadius: 0.5,
  24935. waypointIndoorRadius: 0.24,
  24936. waypointPulse: 1e3,
  24937. typ: l.BLACK,
  24938. meshFree: r.valueFromHash('mf', 1),
  24939. mapGuides: r.valueFromHash('guides', !0),
  24940. fadeInTime: 400,
  24941. fadeOutTime: 300
  24942. },
  24943. warp: {
  24944. nearPanoDist: 0.1,
  24945. matchCam: !1,
  24946. blur: 0.33,
  24947. fastTime: 1500,
  24948. teleportTime: 1500, //瞬间过渡的时间
  24949. flytimeDistanceMultiplier: 150, //add
  24950. flyTime: 750, //add
  24951. outsideTime: 2e3,
  24952. lookAheadMax: 0.3,
  24953. lookAheadDist: 2.5,
  24954. softPushDist: 0.37,
  24955. softPushEnd: 0.3,
  24956. softBendAngle: 8,
  24957. softBendTilt: 4,
  24958. softBendEnd: 0.3,
  24959. doBurns: !0,
  24960. burnsAngle: 8,
  24961. minBurnsAngle: 35,
  24962. minDownAngle: -35,
  24963. maxTurnPerSec: 280,
  24964. maxAimPerSec: 35,
  24965. minRotation: 12,
  24966. maxAimRotation: 33.2,
  24967. turnFriction: 0.2,
  24968. flySpeed: 0.01,
  24969. minWarpTime: 1200,
  24970. warpInterruptionRedirectTime: 500,
  24971. tourStepDelay: r.valueFromHash('st', 0),
  24972. walkDelay: 0,
  24973. walkMaxDist: 50,
  24974. walkMinDist: 0.8,
  24975. walkSlideShowThreshhold: 3e3,
  24976. walkExtraPanosDistance: 0.4,
  24977. timePerMeter: 1200,
  24978. motionLeadTime: 5e3,
  24979. movementEasing: 'easeInOutQuad',
  24980. blendEasing: 'easeInOutQuad',
  24981. showBunny: !1,
  24982. loop: r.valueFromHash('lp', !1),
  24983. auto: r.valueFromHash('ts', -1),
  24984. eOrder: 'YXZ',
  24985. stepFactor: 0.25,
  24986. brakeStrength: 2,
  24987. minBrakeAngle: 0.1,
  24988. maxBrakeAngle: 1.8,
  24989. climbEffort: 4
  24990. },
  24991. rotationFriction: 0.05,
  24992. rotationAccelerationInside: 4.5,
  24993. rotationAccelerationOutside: 0.15,
  24994. rotationAfterMoveMultiplier: 40,
  24995. rotationAfterMoveHistoryCount: 5,
  24996. panFriction: 0.09,
  24997. panAccelerationOutside: 60,
  24998. onload: r.valueFromHash('onload', o.PANORAMA),
  24999. zoomNearLimit: 0.1,
  25000. zoomFarLimit: 50,
  25001. navigation: {
  25002. panoScores: !1,
  25003. mouseDirection: !0,
  25004. filterStrictness: 0.75,
  25005. angleFactor: -30,
  25006. directionFactor: 10,
  25007. distanceFactor: -1,
  25008. optionalityFactor: 3
  25009. },
  25010. sdkInit: !1,
  25011. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  25012. console: r.valueFromHash('console', !1),
  25013. noMeshFloorPositionOffset: new n.Vector3(0, -1.2, 0),
  25014. panoramaNeighbourMaxDistance: 5,
  25015. panoFloorClickRadius: 0.35,
  25016. showScreenshotLocations: !1,
  25017. showAxis: !1,
  25018. showNeighbourRaycasts: !1,
  25019. colorMarkerOnLoad: !1,
  25020. colorMarkerByFloor: !1,
  25021. tiling: {
  25022. panoPreRenderRepeatDelay: 2500,
  25023. panoPreRenderDelay: 500,
  25024. preRenderTourPanos: r.valueFromHash('tileprerender', 0),
  25025. tilingFlagNames: ['usetiles', 'tiles'],
  25026. maxNavPanoQuality: r.valueFromHash('maxtileq', null),
  25027. maxZoomPanoQuality: r.valueFromHash('maxztileq', null),
  25028. overlayStyle: r.valueFromHash('tileoverlay', 0),
  25029. uploadIntervalDelay: r.valueFromHash('tileupdelay', 10),
  25030. initialIntervalDelay: r.valueFromHash('itiledelay', 0),
  25031. maxNonBaseUploadsPerFrame: r.valueFromHash('maxnbtpf', 2),
  25032. maxBaseUploadsPerFrame: r.valueFromHash('maxbtpf', 6),
  25033. customCompression: r.valueFromHash('tilecustcomp', 0),
  25034. mobileHighQualityOverride: 1,
  25035. allowUltraHighResolution: !0
  25036. },
  25037. zoom: {
  25038. enabled: !0,
  25039. forceOff: r.valueFromHash('nozoom', 0),
  25040. overridemax: r.valueFromHash('maxzoom', null),
  25041. overridemin: r.valueFromHash('minzoom', null),
  25042. max: d.highQualityMaxZoom,
  25043. min: 1,
  25044. transitionStyle: r.valueFromHash('zoomtrans', 1),
  25045. activationThreshold: 1.1,
  25046. restoreTime: 500
  25047. },
  25048. profiling: {
  25049. enabled: r.valueFromHash('mem', !1)
  25050. }
  25051. }
  25052. ;(p = h.deepExtend(p, d, {
  25053. insideFOV: r.valueFromHash('fov', d.insideFOV),
  25054. insideFOVMax: r.valueFromHash('fovmax', d.insideFOVMax),
  25055. panorama: {
  25056. transitionTime: 1e3,
  25057. modelAlpha: 0,
  25058. modelAlphaDelay: p.flydown.modelTextureDelay,
  25059. modelAlphaLength: 1,
  25060. skyboxOpacity: 1,
  25061. skyboxOpacityDelay: p.flydown.skyboxDelay,
  25062. skyboxOpacityLength: 0.9,
  25063. fovLength: 1,
  25064. fovDelay: 0,
  25065. cameraMatrixDuration: 0.8,
  25066. cameraMatrixDelay: 0,
  25067. cameraMatrixEase: c.easeInCubic,
  25068. reticuleOpacity: 1,
  25069. markerOpacity: 0.3,
  25070. markerOpacityOnHover: 1
  25071. },
  25072. dollhouse: {
  25073. transitionTime: 1e3,
  25074. modelAlpha: 1,
  25075. modelAlphaDelay: 0,
  25076. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25077. skyboxOpacity: 0,
  25078. skyboxOpacityDelay: 0,
  25079. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25080. fovLength: 1,
  25081. fovDelay: 0,
  25082. cameraMatrixDuration: 0.8,
  25083. cameraMatrixDelay: 0.3,
  25084. cameraMatrixEase: c.easeInCubic,
  25085. reticuleOpacity: 1,
  25086. markerOpacity: 0,
  25087. markerOpacityOnHover: 0
  25088. },
  25089. floorplan: {
  25090. transitionTime: 1e3,
  25091. modelAlpha: 1,
  25092. modelAlphaDelay: 0,
  25093. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25094. skyboxOpacity: 0,
  25095. skyboxOpacityDelay: 0,
  25096. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25097. fovLength: 1,
  25098. fovDelay: 0,
  25099. cameraMatrixDuration: 0.5,
  25100. cameraMatrixDelay: 0,
  25101. cameraMatrixEase: c.easeOutCubic,
  25102. reticuleOpacity: 1,
  25103. markerOpacity: 0,
  25104. markerOpacityOnHover: 0,
  25105. cameraHeight: 50
  25106. },
  25107. transitioning: {
  25108. reticuleOpacity: 0,
  25109. markerOpacity: 0.3,
  25110. markerOpacityOnHover: 1
  25111. },
  25112. 'floorplan-dollhouse': {
  25113. rotationDelay: 0,
  25114. rotationDuration: 1
  25115. },
  25116. 'floorplan-panorama': {
  25117. rotationDelay: 0.5,
  25118. rotationDuration: 1
  25119. },
  25120. 'dollhouse-panorama': {
  25121. rotationDelay: 0.5,
  25122. rotationDuration: 1
  25123. },
  25124. 'dollhouse-floorplan': {
  25125. rotationDelay: 0,
  25126. rotationDuration: 1,
  25127. cameraMatrixDuration: 1.05,
  25128. cameraMatrixDelay: 0.5
  25129. },
  25130. 'panorama-dollhouse': {
  25131. rotationDelay: 0,
  25132. rotationDuration: 0.5
  25133. },
  25134. 'panorama-floorplan': {
  25135. transitionTime: 1500,
  25136. rotationDelay: 0,
  25137. rotationDuration: 0.5
  25138. }
  25139. })).path.meshFree && (p.path.typ = l.WALK),
  25140. (p.zoom.max = p.zoom.overridemax || p.zoom.max),
  25141. (p.zoom.min = p.zoom.overridemin || p.zoom.min),
  25142. (window._settings = t.exports = p)
  25143. },
  25144. {
  25145. './constants': 8,
  25146. './enum/Colors': 19,
  25147. './enum/VROption': 47,
  25148. './enum/Viewmode': 51,
  25149. './enum/WarpStyle': 52,
  25150. './util/browser': 182,
  25151. './util/common': 185,
  25152. './util/easing': 186,
  25153. './util/showcase': 193,
  25154. three: 217
  25155. }
  25156. ],
  25157. 167: [
  25158. function (e, t, i) {
  25159. 'use strict'
  25160. var n = e('three'),
  25161. r = e('./settings'),
  25162. o =
  25163. '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',
  25164. a = 'precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n'
  25165. t.exports = {
  25166. basicTextured: {
  25167. uniforms: {
  25168. tDiffuse: {
  25169. type: 't',
  25170. value: null
  25171. },
  25172. alpha: {
  25173. type: 'f',
  25174. value: 1
  25175. }
  25176. },
  25177. vertexShader: 'varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  25178. fragmentShader:
  25179. '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}'
  25180. },
  25181. copyCubeMap: {
  25182. uniforms: {
  25183. tDiffuse: {
  25184. type: 't',
  25185. value: null
  25186. },
  25187. alpha: {
  25188. type: 'f',
  25189. value: 1
  25190. }
  25191. },
  25192. vertexShader:
  25193. 'varying vec3 vWorldPos;\nvoid main() {\n vWorldPos = vec3(-position.x, -position.y, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  25194. fragmentShader:
  25195. '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}'
  25196. },
  25197. cube: {
  25198. uniforms: {
  25199. map: {
  25200. type: 't',
  25201. value: null
  25202. },
  25203. opacity: {
  25204. type: 'f',
  25205. value: 1
  25206. }
  25207. },
  25208. vertexShader: o + 'varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n',
  25209. fragmentShader:
  25210. a +
  25211. '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'
  25212. },
  25213. model: {
  25214. uniforms: {
  25215. map: {
  25216. type: 't',
  25217. value: null
  25218. },
  25219. modelAlpha: {
  25220. type: 'f',
  25221. value: r.modelAlpha
  25222. },
  25223. opacity: {
  25224. type: 'f',
  25225. value: 1
  25226. },
  25227. progress: {
  25228. type: 'f',
  25229. value: 0
  25230. },
  25231. blackout: {
  25232. type: 'i',
  25233. value: 0
  25234. },
  25235. pano0Map: {
  25236. type: 't',
  25237. value: null
  25238. },
  25239. pano0Position: {
  25240. type: 'v3',
  25241. value: new n.Vector3()
  25242. },
  25243. pano0Matrix: {
  25244. type: 'm4',
  25245. value: new n.Matrix4()
  25246. },
  25247. pano1Map: {
  25248. type: 't',
  25249. value: null
  25250. },
  25251. pano1Position: {
  25252. type: 'v3',
  25253. value: new n.Vector3()
  25254. },
  25255. pano1Matrix: {
  25256. type: 'm4',
  25257. value: new n.Matrix4()
  25258. }
  25259. },
  25260. /* vertexShader: o + "uniform vec3 pano0Position;\nuniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\nuniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\n\nvoid main() {\n\n vUv = uv;\n vec4 worldPosition = modelMatrix * vec4(position, 1.0);\n\n vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;\n vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;\n vWorldPosition0.x *= -1.0;\n\n vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;\n vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;\n vWorldPosition1.x *= -1.0;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25261. fragmentShader: a + "uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\nuniform float progress;\nuniform int blackout;\n\nuniform vec3 pano0Position;\nuniform samplerCube pano0Map;\n\nuniform vec3 pano1Position;\nuniform samplerCube pano1Map;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\n\nvoid main() {\n\tconst vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);\n\tconst vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);\n\n\tvec4 colorFromPanos;\n\tvec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);\n\tvec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);\n\n\tif (blackout == 0) {\n\t\tcolorFromPanos = mix(colorFromPano0, colorFromPano1, progress);\n\t} else if (blackout == 1) {\n\t\tcolorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));\n\t\tcolorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));\n\t} else if (blackout == 2) {\n\t\tcolorFromPanos = mix(colorFromPano0, BLACK, progress);\n\t} else if (blackout == 3) {\n\t\tcolorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));\n\t} \n\n\tvec4 colorFromTexture = texture2D( map, vUv );\n\tcolorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);\n\n\tfloat whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);\n\tcolorFromPanos = mix(colorFromPanos, GREY, whiteness);\n\tgl_FragColor = vec4(colorFromPanos.rgb, opacity);\n}\n"
  25262. */
  25263. vertexShader:
  25264. o +
  25265. `uniform vec3 pano0Position;
  25266. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  25267. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  25268. varying vec3 vWorldPosition0;
  25269. varying vec3 vWorldPosition1;
  25270. uniform int blackout;
  25271. void main() {
  25272. vUv = uv;
  25273. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  25274. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  25275. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  25276. vWorldPosition0.x *= -1.0;
  25277. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  25278. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  25279. vWorldPosition1.x *= -1.0;
  25280. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  25281. }`,
  25282. fragmentShader:
  25283. a +
  25284. `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  25285. 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
  25286. void main() {
  25287. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  25288. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  25289. vec4 colorFromPanos;
  25290. if (blackout == 5){//add for TransitionPass
  25291. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  25292. }else{
  25293. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  25294. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  25295. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  25296. else if (blackout == 1) {
  25297. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  25298. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  25299. }
  25300. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  25301. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  25302. }
  25303. vec4 colorFromTexture = texture2D( map, vUv );
  25304. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  25305. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  25306. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  25307. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  25308. }`
  25309. },
  25310. hot: {
  25311. uniforms: {
  25312. color: {
  25313. type: 'c',
  25314. value: new n.Color(16720384)
  25315. },
  25316. opac: {
  25317. type: 'f',
  25318. value: 0
  25319. },
  25320. texture1: {
  25321. type: 't',
  25322. value: null
  25323. },
  25324. texture2: {
  25325. type: 't',
  25326. value: null
  25327. }
  25328. },
  25329. vertexShader: 'varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n',
  25330. fragmentShader:
  25331. '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'
  25332. },
  25333. modelOutside: {
  25334. uniforms: {
  25335. map: {
  25336. type: 't',
  25337. value: null
  25338. },
  25339. opacity: {
  25340. type: 'f',
  25341. value: 1
  25342. }
  25343. },
  25344. vertexShader: o + 'varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n',
  25345. fragmentShader:
  25346. a +
  25347. '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'
  25348. },
  25349. ribbon: {
  25350. uniforms: {
  25351. map: {
  25352. type: 't',
  25353. value: null
  25354. },
  25355. opacity: {
  25356. type: 'f',
  25357. value: 1
  25358. },
  25359. color: {
  25360. type: 'c',
  25361. value: new n.Color(r.path.color)
  25362. }
  25363. },
  25364. vertexShader:
  25365. o +
  25366. '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',
  25367. fragmentShader:
  25368. a +
  25369. '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'
  25370. },
  25371. waypoint: {
  25372. uniforms: {
  25373. map: {
  25374. type: 't',
  25375. value: null
  25376. },
  25377. opacity: {
  25378. type: 'f',
  25379. value: 1
  25380. },
  25381. pulse: {
  25382. type: 'f',
  25383. value: 1
  25384. },
  25385. nearFade: {
  25386. type: 'v2',
  25387. value: new n.Vector2(2 * r.insideNear, 2 * r.path.waypointIndoorRadius)
  25388. },
  25389. color: {
  25390. type: 'c',
  25391. value: new n.Color(r.reticuleColor)
  25392. }
  25393. },
  25394. vertexShader:
  25395. o +
  25396. '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',
  25397. fragmentShader:
  25398. a +
  25399. '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'
  25400. },
  25401. modelDebug: {
  25402. uniforms: {
  25403. map: {
  25404. type: 't',
  25405. value: null
  25406. },
  25407. modelAlpha: {
  25408. type: 'f',
  25409. value: r.modelAlpha
  25410. },
  25411. depthmapRatio: {
  25412. type: 'f',
  25413. value: 0
  25414. },
  25415. opacity: {
  25416. type: 'f',
  25417. value: 1
  25418. },
  25419. progress: {
  25420. type: 'f',
  25421. value: 0
  25422. },
  25423. considerOcclusion: {
  25424. type: 'i',
  25425. value: r.fancierTransition
  25426. },
  25427. highlightPanoSelection: {
  25428. type: 'i',
  25429. value: 0
  25430. },
  25431. useThirdPano: {
  25432. type: 'i',
  25433. value: r.useThirdPano
  25434. },
  25435. pano0Map: {
  25436. type: 't',
  25437. value: null
  25438. },
  25439. pano0Depth: {
  25440. type: 't',
  25441. value: null
  25442. },
  25443. pano0Position: {
  25444. type: 'v3',
  25445. value: new n.Vector3()
  25446. },
  25447. pano0Matrix: {
  25448. type: 'm4',
  25449. value: new n.Matrix4()
  25450. },
  25451. pano0Weight: {
  25452. type: 'f',
  25453. value: r.transition.pano0Weight
  25454. },
  25455. pano1Map: {
  25456. type: 't',
  25457. value: null
  25458. },
  25459. pano1Depth: {
  25460. type: 't',
  25461. value: null
  25462. },
  25463. pano1Position: {
  25464. type: 'v3',
  25465. value: new n.Vector3()
  25466. },
  25467. pano1Matrix: {
  25468. type: 'm4',
  25469. value: new n.Matrix4()
  25470. },
  25471. pano1Weight: {
  25472. type: 'f',
  25473. value: r.transition.pano1Weight
  25474. },
  25475. pano2Map: {
  25476. type: 't',
  25477. value: null
  25478. },
  25479. pano2Depth: {
  25480. type: 't',
  25481. value: null
  25482. },
  25483. pano2Position: {
  25484. type: 'v3',
  25485. value: new n.Vector3()
  25486. },
  25487. pano2Matrix: {
  25488. type: 'm4',
  25489. value: new n.Matrix4()
  25490. },
  25491. pano2Weight: {
  25492. type: 'f',
  25493. value: r.transition.pano2Weight
  25494. }
  25495. },
  25496. vertexShader:
  25497. o +
  25498. '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',
  25499. fragmentShader:
  25500. a +
  25501. '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'
  25502. },
  25503. customDepth: {
  25504. uniforms: {
  25505. panoPosition: {
  25506. type: 'v3',
  25507. value: new n.Vector3()
  25508. }
  25509. },
  25510. vertexShader:
  25511. o +
  25512. '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',
  25513. fragmentShader:
  25514. a +
  25515. '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'
  25516. },
  25517. skysphere: {
  25518. uniforms: {
  25519. radius: {
  25520. type: 'f',
  25521. value: 0
  25522. }
  25523. },
  25524. vertexShader:
  25525. o +
  25526. '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',
  25527. fragmentShader:
  25528. a +
  25529. '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'
  25530. },
  25531. tagDisc: {
  25532. uniforms: {
  25533. opacity: {
  25534. type: 'f',
  25535. value: 0
  25536. },
  25537. color: {
  25538. type: 'c',
  25539. value: new n.Color()
  25540. },
  25541. bg: {
  25542. type: 't',
  25543. value: null
  25544. },
  25545. mask: {
  25546. type: 't',
  25547. value: null
  25548. }
  25549. },
  25550. vertexShader: o + 'varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  25551. fragmentShader:
  25552. a +
  25553. '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'
  25554. }
  25555. }
  25556. window.shaders = t.exports
  25557. },
  25558. {
  25559. './settings': 166,
  25560. three: 217
  25561. }
  25562. ],
  25563. 168: [
  25564. function (E, _, e) {
  25565. ;(function (e) {
  25566. 'use strict'
  25567. var t = E('three'),
  25568. i = (E('url'), E('./util/ajax')),
  25569. n = E('./settings'),
  25570. r = E('./util/logger'),
  25571. o = E('./util/math'),
  25572. a = E('./util/showcase'),
  25573. s = E('./objects/Panorama'),
  25574. l = new r(e),
  25575. c = E('./model/Model'),
  25576. h = E('./shaders'),
  25577. u = E('./util/transitions'),
  25578. d = E('./objects/Chunk'),
  25579. p = E('./objects/Reticule'),
  25580. f = E('./objects/Skybox'),
  25581. g = E('./objects/Floor'),
  25582. m = E('./cameras/DollhouseCamera'),
  25583. v = E('./cameras/FloorplanCamera'),
  25584. y = E('./cameras/PanoramaCamera'),
  25585. A = E('./controls/DollhouseControls'),
  25586. C = E('./controls/FloorplanControls'),
  25587. I = E('./controls/PanoramaControls')
  25588. ;(t.ImageUtils.crossOrigin = n.crossOrigin),
  25589. (_.exports = {
  25590. shaders: h,
  25591. transitions: u,
  25592. Model: c,
  25593. Chunk: d,
  25594. Floor: g,
  25595. Skybox: f,
  25596. Reticule: p,
  25597. Panorama: s,
  25598. DollhouseCamera: m,
  25599. FloorplanCamera: v,
  25600. PanoramaCamera: y,
  25601. DollhouseControls: A,
  25602. FloorplanControls: C,
  25603. PanoramaControls: I,
  25604. getModel: function (e) {
  25605. if (!e.url) throw 'getModel(): missing parameter "url"'
  25606. e.autoload = void 0 === e.autoload || e.autoload
  25607. var t = a.parseSidUrl(e.url)
  25608. ;(e.urlBase = t.urlBase), (e.urlModel = /* 'data1/1081/', */ t.urlModel), (e.urlFiles = t.urlFiles)
  25609. var i = this._getPlatformError()
  25610. return i ? $.Deferred().reject(i).promise() : ((this.options = e), this._loadModel().then(this._buildModel.bind(this)))
  25611. },
  25612. _getPlatformError: function () {
  25613. return 'IE' === $.ua.browser.name && parseInt($.ua.browser.major) < 11
  25614. ? 'webgl-unsupported'
  25615. : 'iOS' === $.ua.os.name && /^[0-7][$\.]/.test($.ua.os.version)
  25616. ? 'webgl-ios'
  25617. : Modernizr.webgl
  25618. ? null
  25619. : 'webgl-unsupported'
  25620. },
  25621. _loadModel: function () {
  25622. return i
  25623. .get(this.options.urlModel, {
  25624. responseType: 'json',
  25625. prefetchFrom: 'model',
  25626. auth: a.getAuthorizationHeader()
  25627. })
  25628. .then(null, function () {
  25629. return l.warn('Model loading failed at initial metadata load'), 'loading-failed'
  25630. })
  25631. },
  25632. _buildModel: function (e) {
  25633. e = a.normalizeModeldata(e, o)
  25634. var t = new c(this.options, e)
  25635. return this.options.autoload ? t.load(!0) : $.when(t)
  25636. }
  25637. })
  25638. }).call(this, '/js/showcase.js')
  25639. },
  25640. {
  25641. './cameras/DollhouseCamera': 5,
  25642. './cameras/FloorplanCamera': 6,
  25643. './cameras/PanoramaCamera': 7,
  25644. './controls/DollhouseControls': 10,
  25645. './controls/FloorplanControls': 11,
  25646. './controls/PanoramaControls': 13,
  25647. './model/Model': 139,
  25648. './objects/Chunk': 144,
  25649. './objects/Floor': 146,
  25650. './objects/Panorama': 148,
  25651. './objects/Reticule': 149,
  25652. './objects/Skybox': 152,
  25653. './settings': 166,
  25654. './shaders': 167,
  25655. './util/ajax': 181,
  25656. './util/logger': 189,
  25657. './util/math': 190,
  25658. './util/showcase': 193,
  25659. './util/transitions': 195,
  25660. three: 217,
  25661. url: 208
  25662. }
  25663. ],
  25664. 169: [
  25665. function (e, t, i) {
  25666. 'use strict'
  25667. function l(e) {
  25668. var t = {
  25669. renderTarget: null,
  25670. inUse: !1,
  25671. size: -1,
  25672. pano: null
  25673. }
  25674. return (
  25675. (t.inUse = !0),
  25676. (t.size = e),
  25677. (function (e) {
  25678. O.push(e)
  25679. })(t),
  25680. t
  25681. )
  25682. }
  25683. function c(e) {
  25684. for (var t = 0; t < O.length; t++) {
  25685. var i = O[t]
  25686. if (i.renderTarget === e) return !(i.inUse = !1)
  25687. }
  25688. return !1
  25689. }
  25690. function n() {
  25691. ;(this.tileDirectory = {}),
  25692. (this.activeRenderTargetDescriptors = {}),
  25693. (this.activePanos = []),
  25694. (this.panoLODDescriptors = {}),
  25695. (this.panoDescriptors = {}),
  25696. (this.tileTrees = {}),
  25697. (this.sceneRenderer = null),
  25698. (this.tileDownloader = null),
  25699. (this.forceQueue = []),
  25700. (this.uploadQueues = {}),
  25701. (this.uploadInterval = null),
  25702. (this.uploadIntervalCancelled = !1),
  25703. (this.usingTileOverlay = !1),
  25704. (this.overlayTilesLoaded = !1),
  25705. (this.overlayTileBase = null),
  25706. (this.overlayTilesBasic = {}),
  25707. (this.overlayTilesEnhanced = {}),
  25708. (this.zoomRenderTarget = null),
  25709. (this.zoomPano = null),
  25710. (this.zoomingActive = !1),
  25711. (this.zoomPanoId = null),
  25712. (this.zoomPanoRenderingDisabled = !1),
  25713. (this.direction = new _.Vector3()),
  25714. (this.initTime = -1),
  25715. (this.maxBaseUploadsPerFrame = R),
  25716. (this.maxNonBaseUploadsPerFrame = M)
  25717. }
  25718. var I,
  25719. E,
  25720. r,
  25721. o,
  25722. a,
  25723. h,
  25724. s,
  25725. _ = e('three'),
  25726. u = e('../exception/BasicException'),
  25727. d = e('../settings'),
  25728. p = e('../enum/PanoSizeClass'),
  25729. b = (e('../objects/Panorama'), e('../enum/PanoRendererEvents')),
  25730. f = e('../enum/SceneRendererEvents'),
  25731. g = e('../enum/TileDownloaderEvents'),
  25732. m = e('../enum/Vectors'),
  25733. v = (e('../enum/GLCubeFaces'), e('../objects/Panorama'), e('./TileTree')),
  25734. y = (e('./TileDownloader'), e('./TilePrioritizer')),
  25735. A = e('./TileUtils'),
  25736. C = ((p = e('../enum/PanoSizeClass')), e('../util/browser'), e('../util/panorama')),
  25737. w = e('events').EventEmitter,
  25738. T = !1,
  25739. x = d.tiling.uploadIntervalDelay,
  25740. S = d.tiling.initialIntervalDelay,
  25741. M = d.tiling.maxNonBaseUploadsPerFrame,
  25742. R = d.tiling.maxBaseUploadsPerFrame,
  25743. P = {
  25744. Base: 0,
  25745. Remaining: 1
  25746. },
  25747. O = []
  25748. function L(e) {
  25749. var t = e.shift()
  25750. return (t.uploadQueued = !1), t
  25751. }
  25752. ;((n.prototype = Object.create(w.prototype)).init = function (e, t, i) {
  25753. ;(this.sceneRenderer = e),
  25754. (this.tileDownloader = t),
  25755. (this.qualityManager = i),
  25756. this.bindEvents(),
  25757. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  25758. (this.initTime = performance.now())
  25759. }),
  25760. (n.prototype.getActivePanoTextures = function (e) {
  25761. e = e || []
  25762. for (var t = 0; t < O.length; t++) {
  25763. var i = O[t]
  25764. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25765. }
  25766. }),
  25767. (n.prototype.hasQueuedTiles = function () {
  25768. var e = this.peekNextFromUploadQueue()
  25769. return null != e
  25770. }),
  25771. (n.prototype.getActiveRenderTargetDescriptor = function (e) {
  25772. return this.activeRenderTargetDescriptors[e]
  25773. }),
  25774. (n.prototype.setActiveRenderTargetDescriptor = function (e, t) {
  25775. this.activeRenderTargetDescriptors[e] = t
  25776. }),
  25777. (n.prototype.loadOverlayTiles = function () {
  25778. if (0 !== d.tiling.overlayStyle) {
  25779. var n = 0,
  25780. e = function (e, t, i) {
  25781. ;(e = t
  25782. ? (e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping))
  25783. : (this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping))),
  25784. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25785. ++n === r.length && (this.overlayTilesLoaded = !0)
  25786. }.bind(this),
  25787. r = [
  25788. ['images/outlineBase.png', e.bind(this, this.overlayTileBase, null)],
  25789. ['images/outlineBasic512.png', e.bind(this, this.overlayTilesBasic, 256)],
  25790. ['images/outlineBasic512.png', e.bind(this, this.overlayTilesBasic, 512)],
  25791. ['images/outlineBasic1024.png', e.bind(this, this.overlayTilesBasic, 1024)],
  25792. ['images/outlineBasic2048.png', e.bind(this, this.overlayTilesBasic, 2048)],
  25793. ['images/outlineBasic4096.png', e.bind(this, this.overlayTilesBasic, 4096)],
  25794. ['images/outlineEnhanced512.png', e.bind(this, this.overlayTilesEnhanced, 256)],
  25795. ['images/outlineEnhanced512.png', e.bind(this, this.overlayTilesEnhanced, 512)],
  25796. ['images/outlineEnhanced1024.png', e.bind(this, this.overlayTilesEnhanced, 1024)],
  25797. ['images/outlineEnhanced2048.png', e.bind(this, this.overlayTilesEnhanced, 2048)],
  25798. ['images/outlineEnhanced4096.png', e.bind(this, this.overlayTilesEnhanced, 4096)]
  25799. ]
  25800. r.forEach(
  25801. function (e) {
  25802. this.tileDownloader.loadImage(e[0], 0, e[1])
  25803. }.bind(this)
  25804. ),
  25805. (this.usingTileOverlay = !0)
  25806. } else this.usingTileOverlay = !1
  25807. }),
  25808. (n.prototype.bindEvents = function () {
  25809. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25810. }),
  25811. (n.prototype.setupZoomRenderTarget = function () {
  25812. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25813. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize()) return
  25814. var e = this.zoomRenderTarget
  25815. if (((this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1)), e)) {
  25816. var t = e.width,
  25817. i = this.zoomRenderTarget.width
  25818. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25819. e.texture.dispose(),
  25820. (e.texture.loaded = !1),
  25821. (e.texture.version = 0),
  25822. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25823. (e.texture = null)
  25824. }
  25825. this.zoomPanoRenderingDisabled = !1
  25826. } else this.zoomPanoRenderingDisabled = !0
  25827. }),
  25828. (n.prototype.enableUltraHighQualityMode = function (t) {
  25829. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25830. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH)
  25831. this.tileDownloader.testDownload(
  25832. e,
  25833. A.TILE_SIZE,
  25834. function (e) {
  25835. e && (this.qualityManager.enableUltraHighQualityMode(), this.setupZoomRenderTarget(), t())
  25836. }.bind(this)
  25837. )
  25838. }
  25839. }),
  25840. (n.prototype.activateTiledPano = function (e, t, i) {
  25841. i && this.clearAllQueuedUploads()
  25842. for (var n = 0; n < A.FACES_PER_PANO; n++) this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize())
  25843. this.linkAllTilesAndNodes(e)
  25844. var r = this.getActiveRenderTargetDescriptor(e.id),
  25845. o = t
  25846. if ((o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()), !r || o !== r.size)) {
  25847. if (
  25848. (r && c(r.renderTarget),
  25849. !(r = (function (e) {
  25850. for (var t = 0; t < O.length; t++) {
  25851. var i = O[t]
  25852. if (!i.inUse && i.size === e) return (i.inUse = !0), i
  25853. }
  25854. return null
  25855. })(o)))
  25856. ) {
  25857. var a = this.initTiledPano(o, !1)
  25858. ;(r = l(a.width)).renderTarget = a
  25859. }
  25860. ;(r.pano = e), this.resetPanoDescriptor(e.id), this.resetPanoLODDescriptors(e.id), this.resetRenderStatus(e.id, !0, !0)
  25861. }
  25862. this.setActiveRenderTargetDescriptor(e.id, r)
  25863. var s = i ? 0 : 1
  25864. return this.updateActivePanos(e, s), r.renderTarget
  25865. }),
  25866. (n.prototype.deactivateTiledPano = function (e) {
  25867. var t = this.getActiveRenderTargetDescriptor(e.id)
  25868. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget), this.setActiveRenderTargetDescriptor(e.id, null)
  25869. var i = this.getUploadQueueForPano(e.id)
  25870. this.clearUploadQueue(i), this.updateActivePanos()
  25871. }),
  25872. (n.prototype.updateActivePanos =
  25873. ((s = []),
  25874. function (e, t) {
  25875. for (var i = (s.length = 0); i < this.activePanos.length; i++) {
  25876. e && s.length === t && s.push(e)
  25877. var n = this.activePanos[i],
  25878. r = this.getActiveRenderTargetDescriptor(n.id)
  25879. ;(e && n.id === e.id) || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  25880. }
  25881. e && t >= s.length && s.push(e), (this.activePanos.length = 0), this.activePanos.push.apply(this.activePanos, s)
  25882. })),
  25883. (n.prototype.getActivePanoCount = function () {
  25884. return this.activePanos.length
  25885. }),
  25886. (n.prototype.resetRenderStatus = function (e, r, o, t) {
  25887. var i = null
  25888. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1)
  25889. for (
  25890. var n = function (e, t, i, n) {
  25891. o && (t.tile.zoomUploaded = !1), r && (t.tile.uploaded = !1)
  25892. },
  25893. a = 0;
  25894. a < A.FACES_PER_PANO;
  25895. a++
  25896. ) {
  25897. this.getTileTree(e, a).breadthFirst({
  25898. callback: n.bind(this, a),
  25899. minLevel: i
  25900. })
  25901. }
  25902. }),
  25903. (n.prototype.copyBaseRenderStatusToZoomed = function (e) {
  25904. for (
  25905. var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()),
  25906. i = function (e, t, i, n) {
  25907. ;(t.tile.zoomUploaded = t.tile.uploaded), (t.zoomCovered = t.covered)
  25908. },
  25909. n = 0;
  25910. n < A.FACES_PER_PANO;
  25911. n++
  25912. ) {
  25913. this.getTileTree(e, n).breadthFirst({
  25914. callback: i.bind(this, n),
  25915. maxLevel: t
  25916. })
  25917. }
  25918. }),
  25919. (n.prototype.renderPanoTiles =
  25920. ((h = []),
  25921. function (e, t, i, n) {
  25922. ;(this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize()) || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25923. (t = t || this.direction || m.FORWARD)
  25924. var r = this.getActiveRenderTargetDescriptor(e)
  25925. if (!this.isRenderTargetDescriptorValid(r)) throw new u('PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.')
  25926. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  25927. var a = this.getTileTree(e, o)
  25928. ;(h.length = 0),
  25929. a.breadthFirst({
  25930. saveVisited: h
  25931. })
  25932. for (var s = 0; s < h.length; s++) {
  25933. var l = h[s]
  25934. this.queueTileUpload(l.tile, !1, n || (0 === s && i))
  25935. }
  25936. }
  25937. this.updateDirection(t)
  25938. })),
  25939. (n.prototype.isRenderTargetDescriptorValid = function (e) {
  25940. return e && e.renderTarget
  25941. }),
  25942. (n.prototype.isPanoActive = function (e) {
  25943. var t = this.getActiveRenderTargetDescriptor(e)
  25944. return this.isRenderTargetDescriptorValid(t)
  25945. }),
  25946. (n.prototype.isPanoZoomed = function (e) {
  25947. return this.zoomingActive && this.zoomPanoId === e
  25948. }),
  25949. (n.prototype.initTileTree = function (e, t, i) {
  25950. var n = this.tileTrees[e]
  25951. n || ((n = []), (this.tileTrees[e] = n))
  25952. var r = n[t]
  25953. if (!r) {
  25954. var o = v.getLevelCountForSize(A.TILE_SIZE, i)
  25955. ;(r = new v(A.TILE_SIZE, o)), (n[t] = r)
  25956. }
  25957. }),
  25958. (n.prototype.getTileTree = function (e, t) {
  25959. var i = this.tileTrees[e]
  25960. if (!i) throw new u('PanoRenderer.getTileTree() -> Tree array not yet initialized!')
  25961. var n = i[t]
  25962. if (!n) throw new u('PanoRenderer.getTileTree() -> Tree not yet initialized!')
  25963. return n
  25964. }),
  25965. (n.prototype.initTiledPano = function (e, t) {
  25966. var i = this.sceneRenderer.renderer,
  25967. n =
  25968. (i.context,
  25969. new _.WebGLRenderTargetCube(e, e, {
  25970. stencilBuffer: !1
  25971. })),
  25972. r = new _.CubeTexture([])
  25973. ;((n.texture = r).image = [null, null, null, null, null, null]),
  25974. (r.flipY = !0),
  25975. t
  25976. ? ((r.generateMipmaps = !0), (r.magFilter = _.LinearFilter), (r.minFilter = _.LinearMipMapLinearFilter))
  25977. : ((r.generateMipmaps = !1), (r.magFilter = _.LinearFilter), (r.minFilter = _.LinearFilter)),
  25978. (r.format = _.RGBAFormat),
  25979. i.setRenderTarget(n),
  25980. i.setRenderTarget(null)
  25981. var o = i.properties.get(r)
  25982. return (o.__image__webglTextureCube = o.__webglTexture), n
  25983. }),
  25984. (n.prototype.getUploadQueueForPano = function (e) {
  25985. var t = this.uploadQueues[e]
  25986. return t || ((t = []), (this.uploadQueues[e] = t)), t
  25987. }),
  25988. (n.prototype.isTileUploaded = function (e) {
  25989. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25990. }),
  25991. (n.prototype.setUploaded = function (e, t) {
  25992. this.isPanoZoomed(e.panoId) ? (e.zoomUploaded = t) : (e.uploaded = t)
  25993. }),
  25994. (n.prototype.queueTileUpload = function (e, t, i) {
  25995. var n = this.getActiveRenderTargetDescriptor(e.panoId)
  25996. if (
  25997. this.isRenderTargetDescriptorValid(n) &&
  25998. e.downloaded &&
  25999. !this.isTileUploaded(e) &&
  26000. (!e.uploadQueued || i) &&
  26001. (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)
  26002. ) {
  26003. var r = this.getUploadQueueForPano(e.panoId)
  26004. i
  26005. ? this.uploadTile(e, !1)
  26006. : (this.shoulPushToFrontOfQueue(e) ? this.forceQueue.push(e) : t && this.direction ? y.insertSortedPanoTile(r, e, n.pano, this.direction) : r.push(e),
  26007. (e.uploadQueued = !0),
  26008. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  26009. }
  26010. }),
  26011. (n.prototype.shoulPushToFrontOfQueue = function (e) {
  26012. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  26013. }),
  26014. (n.prototype.getTopUploadQueue = function () {
  26015. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  26016. for (var n = 0; n < this.activePanos.length; n++)
  26017. if (((e = this.activePanos[n]), 0 < (t = this.getUploadQueueForPano(e.id)).length))
  26018. switch (i) {
  26019. case P.Base:
  26020. if (0 === t[0].level) return t
  26021. break
  26022. case P.Remaining:
  26023. return t
  26024. }
  26025. return null
  26026. }),
  26027. (n.prototype.getNextFromUploadQueue = function () {
  26028. if (0 < this.forceQueue.length) return L(this.forceQueue)
  26029. var e = this.getTopUploadQueue()
  26030. return e && 0 < e.length ? L(e) : null
  26031. }),
  26032. (n.prototype.peekNextFromUploadQueue = function () {
  26033. if (0 < this.forceQueue.length) return this.forceQueue[0]
  26034. var e = this.getTopUploadQueue()
  26035. return e && 0 < e.length ? e[0] : null
  26036. }),
  26037. (n.prototype.clearAllQueuedUploads = function () {
  26038. this.clearAllUploadQueues(null, 0)
  26039. }),
  26040. (n.prototype.clearAllQueuedUploadsForPano = function (e) {
  26041. this.clearAllUploadQueues(e, 0)
  26042. }),
  26043. (n.prototype.clearAllUploadQueues = function (e, t) {
  26044. if (e) this.clearUploadQueue(this.getUploadQueueForPano(e), t), this.clearUploadQueue(this.forceQueue, t, e)
  26045. else {
  26046. for (var i = 0; i < this.activePanos.length; i++) {
  26047. var n = this.activePanos[i]
  26048. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  26049. }
  26050. this.clearUploadQueue(this.forceQueue, t)
  26051. }
  26052. }),
  26053. (n.prototype.clearUploadQueue = function (e, t, i) {
  26054. null != t || (t = 0)
  26055. for (var n = 0; n < e.length; ) {
  26056. var r = e[n]
  26057. ;(!i || (i && i === r.tile.panoId)) && r.level >= t ? ((r.uploadQueued = !1), e.splice(n, 1)) : n++
  26058. }
  26059. }),
  26060. (n.prototype.refreshUploadInterval =
  26061. ((a = null),
  26062. function (e) {
  26063. this.uploadIntervalCancelled ||
  26064. ((a =
  26065. a ||
  26066. function () {
  26067. this.uploadIntervalCancelled ||
  26068. (this.overlayTilesLoaded || !this.usingTileOverlay
  26069. ? ((T = !0),
  26070. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26071. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : (this.uploadInterval = null))
  26072. : this.refreshUploadInterval(this.uploadIntervalDelay))
  26073. }.bind(this)),
  26074. null != e || (e = x),
  26075. T || (e = S),
  26076. (this.uploadInterval = window.setTimeout(a, e)),
  26077. (this.uploadIntervalDelay = e))
  26078. })),
  26079. (n.prototype.update =
  26080. ((r = performance.now()),
  26081. (o = 0),
  26082. function () {
  26083. ;(this.uploadIntervalCancelled = !0), window.clearTimeout(this.uploadInterval), (this.uploadInterval = null)
  26084. var e = performance.now() - r
  26085. !(x < e || 0 === o) ||
  26086. (!this.overlayTilesLoaded && this.usingTileOverlay) ||
  26087. (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame), (r = performance.now())),
  26088. o++
  26089. })),
  26090. (n.prototype.updateUploadQueue = function (e, t) {
  26091. e = e || 1
  26092. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  26093. var r = this.getNextFromUploadQueue()
  26094. if (!r) break
  26095. if ((0 !== r.level ? i++ : n++, !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  26096. var o = this.getActiveRenderTargetDescriptor(r.panoId)
  26097. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  26098. }
  26099. }
  26100. }),
  26101. (n.prototype.updateDirection = function (e) {
  26102. if ((e = e || this.direction)) {
  26103. this.direction = e
  26104. for (var t = 0; t < this.activePanos.length; t++) {
  26105. var i = this.activePanos[t],
  26106. n = this.getUploadQueueForPano(i.id)
  26107. y.sortPanoTiles(n, i, this.direction)
  26108. }
  26109. }
  26110. }),
  26111. (n.prototype.uploadTile =
  26112. ((I = {}),
  26113. new _.Vector4(),
  26114. (E = d.tiling.overlayStyle),
  26115. function (e, t) {
  26116. var i = e.panoId,
  26117. n = e.image,
  26118. r = e.tileSize,
  26119. o = e.panoSize,
  26120. a = e.tileIndex,
  26121. s = (e.faceTileIndex, e.totalTiles),
  26122. l = (e.face, e.tileX),
  26123. c = e.tileY,
  26124. h = !0,
  26125. u = !1,
  26126. d = (this.getPanoDescriptor(i), this.getPanoLODDescriptor(i, o)),
  26127. p = this.getActiveRenderTargetDescriptor(i),
  26128. f = p.renderTarget,
  26129. g = p.size
  26130. if (
  26131. (this.isPanoZoomed(i) && ((f = this.zoomRenderTarget), (g = this.qualityManager.getMaxZoomPanoSize())),
  26132. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  26133. t || (this.anyUploaded(e.node) && (u = !(h = !1)), this.isTileUploaded(e) && (u = h = !1)),
  26134. h)
  26135. ) {
  26136. var m = (r / o) * g,
  26137. v = ((l * r) / o) * g,
  26138. y = ((c * r) / o) * g
  26139. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping))
  26140. var A = I[r]
  26141. if ((this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r), 1 === E || 2 === E)) {
  26142. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced
  26143. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  26144. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, 0.5)
  26145. } else this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace)
  26146. d.uploadCount++, this.emit(b.TileRenderSuccess, i, o, a, s), d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s), this.setUploaded(e, !0), this.addCoverageForNode(e.node)
  26147. } else this.setUploaded(e, !1)
  26148. return (
  26149. e.uploadAttempted || (d.uploadAttempts++, this.emit(b.TileUploadAttempted, i, o, a, s)),
  26150. (e.uploadAttempted = !0),
  26151. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  26152. u
  26153. )
  26154. })),
  26155. (n.prototype.linkTileAndNode = function (e, t) {
  26156. ;(t.tile = e).node = t
  26157. }),
  26158. (n.prototype.linkAllTilesAndNodes = function (a) {
  26159. for (
  26160. var e = function (e, t, i, n, r) {
  26161. var o = this.getTileDirectoryEntry(a.id, t, n, r)
  26162. this.linkTileAndNode(o, i)
  26163. },
  26164. t = 0;
  26165. t < A.FACES_PER_PANO;
  26166. t++
  26167. ) {
  26168. var i = this.getTileTree(a.id, t)
  26169. i.breadthFirst({
  26170. callback: e.bind(this, i, t)
  26171. })
  26172. }
  26173. }),
  26174. (n.prototype.anyUploaded = function (e) {
  26175. if (!e) return !1
  26176. if (e.tile && this.isTileUploaded(e.tile)) return !0
  26177. if (e.children)
  26178. for (var t = 0; t < e.children.length; t++) {
  26179. var i = e.children[t]
  26180. if (this.anyUploaded(i)) return !0
  26181. }
  26182. return !1
  26183. }),
  26184. (n.prototype.setNodeCovered = function (e, t) {
  26185. this.isPanoZoomed(e.tile.panoId) ? (e.zoomCovered = t) : (e.covered = t)
  26186. }),
  26187. (n.prototype.isNodeCovered = function (e) {
  26188. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  26189. }),
  26190. (n.prototype.addCoverageForNode = function (e) {
  26191. if ((this.setNodeCovered(e, !0), e.parent && e.covered)) {
  26192. var t = e.parent
  26193. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  26194. }
  26195. }),
  26196. (n.prototype.calcFullCoverage = function (e) {
  26197. var t = !1
  26198. if (e.children)
  26199. for (var i = 0; i < e.children.length; i++) {
  26200. var n = e.children[i]
  26201. t = t || this.calcFullCoverage(n)
  26202. }
  26203. e.covered = e.tile.uploaded || t
  26204. }),
  26205. (n.prototype.nodeSubcovered = function (e) {
  26206. if (!e.children) return !1
  26207. for (var t = 0; t < e.children.length; t++) if (!e.children[t] || !this.isNodeCovered(e.children[t])) return !1
  26208. return !0
  26209. }),
  26210. (n.prototype.resetPanoDescriptor = function (e) {
  26211. this.getPanoDescriptor(e)
  26212. }),
  26213. (n.prototype.getPanoDescriptor = function (e) {
  26214. var t = this.panoDescriptors[e]
  26215. return t || ((t = {}), (this.panoDescriptors[e] = t)), t
  26216. }),
  26217. (n.prototype.resetPanoLODDescriptors = function (e) {
  26218. var t = this.getPanoLODDescriptors(e)
  26219. for (var i in t)
  26220. if (t.hasOwnProperty(i)) {
  26221. var n = t[i]
  26222. ;(n.uploadCount = 0), (n.uploadAttempts = 0)
  26223. }
  26224. }),
  26225. (n.prototype.getPanoLODDescriptor = function (e, t) {
  26226. var i = this.getPanoLODDescriptors(e),
  26227. n = i[t]
  26228. return (
  26229. n ||
  26230. ((n = {
  26231. uploadCount: 0,
  26232. uploadAttempts: 0
  26233. }),
  26234. (i[t] = n)),
  26235. n
  26236. )
  26237. }),
  26238. (n.prototype.getPanoLODDescriptors = function (e) {
  26239. var t = this.panoLODDescriptors[e]
  26240. return t || ((t = {}), (this.panoLODDescriptors[e] = t)), t
  26241. }),
  26242. (n.prototype.onTileDownloaded = function (e) {
  26243. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize),
  26244. i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex)
  26245. if (
  26246. ((i.downloaded = !0),
  26247. (i.image = e.image),
  26248. (i.panoSize = e.panoSize),
  26249. (i.tileX = e.tileX),
  26250. (i.tileY = e.tileY),
  26251. (i.totalTiles = e.totalTiles),
  26252. (i.tileIndex = e.tileIndex),
  26253. (i.faceTileIndex = e.faceTileIndex),
  26254. (i.face = e.face),
  26255. (i.cubeFace = C.mapFaceToCubemapFace(e.face)),
  26256. (i.panoId = e.panoId),
  26257. (i.tileSize = e.tileSize),
  26258. (i.direction = new _.Vector3().copy(e.direction)),
  26259. (i.node = null),
  26260. (i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize)),
  26261. this.isPanoActive(i.panoId))
  26262. ) {
  26263. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY)
  26264. this.linkTileAndNode(i, n), this.queueTileUpload(i, !0)
  26265. }
  26266. }),
  26267. (n.prototype.getTileDirectoryEntry = function (e, t, i, n) {
  26268. var r = this.tileDirectory[e]
  26269. r || ((r = {}), (this.tileDirectory[e] = r))
  26270. var o = 16384 * t + 1024 * i + n,
  26271. a = r[o]
  26272. return (
  26273. a ||
  26274. ((a = {
  26275. downloaded: !1,
  26276. uploaded: !1,
  26277. zoomUploaded: !1
  26278. }),
  26279. (r[o] = a)),
  26280. (a._key = e + ':' + t + ':' + i + ':' + n),
  26281. (a._tileKey = o),
  26282. a
  26283. )
  26284. }),
  26285. (n.prototype.setZoomingActive = function (e, t, i) {
  26286. this.zoomPanoRenderingDisabled ||
  26287. (e === this.zoomingActive && this.zoomPanoId === t.id) ||
  26288. ((this.zoomingActive = e), (this.zoomPanoId = t.id), this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  26289. }),
  26290. (n.prototype.updateZoomedPanoFromBase = function (e) {
  26291. if (!this.zoomPanoRenderingDisabled) {
  26292. var t = this.getActiveRenderTargetDescriptor(e.id)
  26293. if (t && t.renderTarget) {
  26294. var i = this.qualityManager.getMaxZoomPanoSize(),
  26295. n = t.renderTarget,
  26296. r = t.size
  26297. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i), this.copyBaseRenderStatusToZoomed(e.id)
  26298. }
  26299. }
  26300. }),
  26301. (t.exports = n)
  26302. },
  26303. {
  26304. '../enum/GLCubeFaces': 25,
  26305. '../enum/PanoRendererEvents': 35,
  26306. '../enum/PanoSizeClass': 36,
  26307. '../enum/SceneRendererEvents': 43,
  26308. '../enum/TileDownloaderEvents': 45,
  26309. '../enum/Vectors': 50,
  26310. '../exception/BasicException': 55,
  26311. '../objects/Panorama': 148,
  26312. '../settings': 166,
  26313. '../util/browser': 182,
  26314. '../util/panorama': 191,
  26315. './TileDownloader': 171,
  26316. './TilePrioritizer': 172,
  26317. './TileTree': 173,
  26318. './TileUtils': 174,
  26319. events: 202,
  26320. three: 217
  26321. }
  26322. ],
  26323. 170: [
  26324. function (e, t, i) {
  26325. 'use strict'
  26326. function n(e, t, i) {
  26327. ;(this.maxNavPanoSize = -1),
  26328. (this.maxZoomPanoSize = -1),
  26329. (this.devicePixelDensity = e),
  26330. (this.deviceScreenSize = t),
  26331. (this.clientBandwidth = i),
  26332. (this.panoSizeClassMap = {}),
  26333. (this.useHighResolutionPanos = !0),
  26334. (this.useUltraHighResolutionPanos = !1),
  26335. (this.modelHasUltraHighPanos = !1)
  26336. }
  26337. var r = e('../enum/PanoSizeClass'),
  26338. o = e('../settings'),
  26339. a = e('../util/browser'),
  26340. s = e('../constants'),
  26341. l = e('../util/showcase'),
  26342. c = e('../enum/ModelManagerEvents')
  26343. ;(n.prototype.init = function (e) {
  26344. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  26345. (this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH)),
  26346. (this.highSize = this.getPanoSize(r.HIGH)),
  26347. (this.standardSize = this.getPanoSize(r.STANDARD)),
  26348. (this.baseSize = this.getPanoSize(r.BASE)),
  26349. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  26350. (this.highQualityThreshold = a.valueFromHash('threshold2k', s.windowHeightHighQualityThreshold)),
  26351. this.updateMaximums(),
  26352. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  26353. }),
  26354. (n.prototype.updateFromModel = function (e) {
  26355. this.updateHighResolutionSettings(e), this.updateUltraHighResolutionSettings(e)
  26356. }),
  26357. (n.prototype.updateHighResolutionSettings = function (e) {
  26358. l.modelDataPromisesTiles(e.data) ? (this.useHighResolutionPanos = !0) : (this.useHighResolutionPanos = !1), this.updateMaximums()
  26359. }),
  26360. (n.prototype.updateUltraHighResolutionSettings = function (e) {
  26361. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? (this.useUltraHighResolutionPanos = !0) : (this.useUltraHighResolutionPanos = !1), this.updateMaximums()
  26362. }),
  26363. (n.prototype.enableUltraHighQualityMode = function () {
  26364. ;(this.modelHasUltraHighPanos = !0), this.updateUltraHighResolutionSettings(null)
  26365. }),
  26366. (n.prototype.ultraHighQualityModeEnabled = function () {
  26367. return this.modelHasUltraHighPanos
  26368. }),
  26369. (n.prototype.onModelChanged = function (e) {
  26370. this.updateFromModel(e.model), this.updateMaximums()
  26371. }),
  26372. (n.prototype.updateMaximums = function () {
  26373. ;(this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize()),
  26374. (this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize()),
  26375. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  26376. }),
  26377. (n.prototype.buildPanoSizeClassMap = function () {
  26378. ;(this.panoSizeClassMap[r.BASE] = 512), (this.panoSizeClassMap[r.STANDARD] = 1024), (this.panoSizeClassMap[r.HIGH] = 2048), (this.panoSizeClassMap[r.ULTRAHIGH] = 4096)
  26379. }),
  26380. (n.prototype.getPanoSize = function (e) {
  26381. return this.panoSizeClassMap[e]
  26382. }),
  26383. (n.prototype.getMaxPossiblePanoSize = function () {
  26384. return this.getPanoSize(r.ULTRAHIGH)
  26385. }),
  26386. (n.prototype.getMaxPanoSize = function () {
  26387. return this.maxZoomPanoSize
  26388. }),
  26389. (n.prototype.getMaxNavPanoSize = function () {
  26390. return this.maxNavPanoSize
  26391. }),
  26392. (n.prototype.getMaxZoomPanoSize = function () {
  26393. return this.maxZoomPanoSize
  26394. }),
  26395. (n.prototype.detectMaxNavPanoSizeClass = function () {
  26396. return this.useHighResolutionPanos ? (a.isMobile() ? r.STANDARD : $('#player').height() < this.highQualityThreshold ? r.STANDARD : r.HIGH) : r.STANDARD
  26397. }),
  26398. (n.prototype.detectMaxNavPanoSize = function () {
  26399. var e = this.detectMaxNavPanoSizeClass()
  26400. return this.getPanoSize(e)
  26401. }),
  26402. (n.prototype.detectMaxZoomPanoSize = function () {
  26403. return this.useHighResolutionPanos
  26404. ? a.isMobile()
  26405. ? o.tiling.mobileHighQualityOverride
  26406. ? this.getPanoSize(r.HIGH)
  26407. : this.getPanoSize(r.STANDARD)
  26408. : this.useUltraHighResolutionPanos
  26409. ? this.getPanoSize(r.ULTRAHIGH)
  26410. : this.getPanoSize(r.HIGH)
  26411. : this.getPanoSize(r.STANDARD)
  26412. }),
  26413. (t.exports = n)
  26414. },
  26415. {
  26416. '../constants': 8,
  26417. '../enum/ModelManagerEvents': 33,
  26418. '../enum/PanoSizeClass': 36,
  26419. '../settings': 166,
  26420. '../util/browser': 182,
  26421. '../util/showcase': 193
  26422. }
  26423. ],
  26424. 171: [
  26425. function (A, C, e) {
  26426. ;(function (e) {
  26427. 'use strict'
  26428. function i(e) {
  26429. ;(this.panos = null),
  26430. (this.retryMinimumTime = 1e4),
  26431. (this.urls = null),
  26432. (this.panoLoadCallbacks = {}),
  26433. (this.downloadDescriptors = {}),
  26434. (this.priorityQueue = []),
  26435. (this.forceQueue = []),
  26436. (this.activeDownloads = []),
  26437. (this.qualityManager = null),
  26438. (this.tilePrioritizer = null),
  26439. (this.refreshInterval = null),
  26440. (this.processPriorityQueue = !1),
  26441. (this.concurrentDownloads = e.concurrentDownloads || 1),
  26442. (this.downloadTestResults = {})
  26443. }
  26444. var c,
  26445. h,
  26446. n,
  26447. p,
  26448. f,
  26449. t = A('three'),
  26450. u = (A('../enum/Viewmode'), A('../settings')),
  26451. r = (A('../objects/Panorama'), A('../util/logger')),
  26452. o = (A('../enum/Vectors'), A('../enum/PanoSizeClass'), A('../enum/TileDownloaderEvents')),
  26453. g = A('./TilePrioritizer'),
  26454. m = A('./TileUtils'),
  26455. v = (A('../enum/GLCubeFaces'), A('../enum/DownloadStatus')),
  26456. a = A('../util/panorama'),
  26457. s = A('../util/ajax'),
  26458. d = A('../ab'),
  26459. l = A('events').EventEmitter,
  26460. y =
  26461. (new r(e),
  26462. Object.freeze({
  26463. Testing: 1,
  26464. Success: 2,
  26465. Fail: 3
  26466. }))
  26467. ;(i.prototype = Object.create(l.prototype)),
  26468. (i.IDLE_REFRESH_DELAY = 500),
  26469. (i.ACTIVE_REFRESH_DELAY = 16),
  26470. (i.DOWNLOAD_RETRIES = 4),
  26471. (i.prototype.init = function (e) {
  26472. this.qualityManager = e
  26473. }),
  26474. (i.prototype.setUrls = function (e) {
  26475. this.urls = e
  26476. }),
  26477. (i.prototype.setPanoData = function (e, t, i) {
  26478. ;(this.panos = e), (this.imagePanos = t), (this.panoGroupId = i)
  26479. }),
  26480. (i.prototype.start = function () {
  26481. this.refreshUpdateInterval(0)
  26482. }),
  26483. (i.prototype.stop = function () {
  26484. window.cancel(this.refreshInterval)
  26485. }),
  26486. (i.prototype.refreshUpdateInterval = function (e) {
  26487. ;(e = e || 0),
  26488. (this.refreshInterval = window.setTimeout(
  26489. function () {
  26490. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  26491. }.bind(this),
  26492. e
  26493. ))
  26494. }),
  26495. (i.prototype.update = function () {
  26496. var e = 0 < this.forceQueue.length
  26497. return (
  26498. this.processQueueForDownloading(this.forceQueue),
  26499. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos), 0 < this.priorityQueue.length && (e = !0), this.processQueueForDownloading(this.priorityQueue)),
  26500. e
  26501. )
  26502. }),
  26503. (i.prototype.forceQueueTilesForPano =
  26504. ((p = []),
  26505. (f = []),
  26506. function (e, t, i, n, r, o) {
  26507. p.length = 0
  26508. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  26509. var l = a[s]
  26510. ;(l.status !== v.None && l.status !== v.Queued) || p.push(l)
  26511. }
  26512. if (i && 0 < p.length) {
  26513. g.sortPanoTiles(p, e, i), (f.length = 0), m.matchingTilesInDirection(e, t, i, n, r, f)
  26514. for (
  26515. var c = 0,
  26516. h = function (e) {
  26517. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  26518. };
  26519. c < p.length;
  26520. ) {
  26521. var u = p[c]
  26522. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  26523. }
  26524. }
  26525. for (var d = 0; d < p.length; d++) this.forceQueue.push(p[d])
  26526. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued), this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1), o && this.processQueueForDownloading(this.forceQueue, !0)
  26527. })),
  26528. (i.prototype.clearForceQueue = function () {
  26529. this.clearQueue(this.forceQueue)
  26530. }),
  26531. (i.prototype.queuePrioritizedTilesForPanos = function (e) {
  26532. this.tilePrioritizer &&
  26533. (this.clearQueue(this.priorityQueue),
  26534. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  26535. this.clearFromQueue(this.priorityQueue, v.None, !0),
  26536. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  26537. }),
  26538. (i.prototype.clearQueue = function (e) {
  26539. this.setStatusForAllDescriptors(e, v.None), (e.length = 0)
  26540. }),
  26541. (i.prototype.clearFromQueue = function (e, t, i) {
  26542. for (var n = 0; n < e.length; n++) {
  26543. var r = e[n]
  26544. r && ((t === r.status && !i) || (t !== r.status && i)) && (e[n] = null)
  26545. }
  26546. }),
  26547. (i.prototype.setStatusForAllDescriptors = function (e, t) {
  26548. for (var i = 0; i < e.length; i++) {
  26549. var n = e[i]
  26550. n && (n.status = t)
  26551. }
  26552. }),
  26553. (i.prototype.setStatusOrRemoveForAllDescriptors = function (e, t) {
  26554. for (var i = 0; i < e.length; i++) {
  26555. var n = e[i]
  26556. n && (n.status !== t ? (n.status = t) : (e[i] = null))
  26557. }
  26558. }),
  26559. (i.prototype.getTileDownloadDescriptors = function (e, t) {
  26560. var i = this.getAllTileDownloadDescriptorsForPano(e),
  26561. n = i[t]
  26562. return n || ((n = this.buildDownloadDescriptorArray(t)), (i[t] = n), this.initTileDownloadDescriptors(n, e, t)), n
  26563. }),
  26564. (i.prototype.getAllTileDownloadDescriptorsForPano = function (e) {
  26565. var t = this.downloadDescriptors[e.id]
  26566. return t || ((t = {}), (this.downloadDescriptors[e.id] = t)), t
  26567. }),
  26568. (i.prototype.processQueueForDownloading = function (e, t) {
  26569. if ((this.cleanupActiveDownloads(), this.activeDownloads.length < this.concurrentDownloads || t))
  26570. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  26571. var r = e.shift()
  26572. r && (this.startDownload(r), n++)
  26573. }
  26574. }),
  26575. (i.prototype.testDownload = function (t, e, i) {
  26576. var n = this.downloadTestResults[t]
  26577. if (n) n === y.Success ? i(!0) : n === y.Fail && i(!1)
  26578. else {
  26579. this.downloadTestResults[t] = y.Testing
  26580. var r = this.panos.list[0],
  26581. o = this.getTileUrl(r.id, t, e, 0),
  26582. a = function (e) {
  26583. ;(this.downloadTestResults[t] = y.Success), i(!0)
  26584. }.bind(this),
  26585. s = function () {
  26586. ;(this.downloadTestResults[t] = y.Fail), i(!1)
  26587. }.bind(this)
  26588. this.loadImage(o, 0, a, s)
  26589. }
  26590. }),
  26591. (i.prototype.startDownload = function (e) {
  26592. e.status = v.Downloading
  26593. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex)
  26594. this.activeDownloads.push(e), this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26595. }),
  26596. (i.prototype.downloadFailed = function (e, t) {}),
  26597. (i.prototype.downloadComplete = function (e, t) {
  26598. if (e.panoGroupId === this.panoGroupId) {
  26599. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize)
  26600. ;(e.status = v.Downloaded), i && i.onProgress && i.onProgress(e.pano, e.panoSize)
  26601. var n = {
  26602. panoId: e.pano.id,
  26603. image: t,
  26604. tileSize: e.tileSize,
  26605. panoSize: e.panoSize,
  26606. tileIndex: e.tileIndex,
  26607. faceTileIndex: e.faceTileIndex,
  26608. totalTiles: e.totalTiles,
  26609. face: e.face,
  26610. tileX: e.tileX,
  26611. tileY: e.tileY,
  26612. direction: e.direction
  26613. }
  26614. ;(e.image = t),
  26615. this.emit(o.TileDownloadSuccess, n),
  26616. this.isPanoDownloaded(e.pano, e.panoSize) &&
  26617. ((n = {
  26618. panoId: e.pano.id,
  26619. tileSize: e.tileSize,
  26620. panoSize: e.panoSize
  26621. }),
  26622. this.emit(o.PanoDownloadComplete, n),
  26623. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26624. }
  26625. }),
  26626. (i.prototype.cleanupActiveDownloads =
  26627. ((n = []),
  26628. function () {
  26629. for (var e = (n.length = 0); e < this.activeDownloads.length; e++) {
  26630. var t = this.activeDownloads[e]
  26631. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  26632. }
  26633. ;(this.activeDownloads.length = 0), this.activeDownloads.push.apply(this.activeDownloads, n)
  26634. })),
  26635. (i.prototype.isPanoDownloaded = function (e, t) {
  26636. var i = this.getTileDownloadDescriptors(e, t)
  26637. if (i.length <= 0) return !1
  26638. for (var n = 0; n < i.length; n++) {
  26639. if (i[n].status !== v.Downloaded) return !1
  26640. }
  26641. return !0
  26642. }),
  26643. (i.prototype.setPanoLoadCallbacks = function (e, t, i, n, r) {
  26644. var o = e.id + ':' + this.qualityManager.getPanoSize(t)
  26645. this.panoLoadCallbacks[o] = {
  26646. onLoad: i,
  26647. onFail: n,
  26648. onProgress: r
  26649. }
  26650. }),
  26651. (i.prototype.getPanoLoadCallbacks = function (e, t) {
  26652. var i = e.id + ':' + t
  26653. return this.panoLoadCallbacks[i]
  26654. }),
  26655. (i.prototype.buildDownloadDescriptorArray = function (e) {
  26656. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26657. var r = this.buildDownloadDescriptor()
  26658. i.push(r)
  26659. }
  26660. return i
  26661. }),
  26662. (i.prototype.buildDownloadDescriptor = function () {
  26663. return {
  26664. panoGroupId: null,
  26665. pano: null,
  26666. panoSize: -1,
  26667. tileSize: -1,
  26668. tileIndex: -1,
  26669. totalTiles: -1,
  26670. faceTileIndex: -1,
  26671. status: v.None,
  26672. url: null,
  26673. image: null,
  26674. direction: new t.Vector3(),
  26675. face: -1,
  26676. cubeFace: -1,
  26677. tileX: -1,
  26678. tileY: -1
  26679. }
  26680. }),
  26681. (i.prototype.initTileDownloadDescriptors = function (e, t, i) {
  26682. for (var n = 0; n < e.length; n++) {
  26683. var r = e[n]
  26684. this.initTileDownloadDescriptor(r, t, i, n)
  26685. }
  26686. }),
  26687. (i.prototype.initTileDownloadDescriptor = function (e, t, i, n) {
  26688. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i
  26689. ;(e.face = m.getFaceForTile(i, n)),
  26690. (e.cubeFace = a.mapFaceToCubemapFace(e.face)),
  26691. (e.panoGroupId = this.panoGroupId),
  26692. (e.pano = t),
  26693. (e.panoSize = i),
  26694. (e.tileSize = r),
  26695. (e.tileIndex = n),
  26696. (e.totalTiles = m.getTileCountForSize(i)),
  26697. (e.status = v.None),
  26698. (e.image = null),
  26699. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26700. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26701. }),
  26702. (i.prototype.getTileUrl =
  26703. ((c = {
  26704. 256: '256',
  26705. 512: '512',
  26706. 1024: '1k',
  26707. 2048: '2k',
  26708. 4096: '4k'
  26709. }),
  26710. (h = {
  26711. face: -1,
  26712. faceTileIndex: -1,
  26713. tileX: -1,
  26714. tileY: -1
  26715. }),
  26716. function (e, t, i, n) {
  26717. m.getTileLocation(t, n, h)
  26718. var r = Math.floor(t / i),
  26719. o = r * r,
  26720. a = Math.floor(n / o),
  26721. s = ''
  26722. 1 === u.tiling.customCompression && (s = '_' + u.tiling['q' + c[t]])
  26723. var l = this.urls.get('tiles/' + e + '/' + c[t] + s + '_face' + a + '_' + h.tileX + '_' + h.tileY + '.jpg')
  26724. return d.changeIfTileGenerating(l)
  26725. })),
  26726. (i.prototype.loadImage = function (e, t, i, n) {
  26727. s.getImage(e, t)
  26728. .then(function (e) {
  26729. i(e)
  26730. })
  26731. .fail(n)
  26732. }),
  26733. (C.exports = i)
  26734. }).call(this, '/js/tile/TileDownloader.js')
  26735. },
  26736. {
  26737. '../ab': 3,
  26738. '../enum/DownloadStatus': 24,
  26739. '../enum/GLCubeFaces': 25,
  26740. '../enum/PanoSizeClass': 36,
  26741. '../enum/TileDownloaderEvents': 45,
  26742. '../enum/Vectors': 50,
  26743. '../enum/Viewmode': 51,
  26744. '../objects/Panorama': 148,
  26745. '../settings': 166,
  26746. '../util/ajax': 181,
  26747. '../util/logger': 189,
  26748. '../util/panorama': 191,
  26749. './TilePrioritizer': 172,
  26750. './TileUtils': 174,
  26751. events: 202,
  26752. three: 217
  26753. }
  26754. ],
  26755. 172: [
  26756. function (n, C, e) {
  26757. ;(function (e) {
  26758. 'use strict'
  26759. function h(e, t, i, n, r) {
  26760. ;(this.qualityManager = e),
  26761. (this.maxNavQuality = this.qualityManager.getMaxNavPanoSize()),
  26762. (this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()),
  26763. (this.baseSize = t),
  26764. (this.standardSize = i),
  26765. (this.highSize = n),
  26766. (this.ultraHighSize = r),
  26767. (this.priorityCriteria = new h.PriorityCriteria(null, new o.Vector3(0, 0, 0), new o.Vector3(0, 0, -1), new o.Vector3(0, 0, -1)))
  26768. }
  26769. var c,
  26770. s,
  26771. l,
  26772. d,
  26773. r,
  26774. u,
  26775. p,
  26776. f,
  26777. o = n('three'),
  26778. g = (n('../enum/Viewmode'), n('../settings'), n('../settings'), n('../objects/Panorama')),
  26779. t = n('../util/logger'),
  26780. i = (n('../enum/Vectors'), n('../enum/PanoSizeClass'), n('../enum/ModelManagerEvents'), n('../enum/GLCubeFaces'), n('../enum/DownloadStatus')),
  26781. m = (n('../util/browser'), n('./TileUtils')),
  26782. v = n('../util/math'),
  26783. a =
  26784. (n('events').EventEmitter,
  26785. new t(e),
  26786. Object.freeze({
  26787. None: 0,
  26788. DirectionalFOV: 1
  26789. }))
  26790. ;(h.PriorityCriteria = function (e, t, i, n, r) {
  26791. ;(this.pano = e),
  26792. (this.cameraPosition = new o.Vector3().copy(t)),
  26793. (this.cameraDir = new o.Vector3().copy(i)),
  26794. (this.panoSpaceDir = new o.Vector3().copy(n)),
  26795. (this.upcomingPanos = r),
  26796. (this.copy = function (e) {
  26797. ;(this.pano = e.pano), this.cameraPosition.copy(e.cameraPosition), this.cameraDir.copy(e.cameraDir), this.panoSpaceDir.copy(e.panoSpaceDir), (this.upcomingPanos = r)
  26798. }),
  26799. (this.zoomingActive = !1)
  26800. }),
  26801. (h.DIRECTIONAL_FOV = 180),
  26802. (h.DIRECTIONAL_FOV_NARROW = 120),
  26803. (h.MAX_SCORED_PANOS_TOCONSIDER = 6),
  26804. (h.MAX_SCORED_PANOS_TOADD = 2),
  26805. (h.MAX_UPCOMING_PANOS_TOADD = 3),
  26806. (h.DIRECTION_SCORE_STRICTNESS = 0.75),
  26807. (h.appendQueue = function (e, t) {
  26808. if (e && t) for (var i = 0; i < t.length; i++) e.push(t[i])
  26809. }),
  26810. (h.prototype.updateCriteria = function (e, t, i, n) {
  26811. ;(this.priorityCriteria.pano = e),
  26812. this.priorityCriteria.cameraPosition.copy(t),
  26813. this.priorityCriteria.cameraDir.copy(i),
  26814. (this.priorityCriteria.upcomingPanos = n),
  26815. (this.maxNavQuality = this.qualityManager.getMaxNavPanoSize()),
  26816. (this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize())
  26817. }),
  26818. (h.prototype.filterAndPrioritize =
  26819. ((u = []),
  26820. (p = []),
  26821. (f = []),
  26822. function (e, t, i) {
  26823. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  26824. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER)
  26825. var n = this.baseSize,
  26826. r = this.standardSize,
  26827. o = this.highSize,
  26828. a = this.ultraHighSize
  26829. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  26830. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  26831. (f.length = 0),
  26832. this.canDownloadSize(r) &&
  26833. this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26834. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26835. h.appendQueue(e, f),
  26836. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  26837. (f.length = 0),
  26838. this.canDownloadSize(o) &&
  26839. this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26840. this.canDownloadSize(a) &&
  26841. this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26842. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26843. h.appendQueue(e, f),
  26844. (f.length = 0),
  26845. this.canDownloadSize(r) &&
  26846. this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26847. this.canDownloadSize(o) &&
  26848. this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26849. this.canDownloadSize(a) &&
  26850. this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26851. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26852. h.appendQueue(e, f),
  26853. this.queueTilesForPanos(e, u, i, n)
  26854. })),
  26855. (h.prototype.canDownloadSize = function (e) {
  26856. return this.maxNavQuality >= e || (this.maxZoomQuality >= e && this.zoomingActive)
  26857. }),
  26858. (h.prototype.populateNeighborPanos = function (e, t, i) {
  26859. ;(i = i || []).length = 0
  26860. var n = t.getNeighbours(e)
  26861. for (var r in n)
  26862. if (n.hasOwnProperty(r)) {
  26863. var o = t.get(r)
  26864. i.push(o)
  26865. }
  26866. return i
  26867. }),
  26868. (h.prototype.populateScoredPanos = function (e, t, i, n, r) {
  26869. ;(i = i || []).length = 0
  26870. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)],
  26871. a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)],
  26872. s = t.sortByScore(o, a)
  26873. if (s)
  26874. for (var l = 0; l < s.length && l < r; l++) {
  26875. var c = s[l].item
  26876. i.push(c)
  26877. }
  26878. return i
  26879. }),
  26880. (h.prototype.queueTilesForPanos = function (e, t, i, n, r) {
  26881. for (var o = 0, a = 0; a < t.length; a++) {
  26882. var s = t[a]
  26883. if (((o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0), r && r <= o)) break
  26884. }
  26885. return o
  26886. }),
  26887. (h.prototype.queueTilesForPano =
  26888. ((r = {
  26889. filter: a.None
  26890. }),
  26891. function (e, t, i, n) {
  26892. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  26893. })),
  26894. (h.prototype.queueTilesForPanosInDirection =
  26895. ((d = new o.Vector3()),
  26896. function (e, t, i, n, r, o, a, s) {
  26897. for (var l = 0, c = 0; c < i.length; c++) {
  26898. var h = i[c]
  26899. d.copy(h.position), d.sub(r), d.normalize()
  26900. var u = Math.max(Math.min(o.dot(d), 1), -1)
  26901. if (v.getFOVDotThreshold(a) <= u && ((l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0), s && s <= l)) break
  26902. }
  26903. return l
  26904. })),
  26905. (h.prototype.queueTilesInDirectionForPanos = function (e, t, i, n, r, o, a, s) {
  26906. for (var l = 0, c = 0; c < i.length; c++) {
  26907. var h = i[c]
  26908. if (((l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0), s && s <= l)) break
  26909. }
  26910. return l
  26911. }),
  26912. (h.prototype.queueTilesInDirectionForPano =
  26913. ((s = {
  26914. filter: a.DirectionalFOV,
  26915. direction: new o.Vector3(),
  26916. fov: 60
  26917. }),
  26918. (l = new o.Vector3()),
  26919. function (e, t, i, n, r, o, a) {
  26920. return l.copy(o), m.getRelativeDirection(i.quaternion, l), s.direction.copy(l), (s.fov = a), this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  26921. })),
  26922. (h.prototype.filterAndQueueTileDownloadDescriptors =
  26923. ((c = []),
  26924. function (e, t, i, n, r) {
  26925. var o = t.getTileDownloadDescriptors(i, n)
  26926. ;(c.length = 0), this.filterTileDownloadDescriptors(i, o, c, r)
  26927. for (var a = 0, s = 0; s < c.length; s++) {
  26928. var l = c[s]
  26929. l && (e.push(l), a++)
  26930. }
  26931. return a
  26932. })),
  26933. (h.prototype.filterTileDownloadDescriptors =
  26934. (new o.Vector3(),
  26935. function (e, t, i, n) {
  26936. var r, o
  26937. switch (n.filter) {
  26938. case a.DirectionalFOV:
  26939. for (r = 0; r < t.length; r++) (o = t[r]), m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o)
  26940. break
  26941. default:
  26942. for (r = 0; r < t.length; r++) (o = t[r]), i.push(o)
  26943. }
  26944. for (r = 0; r < i.length; r++) (o = i[r]), this.canIncludeDescriptor(o) || (i[r] = null)
  26945. })),
  26946. (h.prototype.canIncludeDescriptor = function (e) {
  26947. return e.status !== i.Downloading && e.status !== i.Downloaded
  26948. }),
  26949. (h.prototype.canIncludePano = function (e, t) {
  26950. return !e.isLoaded(t)
  26951. }),
  26952. (h.getFOVDotThreshold = function (e) {
  26953. return Math.cos(o.Math.degToRad(e / 2))
  26954. })
  26955. var y = ((A._panoSpaceDir = new o.Vector3()), (A._fovThreshold = -1), (A._fovThresholdNarrow = -1), A)
  26956. function A(e, t) {
  26957. var i = A._panoSpaceDir,
  26958. n = A._fovThreshold,
  26959. r = A._fovThresholdNarrow,
  26960. o = Math.max(Math.min(i.dot(e.direction), 1), -1),
  26961. a = Math.max(Math.min(i.dot(t.direction), 1), -1)
  26962. return (
  26963. (e._dot = o),
  26964. (t._dot = a),
  26965. n <= o && a < n ? -1 : o < n && n <= a ? 1 : r <= o && a < r ? -1 : o < r && r <= a ? 1 : e.panoSize > t.panoSize ? 1 : t.panoSize > e.panoSize ? -1 : -(o - a)
  26966. )
  26967. }
  26968. ;(h.sortPanoTiles = function (e, t, i) {
  26969. y._panoSpaceDir.copy(i),
  26970. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  26971. (y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW)),
  26972. (y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV)),
  26973. e.sort(y)
  26974. }),
  26975. (h.insertSortedPanoTile = function (e, t, i, n) {
  26976. y._panoSpaceDir.copy(n),
  26977. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  26978. (y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW)),
  26979. (y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV))
  26980. for (var r = -1, o = 0; o < e.length; o++) {
  26981. if (y(t, e[o]) <= 0) {
  26982. r = o
  26983. break
  26984. }
  26985. }
  26986. if (-1 === r) e[e.length] = t
  26987. else {
  26988. for (var a = e.length; r < a; a--) e[a] = e[a - 1]
  26989. e[r] = t
  26990. }
  26991. }),
  26992. (h.prototype.setZoomingActive = function (e) {
  26993. e !== this.zoomingActive && (this.zoomingActive = e)
  26994. }),
  26995. (C.exports = h)
  26996. }).call(this, '/js/tile/TilePrioritizer.js')
  26997. },
  26998. {
  26999. '../enum/DownloadStatus': 24,
  27000. '../enum/GLCubeFaces': 25,
  27001. '../enum/ModelManagerEvents': 33,
  27002. '../enum/PanoSizeClass': 36,
  27003. '../enum/Vectors': 50,
  27004. '../enum/Viewmode': 51,
  27005. '../objects/Panorama': 148,
  27006. '../settings': 166,
  27007. '../util/browser': 182,
  27008. '../util/logger': 189,
  27009. '../util/math': 190,
  27010. './TileUtils': 174,
  27011. events: 202,
  27012. three: 217
  27013. }
  27014. ],
  27015. 173: [
  27016. function (e, t, i) {
  27017. 'use strict'
  27018. function f(e, t) {
  27019. ;(this.levels = t),
  27020. (this.tileSize = e),
  27021. (this.root = null),
  27022. (this.allNodes = []),
  27023. (function (e) {
  27024. e.root = (function e(t, i, n) {
  27025. if (n > t.levels) return null
  27026. var r = new a(t, i)
  27027. t.allNodes.push(r)
  27028. for (var o = 0; o < s; o++) r.children[o] = e(t, r, n + 1)
  27029. return r
  27030. })(e, null, 0)
  27031. })(this)
  27032. }
  27033. function a(e, t) {
  27034. ;(this.tree = e), (this.parent = t), (this.children = []), (this.id = ++n)
  27035. }
  27036. var g = (e('three'), e('./TileUtils'), e('../objects/Panorama'), e('../util/panorama'), e('events').EventEmitter, 2),
  27037. s = g * g
  27038. f.TraversalType = Object.freeze({
  27039. PreOrder: 0,
  27040. PostOrder: 1
  27041. })
  27042. var n = 0
  27043. ;(f.getLevelCountForSize = function (e, t) {
  27044. var i = 0
  27045. for (t < e && (t = e); !((t /= g) < e); ) i++
  27046. return i
  27047. }),
  27048. (f.getSizeForLevel = function (e, t) {
  27049. return Math.pow(g, t) * e
  27050. }),
  27051. (f.prototype.getSubNode = function (e, t, i) {
  27052. ;(!t || e < this.tileSize) && (t = 0), (!i || e < this.tileSize) && (i = 0), e < this.tileSize && (e = this.tileSize)
  27053. var n = f.getLevelCountForSize(this.tileSize, e)
  27054. return (function e(t, i, n, r, o) {
  27055. if (!t) return null
  27056. if (0 === n) return t
  27057. if (!t.children || 0 === t.children.length) return null
  27058. var a = Math.pow(g, n) / g,
  27059. s = r % a,
  27060. l = o % a,
  27061. c = Math.floor(o / a),
  27062. h = Math.floor(r / a),
  27063. u = c * g + h
  27064. return e(t.children[u], i + 1, n - 1, s, l)
  27065. })(this.root, 0, n, t, i)
  27066. }),
  27067. (f.prototype.breadthFirst = function (e) {
  27068. var t = !!(e = e || {}).nullLevelEnd,
  27069. i = e.maxLevel,
  27070. n = e.minLevel,
  27071. r = e.callback,
  27072. o = e.saveVisited,
  27073. a = [],
  27074. s = {},
  27075. l = 0
  27076. for (a.push(this.root), a.push(s); 0 < a.length && !(i && i < l); ) {
  27077. var c = a.shift()
  27078. if (c === s) (!n || n <= l) && (r && t && r(null), o && t && o.push(null)), 0 < a.length && a.push(s), l++, 0
  27079. else {
  27080. if (c.children)
  27081. for (var h = 0; h < c.children.length; h++) {
  27082. c.children[h] && a.push(c.children[h])
  27083. }
  27084. var u = this.getFaceIndexFromNode(c)
  27085. ;(!n || n <= l) && (r && r(c, l, u), o && o.push(c)), 0
  27086. }
  27087. }
  27088. }),
  27089. (f.prototype.getFaceIndexFromNode = function (e) {
  27090. if (!e) return -1
  27091. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  27092. var o = i.parent
  27093. if (!o) break
  27094. for (var a = -1, s = 0; s < o.children.length; s++) o.children[s] === i && (a = s)
  27095. ;(n = (a % g) * t + n), (r = Math.floor(a / g) * t + r), (t *= g), (i = o)
  27096. }
  27097. return r * t + n
  27098. }),
  27099. (f.prototype.depthFirst = function (e, t, i) {
  27100. !(function e(t, i, n, r, o, a, s, l) {
  27101. if (t) {
  27102. s = s || f.TraversalType.PreOrder
  27103. var c = r * g + n
  27104. if ((s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r), a && a.push(t)), t.children && 0 !== t.children.length)) {
  27105. for (var h = r * g, u = n * g, d = 0; d < g; d++) for (var p = 0; p < g; p++) e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l)
  27106. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r), a && a.push(t))
  27107. }
  27108. }
  27109. })(this.root, 0, 0, 0, e, t, i, this.tileSize)
  27110. }),
  27111. (t.exports = f)
  27112. },
  27113. {
  27114. '../objects/Panorama': 148,
  27115. '../util/panorama': 191,
  27116. './TileUtils': 174,
  27117. events: 202,
  27118. three: 217
  27119. }
  27120. ],
  27121. 174: [
  27122. function (e, t, i) {
  27123. 'use strict'
  27124. var n,
  27125. a,
  27126. s,
  27127. p,
  27128. f,
  27129. g,
  27130. E,
  27131. l,
  27132. c,
  27133. h,
  27134. u,
  27135. d,
  27136. r,
  27137. o,
  27138. m = e('../enum/GLCubeFaces'),
  27139. _ = e('../util/MathLight'),
  27140. b = {}
  27141. ;(b.TILE_SIZE = 512),
  27142. (b.FACES_PER_PANO = 6),
  27143. (b.LocationOnTile = {
  27144. Center: 0,
  27145. UpperLeft: 1,
  27146. UpperRight: 2,
  27147. LowerRight: 3,
  27148. LowerLeft: 4
  27149. }),
  27150. (b.getTileVector = function (e, t, i, n, r, o, a, s) {
  27151. var l = e / t,
  27152. c = (t / e) * 2,
  27153. h = c / 2,
  27154. u = (n / l) * 2 - 1 + h,
  27155. d = ((r = l - 1 - r) / l) * 2 - 1 + h
  27156. switch ((o = o || b.LocationOnTile.Center)) {
  27157. case b.LocationOnTile.UpperLeft:
  27158. ;(u -= h), (d += h), (u += a * c)
  27159. break
  27160. case b.LocationOnTile.UpperRight:
  27161. ;(u += h), (d += h), (d -= a * c)
  27162. break
  27163. case b.LocationOnTile.LowerRight:
  27164. ;(u += h), (d -= h), (u -= a * c)
  27165. break
  27166. case b.LocationOnTile.LowerLeft:
  27167. ;(u -= h), (d -= h), (d += a * c)
  27168. break
  27169. case b.LocationOnTile.Center:
  27170. }
  27171. switch (i) {
  27172. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  27173. _.setVector(s, -1, d, -u)
  27174. break
  27175. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  27176. _.setVector(s, 1, d, u)
  27177. break
  27178. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  27179. _.setVector(s, -u, 1, -d)
  27180. break
  27181. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  27182. _.setVector(s, -u, -1, d)
  27183. break
  27184. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  27185. _.setVector(s, -u, d, 1)
  27186. break
  27187. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  27188. _.setVector(s, u, d, -1)
  27189. }
  27190. _.normalize(s)
  27191. }),
  27192. (b.getFaceForTile = function (e, t) {
  27193. var i = b.TILE_SIZE
  27194. e < b.TILE_SIZE && (i = e)
  27195. var n = Math.floor(e / i),
  27196. r = n * n
  27197. return Math.floor(t / r)
  27198. }),
  27199. (b.getTileLocation = function (e, t, i) {
  27200. var n = b.TILE_SIZE
  27201. e < b.TILE_SIZE && (n = e)
  27202. var r = b.getFaceForTile(e, t),
  27203. o = Math.floor(e / n),
  27204. a = t - r * (o * o)
  27205. ;(i.tileX = a % o), (i.tileY = Math.floor(a / o)), (i.face = r), (i.faceTileIndex = a)
  27206. }),
  27207. (b.getTileCountForSize = function (e) {
  27208. if (e <= b.TILE_SIZE) return b.FACES_PER_PANO
  27209. var t = Math.floor(e / b.TILE_SIZE)
  27210. return t * t * b.FACES_PER_PANO
  27211. }),
  27212. (b.getRelativeDirection =
  27213. ((r = new _.Matrix4()),
  27214. (o = new _.Quaternion()),
  27215. function (e, t) {
  27216. o.copy(e), o.inverse(), r.makeRotationFromQuaternion(o), r.applyToVector3(t), _.normalize(t)
  27217. })),
  27218. (b.matchingTilesInDirection =
  27219. ((c = new _.Vector3()),
  27220. (h = new _.Vector3(0, 0, -1)),
  27221. (u = new _.Quaternion()),
  27222. (l = {
  27223. face: -1,
  27224. faceTileIndex: -1,
  27225. tileX: -1,
  27226. tileY: -1
  27227. }),
  27228. (d = function (e, t, i) {
  27229. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  27230. b.getTileLocation(e, o, l),
  27231. (t && !t(l)) ||
  27232. (r++,
  27233. i &&
  27234. ((a = l),
  27235. i.push({
  27236. face: a.face,
  27237. faceTileIndex: a.faceTileIndex,
  27238. tileX: a.tileX,
  27239. tileY: a.tileY
  27240. })))
  27241. var a
  27242. return r
  27243. }),
  27244. function (e, t, i, n, r, o) {
  27245. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE
  27246. if ((b.getTileCountForSize(t), !n && !r)) return d(t, null, o)
  27247. var s = !!r
  27248. return (
  27249. (r = r || n),
  27250. (r = Math.max(0, Math.min(r, 360))),
  27251. (n = Math.max(0, Math.min(n, 360))),
  27252. _.copyVector(i, c),
  27253. b.getRelativeDirection(e.quaternion, c),
  27254. s
  27255. ? (u.setFromUnitVectors(c, h),
  27256. d(
  27257. t,
  27258. function (e) {
  27259. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  27260. },
  27261. o
  27262. ))
  27263. : d(
  27264. t,
  27265. function (e) {
  27266. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  27267. },
  27268. o
  27269. )
  27270. )
  27271. })),
  27272. (b.isTileWithinFrustum =
  27273. ((E = new _.Vector3()),
  27274. function (e, t, i, n, r, o, a, s) {
  27275. for (
  27276. var l = Math.tan(0.5 * s * _.RADIANS_PER_DEGREE),
  27277. c = -l,
  27278. h = Math.tan(0.5 * a * _.RADIANS_PER_DEGREE),
  27279. u = -h,
  27280. d = b.mapFaceToCubemapFace(i),
  27281. p = 0,
  27282. f = 0,
  27283. g = 0,
  27284. m = 0,
  27285. v = 0,
  27286. y = b.LocationOnTile.Center;
  27287. y <= b.LocationOnTile.LowerLeft;
  27288. y++
  27289. )
  27290. if ((b.getTileVector(e, t, d, n, r, y, 0, E), _.applyQuaternionToVector(o, E), -1e-5 <= E.z));
  27291. else {
  27292. var A = -1 / E.z,
  27293. C = E.x * A,
  27294. I = E.y * A
  27295. l < I ? p++ : I < c && f++, h < C ? g++ : C < u && m++, v++
  27296. }
  27297. return f !== v && p !== v && g !== v && m !== v
  27298. })),
  27299. (b.isTileWithinFOV =
  27300. ((p = new _.Vector3()),
  27301. (f = new _.Vector3(0, 1, 0)),
  27302. (g = new _.Vector3(1, 0, 0)),
  27303. function (e, t, i, n, r, o, a) {
  27304. var s = b.mapFaceToCubemapFace(i)
  27305. if ((_.cross(o, f, g), b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p), b.isWithinFOV(p, o, a, null))) return !0
  27306. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  27307. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++) if ((b.getTileVector(e, t, s, n, r, d, h, p), b.isWithinFOV(p, o, a, null))) return !0
  27308. h += l
  27309. }
  27310. return !1
  27311. })),
  27312. (b.isWithinFOV =
  27313. ((a = new _.Vector3()),
  27314. (s = new _.Vector3()),
  27315. function (e, t, i, n) {
  27316. if ((_.copyVector(e, s), n)) {
  27317. _.copyVector(n, a), _.normalize(a)
  27318. var r = _.dot(a, e)
  27319. ;(a.x *= r), (a.y *= r), (a.z *= r), _.subVector(s, a)
  27320. }
  27321. var o = (i / 2) * _.RADIANS_PER_DEGREE
  27322. return Math.cos(o) <= _.dot(s, t)
  27323. })),
  27324. (b.mapFaceToCubemapFace =
  27325. ((n = {
  27326. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  27327. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  27328. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  27329. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  27330. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  27331. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  27332. }),
  27333. function (e) {
  27334. return n[e]
  27335. })),
  27336. (t.exports = b)
  27337. },
  27338. {
  27339. '../enum/GLCubeFaces': 25,
  27340. '../util/MathLight': 176
  27341. }
  27342. ],
  27343. 175: [
  27344. function (i, n, e) {
  27345. ;(function (e) {
  27346. 'use strict'
  27347. function t() {
  27348. ;(this.list = []),
  27349. (this.index = {}),
  27350. Object.defineProperty(this, 'length', {
  27351. get: function () {
  27352. return this.list.length
  27353. }
  27354. })
  27355. }
  27356. new (i('./common'), i('./logger'))(e),
  27357. (t.prototype.forEach = function (e) {
  27358. this.list.forEach(e)
  27359. }),
  27360. (t.prototype.add = function (e) {
  27361. this.list.push(e), (this.index[this.getIndex(e)] = e)
  27362. }),
  27363. (t.prototype.getIndex = function (e) {
  27364. throw new Error('IndexedCollection.getIndex not implemented in subclass.')
  27365. }),
  27366. (t.prototype.extend = function (e) {
  27367. for (var t = 0; t < e.length; t++) this.add(e[t])
  27368. }),
  27369. (t.prototype.get = function (e) {
  27370. return this.index[e]
  27371. }),
  27372. (t.prototype.first = function () {
  27373. return this.list[0]
  27374. }),
  27375. (t.prototype.last = function () {
  27376. return this.list[this.list.length - 1]
  27377. }),
  27378. (t.prototype.reIndex = function () {
  27379. this.index = {}
  27380. var t = this
  27381. this.forEach(function (e) {
  27382. t.index[t.getIndex(e)] = e
  27383. })
  27384. }),
  27385. (t.prototype.filter = function (e) {
  27386. var t = this.list.filter(e)
  27387. return this.reIndex(), t
  27388. }),
  27389. (t.prototype.reduce = function (e, t) {
  27390. return this.list.reduce(e, t)
  27391. }),
  27392. (t.prototype.sort = function (e) {
  27393. return this.list.sort(e)
  27394. }),
  27395. (t.prototype.indexOf = function (e) {
  27396. for (var t = 0; t < this.list.length; ++t) if (this.list[t] === e) return t
  27397. return -1
  27398. }),
  27399. (n.exports = t)
  27400. }).call(this, '/js/util/IndexedCollection.js')
  27401. },
  27402. {
  27403. './common': 185,
  27404. './logger': 189
  27405. }
  27406. ],
  27407. 176: [
  27408. function (e, t, i) {
  27409. 'use strict'
  27410. e('../constants')
  27411. var n,
  27412. r,
  27413. o = {}
  27414. ;(o.RADIANS_PER_DEGREE = Math.PI / 180),
  27415. (o.DEGREES_PER_RADIAN = 180 / Math.PI),
  27416. (o.Vector3 = function (e, t, i) {
  27417. ;(this.x = e || 0), (this.y = t || 0), (this.z = i || 0)
  27418. }),
  27419. (o.Matrix4 = function () {
  27420. ;(this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])),
  27421. 0 < arguments.length && console.error('MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.')
  27422. }),
  27423. (o.Matrix4.prototype = {
  27424. identity: function () {
  27425. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  27426. },
  27427. copy: function (e) {
  27428. return this.elements.set(e.elements), this
  27429. },
  27430. applyToVector3: function (e) {
  27431. var t = e.x,
  27432. i = e.y,
  27433. n = e.z,
  27434. r = this.elements
  27435. return (e.x = r[0] * t + r[4] * i + r[8] * n + r[12]), (e.y = r[1] * t + r[5] * i + r[9] * n + r[13]), (e.z = r[2] * t + r[6] * i + r[10] * n + r[14]), this
  27436. },
  27437. getInverse: function (e, t) {
  27438. var i = this.elements,
  27439. n = e.elements,
  27440. r = n[0],
  27441. o = n[1],
  27442. a = n[2],
  27443. s = n[3],
  27444. l = n[4],
  27445. c = n[5],
  27446. h = n[6],
  27447. u = n[7],
  27448. d = n[8],
  27449. p = n[9],
  27450. f = n[10],
  27451. g = n[11],
  27452. m = n[12],
  27453. v = n[13],
  27454. y = n[14],
  27455. A = n[15],
  27456. C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A,
  27457. I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A,
  27458. E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A,
  27459. _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y,
  27460. b = r * C + o * I + a * E + s * _
  27461. if (0 == b) {
  27462. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0"
  27463. if (t) throw new Error(w)
  27464. return console.warn(w), this.identity()
  27465. }
  27466. var T = 1 / b
  27467. return (
  27468. (i[0] = C * T),
  27469. (i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T),
  27470. (i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T),
  27471. (i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T),
  27472. (i[4] = I * T),
  27473. (i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T),
  27474. (i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T),
  27475. (i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T),
  27476. (i[8] = E * T),
  27477. (i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T),
  27478. (i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T),
  27479. (i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T),
  27480. (i[12] = _ * T),
  27481. (i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T),
  27482. (i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T),
  27483. (i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T),
  27484. this
  27485. )
  27486. },
  27487. makeRotationFromQuaternion: function (e) {
  27488. var t = this.elements,
  27489. i = e.x,
  27490. n = e.y,
  27491. r = e.z,
  27492. o = e.w,
  27493. a = i + i,
  27494. s = n + n,
  27495. l = r + r,
  27496. c = i * a,
  27497. h = i * s,
  27498. u = i * l,
  27499. d = n * s,
  27500. p = n * l,
  27501. f = r * l,
  27502. g = o * a,
  27503. m = o * s,
  27504. v = o * l
  27505. return (
  27506. (t[0] = 1 - (d + f)),
  27507. (t[4] = h - v),
  27508. (t[8] = u + m),
  27509. (t[1] = h + v),
  27510. (t[5] = 1 - (c + f)),
  27511. (t[9] = p - g),
  27512. (t[2] = u - m),
  27513. (t[6] = p + g),
  27514. (t[10] = 1 - (c + d)),
  27515. (t[3] = 0),
  27516. (t[7] = 0),
  27517. (t[11] = 0),
  27518. (t[12] = 0),
  27519. (t[13] = 0),
  27520. (t[14] = 0),
  27521. (t[15] = 1),
  27522. this
  27523. )
  27524. }
  27525. }),
  27526. (o.Quaternion = function (e, t, i, n) {
  27527. ;(this._x = e || 0), (this._y = t || 0), (this._z = i || 0), (this._w = void 0 !== n ? n : 1)
  27528. }),
  27529. (o.Quaternion.prototype = {
  27530. get x() {
  27531. return this._x
  27532. },
  27533. set x(e) {
  27534. this._x = e
  27535. },
  27536. get y() {
  27537. return this._y
  27538. },
  27539. set y(e) {
  27540. this._y = e
  27541. },
  27542. get z() {
  27543. return this._z
  27544. },
  27545. set z(e) {
  27546. this._z = e
  27547. },
  27548. get w() {
  27549. return this._w
  27550. },
  27551. set w(e) {
  27552. this._w = e
  27553. },
  27554. copy: function (e) {
  27555. ;(this._x = e.x), (this._y = e.y), (this._z = e.z), (this._w = e.w)
  27556. },
  27557. inverse: function () {
  27558. return this.conjugate().normalize()
  27559. },
  27560. conjugate: function () {
  27561. return (this._x *= -1), (this._y *= -1), (this._z *= -1), this
  27562. },
  27563. length: function () {
  27564. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27565. },
  27566. normalize: function () {
  27567. var e = this.length()
  27568. return (
  27569. 0 === e
  27570. ? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1))
  27571. : ((e = 1 / e), (this._x = this._x * e), (this._y = this._y * e), (this._z = this._z * e), (this._w = this._w * e)),
  27572. this
  27573. )
  27574. },
  27575. setFromAxisAngle: function (e, t) {
  27576. var i = t / 2,
  27577. n = Math.sin(i)
  27578. return (this._x = e.x * n), (this._y = e.y * n), (this._z = e.z * n), (this._w = Math.cos(i)), this
  27579. },
  27580. setFromUnitVectors: function (e, t) {
  27581. return (
  27582. void 0 === n && (n = new o.Vector3()),
  27583. (r = o.dot(e, t) + 1) < 1e-6 ? ((r = 0), Math.abs(e.x) > Math.abs(e.z) ? o.setVector(n, -e.y, e.x, 0) : o.setVector(n, 0, -e.z, e.y)) : o.cross(e, t, n),
  27584. (this._x = n.x),
  27585. (this._y = n.y),
  27586. (this._z = n.z),
  27587. (this._w = r),
  27588. this.normalize()
  27589. )
  27590. },
  27591. multiply: function (e) {
  27592. return this.multiplyQuaternions(this, e)
  27593. },
  27594. premultiply: function (e) {
  27595. return this.multiplyQuaternions(e, this)
  27596. },
  27597. multiplyQuaternions: function (e, t) {
  27598. var i = e._x,
  27599. n = e._y,
  27600. r = e._z,
  27601. o = e._w,
  27602. a = t._x,
  27603. s = t._y,
  27604. l = t._z,
  27605. c = t._w
  27606. return (this._x = i * c + o * a + n * l - r * s), (this._y = n * c + o * s + r * a - i * l), (this._z = r * c + o * l + i * s - n * a), (this._w = o * c - i * a - n * s - r * l), this
  27607. }
  27608. }),
  27609. (o.convertWorkshopVector = function (e) {
  27610. return new o.Vector3(-e.x, e.y, e.z)
  27611. }),
  27612. (o.convertWorkshopQuaternion = function (e) {
  27613. return new o.Quaternion(-e.x, e.y, e.z, -e.w).multiply(new o.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0))
  27614. }),
  27615. (o.convertWorkshopOrthoZoom = function (e) {
  27616. return -1 === e ? -1 : ((e * ($('#player').width() / $('#player').height())) / g_snapShotWidth) * g_snapShotHeight
  27617. }),
  27618. (o.convertWorkshopPanoramaQuaternion = function (e) {
  27619. return new o.Quaternion(e.x, -e.y, -e.z, e.w).normalize().multiply(new o.Quaternion().setFromAxisAngle(new o.Vector3(0, 1, 0), 270 * o.RADIANS_PER_DEGREE))
  27620. }),
  27621. (o.normalize = function (e) {
  27622. var t = e.x * e.x + e.y * e.y + e.z * e.z,
  27623. i = Math.sqrt(t)
  27624. ;(e.x /= i), (e.y /= i), (e.z /= i)
  27625. }),
  27626. (o.dot = function (e, t) {
  27627. return e.x * t.x + e.y * t.y + e.z * t.z
  27628. }),
  27629. (o.cross = function (e, t, i) {
  27630. var n = e.x,
  27631. r = e.y,
  27632. o = e.z
  27633. ;(i.x = r * t.z - o * t.y), (i.y = o * t.x - n * t.z), (i.z = n * t.y - r * t.x)
  27634. }),
  27635. (o.setVector = function (e, t, i, n) {
  27636. ;(e.x = t), (e.y = i), (e.z = n)
  27637. }),
  27638. (o.copyVector = function (e, t) {
  27639. ;(t.x = e.x), (t.y = e.y), (t.z = e.z)
  27640. }),
  27641. (o.addVector = function (e, t) {
  27642. ;(e.x += t.x), (e.y += t.y), (e.z += t.z)
  27643. }),
  27644. (o.subVector = function (e, t) {
  27645. ;(e.x -= t.x), (e.y -= t.y), (e.z -= t.z)
  27646. }),
  27647. (o.applyQuaternionToVector = function (e, t) {
  27648. var i = t.x,
  27649. n = t.y,
  27650. r = t.z,
  27651. o = e.x,
  27652. a = e.y,
  27653. s = e.z,
  27654. l = e.w,
  27655. c = l * i + a * r - s * n,
  27656. h = l * n + s * i - o * r,
  27657. u = l * r + o * n - a * i,
  27658. d = -o * i - a * n - s * r
  27659. ;(t.x = c * l + d * -o + h * -s - u * -a), (t.y = h * l + d * -a + u * -o - c * -s), (t.z = u * l + d * -s + c * -a - h * -o)
  27660. }),
  27661. (o.angleBetweenVectors = function (e, t) {
  27662. return Math.acos(o.dot(e, t))
  27663. }),
  27664. (t.exports = o)
  27665. },
  27666. {
  27667. '../constants': 8
  27668. }
  27669. ],
  27670. 177: [
  27671. function (c, h, e) {
  27672. ;(function (e) {
  27673. 'use strict'
  27674. function t(e) {
  27675. ;(this.cache = null), (this.expires = 0)
  27676. }
  27677. function i() {
  27678. ;(this.baseUrl = null), (this.cache = null), (this.expires = 0)
  27679. }
  27680. function n() {
  27681. ;(this.baseUrl = null), (this.expires = 0)
  27682. }
  27683. function r(e) {
  27684. ;(this.initialLoadingPromise = null),
  27685. (this.endpoint = e + '?type=3'),
  27686. (this.urlContainer = null),
  27687. (this.authorizationHeader = s.getAuthorizationHeader()),
  27688. (this.containerClasses = [n, i, t])
  27689. }
  27690. c('./ajax')
  27691. var o = c('./logger'),
  27692. a = c('../constants'),
  27693. s = c('./showcase'),
  27694. l = (c('../ab'), new o(e))
  27695. ;(t.prototype = {
  27696. version: 1,
  27697. validate: function (e) {
  27698. return 'catalog.json' in e && 0 < Object.keys(e).length
  27699. },
  27700. update: function (e) {
  27701. return (this.cache = e), (this.expires = Date.now() + a.signedUrlDefaultExpireTime), $.when()
  27702. },
  27703. get: function (e) {
  27704. return this.cache[e]
  27705. }
  27706. }),
  27707. (i.prototype = {
  27708. version: 2,
  27709. validate: function (e) {
  27710. return 'catalog.json' in e && 'base.url' in e && 1 < Object.keys(e).length
  27711. },
  27712. update: function (e) {
  27713. return (this.baseUrl = e['base.url']), (this.cache = e), (this.expires = Date.now() + a.signedUrlDefaultExpireTime), $.when()
  27714. },
  27715. get: function (e) {
  27716. var t = this.cache[e]
  27717. return t ? this.baseUrl.replace('{{filename}}', e) + t : null
  27718. }
  27719. }),
  27720. (n.prototype = {
  27721. version: 3,
  27722. validate: function (e) {
  27723. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27724. },
  27725. update: function (e) {
  27726. return (this.baseUrl = e.templates[0]), e.expires ? (this.expires = 1e3 * e.expires) : (this.expires = Date.now() + a.signedUrlDefaultExpireTime), $.when()
  27727. },
  27728. get: function (e) {
  27729. return this.baseUrl.replace('{{filename}}', e)
  27730. }
  27731. }),
  27732. (r.prototype = {
  27733. init: function () {
  27734. return (
  27735. this.initialLoadingPromise ||
  27736. (setInterval(
  27737. function () {
  27738. var e = this.urlContainer ? this.urlContainer.expires : Date.now()
  27739. Date.now() + a.signedUrlRefreshBuffer > e &&
  27740. (l.debug('Refreshing urls...'),
  27741. this.refresh()
  27742. .done(function () {
  27743. l.debug('Refreshed')
  27744. })
  27745. .fail(function () {
  27746. l.error('Failed url refresh, urls might go stale soon')
  27747. }))
  27748. }.bind(this),
  27749. a.signedUrlCheckInterval
  27750. ),
  27751. (this.initialLoadingPromise = this.refresh())),
  27752. this.initialLoadingPromise
  27753. )
  27754. },
  27755. refresh: function (e) {
  27756. return {}, $.Deferred().resolve()
  27757. },
  27758. get: function (e) {
  27759. return window.DATA.files.templates[0].replace('{{filename}}', e)
  27760. }
  27761. }),
  27762. (h.exports = r)
  27763. }).call(this, '/js/util/ModelUrls.js')
  27764. },
  27765. {
  27766. '../ab': 3,
  27767. '../constants': 8,
  27768. './ajax': 181,
  27769. './logger': 189,
  27770. './showcase': 193
  27771. }
  27772. ],
  27773. 178: [
  27774. function (l, c, e) {
  27775. ;(function (e) {
  27776. 'use strict'
  27777. function t() {
  27778. i.call(this), (this.neighbourMap = {}), (this.map = null)
  27779. }
  27780. var f,
  27781. g,
  27782. m,
  27783. v,
  27784. y,
  27785. A,
  27786. C,
  27787. I,
  27788. E,
  27789. _,
  27790. b,
  27791. w = l('three'),
  27792. n = l('./common'),
  27793. a = l('../settings'),
  27794. r = l('../objects/Panorama'),
  27795. o = ((a = l('../settings')), l('./aStar')),
  27796. T = new (l('./logger'))(e),
  27797. i = l('./IndexedCollection'),
  27798. s = l('./transitions')
  27799. n.inherit(t, i),
  27800. (t.prototype.getIndex = function (e) {
  27801. return e.id
  27802. }),
  27803. (t.prototype.find = function (e, t) {
  27804. var i = n.filterAll(this.list, e)
  27805. return 0 === i.length
  27806. ? null
  27807. : (t &&
  27808. t.forEach(function (e) {
  27809. i = n.stableSort(i, e)
  27810. }),
  27811. i[0])
  27812. }),
  27813. /* t.prototype.sortByScore = function(e, t) {
  27814. var i = n.filterAll(this.list, e);
  27815. return 0 === i.length ? null : i = i.map(function(i) {
  27816. return {
  27817. pano: i,
  27818. score: t.reduce(function(e, t) {
  27819. return e + t(i)
  27820. }, 0)
  27821. }
  27822. }).sort(function(e, t) {
  27823. return t.score - e.score
  27824. })
  27825. } */
  27826. (t.prototype.sortByScore = function (request, rank) {
  27827. return common.sortByScore(this.list, request, rank)
  27828. }),
  27829. (t.prototype.lowestByScore = function (e, t, i) {
  27830. return this.findRankedByScore(0, e, t, i)
  27831. }),
  27832. (t.prototype.findRankedByScore = function (e, t, i, n) {
  27833. n && ((n.candidates = null), (n.pano = null)), (e = e || 0)
  27834. var r = this.sortByScore(t, i)
  27835. return !r || 0 === r.length || e >= r.length ? null : (n && ((n.candidates = r), (n.pano = r[e].item)), r[e].item)
  27836. }),
  27837. (t.prototype.showPanoScores = function (e) {
  27838. this.list.forEach(function (e) {
  27839. e.removeTextSprite()
  27840. })
  27841. var t = 6344768
  27842. e.forEach(function (e) {
  27843. e.pano.addTextSprite(e.score.toFixed(2), t), (t = 16428055)
  27844. })
  27845. }),
  27846. (t.prototype.isNeighbour = function (e, t) {
  27847. return this.neighbourMap[e.id][t.id]
  27848. }),
  27849. (t.prototype.getNeighbours = function (e) {
  27850. return this.neighbourMap[e.id]
  27851. }),
  27852. (t.prototype.setNeighbour = function (e, t, i) {
  27853. return (
  27854. this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27855. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27856. (this.neighbourMap[e.id][e.id] = !0),
  27857. (this.neighbourMap[t.id][t.id] = !0),
  27858. (this.neighbourMap[e.id][t.id] = i),
  27859. (this.neighbourMap[t.id][e.id] = i),
  27860. this.neighbourMap[e.id]
  27861. )
  27862. }),
  27863. (t.prototype.findClosest = function (e, t) {
  27864. var i = [r.filters.isPanoAligned()]
  27865. return t && i.push(r.filters.inDirection(e, t, 0.75)), this.find(i, [r.sortFunctions.distanceToPoint(e)])
  27866. }),
  27867. (t.prototype.dualNeighbors = function (e, t) {
  27868. var i,
  27869. n = []
  27870. for (i in this.neighbourMap[e.id]) this.neighbourMap[t.id][i] && n.push(i)
  27871. return n
  27872. }),
  27873. (t.prototype.populate_path_graph = function () {
  27874. var e,
  27875. t,
  27876. i,
  27877. n,
  27878. r,
  27879. o,
  27880. a,
  27881. s,
  27882. l = Date.now(),
  27883. c = {},
  27884. h = 0,
  27885. u = new w.Vector3(0, 0, 0)
  27886. for (e = 0; e < this.list.length; e += 1) {
  27887. for (t in ((s = !(a = {})), (i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())))
  27888. if (i[t]) {
  27889. ;(o = this.index[t]), u.copy(r.floorPosition), u.sub(o.floorPosition)
  27890. var d = Math.sqrt(u.x * u.x + u.z * u.z),
  27891. p = (Math.abs(u.y), Math.max(d, 0.01), Math.max(0, Math.abs(u.y) - 0.2))
  27892. ;(n = 0 < p ? (1, (p = Math.pow(4 * p, 2)), (d = Math.pow(d, 2)), Math.sqrt(p * p + d * d)) : (1, u.length())), (a[o.id] = n), (s = !0)
  27893. }
  27894. s ? (c[r.id] = a) : (h += 1)
  27895. }
  27896. ;(this.map = c), T.info('graph ready in ' + (Date.now() - l) + 'ms, ' + h + ' had no neighbors')
  27897. }),
  27898. (t.prototype.aStarSearch = function (e, t) {
  27899. var i = Date.now(),
  27900. n = new o({
  27901. start: e,
  27902. isEnd: function (e) {
  27903. return e === t
  27904. },
  27905. neighbor: function (e) {
  27906. var t = e.neighbourPanos || e.findNeighourPanos(),
  27907. i = []
  27908. for (var n in t) t[n] && i.push(this.index[n]) //add: t[n] &&
  27909. return i
  27910. }.bind(this),
  27911. distance: function (e, t) {
  27912. return this.map[e.id][t.id]
  27913. }.bind(this),
  27914. heuristic: function (e, t) {
  27915. return 1
  27916. }.bind(this),
  27917. hash: function (e) {
  27918. return e.id
  27919. },
  27920. timeout: 5e3
  27921. })
  27922. if ((T.debug('A* search in ' + (Date.now() - i) + 'ms'), 'success' !== n.status)) return T.debug('Did not find A* path from ' + e + ' to ' + t), null
  27923. T.debug('Total cost ' + n.cost.toPrecision(3) + ', ' + n.path.length + ' steps')
  27924. var r = []
  27925. return (
  27926. n.path.forEach(function (e) {
  27927. r.push(e.id)
  27928. }),
  27929. r
  27930. )
  27931. }),
  27932. (t.prototype.includeNodesNearPath =
  27933. ((f = new w.Vector3()),
  27934. (g = new w.Vector3()),
  27935. (m = new w.Vector3()),
  27936. (v = new w.Vector3()),
  27937. (y = new w.Vector3()),
  27938. (A = new w.Vector3()),
  27939. (C = new w.Vector3()),
  27940. (I = new w.Vector3()),
  27941. (E = []),
  27942. (_ = new w.Vector3()),
  27943. (b = new w.Vector3()),
  27944. function (e, t) {
  27945. if (e)
  27946. for (
  27947. var i = function (e, t, i) {
  27948. return y.copy(t).sub(e), y.dot(i)
  27949. },
  27950. n = function (e, t) {
  27951. return i(_, e.position, m) - i(_, t.position, m)
  27952. },
  27953. r = 0;
  27954. r < e.length - 1;
  27955. ) {
  27956. var o = e[r],
  27957. a = e[r + 1],
  27958. s = this.index[o],
  27959. l = this.index[a]
  27960. _.copy(s.position), b.copy(l.position), (E.length = 0), f.copy(b).sub(_), m.copy(f).normalize()
  27961. for (var c = 0; c < this.list.length; c++) {
  27962. var h = this.list[c]
  27963. y.copy(h.position).sub(_)
  27964. var u = y.dot(m)
  27965. 0 < u &&
  27966. (C.copy(m), C.multiplyScalar(u), A.copy(y), A.sub(C), A.length() < t && (g.copy(f).negate(), v.copy(g).normalize(), I.copy(h.position).sub(b), 0 < I.dot(v) && E.push(h)))
  27967. }
  27968. if (0 < E.length) {
  27969. E.sort(n)
  27970. for (var d = e.length + E.length - 1; d >= r + E.length; d--) e[d] = e[d - E.length]
  27971. for (var p = 0; p < E.length; p++) e[p + r + 1] = E[p].id
  27972. }
  27973. r += E.length + 1
  27974. }
  27975. })),
  27976. /* t.prototype.fadeMarkerOpacity = function(e, t) {
  27977. var i = void 0 === e ? a.panorama.markerOpacity : e
  27978. , n = this.list.findIndex(function(e) {
  27979. return e.marker
  27980. });
  27981. if (!(n < 0)) {
  27982. var r = this.list[n].marker.material.opacity;
  27983. if (r !== e) {
  27984. var o = i - r;
  27985. s.trigger({
  27986. func: function(e, t) {
  27987. var i = r + e * o;
  27988. this.forEach(function(e) {
  27989. e.marker && (e.marker.material.opacity = i)
  27990. })
  27991. }
  27992. .bind(this),
  27993. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  27994. name: "_fpm"
  27995. })
  27996. }
  27997. }
  27998. } */
  27999. (t.prototype.fadeMarkerOpacity = function (e, t, gr) {
  28000. s.cancelById('fadeMarkerOpacity')
  28001. var n = this.list.findIndex(function (e) {
  28002. //why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  28003. return e.marker
  28004. })
  28005. if (n < 0) {
  28006. //logger.info('marker findIndex<0')
  28007. return
  28008. }
  28009. var group
  28010. var tran = function (list, index) {
  28011. list.member = list.member.filter(function (m) {
  28012. return m.marker && m.marker.material.opacity != list.toOp
  28013. })
  28014. s.trigger({
  28015. func: function (e, t) {
  28016. //e:0-1
  28017. list.member.forEach(function (m) {
  28018. var o = m.marker.oldOpacity
  28019. var i = o + e * (list.toOp - o)
  28020. m.marker && (m.marker.material.opacity = i)
  28021. })
  28022. }.bind(this),
  28023. duration: void 0 == t ? a.markerOpacityTransitionTime : t,
  28024. name: '_fpm_' + index,
  28025. id: 'fadeMarkerOpacity'
  28026. })
  28027. }
  28028. this.forEach(function (e) {
  28029. //先记录旧的opacity
  28030. e.marker && (e.marker.oldOpacity = e.marker.material.opacity)
  28031. })
  28032. group = gr
  28033. /* if (e > 0 && gr) {
  28034. group = gr
  28035. } else {
  28036. group = [
  28037. {
  28038. member: this.list,
  28039. toOp: 0,
  28040. },
  28041. ]
  28042. } */
  28043. for (var i = 0; i < group.length; i++) {
  28044. tran(group[i], i)
  28045. }
  28046. }),
  28047. (c.exports = t)
  28048. }).call(this, '/js/util/PanoramaCollection.js')
  28049. },
  28050. {
  28051. '../objects/Panorama': 148,
  28052. '../settings': 166,
  28053. './IndexedCollection': 175,
  28054. './aStar': 180,
  28055. './common': 185,
  28056. './logger': 189,
  28057. './transitions': 195,
  28058. three: 217
  28059. }
  28060. ],
  28061. 179: [
  28062. function (e, t, i) {
  28063. 'use strict'
  28064. function n() {
  28065. ;(this.actionSequence = []), (this.actionSequenceInProgress = !1)
  28066. }
  28067. function r(e, t, i, n) {
  28068. c.trackAlways('zoom_' + e, {
  28069. from: t,
  28070. to: i,
  28071. pano: n
  28072. })
  28073. }
  28074. var o,
  28075. a,
  28076. s,
  28077. l,
  28078. c = e('../analytics')
  28079. ;(n.prototype.reset = function (e) {
  28080. ;(this.actionSequenceInProgress = !1), (this.actionSequence.length = 0)
  28081. }),
  28082. (n.prototype.addZoomAction =
  28083. ((a = o = null),
  28084. (s = !1),
  28085. (l = function () {
  28086. if (((o = null), 0 < this.actionSequence.length)) {
  28087. var e = this.actionSequence[0].start,
  28088. t = this.actionSequence[this.actionSequence.length - 1].end
  28089. 1 === e
  28090. ? (function (e, t) {
  28091. r('initial', 1, e, t)
  28092. })(t, a)
  28093. : (function (e, t, i) {
  28094. r('followup', e, t, i)
  28095. })(e, t, a)
  28096. }
  28097. this.reset()
  28098. }),
  28099. function (e, t, i) {
  28100. if (e !== t) {
  28101. s || ((l = l.bind(this)), (s = !0)),
  28102. o && (window.clearTimeout(o), (o = null)),
  28103. (i === a && this.actionSequenceInProgress) || (this.reset(), (a = i)),
  28104. (this.actionSequenceInProgress = !0)
  28105. var n = {
  28106. start: e,
  28107. end: t
  28108. }
  28109. this.actionSequence.push(n), (o = window.setTimeout(l, 150))
  28110. }
  28111. })),
  28112. (t.exports = n)
  28113. },
  28114. {
  28115. '../analytics': 4
  28116. }
  28117. ],
  28118. 180: [
  28119. function (e, t, i) {
  28120. 'use strict'
  28121. function g(e) {
  28122. if (void 0 === e.parent) return [e.data]
  28123. var t = g(e.parent)
  28124. return t.push(e.data), t
  28125. }
  28126. function m(e) {
  28127. return e.toString()
  28128. }
  28129. function v(e, t) {
  28130. return e.f - t.f
  28131. }
  28132. var y = e('Set'),
  28133. A = e('heap'),
  28134. C = e('dict')
  28135. t.exports = function (e) {
  28136. void 0 === e.timeout && (e.timeout = 1 / 0)
  28137. var t = e.hash || m,
  28138. i = {
  28139. data: e.start,
  28140. g: 0,
  28141. h: e.heuristic(e.start)
  28142. },
  28143. n = i
  28144. i.f = i.h
  28145. var r = new y(),
  28146. o = new A(v),
  28147. a = C()
  28148. o.push(i), a.set(t(i.data), i)
  28149. for (var s = new Date(); o.size(); ) {
  28150. if (new Date() - s > e.timeout)
  28151. return {
  28152. status: 'timeout',
  28153. cost: n.g,
  28154. path: g(n)
  28155. }
  28156. var l = o.pop()
  28157. if ((a.delete(t(l.data)), e.isEnd(l.data)))
  28158. return {
  28159. status: 'success',
  28160. cost: l.g,
  28161. path: g(l)
  28162. }
  28163. r.add(t(l.data))
  28164. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  28165. var u = c[h]
  28166. if (!r.contains(t(u))) {
  28167. var d = l.g + e.distance(l.data, u),
  28168. p = a.get(t(u)),
  28169. f = !1
  28170. if (void 0 === p)
  28171. (p = {
  28172. data: u
  28173. }),
  28174. a.set(t(u), p)
  28175. else {
  28176. if (p.g < d) continue
  28177. f = !0
  28178. }
  28179. ;(p.parent = l), (p.g = d), (p.h = e.heuristic(u)), (p.f = d + p.h), p.h < n.h && (n = p), f ? o.heapify() : o.push(p)
  28180. }
  28181. }
  28182. }
  28183. return {
  28184. status: 'noPath',
  28185. cost: n.g,
  28186. path: g(n)
  28187. }
  28188. }
  28189. },
  28190. {
  28191. Set: 196,
  28192. dict: 210,
  28193. heap: 211
  28194. }
  28195. ],
  28196. 181: [
  28197. function (i, n, e) {
  28198. ;(function (e) {
  28199. 'use strict'
  28200. function s(e, t, i) {
  28201. function n() {
  28202. l.warn('Retrying ', t), s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  28203. }
  28204. var r = (function (e, t, i) {
  28205. var n = new XMLHttpRequest()
  28206. if (i && 'withCredentials' in n) n.open(e, t, i)
  28207. else if ('undefined' != typeof XDomainRequest) (n = new XDomainRequest()).open(e, t)
  28208. else {
  28209. if (i) throw 'Browser does not support CORS!'
  28210. n.open(e, t)
  28211. }
  28212. return n
  28213. })(e, t, !1)
  28214. if ((((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0), (i.retry = void 0 !== i.retry ? i.retry : 'get' === e.toLowerCase()), i.responseType))
  28215. if (-1 < ['arraybuffer', 'text', 'json'].indexOf(i.responseType)) r.responseType = i.responseType
  28216. else {
  28217. if ('image/jpeg' !== i.responseType) throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"')
  28218. r.responseType = 'arraybuffer'
  28219. }
  28220. if (
  28221. ('json' === i.responseType && r.setRequestHeader('Accept', 'application/json'),
  28222. i.auth && r.setRequestHeader('Authorization', i.auth),
  28223. 'object' == typeof i.data && ((i.data = JSON.stringify(i.data)), r.setRequestHeader('Content-Type', 'application/json')),
  28224. 'object' == typeof i.headers)
  28225. )
  28226. for (var o in i.headers) r.setRequestHeader(o, i.headers[o])
  28227. var a = $.Deferred()
  28228. return (
  28229. (r.onreadystatechange = function (e) {
  28230. if (4 === this.readyState)
  28231. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3) i.retries++, setTimeout(n, 1e3)
  28232. else if (200 === this.status) {
  28233. var t = (function (e, t) {
  28234. var i = e.response
  28235. if ('json' === t && 'object' != typeof i)
  28236. try {
  28237. i = JSON.parse(e.responseText)
  28238. } catch (e) {
  28239. return void a.reject({
  28240. error: 'Failed parsing JSON'
  28241. })
  28242. }
  28243. else if ('image/jpeg' === t) {
  28244. var n = new Uint8Array(e.response),
  28245. r = new Blob([n], {
  28246. type: 'image/jpeg'
  28247. }),
  28248. o = URL.createObjectURL(r)
  28249. ;((i = new Image()).src = o),
  28250. (i.crossOrigin = 'Anonymous'),
  28251. (i.onload = function () {
  28252. URL.revokeObjectURL(o)
  28253. })
  28254. }
  28255. return i
  28256. })(this, i.responseType)
  28257. a.resolve(t)
  28258. } else a.reject(this)
  28259. }),
  28260. (r.onprogress = function (e) {
  28261. a.notify(e)
  28262. }),
  28263. r.send(i.data),
  28264. a.promise()
  28265. )
  28266. }
  28267. function o(e, t) {
  28268. var i = e + '__' + (t.responseType || null) + '__' + (t.auth || null) + '__' + (t.prefetchFrom || null)
  28269. return (
  28270. t.headers &&
  28271. (function (t) {
  28272. return Object.keys(t)
  28273. .sort()
  28274. .map(function (e) {
  28275. return {
  28276. key: e,
  28277. value: t[e]
  28278. }
  28279. })
  28280. })(t.headers).forEach(function (e) {
  28281. i += '__' + e.key + ':' + e.value
  28282. }),
  28283. i
  28284. )
  28285. }
  28286. var t = i('./logger'),
  28287. a = i('../ab'),
  28288. l = new t(e)
  28289. ;(window.URL = window.URL || window.webkitURL),
  28290. (window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {}),
  28291. (window.DATA = window.DATA || {}),
  28292. (n.exports = {
  28293. get: function (e, t) {
  28294. var i,
  28295. n = void 0 === (t = t || {}).cache || t.cache
  28296. if (n) {
  28297. var r = (function (e, t) {
  28298. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  28299. })(e, t)
  28300. if (r) return r
  28301. }
  28302. return (
  28303. (i = t.prefetchFrom && window.DATA[t.prefetchFrom] ? $.when(window.DATA[t.prefetchFrom]) : s('GET', e, t)),
  28304. n &&
  28305. (function (e, t, i) {
  28306. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  28307. })(e, t, i),
  28308. i
  28309. )
  28310. },
  28311. post: function (e, t) {
  28312. return s('POST', e, t)
  28313. },
  28314. patch: function (e, t) {
  28315. return s('PATCH', e, t)
  28316. },
  28317. getImage: function (e, t) {
  28318. function i() {
  28319. l.warn('Retrying ', e),
  28320. o
  28321. .getImage(e, t - 1)
  28322. .done(n.resolve.bind(n))
  28323. .progress(n.notify.bind(n))
  28324. .fail(n.reject.bind(n))
  28325. }
  28326. var n = $.Deferred(),
  28327. r = new Image(),
  28328. o = this
  28329. return (
  28330. (e = a.changeIfImageOptimzing(e)),
  28331. null != t || (t = 3),
  28332. (r.onerror = function () {
  28333. 0 < t ? setTimeout(i, 1e3) : n.reject()
  28334. }),
  28335. (r.onload = function () {
  28336. n.resolve(r)
  28337. }),
  28338. (r.crossOrigin = 'anonymous'),
  28339. (r.src = e),
  28340. n
  28341. )
  28342. }
  28343. })
  28344. }).call(this, '/js/util/ajax.js')
  28345. },
  28346. {
  28347. '../ab': 3,
  28348. './logger': 189
  28349. }
  28350. ],
  28351. 182: [
  28352. function (e, t, i) {
  28353. 'use strict'
  28354. function n(e, t) {
  28355. var i = window.navigator.userAgent.match(e)
  28356. return (
  28357. (i = i ? i[1].split(t) : []),
  28358. {
  28359. major: parseInt(i[0]) || 0,
  28360. minor: parseInt(i[1]) || 0,
  28361. patch: parseInt(i[2]) || 0
  28362. }
  28363. )
  28364. }
  28365. var r = e('../exception/DeviceMismatchException')
  28366. t.exports = {
  28367. supportsFullscreen: function () {
  28368. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28369. },
  28370. isPointerLocked: function () {
  28371. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28372. },
  28373. requestFullscreen: function (e, t) {
  28374. e.requestFullscreen
  28375. ? e.requestFullscreen()
  28376. : e.mozRequestFullScreen
  28377. ? e.mozRequestFullScreen()
  28378. : e.webkitRequestFullscreen
  28379. ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)
  28380. : e.msRequestFullscreen && e.msRequestFullscreen(),
  28381. t && $(document).on('fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange', browser.requestPointerLock)
  28382. },
  28383. requestPointerLock: function () {
  28384. var e
  28385. if (document.fullscreenElement) e = document.fullscreenElement()
  28386. else if (document.mozFullscreenElement) e = document.mozFullscreenElement()
  28387. else if (document.mozFullScreenElement) e = document.mozFullScreenElement()
  28388. else {
  28389. if (!document.webkitFullscreenElement) return
  28390. e = document.webkitFullscreenElement()
  28391. }
  28392. ;(e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock),
  28393. e.requestPointerLock(),
  28394. $(document).off('fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange', this)
  28395. },
  28396. exitPointerLock: function () {
  28397. ;(document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock), document.exitPointerLock()
  28398. },
  28399. exitFullscreen: function () {
  28400. document.exitFullscreen
  28401. ? document.exitFullscreen()
  28402. : document.msExitFullscreen
  28403. ? document.msExitFullscreen()
  28404. : document.mozCancelFullScreen
  28405. ? document.mozCancelFullScreen()
  28406. : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28407. },
  28408. details: function () {
  28409. var e = navigator.userAgent.match('(Firefox|Chrome|Safari)/([\\d]+)')
  28410. return e
  28411. ? {
  28412. name: e[1],
  28413. version: parseInt(e[2]),
  28414. platform: navigator.platform
  28415. }
  28416. : {}
  28417. },
  28418. is: function (e) {
  28419. return this.details() && this.details().name === e
  28420. },
  28421. inIframe: function () {
  28422. return window.parent !== window
  28423. },
  28424. aspectRatio: function () {
  28425. var e = $('#player').width() / $('#player').height()
  28426. return isFinite(e) ? e : 0
  28427. },
  28428. userAgent: function () {
  28429. return window.navigator.userAgent
  28430. },
  28431. isLandscape: function () {
  28432. return this.isMobile && 1 < this.aspectRatio()
  28433. },
  28434. isSmallScreen: function () {
  28435. return screen.width / window.devicePixelRatio < 240
  28436. },
  28437. detectIE: function () {
  28438. return -1 !== window.navigator.userAgent.indexOf('MSIE ') || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28439. },
  28440. detectSafari: function () {
  28441. return -1 !== window.navigator.userAgent.indexOf('Safari') && !this.detectChrome()
  28442. },
  28443. detectFirefox: function () {
  28444. return -1 !== window.navigator.userAgent.indexOf('Firefox')
  28445. },
  28446. detectChrome: function () {
  28447. return -1 !== window.navigator.userAgent.indexOf('Chrome') && !this.detectOpera()
  28448. },
  28449. detectOpera: function () {
  28450. return -1 !== window.navigator.userAgent.indexOf('OPR')
  28451. },
  28452. detectIOS: function () {
  28453. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28454. },
  28455. detectIPad: function () {
  28456. var e = window.navigator.userAgent
  28457. return /iPad/.test(e)
  28458. },
  28459. detectIPod: function () {
  28460. var e = window.navigator.userAgent
  28461. return /iPod/.test(e)
  28462. },
  28463. detectIPhone: function () {
  28464. var e = window.navigator.userAgent
  28465. return /iPhone/.test(e)
  28466. },
  28467. detectAndroid: function () {
  28468. return -1 !== window.navigator.userAgent.indexOf('Android')
  28469. },
  28470. detectAndroidMobile: function () {
  28471. var e = window.navigator.userAgent
  28472. return this.detectAndroid() && -1 !== e.indexOf('Mobile')
  28473. },
  28474. detectSamsungNative: function () {
  28475. var e = window.navigator.userAgent
  28476. return -1 !== e.indexOf('SM-G900H') || -1 !== e.indexOf('GT-I9500') || -1 !== e.indexOf('SM-N900')
  28477. },
  28478. detectSamsungS6: function () {
  28479. return -1 !== window.navigator.userAgent.indexOf('SM-G92')
  28480. },
  28481. detectHUAWEI5X: function () {
  28482. return -1 !== window.navigator.userAgent.indexOf('KIW-TL00H')
  28483. },
  28484. detectWebVR: function () {
  28485. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28486. },
  28487. getVRDisplay: function () {
  28488. var t = $.Deferred()
  28489. return this.detectWebVR()
  28490. ? (navigator.getVRDisplays().then(function (e) {
  28491. 1 <= e.length && t.resolve(e[0]), t.reject(null)
  28492. }),
  28493. t)
  28494. : t.reject(null)
  28495. },
  28496. iosVersion: function () {
  28497. if (!this.detectIOS()) throw new r('Did not detect an iDevice')
  28498. return n(/((?:\d+\_?){1,3}) like Mac OS/, '_')
  28499. },
  28500. androidVersion: function () {
  28501. if (!this.detectAndroid()) throw new r('Did not detect an Android based device')
  28502. return n(/Android ((?:\d+\.?){1,3})/, '.')
  28503. },
  28504. valueFromCookie: function (e, t) {
  28505. var i = new RegExp(e + '=([0-9a-f]+)(; ?|$)').exec(document.cookie)
  28506. if (!i) return t
  28507. var n = i[1]
  28508. return 'boolean' == typeof t ? 'true' === n || '1' === n : 'number' == typeof t ? parseFloat(n) : n
  28509. }
  28510. }
  28511. Object.assign(window.browser, t.exports)
  28512. t.exports = window.browser
  28513. },
  28514. {
  28515. '../exception/DeviceMismatchException': 56
  28516. }
  28517. ],
  28518. 183: [
  28519. function (i, n, e) {
  28520. ;(function (e) {
  28521. 'use strict'
  28522. var o = i('../controls/serializer'),
  28523. a = i('../util/math'),
  28524. s = i('./browser'),
  28525. l = i('../enum/Viewmode'),
  28526. t = i('../util/logger'),
  28527. c = i('three'),
  28528. h = new t(e)
  28529. n.exports = {
  28530. getStartCameraOptions: function (e, t) {
  28531. var i = (function (e) {
  28532. var t = s.valueFromHash('start', ''),
  28533. i = {}
  28534. if ('' !== t) {
  28535. h.debug('Start override found in parameters, trying to parse...'),
  28536. (i =
  28537. (function (e) {
  28538. return o.deserialize(e)
  28539. })(t) || {})
  28540. var n = s.valueFromHash('tag', null)
  28541. n && (i.tag = n), i.panoId && (i.pano = e.get(i.panoId))
  28542. }
  28543. return i
  28544. })(t)
  28545. if (0 < Object.keys(i).length) return i
  28546. if (e.heroImage)
  28547. i = (function (e, t) {
  28548. if (!e.heroImage || !e.heroImage.metadata.camera_position) return {}
  28549. var i = {},
  28550. n = e.heroImage.metadata
  28551. h.debug('Using start position from thumbnail image'), (i.position = n.camera_position), (i.quaternion = n.camera_quaternion)
  28552. try {
  28553. ;(i.mode = l.convertWorkshopModeInt(n.camera_mode)), i.mode === l.PANORAMA ? (i.pano = t.get(n.scan_id)) : (i.floorVisibility = n.floor_visibility)
  28554. } catch (e) {
  28555. h.debug(e.message)
  28556. }
  28557. return i
  28558. })(e, t)
  28559. else if (window.DATA.camera_start) {
  28560. var n = window.DATA.camera_start
  28561. try {
  28562. 0 < Object.keys(n).length &&
  28563. !a.isEmptyQuaternion(n.camera.quaternion) &&
  28564. ((i.mode = l.convertWorkshopModeInt(n.mode)),
  28565. (i.position = new c.Vector3().fromArray(n.camera.position)),
  28566. (i.quaternion = new c.Quaternion().fromArray(n.camera.quaternion)),
  28567. (i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom)),
  28568. n.pano &&
  28569. ((i.pano = t.get(n.pano.uuid) || t.findClosest(i.position)),
  28570. h.debug('Using camera_start'),
  28571. h.debug('Modeldata pano: ', i.pano.quaternion),
  28572. h.debug('Camera start pano: ', n.pano.quaternion)),
  28573. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  28574. } catch (e) {
  28575. h.warn(e.message)
  28576. if (i.mode == 'panorama' && !i.pano) {
  28577. i.pano = t.list[0]
  28578. }
  28579. }
  28580. }
  28581. if (
  28582. (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28583. i.mode === l.MESH && i.position && ((i.mode = l.PANORAMA), (i.pano = t.findClosest(i.position)), (i.quaternion = i.pano.quaternion)),
  28584. 0 === Object.keys(i).length)
  28585. ) {
  28586. var r = t.list[0]
  28587. r && ((i.mode = l.PANORAMA), (i.pano = r), (i.position = r.position), (i.quaternion = r.quaternion), h.info('Starting at 1st pano ' + r.id))
  28588. }
  28589. return (i.mode = i.mode || l.DOLLHOUSE), i
  28590. }
  28591. }
  28592. }).call(this, '/js/util/camera.js')
  28593. },
  28594. {
  28595. '../controls/serializer': 14,
  28596. '../enum/Viewmode': 51,
  28597. '../util/logger': 189,
  28598. '../util/math': 190,
  28599. './browser': 182,
  28600. three: 217
  28601. }
  28602. ],
  28603. 184: [
  28604. function (e, t, i) {
  28605. 'use strict'
  28606. function r(e, t, i) {
  28607. var n = t,
  28608. r = i
  28609. return 2 * Math.atan(Math.tan((e * a.RADIANS_PER_DEGREE) / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28610. }
  28611. function o(e, t, i) {
  28612. var n = t,
  28613. r = i
  28614. return 2 * Math.atan(Math.tan((e * a.RADIANS_PER_DEGREE) / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28615. }
  28616. var a = e('./MathLight')
  28617. t.exports = {
  28618. clampVFOV: function (e, t, i, n) {
  28619. return t < r(e, i, n) ? o(t, i, n) : e
  28620. },
  28621. getHFOVForCamera: function (e, t, i) {
  28622. return r(e.fov, t, i)
  28623. },
  28624. getHFOVFromVFOV: r,
  28625. getVFOVFromHFOV: o
  28626. }
  28627. window.MathLight = t.exports
  28628. MathLight.closeTo = function (e1, e2, precision) {
  28629. //xzw add 判断e1,e2是否接近
  28630. var prec = Math.pow(10, -(precision || 4))
  28631. var s1 = Math.abs(e1.x - e2.x) < prec && Math.abs(e1.y - e2.y) < prec && Math.abs(e1.z - e2.z) < prec
  28632. if (e1.w) {
  28633. return s1 && Math.abs(e1.w - e2.w) < prec
  28634. } else return s1
  28635. }
  28636. },
  28637. {
  28638. './MathLight': 176
  28639. }
  28640. ],
  28641. 185: [
  28642. function (e, t, i) {
  28643. 'use strict'
  28644. var a = e('three')
  28645. ;(t.exports = {
  28646. delayOneFrame: function (e) {
  28647. window.setTimeout(e, 1)
  28648. },
  28649. normalizeUrl: function (e) {
  28650. return e.replace('https://', 'http://')
  28651. },
  28652. domainFromUrl: function (e) {
  28653. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e)
  28654. return t ? t[3] : e
  28655. },
  28656. average: function (e, t) {
  28657. if (0 === e.length) return null
  28658. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28659. ;(i += t ? e[r][t] : e[r]), n++
  28660. }
  28661. return i / n
  28662. },
  28663. countUnique: function (e) {
  28664. for (var t = {}, i = 0; i < e.length; i++) t[e[i]] = 1 + (t[e[i]] || 0)
  28665. return Object.keys(t).length
  28666. },
  28667. averageVectors: function (e, t) {
  28668. var i = new a.Vector3()
  28669. if (0 === e.length) return i
  28670. for (var n = 0, r = 0; r < e.length; r++) {
  28671. var o = t ? e[r][t] : e[r]
  28672. i.add(o), n++
  28673. }
  28674. return i.divideScalar(n)
  28675. },
  28676. equalLists: function (e, t) {
  28677. if (e.length !== t.length) return !1
  28678. for (var i = 0; i < e.length; i++) if (e[i] !== t[i]) return !1
  28679. return !0
  28680. },
  28681. lowerMedian: function (e, t) {
  28682. return 0 === e.length
  28683. ? null
  28684. : ((t = t || 2),
  28685. e.sort(function (e, t) {
  28686. return e - t
  28687. }),
  28688. e[Math.floor(e.length / t)])
  28689. },
  28690. stableSort: function (e, n) {
  28691. return e
  28692. .map(function (e, t) {
  28693. return {
  28694. value: e,
  28695. index: t
  28696. }
  28697. })
  28698. .sort(function (e, t) {
  28699. var i = n(e.value, t.value)
  28700. return 0 !== i ? i : e.index - t.index
  28701. })
  28702. .map(function (e) {
  28703. return e.value
  28704. })
  28705. },
  28706. filterAll: function (e, i) {
  28707. return e.filter(function (t) {
  28708. return i.every(function (e) {
  28709. return e(t)
  28710. })
  28711. })
  28712. },
  28713. formatDate: function (e) {
  28714. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join('-')
  28715. },
  28716. formatDatetime: function (e) {
  28717. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join('-')
  28718. },
  28719. randomString: function (e) {
  28720. for (var t = '', i = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', n = 0; n < e; n++) t += i.charAt(Math.floor(Math.random() * i.length))
  28721. return t
  28722. },
  28723. uint8ToBase64: function (e, t) {
  28724. ;(t && 'number' == typeof t) || (t = 8192)
  28725. for (var i = [], n = 0; n < e.length; n += t) i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)))
  28726. return btoa(i.join(''))
  28727. },
  28728. uuid4: function e(t) {
  28729. return t ? (t ^ ((16 * Math.random()) >> (t / 4))).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28730. },
  28731. nth: function (e) {
  28732. return 1 === (e %= 10) ? e + 'st' : 2 === e ? e + 'nd' : 3 === e ? e + 'rd' : e + 'th'
  28733. },
  28734. extendObject: function (t, i) {
  28735. return (
  28736. Object.keys(i).forEach(function (e) {
  28737. t[e] = i[e]
  28738. }),
  28739. t
  28740. )
  28741. },
  28742. deepExtend: function e(t) {
  28743. t = t || {}
  28744. for (var i = 1; i < arguments.length; i++) {
  28745. var n = arguments[i]
  28746. if (n) for (var r in n) n.hasOwnProperty(r) && ('object' == typeof n[r] ? (t[r] = e(t[r], n[r])) : (t[r] = n[r]))
  28747. }
  28748. return t
  28749. },
  28750. inherit: function (e, t) {
  28751. ;(e.prototype = Object.create(t.prototype)), (e.prototype.constructor = e)
  28752. },
  28753. extend: function (e, t) {
  28754. for (var i in t.prototype) e.prototype[i] = t.prototype[i]
  28755. },
  28756. getFileNameFromUrl: function (url) {
  28757. return url.split('/').pop()
  28758. }
  28759. }),
  28760. (Math.sign = function (e) {
  28761. return e < 0 ? -1 : 1
  28762. })
  28763. window.common = t.exports
  28764. expandCommon(common)
  28765. },
  28766. {
  28767. three: 217
  28768. }
  28769. ],
  28770. 186: [
  28771. function (e, t, i) {
  28772. 'use strict'
  28773. var r = {
  28774. linearTween: function (e, t, i, n) {
  28775. return (i * e) / n + t
  28776. },
  28777. easeInQuad: function (e, t, i, n) {
  28778. return i * (e /= n) * e + t
  28779. },
  28780. easeOutQuad: function (e, t, i, n) {
  28781. return -i * (e /= n) * (e - 2) + t
  28782. },
  28783. easeInOutQuad: function (e, t, i, n) {
  28784. return (e /= n / 2) < 1 ? (i / 2) * e * e + t : (-i / 2) * (--e * (e - 2) - 1) + t
  28785. },
  28786. easeInCubic: function (e, t, i, n) {
  28787. return i * (e /= n) * e * e + t
  28788. },
  28789. easeOutCubic: function (e, t, i, n) {
  28790. return (e /= n), i * (--e * e * e + 1) + t
  28791. },
  28792. easeInOutCubic: function (e, t, i, n) {
  28793. return (e /= n / 2) < 1 ? (i / 2) * e * e * e + t : (i / 2) * ((e -= 2) * e * e + 2) + t
  28794. },
  28795. easeInQuart: function (e, t, i, n) {
  28796. return i * (e /= n) * e * e * e + t
  28797. },
  28798. easeOutQuart: function (e, t, i, n) {
  28799. return (e /= n), -i * (--e * e * e * e - 1) + t
  28800. },
  28801. easeInOutQuart: function (e, t, i, n) {
  28802. return (e /= n / 2) < 1 ? (i / 2) * e * e * e * e + t : (-i / 2) * ((e -= 2) * e * e * e - 2) + t
  28803. },
  28804. easeInQuint: function (e, t, i, n) {
  28805. return i * (e /= n) * e * e * e * e + t
  28806. },
  28807. easeOutQuint: function (e, t, i, n) {
  28808. return (e /= n), i * (--e * e * e * e * e + 1) + t
  28809. },
  28810. easeInOutQuint: function (e, t, i, n) {
  28811. return (e /= n / 2) < 1 ? (i / 2) * e * e * e * e * e + t : (i / 2) * ((e -= 2) * e * e * e * e + 2) + t
  28812. },
  28813. easeInSine: function (e, t, i, n) {
  28814. return -i * Math.cos((e / n) * (Math.PI / 2)) + i + t
  28815. },
  28816. easeOutSine: function (e, t, i, n) {
  28817. return i * Math.sin((e / n) * (Math.PI / 2)) + t
  28818. },
  28819. easeInOutSine: function (e, t, i, n) {
  28820. return (-i / 2) * (Math.cos((Math.PI * e) / n) - 1) + t
  28821. },
  28822. easeInExpo: function (e, t, i, n) {
  28823. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28824. },
  28825. easeOutExpo: function (e, t, i, n) {
  28826. return i * (1 - Math.pow(2, (-10 * e) / n)) + t
  28827. },
  28828. easeInOutExpo: function (e, t, i, n) {
  28829. return (e /= n / 2) < 1 ? (i / 2) * Math.pow(2, 10 * (e - 1)) + t : (e--, (i / 2) * (2 - Math.pow(2, -10 * e)) + t)
  28830. },
  28831. easeInCirc: function (e, t, i, n) {
  28832. return (e /= n), -i * (Math.sqrt(1 - e * e) - 1) + t
  28833. },
  28834. easeOutCirc: function (e, t, i, n) {
  28835. return (e /= n), e--, i * Math.sqrt(1 - e * e) + t
  28836. },
  28837. easeInOutCirc: function (e, t, i, n) {
  28838. return (e /= n / 2) < 1 ? (-i / 2) * (Math.sqrt(1 - e * e) - 1) + t : ((e -= 2), (i / 2) * (Math.sqrt(1 - e * e) + 1) + t)
  28839. },
  28840. easeInElastic: function (e, t, i, n) {
  28841. var r = 1.70158,
  28842. o = 0,
  28843. a = i
  28844. return 0 === e
  28845. ? t
  28846. : 1 == (e /= n)
  28847. ? t + i
  28848. : ((o = o || 0.3 * n),
  28849. (r = a < Math.abs(i) ? ((a = i), o / 4) : (o / (2 * Math.PI)) * Math.asin(i / a)),
  28850. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin(((e * n - r) * (2 * Math.PI)) / o) + t)
  28851. },
  28852. easeOutElastic: function (e, t, i, n) {
  28853. var r = 1.70158,
  28854. o = 0,
  28855. a = i
  28856. return 0 === e
  28857. ? t
  28858. : 1 == (e /= n)
  28859. ? t + i
  28860. : ((o = o || 0.3 * n),
  28861. (r = a < Math.abs(i) ? ((a = i), o / 4) : (o / (2 * Math.PI)) * Math.asin(i / a)),
  28862. a * Math.pow(2, -10 * e) * Math.sin(((e * n - r) * (2 * Math.PI)) / o) + i + t)
  28863. },
  28864. easeInOutElastic: function (e, t, i, n) {
  28865. var r = 1.70158,
  28866. o = 0,
  28867. a = i
  28868. return 0 === e
  28869. ? t
  28870. : 2 == (e /= n / 2)
  28871. ? t + i
  28872. : ((o = o || n * (0.3 * 1.5)),
  28873. (r = a < Math.abs(i) ? ((a = i), o / 4) : (o / (2 * Math.PI)) * Math.asin(i / a)),
  28874. e < 1
  28875. ? a * Math.pow(2, 10 * (e -= 1)) * Math.sin(((e * n - r) * (2 * Math.PI)) / o) * -0.5 + t
  28876. : a * Math.pow(2, -10 * (e -= 1)) * Math.sin(((e * n - r) * (2 * Math.PI)) / o) * 0.5 + i + t)
  28877. },
  28878. easeInBack: function (e, t, i, n, r) {
  28879. return void 0 === r && (r = 1.70158), i * (e /= n) * e * ((r + 1) * e - r) + t
  28880. },
  28881. easeOutBack: function (e, t, i, n, r) {
  28882. return void 0 === r && (r = 1.70158), i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  28883. },
  28884. easeInOutBack: function (e, t, i, n, r) {
  28885. return void 0 === r && (r = 1.70158), (e /= n / 2) < 1 ? (i / 2) * (e * e * ((1 + (r *= 1.525)) * e - r)) + t : (i / 2) * ((e -= 2) * e * ((1 + (r *= 1.525)) * e + r) + 2) + t
  28886. },
  28887. easeOutBounce: function (e, t, i, n) {
  28888. return (e /= n) < 1 / 2.75
  28889. ? i * (7.5625 * e * e) + t
  28890. : e < 2 / 2.75
  28891. ? i * (7.5625 * (e -= 1.5 / 2.75) * e + 0.75) + t
  28892. : e < 2.5 / 2.75
  28893. ? i * (7.5625 * (e -= 2.25 / 2.75) * e + 0.9375) + t
  28894. : i * (7.5625 * (e -= 2.625 / 2.75) * e + 0.984375) + t
  28895. },
  28896. easeInBounce: function (e, t, i, n) {
  28897. return i - r.easeOutBounce(n - e, 0, i, n) + t
  28898. },
  28899. easeInOutBounce: function (e, t, i, n) {
  28900. return e < n / 2 ? 0.5 * r.easeInBounce(2 * e, 0, i, n) + t : 0.5 * r.easeOutBounce(x, 2 * e - n, 0, i, n) + 0.5 * i + t
  28901. }
  28902. }
  28903. window.easing = t.exports = r
  28904. },
  28905. {}
  28906. ],
  28907. 187: [
  28908. function (e, t, i) {
  28909. 'use strict'
  28910. function n() {
  28911. ;(this.events = []), (this.valid = !1)
  28912. }
  28913. var r = e('../enum/Joystick')
  28914. ;(n.prototype.push = function (e, t) {
  28915. this.events.push({
  28916. direction: e,
  28917. pano: t
  28918. }),
  28919. (this.valid = !0)
  28920. }),
  28921. (n.prototype.pop = function (e) {
  28922. var t = this.events.pop()
  28923. return this.events.length < 1 && (this.valid = !1), t
  28924. }),
  28925. (n.prototype.peek = function () {
  28926. return this.events.length
  28927. ? this.events[this.events.length - 1]
  28928. : {
  28929. direction: null,
  28930. pano: null
  28931. }
  28932. }),
  28933. (n.prototype.invalidate = function () {
  28934. ;(this.events = []), (this.valid = !1)
  28935. }),
  28936. (n.prototype.reversePano = function (e) {
  28937. if (!this.valid) return null
  28938. var t = this.peek()
  28939. return r.opposite(e) === t.direction ? (this.pop(), t.pano) : null
  28940. }),
  28941. (t.exports = n)
  28942. },
  28943. {
  28944. '../enum/Joystick': 29
  28945. }
  28946. ],
  28947. 188: [
  28948. function (e, t, i) {
  28949. 'use strict'
  28950. t.exports = {
  28951. vector: function (t, i) {
  28952. var n = t.clone()
  28953. return (
  28954. (i = i.clone()),
  28955. function (e) {
  28956. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  28957. }
  28958. )
  28959. },
  28960. quaternion: function (t, i) {
  28961. var n = t.clone()
  28962. return function (e) {
  28963. t.copy(n).slerp(i, e)
  28964. }
  28965. },
  28966. property: function (t, i, n, r) {
  28967. var o = t[i]
  28968. return function (e) {
  28969. ;(t[i] = o * (1 - e) + n * e), r && r(t[i])
  28970. }
  28971. },
  28972. uniform: function (t, i, n) {
  28973. var r = t.material.uniforms[i].value
  28974. return function (e) {
  28975. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  28976. }
  28977. },
  28978. matrix4: function (o, a) {
  28979. var s = o.clone()
  28980. return function (e) {
  28981. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++) t[r] = i[r] * (1 - e) + n[r] * e
  28982. }
  28983. },
  28984. allUniforms: function (e, t, i) {
  28985. var n = e.map(
  28986. function (e) {
  28987. return this.uniform(e, t, i)
  28988. }.bind(this)
  28989. )
  28990. return function (t) {
  28991. n.forEach(function (e) {
  28992. e(t)
  28993. })
  28994. }
  28995. }
  28996. }
  28997. },
  28998. {}
  28999. ],
  29000. 189: [
  29001. function (e, t, i) {
  29002. 'use strict'
  29003. function h(n) {
  29004. var e,
  29005. t,
  29006. i,
  29007. r,
  29008. o = n.split('/'),
  29009. a = '[' + o[o.length - 1].replace('.js', '') + ']',
  29010. s = {}
  29011. if (h.consoleEnabled) {
  29012. var l = function (e) {
  29013. $('#debug-console').append('<p>' + e + '</p>'), ($('#debug-console')[0].scrollTop = $('#debug-console')[0].scrollHeight)
  29014. }
  29015. ;(e = function (e) {
  29016. l(Array.prototype.slice.call(arguments).join(' '))
  29017. }),
  29018. (t = function (e) {
  29019. l(Array.prototype.slice.call(arguments).join(' '))
  29020. }),
  29021. (i = function (e) {
  29022. l('WARN: ' + Array.prototype.slice.call(arguments).join(' '))
  29023. }),
  29024. (r = function (e) {
  29025. l('ERROR: ' + Array.prototype.slice.call(arguments).join(' '))
  29026. })
  29027. } else
  29028. console.log
  29029. ? ((e = console.log), (t = console.info ? console.info : console.log), (i = console.warn ? console.warn : console.log), (r = console.error ? console.error : console.log))
  29030. : (e = t = i = r = function () {})
  29031. function c(e) {
  29032. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  29033. }
  29034. return {
  29035. debug: function () {
  29036. h.level >= h.levels.debug && e.apply(console, c(arguments))
  29037. },
  29038. info: function () {
  29039. h.level >= h.levels.info && t.apply(console, c(arguments))
  29040. },
  29041. warn: function () {
  29042. ;(function (e, t) {
  29043. if (u) {
  29044. var i = Array.prototype.slice.call(e).join(' ')
  29045. u.captureMessage(i, {
  29046. level: t,
  29047. path: n,
  29048. timestamp: h.timestamp()
  29049. })
  29050. }
  29051. })(arguments, 'warn'),
  29052. h.level >= h.levels.warn && i.apply(console, c(arguments))
  29053. },
  29054. error: function () {
  29055. ;(function (e, t) {
  29056. if (u) {
  29057. var i = Array.prototype.slice.call(e).join(' ')
  29058. u.captureException(new Error(i), {
  29059. level: t,
  29060. path: n,
  29061. timestamp: h.timestamp()
  29062. })
  29063. }
  29064. })(arguments, 'error'),
  29065. h.level >= h.levels.error && r.apply(console, c(arguments))
  29066. },
  29067. v3str: function (e, t) {
  29068. var i = void 0 === t ? 2 : t
  29069. return '(' + e.x.toPrecision(i) + ', ' + e.y.toPrecision(i) + ', ' + e.z.toPrecision(i) + ')'
  29070. },
  29071. eulstr: function (e, t) {
  29072. var i = void 0 === t ? 2 : t
  29073. return '(' + THREE.Math.radToDeg(e.x).toPrecision(i) + ', ' + THREE.Math.radToDeg(e.y).toPrecision(i) + ', ' + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  29074. },
  29075. time: function (e) {
  29076. h.level >= h.levels.debug && (s[e] = Date.now())
  29077. },
  29078. timeEnd: function (e) {
  29079. if (h.level >= h.levels.debug) {
  29080. var t = s[e]
  29081. if (!t) return
  29082. var i = (Date.now() - t) / 1e3
  29083. this.debug(e, i + 's')
  29084. }
  29085. }
  29086. }
  29087. }
  29088. var u = window.Raven
  29089. ;(h.timestamp = function () {
  29090. return (Date.now() - window.navigationStart) / 1e3 + 's'
  29091. }),
  29092. (h.level = (h.levels = {
  29093. debug: 3,
  29094. info: 2,
  29095. warn: 1,
  29096. error: 0
  29097. }).info),
  29098. (t.exports = h)
  29099. },
  29100. {}
  29101. ],
  29102. 190: [
  29103. function (e, t, i) {
  29104. 'use strict'
  29105. var o = e('three'),
  29106. r = e('../enum/GLCubeFaces')
  29107. e('../constants')
  29108. t.exports = {
  29109. convertVisionVector: function (e) {
  29110. return new o.Vector3(e.x, e.z, -e.y)
  29111. },
  29112. convertVisionQuaternion: function (e) {
  29113. return new o.Quaternion(e.x, e.z, -e.y, e.w).multiply(new o.Quaternion().setFromAxisAngle(new o.Vector3(0, 1, 0), o.Math.degToRad(90)))
  29114. },
  29115. convertWorkshopVector: function (e) {
  29116. return new o.Vector3(-e.x, e.y, e.z)
  29117. },
  29118. convertWorkshopQuaternion: function (e) {
  29119. return new o.Quaternion(-e.x, e.y, e.z, -e.w).multiply(new o.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0))
  29120. },
  29121. convertWorkshopPanoramaQuaternion: function (e) {
  29122. return new o.Quaternion(e.x, -e.y, -e.z, e.w).normalize().multiply(new o.Quaternion().setFromAxisAngle(new o.Vector3(0, 1, 0), o.Math.degToRad(270)))
  29123. },
  29124. convertWorkshopOrthoZoom: function (e) {
  29125. return -1 === e ? -1 : ((e * ($('#player').width() / $('#player').height())) / g_snapShotWidth) * g_snapShotHeight
  29126. },
  29127. toPrecision: function (e, t) {
  29128. function i(e, t) {
  29129. var i = Math.pow(10, t)
  29130. return Math.round(e * i) / i
  29131. }
  29132. if (e instanceof Array) {
  29133. for (var n = 0; n < e.length; n++) e[n] = i(e[n], t)
  29134. return e
  29135. }
  29136. return i(e, t)
  29137. },
  29138. isEmptyQuaternion: function (e) {
  29139. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  29140. },
  29141. projectPositionToCanvas: function (e, t, i) {
  29142. ;(i = i || new o.Vector3()).copy(e)
  29143. var n = 0.5 * $('#player').width(),
  29144. r = 0.5 * $('#player').height()
  29145. return i.project(t), (i.x = i.x * n + n), (i.y = -i.y * r + r), i
  29146. },
  29147. convertScreenPositionToNDC: function (e, t, i) {
  29148. return ((i = i || new o.Vector2()).x = (e / $('#player').width()) * 2 - 1), (i.y = (-t / $('#player').height()) * 2 + 1), i
  29149. },
  29150. constrainedTurn: function (e) {
  29151. var t = e % (2 * Math.PI)
  29152. return t > Math.PI ? (t -= 2 * Math.PI) : t < -Math.PI ? (t += 2 * Math.PI) : t
  29153. },
  29154. getFOVDotThreshold: function (e) {
  29155. return Math.cos(o.Math.degToRad(e / 2))
  29156. },
  29157. transform2DForwardVectorByCubeFace: function (e, t, i, n) {
  29158. switch (e) {
  29159. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29160. i.set(1, t.y, t.x)
  29161. break
  29162. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29163. i.set(-1, t.y, -t.x)
  29164. break
  29165. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29166. i.set(-t.x, 1, -t.y)
  29167. break
  29168. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29169. i.set(-t.x, -1, t.y)
  29170. break
  29171. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29172. i.set(-t.x, t.y, 1)
  29173. break
  29174. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29175. i.set(t.x, t.y, -1)
  29176. }
  29177. n && i.normalize()
  29178. },
  29179. //add:
  29180. getPos2d: function (point, camera, dom) {
  29181. var camera = camera
  29182. var dom = dom
  29183. 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);
  29184. var x, y
  29185. x = ((pos.x + 1) / 2) * dom.clientWidth
  29186. y = (1 - (pos.y + 1) / 2) * dom.clientHeight
  29187. var inSight = x <= dom.clientWidth && x >= 0 && y <= dom.clientHeight && y >= 0
  29188. return {
  29189. pos: new THREE.Vector2(x, y),
  29190. vector: pos,
  29191. trueSide: pos.z < 1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  29192. inSight: inSight //在屏幕范围内可见
  29193. }
  29194. },
  29195. getDirByLonLat: function (lon, lat) {
  29196. var dir = new THREE.Vector3()
  29197. var phi = THREE.Math.degToRad(90 - lat)
  29198. var theta = THREE.Math.degToRad(lon)
  29199. dir.x = Math.sin(phi) * Math.cos(theta)
  29200. dir.y = Math.cos(phi)
  29201. dir.z = Math.sin(phi) * Math.sin(theta)
  29202. return dir.negate()
  29203. }
  29204. }
  29205. window.math = t.exports
  29206. expandMath(math)
  29207. },
  29208. {
  29209. '../constants': 8,
  29210. '../enum/GLCubeFaces': 25,
  29211. three: 217
  29212. }
  29213. ],
  29214. 191: [
  29215. function (e, t, i) {
  29216. 'use strict'
  29217. function o(e) {
  29218. return r[e]
  29219. }
  29220. var n = e('../enum/GLCubeFaces'),
  29221. a = [0, 1, 2, 3, 4, 5],
  29222. r = {
  29223. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29224. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29225. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29226. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29227. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29228. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29229. }
  29230. t.exports = {
  29231. mapFaceToCubemapFace: o,
  29232. getCubemapUrls: function (i, n, r) {
  29233. return a.map(
  29234. function (e, t) {
  29235. return i.get('pan/' + r + '/' + n + '_skybox' + o(e) + '.jpg')
  29236. }.bind(this)
  29237. )
  29238. }
  29239. }
  29240. },
  29241. {
  29242. '../enum/GLCubeFaces': 25
  29243. }
  29244. ],
  29245. 192: [
  29246. function (e, t, i) {
  29247. 'use strict'
  29248. t.exports = {
  29249. captureErrors: function (e, t, i) {
  29250. if ('Raven' in window) {
  29251. Raven.config(e, t).install(), i && Raven.setTagsContext(i)
  29252. var n = console.warn,
  29253. r = console.error
  29254. ;(console.warn = function () {
  29255. var e = Array.prototype.slice.call(arguments)
  29256. Raven.captureMessage(e.join(' '), {
  29257. level: 'warning'
  29258. }),
  29259. n.apply(console, e)
  29260. }),
  29261. (console.error = function () {
  29262. var e = Array.prototype.slice.call(arguments)
  29263. Raven.captureException(new Error(e.join(' ')), {
  29264. level: 'error'
  29265. }),
  29266. r.apply(console, e)
  29267. })
  29268. } else console.error('Raven not found, not capturing errors.')
  29269. }
  29270. }
  29271. },
  29272. {}
  29273. ],
  29274. 193: [
  29275. function (c, h, e) {
  29276. ;(function (e) {
  29277. 'use strict'
  29278. var i,
  29279. n = c('./browser'),
  29280. r = c('../constants'),
  29281. o = c('url'),
  29282. t = c('./logger'),
  29283. a = c('three'),
  29284. s = new t(e),
  29285. l = {
  29286. getAuthorizationHeader: function () {
  29287. var e = n.valueFromHash('auth')
  29288. if (e) return e.replace(',', ' ')
  29289. var t = n.valueFromCookie('token')
  29290. return t ? 'Token ' + t : null
  29291. },
  29292. parseSidUrl: function (e) {
  29293. var t, i
  29294. if (((t = g_Prefix), (e = e || '').match(/^https?/))) {
  29295. o.parse(e)
  29296. ;(t = g_Prefix), (i = e)
  29297. } else i = (t = g_Prefix) + 'data1/' + e
  29298. return {
  29299. urlBase: t,
  29300. urlModel: i,
  29301. urlFiles: i + (i.match(/\/$/) ? 'files' : '/files'),
  29302. urlThumb: i + (i.match(/\/$/) ? 'thumb' : '/thumb')
  29303. }
  29304. },
  29305. getModelIDFromQueryString: function () {
  29306. return n.valueFromHash('model') || n.valueFromHash('m')
  29307. },
  29308. /* normalizeModeldata: function(e, i) {
  29309. e = JSON.parse(JSON.stringify(e));
  29310. var n = null;
  29311. if (e.images.forEach(function(t) {
  29312. if (t.metadata) {
  29313. if ("string" == typeof t.metadata)
  29314. try {
  29315. t.metadata = JSON.parse(t.metadata)
  29316. } catch (e) {
  29317. s.warn("Unable to parse image metadata"),
  29318. t.metadata = null
  29319. }
  29320. else
  29321. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  29322. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  29323. t.metadata.camera_quaternion = (new a.Quaternion).fromArray(t.metadata.camera_quaternion)) : (t.metadata.camera_quaternion && (t.metadata.camera_quaternion = i.convertWorkshopQuaternion(t.metadata.camera_quaternion)),
  29324. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  29325. t.metadata.zoom = t.metadata.zoom || 1),
  29326. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  29327. }
  29328. }),
  29329. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  29330. var t = {};
  29331. t.pano = {
  29332. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  29333. position: i.convertWorkshopVector(n.scan_position),
  29334. uuid: n.scan_id
  29335. },
  29336. t.camera = {
  29337. quaternion: n.camera_quaternion,
  29338. position: n.camera_position
  29339. },
  29340. e.startPano = t
  29341. }
  29342. return e
  29343. }, */
  29344. normalizeModeldata: function (e, t) {
  29345. //xzw 修改导览images数据
  29346. e = JSON.parse(JSON.stringify(e))
  29347. var i = null
  29348. var deal = function (n) {
  29349. if (!n.metadata) return
  29350. if ('string' == typeof n.metadata)
  29351. try {
  29352. n.metadata = JSON.parse(n.metadata)
  29353. } catch (e) {
  29354. s.warn('Unable to parse image metadata'), (n.metadata = null)
  29355. }
  29356. else {
  29357. 'object' == typeof n.metadata && s.debug('image.metadata already a JSON object')
  29358. }
  29359. if (n.metadata.camera_position instanceof Array) {
  29360. //xzw 改的格式
  29361. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position)
  29362. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion)
  29363. } else {
  29364. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  29365. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  29366. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29367. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  29368. }
  29369. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29370. }
  29371. //改
  29372. e.images.forEach(info => {
  29373. if (info.locations) {
  29374. info.locations.forEach(a => deal(a))
  29375. } else {
  29376. deal(info)
  29377. }
  29378. })
  29379. //icon初始视角的:
  29380. if (i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29381. var n = {}
  29382. ;(n.pano = {
  29383. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29384. position: t.convertWorkshopVector(i.scan_position),
  29385. uuid: i.scan_id
  29386. }),
  29387. (n.camera = {
  29388. quaternion: i.camera_quaternion,
  29389. position: i.camera_position
  29390. }),
  29391. (e.startPano = n)
  29392. }
  29393. return e
  29394. },
  29395. visionVersionToInt:
  29396. ((i = new RegExp(['(?:[0-9.]+\\.){1,4}', '([0-9]+)', '[^\\.]*$'].join(''))),
  29397. function (e) {
  29398. if (!e) throw new Error('Vision version is required')
  29399. var t = i.exec(e)
  29400. if (null === t) throw new Error('String is not a vision version: ' + e)
  29401. return parseInt(t[1])
  29402. }),
  29403. modelDataPromisesTiles: function (e) {
  29404. var t = e.vision_version || window.DATA.vision_version
  29405. if (t)
  29406. try {
  29407. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29408. } catch (e) {
  29409. s.warn('Invalid vision version: ' + t)
  29410. }
  29411. return !1
  29412. }
  29413. }
  29414. h.exports = l
  29415. }).call(this, '/js/util/showcase.js')
  29416. },
  29417. {
  29418. '../constants': 8,
  29419. './browser': 182,
  29420. './logger': 189,
  29421. three: 217,
  29422. url: 208
  29423. }
  29424. ],
  29425. 194: [
  29426. function (e, t, i) {
  29427. 'use strict'
  29428. var r = e('../util/ajax'),
  29429. o = e('three'),
  29430. a = e('../settings'),
  29431. s = {}
  29432. t.exports = {
  29433. load: function (e, t, i) {
  29434. var n = s[e]
  29435. return (
  29436. n
  29437. ? t &&
  29438. setTimeout(function () {
  29439. t(n)
  29440. }, 1)
  29441. : ((n = new o.Texture()),
  29442. a.minimalMemoryMode && ((n.minFilter = o.LinearFilter), (n.magFilter = o.LinearFilter), (n.generateMipmaps = !1)),
  29443. (n.sourceFile = e),
  29444. (s[e] = n),
  29445. r
  29446. .getImage(e)
  29447. .then(function (e) {
  29448. ;(n.image = e), (n.needsUpdate = !0), t && t(n)
  29449. })
  29450. .fail(i)),
  29451. n
  29452. )
  29453. },
  29454. loadBase64: function (e, t) {
  29455. t = t || 'png'
  29456. var i = new o.Texture()
  29457. return (
  29458. (i.image = document.createElement('img')),
  29459. i.image.setAttribute('src', 'data:image/' + t + ';base64,' + e),
  29460. a.minimalMemoryMode && ((i.minFilter = o.LinearFilter), (i.magFilter = o.LinearFilter), (i.generateMipmaps = !1)),
  29461. (i.needsUpdate = !0),
  29462. i
  29463. )
  29464. },
  29465. isLoaded: function (e) {
  29466. return !!s[e]
  29467. }
  29468. }
  29469. window.Texture = t.exports
  29470. },
  29471. {
  29472. '../settings': 166,
  29473. '../util/ajax': 181,
  29474. three: 217
  29475. }
  29476. ],
  29477. 195: [
  29478. function (e, t, i) {
  29479. 'use strict'
  29480. var l = e('./easing')
  29481. window.transitions = t.exports = {
  29482. globalDone: null,
  29483. funcs: [],
  29484. counter: 0,
  29485. uniqueID: 0,
  29486. start: function (e, t, i, n, r, o, a) {
  29487. return (
  29488. (n = n || 0),
  29489. this.funcs.push({
  29490. func: e,
  29491. current: -n * Math.abs(t),
  29492. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  29493. done: i,
  29494. easing: r || l.linearTween,
  29495. cycling: t < 0,
  29496. running: !0,
  29497. debug: n < 0,
  29498. name: o || 'T' + this.counter,
  29499. id: void 0 === a ? this.counter : a,
  29500. paused: !1
  29501. }),
  29502. e(0, 16),
  29503. (this.counter += 1),
  29504. e
  29505. )
  29506. },
  29507. trigger: function (e) {
  29508. var t = void 0 === e.delayRatio ? 0 : e.delayRatio,
  29509. i = e.func || function () {},
  29510. n = void 0 === e.duration ? 0 : e.duration
  29511. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n))
  29512. var r = e.done || null,
  29513. o = e.easing || l.linearTween,
  29514. a = e.name || 'R' + this.counter,
  29515. s = void 0 === e.id ? this.counter : e.id
  29516. return this.start(i, n, r, t, o, a, s)
  29517. },
  29518. setTimeout: function (e, t, i) {
  29519. var n = void 0 === i ? this.counter : i
  29520. return this.trigger({
  29521. done: e,
  29522. duration: void 0 === t ? 0 : t,
  29523. name: 'O' + this.counter,
  29524. id: n
  29525. })
  29526. },
  29527. pause: function () {
  29528. this.paused = !0
  29529. },
  29530. resume: function () {
  29531. this.paused = !1
  29532. },
  29533. update: function (n) {
  29534. this.funcs.forEach(function (e) {
  29535. if (!(e.paused || ((e.current += 1e3 * n), e.current < 0)))
  29536. if (e.current >= e.duration && !e.cycling) {
  29537. var t = e.easing(1, 0, 1, 1)
  29538. e.func(t, 1e3 * n), e.done && e.done(), (e.running = !1)
  29539. } else {
  29540. var i = e.easing((e.current % e.duration) / e.duration, 0, 1, 1)
  29541. ;(e.func(i, 1e3 * n) || !1) && (e.done && e.done(), (e.running = !1))
  29542. }
  29543. })
  29544. var e = this.funcs.length
  29545. this.funcs = this.funcs.filter(function (e) {
  29546. return e.running
  29547. })
  29548. var t = this.funcs.length
  29549. if (0 < e && 0 === t && this.globalDone) {
  29550. var i = this.globalDone
  29551. ;(this.globalDone = null), i()
  29552. }
  29553. },
  29554. adjustSpeed: function (e, t) {
  29555. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29556. var r = i[n]
  29557. ;(r.duration /= t), (r.current /= t)
  29558. }
  29559. },
  29560. getById: function (t) {
  29561. return this.funcs.filter(function (e) {
  29562. return t === e.id
  29563. })
  29564. },
  29565. get: function (e) {
  29566. for (var t = 0; t < this.funcs.length; t += 1) if (this.funcs[t].func === e) return this.funcs[t]
  29567. return null
  29568. },
  29569. isRunning: function (e) {
  29570. var t = this.get(e)
  29571. return null !== t && t.running
  29572. },
  29573. countActive: function () {
  29574. for (var e = 0, t = 0; t < this.funcs.length; t += 1) e += this.funcs[t].running
  29575. return e
  29576. },
  29577. listActive: function () {
  29578. for (var e = [], t = 0; t < this.funcs.length; t += 1) this.funcs[t].running && e.push(this.funcs[t].name)
  29579. return e
  29580. },
  29581. done: function (e) {
  29582. this.globalDone = e
  29583. },
  29584. cancelById: function (e) {
  29585. var t = void 0 === e ? 0 : e
  29586. this.funcs = this.funcs.filter(function (e) {
  29587. return e.id !== t
  29588. })
  29589. },
  29590. cancel: function (t) {
  29591. this.funcs = this.funcs.filter(function (e) {
  29592. return e.func !== t
  29593. })
  29594. },
  29595. getUniqueId: function () {
  29596. return (this.uniqueID -= 1), this.uniqueID
  29597. }
  29598. }
  29599. },
  29600. {
  29601. './easing': 186
  29602. }
  29603. ],
  29604. 196: [
  29605. function (e, t, i) {
  29606. function n(e) {
  29607. if (
  29608. ((this.set = {}),
  29609. (this.infContains = function () {
  29610. return !0
  29611. }),
  29612. 'object' == typeof e)
  29613. )
  29614. if (e instanceof Array) for (var t = 0; t < e.length; t++) this.set[e[t]] = !0
  29615. else this.set = e
  29616. else if ('function' == typeof e) this.infContains = e
  29617. else if (void 0 !== e) throw new Error('set must be either an array or an object.')
  29618. }
  29619. ;((t.exports = n).prototype.has = n.prototype.contains =
  29620. function (e) {
  29621. return !!this.set[e]
  29622. }),
  29623. (n.prototype.add = function (e) {
  29624. if (1 == arguments.length) this.set[e] = !0
  29625. else for (var t = 0; t < arguments.length; t++) this.set[arguments[t]] = !0
  29626. }),
  29627. (n.prototype.addAll = function (e) {
  29628. if ('object' != typeof e && !(e instanceof Array)) throw new Error('arr must be an array.')
  29629. for (var t = 0; t < e.length; t++) this.add(e[t])
  29630. }),
  29631. (n.prototype.delete = n.prototype.remove =
  29632. function (e) {
  29633. if (1 == arguments.length) delete this.set[e]
  29634. else for (var t = 0; t < arguments.length; t++) delete this.set[arguments[t]]
  29635. }),
  29636. (n.prototype.clear = function () {
  29637. this.set = {}
  29638. }),
  29639. (n.prototype.size = function () {
  29640. return Object.keys(this.set).length
  29641. }),
  29642. (n.prototype.toString = function () {
  29643. return '{' + Object.keys(this.set).toString() + '}'
  29644. }),
  29645. (n.prototype['*values'] = n.prototype.toArray =
  29646. function () {
  29647. return void 0 === this.set ? [] : Object.keys(this.set)
  29648. })
  29649. },
  29650. {}
  29651. ],
  29652. 197: [function (e, t, i) {}, {}],
  29653. 198: [
  29654. function (N, e, F) {
  29655. ;(function (e) {
  29656. 'use strict'
  29657. function i() {
  29658. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29659. }
  29660. function o(e, t) {
  29661. if (i() < t) throw new RangeError('Invalid typed array length')
  29662. return u.TYPED_ARRAY_SUPPORT ? ((e = new Uint8Array(t)).__proto__ = u.prototype) : (null === e && (e = new u(t)), (e.length = t)), e
  29663. }
  29664. function u(e, t, i) {
  29665. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u)) return new u(e, t, i)
  29666. if ('number' != typeof e) return n(this, e, t, i)
  29667. if ('string' == typeof t) throw new Error('If encoding is specified then the first argument must be a string')
  29668. return a(this, e)
  29669. }
  29670. function n(e, t, i, n) {
  29671. if ('number' == typeof t) throw new TypeError('"value" argument must not be a number')
  29672. return 'undefined' != typeof ArrayBuffer && t instanceof ArrayBuffer
  29673. ? (function (e, t, i, n) {
  29674. if ((t.byteLength, i < 0 || t.byteLength < i)) throw new RangeError("'offset' is out of bounds")
  29675. if (t.byteLength < i + (n || 0)) throw new RangeError("'length' is out of bounds")
  29676. return (
  29677. (t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t, i) : new Uint8Array(t, i, n)),
  29678. u.TYPED_ARRAY_SUPPORT ? ((e = t).__proto__ = u.prototype) : (e = s(e, t)),
  29679. e
  29680. )
  29681. })(e, t, i, n)
  29682. : 'string' == typeof t
  29683. ? (function (e, t, i) {
  29684. if ((('string' == typeof i && '' !== i) || (i = 'utf8'), !u.isEncoding(i))) throw new TypeError('"encoding" must be a valid string encoding')
  29685. var n = 0 | c(t, i),
  29686. r = (e = o(e, n)).write(t, i)
  29687. return r !== n && (e = e.slice(0, r)), e
  29688. })(e, t, i)
  29689. : (function (e, t) {
  29690. if (u.isBuffer(t)) {
  29691. var i = 0 | l(t.length)
  29692. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i), e
  29693. }
  29694. if (t) {
  29695. if (('undefined' != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer) || 'length' in t)
  29696. return 'number' != typeof t.length ||
  29697. (function (e) {
  29698. return e != e
  29699. })(t.length)
  29700. ? o(e, 0)
  29701. : s(e, t)
  29702. if ('Buffer' === t.type && L(t.data)) return s(e, t.data)
  29703. }
  29704. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  29705. })(e, t)
  29706. }
  29707. function r(e) {
  29708. if ('number' != typeof e) throw new TypeError('"size" argument must be a number')
  29709. if (e < 0) throw new RangeError('"size" argument must not be negative')
  29710. }
  29711. function a(e, t) {
  29712. if ((r(t), (e = o(e, t < 0 ? 0 : 0 | l(t))), !u.TYPED_ARRAY_SUPPORT)) for (var i = 0; i < t; ++i) e[i] = 0
  29713. return e
  29714. }
  29715. function s(e, t) {
  29716. var i = t.length < 0 ? 0 : 0 | l(t.length)
  29717. e = o(e, i)
  29718. for (var n = 0; n < i; n += 1) e[n] = 255 & t[n]
  29719. return e
  29720. }
  29721. function l(e) {
  29722. if (e >= i()) throw new RangeError('Attempt to allocate Buffer larger than maximum size: 0x' + i().toString(16) + ' bytes')
  29723. return 0 | e
  29724. }
  29725. function c(e, t) {
  29726. if (u.isBuffer(e)) return e.length
  29727. if ('undefined' != typeof ArrayBuffer && 'function' == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer)) return e.byteLength
  29728. 'string' != typeof e && (e = '' + e)
  29729. var i = e.length
  29730. if (0 === i) return 0
  29731. for (var n = !1; ; )
  29732. switch (t) {
  29733. case 'ascii':
  29734. case 'latin1':
  29735. case 'binary':
  29736. return i
  29737. case 'utf8':
  29738. case 'utf-8':
  29739. case void 0:
  29740. return S(e).length
  29741. case 'ucs2':
  29742. case 'ucs-2':
  29743. case 'utf16le':
  29744. case 'utf-16le':
  29745. return 2 * i
  29746. case 'hex':
  29747. return i >>> 1
  29748. case 'base64':
  29749. return M(e).length
  29750. default:
  29751. if (n) return S(e).length
  29752. ;(t = ('' + t).toLowerCase()), (n = !0)
  29753. }
  29754. }
  29755. function h(e, t, i) {
  29756. var n = e[t]
  29757. ;(e[t] = e[i]), (e[i] = n)
  29758. }
  29759. function d(e, t, i, n, r) {
  29760. if (0 === e.length) return -1
  29761. if (
  29762. ('string' == typeof i ? ((n = i), (i = 0)) : 2147483647 < i ? (i = 2147483647) : i < -2147483648 && (i = -2147483648),
  29763. (i = +i),
  29764. isNaN(i) && (i = r ? 0 : e.length - 1),
  29765. i < 0 && (i = e.length + i),
  29766. i >= e.length)
  29767. ) {
  29768. if (r) return -1
  29769. i = e.length - 1
  29770. } else if (i < 0) {
  29771. if (!r) return -1
  29772. i = 0
  29773. }
  29774. if (('string' == typeof t && (t = u.from(t, n)), u.isBuffer(t))) return 0 === t.length ? -1 : p(e, t, i, n, r)
  29775. if ('number' == typeof t)
  29776. return (
  29777. (t &= 255),
  29778. u.TYPED_ARRAY_SUPPORT && 'function' == typeof Uint8Array.prototype.indexOf
  29779. ? r
  29780. ? Uint8Array.prototype.indexOf.call(e, t, i)
  29781. : Uint8Array.prototype.lastIndexOf.call(e, t, i)
  29782. : p(e, [t], i, n, r)
  29783. )
  29784. throw new TypeError('val must be string, number or Buffer')
  29785. }
  29786. function p(e, t, i, n, r) {
  29787. function o(e, t) {
  29788. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  29789. }
  29790. var a,
  29791. s = 1,
  29792. l = e.length,
  29793. c = t.length
  29794. if (void 0 !== n && ('ucs2' === (n = String(n).toLowerCase()) || 'ucs-2' === n || 'utf16le' === n || 'utf-16le' === n)) {
  29795. if (e.length < 2 || t.length < 2) return -1
  29796. ;(l /= s = 2), (c /= 2), (i /= 2)
  29797. }
  29798. if (r) {
  29799. var h = -1
  29800. for (a = i; a < l; a++)
  29801. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  29802. if ((-1 === h && (h = a), a - h + 1 === c)) return h * s
  29803. } else -1 !== h && (a -= a - h), (h = -1)
  29804. } else
  29805. for (l < i + c && (i = l - c), a = i; 0 <= a; a--) {
  29806. for (var u = !0, d = 0; d < c; d++)
  29807. if (o(e, a + d) !== o(t, d)) {
  29808. u = !1
  29809. break
  29810. }
  29811. if (u) return a
  29812. }
  29813. return -1
  29814. }
  29815. function g(e, t, i, n) {
  29816. i = Number(i) || 0
  29817. var r = e.length - i
  29818. n ? r < (n = Number(n)) && (n = r) : (n = r)
  29819. var o = t.length
  29820. if (o % 2 != 0) throw new TypeError('Invalid hex string')
  29821. o / 2 < n && (n = o / 2)
  29822. for (var a = 0; a < n; ++a) {
  29823. var s = parseInt(t.substr(2 * a, 2), 16)
  29824. if (isNaN(s)) return a
  29825. e[i + a] = s
  29826. }
  29827. return a
  29828. }
  29829. function m(e, t, i, n) {
  29830. return R(
  29831. (function (e) {
  29832. for (var t = [], i = 0; i < e.length; ++i) t.push(255 & e.charCodeAt(i))
  29833. return t
  29834. })(t),
  29835. e,
  29836. i,
  29837. n
  29838. )
  29839. }
  29840. function f(e, t, i) {
  29841. i = Math.min(e.length, i)
  29842. for (var n = [], r = t; r < i; ) {
  29843. var o,
  29844. a,
  29845. s,
  29846. l,
  29847. c = e[r],
  29848. h = null,
  29849. u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1
  29850. if (r + u <= i)
  29851. switch (u) {
  29852. case 1:
  29853. c < 128 && (h = c)
  29854. break
  29855. case 2:
  29856. 128 == (192 & (o = e[r + 1])) && 127 < (l = ((31 & c) << 6) | (63 & o)) && (h = l)
  29857. break
  29858. case 3:
  29859. ;(o = e[r + 1]), (a = e[r + 2]), 128 == (192 & o) && 128 == (192 & a) && 2047 < (l = ((15 & c) << 12) | ((63 & o) << 6) | (63 & a)) && (l < 55296 || 57343 < l) && (h = l)
  29860. break
  29861. case 4:
  29862. ;(o = e[r + 1]),
  29863. (a = e[r + 2]),
  29864. (s = e[r + 3]),
  29865. 128 == (192 & o) && 128 == (192 & a) && 128 == (192 & s) && 65535 < (l = ((15 & c) << 18) | ((63 & o) << 12) | ((63 & a) << 6) | (63 & s)) && l < 1114112 && (h = l)
  29866. }
  29867. null === h ? ((h = 65533), (u = 1)) : 65535 < h && ((h -= 65536), n.push(((h >>> 10) & 1023) | 55296), (h = 56320 | (1023 & h))), n.push(h), (r += u)
  29868. }
  29869. return (function (e) {
  29870. var t = e.length
  29871. if (t <= D) return String.fromCharCode.apply(String, e)
  29872. for (var i = '', n = 0; n < t; ) i += String.fromCharCode.apply(String, e.slice(n, (n += D)))
  29873. return i
  29874. })(n)
  29875. }
  29876. function v(e, t, i) {
  29877. var n = ''
  29878. i = Math.min(e.length, i)
  29879. for (var r = t; r < i; ++r) n += String.fromCharCode(127 & e[r])
  29880. return n
  29881. }
  29882. function y(e, t, i) {
  29883. var n = ''
  29884. i = Math.min(e.length, i)
  29885. for (var r = t; r < i; ++r) n += String.fromCharCode(e[r])
  29886. return n
  29887. }
  29888. function A(e, t, i) {
  29889. var n,
  29890. r = e.length
  29891. ;(!t || t < 0) && (t = 0), (!i || i < 0 || r < i) && (i = r)
  29892. for (var o = '', a = t; a < i; ++a) o += (n = e[a]) < 16 ? '0' + n.toString(16) : n.toString(16)
  29893. return o
  29894. }
  29895. function C(e, t, i) {
  29896. for (var n = e.slice(t, i), r = '', o = 0; o < n.length; o += 2) r += String.fromCharCode(n[o] + 256 * n[o + 1])
  29897. return r
  29898. }
  29899. function I(e, t, i) {
  29900. if (e % 1 != 0 || e < 0) throw new RangeError('offset is not uint')
  29901. if (i < e + t) throw new RangeError('Trying to access beyond buffer length')
  29902. }
  29903. function E(e, t, i, n, r, o) {
  29904. if (!u.isBuffer(e)) throw new TypeError('"buffer" argument must be a Buffer instance')
  29905. if (r < t || t < o) throw new RangeError('"value" argument is out of bounds')
  29906. if (i + n > e.length) throw new RangeError('Index out of range')
  29907. }
  29908. function _(e, t, i, n) {
  29909. t < 0 && (t = 65535 + t + 1)
  29910. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r) e[i + r] = (t & (255 << (8 * (n ? r : 1 - r)))) >>> (8 * (n ? r : 1 - r))
  29911. }
  29912. function b(e, t, i, n) {
  29913. t < 0 && (t = 4294967295 + t + 1)
  29914. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r) e[i + r] = (t >>> (8 * (n ? r : 3 - r))) & 255
  29915. }
  29916. function w(e, t, i, n) {
  29917. if (i + n > e.length) throw new RangeError('Index out of range')
  29918. if (i < 0) throw new RangeError('Index out of range')
  29919. }
  29920. function T(e, t, i, n, r) {
  29921. return r || w(e, 0, i, 4), O.write(e, t, i, n, 23, 4), i + 4
  29922. }
  29923. function x(e, t, i, n, r) {
  29924. return r || w(e, 0, i, 8), O.write(e, t, i, n, 52, 8), i + 8
  29925. }
  29926. function S(e, t) {
  29927. t = t || 1 / 0
  29928. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  29929. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  29930. if (!r) {
  29931. if (56319 < i) {
  29932. ;-1 < (t -= 3) && o.push(239, 191, 189)
  29933. continue
  29934. }
  29935. if (a + 1 === n) {
  29936. ;-1 < (t -= 3) && o.push(239, 191, 189)
  29937. continue
  29938. }
  29939. r = i
  29940. continue
  29941. }
  29942. if (i < 56320) {
  29943. ;-1 < (t -= 3) && o.push(239, 191, 189), (r = i)
  29944. continue
  29945. }
  29946. i = 65536 + (((r - 55296) << 10) | (i - 56320))
  29947. } else r && -1 < (t -= 3) && o.push(239, 191, 189)
  29948. if (((r = null), i < 128)) {
  29949. if ((t -= 1) < 0) break
  29950. o.push(i)
  29951. } else if (i < 2048) {
  29952. if ((t -= 2) < 0) break
  29953. o.push((i >> 6) | 192, (63 & i) | 128)
  29954. } else if (i < 65536) {
  29955. if ((t -= 3) < 0) break
  29956. o.push((i >> 12) | 224, ((i >> 6) & 63) | 128, (63 & i) | 128)
  29957. } else {
  29958. if (!(i < 1114112)) throw new Error('Invalid code point')
  29959. if ((t -= 4) < 0) break
  29960. o.push((i >> 18) | 240, ((i >> 12) & 63) | 128, ((i >> 6) & 63) | 128, (63 & i) | 128)
  29961. }
  29962. }
  29963. return o
  29964. }
  29965. function M(e) {
  29966. return P.toByteArray(
  29967. (function (e) {
  29968. if (
  29969. (e = (function (e) {
  29970. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, '')
  29971. })(e).replace(t, '')).length < 2
  29972. )
  29973. return ''
  29974. for (; e.length % 4 != 0; ) e += '='
  29975. return e
  29976. })(e)
  29977. )
  29978. }
  29979. function R(e, t, i, n) {
  29980. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r) t[r + i] = e[r]
  29981. return r
  29982. }
  29983. var P = N('base64-js'),
  29984. O = N('ieee754'),
  29985. L = N('isarray')
  29986. ;(F.Buffer = u),
  29987. (F.SlowBuffer = function (e) {
  29988. return +e != e && (e = 0), u.alloc(+e)
  29989. }),
  29990. (F.INSPECT_MAX_BYTES = 50),
  29991. (u.TYPED_ARRAY_SUPPORT =
  29992. void 0 !== e.TYPED_ARRAY_SUPPORT
  29993. ? e.TYPED_ARRAY_SUPPORT
  29994. : (function () {
  29995. try {
  29996. var e = new Uint8Array(1)
  29997. return (
  29998. (e.__proto__ = {
  29999. __proto__: Uint8Array.prototype,
  30000. foo: function () {
  30001. return 42
  30002. }
  30003. }),
  30004. 42 === e.foo() && 'function' == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  30005. )
  30006. } catch (e) {
  30007. return !1
  30008. }
  30009. })()),
  30010. (F.kMaxLength = i()),
  30011. (u.poolSize = 8192),
  30012. (u._augment = function (e) {
  30013. return (e.__proto__ = u.prototype), e
  30014. }),
  30015. (u.from = function (e, t, i) {
  30016. return n(null, e, t, i)
  30017. }),
  30018. u.TYPED_ARRAY_SUPPORT &&
  30019. ((u.prototype.__proto__ = Uint8Array.prototype),
  30020. (u.__proto__ = Uint8Array),
  30021. 'undefined' != typeof Symbol &&
  30022. Symbol.species &&
  30023. u[Symbol.species] === u &&
  30024. Object.defineProperty(u, Symbol.species, {
  30025. value: null,
  30026. configurable: !0
  30027. })),
  30028. (u.alloc = function (e, t, i) {
  30029. return (function (e, t, i, n) {
  30030. return r(t), t <= 0 ? o(e, t) : void 0 !== i ? ('string' == typeof n ? o(e, t).fill(i, n) : o(e, t).fill(i)) : o(e, t)
  30031. })(null, e, t, i)
  30032. }),
  30033. (u.allocUnsafe = function (e) {
  30034. return a(null, e)
  30035. }),
  30036. (u.allocUnsafeSlow = function (e) {
  30037. return a(null, e)
  30038. }),
  30039. (u.isBuffer = function (e) {
  30040. return !(null == e || !e._isBuffer)
  30041. }),
  30042. (u.compare = function (e, t) {
  30043. if (!u.isBuffer(e) || !u.isBuffer(t)) throw new TypeError('Arguments must be Buffers')
  30044. if (e === t) return 0
  30045. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  30046. if (e[r] !== t[r]) {
  30047. ;(i = e[r]), (n = t[r])
  30048. break
  30049. }
  30050. return i < n ? -1 : n < i ? 1 : 0
  30051. }),
  30052. (u.isEncoding = function (e) {
  30053. switch (String(e).toLowerCase()) {
  30054. case 'hex':
  30055. case 'utf8':
  30056. case 'utf-8':
  30057. case 'ascii':
  30058. case 'latin1':
  30059. case 'binary':
  30060. case 'base64':
  30061. case 'ucs2':
  30062. case 'ucs-2':
  30063. case 'utf16le':
  30064. case 'utf-16le':
  30065. return !0
  30066. default:
  30067. return !1
  30068. }
  30069. }),
  30070. (u.concat = function (e, t) {
  30071. if (!L(e)) throw new TypeError('"list" argument must be an Array of Buffers')
  30072. if (0 === e.length) return u.alloc(0)
  30073. var i
  30074. if (void 0 === t) for (i = t = 0; i < e.length; ++i) t += e[i].length
  30075. var n = u.allocUnsafe(t),
  30076. r = 0
  30077. for (i = 0; i < e.length; ++i) {
  30078. var o = e[i]
  30079. if (!u.isBuffer(o)) throw new TypeError('"list" argument must be an Array of Buffers')
  30080. o.copy(n, r), (r += o.length)
  30081. }
  30082. return n
  30083. }),
  30084. (u.byteLength = c),
  30085. (u.prototype._isBuffer = !0),
  30086. (u.prototype.swap16 = function () {
  30087. var e = this.length
  30088. if (e % 2 != 0) throw new RangeError('Buffer size must be a multiple of 16-bits')
  30089. for (var t = 0; t < e; t += 2) h(this, t, t + 1)
  30090. return this
  30091. }),
  30092. (u.prototype.swap32 = function () {
  30093. var e = this.length
  30094. if (e % 4 != 0) throw new RangeError('Buffer size must be a multiple of 32-bits')
  30095. for (var t = 0; t < e; t += 4) h(this, t, t + 3), h(this, t + 1, t + 2)
  30096. return this
  30097. }),
  30098. (u.prototype.swap64 = function () {
  30099. var e = this.length
  30100. if (e % 8 != 0) throw new RangeError('Buffer size must be a multiple of 64-bits')
  30101. for (var t = 0; t < e; t += 8) h(this, t, t + 7), h(this, t + 1, t + 6), h(this, t + 2, t + 5), h(this, t + 3, t + 4)
  30102. return this
  30103. }),
  30104. (u.prototype.toString = function () {
  30105. var e = 0 | this.length
  30106. return 0 == e
  30107. ? ''
  30108. : 0 === arguments.length
  30109. ? f(this, 0, e)
  30110. : function (e, t, i) {
  30111. var n,
  30112. r,
  30113. o,
  30114. a = !1
  30115. if (((void 0 === t || t < 0) && (t = 0), t > this.length)) return ''
  30116. if (((void 0 === i || i > this.length) && (i = this.length), i <= 0)) return ''
  30117. if ((i >>>= 0) <= (t >>>= 0)) return ''
  30118. for (e = e || 'utf8'; ; )
  30119. switch (e) {
  30120. case 'hex':
  30121. return A(this, t, i)
  30122. case 'utf8':
  30123. case 'utf-8':
  30124. return f(this, t, i)
  30125. case 'ascii':
  30126. return v(this, t, i)
  30127. case 'latin1':
  30128. case 'binary':
  30129. return y(this, t, i)
  30130. case 'base64':
  30131. return (n = this), (o = i), 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o))
  30132. case 'ucs2':
  30133. case 'ucs-2':
  30134. case 'utf16le':
  30135. case 'utf-16le':
  30136. return C(this, t, i)
  30137. default:
  30138. if (a) throw new TypeError('Unknown encoding: ' + e)
  30139. ;(e = (e + '').toLowerCase()), (a = !0)
  30140. }
  30141. }.apply(this, arguments)
  30142. }),
  30143. (u.prototype.equals = function (e) {
  30144. if (!u.isBuffer(e)) throw new TypeError('Argument must be a Buffer')
  30145. return this === e || 0 === u.compare(this, e)
  30146. }),
  30147. (u.prototype.inspect = function () {
  30148. var e = '',
  30149. t = F.INSPECT_MAX_BYTES
  30150. return 0 < this.length && ((e = this.toString('hex', 0, t).match(/.{2}/g).join(' ')), this.length > t && (e += ' ... ')), '<Buffer ' + e + '>'
  30151. }),
  30152. (u.prototype.compare = function (e, t, i, n, r) {
  30153. if (!u.isBuffer(e)) throw new TypeError('Argument must be a Buffer')
  30154. if ((void 0 === t && (t = 0), void 0 === i && (i = e ? e.length : 0), void 0 === n && (n = 0), void 0 === r && (r = this.length), t < 0 || i > e.length || n < 0 || r > this.length))
  30155. throw new RangeError('out of range index')
  30156. if (r <= n && i <= t) return 0
  30157. if (r <= n) return -1
  30158. if (i <= t) return 1
  30159. if (this === e) return 0
  30160. for (var o = (r >>>= 0) - (n >>>= 0), a = (i >>>= 0) - (t >>>= 0), s = Math.min(o, a), l = this.slice(n, r), c = e.slice(t, i), h = 0; h < s; ++h)
  30161. if (l[h] !== c[h]) {
  30162. ;(o = l[h]), (a = c[h])
  30163. break
  30164. }
  30165. return o < a ? -1 : a < o ? 1 : 0
  30166. }),
  30167. (u.prototype.includes = function (e, t, i) {
  30168. return -1 !== this.indexOf(e, t, i)
  30169. }),
  30170. (u.prototype.indexOf = function (e, t, i) {
  30171. return d(this, e, t, i, !0)
  30172. }),
  30173. (u.prototype.lastIndexOf = function (e, t, i) {
  30174. return d(this, e, t, i, !1)
  30175. }),
  30176. (u.prototype.write = function (e, t, i, n) {
  30177. if (void 0 === t) (n = 'utf8'), (i = this.length), (t = 0)
  30178. else if (void 0 === i && 'string' == typeof t) (n = t), (i = this.length), (t = 0)
  30179. else {
  30180. if (!isFinite(t)) throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported')
  30181. ;(t |= 0), isFinite(i) ? ((i |= 0), void 0 === n && (n = 'utf8')) : ((n = i), (i = void 0))
  30182. }
  30183. var r,
  30184. o,
  30185. a,
  30186. s,
  30187. l,
  30188. c,
  30189. h,
  30190. u,
  30191. d,
  30192. p = this.length - t
  30193. if (((void 0 === i || p < i) && (i = p), (0 < e.length && (i < 0 || t < 0)) || t > this.length)) throw new RangeError('Attempt to write outside buffer bounds')
  30194. n = n || 'utf8'
  30195. for (var f = !1; ; )
  30196. switch (n) {
  30197. case 'hex':
  30198. return g(this, e, t, i)
  30199. case 'utf8':
  30200. case 'utf-8':
  30201. return (u = t), (d = i), R(S(e, (h = this).length - u), h, u, d)
  30202. case 'ascii':
  30203. return m(this, e, t, i)
  30204. case 'latin1':
  30205. case 'binary':
  30206. return m(this, e, t, i)
  30207. case 'base64':
  30208. return (s = this), (l = t), (c = i), R(M(e), s, l, c)
  30209. case 'ucs2':
  30210. case 'ucs-2':
  30211. case 'utf16le':
  30212. case 'utf-16le':
  30213. return (
  30214. (o = t),
  30215. (a = i),
  30216. R(
  30217. (function (e, t) {
  30218. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a) (i = e.charCodeAt(a)), (n = i >> 8), (r = i % 256), o.push(r), o.push(n)
  30219. return o
  30220. })(e, (r = this).length - o),
  30221. r,
  30222. o,
  30223. a
  30224. )
  30225. )
  30226. default:
  30227. if (f) throw new TypeError('Unknown encoding: ' + n)
  30228. ;(n = ('' + n).toLowerCase()), (f = !0)
  30229. }
  30230. }),
  30231. (u.prototype.toJSON = function () {
  30232. return {
  30233. type: 'Buffer',
  30234. data: Array.prototype.slice.call(this._arr || this, 0)
  30235. }
  30236. })
  30237. var D = 4096
  30238. ;(u.prototype.slice = function (e, t) {
  30239. var i,
  30240. n = this.length
  30241. if (((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n), (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n), t < e && (t = e), u.TYPED_ARRAY_SUPPORT))
  30242. (i = this.subarray(e, t)).__proto__ = u.prototype
  30243. else {
  30244. var r = t - e
  30245. i = new u(r, void 0)
  30246. for (var o = 0; o < r; ++o) i[o] = this[o + e]
  30247. }
  30248. return i
  30249. }),
  30250. (u.prototype.readUIntLE = function (e, t, i) {
  30251. ;(e |= 0), (t |= 0), i || I(e, t, this.length)
  30252. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); ) n += this[e + o] * r
  30253. return n
  30254. }),
  30255. (u.prototype.readUIntBE = function (e, t, i) {
  30256. ;(e |= 0), (t |= 0), i || I(e, t, this.length)
  30257. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); ) n += this[e + --t] * r
  30258. return n
  30259. }),
  30260. (u.prototype.readUInt8 = function (e, t) {
  30261. return t || I(e, 1, this.length), this[e]
  30262. }),
  30263. (u.prototype.readUInt16LE = function (e, t) {
  30264. return t || I(e, 2, this.length), this[e] | (this[e + 1] << 8)
  30265. }),
  30266. (u.prototype.readUInt16BE = function (e, t) {
  30267. return t || I(e, 2, this.length), (this[e] << 8) | this[e + 1]
  30268. }),
  30269. (u.prototype.readUInt32LE = function (e, t) {
  30270. return t || I(e, 4, this.length), (this[e] | (this[e + 1] << 8) | (this[e + 2] << 16)) + 16777216 * this[e + 3]
  30271. }),
  30272. (u.prototype.readUInt32BE = function (e, t) {
  30273. return t || I(e, 4, this.length), 16777216 * this[e] + ((this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3])
  30274. }),
  30275. (u.prototype.readIntLE = function (e, t, i) {
  30276. ;(e |= 0), (t |= 0), i || I(e, t, this.length)
  30277. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); ) n += this[e + o] * r
  30278. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)), n
  30279. }),
  30280. (u.prototype.readIntBE = function (e, t, i) {
  30281. ;(e |= 0), (t |= 0), i || I(e, t, this.length)
  30282. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); ) o += this[e + --n] * r
  30283. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)), o
  30284. }),
  30285. (u.prototype.readInt8 = function (e, t) {
  30286. return t || I(e, 1, this.length), 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  30287. }),
  30288. (u.prototype.readInt16LE = function (e, t) {
  30289. t || I(e, 2, this.length)
  30290. var i = this[e] | (this[e + 1] << 8)
  30291. return 32768 & i ? 4294901760 | i : i
  30292. }),
  30293. (u.prototype.readInt16BE = function (e, t) {
  30294. t || I(e, 2, this.length)
  30295. var i = this[e + 1] | (this[e] << 8)
  30296. return 32768 & i ? 4294901760 | i : i
  30297. }),
  30298. (u.prototype.readInt32LE = function (e, t) {
  30299. return t || I(e, 4, this.length), this[e] | (this[e + 1] << 8) | (this[e + 2] << 16) | (this[e + 3] << 24)
  30300. }),
  30301. (u.prototype.readInt32BE = function (e, t) {
  30302. return t || I(e, 4, this.length), (this[e] << 24) | (this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3]
  30303. }),
  30304. (u.prototype.readFloatLE = function (e, t) {
  30305. return t || I(e, 4, this.length), O.read(this, e, !0, 23, 4)
  30306. }),
  30307. (u.prototype.readFloatBE = function (e, t) {
  30308. return t || I(e, 4, this.length), O.read(this, e, !1, 23, 4)
  30309. }),
  30310. (u.prototype.readDoubleLE = function (e, t) {
  30311. return t || I(e, 8, this.length), O.read(this, e, !0, 52, 8)
  30312. }),
  30313. (u.prototype.readDoubleBE = function (e, t) {
  30314. return t || I(e, 8, this.length), O.read(this, e, !1, 52, 8)
  30315. }),
  30316. (u.prototype.writeUIntLE = function (e, t, i, n) {
  30317. ;(e = +e), (t |= 0), (i |= 0), n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0)
  30318. var r = 1,
  30319. o = 0
  30320. for (this[t] = 255 & e; ++o < i && (r *= 256); ) this[t + o] = (e / r) & 255
  30321. return t + i
  30322. }),
  30323. (u.prototype.writeUIntBE = function (e, t, i, n) {
  30324. ;(e = +e), (t |= 0), (i |= 0), n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0)
  30325. var r = i - 1,
  30326. o = 1
  30327. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); ) this[t + r] = (e / o) & 255
  30328. return t + i
  30329. }),
  30330. (u.prototype.writeUInt8 = function (e, t, i) {
  30331. return (e = +e), (t |= 0), i || E(this, e, t, 1, 255, 0), u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), (this[t] = 255 & e), t + 1
  30332. }),
  30333. (u.prototype.writeUInt16LE = function (e, t, i) {
  30334. return (e = +e), (t |= 0), i || E(this, e, t, 2, 65535, 0), u.TYPED_ARRAY_SUPPORT ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8)) : _(this, e, t, !0), t + 2
  30335. }),
  30336. (u.prototype.writeUInt16BE = function (e, t, i) {
  30337. return (e = +e), (t |= 0), i || E(this, e, t, 2, 65535, 0), u.TYPED_ARRAY_SUPPORT ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e)) : _(this, e, t, !1), t + 2
  30338. }),
  30339. (u.prototype.writeUInt32LE = function (e, t, i) {
  30340. return (
  30341. (e = +e),
  30342. (t |= 0),
  30343. i || E(this, e, t, 4, 4294967295, 0),
  30344. u.TYPED_ARRAY_SUPPORT ? ((this[t + 3] = e >>> 24), (this[t + 2] = e >>> 16), (this[t + 1] = e >>> 8), (this[t] = 255 & e)) : b(this, e, t, !0),
  30345. t + 4
  30346. )
  30347. }),
  30348. (u.prototype.writeUInt32BE = function (e, t, i) {
  30349. return (
  30350. (e = +e),
  30351. (t |= 0),
  30352. i || E(this, e, t, 4, 4294967295, 0),
  30353. u.TYPED_ARRAY_SUPPORT ? ((this[t] = e >>> 24), (this[t + 1] = e >>> 16), (this[t + 2] = e >>> 8), (this[t + 3] = 255 & e)) : b(this, e, t, !1),
  30354. t + 4
  30355. )
  30356. }),
  30357. (u.prototype.writeIntLE = function (e, t, i, n) {
  30358. if (((e = +e), (t |= 0), !n)) {
  30359. var r = Math.pow(2, 8 * i - 1)
  30360. E(this, e, t, i, r - 1, -r)
  30361. }
  30362. var o = 0,
  30363. a = 1,
  30364. s = 0
  30365. for (this[t] = 255 & e; ++o < i && (a *= 256); ) e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1), (this[t + o] = (((e / a) >> 0) - s) & 255)
  30366. return t + i
  30367. }),
  30368. (u.prototype.writeIntBE = function (e, t, i, n) {
  30369. if (((e = +e), (t |= 0), !n)) {
  30370. var r = Math.pow(2, 8 * i - 1)
  30371. E(this, e, t, i, r - 1, -r)
  30372. }
  30373. var o = i - 1,
  30374. a = 1,
  30375. s = 0
  30376. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); ) e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1), (this[t + o] = (((e / a) >> 0) - s) & 255)
  30377. return t + i
  30378. }),
  30379. (u.prototype.writeInt8 = function (e, t, i) {
  30380. return (e = +e), (t |= 0), i || E(this, e, t, 1, 127, -128), u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), e < 0 && (e = 255 + e + 1), (this[t] = 255 & e), t + 1
  30381. }),
  30382. (u.prototype.writeInt16LE = function (e, t, i) {
  30383. return (e = +e), (t |= 0), i || E(this, e, t, 2, 32767, -32768), u.TYPED_ARRAY_SUPPORT ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8)) : _(this, e, t, !0), t + 2
  30384. }),
  30385. (u.prototype.writeInt16BE = function (e, t, i) {
  30386. return (e = +e), (t |= 0), i || E(this, e, t, 2, 32767, -32768), u.TYPED_ARRAY_SUPPORT ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e)) : _(this, e, t, !1), t + 2
  30387. }),
  30388. (u.prototype.writeInt32LE = function (e, t, i) {
  30389. return (
  30390. (e = +e),
  30391. (t |= 0),
  30392. i || E(this, e, t, 4, 2147483647, -2147483648),
  30393. u.TYPED_ARRAY_SUPPORT ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8), (this[t + 2] = e >>> 16), (this[t + 3] = e >>> 24)) : b(this, e, t, !0),
  30394. t + 4
  30395. )
  30396. }),
  30397. (u.prototype.writeInt32BE = function (e, t, i) {
  30398. return (
  30399. (e = +e),
  30400. (t |= 0),
  30401. i || E(this, e, t, 4, 2147483647, -2147483648),
  30402. e < 0 && (e = 4294967295 + e + 1),
  30403. u.TYPED_ARRAY_SUPPORT ? ((this[t] = e >>> 24), (this[t + 1] = e >>> 16), (this[t + 2] = e >>> 8), (this[t + 3] = 255 & e)) : b(this, e, t, !1),
  30404. t + 4
  30405. )
  30406. }),
  30407. (u.prototype.writeFloatLE = function (e, t, i) {
  30408. return T(this, e, t, !0, i)
  30409. }),
  30410. (u.prototype.writeFloatBE = function (e, t, i) {
  30411. return T(this, e, t, !1, i)
  30412. }),
  30413. (u.prototype.writeDoubleLE = function (e, t, i) {
  30414. return x(this, e, t, !0, i)
  30415. }),
  30416. (u.prototype.writeDoubleBE = function (e, t, i) {
  30417. return x(this, e, t, !1, i)
  30418. }),
  30419. (u.prototype.copy = function (e, t, i, n) {
  30420. if (((i = i || 0), n || 0 === n || (n = this.length), t >= e.length && (t = e.length), (t = t || 0), 0 < n && n < i && (n = i), n === i)) return 0
  30421. if (0 === e.length || 0 === this.length) return 0
  30422. if (t < 0) throw new RangeError('targetStart out of bounds')
  30423. if (i < 0 || i >= this.length) throw new RangeError('sourceStart out of bounds')
  30424. if (n < 0) throw new RangeError('sourceEnd out of bounds')
  30425. n > this.length && (n = this.length), e.length - t < n - i && (n = e.length - t + i)
  30426. var r,
  30427. o = n - i
  30428. if (this === e && i < t && t < n) for (r = o - 1; 0 <= r; --r) e[r + t] = this[r + i]
  30429. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT) for (r = 0; r < o; ++r) e[r + t] = this[r + i]
  30430. else Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t)
  30431. return o
  30432. }),
  30433. (u.prototype.fill = function (e, t, i, n) {
  30434. if ('string' == typeof e) {
  30435. if (('string' == typeof t ? ((n = t), (t = 0), (i = this.length)) : 'string' == typeof i && ((n = i), (i = this.length)), 1 === e.length)) {
  30436. var r = e.charCodeAt(0)
  30437. r < 256 && (e = r)
  30438. }
  30439. if (void 0 !== n && 'string' != typeof n) throw new TypeError('encoding must be a string')
  30440. if ('string' == typeof n && !u.isEncoding(n)) throw new TypeError('Unknown encoding: ' + n)
  30441. } else 'number' == typeof e && (e &= 255)
  30442. if (t < 0 || this.length < t || this.length < i) throw new RangeError('Out of range index')
  30443. if (i <= t) return this
  30444. var o
  30445. if (((t >>>= 0), (i = void 0 === i ? this.length : i >>> 0), 'number' == typeof (e = e || 0))) for (o = t; o < i; ++o) this[o] = e
  30446. else {
  30447. var a = u.isBuffer(e) ? e : S(new u(e, n).toString()),
  30448. s = a.length
  30449. for (o = 0; o < i - t; ++o) this[o + t] = a[o % s]
  30450. }
  30451. return this
  30452. })
  30453. var t = /[^+\/0-9A-Za-z-_]/g
  30454. }).call(this, 'undefined' != typeof global ? global : 'undefined' != typeof self ? self : 'undefined' != typeof window ? window : {})
  30455. },
  30456. {
  30457. 'base64-js': 199,
  30458. ieee754: 200,
  30459. isarray: 201
  30460. }
  30461. ],
  30462. 199: [
  30463. function (e, t, i) {
  30464. 'use strict'
  30465. function l(e) {
  30466. var t = e.length
  30467. if (0 < t % 4) throw new Error('Invalid string. Length must be a multiple of 4')
  30468. return '=' === e[t - 2] ? 2 : '=' === e[t - 1] ? 1 : 0
  30469. }
  30470. function c(e, t, i) {
  30471. for (var n, r = [], o = t; o < i; o += 3) (n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2]), r.push(h[((a = n) >> 18) & 63] + h[(a >> 12) & 63] + h[(a >> 6) & 63] + h[63 & a])
  30472. var a
  30473. return r.join('')
  30474. }
  30475. ;(i.byteLength = function (e) {
  30476. return (3 * e.length) / 4 - l(e)
  30477. }),
  30478. (i.toByteArray = function (e) {
  30479. var t,
  30480. i,
  30481. n,
  30482. r,
  30483. o,
  30484. a = e.length
  30485. ;(r = l(e)), (o = new d((3 * a) / 4 - r)), (i = 0 < r ? a - 4 : a)
  30486. var s = 0
  30487. for (t = 0; t < i; t += 4, 3)
  30488. (n = (u[e.charCodeAt(t)] << 18) | (u[e.charCodeAt(t + 1)] << 12) | (u[e.charCodeAt(t + 2)] << 6) | u[e.charCodeAt(t + 3)]),
  30489. (o[s++] = (n >> 16) & 255),
  30490. (o[s++] = (n >> 8) & 255),
  30491. (o[s++] = 255 & n)
  30492. return (
  30493. 2 === r
  30494. ? ((n = (u[e.charCodeAt(t)] << 2) | (u[e.charCodeAt(t + 1)] >> 4)), (o[s++] = 255 & n))
  30495. : 1 === r && ((n = (u[e.charCodeAt(t)] << 10) | (u[e.charCodeAt(t + 1)] << 4) | (u[e.charCodeAt(t + 2)] >> 2)), (o[s++] = (n >> 8) & 255), (o[s++] = 255 & n)),
  30496. o
  30497. )
  30498. }),
  30499. (i.fromByteArray = function (e) {
  30500. for (var t, i = e.length, n = i % 3, r = '', o = [], a = 0, s = i - n; a < s; a += 16383) o.push(c(e, a, s < a + 16383 ? s : a + 16383))
  30501. return (
  30502. 1 == n
  30503. ? ((t = e[i - 1]), (r += h[t >> 2]), (r += h[(t << 4) & 63]), (r += '=='))
  30504. : 2 == n && ((t = (e[i - 2] << 8) + e[i - 1]), (r += h[t >> 10]), (r += h[(t >> 4) & 63]), (r += h[(t << 2) & 63]), (r += '=')),
  30505. o.push(r),
  30506. o.join('')
  30507. )
  30508. })
  30509. for (var h = [], u = [], d = 'undefined' != typeof Uint8Array ? Uint8Array : Array, n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', r = 0, o = n.length; r < o; ++r)
  30510. (h[r] = n[r]), (u[n.charCodeAt(r)] = r)
  30511. ;(u['-'.charCodeAt(0)] = 62), (u['_'.charCodeAt(0)] = 63)
  30512. },
  30513. {}
  30514. ],
  30515. 200: [
  30516. function (e, t, i) {
  30517. ;(i.read = function (e, t, i, n, r) {
  30518. var o,
  30519. a,
  30520. s = 8 * r - n - 1,
  30521. l = (1 << s) - 1,
  30522. c = l >> 1,
  30523. h = -7,
  30524. u = i ? r - 1 : 0,
  30525. d = i ? -1 : 1,
  30526. p = e[t + u]
  30527. for (u += d, o = p & ((1 << -h) - 1), p >>= -h, h += s; 0 < h; o = 256 * o + e[t + u], u += d, h -= 8);
  30528. for (a = o & ((1 << -h) - 1), o >>= -h, h += n; 0 < h; a = 256 * a + e[t + u], u += d, h -= 8);
  30529. if (0 === o) o = 1 - c
  30530. else {
  30531. if (o === l) return a ? NaN : (1 / 0) * (p ? -1 : 1)
  30532. ;(a += Math.pow(2, n)), (o -= c)
  30533. }
  30534. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30535. }),
  30536. (i.write = function (e, t, i, n, r, o) {
  30537. var a,
  30538. s,
  30539. l,
  30540. c = 8 * o - r - 1,
  30541. h = (1 << c) - 1,
  30542. u = h >> 1,
  30543. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  30544. p = n ? 0 : o - 1,
  30545. f = n ? 1 : -1,
  30546. g = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0
  30547. for (
  30548. t = Math.abs(t),
  30549. isNaN(t) || t === 1 / 0
  30550. ? ((s = isNaN(t) ? 1 : 0), (a = h))
  30551. : ((a = Math.floor(Math.log(t) / Math.LN2)),
  30552. t * (l = Math.pow(2, -a)) < 1 && (a--, (l *= 2)),
  30553. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++, (l /= 2)),
  30554. h <= a + u ? ((s = 0), (a = h)) : 1 <= a + u ? ((s = (t * l - 1) * Math.pow(2, r)), (a += u)) : ((s = t * Math.pow(2, u - 1) * Math.pow(2, r)), (a = 0)));
  30555. 8 <= r;
  30556. e[i + p] = 255 & s, p += f, s /= 256, r -= 8
  30557. );
  30558. for (a = (a << r) | s, c += r; 0 < c; e[i + p] = 255 & a, p += f, a /= 256, c -= 8);
  30559. e[i + p - f] |= 128 * g
  30560. })
  30561. },
  30562. {}
  30563. ],
  30564. 201: [
  30565. function (e, t, i) {
  30566. var n = {}.toString
  30567. t.exports =
  30568. Array.isArray ||
  30569. function (e) {
  30570. return '[object Array]' == n.call(e)
  30571. }
  30572. },
  30573. {}
  30574. ],
  30575. 202: [
  30576. function (e, t, i) {
  30577. function n() {
  30578. ;(this._events = this._events || {}), (this._maxListeners = this._maxListeners || void 0)
  30579. }
  30580. function l(e) {
  30581. return 'function' == typeof e
  30582. }
  30583. function c(e) {
  30584. return 'object' == typeof e && null !== e
  30585. }
  30586. function h(e) {
  30587. return void 0 === e
  30588. }
  30589. ;(((t.exports = n).EventEmitter = n).prototype._events = void 0),
  30590. (n.prototype._maxListeners = void 0),
  30591. (n.defaultMaxListeners = 10),
  30592. (n.prototype.setMaxListeners = function (e) {
  30593. if (
  30594. !(function (e) {
  30595. return 'number' == typeof e
  30596. })(e) ||
  30597. e < 0 ||
  30598. isNaN(e)
  30599. )
  30600. throw TypeError('n must be a positive number')
  30601. return (this._maxListeners = e), this
  30602. }),
  30603. (n.prototype.emit = function (e) {
  30604. var t, i, n, r, o, a
  30605. if ((this._events || (this._events = {}), 'error' === e && (!this._events.error || (c(this._events.error) && !this._events.error.length)))) {
  30606. if ((t = arguments[1]) instanceof Error) throw t
  30607. var s = new Error('Uncaught, unspecified "error" event. (' + t + ')')
  30608. throw ((s.context = t), s)
  30609. }
  30610. if (h((i = this._events[e]))) return !1
  30611. if (l(i))
  30612. switch (arguments.length) {
  30613. case 1:
  30614. i.call(this)
  30615. break
  30616. case 2:
  30617. i.call(this, arguments[1])
  30618. break
  30619. case 3:
  30620. i.call(this, arguments[1], arguments[2])
  30621. break
  30622. default:
  30623. ;(r = Array.prototype.slice.call(arguments, 1)), i.apply(this, r)
  30624. }
  30625. else if (c(i)) for (r = Array.prototype.slice.call(arguments, 1), n = (a = i.slice()).length, o = 0; o < n; o++) a[o].apply(this, r)
  30626. return !0
  30627. }),
  30628. (n.prototype.on = n.prototype.addListener =
  30629. function (e, t) {
  30630. var i
  30631. if (!l(t)) throw TypeError('listener must be a function')
  30632. return (
  30633. this._events || (this._events = {}),
  30634. this._events.newListener && this.emit('newListener', e, l(t.listener) ? t.listener : t),
  30635. this._events[e] ? (c(this._events[e]) ? this._events[e].push(t) : (this._events[e] = [this._events[e], t])) : (this._events[e] = t),
  30636. c(this._events[e]) &&
  30637. !this._events[e].warned &&
  30638. (i = h(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners) &&
  30639. 0 < i &&
  30640. this._events[e].length > i &&
  30641. ((this._events[e].warned = !0),
  30642. console.error('(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.', this._events[e].length),
  30643. 'function' == typeof console.trace && console.trace()),
  30644. this
  30645. )
  30646. }),
  30647. (n.prototype.once = function (e, t) {
  30648. function i() {
  30649. this.removeListener(e, i), n || ((n = !0), t.apply(this, arguments))
  30650. }
  30651. if (!l(t)) throw TypeError('listener must be a function')
  30652. var n = !1
  30653. return (i.listener = t), this.on(e, i), this
  30654. }),
  30655. (n.prototype.removeListener = function (e, t) {
  30656. var i, n, r, o
  30657. if (!l(t)) throw TypeError('listener must be a function')
  30658. if (!this._events || !this._events[e]) return this
  30659. if (((r = (i = this._events[e]).length), (n = -1), i === t || (l(i.listener) && i.listener === t)))
  30660. delete this._events[e], this._events.removeListener && this.emit('removeListener', e, t)
  30661. else if (c(i)) {
  30662. for (o = r; 0 < o--; )
  30663. if (i[o] === t || (i[o].listener && i[o].listener === t)) {
  30664. n = o
  30665. break
  30666. }
  30667. if (n < 0) return this
  30668. 1 === i.length ? ((i.length = 0), delete this._events[e]) : i.splice(n, 1), this._events.removeListener && this.emit('removeListener', e, t)
  30669. }
  30670. return this
  30671. }),
  30672. (n.prototype.removeAllListeners = function (e) {
  30673. var t, i
  30674. if (!this._events) return this
  30675. if (!this._events.removeListener) return 0 === arguments.length ? (this._events = {}) : this._events[e] && delete this._events[e], this
  30676. if (0 === arguments.length) {
  30677. for (t in this._events) 'removeListener' !== t && this.removeAllListeners(t)
  30678. return this.removeAllListeners('removeListener'), (this._events = {}), this
  30679. }
  30680. if (l((i = this._events[e]))) this.removeListener(e, i)
  30681. else if (i) for (; i.length; ) this.removeListener(e, i[i.length - 1])
  30682. return delete this._events[e], this
  30683. }),
  30684. (n.prototype.listeners = function (e) {
  30685. return this._events && this._events[e] ? (l(this._events[e]) ? [this._events[e]] : this._events[e].slice()) : []
  30686. }),
  30687. (n.prototype.listenerCount = function (e) {
  30688. if (this._events) {
  30689. var t = this._events[e]
  30690. if (l(t)) return 1
  30691. if (t) return t.length
  30692. }
  30693. return 0
  30694. }),
  30695. (n.listenerCount = function (e, t) {
  30696. return e.listenerCount(t)
  30697. })
  30698. },
  30699. {}
  30700. ],
  30701. 203: [
  30702. function (e, t, i) {
  30703. function n() {
  30704. throw new Error('setTimeout has not been defined')
  30705. }
  30706. function r() {
  30707. throw new Error('clearTimeout has not been defined')
  30708. }
  30709. function o(t) {
  30710. if (h === setTimeout) return setTimeout(t, 0)
  30711. if ((h === n || !h) && setTimeout) return (h = setTimeout), setTimeout(t, 0)
  30712. try {
  30713. return h(t, 0)
  30714. } catch (e) {
  30715. try {
  30716. return h.call(null, t, 0)
  30717. } catch (e) {
  30718. return h.call(this, t, 0)
  30719. }
  30720. }
  30721. }
  30722. function a() {
  30723. g && p && ((g = !1), p.length ? (f = p.concat(f)) : (m = -1), f.length && s())
  30724. }
  30725. function s() {
  30726. if (!g) {
  30727. var e = o(a)
  30728. g = !0
  30729. for (var t = f.length; t; ) {
  30730. for (p = f, f = []; ++m < t; ) p && p[m].run()
  30731. ;(m = -1), (t = f.length)
  30732. }
  30733. ;(p = null),
  30734. (g = !1),
  30735. (function (t) {
  30736. if (u === clearTimeout) return clearTimeout(t)
  30737. if ((u === r || !u) && clearTimeout) return (u = clearTimeout), clearTimeout(t)
  30738. try {
  30739. u(t)
  30740. } catch (e) {
  30741. try {
  30742. return u.call(null, t)
  30743. } catch (e) {
  30744. return u.call(this, t)
  30745. }
  30746. }
  30747. })(e)
  30748. }
  30749. }
  30750. function l(e, t) {
  30751. ;(this.fun = e), (this.array = t)
  30752. }
  30753. function c() {}
  30754. var h,
  30755. u,
  30756. d = (t.exports = {})
  30757. !(function () {
  30758. try {
  30759. h = 'function' == typeof setTimeout ? setTimeout : n
  30760. } catch (e) {
  30761. h = n
  30762. }
  30763. try {
  30764. u = 'function' == typeof clearTimeout ? clearTimeout : r
  30765. } catch (e) {
  30766. u = r
  30767. }
  30768. })()
  30769. var p,
  30770. f = [],
  30771. g = !1,
  30772. m = -1
  30773. ;(d.nextTick = function (e) {
  30774. var t = new Array(arguments.length - 1)
  30775. if (1 < arguments.length) for (var i = 1; i < arguments.length; i++) t[i - 1] = arguments[i]
  30776. f.push(new l(e, t)), 1 !== f.length || g || o(s)
  30777. }),
  30778. (l.prototype.run = function () {
  30779. this.fun.apply(null, this.array)
  30780. }),
  30781. (d.title = 'browser'),
  30782. (d.browser = !0),
  30783. (d.env = {}),
  30784. (d.argv = []),
  30785. (d.version = ''),
  30786. (d.versions = {}),
  30787. (d.on = c),
  30788. (d.addListener = c),
  30789. (d.once = c),
  30790. (d.off = c),
  30791. (d.removeListener = c),
  30792. (d.removeAllListeners = c),
  30793. (d.emit = c),
  30794. (d.binding = function (e) {
  30795. throw new Error('process.binding is not supported')
  30796. }),
  30797. (d.cwd = function () {
  30798. return '/'
  30799. }),
  30800. (d.chdir = function (e) {
  30801. throw new Error('process.chdir is not supported')
  30802. }),
  30803. (d.umask = function () {
  30804. return 0
  30805. })
  30806. },
  30807. {}
  30808. ],
  30809. 204: [
  30810. function (e, O, L) {
  30811. ;(function (P) {
  30812. !(function (e) {
  30813. function v(e) {
  30814. throw new RangeError(g[e])
  30815. }
  30816. function r(e, t) {
  30817. for (var i = e.length, n = []; i--; ) n[i] = t(e[i])
  30818. return n
  30819. }
  30820. function t(e, t) {
  30821. var i = e.split('@'),
  30822. n = ''
  30823. return 1 < i.length && ((n = i[0] + '@'), (e = i[1])), n + r((e = e.replace(f, '.')).split('.'), t).join('.')
  30824. }
  30825. function y(e) {
  30826. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  30827. 55296 <= (t = e.charCodeAt(r++)) && t <= 56319 && r < o
  30828. ? 56320 == (64512 & (i = e.charCodeAt(r++)))
  30829. ? n.push(((1023 & t) << 10) + (1023 & i) + 65536)
  30830. : (n.push(t), r--)
  30831. : n.push(t)
  30832. return n
  30833. }
  30834. function A(e) {
  30835. return r(e, function (e) {
  30836. var t = ''
  30837. return 65535 < e && ((t += R((((e -= 65536) >>> 10) & 1023) | 55296)), (e = 56320 | (1023 & e))), t + R(e)
  30838. }).join('')
  30839. }
  30840. function C(e, t) {
  30841. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  30842. }
  30843. function I(e, t, i) {
  30844. var n = 0
  30845. for (e = i ? M(e / u) : e >> 1, e += M(e / t); (m * w) >> 1 < e; n += _) e = M(e / m)
  30846. return M(n + ((m + 1) * e) / (e + h))
  30847. }
  30848. function i(e) {
  30849. var t,
  30850. i,
  30851. n,
  30852. r,
  30853. o,
  30854. a,
  30855. s,
  30856. l,
  30857. c,
  30858. h,
  30859. u,
  30860. d = [],
  30861. p = e.length,
  30862. f = 0,
  30863. g = x,
  30864. m = T
  30865. for ((i = e.lastIndexOf(S)) < 0 && (i = 0), n = 0; n < i; ++n) 128 <= e.charCodeAt(n) && v('not-basic'), d.push(e.charCodeAt(n))
  30866. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  30867. for (
  30868. o = f, a = 1, s = _;
  30869. p <= r && v('invalid-input'),
  30870. (u = e.charCodeAt(r++)),
  30871. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v('overflow'),
  30872. (f += l * a),
  30873. !(l < (c = s <= m ? b : m + w <= s ? w : s - m));
  30874. s += _
  30875. )
  30876. a > M(E / (h = _ - c)) && v('overflow'), (a *= h)
  30877. ;(m = I(f - o, (t = d.length + 1), 0 == o)), M(f / t) > E - g && v('overflow'), (g += M(f / t)), (f %= t), d.splice(f++, 0, g)
  30878. }
  30879. return A(d)
  30880. }
  30881. function n(e) {
  30882. var t,
  30883. i,
  30884. n,
  30885. r,
  30886. o,
  30887. a,
  30888. s,
  30889. l,
  30890. c,
  30891. h,
  30892. u,
  30893. d,
  30894. p,
  30895. f,
  30896. g,
  30897. m = []
  30898. for (d = (e = y(e)).length, t = x, o = T, a = i = 0; a < d; ++a) (u = e[a]) < 128 && m.push(R(u))
  30899. for (n = r = m.length, r && m.push(S); n < d; ) {
  30900. for (s = E, a = 0; a < d; ++a) t <= (u = e[a]) && u < s && (s = u)
  30901. for (s - t > M((E - i) / (p = n + 1)) && v('overflow'), i += (s - t) * p, t = s, a = 0; a < d; ++a)
  30902. if (((u = e[a]) < t && ++i > E && v('overflow'), u == t)) {
  30903. for (l = i, c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _) (g = l - h), (f = _ - h), m.push(R(C(h + (g % f), 0))), (l = M(g / f))
  30904. m.push(R(C(l, 0))), (o = I(i, p, n == r)), (i = 0), ++n
  30905. }
  30906. ++i, ++t
  30907. }
  30908. return m.join('')
  30909. }
  30910. var o = 'object' == typeof L && L && !L.nodeType && L,
  30911. a = 'object' == typeof O && O && !O.nodeType && O,
  30912. s = 'object' == typeof P && P
  30913. ;(s.global !== s && s.window !== s && s.self !== s) || (e = s)
  30914. var l,
  30915. c,
  30916. E = 2147483647,
  30917. _ = 36,
  30918. b = 1,
  30919. w = 26,
  30920. h = 38,
  30921. u = 700,
  30922. T = 72,
  30923. x = 128,
  30924. S = '-',
  30925. d = /^xn--/,
  30926. p = /[^\x20-\x7E]/,
  30927. f = /[\x2E\u3002\uFF0E\uFF61]/g,
  30928. g = {
  30929. overflow: 'Overflow: input needs wider integers to process',
  30930. 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
  30931. 'invalid-input': 'Invalid input'
  30932. },
  30933. m = _ - b,
  30934. M = Math.floor,
  30935. R = String.fromCharCode
  30936. if (
  30937. ((l = {
  30938. version: '1.4.1',
  30939. ucs2: {
  30940. decode: y,
  30941. encode: A
  30942. },
  30943. decode: i,
  30944. encode: n,
  30945. toASCII: function (e) {
  30946. return t(e, function (e) {
  30947. return p.test(e) ? 'xn--' + n(e) : e
  30948. })
  30949. },
  30950. toUnicode: function (e) {
  30951. return t(e, function (e) {
  30952. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  30953. })
  30954. }
  30955. }),
  30956. 'function' == typeof define && 'object' == typeof define.amd && define.amd)
  30957. )
  30958. define('punycode', function () {
  30959. return l
  30960. })
  30961. else if (o && a)
  30962. if (O.exports == o) a.exports = l
  30963. else for (c in l) l.hasOwnProperty(c) && (o[c] = l[c])
  30964. else e.punycode = l
  30965. })(this)
  30966. }).call(this, 'undefined' != typeof global ? global : 'undefined' != typeof self ? self : 'undefined' != typeof window ? window : {})
  30967. },
  30968. {}
  30969. ],
  30970. 205: [
  30971. function (e, t, i) {
  30972. 'use strict'
  30973. t.exports = function (e, t, i, n) {
  30974. ;(t = t || '&'), (i = i || '=')
  30975. var r = {}
  30976. if ('string' != typeof e || 0 === e.length) return r
  30977. var o = /\+/g
  30978. e = e.split(t)
  30979. var a = 1e3
  30980. n && 'number' == typeof n.maxKeys && (a = n.maxKeys)
  30981. var s,
  30982. l,
  30983. c = e.length
  30984. 0 < a && a < c && (c = a)
  30985. for (var h = 0; h < c; ++h) {
  30986. var u,
  30987. d,
  30988. p,
  30989. f,
  30990. g = e[h].replace(o, '%20'),
  30991. m = g.indexOf(i)
  30992. ;(d = 0 <= m ? ((u = g.substr(0, m)), g.substr(m + 1)) : ((u = g), '')),
  30993. (p = decodeURIComponent(u)),
  30994. (f = decodeURIComponent(d)),
  30995. (s = r),
  30996. (l = p),
  30997. Object.prototype.hasOwnProperty.call(s, l) ? (v(r[p]) ? r[p].push(f) : (r[p] = [r[p], f])) : (r[p] = f)
  30998. }
  30999. return r
  31000. }
  31001. var v =
  31002. Array.isArray ||
  31003. function (e) {
  31004. return '[object Array]' === Object.prototype.toString.call(e)
  31005. }
  31006. },
  31007. {}
  31008. ],
  31009. 206: [
  31010. function (e, t, i) {
  31011. 'use strict'
  31012. function o(e, t) {
  31013. if (e.map) return e.map(t)
  31014. for (var i = [], n = 0; n < e.length; n++) i.push(t(e[n], n))
  31015. return i
  31016. }
  31017. function a(e) {
  31018. switch (typeof e) {
  31019. case 'string':
  31020. return e
  31021. case 'boolean':
  31022. return e ? 'true' : 'false'
  31023. case 'number':
  31024. return isFinite(e) ? e : ''
  31025. default:
  31026. return ''
  31027. }
  31028. }
  31029. t.exports = function (i, n, r, e) {
  31030. return (
  31031. (n = n || '&'),
  31032. (r = r || '='),
  31033. null === i && (i = void 0),
  31034. 'object' == typeof i
  31035. ? o(l(i), function (e) {
  31036. var t = encodeURIComponent(a(e)) + r
  31037. return s(i[e])
  31038. ? o(i[e], function (e) {
  31039. return t + encodeURIComponent(a(e))
  31040. }).join(n)
  31041. : t + encodeURIComponent(a(i[e]))
  31042. }).join(n)
  31043. : e
  31044. ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i))
  31045. : ''
  31046. )
  31047. }
  31048. var s =
  31049. Array.isArray ||
  31050. function (e) {
  31051. return '[object Array]' === Object.prototype.toString.call(e)
  31052. },
  31053. l =
  31054. Object.keys ||
  31055. function (e) {
  31056. var t = []
  31057. for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && t.push(i)
  31058. return t
  31059. }
  31060. },
  31061. {}
  31062. ],
  31063. 207: [
  31064. function (e, t, i) {
  31065. 'use strict'
  31066. ;(i.decode = i.parse = e('./decode')), (i.encode = i.stringify = e('./encode'))
  31067. },
  31068. {
  31069. './decode': 205,
  31070. './encode': 206
  31071. }
  31072. ],
  31073. 208: [
  31074. function (e, t, i) {
  31075. 'use strict'
  31076. function x() {
  31077. ;(this.protocol = null),
  31078. (this.slashes = null),
  31079. (this.auth = null),
  31080. (this.host = null),
  31081. (this.port = null),
  31082. (this.hostname = null),
  31083. (this.hash = null),
  31084. (this.search = null),
  31085. (this.query = null),
  31086. (this.pathname = null),
  31087. (this.path = null),
  31088. (this.href = null)
  31089. }
  31090. function n(e, t, i) {
  31091. if (e && D.isObject(e) && e instanceof x) return e
  31092. var n = new x()
  31093. return n.parse(e, t, i), n
  31094. }
  31095. var L = e('punycode'),
  31096. D = e('./util')
  31097. ;(i.parse = n),
  31098. (i.resolve = function (e, t) {
  31099. return n(e, !1, !0).resolve(t)
  31100. }),
  31101. (i.resolveObject = function (e, t) {
  31102. return e ? n(e, !1, !0).resolveObject(t) : t
  31103. }),
  31104. (i.format = function (e) {
  31105. return D.isString(e) && (e = n(e)), e instanceof x ? e.format() : x.prototype.format.call(e)
  31106. }),
  31107. (i.Url = x)
  31108. var N = /^([a-z0-9.+-]+:)/i,
  31109. r = /:[0-9]*$/,
  31110. F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
  31111. o = ['{', '}', '|', '\\', '^', '`'].concat(['<', '>', '"', '`', ' ', '\r', '\n', '\t']),
  31112. B = ["'"].concat(o),
  31113. V = ['%', '/', '?', ';', '#'].concat(B),
  31114. k = ['/', '?', '#'],
  31115. U = /^[+a-z0-9A-Z_-]{0,63}$/,
  31116. H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
  31117. z = {
  31118. javascript: !0,
  31119. 'javascript:': !0
  31120. },
  31121. G = {
  31122. javascript: !0,
  31123. 'javascript:': !0
  31124. },
  31125. W = {
  31126. http: !0,
  31127. https: !0,
  31128. ftp: !0,
  31129. gopher: !0,
  31130. file: !0,
  31131. 'http:': !0,
  31132. 'https:': !0,
  31133. 'ftp:': !0,
  31134. 'gopher:': !0,
  31135. 'file:': !0
  31136. },
  31137. j = e('querystring')
  31138. ;(x.prototype.parse = function (e, t, i) {
  31139. if (!D.isString(e)) throw new TypeError("Parameter 'url' must be a string, not " + typeof e)
  31140. var n = e.indexOf('?'),
  31141. r = -1 !== n && n < e.indexOf('#') ? '?' : '#',
  31142. o = e.split(r)
  31143. o[0] = o[0].replace(/\\/g, '/')
  31144. var a = (e = o.join(r))
  31145. if (((a = a.trim()), !i && 1 === e.split('#').length)) {
  31146. var s = F.exec(a)
  31147. if (s)
  31148. return (
  31149. (this.path = a),
  31150. (this.href = a),
  31151. (this.pathname = s[1]),
  31152. s[2] ? ((this.search = s[2]), (this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1))) : t && ((this.search = ''), (this.query = {})),
  31153. this
  31154. )
  31155. }
  31156. var l = N.exec(a)
  31157. if (l) {
  31158. var c = (l = l[0]).toLowerCase()
  31159. ;(this.protocol = c), (a = a.substr(l.length))
  31160. }
  31161. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31162. var h = '//' === a.substr(0, 2)
  31163. !h || (l && G[l]) || ((a = a.substr(2)), (this.slashes = !0))
  31164. }
  31165. if (!G[l] && (h || (l && !W[l]))) {
  31166. for (var u = -1, d = 0; d < k.length; d++) {
  31167. ;-1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  31168. }
  31169. var p, f
  31170. ;-1 !== (f = -1 === u ? a.lastIndexOf('@') : a.lastIndexOf('@', u)) && ((p = a.slice(0, f)), (a = a.slice(f + 1)), (this.auth = decodeURIComponent(p))), (u = -1)
  31171. for (d = 0; d < V.length; d++) {
  31172. var g
  31173. ;-1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  31174. }
  31175. ;-1 === u && (u = a.length), (this.host = a.slice(0, u)), (a = a.slice(u)), this.parseHost(), (this.hostname = this.hostname || '')
  31176. var m = '[' === this.hostname[0] && ']' === this.hostname[this.hostname.length - 1]
  31177. if (!m)
  31178. for (var v = this.hostname.split(/\./), y = ((d = 0), v.length); d < y; d++) {
  31179. var A = v[d]
  31180. if (A && !A.match(U)) {
  31181. for (var C = '', I = 0, E = A.length; I < E; I++) C += 127 < A.charCodeAt(I) ? 'x' : A[I]
  31182. if (!C.match(U)) {
  31183. var _ = v.slice(0, d),
  31184. b = v.slice(d + 1),
  31185. w = A.match(H)
  31186. w && (_.push(w[1]), b.unshift(w[2])), b.length && (a = '/' + b.join('.') + a), (this.hostname = _.join('.'))
  31187. break
  31188. }
  31189. }
  31190. }
  31191. 255 < this.hostname.length ? (this.hostname = '') : (this.hostname = this.hostname.toLowerCase()), m || (this.hostname = L.toASCII(this.hostname))
  31192. var T = this.port ? ':' + this.port : '',
  31193. x = this.hostname || ''
  31194. ;(this.host = x + T), (this.href += this.host), m && ((this.hostname = this.hostname.substr(1, this.hostname.length - 2)), '/' !== a[0] && (a = '/' + a))
  31195. }
  31196. if (!z[c])
  31197. for (d = 0, y = B.length; d < y; d++) {
  31198. var S = B[d]
  31199. if (-1 !== a.indexOf(S)) {
  31200. var M = encodeURIComponent(S)
  31201. M === S && (M = escape(S)), (a = a.split(S).join(M))
  31202. }
  31203. }
  31204. var R = a.indexOf('#')
  31205. ;-1 !== R && ((this.hash = a.substr(R)), (a = a.slice(0, R)))
  31206. var P = a.indexOf('?')
  31207. if (
  31208. (-1 !== P ? ((this.search = a.substr(P)), (this.query = a.substr(P + 1)), t && (this.query = j.parse(this.query)), (a = a.slice(0, P))) : t && ((this.search = ''), (this.query = {})),
  31209. a && (this.pathname = a),
  31210. W[c] && this.hostname && !this.pathname && (this.pathname = '/'),
  31211. this.pathname || this.search)
  31212. ) {
  31213. T = this.pathname || ''
  31214. var O = this.search || ''
  31215. this.path = T + O
  31216. }
  31217. return (this.href = this.format()), this
  31218. }),
  31219. (x.prototype.format = function () {
  31220. var e = this.auth || ''
  31221. e && ((e = (e = encodeURIComponent(e)).replace(/%3A/i, ':')), (e += '@'))
  31222. var t = this.protocol || '',
  31223. i = this.pathname || '',
  31224. n = this.hash || '',
  31225. r = !1,
  31226. o = ''
  31227. this.host ? (r = e + this.host) : this.hostname && ((r = e + (-1 === this.hostname.indexOf(':') ? this.hostname : '[' + this.hostname + ']')), this.port && (r += ':' + this.port)),
  31228. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query))
  31229. var a = this.search || (o && '?' + o) || ''
  31230. return (
  31231. t && ':' !== t.substr(-1) && (t += ':'),
  31232. this.slashes || ((!t || W[t]) && !1 !== r) ? ((r = '//' + (r || '')), i && '/' !== i.charAt(0) && (i = '/' + i)) : (r = r || ''),
  31233. n && '#' !== n.charAt(0) && (n = '#' + n),
  31234. a && '?' !== a.charAt(0) && (a = '?' + a),
  31235. t +
  31236. r +
  31237. (i = i.replace(/[?#]/g, function (e) {
  31238. return encodeURIComponent(e)
  31239. })) +
  31240. (a = a.replace('#', '%23')) +
  31241. n
  31242. )
  31243. }),
  31244. (x.prototype.resolve = function (e) {
  31245. return this.resolveObject(n(e, !1, !0)).format()
  31246. }),
  31247. (x.prototype.resolveObject = function (e) {
  31248. if (D.isString(e)) {
  31249. var t = new x()
  31250. t.parse(e, !1, !0), (e = t)
  31251. }
  31252. for (var i = new x(), n = Object.keys(this), r = 0; r < n.length; r++) {
  31253. var o = n[r]
  31254. i[o] = this[o]
  31255. }
  31256. if (((i.hash = e.hash), '' === e.href)) return (i.href = i.format()), i
  31257. if (e.slashes && !e.protocol) {
  31258. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  31259. var l = a[s]
  31260. 'protocol' !== l && (i[l] = e[l])
  31261. }
  31262. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = '/'), (i.href = i.format()), i
  31263. }
  31264. if (e.protocol && e.protocol !== i.protocol) {
  31265. if (!W[e.protocol]) {
  31266. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  31267. var u = c[h]
  31268. i[u] = e[u]
  31269. }
  31270. return (i.href = i.format()), i
  31271. }
  31272. if (((i.protocol = e.protocol), e.host || G[e.protocol])) i.pathname = e.pathname
  31273. else {
  31274. for (var d = (e.pathname || '').split('/'); d.length && !(e.host = d.shift()); );
  31275. e.host || (e.host = ''), e.hostname || (e.hostname = ''), '' !== d[0] && d.unshift(''), d.length < 2 && d.unshift(''), (i.pathname = d.join('/'))
  31276. }
  31277. if (((i.search = e.search), (i.query = e.query), (i.host = e.host || ''), (i.auth = e.auth), (i.hostname = e.hostname || e.host), (i.port = e.port), i.pathname || i.search)) {
  31278. var p = i.pathname || '',
  31279. f = i.search || ''
  31280. i.path = p + f
  31281. }
  31282. return (i.slashes = i.slashes || e.slashes), (i.href = i.format()), i
  31283. }
  31284. var g = i.pathname && '/' === i.pathname.charAt(0),
  31285. m = e.host || (e.pathname && '/' === e.pathname.charAt(0)),
  31286. v = m || g || (i.host && e.pathname),
  31287. y = v,
  31288. A = (i.pathname && i.pathname.split('/')) || [],
  31289. C = ((d = (e.pathname && e.pathname.split('/')) || []), i.protocol && !W[i.protocol])
  31290. if (
  31291. (C &&
  31292. ((i.hostname = ''),
  31293. (i.port = null),
  31294. i.host && ('' === A[0] ? (A[0] = i.host) : A.unshift(i.host)),
  31295. (i.host = ''),
  31296. e.protocol && ((e.hostname = null), (e.port = null), e.host && ('' === d[0] ? (d[0] = e.host) : d.unshift(e.host)), (e.host = null)),
  31297. (v = v && ('' === d[0] || '' === A[0]))),
  31298. m)
  31299. )
  31300. (i.host = e.host || '' === e.host ? e.host : i.host), (i.hostname = e.hostname || '' === e.hostname ? e.hostname : i.hostname), (i.search = e.search), (i.query = e.query), (A = d)
  31301. else if (d.length) (A = A || []).pop(), (A = A.concat(d)), (i.search = e.search), (i.query = e.query)
  31302. else if (!D.isNullOrUndefined(e.search)) {
  31303. if (C) (i.hostname = i.host = A.shift()), (w = !!(i.host && 0 < i.host.indexOf('@')) && i.host.split('@')) && ((i.auth = w.shift()), (i.host = i.hostname = w.shift()))
  31304. return (
  31305. (i.search = e.search),
  31306. (i.query = e.query),
  31307. (D.isNull(i.pathname) && D.isNull(i.search)) || (i.path = (i.pathname ? i.pathname : '') + (i.search ? i.search : '')),
  31308. (i.href = i.format()),
  31309. i
  31310. )
  31311. }
  31312. if (!A.length) return (i.pathname = null), i.search ? (i.path = '/' + i.search) : (i.path = null), (i.href = i.format()), i
  31313. for (var I = A.slice(-1)[0], E = ((i.host || e.host || 1 < A.length) && ('.' === I || '..' === I)) || '' === I, _ = 0, b = A.length; 0 <= b; b--)
  31314. '.' === (I = A[b]) ? A.splice(b, 1) : '..' === I ? (A.splice(b, 1), _++) : _ && (A.splice(b, 1), _--)
  31315. if (!v && !y) for (; _--; ) A.unshift('..')
  31316. !v || '' === A[0] || (A[0] && '/' === A[0].charAt(0)) || A.unshift(''), E && '/' !== A.join('/').substr(-1) && A.push('')
  31317. var w,
  31318. T = '' === A[0] || (A[0] && '/' === A[0].charAt(0))
  31319. C &&
  31320. ((i.hostname = i.host = T ? '' : A.length ? A.shift() : ''),
  31321. (w = !!(i.host && 0 < i.host.indexOf('@')) && i.host.split('@')) && ((i.auth = w.shift()), (i.host = i.hostname = w.shift())))
  31322. return (
  31323. (v = v || (i.host && A.length)) && !T && A.unshift(''),
  31324. A.length ? (i.pathname = A.join('/')) : ((i.pathname = null), (i.path = null)),
  31325. (D.isNull(i.pathname) && D.isNull(i.search)) || (i.path = (i.pathname ? i.pathname : '') + (i.search ? i.search : '')),
  31326. (i.auth = e.auth || i.auth),
  31327. (i.slashes = i.slashes || e.slashes),
  31328. (i.href = i.format()),
  31329. i
  31330. )
  31331. }),
  31332. (x.prototype.parseHost = function () {
  31333. var e = this.host,
  31334. t = r.exec(e)
  31335. t && (':' !== (t = t[0]) && (this.port = t.substr(1)), (e = e.substr(0, e.length - t.length))), e && (this.hostname = e)
  31336. })
  31337. },
  31338. {
  31339. './util': 209,
  31340. punycode: 204,
  31341. querystring: 207
  31342. }
  31343. ],
  31344. 209: [
  31345. function (e, t, i) {
  31346. 'use strict'
  31347. t.exports = {
  31348. isString: function (e) {
  31349. return 'string' == typeof e
  31350. },
  31351. isObject: function (e) {
  31352. return 'object' == typeof e && null !== e
  31353. },
  31354. isNull: function (e) {
  31355. return null === e
  31356. },
  31357. isNullOrUndefined: function (e) {
  31358. return null == e
  31359. }
  31360. }
  31361. },
  31362. {}
  31363. ],
  31364. 210: [
  31365. function (e, t, i) {
  31366. 'use strict'
  31367. function r(e) {
  31368. return c + e
  31369. }
  31370. function s(e) {
  31371. if ('string' != typeof e) throw new TypeError('key must be a string.')
  31372. }
  31373. var l = Object.prototype.hasOwnProperty,
  31374. c = '~'
  31375. t.exports = function (t) {
  31376. var o = Object.create(null),
  31377. n = 0,
  31378. a = {}
  31379. return (
  31380. (function (e, t) {
  31381. for (var i in t)
  31382. Object.defineProperty(e, i, {
  31383. value: t[i],
  31384. configurable: !0,
  31385. writable: !0
  31386. })
  31387. })(a, {
  31388. get: function (e, t) {
  31389. s(e)
  31390. var i = r(e)
  31391. return i in o ? o[i] : t
  31392. },
  31393. set: function (e, t) {
  31394. s(e)
  31395. var i = r(e)
  31396. return i in o || ++n, (o[i] = t)
  31397. },
  31398. has: function (e) {
  31399. return s(e), r(e) in o
  31400. },
  31401. delete: function (e) {
  31402. s(e)
  31403. var t = r(e)
  31404. return t in o && (--n, delete o[t], !0)
  31405. },
  31406. clear: function () {
  31407. ;(o = Object.create(null)), (n = 0)
  31408. },
  31409. forEach: function (e, t) {
  31410. if ('function' != typeof e) throw new TypeError('`callback` must be a function')
  31411. for (var i in o)
  31412. if (l.call(o, i)) {
  31413. var n = i.substring(c.length),
  31414. r = o[i]
  31415. e.call(t, r, n, a)
  31416. }
  31417. }
  31418. }),
  31419. Object.defineProperty(a, 'size', {
  31420. get: function () {
  31421. return n
  31422. },
  31423. configurable: !0
  31424. }),
  31425. 'object' == typeof t &&
  31426. null !== t &&
  31427. Object.keys(t).forEach(function (e) {
  31428. a.set(e, t[e])
  31429. }),
  31430. a
  31431. )
  31432. }
  31433. },
  31434. {}
  31435. ],
  31436. 211: [
  31437. function (e, t, i) {
  31438. t.exports = e('./lib/heap')
  31439. },
  31440. {
  31441. './lib/heap': 212
  31442. }
  31443. ],
  31444. 212: [
  31445. function (e, y, A) {
  31446. ;(function () {
  31447. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s
  31448. function v(e) {
  31449. ;(this.cmp = null != e ? e : d), (this.nodes = [])
  31450. }
  31451. ;(l = Math.floor),
  31452. (m = Math.min),
  31453. (d = function (e, t) {
  31454. return e < t ? -1 : t < e ? 1 : 0
  31455. }),
  31456. (g = function (e, t, i, n, r) {
  31457. var o
  31458. if ((null == i && (i = 0), null == r && (r = d), i < 0)) throw new Error('lo must be non-negative')
  31459. for (null == n && (n = e.length); i < n; ) r(t, e[(o = l((i + n) / 2))]) < 0 ? (n = o) : (i = o + 1)
  31460. return [].splice.apply(e, [i, i - i].concat(t)), t
  31461. }),
  31462. (t = function (e, t, i) {
  31463. return null == i && (i = d), e.push(t), h(e, 0, e.length - 1, i)
  31464. }),
  31465. (f = function (e, t) {
  31466. var i, n
  31467. return null == t && (t = d), (i = e.pop()), e.length ? ((n = e[0]), (e[0] = i), u(e, 0, t)) : (n = i), n
  31468. }),
  31469. (i = function (e, t, i) {
  31470. var n
  31471. return null == i && (i = d), (n = e[0]), (e[0] = t), u(e, 0, i), n
  31472. }),
  31473. (c = function (e, t, i) {
  31474. var n
  31475. return null == i && (i = d), e.length && i(e[0], t) < 0 && ((t = (n = [e[0], t])[0]), (e[0] = n[1]), u(e, 0, i)), t
  31476. }),
  31477. (p = function (i, e) {
  31478. var t, n, r, o, a, s
  31479. for (
  31480. null == e && (e = d),
  31481. a = [],
  31482. n = 0,
  31483. r = (o = function () {
  31484. s = []
  31485. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--) s.push(e)
  31486. return s
  31487. }
  31488. .apply(this)
  31489. .reverse()).length;
  31490. n < r;
  31491. n++
  31492. )
  31493. (t = o[n]), a.push(u(i, t, e))
  31494. return a
  31495. }),
  31496. (o = function (e, t, i) {
  31497. var n
  31498. if ((null == i && (i = d), -1 !== (n = e.indexOf(t)))) return h(e, 0, n, i), u(e, n, i)
  31499. }),
  31500. (n = function (e, t, i) {
  31501. var n, r, o, a, s
  31502. if ((null == i && (i = d), !(r = e.slice(0, t)).length)) return r
  31503. for (p(r, i), o = 0, a = (s = e.slice(t)).length; o < a; o++) (n = s[o]), c(r, n, i)
  31504. return r.sort(i).reverse()
  31505. }),
  31506. (r = function (e, t, i) {
  31507. var n, r, o, a, s, l, c, h, u
  31508. if ((null == i && (i = d), 10 * t <= e.length)) {
  31509. if (!(o = e.slice(0, t).sort(i)).length) return o
  31510. for (r = o[o.length - 1], a = 0, l = (c = e.slice(t)).length; a < l; a++) i((n = c[a]), r) < 0 && (g(o, n, 0, null, i), o.pop(), (r = o[o.length - 1]))
  31511. return o
  31512. }
  31513. for (p(e, i), u = [], s = 0, h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s) u.push(f(e, i))
  31514. return u
  31515. }),
  31516. (h = function (e, t, i, n) {
  31517. var r, o, a
  31518. for (null == n && (n = d), r = e[i]; t < i && n(r, (o = e[(a = (i - 1) >> 1)])) < 0; ) (e[i] = o), (i = a)
  31519. return (e[i] = r)
  31520. }),
  31521. (u = function (e, t, i) {
  31522. var n, r, o, a, s
  31523. for (null == i && (i = d), r = e.length, o = e[(s = t)], n = 2 * t + 1; n < r; ) (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a), (e[t] = e[n]), (n = 2 * (t = n) + 1)
  31524. return (e[t] = o), h(e, s, t, i)
  31525. }),
  31526. (v.push = t),
  31527. (v.pop = f),
  31528. (v.replace = i),
  31529. (v.pushpop = c),
  31530. (v.heapify = p),
  31531. (v.updateItem = o),
  31532. (v.nlargest = n),
  31533. (v.nsmallest = r),
  31534. (v.prototype.push = function (e) {
  31535. return t(this.nodes, e, this.cmp)
  31536. }),
  31537. (v.prototype.pop = function () {
  31538. return f(this.nodes, this.cmp)
  31539. }),
  31540. (v.prototype.peek = function () {
  31541. return this.nodes[0]
  31542. }),
  31543. (v.prototype.contains = function (e) {
  31544. return -1 !== this.nodes.indexOf(e)
  31545. }),
  31546. (v.prototype.replace = function (e) {
  31547. return i(this.nodes, e, this.cmp)
  31548. }),
  31549. (v.prototype.pushpop = function (e) {
  31550. return c(this.nodes, e, this.cmp)
  31551. }),
  31552. (v.prototype.heapify = function () {
  31553. return p(this.nodes, this.cmp)
  31554. }),
  31555. (v.prototype.updateItem = function (e) {
  31556. return o(this.nodes, e, this.cmp)
  31557. }),
  31558. (v.prototype.clear = function () {
  31559. return (this.nodes = [])
  31560. }),
  31561. (v.prototype.empty = function () {
  31562. return 0 === this.nodes.length
  31563. }),
  31564. (v.prototype.size = function () {
  31565. return this.nodes.length
  31566. }),
  31567. (v.prototype.clone = function () {
  31568. var e
  31569. return ((e = new v()).nodes = this.nodes.slice(0)), e
  31570. }),
  31571. (v.prototype.toArray = function () {
  31572. return this.nodes.slice(0)
  31573. }),
  31574. (v.prototype.insert = v.prototype.push),
  31575. (v.prototype.top = v.prototype.peek),
  31576. (v.prototype.front = v.prototype.peek),
  31577. (v.prototype.has = v.prototype.contains),
  31578. (v.prototype.copy = v.prototype.clone),
  31579. (e = v),
  31580. (a = this),
  31581. (s = function () {
  31582. return e
  31583. }),
  31584. 'function' == typeof define && define.amd ? define([], s) : 'object' == typeof A ? (y.exports = s()) : (a.Heap = s())
  31585. }).call(this)
  31586. },
  31587. {}
  31588. ],
  31589. 213: [
  31590. function (e, t, i) {
  31591. function n() {}
  31592. function o(e) {
  31593. if ('object' != typeof this) throw new TypeError('Promises must be constructed via new')
  31594. if ('function' != typeof e) throw new TypeError('not a function')
  31595. ;(this._state = 0), (this._handled = !1), (this._value = void 0), (this._deferreds = []), h(e, this)
  31596. }
  31597. function r(i, n) {
  31598. for (; 3 === i._state; ) i = i._value
  31599. return 0 === i._state
  31600. ? void i._deferreds.push(n)
  31601. : ((i._handled = !0),
  31602. void o._immediateFn(function () {
  31603. var e = 1 === i._state ? n.onFulfilled : n.onRejected
  31604. if (null !== e) {
  31605. var t
  31606. try {
  31607. t = e(i._value)
  31608. } catch (e) {
  31609. return void s(n.promise, e)
  31610. }
  31611. a(n.promise, t)
  31612. } else (1 === i._state ? a : s)(n.promise, i._value)
  31613. }))
  31614. }
  31615. function a(e, t) {
  31616. try {
  31617. if (t === e) throw new TypeError('A promise cannot be resolved with itself.')
  31618. if (t && ('object' == typeof t || 'function' == typeof t)) {
  31619. var i = t.then
  31620. if (t instanceof o) return (e._state = 3), (e._value = t), void l(e)
  31621. if ('function' == typeof i)
  31622. return void h(
  31623. (function (e, t) {
  31624. return function () {
  31625. e.apply(t, arguments)
  31626. }
  31627. })(i, t),
  31628. e
  31629. )
  31630. }
  31631. ;(e._state = 1), (e._value = t), l(e)
  31632. } catch (t) {
  31633. s(e, t)
  31634. }
  31635. }
  31636. function s(e, t) {
  31637. ;(e._state = 2), (e._value = t), l(e)
  31638. }
  31639. function l(e) {
  31640. 2 === e._state &&
  31641. 0 === e._deferreds.length &&
  31642. o._immediateFn(function () {
  31643. e._handled || o._unhandledRejectionFn(e._value)
  31644. })
  31645. for (var t = 0, i = e._deferreds.length; t < i; t++) r(e, e._deferreds[t])
  31646. e._deferreds = null
  31647. }
  31648. function c(e, t, i) {
  31649. ;(this.onFulfilled = 'function' == typeof e ? e : null), (this.onRejected = 'function' == typeof t ? t : null), (this.promise = i)
  31650. }
  31651. function h(e, t) {
  31652. var i = !1
  31653. try {
  31654. e(
  31655. function (e) {
  31656. i || ((i = !0), a(t, e))
  31657. },
  31658. function (e) {
  31659. i || ((i = !0), s(t, e))
  31660. }
  31661. )
  31662. } catch (e) {
  31663. if (i) return
  31664. ;(i = !0), s(t, e)
  31665. }
  31666. }
  31667. var u, d
  31668. ;(u = this),
  31669. (d = setTimeout),
  31670. (o.prototype.catch = function (e) {
  31671. return this.then(null, e)
  31672. }),
  31673. (o.prototype.then = function (e, t) {
  31674. var i = new this.constructor(n)
  31675. return r(this, new c(e, t, i)), i
  31676. }),
  31677. (o.all = function (e) {
  31678. var s = Array.prototype.slice.call(e)
  31679. return new o(function (n, r) {
  31680. function o(t, e) {
  31681. try {
  31682. if (e && ('object' == typeof e || 'function' == typeof e)) {
  31683. var i = e.then
  31684. if ('function' == typeof i)
  31685. return void i.call(
  31686. e,
  31687. function (e) {
  31688. o(t, e)
  31689. },
  31690. r
  31691. )
  31692. }
  31693. ;(s[t] = e), 0 == --a && n(s)
  31694. } catch (e) {
  31695. r(e)
  31696. }
  31697. }
  31698. if (0 === s.length) return n([])
  31699. for (var a = s.length, e = 0; e < s.length; e++) o(e, s[e])
  31700. })
  31701. }),
  31702. (o.resolve = function (t) {
  31703. return t && 'object' == typeof t && t.constructor === o
  31704. ? t
  31705. : new o(function (e) {
  31706. e(t)
  31707. })
  31708. }),
  31709. (o.reject = function (i) {
  31710. return new o(function (e, t) {
  31711. t(i)
  31712. })
  31713. }),
  31714. (o.race = function (r) {
  31715. return new o(function (e, t) {
  31716. for (var i = 0, n = r.length; i < n; i++) r[i].then(e, t)
  31717. })
  31718. }),
  31719. (o._immediateFn =
  31720. ('function' == typeof setImmediate &&
  31721. function (e) {
  31722. setImmediate(e)
  31723. }) ||
  31724. function (e) {
  31725. d(e, 0)
  31726. }),
  31727. (o._unhandledRejectionFn = function (e) {
  31728. 'undefined' != typeof console && console && console.warn('Possible Unhandled Promise Rejection:', e)
  31729. }),
  31730. (o._setImmediateFn = function (e) {
  31731. o._immediateFn = e
  31732. }),
  31733. (o._setUnhandledRejectionFn = function (e) {
  31734. o._unhandledRejectionFn = e
  31735. }),
  31736. void 0 !== t && t.exports ? (t.exports = o) : u.Promise || (u.Promise = o)
  31737. },
  31738. {}
  31739. ],
  31740. 214: [
  31741. function (p, i, e) {
  31742. ;(function (d) {
  31743. var e, t
  31744. ;(e = this),
  31745. (t = function (I, e) {
  31746. 'use strict'
  31747. var a,
  31748. t,
  31749. u,
  31750. i,
  31751. s,
  31752. n,
  31753. r,
  31754. o = {}
  31755. return (
  31756. (o.ByteBuffer = I),
  31757. (o.Long = I.Long || null),
  31758. (o.VERSION = '5.0.1'),
  31759. (o.WIRE_TYPES = {}),
  31760. (o.WIRE_TYPES.VARINT = 0),
  31761. (o.WIRE_TYPES.BITS64 = 1),
  31762. (o.WIRE_TYPES.LDELIM = 2),
  31763. (o.WIRE_TYPES.STARTGROUP = 3),
  31764. (o.WIRE_TYPES.ENDGROUP = 4),
  31765. (o.WIRE_TYPES.BITS32 = 5),
  31766. (o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32]),
  31767. (o.TYPES = {
  31768. int32: {
  31769. name: 'int32',
  31770. wireType: o.WIRE_TYPES.VARINT,
  31771. defaultValue: 0
  31772. },
  31773. uint32: {
  31774. name: 'uint32',
  31775. wireType: o.WIRE_TYPES.VARINT,
  31776. defaultValue: 0
  31777. },
  31778. sint32: {
  31779. name: 'sint32',
  31780. wireType: o.WIRE_TYPES.VARINT,
  31781. defaultValue: 0
  31782. },
  31783. int64: {
  31784. name: 'int64',
  31785. wireType: o.WIRE_TYPES.VARINT,
  31786. defaultValue: o.Long ? o.Long.ZERO : void 0
  31787. },
  31788. uint64: {
  31789. name: 'uint64',
  31790. wireType: o.WIRE_TYPES.VARINT,
  31791. defaultValue: o.Long ? o.Long.UZERO : void 0
  31792. },
  31793. sint64: {
  31794. name: 'sint64',
  31795. wireType: o.WIRE_TYPES.VARINT,
  31796. defaultValue: o.Long ? o.Long.ZERO : void 0
  31797. },
  31798. bool: {
  31799. name: 'bool',
  31800. wireType: o.WIRE_TYPES.VARINT,
  31801. defaultValue: !1
  31802. },
  31803. double: {
  31804. name: 'double',
  31805. wireType: o.WIRE_TYPES.BITS64,
  31806. defaultValue: 0
  31807. },
  31808. string: {
  31809. name: 'string',
  31810. wireType: o.WIRE_TYPES.LDELIM,
  31811. defaultValue: ''
  31812. },
  31813. bytes: {
  31814. name: 'bytes',
  31815. wireType: o.WIRE_TYPES.LDELIM,
  31816. defaultValue: null
  31817. },
  31818. fixed32: {
  31819. name: 'fixed32',
  31820. wireType: o.WIRE_TYPES.BITS32,
  31821. defaultValue: 0
  31822. },
  31823. sfixed32: {
  31824. name: 'sfixed32',
  31825. wireType: o.WIRE_TYPES.BITS32,
  31826. defaultValue: 0
  31827. },
  31828. fixed64: {
  31829. name: 'fixed64',
  31830. wireType: o.WIRE_TYPES.BITS64,
  31831. defaultValue: o.Long ? o.Long.UZERO : void 0
  31832. },
  31833. sfixed64: {
  31834. name: 'sfixed64',
  31835. wireType: o.WIRE_TYPES.BITS64,
  31836. defaultValue: o.Long ? o.Long.ZERO : void 0
  31837. },
  31838. float: {
  31839. name: 'float',
  31840. wireType: o.WIRE_TYPES.BITS32,
  31841. defaultValue: 0
  31842. },
  31843. enum: {
  31844. name: 'enum',
  31845. wireType: o.WIRE_TYPES.VARINT,
  31846. defaultValue: 0
  31847. },
  31848. message: {
  31849. name: 'message',
  31850. wireType: o.WIRE_TYPES.LDELIM,
  31851. defaultValue: null
  31852. },
  31853. group: {
  31854. name: 'group',
  31855. wireType: o.WIRE_TYPES.STARTGROUP,
  31856. defaultValue: null
  31857. }
  31858. }),
  31859. (o.MAP_KEY_TYPES = [
  31860. o.TYPES.int32,
  31861. o.TYPES.sint32,
  31862. o.TYPES.sfixed32,
  31863. o.TYPES.uint32,
  31864. o.TYPES.fixed32,
  31865. o.TYPES.int64,
  31866. o.TYPES.sint64,
  31867. o.TYPES.sfixed64,
  31868. o.TYPES.uint64,
  31869. o.TYPES.fixed64,
  31870. o.TYPES.bool,
  31871. o.TYPES.string,
  31872. o.TYPES.bytes
  31873. ]),
  31874. (o.ID_MIN = 1),
  31875. (o.ID_MAX = 536870911),
  31876. (o.convertFieldsToCamelCase = !1),
  31877. (o.populateAccessors = !0),
  31878. (o.populateDefaults = !0),
  31879. (o.Util =
  31880. (((r = {}).IS_NODE = !('object' != typeof d || d + '' != '[object process]' || d.browser)),
  31881. (r.XHR = function () {
  31882. for (
  31883. var e = [
  31884. function () {
  31885. return new XMLHttpRequest()
  31886. },
  31887. function () {
  31888. return new ActiveXObject('Msxml2.XMLHTTP')
  31889. },
  31890. function () {
  31891. return new ActiveXObject('Msxml3.XMLHTTP')
  31892. },
  31893. function () {
  31894. return new ActiveXObject('Microsoft.XMLHTTP')
  31895. }
  31896. ],
  31897. t = null,
  31898. i = 0;
  31899. i < e.length;
  31900. i++
  31901. ) {
  31902. try {
  31903. t = e[i]()
  31904. } catch (e) {
  31905. continue
  31906. }
  31907. break
  31908. }
  31909. if (!t) throw Error('XMLHttpRequest is not supported')
  31910. return t
  31911. }),
  31912. (r.fetch = function (e, i) {
  31913. if ((i && 'function' != typeof i && (i = null), r.IS_NODE)) {
  31914. var t = p('fs')
  31915. if (i)
  31916. t.readFile(e, function (e, t) {
  31917. i(e ? null : '' + t)
  31918. })
  31919. else
  31920. try {
  31921. return t.readFileSync(e)
  31922. } catch (e) {
  31923. return null
  31924. }
  31925. } else {
  31926. var n = r.XHR()
  31927. if ((n.open('GET', e, !!i), n.setRequestHeader('Accept', 'text/plain'), 'function' == typeof n.overrideMimeType && n.overrideMimeType('text/plain'), !i))
  31928. return n.send(null), 200 == n.status || (0 == n.status && 'string' == typeof n.responseText) ? n.responseText : null
  31929. if (
  31930. ((n.onreadystatechange = function () {
  31931. 4 == n.readyState && i(200 == n.status || (0 == n.status && 'string' == typeof n.responseText) ? n.responseText : null)
  31932. }),
  31933. 4 == n.readyState)
  31934. )
  31935. return
  31936. n.send(null)
  31937. }
  31938. }),
  31939. (r.toCamelCase = function (e) {
  31940. return e.replace(/_([a-zA-Z])/g, function (e, t) {
  31941. return t.toUpperCase()
  31942. })
  31943. }),
  31944. r)),
  31945. (o.Lang = {
  31946. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  31947. RULE: /^(?:required|optional|repeated|map)$/,
  31948. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  31949. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  31950. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  31951. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  31952. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  31953. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  31954. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  31955. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  31956. NUMBER_OCT: /^0[0-7]+$/,
  31957. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  31958. BOOL: /^(?:true|false)$/i,
  31959. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  31960. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  31961. WHITESPACE: /\s/,
  31962. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  31963. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  31964. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  31965. }),
  31966. (o.DotProto = (function (r, a) {
  31967. function s(e, t) {
  31968. var i = -1,
  31969. n = 1
  31970. if (('-' == e.charAt(0) && ((n = -1), (e = e.substring(1))), a.NUMBER_DEC.test(e))) i = parseInt(e)
  31971. else if (a.NUMBER_HEX.test(e)) i = parseInt(e.substring(2), 16)
  31972. else {
  31973. if (!a.NUMBER_OCT.test(e)) throw Error('illegal id value: ' + (n < 0 ? '-' : '') + e)
  31974. i = parseInt(e.substring(1), 8)
  31975. }
  31976. if (((i = (n * i) | 0), !t && i < 0)) throw Error('illegal id value: ' + (n < 0 ? '-' : '') + e)
  31977. return i
  31978. }
  31979. function o(e) {
  31980. var t = 1
  31981. if (('-' == e.charAt(0) && ((t = -1), (e = e.substring(1))), a.NUMBER_DEC.test(e))) return t * parseInt(e, 10)
  31982. if (a.NUMBER_HEX.test(e)) return t * parseInt(e.substring(2), 16)
  31983. if (a.NUMBER_OCT.test(e)) return t * parseInt(e.substring(1), 8)
  31984. if ('inf' === e) return t * (1 / 0)
  31985. if ('nan' === e) return NaN
  31986. if (a.NUMBER_FLT.test(e)) return t * parseFloat(e)
  31987. throw Error('illegal number value: ' + (t < 0 ? '-' : '') + e)
  31988. }
  31989. function n(e, t, i) {
  31990. void 0 === e[t] ? (e[t] = i) : (Array.isArray(e[t]) || (e[t] = [e[t]]), e[t].push(i))
  31991. }
  31992. function t(e) {
  31993. ;(this.source = e + ''), (this.index = 0), (this.line = 1), (this.stack = []), (this._stringOpen = null)
  31994. }
  31995. var e = {},
  31996. i = t.prototype
  31997. ;(i._readString = function () {
  31998. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ
  31999. e.lastIndex = this.index - 1
  32000. var t = e.exec(this.source)
  32001. if (!t) throw Error('unterminated string')
  32002. return (this.index = e.lastIndex), this.stack.push(this._stringOpen), (this._stringOpen = null), t[1]
  32003. }),
  32004. (i.next = function () {
  32005. if (0 < this.stack.length) return this.stack.shift()
  32006. if (this.index >= this.source.length) return null
  32007. if (null !== this._stringOpen) return this._readString()
  32008. var e, t, i
  32009. do {
  32010. for (e = !1; a.WHITESPACE.test((i = this.source.charAt(this.index))); ) if (('\n' === i && ++this.line, ++this.index === this.source.length)) return null
  32011. if ('/' === this.source.charAt(this.index))
  32012. if ((++this.index, '/' === this.source.charAt(this.index))) {
  32013. for (; '\n' !== this.source.charAt(++this.index); ) if (this.index == this.source.length) return null
  32014. ++this.index, ++this.line, (e = !0)
  32015. } else {
  32016. if ('*' !== (i = this.source.charAt(this.index))) return '/'
  32017. do {
  32018. if (('\n' === i && ++this.line, ++this.index === this.source.length)) return null
  32019. ;(t = i), (i = this.source.charAt(this.index))
  32020. } while ('*' !== t || '/' !== i)
  32021. ++this.index, (e = !0)
  32022. }
  32023. } while (e)
  32024. if (this.index === this.source.length) return null
  32025. var n = this.index
  32026. if (((a.DELIM.lastIndex = 0), !a.DELIM.test(this.source.charAt(n++)))) for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); ) ++n
  32027. var r = this.source.substring(this.index, (this.index = n))
  32028. return ('"' !== r && "'" !== r) || (this._stringOpen = r), r
  32029. }),
  32030. (i.peek = function () {
  32031. if (0 === this.stack.length) {
  32032. var e = this.next()
  32033. if (null === e) return null
  32034. this.stack.push(e)
  32035. }
  32036. return this.stack[0]
  32037. }),
  32038. (i.skip = function (e) {
  32039. var t = this.next()
  32040. if (t !== e) throw Error("illegal '" + t + "', '" + e + "' expected")
  32041. }),
  32042. (i.omit = function (e) {
  32043. return this.peek() === e && (this.next(), !0)
  32044. }),
  32045. (i.toString = function () {
  32046. return 'Tokenizer (' + this.index + '/' + this.source.length + ' at line ' + this.line + ')'
  32047. }),
  32048. (e.Tokenizer = t)
  32049. function l(e) {
  32050. ;(this.tn = new t(e)), (this.proto3 = !1)
  32051. }
  32052. var c = l.prototype
  32053. return (
  32054. (c.parse = function () {
  32055. var e,
  32056. t,
  32057. i = {
  32058. name: '[ROOT]',
  32059. package: null,
  32060. messages: [],
  32061. enums: [],
  32062. imports: [],
  32063. options: {},
  32064. services: []
  32065. },
  32066. n = !0
  32067. try {
  32068. for (; (e = this.tn.next()); )
  32069. switch (e) {
  32070. case 'package':
  32071. if (!n || null !== i.package) throw Error("unexpected 'package'")
  32072. if (((e = this.tn.next()), !a.TYPEREF.test(e))) throw Error('illegal package name: ' + e)
  32073. this.tn.skip(';'), (i.package = e)
  32074. break
  32075. case 'import':
  32076. if (!n) throw Error("unexpected 'import'")
  32077. ;('public' !== (e = this.tn.peek()) && !(t = 'weak' === e)) || this.tn.next(), (e = this._readString()), this.tn.skip(';'), t || i.imports.push(e)
  32078. break
  32079. case 'syntax':
  32080. if (!n) throw Error("unexpected 'syntax'")
  32081. this.tn.skip('='), 'proto3' === (i.syntax = this._readString()) && (this.proto3 = !0), this.tn.skip(';')
  32082. break
  32083. case 'message':
  32084. this._parseMessage(i, null), (n = !1)
  32085. break
  32086. case 'enum':
  32087. this._parseEnum(i), (n = !1)
  32088. break
  32089. case 'option':
  32090. this._parseOption(i)
  32091. break
  32092. case 'service':
  32093. this._parseService(i)
  32094. break
  32095. case 'extend':
  32096. this._parseExtend(i)
  32097. break
  32098. default:
  32099. throw Error("unexpected '" + e + "'")
  32100. }
  32101. } catch (e) {
  32102. throw ((e.message = 'Parse error at line ' + this.tn.line + ': ' + e.message), e)
  32103. }
  32104. return delete i.name, i
  32105. }),
  32106. (l.parse = function (e) {
  32107. return new l(e).parse()
  32108. }),
  32109. (c._readString = function () {
  32110. var e,
  32111. t,
  32112. i = ''
  32113. do {
  32114. if ("'" !== (t = this.tn.next()) && '"' !== t) throw Error('illegal string delimiter: ' + t)
  32115. ;(i += this.tn.next()), this.tn.skip(t), (e = this.tn.peek())
  32116. } while ('"' === e || '"' === e)
  32117. return i
  32118. }),
  32119. (c._readValue = function (e) {
  32120. var t = this.tn.peek()
  32121. if ('"' === t || "'" === t) return this._readString()
  32122. if ((this.tn.next(), a.NUMBER.test(t))) return o(t)
  32123. if (a.BOOL.test(t)) return 'true' === t.toLowerCase()
  32124. if (e && a.TYPEREF.test(t)) return t
  32125. throw Error('illegal value: ' + t)
  32126. }),
  32127. (c._parseOption = function (e, t) {
  32128. var i = this.tn.next(),
  32129. n = !1
  32130. if (('(' === i && ((n = !0), (i = this.tn.next())), !a.TYPEREF.test(i))) throw Error('illegal option name: ' + i)
  32131. var r = i
  32132. n && (this.tn.skip(')'), (r = '(' + r + ')'), (i = this.tn.peek()), a.FQTYPEREF.test(i) && ((r += i), this.tn.next())),
  32133. this.tn.skip('='),
  32134. this._parseOptionValue(e, r),
  32135. t || this.tn.skip(';')
  32136. }),
  32137. (c._parseOptionValue = function (e, t) {
  32138. var i = this.tn.peek()
  32139. if ('{' !== i) n(e.options, t, this._readValue(!0))
  32140. else
  32141. for (this.tn.skip('{'); '}' !== (i = this.tn.next()); ) {
  32142. if (!a.NAME.test(i)) throw Error('illegal option name: ' + t + '.' + i)
  32143. this.tn.omit(':') ? n(e.options, t + '.' + i, this._readValue(!0)) : this._parseOptionValue(e, t + '.' + i)
  32144. }
  32145. }),
  32146. (c._parseService = function (e) {
  32147. var t = this.tn.next()
  32148. if (!a.NAME.test(t)) throw Error('illegal service name at line ' + this.tn.line + ': ' + t)
  32149. var i = {
  32150. name: t,
  32151. rpc: {},
  32152. options: {}
  32153. }
  32154. for (this.tn.skip('{'); '}' !== (t = this.tn.next()); )
  32155. if ('option' === t) this._parseOption(i)
  32156. else {
  32157. if ('rpc' !== t) throw Error('illegal service token: ' + t)
  32158. this._parseServiceRPC(i)
  32159. }
  32160. this.tn.omit(';'), e.services.push(i)
  32161. }),
  32162. (c._parseServiceRPC = function (e) {
  32163. var t = this.tn.next()
  32164. if (!a.NAME.test(t)) throw Error('illegal rpc service method name: ' + t)
  32165. var i = t,
  32166. n = {
  32167. request: null,
  32168. response: null,
  32169. request_stream: !1,
  32170. response_stream: !1,
  32171. options: {}
  32172. }
  32173. if ((this.tn.skip('('), 'stream' === (t = this.tn.next()).toLowerCase() && ((n.request_stream = !0), (t = this.tn.next())), !a.TYPEREF.test(t)))
  32174. throw Error('illegal rpc service request type: ' + t)
  32175. if (((n.request = t), this.tn.skip(')'), 'returns' !== (t = this.tn.next()).toLowerCase())) throw Error('illegal rpc service request type delimiter: ' + t)
  32176. if (
  32177. (this.tn.skip('('),
  32178. 'stream' === (t = this.tn.next()).toLowerCase() && ((n.response_stream = !0), (t = this.tn.next())),
  32179. (n.response = t),
  32180. this.tn.skip(')'),
  32181. '{' === (t = this.tn.peek()))
  32182. ) {
  32183. for (this.tn.next(); '}' !== (t = this.tn.next()); ) {
  32184. if ('option' !== t) throw Error('illegal rpc service token: ' + t)
  32185. this._parseOption(n)
  32186. }
  32187. this.tn.omit(';')
  32188. } else this.tn.skip(';')
  32189. void 0 === e.rpc && (e.rpc = {}), (e.rpc[i] = n)
  32190. }),
  32191. (c._parseMessage = function (e, t) {
  32192. var i = !!t,
  32193. n = this.tn.next(),
  32194. r = {
  32195. name: '',
  32196. fields: [],
  32197. enums: [],
  32198. messages: [],
  32199. options: {},
  32200. services: [],
  32201. oneofs: {}
  32202. }
  32203. if (!a.NAME.test(n)) throw Error('illegal ' + (i ? 'group' : 'message') + ' name: ' + n)
  32204. for (
  32205. r.name = n, i && (this.tn.skip('='), (t.id = s(this.tn.next())), (r.isGroup = !0)), '[' === (n = this.tn.peek()) && t && this._parseFieldOptions(t), this.tn.skip('{');
  32206. '}' !== (n = this.tn.next());
  32207. )
  32208. if (a.RULE.test(n)) this._parseMessageField(r, n)
  32209. else if ('oneof' === n) this._parseMessageOneOf(r)
  32210. else if ('enum' === n) this._parseEnum(r)
  32211. else if ('message' === n) this._parseMessage(r)
  32212. else if ('option' === n) this._parseOption(r)
  32213. else if ('service' === n) this._parseService(r)
  32214. else if ('extensions' === n) r.extensions = this._parseExtensionRanges()
  32215. else if ('reserved' === n) this._parseIgnored()
  32216. else if ('extend' === n) this._parseExtend(r)
  32217. else {
  32218. if (!a.TYPEREF.test(n)) throw Error('illegal message token: ' + n)
  32219. if (!this.proto3) throw Error('illegal field rule: ' + n)
  32220. this._parseMessageField(r, 'optional', n)
  32221. }
  32222. return this.tn.omit(';'), e.messages.push(r), r
  32223. }),
  32224. (c._parseIgnored = function () {
  32225. for (; ';' !== this.tn.peek(); ) this.tn.next()
  32226. this.tn.skip(';')
  32227. }),
  32228. (c._parseMessageField = function (e, t, i) {
  32229. if (!a.RULE.test(t)) throw Error('illegal message field rule: ' + t)
  32230. var n,
  32231. r = {
  32232. rule: t,
  32233. type: '',
  32234. name: '',
  32235. options: {},
  32236. id: 0
  32237. }
  32238. if ('map' === t) {
  32239. if (i) throw Error('illegal type: ' + i)
  32240. if ((this.tn.skip('<'), (n = this.tn.next()), !a.TYPE.test(n) && !a.TYPEREF.test(n))) throw Error('illegal message field type: ' + n)
  32241. if (((r.keytype = n), this.tn.skip(','), (n = this.tn.next()), !a.TYPE.test(n) && !a.TYPEREF.test(n))) throw Error('illegal message field: ' + n)
  32242. if (((r.type = n), this.tn.skip('>'), (n = this.tn.next()), !a.NAME.test(n))) throw Error('illegal message field name: ' + n)
  32243. ;(r.name = n), this.tn.skip('='), (r.id = s(this.tn.next())), '[' === (n = this.tn.peek()) && this._parseFieldOptions(r), this.tn.skip(';')
  32244. } else if ('group' === (i = void 0 !== i ? i : this.tn.next())) {
  32245. var o = this._parseMessage(e, r)
  32246. if (!/^[A-Z]/.test(o.name)) throw Error('illegal group name: ' + o.name)
  32247. ;(r.type = o.name), (r.name = o.name.toLowerCase()), this.tn.omit(';')
  32248. } else {
  32249. if (!a.TYPE.test(i) && !a.TYPEREF.test(i)) throw Error('illegal message field type: ' + i)
  32250. if (((r.type = i), (n = this.tn.next()), !a.NAME.test(n))) throw Error('illegal message field name: ' + n)
  32251. ;(r.name = n), this.tn.skip('='), (r.id = s(this.tn.next())), '[' === (n = this.tn.peek()) && this._parseFieldOptions(r), this.tn.skip(';')
  32252. }
  32253. return e.fields.push(r), r
  32254. }),
  32255. (c._parseMessageOneOf = function (e) {
  32256. var t = this.tn.next()
  32257. if (!a.NAME.test(t)) throw Error('illegal oneof name: ' + t)
  32258. var i,
  32259. n = t,
  32260. r = []
  32261. for (this.tn.skip('{'); '}' !== (t = this.tn.next()); ) ((i = this._parseMessageField(e, 'optional', t)).oneof = n), r.push(i.id)
  32262. this.tn.omit(';'), (e.oneofs[n] = r)
  32263. }),
  32264. (c._parseFieldOptions = function (e) {
  32265. this.tn.skip('[')
  32266. for (var t = !0; ']' !== this.tn.peek(); ) t || this.tn.skip(','), this._parseOption(e, !0), (t = !1)
  32267. this.tn.next()
  32268. }),
  32269. (c._parseEnum = function (e) {
  32270. var t = {
  32271. name: '',
  32272. values: [],
  32273. options: {}
  32274. },
  32275. i = this.tn.next()
  32276. if (!a.NAME.test(i)) throw Error('illegal name: ' + i)
  32277. for (t.name = i, this.tn.skip('{'); '}' !== (i = this.tn.next()); )
  32278. if ('option' === i) this._parseOption(t)
  32279. else {
  32280. if (!a.NAME.test(i)) throw Error('illegal name: ' + i)
  32281. this.tn.skip('=')
  32282. var n = {
  32283. name: i,
  32284. id: s(this.tn.next(), !0)
  32285. }
  32286. '[' === (i = this.tn.peek()) &&
  32287. this._parseFieldOptions({
  32288. options: {}
  32289. }),
  32290. this.tn.skip(';'),
  32291. t.values.push(n)
  32292. }
  32293. this.tn.omit(';'), e.enums.push(t)
  32294. }),
  32295. (c._parseExtensionRanges = function () {
  32296. var e,
  32297. t,
  32298. i,
  32299. n = []
  32300. do {
  32301. for (t = []; ; ) {
  32302. switch ((e = this.tn.next())) {
  32303. case 'min':
  32304. i = r.ID_MIN
  32305. break
  32306. case 'max':
  32307. i = r.ID_MAX
  32308. break
  32309. default:
  32310. i = o(e)
  32311. }
  32312. if ((t.push(i), 2 === t.length)) break
  32313. if ('to' !== this.tn.peek()) {
  32314. t.push(i)
  32315. break
  32316. }
  32317. this.tn.next()
  32318. }
  32319. n.push(t)
  32320. } while (this.tn.omit(','))
  32321. return this.tn.skip(';'), n
  32322. }),
  32323. (c._parseExtend = function (e) {
  32324. var t = this.tn.next()
  32325. if (!a.TYPEREF.test(t)) throw Error('illegal extend reference: ' + t)
  32326. var i = {
  32327. ref: t,
  32328. fields: []
  32329. }
  32330. for (this.tn.skip('{'); '}' !== (t = this.tn.next()); )
  32331. if (a.RULE.test(t)) this._parseMessageField(i, t)
  32332. else {
  32333. if (!a.TYPEREF.test(t)) throw Error('illegal extend token: ' + t)
  32334. if (!this.proto3) throw Error('illegal field rule: ' + t)
  32335. this._parseMessageField(i, 'optional', t)
  32336. }
  32337. return this.tn.omit(';'), e.messages.push(i), i
  32338. }),
  32339. (c.toString = function () {
  32340. return 'Parser at line ' + this.tn.line
  32341. }),
  32342. (e.Parser = l),
  32343. e
  32344. )
  32345. })(o, o.Lang)),
  32346. (o.Reflect = (function (g) {
  32347. function a(e, t) {
  32348. if (e && 'number' == typeof e.low && 'number' == typeof e.high && 'boolean' == typeof e.unsigned && e.low == e.low && e.high == e.high)
  32349. return new g.Long(e.low, e.high, void 0 === t ? e.unsigned : t)
  32350. if ('string' == typeof e) return g.Long.fromString(e, t || !1, 10)
  32351. if ('number' == typeof e) return g.Long.fromNumber(e, t || !1)
  32352. throw Error('not convertible to Long')
  32353. }
  32354. function m(e, t) {
  32355. var i = t.readVarint32(),
  32356. n = 7 & i,
  32357. r = i >>> 3
  32358. switch (n) {
  32359. case g.WIRE_TYPES.VARINT:
  32360. for (; 128 == (128 & (i = t.readUint8())); );
  32361. break
  32362. case g.WIRE_TYPES.BITS64:
  32363. t.offset += 8
  32364. break
  32365. case g.WIRE_TYPES.LDELIM:
  32366. ;(i = t.readVarint32()), (t.offset += i)
  32367. break
  32368. case g.WIRE_TYPES.STARTGROUP:
  32369. m(r, t)
  32370. break
  32371. case g.WIRE_TYPES.ENDGROUP:
  32372. if (r === e) return !1
  32373. throw Error('Illegal GROUPEND after unknown group: ' + r + ' (' + e + ' expected)')
  32374. case g.WIRE_TYPES.BITS32:
  32375. t.offset += 4
  32376. break
  32377. default:
  32378. throw Error('Illegal wire type in unknown group ' + e + ': ' + n)
  32379. }
  32380. return !0
  32381. }
  32382. function h(e, t, i) {
  32383. ;(this.builder = e), (this.parent = t), (this.name = i), this.className
  32384. }
  32385. var s = {},
  32386. e = h.prototype
  32387. ;(e.fqn = function () {
  32388. for (var e = this.name, t = this; null != (t = t.parent); ) e = t.name + '.' + e
  32389. return e
  32390. }),
  32391. (e.toString = function (e) {
  32392. return (e ? this.className + ' ' : '') + this.fqn()
  32393. }),
  32394. (e.build = function () {
  32395. throw Error(this.toString(!0) + ' cannot be built directly')
  32396. }),
  32397. (s.T = h)
  32398. function l(e, t, i, n, r) {
  32399. h.call(this, e, t, i), (this.className = 'Namespace'), (this.children = []), (this.options = n || {}), (this.syntax = r || 'proto2')
  32400. }
  32401. var t = (l.prototype = Object.create(h.prototype))
  32402. ;(t.getChildren = function (e) {
  32403. if (null == (e = e || null)) return this.children.slice()
  32404. for (var t = [], i = 0, n = this.children.length; i < n; ++i) this.children[i] instanceof e && t.push(this.children[i])
  32405. return t
  32406. }),
  32407. (t.addChild = function (e) {
  32408. var t
  32409. if ((t = this.getChild(e.name)))
  32410. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName)) t.name = t.originalName
  32411. else {
  32412. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  32413. throw Error('Duplicate name in namespace ' + this.toString(!0) + ': ' + e.name)
  32414. e.name = e.originalName
  32415. }
  32416. this.children.push(e)
  32417. }),
  32418. (t.getChild = function (e) {
  32419. for (var t = 'number' == typeof e ? 'id' : 'name', i = 0, n = this.children.length; i < n; ++i) if (this.children[i][t] === e) return this.children[i]
  32420. return null
  32421. }),
  32422. (t.resolve = function (e, t) {
  32423. var i,
  32424. n = 'string' == typeof e ? e.split('.') : e,
  32425. r = this,
  32426. o = 0
  32427. if ('' === n[o]) {
  32428. for (; null !== r.parent; ) r = r.parent
  32429. o++
  32430. }
  32431. do {
  32432. do {
  32433. if (!(r instanceof s.Namespace)) {
  32434. r = null
  32435. break
  32436. }
  32437. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || (t && !(i instanceof s.Namespace))) {
  32438. r = null
  32439. break
  32440. }
  32441. ;(r = i), o++
  32442. } while (o < n.length)
  32443. if (null != r) break
  32444. if (null !== this.parent) return this.parent.resolve(e, t)
  32445. } while (null != r)
  32446. return r
  32447. }),
  32448. (t.qn = function (e) {
  32449. for (var t = [], i = e; t.unshift(i.name), null !== (i = i.parent); );
  32450. for (var n = 1; n <= t.length; n++) {
  32451. var r = t.slice(t.length - n)
  32452. if (e === this.resolve(r, e instanceof s.Namespace)) return r.join('.')
  32453. }
  32454. return e.fqn()
  32455. }),
  32456. (t.build = function () {
  32457. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n) (e = i[n]) instanceof l && (t[e.name] = e.build())
  32458. return (
  32459. Object.defineProperty &&
  32460. Object.defineProperty(t, '$options', {
  32461. value: this.buildOpt()
  32462. }),
  32463. t
  32464. )
  32465. }),
  32466. (t.buildOpt = function () {
  32467. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  32468. var r = t[i],
  32469. o = this.options[t[i]]
  32470. e[r] = o
  32471. }
  32472. return e
  32473. }),
  32474. (t.getOption = function (e) {
  32475. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  32476. }),
  32477. (s.Namespace = l)
  32478. function u(e, t, i, n) {
  32479. if (((this.type = e), (this.resolvedType = t), (this.isMapKey = i), (this.syntax = n), i && g.MAP_KEY_TYPES.indexOf(e) < 0)) throw Error('Invalid map key type: ' + e.name)
  32480. }
  32481. var i = u.prototype
  32482. ;(u.defaultFieldValue = function (e) {
  32483. if (('string' == typeof e && (e = g.TYPES[e]), void 0 === e.defaultValue)) throw Error('default value for type ' + e.name + ' is not supported')
  32484. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  32485. }),
  32486. (i.verifyValue = function (t) {
  32487. function i(e, t) {
  32488. throw Error('Illegal value for ' + n.toString(!0) + ' of type ' + n.type.name + ': ' + e + ' (' + t + ')')
  32489. }
  32490. var n = this
  32491. switch (this.type) {
  32492. case g.TYPES.int32:
  32493. case g.TYPES.sint32:
  32494. case g.TYPES.sfixed32:
  32495. return ('number' != typeof t || (t == t && t % 1 != 0)) && i(typeof t, 'not an integer'), 4294967295 < t ? 0 | t : t
  32496. case g.TYPES.uint32:
  32497. case g.TYPES.fixed32:
  32498. return ('number' != typeof t || (t == t && t % 1 != 0)) && i(typeof t, 'not an integer'), t < 0 ? t >>> 0 : t
  32499. case g.TYPES.int64:
  32500. case g.TYPES.sint64:
  32501. case g.TYPES.sfixed64:
  32502. if (g.Long)
  32503. try {
  32504. return a(t, !1)
  32505. } catch (e) {
  32506. i(typeof t, e.message)
  32507. }
  32508. else i(typeof t, 'requires Long.js')
  32509. case g.TYPES.uint64:
  32510. case g.TYPES.fixed64:
  32511. if (g.Long)
  32512. try {
  32513. return a(t, !0)
  32514. } catch (e) {
  32515. i(typeof t, e.message)
  32516. }
  32517. else i(typeof t, 'requires Long.js')
  32518. case g.TYPES.bool:
  32519. return 'boolean' != typeof t && i(typeof t, 'not a boolean'), t
  32520. case g.TYPES.float:
  32521. case g.TYPES.double:
  32522. return 'number' != typeof t && i(typeof t, 'not a number'), t
  32523. case g.TYPES.string:
  32524. return 'string' == typeof t || (t && t instanceof String) || i(typeof t, 'not a string'), '' + t
  32525. case g.TYPES.bytes:
  32526. return I.isByteBuffer(t) ? t : I.wrap(t, 'base64')
  32527. case g.TYPES.enum:
  32528. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value)
  32529. for (o = 0; o < e.length; o++) {
  32530. if (e[o].name == t) return e[o].id
  32531. if (e[o].id == t) return e[o].id
  32532. }
  32533. if ('proto3' === this.syntax)
  32534. return ('number' != typeof t || (t == t && t % 1 != 0)) && i(typeof t, 'not an integer'), (4294967295 < t || t < 0) && i(typeof t, 'not in range for uint32'), t
  32535. i(t, 'not a valid enum value')
  32536. case g.TYPES.group:
  32537. case g.TYPES.message:
  32538. if (((t && 'object' == typeof t) || i(typeof t, 'object expected'), t instanceof this.resolvedType.clazz)) return t
  32539. if (t instanceof g.Builder.Message) {
  32540. var r = {}
  32541. for (var o in t) t.hasOwnProperty(o) && (r[o] = t[o])
  32542. t = r
  32543. }
  32544. return new this.resolvedType.clazz(t)
  32545. }
  32546. throw Error('[INTERNAL] Illegal value for ' + this.toString(!0) + ': ' + t + ' (undefined type ' + this.type + ')')
  32547. }),
  32548. (i.calculateLength = function (e, t) {
  32549. if (null === t) return 0
  32550. var i
  32551. switch (this.type) {
  32552. case g.TYPES.int32:
  32553. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t)
  32554. case g.TYPES.uint32:
  32555. return I.calculateVarint32(t)
  32556. case g.TYPES.sint32:
  32557. return I.calculateVarint32(I.zigZagEncode32(t))
  32558. case g.TYPES.fixed32:
  32559. case g.TYPES.sfixed32:
  32560. case g.TYPES.float:
  32561. return 4
  32562. case g.TYPES.int64:
  32563. case g.TYPES.uint64:
  32564. return I.calculateVarint64(t)
  32565. case g.TYPES.sint64:
  32566. return I.calculateVarint64(I.zigZagEncode64(t))
  32567. case g.TYPES.fixed64:
  32568. case g.TYPES.sfixed64:
  32569. return 8
  32570. case g.TYPES.bool:
  32571. return 1
  32572. case g.TYPES.enum:
  32573. return I.calculateVarint32(t)
  32574. case g.TYPES.double:
  32575. return 8
  32576. case g.TYPES.string:
  32577. return (i = I.calculateUTF8Bytes(t)), I.calculateVarint32(i) + i
  32578. case g.TYPES.bytes:
  32579. if (t.remaining() < 0) throw Error('Illegal value for ' + this.toString(!0) + ': ' + t.remaining() + ' bytes remaining')
  32580. return I.calculateVarint32(t.remaining()) + t.remaining()
  32581. case g.TYPES.message:
  32582. return (i = this.resolvedType.calculate(t)), I.calculateVarint32(i) + i
  32583. case g.TYPES.group:
  32584. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32((e << 3) | g.WIRE_TYPES.ENDGROUP)
  32585. }
  32586. throw Error('[INTERNAL] Illegal value to encode in ' + this.toString(!0) + ': ' + t + ' (unknown type)')
  32587. }),
  32588. (i.encodeValue = function (e, t, i) {
  32589. if (null === t) return i
  32590. switch (this.type) {
  32591. case g.TYPES.int32:
  32592. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t)
  32593. break
  32594. case g.TYPES.uint32:
  32595. i.writeVarint32(t)
  32596. break
  32597. case g.TYPES.sint32:
  32598. i.writeVarint32ZigZag(t)
  32599. break
  32600. case g.TYPES.fixed32:
  32601. i.writeUint32(t)
  32602. break
  32603. case g.TYPES.sfixed32:
  32604. i.writeInt32(t)
  32605. break
  32606. case g.TYPES.int64:
  32607. case g.TYPES.uint64:
  32608. i.writeVarint64(t)
  32609. break
  32610. case g.TYPES.sint64:
  32611. i.writeVarint64ZigZag(t)
  32612. break
  32613. case g.TYPES.fixed64:
  32614. i.writeUint64(t)
  32615. break
  32616. case g.TYPES.sfixed64:
  32617. i.writeInt64(t)
  32618. break
  32619. case g.TYPES.bool:
  32620. 'string' == typeof t ? i.writeVarint32('false' === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0)
  32621. break
  32622. case g.TYPES.enum:
  32623. i.writeVarint32(t)
  32624. break
  32625. case g.TYPES.float:
  32626. i.writeFloat32(t)
  32627. break
  32628. case g.TYPES.double:
  32629. i.writeFloat64(t)
  32630. break
  32631. case g.TYPES.string:
  32632. i.writeVString(t)
  32633. break
  32634. case g.TYPES.bytes:
  32635. if (t.remaining() < 0) throw Error('Illegal value for ' + this.toString(!0) + ': ' + t.remaining() + ' bytes remaining')
  32636. var n = t.offset
  32637. i.writeVarint32(t.remaining()), i.append(t), (t.offset = n)
  32638. break
  32639. case g.TYPES.message:
  32640. var r = new I().LE()
  32641. this.resolvedType.encode(t, r), i.writeVarint32(r.offset), i.append(r.flip())
  32642. break
  32643. case g.TYPES.group:
  32644. this.resolvedType.encode(t, i), i.writeVarint32((e << 3) | g.WIRE_TYPES.ENDGROUP)
  32645. break
  32646. default:
  32647. throw Error('[INTERNAL] Illegal value to encode in ' + this.toString(!0) + ': ' + t + ' (unknown type)')
  32648. }
  32649. return i
  32650. }),
  32651. (i.decode = function (e, t, i) {
  32652. if (t != this.type.wireType) throw Error('Unexpected wire type for element')
  32653. var n, r
  32654. switch (this.type) {
  32655. case g.TYPES.int32:
  32656. return 0 | e.readVarint32()
  32657. case g.TYPES.uint32:
  32658. return e.readVarint32() >>> 0
  32659. case g.TYPES.sint32:
  32660. return 0 | e.readVarint32ZigZag()
  32661. case g.TYPES.fixed32:
  32662. return e.readUint32() >>> 0
  32663. case g.TYPES.sfixed32:
  32664. return 0 | e.readInt32()
  32665. case g.TYPES.int64:
  32666. return e.readVarint64()
  32667. case g.TYPES.uint64:
  32668. return e.readVarint64().toUnsigned()
  32669. case g.TYPES.sint64:
  32670. return e.readVarint64ZigZag()
  32671. case g.TYPES.fixed64:
  32672. return e.readUint64()
  32673. case g.TYPES.sfixed64:
  32674. return e.readInt64()
  32675. case g.TYPES.bool:
  32676. return !!e.readVarint32()
  32677. case g.TYPES.enum:
  32678. return e.readVarint32()
  32679. case g.TYPES.float:
  32680. return e.readFloat()
  32681. case g.TYPES.double:
  32682. return e.readDouble()
  32683. case g.TYPES.string:
  32684. return e.readVString()
  32685. case g.TYPES.bytes:
  32686. if (((r = e.readVarint32()), e.remaining() < r)) throw Error('Illegal number of bytes for ' + this.toString(!0) + ': ' + r + ' required but got only ' + e.remaining())
  32687. return ((n = e.clone()).limit = n.offset + r), (e.offset += r), n
  32688. case g.TYPES.message:
  32689. return (r = e.readVarint32()), this.resolvedType.decode(e, r)
  32690. case g.TYPES.group:
  32691. return this.resolvedType.decode(e, -1, i)
  32692. }
  32693. throw Error('[INTERNAL] Illegal decode type')
  32694. }),
  32695. (i.valueFromString = function (e) {
  32696. if (!this.isMapKey) throw Error('valueFromString() called on non-map-key element')
  32697. switch (this.type) {
  32698. case g.TYPES.int32:
  32699. case g.TYPES.sint32:
  32700. case g.TYPES.sfixed32:
  32701. case g.TYPES.uint32:
  32702. case g.TYPES.fixed32:
  32703. return this.verifyValue(parseInt(e))
  32704. case g.TYPES.int64:
  32705. case g.TYPES.sint64:
  32706. case g.TYPES.sfixed64:
  32707. case g.TYPES.uint64:
  32708. case g.TYPES.fixed64:
  32709. return this.verifyValue(e)
  32710. case g.TYPES.bool:
  32711. return 'true' === e
  32712. case g.TYPES.string:
  32713. return this.verifyValue(e)
  32714. case g.TYPES.bytes:
  32715. return I.fromBinary(e)
  32716. }
  32717. }),
  32718. (i.valueToString = function (e) {
  32719. if (!this.isMapKey) throw Error('valueToString() called on non-map-key element')
  32720. return this.type === g.TYPES.bytes ? e.toString('binary') : e.toString()
  32721. }),
  32722. (s.Element = u)
  32723. var d = function (e, t, i, n, r, o) {
  32724. l.call(this, e, t, i, n, o),
  32725. (this.className = 'Message'),
  32726. (this.extensions = void 0),
  32727. (this.clazz = null),
  32728. (this.isGroup = !!r),
  32729. (this._fields = null),
  32730. (this._fieldsById = null),
  32731. (this._fieldsByName = null)
  32732. },
  32733. n = (d.prototype = Object.create(l.prototype))
  32734. ;(n.build = function (e) {
  32735. if (this.clazz && !e) return this.clazz
  32736. var t = (function (u, a) {
  32737. function d(e, i, n, r) {
  32738. if (null === e || 'object' != typeof e) {
  32739. if (r && r instanceof u.Reflect.Enum) {
  32740. var t = u.Reflect.Enum.getName(r.object, e)
  32741. if (null !== t) return t
  32742. }
  32743. return e
  32744. }
  32745. if (I.isByteBuffer(e)) return i ? e.toBase64() : e.toBuffer()
  32746. if (u.Long.isLong(e)) return n ? e.toString() : u.Long.fromValue(e)
  32747. var o
  32748. if (Array.isArray(e))
  32749. return (
  32750. (o = []),
  32751. e.forEach(function (e, t) {
  32752. o[t] = d(e, i, n, r)
  32753. }),
  32754. o
  32755. )
  32756. if (((o = {}), e instanceof u.Map)) {
  32757. for (var a = e.entries(), s = a.next(); !s.done; s = a.next()) o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType)
  32758. return o
  32759. }
  32760. var l = e.$type,
  32761. c = void 0
  32762. for (var h in e) e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? (o[h] = d(e[h], i, n, c.resolvedType)) : (o[h] = d(e[h], i, n)))
  32763. return o
  32764. }
  32765. var s = a.getChildren(u.Reflect.Message.Field),
  32766. l = a.getChildren(u.Reflect.Message.OneOf),
  32767. c = function (e, t) {
  32768. u.Builder.Message.call(this)
  32769. for (var i = 0, n = l.length; i < n; ++i) this[l[i].name] = null
  32770. for (i = 0, n = s.length; i < n; ++i) {
  32771. var r = s[i]
  32772. ;(this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null), (!r.required && 'proto3' !== a.syntax) || null === r.defaultValue || (this[r.name] = r.defaultValue)
  32773. }
  32774. var o
  32775. if (0 < arguments.length)
  32776. if (
  32777. 1 !== arguments.length ||
  32778. null === e ||
  32779. 'object' != typeof e ||
  32780. !('function' != typeof e.encode || e instanceof c) ||
  32781. Array.isArray(e) ||
  32782. e instanceof u.Map ||
  32783. I.isByteBuffer(e) ||
  32784. e instanceof ArrayBuffer ||
  32785. (u.Long && e instanceof u.Long)
  32786. )
  32787. for (i = 0, n = arguments.length; i < n; ++i) void 0 !== (o = arguments[i]) && this.$set(s[i].name, o)
  32788. else this.$set(e)
  32789. },
  32790. o = (c.prototype = Object.create(u.Builder.Message.prototype))
  32791. ;(o.add = function (e, t, i) {
  32792. var n = a._fieldsByName[e]
  32793. if (!i) {
  32794. if (!n) throw Error(this + '#' + e + ' is undefined')
  32795. if (!(n instanceof u.Reflect.Message.Field)) throw Error(this + '#' + e + ' is not a field: ' + n.toString(!0))
  32796. if (!n.repeated) throw Error(this + '#' + e + ' is not a repeated field')
  32797. t = n.verifyValue(t, !0)
  32798. }
  32799. return null === this[e] && (this[e] = []), this[e].push(t), this
  32800. }),
  32801. (o.$add = o.add),
  32802. (o.set = function (e, t, i) {
  32803. if (e && 'object' == typeof e) {
  32804. for (var n in ((i = t), e)) e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i)
  32805. return this
  32806. }
  32807. var r = a._fieldsByName[e]
  32808. if (i) this[e] = t
  32809. else {
  32810. if (!r) throw Error(this + '#' + e + ' is not a field: undefined')
  32811. if (!(r instanceof u.Reflect.Message.Field)) throw Error(this + '#' + e + ' is not a field: ' + r.toString(!0))
  32812. this[r.name] = t = r.verifyValue(t)
  32813. }
  32814. if (r && r.oneof) {
  32815. var o = this[r.oneof.name]
  32816. null !== t ? (null !== o && o !== r.name && (this[o] = null), (this[r.oneof.name] = r.name)) : o === e && (this[r.oneof.name] = null)
  32817. }
  32818. return this
  32819. }),
  32820. (o.$set = o.set),
  32821. (o.get = function (e, t) {
  32822. if (t) return this[e]
  32823. var i = a._fieldsByName[e]
  32824. if (!(i && i instanceof u.Reflect.Message.Field)) throw Error(this + '#' + e + ' is not a field: undefined')
  32825. if (!(i instanceof u.Reflect.Message.Field)) throw Error(this + '#' + e + ' is not a field: ' + i.toString(!0))
  32826. return this[i.name]
  32827. }),
  32828. (o.$get = o.get)
  32829. for (var e = 0; e < s.length; e++) {
  32830. var t = s[e]
  32831. t instanceof u.Reflect.Message.ExtensionField ||
  32832. (a.builder.options.populateAccessors &&
  32833. (function (i) {
  32834. var e = i.originalName.replace(/(_[a-zA-Z])/g, function (e) {
  32835. return e.toUpperCase().replace('_', '')
  32836. })
  32837. e = e.substring(0, 1).toUpperCase() + e.substring(1)
  32838. function t(e, t) {
  32839. return (this[i.name] = t ? e : i.verifyValue(e)), this
  32840. }
  32841. function n() {
  32842. return this[i.name]
  32843. }
  32844. var r = i.originalName.replace(/([A-Z])/g, function (e) {
  32845. return '_' + e
  32846. })
  32847. null === a.getChild('set' + e) && (o['set' + e] = t),
  32848. null === a.getChild('set_' + r) && (o['set_' + r] = t),
  32849. null === a.getChild('get' + e) && (o['get' + e] = n),
  32850. null === a.getChild('get_' + r) && (o['get_' + r] = n)
  32851. })(t))
  32852. }
  32853. return (
  32854. (o.encode = function (t, e) {
  32855. 'boolean' == typeof t && ((e = t), (t = void 0))
  32856. var i = !1
  32857. t || ((t = new I()), (i = !0))
  32858. var n = t.littleEndian
  32859. try {
  32860. return a.encode(this, t.LE(), e), (i ? t.flip() : t).LE(n)
  32861. } catch (e) {
  32862. throw (t.LE(n), e)
  32863. }
  32864. }),
  32865. (c.encode = function (e, t, i) {
  32866. return new c(e).encode(t, i)
  32867. }),
  32868. (o.calculate = function () {
  32869. return a.calculate(this)
  32870. }),
  32871. (o.encodeDelimited = function (e, t) {
  32872. var i = !1
  32873. e || ((e = new I()), (i = !0))
  32874. var n = new I().LE()
  32875. return a.encode(this, n, t).flip(), e.writeVarint32(n.remaining()), e.append(n), i ? e.flip() : e
  32876. }),
  32877. (o.encodeAB = function () {
  32878. try {
  32879. return this.encode().toArrayBuffer()
  32880. } catch (e) {
  32881. throw (e.encoded && (e.encoded = e.encoded.toArrayBuffer()), e)
  32882. }
  32883. }),
  32884. (o.toArrayBuffer = o.encodeAB),
  32885. (o.encodeNB = function () {
  32886. try {
  32887. return this.encode().toBuffer()
  32888. } catch (e) {
  32889. throw (e.encoded && (e.encoded = e.encoded.toBuffer()), e)
  32890. }
  32891. }),
  32892. (o.toBuffer = o.encodeNB),
  32893. (o.encode64 = function () {
  32894. try {
  32895. return this.encode().toBase64()
  32896. } catch (e) {
  32897. throw (e.encoded && (e.encoded = e.encoded.toBase64()), e)
  32898. }
  32899. }),
  32900. (o.toBase64 = o.encode64),
  32901. (o.encodeHex = function () {
  32902. try {
  32903. return this.encode().toHex()
  32904. } catch (e) {
  32905. throw (e.encoded && (e.encoded = e.encoded.toHex()), e)
  32906. }
  32907. }),
  32908. (o.toHex = o.encodeHex),
  32909. (o.toRaw = function (e, t) {
  32910. return d(this, !!e, !!t, this.$type)
  32911. }),
  32912. (o.encodeJSON = function () {
  32913. return JSON.stringify(d(this, !0, !0, this.$type))
  32914. }),
  32915. (c.decode = function (t, e, i) {
  32916. 'string' == typeof e && ((i = e), (e = -1)), 'string' == typeof t && (t = I.wrap(t, i || 'base64'))
  32917. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian
  32918. try {
  32919. var r = a.decode(t.LE())
  32920. return t.LE(n), r
  32921. } catch (e) {
  32922. throw (t.LE(n), e)
  32923. }
  32924. }),
  32925. (c.decodeDelimited = function (t, e) {
  32926. if (('string' == typeof t && (t = I.wrap(t, e || 'base64')), (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)) return null
  32927. var i = t.offset,
  32928. n = t.readVarint32()
  32929. if (t.remaining() < n) return (t.offset = i), null
  32930. try {
  32931. var r = a.decode(t.slice(t.offset, t.offset + n).LE())
  32932. return (t.offset += n), r
  32933. } catch (e) {
  32934. throw ((t.offset += n), e)
  32935. }
  32936. }),
  32937. (c.decode64 = function (e) {
  32938. return c.decode(e, 'base64')
  32939. }),
  32940. (c.decodeHex = function (e) {
  32941. return c.decode(e, 'hex')
  32942. }),
  32943. (c.decodeJSON = function (e) {
  32944. return new c(JSON.parse(e))
  32945. }),
  32946. (o.toString = function () {
  32947. return a.toString()
  32948. }),
  32949. Object.defineProperty &&
  32950. (Object.defineProperty(c, '$options', {
  32951. value: a.buildOpt()
  32952. }),
  32953. Object.defineProperty(o, '$options', {
  32954. value: c.$options
  32955. }),
  32956. Object.defineProperty(c, '$type', {
  32957. value: a
  32958. }),
  32959. Object.defineProperty(o, '$type', {
  32960. value: a
  32961. })),
  32962. c
  32963. )
  32964. })(g, this)
  32965. ;(this._fields = []), (this._fieldsById = {}), (this._fieldsByName = {})
  32966. for (var i, n = 0, r = this.children.length; n < r; n++)
  32967. if ((i = this.children[n]) instanceof p || i instanceof d || i instanceof y) {
  32968. if (t.hasOwnProperty(i.name)) throw Error('Illegal reflect child of ' + this.toString(!0) + ': ' + i.toString(!0) + " cannot override static property '" + i.name + "'")
  32969. t[i.name] = i.build()
  32970. } else if (i instanceof d.Field) i.build(), this._fields.push(i), (this._fieldsById[i.id] = i), (this._fieldsByName[i.name] = i)
  32971. else if (!(i instanceof d.OneOf || i instanceof v)) throw Error('Illegal reflect child of ' + this.toString(!0) + ': ' + this.children[n].toString(!0))
  32972. return (this.clazz = t)
  32973. }),
  32974. (n.encode = function (e, t, i) {
  32975. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  32976. (r = e[(n = this._fields[a]).name]), n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e)
  32977. if (null === o) return t
  32978. var l = Error('Missing at least one required field for ' + this.toString(!0) + ': ' + o)
  32979. throw ((l.encoded = t), l)
  32980. }),
  32981. (n.calculate = function (e) {
  32982. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  32983. if (((i = e[(t = this._fields[r]).name]), t.required && null === i)) throw Error('Missing at least one required field for ' + this.toString(!0) + ': ' + t)
  32984. n += t.calculate(i, e)
  32985. }
  32986. return n
  32987. }),
  32988. (n.decode = function (e, t, i) {
  32989. t = 'number' == typeof t ? t : -1
  32990. for (var n, r, o, a, s = e.offset, l = new this.clazz(); e.offset < s + t || (-1 === t && 0 < e.remaining()); ) {
  32991. if (((o = (n = e.readVarint32()) >>> 3), (r = 7 & n) === g.WIRE_TYPES.ENDGROUP)) {
  32992. if (o !== i) throw Error('Illegal group end indicator for ' + this.toString(!0) + ': ' + o + ' (' + (i ? i + ' expected' : 'not a group') + ')')
  32993. break
  32994. }
  32995. if ((a = this._fieldsById[o])) {
  32996. if (a.repeated && !a.options.packed) l[a.name].push(a.decode(r, e))
  32997. else if (a.map) {
  32998. var c = a.decode(r, e)
  32999. l[a.name].set(c[0], c[1])
  33000. } else if (((l[a.name] = a.decode(r, e)), a.oneof)) {
  33001. var h = l[a.oneof.name]
  33002. null !== h && h !== a.name && (l[h] = null), (l[a.oneof.name] = a.name)
  33003. }
  33004. } else
  33005. switch (r) {
  33006. case g.WIRE_TYPES.VARINT:
  33007. e.readVarint32()
  33008. break
  33009. case g.WIRE_TYPES.BITS32:
  33010. e.offset += 4
  33011. break
  33012. case g.WIRE_TYPES.BITS64:
  33013. e.offset += 8
  33014. break
  33015. case g.WIRE_TYPES.LDELIM:
  33016. var u = e.readVarint32()
  33017. e.offset += u
  33018. break
  33019. case g.WIRE_TYPES.STARTGROUP:
  33020. for (; m(o, e); );
  33021. break
  33022. default:
  33023. throw Error('Illegal wire type for unknown field ' + o + ' in ' + this.toString(!0) + '#decode: ' + r)
  33024. }
  33025. }
  33026. for (var d = 0, p = this._fields.length; d < p; ++d)
  33027. if (null === l[(a = this._fields[d]).name])
  33028. if ('proto3' === this.syntax) l[a.name] = a.defaultValue
  33029. else {
  33030. if (a.required) {
  33031. var f = Error('Missing at least one required field for ' + this.toString(!0) + ': ' + a.name)
  33032. throw ((f.decoded = l), f)
  33033. }
  33034. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  33035. }
  33036. return l
  33037. }),
  33038. (s.Message = d)
  33039. function c(e, t, i, n, r, o, a, s, l, c) {
  33040. h.call(this, e, t, o),
  33041. (this.className = 'Message.Field'),
  33042. (this.required = 'required' === i),
  33043. (this.repeated = 'repeated' === i),
  33044. (this.map = 'map' === i),
  33045. (this.keyType = n || null),
  33046. (this.type = r),
  33047. (this.resolvedType = null),
  33048. (this.id = a),
  33049. (this.options = s || {}),
  33050. (this.defaultValue = null),
  33051. (this.oneof = l || null),
  33052. (this.syntax = c || 'proto2'),
  33053. (this.originalName = this.name),
  33054. (this.element = null),
  33055. (this.keyElement = null),
  33056. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  33057. }
  33058. var r = (c.prototype = Object.create(h.prototype))
  33059. ;(r.build = function () {
  33060. ;(this.element = new u(this.type, this.resolvedType, !1, this.syntax)),
  33061. this.map && (this.keyElement = new u(this.keyType, void 0, !0, this.syntax)),
  33062. 'proto3' !== this.syntax || this.repeated || this.map
  33063. ? void 0 !== this.options.default && (this.defaultValue = this.verifyValue(this.options.default))
  33064. : (this.defaultValue = u.defaultFieldValue(this.type))
  33065. }),
  33066. (r.verifyValue = function (e, t) {
  33067. function i(e, t) {
  33068. throw Error('Illegal value for ' + r.toString(!0) + ' of type ' + r.type.name + ': ' + e + ' (' + t + ')')
  33069. }
  33070. t = t || !1
  33071. var n,
  33072. r = this
  33073. if (null === e)
  33074. return (
  33075. this.required && i(typeof e, 'required'),
  33076. 'proto3' === this.syntax && this.type !== g.TYPES.message && i(typeof e, 'proto3 field without field presence cannot be null'),
  33077. null
  33078. )
  33079. if (!this.repeated || t)
  33080. return this.map && !t
  33081. ? e instanceof g.Map
  33082. ? e
  33083. : (e instanceof Object || i(typeof e, 'expected ProtoBuf.Map or raw object for map field'), new g.Map(this, e))
  33084. : (!this.repeated && Array.isArray(e) && i(typeof e, 'no array expected'), this.element.verifyValue(e))
  33085. Array.isArray(e) || (e = [e])
  33086. var o = []
  33087. for (n = 0; n < e.length; n++) o.push(this.element.verifyValue(e[n]))
  33088. return o
  33089. }),
  33090. (r.hasWirePresence = function (e, t) {
  33091. if ('proto3' !== this.syntax) return null !== e
  33092. if (this.oneof && t[this.oneof.name] === this.name) return !0
  33093. switch (this.type) {
  33094. case g.TYPES.int32:
  33095. case g.TYPES.sint32:
  33096. case g.TYPES.sfixed32:
  33097. case g.TYPES.uint32:
  33098. case g.TYPES.fixed32:
  33099. return 0 !== e
  33100. case g.TYPES.int64:
  33101. case g.TYPES.sint64:
  33102. case g.TYPES.sfixed64:
  33103. case g.TYPES.uint64:
  33104. case g.TYPES.fixed64:
  33105. return 0 !== e.low || 0 !== e.high
  33106. case g.TYPES.bool:
  33107. return e
  33108. case g.TYPES.float:
  33109. case g.TYPES.double:
  33110. return 0 !== e
  33111. case g.TYPES.string:
  33112. return 0 < e.length
  33113. case g.TYPES.bytes:
  33114. return 0 < e.remaining()
  33115. case g.TYPES.enum:
  33116. return 0 !== e
  33117. case g.TYPES.message:
  33118. return null !== e
  33119. default:
  33120. return !0
  33121. }
  33122. }),
  33123. (r.encode = function (t, r, e) {
  33124. if (null === this.type || 'object' != typeof this.type) throw Error('[INTERNAL] Unresolved type in ' + this.toString(!0) + ': ' + this.type)
  33125. if (null === t || (this.repeated && 0 == t.length)) return r
  33126. try {
  33127. var i
  33128. if (this.repeated)
  33129. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33130. r.writeVarint32((this.id << 3) | g.WIRE_TYPES.LDELIM), r.ensureCapacity((r.offset += 1))
  33131. var n = r.offset
  33132. for (i = 0; i < t.length; i++) this.element.encodeValue(this.id, t[i], r)
  33133. var o = r.offset - n,
  33134. a = I.calculateVarint32(o)
  33135. if (1 < a) {
  33136. var s = r.slice(n, r.offset)
  33137. ;(n += a - 1), (r.offset = n), r.append(s)
  33138. }
  33139. r.writeVarint32(o, n - a)
  33140. } else for (i = 0; i < t.length; i++) r.writeVarint32((this.id << 3) | this.type.wireType), this.element.encodeValue(this.id, t[i], r)
  33141. else
  33142. this.map
  33143. ? t.forEach(function (e, t, i) {
  33144. var n =
  33145. I.calculateVarint32(8 | this.keyType.wireType) +
  33146. this.keyElement.calculateLength(1, t) +
  33147. I.calculateVarint32(16 | this.type.wireType) +
  33148. this.element.calculateLength(2, e)
  33149. r.writeVarint32((this.id << 3) | g.WIRE_TYPES.LDELIM),
  33150. r.writeVarint32(n),
  33151. r.writeVarint32(8 | this.keyType.wireType),
  33152. this.keyElement.encodeValue(1, t, r),
  33153. r.writeVarint32(16 | this.type.wireType),
  33154. this.element.encodeValue(2, e, r)
  33155. }, this)
  33156. : this.hasWirePresence(t, e) && (r.writeVarint32((this.id << 3) | this.type.wireType), this.element.encodeValue(this.id, t, r))
  33157. } catch (e) {
  33158. throw Error('Illegal value for ' + this.toString(!0) + ': ' + t + ' (' + e + ')')
  33159. }
  33160. return r
  33161. }),
  33162. (r.calculate = function (t, e) {
  33163. if (((t = this.verifyValue(t)), null === this.type || 'object' != typeof this.type)) throw Error('[INTERNAL] Unresolved type in ' + this.toString(!0) + ': ' + this.type)
  33164. if (null === t || (this.repeated && 0 == t.length)) return 0
  33165. var r = 0
  33166. try {
  33167. var i, n
  33168. if (this.repeated)
  33169. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33170. for (r += I.calculateVarint32((this.id << 3) | g.WIRE_TYPES.LDELIM), i = n = 0; i < t.length; i++) n += this.element.calculateLength(this.id, t[i])
  33171. ;(r += I.calculateVarint32(n)), (r += n)
  33172. } else for (i = 0; i < t.length; i++) (r += I.calculateVarint32((this.id << 3) | this.type.wireType)), (r += this.element.calculateLength(this.id, t[i]))
  33173. else
  33174. this.map
  33175. ? t.forEach(function (e, t, i) {
  33176. var n =
  33177. I.calculateVarint32(8 | this.keyType.wireType) +
  33178. this.keyElement.calculateLength(1, t) +
  33179. I.calculateVarint32(16 | this.type.wireType) +
  33180. this.element.calculateLength(2, e)
  33181. ;(r += I.calculateVarint32((this.id << 3) | g.WIRE_TYPES.LDELIM)), (r += I.calculateVarint32(n)), (r += n)
  33182. }, this)
  33183. : this.hasWirePresence(t, e) && ((r += I.calculateVarint32((this.id << 3) | this.type.wireType)), (r += this.element.calculateLength(this.id, t)))
  33184. } catch (e) {
  33185. throw Error('Illegal value for ' + this.toString(!0) + ': ' + t + ' (' + e + ')')
  33186. }
  33187. return r
  33188. }),
  33189. (r.decode = function (e, t, i) {
  33190. var n, r
  33191. if (!((!this.map && e == this.type.wireType) || (!i && this.repeated && this.options.packed && e == g.WIRE_TYPES.LDELIM) || (this.map && e == g.WIRE_TYPES.LDELIM)))
  33192. throw Error('Illegal wire type for field ' + this.toString(!0) + ': ' + e + ' (' + this.type.wireType + ' expected)')
  33193. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  33194. ;(r = t.readVarint32()), (r = t.offset + r)
  33195. for (var o = []; t.offset < r; ) o.push(this.decode(this.type.wireType, t, !0))
  33196. return o
  33197. }
  33198. if (this.map) {
  33199. var a = u.defaultFieldValue(this.keyType)
  33200. if (((n = u.defaultFieldValue(this.type)), (r = t.readVarint32()), t.remaining() < r))
  33201. throw Error('Illegal number of bytes for ' + this.toString(!0) + ': ' + r + ' required but got only ' + t.remaining())
  33202. var s = t.clone()
  33203. for (s.limit = s.offset + r, t.offset += r; 0 < s.remaining(); ) {
  33204. var l = s.readVarint32()
  33205. e = 7 & l
  33206. var c = l >>> 3
  33207. if (1 == c) a = this.keyElement.decode(s, e, c)
  33208. else {
  33209. if (2 != c) throw Error('Unexpected tag in map field key/value submessage')
  33210. n = this.element.decode(s, e, c)
  33211. }
  33212. }
  33213. return [a, n]
  33214. }
  33215. return this.element.decode(t, e, this.id)
  33216. }),
  33217. (s.Message.Field = c)
  33218. function o(e, t, i, n, r, o, a) {
  33219. c.call(this, e, t, i, null, n, r, o, a), this.extension
  33220. }
  33221. ;(o.prototype = Object.create(c.prototype)), (s.Message.ExtensionField = o)
  33222. s.Message.OneOf = function (e, t, i) {
  33223. h.call(this, e, t, i), (this.fields = [])
  33224. }
  33225. var p = function (e, t, i, n, r) {
  33226. l.call(this, e, t, i, n, r), (this.className = 'Enum'), (this.object = null)
  33227. }
  33228. ;(p.getName = function (e, t) {
  33229. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r) if (e[(i = n[r])] === t) return i
  33230. return null
  33231. }),
  33232. ((p.prototype = Object.create(l.prototype)).build = function (e) {
  33233. if (this.object && !e) return this.object
  33234. for (var t = new g.Builder.Enum(), i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n) t[i[n].name] = i[n].id
  33235. return (
  33236. Object.defineProperty &&
  33237. Object.defineProperty(t, '$options', {
  33238. value: this.buildOpt(),
  33239. enumerable: !1
  33240. }),
  33241. (this.object = t)
  33242. )
  33243. }),
  33244. (s.Enum = p)
  33245. function f(e, t, i, n) {
  33246. h.call(this, e, t, i), (this.className = 'Enum.Value'), (this.id = n)
  33247. }
  33248. ;(f.prototype = Object.create(h.prototype)), (s.Enum.Value = f)
  33249. var v = function (e, t, i, n) {
  33250. h.call(this, e, t, i), (this.field = n)
  33251. }
  33252. ;(v.prototype = Object.create(h.prototype)), (s.Extension = v)
  33253. var y = function (e, t, i, n) {
  33254. l.call(this, e, t, i, n), (this.className = 'Service'), (this.clazz = null)
  33255. }
  33256. ;((y.prototype = Object.create(l.prototype)).build = function (e) {
  33257. return this.clazz && !e
  33258. ? this.clazz
  33259. : (this.clazz = (function (t, r) {
  33260. for (
  33261. var o = function (e) {
  33262. t.Builder.Service.call(this),
  33263. (this.rpcImpl =
  33264. e ||
  33265. function (e, t, i) {
  33266. setTimeout(i.bind(this, Error('Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services')), 0)
  33267. })
  33268. },
  33269. e = (o.prototype = Object.create(t.Builder.Service.prototype)),
  33270. i = r.getChildren(t.Reflect.Service.RPCMethod),
  33271. n = 0;
  33272. n < i.length;
  33273. n++
  33274. )
  33275. !(function (n) {
  33276. ;(e[n.name] = function (e, i) {
  33277. try {
  33278. try {
  33279. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  33280. } catch (e) {
  33281. if (!(e instanceof TypeError)) throw e
  33282. }
  33283. if (null === e || 'object' != typeof e) throw Error('Illegal arguments')
  33284. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  33285. this.rpcImpl(n.fqn(), e, function (e, t) {
  33286. if (!e) {
  33287. null === t && (t = '')
  33288. try {
  33289. t = n.resolvedResponseType.clazz.decode(t)
  33290. } catch (e) {}
  33291. return t && t instanceof n.resolvedResponseType.clazz
  33292. ? void i(null, t)
  33293. : void i(Error('Illegal response type received in service method ' + r.name + '#' + n.name))
  33294. }
  33295. i(e)
  33296. })
  33297. } catch (e) {
  33298. setTimeout(i.bind(this, e), 0)
  33299. }
  33300. }),
  33301. (o[n.name] = function (e, t, i) {
  33302. new o(e)[n.name](t, i)
  33303. }),
  33304. Object.defineProperty &&
  33305. (Object.defineProperty(o[n.name], '$options', {
  33306. value: n.buildOpt()
  33307. }),
  33308. Object.defineProperty(e[n.name], '$options', {
  33309. value: o[n.name].$options
  33310. }))
  33311. })(i[n])
  33312. return (
  33313. Object.defineProperty &&
  33314. (Object.defineProperty(o, '$options', {
  33315. value: r.buildOpt()
  33316. }),
  33317. Object.defineProperty(e, '$options', {
  33318. value: o.$options
  33319. }),
  33320. Object.defineProperty(o, '$type', {
  33321. value: r
  33322. }),
  33323. Object.defineProperty(e, '$type', {
  33324. value: r
  33325. })),
  33326. o
  33327. )
  33328. })(g, this))
  33329. }),
  33330. (s.Service = y)
  33331. function A(e, t, i, n) {
  33332. h.call(this, e, t, i), (this.className = 'Service.Method'), (this.options = n || {})
  33333. }
  33334. ;((A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt), (s.Service.Method = A)
  33335. function C(e, t, i, n, r, o, a, s) {
  33336. A.call(this, e, t, i, s),
  33337. (this.className = 'Service.RPCMethod'),
  33338. (this.requestName = n),
  33339. (this.responseName = r),
  33340. (this.requestStream = o),
  33341. (this.responseStream = a),
  33342. (this.resolvedRequestType = null),
  33343. (this.resolvedResponseType = null)
  33344. }
  33345. return (C.prototype = Object.create(A.prototype)), (s.Service.RPCMethod = C), s
  33346. })(o)),
  33347. (o.Builder =
  33348. ((i = (u = o).Lang),
  33349. (s = o.Reflect),
  33350. (n = h.prototype),
  33351. (h.isMessage = function (e) {
  33352. return 'string' == typeof e.name && void 0 === e.values && void 0 === e.rpc
  33353. }),
  33354. (h.isMessageField = function (e) {
  33355. return 'string' == typeof e.rule && 'string' == typeof e.name && 'string' == typeof e.type && void 0 !== e.id
  33356. }),
  33357. (h.isEnum = function (e) {
  33358. return 'string' == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  33359. }),
  33360. (h.isService = function (e) {
  33361. return !('string' != typeof e.name || 'object' != typeof e.rpc || !e.rpc)
  33362. }),
  33363. (h.isExtend = function (e) {
  33364. return 'string' == typeof e.ref
  33365. }),
  33366. (n.reset = function () {
  33367. return (this.ptr = this.ns), this
  33368. }),
  33369. (n.define = function (e) {
  33370. if ('string' != typeof e || !i.TYPEREF.test(e)) throw Error('illegal namespace: ' + e)
  33371. return (
  33372. e.split('.').forEach(function (e) {
  33373. var t = this.ptr.getChild(e)
  33374. null === t && this.ptr.addChild((t = new s.Namespace(this, this.ptr, e))), (this.ptr = t)
  33375. }, this),
  33376. this
  33377. )
  33378. }),
  33379. (n.create = function (e) {
  33380. if (!e) return this
  33381. if (Array.isArray(e)) {
  33382. if (0 === e.length) return this
  33383. e = e.slice()
  33384. } else e = [e]
  33385. for (var t = [e]; 0 < t.length; ) {
  33386. if (((e = t.pop()), !Array.isArray(e))) throw Error('not a valid namespace: ' + JSON.stringify(e))
  33387. for (; 0 < e.length; ) {
  33388. var i = e.shift()
  33389. if (h.isMessage(i)) {
  33390. var o = new s.Message(this, this.ptr, i.name, i.options, i.isGroup, i.syntax),
  33391. n = {}
  33392. i.oneofs &&
  33393. Object.keys(i.oneofs).forEach(function (e) {
  33394. o.addChild((n[e] = new s.Message.OneOf(this, o, e)))
  33395. }, this),
  33396. i.fields &&
  33397. i.fields.forEach(function (e) {
  33398. if (null !== o.getChild(0 | e.id)) throw Error('duplicate or invalid field id in ' + o.name + ': ' + e.id)
  33399. if (e.options && 'object' != typeof e.options) throw Error('illegal field options in ' + o.name + '#' + e.name)
  33400. var t = null
  33401. if ('string' == typeof e.oneof && !(t = n[e.oneof])) throw Error('illegal oneof in ' + o.name + '#' + e.name + ': ' + e.oneof)
  33402. ;(e = new s.Message.Field(this, o, e.rule, e.keytype, e.type, e.name, e.id, e.options, t, i.syntax)), t && t.fields.push(e), o.addChild(e)
  33403. }, this)
  33404. var r = []
  33405. if (
  33406. (i.enums &&
  33407. i.enums.forEach(function (e) {
  33408. r.push(e)
  33409. }),
  33410. i.messages &&
  33411. i.messages.forEach(function (e) {
  33412. r.push(e)
  33413. }),
  33414. i.services &&
  33415. i.services.forEach(function (e) {
  33416. r.push(e)
  33417. }),
  33418. i.extensions && ('number' == typeof i.extensions[0] ? (o.extensions = [i.extensions]) : (o.extensions = i.extensions)),
  33419. this.ptr.addChild(o),
  33420. 0 < r.length)
  33421. ) {
  33422. t.push(e), (e = r), (r = null), (this.ptr = o), (o = null)
  33423. continue
  33424. }
  33425. r = null
  33426. } else if (h.isEnum(i))
  33427. (o = new s.Enum(this, this.ptr, i.name, i.options, i.syntax)),
  33428. i.values.forEach(function (e) {
  33429. o.addChild(new s.Enum.Value(this, o, e.name, e.id))
  33430. }, this),
  33431. this.ptr.addChild(o)
  33432. else if (h.isService(i))
  33433. (o = new s.Service(this, this.ptr, i.name, i.options)),
  33434. Object.keys(i.rpc).forEach(function (e) {
  33435. var t = i.rpc[e]
  33436. o.addChild(new s.Service.RPCMethod(this, o, e, t.request, t.response, !!t.request_stream, !!t.response_stream, t.options))
  33437. }, this),
  33438. this.ptr.addChild(o)
  33439. else {
  33440. if (!h.isExtend(i)) throw Error('not a valid definition: ' + JSON.stringify(i))
  33441. if ((o = this.ptr.resolve(i.ref, !0)))
  33442. i.fields.forEach(function (t) {
  33443. if (null !== o.getChild(0 | t.id)) throw Error('duplicate extended field id in ' + o.name + ': ' + t.id)
  33444. if (o.extensions) {
  33445. var i = !1
  33446. if (
  33447. (o.extensions.forEach(function (e) {
  33448. t.id >= e[0] && t.id <= e[1] && (i = !0)
  33449. }),
  33450. !i)
  33451. )
  33452. throw Error('illegal extended field id in ' + o.name + ': ' + t.id + ' (not within valid ranges)')
  33453. }
  33454. var e = t.name
  33455. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e))
  33456. var n = new s.Message.ExtensionField(this, o, t.rule, t.type, this.ptr.fqn() + '.' + e, t.id, t.options),
  33457. r = new s.Extension(this, this.ptr, t.name, n)
  33458. ;(n.extension = r), this.ptr.addChild(r), o.addChild(n)
  33459. }, this)
  33460. else if (!/\.?google\.protobuf\./.test(i.ref)) throw Error('extended message ' + i.ref + ' is not defined')
  33461. }
  33462. o = i = null
  33463. }
  33464. ;(e = null), (this.ptr = this.ptr.parent)
  33465. }
  33466. return (this.resolved = !1), (this.result = null), this
  33467. }),
  33468. (n.import = function (t, e) {
  33469. var i = '/'
  33470. if ('string' == typeof e) {
  33471. if ((u.Util.IS_NODE && (e = p('path').resolve(e)), !0 === this.files[e])) return this.reset()
  33472. this.files[e] = !0
  33473. } else if ('object' == typeof e) {
  33474. var n = e.root
  33475. u.Util.IS_NODE && (n = p('path').resolve(n)), (0 <= n.indexOf('\\') || 0 <= e.file.indexOf('\\')) && (i = '\\')
  33476. var r = n + i + e.file
  33477. if (!0 === this.files[r]) return this.reset()
  33478. this.files[r] = !0
  33479. }
  33480. if (t.imports && 0 < t.imports.length) {
  33481. var o,
  33482. a = !1
  33483. 'object' == typeof e
  33484. ? ((this.importRoot = e.root), (a = !0), (o = this.importRoot), (e = e.file), (0 <= o.indexOf('\\') || 0 <= e.indexOf('\\')) && (i = '\\'))
  33485. : 'string' == typeof e
  33486. ? this.importRoot
  33487. ? (o = this.importRoot)
  33488. : 0 <= e.indexOf('/')
  33489. ? '' === (o = e.replace(/\/[^\/]*$/, '')) && (o = '/')
  33490. : 0 <= e.indexOf('\\')
  33491. ? ((o = e.replace(/\\[^\\]*$/, '')), (i = '\\'))
  33492. : (o = '.')
  33493. : (o = null)
  33494. for (var s = 0; s < t.imports.length; s++)
  33495. if ('string' == typeof t.imports[s]) {
  33496. if (!o) throw Error('cannot determine import root')
  33497. var l = t.imports[s]
  33498. if ('google/protobuf/descriptor.proto' === l) continue
  33499. if (((l = o + i + l), !0 === this.files[l])) continue
  33500. ;/\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, '.json'))
  33501. var c = u.Util.fetch(l)
  33502. if (null === c) throw Error("failed to import '" + l + "' in '" + e + "': file not found")
  33503. ;/\.json$/i.test(l) ? this.import(JSON.parse(c + ''), l) : this.import(u.DotProto.Parser.parse(c), l)
  33504. } else
  33505. e
  33506. ? /\.(\w+)$/.test(e)
  33507. ? this.import(
  33508. t.imports[s],
  33509. e.replace(/^(.+)\.(\w+)$/, function (e, t, i) {
  33510. return t + '_import' + s + '.' + i
  33511. })
  33512. )
  33513. : this.import(t.imports[s], e + '_import' + s)
  33514. : this.import(t.imports[s])
  33515. a && (this.importRoot = null)
  33516. }
  33517. t.package && this.define(t.package),
  33518. t.syntax &&
  33519. (function t(i) {
  33520. i.messages &&
  33521. i.messages.forEach(function (e) {
  33522. ;(e.syntax = i.syntax), t(e)
  33523. }),
  33524. i.enums &&
  33525. i.enums.forEach(function (e) {
  33526. e.syntax = i.syntax
  33527. })
  33528. })(t)
  33529. var h = this.ptr
  33530. return (
  33531. t.options &&
  33532. Object.keys(t.options).forEach(function (e) {
  33533. h.options[e] = t.options[e]
  33534. }),
  33535. t.messages && (this.create(t.messages), (this.ptr = h)),
  33536. t.enums && (this.create(t.enums), (this.ptr = h)),
  33537. t.services && (this.create(t.services), (this.ptr = h)),
  33538. t.extends && this.create(t.extends),
  33539. this.reset()
  33540. )
  33541. }),
  33542. (n.resolveAll = function () {
  33543. var e
  33544. if (null == this.ptr || 'object' == typeof this.ptr.type) return this
  33545. if (this.ptr instanceof s.Namespace)
  33546. this.ptr.children.forEach(function (e) {
  33547. ;(this.ptr = e), this.resolveAll()
  33548. }, this)
  33549. else if (this.ptr instanceof s.Message.Field) {
  33550. if (i.TYPE.test(this.ptr.type)) this.ptr.type = u.TYPES[this.ptr.type]
  33551. else {
  33552. if (!i.TYPEREF.test(this.ptr.type)) throw Error('illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.type)
  33553. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  33554. throw Error('unresolvable type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.type)
  33555. if ((this.ptr.resolvedType = e) instanceof s.Enum) {
  33556. if (((this.ptr.type = u.TYPES.enum), 'proto3' === this.ptr.syntax && 'proto3' !== e.syntax)) throw Error('proto3 message cannot reference proto2 enum')
  33557. } else {
  33558. if (!(e instanceof s.Message)) throw Error('illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.type)
  33559. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  33560. }
  33561. }
  33562. if (this.ptr.map) {
  33563. if (!i.TYPE.test(this.ptr.keyType)) throw Error('illegal key type for map field in ' + this.ptr.toString(!0) + ': ' + this.ptr.keyType)
  33564. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  33565. }
  33566. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  33567. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod)) throw Error('illegal service type in ' + this.ptr.toString(!0))
  33568. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  33569. throw Error('Illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.requestName)
  33570. if (((this.ptr.resolvedRequestType = e), !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message)))
  33571. throw Error('Illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.responseName)
  33572. this.ptr.resolvedResponseType = e
  33573. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  33574. throw Error('illegal object in namespace: ' + typeof this.ptr + ': ' + this.ptr)
  33575. return this.reset()
  33576. }),
  33577. (n.build = function (e) {
  33578. if ((this.reset(), this.resolved || (this.resolveAll(), (this.resolved = !0), (this.result = null)), null === this.result && (this.result = this.ns.build()), !e))
  33579. return this.result
  33580. for (var t = 'string' == typeof e ? e.split('.') : e, i = this.result, n = 0; n < t.length; n++) {
  33581. if (!i[t[n]]) {
  33582. i = null
  33583. break
  33584. }
  33585. i = i[t[n]]
  33586. }
  33587. return i
  33588. }),
  33589. (n.lookup = function (e, t) {
  33590. return e ? this.ns.resolve(e, t) : this.ns
  33591. }),
  33592. (n.toString = function () {
  33593. return 'Builder'
  33594. }),
  33595. (h.Message = function () {}),
  33596. (h.Enum = function () {}),
  33597. (h.Service = function () {}),
  33598. h)),
  33599. (o.Map =
  33600. ((a = o.Reflect),
  33601. ((t = c.prototype).clear = function () {
  33602. this.map = {}
  33603. }),
  33604. (t.delete = function (e) {
  33605. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e)),
  33606. i = t in this.map
  33607. return delete this.map[t], i
  33608. }),
  33609. (t.entries = function () {
  33610. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++) t.push([(e = this.map[i[n]]).key, e.value])
  33611. return l(t)
  33612. }),
  33613. (t.keys = function () {
  33614. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++) e.push(this.map[t[i]].key)
  33615. return l(e)
  33616. }),
  33617. (t.values = function () {
  33618. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++) e.push(this.map[t[i]].value)
  33619. return l(e)
  33620. }),
  33621. (t.forEach = function (e, t) {
  33622. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++) e.call(t, (i = this.map[n[r]]).value, i.key, this)
  33623. }),
  33624. (t.set = function (e, t) {
  33625. var i = this.keyElem.verifyValue(e),
  33626. n = this.valueElem.verifyValue(t)
  33627. return (
  33628. (this.map[this.keyElem.valueToString(i)] = {
  33629. key: i,
  33630. value: n
  33631. }),
  33632. this
  33633. )
  33634. }),
  33635. (t.get = function (e) {
  33636. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  33637. if (t in this.map) return this.map[t].value
  33638. }),
  33639. (t.has = function (e) {
  33640. return this.keyElem.valueToString(this.keyElem.verifyValue(e)) in this.map
  33641. }),
  33642. c)),
  33643. (o.loadProto = function (e, t, i) {
  33644. return ('string' == typeof t || (t && 'string' == typeof t.file && 'string' == typeof t.root)) && ((i = t), (t = void 0)), o.loadJson(o.DotProto.Parser.parse(e), t, i)
  33645. }),
  33646. (o.protoFromString = o.loadProto),
  33647. (o.loadProtoFile = function (t, i, n) {
  33648. if ((i && 'object' == typeof i ? ((n = i), (i = null)) : (i && 'function' == typeof i) || (i = null), i))
  33649. return o.Util.fetch('string' == typeof t ? t : t.root + '/' + t.file, function (e) {
  33650. if (null !== e)
  33651. try {
  33652. i(null, o.loadProto(e, n, t))
  33653. } catch (e) {
  33654. i(e)
  33655. }
  33656. else i(Error('Failed to fetch file'))
  33657. })
  33658. var e = o.Util.fetch('object' == typeof t ? t.root + '/' + t.file : t)
  33659. return null === e ? null : o.loadProto(e, n, t)
  33660. }),
  33661. (o.protoFromFile = o.loadProtoFile),
  33662. (o.newBuilder = function (e) {
  33663. return (
  33664. void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  33665. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  33666. new o.Builder(e)
  33667. )
  33668. }),
  33669. (o.loadJson = function (e, t, i) {
  33670. return (
  33671. ('string' == typeof t || (t && 'string' == typeof t.file && 'string' == typeof t.root)) && ((i = t), (t = null)),
  33672. (t && 'object' == typeof t) || (t = o.newBuilder()),
  33673. 'string' == typeof e && (e = JSON.parse(e)),
  33674. t.import(e, i),
  33675. t.resolveAll(),
  33676. t
  33677. )
  33678. }),
  33679. (o.loadJsonFile = function (t, i, n) {
  33680. if ((i && 'object' == typeof i ? ((n = i), (i = null)) : (i && 'function' == typeof i) || (i = null), i))
  33681. return o.Util.fetch('string' == typeof t ? t : t.root + '/' + t.file, function (e) {
  33682. if (null !== e)
  33683. try {
  33684. i(null, o.loadJson(JSON.parse(e), n, t))
  33685. } catch (e) {
  33686. i(e)
  33687. }
  33688. else i(Error('Failed to fetch file'))
  33689. })
  33690. var e = o.Util.fetch('object' == typeof t ? t.root + '/' + t.file : t)
  33691. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  33692. }),
  33693. o
  33694. )
  33695. function l(e) {
  33696. var t = 0
  33697. return {
  33698. next: function () {
  33699. return t < e.length
  33700. ? {
  33701. done: !1,
  33702. value: e[t++]
  33703. }
  33704. : {
  33705. done: !0
  33706. }
  33707. }
  33708. }
  33709. }
  33710. function c(e, t) {
  33711. if (!e.map) throw Error('field is not a map')
  33712. if (
  33713. ((this.field = e),
  33714. (this.keyElem = new a.Element(e.keyType, null, !0, e.syntax)),
  33715. (this.valueElem = new a.Element(e.type, e.resolvedType, !1, e.syntax)),
  33716. (this.map = {}),
  33717. Object.defineProperty(this, 'size', {
  33718. get: function () {
  33719. return Object.keys(this.map).length
  33720. }
  33721. }),
  33722. t)
  33723. )
  33724. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  33725. var r = this.keyElem.valueFromString(i[n]),
  33726. o = this.valueElem.verifyValue(t[i[n]])
  33727. this.map[this.keyElem.valueToString(r)] = {
  33728. key: r,
  33729. value: o
  33730. }
  33731. }
  33732. }
  33733. function h(e) {
  33734. ;(this.ns = new s.Namespace(this, null, '')), (this.ptr = this.ns), (this.resolved = !1), (this.result = null), (this.files = {}), (this.importRoot = null), (this.options = e || {})
  33735. }
  33736. }),
  33737. 'function' == typeof define && define.amd
  33738. ? define(['bytebuffer'], t)
  33739. : 'function' == typeof p && 'object' == typeof i && i && i.exports
  33740. ? (i.exports = t(p('bytebuffer')))
  33741. : ((e.dcodeIO = e.dcodeIO || {}).ProtoBuf = t(e.dcodeIO.ByteBuffer))
  33742. }).call(this, p('_process'))
  33743. },
  33744. {
  33745. _process: 203,
  33746. bytebuffer: 215,
  33747. fs: 197,
  33748. path: 197
  33749. }
  33750. ],
  33751. 215: [
  33752. function (t, e, i) {
  33753. var n, r
  33754. ;(n = this),
  33755. (r = function (l) {
  33756. 'use strict'
  33757. function s(e) {
  33758. var t = 0
  33759. return function () {
  33760. return t < e.length ? e.charCodeAt(t++) : null
  33761. }
  33762. }
  33763. function c() {
  33764. var e = [],
  33765. t = []
  33766. return function () {
  33767. return 0 === arguments.length
  33768. ? t.join('') + i.apply(String, e)
  33769. : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)), (e.length = 0)), void Array.prototype.push.apply(e, arguments))
  33770. }
  33771. }
  33772. function n(e, t, i, n, r) {
  33773. var o,
  33774. a,
  33775. s = 8 * r - n - 1,
  33776. l = (1 << s) - 1,
  33777. c = l >> 1,
  33778. h = -7,
  33779. u = i ? r - 1 : 0,
  33780. d = i ? -1 : 1,
  33781. p = e[t + u]
  33782. for (u += d, o = p & ((1 << -h) - 1), p >>= -h, h += s; 0 < h; o = 256 * o + e[t + u], u += d, h -= 8);
  33783. for (a = o & ((1 << -h) - 1), o >>= -h, h += n; 0 < h; a = 256 * a + e[t + u], u += d, h -= 8);
  33784. if (0 === o) o = 1 - c
  33785. else {
  33786. if (o === l) return a ? NaN : (1 / 0) * (p ? -1 : 1)
  33787. ;(a += Math.pow(2, n)), (o -= c)
  33788. }
  33789. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  33790. }
  33791. function r(e, t, i, n, r, o) {
  33792. var a,
  33793. s,
  33794. l,
  33795. c = 8 * o - r - 1,
  33796. h = (1 << c) - 1,
  33797. u = h >> 1,
  33798. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  33799. p = n ? 0 : o - 1,
  33800. f = n ? 1 : -1,
  33801. g = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0
  33802. for (
  33803. t = Math.abs(t),
  33804. isNaN(t) || t === 1 / 0
  33805. ? ((s = isNaN(t) ? 1 : 0), (a = h))
  33806. : ((a = Math.floor(Math.log(t) / Math.LN2)),
  33807. t * (l = Math.pow(2, -a)) < 1 && (a--, (l *= 2)),
  33808. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++, (l /= 2)),
  33809. h <= a + u ? ((s = 0), (a = h)) : 1 <= a + u ? ((s = (t * l - 1) * Math.pow(2, r)), (a += u)) : ((s = t * Math.pow(2, u - 1) * Math.pow(2, r)), (a = 0)));
  33810. 8 <= r;
  33811. e[i + p] = 255 & s, p += f, s /= 256, r -= 8
  33812. );
  33813. for (a = (a << r) | s, c += r; 0 < c; e[i + p] = 255 & a, p += f, a /= 256, c -= 8);
  33814. e[i + p - f] |= 128 * g
  33815. }
  33816. var f = function (e, t, i) {
  33817. if ((void 0 === e && (e = f.DEFAULT_CAPACITY), void 0 === t && (t = f.DEFAULT_ENDIAN), void 0 === i && (i = f.DEFAULT_NOASSERT), !i)) {
  33818. if ((e |= 0) < 0) throw RangeError('Illegal capacity')
  33819. ;(t = !!t), (i = !!i)
  33820. }
  33821. ;(this.buffer = 0 === e ? o : new ArrayBuffer(e)),
  33822. (this.view = 0 === e ? null : new Uint8Array(this.buffer)),
  33823. (this.offset = 0),
  33824. (this.markedOffset = -1),
  33825. (this.limit = e),
  33826. (this.littleEndian = t),
  33827. (this.noAssert = i)
  33828. }
  33829. ;(f.VERSION = '5.0.1'), (f.LITTLE_ENDIAN = !0), (f.BIG_ENDIAN = !1), (f.DEFAULT_CAPACITY = 16), (f.DEFAULT_ENDIAN = f.BIG_ENDIAN), (f.DEFAULT_NOASSERT = !1), (f.Long = l || null)
  33830. var a = f.prototype
  33831. a.__isByteBuffer__,
  33832. Object.defineProperty(a, '__isByteBuffer__', {
  33833. value: !0,
  33834. enumerable: !1,
  33835. configurable: !1
  33836. })
  33837. var o = new ArrayBuffer(0),
  33838. i = String.fromCharCode
  33839. ;(f.accessor = function () {
  33840. return Uint8Array
  33841. }),
  33842. (f.allocate = function (e, t, i) {
  33843. return new f(e, t, i)
  33844. }),
  33845. (f.concat = function (e, t, i, n) {
  33846. ;('boolean' != typeof t && 'string' == typeof t) || ((n = i), (i = t), (t = void 0))
  33847. for (var r, o = 0, a = 0, s = e.length; a < s; ++a) f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)), 0 < (r = e[a].limit - e[a].offset) && (o += r)
  33848. if (0 === o) return new f(0, i, n)
  33849. var l,
  33850. c = new f(o, i, n)
  33851. for (a = 0; a < s; ) (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset), (c.offset += r))
  33852. return (c.limit = c.offset), (c.offset = 0), c
  33853. }),
  33854. (f.isByteBuffer = function (e) {
  33855. return !0 === (e && e.__isByteBuffer__)
  33856. }),
  33857. (f.type = function () {
  33858. return ArrayBuffer
  33859. }),
  33860. (f.wrap = function (e, t, i, n) {
  33861. if (('string' != typeof t && ((n = i), (i = t), (t = void 0)), 'string' == typeof e))
  33862. switch ((void 0 === t && (t = 'utf8'), t)) {
  33863. case 'base64':
  33864. return f.fromBase64(e, i)
  33865. case 'hex':
  33866. return f.fromHex(e, i)
  33867. case 'binary':
  33868. return f.fromBinary(e, i)
  33869. case 'utf8':
  33870. return f.fromUTF8(e, i)
  33871. case 'debug':
  33872. return f.fromDebug(e, i)
  33873. default:
  33874. throw Error('Unsupported encoding: ' + t)
  33875. }
  33876. if (null === e || 'object' != typeof e) throw TypeError('Illegal buffer')
  33877. var r
  33878. if (f.isByteBuffer(e)) return ((r = a.clone.call(e)).markedOffset = -1), r
  33879. if (e instanceof Uint8Array)
  33880. (r = new f(0, i, n)), 0 < e.length && ((r.buffer = e.buffer), (r.offset = e.byteOffset), (r.limit = e.byteOffset + e.byteLength), (r.view = new Uint8Array(e.buffer)))
  33881. else if (e instanceof ArrayBuffer)
  33882. (r = new f(0, i, n)), 0 < e.byteLength && ((r.buffer = e), (r.offset = 0), (r.limit = e.byteLength), (r.view = 0 < e.byteLength ? new Uint8Array(e) : null))
  33883. else {
  33884. if ('[object Array]' !== Object.prototype.toString.call(e)) throw TypeError('Illegal buffer')
  33885. ;(r = new f(e.length, i, n)).limit = e.length
  33886. for (var o = 0; o < e.length; ++o) r.view[o] = e[o]
  33887. }
  33888. return r
  33889. }),
  33890. (a.writeBitSet = function (e, t) {
  33891. var i = void 0 === t
  33892. if ((i && (t = this.offset), !this.noAssert)) {
  33893. if (!(e instanceof Array)) throw TypeError('Illegal BitSet: Not an array')
  33894. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  33895. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  33896. }
  33897. var n,
  33898. r = t,
  33899. o = e.length,
  33900. a = o >> 3,
  33901. s = 0
  33902. for (t += this.writeVarint32(o, t); a--; )
  33903. (n =
  33904. (1 & !!e[s++]) |
  33905. ((1 & !!e[s++]) << 1) |
  33906. ((1 & !!e[s++]) << 2) |
  33907. ((1 & !!e[s++]) << 3) |
  33908. ((1 & !!e[s++]) << 4) |
  33909. ((1 & !!e[s++]) << 5) |
  33910. ((1 & !!e[s++]) << 6) |
  33911. ((1 & !!e[s++]) << 7)),
  33912. this.writeByte(n, t++)
  33913. if (s < o) {
  33914. var l = 0
  33915. for (n = 0; s < o; ) n |= (1 & !!e[s++]) << l++
  33916. this.writeByte(n, t++)
  33917. }
  33918. return i ? ((this.offset = t), this) : t - r
  33919. }),
  33920. (a.readBitSet = function (e) {
  33921. var t = void 0 === e
  33922. t && (e = this.offset)
  33923. var i,
  33924. n = this.readVarint32(e),
  33925. r = n.value,
  33926. o = r >> 3,
  33927. a = 0,
  33928. s = []
  33929. for (e += n.length; o--; )
  33930. (i = this.readByte(e++)),
  33931. (s[a++] = !!(1 & i)),
  33932. (s[a++] = !!(2 & i)),
  33933. (s[a++] = !!(4 & i)),
  33934. (s[a++] = !!(8 & i)),
  33935. (s[a++] = !!(16 & i)),
  33936. (s[a++] = !!(32 & i)),
  33937. (s[a++] = !!(64 & i)),
  33938. (s[a++] = !!(128 & i))
  33939. if (a < r) {
  33940. var l = 0
  33941. for (i = this.readByte(e++); a < r; ) s[a++] = !!((i >> l++) & 1)
  33942. }
  33943. return t && (this.offset = e), s
  33944. }),
  33945. (a.readBytes = function (e, t) {
  33946. var i = void 0 === t
  33947. if ((i && (t = this.offset), !this.noAssert)) {
  33948. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  33949. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+' + e + ') <= ' + this.buffer.byteLength)
  33950. }
  33951. var n = this.slice(t, t + e)
  33952. return i && (this.offset += e), n
  33953. }),
  33954. (a.writeBytes = a.append),
  33955. (a.writeInt8 = function (e, t) {
  33956. var i = void 0 === t
  33957. if ((i && (t = this.offset), !this.noAssert)) {
  33958. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  33959. if (((e |= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  33960. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  33961. }
  33962. t += 1
  33963. var n = this.buffer.byteLength
  33964. return n < t && this.resize((n *= 2) > t ? n : t), (t -= 1), (this.view[t] = e), i && (this.offset += 1), this
  33965. }),
  33966. (a.writeByte = a.writeInt8),
  33967. (a.readInt8 = function (e) {
  33968. var t = void 0 === e
  33969. if ((t && (e = this.offset), !this.noAssert)) {
  33970. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  33971. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength)
  33972. }
  33973. var i = this.view[e]
  33974. return 128 == (128 & i) && (i = -(255 - i + 1)), t && (this.offset += 1), i
  33975. }),
  33976. (a.readByte = a.readInt8),
  33977. (a.writeUint8 = function (e, t) {
  33978. var i = void 0 === t
  33979. if ((i && (t = this.offset), !this.noAssert)) {
  33980. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  33981. if (((e >>>= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  33982. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  33983. }
  33984. t += 1
  33985. var n = this.buffer.byteLength
  33986. return n < t && this.resize((n *= 2) > t ? n : t), (t -= 1), (this.view[t] = e), i && (this.offset += 1), this
  33987. }),
  33988. (a.writeUInt8 = a.writeUint8),
  33989. (a.readUint8 = function (e) {
  33990. var t = void 0 === e
  33991. if ((t && (e = this.offset), !this.noAssert)) {
  33992. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  33993. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength)
  33994. }
  33995. var i = this.view[e]
  33996. return t && (this.offset += 1), i
  33997. }),
  33998. (a.readUInt8 = a.readUint8),
  33999. (a.writeInt16 = function (e, t) {
  34000. var i = void 0 === t
  34001. if ((i && (t = this.offset), !this.noAssert)) {
  34002. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  34003. if (((e |= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34004. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34005. }
  34006. t += 2
  34007. var n = this.buffer.byteLength
  34008. return (
  34009. n < t && this.resize((n *= 2) > t ? n : t),
  34010. (t -= 2),
  34011. this.littleEndian ? ((this.view[t + 1] = (65280 & e) >>> 8), (this.view[t] = 255 & e)) : ((this.view[t] = (65280 & e) >>> 8), (this.view[t + 1] = 255 & e)),
  34012. i && (this.offset += 2),
  34013. this
  34014. )
  34015. }),
  34016. (a.writeShort = a.writeInt16),
  34017. (a.readInt16 = function (e) {
  34018. var t = void 0 === e
  34019. if ((t && (e = this.offset), !this.noAssert)) {
  34020. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34021. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+2) <= ' + this.buffer.byteLength)
  34022. }
  34023. var i = 0
  34024. return (
  34025. this.littleEndian ? ((i = this.view[e]), (i |= this.view[e + 1] << 8)) : ((i = this.view[e] << 8), (i |= this.view[e + 1])),
  34026. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  34027. t && (this.offset += 2),
  34028. i
  34029. )
  34030. }),
  34031. (a.readShort = a.readInt16),
  34032. (a.writeUint16 = function (e, t) {
  34033. var i = void 0 === t
  34034. if ((i && (t = this.offset), !this.noAssert)) {
  34035. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  34036. if (((e >>>= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34037. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34038. }
  34039. t += 2
  34040. var n = this.buffer.byteLength
  34041. return (
  34042. n < t && this.resize((n *= 2) > t ? n : t),
  34043. (t -= 2),
  34044. this.littleEndian ? ((this.view[t + 1] = (65280 & e) >>> 8), (this.view[t] = 255 & e)) : ((this.view[t] = (65280 & e) >>> 8), (this.view[t + 1] = 255 & e)),
  34045. i && (this.offset += 2),
  34046. this
  34047. )
  34048. }),
  34049. (a.writeUInt16 = a.writeUint16),
  34050. (a.readUint16 = function (e) {
  34051. var t = void 0 === e
  34052. if ((t && (e = this.offset), !this.noAssert)) {
  34053. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34054. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+2) <= ' + this.buffer.byteLength)
  34055. }
  34056. var i = 0
  34057. return this.littleEndian ? ((i = this.view[e]), (i |= this.view[e + 1] << 8)) : ((i = this.view[e] << 8), (i |= this.view[e + 1])), t && (this.offset += 2), i
  34058. }),
  34059. (a.readUInt16 = a.readUint16),
  34060. (a.writeInt32 = function (e, t) {
  34061. var i = void 0 === t
  34062. if ((i && (t = this.offset), !this.noAssert)) {
  34063. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  34064. if (((e |= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34065. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34066. }
  34067. t += 4
  34068. var n = this.buffer.byteLength
  34069. return (
  34070. n < t && this.resize((n *= 2) > t ? n : t),
  34071. (t -= 4),
  34072. this.littleEndian
  34073. ? ((this.view[t + 3] = (e >>> 24) & 255), (this.view[t + 2] = (e >>> 16) & 255), (this.view[t + 1] = (e >>> 8) & 255), (this.view[t] = 255 & e))
  34074. : ((this.view[t] = (e >>> 24) & 255), (this.view[t + 1] = (e >>> 16) & 255), (this.view[t + 2] = (e >>> 8) & 255), (this.view[t + 3] = 255 & e)),
  34075. i && (this.offset += 4),
  34076. this
  34077. )
  34078. }),
  34079. (a.writeInt = a.writeInt32),
  34080. (a.readInt32 = function (e) {
  34081. var t = void 0 === e
  34082. if ((t && (e = this.offset), !this.noAssert)) {
  34083. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34084. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength)
  34085. }
  34086. var i = 0
  34087. return (
  34088. this.littleEndian
  34089. ? ((i = this.view[e + 2] << 16), (i |= this.view[e + 1] << 8), (i |= this.view[e]), (i += (this.view[e + 3] << 24) >>> 0))
  34090. : ((i = this.view[e + 1] << 16), (i |= this.view[e + 2] << 8), (i |= this.view[e + 3]), (i += (this.view[e] << 24) >>> 0)),
  34091. (i |= 0),
  34092. t && (this.offset += 4),
  34093. i
  34094. )
  34095. }),
  34096. (a.readInt = a.readInt32),
  34097. (a.writeUint32 = function (e, t) {
  34098. var i = void 0 === t
  34099. if ((i && (t = this.offset), !this.noAssert)) {
  34100. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  34101. if (((e >>>= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34102. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34103. }
  34104. t += 4
  34105. var n = this.buffer.byteLength
  34106. return (
  34107. n < t && this.resize((n *= 2) > t ? n : t),
  34108. (t -= 4),
  34109. this.littleEndian
  34110. ? ((this.view[t + 3] = (e >>> 24) & 255), (this.view[t + 2] = (e >>> 16) & 255), (this.view[t + 1] = (e >>> 8) & 255), (this.view[t] = 255 & e))
  34111. : ((this.view[t] = (e >>> 24) & 255), (this.view[t + 1] = (e >>> 16) & 255), (this.view[t + 2] = (e >>> 8) & 255), (this.view[t + 3] = 255 & e)),
  34112. i && (this.offset += 4),
  34113. this
  34114. )
  34115. }),
  34116. (a.writeUInt32 = a.writeUint32),
  34117. (a.readUint32 = function (e) {
  34118. var t = void 0 === e
  34119. if ((t && (e = this.offset), !this.noAssert)) {
  34120. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34121. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength)
  34122. }
  34123. var i = 0
  34124. return (
  34125. this.littleEndian
  34126. ? ((i = this.view[e + 2] << 16), (i |= this.view[e + 1] << 8), (i |= this.view[e]), (i += (this.view[e + 3] << 24) >>> 0))
  34127. : ((i = this.view[e + 1] << 16), (i |= this.view[e + 2] << 8), (i |= this.view[e + 3]), (i += (this.view[e] << 24) >>> 0)),
  34128. t && (this.offset += 4),
  34129. i
  34130. )
  34131. }),
  34132. (a.readUInt32 = a.readUint32),
  34133. l &&
  34134. ((a.writeInt64 = function (e, t) {
  34135. var i = void 0 === t
  34136. if ((i && (t = this.offset), !this.noAssert)) {
  34137. if ('number' == typeof e) e = l.fromNumber(e)
  34138. else if ('string' == typeof e) e = l.fromString(e)
  34139. else if (!(e && e instanceof l)) throw TypeError('Illegal value: ' + e + ' (not an integer or Long)')
  34140. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34141. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34142. }
  34143. 'number' == typeof e ? (e = l.fromNumber(e)) : 'string' == typeof e && (e = l.fromString(e)), (t += 8)
  34144. var n = this.buffer.byteLength
  34145. n < t && this.resize((n *= 2) > t ? n : t), (t -= 8)
  34146. var r = e.low,
  34147. o = e.high
  34148. return (
  34149. this.littleEndian
  34150. ? ((this.view[t + 3] = (r >>> 24) & 255),
  34151. (this.view[t + 2] = (r >>> 16) & 255),
  34152. (this.view[t + 1] = (r >>> 8) & 255),
  34153. (this.view[t] = 255 & r),
  34154. (t += 4),
  34155. (this.view[t + 3] = (o >>> 24) & 255),
  34156. (this.view[t + 2] = (o >>> 16) & 255),
  34157. (this.view[t + 1] = (o >>> 8) & 255),
  34158. (this.view[t] = 255 & o))
  34159. : ((this.view[t] = (o >>> 24) & 255),
  34160. (this.view[t + 1] = (o >>> 16) & 255),
  34161. (this.view[t + 2] = (o >>> 8) & 255),
  34162. (this.view[t + 3] = 255 & o),
  34163. (t += 4),
  34164. (this.view[t] = (r >>> 24) & 255),
  34165. (this.view[t + 1] = (r >>> 16) & 255),
  34166. (this.view[t + 2] = (r >>> 8) & 255),
  34167. (this.view[t + 3] = 255 & r)),
  34168. i && (this.offset += 8),
  34169. this
  34170. )
  34171. }),
  34172. (a.writeLong = a.writeInt64),
  34173. (a.readInt64 = function (e) {
  34174. var t = void 0 === e
  34175. if ((t && (e = this.offset), !this.noAssert)) {
  34176. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34177. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+8) <= ' + this.buffer.byteLength)
  34178. }
  34179. var i = 0,
  34180. n = 0
  34181. this.littleEndian
  34182. ? ((i = this.view[e + 2] << 16),
  34183. (i |= this.view[e + 1] << 8),
  34184. (i |= this.view[e]),
  34185. (i += (this.view[e + 3] << 24) >>> 0),
  34186. (e += 4),
  34187. (n = this.view[e + 2] << 16),
  34188. (n |= this.view[e + 1] << 8),
  34189. (n |= this.view[e]),
  34190. (n += (this.view[e + 3] << 24) >>> 0))
  34191. : ((n = this.view[e + 1] << 16),
  34192. (n |= this.view[e + 2] << 8),
  34193. (n |= this.view[e + 3]),
  34194. (n += (this.view[e] << 24) >>> 0),
  34195. (e += 4),
  34196. (i = this.view[e + 1] << 16),
  34197. (i |= this.view[e + 2] << 8),
  34198. (i |= this.view[e + 3]),
  34199. (i += (this.view[e] << 24) >>> 0))
  34200. var r = new l(i, n, !1)
  34201. return t && (this.offset += 8), r
  34202. }),
  34203. (a.readLong = a.readInt64),
  34204. (a.writeUint64 = function (e, t) {
  34205. var i = void 0 === t
  34206. if ((i && (t = this.offset), !this.noAssert)) {
  34207. if ('number' == typeof e) e = l.fromNumber(e)
  34208. else if ('string' == typeof e) e = l.fromString(e)
  34209. else if (!(e && e instanceof l)) throw TypeError('Illegal value: ' + e + ' (not an integer or Long)')
  34210. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34211. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34212. }
  34213. 'number' == typeof e ? (e = l.fromNumber(e)) : 'string' == typeof e && (e = l.fromString(e)), (t += 8)
  34214. var n = this.buffer.byteLength
  34215. n < t && this.resize((n *= 2) > t ? n : t), (t -= 8)
  34216. var r = e.low,
  34217. o = e.high
  34218. return (
  34219. this.littleEndian
  34220. ? ((this.view[t + 3] = (r >>> 24) & 255),
  34221. (this.view[t + 2] = (r >>> 16) & 255),
  34222. (this.view[t + 1] = (r >>> 8) & 255),
  34223. (this.view[t] = 255 & r),
  34224. (t += 4),
  34225. (this.view[t + 3] = (o >>> 24) & 255),
  34226. (this.view[t + 2] = (o >>> 16) & 255),
  34227. (this.view[t + 1] = (o >>> 8) & 255),
  34228. (this.view[t] = 255 & o))
  34229. : ((this.view[t] = (o >>> 24) & 255),
  34230. (this.view[t + 1] = (o >>> 16) & 255),
  34231. (this.view[t + 2] = (o >>> 8) & 255),
  34232. (this.view[t + 3] = 255 & o),
  34233. (t += 4),
  34234. (this.view[t] = (r >>> 24) & 255),
  34235. (this.view[t + 1] = (r >>> 16) & 255),
  34236. (this.view[t + 2] = (r >>> 8) & 255),
  34237. (this.view[t + 3] = 255 & r)),
  34238. i && (this.offset += 8),
  34239. this
  34240. )
  34241. }),
  34242. (a.writeUInt64 = a.writeUint64),
  34243. (a.readUint64 = function (e) {
  34244. var t = void 0 === e
  34245. if ((t && (e = this.offset), !this.noAssert)) {
  34246. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34247. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+8) <= ' + this.buffer.byteLength)
  34248. }
  34249. var i = 0,
  34250. n = 0
  34251. this.littleEndian
  34252. ? ((i = this.view[e + 2] << 16),
  34253. (i |= this.view[e + 1] << 8),
  34254. (i |= this.view[e]),
  34255. (i += (this.view[e + 3] << 24) >>> 0),
  34256. (e += 4),
  34257. (n = this.view[e + 2] << 16),
  34258. (n |= this.view[e + 1] << 8),
  34259. (n |= this.view[e]),
  34260. (n += (this.view[e + 3] << 24) >>> 0))
  34261. : ((n = this.view[e + 1] << 16),
  34262. (n |= this.view[e + 2] << 8),
  34263. (n |= this.view[e + 3]),
  34264. (n += (this.view[e] << 24) >>> 0),
  34265. (e += 4),
  34266. (i = this.view[e + 1] << 16),
  34267. (i |= this.view[e + 2] << 8),
  34268. (i |= this.view[e + 3]),
  34269. (i += (this.view[e] << 24) >>> 0))
  34270. var r = new l(i, n, !0)
  34271. return t && (this.offset += 8), r
  34272. }),
  34273. (a.readUInt64 = a.readUint64)),
  34274. (a.writeFloat32 = function (e, t) {
  34275. var i = void 0 === t
  34276. if ((i && (t = this.offset), !this.noAssert)) {
  34277. if ('number' != typeof e) throw TypeError('Illegal value: ' + e + ' (not a number)')
  34278. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34279. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34280. }
  34281. t += 4
  34282. var n = this.buffer.byteLength
  34283. return n < t && this.resize((n *= 2) > t ? n : t), (t -= 4), r(this.view, e, t, this.littleEndian, 23, 4), i && (this.offset += 4), this
  34284. }),
  34285. (a.writeFloat = a.writeFloat32),
  34286. (a.readFloat32 = function (e) {
  34287. var t = void 0 === e
  34288. if ((t && (e = this.offset), !this.noAssert)) {
  34289. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34290. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength)
  34291. }
  34292. var i = n(this.view, e, this.littleEndian, 23, 4)
  34293. return t && (this.offset += 4), i
  34294. }),
  34295. (a.readFloat = a.readFloat32),
  34296. (a.writeFloat64 = function (e, t) {
  34297. var i = void 0 === t
  34298. if ((i && (t = this.offset), !this.noAssert)) {
  34299. if ('number' != typeof e) throw TypeError('Illegal value: ' + e + ' (not a number)')
  34300. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34301. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34302. }
  34303. t += 8
  34304. var n = this.buffer.byteLength
  34305. return n < t && this.resize((n *= 2) > t ? n : t), (t -= 8), r(this.view, e, t, this.littleEndian, 52, 8), i && (this.offset += 8), this
  34306. }),
  34307. (a.writeDouble = a.writeFloat64),
  34308. (a.readFloat64 = function (e) {
  34309. var t = void 0 === e
  34310. if ((t && (e = this.offset), !this.noAssert)) {
  34311. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34312. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+8) <= ' + this.buffer.byteLength)
  34313. }
  34314. var i = n(this.view, e, this.littleEndian, 52, 8)
  34315. return t && (this.offset += 8), i
  34316. }),
  34317. (a.readDouble = a.readFloat64),
  34318. (f.MAX_VARINT32_BYTES = 5),
  34319. (f.calculateVarint32 = function (e) {
  34320. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  34321. }),
  34322. (f.zigZagEncode32 = function (e) {
  34323. return (((e |= 0) << 1) ^ (e >> 31)) >>> 0
  34324. }),
  34325. (f.zigZagDecode32 = function (e) {
  34326. return ((e >>> 1) ^ -(1 & e)) | 0
  34327. }),
  34328. (a.writeVarint32 = function (e, t) {
  34329. var i = void 0 === t
  34330. if ((i && (t = this.offset), !this.noAssert)) {
  34331. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  34332. if (((e |= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34333. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34334. }
  34335. var n,
  34336. r = f.calculateVarint32(e)
  34337. t += r
  34338. var o = this.buffer.byteLength
  34339. for (o < t && this.resize((o *= 2) > t ? o : t), t -= r, e >>>= 0; 128 <= e; ) (n = (127 & e) | 128), (this.view[t++] = n), (e >>>= 7)
  34340. return (this.view[t++] = e), i ? ((this.offset = t), this) : r
  34341. }),
  34342. (a.writeVarint32ZigZag = function (e, t) {
  34343. return this.writeVarint32(f.zigZagEncode32(e), t)
  34344. }),
  34345. (a.readVarint32 = function (e) {
  34346. var t = void 0 === e
  34347. if ((t && (e = this.offset), !this.noAssert)) {
  34348. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34349. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength)
  34350. }
  34351. var i,
  34352. n = 0,
  34353. r = 0
  34354. do {
  34355. if (!this.noAssert && e > this.limit) {
  34356. var o = Error('Truncated')
  34357. throw ((o.truncated = !0), o)
  34358. }
  34359. ;(i = this.view[e++]), n < 5 && (r |= (127 & i) << (7 * n)), ++n
  34360. } while (0 != (128 & i))
  34361. return (
  34362. (r |= 0),
  34363. t
  34364. ? ((this.offset = e), r)
  34365. : {
  34366. value: r,
  34367. length: n
  34368. }
  34369. )
  34370. }),
  34371. (a.readVarint32ZigZag = function (e) {
  34372. var t = this.readVarint32(e)
  34373. return 'object' == typeof t ? (t.value = f.zigZagDecode32(t.value)) : (t = f.zigZagDecode32(t)), t
  34374. }),
  34375. l &&
  34376. ((f.MAX_VARINT64_BYTES = 10),
  34377. (f.calculateVarint64 = function (e) {
  34378. 'number' == typeof e ? (e = l.fromNumber(e)) : 'string' == typeof e && (e = l.fromString(e))
  34379. var t = e.toInt() >>> 0,
  34380. i = e.shiftRightUnsigned(28).toInt() >>> 0,
  34381. n = e.shiftRightUnsigned(56).toInt() >>> 0
  34382. return 0 == n ? (0 == i ? (t < 16384 ? (t < 128 ? 1 : 2) : t < 1 << 21 ? 3 : 4) : i < 16384 ? (i < 128 ? 5 : 6) : i < 1 << 21 ? 7 : 8) : n < 128 ? 9 : 10
  34383. }),
  34384. (f.zigZagEncode64 = function (e) {
  34385. return (
  34386. 'number' == typeof e ? (e = l.fromNumber(e, !1)) : 'string' == typeof e ? (e = l.fromString(e, !1)) : !1 !== e.unsigned && (e = e.toSigned()),
  34387. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  34388. )
  34389. }),
  34390. (f.zigZagDecode64 = function (e) {
  34391. return (
  34392. 'number' == typeof e ? (e = l.fromNumber(e, !1)) : 'string' == typeof e ? (e = l.fromString(e, !1)) : !1 !== e.unsigned && (e = e.toSigned()),
  34393. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  34394. )
  34395. }),
  34396. (a.writeVarint64 = function (e, t) {
  34397. var i = void 0 === t
  34398. if ((i && (t = this.offset), !this.noAssert)) {
  34399. if ('number' == typeof e) e = l.fromNumber(e)
  34400. else if ('string' == typeof e) e = l.fromString(e)
  34401. else if (!(e && e instanceof l)) throw TypeError('Illegal value: ' + e + ' (not an integer or Long)')
  34402. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34403. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34404. }
  34405. 'number' == typeof e ? (e = l.fromNumber(e, !1)) : 'string' == typeof e ? (e = l.fromString(e, !1)) : !1 !== e.unsigned && (e = e.toSigned())
  34406. var n = f.calculateVarint64(e),
  34407. r = e.toInt() >>> 0,
  34408. o = e.shiftRightUnsigned(28).toInt() >>> 0,
  34409. a = e.shiftRightUnsigned(56).toInt() >>> 0
  34410. t += n
  34411. var s = this.buffer.byteLength
  34412. switch ((s < t && this.resize((s *= 2) > t ? s : t), (t -= n), n)) {
  34413. case 10:
  34414. this.view[t + 9] = (a >>> 7) & 1
  34415. case 9:
  34416. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a
  34417. case 8:
  34418. this.view[t + 7] = 8 !== n ? (o >>> 21) | 128 : (o >>> 21) & 127
  34419. case 7:
  34420. this.view[t + 6] = 7 !== n ? (o >>> 14) | 128 : (o >>> 14) & 127
  34421. case 6:
  34422. this.view[t + 5] = 6 !== n ? (o >>> 7) | 128 : (o >>> 7) & 127
  34423. case 5:
  34424. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o
  34425. case 4:
  34426. this.view[t + 3] = 4 !== n ? (r >>> 21) | 128 : (r >>> 21) & 127
  34427. case 3:
  34428. this.view[t + 2] = 3 !== n ? (r >>> 14) | 128 : (r >>> 14) & 127
  34429. case 2:
  34430. this.view[t + 1] = 2 !== n ? (r >>> 7) | 128 : (r >>> 7) & 127
  34431. case 1:
  34432. this.view[t] = 1 !== n ? 128 | r : 127 & r
  34433. }
  34434. return i ? ((this.offset += n), this) : n
  34435. }),
  34436. (a.writeVarint64ZigZag = function (e, t) {
  34437. return this.writeVarint64(f.zigZagEncode64(e), t)
  34438. }),
  34439. (a.readVarint64 = function (e) {
  34440. var t = void 0 === e
  34441. if ((t && (e = this.offset), !this.noAssert)) {
  34442. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34443. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength)
  34444. }
  34445. var i = e,
  34446. n = 0,
  34447. r = 0,
  34448. o = 0,
  34449. a = 0
  34450. if (
  34451. ((n = 127 & (a = this.view[e++])),
  34452. 128 & a &&
  34453. ((n |= (127 & (a = this.view[e++])) << 7),
  34454. (128 & a || (this.noAssert && void 0 === a)) &&
  34455. ((n |= (127 & (a = this.view[e++])) << 14),
  34456. (128 & a || (this.noAssert && void 0 === a)) &&
  34457. ((n |= (127 & (a = this.view[e++])) << 21),
  34458. (128 & a || (this.noAssert && void 0 === a)) &&
  34459. ((r = 127 & (a = this.view[e++])),
  34460. (128 & a || (this.noAssert && void 0 === a)) &&
  34461. ((r |= (127 & (a = this.view[e++])) << 7),
  34462. (128 & a || (this.noAssert && void 0 === a)) &&
  34463. ((r |= (127 & (a = this.view[e++])) << 14),
  34464. (128 & a || (this.noAssert && void 0 === a)) &&
  34465. ((r |= (127 & (a = this.view[e++])) << 21),
  34466. (128 & a || (this.noAssert && void 0 === a)) &&
  34467. ((o = 127 & (a = this.view[e++])),
  34468. (128 & a || (this.noAssert && void 0 === a)) && ((o |= (127 & (a = this.view[e++])) << 7), 128 & a || (this.noAssert && void 0 === a)))))))))))
  34469. )
  34470. throw Error('Buffer overrun')
  34471. var s = l.fromBits(n | (r << 28), (r >>> 4) | (o << 24), !1)
  34472. return t
  34473. ? ((this.offset = e), s)
  34474. : {
  34475. value: s,
  34476. length: e - i
  34477. }
  34478. }),
  34479. (a.readVarint64ZigZag = function (e) {
  34480. var t = this.readVarint64(e)
  34481. return t && t.value instanceof l ? (t.value = f.zigZagDecode64(t.value)) : (t = f.zigZagDecode64(t)), t
  34482. })),
  34483. (a.writeCString = function (e, t) {
  34484. var i = void 0 === t
  34485. i && (t = this.offset)
  34486. var n,
  34487. r = e.length
  34488. if (!this.noAssert) {
  34489. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  34490. for (n = 0; n < r; ++n) if (0 === e.charCodeAt(n)) throw RangeError('Illegal str: Contains NULL-characters')
  34491. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34492. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34493. }
  34494. ;(r = d.calculateUTF16asUTF8(s(e))[1]), (t += r + 1)
  34495. var o = this.buffer.byteLength
  34496. return (
  34497. o < t && this.resize((o *= 2) > t ? o : t),
  34498. (t -= r + 1),
  34499. d.encodeUTF16toUTF8(
  34500. s(e),
  34501. function (e) {
  34502. this.view[t++] = e
  34503. }.bind(this)
  34504. ),
  34505. (this.view[t++] = 0),
  34506. i ? ((this.offset = t), this) : r
  34507. )
  34508. }),
  34509. (a.readCString = function (e) {
  34510. var t = void 0 === e
  34511. if ((t && (e = this.offset), !this.noAssert)) {
  34512. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34513. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength)
  34514. }
  34515. var i,
  34516. n = e,
  34517. r = -1
  34518. return (
  34519. d.decodeUTF8toUTF16(
  34520. function () {
  34521. if (0 === r) return null
  34522. if (e >= this.limit) throw RangeError('Illegal range: Truncated data, ' + e + ' < ' + this.limit)
  34523. return 0 === (r = this.view[e++]) ? null : r
  34524. }.bind(this),
  34525. (i = c()),
  34526. !0
  34527. ),
  34528. t
  34529. ? ((this.offset = e), i())
  34530. : {
  34531. string: i(),
  34532. length: e - n
  34533. }
  34534. )
  34535. }),
  34536. (a.writeIString = function (e, t) {
  34537. var i = void 0 === t
  34538. if ((i && (t = this.offset), !this.noAssert)) {
  34539. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  34540. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34541. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34542. }
  34543. var n,
  34544. r = t
  34545. ;(n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1]), (t += 4 + n)
  34546. var o = this.buffer.byteLength
  34547. if (
  34548. (o < t && this.resize((o *= 2) > t ? o : t),
  34549. (t -= 4 + n),
  34550. this.littleEndian
  34551. ? ((this.view[t + 3] = (n >>> 24) & 255), (this.view[t + 2] = (n >>> 16) & 255), (this.view[t + 1] = (n >>> 8) & 255), (this.view[t] = 255 & n))
  34552. : ((this.view[t] = (n >>> 24) & 255), (this.view[t + 1] = (n >>> 16) & 255), (this.view[t + 2] = (n >>> 8) & 255), (this.view[t + 3] = 255 & n)),
  34553. (t += 4),
  34554. d.encodeUTF16toUTF8(
  34555. s(e),
  34556. function (e) {
  34557. this.view[t++] = e
  34558. }.bind(this)
  34559. ),
  34560. t !== r + 4 + n)
  34561. )
  34562. throw RangeError('Illegal range: Truncated data, ' + t + ' == ' + (t + 4 + n))
  34563. return i ? ((this.offset = t), this) : t - r
  34564. }),
  34565. (a.readIString = function (e) {
  34566. var t = void 0 === e
  34567. if ((t && (e = this.offset), !this.noAssert)) {
  34568. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34569. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength)
  34570. }
  34571. var i = e,
  34572. n = this.readUint32(e),
  34573. r = this.readUTF8String(n, f.METRICS_BYTES, (e += 4))
  34574. return (
  34575. (e += r.length),
  34576. t
  34577. ? ((this.offset = e), r.string)
  34578. : {
  34579. string: r.string,
  34580. length: e - i
  34581. }
  34582. )
  34583. }),
  34584. (f.METRICS_CHARS = 'c'),
  34585. (f.METRICS_BYTES = 'b'),
  34586. (a.writeUTF8String = function (e, t) {
  34587. var i = void 0 === t
  34588. if ((i && (t = this.offset), !this.noAssert)) {
  34589. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34590. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34591. }
  34592. var n,
  34593. r = t
  34594. ;(n = d.calculateUTF16asUTF8(s(e))[1]), (t += n)
  34595. var o = this.buffer.byteLength
  34596. return (
  34597. o < t && this.resize((o *= 2) > t ? o : t),
  34598. (t -= n),
  34599. d.encodeUTF16toUTF8(
  34600. s(e),
  34601. function (e) {
  34602. this.view[t++] = e
  34603. }.bind(this)
  34604. ),
  34605. i ? ((this.offset = t), this) : t - r
  34606. )
  34607. }),
  34608. (a.writeString = a.writeUTF8String),
  34609. (f.calculateUTF8Chars = function (e) {
  34610. return d.calculateUTF16asUTF8(s(e))[0]
  34611. }),
  34612. (f.calculateUTF8Bytes = function (e) {
  34613. return d.calculateUTF16asUTF8(s(e))[1]
  34614. }),
  34615. (f.calculateString = f.calculateUTF8Bytes),
  34616. (a.readUTF8String = function (e, t, i) {
  34617. 'number' == typeof t && ((i = t), (t = void 0))
  34618. var n = void 0 === i
  34619. if ((n && (i = this.offset), void 0 === t && (t = f.METRICS_CHARS), !this.noAssert)) {
  34620. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal length: ' + e + ' (not an integer)')
  34621. if (((e |= 0), 'number' != typeof i || i % 1 != 0)) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  34622. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  34623. }
  34624. var r,
  34625. o = 0,
  34626. a = i
  34627. if (t === f.METRICS_CHARS) {
  34628. if (
  34629. ((r = c()),
  34630. d.decodeUTF8(
  34631. function () {
  34632. return o < e && i < this.limit ? this.view[i++] : null
  34633. }.bind(this),
  34634. function (e) {
  34635. ++o, d.UTF8toUTF16(e, r)
  34636. }
  34637. ),
  34638. o !== e)
  34639. )
  34640. throw RangeError('Illegal range: Truncated data, ' + o + ' == ' + e)
  34641. return n
  34642. ? ((this.offset = i), r())
  34643. : {
  34644. string: r(),
  34645. length: i - a
  34646. }
  34647. }
  34648. if (t !== f.METRICS_BYTES) throw TypeError('Unsupported metrics: ' + t)
  34649. if (!this.noAssert) {
  34650. if ('number' != typeof i || i % 1 != 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  34651. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + i + ' (+' + e + ') <= ' + this.buffer.byteLength)
  34652. }
  34653. var s = i + e
  34654. if (
  34655. (d.decodeUTF8toUTF16(
  34656. function () {
  34657. return i < s ? this.view[i++] : null
  34658. }.bind(this),
  34659. (r = c()),
  34660. this.noAssert
  34661. ),
  34662. i !== s)
  34663. )
  34664. throw RangeError('Illegal range: Truncated data, ' + i + ' == ' + s)
  34665. return n
  34666. ? ((this.offset = i), r())
  34667. : {
  34668. string: r(),
  34669. length: i - a
  34670. }
  34671. }),
  34672. (a.readString = a.readUTF8String),
  34673. (a.writeVString = function (e, t) {
  34674. var i = void 0 === t
  34675. if ((i && (t = this.offset), !this.noAssert)) {
  34676. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  34677. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34678. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34679. }
  34680. var n,
  34681. r,
  34682. o = t
  34683. ;(n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1]), (r = f.calculateVarint32(n)), (t += r + n)
  34684. var a = this.buffer.byteLength
  34685. if (
  34686. (a < t && this.resize((a *= 2) > t ? a : t),
  34687. (t -= r + n),
  34688. (t += this.writeVarint32(n, t)),
  34689. d.encodeUTF16toUTF8(
  34690. s(e),
  34691. function (e) {
  34692. this.view[t++] = e
  34693. }.bind(this)
  34694. ),
  34695. t !== o + n + r)
  34696. )
  34697. throw RangeError('Illegal range: Truncated data, ' + t + ' == ' + (t + n + r))
  34698. return i ? ((this.offset = t), this) : t - o
  34699. }),
  34700. (a.readVString = function (e) {
  34701. var t = void 0 === e
  34702. if ((t && (e = this.offset), !this.noAssert)) {
  34703. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34704. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength)
  34705. }
  34706. var i = e,
  34707. n = this.readVarint32(e),
  34708. r = this.readUTF8String(n.value, f.METRICS_BYTES, (e += n.length))
  34709. return (
  34710. (e += r.length),
  34711. t
  34712. ? ((this.offset = e), r.string)
  34713. : {
  34714. string: r.string,
  34715. length: e - i
  34716. }
  34717. )
  34718. }),
  34719. (a.append = function (e, t, i) {
  34720. ;('number' != typeof t && 'string' == typeof t) || ((i = t), (t = void 0))
  34721. var n = void 0 === i
  34722. if ((n && (i = this.offset), !this.noAssert)) {
  34723. if ('number' != typeof i || i % 1 != 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  34724. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  34725. }
  34726. e instanceof f || (e = f.wrap(e, t))
  34727. var r = e.limit - e.offset
  34728. if (r <= 0) return this
  34729. i += r
  34730. var o = this.buffer.byteLength
  34731. return o < i && this.resize((o *= 2) > i ? o : i), (i -= r), this.view.set(e.view.subarray(e.offset, e.limit), i), (e.offset += r), n && (this.offset += r), this
  34732. }),
  34733. (a.appendTo = function (e, t) {
  34734. return e.append(this, t), this
  34735. }),
  34736. (a.assert = function (e) {
  34737. return (this.noAssert = !e), this
  34738. }),
  34739. (a.capacity = function () {
  34740. return this.buffer.byteLength
  34741. }),
  34742. (a.clear = function () {
  34743. return (this.offset = 0), (this.limit = this.buffer.byteLength), (this.markedOffset = -1), this
  34744. }),
  34745. (a.clone = function (e) {
  34746. var t = new f(0, this.littleEndian, this.noAssert)
  34747. return (
  34748. e ? ((t.buffer = new ArrayBuffer(this.buffer.byteLength)), (t.view = new Uint8Array(t.buffer))) : ((t.buffer = this.buffer), (t.view = this.view)),
  34749. (t.offset = this.offset),
  34750. (t.markedOffset = this.markedOffset),
  34751. (t.limit = this.limit),
  34752. t
  34753. )
  34754. }),
  34755. (a.compact = function (e, t) {
  34756. if ((void 0 === e && (e = this.offset), void 0 === t && (t = this.limit), !this.noAssert)) {
  34757. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal begin: Not an integer')
  34758. if (((e >>>= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal end: Not an integer')
  34759. if (((t >>>= 0), e < 0 || t < e || t > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength)
  34760. }
  34761. if (0 === e && t === this.buffer.byteLength) return this
  34762. var i = t - e
  34763. if (0 == i) return (this.buffer = o), (this.view = null), 0 <= this.markedOffset && (this.markedOffset -= e), (this.offset = 0), (this.limit = 0), this
  34764. var n = new ArrayBuffer(i),
  34765. r = new Uint8Array(n)
  34766. return r.set(this.view.subarray(e, t)), (this.buffer = n), (this.view = r), 0 <= this.markedOffset && (this.markedOffset -= e), (this.offset = 0), (this.limit = i), this
  34767. }),
  34768. (a.copy = function (e, t) {
  34769. if ((void 0 === e && (e = this.offset), void 0 === t && (t = this.limit), !this.noAssert)) {
  34770. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal begin: Not an integer')
  34771. if (((e >>>= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal end: Not an integer')
  34772. if (((t >>>= 0), e < 0 || t < e || t > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength)
  34773. }
  34774. if (e === t) return new f(0, this.littleEndian, this.noAssert)
  34775. var i = t - e,
  34776. n = new f(i, this.littleEndian, this.noAssert)
  34777. return (n.offset = 0), (n.limit = i), 0 <= n.markedOffset && (n.markedOffset -= e), this.copyTo(n, 0, e, t), n
  34778. }),
  34779. (a.copyTo = function (e, t, i, n) {
  34780. var r, o
  34781. if (!this.noAssert && !f.isByteBuffer(e)) throw TypeError('Illegal target: Not a ByteBuffer')
  34782. if (((t = (o = void 0 === t) ? e.offset : 0 | t), (i = (r = void 0 === i) ? this.offset : 0 | i), (n = void 0 === n ? this.limit : 0 | n), t < 0 || t > e.buffer.byteLength))
  34783. throw RangeError('Illegal target range: 0 <= ' + t + ' <= ' + e.buffer.byteLength)
  34784. if (i < 0 || n > this.buffer.byteLength) throw RangeError('Illegal source range: 0 <= ' + i + ' <= ' + this.buffer.byteLength)
  34785. var a = n - i
  34786. return 0 == a ? e : (e.ensureCapacity(t + a), e.view.set(this.view.subarray(i, n), t), r && (this.offset += a), o && (e.offset += a), this)
  34787. }),
  34788. (a.ensureCapacity = function (e) {
  34789. var t = this.buffer.byteLength
  34790. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  34791. }),
  34792. (a.fill = function (e, t, i) {
  34793. var n = void 0 === t
  34794. if ((n && (t = this.offset), 'string' == typeof e && 0 < e.length && (e = e.charCodeAt(0)), void 0 === t && (t = this.offset), void 0 === i && (i = this.limit), !this.noAssert)) {
  34795. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  34796. if (((e |= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal begin: Not an integer')
  34797. if (((t >>>= 0), 'number' != typeof i || i % 1 != 0)) throw TypeError('Illegal end: Not an integer')
  34798. if (((i >>>= 0), t < 0 || i < t || i > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + t + ' <= ' + i + ' <= ' + this.buffer.byteLength)
  34799. }
  34800. if (i <= t) return this
  34801. for (; t < i; ) this.view[t++] = e
  34802. return n && (this.offset = t), this
  34803. }),
  34804. (a.flip = function () {
  34805. return (this.limit = this.offset), (this.offset = 0), this
  34806. }),
  34807. (a.mark = function (e) {
  34808. if (((e = void 0 === e ? this.offset : e), !this.noAssert)) {
  34809. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34810. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+0) <= ' + this.buffer.byteLength)
  34811. }
  34812. return (this.markedOffset = e), this
  34813. }),
  34814. (a.order = function (e) {
  34815. if (!this.noAssert && 'boolean' != typeof e) throw TypeError('Illegal littleEndian: Not a boolean')
  34816. return (this.littleEndian = !!e), this
  34817. }),
  34818. (a.LE = function (e) {
  34819. return (this.littleEndian = void 0 === e || !!e), this
  34820. }),
  34821. (a.BE = function (e) {
  34822. return (this.littleEndian = void 0 !== e && !e), this
  34823. }),
  34824. (a.prepend = function (e, t, i) {
  34825. ;('number' != typeof t && 'string' == typeof t) || ((i = t), (t = void 0))
  34826. var n = void 0 === i
  34827. if ((n && (i = this.offset), !this.noAssert)) {
  34828. if ('number' != typeof i || i % 1 != 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  34829. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  34830. }
  34831. e instanceof f || (e = f.wrap(e, t))
  34832. var r = e.limit - e.offset
  34833. if (r <= 0) return this
  34834. var o = r - i
  34835. if (0 < o) {
  34836. var a = new ArrayBuffer(this.buffer.byteLength + o),
  34837. s = new Uint8Array(a)
  34838. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  34839. (this.buffer = a),
  34840. (this.view = s),
  34841. (this.offset += o),
  34842. 0 <= this.markedOffset && (this.markedOffset += o),
  34843. (this.limit += o),
  34844. (i += o)
  34845. } else new Uint8Array(this.buffer)
  34846. return this.view.set(e.view.subarray(e.offset, e.limit), i - r), (e.offset = e.limit), n && (this.offset -= r), this
  34847. }),
  34848. (a.prependTo = function (e, t) {
  34849. return e.prepend(this, t), this
  34850. }),
  34851. (a.printDebug = function (e) {
  34852. 'function' != typeof e && (e = console.log.bind(console)), e(this.toString() + '\n-------------------------------------------------------------------\n' + this.toDebug(!0))
  34853. }),
  34854. (a.remaining = function () {
  34855. return this.limit - this.offset
  34856. }),
  34857. (a.reset = function () {
  34858. return 0 <= this.markedOffset ? ((this.offset = this.markedOffset), (this.markedOffset = -1)) : (this.offset = 0), this
  34859. }),
  34860. (a.resize = function (e) {
  34861. if (!this.noAssert) {
  34862. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal capacity: ' + e + ' (not an integer)')
  34863. if ((e |= 0) < 0) throw RangeError('Illegal capacity: 0 <= ' + e)
  34864. }
  34865. if (this.buffer.byteLength < e) {
  34866. var t = new ArrayBuffer(e),
  34867. i = new Uint8Array(t)
  34868. i.set(this.view), (this.buffer = t), (this.view = i)
  34869. }
  34870. return this
  34871. }),
  34872. (a.reverse = function (e, t) {
  34873. if ((void 0 === e && (e = this.offset), void 0 === t && (t = this.limit), !this.noAssert)) {
  34874. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal begin: Not an integer')
  34875. if (((e >>>= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal end: Not an integer')
  34876. if (((t >>>= 0), e < 0 || t < e || t > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength)
  34877. }
  34878. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)), this
  34879. }),
  34880. (a.skip = function (e) {
  34881. if (!this.noAssert) {
  34882. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal length: ' + e + ' (not an integer)')
  34883. e |= 0
  34884. }
  34885. var t = this.offset + e
  34886. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength)) throw RangeError('Illegal length: 0 <= ' + this.offset + ' + ' + e + ' <= ' + this.buffer.byteLength)
  34887. return (this.offset = t), this
  34888. }),
  34889. (a.slice = function (e, t) {
  34890. if ((void 0 === e && (e = this.offset), void 0 === t && (t = this.limit), !this.noAssert)) {
  34891. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal begin: Not an integer')
  34892. if (((e >>>= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal end: Not an integer')
  34893. if (((t >>>= 0), e < 0 || t < e || t > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength)
  34894. }
  34895. var i = this.clone()
  34896. return (i.offset = e), (i.limit = t), i
  34897. }),
  34898. (a.toBuffer = function (e) {
  34899. var t = this.offset,
  34900. i = this.limit
  34901. if (!this.noAssert) {
  34902. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: Not an integer')
  34903. if (((t >>>= 0), 'number' != typeof i || i % 1 != 0)) throw TypeError('Illegal limit: Not an integer')
  34904. if (((i >>>= 0), t < 0 || i < t || i > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + t + ' <= ' + i + ' <= ' + this.buffer.byteLength)
  34905. }
  34906. if (!e && 0 === t && i === this.buffer.byteLength) return this.buffer
  34907. if (t === i) return o
  34908. var n = new ArrayBuffer(i - t)
  34909. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0), n
  34910. }),
  34911. (a.toArrayBuffer = a.toBuffer),
  34912. (a.toString = function (e, t, i) {
  34913. if (void 0 === e) return 'ByteBufferAB(offset=' + this.offset + ',markedOffset=' + this.markedOffset + ',limit=' + this.limit + ',capacity=' + this.capacity() + ')'
  34914. switch (('number' == typeof e && (i = t = e = 'utf8'), e)) {
  34915. case 'utf8':
  34916. return this.toUTF8(t, i)
  34917. case 'base64':
  34918. return this.toBase64(t, i)
  34919. case 'hex':
  34920. return this.toHex(t, i)
  34921. case 'binary':
  34922. return this.toBinary(t, i)
  34923. case 'debug':
  34924. return this.toDebug()
  34925. case 'columns':
  34926. return this.toColumns()
  34927. default:
  34928. throw Error('Unsupported encoding: ' + e)
  34929. }
  34930. })
  34931. var h = (function () {
  34932. for (
  34933. var e = {},
  34934. r = [
  34935. 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  34936. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47
  34937. ],
  34938. a = [],
  34939. t = 0,
  34940. i = r.length;
  34941. t < i;
  34942. ++t
  34943. )
  34944. a[r[t]] = t
  34945. return (
  34946. (e.encode = function (e, t) {
  34947. for (var i, n; null !== (i = e()); )
  34948. t(r[(i >> 2) & 63]),
  34949. (n = (3 & i) << 4),
  34950. null !== (i = e())
  34951. ? (t(r[63 & ((n |= (i >> 4) & 15) | ((i >> 4) & 15))]), (n = (15 & i) << 2), null !== (i = e()) ? (t(r[63 & (n | ((i >> 6) & 3))]), t(r[63 & i])) : (t(r[63 & n]), t(61)))
  34952. : (t(r[63 & n]), t(61), t(61))
  34953. }),
  34954. (e.decode = function (e, t) {
  34955. function i(e) {
  34956. throw Error('Illegal character code: ' + e)
  34957. }
  34958. for (var n, r, o; null !== (n = e()); )
  34959. if ((void 0 === (r = a[n]) && i(n), null !== (n = e()) && (void 0 === (o = a[n]) && i(n), t(((r << 2) >>> 0) | ((48 & o) >> 4)), null !== (n = e())))) {
  34960. if (void 0 === (r = a[n])) {
  34961. if (61 === n) break
  34962. i(n)
  34963. }
  34964. if ((t((((15 & o) << 4) >>> 0) | ((60 & r) >> 2)), null !== (n = e()))) {
  34965. if (void 0 === (o = a[n])) {
  34966. if (61 === n) break
  34967. i(n)
  34968. }
  34969. t((((3 & r) << 6) >>> 0) | o)
  34970. }
  34971. }
  34972. }),
  34973. (e.test = function (e) {
  34974. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  34975. }),
  34976. e
  34977. )
  34978. })()
  34979. ;(a.toBase64 = function (e, t) {
  34980. if ((void 0 === e && (e = this.offset), void 0 === t && (t = this.limit), (t |= 0), (e |= 0) < 0 || t > this.capacity || t < e)) throw RangeError('begin, end')
  34981. var i
  34982. return (
  34983. h.encode(
  34984. function () {
  34985. return e < t ? this.view[e++] : null
  34986. }.bind(this),
  34987. (i = c())
  34988. ),
  34989. i()
  34990. )
  34991. }),
  34992. (f.fromBase64 = function (e, t) {
  34993. if ('string' != typeof e) throw TypeError('str')
  34994. var i = new f((e.length / 4) * 3, t),
  34995. n = 0
  34996. return (
  34997. h.decode(s(e), function (e) {
  34998. i.view[n++] = e
  34999. }),
  35000. (i.limit = n),
  35001. i
  35002. )
  35003. }),
  35004. (f.btoa = function (e) {
  35005. return f.fromBinary(e).toBase64()
  35006. }),
  35007. (f.atob = function (e) {
  35008. return f.fromBase64(e).toBinary()
  35009. }),
  35010. (a.toBinary = function (e, t) {
  35011. if ((void 0 === e && (e = this.offset), void 0 === t && (t = this.limit), (t |= 0), (e |= 0) < 0 || t > this.capacity() || t < e)) throw RangeError('begin, end')
  35012. if (e === t) return ''
  35013. for (var i = [], n = []; e < t; ) i.push(this.view[e++]), 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)), (i = []))
  35014. return n.join('') + String.fromCharCode.apply(String, i)
  35015. }),
  35016. (f.fromBinary = function (e, t) {
  35017. if ('string' != typeof e) throw TypeError('str')
  35018. for (var i, n = 0, r = e.length, o = new f(r, t); n < r; ) {
  35019. if (255 < (i = e.charCodeAt(n))) throw RangeError('illegal char code: ' + i)
  35020. o.view[n++] = i
  35021. }
  35022. return (o.limit = r), o
  35023. }),
  35024. (a.toDebug = function (e) {
  35025. for (var t, i = -1, n = this.buffer.byteLength, r = '', o = '', a = ''; i < n; ) {
  35026. if (
  35027. (-1 !== i && ((r += (t = this.view[i]) < 16 ? '0' + t.toString(16).toUpperCase() : t.toString(16).toUpperCase()), e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : '.')),
  35028. ++i,
  35029. e && 0 < i && i % 16 == 0 && i !== n)
  35030. ) {
  35031. for (; r.length < 51; ) r += ' '
  35032. ;(a += r + o + '\n'), (r = o = '')
  35033. }
  35034. r +=
  35035. i === this.offset && i === this.limit
  35036. ? i === this.markedOffset
  35037. ? '!'
  35038. : '|'
  35039. : i === this.offset
  35040. ? i === this.markedOffset
  35041. ? '['
  35042. : '<'
  35043. : i === this.limit
  35044. ? i === this.markedOffset
  35045. ? ']'
  35046. : '>'
  35047. : i === this.markedOffset
  35048. ? "'"
  35049. : e || (0 !== i && i !== n)
  35050. ? ' '
  35051. : ''
  35052. }
  35053. if (e && ' ' !== r) {
  35054. for (; r.length < 51; ) r += ' '
  35055. a += r + o + '\n'
  35056. }
  35057. return e ? a : r
  35058. }),
  35059. (f.fromDebug = function (e, t, i) {
  35060. for (var n, r, o = e.length, a = new f(((o + 1) / 3) | 0, t, i), s = 0, l = 0, c = !1, h = !1, u = !1, d = !1, p = !1; s < o; ) {
  35061. switch ((n = e.charAt(s++))) {
  35062. case '!':
  35063. if (!i) {
  35064. if (h || u || d) {
  35065. p = !0
  35066. break
  35067. }
  35068. h = u = d = !0
  35069. }
  35070. ;(a.offset = a.markedOffset = a.limit = l), (c = !1)
  35071. break
  35072. case '|':
  35073. if (!i) {
  35074. if (h || d) {
  35075. p = !0
  35076. break
  35077. }
  35078. h = d = !0
  35079. }
  35080. ;(a.offset = a.limit = l), (c = !1)
  35081. break
  35082. case '[':
  35083. if (!i) {
  35084. if (h || u) {
  35085. p = !0
  35086. break
  35087. }
  35088. h = u = !0
  35089. }
  35090. ;(a.offset = a.markedOffset = l), (c = !1)
  35091. break
  35092. case '<':
  35093. if (!i) {
  35094. if (h) {
  35095. p = !0
  35096. break
  35097. }
  35098. h = !0
  35099. }
  35100. ;(a.offset = l), (c = !1)
  35101. break
  35102. case ']':
  35103. if (!i) {
  35104. if (d || u) {
  35105. p = !0
  35106. break
  35107. }
  35108. d = u = !0
  35109. }
  35110. ;(a.limit = a.markedOffset = l), (c = !1)
  35111. break
  35112. case '>':
  35113. if (!i) {
  35114. if (d) {
  35115. p = !0
  35116. break
  35117. }
  35118. d = !0
  35119. }
  35120. ;(a.limit = l), (c = !1)
  35121. break
  35122. case "'":
  35123. if (!i) {
  35124. if (u) {
  35125. p = !0
  35126. break
  35127. }
  35128. u = !0
  35129. }
  35130. ;(a.markedOffset = l), (c = !1)
  35131. break
  35132. case ' ':
  35133. c = !1
  35134. break
  35135. default:
  35136. if (!i && c) {
  35137. p = !0
  35138. break
  35139. }
  35140. if (((r = parseInt(n + e.charAt(s++), 16)), !i && (isNaN(r) || r < 0 || 255 < r))) throw TypeError('Illegal str: Not a debug encoded string')
  35141. ;(a.view[l++] = r), (c = !0)
  35142. }
  35143. if (p) throw TypeError('Illegal str: Invalid symbol at ' + s)
  35144. }
  35145. if (!i) {
  35146. if (!h || !d) throw TypeError('Illegal str: Missing offset or limit')
  35147. if (l < a.buffer.byteLength) throw TypeError('Illegal str: Not a debug encoded string (is it hex?) ' + l + ' < ' + o)
  35148. }
  35149. return a
  35150. }),
  35151. (a.toHex = function (e, t) {
  35152. if (((e = void 0 === e ? this.offset : e), (t = void 0 === t ? this.limit : t), !this.noAssert)) {
  35153. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal begin: Not an integer')
  35154. if (((e >>>= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal end: Not an integer')
  35155. if (((t >>>= 0), e < 0 || t < e || t > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength)
  35156. }
  35157. for (var i, n = new Array(t - e); e < t; ) (i = this.view[e++]) < 16 ? n.push('0', i.toString(16)) : n.push(i.toString(16))
  35158. return n.join('')
  35159. }),
  35160. (f.fromHex = function (e, t, i) {
  35161. if (!i) {
  35162. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  35163. if (e.length % 2 != 0) throw TypeError('Illegal str: Length not a multiple of 2')
  35164. }
  35165. for (var n, r = e.length, o = new f((r / 2) | 0, t), a = 0, s = 0; a < r; a += 2) {
  35166. if (((n = parseInt(e.substring(a, a + 2), 16)), !i && (!isFinite(n) || n < 0 || 255 < n))) throw TypeError('Illegal str: Contains non-hex characters')
  35167. o.view[s++] = n
  35168. }
  35169. return (o.limit = s), o
  35170. })
  35171. var u,
  35172. d = (u = {
  35173. MAX_CODEPOINT: 1114111,
  35174. encodeUTF8: function (e, t) {
  35175. var i = null
  35176. for (
  35177. 'number' == typeof e &&
  35178. ((i = e),
  35179. (e = function () {
  35180. return null
  35181. }));
  35182. null !== i || null !== (i = e());
  35183. )
  35184. i < 128
  35185. ? t(127 & i)
  35186. : (i < 2048 ? t(((i >> 6) & 31) | 192) : (i < 65536 ? t(((i >> 12) & 15) | 224) : (t(((i >> 18) & 7) | 240), t(((i >> 12) & 63) | 128)), t(((i >> 6) & 63) | 128)),
  35187. t((63 & i) | 128)),
  35188. (i = null)
  35189. },
  35190. decodeUTF8: function (e, t) {
  35191. for (
  35192. var i,
  35193. n,
  35194. r,
  35195. o,
  35196. a = function (e) {
  35197. e = e.slice(0, e.indexOf(null))
  35198. var t = Error(e.toString())
  35199. throw ((t.name = 'TruncatedError'), (t.bytes = e), t)
  35200. };
  35201. null !== (i = e());
  35202. )
  35203. if (0 == (128 & i)) t(i)
  35204. else if (192 == (224 & i)) null === (n = e()) && a([i, n]), t(((31 & i) << 6) | (63 & n))
  35205. else if (224 == (240 & i)) (null !== (n = e()) && null !== (r = e())) || a([i, n, r]), t(((15 & i) << 12) | ((63 & n) << 6) | (63 & r))
  35206. else {
  35207. if (240 != (248 & i)) throw RangeError('Illegal starting byte: ' + i)
  35208. ;(null !== (n = e()) && null !== (r = e()) && null !== (o = e())) || a([i, n, r, o]), t(((7 & i) << 18) | ((63 & n) << 12) | ((63 & r) << 6) | (63 & o))
  35209. }
  35210. },
  35211. UTF16toUTF8: function (e, t) {
  35212. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  35213. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536), (n = null)) : t(i)
  35214. null !== n && t(n)
  35215. },
  35216. UTF8toUTF16: function (e, t) {
  35217. var i = null
  35218. for (
  35219. 'number' == typeof e &&
  35220. ((i = e),
  35221. (e = function () {
  35222. return null
  35223. }));
  35224. null !== i || null !== (i = e());
  35225. )
  35226. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)), t((i % 1024) + 56320)), (i = null)
  35227. },
  35228. encodeUTF16toUTF8: function (e, t) {
  35229. u.UTF16toUTF8(e, function (e) {
  35230. u.encodeUTF8(e, t)
  35231. })
  35232. },
  35233. decodeUTF8toUTF16: function (e, t) {
  35234. u.decodeUTF8(e, function (e) {
  35235. u.UTF8toUTF16(e, t)
  35236. })
  35237. },
  35238. calculateCodePoint: function (e) {
  35239. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  35240. },
  35241. calculateUTF8: function (e) {
  35242. for (var t, i = 0; null !== (t = e()); ) i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4
  35243. return i
  35244. },
  35245. calculateUTF16asUTF8: function (e) {
  35246. var t = 0,
  35247. i = 0
  35248. return (
  35249. u.UTF16toUTF8(e, function (e) {
  35250. ++t, (i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4)
  35251. }),
  35252. [t, i]
  35253. )
  35254. }
  35255. })
  35256. return (
  35257. (a.toUTF8 = function (t, i) {
  35258. if ((void 0 === t && (t = this.offset), void 0 === i && (i = this.limit), !this.noAssert)) {
  35259. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal begin: Not an integer')
  35260. if (((t >>>= 0), 'number' != typeof i || i % 1 != 0)) throw TypeError('Illegal end: Not an integer')
  35261. if (((i >>>= 0), t < 0 || i < t || i > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + t + ' <= ' + i + ' <= ' + this.buffer.byteLength)
  35262. }
  35263. var e
  35264. try {
  35265. d.decodeUTF8toUTF16(
  35266. function () {
  35267. return t < i ? this.view[t++] : null
  35268. }.bind(this),
  35269. (e = c())
  35270. )
  35271. } catch (e) {
  35272. if (t !== i) throw RangeError('Illegal range: Truncated data, ' + t + ' != ' + i)
  35273. }
  35274. return e()
  35275. }),
  35276. (f.fromUTF8 = function (e, t, i) {
  35277. if (!i && 'string' != typeof e) throw TypeError('Illegal str: Not a string')
  35278. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1], t, i),
  35279. r = 0
  35280. return (
  35281. d.encodeUTF16toUTF8(s(e), function (e) {
  35282. n.view[r++] = e
  35283. }),
  35284. (n.limit = r),
  35285. n
  35286. )
  35287. }),
  35288. f
  35289. )
  35290. }),
  35291. 'function' == typeof define && define.amd
  35292. ? define(['long'], r)
  35293. : 'function' == typeof t && 'object' == typeof e && e && e.exports
  35294. ? (e.exports = (function () {
  35295. var e
  35296. try {
  35297. e = t('long')
  35298. } catch (e) {}
  35299. return r(e)
  35300. })())
  35301. : ((n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long))
  35302. },
  35303. {
  35304. long: 216
  35305. }
  35306. ],
  35307. 216: [
  35308. function (e, t, i) {
  35309. var n, r
  35310. ;(n = this),
  35311. (r = function () {
  35312. 'use strict'
  35313. function n(e, t, i) {
  35314. ;(this.low = 0 | e), (this.high = 0 | t), (this.unsigned = !!i)
  35315. }
  35316. function p(e) {
  35317. return !0 === (e && e.__isLong__)
  35318. }
  35319. function e(e, t) {
  35320. var i, n, r
  35321. return t
  35322. ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e])
  35323. ? n
  35324. : ((i = g(e, (0 | e) < 0 ? -1 : 0, !0)), r && (a[e] = i), i)
  35325. : (r = -128 <= (e |= 0) && e < 128) && (n = o[e])
  35326. ? n
  35327. : ((i = g(e, e < 0 ? -1 : 0, !1)), r && (o[e] = i), i)
  35328. }
  35329. function f(e, t) {
  35330. if (isNaN(e) || !isFinite(e)) return t ? l : y
  35331. if (t) {
  35332. if (e < 0) return l
  35333. if (r <= e) return I
  35334. } else {
  35335. if (e <= -s) return E
  35336. if (s <= e + 1) return C
  35337. }
  35338. return e < 0 ? f(-e, t).neg() : g(e % i | 0, (e / i) | 0, t)
  35339. }
  35340. function g(e, t, i) {
  35341. return new n(e, t, i)
  35342. }
  35343. function h(e, t, i) {
  35344. if (0 === e.length) throw Error('empty string')
  35345. if ('NaN' === e || 'Infinity' === e || '+Infinity' === e || '-Infinity' === e) return y
  35346. if (((t = 'number' == typeof t ? ((i = t), !1) : !!t), (i = i || 10) < 2 || 36 < i)) throw RangeError('radix')
  35347. var n
  35348. if (0 < (n = e.indexOf('-'))) throw Error('interior hyphen')
  35349. if (0 === n) return h(e.substring(1), t, i).neg()
  35350. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  35351. var s = Math.min(8, e.length - a),
  35352. l = parseInt(e.substring(a, a + s), i)
  35353. if (s < 8) {
  35354. var c = f(u(i, s))
  35355. o = o.mul(c).add(f(l))
  35356. } else o = (o = o.mul(r)).add(f(l))
  35357. }
  35358. return (o.unsigned = t), o
  35359. }
  35360. function m(e) {
  35361. return e instanceof n ? e : 'number' == typeof e ? f(e) : 'string' == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  35362. }
  35363. Object.defineProperty(n.prototype, '__isLong__', {
  35364. value: !0,
  35365. enumerable: !1,
  35366. configurable: !1
  35367. }),
  35368. (n.isLong = p)
  35369. var o = {},
  35370. a = {}
  35371. ;(n.fromInt = e), (n.fromNumber = f), (n.fromBits = g)
  35372. var u = Math.pow
  35373. ;(n.fromString = h), (n.fromValue = m)
  35374. var i = 4294967296,
  35375. r = 0x10000000000000000,
  35376. s = r / 2,
  35377. v = e(1 << 24),
  35378. y = e(0)
  35379. n.ZERO = y
  35380. var l = e(0, !0)
  35381. n.UZERO = l
  35382. var c = e(1)
  35383. n.ONE = c
  35384. var d = e(1, !0)
  35385. n.UONE = d
  35386. var A = e(-1)
  35387. n.NEG_ONE = A
  35388. var C = g(-1, 2147483647, !1)
  35389. n.MAX_VALUE = C
  35390. var I = g(-1, -1, !0)
  35391. n.MAX_UNSIGNED_VALUE = I
  35392. var E = g(0, -2147483648, !1)
  35393. n.MIN_VALUE = E
  35394. var t = n.prototype
  35395. return (
  35396. (t.toInt = function () {
  35397. return this.unsigned ? this.low >>> 0 : this.low
  35398. }),
  35399. (t.toNumber = function () {
  35400. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  35401. }),
  35402. (t.toString = function (e) {
  35403. if ((e = e || 10) < 2 || 36 < e) throw RangeError('radix')
  35404. if (this.isZero()) return '0'
  35405. if (this.isNegative()) {
  35406. if (this.eq(E)) {
  35407. var t = f(e),
  35408. i = this.div(t),
  35409. n = i.mul(t).sub(this)
  35410. return i.toString(e) + n.toInt().toString(e)
  35411. }
  35412. return '-' + this.neg().toString(e)
  35413. }
  35414. for (var r = f(u(e, 6), this.unsigned), o = this, a = ''; ; ) {
  35415. var s = o.div(r),
  35416. l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e)
  35417. if ((o = s).isZero()) return l + a
  35418. for (; l.length < 6; ) l = '0' + l
  35419. a = '' + l + a
  35420. }
  35421. }),
  35422. (t.getHighBits = function () {
  35423. return this.high
  35424. }),
  35425. (t.getHighBitsUnsigned = function () {
  35426. return this.high >>> 0
  35427. }),
  35428. (t.getLowBits = function () {
  35429. return this.low
  35430. }),
  35431. (t.getLowBitsUnsigned = function () {
  35432. return this.low >>> 0
  35433. }),
  35434. (t.getNumBitsAbs = function () {
  35435. if (this.isNegative()) return this.eq(E) ? 64 : this.neg().getNumBitsAbs()
  35436. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & (1 << t)); t--);
  35437. return 0 != this.high ? t + 33 : t + 1
  35438. }),
  35439. (t.isZero = function () {
  35440. return 0 === this.high && 0 === this.low
  35441. }),
  35442. (t.isNegative = function () {
  35443. return !this.unsigned && this.high < 0
  35444. }),
  35445. (t.isPositive = function () {
  35446. return this.unsigned || 0 <= this.high
  35447. }),
  35448. (t.isOdd = function () {
  35449. return 1 == (1 & this.low)
  35450. }),
  35451. (t.isEven = function () {
  35452. return 0 == (1 & this.low)
  35453. }),
  35454. (t.equals = function (e) {
  35455. return p(e) || (e = m(e)), (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  35456. }),
  35457. (t.eq = t.equals),
  35458. (t.notEquals = function (e) {
  35459. return !this.eq(e)
  35460. }),
  35461. (t.neq = t.notEquals),
  35462. (t.lessThan = function (e) {
  35463. return this.comp(e) < 0
  35464. }),
  35465. (t.lt = t.lessThan),
  35466. (t.lessThanOrEqual = function (e) {
  35467. return this.comp(e) <= 0
  35468. }),
  35469. (t.lte = t.lessThanOrEqual),
  35470. (t.greaterThan = function (e) {
  35471. return 0 < this.comp(e)
  35472. }),
  35473. (t.gt = t.greaterThan),
  35474. (t.greaterThanOrEqual = function (e) {
  35475. return 0 <= this.comp(e)
  35476. }),
  35477. (t.gte = t.greaterThanOrEqual),
  35478. (t.compare = function (e) {
  35479. if ((p(e) || (e = m(e)), this.eq(e))) return 0
  35480. var t = this.isNegative(),
  35481. i = e.isNegative()
  35482. return t && !i
  35483. ? -1
  35484. : !t && i
  35485. ? 1
  35486. : this.unsigned
  35487. ? e.high >>> 0 > this.high >>> 0 || (e.high === this.high && e.low >>> 0 > this.low >>> 0)
  35488. ? -1
  35489. : 1
  35490. : this.sub(e).isNegative()
  35491. ? -1
  35492. : 1
  35493. }),
  35494. (t.comp = t.compare),
  35495. (t.negate = function () {
  35496. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  35497. }),
  35498. (t.neg = t.negate),
  35499. (t.add = function (e) {
  35500. p(e) || (e = m(e))
  35501. var t = this.high >>> 16,
  35502. i = 65535 & this.high,
  35503. n = this.low >>> 16,
  35504. r = 65535 & this.low,
  35505. o = e.high >>> 16,
  35506. a = 65535 & e.high,
  35507. s = e.low >>> 16,
  35508. l = 0,
  35509. c = 0,
  35510. h = 0,
  35511. u = 0
  35512. return (
  35513. (h += (u += r + (65535 & e.low)) >>> 16),
  35514. (c += (h += n + s) >>> 16),
  35515. (l += (c += i + a) >>> 16),
  35516. (l += t + o),
  35517. g(((h &= 65535) << 16) | (u &= 65535), ((l &= 65535) << 16) | (c &= 65535), this.unsigned)
  35518. )
  35519. }),
  35520. (t.subtract = function (e) {
  35521. return p(e) || (e = m(e)), this.add(e.neg())
  35522. }),
  35523. (t.sub = t.subtract),
  35524. (t.multiply = function (e) {
  35525. if (this.isZero()) return y
  35526. if ((p(e) || (e = m(e)), e.isZero())) return y
  35527. if (this.eq(E)) return e.isOdd() ? E : y
  35528. if (e.eq(E)) return this.isOdd() ? E : y
  35529. if (this.isNegative()) return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg()
  35530. if (e.isNegative()) return this.mul(e.neg()).neg()
  35531. if (this.lt(v) && e.lt(v)) return f(this.toNumber() * e.toNumber(), this.unsigned)
  35532. var t = this.high >>> 16,
  35533. i = 65535 & this.high,
  35534. n = this.low >>> 16,
  35535. r = 65535 & this.low,
  35536. o = e.high >>> 16,
  35537. a = 65535 & e.high,
  35538. s = e.low >>> 16,
  35539. l = 65535 & e.low,
  35540. c = 0,
  35541. h = 0,
  35542. u = 0,
  35543. d = 0
  35544. return (
  35545. (u += (d += r * l) >>> 16),
  35546. (h += (u += n * l) >>> 16),
  35547. (u &= 65535),
  35548. (h += (u += r * s) >>> 16),
  35549. (c += (h += i * l) >>> 16),
  35550. (h &= 65535),
  35551. (c += (h += n * s) >>> 16),
  35552. (h &= 65535),
  35553. (c += (h += r * a) >>> 16),
  35554. (c += t * l + i * s + n * a + r * o),
  35555. g(((u &= 65535) << 16) | (d &= 65535), ((c &= 65535) << 16) | (h &= 65535), this.unsigned)
  35556. )
  35557. }),
  35558. (t.mul = t.multiply),
  35559. (t.divide = function (e) {
  35560. if ((p(e) || (e = m(e)), e.isZero())) throw Error('division by zero')
  35561. if (this.isZero()) return this.unsigned ? l : y
  35562. var t, i, n
  35563. if (this.unsigned) {
  35564. if ((e.unsigned || (e = e.toUnsigned()), e.gt(this))) return l
  35565. if (e.gt(this.shru(1))) return d
  35566. n = l
  35567. } else {
  35568. if (this.eq(E)) return e.eq(c) || e.eq(A) ? E : e.eq(E) ? c : (t = this.shr(1).div(e).shl(1)).eq(y) ? (e.isNegative() ? c : A) : ((i = this.sub(e.mul(t))), (n = t.add(i.div(e))))
  35569. if (e.eq(E)) return this.unsigned ? l : y
  35570. if (this.isNegative()) return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg()
  35571. if (e.isNegative()) return this.div(e.neg()).neg()
  35572. n = y
  35573. }
  35574. for (i = this; i.gte(e); ) {
  35575. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()))
  35576. for (var r = Math.ceil(Math.log(t) / Math.LN2), o = r <= 48 ? 1 : u(2, r - 48), a = f(t), s = a.mul(e); s.isNegative() || s.gt(i); ) s = (a = f((t -= o), this.unsigned)).mul(e)
  35577. a.isZero() && (a = c), (n = n.add(a)), (i = i.sub(s))
  35578. }
  35579. return n
  35580. }),
  35581. (t.div = t.divide),
  35582. (t.modulo = function (e) {
  35583. return p(e) || (e = m(e)), this.sub(this.div(e).mul(e))
  35584. }),
  35585. (t.mod = t.modulo),
  35586. (t.not = function () {
  35587. return g(~this.low, ~this.high, this.unsigned)
  35588. }),
  35589. (t.and = function (e) {
  35590. return p(e) || (e = m(e)), g(this.low & e.low, this.high & e.high, this.unsigned)
  35591. }),
  35592. (t.or = function (e) {
  35593. return p(e) || (e = m(e)), g(this.low | e.low, this.high | e.high, this.unsigned)
  35594. }),
  35595. (t.xor = function (e) {
  35596. return p(e) || (e = m(e)), g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  35597. }),
  35598. (t.shiftLeft = function (e) {
  35599. return (
  35600. p(e) && (e = e.toInt()), 0 == (e &= 63) ? this : e < 32 ? g(this.low << e, (this.high << e) | (this.low >>> (32 - e)), this.unsigned) : g(0, this.low << (e - 32), this.unsigned)
  35601. )
  35602. }),
  35603. (t.shl = t.shiftLeft),
  35604. (t.shiftRight = function (e) {
  35605. return (
  35606. p(e) && (e = e.toInt()),
  35607. 0 == (e &= 63) ? this : e < 32 ? g((this.low >>> e) | (this.high << (32 - e)), this.high >> e, this.unsigned) : g(this.high >> (e - 32), 0 <= this.high ? 0 : -1, this.unsigned)
  35608. )
  35609. }),
  35610. (t.shr = t.shiftRight),
  35611. (t.shiftRightUnsigned = function (e) {
  35612. if ((p(e) && (e = e.toInt()), 0 === (e &= 63))) return this
  35613. var t = this.high
  35614. return e < 32 ? g((this.low >>> e) | (t << (32 - e)), t >>> e, this.unsigned) : g(32 === e ? t : t >>> (e - 32), 0, this.unsigned)
  35615. }),
  35616. (t.shru = t.shiftRightUnsigned),
  35617. (t.toSigned = function () {
  35618. return this.unsigned ? g(this.low, this.high, !1) : this
  35619. }),
  35620. (t.toUnsigned = function () {
  35621. return this.unsigned ? this : g(this.low, this.high, !0)
  35622. }),
  35623. (t.toBytes = function (e) {
  35624. return e ? this.toBytesLE() : this.toBytesBE()
  35625. }),
  35626. (t.toBytesLE = function () {
  35627. var e = this.high,
  35628. t = this.low
  35629. return [255 & t, (t >>> 8) & 255, (t >>> 16) & 255, (t >>> 24) & 255, 255 & e, (e >>> 8) & 255, (e >>> 16) & 255, (e >>> 24) & 255]
  35630. }),
  35631. (t.toBytesBE = function () {
  35632. var e = this.high,
  35633. t = this.low
  35634. return [(e >>> 24) & 255, (e >>> 16) & 255, (e >>> 8) & 255, 255 & e, (t >>> 24) & 255, (t >>> 16) & 255, (t >>> 8) & 255, 255 & t]
  35635. }),
  35636. n
  35637. )
  35638. }),
  35639. 'function' == typeof define && define.amd
  35640. ? define([], r)
  35641. : 'function' == typeof e && 'object' == typeof t && t && t.exports
  35642. ? (t.exports = r())
  35643. : ((n.dcodeIO = n.dcodeIO || {}).Long = r())
  35644. },
  35645. {}
  35646. ],
  35647. 217: [
  35648. function (e, t, i) {
  35649. var n,
  35650. r,
  35651. o,
  35652. a,
  35653. s,
  35654. l,
  35655. c,
  35656. h,
  35657. u,
  35658. d,
  35659. p,
  35660. f,
  35661. g,
  35662. m,
  35663. v,
  35664. y,
  35665. A,
  35666. C,
  35667. I,
  35668. E,
  35669. _,
  35670. b,
  35671. w,
  35672. T,
  35673. x,
  35674. S,
  35675. M,
  35676. R,
  35677. P,
  35678. O,
  35679. L,
  35680. D,
  35681. N,
  35682. F,
  35683. B,
  35684. V,
  35685. k,
  35686. U,
  35687. H,
  35688. z,
  35689. G,
  35690. W,
  35691. j,
  35692. Y,
  35693. q,
  35694. X,
  35695. Z,
  35696. K,
  35697. Q,
  35698. J,
  35699. $,
  35700. ee,
  35701. te,
  35702. ie,
  35703. ne,
  35704. re,
  35705. oe,
  35706. ae,
  35707. se,
  35708. le,
  35709. ce,
  35710. he,
  35711. ue,
  35712. de,
  35713. pe,
  35714. fe,
  35715. ge,
  35716. me,
  35717. ve,
  35718. ye,
  35719. Ae,
  35720. Ce,
  35721. Ie,
  35722. Ee,
  35723. _e,
  35724. be,
  35725. we,
  35726. Te,
  35727. xe,
  35728. Se,
  35729. Me,
  35730. Re,
  35731. Pe,
  35732. Oe,
  35733. Le,
  35734. De,
  35735. Ne,
  35736. Fe,
  35737. Be,
  35738. Ve,
  35739. ke,
  35740. Ue,
  35741. He,
  35742. ze,
  35743. Ge,
  35744. We,
  35745. je,
  35746. Ye,
  35747. qe,
  35748. Xe,
  35749. Ze,
  35750. Ke,
  35751. Qe,
  35752. Je,
  35753. $e,
  35754. et,
  35755. tt,
  35756. it,
  35757. nt,
  35758. rt,
  35759. ot,
  35760. at,
  35761. st,
  35762. lt,
  35763. ct,
  35764. ht,
  35765. ut,
  35766. dt,
  35767. pt,
  35768. ft,
  35769. gt,
  35770. mt,
  35771. vt,
  35772. yt,
  35773. At,
  35774. Ct,
  35775. It,
  35776. Et,
  35777. _t,
  35778. bt,
  35779. wt,
  35780. Tt,
  35781. xt,
  35782. St,
  35783. Mt,
  35784. Rt,
  35785. Pt,
  35786. Ot,
  35787. Lt,
  35788. Dt,
  35789. Nt,
  35790. Ft,
  35791. Bt,
  35792. Vt,
  35793. kt,
  35794. Ut,
  35795. Ht,
  35796. zt,
  35797. Gt,
  35798. Wt,
  35799. jt,
  35800. Yt,
  35801. qt,
  35802. Xt,
  35803. Zt,
  35804. Kt,
  35805. Qt,
  35806. Jt,
  35807. $t,
  35808. ei,
  35809. ti,
  35810. ii,
  35811. ni,
  35812. ri,
  35813. oi,
  35814. ai,
  35815. si,
  35816. li,
  35817. ci,
  35818. hi,
  35819. ui,
  35820. di,
  35821. pi,
  35822. fi,
  35823. gi,
  35824. mi,
  35825. vi,
  35826. yi,
  35827. Ai,
  35828. Ci = {
  35829. REVISION: '75'
  35830. }
  35831. function Ii(e, t) {
  35832. return e.distance - t.distance
  35833. }
  35834. function Ei(e, t, i, n) {
  35835. if (!1 !== e.visible && (e.raycast(t, i), !0 === n)) for (var r = e.children, o = 0, a = r.length; o < a; o++) Ei(r[o], t, i, !0)
  35836. }
  35837. function _i(e, t, i) {
  35838. return i < 0 && (i += 1), 1 < i && (i -= 1), i < 1 / 6 ? e + 6 * (t - e) * i : i < 0.5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  35839. }
  35840. function bi(e, t, i, n, r, o, a) {
  35841. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt), r.multiplyScalar(Vt.x), o.multiplyScalar(Vt.y), a.multiplyScalar(Vt.z), r.add(o).add(a), r.clone()
  35842. }
  35843. function wi(e, t, i, n, r, o, a) {
  35844. var s = e.material
  35845. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a))) return null
  35846. Ut.copy(a), Ut.applyMatrix4(e.matrixWorld)
  35847. var l = t.ray.origin.distanceTo(Ut)
  35848. return l < t.near || l > t.far
  35849. ? null
  35850. : {
  35851. distance: l,
  35852. point: Ut.clone(),
  35853. object: e
  35854. }
  35855. }
  35856. function Ti(e, t, i, n, r, o, a, s) {
  35857. Mt.fromArray(n, 3 * o), Rt.fromArray(n, 3 * a), Pt.fromArray(n, 3 * s)
  35858. var l = wi(e, t, i, Mt, Rt, Pt, kt)
  35859. return (
  35860. l &&
  35861. (r && (Nt.fromArray(r, 2 * o), Ft.fromArray(r, 2 * a), Bt.fromArray(r, 2 * s), (l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt))),
  35862. (l.face = new Ci.Face3(o, a, s, Ci.Triangle.normal(Mt, Rt, Pt))),
  35863. (l.faceIndex = o)),
  35864. l
  35865. )
  35866. }
  35867. function xi() {}
  35868. function Si(e, t, i, n, r, o) {
  35869. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E
  35870. if (((s = e[o[t]].x), (l = e[o[t]].y), (c = e[o[i]].x), (h = e[o[i]].y), (u = e[o[n]].x), (d = e[o[n]].y), Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))) return !1
  35871. for (g = u - c, m = d - h, v = s - u, y = l - d, A = c - s, C = h - l, a = 0; a < r; a++)
  35872. if (
  35873. ((p = e[o[a]].x),
  35874. (f = e[o[a]].y),
  35875. !((p === s && f === l) || (p === c && f === h) || (p === u && f === d)) &&
  35876. ((I = A * (f - l) - C * (p - s)), (E = v * (f - d) - y * (p - u)), g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  35877. )
  35878. return !1
  35879. return !0
  35880. }
  35881. function Mi(e) {
  35882. switch (e) {
  35883. case Ci.LinearEncoding:
  35884. return ['Linear', '( value )']
  35885. case Ci.sRGBEncoding:
  35886. return ['sRGB', '( value )']
  35887. case Ci.RGBEEncoding:
  35888. return ['RGBE', '( value )']
  35889. case Ci.RGBM7Encoding:
  35890. return ['RGBM', '( value, 7.0 )']
  35891. case Ci.RGBM16Encoding:
  35892. return ['RGBM', '( value, 16.0 )']
  35893. case Ci.RGBDEncoding:
  35894. return ['RGBD', '( value, 256.0 )']
  35895. case Ci.GammaEncoding:
  35896. return ['Gamma', '( value, float( GAMMA_FACTOR ) )']
  35897. default:
  35898. throw new Error('unsupported encoding: ' + e)
  35899. }
  35900. }
  35901. function Ri(e, t) {
  35902. var i = Mi(t)
  35903. return 'vec4 ' + e + '( vec4 value ) { return ' + i[0] + 'ToLinear' + i[1] + '; }'
  35904. }
  35905. function Pi(e) {
  35906. return '' !== e
  35907. }
  35908. function Oi(e, t) {
  35909. return e
  35910. .replace(/NUM_DIR_LIGHTS/g, t.numDirLights)
  35911. .replace(/NUM_SPOT_LIGHTS/g, t.numSpotLights)
  35912. .replace(/NUM_POINT_LIGHTS/g, t.numPointLights)
  35913. .replace(/NUM_HEMI_LIGHTS/g, t.numHemiLights)
  35914. }
  35915. function Li(e) {
  35916. return e.replace(/#include +<([\w\d.]+)>/g, function (e, t) {
  35917. var i = Ci.ShaderChunk[t]
  35918. if (void 0 === i) throw new Error('Can not resolve #include <' + t + '>')
  35919. return Li(i)
  35920. })
  35921. }
  35922. function Di(e) {
  35923. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function (e, t, i, n) {
  35924. for (var r = '', o = parseInt(t); o < parseInt(i); o++) r += n.replace(/\[ i \]/g, '[ ' + o + ' ]')
  35925. return r
  35926. })
  35927. }
  35928. function Ni(e, t, i, n) {
  35929. gi.set(t, i, n).unproject(mi)
  35930. var r = fi[e]
  35931. if (void 0 !== r) for (var o = 0, a = r.length; o < a; o++) pi.vertices[r[o]].copy(gi)
  35932. }
  35933. 'function' == typeof define && define.amd ? define('three', Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  35934. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  35935. void 0 === Math.sign &&
  35936. (Math.sign = function (e) {
  35937. return e < 0 ? -1 : 0 < e ? 1 : +e
  35938. }),
  35939. void 0 === Function.prototype.name &&
  35940. void 0 !== Object.defineProperty &&
  35941. Object.defineProperty(Function.prototype, 'name', {
  35942. get: function () {
  35943. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  35944. }
  35945. }),
  35946. void 0 === Object.assign &&
  35947. Object.defineProperty(Object, 'assign', {
  35948. writable: !0,
  35949. configurable: !0,
  35950. value: function (e) {
  35951. 'use strict'
  35952. if (null == e) throw new TypeError('Cannot convert first argument to object')
  35953. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  35954. var r = arguments[i]
  35955. if (null != r) {
  35956. r = Object(r)
  35957. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  35958. var l = o[a],
  35959. c = Object.getOwnPropertyDescriptor(r, l)
  35960. void 0 !== c && c.enumerable && (t[l] = r[l])
  35961. }
  35962. }
  35963. }
  35964. return t
  35965. }
  35966. }),
  35967. (Ci.MOUSE = {
  35968. LEFT: 0,
  35969. MIDDLE: 1,
  35970. RIGHT: 2
  35971. }),
  35972. (Ci.CullFaceNone = 0),
  35973. (Ci.CullFaceBack = 1),
  35974. (Ci.CullFaceFront = 2),
  35975. (Ci.CullFaceFrontBack = 3),
  35976. (Ci.FrontFaceDirectionCW = 0),
  35977. (Ci.FrontFaceDirectionCCW = 1),
  35978. (Ci.BasicShadowMap = 0),
  35979. (Ci.PCFShadowMap = 1),
  35980. (Ci.PCFSoftShadowMap = 2),
  35981. (Ci.FrontSide = 0),
  35982. (Ci.BackSide = 1),
  35983. (Ci.DoubleSide = 2),
  35984. (Ci.FlatShading = 1),
  35985. (Ci.SmoothShading = 2),
  35986. (Ci.NoColors = 0),
  35987. (Ci.FaceColors = 1),
  35988. (Ci.VertexColors = 2),
  35989. (Ci.NoBlending = 0),
  35990. (Ci.NormalBlending = 1),
  35991. (Ci.AdditiveBlending = 2),
  35992. (Ci.SubtractiveBlending = 3),
  35993. (Ci.MultiplyBlending = 4),
  35994. (Ci.CustomBlending = 5),
  35995. (Ci.AddEquation = 100),
  35996. (Ci.SubtractEquation = 101),
  35997. (Ci.ReverseSubtractEquation = 102),
  35998. (Ci.MinEquation = 103),
  35999. (Ci.MaxEquation = 104),
  36000. (Ci.ZeroFactor = 200),
  36001. (Ci.OneFactor = 201),
  36002. (Ci.SrcColorFactor = 202),
  36003. (Ci.OneMinusSrcColorFactor = 203),
  36004. (Ci.SrcAlphaFactor = 204),
  36005. (Ci.OneMinusSrcAlphaFactor = 205),
  36006. (Ci.DstAlphaFactor = 206),
  36007. (Ci.OneMinusDstAlphaFactor = 207),
  36008. (Ci.DstColorFactor = 208),
  36009. (Ci.OneMinusDstColorFactor = 209),
  36010. (Ci.SrcAlphaSaturateFactor = 210),
  36011. (Ci.NeverDepth = 0),
  36012. (Ci.AlwaysDepth = 1),
  36013. (Ci.LessDepth = 2),
  36014. (Ci.LessEqualDepth = 3),
  36015. (Ci.EqualDepth = 4),
  36016. (Ci.GreaterEqualDepth = 5),
  36017. (Ci.GreaterDepth = 6),
  36018. (Ci.NotEqualDepth = 7),
  36019. (Ci.MultiplyOperation = 0),
  36020. (Ci.MixOperation = 1),
  36021. (Ci.AddOperation = 2),
  36022. (Ci.NoToneMapping = 0),
  36023. (Ci.LinearToneMapping = 1),
  36024. (Ci.ReinhardToneMapping = 2),
  36025. (Ci.Uncharted2ToneMapping = 3),
  36026. (Ci.CineonToneMapping = 4),
  36027. (Ci.UVMapping = 300),
  36028. (Ci.CubeReflectionMapping = 301),
  36029. (Ci.CubeRefractionMapping = 302),
  36030. (Ci.EquirectangularReflectionMapping = 303),
  36031. (Ci.EquirectangularRefractionMapping = 304),
  36032. (Ci.SphericalReflectionMapping = 305),
  36033. (Ci.CubeUVReflectionMapping = 306),
  36034. (Ci.CubeUVRefractionMapping = 307),
  36035. (Ci.RepeatWrapping = 1e3),
  36036. (Ci.ClampToEdgeWrapping = 1001),
  36037. (Ci.MirroredRepeatWrapping = 1002),
  36038. (Ci.NearestFilter = 1003),
  36039. (Ci.NearestMipMapNearestFilter = 1004),
  36040. (Ci.NearestMipMapLinearFilter = 1005),
  36041. (Ci.LinearFilter = 1006),
  36042. (Ci.LinearMipMapNearestFilter = 1007),
  36043. (Ci.LinearMipMapLinearFilter = 1008),
  36044. (Ci.UnsignedByteType = 1009),
  36045. (Ci.ByteType = 1010),
  36046. (Ci.ShortType = 1011),
  36047. (Ci.UnsignedShortType = 1012),
  36048. (Ci.IntType = 1013),
  36049. (Ci.UnsignedIntType = 1014),
  36050. (Ci.FloatType = 1015),
  36051. (Ci.HalfFloatType = 1025),
  36052. (Ci.UnsignedShort4444Type = 1016),
  36053. (Ci.UnsignedShort5551Type = 1017),
  36054. (Ci.UnsignedShort565Type = 1018),
  36055. (Ci.AlphaFormat = 1019),
  36056. (Ci.RGBFormat = 1020),
  36057. (Ci.RGBAFormat = 1021),
  36058. (Ci.LuminanceFormat = 1022),
  36059. (Ci.LuminanceAlphaFormat = 1023),
  36060. (Ci.RGBEFormat = Ci.RGBAFormat),
  36061. (Ci.RGB_S3TC_DXT1_Format = 2001),
  36062. (Ci.RGBA_S3TC_DXT1_Format = 2002),
  36063. (Ci.RGBA_S3TC_DXT3_Format = 2003),
  36064. (Ci.RGBA_S3TC_DXT5_Format = 2004),
  36065. (Ci.RGB_PVRTC_4BPPV1_Format = 2100),
  36066. (Ci.RGB_PVRTC_2BPPV1_Format = 2101),
  36067. (Ci.RGBA_PVRTC_4BPPV1_Format = 2102),
  36068. (Ci.RGBA_PVRTC_2BPPV1_Format = 2103),
  36069. (Ci.RGB_ETC1_Format = 2151),
  36070. (Ci.LoopOnce = 2200),
  36071. (Ci.LoopRepeat = 2201),
  36072. (Ci.LoopPingPong = 2202),
  36073. (Ci.InterpolateDiscrete = 2300),
  36074. (Ci.InterpolateLinear = 2301),
  36075. (Ci.InterpolateSmooth = 2302),
  36076. (Ci.ZeroCurvatureEnding = 2400),
  36077. (Ci.ZeroSlopeEnding = 2401),
  36078. (Ci.WrapAroundEnding = 2402),
  36079. (Ci.TrianglesDrawMode = 0),
  36080. (Ci.TriangleStripDrawMode = 1),
  36081. (Ci.TriangleFanDrawMode = 2),
  36082. (Ci.LinearEncoding = 3e3),
  36083. (Ci.sRGBEncoding = 3001),
  36084. (Ci.GammaEncoding = 3007),
  36085. (Ci.RGBEEncoding = 3002),
  36086. (Ci.LogLuvEncoding = 3003),
  36087. (Ci.RGBM7Encoding = 3004),
  36088. (Ci.RGBM16Encoding = 3005),
  36089. (Ci.RGBDEncoding = 3006),
  36090. (Ci.Color = function (e) {
  36091. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  36092. }),
  36093. (Ci.Color.prototype = {
  36094. constructor: Ci.Color,
  36095. r: 1,
  36096. g: 1,
  36097. b: 1,
  36098. set: function (e) {
  36099. return e instanceof Ci.Color ? this.copy(e) : 'number' == typeof e ? this.setHex(e) : 'string' == typeof e && this.setStyle(e), this
  36100. },
  36101. setScalar: function (e) {
  36102. ;(this.r = e), (this.g = e), (this.b = e)
  36103. },
  36104. setHex: function (e) {
  36105. return (e = Math.floor(e)), (this.r = ((e >> 16) & 255) / 255), (this.g = ((e >> 8) & 255) / 255), (this.b = (255 & e) / 255), this
  36106. },
  36107. setRGB: function (e, t, i) {
  36108. return (this.r = e), (this.g = t), (this.b = i), this
  36109. },
  36110. setHSL: function (e, t, i) {
  36111. if (((e = Ci.Math.euclideanModulo(e, 1)), (t = Ci.Math.clamp(t, 0, 1)), (i = Ci.Math.clamp(i, 0, 1)), 0 === t)) this.r = this.g = this.b = i
  36112. else {
  36113. var n = i <= 0.5 ? i * (1 + t) : i + t - i * t,
  36114. r = 2 * i - n
  36115. ;(this.r = _i(r, n, e + 1 / 3)), (this.g = _i(r, n, e)), (this.b = _i(r, n, e - 1 / 3))
  36116. }
  36117. return this
  36118. },
  36119. setStyle: function (t) {
  36120. function e(e) {
  36121. void 0 !== e && parseFloat(e) < 1 && console.warn('THREE.Color: Alpha component of ' + t + ' will be ignored.')
  36122. }
  36123. var i
  36124. if ((i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t))) {
  36125. var n,
  36126. r = i[1],
  36127. o = i[2]
  36128. switch (r) {
  36129. case 'rgb':
  36130. case 'rgba':
  36131. if ((n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)))
  36132. return (this.r = Math.min(255, parseInt(n[1], 10)) / 255), (this.g = Math.min(255, parseInt(n[2], 10)) / 255), (this.b = Math.min(255, parseInt(n[3], 10)) / 255), e(n[5]), this
  36133. if ((n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)))
  36134. return (this.r = Math.min(100, parseInt(n[1], 10)) / 100), (this.g = Math.min(100, parseInt(n[2], 10)) / 100), (this.b = Math.min(100, parseInt(n[3], 10)) / 100), e(n[5]), this
  36135. break
  36136. case 'hsl':
  36137. case 'hsla':
  36138. if ((n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))) {
  36139. var a = parseFloat(n[1]) / 360,
  36140. s = parseInt(n[2], 10) / 100,
  36141. l = parseInt(n[3], 10) / 100
  36142. return e(n[5]), this.setHSL(a, s, l)
  36143. }
  36144. }
  36145. } else if ((i = /^\#([A-Fa-f0-9]+)$/.exec(t))) {
  36146. var c,
  36147. h = (c = i[1]).length
  36148. if (3 === h)
  36149. return (
  36150. (this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255), (this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255), (this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255), this
  36151. )
  36152. if (6 === h)
  36153. return (
  36154. (this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255), (this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255), (this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255), this
  36155. )
  36156. }
  36157. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn('THREE.Color: Unknown color ' + t))
  36158. return this
  36159. },
  36160. clone: function () {
  36161. return new this.constructor(this.r, this.g, this.b)
  36162. },
  36163. copy: function (e) {
  36164. return (this.r = e.r), (this.g = e.g), (this.b = e.b), this
  36165. },
  36166. copyGammaToLinear: function (e, t) {
  36167. return void 0 === t && (t = 2), (this.r = Math.pow(e.r, t)), (this.g = Math.pow(e.g, t)), (this.b = Math.pow(e.b, t)), this
  36168. },
  36169. copyLinearToGamma: function (e, t) {
  36170. void 0 === t && (t = 2)
  36171. var i = 0 < t ? 1 / t : 1
  36172. return (this.r = Math.pow(e.r, i)), (this.g = Math.pow(e.g, i)), (this.b = Math.pow(e.b, i)), this
  36173. },
  36174. convertGammaToLinear: function () {
  36175. var e = this.r,
  36176. t = this.g,
  36177. i = this.b
  36178. return (this.r = e * e), (this.g = t * t), (this.b = i * i), this
  36179. },
  36180. convertLinearToGamma: function () {
  36181. return (this.r = Math.sqrt(this.r)), (this.g = Math.sqrt(this.g)), (this.b = Math.sqrt(this.b)), this
  36182. },
  36183. getHex: function () {
  36184. return ((255 * this.r) << 16) ^ ((255 * this.g) << 8) ^ ((255 * this.b) << 0)
  36185. },
  36186. getHexString: function () {
  36187. return ('000000' + this.getHex().toString(16)).slice(-6)
  36188. },
  36189. getHSL: function (e) {
  36190. var t,
  36191. i,
  36192. n = e || {
  36193. h: 0,
  36194. s: 0,
  36195. l: 0
  36196. },
  36197. r = this.r,
  36198. o = this.g,
  36199. a = this.b,
  36200. s = Math.max(r, o, a),
  36201. l = Math.min(r, o, a),
  36202. c = (l + s) / 2
  36203. if (l === s) i = t = 0
  36204. else {
  36205. var h = s - l
  36206. switch (((i = c <= 0.5 ? h / (s + l) : h / (2 - s - l)), s)) {
  36207. case r:
  36208. t = (o - a) / h + (o < a ? 6 : 0)
  36209. break
  36210. case o:
  36211. t = (a - r) / h + 2
  36212. break
  36213. case a:
  36214. t = (r - o) / h + 4
  36215. }
  36216. t /= 6
  36217. }
  36218. return (n.h = t), (n.s = i), (n.l = c), n
  36219. },
  36220. getStyle: function () {
  36221. return 'rgb(' + ((255 * this.r) | 0) + ',' + ((255 * this.g) | 0) + ',' + ((255 * this.b) | 0) + ')'
  36222. },
  36223. offsetHSL: function (e, t, i) {
  36224. var n = this.getHSL()
  36225. return (n.h += e), (n.s += t), (n.l += i), this.setHSL(n.h, n.s, n.l), this
  36226. },
  36227. add: function (e) {
  36228. return (this.r += e.r), (this.g += e.g), (this.b += e.b), this
  36229. },
  36230. addColors: function (e, t) {
  36231. return (this.r = e.r + t.r), (this.g = e.g + t.g), (this.b = e.b + t.b), this
  36232. },
  36233. addScalar: function (e) {
  36234. return (this.r += e), (this.g += e), (this.b += e), this
  36235. },
  36236. multiply: function (e) {
  36237. return (this.r *= e.r), (this.g *= e.g), (this.b *= e.b), this
  36238. },
  36239. multiplyScalar: function (e) {
  36240. return (this.r *= e), (this.g *= e), (this.b *= e), this
  36241. },
  36242. lerp: function (e, t) {
  36243. return (this.r += (e.r - this.r) * t), (this.g += (e.g - this.g) * t), (this.b += (e.b - this.b) * t), this
  36244. },
  36245. equals: function (e) {
  36246. return e.r === this.r && e.g === this.g && e.b === this.b
  36247. },
  36248. fromArray: function (e, t) {
  36249. return void 0 === t && (t = 0), (this.r = e[t]), (this.g = e[t + 1]), (this.b = e[t + 2]), this
  36250. },
  36251. toArray: function (e, t) {
  36252. return void 0 === e && (e = []), void 0 === t && (t = 0), (e[t] = this.r), (e[t + 1] = this.g), (e[t + 2] = this.b), e
  36253. }
  36254. }),
  36255. (Ci.ColorKeywords = {
  36256. aliceblue: 15792383,
  36257. antiquewhite: 16444375,
  36258. aqua: 65535,
  36259. aquamarine: 8388564,
  36260. azure: 15794175,
  36261. beige: 16119260,
  36262. bisque: 16770244,
  36263. black: 0,
  36264. blanchedalmond: 16772045,
  36265. blue: 255,
  36266. blueviolet: 9055202,
  36267. brown: 10824234,
  36268. burlywood: 14596231,
  36269. cadetblue: 6266528,
  36270. chartreuse: 8388352,
  36271. chocolate: 13789470,
  36272. coral: 16744272,
  36273. cornflowerblue: 6591981,
  36274. cornsilk: 16775388,
  36275. crimson: 14423100,
  36276. cyan: 65535,
  36277. darkblue: 139,
  36278. darkcyan: 35723,
  36279. darkgoldenrod: 12092939,
  36280. darkgray: 11119017,
  36281. darkgreen: 25600,
  36282. darkgrey: 11119017,
  36283. darkkhaki: 12433259,
  36284. darkmagenta: 9109643,
  36285. darkolivegreen: 5597999,
  36286. darkorange: 16747520,
  36287. darkorchid: 10040012,
  36288. darkred: 9109504,
  36289. darksalmon: 15308410,
  36290. darkseagreen: 9419919,
  36291. darkslateblue: 4734347,
  36292. darkslategray: 3100495,
  36293. darkslategrey: 3100495,
  36294. darkturquoise: 52945,
  36295. darkviolet: 9699539,
  36296. deeppink: 16716947,
  36297. deepskyblue: 49151,
  36298. dimgray: 6908265,
  36299. dimgrey: 6908265,
  36300. dodgerblue: 2003199,
  36301. firebrick: 11674146,
  36302. floralwhite: 16775920,
  36303. forestgreen: 2263842,
  36304. fuchsia: 16711935,
  36305. gainsboro: 14474460,
  36306. ghostwhite: 16316671,
  36307. gold: 16766720,
  36308. goldenrod: 14329120,
  36309. gray: 8421504,
  36310. green: 32768,
  36311. greenyellow: 11403055,
  36312. grey: 8421504,
  36313. honeydew: 15794160,
  36314. hotpink: 16738740,
  36315. indianred: 13458524,
  36316. indigo: 4915330,
  36317. ivory: 16777200,
  36318. khaki: 15787660,
  36319. lavender: 15132410,
  36320. lavenderblush: 16773365,
  36321. lawngreen: 8190976,
  36322. lemonchiffon: 16775885,
  36323. lightblue: 11393254,
  36324. lightcoral: 15761536,
  36325. lightcyan: 14745599,
  36326. lightgoldenrodyellow: 16448210,
  36327. lightgray: 13882323,
  36328. lightgreen: 9498256,
  36329. lightgrey: 13882323,
  36330. lightpink: 16758465,
  36331. lightsalmon: 16752762,
  36332. lightseagreen: 2142890,
  36333. lightskyblue: 8900346,
  36334. lightslategray: 7833753,
  36335. lightslategrey: 7833753,
  36336. lightsteelblue: 11584734,
  36337. lightyellow: 16777184,
  36338. lime: 65280,
  36339. limegreen: 3329330,
  36340. linen: 16445670,
  36341. magenta: 16711935,
  36342. maroon: 8388608,
  36343. mediumaquamarine: 6737322,
  36344. mediumblue: 205,
  36345. mediumorchid: 12211667,
  36346. mediumpurple: 9662683,
  36347. mediumseagreen: 3978097,
  36348. mediumslateblue: 8087790,
  36349. mediumspringgreen: 64154,
  36350. mediumturquoise: 4772300,
  36351. mediumvioletred: 13047173,
  36352. midnightblue: 1644912,
  36353. mintcream: 16121850,
  36354. mistyrose: 16770273,
  36355. moccasin: 16770229,
  36356. navajowhite: 16768685,
  36357. navy: 128,
  36358. oldlace: 16643558,
  36359. olive: 8421376,
  36360. olivedrab: 7048739,
  36361. orange: 16753920,
  36362. orangered: 16729344,
  36363. orchid: 14315734,
  36364. palegoldenrod: 15657130,
  36365. palegreen: 10025880,
  36366. paleturquoise: 11529966,
  36367. palevioletred: 14381203,
  36368. papayawhip: 16773077,
  36369. peachpuff: 16767673,
  36370. peru: 13468991,
  36371. pink: 16761035,
  36372. plum: 14524637,
  36373. powderblue: 11591910,
  36374. purple: 8388736,
  36375. red: 16711680,
  36376. rosybrown: 12357519,
  36377. royalblue: 4286945,
  36378. saddlebrown: 9127187,
  36379. salmon: 16416882,
  36380. sandybrown: 16032864,
  36381. seagreen: 3050327,
  36382. seashell: 16774638,
  36383. sienna: 10506797,
  36384. silver: 12632256,
  36385. skyblue: 8900331,
  36386. slateblue: 6970061,
  36387. slategray: 7372944,
  36388. slategrey: 7372944,
  36389. snow: 16775930,
  36390. springgreen: 65407,
  36391. steelblue: 4620980,
  36392. tan: 13808780,
  36393. teal: 32896,
  36394. thistle: 14204888,
  36395. tomato: 16737095,
  36396. turquoise: 4251856,
  36397. violet: 15631086,
  36398. wheat: 16113331,
  36399. white: 16777215,
  36400. whitesmoke: 16119285,
  36401. yellow: 16776960,
  36402. yellowgreen: 10145074
  36403. }),
  36404. (Ci.Quaternion = function (e, t, i, n) {
  36405. ;(this._x = e || 0), (this._y = t || 0), (this._z = i || 0), (this._w = void 0 !== n ? n : 1)
  36406. }),
  36407. (Ci.Quaternion.prototype = {
  36408. constructor: Ci.Quaternion,
  36409. get x() {
  36410. return this._x
  36411. },
  36412. set x(e) {
  36413. ;(this._x = e), this.onChangeCallback()
  36414. },
  36415. get y() {
  36416. return this._y
  36417. },
  36418. set y(e) {
  36419. ;(this._y = e), this.onChangeCallback()
  36420. },
  36421. get z() {
  36422. return this._z
  36423. },
  36424. set z(e) {
  36425. ;(this._z = e), this.onChangeCallback()
  36426. },
  36427. get w() {
  36428. return this._w
  36429. },
  36430. set w(e) {
  36431. ;(this._w = e), this.onChangeCallback()
  36432. },
  36433. set: function (e, t, i, n) {
  36434. return (this._x = e), (this._y = t), (this._z = i), (this._w = n), this.onChangeCallback(), this
  36435. },
  36436. clone: function () {
  36437. return new this.constructor(this._x, this._y, this._z, this._w)
  36438. },
  36439. toObject: function () {
  36440. //add
  36441. return { x: this.x, y: this.y, z: this.z, w: this.w }
  36442. },
  36443. copy: function (e) {
  36444. return (this._x = e.x), (this._y = e.y), (this._z = e.z), (this._w = e.w), this.onChangeCallback(), this
  36445. },
  36446. setFromEuler: function (e, t) {
  36447. if (e instanceof Ci.Euler == 0) throw new Error('THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.')
  36448. var i = Math.cos(e._x / 2),
  36449. n = Math.cos(e._y / 2),
  36450. r = Math.cos(e._z / 2),
  36451. o = Math.sin(e._x / 2),
  36452. a = Math.sin(e._y / 2),
  36453. s = Math.sin(e._z / 2),
  36454. l = e.order
  36455. return (
  36456. 'XYZ' === l
  36457. ? ((this._x = o * n * r + i * a * s), (this._y = i * a * r - o * n * s), (this._z = i * n * s + o * a * r), (this._w = i * n * r - o * a * s))
  36458. : 'YXZ' === l
  36459. ? ((this._x = o * n * r + i * a * s), (this._y = i * a * r - o * n * s), (this._z = i * n * s - o * a * r), (this._w = i * n * r + o * a * s))
  36460. : 'ZXY' === l
  36461. ? ((this._x = o * n * r - i * a * s), (this._y = i * a * r + o * n * s), (this._z = i * n * s + o * a * r), (this._w = i * n * r - o * a * s))
  36462. : 'ZYX' === l
  36463. ? ((this._x = o * n * r - i * a * s), (this._y = i * a * r + o * n * s), (this._z = i * n * s - o * a * r), (this._w = i * n * r + o * a * s))
  36464. : 'YZX' === l
  36465. ? ((this._x = o * n * r + i * a * s), (this._y = i * a * r + o * n * s), (this._z = i * n * s - o * a * r), (this._w = i * n * r - o * a * s))
  36466. : 'XZY' === l && ((this._x = o * n * r - i * a * s), (this._y = i * a * r - o * n * s), (this._z = i * n * s + o * a * r), (this._w = i * n * r + o * a * s)),
  36467. !1 !== t && this.onChangeCallback(),
  36468. this
  36469. )
  36470. },
  36471. setFromAxisAngle: function (e, t) {
  36472. var i = t / 2,
  36473. n = Math.sin(i)
  36474. return (this._x = e.x * n), (this._y = e.y * n), (this._z = e.z * n), (this._w = Math.cos(i)), this.onChangeCallback(), this
  36475. },
  36476. setFromRotationMatrix: function (e) {
  36477. var t,
  36478. i = e.elements,
  36479. n = i[0],
  36480. r = i[4],
  36481. o = i[8],
  36482. a = i[1],
  36483. s = i[5],
  36484. l = i[9],
  36485. c = i[2],
  36486. h = i[6],
  36487. u = i[10],
  36488. d = n + s + u
  36489. return (
  36490. 0 < d
  36491. ? ((t = 0.5 / Math.sqrt(d + 1)), (this._w = 0.25 / t), (this._x = (h - l) * t), (this._y = (o - c) * t), (this._z = (a - r) * t))
  36492. : s < n && u < n
  36493. ? ((t = 2 * Math.sqrt(1 + n - s - u)), (this._w = (h - l) / t), (this._x = 0.25 * t), (this._y = (r + a) / t), (this._z = (o + c) / t))
  36494. : u < s
  36495. ? ((t = 2 * Math.sqrt(1 + s - n - u)), (this._w = (o - c) / t), (this._x = (r + a) / t), (this._y = 0.25 * t), (this._z = (l + h) / t))
  36496. : ((t = 2 * Math.sqrt(1 + u - n - s)), (this._w = (a - r) / t), (this._x = (o + c) / t), (this._y = (l + h) / t), (this._z = 0.25 * t)),
  36497. this.onChangeCallback(),
  36498. this
  36499. )
  36500. },
  36501. setFromUnitVectors: function (e, t) {
  36502. return (
  36503. void 0 === Be && (Be = new Ci.Vector3()),
  36504. (Ve = e.dot(t) + 1) < 1e-6 ? ((Ve = 0), Math.abs(e.x) > Math.abs(e.z) ? Be.set(-e.y, e.x, 0) : Be.set(0, -e.z, e.y)) : Be.crossVectors(e, t),
  36505. (this._x = Be.x),
  36506. (this._y = Be.y),
  36507. (this._z = Be.z),
  36508. (this._w = Ve),
  36509. this.normalize(),
  36510. this
  36511. )
  36512. },
  36513. inverse: function () {
  36514. return this.conjugate().normalize(), this
  36515. },
  36516. conjugate: function () {
  36517. return (this._x *= -1), (this._y *= -1), (this._z *= -1), this.onChangeCallback(), this
  36518. },
  36519. dot: function (e) {
  36520. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  36521. },
  36522. lengthSq: function () {
  36523. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  36524. },
  36525. length: function () {
  36526. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  36527. },
  36528. normalize: function () {
  36529. var e = this.length()
  36530. return (
  36531. 0 === e
  36532. ? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1))
  36533. : ((e = 1 / e), (this._x = this._x * e), (this._y = this._y * e), (this._z = this._z * e), (this._w = this._w * e)),
  36534. this.onChangeCallback(),
  36535. this
  36536. )
  36537. },
  36538. multiply: function (e, t) {
  36539. return void 0 !== t
  36540. ? (console.warn('THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.'), this.multiplyQuaternions(e, t))
  36541. : this.multiplyQuaternions(this, e)
  36542. },
  36543. multiplyQuaternions: function (e, t) {
  36544. var i = e._x,
  36545. n = e._y,
  36546. r = e._z,
  36547. o = e._w,
  36548. a = t._x,
  36549. s = t._y,
  36550. l = t._z,
  36551. c = t._w
  36552. return (
  36553. (this._x = i * c + o * a + n * l - r * s),
  36554. (this._y = n * c + o * s + r * a - i * l),
  36555. (this._z = r * c + o * l + i * s - n * a),
  36556. (this._w = o * c - i * a - n * s - r * l),
  36557. this.onChangeCallback(),
  36558. this
  36559. )
  36560. },
  36561. slerp: function (e, t) {
  36562. if (0 === t) return this
  36563. if (1 === t) return this.copy(e)
  36564. var i = this._x,
  36565. n = this._y,
  36566. r = this._z,
  36567. o = this._w,
  36568. a = o * e._w + i * e._x + n * e._y + r * e._z
  36569. if ((a < 0 ? ((this._w = -e._w), (this._x = -e._x), (this._y = -e._y), (this._z = -e._z), (a = -a)) : this.copy(e), 1 <= a))
  36570. return (this._w = o), (this._x = i), (this._y = n), (this._z = r), this
  36571. var s = Math.sqrt(1 - a * a)
  36572. if (Math.abs(s) < 0.001) return (this._w = 0.5 * (o + this._w)), (this._x = 0.5 * (i + this._x)), (this._y = 0.5 * (n + this._y)), (this._z = 0.5 * (r + this._z)), this
  36573. var l = Math.atan2(s, a),
  36574. c = Math.sin((1 - t) * l) / s,
  36575. h = Math.sin(t * l) / s
  36576. return (this._w = o * c + this._w * h), (this._x = i * c + this._x * h), (this._y = n * c + this._y * h), (this._z = r * c + this._z * h), this.onChangeCallback(), this
  36577. },
  36578. equals: function (e) {
  36579. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  36580. },
  36581. fromArray: function (e, t) {
  36582. return void 0 === t && (t = 0), (this._x = e[t]), (this._y = e[t + 1]), (this._z = e[t + 2]), (this._w = e[t + 3]), this.onChangeCallback(), this
  36583. },
  36584. toArray: function (e, t) {
  36585. return void 0 === e && (e = []), void 0 === t && (t = 0), (e[t] = this._x), (e[t + 1] = this._y), (e[t + 2] = this._z), (e[t + 3] = this._w), e
  36586. },
  36587. onChange: function (e) {
  36588. return (this.onChangeCallback = e), this
  36589. },
  36590. onChangeCallback: function () {}
  36591. }),
  36592. Object.assign(Ci.Quaternion, {
  36593. slerp: function (e, t, i, n) {
  36594. return i.copy(e).slerp(t, n)
  36595. },
  36596. slerpFlat: function (e, t, i, n, r, o, a) {
  36597. var s = i[n + 0],
  36598. l = i[n + 1],
  36599. c = i[n + 2],
  36600. h = i[n + 3],
  36601. u = r[o + 0],
  36602. d = r[o + 1],
  36603. p = r[o + 2],
  36604. f = r[o + 3]
  36605. if (h !== f || s !== u || l !== d || c !== p) {
  36606. var g = 1 - a,
  36607. m = s * u + l * d + c * p + h * f,
  36608. v = 0 <= m ? 1 : -1,
  36609. y = 1 - m * m
  36610. if (y > Number.EPSILON) {
  36611. var A = Math.sqrt(y),
  36612. C = Math.atan2(A, m * v)
  36613. ;(g = Math.sin(g * C) / A), (a = Math.sin(a * C) / A)
  36614. }
  36615. var I = a * v
  36616. if (((s = s * g + u * I), (l = l * g + d * I), (c = c * g + p * I), (h = h * g + f * I), g === 1 - a)) {
  36617. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h)
  36618. ;(s *= E), (l *= E), (c *= E), (h *= E)
  36619. }
  36620. }
  36621. ;(e[t] = s), (e[t + 1] = l), (e[t + 2] = c), (e[t + 3] = h)
  36622. }
  36623. }),
  36624. (Ci.Vector2 = function (e, t) {
  36625. ;(this.x = e || 0), (this.y = t || 0)
  36626. }),
  36627. (Ci.Vector2.prototype = {
  36628. constructor: Ci.Vector2,
  36629. get width() {
  36630. return this.x
  36631. },
  36632. set width(e) {
  36633. this.x = e
  36634. },
  36635. get height() {
  36636. return this.y
  36637. },
  36638. set height(e) {
  36639. this.y = e
  36640. },
  36641. set: function (e, t) {
  36642. return (this.x = e), (this.y = t), this
  36643. },
  36644. setScalar: function (e) {
  36645. return (this.x = e), (this.y = e), this
  36646. },
  36647. setX: function (e) {
  36648. return (this.x = e), this
  36649. },
  36650. setY: function (e) {
  36651. return (this.y = e), this
  36652. },
  36653. setComponent: function (e, t) {
  36654. switch (e) {
  36655. case 0:
  36656. this.x = t
  36657. break
  36658. case 1:
  36659. this.y = t
  36660. break
  36661. default:
  36662. throw new Error('index is out of range: ' + e)
  36663. }
  36664. },
  36665. getComponent: function (e) {
  36666. switch (e) {
  36667. case 0:
  36668. return this.x
  36669. case 1:
  36670. return this.y
  36671. default:
  36672. throw new Error('index is out of range: ' + e)
  36673. }
  36674. },
  36675. clone: function () {
  36676. return new this.constructor(this.x, this.y)
  36677. },
  36678. copy: function (e) {
  36679. return (this.x = e.x), (this.y = e.y), this
  36680. },
  36681. add: function (e, t) {
  36682. return void 0 !== t
  36683. ? (console.warn('THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'), this.addVectors(e, t))
  36684. : ((this.x += e.x), (this.y += e.y), this)
  36685. },
  36686. addScalar: function (e) {
  36687. return (this.x += e), (this.y += e), this
  36688. },
  36689. addVectors: function (e, t) {
  36690. return (this.x = e.x + t.x), (this.y = e.y + t.y), this
  36691. },
  36692. addScaledVector: function (e, t) {
  36693. return (this.x += e.x * t), (this.y += e.y * t), this
  36694. },
  36695. sub: function (e, t) {
  36696. return void 0 !== t
  36697. ? (console.warn('THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'), this.subVectors(e, t))
  36698. : ((this.x -= e.x), (this.y -= e.y), this)
  36699. },
  36700. subScalar: function (e) {
  36701. return (this.x -= e), (this.y -= e), this
  36702. },
  36703. subVectors: function (e, t) {
  36704. return (this.x = e.x - t.x), (this.y = e.y - t.y), this
  36705. },
  36706. multiply: function (e) {
  36707. return (this.x *= e.x), (this.y *= e.y), this
  36708. },
  36709. multiplyScalar: function (e) {
  36710. return isFinite(e) ? ((this.x *= e), (this.y *= e)) : ((this.x = 0), (this.y = 0)), this
  36711. },
  36712. divide: function (e) {
  36713. return (this.x /= e.x), (this.y /= e.y), this
  36714. },
  36715. divideScalar: function (e) {
  36716. return this.multiplyScalar(1 / e)
  36717. },
  36718. min: function (e) {
  36719. return (this.x = Math.min(this.x, e.x)), (this.y = Math.min(this.y, e.y)), this
  36720. },
  36721. max: function (e) {
  36722. return (this.x = Math.max(this.x, e.x)), (this.y = Math.max(this.y, e.y)), this
  36723. },
  36724. clamp: function (e, t) {
  36725. return (this.x = Math.max(e.x, Math.min(t.x, this.x))), (this.y = Math.max(e.y, Math.min(t.y, this.y))), this
  36726. },
  36727. clampScalar: function (e, t) {
  36728. return void 0 === Ne && ((Ne = new Ci.Vector2()), (Fe = new Ci.Vector2())), Ne.set(e, e), Fe.set(t, t), this.clamp(Ne, Fe)
  36729. },
  36730. clampLength: function (e, t) {
  36731. var i = this.length()
  36732. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i), this
  36733. },
  36734. floor: function () {
  36735. return (this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), this
  36736. },
  36737. ceil: function () {
  36738. return (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), this
  36739. },
  36740. round: function () {
  36741. return (this.x = Math.round(this.x)), (this.y = Math.round(this.y)), this
  36742. },
  36743. roundToZero: function () {
  36744. return (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)), (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)), this
  36745. },
  36746. negate: function () {
  36747. return (this.x = -this.x), (this.y = -this.y), this
  36748. },
  36749. dot: function (e) {
  36750. return this.x * e.x + this.y * e.y
  36751. },
  36752. lengthSq: function () {
  36753. return this.x * this.x + this.y * this.y
  36754. },
  36755. length: function () {
  36756. return Math.sqrt(this.x * this.x + this.y * this.y)
  36757. },
  36758. lengthManhattan: function () {
  36759. return Math.abs(this.x) + Math.abs(this.y)
  36760. },
  36761. normalize: function () {
  36762. return this.divideScalar(this.length())
  36763. },
  36764. angle: function () {
  36765. var e = Math.atan2(this.y, this.x)
  36766. return e < 0 && (e += 2 * Math.PI), e
  36767. },
  36768. distanceTo: function (e) {
  36769. return Math.sqrt(this.distanceToSquared(e))
  36770. },
  36771. distanceToSquared: function (e) {
  36772. var t = this.x - e.x,
  36773. i = this.y - e.y
  36774. return t * t + i * i
  36775. },
  36776. setLength: function (e) {
  36777. return this.multiplyScalar(e / this.length())
  36778. },
  36779. lerp: function (e, t) {
  36780. return (this.x += (e.x - this.x) * t), (this.y += (e.y - this.y) * t), this
  36781. },
  36782. lerpVectors: function (e, t, i) {
  36783. return this.subVectors(t, e).multiplyScalar(i).add(e), this
  36784. },
  36785. equals: function (e) {
  36786. return e.x === this.x && e.y === this.y
  36787. },
  36788. fromArray: function (e, t) {
  36789. return void 0 === t && (t = 0), (this.x = e[t]), (this.y = e[t + 1]), this
  36790. },
  36791. toArray: function (e, t) {
  36792. return void 0 === e && (e = []), void 0 === t && (t = 0), (e[t] = this.x), (e[t + 1] = this.y), e
  36793. },
  36794. fromAttribute: function (e, t, i) {
  36795. return void 0 === i && (i = 0), (t = t * e.itemSize + i), (this.x = e.array[t]), (this.y = e.array[t + 1]), this
  36796. },
  36797. rotateAround: function (e, t) {
  36798. var i = Math.cos(t),
  36799. n = Math.sin(t),
  36800. r = this.x - e.x,
  36801. o = this.y - e.y
  36802. return (this.x = r * i - o * n + e.x), (this.y = r * n + o * i + e.y), this
  36803. }
  36804. }),
  36805. (Ci.Vector3 = function (e, t, i) {
  36806. ;(this.x = e || 0), (this.y = t || 0), (this.z = i || 0)
  36807. }),
  36808. (Ci.Vector3.prototype = {
  36809. constructor: Ci.Vector3,
  36810. set: function (e, t, i) {
  36811. return (this.x = e), (this.y = t), (this.z = i), this
  36812. },
  36813. setScalar: function (e) {
  36814. return (this.x = e), (this.y = e), (this.z = e), this
  36815. },
  36816. setX: function (e) {
  36817. return (this.x = e), this
  36818. },
  36819. setY: function (e) {
  36820. return (this.y = e), this
  36821. },
  36822. setZ: function (e) {
  36823. return (this.z = e), this
  36824. },
  36825. setComponent: function (e, t) {
  36826. switch (e) {
  36827. case 0:
  36828. this.x = t
  36829. break
  36830. case 1:
  36831. this.y = t
  36832. break
  36833. case 2:
  36834. this.z = t
  36835. break
  36836. default:
  36837. throw new Error('index is out of range: ' + e)
  36838. }
  36839. },
  36840. getComponent: function (e) {
  36841. switch (e) {
  36842. case 0:
  36843. return this.x
  36844. case 1:
  36845. return this.y
  36846. case 2:
  36847. return this.z
  36848. default:
  36849. throw new Error('index is out of range: ' + e)
  36850. }
  36851. },
  36852. clone: function () {
  36853. return new this.constructor(this.x, this.y, this.z)
  36854. },
  36855. copy: function (e) {
  36856. return (this.x = e.x), (this.y = e.y), (this.z = e.z), this
  36857. },
  36858. add: function (e, t) {
  36859. return void 0 !== t
  36860. ? (console.warn('THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'), this.addVectors(e, t))
  36861. : ((this.x += e.x), (this.y += e.y), (this.z += e.z), this)
  36862. },
  36863. addScalar: function (e) {
  36864. return (this.x += e), (this.y += e), (this.z += e), this
  36865. },
  36866. addVectors: function (e, t) {
  36867. return (this.x = e.x + t.x), (this.y = e.y + t.y), (this.z = e.z + t.z), this
  36868. },
  36869. addScaledVector: function (e, t) {
  36870. return (this.x += e.x * t), (this.y += e.y * t), (this.z += e.z * t), this
  36871. },
  36872. sub: function (e, t) {
  36873. return void 0 !== t
  36874. ? (console.warn('THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'), this.subVectors(e, t))
  36875. : ((this.x -= e.x), (this.y -= e.y), (this.z -= e.z), this)
  36876. },
  36877. subScalar: function (e) {
  36878. return (this.x -= e), (this.y -= e), (this.z -= e), this
  36879. },
  36880. subVectors: function (e, t) {
  36881. return (this.x = e.x - t.x), (this.y = e.y - t.y), (this.z = e.z - t.z), this
  36882. },
  36883. multiply: function (e, t) {
  36884. return void 0 !== t
  36885. ? (console.warn('THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.'), this.multiplyVectors(e, t))
  36886. : ((this.x *= e.x), (this.y *= e.y), (this.z *= e.z), this)
  36887. },
  36888. multiplyScalar: function (e) {
  36889. return isFinite(e) ? ((this.x *= e), (this.y *= e), (this.z *= e)) : ((this.x = 0), (this.y = 0), (this.z = 0)), this
  36890. },
  36891. multiplyVectors: function (e, t) {
  36892. return (this.x = e.x * t.x), (this.y = e.y * t.y), (this.z = e.z * t.z), this
  36893. },
  36894. applyEuler: function (e) {
  36895. return (
  36896. e instanceof Ci.Euler == 0 && console.error('THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.'),
  36897. void 0 === De && (De = new Ci.Quaternion()),
  36898. this.applyQuaternion(De.setFromEuler(e)),
  36899. this
  36900. )
  36901. },
  36902. applyAxisAngle: function (e, t) {
  36903. return void 0 === Le && (Le = new Ci.Quaternion()), this.applyQuaternion(Le.setFromAxisAngle(e, t)), this
  36904. },
  36905. applyMatrix3: function (e) {
  36906. var t = this.x,
  36907. i = this.y,
  36908. n = this.z,
  36909. r = e.elements
  36910. return (this.x = r[0] * t + r[3] * i + r[6] * n), (this.y = r[1] * t + r[4] * i + r[7] * n), (this.z = r[2] * t + r[5] * i + r[8] * n), this
  36911. },
  36912. applyMatrix4: function (e) {
  36913. var t = this.x,
  36914. i = this.y,
  36915. n = this.z,
  36916. r = e.elements
  36917. return (this.x = r[0] * t + r[4] * i + r[8] * n + r[12]), (this.y = r[1] * t + r[5] * i + r[9] * n + r[13]), (this.z = r[2] * t + r[6] * i + r[10] * n + r[14]), this
  36918. },
  36919. applyProjection: function (e) {
  36920. var t = this.x,
  36921. i = this.y,
  36922. n = this.z,
  36923. r = e.elements,
  36924. o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15])
  36925. return (this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o), (this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o), (this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o), this
  36926. },
  36927. applyQuaternion: function (e) {
  36928. var t = this.x,
  36929. i = this.y,
  36930. n = this.z,
  36931. r = e.x,
  36932. o = e.y,
  36933. a = e.z,
  36934. s = e.w,
  36935. l = s * t + o * n - a * i,
  36936. c = s * i + a * t - r * n,
  36937. h = s * n + r * i - o * t,
  36938. u = -r * t - o * i - a * n
  36939. return (this.x = l * s + u * -r + c * -a - h * -o), (this.y = c * s + u * -o + h * -r - l * -a), (this.z = h * s + u * -a + l * -o - c * -r), this
  36940. },
  36941. project: function (e) {
  36942. return void 0 === Oe && (Oe = new Ci.Matrix4()), Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)), this.applyProjection(Oe)
  36943. },
  36944. unproject: function (e) {
  36945. return void 0 === Pe && (Pe = new Ci.Matrix4()), Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)), this.applyProjection(Pe)
  36946. },
  36947. transformDirection: function (e) {
  36948. var t = this.x,
  36949. i = this.y,
  36950. n = this.z,
  36951. r = e.elements
  36952. return (this.x = r[0] * t + r[4] * i + r[8] * n), (this.y = r[1] * t + r[5] * i + r[9] * n), (this.z = r[2] * t + r[6] * i + r[10] * n), this.normalize(), this
  36953. },
  36954. divide: function (e) {
  36955. return (this.x /= e.x), (this.y /= e.y), (this.z /= e.z), this
  36956. },
  36957. divideScalar: function (e) {
  36958. return this.multiplyScalar(1 / e)
  36959. },
  36960. min: function (e) {
  36961. return (this.x = Math.min(this.x, e.x)), (this.y = Math.min(this.y, e.y)), (this.z = Math.min(this.z, e.z)), this
  36962. },
  36963. max: function (e) {
  36964. return (this.x = Math.max(this.x, e.x)), (this.y = Math.max(this.y, e.y)), (this.z = Math.max(this.z, e.z)), this
  36965. },
  36966. clamp: function (e, t) {
  36967. return (this.x = Math.max(e.x, Math.min(t.x, this.x))), (this.y = Math.max(e.y, Math.min(t.y, this.y))), (this.z = Math.max(e.z, Math.min(t.z, this.z))), this
  36968. },
  36969. clampScalar: function (e, t) {
  36970. return void 0 === Me && ((Me = new Ci.Vector3()), (Re = new Ci.Vector3())), Me.set(e, e, e), Re.set(t, t, t), this.clamp(Me, Re)
  36971. },
  36972. clampLength: function (e, t) {
  36973. var i = this.length()
  36974. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i), this
  36975. },
  36976. floor: function () {
  36977. return (this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), (this.z = Math.floor(this.z)), this
  36978. },
  36979. ceil: function () {
  36980. return (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), (this.z = Math.ceil(this.z)), this
  36981. },
  36982. round: function () {
  36983. return (this.x = Math.round(this.x)), (this.y = Math.round(this.y)), (this.z = Math.round(this.z)), this
  36984. },
  36985. roundToZero: function () {
  36986. return (
  36987. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  36988. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  36989. (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
  36990. this
  36991. )
  36992. },
  36993. negate: function () {
  36994. return (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), this
  36995. },
  36996. dot: function (e) {
  36997. return this.x * e.x + this.y * e.y + this.z * e.z
  36998. },
  36999. lengthSq: function () {
  37000. return this.x * this.x + this.y * this.y + this.z * this.z
  37001. },
  37002. length: function () {
  37003. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  37004. },
  37005. lengthManhattan: function () {
  37006. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  37007. },
  37008. normalize: function () {
  37009. return this.divideScalar(this.length())
  37010. },
  37011. setLength: function (e) {
  37012. return this.multiplyScalar(e / this.length())
  37013. },
  37014. lerp: function (e, t) {
  37015. return (this.x += (e.x - this.x) * t), (this.y += (e.y - this.y) * t), (this.z += (e.z - this.z) * t), this
  37016. },
  37017. lerpVectors: function (e, t, i) {
  37018. return this.subVectors(t, e).multiplyScalar(i).add(e), this
  37019. },
  37020. cross: function (e, t) {
  37021. if (void 0 !== t) return console.warn('THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.'), this.crossVectors(e, t)
  37022. var i = this.x,
  37023. n = this.y,
  37024. r = this.z
  37025. return (this.x = n * e.z - r * e.y), (this.y = r * e.x - i * e.z), (this.z = i * e.y - n * e.x), this
  37026. },
  37027. crossVectors: function (e, t) {
  37028. var i = e.x,
  37029. n = e.y,
  37030. r = e.z,
  37031. o = t.x,
  37032. a = t.y,
  37033. s = t.z
  37034. return (this.x = n * s - r * a), (this.y = r * o - i * s), (this.z = i * a - n * o), this
  37035. },
  37036. projectOnVector: function (e) {
  37037. return void 0 === xe && (xe = new Ci.Vector3()), xe.copy(e).normalize(), (Se = this.dot(xe)), this.copy(xe).multiplyScalar(Se)
  37038. },
  37039. projectOnPlane: function (e) {
  37040. return void 0 === Te && (Te = new Ci.Vector3()), Te.copy(this).projectOnVector(e), this.sub(Te)
  37041. },
  37042. reflect: function (e) {
  37043. return void 0 === we && (we = new Ci.Vector3()), this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  37044. },
  37045. angleTo: function (e) {
  37046. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq())
  37047. return Math.acos(Ci.Math.clamp(t, -1, 1))
  37048. },
  37049. distanceTo: function (e) {
  37050. return Math.sqrt(this.distanceToSquared(e))
  37051. },
  37052. distanceToSquared: function (e) {
  37053. var t = this.x - e.x,
  37054. i = this.y - e.y,
  37055. n = this.z - e.z
  37056. return t * t + i * i + n * n
  37057. },
  37058. setFromSpherical: function (e) {
  37059. var t = Math.sin(e.phi) * e.radius
  37060. return (this.x = t * Math.sin(e.theta)), (this.y = Math.cos(e.phi) * e.radius), (this.z = t * Math.cos(e.theta)), this
  37061. },
  37062. setFromMatrixPosition: function (e) {
  37063. return this.setFromMatrixColumn(e, 3)
  37064. },
  37065. setFromMatrixScale: function (e) {
  37066. var t = this.setFromMatrixColumn(e, 0).length(),
  37067. i = this.setFromMatrixColumn(e, 1).length(),
  37068. n = this.setFromMatrixColumn(e, 2).length()
  37069. return (this.x = t), (this.y = i), (this.z = n), this
  37070. },
  37071. setFromMatrixColumn: function (e, t) {
  37072. return 'number' == typeof e && (console.warn('THREE.Vector3: setFromMatrixColumn now expects ( matrix, index ).'), (t = e = t)), this.fromArray(e.elements, 4 * t)
  37073. },
  37074. equals: function (e) {
  37075. return e.x === this.x && e.y === this.y && e.z === this.z
  37076. },
  37077. fromArray: function (e, t) {
  37078. return void 0 === t && (t = 0), (this.x = e[t]), (this.y = e[t + 1]), (this.z = e[t + 2]), this
  37079. },
  37080. toArray: function (e, t) {
  37081. return void 0 === e && (e = []), void 0 === t && (t = 0), (e[t] = this.x), (e[t + 1] = this.y), (e[t + 2] = this.z), e
  37082. },
  37083. fromAttribute: function (e, t, i) {
  37084. return void 0 === i && (i = 0), (t = t * e.itemSize + i), (this.x = e.array[t]), (this.y = e.array[t + 1]), (this.z = e.array[t + 2]), this
  37085. }
  37086. }),
  37087. (Ci.Vector4 = function (e, t, i, n) {
  37088. ;(this.x = e || 0), (this.y = t || 0), (this.z = i || 0), (this.w = void 0 !== n ? n : 1)
  37089. }),
  37090. (Ci.Vector4.prototype = {
  37091. constructor: Ci.Vector4,
  37092. set: function (e, t, i, n) {
  37093. return (this.x = e), (this.y = t), (this.z = i), (this.w = n), this
  37094. },
  37095. setScalar: function (e) {
  37096. return (this.x = e), (this.y = e), (this.z = e), (this.w = e), this
  37097. },
  37098. setX: function (e) {
  37099. return (this.x = e), this
  37100. },
  37101. setY: function (e) {
  37102. return (this.y = e), this
  37103. },
  37104. setZ: function (e) {
  37105. return (this.z = e), this
  37106. },
  37107. setW: function (e) {
  37108. return (this.w = e), this
  37109. },
  37110. setComponent: function (e, t) {
  37111. switch (e) {
  37112. case 0:
  37113. this.x = t
  37114. break
  37115. case 1:
  37116. this.y = t
  37117. break
  37118. case 2:
  37119. this.z = t
  37120. break
  37121. case 3:
  37122. this.w = t
  37123. break
  37124. default:
  37125. throw new Error('index is out of range: ' + e)
  37126. }
  37127. },
  37128. getComponent: function (e) {
  37129. switch (e) {
  37130. case 0:
  37131. return this.x
  37132. case 1:
  37133. return this.y
  37134. case 2:
  37135. return this.z
  37136. case 3:
  37137. return this.w
  37138. default:
  37139. throw new Error('index is out of range: ' + e)
  37140. }
  37141. },
  37142. clone: function () {
  37143. return new this.constructor(this.x, this.y, this.z, this.w)
  37144. },
  37145. copy: function (e) {
  37146. return (this.x = e.x), (this.y = e.y), (this.z = e.z), (this.w = void 0 !== e.w ? e.w : 1), this
  37147. },
  37148. add: function (e, t) {
  37149. return void 0 !== t
  37150. ? (console.warn('THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'), this.addVectors(e, t))
  37151. : ((this.x += e.x), (this.y += e.y), (this.z += e.z), (this.w += e.w), this)
  37152. },
  37153. addScalar: function (e) {
  37154. return (this.x += e), (this.y += e), (this.z += e), (this.w += e), this
  37155. },
  37156. addVectors: function (e, t) {
  37157. return (this.x = e.x + t.x), (this.y = e.y + t.y), (this.z = e.z + t.z), (this.w = e.w + t.w), this
  37158. },
  37159. addScaledVector: function (e, t) {
  37160. return (this.x += e.x * t), (this.y += e.y * t), (this.z += e.z * t), (this.w += e.w * t), this
  37161. },
  37162. sub: function (e, t) {
  37163. return void 0 !== t
  37164. ? (console.warn('THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'), this.subVectors(e, t))
  37165. : ((this.x -= e.x), (this.y -= e.y), (this.z -= e.z), (this.w -= e.w), this)
  37166. },
  37167. subScalar: function (e) {
  37168. return (this.x -= e), (this.y -= e), (this.z -= e), (this.w -= e), this
  37169. },
  37170. subVectors: function (e, t) {
  37171. return (this.x = e.x - t.x), (this.y = e.y - t.y), (this.z = e.z - t.z), (this.w = e.w - t.w), this
  37172. },
  37173. multiplyScalar: function (e) {
  37174. return isFinite(e) ? ((this.x *= e), (this.y *= e), (this.z *= e), (this.w *= e)) : ((this.x = 0), (this.y = 0), (this.z = 0), (this.w = 0)), this
  37175. },
  37176. applyMatrix4: function (e) {
  37177. var t = this.x,
  37178. i = this.y,
  37179. n = this.z,
  37180. r = this.w,
  37181. o = e.elements
  37182. return (
  37183. (this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r),
  37184. (this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r),
  37185. (this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r),
  37186. (this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r),
  37187. this
  37188. )
  37189. },
  37190. divideScalar: function (e) {
  37191. return this.multiplyScalar(1 / e)
  37192. },
  37193. setAxisAngleFromQuaternion: function (e) {
  37194. this.w = 2 * Math.acos(e.w)
  37195. var t = Math.sqrt(1 - e.w * e.w)
  37196. return t < 1e-4 ? ((this.x = 1), (this.y = 0), (this.z = 0)) : ((this.x = e.x / t), (this.y = e.y / t), (this.z = e.z / t)), this
  37197. },
  37198. setAxisAngleFromRotationMatrix: function (e) {
  37199. var t,
  37200. i,
  37201. n,
  37202. r,
  37203. o = e.elements,
  37204. a = o[0],
  37205. s = o[4],
  37206. l = o[8],
  37207. c = o[1],
  37208. h = o[5],
  37209. u = o[9],
  37210. d = o[2],
  37211. p = o[6],
  37212. f = o[10]
  37213. if (Math.abs(s - c) < 0.01 && Math.abs(l - d) < 0.01 && Math.abs(u - p) < 0.01) {
  37214. if (Math.abs(s + c) < 0.1 && Math.abs(l + d) < 0.1 && Math.abs(u + p) < 0.1 && Math.abs(a + h + f - 3) < 0.1) return this.set(1, 0, 0, 0), this
  37215. t = Math.PI
  37216. var g = (a + 1) / 2,
  37217. m = (h + 1) / 2,
  37218. v = (f + 1) / 2,
  37219. y = (s + c) / 4,
  37220. A = (l + d) / 4,
  37221. C = (u + p) / 4
  37222. return (
  37223. m < g && v < g
  37224. ? (r = g < 0.01 ? ((i = 0), (n = 0.707106781)) : ((n = y / (i = Math.sqrt(g))), A / i))
  37225. : v < m
  37226. ? (r = m < 0.01 ? ((n = 0), (i = 0.707106781)) : ((i = y / (n = Math.sqrt(m))), C / n))
  37227. : v < 0.01
  37228. ? ((n = i = 0.707106781), (r = 0))
  37229. : ((i = A / (r = Math.sqrt(v))), (n = C / r)),
  37230. this.set(i, n, r, t),
  37231. this
  37232. )
  37233. }
  37234. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s))
  37235. return Math.abs(I) < 0.001 && (I = 1), (this.x = (p - u) / I), (this.y = (l - d) / I), (this.z = (c - s) / I), (this.w = Math.acos((a + h + f - 1) / 2)), this
  37236. },
  37237. min: function (e) {
  37238. return (this.x = Math.min(this.x, e.x)), (this.y = Math.min(this.y, e.y)), (this.z = Math.min(this.z, e.z)), (this.w = Math.min(this.w, e.w)), this
  37239. },
  37240. max: function (e) {
  37241. return (this.x = Math.max(this.x, e.x)), (this.y = Math.max(this.y, e.y)), (this.z = Math.max(this.z, e.z)), (this.w = Math.max(this.w, e.w)), this
  37242. },
  37243. clamp: function (e, t) {
  37244. return (
  37245. (this.x = Math.max(e.x, Math.min(t.x, this.x))),
  37246. (this.y = Math.max(e.y, Math.min(t.y, this.y))),
  37247. (this.z = Math.max(e.z, Math.min(t.z, this.z))),
  37248. (this.w = Math.max(e.w, Math.min(t.w, this.w))),
  37249. this
  37250. )
  37251. },
  37252. clampScalar: function (e, t) {
  37253. return void 0 === _e && ((_e = new Ci.Vector4()), (be = new Ci.Vector4())), _e.set(e, e, e, e), be.set(t, t, t, t), this.clamp(_e, be)
  37254. },
  37255. floor: function () {
  37256. return (this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), (this.z = Math.floor(this.z)), (this.w = Math.floor(this.w)), this
  37257. },
  37258. ceil: function () {
  37259. return (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), (this.z = Math.ceil(this.z)), (this.w = Math.ceil(this.w)), this
  37260. },
  37261. round: function () {
  37262. return (this.x = Math.round(this.x)), (this.y = Math.round(this.y)), (this.z = Math.round(this.z)), (this.w = Math.round(this.w)), this
  37263. },
  37264. roundToZero: function () {
  37265. return (
  37266. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  37267. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  37268. (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
  37269. (this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w)),
  37270. this
  37271. )
  37272. },
  37273. negate: function () {
  37274. return (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), (this.w = -this.w), this
  37275. },
  37276. dot: function (e) {
  37277. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  37278. },
  37279. lengthSq: function () {
  37280. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  37281. },
  37282. length: function () {
  37283. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  37284. },
  37285. lengthManhattan: function () {
  37286. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  37287. },
  37288. normalize: function () {
  37289. return this.divideScalar(this.length())
  37290. },
  37291. setLength: function (e) {
  37292. return this.multiplyScalar(e / this.length())
  37293. },
  37294. lerp: function (e, t) {
  37295. return (this.x += (e.x - this.x) * t), (this.y += (e.y - this.y) * t), (this.z += (e.z - this.z) * t), (this.w += (e.w - this.w) * t), this
  37296. },
  37297. lerpVectors: function (e, t, i) {
  37298. return this.subVectors(t, e).multiplyScalar(i).add(e), this
  37299. },
  37300. equals: function (e) {
  37301. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  37302. },
  37303. fromArray: function (e, t) {
  37304. return void 0 === t && (t = 0), (this.x = e[t]), (this.y = e[t + 1]), (this.z = e[t + 2]), (this.w = e[t + 3]), this
  37305. },
  37306. toArray: function (e, t) {
  37307. return void 0 === e && (e = []), void 0 === t && (t = 0), (e[t] = this.x), (e[t + 1] = this.y), (e[t + 2] = this.z), (e[t + 3] = this.w), e
  37308. },
  37309. fromAttribute: function (e, t, i) {
  37310. return void 0 === i && (i = 0), (t = t * e.itemSize + i), (this.x = e.array[t]), (this.y = e.array[t + 1]), (this.z = e.array[t + 2]), (this.w = e.array[t + 3]), this
  37311. }
  37312. }),
  37313. (Ci.Euler = function (e, t, i, n) {
  37314. ;(this._x = e || 0), (this._y = t || 0), (this._z = i || 0), (this._order = n || Ci.Euler.DefaultOrder)
  37315. }),
  37316. (Ci.Euler.RotationOrders = ['XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX']),
  37317. (Ci.Euler.DefaultOrder = 'XYZ'),
  37318. (Ci.Euler.prototype = {
  37319. constructor: Ci.Euler,
  37320. get x() {
  37321. return this._x
  37322. },
  37323. set x(e) {
  37324. ;(this._x = e), this.onChangeCallback()
  37325. },
  37326. get y() {
  37327. return this._y
  37328. },
  37329. set y(e) {
  37330. ;(this._y = e), this.onChangeCallback()
  37331. },
  37332. get z() {
  37333. return this._z
  37334. },
  37335. set z(e) {
  37336. ;(this._z = e), this.onChangeCallback()
  37337. },
  37338. get order() {
  37339. return this._order
  37340. },
  37341. set order(e) {
  37342. ;(this._order = e), this.onChangeCallback()
  37343. },
  37344. set: function (e, t, i, n) {
  37345. return (this._x = e), (this._y = t), (this._z = i), (this._order = n || this._order), this.onChangeCallback(), this
  37346. },
  37347. clone: function () {
  37348. return new this.constructor(this._x, this._y, this._z, this._order)
  37349. },
  37350. copy: function (e) {
  37351. return (this._x = e._x), (this._y = e._y), (this._z = e._z), (this._order = e._order), this.onChangeCallback(), this
  37352. },
  37353. toObject: function () {
  37354. //xzw
  37355. return { x: this.x, y: this.y, z: this.z }
  37356. },
  37357. setFromRotationMatrix: function (e, t, i) {
  37358. var n = Ci.Math.clamp,
  37359. r = e.elements,
  37360. o = r[0],
  37361. a = r[4],
  37362. s = r[8],
  37363. l = r[1],
  37364. c = r[5],
  37365. h = r[9],
  37366. u = r[2],
  37367. d = r[6],
  37368. p = r[10]
  37369. return (
  37370. 'XYZ' === (t = t || this._order)
  37371. ? ((this._y = Math.asin(n(s, -1, 1))), Math.abs(s) < 0.99999 ? ((this._x = Math.atan2(-h, p)), (this._z = Math.atan2(-a, o))) : ((this._x = Math.atan2(d, c)), (this._z = 0)))
  37372. : 'YXZ' === t
  37373. ? ((this._x = Math.asin(-n(h, -1, 1))), Math.abs(h) < 0.99999 ? ((this._y = Math.atan2(s, p)), (this._z = Math.atan2(l, c))) : ((this._y = Math.atan2(-u, o)), (this._z = 0)))
  37374. : 'ZXY' === t
  37375. ? ((this._x = Math.asin(n(d, -1, 1))), Math.abs(d) < 0.99999 ? ((this._y = Math.atan2(-u, p)), (this._z = Math.atan2(-a, c))) : ((this._y = 0), (this._z = Math.atan2(l, o))))
  37376. : 'ZYX' === t
  37377. ? ((this._y = Math.asin(-n(u, -1, 1))), Math.abs(u) < 0.99999 ? ((this._x = Math.atan2(d, p)), (this._z = Math.atan2(l, o))) : ((this._x = 0), (this._z = Math.atan2(-a, c))))
  37378. : 'YZX' === t
  37379. ? ((this._z = Math.asin(n(l, -1, 1))), Math.abs(l) < 0.99999 ? ((this._x = Math.atan2(-h, c)), (this._y = Math.atan2(-u, o))) : ((this._x = 0), (this._y = Math.atan2(s, p))))
  37380. : 'XZY' === t
  37381. ? ((this._z = Math.asin(-n(a, -1, 1))), Math.abs(a) < 0.99999 ? ((this._x = Math.atan2(d, c)), (this._y = Math.atan2(s, o))) : ((this._x = Math.atan2(-h, p)), (this._y = 0)))
  37382. : console.warn('THREE.Euler: .setFromRotationMatrix() given unsupported order: ' + t),
  37383. (this._order = t),
  37384. !1 !== i && this.onChangeCallback(),
  37385. this
  37386. )
  37387. },
  37388. setFromQuaternion: function (e, t, i) {
  37389. return void 0 === Ee && (Ee = new Ci.Matrix4()), Ee.makeRotationFromQuaternion(e), this.setFromRotationMatrix(Ee, t, i), this
  37390. },
  37391. setFromVector3: function (e, t) {
  37392. return this.set(e.x, e.y, e.z, t || this._order)
  37393. },
  37394. reorder:
  37395. ((Ie = new Ci.Quaternion()),
  37396. function (e) {
  37397. Ie.setFromEuler(this), this.setFromQuaternion(Ie, e)
  37398. }),
  37399. equals: function (e) {
  37400. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  37401. },
  37402. fromArray: function (e) {
  37403. return (this._x = e[0]), (this._y = e[1]), (this._z = e[2]), void 0 !== e[3] && (this._order = e[3]), this.onChangeCallback(), this
  37404. },
  37405. toArray: function (e, t) {
  37406. return void 0 === e && (e = []), void 0 === t && (t = 0), (e[t] = this._x), (e[t + 1] = this._y), (e[t + 2] = this._z), (e[t + 3] = this._order), e
  37407. },
  37408. toVector3: function (e) {
  37409. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x, this._y, this._z)
  37410. },
  37411. onChange: function (e) {
  37412. return (this.onChangeCallback = e), this
  37413. },
  37414. onChangeCallback: function () {}
  37415. }),
  37416. (Ci.Line3 = function (e, t) {
  37417. ;(this.start = void 0 !== e ? e : new Ci.Vector3()), (this.end = void 0 !== t ? t : new Ci.Vector3())
  37418. }),
  37419. (Ci.Line3.prototype = {
  37420. constructor: Ci.Line3,
  37421. set: function (e, t) {
  37422. return this.start.copy(e), this.end.copy(t), this
  37423. },
  37424. clone: function () {
  37425. return new this.constructor().copy(this)
  37426. },
  37427. copy: function (e) {
  37428. return this.start.copy(e.start), this.end.copy(e.end), this
  37429. },
  37430. center: function (e) {
  37431. return (e || new Ci.Vector3()).addVectors(this.start, this.end).multiplyScalar(0.5)
  37432. },
  37433. delta: function (e) {
  37434. return (e || new Ci.Vector3()).subVectors(this.end, this.start)
  37435. },
  37436. distanceSq: function () {
  37437. return this.start.distanceToSquared(this.end)
  37438. },
  37439. distance: function () {
  37440. return this.start.distanceTo(this.end)
  37441. },
  37442. at: function (e, t) {
  37443. var i = t || new Ci.Vector3()
  37444. return this.delta(i).multiplyScalar(e).add(this.start)
  37445. },
  37446. closestPointToPointParameter:
  37447. ((Ae = new Ci.Vector3()),
  37448. (Ce = new Ci.Vector3()),
  37449. function (e, t) {
  37450. Ae.subVectors(e, this.start), Ce.subVectors(this.end, this.start)
  37451. var i = Ce.dot(Ce),
  37452. n = Ce.dot(Ae) / i
  37453. return t && (n = Ci.Math.clamp(n, 0, 1)), n
  37454. }),
  37455. closestPointToPoint: function (e, t, i) {
  37456. var n = this.closestPointToPointParameter(e, t),
  37457. r = i || new Ci.Vector3()
  37458. return this.delta(r).multiplyScalar(n).add(this.start)
  37459. },
  37460. applyMatrix4: function (e) {
  37461. return this.start.applyMatrix4(e), this.end.applyMatrix4(e), this
  37462. },
  37463. equals: function (e) {
  37464. return e.start.equals(this.start) && e.end.equals(this.end)
  37465. }
  37466. }),
  37467. (Ci.Box2 = function (e, t) {
  37468. ;(this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0, 1 / 0)), (this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0, -1 / 0))
  37469. }),
  37470. (Ci.Box2.prototype = {
  37471. constructor: Ci.Box2,
  37472. set: function (e, t) {
  37473. return this.min.copy(e), this.max.copy(t), this
  37474. },
  37475. setFromPoints: function (e) {
  37476. this.makeEmpty()
  37477. for (var t = 0, i = e.length; t < i; t++) this.expandByPoint(e[t])
  37478. return this
  37479. },
  37480. setFromCenterAndSize:
  37481. ((ye = new Ci.Vector2()),
  37482. function (e, t) {
  37483. var i = ye.copy(t).multiplyScalar(0.5)
  37484. return this.min.copy(e).sub(i), this.max.copy(e).add(i), this
  37485. }),
  37486. clone: function () {
  37487. return new this.constructor().copy(this)
  37488. },
  37489. copy: function (e) {
  37490. return this.min.copy(e.min), this.max.copy(e.max), this
  37491. },
  37492. makeEmpty: function () {
  37493. return (this.min.x = this.min.y = 1 / 0), (this.max.x = this.max.y = -1 / 0), this
  37494. },
  37495. isEmpty: function () {
  37496. return this.max.x < this.min.x || this.max.y < this.min.y
  37497. },
  37498. center: function (e) {
  37499. return (e || new Ci.Vector2()).addVectors(this.min, this.max).multiplyScalar(0.5)
  37500. },
  37501. size: function (e) {
  37502. return (e || new Ci.Vector2()).subVectors(this.max, this.min)
  37503. },
  37504. expandByPoint: function (e) {
  37505. return this.min.min(e), this.max.max(e), this
  37506. },
  37507. expandByVector: function (e) {
  37508. return this.min.sub(e), this.max.add(e), this
  37509. },
  37510. expandByScalar: function (e) {
  37511. return this.min.addScalar(-e), this.max.addScalar(e), this
  37512. },
  37513. containsPoint: function (e) {
  37514. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  37515. },
  37516. containsBox: function (e) {
  37517. return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y
  37518. },
  37519. getParameter: function (e, t) {
  37520. return (t || new Ci.Vector2()).set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y))
  37521. },
  37522. intersectsBox: function (e) {
  37523. return !(e.max.x < this.min.x || e.min.x > this.max.x || e.max.y < this.min.y || e.min.y > this.max.y)
  37524. },
  37525. clampPoint: function (e, t) {
  37526. return (t || new Ci.Vector2()).copy(e).clamp(this.min, this.max)
  37527. },
  37528. distanceToPoint:
  37529. ((ve = new Ci.Vector2()),
  37530. function (e) {
  37531. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  37532. }),
  37533. intersect: function (e) {
  37534. return this.min.max(e.min), this.max.min(e.max), this
  37535. },
  37536. union: function (e) {
  37537. return this.min.min(e.min), this.max.max(e.max), this
  37538. },
  37539. translate: function (e) {
  37540. return this.min.add(e), this.max.add(e), this
  37541. },
  37542. equals: function (e) {
  37543. return e.min.equals(this.min) && e.max.equals(this.max)
  37544. }
  37545. }),
  37546. (Ci.Box3 = function (e, t) {
  37547. ;(this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0, 1 / 0, 1 / 0)), (this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0, -1 / 0, -1 / 0))
  37548. }),
  37549. (Ci.Box3.prototype = {
  37550. constructor: Ci.Box3,
  37551. set: function (e, t) {
  37552. return this.min.copy(e), this.max.copy(t), this
  37553. },
  37554. setFromArray: function (e) {
  37555. this.makeEmpty()
  37556. for (var t = 1 / 0, i = 1 / 0, n = 1 / 0, r = -1 / 0, o = -1 / 0, a = -1 / 0, s = 0, l = e.length; s < l; s += 3) {
  37557. var c = e[s],
  37558. h = e[s + 1],
  37559. u = e[s + 2]
  37560. c < t && (t = c), h < i && (i = h), u < n && (n = u), r < c && (r = c), o < h && (o = h), a < u && (a = u)
  37561. }
  37562. this.min.set(t, i, n), this.max.set(r, o, a)
  37563. },
  37564. setFromPoints: function (e) {
  37565. this.makeEmpty()
  37566. for (var t = 0, i = e.length; t < i; t++) this.expandByPoint(e[t])
  37567. return this
  37568. },
  37569. setFromCenterAndSize:
  37570. ((me = new Ci.Vector3()),
  37571. function (e, t) {
  37572. var i = me.copy(t).multiplyScalar(0.5)
  37573. return this.min.copy(e).sub(i), this.max.copy(e).add(i), this
  37574. }),
  37575. setFromObject: function (e) {
  37576. void 0 === ge && (ge = new Ci.Box3())
  37577. var i = this
  37578. return (
  37579. this.makeEmpty(),
  37580. e.updateMatrixWorld(!0),
  37581. e.traverse(function (e) {
  37582. var t = e.geometry
  37583. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(), !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox), ge.applyMatrix4(e.matrixWorld), i.union(ge)))
  37584. }),
  37585. this
  37586. )
  37587. },
  37588. clone: function () {
  37589. return new this.constructor().copy(this)
  37590. },
  37591. copy: function (e) {
  37592. return this.min.copy(e.min), this.max.copy(e.max), this
  37593. },
  37594. makeEmpty: function () {
  37595. return (this.min.x = this.min.y = this.min.z = 1 / 0), (this.max.x = this.max.y = this.max.z = -1 / 0), this
  37596. },
  37597. isEmpty: function () {
  37598. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  37599. },
  37600. center: function (e) {
  37601. return (e || new Ci.Vector3()).addVectors(this.min, this.max).multiplyScalar(0.5)
  37602. },
  37603. size: function (e) {
  37604. return (e || new Ci.Vector3()).subVectors(this.max, this.min)
  37605. },
  37606. expandByPoint: function (e) {
  37607. return this.min.min(e), this.max.max(e), this
  37608. },
  37609. expandByVector: function (e) {
  37610. return this.min.sub(e), this.max.add(e), this
  37611. },
  37612. expandByScalar: function (e) {
  37613. return this.min.addScalar(-e), this.max.addScalar(e), this
  37614. },
  37615. containsPoint: function (e) {
  37616. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y || e.z < this.min.z || e.z > this.max.z)
  37617. },
  37618. containsBox: function (e) {
  37619. return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y && this.min.z <= e.min.z && e.max.z <= this.max.z
  37620. },
  37621. getParameter: function (e, t) {
  37622. return (t || new Ci.Vector3()).set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y), (e.z - this.min.z) / (this.max.z - this.min.z))
  37623. },
  37624. intersectsBox: function (e) {
  37625. return !(e.max.x < this.min.x || e.min.x > this.max.x || e.max.y < this.min.y || e.min.y > this.max.y || e.max.z < this.min.z || e.min.z > this.max.z)
  37626. },
  37627. intersectsSphere: function (e) {
  37628. return void 0 === fe && (fe = new Ci.Vector3()), this.clampPoint(e.center, fe), fe.distanceToSquared(e.center) <= e.radius * e.radius
  37629. },
  37630. intersectsPlane: function (e) {
  37631. var t, i
  37632. return (
  37633. (i = 0 < e.normal.x ? ((t = e.normal.x * this.min.x), e.normal.x * this.max.x) : ((t = e.normal.x * this.max.x), e.normal.x * this.min.x)),
  37634. 0 < e.normal.y ? ((t += e.normal.y * this.min.y), (i += e.normal.y * this.max.y)) : ((t += e.normal.y * this.max.y), (i += e.normal.y * this.min.y)),
  37635. 0 < e.normal.z ? ((t += e.normal.z * this.min.z), (i += e.normal.z * this.max.z)) : ((t += e.normal.z * this.max.z), (i += e.normal.z * this.min.z)),
  37636. t <= e.constant && i >= e.constant
  37637. )
  37638. },
  37639. clampPoint: function (e, t) {
  37640. return (t || new Ci.Vector3()).copy(e).clamp(this.min, this.max)
  37641. },
  37642. distanceToPoint:
  37643. ((pe = new Ci.Vector3()),
  37644. function (e) {
  37645. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  37646. }),
  37647. getBoundingSphere:
  37648. ((de = new Ci.Vector3()),
  37649. function (e) {
  37650. var t = e || new Ci.Sphere()
  37651. return (t.center = this.center()), (t.radius = 0.5 * this.size(de).length()), t
  37652. }),
  37653. intersect: function (e) {
  37654. return this.min.max(e.min), this.max.min(e.max), this
  37655. },
  37656. union: function (e) {
  37657. return this.min.min(e.min), this.max.max(e.max), this
  37658. },
  37659. applyMatrix4:
  37660. ((ue = [new Ci.Vector3(), new Ci.Vector3(), new Ci.Vector3(), new Ci.Vector3(), new Ci.Vector3(), new Ci.Vector3(), new Ci.Vector3(), new Ci.Vector3()]),
  37661. function (e) {
  37662. return (
  37663. ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  37664. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  37665. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  37666. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  37667. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  37668. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  37669. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  37670. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  37671. this.makeEmpty(),
  37672. this.setFromPoints(ue),
  37673. this
  37674. )
  37675. }),
  37676. translate: function (e) {
  37677. return this.min.add(e), this.max.add(e), this
  37678. },
  37679. equals: function (e) {
  37680. return e.min.equals(this.min) && e.max.equals(this.max)
  37681. }
  37682. }),
  37683. (Ci.Matrix3 = function () {
  37684. ;(this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1])), 0 < arguments.length && console.error('THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.')
  37685. }),
  37686. (Ci.Matrix3.prototype = {
  37687. constructor: Ci.Matrix3,
  37688. set: function (e, t, i, n, r, o, a, s, l) {
  37689. var c = this.elements
  37690. return (c[0] = e), (c[1] = n), (c[2] = a), (c[3] = t), (c[4] = r), (c[5] = s), (c[6] = i), (c[7] = o), (c[8] = l), this
  37691. },
  37692. identity: function () {
  37693. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this
  37694. },
  37695. clone: function () {
  37696. return new this.constructor().fromArray(this.elements)
  37697. },
  37698. copy: function (e) {
  37699. var t = e.elements
  37700. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]), this
  37701. },
  37702. setFromMatrix4: function (e) {
  37703. var t = e.elements
  37704. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]), this
  37705. },
  37706. applyToVector3Array: function (e, t, i) {
  37707. void 0 === he && (he = new Ci.Vector3()), void 0 === t && (t = 0), void 0 === i && (i = e.length)
  37708. for (var n = 0, r = t; n < i; n += 3, r += 3) he.fromArray(e, r), he.applyMatrix3(this), he.toArray(e, r)
  37709. return e
  37710. },
  37711. applyToBuffer: function (e, t, i) {
  37712. void 0 === ce && (ce = new Ci.Vector3()), void 0 === t && (t = 0), void 0 === i && (i = e.length / e.itemSize)
  37713. for (var n = 0, r = t; n < i; n++, r++) (ce.x = e.getX(r)), (ce.y = e.getY(r)), (ce.z = e.getZ(r)), ce.applyMatrix3(this), e.setXYZ(ce.x, ce.y, ce.z)
  37714. return e
  37715. },
  37716. multiplyScalar: function (e) {
  37717. var t = this.elements
  37718. return (t[0] *= e), (t[3] *= e), (t[6] *= e), (t[1] *= e), (t[4] *= e), (t[7] *= e), (t[2] *= e), (t[5] *= e), (t[8] *= e), this
  37719. },
  37720. determinant: function () {
  37721. var e = this.elements,
  37722. t = e[0],
  37723. i = e[1],
  37724. n = e[2],
  37725. r = e[3],
  37726. o = e[4],
  37727. a = e[5],
  37728. s = e[6],
  37729. l = e[7],
  37730. c = e[8]
  37731. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  37732. },
  37733. getInverse: function (e, t) {
  37734. e instanceof Ci.Matrix4 && console.warn('THREE.Matrix3.getInverse no longer takes a Matrix4 argument.')
  37735. var i = e.elements,
  37736. n = this.elements,
  37737. r = i[0],
  37738. o = i[1],
  37739. a = i[2],
  37740. s = i[3],
  37741. l = i[4],
  37742. c = i[5],
  37743. h = i[6],
  37744. u = i[7],
  37745. d = i[8],
  37746. p = d * l - c * u,
  37747. f = c * h - d * s,
  37748. g = u * s - l * h,
  37749. m = r * p + o * f + a * g
  37750. if (0 != m)
  37751. return (
  37752. (n[0] = p),
  37753. (n[1] = a * u - d * o),
  37754. (n[2] = c * o - a * l),
  37755. (n[3] = f),
  37756. (n[4] = d * r - a * h),
  37757. (n[5] = a * s - c * r),
  37758. (n[6] = g),
  37759. (n[7] = o * h - u * r),
  37760. (n[8] = l * r - o * s),
  37761. this.multiplyScalar(1 / m)
  37762. )
  37763. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0"
  37764. if (t) throw new Error(v)
  37765. return this.identity() /* console.warn(v), */ //许钟文删 boxHelper报的
  37766. },
  37767. transpose: function () {
  37768. var e,
  37769. t = this.elements
  37770. return (e = t[1]), (t[1] = t[3]), (t[3] = e), (e = t[2]), (t[2] = t[6]), (t[6] = e), (e = t[5]), (t[5] = t[7]), (t[7] = e), this
  37771. },
  37772. flattenToArrayOffset: function (e, t) {
  37773. var i = this.elements
  37774. return (e[t] = i[0]), (e[t + 1] = i[1]), (e[t + 2] = i[2]), (e[t + 3] = i[3]), (e[t + 4] = i[4]), (e[t + 5] = i[5]), (e[t + 6] = i[6]), (e[t + 7] = i[7]), (e[t + 8] = i[8]), e
  37775. },
  37776. getNormalMatrix: function (e) {
  37777. return this.setFromMatrix4(e).getInverse(this).transpose()
  37778. },
  37779. transposeIntoArray: function (e) {
  37780. var t = this.elements
  37781. return (e[0] = t[0]), (e[1] = t[3]), (e[2] = t[6]), (e[3] = t[1]), (e[4] = t[4]), (e[5] = t[7]), (e[6] = t[2]), (e[7] = t[5]), (e[8] = t[8]), this
  37782. },
  37783. fromArray: function (e) {
  37784. return this.elements.set(e), this
  37785. },
  37786. toArray: function () {
  37787. var e = this.elements
  37788. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  37789. }
  37790. }),
  37791. (Ci.Matrix4 = function () {
  37792. ;(this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])),
  37793. 0 < arguments.length && console.error('THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.')
  37794. }),
  37795. (Ci.Matrix4.prototype = {
  37796. constructor: Ci.Matrix4,
  37797. set: function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  37798. var m = this.elements
  37799. return (
  37800. (m[0] = e),
  37801. (m[4] = t),
  37802. (m[8] = i),
  37803. (m[12] = n),
  37804. (m[1] = r),
  37805. (m[5] = o),
  37806. (m[9] = a),
  37807. (m[13] = s),
  37808. (m[2] = l),
  37809. (m[6] = c),
  37810. (m[10] = h),
  37811. (m[14] = u),
  37812. (m[3] = d),
  37813. (m[7] = p),
  37814. (m[11] = f),
  37815. (m[15] = g),
  37816. this
  37817. )
  37818. },
  37819. identity: function () {
  37820. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  37821. },
  37822. clone: function () {
  37823. return new Ci.Matrix4().fromArray(this.elements)
  37824. },
  37825. copy: function (e) {
  37826. return this.elements.set(e.elements), this
  37827. },
  37828. copyPosition: function (e) {
  37829. var t = this.elements,
  37830. i = e.elements
  37831. return (t[12] = i[12]), (t[13] = i[13]), (t[14] = i[14]), this
  37832. },
  37833. extractBasis: function (e, t, i) {
  37834. return e.setFromMatrixColumn(this, 0), t.setFromMatrixColumn(this, 1), i.setFromMatrixColumn(this, 2), this
  37835. },
  37836. makeBasis: function (e, t, i) {
  37837. return this.set(e.x, t.x, i.x, 0, e.y, t.y, i.y, 0, e.z, t.z, i.z, 0, 0, 0, 0, 1), this
  37838. },
  37839. extractRotation: function (e) {
  37840. void 0 === le && (le = new Ci.Vector3())
  37841. var t = this.elements,
  37842. i = e.elements,
  37843. n = 1 / le.setFromMatrixColumn(e, 0).length(),
  37844. r = 1 / le.setFromMatrixColumn(e, 1).length(),
  37845. o = 1 / le.setFromMatrixColumn(e, 2).length()
  37846. return (t[0] = i[0] * n), (t[1] = i[1] * n), (t[2] = i[2] * n), (t[4] = i[4] * r), (t[5] = i[5] * r), (t[6] = i[6] * r), (t[8] = i[8] * o), (t[9] = i[9] * o), (t[10] = i[10] * o), this
  37847. },
  37848. makeRotationFromEuler: function (e) {
  37849. e instanceof Ci.Euler == 0 && console.error('THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.')
  37850. var t = this.elements,
  37851. i = e.x,
  37852. n = e.y,
  37853. r = e.z,
  37854. o = Math.cos(i),
  37855. a = Math.sin(i),
  37856. s = Math.cos(n),
  37857. l = Math.sin(n),
  37858. c = Math.cos(r),
  37859. h = Math.sin(r)
  37860. if ('XYZ' === e.order) {
  37861. var u = o * c,
  37862. d = o * h,
  37863. p = a * c,
  37864. f = a * h
  37865. ;(t[0] = s * c), (t[4] = -s * h), (t[8] = l), (t[1] = d + p * l), (t[5] = u - f * l), (t[9] = -a * s), (t[2] = f - u * l), (t[6] = p + d * l), (t[10] = o * s)
  37866. } else if ('YXZ' === e.order) {
  37867. var g = s * c,
  37868. m = s * h,
  37869. v = l * c,
  37870. y = l * h
  37871. ;(t[0] = g + y * a), (t[4] = v * a - m), (t[8] = o * l), (t[1] = o * h), (t[5] = o * c), (t[9] = -a), (t[2] = m * a - v), (t[6] = y + g * a), (t[10] = o * s)
  37872. } else if ('ZXY' === e.order) {
  37873. ;(g = s * c), (m = s * h), (v = l * c), (y = l * h)
  37874. ;(t[0] = g - y * a), (t[4] = -o * h), (t[8] = v + m * a), (t[1] = m + v * a), (t[5] = o * c), (t[9] = y - g * a), (t[2] = -o * l), (t[6] = a), (t[10] = o * s)
  37875. } else if ('ZYX' === e.order) {
  37876. ;(u = o * c), (d = o * h), (p = a * c), (f = a * h)
  37877. ;(t[0] = s * c), (t[4] = p * l - d), (t[8] = u * l + f), (t[1] = s * h), (t[5] = f * l + u), (t[9] = d * l - p), (t[2] = -l), (t[6] = a * s), (t[10] = o * s)
  37878. } else if ('YZX' === e.order) {
  37879. var A = o * s,
  37880. C = o * l,
  37881. I = a * s,
  37882. E = a * l
  37883. ;(t[0] = s * c), (t[4] = E - A * h), (t[8] = I * h + C), (t[1] = h), (t[5] = o * c), (t[9] = -a * c), (t[2] = -l * c), (t[6] = C * h + I), (t[10] = A - E * h)
  37884. } else if ('XZY' === e.order) {
  37885. ;(A = o * s), (C = o * l), (I = a * s), (E = a * l)
  37886. ;(t[0] = s * c), (t[4] = -h), (t[8] = l * c), (t[1] = A * h + E), (t[5] = o * c), (t[9] = C * h - I), (t[2] = I * h - C), (t[6] = a * c), (t[10] = E * h + A)
  37887. }
  37888. return (t[3] = 0), (t[7] = 0), (t[11] = 0), (t[12] = 0), (t[13] = 0), (t[14] = 0), (t[15] = 1), this
  37889. },
  37890. makeRotationFromQuaternion: function (e) {
  37891. var t = this.elements,
  37892. i = e.x,
  37893. n = e.y,
  37894. r = e.z,
  37895. o = e.w,
  37896. a = i + i,
  37897. s = n + n,
  37898. l = r + r,
  37899. c = i * a,
  37900. h = i * s,
  37901. u = i * l,
  37902. d = n * s,
  37903. p = n * l,
  37904. f = r * l,
  37905. g = o * a,
  37906. m = o * s,
  37907. v = o * l
  37908. return (
  37909. (t[0] = 1 - (d + f)),
  37910. (t[4] = h - v),
  37911. (t[8] = u + m),
  37912. (t[1] = h + v),
  37913. (t[5] = 1 - (c + f)),
  37914. (t[9] = p - g),
  37915. (t[2] = u - m),
  37916. (t[6] = p + g),
  37917. (t[10] = 1 - (c + d)),
  37918. (t[3] = 0),
  37919. (t[7] = 0),
  37920. (t[11] = 0),
  37921. (t[12] = 0),
  37922. (t[13] = 0),
  37923. (t[14] = 0),
  37924. (t[15] = 1),
  37925. this
  37926. )
  37927. },
  37928. lookAt: function (e, t, i) {
  37929. void 0 === oe && (oe = new Ci.Vector3()), void 0 === ae && (ae = new Ci.Vector3()), void 0 === se && (se = new Ci.Vector3())
  37930. var n = this.elements
  37931. return (
  37932. se.subVectors(e, t).normalize(),
  37933. 0 === se.lengthSq() && (se.z = 1),
  37934. oe.crossVectors(i, se).normalize(),
  37935. 0 === oe.lengthSq() && ((se.x += 1e-4), oe.crossVectors(i, se).normalize()),
  37936. ae.crossVectors(se, oe),
  37937. (n[0] = oe.x),
  37938. (n[4] = ae.x),
  37939. (n[8] = se.x),
  37940. (n[1] = oe.y),
  37941. (n[5] = ae.y),
  37942. (n[9] = se.y),
  37943. (n[2] = oe.z),
  37944. (n[6] = ae.z),
  37945. (n[10] = se.z),
  37946. this
  37947. )
  37948. },
  37949. multiply: function (e, t) {
  37950. return void 0 !== t
  37951. ? (console.warn('THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.'), this.multiplyMatrices(e, t))
  37952. : this.multiplyMatrices(this, e)
  37953. },
  37954. multiplyMatrices: function (e, t) {
  37955. var i = e.elements,
  37956. n = t.elements,
  37957. r = this.elements,
  37958. o = i[0],
  37959. a = i[4],
  37960. s = i[8],
  37961. l = i[12],
  37962. c = i[1],
  37963. h = i[5],
  37964. u = i[9],
  37965. d = i[13],
  37966. p = i[2],
  37967. f = i[6],
  37968. g = i[10],
  37969. m = i[14],
  37970. v = i[3],
  37971. y = i[7],
  37972. A = i[11],
  37973. C = i[15],
  37974. I = n[0],
  37975. E = n[4],
  37976. _ = n[8],
  37977. b = n[12],
  37978. w = n[1],
  37979. T = n[5],
  37980. x = n[9],
  37981. S = n[13],
  37982. M = n[2],
  37983. R = n[6],
  37984. P = n[10],
  37985. O = n[14],
  37986. L = n[3],
  37987. D = n[7],
  37988. N = n[11],
  37989. F = n[15]
  37990. return (
  37991. (r[0] = o * I + a * w + s * M + l * L),
  37992. (r[4] = o * E + a * T + s * R + l * D),
  37993. (r[8] = o * _ + a * x + s * P + l * N),
  37994. (r[12] = o * b + a * S + s * O + l * F),
  37995. (r[1] = c * I + h * w + u * M + d * L),
  37996. (r[5] = c * E + h * T + u * R + d * D),
  37997. (r[9] = c * _ + h * x + u * P + d * N),
  37998. (r[13] = c * b + h * S + u * O + d * F),
  37999. (r[2] = p * I + f * w + g * M + m * L),
  38000. (r[6] = p * E + f * T + g * R + m * D),
  38001. (r[10] = p * _ + f * x + g * P + m * N),
  38002. (r[14] = p * b + f * S + g * O + m * F),
  38003. (r[3] = v * I + y * w + A * M + C * L),
  38004. (r[7] = v * E + y * T + A * R + C * D),
  38005. (r[11] = v * _ + y * x + A * P + C * N),
  38006. (r[15] = v * b + y * S + A * O + C * F),
  38007. this
  38008. )
  38009. },
  38010. multiplyToArray: function (e, t, i) {
  38011. var n = this.elements
  38012. return (
  38013. this.multiplyMatrices(e, t),
  38014. (i[0] = n[0]),
  38015. (i[1] = n[1]),
  38016. (i[2] = n[2]),
  38017. (i[3] = n[3]),
  38018. (i[4] = n[4]),
  38019. (i[5] = n[5]),
  38020. (i[6] = n[6]),
  38021. (i[7] = n[7]),
  38022. (i[8] = n[8]),
  38023. (i[9] = n[9]),
  38024. (i[10] = n[10]),
  38025. (i[11] = n[11]),
  38026. (i[12] = n[12]),
  38027. (i[13] = n[13]),
  38028. (i[14] = n[14]),
  38029. (i[15] = n[15]),
  38030. this
  38031. )
  38032. },
  38033. multiplyScalar: function (e) {
  38034. var t = this.elements
  38035. return (
  38036. (t[0] *= e),
  38037. (t[4] *= e),
  38038. (t[8] *= e),
  38039. (t[12] *= e),
  38040. (t[1] *= e),
  38041. (t[5] *= e),
  38042. (t[9] *= e),
  38043. (t[13] *= e),
  38044. (t[2] *= e),
  38045. (t[6] *= e),
  38046. (t[10] *= e),
  38047. (t[14] *= e),
  38048. (t[3] *= e),
  38049. (t[7] *= e),
  38050. (t[11] *= e),
  38051. (t[15] *= e),
  38052. this
  38053. )
  38054. },
  38055. applyToVector3Array: function (e, t, i) {
  38056. void 0 === re && (re = new Ci.Vector3()), void 0 === t && (t = 0), void 0 === i && (i = e.length)
  38057. for (var n = 0, r = t; n < i; n += 3, r += 3) re.fromArray(e, r), re.applyMatrix4(this), re.toArray(e, r)
  38058. return e
  38059. },
  38060. applyToBuffer: function (e, t, i) {
  38061. void 0 === ne && (ne = new Ci.Vector3()), void 0 === t && (t = 0), void 0 === i && (i = e.length / e.itemSize)
  38062. for (var n = 0, r = t; n < i; n++, r++) (ne.x = e.getX(r)), (ne.y = e.getY(r)), (ne.z = e.getZ(r)), ne.applyMatrix4(this), e.setXYZ(ne.x, ne.y, ne.z)
  38063. return e
  38064. },
  38065. determinant: function () {
  38066. var e = this.elements,
  38067. t = e[0],
  38068. i = e[4],
  38069. n = e[8],
  38070. r = e[12],
  38071. o = e[1],
  38072. a = e[5],
  38073. s = e[9],
  38074. l = e[13],
  38075. c = e[2],
  38076. h = e[6],
  38077. u = e[10],
  38078. d = e[14]
  38079. return (
  38080. e[3] * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) +
  38081. e[7] * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) +
  38082. e[11] * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) +
  38083. e[15] * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  38084. )
  38085. },
  38086. transpose: function () {
  38087. var e,
  38088. t = this.elements
  38089. return (
  38090. (e = t[1]),
  38091. (t[1] = t[4]),
  38092. (t[4] = e),
  38093. (e = t[2]),
  38094. (t[2] = t[8]),
  38095. (t[8] = e),
  38096. (e = t[6]),
  38097. (t[6] = t[9]),
  38098. (t[9] = e),
  38099. (e = t[3]),
  38100. (t[3] = t[12]),
  38101. (t[12] = e),
  38102. (e = t[7]),
  38103. (t[7] = t[13]),
  38104. (t[13] = e),
  38105. (e = t[11]),
  38106. (t[11] = t[14]),
  38107. (t[14] = e),
  38108. this
  38109. )
  38110. },
  38111. flattenToArrayOffset: function (e, t) {
  38112. var i = this.elements
  38113. return (
  38114. (e[t] = i[0]),
  38115. (e[t + 1] = i[1]),
  38116. (e[t + 2] = i[2]),
  38117. (e[t + 3] = i[3]),
  38118. (e[t + 4] = i[4]),
  38119. (e[t + 5] = i[5]),
  38120. (e[t + 6] = i[6]),
  38121. (e[t + 7] = i[7]),
  38122. (e[t + 8] = i[8]),
  38123. (e[t + 9] = i[9]),
  38124. (e[t + 10] = i[10]),
  38125. (e[t + 11] = i[11]),
  38126. (e[t + 12] = i[12]),
  38127. (e[t + 13] = i[13]),
  38128. (e[t + 14] = i[14]),
  38129. (e[t + 15] = i[15]),
  38130. e
  38131. )
  38132. },
  38133. getPosition: function () {
  38134. return (
  38135. void 0 === ie && (ie = new Ci.Vector3()),
  38136. console.warn('THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.'),
  38137. ie.setFromMatrixColumn(this, 3)
  38138. )
  38139. },
  38140. setPosition: function (e) {
  38141. var t = this.elements
  38142. return (t[12] = e.x), (t[13] = e.y), (t[14] = e.z), this
  38143. },
  38144. getInverse: function (e, t) {
  38145. var i = this.elements,
  38146. n = e.elements,
  38147. r = n[0],
  38148. o = n[1],
  38149. a = n[2],
  38150. s = n[3],
  38151. l = n[4],
  38152. c = n[5],
  38153. h = n[6],
  38154. u = n[7],
  38155. d = n[8],
  38156. p = n[9],
  38157. f = n[10],
  38158. g = n[11],
  38159. m = n[12],
  38160. v = n[13],
  38161. y = n[14],
  38162. A = n[15],
  38163. C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A,
  38164. I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A,
  38165. E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A,
  38166. _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y,
  38167. b = r * C + o * I + a * E + s * _
  38168. if (0 != b)
  38169. return (
  38170. (i[0] = C),
  38171. (i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A),
  38172. (i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A),
  38173. (i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g),
  38174. (i[4] = I),
  38175. (i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A),
  38176. (i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A),
  38177. (i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g),
  38178. (i[8] = E),
  38179. (i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A),
  38180. (i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A),
  38181. (i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g),
  38182. (i[12] = _),
  38183. (i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y),
  38184. (i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y),
  38185. (i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f),
  38186. this.multiplyScalar(1 / b)
  38187. )
  38188. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0"
  38189. if (t) throw new Error(w)
  38190. return console.warn(w), this.identity()
  38191. },
  38192. scale: function (e) {
  38193. var t = this.elements,
  38194. i = e.x,
  38195. n = e.y,
  38196. r = e.z
  38197. return (t[0] *= i), (t[4] *= n), (t[8] *= r), (t[1] *= i), (t[5] *= n), (t[9] *= r), (t[2] *= i), (t[6] *= n), (t[10] *= r), (t[3] *= i), (t[7] *= n), (t[11] *= r), this
  38198. },
  38199. getMaxScaleOnAxis: function () {
  38200. var e = this.elements,
  38201. t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2],
  38202. i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6],
  38203. n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10]
  38204. return Math.sqrt(Math.max(t, i, n))
  38205. },
  38206. makeTranslation: function (e, t, i) {
  38207. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1), this
  38208. },
  38209. makeRotationX: function (e) {
  38210. var t = Math.cos(e),
  38211. i = Math.sin(e)
  38212. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1), this
  38213. },
  38214. makeRotationY: function (e) {
  38215. var t = Math.cos(e),
  38216. i = Math.sin(e)
  38217. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1), this
  38218. },
  38219. makeRotationZ: function (e) {
  38220. var t = Math.cos(e),
  38221. i = Math.sin(e)
  38222. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  38223. },
  38224. makeRotationAxis: function (e, t) {
  38225. var i = Math.cos(t),
  38226. n = Math.sin(t),
  38227. r = 1 - i,
  38228. o = e.x,
  38229. a = e.y,
  38230. s = e.z,
  38231. l = r * o,
  38232. c = r * a
  38233. return this.set(l * o + i, l * a - n * s, l * s + n * a, 0, l * a + n * s, c * a + i, c * s - n * o, 0, l * s - n * a, c * s + n * o, r * s * s + i, 0, 0, 0, 0, 1), this
  38234. },
  38235. makeScale: function (e, t, i) {
  38236. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1), this
  38237. },
  38238. compose: function (e, t, i) {
  38239. return this.makeRotationFromQuaternion(t), this.scale(i), this.setPosition(e), this
  38240. },
  38241. decompose: function (e, t, i) {
  38242. void 0 === ee && (ee = new Ci.Vector3()), void 0 === te && (te = new Ci.Matrix4())
  38243. var n = this.elements,
  38244. r = ee.set(n[0], n[1], n[2]).length(),
  38245. o = ee.set(n[4], n[5], n[6]).length(),
  38246. a = ee.set(n[8], n[9], n[10]).length()
  38247. this.determinant() < 0 && (r = -r), (e.x = n[12]), (e.y = n[13]), (e.z = n[14]), te.elements.set(this.elements)
  38248. var s = 1 / r,
  38249. l = 1 / o,
  38250. c = 1 / a
  38251. return (
  38252. (te.elements[0] *= s),
  38253. (te.elements[1] *= s),
  38254. (te.elements[2] *= s),
  38255. (te.elements[4] *= l),
  38256. (te.elements[5] *= l),
  38257. (te.elements[6] *= l),
  38258. (te.elements[8] *= c),
  38259. (te.elements[9] *= c),
  38260. (te.elements[10] *= c),
  38261. t.setFromRotationMatrix(te),
  38262. (i.x = r),
  38263. (i.y = o),
  38264. (i.z = a),
  38265. this
  38266. )
  38267. },
  38268. makeFrustum: function (e, t, i, n, r, o) {
  38269. var a = this.elements,
  38270. s = (2 * r) / (t - e),
  38271. l = (2 * r) / (n - i),
  38272. c = (t + e) / (t - e),
  38273. h = (n + i) / (n - i),
  38274. u = -(o + r) / (o - r),
  38275. d = (-2 * o * r) / (o - r)
  38276. return (
  38277. (a[0] = s),
  38278. (a[4] = 0),
  38279. (a[8] = c),
  38280. (a[12] = 0),
  38281. (a[1] = 0),
  38282. (a[5] = l),
  38283. (a[9] = h),
  38284. (a[13] = 0),
  38285. (a[2] = 0),
  38286. (a[6] = 0),
  38287. (a[10] = u),
  38288. (a[14] = d),
  38289. (a[3] = 0),
  38290. (a[7] = 0),
  38291. (a[11] = -1),
  38292. (a[15] = 0),
  38293. this
  38294. )
  38295. },
  38296. makePerspective: function (e, t, i, n) {
  38297. var r = i * Math.tan(Ci.Math.degToRad(0.5 * e)),
  38298. o = -r,
  38299. a = o * t,
  38300. s = r * t
  38301. return this.makeFrustum(a, s, o, r, i, n)
  38302. },
  38303. makeOrthographic: function (e, t, i, n, r, o) {
  38304. var a = this.elements,
  38305. s = 1 / (t - e),
  38306. l = 1 / (i - n),
  38307. c = 1 / (o - r),
  38308. h = (t + e) * s,
  38309. u = (i + n) * l,
  38310. d = (o + r) * c
  38311. return (
  38312. (a[0] = 2 * s),
  38313. (a[4] = 0),
  38314. (a[8] = 0),
  38315. (a[12] = -h),
  38316. (a[1] = 0),
  38317. (a[5] = 2 * l),
  38318. (a[9] = 0),
  38319. (a[13] = -u),
  38320. (a[2] = 0),
  38321. (a[6] = 0),
  38322. (a[10] = -2 * c),
  38323. (a[14] = -d),
  38324. (a[3] = 0),
  38325. (a[7] = 0),
  38326. (a[11] = 0),
  38327. (a[15] = 1),
  38328. this
  38329. )
  38330. },
  38331. equals: function (e) {
  38332. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++) if (t[n] !== i[n]) return !1
  38333. return !0
  38334. },
  38335. fromArray: function (e) {
  38336. return this.elements.set(e), this
  38337. },
  38338. toArray: function () {
  38339. var e = this.elements
  38340. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8], e[9], e[10], e[11], e[12], e[13], e[14], e[15]]
  38341. }
  38342. }),
  38343. (Ci.Ray = function (e, t) {
  38344. ;(this.origin = void 0 !== e ? e : new Ci.Vector3()), (this.direction = void 0 !== t ? t : new Ci.Vector3())
  38345. }),
  38346. (Ci.Ray.prototype = {
  38347. constructor: Ci.Ray,
  38348. set: function (e, t) {
  38349. return this.origin.copy(e), this.direction.copy(t), this
  38350. },
  38351. clone: function () {
  38352. return new this.constructor().copy(this)
  38353. },
  38354. copy: function (e) {
  38355. return this.origin.copy(e.origin), this.direction.copy(e.direction), this
  38356. },
  38357. at: function (e, t) {
  38358. return (t || new Ci.Vector3()).copy(this.direction).multiplyScalar(e).add(this.origin)
  38359. },
  38360. lookAt: function (e) {
  38361. this.direction.copy(e).sub(this.origin).normalize()
  38362. },
  38363. recast:
  38364. (($ = new Ci.Vector3()),
  38365. function (e) {
  38366. return this.origin.copy(this.at(e, $)), this
  38367. }),
  38368. closestPointToPoint: function (e, t) {
  38369. var i = t || new Ci.Vector3()
  38370. i.subVectors(e, this.origin)
  38371. var n = i.dot(this.direction)
  38372. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  38373. },
  38374. distanceToPoint: function (e) {
  38375. return Math.sqrt(this.distanceSqToPoint(e))
  38376. },
  38377. distanceSqToPoint:
  38378. ((J = new Ci.Vector3()),
  38379. function (e) {
  38380. var t = J.subVectors(e, this.origin).dot(this.direction)
  38381. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin), J.distanceToSquared(e))
  38382. }),
  38383. distanceSqToSegment:
  38384. ((Z = new Ci.Vector3()),
  38385. (K = new Ci.Vector3()),
  38386. (Q = new Ci.Vector3()),
  38387. function (e, t, i, n) {
  38388. Z.copy(e).add(t).multiplyScalar(0.5), K.copy(t).sub(e).normalize(), Q.copy(this.origin).sub(Z)
  38389. var r,
  38390. o,
  38391. a,
  38392. s,
  38393. l = 0.5 * e.distanceTo(t),
  38394. c = -this.direction.dot(K),
  38395. h = Q.dot(this.direction),
  38396. u = -Q.dot(K),
  38397. d = Q.lengthSq(),
  38398. p = Math.abs(1 - c * c)
  38399. if (0 < p)
  38400. if (((o = c * h - u), (s = l * p), 0 <= (r = c * u - h)))
  38401. if (-s <= o)
  38402. if (o <= s) {
  38403. var f = 1 / p
  38404. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  38405. } else (o = l), (a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d)
  38406. else (o = -l), (a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d)
  38407. else
  38408. a =
  38409. o <= -s
  38410. ? -(r = Math.max(0, -(-c * l + h))) * r + (o = 0 < r ? -l : Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d
  38411. : o <= s
  38412. ? ((r = 0), (o = Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d)
  38413. : -(r = Math.max(0, -(c * l + h))) * r + (o = 0 < r ? l : Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d
  38414. else (o = 0 < c ? -l : l), (a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d)
  38415. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin), n && n.copy(K).multiplyScalar(o).add(Z), a
  38416. }),
  38417. intersectSphere:
  38418. ((X = new Ci.Vector3()),
  38419. function (e, t) {
  38420. X.subVectors(e.center, this.origin)
  38421. var i = X.dot(this.direction),
  38422. n = X.dot(X) - i * i,
  38423. r = e.radius * e.radius
  38424. if (r < n) return null
  38425. var o = Math.sqrt(r - n),
  38426. a = i - o,
  38427. s = i + o
  38428. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  38429. }),
  38430. intersectsSphere: function (e) {
  38431. return this.distanceToPoint(e.center) <= e.radius
  38432. },
  38433. distanceToPlane: function (e) {
  38434. var t = e.normal.dot(this.direction)
  38435. if (0 === t) return 0 === e.distanceToPoint(this.origin) ? 0 : null
  38436. var i = -(this.origin.dot(e.normal) + e.constant) / t
  38437. return 0 <= i ? i : null
  38438. },
  38439. intersectPlane: function (e, t) {
  38440. var i = this.distanceToPlane(e)
  38441. return null === i ? null : this.at(i, t)
  38442. },
  38443. intersectsPlane: function (e) {
  38444. var t = e.distanceToPoint(this.origin)
  38445. return 0 === t || e.normal.dot(this.direction) * t < 0
  38446. },
  38447. intersectBox: function (e, t) {
  38448. var i,
  38449. n,
  38450. r,
  38451. o,
  38452. a,
  38453. s,
  38454. l = 1 / this.direction.x,
  38455. c = 1 / this.direction.y,
  38456. h = 1 / this.direction.z,
  38457. u = this.origin
  38458. return (
  38459. (n = 0 <= l ? ((i = (e.min.x - u.x) * l), (e.max.x - u.x) * l) : ((i = (e.max.x - u.x) * l), (e.min.x - u.x) * l)),
  38460. (o = 0 <= c ? ((r = (e.min.y - u.y) * c), (e.max.y - u.y) * c) : ((r = (e.max.y - u.y) * c), (e.min.y - u.y) * c)) < i || n < r
  38461. ? null
  38462. : ((i < r || i != i) && (i = r),
  38463. (o < n || n != n) && (n = o),
  38464. (s = 0 <= h ? ((a = (e.min.z - u.z) * h), (e.max.z - u.z) * h) : ((a = (e.max.z - u.z) * h), (e.min.z - u.z) * h)) < i || n < a
  38465. ? null
  38466. : ((i < a || i != i) && (i = a), (s < n || n != n) && (n = s), n < 0 ? null : this.at(0 <= i ? i : n, t)))
  38467. )
  38468. },
  38469. intersectsBox:
  38470. ((q = new Ci.Vector3()),
  38471. function (e) {
  38472. return null !== this.intersectBox(e, q)
  38473. }),
  38474. intersectTriangle:
  38475. ((G = new Ci.Vector3()),
  38476. (W = new Ci.Vector3()),
  38477. (j = new Ci.Vector3()),
  38478. (Y = new Ci.Vector3()),
  38479. function (e, t, i, n, r) {
  38480. W.subVectors(t, e), j.subVectors(i, e), Y.crossVectors(W, j)
  38481. var o,
  38482. a = this.direction.dot(Y)
  38483. if (0 < a) {
  38484. if (n) return null
  38485. o = 1
  38486. } else {
  38487. if (!(a < 0)) return null
  38488. ;(o = -1), (a = -a)
  38489. }
  38490. G.subVectors(this.origin, e)
  38491. var s = o * this.direction.dot(j.crossVectors(G, j))
  38492. if (s < 0) return null
  38493. var l = o * this.direction.dot(W.cross(G))
  38494. if (l < 0) return null
  38495. if (a < s + l) return null
  38496. var c = -o * G.dot(Y)
  38497. return c < 0 ? null : this.at(c / a, r)
  38498. }),
  38499. applyMatrix4: function (e) {
  38500. return this.direction.add(this.origin).applyMatrix4(e), this.origin.applyMatrix4(e), this.direction.sub(this.origin), this.direction.normalize(), this
  38501. },
  38502. equals: function (e) {
  38503. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  38504. }
  38505. }),
  38506. (Ci.Sphere = function (e, t) {
  38507. ;(this.center = void 0 !== e ? e : new Ci.Vector3()), (this.radius = void 0 !== t ? t : 0)
  38508. }),
  38509. (Ci.Sphere.prototype = {
  38510. constructor: Ci.Sphere,
  38511. set: function (e, t) {
  38512. return this.center.copy(e), (this.radius = t), this
  38513. },
  38514. setFromPoints:
  38515. ((z = new Ci.Box3()),
  38516. function (e, t) {
  38517. var i = this.center
  38518. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i)
  38519. for (var n = 0, r = 0, o = e.length; r < o; r++) n = Math.max(n, i.distanceToSquared(e[r]))
  38520. return (this.radius = Math.sqrt(n)), this
  38521. }),
  38522. clone: function () {
  38523. return new this.constructor().copy(this)
  38524. },
  38525. copy: function (e) {
  38526. return this.center.copy(e.center), (this.radius = e.radius), this
  38527. },
  38528. empty: function () {
  38529. return this.radius <= 0
  38530. },
  38531. containsPoint: function (e) {
  38532. return e.distanceToSquared(this.center) <= this.radius * this.radius
  38533. },
  38534. distanceToPoint: function (e) {
  38535. return e.distanceTo(this.center) - this.radius
  38536. },
  38537. intersectsSphere: function (e) {
  38538. var t = this.radius + e.radius
  38539. return e.center.distanceToSquared(this.center) <= t * t
  38540. },
  38541. intersectsBox: function (e) {
  38542. return e.intersectsSphere(this)
  38543. },
  38544. intersectsPlane: function (e) {
  38545. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  38546. },
  38547. clampPoint: function (e, t) {
  38548. var i = this.center.distanceToSquared(e),
  38549. n = t || new Ci.Vector3()
  38550. return n.copy(e), i > this.radius * this.radius && (n.sub(this.center).normalize(), n.multiplyScalar(this.radius).add(this.center)), n
  38551. },
  38552. getBoundingBox: function (e) {
  38553. var t = e || new Ci.Box3()
  38554. return t.set(this.center, this.center), t.expandByScalar(this.radius), t
  38555. },
  38556. applyMatrix4: function (e) {
  38557. return this.center.applyMatrix4(e), (this.radius = this.radius * e.getMaxScaleOnAxis()), this
  38558. },
  38559. translate: function (e) {
  38560. return this.center.add(e), this
  38561. },
  38562. equals: function (e) {
  38563. return e.center.equals(this.center) && e.radius === this.radius
  38564. }
  38565. }),
  38566. (Ci.Frustum = function (e, t, i, n, r, o) {
  38567. this.planes = [
  38568. void 0 !== e ? e : new Ci.Plane(),
  38569. void 0 !== t ? t : new Ci.Plane(),
  38570. void 0 !== i ? i : new Ci.Plane(),
  38571. void 0 !== n ? n : new Ci.Plane(),
  38572. void 0 !== r ? r : new Ci.Plane(),
  38573. void 0 !== o ? o : new Ci.Plane()
  38574. ]
  38575. }),
  38576. (Ci.Frustum.prototype = {
  38577. constructor: Ci.Frustum,
  38578. set: function (e, t, i, n, r, o) {
  38579. var a = this.planes
  38580. return a[0].copy(e), a[1].copy(t), a[2].copy(i), a[3].copy(n), a[4].copy(r), a[5].copy(o), this
  38581. },
  38582. clone: function () {
  38583. return new this.constructor().copy(this)
  38584. },
  38585. copy: function (e) {
  38586. for (var t = this.planes, i = 0; i < 6; i++) t[i].copy(e.planes[i])
  38587. return this
  38588. },
  38589. setFromMatrix: function (e) {
  38590. var t = this.planes,
  38591. i = e.elements,
  38592. n = i[0],
  38593. r = i[1],
  38594. o = i[2],
  38595. a = i[3],
  38596. s = i[4],
  38597. l = i[5],
  38598. c = i[6],
  38599. h = i[7],
  38600. u = i[8],
  38601. d = i[9],
  38602. p = i[10],
  38603. f = i[11],
  38604. g = i[12],
  38605. m = i[13],
  38606. v = i[14],
  38607. y = i[15]
  38608. return (
  38609. t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  38610. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  38611. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  38612. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  38613. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  38614. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  38615. this
  38616. )
  38617. },
  38618. intersectsObject:
  38619. ((H = new Ci.Sphere()),
  38620. function (e) {
  38621. var t = e.geometry
  38622. return null === t.boundingSphere && t.computeBoundingSphere(), H.copy(t.boundingSphere), H.applyMatrix4(e.matrixWorld), this.intersectsSphere(H)
  38623. }),
  38624. intersectsSphere: function (e) {
  38625. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  38626. if (t[r].distanceToPoint(i) < n) return !1
  38627. }
  38628. return !0
  38629. },
  38630. intersectsBox:
  38631. ((k = new Ci.Vector3()),
  38632. (U = new Ci.Vector3()),
  38633. function (e) {
  38634. for (var t = this.planes, i = 0; i < 6; i++) {
  38635. var n = t[i]
  38636. ;(k.x = 0 < n.normal.x ? e.min.x : e.max.x),
  38637. (U.x = 0 < n.normal.x ? e.max.x : e.min.x),
  38638. (k.y = 0 < n.normal.y ? e.min.y : e.max.y),
  38639. (U.y = 0 < n.normal.y ? e.max.y : e.min.y),
  38640. (k.z = 0 < n.normal.z ? e.min.z : e.max.z),
  38641. (U.z = 0 < n.normal.z ? e.max.z : e.min.z)
  38642. var r = n.distanceToPoint(k),
  38643. o = n.distanceToPoint(U)
  38644. if (r < 0 && o < 0) return !1
  38645. }
  38646. return !0
  38647. }),
  38648. containsPoint: function (e) {
  38649. for (var t = this.planes, i = 0; i < 6; i++) if (t[i].distanceToPoint(e) < 0) return !1
  38650. return !0
  38651. }
  38652. }),
  38653. (Ci.Plane = function (e, t) {
  38654. ;(this.normal = void 0 !== e ? e : new Ci.Vector3(1, 0, 0)), (this.constant = void 0 !== t ? t : 0)
  38655. }),
  38656. (Ci.Plane.prototype = {
  38657. constructor: Ci.Plane,
  38658. set: function (e, t) {
  38659. return this.normal.copy(e), (this.constant = t), this
  38660. },
  38661. setComponents: function (e, t, i, n) {
  38662. return this.normal.set(e, t, i), (this.constant = n), this
  38663. },
  38664. setFromNormalAndCoplanarPoint: function (e, t) {
  38665. return this.normal.copy(e), (this.constant = -t.dot(this.normal)), this
  38666. },
  38667. setFromCoplanarPoints:
  38668. ((B = new Ci.Vector3()),
  38669. (V = new Ci.Vector3()),
  38670. function (e, t, i) {
  38671. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize()
  38672. return this.setFromNormalAndCoplanarPoint(n, e), this
  38673. }),
  38674. clone: function () {
  38675. return new this.constructor().copy(this)
  38676. },
  38677. copy: function (e) {
  38678. return this.normal.copy(e.normal), (this.constant = e.constant), this
  38679. },
  38680. normalize: function () {
  38681. var e = 1 / this.normal.length()
  38682. return this.normal.multiplyScalar(e), (this.constant *= e), this
  38683. },
  38684. negate: function () {
  38685. return (this.constant *= -1), this.normal.negate(), this
  38686. },
  38687. distanceToPoint: function (e) {
  38688. return this.normal.dot(e) + this.constant
  38689. },
  38690. distanceToSphere: function (e) {
  38691. return this.distanceToPoint(e.center) - e.radius
  38692. },
  38693. projectPoint: function (e, t) {
  38694. return this.orthoPoint(e, t).sub(e).negate()
  38695. },
  38696. orthoPoint: function (e, t) {
  38697. var i = this.distanceToPoint(e)
  38698. return (t || new Ci.Vector3()).copy(this.normal).multiplyScalar(i)
  38699. },
  38700. intersectLine:
  38701. ((F = new Ci.Vector3()),
  38702. function (e, t) {
  38703. var i = t || new Ci.Vector3(),
  38704. n = e.delta(F),
  38705. r = this.normal.dot(n)
  38706. if (0 !== r) {
  38707. var o = -(e.start.dot(this.normal) + this.constant) / r
  38708. if (!(o < 0 || 1 < o)) return i.copy(n).multiplyScalar(o).add(e.start)
  38709. } else if (0 === this.distanceToPoint(e.start)) return i.copy(e.start)
  38710. }),
  38711. intersectsLine: function (e) {
  38712. var t = this.distanceToPoint(e.start),
  38713. i = this.distanceToPoint(e.end)
  38714. return (t < 0 && 0 < i) || (i < 0 && 0 < t)
  38715. },
  38716. intersectsBox: function (e) {
  38717. return e.intersectsPlane(this)
  38718. },
  38719. intersectsSphere: function (e) {
  38720. return e.intersectsPlane(this)
  38721. },
  38722. coplanarPoint: function (e) {
  38723. return (e || new Ci.Vector3()).copy(this.normal).multiplyScalar(-this.constant)
  38724. },
  38725. applyMatrix4:
  38726. ((L = new Ci.Vector3()),
  38727. (D = new Ci.Vector3()),
  38728. (N = new Ci.Matrix3()),
  38729. function (e, t) {
  38730. var i = t || N.getNormalMatrix(e),
  38731. n = L.copy(this.normal).applyMatrix3(i),
  38732. r = this.coplanarPoint(D)
  38733. return r.applyMatrix4(e), this.setFromNormalAndCoplanarPoint(n, r), this
  38734. }),
  38735. translate: function (e) {
  38736. return (this.constant = this.constant - e.dot(this.normal)), this
  38737. },
  38738. equals: function (e) {
  38739. return e.normal.equals(this.normal) && e.constant === this.constant
  38740. }
  38741. }),
  38742. (Ci.Spherical = function (e, t, i) {
  38743. return (this.radius = void 0 !== e ? e : 1), (this.phi = void 0 !== t ? t : 0), (this.theta = void 0 !== i ? i : 0), this
  38744. }),
  38745. (Ci.Spherical.prototype = {
  38746. constructor: Ci.Spherical,
  38747. set: function (e, t, i) {
  38748. ;(this.radius = e), (this.phi = t), (this.theta = i)
  38749. },
  38750. clone: function () {
  38751. return new this.constructor().copy(this)
  38752. },
  38753. copy: function (e) {
  38754. return this.radius.copy(e.radius), this.phi.copy(e.phi), this.theta.copy(e.theta), this
  38755. },
  38756. makeSafe: function () {
  38757. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  38758. },
  38759. setFromVector3: function (e) {
  38760. return (
  38761. (this.radius = e.length()),
  38762. 0 === this.radius ? ((this.theta = 0), (this.phi = 0)) : ((this.theta = Math.atan2(e.x, e.z)), (this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1)))),
  38763. this
  38764. )
  38765. }
  38766. }),
  38767. (Ci.Math = {
  38768. generateUUID:
  38769. ((R = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('')),
  38770. (P = new Array(36)),
  38771. (O = 0),
  38772. function () {
  38773. for (var e = 0; e < 36; e++)
  38774. 8 === e || 13 === e || 18 === e || 23 === e
  38775. ? (P[e] = '-')
  38776. : 14 === e
  38777. ? (P[e] = '4')
  38778. : (O <= 2 && (O = (33554432 + 16777216 * Math.random()) | 0), (M = 15 & O), (O >>= 4), (P[e] = R[19 === e ? (3 & M) | 8 : M]))
  38779. return P.join('')
  38780. }),
  38781. clamp: function (e, t, i) {
  38782. return Math.max(t, Math.min(i, e))
  38783. },
  38784. euclideanModulo: function (e, t) {
  38785. return ((e % t) + t) % t
  38786. },
  38787. mapLinear: function (e, t, i, n, r) {
  38788. return n + ((e - t) * (r - n)) / (i - t)
  38789. },
  38790. smoothstep: function (e, t, i) {
  38791. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  38792. },
  38793. smootherstep: function (e, t, i) {
  38794. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  38795. },
  38796. random16: function () {
  38797. return console.warn('THREE.Math.random16() has been deprecated. Use Math.random() instead.'), Math.random()
  38798. },
  38799. randInt: function (e, t) {
  38800. return e + Math.floor(Math.random() * (t - e + 1))
  38801. },
  38802. randFloat: function (e, t) {
  38803. return e + Math.random() * (t - e)
  38804. },
  38805. randFloatSpread: function (e) {
  38806. return e * (0.5 - Math.random())
  38807. },
  38808. degToRad:
  38809. ((S = Math.PI / 180),
  38810. function (e) {
  38811. return e * S
  38812. }),
  38813. radToDeg:
  38814. ((x = 180 / Math.PI),
  38815. function (e) {
  38816. return e * x
  38817. }),
  38818. isPowerOfTwo: function (e) {
  38819. return 0 == (e & (e - 1)) && 0 !== e
  38820. },
  38821. nearestPowerOfTwo: function (e) {
  38822. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  38823. },
  38824. nextPowerOfTwo: function (e) {
  38825. return e--, (e |= e >> 1), (e |= e >> 2), (e |= e >> 4), (e |= e >> 8), (e |= e >> 16), ++e
  38826. }
  38827. }),
  38828. (Ci.Spline = function (e) {
  38829. function t(e, t, i, n, r, o, a) {
  38830. var s = 0.5 * (i - e),
  38831. l = 0.5 * (n - t)
  38832. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  38833. }
  38834. this.points = e
  38835. var i,
  38836. n,
  38837. r,
  38838. o,
  38839. a,
  38840. s,
  38841. l,
  38842. c,
  38843. h,
  38844. u = [],
  38845. d = {
  38846. x: 0,
  38847. y: 0,
  38848. z: 0
  38849. }
  38850. ;(this.initFromArray = function (e) {
  38851. this.points = []
  38852. for (var t = 0; t < e.length; t++)
  38853. this.points[t] = {
  38854. x: e[t][0],
  38855. y: e[t][1],
  38856. z: e[t][2]
  38857. }
  38858. }),
  38859. (this.getPoint = function (e) {
  38860. return (
  38861. (i = (this.points.length - 1) * e),
  38862. (n = Math.floor(i)),
  38863. (r = i - n),
  38864. (u[0] = 0 === n ? n : n - 1),
  38865. (u[1] = n),
  38866. (u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1),
  38867. (u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2),
  38868. (s = this.points[u[0]]),
  38869. (l = this.points[u[1]]),
  38870. (c = this.points[u[2]]),
  38871. (h = this.points[u[3]]),
  38872. (a = r * (o = r * r)),
  38873. (d.x = t(s.x, l.x, c.x, h.x, r, o, a)),
  38874. (d.y = t(s.y, l.y, c.y, h.y, r, o, a)),
  38875. (d.z = t(s.z, l.z, c.z, h.z, r, o, a)),
  38876. d
  38877. )
  38878. }),
  38879. (this.getControlPointsArray = function () {
  38880. var e,
  38881. t,
  38882. i = this.points.length,
  38883. n = []
  38884. for (e = 0; e < i; e++) (t = this.points[e]), (n[e] = [t.x, t.y, t.z])
  38885. return n
  38886. }),
  38887. (this.getLength = function (e) {
  38888. var t,
  38889. i,
  38890. n,
  38891. r,
  38892. o = 0,
  38893. a = 0,
  38894. s = 0,
  38895. l = new Ci.Vector3(),
  38896. c = new Ci.Vector3(),
  38897. h = [],
  38898. u = 0
  38899. for (h[0] = 0, e = e || 100, n = this.points.length * e, l.copy(this.points[0]), t = 1; t < n; t++)
  38900. (i = t / n), (r = this.getPoint(i)), c.copy(r), (u += c.distanceTo(l)), l.copy(r), (o = (this.points.length - 1) * i), (a = Math.floor(o)) !== s && ((h[a] = u), (s = a))
  38901. return (
  38902. (h[h.length] = u),
  38903. {
  38904. chunks: h,
  38905. total: u
  38906. }
  38907. )
  38908. }),
  38909. (this.reparametrizeByArcLength = function (e) {
  38910. var t,
  38911. i,
  38912. n,
  38913. r,
  38914. o,
  38915. a,
  38916. s,
  38917. l,
  38918. c = [],
  38919. h = new Ci.Vector3(),
  38920. u = this.getLength()
  38921. for (c.push(h.copy(this.points[0]).clone()), t = 1; t < this.points.length; t++) {
  38922. for (a = u.chunks[t] - u.chunks[t - 1], s = Math.ceil((e * a) / u.total), r = (t - 1) / (this.points.length - 1), o = t / (this.points.length - 1), i = 1; i < s - 1; i++)
  38923. (n = r + i * (1 / s) * (o - r)), (l = this.getPoint(n)), c.push(h.copy(l).clone())
  38924. c.push(h.copy(this.points[t]).clone())
  38925. }
  38926. this.points = c
  38927. })
  38928. }),
  38929. (Ci.Triangle = function (e, t, i) {
  38930. ;(this.a = void 0 !== e ? e : new Ci.Vector3()), (this.b = void 0 !== t ? t : new Ci.Vector3()), (this.c = void 0 !== i ? i : new Ci.Vector3())
  38931. }),
  38932. (Ci.Triangle.normal =
  38933. ((T = new Ci.Vector3()),
  38934. function (e, t, i, n) {
  38935. var r = n || new Ci.Vector3()
  38936. r.subVectors(i, t), T.subVectors(e, t), r.cross(T)
  38937. var o = r.lengthSq()
  38938. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  38939. })),
  38940. (Ci.Triangle.barycoordFromPoint =
  38941. ((_ = new Ci.Vector3()),
  38942. (b = new Ci.Vector3()),
  38943. (w = new Ci.Vector3()),
  38944. function (e, t, i, n, r) {
  38945. _.subVectors(n, t), b.subVectors(i, t), w.subVectors(e, t)
  38946. var o = _.dot(_),
  38947. a = _.dot(b),
  38948. s = _.dot(w),
  38949. l = b.dot(b),
  38950. c = b.dot(w),
  38951. h = o * l - a * a,
  38952. u = r || new Ci.Vector3()
  38953. if (0 == h) return u.set(-2, -1, -1)
  38954. var d = 1 / h,
  38955. p = (l * s - a * c) * d,
  38956. f = (o * c - a * s) * d
  38957. return u.set(1 - p - f, f, p)
  38958. })),
  38959. (Ci.Triangle.containsPoint =
  38960. ((E = new Ci.Vector3()),
  38961. function (e, t, i, n) {
  38962. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E)
  38963. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  38964. })),
  38965. (Ci.Triangle.prototype = {
  38966. constructor: Ci.Triangle,
  38967. set: function (e, t, i) {
  38968. return this.a.copy(e), this.b.copy(t), this.c.copy(i), this
  38969. },
  38970. setFromPointsAndIndices: function (e, t, i, n) {
  38971. return this.a.copy(e[t]), this.b.copy(e[i]), this.c.copy(e[n]), this
  38972. },
  38973. clone: function () {
  38974. return new this.constructor().copy(this)
  38975. },
  38976. copy: function (e) {
  38977. return this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this
  38978. },
  38979. area:
  38980. ((C = new Ci.Vector3()),
  38981. (I = new Ci.Vector3()),
  38982. function () {
  38983. return C.subVectors(this.c, this.b), I.subVectors(this.a, this.b), 0.5 * C.cross(I).length()
  38984. }),
  38985. midpoint: function (e) {
  38986. return (e || new Ci.Vector3())
  38987. .addVectors(this.a, this.b)
  38988. .add(this.c)
  38989. .multiplyScalar(1 / 3)
  38990. },
  38991. normal: function (e) {
  38992. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  38993. },
  38994. plane: function (e) {
  38995. return (e || new Ci.Plane()).setFromCoplanarPoints(this.a, this.b, this.c)
  38996. },
  38997. barycoordFromPoint: function (e, t) {
  38998. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  38999. },
  39000. containsPoint: function (e) {
  39001. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  39002. },
  39003. equals: function (e) {
  39004. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  39005. }
  39006. }),
  39007. (Ci.Interpolant = function (e, t, i, n) {
  39008. ;(this.parameterPositions = e), (this._cachedIndex = 0), (this.resultBuffer = void 0 !== n ? n : new t.constructor(i)), (this.sampleValues = t), (this.valueSize = i)
  39009. }),
  39010. (Ci.Interpolant.prototype = {
  39011. constructor: Ci.Interpolant,
  39012. evaluate: function (e) {
  39013. var t = this.parameterPositions,
  39014. i = this._cachedIndex,
  39015. n = t[i],
  39016. r = t[i - 1]
  39017. e: {
  39018. t: {
  39019. var o
  39020. i: {
  39021. n: if (!(e < n)) {
  39022. for (var a = i + 2; ; ) {
  39023. if (void 0 === n) {
  39024. if (e < r) break n
  39025. return (i = t.length), (this._cachedIndex = i), this.afterEnd_(i - 1, e, r)
  39026. }
  39027. if (i === a) break
  39028. if (((r = n), e < (n = t[++i]))) break t
  39029. }
  39030. o = t.length
  39031. break i
  39032. }
  39033. if (r <= e) break e
  39034. var s = t[1]
  39035. e < s && ((i = 2), (r = s))
  39036. for (a = i - 2; ; ) {
  39037. if (void 0 === r) return (this._cachedIndex = 0), this.beforeStart_(0, e, n)
  39038. if (i === a) break
  39039. if (((n = r), (r = t[--i - 1]) <= e)) break t
  39040. }
  39041. ;(o = i), (i = 0)
  39042. }
  39043. for (; i < o; ) {
  39044. var l = (i + o) >>> 1
  39045. e < t[l] ? (o = l) : (i = 1 + l)
  39046. }
  39047. if (((n = t[i]), void 0 === (r = t[i - 1]))) return (this._cachedIndex = 0), this.beforeStart_(0, e, n)
  39048. if (void 0 === n) return (i = t.length), (this._cachedIndex = i), this.afterEnd_(i - 1, r, e)
  39049. }
  39050. ;(this._cachedIndex = i), this.intervalChanged_(i, r, n)
  39051. }
  39052. return this.interpolate_(i, r, e, n)
  39053. },
  39054. settings: null,
  39055. DefaultSettings_: {},
  39056. getSettings_: function () {
  39057. return this.settings || this.DefaultSettings_
  39058. },
  39059. copySampleValue_: function (e) {
  39060. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o) t[o] = i[r + o]
  39061. return t
  39062. },
  39063. interpolate_: function (e, t, i, n) {
  39064. throw new Error('call to abstract method')
  39065. },
  39066. intervalChanged_: function (e, t, i) {}
  39067. }),
  39068. Object.assign(Ci.Interpolant.prototype, {
  39069. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  39070. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  39071. }),
  39072. (Ci.CubicInterpolant = function (e, t, i, n) {
  39073. Ci.Interpolant.call(this, e, t, i, n), (this._weightPrev = -0), (this._offsetPrev = -0), (this._weightNext = -0), (this._offsetNext = -0)
  39074. }),
  39075. (Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  39076. constructor: Ci.CubicInterpolant,
  39077. DefaultSettings_: {
  39078. endingStart: Ci.ZeroCurvatureEnding,
  39079. endingEnd: Ci.ZeroCurvatureEnding
  39080. },
  39081. intervalChanged_: function (e, t, i) {
  39082. var n = this.parameterPositions,
  39083. r = e - 2,
  39084. o = e + 1,
  39085. a = n[r],
  39086. s = n[o]
  39087. if (void 0 === a)
  39088. switch (this.getSettings_().endingStart) {
  39089. case Ci.ZeroSlopeEnding:
  39090. ;(r = e), (a = 2 * t - i)
  39091. break
  39092. case Ci.WrapAroundEnding:
  39093. a = t + n[(r = n.length - 2)] - n[r + 1]
  39094. break
  39095. default:
  39096. ;(r = e), (a = i)
  39097. }
  39098. if (void 0 === s)
  39099. switch (this.getSettings_().endingEnd) {
  39100. case Ci.ZeroSlopeEnding:
  39101. ;(o = e), (s = 2 * i - t)
  39102. break
  39103. case Ci.WrapAroundEnding:
  39104. s = i + n[(o = 1)] - n[0]
  39105. break
  39106. default:
  39107. ;(o = e - 1), (s = t)
  39108. }
  39109. var l = 0.5 * (i - t),
  39110. c = this.valueSize
  39111. ;(this._weightPrev = l / (t - a)), (this._weightNext = l / (s - i)), (this._offsetPrev = r * c), (this._offsetNext = o * c)
  39112. },
  39113. interpolate_: function (e, t, i, n) {
  39114. for (
  39115. var r = this.resultBuffer,
  39116. o = this.sampleValues,
  39117. a = this.valueSize,
  39118. s = e * a,
  39119. l = s - a,
  39120. c = this._offsetPrev,
  39121. h = this._offsetNext,
  39122. u = this._weightPrev,
  39123. d = this._weightNext,
  39124. p = (i - t) / (n - t),
  39125. f = p * p,
  39126. g = f * p,
  39127. m = -u * g + 2 * u * f - u * p,
  39128. v = (1 + u) * g + (-1.5 - 2 * u) * f + (-0.5 + u) * p + 1,
  39129. y = (-1 - d) * g + (1.5 + d) * f + 0.5 * p,
  39130. A = d * g - d * f,
  39131. C = 0;
  39132. C !== a;
  39133. ++C
  39134. )
  39135. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C]
  39136. return r
  39137. }
  39138. })),
  39139. (Ci.DiscreteInterpolant = function (e, t, i, n) {
  39140. Ci.Interpolant.call(this, e, t, i, n)
  39141. }),
  39142. (Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  39143. constructor: Ci.DiscreteInterpolant,
  39144. interpolate_: function (e, t, i, n) {
  39145. return this.copySampleValue_(e - 1)
  39146. }
  39147. })),
  39148. (Ci.LinearInterpolant = function (e, t, i, n) {
  39149. Ci.Interpolant.call(this, e, t, i, n)
  39150. }),
  39151. (Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  39152. constructor: Ci.LinearInterpolant,
  39153. interpolate_: function (e, t, i, n) {
  39154. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = s - a, c = (i - t) / (n - t), h = 1 - c, u = 0; u !== a; ++u)
  39155. r[u] = o[l + u] * h + o[s + u] * c
  39156. return r
  39157. }
  39158. })),
  39159. (Ci.QuaternionLinearInterpolant = function (e, t, i, n) {
  39160. Ci.Interpolant.call(this, e, t, i, n)
  39161. }),
  39162. (Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  39163. constructor: Ci.QuaternionLinearInterpolant,
  39164. interpolate_: function (e, t, i, n) {
  39165. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = (i - t) / (n - t), c = s + a; s !== c; s += 4)
  39166. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l)
  39167. return r
  39168. }
  39169. })),
  39170. (Ci.Clock = function (e) {
  39171. ;(this.autoStart = void 0 === e || e), (this.startTime = 0), (this.oldTime = 0), (this.elapsedTime = 0), (this.running = !1)
  39172. }),
  39173. (Ci.Clock.prototype = {
  39174. constructor: Ci.Clock,
  39175. start: function () {
  39176. ;(this.startTime = performance.now()), (this.oldTime = this.startTime), (this.running = !0)
  39177. },
  39178. stop: function () {
  39179. this.getElapsedTime(), (this.running = !1)
  39180. },
  39181. getElapsedTime: function () {
  39182. return this.getDelta(), this.elapsedTime
  39183. },
  39184. getDelta: function () {
  39185. var e = 0
  39186. if ((this.autoStart && !this.running && this.start(), this.running)) {
  39187. var t = performance.now()
  39188. ;(e = 0.001 * (t - this.oldTime)), (this.oldTime = t), (this.elapsedTime += e)
  39189. }
  39190. return e
  39191. }
  39192. }),
  39193. (Ci.EventDispatcher = function () {}),
  39194. (Ci.EventDispatcher.prototype = {
  39195. constructor: Ci.EventDispatcher,
  39196. apply: function (e) {
  39197. ;(e.addEventListener = Ci.EventDispatcher.prototype.addEventListener),
  39198. (e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener),
  39199. (e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener),
  39200. (e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent)
  39201. },
  39202. addEventListener: function (e, t) {
  39203. void 0 === this._listeners && (this._listeners = {})
  39204. var i = this._listeners
  39205. void 0 === i[e] && (i[e] = []), -1 === i[e].indexOf(t) && i[e].push(t)
  39206. },
  39207. hasEventListener: function (e, t) {
  39208. if (void 0 === this._listeners) return !1
  39209. var i = this._listeners
  39210. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  39211. },
  39212. removeEventListener: function (e, t) {
  39213. if (void 0 !== this._listeners) {
  39214. var i = this._listeners[e]
  39215. if (void 0 !== i) {
  39216. var n = i.indexOf(t)
  39217. ;-1 !== n && i.splice(n, 1)
  39218. }
  39219. }
  39220. },
  39221. dispatchEvent: function (e) {
  39222. if (void 0 !== this._listeners) {
  39223. var t = this._listeners[e.type]
  39224. if (void 0 !== t) {
  39225. e.target = this
  39226. for (var i = [], n = t.length, r = 0; r < n; r++) i[r] = t[r]
  39227. for (r = 0; r < n; r++) i[r].call(this, e)
  39228. }
  39229. }
  39230. }
  39231. }),
  39232. (Ci.Layers = function () {
  39233. this.mask = 1
  39234. }),
  39235. (Ci.Layers.prototype = {
  39236. constructor: Ci.Layers,
  39237. set: function (e) {
  39238. this.mask = 1 << e
  39239. },
  39240. enable: function (e) {
  39241. this.mask |= 1 << e
  39242. },
  39243. toggle: function (e) {
  39244. this.mask ^= 1 << e
  39245. },
  39246. disable: function (e) {
  39247. this.mask &= ~(1 << e)
  39248. },
  39249. test: function (e) {
  39250. return 0 != (this.mask & e.mask)
  39251. }
  39252. }),
  39253. ((A = Ci).Raycaster = function (e, t, i, n) {
  39254. ;(this.ray = new A.Ray(e, t)),
  39255. (this.near = i || 0),
  39256. (this.far = n || 1 / 0),
  39257. (this.params = {
  39258. Mesh: {},
  39259. Line: {},
  39260. LOD: {},
  39261. Points: {
  39262. threshold: 1
  39263. },
  39264. Sprite: {}
  39265. }),
  39266. Object.defineProperties(this.params, {
  39267. PointCloud: {
  39268. get: function () {
  39269. return console.warn('THREE.Raycaster: params.PointCloud has been renamed to params.Points.'), this.Points
  39270. }
  39271. }
  39272. })
  39273. }),
  39274. (A.Raycaster.prototype = {
  39275. constructor: A.Raycaster,
  39276. linePrecision: 1,
  39277. set: function (e, t) {
  39278. this.ray.set(e, t)
  39279. },
  39280. setFromCamera: function (e, t) {
  39281. t instanceof A.PerspectiveCamera
  39282. ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld), this.ray.direction.set(e.x, e.y, 0.5).unproject(t).sub(this.ray.origin).normalize())
  39283. : t instanceof A.OrthographicCamera
  39284. ? (this.ray.origin.set(e.x, e.y, -1).unproject(t), this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld))
  39285. : console.error('THREE.Raycaster: Unsupported camera type.')
  39286. },
  39287. intersectObject: function (e, t) {
  39288. var i = []
  39289. return Ei(e, this, i, t), i.sort(Ii), i
  39290. },
  39291. intersectObjects: function (e, t) {
  39292. var i = []
  39293. if (!1 === Array.isArray(e)) return console.warn('THREE.Raycaster.intersectObjects: objects is not an Array.'), i
  39294. for (var n = 0, r = e.length; n < r; n++) Ei(e[n], this, i, t)
  39295. return i.sort(Ii), i
  39296. }
  39297. }),
  39298. (Ci.Object3D = function () {
  39299. Object.defineProperty(this, 'id', {
  39300. value: Ci.Object3DIdCount++
  39301. }),
  39302. (this.uuid = Ci.Math.generateUUID()),
  39303. (this.name = ''),
  39304. (this.type = 'Object3D'),
  39305. (this.parent = null),
  39306. (this.children = []),
  39307. (this.up = Ci.Object3D.DefaultUp.clone())
  39308. var e = new Ci.Vector3(),
  39309. t = new Ci.Euler(),
  39310. i = new Ci.Quaternion(),
  39311. n = new Ci.Vector3(1, 1, 1)
  39312. t.onChange(function () {
  39313. i.setFromEuler(t, !1)
  39314. }),
  39315. i.onChange(function () {
  39316. t.setFromQuaternion(i, void 0, !1)
  39317. }),
  39318. Object.defineProperties(this, {
  39319. position: {
  39320. enumerable: !0,
  39321. value: e
  39322. },
  39323. rotation: {
  39324. enumerable: !0,
  39325. value: t
  39326. },
  39327. quaternion: {
  39328. enumerable: !0,
  39329. value: i
  39330. },
  39331. scale: {
  39332. enumerable: !0,
  39333. value: n
  39334. },
  39335. modelViewMatrix: {
  39336. value: new Ci.Matrix4()
  39337. },
  39338. normalMatrix: {
  39339. value: new Ci.Matrix3()
  39340. }
  39341. }),
  39342. (this.rotationAutoUpdate = !0),
  39343. (this.matrix = new Ci.Matrix4()),
  39344. (this.matrixWorld = new Ci.Matrix4()),
  39345. (this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate),
  39346. (this.matrixWorldNeedsUpdate = !1),
  39347. (this.layers = new Ci.Layers()),
  39348. (this.visible = !0),
  39349. (this.castShadow = !1),
  39350. (this.receiveShadow = !1),
  39351. (this.frustumCulled = !0),
  39352. (this.renderOrder = 0),
  39353. (this.userData = {})
  39354. }),
  39355. (Ci.Object3D.DefaultUp = new Ci.Vector3(0, 1, 0)),
  39356. (Ci.Object3D.DefaultMatrixAutoUpdate = !0),
  39357. (Ci.Object3D.prototype = {
  39358. constructor: Ci.Object3D,
  39359. applyMatrix: function (e) {
  39360. this.matrix.multiplyMatrices(e, this.matrix), this.matrix.decompose(this.position, this.quaternion, this.scale)
  39361. },
  39362. setRotationFromAxisAngle: function (e, t) {
  39363. this.quaternion.setFromAxisAngle(e, t)
  39364. },
  39365. setRotationFromEuler: function (e) {
  39366. this.quaternion.setFromEuler(e, !0)
  39367. },
  39368. setRotationFromMatrix: function (e) {
  39369. this.quaternion.setFromRotationMatrix(e)
  39370. },
  39371. setRotationFromQuaternion: function (e) {
  39372. this.quaternion.copy(e)
  39373. },
  39374. rotateOnAxis:
  39375. ((y = new Ci.Quaternion()),
  39376. function (e, t) {
  39377. return y.setFromAxisAngle(e, t), this.quaternion.multiply(y), this
  39378. }),
  39379. rotateX:
  39380. ((v = new Ci.Vector3(1, 0, 0)),
  39381. function (e) {
  39382. return this.rotateOnAxis(v, e)
  39383. }),
  39384. rotateY:
  39385. ((m = new Ci.Vector3(0, 1, 0)),
  39386. function (e) {
  39387. return this.rotateOnAxis(m, e)
  39388. }),
  39389. rotateZ:
  39390. ((g = new Ci.Vector3(0, 0, 1)),
  39391. function (e) {
  39392. return this.rotateOnAxis(g, e)
  39393. }),
  39394. translateOnAxis:
  39395. ((f = new Ci.Vector3()),
  39396. function (e, t) {
  39397. return f.copy(e).applyQuaternion(this.quaternion), this.position.add(f.multiplyScalar(t)), this
  39398. }),
  39399. translateX:
  39400. ((p = new Ci.Vector3(1, 0, 0)),
  39401. function (e) {
  39402. return this.translateOnAxis(p, e)
  39403. }),
  39404. translateY:
  39405. ((d = new Ci.Vector3(0, 1, 0)),
  39406. function (e) {
  39407. return this.translateOnAxis(d, e)
  39408. }),
  39409. translateZ:
  39410. ((u = new Ci.Vector3(0, 0, 1)),
  39411. function (e) {
  39412. return this.translateOnAxis(u, e)
  39413. }),
  39414. localToWorld: function (e) {
  39415. return e.applyMatrix4(this.matrixWorld)
  39416. },
  39417. worldToLocal:
  39418. ((h = new Ci.Matrix4()),
  39419. function (e) {
  39420. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  39421. }),
  39422. lookAt:
  39423. ((c = new Ci.Matrix4()),
  39424. function (e) {
  39425. c.lookAt(e, this.position, this.up), this.quaternion.setFromRotationMatrix(c)
  39426. }),
  39427. add: function (e) {
  39428. if (1 < arguments.length) {
  39429. for (var t = 0; t < arguments.length; t++) this.add(arguments[t])
  39430. return this
  39431. }
  39432. return (
  39433. e === this
  39434. ? console.error("THREE.Object3D.add: object can't be added as a child of itself.", e)
  39435. : e instanceof Ci.Object3D
  39436. ? (null !== e.parent && e.parent.remove(e),
  39437. (e.parent = this),
  39438. e.dispatchEvent({
  39439. type: 'added'
  39440. }),
  39441. this.children.push(e))
  39442. : console.error('THREE.Object3D.add: object not an instance of THREE.Object3D.', e),
  39443. this
  39444. )
  39445. },
  39446. remove: function (e) {
  39447. if (1 < arguments.length) for (var t = 0; t < arguments.length; t++) this.remove(arguments[t])
  39448. var i = this.children.indexOf(e)
  39449. ;-1 !== i &&
  39450. ((e.parent = null),
  39451. e.dispatchEvent({
  39452. type: 'removed'
  39453. }),
  39454. this.children.splice(i, 1))
  39455. },
  39456. getObjectById: function (e) {
  39457. return this.getObjectByProperty('id', e)
  39458. },
  39459. getObjectByName: function (e) {
  39460. return this.getObjectByProperty('name', e)
  39461. },
  39462. getObjectByProperty: function (e, t) {
  39463. if (this[e] === t) return this
  39464. for (var i = 0, n = this.children.length; i < n; i++) {
  39465. var r = this.children[i].getObjectByProperty(e, t)
  39466. if (void 0 !== r) return r
  39467. }
  39468. },
  39469. getWorldPosition: function (e) {
  39470. var t = e || new Ci.Vector3()
  39471. return this.updateMatrixWorld(!0), t.setFromMatrixPosition(this.matrixWorld)
  39472. },
  39473. getWorldQuaternion:
  39474. ((s = new Ci.Vector3()),
  39475. (l = new Ci.Vector3()),
  39476. function (e) {
  39477. var t = e || new Ci.Quaternion()
  39478. return this.updateMatrixWorld(!0), this.matrixWorld.decompose(s, t, l), t
  39479. }),
  39480. getWorldRotation:
  39481. ((a = new Ci.Quaternion()),
  39482. function (e) {
  39483. var t = e || new Ci.Euler()
  39484. return this.getWorldQuaternion(a), t.setFromQuaternion(a, this.rotation.order, !1)
  39485. }),
  39486. getWorldScale:
  39487. ((r = new Ci.Vector3()),
  39488. (o = new Ci.Quaternion()),
  39489. function (e) {
  39490. var t = e || new Ci.Vector3()
  39491. return this.updateMatrixWorld(!0), this.matrixWorld.decompose(r, o, t), t
  39492. }),
  39493. getWorldDirection:
  39494. ((n = new Ci.Quaternion()),
  39495. function (e) {
  39496. var t = e || new Ci.Vector3()
  39497. return this.getWorldQuaternion(n), t.set(0, 0, 1).applyQuaternion(n)
  39498. }),
  39499. raycast: function () {},
  39500. traverse: function (e) {
  39501. e(this)
  39502. for (var t = this.children, i = 0, n = t.length; i < n; i++) t[i].traverse(e)
  39503. },
  39504. traverseVisible: function (e) {
  39505. if (!1 !== this.visible) {
  39506. e(this)
  39507. for (var t = this.children, i = 0, n = t.length; i < n; i++) t[i].traverseVisible(e)
  39508. }
  39509. },
  39510. traverseAncestors: function (e) {
  39511. var t = this.parent
  39512. null !== t && (e(t), t.traverseAncestors(e))
  39513. },
  39514. updateMatrix: function () {
  39515. this.matrix.compose(this.position, this.quaternion, this.scale), (this.matrixWorldNeedsUpdate = !0)
  39516. },
  39517. updateMatrixWorld: function (e) {
  39518. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  39519. (!0 !== this.matrixWorldNeedsUpdate && !0 !== e) ||
  39520. (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix), (e = !(this.matrixWorldNeedsUpdate = !1)))
  39521. for (var t = 0, i = this.children.length; t < i; t++) this.children[t].updateMatrixWorld(e)
  39522. },
  39523. toJSON: function (e) {
  39524. function t(e) {
  39525. var t = []
  39526. for (var i in e) {
  39527. var n = e[i]
  39528. delete n.metadata, t.push(n)
  39529. }
  39530. return t
  39531. }
  39532. var i = void 0 === e,
  39533. n = {}
  39534. i &&
  39535. ((e = {
  39536. geometries: {},
  39537. materials: {},
  39538. textures: {},
  39539. images: {}
  39540. }),
  39541. (n.metadata = {
  39542. version: 4.4,
  39543. type: 'Object',
  39544. generator: 'Object3D.toJSON'
  39545. }))
  39546. var r = {}
  39547. if (
  39548. ((r.uuid = this.uuid),
  39549. (r.type = this.type),
  39550. '' !== this.name && (r.name = this.name),
  39551. '{}' !== JSON.stringify(this.userData) && (r.userData = this.userData),
  39552. !0 === this.castShadow && (r.castShadow = !0),
  39553. !0 === this.receiveShadow && (r.receiveShadow = !0),
  39554. !1 === this.visible && (r.visible = !1),
  39555. (r.matrix = this.matrix.toArray()),
  39556. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)), (r.geometry = this.geometry.uuid)),
  39557. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)), (r.material = this.material.uuid)),
  39558. 0 < this.children.length)
  39559. ) {
  39560. r.children = []
  39561. for (var o = 0; o < this.children.length; o++) r.children.push(this.children[o].toJSON(e).object)
  39562. }
  39563. if (i) {
  39564. var a = t(e.geometries),
  39565. s = t(e.materials),
  39566. l = t(e.textures),
  39567. c = t(e.images)
  39568. 0 < a.length && (n.geometries = a), 0 < s.length && (n.materials = s), 0 < l.length && (n.textures = l), 0 < c.length && (n.images = c)
  39569. }
  39570. return (n.object = r), n
  39571. },
  39572. clone: function (e) {
  39573. return new this.constructor().copy(this, e)
  39574. },
  39575. copy: function (e, t) {
  39576. if (
  39577. (void 0 === t && (t = !0),
  39578. (this.name = e.name),
  39579. this.up.copy(e.up),
  39580. this.position.copy(e.position),
  39581. this.quaternion.copy(e.quaternion),
  39582. this.scale.copy(e.scale),
  39583. (this.rotationAutoUpdate = e.rotationAutoUpdate),
  39584. this.matrix.copy(e.matrix),
  39585. this.matrixWorld.copy(e.matrixWorld),
  39586. (this.matrixAutoUpdate = e.matrixAutoUpdate),
  39587. (this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate),
  39588. (this.visible = e.visible),
  39589. (this.castShadow = e.castShadow),
  39590. (this.receiveShadow = e.receiveShadow),
  39591. (this.frustumCulled = e.frustumCulled),
  39592. (this.renderOrder = e.renderOrder),
  39593. (this.userData = JSON.parse(JSON.stringify(e.userData))),
  39594. !0 === t)
  39595. )
  39596. for (var i = 0; i < e.children.length; i++) {
  39597. var n = e.children[i]
  39598. this.add(n.clone())
  39599. }
  39600. return this
  39601. }
  39602. }),
  39603. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  39604. (Ci.Object3DIdCount = 0),
  39605. (Ci.Face3 = function (e, t, i, n, r, o) {
  39606. ;(this.a = e),
  39607. (this.b = t),
  39608. (this.c = i),
  39609. (this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3()),
  39610. (this.vertexNormals = Array.isArray(n) ? n : []),
  39611. (this.color = r instanceof Ci.Color ? r : new Ci.Color()),
  39612. (this.vertexColors = Array.isArray(r) ? r : []),
  39613. (this.materialIndex = void 0 !== o ? o : 0)
  39614. }),
  39615. (Ci.Face3.prototype = {
  39616. constructor: Ci.Face3,
  39617. clone: function () {
  39618. return new this.constructor().copy(this)
  39619. },
  39620. copy: function (e) {
  39621. ;(this.a = e.a), (this.b = e.b), (this.c = e.c), this.normal.copy(e.normal), this.color.copy(e.color), (this.materialIndex = e.materialIndex)
  39622. for (var t = 0, i = e.vertexNormals.length; t < i; t++) this.vertexNormals[t] = e.vertexNormals[t].clone()
  39623. for (t = 0, i = e.vertexColors.length; t < i; t++) this.vertexColors[t] = e.vertexColors[t].clone()
  39624. return this
  39625. }
  39626. }),
  39627. (Ci.BufferAttribute = function (e, t) {
  39628. ;(this.uuid = Ci.Math.generateUUID()),
  39629. (this.array = e),
  39630. (this.itemSize = t),
  39631. (this.dynamic = !1),
  39632. (this.updateRange = {
  39633. offset: 0,
  39634. count: -1
  39635. }),
  39636. (this.version = 0)
  39637. }),
  39638. (Ci.BufferAttribute.prototype = {
  39639. constructor: Ci.BufferAttribute,
  39640. get count() {
  39641. return this.array.length / this.itemSize
  39642. },
  39643. set needsUpdate(e) {
  39644. !0 === e && this.version++
  39645. },
  39646. setDynamic: function (e) {
  39647. return (this.dynamic = e), this
  39648. },
  39649. copy: function (e) {
  39650. return (this.array = new e.array.constructor(e.array)), (this.itemSize = e.itemSize), (this.dynamic = e.dynamic), this
  39651. },
  39652. copyAt: function (e, t, i) {
  39653. ;(e *= this.itemSize), (i *= t.itemSize)
  39654. for (var n = 0, r = this.itemSize; n < r; n++) this.array[e + n] = t.array[i + n]
  39655. return this
  39656. },
  39657. copyArray: function (e) {
  39658. return this.array.set(e), this
  39659. },
  39660. copyColorsArray: function (e) {
  39661. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  39662. var o = e[n]
  39663. void 0 === o && (console.warn('THREE.BufferAttribute.copyColorsArray(): color is undefined', n), (o = new Ci.Color())), (t[i++] = o.r), (t[i++] = o.g), (t[i++] = o.b)
  39664. }
  39665. return this
  39666. },
  39667. copyIndicesArray: function (e) {
  39668. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  39669. var o = e[n]
  39670. ;(t[i++] = o.a), (t[i++] = o.b), (t[i++] = o.c)
  39671. }
  39672. return this
  39673. },
  39674. copyVector2sArray: function (e) {
  39675. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  39676. var o = e[n]
  39677. void 0 === o && (console.warn('THREE.BufferAttribute.copyVector2sArray(): vector is undefined', n), (o = new Ci.Vector2())), (t[i++] = o.x), (t[i++] = o.y)
  39678. }
  39679. return this
  39680. },
  39681. copyVector3sArray: function (e) {
  39682. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  39683. var o = e[n]
  39684. void 0 === o && (console.warn('THREE.BufferAttribute.copyVector3sArray(): vector is undefined', n), (o = new Ci.Vector3())), (t[i++] = o.x), (t[i++] = o.y), (t[i++] = o.z)
  39685. }
  39686. return this
  39687. },
  39688. copyVector4sArray: function (e) {
  39689. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  39690. var o = e[n]
  39691. void 0 === o && (console.warn('THREE.BufferAttribute.copyVector4sArray(): vector is undefined', n), (o = new Ci.Vector4())),
  39692. (t[i++] = o.x),
  39693. (t[i++] = o.y),
  39694. (t[i++] = o.z),
  39695. (t[i++] = o.w)
  39696. }
  39697. return this
  39698. },
  39699. set: function (e, t) {
  39700. return void 0 === t && (t = 0), this.array.set(e, t), this
  39701. },
  39702. getX: function (e) {
  39703. return this.array[e * this.itemSize]
  39704. },
  39705. setX: function (e, t) {
  39706. return (this.array[e * this.itemSize] = t), this
  39707. },
  39708. getY: function (e) {
  39709. return this.array[e * this.itemSize + 1]
  39710. },
  39711. setY: function (e, t) {
  39712. return (this.array[e * this.itemSize + 1] = t), this
  39713. },
  39714. getZ: function (e) {
  39715. return this.array[e * this.itemSize + 2]
  39716. },
  39717. setZ: function (e, t) {
  39718. return (this.array[e * this.itemSize + 2] = t), this
  39719. },
  39720. getW: function (e) {
  39721. return this.array[e * this.itemSize + 3]
  39722. },
  39723. setW: function (e, t) {
  39724. return (this.array[e * this.itemSize + 3] = t), this
  39725. },
  39726. setXY: function (e, t, i) {
  39727. return (e *= this.itemSize), (this.array[e + 0] = t), (this.array[e + 1] = i), this
  39728. },
  39729. setXYZ: function (e, t, i, n) {
  39730. return (e *= this.itemSize), (this.array[e + 0] = t), (this.array[e + 1] = i), (this.array[e + 2] = n), this
  39731. },
  39732. setXYZW: function (e, t, i, n, r) {
  39733. return (e *= this.itemSize), (this.array[e + 0] = t), (this.array[e + 1] = i), (this.array[e + 2] = n), (this.array[e + 3] = r), this
  39734. },
  39735. clone: function () {
  39736. return new this.constructor().copy(this)
  39737. }
  39738. }),
  39739. (Ci.Int8Attribute = function (e, t) {
  39740. return new Ci.BufferAttribute(new Int8Array(e), t)
  39741. }),
  39742. (Ci.Uint8Attribute = function (e, t) {
  39743. return new Ci.BufferAttribute(new Uint8Array(e), t)
  39744. }),
  39745. (Ci.Uint8ClampedAttribute = function (e, t) {
  39746. return new Ci.BufferAttribute(new Uint8ClampedArray(e), t)
  39747. }),
  39748. (Ci.Int16Attribute = function (e, t) {
  39749. return new Ci.BufferAttribute(new Int16Array(e), t)
  39750. }),
  39751. (Ci.Uint16Attribute = function (e, t) {
  39752. return new Ci.BufferAttribute(new Uint16Array(e), t)
  39753. }),
  39754. (Ci.Int32Attribute = function (e, t) {
  39755. return new Ci.BufferAttribute(new Int32Array(e), t)
  39756. }),
  39757. (Ci.Uint32Attribute = function (e, t) {
  39758. return new Ci.BufferAttribute(new Uint32Array(e), t)
  39759. }),
  39760. (Ci.Float32Attribute = function (e, t) {
  39761. return new Ci.BufferAttribute(new Float32Array(e), t)
  39762. }),
  39763. (Ci.Float64Attribute = function (e, t) {
  39764. return new Ci.BufferAttribute(new Float64Array(e), t)
  39765. }),
  39766. (Ci.DynamicBufferAttribute = function (e, t) {
  39767. return console.warn('THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.'), new Ci.BufferAttribute(e, t).setDynamic(!0)
  39768. }),
  39769. (Ci.InstancedBufferAttribute = function (e, t, i) {
  39770. Ci.BufferAttribute.call(this, e, t), (this.meshPerAttribute = i || 1)
  39771. }),
  39772. (Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype)),
  39773. (Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute),
  39774. (Ci.InstancedBufferAttribute.prototype.copy = function (e) {
  39775. return Ci.BufferAttribute.prototype.copy.call(this, e), (this.meshPerAttribute = e.meshPerAttribute), this
  39776. }),
  39777. (Ci.InterleavedBuffer = function (e, t) {
  39778. ;(this.uuid = Ci.Math.generateUUID()),
  39779. (this.array = e),
  39780. (this.stride = t),
  39781. (this.dynamic = !1),
  39782. (this.updateRange = {
  39783. offset: 0,
  39784. count: -1
  39785. }),
  39786. (this.version = 0)
  39787. }),
  39788. (Ci.InterleavedBuffer.prototype = {
  39789. constructor: Ci.InterleavedBuffer,
  39790. get length() {
  39791. return this.array.length
  39792. },
  39793. get count() {
  39794. return this.array.length / this.stride
  39795. },
  39796. set needsUpdate(e) {
  39797. !0 === e && this.version++
  39798. },
  39799. setDynamic: function (e) {
  39800. return (this.dynamic = e), this
  39801. },
  39802. copy: function (e) {
  39803. return (this.array = new e.array.constructor(e.array)), (this.stride = e.stride), (this.dynamic = e.dynamic), this
  39804. },
  39805. copyAt: function (e, t, i) {
  39806. ;(e *= this.stride), (i *= t.stride)
  39807. for (var n = 0, r = this.stride; n < r; n++) this.array[e + n] = t.array[i + n]
  39808. return this
  39809. },
  39810. set: function (e, t) {
  39811. return void 0 === t && (t = 0), this.array.set(e, t), this
  39812. },
  39813. clone: function () {
  39814. return new this.constructor().copy(this)
  39815. }
  39816. }),
  39817. (Ci.InstancedInterleavedBuffer = function (e, t, i) {
  39818. Ci.InterleavedBuffer.call(this, e, t), (this.meshPerAttribute = i || 1)
  39819. }),
  39820. (Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype)),
  39821. (Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer),
  39822. (Ci.InstancedInterleavedBuffer.prototype.copy = function (e) {
  39823. return Ci.InterleavedBuffer.prototype.copy.call(this, e), (this.meshPerAttribute = e.meshPerAttribute), this
  39824. }),
  39825. (Ci.InterleavedBufferAttribute = function (e, t, i) {
  39826. ;(this.uuid = Ci.Math.generateUUID()), (this.data = e), (this.itemSize = t), (this.offset = i)
  39827. }),
  39828. (Ci.InterleavedBufferAttribute.prototype = {
  39829. constructor: Ci.InterleavedBufferAttribute,
  39830. get length() {
  39831. return console.warn('THREE.BufferAttribute: .length has been deprecated. Please use .count.'), this.array.length
  39832. },
  39833. get count() {
  39834. return this.data.count
  39835. },
  39836. setX: function (e, t) {
  39837. return (this.data.array[e * this.data.stride + this.offset] = t), this
  39838. },
  39839. setY: function (e, t) {
  39840. return (this.data.array[e * this.data.stride + this.offset + 1] = t), this
  39841. },
  39842. setZ: function (e, t) {
  39843. return (this.data.array[e * this.data.stride + this.offset + 2] = t), this
  39844. },
  39845. setW: function (e, t) {
  39846. return (this.data.array[e * this.data.stride + this.offset + 3] = t), this
  39847. },
  39848. getX: function (e) {
  39849. return this.data.array[e * this.data.stride + this.offset]
  39850. },
  39851. getY: function (e) {
  39852. return this.data.array[e * this.data.stride + this.offset + 1]
  39853. },
  39854. getZ: function (e) {
  39855. return this.data.array[e * this.data.stride + this.offset + 2]
  39856. },
  39857. getW: function (e) {
  39858. return this.data.array[e * this.data.stride + this.offset + 3]
  39859. },
  39860. setXY: function (e, t, i) {
  39861. return (e = e * this.data.stride + this.offset), (this.data.array[e + 0] = t), (this.data.array[e + 1] = i), this
  39862. },
  39863. setXYZ: function (e, t, i, n) {
  39864. return (e = e * this.data.stride + this.offset), (this.data.array[e + 0] = t), (this.data.array[e + 1] = i), (this.data.array[e + 2] = n), this
  39865. },
  39866. setXYZW: function (e, t, i, n, r) {
  39867. return (e = e * this.data.stride + this.offset), (this.data.array[e + 0] = t), (this.data.array[e + 1] = i), (this.data.array[e + 2] = n), (this.data.array[e + 3] = r), this
  39868. }
  39869. }),
  39870. (Ci.Geometry = function () {
  39871. Object.defineProperty(this, 'id', {
  39872. value: Ci.GeometryIdCount++
  39873. }),
  39874. (this.uuid = Ci.Math.generateUUID()),
  39875. (this.name = ''),
  39876. (this.type = 'Geometry'),
  39877. (this.vertices = []),
  39878. (this.colors = []),
  39879. (this.faces = []),
  39880. (this.faceVertexUvs = [[]]),
  39881. (this.morphTargets = []),
  39882. (this.morphNormals = []),
  39883. (this.skinWeights = []),
  39884. (this.skinIndices = []),
  39885. (this.lineDistances = []),
  39886. (this.boundingBox = null),
  39887. (this.boundingSphere = null),
  39888. (this.verticesNeedUpdate = !1),
  39889. (this.elementsNeedUpdate = !1),
  39890. (this.uvsNeedUpdate = !1),
  39891. (this.normalsNeedUpdate = !1),
  39892. (this.colorsNeedUpdate = !1),
  39893. (this.lineDistancesNeedUpdate = !1),
  39894. (this.groupsNeedUpdate = !1)
  39895. }),
  39896. (Ci.Geometry.prototype = {
  39897. constructor: Ci.Geometry,
  39898. applyMatrix: function (e) {
  39899. for (var t = new Ci.Matrix3().getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  39900. this.vertices[i].applyMatrix4(e)
  39901. }
  39902. for (i = 0, n = this.faces.length; i < n; i++) {
  39903. var r = this.faces[i]
  39904. r.normal.applyMatrix3(t).normalize()
  39905. for (var o = 0, a = r.vertexNormals.length; o < a; o++) r.vertexNormals[o].applyMatrix3(t).normalize()
  39906. }
  39907. return (
  39908. null !== this.boundingBox && this.computeBoundingBox(),
  39909. null !== this.boundingSphere && this.computeBoundingSphere(),
  39910. (this.verticesNeedUpdate = !0),
  39911. (this.normalsNeedUpdate = !0),
  39912. this
  39913. )
  39914. },
  39915. rotateX: function (e) {
  39916. return void 0 === mt && (mt = new Ci.Matrix4()), mt.makeRotationX(e), this.applyMatrix(mt), this
  39917. },
  39918. rotateY: function (e) {
  39919. return void 0 === gt && (gt = new Ci.Matrix4()), gt.makeRotationY(e), this.applyMatrix(gt), this
  39920. },
  39921. rotateZ: function (e) {
  39922. return void 0 === ft && (ft = new Ci.Matrix4()), ft.makeRotationZ(e), this.applyMatrix(ft), this
  39923. },
  39924. translate: function (e, t, i) {
  39925. return void 0 === pt && (pt = new Ci.Matrix4()), pt.makeTranslation(e, t, i), this.applyMatrix(pt), this
  39926. },
  39927. scale: function (e, t, i) {
  39928. return void 0 === dt && (dt = new Ci.Matrix4()), dt.makeScale(e, t, i), this.applyMatrix(dt), this
  39929. },
  39930. lookAt: function (e) {
  39931. void 0 === ut && (ut = new Ci.Object3D()), ut.lookAt(e), ut.updateMatrix(), this.applyMatrix(ut.matrix)
  39932. },
  39933. fromBufferGeometry: function (e) {
  39934. function t(e, t, i, n) {
  39935. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : [],
  39936. o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : [],
  39937. a = new Ci.Face3(e, t, i, r, o, n)
  39938. s.faces.push(a),
  39939. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  39940. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  39941. }
  39942. var s = this,
  39943. i = null !== e.index ? e.index.array : void 0,
  39944. n = e.attributes,
  39945. r = n.position.array,
  39946. l = void 0 !== n.normal ? n.normal.array : void 0,
  39947. c = void 0 !== n.color ? n.color.array : void 0,
  39948. h = void 0 !== n.uv ? n.uv.array : void 0,
  39949. u = void 0 !== n.uv2 ? n.uv2.array : void 0
  39950. void 0 !== u && (this.faceVertexUvs[1] = [])
  39951. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3, a += 2)
  39952. s.vertices.push(new Ci.Vector3(r[o], r[o + 1], r[o + 2])),
  39953. void 0 !== l && d.push(new Ci.Vector3(l[o], l[o + 1], l[o + 2])),
  39954. void 0 !== c && s.colors.push(new Ci.Color(c[o], c[o + 1], c[o + 2])),
  39955. void 0 !== h && p.push(new Ci.Vector2(h[a], h[a + 1])),
  39956. void 0 !== u && f.push(new Ci.Vector2(u[a], u[a + 1]))
  39957. if (void 0 !== i) {
  39958. var g = e.groups
  39959. if (0 < g.length) for (o = 0; o < g.length; o++) for (var m = g[o], v = m.start, y = ((a = v), v + m.count); a < y; a += 3) t(i[a], i[a + 1], i[a + 2], m.materialIndex)
  39960. else for (o = 0; o < i.length; o += 3) t(i[o], i[o + 1], i[o + 2])
  39961. } else for (o = 0; o < r.length / 3; o += 3) t(o, o + 1, o + 2)
  39962. return (
  39963. this.computeFaceNormals(), null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()), null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()), this
  39964. )
  39965. },
  39966. center: function () {
  39967. this.computeBoundingBox()
  39968. var e = this.boundingBox.center().negate()
  39969. return this.translate(e.x, e.y, e.z), e
  39970. },
  39971. normalize: function () {
  39972. this.computeBoundingSphere()
  39973. var e = this.boundingSphere.center,
  39974. t = this.boundingSphere.radius,
  39975. i = 0 === t ? 1 : 1 / t,
  39976. n = new Ci.Matrix4()
  39977. return n.set(i, 0, 0, -i * e.x, 0, i, 0, -i * e.y, 0, 0, i, -i * e.z, 0, 0, 0, 1), this.applyMatrix(n), this
  39978. },
  39979. computeFaceNormals: function () {
  39980. for (var e = new Ci.Vector3(), t = new Ci.Vector3(), i = 0, n = this.faces.length; i < n; i++) {
  39981. var r = this.faces[i],
  39982. o = this.vertices[r.a],
  39983. a = this.vertices[r.b],
  39984. s = this.vertices[r.c]
  39985. e.subVectors(s, a), t.subVectors(o, a), e.cross(t), e.normalize(), r.normal.copy(e)
  39986. }
  39987. },
  39988. computeVertexNormals: function (e) {
  39989. var t, i, n, r, o, a
  39990. for (void 0 === e && (e = !0), a = new Array(this.vertices.length), t = 0, i = this.vertices.length; t < i; t++) a[t] = new Ci.Vector3()
  39991. if (e) {
  39992. var s,
  39993. l,
  39994. c,
  39995. h = new Ci.Vector3(),
  39996. u = new Ci.Vector3()
  39997. for (n = 0, r = this.faces.length; n < r; n++)
  39998. (o = this.faces[n]),
  39999. (s = this.vertices[o.a]),
  40000. (l = this.vertices[o.b]),
  40001. (c = this.vertices[o.c]),
  40002. h.subVectors(c, l),
  40003. u.subVectors(s, l),
  40004. h.cross(u),
  40005. a[o.a].add(h),
  40006. a[o.b].add(h),
  40007. a[o.c].add(h)
  40008. } else for (n = 0, r = this.faces.length; n < r; n++) a[(o = this.faces[n]).a].add(o.normal), a[o.b].add(o.normal), a[o.c].add(o.normal)
  40009. for (t = 0, i = this.vertices.length; t < i; t++) a[t].normalize()
  40010. for (n = 0, r = this.faces.length; n < r; n++) {
  40011. var d = (o = this.faces[n]).vertexNormals
  40012. 3 === d.length ? (d[0].copy(a[o.a]), d[1].copy(a[o.b]), d[2].copy(a[o.c])) : ((d[0] = a[o.a].clone()), (d[1] = a[o.b].clone()), (d[2] = a[o.c].clone()))
  40013. }
  40014. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  40015. },
  40016. computeMorphNormals: function () {
  40017. var e, t, i, n, r
  40018. for (i = 0, n = this.faces.length; i < n; i++)
  40019. for (
  40020. (r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : (r.__originalFaceNormal = r.normal.clone()),
  40021. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  40022. e = 0,
  40023. t = r.vertexNormals.length;
  40024. e < t;
  40025. e++
  40026. )
  40027. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : (r.__originalVertexNormals[e] = r.vertexNormals[e].clone())
  40028. var o = new Ci.Geometry()
  40029. for (o.faces = this.faces, e = 0, t = this.morphTargets.length; e < t; e++) {
  40030. if (!this.morphNormals[e]) {
  40031. ;(this.morphNormals[e] = {}), (this.morphNormals[e].faceNormals = []), (this.morphNormals[e].vertexNormals = [])
  40032. var a = this.morphNormals[e].faceNormals,
  40033. s = this.morphNormals[e].vertexNormals
  40034. for (i = 0, n = this.faces.length; i < n; i++)
  40035. (l = new Ci.Vector3()),
  40036. (c = {
  40037. a: new Ci.Vector3(),
  40038. b: new Ci.Vector3(),
  40039. c: new Ci.Vector3()
  40040. }),
  40041. a.push(l),
  40042. s.push(c)
  40043. }
  40044. var l,
  40045. c,
  40046. h = this.morphNormals[e]
  40047. for (o.vertices = this.morphTargets[e].vertices, o.computeFaceNormals(), o.computeVertexNormals(), i = 0, n = this.faces.length; i < n; i++)
  40048. (r = this.faces[i]), (l = h.faceNormals[i]), (c = h.vertexNormals[i]), l.copy(r.normal), c.a.copy(r.vertexNormals[0]), c.b.copy(r.vertexNormals[1]), c.c.copy(r.vertexNormals[2])
  40049. }
  40050. for (i = 0, n = this.faces.length; i < n; i++) ((r = this.faces[i]).normal = r.__originalFaceNormal), (r.vertexNormals = r.__originalVertexNormals)
  40051. },
  40052. computeTangents: function () {
  40053. console.warn('THREE.Geometry: .computeTangents() has been removed.')
  40054. },
  40055. computeLineDistances: function () {
  40056. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++) 0 < i && (e += t[i].distanceTo(t[i - 1])), (this.lineDistances[i] = e)
  40057. },
  40058. computeBoundingBox: function () {
  40059. null === this.boundingBox && (this.boundingBox = new Ci.Box3()), this.boundingBox.setFromPoints(this.vertices)
  40060. },
  40061. computeBoundingSphere: function () {
  40062. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere()), this.boundingSphere.setFromPoints(this.vertices)
  40063. },
  40064. merge: function (e, t, i) {
  40065. if (e instanceof Ci.Geometry != 0) {
  40066. var n,
  40067. r = this.vertices.length,
  40068. o = this.vertices,
  40069. a = e.vertices,
  40070. s = this.faces,
  40071. l = e.faces,
  40072. c = this.faceVertexUvs[0],
  40073. h = e.faceVertexUvs[0]
  40074. void 0 === i && (i = 0), void 0 !== t && (n = new Ci.Matrix3().getNormalMatrix(t))
  40075. for (var u = 0, d = a.length; u < d; u++) {
  40076. var p = a[u].clone()
  40077. void 0 !== t && p.applyMatrix4(t), o.push(p)
  40078. }
  40079. for (u = 0, d = l.length; u < d; u++) {
  40080. var f,
  40081. g,
  40082. m,
  40083. v = l[u],
  40084. y = v.vertexNormals,
  40085. A = v.vertexColors
  40086. ;(f = new Ci.Face3(v.a + r, v.b + r, v.c + r)).normal.copy(v.normal), void 0 !== n && f.normal.applyMatrix3(n).normalize()
  40087. for (var C = 0, I = y.length; C < I; C++) (g = y[C].clone()), void 0 !== n && g.applyMatrix3(n).normalize(), f.vertexNormals.push(g)
  40088. f.color.copy(v.color)
  40089. for (C = 0, I = A.length; C < I; C++) (m = A[C]), f.vertexColors.push(m.clone())
  40090. ;(f.materialIndex = v.materialIndex + i), s.push(f)
  40091. }
  40092. for (u = 0, d = h.length; u < d; u++) {
  40093. var E = h[u],
  40094. _ = []
  40095. if (void 0 !== E) {
  40096. for (C = 0, I = E.length; C < I; C++) _.push(E[C].clone())
  40097. c.push(_)
  40098. }
  40099. }
  40100. } else console.error('THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.', e)
  40101. },
  40102. mergeMesh: function (e) {
  40103. return e instanceof Ci.Mesh == 0
  40104. ? void console.error('THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.', e)
  40105. : (e.matrixAutoUpdate && e.updateMatrix(), void this.merge(e.geometry, e.matrix))
  40106. },
  40107. mergeVertices: function () {
  40108. var e,
  40109. t,
  40110. i,
  40111. n,
  40112. r,
  40113. o,
  40114. a,
  40115. s,
  40116. l = {},
  40117. c = [],
  40118. h = [],
  40119. u = Math.pow(10, 4)
  40120. for (i = 0, n = this.vertices.length; i < n; i++)
  40121. (e = this.vertices[i]),
  40122. void 0 === l[(t = Math.round(e.x * u) + '_' + Math.round(e.y * u) + '_' + Math.round(e.z * u))] ? ((l[t] = i), c.push(this.vertices[i]), (h[i] = c.length - 1)) : (h[i] = h[l[t]])
  40123. var d = []
  40124. for (i = 0, n = this.faces.length; i < n; i++) {
  40125. ;((r = this.faces[i]).a = h[r.a]), (r.b = h[r.b]), (r.c = h[r.c]), (o = [r.a, r.b, r.c])
  40126. for (var p = 0; p < 3; p++)
  40127. if (o[p] === o[(p + 1) % 3]) {
  40128. p, d.push(i)
  40129. break
  40130. }
  40131. }
  40132. for (i = d.length - 1; 0 <= i; i--) {
  40133. var f = d[i]
  40134. for (this.faces.splice(f, 1), a = 0, s = this.faceVertexUvs.length; a < s; a++) this.faceVertexUvs[a].splice(f, 1)
  40135. }
  40136. var g = this.vertices.length - c.length
  40137. return (this.vertices = c), g
  40138. },
  40139. sortFacesByMaterialIndex: function () {
  40140. for (var e = this.faces, t = e.length, i = 0; i < t; i++) e[i]._id = i
  40141. e.sort(function (e, t) {
  40142. return e.materialIndex - t.materialIndex
  40143. })
  40144. var n,
  40145. r,
  40146. o = this.faceVertexUvs[0],
  40147. a = this.faceVertexUvs[1]
  40148. o && o.length === t && (n = []), a && a.length === t && (r = [])
  40149. for (i = 0; i < t; i++) {
  40150. var s = e[i]._id
  40151. n && n.push(o[s]), r && r.push(a[s])
  40152. }
  40153. n && (this.faceVertexUvs[0] = n), r && (this.faceVertexUvs[1] = r)
  40154. },
  40155. toJSON: function () {
  40156. function e(e, t, i) {
  40157. return i ? e | (1 << t) : e & ~(1 << t)
  40158. }
  40159. function t(e) {
  40160. var t = e.x.toString() + e.y.toString() + e.z.toString()
  40161. return void 0 !== d[t] || ((d[t] = u.length / 3), u.push(e.x, e.y, e.z)), d[t]
  40162. }
  40163. function i(e) {
  40164. var t = e.r.toString() + e.g.toString() + e.b.toString()
  40165. return void 0 !== f[t] || ((f[t] = p.length), p.push(e.getHex())), f[t]
  40166. }
  40167. function n(e) {
  40168. var t = e.x.toString() + e.y.toString()
  40169. return void 0 !== m[t] || ((m[t] = g.length / 2), g.push(e.x, e.y)), m[t]
  40170. }
  40171. var r = {
  40172. metadata: {
  40173. version: 4.4,
  40174. type: 'Geometry',
  40175. generator: 'Geometry.toJSON'
  40176. }
  40177. }
  40178. if (((r.uuid = this.uuid), (r.type = this.type), '' !== this.name && (r.name = this.name), void 0 !== this.parameters)) {
  40179. var o = this.parameters
  40180. for (var a in o) void 0 !== o[a] && (r[a] = o[a])
  40181. return r
  40182. }
  40183. for (var s = [], l = 0; l < this.vertices.length; l++) {
  40184. var c = this.vertices[l]
  40185. s.push(c.x, c.y, c.z)
  40186. }
  40187. var h = [],
  40188. u = [],
  40189. d = {},
  40190. p = [],
  40191. f = {},
  40192. g = [],
  40193. m = {}
  40194. for (l = 0; l < this.faces.length; l++) {
  40195. var v = this.faces[l],
  40196. y = void 0 !== this.faceVertexUvs[0][l],
  40197. A = 0 < v.normal.length(),
  40198. C = 0 < v.vertexNormals.length,
  40199. I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b,
  40200. E = 0 < v.vertexColors.length,
  40201. _ = 0
  40202. if (
  40203. ((_ = e((_ = e((_ = e((_ = e((_ = e((_ = e((_ = e((_ = e(_, 0, 0)), 1, !0)), 2, !1)), 3, y)), 4, A)), 5, C)), 6, I)), 7, E)),
  40204. h.push(_),
  40205. h.push(v.a, v.b, v.c),
  40206. h.push(v.materialIndex),
  40207. y)
  40208. ) {
  40209. var b = this.faceVertexUvs[0][l]
  40210. h.push(n(b[0]), n(b[1]), n(b[2]))
  40211. }
  40212. if ((A && h.push(t(v.normal)), C)) {
  40213. var w = v.vertexNormals
  40214. h.push(t(w[0]), t(w[1]), t(w[2]))
  40215. }
  40216. if ((I && h.push(i(v.color)), E)) {
  40217. var T = v.vertexColors
  40218. h.push(i(T[0]), i(T[1]), i(T[2]))
  40219. }
  40220. }
  40221. return (r.data = {}), (r.data.vertices = s), (r.data.normals = u), 0 < p.length && (r.data.colors = p), 0 < g.length && (r.data.uvs = [g]), (r.data.faces = h), r
  40222. },
  40223. clone: function () {
  40224. return new Ci.Geometry().copy(this)
  40225. },
  40226. copy: function (e) {
  40227. ;(this.vertices = []), (this.faces = []), (this.faceVertexUvs = [[]])
  40228. for (var t = e.vertices, i = 0, n = t.length; i < n; i++) this.vertices.push(t[i].clone())
  40229. var r = e.faces
  40230. for (i = 0, n = r.length; i < n; i++) this.faces.push(r[i].clone())
  40231. for (i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  40232. var o = e.faceVertexUvs[i]
  40233. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = [])
  40234. for (var a = 0, s = o.length; a < s; a++) {
  40235. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  40236. var d = l[h]
  40237. c.push(d.clone())
  40238. }
  40239. this.faceVertexUvs[i].push(c)
  40240. }
  40241. }
  40242. return this
  40243. },
  40244. dispose: function () {
  40245. this.dispatchEvent({
  40246. type: 'dispose'
  40247. })
  40248. }
  40249. }),
  40250. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  40251. (Ci.GeometryIdCount = 0),
  40252. (Ci.DirectGeometry = function () {
  40253. Object.defineProperty(this, 'id', {
  40254. value: Ci.GeometryIdCount++
  40255. }),
  40256. (this.uuid = Ci.Math.generateUUID()),
  40257. (this.name = ''),
  40258. (this.type = 'DirectGeometry'),
  40259. (this.indices = []),
  40260. (this.vertices = []),
  40261. (this.normals = []),
  40262. (this.colors = []),
  40263. (this.uvs = []),
  40264. (this.uvs2 = []),
  40265. (this.groups = []),
  40266. (this.morphTargets = {}),
  40267. (this.skinWeights = []),
  40268. (this.skinIndices = []),
  40269. (this.boundingBox = null),
  40270. (this.boundingSphere = null),
  40271. (this.verticesNeedUpdate = !1),
  40272. (this.normalsNeedUpdate = !1),
  40273. (this.colorsNeedUpdate = !1),
  40274. (this.uvsNeedUpdate = !1),
  40275. (this.groupsNeedUpdate = !1)
  40276. }),
  40277. (Ci.DirectGeometry.prototype = {
  40278. constructor: Ci.DirectGeometry,
  40279. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  40280. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  40281. computeFaceNormals: function () {
  40282. console.warn('THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.')
  40283. },
  40284. computeVertexNormals: function () {
  40285. console.warn('THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.')
  40286. },
  40287. computeGroups: function (e) {
  40288. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  40289. var a = r[o]
  40290. a.materialIndex !== i &&
  40291. ((i = a.materialIndex),
  40292. void 0 !== t && ((t.count = 3 * o - t.start), n.push(t)),
  40293. (t = {
  40294. start: 3 * o,
  40295. materialIndex: i
  40296. }))
  40297. }
  40298. void 0 !== t && ((t.count = 3 * o - t.start), n.push(t)), (this.groups = n)
  40299. },
  40300. fromGeometry: function (e) {
  40301. var t,
  40302. i = e.faces,
  40303. n = e.vertices,
  40304. r = e.faceVertexUvs,
  40305. o = r[0] && 0 < r[0].length,
  40306. a = r[1] && 0 < r[1].length,
  40307. s = e.morphTargets,
  40308. l = s.length
  40309. if (0 < l) {
  40310. t = []
  40311. for (var c = 0; c < l; c++) t[c] = []
  40312. this.morphTargets.position = t
  40313. }
  40314. var h,
  40315. u = e.morphNormals,
  40316. d = u.length
  40317. if (0 < d) {
  40318. h = []
  40319. for (c = 0; c < d; c++) h[c] = []
  40320. this.morphTargets.normal = h
  40321. }
  40322. var p = e.skinIndices,
  40323. f = e.skinWeights,
  40324. g = p.length === n.length,
  40325. m = f.length === n.length
  40326. for (c = 0; c < i.length; c++) {
  40327. var v = i[c]
  40328. this.vertices.push(n[v.a], n[v.b], n[v.c])
  40329. var y = v.vertexNormals
  40330. if (3 === y.length) this.normals.push(y[0], y[1], y[2])
  40331. else {
  40332. var A = v.normal
  40333. this.normals.push(A, A, A)
  40334. }
  40335. var C,
  40336. I = v.vertexColors
  40337. if (3 === I.length) this.colors.push(I[0], I[1], I[2])
  40338. else {
  40339. var E = v.color
  40340. this.colors.push(E, E, E)
  40341. }
  40342. if (!0 === o)
  40343. void 0 !== (C = r[0][c])
  40344. ? this.uvs.push(C[0], C[1], C[2])
  40345. : (console.warn('THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ', c), this.uvs.push(new Ci.Vector2(), new Ci.Vector2(), new Ci.Vector2()))
  40346. if (!0 === a)
  40347. void 0 !== (C = r[1][c])
  40348. ? this.uvs2.push(C[0], C[1], C[2])
  40349. : (console.warn('THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ', c), this.uvs2.push(new Ci.Vector2(), new Ci.Vector2(), new Ci.Vector2()))
  40350. for (var _ = 0; _ < l; _++) {
  40351. var b = s[_].vertices
  40352. t[_].push(b[v.a], b[v.b], b[v.c])
  40353. }
  40354. for (_ = 0; _ < d; _++) {
  40355. var w = u[_].vertexNormals[c]
  40356. h[_].push(w.a, w.b, w.c)
  40357. }
  40358. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]), m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  40359. }
  40360. return (
  40361. this.computeGroups(e),
  40362. (this.verticesNeedUpdate = e.verticesNeedUpdate),
  40363. (this.normalsNeedUpdate = e.normalsNeedUpdate),
  40364. (this.colorsNeedUpdate = e.colorsNeedUpdate),
  40365. (this.uvsNeedUpdate = e.uvsNeedUpdate),
  40366. (this.groupsNeedUpdate = e.groupsNeedUpdate),
  40367. this
  40368. )
  40369. },
  40370. dispose: function () {
  40371. this.dispatchEvent({
  40372. type: 'dispose'
  40373. })
  40374. }
  40375. }),
  40376. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  40377. (Ci.BufferGeometry = function () {
  40378. Object.defineProperty(this, 'id', {
  40379. value: Ci.GeometryIdCount++
  40380. }),
  40381. (this.uuid = Ci.Math.generateUUID()),
  40382. (this.name = ''),
  40383. (this.type = 'BufferGeometry'),
  40384. (this.index = null),
  40385. (this.attributes = {}),
  40386. (this.morphAttributes = {}),
  40387. (this.groups = []),
  40388. (this.boundingBox = null),
  40389. (this.boundingSphere = null),
  40390. (this.drawRange = {
  40391. start: 0,
  40392. count: 1 / 0
  40393. })
  40394. }),
  40395. (Ci.BufferGeometry.prototype = {
  40396. constructor: Ci.BufferGeometry,
  40397. getIndex: function () {
  40398. return this.index
  40399. },
  40400. setIndex: function (e) {
  40401. this.index = e
  40402. },
  40403. addAttribute: function (e, t) {
  40404. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0
  40405. ? (console.warn('THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).'), void this.addAttribute(e, new Ci.BufferAttribute(t, arguments[2])))
  40406. : 'index' === e
  40407. ? (console.warn('THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.'), void this.setIndex(t))
  40408. : ((this.attributes[e] = t), this)
  40409. },
  40410. getAttribute: function (e) {
  40411. return this.attributes[e]
  40412. },
  40413. removeAttribute: function (e) {
  40414. return delete this.attributes[e], this
  40415. },
  40416. addGroup: function (e, t, i) {
  40417. this.groups.push({
  40418. start: e,
  40419. count: t,
  40420. materialIndex: void 0 !== i ? i : 0
  40421. })
  40422. },
  40423. clearGroups: function () {
  40424. this.groups = []
  40425. },
  40426. setDrawRange: function (e, t) {
  40427. ;(this.drawRange.start = e), (this.drawRange.count = t)
  40428. },
  40429. applyMatrix: function (e) {
  40430. var t = this.attributes.position
  40431. void 0 !== t && (e.applyToVector3Array(t.array), (t.needsUpdate = !0))
  40432. var i = this.attributes.normal
  40433. void 0 !== i && (new Ci.Matrix3().getNormalMatrix(e).applyToVector3Array(i.array), (i.needsUpdate = !0))
  40434. return null !== this.boundingBox && this.computeBoundingBox(), null !== this.boundingSphere && this.computeBoundingSphere(), this
  40435. },
  40436. rotateX: function (e) {
  40437. return void 0 === ht && (ht = new Ci.Matrix4()), ht.makeRotationX(e), this.applyMatrix(ht), this
  40438. },
  40439. rotateY: function (e) {
  40440. return void 0 === ct && (ct = new Ci.Matrix4()), ct.makeRotationY(e), this.applyMatrix(ct), this
  40441. },
  40442. rotateZ: function (e) {
  40443. return void 0 === lt && (lt = new Ci.Matrix4()), lt.makeRotationZ(e), this.applyMatrix(lt), this
  40444. },
  40445. translate: function (e, t, i) {
  40446. return void 0 === st && (st = new Ci.Matrix4()), st.makeTranslation(e, t, i), this.applyMatrix(st), this
  40447. },
  40448. scale: function (e, t, i) {
  40449. return void 0 === at && (at = new Ci.Matrix4()), at.makeScale(e, t, i), this.applyMatrix(at), this
  40450. },
  40451. lookAt: function (e) {
  40452. void 0 === ot && (ot = new Ci.Object3D()), ot.lookAt(e), ot.updateMatrix(), this.applyMatrix(ot.matrix)
  40453. },
  40454. center: function () {
  40455. this.computeBoundingBox()
  40456. var e = this.boundingBox.center().negate()
  40457. return this.translate(e.x, e.y, e.z), e
  40458. },
  40459. setFromObject: function (e) {
  40460. var t = e.geometry
  40461. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  40462. var i = new Ci.Float32Attribute(3 * t.vertices.length, 3),
  40463. n = new Ci.Float32Attribute(3 * t.colors.length, 3)
  40464. if (
  40465. (this.addAttribute('position', i.copyVector3sArray(t.vertices)),
  40466. this.addAttribute('color', n.copyColorsArray(t.colors)),
  40467. t.lineDistances && t.lineDistances.length === t.vertices.length)
  40468. ) {
  40469. var r = new Ci.Float32Attribute(t.lineDistances.length, 1)
  40470. this.addAttribute('lineDistance', r.copyArray(t.lineDistances))
  40471. }
  40472. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()), null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  40473. } else e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t)
  40474. return this
  40475. },
  40476. updateFromObject: function (e) {
  40477. var t,
  40478. i = e.geometry
  40479. if (e instanceof Ci.Mesh) {
  40480. var n = i.__directGeometry
  40481. if (void 0 === n) return this.fromGeometry(i)
  40482. ;(n.verticesNeedUpdate = i.verticesNeedUpdate),
  40483. (n.normalsNeedUpdate = i.normalsNeedUpdate),
  40484. (n.colorsNeedUpdate = i.colorsNeedUpdate),
  40485. (n.uvsNeedUpdate = i.uvsNeedUpdate),
  40486. (n.groupsNeedUpdate = i.groupsNeedUpdate),
  40487. (i.verticesNeedUpdate = !1),
  40488. (i.normalsNeedUpdate = !1),
  40489. (i.colorsNeedUpdate = !1),
  40490. (i.uvsNeedUpdate = !1),
  40491. (i.groupsNeedUpdate = !1),
  40492. (i = n)
  40493. }
  40494. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices), (t.needsUpdate = !0)), (i.verticesNeedUpdate = !1))
  40495. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals), (t.needsUpdate = !0)), (i.normalsNeedUpdate = !1))
  40496. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors), (t.needsUpdate = !0)), (i.colorsNeedUpdate = !1))
  40497. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs), (t.needsUpdate = !0)), (i.uvsNeedUpdate = !1))
  40498. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances), (t.needsUpdate = !0)), (i.lineDistancesNeedUpdate = !1))
  40499. return i.groupsNeedUpdate && (i.computeGroups(e.geometry), (this.groups = i.groups), (i.groupsNeedUpdate = !1)), this
  40500. },
  40501. fromGeometry: function (e) {
  40502. return (e.__directGeometry = new Ci.DirectGeometry().fromGeometry(e)), this.fromDirectGeometry(e.__directGeometry)
  40503. },
  40504. fromDirectGeometry: function (e) {
  40505. var t = new Float32Array(3 * e.vertices.length)
  40506. if ((this.addAttribute('position', new Ci.BufferAttribute(t, 3).copyVector3sArray(e.vertices)), 0 < e.normals.length)) {
  40507. var i = new Float32Array(3 * e.normals.length)
  40508. this.addAttribute('normal', new Ci.BufferAttribute(i, 3).copyVector3sArray(e.normals))
  40509. }
  40510. if (0 < e.colors.length) {
  40511. var n = new Float32Array(3 * e.colors.length)
  40512. this.addAttribute('color', new Ci.BufferAttribute(n, 3).copyColorsArray(e.colors))
  40513. }
  40514. if (0 < e.uvs.length) {
  40515. var r = new Float32Array(2 * e.uvs.length)
  40516. this.addAttribute('uv', new Ci.BufferAttribute(r, 2).copyVector2sArray(e.uvs))
  40517. }
  40518. if (0 < e.uvs2.length) {
  40519. var o = new Float32Array(2 * e.uvs2.length)
  40520. this.addAttribute('uv2', new Ci.BufferAttribute(o, 2).copyVector2sArray(e.uvs2))
  40521. }
  40522. if (0 < e.indices.length) {
  40523. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length)
  40524. this.setIndex(new Ci.BufferAttribute(a, 1).copyIndicesArray(e.indices))
  40525. }
  40526. for (var s in ((this.groups = e.groups), e.morphTargets)) {
  40527. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  40528. var d = c[h],
  40529. p = new Ci.Float32Attribute(3 * d.length, 3)
  40530. l.push(p.copyVector3sArray(d))
  40531. }
  40532. this.morphAttributes[s] = l
  40533. }
  40534. if (0 < e.skinIndices.length) {
  40535. var f = new Ci.Float32Attribute(4 * e.skinIndices.length, 4)
  40536. this.addAttribute('skinIndex', f.copyVector4sArray(e.skinIndices))
  40537. }
  40538. if (0 < e.skinWeights.length) {
  40539. var g = new Ci.Float32Attribute(4 * e.skinWeights.length, 4)
  40540. this.addAttribute('skinWeight', g.copyVector4sArray(e.skinWeights))
  40541. }
  40542. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()), null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()), this
  40543. },
  40544. computeBoundingBox:
  40545. (new Ci.Vector3(),
  40546. function () {
  40547. null === this.boundingBox && (this.boundingBox = new Ci.Box3())
  40548. var e = this.attributes.position.array
  40549. e && this.boundingBox.setFromArray(e),
  40550. (void 0 !== e && 0 !== e.length) || (this.boundingBox.min.set(0, 0, 0), this.boundingBox.max.set(0, 0, 0)),
  40551. (isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) &&
  40552. console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this)
  40553. }),
  40554. computeBoundingSphere:
  40555. ((nt = new Ci.Box3()),
  40556. (rt = new Ci.Vector3()),
  40557. function () {
  40558. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere())
  40559. var e = this.attributes.position.array
  40560. if (e) {
  40561. var t = this.boundingSphere.center
  40562. nt.setFromArray(e), nt.center(t)
  40563. for (var i = 0, n = 0, r = e.length; n < r; n += 3) rt.fromArray(e, n), (i = Math.max(i, t.distanceToSquared(rt)))
  40564. ;(this.boundingSphere.radius = Math.sqrt(i)),
  40565. isNaN(this.boundingSphere.radius) &&
  40566. console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  40567. }
  40568. }),
  40569. computeFaceNormals: function () {},
  40570. computeVertexNormals: function () {
  40571. var e = this.index,
  40572. t = this.attributes,
  40573. i = this.groups
  40574. if (t.position) {
  40575. var n = t.position.array
  40576. if (void 0 === t.normal) this.addAttribute('normal', new Ci.BufferAttribute(new Float32Array(n.length), 3))
  40577. else for (var r = t.normal.array, o = 0, a = r.length; o < a; o++) r[o] = 0
  40578. var s,
  40579. l,
  40580. c,
  40581. h = t.normal.array,
  40582. u = new Ci.Vector3(),
  40583. d = new Ci.Vector3(),
  40584. p = new Ci.Vector3(),
  40585. f = new Ci.Vector3(),
  40586. g = new Ci.Vector3()
  40587. if (e) {
  40588. var m = e.array
  40589. 0 === i.length && this.addGroup(0, m.length)
  40590. for (var v = 0, y = i.length; v < y; ++v) {
  40591. var A = i[v],
  40592. C = A.start
  40593. for (o = C, a = C + A.count; o < a; o += 3)
  40594. (s = 3 * m[o + 0]),
  40595. (l = 3 * m[o + 1]),
  40596. (c = 3 * m[o + 2]),
  40597. u.fromArray(n, s),
  40598. d.fromArray(n, l),
  40599. p.fromArray(n, c),
  40600. f.subVectors(p, d),
  40601. g.subVectors(u, d),
  40602. f.cross(g),
  40603. (h[s] += f.x),
  40604. (h[1 + s] += f.y),
  40605. (h[2 + s] += f.z),
  40606. (h[l] += f.x),
  40607. (h[1 + l] += f.y),
  40608. (h[2 + l] += f.z),
  40609. (h[c] += f.x),
  40610. (h[1 + c] += f.y),
  40611. (h[2 + c] += f.z)
  40612. }
  40613. } else
  40614. for (o = 0, a = n.length; o < a; o += 9)
  40615. u.fromArray(n, o),
  40616. d.fromArray(n, o + 3),
  40617. p.fromArray(n, o + 6),
  40618. f.subVectors(p, d),
  40619. g.subVectors(u, d),
  40620. f.cross(g),
  40621. (h[o] = f.x),
  40622. (h[o + 1] = f.y),
  40623. (h[o + 2] = f.z),
  40624. (h[o + 3] = f.x),
  40625. (h[o + 4] = f.y),
  40626. (h[o + 5] = f.z),
  40627. (h[o + 6] = f.x),
  40628. (h[o + 7] = f.y),
  40629. (h[o + 8] = f.z)
  40630. this.normalizeNormals(), (t.normal.needsUpdate = !0)
  40631. }
  40632. },
  40633. merge: function (e, t) {
  40634. if (e instanceof Ci.BufferGeometry != 0) {
  40635. void 0 === t && (t = 0)
  40636. var i = this.attributes
  40637. for (var n in i) if (void 0 !== e.attributes[n]) for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++, l++) r[l] = a[s]
  40638. return this
  40639. }
  40640. console.error('THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.', e)
  40641. },
  40642. normalizeNormals: function () {
  40643. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  40644. (e = r[o]), (t = r[o + 1]), (i = r[o + 2]), (n = 1 / Math.sqrt(e * e + t * t + i * i)), (r[o] *= n), (r[o + 1] *= n), (r[o + 2] *= n)
  40645. },
  40646. toNonIndexed: function () {
  40647. if (null === this.index) return console.warn('THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed.'), this
  40648. var e = new Ci.BufferGeometry(),
  40649. t = this.index.array,
  40650. i = this.attributes
  40651. for (var n in i) {
  40652. for (var r = i[n], o = r.array, a = r.itemSize, s = new o.constructor(t.length * a), l = 0, c = 0, h = 0, u = t.length; h < u; h++) {
  40653. l = t[h] * a
  40654. for (var d = 0; d < a; d++) s[c++] = o[l++]
  40655. }
  40656. e.addAttribute(n, new Ci.BufferAttribute(s, a))
  40657. }
  40658. return e
  40659. },
  40660. toJSON: function () {
  40661. var e = {
  40662. metadata: {
  40663. version: 4.4,
  40664. type: 'BufferGeometry',
  40665. generator: 'BufferGeometry.toJSON'
  40666. }
  40667. }
  40668. if (((e.uuid = this.uuid), (e.type = this.type), '' !== this.name && (e.name = this.name), void 0 !== this.parameters)) {
  40669. var t = this.parameters
  40670. for (var i in t) void 0 !== t[i] && (e[i] = t[i])
  40671. return e
  40672. }
  40673. e.data = {
  40674. attributes: {}
  40675. }
  40676. var n = this.index
  40677. if (null !== n) {
  40678. var r = Array.prototype.slice.call(n.array)
  40679. e.data.index = {
  40680. type: n.array.constructor.name,
  40681. array: r
  40682. }
  40683. }
  40684. var o = this.attributes
  40685. for (var i in o) {
  40686. var a = o[i]
  40687. r = Array.prototype.slice.call(a.array)
  40688. e.data.attributes[i] = {
  40689. itemSize: a.itemSize,
  40690. type: a.array.constructor.name,
  40691. array: r
  40692. }
  40693. }
  40694. var s = this.groups
  40695. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)))
  40696. var l = this.boundingSphere
  40697. return (
  40698. null !== l &&
  40699. (e.data.boundingSphere = {
  40700. center: l.center.toArray(),
  40701. radius: l.radius
  40702. }),
  40703. e
  40704. )
  40705. },
  40706. clone: function () {
  40707. return new Ci.BufferGeometry().copy(this)
  40708. },
  40709. copy: function (e) {
  40710. var t = e.index
  40711. null !== t && this.setIndex(t.clone())
  40712. var i = e.attributes
  40713. for (var n in i) {
  40714. var r = i[n]
  40715. this.addAttribute(n, r.clone())
  40716. }
  40717. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  40718. var l = o[a]
  40719. this.addGroup(l.start, l.count)
  40720. }
  40721. return this
  40722. },
  40723. dispose: function () {
  40724. this.dispatchEvent({
  40725. type: 'dispose'
  40726. })
  40727. }
  40728. }),
  40729. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  40730. (Ci.BufferGeometry.MaxIndex = 65535),
  40731. (Ci.InstancedBufferGeometry = function () {
  40732. Ci.BufferGeometry.call(this), (this.type = 'InstancedBufferGeometry'), (this.maxInstancedCount = void 0)
  40733. }),
  40734. (Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  40735. (Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry),
  40736. (Ci.InstancedBufferGeometry.prototype.addGroup = function (e, t, i) {
  40737. this.groups.push({
  40738. start: e,
  40739. count: t,
  40740. instances: i
  40741. })
  40742. }),
  40743. (Ci.InstancedBufferGeometry.prototype.copy = function (e) {
  40744. var t = e.index
  40745. null !== t && this.setIndex(t.clone())
  40746. var i = e.attributes
  40747. for (var n in i) {
  40748. var r = i[n]
  40749. this.addAttribute(n, r.clone())
  40750. }
  40751. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  40752. var l = o[a]
  40753. this.addGroup(l.start, l.count, l.instances)
  40754. }
  40755. return this
  40756. }),
  40757. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  40758. (Ci.Uniform = function (e, t) {
  40759. ;(this.type = e), (this.value = t), (this.dynamic = !1)
  40760. }),
  40761. (Ci.Uniform.prototype = {
  40762. constructor: Ci.Uniform,
  40763. onUpdate: function (e) {
  40764. return (this.dynamic = !0), (this.onUpdateCallback = e), this
  40765. }
  40766. }),
  40767. (Ci.AnimationClip = function (e, t, i) {
  40768. ;(this.name = e || Ci.Math.generateUUID()), (this.tracks = i), (this.duration = void 0 !== t ? t : -1), this.duration < 0 && this.resetDuration(), this.trim(), this.optimize()
  40769. }),
  40770. (Ci.AnimationClip.prototype = {
  40771. constructor: Ci.AnimationClip,
  40772. resetDuration: function () {
  40773. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  40774. var n = this.tracks[t]
  40775. e = Math.max(e, n.times[n.times.length - 1])
  40776. }
  40777. this.duration = e
  40778. },
  40779. trim: function () {
  40780. for (var e = 0; e < this.tracks.length; e++) this.tracks[e].trim(0, this.duration)
  40781. return this
  40782. },
  40783. optimize: function () {
  40784. for (var e = 0; e < this.tracks.length; e++) this.tracks[e].optimize()
  40785. return this
  40786. }
  40787. }),
  40788. Object.assign(Ci.AnimationClip, {
  40789. parse: function (e) {
  40790. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r) t.push(Ci.KeyframeTrack.parse(i[r]).scale(n))
  40791. return new Ci.AnimationClip(e.name, e.duration, t)
  40792. },
  40793. toJSON: function (e) {
  40794. for (
  40795. var t = [],
  40796. i = e.tracks,
  40797. n = {
  40798. name: e.name,
  40799. duration: e.duration,
  40800. tracks: t
  40801. },
  40802. r = 0,
  40803. o = i.length;
  40804. r !== o;
  40805. ++r
  40806. )
  40807. t.push(Ci.KeyframeTrack.toJSON(i[r]))
  40808. return n
  40809. },
  40810. CreateFromMorphTargetSequence: function (e, t, i) {
  40811. for (var n = t.length, r = [], o = 0; o < n; o++) {
  40812. var a = [],
  40813. s = []
  40814. a.push((o + n - 1) % n, o, (o + 1) % n), s.push(0, 1, 0)
  40815. var l = Ci.AnimationUtils.getKeyframeOrder(a)
  40816. ;(a = Ci.AnimationUtils.sortedArray(a, 1, l)),
  40817. (s = Ci.AnimationUtils.sortedArray(s, 1, l)),
  40818. 0 === a[0] && (a.push(n), s.push(s[0])),
  40819. r.push(new Ci.NumberKeyframeTrack('.morphTargetInfluences[' + t[o].name + ']', a, s).scale(1 / i))
  40820. }
  40821. return new Ci.AnimationClip(e, -1, r)
  40822. },
  40823. findByName: function (e, t) {
  40824. for (var i = 0; i < e.length; i++) if (e[i].name === t) return e[i]
  40825. return null
  40826. },
  40827. CreateClipsFromMorphTargetSequences: function (e, t) {
  40828. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  40829. var a = e[r],
  40830. s = a.name.match(n)
  40831. if (s && 1 < s.length) {
  40832. var l = i[(h = s[1])]
  40833. l || (i[h] = l = []), l.push(a)
  40834. }
  40835. }
  40836. var c = []
  40837. for (var h in i) c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t))
  40838. return c
  40839. },
  40840. parseAnimation: function (e, t, i) {
  40841. if (!e) return console.error(' no animation in JSONLoader data'), null
  40842. function n(e, t, i, n, r) {
  40843. if (0 !== i.length) {
  40844. var o = [],
  40845. a = []
  40846. Ci.AnimationUtils.flattenJSON(i, o, a, n), 0 !== o.length && r.push(new e(t, o, a))
  40847. }
  40848. }
  40849. for (var r = [], o = e.name || 'default', a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  40850. var h = l[c].keys
  40851. if (h && 0 != h.length)
  40852. if (h[0].morphTargets) {
  40853. for (var u = {}, d = 0; d < h.length; d++) if (h[d].morphTargets) for (var p = 0; p < h[d].morphTargets.length; p++) u[h[d].morphTargets[p]] = -1
  40854. for (var f in u) {
  40855. var g = [],
  40856. m = []
  40857. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  40858. var v = h[d]
  40859. g.push(v.time), m.push(v.morphTarget === f ? 1 : 0)
  40860. }
  40861. r.push(new Ci.NumberKeyframeTrack('.morphTargetInfluence[' + f + ']', g, m))
  40862. }
  40863. a = u.length * (s || 1)
  40864. } else {
  40865. var y = '.bones[' + t[c].name + ']'
  40866. n(Ci.VectorKeyframeTrack, y + '.position', h, 'pos', r), n(Ci.QuaternionKeyframeTrack, y + '.quaternion', h, 'rot', r), n(Ci.VectorKeyframeTrack, y + '.scale', h, 'scl', r)
  40867. }
  40868. }
  40869. return 0 === r.length ? null : new Ci.AnimationClip(o, a, r)
  40870. }
  40871. }),
  40872. (Ci.AnimationMixer = function (e) {
  40873. ;(this._root = e), this._initMemoryManager(), (this._accuIndex = 0), (this.time = 0), (this.timeScale = 1)
  40874. }),
  40875. (Ci.AnimationMixer.prototype = {
  40876. constructor: Ci.AnimationMixer,
  40877. clipAction: function (e, t) {
  40878. var i,
  40879. n = (t || this._root).uuid,
  40880. r = 'string' == typeof e ? e : e.name,
  40881. o = e !== r ? e : null,
  40882. a = this._actionsByClip[r]
  40883. if (void 0 !== a) {
  40884. var s = a.actionByRoot[n]
  40885. if (void 0 !== s) return s
  40886. if (((o = (i = a.knownActions[0])._clip), e !== r && e !== o)) throw new Error('Different clips with the same name detected!')
  40887. }
  40888. if (null === o) return null
  40889. var l = new Ci.AnimationMixer._Action(this, o, t)
  40890. return this._bindAction(l, i), this._addInactiveAction(l, r, n), l
  40891. },
  40892. existingAction: function (e, t) {
  40893. var i = (t || this._root).uuid,
  40894. n = 'string' == typeof e ? e : e.name,
  40895. r = this._actionsByClip[n]
  40896. return (void 0 !== r && r.actionByRoot[i]) || null
  40897. },
  40898. stopAllAction: function () {
  40899. var e = this._actions,
  40900. t = this._nActiveActions,
  40901. i = this._bindings,
  40902. n = this._nActiveBindings
  40903. this._nActiveActions = 0
  40904. for (var r = (this._nActiveBindings = 0); r !== t; ++r) e[r].reset()
  40905. for (r = 0; r !== n; ++r) i[r].useCount = 0
  40906. return this
  40907. },
  40908. update: function (e) {
  40909. e *= this.timeScale
  40910. for (var t = this._actions, i = this._nActiveActions, n = (this.time += e), r = Math.sign(e), o = (this._accuIndex ^= 1), a = 0; a !== i; ++a) {
  40911. var s = t[a]
  40912. s.enabled && s._update(n, e, r, o)
  40913. }
  40914. var l = this._bindings,
  40915. c = this._nActiveBindings
  40916. for (a = 0; a !== c; ++a) l[a].apply(o)
  40917. return this
  40918. },
  40919. getRoot: function () {
  40920. return this._root
  40921. },
  40922. uncacheClip: function (e) {
  40923. var t = this._actions,
  40924. i = e.name,
  40925. n = this._actionsByClip,
  40926. r = n[i]
  40927. if (void 0 !== r) {
  40928. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  40929. var l = o[a]
  40930. this._deactivateAction(l)
  40931. var c = l._cacheIndex,
  40932. h = t[t.length - 1]
  40933. ;(l._cacheIndex = null), (l._byClipCacheIndex = null), (t[(h._cacheIndex = c)] = h), t.pop(), this._removeInactiveBindingsForAction(l)
  40934. }
  40935. delete n[i]
  40936. }
  40937. },
  40938. uncacheRoot: function (e) {
  40939. var t = e.uuid,
  40940. i = this._actionsByClip
  40941. for (var n in i) {
  40942. var r = i[n].actionByRoot[t]
  40943. void 0 !== r && (this._deactivateAction(r), this._removeInactiveAction(r))
  40944. }
  40945. var o = this._bindingsByRootAndName[t]
  40946. if (void 0 !== o)
  40947. for (var a in o) {
  40948. var s = o[a]
  40949. s.restoreOriginalState(), this._removeInactiveBinding(s)
  40950. }
  40951. },
  40952. uncacheAction: function (e, t) {
  40953. var i = this.existingAction(e, t)
  40954. null !== i && (this._deactivateAction(i), this._removeInactiveAction(i))
  40955. }
  40956. }),
  40957. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  40958. (Ci.AnimationMixer._Action = function (e, t, i) {
  40959. ;(this._mixer = e), (this._clip = t), (this._localRoot = i || null)
  40960. for (
  40961. var n = t.tracks,
  40962. r = n.length,
  40963. o = new Array(r),
  40964. a = {
  40965. endingStart: Ci.ZeroCurvatureEnding,
  40966. endingEnd: Ci.ZeroCurvatureEnding
  40967. },
  40968. s = 0;
  40969. s !== r;
  40970. ++s
  40971. ) {
  40972. var l = n[s].createInterpolant(null)
  40973. ;(o[s] = l).settings = a
  40974. }
  40975. ;(this._interpolantSettings = a),
  40976. (this._interpolants = o),
  40977. (this._propertyBindings = new Array(r)),
  40978. (this._cacheIndex = null),
  40979. (this._byClipCacheIndex = null),
  40980. (this._timeScaleInterpolant = null),
  40981. (this._weightInterpolant = null),
  40982. (this.loop = Ci.LoopRepeat),
  40983. (this._loopCount = -1),
  40984. (this._startTime = null),
  40985. (this.time = 0),
  40986. (this.timeScale = 1),
  40987. (this._effectiveTimeScale = 1),
  40988. (this.weight = 1),
  40989. (this._effectiveWeight = 1),
  40990. (this.repetitions = 1 / 0),
  40991. (this.paused = !1),
  40992. (this.enabled = !0),
  40993. (this.clampWhenFinished = !1),
  40994. (this.zeroSlopeAtStart = !0),
  40995. (this.zeroSlopeAtEnd = !0)
  40996. }),
  40997. (Ci.AnimationMixer._Action.prototype = {
  40998. constructor: Ci.AnimationMixer._Action,
  40999. play: function () {
  41000. return this._mixer._activateAction(this), this
  41001. },
  41002. stop: function () {
  41003. return this._mixer._deactivateAction(this), this.reset()
  41004. },
  41005. reset: function () {
  41006. return (this.paused = !1), (this.enabled = !0), (this.time = 0), (this._loopCount = -1), (this._startTime = null), this.stopFading().stopWarping()
  41007. },
  41008. isRunning: function () {
  41009. return this._startTime, this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  41010. },
  41011. isScheduled: function () {
  41012. return this._mixer._isActiveAction(this)
  41013. },
  41014. startAt: function (e) {
  41015. return (this._startTime = e), this
  41016. },
  41017. setLoop: function (e, t) {
  41018. return (this.loop = e), (this.repetitions = t), this
  41019. },
  41020. setEffectiveWeight: function (e) {
  41021. return (this.weight = e), (this._effectiveWeight = this.enabled ? e : 0), this.stopFading()
  41022. },
  41023. getEffectiveWeight: function () {
  41024. return this._effectiveWeight
  41025. },
  41026. fadeIn: function (e) {
  41027. return this._scheduleFading(e, 0, 1)
  41028. },
  41029. fadeOut: function (e) {
  41030. return this._scheduleFading(e, 1, 0)
  41031. },
  41032. crossFadeFrom: function (e, t, i) {
  41033. if ((this._mixer, e.fadeOut(t), this.fadeIn(t), i)) {
  41034. var n = this._clip.duration,
  41035. r = e._clip.duration,
  41036. o = r / n,
  41037. a = n / r
  41038. e.warp(1, o, t), this.warp(a, 1, t)
  41039. }
  41040. return this
  41041. },
  41042. crossFadeTo: function (e, t, i) {
  41043. return e.crossFadeFrom(this, t, i)
  41044. },
  41045. stopFading: function () {
  41046. var e = this._weightInterpolant
  41047. return null !== e && ((this._weightInterpolant = null), this._mixer._takeBackControlInterpolant(e)), this
  41048. },
  41049. setEffectiveTimeScale: function (e) {
  41050. return (this.timeScale = e), (this._effectiveTimeScale = this.paused ? 0 : e), this.stopWarping()
  41051. },
  41052. getEffectiveTimeScale: function () {
  41053. return this._effectiveTimeScale
  41054. },
  41055. setDuration: function (e) {
  41056. return (this.timeScale = this._clip.duration / e), this.stopWarping()
  41057. },
  41058. syncWith: function (e) {
  41059. return (this.time = e.time), (this.timeScale = e.timeScale), this.stopWarping()
  41060. },
  41061. halt: function (e) {
  41062. return this.warp(this._currentTimeScale, 0, e)
  41063. },
  41064. warp: function (e, t, i) {
  41065. var n = this._mixer,
  41066. r = n.time,
  41067. o = this._timeScaleInterpolant,
  41068. a = this.timeScale
  41069. null === o && ((o = n._lendControlInterpolant()), (this._timeScaleInterpolant = o))
  41070. var s = o.parameterPositions,
  41071. l = o.sampleValues
  41072. return (s[0] = r), (s[1] = r + i), (l[0] = e / a), (l[1] = t / a), this
  41073. },
  41074. stopWarping: function () {
  41075. var e = this._timeScaleInterpolant
  41076. return null !== e && ((this._timeScaleInterpolant = null), this._mixer._takeBackControlInterpolant(e)), this
  41077. },
  41078. getMixer: function () {
  41079. return this._mixer
  41080. },
  41081. getClip: function () {
  41082. return this._clip
  41083. },
  41084. getRoot: function () {
  41085. return this._localRoot || this._mixer._root
  41086. },
  41087. _update: function (e, t, i, n) {
  41088. var r = this._startTime
  41089. if (null !== r) {
  41090. var o = (e - r) * i
  41091. if (o < 0 || 0 === i) return
  41092. ;(this._startTime = null), (t = i * o)
  41093. }
  41094. t *= this._updateTimeScale(e)
  41095. var a = this._updateTime(t),
  41096. s = this._updateWeight(e)
  41097. if (0 < s) for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h) l[h].evaluate(a), c[h].accumulate(n, s)
  41098. },
  41099. _updateWeight: function (e) {
  41100. var t = 0
  41101. if (this.enabled) {
  41102. t = this.weight
  41103. var i = this._weightInterpolant
  41104. if (null !== i) {
  41105. var n = i.evaluate(e)[0]
  41106. ;(t *= n), e > i.parameterPositions[1] && (this.stopFading(), 0 === n && (this.enabled = !1))
  41107. }
  41108. }
  41109. return (this._effectiveWeight = t)
  41110. },
  41111. _updateTimeScale: function (e) {
  41112. var t = 0
  41113. if (!this.paused) {
  41114. t = this.timeScale
  41115. var i = this._timeScaleInterpolant
  41116. if (null !== i) (t *= i.evaluate(e)[0]), e > i.parameterPositions[1] && (this.stopWarping(), 0 === t ? (this.pause = !0) : (this.timeScale = t))
  41117. }
  41118. return (this._effectiveTimeScale = t)
  41119. },
  41120. _updateTime: function (e) {
  41121. var t = this.time + e
  41122. if (0 === e) return t
  41123. var i = this._clip.duration,
  41124. n = this.loop,
  41125. r = this._loopCount,
  41126. o = !1
  41127. switch (n) {
  41128. case Ci.LoopOnce:
  41129. if ((-1 === r && ((this.loopCount = 0), this._setEndings(!0, !0, !1)), i <= t)) t = i
  41130. else {
  41131. if (!(t < 0)) break
  41132. t = 0
  41133. }
  41134. this.clampWhenFinished ? (this.pause = !0) : (this.enabled = !1),
  41135. this._mixer.dispatchEvent({
  41136. type: 'finished',
  41137. action: this,
  41138. direction: e < 0 ? -1 : 1
  41139. })
  41140. break
  41141. case Ci.LoopPingPong:
  41142. o = !0
  41143. case Ci.LoopRepeat:
  41144. if ((-1 === r && (0 < e ? ((r = 0), this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)), i <= t || t < 0)) {
  41145. var a = Math.floor(t / i)
  41146. ;(t -= i * a), (r += Math.abs(a))
  41147. var s = this.repetitions - r
  41148. if (s < 0) {
  41149. this.clampWhenFinished ? (this.paused = !0) : (this.enabled = !1),
  41150. (t = 0 < e ? i : 0),
  41151. this._mixer.dispatchEvent({
  41152. type: 'finished',
  41153. action: this,
  41154. direction: 0 < e ? 1 : -1
  41155. })
  41156. break
  41157. }
  41158. if (0 == s) {
  41159. var l = e < 0
  41160. this._setEndings(l, !l, o)
  41161. } else this._setEndings(!1, !1, o)
  41162. ;(this._loopCount = r),
  41163. this._mixer.dispatchEvent({
  41164. type: 'loop',
  41165. action: this,
  41166. loopDelta: a
  41167. })
  41168. }
  41169. if (n === Ci.LoopPingPong && 1 == (1 & r)) return i - (this.time = t)
  41170. }
  41171. return (this.time = t)
  41172. },
  41173. _setEndings: function (e, t, i) {
  41174. var n = this._interpolantSettings
  41175. i
  41176. ? ((n.endingStart = Ci.ZeroSlopeEnding), (n.endingEnd = Ci.ZeroSlopeEnding))
  41177. : ((n.endingStart = e ? (this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding) : Ci.WrapAroundEnding),
  41178. (n.endingEnd = t ? (this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding) : Ci.WrapAroundEnding))
  41179. },
  41180. _scheduleFading: function (e, t, i) {
  41181. var n = this._mixer,
  41182. r = n.time,
  41183. o = this._weightInterpolant
  41184. null === o && ((o = n._lendControlInterpolant()), (this._weightInterpolant = o))
  41185. var a = o.parameterPositions,
  41186. s = o.sampleValues
  41187. return (a[0] = r), (s[0] = t), (a[1] = r + e), (s[1] = i), this
  41188. }
  41189. }),
  41190. Object.assign(Ci.AnimationMixer.prototype, {
  41191. _bindAction: function (e, t) {
  41192. var i = e._localRoot || this._root,
  41193. n = e._clip.tracks,
  41194. r = n.length,
  41195. o = e._propertyBindings,
  41196. a = e._interpolants,
  41197. s = i.uuid,
  41198. l = this._bindingsByRootAndName,
  41199. c = l[s]
  41200. void 0 === c && ((c = {}), (l[s] = c))
  41201. for (var h = 0; h !== r; ++h) {
  41202. var u = n[h],
  41203. d = u.name,
  41204. p = c[d]
  41205. if (void 0 !== p) o[h] = p
  41206. else {
  41207. if (void 0 !== (p = o[h])) {
  41208. null === p._cacheIndex && (++p.referenceCount, this._addInactiveBinding(p, s, d))
  41209. continue
  41210. }
  41211. var f = t && t._propertyBindings[h].binding.parsedPath
  41212. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f), u.ValueTypeName, u.getValueSize())).referenceCount, this._addInactiveBinding(p, s, d), (o[h] = p)
  41213. }
  41214. a[h].resultBuffer = p.buffer
  41215. }
  41216. },
  41217. _activateAction: function (e) {
  41218. if (!this._isActiveAction(e)) {
  41219. if (null === e._cacheIndex) {
  41220. var t = (e._localRoot || this._root).uuid,
  41221. i = e._clip.name,
  41222. n = this._actionsByClip[i]
  41223. this._bindAction(e, n && n.knownActions[0]), this._addInactiveAction(e, i, t)
  41224. }
  41225. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  41226. var s = r[o]
  41227. 0 == s.useCount++ && (this._lendBinding(s), s.saveOriginalState())
  41228. }
  41229. this._lendAction(e)
  41230. }
  41231. },
  41232. _deactivateAction: function (e) {
  41233. if (this._isActiveAction(e)) {
  41234. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  41235. var r = t[i]
  41236. 0 == --r.useCount && (r.restoreOriginalState(), this._takeBackBinding(r))
  41237. }
  41238. this._takeBackAction(e)
  41239. }
  41240. },
  41241. _initMemoryManager: function () {
  41242. ;(this._actions = []),
  41243. (this._nActiveActions = 0),
  41244. (this._actionsByClip = {}),
  41245. (this._bindings = []),
  41246. (this._nActiveBindings = 0),
  41247. (this._bindingsByRootAndName = {}),
  41248. (this._controlInterpolants = []),
  41249. (this._nActiveControlInterpolants = 0)
  41250. var e = this
  41251. this.stats = {
  41252. actions: {
  41253. get total() {
  41254. return e._actions.length
  41255. },
  41256. get inUse() {
  41257. return e._nActiveActions
  41258. }
  41259. },
  41260. bindings: {
  41261. get total() {
  41262. return e._bindings.length
  41263. },
  41264. get inUse() {
  41265. return e._nActiveBindings
  41266. }
  41267. },
  41268. controlInterpolants: {
  41269. get total() {
  41270. return e._controlInterpolants.length
  41271. },
  41272. get inUse() {
  41273. return e._nActiveControlInterpolants
  41274. }
  41275. }
  41276. }
  41277. },
  41278. _isActiveAction: function (e) {
  41279. var t = e._cacheIndex
  41280. return null !== t && t < this._nActiveActions
  41281. },
  41282. _addInactiveAction: function (e, t, i) {
  41283. var n = this._actions,
  41284. r = this._actionsByClip,
  41285. o = r[t]
  41286. if (void 0 === o)
  41287. (o = {
  41288. knownActions: [e],
  41289. actionByRoot: {}
  41290. }),
  41291. (e._byClipCacheIndex = 0),
  41292. (r[t] = o)
  41293. else {
  41294. var a = o.knownActions
  41295. ;(e._byClipCacheIndex = a.length), a.push(e)
  41296. }
  41297. ;(e._cacheIndex = n.length), n.push(e), (o.actionByRoot[i] = e)
  41298. },
  41299. _removeInactiveAction: function (e) {
  41300. var t = this._actions,
  41301. i = t[t.length - 1],
  41302. n = e._cacheIndex
  41303. ;(t[(i._cacheIndex = n)] = i), t.pop(), (e._cacheIndex = null)
  41304. var r = e._clip.name,
  41305. o = this._actionsByClip,
  41306. a = o[r],
  41307. s = a.knownActions,
  41308. l = s[s.length - 1],
  41309. c = e._byClipCacheIndex
  41310. ;(s[(l._byClipCacheIndex = c)] = l),
  41311. s.pop(),
  41312. (e._byClipCacheIndex = null),
  41313. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  41314. 0 === s.length && delete o[r],
  41315. this._removeInactiveBindingsForAction(e)
  41316. },
  41317. _removeInactiveBindingsForAction: function (e) {
  41318. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  41319. var r = t[i]
  41320. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  41321. }
  41322. },
  41323. _lendAction: function (e) {
  41324. var t = this._actions,
  41325. i = e._cacheIndex,
  41326. n = this._nActiveActions++,
  41327. r = t[n]
  41328. ;(t[(e._cacheIndex = n)] = e), (t[(r._cacheIndex = i)] = r)
  41329. },
  41330. _takeBackAction: function (e) {
  41331. var t = this._actions,
  41332. i = e._cacheIndex,
  41333. n = --this._nActiveActions,
  41334. r = t[n]
  41335. ;(t[(e._cacheIndex = n)] = e), (t[(r._cacheIndex = i)] = r)
  41336. },
  41337. _addInactiveBinding: function (e, t, i) {
  41338. var n = this._bindingsByRootAndName,
  41339. r = n[t],
  41340. o = this._bindings
  41341. void 0 === r && ((r = {}), (n[t] = r)), ((r[i] = e)._cacheIndex = o.length), o.push(e)
  41342. },
  41343. _removeInactiveBinding: function (e) {
  41344. var t = this._bindings,
  41345. i = e.binding,
  41346. n = i.rootNode.uuid,
  41347. r = i.path,
  41348. o = this._bindingsByRootAndName,
  41349. a = o[n],
  41350. s = t[t.length - 1],
  41351. l = e._cacheIndex
  41352. ;(t[(s._cacheIndex = l)] = s), t.pop(), delete a[r]
  41353. e: {
  41354. for (var c in a) break e
  41355. delete o[n]
  41356. }
  41357. },
  41358. _lendBinding: function (e) {
  41359. var t = this._bindings,
  41360. i = e._cacheIndex,
  41361. n = this._nActiveBindings++,
  41362. r = t[n]
  41363. ;(t[(e._cacheIndex = n)] = e), (t[(r._cacheIndex = i)] = r)
  41364. },
  41365. _takeBackBinding: function (e) {
  41366. var t = this._bindings,
  41367. i = e._cacheIndex,
  41368. n = --this._nActiveBindings,
  41369. r = t[n]
  41370. ;(t[(e._cacheIndex = n)] = e), (t[(r._cacheIndex = i)] = r)
  41371. },
  41372. _lendControlInterpolant: function () {
  41373. var e = this._controlInterpolants,
  41374. t = this._nActiveControlInterpolants++,
  41375. i = e[t]
  41376. return void 0 === i && (e[((i = new Ci.LinearInterpolant(new Float32Array(2), new Float32Array(2), 1, this._controlInterpolantsResultBuffer)).__cacheIndex = t)] = i), i
  41377. },
  41378. _takeBackControlInterpolant: function (e) {
  41379. var t = this._controlInterpolants,
  41380. i = e.__cacheIndex,
  41381. n = --this._nActiveControlInterpolants,
  41382. r = t[n]
  41383. ;(t[(e.__cacheIndex = n)] = e), (t[(r.__cacheIndex = i)] = r)
  41384. },
  41385. _controlInterpolantsResultBuffer: new Float32Array(1)
  41386. }),
  41387. (Ci.AnimationObjectGroup = function (e) {
  41388. ;(this.uuid = Ci.Math.generateUUID()), (this._objects = Array.prototype.slice.call(arguments)), (this.nCachedObjects_ = 0)
  41389. var t = {}
  41390. this._indicesByUUID = t
  41391. for (var i = 0, n = arguments.length; i !== n; ++i) t[arguments[i].uuid] = i
  41392. ;(this._paths = []), (this._parsedPaths = []), (this._bindings = []), (this._bindingsIndicesByPath = {})
  41393. var r = this
  41394. this.stats = {
  41395. objects: {
  41396. get total() {
  41397. return r._objects.length
  41398. },
  41399. get inUse() {
  41400. return this.total - r.nCachedObjects_
  41401. }
  41402. },
  41403. get bindingsPerObject() {
  41404. return r._bindings.length
  41405. }
  41406. }
  41407. }),
  41408. (Ci.AnimationObjectGroup.prototype = {
  41409. constructor: Ci.AnimationObjectGroup,
  41410. add: function (e) {
  41411. for (
  41412. var t = this._objects,
  41413. i = t.length,
  41414. n = this.nCachedObjects_,
  41415. r = this._indicesByUUID,
  41416. o = this._paths,
  41417. a = this._parsedPaths,
  41418. s = this._bindings,
  41419. l = s.length,
  41420. c = 0,
  41421. h = arguments.length;
  41422. c !== h;
  41423. ++c
  41424. ) {
  41425. var u = arguments[c],
  41426. d = u.uuid,
  41427. p = r[d]
  41428. if (void 0 === p) {
  41429. ;(p = i++), (r[d] = p), t.push(u)
  41430. for (var f = 0, g = l; f !== g; ++f) s[f].push(new Ci.PropertyBinding(u, o[f], a[f]))
  41431. } else if (p < n) {
  41432. var m = t[p],
  41433. v = --n,
  41434. y = t[v]
  41435. ;(t[(r[y.uuid] = p)] = y), (t[(r[d] = v)] = u)
  41436. for (f = 0, g = l; f !== g; ++f) {
  41437. var A = s[f],
  41438. C = A[v],
  41439. I = A[p]
  41440. ;(A[p] = C), void 0 === I && (I = new Ci.PropertyBinding(u, o[f], a[f])), (A[v] = I)
  41441. }
  41442. } else t[p] !== m && console.error('Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...')
  41443. }
  41444. this.nCachedObjects_ = n
  41445. },
  41446. remove: function (e) {
  41447. for (var t = this._objects, i = (t.length, this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  41448. var l = arguments[a],
  41449. c = l.uuid,
  41450. h = n[c]
  41451. if (void 0 !== h && i <= h) {
  41452. var u = i++,
  41453. d = t[u]
  41454. ;(t[(n[d.uuid] = h)] = d), (t[(n[c] = u)] = l)
  41455. for (var p = 0, f = o; p !== f; ++p) {
  41456. var g = r[p],
  41457. m = g[u],
  41458. v = g[h]
  41459. ;(g[h] = m), (g[u] = v)
  41460. }
  41461. }
  41462. }
  41463. this.nCachedObjects_ = i
  41464. },
  41465. uncache: function (e) {
  41466. for (var t = this._objects, i = t.length, n = this.nCachedObjects_, r = this._indicesByUUID, o = this._bindings, a = o.length, s = 0, l = arguments.length; s !== l; ++s) {
  41467. var c = arguments[s].uuid,
  41468. h = r[c]
  41469. if (void 0 !== h)
  41470. if ((delete r[c], h < n)) {
  41471. var u = --n,
  41472. d = t[u],
  41473. p = t[(y = --i)]
  41474. ;(t[(r[d.uuid] = h)] = d), (t[(r[p.uuid] = u)] = p), t.pop()
  41475. for (var f = 0, g = a; f !== g; ++f) {
  41476. var m = (A = o[f])[u],
  41477. v = A[y]
  41478. ;(A[h] = m), (A[u] = v), A.pop()
  41479. }
  41480. } else {
  41481. var y
  41482. ;(t[(r[(p = t[(y = --i)]).uuid] = h)] = p), t.pop()
  41483. for (f = 0, g = a; f !== g; ++f) {
  41484. var A
  41485. ;((A = o[f])[h] = A[y]), A.pop()
  41486. }
  41487. }
  41488. }
  41489. this.nCachedObjects_ = n
  41490. },
  41491. subscribe_: function (e, t) {
  41492. var i = this._bindingsIndicesByPath,
  41493. n = i[e],
  41494. r = this._bindings
  41495. if (void 0 !== n) return r[n]
  41496. var o = this._paths,
  41497. a = this._parsedPaths,
  41498. s = this._objects,
  41499. l = s.length,
  41500. c = this.nCachedObjects_,
  41501. h = new Array(l)
  41502. ;(n = r.length), (i[e] = n), o.push(e), a.push(t), r.push(h)
  41503. for (var u = c, d = s.length; u !== d; ++u) {
  41504. var p = s[u]
  41505. h[u] = new Ci.PropertyBinding(p, e, t)
  41506. }
  41507. return h
  41508. },
  41509. unsubscribe_: function (e) {
  41510. var t = this._bindingsIndicesByPath,
  41511. i = t[e]
  41512. if (void 0 !== i) {
  41513. var n = this._paths,
  41514. r = this._parsedPaths,
  41515. o = this._bindings,
  41516. a = o.length - 1,
  41517. s = o[a]
  41518. ;(o[(t[e[a]] = i)] = s), o.pop(), (r[i] = r[a]), r.pop(), (n[i] = n[a]), n.pop()
  41519. }
  41520. }
  41521. }),
  41522. (Ci.AnimationUtils = {
  41523. arraySlice: function (e, t, i) {
  41524. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  41525. },
  41526. convertArray: function (e, t, i) {
  41527. return !e || (!i && e.constructor === t) ? e : 'number' == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  41528. },
  41529. isTypedArray: function (e) {
  41530. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  41531. },
  41532. getKeyframeOrder: function (i) {
  41533. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n) t[n] = n
  41534. return (
  41535. t.sort(function (e, t) {
  41536. return i[e] - i[t]
  41537. }),
  41538. t
  41539. )
  41540. },
  41541. sortedArray: function (e, t, i) {
  41542. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o) for (var s = i[o] * t, l = 0; l !== t; ++l) r[a++] = e[s + l]
  41543. return r
  41544. },
  41545. flattenJSON: function (e, t, i, n) {
  41546. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; ) o = e[r++]
  41547. if (void 0 !== o) {
  41548. var a = o[n]
  41549. if (void 0 !== a)
  41550. if (Array.isArray(a)) for (; void 0 !== (a = o[n]) && (t.push(o.time), i.push.apply(i, a)), void 0 !== (o = e[r++]); );
  41551. else if (void 0 !== a.toArray) for (; void 0 !== (a = o[n]) && (t.push(o.time), a.toArray(i, i.length)), void 0 !== (o = e[r++]); );
  41552. else for (; void 0 !== (a = o[n]) && (t.push(o.time), i.push(a)), void 0 !== (o = e[r++]); );
  41553. }
  41554. }
  41555. }),
  41556. (Ci.KeyframeTrack = function (e, t, i, n) {
  41557. if (void 0 === e) throw new Error('track name is undefined')
  41558. if (void 0 === t || 0 === t.length) throw new Error('no keyframes in track named ' + e)
  41559. ;(this.name = e),
  41560. (this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType)),
  41561. (this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType)),
  41562. this.setInterpolation(n || this.DefaultInterpolation),
  41563. this.validate(),
  41564. this.optimize()
  41565. }),
  41566. (Ci.KeyframeTrack.prototype = {
  41567. constructor: Ci.KeyframeTrack,
  41568. TimeBufferType: Float32Array,
  41569. ValueBufferType: Float32Array,
  41570. DefaultInterpolation: Ci.InterpolateLinear,
  41571. InterpolantFactoryMethodDiscrete: function (e) {
  41572. return new Ci.DiscreteInterpolant(this.times, this.values, this.getValueSize(), e)
  41573. },
  41574. InterpolantFactoryMethodLinear: function (e) {
  41575. return new Ci.LinearInterpolant(this.times, this.values, this.getValueSize(), e)
  41576. },
  41577. InterpolantFactoryMethodSmooth: function (e) {
  41578. return new Ci.CubicInterpolant(this.times, this.values, this.getValueSize(), e)
  41579. },
  41580. setInterpolation: function (e) {
  41581. var t = void 0
  41582. switch (e) {
  41583. case Ci.InterpolateDiscrete:
  41584. t = this.InterpolantFactoryMethodDiscrete
  41585. break
  41586. case Ci.InterpolateLinear:
  41587. t = this.InterpolantFactoryMethodLinear
  41588. break
  41589. case Ci.InterpolateSmooth:
  41590. t = this.InterpolantFactoryMethodSmooth
  41591. }
  41592. if (void 0 !== t) this.createInterpolant = t
  41593. else {
  41594. var i = 'unsupported interpolation for ' + this.ValueTypeName + ' keyframe track named ' + this.name
  41595. if (void 0 === this.createInterpolant) {
  41596. if (e === this.DefaultInterpolation) throw new Error(i)
  41597. this.setInterpolation(this.DefaultInterpolation)
  41598. }
  41599. console.warn(i)
  41600. }
  41601. },
  41602. getInterpolation: function () {
  41603. switch (this.createInterpolant) {
  41604. case this.InterpolantFactoryMethodDiscrete:
  41605. return Ci.InterpolateDiscrete
  41606. case this.InterpolantFactoryMethodLinear:
  41607. return Ci.InterpolateLinear
  41608. case this.InterpolantFactoryMethodSmooth:
  41609. return Ci.InterpolateSmooth
  41610. }
  41611. },
  41612. getValueSize: function () {
  41613. return this.values.length / this.times.length
  41614. },
  41615. shift: function (e) {
  41616. if (0 !== e) for (var t = this.times, i = 0, n = t.length; i !== n; ++i) t[i] += e
  41617. return this
  41618. },
  41619. scale: function (e) {
  41620. if (1 !== e) for (var t = this.times, i = 0, n = t.length; i !== n; ++i) t[i] *= e
  41621. return this
  41622. },
  41623. trim: function (e, t) {
  41624. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; ) ++r
  41625. for (; -1 !== o && i[o] > t; ) --o
  41626. if ((++o, 0 !== r || o !== n)) {
  41627. o <= r && (r = (o = Math.max(o, 1)) - 1)
  41628. var a = this.getValueSize()
  41629. ;(this.times = Ci.AnimationUtils.arraySlice(i, r, o)), (this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a))
  41630. }
  41631. return this
  41632. },
  41633. validate: function () {
  41634. var e = !0,
  41635. t = this.getValueSize()
  41636. t - Math.floor(t) != 0 && (console.error('invalid value size in track', this), (e = !1))
  41637. var i = this.times,
  41638. n = this.values,
  41639. r = i.length
  41640. 0 === r && (console.error('track is empty', this), (e = !1))
  41641. for (var o = null, a = 0; a !== r; a++) {
  41642. var s = i[a]
  41643. if ('number' == typeof s && isNaN(s)) {
  41644. console.error('time is not a valid number', this, a, s), (e = !1)
  41645. break
  41646. }
  41647. if (null !== o && s < o) {
  41648. console.error('out of order keys', this, a, s, o), (e = !1)
  41649. break
  41650. }
  41651. o = s
  41652. }
  41653. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  41654. a = 0
  41655. for (var l = n.length; a !== l; ++a) {
  41656. var c = n[a]
  41657. if (isNaN(c)) {
  41658. console.error('value is not a valid number', this, a, c), (e = !1)
  41659. break
  41660. }
  41661. }
  41662. }
  41663. return e
  41664. },
  41665. optimize: function () {
  41666. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  41667. var a = !1,
  41668. s = e[r]
  41669. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  41670. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  41671. var d = t[l + u]
  41672. if (d !== t[c + u] || d !== t[h + u]) {
  41673. a = !0
  41674. break
  41675. }
  41676. }
  41677. if (a) {
  41678. if (r !== n) {
  41679. e[n] = e[r]
  41680. var p = r * i,
  41681. f = n * i
  41682. for (u = 0; u !== i; ++u) t[f + u] = t[p + u]
  41683. }
  41684. ++n
  41685. }
  41686. }
  41687. return n !== e.length && ((this.times = Ci.AnimationUtils.arraySlice(e, 0, n)), (this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i))), this
  41688. }
  41689. }),
  41690. Object.assign(Ci.KeyframeTrack, {
  41691. parse: function (e) {
  41692. if (void 0 === e.type) throw new Error('track type undefined, can not parse')
  41693. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type)
  41694. if (void 0 === e.times) {
  41695. console.warn('legacy JSON format detected, converting')
  41696. var i = [],
  41697. n = []
  41698. Ci.AnimationUtils.flattenJSON(e.keys, i, n, 'value'), (e.times = i), (e.values = n)
  41699. }
  41700. return void 0 !== t.parse ? t.parse(e) : new t(e.name, e.times, e.values, e.interpolation)
  41701. },
  41702. toJSON: function (e) {
  41703. var t,
  41704. i = e.constructor
  41705. if (void 0 !== i.toJSON) t = i.toJSON(e)
  41706. else {
  41707. t = {
  41708. name: e.name,
  41709. times: Ci.AnimationUtils.convertArray(e.times, Array),
  41710. values: Ci.AnimationUtils.convertArray(e.values, Array)
  41711. }
  41712. var n = e.getInterpolation()
  41713. n !== e.DefaultInterpolation && (t.interpolation = n)
  41714. }
  41715. return (t.type = e.ValueTypeName), t
  41716. },
  41717. _getTrackTypeForValueTypeName: function (e) {
  41718. switch (e.toLowerCase()) {
  41719. case 'scalar':
  41720. case 'double':
  41721. case 'float':
  41722. case 'number':
  41723. case 'integer':
  41724. return Ci.NumberKeyframeTrack
  41725. case 'vector':
  41726. case 'vector2':
  41727. case 'vector3':
  41728. case 'vector4':
  41729. return Ci.VectorKeyframeTrack
  41730. case 'color':
  41731. return Ci.ColorKeyframeTrack
  41732. case 'quaternion':
  41733. return Ci.QuaternionKeyframeTrack
  41734. case 'bool':
  41735. case 'boolean':
  41736. return Ci.BooleanKeyframeTrack
  41737. case 'string':
  41738. return Ci.StringKeyframeTrack
  41739. }
  41740. throw new Error('Unsupported typeName: ' + e)
  41741. }
  41742. }),
  41743. (Ci.PropertyBinding = function (e, t, i) {
  41744. ;(this.path = t), (this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t)), (this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e), (this.rootNode = e)
  41745. }),
  41746. (Ci.PropertyBinding.prototype = {
  41747. constructor: Ci.PropertyBinding,
  41748. getValue: function (e, t) {
  41749. this.bind(), this.getValue(e, t)
  41750. },
  41751. setValue: function (e, t) {
  41752. this.bind(), this.setValue(e, t)
  41753. },
  41754. bind: function () {
  41755. var e = this.node,
  41756. t = this.parsedPath,
  41757. i = t.objectName,
  41758. n = t.propertyName,
  41759. r = t.propertyIndex
  41760. if (
  41761. (e || ((e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode), (this.node = e)),
  41762. (this.getValue = this._getValue_unavailable),
  41763. (this.setValue = this._setValue_unavailable),
  41764. e)
  41765. ) {
  41766. if (i) {
  41767. var o = t.objectIndex
  41768. switch (i) {
  41769. case 'materials':
  41770. if (!e.material) return void console.error(' can not bind to material as node does not have a material', this)
  41771. if (!e.material.materials) return void console.error(' can not bind to material.materials as node.material does not have a materials array', this)
  41772. e = e.material.materials
  41773. break
  41774. case 'bones':
  41775. if (!e.skeleton) return void console.error(' can not bind to bones as node does not have a skeleton', this)
  41776. e = e.skeleton.bones
  41777. for (var a = 0; a < e.length; a++)
  41778. if (e[a].name === o) {
  41779. o = a
  41780. break
  41781. }
  41782. break
  41783. default:
  41784. if (void 0 === e[i]) return void console.error(' can not bind to objectName of node, undefined', this)
  41785. e = e[i]
  41786. }
  41787. if (void 0 !== o) {
  41788. if (void 0 === e[o]) return void console.error(' trying to bind to objectIndex of objectName, but is undefined:', this, e)
  41789. e = e[o]
  41790. }
  41791. }
  41792. var s = e[n]
  41793. if (s) {
  41794. var l = this.Versioning.None
  41795. void 0 !== e.needsUpdate
  41796. ? ((l = this.Versioning.NeedsUpdate), (this.targetObject = e))
  41797. : void 0 !== e.matrixWorldNeedsUpdate && ((l = this.Versioning.MatrixWorldNeedsUpdate), (this.targetObject = e))
  41798. var c = this.BindingType.Direct
  41799. if (void 0 !== r) {
  41800. if ('morphTargetInfluences' === n) {
  41801. if (!e.geometry) return void console.error(' can not bind to morphTargetInfluences becasuse node does not have a geometry', this)
  41802. if (!e.geometry.morphTargets) return void console.error(' can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets', this)
  41803. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  41804. if (e.geometry.morphTargets[a].name === r) {
  41805. r = a
  41806. break
  41807. }
  41808. }
  41809. ;(c = this.BindingType.ArrayElement), (this.resolvedProperty = s), (this.propertyIndex = r)
  41810. } else
  41811. void 0 !== s.fromArray && void 0 !== s.toArray
  41812. ? ((c = this.BindingType.HasFromToArray), (this.resolvedProperty = s))
  41813. : void 0 !== s.length
  41814. ? ((c = this.BindingType.EntireArray), (this.resolvedProperty = s))
  41815. : (this.propertyName = n)
  41816. ;(this.getValue = this.GetterByBindingType[c]), (this.setValue = this.SetterByBindingTypeAndVersioning[c][l])
  41817. } else {
  41818. var h = t.nodeName
  41819. console.error(' trying to update property for track: ' + h + '.' + n + " but it wasn't found.", e)
  41820. }
  41821. } else console.error(' trying to update node for track: ' + this.path + " but it wasn't found.")
  41822. },
  41823. unbind: function () {
  41824. ;(this.node = null), (this.getValue = this._getValue_unbound), (this.setValue = this._setValue_unbound)
  41825. }
  41826. }),
  41827. Object.assign(Ci.PropertyBinding.prototype, {
  41828. _getValue_unavailable: function () {},
  41829. _setValue_unavailable: function () {},
  41830. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  41831. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  41832. BindingType: {
  41833. Direct: 0,
  41834. EntireArray: 1,
  41835. ArrayElement: 2,
  41836. HasFromToArray: 3
  41837. },
  41838. Versioning: {
  41839. None: 0,
  41840. NeedsUpdate: 1,
  41841. MatrixWorldNeedsUpdate: 2
  41842. },
  41843. GetterByBindingType: [
  41844. function (e, t) {
  41845. e[t] = this.node[this.propertyName]
  41846. },
  41847. function (e, t) {
  41848. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n) e[t++] = i[n]
  41849. },
  41850. function (e, t) {
  41851. e[t] = this.resolvedProperty[this.propertyIndex]
  41852. },
  41853. function (e, t) {
  41854. this.resolvedProperty.toArray(e, t)
  41855. }
  41856. ],
  41857. SetterByBindingTypeAndVersioning: [
  41858. [
  41859. function (e, t) {
  41860. this.node[this.propertyName] = e[t]
  41861. },
  41862. function (e, t) {
  41863. ;(this.node[this.propertyName] = e[t]), (this.targetObject.needsUpdate = !0)
  41864. },
  41865. function (e, t) {
  41866. ;(this.node[this.propertyName] = e[t]), (this.targetObject.matrixWorldNeedsUpdate = !0)
  41867. }
  41868. ],
  41869. [
  41870. function (e, t) {
  41871. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n) i[n] = e[t++]
  41872. },
  41873. function (e, t) {
  41874. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n) i[n] = e[t++]
  41875. this.targetObject.needsUpdate = !0
  41876. },
  41877. function (e, t) {
  41878. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n) i[n] = e[t++]
  41879. this.targetObject.matrixWorldNeedsUpdate = !0
  41880. }
  41881. ],
  41882. [
  41883. function (e, t) {
  41884. this.resolvedProperty[this.propertyIndex] = e[t]
  41885. },
  41886. function (e, t) {
  41887. ;(this.resolvedProperty[this.propertyIndex] = e[t]), (this.targetObject.needsUpdate = !0)
  41888. },
  41889. function (e, t) {
  41890. ;(this.resolvedProperty[this.propertyIndex] = e[t]), (this.targetObject.matrixWorldNeedsUpdate = !0)
  41891. }
  41892. ],
  41893. [
  41894. function (e, t) {
  41895. this.resolvedProperty.fromArray(e, t)
  41896. },
  41897. function (e, t) {
  41898. this.resolvedProperty.fromArray(e, t), (this.targetObject.needsUpdate = !0)
  41899. },
  41900. function (e, t) {
  41901. this.resolvedProperty.fromArray(e, t), (this.targetObject.matrixWorldNeedsUpdate = !0)
  41902. }
  41903. ]
  41904. ]
  41905. }),
  41906. (Ci.PropertyBinding.Composite = function (e, t, i) {
  41907. var n = i || Ci.PropertyBinding.parseTrackName(t)
  41908. ;(this._targetGroup = e), (this._bindings = e.subscribe_(t, n))
  41909. }),
  41910. (Ci.PropertyBinding.Composite.prototype = {
  41911. constructor: Ci.PropertyBinding.Composite,
  41912. getValue: function (e, t) {
  41913. this.bind()
  41914. var i = this._targetGroup.nCachedObjects_,
  41915. n = this._bindings[i]
  41916. void 0 !== n && n.getValue(e, t)
  41917. },
  41918. setValue: function (e, t) {
  41919. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n) i[n].setValue(e, t)
  41920. },
  41921. bind: function () {
  41922. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t) e[t].bind()
  41923. },
  41924. unbind: function () {
  41925. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t) e[t].unbind()
  41926. }
  41927. }),
  41928. (Ci.PropertyBinding.create = function (e, t, i) {
  41929. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e, t, i) : new Ci.PropertyBinding(e, t, i)
  41930. }),
  41931. (Ci.PropertyBinding.parseTrackName = function (e) {
  41932. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/,
  41933. i = t.exec(e)
  41934. if (!i) throw new Error('cannot parse trackName at all: ' + e)
  41935. i.index === t.lastIndex && t.lastIndex++
  41936. var n = {
  41937. nodeName: i[3],
  41938. objectName: i[5],
  41939. objectIndex: i[7],
  41940. propertyName: i[9],
  41941. propertyIndex: i[11]
  41942. }
  41943. if (null === n.propertyName || 0 === n.propertyName.length) throw new Error('can not parse propertyName from trackName: ' + e)
  41944. return n
  41945. }),
  41946. (Ci.PropertyBinding.findNode = function (e, r) {
  41947. if (!r || '' === r || 'root' === r || '.' === r || -1 === r || r === e.name || r === e.uuid) return e
  41948. if (e.skeleton) {
  41949. var t = (function (e) {
  41950. for (var t = 0; t < e.bones.length; t++) {
  41951. var i = e.bones[t]
  41952. if (i.name === r) return i
  41953. }
  41954. return null
  41955. })(e.skeleton)
  41956. if (t) return t
  41957. }
  41958. if (e.children) {
  41959. var o = function (e) {
  41960. for (var t = 0; t < e.length; t++) {
  41961. var i = e[t]
  41962. if (i.name === r || i.uuid === r) return i
  41963. var n = o(i.children)
  41964. if (n) return n
  41965. }
  41966. return null
  41967. },
  41968. i = o(e.children)
  41969. if (i) return i
  41970. }
  41971. return null
  41972. }),
  41973. (Ci.PropertyMixer = function (e, t, i) {
  41974. ;(this.binding = e), (this.valueSize = i)
  41975. var n,
  41976. r = Float64Array
  41977. switch (t) {
  41978. case 'quaternion':
  41979. n = this._slerp
  41980. break
  41981. case 'string':
  41982. case 'bool':
  41983. ;(r = Array), (n = this._select)
  41984. break
  41985. default:
  41986. n = this._lerp
  41987. }
  41988. ;(this.buffer = new r(4 * i)), (this._mixBufferRegion = n), (this.cumulativeWeight = 0), (this.useCount = 0), (this.referenceCount = 0)
  41989. }),
  41990. (Ci.PropertyMixer.prototype = {
  41991. constructor: Ci.PropertyMixer,
  41992. accumulate: function (e, t) {
  41993. var i = this.buffer,
  41994. n = this.valueSize,
  41995. r = e * n + n,
  41996. o = this.cumulativeWeight
  41997. if (0 === o) {
  41998. for (var a = 0; a !== n; ++a) i[r + a] = i[a]
  41999. o = t
  42000. } else {
  42001. var s = t / (o += t)
  42002. this._mixBufferRegion(i, r, 0, s, n)
  42003. }
  42004. this.cumulativeWeight = o
  42005. },
  42006. apply: function (e) {
  42007. var t = this.valueSize,
  42008. i = this.buffer,
  42009. n = e * t + t,
  42010. r = this.cumulativeWeight,
  42011. o = this.binding
  42012. if (((this.cumulativeWeight = 0), r < 1)) {
  42013. var a = 3 * t
  42014. this._mixBufferRegion(i, n, a, 1 - r, t)
  42015. }
  42016. for (var s = t, l = t + t; s !== l; ++s)
  42017. if (i[s] !== i[s + t]) {
  42018. o.setValue(i, n)
  42019. break
  42020. }
  42021. },
  42022. saveOriginalState: function () {
  42023. var e = this.binding,
  42024. t = this.buffer,
  42025. i = this.valueSize,
  42026. n = 3 * i
  42027. e.getValue(t, n)
  42028. for (var r = i, o = n; r !== o; ++r) t[r] = t[n + (r % i)]
  42029. this.cumulativeWeight = 0
  42030. },
  42031. restoreOriginalState: function () {
  42032. var e = 3 * this.valueSize
  42033. this.binding.setValue(this.buffer, e)
  42034. },
  42035. _select: function (e, t, i, n, r) {
  42036. if (0.5 <= n) for (var o = 0; o !== r; ++o) e[t + o] = e[i + o]
  42037. },
  42038. _slerp: function (e, t, i, n, r) {
  42039. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  42040. },
  42041. _lerp: function (e, t, i, n, r) {
  42042. for (var o = 1 - n, a = 0; a !== r; ++a) {
  42043. var s = t + a
  42044. e[s] = e[s] * o + e[i + a] * n
  42045. }
  42046. }
  42047. }),
  42048. (Ci.BooleanKeyframeTrack = function (e, t, i) {
  42049. Ci.KeyframeTrack.call(this, e, t, i)
  42050. }),
  42051. (Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  42052. constructor: Ci.BooleanKeyframeTrack,
  42053. ValueTypeName: 'bool',
  42054. ValueBufferType: Array,
  42055. DefaultInterpolation: Ci.IntepolateDiscrete,
  42056. InterpolantFactoryMethodLinear: void 0,
  42057. InterpolantFactoryMethodSmooth: void 0
  42058. })),
  42059. (Ci.NumberKeyframeTrack = function (e, t, i, n) {
  42060. Ci.KeyframeTrack.call(this, e, t, i, n)
  42061. }),
  42062. (Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  42063. constructor: Ci.NumberKeyframeTrack,
  42064. ValueTypeName: 'number'
  42065. })),
  42066. (Ci.QuaternionKeyframeTrack = function (e, t, i, n) {
  42067. Ci.KeyframeTrack.call(this, e, t, i, n)
  42068. }),
  42069. (Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  42070. constructor: Ci.QuaternionKeyframeTrack,
  42071. ValueTypeName: 'quaternion',
  42072. DefaultInterpolation: Ci.InterpolateLinear,
  42073. InterpolantFactoryMethodLinear: function (e) {
  42074. return new Ci.QuaternionLinearInterpolant(this.times, this.values, this.getValueSize(), e)
  42075. },
  42076. InterpolantFactoryMethodSmooth: void 0
  42077. })),
  42078. (Ci.StringKeyframeTrack = function (e, t, i, n) {
  42079. Ci.KeyframeTrack.call(this, e, t, i, n)
  42080. }),
  42081. (Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  42082. constructor: Ci.StringKeyframeTrack,
  42083. ValueTypeName: 'string',
  42084. ValueBufferType: Array,
  42085. DefaultInterpolation: Ci.IntepolateDiscrete,
  42086. InterpolantFactoryMethodLinear: void 0,
  42087. InterpolantFactoryMethodSmooth: void 0
  42088. })),
  42089. (Ci.VectorKeyframeTrack = function (e, t, i, n) {
  42090. Ci.KeyframeTrack.call(this, e, t, i, n)
  42091. }),
  42092. (Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  42093. constructor: Ci.VectorKeyframeTrack,
  42094. ValueTypeName: 'vector'
  42095. })),
  42096. (Ci.Audio = function (e) {
  42097. Ci.Object3D.call(this),
  42098. (this.type = 'Audio'),
  42099. (this.context = e.context),
  42100. (this.source = this.context.createBufferSource()),
  42101. (this.source.onended = this.onEnded.bind(this)),
  42102. (this.gain = this.context.createGain()),
  42103. this.gain.connect(e.getInput()),
  42104. (this.autoplay = !1),
  42105. (this.startTime = 0),
  42106. (this.playbackRate = 1),
  42107. (this.isPlaying = !1),
  42108. (this.hasPlaybackControl = !0),
  42109. (this.sourceType = 'empty'),
  42110. (this.filter = null)
  42111. }),
  42112. (Ci.Audio.prototype = Object.create(Ci.Object3D.prototype)),
  42113. (Ci.Audio.prototype.constructor = Ci.Audio),
  42114. (Ci.Audio.prototype.getOutput = function () {
  42115. return this.gain
  42116. }),
  42117. (Ci.Audio.prototype.load = function (e) {
  42118. var t = new Ci.AudioBuffer(this.context)
  42119. return t.load(e), this.setBuffer(t), this
  42120. }),
  42121. (Ci.Audio.prototype.setNodeSource = function (e) {
  42122. return (this.hasPlaybackControl = !1), (this.sourceType = 'audioNode'), (this.source = e), this.connect(), this
  42123. }),
  42124. (Ci.Audio.prototype.setBuffer = function (e) {
  42125. var t = this
  42126. return (
  42127. e.onReady(function (e) {
  42128. ;(t.source.buffer = e), (t.sourceType = 'buffer'), t.autoplay && t.play()
  42129. }),
  42130. this
  42131. )
  42132. }),
  42133. (Ci.Audio.prototype.play = function () {
  42134. if (!0 !== this.isPlaying)
  42135. if (!1 !== this.hasPlaybackControl) {
  42136. var e = this.context.createBufferSource()
  42137. ;(e.buffer = this.source.buffer),
  42138. (e.loop = this.source.loop),
  42139. (e.onended = this.source.onended),
  42140. e.start(0, this.startTime),
  42141. (e.playbackRate.value = this.playbackRate),
  42142. (this.isPlaying = !0),
  42143. (this.source = e),
  42144. this.connect()
  42145. } else console.warn('THREE.Audio: this Audio has no playback control.')
  42146. else console.warn('THREE.Audio: Audio is already playing.')
  42147. }),
  42148. (Ci.Audio.prototype.pause = function () {
  42149. return !1 === this.hasPlaybackControl ? void console.warn('THREE.Audio: this Audio has no playback control.') : (this.source.stop(), void (this.startTime = this.context.currentTime))
  42150. }),
  42151. (Ci.Audio.prototype.stop = function () {
  42152. return !1 === this.hasPlaybackControl ? void console.warn('THREE.Audio: this Audio has no playback control.') : (this.source.stop(), void (this.startTime = 0))
  42153. }),
  42154. (Ci.Audio.prototype.connect = function () {
  42155. null !== this.filter ? (this.source.connect(this.filter), this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  42156. }),
  42157. (Ci.Audio.prototype.disconnect = function () {
  42158. null !== this.filter ? (this.source.disconnect(this.filter), this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  42159. }),
  42160. (Ci.Audio.prototype.getFilter = function () {
  42161. return this.filter
  42162. }),
  42163. (Ci.Audio.prototype.setFilter = function (e) {
  42164. void 0 === e && (e = null), !0 === this.isPlaying ? (this.disconnect(), (this.filter = e), this.connect()) : (this.filter = e)
  42165. }),
  42166. (Ci.Audio.prototype.setPlaybackRate = function (e) {
  42167. return !1 === this.hasPlaybackControl
  42168. ? void console.warn('THREE.Audio: this Audio has no playback control.')
  42169. : ((this.playbackRate = e), void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  42170. }),
  42171. (Ci.Audio.prototype.getPlaybackRate = function () {
  42172. return this.playbackRate
  42173. }),
  42174. (Ci.Audio.prototype.onEnded = function () {
  42175. this.isPlaying = !1
  42176. }),
  42177. (Ci.Audio.prototype.setLoop = function (e) {
  42178. return !1 === this.hasPlaybackControl ? void console.warn('THREE.Audio: this Audio has no playback control.') : void (this.source.loop = e)
  42179. }),
  42180. (Ci.Audio.prototype.getLoop = function () {
  42181. return !1 === this.hasPlaybackControl ? (console.warn('THREE.Audio: this Audio has no playback control.'), !1) : this.source.loop
  42182. }),
  42183. (Ci.Audio.prototype.setVolume = function (e) {
  42184. this.gain.gain.value = e
  42185. }),
  42186. (Ci.Audio.prototype.getVolume = function () {
  42187. return this.gain.gain.value
  42188. }),
  42189. (Ci.AudioAnalyser = function (e, t) {
  42190. ;(this.analyser = e.context.createAnalyser()),
  42191. (this.analyser.fftSize = void 0 !== t ? t : 2048),
  42192. (this.data = new Uint8Array(this.analyser.frequencyBinCount)),
  42193. e.getOutput().connect(this.analyser)
  42194. }),
  42195. (Ci.AudioAnalyser.prototype = {
  42196. constructor: Ci.AudioAnalyser,
  42197. getData: function () {
  42198. return this.analyser.getByteFrequencyData(this.data), this.data
  42199. }
  42200. }),
  42201. (Ci.AudioBuffer = function (e) {
  42202. ;(this.context = e), (this.ready = !1), (this.readyCallbacks = [])
  42203. }),
  42204. (Ci.AudioBuffer.prototype.load = function (e) {
  42205. var i = this,
  42206. t = new XMLHttpRequest()
  42207. return (
  42208. t.open('GET', e, !0),
  42209. (t.responseType = 'arraybuffer'),
  42210. (t.onload = function (e) {
  42211. i.context.decodeAudioData(this.response, function (e) {
  42212. ;(i.buffer = e), (i.ready = !0)
  42213. for (var t = 0; t < i.readyCallbacks.length; t++) i.readyCallbacks[t](i.buffer)
  42214. i.readyCallbacks = []
  42215. })
  42216. }),
  42217. t.send(),
  42218. this
  42219. )
  42220. }),
  42221. (Ci.AudioBuffer.prototype.onReady = function (e) {
  42222. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  42223. }),
  42224. (Ci.PositionalAudio = function (e) {
  42225. Ci.Audio.call(this, e), (this.panner = this.context.createPanner()), this.panner.connect(this.gain)
  42226. }),
  42227. (Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype)),
  42228. (Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio),
  42229. (Ci.PositionalAudio.prototype.getOutput = function () {
  42230. return this.panner
  42231. }),
  42232. (Ci.PositionalAudio.prototype.setRefDistance = function (e) {
  42233. this.panner.refDistance = e
  42234. }),
  42235. (Ci.PositionalAudio.prototype.getRefDistance = function () {
  42236. return this.panner.refDistance
  42237. }),
  42238. (Ci.PositionalAudio.prototype.setRolloffFactor = function (e) {
  42239. this.panner.rolloffFactor = e
  42240. }),
  42241. (Ci.PositionalAudio.prototype.getRolloffFactor = function () {
  42242. return this.panner.rolloffFactor
  42243. }),
  42244. (Ci.PositionalAudio.prototype.setDistanceModel = function (e) {
  42245. this.panner.distanceModel = e
  42246. }),
  42247. (Ci.PositionalAudio.prototype.getDistanceModel = function () {
  42248. return this.panner.distanceModel
  42249. }),
  42250. (Ci.PositionalAudio.prototype.setMaxDistance = function (e) {
  42251. this.panner.maxDistance = e
  42252. }),
  42253. (Ci.PositionalAudio.prototype.getMaxDistance = function () {
  42254. return this.panner.maxDistance
  42255. }),
  42256. (Ci.PositionalAudio.prototype.updateMatrixWorld =
  42257. ((it = new Ci.Vector3()),
  42258. function (e) {
  42259. Ci.Object3D.prototype.updateMatrixWorld.call(this, e), it.setFromMatrixPosition(this.matrixWorld), this.panner.setPosition(it.x, it.y, it.z)
  42260. })),
  42261. (Ci.AudioListener = function () {
  42262. Ci.Object3D.call(this),
  42263. (this.type = 'AudioListener'),
  42264. (this.context = new (window.AudioContext || window.webkitAudioContext)()),
  42265. (this.gain = this.context.createGain()),
  42266. this.gain.connect(this.context.destination),
  42267. (this.filter = null)
  42268. }),
  42269. (Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype)),
  42270. (Ci.AudioListener.prototype.constructor = Ci.AudioListener),
  42271. (Ci.AudioListener.prototype.getInput = function () {
  42272. return this.gain
  42273. }),
  42274. (Ci.AudioListener.prototype.removeFilter = function () {
  42275. null !== this.filter && (this.gain.disconnect(this.filter), this.filter.disconnect(this.context.destination), this.gain.connect(this.context.destination), (this.filter = null))
  42276. }),
  42277. (Ci.AudioListener.prototype.setFilter = function (e) {
  42278. null !== this.filter ? (this.gain.disconnect(this.filter), this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  42279. (this.filter = e),
  42280. this.gain.connect(this.filter),
  42281. this.filter.connect(this.context.destination)
  42282. }),
  42283. (Ci.AudioListener.prototype.getFilter = function () {
  42284. return this.filter
  42285. }),
  42286. (Ci.AudioListener.prototype.setMasterVolume = function (e) {
  42287. this.gain.gain.value = e
  42288. }),
  42289. (Ci.AudioListener.prototype.getMasterVolume = function () {
  42290. return this.gain.gain.value
  42291. }),
  42292. (Ci.AudioListener.prototype.updateMatrixWorld =
  42293. ((Je = new Ci.Vector3()),
  42294. ($e = new Ci.Quaternion()),
  42295. (et = new Ci.Vector3()),
  42296. (tt = new Ci.Vector3()),
  42297. function (e) {
  42298. Ci.Object3D.prototype.updateMatrixWorld.call(this, e)
  42299. var t = this.context.listener,
  42300. i = this.up
  42301. this.matrixWorld.decompose(Je, $e, et), tt.set(0, 0, -1).applyQuaternion($e), t.setPosition(Je.x, Je.y, Je.z), t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  42302. })),
  42303. (Ci.Camera = function () {
  42304. Ci.Object3D.call(this), (this.type = 'Camera'), (this.matrixWorldInverse = new Ci.Matrix4()), (this.projectionMatrix = new Ci.Matrix4())
  42305. }),
  42306. (Ci.Camera.prototype = Object.create(Ci.Object3D.prototype)),
  42307. (Ci.Camera.prototype.constructor = Ci.Camera),
  42308. (Ci.Camera.prototype.getWorldDirection =
  42309. ((Qe = new Ci.Quaternion()),
  42310. function (e) {
  42311. var t = e || new Ci.Vector3()
  42312. return this.getWorldQuaternion(Qe), t.set(0, 0, -1).applyQuaternion(Qe)
  42313. })),
  42314. (Ci.Camera.prototype.lookAt =
  42315. ((Ke = new Ci.Matrix4()),
  42316. function (e) {
  42317. Ke.lookAt(this.position, e, this.up), this.quaternion.setFromRotationMatrix(Ke)
  42318. })),
  42319. (Ci.Camera.prototype.clone = function () {
  42320. return new this.constructor().copy(this)
  42321. }),
  42322. (Ci.Camera.prototype.copy = function (e) {
  42323. return Ci.Object3D.prototype.copy.call(this, e), this.matrixWorldInverse.copy(e.matrixWorldInverse), this.projectionMatrix.copy(e.projectionMatrix), this
  42324. }),
  42325. (Ci.CubeCamera = function (e, t, i) {
  42326. Ci.Object3D.call(this), (this.type = 'CubeCamera')
  42327. var r = new Ci.PerspectiveCamera(90, 1, e, t)
  42328. r.up.set(0, -1, 0), r.lookAt(new Ci.Vector3(1, 0, 0)), this.add(r)
  42329. var o = new Ci.PerspectiveCamera(90, 1, e, t)
  42330. o.up.set(0, -1, 0), o.lookAt(new Ci.Vector3(-1, 0, 0)), this.add(o)
  42331. var a = new Ci.PerspectiveCamera(90, 1, e, t)
  42332. a.up.set(0, 0, 1), a.lookAt(new Ci.Vector3(0, 1, 0)), this.add(a)
  42333. var s = new Ci.PerspectiveCamera(90, 1, e, t)
  42334. s.up.set(0, 0, -1), s.lookAt(new Ci.Vector3(0, -1, 0)), this.add(s)
  42335. var l = new Ci.PerspectiveCamera(90, 1, e, t)
  42336. l.up.set(0, -1, 0), l.lookAt(new Ci.Vector3(0, 0, 1)), this.add(l)
  42337. var c = new Ci.PerspectiveCamera(90, 1, e, t)
  42338. c.up.set(0, -1, 0), c.lookAt(new Ci.Vector3(0, 0, -1)), this.add(c)
  42339. var n = {
  42340. format: Ci.RGBFormat,
  42341. magFilter: Ci.LinearFilter,
  42342. minFilter: Ci.LinearFilter
  42343. }
  42344. ;(this.renderTarget = new Ci.WebGLRenderTargetCube(i, i, n)),
  42345. (this.updateCubeMap = function (e, t) {
  42346. null === this.parent && this.updateMatrixWorld()
  42347. var i = this.renderTarget,
  42348. n = i.texture.generateMipmaps
  42349. ;(i.texture.generateMipmaps = !1),
  42350. (i.activeCubeFace = 0),
  42351. e.render(t, r, i),
  42352. (i.activeCubeFace = 1),
  42353. e.render(t, o, i),
  42354. (i.activeCubeFace = 2),
  42355. e.render(t, a, i),
  42356. (i.activeCubeFace = 3),
  42357. e.render(t, s, i),
  42358. (i.activeCubeFace = 4),
  42359. e.render(t, l, i),
  42360. (i.texture.generateMipmaps = n),
  42361. (i.activeCubeFace = 5),
  42362. e.render(t, c, i),
  42363. e.setRenderTarget(null)
  42364. })
  42365. }),
  42366. (Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype)),
  42367. (Ci.CubeCamera.prototype.constructor = Ci.CubeCamera),
  42368. (Ci.OrthographicCamera = function (e, t, i, n, r, o) {
  42369. Ci.Camera.call(this),
  42370. (this.type = 'OrthographicCamera'),
  42371. (this.zoom = 1),
  42372. (this.left = e),
  42373. (this.right = t),
  42374. (this.top = i),
  42375. (this.bottom = n),
  42376. (this.near = void 0 !== r ? r : 0.1),
  42377. (this.far = void 0 !== o ? o : 2e3),
  42378. this.updateProjectionMatrix()
  42379. }),
  42380. (Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype)),
  42381. (Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera),
  42382. (Ci.OrthographicCamera.prototype.updateProjectionMatrix = function () {
  42383. var e = (this.right - this.left) / (2 * this.zoom),
  42384. t = (this.top - this.bottom) / (2 * this.zoom),
  42385. i = (this.right + this.left) / 2,
  42386. n = (this.top + this.bottom) / 2
  42387. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  42388. }),
  42389. (Ci.OrthographicCamera.prototype.copy = function (e) {
  42390. return (
  42391. Ci.Camera.prototype.copy.call(this, e),
  42392. (this.left = e.left),
  42393. (this.right = e.right),
  42394. (this.top = e.top),
  42395. (this.bottom = e.bottom),
  42396. (this.near = e.near),
  42397. (this.far = e.far),
  42398. (this.zoom = e.zoom),
  42399. this
  42400. )
  42401. }),
  42402. (Ci.OrthographicCamera.prototype.toJSON = function (e) {
  42403. var t = Ci.Object3D.prototype.toJSON.call(this, e)
  42404. return (
  42405. (t.object.zoom = this.zoom),
  42406. (t.object.left = this.left),
  42407. (t.object.right = this.right),
  42408. (t.object.top = this.top),
  42409. (t.object.bottom = this.bottom),
  42410. (t.object.near = this.near),
  42411. (t.object.far = this.far),
  42412. t
  42413. )
  42414. }),
  42415. (Ci.PerspectiveCamera = function (e, t, i, n) {
  42416. Ci.Camera.call(this),
  42417. (this.type = 'PerspectiveCamera'),
  42418. (this.focalLength = 10),
  42419. (this.zoom = 1),
  42420. (this.fov = void 0 !== e ? e : 50),
  42421. (this.aspect = void 0 !== t ? t : 1),
  42422. (this.near = void 0 !== i ? i : 0.1),
  42423. (this.far = void 0 !== n ? n : 2e3),
  42424. this.updateProjectionMatrix()
  42425. }),
  42426. (Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype)),
  42427. (Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera),
  42428. (Ci.PerspectiveCamera.prototype.setLens = function (e, t) {
  42429. void 0 === t && (t = 24), (this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e)))), this.updateProjectionMatrix()
  42430. }),
  42431. (Ci.PerspectiveCamera.prototype.setViewOffset = function (e, t, i, n, r, o) {
  42432. ;(this.fullWidth = e), (this.fullHeight = t), (this.x = i), (this.y = n), (this.width = r), (this.height = o), this.updateProjectionMatrix()
  42433. }),
  42434. (Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function () {
  42435. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(0.5 * Ci.Math.degToRad(this.fov)) / this.zoom))
  42436. if (this.fullWidth) {
  42437. var t = this.fullWidth / this.fullHeight,
  42438. i = Math.tan(Ci.Math.degToRad(0.5 * e)) * this.near,
  42439. n = -i,
  42440. r = t * n,
  42441. o = t * i,
  42442. a = Math.abs(o - r),
  42443. s = Math.abs(i - n)
  42444. this.projectionMatrix.makeFrustum(
  42445. r + (this.x * a) / this.fullWidth,
  42446. r + ((this.x + this.width) * a) / this.fullWidth,
  42447. i - ((this.y + this.height) * s) / this.fullHeight,
  42448. i - (this.y * s) / this.fullHeight,
  42449. this.near,
  42450. this.far
  42451. )
  42452. } else this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  42453. }),
  42454. (Ci.PerspectiveCamera.prototype.copy = function (e) {
  42455. return (
  42456. Ci.Camera.prototype.copy.call(this, e),
  42457. (this.focalLength = e.focalLength),
  42458. (this.zoom = e.zoom),
  42459. (this.fov = e.fov),
  42460. (this.aspect = e.aspect),
  42461. (this.near = e.near),
  42462. (this.far = e.far),
  42463. this
  42464. )
  42465. }),
  42466. (Ci.PerspectiveCamera.prototype.toJSON = function (e) {
  42467. var t = Ci.Object3D.prototype.toJSON.call(this, e)
  42468. return (
  42469. (t.object.focalLength = this.focalLength),
  42470. (t.object.zoom = this.zoom),
  42471. (t.object.fov = this.fov),
  42472. (t.object.aspect = this.aspect),
  42473. (t.object.near = this.near),
  42474. (t.object.far = this.far),
  42475. t
  42476. )
  42477. }),
  42478. (Ci.StereoCamera = function () {
  42479. ;(this.type = 'StereoCamera'),
  42480. (this.aspect = 1),
  42481. (this.cameraL = new Ci.PerspectiveCamera()),
  42482. this.cameraL.layers.enable(1),
  42483. (this.cameraL.matrixAutoUpdate = !1),
  42484. (this.cameraR = new Ci.PerspectiveCamera()),
  42485. this.cameraR.layers.enable(2),
  42486. (this.cameraR.matrixAutoUpdate = !1)
  42487. }),
  42488. (Ci.StereoCamera.prototype = {
  42489. constructor: Ci.StereoCamera,
  42490. update:
  42491. ((Xe = new Ci.Matrix4()),
  42492. (Ze = new Ci.Matrix4()),
  42493. function (e) {
  42494. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  42495. ;(Ge = e.focalLength), (We = e.fov), (je = e.aspect * this.aspect), (Ye = e.near), (qe = e.far)
  42496. var t,
  42497. i,
  42498. n = e.projectionMatrix.clone(),
  42499. r = (0.032 * Ye) / Ge,
  42500. o = Ye * Math.tan(Ci.Math.degToRad(0.5 * We))
  42501. ;(Ze.elements[12] = -0.032),
  42502. (Xe.elements[12] = 0.032),
  42503. (t = -o * je + r),
  42504. (i = o * je + r),
  42505. (n.elements[0] = (2 * Ye) / (i - t)),
  42506. (n.elements[8] = (i + t) / (i - t)),
  42507. this.cameraL.projectionMatrix.copy(n),
  42508. (t = -o * je - r),
  42509. (i = o * je - r),
  42510. (n.elements[0] = (2 * Ye) / (i - t)),
  42511. (n.elements[8] = (i + t) / (i - t)),
  42512. this.cameraR.projectionMatrix.copy(n)
  42513. }
  42514. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze), this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  42515. })
  42516. }),
  42517. (Ci.Light = function (e, t) {
  42518. Ci.Object3D.call(this), (this.type = 'Light'), (this.color = new Ci.Color(e)), (this.intensity = void 0 !== t ? t : 1), (this.receiveShadow = void 0)
  42519. }),
  42520. (Ci.Light.prototype = Object.create(Ci.Object3D.prototype)),
  42521. (Ci.Light.prototype.constructor = Ci.Light),
  42522. (Ci.Light.prototype.copy = function (e) {
  42523. return Ci.Object3D.prototype.copy.call(this, e), this.color.copy(e.color), (this.intensity = e.intensity), this
  42524. }),
  42525. (Ci.Light.prototype.toJSON = function (e) {
  42526. var t = Ci.Object3D.prototype.toJSON.call(this, e)
  42527. return (
  42528. (t.object.color = this.color.getHex()),
  42529. (t.object.intensity = this.intensity),
  42530. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  42531. void 0 !== this.distance && (t.object.distance = this.distance),
  42532. void 0 !== this.angle && (t.object.angle = this.angle),
  42533. void 0 !== this.decay && (t.object.decay = this.decay),
  42534. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  42535. t
  42536. )
  42537. }),
  42538. (Ci.LightShadow = function (e) {
  42539. ;(this.camera = e), (this.bias = 0), (this.radius = 1), (this.mapSize = new Ci.Vector2(512, 512)), (this.map = null), (this.matrix = new Ci.Matrix4())
  42540. }),
  42541. (Ci.LightShadow.prototype = {
  42542. constructor: Ci.LightShadow,
  42543. copy: function (e) {
  42544. return (this.camera = e.camera.clone()), (this.bias = e.bias), (this.radius = e.radius), this.mapSize.copy(e.mapSize), this
  42545. },
  42546. clone: function () {
  42547. return new this.constructor().copy(this)
  42548. }
  42549. }),
  42550. (Ci.AmbientLight = function (e, t) {
  42551. Ci.Light.call(this, e, t), (this.type = 'AmbientLight'), (this.castShadow = void 0)
  42552. }),
  42553. (Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype)),
  42554. (Ci.AmbientLight.prototype.constructor = Ci.AmbientLight),
  42555. (Ci.DirectionalLight = function (e, t) {
  42556. Ci.Light.call(this, e, t),
  42557. (this.type = 'DirectionalLight'),
  42558. this.position.set(0, 1, 0),
  42559. this.updateMatrix(),
  42560. (this.target = new Ci.Object3D()),
  42561. (this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5, 5, 5, -5, 0.5, 500)))
  42562. }),
  42563. (Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype)),
  42564. (Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight),
  42565. (Ci.DirectionalLight.prototype.copy = function (e) {
  42566. return Ci.Light.prototype.copy.call(this, e), (this.target = e.target.clone()), (this.shadow = e.shadow.clone()), this
  42567. }),
  42568. (Ci.HemisphereLight = function (e, t, i) {
  42569. Ci.Light.call(this, e, i), (this.type = 'HemisphereLight'), (this.castShadow = void 0), this.position.set(0, 1, 0), this.updateMatrix(), (this.groundColor = new Ci.Color(t))
  42570. }),
  42571. (Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype)),
  42572. (Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight),
  42573. (Ci.HemisphereLight.prototype.copy = function (e) {
  42574. return Ci.Light.prototype.copy.call(this, e), this.groundColor.copy(e.groundColor), this
  42575. }),
  42576. (Ci.PointLight = function (e, t, i, n) {
  42577. Ci.Light.call(this, e, t),
  42578. (this.type = 'PointLight'),
  42579. (this.distance = void 0 !== i ? i : 0),
  42580. (this.decay = void 0 !== n ? n : 1),
  42581. (this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90, 1, 0.5, 500)))
  42582. }),
  42583. (Ci.PointLight.prototype = Object.create(Ci.Light.prototype)),
  42584. (Ci.PointLight.prototype.constructor = Ci.PointLight),
  42585. Object.defineProperty(Ci.PointLight.prototype, 'power', {
  42586. get: function () {
  42587. return 4 * this.intensity * Math.PI
  42588. },
  42589. set: function (e) {
  42590. this.intensity = e / (4 * Math.PI)
  42591. }
  42592. }),
  42593. (Ci.PointLight.prototype.copy = function (e) {
  42594. return Ci.Light.prototype.copy.call(this, e), (this.distance = e.distance), (this.decay = e.decay), (this.shadow = e.shadow.clone()), this
  42595. }),
  42596. (Ci.SpotLight = function (e, t, i, n, r, o) {
  42597. Ci.Light.call(this, e, t),
  42598. (this.type = 'SpotLight'),
  42599. this.position.set(0, 1, 0),
  42600. this.updateMatrix(),
  42601. (this.target = new Ci.Object3D()),
  42602. (this.distance = void 0 !== i ? i : 0),
  42603. (this.angle = void 0 !== n ? n : Math.PI / 3),
  42604. (this.penumbra = void 0 !== r ? r : 0),
  42605. (this.decay = void 0 !== o ? o : 1),
  42606. (this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50, 1, 0.5, 500)))
  42607. }),
  42608. (Ci.SpotLight.prototype = Object.create(Ci.Light.prototype)),
  42609. (Ci.SpotLight.prototype.constructor = Ci.SpotLight),
  42610. Object.defineProperty(Ci.SpotLight.prototype, 'power', {
  42611. get: function () {
  42612. return this.intensity * Math.PI
  42613. },
  42614. set: function (e) {
  42615. this.intensity = e / Math.PI
  42616. }
  42617. }),
  42618. (Ci.SpotLight.prototype.copy = function (e) {
  42619. return (
  42620. Ci.Light.prototype.copy.call(this, e),
  42621. (this.distance = e.distance),
  42622. (this.angle = e.angle),
  42623. (this.penumbra = e.penumbra),
  42624. (this.decay = e.decay),
  42625. (this.target = e.target.clone()),
  42626. (this.shadow = e.shadow.clone()),
  42627. this
  42628. )
  42629. }),
  42630. (Ci.Cache = {
  42631. enabled: !1,
  42632. files: {},
  42633. add: function (e, t) {
  42634. !1 !== this.enabled && (this.files[e] = t)
  42635. },
  42636. get: function (e) {
  42637. if (!1 !== this.enabled) return this.files[e]
  42638. },
  42639. remove: function (e) {
  42640. delete this.files[e]
  42641. },
  42642. clear: function () {
  42643. this.files = {}
  42644. }
  42645. }),
  42646. (Ci.Loader = function () {
  42647. ;(this.onLoadStart = function () {}), (this.onLoadProgress = function () {}), (this.onLoadComplete = function () {})
  42648. }),
  42649. (Ci.Loader.prototype = {
  42650. constructor: Ci.Loader,
  42651. crossOrigin: void 0,
  42652. extractUrlBase: function (e) {
  42653. var t = e.split('/')
  42654. return 1 === t.length ? './' : (t.pop(), t.join('/') + '/')
  42655. },
  42656. initMaterials: function (e, t, i) {
  42657. for (var n = [], r = 0; r < e.length; ++r) n[r] = this.createMaterial(e[r], t, i)
  42658. return n
  42659. },
  42660. createMaterial: function (e, c, h) {
  42661. function t(e, t, i, n, r) {
  42662. var o,
  42663. a = c + e,
  42664. s = Ci.Loader.Handlers.get(a)
  42665. ;(o = null !== s ? s.load(a) : (He.setCrossOrigin(h), He.load(a))),
  42666. void 0 !== t && (o.repeat.fromArray(t), 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping), 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  42667. void 0 !== i && o.offset.fromArray(i),
  42668. void 0 !== n &&
  42669. ('repeat' === n[0] && (o.wrapS = Ci.RepeatWrapping),
  42670. 'mirror' === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  42671. 'repeat' === n[1] && (o.wrapT = Ci.RepeatWrapping),
  42672. 'mirror' === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  42673. void 0 !== r && (o.anisotropy = r)
  42674. var l = Ci.Math.generateUUID()
  42675. return (u[l] = o), l
  42676. }
  42677. void 0 === Ue && (Ue = new Ci.Color()), void 0 === He && (He = new Ci.TextureLoader()), void 0 === ze && (ze = new Ci.MaterialLoader())
  42678. var u = {},
  42679. i = {
  42680. uuid: Ci.Math.generateUUID(),
  42681. type: 'MeshLambertMaterial'
  42682. }
  42683. for (var n in e) {
  42684. var r = e[n]
  42685. switch (n) {
  42686. case 'DbgColor':
  42687. case 'DbgIndex':
  42688. case 'opticalDensity':
  42689. case 'illumination':
  42690. break
  42691. case 'DbgName':
  42692. i.name = r
  42693. break
  42694. case 'blending':
  42695. i.blending = Ci[r]
  42696. break
  42697. case 'colorAmbient':
  42698. case 'mapAmbient':
  42699. console.warn('THREE.Loader.createMaterial:', n, 'is no longer supported.')
  42700. break
  42701. case 'colorDiffuse':
  42702. i.color = Ue.fromArray(r).getHex()
  42703. break
  42704. case 'colorSpecular':
  42705. i.specular = Ue.fromArray(r).getHex()
  42706. break
  42707. case 'colorEmissive':
  42708. i.emissive = Ue.fromArray(r).getHex()
  42709. break
  42710. case 'specularCoef':
  42711. i.shininess = r
  42712. break
  42713. case 'shading':
  42714. 'basic' === r.toLowerCase() && (i.type = 'MeshBasicMaterial'), 'phong' === r.toLowerCase() && (i.type = 'MeshPhongMaterial')
  42715. break
  42716. case 'mapDiffuse':
  42717. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy)
  42718. break
  42719. case 'mapDiffuseRepeat':
  42720. case 'mapDiffuseOffset':
  42721. case 'mapDiffuseWrap':
  42722. case 'mapDiffuseAnisotropy':
  42723. break
  42724. case 'mapLight':
  42725. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy)
  42726. break
  42727. case 'mapLightRepeat':
  42728. case 'mapLightOffset':
  42729. case 'mapLightWrap':
  42730. case 'mapLightAnisotropy':
  42731. break
  42732. case 'mapAO':
  42733. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy)
  42734. break
  42735. case 'mapAORepeat':
  42736. case 'mapAOOffset':
  42737. case 'mapAOWrap':
  42738. case 'mapAOAnisotropy':
  42739. break
  42740. case 'mapBump':
  42741. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy)
  42742. break
  42743. case 'mapBumpScale':
  42744. i.bumpScale = r
  42745. break
  42746. case 'mapBumpRepeat':
  42747. case 'mapBumpOffset':
  42748. case 'mapBumpWrap':
  42749. case 'mapBumpAnisotropy':
  42750. break
  42751. case 'mapNormal':
  42752. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy)
  42753. break
  42754. case 'mapNormalFactor':
  42755. i.normalScale = [r, r]
  42756. break
  42757. case 'mapNormalRepeat':
  42758. case 'mapNormalOffset':
  42759. case 'mapNormalWrap':
  42760. case 'mapNormalAnisotropy':
  42761. break
  42762. case 'mapSpecular':
  42763. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy)
  42764. break
  42765. case 'mapSpecularRepeat':
  42766. case 'mapSpecularOffset':
  42767. case 'mapSpecularWrap':
  42768. case 'mapSpecularAnisotropy':
  42769. break
  42770. case 'mapAlpha':
  42771. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy)
  42772. break
  42773. case 'mapAlphaRepeat':
  42774. case 'mapAlphaOffset':
  42775. case 'mapAlphaWrap':
  42776. case 'mapAlphaAnisotropy':
  42777. break
  42778. case 'flipSided':
  42779. i.side = Ci.BackSide
  42780. break
  42781. case 'doubleSided':
  42782. i.side = Ci.DoubleSide
  42783. break
  42784. case 'transparency':
  42785. console.warn('THREE.Loader.createMaterial: transparency has been renamed to opacity'), (i.opacity = r)
  42786. break
  42787. case 'depthTest':
  42788. case 'depthWrite':
  42789. case 'colorWrite':
  42790. case 'opacity':
  42791. case 'reflectivity':
  42792. case 'transparent':
  42793. case 'visible':
  42794. case 'wireframe':
  42795. i[n] = r
  42796. break
  42797. case 'vertexColors':
  42798. !0 === r && (i.vertexColors = Ci.VertexColors), 'face' === r && (i.vertexColors = Ci.FaceColors)
  42799. break
  42800. default:
  42801. console.error('THREE.Loader.createMaterial: Unsupported', n, r)
  42802. }
  42803. }
  42804. return 'MeshBasicMaterial' === i.type && delete i.emissive, 'MeshPhongMaterial' !== i.type && delete i.specular, i.opacity < 1 && (i.transparent = !0), ze.setTextures(u), ze.parse(i)
  42805. }
  42806. }),
  42807. (Ci.Loader.Handlers = {
  42808. handlers: [],
  42809. add: function (e, t) {
  42810. this.handlers.push(e, t)
  42811. },
  42812. get: function (e) {
  42813. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  42814. var r = t[i],
  42815. o = t[i + 1]
  42816. if (r.test(e)) return o
  42817. }
  42818. return null
  42819. }
  42820. }),
  42821. (Ci.XHRLoader = function (e) {
  42822. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  42823. }),
  42824. (Ci.XHRLoader.prototype = {
  42825. constructor: Ci.XHRLoader,
  42826. load: function (i, n, t, r) {
  42827. void 0 !== this.path && (i = this.path + i)
  42828. var o = this,
  42829. e = Ci.Cache.get(i)
  42830. if (void 0 !== e)
  42831. return (
  42832. n &&
  42833. setTimeout(function () {
  42834. n(e)
  42835. }, 0),
  42836. e
  42837. )
  42838. var a = new XMLHttpRequest()
  42839. return (
  42840. a.overrideMimeType('text/plain'),
  42841. a.open('GET', i, !0),
  42842. a.addEventListener(
  42843. 'load',
  42844. function (e) {
  42845. var t = e.target.response
  42846. Ci.Cache.add(i, t),
  42847. 200 === this.status
  42848. ? (n && n(t), o.manager.itemEnd(i))
  42849. : 0 === this.status
  42850. ? (console.warn('THREE.XHRLoader: HTTP Status 0 received.'), n && n(t), o.manager.itemEnd(i))
  42851. : (r && r(e), o.manager.itemError(i))
  42852. },
  42853. !1
  42854. ),
  42855. void 0 !== t &&
  42856. a.addEventListener(
  42857. 'progress',
  42858. function (e) {
  42859. t(e)
  42860. },
  42861. !1
  42862. ),
  42863. a.addEventListener(
  42864. 'error',
  42865. function (e) {
  42866. r && r(e), o.manager.itemError(i)
  42867. },
  42868. !1
  42869. ),
  42870. void 0 !== this.responseType && (a.responseType = this.responseType),
  42871. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  42872. a.send(null),
  42873. o.manager.itemStart(i),
  42874. a
  42875. )
  42876. },
  42877. setPath: function (e) {
  42878. this.path = e
  42879. },
  42880. setResponseType: function (e) {
  42881. this.responseType = e
  42882. },
  42883. setWithCredentials: function (e) {
  42884. this.withCredentials = e
  42885. }
  42886. }),
  42887. (Ci.FontLoader = function (e) {
  42888. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  42889. }),
  42890. (Ci.FontLoader.prototype = {
  42891. constructor: Ci.FontLoader,
  42892. load: function (e, t, i, n) {
  42893. new Ci.XHRLoader(this.manager).load(
  42894. e,
  42895. function (e) {
  42896. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  42897. },
  42898. i,
  42899. n
  42900. )
  42901. }
  42902. }),
  42903. (Ci.ImageLoader = function (e) {
  42904. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  42905. }),
  42906. (Ci.ImageLoader.prototype = {
  42907. constructor: Ci.ImageLoader,
  42908. load: function (t, i, n, r) {
  42909. void 0 !== this.path && (t = this.path + t)
  42910. var o = this,
  42911. e = Ci.Cache.get(t)
  42912. if (void 0 !== e)
  42913. return (
  42914. o.manager.itemStart(t),
  42915. i
  42916. ? setTimeout(function () {
  42917. i(e), o.manager.itemEnd(t)
  42918. }, 0)
  42919. : o.manager.itemEnd(t),
  42920. e
  42921. )
  42922. var a = document.createElement('img')
  42923. return (
  42924. a.addEventListener(
  42925. 'load',
  42926. function (e) {
  42927. Ci.Cache.add(t, this), i && i(this), o.manager.itemEnd(t)
  42928. },
  42929. !1
  42930. ),
  42931. void 0 !== n &&
  42932. a.addEventListener(
  42933. 'progress',
  42934. function (e) {
  42935. n(e)
  42936. },
  42937. !1
  42938. ),
  42939. a.addEventListener(
  42940. 'error',
  42941. function (e) {
  42942. r && r(e), o.manager.itemError(t)
  42943. },
  42944. !1
  42945. ),
  42946. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  42947. o.manager.itemStart(t),
  42948. (a.src = t),
  42949. a
  42950. )
  42951. },
  42952. setCrossOrigin: function (e) {
  42953. this.crossOrigin = e
  42954. },
  42955. setPath: function (e) {
  42956. this.path = e
  42957. }
  42958. }),
  42959. (Ci.JSONLoader = function (e) {
  42960. 'boolean' == typeof e && (console.warn('THREE.JSONLoader: showStatus parameter has been removed from constructor.'), (e = void 0)),
  42961. (this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager),
  42962. (this.withCredentials = !1)
  42963. }),
  42964. (Ci.JSONLoader.prototype = {
  42965. constructor: Ci.JSONLoader,
  42966. get statusDomElement() {
  42967. return (
  42968. void 0 === this._statusDomElement && (this._statusDomElement = document.createElement('div')),
  42969. console.warn('THREE.JSONLoader: .statusDomElement has been removed.'),
  42970. this._statusDomElement
  42971. )
  42972. },
  42973. load: function (o, a, e, t) {
  42974. var s = this,
  42975. l = this.texturePath && 'string' == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o),
  42976. i = new Ci.XHRLoader(this.manager)
  42977. i.setWithCredentials(this.withCredentials),
  42978. i.load(
  42979. o,
  42980. function (e) {
  42981. var t = JSON.parse(e),
  42982. i = t.metadata
  42983. if (void 0 !== i) {
  42984. var n = i.type
  42985. if (void 0 !== n) {
  42986. if ('object' === n.toLowerCase()) return void console.error('THREE.JSONLoader: ' + o + ' should be loaded with THREE.ObjectLoader instead.')
  42987. if ('scene' === n.toLowerCase()) return void console.error('THREE.JSONLoader: ' + o + ' should be loaded with THREE.SceneLoader instead.')
  42988. }
  42989. }
  42990. var r = s.parse(t, l)
  42991. a(r.geometry, r.materials)
  42992. },
  42993. e,
  42994. t
  42995. )
  42996. },
  42997. setTexturePath: function (e) {
  42998. this.texturePath = e
  42999. },
  43000. parse: function (D, e) {
  43001. var N = new Ci.Geometry(),
  43002. t = void 0 !== D.scale ? 1 / D.scale : 1
  43003. if (
  43004. ((function (e) {
  43005. function t(e, t) {
  43006. return e & (1 << t)
  43007. }
  43008. var i,
  43009. n,
  43010. r,
  43011. o,
  43012. a,
  43013. s,
  43014. l,
  43015. c,
  43016. h,
  43017. u,
  43018. d,
  43019. p,
  43020. f,
  43021. g,
  43022. m,
  43023. v,
  43024. y,
  43025. A,
  43026. C,
  43027. I,
  43028. E,
  43029. _,
  43030. b,
  43031. w,
  43032. T,
  43033. x,
  43034. S,
  43035. M = D.faces,
  43036. R = D.vertices,
  43037. P = D.normals,
  43038. O = D.colors,
  43039. L = 0
  43040. if (void 0 !== D.uvs) {
  43041. for (i = 0; i < D.uvs.length; i++) D.uvs[i].length && L++
  43042. for (i = 0; i < L; i++) N.faceVertexUvs[i] = []
  43043. }
  43044. for (o = 0, a = R.length; o < a; ) ((A = new Ci.Vector3()).x = R[o++] * e), (A.y = R[o++] * e), (A.z = R[o++] * e), N.vertices.push(A)
  43045. for (o = 0, a = M.length; o < a; )
  43046. if (((d = t((u = M[o++]), 0)), (p = t(u, 1)), (f = t(u, 3)), (g = t(u, 4)), (m = t(u, 5)), (v = t(u, 6)), (y = t(u, 7)), d)) {
  43047. if (
  43048. (((I = new Ci.Face3()).a = M[o]),
  43049. (I.b = M[o + 1]),
  43050. (I.c = M[o + 3]),
  43051. ((E = new Ci.Face3()).a = M[o + 1]),
  43052. (E.b = M[o + 2]),
  43053. (E.c = M[o + 3]),
  43054. (o += 4),
  43055. p && ((h = M[o++]), (I.materialIndex = h), (E.materialIndex = h)),
  43056. (r = N.faces.length),
  43057. f)
  43058. )
  43059. for (i = 0; i < L; i++)
  43060. for (w = D.uvs[i], N.faceVertexUvs[i][r] = [], N.faceVertexUvs[i][r + 1] = [], n = 0; n < 4; n++)
  43061. (x = w[2 * (c = M[o++])]), (S = w[2 * c + 1]), (T = new Ci.Vector2(x, S)), 2 !== n && N.faceVertexUvs[i][r].push(T), 0 !== n && N.faceVertexUvs[i][r + 1].push(T)
  43062. if ((g && ((l = 3 * M[o++]), I.normal.set(P[l++], P[l++], P[l]), E.normal.copy(I.normal)), m))
  43063. for (i = 0; i < 4; i++) (l = 3 * M[o++]), (b = new Ci.Vector3(P[l++], P[l++], P[l])), 2 !== i && I.vertexNormals.push(b), 0 !== i && E.vertexNormals.push(b)
  43064. if ((v && ((_ = O[(s = M[o++])]), I.color.setHex(_), E.color.setHex(_)), y))
  43065. for (i = 0; i < 4; i++) (_ = O[(s = M[o++])]), 2 !== i && I.vertexColors.push(new Ci.Color(_)), 0 !== i && E.vertexColors.push(new Ci.Color(_))
  43066. N.faces.push(I), N.faces.push(E)
  43067. } else {
  43068. if ((((C = new Ci.Face3()).a = M[o++]), (C.b = M[o++]), (C.c = M[o++]), p && ((h = M[o++]), (C.materialIndex = h)), (r = N.faces.length), f))
  43069. for (i = 0; i < L; i++)
  43070. for (w = D.uvs[i], N.faceVertexUvs[i][r] = [], n = 0; n < 3; n++) (x = w[2 * (c = M[o++])]), (S = w[2 * c + 1]), (T = new Ci.Vector2(x, S)), N.faceVertexUvs[i][r].push(T)
  43071. if ((g && ((l = 3 * M[o++]), C.normal.set(P[l++], P[l++], P[l])), m))
  43072. for (i = 0; i < 3; i++) (l = 3 * M[o++]), (b = new Ci.Vector3(P[l++], P[l++], P[l])), C.vertexNormals.push(b)
  43073. if ((v && ((s = M[o++]), C.color.setHex(O[s])), y)) for (i = 0; i < 3; i++) (s = M[o++]), C.vertexColors.push(new Ci.Color(O[s]))
  43074. N.faces.push(C)
  43075. }
  43076. })(t),
  43077. (function () {
  43078. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2
  43079. if (D.skinWeights)
  43080. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  43081. var n = D.skinWeights[t],
  43082. r = 1 < e ? D.skinWeights[t + 1] : 0,
  43083. o = 2 < e ? D.skinWeights[t + 2] : 0,
  43084. a = 3 < e ? D.skinWeights[t + 3] : 0
  43085. N.skinWeights.push(new Ci.Vector4(n, r, o, a))
  43086. }
  43087. if (D.skinIndices)
  43088. for (t = 0, i = D.skinIndices.length; t < i; t += e) {
  43089. var s = D.skinIndices[t],
  43090. l = 1 < e ? D.skinIndices[t + 1] : 0,
  43091. c = 2 < e ? D.skinIndices[t + 2] : 0,
  43092. h = 3 < e ? D.skinIndices[t + 3] : 0
  43093. N.skinIndices.push(new Ci.Vector4(s, l, c, h))
  43094. }
  43095. ;(N.bones = D.bones),
  43096. N.bones &&
  43097. 0 < N.bones.length &&
  43098. (N.skinWeights.length !== N.skinIndices.length || N.skinIndices.length !== N.vertices.length) &&
  43099. console.warn(
  43100. 'When skinning, number of vertices (' + N.vertices.length + '), skinIndices (' + N.skinIndices.length + '), and skinWeights (' + N.skinWeights.length + ') should match.'
  43101. )
  43102. })(),
  43103. (function (e) {
  43104. if (void 0 !== D.morphTargets)
  43105. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  43106. ;(N.morphTargets[t] = {}), (N.morphTargets[t].name = D.morphTargets[t].name), (N.morphTargets[t].vertices = [])
  43107. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  43108. var s = new Ci.Vector3()
  43109. ;(s.x = r[o] * e), (s.y = r[o + 1] * e), (s.z = r[o + 2] * e), n.push(s)
  43110. }
  43111. }
  43112. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  43113. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.')
  43114. var l = N.faces,
  43115. c = D.morphColors[0].colors
  43116. for (t = 0, i = l.length; t < i; t++) l[t].color.fromArray(c, 3 * t)
  43117. }
  43118. })(t),
  43119. (function () {
  43120. var e = [],
  43121. t = []
  43122. void 0 !== D.animation && t.push(D.animation), void 0 !== D.animations && (D.animations.length ? (t = t.concat(D.animations)) : t.push(D.animations))
  43123. for (var i = 0; i < t.length; i++) {
  43124. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones)
  43125. n && e.push(n)
  43126. }
  43127. if (N.morphTargets) {
  43128. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10)
  43129. e = e.concat(r)
  43130. }
  43131. 0 < e.length && (N.animations = e)
  43132. })(),
  43133. N.computeFaceNormals(),
  43134. N.computeBoundingSphere(),
  43135. void 0 === D.materials || 0 === D.materials.length)
  43136. )
  43137. return {
  43138. geometry: N
  43139. }
  43140. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin)
  43141. return {
  43142. geometry: N,
  43143. materials: i
  43144. }
  43145. }
  43146. }),
  43147. (Ci.LoadingManager = function (e, t, i) {
  43148. var n = this,
  43149. r = !1,
  43150. o = 0,
  43151. a = 0
  43152. ;(this.onStart = void 0),
  43153. (this.onLoad = e),
  43154. (this.onProgress = t),
  43155. (this.onError = i),
  43156. (this.itemStart = function (e) {
  43157. a++, !1 === r && void 0 !== n.onStart && n.onStart(e, o, a), (r = !0)
  43158. }),
  43159. (this.itemEnd = function (e) {
  43160. o++, void 0 !== n.onProgress && n.onProgress(e, o, a), o === a && ((r = !1), void 0 !== n.onLoad && n.onLoad())
  43161. }),
  43162. (this.itemError = function (e) {
  43163. void 0 !== n.onError && n.onError(e)
  43164. })
  43165. }),
  43166. (Ci.DefaultLoadingManager = new Ci.LoadingManager()),
  43167. (Ci.BufferGeometryLoader = function (e) {
  43168. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  43169. }),
  43170. (Ci.BufferGeometryLoader.prototype = {
  43171. constructor: Ci.BufferGeometryLoader,
  43172. load: function (e, t, i, n) {
  43173. var r = this
  43174. new Ci.XHRLoader(r.manager).load(
  43175. e,
  43176. function (e) {
  43177. t(r.parse(JSON.parse(e)))
  43178. },
  43179. i,
  43180. n
  43181. )
  43182. },
  43183. parse: function (e) {
  43184. var t = new Ci.BufferGeometry(),
  43185. i = e.data.index,
  43186. n = {
  43187. Int8Array: Int8Array,
  43188. Uint8Array: Uint8Array,
  43189. Uint8ClampedArray: Uint8ClampedArray,
  43190. Int16Array: Int16Array,
  43191. Uint16Array: Uint16Array,
  43192. Int32Array: Int32Array,
  43193. Uint32Array: Uint32Array,
  43194. Float32Array: Float32Array,
  43195. Float64Array: Float64Array
  43196. }
  43197. if (void 0 !== i) {
  43198. var r = new n[i.type](i.array)
  43199. t.setIndex(new Ci.BufferAttribute(r, 1))
  43200. }
  43201. var o = e.data.attributes
  43202. for (var a in o) {
  43203. var s = o[a]
  43204. r = new n[s.type](s.array)
  43205. t.addAttribute(a, new Ci.BufferAttribute(r, s.itemSize))
  43206. }
  43207. var l = e.data.groups || e.data.drawcalls || e.data.offsets
  43208. if (void 0 !== l)
  43209. for (var c = 0, h = l.length; c !== h; ++c) {
  43210. var u = l[c]
  43211. t.addGroup(u.start, u.count, u.materialIndex)
  43212. }
  43213. var d = e.data.boundingSphere
  43214. if (void 0 !== d) {
  43215. var p = new Ci.Vector3()
  43216. void 0 !== d.center && p.fromArray(d.center), (t.boundingSphere = new Ci.Sphere(p, d.radius))
  43217. }
  43218. return t
  43219. }
  43220. }),
  43221. (Ci.MaterialLoader = function (e) {
  43222. ;(this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager), (this.textures = {})
  43223. }),
  43224. (Ci.MaterialLoader.prototype = {
  43225. constructor: Ci.MaterialLoader,
  43226. load: function (e, t, i, n) {
  43227. var r = this
  43228. new Ci.XHRLoader(r.manager).load(
  43229. e,
  43230. function (e) {
  43231. t(r.parse(JSON.parse(e)))
  43232. },
  43233. i,
  43234. n
  43235. )
  43236. },
  43237. setTextures: function (e) {
  43238. this.textures = e
  43239. },
  43240. getTexture: function (e) {
  43241. var t = this.textures
  43242. return void 0 === t[e] && console.warn('THREE.MaterialLoader: Undefined texture', e), t[e]
  43243. },
  43244. parse: function (e) {
  43245. var t = new Ci[e.type]()
  43246. if (
  43247. (void 0 !== e.uuid && (t.uuid = e.uuid),
  43248. void 0 !== e.name && (t.name = e.name),
  43249. void 0 !== e.color && t.color.setHex(e.color),
  43250. void 0 !== e.roughness && (t.roughness = e.roughness),
  43251. void 0 !== e.metalness && (t.metalness = e.metalness),
  43252. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  43253. void 0 !== e.specular && t.specular.setHex(e.specular),
  43254. void 0 !== e.shininess && (t.shininess = e.shininess),
  43255. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  43256. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  43257. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  43258. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  43259. void 0 !== e.shading && (t.shading = e.shading),
  43260. void 0 !== e.blending && (t.blending = e.blending),
  43261. void 0 !== e.side && (t.side = e.side),
  43262. void 0 !== e.opacity && (t.opacity = e.opacity),
  43263. void 0 !== e.transparent && (t.transparent = e.transparent),
  43264. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  43265. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  43266. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  43267. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  43268. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  43269. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  43270. void 0 !== e.size && (t.size = e.size),
  43271. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  43272. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  43273. void 0 !== e.alphaMap && ((t.alphaMap = this.getTexture(e.alphaMap)), (t.transparent = !0)),
  43274. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  43275. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  43276. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  43277. void 0 !== e.normalScale)
  43278. ) {
  43279. var i = e.normalScale
  43280. !1 === Array.isArray(i) && (i = [i, i]), (t.normalScale = new Ci.Vector2().fromArray(i))
  43281. }
  43282. if (
  43283. (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  43284. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  43285. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  43286. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  43287. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  43288. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  43289. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  43290. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  43291. void 0 !== e.envMap && ((t.envMap = this.getTexture(e.envMap)), (t.combine = Ci.MultiplyOperation)),
  43292. e.reflectivity && (t.reflectivity = e.reflectivity),
  43293. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  43294. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  43295. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  43296. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  43297. void 0 !== e.materials)
  43298. )
  43299. for (var n = 0, r = e.materials.length; n < r; n++) t.materials.push(this.parse(e.materials[n]))
  43300. return t
  43301. }
  43302. }),
  43303. (Ci.ObjectLoader = function (e) {
  43304. ;(this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager), (this.texturePath = '')
  43305. }),
  43306. (Ci.ObjectLoader.prototype = {
  43307. constructor: Ci.ObjectLoader,
  43308. load: function (e, t, i, n) {
  43309. '' === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf('/') + 1))
  43310. var r = this
  43311. new Ci.XHRLoader(r.manager).load(
  43312. e,
  43313. function (e) {
  43314. r.parse(JSON.parse(e), t)
  43315. },
  43316. i,
  43317. n
  43318. )
  43319. },
  43320. setTexturePath: function (e) {
  43321. this.texturePath = e
  43322. },
  43323. setCrossOrigin: function (e) {
  43324. this.crossOrigin = e
  43325. },
  43326. parse: function (e, t) {
  43327. var i = this.parseGeometries(e.geometries),
  43328. n = this.parseImages(e.images, function () {
  43329. void 0 !== t && t(a)
  43330. }),
  43331. r = this.parseTextures(e.textures, n),
  43332. o = this.parseMaterials(e.materials, r),
  43333. a = this.parseObject(e.object, i, o)
  43334. return e.animations && (a.animations = this.parseAnimations(e.animations)), (void 0 !== e.images && 0 !== e.images.length) || (void 0 !== t && t(a)), a
  43335. },
  43336. parseGeometries: function (e) {
  43337. var t = {}
  43338. if (void 0 !== e)
  43339. for (var i = new Ci.JSONLoader(), n = new Ci.BufferGeometryLoader(), r = 0, o = e.length; r < o; r++) {
  43340. var a,
  43341. s = e[r]
  43342. switch (s.type) {
  43343. case 'PlaneGeometry':
  43344. case 'PlaneBufferGeometry':
  43345. a = new Ci[s.type](s.width, s.height, s.widthSegments, s.heightSegments)
  43346. break
  43347. case 'BoxGeometry':
  43348. case 'BoxBufferGeometry':
  43349. case 'CubeGeometry':
  43350. a = new Ci[s.type](s.width, s.height, s.depth, s.widthSegments, s.heightSegments, s.depthSegments)
  43351. break
  43352. case 'CircleGeometry':
  43353. case 'CircleBufferGeometry':
  43354. a = new Ci[s.type](s.radius, s.segments, s.thetaStart, s.thetaLength)
  43355. break
  43356. case 'CylinderGeometry':
  43357. case 'CylinderBufferGeometry':
  43358. a = new Ci[s.type](s.radiusTop, s.radiusBottom, s.height, s.radialSegments, s.heightSegments, s.openEnded, s.thetaStart, s.thetaLength)
  43359. break
  43360. case 'SphereGeometry':
  43361. case 'SphereBufferGeometry':
  43362. a = new Ci[s.type](s.radius, s.widthSegments, s.heightSegments, s.phiStart, s.phiLength, s.thetaStart, s.thetaLength)
  43363. break
  43364. case 'DodecahedronGeometry':
  43365. a = new Ci.DodecahedronGeometry(s.radius, s.detail)
  43366. break
  43367. case 'IcosahedronGeometry':
  43368. a = new Ci.IcosahedronGeometry(s.radius, s.detail)
  43369. break
  43370. case 'OctahedronGeometry':
  43371. a = new Ci.OctahedronGeometry(s.radius, s.detail)
  43372. break
  43373. case 'TetrahedronGeometry':
  43374. a = new Ci.TetrahedronGeometry(s.radius, s.detail)
  43375. break
  43376. case 'RingGeometry':
  43377. case 'RingBufferGeometry':
  43378. a = new Ci[s.type](s.innerRadius, s.outerRadius, s.thetaSegments, s.phiSegments, s.thetaStart, s.thetaLength)
  43379. break
  43380. case 'TorusGeometry':
  43381. case 'TorusBufferGeometry':
  43382. a = new Ci[s.type](s.radius, s.tube, s.radialSegments, s.tubularSegments, s.arc)
  43383. break
  43384. case 'TorusKnotGeometry':
  43385. case 'TorusKnotBufferGeometry':
  43386. a = new Ci[s.type](s.radius, s.tube, s.tubularSegments, s.radialSegments, s.p, s.q)
  43387. break
  43388. case 'LatheGeometry':
  43389. a = new Ci.LatheGeometry(s.points, s.segments, s.phiStart, s.phiLength)
  43390. break
  43391. case 'BufferGeometry':
  43392. a = n.parse(s)
  43393. break
  43394. case 'Geometry':
  43395. a = i.parse(s.data, this.texturePath).geometry
  43396. break
  43397. default:
  43398. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"')
  43399. continue
  43400. }
  43401. ;(a.uuid = s.uuid), void 0 !== s.name && (a.name = s.name), (t[s.uuid] = a)
  43402. }
  43403. return t
  43404. },
  43405. parseMaterials: function (e, t) {
  43406. var i = {}
  43407. if (void 0 !== e) {
  43408. var n = new Ci.MaterialLoader()
  43409. n.setTextures(t)
  43410. for (var r = 0, o = e.length; r < o; r++) {
  43411. var a = n.parse(e[r])
  43412. i[a.uuid] = a
  43413. }
  43414. }
  43415. return i
  43416. },
  43417. parseAnimations: function (e) {
  43418. for (var t = [], i = 0; i < e.length; i++) {
  43419. var n = Ci.AnimationClip.parse(e[i])
  43420. t.push(n)
  43421. }
  43422. return t
  43423. },
  43424. parseImages: function (e, t) {
  43425. function i(e) {
  43426. return (
  43427. n.manager.itemStart(e),
  43428. a.load(e, function () {
  43429. n.manager.itemEnd(e)
  43430. })
  43431. )
  43432. }
  43433. var n = this,
  43434. r = {}
  43435. if (void 0 !== e && 0 < e.length) {
  43436. var o = new Ci.LoadingManager(t),
  43437. a = new Ci.ImageLoader(o)
  43438. a.setCrossOrigin(this.crossOrigin)
  43439. for (var s = 0, l = e.length; s < l; s++) {
  43440. var c = e[s],
  43441. h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url
  43442. r[c.uuid] = i(h)
  43443. }
  43444. }
  43445. return r
  43446. },
  43447. parseTextures: function (e, t) {
  43448. function i(e) {
  43449. return 'number' == typeof e ? e : (console.warn('THREE.ObjectLoader.parseTexture: Constant should be in numeric form.', e), Ci[e])
  43450. }
  43451. var n = {}
  43452. if (void 0 !== e)
  43453. for (var r = 0, o = e.length; r < o; r++) {
  43454. var a = e[r]
  43455. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid), void 0 === t[a.image] && console.warn('THREE.ObjectLoader: Undefined image', a.image)
  43456. var s = new Ci.Texture(t[a.image])
  43457. ;(s.needsUpdate = !0),
  43458. (s.uuid = a.uuid),
  43459. void 0 !== a.name && (s.name = a.name),
  43460. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  43461. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0], a.offset[1])),
  43462. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0], a.repeat[1])),
  43463. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  43464. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  43465. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  43466. Array.isArray(a.wrap) && ((s.wrapS = i(a.wrap[0])), (s.wrapT = i(a.wrap[1]))),
  43467. (n[a.uuid] = s)
  43468. }
  43469. return n
  43470. },
  43471. parseObject:
  43472. ((ke = new Ci.Matrix4()),
  43473. function (e, t, i) {
  43474. function n(e) {
  43475. return void 0 === t[e] && console.warn('THREE.ObjectLoader: Undefined geometry', e), t[e]
  43476. }
  43477. function r(e) {
  43478. if (void 0 !== e) return void 0 === i[e] && console.warn('THREE.ObjectLoader: Undefined material', e), i[e]
  43479. }
  43480. var o
  43481. switch (e.type) {
  43482. case 'Scene':
  43483. o = new Ci.Scene()
  43484. break
  43485. case 'PerspectiveCamera':
  43486. o = new Ci.PerspectiveCamera(e.fov, e.aspect, e.near, e.far)
  43487. break
  43488. case 'OrthographicCamera':
  43489. o = new Ci.OrthographicCamera(e.left, e.right, e.top, e.bottom, e.near, e.far)
  43490. break
  43491. case 'AmbientLight':
  43492. o = new Ci.AmbientLight(e.color, e.intensity)
  43493. break
  43494. case 'DirectionalLight':
  43495. o = new Ci.DirectionalLight(e.color, e.intensity)
  43496. break
  43497. case 'PointLight':
  43498. o = new Ci.PointLight(e.color, e.intensity, e.distance, e.decay)
  43499. break
  43500. case 'SpotLight':
  43501. o = new Ci.SpotLight(e.color, e.intensity, e.distance, e.angle, e.penumbra, e.decay)
  43502. break
  43503. case 'HemisphereLight':
  43504. o = new Ci.HemisphereLight(e.color, e.groundColor, e.intensity)
  43505. break
  43506. case 'Mesh':
  43507. var a = n(e.geometry),
  43508. s = r(e.material)
  43509. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a, s) : new Ci.Mesh(a, s)
  43510. break
  43511. case 'LOD':
  43512. o = new Ci.LOD()
  43513. break
  43514. case 'Line':
  43515. o = new Ci.Line(n(e.geometry), r(e.material), e.mode)
  43516. break
  43517. case 'PointCloud':
  43518. case 'Points':
  43519. o = new Ci.Points(n(e.geometry), r(e.material))
  43520. break
  43521. case 'Sprite':
  43522. o = new Ci.Sprite(r(e.material))
  43523. break
  43524. case 'Group':
  43525. o = new Ci.Group()
  43526. break
  43527. default:
  43528. o = new Ci.Object3D()
  43529. }
  43530. if (
  43531. ((o.uuid = e.uuid),
  43532. void 0 !== e.name && (o.name = e.name),
  43533. void 0 !== e.matrix
  43534. ? (ke.fromArray(e.matrix), ke.decompose(o.position, o.quaternion, o.scale))
  43535. : (void 0 !== e.position && o.position.fromArray(e.position), void 0 !== e.rotation && o.rotation.fromArray(e.rotation), void 0 !== e.scale && o.scale.fromArray(e.scale)),
  43536. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  43537. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  43538. void 0 !== e.visible && (o.visible = e.visible),
  43539. void 0 !== e.userData && (o.userData = e.userData),
  43540. void 0 !== e.children)
  43541. )
  43542. for (var l in e.children) o.add(this.parseObject(e.children[l], t, i))
  43543. if ('LOD' === e.type)
  43544. for (var c = e.levels, h = 0; h < c.length; h++) {
  43545. var u = c[h]
  43546. void 0 !== (l = o.getObjectByProperty('uuid', u.object)) && o.addLevel(l, u.distance)
  43547. }
  43548. return o
  43549. })
  43550. }),
  43551. (Ci.TextureLoader = function (e) {
  43552. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  43553. }),
  43554. (Ci.TextureLoader.prototype = {
  43555. constructor: Ci.TextureLoader,
  43556. load: function (e, t, i, n) {
  43557. var r = new Ci.Texture(),
  43558. o = new Ci.ImageLoader(this.manager)
  43559. return (
  43560. o.setCrossOrigin(this.crossOrigin),
  43561. o.setPath(this.path),
  43562. o.load(
  43563. e,
  43564. function (e) {
  43565. ;(r.image = e), (r.needsUpdate = !0), void 0 !== t && t(r)
  43566. },
  43567. i,
  43568. n
  43569. ),
  43570. r
  43571. )
  43572. },
  43573. setCrossOrigin: function (e) {
  43574. this.crossOrigin = e
  43575. },
  43576. setPath: function (e) {
  43577. this.path = e
  43578. }
  43579. }),
  43580. (Ci.CubeTextureLoader = function (e) {
  43581. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  43582. }),
  43583. (Ci.CubeTextureLoader.prototype = {
  43584. constructor: Ci.CubeTextureLoader,
  43585. load: function (e, i, t, n) {
  43586. function r(t) {
  43587. a.load(
  43588. e[t],
  43589. function (e) {
  43590. ;(o.images[t] = e), 6 === ++s && ((o.needsUpdate = !0), i && i(o))
  43591. },
  43592. void 0,
  43593. n
  43594. )
  43595. }
  43596. var o = new Ci.CubeTexture(),
  43597. a = new Ci.ImageLoader(this.manager)
  43598. a.setCrossOrigin(this.crossOrigin), a.setPath(this.path)
  43599. for (var s = 0, l = 0; l < e.length; ++l) r(l)
  43600. return o
  43601. },
  43602. setCrossOrigin: function (e) {
  43603. this.crossOrigin = e
  43604. },
  43605. setPath: function (e) {
  43606. this.path = e
  43607. }
  43608. }),
  43609. (Ci.DataTextureLoader = Ci.BinaryTextureLoader =
  43610. function (e) {
  43611. ;(this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager), (this._parser = null)
  43612. }),
  43613. (Ci.BinaryTextureLoader.prototype = {
  43614. constructor: Ci.BinaryTextureLoader,
  43615. load: function (e, i, t, n) {
  43616. var r = this,
  43617. o = new Ci.DataTexture(),
  43618. a = new Ci.XHRLoader(this.manager)
  43619. return (
  43620. a.setResponseType('arraybuffer'),
  43621. a.load(
  43622. e,
  43623. function (e) {
  43624. var t = r._parser(e)
  43625. t &&
  43626. (void 0 !== t.image ? (o.image = t.image) : void 0 !== t.data && ((o.image.width = t.width), (o.image.height = t.height), (o.image.data = t.data)),
  43627. (o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping),
  43628. (o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping),
  43629. (o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter),
  43630. (o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter),
  43631. (o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1),
  43632. void 0 !== t.format && (o.format = t.format),
  43633. void 0 !== t.type && (o.type = t.type),
  43634. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  43635. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  43636. (o.needsUpdate = !0),
  43637. i && i(o, t))
  43638. },
  43639. t,
  43640. n
  43641. ),
  43642. o
  43643. )
  43644. }
  43645. }),
  43646. (Ci.CompressedTextureLoader = function (e) {
  43647. ;(this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager), (this._parser = null)
  43648. }),
  43649. (Ci.CompressedTextureLoader.prototype = {
  43650. constructor: Ci.CompressedTextureLoader,
  43651. load: function (e, o, t, n) {
  43652. function i(i) {
  43653. r.load(
  43654. e[i],
  43655. function (e) {
  43656. var t = a._parser(e, !0)
  43657. ;(s[i] = {
  43658. width: t.width,
  43659. height: t.height,
  43660. format: t.format,
  43661. mipmaps: t.mipmaps
  43662. }),
  43663. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter), (l.format = t.format), (l.needsUpdate = !0), o && o(l))
  43664. },
  43665. t,
  43666. n
  43667. )
  43668. }
  43669. var a = this,
  43670. s = [],
  43671. l = new Ci.CompressedTexture()
  43672. l.image = s
  43673. var r = new Ci.XHRLoader(this.manager)
  43674. if ((r.setPath(this.path), r.setResponseType('arraybuffer'), Array.isArray(e))) for (var c = 0, h = 0, u = e.length; h < u; ++h) i(h)
  43675. else
  43676. r.load(
  43677. e,
  43678. function (e) {
  43679. var t = a._parser(e, !0)
  43680. if (t.isCubemap)
  43681. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  43682. s[n] = {
  43683. mipmaps: []
  43684. }
  43685. for (var r = 0; r < t.mipmapCount; r++) s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]), (s[n].format = t.format), (s[n].width = t.width), (s[n].height = t.height)
  43686. }
  43687. else (l.image.width = t.width), (l.image.height = t.height), (l.mipmaps = t.mipmaps)
  43688. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter), (l.format = t.format), (l.needsUpdate = !0), o && o(l)
  43689. },
  43690. t,
  43691. n
  43692. )
  43693. return l
  43694. },
  43695. setPath: function (e) {
  43696. this.path = e
  43697. }
  43698. }),
  43699. (Ci.Material = function () {
  43700. Object.defineProperty(this, 'id', {
  43701. value: Ci.MaterialIdCount++
  43702. }),
  43703. (this.uuid = Ci.Math.generateUUID()),
  43704. (this.name = ''),
  43705. (this.type = 'Material'),
  43706. (this.side = Ci.FrontSide),
  43707. (this.opacity = 1),
  43708. (this.transparent = !1),
  43709. (this.blending = Ci.NormalBlending),
  43710. (this.blendSrc = Ci.SrcAlphaFactor),
  43711. (this.blendDst = Ci.OneMinusSrcAlphaFactor),
  43712. (this.blendEquation = Ci.AddEquation),
  43713. (this.blendSrcAlpha = null),
  43714. (this.blendDstAlpha = null),
  43715. (this.blendEquationAlpha = null),
  43716. (this.depthFunc = Ci.LessEqualDepth),
  43717. (this.depthTest = !0),
  43718. (this.depthWrite = !0),
  43719. (this.colorWrite = !0),
  43720. (this.precision = null),
  43721. (this.polygonOffset = !1),
  43722. (this.polygonOffsetFactor = 0),
  43723. (this.polygonOffsetUnits = 0),
  43724. (this.alphaTest = 0),
  43725. (this.premultipliedAlpha = !1),
  43726. (this.overdraw = 0),
  43727. (this.visible = !0),
  43728. (this._needsUpdate = !0)
  43729. }),
  43730. (Ci.Material.prototype = {
  43731. constructor: Ci.Material,
  43732. get needsUpdate() {
  43733. return this._needsUpdate
  43734. },
  43735. set needsUpdate(e) {
  43736. !0 === e && this.update(), (this._needsUpdate = e)
  43737. },
  43738. setValues: function (e) {
  43739. if (void 0 !== e)
  43740. for (var t in e) {
  43741. var i = e[t]
  43742. if (void 0 !== i) {
  43743. var n = this[t]
  43744. void 0 !== n
  43745. ? n instanceof Ci.Color
  43746. ? n.set(i)
  43747. : n instanceof Ci.Vector3 && i instanceof Ci.Vector3
  43748. ? n.copy(i)
  43749. : (this[t] = 'overdraw' === t ? Number(i) : i)
  43750. : console.warn('THREE.' + this.type + ": '" + t + "' is not a property of this material.")
  43751. } else console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  43752. }
  43753. },
  43754. toJSON: function (e) {
  43755. function t(e) {
  43756. var t = []
  43757. for (var i in e) {
  43758. var n = e[i]
  43759. delete n.metadata, t.push(n)
  43760. }
  43761. return t
  43762. }
  43763. var i = void 0 === e
  43764. i &&
  43765. (e = {
  43766. textures: {},
  43767. images: {}
  43768. })
  43769. var n = {
  43770. metadata: {
  43771. version: 4.4,
  43772. type: 'Material',
  43773. generator: 'Material.toJSON'
  43774. }
  43775. }
  43776. if (
  43777. ((n.uuid = this.uuid),
  43778. (n.type = this.type),
  43779. '' !== this.name && (n.name = this.name),
  43780. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  43781. 0.5 !== this.roughness && (n.roughness = this.roughness),
  43782. 0.5 !== this.metalness && (n.metalness = this.metalness),
  43783. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  43784. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  43785. void 0 !== this.shininess && (n.shininess = this.shininess),
  43786. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  43787. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  43788. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  43789. this.bumpMap instanceof Ci.Texture && ((n.bumpMap = this.bumpMap.toJSON(e).uuid), (n.bumpScale = this.bumpScale)),
  43790. this.normalMap instanceof Ci.Texture && ((n.normalMap = this.normalMap.toJSON(e).uuid), (n.normalScale = this.normalScale.toArray())),
  43791. this.displacementMap instanceof Ci.Texture &&
  43792. ((n.displacementMap = this.displacementMap.toJSON(e).uuid), (n.displacementScale = this.displacementScale), (n.displacementBias = this.displacementBias)),
  43793. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  43794. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  43795. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  43796. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  43797. this.envMap instanceof Ci.Texture && ((n.envMap = this.envMap.toJSON(e).uuid), (n.reflectivity = this.reflectivity)),
  43798. void 0 !== this.size && (n.size = this.size),
  43799. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  43800. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  43801. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  43802. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  43803. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  43804. this.opacity < 1 && (n.opacity = this.opacity),
  43805. !0 === this.transparent && (n.transparent = this.transparent),
  43806. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  43807. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  43808. !0 === this.wireframe && (n.wireframe = this.wireframe),
  43809. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  43810. i)
  43811. ) {
  43812. var r = t(e.textures),
  43813. o = t(e.images)
  43814. 0 < r.length && (n.textures = r), 0 < o.length && (n.images = o)
  43815. }
  43816. return n
  43817. },
  43818. clone: function () {
  43819. return new this.constructor().copy(this)
  43820. },
  43821. copy: function (e) {
  43822. return (
  43823. (this.name = e.name),
  43824. (this.side = e.side),
  43825. (this.opacity = e.opacity),
  43826. (this.transparent = e.transparent),
  43827. (this.blending = e.blending),
  43828. (this.blendSrc = e.blendSrc),
  43829. (this.blendDst = e.blendDst),
  43830. (this.blendEquation = e.blendEquation),
  43831. (this.blendSrcAlpha = e.blendSrcAlpha),
  43832. (this.blendDstAlpha = e.blendDstAlpha),
  43833. (this.blendEquationAlpha = e.blendEquationAlpha),
  43834. (this.depthFunc = e.depthFunc),
  43835. (this.depthTest = e.depthTest),
  43836. (this.depthWrite = e.depthWrite),
  43837. (this.colorWrite = e.colorWrite),
  43838. (this.precision = e.precision),
  43839. (this.polygonOffset = e.polygonOffset),
  43840. (this.polygonOffsetFactor = e.polygonOffsetFactor),
  43841. (this.polygonOffsetUnits = e.polygonOffsetUnits),
  43842. (this.alphaTest = e.alphaTest),
  43843. (this.premultipliedAlpha = e.premultipliedAlpha),
  43844. (this.overdraw = e.overdraw),
  43845. (this.visible = e.visible),
  43846. this
  43847. )
  43848. },
  43849. update: function () {
  43850. this.dispatchEvent({
  43851. type: 'update'
  43852. })
  43853. },
  43854. dispose: function () {
  43855. this.dispatchEvent({
  43856. type: 'dispose'
  43857. })
  43858. }
  43859. }),
  43860. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  43861. (Ci.MaterialIdCount = 0),
  43862. (Ci.LineBasicMaterial = function (e) {
  43863. Ci.Material.call(this),
  43864. (this.type = 'LineBasicMaterial'),
  43865. (this.color = new Ci.Color(16777215)),
  43866. (this.linewidth = 1),
  43867. (this.linecap = 'round'),
  43868. (this.linejoin = 'round'),
  43869. (this.blending = Ci.NormalBlending),
  43870. (this.vertexColors = Ci.NoColors),
  43871. (this.fog = !0),
  43872. this.setValues(e)
  43873. }),
  43874. (Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype)),
  43875. (Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial),
  43876. (Ci.LineBasicMaterial.prototype.copy = function (e) {
  43877. return (
  43878. Ci.Material.prototype.copy.call(this, e),
  43879. this.color.copy(e.color),
  43880. (this.linewidth = e.linewidth),
  43881. (this.linecap = e.linecap),
  43882. (this.linejoin = e.linejoin),
  43883. (this.vertexColors = e.vertexColors),
  43884. (this.fog = e.fog),
  43885. this
  43886. )
  43887. }),
  43888. (Ci.LineDashedMaterial = function (e) {
  43889. Ci.Material.call(this),
  43890. (this.type = 'LineDashedMaterial'),
  43891. (this.color = new Ci.Color(16777215)),
  43892. (this.linewidth = 1),
  43893. (this.scale = 1),
  43894. (this.dashSize = 3),
  43895. (this.gapSize = 1),
  43896. (this.blending = Ci.NormalBlending),
  43897. (this.vertexColors = Ci.NoColors),
  43898. (this.fog = !0),
  43899. this.setValues(e)
  43900. }),
  43901. (Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype)),
  43902. (Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial),
  43903. (Ci.LineDashedMaterial.prototype.copy = function (e) {
  43904. return (
  43905. Ci.Material.prototype.copy.call(this, e),
  43906. this.color.copy(e.color),
  43907. (this.linewidth = e.linewidth),
  43908. (this.scale = e.scale),
  43909. (this.dashSize = e.dashSize),
  43910. (this.gapSize = e.gapSize),
  43911. (this.vertexColors = e.vertexColors),
  43912. (this.fog = e.fog),
  43913. this
  43914. )
  43915. }),
  43916. (Ci.MeshBasicMaterial = function (e) {
  43917. Ci.Material.call(this),
  43918. (this.type = 'MeshBasicMaterial'),
  43919. (this.color = new Ci.Color(16777215)),
  43920. (this.map = null),
  43921. (this.aoMap = null),
  43922. (this.aoMapIntensity = 1),
  43923. (this.specularMap = null),
  43924. (this.alphaMap = null),
  43925. (this.envMap = null),
  43926. (this.combine = Ci.MultiplyOperation),
  43927. (this.reflectivity = 1),
  43928. (this.refractionRatio = 0.98),
  43929. (this.fog = !0),
  43930. (this.shading = Ci.SmoothShading),
  43931. (this.blending = Ci.NormalBlending),
  43932. (this.wireframe = !1),
  43933. (this.wireframeLinewidth = 1),
  43934. (this.wireframeLinecap = 'round'),
  43935. (this.wireframeLinejoin = 'round'),
  43936. (this.vertexColors = Ci.NoColors),
  43937. (this.skinning = !1),
  43938. (this.morphTargets = !1),
  43939. this.setValues(e)
  43940. }),
  43941. (Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype)),
  43942. (Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial),
  43943. (Ci.MeshBasicMaterial.prototype.copy = function (e) {
  43944. return (
  43945. Ci.Material.prototype.copy.call(this, e),
  43946. this.color.copy(e.color),
  43947. (this.map = e.map),
  43948. (this.aoMap = e.aoMap),
  43949. (this.aoMapIntensity = e.aoMapIntensity),
  43950. (this.specularMap = e.specularMap),
  43951. (this.alphaMap = e.alphaMap),
  43952. (this.envMap = e.envMap),
  43953. (this.combine = e.combine),
  43954. (this.reflectivity = e.reflectivity),
  43955. (this.refractionRatio = e.refractionRatio),
  43956. (this.fog = e.fog),
  43957. (this.shading = e.shading),
  43958. (this.wireframe = e.wireframe),
  43959. (this.wireframeLinewidth = e.wireframeLinewidth),
  43960. (this.wireframeLinecap = e.wireframeLinecap),
  43961. (this.wireframeLinejoin = e.wireframeLinejoin),
  43962. (this.vertexColors = e.vertexColors),
  43963. (this.skinning = e.skinning),
  43964. (this.morphTargets = e.morphTargets),
  43965. this
  43966. )
  43967. }),
  43968. (Ci.MeshLambertMaterial = function (e) {
  43969. Ci.Material.call(this),
  43970. (this.type = 'MeshLambertMaterial'),
  43971. (this.color = new Ci.Color(16777215)),
  43972. (this.map = null),
  43973. (this.lightMap = null),
  43974. (this.lightMapIntensity = 1),
  43975. (this.aoMap = null),
  43976. (this.aoMapIntensity = 1),
  43977. (this.emissive = new Ci.Color(0)),
  43978. (this.emissiveIntensity = 1),
  43979. (this.emissiveMap = null),
  43980. (this.specularMap = null),
  43981. (this.alphaMap = null),
  43982. (this.envMap = null),
  43983. (this.combine = Ci.MultiplyOperation),
  43984. (this.reflectivity = 1),
  43985. (this.refractionRatio = 0.98),
  43986. (this.fog = !0),
  43987. (this.blending = Ci.NormalBlending),
  43988. (this.wireframe = !1),
  43989. (this.wireframeLinewidth = 1),
  43990. (this.wireframeLinecap = 'round'),
  43991. (this.wireframeLinejoin = 'round'),
  43992. (this.vertexColors = Ci.NoColors),
  43993. (this.skinning = !1),
  43994. (this.morphTargets = !1),
  43995. (this.morphNormals = !1),
  43996. this.setValues(e)
  43997. }),
  43998. (Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype)),
  43999. (Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial),
  44000. (Ci.MeshLambertMaterial.prototype.copy = function (e) {
  44001. return (
  44002. Ci.Material.prototype.copy.call(this, e),
  44003. this.color.copy(e.color),
  44004. (this.map = e.map),
  44005. (this.lightMap = e.lightMap),
  44006. (this.lightMapIntensity = e.lightMapIntensity),
  44007. (this.aoMap = e.aoMap),
  44008. (this.aoMapIntensity = e.aoMapIntensity),
  44009. this.emissive.copy(e.emissive),
  44010. (this.emissiveMap = e.emissiveMap),
  44011. (this.emissiveIntensity = e.emissiveIntensity),
  44012. (this.specularMap = e.specularMap),
  44013. (this.alphaMap = e.alphaMap),
  44014. (this.envMap = e.envMap),
  44015. (this.combine = e.combine),
  44016. (this.reflectivity = e.reflectivity),
  44017. (this.refractionRatio = e.refractionRatio),
  44018. (this.fog = e.fog),
  44019. (this.wireframe = e.wireframe),
  44020. (this.wireframeLinewidth = e.wireframeLinewidth),
  44021. (this.wireframeLinecap = e.wireframeLinecap),
  44022. (this.wireframeLinejoin = e.wireframeLinejoin),
  44023. (this.vertexColors = e.vertexColors),
  44024. (this.skinning = e.skinning),
  44025. (this.morphTargets = e.morphTargets),
  44026. (this.morphNormals = e.morphNormals),
  44027. this
  44028. )
  44029. }),
  44030. (Ci.MeshPhongMaterial = function (e) {
  44031. Ci.Material.call(this),
  44032. (this.type = 'MeshPhongMaterial'),
  44033. (this.color = new Ci.Color(16777215)),
  44034. (this.specular = new Ci.Color(1118481)),
  44035. (this.shininess = 30),
  44036. (this.map = null),
  44037. (this.lightMap = null),
  44038. (this.lightMapIntensity = 1),
  44039. (this.aoMap = null),
  44040. (this.aoMapIntensity = 1),
  44041. (this.emissive = new Ci.Color(0)),
  44042. (this.emissiveIntensity = 1),
  44043. (this.emissiveMap = null),
  44044. (this.bumpMap = null),
  44045. (this.bumpScale = 1),
  44046. (this.normalMap = null),
  44047. (this.normalScale = new Ci.Vector2(1, 1)),
  44048. (this.displacementMap = null),
  44049. (this.displacementScale = 1),
  44050. (this.displacementBias = 0),
  44051. (this.specularMap = null),
  44052. (this.alphaMap = null),
  44053. (this.envMap = null),
  44054. (this.combine = Ci.MultiplyOperation),
  44055. (this.reflectivity = 1),
  44056. (this.refractionRatio = 0.98),
  44057. (this.fog = !0),
  44058. (this.shading = Ci.SmoothShading),
  44059. (this.blending = Ci.NormalBlending),
  44060. (this.wireframe = !1),
  44061. (this.wireframeLinewidth = 1),
  44062. (this.wireframeLinecap = 'round'),
  44063. (this.wireframeLinejoin = 'round'),
  44064. (this.vertexColors = Ci.NoColors),
  44065. (this.skinning = !1),
  44066. (this.morphTargets = !1),
  44067. (this.morphNormals = !1),
  44068. this.setValues(e)
  44069. }),
  44070. (Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype)),
  44071. (Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial),
  44072. (Ci.MeshPhongMaterial.prototype.copy = function (e) {
  44073. return (
  44074. Ci.Material.prototype.copy.call(this, e),
  44075. this.color.copy(e.color),
  44076. this.specular.copy(e.specular),
  44077. (this.shininess = e.shininess),
  44078. (this.map = e.map),
  44079. (this.lightMap = e.lightMap),
  44080. (this.lightMapIntensity = e.lightMapIntensity),
  44081. (this.aoMap = e.aoMap),
  44082. (this.aoMapIntensity = e.aoMapIntensity),
  44083. this.emissive.copy(e.emissive),
  44084. (this.emissiveMap = e.emissiveMap),
  44085. (this.emissiveIntensity = e.emissiveIntensity),
  44086. (this.bumpMap = e.bumpMap),
  44087. (this.bumpScale = e.bumpScale),
  44088. (this.normalMap = e.normalMap),
  44089. this.normalScale.copy(e.normalScale),
  44090. (this.displacementMap = e.displacementMap),
  44091. (this.displacementScale = e.displacementScale),
  44092. (this.displacementBias = e.displacementBias),
  44093. (this.specularMap = e.specularMap),
  44094. (this.alphaMap = e.alphaMap),
  44095. (this.envMap = e.envMap),
  44096. (this.combine = e.combine),
  44097. (this.reflectivity = e.reflectivity),
  44098. (this.refractionRatio = e.refractionRatio),
  44099. (this.fog = e.fog),
  44100. (this.shading = e.shading),
  44101. (this.wireframe = e.wireframe),
  44102. (this.wireframeLinewidth = e.wireframeLinewidth),
  44103. (this.wireframeLinecap = e.wireframeLinecap),
  44104. (this.wireframeLinejoin = e.wireframeLinejoin),
  44105. (this.vertexColors = e.vertexColors),
  44106. (this.skinning = e.skinning),
  44107. (this.morphTargets = e.morphTargets),
  44108. (this.morphNormals = e.morphNormals),
  44109. this
  44110. )
  44111. }),
  44112. (Ci.MeshStandardMaterial = function (e) {
  44113. Ci.Material.call(this),
  44114. (this.type = 'MeshStandardMaterial'),
  44115. (this.color = new Ci.Color(16777215)),
  44116. (this.roughness = 0.5),
  44117. (this.metalness = 0.5),
  44118. (this.map = null),
  44119. (this.lightMap = null),
  44120. (this.lightMapIntensity = 1),
  44121. (this.aoMap = null),
  44122. (this.aoMapIntensity = 1),
  44123. (this.emissive = new Ci.Color(0)),
  44124. (this.emissiveIntensity = 1),
  44125. (this.emissiveMap = null),
  44126. (this.bumpMap = null),
  44127. (this.bumpScale = 1),
  44128. (this.normalMap = null),
  44129. (this.normalScale = new Ci.Vector2(1, 1)),
  44130. (this.displacementMap = null),
  44131. (this.displacementScale = 1),
  44132. (this.displacementBias = 0),
  44133. (this.roughnessMap = null),
  44134. (this.metalnessMap = null),
  44135. (this.alphaMap = null),
  44136. (this.envMap = null),
  44137. (this.envMapIntensity = 1),
  44138. (this.refractionRatio = 0.98),
  44139. (this.fog = !0),
  44140. (this.shading = Ci.SmoothShading),
  44141. (this.blending = Ci.NormalBlending),
  44142. (this.wireframe = !1),
  44143. (this.wireframeLinewidth = 1),
  44144. (this.wireframeLinecap = 'round'),
  44145. (this.wireframeLinejoin = 'round'),
  44146. (this.vertexColors = Ci.NoColors),
  44147. (this.skinning = !1),
  44148. (this.morphTargets = !1),
  44149. (this.morphNormals = !1),
  44150. this.setValues(e)
  44151. }),
  44152. (Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype)),
  44153. (Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial),
  44154. (Ci.MeshStandardMaterial.prototype.copy = function (e) {
  44155. return (
  44156. Ci.Material.prototype.copy.call(this, e),
  44157. this.color.copy(e.color),
  44158. (this.roughness = e.roughness),
  44159. (this.metalness = e.metalness),
  44160. (this.map = e.map),
  44161. (this.lightMap = e.lightMap),
  44162. (this.lightMapIntensity = e.lightMapIntensity),
  44163. (this.aoMap = e.aoMap),
  44164. (this.aoMapIntensity = e.aoMapIntensity),
  44165. this.emissive.copy(e.emissive),
  44166. (this.emissiveMap = e.emissiveMap),
  44167. (this.emissiveIntensity = e.emissiveIntensity),
  44168. (this.bumpMap = e.bumpMap),
  44169. (this.bumpScale = e.bumpScale),
  44170. (this.normalMap = e.normalMap),
  44171. this.normalScale.copy(e.normalScale),
  44172. (this.displacementMap = e.displacementMap),
  44173. (this.displacementScale = e.displacementScale),
  44174. (this.displacementBias = e.displacementBias),
  44175. (this.roughnessMap = e.roughnessMap),
  44176. (this.metalnessMap = e.metalnessMap),
  44177. (this.alphaMap = e.alphaMap),
  44178. (this.envMap = e.envMap),
  44179. (this.envMapIntensity = e.envMapIntensity),
  44180. (this.refractionRatio = e.refractionRatio),
  44181. (this.fog = e.fog),
  44182. (this.shading = e.shading),
  44183. (this.wireframe = e.wireframe),
  44184. (this.wireframeLinewidth = e.wireframeLinewidth),
  44185. (this.wireframeLinecap = e.wireframeLinecap),
  44186. (this.wireframeLinejoin = e.wireframeLinejoin),
  44187. (this.vertexColors = e.vertexColors),
  44188. (this.skinning = e.skinning),
  44189. (this.morphTargets = e.morphTargets),
  44190. (this.morphNormals = e.morphNormals),
  44191. this
  44192. )
  44193. }),
  44194. (Ci.MeshDepthMaterial = function (e) {
  44195. Ci.Material.call(this), (this.type = 'MeshDepthMaterial'), (this.morphTargets = !1), (this.wireframe = !1), (this.wireframeLinewidth = 1), this.setValues(e)
  44196. }),
  44197. (Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype)),
  44198. (Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial),
  44199. (Ci.MeshDepthMaterial.prototype.copy = function (e) {
  44200. return Ci.Material.prototype.copy.call(this, e), (this.wireframe = e.wireframe), (this.wireframeLinewidth = e.wireframeLinewidth), this
  44201. }),
  44202. (Ci.MeshNormalMaterial = function (e) {
  44203. Ci.Material.call(this, e), (this.type = 'MeshNormalMaterial'), (this.wireframe = !1), (this.wireframeLinewidth = 1), (this.morphTargets = !1), this.setValues(e)
  44204. }),
  44205. (Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype)),
  44206. (Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial),
  44207. (Ci.MeshNormalMaterial.prototype.copy = function (e) {
  44208. return Ci.Material.prototype.copy.call(this, e), (this.wireframe = e.wireframe), (this.wireframeLinewidth = e.wireframeLinewidth), this
  44209. }),
  44210. (Ci.MultiMaterial = function (e) {
  44211. ;(this.uuid = Ci.Math.generateUUID()), (this.type = 'MultiMaterial'), (this.materials = e instanceof Array ? e : []), (this.visible = !0)
  44212. }),
  44213. (Ci.MultiMaterial.prototype = {
  44214. constructor: Ci.MultiMaterial,
  44215. toJSON: function (e) {
  44216. for (
  44217. var t = {
  44218. metadata: {
  44219. version: 4.2,
  44220. type: 'material',
  44221. generator: 'MaterialExporter'
  44222. },
  44223. uuid: this.uuid,
  44224. type: this.type,
  44225. materials: []
  44226. },
  44227. i = this.materials,
  44228. n = 0,
  44229. r = i.length;
  44230. n < r;
  44231. n++
  44232. ) {
  44233. var o = i[n].toJSON(e)
  44234. delete o.metadata, t.materials.push(o)
  44235. }
  44236. return (t.visible = this.visible), t
  44237. },
  44238. clone: function () {
  44239. for (var e = new this.constructor(), t = 0; t < this.materials.length; t++) e.materials.push(this.materials[t].clone())
  44240. return (e.visible = this.visible), e
  44241. }
  44242. }),
  44243. (Ci.PointsMaterial = function (e) {
  44244. Ci.Material.call(this),
  44245. (this.type = 'PointsMaterial'),
  44246. (this.color = new Ci.Color(16777215)),
  44247. (this.map = null),
  44248. (this.size = 1),
  44249. (this.sizeAttenuation = !0),
  44250. (this.blending = Ci.NormalBlending),
  44251. (this.vertexColors = Ci.NoColors),
  44252. (this.fog = !0),
  44253. this.setValues(e)
  44254. }),
  44255. (Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype)),
  44256. (Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial),
  44257. (Ci.PointsMaterial.prototype.copy = function (e) {
  44258. return (
  44259. Ci.Material.prototype.copy.call(this, e),
  44260. this.color.copy(e.color),
  44261. (this.map = e.map),
  44262. (this.size = e.size),
  44263. (this.sizeAttenuation = e.sizeAttenuation),
  44264. (this.vertexColors = e.vertexColors),
  44265. (this.fog = e.fog),
  44266. this
  44267. )
  44268. }),
  44269. (Ci.ShaderMaterial = function (e) {
  44270. Ci.Material.call(this),
  44271. (this.type = 'ShaderMaterial'),
  44272. (this.defines = {}),
  44273. (this.uniforms = {}),
  44274. (this.vertexShader = 'void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}'),
  44275. (this.fragmentShader = 'void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}'),
  44276. (this.shading = Ci.SmoothShading),
  44277. (this.linewidth = 1),
  44278. (this.wireframe = !1),
  44279. (this.wireframeLinewidth = 1),
  44280. (this.fog = !1),
  44281. (this.lights = !1),
  44282. (this.vertexColors = Ci.NoColors),
  44283. (this.skinning = !1),
  44284. (this.morphTargets = !1),
  44285. (this.morphNormals = !1),
  44286. (this.extensions = {
  44287. derivatives: !1,
  44288. fragDepth: !1,
  44289. drawBuffers: !1,
  44290. shaderTextureLOD: !1
  44291. }),
  44292. (this.defaultAttributeValues = {
  44293. color: [1, 1, 1],
  44294. uv: [0, 0],
  44295. uv2: [0, 0]
  44296. }),
  44297. (this.index0AttributeName = void 0) !== e &&
  44298. (void 0 !== e.attributes && console.error('THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.'), this.setValues(e))
  44299. }),
  44300. (Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype)),
  44301. (Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial),
  44302. (Ci.ShaderMaterial.prototype.copy = function (e) {
  44303. return (
  44304. Ci.Material.prototype.copy.call(this, e),
  44305. (this.fragmentShader = e.fragmentShader),
  44306. (this.vertexShader = e.vertexShader),
  44307. (this.uniforms = Ci.UniformsUtils.clone(e.uniforms)),
  44308. (this.defines = e.defines),
  44309. (this.shading = e.shading),
  44310. (this.wireframe = e.wireframe),
  44311. (this.wireframeLinewidth = e.wireframeLinewidth),
  44312. (this.fog = e.fog),
  44313. (this.lights = e.lights),
  44314. (this.vertexColors = e.vertexColors),
  44315. (this.skinning = e.skinning),
  44316. (this.morphTargets = e.morphTargets),
  44317. (this.morphNormals = e.morphNormals),
  44318. (this.extensions = e.extensions),
  44319. this
  44320. )
  44321. }),
  44322. (Ci.ShaderMaterial.prototype.toJSON = function (e) {
  44323. var t = Ci.Material.prototype.toJSON.call(this, e)
  44324. return (t.uniforms = this.uniforms), (t.vertexShader = this.vertexShader), (t.fragmentShader = this.fragmentShader), t
  44325. }),
  44326. (Ci.RawShaderMaterial = function (e) {
  44327. Ci.ShaderMaterial.call(this, e), (this.type = 'RawShaderMaterial')
  44328. }),
  44329. (Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype)),
  44330. (Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial),
  44331. (Ci.SpriteMaterial = function (e) {
  44332. Ci.Material.call(this), (this.type = 'SpriteMaterial'), (this.color = new Ci.Color(16777215)), (this.map = null), (this.rotation = 0), (this.fog = !1), this.setValues(e)
  44333. }),
  44334. (Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype)),
  44335. (Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial),
  44336. (Ci.SpriteMaterial.prototype.copy = function (e) {
  44337. return Ci.Material.prototype.copy.call(this, e), this.color.copy(e.color), (this.map = e.map), (this.rotation = e.rotation), (this.fog = e.fog), this
  44338. }),
  44339. (Ci.Texture = function (e, t, i, n, r, o, a, s, l) {
  44340. Object.defineProperty(this, 'id', {
  44341. value: Ci.TextureIdCount++
  44342. }),
  44343. (this.uuid = Ci.Math.generateUUID()),
  44344. (this.name = ''),
  44345. (this.sourceFile = ''),
  44346. (this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE),
  44347. (this.mipmaps = []),
  44348. (this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING),
  44349. (this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping),
  44350. (this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping),
  44351. (this.magFilter = void 0 !== r ? r : Ci.LinearFilter),
  44352. (this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter),
  44353. (this.anisotropy = void 0 !== l ? l : 1),
  44354. (this.format = void 0 !== a ? a : Ci.RGBAFormat),
  44355. (this.type = void 0 !== s ? s : Ci.UnsignedByteType),
  44356. (this.offset = new Ci.Vector2(0, 0)),
  44357. (this.repeat = new Ci.Vector2(1, 1)),
  44358. (this.generateMipmaps = !0),
  44359. (this.premultiplyAlpha = !1),
  44360. (this.flipY = !0),
  44361. (this.unpackAlignment = 4),
  44362. (this.encoding = Ci.LinearEncoding),
  44363. (this.version = 0),
  44364. (this.onUpdate = null)
  44365. }),
  44366. (Ci.Texture.DEFAULT_IMAGE = void 0),
  44367. (Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping),
  44368. (Ci.Texture.prototype = {
  44369. constructor: Ci.Texture,
  44370. set needsUpdate(e) {
  44371. !0 === e && this.version++
  44372. },
  44373. clone: function () {
  44374. return new this.constructor().copy(this)
  44375. },
  44376. copy: function (e) {
  44377. return (
  44378. (this.image = e.image),
  44379. (this.mipmaps = e.mipmaps.slice(0)),
  44380. (this.mapping = e.mapping),
  44381. (this.wrapS = e.wrapS),
  44382. (this.wrapT = e.wrapT),
  44383. (this.magFilter = e.magFilter),
  44384. (this.minFilter = e.minFilter),
  44385. (this.anisotropy = e.anisotropy),
  44386. (this.format = e.format),
  44387. (this.type = e.type),
  44388. this.offset.copy(e.offset),
  44389. this.repeat.copy(e.repeat),
  44390. (this.generateMipmaps = e.generateMipmaps),
  44391. (this.premultiplyAlpha = e.premultiplyAlpha),
  44392. (this.flipY = e.flipY),
  44393. (this.unpackAlignment = e.unpackAlignment),
  44394. (this.encoding = e.encoding),
  44395. this
  44396. )
  44397. },
  44398. toJSON: function (e) {
  44399. if (void 0 !== e.textures[this.uuid]) return e.textures[this.uuid]
  44400. var t,
  44401. i,
  44402. n = {
  44403. metadata: {
  44404. version: 4.4,
  44405. type: 'Texture',
  44406. generator: 'Texture.toJSON'
  44407. },
  44408. uuid: this.uuid,
  44409. name: this.name,
  44410. mapping: this.mapping,
  44411. repeat: [this.repeat.x, this.repeat.y],
  44412. offset: [this.offset.x, this.offset.y],
  44413. wrap: [this.wrapS, this.wrapT],
  44414. minFilter: this.minFilter,
  44415. magFilter: this.magFilter,
  44416. anisotropy: this.anisotropy
  44417. }
  44418. if (void 0 !== this.image) {
  44419. var r = this.image
  44420. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  44421. void 0 === e.images[r.uuid] &&
  44422. (e.images[r.uuid] = {
  44423. uuid: r.uuid,
  44424. url:
  44425. ((t = r),
  44426. void 0 !== t.toDataURL
  44427. ? (i = t)
  44428. : (((i = document.createElement('canvas')).width = t.width), (i.height = t.height), i.getContext('2d').drawImage(t, 0, 0, t.width, t.height)),
  44429. 2048 < i.width || 2048 < i.height ? i.toDataURL('image/jpeg', 0.6) : i.toDataURL('image/png'))
  44430. }),
  44431. (n.image = r.uuid)
  44432. }
  44433. return (e.textures[this.uuid] = n)
  44434. },
  44435. dispose: function () {
  44436. this.dispatchEvent({
  44437. type: 'dispose'
  44438. })
  44439. },
  44440. transformUv: function (e) {
  44441. if (this.mapping === Ci.UVMapping) {
  44442. if ((e.multiply(this.repeat), e.add(this.offset), e.x < 0 || 1 < e.x))
  44443. switch (this.wrapS) {
  44444. case Ci.RepeatWrapping:
  44445. e.x = e.x - Math.floor(e.x)
  44446. break
  44447. case Ci.ClampToEdgeWrapping:
  44448. e.x = e.x < 0 ? 0 : 1
  44449. break
  44450. case Ci.MirroredRepeatWrapping:
  44451. 1 === Math.abs(Math.floor(e.x) % 2) ? (e.x = Math.ceil(e.x) - e.x) : (e.x = e.x - Math.floor(e.x))
  44452. }
  44453. if (e.y < 0 || 1 < e.y)
  44454. switch (this.wrapT) {
  44455. case Ci.RepeatWrapping:
  44456. e.y = e.y - Math.floor(e.y)
  44457. break
  44458. case Ci.ClampToEdgeWrapping:
  44459. e.y = e.y < 0 ? 0 : 1
  44460. break
  44461. case Ci.MirroredRepeatWrapping:
  44462. 1 === Math.abs(Math.floor(e.y) % 2) ? (e.y = Math.ceil(e.y) - e.y) : (e.y = e.y - Math.floor(e.y))
  44463. }
  44464. this.flipY && (e.y = 1 - e.y)
  44465. }
  44466. }
  44467. }),
  44468. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  44469. (Ci.TextureIdCount = 0),
  44470. (Ci.CanvasTexture = function (e, t, i, n, r, o, a, s, l) {
  44471. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l), (this.needsUpdate = !0)
  44472. }),
  44473. (Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype)),
  44474. (Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture),
  44475. (Ci.CubeTexture = function (e, t, i, n, r, o, a, s, l) {
  44476. ;(e = void 0 !== e ? e : []), (t = void 0 !== t ? t : Ci.CubeReflectionMapping), Ci.Texture.call(this, e, t, i, n, r, o, a, s, l), (this.flipY = !1)
  44477. }),
  44478. (Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype)),
  44479. (Ci.CubeTexture.prototype.constructor = Ci.CubeTexture),
  44480. Object.defineProperty(Ci.CubeTexture.prototype, 'images', {
  44481. get: function () {
  44482. return this.image
  44483. },
  44484. set: function (e) {
  44485. this.image = e
  44486. }
  44487. }),
  44488. (Ci.CompressedTexture = function (e, t, i, n, r, o, a, s, l, c, h) {
  44489. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  44490. (this.image = {
  44491. width: t,
  44492. height: i
  44493. }),
  44494. (this.mipmaps = e),
  44495. (this.flipY = !1),
  44496. (this.generateMipmaps = !1)
  44497. }),
  44498. (Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype)),
  44499. (Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture),
  44500. (Ci.DataTexture = function (e, t, i, n, r, o, a, s, l, c, h) {
  44501. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  44502. (this.image = {
  44503. data: e,
  44504. width: t,
  44505. height: i
  44506. }),
  44507. (this.magFilter = void 0 !== l ? l : Ci.NearestFilter),
  44508. (this.minFilter = void 0 !== c ? c : Ci.NearestFilter),
  44509. (this.flipY = !1),
  44510. (this.generateMipmaps = !1)
  44511. }),
  44512. (Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype)),
  44513. (Ci.DataTexture.prototype.constructor = Ci.DataTexture),
  44514. (Ci.VideoTexture = function (t, e, i, n, r, o, a, s, l) {
  44515. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l), (this.generateMipmaps = !1)
  44516. var c = this
  44517. !(function e() {
  44518. requestAnimationFrame(e), !t.paused && t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  44519. })()
  44520. }),
  44521. (Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype)),
  44522. (Ci.VideoTexture.prototype.constructor = Ci.VideoTexture),
  44523. (Ci.Group = function () {
  44524. Ci.Object3D.call(this), (this.type = 'Group')
  44525. }),
  44526. (Ci.Group.prototype = Object.create(Ci.Object3D.prototype)),
  44527. (Ci.Group.prototype.constructor = Ci.Group),
  44528. (Ci.Points = function (e, t) {
  44529. Ci.Object3D.call(this),
  44530. (this.type = 'Points'),
  44531. (this.geometry = void 0 !== e ? e : new Ci.Geometry()),
  44532. (this.material =
  44533. void 0 !== t
  44534. ? t
  44535. : new Ci.PointsMaterial({
  44536. color: 16777215 * Math.random()
  44537. }))
  44538. }),
  44539. (Ci.Points.prototype = Object.create(Ci.Object3D.prototype)),
  44540. (Ci.Points.prototype.constructor = Ci.Points),
  44541. (Ci.Points.prototype.raycast =
  44542. ((Wt = new Ci.Matrix4()),
  44543. (jt = new Ci.Ray()),
  44544. (Yt = new Ci.Sphere()),
  44545. function (o, a) {
  44546. function e(e, t) {
  44547. var i = jt.distanceSqToPoint(e)
  44548. if (i < c) {
  44549. var n = jt.closestPointToPoint(e)
  44550. n.applyMatrix4(l)
  44551. var r = o.ray.origin.distanceTo(n)
  44552. if (r < o.near || r > o.far) return
  44553. a.push({
  44554. distance: r,
  44555. distanceToRay: Math.sqrt(i),
  44556. point: n.clone(),
  44557. index: t,
  44558. face: null,
  44559. object: s
  44560. })
  44561. }
  44562. }
  44563. var s = this,
  44564. t = this.geometry,
  44565. l = this.matrixWorld,
  44566. i = o.params.Points.threshold
  44567. if ((null === t.boundingSphere && t.computeBoundingSphere(), Yt.copy(t.boundingSphere), Yt.applyMatrix4(l), !1 !== o.ray.intersectsSphere(Yt))) {
  44568. Wt.getInverse(l), jt.copy(o.ray).applyMatrix4(Wt)
  44569. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3),
  44570. c = n * n,
  44571. r = new Ci.Vector3()
  44572. if (t instanceof Ci.BufferGeometry) {
  44573. var h = t.index,
  44574. u = t.attributes.position.array
  44575. if (null !== h)
  44576. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  44577. var g = d[p]
  44578. r.fromArray(u, 3 * g), e(r, g)
  44579. }
  44580. else {
  44581. p = 0
  44582. for (var m = u.length / 3; p < m; p++) r.fromArray(u, 3 * p), e(r, p)
  44583. }
  44584. } else {
  44585. var v = t.vertices
  44586. for (p = 0, m = v.length; p < m; p++) e(v[p], p)
  44587. }
  44588. }
  44589. })),
  44590. (Ci.Points.prototype.clone = function () {
  44591. return new this.constructor(this.geometry, this.material).copy(this)
  44592. }),
  44593. (Ci.Line = function (e, t, i) {
  44594. return 1 === i
  44595. ? (console.warn('THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead.'), new Ci.LineSegments(e, t))
  44596. : (Ci.Object3D.call(this),
  44597. (this.type = 'Line'),
  44598. (this.geometry = void 0 !== e ? e : new Ci.Geometry()),
  44599. void (this.material =
  44600. void 0 !== t
  44601. ? t
  44602. : new Ci.LineBasicMaterial({
  44603. color: 16777215 * Math.random()
  44604. })))
  44605. }),
  44606. (Ci.Line.prototype = Object.create(Ci.Object3D.prototype)),
  44607. (Ci.Line.prototype.constructor = Ci.Line),
  44608. (Ci.Line.prototype.raycast =
  44609. ((Ht = new Ci.Matrix4()),
  44610. (zt = new Ci.Ray()),
  44611. (Gt = new Ci.Sphere()),
  44612. function (e, t) {
  44613. var i = e.linePrecision,
  44614. n = i * i,
  44615. r = this.geometry,
  44616. o = this.matrixWorld
  44617. if ((null === r.boundingSphere && r.computeBoundingSphere(), Gt.copy(r.boundingSphere), Gt.applyMatrix4(o), !1 !== e.ray.intersectsSphere(Gt))) {
  44618. Ht.getInverse(o), zt.copy(e.ray).applyMatrix4(Ht)
  44619. var a = new Ci.Vector3(),
  44620. s = new Ci.Vector3(),
  44621. l = new Ci.Vector3(),
  44622. c = new Ci.Vector3(),
  44623. h = this instanceof Ci.LineSegments ? 2 : 1
  44624. if (r instanceof Ci.BufferGeometry) {
  44625. var u = r.index,
  44626. d = r.attributes.position.array
  44627. if (null !== u)
  44628. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  44629. var m = p[f],
  44630. v = p[f + 1]
  44631. a.fromArray(d, 3 * m),
  44632. s.fromArray(d, 3 * v),
  44633. n < zt.distanceSqToSegment(a, s, c, l) ||
  44634. (c.applyMatrix4(this.matrixWorld),
  44635. (C = e.ray.origin.distanceTo(c)) < e.near ||
  44636. C > e.far ||
  44637. t.push({
  44638. distance: C,
  44639. point: l.clone().applyMatrix4(this.matrixWorld),
  44640. index: f,
  44641. face: null,
  44642. faceIndex: null,
  44643. object: this
  44644. }))
  44645. }
  44646. else
  44647. for (f = 0, g = d.length / 3 - 1; f < g; f += h)
  44648. a.fromArray(d, 3 * f),
  44649. s.fromArray(d, 3 * f + 3),
  44650. n < zt.distanceSqToSegment(a, s, c, l) ||
  44651. (c.applyMatrix4(this.matrixWorld),
  44652. (C = e.ray.origin.distanceTo(c)) < e.near ||
  44653. C > e.far ||
  44654. t.push({
  44655. distance: C,
  44656. point: l.clone().applyMatrix4(this.matrixWorld),
  44657. index: f,
  44658. face: null,
  44659. faceIndex: null,
  44660. object: this
  44661. }))
  44662. } else if (r instanceof Ci.Geometry) {
  44663. var y = r.vertices,
  44664. A = y.length
  44665. for (f = 0; f < A - 1; f += h) {
  44666. var C
  44667. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) ||
  44668. (c.applyMatrix4(this.matrixWorld),
  44669. (C = e.ray.origin.distanceTo(c)) < e.near ||
  44670. C > e.far ||
  44671. t.push({
  44672. distance: C,
  44673. point: l.clone().applyMatrix4(this.matrixWorld),
  44674. index: f,
  44675. face: null,
  44676. faceIndex: null,
  44677. object: this
  44678. }))
  44679. }
  44680. }
  44681. }
  44682. })),
  44683. (Ci.Line.prototype.clone = function () {
  44684. return new this.constructor(this.geometry, this.material).copy(this)
  44685. }),
  44686. (Ci.LineStrip = 0),
  44687. (Ci.LinePieces = 1),
  44688. (Ci.LineSegments = function (e, t) {
  44689. Ci.Line.call(this, e, t), (this.type = 'LineSegments')
  44690. }),
  44691. (Ci.LineSegments.prototype = Object.create(Ci.Line.prototype)),
  44692. (Ci.LineSegments.prototype.constructor = Ci.LineSegments),
  44693. (Ci.Mesh = function (e, t) {
  44694. Ci.Object3D.call(this),
  44695. (this.type = 'Mesh'),
  44696. (this.geometry = void 0 !== e ? e : new Ci.Geometry()),
  44697. (this.material =
  44698. void 0 !== t
  44699. ? t
  44700. : new Ci.MeshBasicMaterial({
  44701. color: 16777215 * Math.random()
  44702. })),
  44703. (this.drawMode = Ci.TrianglesDrawMode),
  44704. this.updateMorphTargets()
  44705. }),
  44706. (Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype)),
  44707. (Ci.Mesh.prototype.constructor = Ci.Mesh),
  44708. (Ci.Mesh.prototype.setDrawMode = function (e) {
  44709. this.drawMode = e
  44710. }),
  44711. (Ci.Mesh.prototype.updateMorphTargets = function () {
  44712. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  44713. ;(this.morphTargetBase = -1), (this.morphTargetInfluences = []), (this.morphTargetDictionary = {})
  44714. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++) this.morphTargetInfluences.push(0), (this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e)
  44715. }
  44716. }),
  44717. (Ci.Mesh.prototype.getMorphTargetIndexByName = function (e) {
  44718. return void 0 !== this.morphTargetDictionary[e]
  44719. ? this.morphTargetDictionary[e]
  44720. : (console.warn('THREE.Mesh.getMorphTargetIndexByName: morph target ' + e + ' does not exist. Returning 0.'), 0)
  44721. }),
  44722. (Ci.Mesh.prototype.raycast =
  44723. ((Tt = new Ci.Matrix4()),
  44724. (xt = new Ci.Ray()),
  44725. (St = new Ci.Sphere()),
  44726. (Mt = new Ci.Vector3()),
  44727. (Rt = new Ci.Vector3()),
  44728. (Pt = new Ci.Vector3()),
  44729. (Ot = new Ci.Vector3()),
  44730. (Lt = new Ci.Vector3()),
  44731. (Dt = new Ci.Vector3()),
  44732. (Nt = new Ci.Vector2()),
  44733. (Ft = new Ci.Vector2()),
  44734. (Bt = new Ci.Vector2()),
  44735. (Vt = new Ci.Vector3()),
  44736. (kt = new Ci.Vector3()),
  44737. (Ut = new Ci.Vector3()),
  44738. function (e, t) {
  44739. var i,
  44740. n,
  44741. r = this.geometry,
  44742. o = this.material,
  44743. a = this.matrixWorld
  44744. if (
  44745. void 0 !== o &&
  44746. (null === r.boundingSphere && r.computeBoundingSphere(),
  44747. St.copy(r.boundingSphere),
  44748. St.applyMatrix4(a),
  44749. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a), xt.copy(e.ray).applyMatrix4(Tt), null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox)))
  44750. )
  44751. if (r instanceof Ci.BufferGeometry) {
  44752. var s,
  44753. l,
  44754. c,
  44755. h = r.index,
  44756. u = r.attributes,
  44757. d = u.position.array
  44758. if ((void 0 !== u.uv && (i = u.uv.array), null !== h))
  44759. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  44760. (s = p[f]), (l = p[f + 1]), (c = p[f + 2]), (n = Ti(this, e, xt, d, i, s, l, c)) && ((n.faceIndex = Math.floor(f / 3)), t.push(n))
  44761. else for (f = 0, g = d.length; f < g; f += 9) (n = Ti(this, e, xt, d, i, (s = f / 3), (l = s + 1), (c = s + 2))) && ((n.index = s), t.push(n))
  44762. } else if (r instanceof Ci.Geometry) {
  44763. var m,
  44764. v,
  44765. y,
  44766. A = o instanceof Ci.MultiMaterial,
  44767. C = 1 == A ? o.materials : null,
  44768. I = r.vertices,
  44769. E = r.faces,
  44770. _ = r.faceVertexUvs[0]
  44771. 0 < _.length && (i = _)
  44772. for (var b = 0, w = E.length; b < w; b++) {
  44773. var T = E[b],
  44774. x = 1 == A ? C[T.materialIndex] : o
  44775. if (void 0 !== x) {
  44776. if (((m = I[T.a]), (v = I[T.b]), (y = I[T.c]), !0 === x.morphTargets)) {
  44777. var S = r.morphTargets,
  44778. M = this.morphTargetInfluences
  44779. Mt.set(0, 0, 0), Rt.set(0, 0, 0), Pt.set(0, 0, 0)
  44780. for (var R = 0, P = S.length; R < P; R++) {
  44781. var O = M[R]
  44782. if (0 !== O) {
  44783. var L = S[R].vertices
  44784. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O), Rt.addScaledVector(Lt.subVectors(L[T.b], v), O), Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  44785. }
  44786. }
  44787. Mt.add(m), Rt.add(v), Pt.add(y), (m = Mt), (v = Rt), (y = Pt)
  44788. }
  44789. if ((n = wi(this, e, xt, m, v, y, kt))) {
  44790. if (i) {
  44791. var D = i[b]
  44792. Nt.copy(D[0]), Ft.copy(D[1]), Bt.copy(D[2]), (n.uv = bi(kt, m, v, y, Nt, Ft, Bt))
  44793. }
  44794. ;(n.face = T), (n.faceIndex = b), t.push(n)
  44795. }
  44796. }
  44797. }
  44798. }
  44799. })),
  44800. (Ci.Mesh.prototype.clone = function () {
  44801. return new this.constructor(this.geometry, this.material).copy(this)
  44802. }),
  44803. (Ci.Bone = function (e) {
  44804. Ci.Object3D.call(this), (this.type = 'Bone'), (this.skin = e)
  44805. }),
  44806. (Ci.Bone.prototype = Object.create(Ci.Object3D.prototype)),
  44807. (Ci.Bone.prototype.constructor = Ci.Bone),
  44808. (Ci.Bone.prototype.copy = function (e) {
  44809. return Ci.Object3D.prototype.copy.call(this, e), (this.skin = e.skin), this
  44810. }),
  44811. (Ci.Skeleton = function (e, t, i) {
  44812. if (((this.useVertexTexture = void 0 === i || i), (this.identityMatrix = new Ci.Matrix4()), (e = e || []), (this.bones = e.slice(0)), this.useVertexTexture)) {
  44813. var n = Math.sqrt(4 * this.bones.length)
  44814. ;(n = Ci.Math.nextPowerOfTwo(Math.ceil(n))),
  44815. (n = Math.max(n, 4)),
  44816. (this.boneTextureWidth = n),
  44817. (this.boneTextureHeight = n),
  44818. (this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4)),
  44819. (this.boneTexture = new Ci.DataTexture(this.boneMatrices, this.boneTextureWidth, this.boneTextureHeight, Ci.RGBAFormat, Ci.FloatType))
  44820. } else this.boneMatrices = new Float32Array(16 * this.bones.length)
  44821. if (void 0 === t) this.calculateInverses()
  44822. else if (this.bones.length === t.length) this.boneInverses = t.slice(0)
  44823. else {
  44824. console.warn('THREE.Skeleton bonInverses is the wrong length.'), (this.boneInverses = [])
  44825. for (var r = 0, o = this.bones.length; r < o; r++) this.boneInverses.push(new Ci.Matrix4())
  44826. }
  44827. }),
  44828. (Ci.Skeleton.prototype.calculateInverses = function () {
  44829. this.boneInverses = []
  44830. for (var e = 0, t = this.bones.length; e < t; e++) {
  44831. var i = new Ci.Matrix4()
  44832. this.bones[e] && i.getInverse(this.bones[e].matrixWorld), this.boneInverses.push(i)
  44833. }
  44834. }),
  44835. (Ci.Skeleton.prototype.pose = function () {
  44836. for (var e, t = 0, i = this.bones.length; t < i; t++) (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t])
  44837. for (t = 0, i = this.bones.length; t < i; t++)
  44838. (e = this.bones[t]) &&
  44839. (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld), e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld), e.matrix.decompose(e.position, e.quaternion, e.scale))
  44840. }),
  44841. (Ci.Skeleton.prototype.update =
  44842. ((wt = new Ci.Matrix4()),
  44843. function () {
  44844. for (var e = 0, t = this.bones.length; e < t; e++) {
  44845. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix
  44846. wt.multiplyMatrices(i, this.boneInverses[e]), wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  44847. }
  44848. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  44849. })),
  44850. (Ci.Skeleton.prototype.clone = function () {
  44851. return new Ci.Skeleton(this.bones, this.boneInverses, this.useVertexTexture)
  44852. }),
  44853. (Ci.SkinnedMesh = function (e, t, i) {
  44854. Ci.Mesh.call(this, e, t), (this.type = 'SkinnedMesh'), (this.bindMode = 'attached'), (this.bindMatrix = new Ci.Matrix4()), (this.bindMatrixInverse = new Ci.Matrix4())
  44855. var n = []
  44856. if (this.geometry && void 0 !== this.geometry.bones) {
  44857. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  44858. (o = this.geometry.bones[a]),
  44859. (r = new Ci.Bone(this)),
  44860. n.push(r),
  44861. (r.name = o.name),
  44862. r.position.fromArray(o.pos),
  44863. r.quaternion.fromArray(o.rotq),
  44864. void 0 !== o.scl && r.scale.fromArray(o.scl)
  44865. for (a = 0, s = this.geometry.bones.length; a < s; ++a) -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  44866. }
  44867. this.normalizeSkinWeights(), this.updateMatrixWorld(!0), this.bind(new Ci.Skeleton(n, void 0, i), this.matrixWorld)
  44868. }),
  44869. (Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype)),
  44870. (Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh),
  44871. (Ci.SkinnedMesh.prototype.bind = function (e, t) {
  44872. ;(this.skeleton = e),
  44873. void 0 === t && (this.updateMatrixWorld(!0), this.skeleton.calculateInverses(), (t = this.matrixWorld)),
  44874. this.bindMatrix.copy(t),
  44875. this.bindMatrixInverse.getInverse(t)
  44876. }),
  44877. (Ci.SkinnedMesh.prototype.pose = function () {
  44878. this.skeleton.pose()
  44879. }),
  44880. (Ci.SkinnedMesh.prototype.normalizeSkinWeights = function () {
  44881. if (this.geometry instanceof Ci.Geometry)
  44882. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  44883. var t = this.geometry.skinWeights[e]
  44884. ;(r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  44885. }
  44886. else if (this.geometry instanceof Ci.BufferGeometry) {
  44887. var i = new Ci.Vector4(),
  44888. n = this.geometry.attributes.skinWeight
  44889. for (e = 0; e < n.count; e++) {
  44890. var r
  44891. ;(i.x = n.getX(e)),
  44892. (i.y = n.getY(e)),
  44893. (i.z = n.getZ(e)),
  44894. (i.w = n.getW(e)),
  44895. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  44896. n.setXYZW(e, i.x, i.y, i.z, i.w)
  44897. }
  44898. }
  44899. }),
  44900. (Ci.SkinnedMesh.prototype.updateMatrixWorld = function (e) {
  44901. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  44902. 'attached' === this.bindMode
  44903. ? this.bindMatrixInverse.getInverse(this.matrixWorld)
  44904. : 'detached' === this.bindMode
  44905. ? this.bindMatrixInverse.getInverse(this.bindMatrix)
  44906. : console.warn('THREE.SkinnedMesh unrecognized bindMode: ' + this.bindMode)
  44907. }),
  44908. (Ci.SkinnedMesh.prototype.clone = function () {
  44909. return new this.constructor(this.geometry, this.material, this.useVertexTexture).copy(this)
  44910. }),
  44911. (Ci.LOD = function () {
  44912. Ci.Object3D.call(this),
  44913. (this.type = 'LOD'),
  44914. Object.defineProperties(this, {
  44915. levels: {
  44916. enumerable: !0,
  44917. value: []
  44918. },
  44919. objects: {
  44920. get: function () {
  44921. return console.warn('THREE.LOD: .objects has been renamed to .levels.'), this.levels
  44922. }
  44923. }
  44924. })
  44925. }),
  44926. (Ci.LOD.prototype = Object.create(Ci.Object3D.prototype)),
  44927. (Ci.LOD.prototype.constructor = Ci.LOD),
  44928. (Ci.LOD.prototype.addLevel = function (e, t) {
  44929. void 0 === t && (t = 0), (t = Math.abs(t))
  44930. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++);
  44931. i.splice(n, 0, {
  44932. distance: t,
  44933. object: e
  44934. }),
  44935. this.add(e)
  44936. }),
  44937. (Ci.LOD.prototype.getObjectForDistance = function (e) {
  44938. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++);
  44939. return t[i - 1].object
  44940. }),
  44941. (Ci.LOD.prototype.raycast =
  44942. ((bt = new Ci.Vector3()),
  44943. function (e, t) {
  44944. bt.setFromMatrixPosition(this.matrixWorld)
  44945. var i = e.ray.origin.distanceTo(bt)
  44946. this.getObjectForDistance(i).raycast(e, t)
  44947. })),
  44948. (Ci.LOD.prototype.update =
  44949. ((Et = new Ci.Vector3()),
  44950. (_t = new Ci.Vector3()),
  44951. function (e) {
  44952. var t = this.levels
  44953. if (1 < t.length) {
  44954. Et.setFromMatrixPosition(e.matrixWorld), _t.setFromMatrixPosition(this.matrixWorld)
  44955. var i = Et.distanceTo(_t)
  44956. t[0].object.visible = !0
  44957. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++) (t[n - 1].object.visible = !1), (t[n].object.visible = !0)
  44958. for (; n < r; n++) t[n].object.visible = !1
  44959. }
  44960. })),
  44961. (Ci.LOD.prototype.copy = function (e) {
  44962. Ci.Object3D.prototype.copy.call(this, e, !1)
  44963. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  44964. var r = t[i]
  44965. this.addLevel(r.object.clone(), r.distance)
  44966. }
  44967. return this
  44968. }),
  44969. (Ci.LOD.prototype.toJSON = function (e) {
  44970. var t = Ci.Object3D.prototype.toJSON.call(this, e)
  44971. t.object.levels = []
  44972. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  44973. var o = i[n]
  44974. t.object.levels.push({
  44975. object: o.object.uuid,
  44976. distance: o.distance
  44977. })
  44978. }
  44979. return t
  44980. }),
  44981. (Ci.Sprite =
  44982. ((yt = new Uint16Array([0, 1, 2, 0, 2, 3])),
  44983. (At = new Float32Array([-0.5, -0.5, 0, 0.5, -0.5, 0, 0.5, 0.5, 0, -0.5, 0.5, 0])),
  44984. (Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])),
  44985. (It = new Ci.BufferGeometry()).setIndex(new Ci.BufferAttribute(yt, 1)),
  44986. It.addAttribute('position', new Ci.BufferAttribute(At, 3)),
  44987. It.addAttribute('uv', new Ci.BufferAttribute(Ct, 2)),
  44988. function (e) {
  44989. Ci.Object3D.call(this), (this.type = 'Sprite'), (this.geometry = It), (this.material = void 0 !== e ? e : new Ci.SpriteMaterial())
  44990. })),
  44991. (Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype)),
  44992. (Ci.Sprite.prototype.constructor = Ci.Sprite),
  44993. (Ci.Sprite.prototype.raycast =
  44994. ((vt = new Ci.Vector3()),
  44995. function (e, t) {
  44996. vt.setFromMatrixPosition(this.matrixWorld)
  44997. var i = e.ray.distanceSqToPoint(vt)
  44998. this.scale.x * this.scale.y < i ||
  44999. t.push({
  45000. distance: Math.sqrt(i),
  45001. point: this.position,
  45002. face: null,
  45003. object: this
  45004. })
  45005. })),
  45006. (Ci.Sprite.prototype.clone = function () {
  45007. return new this.constructor(this.material).copy(this)
  45008. }),
  45009. (Ci.Particle = Ci.Sprite),
  45010. (Ci.LensFlare = function (e, t, i, n, r) {
  45011. Ci.Object3D.call(this), (this.lensFlares = []), (this.positionScreen = new Ci.Vector3()), (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  45012. }),
  45013. (Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype)),
  45014. (Ci.LensFlare.prototype.constructor = Ci.LensFlare),
  45015. (Ci.LensFlare.prototype.add = function (e, t, i, n, r, o) {
  45016. void 0 === t && (t = -1),
  45017. void 0 === i && (i = 0),
  45018. void 0 === o && (o = 1),
  45019. void 0 === r && (r = new Ci.Color(16777215)),
  45020. void 0 === n && (n = Ci.NormalBlending),
  45021. (i = Math.min(i, Math.max(0, i))),
  45022. this.lensFlares.push({
  45023. texture: e,
  45024. size: t,
  45025. distance: i,
  45026. x: 0,
  45027. y: 0,
  45028. z: 0,
  45029. scale: 1,
  45030. rotation: 0,
  45031. opacity: o,
  45032. color: r,
  45033. blending: n
  45034. })
  45035. }),
  45036. (Ci.LensFlare.prototype.updateLensFlares = function () {
  45037. var e,
  45038. t,
  45039. i = this.lensFlares.length,
  45040. n = 2 * -this.positionScreen.x,
  45041. r = 2 * -this.positionScreen.y
  45042. for (e = 0; e < i; e++)
  45043. ((t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance),
  45044. (t.y = this.positionScreen.y + r * t.distance),
  45045. (t.wantedRotation = t.x * Math.PI * 0.25),
  45046. (t.rotation += 0.25 * (t.wantedRotation - t.rotation))
  45047. }),
  45048. (Ci.LensFlare.prototype.copy = function (e) {
  45049. Ci.Object3D.prototype.copy.call(this, e), this.positionScreen.copy(e.positionScreen), (this.customUpdateCallback = e.customUpdateCallback)
  45050. for (var t = 0, i = e.lensFlares.length; t < i; t++) this.lensFlares.push(e.lensFlares[t])
  45051. return this
  45052. }),
  45053. (Ci.Scene = function () {
  45054. Ci.Object3D.call(this), (this.type = 'Scene'), (this.fog = null), (this.overrideMaterial = null), (this.autoUpdate = !0)
  45055. }),
  45056. (Ci.Scene.prototype = Object.create(Ci.Object3D.prototype)),
  45057. (Ci.Scene.prototype.constructor = Ci.Scene),
  45058. (Ci.Scene.prototype.copy = function (e, t) {
  45059. return (
  45060. Ci.Object3D.prototype.copy.call(this, e, t),
  45061. null !== e.fog && (this.fog = e.fog.clone()),
  45062. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  45063. (this.autoUpdate = e.autoUpdate),
  45064. (this.matrixAutoUpdate = e.matrixAutoUpdate),
  45065. this
  45066. )
  45067. }),
  45068. (Ci.Fog = function (e, t, i) {
  45069. ;(this.name = ''), (this.color = new Ci.Color(e)), (this.near = void 0 !== t ? t : 1), (this.far = void 0 !== i ? i : 1e3)
  45070. }),
  45071. (Ci.Fog.prototype.clone = function () {
  45072. return new Ci.Fog(this.color.getHex(), this.near, this.far)
  45073. }),
  45074. (Ci.FogExp2 = function (e, t) {
  45075. ;(this.name = ''), (this.color = new Ci.Color(e)), (this.density = void 0 !== t ? t : 25e-5)
  45076. }),
  45077. (Ci.FogExp2.prototype.clone = function () {
  45078. return new Ci.FogExp2(this.color.getHex(), this.density)
  45079. }),
  45080. (Ci.ShaderChunk = {}),
  45081. (Ci.ShaderChunk.alphamap_fragment = '#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n'),
  45082. (Ci.ShaderChunk.alphamap_pars_fragment = '#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n'),
  45083. (Ci.ShaderChunk.alphatest_fragment = '#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n'),
  45084. (Ci.ShaderChunk.aomap_fragment =
  45085. '#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'),
  45086. (Ci.ShaderChunk.aomap_pars_fragment = '#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif'),
  45087. (Ci.ShaderChunk.begin_vertex = '\nvec3 transformed = vec3( position );\n'),
  45088. (Ci.ShaderChunk.beginnormal_vertex = '\nvec3 objectNormal = vec3( normal );\n'),
  45089. (Ci.ShaderChunk.bsdfs =
  45090. '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'),
  45091. (Ci.ShaderChunk.bumpmap_pars_fragment =
  45092. '#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'),
  45093. (Ci.ShaderChunk.color_fragment = '#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif'),
  45094. (Ci.ShaderChunk.color_pars_fragment = '#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n'),
  45095. (Ci.ShaderChunk.color_pars_vertex = '#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif'),
  45096. (Ci.ShaderChunk.color_vertex = '#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif'),
  45097. (Ci.ShaderChunk.common =
  45098. '#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'),
  45099. (Ci.ShaderChunk.cube_uv_reflection_fragment =
  45100. '#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'),
  45101. (Ci.ShaderChunk.defaultnormal_vertex = '#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n'),
  45102. (Ci.ShaderChunk.displacementmap_vertex = '#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n'),
  45103. (Ci.ShaderChunk.displacementmap_pars_vertex =
  45104. '#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n'),
  45105. (Ci.ShaderChunk.emissivemap_fragment =
  45106. '#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n'),
  45107. (Ci.ShaderChunk.emissivemap_pars_fragment = '#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n'),
  45108. (Ci.ShaderChunk.encodings_pars_fragment =
  45109. '\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'),
  45110. (Ci.ShaderChunk.encodings_fragment = ' gl_FragColor = linearToOutputTexel( gl_FragColor );\n'),
  45111. (Ci.ShaderChunk.envmap_fragment =
  45112. '#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'),
  45113. (Ci.ShaderChunk.envmap_pars_fragment =
  45114. '#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'),
  45115. (Ci.ShaderChunk.envmap_pars_vertex =
  45116. '#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'),
  45117. (Ci.ShaderChunk.envmap_vertex =
  45118. '#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'),
  45119. (Ci.ShaderChunk.fog_fragment =
  45120. '#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'),
  45121. (Ci.ShaderChunk.fog_pars_fragment =
  45122. '#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'),
  45123. (Ci.ShaderChunk.lightmap_fragment = '#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n'),
  45124. (Ci.ShaderChunk.lightmap_pars_fragment = '#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif'),
  45125. (Ci.ShaderChunk.lights_lambert_vertex =
  45126. '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'),
  45127. (Ci.ShaderChunk.lights_pars =
  45128. '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'),
  45129. (Ci.ShaderChunk.lights_phong_fragment =
  45130. 'BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n'),
  45131. (Ci.ShaderChunk.lights_phong_pars_fragment =
  45132. '#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'),
  45133. (Ci.ShaderChunk.lights_phong_pars_vertex = '#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n'),
  45134. (Ci.ShaderChunk.lights_phong_vertex = '#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n'),
  45135. (Ci.ShaderChunk.lights_standard_fragment =
  45136. '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'),
  45137. (Ci.ShaderChunk.lights_standard_pars_fragment =
  45138. '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'),
  45139. (Ci.ShaderChunk.lights_template =
  45140. '\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'),
  45141. (Ci.ShaderChunk.logdepthbuf_fragment = '#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif'),
  45142. (Ci.ShaderChunk.logdepthbuf_pars_fragment = '#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n'),
  45143. (Ci.ShaderChunk.logdepthbuf_pars_vertex = '#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif'),
  45144. (Ci.ShaderChunk.logdepthbuf_vertex =
  45145. '#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'),
  45146. (Ci.ShaderChunk.map_fragment = '#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n'),
  45147. (Ci.ShaderChunk.map_pars_fragment = '#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n'),
  45148. (Ci.ShaderChunk.map_particle_fragment =
  45149. '#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'),
  45150. (Ci.ShaderChunk.map_particle_pars_fragment = '#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n'),
  45151. (Ci.ShaderChunk.metalnessmap_fragment =
  45152. 'float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n'),
  45153. (Ci.ShaderChunk.metalnessmap_pars_fragment = '#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif'),
  45154. (Ci.ShaderChunk.morphnormal_vertex =
  45155. '#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'),
  45156. (Ci.ShaderChunk.morphtarget_pars_vertex =
  45157. '#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'),
  45158. (Ci.ShaderChunk.morphtarget_vertex =
  45159. '#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'),
  45160. (Ci.ShaderChunk.normal_fragment =
  45161. '#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'),
  45162. (Ci.ShaderChunk.normalmap_pars_fragment =
  45163. '#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'),
  45164. (Ci.ShaderChunk.premultiplied_alpha_fragment = '#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n'),
  45165. (Ci.ShaderChunk.project_vertex =
  45166. '#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'),
  45167. (Ci.ShaderChunk.roughnessmap_fragment =
  45168. 'float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n'),
  45169. (Ci.ShaderChunk.roughnessmap_pars_fragment = '#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif'),
  45170. (Ci.ShaderChunk.shadowmap_pars_fragment =
  45171. '#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'),
  45172. (Ci.ShaderChunk.shadowmap_pars_vertex =
  45173. '#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'),
  45174. (Ci.ShaderChunk.shadowmap_vertex =
  45175. '#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'),
  45176. (Ci.ShaderChunk.shadowmask_pars_fragment =
  45177. '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'),
  45178. (Ci.ShaderChunk.skinbase_vertex =
  45179. '#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'),
  45180. (Ci.ShaderChunk.skinning_pars_vertex =
  45181. '#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'),
  45182. (Ci.ShaderChunk.skinning_vertex =
  45183. '#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'),
  45184. (Ci.ShaderChunk.skinnormal_vertex =
  45185. '#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'),
  45186. (Ci.ShaderChunk.specularmap_fragment =
  45187. 'float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif'),
  45188. (Ci.ShaderChunk.specularmap_pars_fragment = '#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif'),
  45189. (Ci.ShaderChunk.tonemapping_fragment = '#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n'),
  45190. (Ci.ShaderChunk.tonemapping_pars_fragment =
  45191. '#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'),
  45192. (Ci.ShaderChunk.uv2_pars_fragment = '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif'),
  45193. (Ci.ShaderChunk.uv2_pars_vertex = '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif'),
  45194. (Ci.ShaderChunk.uv2_vertex = '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif'),
  45195. (Ci.ShaderChunk.uv_pars_fragment =
  45196. '#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'),
  45197. (Ci.ShaderChunk.uv_pars_vertex =
  45198. '#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'),
  45199. (Ci.ShaderChunk.uv_vertex =
  45200. '#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'),
  45201. (Ci.ShaderChunk.worldpos_vertex =
  45202. '#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'),
  45203. (Ci.UniformsUtils = {
  45204. merge: function (e) {
  45205. for (var t = {}, i = 0; i < e.length; i++) {
  45206. var n = this.clone(e[i])
  45207. for (var r in n) t[r] = n[r]
  45208. }
  45209. return t
  45210. },
  45211. clone: function (e) {
  45212. var t = {}
  45213. for (var i in e)
  45214. for (var n in ((t[i] = {}), e[i])) {
  45215. var r = e[i][n]
  45216. r instanceof Ci.Color ||
  45217. r instanceof Ci.Vector2 ||
  45218. r instanceof Ci.Vector3 ||
  45219. r instanceof Ci.Vector4 ||
  45220. r instanceof Ci.Matrix3 ||
  45221. r instanceof Ci.Matrix4 ||
  45222. r instanceof Ci.Texture
  45223. ? (t[i][n] = r.clone())
  45224. : Array.isArray(r)
  45225. ? (t[i][n] = r.slice())
  45226. : (t[i][n] = r)
  45227. }
  45228. return t
  45229. }
  45230. }),
  45231. (Ci.UniformsLib = {
  45232. common: {
  45233. diffuse: {
  45234. type: 'c',
  45235. value: new Ci.Color(15658734)
  45236. },
  45237. opacity: {
  45238. type: 'f',
  45239. value: 1
  45240. },
  45241. map: {
  45242. type: 't',
  45243. value: null
  45244. },
  45245. offsetRepeat: {
  45246. type: 'v4',
  45247. value: new Ci.Vector4(0, 0, 1, 1)
  45248. },
  45249. specularMap: {
  45250. type: 't',
  45251. value: null
  45252. },
  45253. alphaMap: {
  45254. type: 't',
  45255. value: null
  45256. },
  45257. envMap: {
  45258. type: 't',
  45259. value: null
  45260. },
  45261. flipEnvMap: {
  45262. type: 'f',
  45263. value: -1
  45264. },
  45265. reflectivity: {
  45266. type: 'f',
  45267. value: 1
  45268. },
  45269. refractionRatio: {
  45270. type: 'f',
  45271. value: 0.98
  45272. }
  45273. },
  45274. aomap: {
  45275. aoMap: {
  45276. type: 't',
  45277. value: null
  45278. },
  45279. aoMapIntensity: {
  45280. type: 'f',
  45281. value: 1
  45282. }
  45283. },
  45284. lightmap: {
  45285. lightMap: {
  45286. type: 't',
  45287. value: null
  45288. },
  45289. lightMapIntensity: {
  45290. type: 'f',
  45291. value: 1
  45292. }
  45293. },
  45294. emissivemap: {
  45295. emissiveMap: {
  45296. type: 't',
  45297. value: null
  45298. }
  45299. },
  45300. bumpmap: {
  45301. bumpMap: {
  45302. type: 't',
  45303. value: null
  45304. },
  45305. bumpScale: {
  45306. type: 'f',
  45307. value: 1
  45308. }
  45309. },
  45310. normalmap: {
  45311. normalMap: {
  45312. type: 't',
  45313. value: null
  45314. },
  45315. normalScale: {
  45316. type: 'v2',
  45317. value: new Ci.Vector2(1, 1)
  45318. }
  45319. },
  45320. displacementmap: {
  45321. displacementMap: {
  45322. type: 't',
  45323. value: null
  45324. },
  45325. displacementScale: {
  45326. type: 'f',
  45327. value: 1
  45328. },
  45329. displacementBias: {
  45330. type: 'f',
  45331. value: 0
  45332. }
  45333. },
  45334. roughnessmap: {
  45335. roughnessMap: {
  45336. type: 't',
  45337. value: null
  45338. }
  45339. },
  45340. metalnessmap: {
  45341. metalnessMap: {
  45342. type: 't',
  45343. value: null
  45344. }
  45345. },
  45346. fog: {
  45347. fogDensity: {
  45348. type: 'f',
  45349. value: 25e-5
  45350. },
  45351. fogNear: {
  45352. type: 'f',
  45353. value: 1
  45354. },
  45355. fogFar: {
  45356. type: 'f',
  45357. value: 2e3
  45358. },
  45359. fogColor: {
  45360. type: 'c',
  45361. value: new Ci.Color(16777215)
  45362. }
  45363. },
  45364. lights: {
  45365. ambientLightColor: {
  45366. type: 'fv',
  45367. value: []
  45368. },
  45369. directionalLights: {
  45370. type: 'sa',
  45371. value: [],
  45372. properties: {
  45373. direction: {
  45374. type: 'v3'
  45375. },
  45376. color: {
  45377. type: 'c'
  45378. },
  45379. shadow: {
  45380. type: 'i'
  45381. },
  45382. shadowBias: {
  45383. type: 'f'
  45384. },
  45385. shadowRadius: {
  45386. type: 'f'
  45387. },
  45388. shadowMapSize: {
  45389. type: 'v2'
  45390. }
  45391. }
  45392. },
  45393. directionalShadowMap: {
  45394. type: 'tv',
  45395. value: []
  45396. },
  45397. directionalShadowMatrix: {
  45398. type: 'm4v',
  45399. value: []
  45400. },
  45401. spotLights: {
  45402. type: 'sa',
  45403. value: [],
  45404. properties: {
  45405. color: {
  45406. type: 'c'
  45407. },
  45408. position: {
  45409. type: 'v3'
  45410. },
  45411. direction: {
  45412. type: 'v3'
  45413. },
  45414. distance: {
  45415. type: 'f'
  45416. },
  45417. coneCos: {
  45418. type: 'f'
  45419. },
  45420. penumbraCos: {
  45421. type: 'f'
  45422. },
  45423. decay: {
  45424. type: 'f'
  45425. },
  45426. shadow: {
  45427. type: 'i'
  45428. },
  45429. shadowBias: {
  45430. type: 'f'
  45431. },
  45432. shadowRadius: {
  45433. type: 'f'
  45434. },
  45435. shadowMapSize: {
  45436. type: 'v2'
  45437. }
  45438. }
  45439. },
  45440. spotShadowMap: {
  45441. type: 'tv',
  45442. value: []
  45443. },
  45444. spotShadowMatrix: {
  45445. type: 'm4v',
  45446. value: []
  45447. },
  45448. pointLights: {
  45449. type: 'sa',
  45450. value: [],
  45451. properties: {
  45452. color: {
  45453. type: 'c'
  45454. },
  45455. position: {
  45456. type: 'v3'
  45457. },
  45458. decay: {
  45459. type: 'f'
  45460. },
  45461. distance: {
  45462. type: 'f'
  45463. },
  45464. shadow: {
  45465. type: 'i'
  45466. },
  45467. shadowBias: {
  45468. type: 'f'
  45469. },
  45470. shadowRadius: {
  45471. type: 'f'
  45472. },
  45473. shadowMapSize: {
  45474. type: 'v2'
  45475. }
  45476. }
  45477. },
  45478. pointShadowMap: {
  45479. type: 'tv',
  45480. value: []
  45481. },
  45482. pointShadowMatrix: {
  45483. type: 'm4v',
  45484. value: []
  45485. },
  45486. hemisphereLights: {
  45487. type: 'sa',
  45488. value: [],
  45489. properties: {
  45490. direction: {
  45491. type: 'v3'
  45492. },
  45493. skyColor: {
  45494. type: 'c'
  45495. },
  45496. groundColor: {
  45497. type: 'c'
  45498. }
  45499. }
  45500. }
  45501. },
  45502. points: {
  45503. diffuse: {
  45504. type: 'c',
  45505. value: new Ci.Color(15658734)
  45506. },
  45507. opacity: {
  45508. type: 'f',
  45509. value: 1
  45510. },
  45511. size: {
  45512. type: 'f',
  45513. value: 1
  45514. },
  45515. scale: {
  45516. type: 'f',
  45517. value: 1
  45518. },
  45519. map: {
  45520. type: 't',
  45521. value: null
  45522. },
  45523. offsetRepeat: {
  45524. type: 'v4',
  45525. value: new Ci.Vector4(0, 0, 1, 1)
  45526. }
  45527. }
  45528. }),
  45529. (Ci.ShaderChunk.cube_frag =
  45530. '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'),
  45531. (Ci.ShaderChunk.cube_vert =
  45532. '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'),
  45533. (Ci.ShaderChunk.depth_frag =
  45534. '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'),
  45535. (Ci.ShaderChunk.depth_vert =
  45536. '#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'),
  45537. (Ci.ShaderChunk.depthRGBA_frag =
  45538. '#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'),
  45539. (Ci.ShaderChunk.depthRGBA_vert =
  45540. '#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'),
  45541. (Ci.ShaderChunk.distanceRGBA_frag =
  45542. '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'),
  45543. (Ci.ShaderChunk.distanceRGBA_vert =
  45544. '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'),
  45545. (Ci.ShaderChunk.equirect_frag =
  45546. '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'),
  45547. (Ci.ShaderChunk.equirect_vert =
  45548. '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'),
  45549. (Ci.ShaderChunk.linedashed_frag =
  45550. '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'),
  45551. (Ci.ShaderChunk.linedashed_vert =
  45552. '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'),
  45553. (Ci.ShaderChunk.meshbasic_frag =
  45554. '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'),
  45555. (Ci.ShaderChunk.meshbasic_vert =
  45556. '#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'),
  45557. (Ci.ShaderChunk.meshlambert_frag =
  45558. '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'),
  45559. (Ci.ShaderChunk.meshlambert_vert =
  45560. '#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'),
  45561. (Ci.ShaderChunk.meshphong_frag =
  45562. '#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'),
  45563. (Ci.ShaderChunk.meshphong_vert =
  45564. '#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'),
  45565. (Ci.ShaderChunk.meshstandard_frag =
  45566. '#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'),
  45567. (Ci.ShaderChunk.meshstandard_vert =
  45568. '#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'),
  45569. (Ci.ShaderChunk.normal_frag =
  45570. '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'),
  45571. (Ci.ShaderChunk.normal_vert =
  45572. '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'),
  45573. (Ci.ShaderChunk.points_frag =
  45574. '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'),
  45575. (Ci.ShaderChunk.points_vert =
  45576. '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'),
  45577. (Ci.ShaderLib = {
  45578. basic: {
  45579. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  45580. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  45581. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  45582. },
  45583. lambert: {
  45584. uniforms: Ci.UniformsUtils.merge([
  45585. Ci.UniformsLib.common,
  45586. Ci.UniformsLib.aomap,
  45587. Ci.UniformsLib.lightmap,
  45588. Ci.UniformsLib.emissivemap,
  45589. Ci.UniformsLib.fog,
  45590. Ci.UniformsLib.lights,
  45591. {
  45592. emissive: {
  45593. type: 'c',
  45594. value: new Ci.Color(0)
  45595. }
  45596. }
  45597. ]),
  45598. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  45599. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  45600. },
  45601. phong: {
  45602. uniforms: Ci.UniformsUtils.merge([
  45603. Ci.UniformsLib.common,
  45604. Ci.UniformsLib.aomap,
  45605. Ci.UniformsLib.lightmap,
  45606. Ci.UniformsLib.emissivemap,
  45607. Ci.UniformsLib.bumpmap,
  45608. Ci.UniformsLib.normalmap,
  45609. Ci.UniformsLib.displacementmap,
  45610. Ci.UniformsLib.fog,
  45611. Ci.UniformsLib.lights,
  45612. {
  45613. emissive: {
  45614. type: 'c',
  45615. value: new Ci.Color(0)
  45616. },
  45617. specular: {
  45618. type: 'c',
  45619. value: new Ci.Color(1118481)
  45620. },
  45621. shininess: {
  45622. type: 'f',
  45623. value: 30
  45624. }
  45625. }
  45626. ]),
  45627. vertexShader: Ci.ShaderChunk.meshphong_vert,
  45628. fragmentShader: Ci.ShaderChunk.meshphong_frag
  45629. },
  45630. standard: {
  45631. uniforms: Ci.UniformsUtils.merge([
  45632. Ci.UniformsLib.common,
  45633. Ci.UniformsLib.aomap,
  45634. Ci.UniformsLib.lightmap,
  45635. Ci.UniformsLib.emissivemap,
  45636. Ci.UniformsLib.bumpmap,
  45637. Ci.UniformsLib.normalmap,
  45638. Ci.UniformsLib.displacementmap,
  45639. Ci.UniformsLib.roughnessmap,
  45640. Ci.UniformsLib.metalnessmap,
  45641. Ci.UniformsLib.fog,
  45642. Ci.UniformsLib.lights,
  45643. {
  45644. emissive: {
  45645. type: 'c',
  45646. value: new Ci.Color(0)
  45647. },
  45648. roughness: {
  45649. type: 'f',
  45650. value: 0.5
  45651. },
  45652. metalness: {
  45653. type: 'f',
  45654. value: 0
  45655. },
  45656. envMapIntensity: {
  45657. type: 'f',
  45658. value: 1
  45659. }
  45660. }
  45661. ]),
  45662. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  45663. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  45664. },
  45665. points: {
  45666. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  45667. vertexShader: Ci.ShaderChunk.points_vert,
  45668. fragmentShader: Ci.ShaderChunk.points_frag
  45669. },
  45670. dashed: {
  45671. uniforms: Ci.UniformsUtils.merge([
  45672. Ci.UniformsLib.common,
  45673. Ci.UniformsLib.fog,
  45674. {
  45675. scale: {
  45676. type: 'f',
  45677. value: 1
  45678. },
  45679. dashSize: {
  45680. type: 'f',
  45681. value: 1
  45682. },
  45683. totalSize: {
  45684. type: 'f',
  45685. value: 2
  45686. }
  45687. }
  45688. ]),
  45689. vertexShader: Ci.ShaderChunk.linedashed_vert,
  45690. fragmentShader: Ci.ShaderChunk.linedashed_frag
  45691. },
  45692. depth: {
  45693. uniforms: {
  45694. mNear: {
  45695. type: 'f',
  45696. value: 1
  45697. },
  45698. mFar: {
  45699. type: 'f',
  45700. value: 2e3
  45701. },
  45702. opacity: {
  45703. type: 'f',
  45704. value: 1
  45705. }
  45706. },
  45707. vertexShader: Ci.ShaderChunk.depth_vert,
  45708. fragmentShader: Ci.ShaderChunk.depth_frag
  45709. },
  45710. normal: {
  45711. uniforms: {
  45712. opacity: {
  45713. type: 'f',
  45714. value: 1
  45715. }
  45716. },
  45717. vertexShader: Ci.ShaderChunk.normal_vert,
  45718. fragmentShader: Ci.ShaderChunk.normal_frag
  45719. },
  45720. cube: {
  45721. uniforms: {
  45722. tCube: {
  45723. type: 't',
  45724. value: null
  45725. },
  45726. tFlip: {
  45727. type: 'f',
  45728. value: -1
  45729. }
  45730. },
  45731. vertexShader: Ci.ShaderChunk.cube_vert,
  45732. fragmentShader: Ci.ShaderChunk.cube_frag
  45733. },
  45734. equirect: {
  45735. uniforms: {
  45736. tEquirect: {
  45737. type: 't',
  45738. value: null
  45739. },
  45740. tFlip: {
  45741. type: 'f',
  45742. value: -1
  45743. }
  45744. },
  45745. vertexShader: Ci.ShaderChunk.equirect_vert,
  45746. fragmentShader: Ci.ShaderChunk.equirect_frag
  45747. },
  45748. depthRGBA: {
  45749. uniforms: {},
  45750. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  45751. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  45752. },
  45753. distanceRGBA: {
  45754. uniforms: {
  45755. lightPos: {
  45756. type: 'v3',
  45757. value: new Ci.Vector3(0, 0, 0)
  45758. }
  45759. },
  45760. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  45761. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  45762. }
  45763. }),
  45764. (Ci.WebGLRenderer = function (e) {
  45765. function S() {
  45766. return null === Q ? he : 1
  45767. }
  45768. function i(e, t, i, n) {
  45769. !0 === V && ((e *= n), (t *= n), (i *= n)), _e.clearColor(e, t, i, n)
  45770. }
  45771. function t() {
  45772. _e.init(), _e.scissor(ie.copy(ue).multiplyScalar(he)), _e.viewport(re.copy(pe).multiplyScalar(he)), i(ae.r, ae.g, ae.b, se)
  45773. }
  45774. function n() {
  45775. ;(te = K = null), (ee = ''), ($ = -1), _e.reset()
  45776. }
  45777. function r(e) {
  45778. e.preventDefault(), n(), t(), be.clear()
  45779. }
  45780. function f(e) {
  45781. var t = e.target
  45782. t.removeEventListener('dispose', f),
  45783. (function (e) {
  45784. var t = be.get(e)
  45785. if (e.image && t.__image__webglTextureCube) X.deleteTexture(t.__image__webglTextureCube)
  45786. else {
  45787. if (void 0 === t.__webglInit) return
  45788. X.deleteTexture(t.__webglTexture)
  45789. }
  45790. be.delete(e)
  45791. })(t),
  45792. ye.textures--
  45793. }
  45794. function a(e) {
  45795. var t = e.target
  45796. t.removeEventListener('dispose', a),
  45797. (function (e) {
  45798. var t = be.get(e),
  45799. i = be.get(e.texture)
  45800. if (e && void 0 !== i.__webglTexture) {
  45801. if ((X.deleteTexture(i.__webglTexture), e instanceof Ci.WebGLRenderTargetCube))
  45802. for (var n = 0; n < 6; n++) X.deleteFramebuffer(t.__webglFramebuffer[n]), X.deleteRenderbuffer(t.__webglDepthbuffer[n])
  45803. else X.deleteFramebuffer(t.__webglFramebuffer), X.deleteRenderbuffer(t.__webglDepthbuffer)
  45804. be.delete(e.texture), be.delete(e)
  45805. }
  45806. })(t),
  45807. ye.textures--
  45808. }
  45809. function v(e) {
  45810. var t = e.target
  45811. t.removeEventListener('dispose', v),
  45812. (function (e) {
  45813. y(e), be.delete(e)
  45814. })(t)
  45815. }
  45816. function y(e) {
  45817. var t = be.get(e).program
  45818. ;(e.program = void 0) !== t && Te.releaseProgram(t)
  45819. }
  45820. function M(e, t) {
  45821. return Math.abs(t[0]) - Math.abs(e[0])
  45822. }
  45823. function s(e, t) {
  45824. return e.object.renderOrder !== t.object.renderOrder
  45825. ? e.object.renderOrder - t.object.renderOrder
  45826. : e.material.id !== t.material.id
  45827. ? e.material.id - t.material.id
  45828. : e.z !== t.z
  45829. ? e.z - t.z
  45830. : e.id - t.id
  45831. }
  45832. function l(e, t) {
  45833. return e.object.renderOrder !== t.object.renderOrder ? e.object.renderOrder - t.object.renderOrder : e.z !== t.z ? t.z - e.z : e.id - t.id
  45834. }
  45835. function d(e, t, i, n, r) {
  45836. var o, a
  45837. a = i.transparent ? ((o = G), ++W) : ((o = H), ++z)
  45838. var s = o[a]
  45839. void 0 !== s
  45840. ? ((s.id = e.id), (s.object = e), (s.geometry = t), (s.material = i), (s.z = me.z), (s.group = r))
  45841. : ((s = {
  45842. id: e.id,
  45843. object: e,
  45844. geometry: t,
  45845. material: i,
  45846. z: me.z,
  45847. group: r
  45848. }),
  45849. o.push(s))
  45850. }
  45851. function c(e, t, i, n) {
  45852. for (var r = 0, o = e.length; r < o; r++) {
  45853. var a = e[r],
  45854. s = a.object,
  45855. l = a.geometry,
  45856. c = void 0 === n ? a.material : n,
  45857. h = a.group
  45858. if ((s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld), s.normalMatrix.getNormalMatrix(s.modelViewMatrix), s instanceof Ci.ImmediateRenderObject)) {
  45859. R(c)
  45860. var u = P(t, i, c, s)
  45861. ;(ee = ''),
  45862. s.render(function (e) {
  45863. Z.renderBufferImmediate(e, u, c)
  45864. })
  45865. } else Z.renderBufferDirect(t, i, l, c, s, h)
  45866. }
  45867. }
  45868. function R(e) {
  45869. ;(function (e) {
  45870. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE), _e.setFlipSided(e.side === Ci.BackSide)
  45871. })(e),
  45872. !0 === e.transparent
  45873. ? _e.setBlending(e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha, e.premultipliedAlpha)
  45874. : _e.setBlending(Ci.NoBlending),
  45875. _e.setDepthFunc(e.depthFunc),
  45876. _e.setDepthTest(e.depthTest),
  45877. _e.setDepthWrite(e.depthWrite),
  45878. _e.setColorWrite(e.colorWrite),
  45879. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  45880. }
  45881. function P(e, t, i, n) {
  45882. oe = 0
  45883. var r = be.get(i)
  45884. void 0 === r.program && (i.needsUpdate = !0),
  45885. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  45886. i.needsUpdate &&
  45887. ((function (e, t, i) {
  45888. var n = be.get(e),
  45889. r = Te.getParameters(e, ve, t, i),
  45890. o = Te.getProgramCode(e, r),
  45891. a = n.program,
  45892. s = !0
  45893. if (void 0 === a) e.addEventListener('dispose', v)
  45894. else if (a.code !== o) y(e)
  45895. else {
  45896. if (void 0 !== r.shaderID) return
  45897. s = !1
  45898. }
  45899. if (s) {
  45900. if (r.shaderID) {
  45901. var l = Ci.ShaderLib[r.shaderID]
  45902. n.__webglShader = {
  45903. name: e.type,
  45904. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  45905. vertexShader: l.vertexShader,
  45906. fragmentShader: l.fragmentShader
  45907. }
  45908. } else
  45909. n.__webglShader = {
  45910. name: e.type,
  45911. uniforms: e.uniforms,
  45912. vertexShader: e.vertexShader,
  45913. fragmentShader: e.fragmentShader
  45914. }
  45915. ;(e.__webglShader = n.__webglShader), (a = Te.acquireProgram(e, r, o)), (n.program = a), (e.program = a)
  45916. }
  45917. var c = a.getAttributes()
  45918. if (e.morphTargets) for (var h = (e.numSupportedMorphTargets = 0); h < Z.maxMorphTargets; h++) 0 <= c['morphTarget' + h] && e.numSupportedMorphTargets++
  45919. if (e.morphNormals) for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++) 0 <= c['morphNormal' + h] && e.numSupportedMorphNormals++
  45920. n.uniformsList = []
  45921. var u = n.__webglShader.uniforms,
  45922. d = n.program.getUniforms()
  45923. for (var p in u) {
  45924. var f = d[p]
  45925. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  45926. }
  45927. ;(e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) &&
  45928. ((n.lightsHash = ve.hash),
  45929. (u.ambientLightColor.value = ve.ambient),
  45930. (u.directionalLights.value = ve.directional),
  45931. (u.spotLights.value = ve.spot),
  45932. (u.pointLights.value = ve.point),
  45933. (u.hemisphereLights.value = ve.hemi),
  45934. (u.directionalShadowMap.value = ve.directionalShadowMap),
  45935. (u.directionalShadowMatrix.value = ve.directionalShadowMatrix),
  45936. (u.spotShadowMap.value = ve.spotShadowMap),
  45937. (u.spotShadowMatrix.value = ve.spotShadowMatrix),
  45938. (u.pointShadowMap.value = ve.pointShadowMap),
  45939. (u.pointShadowMatrix.value = ve.pointShadowMatrix)),
  45940. (n.hasDynamicUniforms = !1)
  45941. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  45942. if (!0 === n.uniformsList[g][0].dynamic) {
  45943. n.hasDynamicUniforms = !0
  45944. break
  45945. }
  45946. }
  45947. })(i, t, n),
  45948. (i.needsUpdate = !1))
  45949. var o = !1,
  45950. a = !1,
  45951. s = !1,
  45952. l = r.program,
  45953. c = l.getUniforms(),
  45954. h = r.__webglShader.uniforms
  45955. if (
  45956. (l.id !== K && (X.useProgram(l.program), (K = l.id), (s = a = o = !0)),
  45957. i.id !== $ && (($ = i.id), (a = !0)),
  45958. (!o && e === te) ||
  45959. (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  45960. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  45961. e !== te && ((te = e), (s = a = !0)),
  45962. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) &&
  45963. void 0 !== c.cameraPosition &&
  45964. (me.setFromMatrixPosition(e.matrixWorld), X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  45965. (i instanceof Ci.MeshPhongMaterial ||
  45966. i instanceof Ci.MeshLambertMaterial ||
  45967. i instanceof Ci.MeshBasicMaterial ||
  45968. i instanceof Ci.MeshStandardMaterial ||
  45969. i instanceof Ci.ShaderMaterial ||
  45970. i.skinning) &&
  45971. void 0 !== c.viewMatrix &&
  45972. X.uniformMatrix4fv(c.viewMatrix, !1, e.matrixWorldInverse.elements),
  45973. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  45974. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  45975. i.skinning)
  45976. )
  45977. if (
  45978. (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  45979. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  45980. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture)
  45981. ) {
  45982. if (void 0 !== c.boneTexture) {
  45983. var u = A()
  45984. X.uniform1i(c.boneTexture, u), Z.setTexture(n.skeleton.boneTexture, u)
  45985. }
  45986. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  45987. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  45988. } else n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices)
  45989. return (
  45990. a &&
  45991. ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) &&
  45992. (function (e, t) {
  45993. ;(e.ambientLightColor.needsUpdate = t),
  45994. (e.directionalLights.needsUpdate = t),
  45995. (e.pointLights.needsUpdate = t),
  45996. (e.spotLights.needsUpdate = t),
  45997. (e.hemisphereLights.needsUpdate = t)
  45998. })(h, s),
  45999. t &&
  46000. i.fog &&
  46001. (function (e, t) {
  46002. ;(e.fogColor.value = t.color), t instanceof Ci.Fog ? ((e.fogNear.value = t.near), (e.fogFar.value = t.far)) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  46003. })(h, t),
  46004. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) &&
  46005. (function (e, t) {
  46006. var i
  46007. if (
  46008. ((e.opacity.value = t.opacity),
  46009. (e.diffuse.value = t.color),
  46010. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  46011. (e.map.value = t.map),
  46012. (e.specularMap.value = t.specularMap),
  46013. (e.alphaMap.value = t.alphaMap),
  46014. t.aoMap && ((e.aoMap.value = t.aoMap), (e.aoMapIntensity.value = t.aoMapIntensity)),
  46015. t.map
  46016. ? (i = t.map)
  46017. : t.specularMap
  46018. ? (i = t.specularMap)
  46019. : t.displacementMap
  46020. ? (i = t.displacementMap)
  46021. : t.normalMap
  46022. ? (i = t.normalMap)
  46023. : t.bumpMap
  46024. ? (i = t.bumpMap)
  46025. : t.roughnessMap
  46026. ? (i = t.roughnessMap)
  46027. : t.metalnessMap
  46028. ? (i = t.metalnessMap)
  46029. : t.alphaMap
  46030. ? (i = t.alphaMap)
  46031. : t.emissiveMap && (i = t.emissiveMap),
  46032. void 0 !== i)
  46033. ) {
  46034. i instanceof Ci.WebGLRenderTarget && (i = i.texture)
  46035. var n = i.offset,
  46036. r = i.repeat
  46037. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  46038. }
  46039. ;(e.envMap.value = t.envMap),
  46040. (e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1),
  46041. (e.reflectivity.value = t.reflectivity),
  46042. (e.refractionRatio.value = t.refractionRatio)
  46043. })(h, i),
  46044. i instanceof Ci.LineBasicMaterial
  46045. ? p(h, i)
  46046. : i instanceof Ci.LineDashedMaterial
  46047. ? (p(h, i),
  46048. (function (e, t) {
  46049. ;(e.dashSize.value = t.dashSize), (e.totalSize.value = t.dashSize + t.gapSize), (e.scale.value = t.scale)
  46050. })(h, i))
  46051. : i instanceof Ci.PointsMaterial
  46052. ? (function (e, t) {
  46053. if (((e.diffuse.value = t.color), (e.opacity.value = t.opacity), (e.size.value = t.size * he), (e.scale.value = O.clientHeight / 2), (e.map.value = t.map), null !== t.map)) {
  46054. var i = t.map.offset,
  46055. n = t.map.repeat
  46056. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  46057. }
  46058. })(h, i)
  46059. : i instanceof Ci.MeshLambertMaterial
  46060. ? (function (e, t) {
  46061. t.lightMap && ((e.lightMap.value = t.lightMap), (e.lightMapIntensity.value = t.lightMapIntensity)), t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  46062. })(h, i)
  46063. : i instanceof Ci.MeshPhongMaterial
  46064. ? (function (e, t) {
  46065. ;(e.specular.value = t.specular),
  46066. (e.shininess.value = Math.max(t.shininess, 1e-4)),
  46067. t.lightMap && ((e.lightMap.value = t.lightMap), (e.lightMapIntensity.value = t.lightMapIntensity)),
  46068. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  46069. t.bumpMap && ((e.bumpMap.value = t.bumpMap), (e.bumpScale.value = t.bumpScale)),
  46070. t.normalMap && ((e.normalMap.value = t.normalMap), e.normalScale.value.copy(t.normalScale)),
  46071. t.displacementMap && ((e.displacementMap.value = t.displacementMap), (e.displacementScale.value = t.displacementScale), (e.displacementBias.value = t.displacementBias))
  46072. })(h, i)
  46073. : i instanceof Ci.MeshStandardMaterial
  46074. ? (function (e, t) {
  46075. ;(e.roughness.value = t.roughness),
  46076. (e.metalness.value = t.metalness),
  46077. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  46078. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  46079. t.lightMap && ((e.lightMap.value = t.lightMap), (e.lightMapIntensity.value = t.lightMapIntensity)),
  46080. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  46081. t.bumpMap && ((e.bumpMap.value = t.bumpMap), (e.bumpScale.value = t.bumpScale)),
  46082. t.normalMap && ((e.normalMap.value = t.normalMap), e.normalScale.value.copy(t.normalScale)),
  46083. t.displacementMap && ((e.displacementMap.value = t.displacementMap), (e.displacementScale.value = t.displacementScale), (e.displacementBias.value = t.displacementBias)),
  46084. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  46085. })(h, i)
  46086. : i instanceof Ci.MeshDepthMaterial
  46087. ? ((h.mNear.value = e.near), (h.mFar.value = e.far), (h.opacity.value = i.opacity))
  46088. : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  46089. g(r.uniformsList)),
  46090. (function (e, t) {
  46091. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements), e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  46092. })(c, n),
  46093. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  46094. !0 === r.hasDynamicUniforms &&
  46095. (function (e, t, i) {
  46096. for (var n = [], r = 0, o = e.length; r < o; r++) {
  46097. var a = e[r][0],
  46098. s = a.onUpdateCallback
  46099. void 0 !== s && (s.bind(a)(t, i), n.push(e[r]))
  46100. }
  46101. g(n)
  46102. })(r.uniformsList, n, e),
  46103. l
  46104. )
  46105. }
  46106. function p(e, t) {
  46107. ;(e.diffuse.value = t.color), (e.opacity.value = t.opacity)
  46108. }
  46109. function A() {
  46110. var e = oe
  46111. return e >= Ee.maxTextures && console.warn('WebGLRenderer: trying to use ' + e + ' texture units while this GPU supports only ' + Ee.maxTextures), (oe += 1), e
  46112. }
  46113. function C(e, t, i, n) {
  46114. var r, o
  46115. if ('1i' === t) X.uniform1i(i, n)
  46116. else if ('1f' === t) X.uniform1f(i, n)
  46117. else if ('2f' === t) X.uniform2f(i, n[0], n[1])
  46118. else if ('3f' === t) X.uniform3f(i, n[0], n[1], n[2])
  46119. else if ('4f' === t) X.uniform4f(i, n[0], n[1], n[2], n[3])
  46120. else if ('1iv' === t) X.uniform1iv(i, n)
  46121. else if ('3iv' === t) X.uniform3iv(i, n)
  46122. else if ('1fv' === t) X.uniform1fv(i, n)
  46123. else if ('2fv' === t) X.uniform2fv(i, n)
  46124. else if ('3fv' === t) X.uniform3fv(i, n)
  46125. else if ('4fv' === t) X.uniform4fv(i, n)
  46126. else if ('Matrix2fv' === t) X.uniformMatrix2fv(i, !1, n)
  46127. else if ('Matrix3fv' === t) X.uniformMatrix3fv(i, !1, n)
  46128. else if ('Matrix4fv' === t) X.uniformMatrix4fv(i, !1, n)
  46129. else if ('i' === t) X.uniform1i(i, n)
  46130. else if ('f' === t) X.uniform1f(i, n)
  46131. else if ('v2' === t) X.uniform2f(i, n.x, n.y)
  46132. else if ('v3' === t) X.uniform3f(i, n.x, n.y, n.z)
  46133. else if ('v4' === t) X.uniform4f(i, n.x, n.y, n.z, n.w)
  46134. else if ('c' === t) X.uniform3f(i, n.r, n.g, n.b)
  46135. else if ('s' === t) {
  46136. var a = e.properties
  46137. for (var s in a) {
  46138. var l = a[s],
  46139. c = i[s],
  46140. h = n[s]
  46141. C(l, l.type, c, h)
  46142. }
  46143. } else if ('sa' === t) {
  46144. a = e.properties
  46145. for (var u = 0, d = n.length; u < d; u++)
  46146. for (var s in a) {
  46147. ;(l = a[s]), (c = i[u][s]), (h = n[u][s])
  46148. C(l, l.type, c, h)
  46149. }
  46150. } else if ('iv1' === t) X.uniform1iv(i, n)
  46151. else if ('iv' === t) X.uniform3iv(i, n)
  46152. else if ('fv1' === t) X.uniform1fv(i, n)
  46153. else if ('fv' === t) X.uniform3fv(i, n)
  46154. else if ('v2v' === t) {
  46155. void 0 === e._array && (e._array = new Float32Array(2 * n.length))
  46156. u = 0
  46157. for (var p = 0, f = n.length; u < f; u++, p += 2) (e._array[p + 0] = n[u].x), (e._array[p + 1] = n[u].y)
  46158. X.uniform2fv(i, e._array)
  46159. } else if ('v3v' === t) {
  46160. void 0 === e._array && (e._array = new Float32Array(3 * n.length))
  46161. u = 0
  46162. var g = 0
  46163. for (f = n.length; u < f; u++, g += 3) (e._array[g + 0] = n[u].x), (e._array[g + 1] = n[u].y), (e._array[g + 2] = n[u].z)
  46164. X.uniform3fv(i, e._array)
  46165. } else if ('v4v' === t) {
  46166. void 0 === e._array && (e._array = new Float32Array(4 * n.length))
  46167. u = 0
  46168. var m = 0
  46169. for (f = n.length; u < f; u++, m += 4) (e._array[m + 0] = n[u].x), (e._array[m + 1] = n[u].y), (e._array[m + 2] = n[u].z), (e._array[m + 3] = n[u].w)
  46170. X.uniform4fv(i, e._array)
  46171. } else if ('m2' === t) X.uniformMatrix2fv(i, !1, n.elements)
  46172. else if ('m3' === t) X.uniformMatrix3fv(i, !1, n.elements)
  46173. else if ('m3v' === t) {
  46174. void 0 === e._array && (e._array = new Float32Array(9 * n.length))
  46175. for (u = 0, f = n.length; u < f; u++) n[u].flattenToArrayOffset(e._array, 9 * u)
  46176. X.uniformMatrix3fv(i, !1, e._array)
  46177. } else if ('m4' === t) X.uniformMatrix4fv(i, !1, n.elements)
  46178. else if ('m4v' === t) {
  46179. void 0 === e._array && (e._array = new Float32Array(16 * n.length))
  46180. for (u = 0, f = n.length; u < f; u++) n[u].flattenToArrayOffset(e._array, 16 * u)
  46181. X.uniformMatrix4fv(i, !1, e._array)
  46182. } else if ('t' === t) {
  46183. if (((r = n), (o = A()), X.uniform1i(i, o), !r)) return
  46184. r instanceof Ci.CubeTexture || (Array.isArray(r.image) && 6 === r.image.length)
  46185. ? _(r, o)
  46186. : r instanceof Ci.WebGLRenderTargetCube
  46187. ? b(r.texture, o)
  46188. : r instanceof Ci.WebGLRenderTarget
  46189. ? Z.setTexture(r.texture, o)
  46190. : Z.setTexture(r, o)
  46191. } else if ('tv' === t) {
  46192. void 0 === e._array && (e._array = [])
  46193. for (u = 0, f = e.value.length; u < f; u++) e._array[u] = A()
  46194. X.uniform1iv(i, e._array)
  46195. for (u = 0, f = e.value.length; u < f; u++)
  46196. (r = e.value[u]),
  46197. (o = e._array[u]),
  46198. r &&
  46199. (r instanceof Ci.CubeTexture || (r.image instanceof Array && 6 === r.image.length)
  46200. ? _(r, o)
  46201. : r instanceof Ci.WebGLRenderTarget
  46202. ? Z.setTexture(r.texture, o)
  46203. : r instanceof Ci.WebGLRenderTargetCube
  46204. ? b(r.texture, o)
  46205. : Z.setTexture(r, o))
  46206. } else console.warn('THREE.WebGLRenderer: Unknown uniform type: ' + t)
  46207. }
  46208. function g(e) {
  46209. for (var t = 0, i = e.length; t < i; t++) {
  46210. var n = e[t][0]
  46211. if (!1 !== n.needsUpdate) C(n, n.type, e[t][1], n.value)
  46212. }
  46213. }
  46214. function m(e, t, i) {
  46215. var n
  46216. if (
  46217. (i
  46218. ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  46219. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  46220. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  46221. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter)))
  46222. : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  46223. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  46224. (t.wrapS === Ci.ClampToEdgeWrapping && t.wrapT === Ci.ClampToEdgeWrapping) ||
  46225. console.warn('THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.', t),
  46226. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  46227. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  46228. t.minFilter !== Ci.NearestFilter &&
  46229. t.minFilter !== Ci.LinearFilter &&
  46230. console.warn('THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.', t)),
  46231. (n = Ie.get('EXT_texture_filter_anisotropic')))
  46232. ) {
  46233. if (t.type === Ci.FloatType && null === Ie.get('OES_texture_float_linear')) return
  46234. if (t.type === Ci.HalfFloatType && null === Ie.get('OES_texture_half_float_linear')) return
  46235. ;(1 < t.anisotropy || be.get(t).__currentAnisotropy) &&
  46236. (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())), (be.get(t).__currentAnisotropy = t.anisotropy))
  46237. }
  46238. }
  46239. function o(e, t, i) {
  46240. void 0 === e.__webglInit && ((e.__webglInit = !0), t.addEventListener('dispose', f), (e.__webglTexture = X.createTexture()), ye.textures++),
  46241. _e.activeTexture(X.TEXTURE0 + i),
  46242. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  46243. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  46244. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  46245. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment)
  46246. var n = I(t.image, Ee.maxTextureSize)
  46247. !(function (e) {
  46248. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || (e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter)
  46249. })(t) ||
  46250. !1 !== E(n) ||
  46251. (n = (function (e) {
  46252. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  46253. var t = document.createElement('canvas')
  46254. return (
  46255. (t.width = Ci.Math.nearestPowerOfTwo(e.width)),
  46256. (t.height = Ci.Math.nearestPowerOfTwo(e.height)),
  46257. t.getContext('2d').drawImage(e, 0, 0, t.width, t.height),
  46258. console.warn('THREE.WebGLRenderer: image is not power of two (' + e.width + 'x' + e.height + '). Resized to ' + t.width + 'x' + t.height, e),
  46259. t
  46260. )
  46261. }
  46262. return e
  46263. })(n))
  46264. var r = E(n),
  46265. o = x(t.format),
  46266. a = x(t.type)
  46267. m(X.TEXTURE_2D, t, r)
  46268. var s,
  46269. l = t.mipmaps
  46270. if (t instanceof Ci.DataTexture)
  46271. if (0 < l.length && r) {
  46272. for (var c = 0, h = l.length; c < h; c++) (s = l[c]), _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data)
  46273. t.generateMipmaps = !1
  46274. } else _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data)
  46275. else if (t instanceof Ci.CompressedTexture)
  46276. for (c = 0, h = l.length; c < h; c++)
  46277. (s = l[c]),
  46278. t.format !== Ci.RGBAFormat && t.format !== Ci.RGBFormat
  46279. ? -1 < _e.getCompressedTextureFormats().indexOf(o)
  46280. ? _e.compressedTexImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, s.data)
  46281. : console.warn('THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()')
  46282. : _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data)
  46283. else if (0 < l.length && r) {
  46284. for (c = 0, h = l.length; c < h; c++) (s = l[c]), _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s)
  46285. t.generateMipmaps = !1
  46286. } else _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n)
  46287. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D), (e.__version = t.version), t.onUpdate && t.onUpdate(t)
  46288. }
  46289. function I(e, t) {
  46290. if (e.width > t || e.height > t) {
  46291. var i = t / Math.max(e.width, e.height),
  46292. n = document.createElement('canvas')
  46293. return (
  46294. (n.width = Math.floor(e.width * i)),
  46295. (n.height = Math.floor(e.height * i)),
  46296. n.getContext('2d').drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  46297. console.warn('THREE.WebGLRenderer: image is too big (' + e.width + 'x' + e.height + '). Resized to ' + n.width + 'x' + n.height, e),
  46298. n
  46299. )
  46300. }
  46301. return e
  46302. }
  46303. function E(e) {
  46304. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  46305. }
  46306. function _(e, t) {
  46307. var i = be.get(e)
  46308. if (6 === e.image.length)
  46309. if (0 < e.version && i.__version !== e.version) {
  46310. i.__image__webglTextureCube || (e.addEventListener('dispose', f), (i.__image__webglTextureCube = X.createTexture()), ye.textures++),
  46311. _e.activeTexture(X.TEXTURE0 + t),
  46312. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  46313. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY)
  46314. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0] instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  46315. !Z.autoScaleCubemaps || n || r ? (o[a] = r ? e.image[a].image : e.image[a]) : (o[a] = I(e.image[a], Ee.maxCubemapSize))
  46316. var s = E(o[0]),
  46317. l = x(e.format),
  46318. c = x(e.type)
  46319. m(X.TEXTURE_CUBE_MAP, e, s)
  46320. for (a = 0; a < 6; a++)
  46321. if (n)
  46322. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  46323. (h = u[d]),
  46324. e.format !== Ci.RGBAFormat && e.format !== Ci.RGBFormat
  46325. ? -1 < _e.getCompressedTextureFormats().indexOf(l)
  46326. ? _e.compressedTexImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, d, l, h.width, h.height, 0, h.data)
  46327. : console.warn('THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()')
  46328. : _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, d, l, h.width, h.height, 0, l, c, h.data)
  46329. else r ? _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, 0, l, o[a].width, o[a].height, 0, l, c, o[a].data) : _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, 0, l, l, c, o[a])
  46330. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP), (i.__version = e.version), e.onUpdate && e.onUpdate(e)
  46331. } else _e.activeTexture(X.TEXTURE0 + t), _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  46332. }
  46333. function b(e, t) {
  46334. _e.activeTexture(X.TEXTURE0 + t), _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  46335. }
  46336. function h(e, t, i, n) {
  46337. var r = x(t.texture.format),
  46338. o = x(t.texture.type)
  46339. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  46340. X.bindFramebuffer(X.FRAMEBUFFER, e),
  46341. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  46342. X.bindFramebuffer(X.FRAMEBUFFER, null)
  46343. }
  46344. function u(e, t) {
  46345. X.bindRenderbuffer(X.RENDERBUFFER, e),
  46346. t.depthBuffer && !t.stencilBuffer
  46347. ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height), X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_ATTACHMENT, X.RENDERBUFFER, e))
  46348. : t.depthBuffer && t.stencilBuffer
  46349. ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_STENCIL, t.width, t.height), X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e))
  46350. : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  46351. X.bindRenderbuffer(X.RENDERBUFFER, null)
  46352. }
  46353. function w(e) {
  46354. var t = be.get(e),
  46355. i = be.get(e.texture)
  46356. e.addEventListener('dispose', a), (i.__webglTexture = X.createTexture()), ye.textures++
  46357. var n = e instanceof Ci.WebGLRenderTargetCube,
  46358. r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  46359. if (n) {
  46360. t.__webglFramebuffer = []
  46361. for (var o = 0; o < 6; o++) t.__webglFramebuffer[o] = X.createFramebuffer()
  46362. } else t.__webglFramebuffer = X.createFramebuffer()
  46363. if (n) {
  46364. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture), m(X.TEXTURE_CUBE_MAP, e.texture, r)
  46365. for (o = 0; o < 6; o++) h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o)
  46366. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP), _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  46367. } else
  46368. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  46369. m(X.TEXTURE_2D, e.texture, r),
  46370. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  46371. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  46372. _e.bindTexture(X.TEXTURE_2D, null)
  46373. e.depthBuffer &&
  46374. (function (e) {
  46375. var t = be.get(e)
  46376. if (e instanceof Ci.WebGLRenderTargetCube) {
  46377. t.__webglDepthbuffer = []
  46378. for (var i = 0; i < 6; i++) X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]), (t.__webglDepthbuffer[i] = X.createRenderbuffer()), u(t.__webglDepthbuffer[i], e)
  46379. } else X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer), (t.__webglDepthbuffer = X.createRenderbuffer()), u(t.__webglDepthbuffer, e)
  46380. X.bindFramebuffer(X.FRAMEBUFFER, null)
  46381. })(e)
  46382. }
  46383. function T(e) {
  46384. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  46385. }
  46386. function x(e) {
  46387. var t
  46388. if (e === Ci.RepeatWrapping) return X.REPEAT
  46389. if (e === Ci.ClampToEdgeWrapping) return X.CLAMP_TO_EDGE
  46390. if (e === Ci.MirroredRepeatWrapping) return X.MIRRORED_REPEAT
  46391. if (e === Ci.NearestFilter) return X.NEAREST
  46392. if (e === Ci.NearestMipMapNearestFilter) return X.NEAREST_MIPMAP_NEAREST
  46393. if (e === Ci.NearestMipMapLinearFilter) return X.NEAREST_MIPMAP_LINEAR
  46394. if (e === Ci.LinearFilter) return X.LINEAR
  46395. if (e === Ci.LinearMipMapNearestFilter) return X.LINEAR_MIPMAP_NEAREST
  46396. if (e === Ci.LinearMipMapLinearFilter) return X.LINEAR_MIPMAP_LINEAR
  46397. if (e === Ci.UnsignedByteType) return X.UNSIGNED_BYTE
  46398. if (e === Ci.UnsignedShort4444Type) return X.UNSIGNED_SHORT_4_4_4_4
  46399. if (e === Ci.UnsignedShort5551Type) return X.UNSIGNED_SHORT_5_5_5_1
  46400. if (e === Ci.UnsignedShort565Type) return X.UNSIGNED_SHORT_5_6_5
  46401. if (e === Ci.ByteType) return X.BYTE
  46402. if (e === Ci.ShortType) return X.SHORT
  46403. if (e === Ci.UnsignedShortType) return X.UNSIGNED_SHORT
  46404. if (e === Ci.IntType) return X.INT
  46405. if (e === Ci.UnsignedIntType) return X.UNSIGNED_INT
  46406. if (e === Ci.FloatType) return X.FLOAT
  46407. if (null !== (t = Ie.get('OES_texture_half_float')) && e === Ci.HalfFloatType) return t.HALF_FLOAT_OES
  46408. if (e === Ci.AlphaFormat) return X.ALPHA
  46409. if (e === Ci.RGBFormat) return X.RGB
  46410. if (e === Ci.RGBAFormat) return X.RGBA
  46411. if (e === Ci.LuminanceFormat) return X.LUMINANCE
  46412. if (e === Ci.LuminanceAlphaFormat) return X.LUMINANCE_ALPHA
  46413. if (e === Ci.AddEquation) return X.FUNC_ADD
  46414. if (e === Ci.SubtractEquation) return X.FUNC_SUBTRACT
  46415. if (e === Ci.ReverseSubtractEquation) return X.FUNC_REVERSE_SUBTRACT
  46416. if (e === Ci.ZeroFactor) return X.ZERO
  46417. if (e === Ci.OneFactor) return X.ONE
  46418. if (e === Ci.SrcColorFactor) return X.SRC_COLOR
  46419. if (e === Ci.OneMinusSrcColorFactor) return X.ONE_MINUS_SRC_COLOR
  46420. if (e === Ci.SrcAlphaFactor) return X.SRC_ALPHA
  46421. if (e === Ci.OneMinusSrcAlphaFactor) return X.ONE_MINUS_SRC_ALPHA
  46422. if (e === Ci.DstAlphaFactor) return X.DST_ALPHA
  46423. if (e === Ci.OneMinusDstAlphaFactor) return X.ONE_MINUS_DST_ALPHA
  46424. if (e === Ci.DstColorFactor) return X.DST_COLOR
  46425. if (e === Ci.OneMinusDstColorFactor) return X.ONE_MINUS_DST_COLOR
  46426. if (e === Ci.SrcAlphaSaturateFactor) return X.SRC_ALPHA_SATURATE
  46427. if (null !== (t = Ie.get('WEBGL_compressed_texture_s3tc'))) {
  46428. if (e === Ci.RGB_S3TC_DXT1_Format) return t.COMPRESSED_RGB_S3TC_DXT1_EXT
  46429. if (e === Ci.RGBA_S3TC_DXT1_Format) return t.COMPRESSED_RGBA_S3TC_DXT1_EXT
  46430. if (e === Ci.RGBA_S3TC_DXT3_Format) return t.COMPRESSED_RGBA_S3TC_DXT3_EXT
  46431. if (e === Ci.RGBA_S3TC_DXT5_Format) return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  46432. }
  46433. if (null !== (t = Ie.get('WEBGL_compressed_texture_pvrtc'))) {
  46434. if (e === Ci.RGB_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG
  46435. if (e === Ci.RGB_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG
  46436. if (e === Ci.RGBA_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
  46437. if (e === Ci.RGBA_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  46438. }
  46439. if (null !== (t = Ie.get('WEBGL_compressed_texture_etc1')) && e === Ci.RGB_ETC1_Format) return t.COMPRESSED_RGB_ETC1_WEBGL
  46440. if (null !== (t = Ie.get('EXT_blend_minmax'))) {
  46441. if (e === Ci.MinEquation) return t.MIN_EXT
  46442. if (e === Ci.MaxEquation) return t.MAX_EXT
  46443. }
  46444. return 0
  46445. }
  46446. console.log('THREE.WebGLRenderer', Ci.REVISION)
  46447. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement('canvas'),
  46448. L = void 0 !== e.context ? e.context : null,
  46449. D = void 0 !== e.alpha && e.alpha,
  46450. N = void 0 === e.depth || e.depth,
  46451. F = void 0 === e.stencil || e.stencil,
  46452. B = void 0 !== e.antialias && e.antialias,
  46453. V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha,
  46454. k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer,
  46455. U = [],
  46456. H = [],
  46457. z = -1,
  46458. G = [],
  46459. W = -1,
  46460. j = new Float32Array(8),
  46461. Y = [],
  46462. q = []
  46463. ;(this.domElement = O),
  46464. (this.context = null),
  46465. (this.autoClear = !0),
  46466. (this.autoClearColor = !0),
  46467. (this.autoClearDepth = !0),
  46468. (this.autoClearStencil = !0),
  46469. (this.sortObjects = !0),
  46470. (this.gammaFactor = 2),
  46471. (this.gammaInput = !1),
  46472. (this.gammaOutput = !1),
  46473. (this.physicallyCorrectLights = !1),
  46474. (this.toneMapping = Ci.LinearToneMapping),
  46475. (this.toneMappingExposure = 1),
  46476. (this.toneMappingWhitePoint = 1),
  46477. (this.maxMorphTargets = 8),
  46478. (this.maxMorphNormals = 4),
  46479. (this.autoScaleCubemaps = !0)
  46480. var X,
  46481. Z = this,
  46482. K = null,
  46483. Q = null,
  46484. J = null,
  46485. $ = -1,
  46486. ee = '',
  46487. te = null,
  46488. ie = new Ci.Vector4(),
  46489. ne = null,
  46490. re = new Ci.Vector4(),
  46491. oe = 0,
  46492. ae = new Ci.Color(0),
  46493. se = 0,
  46494. le = O.width,
  46495. ce = O.height,
  46496. he = 1,
  46497. ue = new Ci.Vector4(0, 0, le, ce),
  46498. de = !1,
  46499. pe = new Ci.Vector4(0, 0, le, ce),
  46500. fe = new Ci.Frustum(),
  46501. ge = new Ci.Matrix4(),
  46502. me = new Ci.Vector3(),
  46503. ve = {
  46504. hash: '',
  46505. ambient: [0, 0, 0],
  46506. directional: [],
  46507. directionalShadowMap: [],
  46508. directionalShadowMatrix: [],
  46509. spot: [],
  46510. spotShadowMap: [],
  46511. spotShadowMatrix: [],
  46512. point: [],
  46513. pointShadowMap: [],
  46514. pointShadowMatrix: [],
  46515. hemi: [],
  46516. shadows: [],
  46517. shadowsPointLight: 0
  46518. },
  46519. ye = {
  46520. geometries: 0,
  46521. textures: 0
  46522. },
  46523. Ae = {
  46524. calls: 0,
  46525. vertices: 0,
  46526. faces: 0,
  46527. points: 0
  46528. }
  46529. this.info = {
  46530. render: Ae,
  46531. memory: ye,
  46532. programs: null
  46533. }
  46534. try {
  46535. var Ce = {
  46536. alpha: D,
  46537. depth: N,
  46538. stencil: F,
  46539. antialias: B,
  46540. premultipliedAlpha: V,
  46541. preserveDrawingBuffer: k
  46542. }
  46543. if (null === (X = L || O.getContext('webgl', Ce) || O.getContext('experimental-webgl', Ce)))
  46544. throw null !== O.getContext('webgl') ? 'Error creating WebGL context with your selected attributes.' : 'Error creating WebGL context.'
  46545. void 0 === X.getShaderPrecisionFormat &&
  46546. (X.getShaderPrecisionFormat = function () {
  46547. return {
  46548. rangeMin: 1,
  46549. rangeMax: 1,
  46550. precision: 1
  46551. }
  46552. }),
  46553. O.addEventListener('webglcontextlost', r, !1)
  46554. } catch (e) {
  46555. console.error('THREE.WebGLRenderer: ' + e)
  46556. }
  46557. var Ie = new Ci.WebGLExtensions(X)
  46558. Ie.get('OES_texture_float'),
  46559. Ie.get('OES_texture_float_linear'),
  46560. Ie.get('OES_texture_half_float'),
  46561. Ie.get('OES_texture_half_float_linear'),
  46562. Ie.get('OES_standard_derivatives'),
  46563. Ie.get('ANGLE_instanced_arrays'),
  46564. Ie.get('OES_element_index_uint') && (Ci.BufferGeometry.MaxIndex = 4294967296)
  46565. var Ee = new Ci.WebGLCapabilities(X, Ie, e),
  46566. _e = new Ci.WebGLState(X, Ie, x),
  46567. be = new Ci.WebGLProperties(),
  46568. we = new Ci.WebGLObjects(X, be, this.info),
  46569. Te = new Ci.WebGLPrograms(this, Ee),
  46570. xe = new Ci.WebGLLights()
  46571. this.info.programs = Te.programs
  46572. var Se = new Ci.WebGLBufferRenderer(X, Ie, Ae),
  46573. Me = new Ci.WebGLIndexedBufferRenderer(X, Ie, Ae)
  46574. t(), (this.context = X), (this.capabilities = Ee), (this.extensions = Ie), (this.properties = be), (this.state = _e)
  46575. var Re = new Ci.WebGLShadowMap(this, ve, we)
  46576. this.shadowMap = Re
  46577. var Pe,
  46578. Oe = new Ci.SpritePlugin(this, Y),
  46579. Le = new Ci.LensFlarePlugin(this, q)
  46580. ;(this.getContext = function () {
  46581. return X
  46582. }),
  46583. (this.getContextAttributes = function () {
  46584. return X.getContextAttributes()
  46585. }),
  46586. (this.forceContextLoss = function () {
  46587. Ie.get('WEBGL_lose_context').loseContext()
  46588. }),
  46589. (this.getMaxAnisotropy = function () {
  46590. if (void 0 !== Pe) return Pe
  46591. var e = Ie.get('EXT_texture_filter_anisotropic')
  46592. return (Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0)
  46593. }),
  46594. (this.getPrecision = function () {
  46595. return Ee.precision
  46596. }),
  46597. (this.getPixelRatio = function () {
  46598. return he
  46599. }),
  46600. (this.setPixelRatio = function (e) {
  46601. void 0 !== e && ((he = e), this.setSize(pe.z, pe.w, !1))
  46602. }),
  46603. (this.getSize = function () {
  46604. return {
  46605. width: le,
  46606. height: ce
  46607. }
  46608. }),
  46609. (this.setSize = function (e, t, i, n) {
  46610. null != n && (he = n),
  46611. (le = e),
  46612. (ce = t),
  46613. (O.width = e * he),
  46614. (O.height = t * he),
  46615. !1 !== i && ((O.style.width = e + 'px'), (O.style.height = t + 'px')),
  46616. this.setViewport(0, 0, e, t)
  46617. }),
  46618. (this.setViewport = function (e, t, i, n) {
  46619. _e.viewport(pe.set(e, t, i, n))
  46620. }),
  46621. (this.setScissor = function (e, t, i, n) {
  46622. _e.scissor(ue.set(e, t, i, n))
  46623. }),
  46624. (this.setScissorTest = function (e) {
  46625. _e.setScissorTest((de = e))
  46626. }),
  46627. (this.getClearColor = function () {
  46628. return ae
  46629. }),
  46630. (this.setClearColor = function (e, t) {
  46631. ae.set(e), (se = void 0 !== t ? t : 1), i(ae.r, ae.g, ae.b, se)
  46632. }),
  46633. (this.getClearAlpha = function () {
  46634. return se
  46635. }),
  46636. (this.setClearAlpha = function (e) {
  46637. ;(se = e), i(ae.r, ae.g, ae.b, se)
  46638. }),
  46639. (this.clear = function (e, t, i) {
  46640. var n = 0
  46641. ;(void 0 !== e && !e) || (n |= X.COLOR_BUFFER_BIT), (void 0 !== t && !t) || (n |= X.DEPTH_BUFFER_BIT), (void 0 !== i && !i) || (n |= X.STENCIL_BUFFER_BIT), X.clear(n)
  46642. }),
  46643. (this.clearColor = function () {
  46644. this.clear(!0, !1, !1)
  46645. }),
  46646. (this.clearDepth = function () {
  46647. this.clear(!1, !0, !1)
  46648. }),
  46649. (this.clearStencil = function () {
  46650. this.clear(!1, !1, !0)
  46651. }),
  46652. (this.clearTarget = function (e, t, i, n) {
  46653. this.setRenderTarget(e), this.clear(t, i, n)
  46654. }),
  46655. (this.resetGLState = n),
  46656. (this.dispose = function () {
  46657. O.removeEventListener('webglcontextlost', r, !1)
  46658. }),
  46659. (this.renderBufferImmediate = function (e, t, i) {
  46660. _e.initAttributes()
  46661. var n = be.get(e)
  46662. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  46663. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  46664. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  46665. e.hasColors && !n.color && (n.color = X.createBuffer())
  46666. var r = t.getAttributes()
  46667. if (
  46668. (e.hasPositions &&
  46669. (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  46670. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  46671. _e.enableAttribute(r.position),
  46672. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  46673. e.hasNormals)
  46674. ) {
  46675. if ((X.bindBuffer(X.ARRAY_BUFFER, n.normal), 'MeshPhongMaterial' !== i.type && 'MeshStandardMaterial' !== i.type && i.shading === Ci.FlatShading))
  46676. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  46677. var s = e.normalArray,
  46678. l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3,
  46679. c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3,
  46680. h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3
  46681. ;(s[o + 0] = l), (s[o + 1] = c), (s[o + 2] = h), (s[o + 3] = l), (s[o + 4] = c), (s[o + 5] = h), (s[o + 6] = l), (s[o + 7] = c), (s[o + 8] = h)
  46682. }
  46683. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW), _e.enableAttribute(r.normal), X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  46684. }
  46685. e.hasUvs &&
  46686. i.map &&
  46687. (X.bindBuffer(X.ARRAY_BUFFER, n.uv), X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW), _e.enableAttribute(r.uv), X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  46688. e.hasColors &&
  46689. i.vertexColors !== Ci.NoColors &&
  46690. (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  46691. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  46692. _e.enableAttribute(r.color),
  46693. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  46694. _e.disableUnusedAttributes(),
  46695. X.drawArrays(X.TRIANGLES, 0, e.count),
  46696. (e.count = 0)
  46697. }),
  46698. (this.renderBufferDirect = function (e, t, i, n, r, o) {
  46699. R(n)
  46700. var a = P(e, t, n, r),
  46701. s = !1,
  46702. l = i.id + '_' + a.id + '_' + n.wireframe
  46703. l !== ee && ((ee = l), (s = !0))
  46704. var c = r.morphTargetInfluences
  46705. if (void 0 !== c) {
  46706. for (var h = [], u = 0, d = c.length; u < d; u++) {
  46707. var p = c[u]
  46708. h.push([p, u])
  46709. }
  46710. h.sort(M), 8 < h.length && (h.length = 8)
  46711. var f = i.morphAttributes
  46712. for (u = 0, d = h.length; u < d; u++) {
  46713. p = h[u]
  46714. if (((j[u] = p[0]), 0 !== p[0])) {
  46715. var g = p[1]
  46716. !0 === n.morphTargets && f.position && i.addAttribute('morphTarget' + u, f.position[g]), !0 === n.morphNormals && f.normal && i.addAttribute('morphNormal' + u, f.normal[g])
  46717. } else !0 === n.morphTargets && i.removeAttribute('morphTarget' + u), !0 === n.morphNormals && i.removeAttribute('morphNormal' + u)
  46718. }
  46719. var m = a.getUniforms()
  46720. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j), (s = !0)
  46721. }
  46722. g = i.index
  46723. var v,
  46724. y = i.attributes.position
  46725. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  46726. null !== g ? (v = Me).setIndex(g) : (v = Se),
  46727. s &&
  46728. ((function (e, t, i, n) {
  46729. var r
  46730. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get('ANGLE_instanced_arrays')))
  46731. console.error('THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.')
  46732. else {
  46733. void 0 === n && (n = 0), _e.initAttributes()
  46734. var o = i.attributes,
  46735. a = t.getAttributes(),
  46736. s = e.defaultAttributeValues
  46737. for (var l in a) {
  46738. var c = a[l]
  46739. if (0 <= c) {
  46740. var h = o[l]
  46741. if (void 0 !== h) {
  46742. var u = h.itemSize,
  46743. d = we.getAttributeBuffer(h)
  46744. if (h instanceof Ci.InterleavedBufferAttribute) {
  46745. var p = h.data,
  46746. f = p.stride,
  46747. g = h.offset
  46748. p instanceof Ci.InstancedInterleavedBuffer
  46749. ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r), void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count))
  46750. : _e.enableAttribute(c),
  46751. X.bindBuffer(X.ARRAY_BUFFER, d),
  46752. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  46753. } else
  46754. h instanceof Ci.InstancedBufferAttribute
  46755. ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r), void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count))
  46756. : _e.enableAttribute(c),
  46757. X.bindBuffer(X.ARRAY_BUFFER, d),
  46758. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  46759. } else if (void 0 !== s) {
  46760. var m = s[l]
  46761. if (void 0 !== m)
  46762. switch (m.length) {
  46763. case 2:
  46764. X.vertexAttrib2fv(c, m)
  46765. break
  46766. case 3:
  46767. X.vertexAttrib3fv(c, m)
  46768. break
  46769. case 4:
  46770. X.vertexAttrib4fv(c, m)
  46771. break
  46772. default:
  46773. X.vertexAttrib1fv(c, m)
  46774. }
  46775. }
  46776. }
  46777. }
  46778. _e.disableUnusedAttributes()
  46779. }
  46780. })(n, a, i),
  46781. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)))
  46782. var A = 1 / 0
  46783. null !== g ? (A = g.count) : void 0 !== y && (A = y.count)
  46784. var C = i.drawRange.start,
  46785. I = i.drawRange.count,
  46786. E = null !== o ? o.start : 0,
  46787. _ = null !== o ? o.count : 1 / 0,
  46788. b = Math.max(0, C, E),
  46789. w = Math.min(0 + A, C + I, E + _) - 1,
  46790. T = Math.max(0, w - b + 1)
  46791. if (r instanceof Ci.Mesh)
  46792. if (!0 === n.wireframe) _e.setLineWidth(n.wireframeLinewidth * S()), v.setMode(X.LINES)
  46793. else
  46794. switch (r.drawMode) {
  46795. case Ci.TrianglesDrawMode:
  46796. v.setMode(X.TRIANGLES)
  46797. break
  46798. case Ci.TriangleStripDrawMode:
  46799. v.setMode(X.TRIANGLE_STRIP)
  46800. break
  46801. case Ci.TriangleFanDrawMode:
  46802. v.setMode(X.TRIANGLE_FAN)
  46803. }
  46804. else if (r instanceof Ci.Line) {
  46805. var x = n.linewidth
  46806. void 0 === x && (x = 1), _e.setLineWidth(x * S()), r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  46807. } else r instanceof Ci.Points && v.setMode(X.POINTS)
  46808. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  46809. }),
  46810. (this.render = function (e, t, i, n) {
  46811. if (t instanceof Ci.Camera != 0) {
  46812. var r = e.fog
  46813. if (
  46814. ((ee = ''),
  46815. ($ = -1),
  46816. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  46817. null === t.parent && t.updateMatrixWorld(),
  46818. t.matrixWorldInverse.getInverse(t.matrixWorld),
  46819. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  46820. fe.setFromMatrix(ge),
  46821. (U.length = 0),
  46822. (W = z = -1),
  46823. (Y.length = 0),
  46824. (q.length = 0),
  46825. (function e(t, i) {
  46826. if (!1 !== t.visible) {
  46827. if (t.layers.test(i.layers))
  46828. if (t instanceof Ci.Light) U.push(t)
  46829. else if (t instanceof Ci.Sprite) (!1 !== t.frustumCulled && !0 !== fe.intersectsObject(t)) || Y.push(t)
  46830. else if (t instanceof Ci.LensFlare) q.push(t)
  46831. else if (t instanceof Ci.ImmediateRenderObject)
  46832. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld), me.applyProjection(ge)), d(t, null, t.material, me.z, null)
  46833. else if (
  46834. (t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) &&
  46835. (t instanceof Ci.SkinnedMesh && t.skeleton.update(), !1 === t.frustumCulled || !0 === fe.intersectsObject(t))
  46836. ) {
  46837. var n = t.material
  46838. if (!0 === n.visible) {
  46839. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld), me.applyProjection(ge))
  46840. var r = we.update(t)
  46841. if (n instanceof Ci.MultiMaterial)
  46842. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  46843. var c = o[s],
  46844. h = a[c.materialIndex]
  46845. !0 === h.visible && d(t, r, h, me.z, c)
  46846. }
  46847. else d(t, r, n, me.z, null)
  46848. }
  46849. }
  46850. var u = t.children
  46851. for (s = 0, l = u.length; s < l; s++) e(u[s], i)
  46852. }
  46853. })(e, t),
  46854. (H.length = z + 1),
  46855. (G.length = W + 1),
  46856. !0 === Z.sortObjects && (H.sort(s), G.sort(l)),
  46857. (function (e, t) {
  46858. var i,
  46859. n,
  46860. r,
  46861. o,
  46862. a,
  46863. s,
  46864. l = 0,
  46865. c = 0,
  46866. h = 0,
  46867. u = t.matrixWorldInverse,
  46868. d = 0,
  46869. p = 0,
  46870. f = 0,
  46871. g = 0,
  46872. m = 0
  46873. for (i = ve.shadowsPointLight = 0, n = e.length; i < n; i++)
  46874. if (((o = (r = e[i]).color), (a = r.intensity), (s = r.distance), r instanceof Ci.AmbientLight)) (l += o.r * a), (c += o.g * a), (h += o.b * a)
  46875. else if (r instanceof Ci.DirectionalLight) {
  46876. ;(v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  46877. v.direction.setFromMatrixPosition(r.matrixWorld),
  46878. me.setFromMatrixPosition(r.target.matrixWorld),
  46879. v.direction.sub(me),
  46880. v.direction.transformDirection(u),
  46881. (v.shadow = r.castShadow),
  46882. r.castShadow && ((v.shadowBias = r.shadow.bias), (v.shadowRadius = r.shadow.radius), (v.shadowMapSize = r.shadow.mapSize), (ve.shadows[m++] = r)),
  46883. (ve.directionalShadowMap[d] = r.shadow.map),
  46884. (ve.directionalShadowMatrix[d] = r.shadow.matrix),
  46885. (ve.directional[d++] = v)
  46886. } else if (r instanceof Ci.SpotLight) {
  46887. ;(v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  46888. v.position.applyMatrix4(u),
  46889. v.color.copy(o).multiplyScalar(a),
  46890. (v.distance = s),
  46891. v.direction.setFromMatrixPosition(r.matrixWorld),
  46892. me.setFromMatrixPosition(r.target.matrixWorld),
  46893. v.direction.sub(me),
  46894. v.direction.transformDirection(u),
  46895. (v.coneCos = Math.cos(r.angle)),
  46896. (v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra))),
  46897. (v.decay = 0 === r.distance ? 0 : r.decay),
  46898. (v.shadow = r.castShadow),
  46899. r.castShadow && ((v.shadowBias = r.shadow.bias), (v.shadowRadius = r.shadow.radius), (v.shadowMapSize = r.shadow.mapSize), (ve.shadows[m++] = r)),
  46900. (ve.spotShadowMap[f] = r.shadow.map),
  46901. (ve.spotShadowMatrix[f] = r.shadow.matrix),
  46902. (ve.spot[f++] = v)
  46903. } else if (r instanceof Ci.PointLight) {
  46904. ;(v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  46905. v.position.applyMatrix4(u),
  46906. v.color.copy(r.color).multiplyScalar(r.intensity),
  46907. (v.distance = r.distance),
  46908. (v.decay = 0 === r.distance ? 0 : r.decay),
  46909. (v.shadow = r.castShadow),
  46910. r.castShadow && ((v.shadowBias = r.shadow.bias), (v.shadowRadius = r.shadow.radius), (v.shadowMapSize = r.shadow.mapSize), (ve.shadows[m++] = r)),
  46911. (ve.pointShadowMap[p] = r.shadow.map),
  46912. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4()),
  46913. me.setFromMatrixPosition(r.matrixWorld).negate(),
  46914. ve.pointShadowMatrix[p].identity().setPosition(me),
  46915. (ve.point[p++] = v)
  46916. } else if (r instanceof Ci.HemisphereLight) {
  46917. var v
  46918. ;(v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  46919. v.direction.transformDirection(u),
  46920. v.direction.normalize(),
  46921. v.skyColor.copy(r.color).multiplyScalar(a),
  46922. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  46923. (ve.hemi[g++] = v)
  46924. }
  46925. ;(ve.ambient[0] = l),
  46926. (ve.ambient[1] = c),
  46927. (ve.ambient[2] = h),
  46928. (ve.directional.length = d),
  46929. (ve.spot.length = f),
  46930. (ve.point.length = p),
  46931. (ve.hemi.length = g),
  46932. (ve.shadows.length = m),
  46933. (ve.hash = d + ',' + p + ',' + f + ',' + g + ',' + m)
  46934. })(U, t),
  46935. Re.render(e, t),
  46936. (Ae.calls = 0),
  46937. (Ae.vertices = 0),
  46938. (Ae.faces = 0),
  46939. void (Ae.points = 0) === i && (i = null),
  46940. this.setRenderTarget(i),
  46941. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  46942. e.overrideMaterial)
  46943. ) {
  46944. var o = e.overrideMaterial
  46945. c(H, t, r, o), c(G, t, r, o)
  46946. } else _e.setBlending(Ci.NoBlending), c(H, t, r), c(G, t, r)
  46947. if ((Oe.render(e, t), Le.render(e, t, re), i)) {
  46948. var a = i.texture
  46949. a.generateMipmaps &&
  46950. E(i) &&
  46951. a.minFilter !== Ci.NearestFilter &&
  46952. a.minFilter !== Ci.LinearFilter &&
  46953. (function (e) {
  46954. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D,
  46955. i = be.get(e.texture).__webglTexture
  46956. _e.bindTexture(t, i), X.generateMipmap(t), _e.bindTexture(t, null)
  46957. })(i)
  46958. }
  46959. _e.setDepthTest(!0), _e.setDepthWrite(!0), _e.setColorWrite(!0)
  46960. } else console.error('THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.')
  46961. }),
  46962. (this.setFaceCulling = function (e, t) {
  46963. e === Ci.CullFaceNone
  46964. ? _e.disable(X.CULL_FACE)
  46965. : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  46966. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  46967. _e.enable(X.CULL_FACE))
  46968. }),
  46969. (this.setTexture = function (e, t) {
  46970. var i = be.get(e)
  46971. if (0 < e.version && i.__version !== e.version) {
  46972. var n = e.image
  46973. return void 0 === n
  46974. ? void console.warn('THREE.WebGLRenderer: Texture marked for update but image is undefined', e)
  46975. : !1 === n.complete
  46976. ? void console.warn('THREE.WebGLRenderer: Texture marked for update but image is incomplete', e)
  46977. : void o(i, e, t)
  46978. }
  46979. _e.activeTexture(X.TEXTURE0 + t), _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  46980. }),
  46981. (this.getCurrentRenderTarget = function () {
  46982. return Q
  46983. }),
  46984. (this.setRenderTarget = function (e) {
  46985. ;(Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e)
  46986. var t,
  46987. i = e instanceof Ci.WebGLRenderTargetCube
  46988. if (e) {
  46989. var n = be.get(e)
  46990. ;(t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer), ie.copy(e.scissor), (ne = e.scissorTest), re.copy(e.viewport)
  46991. } else (t = null), ie.copy(ue).multiplyScalar(he), (ne = de), re.copy(pe).multiplyScalar(he)
  46992. if ((J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t), (J = t)), _e.scissor(ie), _e.setScissorTest(ne), _e.viewport(re), i)) {
  46993. var r = be.get(e.texture)
  46994. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  46995. }
  46996. }),
  46997. (this.readRenderTargetPixels = function (e, t, i, n, r, o) {
  46998. if (e instanceof Ci.WebGLRenderTarget != 0) {
  46999. var a = be.get(e).__webglFramebuffer
  47000. if (a) {
  47001. var s = !1
  47002. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a), (s = !0))
  47003. try {
  47004. var l = e.texture
  47005. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  47006. return void console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.')
  47007. if (
  47008. !(
  47009. l.type === Ci.UnsignedByteType ||
  47010. x(l.type) === X.getParameter(X.IMPLEMENTATION_COLOR_READ_TYPE) ||
  47011. (l.type === Ci.FloatType && Ie.get('WEBGL_color_buffer_float')) ||
  47012. (l.type === Ci.HalfFloatType && Ie.get('EXT_color_buffer_half_float'))
  47013. )
  47014. )
  47015. return void console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.')
  47016. X.checkFramebufferStatus(X.FRAMEBUFFER) === X.FRAMEBUFFER_COMPLETE
  47017. ? X.readPixels(t, i, n, r, x(l.format), x(l.type), o)
  47018. : console.error('THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.')
  47019. } finally {
  47020. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  47021. }
  47022. }
  47023. } else console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.')
  47024. })
  47025. }),
  47026. (Ci.WebGLRenderTarget = function (e, t, i) {
  47027. ;(this.uuid = Ci.Math.generateUUID()),
  47028. (this.width = e),
  47029. (this.height = t),
  47030. (this.scissor = new Ci.Vector4(0, 0, e, t)),
  47031. (this.scissorTest = !1),
  47032. (this.viewport = new Ci.Vector4(0, 0, e, t)),
  47033. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  47034. (this.texture = new Ci.Texture(void 0, void 0, i.wrapS, i.wrapT, i.magFilter, i.minFilter, i.format, i.type, i.anisotropy)),
  47035. (this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer),
  47036. (this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer)
  47037. }),
  47038. (Ci.WebGLRenderTarget.prototype = {
  47039. constructor: Ci.WebGLRenderTarget,
  47040. setSize: function (e, t) {
  47041. ;(this.width === e && this.height === t) || ((this.width = e), (this.height = t), this.dispose()), this.viewport.set(0, 0, e, t), this.scissor.set(0, 0, e, t)
  47042. },
  47043. clone: function () {
  47044. return new this.constructor().copy(this)
  47045. },
  47046. copy: function (e) {
  47047. return (
  47048. (this.width = e.width),
  47049. (this.height = e.height),
  47050. this.viewport.copy(e.viewport),
  47051. (this.texture = e.texture.clone()),
  47052. (this.depthBuffer = e.depthBuffer),
  47053. (this.stencilBuffer = e.stencilBuffer),
  47054. this
  47055. )
  47056. },
  47057. dispose: function () {
  47058. this.dispatchEvent({
  47059. type: 'dispose'
  47060. })
  47061. }
  47062. }),
  47063. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  47064. (Ci.WebGLRenderTargetCube = function (e, t, i) {
  47065. Ci.WebGLRenderTarget.call(this, e, t, i), (this.activeCubeFace = 0), (this.activeMipMapLevel = 0)
  47066. }),
  47067. (Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype)),
  47068. (Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube),
  47069. (Ci.WebGLBufferRenderer = function (r, o, a) {
  47070. var s
  47071. ;(this.setMode = function (e) {
  47072. s = e
  47073. }),
  47074. (this.render = function (e, t) {
  47075. r.drawArrays(s, e, t), a.calls++, (a.vertices += t), s === r.TRIANGLES && (a.faces += t / 3)
  47076. }),
  47077. (this.renderInstances = function (e) {
  47078. var t = o.get('ANGLE_instanced_arrays')
  47079. if (null !== t) {
  47080. var i = e.attributes.position,
  47081. n = 0
  47082. ;(n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count),
  47083. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  47084. a.calls++,
  47085. (a.vertices += n * e.maxInstancedCount),
  47086. s === r.TRIANGLES && (a.faces += (e.maxInstancedCount * n) / 3)
  47087. } else console.error('THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.')
  47088. })
  47089. }),
  47090. (Ci.WebGLIndexedBufferRenderer = function (r, o, a) {
  47091. var s, l, c
  47092. ;(this.setMode = function (e) {
  47093. s = e
  47094. }),
  47095. (this.setIndex = function (e) {
  47096. c = e.array instanceof Uint32Array && o.get('OES_element_index_uint') ? ((l = r.UNSIGNED_INT), 4) : ((l = r.UNSIGNED_SHORT), 2)
  47097. }),
  47098. (this.render = function (e, t) {
  47099. r.drawElements(s, t, l, e * c), a.calls++, (a.vertices += t), s === r.TRIANGLES && (a.faces += t / 3)
  47100. }),
  47101. (this.renderInstances = function (e, t, i) {
  47102. var n = o.get('ANGLE_instanced_arrays')
  47103. return null === n
  47104. ? void console.error('THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.')
  47105. : (n.drawElementsInstancedANGLE(s, i, l, t * c, e.maxInstancedCount),
  47106. a.calls++,
  47107. (a.vertices += i * e.maxInstancedCount),
  47108. void (s === r.TRIANGLES && (a.faces += (e.maxInstancedCount * i) / 3)))
  47109. })
  47110. }),
  47111. (Ci.WebGLExtensions = function (i) {
  47112. var n = {}
  47113. this.get = function (e) {
  47114. if (void 0 !== n[e]) return n[e]
  47115. var t
  47116. switch (e) {
  47117. case 'EXT_texture_filter_anisotropic':
  47118. t = i.getExtension('EXT_texture_filter_anisotropic') || i.getExtension('MOZ_EXT_texture_filter_anisotropic') || i.getExtension('WEBKIT_EXT_texture_filter_anisotropic')
  47119. break
  47120. case 'WEBGL_compressed_texture_s3tc':
  47121. t = i.getExtension('WEBGL_compressed_texture_s3tc') || i.getExtension('MOZ_WEBGL_compressed_texture_s3tc') || i.getExtension('WEBKIT_WEBGL_compressed_texture_s3tc')
  47122. break
  47123. case 'WEBGL_compressed_texture_pvrtc':
  47124. t = i.getExtension('WEBGL_compressed_texture_pvrtc') || i.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc')
  47125. break
  47126. case 'WEBGL_compressed_texture_etc1':
  47127. t = i.getExtension('WEBGL_compressed_texture_etc1')
  47128. break
  47129. default:
  47130. t = i.getExtension(e)
  47131. }
  47132. return null === t && console.warn('THREE.WebGLRenderer: ' + e + ' extension not supported.'), (n[e] = t)
  47133. }
  47134. }),
  47135. (Ci.WebGLCapabilities = function (t, e, i) {
  47136. function n(e) {
  47137. if ('highp' === e) {
  47138. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision) return 'highp'
  47139. e = 'mediump'
  47140. }
  47141. return 'mediump' === e && 0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.MEDIUM_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.MEDIUM_FLOAT).precision
  47142. ? 'mediump'
  47143. : 'lowp'
  47144. }
  47145. ;(this.getMaxPrecision = n),
  47146. (this.precision = void 0 !== i.precision ? i.precision : 'highp'),
  47147. (this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer),
  47148. (this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)),
  47149. (this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS)),
  47150. (this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE)),
  47151. (this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)),
  47152. (this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS)),
  47153. (this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS)),
  47154. (this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS)),
  47155. (this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS)),
  47156. (this.vertexTextures = 0 < this.maxVertexTextures),
  47157. (this.floatFragmentTextures = !!e.get('OES_texture_float')),
  47158. (this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures)
  47159. var r = n(this.precision)
  47160. r !== this.precision && (console.warn('THREE.WebGLRenderer:', this.precision, 'not supported, using', r, 'instead.'), (this.precision = r)),
  47161. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get('EXT_frag_depth'))
  47162. }),
  47163. (Ci.WebGLGeometries = function (i, o, a) {
  47164. function s(e) {
  47165. var t = e.target,
  47166. i = c[t.id]
  47167. null !== i.index && l(i.index),
  47168. (function (e) {
  47169. for (var t in e) l(e[t])
  47170. })(i.attributes),
  47171. t.removeEventListener('dispose', s),
  47172. delete c[t.id]
  47173. var n = o.get(t)
  47174. n.wireframe && l(n.wireframe), o.delete(t)
  47175. var r = o.get(i)
  47176. r.wireframe && l(r.wireframe), o.delete(i), a.memory.geometries--
  47177. }
  47178. function l(e) {
  47179. var t = (function (e) {
  47180. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  47181. })(e)
  47182. void 0 !== t &&
  47183. (i.deleteBuffer(t),
  47184. (function (e) {
  47185. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  47186. })(e))
  47187. }
  47188. var c = {}
  47189. this.get = function (e) {
  47190. var t,
  47191. i = e.geometry
  47192. return void 0 !== c[i.id]
  47193. ? c[i.id]
  47194. : (i.addEventListener('dispose', s),
  47195. i instanceof Ci.BufferGeometry
  47196. ? (t = i)
  47197. : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = new Ci.BufferGeometry().setFromObject(e)), (t = i._bufferGeometry)),
  47198. (c[i.id] = t),
  47199. a.memory.geometries++,
  47200. t)
  47201. }
  47202. }),
  47203. (Ci.WebGLLights = function () {
  47204. var i = {}
  47205. this.get = function (e) {
  47206. if (void 0 !== i[e.id]) return i[e.id]
  47207. var t
  47208. switch (e.type) {
  47209. case 'DirectionalLight':
  47210. t = {
  47211. direction: new Ci.Vector3(),
  47212. color: new Ci.Color(),
  47213. shadow: !1,
  47214. shadowBias: 0,
  47215. shadowRadius: 1,
  47216. shadowMapSize: new Ci.Vector2()
  47217. }
  47218. break
  47219. case 'SpotLight':
  47220. t = {
  47221. position: new Ci.Vector3(),
  47222. direction: new Ci.Vector3(),
  47223. color: new Ci.Color(),
  47224. distance: 0,
  47225. coneCos: 0,
  47226. penumbraCos: 0,
  47227. decay: 0,
  47228. shadow: !1,
  47229. shadowBias: 0,
  47230. shadowRadius: 1,
  47231. shadowMapSize: new Ci.Vector2()
  47232. }
  47233. break
  47234. case 'PointLight':
  47235. t = {
  47236. position: new Ci.Vector3(),
  47237. color: new Ci.Color(),
  47238. distance: 0,
  47239. decay: 0,
  47240. shadow: !1,
  47241. shadowBias: 0,
  47242. shadowRadius: 1,
  47243. shadowMapSize: new Ci.Vector2()
  47244. }
  47245. break
  47246. case 'HemisphereLight':
  47247. t = {
  47248. direction: new Ci.Vector3(),
  47249. skyColor: new Ci.Color(),
  47250. groundColor: new Ci.Color()
  47251. }
  47252. }
  47253. return (i[e.id] = t)
  47254. }
  47255. }),
  47256. (Ci.WebGLObjects = function (g, m, e) {
  47257. function v(e, t) {
  47258. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e,
  47259. n = m.get(i)
  47260. void 0 === n.__webglBuffer
  47261. ? (function (e, t, i) {
  47262. ;(e.__webglBuffer = g.createBuffer()), g.bindBuffer(i, e.__webglBuffer)
  47263. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW
  47264. g.bufferData(i, t.array, n), (e.version = t.version)
  47265. })(n, i, t)
  47266. : n.version !== i.version &&
  47267. (function (e, t, i) {
  47268. g.bindBuffer(i, e.__webglBuffer),
  47269. !1 === t.dynamic || -1 === t.updateRange.count
  47270. ? g.bufferSubData(i, 0, t.array)
  47271. : 0 === t.updateRange.count
  47272. ? console.error(
  47273. 'THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.'
  47274. )
  47275. : (g.bufferSubData(i, t.updateRange.offset * t.array.BYTES_PER_ELEMENT, t.array.subarray(t.updateRange.offset, t.updateRange.offset + t.updateRange.count)),
  47276. (t.updateRange.count = 0)),
  47277. (e.version = t.version)
  47278. })(n, i, t)
  47279. }
  47280. function y(e, t, i) {
  47281. if (i < t) {
  47282. var n = t
  47283. ;(t = i), (i = n)
  47284. }
  47285. var r = e[t]
  47286. return void 0 === r ? ((e[t] = [i]), !0) : -1 === r.indexOf(i) && (r.push(i), !0)
  47287. }
  47288. var c = new Ci.WebGLGeometries(g, m, e)
  47289. ;(this.getAttributeBuffer = function (e) {
  47290. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  47291. }),
  47292. (this.getWireframeAttribute = function (e) {
  47293. var t = m.get(e)
  47294. if (void 0 !== t.wireframe) return t.wireframe
  47295. var i,
  47296. n = [],
  47297. r = e.index,
  47298. o = e.attributes,
  47299. a = o.position
  47300. if (null !== r)
  47301. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  47302. var h = i[l + 0],
  47303. u = i[l + 1],
  47304. d = i[l + 2]
  47305. y(s, h, u) && n.push(h, u), y(s, u, d) && n.push(u, d), y(s, d, h) && n.push(d, h)
  47306. }
  47307. else
  47308. for (l = 0, c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  47309. ;(h = l + 0), (u = l + 1), (d = l + 2)
  47310. n.push(h, u, u, d, d, h)
  47311. }
  47312. var p = 65535 < a.count ? Uint32Array : Uint16Array,
  47313. f = new Ci.BufferAttribute(new p(n), 1)
  47314. return v(f, g.ELEMENT_ARRAY_BUFFER), (t.wireframe = f)
  47315. }),
  47316. (this.update = function (e) {
  47317. var t = c.get(e)
  47318. e.geometry instanceof Ci.Geometry && t.updateFromObject(e)
  47319. var i = t.index,
  47320. n = t.attributes
  47321. for (var r in (null !== i && v(i, g.ELEMENT_ARRAY_BUFFER), n)) v(n[r], g.ARRAY_BUFFER)
  47322. var o = t.morphAttributes
  47323. for (var r in o) for (var a = o[r], s = 0, l = a.length; s < l; s++) v(a[s], g.ARRAY_BUFFER)
  47324. return t
  47325. })
  47326. }),
  47327. (Ci.WebGLProgram =
  47328. ((Qt = 0),
  47329. (Jt = /^([\w\d_]+)\.([\w\d_]+)$/),
  47330. ($t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/),
  47331. (ei = /^([\w\d_]+)\[0\]$/),
  47332. function (e, t, i, n) {
  47333. var r = e.context,
  47334. o = i.extensions,
  47335. a = i.defines,
  47336. s = i.__webglShader.vertexShader,
  47337. l = i.__webglShader.fragmentShader,
  47338. c = 'SHADOWMAP_TYPE_BASIC'
  47339. n.shadowMapType === Ci.PCFShadowMap ? (c = 'SHADOWMAP_TYPE_PCF') : n.shadowMapType === Ci.PCFSoftShadowMap && (c = 'SHADOWMAP_TYPE_PCF_SOFT')
  47340. var h = 'ENVMAP_TYPE_CUBE',
  47341. u = 'ENVMAP_MODE_REFLECTION',
  47342. d = 'ENVMAP_BLENDING_MULTIPLY'
  47343. if (n.envMap) {
  47344. switch (i.envMap.mapping) {
  47345. case Ci.CubeReflectionMapping:
  47346. case Ci.CubeRefractionMapping:
  47347. h = 'ENVMAP_TYPE_CUBE'
  47348. break
  47349. case Ci.CubeUVReflectionMapping:
  47350. case Ci.CubeUVRefractionMapping:
  47351. h = 'ENVMAP_TYPE_CUBE_UV'
  47352. break
  47353. case Ci.EquirectangularReflectionMapping:
  47354. case Ci.EquirectangularRefractionMapping:
  47355. h = 'ENVMAP_TYPE_EQUIREC'
  47356. break
  47357. case Ci.SphericalReflectionMapping:
  47358. h = 'ENVMAP_TYPE_SPHERE'
  47359. }
  47360. switch (i.envMap.mapping) {
  47361. case Ci.CubeRefractionMapping:
  47362. case Ci.EquirectangularRefractionMapping:
  47363. u = 'ENVMAP_MODE_REFRACTION'
  47364. }
  47365. switch (i.combine) {
  47366. case Ci.MultiplyOperation:
  47367. d = 'ENVMAP_BLENDING_MULTIPLY'
  47368. break
  47369. case Ci.MixOperation:
  47370. d = 'ENVMAP_BLENDING_MIX'
  47371. break
  47372. case Ci.AddOperation:
  47373. d = 'ENVMAP_BLENDING_ADD'
  47374. }
  47375. }
  47376. var p,
  47377. f,
  47378. g = 0 < e.gammaFactor ? e.gammaFactor : 1,
  47379. m = (function (e, t, i) {
  47380. return [
  47381. (e = e || {}).derivatives || t.envMapCubeUV || t.bumpMap || t.normalMap || t.flatShading ? '#extension GL_OES_standard_derivatives : enable' : '',
  47382. (e.fragDepth || t.logarithmicDepthBuffer) && i.get('EXT_frag_depth') ? '#extension GL_EXT_frag_depth : enable' : '',
  47383. e.drawBuffers && i.get('WEBGL_draw_buffers') ? '#extension GL_EXT_draw_buffers : require' : '',
  47384. (e.shaderTextureLOD || t.envMap) && i.get('EXT_shader_texture_lod') ? '#extension GL_EXT_shader_texture_lod : enable' : ''
  47385. ]
  47386. .filter(Pi)
  47387. .join('\n')
  47388. })(o, n, e.extensions),
  47389. v = (function (e) {
  47390. var t = []
  47391. for (var i in e) {
  47392. var n = e[i]
  47393. !1 !== n && t.push('#define ' + i + ' ' + n)
  47394. }
  47395. return t.join('\n')
  47396. })(a),
  47397. y = r.createProgram()
  47398. ;(f =
  47399. i instanceof Ci.RawShaderMaterial
  47400. ? (p = '')
  47401. : ((p = [
  47402. 'precision ' + n.precision + ' float;',
  47403. 'precision ' + n.precision + ' int;',
  47404. '#define SHADER_NAME ' + i.__webglShader.name,
  47405. v,
  47406. n.supportsVertexTextures ? '#define VERTEX_TEXTURES' : '',
  47407. '#define GAMMA_FACTOR ' + g,
  47408. '#define MAX_BONES ' + n.maxBones,
  47409. n.map ? '#define USE_MAP' : '',
  47410. n.envMap ? '#define USE_ENVMAP' : '',
  47411. n.envMap ? '#define ' + u : '',
  47412. n.lightMap ? '#define USE_LIGHTMAP' : '',
  47413. n.aoMap ? '#define USE_AOMAP' : '',
  47414. n.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
  47415. n.bumpMap ? '#define USE_BUMPMAP' : '',
  47416. n.normalMap ? '#define USE_NORMALMAP' : '',
  47417. n.displacementMap && n.supportsVertexTextures ? '#define USE_DISPLACEMENTMAP' : '',
  47418. n.specularMap ? '#define USE_SPECULARMAP' : '',
  47419. n.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
  47420. n.metalnessMap ? '#define USE_METALNESSMAP' : '',
  47421. n.alphaMap ? '#define USE_ALPHAMAP' : '',
  47422. n.vertexColors ? '#define USE_COLOR' : '',
  47423. n.flatShading ? '#define FLAT_SHADED' : '',
  47424. n.skinning ? '#define USE_SKINNING' : '',
  47425. n.useVertexTexture ? '#define BONE_TEXTURE' : '',
  47426. n.morphTargets ? '#define USE_MORPHTARGETS' : '',
  47427. n.morphNormals && !1 === n.flatShading ? '#define USE_MORPHNORMALS' : '',
  47428. n.doubleSided ? '#define DOUBLE_SIDED' : '',
  47429. n.flipSided ? '#define FLIP_SIDED' : '',
  47430. n.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',
  47431. n.shadowMapEnabled ? '#define ' + c : '',
  47432. 0 < n.pointLightShadows ? '#define POINT_LIGHT_SHADOWS' : '',
  47433. n.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '',
  47434. n.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
  47435. n.logarithmicDepthBuffer && e.extensions.get('EXT_frag_depth') ? '#define USE_LOGDEPTHBUF_EXT' : '',
  47436. 'uniform mat4 modelMatrix;',
  47437. 'uniform mat4 modelViewMatrix;',
  47438. 'uniform mat4 projectionMatrix;',
  47439. 'uniform mat4 viewMatrix;',
  47440. 'uniform mat3 normalMatrix;',
  47441. 'uniform vec3 cameraPosition;',
  47442. 'attribute vec3 position;',
  47443. 'attribute vec3 normal;',
  47444. 'attribute vec2 uv;',
  47445. '#ifdef USE_COLOR',
  47446. '\tattribute vec3 color;',
  47447. '#endif',
  47448. '#ifdef USE_MORPHTARGETS',
  47449. '\tattribute vec3 morphTarget0;',
  47450. '\tattribute vec3 morphTarget1;',
  47451. '\tattribute vec3 morphTarget2;',
  47452. '\tattribute vec3 morphTarget3;',
  47453. '\t#ifdef USE_MORPHNORMALS',
  47454. '\t\tattribute vec3 morphNormal0;',
  47455. '\t\tattribute vec3 morphNormal1;',
  47456. '\t\tattribute vec3 morphNormal2;',
  47457. '\t\tattribute vec3 morphNormal3;',
  47458. '\t#else',
  47459. '\t\tattribute vec3 morphTarget4;',
  47460. '\t\tattribute vec3 morphTarget5;',
  47461. '\t\tattribute vec3 morphTarget6;',
  47462. '\t\tattribute vec3 morphTarget7;',
  47463. '\t#endif',
  47464. '#endif',
  47465. '#ifdef USE_SKINNING',
  47466. '\tattribute vec4 skinIndex;',
  47467. '\tattribute vec4 skinWeight;',
  47468. '#endif',
  47469. '\n'
  47470. ]
  47471. .filter(Pi)
  47472. .join('\n')),
  47473. [
  47474. m,
  47475. 'precision ' + n.precision + ' float;',
  47476. 'precision ' + n.precision + ' int;',
  47477. '#define SHADER_NAME ' + i.__webglShader.name,
  47478. v,
  47479. n.alphaTest ? '#define ALPHATEST ' + n.alphaTest : '',
  47480. '#define GAMMA_FACTOR ' + g,
  47481. n.useFog && n.fog ? '#define USE_FOG' : '',
  47482. n.useFog && n.fogExp ? '#define FOG_EXP2' : '',
  47483. n.map ? '#define USE_MAP' : '',
  47484. n.envMap ? '#define USE_ENVMAP' : '',
  47485. n.envMap ? '#define ' + h : '',
  47486. n.envMap ? '#define ' + u : '',
  47487. n.envMap ? '#define ' + d : '',
  47488. n.lightMap ? '#define USE_LIGHTMAP' : '',
  47489. n.aoMap ? '#define USE_AOMAP' : '',
  47490. n.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
  47491. n.bumpMap ? '#define USE_BUMPMAP' : '',
  47492. n.normalMap ? '#define USE_NORMALMAP' : '',
  47493. n.specularMap ? '#define USE_SPECULARMAP' : '',
  47494. n.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
  47495. n.metalnessMap ? '#define USE_METALNESSMAP' : '',
  47496. n.alphaMap ? '#define USE_ALPHAMAP' : '',
  47497. n.vertexColors ? '#define USE_COLOR' : '',
  47498. n.flatShading ? '#define FLAT_SHADED' : '',
  47499. n.doubleSided ? '#define DOUBLE_SIDED' : '',
  47500. n.flipSided ? '#define FLIP_SIDED' : '',
  47501. n.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',
  47502. n.shadowMapEnabled ? '#define ' + c : '',
  47503. 0 < n.pointLightShadows ? '#define POINT_LIGHT_SHADOWS' : '',
  47504. n.premultipliedAlpha ? '#define PREMULTIPLIED_ALPHA' : '',
  47505. n.physicallyCorrectLights ? '#define PHYSICALLY_CORRECT_LIGHTS' : '',
  47506. n.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
  47507. n.logarithmicDepthBuffer && e.extensions.get('EXT_frag_depth') ? '#define USE_LOGDEPTHBUF_EXT' : '',
  47508. n.envMap && e.extensions.get('EXT_shader_texture_lod') ? '#define TEXTURE_LOD_EXT' : '',
  47509. 'uniform mat4 viewMatrix;',
  47510. 'uniform vec3 cameraPosition;',
  47511. n.toneMapping !== Ci.NoToneMapping ? '#define TONE_MAPPING' : '',
  47512. n.toneMapping !== Ci.NoToneMapping ? Ci.ShaderChunk.tonemapping_pars_fragment : '',
  47513. n.toneMapping !== Ci.NoToneMapping
  47514. ? (function (e, t) {
  47515. var i
  47516. switch (t) {
  47517. case Ci.LinearToneMapping:
  47518. i = 'Linear'
  47519. break
  47520. case Ci.ReinhardToneMapping:
  47521. i = 'Reinhard'
  47522. break
  47523. case Ci.Uncharted2ToneMapping:
  47524. i = 'Uncharted2'
  47525. break
  47526. case Ci.CineonToneMapping:
  47527. i = 'OptimizedCineon'
  47528. break
  47529. default:
  47530. throw new Error('unsupported toneMapping: ' + t)
  47531. }
  47532. return 'vec3 ' + e + '( vec3 color ) { return ' + i + 'ToneMapping( color ); }'
  47533. })('toneMapping', n.toneMapping)
  47534. : '',
  47535. n.outputEncoding || n.mapEncoding || n.envMapEncoding || n.emissiveMapEncoding ? Ci.ShaderChunk.encodings_pars_fragment : '',
  47536. n.mapEncoding ? Ri('mapTexelToLinear', n.mapEncoding) : '',
  47537. n.envMapEncoding ? Ri('envMapTexelToLinear', n.envMapEncoding) : '',
  47538. n.emissiveMapEncoding ? Ri('emissiveMapTexelToLinear', n.emissiveMapEncoding) : '',
  47539. n.outputEncoding
  47540. ? (function (e, t) {
  47541. var i = Mi(t)
  47542. return 'vec4 ' + e + '( vec4 value ) { return LinearTo' + i[0] + i[1] + '; }'
  47543. })('linearToOutputTexel', n.outputEncoding)
  47544. : '',
  47545. '\n'
  47546. ]
  47547. .filter(Pi)
  47548. .join('\n'))),
  47549. (s = Oi((s = Li(s)), n)),
  47550. (l = Oi((l = Li(l)), n)),
  47551. i instanceof Ci.ShaderMaterial == 0 && ((s = Di(s)), (l = Di(l)))
  47552. var A = p + s,
  47553. C = f + l,
  47554. I = Ci.WebGLShader(r, r.VERTEX_SHADER, A),
  47555. E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C)
  47556. r.attachShader(y, I),
  47557. r.attachShader(y, E),
  47558. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, 'position'),
  47559. r.linkProgram(y)
  47560. var _,
  47561. b,
  47562. w = r.getProgramInfoLog(y),
  47563. T = r.getShaderInfoLog(I),
  47564. x = r.getShaderInfoLog(E),
  47565. S = !0,
  47566. M = !0
  47567. return (
  47568. !1 === r.getProgramParameter(y, r.LINK_STATUS)
  47569. ? ((S = !1), console.error('THREE.WebGLProgram: shader error: ', r.getError(), 'gl.VALIDATE_STATUS', r.getProgramParameter(y, r.VALIDATE_STATUS), 'gl.getProgramInfoLog', w, T, x))
  47570. : '' !== w
  47571. ? console.warn('THREE.WebGLProgram: gl.getProgramInfoLog()', w)
  47572. : ('' !== T && '' !== x) || (M = !1),
  47573. M &&
  47574. (this.diagnostics = {
  47575. runnable: S,
  47576. material: i,
  47577. programLog: w,
  47578. vertexShader: {
  47579. log: T,
  47580. prefix: p
  47581. },
  47582. fragmentShader: {
  47583. log: x,
  47584. prefix: f
  47585. }
  47586. }),
  47587. r.deleteShader(I),
  47588. r.deleteShader(E),
  47589. (this.getUniforms = function () {
  47590. return (
  47591. void 0 === _ &&
  47592. (_ = (function (e, t) {
  47593. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  47594. var o = e.getActiveUniform(t, r).name,
  47595. a = e.getUniformLocation(t, o),
  47596. s = Jt.exec(o)
  47597. if (s) {
  47598. var l = s[1],
  47599. c = s[2],
  47600. h = i[l]
  47601. ;(h = h || (i[l] = {}))[c] = a
  47602. } else if ((s = $t.exec(o))) {
  47603. var u = s[1],
  47604. d = s[2],
  47605. p = s[3],
  47606. f = i[u],
  47607. g = (f = f || (i[u] = []))[d]
  47608. ;(g = g || (f[d] = {}))[p] = a
  47609. } else (s = ei.exec(o)) ? (i[(u = s[1])] = a) : (i[o] = a)
  47610. }
  47611. return i
  47612. })(r, y)),
  47613. _
  47614. )
  47615. }),
  47616. (this.getAttributes = function () {
  47617. return (
  47618. void 0 === b &&
  47619. (b = (function (e, t) {
  47620. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  47621. var o = e.getActiveAttrib(t, r).name
  47622. i[o] = e.getAttribLocation(t, o)
  47623. }
  47624. return i
  47625. })(r, y)),
  47626. b
  47627. )
  47628. }),
  47629. (this.destroy = function () {
  47630. r.deleteProgram(y), (this.program = void 0)
  47631. }),
  47632. Object.defineProperties(this, {
  47633. uniforms: {
  47634. get: function () {
  47635. return console.warn('THREE.WebGLProgram: .uniforms is now .getUniforms().'), this.getUniforms()
  47636. }
  47637. },
  47638. attributes: {
  47639. get: function () {
  47640. return console.warn('THREE.WebGLProgram: .attributes is now .getAttributes().'), this.getAttributes()
  47641. }
  47642. }
  47643. }),
  47644. (this.id = Qt++),
  47645. (this.code = t),
  47646. (this.usedTimes = 1),
  47647. (this.program = y),
  47648. (this.vertexShader = I),
  47649. (this.fragmentShader = E),
  47650. this
  47651. )
  47652. })),
  47653. (Ci.WebGLPrograms = function (s, l) {
  47654. function c(e, t) {
  47655. var i
  47656. return (
  47657. e ? (e instanceof Ci.Texture ? (i = e.encoding) : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding)) : (i = Ci.LinearEncoding),
  47658. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  47659. i
  47660. )
  47661. }
  47662. var h = [],
  47663. u = {
  47664. MeshDepthMaterial: 'depth',
  47665. MeshNormalMaterial: 'normal',
  47666. MeshBasicMaterial: 'basic',
  47667. MeshLambertMaterial: 'lambert',
  47668. MeshPhongMaterial: 'phong',
  47669. MeshStandardMaterial: 'standard',
  47670. LineBasicMaterial: 'basic',
  47671. LineDashedMaterial: 'dashed',
  47672. PointsMaterial: 'points'
  47673. },
  47674. a = [
  47675. 'precision',
  47676. 'supportsVertexTextures',
  47677. 'map',
  47678. 'mapEncoding',
  47679. 'envMap',
  47680. 'envMapMode',
  47681. 'envMapEncoding',
  47682. 'lightMap',
  47683. 'aoMap',
  47684. 'emissiveMap',
  47685. 'emissiveMapEncoding',
  47686. 'bumpMap',
  47687. 'normalMap',
  47688. 'displacementMap',
  47689. 'specularMap',
  47690. 'roughnessMap',
  47691. 'metalnessMap',
  47692. 'alphaMap',
  47693. 'combine',
  47694. 'vertexColors',
  47695. 'fog',
  47696. 'useFog',
  47697. 'fogExp',
  47698. 'flatShading',
  47699. 'sizeAttenuation',
  47700. 'logarithmicDepthBuffer',
  47701. 'skinning',
  47702. 'maxBones',
  47703. 'useVertexTexture',
  47704. 'morphTargets',
  47705. 'morphNormals',
  47706. 'maxMorphTargets',
  47707. 'maxMorphNormals',
  47708. 'premultipliedAlpha',
  47709. 'numDirLights',
  47710. 'numPointLights',
  47711. 'numSpotLights',
  47712. 'numHemiLights',
  47713. 'shadowMapEnabled',
  47714. 'pointLightShadows',
  47715. 'toneMapping',
  47716. 'physicallyCorrectLights',
  47717. 'shadowMapType',
  47718. 'alphaTest',
  47719. 'doubleSided',
  47720. 'flipSided'
  47721. ]
  47722. ;(this.getParameters = function (e, t, i, n) {
  47723. var r = u[e.type],
  47724. o = (function (e) {
  47725. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture) return 1024
  47726. var t = l.maxVertexUniforms,
  47727. i = Math.floor((t - 20) / 4)
  47728. return (
  47729. void 0 !== e &&
  47730. e instanceof Ci.SkinnedMesh &&
  47731. (i = Math.min(e.skeleton.bones.length, i)) < e.skeleton.bones.length &&
  47732. console.warn('WebGLRenderer: too many bones - ' + e.skeleton.bones.length + ', this GPU supports just ' + i + ' (try OpenGL instead of ANGLE)'),
  47733. i
  47734. )
  47735. })(n),
  47736. a = s.getPrecision()
  47737. return (
  47738. null === e.precision ||
  47739. ((a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn('THREE.WebGLProgram.getParameters:', e.precision, 'not supported, using', a, 'instead.')),
  47740. {
  47741. shaderID: r,
  47742. precision: a,
  47743. supportsVertexTextures: l.vertexTextures,
  47744. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  47745. map: !!e.map,
  47746. mapEncoding: c(e.map, s.gammaInput),
  47747. envMap: !!e.envMap,
  47748. envMapMode: e.envMap && e.envMap.mapping,
  47749. envMapEncoding: c(e.envMap, s.gammaInput),
  47750. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  47751. lightMap: !!e.lightMap,
  47752. aoMap: !!e.aoMap,
  47753. emissiveMap: !!e.emissiveMap,
  47754. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  47755. bumpMap: !!e.bumpMap,
  47756. normalMap: !!e.normalMap,
  47757. displacementMap: !!e.displacementMap,
  47758. roughnessMap: !!e.roughnessMap,
  47759. metalnessMap: !!e.metalnessMap,
  47760. specularMap: !!e.specularMap,
  47761. alphaMap: !!e.alphaMap,
  47762. combine: e.combine,
  47763. vertexColors: e.vertexColors,
  47764. fog: i,
  47765. useFog: e.fog,
  47766. fogExp: i instanceof Ci.FogExp2,
  47767. flatShading: e.shading === Ci.FlatShading,
  47768. sizeAttenuation: e.sizeAttenuation,
  47769. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  47770. skinning: e.skinning,
  47771. maxBones: o,
  47772. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  47773. morphTargets: e.morphTargets,
  47774. morphNormals: e.morphNormals,
  47775. maxMorphTargets: s.maxMorphTargets,
  47776. maxMorphNormals: s.maxMorphNormals,
  47777. numDirLights: t.directional.length,
  47778. numPointLights: t.point.length,
  47779. numSpotLights: t.spot.length,
  47780. numHemiLights: t.hemi.length,
  47781. pointLightShadows: t.shadowsPointLight,
  47782. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  47783. shadowMapType: s.shadowMap.type,
  47784. toneMapping: s.toneMapping,
  47785. physicallyCorrectLights: s.physicallyCorrectLights,
  47786. premultipliedAlpha: e.premultipliedAlpha,
  47787. alphaTest: e.alphaTest,
  47788. doubleSided: e.side === Ci.DoubleSide,
  47789. flipSided: e.side === Ci.BackSide
  47790. }
  47791. )
  47792. }),
  47793. (this.getProgramCode = function (e, t) {
  47794. var i = []
  47795. if ((t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader), i.push(e.vertexShader)), void 0 !== e.defines)) for (var n in e.defines) i.push(n), i.push(e.defines[n])
  47796. for (var r = 0; r < a.length; r++) {
  47797. var o = a[r]
  47798. i.push(o), i.push(t[o])
  47799. }
  47800. return i.join()
  47801. }),
  47802. (this.acquireProgram = function (e, t, i) {
  47803. for (var n, r = 0, o = h.length; r < o; r++) {
  47804. var a = h[r]
  47805. if (a.code === i) {
  47806. ++(n = a).usedTimes
  47807. break
  47808. }
  47809. }
  47810. return void 0 === n && ((n = new Ci.WebGLProgram(s, i, e, t)), h.push(n)), n
  47811. }),
  47812. (this.releaseProgram = function (e) {
  47813. if (0 == --e.usedTimes) {
  47814. var t = h.indexOf(e)
  47815. ;(h[t] = h[h.length - 1]), h.pop(), e.destroy()
  47816. }
  47817. }),
  47818. (this.programs = h)
  47819. }),
  47820. (Ci.WebGLProperties = function () {
  47821. var n = {}
  47822. ;(this.get = function (e) {
  47823. var t = e.uuid,
  47824. i = n[t]
  47825. return void 0 === i && ((i = {}), (n[t] = i)), i
  47826. }),
  47827. (this.delete = function (e) {
  47828. delete n[e.uuid]
  47829. }),
  47830. (this.clear = function () {
  47831. n = {}
  47832. })
  47833. }),
  47834. (Ci.WebGLShader = function (e, t, i) {
  47835. var n = e.createShader(t)
  47836. return (
  47837. e.shaderSource(n, i),
  47838. e.compileShader(n),
  47839. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  47840. '' !== e.getShaderInfoLog(n) &&
  47841. console.warn(
  47842. 'THREE.WebGLShader: gl.getShaderInfoLog()',
  47843. t === e.VERTEX_SHADER ? 'vertex' : 'fragment',
  47844. e.getShaderInfoLog(n),
  47845. (function (e) {
  47846. for (var t = e.split('\n'), i = 0; i < t.length; i++) t[i] = i + 1 + ': ' + t[i]
  47847. return t.join('\n')
  47848. })(i)
  47849. ),
  47850. n
  47851. )
  47852. }),
  47853. (Ci.WebGLShadowMap = function (P, O, L) {
  47854. function D(e, t, i, n) {
  47855. var r = e.geometry,
  47856. o = null,
  47857. a = p,
  47858. s = e.customDepthMaterial
  47859. if ((i && ((a = f), (s = e.customDistanceMaterial)), s)) o = s
  47860. else {
  47861. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets,
  47862. c = e instanceof Ci.SkinnedMesh && t.skinning,
  47863. h = 0
  47864. l && (h |= u), c && (h |= d), (o = a[h])
  47865. }
  47866. return (o.visible = t.visible), (o.wireframe = t.wireframe), (o.wireframeLinewidth = t.wireframeLinewidth), i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n), o
  47867. }
  47868. function N(e, t, i) {
  47869. if (!1 !== e.visible) {
  47870. if (e.layers.test(t.layers) && (e instanceof Ci.Mesh || e instanceof Ci.Line || e instanceof Ci.Points) && e.castShadow && (!1 === e.frustumCulled || !0 === V.intersectsObject(e)))
  47871. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld), G.push(e))
  47872. for (var n = e.children, r = 0, o = n.length; r < o; r++) N(n[r], t, i)
  47873. }
  47874. }
  47875. for (
  47876. var F = P.context,
  47877. B = P.state,
  47878. V = new Ci.Frustum(),
  47879. k = new Ci.Matrix4(),
  47880. U = new Ci.Vector2(),
  47881. H = new Ci.Vector3(),
  47882. z = new Ci.Vector3(),
  47883. G = [],
  47884. u = 1,
  47885. d = 2,
  47886. e = 1 + (u | d),
  47887. p = new Array(e),
  47888. f = new Array(e),
  47889. W = [new Ci.Vector3(1, 0, 0), new Ci.Vector3(-1, 0, 0), new Ci.Vector3(0, 0, 1), new Ci.Vector3(0, 0, -1), new Ci.Vector3(0, 1, 0), new Ci.Vector3(0, -1, 0)],
  47890. j = [new Ci.Vector3(0, 1, 0), new Ci.Vector3(0, 1, 0), new Ci.Vector3(0, 1, 0), new Ci.Vector3(0, 1, 0), new Ci.Vector3(0, 0, 1), new Ci.Vector3(0, 0, -1)],
  47891. Y = [new Ci.Vector4(), new Ci.Vector4(), new Ci.Vector4(), new Ci.Vector4(), new Ci.Vector4(), new Ci.Vector4()],
  47892. t = Ci.ShaderLib.depthRGBA,
  47893. i = Ci.UniformsUtils.clone(t.uniforms),
  47894. n = Ci.ShaderLib.distanceRGBA,
  47895. r = Ci.UniformsUtils.clone(n.uniforms),
  47896. o = 0;
  47897. o !== e;
  47898. ++o
  47899. ) {
  47900. var a = 0 != (o & u),
  47901. s = 0 != (o & d),
  47902. l = new Ci.ShaderMaterial({
  47903. uniforms: i,
  47904. vertexShader: t.vertexShader,
  47905. fragmentShader: t.fragmentShader,
  47906. morphTargets: a,
  47907. skinning: s
  47908. })
  47909. p[o] = l
  47910. var c = new Ci.ShaderMaterial({
  47911. defines: {
  47912. USE_SHADOWMAP: ''
  47913. },
  47914. uniforms: r,
  47915. vertexShader: n.vertexShader,
  47916. fragmentShader: n.fragmentShader,
  47917. morphTargets: a,
  47918. skinning: s
  47919. })
  47920. f[o] = c
  47921. }
  47922. var q = this
  47923. ;(this.enabled = !1),
  47924. (this.autoUpdate = !0),
  47925. (this.needsUpdate = !1),
  47926. (this.type = Ci.PCFShadowMap),
  47927. (this.cullFace = Ci.CullFaceFront),
  47928. (this.render = function (e, t) {
  47929. var i,
  47930. n,
  47931. r = O.shadows
  47932. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  47933. B.clearColor(1, 1, 1, 1),
  47934. B.disable(F.BLEND),
  47935. B.enable(F.CULL_FACE),
  47936. F.frontFace(F.CCW),
  47937. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  47938. B.setDepthTest(!0),
  47939. B.setScissorTest(!1)
  47940. for (var o = 0, a = r.length; o < a; o++) {
  47941. var s = r[o],
  47942. l = s.shadow,
  47943. c = l.camera
  47944. if ((U.copy(l.mapSize), s instanceof Ci.PointLight)) {
  47945. ;(i = 6), (n = !0)
  47946. var h = U.x,
  47947. u = U.y
  47948. Y[0].set(2 * h, u, h, u), Y[1].set(0, u, h, u), Y[2].set(3 * h, u, h, u), Y[3].set(h, u, h, u), Y[4].set(3 * h, 0, h, u), Y[5].set(h, 0, h, u), (U.x *= 4), (U.y *= 2)
  47949. } else n = !(i = 1)
  47950. if (null === l.map) {
  47951. var d = {
  47952. minFilter: Ci.NearestFilter,
  47953. magFilter: Ci.NearestFilter,
  47954. format: Ci.RGBAFormat
  47955. }
  47956. ;(l.map = new Ci.WebGLRenderTarget(U.x, U.y, d)), s instanceof Ci.SpotLight && (c.aspect = U.x / U.y), c.updateProjectionMatrix()
  47957. }
  47958. var p = l.map,
  47959. f = l.matrix
  47960. z.setFromMatrixPosition(s.matrixWorld), c.position.copy(z), P.setRenderTarget(p), P.clear()
  47961. for (var g = 0; g < i; g++) {
  47962. if (n) {
  47963. H.copy(c.position), H.add(W[g]), c.up.copy(j[g]), c.lookAt(H)
  47964. var m = Y[g]
  47965. B.viewport(m)
  47966. } else H.setFromMatrixPosition(s.target.matrixWorld), c.lookAt(H)
  47967. c.updateMatrixWorld(),
  47968. c.matrixWorldInverse.getInverse(c.matrixWorld),
  47969. f.set(0.5, 0, 0, 0.5, 0, 0.5, 0, 0.5, 0, 0, 0.5, 0.5, 0, 0, 0, 1),
  47970. f.multiply(c.projectionMatrix),
  47971. f.multiply(c.matrixWorldInverse),
  47972. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  47973. V.setFromMatrix(k),
  47974. (G.length = 0),
  47975. N(e, t, c)
  47976. for (var v = 0, y = G.length; v < y; v++) {
  47977. var A = G[v],
  47978. C = L.update(A),
  47979. I = A.material
  47980. if (I instanceof Ci.MultiMaterial)
  47981. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  47982. var T = E[b],
  47983. x = _[T.materialIndex]
  47984. if (!0 === x.visible) {
  47985. var S = D(A, x, n, z)
  47986. P.renderBufferDirect(c, null, C, S, A, T)
  47987. }
  47988. }
  47989. else {
  47990. S = D(A, I, n, z)
  47991. P.renderBufferDirect(c, null, C, S, A, null)
  47992. }
  47993. }
  47994. }
  47995. }
  47996. var M = P.getClearColor(),
  47997. R = P.getClearAlpha()
  47998. P.setClearColor(M, R), B.enable(F.BLEND), q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK), (q.needsUpdate = !1)
  47999. }
  48000. })
  48001. }),
  48002. (Ci.WebGLState = function (l, i, c) {
  48003. var n = this,
  48004. r = new Ci.Vector4(),
  48005. o = new Uint8Array(16),
  48006. a = new Uint8Array(16),
  48007. s = new Uint8Array(16),
  48008. t = {},
  48009. h = null,
  48010. u = null,
  48011. d = null,
  48012. p = null,
  48013. f = null,
  48014. g = null,
  48015. m = null,
  48016. v = null,
  48017. y = !1,
  48018. A = null,
  48019. C = null,
  48020. I = null,
  48021. E = null,
  48022. _ = null,
  48023. b = null,
  48024. w = null,
  48025. T = null,
  48026. x = null,
  48027. S = null,
  48028. M = null,
  48029. R = null,
  48030. P = null,
  48031. O = null,
  48032. L = null,
  48033. D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),
  48034. N = void 0,
  48035. F = {},
  48036. B = new Ci.Vector4(),
  48037. V = null,
  48038. k = null,
  48039. U = new Ci.Vector4(),
  48040. H = new Ci.Vector4(),
  48041. z = l.createTexture()
  48042. l.bindTexture(l.TEXTURE_2D, z),
  48043. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  48044. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  48045. (this.init = function () {
  48046. this.clearColor(0, 0, 0, 1),
  48047. this.clearDepth(1),
  48048. this.clearStencil(0),
  48049. this.enable(l.DEPTH_TEST),
  48050. l.depthFunc(l.LEQUAL),
  48051. l.frontFace(l.CCW),
  48052. l.cullFace(l.BACK),
  48053. this.enable(l.CULL_FACE),
  48054. this.enable(l.BLEND),
  48055. l.blendEquation(l.FUNC_ADD),
  48056. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  48057. }),
  48058. (this.initAttributes = function () {
  48059. for (var e = 0, t = o.length; e < t; e++) o[e] = 0
  48060. }),
  48061. (this.enableAttribute = function (e) {
  48062. ;(o[e] = 1), 0 === a[e] && (l.enableVertexAttribArray(e), (a[e] = 1)), 0 !== s[e] && (i.get('ANGLE_instanced_arrays').vertexAttribDivisorANGLE(e, 0), (s[e] = 0))
  48063. }),
  48064. (this.enableAttributeAndDivisor = function (e, t, i) {
  48065. ;(o[e] = 1), 0 === a[e] && (l.enableVertexAttribArray(e), (a[e] = 1)), s[e] !== t && (i.vertexAttribDivisorANGLE(e, t), (s[e] = t))
  48066. }),
  48067. (this.disableUnusedAttributes = function () {
  48068. for (var e = 0, t = a.length; e < t; e++) a[e] !== o[e] && (l.disableVertexAttribArray(e), (a[e] = 0))
  48069. }),
  48070. (this.enable = function (e) {
  48071. !0 !== t[e] && (l.enable(e), (t[e] = !0))
  48072. }),
  48073. (this.disable = function (e) {
  48074. !1 !== t[e] && (l.disable(e), (t[e] = !1))
  48075. }),
  48076. (this.getCompressedTextureFormats = function () {
  48077. if (null === h && ((h = []), i.get('WEBGL_compressed_texture_pvrtc') || i.get('WEBGL_compressed_texture_s3tc') || i.get('WEBGL_compressed_texture_etc1')))
  48078. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++) h.push(e[t])
  48079. return h
  48080. }),
  48081. (this.setBlending = function (e, t, i, n, r, o, a, s) {
  48082. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  48083. (e === u && s === y) ||
  48084. (e === Ci.AdditiveBlending
  48085. ? s
  48086. ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE))
  48087. : (l.blendEquation(l.FUNC_ADD), l.blendFunc(l.SRC_ALPHA, l.ONE))
  48088. : e === Ci.SubtractiveBlending
  48089. ? s
  48090. ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA))
  48091. : (l.blendEquation(l.FUNC_ADD), l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR))
  48092. : e === Ci.MultiplyBlending
  48093. ? s
  48094. ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA))
  48095. : (l.blendEquation(l.FUNC_ADD), l.blendFunc(l.ZERO, l.SRC_COLOR))
  48096. : s
  48097. ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA))
  48098. : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  48099. (u = e),
  48100. (y = s)),
  48101. e === Ci.CustomBlending
  48102. ? ((r = r || t),
  48103. (o = o || i),
  48104. (a = a || n),
  48105. (t === d && r === g) || (l.blendEquationSeparate(c(t), c(r)), (d = t), (g = r)),
  48106. (i === p && n === f && o === m && a === v) || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)), (p = i), (f = n), (m = o), (v = a)))
  48107. : (v = m = g = f = p = d = null)
  48108. }),
  48109. (this.setDepthFunc = function (e) {
  48110. if (A !== e) {
  48111. if (e)
  48112. switch (e) {
  48113. case Ci.NeverDepth:
  48114. l.depthFunc(l.NEVER)
  48115. break
  48116. case Ci.AlwaysDepth:
  48117. l.depthFunc(l.ALWAYS)
  48118. break
  48119. case Ci.LessDepth:
  48120. l.depthFunc(l.LESS)
  48121. break
  48122. case Ci.LessEqualDepth:
  48123. l.depthFunc(l.LEQUAL)
  48124. break
  48125. case Ci.EqualDepth:
  48126. l.depthFunc(l.EQUAL)
  48127. break
  48128. case Ci.GreaterEqualDepth:
  48129. l.depthFunc(l.GEQUAL)
  48130. break
  48131. case Ci.GreaterDepth:
  48132. l.depthFunc(l.GREATER)
  48133. break
  48134. case Ci.NotEqualDepth:
  48135. l.depthFunc(l.NOTEQUAL)
  48136. break
  48137. default:
  48138. l.depthFunc(l.LEQUAL)
  48139. }
  48140. else l.depthFunc(l.LEQUAL)
  48141. A = e
  48142. }
  48143. }),
  48144. (this.setDepthTest = function (e) {
  48145. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  48146. }),
  48147. (this.setDepthWrite = function (e) {
  48148. C !== e && (l.depthMask(e), (C = e))
  48149. }),
  48150. (this.setColorWrite = function (e) {
  48151. I !== e && (l.colorMask(e, e, e, e), (I = e))
  48152. }),
  48153. (this.setStencilFunc = function (e, t, i) {
  48154. ;(_ === e && b === t && w === i) || (l.stencilFunc(e, t, i), (_ = e), (b = t), (w = i))
  48155. }),
  48156. (this.setStencilOp = function (e, t, i) {
  48157. ;(T === e && x === t && S === i) || (l.stencilOp(e, t, i), (T = e), (x = t), (S = i))
  48158. }),
  48159. (this.setStencilTest = function (e) {
  48160. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  48161. }),
  48162. (this.setStencilWrite = function (e) {
  48163. E !== e && (l.stencilMask(e), (E = e))
  48164. }),
  48165. (this.setFlipSided = function (e) {
  48166. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW), (M = e))
  48167. }),
  48168. (this.setLineWidth = function (e) {
  48169. e !== R && (l.lineWidth(e), (R = e))
  48170. }),
  48171. (this.setPolygonOffset = function (e, t, i) {
  48172. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL), !e || (P === t && O === i) || (l.polygonOffset(t, i), (P = t), (O = i))
  48173. }),
  48174. (this.getScissorTest = function () {
  48175. return L
  48176. }),
  48177. (this.setScissorTest = function (e) {
  48178. ;(L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  48179. }),
  48180. (this.activeTexture = function (e) {
  48181. void 0 === e && (e = l.TEXTURE0 + D - 1), N !== e && (l.activeTexture(e), (N = e))
  48182. }),
  48183. (this.bindTexture = function (e, t) {
  48184. void 0 === N && n.activeTexture()
  48185. var i = F[N]
  48186. void 0 === i &&
  48187. ((i = {
  48188. type: void 0,
  48189. texture: void 0
  48190. }),
  48191. (F[N] = i)),
  48192. (i.type === e && i.texture === t) || (l.bindTexture(e, t || z), (i.type = e), (i.texture = t))
  48193. }),
  48194. (this.compressedTexImage2D = function () {
  48195. try {
  48196. l.compressedTexImage2D.apply(l, arguments)
  48197. } catch (e) {
  48198. console.error(e)
  48199. }
  48200. }),
  48201. (this.texImage2D = function () {
  48202. try {
  48203. l.texImage2D.apply(l, arguments)
  48204. } catch (e) {
  48205. console.error(e)
  48206. }
  48207. }),
  48208. (this.clearColor = function (e, t, i, n) {
  48209. r.set(e, t, i, n), !1 === B.equals(r) && (l.clearColor(e, t, i, n), B.copy(r))
  48210. }),
  48211. (this.clearDepth = function (e) {
  48212. V !== e && (l.clearDepth(e), (V = e))
  48213. }),
  48214. (this.clearStencil = function (e) {
  48215. k !== e && (l.clearStencil(e), (k = e))
  48216. }),
  48217. (this.scissor = function (e) {
  48218. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w), U.copy(e))
  48219. }),
  48220. (this.viewport = function (e) {
  48221. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w), H.copy(e))
  48222. }),
  48223. (this.reset = function () {
  48224. for (var e = 0; e < a.length; e++) 1 === a[e] && (l.disableVertexAttribArray(e), (a[e] = 0))
  48225. ;(t = {}), (N = void 0), (F = {}), (M = E = C = I = u = h = null)
  48226. })
  48227. }),
  48228. (Ci.LensFlarePlugin = function (v, y) {
  48229. function A() {
  48230. var e,
  48231. t = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1]),
  48232. i = new Uint16Array([0, 1, 2, 0, 2, 3])
  48233. ;(C = S.createBuffer()),
  48234. (I = S.createBuffer()),
  48235. S.bindBuffer(S.ARRAY_BUFFER, C),
  48236. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  48237. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  48238. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  48239. (T = S.createTexture()),
  48240. (x = S.createTexture()),
  48241. M.bindTexture(S.TEXTURE_2D, T),
  48242. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  48243. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  48244. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  48245. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  48246. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  48247. M.bindTexture(S.TEXTURE_2D, x),
  48248. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  48249. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  48250. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  48251. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  48252. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  48253. (e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS))
  48254. ? {
  48255. vertexShader: [
  48256. 'uniform lowp int renderType;',
  48257. 'uniform vec3 screenPosition;',
  48258. 'uniform vec2 scale;',
  48259. 'uniform float rotation;',
  48260. 'uniform sampler2D occlusionMap;',
  48261. 'attribute vec2 position;',
  48262. 'attribute vec2 uv;',
  48263. 'varying vec2 vUV;',
  48264. 'varying float vVisibility;',
  48265. 'void main() {',
  48266. 'vUV = uv;',
  48267. 'vec2 pos = position;',
  48268. 'if ( renderType == 2 ) {',
  48269. 'vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );',
  48270. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );',
  48271. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );',
  48272. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );',
  48273. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );',
  48274. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );',
  48275. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );',
  48276. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );',
  48277. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );',
  48278. 'vVisibility = visibility.r / 9.0;',
  48279. 'vVisibility *= 1.0 - visibility.g / 9.0;',
  48280. 'vVisibility *= visibility.b / 9.0;',
  48281. 'vVisibility *= 1.0 - visibility.a / 9.0;',
  48282. 'pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;',
  48283. 'pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;',
  48284. '}',
  48285. 'gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );',
  48286. '}'
  48287. ].join('\n'),
  48288. fragmentShader: [
  48289. 'uniform lowp int renderType;',
  48290. 'uniform sampler2D map;',
  48291. 'uniform float opacity;',
  48292. 'uniform vec3 color;',
  48293. 'varying vec2 vUV;',
  48294. 'varying float vVisibility;',
  48295. 'void main() {',
  48296. 'if ( renderType == 0 ) {',
  48297. 'gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );',
  48298. '} else if ( renderType == 1 ) {',
  48299. 'gl_FragColor = texture2D( map, vUV );',
  48300. '} else {',
  48301. 'vec4 texture = texture2D( map, vUV );',
  48302. 'texture.a *= opacity * vVisibility;',
  48303. 'gl_FragColor = texture;',
  48304. 'gl_FragColor.rgb *= color;',
  48305. '}',
  48306. '}'
  48307. ].join('\n')
  48308. }
  48309. : {
  48310. vertexShader: [
  48311. 'uniform lowp int renderType;',
  48312. 'uniform vec3 screenPosition;',
  48313. 'uniform vec2 scale;',
  48314. 'uniform float rotation;',
  48315. 'attribute vec2 position;',
  48316. 'attribute vec2 uv;',
  48317. 'varying vec2 vUV;',
  48318. 'void main() {',
  48319. 'vUV = uv;',
  48320. 'vec2 pos = position;',
  48321. 'if ( renderType == 2 ) {',
  48322. 'pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;',
  48323. 'pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;',
  48324. '}',
  48325. 'gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );',
  48326. '}'
  48327. ].join('\n'),
  48328. fragmentShader: [
  48329. 'precision mediump float;',
  48330. 'uniform lowp int renderType;',
  48331. 'uniform sampler2D map;',
  48332. 'uniform sampler2D occlusionMap;',
  48333. 'uniform float opacity;',
  48334. 'uniform vec3 color;',
  48335. 'varying vec2 vUV;',
  48336. 'void main() {',
  48337. 'if ( renderType == 0 ) {',
  48338. 'gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );',
  48339. '} else if ( renderType == 1 ) {',
  48340. 'gl_FragColor = texture2D( map, vUV );',
  48341. '} else {',
  48342. 'float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;',
  48343. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;',
  48344. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;',
  48345. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;',
  48346. 'visibility = ( 1.0 - visibility / 4.0 );',
  48347. 'vec4 texture = texture2D( map, vUV );',
  48348. 'texture.a *= opacity * visibility;',
  48349. 'gl_FragColor = texture;',
  48350. 'gl_FragColor.rgb *= color;',
  48351. '}',
  48352. '}'
  48353. ].join('\n')
  48354. }),
  48355. (E = (function (e) {
  48356. var t = S.createProgram(),
  48357. i = S.createShader(S.FRAGMENT_SHADER),
  48358. n = S.createShader(S.VERTEX_SHADER),
  48359. r = 'precision ' + v.getPrecision() + ' float;\n'
  48360. return (
  48361. S.shaderSource(i, r + e.fragmentShader),
  48362. S.shaderSource(n, r + e.vertexShader),
  48363. S.compileShader(i),
  48364. S.compileShader(n),
  48365. S.attachShader(t, i),
  48366. S.attachShader(t, n),
  48367. S.linkProgram(t),
  48368. t
  48369. )
  48370. })(e)),
  48371. (_ = {
  48372. vertex: S.getAttribLocation(E, 'position'),
  48373. uv: S.getAttribLocation(E, 'uv')
  48374. }),
  48375. (b = {
  48376. renderType: S.getUniformLocation(E, 'renderType'),
  48377. map: S.getUniformLocation(E, 'map'),
  48378. occlusionMap: S.getUniformLocation(E, 'occlusionMap'),
  48379. opacity: S.getUniformLocation(E, 'opacity'),
  48380. color: S.getUniformLocation(E, 'color'),
  48381. scale: S.getUniformLocation(E, 'scale'),
  48382. rotation: S.getUniformLocation(E, 'rotation'),
  48383. screenPosition: S.getUniformLocation(E, 'screenPosition')
  48384. })
  48385. }
  48386. var C,
  48387. I,
  48388. E,
  48389. _,
  48390. b,
  48391. w,
  48392. T,
  48393. x,
  48394. S = v.context,
  48395. M = v.state
  48396. this.render = function (e, t, i) {
  48397. if (0 !== y.length) {
  48398. var n = new Ci.Vector3(),
  48399. r = i.w / i.z,
  48400. o = 0.5 * i.z,
  48401. a = 0.5 * i.w,
  48402. s = 16 / i.w,
  48403. l = new Ci.Vector2(s * r, s),
  48404. c = new Ci.Vector3(1, 1, 0),
  48405. h = new Ci.Vector2(1, 1)
  48406. void 0 === E && A(),
  48407. S.useProgram(E),
  48408. M.initAttributes(),
  48409. M.enableAttribute(_.vertex),
  48410. M.enableAttribute(_.uv),
  48411. M.disableUnusedAttributes(),
  48412. S.uniform1i(b.occlusionMap, 0),
  48413. S.uniform1i(b.map, 1),
  48414. S.bindBuffer(S.ARRAY_BUFFER, C),
  48415. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  48416. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  48417. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  48418. M.disable(S.CULL_FACE),
  48419. M.setDepthWrite(!1)
  48420. for (var u = 0, d = y.length; u < d; u++) {
  48421. ;(s = 16 / i.w), l.set(s * r, s)
  48422. var p = y[u]
  48423. if (
  48424. (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  48425. n.applyMatrix4(t.matrixWorldInverse),
  48426. n.applyProjection(t.projectionMatrix),
  48427. c.copy(n),
  48428. (h.x = c.x * o + o),
  48429. (h.y = c.y * a + a),
  48430. w || (0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w))
  48431. ) {
  48432. M.activeTexture(S.TEXTURE0),
  48433. M.bindTexture(S.TEXTURE_2D, null),
  48434. M.activeTexture(S.TEXTURE1),
  48435. M.bindTexture(S.TEXTURE_2D, T),
  48436. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  48437. S.uniform1i(b.renderType, 0),
  48438. S.uniform2f(b.scale, l.x, l.y),
  48439. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  48440. M.disable(S.BLEND),
  48441. M.enable(S.DEPTH_TEST),
  48442. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  48443. M.activeTexture(S.TEXTURE0),
  48444. M.bindTexture(S.TEXTURE_2D, x),
  48445. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  48446. S.uniform1i(b.renderType, 1),
  48447. M.disable(S.DEPTH_TEST),
  48448. M.activeTexture(S.TEXTURE1),
  48449. M.bindTexture(S.TEXTURE_2D, T),
  48450. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  48451. p.positionScreen.copy(c),
  48452. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  48453. S.uniform1i(b.renderType, 2),
  48454. M.enable(S.BLEND)
  48455. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  48456. var m = p.lensFlares[f]
  48457. 0.001 < m.opacity &&
  48458. 0.001 < m.scale &&
  48459. ((c.x = m.x),
  48460. (c.y = m.y),
  48461. (c.z = m.z),
  48462. (s = (m.size * m.scale) / i.w),
  48463. (l.x = s * r),
  48464. (l.y = s),
  48465. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  48466. S.uniform2f(b.scale, l.x, l.y),
  48467. S.uniform1f(b.rotation, m.rotation),
  48468. S.uniform1f(b.opacity, m.opacity),
  48469. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  48470. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  48471. v.setTexture(m.texture, 1),
  48472. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  48473. }
  48474. }
  48475. }
  48476. M.enable(S.CULL_FACE), M.enable(S.DEPTH_TEST), M.setDepthWrite(!0), v.resetGLState()
  48477. }
  48478. }
  48479. }),
  48480. (Ci.SpritePlugin = function (u, d) {
  48481. function p() {
  48482. var e = new Float32Array([-0.5, -0.5, 0, 0, 0.5, -0.5, 1, 0, 0.5, 0.5, 1, 1, -0.5, 0.5, 0, 1]),
  48483. t = new Uint16Array([0, 1, 2, 0, 2, 3])
  48484. ;(g = I.createBuffer()),
  48485. (m = I.createBuffer()),
  48486. I.bindBuffer(I.ARRAY_BUFFER, g),
  48487. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  48488. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  48489. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  48490. (v = (function () {
  48491. var e = I.createProgram(),
  48492. t = I.createShader(I.VERTEX_SHADER),
  48493. i = I.createShader(I.FRAGMENT_SHADER)
  48494. return (
  48495. I.shaderSource(
  48496. t,
  48497. [
  48498. 'precision ' + u.getPrecision() + ' float;',
  48499. 'uniform mat4 modelViewMatrix;',
  48500. 'uniform mat4 projectionMatrix;',
  48501. 'uniform float rotation;',
  48502. 'uniform vec2 scale;',
  48503. 'uniform vec2 uvOffset;',
  48504. 'uniform vec2 uvScale;',
  48505. 'attribute vec2 position;',
  48506. 'attribute vec2 uv;',
  48507. 'varying vec2 vUV;',
  48508. 'void main() {',
  48509. 'vUV = uvOffset + uv * uvScale;',
  48510. 'vec2 alignedPosition = position * scale;',
  48511. 'vec2 rotatedPosition;',
  48512. 'rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;',
  48513. 'rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;',
  48514. 'vec4 finalPosition;',
  48515. 'finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );',
  48516. 'finalPosition.xy += rotatedPosition;',
  48517. 'finalPosition = projectionMatrix * finalPosition;',
  48518. 'gl_Position = finalPosition;',
  48519. '}'
  48520. ].join('\n')
  48521. ),
  48522. I.shaderSource(
  48523. i,
  48524. [
  48525. 'precision ' + u.getPrecision() + ' float;',
  48526. 'uniform vec3 color;',
  48527. 'uniform sampler2D map;',
  48528. 'uniform float opacity;',
  48529. 'uniform int fogType;',
  48530. 'uniform vec3 fogColor;',
  48531. 'uniform float fogDensity;',
  48532. 'uniform float fogNear;',
  48533. 'uniform float fogFar;',
  48534. 'uniform float alphaTest;',
  48535. 'varying vec2 vUV;',
  48536. 'void main() {',
  48537. 'vec4 texture = texture2D( map, vUV );',
  48538. 'if ( texture.a < alphaTest ) discard;',
  48539. 'gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );',
  48540. 'if ( fogType > 0 ) {',
  48541. 'float depth = gl_FragCoord.z / gl_FragCoord.w;',
  48542. 'float fogFactor = 0.0;',
  48543. 'if ( fogType == 1 ) {',
  48544. 'fogFactor = smoothstep( fogNear, fogFar, depth );',
  48545. '} else {',
  48546. 'const float LOG2 = 1.442695;',
  48547. 'fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );',
  48548. 'fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );',
  48549. '}',
  48550. 'gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );',
  48551. '}',
  48552. '}'
  48553. ].join('\n')
  48554. ),
  48555. I.compileShader(t),
  48556. I.compileShader(i),
  48557. I.attachShader(e, t),
  48558. I.attachShader(e, i),
  48559. I.linkProgram(e),
  48560. e
  48561. )
  48562. })()),
  48563. (y = {
  48564. position: I.getAttribLocation(v, 'position'),
  48565. uv: I.getAttribLocation(v, 'uv')
  48566. }),
  48567. (A = {
  48568. uvOffset: I.getUniformLocation(v, 'uvOffset'),
  48569. uvScale: I.getUniformLocation(v, 'uvScale'),
  48570. rotation: I.getUniformLocation(v, 'rotation'),
  48571. scale: I.getUniformLocation(v, 'scale'),
  48572. color: I.getUniformLocation(v, 'color'),
  48573. map: I.getUniformLocation(v, 'map'),
  48574. opacity: I.getUniformLocation(v, 'opacity'),
  48575. modelViewMatrix: I.getUniformLocation(v, 'modelViewMatrix'),
  48576. projectionMatrix: I.getUniformLocation(v, 'projectionMatrix'),
  48577. fogType: I.getUniformLocation(v, 'fogType'),
  48578. fogDensity: I.getUniformLocation(v, 'fogDensity'),
  48579. fogNear: I.getUniformLocation(v, 'fogNear'),
  48580. fogFar: I.getUniformLocation(v, 'fogFar'),
  48581. fogColor: I.getUniformLocation(v, 'fogColor'),
  48582. alphaTest: I.getUniformLocation(v, 'alphaTest')
  48583. })
  48584. var i = document.createElement('canvas')
  48585. ;(i.width = 8), (i.height = 8)
  48586. var n = i.getContext('2d')
  48587. ;(n.fillStyle = 'white'), n.fillRect(0, 0, 8, 8), ((C = new Ci.Texture(i)).needsUpdate = !0)
  48588. }
  48589. function f(e, t) {
  48590. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  48591. }
  48592. var g,
  48593. m,
  48594. v,
  48595. y,
  48596. A,
  48597. C,
  48598. I = u.context,
  48599. E = u.state,
  48600. _ = new Ci.Vector3(),
  48601. b = new Ci.Quaternion(),
  48602. w = new Ci.Vector3()
  48603. this.render = function (e, t) {
  48604. if (0 !== d.length) {
  48605. void 0 === v && p(),
  48606. I.useProgram(v),
  48607. E.initAttributes(),
  48608. E.enableAttribute(y.position),
  48609. E.enableAttribute(y.uv),
  48610. E.disableUnusedAttributes(),
  48611. E.disable(I.CULL_FACE),
  48612. E.enable(I.BLEND),
  48613. I.bindBuffer(I.ARRAY_BUFFER, g),
  48614. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  48615. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  48616. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  48617. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  48618. E.activeTexture(I.TEXTURE0),
  48619. I.uniform1i(A.map, 0)
  48620. var i = 0,
  48621. n = 0,
  48622. r = e.fog
  48623. r
  48624. ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  48625. r instanceof Ci.Fog
  48626. ? (I.uniform1f(A.fogNear, r.near), I.uniform1f(A.fogFar, r.far), I.uniform1i(A.fogType, 1), (n = i = 1))
  48627. : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density), I.uniform1i(A.fogType, 2), (n = i = 2)))
  48628. : (I.uniform1i(A.fogType, 0), (n = i = 0))
  48629. for (var o = 0, a = d.length; o < a; o++) {
  48630. ;(l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld), (l.z = -l.modelViewMatrix.elements[14])
  48631. }
  48632. d.sort(f)
  48633. var s = []
  48634. for (o = 0, a = d.length; o < a; o++) {
  48635. var l,
  48636. c = (l = d[o]).material
  48637. I.uniform1f(A.alphaTest, c.alphaTest), I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements), l.matrixWorld.decompose(_, b, w), (s[0] = w.x), (s[1] = w.y)
  48638. var h = 0
  48639. e.fog && c.fog && (h = n),
  48640. i !== h && (I.uniform1i(A.fogType, h), (i = h)),
  48641. null !== c.map
  48642. ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y), I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y))
  48643. : (I.uniform2f(A.uvOffset, 0, 0), I.uniform2f(A.uvScale, 1, 1)),
  48644. I.uniform1f(A.opacity, c.opacity),
  48645. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  48646. I.uniform1f(A.rotation, c.rotation),
  48647. I.uniform2fv(A.scale, s),
  48648. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  48649. E.setDepthTest(c.depthTest),
  48650. E.setDepthWrite(c.depthWrite),
  48651. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  48652. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  48653. }
  48654. E.enable(I.CULL_FACE), u.resetGLState()
  48655. }
  48656. }
  48657. }),
  48658. Object.defineProperties(Ci.Box2.prototype, {
  48659. empty: {
  48660. value: function () {
  48661. return console.warn('THREE.Box2: .empty() has been renamed to .isEmpty().'), this.isEmpty()
  48662. }
  48663. },
  48664. isIntersectionBox: {
  48665. value: function (e) {
  48666. return console.warn('THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().'), this.intersectsBox(e)
  48667. }
  48668. }
  48669. }),
  48670. Object.defineProperties(Ci.Box3.prototype, {
  48671. empty: {
  48672. value: function () {
  48673. return console.warn('THREE.Box3: .empty() has been renamed to .isEmpty().'), this.isEmpty()
  48674. }
  48675. },
  48676. isIntersectionBox: {
  48677. value: function (e) {
  48678. return console.warn('THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().'), this.intersectsBox(e)
  48679. }
  48680. },
  48681. isIntersectionSphere: {
  48682. value: function (e) {
  48683. return console.warn('THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().'), this.intersectsSphere(e)
  48684. }
  48685. }
  48686. }),
  48687. Object.defineProperties(Ci.Matrix3.prototype, {
  48688. multiplyVector3: {
  48689. value: function (e) {
  48690. return console.warn('THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.'), e.applyMatrix3(this)
  48691. }
  48692. },
  48693. multiplyVector3Array: {
  48694. value: function (e) {
  48695. return console.warn('THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.'), this.applyToVector3Array(e)
  48696. }
  48697. }
  48698. }),
  48699. Object.defineProperties(Ci.Matrix4.prototype, {
  48700. extractPosition: {
  48701. value: function (e) {
  48702. return console.warn('THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().'), this.copyPosition(e)
  48703. }
  48704. },
  48705. setRotationFromQuaternion: {
  48706. value: function (e) {
  48707. return console.warn('THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().'), this.makeRotationFromQuaternion(e)
  48708. }
  48709. },
  48710. multiplyVector3: {
  48711. value: function (e) {
  48712. return console.warn('THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.'), e.applyProjection(this)
  48713. }
  48714. },
  48715. multiplyVector4: {
  48716. value: function (e) {
  48717. return console.warn('THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.'), e.applyMatrix4(this)
  48718. }
  48719. },
  48720. multiplyVector3Array: {
  48721. value: function (e) {
  48722. return console.warn('THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.'), this.applyToVector3Array(e)
  48723. }
  48724. },
  48725. rotateAxis: {
  48726. value: function (e) {
  48727. console.warn('THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.'), e.transformDirection(this)
  48728. }
  48729. },
  48730. crossVector: {
  48731. value: function (e) {
  48732. return console.warn('THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.'), e.applyMatrix4(this)
  48733. }
  48734. },
  48735. translate: {
  48736. value: function (e) {
  48737. console.error('THREE.Matrix4: .translate() has been removed.')
  48738. }
  48739. },
  48740. rotateX: {
  48741. value: function (e) {
  48742. console.error('THREE.Matrix4: .rotateX() has been removed.')
  48743. }
  48744. },
  48745. rotateY: {
  48746. value: function (e) {
  48747. console.error('THREE.Matrix4: .rotateY() has been removed.')
  48748. }
  48749. },
  48750. rotateZ: {
  48751. value: function (e) {
  48752. console.error('THREE.Matrix4: .rotateZ() has been removed.')
  48753. }
  48754. },
  48755. rotateByAxis: {
  48756. value: function (e, t) {
  48757. console.error('THREE.Matrix4: .rotateByAxis() has been removed.')
  48758. }
  48759. }
  48760. }),
  48761. Object.defineProperties(Ci.Plane.prototype, {
  48762. isIntersectionLine: {
  48763. value: function (e) {
  48764. return console.warn('THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().'), this.intersectsLine(e)
  48765. }
  48766. }
  48767. }),
  48768. Object.defineProperties(Ci.Quaternion.prototype, {
  48769. multiplyVector3: {
  48770. value: function (e) {
  48771. return console.warn('THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.'), e.applyQuaternion(this)
  48772. }
  48773. }
  48774. }),
  48775. Object.defineProperties(Ci.Ray.prototype, {
  48776. isIntersectionBox: {
  48777. value: function (e) {
  48778. return console.warn('THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().'), this.intersectsBox(e)
  48779. }
  48780. },
  48781. isIntersectionPlane: {
  48782. value: function (e) {
  48783. return console.warn('THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().'), this.intersectsPlane(e)
  48784. }
  48785. },
  48786. isIntersectionSphere: {
  48787. value: function (e) {
  48788. return console.warn('THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().'), this.intersectsSphere(e)
  48789. }
  48790. }
  48791. }),
  48792. Object.defineProperties(Ci.Vector3.prototype, {
  48793. setEulerFromRotationMatrix: {
  48794. value: function () {
  48795. console.error('THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.')
  48796. }
  48797. },
  48798. setEulerFromQuaternion: {
  48799. value: function () {
  48800. console.error('THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.')
  48801. }
  48802. },
  48803. getPositionFromMatrix: {
  48804. value: function (e) {
  48805. return console.warn('THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().'), this.setFromMatrixPosition(e)
  48806. }
  48807. },
  48808. getScaleFromMatrix: {
  48809. value: function (e) {
  48810. return console.warn('THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().'), this.setFromMatrixScale(e)
  48811. }
  48812. },
  48813. getColumnFromMatrix: {
  48814. value: function (e, t) {
  48815. return console.warn('THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().'), this.setFromMatrixColumn(e, t)
  48816. }
  48817. }
  48818. }),
  48819. (Ci.Face4 = function (e, t, i, n, r, o, a) {
  48820. return console.warn('THREE.Face4 has been removed. A THREE.Face3 will be created instead.'), new Ci.Face3(e, t, i, r, o, a)
  48821. }),
  48822. (Ci.Vertex = function (e, t, i) {
  48823. return console.warn('THREE.Vertex has been removed. Use THREE.Vector3 instead.'), new Ci.Vector3(e, t, i)
  48824. }),
  48825. Object.defineProperties(Ci.Object3D.prototype, {
  48826. eulerOrder: {
  48827. get: function () {
  48828. return console.warn('THREE.Object3D: .eulerOrder is now .rotation.order.'), this.rotation.order
  48829. },
  48830. set: function (e) {
  48831. console.warn('THREE.Object3D: .eulerOrder is now .rotation.order.'), (this.rotation.order = e)
  48832. }
  48833. },
  48834. getChildByName: {
  48835. value: function (e) {
  48836. return console.warn('THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().'), this.getObjectByName(e)
  48837. }
  48838. },
  48839. renderDepth: {
  48840. set: function (e) {
  48841. console.warn('THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.')
  48842. }
  48843. },
  48844. translate: {
  48845. value: function (e, t) {
  48846. return console.warn('THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.'), this.translateOnAxis(t, e)
  48847. }
  48848. },
  48849. useQuaternion: {
  48850. get: function () {
  48851. console.warn('THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.')
  48852. },
  48853. set: function (e) {
  48854. console.warn('THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.')
  48855. }
  48856. }
  48857. }),
  48858. Object.defineProperties(Ci, {
  48859. PointCloud: {
  48860. value: function (e, t) {
  48861. return console.warn('THREE.PointCloud has been renamed to THREE.Points.'), new Ci.Points(e, t)
  48862. }
  48863. },
  48864. ParticleSystem: {
  48865. value: function (e, t) {
  48866. return console.warn('THREE.ParticleSystem has been renamed to THREE.Points.'), new Ci.Points(e, t)
  48867. }
  48868. }
  48869. }),
  48870. Object.defineProperties(Ci.Light.prototype, {
  48871. onlyShadow: {
  48872. set: function (e) {
  48873. console.warn('THREE.Light: .onlyShadow has been removed.')
  48874. }
  48875. },
  48876. shadowCameraFov: {
  48877. set: function (e) {
  48878. console.warn('THREE.Light: .shadowCameraFov is now .shadow.camera.fov.'), (this.shadow.camera.fov = e)
  48879. }
  48880. },
  48881. shadowCameraLeft: {
  48882. set: function (e) {
  48883. console.warn('THREE.Light: .shadowCameraLeft is now .shadow.camera.left.'), (this.shadow.camera.left = e)
  48884. }
  48885. },
  48886. shadowCameraRight: {
  48887. set: function (e) {
  48888. console.warn('THREE.Light: .shadowCameraRight is now .shadow.camera.right.'), (this.shadow.camera.right = e)
  48889. }
  48890. },
  48891. shadowCameraTop: {
  48892. set: function (e) {
  48893. console.warn('THREE.Light: .shadowCameraTop is now .shadow.camera.top.'), (this.shadow.camera.top = e)
  48894. }
  48895. },
  48896. shadowCameraBottom: {
  48897. set: function (e) {
  48898. console.warn('THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.'), (this.shadow.camera.bottom = e)
  48899. }
  48900. },
  48901. shadowCameraNear: {
  48902. set: function (e) {
  48903. console.warn('THREE.Light: .shadowCameraNear is now .shadow.camera.near.'), (this.shadow.camera.near = e)
  48904. }
  48905. },
  48906. shadowCameraFar: {
  48907. set: function (e) {
  48908. console.warn('THREE.Light: .shadowCameraFar is now .shadow.camera.far.'), (this.shadow.camera.far = e)
  48909. }
  48910. },
  48911. shadowCameraVisible: {
  48912. set: function (e) {
  48913. console.warn('THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.')
  48914. }
  48915. },
  48916. shadowBias: {
  48917. set: function (e) {
  48918. console.warn('THREE.Light: .shadowBias is now .shadow.bias.'), (this.shadow.bias = e)
  48919. }
  48920. },
  48921. shadowDarkness: {
  48922. set: function (e) {
  48923. console.warn('THREE.Light: .shadowDarkness has been removed.')
  48924. }
  48925. },
  48926. shadowMapWidth: {
  48927. set: function (e) {
  48928. console.warn('THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.'), (this.shadow.mapSize.width = e)
  48929. }
  48930. },
  48931. shadowMapHeight: {
  48932. set: function (e) {
  48933. console.warn('THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.'), (this.shadow.mapSize.height = e)
  48934. }
  48935. }
  48936. }),
  48937. Object.defineProperties(Ci.BufferAttribute.prototype, {
  48938. length: {
  48939. get: function () {
  48940. return console.warn('THREE.BufferAttribute: .length has been deprecated. Please use .count.'), this.array.length
  48941. }
  48942. }
  48943. }),
  48944. Object.defineProperties(Ci.BufferGeometry.prototype, {
  48945. drawcalls: {
  48946. get: function () {
  48947. return console.error('THREE.BufferGeometry: .drawcalls has been renamed to .groups.'), this.groups
  48948. }
  48949. },
  48950. offsets: {
  48951. get: function () {
  48952. return console.warn('THREE.BufferGeometry: .offsets has been renamed to .groups.'), this.groups
  48953. }
  48954. },
  48955. addIndex: {
  48956. value: function (e) {
  48957. console.warn('THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().'), this.setIndex(e)
  48958. }
  48959. },
  48960. addDrawCall: {
  48961. value: function (e, t, i) {
  48962. void 0 !== i && console.warn('THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.'),
  48963. console.warn('THREE.BufferGeometry: .addDrawCall() is now .addGroup().'),
  48964. this.addGroup(e, t)
  48965. }
  48966. },
  48967. clearDrawCalls: {
  48968. value: function () {
  48969. console.warn('THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().'), this.clearGroups()
  48970. }
  48971. },
  48972. computeTangents: {
  48973. value: function () {
  48974. console.warn('THREE.BufferGeometry: .computeTangents() has been removed.')
  48975. }
  48976. },
  48977. computeOffsets: {
  48978. value: function () {
  48979. console.warn('THREE.BufferGeometry: .computeOffsets() has been removed.')
  48980. }
  48981. }
  48982. }),
  48983. Object.defineProperties(Ci.Material.prototype, {
  48984. wrapAround: {
  48985. get: function () {
  48986. console.warn('THREE.' + this.type + ': .wrapAround has been removed.')
  48987. },
  48988. set: function (e) {
  48989. console.warn('THREE.' + this.type + ': .wrapAround has been removed.')
  48990. }
  48991. },
  48992. wrapRGB: {
  48993. get: function () {
  48994. return console.warn('THREE.' + this.type + ': .wrapRGB has been removed.'), new Ci.Color()
  48995. }
  48996. }
  48997. }),
  48998. Object.defineProperties(Ci, {
  48999. PointCloudMaterial: {
  49000. value: function (e) {
  49001. return console.warn('THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.'), new Ci.PointsMaterial(e)
  49002. }
  49003. },
  49004. ParticleBasicMaterial: {
  49005. value: function (e) {
  49006. return console.warn('THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.'), new Ci.PointsMaterial(e)
  49007. }
  49008. },
  49009. ParticleSystemMaterial: {
  49010. value: function (e) {
  49011. return console.warn('THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.'), new Ci.PointsMaterial(e)
  49012. }
  49013. }
  49014. }),
  49015. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  49016. metal: {
  49017. get: function () {
  49018. return console.warn('THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.'), !1
  49019. },
  49020. set: function (e) {
  49021. console.warn('THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead')
  49022. }
  49023. }
  49024. }),
  49025. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  49026. derivatives: {
  49027. get: function () {
  49028. return console.warn('THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.'), this.extensions.derivatives
  49029. },
  49030. set: function (e) {
  49031. console.warn('THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.'), (this.extensions.derivatives = e)
  49032. }
  49033. }
  49034. }),
  49035. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  49036. supportsFloatTextures: {
  49037. value: function () {
  49038. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."), this.extensions.get('OES_texture_float')
  49039. }
  49040. },
  49041. supportsHalfFloatTextures: {
  49042. value: function () {
  49043. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."), this.extensions.get('OES_texture_half_float')
  49044. }
  49045. },
  49046. supportsStandardDerivatives: {
  49047. value: function () {
  49048. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."), this.extensions.get('OES_standard_derivatives')
  49049. }
  49050. },
  49051. supportsCompressedTextureS3TC: {
  49052. value: function () {
  49053. return (
  49054. console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  49055. this.extensions.get('WEBGL_compressed_texture_s3tc')
  49056. )
  49057. }
  49058. },
  49059. supportsCompressedTexturePVRTC: {
  49060. value: function () {
  49061. return (
  49062. console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  49063. this.extensions.get('WEBGL_compressed_texture_pvrtc')
  49064. )
  49065. }
  49066. },
  49067. supportsBlendMinMax: {
  49068. value: function () {
  49069. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."), this.extensions.get('EXT_blend_minmax')
  49070. }
  49071. },
  49072. supportsVertexTextures: {
  49073. value: function () {
  49074. return this.capabilities.vertexTextures
  49075. }
  49076. },
  49077. supportsInstancedArrays: {
  49078. value: function () {
  49079. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."), this.extensions.get('ANGLE_instanced_arrays')
  49080. }
  49081. },
  49082. enableScissorTest: {
  49083. value: function (e) {
  49084. console.warn('THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().'), this.setScissorTest(e)
  49085. }
  49086. },
  49087. initMaterial: {
  49088. value: function () {
  49089. console.warn('THREE.WebGLRenderer: .initMaterial() has been removed.')
  49090. }
  49091. },
  49092. addPrePlugin: {
  49093. value: function () {
  49094. console.warn('THREE.WebGLRenderer: .addPrePlugin() has been removed.')
  49095. }
  49096. },
  49097. addPostPlugin: {
  49098. value: function () {
  49099. console.warn('THREE.WebGLRenderer: .addPostPlugin() has been removed.')
  49100. }
  49101. },
  49102. updateShadowMap: {
  49103. value: function () {
  49104. console.warn('THREE.WebGLRenderer: .updateShadowMap() has been removed.')
  49105. }
  49106. },
  49107. shadowMapEnabled: {
  49108. get: function () {
  49109. return this.shadowMap.enabled
  49110. },
  49111. set: function (e) {
  49112. console.warn('THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.'), (this.shadowMap.enabled = e)
  49113. }
  49114. },
  49115. shadowMapType: {
  49116. get: function () {
  49117. return this.shadowMap.type
  49118. },
  49119. set: function (e) {
  49120. console.warn('THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.'), (this.shadowMap.type = e)
  49121. }
  49122. },
  49123. shadowMapCullFace: {
  49124. get: function () {
  49125. return this.shadowMap.cullFace
  49126. },
  49127. set: function (e) {
  49128. console.warn('THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.'), (this.shadowMap.cullFace = e)
  49129. }
  49130. }
  49131. }),
  49132. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  49133. wrapS: {
  49134. get: function () {
  49135. return console.warn('THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.'), this.texture.wrapS
  49136. },
  49137. set: function (e) {
  49138. console.warn('THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.'), (this.texture.wrapS = e)
  49139. }
  49140. },
  49141. wrapT: {
  49142. get: function () {
  49143. return console.warn('THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.'), this.texture.wrapT
  49144. },
  49145. set: function (e) {
  49146. console.warn('THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.'), (this.texture.wrapT = e)
  49147. }
  49148. },
  49149. magFilter: {
  49150. get: function () {
  49151. return console.warn('THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.'), this.texture.magFilter
  49152. },
  49153. set: function (e) {
  49154. console.warn('THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.'), (this.texture.magFilter = e)
  49155. }
  49156. },
  49157. minFilter: {
  49158. get: function () {
  49159. return console.warn('THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.'), this.texture.minFilter
  49160. },
  49161. set: function (e) {
  49162. console.warn('THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.'), (this.texture.minFilter = e)
  49163. }
  49164. },
  49165. anisotropy: {
  49166. get: function () {
  49167. return console.warn('THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.'), this.texture.anisotropy
  49168. },
  49169. set: function (e) {
  49170. console.warn('THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.'), (this.texture.anisotropy = e)
  49171. }
  49172. },
  49173. offset: {
  49174. get: function () {
  49175. return console.warn('THREE.WebGLRenderTarget: .offset is now .texture.offset.'), this.texture.offset
  49176. },
  49177. set: function (e) {
  49178. console.warn('THREE.WebGLRenderTarget: .offset is now .texture.offset.'), (this.texture.offset = e)
  49179. }
  49180. },
  49181. repeat: {
  49182. get: function () {
  49183. return console.warn('THREE.WebGLRenderTarget: .repeat is now .texture.repeat.'), this.texture.repeat
  49184. },
  49185. set: function (e) {
  49186. console.warn('THREE.WebGLRenderTarget: .repeat is now .texture.repeat.'), (this.texture.repeat = e)
  49187. }
  49188. },
  49189. format: {
  49190. get: function () {
  49191. return console.warn('THREE.WebGLRenderTarget: .format is now .texture.format.'), this.texture.format
  49192. },
  49193. set: function (e) {
  49194. console.warn('THREE.WebGLRenderTarget: .format is now .texture.format.'), (this.texture.format = e)
  49195. }
  49196. },
  49197. type: {
  49198. get: function () {
  49199. return console.warn('THREE.WebGLRenderTarget: .type is now .texture.type.'), this.texture.type
  49200. },
  49201. set: function (e) {
  49202. console.warn('THREE.WebGLRenderTarget: .type is now .texture.type.'), (this.texture.type = e)
  49203. }
  49204. },
  49205. generateMipmaps: {
  49206. get: function () {
  49207. return console.warn('THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.'), this.texture.generateMipmaps
  49208. },
  49209. set: function (e) {
  49210. console.warn('THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.'), (this.texture.generateMipmaps = e)
  49211. }
  49212. }
  49213. }),
  49214. (Ci.GeometryUtils = {
  49215. merge: function (e, t, i) {
  49216. var n
  49217. console.warn('THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.'),
  49218. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(), (n = t.matrix), (t = t.geometry)),
  49219. e.merge(t, n, i)
  49220. },
  49221. center: function (e) {
  49222. return console.warn('THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.'), e.center()
  49223. }
  49224. }),
  49225. (Ci.ImageUtils = {
  49226. crossOrigin: void 0,
  49227. loadTexture: function (e, t, i, n) {
  49228. console.warn('THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.')
  49229. var r = new Ci.TextureLoader()
  49230. r.setCrossOrigin(this.crossOrigin)
  49231. var o = r.load(e, i, void 0, n)
  49232. return t && (o.mapping = t), o
  49233. },
  49234. loadTextureCube: function (e, t, i, n) {
  49235. console.warn('THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.')
  49236. var r = new Ci.CubeTextureLoader()
  49237. r.setCrossOrigin(this.crossOrigin)
  49238. var o = r.load(e, i, void 0, n)
  49239. return t && (o.mapping = t), o
  49240. },
  49241. loadCompressedTexture: function () {
  49242. console.error('THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.')
  49243. },
  49244. loadCompressedTextureCube: function () {
  49245. console.error('THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.')
  49246. }
  49247. }),
  49248. (Ci.Projector = function () {
  49249. console.error('THREE.Projector has been moved to /examples/js/renderers/Projector.js.'),
  49250. (this.projectVector = function (e, t) {
  49251. console.warn('THREE.Projector: .projectVector() is now vector.project().'), e.project(t)
  49252. }),
  49253. (this.unprojectVector = function (e, t) {
  49254. console.warn('THREE.Projector: .unprojectVector() is now vector.unproject().'), e.unproject(t)
  49255. }),
  49256. (this.pickingRay = function (e, t) {
  49257. console.error('THREE.Projector: .pickingRay() is now raycaster.setFromCamera().')
  49258. })
  49259. }),
  49260. (Ci.CanvasRenderer = function () {
  49261. console.error('THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js'),
  49262. (this.domElement = document.createElement('canvas')),
  49263. (this.clear = function () {}),
  49264. (this.render = function () {}),
  49265. (this.setClearColor = function () {}),
  49266. (this.setSize = function () {})
  49267. }),
  49268. (Ci.MeshFaceMaterial = Ci.MultiMaterial),
  49269. (Ci.CurveUtils = {
  49270. tangentQuadraticBezier: function (e, t, i, n) {
  49271. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  49272. },
  49273. tangentCubicBezier: function (e, t, i, n, r) {
  49274. return -3 * t * (1 - e) * (1 - e) + 3 * i * (1 - e) * (1 - e) - 6 * e * i * (1 - e) + 6 * e * n * (1 - e) - 3 * e * e * n + 3 * e * e * r
  49275. },
  49276. tangentSpline: function (e, t, i, n, r) {
  49277. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  49278. },
  49279. interpolate: function (e, t, i, n, r) {
  49280. var o = 0.5 * (i - e),
  49281. a = 0.5 * (n - t),
  49282. s = r * r
  49283. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  49284. }
  49285. }),
  49286. (Ci.SceneUtils = {
  49287. createMultiMaterialObject: function (e, t) {
  49288. for (var i = new Ci.Group(), n = 0, r = t.length; n < r; n++) i.add(new Ci.Mesh(e, t[n]))
  49289. return i
  49290. },
  49291. detach: function (e, t, i) {
  49292. e.applyMatrix(t.matrixWorld), t.remove(e), i.add(e)
  49293. },
  49294. attach: function (e, t, i) {
  49295. var n = new Ci.Matrix4()
  49296. n.getInverse(i.matrixWorld), e.applyMatrix(n), t.remove(e), i.add(e)
  49297. }
  49298. }),
  49299. (Ci.ShapeUtils = {
  49300. area: function (e) {
  49301. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++) i += e[n].x * e[r].y - e[r].x * e[n].y
  49302. return 0.5 * i
  49303. },
  49304. triangulate: function (e, t) {
  49305. var i = e.length
  49306. if (i < 3) return null
  49307. var n,
  49308. r,
  49309. o,
  49310. a = [],
  49311. s = [],
  49312. l = []
  49313. if (0 < Ci.ShapeUtils.area(e)) for (r = 0; r < i; r++) s[r] = r
  49314. else for (r = 0; r < i; r++) s[r] = i - 1 - r
  49315. var c = i,
  49316. h = 2 * c
  49317. for (r = c - 1; 2 < c; ) {
  49318. if (h-- <= 0) return console.warn('THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()'), t ? l : a
  49319. if ((c <= (n = r) && (n = 0), c <= (r = n + 1) && (r = 0), c <= (o = r + 1) && (o = 0), Si(e, n, r, o, c, s))) {
  49320. var u, d, p, f, g
  49321. for (u = s[n], d = s[r], p = s[o], a.push([e[u], e[d], e[p]]), l.push([s[n], s[r], s[o]]), g = (f = r) + 1; g < c; f++, g++) s[f] = s[g]
  49322. h = 2 * --c
  49323. }
  49324. }
  49325. return t ? l : a
  49326. },
  49327. triangulateShape: function (e, t) {
  49328. function w(e, t, i) {
  49329. return e.x !== t.x ? (e.x < t.x ? e.x <= i.x && i.x <= t.x : t.x <= i.x && i.x <= e.x) : e.y < t.y ? e.y <= i.y && i.y <= t.y : t.y <= i.y && i.y <= e.y
  49330. }
  49331. function b(e, t, i, n, r) {
  49332. var o = t.x - e.x,
  49333. a = t.y - e.y,
  49334. s = n.x - i.x,
  49335. l = n.y - i.y,
  49336. c = e.x - i.x,
  49337. h = e.y - i.y,
  49338. u = a * s - o * l,
  49339. d = a * c - o * h
  49340. if (Math.abs(u) > Number.EPSILON) {
  49341. var p
  49342. if (0 < u) {
  49343. if (d < 0 || u < d) return []
  49344. if ((p = l * c - s * h) < 0 || u < p) return []
  49345. } else {
  49346. if (0 < d || d < u) return []
  49347. if (0 < (p = l * c - s * h) || p < u) return []
  49348. }
  49349. if (0 === p) return !r || (0 != d && d != u) ? [e] : []
  49350. if (p === u) return !r || (0 != d && d != u) ? [t] : []
  49351. if (0 == d) return [i]
  49352. if (d == u) return [n]
  49353. var f = p / u
  49354. return [
  49355. {
  49356. x: e.x + f * o,
  49357. y: e.y + f * a
  49358. }
  49359. ]
  49360. }
  49361. if (0 != d || l * c != s * h) return []
  49362. var g,
  49363. m,
  49364. v,
  49365. y,
  49366. A,
  49367. C,
  49368. I,
  49369. E,
  49370. _ = 0 == o && 0 == a,
  49371. b = 0 == s && 0 == l
  49372. return _ && b
  49373. ? e.x !== i.x || e.y !== i.y
  49374. ? []
  49375. : [e]
  49376. : _
  49377. ? w(i, n, e)
  49378. ? [e]
  49379. : []
  49380. : b
  49381. ? w(e, t, i)
  49382. ? [i]
  49383. : []
  49384. : ((E =
  49385. 0 != o
  49386. ? ((y = e.x < t.x ? ((v = (g = e).x), (m = t).x) : ((v = (g = t).x), (m = e).x)), i.x < n.x ? ((I = (A = i).x), (C = n).x) : ((I = (A = n).x), (C = i).x))
  49387. : ((y = e.y < t.y ? ((v = (g = e).y), (m = t).y) : ((v = (g = t).y), (m = e).y)), i.y < n.y ? ((I = (A = i).y), (C = n).y) : ((I = (A = n).y), (C = i).y))),
  49388. v <= I ? (y < I ? [] : y === I ? (r ? [] : [A]) : y <= E ? [A, m] : [A, C]) : E < v ? [] : v === E ? (r ? [] : [g]) : y <= E ? [g, m] : [g, C])
  49389. }
  49390. function T(e, t, i, n) {
  49391. var r = t.x - e.x,
  49392. o = t.y - e.y,
  49393. a = i.x - e.x,
  49394. s = i.y - e.y,
  49395. l = n.x - e.x,
  49396. c = n.y - e.y,
  49397. h = r * s - o * a,
  49398. u = r * c - o * l
  49399. if (Math.abs(h) > Number.EPSILON) {
  49400. var d = l * s - c * a
  49401. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  49402. }
  49403. return 0 < u
  49404. }
  49405. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++) Array.prototype.push.apply(c, t[h])
  49406. for (i = 0, n = c.length; i < n; i++) void 0 !== l[(a = c[i].x + ':' + c[i].y)] && console.warn('THREE.Shape: Duplicate point', a), (l[a] = i)
  49407. var d = (function (e, a) {
  49408. function t(e, t) {
  49409. var i = m.length - 1,
  49410. n = e - 1
  49411. n < 0 && (n = i)
  49412. var r = e + 1
  49413. i < r && (r = 0)
  49414. var o = T(m[e], m[n], m[r], c[t])
  49415. if (!o) return !1
  49416. var a = c.length - 1,
  49417. s = t - 1
  49418. s < 0 && (s = a)
  49419. var l = t + 1
  49420. return a < l && (l = 0), !!(o = T(c[t], c[s], c[l], m[e]))
  49421. }
  49422. function i(e, t) {
  49423. var i, n
  49424. for (i = 0; i < m.length; i++) if (((n = i + 1), (n %= m.length), 0 < b(e, t, m[i], m[n], !0).length)) return !0
  49425. return !1
  49426. }
  49427. function n(e, t) {
  49428. var i, n, r, o
  49429. for (i = 0; i < v.length; i++) for (n = a[v[i]], r = 0; r < n.length; r++) if (((o = r + 1), (o %= n.length), 0 < b(e, t, n[r], n[o], !0).length)) return !0
  49430. return !1
  49431. }
  49432. for (var c, r, o, s, l, h, u, d, p, f, g, m = e.concat(), v = [], y = [], A = 0, C = a.length; A < C; A++) v.push(A)
  49433. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  49434. if (--E < 0) {
  49435. console.log('Infinite Loop! Holes left:' + v.length + ', Probably Hole outside Shape!')
  49436. break
  49437. }
  49438. for (o = I; o < m.length; o++) {
  49439. ;(s = m[o]), (r = -1)
  49440. for (A = 0; A < v.length; A++)
  49441. if (((h = v[A]), void 0 === y[(u = s.x + ':' + s.y + ':' + h)])) {
  49442. c = a[h]
  49443. for (var _ = 0; _ < c.length; _++)
  49444. if (((l = c[_]), t(o, _) && !i(s, l) && !n(s, l))) {
  49445. ;(r = _), v.splice(A, 1), (d = m.slice(0, o + 1)), (p = m.slice(o)), (f = c.slice(r)), (g = c.slice(0, r + 1)), (m = d.concat(f).concat(g).concat(p)), (I = o)
  49446. break
  49447. }
  49448. if (0 <= r) break
  49449. y[u] = !0
  49450. }
  49451. if (0 <= r) break
  49452. }
  49453. }
  49454. return m
  49455. })(e, t),
  49456. p = Ci.ShapeUtils.triangulate(d, !1)
  49457. for (i = 0, n = p.length; i < n; i++) for (o = p[i], r = 0; r < 3; r++) void 0 !== (s = l[(a = o[r].x + ':' + o[r].y)]) && (o[r] = s)
  49458. return p.concat()
  49459. },
  49460. isClockWise: function (e) {
  49461. return Ci.ShapeUtils.area(e) < 0
  49462. },
  49463. b2: function (e, t, i, n) {
  49464. return (
  49465. (function (e, t) {
  49466. var i = 1 - e
  49467. return i * i * t
  49468. })(e, t) +
  49469. (function (e, t) {
  49470. return 2 * (1 - e) * e * t
  49471. })(e, i) +
  49472. (function (e, t) {
  49473. return e * e * t
  49474. })(e, n)
  49475. )
  49476. },
  49477. b3: function (e, t, i, n, r) {
  49478. return (
  49479. (function (e, t) {
  49480. var i = 1 - e
  49481. return i * i * i * t
  49482. })(e, t) +
  49483. (function (e, t) {
  49484. var i = 1 - e
  49485. return 3 * i * i * e * t
  49486. })(e, i) +
  49487. (function (e, t) {
  49488. return 3 * (1 - e) * e * e * t
  49489. })(e, n) +
  49490. (function (e, t) {
  49491. return e * e * e * t
  49492. })(e, r)
  49493. )
  49494. }
  49495. }),
  49496. (Ci.Curve = function () {}),
  49497. (Ci.Curve.prototype = {
  49498. constructor: Ci.Curve,
  49499. getPoint: function (e) {
  49500. return console.warn('THREE.Curve: Warning, getPoint() not implemented!'), null
  49501. },
  49502. getPointAt: function (e) {
  49503. var t = this.getUtoTmapping(e)
  49504. return this.getPoint(t)
  49505. },
  49506. getPoints: function (e) {
  49507. e = e || 5
  49508. var t,
  49509. i = []
  49510. for (t = 0; t <= e; t++) i.push(this.getPoint(t / e))
  49511. return i
  49512. },
  49513. getSpacedPoints: function (e) {
  49514. e = e || 5
  49515. var t,
  49516. i = []
  49517. for (t = 0; t <= e; t++) i.push(this.getPointAt(t / e))
  49518. return i
  49519. },
  49520. getLength: function () {
  49521. var e = this.getLengths()
  49522. return e[e.length - 1]
  49523. },
  49524. getLengths: function (e) {
  49525. if (((e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200)), this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate))
  49526. return this.cacheArcLengths
  49527. this.needsUpdate = !1
  49528. var t,
  49529. i,
  49530. n = [],
  49531. r = this.getPoint(0),
  49532. o = 0
  49533. for (n.push(0), i = 1; i <= e; i++) (o += (t = this.getPoint(i / e)).distanceTo(r)), n.push(o), (r = t)
  49534. return (this.cacheArcLengths = n)
  49535. },
  49536. updateArcLengths: function () {
  49537. ;(this.needsUpdate = !0), this.getLengths()
  49538. },
  49539. getUtoTmapping: function (e, t) {
  49540. var i,
  49541. n = this.getLengths(),
  49542. r = 0,
  49543. o = n.length
  49544. i = t || e * n[o - 1]
  49545. for (var a, s = 0, l = o - 1; s <= l; )
  49546. if ((a = n[(r = Math.floor(s + (l - s) / 2))] - i) < 0) s = r + 1
  49547. else {
  49548. if (!(0 < a)) {
  49549. l = r
  49550. break
  49551. }
  49552. l = r - 1
  49553. }
  49554. if (n[(r = l)] === i) return r / (o - 1)
  49555. var c = n[r]
  49556. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  49557. },
  49558. getTangent: function (e) {
  49559. var t = e - 1e-4,
  49560. i = e + 1e-4
  49561. t < 0 && (t = 0), 1 < i && (i = 1)
  49562. var n = this.getPoint(t)
  49563. return this.getPoint(i).clone().sub(n).normalize()
  49564. },
  49565. getTangentAt: function (e) {
  49566. var t = this.getUtoTmapping(e)
  49567. return this.getTangent(t)
  49568. }
  49569. }),
  49570. (Ci.Curve.create = function (e, t) {
  49571. return (e.prototype = Object.create(Ci.Curve.prototype)), ((e.prototype.constructor = e).prototype.getPoint = t), e
  49572. }),
  49573. (Ci.CurvePath = function () {
  49574. ;(this.curves = []), (this.autoClose = !1)
  49575. }),
  49576. (Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype)),
  49577. (Ci.CurvePath.prototype.constructor = Ci.CurvePath),
  49578. (Ci.CurvePath.prototype.add = function (e) {
  49579. this.curves.push(e)
  49580. }),
  49581. (Ci.CurvePath.prototype.closePath = function () {
  49582. var e = this.curves[0].getPoint(0),
  49583. t = this.curves[this.curves.length - 1].getPoint(1)
  49584. e.equals(t) || this.curves.push(new Ci.LineCurve(t, e))
  49585. }),
  49586. (Ci.CurvePath.prototype.getPoint = function (e) {
  49587. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  49588. if (i[n] >= t) {
  49589. var r = i[n] - t,
  49590. o = this.curves[n],
  49591. a = 1 - r / o.getLength()
  49592. return o.getPointAt(a)
  49593. }
  49594. n++
  49595. }
  49596. return null
  49597. }),
  49598. (Ci.CurvePath.prototype.getLength = function () {
  49599. var e = this.getCurveLengths()
  49600. return e[e.length - 1]
  49601. }),
  49602. (Ci.CurvePath.prototype.getCurveLengths = function () {
  49603. if (this.cacheLengths && this.cacheLengths.length === this.curves.length) return this.cacheLengths
  49604. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++) (t += this.curves[i].getLength()), e.push(t)
  49605. return (this.cacheLengths = e)
  49606. }),
  49607. (Ci.CurvePath.prototype.createPointsGeometry = function (e) {
  49608. var t = this.getPoints(e)
  49609. return this.createGeometry(t)
  49610. }),
  49611. (Ci.CurvePath.prototype.createSpacedPointsGeometry = function (e) {
  49612. var t = this.getSpacedPoints(e)
  49613. return this.createGeometry(t)
  49614. }),
  49615. (Ci.CurvePath.prototype.createGeometry = function (e) {
  49616. for (var t = new Ci.Geometry(), i = 0, n = e.length; i < n; i++) {
  49617. var r = e[i]
  49618. t.vertices.push(new Ci.Vector3(r.x, r.y, r.z || 0))
  49619. }
  49620. return t
  49621. }),
  49622. (Ci.Font = function (e) {
  49623. this.data = e
  49624. }),
  49625. (Ci.Font.prototype = {
  49626. constructor: Ci.Font,
  49627. generateShapes: function (e, s, b) {
  49628. function l(e, t, i) {
  49629. var n = w.glyphs[e] || w.glyphs['?']
  49630. if (n) {
  49631. var r,
  49632. o,
  49633. a,
  49634. s,
  49635. l,
  49636. c,
  49637. h,
  49638. u,
  49639. d,
  49640. p,
  49641. f,
  49642. g = new Ci.Path(),
  49643. m = [],
  49644. v = Ci.ShapeUtils.b2,
  49645. y = Ci.ShapeUtils.b3
  49646. if (n.o)
  49647. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(' ')), C = 0, I = A.length; C < I; ) {
  49648. switch (A[C++]) {
  49649. case 'm':
  49650. ;(r = A[C++] * t + i), (o = A[C++] * t), g.moveTo(r, o)
  49651. break
  49652. case 'l':
  49653. ;(r = A[C++] * t + i), (o = A[C++] * t), g.lineTo(r, o)
  49654. break
  49655. case 'q':
  49656. if (((a = A[C++] * t + i), (s = A[C++] * t), (h = A[C++] * t + i), (u = A[C++] * t), g.quadraticCurveTo(h, u, a, s), (f = m[m.length - 1]))) {
  49657. ;(l = f.x), (c = f.y)
  49658. for (var E = 1; E <= b; E++) {
  49659. v((_ = E / b), l, h, a), v(_, c, u, s)
  49660. }
  49661. }
  49662. break
  49663. case 'b':
  49664. if (
  49665. ((a = A[C++] * t + i),
  49666. (s = A[C++] * t),
  49667. (h = A[C++] * t + i),
  49668. (u = A[C++] * t),
  49669. (d = A[C++] * t + i),
  49670. (p = A[C++] * t),
  49671. g.bezierCurveTo(h, u, d, p, a, s),
  49672. (f = m[m.length - 1]))
  49673. ) {
  49674. ;(l = f.x), (c = f.y)
  49675. for (E = 1; E <= b; E++) {
  49676. var _
  49677. y((_ = E / b), l, h, d, a), y(_, c, u, p, s)
  49678. }
  49679. }
  49680. }
  49681. }
  49682. return {
  49683. offset: n.ha * t,
  49684. path: g
  49685. }
  49686. }
  49687. }
  49688. void 0 === s && (s = 100), void 0 === b && (b = 4)
  49689. for (
  49690. var w = this.data,
  49691. t = (function (e) {
  49692. for (var t = String(e).split(''), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  49693. var a = l(t[o], i, n)
  49694. ;(n += a.offset), r.push(a.path)
  49695. }
  49696. return r
  49697. })(e),
  49698. i = [],
  49699. n = 0,
  49700. r = t.length;
  49701. n < r;
  49702. n++
  49703. )
  49704. Array.prototype.push.apply(i, t[n].toShapes())
  49705. return i
  49706. }
  49707. }),
  49708. (Ci.Path = function (e) {
  49709. Ci.CurvePath.call(this), (this.actions = []), e && this.fromPoints(e)
  49710. }),
  49711. (Ci.Path.prototype = Object.create(Ci.CurvePath.prototype)),
  49712. (Ci.Path.prototype.constructor = Ci.Path),
  49713. (Ci.Path.prototype.fromPoints = function (e) {
  49714. this.moveTo(e[0].x, e[0].y)
  49715. for (var t = 1, i = e.length; t < i; t++) this.lineTo(e[t].x, e[t].y)
  49716. }),
  49717. (Ci.Path.prototype.moveTo = function (e, t) {
  49718. this.actions.push({
  49719. action: 'moveTo',
  49720. args: [e, t]
  49721. })
  49722. }),
  49723. (Ci.Path.prototype.lineTo = function (e, t) {
  49724. var i = this.actions[this.actions.length - 1].args,
  49725. n = i[i.length - 2],
  49726. r = i[i.length - 1],
  49727. o = new Ci.LineCurve(new Ci.Vector2(n, r), new Ci.Vector2(e, t))
  49728. this.curves.push(o),
  49729. this.actions.push({
  49730. action: 'lineTo',
  49731. args: [e, t]
  49732. })
  49733. }),
  49734. (Ci.Path.prototype.quadraticCurveTo = function (e, t, i, n) {
  49735. var r = this.actions[this.actions.length - 1].args,
  49736. o = r[r.length - 2],
  49737. a = r[r.length - 1],
  49738. s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o, a), new Ci.Vector2(e, t), new Ci.Vector2(i, n))
  49739. this.curves.push(s),
  49740. this.actions.push({
  49741. action: 'quadraticCurveTo',
  49742. args: [e, t, i, n]
  49743. })
  49744. }),
  49745. (Ci.Path.prototype.bezierCurveTo = function (e, t, i, n, r, o) {
  49746. var a = this.actions[this.actions.length - 1].args,
  49747. s = a[a.length - 2],
  49748. l = a[a.length - 1],
  49749. c = new Ci.CubicBezierCurve(new Ci.Vector2(s, l), new Ci.Vector2(e, t), new Ci.Vector2(i, n), new Ci.Vector2(r, o))
  49750. this.curves.push(c),
  49751. this.actions.push({
  49752. action: 'bezierCurveTo',
  49753. args: [e, t, i, n, r, o]
  49754. })
  49755. }),
  49756. (Ci.Path.prototype.splineThru = function (e) {
  49757. var t = Array.prototype.slice.call(arguments),
  49758. i = this.actions[this.actions.length - 1].args,
  49759. n = i[i.length - 2],
  49760. r = i[i.length - 1],
  49761. o = [new Ci.Vector2(n, r)]
  49762. Array.prototype.push.apply(o, e)
  49763. var a = new Ci.SplineCurve(o)
  49764. this.curves.push(a),
  49765. this.actions.push({
  49766. action: 'splineThru',
  49767. args: t
  49768. })
  49769. }),
  49770. (Ci.Path.prototype.arc = function (e, t, i, n, r, o) {
  49771. var a = this.actions[this.actions.length - 1].args,
  49772. s = a[a.length - 2],
  49773. l = a[a.length - 1]
  49774. this.absarc(e + s, t + l, i, n, r, o)
  49775. }),
  49776. (Ci.Path.prototype.absarc = function (e, t, i, n, r, o) {
  49777. this.absellipse(e, t, i, i, n, r, o)
  49778. }),
  49779. (Ci.Path.prototype.ellipse = function (e, t, i, n, r, o, a, s) {
  49780. var l = this.actions[this.actions.length - 1].args,
  49781. c = l[l.length - 2],
  49782. h = l[l.length - 1]
  49783. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  49784. }),
  49785. (Ci.Path.prototype.absellipse = function (e, t, i, n, r, o, a, s) {
  49786. var l = [e, t, i, n, r, o, a, s || 0],
  49787. c = new Ci.EllipseCurve(e, t, i, n, r, o, a, s)
  49788. this.curves.push(c)
  49789. var h = c.getPoint(1)
  49790. l.push(h.x),
  49791. l.push(h.y),
  49792. this.actions.push({
  49793. action: 'ellipse',
  49794. args: l
  49795. })
  49796. }),
  49797. (Ci.Path.prototype.getSpacedPoints = function (e) {
  49798. e = e || 40
  49799. for (var t = [], i = 0; i < e; i++) t.push(this.getPoint(i / e))
  49800. return this.autoClose && t.push(t[0]), t
  49801. }),
  49802. (Ci.Path.prototype.getPoints = function (e) {
  49803. e = e || 12
  49804. for (var t, i, n, r, o, a, s, l, c, h, u, d = Ci.ShapeUtils.b2, p = Ci.ShapeUtils.b3, f = [], g = 0, m = this.actions.length; g < m; g++) {
  49805. var v = this.actions[g],
  49806. y = v.action,
  49807. A = v.args
  49808. switch (y) {
  49809. case 'moveTo':
  49810. case 'lineTo':
  49811. f.push(new Ci.Vector2(A[0], A[1]))
  49812. break
  49813. case 'quadraticCurveTo':
  49814. ;(t = A[2]), (i = A[3]), (o = A[0]), (a = A[1]), (l = 0 < f.length ? ((s = (c = f[f.length - 1]).x), c.y) : ((s = (c = this.actions[g - 1].args)[c.length - 2]), c[c.length - 1]))
  49815. for (var C = 1; C <= e; C++) {
  49816. ;(h = d((O = C / e), s, o, t)), (u = d(O, l, a, i)), f.push(new Ci.Vector2(h, u))
  49817. }
  49818. break
  49819. case 'bezierCurveTo':
  49820. ;(t = A[4]),
  49821. (i = A[5]),
  49822. (o = A[0]),
  49823. (a = A[1]),
  49824. (n = A[2]),
  49825. (r = A[3]),
  49826. (l = 0 < f.length ? ((s = (c = f[f.length - 1]).x), c.y) : ((s = (c = this.actions[g - 1].args)[c.length - 2]), c[c.length - 1]))
  49827. for (C = 1; C <= e; C++) {
  49828. ;(h = p((O = C / e), s, o, n, t)), (u = p(O, l, a, r, i)), f.push(new Ci.Vector2(h, u))
  49829. }
  49830. break
  49831. case 'splineThru':
  49832. c = this.actions[g - 1].args
  49833. var I = [new Ci.Vector2(c[c.length - 2], c[c.length - 1])],
  49834. E = e * A[0].length
  49835. I = I.concat(A[0])
  49836. var _ = new Ci.SplineCurve(I)
  49837. for (C = 1; C <= E; C++) f.push(_.getPointAt(C / E))
  49838. break
  49839. case 'arc':
  49840. var b = A[0],
  49841. w = A[1],
  49842. T = A[2],
  49843. x = A[3],
  49844. S = A[4],
  49845. M = !!A[5],
  49846. R = S - x,
  49847. P = 2 * e
  49848. for (C = 1; C <= P; C++) {
  49849. var O = C / P
  49850. M || (O = 1 - O), (L = x + O * R), (h = b + T * Math.cos(L)), (u = w + T * Math.sin(L)), f.push(new Ci.Vector2(h, u))
  49851. }
  49852. break
  49853. case 'ellipse':
  49854. ;(b = A[0]), (w = A[1])
  49855. var L,
  49856. D,
  49857. N,
  49858. F = A[2],
  49859. B = A[3],
  49860. V = ((x = A[4]), (S = A[5]), (M = !!A[6]), A[7])
  49861. ;(R = S - x), (P = 2 * e)
  49862. 0 !== V && ((D = Math.cos(V)), (N = Math.sin(V)))
  49863. for (C = 1; C <= P; C++) {
  49864. O = C / P
  49865. if ((M || (O = 1 - O), (L = x + O * R), (h = b + F * Math.cos(L)), (u = w + B * Math.sin(L)), 0 !== V)) {
  49866. var k = h
  49867. ;(h = (k - b) * D - (u - w) * N + b), (u = (k - b) * N + (u - w) * D + w)
  49868. }
  49869. f.push(new Ci.Vector2(h, u))
  49870. }
  49871. }
  49872. }
  49873. var U = f[f.length - 1]
  49874. return Math.abs(U.x - f[0].x) < Number.EPSILON && Math.abs(U.y - f[0].y) < Number.EPSILON && f.splice(f.length - 1, 1), this.autoClose && f.push(f[0]), f
  49875. }),
  49876. (Ci.Path.prototype.toShapes = function (e, t) {
  49877. function i(e) {
  49878. for (var t = [], i = 0, n = e.length; i < n; i++) {
  49879. var r = e[i],
  49880. o = new Ci.Shape()
  49881. ;(o.actions = r.actions), (o.curves = r.curves), t.push(o)
  49882. }
  49883. return t
  49884. }
  49885. function n(e, t) {
  49886. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  49887. var a = t[r],
  49888. s = t[o],
  49889. l = s.x - a.x,
  49890. c = s.y - a.y
  49891. if (Math.abs(c) > Number.EPSILON) {
  49892. if ((c < 0 && ((a = t[o]), (l = -l), (s = t[r]), (c = -c)), e.y < a.y || e.y > s.y)) continue
  49893. if (e.y === a.y) {
  49894. if (e.x === a.x) return !0
  49895. } else {
  49896. var h = c * (e.x - a.x) - l * (e.y - a.y)
  49897. if (0 == h) return !0
  49898. if (h < 0) continue
  49899. n = !n
  49900. }
  49901. } else {
  49902. if (e.y !== a.y) continue
  49903. if ((s.x <= e.x && e.x <= a.x) || (a.x <= e.x && e.x <= s.x)) return !0
  49904. }
  49905. }
  49906. return n
  49907. }
  49908. var r = Ci.ShapeUtils.isClockWise,
  49909. o = (function (e) {
  49910. for (var t = [], i = new Ci.Path(), n = 0, r = e.length; n < r; n++) {
  49911. var o = e[n],
  49912. a = o.args,
  49913. s = o.action
  49914. 'moveTo' === s && 0 !== i.actions.length && (t.push(i), (i = new Ci.Path())), i[s].apply(i, a)
  49915. }
  49916. return 0 !== i.actions.length && t.push(i), t
  49917. })(this.actions)
  49918. if (0 === o.length) return []
  49919. if (!0 === t) return i(o)
  49920. var a,
  49921. s,
  49922. l,
  49923. c = []
  49924. if (1 === o.length) return (s = o[0]), ((l = new Ci.Shape()).actions = s.actions), (l.curves = s.curves), c.push(l), c
  49925. var h = !r(o[0].getPoints())
  49926. h = e ? !h : h
  49927. var u,
  49928. d = [],
  49929. p = [],
  49930. f = [],
  49931. g = 0
  49932. ;(p[g] = void 0), (f[g] = [])
  49933. for (var m = 0, v = o.length; m < v; m++)
  49934. (a = r((u = (s = o[m]).getPoints()))),
  49935. (a = e ? !a : a)
  49936. ? (!h && p[g] && g++,
  49937. (p[g] = {
  49938. s: new Ci.Shape(),
  49939. p: u
  49940. }),
  49941. (p[g].s.actions = s.actions),
  49942. (p[g].s.curves = s.curves),
  49943. h && g++,
  49944. (f[g] = []))
  49945. : f[g].push({
  49946. h: s,
  49947. p: u[0]
  49948. })
  49949. if (!p[0]) return i(o)
  49950. if (1 < p.length) {
  49951. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++) d[C] = []
  49952. for (C = 0, I = p.length; C < I; C++)
  49953. for (var E = f[C], _ = 0; _ < E.length; _++) {
  49954. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  49955. n(b.p, p[T].p) &&
  49956. (C !== T &&
  49957. A.push({
  49958. froms: C,
  49959. tos: T,
  49960. hole: _
  49961. }),
  49962. w ? ((w = !1), d[T].push(b)) : (y = !0))
  49963. w && d[C].push(b)
  49964. }
  49965. 0 < A.length && (y || (f = d))
  49966. }
  49967. m = 0
  49968. for (var x, S = p.length; m < S; m++) {
  49969. ;(l = p[m].s), c.push(l)
  49970. for (var M = 0, R = (x = f[m]).length; M < R; M++) l.holes.push(x[M].h)
  49971. }
  49972. return c
  49973. }),
  49974. (Ci.Shape = function () {
  49975. Ci.Path.apply(this, arguments), (this.holes = [])
  49976. }),
  49977. (Ci.Shape.prototype = Object.create(Ci.Path.prototype)),
  49978. (Ci.Shape.prototype.constructor = Ci.Shape),
  49979. (Ci.Shape.prototype.extrude = function (e) {
  49980. return new Ci.ExtrudeGeometry(this, e)
  49981. }),
  49982. (Ci.Shape.prototype.makeGeometry = function (e) {
  49983. return new Ci.ShapeGeometry(this, e)
  49984. }),
  49985. (Ci.Shape.prototype.getPointsHoles = function (e) {
  49986. for (var t = [], i = 0, n = this.holes.length; i < n; i++) t[i] = this.holes[i].getPoints(e)
  49987. return t
  49988. }),
  49989. (Ci.Shape.prototype.extractAllPoints = function (e) {
  49990. return {
  49991. shape: this.getPoints(e),
  49992. holes: this.getPointsHoles(e)
  49993. }
  49994. }),
  49995. (Ci.Shape.prototype.extractPoints = function (e) {
  49996. return this.extractAllPoints(e)
  49997. }),
  49998. (Ci.LineCurve = function (e, t) {
  49999. ;(this.v1 = e), (this.v2 = t)
  50000. }),
  50001. (Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype)),
  50002. (Ci.LineCurve.prototype.constructor = Ci.LineCurve),
  50003. (Ci.LineCurve.prototype.getPoint = function (e) {
  50004. var t = this.v2.clone().sub(this.v1)
  50005. return t.multiplyScalar(e).add(this.v1), t
  50006. }),
  50007. (Ci.LineCurve.prototype.getPointAt = function (e) {
  50008. return this.getPoint(e)
  50009. }),
  50010. (Ci.LineCurve.prototype.getTangent = function (e) {
  50011. return this.v2.clone().sub(this.v1).normalize()
  50012. }),
  50013. (Ci.QuadraticBezierCurve = function (e, t, i) {
  50014. ;(this.v0 = e), (this.v1 = t), (this.v2 = i)
  50015. }),
  50016. (Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype)),
  50017. (Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve),
  50018. (Ci.QuadraticBezierCurve.prototype.getPoint = function (e) {
  50019. var t = Ci.ShapeUtils.b2
  50020. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x), t(e, this.v0.y, this.v1.y, this.v2.y))
  50021. }),
  50022. (Ci.QuadraticBezierCurve.prototype.getTangent = function (e) {
  50023. var t = Ci.CurveUtils.tangentQuadraticBezier
  50024. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x), t(e, this.v0.y, this.v1.y, this.v2.y)).normalize()
  50025. }),
  50026. (Ci.CubicBezierCurve = function (e, t, i, n) {
  50027. ;(this.v0 = e), (this.v1 = t), (this.v2 = i), (this.v3 = n)
  50028. }),
  50029. (Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype)),
  50030. (Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve),
  50031. (Ci.CubicBezierCurve.prototype.getPoint = function (e) {
  50032. var t = Ci.ShapeUtils.b3
  50033. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x), t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y))
  50034. }),
  50035. (Ci.CubicBezierCurve.prototype.getTangent = function (e) {
  50036. var t = Ci.CurveUtils.tangentCubicBezier
  50037. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x), t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)).normalize()
  50038. }),
  50039. (Ci.SplineCurve = function (e) {
  50040. this.points = null == e ? [] : e
  50041. }),
  50042. (Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype)),
  50043. (Ci.SplineCurve.prototype.constructor = Ci.SplineCurve),
  50044. (Ci.SplineCurve.prototype.getPoint = function (e) {
  50045. var t = this.points,
  50046. i = (t.length - 1) * e,
  50047. n = Math.floor(i),
  50048. r = i - n,
  50049. o = t[0 === n ? n : n - 1],
  50050. a = t[n],
  50051. s = t[n > t.length - 2 ? t.length - 1 : n + 1],
  50052. l = t[n > t.length - 3 ? t.length - 1 : n + 2],
  50053. c = Ci.CurveUtils.interpolate
  50054. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r), c(o.y, a.y, s.y, l.y, r))
  50055. }),
  50056. (Ci.EllipseCurve = function (e, t, i, n, r, o, a, s) {
  50057. ;(this.aX = e), (this.aY = t), (this.xRadius = i), (this.yRadius = n), (this.aStartAngle = r), (this.aEndAngle = o), (this.aClockwise = a), (this.aRotation = s || 0)
  50058. }),
  50059. (Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype)),
  50060. (Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve),
  50061. (Ci.EllipseCurve.prototype.getPoint = function (e) {
  50062. var t,
  50063. i = this.aEndAngle - this.aStartAngle
  50064. i < 0 && (i += 2 * Math.PI), i > 2 * Math.PI && (i -= 2 * Math.PI), (t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i)
  50065. var n = this.aX + this.xRadius * Math.cos(t),
  50066. r = this.aY + this.yRadius * Math.sin(t)
  50067. if (0 !== this.aRotation) {
  50068. var o = Math.cos(this.aRotation),
  50069. a = Math.sin(this.aRotation),
  50070. s = n,
  50071. l = r
  50072. ;(n = (s - this.aX) * o - (l - this.aY) * a + this.aX), (r = (s - this.aX) * a + (l - this.aY) * o + this.aY)
  50073. }
  50074. return new Ci.Vector2(n, r)
  50075. }),
  50076. (Ci.ArcCurve = function (e, t, i, n, r, o) {
  50077. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  50078. }),
  50079. (Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype)),
  50080. (Ci.ArcCurve.prototype.constructor = Ci.ArcCurve),
  50081. (Ci.LineCurve3 = Ci.Curve.create(
  50082. function (e, t) {
  50083. ;(this.v1 = e), (this.v2 = t)
  50084. },
  50085. function (e) {
  50086. var t = new Ci.Vector3()
  50087. return t.subVectors(this.v2, this.v1), t.multiplyScalar(e), t.add(this.v1), t
  50088. }
  50089. )),
  50090. (Ci.QuadraticBezierCurve3 = Ci.Curve.create(
  50091. function (e, t, i) {
  50092. ;(this.v0 = e), (this.v1 = t), (this.v2 = i)
  50093. },
  50094. function (e) {
  50095. var t = Ci.ShapeUtils.b2
  50096. return new Ci.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x), t(e, this.v0.y, this.v1.y, this.v2.y), t(e, this.v0.z, this.v1.z, this.v2.z))
  50097. }
  50098. )),
  50099. (Ci.CubicBezierCurve3 = Ci.Curve.create(
  50100. function (e, t, i, n) {
  50101. ;(this.v0 = e), (this.v1 = t), (this.v2 = i), (this.v3 = n)
  50102. },
  50103. function (e) {
  50104. var t = Ci.ShapeUtils.b3
  50105. return new Ci.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x), t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y), t(e, this.v0.z, this.v1.z, this.v2.z, this.v3.z))
  50106. }
  50107. )),
  50108. (Ci.SplineCurve3 = Ci.Curve.create(
  50109. function (e) {
  50110. console.warn('THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3'), (this.points = null == e ? [] : e)
  50111. },
  50112. function (e) {
  50113. var t = this.points,
  50114. i = (t.length - 1) * e,
  50115. n = Math.floor(i),
  50116. r = i - n,
  50117. o = t[0 == n ? n : n - 1],
  50118. a = t[n],
  50119. s = t[n > t.length - 2 ? t.length - 1 : n + 1],
  50120. l = t[n > t.length - 3 ? t.length - 1 : n + 2],
  50121. c = Ci.CurveUtils.interpolate
  50122. return new Ci.Vector3(c(o.x, a.x, s.x, l.x, r), c(o.y, a.y, s.y, l.y, r), c(o.z, a.z, s.z, l.z, r))
  50123. }
  50124. )),
  50125. (Ci.CatmullRomCurve3 =
  50126. ((qt = new Ci.Vector3()),
  50127. (Xt = new xi()),
  50128. (Zt = new xi()),
  50129. (Kt = new xi()),
  50130. (xi.prototype.init = function (e, t, i, n) {
  50131. ;(this.c0 = e), (this.c1 = i), (this.c2 = -3 * e + 3 * t - 2 * i - n), (this.c3 = 2 * e - 2 * t + i + n)
  50132. }),
  50133. (xi.prototype.initNonuniformCatmullRom = function (e, t, i, n, r, o, a) {
  50134. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o,
  50135. l = (i - t) / o - (n - t) / (o + a) + (n - i) / a
  50136. ;(s *= o), (l *= o), this.init(t, i, s, l)
  50137. }),
  50138. (xi.prototype.initCatmullRom = function (e, t, i, n, r) {
  50139. this.init(t, i, r * (i - e), r * (n - t))
  50140. }),
  50141. (xi.prototype.calc = function (e) {
  50142. var t = e * e,
  50143. i = t * e
  50144. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  50145. }),
  50146. Ci.Curve.create(
  50147. function (e) {
  50148. ;(this.points = e || []), (this.closed = !1)
  50149. },
  50150. function (e) {
  50151. var t,
  50152. i,
  50153. n,
  50154. r,
  50155. o,
  50156. a,
  50157. s,
  50158. l,
  50159. c = this.points
  50160. if (
  50161. ((r = c.length) < 2 && console.log('duh, you need at least 2 points'),
  50162. (n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t))),
  50163. this.closed ? (i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length) : 0 === n && i === r - 1 && ((i = r - 2), (n = 1)),
  50164. (o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]), qt)),
  50165. (a = c[i % r]),
  50166. (s = c[(i + 1) % r]),
  50167. (l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]), qt)),
  50168. void 0 === this.type || 'centripetal' === this.type || 'chordal' === this.type)
  50169. ) {
  50170. var h = 'chordal' === this.type ? 0.5 : 0.25,
  50171. u = Math.pow(o.distanceToSquared(a), h),
  50172. d = Math.pow(a.distanceToSquared(s), h),
  50173. p = Math.pow(s.distanceToSquared(l), h)
  50174. d < 1e-4 && (d = 1),
  50175. u < 1e-4 && (u = d),
  50176. p < 1e-4 && (p = d),
  50177. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  50178. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  50179. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  50180. } else if ('catmullrom' === this.type) {
  50181. var f = void 0 !== this.tension ? this.tension : 0.5
  50182. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f), Zt.initCatmullRom(o.y, a.y, s.y, l.y, f), Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  50183. }
  50184. return new Ci.Vector3(Xt.calc(n), Zt.calc(n), Kt.calc(n))
  50185. }
  50186. ))),
  50187. (Ci.ClosedSplineCurve3 = function (e) {
  50188. console.warn('THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3.'), Ci.CatmullRomCurve3.call(this, e), (this.type = 'catmullrom'), (this.closed = !0)
  50189. }),
  50190. (Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype)),
  50191. (Ci.BoxGeometry = function (e, t, i, n, r, o) {
  50192. Ci.Geometry.call(this),
  50193. (this.type = 'BoxGeometry'),
  50194. (this.parameters = {
  50195. width: e,
  50196. height: t,
  50197. depth: i,
  50198. widthSegments: n,
  50199. heightSegments: r,
  50200. depthSegments: o
  50201. }),
  50202. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e, t, i, n, r, o)),
  50203. this.mergeVertices()
  50204. }),
  50205. (Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  50206. (Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry),
  50207. (Ci.CubeGeometry = Ci.BoxGeometry),
  50208. (Ci.BoxBufferGeometry = function (e, t, i, n, r, o) {
  50209. function a(e, t, i, n, r, o, a, s, l, c, h) {
  50210. for (var u = o / l, d = a / c, p = o / 2, f = a / 2, g = s / 2, m = l + 1, v = c + 1, y = 0, A = 0, C = new Ci.Vector3(), I = 0; I < v; I++)
  50211. for (var E = I * d - f, _ = 0; _ < m; _++) {
  50212. var b = _ * u - p
  50213. ;(C[e] = b * n),
  50214. (C[t] = E * r),
  50215. (C[i] = g),
  50216. (P[D] = C.x),
  50217. (P[D + 1] = C.y),
  50218. (P[D + 2] = C.z),
  50219. (C[e] = 0),
  50220. (C[t] = 0),
  50221. (C[i] = 0 < s ? 1 : -1),
  50222. (O[D] = C.x),
  50223. (O[D + 1] = C.y),
  50224. (O[D + 2] = C.z),
  50225. (L[N] = _ / l),
  50226. (L[N + 1] = 1 - I / c),
  50227. (D += 3),
  50228. (N += 2),
  50229. (y += 1)
  50230. }
  50231. for (I = 0; I < c; I++)
  50232. for (_ = 0; _ < l; _++) {
  50233. var w = B + _ + m * I,
  50234. T = B + _ + m * (I + 1),
  50235. x = B + (_ + 1) + m * (I + 1),
  50236. S = B + (_ + 1) + m * I
  50237. ;(R[F] = w), (R[F + 1] = T), (R[F + 2] = S), (R[F + 3] = T), (R[F + 4] = x), (R[F + 5] = S), (F += 6), (A += 6)
  50238. }
  50239. M.addGroup(V, A, h), (V += A), (B += y)
  50240. }
  50241. Ci.BufferGeometry.call(this),
  50242. (this.type = 'BoxBufferGeometry'),
  50243. (this.parameters = {
  50244. width: e,
  50245. height: t,
  50246. depth: i,
  50247. widthSegments: n,
  50248. heightSegments: r,
  50249. depthSegments: o
  50250. })
  50251. var M = this
  50252. ;(n = Math.floor(n) || 1), (r = Math.floor(r) || 1), (o = Math.floor(o) || 1)
  50253. var s,
  50254. l,
  50255. c,
  50256. h,
  50257. u = ((h = 0), (h += (s = n) * (l = r) * 2), (h += s * (c = o) * 2), 4 * (h += c * l * 2)),
  50258. d = (u / 4) * 6,
  50259. R = new (65535 < d ? Uint32Array : Uint16Array)(d),
  50260. P = new Float32Array(3 * u),
  50261. O = new Float32Array(3 * u),
  50262. L = new Float32Array(2 * u),
  50263. D = 0,
  50264. N = 0,
  50265. F = 0,
  50266. B = 0,
  50267. V = 0
  50268. a('z', 'y', 'x', -1, -1, i, t, e, o, r, 0),
  50269. a('z', 'y', 'x', 1, -1, i, t, -e, o, r, 1),
  50270. a('x', 'z', 'y', 1, 1, e, i, t, n, o, 2),
  50271. a('x', 'z', 'y', 1, -1, e, i, -t, n, o, 3),
  50272. a('x', 'y', 'z', 1, -1, e, t, i, n, r, 4),
  50273. a('x', 'y', 'z', -1, -1, e, t, -i, n, r, 5),
  50274. this.setIndex(new Ci.BufferAttribute(R, 1)),
  50275. this.addAttribute('position', new Ci.BufferAttribute(P, 3)),
  50276. this.addAttribute('normal', new Ci.BufferAttribute(O, 3)),
  50277. this.addAttribute('uv', new Ci.BufferAttribute(L, 2))
  50278. }),
  50279. (Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  50280. (Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry),
  50281. (Ci.CircleGeometry = function (e, t, i, n) {
  50282. Ci.Geometry.call(this),
  50283. (this.type = 'CircleGeometry'),
  50284. (this.parameters = {
  50285. radius: e,
  50286. segments: t,
  50287. thetaStart: i,
  50288. thetaLength: n
  50289. }),
  50290. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e, t, i, n))
  50291. }),
  50292. (Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  50293. (Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry),
  50294. (Ci.CircleBufferGeometry = function (e, t, i, n) {
  50295. Ci.BufferGeometry.call(this),
  50296. (this.type = 'CircleBufferGeometry'),
  50297. (this.parameters = {
  50298. radius: e,
  50299. segments: t,
  50300. thetaStart: i,
  50301. thetaLength: n
  50302. }),
  50303. (e = e || 50),
  50304. (t = void 0 !== t ? Math.max(3, t) : 8),
  50305. (i = void 0 !== i ? i : 0),
  50306. (n = void 0 !== n ? n : 2 * Math.PI)
  50307. var r = t + 2,
  50308. o = new Float32Array(3 * r),
  50309. a = new Float32Array(3 * r),
  50310. s = new Float32Array(2 * r)
  50311. ;(a[2] = 1), (s[0] = 0.5), (s[1] = 0.5)
  50312. for (var l = 0, c = 3, h = 2; l <= t; l++, c += 3, h += 2) {
  50313. var u = i + (l / t) * n
  50314. ;(o[c] = e * Math.cos(u)), (o[c + 1] = e * Math.sin(u)), (a[c + 2] = 1), (s[h] = (o[c] / e + 1) / 2), (s[h + 1] = (o[c + 1] / e + 1) / 2)
  50315. }
  50316. var d = []
  50317. for (c = 1; c <= t; c++) d.push(c, c + 1, 0)
  50318. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d), 1)),
  50319. this.addAttribute('position', new Ci.BufferAttribute(o, 3)),
  50320. this.addAttribute('normal', new Ci.BufferAttribute(a, 3)),
  50321. this.addAttribute('uv', new Ci.BufferAttribute(s, 2)),
  50322. (this.boundingSphere = new Ci.Sphere(new Ci.Vector3(), e))
  50323. }),
  50324. (Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  50325. (Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry),
  50326. (Ci.CylinderBufferGeometry = function (p, f, g, m, v, e, y, A) {
  50327. function t(e) {
  50328. var t,
  50329. i,
  50330. n,
  50331. r = new Ci.Vector2(),
  50332. o = new Ci.Vector3(),
  50333. a = !0 === e ? p : f,
  50334. s = !0 === e ? 1 : -1
  50335. for (i = b, t = 1; t <= m; t++) I.setXYZ(b, 0, x * s, 0), E.setXYZ(b, 0, s, 0), !0 === e ? ((r.x = t / m), (r.y = 0)) : ((r.x = (t - 1) / m), (r.y = 1)), _.setXY(b, r.x, r.y), b++
  50336. for (n = b, t = 0; t <= m; t++) {
  50337. var l = t / m
  50338. ;(o.x = a * Math.sin(l * A + y)), (o.y = x * s), (o.z = a * Math.cos(l * A + y)), I.setXYZ(b, o.x, o.y, o.z), E.setXYZ(b, 0, s, 0), _.setXY(b, l, !0 === e ? 1 : 0), b++
  50339. }
  50340. for (t = 0; t < m; t++) {
  50341. var c = i + t,
  50342. h = n + t
  50343. !0 === e ? (C.setX(w, h), w++, C.setX(w, h + 1)) : (C.setX(w, h + 1), w++, C.setX(w, h)), w++, C.setX(w, c), w++
  50344. }
  50345. }
  50346. Ci.BufferGeometry.call(this),
  50347. (this.type = 'CylinderBufferGeometry'),
  50348. (this.parameters = {
  50349. radiusTop: p,
  50350. radiusBottom: f,
  50351. height: g,
  50352. radialSegments: m,
  50353. heightSegments: v,
  50354. openEnded: e,
  50355. thetaStart: y,
  50356. thetaLength: A
  50357. }),
  50358. (p = void 0 !== p ? p : 20),
  50359. (f = void 0 !== f ? f : 20),
  50360. (g = void 0 !== g ? g : 100),
  50361. (m = Math.floor(m) || 8),
  50362. (v = Math.floor(v) || 1),
  50363. (e = void 0 !== e && e),
  50364. (y = void 0 !== y ? y : 0),
  50365. (A = void 0 !== A ? A : 2 * Math.PI)
  50366. var i,
  50367. n,
  50368. r = ((n = (m + 1) * (v + 1)), !1 === e && (n += 2 * (m + 1) + 2 * m), n),
  50369. o = ((i = m * v * 2 * 3), !1 === e && (i += 2 * m * 3), i),
  50370. C = new Ci.BufferAttribute(new (65535 < o ? Uint32Array : Uint16Array)(o), 1),
  50371. I = new Ci.BufferAttribute(new Float32Array(3 * r), 3),
  50372. E = new Ci.BufferAttribute(new Float32Array(3 * r), 3),
  50373. _ = new Ci.BufferAttribute(new Float32Array(2 * r), 2),
  50374. b = 0,
  50375. w = 0,
  50376. T = [],
  50377. x = g / 2
  50378. ;(function () {
  50379. var e,
  50380. t,
  50381. i = new Ci.Vector3(),
  50382. n = new Ci.Vector3(),
  50383. r = (f - p) / g
  50384. for (t = 0; t <= v; t++) {
  50385. var o = [],
  50386. a = t / v,
  50387. s = a * (f - p) + p
  50388. for (e = 0; e <= m; e++) {
  50389. var l = e / m
  50390. ;(n.x = s * Math.sin(l * A + y)),
  50391. (n.y = -a * g + x),
  50392. (n.z = s * Math.cos(l * A + y)),
  50393. I.setXYZ(b, n.x, n.y, n.z),
  50394. i.copy(n),
  50395. ((0 === p && 0 === t) || (0 === f && t === v)) && ((i.x = Math.sin(l * A + y)), (i.z = Math.cos(l * A + y))),
  50396. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  50397. E.setXYZ(b, i.x, i.y, i.z),
  50398. _.setXY(b, l, 1 - a),
  50399. o.push(b),
  50400. b++
  50401. }
  50402. T.push(o)
  50403. }
  50404. for (e = 0; e < m; e++)
  50405. for (t = 0; t < v; t++) {
  50406. var c = T[t][e],
  50407. h = T[t + 1][e],
  50408. u = T[t + 1][e + 1],
  50409. d = T[t][e + 1]
  50410. C.setX(w, c), w++, C.setX(w, h), w++, C.setX(w, d), w++, C.setX(w, h), w++, C.setX(w, u), w++, C.setX(w, d), w++
  50411. }
  50412. })(),
  50413. !1 === e && (0 < p && t(!0), 0 < f && t(!1)),
  50414. this.setIndex(C),
  50415. this.addAttribute('position', I),
  50416. this.addAttribute('normal', E),
  50417. this.addAttribute('uv', _)
  50418. }),
  50419. (Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  50420. (Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry),
  50421. (Ci.CylinderGeometry = function (e, t, i, n, r, o, a, s) {
  50422. Ci.Geometry.call(this),
  50423. (this.type = 'CylinderGeometry'),
  50424. (this.parameters = {
  50425. radiusTop: e,
  50426. radiusBottom: t,
  50427. height: i,
  50428. radialSegments: n,
  50429. heightSegments: r,
  50430. openEnded: o,
  50431. thetaStart: a,
  50432. thetaLength: s
  50433. }),
  50434. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e, t, i, n, r, o, a, s)),
  50435. this.mergeVertices()
  50436. }),
  50437. (Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  50438. (Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry),
  50439. (Ci.EdgesGeometry = function (e, t) {
  50440. function i(e, t) {
  50441. return e - t
  50442. }
  50443. Ci.BufferGeometry.call(this), (t = void 0 !== t ? t : 1)
  50444. var n,
  50445. r = Math.cos(Ci.Math.degToRad(t)),
  50446. o = [0, 0],
  50447. a = {},
  50448. s = ['a', 'b', 'c']
  50449. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry()).fromBufferGeometry(e) : (n = e.clone()), n.mergeVertices(), n.computeFaceNormals()
  50450. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  50451. for (var d = c[h], p = 0; p < 3; p++) {
  50452. ;(o[0] = d[s[p]]),
  50453. (o[1] = d[s[(p + 1) % 3]]),
  50454. o.sort(i),
  50455. void 0 === a[(g = o.toString())]
  50456. ? (a[g] = {
  50457. vert1: o[0],
  50458. vert2: o[1],
  50459. face1: h,
  50460. face2: void 0
  50461. })
  50462. : (a[g].face2 = h)
  50463. }
  50464. var f = []
  50465. for (var g in a) {
  50466. var m = a[g]
  50467. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  50468. var v = l[m.vert1]
  50469. f.push(v.x), f.push(v.y), f.push(v.z), (v = l[m.vert2]), f.push(v.x), f.push(v.y), f.push(v.z)
  50470. }
  50471. }
  50472. this.addAttribute('position', new Ci.BufferAttribute(new Float32Array(f), 3))
  50473. }),
  50474. (Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  50475. (Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry),
  50476. (Ci.ExtrudeGeometry = function (e, t) {
  50477. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this), (this.type = 'ExtrudeGeometry'), (e = Array.isArray(e) ? e : [e]), this.addShapeList(e, t), void this.computeFaceNormals())
  50478. })
  50479. ;(Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  50480. (Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry),
  50481. (Ci.ExtrudeGeometry.prototype.addShapeList = function (e, t) {
  50482. for (var i = e.length, n = 0; n < i; n++) {
  50483. var r = e[n]
  50484. this.addShape(r, t)
  50485. }
  50486. }),
  50487. (Ci.ExtrudeGeometry.prototype.addShape = function (e, t) {
  50488. function i(e, t, i) {
  50489. return t || console.error('THREE.ExtrudeGeometry: vec does not exist'), t.clone().multiplyScalar(i).add(e)
  50490. }
  50491. function n(e, t, i) {
  50492. var n,
  50493. r,
  50494. o = 1,
  50495. a = e.x - t.x,
  50496. s = e.y - t.y,
  50497. l = i.x - e.x,
  50498. c = i.y - e.y,
  50499. h = a * a + s * s,
  50500. u = a * c - s * l
  50501. if (Math.abs(u) > Number.EPSILON) {
  50502. var d = Math.sqrt(h),
  50503. p = Math.sqrt(l * l + c * c),
  50504. f = t.x - s / d,
  50505. g = t.y + a / d,
  50506. m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l),
  50507. v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r
  50508. if (v <= 2) return new Ci.Vector2(n, r)
  50509. o = Math.sqrt(v / 2)
  50510. } else {
  50511. var y = !1
  50512. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  50513. (o = y ? ((n = -s), (r = a), Math.sqrt(h)) : ((n = a), (r = s), Math.sqrt(h / 2)))
  50514. }
  50515. return new Ci.Vector2(n / o, r / o)
  50516. }
  50517. function r(e, t) {
  50518. var i, n
  50519. for (G = e.length; 0 <= --G; ) {
  50520. ;(n = (i = G) - 1) < 0 && (n = e.length - 1)
  50521. var r = 0,
  50522. o = A + 2 * m
  50523. for (r = 0; r < o; r++) {
  50524. var a = U * r,
  50525. s = U * (r + 1)
  50526. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  50527. }
  50528. }
  50529. }
  50530. function o(e, t, i) {
  50531. T.vertices.push(new Ci.Vector3(e, t, i))
  50532. }
  50533. function a(e, t, i) {
  50534. ;(e += x), (t += x), (i += x), T.faces.push(new Ci.Face3(e, t, i, null, null, 0))
  50535. var n = E.generateTopUV(T, e, t, i)
  50536. T.faceVertexUvs[0].push(n)
  50537. }
  50538. function l(e, t, i, n) {
  50539. ;(e += x), (t += x), (i += x), (n += x), T.faces.push(new Ci.Face3(e, t, n, null, null, 1)), T.faces.push(new Ci.Face3(t, i, n, null, null, 1))
  50540. var r = E.generateSideWallUV(T, e, t, i, n)
  50541. T.faceVertexUvs[0].push([r[0], r[1], r[3]]), T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  50542. }
  50543. var s,
  50544. c,
  50545. h,
  50546. u,
  50547. d,
  50548. p = void 0 !== t.amount ? t.amount : 100,
  50549. f = void 0 !== t.bevelThickness ? t.bevelThickness : 6,
  50550. g = void 0 !== t.bevelSize ? t.bevelSize : f - 2,
  50551. m = void 0 !== t.bevelSegments ? t.bevelSegments : 3,
  50552. v = void 0 === t.bevelEnabled || t.bevelEnabled,
  50553. y = void 0 !== t.curveSegments ? t.curveSegments : 12,
  50554. A = void 0 !== t.steps ? t.steps : 1,
  50555. C = t.extrudePath,
  50556. I = !1,
  50557. E = void 0 !== t.UVGenerator ? t.UVGenerator : Ci.ExtrudeGeometry.WorldUVGenerator
  50558. C &&
  50559. ((s = C.getSpacedPoints(A)),
  50560. (v = !(I = !0)),
  50561. (c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C, A, !1)),
  50562. (h = new Ci.Vector3()),
  50563. (u = new Ci.Vector3()),
  50564. (d = new Ci.Vector3())),
  50565. v || (g = f = m = 0)
  50566. var _,
  50567. b,
  50568. w,
  50569. T = this,
  50570. x = this.vertices.length,
  50571. S = e.extractPoints(y),
  50572. M = S.shape,
  50573. R = S.holes,
  50574. P = !Ci.ShapeUtils.isClockWise(M)
  50575. if (P) {
  50576. for (M = M.reverse(), b = 0, w = R.length; b < w; b++) (_ = R[b]), Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse())
  50577. P = !1
  50578. }
  50579. var O = Ci.ShapeUtils.triangulateShape(M, R),
  50580. L = M
  50581. for (b = 0, w = R.length; b < w; b++) (_ = R[b]), (M = M.concat(_))
  50582. for (var D, N, F, B, V, k, U = M.length, H = O.length, z = [], G = 0, W = L.length, j = W - 1, Y = G + 1; G < W; G++, j++, Y++)
  50583. j === W && (j = 0), Y === W && (Y = 0), (z[G] = n(L[G], L[j], L[Y]))
  50584. var q,
  50585. X,
  50586. Z = [],
  50587. K = z.concat()
  50588. for (b = 0, w = R.length; b < w; b++) {
  50589. for (_ = R[b], q = [], G = 0, j = (W = _.length) - 1, Y = G + 1; G < W; G++, j++, Y++) j === W && (j = 0), Y === W && (Y = 0), (q[G] = n(_[G], _[j], _[Y]))
  50590. Z.push(q), (K = K.concat(q))
  50591. }
  50592. for (D = 0; D < m; D++) {
  50593. for (B = f * (1 - (F = D / m)), N = g * Math.sin((F * Math.PI) / 2), G = 0, W = L.length; G < W; G++) o((V = i(L[G], z[G], N)).x, V.y, -B)
  50594. for (b = 0, w = R.length; b < w; b++) for (_ = R[b], q = Z[b], G = 0, W = _.length; G < W; G++) o((V = i(_[G], q[G], N)).x, V.y, -B)
  50595. }
  50596. for (N = g, G = 0; G < U; G++)
  50597. (V = v ? i(M[G], K[G], N) : M[G]),
  50598. I ? (u.copy(c.normals[0]).multiplyScalar(V.x), h.copy(c.binormals[0]).multiplyScalar(V.y), d.copy(s[0]).add(u).add(h), o(d.x, d.y, d.z)) : o(V.x, V.y, 0)
  50599. for (X = 1; X <= A; X++)
  50600. for (G = 0; G < U; G++)
  50601. (V = v ? i(M[G], K[G], N) : M[G]),
  50602. I ? (u.copy(c.normals[X]).multiplyScalar(V.x), h.copy(c.binormals[X]).multiplyScalar(V.y), d.copy(s[X]).add(u).add(h), o(d.x, d.y, d.z)) : o(V.x, V.y, (p / A) * X)
  50603. for (D = m - 1; 0 <= D; D--) {
  50604. for (B = f * (1 - (F = D / m)), N = g * Math.sin((F * Math.PI) / 2), G = 0, W = L.length; G < W; G++) o((V = i(L[G], z[G], N)).x, V.y, p + B)
  50605. for (b = 0, w = R.length; b < w; b++)
  50606. for (_ = R[b], q = Z[b], G = 0, W = _.length; G < W; G++) (V = i(_[G], q[G], N)), I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  50607. }
  50608. ;(function () {
  50609. if (v) {
  50610. var e = 0,
  50611. t = U * e
  50612. for (G = 0; G < H; G++) a((k = O[G])[2] + t, k[1] + t, k[0] + t)
  50613. for (t = U * (e = A + 2 * m), G = 0; G < H; G++) a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  50614. } else {
  50615. for (G = 0; G < H; G++) a((k = O[G])[2], k[1], k[0])
  50616. for (G = 0; G < H; G++) a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  50617. }
  50618. })(),
  50619. (function () {
  50620. var e = 0
  50621. for (r(L, e), e += L.length, b = 0, w = R.length; b < w; b++) r((_ = R[b]), e), (e += _.length)
  50622. })()
  50623. }),
  50624. (Ci.ExtrudeGeometry.WorldUVGenerator = {
  50625. generateTopUV: function (e, t, i, n) {
  50626. var r = e.vertices,
  50627. o = r[t],
  50628. a = r[i],
  50629. s = r[n]
  50630. return [new Ci.Vector2(o.x, o.y), new Ci.Vector2(a.x, a.y), new Ci.Vector2(s.x, s.y)]
  50631. },
  50632. generateSideWallUV: function (e, t, i, n, r) {
  50633. var o = e.vertices,
  50634. a = o[t],
  50635. s = o[i],
  50636. l = o[n],
  50637. c = o[r]
  50638. return Math.abs(a.y - s.y) < 0.01
  50639. ? [new Ci.Vector2(a.x, 1 - a.z), new Ci.Vector2(s.x, 1 - s.z), new Ci.Vector2(l.x, 1 - l.z), new Ci.Vector2(c.x, 1 - c.z)]
  50640. : [new Ci.Vector2(a.y, 1 - a.z), new Ci.Vector2(s.y, 1 - s.z), new Ci.Vector2(l.y, 1 - l.z), new Ci.Vector2(c.y, 1 - c.z)]
  50641. }
  50642. }),
  50643. (Ci.ShapeGeometry = function (e, t) {
  50644. Ci.Geometry.call(this), !(this.type = 'ShapeGeometry') === Array.isArray(e) && (e = [e]), this.addShapeList(e, t), this.computeFaceNormals()
  50645. }),
  50646. (Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  50647. (Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry),
  50648. (Ci.ShapeGeometry.prototype.addShapeList = function (e, t) {
  50649. for (var i = 0, n = e.length; i < n; i++) this.addShape(e[i], t)
  50650. return this
  50651. }),
  50652. (Ci.ShapeGeometry.prototype.addShape = function (e, t) {
  50653. void 0 === t && (t = {})
  50654. var i,
  50655. n,
  50656. r,
  50657. o = void 0 !== t.curveSegments ? t.curveSegments : 12,
  50658. a = t.material,
  50659. s = void 0 === t.UVGenerator ? Ci.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator,
  50660. l = this.vertices.length,
  50661. c = e.extractPoints(o),
  50662. h = c.shape,
  50663. u = c.holes,
  50664. d = !Ci.ShapeUtils.isClockWise(h)
  50665. if (d) {
  50666. for (h = h.reverse(), i = 0, n = u.length; i < n; i++) (r = u[i]), Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse())
  50667. d = !1
  50668. }
  50669. var p = Ci.ShapeUtils.triangulateShape(h, u)
  50670. for (i = 0, n = u.length; i < n; i++) (r = u[i]), (h = h.concat(r))
  50671. var f,
  50672. g,
  50673. m = h.length,
  50674. v = p.length
  50675. for (i = 0; i < m; i++) (f = h[i]), this.vertices.push(new Ci.Vector3(f.x, f.y, 0))
  50676. for (i = 0; i < v; i++) {
  50677. var y = (g = p[i])[0] + l,
  50678. A = g[1] + l,
  50679. C = g[2] + l
  50680. this.faces.push(new Ci.Face3(y, A, C, null, null, a)), this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  50681. }
  50682. }),
  50683. (Ci.LatheBufferGeometry = function (e, t, i, n) {
  50684. Ci.BufferGeometry.call(this),
  50685. (this.type = 'LatheBufferGeometry'),
  50686. (this.parameters = {
  50687. points: e,
  50688. segments: t,
  50689. phiStart: i,
  50690. phiLength: n
  50691. }),
  50692. (t = Math.floor(t) || 12),
  50693. (i = i || 0),
  50694. (n = n || 2 * Math.PI),
  50695. (n = Ci.Math.clamp(n, 0, 2 * Math.PI))
  50696. var r,
  50697. o,
  50698. a,
  50699. s = (t + 1) * e.length,
  50700. l = t * e.length * 2 * 3,
  50701. c = new Ci.BufferAttribute(new (65535 < l ? Uint32Array : Uint16Array)(l), 1),
  50702. h = new Ci.BufferAttribute(new Float32Array(3 * s), 3),
  50703. u = new Ci.BufferAttribute(new Float32Array(2 * s), 2),
  50704. d = 0,
  50705. p = 0,
  50706. f = (e.length, 1 / t),
  50707. g = new Ci.Vector3(),
  50708. m = new Ci.Vector2()
  50709. for (o = 0; o <= t; o++) {
  50710. var v = i + o * f * n,
  50711. y = Math.sin(v),
  50712. A = Math.cos(v)
  50713. for (a = 0; a <= e.length - 1; a++)
  50714. (g.x = e[a].x * y), (g.y = e[a].y), (g.z = e[a].x * A), h.setXYZ(d, g.x, g.y, g.z), (m.x = o / t), (m.y = a / (e.length - 1)), u.setXY(d, m.x, m.y), d++
  50715. }
  50716. for (o = 0; o < t; o++)
  50717. for (a = 0; a < e.length - 1; a++) {
  50718. var C = (r = a + o * e.length),
  50719. I = r + e.length,
  50720. E = r + e.length + 1,
  50721. _ = r + 1
  50722. c.setX(p, C), p++, c.setX(p, I), p++, c.setX(p, _), p++, c.setX(p, I), p++, c.setX(p, E), p++, c.setX(p, _), p++
  50723. }
  50724. if ((this.setIndex(c), this.addAttribute('position', h), this.addAttribute('uv', u), this.computeVertexNormals(), n === 2 * Math.PI)) {
  50725. var b = this.attributes.normal.array,
  50726. w = new Ci.Vector3(),
  50727. T = new Ci.Vector3(),
  50728. x = new Ci.Vector3()
  50729. for (r = t * e.length * 3, a = o = 0; o < e.length; o++, a += 3)
  50730. (w.x = b[a + 0]),
  50731. (w.y = b[a + 1]),
  50732. (w.z = b[a + 2]),
  50733. (T.x = b[r + a + 0]),
  50734. (T.y = b[r + a + 1]),
  50735. (T.z = b[r + a + 2]),
  50736. x.addVectors(w, T).normalize(),
  50737. (b[a + 0] = b[r + a + 0] = x.x),
  50738. (b[a + 1] = b[r + a + 1] = x.y),
  50739. (b[a + 2] = b[r + a + 2] = x.z)
  50740. }
  50741. }),
  50742. (Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  50743. (Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry),
  50744. (Ci.LatheGeometry = function (e, t, i, n) {
  50745. Ci.Geometry.call(this),
  50746. (this.type = 'LatheGeometry'),
  50747. (this.parameters = {
  50748. points: e,
  50749. segments: t,
  50750. phiStart: i,
  50751. phiLength: n
  50752. }),
  50753. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e, t, i, n)),
  50754. this.mergeVertices()
  50755. }),
  50756. (Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  50757. (Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry),
  50758. (Ci.PlaneGeometry = function (e, t, i, n) {
  50759. Ci.Geometry.call(this),
  50760. (this.type = 'PlaneGeometry'),
  50761. (this.parameters = {
  50762. width: e,
  50763. height: t,
  50764. widthSegments: i,
  50765. heightSegments: n
  50766. }),
  50767. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e, t, i, n))
  50768. }),
  50769. (Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  50770. (Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry),
  50771. (Ci.PlaneBufferGeometry = function (e, t, i, n) {
  50772. Ci.BufferGeometry.call(this),
  50773. (this.type = 'PlaneBufferGeometry'),
  50774. (this.parameters = {
  50775. width: e,
  50776. height: t,
  50777. widthSegments: i,
  50778. heightSegments: n
  50779. })
  50780. for (
  50781. var r = e / 2,
  50782. o = t / 2,
  50783. a = Math.floor(i) || 1,
  50784. s = Math.floor(n) || 1,
  50785. l = a + 1,
  50786. c = s + 1,
  50787. h = e / a,
  50788. u = t / s,
  50789. d = new Float32Array(l * c * 3),
  50790. p = new Float32Array(l * c * 3),
  50791. f = new Float32Array(l * c * 2),
  50792. g = 0,
  50793. m = 0,
  50794. v = 0;
  50795. v < c;
  50796. v++
  50797. )
  50798. for (var y = v * u - o, A = 0; A < l; A++) {
  50799. var C = A * h - r
  50800. ;(d[g] = C), (d[g + 1] = -y), (p[g + 2] = 1), (f[m] = A / a), (f[m + 1] = 1 - v / s), (g += 3), (m += 2)
  50801. }
  50802. g = 0
  50803. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6)
  50804. for (v = 0; v < s; v++)
  50805. for (A = 0; A < a; A++) {
  50806. var E = A + l * v,
  50807. _ = A + l * (v + 1),
  50808. b = A + 1 + l * (v + 1),
  50809. w = A + 1 + l * v
  50810. ;(I[g] = E), (I[g + 1] = _), (I[g + 2] = w), (I[g + 3] = _), (I[g + 4] = b), (I[g + 5] = w), (g += 6)
  50811. }
  50812. this.setIndex(new Ci.BufferAttribute(I, 1)),
  50813. this.addAttribute('position', new Ci.BufferAttribute(d, 3)),
  50814. this.addAttribute('normal', new Ci.BufferAttribute(p, 3)),
  50815. this.addAttribute('uv', new Ci.BufferAttribute(f, 2))
  50816. }),
  50817. (Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  50818. (Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry),
  50819. (Ci.RingBufferGeometry = function (e, t, i, n, r, o) {
  50820. Ci.BufferGeometry.call(this),
  50821. (this.type = 'RingBufferGeometry'),
  50822. (this.parameters = {
  50823. innerRadius: e,
  50824. outerRadius: t,
  50825. thetaSegments: i,
  50826. phiSegments: n,
  50827. thetaStart: r,
  50828. thetaLength: o
  50829. }),
  50830. (e = e || 20),
  50831. (t = t || 50),
  50832. (r = void 0 !== r ? r : 0),
  50833. (o = void 0 !== o ? o : 2 * Math.PI)
  50834. var a,
  50835. s,
  50836. l,
  50837. c = ((i = void 0 !== i ? Math.max(3, i) : 8) + 1) * ((n = void 0 !== n ? Math.max(1, n) : 1) + 1),
  50838. h = i * n * 2 * 3,
  50839. u = new Ci.BufferAttribute(new (65535 < h ? Uint32Array : Uint16Array)(h), 1),
  50840. d = new Ci.BufferAttribute(new Float32Array(3 * c), 3),
  50841. p = new Ci.BufferAttribute(new Float32Array(3 * c), 3),
  50842. f = new Ci.BufferAttribute(new Float32Array(2 * c), 2),
  50843. g = 0,
  50844. m = 0,
  50845. v = e,
  50846. y = (t - e) / n,
  50847. A = new Ci.Vector3(),
  50848. C = new Ci.Vector2()
  50849. for (s = 0; s <= n; s++) {
  50850. for (l = 0; l <= i; l++)
  50851. (a = r + (l / i) * o),
  50852. (A.x = v * Math.cos(a)),
  50853. (A.y = v * Math.sin(a)),
  50854. d.setXYZ(g, A.x, A.y, A.z),
  50855. p.setXYZ(g, 0, 0, 1),
  50856. (C.x = (A.x / t + 1) / 2),
  50857. (C.y = (A.y / t + 1) / 2),
  50858. f.setXY(g, C.x, C.y),
  50859. g++
  50860. v += y
  50861. }
  50862. for (s = 0; s < n; s++) {
  50863. var I = s * (i + 1)
  50864. for (l = 0; l < i; l++) {
  50865. var E = (a = l + I),
  50866. _ = a + i + 1,
  50867. b = a + i + 2,
  50868. w = a + 1
  50869. u.setX(m, E), m++, u.setX(m, _), m++, u.setX(m, b), m++, u.setX(m, E), m++, u.setX(m, b), m++, u.setX(m, w), m++
  50870. }
  50871. }
  50872. this.setIndex(u), this.addAttribute('position', d), this.addAttribute('normal', p), this.addAttribute('uv', f)
  50873. }),
  50874. (Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  50875. (Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry),
  50876. (Ci.RingGeometry = function (e, t, i, n, r, o) {
  50877. Ci.Geometry.call(this),
  50878. (this.type = 'RingGeometry'),
  50879. (this.parameters = {
  50880. innerRadius: e,
  50881. outerRadius: t,
  50882. thetaSegments: i,
  50883. phiSegments: n,
  50884. thetaStart: r,
  50885. thetaLength: o
  50886. }),
  50887. this.fromBufferGeometry(new Ci.RingBufferGeometry(e, t, i, n, r, o))
  50888. }),
  50889. (Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  50890. (Ci.RingGeometry.prototype.constructor = Ci.RingGeometry),
  50891. (Ci.SphereGeometry = function (e, t, i, n, r, o, a) {
  50892. Ci.Geometry.call(this),
  50893. (this.type = 'SphereGeometry'),
  50894. (this.parameters = {
  50895. radius: e,
  50896. widthSegments: t,
  50897. heightSegments: i,
  50898. phiStart: n,
  50899. phiLength: r,
  50900. thetaStart: o,
  50901. thetaLength: a
  50902. }),
  50903. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e, t, i, n, r, o, a))
  50904. }),
  50905. (Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  50906. (Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry),
  50907. (Ci.SphereBufferGeometry = function (e, t, i, n, r, o, a) {
  50908. Ci.BufferGeometry.call(this),
  50909. (this.type = 'SphereBufferGeometry'),
  50910. (this.parameters = {
  50911. radius: e,
  50912. widthSegments: t,
  50913. heightSegments: i,
  50914. phiStart: n,
  50915. phiLength: r,
  50916. thetaStart: o,
  50917. thetaLength: a
  50918. }),
  50919. (e = e || 50),
  50920. (t = Math.max(3, Math.floor(t) || 8)),
  50921. (i = Math.max(2, Math.floor(i) || 6)),
  50922. (n = void 0 !== n ? n : 0),
  50923. (r = void 0 !== r ? r : 2 * Math.PI)
  50924. for (
  50925. var s = (o = void 0 !== o ? o : 0) + (a = void 0 !== a ? a : Math.PI),
  50926. l = (t + 1) * (i + 1),
  50927. c = new Ci.BufferAttribute(new Float32Array(3 * l), 3),
  50928. h = new Ci.BufferAttribute(new Float32Array(3 * l), 3),
  50929. u = new Ci.BufferAttribute(new Float32Array(2 * l), 2),
  50930. d = 0,
  50931. p = [],
  50932. f = new Ci.Vector3(),
  50933. g = 0;
  50934. g <= i;
  50935. g++
  50936. ) {
  50937. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  50938. var A = y / t,
  50939. C = -e * Math.cos(n + A * r) * Math.sin(o + v * a),
  50940. I = e * Math.cos(o + v * a),
  50941. E = e * Math.sin(n + A * r) * Math.sin(o + v * a)
  50942. f.set(C, I, E).normalize(), c.setXYZ(d, C, I, E), h.setXYZ(d, f.x, f.y, f.z), u.setXY(d, A, 1 - v), m.push(d), d++
  50943. }
  50944. p.push(m)
  50945. }
  50946. var _ = []
  50947. for (g = 0; g < i; g++)
  50948. for (y = 0; y < t; y++) {
  50949. var b = p[g][y + 1],
  50950. w = p[g][y],
  50951. T = p[g + 1][y],
  50952. x = p[g + 1][y + 1]
  50953. ;(0 !== g || 0 < o) && _.push(b, w, x), (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  50954. }
  50955. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_, 1)),
  50956. this.addAttribute('position', c),
  50957. this.addAttribute('normal', h),
  50958. this.addAttribute('uv', u),
  50959. (this.boundingSphere = new Ci.Sphere(new Ci.Vector3(), e))
  50960. }),
  50961. (Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  50962. (Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry),
  50963. (Ci.TextGeometry = function (e, t) {
  50964. var i = (t = t || {}).font
  50965. if (i instanceof Ci.Font == 0) return console.error('THREE.TextGeometry: font parameter is not an instance of THREE.Font.'), new Ci.Geometry()
  50966. var n = i.generateShapes(e, t.size, t.curveSegments)
  50967. ;(t.amount = void 0 !== t.height ? t.height : 50),
  50968. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  50969. void 0 === t.bevelSize && (t.bevelSize = 8),
  50970. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  50971. Ci.ExtrudeGeometry.call(this, n, t),
  50972. (this.type = 'TextGeometry')
  50973. }),
  50974. (Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype)),
  50975. (Ci.TextGeometry.prototype.constructor = Ci.TextGeometry),
  50976. (Ci.TorusBufferGeometry = function (e, t, i, n, r) {
  50977. Ci.BufferGeometry.call(this),
  50978. (this.type = 'TorusBufferGeometry'),
  50979. (this.parameters = {
  50980. radius: e,
  50981. tube: t,
  50982. radialSegments: i,
  50983. tubularSegments: n,
  50984. arc: r
  50985. }),
  50986. (e = e || 100),
  50987. (t = t || 40),
  50988. (i = Math.floor(i) || 8),
  50989. (n = Math.floor(n) || 6),
  50990. (r = r || 2 * Math.PI)
  50991. var o,
  50992. a,
  50993. s = (i + 1) * (n + 1),
  50994. l = i * n * 2 * 3,
  50995. c = new (65535 < l ? Uint32Array : Uint16Array)(l),
  50996. h = new Float32Array(3 * s),
  50997. u = new Float32Array(3 * s),
  50998. d = new Float32Array(2 * s),
  50999. p = 0,
  51000. f = 0,
  51001. g = 0,
  51002. m = new Ci.Vector3(),
  51003. v = new Ci.Vector3(),
  51004. y = new Ci.Vector3()
  51005. for (o = 0; o <= i; o++)
  51006. for (a = 0; a <= n; a++) {
  51007. var A = (a / n) * r,
  51008. C = (o / i) * Math.PI * 2
  51009. ;(v.x = (e + t * Math.cos(C)) * Math.cos(A)),
  51010. (v.y = (e + t * Math.cos(C)) * Math.sin(A)),
  51011. (v.z = t * Math.sin(C)),
  51012. (h[p] = v.x),
  51013. (h[p + 1] = v.y),
  51014. (h[p + 2] = v.z),
  51015. (m.x = e * Math.cos(A)),
  51016. (m.y = e * Math.sin(A)),
  51017. y.subVectors(v, m).normalize(),
  51018. (u[p] = y.x),
  51019. (u[p + 1] = y.y),
  51020. (u[p + 2] = y.z),
  51021. (d[f] = a / n),
  51022. (d[f + 1] = o / i),
  51023. (p += 3),
  51024. (f += 2)
  51025. }
  51026. for (o = 1; o <= i; o++)
  51027. for (a = 1; a <= n; a++) {
  51028. var I = (n + 1) * o + a - 1,
  51029. E = (n + 1) * (o - 1) + a - 1,
  51030. _ = (n + 1) * (o - 1) + a,
  51031. b = (n + 1) * o + a
  51032. ;(c[g] = I), (c[g + 1] = E), (c[g + 2] = b), (c[g + 3] = E), (c[g + 4] = _), (c[g + 5] = b), (g += 6)
  51033. }
  51034. this.setIndex(new Ci.BufferAttribute(c, 1)),
  51035. this.addAttribute('position', new Ci.BufferAttribute(h, 3)),
  51036. this.addAttribute('normal', new Ci.BufferAttribute(u, 3)),
  51037. this.addAttribute('uv', new Ci.BufferAttribute(d, 2))
  51038. }),
  51039. (Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  51040. (Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry),
  51041. (Ci.TorusGeometry = function (e, t, i, n, r) {
  51042. Ci.Geometry.call(this),
  51043. (this.type = 'TorusGeometry'),
  51044. (this.parameters = {
  51045. radius: e,
  51046. tube: t,
  51047. radialSegments: i,
  51048. tubularSegments: n,
  51049. arc: r
  51050. }),
  51051. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e, t, i, n, r))
  51052. }),
  51053. (Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  51054. (Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry),
  51055. (Ci.TorusKnotBufferGeometry = function (e, t, i, n, r, o) {
  51056. function a(e, t, i, n, r) {
  51057. var o = Math.cos(e),
  51058. a = Math.sin(e),
  51059. s = (i / t) * e,
  51060. l = Math.cos(s)
  51061. ;(r.x = n * (2 + l) * 0.5 * o), (r.y = n * (2 + l) * a * 0.5), (r.z = n * Math.sin(s) * 0.5)
  51062. }
  51063. Ci.BufferGeometry.call(this),
  51064. (this.type = 'TorusKnotBufferGeometry'),
  51065. (this.parameters = {
  51066. radius: e,
  51067. tube: t,
  51068. tubularSegments: i,
  51069. radialSegments: n,
  51070. p: r,
  51071. q: o
  51072. }),
  51073. (e = e || 100),
  51074. (t = t || 40),
  51075. (i = Math.floor(i) || 64),
  51076. (r = r || 2),
  51077. (o = o || 3)
  51078. var s,
  51079. l,
  51080. c = ((n = Math.floor(n) || 8) + 1) * (i + 1),
  51081. h = n * i * 2 * 3,
  51082. u = new Ci.BufferAttribute(new (65535 < h ? Uint32Array : Uint16Array)(h), 1),
  51083. d = new Ci.BufferAttribute(new Float32Array(3 * c), 3),
  51084. p = new Ci.BufferAttribute(new Float32Array(3 * c), 3),
  51085. f = new Ci.BufferAttribute(new Float32Array(2 * c), 2),
  51086. g = 0,
  51087. m = 0,
  51088. v = new Ci.Vector3(),
  51089. y = new Ci.Vector3(),
  51090. A = new Ci.Vector2(),
  51091. C = new Ci.Vector3(),
  51092. I = new Ci.Vector3(),
  51093. E = new Ci.Vector3(),
  51094. _ = new Ci.Vector3(),
  51095. b = new Ci.Vector3()
  51096. for (s = 0; s <= i; ++s) {
  51097. var w = (s / i) * r * Math.PI * 2
  51098. for (a(w, r, o, e, C), a(0.01 + w, r, o, e, I), _.subVectors(I, C), b.addVectors(I, C), E.crossVectors(_, b), b.crossVectors(E, _), E.normalize(), b.normalize(), l = 0; l <= n; ++l) {
  51099. var T = (l / n) * Math.PI * 2,
  51100. x = -t * Math.cos(T),
  51101. S = t * Math.sin(T)
  51102. ;(v.x = C.x + (x * b.x + S * E.x)),
  51103. (v.y = C.y + (x * b.y + S * E.y)),
  51104. (v.z = C.z + (x * b.z + S * E.z)),
  51105. d.setXYZ(g, v.x, v.y, v.z),
  51106. y.subVectors(v, C).normalize(),
  51107. p.setXYZ(g, y.x, y.y, y.z),
  51108. (A.x = s / i),
  51109. (A.y = l / n),
  51110. f.setXY(g, A.x, A.y),
  51111. g++
  51112. }
  51113. }
  51114. for (l = 1; l <= i; l++)
  51115. for (s = 1; s <= n; s++) {
  51116. var M = (n + 1) * (l - 1) + (s - 1),
  51117. R = (n + 1) * l + (s - 1),
  51118. P = (n + 1) * l + s,
  51119. O = (n + 1) * (l - 1) + s
  51120. u.setX(m, M), m++, u.setX(m, R), m++, u.setX(m, O), m++, u.setX(m, R), m++, u.setX(m, P), m++, u.setX(m, O), m++
  51121. }
  51122. this.setIndex(u), this.addAttribute('position', d), this.addAttribute('normal', p), this.addAttribute('uv', f)
  51123. }),
  51124. (Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  51125. (Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry),
  51126. (Ci.TorusKnotGeometry = function (e, t, i, n, r, o, a) {
  51127. Ci.Geometry.call(this),
  51128. (this.type = 'TorusKnotGeometry'),
  51129. (this.parameters = {
  51130. radius: e,
  51131. tube: t,
  51132. tubularSegments: i,
  51133. radialSegments: n,
  51134. p: r,
  51135. q: o
  51136. }),
  51137. void 0 !== a && console.warn('THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead.'),
  51138. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e, t, i, n, r, o)),
  51139. this.mergeVertices()
  51140. }),
  51141. (Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  51142. (Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry),
  51143. (Ci.TubeGeometry = function (e, t, i, n, r, o) {
  51144. Ci.Geometry.call(this),
  51145. (this.type = 'TubeGeometry'),
  51146. (this.parameters = {
  51147. path: e,
  51148. segments: t,
  51149. radius: i,
  51150. radialSegments: n,
  51151. closed: r,
  51152. taper: o
  51153. }),
  51154. (t = t || 64),
  51155. (i = i || 1),
  51156. (n = n || 8),
  51157. (r = r || !1),
  51158. (o = o || Ci.TubeGeometry.NoTaper)
  51159. var a,
  51160. s,
  51161. l,
  51162. c,
  51163. h,
  51164. u,
  51165. d,
  51166. p,
  51167. f,
  51168. g,
  51169. m,
  51170. v,
  51171. y,
  51172. A,
  51173. C,
  51174. I,
  51175. E,
  51176. _,
  51177. b,
  51178. w,
  51179. T,
  51180. x,
  51181. S,
  51182. M = [],
  51183. R = this,
  51184. P = t + 1,
  51185. O = new Ci.Vector3(),
  51186. L = new Ci.TubeGeometry.FrenetFrames(e, t, r),
  51187. D = L.tangents,
  51188. N = L.normals,
  51189. F = L.binormals
  51190. for (this.tangents = D, this.normals = N, this.binormals = F, f = 0; f < P; f++)
  51191. for (M[f] = [], l = f / (P - 1), p = e.getPointAt(l), D[f], a = N[f], s = F[f], h = i * o(l), g = 0; g < n; g++)
  51192. (c = (g / n) * 2 * Math.PI),
  51193. (u = -h * Math.cos(c)),
  51194. (d = h * Math.sin(c)),
  51195. O.copy(p),
  51196. (O.x += u * a.x + d * s.x),
  51197. (O.y += u * a.y + d * s.y),
  51198. (O.z += u * a.z + d * s.z),
  51199. (M[f][g] = ((T = O.x), (x = O.y), (S = O.z), R.vertices.push(new Ci.Vector3(T, x, S)) - 1))
  51200. for (f = 0; f < t; f++)
  51201. for (g = 0; g < n; g++)
  51202. (m = r ? (f + 1) % t : f + 1),
  51203. (v = (g + 1) % n),
  51204. (y = M[f][g]),
  51205. (A = M[m][g]),
  51206. (C = M[m][v]),
  51207. (I = M[f][v]),
  51208. (E = new Ci.Vector2(f / t, g / n)),
  51209. (_ = new Ci.Vector2((f + 1) / t, g / n)),
  51210. (b = new Ci.Vector2((f + 1) / t, (g + 1) / n)),
  51211. (w = new Ci.Vector2(f / t, (g + 1) / n)),
  51212. this.faces.push(new Ci.Face3(y, A, I)),
  51213. this.faceVertexUvs[0].push([E, _, w]),
  51214. this.faces.push(new Ci.Face3(A, C, I)),
  51215. this.faceVertexUvs[0].push([_.clone(), b, w.clone()])
  51216. this.computeFaceNormals(), this.computeVertexNormals()
  51217. }),
  51218. (Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  51219. (Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry),
  51220. (Ci.TubeGeometry.NoTaper = function (e) {
  51221. return 1
  51222. }),
  51223. (Ci.TubeGeometry.SinusoidalTaper = function (e) {
  51224. return Math.sin(Math.PI * e)
  51225. }),
  51226. (Ci.TubeGeometry.FrenetFrames = function (e, t, i) {
  51227. var n,
  51228. r,
  51229. o,
  51230. a,
  51231. s,
  51232. l,
  51233. c,
  51234. h = new Ci.Vector3(),
  51235. u = [],
  51236. d = [],
  51237. p = [],
  51238. f = new Ci.Vector3(),
  51239. g = new Ci.Matrix4(),
  51240. m = t + 1
  51241. for (this.tangents = u, this.normals = d, this.binormals = p, l = 0; l < m; l++) (c = l / (m - 1)), (u[l] = e.getTangentAt(c)), u[l].normalize()
  51242. for (
  51243. d[0] = new Ci.Vector3(),
  51244. p[0] = new Ci.Vector3(),
  51245. r = Number.MAX_VALUE,
  51246. o = Math.abs(u[0].x),
  51247. a = Math.abs(u[0].y),
  51248. s = Math.abs(u[0].z),
  51249. o <= r && ((r = o), h.set(1, 0, 0)),
  51250. a <= r && ((r = a), h.set(0, 1, 0)),
  51251. s <= r && h.set(0, 0, 1),
  51252. f.crossVectors(u[0], h).normalize(),
  51253. d[0].crossVectors(u[0], f),
  51254. p[0].crossVectors(u[0], d[0]),
  51255. l = 1;
  51256. l < m;
  51257. l++
  51258. )
  51259. (d[l] = d[l - 1].clone()),
  51260. (p[l] = p[l - 1].clone()),
  51261. f.crossVectors(u[l - 1], u[l]),
  51262. f.length() > Number.EPSILON && (f.normalize(), (n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1))), d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  51263. p[l].crossVectors(u[l], d[l])
  51264. if (i)
  51265. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)), n /= m - 1, 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n), l = 1; l < m; l++)
  51266. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)), p[l].crossVectors(u[l], d[l])
  51267. }),
  51268. (Ci.PolyhedronGeometry = function (e, t, i, n) {
  51269. function f(e) {
  51270. var t = e.normalize().clone()
  51271. t.index = m.vertices.push(t) - 1
  51272. var i = a(e) / 2 / Math.PI + 0.5,
  51273. n =
  51274. (function (e) {
  51275. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  51276. })(e) /
  51277. Math.PI +
  51278. 0.5
  51279. return (t.uv = new Ci.Vector2(i, 1 - n)), t
  51280. }
  51281. function g(e, t, i, n) {
  51282. var r = new Ci.Face3(e.index, t.index, i.index, [e.clone(), t.clone(), i.clone()], void 0, n)
  51283. m.faces.push(r), y.copy(e).add(t).add(i).divideScalar(3)
  51284. var o = a(y)
  51285. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  51286. }
  51287. function r(e, t) {
  51288. for (var i = Math.pow(2, t), n = f(m.vertices[e.a]), r = f(m.vertices[e.b]), o = f(m.vertices[e.c]), a = [], s = e.materialIndex, l = 0; l <= i; l++) {
  51289. a[l] = []
  51290. for (var c = f(n.clone().lerp(o, l / i)), h = f(r.clone().lerp(o, l / i)), u = i - l, d = 0; d <= u; d++) a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  51291. }
  51292. for (l = 0; l < i; l++)
  51293. for (d = 0; d < 2 * (i - l) - 1; d++) {
  51294. var p = Math.floor(d / 2)
  51295. d % 2 == 0 ? g(a[l][p + 1], a[l + 1][p], a[l][p], s) : g(a[l][p + 1], a[l + 1][p + 1], a[l + 1][p], s)
  51296. }
  51297. }
  51298. function a(e) {
  51299. return Math.atan2(e.z, -e.x)
  51300. }
  51301. function s(e, t, i) {
  51302. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1, e.y)), 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + 0.5, e.y)), e.clone()
  51303. }
  51304. Ci.Geometry.call(this),
  51305. (this.type = 'PolyhedronGeometry'),
  51306. (this.parameters = {
  51307. vertices: e,
  51308. indices: t,
  51309. radius: i,
  51310. detail: n
  51311. }),
  51312. (i = i || 1),
  51313. (n = n || 0)
  51314. for (var m = this, o = 0, l = e.length; o < l; o += 3) f(new Ci.Vector3(e[o], e[o + 1], e[o + 2]))
  51315. var c = this.vertices,
  51316. h = [],
  51317. u = ((o = 0), 0)
  51318. for (l = t.length; o < l; o += 3, u++) {
  51319. var d = c[t[o]],
  51320. p = c[t[o + 1]],
  51321. v = c[t[o + 2]]
  51322. h[u] = new Ci.Face3(d.index, p.index, v.index, [d.clone(), p.clone(), v.clone()], void 0, u)
  51323. }
  51324. var y = new Ci.Vector3()
  51325. for (o = 0, l = h.length; o < l; o++) r(h[o], n)
  51326. for (o = 0, l = this.faceVertexUvs[0].length; o < l; o++) {
  51327. var A = this.faceVertexUvs[0][o],
  51328. C = A[0].x,
  51329. I = A[1].x,
  51330. E = A[2].x,
  51331. _ = Math.max(C, I, E),
  51332. b = Math.min(C, I, E)
  51333. 0.9 < _ && b < 0.1 && (C < 0.2 && (A[0].x += 1), I < 0.2 && (A[1].x += 1), E < 0.2 && (A[2].x += 1))
  51334. }
  51335. for (o = 0, l = this.vertices.length; o < l; o++) this.vertices[o].multiplyScalar(i)
  51336. this.mergeVertices(), this.computeFaceNormals(), (this.boundingSphere = new Ci.Sphere(new Ci.Vector3(), i))
  51337. }),
  51338. (Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  51339. (Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry),
  51340. (Ci.DodecahedronGeometry = function (e, t) {
  51341. var i = (1 + Math.sqrt(5)) / 2,
  51342. n = 1 / i,
  51343. r = [
  51344. -1,
  51345. -1,
  51346. -1,
  51347. -1,
  51348. -1,
  51349. 1,
  51350. -1,
  51351. 1,
  51352. -1,
  51353. -1,
  51354. 1,
  51355. 1,
  51356. 1,
  51357. -1,
  51358. -1,
  51359. 1,
  51360. -1,
  51361. 1,
  51362. 1,
  51363. 1,
  51364. -1,
  51365. 1,
  51366. 1,
  51367. 1,
  51368. 0,
  51369. -n,
  51370. -i,
  51371. 0,
  51372. -n,
  51373. i,
  51374. 0,
  51375. n,
  51376. -i,
  51377. 0,
  51378. n,
  51379. i,
  51380. -n,
  51381. -i,
  51382. 0,
  51383. -n,
  51384. i,
  51385. 0,
  51386. n,
  51387. -i,
  51388. 0,
  51389. n,
  51390. i,
  51391. 0,
  51392. -i,
  51393. 0,
  51394. -n,
  51395. i,
  51396. 0,
  51397. -n,
  51398. -i,
  51399. 0,
  51400. n,
  51401. i,
  51402. 0,
  51403. n
  51404. ]
  51405. Ci.PolyhedronGeometry.call(
  51406. this,
  51407. r,
  51408. [
  51409. 3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10, 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0, 12, 1, 0, 1, 18, 0, 18, 16, 6, 10, 2, 6, 2, 13, 6, 13,
  51410. 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4, 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14, 5,
  51411. 1, 5, 9
  51412. ],
  51413. e,
  51414. t
  51415. ),
  51416. (this.type = 'DodecahedronGeometry'),
  51417. (this.parameters = {
  51418. radius: e,
  51419. detail: t
  51420. })
  51421. }),
  51422. (Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype)),
  51423. (Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry),
  51424. (Ci.IcosahedronGeometry = function (e, t) {
  51425. var i = (1 + Math.sqrt(5)) / 2,
  51426. n = [-1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, 0, 0, -1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, i, 0, -1, i, 0, 1, -i, 0, -1, -i, 0, 1]
  51427. Ci.PolyhedronGeometry.call(
  51428. this,
  51429. n,
  51430. [
  51431. 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7,
  51432. 9, 8, 1
  51433. ],
  51434. e,
  51435. t
  51436. ),
  51437. (this.type = 'IcosahedronGeometry'),
  51438. (this.parameters = {
  51439. radius: e,
  51440. detail: t
  51441. })
  51442. }),
  51443. (Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype)),
  51444. (Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry),
  51445. (Ci.OctahedronGeometry = function (e, t) {
  51446. Ci.PolyhedronGeometry.call(this, [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1], [0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2], e, t),
  51447. (this.type = 'OctahedronGeometry'),
  51448. (this.parameters = {
  51449. radius: e,
  51450. detail: t
  51451. })
  51452. }),
  51453. (Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype)),
  51454. (Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry),
  51455. (Ci.TetrahedronGeometry = function (e, t) {
  51456. Ci.PolyhedronGeometry.call(this, [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1], [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1], e, t),
  51457. (this.type = 'TetrahedronGeometry'),
  51458. (this.parameters = {
  51459. radius: e,
  51460. detail: t
  51461. })
  51462. }),
  51463. (Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype)),
  51464. (Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry),
  51465. (Ci.ParametricGeometry = function (e, t, i) {
  51466. Ci.Geometry.call(this),
  51467. (this.type = 'ParametricGeometry'),
  51468. (this.parameters = {
  51469. func: e,
  51470. slices: t,
  51471. stacks: i
  51472. })
  51473. var n,
  51474. r,
  51475. o,
  51476. a,
  51477. s,
  51478. l,
  51479. c,
  51480. h,
  51481. u,
  51482. d,
  51483. p,
  51484. f,
  51485. g = this.vertices,
  51486. m = this.faces,
  51487. v = this.faceVertexUvs[0],
  51488. y = t + 1
  51489. for (n = 0; n <= i; n++) for (a = n / i, r = 0; r <= t; r++) (o = e(r / t, a)), g.push(o)
  51490. for (n = 0; n < i; n++)
  51491. for (r = 0; r < t; r++)
  51492. (l = (s = n * y + r) + 1),
  51493. (c = (n + 1) * y + r + 1),
  51494. (h = (n + 1) * y + r),
  51495. (u = new Ci.Vector2(r / t, n / i)),
  51496. (d = new Ci.Vector2((r + 1) / t, n / i)),
  51497. (p = new Ci.Vector2((r + 1) / t, (n + 1) / i)),
  51498. (f = new Ci.Vector2(r / t, (n + 1) / i)),
  51499. m.push(new Ci.Face3(s, l, h)),
  51500. v.push([u, d, f]),
  51501. m.push(new Ci.Face3(l, c, h)),
  51502. v.push([d.clone(), p, f.clone()])
  51503. this.computeFaceNormals(), this.computeVertexNormals()
  51504. }),
  51505. (Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  51506. (Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry),
  51507. (Ci.WireframeGeometry = function (e) {
  51508. function t(e, t) {
  51509. return e - t
  51510. }
  51511. Ci.BufferGeometry.call(this)
  51512. var i = [0, 0],
  51513. n = {},
  51514. r = ['a', 'b', 'c']
  51515. if (e instanceof Ci.Geometry) {
  51516. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  51517. for (var u = a[c], d = 0; d < 3; d++) {
  51518. ;(i[0] = u[r[d]]), (i[1] = u[r[(d + 1) % 3]]), i.sort(t), void 0 === n[(E = i.toString())] && ((l[2 * s] = i[0]), (l[2 * s + 1] = i[1]), (n[E] = !0), s++)
  51519. }
  51520. var p = new Float32Array(2 * s * 3)
  51521. for (c = 0, h = s; c < h; c++)
  51522. for (d = 0; d < 2; d++) {
  51523. var f = o[l[2 * c + d]]
  51524. ;(p[(_ = 6 * c + 3 * d) + 0] = f.x), (p[_ + 1] = f.y), (p[_ + 2] = f.z)
  51525. }
  51526. this.addAttribute('position', new Ci.BufferAttribute(p, 3))
  51527. } else if (e instanceof Ci.BufferGeometry)
  51528. if (null !== e.index) {
  51529. var g = e.index.array,
  51530. m = ((o = e.attributes.position), e.groups)
  51531. s = 0
  51532. 0 === m.length && e.addGroup(0, g.length)
  51533. l = new Uint32Array(2 * g.length)
  51534. for (var v = 0, y = m.length; v < y; ++v)
  51535. for (var A = m[v], C = A.start, I = ((c = C), C + A.count); c < I; c += 3)
  51536. for (d = 0; d < 3; d++) {
  51537. var E
  51538. ;(i[0] = g[c + d]), (i[1] = g[c + ((d + 1) % 3)]), i.sort(t), void 0 === n[(E = i.toString())] && ((l[2 * s] = i[0]), (l[2 * s + 1] = i[1]), (n[E] = !0), s++)
  51539. }
  51540. for (p = new Float32Array(2 * s * 3), c = 0, h = s; c < h; c++)
  51541. for (d = 0; d < 2; d++) {
  51542. var _ = 6 * c + 3 * d,
  51543. b = l[2 * c + d]
  51544. ;(p[_ + 0] = o.getX(b)), (p[_ + 1] = o.getY(b)), (p[_ + 2] = o.getZ(b))
  51545. }
  51546. this.addAttribute('position', new Ci.BufferAttribute(p, 3))
  51547. } else {
  51548. var w = (s = (o = e.attributes.position.array).length / 3) / 3
  51549. for (p = new Float32Array(2 * s * 3), c = 0, h = w; c < h; c++)
  51550. for (d = 0; d < 3; d++) {
  51551. var T = 9 * c + 3 * d
  51552. ;(p[(_ = 18 * c + 6 * d) + 0] = o[T]), (p[_ + 1] = o[1 + T]), (p[_ + 2] = o[2 + T])
  51553. b = 9 * c + ((d + 1) % 3) * 3
  51554. ;(p[_ + 3] = o[b]), (p[_ + 4] = o[b + 1]), (p[_ + 5] = o[b + 2])
  51555. }
  51556. this.addAttribute('position', new Ci.BufferAttribute(p, 3))
  51557. }
  51558. }),
  51559. (Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  51560. (Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry),
  51561. (Ci.AxisHelper = function (e) {
  51562. e = e || 1
  51563. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e]),
  51564. i = new Float32Array([1, 0, 0, 1, 0.6, 0, 0, 1, 0, 0.6, 1, 0, 0, 0, 1, 0, 0.6, 1]),
  51565. n = new Ci.BufferGeometry()
  51566. n.addAttribute('position', new Ci.BufferAttribute(t, 3)), n.addAttribute('color', new Ci.BufferAttribute(i, 3))
  51567. var r = new Ci.LineBasicMaterial({
  51568. vertexColors: Ci.VertexColors
  51569. })
  51570. Ci.LineSegments.call(this, n, r)
  51571. }),
  51572. (Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype)),
  51573. (Ci.AxisHelper.prototype.constructor = Ci.AxisHelper),
  51574. (Ci.ArrowHelper = (function () {
  51575. var a = new Ci.Geometry()
  51576. a.vertices.push(new Ci.Vector3(0, 0, 0), new Ci.Vector3(0, 1, 0))
  51577. var s = new Ci.CylinderGeometry(0, 0.5, 1, 5, 1)
  51578. return (
  51579. s.translate(0, -0.5, 0),
  51580. function (e, t, i, n, r, o) {
  51581. Ci.Object3D.call(this),
  51582. void 0 === n && (n = 16776960),
  51583. void 0 === i && (i = 1),
  51584. void 0 === r && (r = 0.2 * i),
  51585. void 0 === o && (o = 0.2 * r),
  51586. this.position.copy(t),
  51587. (this.line = new Ci.Line(
  51588. a,
  51589. new Ci.LineBasicMaterial({
  51590. color: n
  51591. })
  51592. )),
  51593. (this.line.matrixAutoUpdate = !1),
  51594. this.add(this.line),
  51595. (this.cone = new Ci.Mesh(
  51596. s,
  51597. new Ci.MeshBasicMaterial({
  51598. color: n
  51599. })
  51600. )),
  51601. (this.cone.matrixAutoUpdate = !1),
  51602. this.add(this.cone),
  51603. this.setDirection(e),
  51604. this.setLength(i, r, o)
  51605. }
  51606. )
  51607. })()),
  51608. (Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype)),
  51609. (Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper),
  51610. (Ci.ArrowHelper.prototype.setDirection =
  51611. ((Ai = new Ci.Vector3()),
  51612. function (e) {
  51613. 0.99999 < e.y
  51614. ? this.quaternion.set(0, 0, 0, 1)
  51615. : e.y < -0.99999
  51616. ? this.quaternion.set(1, 0, 0, 0)
  51617. : (Ai.set(e.z, 0, -e.x).normalize(), (yi = Math.acos(e.y)), this.quaternion.setFromAxisAngle(Ai, yi))
  51618. })),
  51619. (Ci.ArrowHelper.prototype.setLength = function (e, t, i) {
  51620. void 0 === t && (t = 0.2 * e),
  51621. void 0 === i && (i = 0.2 * t),
  51622. this.line.scale.set(1, Math.max(0, e - t), 1),
  51623. this.line.updateMatrix(),
  51624. this.cone.scale.set(i, t, i),
  51625. (this.cone.position.y = e),
  51626. this.cone.updateMatrix()
  51627. }),
  51628. (Ci.ArrowHelper.prototype.setColor = function (e) {
  51629. this.line.material.color.set(e), this.cone.material.color.set(e)
  51630. }),
  51631. (Ci.BoxHelper = function (e) {
  51632. var t = new Uint16Array([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7]),
  51633. i = new Float32Array(24),
  51634. n = new Ci.BufferGeometry()
  51635. n.setIndex(new Ci.BufferAttribute(t, 1)),
  51636. n.addAttribute('position', new Ci.BufferAttribute(i, 3)),
  51637. Ci.LineSegments.call(
  51638. this,
  51639. n,
  51640. new Ci.LineBasicMaterial({
  51641. color: 16776960
  51642. })
  51643. ),
  51644. void 0 !== e && this.update(e)
  51645. }),
  51646. (Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype)),
  51647. (Ci.BoxHelper.prototype.constructor = Ci.BoxHelper),
  51648. (Ci.BoxHelper.prototype.update =
  51649. ((vi = new Ci.Box3()),
  51650. function (e) {
  51651. if ((vi.setFromObject(e), !vi.isEmpty())) {
  51652. var t = vi.min,
  51653. i = vi.max,
  51654. n = this.geometry.attributes.position,
  51655. r = n.array
  51656. ;(r[0] = i.x),
  51657. (r[1] = i.y),
  51658. (r[2] = i.z),
  51659. (r[3] = t.x),
  51660. (r[4] = i.y),
  51661. (r[5] = i.z),
  51662. (r[6] = t.x),
  51663. (r[7] = t.y),
  51664. (r[8] = i.z),
  51665. (r[9] = i.x),
  51666. (r[10] = t.y),
  51667. (r[11] = i.z),
  51668. (r[12] = i.x),
  51669. (r[13] = i.y),
  51670. (r[14] = t.z),
  51671. (r[15] = t.x),
  51672. (r[16] = i.y),
  51673. (r[17] = t.z),
  51674. (r[18] = t.x),
  51675. (r[19] = t.y),
  51676. (r[20] = t.z),
  51677. (r[21] = i.x),
  51678. (r[22] = t.y),
  51679. (r[23] = t.z),
  51680. (n.needsUpdate = !0),
  51681. this.geometry.computeBoundingSphere()
  51682. }
  51683. })),
  51684. (Ci.BoundingBoxHelper = function (e, t) {
  51685. var i = void 0 !== t ? t : 8947848
  51686. ;(this.object = e),
  51687. (this.box = new Ci.Box3()),
  51688. Ci.Mesh.call(
  51689. this,
  51690. new Ci.BoxGeometry(1, 1, 1),
  51691. new Ci.MeshBasicMaterial({
  51692. color: i,
  51693. wireframe: !0
  51694. })
  51695. )
  51696. }),
  51697. (Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype)),
  51698. (Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper),
  51699. (Ci.BoundingBoxHelper.prototype.update = function () {
  51700. this.box.setFromObject(this.object), this.box.size(this.scale), this.box.center(this.position)
  51701. }),
  51702. (Ci.CameraHelper = function (e) {
  51703. function t(e, t, i) {
  51704. n(e, i), n(t, i)
  51705. }
  51706. function n(e, t) {
  51707. i.vertices.push(new Ci.Vector3()), i.colors.push(new Ci.Color(t)), void 0 === o[e] && (o[e] = []), o[e].push(i.vertices.length - 1)
  51708. }
  51709. var i = new Ci.Geometry(),
  51710. r = new Ci.LineBasicMaterial({
  51711. color: 16777215,
  51712. vertexColors: Ci.FaceColors
  51713. }),
  51714. o = {},
  51715. a = 16755200,
  51716. s = 16711680,
  51717. l = 3355443
  51718. t('n1', 'n2', a),
  51719. t('n2', 'n4', a),
  51720. t('n4', 'n3', a),
  51721. t('n3', 'n1', a),
  51722. t('f1', 'f2', a),
  51723. t('f2', 'f4', a),
  51724. t('f4', 'f3', a),
  51725. t('f3', 'f1', a),
  51726. t('n1', 'f1', a),
  51727. t('n2', 'f2', a),
  51728. t('n3', 'f3', a),
  51729. t('n4', 'f4', a),
  51730. t('p', 'n1', s),
  51731. t('p', 'n2', s),
  51732. t('p', 'n3', s),
  51733. t('p', 'n4', s),
  51734. t('u1', 'u2', 43775),
  51735. t('u2', 'u3', 43775),
  51736. t('u3', 'u1', 43775),
  51737. t('c', 't', 16777215),
  51738. t('p', 'c', l),
  51739. t('cn1', 'cn2', l),
  51740. t('cn3', 'cn4', l),
  51741. t('cf1', 'cf2', l),
  51742. t('cf3', 'cf4', l),
  51743. Ci.LineSegments.call(this, i, r),
  51744. (this.camera = e),
  51745. this.camera.updateProjectionMatrix(),
  51746. (this.matrix = e.matrixWorld),
  51747. (this.matrixAutoUpdate = !1),
  51748. (this.pointMap = o),
  51749. this.update()
  51750. }),
  51751. (Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype)),
  51752. (Ci.CameraHelper.prototype.constructor = Ci.CameraHelper),
  51753. (Ci.CameraHelper.prototype.update =
  51754. ((gi = new Ci.Vector3()),
  51755. (mi = new Ci.Camera()),
  51756. function () {
  51757. ;(pi = this.geometry),
  51758. (fi = this.pointMap),
  51759. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  51760. Ni('c', 0, 0, -1),
  51761. Ni('t', 0, 0, 1),
  51762. Ni('n1', -1, -1, -1),
  51763. Ni('n2', 1, -1, -1),
  51764. Ni('n3', -1, 1, -1),
  51765. Ni('n4', 1, 1, -1),
  51766. Ni('f1', -1, -1, 1),
  51767. Ni('f2', 1, -1, 1),
  51768. Ni('f3', -1, 1, 1),
  51769. Ni('f4', 1, 1, 1),
  51770. Ni('u1', 0.7, 1.1, -1),
  51771. Ni('u2', -0.7, 1.1, -1),
  51772. Ni('u3', 0, 2, -1),
  51773. Ni('cf1', -1, 0, 1),
  51774. Ni('cf2', 1, 0, 1),
  51775. Ni('cf3', 0, -1, 1),
  51776. Ni('cf4', 0, 1, 1),
  51777. Ni('cn1', -1, 0, -1),
  51778. Ni('cn2', 1, 0, -1),
  51779. Ni('cn3', 0, -1, -1),
  51780. Ni('cn4', 0, 1, -1),
  51781. (pi.verticesNeedUpdate = !0)
  51782. })),
  51783. (Ci.DirectionalLightHelper = function (e, t) {
  51784. Ci.Object3D.call(this), (this.light = e), this.light.updateMatrixWorld(), (this.matrix = e.matrixWorld), (this.matrixAutoUpdate = !1), (t = t || 1)
  51785. var i = new Ci.Geometry()
  51786. i.vertices.push(new Ci.Vector3(-t, t, 0), new Ci.Vector3(t, t, 0), new Ci.Vector3(t, -t, 0), new Ci.Vector3(-t, -t, 0), new Ci.Vector3(-t, t, 0))
  51787. var n = new Ci.LineBasicMaterial({
  51788. fog: !1
  51789. })
  51790. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  51791. (this.lightPlane = new Ci.Line(i, n)),
  51792. this.add(this.lightPlane),
  51793. (i = new Ci.Geometry()).vertices.push(new Ci.Vector3(), new Ci.Vector3()),
  51794. (n = new Ci.LineBasicMaterial({
  51795. fog: !1
  51796. })).color
  51797. .copy(this.light.color)
  51798. .multiplyScalar(this.light.intensity),
  51799. (this.targetLine = new Ci.Line(i, n)),
  51800. this.add(this.targetLine),
  51801. this.update()
  51802. }),
  51803. (Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype)),
  51804. (Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper),
  51805. (Ci.DirectionalLightHelper.prototype.dispose = function () {
  51806. this.lightPlane.geometry.dispose(), this.lightPlane.material.dispose(), this.targetLine.geometry.dispose(), this.targetLine.material.dispose()
  51807. }),
  51808. (Ci.DirectionalLightHelper.prototype.update =
  51809. ((hi = new Ci.Vector3()),
  51810. (ui = new Ci.Vector3()),
  51811. (di = new Ci.Vector3()),
  51812. function () {
  51813. hi.setFromMatrixPosition(this.light.matrixWorld),
  51814. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  51815. di.subVectors(ui, hi),
  51816. this.lightPlane.lookAt(di),
  51817. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  51818. this.targetLine.geometry.vertices[1].copy(di),
  51819. (this.targetLine.geometry.verticesNeedUpdate = !0),
  51820. this.targetLine.material.color.copy(this.lightPlane.material.color)
  51821. })),
  51822. (Ci.EdgesHelper = function (e, t, i) {
  51823. var n = void 0 !== t ? t : 16777215
  51824. Ci.LineSegments.call(
  51825. this,
  51826. new Ci.EdgesGeometry(e.geometry, i),
  51827. new Ci.LineBasicMaterial({
  51828. color: n
  51829. })
  51830. ),
  51831. (this.matrix = e.matrixWorld),
  51832. (this.matrixAutoUpdate = !1)
  51833. }),
  51834. (Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype)),
  51835. (Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper),
  51836. (Ci.FaceNormalsHelper = function (e, t, i, n) {
  51837. ;(this.object = e), (this.size = void 0 !== t ? t : 1)
  51838. var r = void 0 !== i ? i : 16776960,
  51839. o = void 0 !== n ? n : 1,
  51840. a = 0,
  51841. s = this.object.geometry
  51842. s instanceof Ci.Geometry ? (a = s.faces.length) : console.warn('THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.')
  51843. var l = new Ci.BufferGeometry(),
  51844. c = new Ci.Float32Attribute(2 * a * 3, 3)
  51845. l.addAttribute('position', c),
  51846. Ci.LineSegments.call(
  51847. this,
  51848. l,
  51849. new Ci.LineBasicMaterial({
  51850. color: r,
  51851. linewidth: o
  51852. })
  51853. ),
  51854. (this.matrixAutoUpdate = !1),
  51855. this.update()
  51856. }),
  51857. (Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype)),
  51858. (Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper),
  51859. (Ci.FaceNormalsHelper.prototype.update =
  51860. ((si = new Ci.Vector3()),
  51861. (li = new Ci.Vector3()),
  51862. (ci = new Ci.Matrix3()),
  51863. function () {
  51864. this.object.updateMatrixWorld(!0), ci.getNormalMatrix(this.object.matrixWorld)
  51865. for (var e = this.object.matrixWorld, t = this.geometry.attributes.position, i = this.object.geometry, n = i.vertices, r = i.faces, o = 0, a = 0, s = r.length; a < s; a++) {
  51866. var l = r[a],
  51867. c = l.normal
  51868. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  51869. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  51870. t.setXYZ(o, si.x, si.y, si.z),
  51871. (o += 1),
  51872. t.setXYZ(o, li.x, li.y, li.z),
  51873. (o += 1)
  51874. }
  51875. return (t.needsUpdate = !0), this
  51876. })),
  51877. (Ci.GridHelper = function (e, t) {
  51878. var i = new Ci.Geometry(),
  51879. n = new Ci.LineBasicMaterial({
  51880. vertexColors: Ci.VertexColors
  51881. })
  51882. ;(this.color1 = new Ci.Color(4473924)), (this.color2 = new Ci.Color(8947848))
  51883. for (var r = -e; r <= e; r += t) {
  51884. i.vertices.push(new Ci.Vector3(-e, 0, r), new Ci.Vector3(e, 0, r), new Ci.Vector3(r, 0, -e), new Ci.Vector3(r, 0, e))
  51885. var o = 0 === r ? this.color1 : this.color2
  51886. i.colors.push(o, o, o, o)
  51887. }
  51888. Ci.LineSegments.call(this, i, n)
  51889. }),
  51890. (Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype)),
  51891. (Ci.GridHelper.prototype.constructor = Ci.GridHelper),
  51892. (Ci.GridHelper.prototype.setColors = function (e, t) {
  51893. this.color1.set(e), this.color2.set(t), (this.geometry.colorsNeedUpdate = !0)
  51894. }),
  51895. (Ci.HemisphereLightHelper = function (e, t) {
  51896. Ci.Object3D.call(this), (this.light = e), this.light.updateMatrixWorld(), (this.matrix = e.matrixWorld), (this.matrixAutoUpdate = !1), (this.colors = [new Ci.Color(), new Ci.Color()])
  51897. var i = new Ci.SphereGeometry(t, 4, 2)
  51898. i.rotateX(-Math.PI / 2)
  51899. for (var n = 0; n < 8; n++) i.faces[n].color = this.colors[n < 4 ? 0 : 1]
  51900. var r = new Ci.MeshBasicMaterial({
  51901. vertexColors: Ci.FaceColors,
  51902. wireframe: !0
  51903. })
  51904. ;(this.lightSphere = new Ci.Mesh(i, r)), this.add(this.lightSphere), this.update()
  51905. }),
  51906. (Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype)),
  51907. (Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper),
  51908. (Ci.HemisphereLightHelper.prototype.dispose = function () {
  51909. this.lightSphere.geometry.dispose(), this.lightSphere.material.dispose()
  51910. }),
  51911. (Ci.HemisphereLightHelper.prototype.update =
  51912. ((ai = new Ci.Vector3()),
  51913. function () {
  51914. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  51915. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  51916. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  51917. (this.lightSphere.geometry.colorsNeedUpdate = !0)
  51918. })),
  51919. (Ci.PointLightHelper = function (e, t) {
  51920. ;(this.light = e), this.light.updateMatrixWorld()
  51921. var i = new Ci.SphereGeometry(t, 4, 2),
  51922. n = new Ci.MeshBasicMaterial({
  51923. wireframe: !0,
  51924. fog: !1
  51925. })
  51926. n.color.copy(this.light.color).multiplyScalar(this.light.intensity), Ci.Mesh.call(this, i, n), (this.matrix = this.light.matrixWorld), (this.matrixAutoUpdate = !1)
  51927. }),
  51928. (Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype)),
  51929. (Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper),
  51930. (Ci.PointLightHelper.prototype.dispose = function () {
  51931. this.geometry.dispose(), this.material.dispose()
  51932. }),
  51933. (Ci.PointLightHelper.prototype.update = function () {
  51934. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  51935. }),
  51936. (Ci.SkeletonHelper = function (e) {
  51937. this.bones = this.getBoneList(e)
  51938. for (var t = new Ci.Geometry(), i = 0; i < this.bones.length; i++) {
  51939. this.bones[i].parent instanceof Ci.Bone &&
  51940. (t.vertices.push(new Ci.Vector3()), t.vertices.push(new Ci.Vector3()), t.colors.push(new Ci.Color(0, 0, 1)), t.colors.push(new Ci.Color(0, 1, 0)))
  51941. }
  51942. t.dynamic = !0
  51943. var n = new Ci.LineBasicMaterial({
  51944. vertexColors: Ci.VertexColors,
  51945. depthTest: !1,
  51946. depthWrite: !1,
  51947. transparent: !0
  51948. })
  51949. Ci.LineSegments.call(this, t, n), (this.root = e), (this.matrix = e.matrixWorld), (this.matrixAutoUpdate = !1), this.update()
  51950. }),
  51951. (Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype)),
  51952. (Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper),
  51953. (Ci.SkeletonHelper.prototype.getBoneList = function (e) {
  51954. var t = []
  51955. e instanceof Ci.Bone && t.push(e)
  51956. for (var i = 0; i < e.children.length; i++) t.push.apply(t, this.getBoneList(e.children[i]))
  51957. return t
  51958. }),
  51959. (Ci.SkeletonHelper.prototype.update = function () {
  51960. for (var e = this.geometry, t = new Ci.Matrix4().getInverse(this.root.matrixWorld), i = new Ci.Matrix4(), n = 0, r = 0; r < this.bones.length; r++) {
  51961. var o = this.bones[r]
  51962. o.parent instanceof Ci.Bone &&
  51963. (i.multiplyMatrices(t, o.matrixWorld), e.vertices[n].setFromMatrixPosition(i), i.multiplyMatrices(t, o.parent.matrixWorld), e.vertices[n + 1].setFromMatrixPosition(i), (n += 2))
  51964. }
  51965. ;(e.verticesNeedUpdate = !0), e.computeBoundingSphere()
  51966. }),
  51967. (Ci.SpotLightHelper = function (e) {
  51968. Ci.Object3D.call(this), (this.light = e), this.light.updateMatrixWorld(), (this.matrix = e.matrixWorld), (this.matrixAutoUpdate = !1)
  51969. var t = new Ci.CylinderGeometry(0, 1, 1, 8, 1, !0)
  51970. t.translate(0, -0.5, 0), t.rotateX(-Math.PI / 2)
  51971. var i = new Ci.MeshBasicMaterial({
  51972. wireframe: !0,
  51973. fog: !1
  51974. })
  51975. ;(this.cone = new Ci.Mesh(t, i)), this.add(this.cone), this.update()
  51976. }),
  51977. (Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype)),
  51978. (Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper),
  51979. (Ci.SpotLightHelper.prototype.dispose = function () {
  51980. this.cone.geometry.dispose(), this.cone.material.dispose()
  51981. }),
  51982. (Ci.SpotLightHelper.prototype.update =
  51983. ((ri = new Ci.Vector3()),
  51984. (oi = new Ci.Vector3()),
  51985. function () {
  51986. var e = this.light.distance ? this.light.distance : 1e4,
  51987. t = e * Math.tan(this.light.angle)
  51988. this.cone.scale.set(t, t, e),
  51989. ri.setFromMatrixPosition(this.light.matrixWorld),
  51990. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  51991. this.cone.lookAt(oi.sub(ri)),
  51992. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  51993. })),
  51994. (Ci.VertexNormalsHelper = function (e, t, i, n) {
  51995. ;(this.object = e), (this.size = void 0 !== t ? t : 1)
  51996. var r = void 0 !== i ? i : 16711680,
  51997. o = void 0 !== n ? n : 1,
  51998. a = 0,
  51999. s = this.object.geometry
  52000. s instanceof Ci.Geometry ? (a = 3 * s.faces.length) : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count)
  52001. var l = new Ci.BufferGeometry(),
  52002. c = new Ci.Float32Attribute(2 * a * 3, 3)
  52003. l.addAttribute('position', c),
  52004. Ci.LineSegments.call(
  52005. this,
  52006. l,
  52007. new Ci.LineBasicMaterial({
  52008. color: r,
  52009. linewidth: o
  52010. })
  52011. ),
  52012. (this.matrixAutoUpdate = !1),
  52013. this.update()
  52014. }),
  52015. (Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype)),
  52016. (Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper),
  52017. (Ci.VertexNormalsHelper.prototype.update =
  52018. ((ti = new Ci.Vector3()),
  52019. (ii = new Ci.Vector3()),
  52020. (ni = new Ci.Matrix3()),
  52021. function () {
  52022. var e = ['a', 'b', 'c']
  52023. this.object.updateMatrixWorld(!0), ni.getNormalMatrix(this.object.matrixWorld)
  52024. var t = this.object.matrixWorld,
  52025. i = this.geometry.attributes.position,
  52026. n = this.object.geometry
  52027. if (n instanceof Ci.Geometry)
  52028. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  52029. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  52030. var d = r[c[e[h]]],
  52031. p = c.vertexNormals[h]
  52032. ti.copy(d).applyMatrix4(t),
  52033. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  52034. i.setXYZ(a, ti.x, ti.y, ti.z),
  52035. (a += 1),
  52036. i.setXYZ(a, ii.x, ii.y, ii.z),
  52037. (a += 1)
  52038. }
  52039. else if (n instanceof Ci.BufferGeometry) {
  52040. var f = n.attributes.position,
  52041. g = n.attributes.normal
  52042. for (h = a = 0, u = f.count; h < u; h++)
  52043. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  52044. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  52045. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  52046. i.setXYZ(a, ti.x, ti.y, ti.z),
  52047. (a += 1),
  52048. i.setXYZ(a, ii.x, ii.y, ii.z),
  52049. (a += 1)
  52050. }
  52051. return (i.needsUpdate = !0), this
  52052. })),
  52053. (Ci.WireframeHelper = function (e, t) {
  52054. var i = void 0 !== t ? t : 16777215
  52055. Ci.LineSegments.call(
  52056. this,
  52057. new Ci.WireframeGeometry(e.geometry),
  52058. new Ci.LineBasicMaterial({
  52059. color: i
  52060. })
  52061. ),
  52062. (this.matrix = e.matrixWorld),
  52063. (this.matrixAutoUpdate = !1)
  52064. }),
  52065. (Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype)),
  52066. (Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper),
  52067. (Ci.ImmediateRenderObject = function (e) {
  52068. Ci.Object3D.call(this), (this.material = e), (this.render = function (e) {})
  52069. }),
  52070. (Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype)),
  52071. (Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject),
  52072. (Ci.MorphBlendMesh = function (e, t) {
  52073. Ci.Mesh.call(this, e, t), (this.animationsMap = {}), (this.animationsList = [])
  52074. var i = this.geometry.morphTargets.length,
  52075. n = i - 1,
  52076. r = i / 1
  52077. this.createAnimation('__default', 0, n, r), this.setAnimationWeight('__default', 1)
  52078. }),
  52079. (Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype)),
  52080. (Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh),
  52081. (Ci.MorphBlendMesh.prototype.createAnimation = function (e, t, i, n) {
  52082. var r = {
  52083. start: t,
  52084. end: i,
  52085. length: i - t + 1,
  52086. fps: n,
  52087. duration: (i - t) / n,
  52088. lastFrame: 0,
  52089. currentFrame: 0,
  52090. active: !1,
  52091. time: 0,
  52092. direction: 1,
  52093. weight: 1,
  52094. directionBackwards: !1,
  52095. mirroredLoop: !1
  52096. }
  52097. ;(this.animationsMap[e] = r), this.animationsList.push(r)
  52098. }),
  52099. (Ci.MorphBlendMesh.prototype.autoCreateAnimations = function (e) {
  52100. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  52101. var s = r.morphTargets[o].name.match(i)
  52102. if (s && 1 < s.length)
  52103. n[(l = s[1])] ||
  52104. (n[l] = {
  52105. start: 1 / 0,
  52106. end: -1 / 0
  52107. }),
  52108. o < (c = n[l]).start && (c.start = o),
  52109. o > c.end && (c.end = o),
  52110. (t = t || l)
  52111. }
  52112. for (var l in n) {
  52113. var c = n[l]
  52114. this.createAnimation(l, c.start, c.end, e)
  52115. }
  52116. this.firstAnimation = t
  52117. }),
  52118. (Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function (e) {
  52119. var t = this.animationsMap[e]
  52120. t && ((t.direction = 1), (t.directionBackwards = !1))
  52121. }),
  52122. (Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function (e) {
  52123. var t = this.animationsMap[e]
  52124. t && ((t.direction = -1), (t.directionBackwards = !0))
  52125. }),
  52126. (Ci.MorphBlendMesh.prototype.setAnimationFPS = function (e, t) {
  52127. var i = this.animationsMap[e]
  52128. i && ((i.fps = t), (i.duration = (i.end - i.start) / i.fps))
  52129. }),
  52130. (Ci.MorphBlendMesh.prototype.setAnimationDuration = function (e, t) {
  52131. var i = this.animationsMap[e]
  52132. i && ((i.duration = t), (i.fps = (i.end - i.start) / i.duration))
  52133. }),
  52134. (Ci.MorphBlendMesh.prototype.setAnimationWeight = function (e, t) {
  52135. var i = this.animationsMap[e]
  52136. i && (i.weight = t)
  52137. }),
  52138. (Ci.MorphBlendMesh.prototype.setAnimationTime = function (e, t) {
  52139. var i = this.animationsMap[e]
  52140. i && (i.time = t)
  52141. }),
  52142. (Ci.MorphBlendMesh.prototype.getAnimationTime = function (e) {
  52143. var t = 0,
  52144. i = this.animationsMap[e]
  52145. return i && (t = i.time), t
  52146. }),
  52147. (Ci.MorphBlendMesh.prototype.getAnimationDuration = function (e) {
  52148. var t = -1,
  52149. i = this.animationsMap[e]
  52150. return i && (t = i.duration), t
  52151. }),
  52152. (Ci.MorphBlendMesh.prototype.playAnimation = function (e) {
  52153. var t = this.animationsMap[e]
  52154. t ? ((t.time = 0), (t.active = !0)) : console.warn('THREE.MorphBlendMesh: animation[' + e + '] undefined in .playAnimation()')
  52155. }),
  52156. (Ci.MorphBlendMesh.prototype.stopAnimation = function (e) {
  52157. var t = this.animationsMap[e]
  52158. t && (t.active = !1)
  52159. }),
  52160. (Ci.MorphBlendMesh.prototype.update = function (e) {
  52161. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  52162. var n = this.animationsList[t]
  52163. if (n.active) {
  52164. var r = n.duration / n.length
  52165. ;(n.time += n.direction * e),
  52166. n.mirroredLoop
  52167. ? (n.time > n.duration || n.time < 0) &&
  52168. ((n.direction *= -1), n.time > n.duration && ((n.time = n.duration), (n.directionBackwards = !0)), n.time < 0 && ((n.time = 0), (n.directionBackwards = !1)))
  52169. : ((n.time = n.time % n.duration), n.time < 0 && (n.time += n.duration))
  52170. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1),
  52171. a = n.weight
  52172. o !== n.currentFrame &&
  52173. ((this.morphTargetInfluences[n.lastFrame] = 0),
  52174. (this.morphTargetInfluences[n.currentFrame] = 1 * a),
  52175. (this.morphTargetInfluences[o] = 0),
  52176. (n.lastFrame = n.currentFrame),
  52177. (n.currentFrame = o))
  52178. var s = (n.time % r) / r
  52179. n.directionBackwards && (s = 1 - s),
  52180. n.currentFrame !== n.lastFrame
  52181. ? ((this.morphTargetInfluences[n.currentFrame] = s * a), (this.morphTargetInfluences[n.lastFrame] = (1 - s) * a))
  52182. : (this.morphTargetInfluences[n.currentFrame] = a)
  52183. }
  52184. }
  52185. }),
  52186. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci), (i.THREE = Ci)) : (this.THREE = Ci)
  52187. window.THREE = Ci
  52188. getObjLoader()
  52189. initByTHREE(THREE)
  52190. },
  52191. {}
  52192. ]
  52193. },
  52194. {},
  52195. [116]
  52196. )