main_2020_edit.js 2.5 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667
  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. /* if(_settings.angleShift2d){ //怎么算都会超出,仔细想了下是无法算准的
  3507. angle += THREE.Math.degToRad(_settings.angleShift2d)
  3508. } */
  3509. modelSize = modelSize.clone().applyEuler(new THREE.Euler(0, angle, 0))
  3510. var n = Math.max(Math.abs(modelSize.x), Math.abs(modelSize.z) * this.camera.aspect) //视口宽高比 >= 1 情况下,模型所占最大视口尺寸
  3511. var screenSize = Math.min($('#player').width(), $('#player').height())
  3512. var maxSize = 800 //模型最大占据像素
  3513. ratio = ratio != void 0 ? ratio : Math.max((screenSize * defaultRatio) / maxSize, defaultRatio)
  3514. absoluteScale = (n / 2 / l.orthoBase) * ratio //根据模型所占最大视口尺寸调整缩放
  3515. } else {
  3516. var t = Math.max(modelSize.x, modelSize.z),
  3517. i = Math.min(modelSize.x, modelSize.z),
  3518. n = Math.max(t, i * this.camera.aspect),
  3519. r = Math.max(i, t * this.camera.aspect)
  3520. absoluteScale = ((p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase) * defaultRatio
  3521. }
  3522. return absoluteScale
  3523. }),
  3524. (n.prototype.rotateToView = function (modelSize, direction, type) {
  3525. let i = 0,
  3526. n = p.aspectRatio() < 1 //是否模型尺寸显“细长”
  3527. if (_settings.floorPlanAngle) {
  3528. //规定了cadImage旋转值的话 (0是无效的,将不设置)
  3529. i = parseFloat(_settings.floorPlanAngle)
  3530. } else {
  3531. let r = modelSize.x < modelSize.z //是否视口为“窄屏”
  3532. if (n === r) {
  3533. //“细长” 且 “窄屏”,说明模型尺寸比例与视口比例匹配,相机坐标只需要调转“前”“后”
  3534. if (direction.z > 0) {
  3535. //(第一种情况)相机是否位于背面。 注:在默认情况下webgl的相机朝向-z, direction.z > 0 说明相机视野已经偏向+z,说明相机位于模型“背面”
  3536. i = Math.PI //经度上做180度轨道角位移,使相机移到静止模型的“前面”
  3537. }
  3538. //(第二种情况) 不做处理
  3539. } else if (direction.x > 0) {
  3540. i = Math.PI / 2
  3541. } else {
  3542. i = -Math.PI / 2
  3543. }
  3544. }
  3545. if (_settings.angleShift2d) {
  3546. i += THREE.Math.degToRad(_settings.angleShift2d)
  3547. }
  3548. if (type == 'update') {
  3549. //若不是update,只能是从其他模式刚转到floorplan
  3550. i += this.lon
  3551. }
  3552. this.rotateLeft(i)
  3553. this.update(0)
  3554. }),
  3555. (n.prototype.updateRotate = function (angle) {
  3556. //add 在floorplan模式直接旋转
  3557. this.rotateToView(player.model.size, player.getDirection(), 'update')
  3558. }),
  3559. /* n.prototype.rotateToAngle = function(angle){//add 旋转到特定角度
  3560. this.rotateLeft(angle + this.lon);
  3561. this.update(0);
  3562. } */
  3563. (n.prototype.pan = function (e, t) {
  3564. this.camera.updateMatrix(),
  3565. this.panLeft((e * (this.camera.right - this.camera.left)) / $('#player').width()),
  3566. this.panUp((-t * (this.camera.top - this.camera.bottom)) / $('#player').height())
  3567. }),
  3568. (n.prototype.updateZoom = function () {
  3569. return (
  3570. (this.absoluteScale *= this.scale - 0.03 * this.keyboardZoomSpeed),
  3571. (this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit))),
  3572. (this.currentScale = 0.8 * this.currentScale + 0.2 * this.absoluteScale),
  3573. (this.camera.left = -l.orthoBase * this.currentScale),
  3574. (this.camera.right = l.orthoBase * this.currentScale),
  3575. (this.camera.top = (l.orthoBase * this.currentScale) / this.camera.aspect),
  3576. (this.camera.bottom = (-l.orthoBase * this.currentScale) / this.camera.aspect),
  3577. this.camera.updateProjectionMatrix(),
  3578. this.offset.length()
  3579. )
  3580. }),
  3581. (n.prototype.toJSON =
  3582. ((r = new s.Quaternion()),
  3583. (o = new s.Quaternion().setFromAxisAngle(new s.Vector3(0, 1, 0), s.Math.degToRad(90))),
  3584. (a = new s.Quaternion()),
  3585. function () {
  3586. var e = c.prototype.toJSON.call(this)
  3587. return (
  3588. r.copy(e.camera_quaternion),
  3589. a.copy(o),
  3590. a.multiply(r),
  3591. (e.camera_quaternion.x = d.toPrecision(a.x, 4)),
  3592. (e.camera_quaternion.y = d.toPrecision(a.y, 4)),
  3593. (e.camera_quaternion.z = d.toPrecision(a.z, 4)),
  3594. (e.camera_quaternion.w = d.toPrecision(a.w, 4)),
  3595. (e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4)),
  3596. e
  3597. )
  3598. })),
  3599. (t.exports = n)
  3600. },
  3601. {
  3602. '../enum/ControlActions': 20,
  3603. '../enum/MouseButton': 34,
  3604. '../settings': 166,
  3605. '../util/browser': 182,
  3606. '../util/math': 190,
  3607. './OutsideControls': 12,
  3608. three: 217
  3609. }
  3610. ],
  3611. 12: [
  3612. function (e, t, i) {
  3613. 'use strict'
  3614. function n(e) {
  3615. ;(this.camera = e),
  3616. ((this.camera.controls = this).enabled = !1),
  3617. (this.target = new a.Vector3()),
  3618. (this.targetBounds = new a.Box3()),
  3619. (this.zoomSpeed = 2), //编辑时缩放快一些
  3620. (this.minDistance = 0),
  3621. (this.maxDistance = 1 / 0),
  3622. (this.noRotateUpDown = !1),
  3623. (this.rotateSpeed = 1),
  3624. (this.keyboardZoomSpeed = 0),
  3625. (this.keyPanSpeed = 7),
  3626. (this.autoRotate = !1),
  3627. (this.autoRotateSpeed = 2),
  3628. (this.autoPan = !1),
  3629. (this.autoPanPosition = new a.Vector3()),
  3630. (this.minPolarAngle = a.Math.degToRad(25)),
  3631. (this.maxPolarAngle = a.Math.degToRad(65)),
  3632. (this.rotationAcceleration = new a.Vector2()),
  3633. (this.rotationSpeed = new a.Vector2()),
  3634. (this.panAcceleration = new a.Vector2()),
  3635. (this.panSpeed = new a.Vector2()),
  3636. (this.rotateStart = new a.Vector2()),
  3637. (this.rotateEnd = new a.Vector2()),
  3638. (this.rotateDelta = new a.Vector2()),
  3639. (this.panStart = new a.Vector2()),
  3640. (this.panEnd = new a.Vector2()),
  3641. (this.panDelta = new a.Vector2()),
  3642. (this.panOffset = new a.Vector3()),
  3643. (this.offset = new a.Vector3()),
  3644. (this.dollyStart = new a.Vector2()),
  3645. (this.dollyEnd = new a.Vector2()),
  3646. (this.dollyDelta = new a.Vector2()),
  3647. (this.phiDelta = 0),
  3648. (this.thetaDelta = 0),
  3649. (this.scale = 1),
  3650. (this.panVector = new a.Vector3()),
  3651. (this.lastPosition = new a.Vector3()),
  3652. (this.state = u.NONE),
  3653. (this.mouseActions = {}),
  3654. (this.mouseActions[d.LEFT] = u.ROTATE),
  3655. (this.mouseActions[d.MIDDLE] = u.DOLLY),
  3656. (this.mouseActions[d.RIGHT] = u.PAN),
  3657. (this.touchActions = {}),
  3658. (this.touchActions[1] = u.ROTATE),
  3659. (this.touchActions[2] = u.PAN_DOLLY),
  3660. (this.lastMoveTime = 0),
  3661. (this.pointersLimit = 2),
  3662. (this.pointers = [])
  3663. }
  3664. var r,
  3665. o,
  3666. a = e('three'),
  3667. c = e('../settings'),
  3668. h = e('../util/common'),
  3669. s = e('../util/math'),
  3670. l = e('../enum/Vectors'),
  3671. u = e('../enum/ControlActions'),
  3672. d = e('../enum/MouseButton'),
  3673. p = e('../enum/Keys'),
  3674. f = e('../enum/ControlEvents'),
  3675. g = e('events').EventEmitter
  3676. ;((n.prototype = Object.create(g.prototype)).setBounds = function (e) {
  3677. this.targetBounds = e
  3678. }),
  3679. (n.prototype.isEngaged = function () {
  3680. return this.state !== u.NONE
  3681. }),
  3682. (n.prototype.rotateLeft = function (e) {
  3683. void 0 === e && (e = this.getAutoRotationAngle()), (this.thetaDelta -= e)
  3684. }),
  3685. (n.prototype.rotateUp = function (e) {
  3686. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()), (this.phiDelta -= e))
  3687. }),
  3688. (n.prototype.panLeft = function (e) {
  3689. var t = this.camera.matrix.elements
  3690. this.panOffset.set(t[0], 0, t[2]).normalize(), this.panOffset.multiplyScalar(-e), this.panVector.add(this.panOffset)
  3691. }),
  3692. (n.prototype.panUp = function (e) {
  3693. var t = this.camera.matrix.elements
  3694. this.panOffset.set(t[4], 0, t[6]).normalize(), this.panOffset.multiplyScalar(-e), this.panVector.add(this.panOffset)
  3695. }),
  3696. (n.prototype.startRotating = function (e, t) {
  3697. e && this.navRotationAcc('x', e), t && this.navRotationAcc('y', t)
  3698. }),
  3699. (n.prototype.stopRotating = function (e) {
  3700. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0), this.navRotationAcc('x', 0), this.navRotationAcc('y', 0)
  3701. }),
  3702. (n.prototype.setAutoPanPosition =
  3703. ((r = new a.Vector3()),
  3704. (o = new a.Vector3()),
  3705. function (e, t) {
  3706. r.copy(this.camera.position), (void 0 === e && null === e) || r.setX(e), (void 0 === t && null === t) || r.setZ(t)
  3707. var i = this.camera.position.distanceTo(this.target),
  3708. n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion)
  3709. ;(this.targetClamped = !1),
  3710. o.copy(r).addScaledVector(n, i),
  3711. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o), r.copy(o).addScaledVector(n, -i), (this.targetClamped = !0)),
  3712. (this.autoPanPosition.x = r.x),
  3713. (this.autoPanPosition.z = r.z),
  3714. this.autoPan && this.stopAutoPanning()
  3715. })),
  3716. (n.prototype.stopAutoPanning = function () {
  3717. var e = this.autoPan
  3718. ;(this.autoPan = !1), this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3719. }),
  3720. (n.prototype.dollyIn = function (e) {
  3721. void 0 === e && (e = this.getZoomScale()), (this.scale /= e)
  3722. }),
  3723. (n.prototype.dollyOut = function (e) {
  3724. void 0 === e && (e = this.getZoomScale()), (this.scale *= e)
  3725. }),
  3726. (n.prototype.updatePan = function (e) {
  3727. if ((this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e), this.pan(-this.panSpeed.x, this.panSpeed.y), this.autoPan)) {
  3728. var t = new a.Vector3().copy(this.autoPanPosition).sub(this.camera.position)
  3729. t.setY(0).clampLength(0, 50 * e),
  3730. this.target.add(t),
  3731. this.camera.position.add(t),
  3732. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && ((this.autoPan = !1), this.stopAutoPanning())
  3733. }
  3734. }),
  3735. (n.prototype.update = function (e) {
  3736. ;(e = e || 1 / 60),
  3737. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3738. this.rotateLeft(-this.rotationSpeed.x),
  3739. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3740. this.updatePan(e)
  3741. var t = this.camera.position
  3742. this.offset.copy(t).sub(this.target)
  3743. var i = Math.atan2(this.offset.x, this.offset.z),
  3744. n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y)
  3745. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3746. (i += this.thetaDelta),
  3747. (n += this.phiDelta),
  3748. (n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n))),
  3749. (n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n)))
  3750. ;(this.lon = i), (this.lat = n) //add
  3751. var r = this.updateZoom()
  3752. ;(r = Math.max(this.minDistance, Math.min(this.maxDistance, r))),
  3753. this.target.add(this.panVector),
  3754. this.targetBounds.clampPoint(this.target, this.target),
  3755. (this.offset.x = r * Math.sin(n) * Math.sin(i)),
  3756. (this.offset.y = r * Math.cos(n)),
  3757. (this.offset.z = r * Math.sin(n) * Math.cos(i)),
  3758. t.copy(this.target).add(this.offset),
  3759. this.camera.lookAt(this.target),
  3760. (this.thetaDelta = 0),
  3761. (this.phiDelta = 0),
  3762. (this.scale = 1),
  3763. this.panVector.set(0, 0, 0),
  3764. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3765. }),
  3766. (n.prototype.getAutoRotationAngle = function () {
  3767. return ((2 * Math.PI) / 60 / 60) * this.autoRotateSpeed
  3768. }),
  3769. (n.prototype.getZoomScale = function () {
  3770. return Math.pow(0.95, this.zoomSpeed)
  3771. }),
  3772. (n.prototype.onMouseDown = function (e) {
  3773. if (this.enabled) {
  3774. switch ((e.preventDefault(), this.stopAutoPanning(), (this.mouseDown = !0), (this.state = this.mouseActions[e.button]), this.state)) {
  3775. case u.ROTATE:
  3776. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY), this.rotationSpeed.set(0, 0)
  3777. break
  3778. case u.DOLLY:
  3779. this.dollyStart.set(e.clientX, e.clientY)
  3780. break
  3781. case u.PAN:
  3782. this.panStart.set(e.clientX, e.clientY)
  3783. }
  3784. this.emit(f.InputStart, 'mouse')
  3785. }
  3786. }),
  3787. (n.prototype.onMouseMove = function (e) {
  3788. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3789. switch ((e.preventDefault(), this.state)) {
  3790. case u.ROTATE:
  3791. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3792. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3793. this.rotateLeft(((2 * Math.PI * this.rotateDelta.x) / $('#player').width()) * this.rotateSpeed),
  3794. this.rotateUp(((2 * Math.PI * this.rotateDelta.y) / $('#player').height()) * this.rotateSpeed),
  3795. this.rotateStart.copy(this.rotateEnd)
  3796. break
  3797. case u.DOLLY:
  3798. this.dollyEnd.set(e.clientX, e.clientY),
  3799. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3800. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3801. this.dollyStart.copy(this.dollyEnd)
  3802. break
  3803. case u.PAN:
  3804. 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)
  3805. }
  3806. this.emit(f.Move, 'mouse'), (this.lastMoveTime = e.timeStamp), this.update()
  3807. }
  3808. }),
  3809. (n.prototype.onMouseUp = function (e) {
  3810. this.enabled &&
  3811. ((this.mouseDown = !1),
  3812. (this.state = u.NONE),
  3813. 'mouseover' !== e.type &&
  3814. (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3815. this.update(),
  3816. this.rotationAcceleration.set(0, 0),
  3817. this.rotateDelta.set(0, 0)))
  3818. }),
  3819. (n.prototype.onMouseOver = function (e) {
  3820. ;(0 !== e.which && 0 !== e.buttons) || this.onMouseUp(e)
  3821. }),
  3822. (n.prototype.onMouseWheel = function (e) {
  3823. this.enabled && c.useWheel && (this.emit(f.Move, 'wheel'), (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this), this.update())
  3824. }),
  3825. (n.prototype.onKeyDown = function (e) {
  3826. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(), this.handleKeyDown(e.which)))
  3827. }),
  3828. (n.prototype.navRotationAcc = function (e, t) {
  3829. 'y' === e ? (this.noRotateUpDown ? (this.keyboardZoomSpeed = t) : (this.rotationAcceleration.y = t)) : (this.rotationAcceleration.x = t)
  3830. }),
  3831. (n.prototype.navPanAcc = function (e, t) {
  3832. this.stopAutoPanning(), (this.panAcceleration[e] = t)
  3833. }),
  3834. (n.prototype.handleKeyDown = function (e) {
  3835. var t = !0
  3836. switch (e) {
  3837. case p.UPARROW:
  3838. case p.I:
  3839. this.navRotationAcc('y', 1)
  3840. break
  3841. case p.DOWNARROW:
  3842. case p.K:
  3843. this.navRotationAcc('y', -1)
  3844. break
  3845. case p.LEFTARROW:
  3846. case p.J:
  3847. this.navRotationAcc('x', -1)
  3848. break
  3849. case p.RIGHTARROW:
  3850. case p.L:
  3851. this.navRotationAcc('x', 1)
  3852. break
  3853. case p.W:
  3854. this.navPanAcc('y', 1)
  3855. break
  3856. case p.S:
  3857. this.navPanAcc('y', -1)
  3858. break
  3859. case p.A:
  3860. this.navPanAcc('x', -1)
  3861. break
  3862. case p.D:
  3863. this.navPanAcc('x', 1)
  3864. break
  3865. default:
  3866. t = !1
  3867. }
  3868. t && this.emit(f.Move, 'key')
  3869. }),
  3870. (n.prototype.onKeyUp = function (e) {
  3871. this.enabled && (e.preventDefault(), e.stopPropagation(), this.handleKeyUp(e.which))
  3872. }),
  3873. (n.prototype.handleKeyUp = function (e) {
  3874. switch (e) {
  3875. case p.I:
  3876. case p.K:
  3877. case p.UPARROW:
  3878. case p.DOWNARROW:
  3879. ;(this.keyboardZoomSpeed = 0), (this.rotationAcceleration.y = 0)
  3880. break
  3881. case p.J:
  3882. case p.L:
  3883. case p.LEFTARROW:
  3884. case p.RIGHTARROW:
  3885. this.rotationAcceleration.x = 0
  3886. break
  3887. case p.S:
  3888. case p.W:
  3889. this.panAcceleration.y = 0
  3890. break
  3891. case p.A:
  3892. case p.D:
  3893. this.panAcceleration.x = 0
  3894. }
  3895. }),
  3896. (n.prototype.onTouchStart = function (i) {
  3897. if (this.enabled || this.state === u.NONE) {
  3898. i.preventDefault(), i.stopPropagation(), this.stopAutoPanning()
  3899. var e = function () {
  3900. if (2 === i.touches.length) {
  3901. var e = i.touches[0].pageX - i.touches[1].pageX,
  3902. t = i.touches[0].pageY - i.touches[1].pageY
  3903. this.dollyStart.set(e, t)
  3904. }
  3905. }.bind(this),
  3906. t = function () {
  3907. this.panStart.set(h.average(i.touches, 'pageX'), h.average(i.touches, 'pageY'))
  3908. }.bind(this),
  3909. n = function () {
  3910. this.rotateStart.set(h.average(i.touches, 'pageX'), h.average(i.touches, 'pageY'))
  3911. }.bind(this)
  3912. switch (((this.state = this.touchActions[i.touches.length]), this.state)) {
  3913. case u.PAN_DOLLY:
  3914. e()
  3915. case u.PAN:
  3916. t()
  3917. break
  3918. case u.ROTATE_DOLLY:
  3919. e()
  3920. case u.ROTATE:
  3921. n()
  3922. }
  3923. this.rotationSpeed.set(0, 0), this.emit(f.InputStart, 'touch')
  3924. }
  3925. }),
  3926. (n.prototype.onTouchMove = function (a) {
  3927. if (this.enabled && this.state !== u.NONE) {
  3928. a.preventDefault(), a.stopPropagation()
  3929. var s = function () {
  3930. var e = a.touches[0].pageX - a.touches[1].pageX,
  3931. t = a.touches[0].pageY - a.touches[1].pageY
  3932. this.dollyEnd.set(e, t)
  3933. var i = this.dollyStart.length() - this.dollyEnd.length()
  3934. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500), this.dollyStart.copy(this.dollyEnd)
  3935. }.bind(this),
  3936. e = function () {
  3937. this.panEnd.set(h.average(a.touches, 'pageX'), h.average(a.touches, 'pageY')),
  3938. this.panDelta.subVectors(this.panEnd, this.panStart),
  3939. this.pan(this.panDelta.x, this.panDelta.y),
  3940. this.panStart.copy(this.panEnd),
  3941. this.rotateDelta.set(0, 0)
  3942. }.bind(this),
  3943. l = function () {
  3944. this.rotateEnd.set(h.average(a.touches, 'pageX'), h.average(a.touches, 'pageY')),
  3945. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3946. this.rotateLeft(((2 * Math.PI * this.rotateDelta.x) / $('#player').width()) * this.rotateSpeed),
  3947. this.rotateUp(((2 * Math.PI * this.rotateDelta.y) / $('#player').height()) * this.rotateSpeed),
  3948. this.rotateStart.copy(this.rotateEnd)
  3949. }.bind(this),
  3950. t = function () {
  3951. if (2 === a.touches.length) {
  3952. var e = window.devicePixelRatio || 1,
  3953. t = a.touches[1].pageX - a.touches[0].pageX,
  3954. i = a.touches[1].pageY - a.touches[0].pageY,
  3955. n = Math.sqrt(t * t + i * i)
  3956. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e) (this.state = u.DOLLY), s()
  3957. else {
  3958. var r = h.average(a.touches, 'pageX'),
  3959. o = h.average(a.touches, 'pageY')
  3960. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && ((this.state = u.ROTATE), this.rotateStart.set(r, o), l())
  3961. }
  3962. }
  3963. }.bind(this)
  3964. switch (this.state) {
  3965. case u.PAN_DOLLY:
  3966. s()
  3967. case u.PAN:
  3968. e()
  3969. break
  3970. case u.ROTATE_DOLLY:
  3971. t()
  3972. break
  3973. case u.DOLLY:
  3974. s()
  3975. break
  3976. case u.ROTATE:
  3977. l()
  3978. break
  3979. default:
  3980. this.state = u.NONE
  3981. }
  3982. ;(this.lastMoveTime = a.timeStamp), this.emit(f.Move, 'touch')
  3983. }
  3984. }),
  3985. (n.prototype.onTouchEnd = function (e) {
  3986. this.enabled &&
  3987. (this.state === u.ROTATE &&
  3988. (e.timeStamp > this.lastMoveTime + 100
  3989. ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0))
  3990. : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3991. (this.state = u.NONE),
  3992. this.update(),
  3993. this.rotationAcceleration.set(0, 0),
  3994. this.rotateDelta.set(0, 0))
  3995. }),
  3996. (n.prototype.onPointerDown = function (e) {
  3997. this.enabled &&
  3998. ('touch' === e.pointerType &&
  3999. (this.pointers.length < this.pointersLimit &&
  4000. this.pointers.push({
  4001. id: e.pointerId,
  4002. pageX: e.pageX,
  4003. pageY: e.pageY
  4004. }),
  4005. (e.touches = this.pointers),
  4006. this.onTouchStart(e)),
  4007. this.emit(f.InputStart, 'pointer'))
  4008. }),
  4009. (n.prototype.onPointerMove = function (t) {
  4010. this.enabled &&
  4011. 'touch' === t.pointerType &&
  4012. (this.pointers.forEach(function (e) {
  4013. t.pointerId === e.id && ((e.pageX = t.pageX), (e.pageY = t.pageY))
  4014. }),
  4015. (t.touches = this.pointers),
  4016. this.onTouchMove(t))
  4017. }),
  4018. (n.prototype.onPointerUp = function (i) {
  4019. this.enabled &&
  4020. 'touch' === i.pointerType &&
  4021. (this.pointers.forEach(
  4022. function (e, t) {
  4023. i.pointerId === e.id && this.pointers.splice(t, 1)
  4024. }.bind(this)
  4025. ),
  4026. (i.touches = this.pointers),
  4027. this.onTouchEnd(i))
  4028. }),
  4029. (n.prototype.reset = function () {
  4030. ;(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)
  4031. }),
  4032. (n.prototype.toJSON = function () {
  4033. return {
  4034. camera_position: {
  4035. x: s.toPrecision(this.camera.position.x, 4),
  4036. y: s.toPrecision(this.camera.position.y, 4),
  4037. z: s.toPrecision(this.camera.position.z, 4)
  4038. },
  4039. camera_quaternion: {
  4040. x: s.toPrecision(this.camera.quaternion.x, 4),
  4041. y: s.toPrecision(this.camera.quaternion.y, 4),
  4042. z: s.toPrecision(this.camera.quaternion.z, 4),
  4043. w: s.toPrecision(this.camera.quaternion.w, 4)
  4044. }
  4045. }
  4046. }),
  4047. (t.exports = n)
  4048. },
  4049. {
  4050. '../enum/ControlActions': 20,
  4051. '../enum/ControlEvents': 21,
  4052. '../enum/Keys': 30,
  4053. '../enum/MouseButton': 34,
  4054. '../enum/Vectors': 50,
  4055. '../settings': 166,
  4056. '../util/common': 185,
  4057. '../util/math': 190,
  4058. events: 202,
  4059. three: 217
  4060. }
  4061. ],
  4062. 13: [
  4063. function (u, d, e) {
  4064. ;(function (e) {
  4065. 'use strict'
  4066. function t(e) {
  4067. ;(this.camera = e),
  4068. ((this.camera.controls = this).target = new s.Vector3(0, 0, 0)),
  4069. (this.lookVector = new s.Vector3()),
  4070. (this.lookSpeed = 0.05),
  4071. (this.rotationAcc = new s.Vector2()),
  4072. (this.rotationSpeed = new s.Vector2()),
  4073. (this.lat = 0),
  4074. (this.lon = 0),
  4075. (this.phi = 0),
  4076. (this.theta = 0),
  4077. (this.enabled = !1),
  4078. (this.locked = !1),
  4079. (this.pointer = new s.Vector2(0, 0)),
  4080. (this.rotationHistory = []),
  4081. (this.rotationDifference = new s.Vector2()),
  4082. (this.pointerDragOn = !1),
  4083. (this.pointerDragStart = new s.Vector2(0, 0)),
  4084. (this.pinchDistance = 0),
  4085. (this.moveStart = new s.Vector2()),
  4086. (this.moveTolerance = 0.01),
  4087. (this.pointersLimit = 2),
  4088. (this.pointers = [])
  4089. //watch(this, 'enabled', this.enabled)
  4090. }
  4091. var s = u('three'),
  4092. i = u('../util/logger'),
  4093. n = u('../settings'),
  4094. r = u('../util/common'),
  4095. o = u('../util/math'),
  4096. a = (u('../enum/Vectors'), u('../enum/MouseButton')),
  4097. l = u('../enum/Keys'),
  4098. c = u('../enum/ControlEvents'),
  4099. h = u('events').EventEmitter
  4100. new i(e),
  4101. ((t.prototype = Object.create(h.prototype)).usable = function () {
  4102. return this.enabled && !this.locked
  4103. }),
  4104. /* t.prototype.lookAt = function(e) {
  4105. var t = this.camera.position.clone().sub(e)
  4106. , i = Math.atan(t.z / t.x);
  4107. i += t.x < 0 ? Math.PI : 0,
  4108. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  4109. this.lon = s.Math.radToDeg(i) + 180;
  4110. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4111. , r = Math.atan(t.y / n);
  4112. this.lat = -s.Math.radToDeg(r)
  4113. } */
  4114. (t.prototype.lookAt = function (aim, dir) {
  4115. var t = dir || this.camera.position.clone().sub(aim) //aim所指点的笛卡尔坐标系
  4116. var i = Math.atan(t.z / t.x)
  4117. i += t.x < 0 ? Math.PI : 0
  4118. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0
  4119. this.lon = s.Math.radToDeg(i) + 180
  4120. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  4121. o = Math.atan(t.y / n)
  4122. this.lat = -s.Math.radToDeg(o)
  4123. }),
  4124. (t.prototype.startRotationFrom = function (e, t) {
  4125. o.convertScreenPositionToNDC(e, t, this.pointer),
  4126. (this.pointerDragOn = !0),
  4127. this.pointerDragStart.copy(this.pointer),
  4128. this.moveStart.copy(this.pointer),
  4129. (this.rotationHistory = []),
  4130. this.rotationSpeed.set(0, 0)
  4131. }),
  4132. (t.prototype.onMouseOver = function (e) {
  4133. !this.pointerDragOn || (0 !== e.which && 0 !== e.buttons) || this.onMouseUp(e)
  4134. }),
  4135. (t.prototype.onTouchStart = function (e) {
  4136. if (this.usable()) {
  4137. switch ((e.preventDefault(), e.stopPropagation(), e.touches.length)) {
  4138. case 1:
  4139. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY)
  4140. break
  4141. case 2:
  4142. var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width(),
  4143. i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height()
  4144. this.pinchDistance = Math.sqrt(t * t + i * i)
  4145. }
  4146. this.emit(c.InputStart, 'touch')
  4147. }
  4148. }),
  4149. (t.prototype.onPointerDown = function (e) {
  4150. this.usable() &&
  4151. 'touch' === e.pointerType &&
  4152. (this.pointers.length < this.pointersLimit &&
  4153. this.pointers.push({
  4154. id: e.pointerId,
  4155. clientX: e.clientX,
  4156. clientY: e.clientY
  4157. }),
  4158. (e.touches = this.pointers),
  4159. this.onTouchStart(e),
  4160. this.emit(c.InputStart, 'pointer'))
  4161. }),
  4162. (t.prototype.onMouseDown = function (e) {
  4163. if (this.usable()) {
  4164. switch ((e.preventDefault(), e.stopPropagation(), e.button)) {
  4165. case a.LEFT:
  4166. this.startRotationFrom(e.clientX, e.clientY)
  4167. }
  4168. this.emit(c.InputStart, 'mouse')
  4169. }
  4170. }),
  4171. (t.prototype.updateRotation = function () {
  4172. if (this.usable() && this.pointerDragOn) {
  4173. var e = new s.Vector3(this.pointerDragStart.x, this.pointerDragStart.y, -1).unproject(this.camera),
  4174. t = new s.Vector3(this.pointer.x, this.pointer.y, -1).unproject(this.camera),
  4175. i = Math.sqrt(e.x * e.x + e.z * e.z),
  4176. n = Math.sqrt(t.x * t.x + t.z * t.z),
  4177. r = Math.atan2(e.y, i),
  4178. o = Math.atan2(t.y, n)
  4179. ;(this.rotationDifference.y = s.Math.radToDeg(r - o)), (e.y = 0), (t.y = 0)
  4180. var a = Math.acos(e.dot(t) / e.length() / t.length())
  4181. isNaN(a) || ((this.rotationDifference.x = s.Math.radToDeg(a)), this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4182. this.pointerDragStart.copy(this.pointer)
  4183. }
  4184. }),
  4185. (t.prototype.onMouseMove = function (e) {
  4186. this.usable() &&
  4187. (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4188. this.pointerDragOn &&
  4189. (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) &&
  4190. this.emit(c.Move, 'mouse'))
  4191. }),
  4192. (t.prototype.onTouchMove = function (e) {
  4193. if (this.usable())
  4194. switch ((this.emit(c.Move, 'touch'), e.touches.length)) {
  4195. case 1:
  4196. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer)
  4197. break
  4198. case 2:
  4199. var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width(),
  4200. i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height(),
  4201. n = this.pinchDistance - Math.sqrt(t * t + i * i)
  4202. 0.01 < Math.abs(n) && (this.emit(c.InteractionDirect), this.emit(c.Pinch, n), (this.pinchDistance -= n))
  4203. }
  4204. }),
  4205. (t.prototype.onPointerMove = function (t) {
  4206. this.usable() &&
  4207. 'touch' === t.pointerType &&
  4208. (this.pointers.forEach(function (e) {
  4209. t.pointerId === e.id && ((e.clientX = t.clientX), (e.clientY = t.clientY))
  4210. }),
  4211. (t.touches = this.pointers),
  4212. this.onTouchMove(t))
  4213. }),
  4214. (t.prototype.endRotation = function () {
  4215. this.pointerDragOn = !1
  4216. var e = r.averageVectors(this.rotationHistory)
  4217. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4218. }),
  4219. (t.prototype.onTouchEnd = function (e) {
  4220. this.usable() && (e.preventDefault(), e.stopPropagation(), this.endRotation())
  4221. }),
  4222. (t.prototype.onMouseUp = function (e) {
  4223. this.usable() && (e.preventDefault(), e.stopPropagation(), this.endRotation())
  4224. }),
  4225. (t.prototype.onPointerUp = function (i) {
  4226. this.usable() &&
  4227. 'touch' === i.pointerType &&
  4228. (this.pointers.forEach(
  4229. function (e, t) {
  4230. i.pointerId === e.id && this.pointers.splice(t, 1)
  4231. }.bind(this)
  4232. ),
  4233. (i.touches = this.pointers),
  4234. this.onTouchEnd(i))
  4235. }),
  4236. (t.prototype.update = function (e) {
  4237. for (this.lon, this.lat, this.updateRotation(), this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4238. this.rotationHistory.shift()
  4239. ;(this.lon += this.rotationDifference.x),
  4240. (this.lat += this.rotationDifference.y),
  4241. this.rotationDifference.set(0, 0),
  4242. (this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside),
  4243. (this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside),
  4244. (this.lon += this.rotationSpeed.x * e),
  4245. (this.lat += this.rotationSpeed.y * e)
  4246. let insideLookLimitDown = this.insideLookLimitDown != void 0 ? this.insideLookLimitDown : n.insideLookLimitDown
  4247. let insideLookLimitUp = this.insideLookLimitUp != void 0 ? this.insideLookLimitUp : n.insideLookLimitUp
  4248. insideLookLimitDown = insideLookLimitDown - n.insideFOV / 2 + this.camera.fov / 2
  4249. insideLookLimitUp = insideLookLimitUp + n.insideFOV / 2 - this.camera.fov / 2
  4250. 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 );
  4251. //this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4252. ;(this.phi = s.Math.degToRad(90 - this.lat)),
  4253. (this.theta = s.Math.degToRad(this.lon)),
  4254. (this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta)),
  4255. (this.lookVector.y = Math.cos(this.phi)),
  4256. (this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta)),
  4257. this.target.copy(this.lookVector).add(this.camera.position),
  4258. this.camera.lookAt(this.target)
  4259. }),
  4260. (t.prototype.onMouseWheel = function (e) {
  4261. if (this.usable()) {
  4262. var t = e.wheelDelta || -e.detail
  4263. this.emit(c.InteractionDirect), this.emit(c.Scroll, t)
  4264. }
  4265. }),
  4266. (t.prototype.onKeyDown = function (e) {
  4267. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(), this.handleKeyDown(e.which)))
  4268. }),
  4269. (t.prototype.handleKeyDown = function (e) {
  4270. var t = function (e, t) {
  4271. this.rotationAcc[e] = t
  4272. }.bind(this)
  4273. this.emit(c.InteractionKey)
  4274. var i = !0
  4275. switch (e) {
  4276. case l.LEFTARROW:
  4277. case l.J:
  4278. t('x', -1)
  4279. break
  4280. case l.RIGHTARROW:
  4281. case l.L:
  4282. t('x', 1)
  4283. break
  4284. case l.I:
  4285. t('y', 1)
  4286. break
  4287. case l.K:
  4288. t('y', -1)
  4289. break
  4290. default:
  4291. i = !1
  4292. }
  4293. i && this.emit(c.Move, 'key')
  4294. }),
  4295. (t.prototype.onKeyUp = function (e) {
  4296. this.usable() && (e.preventDefault(), e.stopPropagation(), this.handleKeyUp(e.which))
  4297. }),
  4298. (t.prototype.handleKeyUp = function (e) {
  4299. switch (e) {
  4300. case l.LEFTARROW:
  4301. case l.J:
  4302. case l.RIGHTARROW:
  4303. case l.L:
  4304. this.rotationAcc.x = 0
  4305. break
  4306. case l.I:
  4307. case l.K:
  4308. this.rotationAcc.y = 0
  4309. }
  4310. }),
  4311. (t.prototype.startRotating = function (e, t) {
  4312. e && (this.rotationAcc.x = e), t && (this.rotationAcc.y = t)
  4313. }),
  4314. (t.prototype.stopRotating = function (e) {
  4315. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0), this.rotationAcc.set(0, 0)
  4316. }),
  4317. (t.prototype.reset = function () {
  4318. ;(this.pointerDragOn = !1), this.rotationAcc.set(0, 0), this.rotationSpeed.set(0, 0), (this.pointers = [])
  4319. }),
  4320. (t.prototype.toJSON = function () {
  4321. return {
  4322. camera_position: {
  4323. x: o.toPrecision(this.camera.position.x, 4),
  4324. y: o.toPrecision(this.camera.position.y, 4),
  4325. z: o.toPrecision(this.camera.position.z, 4)
  4326. },
  4327. camera_quaternion: {
  4328. x: o.toPrecision(this.camera.quaternion.x, 4),
  4329. y: o.toPrecision(this.camera.quaternion.y, 4),
  4330. z: o.toPrecision(this.camera.quaternion.z, 4),
  4331. w: o.toPrecision(this.camera.quaternion.w, 4)
  4332. }
  4333. }
  4334. }),
  4335. (t.prototype.setStateFromJSON = function (e) {
  4336. this.camera.position.copy(e.camera_position), this.camera.quaternion.copy(e.camera_quaternion)
  4337. }),
  4338. (d.exports = t)
  4339. }).call(this, '/js/controls/PanoramaControls.js')
  4340. },
  4341. {
  4342. '../enum/ControlEvents': 21,
  4343. '../enum/Keys': 30,
  4344. '../enum/MouseButton': 34,
  4345. '../enum/Vectors': 50,
  4346. '../settings': 166,
  4347. '../util/common': 185,
  4348. '../util/logger': 189,
  4349. '../util/math': 190,
  4350. events: 202,
  4351. three: 217
  4352. }
  4353. ],
  4354. 14: [
  4355. function (t, i, e) {
  4356. ;(function (e) {
  4357. 'use strict'
  4358. var c = t('three'),
  4359. h = t('../enum/Viewmode'),
  4360. u = new (t('../util/logger'))(e)
  4361. i.exports = {
  4362. serialize: function (e) {
  4363. return encodeURI(JSON.stringify(e))
  4364. },
  4365. deserialize: function (e) {
  4366. function t(e) {
  4367. return e.reduce(function (e, t) {
  4368. return e && 'number' == typeof t && !isNaN(t)
  4369. }, !0)
  4370. }
  4371. try {
  4372. var i = JSON.parse(decodeURI(e)),
  4373. n = {
  4374. mode: h.fromInt(i.camera_mode),
  4375. panoId: i.scan_id,
  4376. position: new c.Vector3().copy(i.camera_position),
  4377. quaternion: new c.Quaternion().copy(i.camera_quaternion),
  4378. zoom: i.ortho_zoom,
  4379. floorVisibility: i.floor_visibility
  4380. },
  4381. r = n.position
  4382. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0)
  4383. var o = n.quaternion
  4384. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1), n
  4385. } catch (i) {
  4386. u.debug('Not able to parse start location as JSON; falling back to old array style parsing')
  4387. try {
  4388. var a = e.split(','),
  4389. s = {
  4390. x: parseFloat(a[2]),
  4391. y: parseFloat(a[3]),
  4392. z: parseFloat(a[4])
  4393. },
  4394. l = {
  4395. x: parseFloat(a[5]),
  4396. y: parseFloat(a[6]),
  4397. z: parseFloat(a[7]),
  4398. w: parseFloat(a[8])
  4399. }
  4400. return (
  4401. t([s.x, s.y, s.z]) || ((s.x = 0), (s.y = 0), (s.z = 0)),
  4402. t([l.x, l.y, l.z, l.w]) || ((l.x = 0), (l.y = 0), (l.z = 0), (l.w = 1)),
  4403. {
  4404. mode: h.fromInt(a[0]),
  4405. panoId: a[1],
  4406. position: new c.Vector3().copy(s),
  4407. quaternion: new c.Quaternion().copy(l)
  4408. }
  4409. )
  4410. } catch (t) {
  4411. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4412. }
  4413. }
  4414. return null
  4415. }
  4416. }
  4417. }).call(this, '/js/controls/serializer.js')
  4418. },
  4419. {
  4420. '../enum/Viewmode': 51,
  4421. '../util/logger': 189,
  4422. three: 217
  4423. }
  4424. ],
  4425. 15: [
  4426. function (C, I, e) {
  4427. ;(function (e) {
  4428. 'use strict'
  4429. function t() {
  4430. ;(this.endlessLoop = r.warp.loop),
  4431. (this.clock = new i.Clock(!0)),
  4432. (this.model = null),
  4433. (this.player = null),
  4434. (this.currentItem = null),
  4435. (this.destinationItem = null),
  4436. (this.tourIsPlaying = !1),
  4437. (this.transitionStage = v.None),
  4438. (this.nextFunc = null),
  4439. (this.onTheBus = !1),
  4440. (this.tourInProgress = !1),
  4441. (this.reachSource = null),
  4442. (this.interrupted = !1),
  4443. (this.nItems = 0),
  4444. (this.walkingSectionPaused = !1)
  4445. }
  4446. var i = C('three'),
  4447. n = C('./util/logger'),
  4448. r = C('./settings'),
  4449. o = C('./util/transitions'),
  4450. a = C('events').EventEmitter,
  4451. s = C('./enum/Viewmode'),
  4452. l = C('./analytics'),
  4453. c = C('./enum/WarpStyle'),
  4454. h = ((o = C('./util/transitions')), C('./model/ModelManager'), C('./enum/ModelManagerEvents')),
  4455. u = C('./enum/DirectorEvents'),
  4456. d = C('./enum/PlayerEvents'),
  4457. p = (C('./enum/ControlEvents'), C('./enum/BlackoutStyle')),
  4458. f = C('./enum/PathDiscardMode'),
  4459. g = C('./enum/PathDisplayMode'),
  4460. m = (C('./player'), new n(e)),
  4461. v = Object.freeze({
  4462. None: 0,
  4463. Moving: 1,
  4464. Aiming: 2,
  4465. Interlude: 3
  4466. }),
  4467. y = Object.freeze({
  4468. Forward: 1,
  4469. NoChange: 0,
  4470. Backwards: -1
  4471. }),
  4472. A = o.getUniqueId()
  4473. ;((t.prototype = Object.create(a.prototype)).init = function (e, t) {
  4474. ;(this.player = e), (this.modelManager = t), this.updateModel(), this.resetAll(), this.bindEvents()
  4475. }),
  4476. (t.prototype.resetAll = function () {
  4477. if (
  4478. ((this.currentItem = null),
  4479. (this.destinationItem = null),
  4480. (this.tourIsPlaying = !1),
  4481. //this.bgmReplay(),
  4482. (this.transitionStage = v.None),
  4483. (this.nextFunc = null),
  4484. (this.onTheBus = !1),
  4485. (this.reachSource = null),
  4486. (this.interrupted = !1),
  4487. this.model)
  4488. ) {
  4489. var e = r.path.typ === c.WALK ? c.WALK : c.STD
  4490. this.defaultWarpStyle = this.model.data.hasOwnProperty('player_options') && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4491. } else (this.defaultWarpStyle = c.BLACK), m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions')
  4492. this.resetSpecialTransition()
  4493. }),
  4494. (t.prototype.updateModel = function () {
  4495. ;(this.model = this.modelManager.getActiveModel()), (this.nItems = this.model.heroLocations.length)
  4496. }),
  4497. (t.prototype.bindEvents = function () {
  4498. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4499. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4500. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4501. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4502. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4503. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4504. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4505. this.player.once(d.Move, function () {
  4506. o.cancelById(A)
  4507. })
  4508. }),
  4509. (t.prototype.checkAndHandleWalkingtourInterruption = function (e) {
  4510. //快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
  4511. return /* e === c.WALK && ( */ this.interrupt(p.NONE), this.pauseWalkingSection(), this.player.fastForwardActivePanoFlight(), !0 /* ) */
  4512. }),
  4513. (t.prototype.handlePlayerMove = function (e) {
  4514. this.transitionStage === v.Interlude && this.interrupt(p.NONE), this.emit('update.controls')
  4515. }),
  4516. (t.prototype.handlePlayerPanoChosen = function (e, t) {
  4517. this.intermediateState() || e.id === t.id || ((this.onTheBus = !1), this.emit('update.controls'))
  4518. }),
  4519. (t.prototype.handlePlayerModeChanged = function (e, t) {
  4520. this.intermediateState() || e === t || ((this.onTheBus = !1), this.emit('update.controls'))
  4521. }),
  4522. (t.prototype.handlePlayerInputStart = function (e) {
  4523. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4524. }),
  4525. (t.prototype.handlePlayerFlyingStarted = function () {
  4526. this.clearWalkingSectionPaused()
  4527. }),
  4528. (t.prototype.describe = function () {
  4529. return {
  4530. nItems: this.nItems,
  4531. currentItem: this.currentItem,
  4532. destinationItem: this.destinationItem,
  4533. tourIsPlaying: this.tourIsPlaying,
  4534. onTheBus: this.onTheBus,
  4535. endlessLoop: this.endlessLoop,
  4536. viewMode: this.player.mode,
  4537. inTransition: this._inTransition(),
  4538. transitionStage: this.transitionStage,
  4539. tourInProgress: this.tourInProgress
  4540. }
  4541. }),
  4542. (t.prototype._inTransition = function () {
  4543. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4544. }),
  4545. (t.prototype.bounceable = function () {
  4546. var e = this.clock.getDelta()
  4547. return this.isInterrupted() || (e < 0.9 && 0.01 < e) || (this.player.flying && !this.player.isWarping())
  4548. }),
  4549. (t.prototype.itemCompare = function (item1, item2, type) {
  4550. //add
  4551. if (type == 'equal') {
  4552. //==
  4553. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4554. } else if (type == 'less') {
  4555. //<
  4556. return (item1 && item2 && item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4557. }
  4558. })
  4559. ;(t.prototype.currentMoveDirection = function () {
  4560. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4561. return null === this.currentItem || void 0 === this.currentItem
  4562. ? y.Forward
  4563. : this.itemCompare(this.destinationItem, this.currentItem, 'equal')
  4564. ? y.NoChange
  4565. : this.itemCompare(this.currentItem, this.destinationItem, 'less')
  4566. ? y.Forward
  4567. : y.Backwards
  4568. }),
  4569. (t.prototype.clearPath = function () {
  4570. this._inTransition() || this.player.path.discardPathObject()
  4571. }),
  4572. (t.prototype.allFloors = function () {
  4573. this.model.toggleAllFloors()
  4574. }),
  4575. (t.prototype.actionComplete = function (e) {
  4576. if (
  4577. ((this.interrupted = !1),
  4578. (this.transitionStage = v.None),
  4579. this.resetSpecialTransition(),
  4580. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4581. this.tourIsPlaying || (this.player.disablePreRendering(), this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4582. this.emit('update.controls'),
  4583. this.nextFunc)
  4584. ) {
  4585. var t = this.nextFunc
  4586. ;(this.nextFunc = null), t()
  4587. }
  4588. }),
  4589. (t.prototype.awaitCompletion = function (e, t) {
  4590. ;(this.nextFunc = t), e()
  4591. }),
  4592. (t.prototype.updateSuccessFunction = function (e) {
  4593. this.nextFunc = e
  4594. }),
  4595. (t.prototype.interrupt = function (e, t) {
  4596. return (
  4597. !!this.wouldInterrupt() &&
  4598. (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4599. (this.tourIsPlaying = !1),
  4600. //this.bgmReplay(),
  4601. (this.interrupted = !0),
  4602. (this.nextFunc = null),
  4603. this.emit(u.ActionInterrupted),
  4604. null != e || (e = p.BEGINNING),
  4605. this.player.interruptAndFastForward(e, t),
  4606. !0)
  4607. )
  4608. }),
  4609. (t.prototype.wouldInterrupt = function () {
  4610. return this.transitionStage !== v.None
  4611. }),
  4612. (t.prototype.intermediateState = function () {
  4613. return this.transitionStage !== v.None
  4614. }),
  4615. (t.prototype.isInterrupted = function () {
  4616. return this.interrupted
  4617. }),
  4618. (t.prototype.pauseWalkingSection = function () {
  4619. this.walkingSectionPaused = !0
  4620. }),
  4621. (t.prototype.clearWalkingSectionPaused = function () {
  4622. this.walkingSectionPaused = !1
  4623. }),
  4624. (t.prototype.autoTour = function () {
  4625. var i = Date.now()
  4626. this.model.auxDataPromise.then(
  4627. function () {
  4628. i = Date.now() - i
  4629. var e = r.warp.auto,
  4630. t = this.model.data && this.model.data.player_options /* && this.model.data.player_options.highlight_reel */
  4631. 0 <= e &&
  4632. 1 < this.model.heroCount() &&
  4633. t &&
  4634. o.trigger({
  4635. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4636. done: function () {
  4637. this.playTour()
  4638. }.bind(this),
  4639. name: '_atr',
  4640. id: A
  4641. })
  4642. }.bind(this)
  4643. )
  4644. }),
  4645. (t.prototype.atDestinationPano = function () {
  4646. if (!this.player.currentPano || null === this.destinationItem) return !1
  4647. var e = this.player.currentPano.id
  4648. if (void 0 === e) return !1
  4649. var t = this.model.heroLocations
  4650. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4651. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4652. return destination && destination.panoId == e
  4653. }),
  4654. (t.prototype.redirectToItem = function (e, t) {
  4655. if (null != e)
  4656. if (this.wouldInterrupt())
  4657. if (this.player.mode !== s.TRANSITIONING) {
  4658. m.debug('Director.redirectToItem() -> Redirecting to ' + e + ' via ' + t)
  4659. var i = function () {
  4660. o.setTimeout(
  4661. function () {
  4662. this.setDestinationItem(e), this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4663. }.bind(this),
  4664. 0
  4665. )
  4666. }.bind(this)
  4667. this.interrupt(p.END, 0), this.updateSuccessFunction(i)
  4668. } else m.debug('Director.redirectToItem() -> Cannot redirect while transitioning.')
  4669. else m.warn('Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.')
  4670. else m.warn('Director.redirectToItem() -> Redirecting to null item.')
  4671. }),
  4672. (t.prototype.useSpecialTransition = function (e) {
  4673. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug('useSpecialTransition(): ' + e), (this.nextWarpStyle = c.BLACK)
  4674. }),
  4675. (t.prototype.resetSpecialTransition = function () {
  4676. this.nextWarpStyle = this.defaultWarpStyle
  4677. }),
  4678. (t.prototype.arrivedAtDestination = function (e) {
  4679. if (this.player.flying || this.player.isWarping()) m.warn('Cannot advance to interlude or aiming while player is flying or warping.')
  4680. else {
  4681. this.transitionStage = v.Aiming
  4682. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null
  4683. this.player.model.fadePanoMarkers(0),
  4684. this.awaitCompletion(
  4685. function () {
  4686. this.resetSpecialTransition(), e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4687. }.bind(this),
  4688. t
  4689. )
  4690. }
  4691. }),
  4692. (t.prototype.goToDestination = function (e, t, i, n) {
  4693. //音频
  4694. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo //只有外层有音乐
  4695. if (musicInfo && musicInfo.music) {
  4696. let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music
  4697. let audioObj = SoundManager.list.find(e => e.name == 'tour')
  4698. let audioSrc1 = common.getFileNameFromUrl(audioObj.src)
  4699. let audioSrc2 = common.getFileNameFromUrl(src)
  4700. if (audioSrc1 == audioSrc2) {
  4701. //应该是继续播放该folder
  4702. if (this.destinationItem[1] == 0) {
  4703. //从头开始播放 因为可能暂停后然后再点该缩略图播
  4704. SoundManager.play('tour', null, 0) // currentTime = 0;
  4705. } else if (audioObj.audio.paused && audioObj.audio.currentTime < audioObj.audio.duration) {
  4706. //未播完
  4707. SoundManager.play('tour') //继续播。 如果不是< 说明播完了,item[1]不为0应该是继续播放就不需要从头
  4708. }
  4709. } else {
  4710. //很可能是该folder的起始
  4711. SoundManager.play('tour', manage.dealURL(src))
  4712. }
  4713. }
  4714. if (((this.onTheBus = !0), this.emit('update.controls'), this.player.updateLastView(), n || !this.atDestinationPano())) {
  4715. if (this.player.flying || this.player.isWarping()) m.warn('Cannot go to new destination while player is flying or warping.')
  4716. else {
  4717. var a = this.model.getHeroDescriptorByIndex(this.destinationItem),
  4718. s = null,
  4719. l = null
  4720. if (a.isPano()) {
  4721. var o1 = e ? 'black' : this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
  4722. ;(l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o1, !0, i, this.actionComplete.bind(this))),
  4723. (s = this.arrivedAtDestination.bind(this, !0))
  4724. //add
  4725. if (o1 == 'black' && a.zoom && a.zoom != this.player.zoomLevel) {
  4726. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4727. }
  4728. } else {
  4729. ;(l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this))), (s = this.arrivedAtDestination.bind(this, !1))
  4730. }
  4731. ;(this.transitionStage = v.Moving),
  4732. this.model.fadePanoMarkers(0),
  4733. this.awaitCompletion(
  4734. function () {
  4735. l()
  4736. }.bind(this),
  4737. s
  4738. ),
  4739. this.emit('update.controls')
  4740. }
  4741. } else {
  4742. //add 原地旋转时, 写到_warpCameraAim里,因那有时间
  4743. /* var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4744. if(a.zoom && a.zoom != this.player.zoomLevel){
  4745. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4746. } */
  4747. this.arrivedAtDestination(!0)
  4748. }
  4749. }),
  4750. (t.prototype.tourInterlude = function () {
  4751. if (
  4752. (l.trackAlways('reach_highlight', {
  4753. reach_source: this.reachSource
  4754. }),
  4755. this.model.fadePanoMarkers(0),
  4756. this.emit('update.controls'),
  4757. this.tourIsPlaying)
  4758. )
  4759. return this.atEndOfTour() && !this.endlessLoop
  4760. ? ((this.tourInProgress = !1), this.stopTour(), this.emit(u.TourEnd), void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity)))
  4761. : void this.awaitCompletion(
  4762. function () {
  4763. ;(this.transitionStage = v.Interlude), this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4764. }.bind(this),
  4765. this.goNext.bind(this)
  4766. )
  4767. }),
  4768. (t.prototype.findNearestItem = function (endToStart = true) {
  4769. //找到离currentPano最近的导览
  4770. /* if(this.atDestinationPano(this.player.currentPano)){//在终点直接从头。但有的场景可能不希望如此,就想跳到所属的展区开始。
  4771. return [0,0] //2023.7.7发现在点击item后播放会从头开始
  4772. } */
  4773. //注:没有判断此刻是否在panorama模式,就使用currentPano
  4774. var result = { item: [0, 0], dis: Infinity }
  4775. var compare = (location, item) => {
  4776. if (location.panoId != void 0 && location.panoId != 'outside') {
  4777. var pano = this.model.panos.index[location.panoId]
  4778. var dis = pano.position.distanceTo(this.player.currentPano.position)
  4779. if (dis < result.dis) {
  4780. ;(result.item = item), (result.dis = dis)
  4781. } else if (dis == result.dis) {
  4782. //如果两个位置相同,优先播放在导览条上离激活的最近的那段导览
  4783. /* if(this.itemCompare(item, this.currentItem, 'equal')){
  4784. result.item = item, result.dis = dis
  4785. } */
  4786. if (this.currentItem && Math.abs(item[0] - this.currentItem[0]) < Math.abs(result.item[0] - this.currentItem[0])) {
  4787. ;(result.item = item), (result.dis = dis)
  4788. }
  4789. }
  4790. }
  4791. }
  4792. this.model.heroLocations.forEach((e, i) => {
  4793. if (e.heroLocations) {
  4794. /* e.heroLocations.forEach((a,j)=>{
  4795. compare(a, [i,j])
  4796. }) */
  4797. var location = e.heroLocations.find(e => e.panoId != void 0)
  4798. location && compare(location, [i, 0]) //跳到此区域开头
  4799. } else {
  4800. compare(e, [i, 0])
  4801. }
  4802. })
  4803. if (endToStart && this.atEndOfTour(result.item)) {
  4804. //如果是最后一个点,直接跳到开头,否则导览开始就在终点的话不会从头开始
  4805. return [0, 0] //但注意最后是区域的话result.item是区域开头,除非站在最末最末尾的位置,上面的atDestinationPano直接返回
  4806. }
  4807. return result.item
  4808. }),
  4809. (t.prototype.playTour = function () {
  4810. if (!this.bounceable())
  4811. return this.tourIsPlaying
  4812. ? void m.info('tour is already playing')
  4813. : void (
  4814. this.wouldInterrupt() ||
  4815. (this.player.emit('tour_auto', this.defaultWarpStyle),
  4816. (this.tourInProgress = !0),
  4817. (this.reachSource = 'play'),
  4818. (this.tourIsPlaying = !0),
  4819. (this.wasZoomEnabled = this.player.zoomEnabled),
  4820. (this.player.zoomEnabled = !1),
  4821. this.resetSpecialTransition(),
  4822. this.emit('update.controls'),
  4823. this.emit(u.TourStart),
  4824. this.player.enablePreRendering(),
  4825. this.walkingSectionPaused
  4826. ? (this.clearWalkingSectionPaused(), this.goToDestination())
  4827. : /* this.goNext() */ this.atEndOfTour()
  4828. ? this.goNext()
  4829. : (this.tourAdvance(0), this.goToDestination()))
  4830. ) //xzw: 不要直接跳到下一个点开始,从当前点开始,否则当一段区域内只有一个导览时播放会立刻跳到下一个缩略图进行。
  4831. }),
  4832. (t.prototype.playTourNearBy = function () {
  4833. //就近导览
  4834. if (!this.bounceable()) {
  4835. return this.tourIsPlaying
  4836. ? void m.info('tour is already playing')
  4837. : void (
  4838. this.wouldInterrupt() ||
  4839. (this.player.emit('tour_auto', this.defaultWarpStyle),
  4840. (this.tourInProgress = !0),
  4841. (this.reachSource = 'play'),
  4842. (this.tourIsPlaying = !0),
  4843. (this.wasZoomEnabled = this.player.zoomEnabled),
  4844. (this.player.zoomEnabled = !1),
  4845. this.resetSpecialTransition(),
  4846. this.emit('update.controls'),
  4847. this.emit(p.TourStart),
  4848. this.player.enablePreRendering(),
  4849. /* this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4850. this.goToDestination()) : this.goNext())) */
  4851. this.setDestinationItem(this.findNearestItem()),
  4852. this.goToDestination())
  4853. )
  4854. }
  4855. }),
  4856. (t.prototype.stopTour = function (isAutoStop) {
  4857. //停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4858. this.isInterrupted() ||
  4859. (this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle)) ||
  4860. (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4861. (this.tourIsPlaying = !1),
  4862. //(!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  4863. this.interrupt(),
  4864. this.clearWalkingSectionPaused(),
  4865. this.resetSpecialTransition(),
  4866. this.emit('update.controls'))
  4867. }),
  4868. (t.prototype.endTourProgress = function () {
  4869. ;(this.tourInProgress = !1), this.emit('update.controls'), this.emit(u.TourEnd)
  4870. }),
  4871. (t.prototype.goToHighlight = function (e) {
  4872. if (this.wouldInterrupt()) this.itemCompare(this.destinationItem, e, 'equal') ? this.interrupt() : this.redirectToItem(e, 'goToHighlight')
  4873. else {
  4874. if ((m.debug('<tour.goto ' + e + '>'), this.isInterrupted())) return
  4875. this.clearWalkingSectionPaused(),
  4876. this.setDestinationItem(e),
  4877. this.useSpecialTransition('Hilight'),
  4878. this.goToDestination(true), //add true
  4879. l.trackAlways('reach_highlight', {
  4880. reach_source: 'thumb'
  4881. })
  4882. }
  4883. }),
  4884. (t.prototype.prevHighlight = function () {
  4885. this.bounceable() ||
  4886. (this.player.emit('tour_manual', 'prev'), this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(), (this.reachSource = 'prev'), this.goPrev()))
  4887. }),
  4888. (t.prototype.nextHighlight = function () {
  4889. this.bounceable() ||
  4890. (this.player.emit('tour_manual', 'next'), this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(), (this.reachSource = 'next'), this.goNext()))
  4891. }),
  4892. (t.prototype.changeMode = function (e) {
  4893. var t = $.Deferred(),
  4894. i = t.resolve.bind(t),
  4895. n = t.reject.bind(t)
  4896. if (
  4897. (this.emit(u.StartModeChange),
  4898. !function () {
  4899. return this.clearWalkingSectionPaused(), !!this.wouldInterrupt() && (this.interrupt(), !0)
  4900. }.bind(this)())
  4901. ) {
  4902. switch (e) {
  4903. case s.PANORAMA:
  4904. this.player.mode === s.PANORAMA
  4905. ? this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(i).fail(n)
  4906. : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n)
  4907. break
  4908. case s.DOLLHOUSE:
  4909. case s.FLOORPLAN:
  4910. this.player
  4911. .flyToNewMode({
  4912. mode: e
  4913. })
  4914. .done(i)
  4915. .fail(n)
  4916. break
  4917. case s.OUTDOOR:
  4918. this.player.model.has360Views &&
  4919. (this.player.mode !== s.PANORAMA || (this.player.mode === s.PANORAMA && this.player.currentPano.isAligned())) &&
  4920. this.player.goToLastView(!1).done(i).fail(n)
  4921. }
  4922. return t.promise()
  4923. }
  4924. }),
  4925. (t.prototype.atEndOfTour = function (item) {
  4926. //return this.currentItem >= this.nItems - 1
  4927. var end = this.currentItem && this.currentItem[0] >= this.nItems - 1
  4928. if (end) {
  4929. var heroLocations = this.model.heroLocations[this.nItems - 1].heroLocations
  4930. if (heroLocations) {
  4931. end = this.currentItem[1] >= heroLocations.length - 1
  4932. }
  4933. }
  4934. return end
  4935. }),
  4936. (t.prototype.firstDestination = function () {
  4937. //return 0 < this.nItems ? 0 : null
  4938. return 0 < this.nItems ? [0, 0] : null
  4939. }),
  4940. (t.prototype.finalDestination = function () {
  4941. //return 0 < this.nItems ? this.nItems - 1 : null
  4942. return 0 < this.nItems ? [this.nItems - 1, 0] : null
  4943. }),
  4944. (t.prototype.goPrev = function () {
  4945. this.tourAdvance(-1)
  4946. }),
  4947. (t.prototype.goNext = function () {
  4948. this.tourAdvance(1)
  4949. }),
  4950. (t.prototype.setDestinationItem = function (e) {
  4951. ;(this.destinationItem = e), this.emit('update.controls')
  4952. }),
  4953. (t.prototype.setCurrentItem = function (e) {
  4954. ;(this.currentItem = e), this.emit('update.controls')
  4955. }),
  4956. (t.prototype.nextItem = function (currentItem) {
  4957. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4958. if (currentItem == void 0) return this.firstDestination()
  4959. var currentLocation = this.model.heroLocations[currentItem[0]]
  4960. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4961. var item
  4962. if (this.currentItem[1] >= currentChildNum - 1) {
  4963. //子目录中最后一个
  4964. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  4965. } else {
  4966. item = [currentItem[0], currentItem[1] + 1]
  4967. }
  4968. if (item[0] >= this.nItems) {
  4969. item = this.firstDestination()
  4970. }
  4971. return item
  4972. //暂时不理会endlessLoop,默认为false
  4973. }),
  4974. (t.prototype.prevItem = function (currentItem) {
  4975. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4976. if (currentItem == void 0) return this.firstDestination() //finalDestination?
  4977. var item
  4978. var lastLocation = this.model.heroLocations[currentItem[0] - 1]
  4979. if (!lastLocation) return this.finalDestination() //[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  4980. else {
  4981. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  4982. if (this.currentItem[1] == 0) {
  4983. //子目录中第一个
  4984. return [currentItem[0] - 1, lastChildNum - 1]
  4985. } else {
  4986. return [currentItem[0], currentItem[1] - 1]
  4987. }
  4988. }
  4989. }),
  4990. (t.prototype.tourAdvance = function (e) {
  4991. //e是1或-1或0
  4992. m.debug('tourAdvance(' + e + ')')
  4993. if (null === this.currentItem || void 0 === this.currentItem) {
  4994. this.setDestinationItem(this.firstDestination())
  4995. } else {
  4996. var item = this.currentItem
  4997. if (e == 1) {
  4998. item = this.nextItem(this.currentItem)
  4999. } else if (e == -1) {
  5000. item = this.prevItem(this.currentItem)
  5001. }
  5002. this.setDestinationItem(item)
  5003. }
  5004. if (this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0) {
  5005. this.useSpecialTransition('reverse-looping to end')
  5006. } else if (this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')) {
  5007. this.useSpecialTransition('looping back to start')
  5008. }
  5009. /* if(this.destinationItem[0] < 0 ){
  5010. this.setDestinationItem(this.finalDestination())
  5011. this.useSpecialTransition("reverse-looping to end")
  5012. }else{
  5013. this.destinationItem[0] >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  5014. this.useSpecialTransition("looping back to start"))
  5015. } */
  5016. /* var momentTour = this.getMomentTour(this.destinationItem);
  5017. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5018. var i = this.player.zoomLevel;
  5019. this.player.zoomEnabled = !0;
  5020. var t = function(e, t) {
  5021. this.player.zoomTo((1 - e) * i, !0)
  5022. }
  5023. .bind(this);
  5024. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  5025. } */
  5026. this.goToDestination()
  5027. }),
  5028. (t.prototype.getMomentTour = function (destinationItem) {
  5029. //add
  5030. var wholeMomentTour = window.DATA.momentTour || 'walk' //最外层
  5031. if (!destinationItem) return wholeMomentTour
  5032. else {
  5033. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem) //最内层。 如果有使用最内层
  5034. if (currentLocation.momentTour) return currentLocation.momentTour
  5035. var currentLocation_ = this.model.heroLocations[destinationItem[0]]
  5036. return currentLocation_.momentTour || wholeMomentTour //若中间层或最内层有就使用,否则使用最外层
  5037. }
  5038. }),
  5039. (I.exports = t)
  5040. }).call(this, '/js/director.js')
  5041. },
  5042. {
  5043. './analytics': 4,
  5044. './enum/BlackoutStyle': 18,
  5045. './enum/ControlEvents': 21,
  5046. './enum/DirectorEvents': 23,
  5047. './enum/ModelManagerEvents': 33,
  5048. './enum/PathDiscardMode': 38,
  5049. './enum/PathDisplayMode': 39,
  5050. './enum/PlayerEvents': 40,
  5051. './enum/Viewmode': 51,
  5052. './enum/WarpStyle': 52,
  5053. './model/ModelManager': 140,
  5054. './player': 155,
  5055. './settings': 166,
  5056. './util/logger': 189,
  5057. './util/transitions': 195,
  5058. events: 202,
  5059. three: 217
  5060. }
  5061. ],
  5062. 16: [
  5063. function (e, t, i) {
  5064. 'use strict'
  5065. var n = e('three'),
  5066. r = e('./enum/Viewmode'),
  5067. o = (e('./settings'), e('./util/transitions')),
  5068. a = e('./enum/PlayerEvents'),
  5069. s = new n.ShaderPass(n.HorizontalBlurShader),
  5070. l = new n.ShaderPass(n.VerticalBlurShader)
  5071. l.renderToScreen = !0
  5072. var c = $('#player').width() / $('#player').height()
  5073. isNaN(c) && (c = 1)
  5074. //initTransitionPass(n)
  5075. var h = {
  5076. currentBlur: 0,
  5077. aspect: c,
  5078. blurStrength: 1,
  5079. hblurPass: s,
  5080. vblurPass: l,
  5081. fastTranMaskPass: new n.TransitionPass(),
  5082. bindEvents: function (e) {
  5083. e.on(a.ModeChanged, function (e, t) {
  5084. e === r.PANORAMA && (o.cancel(h.blur), o.cancel(h.addBlur), o.start(h.removeBlur, 500, null, 0, null, 'deblur'))
  5085. })
  5086. },
  5087. blur: function (e) {
  5088. var t = (h.currentBlur = e) * h.blurStrength
  5089. ;(l.uniforms.v.value = (t / 512) * h.aspect), (s.uniforms.h.value = t / 512)
  5090. },
  5091. addBlur: function (e) {
  5092. ;(e = Math.max(e, h.currentBlur)), h.blur(e)
  5093. },
  5094. removeBlur: function (e) {
  5095. ;(e = Math.min(1 - e, h.currentBlur)), h.blur(e)
  5096. }
  5097. }
  5098. h.blur(0), (t.exports = h)
  5099. },
  5100. {
  5101. './enum/PlayerEvents': 40,
  5102. './enum/Viewmode': 51,
  5103. './settings': 166,
  5104. './util/transitions': 195,
  5105. three: 217
  5106. }
  5107. ],
  5108. 17: [
  5109. function (e, t, i) {
  5110. 'use strict'
  5111. t.exports = {
  5112. UNKNOWN: 0,
  5113. ALIGNED: 1,
  5114. UNALIGNED: 2,
  5115. PLACED: 3
  5116. }
  5117. },
  5118. {}
  5119. ],
  5120. 18: [
  5121. function (e, t, i) {
  5122. 'use strict'
  5123. t.exports = {
  5124. NONE: 0,
  5125. MIDDLE: 1,
  5126. END: 2,
  5127. BEGINNING: 3,
  5128. FADEIN: 4
  5129. }
  5130. },
  5131. {}
  5132. ],
  5133. 19: [
  5134. function (e, t, i) {
  5135. 'use strict'
  5136. var r = e('three')
  5137. t.exports = {
  5138. newBlue: new r.Color(4967932),
  5139. altBlue: new r.Color(47355),
  5140. tagDefault: new r.Color(223357),
  5141. classicBlue: new r.Color(53759),
  5142. mpYellow: new r.Color(16502016),
  5143. mpOrange: new r.Color(16428055),
  5144. mpBlue: new r.Color(12096),
  5145. mpLtGrey: new r.Color(13751252),
  5146. mpDkGrey: new r.Color(10000019),
  5147. mpRed: new r.Color(12525854),
  5148. mpOrangeDesat: new r.Color(16764529),
  5149. mpBlueDesat: new r.Color(4034734),
  5150. mpRedDesat: new r.Color(14705505),
  5151. white: new r.Color(16777215),
  5152. black: new r.Color(0),
  5153. _desat: function (e, t) {
  5154. var i = t || 0.3,
  5155. n = new r.Color().copy(e).getHSL()
  5156. return new r.Color().setHSL(n.h, n.s * (1 - i), n.l)
  5157. },
  5158. _darken: function (e, t) {
  5159. var i = t || 0.2,
  5160. n = e.getHSL()
  5161. return new r.Color().setHSL(n.h, n.s, n.l * (1 - i))
  5162. }
  5163. }
  5164. },
  5165. {
  5166. three: 217
  5167. }
  5168. ],
  5169. 20: [
  5170. function (e, t, i) {
  5171. 'use strict'
  5172. t.exports = {
  5173. NONE: -1,
  5174. ROTATE: 0,
  5175. DOLLY: 1,
  5176. PAN: 2,
  5177. ROTATE_DOLLY: 3,
  5178. PAN_DOLLY: 4
  5179. }
  5180. },
  5181. {}
  5182. ],
  5183. 21: [
  5184. function (e, t, i) {
  5185. 'use strict'
  5186. t.exports = {
  5187. Move: 'move',
  5188. InteractionDirect: 'interaction.direct',
  5189. InteractionKey: 'interaction.key',
  5190. InteractionGui: 'interaction.gui',
  5191. FlyInDirection: 'fly.direction',
  5192. InputStart: 'input.start',
  5193. Pinch: 'input.pinch',
  5194. Scroll: 'input.scroll',
  5195. AutoPanInterrupt: 'autopan.interrupt',
  5196. AutoPanComplete: 'autopan.complete',
  5197. AutoPanClamped: 'autopan.clamped',
  5198. LongTap: 'longtap'
  5199. }
  5200. },
  5201. {}
  5202. ],
  5203. 22: [
  5204. function (e, t, i) {
  5205. 'use strict'
  5206. t.exports = Object.freeze({
  5207. FORWARD: 'FORWARD',
  5208. LEFT: 'LEFT',
  5209. RIGHT: 'RIGHT',
  5210. BACK: 'BACK',
  5211. UP: 'UP',
  5212. DOWN: 'DOWN'
  5213. })
  5214. },
  5215. {}
  5216. ],
  5217. 23: [
  5218. function (e, t, i) {
  5219. 'use strict'
  5220. t.exports = {
  5221. ActionInterrupted: 'action.interrupted',
  5222. TourStart: 'tour.start',
  5223. TourEnd: 'tour.end',
  5224. StartModeChange: 'mode.startChange'
  5225. }
  5226. },
  5227. {}
  5228. ],
  5229. 24: [
  5230. function (e, t, i) {
  5231. 'use strict'
  5232. t.exports = Object.freeze({
  5233. None: 0,
  5234. Queued: 1,
  5235. ForceQueued: 2,
  5236. Downloading: 3,
  5237. Downloaded: 4,
  5238. DownloadFailed: 5
  5239. })
  5240. },
  5241. {}
  5242. ],
  5243. 25: [
  5244. function (e, t, i) {
  5245. 'use strict'
  5246. t.exports = {
  5247. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5248. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5249. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5250. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5251. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5252. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5253. }
  5254. },
  5255. {}
  5256. ],
  5257. 26: [
  5258. function (e, t, i) {
  5259. 'use strict'
  5260. t.exports = {
  5261. Texture2D: 0,
  5262. TextureCube: 1
  5263. }
  5264. },
  5265. {}
  5266. ],
  5267. 27: [
  5268. function (e, t, i) {
  5269. 'use strict'
  5270. t.exports = {
  5271. SMALL: 'small',
  5272. LARGE: 'large'
  5273. }
  5274. },
  5275. {}
  5276. ],
  5277. 28: [
  5278. function (e, t, i) {
  5279. 'use strict'
  5280. var n = e('./Viewmode'),
  5281. r = {
  5282. LANDING: {},
  5283. NAVIGATION: 'navigation',
  5284. MORE_HELP: 'moreHelp',
  5285. TOUR_INTERACTION: {}
  5286. }
  5287. ;(r.LANDING[n.PANORAMA] = 'panorama.landing'),
  5288. (r.LANDING[n.OUTDOOR] = 'outdoor.landing'),
  5289. (r.LANDING[n.DOLLHOUSE] = 'dollhouse.landing'),
  5290. (r.LANDING[n.FLOORPLAN] = 'floorplan.landing'),
  5291. (r.TOUR_INTERACTION.standard = 'standard.tour'),
  5292. (r.TOUR_INTERACTION[n.OUTDOOR] = 'outdoor.tour'),
  5293. (r.TOUR_INTERACTION[n.FLOORPLAN] = 'floorplan.tour'),
  5294. (t.exports = r)
  5295. },
  5296. {
  5297. './Viewmode': 51
  5298. }
  5299. ],
  5300. 29: [
  5301. function (e, t, i) {
  5302. 'use strict'
  5303. var n = {
  5304. UP: 1,
  5305. DOWN: -1,
  5306. LEFT: 'L',
  5307. RIGHT: 'R',
  5308. FORWARD: 'F',
  5309. BACK: 'B',
  5310. reverse: {},
  5311. opposite: function (e) {
  5312. return this.reverse[e.toString()]
  5313. }
  5314. }
  5315. ;(n.reverse[n.UP] = n.DOWN),
  5316. (n.reverse[n.DOWN] = n.UP),
  5317. (n.reverse[n.LEFT] = n.RIGHT),
  5318. (n.reverse[n.RIGHT] = n.LEFT),
  5319. (n.reverse[n.FORWARD] = n.BACK),
  5320. (n.reverse[n.BACK] = n.FORWARD),
  5321. (t.exports = n)
  5322. },
  5323. {}
  5324. ],
  5325. 30: [
  5326. function (e, t, i) {
  5327. 'use strict'
  5328. var n = {
  5329. ZERO: 48,
  5330. ONE: 49,
  5331. TWO: 50,
  5332. THREE: 51,
  5333. FOUR: 52,
  5334. FIVE: 53,
  5335. SIX: 54,
  5336. SEVEN: 55,
  5337. EIGHT: 56,
  5338. NINE: 57,
  5339. LEFTARROW: 37,
  5340. UPARROW: 38,
  5341. RIGHTARROW: 39,
  5342. DOWNARROW: 40,
  5343. A: 65,
  5344. B: 66,
  5345. C: 67,
  5346. D: 68,
  5347. E: 69,
  5348. F: 70,
  5349. G: 71,
  5350. H: 72,
  5351. I: 73,
  5352. J: 74,
  5353. K: 75,
  5354. L: 76,
  5355. M: 77,
  5356. N: 78,
  5357. O: 79,
  5358. P: 80,
  5359. Q: 81,
  5360. R: 82,
  5361. S: 83,
  5362. T: 84,
  5363. U: 85,
  5364. V: 86,
  5365. W: 87,
  5366. X: 88,
  5367. Y: 89,
  5368. Z: 90,
  5369. SPACE: 32,
  5370. RETURN: 13,
  5371. SEMICOLON: 186,
  5372. PLUSEQUALS: 187,
  5373. DASHUNDERSCORE: 189,
  5374. OPENBRACKET: 219
  5375. }
  5376. e('../util/browser').detectFirefox() && ((n.SEMICOLON = 59), (n.PLUSEQUALS = 61), (n.DASHUNDERSCORE = 173)), (t.exports = n)
  5377. },
  5378. {
  5379. '../util/browser': 182
  5380. }
  5381. ],
  5382. 31: [
  5383. function (e, t, i) {
  5384. 'use strict'
  5385. t.exports = {
  5386. EN_US: 'en-US',
  5387. ES_MX: 'es-MX',
  5388. FR_FR: 'fr-FR',
  5389. DE_DE: 'de-DE',
  5390. RU_RU: 'ru-RU',
  5391. CN_CN: 'cn-CN',
  5392. JP_JP: 'jp-JP'
  5393. }
  5394. },
  5395. {}
  5396. ],
  5397. 32: [
  5398. function (e, t, i) {
  5399. 'use strict'
  5400. t.exports = {
  5401. TagActivated: 'tag.activated',
  5402. TagDismissed: 'tag.dismissed',
  5403. TagNavigation: 'tag.navigation'
  5404. }
  5405. },
  5406. {}
  5407. ],
  5408. 33: [
  5409. function (e, t, i) {
  5410. 'use strict'
  5411. t.exports = {
  5412. ModelAdded: 'model-added',
  5413. ActiveModelChanged: 'active-model-changed'
  5414. }
  5415. },
  5416. {}
  5417. ],
  5418. 34: [
  5419. function (e, t, i) {
  5420. 'use strict'
  5421. t.exports = {
  5422. LEFT: 0,
  5423. MIDDLE: 1,
  5424. RIGHT: 2
  5425. }
  5426. },
  5427. {}
  5428. ],
  5429. 35: [
  5430. function (e, t, i) {
  5431. 'use strict'
  5432. t.exports = {
  5433. PanoRenderComplete: 'panorama.render.complete',
  5434. TileRenderFailure: 'panorama.tile.render.failed',
  5435. TileRenderSuccess: 'panorama.tile.render.success',
  5436. TileUploadAttempted: 'panorama.tile.upload.attempted',
  5437. UploadAttemptedForAllTiles: 'panorama.upload.attempted.all.tiles',
  5438. ZoomLevelRenderStarted: 'panorama.zoom.render.started'
  5439. }
  5440. },
  5441. {}
  5442. ],
  5443. 36: [
  5444. function (e, t, i) {
  5445. 'use strict'
  5446. t.exports = {
  5447. BASE: 1,
  5448. STANDARD: 2,
  5449. HIGH: 3,
  5450. ULTRAHIGH: 4
  5451. }
  5452. },
  5453. {}
  5454. ],
  5455. 37: [
  5456. function (e, t, i) {
  5457. 'use strict'
  5458. t.exports = {
  5459. LoadComplete: 'panorama.load.complete',
  5460. LoadFailed: 'panorama.load.failed',
  5461. TileLoaded: 'panorama.tile.loaded'
  5462. }
  5463. },
  5464. {}
  5465. ],
  5466. 38: [
  5467. function (e, t, i) {
  5468. 'use strict'
  5469. t.exports = Object.freeze({
  5470. Standard: 0,
  5471. Slow: 1,
  5472. Retain: 2
  5473. })
  5474. },
  5475. {}
  5476. ],
  5477. 39: [
  5478. function (e, t, i) {
  5479. 'use strict'
  5480. t.exports = Object.freeze({
  5481. Show: 0,
  5482. Hide: 1,
  5483. Retain: 2
  5484. })
  5485. },
  5486. {}
  5487. ],
  5488. 40: [
  5489. function (e, t, i) {
  5490. 'use strict'
  5491. t.exports = {
  5492. Move: 'move',
  5493. MoveComplete: 'move.complete',
  5494. ModeChanged: 'mode.changed',
  5495. ModeChanging: 'mode.changing',
  5496. PanoChosen: 'pano.chosen',
  5497. ClosestPanoChanging: 'closest.pano.changing',
  5498. WarpStarted: 'warp.started',
  5499. WarpInterrupted: 'warp.interrupted',
  5500. WarpEnded: 'warp.ended',
  5501. FlyinFinished: 'flyin.finished',
  5502. FlyingStarted: 'flying.started',
  5503. FlyingInterrupted: 'flying.interrupted',
  5504. FlyingEnded: 'flying.ended',
  5505. Ready: 'ready',
  5506. StartInside: 'start.inside',
  5507. StartOutside: 'start.outside',
  5508. ViewChanged: 'view.changed',
  5509. WarpInterruptedWithFlyTo: 'warp.interrupted.flyto',
  5510. InputStart: 'input.start'
  5511. }
  5512. },
  5513. {}
  5514. ],
  5515. 41: [
  5516. function (e, t, i) {
  5517. 'use strict'
  5518. t.exports = Object.freeze({
  5519. DEFAULT: 0,
  5520. PANOMARKERS: 1,
  5521. RETICULE: 2,
  5522. TAG: 3
  5523. })
  5524. },
  5525. {}
  5526. ],
  5527. 42: [
  5528. function (e, t, i) {
  5529. 'use strict'
  5530. t.exports = {
  5531. visibleFloor: 1,
  5532. ghostFloor: 3,
  5533. boundingSkybox: 1,
  5534. panoMarker: 2,
  5535. reticule: 3,
  5536. tagStem: 4,
  5537. tagDisc: 5,
  5538. ribbon: 100
  5539. }
  5540. },
  5541. {}
  5542. ],
  5543. 43: [
  5544. function (e, t, i) {
  5545. 'use strict'
  5546. t.exports = {
  5547. ContextCreated: 'scene-renderer-context-created',
  5548. AfterRender: 'after-render',
  5549. MemoryUsageUpdated: 'scene-renderer-memory-usage-updated'
  5550. }
  5551. },
  5552. {}
  5553. ],
  5554. 44: [
  5555. function (e, t, i) {
  5556. 'use strict'
  5557. t.exports = {
  5558. IDLE: 'idle',
  5559. BROWSE: 'browse',
  5560. EXAMINE: 'examine'
  5561. }
  5562. },
  5563. {}
  5564. ],
  5565. 45: [
  5566. function (e, t, i) {
  5567. 'use strict'
  5568. t.exports = {
  5569. TileDownloadSuccess: 'tiledownloader.download.success',
  5570. TileDownloadFailure: 'tiledownloader.download.failure',
  5571. PanoDownloadComplete: 'tiledownloader.pano.download.complete'
  5572. }
  5573. },
  5574. {}
  5575. ],
  5576. 46: [
  5577. function (e, t, i) {
  5578. 'use strict'
  5579. t.exports = {
  5580. CardboardAndroid: 'googlevr',
  5581. GearVR: 'gearvr',
  5582. CardboardIOS: 'googlevrios',
  5583. Cardboard: 'googlevr'
  5584. }
  5585. },
  5586. {}
  5587. ],
  5588. 47: [
  5589. function (e, t, i) {
  5590. 'use strict'
  5591. t.exports = {
  5592. NONE: 0,
  5593. CONTEXTUAL: 1,
  5594. ANDROID: 2
  5595. }
  5596. },
  5597. {}
  5598. ],
  5599. 48: [
  5600. function (e, t, i) {
  5601. 'use strict'
  5602. var n = {
  5603. Title: 0,
  5604. Cardboard: 1
  5605. },
  5606. r = {
  5607. Title: 0,
  5608. Cardboard: 1,
  5609. Gear: 2
  5610. }
  5611. ;[n, r].forEach(function (e) {
  5612. e.pageCount = Object.keys(e).length
  5613. }),
  5614. (t.exports.ios = n),
  5615. (t.exports.standard = r)
  5616. },
  5617. {}
  5618. ],
  5619. 49: [
  5620. function (e, t, i) {
  5621. 'use strict'
  5622. t.exports = {
  5623. Android: 'android',
  5624. IOS: 'ios',
  5625. Desktop: 'desktop',
  5626. UnsupportedAndroid: 'android-unsupported'
  5627. }
  5628. },
  5629. {}
  5630. ],
  5631. 50: [
  5632. function (e, t, i) {
  5633. 'use strict'
  5634. var n = e('three')
  5635. t.exports = {
  5636. UP: new n.Vector3(0, 1, 0),
  5637. DOWN: new n.Vector3(0, -1, 0),
  5638. LEFT: new n.Vector3(-1, 0, 0),
  5639. RIGHT: new n.Vector3(1, 0, 0),
  5640. FORWARD: new n.Vector3(0, 0, -1),
  5641. BACK: new n.Vector3(0, 0, 1)
  5642. }
  5643. },
  5644. {
  5645. three: 217
  5646. }
  5647. ],
  5648. 51: [
  5649. function (e, t, i) {
  5650. 'use strict'
  5651. var n = e('../exception/ViewmodeConvertException'),
  5652. r = e('./coreViewmodes'),
  5653. o = {
  5654. MESH: 'mesh',
  5655. OUTDOOR: 'outdoor',
  5656. TRANSITIONING: 'transitioning',
  5657. toInt: function (e) {
  5658. switch (e) {
  5659. case this.PANORAMA:
  5660. return 1
  5661. case this.DOLLHOUSE:
  5662. return 2
  5663. case this.FLOORPLAN:
  5664. return 3
  5665. case this.OUTDOOR:
  5666. return 4
  5667. case this.TRANSITIONING:
  5668. return -1
  5669. }
  5670. throw new n('No known conversion for Viewmode to int for mode: ' + e)
  5671. },
  5672. fromInt: function (e) {
  5673. switch (e) {
  5674. case '1':
  5675. case 1:
  5676. return this.PANORAMA
  5677. case '2':
  5678. case 2:
  5679. return this.DOLLHOUSE
  5680. case '3':
  5681. case 3:
  5682. return this.FLOORPLAN
  5683. case '4':
  5684. case 4:
  5685. return this.OUTDOOR
  5686. }
  5687. throw new n('No known conversion for int to viewmode for int: ' + e)
  5688. },
  5689. convertWorkshopModeInt: function (e) {
  5690. switch (e) {
  5691. case '0':
  5692. case 0:
  5693. case void 0:
  5694. return this.PANORAMA
  5695. case '1':
  5696. case 1:
  5697. return this.FLOORPLAN
  5698. case '2':
  5699. case 2:
  5700. return this.DOLLHOUSE
  5701. case '3':
  5702. case 3:
  5703. return this.MESH
  5704. }
  5705. throw new n('No known conversion for Workshop int to viewmode for int: ' + e)
  5706. }
  5707. }
  5708. e('../util/common').extendObject(o, r), (t.exports = o)
  5709. },
  5710. {
  5711. '../exception/ViewmodeConvertException': 58,
  5712. '../util/common': 185,
  5713. './coreViewmodes': 54
  5714. }
  5715. ],
  5716. 52: [
  5717. function (e, t, i) {
  5718. 'use strict'
  5719. t.exports = {
  5720. BLACK: 'black',
  5721. STD: 'std',
  5722. WALK: 'walk'
  5723. }
  5724. },
  5725. {}
  5726. ],
  5727. 53: [
  5728. function (e, t, i) {
  5729. 'use strict'
  5730. t.exports = {
  5731. ZoomIn: 'zoom.in',
  5732. ZoomOut: 'zoom.out',
  5733. ZoomMax: 'zoom.max',
  5734. ZoomMin: 'zoom.min'
  5735. }
  5736. },
  5737. {}
  5738. ],
  5739. 54: [
  5740. function (e, t, i) {
  5741. 'use strict'
  5742. t.exports = {
  5743. PANORAMA: 'panorama',
  5744. DOLLHOUSE: 'dollhouse',
  5745. FLOORPLAN: 'floorplan'
  5746. }
  5747. },
  5748. {}
  5749. ],
  5750. 55: [
  5751. function (e, t, i) {
  5752. 'use strict'
  5753. t.exports = function (e) {
  5754. this.message = e
  5755. }
  5756. },
  5757. {}
  5758. ],
  5759. 56: [
  5760. function (e, t, i) {
  5761. 'use strict'
  5762. function n(e) {
  5763. r.call(this, e)
  5764. }
  5765. var r = e('./BasicException')
  5766. ;(n.prototype = Object.create(r.prototype)), (t.exports = n)
  5767. },
  5768. {
  5769. './BasicException': 55
  5770. }
  5771. ],
  5772. 57: [
  5773. function (e, t, i) {
  5774. 'use strict'
  5775. function n(e) {
  5776. r.call(this, e)
  5777. }
  5778. var r = e('./BasicException')
  5779. ;(n.prototype = Object.create(r.prototype)), (t.exports = n)
  5780. },
  5781. {
  5782. './BasicException': 55
  5783. }
  5784. ],
  5785. 58: [
  5786. function (e, t, i) {
  5787. 'use strict'
  5788. function n(e) {
  5789. r.call(this, e)
  5790. }
  5791. var r = e('./BasicException')
  5792. ;(n.prototype = Object.create(r.prototype)), (t.exports = n)
  5793. },
  5794. {
  5795. './BasicException': 55
  5796. }
  5797. ],
  5798. 59: [
  5799. function (a, s, e) {
  5800. ;(function (e) {
  5801. 'use strict'
  5802. var i = a('./util/ajax'),
  5803. n = a('./util/showcase'),
  5804. t = a('./util/logger'),
  5805. r = new t(e),
  5806. o = {}
  5807. s.exports = {
  5808. loadFeatureFlags: function (e) {
  5809. var t = $.Deferred()
  5810. return (
  5811. i
  5812. .get(e.urlBase + '', {
  5813. responseType: 'json',
  5814. prefetchFrom: 'user',
  5815. auth: n.getAuthorizationHeader()
  5816. })
  5817. .done(function (e) {
  5818. ;(o = (function (e) {
  5819. var t = {}
  5820. if (e) {
  5821. var i = e.flags
  5822. if (i) for (var n in i) i.hasOwnProperty(n) && (t[i[n]] = !0)
  5823. return t
  5824. }
  5825. return r.debug('Feature flags -> parseFeatureFlags: rawData is null.'), null
  5826. })(e))
  5827. ? t.resolve(o)
  5828. : t.reject('loading-failed')
  5829. })
  5830. .fail(function () {
  5831. r.debug('Retrieval of feature flags failed.'), t.reject('loading-failed')
  5832. }),
  5833. t.promise()
  5834. )
  5835. },
  5836. getFlags: function () {
  5837. return o
  5838. },
  5839. updateDependentSettings: function (e, t) {
  5840. ;(e = e || o).labels && (t.labels.enabled = !0),
  5841. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5842. e.showcase_sdk && (t.sdkInit = !0),
  5843. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5844. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5845. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5846. e.hide_sc_sharing && (t.share.enabled = !1)
  5847. }
  5848. }
  5849. }).call(this, '/js/featureflags.js')
  5850. },
  5851. {
  5852. './util/ajax': 181,
  5853. './util/logger': 189,
  5854. './util/showcase': 193
  5855. }
  5856. ],
  5857. 60: [
  5858. function (e, t, i) {
  5859. 'use strict'
  5860. var n =
  5861. (e('../util/common'),
  5862. {
  5863. status: 0,
  5864. set: function (e) {
  5865. if (isNaN(e)) return !1
  5866. var t = $('.progressbar')
  5867. e < 0 && (e = 0), 100 < e && (e = 100)
  5868. var i = e * (parseInt(t.css('width').replace('px', '')) / 100),
  5869. n = Math.round(e),
  5870. r = parseInt(i) - 15
  5871. t.find('.bar').css('width', i), t.find('.label').css('left', r), t.find('.perc').text(n + '%'), (this.status = e)
  5872. },
  5873. done: function (e) {
  5874. return e || this.status ? ((this.status = null), this.set(100)) : this
  5875. }
  5876. })
  5877. t.exports.circleLoader = n
  5878. },
  5879. {
  5880. '../util/common': 185
  5881. }
  5882. ],
  5883. 61: [
  5884. function (e, t, i) {
  5885. 'use strict'
  5886. t.exports = Object.freeze({
  5887. CLOSE: 'modal.closer.close'
  5888. })
  5889. },
  5890. {}
  5891. ],
  5892. 62: [
  5893. function (e, t, i) {
  5894. 'use strict'
  5895. function n(t, e) {
  5896. function i() {
  5897. var e = t.offsetHeight >= $('#player').height() && t.offsetWidth >= $('#player').width()
  5898. e !== p && ((p = e) ? (t.classList.add('closeByFooter'), c.classList.add('closeByFooter')) : (t.classList.remove('closeByFooter'), c.classList.remove('closeByFooter')))
  5899. }
  5900. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5901. }
  5902. var r = e('../../settings'),
  5903. o = (e('../../tag/Media/MediaEvent'), e('../../util/browser')),
  5904. a = e('../../util/common'),
  5905. s = e('./ModalCloserEvent'),
  5906. l = e('events').EventEmitter,
  5907. c = document.getElementsByClassName('footer')[0],
  5908. h = c.querySelectorAll('.close')[0],
  5909. u = null,
  5910. d = null,
  5911. p = null,
  5912. f =
  5913. (o.isMobile(),
  5914. {
  5915. open: function (e) {
  5916. e &&
  5917. (n(e),
  5918. u && h.removeEventListener('click', u, !0),
  5919. (u = function (e, t) {
  5920. t && (t.stopPropagation(), t.preventDefault()), e && this.emit(s.CLOSE, e), f.reset()
  5921. }.bind(this, e.id)),
  5922. h.addEventListener('click', u, !0),
  5923. d && window.removeEventListener('resize', d, !0),
  5924. (d = n.bind(this, e)),
  5925. window.addEventListener('resize', d, !0))
  5926. },
  5927. reset: function () {
  5928. c.classList.remove('closeByFooter'), h.removeEventListener('click', u, !0), window.removeEventListener('resize', d, !0), (u = d = p = null)
  5929. }
  5930. })
  5931. a.extendObject(f, l.prototype), (t.exports = f)
  5932. },
  5933. {
  5934. '../../tag/Media/MediaEvent': 131,
  5935. '../../settings': 166,
  5936. '../../util/browser': 182,
  5937. '../../util/common': 185,
  5938. './ModalCloserEvent': 61,
  5939. events: 202
  5940. }
  5941. ],
  5942. 63: [
  5943. function (e, t, i) {
  5944. 'use strict'
  5945. var A = e('../lib/dat.gui'),
  5946. C = e('three'),
  5947. I = e('../util/easing'),
  5948. E = e('../enum/Viewmode'),
  5949. _ = e('../enum/Colors'),
  5950. b = e('../enum/WarpStyle'),
  5951. w = e('../settings')
  5952. e('../tag/tag'),
  5953. (A.GUI.prototype.removeFolder = function (e) {
  5954. var t = this.__folders[e]
  5955. t && (t.close(), this.__ul.removeChild(t.domElement.parentNode), delete this.__folders[e], this.onResize())
  5956. }),
  5957. (t.exports.toggle = function (t, e, i) {
  5958. var n = new A.GUI({
  5959. width: 400
  5960. }),
  5961. r = n.addFolder('Flydown from Dollhouse')
  5962. r.add(w.flydown, 'movementEasing', Object.keys(I)),
  5963. r.add(w.flydown, 'movementDelay', 0, 1).step(0.01),
  5964. r.add(w.flydown, 'rotationEasing', Object.keys(I)),
  5965. r.add(w.flydown, 'rotationDelay', 0, 1).step(0.01),
  5966. r.add(w.flydown, 'modelTextureDelay', 0, 1).step(0.01),
  5967. r.add(w.flydown, 'skyboxDelay', 0, 1).step(0.01),
  5968. r.add(w.dollhouseDefault, 'minPolarAngle', 0, C.Math.degToRad(50)),
  5969. r.add(w.dollhouseDefault, 'maxPolarAngle', C.Math.degToRad(50), C.Math.degToRad(170))
  5970. var o = n.addFolder('Transition between panos')
  5971. o.add(w.transition, 'blur', 0, 10).onFinishChange(function () {}),
  5972. o
  5973. .add(w.transition, 'flySpeed', 0, 10)
  5974. .step(0.01)
  5975. .onFinishChange(function () {
  5976. ;(w.transition.flyTime = 0),
  5977. o.__controllers.forEach(function (e) {
  5978. e.updateDisplay()
  5979. })
  5980. }),
  5981. o.add(w.transition, 'flyTime', 0, 5e3).onFinishChange(function () {
  5982. ;(w.transition.flySpeed = 0),
  5983. o.__controllers.forEach(function (e) {
  5984. e.updateDisplay()
  5985. })
  5986. }),
  5987. o.add(w.transition, 'aimTime', 500, 2500).step(50),
  5988. o.add(w.transition, 'aimSlowFactor', 1, 3).step(0.1),
  5989. o.add(w.transition, 'movementEasing', Object.keys(I))
  5990. var a = n.addFolder('Path Display')
  5991. a
  5992. .add(w.path, 'opacity', 0, 1)
  5993. .step(0.01)
  5994. .onFinishChange(function () {}),
  5995. a
  5996. .add(w.path, 'height', 0, 0.2)
  5997. .step(0.01)
  5998. .onFinishChange(function () {}),
  5999. a
  6000. .add(w.path, 'outsideHeight', 0, 2)
  6001. .step(0.01)
  6002. .onFinishChange(function () {}),
  6003. a
  6004. .add(w.path, 'ribbonWidth', 0.01, 0.35)
  6005. .step(0.01)
  6006. .onFinishChange(function () {}),
  6007. a
  6008. .add(w.path, 'waypointRadius', 0.01, 1.2)
  6009. .step(0.01)
  6010. .onFinishChange(function () {}),
  6011. a
  6012. .add(w.path, 'waypointPulse', 0, 3600)
  6013. .step(20)
  6014. .onFinishChange(function () {}),
  6015. a
  6016. .add(w.path, 'waypointIndoorRadius', 0.01, 1.2)
  6017. .step(0.01)
  6018. .onFinishChange(function () {}),
  6019. a
  6020. .add(w.path, 'fadeInTime', 0, 1200)
  6021. .step(10)
  6022. .onFinishChange(function () {}),
  6023. a
  6024. .add(w.path, 'fadeOutTime', 0, 1200)
  6025. .step(10)
  6026. .onFinishChange(function () {}),
  6027. a.add(w.path, 'color', Object.keys(_)).onFinishChange(function () {
  6028. ;(w.path.color = _[w.path.color]), (w.path.colorUp = _._desat(w.path.color)), (w.path.colorDown = _.darken(w.path.color))
  6029. }),
  6030. a.add(w, 'reticuleColor', Object.keys(_)).onFinishChange(function () {
  6031. w.reticuleColor = _[w.reticuleColor]
  6032. })
  6033. var s = n.addFolder('Warping'),
  6034. l = s.addFolder('Warp/Teleport')
  6035. l.add(w.warp, 'softPushDist', 0, 2).onFinishChange(function () {}),
  6036. l
  6037. .add(w.warp, 'softPushEnd', 0, 1)
  6038. .step(0.01)
  6039. .onFinishChange(function () {}),
  6040. l.add(w.warp, 'softBendAngle', 0, 45).onFinishChange(function () {}),
  6041. l.add(w.warp, 'softBendTilt', 0, 45).onFinishChange(function () {}),
  6042. l
  6043. .add(w.warp, 'softBendEnd', 0, 1)
  6044. .step(0.01)
  6045. .onFinishChange(function () {}),
  6046. l.add(w.warp, 'burnsAngle', 0, 30).onFinishChange(function () {}),
  6047. l.add(w.warp, 'minBurnsAngle', 0, 10).onFinishChange(function () {}),
  6048. l.add(w.warp, 'brakeStrength', 1, 8).onFinishChange(function () {}),
  6049. l
  6050. .add(w.warp, 'minBrakeAngle', 0, 5)
  6051. .step(0.01)
  6052. .onFinishChange(function () {}),
  6053. l
  6054. .add(w.warp, 'maxBrakeAngle', 0, 5)
  6055. .step(0.01)
  6056. .onFinishChange(function () {}),
  6057. l.add(w.path, 'mapGuides').onFinishChange(function () {}),
  6058. l
  6059. .add(w.warp, 'teleportTime', 0, 5e3)
  6060. .step(10)
  6061. .onFinishChange(function () {}),
  6062. l
  6063. .add(w.warp, 'outsideTime', 0, 5e3)
  6064. .step(10)
  6065. .onFinishChange(function () {}),
  6066. l.add(w.path, 'typ', Object.keys(b)).onFinishChange(function () {
  6067. w.path.typ = b[w.path.typ]
  6068. }),
  6069. l
  6070. .add(w.warp, 'loop')
  6071. .onChange(function () {})
  6072. .onFinishChange(function () {
  6073. e.endlessLoop = w.warp.loop
  6074. }),
  6075. l
  6076. .add(w.warp, 'walkSlideShowThreshhold', 1, 1e4)
  6077. .step(1)
  6078. .onFinishChange(function () {}),
  6079. l
  6080. .add(w.warp, 'walkExtraPanosDistance', 0, 3)
  6081. .step(0.1)
  6082. .onFinishChange(function () {}),
  6083. l
  6084. .add(w.transition, 'fastForwardFactor', 1, 10)
  6085. .step(1)
  6086. .onFinishChange(function () {})
  6087. var c = s.addFolder('Long Warp Only')
  6088. c
  6089. .add(w.warp, 'minWarpTime', 0, 5e3)
  6090. .step(10)
  6091. .onFinishChange(function () {
  6092. ;(w.warp.flySpeed = 0),
  6093. c.__controllers.forEach(function (e) {
  6094. e.updateDisplay()
  6095. })
  6096. }),
  6097. c
  6098. .add(w.warp, 'timePerMeter', 0, 5e3)
  6099. .step(10)
  6100. .onFinishChange(function () {}),
  6101. c
  6102. .add(w.warp, 'lookAheadMax', 0.01, 1)
  6103. .step(0.01)
  6104. .onFinishChange(function () {}),
  6105. c
  6106. .add(w.warp, 'lookAheadDist', 0.01, 4)
  6107. .step(0.01)
  6108. .onFinishChange(function () {}),
  6109. c
  6110. .add(w.warp, 'maxTurnPerSec', 0, 720)
  6111. .step(1)
  6112. .onFinishChange(function () {}),
  6113. c
  6114. .add(w.warp, 'maxAimPerSec', 0, 720)
  6115. .step(1)
  6116. .onFinishChange(function () {}),
  6117. c
  6118. .add(w.warp, 'turnFriction', 0, 1)
  6119. .step(0.01)
  6120. .onFinishChange(function () {}),
  6121. c
  6122. .add(w.warp, 'walkDelay', 0, 2e3)
  6123. .step(10)
  6124. .onFinishChange(function () {}),
  6125. c
  6126. .add(w.transition, 'flytimeMaxDistanceThreshold', 0, 25)
  6127. .step(10)
  6128. .onFinishChange(function () {}),
  6129. c
  6130. .add(w.warp, 'walkMaxDist', 0, 100)
  6131. .step(1)
  6132. .onFinishChange(function () {})
  6133. var h = n.addFolder('Warp Esoterica')
  6134. h
  6135. .add(w.warp, 'nearPanoDist', 0.01, 12)
  6136. .step(0)
  6137. .onFinishChange(function () {}),
  6138. h.add(w.warp, 'blur', 0.01, 1).onFinishChange(function () {}),
  6139. h
  6140. .add(w.warp, 'flySpeed', 0, 10)
  6141. .step(0.01)
  6142. .onFinishChange(function () {
  6143. ;(w.warp.minWarpTime = 0),
  6144. h.__controllers.forEach(function (e) {
  6145. e.updateDisplay()
  6146. })
  6147. }),
  6148. h.add(w.warp, 'showBunny').onFinishChange(function () {}),
  6149. h
  6150. .add(w.warp, 'fastTime', 0, 2500)
  6151. .step(10)
  6152. .onFinishChange(function () {}),
  6153. h.add(w.warp, 'movementEasing', Object.keys(I))
  6154. var u = n.addFolder('Misc')
  6155. u.add(w, 'dollhouseFOV', 10, 180).onChange(function () {
  6156. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  6157. }),
  6158. u.add(w, 'insideFOV', 10, 180).onChange(function () {
  6159. i.cameras[E.PANORAMA].fov = w.insideFOV
  6160. }),
  6161. u
  6162. .add(w, 'insideLookSpeed', 0.01, 0.3)
  6163. .step(0.01)
  6164. .onChange(function () {}),
  6165. u
  6166. .add(w, 'rotationAccelerationInside', 0.1, 10)
  6167. .step(0.1)
  6168. .onChange(function () {}),
  6169. u
  6170. .add(w, 'rotationAccelerationOutside', 0.1, 10)
  6171. .step(0.1)
  6172. .onChange(function () {})
  6173. var d = n.addFolder('Navigation')
  6174. d.add(w.navigation, 'panoScores').onFinishChange(function () {
  6175. w.navigation.panoScores ||
  6176. t.panos.forEach(function (e) {
  6177. e.floor.remove(e.text3d), (e.text3d = null)
  6178. })
  6179. }),
  6180. d.add(w.navigation, 'mouseDirection'),
  6181. d.add(w.navigation, 'filterStrictness', 0, 1),
  6182. d.add(w.navigation, 'angleFactor', -60, 0),
  6183. d.add(w.navigation, 'directionFactor', 1, 20),
  6184. d.add(w.navigation, 'distanceFactor', -5, 5),
  6185. d.add(w.navigation, 'optionalityFactor', 0.1, 10)
  6186. var p = n.addFolder('tags'),
  6187. f = p.addFolder('Tag Creation')
  6188. f.add(w.tags.pole, 'enabled').name('poleEnabled'),
  6189. f.add(w.tags.pole, 'height', 0, 2.5).step(0.01).name('poleHeight'),
  6190. f.add(w.tags.pole, 'width', 1, 10).step(1).name('poleWidth'),
  6191. f.add(w.tags.pole, 'opacity', 0.1, 1).step(0.1).name('poleOpacity')
  6192. var g = p.addFolder('Visibility')
  6193. g.add(w.tags.visibility, 'anyDistance'),
  6194. g.add(w.tags.visibility, 'visibleDistance', 0.1, 30).step(0.1),
  6195. g.add(w.tags.visibility, 'cameraClearance', 0, 1).step(0.01),
  6196. g.add(w.tags.visibility, 'hideViaFloor'),
  6197. g.add(w.tags.visibility, 'hideOffScreenDisc').name('hideEdgeDisc'),
  6198. g.add(w.tags.visibility, 'hideOffScreenObject').name('hideEdgeObject')
  6199. var m = p.addFolder('Disc Parameters')
  6200. m.add(w.tags.disc.scale, 'nearBound', 0.1, 10).step(0.1),
  6201. m.add(w.tags.disc.scale, 'farBound', 0.1, 20).step(0.1).listen(),
  6202. m.add(w.tags.disc.scale, 'linkFarBound').onChange(function (e) {
  6203. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  6204. }),
  6205. m
  6206. .add(w.tags.disc.scale, 'linkPercent', 0, 100)
  6207. .step(1)
  6208. .onChange(function (e) {
  6209. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  6210. }),
  6211. m.add(w.tags.disc.scale, 'maxSize', 40, 200).step(1),
  6212. m.add(w.tags.disc.scale, 'minSize', 20, 100).step(1),
  6213. m.add(w.tags.disc.scale, 'responsiveness', 0, 100).step(1)
  6214. var v = p.addFolder('Navigate')
  6215. v.add(w.tags.navigate, 'nearestPano').name('nearestPano'),
  6216. v.add(w.tags.navigate, 'lineOfSight').name('lineOfSight'),
  6217. v.add(w.tags.navigate, 'reactivate').name('reactivate'),
  6218. v.add(w.tags.navigate, 'aimAt', ['disc', 'object', 'pole', 'nothing']).name('aim at'),
  6219. v.add(w.tags.navigate, 'tiltTolerance', 0, 50).step(1),
  6220. v.add(w.tags.navigate, 'rotateSpeedFactor', 0, 5).step(0.1)
  6221. var y = n.addFolder('Debug')
  6222. y.add(w, 'wireframe').onFinishChange(function () {
  6223. t.chunks.forEach(function (e) {
  6224. e.material &&
  6225. (e.wireframeTwin ||
  6226. ((e.wireframeTwin = new C.WireframeHelper(e)),
  6227. (e.wireframeTwin.material.depthWrite = !1),
  6228. (e.wireframeTwin.material.depthTest = !1),
  6229. (e.wireframeTwin.material.opacity = 0.5),
  6230. (e.wireframeTwin.material.transparent = !0)),
  6231. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  6232. })
  6233. }),
  6234. y.add(w, 'skyboxWireframe').onFinishChange(function () {
  6235. w.skyboxWireframe ? ((t.skybox.wireframe = new C.WireframeHelper(t.skybox)), t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe), (t.skybox.wireframe = null))
  6236. }),
  6237. y.add(w, 'showSweeps').onFinishChange(function () {
  6238. t.setSweepVisibility(w.showSweeps)
  6239. }),
  6240. y.add(w, 'showMesh').onFinishChange(function () {
  6241. t.chunks.forEach(function (e) {
  6242. e.visible = w.showMesh
  6243. })
  6244. }),
  6245. y.add(w, 'showFloors').onFinishChange(function () {
  6246. t.floors.forEach(function (e) {
  6247. e.collider.children.forEach(function (e) {
  6248. e.material.visible = w.showFloors
  6249. })
  6250. })
  6251. }),
  6252. y.add(w, 'showSkyboxes').onFinishChange(function () {
  6253. t.panos.forEach(function (e) {
  6254. e.skyboxMesh.visible = w.showSkyboxes
  6255. })
  6256. }),
  6257. y.add(w, 'showNeighbors').onChange(function () {}),
  6258. y.add(t, 'alpha', 0, 1)
  6259. })
  6260. },
  6261. {
  6262. '../enum/Colors': 19,
  6263. '../enum/Viewmode': 51,
  6264. '../enum/WarpStyle': 52,
  6265. '../lib/dat.gui': 93,
  6266. '../tag/tag': 123,
  6267. '../settings': 166,
  6268. '../util/easing': 186,
  6269. three: 217
  6270. }
  6271. ],
  6272. 64: [
  6273. function (c, h, e) {
  6274. ;(function (e) {
  6275. 'use strict'
  6276. function i(e, t, i, n) {
  6277. $('.gui-error .error-problem-text').text(e),
  6278. $('.gui-error .error-solution-text').text(t),
  6279. $('.gui-error .error-explanation').text(i),
  6280. $('.gui-error .error-actions').html(n),
  6281. $(window).resize(),
  6282. $('.gui-error').fadeIn(),
  6283. $('#bottom-logo').fadeIn()
  6284. }
  6285. function n(e) {
  6286. var t = [
  6287. '<div class="browser-tiles">',
  6288. '<div class="tile">',
  6289. '<a href="https://www.google.com/chrome/browser/" target="_blank">',
  6290. '<img class="icon" src="images/icon_Google_Chrome_2011.png" ',
  6291. 'rel="tiletip" title="Chrome"></a>',
  6292. '</div>',
  6293. '<div class="tile">',
  6294. '<a href="https://www.mozilla.org/en-US/firefox/new/" target="_blank">',
  6295. '<img class="icon" src="images/icon_Mozilla_Firefox.png" ',
  6296. 'rel="tiletip" title="Firefox"></a>',
  6297. '</div>',
  6298. '<div class="tile">',
  6299. '<a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie" target="_blank">',
  6300. '<img class="icon" src="images/icon_Internet_Explorer_10.png" ',
  6301. 'rel="tiletip" title="Internet Explorer"></a>',
  6302. '</div>',
  6303. '<div class="tile">',
  6304. '<a href="https://support.apple.com/en-us/HT204416" target="_blank">',
  6305. '<img class="icon" src="images/icon_MacOSX_Safari.png" ',
  6306. 'rel="tiletip" title="Safari"></a>',
  6307. '</div>',
  6308. '</div>'
  6309. ].join('')
  6310. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  6311. r.isMobile() ||
  6312. $('[rel=tiletip]').tooltip({
  6313. placement: 'bottom',
  6314. delay: {
  6315. show: 50,
  6316. hide: 0
  6317. },
  6318. trigger: 'hover',
  6319. viewport: {
  6320. selector: 'body',
  6321. padding: 10
  6322. }
  6323. })
  6324. }
  6325. function t() {
  6326. var e = r.isMobile() ? '' : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + '</span>' + s.ERROR_GENERIC_ACTIONS_3,
  6327. t = [s.ERROR_GENERIC_ACTIONS_1, e].join('')
  6328. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, '', t),
  6329. r.isMobile() ||
  6330. $('.install-browser').on('click touchstart', function (e) {
  6331. e.preventDefault(), e.stopPropagation(), n(' ')
  6332. })
  6333. }
  6334. var r = c('./../util/browser'),
  6335. o = c('./../analytics'),
  6336. a = c('./../settings'),
  6337. s = c('../localization/localize'),
  6338. l = new (c('./../util/logger'))(e)
  6339. h.exports.error = function (e) {
  6340. if (
  6341. ($('head title').text(a.pageTitle),
  6342. $('#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo').hide(),
  6343. $('#gui-loading').fadeOut(250),
  6344. $('#quick-blackout').hide(),
  6345. o.track('showcase_error', {
  6346. error_key: e
  6347. }),
  6348. s.locale || s.init(),
  6349. 'webgl-unsupported' === e)
  6350. )
  6351. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM)
  6352. 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>.')
  6353. else if ('webgl-safari' === e)
  6354. i(
  6355. s.ERROR_WEBGL_SAFARI_PROBLEM,
  6356. '',
  6357. '',
  6358. s.ERROR_WEBGL_SAFARI_ACTIONS_1 +
  6359. '<strong>' +
  6360. s.ERROR_WEBGL_SAFARI_ACTIONS_2 +
  6361. '</strong>. ' +
  6362. s.ERROR_WEBGL_SAFARI_ACTIONS_3 +
  6363. '<strong>' +
  6364. s.ERROR_WEBGL_SAFARI_ACTIONS_4 +
  6365. '</strong>.'
  6366. )
  6367. else if ('webgl-generic' === e) t()
  6368. else if ('missing-urls' === e) i(s.ERROR_MISSING_URLS_PROBLEM, '', s.ERROR_MISSING_URLS_EXPLANATION)
  6369. else if ('loading-failed' === e)
  6370. i(
  6371. s.ERROR_LOADING_FAILED_PROBLEM,
  6372. '',
  6373. '',
  6374. 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>.'
  6375. )
  6376. else {
  6377. if ('loading-failed-maintenance' !== e) return void l.error('Unhandled error: ' + e)
  6378. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  6379. }
  6380. }
  6381. }).call(this, '/js/gui/error.js')
  6382. },
  6383. {
  6384. '../localization/localize': 108,
  6385. './../analytics': 4,
  6386. './../settings': 166,
  6387. './../util/browser': 182,
  6388. './../util/logger': 189
  6389. }
  6390. ],
  6391. 65: [
  6392. function (Oe, Le, e) {
  6393. ;(function (e) {
  6394. 'use strict'
  6395. function c() {
  6396. for (var e in Ce)
  6397. if (Ce.hasOwnProperty(e)) {
  6398. var t = Ce[e]
  6399. if (!t.visible) for (var i = 0; i < t.elements.length; i++) $(t.elements[i]).hide()
  6400. }
  6401. Ce.highlight.visible && $('.pinBottom').addClass('highlightExists'),
  6402. !1 === Ce.tourControls.visible && $('#drawer').addClass('fullWidth'),
  6403. (ge = []),
  6404. Ce.floors.visible && ge.push('.gui-floor', '.gui-floor-title'),
  6405. ge.push('.hideTarget', '.pinTop.right')
  6406. }
  6407. function v(e, t) {
  6408. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying
  6409. $('#gui-zoomin').toggle(i), $('#gui-zoomout').toggle(i)
  6410. }
  6411. function l() {
  6412. n(),
  6413. $('.pinBottom').toggleClass('open'),
  6414. $('#drawer').toggleClass('open'),
  6415. $('.footer').toggleClass('open'),
  6416. $('#drawer').hasClass('open')
  6417. ? ($('#pullTab .icon').attr('data-original-title', se.CLOSE_HIGHLIGHTS), _e('highlights'))
  6418. : ($('#pullTab .icon').attr('data-original-title', se.OPEN_HIGHLIGHTS), O.resetDrawer()),
  6419. setTimeout(
  6420. function () {
  6421. $('#pullTab').toggleClass('opened')
  6422. },
  6423. $('#drawer').hasClass('open') ? 0 : M.highlightAnimationDuration
  6424. ),
  6425. $('.pinBottom').hasClass('open') && t($('.vr-popup')) && $('.vr-popup').is(':visible') && X.dismiss()
  6426. }
  6427. function t(e) {
  6428. var t
  6429. return (
  6430. 'none' !== e.css('display')
  6431. ? (t = e.position().top + e.outerHeight())
  6432. : (e.attr('style', 'visibility: hidden'), (t = e.position().top + e.outerHeight()), e.attr('style', 'display: none')),
  6433. $('#player').outerHeight() - 130 < t + 25
  6434. )
  6435. }
  6436. function y(e) {
  6437. 'touchstart' === e.type && e.preventDefault(), e.stopPropagation()
  6438. }
  6439. function n() {
  6440. w && (w.reload(), w.init())
  6441. }
  6442. function r() {
  6443. $('#gui-spinner').stop(!0, !0), $('#gui-spinner').fadeOut(1e3), !(Ae = !0)
  6444. }
  6445. function A(e, t) {
  6446. var i = e.mode,
  6447. n = t || e.currentPano
  6448. $('#gui-modes-dollhouse').toggleClass('active', i === ie.DOLLHOUSE),
  6449. $('#gui-modes-floorplan').toggleClass('active', i === ie.FLOORPLAN),
  6450. $('#gui-modes-inside').toggleClass('active', i === ie.PANORAMA),
  6451. i === ie.PANORAMA
  6452. ? ($('#view-controllers').slideUp(500),
  6453. M.show360Views.enabled && !n.isAligned()
  6454. ? ($('.gui-floor').addClass('hidden'), $('#gui-modes-outside').addClass('desktop-only'))
  6455. : ($('.gui-floor').removeClass('hidden'), $('#gui-modes-outside').removeClass('desktop-only')),
  6456. $('#gui-modes-outside').removeClass('hidden'))
  6457. : i !== ie.TRANSITIONING &&
  6458. (r(),
  6459. (pe = i),
  6460. $('#gui-modes-outside').addClass('hidden'),
  6461. e.model.has360Views && $('.gui-floor').removeClass('hidden'),
  6462. $('#view-controllers').is(':visible') || $('#view-controllers').slideDown(M.guiAnimationSpeed))
  6463. }
  6464. function C(t, i) {
  6465. function e() {
  6466. document.getElementById('vr').classList.remove('hidden'),
  6467. M.vr.allowWebVR
  6468. ? S.getVRDisplay().then(
  6469. function (e) {
  6470. S.supportsFullscreen()
  6471. ? (function (e) {
  6472. ue.info(e.displayName + ' detected, VR button activates WebVR experience'),
  6473. Q.init(t.data, i, e, x),
  6474. Q.on(J.OPENED, _e.bind(gui, 'vr')),
  6475. Q.on(J.SHOW_TERMS, W.show.bind(W))
  6476. })(e)
  6477. : (ue.warn('Unable to use WebVR when full screen is not supported'), $('.improper-embed').toggleClass('hidden', !1), n())
  6478. },
  6479. function (e) {
  6480. n()
  6481. }
  6482. )
  6483. : n()
  6484. }
  6485. function n() {
  6486. var e
  6487. ue.info('WebVR support not found, VR button activates native app VR modal'),
  6488. X.init(t.data, x),
  6489. X.on(
  6490. Z.OPENED,
  6491. ((e = document.getElementById('vr-modal')),
  6492. function () {
  6493. _e('vr'), V.open(e)
  6494. })
  6495. ),
  6496. X.on(Z.CLOSED, V.reset)
  6497. }
  6498. if (M.vr.enabled && t.supportsVR && !S.valueFromHash('mls', 0))
  6499. switch (M.vr.option) {
  6500. case le.CONTEXTUAL:
  6501. e()
  6502. break
  6503. case le.ANDROID:
  6504. S.detectAndroid() && e()
  6505. break
  6506. case le.NONE:
  6507. }
  6508. }
  6509. function h(e, i) {
  6510. for (var n = $('.gui-floor'), t = 0; t < e.floors.length; t++)
  6511. if ('372' !== getQueryVariable('m')) {
  6512. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name)
  6513. $('.gui-floor').find('.container').prepend(r)
  6514. }
  6515. n.find('.container').prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + '</div>'),
  6516. n.on('click', function (e) {
  6517. y(e), _e('floor'), n.toggleClass('open')
  6518. }),
  6519. $('.floorChoice').on('click', function (e) {
  6520. y(e)
  6521. var t = $(this).data('index')
  6522. 'all' !== t
  6523. ? (R.updateInteraction(oe.InteractionGui, 'floor-control'),
  6524. i.player.gotoFloor(t),
  6525. R.track('showcase_gui', {
  6526. gui_action: 'click_floor_select_button',
  6527. interaction_source: 'gui'
  6528. }))
  6529. : (R.updateInteraction(oe.InteractionGui, 'floor-control'),
  6530. _e('move'),
  6531. i.allFloors(),
  6532. R.track('showcase_gui', {
  6533. gui_action: 'click_toggle_all_floors_button',
  6534. interaction_source: 'gui'
  6535. })),
  6536. n.removeClass('open')
  6537. })
  6538. }
  6539. function I(e, t) {
  6540. e &&
  6541. (t === ie.DOLLHOUSE || t === ie.FLOORPLAN
  6542. ? ($('.allFloorBtn').show(), $('.gui-floor-icon').hide(), $('.gui-floor-title').show())
  6543. : ($('.allFloorBtn').hide(), $('.gui-floor-icon').show(), $('.gui-floor-title').hide()),
  6544. e.model.allFloorsVisible
  6545. ? ($('.gui-floor-title').text(se.FLOOR_ALL),
  6546. $('.gui-floor-number').text(se.FLOOR_ALL),
  6547. $('.floorChoice').removeClass('active'),
  6548. $('.floorChoice[data-index="all"]').addClass('active'))
  6549. : ($('.gui-floor-title').text(e.name),
  6550. $('.gui-floor-number').text(' ' + (e.floorIndex + 1)),
  6551. $('.floorChoice').removeClass('active'),
  6552. $('.floorChoice[data-index=' + e.floorIndex + ']').addClass('active')))
  6553. }
  6554. function E() {
  6555. var e = $('#player').width() - 20,
  6556. t = $('#scroller'),
  6557. i = $('#drawer'),
  6558. n = $('.pinBottom')
  6559. $('#player').width() < 488 || $('#player').height() < 488
  6560. ? (t.addClass('hidden'), i.addClass('noScroll'), n.addClass('noScroll'))
  6561. : e < T != !i.hasClass('noScroll') && (t.toggleClass('hidden'), i.toggleClass('noScroll'), n.toggleClass('noScroll'))
  6562. }
  6563. function _(e) {
  6564. e.waitQueue.length <= 0
  6565. ? r()
  6566. : ye ||
  6567. (function (e) {
  6568. ;(e = e || 0),
  6569. (Ae = !1),
  6570. window.setTimeout(
  6571. function () {
  6572. Ae || (!0, $('#gui-spinner').stop(!0, !0).show())
  6573. }.bind(this),
  6574. e
  6575. )
  6576. })(M.modelComponentLoadSpinnerDelay)
  6577. }
  6578. function b(e, t) {
  6579. for (var i = []; e; ) i.push(e), (e = e.parentNode)
  6580. for (; t && -1 === i.indexOf(t); ) t = t.parentNode
  6581. return t
  6582. }
  6583. var w,
  6584. T,
  6585. o,
  6586. a,
  6587. x,
  6588. i,
  6589. s,
  6590. u,
  6591. d,
  6592. p,
  6593. f,
  6594. g,
  6595. S = (Oe('three'), Oe('../util/ajax'), Oe('../util/browser')),
  6596. M = Oe('../settings'),
  6597. R = Oe('../analytics'),
  6598. m = (Oe('../util/transitions'), Oe('../util/camera'), Oe('../util/logger')),
  6599. P = (Oe('../objects/Snapshot'), Oe('./helpManager')),
  6600. O = Oe('./immersiveMode'),
  6601. L = Oe('./loadingScreen'),
  6602. D = Oe('./landingScreen'),
  6603. N = Oe('./playButton'),
  6604. F = Oe('./populateModal'),
  6605. B = Oe('./memoryUsage'),
  6606. V = Oe('./closer/modalCloser'),
  6607. k = Oe('./closer/ModalCloserEvent'),
  6608. U = Oe('./help/help'),
  6609. H = Oe('./help/HelpEvent'),
  6610. z = Oe('./title/titleBar'),
  6611. G = Oe('./title/TitleEvents'),
  6612. W = Oe('./terms/terms'),
  6613. j = Oe('./terms/TermsEvent'),
  6614. Y = Oe('./title/tagToggle'),
  6615. q = Oe('./tourInteraction'),
  6616. X = Oe('./vr/vrModal'),
  6617. Z = Oe('./vr/vrEvent'),
  6618. K = Oe('./sharing/modal'),
  6619. Q = Oe('./webvr/webVRgui'),
  6620. J = Oe('./webvr/WebVrEvent'),
  6621. ee = Oe('../controls/serializer'),
  6622. te = Oe('../enum/Keys'),
  6623. ie = Oe('../enum/Viewmode'),
  6624. ne = (Oe('../enum/BlackoutStyle'), Oe('../tag/Media/MediaEvent')),
  6625. re = (Oe('../enum/PathDiscardMode'), Oe('../enum/PathDisplayMode'), Oe('../enum/DirectorEvents'), Oe('../enum/PlayerEvents')),
  6626. oe = Oe('../enum/ControlEvents'),
  6627. ae = Oe('./sharing/ShareEvents'),
  6628. se = Oe('../localization/localize'),
  6629. le = (Oe('../enum/Vectors'), Oe('../enum/WarpStyle'), Oe('../enum/AlignmentType'), Oe('../enum/VROption')),
  6630. ce = Oe('./konami'),
  6631. he = Oe('../lib/dat.gui'),
  6632. ue = new m(e),
  6633. de = (Oe('../util/showcase'), Oe('../enum/ZoomEvents')),
  6634. pe = ie.DOLLHOUSE,
  6635. fe = 0,
  6636. ge = ['.hideTarget'],
  6637. me = null,
  6638. ve = null,
  6639. ye = !1,
  6640. Ae = !1,
  6641. Ce = {
  6642. coBrand: {
  6643. visible: !0,
  6644. elements: ['.co-brand', '#loaderCoBrand']
  6645. },
  6646. help: {
  6647. visible: !0,
  6648. elements: ['.nav-help', '#nav-help']
  6649. },
  6650. tourControls: {
  6651. visible: !0,
  6652. elements: ['.next', '.previous', '#play']
  6653. },
  6654. highlight: {
  6655. visible: !0,
  6656. elements: ['#drawer', '#pullTab']
  6657. },
  6658. share: {
  6659. visible: !0,
  6660. elements: ['.socialButton', '#share']
  6661. },
  6662. fullScreen: {
  6663. visible: !0,
  6664. elements: ['#gui-fullscreen']
  6665. },
  6666. floors: {
  6667. visible: !0,
  6668. elements: ['.gui-floor']
  6669. }
  6670. },
  6671. Ie =
  6672. ((g = document.getElementById('drawer')),
  6673. function () {
  6674. $('#player').height() < 400 && g.classList.contains('open') && l()
  6675. }),
  6676. Ee =
  6677. ((f = document.getElementById('meta-info')),
  6678. function () {
  6679. $('#player').height() < 400 && f.classList.contains('expand') && z.toggleMeta(!0)
  6680. }),
  6681. _e =
  6682. ((i = document.getElementById('meta-info')),
  6683. (s = document.getElementById('interaction-modal')),
  6684. (u = $('#drawer').eq(0)),
  6685. (d = $('.gui-floor').eq(0)),
  6686. (p = $('.vr-popup').eq(0)),
  6687. function (e) {
  6688. switch (e) {
  6689. case 'info':
  6690. we(), Te(), Ie(), Me(), Re(), xe(), Pe()
  6691. break
  6692. case 'terms':
  6693. be(), Te(), Se(), Me(), Re(), xe(), Pe()
  6694. break
  6695. case 'help':
  6696. be(), we(), Me(), Re(), xe(), Pe()
  6697. break
  6698. case 'vr':
  6699. be(), we(), Me(), Re(), Te(), Pe(), t(p) && Se()
  6700. break
  6701. case 'highlights':
  6702. Ee(), we(), Me(), Re()
  6703. break
  6704. case 'share':
  6705. be(), we(), Te(), Re(), xe(), Pe()
  6706. break
  6707. case 'floor':
  6708. we(), Me(), xe()
  6709. break
  6710. case 'view':
  6711. Re(), Me(), we(), xe()
  6712. break
  6713. case 'tour':
  6714. case 'move':
  6715. we(), Me(), Re(), xe()
  6716. break
  6717. case 'resize':
  6718. be(), Ie(), Re()
  6719. break
  6720. case 'tag':
  6721. we(), Te(), Me(), Re(), xe()
  6722. }
  6723. })
  6724. function be() {
  6725. i.classList.contains('expand') && z.toggleMeta(!0)
  6726. }
  6727. function we() {
  6728. W.hide()
  6729. }
  6730. function Te() {
  6731. U.close()
  6732. }
  6733. function xe() {
  6734. X.dismiss()
  6735. }
  6736. function Se() {
  6737. u.hasClass('open') && l()
  6738. }
  6739. function Me() {
  6740. K.hide()
  6741. }
  6742. function Re() {
  6743. d.hasClass('open') && d.removeClass('open')
  6744. }
  6745. function Pe() {
  6746. s.classList.contains('fadeIn') && (s.classList.contains('landing') ? D.dismissModal() : s.classList.contains('tour') && q.dismissModal())
  6747. }
  6748. $(document).on('fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange', function (e) {
  6749. $('#gui-fullscreen').toggle(!S.isFullscreen()),
  6750. $('#gui-fullscreen-exit').toggle(!!S.isFullscreen()),
  6751. setTimeout(function () {
  6752. $('.icon:visible').hide().show(0)
  6753. }, 100)
  6754. }),
  6755. $('#gui-fullscreen')
  6756. .find('a')
  6757. .on('click', function (e) {
  6758. y(e),
  6759. S.requestFullscreen($('body')[0]),
  6760. R.track('showcase_gui', {
  6761. gui_action: 'click_enter_fullscreen',
  6762. interaction_source: 'gui'
  6763. })
  6764. }),
  6765. $('#gui-fullscreen-exit')
  6766. .find('a')
  6767. .on('click', function (e) {
  6768. y(e),
  6769. S.exitFullscreen(),
  6770. R.track('showcase_gui', {
  6771. gui_action: 'click_exit_fullscreen',
  6772. interaction_source: 'gui'
  6773. })
  6774. }),
  6775. $(window)
  6776. .on('resize', function (e) {
  6777. var t = e.target.innerHeight,
  6778. i = e.target.innerWidth
  6779. ;(t === o && i === a) || (Ce.highlight.visible && E(), _e('resize'), $('.pinTop.right').removeClass('hideUnderMeta'), n(), (o = t), (a = i))
  6780. })
  6781. .resize(),
  6782. S.supportsFullscreen() || $('#gui-fullscreen').hide(),
  6783. $('#pullTab').on('click', function (e) {
  6784. y(e),
  6785. $('#drawer').hasClass('open')
  6786. ? (R.trackAlways('showcase_gui', {
  6787. gui_action: 'hide_highlight_reel'
  6788. }),
  6789. $(this).addClass('open').children('img').attr('src', 'images/auto.png'))
  6790. : (R.trackAlways('showcase_gui', {
  6791. gui_action: 'show_highlight_reel'
  6792. }),
  6793. $(this).removeClass('open').children('img').attr('src', 'images/auto-suspend.png')),
  6794. l()
  6795. }),
  6796. window.DATA.showHotListSta &&
  6797. ($('#hotList').css('display', ''),
  6798. $('#hotList').on('click', function (e) {
  6799. y(e)
  6800. var t = $('#hotListWrap')[0]
  6801. t.classList.contains('hotListActive') ? (t.classList.remove('hotListActive'), this.classList.remove('active')) : (t.classList.add('hotListActive'), this.classList.add('active'))
  6802. }),
  6803. $('#hotListContent ul').on('mouseover', function (e) {
  6804. y(e)
  6805. var t = e.target,
  6806. i = document.getElementById('hotListWrap')
  6807. if ('SPAN' === t.tagName) {
  6808. var n = t.parentElement.parentElement
  6809. t.offsetWidth + 116 >= n.clientWidth ? (i.style.width = t.offsetWidth + 116 + 'px') : (i.style.width = '')
  6810. } else if ('LI' === t.tagName) {
  6811. n = t.parentElement
  6812. t.children[0].offsetWidth + 116 >= n.clientWidth ? (i.style.width = t.children[0].offsetWidth + 116 + 'px') : (i.style.width = '')
  6813. } else i.style.width = ''
  6814. }),
  6815. $('#hotListContent ul').on('click', function (e) {
  6816. y(e),
  6817. this.preElem && this.preElem.classList.remove('active'),
  6818. 'SPAN' === e.target.tagName
  6819. ? (e.target.parentElement.classList.add('active'), e.target.parentElement.hot && e.target.parentElement.hot.examine(!0), (this.preElem = e.target.parentElement))
  6820. : (e.target.classList.add('active'), e.target.hot && e.target.hot.examine(!0), (this.preElem = e.target))
  6821. }),
  6822. $('#hotListClose').on('click', function (e) {
  6823. y(e), $('#hotListWrap')[0].classList.remove('hotListActive'), $('#hotListContent ul .active').removeClass('active'), $('#hotList')[0].classList.remove('active')
  6824. })),
  6825. 'true' === window.DATA.supportsVR && $('#vr').css('display', ''),
  6826. $('#more-menu-button').on('click', function (e) {
  6827. y(e), $('#more-menu').toggleClass('open')
  6828. }),
  6829. (Le.exports.init = function (s, l, c, e, t, i, n) {
  6830. var r
  6831. ;(x = n),
  6832. s.outsideAllowed() || $('#gui-modes-outside').addClass('invisible'),
  6833. s.supportedModes[ie.PANORAMA] || $('#gui-modes-inside').addClass('invisible'),
  6834. F.init(),
  6835. D.init(s, i),
  6836. ce.init(s, l, e),
  6837. $('.icon').on('mouseover', function () {
  6838. l.player && l.player.reticule.hide()
  6839. }),
  6840. (function (e, t) {
  6841. var i = t.player
  6842. $('#gui-modes-inside').on('mousedown touchstart', function (e) {
  6843. y(e),
  6844. R.updateInteraction(oe.InteractionGui, 'inside-button'),
  6845. R.track('USER', {
  6846. event_type: 'showcase_gui',
  6847. gui_action: 'click_inside_mode_button'
  6848. }),
  6849. t.changeMode(ie.PANORAMA)
  6850. }),
  6851. $('#gui-modes-outside')
  6852. .find('a')
  6853. .on('click', function (e) {
  6854. y(e),
  6855. R.track('showcase_gui', {
  6856. gui_action: 'click_outside_mode_button'
  6857. }),
  6858. t.changeMode(pe)
  6859. }),
  6860. $('#gui-modes-floorplan').on('click', function (e) {
  6861. y(e),
  6862. i.mode !== ie.FLOORPLAN &&
  6863. (R.track('showcase_gui', {
  6864. gui_action: 'click_floorplan_mode_button'
  6865. }),
  6866. t.changeMode(ie.FLOORPLAN))
  6867. }),
  6868. $('#gui-modes-dollhouse').on('click', function (e) {
  6869. y(e),
  6870. i.mode !== ie.DOLLHOUSE &&
  6871. (R.track('showcase_gui', {
  6872. gui_action: 'click_dollhouse_mode_button'
  6873. }),
  6874. t.changeMode(ie.DOLLHOUSE))
  6875. })
  6876. })(0, l),
  6877. (function (e, t) {
  6878. $('#play').on('mousedown touchstart', function (e) {
  6879. y(e),
  6880. _e('tour'),
  6881. q.play(),
  6882. R.trackAlways('showcase_gui', {
  6883. gui_action: 'play_highlights'
  6884. })
  6885. }),
  6886. (window.startAndPlay = function (e) {
  6887. _e('tour'),
  6888. q.play(),
  6889. R.trackAlways('showcase_gui', {
  6890. gui_action: 'play_highlights'
  6891. })
  6892. }),
  6893. $('#pause').on('mousedown touchstart', function (e) {
  6894. y(e),
  6895. q.pause(),
  6896. R.trackAlways('showcase_gui', {
  6897. gui_action: 'pause_highlights'
  6898. })
  6899. }),
  6900. $('#gui-zoomin')
  6901. .find('a')
  6902. .on('click', function (e) {
  6903. y(e), t.player.zoomInIncrementally()
  6904. }),
  6905. $('#gui-zoomout')
  6906. .find('a')
  6907. .on('click', function (e) {
  6908. y(e), t.player.zoomOutIncrementally()
  6909. })
  6910. })(0, l),
  6911. s.data.enable_social_sharing &&
  6912. s.data.is_public &&
  6913. M.share.enabled &&
  6914. (K.init(DATA.name /* s.data.name */),
  6915. K.on(
  6916. ae.OPENED,
  6917. ((r = document.getElementById('share-modal')),
  6918. function () {
  6919. _e('share'), V.open(r)
  6920. })
  6921. ),
  6922. K.on(ae.CLOSED, V.reset)),
  6923. 0 < s.heroLocations.length
  6924. ? (function (e, i, t) {
  6925. var n = 100 / (fe = e.heroLocations.length) + '%',
  6926. r = $('#thumb-container'),
  6927. o = $('#progressBar')
  6928. $('#status').find('.totalSteps').text(fe)
  6929. for (var a = 0; a < fe; a++) {
  6930. var s = e.heroLocations[a],
  6931. l = $('<li class="thumbImg" data-index=""><img src=""></li>')
  6932. if (s.heroLocations) {
  6933. //有子项,选第一张截图
  6934. var tmp = s.heroLocations[0].thumbUrl.replace('https://', '').replace('http://', '')
  6935. } else {
  6936. var tmp = s.thumbUrl.replace('https://', '').replace('http://', '')
  6937. }
  6938. if (
  6939. (l.attr('data-index', a),
  6940. //Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6941. Ce.highlight.visible && l.find('img').attr('src', 'http://' + tmp), // xzw改 导览图片 https在某些服务器打不开
  6942. s.name)
  6943. ) {
  6944. var c = $('<div class="overlay"></div>').text(s.name)
  6945. l.prepend(c)
  6946. }
  6947. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6948. var h = e.panos.get(s.panoId),
  6949. u =
  6950. h && !h.isAligned()
  6951. ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>'
  6952. : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>'
  6953. l.prepend(u)
  6954. }
  6955. r.append(l), o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6956. }
  6957. ;(T = 144 * fe),
  6958. 111 * fe,
  6959. $('.thumbImg').on('mouseover', function () {
  6960. !(function (e) {
  6961. return e.describe().inTransition
  6962. })(i) && t.showPathToHeroLocation([$(this).data('index'), 0]) //改
  6963. }),
  6964. $('.thumbImg').on('mouseout', function () {
  6965. i.clearPath()
  6966. }),
  6967. $('.thumbImg').on('click', function (e) {
  6968. y(e)
  6969. var t = $(this)
  6970. R.updateInteraction(oe.InteractionGui, 'thumbnail'),
  6971. R.trackAlways('showcase_gui', {
  6972. gui_action: 'click_highlight'
  6973. }),
  6974. i.goToHighlight([t.data('index'), 0]) //改
  6975. }),
  6976. $('.previous')
  6977. .find('a')
  6978. .on('click', function (e) {
  6979. y(e),
  6980. R.trackAlways('showcase_gui', {
  6981. gui_action: 'prev_highlight'
  6982. }),
  6983. i.prevHighlight()
  6984. }),
  6985. $('.next')
  6986. .find('a')
  6987. .on('click', function (e) {
  6988. y(e),
  6989. R.trackAlways('showcase_gui', {
  6990. gui_action: 'next_highlight'
  6991. }),
  6992. i.nextHighlight()
  6993. }),
  6994. $('#drawer').on('mouseleave', function (t) {
  6995. var i
  6996. y(t)
  6997. try {
  6998. i = new MouseEvent('mouseup', {
  6999. clientX: t.clientX,
  7000. clientY: t.clientY,
  7001. screenX: t.screenX,
  7002. screenY: t.screenY
  7003. })
  7004. } catch (e) {
  7005. ;(i = document.createEvent('MouseEvents')).initMouseEvent(
  7006. 'mouseup',
  7007. t.bubbles,
  7008. t.cancelable,
  7009. t.view,
  7010. t.detail,
  7011. t.screenX,
  7012. t.screenY,
  7013. t.clientX,
  7014. t.clientY,
  7015. t.ctrlKey,
  7016. t.altKey,
  7017. t.shiftKey,
  7018. t.metaKey,
  7019. t.button,
  7020. t.relatedTarget
  7021. )
  7022. }
  7023. document.dispatchEvent(i)
  7024. }),
  7025. (w = new Sly($('#scrollFrame'), {
  7026. horizontal: !0,
  7027. itemNav: 'centered',
  7028. smart: !0,
  7029. scrollTrap: !0,
  7030. scrollBy: 1,
  7031. mouseDragging: !0,
  7032. touchDragging: !0,
  7033. speed: 300,
  7034. dragHandle: !0,
  7035. dynamicHandle: !0,
  7036. clickBar: !0,
  7037. scrollBar: $('#scroller'),
  7038. activateOn: null
  7039. }).init()).on('active', function (e, t) {
  7040. t,
  7041. _e('tour'),
  7042. $('.step').removeClass('active'),
  7043. $('#status')
  7044. .find('.curIdx')
  7045. .text(t + 1)
  7046. for (var i = 0; i <= t; i++)
  7047. $('#progressBar')
  7048. .find("[data-idx='" + i + "']")
  7049. .addClass('active')
  7050. }),
  7051. E()
  7052. //add :
  7053. let scrollFrame = $(w.frame)
  7054. scrollFrame.on('wheel.sly', function () {
  7055. lastMoveScrollTime = Date.now()
  7056. })
  7057. let dragstart
  7058. /* scrollFrame.on("pointerdown", function() {
  7059. dragstart = true
  7060. })
  7061. scrollFrame.on("pointerup", function() {
  7062. dragstart = false
  7063. }) */
  7064. scrollFrame.on('pointermove', function () {
  7065. //if(dragstart){
  7066. lastMoveScrollTime = Date.now()
  7067. //}
  7068. })
  7069. })(s, l, c)
  7070. : ((Ce.highlight.visible = !1), (Ce.tourControls.visible = !1)),
  7071. z.on(G.OPEN_INFO, _e.bind(this, 'info')),
  7072. (function () {
  7073. var n
  7074. document.body.addEventListener(
  7075. 'mousedown',
  7076. function (e) {
  7077. n = 0 === e.button || 1 === e.which ? e.target : null
  7078. },
  7079. !0
  7080. ),
  7081. document.body.addEventListener(
  7082. 'mouseup',
  7083. function (t) {
  7084. n !== t.target && (n = b(n, t.target))
  7085. var e = document.getElementById('gui-parent')
  7086. if ((b(e, n) !== e && (n = null), n)) {
  7087. var i
  7088. try {
  7089. i = new MouseEvent('click', t)
  7090. } catch (e) {
  7091. ;(i = document.createEvent('MouseEvents')).initMouseEvent(
  7092. 'click',
  7093. t.bubbles,
  7094. t.cancelable,
  7095. t.view,
  7096. t.detail,
  7097. t.screenX,
  7098. t.screenY,
  7099. t.clientX,
  7100. t.clientY,
  7101. t.ctrlKey,
  7102. t.altKey,
  7103. t.shiftKey,
  7104. t.metaKey,
  7105. t.button,
  7106. t.relatedTarget
  7107. )
  7108. }
  7109. ;(i.syntheticClick = !0), n.dispatchEvent(i), (n = null)
  7110. }
  7111. },
  7112. !0
  7113. ),
  7114. document.getElementById('gui-parent').addEventListener(
  7115. 'click',
  7116. function (e) {
  7117. e.syntheticClick || (e.stopPropagation(), 'A' === e.target.nodeName && e.preventDefault())
  7118. },
  7119. !0
  7120. )
  7121. })(),
  7122. A(c),
  7123. C(s, t),
  7124. s.on('floor.changed', I),
  7125. s.on(
  7126. 'waiting',
  7127. function (e) {
  7128. _(e)
  7129. }.bind(this, s)
  7130. ),
  7131. s.on(
  7132. 'waiting-done',
  7133. function (e) {
  7134. _(e)
  7135. }.bind(this, s)
  7136. ),
  7137. c.on(re.ModeChanged, function (e, t) {
  7138. A(c), v(l, c), t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR), U.updateMode(t)
  7139. }),
  7140. e.on(oe.Move, _e.bind(this, 'move')),
  7141. c.on(re.Ready, function () {
  7142. O.init(e, c, c.tagManager, l),
  7143. c.on(re.ModeChanged, function (e, t) {
  7144. e !== t && $('.vr-popup').is(':visible') && X.dismiss()
  7145. })
  7146. }),
  7147. c.on(re.PanoChosen, function (e, t) {
  7148. A(c, t), U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  7149. }),
  7150. V.on(k.CLOSE, function (e) {
  7151. switch (e) {
  7152. case 'vr-modal':
  7153. X.dismiss()
  7154. break
  7155. case 'share-modal':
  7156. K.hide()
  7157. break
  7158. case 'terms-modal':
  7159. W.hide()
  7160. }
  7161. })
  7162. var lastMoveScrollTime = 0 //add
  7163. var o,
  7164. h = $('#play').eq(0),
  7165. u = $('#pause').eq(0),
  7166. d = $('.pinBottom').toArray(),
  7167. p = $('#drawer').eq(0),
  7168. f = $('#playHead').eq(0),
  7169. a = $('#progressBar').eq(0),
  7170. g = $('#thumb-container').eq(0).children(),
  7171. m = a.children()
  7172. l.on('update.controls', function () {
  7173. var e,
  7174. t,
  7175. i,
  7176. n = l.describe()
  7177. if (
  7178. (n.tourIsPlaying || c.isWarping()
  7179. ? (Ce.tourControls.visible && (h.hide(), u.show()),
  7180. n.tourInProgress &&
  7181. (d.forEach(function (e) {
  7182. e.classList.add('playing')
  7183. }),
  7184. p.addClass('playing'),
  7185. f.addClass('playing')))
  7186. : (Ce.tourControls.visible && (h.show(), u.hide()),
  7187. n.tourInProgress ||
  7188. (q.stopTour(),
  7189. d.forEach(function (e) {
  7190. e.classList.remove('playing')
  7191. }),
  7192. p.removeClass('playing'),
  7193. f.removeClass('playing'))),
  7194. null !== n.currentItem)
  7195. ) {
  7196. var r, o
  7197. $('#status')
  7198. .find('.curIdx')
  7199. .text(n.currentItem[0] + 1),
  7200. n.onTheBus ? ((r = 'active'), (o = 'recent')) : ((o = 'active'), (r = 'recent'))
  7201. var a = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0]
  7202. for (e = 0; e < s.heroLocations.length; e += 1)
  7203. (i = g.eq(e)),
  7204. (t = m.eq(e)),
  7205. i.removeClass(o),
  7206. t.removeClass(o),
  7207. n.onTheBus && e === n.destinationItem[0]
  7208. ? (i.addClass(r),
  7209. t.addClass(r),
  7210. // 如果一段时间内用户不拖拽滚动scroll,才focus回这个item
  7211. Date.now() - lastMoveScrollTime > 2000 && w.activate(e))
  7212. : n.onTheBus && a && e === n.currentItem[0]
  7213. ? (i.addClass(r), t.addClass(r))
  7214. : (i.removeClass(r), t.removeClass(r))
  7215. } 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')
  7216. v(l, c)
  7217. }),
  7218. document.addEventListener(
  7219. 'keydown',
  7220. function (e) {
  7221. switch ((R.updateInteraction(oe.InteractionKey), e.which)) {
  7222. case te.ZERO:
  7223. M.debug && s.toggleAlpha()
  7224. break
  7225. case te.NINE:
  7226. M.debug && B.toggle()
  7227. break
  7228. case te.ONE:
  7229. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA)
  7230. break
  7231. case te.TWO:
  7232. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE)
  7233. break
  7234. case te.THREE:
  7235. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN)
  7236. break
  7237. case te.FOUR:
  7238. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR)
  7239. break
  7240. case te.SPACE:
  7241. Ce.tourControls.visible && ($('#playHead').hasClass('playing') || _e('tour'))
  7242. break
  7243. case te.RETURN:
  7244. M.debug && s.toggleExplodeUp()
  7245. break
  7246. case te.P:
  7247. !(function (e) {
  7248. me.gui ||
  7249. (me.gui = (function (e) {
  7250. var t = new he.GUI()
  7251. return (
  7252. t
  7253. .add(M, 'showSweeps')
  7254. .name('Show sweeps')
  7255. .onFinishChange(function () {
  7256. e.setSweepVisibility(M.showSweeps)
  7257. }),
  7258. t.add(M, 'rotationAccelerationInside', 0.1, 10).name('Rotation speed').step(0.1),
  7259. t
  7260. .add(M.transition, 'flyTime', 0, 5e3)
  7261. .name('Transition time')
  7262. .onFinishChange(function () {
  7263. ;(M.transition.flySpeed = 0),
  7264. t.__controllers.forEach(function (e) {
  7265. e.updateDisplay()
  7266. })
  7267. }),
  7268. t.add(M.path, 'opacity', 0, 1).name('Path opacity'),
  7269. $(t.__closeButton).hide(),
  7270. t
  7271. )
  7272. })(me.model)),
  7273. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  7274. })(!me.visible)
  7275. break
  7276. case te.U:
  7277. !(function (e) {
  7278. ve.gui ||
  7279. (ve.gui = (function (t, i) {
  7280. function e() {
  7281. var e = i.toJSON()
  7282. ;(n.linkToLocation = window.location.protocol + '//' + window.location.host + window.location.pathname + '?m=' + t.sid + '&start=' + ee.serialize(e)),
  7283. i.tagManager.activeTag && (n.linkToLocation += '&tag=' + i.tagManager.activeTag.sid)
  7284. }
  7285. var n = {},
  7286. r = new he.GUI({
  7287. autoPlace: !0,
  7288. width: '60%'
  7289. })
  7290. return (
  7291. e(),
  7292. i.on(re.ViewChanged, e),
  7293. r.add(n, 'linkToLocation').name(se.LINK_TO_LOCATION).listen(),
  7294. (r.domElement.id = 'datLinks'),
  7295. [].slice.call(r.domElement.querySelectorAll('.property-name')).forEach(function (e) {
  7296. if (!S.detectSafari()) {
  7297. var t = document.createElement('button')
  7298. t.classList.add('btn-deep-link'), (t.innerText = se.MENU_COPY), e.nextSibling.appendChild(t)
  7299. var n = function () {
  7300. alert(se.LINK_ALERT_COPY), t.hide()
  7301. }
  7302. t.addEventListener('click', function (e) {
  7303. try {
  7304. var t = e.target.parentNode.childNodes[0]
  7305. t.select()
  7306. var i = document.execCommand('copy')
  7307. t.blur(), i || n()
  7308. } catch (e) {
  7309. n()
  7310. }
  7311. })
  7312. }
  7313. }),
  7314. $(r.__closeButton).hide(),
  7315. r
  7316. )
  7317. })(ve.model, ve.player)),
  7318. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  7319. })(!ve.visible)
  7320. break
  7321. case te.X:
  7322. M.debug && s.toggleExplode()
  7323. break
  7324. case te.PLUSEQUALS:
  7325. l.player.activatePersistentZooming(!0), O.hideUi()
  7326. break
  7327. case te.DASHUNDERSCORE:
  7328. l.player.activatePersistentZooming(!1), O.hideUi()
  7329. break
  7330. case te.SEVEN:
  7331. ue.info('Zoom level: ' + l.player.zoomLevel + ', FOV: ' + l.player.zoomFov)
  7332. break
  7333. case te.EIGHT:
  7334. l.player.decreaseZoomSpeed()
  7335. break
  7336. case te.NINE:
  7337. l.player.increaseZoomSpeed()
  7338. }
  7339. return c && c.reticule.hide(), !0
  7340. }.bind(this)
  7341. ),
  7342. document.addEventListener(
  7343. 'keyup',
  7344. function (e) {
  7345. switch (e.which) {
  7346. case te.PLUSEQUALS:
  7347. l.player.deactivatePersistentZooming()
  7348. break
  7349. case te.DASHUNDERSCORE:
  7350. l.player.deactivatePersistentZooming()
  7351. }
  7352. }.bind(this)
  7353. ),
  7354. (function (e) {
  7355. me = {
  7356. gui: null,
  7357. visible: !1,
  7358. model: e
  7359. }
  7360. })(s),
  7361. (function (e, t) {
  7362. ve = {
  7363. gui: null,
  7364. visible: !1,
  7365. model: e,
  7366. player: t
  7367. }
  7368. })(s, l.player),
  7369. (function (e) {
  7370. function t(e, i) {
  7371. $(e)
  7372. .find('a')
  7373. .each(function (e, t) {
  7374. i ? $(t).removeClass('buttonZoomDisabled').addClass('buttonZoomEnabled') : $(t).addClass('buttonZoomDisabled').removeClass('buttonZoomEnabled'),
  7375. (t.style.pointerEvents = i ? 'auto' : 'none')
  7376. })
  7377. }
  7378. e.on(de.ZoomMax, function () {
  7379. t('#gui-zoomin', !1), t('#gui-zoomout', !0)
  7380. }),
  7381. e.on(de.ZoomMin, function () {
  7382. t('#gui-zoomin', !0), t('#gui-zoomout', !1)
  7383. }),
  7384. e.on(de.ZoomIn, function () {
  7385. t('#gui-zoomout', !0)
  7386. }),
  7387. e.on(de.ZoomOut, function () {
  7388. t('#gui-zoomin', !0)
  7389. }),
  7390. e.zoomLevel >= M.zoom.max ? t('#gui-zoomin', !1) : t('#gui-zoomin', !0),
  7391. e.zoomLevel <= M.zoom.min ? t('#gui-zoomout', !1) : t('#gui-zoomout', !0)
  7392. })(c),
  7393. P.setAutoPlay(s.heroCount()),
  7394. U.init(c, i.mode),
  7395. U.on(H.OPENED, _e.bind(this, 'help')),
  7396. W.init(),
  7397. W.on(
  7398. j.OPENED,
  7399. ((o = document.getElementById('terms-modal')),
  7400. function () {
  7401. _e('terms'), V.open(o)
  7402. })
  7403. ),
  7404. W.on(j.CLOSED, V.reset),
  7405. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  7406. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  7407. M.profiling.enabled && B.show(),
  7408. q.init(l)
  7409. }),
  7410. (Le.exports.startLoading = function (e, t, i, n, r, o) {
  7411. function a() {
  7412. o.setLoadingStartTime(),
  7413. (function () {
  7414. function e(e) {
  7415. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  7416. }
  7417. $('body').css('touch-action', 'none'),
  7418. $('#gui-parent')
  7419. .find('*:not(#tag-billboards)')
  7420. .on('touchmove', function (e) {})
  7421. var t = document.getElementById('terms-text'),
  7422. i = document.getElementById('more-help-wrapper'),
  7423. n = (document.getElementById('navigation-help-wrapper'), document.getElementById('help-dialog'), document.getElementById('tag-billboards'))
  7424. M.useWheel &&
  7425. (document.body.addEventListener('mousewheel', e, {
  7426. passive: !1
  7427. }),
  7428. document.body.addEventListener('DOMMouseScroll', e)),
  7429. $('#terms-text, #more-help-wrapper, #navigation-help-wrapper')
  7430. .off('touchmove')
  7431. .on('touchmove', function (e) {
  7432. e.stopPropagation()
  7433. })
  7434. })(),
  7435. r
  7436. ? (D.showMessage(t, i, Ce.coBrand.visible), l())
  7437. : (function (e) {
  7438. L.show(e), c()
  7439. })(l)
  7440. }
  7441. var s = $.Deferred(),
  7442. l = s.resolve.bind(s)
  7443. ;(ye = !0), _(e)
  7444. e.data.player_options &&
  7445. (function (e) {
  7446. Ce.tourControls.visible = true //e.tour_buttons && S.valueFromHash("gt", 1),
  7447. ;(Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash('mls', !1)),
  7448. (Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights)
  7449. })(e.data.player_options),
  7450. 1 === M.specialEdition && $('body').addClass('specialEdition')
  7451. se.localizeGUI()
  7452. !(function (i) {
  7453. function e(e, t) {
  7454. return !!i.player_options[e] && i[t || e]
  7455. }
  7456. $('.model-title').text(i.name)
  7457. var t = M.pageTitle
  7458. 2 !== S.valueFromHash('mls', 0) && i.name && (t = i.name),
  7459. (document.title = t),
  7460. S.isMobile()
  7461. ? $('#gui-fullscreen').css('display', 'none')
  7462. : ($('[rel=tooltip]').tooltip({
  7463. delay: {
  7464. show: 50,
  7465. hide: 0
  7466. },
  7467. trigger: 'hover',
  7468. html: !1,
  7469. viewport: {
  7470. selector: 'body',
  7471. padding: 10
  7472. }
  7473. }),
  7474. S.inIframe() && document.getElementsByClassName('pinBottom-container')[0].classList.add('embed')),
  7475. z.populate({
  7476. name: e('model_name', 'name'),
  7477. coBrand: e('presented_by'),
  7478. description: e('model_summary', 'summary') || '暂无内容',
  7479. contactName: e('contact_name'),
  7480. address: e('address'),
  7481. phone: e('contact_phone'),
  7482. formattedPhone: i.formatted_contact_phone,
  7483. email: e('contact_email'),
  7484. url: e('external_url'),
  7485. socialSharing: i.enable_social_sharing && i.is_public
  7486. })
  7487. })(e.data)
  7488. r || $('.quick').addClass('hidden')
  7489. n ? (R.impression(), a()) : (o.setWaitingStartTime(), N.show(r, a))
  7490. return s
  7491. }),
  7492. (Le.exports.endLoading = function (e, t, i) {
  7493. var n = t.player
  7494. function r() {
  7495. i.dismissExaminedTag(), i.disableHovering()
  7496. }
  7497. $('#gui-thumb').fadeOut(2500),
  7498. L.hide(function () {
  7499. ye = !1
  7500. }),
  7501. Y.init(e, i),
  7502. z.finishSetup(Object.keys(e.tags).length),
  7503. i.on(ne.IMAGE_OPENED, _e.bind(this, 'tag')),
  7504. X.on(Z.OPENED, r),
  7505. K.on(ae.OPENED, r),
  7506. U.on(H.OPENED, r),
  7507. W.on(j.OPENED, r)
  7508. var o = i.enableHovering.bind(i)
  7509. if (
  7510. (X.on(Z.CLOSED, o),
  7511. K.on(ae.CLOSED, o),
  7512. U.on(H.CLOSED, o),
  7513. W.on(j.CLOSED, o),
  7514. M.labels.enabled && Object.keys(e.labels).length,
  7515. e.floors.length <= 1 || !Ce.floors.visible ? (Ce.floors.visible = !1) : (h(e, t), I(e.currentFloor, n.mode)),
  7516. '372' === getQueryVariable('m') && ((Ce.floors.visible = 1), h(e, t)),
  7517. c(),
  7518. v(t, t.player),
  7519. $('#gui').fadeIn(1500),
  7520. Ce.highlight.visible &&
  7521. (2 !== M.startHighlights || e.has360Views) &&
  7522. setTimeout(function () {
  7523. l(), ((!e.has360Views && 1 !== M.startHighlights) || (e.has360Views && 0 === M.startHighlights)) && setTimeout(l, 2e3)
  7524. }, 2e3),
  7525. !S.isMobile())
  7526. )
  7527. 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')
  7528. _(e),
  7529. z.setupToggling(),
  7530. window.editHotPanel && editHotPanel(),
  7531. (function () {
  7532. var i = $('#pullTab'),
  7533. e = {
  7534. bottom: {
  7535. 'border-bottom-left-radius': '10px',
  7536. 'border-bottom-right-radius': '10px'
  7537. },
  7538. top: {
  7539. 'border-top-left-radius': '10px',
  7540. 'border-top-right-radius': '10px'
  7541. }
  7542. },
  7543. t = {
  7544. bottom: {
  7545. 'border-top-right-radius': '10px',
  7546. 'border-bottom-right-radius': '10px'
  7547. },
  7548. top: {
  7549. 'border-bottom-left-radius': '10px',
  7550. 'border-top-left-radius': '10px'
  7551. }
  7552. }
  7553. function n(e, t) {
  7554. $('#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)
  7555. }
  7556. ;/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top)
  7557. ;(window.DATA.model.special || 'true' === window.DATA.special) && window.specialScene && specialScene.special().afterImplement()
  7558. })()
  7559. $('.toolRight a').removeClass('hasHover')
  7560. }),
  7561. (Le.exports.onProgress = function (e) {
  7562. L.progress(e)
  7563. })
  7564. }).call(this, '/js/gui/gui.js')
  7565. },
  7566. {
  7567. '../analytics': 4,
  7568. '../controls/serializer': 14,
  7569. '../enum/AlignmentType': 17,
  7570. '../enum/BlackoutStyle': 18,
  7571. '../enum/ControlEvents': 21,
  7572. '../enum/DirectorEvents': 23,
  7573. '../enum/Keys': 30,
  7574. '../enum/PathDiscardMode': 38,
  7575. '../enum/PathDisplayMode': 39,
  7576. '../enum/PlayerEvents': 40,
  7577. '../enum/VROption': 47,
  7578. '../enum/Vectors': 50,
  7579. '../enum/Viewmode': 51,
  7580. '../enum/WarpStyle': 52,
  7581. '../enum/ZoomEvents': 53,
  7582. '../lib/dat.gui': 93,
  7583. '../localization/localize': 108,
  7584. '../tag/Media/MediaEvent': 131,
  7585. '../objects/Snapshot': 153,
  7586. '../settings': 166,
  7587. '../util/ajax': 181,
  7588. '../util/browser': 182,
  7589. '../util/camera': 183,
  7590. '../util/logger': 189,
  7591. '../util/showcase': 193,
  7592. '../util/transitions': 195,
  7593. './closer/ModalCloserEvent': 61,
  7594. './closer/modalCloser': 62,
  7595. './help/HelpEvent': 66,
  7596. './help/help': 67,
  7597. './helpManager': 68,
  7598. './immersiveMode': 69,
  7599. './konami': 70,
  7600. './landingScreen': 71,
  7601. './loadingScreen': 72,
  7602. './memoryUsage': 73,
  7603. './playButton': 74,
  7604. './populateModal': 75,
  7605. './sharing/ShareEvents': 76,
  7606. './sharing/modal': 77,
  7607. './terms/TermsEvent': 78,
  7608. './terms/terms': 79,
  7609. './title/TitleEvents': 80,
  7610. './title/tagToggle': 81,
  7611. './title/titleBar': 82,
  7612. './tourInteraction': 84,
  7613. './vr/vrEvent': 85,
  7614. './vr/vrModal': 87,
  7615. './webvr/WebVrEvent': 88,
  7616. './webvr/webVRgui': 89,
  7617. three: 217
  7618. }
  7619. ],
  7620. 66: [
  7621. function (e, t, i) {
  7622. 'use strict'
  7623. t.exports = Object.freeze({
  7624. OPENED: 'help.opened',
  7625. CLOSED: 'help.closed'
  7626. })
  7627. },
  7628. {}
  7629. ],
  7630. 67: [
  7631. function (e, t, i) {
  7632. 'use strict'
  7633. function n() {
  7634. p.on('click', function (e) {
  7635. T &&
  7636. T !== a.TRANSITIONING &&
  7637. (0 < window.getComputedStyle(v).getPropertyValue('opacity') && !x
  7638. ? S.close()
  7639. : T &&
  7640. T !== a.TRANSITIONING &&
  7641. ((x = !0),
  7642. setTimeout(function () {
  7643. x = !1
  7644. }, h.help.modalStayDuration),
  7645. S.emit(l.OPENED),
  7646. f.addClass('open ' + T),
  7647. p.addClass('open'),
  7648. o(),
  7649. r(),
  7650. v.style.removeProperty ? v.style.removeProperty('display') : v.style.removeAttribute('display'),
  7651. v.classList.add('fadeIn')))
  7652. }),
  7653. E.on('click', function (e) {
  7654. S.close()
  7655. }),
  7656. C.on('click', function (e) {
  7657. T && T !== a.TRANSITIONING && (o(), r())
  7658. }),
  7659. I.on('click', function (e) {
  7660. o(), I.addClass('underline-tab'), c.fill(b, s.MORE_HELP), f.addClass('more-help')
  7661. })
  7662. }
  7663. function r() {
  7664. C.addClass('underline-tab'), c.fill(_, s.NAVIGATION, T), f.addClass(T)
  7665. }
  7666. function o() {
  7667. f.removeClass('more-help ' + a.PANORAMA + ' ' + a.DOLLHOUSE + ' ' + a.FLOORPLAN + ' ' + a.OUTDOOR),
  7668. A.forEach(function (e) {
  7669. e.classList.remove('underline-tab')
  7670. })
  7671. }
  7672. var a = e('../../enum/Viewmode'),
  7673. s = e('../../enum/HelpModalType'),
  7674. l = e('./HelpEvent'),
  7675. c = (e('../helpManager'), e('./../populateModal')),
  7676. h = e('../../settings'),
  7677. u = e('../../util/common'),
  7678. d = e('events').EventEmitter,
  7679. p = $('.footer-help').eq(0),
  7680. f = $('#help-dialog').eq(0),
  7681. g = document.querySelector('#quick-logo'),
  7682. m = document.querySelector('#loaderCoBrand'),
  7683. v = document.querySelector('#help-dialog'),
  7684. y = document.querySelector('.footer'),
  7685. A = $('.help-tabs').children().toArray(),
  7686. C = $('.navigation-tab').eq(0),
  7687. I = $('.more-help-tab').eq(0),
  7688. E = ($('#interaction-modal').eq(0).find('.interaction').toArray(), f.find('.close').eq(0)),
  7689. _ = f.find('.interactions').toArray(),
  7690. b = f.find('.ui-instructions').toArray(),
  7691. w = a.PANORAMA,
  7692. T = a.PANORAMA,
  7693. x = !1,
  7694. S = {
  7695. init: function (e, t) {
  7696. ;(w = T = t),
  7697. [v, m, g, y].forEach(function (e) {
  7698. e.classList.add(c.deviceType)
  7699. }),
  7700. n()
  7701. },
  7702. close: function () {
  7703. if (f.hasClass('open') && (this.emit(l.CLOSED), p.removeClass('open'), f.removeClass('open'), v.classList.contains('fadeIn'))) {
  7704. v.classList.remove('fadeIn')
  7705. var e = T === a.TRANSITIONING ? w : T
  7706. c.clear(_, s.NAVIGATION, e)
  7707. }
  7708. },
  7709. updateMode: function (e) {
  7710. ;(w = T), (T = e)
  7711. }
  7712. }
  7713. u.extendObject(S, d.prototype), (t.exports = S)
  7714. },
  7715. {
  7716. '../../enum/HelpModalType': 28,
  7717. '../../enum/Viewmode': 51,
  7718. '../../settings': 166,
  7719. '../../util/common': 185,
  7720. '../helpManager': 68,
  7721. './../populateModal': 75,
  7722. './HelpEvent': 66,
  7723. events: 202
  7724. }
  7725. ],
  7726. 68: [
  7727. function (s, l, e) {
  7728. ;(function (e) {
  7729. 'use strict'
  7730. var t = s('../util/browser'),
  7731. i = s('./../util/logger'),
  7732. n = s('./../settings'),
  7733. r = new i(e),
  7734. o = (function () {
  7735. var t
  7736. try {
  7737. return (t = window.localStorage.getItem('visitCount') || '0'), (t = (parseFloat(t) + 1).toString()), window.localStorage.setItem('visitCount', t), r.debug('visitCount = ' + t), t
  7738. } catch (e) {
  7739. ;(t = '1'), r.debug("couldn't set local storage")
  7740. }
  7741. })(),
  7742. a = !1
  7743. l.exports = {
  7744. isHelpDisabled: function () {
  7745. return '0' === t.valueFromHash('help', null) || a
  7746. },
  7747. isLargeHelpEnabled: function () {
  7748. return ('1' === o || '1' === t.valueFromHash('help', null)) && !this.isHelpDisabled()
  7749. },
  7750. isSmallHelpEnabled: function () {
  7751. return '2' === t.valueFromHash('help', null) && !this.isHelpDisabled()
  7752. },
  7753. isHelpEnabled: function () {
  7754. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7755. },
  7756. setAutoPlay: function (e) {
  7757. a = 0 <= n.warp.auto && 1 < e
  7758. }
  7759. }
  7760. }).call(this, '/js/gui/helpManager.js')
  7761. },
  7762. {
  7763. '../util/browser': 182,
  7764. './../settings': 166,
  7765. './../util/logger': 189
  7766. }
  7767. ],
  7768. 69: [
  7769. function (e, t, i) {
  7770. 'use strict'
  7771. function r(e) {
  7772. M ||
  7773. (n(e) && C.hasClass('playing')) ||
  7774. (clearTimeout(x),
  7775. (T = !0),
  7776. h.close(),
  7777. (function (e) {
  7778. !n(e) && S
  7779. ? v.forEach(function (e) {
  7780. e.classList.remove('drawerOpen'), e.classList.add('duringTour')
  7781. })
  7782. : C.hasClass('open')
  7783. ? v.forEach(function (e) {
  7784. e.classList.remove('duringTour'), e.classList.add('drawerOpen')
  7785. })
  7786. : P ||
  7787. R === g.FLOORPLAN ||
  7788. R === g.DOLLHOUSE ||
  7789. v.forEach(function (e) {
  7790. e.classList.add('fadeOut')
  7791. })
  7792. })(e),
  7793. R !== g.DOLLHOUSE &&
  7794. R !== g.FLOORPLAN &&
  7795. ((E.hasClass('expand') && !_.hasClass('closed')) || l.valueFromHash('title', 1),
  7796. C.hasClass('playing') ||
  7797. (y.forEach(function (e) {
  7798. e.classList.add('detectHover')
  7799. }),
  7800. (x = setTimeout(a, c.immersive.timeToShowAgain)))))
  7801. }
  7802. function o() {
  7803. C.hasClass('playing') || (clearTimeout(x), (x = setTimeout(a, c.immersive.timeToShowAgain)))
  7804. }
  7805. function a() {
  7806. clearTimeout(x),
  7807. (T = !1),
  7808. m.forEach(function (e) {
  7809. e.classList.remove('drawerOpen')
  7810. }),
  7811. S ||
  7812. v.forEach(function (e) {
  7813. e.classList.remove('duringTour')
  7814. }),
  7815. y.forEach(function (e) {
  7816. e.classList.remove('detectHover')
  7817. })
  7818. }
  7819. function s() {
  7820. T ? a() : r(),
  7821. (M = !0),
  7822. setTimeout(function () {
  7823. M = !1
  7824. }, c.immersive.uiStayDuration)
  7825. }
  7826. function n(e) {
  7827. return 'mouse' === e || 'touch' === e || 'key' === e || 'gui' === e
  7828. }
  7829. var l = e('../util/browser'),
  7830. c = e('../settings'),
  7831. h = e('./help/help'),
  7832. u = e('../enum/tagEvents'),
  7833. d = e('../enum/ControlEvents'),
  7834. p = e('../enum/PlayerEvents'),
  7835. f = e('../enum/DirectorEvents'),
  7836. g = ((p = e('../enum/PlayerEvents')), e('../enum/Viewmode')),
  7837. m = $('.pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer').toArray(),
  7838. v = $('.pinBottom-container, #drawer-container, .footer').toArray(),
  7839. y = $('#hover-bottom, #hover-top').toArray(),
  7840. A = ($('#pullTab').eq(0), $('#playHead').eq(0), $('.pinBottom-container').eq(0)),
  7841. C = $('#drawer').eq(0),
  7842. I = $('#drawer-container').eq(0),
  7843. E = $('#meta-info').eq(0),
  7844. _ = $('.pinTop.left').eq(0),
  7845. b = $('#player').eq(0),
  7846. w = document.getElementById('pullTab'),
  7847. T = !1,
  7848. x = null,
  7849. S = !1,
  7850. M = !1,
  7851. R = null,
  7852. P = !1
  7853. ;(t.exports.init = function (e, t, i, n) {
  7854. ;(function (t, i, e, n) {
  7855. ;[g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function (e) {
  7856. t.controls[e].on(d.Move, r), t.controls[e].on(d.LongTap, s)
  7857. }),
  7858. b.on('mousewheel DOMMouseScroll', r),
  7859. e.on(u.TagActivated, r),
  7860. e.on(u.TagNavigation, r),
  7861. i.on(p.FlyingEnded, o),
  7862. i.on(p.ModeChanging, function (e, t) {
  7863. P = t !== g.PANORAMA && e !== g.PANORAMA
  7864. }),
  7865. i.on(p.ModeChanged, function (e, t) {
  7866. ;(R = i.mode), t !== g.TRANSITIONING ? a() : r('modeChange')
  7867. }),
  7868. n.on(f.TourStart, function () {
  7869. ;(S = !0), r()
  7870. }),
  7871. n.on(f.TourEnd, function () {
  7872. ;(S = !1), a()
  7873. }),
  7874. n.on(f.ActionInterrupted, function () {
  7875. S = !1
  7876. }),
  7877. w.addEventListener(
  7878. 'touchend',
  7879. function () {
  7880. $('#pullTab').hasClass('opened') && !S && a()
  7881. },
  7882. !0
  7883. )
  7884. })(e, t, i, n),
  7885. l.isMobile()
  7886. ? (y.forEach(function (e) {
  7887. e.classList.add('mobile')
  7888. }),
  7889. A.click(a))
  7890. : (y.forEach(function (e) {
  7891. e.addEventListener(
  7892. 'mouseleave',
  7893. function () {
  7894. !b.is(':hover') && y[0].classList.contains('detectHover') && a()
  7895. },
  7896. !0
  7897. )
  7898. }),
  7899. b.mouseleave(function () {
  7900. y[0].classList.contains('detectHover') && a()
  7901. })),
  7902. (R = t.mode)
  7903. }),
  7904. (t.exports.hideUi = r),
  7905. (t.exports.resetDrawer = function () {
  7906. I.hasClass('duringTour') || ((S = !1), r('gui'), a())
  7907. })
  7908. },
  7909. {
  7910. '../enum/ControlEvents': 21,
  7911. '../enum/DirectorEvents': 23,
  7912. '../enum/tagEvents': 32,
  7913. '../enum/PlayerEvents': 40,
  7914. '../enum/Viewmode': 51,
  7915. '../settings': 166,
  7916. '../util/browser': 182,
  7917. './help/help': 67
  7918. }
  7919. ],
  7920. 70: [
  7921. function (i, n, e) {
  7922. ;(function (e) {
  7923. 'use strict'
  7924. var t = i('./../util/logger'),
  7925. o = i('./../settings'),
  7926. a = i('./debug'),
  7927. s = i('./../util/common'),
  7928. l = (i('./gui'), new t(e))
  7929. o.console && $('body').append('<div id="debug-console"></div>'),
  7930. (n.exports.init = function (i, n, r) {
  7931. l.debug('konami has the modelInstance')
  7932. var t = []
  7933. $(window).on('keydown', function (e) {
  7934. t.push(e.which), t.length > o.secretPanelWord.length && t.shift(), s.equalLists(t, o.secretPanelWord) && (l.debug('Developer mode active.'), (o.debug = !0))
  7935. }),
  7936. $(window).on('keydown', function e(t) {
  7937. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r), $(window).off('keydown', e)) : console.warn("sorry we're not ready yet"))
  7938. })
  7939. })
  7940. }).call(this, '/js/gui/konami.js')
  7941. },
  7942. {
  7943. './../settings': 166,
  7944. './../util/common': 185,
  7945. './../util/logger': 189,
  7946. './debug': 63,
  7947. './gui': 65
  7948. }
  7949. ],
  7950. 71: [
  7951. function (e, t, i) {
  7952. 'use strict'
  7953. function r() {
  7954. s.clear(m, l.LANDING[v]), g.removeClass('fadeIn')
  7955. }
  7956. var o = e('../settings'),
  7957. a = (e('./help/help'), e('./helpManager')),
  7958. s = e('./populateModal'),
  7959. l = e('../enum/HelpModalType'),
  7960. n = e('../enum/Viewmode'),
  7961. c = e('../enum/DirectorEvents'),
  7962. h = e('../enum/PlayerEvents'),
  7963. u = $('#quick-blackout').eq(0),
  7964. d = $('#quick-logo').eq(0),
  7965. p = $('.quick-brand').toArray(),
  7966. f = $('#loaderCoBrand').eq(0),
  7967. g = $('#interaction-modal').eq(0),
  7968. m = g.find('.interaction').toArray(),
  7969. v = ($('#model-title, .pinBottom-container, #drawer-container, #drawer, .footer').toArray(), '')
  7970. ;(t.exports.delayLanding = function (e) {
  7971. var t = $.Deferred()
  7972. e || t.resolve()
  7973. var i = o.startupFlyinDelay
  7974. return e === n.PANORAMA && (i += o.dollhouse.transitionTime), setTimeout(t.resolve.bind(t), i), t
  7975. }),
  7976. (t.exports.showMessage = function (e, t, i) {
  7977. var n = 0
  7978. o.quickstart.enabled &&
  7979. ((function (e) {
  7980. /* e && (f.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7981. d.before(f),
  7982. p = $(".quick-brand").toArray()), */
  7983. u.addClass('fadeOut')
  7984. /* setTimeout(function() {
  7985. p.forEach(function(e) {
  7986. e.classList.add("fadeIn")
  7987. })
  7988. }, o.quickstart.showTextDelay),
  7989. setTimeout(function() {
  7990. p.forEach(function(e) {
  7991. e.classList.add("fadeOut")
  7992. })
  7993. }, o.quickstart.fadeOutDelay) */
  7994. })(i),
  7995. (n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay)),
  7996. (function (e, t) {
  7997. setTimeout(function () {
  7998. if (a.isHelpEnabled()) {
  7999. if ((t(), s.init(), g.addClass('fadeIn landing ' + s.deviceType), a.isSmallHelpEnabled())) return void g.addClass('small')
  8000. s.fill(m, l.LANDING[v]), g.addClass(v)
  8001. }
  8002. }, e)
  8003. var i = {
  8004. pc: ['images/pc_step1.png', 'images/pc_step2.png', 'images/pc_step3.png'],
  8005. mobile: ['images/phone_step1.png', 'images/phone_step2.png', 'images/phone_step3.png']
  8006. },
  8007. n = $('.nav-icon .icon')
  8008. ;/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr('src', i.mobile[0])
  8009. function r(e) {
  8010. e.on('click', function () {
  8011. var e = null
  8012. if (((e = 'plus' == $(this).attr('data-id') ? +n.attr('data-page') + 1 : +n.attr('data-page') - 1), i.length < e || e < 1)) return !1
  8013. ;/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)
  8014. ? n.attr({
  8015. 'data-page': e,
  8016. src: i.mobile[e - 1]
  8017. })
  8018. : n.attr({
  8019. 'data-page': e,
  8020. src: i.pc[e - 1]
  8021. })
  8022. })
  8023. }
  8024. r($('.next-button')), r($('.prev-button'))
  8025. })(n, function () {
  8026. e.once(h.Move, r), t.once(c.TourStart, r)
  8027. })
  8028. }),
  8029. (t.exports.init = function (e, t) {
  8030. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  8031. }),
  8032. (t.exports.dismissModal = r)
  8033. },
  8034. {
  8035. '../enum/DirectorEvents': 23,
  8036. '../enum/HelpModalType': 28,
  8037. '../enum/PlayerEvents': 40,
  8038. '../enum/Viewmode': 51,
  8039. '../settings': 166,
  8040. './help/help': 67,
  8041. './helpManager': 68,
  8042. './populateModal': 75
  8043. }
  8044. ],
  8045. 72: [
  8046. function (e, t, i) {
  8047. 'use strict'
  8048. var n = e('./circleLoader').circleLoader
  8049. t.exports = {
  8050. element: $('#gui-loading'),
  8051. hide: function (e) {
  8052. n.done(), this.element.fadeOut(1500, e)
  8053. },
  8054. show: function (e) {
  8055. this.element.fadeIn(
  8056. 500,
  8057. function () {
  8058. this.element.css('display', 'table'), e && e()
  8059. }.bind(this)
  8060. )
  8061. },
  8062. progress: function (e) {
  8063. n.set(e)
  8064. }
  8065. }
  8066. },
  8067. {
  8068. './circleLoader': 60
  8069. }
  8070. ],
  8071. 73: [
  8072. function (e, t, i) {
  8073. 'use strict'
  8074. var n = e('../settings'),
  8075. r = $('#memory-info'),
  8076. o = r.find('#memory-gpu'),
  8077. a = !1
  8078. t.exports = {
  8079. show: function () {
  8080. n.profiling.enabled && (r.show(), (a = !0))
  8081. },
  8082. hide: function () {
  8083. r.hide(), (a = !1)
  8084. },
  8085. toggle: function () {
  8086. a ? this.hide() : this.show()
  8087. },
  8088. update: function (e) {
  8089. n.profiling.enabled && o.text(Math.floor(e / 1e6) + 'MB')
  8090. }
  8091. }
  8092. },
  8093. {
  8094. '../settings': 166
  8095. }
  8096. ],
  8097. 74: [
  8098. function (e, t, i) {
  8099. 'use strict'
  8100. e('../util/browser'), e('../analytics')
  8101. e('../settings'),
  8102. (t.exports = {
  8103. show: function (e, t) {
  8104. $('#gui-message').fadeOut(500, function () {
  8105. t()
  8106. })
  8107. }
  8108. })
  8109. },
  8110. {
  8111. '../analytics': 4,
  8112. '../settings': 166,
  8113. '../util/browser': 182
  8114. }
  8115. ],
  8116. 75: [
  8117. function (e, t, i) {
  8118. 'use strict'
  8119. function n(e, t, i, n) {
  8120. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  8121. }
  8122. var r = e('../util/browser'),
  8123. o = e('../localization/localize'),
  8124. a = e('../enum/HelpModalType'),
  8125. s = (e('../enum/HelpModalSize'), e('../enum/Viewmode'))
  8126. t.exports = {
  8127. init: function () {
  8128. if (!this.hasInitialized) {
  8129. ;(this.hasInitialized = !0),
  8130. (this.deviceType = r.isMobile() ? 'mobile' : 'desktop'),
  8131. (this.assets = {}),
  8132. (this.assets[a.LANDING[s.PANORAMA]] = {
  8133. desktop: {
  8134. left: {
  8135. 'top-info': o.ROTATE,
  8136. 'big-image': 'images/nav_help_mouse_drag_left.png',
  8137. keyboard: 'images/nav_help_keyboard_left_right.png'
  8138. },
  8139. middle: {
  8140. 'top-info': o.MOVE,
  8141. 'big-image': 'images/nav_help_mouse_click.png',
  8142. keyboard: 'images/nav_help_keyboard_up_down.png'
  8143. },
  8144. right: {
  8145. 'top-info': o.ZOOM,
  8146. 'big-image': 'images/nav_help_mouse_zoom.png',
  8147. keyboard: 'images/nav_help_zoom_keys.png'
  8148. }
  8149. },
  8150. mobile: {
  8151. left: {
  8152. 'top-info': o.ROTATE,
  8153. 'big-image': 'images/nav_help_gesture_drag.png'
  8154. },
  8155. middle: {
  8156. 'top-info': o.MOVE,
  8157. 'big-image': 'images/nav_help_gesture_tap.png'
  8158. },
  8159. right: {
  8160. 'top-info': o.ZOOM,
  8161. 'big-image': 'images/nav_help_gesture_pinch.png'
  8162. }
  8163. }
  8164. }),
  8165. (this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]]))),
  8166. (this.assets[a.LANDING[s.DOLLHOUSE]] = {
  8167. desktop: {
  8168. left: {
  8169. 'top-info': o.ROTATE,
  8170. 'big-image': 'images/nav_help_mouse_drag_left.png',
  8171. keyboard: 'images/nav_help_keyboard_left_right.png'
  8172. },
  8173. middle: {
  8174. 'top-info': o.MOVE,
  8175. 'big-image': 'images/nav_help_mouse_position_right.png'
  8176. }
  8177. },
  8178. mobile: {
  8179. left: {
  8180. 'top-info': o.ROTATE,
  8181. 'big-image': 'images/nav_help_gesture_drag.png'
  8182. },
  8183. middle: {
  8184. 'top-info': o.MOVE,
  8185. 'big-image': 'images/nav_help_gesture_position_two_finger.png'
  8186. }
  8187. }
  8188. }),
  8189. (this.assets[a.LANDING[s.FLOORPLAN]] = {
  8190. desktop: {
  8191. left: {
  8192. 'top-info': o.MOVE,
  8193. 'big-image': 'images/nav_help_mouse_position_left.png'
  8194. },
  8195. middle: {
  8196. 'top-info': o.ROTATE,
  8197. 'big-image': 'images/nav_help_mouse_drag_right.png',
  8198. keyboard: 'images/nav_help_keyboard_left_right.png'
  8199. }
  8200. },
  8201. mobile: {
  8202. left: {
  8203. 'top-info': o.MOVE,
  8204. 'big-image': 'images/nav_help_gesture_position.png'
  8205. },
  8206. middle: {
  8207. 'top-info': o.ROTATE,
  8208. 'big-image': 'images/nav_help_gesture_drag_two_finger.png'
  8209. }
  8210. }
  8211. })
  8212. var e = {
  8213. 'top-info': o.INSIDE,
  8214. 'big-image': 'images/nav_help_click_inside.png',
  8215. keyboard: 'images/nav_help_inside_key.png'
  8216. }
  8217. ;(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)
  8218. var t = {
  8219. 'top-info': o.INSIDE,
  8220. 'big-image': 'images/nav_help_tap_inside.png'
  8221. }
  8222. ;(this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t),
  8223. (this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t),
  8224. (this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t),
  8225. (this.assets[a.NAVIGATION] = {}),
  8226. (this.assets[a.NAVIGATION][s.PANORAMA] = {
  8227. desktop: {
  8228. left: {
  8229. 'top-info': o.HELP_DESKTOP_PANORAMA_1A,
  8230. 'bottom-info': o.HELP_DESKTOP_PANORAMA_1B,
  8231. 'big-image': 'images/nav_help_mouse_drag_left.png',
  8232. keyboard: 'images/nav_help_keyboard_left_right.png'
  8233. },
  8234. middle: {
  8235. 'top-info': o.HELP_DESKTOP_PANORAMA_2A,
  8236. 'bottom-info': o.HELP_DESKTOP_PANORAMA_2B,
  8237. 'big-image': 'images/nav_help_mouse_click.png',
  8238. keyboard: 'images/nav_help_keyboard_up_down.png'
  8239. },
  8240. right: {
  8241. 'top-info': o.HELP_DESKTOP_PANORAMA_3A,
  8242. 'bottom-info': o.HELP_DESKTOP_PANORAMA_3B,
  8243. 'big-image': 'images/nav_help_mouse_zoom.png',
  8244. keyboard: 'images/nav_help_zoom_keys.png'
  8245. }
  8246. },
  8247. mobile: {
  8248. left: {
  8249. 'top-info': o.HELP_MOBILE_PANORAMA_1,
  8250. 'big-image': 'images/nav_help_gesture_drag.png'
  8251. },
  8252. middle: {
  8253. 'top-info': o.HELP_MOBILE_PANORAMA_2,
  8254. 'big-image': 'images/nav_help_gesture_tap.png'
  8255. },
  8256. right: {
  8257. 'top-info': o.HELP_MOBILE_3,
  8258. 'big-image': 'images/nav_help_gesture_pinch.png'
  8259. }
  8260. }
  8261. }),
  8262. (this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  8263. desktop: {
  8264. left: {
  8265. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_1A,
  8266. 'bottom-info': o.HELP_DESKTOP_DOLLHOUSE_1B,
  8267. 'big-image': 'images/nav_help_mouse_drag_left.png',
  8268. keyboard: 'images/nav_help_keyboard_all.png'
  8269. },
  8270. middle: {
  8271. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_2A,
  8272. 'big-image': 'images/nav_help_mouse_position_right.png'
  8273. },
  8274. right: {
  8275. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_3A,
  8276. 'big-image': 'images/nav_help_mouse_zoom.png'
  8277. }
  8278. },
  8279. mobile: {
  8280. left: {
  8281. 'top-info': o.HELP_MOBILE_DOLLHOUSE_1,
  8282. 'big-image': 'images/nav_help_gesture_drag.png'
  8283. },
  8284. middle: {
  8285. 'top-info': o.HELP_MOBILE_DOLLHOUSE_2,
  8286. 'big-image': 'images/nav_help_gesture_position_two_finger.png'
  8287. },
  8288. right: {
  8289. 'top-info': o.HELP_MOBILE_3,
  8290. 'big-image': 'images/nav_help_gesture_pinch.png'
  8291. }
  8292. }
  8293. }),
  8294. (this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8295. desktop: {
  8296. left: {
  8297. 'top-info': o.HELP_DESKTOP_FLOORPLAN_1A,
  8298. 'big-image': 'images/nav_help_mouse_position_left.png'
  8299. },
  8300. middle: {
  8301. 'top-info': o.HELP_DESKTOP_FLOORPLAN_2A,
  8302. 'bottom-info': o.HELP_DESKTOP_FLOORPLAN_2B,
  8303. 'big-image': 'images/nav_help_mouse_drag_right.png',
  8304. keyboard: 'images/nav_help_keyboard_left_right.png'
  8305. },
  8306. right: {
  8307. 'top-info': o.HELP_DESKTOP_FLOORPLAN_3A,
  8308. 'bottom-info': o.HELP_DESKTOP_FLOORPLAN_3B,
  8309. 'big-image': 'images/nav_help_mouse_zoom.png',
  8310. keyboard: 'images/nav_help_keyboard_up_down.png'
  8311. }
  8312. },
  8313. mobile: {
  8314. left: {
  8315. 'top-info': o.HELP_MOBILE_FLOORPLAN_1,
  8316. 'big-image': 'images/nav_help_gesture_position.png'
  8317. },
  8318. middle: {
  8319. 'top-info': o.HELP_MOBILE_FLOORPLAN_2,
  8320. 'big-image': 'images/nav_help_gesture_drag_two_finger.png'
  8321. },
  8322. right: {
  8323. 'top-info': o.HELP_MOBILE_3,
  8324. 'big-image': 'images/nav_help_gesture_pinch.png'
  8325. }
  8326. }
  8327. }),
  8328. (this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA]))),
  8329. (this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8330. 'top-info': o.HELP_DESKTOP_360_2A,
  8331. 'bottom-info': o.HELP_DESKTOP_360_2B,
  8332. 'big-image': 'images/nav_help_click_inside.png',
  8333. keyboard: 'images/nav_help_inside_key.png'
  8334. }),
  8335. (this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8336. 'top-info': o.HELP_MOBILE_360_2,
  8337. 'big-image': 'images/nav_help_tap_inside.png'
  8338. }),
  8339. (this.assets[a.MORE_HELP] = {
  8340. desktop: {
  8341. 'more-help-hlr': {
  8342. 'top-info': o.HELP_MORE_HLR_A,
  8343. 'big-image': 'images/nav_help_expand.svg',
  8344. 'bottom-info': o.HELP_DESKTOP_MORE_HLR_B
  8345. },
  8346. 'more-help-dollhouse': {
  8347. 'top-info': o.HELP_MORE_DOLLHOUSE_A,
  8348. 'big-image': 'images/nav_help_dollhouse.svg',
  8349. 'bottom-info': o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8350. },
  8351. 'more-help-floors': {
  8352. 'top-info': o.HELP_MORE_FLOORS_A,
  8353. 'big-image': 'images/nav_help_floor picker.svg',
  8354. 'bottom-info': o.HELP_DESKTOP_MORE_FLOORS_B
  8355. },
  8356. 'more-help-tag': {
  8357. 'top-info': o.HELP_MORE_TAG_A,
  8358. 'big-image': 'images/nav_help_tag.svg',
  8359. 'bottom-info': o.HELP_DESKTOP_MORE_TAG_B
  8360. },
  8361. 'more-help-zoom': {
  8362. 'top-info': o.HELP_MORE_ZOOM_A,
  8363. 'big-image': 'images/nav_help_zoom.svg',
  8364. 'bottom-info': o.HELP_DESKTOP_MORE_ZOOM_B
  8365. },
  8366. 'more-help-tour': {
  8367. 'top-info': o.HELP_MORE_TOUR_A,
  8368. 'big-image': 'images/nav_help_play.png',
  8369. 'bottom-info': o.HELP_DESKTOP_MORE_TOUR_B
  8370. },
  8371. 'more-help-inside': {
  8372. 'top-info': o.HELP_MORE_INSIDE_A,
  8373. 'big-image': 'images/nav_help_inside.svg',
  8374. 'bottom-info': o.HELP_DESKTOP_MORE_INSIDE_B
  8375. },
  8376. 'more-help-vr': {
  8377. 'top-info': o.HELP_MORE_VR_A,
  8378. 'big-image': 'images/nav_help_vr.svg',
  8379. 'bottom-info': o.HELP_DESKTOP_MORE_VR_B
  8380. },
  8381. 'more-help-360': {
  8382. 'top-info': o.HELP_MORE_360_A,
  8383. 'big-image': 'images/nav_help_360.svg',
  8384. 'bottom-info': o.HELP_DESKTOP_MORE_360_B
  8385. },
  8386. 'more-help-fullscreen': {
  8387. 'top-info': o.HELP_MORE_FULLSCREEN_A,
  8388. 'big-image': 'images/nav_help_fullscreen.svg',
  8389. 'bottom-info': o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8390. }
  8391. },
  8392. mobile: {
  8393. 'more-help-hlr': {
  8394. 'top-info': o.HELP_MORE_HLR_A,
  8395. 'big-image': 'images/nav_help_expand.svg',
  8396. 'bottom-info': o.HELP_DESKTOP_MORE_HLR_B
  8397. },
  8398. 'more-help-dollhouse': {
  8399. 'top-info': o.HELP_MORE_DOLLHOUSE_A,
  8400. 'big-image': 'images/nav_help_dollhouse.svg',
  8401. 'bottom-info': o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8402. },
  8403. 'more-help-floors': {
  8404. 'top-info': o.HELP_MORE_FLOORS_A,
  8405. 'big-image': 'images/nav_help_floor picker.svg',
  8406. 'bottom-info': o.HELP_DESKTOP_MORE_FLOORS_B
  8407. },
  8408. 'more-help-tag': {
  8409. 'top-info': o.HELP_MORE_TAG_A,
  8410. 'big-image': 'images/nav_help_tag.svg',
  8411. 'bottom-info': o.HELP_MOBILE_MORE_TAG_B
  8412. },
  8413. 'more-help-tour': {
  8414. 'top-info': o.HELP_MORE_TOUR_A,
  8415. 'big-image': 'images/nav_help_play.png',
  8416. 'bottom-info': o.HELP_DESKTOP_MORE_TOUR_B
  8417. },
  8418. 'more-help-inside': {
  8419. 'top-info': o.HELP_MORE_INSIDE_A,
  8420. 'big-image': 'images/nav_help_inside.svg',
  8421. 'bottom-info': o.HELP_MOBILE_MORE_INSIDE_B
  8422. },
  8423. 'more-help-vr': {
  8424. 'top-info': o.HELP_MORE_VR_A,
  8425. 'big-image': 'images/webvr.svg',
  8426. 'bottom-info': o.HELP_MOBILE_MORE_VR_B
  8427. },
  8428. 'more-help-360': {
  8429. 'top-info': o.HELP_MORE_360_A,
  8430. 'big-image': 'images/nav_help_360.svg',
  8431. 'bottom-info': o.HELP_MOBILE_MORE_360_B
  8432. }
  8433. }
  8434. }),
  8435. (this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8436. desktop: {
  8437. left: {
  8438. 'top-info': o.ROTATE,
  8439. 'big-image': 'images/nav_help_mouse_drag_left.png',
  8440. keyboard: 'images/nav_help_keyboard_left_right.png'
  8441. },
  8442. middle: {
  8443. 'top-info': o.MOVE,
  8444. 'big-image': 'images/nav_help_mouse_click.png',
  8445. keyboard: 'images/nav_help_keyboard_up_down.png'
  8446. },
  8447. right: {
  8448. 'top-info': o.PLAY,
  8449. 'big-image': 'images/Desktop-help-play-button.svg',
  8450. keyboard: 'images/Desktop-help-spacebar-2.svg'
  8451. }
  8452. },
  8453. mobile: {
  8454. left: {
  8455. 'top-info': o.ROTATE,
  8456. 'big-image': 'images/nav_help_gesture_drag.png'
  8457. },
  8458. middle: {
  8459. 'top-info': o.MOVE,
  8460. 'big-image': 'images/nav_help_gesture_tap.png'
  8461. },
  8462. right: {
  8463. 'top-info': o.PLAY,
  8464. 'big-image': 'images/mobile-help-play-button.svg'
  8465. }
  8466. }
  8467. }),
  8468. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]]))),
  8469. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle),
  8470. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle),
  8471. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]]))),
  8472. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left),
  8473. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left)
  8474. }
  8475. },
  8476. fill: function (e, t, i) {
  8477. n.call(this, e, t, i, !0)
  8478. },
  8479. clear: function (e, t, i) {
  8480. n.call(this, e, t, i, !1)
  8481. }
  8482. }
  8483. },
  8484. {
  8485. '../enum/HelpModalSize': 27,
  8486. '../enum/HelpModalType': 28,
  8487. '../enum/Viewmode': 51,
  8488. '../localization/localize': 108,
  8489. '../util/browser': 182
  8490. }
  8491. ],
  8492. 76: [
  8493. function (e, t, i) {
  8494. 'use strict'
  8495. t.exports = Object.freeze({
  8496. OPENED: 'share.open',
  8497. CLOSED: 'share.closed',
  8498. LINK_CLICKED: 'share.linked'
  8499. })
  8500. },
  8501. {}
  8502. ],
  8503. 77: [
  8504. function (e, t, i) {
  8505. 'use strict'
  8506. function n(n) {
  8507. function e(e, t) {
  8508. var i = 'top=' + (window.screenY + ($('#player').height() - t) / 2) + ',left=' + (window.screenX + ($('#player').width() - e) / 2) + ',width=' + e + ',height=' + t
  8509. I.emit(l.LINK_CLICKED, {
  8510. channel: n
  8511. }),
  8512. window.open(C[n], 'shareWindow', i)
  8513. }
  8514. switch (n) {
  8515. case A.FACEBOOK:
  8516. e(580, 420)
  8517. break
  8518. case A.TWITTER:
  8519. e(550, 440)
  8520. break
  8521. case A.MAIL:
  8522. I.emit(l.LINK_CLICKED, {
  8523. channel: 'email'
  8524. }),
  8525. window.open(C[n], '_blank')
  8526. break
  8527. case A.LINKEDIN:
  8528. }
  8529. }
  8530. function r(e) {
  8531. I.emit(l.LINK_CLICKED, {
  8532. channel: 'copylink'
  8533. })
  8534. var t = document.createRange()
  8535. t.selectNodeContents(v)
  8536. var i = window.getSelection()
  8537. i.removeAllRanges(), i.addRange(t), document.execCommand('copy'), y.classList.remove('hidden'), v.classList.add('highlighted')
  8538. }
  8539. function o(e) {
  8540. ;(e && (e.stopPropagation(), e.target === v)) || (window.getSelection().removeAllRanges(), v.classList.remove('highlighted'), y.classList.add('hidden'))
  8541. }
  8542. var a = e('../../util/browser'),
  8543. s = e('../../localization/localize'),
  8544. l = e('./ShareEvents'),
  8545. c = e('../../util/common'),
  8546. h = e('events').EventEmitter,
  8547. u = document.getElementById('sharing'),
  8548. d = document.getElementById('share-modal'),
  8549. p = document.getElementById('share-close'),
  8550. f = document.getElementById('facebook-share'),
  8551. g = document.getElementById('twitter-share'),
  8552. m = document.getElementById('mail-share'),
  8553. v = document.getElementById('share-url-text'),
  8554. y = document.getElementById('copy-success'),
  8555. A = Object.freeze({
  8556. FACEBOOK: 'facebook',
  8557. TWITTER: 'twitter',
  8558. MAIL: 'mail',
  8559. LINKEDIN: 'linkedin'
  8560. }),
  8561. C = {}
  8562. ;(C[A.FACEBOOK] = 'http://www.facebook.com/sharer.php?u=' + encodeURIComponent(window.location.href + '&utm_source=1') + '&t='),
  8563. (C[A.TWITTER] = 'http://twitter.com/intent/tweet?text='),
  8564. (C[A.MAIL] = 'mailto:?subject=')
  8565. var I = {
  8566. init: function (e) {
  8567. var t = encodeURIComponent(s.SHARE_EXPLORE + e + ' ' + s.SHARE_AT + ' ')
  8568. ;(C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + '&utm_source=1')),
  8569. (C[A.TWITTER] += t + encodeURIComponent(window.location.href + '&utm_source=2 ' + s.SHARE_WITH + ' #port')),
  8570. (C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + '&body=' + t + encodeURIComponent(window.location.href + '&utm_source=3')),
  8571. u.addEventListener('click', this.toggle.bind(this)),
  8572. p.addEventListener('click', this.hide.bind(this)),
  8573. v.addEventListener('click', r),
  8574. d.addEventListener('click', o),
  8575. f.addEventListener('click', n.bind(this, A.FACEBOOK)),
  8576. g.addEventListener('click', n.bind(this, A.TWITTER)),
  8577. m.addEventListener('click', n.bind(this, A.MAIL)),
  8578. (v.textContent = window.location.href + '&utm_source=4'),
  8579. d.classList.add(a.isMobile() ? 'mobile' : 'desktop'),
  8580. u.classList.remove('hidden')
  8581. },
  8582. show: function () {
  8583. this.emit(l.OPENED), d.classList.add('fadeIn')
  8584. },
  8585. hide: function () {
  8586. d.classList.contains('fadeIn') && (this.emit(l.CLOSED), document.selection && document.selection.empty(), window.getSelection().removeAllRanges(), o(), d.classList.remove('fadeIn'))
  8587. },
  8588. toggle: function () {
  8589. d.classList.contains('fadeIn') ? this.hide() : this.show()
  8590. }
  8591. }
  8592. c.extendObject(I, h.prototype), (t.exports = I)
  8593. },
  8594. {
  8595. '../../localization/localize': 108,
  8596. '../../util/browser': 182,
  8597. '../../util/common': 185,
  8598. './ShareEvents': 76,
  8599. events: 202
  8600. }
  8601. ],
  8602. 78: [
  8603. function (e, t, i) {
  8604. 'use strict'
  8605. t.exports = Object.freeze({
  8606. OPENED: 'terms.opened',
  8607. CLOSED: 'terms.closed'
  8608. })
  8609. },
  8610. {}
  8611. ],
  8612. 79: [
  8613. function (e, t, i) {
  8614. 'use strict'
  8615. var n = e('./TermsEvent'),
  8616. r = e('../../localization/localize'),
  8617. o = e('../../analytics'),
  8618. a = e('../../util/ajax'),
  8619. s = e('../../util/common'),
  8620. l = e('events').EventEmitter,
  8621. c = document.getElementById('terms-modal'),
  8622. h = {
  8623. init: function () {
  8624. $('.footer-terms').on(
  8625. 'click',
  8626. function (e) {
  8627. e.preventDefault(), this.show()
  8628. }.bind(this)
  8629. ),
  8630. $('#terms-modal .close').on('click', this.hide.bind(this))
  8631. },
  8632. show: function () {
  8633. this.emit(n.OPENED),
  8634. a
  8635. .get('static/' + r.TERMS_TEXT_FILE)
  8636. .done(function (e) {
  8637. var t = $('#terms-text').html(e)
  8638. o.track('showcase_gui', {
  8639. gui_action: 'click_terms_button',
  8640. interaction_source: 'gui'
  8641. }),
  8642. t.find('a').attr('target', '_blank')
  8643. })
  8644. .fail(function () {
  8645. $('#terms-text').html('<h1>' + r.TERMS_OF_USE + '</h1><p>' + r.TERMS_FAIL)
  8646. }),
  8647. c.classList.add('fadeIn')
  8648. },
  8649. hide: function (e) {
  8650. e && e.preventDefault(), c.classList.contains('fadeIn') && this.emit(n.CLOSED), c.classList.remove('fadeIn')
  8651. }
  8652. }
  8653. s.extendObject(h, l.prototype), (t.exports = h)
  8654. },
  8655. {
  8656. '../../analytics': 4,
  8657. '../../localization/localize': 108,
  8658. '../../util/ajax': 181,
  8659. '../../util/common': 185,
  8660. './TermsEvent': 78,
  8661. events: 202
  8662. }
  8663. ],
  8664. 80: [
  8665. function (e, t, i) {
  8666. 'use strict'
  8667. t.exports = Object.freeze({
  8668. OPEN_INFO: 'title.open.info',
  8669. CLOSE_INFO: 'title.close.info',
  8670. SHOW_INFO: 'title.show.info',
  8671. HIDE_INFO: 'title.hide.info',
  8672. LINK_CLICKED: 'title.link.click',
  8673. CONTACT_LINK_CLICKED: 'title.contact.click',
  8674. ORIGIN_LINK_CLICKED: 'title.origin.click'
  8675. })
  8676. },
  8677. {}
  8678. ],
  8679. 81: [
  8680. function (e, t, i) {
  8681. 'use strict'
  8682. var o = e('../../settings')
  8683. t.exports.init = function (e, t) {
  8684. o.tags.enabled &&
  8685. 0 !== Object.keys(e.tags).length &&
  8686. (function (t, i) {
  8687. function e(e) {
  8688. ;(t.shouldShowtags = 'show' === this.value), t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8689. }
  8690. document.getElementById('tag-toggles').classList.remove('hidden'), (document.getElementById('radio-tag-show').checked = !0)
  8691. for (var n = document.getElementById('tag-inputs').querySelectorAll('input'), r = 0; r < n.length; r++) n[r].addEventListener('change', e)
  8692. })(e, t)
  8693. }
  8694. },
  8695. {
  8696. '../../settings': 166
  8697. }
  8698. ],
  8699. 82: [
  8700. function (S, M, e) {
  8701. ;(function (e) {
  8702. 'use strict'
  8703. function i(e) {
  8704. return !(
  8705. !e ||
  8706. (l.inIframe() && document.referrer === e) ||
  8707. (E.classList.remove('hidden'),
  8708. (_.innerHTML = r.WEBVR_LEARN_MORE + ': '),
  8709. _.appendChild(
  8710. (function (e) {
  8711. var t = document.createElement('a')
  8712. 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
  8713. })(e)
  8714. ),
  8715. b.forEach(function (e) {
  8716. e.classList.add('share-link')
  8717. }),
  8718. 0)
  8719. )
  8720. }
  8721. function s(e, t) {
  8722. var i = e,
  8723. n = t
  8724. return function (e, t) {
  8725. i.push(t || n, e)
  8726. }
  8727. }
  8728. var l = S('../../util/browser'),
  8729. t = S('../../util/common'),
  8730. n = S('../../util/logger'),
  8731. r = S('../../localization/localize'),
  8732. o = S('./titleBarSettings'),
  8733. c = S('../../settings'),
  8734. a = S('./TitleEvents'),
  8735. h = S('events').EventEmitter,
  8736. u = new n(e),
  8737. d = document.querySelector('.pinTop.left'),
  8738. p = document.getElementsByClassName('title-container')[0],
  8739. f = document.getElementById('title-toggle').querySelector('i'),
  8740. g = document.getElementById('meta-info-wrapper'),
  8741. m = document.getElementById('meta-info'),
  8742. v = document.getElementById('meta-description'),
  8743. y = document.getElementsByClassName('contact-info')[0],
  8744. A = document.getElementById('contact-data'),
  8745. C = document.getElementById('addressTxt'),
  8746. I = document.getElementById('tag-toggles'),
  8747. E = document.getElementById('share-origin'),
  8748. _ = document.getElementById('share-link-wrapper'),
  8749. b = [m, g, p],
  8750. w = !1,
  8751. T = !1,
  8752. x = {
  8753. populate: function (e) {
  8754. if (
  8755. (function (e, t) {
  8756. return e && l.valueFromHash('title', 1) && 2 !== l.valueFromHash('mls', 0)
  8757. ? ((document.getElementsByClassName('titleText')[0].innerText = e),
  8758. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute('data-original-title', e),
  8759. t && 1 !== c.specialEdition && c.brand && !c.mls
  8760. ? (document.getElementById('cobrandTitle').innerText = t)
  8761. : (document.getElementsByClassName('co-brand')[0].classList.add('hidden'),
  8762. document.getElementById('gui-name').classList.add('noCoBrand'),
  8763. document.getElementById('cobrandTitle').classList.add('hidden')),
  8764. !0)
  8765. : (document.getElementById('model-title').classList.add('hidden'), !1)
  8766. })(DATA.name, e.coBrand)
  8767. ) {
  8768. if (
  8769. ((function (e) {
  8770. e ? ((w = !0), (v.innerHTML = e)) : v.classList.add('hidden')
  8771. })(e.description),
  8772. (function (e, t, i, n) {
  8773. if ((e || t || i) && c.brand && !l.valueFromHash('mls', !1)) {
  8774. w = !0
  8775. var r = [],
  8776. o = s(r, '<br>')
  8777. if ((e && o('<span id="contactName">' + e + '</span>'), t)) {
  8778. var a = n || t
  8779. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + '</a>' : '<span>' + a + '</span>')
  8780. }
  8781. i && o('<a id="email" href="mailTo:' + i + '">' + i + '</a>'), (r[0] = ''), (A.innerHTML = r.join(''))
  8782. } else y.classList.add('hidden')
  8783. })(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8784. (function (e) {
  8785. if ('string' == typeof e)
  8786. try {
  8787. e = JSON.parse(e)
  8788. } catch (e) {
  8789. return u.warn('Unable to parse address data'), C.parentElement.classList.add('hidden')
  8790. }
  8791. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8792. w = !0
  8793. var t = [],
  8794. i = s(t, ' ')
  8795. e.address_1 && i(e.address_1),
  8796. e.address_2 && i(e.address_2),
  8797. e.city && i(e.city, ', '),
  8798. e.state && i(e.state, ', '),
  8799. e.zip && i(e.zip, e.state ? ' ' : ', '),
  8800. (t[0] = ''),
  8801. (C.innerText = t.join(''))
  8802. } else C.parentElement.classList.add('hidden')
  8803. })(e.address),
  8804. w)
  8805. ) {
  8806. var t = document.createElement('br')
  8807. I.insertBefore(t, I.firstElementChild)
  8808. }
  8809. e.socialSharing && c.share.enabled && (T = i(e.url))
  8810. }
  8811. },
  8812. finishSetup: function (e) {
  8813. ;(w = w || !!e),
  8814. document.getElementById('title-toggle').addEventListener('click', x.toggleTitle.bind(x)),
  8815. w && p.addEventListener('click', x.toggleMeta.bind(x, !1)),
  8816. [].slice.call(v.querySelectorAll('a')).forEach(function (e) {
  8817. e.addEventListener('click', x.emit.bind(x, a.LINK_CLICKED))
  8818. }),
  8819. [].slice.call(y.querySelectorAll('a')).forEach(function (e) {
  8820. e.addEventListener(
  8821. 'click',
  8822. x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8823. contact_type: e.getAttribute('id')
  8824. })
  8825. )
  8826. }),
  8827. w || (T ? p.classList.add('share-only') : p.classList.add('no-meta'))
  8828. },
  8829. toggleMeta: function (e, t) {
  8830. var i = document.getElementById('model-title')
  8831. t && t.preventDefault()
  8832. var n = m.classList.contains('expand')
  8833. ;(e && !n) ||
  8834. (n
  8835. ? (b.forEach(function (e) {
  8836. e.classList.remove('expand')
  8837. }),
  8838. this.emit(a.CLOSE_INFO),
  8839. i.classList.remove('expand'))
  8840. : (b.forEach(function (e) {
  8841. e.classList.add('expand')
  8842. }),
  8843. i.classList.add('expand'),
  8844. this.emit(a.OPEN_INFO)))
  8845. },
  8846. setupToggling: function () {
  8847. ;(g.style.height = m.offsetHeight + 'px'),
  8848. m.addEventListener('transitionend', function () {
  8849. g.style.height = m.offsetHeight + 'px'
  8850. })
  8851. },
  8852. toggleTitle: function (e) {
  8853. e && e.preventDefault(),
  8854. d.classList.contains('closed')
  8855. ? (d.classList.add('open'),
  8856. f.classList.remove('icon-dpad-right'),
  8857. f.classList.add('icon-dpad-left'),
  8858. this.emit(a.SHOW_INFO),
  8859. setTimeout(function () {
  8860. d.classList.remove('closed'), d.classList.remove('open')
  8861. }, o.removeAnimationClasses))
  8862. : (d.classList.add('closed'), f.classList.remove('icon-dpad-left'), f.classList.add('icon-dpad-right'), this.emit(a.HIDE_INFO))
  8863. }
  8864. }
  8865. t.extendObject(x, h.prototype), (M.exports = x)
  8866. }).call(this, '/js/gui/title/titleBar.js')
  8867. },
  8868. {
  8869. '../../localization/localize': 108,
  8870. '../../settings': 166,
  8871. '../../util/browser': 182,
  8872. '../../util/common': 185,
  8873. '../../util/logger': 189,
  8874. './TitleEvents': 80,
  8875. './titleBarSettings': 83,
  8876. events: 202
  8877. }
  8878. ],
  8879. 83: [
  8880. function (e, t, i) {
  8881. 'use strict'
  8882. t.exports = Object.freeze({
  8883. minTooltipCharacters: 19,
  8884. removeAnimationClasses: 500
  8885. })
  8886. },
  8887. {}
  8888. ],
  8889. 84: [
  8890. function (e, t, i) {
  8891. 'use strict'
  8892. function n() {
  8893. settings.playTourNearBy ? v.playTourNearBy() : v.playTour()
  8894. y && clearTimeout(y), c(), E.removeClass('fadeIn')
  8895. }
  8896. function r() {
  8897. A.classList.contains('playing') &&
  8898. (v.stopTour(),
  8899. E.addClass('fadeIn'),
  8900. setTimeout(function () {
  8901. E.removeClass('fadeIn')
  8902. }, h.tourInteraction.showPauseButton),
  8903. M || (clearTimeout(y), (y = setTimeout(s, h.tourInteraction.showModal))),
  8904. setTimeout(function () {
  8905. A.classList.remove('playing')
  8906. }, h.tourInteraction.allowNextClick))
  8907. }
  8908. function o() {
  8909. v.tourInProgress && (v.stopTour(), v.endTourProgress(), A.classList.remove('playing'))
  8910. }
  8911. function a() {
  8912. _.is(':visible') ? n() : r()
  8913. }
  8914. function s() {
  8915. //去掉导览结束时的提示
  8916. /* if (!h.tourInteraction.disabled) {
  8917. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8918. T.addClass("fadeIn tour " + p.deviceType);
  8919. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8920. if (!h.tourInteraction.smallModal)
  8921. 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,
  8922. p.fill(x, g.TOUR_INTERACTION[e]),
  8923. T.addClass(e);
  8924. T.addClass(t)
  8925. } */
  8926. }
  8927. function l(e, t) {
  8928. if (t) {
  8929. if ($.contains($('.toolRight')[0], t.target)) return //add 防止编辑时input 空格开始导览
  8930. var i = 'keydown' === t.type,
  8931. n = t.which === u.SPACE || v.tourIsPlaying
  8932. ;(i && n) || e || (M = !0), v.atEndOfTour() && c(), !v.tourIsPlaying && v.tourInProgress && (E.removeClass('fadeIn'), c(), t.which !== u.SPACE && o()), i && n && a()
  8933. }
  8934. }
  8935. function c() {
  8936. T.removeClass('fadeIn')
  8937. }
  8938. var h = (e('../util/browser'), e('../settings')),
  8939. u = e('../enum/Keys'),
  8940. d = e('../enum/Viewmode'),
  8941. p = (e('./helpManager'), e('./populateModal')),
  8942. f = e('../enum/DirectorEvents'),
  8943. g = e('../enum/HelpModalType'),
  8944. m = e('../enum/HelpModalSize'),
  8945. v = null,
  8946. y = null,
  8947. A = document.getElementById('pause-overlay'),
  8948. C = document.getElementById('player'),
  8949. I = document.getElementById('gui'),
  8950. E = $('#pause-icon').eq(0),
  8951. _ = $('#play').eq(0),
  8952. b = $('#playHead').eq(0),
  8953. w = $('.rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan').toArray(),
  8954. T = $('#interaction-modal').eq(0),
  8955. x = $('#interaction-modal .interaction').toArray(),
  8956. S = ['touchstart', 'mousedown', 'pointerdown'],
  8957. M = !1
  8958. ;(t.exports.init = function (e) {
  8959. ;(v = e),
  8960. S.forEach(function (t) {
  8961. C.addEventListener(t, l.bind(this, !1), !0),
  8962. I.addEventListener(t, l.bind(this, !0), !0),
  8963. A.addEventListener(t, r, !0),
  8964. w.forEach(function (e) {
  8965. e.addEventListener(t, o, !0)
  8966. }),
  8967. $('#drawer img').on(t, o)
  8968. }),
  8969. document.addEventListener('keydown', l.bind(this, !1), !0),
  8970. v.on(f.TourStart, function () {
  8971. A.classList.add('playing')
  8972. })
  8973. }),
  8974. (t.exports.play = n),
  8975. (t.exports.pause = r),
  8976. (t.exports.pauseWithoutCTA = o),
  8977. (t.exports.togglePlay = a),
  8978. (t.exports.stopTour = function () {
  8979. b.hasClass('playing') && (clearTimeout(y), v.atEndOfTour() ? (A.classList.remove('playing'), s()) : E.removeClass('fadeIn'))
  8980. }),
  8981. (t.exports.dismissModal = c)
  8982. },
  8983. {
  8984. '../enum/DirectorEvents': 23,
  8985. '../enum/HelpModalSize': 27,
  8986. '../enum/HelpModalType': 28,
  8987. '../enum/Keys': 30,
  8988. '../enum/Viewmode': 51,
  8989. '../settings': 166,
  8990. '../util/browser': 182,
  8991. './helpManager': 68,
  8992. './populateModal': 75
  8993. }
  8994. ],
  8995. 85: [
  8996. function (e, t, i) {
  8997. 'use strict'
  8998. t.exports = Object.freeze({
  8999. OPENED: 'vr.modal.opened',
  9000. LAUNCH: 'vr.modal.launch',
  9001. CLOSED: 'vr.modal.closed',
  9002. NEXT: 'vr.modal.next',
  9003. PREV: 'vr.modal.prev',
  9004. STORE: 'vr.modal.store',
  9005. falseICECHOSEN: 'vr.modal.device'
  9006. })
  9007. },
  9008. {}
  9009. ],
  9010. 86: [
  9011. function (e, t, i) {
  9012. 'use strict'
  9013. var h = e('../../util/browser'),
  9014. u = e('../../enum/VRApps'),
  9015. n = e('../../enum/VRPlatforms'),
  9016. d = e('../../util/ajax'),
  9017. p = e('../../settings'),
  9018. r = {}
  9019. for (var o in ((r[u.CardboardAndroid] = 'https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri='),
  9020. (r[u.CardboardIOS] = 'https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri='),
  9021. (r[u.GearVR] = 'https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri='),
  9022. u)) {
  9023. var a = u[o]
  9024. r[a] += encodeURIComponent(document.referrer + '&display=' + a)
  9025. }
  9026. var s,
  9027. f = {},
  9028. g = (-1 === (s = window.location.host).indexOf('.port.com') && -1 === s.indexOf('localhost') && (s = 'my.port.com'), 'https://' + s)
  9029. ;(t.exports.init = function (e, t, o) {
  9030. function a(e, t, i, n) {
  9031. function r() {
  9032. return '&utm_medium=' + (h.inIframe() ? 'embed' : 'direct') + ('&utm_source=' + s) + ('&utm_showcase_session_id=' + o)
  9033. }
  9034. return h.valueFromHash('vrcoll', !1)
  9035. ? l + '&sids=' + t + '&lsid=' + t + '&ln=' + encodeURIComponent(i) + '&ld=' + encodeURIComponent(n) + '&display=' + e + r()
  9036. : c + '&m=' + t + '&display=' + e + r()
  9037. }
  9038. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href),
  9039. l = g + '/vr/dlist/?ret=' + s,
  9040. c = g + '/vr/show/?ret=' + s
  9041. switch (e) {
  9042. case n.IOS:
  9043. !(function (t, e, i, n) {
  9044. var r = a(t, e, i, n),
  9045. o = {
  9046. responseType: 'json',
  9047. data: {
  9048. branch_key: p.appConfig.branch_key,
  9049. data: {
  9050. m: e,
  9051. full_url: r,
  9052. $desktop_url: '',
  9053. $og_app_id: '331853976762864119',
  9054. $og_title: i,
  9055. $og_description: n,
  9056. $og_image_url: location.origin + '/api/v1/player/models/' + e + '/thumb',
  9057. $canonical_url: window.location.href
  9058. }
  9059. }
  9060. }
  9061. d.post('https://api.branch.io/v1/url', o)
  9062. .done(function (e) {
  9063. f[t] = e.url
  9064. })
  9065. .fail(
  9066. function (e) {
  9067. f[t] = e
  9068. }.bind(this, r)
  9069. )
  9070. })(u.CardboardIOS, t.sid, t.name, t.summary)
  9071. break
  9072. default:
  9073. !(function (e, t, i) {
  9074. for (var n in u) {
  9075. var r = u[n],
  9076. o = a(r, e, t, i)
  9077. f[r] = o
  9078. }
  9079. })(t.sid, t.name, t.summary)
  9080. }
  9081. }),
  9082. (t.exports.launch = function (e) {
  9083. var t = f[e]
  9084. window.open(t, '_blank')
  9085. }),
  9086. (t.exports.launchStore = function (e) {
  9087. var t = r[e]
  9088. window.open(t, '_blank')
  9089. })
  9090. },
  9091. {
  9092. '../../enum/VRApps': 46,
  9093. '../../enum/VRPlatforms': 49,
  9094. '../../settings': 166,
  9095. '../../util/ajax': 181,
  9096. '../../util/browser': 182
  9097. }
  9098. ],
  9099. 87: [
  9100. function (e, t, i) {
  9101. 'use strict'
  9102. function c(e) {
  9103. var t
  9104. switch (e) {
  9105. case y.IOS:
  9106. return 9 < (t = g.iosVersion()).major || (9 === t.major && 1 <= t.minor)
  9107. case y.Android:
  9108. return 4 < (t = g.androidVersion()).major || (4 === t.major && 4 < t.minor) || (4 === t.major && 4 === t.minor && 4 <= t.patch)
  9109. }
  9110. return !1
  9111. }
  9112. function h(e) {
  9113. switch (e) {
  9114. case y.Android:
  9115. x.filter('.cardboard').off().on('click', q.cardboardAndroid), x.filter('.gearvr').off().on('click', q.gear), n(k, U, 'logo-button', 'same-line')
  9116. break
  9117. case y.UnsupportedAndroid:
  9118. n('', H, '', '')
  9119. break
  9120. case y.IOS:
  9121. x.filter('.cardboard').off().on('click', q.cardboardIOS), n(k, '', 'logo-button', '')
  9122. break
  9123. case y.Desktop:
  9124. 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()
  9125. }
  9126. }
  9127. function u(e) {
  9128. $('.p1, .p2, .p3').hide(),
  9129. l.insertAfter(T),
  9130. w.removeClass('front-page'),
  9131. w.removeClass('details-page'),
  9132. w.removeClass('lastPage'),
  9133. x.removeClass('logo-button'),
  9134. x.removeClass('same-line'),
  9135. T.removeClass('headsetOptions'),
  9136. S.attr('src', ''),
  9137. S.filter('.second').removeClass('gear'),
  9138. S.css('display', 'inline-block'),
  9139. S.off(),
  9140. M.filter('.second').css('display', ''),
  9141. O.css('display', 'none'),
  9142. $('.p' + (e + 1) + _).show(),
  9143. S.filter('.third').insertBefore(M.filter('.third'))
  9144. }
  9145. function n(e, t, i, n) {
  9146. w.addClass('front-page'),
  9147. S.filter('.first').attr('src', e),
  9148. S.filter('.second').attr('src', t),
  9149. x.filter('.first').addClass(i),
  9150. x.filter('.second').addClass(i),
  9151. x.addClass(n),
  9152. '.show-desktop' === _ && T.insertAfter(l)
  9153. }
  9154. function r(e, t, i) {
  9155. T.addClass('headsetOptions'),
  9156. x.off(),
  9157. S.filter('.second').attr('src', t),
  9158. O.css('display', 'block'),
  9159. M.filter('.second').css('display', 'none'),
  9160. O.on('click', function () {
  9161. u(b.Title), h(y.Desktop)
  9162. }),
  9163. e &&
  9164. (X.emit(C.falseICECHOSEN, {
  9165. name: v.GearVR
  9166. }),
  9167. S.filter('.first').attr('src', e),
  9168. S.filter('.second').addClass('gear'),
  9169. S.filter('.second').on('click', m.launchStore.bind(this, v.GearVR)),
  9170. Q.gearvr()),
  9171. i &&
  9172. (X.emit(C.falseICECHOSEN, {
  9173. name: v.Cardboard
  9174. }),
  9175. S.filter('.third').attr('src', i),
  9176. S.filter('.third').show(),
  9177. S.filter('.third').insertAfter(S.filter('.second')),
  9178. S.filter('.third').addClass('link'),
  9179. S.filter('.second').addClass('link'),
  9180. S.filter('.second').on('click', m.launchStore.bind(this, v.CardboardIOS)),
  9181. S.filter('.third').on('click', m.launchStore.bind(this, v.CardboardAndroid)),
  9182. Q.cardboard())
  9183. }
  9184. function d(e, t) {
  9185. switch (t) {
  9186. case y.IOS:
  9187. ;(j = W), (Y = G)
  9188. break
  9189. case y.Desktop:
  9190. e === b.Cardboard
  9191. ? ((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)))
  9192. : ((j = F), S.filter('.second').on('click', m.launchStore.bind(this, v.GearVR)), (Y = ''))
  9193. break
  9194. default:
  9195. Y = e === b.Cardboard ? ((j = H), G) : ((j = V), z)
  9196. }
  9197. }
  9198. function p(e, t, i) {
  9199. 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)
  9200. }
  9201. function f() {
  9202. var e = 1 < g.aspectRatio() && g.isMobile()
  9203. w.toggleClass('landscape', e).toggleClass('portrait', !e),
  9204. w.toggleClass('tiny', $('#player').height() <= o.narrowLandscapeHeight),
  9205. w.toggleClass('tinier', $('#player').height() <= o.reallyNarrowLandscapeHeight)
  9206. }
  9207. var g = e('../../util/browser'),
  9208. m = e('./vrLink'),
  9209. v = e('../../enum/VRApps'),
  9210. y = e('../../enum/VRPlatforms'),
  9211. A = e('../../enum/VRPages'),
  9212. C = e('./vrEvent'),
  9213. o = (e('../../settings'), e('../../constants')),
  9214. I = e('../../localization/localize'),
  9215. a = e('../../util/common'),
  9216. s = e('events').EventEmitter,
  9217. E = 0,
  9218. _ = null,
  9219. b = A.standard,
  9220. w = $('.vr-popup'),
  9221. l = w.find('.vr-popup-body'),
  9222. T = w.find('.vr-images'),
  9223. x = w.find('.img-container'),
  9224. S = w.find('.vr-sm-image'),
  9225. M = x.find('.vr-img-caption'),
  9226. R = $('.vr-buttons').find('.prev-button'),
  9227. P = $('.vr-buttons').find('.next-button'),
  9228. O = T.find('.front-close'),
  9229. L = $('.vr-page'),
  9230. D = w.find('img'),
  9231. N = 'images/apple-store.png',
  9232. F = 'images/badge-oculus.png',
  9233. B = 'images/badge-cardboard.png',
  9234. V = 'images/logo-samsung.png',
  9235. k = 'images/headset-cardboard.png',
  9236. U = 'images/headset-gearvr.png',
  9237. H = 'images/ico-android-robot.png',
  9238. z = 'images/ico-gearvr.png',
  9239. G = 'images/ico-vr.png',
  9240. W = 'images/apple-logo-white.svg',
  9241. j = null,
  9242. Y = null,
  9243. q = {},
  9244. X = {
  9245. init: function (e, t) {
  9246. function i(e) {
  9247. X.emit(C.STORE, {
  9248. type: e
  9249. }),
  9250. m.launchStore(e)
  9251. }
  9252. function n(e) {
  9253. switch ((e !== b.pageCount && (u(e), L.text(e + 1 + ' / ' + b.pageCount)), e)) {
  9254. case b.Title:
  9255. R.css('display', 'none'), P.text(a[e]), h(r)
  9256. break
  9257. case b.Cardboard:
  9258. R.css('display', 'block'), P.text(a[e]), x.filter('.cardboard').off(), x.filter('.gearvr').off(), d(e, r), p(k, j, Y)
  9259. break
  9260. case b.Gear:
  9261. P.text(a[e]), d(e, r), w.addClass('lastPage'), p(U, j, Y)
  9262. break
  9263. case b.pageCount:
  9264. w.removeClass('fadeIn'), X.emit(C.CLOSED)
  9265. }
  9266. D.filter("[src='']").hide()
  9267. }
  9268. var r = g.detectAndroid()
  9269. ? g.detectAndroidMobile() && c(y.Android)
  9270. ? (w.addClass('supported'), (_ = '.show-supported'), y.Android)
  9271. : (w.addClass('unsupported'), (_ = '.show-unsupported'), y.UnsupportedAndroid)
  9272. : g.detectIPhone() || g.detectIPod()
  9273. ? (w.addClass('ios'), (_ = '.show-ios'), (b = A.ios), y.IOS)
  9274. : (w.addClass('desktop'), (_ = '.show-desktop'), y.Desktop)
  9275. function o(e) {
  9276. X.emit(C.LAUNCH, {
  9277. vr_platform: r,
  9278. vr_app: e
  9279. }),
  9280. m.launch(e)
  9281. }
  9282. m.init(r, e, t),
  9283. r !== y.Desktop && w.addClass('mobile'),
  9284. (q.cardboardAndroid = o.bind(this, v.CardboardAndroid)),
  9285. (q.gear = o.bind(this, v.GearVR)),
  9286. (q.cardboardIOS = o.bind(this, v.CardboardIOS)),
  9287. f(),
  9288. $('.show-supported, .show-unsupported, .show-ios, .show-desktop').hide(),
  9289. $(_).show()
  9290. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS],
  9291. s = ['vr_modal_learn_more', 'vr_modal_next', 'vr_modal_done']
  9292. r === y.IOS && (a.splice(1, 1), s.splice(1, 1)),
  9293. $('#vr').on('click', function (e) {
  9294. e.preventDefault(),
  9295. window.vrEnabled ||
  9296. ((window.vrEnabled = !0),
  9297. this.classList.add('active'),
  9298. $('#gui div').not('#vrOff').addClass('vrHide'),
  9299. $('#vrOffImg').css({
  9300. display: 'inline-block'
  9301. }))
  9302. }),
  9303. $('#vrOff').on('click', function () {
  9304. ;(window.vrEnabled = !1),
  9305. $('#gui div').not('#vrOff').removeClass('vrHide'),
  9306. $('#vrOffImg').css({
  9307. display: 'none'
  9308. }),
  9309. $('#player canvas').css({
  9310. width: '',
  9311. height: ''
  9312. }),
  9313. $('#vr').removeClass('active')
  9314. })
  9315. var l = 'https://my.port.com/vr/show/?m=' + e.sid
  9316. r === y.IOS ? $('.cardboardLink').on('click', i.bind(this, v.CardboardIOS)) : $('.cardboardLink').on('click', i.bind(this, v.CardboardAndroid)),
  9317. $('.gearLink').on('click', i.bind(this, v.GearVR)),
  9318. $('span.modelLink').text(l),
  9319. R.on('click', function (e) {
  9320. X.emit(C.PREV), n(--E)
  9321. }),
  9322. P.on('click', function (e) {
  9323. P.text(),
  9324. X.emit(C.NEXT, {
  9325. nextAction: s[E]
  9326. }),
  9327. n(++E)
  9328. }),
  9329. w.find('.close').on('click', X.dismiss)
  9330. },
  9331. dismiss: function () {
  9332. w.hasClass('fadeIn') && (w.removeClass('fadeIn'), X.emit(C.CLOSED))
  9333. },
  9334. isDeviceSupported: c
  9335. }
  9336. a.extendObject(X, s.prototype), $(window).resize(f)
  9337. var Z,
  9338. K,
  9339. Q =
  9340. ((Z = M.filter('.first').find('.cardboard')),
  9341. (K = M.filter('.first').find('.gearvr')),
  9342. {
  9343. cardboard: function () {
  9344. K.addClass('hidden'), Z.removeClass('hidden')
  9345. },
  9346. gearvr: function () {
  9347. Z.addClass('hidden'), K.removeClass('hidden')
  9348. }
  9349. })
  9350. t.exports = X
  9351. },
  9352. {
  9353. '../../constants': 8,
  9354. '../../enum/VRApps': 46,
  9355. '../../enum/VRPages': 48,
  9356. '../../enum/VRPlatforms': 49,
  9357. '../../localization/localize': 108,
  9358. '../../settings': 166,
  9359. '../../util/browser': 182,
  9360. '../../util/common': 185,
  9361. './vrEvent': 85,
  9362. './vrLink': 86,
  9363. events: 202
  9364. }
  9365. ],
  9366. 88: [
  9367. function (e, t, i) {
  9368. 'use strict'
  9369. t.exports = Object.freeze({
  9370. OPENED: 'webvr.modal.opened',
  9371. SHOW_TERMS: 'webvr.footer.show.terms'
  9372. })
  9373. },
  9374. {}
  9375. ],
  9376. 89: [
  9377. function (B, V, e) {
  9378. ;(function (e) {
  9379. 'use strict'
  9380. function a() {
  9381. function t() {
  9382. p.isPresenting ||
  9383. (r.info('exiting webVR'),
  9384. c('webvr_exit_app'),
  9385. -1 === window.location.search.indexOf('&qs=1') ? (window.location = window.location + '&qs=1') : (window.location = window.location),
  9386. window.removeEventListener('vrdisplaypresentchange', t))
  9387. }
  9388. r.info('Headset mounted'), u.suspend()
  9389. var e = document.createElement('canvas')
  9390. for (e.getContext('webgl'), e.className = 'webvr-canvas', document.bgColor = '#000', document.body.style.backgroundColor = '#000'; document.body.firstChild; )
  9391. document.body.removeChild(document.body.firstChild)
  9392. document.body.appendChild(e),
  9393. c('webvr_enter_app'),
  9394. p
  9395. .requestPresent([
  9396. {
  9397. source: e,
  9398. predistorted: !0
  9399. }
  9400. ])
  9401. .catch(function (e) {
  9402. r.error('Failed to present: ' + e), c('webvr_exit_calibrate'), t()
  9403. }),
  9404. d.then(function () {
  9405. window.dispatchEvent(new Event('vrapp-start'))
  9406. }),
  9407. window.addEventListener('vrdisplaypresentchange', t)
  9408. }
  9409. function s() {
  9410. c('webvr_modal_close'),
  9411. _.find('.enter-button').off('click', a),
  9412. E.fadeOut(g.guiAnimationSpeed, function () {
  9413. _.toggleClass('hidden', !1), b.toggleClass('hidden', !0), f.exitFullscreen()
  9414. }),
  9415. I.fadeIn(g.guiAnimationSpeed)
  9416. }
  9417. function t() {
  9418. M.toggleClass('hidden', !0), S.toggleClass('hidden', !1)
  9419. }
  9420. function l() {
  9421. _.toggleClass('hidden'), b.toggleClass('hidden')
  9422. }
  9423. function c(e) {
  9424. var t = f.isLandscape() ? 'landscape' : 'portrait'
  9425. i.trackAlways('showcase_gui', {
  9426. gui_action: e,
  9427. orientation: t
  9428. })
  9429. }
  9430. function h() {
  9431. var e = f.isLandscape()
  9432. E.toggleClass('landscape', e).toggleClass('portrait', !e)
  9433. }
  9434. var u,
  9435. d,
  9436. p,
  9437. f = B('../../util/browser'),
  9438. g = B('../../settings'),
  9439. m = (B('./../gui'), B('../../enum/VRPlatforms')),
  9440. v = B('../../enum/VRApps'),
  9441. y = B('./../vr/vrLink'),
  9442. A = B('./WebVrEvent'),
  9443. i = B('../../analytics'),
  9444. C = (B('../../constants'), B('../../localization/localize')),
  9445. n = B('../../util/common'),
  9446. r = new (B('../../util/logger'))(e),
  9447. o = B('events').EventEmitter,
  9448. I = $('#gui'),
  9449. E = $('.webvr-popup'),
  9450. _ = $('.webvr-popup .page.p1'),
  9451. b = $('.webvr-popup .page.p2'),
  9452. w = E.find('.image'),
  9453. T = $('.webvr-popup .detail.headset'),
  9454. x = $('.webvr-popup .detail.phone'),
  9455. S = $('.webvr-popup .tab-content.webvr'),
  9456. M = $('.webvr-popup .tab-content.native'),
  9457. R = 'images/headset-cardboard.png',
  9458. P = 'https://madeby.google.com/vr/',
  9459. O = 'webvr_daydream_link',
  9460. L = P,
  9461. D = O,
  9462. N = {
  9463. init: function (e, t, i, n) {
  9464. function r(e) {
  9465. e.preventDefault(), o(e.currentTarget.id)
  9466. }
  9467. function o(i) {
  9468. F[i](),
  9469. Object.keys(F).map(function (e, t) {
  9470. $('#' + e).toggleClass('tabs-underlined', e === i)
  9471. })
  9472. }
  9473. ;(p = i),
  9474. (u = t),
  9475. y.init(m.Android, e, n),
  9476. h(),
  9477. new RegExp('daydream', 'i').test(p.displayName)
  9478. ? (o('tabdaydream'), w.filter('.device-headset-side').attr('src', 'images/device-daydream-side.png'), _.find('.title').text(C.localizeText('WEBVR_FOR_DAYDREAM')))
  9479. : (o('tabcardboard'), w.filter('.device-headset-side').attr('src', R), _.find('.title').text(C.localizeText('WEBVR_FOR_CARDBOARD'))),
  9480. $('#vr').on('click', function (e) {
  9481. e.preventDefault(),
  9482. c('click_webvr_button'),
  9483. E.is(':hidden') &&
  9484. (N.emit(A.OPENED),
  9485. I.fadeOut(g.guiAnimationSpeed),
  9486. E.fadeIn(g.guiAnimationSpeed),
  9487. (function () {
  9488. if (!d) {
  9489. var n = 'https://static.port.com/webvr/' + (f.valueFromHash('webvr') || g.appConfig.webvr_version) + '/js/main.js'
  9490. d = new Promise(function (e, t) {
  9491. var i = document.createElement('script')
  9492. ;(i.type = 'text/javascript'), (i.src = n), (i.onload = e), document.head.appendChild(i)
  9493. })
  9494. }
  9495. _.find('.enter-button').on('click', a)
  9496. })())
  9497. }),
  9498. $('.webvr-popup .close').on('click', function (e) {
  9499. e.preventDefault(), _.hasClass('hidden') ? (c('webvr_help_close'), l()) : s()
  9500. }),
  9501. $('#tabcardboard').on('click', r),
  9502. $('#tabdaydream').on('click', r),
  9503. $('#tabnative').on('click', r),
  9504. $('.webvr-popup .open-with-app').on('click', function (e) {
  9505. e.preventDefault(), c('webvr_learn_more'), o('tabnative'), l()
  9506. }),
  9507. $('.webvr-popup .help').on('click', function (e) {
  9508. e.preventDefault(), c(_.hasClass('hidden') ? 'webvr_help_close' : 'webvr_help_show'), l()
  9509. }),
  9510. $('.webvr-popup .terms').on('click', function (e) {
  9511. e.preventDefault(), c('webvr_click_terms'), s(), N.emit(A.SHOW_TERMS)
  9512. }),
  9513. T.on('click', function (e) {
  9514. e.preventDefault(), c(D), window.open(L, '_blank')
  9515. }),
  9516. x.on('click', function (e) {
  9517. e.preventDefault(), c('webvr_phone_link'), window.open('https://vr.google.com/daydream/phones/', '_blank')
  9518. }),
  9519. $('.webvr-popup .badge-cardboard').on('click', function (e) {
  9520. e.preventDefault(), c('webvr_cardboard_link'), y.launch(v.CardboardAndroid)
  9521. }),
  9522. $('.webvr-popup .badge-oculus').on('click', function (e) {
  9523. e.preventDefault(), c('webvr_oculus_link'), y.launch(v.GearVR)
  9524. })
  9525. }
  9526. },
  9527. F = {
  9528. tabcardboard: function () {
  9529. w.filter('.device-headset').attr('src', R),
  9530. w.filter('.device-phone').attr('src', 'images/ico-android-robot.png'),
  9531. (L = 'https://vr.google.com/cardboard/get-cardboard/'),
  9532. (D = 'webvr_cardboard_link'),
  9533. T.text(C.localizeText('VR_GOOGLE_CARDBOARD')),
  9534. x.text(C.localizeText('VR_COMPATIBLE_ANDROID_LONG')),
  9535. $('.webvr-popup .detail.daydream-label').toggleClass('hidden', !0),
  9536. t()
  9537. },
  9538. tabdaydream: function () {
  9539. w.filter('.device-headset').attr('src', 'images/device-daydream.png'),
  9540. w.filter('.device-phone').attr('src', 'images/device-pixel.png'),
  9541. (L = P),
  9542. (D = O),
  9543. T.text(C.localizeText('WEBVR_DAYDREAM_VIEW')),
  9544. x.text(C.localizeText('VR_NEED_DAYDREAM_PHONE')),
  9545. $('.webvr-popup .detail.daydream-label').toggleClass('hidden', !1),
  9546. t()
  9547. },
  9548. tabnative: function () {
  9549. w.filter('.badge-cardboard').attr('src', 'images/badge-cardboard.png'),
  9550. w.filter('.badge-oculus').attr('src', 'images/badge-oculus.png'),
  9551. M.toggleClass('hidden', !1),
  9552. S.toggleClass('hidden', !0)
  9553. }
  9554. }
  9555. n.extendObject(N, o.prototype), $(window).resize(h), (V.exports = N)
  9556. }).call(this, '/js/gui/webvr/webVRgui.js')
  9557. },
  9558. {
  9559. '../../analytics': 4,
  9560. '../../constants': 8,
  9561. '../../enum/VRApps': 46,
  9562. '../../enum/VRPlatforms': 49,
  9563. '../../localization/localize': 108,
  9564. '../../settings': 166,
  9565. '../../util/browser': 182,
  9566. '../../util/common': 185,
  9567. '../../util/logger': 189,
  9568. './../gui': 65,
  9569. './../vr/vrLink': 86,
  9570. './WebVrEvent': 88,
  9571. events: 202
  9572. }
  9573. ],
  9574. 90: [
  9575. function (e, t, i) {
  9576. 'use strict'
  9577. function n(e, t, i, n, r) {
  9578. ;(this.floorId = n || 0 === n ? n : -1), (this.roomId = r || ''), (this.labelId = e), (this.position = new o.Vector3().copy(t)), (this.text = i)
  9579. }
  9580. var o = e('three'),
  9581. r = e('../util/browser')
  9582. ;(n.prototype.build = function () {
  9583. var e = window.document.createElement('div')
  9584. r.isMobile() ? e.setAttribute('class', 'gui-floorplan-label gui-floorplan-label-mobile') : e.setAttribute('class', 'gui-floorplan-label')
  9585. var t = window.document.createElement('div')
  9586. t.setAttribute('class', 'gui-floorplan-label-text')
  9587. var i = window.document.createTextNode(this.text)
  9588. t.appendChild(i), e.appendChild(t), window.document.body.appendChild(e), (this.labelGui = e), (this.textBlock = t), $(this.labelGui).hide()
  9589. var n = window.getComputedStyle(this.labelGui)
  9590. this.initialTransform = n.transform || n.webkitTransform
  9591. }),
  9592. (t.exports = n)
  9593. },
  9594. {
  9595. '../util/browser': 182,
  9596. three: 217
  9597. }
  9598. ],
  9599. 91: [
  9600. function (e, t, i) {
  9601. 'use strict'
  9602. function n() {
  9603. ;(this.player = null), (this.modelManager = null), (this.container = null)
  9604. }
  9605. var c,
  9606. o,
  9607. r = e('three'),
  9608. a = (e('../util/common'), e('../enum/PlayerEvents')),
  9609. s = (e('../enum/DirectorEvents'), e('../enum/ModelManagerEvents')),
  9610. l = e('../settings'),
  9611. h = e('../enum/Viewmode'),
  9612. u = (e('../enum/WarpStyle'), e('../util/transitions'), e('../util/lerp'), e('../util/browser'))
  9613. ;(n.prototype.init = function (e, t, i) {
  9614. ;(this.player = e), (this.modelManager = t), (this.container = i), this.updateModel(), this.bindEvents()
  9615. }),
  9616. (n.prototype.bindEvents = function () {
  9617. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9618. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9619. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9620. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9621. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9622. }),
  9623. (n.prototype.updateModel = function () {
  9624. this.model = this.modelManager.getActiveModel()
  9625. }),
  9626. (n.prototype.handlePlayerViewChanged = function () {
  9627. this.updateLabelVisibility(), this.updateLabelDisplay()
  9628. }),
  9629. (n.prototype.getLabelsForFloor = function (t, i) {
  9630. return (
  9631. ((i = i || []).length = 0),
  9632. this.model.labels.forEach(
  9633. function (e) {
  9634. this.labelVisibleForFloor(e, t) && i.push(e)
  9635. }.bind(this)
  9636. ),
  9637. i
  9638. )
  9639. }),
  9640. (n.prototype.getLabelsForCurrentFloor = function (e) {
  9641. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9642. }),
  9643. (n.prototype.labelVisibleForFloor = function (e, t) {
  9644. var i =
  9645. (u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile) || (!u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop)
  9646. if (!this.model.showingLabels || !e.labelGui || !i) return !1
  9647. var n = e.floorId === this.model.floors.size() - 1
  9648. return this.model.allFloorsVisible ? n : e.floorId === t
  9649. }),
  9650. (n.prototype.updateLabelVisibility = function (e) {
  9651. this.model.labels.forEach(
  9652. function (e) {
  9653. this.supportedMode() && this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex)
  9654. ? this.showLabel(e, l.labels.fadeInDelay, l.labels.fadeInDuration)
  9655. : this.hideLabel(e, l.labels.fadeOutDelay, l.labels.fadeOutDuration)
  9656. }.bind(this)
  9657. )
  9658. }),
  9659. (n.prototype.showAllLabels = function (t, i) {
  9660. this.model.labels.forEach(
  9661. function (e) {
  9662. this.showLabel(e, t, i)
  9663. }.bind(this)
  9664. )
  9665. }),
  9666. (n.prototype.hideAllLabels = function (t, i) {
  9667. this.model.labels.forEach(
  9668. function (e) {
  9669. this.hideLabel(e, t, i)
  9670. }.bind(this)
  9671. )
  9672. }),
  9673. (n.prototype.showLabel = function (e, t, i) {
  9674. 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)))
  9675. }),
  9676. (n.prototype.hideLabel = function (e, t, i) {
  9677. e.visible && ((e.visible = !1), u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9678. }),
  9679. (n.prototype.supportedMode = function () {
  9680. return this.player.mode === h.FLOORPLAN
  9681. }),
  9682. (n.prototype.updateLabelDisplay =
  9683. (new r.Vector3(),
  9684. new r.Vector3(),
  9685. (o = []),
  9686. function () {
  9687. var e = this.player.getLabelScaleFactor(),
  9688. t = 1.2 * (1 - e) + 0.6,
  9689. i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop
  9690. this.getLabelsForCurrentFloor(o)
  9691. for (var n = 0; n < o.length; n++) {
  9692. var r = o[n]
  9693. this.supportedMode() &&
  9694. r.labelGui &&
  9695. (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9696. i <= e && r.text.length >= l.labels.minLengthForTruncate
  9697. ? (r.textBlock.innerText = r.text.substring(0, l.labels.truncateLength) + l.labels.truncateSuffix)
  9698. : (r.textBlock.innerText = r.text))
  9699. }
  9700. })),
  9701. (n.prototype.updateProjectedGuiElement =
  9702. ((c = new r.Vector3()),
  9703. new r.Vector3(),
  9704. function (e, t, i, n, r) {
  9705. t.style.fontSize = 100 * r + '%'
  9706. var o = 0.5 * $('#player').width(),
  9707. a = 0.5 * $('#player').height()
  9708. c.copy(i), c.project(this.player.camera)
  9709. var s = c.x * o + o,
  9710. l = -c.y * a + a
  9711. ;(s -= e.offsetWidth / 2), (l -= e.offsetHeight / 2), (e.style.left = s + 'px'), (e.style.top = l + 'px')
  9712. })),
  9713. (n.prototype.handleStartInside = function (e) {
  9714. this.updateLabelVisibility()
  9715. }),
  9716. (n.prototype.handleStartOutside = function () {
  9717. this.updateLabelVisibility()
  9718. }),
  9719. (t.exports = n)
  9720. },
  9721. {
  9722. '../enum/DirectorEvents': 23,
  9723. '../enum/ModelManagerEvents': 33,
  9724. '../enum/PlayerEvents': 40,
  9725. '../enum/Viewmode': 51,
  9726. '../enum/WarpStyle': 52,
  9727. '../settings': 166,
  9728. '../util/browser': 182,
  9729. '../util/common': 185,
  9730. '../util/lerp': 188,
  9731. '../util/transitions': 195,
  9732. three: 217
  9733. }
  9734. ],
  9735. 92: [
  9736. function (e, t, i) {
  9737. 'use strict'
  9738. Array.prototype.findIndex ||
  9739. (Array.prototype.findIndex = function (e) {
  9740. if (null == this) throw new TypeError('Array.prototype.findIndex called on null or undefined')
  9741. if ('function' != typeof e) throw new TypeError('predicate must be a function')
  9742. 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
  9743. return -1
  9744. }),
  9745. Array.prototype.find ||
  9746. Object.defineProperty(Array.prototype, 'find', {
  9747. value: function (e) {
  9748. if (null == this) throw new TypeError('"this" is null or not defined')
  9749. var t = Object(this),
  9750. i = t.length >>> 0
  9751. if ('function' != typeof e) throw new TypeError('predicate must be a function')
  9752. for (var n = arguments[1], r = 0; r < i; ) {
  9753. var o = t[r]
  9754. if (e.call(n, o, r, t)) return o
  9755. r++
  9756. }
  9757. }
  9758. })
  9759. },
  9760. {}
  9761. ],
  9762. 93: [
  9763. function (e, t, i) {
  9764. 'use strict'
  9765. var n,
  9766. r,
  9767. o,
  9768. a,
  9769. s,
  9770. l,
  9771. c,
  9772. h,
  9773. u,
  9774. d,
  9775. p,
  9776. f,
  9777. g,
  9778. m,
  9779. v,
  9780. y,
  9781. A,
  9782. C,
  9783. I,
  9784. E,
  9785. _,
  9786. b,
  9787. w,
  9788. T,
  9789. x,
  9790. S,
  9791. M,
  9792. R,
  9793. P,
  9794. O,
  9795. L,
  9796. D,
  9797. N,
  9798. F,
  9799. B,
  9800. V,
  9801. k,
  9802. U,
  9803. H,
  9804. z,
  9805. G,
  9806. W,
  9807. j,
  9808. Y,
  9809. q,
  9810. X,
  9811. Z,
  9812. K,
  9813. Q,
  9814. J,
  9815. ee = ee || {}
  9816. function te() {
  9817. ;(this.backgroundElement = document.createElement('div')),
  9818. r.extend(this.backgroundElement.style, {
  9819. backgroundColor: 'rgba(0,0,0,0.8)',
  9820. top: 0,
  9821. left: 0,
  9822. display: 'none',
  9823. zIndex: '1000',
  9824. opacity: 0,
  9825. WebkitTransition: 'opacity 0.2s linear'
  9826. }),
  9827. n.makeFullscreen(this.backgroundElement),
  9828. (this.backgroundElement.style.position = 'fixed'),
  9829. (this.domElement = document.createElement('div')),
  9830. r.extend(this.domElement.style, {
  9831. position: 'fixed',
  9832. display: 'none',
  9833. zIndex: '1001',
  9834. opacity: 0,
  9835. WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear'
  9836. }),
  9837. document.body.appendChild(this.backgroundElement),
  9838. document.body.appendChild(this.domElement)
  9839. var e = this
  9840. n.bind(this.backgroundElement, 'click', function () {
  9841. e.hide()
  9842. })
  9843. }
  9844. function ie(e, t, i) {
  9845. Object.defineProperty(e, t, {
  9846. get: function () {
  9847. return 'RGB' === this.__state.space || re(this, t, i), this.__state[t]
  9848. },
  9849. set: function (e) {
  9850. 'RGB' !== this.__state.space && (re(this, t, i), (this.__state.space = 'RGB')), (this.__state[t] = e)
  9851. }
  9852. })
  9853. }
  9854. function ne(e, t) {
  9855. Object.defineProperty(e, t, {
  9856. get: function () {
  9857. return 'HSV' === this.__state.space || oe(this), this.__state[t]
  9858. },
  9859. set: function (e) {
  9860. 'HSV' !== this.__state.space && (oe(this), (this.__state.space = 'HSV')), (this.__state[t] = e)
  9861. }
  9862. })
  9863. }
  9864. function re(e, t, i) {
  9865. if ('HEX' === e.__state.space) e.__state[t] = a.component_from_hex(e.__state.hex, i)
  9866. else {
  9867. if ('HSV' !== e.__state.space) throw 'Corrupted color state'
  9868. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9869. }
  9870. }
  9871. function oe(e) {
  9872. var t = a.rgb_to_hsv(e.r, e.g, e.b)
  9873. l.extend(e.__state, {
  9874. s: t.s,
  9875. v: t.v
  9876. }),
  9877. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : (e.__state.h = t.h)
  9878. }
  9879. function ae() {
  9880. if (((this.__state = o.apply(this, arguments)), !1 === this.__state)) throw 'Failed to interpret color arguments'
  9881. this.__state.a = this.__state.a || 1
  9882. }
  9883. function se(e) {
  9884. return -1 < (e = e.toString()).indexOf('.') ? e.length - e.indexOf('.') - 1 : 0
  9885. }
  9886. function le(e, t) {
  9887. ;(this.initialValue = e[t]), (this.domElement = document.createElement('div')), (this.object = e), (this.property = t), (this.__onChange = void 0), (this.__onFinishChange = void 0)
  9888. }
  9889. ;((t.exports = ee).gui = ee.gui || {}),
  9890. (ee.utils = ee.utils || {}),
  9891. (ee.controllers = ee.controllers || {}),
  9892. (ee.dom = ee.dom || {}),
  9893. (ee.color = ee.color || {}),
  9894. (ee.utils.css = {
  9895. load: function (e, t) {
  9896. var i = (t = t || document).createElement('link')
  9897. ;(i.type = 'text/css'), (i.rel = 'stylesheet'), (i.href = e), t.getElementsByTagName('head')[0].appendChild(i)
  9898. },
  9899. inject: function (e, t) {
  9900. t = t || document
  9901. var i = document.createElement('style')
  9902. ;(i.type = 'text/css'), (i.innerHTML = e), t.getElementsByTagName('head')[0].appendChild(i)
  9903. }
  9904. }),
  9905. (ee.utils.common =
  9906. ((Q = Array.prototype.forEach),
  9907. (J = Array.prototype.slice),
  9908. {
  9909. BREAK: {},
  9910. extend: function (i) {
  9911. return (
  9912. this.each(
  9913. J.call(arguments, 1),
  9914. function (e) {
  9915. for (var t in e) this.isUndefined(e[t]) || (i[t] = e[t])
  9916. },
  9917. this
  9918. ),
  9919. i
  9920. )
  9921. },
  9922. defaults: function (i) {
  9923. return (
  9924. this.each(
  9925. J.call(arguments, 1),
  9926. function (e) {
  9927. for (var t in e) this.isUndefined(i[t]) && (i[t] = e[t])
  9928. },
  9929. this
  9930. ),
  9931. i
  9932. )
  9933. },
  9934. compose: function () {
  9935. var i = J.call(arguments)
  9936. return function () {
  9937. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--) e = [i[t].apply(this, e)]
  9938. return e[0]
  9939. }
  9940. },
  9941. each: function (e, t, i) {
  9942. if (e)
  9943. if (Q && e.forEach && e.forEach === Q) e.forEach(t, i)
  9944. else if (e.length === e.length + 0) {
  9945. for (var n = 0, r = e.length; n < r; n++) if (n in e && t.call(i, e[n], n) === this.BREAK) return
  9946. } else for (var n in e) if (t.call(i, e[n], n) === this.BREAK) return
  9947. },
  9948. defer: function (e) {
  9949. setTimeout(e, 0)
  9950. },
  9951. toArray: function (e) {
  9952. return e.toArray ? e.toArray() : J.call(e)
  9953. },
  9954. isUndefined: function (e) {
  9955. return void 0 === e
  9956. },
  9957. isNull: function (e) {
  9958. return null === e
  9959. },
  9960. isNaN: function (e) {
  9961. return e != e
  9962. },
  9963. isArray:
  9964. Array.isArray ||
  9965. function (e) {
  9966. return e.constructor === Array
  9967. },
  9968. isObject: function (e) {
  9969. return e === Object(e)
  9970. },
  9971. isNumber: function (e) {
  9972. return e === e + 0
  9973. },
  9974. isString: function (e) {
  9975. return e === e + ''
  9976. },
  9977. isBoolean: function (e) {
  9978. return !1 === e || !0 === e
  9979. },
  9980. isFunction: function (e) {
  9981. return '[object Function]' === Object.prototype.toString.call(e)
  9982. }
  9983. })),
  9984. (ee.controllers.Controller =
  9985. (ee.utils.common.extend(le.prototype, {
  9986. onChange: function (e) {
  9987. return (this.__onChange = e), this
  9988. },
  9989. onFinishChange: function (e) {
  9990. return (this.__onFinishChange = e), this
  9991. },
  9992. setValue: function (e) {
  9993. return (this.object[this.property] = e), this.__onChange && this.__onChange.call(this, e), this.updateDisplay(), this
  9994. },
  9995. getValue: function () {
  9996. return this.object[this.property]
  9997. },
  9998. updateDisplay: function () {
  9999. return this
  10000. },
  10001. isModified: function () {
  10002. return this.initialValue !== this.getValue()
  10003. }
  10004. }),
  10005. le)),
  10006. (ee.dom.dom = (function (c) {
  10007. function i(e) {
  10008. if ('0' === e || c.isUndefined(e)) return 0
  10009. var t = e.match(n)
  10010. return c.isNull(t) ? 0 : parseFloat(t[1])
  10011. }
  10012. var h = {}
  10013. c.each(
  10014. {
  10015. HTMLEvents: ['change'],
  10016. MouseEvents: ['click', 'mousemove', 'mousedown', 'mouseup', 'mouseover'],
  10017. KeyboardEvents: ['keydown']
  10018. },
  10019. function (e, t) {
  10020. c.each(e, function (e) {
  10021. h[e] = t
  10022. })
  10023. }
  10024. )
  10025. var n = /(\d+(\.\d+)?)px/,
  10026. r = {
  10027. makeSelectable: function (e, t) {
  10028. void 0 !== e &&
  10029. void 0 !== e.style &&
  10030. ((e.onselectstart = t
  10031. ? function () {
  10032. return !1
  10033. }
  10034. : function () {}),
  10035. (e.style.MozUserSelect = t ? 'auto' : 'none'),
  10036. (e.style.KhtmlUserSelect = t ? 'auto' : 'none'),
  10037. (e.unselectable = t ? 'on' : 'off'))
  10038. },
  10039. makeFullscreen: function (e, t, i) {
  10040. c.isUndefined(t) && (t = !0),
  10041. c.isUndefined(i) && (i = !0),
  10042. (e.style.position = 'absolute'),
  10043. t && ((e.style.left = 0), (e.style.right = 0)),
  10044. i && ((e.style.top = 0), (e.style.bottom = 0))
  10045. },
  10046. fakeEvent: function (e, t, i, n) {
  10047. i = i || {}
  10048. var r = h[t]
  10049. if (!r) throw new Error('Event type ' + t + ' not supported.')
  10050. var o = document.createEvent(r)
  10051. switch (r) {
  10052. case 'MouseEvents':
  10053. var a = i.x || i.clientX || 0,
  10054. s = i.y || i.clientY || 0
  10055. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null)
  10056. break
  10057. case 'KeyboardEvents':
  10058. var l = o.initKeyboardEvent || o.initKeyEvent
  10059. c.defaults(i, {
  10060. cancelable: !0,
  10061. ctrlKey: !1,
  10062. altKey: !1,
  10063. shiftKey: !1,
  10064. metaKey: !1,
  10065. keyCode: void 0,
  10066. charCode: void 0
  10067. }),
  10068. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode)
  10069. break
  10070. default:
  10071. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  10072. }
  10073. c.defaults(o, n), e.dispatchEvent(o)
  10074. },
  10075. bind: function (e, t, i, n) {
  10076. return (n = n || !1), e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent('on' + t, i), r
  10077. },
  10078. unbind: function (e, t, i, n) {
  10079. return (n = n || !1), e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent('on' + t, i), r
  10080. },
  10081. addClass: function (e, t) {
  10082. if (void 0 === e.className) e.className = t
  10083. else if (e.className !== t) {
  10084. var i = e.className.split(/ +/)
  10085. ;-1 == i.indexOf(t) && (i.push(t), (e.className = i.join(' ').replace(/^\s+/, '').replace(/\s+$/, '')))
  10086. }
  10087. return r
  10088. },
  10089. removeClass: function (e, t) {
  10090. if (t)
  10091. if (void 0 === e.className);
  10092. else if (e.className === t) e.removeAttribute('class')
  10093. else {
  10094. var i = e.className.split(/ +/),
  10095. n = i.indexOf(t)
  10096. ;-1 != n && (i.splice(n, 1), (e.className = i.join(' ')))
  10097. }
  10098. else e.className = void 0
  10099. return r
  10100. },
  10101. hasClass: function (e, t) {
  10102. return new RegExp('(?:^|\\s+)' + t + '(?:\\s+|$)').test(e.className) || !1
  10103. },
  10104. getWidth: function (e) {
  10105. var t = getComputedStyle(e)
  10106. return i(t['border-left-width']) + i(t['border-right-width']) + i(t['padding-left']) + i(t['padding-right']) + i(t.width)
  10107. },
  10108. getHeight: function (e) {
  10109. var t = getComputedStyle(e)
  10110. return i(t['border-top-width']) + i(t['border-bottom-width']) + i(t['padding-top']) + i(t['padding-bottom']) + i(t.height)
  10111. },
  10112. getOffset: function (e) {
  10113. var t = {
  10114. left: 0,
  10115. top: 0
  10116. }
  10117. if (e.offsetParent) for (; (t.left += e.offsetLeft), (t.top += e.offsetTop), (e = e.offsetParent); );
  10118. return t
  10119. },
  10120. isActive: function (e) {
  10121. return e === document.activeElement && (e.type || e.href)
  10122. }
  10123. }
  10124. return r
  10125. })(ee.utils.common)),
  10126. (ee.controllers.OptionController =
  10127. ((q = ee.controllers.Controller),
  10128. (X = ee.dom.dom),
  10129. (Z = ee.utils.common),
  10130. ((K = function (e, t, i) {
  10131. K.superclass.call(this, e, t)
  10132. var n = this
  10133. if (((this.__select = document.createElement('select')), Z.isArray(i))) {
  10134. var r = {}
  10135. Z.each(i, function (e) {
  10136. r[e] = e
  10137. }),
  10138. (i = r)
  10139. }
  10140. Z.each(i, function (e, t) {
  10141. var i = document.createElement('option')
  10142. ;(i.innerHTML = t), i.setAttribute('value', e), n.__select.appendChild(i)
  10143. }),
  10144. this.updateDisplay(),
  10145. X.bind(this.__select, 'change', function () {
  10146. var e = this.options[this.selectedIndex].value
  10147. n.setValue(e)
  10148. }),
  10149. this.domElement.appendChild(this.__select)
  10150. }).superclass = q),
  10151. Z.extend(K.prototype, q.prototype, {
  10152. setValue: function (e) {
  10153. var t = K.superclass.prototype.setValue.call(this, e)
  10154. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), t
  10155. },
  10156. updateDisplay: function () {
  10157. return (this.__select.value = this.getValue()), K.superclass.prototype.updateDisplay.call(this)
  10158. }
  10159. }),
  10160. K)),
  10161. (ee.controllers.NumberController =
  10162. ((W = ee.controllers.Controller),
  10163. (j = ee.utils.common),
  10164. ((Y = function (e, t, i) {
  10165. Y.superclass.call(this, e, t),
  10166. (i = i || {}),
  10167. (this.__min = i.min),
  10168. (this.__max = i.max),
  10169. (this.__step = i.step),
  10170. j.isUndefined(this.__step)
  10171. ? 0 == this.initialValue
  10172. ? (this.__impliedStep = 1)
  10173. : (this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10)
  10174. : (this.__impliedStep = this.__step),
  10175. (this.__precision = se(this.__impliedStep))
  10176. }).superclass = W),
  10177. j.extend(Y.prototype, W.prototype, {
  10178. setValue: function (e) {
  10179. return (
  10180. void 0 !== this.__min && e < this.__min ? (e = this.__min) : void 0 !== this.__max && e > this.__max && (e = this.__max),
  10181. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  10182. Y.superclass.prototype.setValue.call(this, e)
  10183. )
  10184. },
  10185. min: function (e) {
  10186. return (this.__min = e), this
  10187. },
  10188. max: function (e) {
  10189. return (this.__max = e), this
  10190. },
  10191. step: function (e) {
  10192. return (this.__step = e), (this.__impliedStep = e), (this.__precision = se(e)), this
  10193. }
  10194. }),
  10195. Y)),
  10196. (ee.controllers.NumberControllerBox =
  10197. ((U = ee.controllers.NumberController),
  10198. (H = ee.dom.dom),
  10199. (z = ee.utils.common),
  10200. ((G = function (e, t, i) {
  10201. function n() {
  10202. var e = parseFloat(s.__input.value)
  10203. z.isNaN(e) || s.setValue(e)
  10204. }
  10205. function r(e) {
  10206. var t = a - e.clientY
  10207. s.setValue(s.getValue() + t * s.__impliedStep), (a = e.clientY)
  10208. }
  10209. function o() {
  10210. H.unbind(window, 'mousemove', r), H.unbind(window, 'mouseup', o)
  10211. }
  10212. ;(this.__truncationSuspended = !1), G.superclass.call(this, e, t, i)
  10213. var a,
  10214. s = this
  10215. ;(this.__input = document.createElement('input')),
  10216. this.__input.setAttribute('type', 'text'),
  10217. H.bind(this.__input, 'change', n),
  10218. H.bind(this.__input, 'blur', function () {
  10219. n(), s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  10220. }),
  10221. H.bind(this.__input, 'mousedown', function (e) {
  10222. H.bind(window, 'mousemove', r), H.bind(window, 'mouseup', o), (a = e.clientY)
  10223. }),
  10224. H.bind(this.__input, 'keydown', function (e) {
  10225. 13 === e.keyCode && ((s.__truncationSuspended = !0), this.blur(), (s.__truncationSuspended = !1))
  10226. }),
  10227. this.updateDisplay(),
  10228. this.domElement.appendChild(this.__input)
  10229. }).superclass = U),
  10230. z.extend(G.prototype, U.prototype, {
  10231. updateDisplay: function () {
  10232. return (
  10233. (this.__input.value = this.__truncationSuspended
  10234. ? this.getValue()
  10235. : (function (e, t) {
  10236. var i = Math.pow(10, t)
  10237. return Math.round(e * i) / i
  10238. })(this.getValue(), this.__precision)),
  10239. G.superclass.prototype.updateDisplay.call(this)
  10240. )
  10241. }
  10242. }),
  10243. G)),
  10244. (ee.controllers.NumberControllerSlider =
  10245. ((N = ee.controllers.NumberController),
  10246. (F = ee.dom.dom),
  10247. (B = ee.utils.css),
  10248. (V = ee.utils.common),
  10249. ((k = function (e, t, i, n, r) {
  10250. function o(e) {
  10251. e.preventDefault()
  10252. var t = F.getOffset(s.__background),
  10253. i = F.getWidth(s.__background)
  10254. return (
  10255. s.setValue(
  10256. (function (e, t, i, n, r) {
  10257. return n + ((e - t) / (i - t)) * (r - n)
  10258. })(e.clientX, t.left, t.left + i, s.__min, s.__max)
  10259. ),
  10260. !1
  10261. )
  10262. }
  10263. function a() {
  10264. F.unbind(window, 'mousemove', o), F.unbind(window, 'mouseup', a), s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  10265. }
  10266. k.superclass.call(this, e, t, {
  10267. min: i,
  10268. max: n,
  10269. step: r
  10270. })
  10271. var s = this
  10272. ;(this.__background = document.createElement('div')),
  10273. (this.__foreground = document.createElement('div')),
  10274. F.bind(this.__background, 'mousedown', function (e) {
  10275. F.bind(window, 'mousemove', o), F.bind(window, 'mouseup', a), o(e)
  10276. }),
  10277. F.addClass(this.__background, 'slider'),
  10278. F.addClass(this.__foreground, 'slider-fg'),
  10279. this.updateDisplay(),
  10280. this.__background.appendChild(this.__foreground),
  10281. this.domElement.appendChild(this.__background)
  10282. }).superclass = N),
  10283. (k.useDefaultStyles = function () {
  10284. B.inject(
  10285. '/**\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}'
  10286. )
  10287. }),
  10288. V.extend(k.prototype, N.prototype, {
  10289. updateDisplay: function () {
  10290. var e = (this.getValue() - this.__min) / (this.__max - this.__min)
  10291. return (this.__foreground.style.width = 100 * e + '%'), k.superclass.prototype.updateDisplay.call(this)
  10292. }
  10293. }),
  10294. k)),
  10295. (ee.controllers.FunctionController =
  10296. ((P = ee.controllers.Controller),
  10297. (O = ee.dom.dom),
  10298. (L = ee.utils.common),
  10299. ((D = function (e, t, i) {
  10300. D.superclass.call(this, e, t)
  10301. var n = this
  10302. ;(this.__button = document.createElement('div')),
  10303. (this.__button.innerHTML = void 0 === i ? 'Fire' : i),
  10304. O.bind(this.__button, 'click', function (e) {
  10305. return e.preventDefault(), n.fire(), !1
  10306. }),
  10307. O.addClass(this.__button, 'button'),
  10308. this.domElement.appendChild(this.__button)
  10309. }).superclass = P),
  10310. L.extend(D.prototype, P.prototype, {
  10311. fire: function () {
  10312. this.__onChange && this.__onChange.call(this), this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), this.getValue().call(this.object)
  10313. }
  10314. }),
  10315. D)),
  10316. (ee.controllers.BooleanController =
  10317. ((x = ee.controllers.Controller),
  10318. (S = ee.dom.dom),
  10319. (M = ee.utils.common),
  10320. ((R = function (e, t) {
  10321. R.superclass.call(this, e, t)
  10322. var i = this
  10323. ;(this.__prev = this.getValue()),
  10324. (this.__checkbox = document.createElement('input')),
  10325. this.__checkbox.setAttribute('type', 'checkbox'),
  10326. S.bind(
  10327. this.__checkbox,
  10328. 'change',
  10329. function () {
  10330. i.setValue(!i.__prev)
  10331. },
  10332. !1
  10333. ),
  10334. this.domElement.appendChild(this.__checkbox),
  10335. this.updateDisplay()
  10336. }).superclass = x),
  10337. M.extend(R.prototype, x.prototype, {
  10338. setValue: function (e) {
  10339. var t = R.superclass.prototype.setValue.call(this, e)
  10340. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), (this.__prev = this.getValue()), t
  10341. },
  10342. updateDisplay: function () {
  10343. return (
  10344. !0 === this.getValue() ? (this.__checkbox.setAttribute('checked', 'checked'), (this.__checkbox.checked = !0)) : (this.__checkbox.checked = !1),
  10345. R.superclass.prototype.updateDisplay.call(this)
  10346. )
  10347. }
  10348. }),
  10349. R)),
  10350. (ee.color.toString =
  10351. ((T = ee.utils.common),
  10352. function (e) {
  10353. if (1 == e.a || T.isUndefined(e.a)) {
  10354. for (var t = e.hex.toString(16); t.length < 6; ) t = '0' + t
  10355. return '#' + t
  10356. }
  10357. return 'rgba(' + Math.round(e.r) + ',' + Math.round(e.g) + ',' + Math.round(e.b) + ',' + e.a + ')'
  10358. })),
  10359. (ee.color.interpret =
  10360. ((I = ee.color.toString),
  10361. (E = ee.utils.common),
  10362. (w = [
  10363. {
  10364. litmus: E.isString,
  10365. conversions: {
  10366. THREE_CHAR_HEX: {
  10367. read: function (e) {
  10368. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i)
  10369. return (
  10370. null !== t && {
  10371. space: 'HEX',
  10372. hex: parseInt('0x' + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10373. }
  10374. )
  10375. },
  10376. write: I
  10377. },
  10378. SIX_CHAR_HEX: {
  10379. read: function (e) {
  10380. var t = e.match(/^#([A-F0-9]{6})$/i)
  10381. return (
  10382. null !== t && {
  10383. space: 'HEX',
  10384. hex: parseInt('0x' + t[1].toString())
  10385. }
  10386. )
  10387. },
  10388. write: I
  10389. },
  10390. CSS_RGB: {
  10391. read: function (e) {
  10392. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/)
  10393. return (
  10394. null !== t && {
  10395. space: 'RGB',
  10396. r: parseFloat(t[1]),
  10397. g: parseFloat(t[2]),
  10398. b: parseFloat(t[3])
  10399. }
  10400. )
  10401. },
  10402. write: I
  10403. },
  10404. CSS_RGBA: {
  10405. read: function (e) {
  10406. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/)
  10407. return (
  10408. null !== t && {
  10409. space: 'RGB',
  10410. r: parseFloat(t[1]),
  10411. g: parseFloat(t[2]),
  10412. b: parseFloat(t[3]),
  10413. a: parseFloat(t[4])
  10414. }
  10415. )
  10416. },
  10417. write: I
  10418. }
  10419. }
  10420. },
  10421. {
  10422. litmus: E.isNumber,
  10423. conversions: {
  10424. HEX: {
  10425. read: function (e) {
  10426. return {
  10427. space: 'HEX',
  10428. hex: e,
  10429. conversionName: 'HEX'
  10430. }
  10431. },
  10432. write: function (e) {
  10433. return e.hex
  10434. }
  10435. }
  10436. }
  10437. },
  10438. {
  10439. litmus: E.isArray,
  10440. conversions: {
  10441. RGB_ARRAY: {
  10442. read: function (e) {
  10443. return (
  10444. 3 == e.length && {
  10445. space: 'RGB',
  10446. r: e[0],
  10447. g: e[1],
  10448. b: e[2]
  10449. }
  10450. )
  10451. },
  10452. write: function (e) {
  10453. return [e.r, e.g, e.b]
  10454. }
  10455. },
  10456. RGBA_ARRAY: {
  10457. read: function (e) {
  10458. return (
  10459. 4 == e.length && {
  10460. space: 'RGB',
  10461. r: e[0],
  10462. g: e[1],
  10463. b: e[2],
  10464. a: e[3]
  10465. }
  10466. )
  10467. },
  10468. write: function (e) {
  10469. return [e.r, e.g, e.b, e.a]
  10470. }
  10471. }
  10472. }
  10473. },
  10474. {
  10475. litmus: E.isObject,
  10476. conversions: {
  10477. RGBA_OBJ: {
  10478. read: function (e) {
  10479. return (
  10480. !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  10481. space: 'RGB',
  10482. r: e.r,
  10483. g: e.g,
  10484. b: e.b,
  10485. a: e.a
  10486. }
  10487. )
  10488. },
  10489. write: function (e) {
  10490. return {
  10491. r: e.r,
  10492. g: e.g,
  10493. b: e.b,
  10494. a: e.a
  10495. }
  10496. }
  10497. },
  10498. RGB_OBJ: {
  10499. read: function (e) {
  10500. return (
  10501. !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  10502. space: 'RGB',
  10503. r: e.r,
  10504. g: e.g,
  10505. b: e.b
  10506. }
  10507. )
  10508. },
  10509. write: function (e) {
  10510. return {
  10511. r: e.r,
  10512. g: e.g,
  10513. b: e.b
  10514. }
  10515. }
  10516. },
  10517. HSVA_OBJ: {
  10518. read: function (e) {
  10519. return (
  10520. !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  10521. space: 'HSV',
  10522. h: e.h,
  10523. s: e.s,
  10524. v: e.v,
  10525. a: e.a
  10526. }
  10527. )
  10528. },
  10529. write: function (e) {
  10530. return {
  10531. h: e.h,
  10532. s: e.s,
  10533. v: e.v,
  10534. a: e.a
  10535. }
  10536. }
  10537. },
  10538. HSV_OBJ: {
  10539. read: function (e) {
  10540. return (
  10541. !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  10542. space: 'HSV',
  10543. h: e.h,
  10544. s: e.s,
  10545. v: e.v
  10546. }
  10547. )
  10548. },
  10549. write: function (e) {
  10550. return {
  10551. h: e.h,
  10552. s: e.s,
  10553. v: e.v
  10554. }
  10555. }
  10556. }
  10557. }
  10558. }
  10559. ]),
  10560. function () {
  10561. b = !1
  10562. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0]
  10563. return (
  10564. E.each(w, function (e) {
  10565. if (e.litmus(i))
  10566. return (
  10567. E.each(e.conversions, function (e, t) {
  10568. if (((_ = e.read(i)), !1 === b && !1 !== _)) return ((b = _).conversionName = t), (_.conversion = e), E.BREAK
  10569. }),
  10570. E.BREAK
  10571. )
  10572. }),
  10573. b
  10574. )
  10575. })),
  10576. (ee.GUI = ee.gui.GUI =
  10577. (function (e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10578. function y(e, t, i, n) {
  10579. if (void 0 === t[i]) throw new Error('Object ' + t + ' has no property "' + i + '"')
  10580. var r
  10581. if (n.color) r = new g(t, i)
  10582. else {
  10583. var o = [t, i].concat(n.factoryArgs)
  10584. r = c.apply(e, o)
  10585. }
  10586. n.before instanceof h && (n.before = n.before.__li), C(e, r), m.addClass(r.domElement, 'c')
  10587. var a = document.createElement('span')
  10588. m.addClass(a, 'property-name'), (a.innerHTML = r.property)
  10589. var s = document.createElement('div')
  10590. s.appendChild(a), s.appendChild(r.domElement)
  10591. var l = A(e, s, n.before)
  10592. return (
  10593. m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10594. m.addClass(l, typeof r.getValue()),
  10595. (function (t, i, n) {
  10596. if (
  10597. ((n.__li = i),
  10598. (n.__gui = t),
  10599. v.extend(n, {
  10600. options: function (e) {
  10601. return 1 < arguments.length
  10602. ? (n.remove(),
  10603. y(t, n.object, n.property, {
  10604. before: n.__li.nextElementSibling,
  10605. factoryArgs: [v.toArray(arguments)]
  10606. }))
  10607. : v.isArray(e) || v.isObject(e)
  10608. ? (n.remove(),
  10609. y(t, n.object, n.property, {
  10610. before: n.__li.nextElementSibling,
  10611. factoryArgs: [e]
  10612. }))
  10613. : void 0
  10614. },
  10615. name: function (e) {
  10616. return (n.__li.firstElementChild.firstElementChild.innerHTML = e), n
  10617. },
  10618. listen: function () {
  10619. return n.__gui.listen(n), n
  10620. },
  10621. remove: function () {
  10622. return n.__gui.remove(n), n
  10623. }
  10624. }),
  10625. n instanceof f)
  10626. ) {
  10627. var r = new p(n.object, n.property, {
  10628. min: n.__min,
  10629. max: n.__max,
  10630. step: n.__step
  10631. })
  10632. v.each(['updateDisplay', 'onChange', 'onFinishChange'], function (e) {
  10633. var t = n[e],
  10634. i = r[e]
  10635. n[e] = r[e] = function () {
  10636. var e = Array.prototype.slice.call(arguments)
  10637. return t.apply(n, e), i.apply(r, e)
  10638. }
  10639. }),
  10640. m.addClass(i, 'has-slider'),
  10641. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10642. } else if (n instanceof p) {
  10643. var e = function (e) {
  10644. return v.isNumber(n.__min) && v.isNumber(n.__max)
  10645. ? (n.remove(),
  10646. y(t, n.object, n.property, {
  10647. before: n.__li.nextElementSibling,
  10648. factoryArgs: [n.__min, n.__max, n.__step]
  10649. }))
  10650. : e
  10651. }
  10652. ;(n.min = v.compose(e, n.min)), (n.max = v.compose(e, n.max))
  10653. } else
  10654. n instanceof u
  10655. ? (m.bind(i, 'click', function () {
  10656. m.fakeEvent(n.__checkbox, 'click')
  10657. }),
  10658. m.bind(n.__checkbox, 'click', function (e) {
  10659. e.stopPropagation()
  10660. }))
  10661. : n instanceof d
  10662. ? (m.bind(i, 'click', function () {
  10663. m.fakeEvent(n.__button, 'click')
  10664. }),
  10665. m.bind(i, 'mouseover', function () {
  10666. m.addClass(n.__button, 'hover')
  10667. }),
  10668. m.bind(i, 'mouseout', function () {
  10669. m.removeClass(n.__button, 'hover')
  10670. }))
  10671. : n instanceof g &&
  10672. (m.addClass(i, 'color'),
  10673. (n.updateDisplay = v.compose(function (e) {
  10674. return (i.style.borderLeftColor = n.__color.toString()), e
  10675. }, n.updateDisplay)),
  10676. n.updateDisplay())
  10677. n.setValue = v.compose(function (e) {
  10678. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0), e
  10679. }, n.setValue)
  10680. })(e, l, r),
  10681. e.__controllers.push(r),
  10682. r
  10683. )
  10684. }
  10685. function A(e, t, i) {
  10686. var n = document.createElement('li')
  10687. return t && n.appendChild(t), i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n), e.onResize(), n
  10688. }
  10689. function C(e, t) {
  10690. var i = e.getRoot(),
  10691. n = i.__rememberedObjects.indexOf(t.object)
  10692. if (-1 != n) {
  10693. var r = i.__rememberedObjectIndecesToControllers[n]
  10694. if ((void 0 === r && ((r = {}), (i.__rememberedObjectIndecesToControllers[n] = r)), (r[t.property] = t), i.load && i.load.remembered)) {
  10695. var o,
  10696. a = i.load.remembered
  10697. if (a[e.preset]) o = a[e.preset]
  10698. else {
  10699. if (!a[T]) return
  10700. o = a[T]
  10701. }
  10702. if (o[n] && void 0 !== o[n][t.property]) {
  10703. var s = o[n][t.property]
  10704. ;(t.initialValue = s), t.setValue(s)
  10705. }
  10706. }
  10707. }
  10708. }
  10709. function I(e, t) {
  10710. return document.location.href + '.' + t
  10711. }
  10712. function l(e, t) {
  10713. ;(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')
  10714. }
  10715. function a(r, o) {
  10716. var a = {}
  10717. return (
  10718. v.each(r.__rememberedObjects, function (e, t) {
  10719. var i = {},
  10720. n = r.__rememberedObjectIndecesToControllers[t]
  10721. v.each(n, function (e, t) {
  10722. i[t] = o ? e.initialValue : e.getValue()
  10723. }),
  10724. (a[t] = i)
  10725. }),
  10726. a
  10727. )
  10728. }
  10729. function E(e, t, i) {
  10730. var n = document.createElement('option')
  10731. ;(n.innerHTML = t), (n.value = t), e.__preset_select.appendChild(n), i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10732. }
  10733. function _(e, t) {
  10734. var i = e.__preset_select[e.__preset_select.selectedIndex]
  10735. i.innerHTML = t ? i.value + '*' : i.value
  10736. }
  10737. e.inject(
  10738. ".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"
  10739. )
  10740. var b,
  10741. w,
  10742. T = 'Default',
  10743. x = (function () {
  10744. try {
  10745. return 'localStorage' in window && null !== window.localStorage
  10746. } catch (e) {
  10747. return !1
  10748. }
  10749. })(),
  10750. S = !0,
  10751. s = !1,
  10752. M = [],
  10753. R = function (t) {
  10754. var i = this
  10755. ;(this.domElement = document.createElement('div')),
  10756. (this.__ul = document.createElement('ul')),
  10757. this.domElement.appendChild(this.__ul),
  10758. m.addClass(this.domElement, 'dg'),
  10759. (this.__folders = {}),
  10760. (this.__controllers = []),
  10761. (this.__rememberedObjects = []),
  10762. (this.__rememberedObjectIndecesToControllers = []),
  10763. (this.__listening = []),
  10764. (t = t || {}),
  10765. (t = v.defaults(t, {
  10766. autoPlace: !0,
  10767. width: R.DEFAULT_WIDTH
  10768. })),
  10769. (t = v.defaults(t, {
  10770. resizable: t.autoPlace,
  10771. hideable: t.autoPlace
  10772. })),
  10773. v.isUndefined(t.load)
  10774. ? (t.load = {
  10775. preset: T
  10776. })
  10777. : t.preset && (t.load.preset = t.preset),
  10778. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10779. (t.resizable = v.isUndefined(t.parent) && t.resizable),
  10780. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0)
  10781. var n,
  10782. e,
  10783. r = x && 'true' === localStorage.getItem(I(0, 'isLocal'))
  10784. if (
  10785. (Object.defineProperties(this, {
  10786. parent: {
  10787. get: function () {
  10788. return t.parent
  10789. }
  10790. },
  10791. scrollable: {
  10792. get: function () {
  10793. return t.scrollable
  10794. }
  10795. },
  10796. autoPlace: {
  10797. get: function () {
  10798. return t.autoPlace
  10799. }
  10800. },
  10801. preset: {
  10802. get: function () {
  10803. return i.parent ? i.getRoot().preset : t.load.preset
  10804. },
  10805. set: function (e) {
  10806. i.parent ? (i.getRoot().preset = e) : (t.load.preset = e),
  10807. (function (e) {
  10808. for (var t = 0; t < e.__preset_select.length; t++) e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10809. })(this),
  10810. i.revert()
  10811. }
  10812. },
  10813. width: {
  10814. get: function () {
  10815. return t.width
  10816. },
  10817. set: function (e) {
  10818. ;(t.width = e), l(i, e)
  10819. }
  10820. },
  10821. name: {
  10822. get: function () {
  10823. return t.name
  10824. },
  10825. set: function (e) {
  10826. ;(t.name = e), a && (a.innerHTML = t.name)
  10827. }
  10828. },
  10829. closed: {
  10830. get: function () {
  10831. return t.closed
  10832. },
  10833. set: function (e) {
  10834. ;(t.closed = e),
  10835. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10836. this.onResize(),
  10837. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10838. }
  10839. },
  10840. load: {
  10841. get: function () {
  10842. return t.load
  10843. }
  10844. },
  10845. useLocalStorage: {
  10846. get: function () {
  10847. return r
  10848. },
  10849. set: function (e) {
  10850. x && ((r = e) ? m.bind(window, 'unload', n) : m.unbind(window, 'unload', n), localStorage.setItem(I(0, 'isLocal'), e))
  10851. }
  10852. }
  10853. }),
  10854. v.isUndefined(t.parent))
  10855. ) {
  10856. if (((t.closed = !1), m.addClass(this.domElement, R.CLASS_MAIN), m.makeSelectable(this.domElement, !1), x && r)) {
  10857. i.useLocalStorage = !0
  10858. var o = localStorage.getItem(I(0, 'gui'))
  10859. o && (t.load = JSON.parse(o))
  10860. }
  10861. ;(this.__closeButton = document.createElement('div')),
  10862. (this.__closeButton.innerHTML = R.TEXT_CLOSED),
  10863. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10864. this.domElement.appendChild(this.__closeButton),
  10865. m.bind(this.__closeButton, 'click', function () {
  10866. i.closed = !i.closed
  10867. })
  10868. } else {
  10869. void 0 === t.closed && (t.closed = !0)
  10870. var a = document.createTextNode(t.name)
  10871. m.addClass(a, 'controller-name')
  10872. var s = A(i, a)
  10873. m.addClass(this.__ul, R.CLASS_CLOSED),
  10874. m.addClass(s, 'title'),
  10875. m.bind(s, 'click', function (e) {
  10876. return e.preventDefault(), (i.closed = !i.closed), !1
  10877. }),
  10878. t.closed || (this.closed = !1)
  10879. }
  10880. t.autoPlace &&
  10881. (v.isUndefined(t.parent) &&
  10882. (S && ((w = document.createElement('div')), m.addClass(w, 'dg'), m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER), document.body.appendChild(w), (S = !1)),
  10883. w.appendChild(this.domElement),
  10884. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10885. this.parent || l(i, t.width)),
  10886. m.bind(window, 'resize', function () {
  10887. i.onResize()
  10888. }),
  10889. m.bind(this.__ul, 'webkitTransitionEnd', function () {
  10890. i.onResize()
  10891. }),
  10892. m.bind(this.__ul, 'transitionend', function () {
  10893. i.onResize()
  10894. }),
  10895. m.bind(this.__ul, 'oTransitionEnd', function () {
  10896. i.onResize()
  10897. }),
  10898. this.onResize(),
  10899. t.resizable &&
  10900. (function (t) {
  10901. function e(e) {
  10902. return e.preventDefault(), (r = e.clientX), m.addClass(t.__closeButton, R.CLASS_DRAG), m.bind(window, 'mousemove', i), m.bind(window, 'mouseup', n), !1
  10903. }
  10904. function i(e) {
  10905. return e.preventDefault(), (t.width += r - e.clientX), t.onResize(), (r = e.clientX), !1
  10906. }
  10907. function n() {
  10908. m.removeClass(t.__closeButton, R.CLASS_DRAG), m.unbind(window, 'mousemove', i), m.unbind(window, 'mouseup', n)
  10909. }
  10910. var r
  10911. ;(t.__resize_handle = document.createElement('div')),
  10912. v.extend(t.__resize_handle.style, {
  10913. width: '6px',
  10914. marginLeft: '-3px',
  10915. height: '200px',
  10916. cursor: 'ew-resize',
  10917. position: 'absolute'
  10918. }),
  10919. m.bind(t.__resize_handle, 'mousedown', e),
  10920. m.bind(t.__closeButton, 'mousedown', e),
  10921. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10922. })(this),
  10923. (n = function () {
  10924. x && 'true' === localStorage.getItem(I(0, 'isLocal')) && localStorage.setItem(I(0, 'gui'), JSON.stringify(i.getSaveObject()))
  10925. }),
  10926. (this.saveToLocalStorageIfPossible = n),
  10927. i.getRoot(),
  10928. t.parent ||
  10929. (((e = i.getRoot()).width += 1),
  10930. v.defer(function () {
  10931. e.width -= 1
  10932. }))
  10933. }
  10934. return (
  10935. (R.toggleHide = function () {
  10936. ;(s = !s),
  10937. v.each(M, function (e) {
  10938. ;(e.domElement.style.zIndex = s ? -999 : 999), (e.domElement.style.opacity = s ? 0 : 1)
  10939. })
  10940. }),
  10941. (R.CLASS_AUTO_PLACE = 'a'),
  10942. (R.CLASS_AUTO_PLACE_CONTAINER = 'ac'),
  10943. (R.CLASS_MAIN = 'main'),
  10944. (R.CLASS_CONTROLLER_ROW = 'cr'),
  10945. (R.CLASS_TOO_TALL = 'taller-than-window'),
  10946. (R.CLASS_CLOSED = 'closed'),
  10947. (R.CLASS_CLOSE_BUTTON = 'close-button'),
  10948. (R.CLASS_DRAG = 'drag'),
  10949. (R.DEFAULT_WIDTH = 245),
  10950. (R.TEXT_CLOSED = 'Close Controls'),
  10951. (R.TEXT_OPEN = 'Open Controls'),
  10952. m.bind(
  10953. window,
  10954. 'keydown',
  10955. function (e) {
  10956. 'text' === document.activeElement.type || (72 !== e.which && 72 != e.keyCode) || R.toggleHide()
  10957. },
  10958. !1
  10959. ),
  10960. v.extend(R.prototype, {
  10961. add: function (e, t) {
  10962. return y(this, e, t, {
  10963. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10964. })
  10965. },
  10966. addColor: function (e, t) {
  10967. return y(this, e, t, {
  10968. color: !0
  10969. })
  10970. },
  10971. remove: function (e) {
  10972. this.__ul.removeChild(e.__li), this.__controllers.slice(this.__controllers.indexOf(e), 1)
  10973. var t = this
  10974. v.defer(function () {
  10975. t.onResize()
  10976. })
  10977. },
  10978. destroy: function () {
  10979. this.autoPlace && w.removeChild(this.domElement)
  10980. },
  10981. addFolder: function (e) {
  10982. if (void 0 !== this.__folders[e]) throw new Error('You already have a folder in this GUI by the name "' + e + '"')
  10983. var t = {
  10984. name: e,
  10985. parent: this
  10986. }
  10987. ;(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]))
  10988. var i = new R(t)
  10989. this.__folders[e] = i
  10990. var n = A(this, i.domElement)
  10991. return m.addClass(n, 'folder'), i
  10992. },
  10993. open: function () {
  10994. this.closed = !1
  10995. },
  10996. close: function () {
  10997. this.closed = !0
  10998. },
  10999. onResize: function () {
  11000. var t = this.getRoot()
  11001. if (t.scrollable) {
  11002. var e = m.getOffset(t.__ul).top,
  11003. i = 0
  11004. v.each(t.__ul.childNodes, function (e) {
  11005. ;(t.autoPlace && e === t.__save_row) || (i += m.getHeight(e))
  11006. }),
  11007. $('#player').height() - e - 20 < i
  11008. ? (m.addClass(t.domElement, R.CLASS_TOO_TALL), (t.__ul.style.height = $('#player').height() - e - 20 + 'px'))
  11009. : (m.removeClass(t.domElement, R.CLASS_TOO_TALL), (t.__ul.style.height = 'auto'))
  11010. }
  11011. t.__resize_handle &&
  11012. v.defer(function () {
  11013. t.__resize_handle.style.height = t.__ul.offsetHeight + 'px'
  11014. }),
  11015. t.__closeButton && (t.__closeButton.style.width = t.width + 'px')
  11016. },
  11017. remember: function () {
  11018. if (
  11019. (v.isUndefined(b) &&
  11020. ((b = new o()).domElement.innerHTML =
  11021. '<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>'),
  11022. this.parent)
  11023. )
  11024. throw new Error('You can only call remember on a top level GUI.')
  11025. var t = this
  11026. v.each(Array.prototype.slice.call(arguments), function (e) {
  11027. 0 == t.__rememberedObjects.length &&
  11028. (function (i) {
  11029. var e = (i.__save_row = document.createElement('li'))
  11030. m.addClass(i.domElement, 'has-save'), i.__ul.insertBefore(e, i.__ul.firstChild), m.addClass(e, 'save-row')
  11031. var t = document.createElement('span')
  11032. ;(t.innerHTML = '&nbsp;'), m.addClass(t, 'button gears')
  11033. var n = document.createElement('span')
  11034. ;(n.innerHTML = 'Save'), m.addClass(n, 'button'), m.addClass(n, 'save')
  11035. var r = document.createElement('span')
  11036. ;(r.innerHTML = 'New'), m.addClass(r, 'button'), m.addClass(r, 'save-as')
  11037. var o = document.createElement('span')
  11038. ;(o.innerHTML = 'Revert'), m.addClass(o, 'button'), m.addClass(o, 'revert')
  11039. var a = (i.__preset_select = document.createElement('select'))
  11040. if (
  11041. (i.load && i.load.remembered
  11042. ? v.each(i.load.remembered, function (e, t) {
  11043. E(i, t, t == i.preset)
  11044. })
  11045. : E(i, T, !1),
  11046. m.bind(a, 'change', function () {
  11047. for (var e = 0; e < i.__preset_select.length; e++) i.__preset_select[e].innerHTML = i.__preset_select[e].value
  11048. i.preset = this.value
  11049. }),
  11050. e.appendChild(a),
  11051. e.appendChild(t),
  11052. e.appendChild(n),
  11053. e.appendChild(r),
  11054. e.appendChild(o),
  11055. x)
  11056. ) {
  11057. var s = document.getElementById('dg-save-locally'),
  11058. l = document.getElementById('dg-local-explain')
  11059. s.style.display = 'block'
  11060. var c = document.getElementById('dg-local-storage')
  11061. 'true' === localStorage.getItem(I(0, 'isLocal')) && c.setAttribute('checked', 'checked')
  11062. var h = function () {
  11063. l.style.display = i.useLocalStorage ? 'block' : 'none'
  11064. }
  11065. h(),
  11066. m.bind(c, 'change', function () {
  11067. ;(i.useLocalStorage = !i.useLocalStorage), h()
  11068. })
  11069. }
  11070. var u = document.getElementById('dg-new-constructor')
  11071. m.bind(u, 'keydown', function (e) {
  11072. !e.metaKey || (67 !== e.which && 67 != e.keyCode) || b.hide()
  11073. }),
  11074. m.bind(t, 'click', function () {
  11075. ;(u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2)), b.show(), u.focus(), u.select()
  11076. }),
  11077. m.bind(n, 'click', function () {
  11078. i.save()
  11079. }),
  11080. m.bind(r, 'click', function () {
  11081. var e = prompt('Enter a new preset name.')
  11082. e && i.saveAs(e)
  11083. }),
  11084. m.bind(o, 'click', function () {
  11085. i.revert()
  11086. })
  11087. })(t),
  11088. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  11089. }),
  11090. this.autoPlace && l(this, this.width)
  11091. },
  11092. getRoot: function () {
  11093. for (var e = this; e.parent; ) e = e.parent
  11094. return e
  11095. },
  11096. getSaveObject: function () {
  11097. var i = this.load
  11098. return (
  11099. (i.closed = this.closed),
  11100. 0 < this.__rememberedObjects.length && ((i.preset = this.preset), i.remembered || (i.remembered = {}), (i.remembered[this.preset] = a(this))),
  11101. (i.folders = {}),
  11102. v.each(this.__folders, function (e, t) {
  11103. i.folders[t] = e.getSaveObject()
  11104. }),
  11105. i
  11106. )
  11107. },
  11108. save: function () {
  11109. this.load.remembered || (this.load.remembered = {}), (this.load.remembered[this.preset] = a(this)), _(this, !1), this.saveToLocalStorageIfPossible()
  11110. },
  11111. saveAs: function (e) {
  11112. this.load.remembered || ((this.load.remembered = {}), (this.load.remembered[T] = a(this, !0))),
  11113. (this.load.remembered[e] = a(this)),
  11114. (this.preset = e),
  11115. E(this, e, !0),
  11116. this.saveToLocalStorageIfPossible()
  11117. },
  11118. revert: function (t) {
  11119. v.each(
  11120. this.__controllers,
  11121. function (e) {
  11122. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  11123. },
  11124. this
  11125. ),
  11126. v.each(this.__folders, function (e) {
  11127. e.revert(e)
  11128. }),
  11129. t || _(this.getRoot(), !1)
  11130. },
  11131. listen: function (e) {
  11132. var t = 0 == this.__listening.length
  11133. this.__listening.push(e),
  11134. t &&
  11135. (function e(t) {
  11136. 0 != t.length &&
  11137. r(function () {
  11138. e(t)
  11139. }),
  11140. v.each(t, function (e) {
  11141. e.updateDisplay()
  11142. })
  11143. })(this.__listening)
  11144. }
  11145. }),
  11146. R
  11147. )
  11148. })(
  11149. ee.utils.css,
  11150. 0,
  11151. 0,
  11152. (ee.controllers.factory =
  11153. ((h = ee.controllers.OptionController),
  11154. (u = ee.controllers.NumberControllerBox),
  11155. (d = ee.controllers.NumberControllerSlider),
  11156. (p = ee.controllers.StringController =
  11157. ((v = ee.controllers.Controller),
  11158. (y = ee.dom.dom),
  11159. (A = ee.utils.common),
  11160. ((C = function (e, t) {
  11161. function i() {
  11162. n.setValue(n.__input.value)
  11163. }
  11164. C.superclass.call(this, e, t)
  11165. var n = this
  11166. ;(this.__input = document.createElement('input')),
  11167. this.__input.setAttribute('type', 'text'),
  11168. y.bind(this.__input, 'keyup', i),
  11169. y.bind(this.__input, 'change', i),
  11170. y.bind(this.__input, 'blur', function () {
  11171. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  11172. }),
  11173. y.bind(this.__input, 'keydown', function (e) {
  11174. 13 === e.keyCode && this.blur()
  11175. }),
  11176. this.updateDisplay(),
  11177. this.domElement.appendChild(this.__input)
  11178. }).superclass = v),
  11179. A.extend(C.prototype, v.prototype, {
  11180. updateDisplay: function () {
  11181. return y.isActive(this.__input) || (this.__input.value = this.getValue()), C.superclass.prototype.updateDisplay.call(this)
  11182. }
  11183. }),
  11184. C)),
  11185. (f = ee.controllers.FunctionController),
  11186. (g = ee.controllers.BooleanController),
  11187. (m = ee.utils.common),
  11188. function (e, t) {
  11189. var i = e[t]
  11190. return m.isArray(arguments[2]) || m.isObject(arguments[2])
  11191. ? new h(e, t, arguments[2])
  11192. : m.isNumber(i)
  11193. ? m.isNumber(arguments[2]) && m.isNumber(arguments[3])
  11194. ? new d(e, t, arguments[2], arguments[3])
  11195. : new u(e, t, {
  11196. min: arguments[2],
  11197. max: arguments[3]
  11198. })
  11199. : m.isString(i)
  11200. ? new p(e, t)
  11201. : m.isFunction(i)
  11202. ? new f(e, t, '')
  11203. : m.isBoolean(i)
  11204. ? new g(e, t)
  11205. : void 0
  11206. })),
  11207. ee.controllers.Controller,
  11208. ee.controllers.BooleanController,
  11209. ee.controllers.FunctionController,
  11210. ee.controllers.NumberControllerBox,
  11211. ee.controllers.NumberControllerSlider,
  11212. ee.controllers.OptionController,
  11213. (ee.controllers.ColorController = (function (e, h, u, d, p) {
  11214. function f(t, i, n, r) {
  11215. ;(t.style.background = ''),
  11216. p.each(o, function (e) {
  11217. t.style.cssText += 'background: ' + e + 'linear-gradient(' + i + ', ' + n + ' 0%, ' + r + ' 100%); '
  11218. })
  11219. }
  11220. var g = function (e, t) {
  11221. function i(e) {
  11222. a(e), h.bind(window, 'mousemove', a), h.bind(window, 'mouseup', n)
  11223. }
  11224. function n() {
  11225. h.unbind(window, 'mousemove', a), h.unbind(window, 'mouseup', n)
  11226. }
  11227. function r() {
  11228. var e = d(this.value)
  11229. !1 !== e ? ((l.__color.__state = e), l.setValue(l.__color.toOriginal())) : (this.value = l.__color.toString())
  11230. }
  11231. function o() {
  11232. h.unbind(window, 'mousemove', s), h.unbind(window, 'mouseup', o)
  11233. }
  11234. function a(e) {
  11235. e.preventDefault()
  11236. var t = h.getWidth(l.__saturation_field),
  11237. i = h.getOffset(l.__saturation_field),
  11238. n = (e.clientX - i.left + document.body.scrollLeft) / t,
  11239. r = 1 - (e.clientY - i.top + document.body.scrollTop) / t
  11240. 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
  11241. }
  11242. function s(e) {
  11243. e.preventDefault()
  11244. var t = h.getHeight(l.__hue_field),
  11245. i = h.getOffset(l.__hue_field),
  11246. n = 1 - (e.clientY - i.top + document.body.scrollTop) / t
  11247. return 1 < n ? (n = 1) : n < 0 && (n = 0), (l.__color.h = 360 * n), l.setValue(l.__color.toOriginal()), !1
  11248. }
  11249. g.superclass.call(this, e, t), (this.__color = new u(this.getValue())), (this.__temp = new u(0))
  11250. var l = this
  11251. ;(this.domElement = document.createElement('div')),
  11252. h.makeSelectable(this.domElement, !1),
  11253. (this.__selector = document.createElement('div')),
  11254. (this.__selector.className = 'selector'),
  11255. (this.__saturation_field = document.createElement('div')),
  11256. (this.__saturation_field.className = 'saturation-field'),
  11257. (this.__field_knob = document.createElement('div')),
  11258. (this.__field_knob.className = 'field-knob'),
  11259. (this.__field_knob_border = '2px solid '),
  11260. (this.__hue_knob = document.createElement('div')),
  11261. (this.__hue_knob.className = 'hue-knob'),
  11262. (this.__hue_field = document.createElement('div')),
  11263. (this.__hue_field.className = 'hue-field'),
  11264. (this.__input = document.createElement('input')),
  11265. (this.__input.type = 'text'),
  11266. (this.__input_textShadow = '0 1px 1px '),
  11267. h.bind(this.__input, 'keydown', function (e) {
  11268. 13 === e.keyCode && r.call(this)
  11269. }),
  11270. h.bind(this.__input, 'blur', r),
  11271. h.bind(this.__selector, 'mousedown', function (e) {
  11272. h.addClass(this, 'drag').bind(window, 'mouseup', function (e) {
  11273. h.removeClass(l.__selector, 'drag')
  11274. })
  11275. })
  11276. var c = document.createElement('div')
  11277. p.extend(this.__selector.style, {
  11278. width: '122px',
  11279. height: '102px',
  11280. padding: '3px',
  11281. backgroundColor: '#222',
  11282. boxShadow: '0px 1px 3px rgba(0,0,0,0.3)'
  11283. }),
  11284. p.extend(this.__field_knob.style, {
  11285. position: 'absolute',
  11286. width: '12px',
  11287. height: '12px',
  11288. border: this.__field_knob_border + (this.__color.v < 0.5 ? '#fff' : '#000'),
  11289. boxShadow: '0px 1px 3px rgba(0,0,0,0.5)',
  11290. borderRadius: '12px',
  11291. zIndex: 1
  11292. }),
  11293. p.extend(this.__hue_knob.style, {
  11294. position: 'absolute',
  11295. width: '15px',
  11296. height: '2px',
  11297. borderRight: '4px solid #fff',
  11298. zIndex: 1
  11299. }),
  11300. p.extend(this.__saturation_field.style, {
  11301. width: '100px',
  11302. height: '100px',
  11303. border: '1px solid #555',
  11304. marginRight: '3px',
  11305. display: 'inline-block',
  11306. cursor: 'pointer'
  11307. }),
  11308. p.extend(c.style, {
  11309. width: '100%',
  11310. height: '100%',
  11311. background: 'none'
  11312. }),
  11313. f(c, 'top', 'rgba(0,0,0,0)', '#000'),
  11314. p.extend(this.__hue_field.style, {
  11315. width: '15px',
  11316. height: '100px',
  11317. display: 'inline-block',
  11318. border: '1px solid #555',
  11319. cursor: 'ns-resize'
  11320. }),
  11321. (function (e) {
  11322. ;(e.style.background = ''),
  11323. (e.style.cssText += 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);'),
  11324. (e.style.cssText += 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  11325. (e.style.cssText += 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  11326. (e.style.cssText += 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  11327. (e.style.cssText += 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);')
  11328. })(this.__hue_field),
  11329. p.extend(this.__input.style, {
  11330. outline: 'none',
  11331. textAlign: 'center',
  11332. color: '#fff',
  11333. border: 0,
  11334. fontWeight: 'bold',
  11335. textShadow: this.__input_textShadow + 'rgba(0,0,0,0.7)'
  11336. }),
  11337. h.bind(this.__saturation_field, 'mousedown', i),
  11338. h.bind(this.__field_knob, 'mousedown', i),
  11339. h.bind(this.__hue_field, 'mousedown', function (e) {
  11340. s(e), h.bind(window, 'mousemove', s), h.bind(window, 'mouseup', o)
  11341. }),
  11342. this.__saturation_field.appendChild(c),
  11343. this.__selector.appendChild(this.__field_knob),
  11344. this.__selector.appendChild(this.__saturation_field),
  11345. this.__selector.appendChild(this.__hue_field),
  11346. this.__hue_field.appendChild(this.__hue_knob),
  11347. this.domElement.appendChild(this.__input),
  11348. this.domElement.appendChild(this.__selector),
  11349. this.updateDisplay()
  11350. }
  11351. ;(g.superclass = e),
  11352. p.extend(g.prototype, e.prototype, {
  11353. updateDisplay: function () {
  11354. var t = d(this.getValue())
  11355. if (!1 !== t) {
  11356. var i = !1
  11357. p.each(
  11358. u.COMPONENTS,
  11359. function (e) {
  11360. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e]) return (i = !0), {}
  11361. },
  11362. this
  11363. ),
  11364. i && p.extend(this.__color.__state, t)
  11365. }
  11366. p.extend(this.__temp.__state, this.__color.__state), (this.__temp.a = 1)
  11367. var e = this.__color.v < 0.5 || 0.5 < this.__color.s ? 255 : 0,
  11368. n = 255 - e
  11369. p.extend(this.__field_knob.style, {
  11370. marginLeft: 100 * this.__color.s - 7 + 'px',
  11371. marginTop: 100 * (1 - this.__color.v) - 7 + 'px',
  11372. backgroundColor: this.__temp.toString(),
  11373. border: this.__field_knob_border + 'rgb(' + e + ',' + e + ',' + e + ')'
  11374. }),
  11375. (this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + 'px'),
  11376. (this.__temp.s = 1),
  11377. (this.__temp.v = 1),
  11378. f(this.__saturation_field, 'left', '#fff', this.__temp.toString()),
  11379. p.extend(this.__input.style, {
  11380. backgroundColor: (this.__input.value = this.__color.toString()),
  11381. color: 'rgb(' + e + ',' + e + ',' + e + ')',
  11382. textShadow: this.__input_textShadow + 'rgba(' + n + ',' + n + ',' + n + ',.7)'
  11383. })
  11384. }
  11385. })
  11386. var o = ['-moz-', '-o-', '-webkit-', '-ms-', '']
  11387. return g
  11388. })(
  11389. ee.controllers.Controller,
  11390. ee.dom.dom,
  11391. (ee.color.Color =
  11392. ((o = ee.color.interpret),
  11393. (a = ee.color.math =
  11394. {
  11395. hsv_to_rgb: function (e, t, i) {
  11396. var n = Math.floor(e / 60) % 6,
  11397. r = e / 60 - Math.floor(e / 60),
  11398. o = i * (1 - t),
  11399. a = i * (1 - r * t),
  11400. s = i * (1 - (1 - r) * t),
  11401. l = [
  11402. [i, s, o],
  11403. [a, i, o],
  11404. [o, i, s],
  11405. [o, a, i],
  11406. [s, o, i],
  11407. [i, o, a]
  11408. ][n]
  11409. return {
  11410. r: 255 * l[0],
  11411. g: 255 * l[1],
  11412. b: 255 * l[2]
  11413. }
  11414. },
  11415. rgb_to_hsv: function (e, t, i) {
  11416. var n,
  11417. r = Math.min(e, t, i),
  11418. o = Math.max(e, t, i),
  11419. a = o - r
  11420. return 0 == o
  11421. ? {
  11422. h: NaN,
  11423. s: 0,
  11424. v: 0
  11425. }
  11426. : ((n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a),
  11427. (n /= 6) < 0 && (n += 1),
  11428. {
  11429. h: 360 * n,
  11430. s: a / o,
  11431. v: o / 255
  11432. })
  11433. },
  11434. rgb_to_hex: function (e, t, i) {
  11435. var n = this.hex_with_component(0, 2, e)
  11436. return (n = this.hex_with_component(n, 1, t)), this.hex_with_component(n, 0, i)
  11437. },
  11438. component_from_hex: function (e, t) {
  11439. return (e >> (8 * t)) & 255
  11440. },
  11441. hex_with_component: function (e, t, i) {
  11442. return (i << (c = 8 * t)) | (e & ~(255 << c))
  11443. }
  11444. }),
  11445. (s = ee.color.toString),
  11446. (l = ee.utils.common),
  11447. (ae.COMPONENTS = ['r', 'g', 'b', 'h', 's', 'v', 'hex', 'a']),
  11448. l.extend(ae.prototype, {
  11449. toString: function () {
  11450. return s(this)
  11451. },
  11452. toOriginal: function () {
  11453. return this.__state.conversion.write(this)
  11454. }
  11455. }),
  11456. ie(ae.prototype, 'r', 2),
  11457. ie(ae.prototype, 'g', 1),
  11458. ie(ae.prototype, 'b', 0),
  11459. ne(ae.prototype, 'h'),
  11460. ne(ae.prototype, 's'),
  11461. ne(ae.prototype, 'v'),
  11462. Object.defineProperty(ae.prototype, 'a', {
  11463. get: function () {
  11464. return this.__state.a
  11465. },
  11466. set: function (e) {
  11467. this.__state.a = e
  11468. }
  11469. }),
  11470. Object.defineProperty(ae.prototype, 'hex', {
  11471. get: function () {
  11472. return 'HEX' !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)), this.__state.hex
  11473. },
  11474. set: function (e) {
  11475. ;(this.__state.space = 'HEX'), (this.__state.hex = e)
  11476. }
  11477. }),
  11478. ae)),
  11479. ee.color.interpret,
  11480. ee.utils.common
  11481. )),
  11482. (ee.utils.requestAnimationFrame =
  11483. window.requestAnimationFrame ||
  11484. window.webkitRequestAnimationFrame ||
  11485. window.mozRequestAnimationFrame ||
  11486. window.oRequestAnimationFrame ||
  11487. window.msRequestAnimationFrame ||
  11488. function (e, t) {
  11489. window.setTimeout(e, 1e3 / 60)
  11490. }),
  11491. (ee.dom.CenteredDiv =
  11492. ((n = ee.dom.dom),
  11493. (r = ee.utils.common),
  11494. (te.prototype.show = function () {
  11495. var e = this
  11496. ;(this.backgroundElement.style.display = 'block'),
  11497. (this.domElement.style.display = 'block'),
  11498. (this.domElement.style.opacity = 0),
  11499. (this.domElement.style.webkitTransform = 'scale(1.1)'),
  11500. this.layout(),
  11501. r.defer(function () {
  11502. ;(e.backgroundElement.style.opacity = 1), (e.domElement.style.opacity = 1), (e.domElement.style.webkitTransform = 'scale(1)')
  11503. })
  11504. }),
  11505. (te.prototype.hide = function () {
  11506. var e = this,
  11507. t = function () {
  11508. ;(e.domElement.style.display = 'none'),
  11509. (e.backgroundElement.style.display = 'none'),
  11510. n.unbind(e.domElement, 'webkitTransitionEnd', t),
  11511. n.unbind(e.domElement, 'transitionend', t),
  11512. n.unbind(e.domElement, 'oTransitionEnd', t)
  11513. }
  11514. n.bind(this.domElement, 'webkitTransitionEnd', t),
  11515. n.bind(this.domElement, 'transitionend', t),
  11516. n.bind(this.domElement, 'oTransitionEnd', t),
  11517. (this.backgroundElement.style.opacity = 0),
  11518. (this.domElement.style.opacity = 0),
  11519. (this.domElement.style.webkitTransform = 'scale(1.1)')
  11520. }),
  11521. (te.prototype.layout = function () {
  11522. ;(this.domElement.style.left = $('#player').width() / 2 - n.getWidth(this.domElement) / 2 + 'px'),
  11523. (this.domElement.style.top = $('#player').height() / 2 - n.getHeight(this.domElement) / 2 + 'px')
  11524. }),
  11525. te)),
  11526. ee.dom.dom,
  11527. ee.utils.common
  11528. ))
  11529. },
  11530. {}
  11531. ],
  11532. 94: [
  11533. function (e, t, i) {
  11534. ;(function (J) {
  11535. 'use strict'
  11536. function i(e) {
  11537. function t(e, t) {
  11538. for (var i = 0, n = 0, r = new Array(), o = 1; o <= 16; o++) {
  11539. for (var a = 1; a <= e[o]; a++) (r[t[n]] = []), (r[t[n]][0] = i), (r[t[n]][1] = o), n++, i++
  11540. i *= 2
  11541. }
  11542. return r
  11543. }
  11544. function _(e) {
  11545. 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))
  11546. }
  11547. function b(e) {
  11548. F.push(e)
  11549. }
  11550. function w(e) {
  11551. b((e >> 8) & 255), b(255 & e)
  11552. }
  11553. function T(e, t, i, n, r) {
  11554. for (
  11555. var o,
  11556. a = r[0],
  11557. s = r[240],
  11558. l = (function (e, t) {
  11559. var i,
  11560. n,
  11561. r,
  11562. o,
  11563. a,
  11564. s,
  11565. l,
  11566. c,
  11567. h,
  11568. u,
  11569. d = 0
  11570. for (h = 0; h < 8; ++h) {
  11571. ;(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])
  11572. var p = i + (c = e[d + 7]),
  11573. f = i - c,
  11574. g = n + l,
  11575. m = n - l,
  11576. v = r + s,
  11577. y = r - s,
  11578. A = o + a,
  11579. C = o - a,
  11580. I = p + A,
  11581. E = p - A,
  11582. _ = g + v,
  11583. b = g - v
  11584. ;(e[d] = I + _), (e[d + 4] = I - _)
  11585. var w = 0.707106781 * (b + E)
  11586. ;(e[d + 2] = E + w), (e[d + 6] = E - w)
  11587. var T = 0.382683433 * ((I = C + y) - (b = m + f)),
  11588. x = 0.5411961 * I + T,
  11589. S = 1.306562965 * b + T,
  11590. M = 0.707106781 * (_ = y + m),
  11591. R = f + M,
  11592. P = f - M
  11593. ;(e[d + 5] = P + x), (e[d + 3] = P - x), (e[d + 1] = R + S), (e[d + 7] = R - S), (d += 8)
  11594. }
  11595. for (h = d = 0; h < 8; ++h) {
  11596. ;(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])
  11597. var O = i + (c = e[d + 56]),
  11598. L = i - c,
  11599. D = n + l,
  11600. N = n - l,
  11601. F = r + s,
  11602. B = r - s,
  11603. V = o + a,
  11604. k = o - a,
  11605. U = O + V,
  11606. H = O - V,
  11607. z = D + F,
  11608. G = D - F
  11609. ;(e[d] = U + z), (e[d + 32] = U - z)
  11610. var W = 0.707106781 * (G + H)
  11611. ;(e[d + 16] = H + W), (e[d + 48] = H - W)
  11612. var j = 0.382683433 * ((U = k + B) - (G = N + L)),
  11613. Y = 0.5411961 * U + j,
  11614. q = 1.306562965 * G + j,
  11615. X = 0.707106781 * (z = B + N),
  11616. Z = L + X,
  11617. K = L - X
  11618. ;(e[d + 40] = K + Y), (e[d + 24] = K - Y), (e[d + 8] = Z + q), (e[d + 56] = Z - q), d++
  11619. }
  11620. for (h = 0; h < 64; ++h) (u = e[h] * t[h]), (Q[h] = 0 < u ? (0.5 + u) | 0 : (u - 0.5) | 0)
  11621. return Q
  11622. })(e, t),
  11623. c = 0;
  11624. c < 64;
  11625. ++c
  11626. )
  11627. A[C[c]] = l[c]
  11628. var h = A[0] - i
  11629. ;(i = A[0]), 0 == h ? _(n[0]) : (_(n[y[(o = 32767 + h)]]), _(v[o]))
  11630. for (var u = 63; 0 < u && 0 == A[u]; u--);
  11631. if (0 == u) return _(a), i
  11632. for (var d, p = 1; p <= u; ) {
  11633. for (var f = p; 0 == A[p] && p <= u; ++p);
  11634. var g = p - f
  11635. if (16 <= g) {
  11636. d = g >> 4
  11637. for (var m = 1; m <= d; ++m) _(s)
  11638. g &= 15
  11639. }
  11640. ;(o = 32767 + A[p]), _(r[(g << 4) + y[o]]), _(v[o]), p++
  11641. }
  11642. return 63 != u && _(a), i
  11643. }
  11644. function x(e) {
  11645. if ((e <= 0 && (e = 1), 100 < e && (e = 100), i != e)) {
  11646. ;(function (e) {
  11647. for (
  11648. var t = [
  11649. 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,
  11650. 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99
  11651. ],
  11652. i = 0;
  11653. i < 64;
  11654. i++
  11655. ) {
  11656. var n = u((t[i] * e + 50) / 100)
  11657. n < 1 ? (n = 1) : 255 < n && (n = 255), (O[C[i]] = n)
  11658. }
  11659. for (
  11660. var r = [
  11661. 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,
  11662. 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99
  11663. ],
  11664. o = 0;
  11665. o < 64;
  11666. o++
  11667. ) {
  11668. var a = u((r[o] * e + 50) / 100)
  11669. a < 1 ? (a = 1) : 255 < a && (a = 255), (L[C[o]] = a)
  11670. }
  11671. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958, 0.5411961, 0.275899379], l = 0, c = 0; c < 8; c++)
  11672. 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++
  11673. })(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11674. (i = e)
  11675. }
  11676. }
  11677. var S,
  11678. M,
  11679. R,
  11680. P,
  11681. i,
  11682. u = (Math.round, Math.floor),
  11683. O = new Array(64),
  11684. L = new Array(64),
  11685. D = new Array(64),
  11686. N = new Array(64),
  11687. v = new Array(65535),
  11688. y = new Array(65535),
  11689. Q = new Array(64),
  11690. A = new Array(64),
  11691. F = [],
  11692. B = 0,
  11693. V = 7,
  11694. k = new Array(64),
  11695. U = new Array(64),
  11696. H = new Array(64),
  11697. n = new Array(256),
  11698. z = new Array(2048),
  11699. C = [
  11700. 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,
  11701. 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63
  11702. ],
  11703. G = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
  11704. W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
  11705. j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125],
  11706. Y = [
  11707. 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,
  11708. 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,
  11709. 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,
  11710. 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,
  11711. 248, 249, 250
  11712. ],
  11713. q = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
  11714. X = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
  11715. Z = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119],
  11716. K = [
  11717. 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,
  11718. 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,
  11719. 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,
  11720. 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,
  11721. 248, 249, 250
  11722. ]
  11723. ;(this.encode = function (e, t) {
  11724. var i = (new Date().getTime(), t.quality)
  11725. i && x(i),
  11726. (F = new Array()),
  11727. (B = 0),
  11728. (V = 7),
  11729. w(65496),
  11730. w(65504),
  11731. w(16),
  11732. b(74),
  11733. b(70),
  11734. b(73),
  11735. b(70),
  11736. b(0),
  11737. b(1),
  11738. b(1),
  11739. b(0),
  11740. w(1),
  11741. w(1),
  11742. b(0),
  11743. b(0),
  11744. (function () {
  11745. w(65499), w(132), b(0)
  11746. for (var e = 0; e < 64; e++) b(O[e])
  11747. b(1)
  11748. for (var t = 0; t < 64; t++) b(L[t])
  11749. })(),
  11750. (function (e, t) {
  11751. 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)
  11752. })(e.width, e.height),
  11753. (function () {
  11754. w(65476), w(418), b(0)
  11755. for (var e = 0; e < 16; e++) b(G[e + 1])
  11756. for (var t = 0; t <= 11; t++) b(W[t])
  11757. b(16)
  11758. for (var i = 0; i < 16; i++) b(j[i + 1])
  11759. for (var n = 0; n <= 161; n++) b(Y[n])
  11760. b(1)
  11761. for (var r = 0; r < 16; r++) b(q[r + 1])
  11762. for (var o = 0; o <= 11; o++) b(X[o])
  11763. b(17)
  11764. for (var a = 0; a < 16; a++) b(Z[a + 1])
  11765. for (var s = 0; s <= 161; s++) b(K[s])
  11766. })(),
  11767. w(65498),
  11768. w(12),
  11769. b(3),
  11770. b(1),
  11771. b(0),
  11772. b(2),
  11773. b(17),
  11774. b(3),
  11775. b(17),
  11776. b(0),
  11777. b(63),
  11778. b(0)
  11779. var n = 0,
  11780. r = 0,
  11781. o = 0
  11782. ;(B = 0), (V = 7), (this.encode.displayName = '_encode_')
  11783. 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); ) {
  11784. for (a = 0; a < A; ) {
  11785. for (u = h = A * C + a, d = -1, f = p = 0; f < 64; f++)
  11786. (u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f))),
  11787. v <= C + p && (u -= A * (C + 1 + p - v)),
  11788. A <= a + d && (u -= a + d - A + 4),
  11789. (s = g[u++]),
  11790. (l = g[u++]),
  11791. (c = g[u++]),
  11792. (k[f] = ((z[s] + z[(l + 256) >> 0] + z[(c + 512) >> 0]) >> 16) - 128),
  11793. (U[f] = ((z[(s + 768) >> 0] + z[(l + 1024) >> 0] + z[(c + 1280) >> 0]) >> 16) - 128),
  11794. (H[f] = ((z[(s + 1280) >> 0] + z[(l + 1536) >> 0] + z[(c + 1792) >> 0]) >> 16) - 128)
  11795. ;(n = T(k, D, n, S, R)), (r = T(U, N, r, M, P)), (o = T(H, N, o, M, P)), (a += 32)
  11796. }
  11797. C += I
  11798. }
  11799. if (0 <= V) {
  11800. var E = []
  11801. ;(E[1] = V + 1), (E[0] = (1 << (V + 1)) - 1), _(E)
  11802. }
  11803. return w(65497), new J(F)
  11804. }),
  11805. new Date().getTime(),
  11806. (e = e || 50),
  11807. (function () {
  11808. for (var e = String.fromCharCode, t = 0; t < 256; t++) n[t] = e(t)
  11809. })(),
  11810. (S = t(G, W)),
  11811. (M = t(q, X)),
  11812. (R = t(j, Y)),
  11813. (P = t(Z, K)),
  11814. (function () {
  11815. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11816. for (var n = e; n < t; n++) (y[32767 + n] = i), (v[32767 + n] = []), (v[32767 + n][1] = i), (v[32767 + n][0] = n)
  11817. 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)
  11818. ;(e <<= 1), (t <<= 1)
  11819. }
  11820. })(),
  11821. (function () {
  11822. for (var e = 0; e < 256; e++)
  11823. (z[e] = 19595 * e),
  11824. (z[(e + 256) >> 0] = 38470 * e),
  11825. (z[(e + 512) >> 0] = 7471 * e + 32768),
  11826. (z[(e + 768) >> 0] = -11059 * e),
  11827. (z[(e + 1024) >> 0] = -21709 * e),
  11828. (z[(e + 1280) >> 0] = 32768 * e + 8421375),
  11829. (z[(e + 1536) >> 0] = -27439 * e),
  11830. (z[(e + 1792) >> 0] = -5329 * e)
  11831. })(),
  11832. x(e),
  11833. new Date().getTime()
  11834. }
  11835. t.exports.encode = function (e, t) {
  11836. return (
  11837. ((t = t || {}).quality = t.quality || 50),
  11838. {
  11839. data: new i(t.quality).encode(e, t),
  11840. width: e.width,
  11841. height: e.height
  11842. }
  11843. )
  11844. }
  11845. }).call(this, e('buffer').Buffer)
  11846. },
  11847. {
  11848. buffer: 198
  11849. }
  11850. ],
  11851. 95: [
  11852. function (e, t, i) {
  11853. 'use strict'
  11854. !(function () {
  11855. if (
  11856. ('performance' in window == 0 && (window.performance = {}),
  11857. (Date.now =
  11858. Date.now ||
  11859. function () {
  11860. return new Date().getTime()
  11861. }),
  11862. 'now' in window.performance == 0)
  11863. ) {
  11864. var e = Date.now()
  11865. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11866. (window.performance.now = function () {
  11867. return Date.now() - e
  11868. })
  11869. }
  11870. })()
  11871. },
  11872. {}
  11873. ],
  11874. 96: [
  11875. function (e, t, i) {
  11876. 'use strict'
  11877. var a = e('three')
  11878. ;(a.EffectComposer = function (e, t) {
  11879. if (((this.renderer = e), void 0 === t)) {
  11880. var i = {
  11881. minFilter: a.LinearFilter,
  11882. magFilter: a.LinearFilter,
  11883. format: a.RGBAFormat,
  11884. stencilBuffer: !1
  11885. },
  11886. n = e.getSize()
  11887. t = new a.WebGLRenderTarget(n.width, n.height, i)
  11888. }
  11889. ;(this.renderTarget1 = t),
  11890. (this.renderTarget2 = t.clone()),
  11891. (this.writeBuffer = this.renderTarget1),
  11892. (this.readBuffer = this.renderTarget2),
  11893. (this.passes = []),
  11894. void 0 === a.CopyShader && console.error('THREE.EffectComposer relies on THREE.CopyShader'),
  11895. (this.copyPass = new a.ShaderPass(a.CopyShader))
  11896. }),
  11897. (a.EffectComposer.prototype = {
  11898. swapBuffers: function () {
  11899. var e = this.readBuffer
  11900. ;(this.readBuffer = this.writeBuffer), (this.writeBuffer = e)
  11901. },
  11902. addPass: function (e) {
  11903. this.passes.push(e)
  11904. },
  11905. insertPass: function (e, t) {
  11906. this.passes.splice(t, 0, e)
  11907. },
  11908. render: function (e) {
  11909. ;(this.writeBuffer = this.renderTarget1), (this.readBuffer = this.renderTarget2)
  11910. var t,
  11911. i,
  11912. n = !1,
  11913. r = this.passes.length
  11914. for (i = 0; i < r; i++)
  11915. if ((t = this.passes[i]).enabled) {
  11916. if ((t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n), t.needsSwap)) {
  11917. if (n) {
  11918. var o = this.renderer.context
  11919. o.stencilFunc(o.NOTEQUAL, 1, 4294967295), this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e), o.stencilFunc(o.EQUAL, 1, 4294967295)
  11920. }
  11921. this.swapBuffers()
  11922. }
  11923. t instanceof a.MaskPass ? (n = !0) : t instanceof a.ClearMaskPass && (n = !1)
  11924. }
  11925. },
  11926. reset: function (e) {
  11927. if (void 0 === e) {
  11928. var t = this.renderer.getSize()
  11929. ;(e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11930. }
  11931. this.renderTarget1.dispose(),
  11932. this.renderTarget2.dispose(),
  11933. (this.renderTarget1 = e),
  11934. (this.renderTarget2 = e.clone()),
  11935. (this.writeBuffer = this.renderTarget1),
  11936. (this.readBuffer = this.renderTarget2)
  11937. },
  11938. setSize: function (e, t) {
  11939. this.renderTarget1.setSize(e, t), this.renderTarget2.setSize(e, t)
  11940. this.passes.forEach(a => {
  11941. //add for TransitionPass
  11942. a.setSize && a.setSize(e, t)
  11943. })
  11944. }
  11945. })
  11946. },
  11947. {
  11948. three: 217
  11949. }
  11950. ],
  11951. 97: [
  11952. function (e, t, i) {
  11953. 'use strict'
  11954. var n = e('three')
  11955. ;(n.MaskPass = function (e, t) {
  11956. ;(this.scene = e), (this.camera = t), (this.enabled = !0), (this.clear = !0), (this.needsSwap = !1), (this.inverse = !1)
  11957. }),
  11958. (n.MaskPass.prototype = {
  11959. render: function (e, t, i, n) {
  11960. var r,
  11961. o,
  11962. a = e.context
  11963. a.colorMask(!1, !1, !1, !1),
  11964. a.depthMask(!1),
  11965. (o = this.inverse ? ((r = 0), 1) : ((r = 1), 0)),
  11966. a.enable(a.STENCIL_TEST),
  11967. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11968. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11969. a.clearStencil(o),
  11970. e.render(this.scene, this.camera, i, this.clear),
  11971. e.render(this.scene, this.camera, t, this.clear),
  11972. a.colorMask(!0, !0, !0, !0),
  11973. a.depthMask(!0),
  11974. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11975. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11976. }
  11977. }),
  11978. (n.ClearMaskPass = function () {
  11979. this.enabled = !0
  11980. }),
  11981. (n.ClearMaskPass.prototype = {
  11982. render: function (e, t, i, n) {
  11983. var r = e.context
  11984. r.disable(r.STENCIL_TEST)
  11985. }
  11986. })
  11987. },
  11988. {
  11989. three: 217
  11990. }
  11991. ],
  11992. 98: [
  11993. function (e, t, i) {
  11994. 'use strict'
  11995. var o = e('three')
  11996. ;(o.RenderPass = function (e, t, i, n, r) {
  11997. ;(this.scene = e),
  11998. (this.camera = t),
  11999. (this.overrideMaterial = i),
  12000. (this.clearColor = n),
  12001. (this.clearAlpha = void 0 !== r ? r : 1),
  12002. (this.oldClearColor = new o.Color()),
  12003. (this.oldClearAlpha = 1),
  12004. (this.enabled = !0),
  12005. (this.clear = !0),
  12006. (this.needsSwap = !1)
  12007. }),
  12008. (o.RenderPass.prototype = {
  12009. render: function (e, t, i, n) {
  12010. ;(this.scene.overrideMaterial = this.overrideMaterial),
  12011. this.clearColor && (this.oldClearColor.copy(e.getClearColor()), (this.oldClearAlpha = e.getClearAlpha()), e.setClearColor(this.clearColor, this.clearAlpha)),
  12012. e.render(this.scene, this.camera, i, this.clear),
  12013. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  12014. (this.scene.overrideMaterial = null)
  12015. }
  12016. })
  12017. },
  12018. {
  12019. three: 217
  12020. }
  12021. ],
  12022. 99: [
  12023. function (e, t, i) {
  12024. 'use strict'
  12025. var n = e('three')
  12026. ;(n.ShaderPass = function (e, t) {
  12027. ;(this.textureID = void 0 !== t ? t : 'tDiffuse'),
  12028. e instanceof n.ShaderMaterial
  12029. ? ((this.uniforms = e.uniforms), (this.material = e))
  12030. : e &&
  12031. ((this.uniforms = n.UniformsUtils.clone(e.uniforms)),
  12032. (this.material = new n.ShaderMaterial({
  12033. defines: e.defines || {},
  12034. uniforms: this.uniforms,
  12035. vertexShader: e.vertexShader,
  12036. fragmentShader: e.fragmentShader
  12037. }))),
  12038. (this.renderToScreen = !1),
  12039. (this.enabled = !0),
  12040. (this.needsSwap = !0),
  12041. (this.clear = !1),
  12042. (this.camera = new n.OrthographicCamera(-1, 1, 1, -1, 0, 1)),
  12043. (this.scene = new n.Scene()),
  12044. (this.quad = new n.Mesh(new n.PlaneBufferGeometry(2, 2), null)),
  12045. this.scene.add(this.quad)
  12046. }),
  12047. (n.ShaderPass.prototype = {
  12048. render: function (e, t, i, n) {
  12049. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  12050. (this.quad.material = this.material),
  12051. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  12052. }
  12053. })
  12054. },
  12055. {
  12056. three: 217
  12057. }
  12058. ],
  12059. 100: [
  12060. function (e, t, i) {
  12061. 'use strict'
  12062. e('three').CopyShader = {
  12063. uniforms: {
  12064. tDiffuse: {
  12065. type: 't',
  12066. value: null
  12067. },
  12068. opacity: {
  12069. type: 'f',
  12070. value: 1
  12071. }
  12072. },
  12073. vertexShader: ['varying vec2 vUv;', 'void main() {', 'vUv = uv;', 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );', '}'].join('\n'),
  12074. fragmentShader: [
  12075. 'uniform float opacity;',
  12076. 'uniform sampler2D tDiffuse;',
  12077. 'varying vec2 vUv;',
  12078. 'void main() {',
  12079. 'vec4 texel = texture2D( tDiffuse, vUv );',
  12080. 'gl_FragColor = opacity * texel;',
  12081. '}'
  12082. ].join('\n')
  12083. }
  12084. },
  12085. {
  12086. three: 217
  12087. }
  12088. ],
  12089. 101: [
  12090. function (e, t, i) {
  12091. 'use strict'
  12092. e('three').HorizontalBlurShader = {
  12093. uniforms: {
  12094. tDiffuse: {
  12095. type: 't',
  12096. value: null
  12097. },
  12098. h: {
  12099. type: 'f',
  12100. value: 1 / 512
  12101. }
  12102. },
  12103. vertexShader: ['varying vec2 vUv;', 'void main() {', 'vUv = uv;', 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );', '}'].join('\n'),
  12104. fragmentShader: [
  12105. 'uniform sampler2D tDiffuse;',
  12106. 'uniform float h;',
  12107. 'varying vec2 vUv;',
  12108. 'void main() {',
  12109. 'vec4 sum = vec4( 0.0 );',
  12110. 'sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;',
  12111. 'sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;',
  12112. 'sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;',
  12113. 'sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;',
  12114. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;',
  12115. 'sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;',
  12116. 'sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;',
  12117. 'sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;',
  12118. 'sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;',
  12119. 'gl_FragColor = sum;',
  12120. '}'
  12121. ].join('\n')
  12122. }
  12123. },
  12124. {
  12125. three: 217
  12126. }
  12127. ],
  12128. 102: [
  12129. function (e, t, i) {
  12130. 'use strict'
  12131. e('three').VerticalBlurShader = {
  12132. uniforms: {
  12133. tDiffuse: {
  12134. type: 't',
  12135. value: null
  12136. },
  12137. v: {
  12138. type: 'f',
  12139. value: 1 / 512
  12140. }
  12141. },
  12142. vertexShader: ['varying vec2 vUv;', 'void main() {', 'vUv = uv;', 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );', '}'].join('\n'),
  12143. fragmentShader: [
  12144. 'uniform sampler2D tDiffuse;',
  12145. 'uniform float v;',
  12146. 'varying vec2 vUv;',
  12147. 'void main() {',
  12148. 'vec4 sum = vec4( 0.0 );',
  12149. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;',
  12150. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;',
  12151. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;',
  12152. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;',
  12153. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;',
  12154. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;',
  12155. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;',
  12156. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;',
  12157. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;',
  12158. 'gl_FragColor = sum;',
  12159. '}'
  12160. ].join('\n')
  12161. }
  12162. },
  12163. {
  12164. three: 217
  12165. }
  12166. ],
  12167. 103: [
  12168. function (e, t, i) {
  12169. 'use strict'
  12170. var z = e('three')
  12171. !(function () {
  12172. if (('performance' in window == 0 && (window.performance = {}), 'now' in window.performance == 0)) {
  12173. var e = Date.now()
  12174. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12175. (window.performance.now = function () {
  12176. return Date.now() - e
  12177. })
  12178. }
  12179. })(),
  12180. (z.WebGLRenderer.prototype.paramThreeToGL = function (e) {
  12181. var t,
  12182. i = this.extensions,
  12183. n = this.context
  12184. if (e === z.RepeatWrapping) return n.REPEAT
  12185. if (e === z.ClampToEdgeWrapping) return n.CLAMP_TO_EDGE
  12186. if (e === z.MirroredRepeatWrapping) return n.MIRRORED_REPEAT
  12187. if (e === z.NearestFilter) return n.NEAREST
  12188. if (e === z.NearestMipMapNearestFilter) return n.NEAREST_MIPMAP_NEAREST
  12189. if (e === z.NearestMipMapLinearFilter) return n.NEAREST_MIPMAP_LINEAR
  12190. if (e === z.LinearFilter) return n.LINEAR
  12191. if (e === z.LinearMipMapNearestFilter) return n.LINEAR_MIPMAP_NEAREST
  12192. if (e === z.LinearMipMapLinearFilter) return n.LINEAR_MIPMAP_LINEAR
  12193. if (e === z.UnsignedByteType) return n.UNSIGNED_BYTE
  12194. if (e === z.UnsignedShort4444Type) return n.UNSIGNED_SHORT_4_4_4_4
  12195. if (e === z.UnsignedShort5551Type) return n.UNSIGNED_SHORT_5_5_5_1
  12196. if (e === z.UnsignedShort565Type) return n.UNSIGNED_SHORT_5_6_5
  12197. if (e === z.ByteType) return n.BYTE
  12198. if (e === z.ShortType) return n.SHORT
  12199. if (e === z.UnsignedShortType) return n.UNSIGNED_SHORT
  12200. if (e === z.IntType) return n.INT
  12201. if (e === z.UnsignedIntType) return n.UNSIGNED_INT
  12202. if (e === z.FloatType) return n.FLOAT
  12203. if (null !== (t = i.get('OES_texture_half_float')) && e === z.HalfFloatType) return t.HALF_FLOAT_OES
  12204. if (e === z.AlphaFormat) return n.ALPHA
  12205. if (e === z.RGBFormat) return n.RGB
  12206. if (e === z.RGBAFormat) return n.RGBA
  12207. if (e === z.LuminanceFormat) return n.LUMINANCE
  12208. if (e === z.LuminanceAlphaFormat) return n.LUMINANCE_ALPHA
  12209. if (e === z.AddEquation) return n.FUNC_ADD
  12210. if (e === z.SubtractEquation) return n.FUNC_SUBTRACT
  12211. if (e === z.ReverseSubtractEquation) return n.FUNC_REVERSE_SUBTRACT
  12212. if (e === z.ZeroFactor) return n.ZERO
  12213. if (e === z.OneFactor) return n.ONE
  12214. if (e === z.SrcColorFactor) return n.SRC_COLOR
  12215. if (e === z.OneMinusSrcColorFactor) return n.ONE_MINUS_SRC_COLOR
  12216. if (e === z.SrcAlphaFactor) return n.SRC_ALPHA
  12217. if (e === z.OneMinusSrcAlphaFactor) return n.ONE_MINUS_SRC_ALPHA
  12218. if (e === z.DstAlphaFactor) return n.DST_ALPHA
  12219. if (e === z.OneMinusDstAlphaFactor) return n.ONE_MINUS_DST_ALPHA
  12220. if (e === z.DstColorFactor) return n.DST_COLOR
  12221. if (e === z.OneMinusDstColorFactor) return n.ONE_MINUS_DST_COLOR
  12222. if (e === z.SrcAlphaSaturateFactor) return n.SRC_ALPHA_SATURATE
  12223. if (null !== (t = i.get('WEBGL_compressed_texture_s3tc'))) {
  12224. if (e === z.RGB_S3TC_DXT1_Format) return t.COMPRESSED_RGB_S3TC_DXT1_EXT
  12225. if (e === z.RGBA_S3TC_DXT1_Format) return t.COMPRESSED_RGBA_S3TC_DXT1_EXT
  12226. if (e === z.RGBA_S3TC_DXT3_Format) return t.COMPRESSED_RGBA_S3TC_DXT3_EXT
  12227. if (e === z.RGBA_S3TC_DXT5_Format) return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12228. }
  12229. if (null !== (t = i.get('WEBGL_compressed_texture_pvrtc'))) {
  12230. if (e === z.RGB_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG
  12231. if (e === z.RGB_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG
  12232. if (e === z.RGBA_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
  12233. if (e === z.RGBA_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12234. }
  12235. if (null !== (t = i.get('WEBGL_compressed_texture_etc1')) && e === z.RGB_ETC1_Format) return t.COMPRESSED_RGB_ETC1_WEBGL
  12236. if (null !== (t = i.get('EXT_blend_minmax'))) {
  12237. if (e === z.MinEquation) return t.MIN_EXT
  12238. if (e === z.MaxEquation) return t.MAX_EXT
  12239. }
  12240. return 0
  12241. }),
  12242. (z.WebGLState = function (l, i, c) {
  12243. var n = this,
  12244. r = new z.Vector4(),
  12245. e = l.getParameter(l.MAX_VERTEX_ATTRIBS),
  12246. o = new Uint8Array(e),
  12247. a = new Uint8Array(e),
  12248. s = new Uint8Array(e),
  12249. t = {},
  12250. h = null,
  12251. u = null,
  12252. d = null,
  12253. p = null,
  12254. f = null,
  12255. g = null,
  12256. m = null,
  12257. v = null,
  12258. y = !1,
  12259. A = null,
  12260. C = null,
  12261. I = null,
  12262. E = null,
  12263. _ = null,
  12264. b = null,
  12265. w = null,
  12266. T = null,
  12267. x = null,
  12268. S = null,
  12269. M = null,
  12270. R = null,
  12271. P = null,
  12272. O = null,
  12273. L = null,
  12274. D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),
  12275. N = void 0,
  12276. F = {},
  12277. B = new z.Vector4(),
  12278. V = null,
  12279. k = null,
  12280. U = new z.Vector4(),
  12281. H = new z.Vector4()
  12282. ;(this.init = function () {
  12283. this.clearColor(0, 0, 0, 1),
  12284. this.clearDepth(1),
  12285. this.clearStencil(0),
  12286. this.enable(l.DEPTH_TEST),
  12287. l.depthFunc(l.LEQUAL),
  12288. l.frontFace(l.CCW),
  12289. l.cullFace(l.BACK),
  12290. this.enable(l.CULL_FACE),
  12291. this.enable(l.BLEND),
  12292. l.blendEquation(l.FUNC_ADD),
  12293. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  12294. }),
  12295. (this.initAttributes = function () {
  12296. for (var e = 0, t = o.length; e < t; e++) o[e] = 0
  12297. }),
  12298. (this.enableAttribute = function (e) {
  12299. ;(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))
  12300. }),
  12301. (this.enableAttributeAndDivisor = function (e, t, i) {
  12302. ;(o[e] = 1), 0 === a[e] && (l.enableVertexAttribArray(e), (a[e] = 1)), s[e] !== t && (i.vertexAttribDivisorANGLE(e, t), (s[e] = t))
  12303. }),
  12304. (this.disableUnusedAttributes = function () {
  12305. for (var e = 0, t = a.length; e < t; e++) a[e] !== o[e] && (l.disableVertexAttribArray(e), (a[e] = 0))
  12306. }),
  12307. (this.enable = function (e) {
  12308. !0 !== t[e] && (l.enable(e), (t[e] = !0))
  12309. }),
  12310. (this.disable = function (e) {
  12311. !1 !== t[e] && (l.disable(e), (t[e] = !1))
  12312. }),
  12313. (this.getCompressedTextureFormats = function () {
  12314. if (null === h && ((h = []), i.get('WEBGL_compressed_texture_pvrtc') || i.get('WEBGL_compressed_texture_s3tc') || i.get('WEBGL_compressed_texture_etc1')))
  12315. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++) h.push(e[t])
  12316. return h
  12317. }),
  12318. (this.setBlending = function (e, t, i, n, r, o, a, s) {
  12319. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  12320. (e === u && s === y) ||
  12321. (e === z.AdditiveBlending
  12322. ? s
  12323. ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE))
  12324. : (l.blendEquation(l.FUNC_ADD), l.blendFunc(l.SRC_ALPHA, l.ONE))
  12325. : e === z.SubtractiveBlending
  12326. ? s
  12327. ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA))
  12328. : (l.blendEquation(l.FUNC_ADD), l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR))
  12329. : e === z.MultiplyBlending
  12330. ? s
  12331. ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA))
  12332. : (l.blendEquation(l.FUNC_ADD), l.blendFunc(l.ZERO, l.SRC_COLOR))
  12333. : s
  12334. ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA))
  12335. : (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)),
  12336. (u = e),
  12337. (y = s)),
  12338. e === z.CustomBlending
  12339. ? ((r = r || t),
  12340. (o = o || i),
  12341. (a = a || n),
  12342. (t === d && r === g) || (l.blendEquationSeparate(c(t), c(r)), (d = t), (g = r)),
  12343. (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)))
  12344. : (v = m = g = f = p = d = null)
  12345. }),
  12346. (this.setDepthFunc = function (e) {
  12347. if (A !== e) {
  12348. if (e)
  12349. switch (e) {
  12350. case z.NeverDepth:
  12351. l.depthFunc(l.NEVER)
  12352. break
  12353. case z.AlwaysDepth:
  12354. l.depthFunc(l.ALWAYS)
  12355. break
  12356. case z.LessDepth:
  12357. l.depthFunc(l.LESS)
  12358. break
  12359. case z.LessEqualDepth:
  12360. l.depthFunc(l.LEQUAL)
  12361. break
  12362. case z.EqualDepth:
  12363. l.depthFunc(l.EQUAL)
  12364. break
  12365. case z.GreaterEqualDepth:
  12366. l.depthFunc(l.GEQUAL)
  12367. break
  12368. case z.GreaterDepth:
  12369. l.depthFunc(l.GREATER)
  12370. break
  12371. case z.NotEqualDepth:
  12372. l.depthFunc(l.NOTEQUAL)
  12373. break
  12374. default:
  12375. l.depthFunc(l.LEQUAL)
  12376. }
  12377. else l.depthFunc(l.LEQUAL)
  12378. A = e
  12379. }
  12380. }),
  12381. (this.setDepthTest = function (e) {
  12382. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  12383. }),
  12384. (this.setDepthWrite = function (e) {
  12385. C !== e && (l.depthMask(e), (C = e))
  12386. }),
  12387. (this.setColorWrite = function (e) {
  12388. I !== e && (l.colorMask(e, e, e, e), (I = e))
  12389. }),
  12390. (this.setStencilFunc = function (e, t, i) {
  12391. ;(_ === e && b === t && w === i) || (l.stencilFunc(e, t, i), (_ = e), (b = t), (w = i))
  12392. }),
  12393. (this.setStencilOp = function (e, t, i) {
  12394. ;(T === e && x === t && S === i) || (l.stencilOp(e, t, i), (T = e), (x = t), (S = i))
  12395. }),
  12396. (this.setStencilTest = function (e) {
  12397. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  12398. }),
  12399. (this.setStencilWrite = function (e) {
  12400. E !== e && (l.stencilMask(e), (E = e))
  12401. }),
  12402. (this.setFlipSided = function (e) {
  12403. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW), (M = e))
  12404. }),
  12405. (this.setLineWidth = function (e) {
  12406. e !== R && (l.lineWidth(e), (R = e))
  12407. }),
  12408. (this.setPolygonOffset = function (e, t, i) {
  12409. 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))
  12410. }),
  12411. (this.getScissorTest = function () {
  12412. return L
  12413. }),
  12414. (this.setScissorTest = function (e) {
  12415. ;(L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  12416. }),
  12417. (this.activeTexture = function (e) {
  12418. void 0 === e && (e = l.TEXTURE0 + D - 1), N !== e && (l.activeTexture(e), (N = e))
  12419. }),
  12420. (this.bindTexture = function (e, t) {
  12421. void 0 === N && n.activeTexture()
  12422. var i = F[N]
  12423. void 0 === i &&
  12424. ((i = {
  12425. type: void 0,
  12426. texture: void 0
  12427. }),
  12428. (F[N] = i)),
  12429. (i.type === e && i.texture === t) || (l.bindTexture(e, t), (i.type = e), (i.texture = t))
  12430. }),
  12431. (this.compressedTexImage2D = function () {
  12432. try {
  12433. l.compressedTexImage2D.apply(l, arguments)
  12434. } catch (e) {
  12435. console.error(e)
  12436. }
  12437. }),
  12438. (this.texImage2D = function () {
  12439. try {
  12440. l.texImage2D.apply(l, arguments)
  12441. } catch (e) {
  12442. console.error(e)
  12443. }
  12444. }),
  12445. (this.clearColor = function (e, t, i, n) {
  12446. r.set(e, t, i, n), !1 === B.equals(r) && (l.clearColor(e, t, i, n), B.copy(r))
  12447. }),
  12448. (this.clearDepth = function (e) {
  12449. V !== e && (l.clearDepth(e), (V = e))
  12450. }),
  12451. (this.clearStencil = function (e) {
  12452. k !== e && (l.clearStencil(e), (k = e))
  12453. }),
  12454. (this.scissor = function (e) {
  12455. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w), U.copy(e))
  12456. }),
  12457. (this.viewport = function (e) {
  12458. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w), H.copy(e))
  12459. }),
  12460. (this.reset = function () {
  12461. for (var e = 0; e < a.length; e++) 1 === a[e] && (l.disableVertexAttribArray(e), (a[e] = 0))
  12462. ;(t = {}), (N = void 0), (F = {}), (M = E = C = I = u = h = null)
  12463. })
  12464. })
  12465. },
  12466. {
  12467. three: 217
  12468. }
  12469. ],
  12470. 104: [
  12471. function (a, h, e) {
  12472. ;(function (i, e) {
  12473. 'use strict'
  12474. function t(e) {
  12475. this.urls = e
  12476. var t = i(
  12477. 'bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==',
  12478. 'base64'
  12479. )
  12480. ;(this.builder = n.loadProto(t)), (this.decoder = this.builder.build('binary_mesh'))
  12481. }
  12482. var s = a('three'),
  12483. n = a('protobufjs'),
  12484. r = a('../util/logger'),
  12485. o = (a('../util/common'), a('../util/ajax')),
  12486. l = a('../objects/Chunk'),
  12487. c = new r(e)
  12488. ;(t.prototype = {
  12489. constructor: t,
  12490. load: function (t, i, n, r) {
  12491. return (
  12492. c.time('download'),
  12493. o
  12494. .get(t, {
  12495. responseType: 'arraybuffer'
  12496. })
  12497. .done(
  12498. function (e) {
  12499. c.timeEnd('download'), this.parse(e, t, i, n, r)
  12500. }.bind(this)
  12501. )
  12502. .fail(r)
  12503. )
  12504. },
  12505. parse: function (e, t, i, n, r) {
  12506. var o = this.readProtobuf(e)
  12507. if (!o) return r()
  12508. try {
  12509. c.time('convert to webgl'), this.convertProtobufToSceneObject(o, t, i, n, r), c.timeEnd('convert to webgl')
  12510. } catch (e) {
  12511. return c.error('failed parsing .dam'), c.error(e.message), r()
  12512. }
  12513. },
  12514. readProtobuf: function (e) {
  12515. var t
  12516. try {
  12517. c.time('parse proto'), (t = this.decoder.decode(e)), c.timeEnd('parse proto')
  12518. } catch (e) {
  12519. return c.error('failed parsing proto for .dam'), c.error(e.message), null
  12520. }
  12521. return t
  12522. },
  12523. convertProtobufToSceneObject: function (e, i, t, n, r) {
  12524. if (0 === e.chunk.length) return c.warn('No chunks in damfile...'), t([])
  12525. var o = new s.Matrix4()
  12526. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1)
  12527. var a = e.chunk.map(function (e) {
  12528. var t = new s.BufferGeometry()
  12529. return (
  12530. t.addAttribute('position', new s.BufferAttribute(new Float32Array(e.vertices.xyz, 0, 3), 3)),
  12531. 0 < e.vertices.uv.length && t.addAttribute('uv', new s.BufferAttribute(new Float32Array(e.vertices.uv, 0, 2), 2)),
  12532. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces, 0, 1), 1)),
  12533. t.applyMatrix(o),
  12534. t.computeBoundingBox(),
  12535. new l({
  12536. geometry: t,
  12537. textureName: e.material_name,
  12538. name: e.chunk_name,
  12539. meshUrl: i
  12540. })
  12541. )
  12542. })
  12543. return a ? t(a) : (c.error('.dam protobuf came out with no chunks...'), r())
  12544. }
  12545. }),
  12546. (h.exports = t)
  12547. }).call(this, a('buffer').Buffer, '/js/loaders/DamLoader.js')
  12548. },
  12549. {
  12550. '../objects/Chunk': 144,
  12551. '../util/ajax': 181,
  12552. '../util/common': 185,
  12553. '../util/logger': 189,
  12554. buffer: 198,
  12555. protobufjs: 214,
  12556. three: 217
  12557. }
  12558. ],
  12559. 105: [
  12560. function (n, r, e) {
  12561. ;(function (e) {
  12562. 'use strict'
  12563. var t = (n('three'), n('../settings'), n('../util/browser'), n('./DamLoader')),
  12564. i = n('../util/logger'),
  12565. u = (n('../ab'), new i(e))
  12566. r.exports = {
  12567. getLoaders: function () {
  12568. return [
  12569. ['_50k', '.dam', t],
  12570. ['', '.dam', t]
  12571. ]
  12572. },
  12573. load: function (e, t, i, n, r, o) {
  12574. var a = this.getLoaders()[(o = o || 0)]
  12575. if (a) {
  12576. var s = a[0],
  12577. l = a[1],
  12578. c = new a[2](t),
  12579. h = t.get(e + s + l)
  12580. h
  12581. ? (u.debug('Trying ' + s + l),
  12582. c.load(
  12583. h,
  12584. i,
  12585. n,
  12586. function () {
  12587. this.load(e, t, i, n, r, ++o)
  12588. }.bind(this)
  12589. ))
  12590. : (u.debug('Skipping ' + l + ', not available'), this.load(e, t, i, n, r, ++o))
  12591. } else r && r('No suitable model file found...')
  12592. }
  12593. }
  12594. }).call(this, '/js/loaders/ModelLoader.js')
  12595. },
  12596. {
  12597. '../ab': 3,
  12598. '../settings': 166,
  12599. '../util/browser': 182,
  12600. '../util/logger': 189,
  12601. './DamLoader': 104,
  12602. three: 217
  12603. }
  12604. ],
  12605. 106: [
  12606. function (i, n, e) {
  12607. ;(function (e) {
  12608. 'use strict'
  12609. var l = i('../util/common'),
  12610. c = i('../util/texture'),
  12611. h = i('../util/browser'),
  12612. t = i('../util/logger'),
  12613. u = i('../settings'),
  12614. d = new t(e)
  12615. n.exports = {
  12616. load: function (i, n) {
  12617. if (!i.chunks[0] || !i.chunks[0].meshUrl) return $.when()
  12618. var r = l.countUnique(
  12619. i.chunks.map(function (e) {
  12620. return e.textureName
  12621. })
  12622. ),
  12623. e = -1 !== i.chunks[0].meshUrl.indexOf('_50k') ? '_50k' : '',
  12624. t = '_50k' == e ? 'high' : 'low'
  12625. u.minimalMemoryMode &&
  12626. 'high' === t &&
  12627. (h.detectSamsungS6()
  12628. ? (d.warn('Galaxy S6 cannot handle large textures, turning down quality.'), (t = 'low'))
  12629. : r > u.maxMobileTextures && (d.warn('Model probably too large for mobile, turning down quality.'), (t = 'low')))
  12630. var o = i.data.job.uuid + e + '_texture_jpg_' + t + '/',
  12631. a = $.Deferred(),
  12632. s = 0
  12633. return (
  12634. i.chunks.forEach(function (e) {
  12635. if (!e.material.map && e.textureName) {
  12636. var t = i.urls.get(o + e.textureName)
  12637. e.setTextureMap(
  12638. c.load(
  12639. t,
  12640. function (e, t) {
  12641. e || (n.push(t), s++, a.notify(s, r), s === r && a.resolve())
  12642. }.bind(this, c.isLoaded(t))
  12643. )
  12644. )
  12645. }
  12646. }),
  12647. a.promise()
  12648. )
  12649. }
  12650. }
  12651. }).call(this, '/js/loaders/ModelTextureLoader.js')
  12652. },
  12653. {
  12654. '../settings': 166,
  12655. '../util/browser': 182,
  12656. '../util/common': 185,
  12657. '../util/logger': 189,
  12658. '../util/texture': 194
  12659. }
  12660. ],
  12661. 107: [
  12662. function (s, l, e) {
  12663. ;(function (n, e) {
  12664. 'use strict'
  12665. function t(e) {
  12666. ;(this.model = e), (this.modelDataPath = this.model.urls.get('vision.modeldata') + '?m=' + new Date().getTime()), (this.sweepLocationsPath = this.model.urls.get('sweep_locations.csv'))
  12667. var t = n(
  12668. 'Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K',
  12669. 'base64'
  12670. ),
  12671. i = r.loadProto(t)
  12672. this.decoder = i.build('VisionModeldata')
  12673. }
  12674. var r = s('protobufjs'),
  12675. i = s('../util/ajax'),
  12676. o = (s('../util/common'), s('../util/math')),
  12677. a = new (s('../util/logger'))(e)
  12678. ;(t.prototype.load = function () {
  12679. return this.modelDataPath
  12680. ? (a.info('Using vision.modeldata'), this.loadVisionModelData())
  12681. : this.sweepLocationsPath
  12682. ? (a.warn('Using sweep_locations.csv'), this.loadSweepLocationsCSV())
  12683. : (a.warn('No sweep file found'), $.when([]))
  12684. }),
  12685. (t.prototype.loadVisionModelData = function () {
  12686. return i
  12687. .get(this.modelDataPath, {
  12688. responseType: 'arraybuffer'
  12689. })
  12690. .then(
  12691. function (e) {
  12692. var t
  12693. try {
  12694. t = this.decoder.decode(e)
  12695. } catch (e) {
  12696. return a.warn('Could not decode vision.modeldata, trying sweep_locations.csv'), this.loadSweepLocationsCSV()
  12697. }
  12698. var i = t.sweepLocations
  12699. .map(function (e) {
  12700. return {
  12701. uuid: e.uuid.toUTF8().replace(/-/g, ''),
  12702. position: {
  12703. x: e.pose.translation.x,
  12704. y: e.pose.translation.y,
  12705. z: e.pose.translation.z
  12706. },
  12707. quaternion: {
  12708. x: e.pose.rotation.x,
  12709. y: e.pose.rotation.y,
  12710. z: e.pose.rotation.z,
  12711. w: e.pose.rotation.w
  12712. },
  12713. puck: {
  12714. x: e.puck.x,
  12715. y: e.puck.y,
  12716. z: e.puck.z
  12717. },
  12718. floor: window.sceneFrom == 'kankan' ? e.subgroup : e.group,
  12719. neighbours: e.visibles,
  12720. alignmentType: e.alignment_type
  12721. }
  12722. })
  12723. .map(function (e) {
  12724. return (e.position = o.convertVisionVector(e.position)), (e.quaternion = o.convertVisionQuaternion(e.quaternion)), (e.puck = o.convertVisionVector(e.puck)), e
  12725. })
  12726. return (
  12727. i.forEach(function (e) {
  12728. /* if(e.neighbours.find(a=>a==-1)){
  12729. console.log('%c neighbours 存在-1 ' +e.uuid ,"color:#f00")
  12730. } */
  12731. e.neighbours = e.neighbours.filter(e => i[e])
  12732. e.neighbours = e.neighbours.map(function (e) {
  12733. return i[e].uuid
  12734. })
  12735. }),
  12736. i
  12737. )
  12738. }.bind(this),
  12739. function () {
  12740. return a.warn('Could not load vision.modeldata, trying sweep_locations.csv'), this.loadSweepLocationsCSV()
  12741. }.bind(this)
  12742. )
  12743. }),
  12744. (t.prototype.loadSweepLocationsCSV = function () {
  12745. return i
  12746. .get(this.sweepLocationsPath)
  12747. .then(function (e) {
  12748. return e
  12749. .split('\n')
  12750. .map(function (e) {
  12751. return e.split(', ')
  12752. })
  12753. .filter(function (e) {
  12754. return 1 < e.length
  12755. })
  12756. .map(function (e) {
  12757. return {
  12758. uuid: e[0],
  12759. position: {
  12760. x: parseFloat(e[1]),
  12761. y: parseFloat(e[2]),
  12762. z: parseFloat(e[3])
  12763. },
  12764. quaternion: {
  12765. x: parseFloat(e[4]),
  12766. y: parseFloat(e[5]),
  12767. z: parseFloat(e[6]),
  12768. w: parseFloat(e[7])
  12769. }
  12770. }
  12771. })
  12772. .map(function (e) {
  12773. return (e.position = o.convertVisionVector(e.position)), (e.quaternion = o.convertVisionQuaternion(e.quaternion)), e
  12774. })
  12775. })
  12776. .fail(function () {
  12777. a.warn('Could not load sweep_locations.csv, no sweeps loaded.')
  12778. })
  12779. }),
  12780. (l.exports = t)
  12781. }).call(this, s('buffer').Buffer, '/js/loaders/SweepDataLoader.js')
  12782. },
  12783. {
  12784. '../util/ajax': 181,
  12785. '../util/common': 185,
  12786. '../util/logger': 189,
  12787. '../util/math': 190,
  12788. buffer: 198,
  12789. protobufjs: 214
  12790. }
  12791. ],
  12792. 108: [
  12793. function (s, l, e) {
  12794. ;(function (e) {
  12795. 'use strict'
  12796. function t() {
  12797. this.locale = null
  12798. }
  12799. var i = s('../settings'),
  12800. n = s('../util/common'),
  12801. r = s('../util/logger'),
  12802. o = s('../enum/Locale'),
  12803. a = new r(e)
  12804. ;(t.prototype.init = function () {
  12805. var e
  12806. switch (i.languageTag) {
  12807. case null:
  12808. case 'en':
  12809. case o.EN_US:
  12810. ;(this.locale = o.EN_US), (e = s('./strings-en-US'))
  12811. break
  12812. case 'es':
  12813. case o.ES_MX:
  12814. ;(this.locale = o.ES_MX), (e = s('./strings-es-MX'))
  12815. break
  12816. case 'fr':
  12817. case o.FR_FR:
  12818. ;(this.locale = o.FR_FR), (e = s('./strings-fr-FR'))
  12819. break
  12820. case 'de':
  12821. case o.DE_DE:
  12822. ;(this.locale = o.DE_DE), (e = s('./strings-de-DE'))
  12823. break
  12824. case 'ru':
  12825. case o.RU_RU:
  12826. ;(this.locale = o.RU_RU), (e = s('./strings-ru-RU'))
  12827. break
  12828. case 'cn':
  12829. case o.CN_CN:
  12830. ;(this.locale = o.CN_CN), (e = s('./strings-cn-CN'))
  12831. break
  12832. case 'jp':
  12833. case o.JP_JP:
  12834. ;(this.locale = o.JP_JP), (e = s('./strings-jp-JP'))
  12835. break
  12836. default:
  12837. a.info("Unsupported language tag, defaulting to 'en-US'"), (this.locale = o.EN_US), (e = s('./strings-en-US'))
  12838. }
  12839. a.info("Using locale '" + this.locale + "'"), n.extendObject(this, e)
  12840. }),
  12841. (t.prototype.localizeGUI = function () {
  12842. var e = document.querySelector('#gui-parent')
  12843. this.localizeTree(e), this.localizeLoadingText()
  12844. }),
  12845. (t.prototype.localizeLoadingText = function () {
  12846. document.querySelector('#help-dialog').classList.add(this.locale),
  12847. document.querySelector('#interaction-modal').classList.add(this.locale),
  12848. document.querySelector('#gui').classList.add(this.locale)
  12849. }),
  12850. (t.prototype.localizeTree = function (e) {
  12851. var t,
  12852. i,
  12853. n = /{\[{ ?(\w+) ?}\]}/
  12854. if (e.nodeType === Node.TEXT_NODE) (t = e.data.match(n)) && ((i = t[1]), (e.data = this.localizeText(i) || i))
  12855. else if (e.nodeType === Node.ELEMENT_NODE) {
  12856. var r = e.getAttribute('title')
  12857. r && (t = r.match(n)) && ((i = t[1]), e.setAttribute('title', this.localizeText(i) || i))
  12858. }
  12859. for (e = e.firstChild; e; ) this.localizeTree(e), (e = e.nextSibling)
  12860. }),
  12861. (t.prototype.localizeText = function (e) {
  12862. var t = this[e]
  12863. return (
  12864. 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])),
  12865. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12866. t
  12867. )
  12868. }),
  12869. (l.exports = new t())
  12870. }).call(this, '/js/localization/localize.js')
  12871. },
  12872. {
  12873. '../enum/Locale': 31,
  12874. '../settings': 166,
  12875. '../util/common': 185,
  12876. '../util/logger': 189,
  12877. './strings-cn-CN': 109,
  12878. './strings-de-DE': 110,
  12879. './strings-en-US': 111,
  12880. './strings-es-MX': 112,
  12881. './strings-fr-FR': 113,
  12882. './strings-jp-JP': 114,
  12883. './strings-ru-RU': 115
  12884. }
  12885. ],
  12886. 109: [
  12887. function (e, t, i) {
  12888. 'use strict'
  12889. t.exports = {
  12890. PAGE_TITLE: '',
  12891. LOADING: '正在加载',
  12892. PRESENTED_BY_CAPS: '呈现者:',
  12893. POWERED_BY: '技术支持:',
  12894. POWERED_BY_CAPS: '技术支持:',
  12895. DESKTOP_SHORT_CTA: '点击一次以探索这个 3D 空间。',
  12896. MOBILE_SHORT_CTA: '点击一次以探索这个 3D 空间。',
  12897. PRESENTED_BY: '呈现者:',
  12898. MORE: '更多 ',
  12899. LESS: '更少 ',
  12900. TAG_CONTENT: 'tag™ 内容',
  12901. SHOW: '显示',
  12902. HIDE: '隐藏',
  12903. DOLLHOUSE: '场景屋',
  12904. FLOOR_PLAN: '楼层平面图',
  12905. OPEN_HIGHLIGHTS: '打开精彩片段',
  12906. CLOSE_HIGHLIGHTS: '关闭',
  12907. PREVIOUS: '上一个',
  12908. PLAY: '播放',
  12909. PAUSE: '暂停',
  12910. NEXT: '下一个',
  12911. EXPLORE_3D_SPACE: '探索 3D 空间',
  12912. VIEW_DOLLHOUSE: '观看场景屋',
  12913. SOCIAL_SHARING: '分享这个空间',
  12914. VIEW_IN_VR: '以 VR 观看',
  12915. VIEW_FULLSCREEN: '全屏观看',
  12916. EXIT_FULLSCREEN: ' 退出全屏',
  12917. ZOOM_IN: '放大',
  12918. ZOOM_OUT: '缩小',
  12919. FLOOR_NAME: '楼层',
  12920. FLOOR_ALL: 'ALL',
  12921. FLOOR_Lang: ['Floor', ''],
  12922. TERMS: '条款',
  12923. PORT_TERMS: 'port 条款',
  12924. TERMS_OF_USE: '使用条款',
  12925. CLOSE_TERMS: '关闭',
  12926. TERMS_TEXT_FILE: 'terms-cn-CN.html',
  12927. TERMS_FAIL: '无法获取条款。请确保您有互联网连接以查看使用条款。',
  12928. WEBVR_FOR_DAYDREAM: '用于 Daydream 视图',
  12929. WEBVR_ENTER_WEBVR: '进入 VR',
  12930. WEBVR_DIFFERENT_HEADSET: '有其他耳机吗?',
  12931. WEBVR_LEARN_MORE: '了解更多',
  12932. WEBVR_VIEW_SPACE: '在 VR 中观看空间',
  12933. WEBVR_DAYDREAM_VIEW: 'Daydream 视图',
  12934. WEBVR_DAYDREAM_PHONE: '支持 Daydream 的手机',
  12935. WEBVR_FOR_CARDBOARD: '用于 Google Cardboard',
  12936. WEBVR_VIEW_CARDBOARD: '或在 Google Cardboard 上观看',
  12937. VR_VIEW_SPACE: '在虚拟现实中观看空间',
  12938. VR_LEARN_MORE_CAPS: '了解更多',
  12939. VR_PREVIOUS_CAPS: '上一个’,',
  12940. VR_NEXT_CAPS: '下一个',
  12941. VR_GOT_IT_CAPS: '明白了',
  12942. VR_SHOW_SUPPORTED: '点击以使用 VR 观看空间',
  12943. VR_SHOW_UNSUPPORTED: '很遗憾,您的设备不符合在 VR 中观看空间的最低要求。',
  12944. VR_SHOW_IOS_1: '点击以使用 VR 观看空间',
  12945. VR_SHOW_IOS_2: '需要有 port VR 应用程序和兼容的 iPhone 才能观看',
  12946. VR_WHAT_YOU_NEED: '关于...您需要什么',
  12947. VR_NEED_CARDBOARD: '您使用 Google Cardboard 时需要什么',
  12948. VR_NEED_SAMSUNG: '您使用 Samsung Gear VR 时需要什么',
  12949. VR_NEED_DAYDREAM: '需要事先与 DAYDREAM VIEW 配对',
  12950. VR_NEED_DAYDREAM_PHONE: '支持 Daydream 的手机',
  12951. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  12952. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  12953. VR_APP: 'port VR 应用程序',
  12954. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  12955. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  12956. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本',
  12957. VR_COMPATIBLE_IPHONES_3: '兼容的 iPhone',
  12958. VR_COMPATIBLE_ANDROID: '兼容的 Android 设备',
  12959. VR_COMPATIBLE_ANDROID_LONG: '4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏',
  12960. VR_ANDROID_DETAIL: '4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏',
  12961. VR_ANDROID_DVICES: 'Android 设备',
  12962. VR_COMPATIBLE_SAMSUNG: '兼容的 Samsung 设备',
  12963. VR_SAMSUNG_DETAIL: 'Galaxy S6 和更高版本',
  12964. VR_APP_FOR_CARDBOARD: '用于 Google Cardboard 的 port VR 应用程序',
  12965. VR_APP_FOR_SAMSUNG: '用于 Gear VR 的 port VR 应用程序',
  12966. VR_APP_FOR_ANDROID: '用于 Android 手机的 port VR 应用程序',
  12967. VR_APP_OPEN: '请使用 port VR 应用程序打开',
  12968. VR_DOWNLOAD_HERE: '在此下载',
  12969. VR_REQUIRE_HEADSET: '需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序',
  12970. VR_REDIRECT_TO_STORE: '如果未安装应用程序,您将跳转到应用程序商店。',
  12971. VR_IMPROPER_EMBED: 'port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。',
  12972. VR_OPEN_ANDROID_LINK: '在您的手机上打开链接',
  12973. VR_ANDROID_OPTIONS: '可用的 VR 耳机选项',
  12974. SHARE_TO: '分享到',
  12975. SHARE_LINK: '直接链接',
  12976. SHARE_EXPLORE: '探索',
  12977. SHARE_AT: '在',
  12978. SHARE_WITH: '使用',
  12979. SHARE_3D: '以 3D',
  12980. SHARE_COPIED: '已复制!',
  12981. ERROR_BROWSER_SOLUTION: '安装更新的浏览器以探索 3D。',
  12982. ERROR_BROWSER_EXPLANATION: 'WebGL 需要现代的浏览器。',
  12983. ERROR_GENERIC_PROBLEM: '糟糕,出现问题。',
  12984. ERROR_GENERIC_SOLUTION: '重新启动您的浏览器。',
  12985. ERROR_GENERIC_ACTIONS_1: '如果问题仍然存在,',
  12986. ERROR_GENERIC_ACTIONS_2: '请安装支持的浏览器',
  12987. ERROR_GENERIC_ACTIONS_3: ' 或',
  12988. ERROR_GENERIC_ACTIONS_4: '查看我们的故障排除指南',
  12989. ERROR_WEBGL_UNSUPPORTED_PROBLEM: '浏览器不受支持。',
  12990. ERROR_WEBGL_IOS_PROBLEM: 'iOS 版本不受支持。',
  12991. ERROR_WEBGL_IOS_SOLUTION: '升级到 iOS 8 或更高版本以在 3D 中探索。',
  12992. ERROR_WEBGL_IOS_ACTIONS_1: '点击 ',
  12993. ERROR_WEBGL_IOS_ACTIONS_2: '设置 > 通用 > 软件更新',
  12994. ERROR_WEBGL_SAFARI_PROBLEM: '启用 WebGL 以在 3D 中探索。',
  12995. ERROR_WEBGL_SAFARI_ACTIONS_1: '单击',
  12996. ERROR_WEBGL_SAFARI_ACTIONS_2: '菜单栏中的首选项 > 高级 > 显示开发菜单',
  12997. ERROR_WEBGL_SAFARI_ACTIONS_3: '然后单击',
  12998. ERROR_WEBGL_SAFARI_ACTIONS_4: '开发 > 启用 WebGL',
  12999. ERROR_MISSING_URLS_PROBLEM: '糟糕,没有此模型的全景。',
  13000. ERROR_MISSING_URLS_EXPLANATION: '这是较早的模型。网站所有者可能正在开发一种新模型。',
  13001. ERROR_LOADING_FAILED_PROBLEM: '糟糕,模式不可用。',
  13002. ERROR_LOADING_FAILED_ACTIONS_1: '如果问题仍然存在,',
  13003. ERROR_LOADING_FAILED_ACTIONS_2: '查看我们的故障排除指南',
  13004. ERROR_MAINTENANCE_PROBLEM: '正在进行维护',
  13005. ERROR_MAINTENANCE_SOLUTION: '请过几分钟再来。',
  13006. LINK_TO_LOCATION: '地点链接',
  13007. MENU_COPY: '复制',
  13008. LINK_ALERT_COPY: '请使用 CTRL/CMD + C 复制。',
  13009. ROTATE: '旋转',
  13010. MOVE: '移动',
  13011. INSIDE: '内部',
  13012. ZOOM: '缩放',
  13013. HELP: '小帮手',
  13014. HELP_NAVIGATION_TAB: '导航',
  13015. HELP_MORE_HELP_TAB: '更多帮助',
  13016. HELP_DESKTOP_PANORAMA_1A: '单击并拖动以环顾空间。',
  13017. HELP_DESKTOP_PANORAMA_2A: '单击整个空间内的圆环以四处移动。',
  13018. HELP_DESKTOP_PANORAMA_3A: '使用鼠标滚轮来放大和缩小。',
  13019. HELP_DESKTOP_PANORAMA_1B: '或者,使用箭头键向左向右转。',
  13020. HELP_DESKTOP_PANORAMA_2B: '或者,使用箭头键向前移动和向后移动。',
  13021. HELP_DESKTOP_PANORAMA_3B: '或者,使用加号和减号键来放大和缩小。',
  13022. HELP_DESKTOP_360_2A: '单击内部视图图标以进入空间。',
  13023. HELP_DESKTOP_360_2B: '或者,按 1 号键进入内部视图。 ',
  13024. HELP_DESKTOP_DOLLHOUSE_1A: '左键单击并向左、向右、向上和向下拖动以旋转场景屋。',
  13025. HELP_DESKTOP_DOLLHOUSE_2A: '右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。',
  13026. HELP_DESKTOP_DOLLHOUSE_3A: '使用鼠标滚轮来放大和缩小。',
  13027. HELP_DESKTOP_DOLLHOUSE_1B: '或者,使用箭头键来旋转场景屋。',
  13028. HELP_DESKTOP_FLOORPLAN_1A: '左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。',
  13029. HELP_DESKTOP_FLOORPLAN_2A: '右键单击并向左或向右拖动以旋转楼层平面图。',
  13030. HELP_DESKTOP_FLOORPLAN_3A: '使用鼠标滚轮来放大和缩小。',
  13031. HELP_DESKTOP_FLOORPLAN_2B: '或者,使用箭头键以向左或向右旋转。',
  13032. HELP_DESKTOP_FLOORPLAN_3B: '或者,使用箭头键来放大和缩小。',
  13033. HELP_MOBILE_PANORAMA_1: '触摸并拖动以环顾空间。',
  13034. HELP_MOBILE_PANORAMA_2: '点击整个空间内的圆环以四处移动。',
  13035. HELP_MOBILE_3: '使用捏合手势来放大和缩小。',
  13036. HELP_MOBILE_360_2: '点击内部视图图标以进入空间。',
  13037. HELP_MOBILE_DOLLHOUSE_1: '触摸并向上、向下、向左和向右拖动以旋转场景屋。',
  13038. HELP_MOBILE_DOLLHOUSE_2: '用两指触摸并拖动以定位场景屋。',
  13039. HELP_MOBILE_FLOORPLAN_1: '触摸并拖动以定位楼层平面图。',
  13040. HELP_MOBILE_FLOORPLAN_2: '用两指触摸并拖动以旋转楼层平面图。',
  13041. HELP_MORE_HLR_A: '精彩片段集锦',
  13042. HELP_DESKTOP_MORE_HLR_B: '打开以使用缩略图图像在空间中流览。',
  13043. HELP_MORE_DOLLHOUSE_A: '场景屋',
  13044. HELP_DESKTOP_MORE_DOLLHOUSE_B: '单击以查看和旋转 3D 内整个空间的俯视图。',
  13045. HELP_MOBILE_MORE_DOLLHOUSE_B: '点击以查看和旋转 3D 内整个空间的俯视图。',
  13046. HELP_MORE_FLOORS_A: '楼层选择器',
  13047. HELP_DESKTOP_MORE_FLOORS_B: '在空间中的楼层之间切换。',
  13048. HELP_MORE_TAG_A: 'tag™ 贴文',
  13049. HELP_DESKTOP_MORE_TAG_B: '单击或悬停鼠标以查看空间中的功能信息。',
  13050. HELP_MOBILE_MORE_TAG_B: '点击以查看空间中的功能信息。',
  13051. HELP_MORE_ZOOM_A: '缩放控件',
  13052. HELP_DESKTOP_MORE_ZOOM_B: '使用这些控件来放大和缩小或使用滚轮。',
  13053. HELP_MORE_TOUR_A: '导览控件',
  13054. HELP_DESKTOP_MORE_TOUR_B: '通过导览播放、暂停以及向前和向后流览。',
  13055. HELP_MORE_INSIDE_A: '内部视图',
  13056. HELP_DESKTOP_MORE_INSIDE_B: '单击以探索空间内部。',
  13057. HELP_MOBILE_MORE_INSIDE_B: '点击以探索空间内部。',
  13058. HELP_MORE_VR_A: 'VR 模式',
  13059. HELP_DESKTOP_MORE_VR_B: '单击以在虚拟现实中启动空间。',
  13060. HELP_MOBILE_MORE_VR_B: '点击以在虚拟现实中启动空间。',
  13061. HELP_MORE_360_A: '360° 视图',
  13062. HELP_DESKTOP_MORE_360_B: '单击精彩片段集锦中的 360 视图中以观看室外场景。',
  13063. HELP_MOBILE_MORE_360_B: '点击精彩片段集锦中的 360 视图中以观看室外场景。',
  13064. HELP_MORE_FULLSCREEN_A: '全屏',
  13065. HELP_DESKTOP_MORE_FULLSCREEN_B: '将 3D Showcase 扩展到全屏。',
  13066. CLOSE: '关闭'
  13067. }
  13068. },
  13069. {}
  13070. ],
  13071. 110: [
  13072. function (e, t, i) {
  13073. 'use strict'
  13074. t.exports = {
  13075. PAGE_TITLE: '',
  13076. LOADING: 'Lädt',
  13077. PRESENTED_BY_CAPS: 'PRÄSENTIERT VON',
  13078. POWERED_BY: 'Angetrieben von',
  13079. POWERED_BY_CAPS: 'ANGETRIEBEN VON',
  13080. DESKTOP_SHORT_CTA: 'Sehen sie sich in diesem 3D Raum um.',
  13081. MOBILE_SHORT_CTA: 'Sehen sie sich in diesem 3D Raum um.',
  13082. PRESENTED_BY: 'Präsentiert von ',
  13083. MORE: 'Mehr ',
  13084. LESS: 'Weniger ',
  13085. TAG_CONTENT: 'tag™ Inhalt',
  13086. SHOW: 'Anzeigen',
  13087. HIDE: 'Verbergen',
  13088. DOLLHOUSE: 'Puppenhaus',
  13089. FLOOR_PLAN: 'Grundriss',
  13090. OPEN_HIGHLIGHTS: 'Highlights anzeigen',
  13091. CLOSE_HIGHLIGHTS: 'Schließen',
  13092. PREVIOUS: 'Vorheriges',
  13093. PLAY: 'Abspielen',
  13094. PAUSE: 'Pausieren',
  13095. NEXT: 'Nächstes',
  13096. EXPLORE_3D_SPACE: 'Innenraum betreten',
  13097. VIEW_DOLLHOUSE: 'Puppenhaus ansehen',
  13098. SOCIAL_SHARING: 'Teilen Sie diesen Raum',
  13099. VIEW_IN_VR: 'In VR ansehen',
  13100. VIEW_FULLSCREEN: 'Ansicht im Vollbildmodus',
  13101. EXIT_FULLSCREEN: 'Beenden des Vollbildmodus',
  13102. ZOOM_IN: 'Vergrößern',
  13103. ZOOM_OUT: 'Verkleinern',
  13104. FLOOR_NAME: 'Etage ',
  13105. FLOOR_ALL: 'Alle',
  13106. TERMS: 'Bedingungen',
  13107. PORT_TERMS: 'port Bedingungen',
  13108. TERMS_OF_USE: 'Nutzungsbedingungen',
  13109. TERMS_TEXT_FILE: 'terms-de-DE.html',
  13110. CLOSE_TERMS: 'Schließen',
  13111. TERMS_FAIL: 'Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.',
  13112. HELP: 'Hilfe',
  13113. HELP_NAVIGATION_TAB: 'Navigation',
  13114. HELP_MORE_HELP_TAB: 'Hilfe-Details',
  13115. CLOSE: 'Schließen',
  13116. HELP_DESKTOP_PANORAMA_1A: 'Klicken und ziehen Sie um sich im Raum umzusehen.',
  13117. HELP_DESKTOP_PANORAMA_2A: 'Klicken Sie auf die Ringe im Raum um sich zu bewegen.',
  13118. HELP_DESKTOP_PANORAMA_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  13119. HELP_DESKTOP_PANORAMA_1B: 'Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.',
  13120. HELP_DESKTOP_PANORAMA_2B: 'Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.',
  13121. HELP_DESKTOP_PANORAMA_3B: 'Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.',
  13122. HELP_DESKTOP_360_2A: 'Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .',
  13123. HELP_DESKTOP_360_2B: 'Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.',
  13124. HELP_DESKTOP_DOLLHOUSE_1A: 'Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.',
  13125. 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.',
  13126. HELP_DESKTOP_DOLLHOUSE_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  13127. HELP_DESKTOP_DOLLHOUSE_1B: 'Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.',
  13128. 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.',
  13129. HELP_DESKTOP_FLOORPLAN_2A: 'Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.',
  13130. HELP_DESKTOP_FLOORPLAN_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  13131. HELP_DESKTOP_FLOORPLAN_2B: 'Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.',
  13132. HELP_DESKTOP_FLOORPLAN_3B: 'Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.',
  13133. HELP_MOBILE_PANORAMA_1: 'Berühren und ziehen an dem Raum um sich umzusehen.',
  13134. HELP_MOBILE_PANORAMA_2: 'Klicken Sie auf die Ringe im Raum, um sich zu bewegen.',
  13135. HELP_MOBILE_3: 'Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.',
  13136. HELP_MOBILE_360_2: 'Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.',
  13137. HELP_MOBILE_DOLLHOUSE_1: 'Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.',
  13138. HELP_MOBILE_DOLLHOUSE_2: 'Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.',
  13139. HELP_MOBILE_FLOORPLAN_1: 'Berühren und ziehen, um den Grundriss zu positionieren.',
  13140. HELP_MOBILE_FLOORPLAN_2: 'Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.',
  13141. HELP_MORE_HLR_A: 'Liste das Highlight',
  13142. HELP_DESKTOP_MORE_HLR_B: 'Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.',
  13143. HELP_MORE_DOLLHOUSE_A: 'Puppenhaus Ansicht',
  13144. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.',
  13145. HELP_MOBILE_MORE_DOLLHOUSE_B: 'Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.',
  13146. HELP_MORE_FLOORS_A: 'Etage auswählen',
  13147. HELP_DESKTOP_MORE_FLOORS_B: 'Zwischen den Etagen im Raum wechseln.',
  13148. HELP_MORE_TAG_A: 'tag™ Posts',
  13149. HELP_DESKTOP_MORE_TAG_B: 'Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.',
  13150. HELP_MOBILE_MORE_TAG_B: 'Tippen Sie für Informationen über die Funktionen im Raum.',
  13151. HELP_MORE_ZOOM_A: 'Zoom Steuerung',
  13152. HELP_DESKTOP_MORE_ZOOM_B: 'Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.',
  13153. HELP_MORE_TOUR_A: 'Tour Steuerung',
  13154. HELP_DESKTOP_MORE_TOUR_B: 'Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.',
  13155. HELP_MORE_INSIDE_A: 'Innenansicht',
  13156. HELP_DESKTOP_MORE_INSIDE_B: 'Klicken Sie hier um sich im Raum umzusehen.',
  13157. HELP_MOBILE_MORE_INSIDE_B: 'Sehen Sie sich in diesen 3D Raum um.',
  13158. HELP_MORE_VR_A: 'VR Modus',
  13159. HELP_DESKTOP_MORE_VR_B: 'Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.',
  13160. HELP_MOBILE_MORE_VR_B: 'Tippen Sie um den Raum in der virtuellen Realität zu starten.',
  13161. HELP_MORE_360_A: '360° Views Ansicht ',
  13162. HELP_DESKTOP_MORE_360_B: 'Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.',
  13163. HELP_MOBILE_MORE_360_B: 'Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.',
  13164. HELP_MORE_FULLSCREEN_A: 'Vollbild',
  13165. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Erweitern Sie 3D Showcase im Vollbildmodus.',
  13166. WEBVR_FOR_CARDBOARD: 'Für Google Cardboard',
  13167. WEBVR_FOR_DAYDREAM: 'Für Daydream View',
  13168. WEBVR_ENTER_WEBVR: 'Starten Sie VR',
  13169. WEBVR_DIFFERENT_HEADSET: 'Haben Sie anderes Headset?',
  13170. WEBVR_LEARN_MORE: 'Mehr Infos',
  13171. WEBVR_VIEW_SPACE: 'Ansicht des Raumes in VR',
  13172. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  13173. WEBVR_DAYDREAM_PHONE: 'Daydream-fähiges Handy',
  13174. WEBVR_VIEW_CARDBOARD: 'Oder mit Google Cardboard ansehen',
  13175. VR_WHAT_YOU_NEED: 'Was Sie dafür brauchen...',
  13176. VR_NEED_DAYDREAM_PHONE: 'Daydream-fähiges Handy',
  13177. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  13178. VR_APP: 'port VR App',
  13179. VR_APP_OPEN: 'Oder öffnen Sie die port VR App',
  13180. 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',
  13181. VR_SAMSUNG_DETAIL: 'Galaxy S6 und neuer',
  13182. VR_APP_FOR_ANDROID: 'port VR app für Android',
  13183. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13184. VR_VIEW_SPACE: 'Ansicht des Raumes in VR',
  13185. VR_LEARN_MORE_CAPS: 'MEHR INFOS',
  13186. VR_PREVIOUS_CAPS: 'ZURÜCK',
  13187. VR_NEXT_CAPS: 'WEITER',
  13188. VR_GOT_IT_CAPS: 'VERSTANDEN',
  13189. VR_SHOW_SUPPORTED: 'Tippen Sie um den Raum in VR zu sehen',
  13190. VR_SHOW_UNSUPPORTED: 'Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.',
  13191. VR_SHOW_IOS_1: 'Tippen Sie um den Raum in VR zu sehen',
  13192. VR_SHOW_IOS_2: 'port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen',
  13193. VR_NEED_CARDBOARD: 'Was Sie dafür brauchen ist Google Cardboard',
  13194. VR_NEED_SAMSUNG: 'Was Sie dafür brauchen ist Samsung Gear VR',
  13195. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  13196. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  13197. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  13198. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s oder neuer, mit iOS 9.1 und später',
  13199. VR_COMPATIBLE_IPHONES_3: 'Kompatibles iPhones',
  13200. VR_COMPATIBLE_ANDROID: 'Kompatibles Android Gerät',
  13201. VR_ANDROID_DETAIL: 'Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer',
  13202. VR_ANDROID_DVICES: 'Android Geräte',
  13203. VR_COMPATIBLE_SAMSUNG: 'Kompatible Samsung Geräte',
  13204. VR_APP_FOR_CARDBOARD: 'port VR App für Google Cardboard',
  13205. VR_APP_FOR_SAMSUNG: 'port VR App für Gear VR',
  13206. VR_DOWNLOAD_HERE: 'Hier runterladen',
  13207. VR_REQUIRE_HEADSET: 'Benötigt das ein VR-Headset und port VR App für Android installiert wird',
  13208. VR_REDIRECT_TO_STORE: 'Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.',
  13209. VR_IMPROPER_EMBED: 'Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.',
  13210. VR_OPEN_ANDROID_LINK: 'Öffnen Sie den Link auf Ihrem Handy',
  13211. VR_ANDROID_OPTIONS: 'VR Headset Optionen',
  13212. SHARE_TO: 'Teilen auf',
  13213. SHARE_LINK: 'Direkter Link',
  13214. SHARE_EXPLORE: 'Umsehen',
  13215. SHARE_AT: 'auf',
  13216. SHARE_WITH: 'mit',
  13217. SHARE_3D: 'in 3D',
  13218. SHARE_COPIED: 'Kopiert!',
  13219. ERROR_BROWSER_SOLUTION: 'Installieren Sie einen neueren Browser um sich in 3D umzusehen.',
  13220. ERROR_BROWSER_EXPLANATION: 'WebGL benötigt einen modernen Browser.',
  13221. ERROR_GENERIC_PROBLEM: 'Huch, etwas ist schief gelaufen.',
  13222. ERROR_GENERIC_SOLUTION: 'Starten Sie Ihren Browser neu.',
  13223. ERROR_GENERIC_ACTIONS_1: 'Wenn das Problem weiterhin besteht, ',
  13224. ERROR_GENERIC_ACTIONS_2: 'Installieren Sie einen unterstützten Browser',
  13225. ERROR_GENERIC_ACTIONS_3: ' oder ',
  13226. ERROR_GENERIC_ACTIONS_4: 'Sehen Sie unseren Leitfaden zur Fehlerbehebung',
  13227. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Browser wird nicht unterstützt.',
  13228. ERROR_WEBGL_IOS_PROBLEM: 'iOS-Version wird nicht unterstützt.',
  13229. ERROR_WEBGL_IOS_SOLUTION: 'Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.',
  13230. ERROR_WEBGL_IOS_ACTIONS_1: 'Tippen ',
  13231. ERROR_WEBGL_IOS_ACTIONS_2: 'Einstellungen > Allgemein > Softwareaktualisierung',
  13232. ERROR_WEBGL_SAFARI_PROBLEM: 'Aktivieren Sie WebVR um sich in 3D umzusehen.',
  13233. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Klicken ',
  13234. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen',
  13235. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Klicken Sie dann ',
  13236. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Entwickler > WebGL Aktivieren',
  13237. ERROR_MISSING_URLS_PROBLEM: 'Huch, es gibt keine Panoramen für dieses Modell .',
  13238. ERROR_MISSING_URLS_EXPLANATION: 'Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.',
  13239. ERROR_LOADING_FAILED_PROBLEM: 'Huch, das Modell ist nicht verfügbar.',
  13240. ERROR_LOADING_FAILED_ACTIONS_1: 'Wenn das Problem weiterhin besteht, ',
  13241. ERROR_LOADING_FAILED_ACTIONS_2: 'sehen Sie unseren Leitfaden zur Fehlerbehebung',
  13242. ERROR_MAINTENANCE_PROBLEM: 'Wartung im Gange.',
  13243. ERROR_MAINTENANCE_SOLUTION: 'Bitte versuchen Sie es in ein paar Minuten nochmal.',
  13244. LINK_TO_LOCATION: 'Link zu',
  13245. MENU_COPY: 'Kopieren',
  13246. LINK_ALERT_COPY: 'Bitte benutzen Sie CTRL/CMD + C zum kopieren.',
  13247. ROTATE: 'Drehen',
  13248. INSIDE: 'Drinnen',
  13249. MOVE: 'Bewegen',
  13250. ZOOM: 'Vergrößern'
  13251. }
  13252. },
  13253. {}
  13254. ],
  13255. 111: [
  13256. function (e, t, i) {
  13257. 'use strict'
  13258. t.exports = {
  13259. PAGE_TITLE: '',
  13260. LOADING: 'Loading',
  13261. PRESENTED_BY_CAPS: 'PRESENTED BY',
  13262. POWERED_BY: 'powered by ',
  13263. POWERED_BY_CAPS: 'POWERED BY',
  13264. DESKTOP_SHORT_CTA: 'Click to explore this 3D space.',
  13265. MOBILE_SHORT_CTA: 'Tap to explore this 3D space.',
  13266. PRESENTED_BY: 'Presented by ',
  13267. MORE: 'More ',
  13268. LESS: 'Less ',
  13269. TAG_CONTENT: 'tag™ Content',
  13270. SHOW: 'Show',
  13271. HIDE: 'Hide',
  13272. DOLLHOUSE: 'Dollhouse',
  13273. FLOOR_PLAN: 'Floor plan',
  13274. OPEN_HIGHLIGHTS: 'Open Highlights',
  13275. CLOSE_HIGHLIGHTS: 'Close',
  13276. PREVIOUS: 'Previous',
  13277. PLAY: 'Play',
  13278. PAUSE: 'Pause',
  13279. NEXT: 'Next',
  13280. EXPLORE_3D_SPACE: 'Explore 3D Space',
  13281. VIEW_DOLLHOUSE: 'View dollhouse',
  13282. SOCIAL_SHARING: 'Share this Space',
  13283. VIEW_IN_VR: 'View in VR',
  13284. VIEW_FULLSCREEN: '全屏',
  13285. EXIT_FULLSCREEN: '退出全屏',
  13286. ZOOM_IN: 'Zoom in',
  13287. ZOOM_OUT: 'Zoom out',
  13288. FLOOR_NAME: 'Floor ',
  13289. FLOOR_ALL: '全部',
  13290. TERMS: 'Terms',
  13291. PORT_TERMS: 'port terms',
  13292. TERMS_OF_USE: 'Terms of Use',
  13293. TERMS_TEXT_FILE: 'terms-en-US.html',
  13294. CLOSE_TERMS: 'Close',
  13295. TERMS_FAIL: 'Could not fetch terms. Please make sure you have an internet connection to view the terms of use.',
  13296. HELP: 'Help',
  13297. HELP_NAVIGATION_TAB: 'Navigation',
  13298. HELP_MORE_HELP_TAB: 'More Help',
  13299. CLOSE: 'Close',
  13300. HELP_DESKTOP_PANORAMA_1A: 'Click and Drag to look around the Space.',
  13301. HELP_DESKTOP_PANORAMA_2A: 'Click on the rings throughout the space to move around.',
  13302. HELP_DESKTOP_PANORAMA_3A: 'Use the scroll wheel to zoom in and out.',
  13303. HELP_DESKTOP_PANORAMA_1B: 'Or, use the arrow keys to turn left and right.',
  13304. HELP_DESKTOP_PANORAMA_2B: 'Or, use the arrow keys to move forward and back.',
  13305. HELP_DESKTOP_PANORAMA_3B: 'Or, use the plus and minus keys to zoom in and out.',
  13306. HELP_DESKTOP_360_2A: 'Click the Inside View icon to enter the Space.',
  13307. HELP_DESKTOP_360_2B: 'Or, press the number 1 key to enter Inside View.',
  13308. HELP_DESKTOP_DOLLHOUSE_1A: 'Left click and drag left, right, up, and down to rotate the Dollhouse.',
  13309. HELP_DESKTOP_DOLLHOUSE_2A: 'Right click and drag left, right, up, and down to change the Dollhouse position on screen.',
  13310. HELP_DESKTOP_DOLLHOUSE_3A: 'Use the scroll wheel to zoom in and out.',
  13311. HELP_DESKTOP_DOLLHOUSE_1B: 'Or, use the arrow keys to rotate the Dollhouse.',
  13312. HELP_DESKTOP_FLOORPLAN_1A: 'Left click and drag left, right, up, and down to change the Floorplan position on screen.',
  13313. HELP_DESKTOP_FLOORPLAN_2A: 'Right click and drag left or right to rotate the Floorplan.',
  13314. HELP_DESKTOP_FLOORPLAN_3A: 'Use the scroll wheel to zoom in and out.',
  13315. HELP_DESKTOP_FLOORPLAN_2B: 'Or, use the arrow keys to rotate left or right.',
  13316. HELP_DESKTOP_FLOORPLAN_3B: 'Or, use the arrow keys to zoom in and out.',
  13317. HELP_MOBILE_PANORAMA_1: 'Touch and Drag to look around the Space.',
  13318. HELP_MOBILE_PANORAMA_2: 'Tap on the rings throughout the Space to move around.',
  13319. HELP_MOBILE_3: 'Use a pinch gesture to zoom in and out.',
  13320. HELP_MOBILE_360_2: 'Tap the Inside View icon to enter the Space.',
  13321. HELP_MOBILE_DOLLHOUSE_1: 'Touch and drag up, down, left, and right to rotate the Dollhouse.',
  13322. HELP_MOBILE_DOLLHOUSE_2: 'Touch and drag with two fingers to position the Dollhouse.',
  13323. HELP_MOBILE_FLOORPLAN_1: 'Touch and drag to position the Floorplan.',
  13324. HELP_MOBILE_FLOORPLAN_2: 'Touch and drag with two fingers to rotate the Floorplan.',
  13325. HELP_MORE_HLR_A: 'Highlight Reel',
  13326. HELP_DESKTOP_MORE_HLR_B: 'Open to navigate through the Space using thumbnail images.',
  13327. HELP_MORE_DOLLHOUSE_A: 'Dollhouse View',
  13328. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'Click to view and rotate a top-down view of the entire Space in 3D.',
  13329. HELP_MOBILE_MORE_DOLLHOUSE_B: 'Tap to view and rotate a top-down view of the entire Space in 3D.',
  13330. HELP_MORE_FLOORS_A: 'Floor Selector',
  13331. HELP_DESKTOP_MORE_FLOORS_B: 'Switch between floors in the Space.',
  13332. HELP_MORE_TAG_A: 'tag™ Posts',
  13333. HELP_DESKTOP_MORE_TAG_B: 'Click or hover over for information about features in the Space.',
  13334. HELP_MOBILE_MORE_TAG_B: 'Tap for information about features in the Space.',
  13335. HELP_MORE_ZOOM_A: 'Zoom Controls',
  13336. HELP_DESKTOP_MORE_ZOOM_B: 'Use these controls to zoom in and out or use the scroll wheel.',
  13337. HELP_MORE_TOUR_A: 'Tour Controls',
  13338. HELP_DESKTOP_MORE_TOUR_B: 'Play, pause, and navigate forward and backward through a Guided Tour.',
  13339. HELP_MORE_INSIDE_A: 'Inside View',
  13340. HELP_DESKTOP_MORE_INSIDE_B: 'Click to explore inside the Space.',
  13341. HELP_MOBILE_MORE_INSIDE_B: 'Tap to explore inside the Space.',
  13342. HELP_MORE_VR_A: 'VR Mode',
  13343. HELP_DESKTOP_MORE_VR_B: 'Click to launch the Space in virtual reality.',
  13344. HELP_MOBILE_MORE_VR_B: 'Tap to launch the Space in virtual reality.',
  13345. HELP_MORE_360_A: '360° Views',
  13346. HELP_DESKTOP_MORE_360_B: 'Click 360 Views in the Highlight Reel to view outdoor scenes.',
  13347. HELP_MOBILE_MORE_360_B: 'Tap 360 Views in the Highlight Reel to view outdoor scenes.',
  13348. HELP_MORE_FULLSCREEN_A: 'Full screen',
  13349. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Expand 3D Showcase to full screen.',
  13350. WEBVR_FOR_CARDBOARD: 'For Google Cardboard',
  13351. WEBVR_VIEW_CARDBOARD: 'Or View on Google Cardboard',
  13352. WEBVR_FOR_DAYDREAM: 'For Daydream View',
  13353. WEBVR_ENTER_WEBVR: 'ENTER VR',
  13354. WEBVR_DIFFERENT_HEADSET: 'Have a different headset?',
  13355. WEBVR_LEARN_MORE: 'Learn more',
  13356. WEBVR_VIEW_SPACE: 'View Space in VR',
  13357. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  13358. WEBVR_DAYDREAM_PHONE: 'Daydream-ready phone',
  13359. VR_VIEW_SPACE: 'View Space in Virtual Reality',
  13360. VR_LEARN_MORE_CAPS: 'LEARN MORE',
  13361. VR_PREVIOUS_CAPS: 'PREVIOUS',
  13362. VR_NEXT_CAPS: 'NEXT',
  13363. VR_GOT_IT_CAPS: 'GOT IT',
  13364. VR_SHOW_SUPPORTED: 'Tap to view the Space in VR with',
  13365. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13366. VR_SHOW_IOS_1: 'Tap to view the space in VR',
  13367. VR_SHOW_IOS_2: 'Requires port VR app and compatible iPhone to view',
  13368. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13369. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13370. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13371. VR_NEED_DAYDREAM: 'NEEDS PRIOR PAIRING WITH DAYDREAM VIEW',
  13372. VR_NEED_DAYDREAM_PHONE: 'Daydream-ready phone',
  13373. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  13374. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  13375. VR_APP: 'port VR App',
  13376. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  13377. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  13378. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s and newer, running iOS 9.1 and higher',
  13379. VR_COMPATIBLE_IPHONES_3: 'Compatible iPhones',
  13380. VR_COMPATIBLE_ANDROID: 'Compatible Android Devices',
  13381. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13382. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13383. VR_ANDROID_DVICES: 'Android Devices',
  13384. VR_COMPATIBLE_SAMSUNG: 'Compatible Samsung Devices',
  13385. VR_SAMSUNG_DETAIL: 'Galaxy S6 and Above',
  13386. VR_APP_FOR_CARDBOARD: 'port VR app for Google Cardboard',
  13387. VR_APP_FOR_SAMSUNG: 'port VR app for Gear VR',
  13388. VR_APP_FOR_ANDROID: 'port VR app for Android Phones',
  13389. VR_APP_OPEN: 'Open with the port VR app instead',
  13390. VR_DOWNLOAD_HERE: 'Download here',
  13391. VR_REQUIRE_HEADSET: 'Requires a VR headset and port VR app for Android to be installed',
  13392. VR_REDIRECT_TO_STORE: 'If app is not installed, you will be redirected to the app store.',
  13393. VR_IMPROPER_EMBED: 'The port Space is not embedded properly to support VR in your web browser.',
  13394. VR_OPEN_ANDROID_LINK: 'Open the Link on Your Mobile Phone',
  13395. VR_ANDROID_OPTIONS: 'Available VR Headset Options',
  13396. SHARE_TO: 'Share to',
  13397. SHARE_LINK: 'Direct Link',
  13398. SHARE_EXPLORE: 'Explore ',
  13399. SHARE_AT: 'at',
  13400. SHARE_WITH: 'with',
  13401. SHARE_3D: ' in 3D',
  13402. SHARE_COPIED: 'Copied!',
  13403. ERROR_BROWSER_SOLUTION: 'Install a new browser to explore in 3D.',
  13404. ERROR_BROWSER_EXPLANATION: 'WebGL requires a modern browser.',
  13405. ERROR_GENERIC_PROBLEM: 'Oops, something went wrong.',
  13406. ERROR_GENERIC_SOLUTION: 'Restart your browser.',
  13407. ERROR_GENERIC_ACTIONS_1: 'If the problem persists, ',
  13408. ERROR_GENERIC_ACTIONS_2: 'install a supported browser',
  13409. ERROR_GENERIC_ACTIONS_3: ' or ',
  13410. ERROR_GENERIC_ACTIONS_4: 'see our troubleshooting guide',
  13411. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Browser not supported.',
  13412. ERROR_WEBGL_IOS_PROBLEM: 'iOS version not supported.',
  13413. ERROR_WEBGL_IOS_SOLUTION: 'Upgrade to iOS 8 or higher to explore in 3D.',
  13414. ERROR_WEBGL_IOS_ACTIONS_1: 'Tap ',
  13415. ERROR_WEBGL_IOS_ACTIONS_2: 'Settings > General > Software Update',
  13416. ERROR_WEBGL_SAFARI_PROBLEM: 'Enable WebGL to explore in 3D.',
  13417. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Click ',
  13418. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Preferences > Advanced > Show Develop menu',
  13419. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Then click ',
  13420. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Develop > Enable WebGL',
  13421. ERROR_MISSING_URLS_PROBLEM: 'Oops, there are no panoramas for this model.',
  13422. ERROR_MISSING_URLS_EXPLANATION: 'This is an older model. The website owner may have a new model on the way.',
  13423. ERROR_LOADING_FAILED_PROBLEM: '模型不可用.',
  13424. ERROR_LOADING_FAILED_ACTIONS_1: 'If the problem persists, ',
  13425. ERROR_LOADING_FAILED_ACTIONS_2: 'see our troubleshooting guide',
  13426. ERROR_MAINTENANCE_PROBLEM: 'Maintenance in progress.',
  13427. ERROR_MAINTENANCE_SOLUTION: 'Please come back in a few minutes.',
  13428. LINK_TO_LOCATION: 'Link to location',
  13429. MENU_COPY: 'Copy',
  13430. LINK_ALERT_COPY: 'Please use CTRL/CMD + C to copy.',
  13431. ROTATE: 'Rotate',
  13432. INSIDE: 'Inside',
  13433. MOVE: 'Move',
  13434. ZOOM: 'Zoom'
  13435. }
  13436. },
  13437. {}
  13438. ],
  13439. 112: [
  13440. function (e, t, i) {
  13441. 'use strict'
  13442. t.exports = {
  13443. PAGE_TITLE: '',
  13444. LOADING: 'Cargando',
  13445. PRESENTED_BY_CAPS: 'PRESENTADO POR',
  13446. POWERED_BY: 'potenciando por ',
  13447. POWERED_BY_CAPS: 'POTENCIADO POR ',
  13448. DESKTOP_SHORT_CTA: 'Haga clic para explorar este Espacio 3D.',
  13449. MOBILE_SHORT_CTA: 'Pulse para explorar este Espacio 3D.',
  13450. PRESENTED_BY: 'Presentado por ',
  13451. MORE: 'Más ',
  13452. LESS: 'Menos ',
  13453. TAG_CONTENT: 'Contenido de tag™',
  13454. SHOW: 'Mostrar',
  13455. HIDE: 'Ocultar',
  13456. DOLLHOUSE: 'Dollhouse',
  13457. FLOOR_PLAN: 'Planos',
  13458. OPEN_HIGHLIGHTS: 'Aspectos Destacados',
  13459. CLOSE_HIGHLIGHTS: 'Cerrar',
  13460. PREVIOUS: 'Anterior',
  13461. PLAY: 'Play',
  13462. PAUSE: 'Pausa',
  13463. NEXT: 'Siguiente',
  13464. EXPLORE_3D_SPACE: 'Explorar el Espacio 3D',
  13465. VIEW_DOLLHOUSE: 'Ver dollhouse',
  13466. SOCIAL_SHARING: 'Compartir este espacio',
  13467. VIEW_IN_VR: 'Ver en realidad virtual',
  13468. VIEW_FULLSCREEN: 'Ver en pantalla completa',
  13469. EXIT_FULLSCREEN: 'Salir de pantalla completa',
  13470. ZOOM_IN: 'Acercar',
  13471. ZOOM_OUT: 'Alejar',
  13472. FLOOR_NAME: 'Piso ',
  13473. FLOOR_ALL: 'Todas',
  13474. TERMS: 'Condiciones',
  13475. PORT_TERMS: 'port términos de uso',
  13476. TERMS_OF_USE: 'Términos de uso',
  13477. TERMS_TEXT_FILE: 'terms-es-MX.html',
  13478. CLOSE_TERMS: 'Cerrar',
  13479. 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.',
  13480. HELP: 'Ayuda',
  13481. HELP_NAVIGATION_TAB: 'Navegación',
  13482. HELP_MORE_HELP_TAB: 'Más Ayuda',
  13483. CLOSE: 'Cerrar',
  13484. HELP_DESKTOP_PANORAMA_1A: 'Haga clic y arrastre para mirar alrededor del espacio.',
  13485. HELP_DESKTOP_PANORAMA_2A: 'Haga clic en los aros a lo largo del espacio para moverse.',
  13486. HELP_DESKTOP_PANORAMA_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  13487. HELP_DESKTOP_PANORAMA_1B: 'O use las teclas de flecha para girar a la izquierda y a la derecha.',
  13488. HELP_DESKTOP_PANORAMA_2B: 'O use las teclas de dirección para adelantar o retroceder.',
  13489. HELP_DESKTOP_PANORAMA_3B: 'O use la tecla más para acercar y la tecla menos para alejar.',
  13490. HELP_DESKTOP_360_2A: 'Haga clic en el icono Vista Interior para ingresar al Espacio.',
  13491. HELP_DESKTOP_360_2B: 'O bien, presione la tecla numero 1 para entrar en la Vista Interior.',
  13492. HELP_DESKTOP_DOLLHOUSE_1A: 'Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.',
  13493. HELP_DESKTOP_DOLLHOUSE_2A: 'Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.',
  13494. HELP_DESKTOP_DOLLHOUSE_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  13495. HELP_DESKTOP_DOLLHOUSE_1B: 'O use las teclas de dirección para girar la Dollhouse.',
  13496. 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.',
  13497. HELP_DESKTOP_FLOORPLAN_2A: 'Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.',
  13498. HELP_DESKTOP_FLOORPLAN_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  13499. HELP_DESKTOP_FLOORPLAN_2B: 'O use las teclas para girar hacia la izquierda o derecha.',
  13500. HELP_DESKTOP_FLOORPLAN_3B: 'O use las teclas de dirección para acercar o alejar.',
  13501. HELP_MOBILE_PANORAMA_1: 'Toque y arrastre para mirar alrededor del espacio.',
  13502. HELP_MOBILE_PANORAMA_2: 'Toque en los aros a lo largo del espacio para moverse.',
  13503. HELP_MOBILE_3: 'Use el gesto de pellizcar para acercar o alejar.',
  13504. HELP_MOBILE_360_2: 'Toque el ícono Vista Interior para entrar en el Espacio.',
  13505. HELP_MOBILE_DOLLHOUSE_1: 'Toque y arrastre con dos dedos para cambiar la posición della dollhouse.',
  13506. HELP_MOBILE_DOLLHOUSE_2: 'Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.',
  13507. HELP_MOBILE_FLOORPLAN_1: 'Toque y arrastre para cambiar la posición de la planta.',
  13508. HELP_MOBILE_FLOORPLAN_2: 'Toque y arrastre con dos dedos para girar la planta.',
  13509. HELP_MORE_HLR_A: 'Galería destacada',
  13510. HELP_DESKTOP_MORE_HLR_B: 'Abra para navegar a través del espacio utilizando imágenes en miniatura.',
  13511. HELP_MORE_DOLLHOUSE_A: 'Vista aérea por pisos',
  13512. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'Haga clic para ver y girar la Dollhouse del espacio completo en 3D.',
  13513. HELP_MOBILE_MORE_DOLLHOUSE_B: 'Toque para ver y girar la vista Dollhouse del espacio completo en 3D.',
  13514. HELP_MORE_FLOORS_A: 'Seleccionador de plantas',
  13515. HELP_DESKTOP_MORE_FLOORS_B: 'Cambie de una planta a otra en el espacio.',
  13516. HELP_MORE_TAG_A: 'tag™ Posts',
  13517. HELP_DESKTOP_MORE_TAG_B: 'Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.',
  13518. HELP_MOBILE_MORE_TAG_B: 'Toque para obtener más información acerca de las características del espacio.',
  13519. HELP_MORE_ZOOM_A: 'Controles de zoom',
  13520. HELP_DESKTOP_MORE_ZOOM_B: 'Use estos controles o la rueda de desplazamiento para acercar o alejar.',
  13521. HELP_MORE_TOUR_A: 'Controles de recorrido',
  13522. HELP_DESKTOP_MORE_TOUR_B: 'Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.',
  13523. HELP_MORE_INSIDE_A: 'Vista interior',
  13524. HELP_DESKTOP_MORE_INSIDE_B: 'Haga clic para explorar el interior del espacio.',
  13525. HELP_MOBILE_MORE_INSIDE_B: 'Toque para explorar el interior del espacio.',
  13526. HELP_MORE_VR_A: 'Modo de realidad virtual',
  13527. HELP_DESKTOP_MORE_VR_B: 'Toque para ver el espacio en realidad virtual.',
  13528. HELP_MOBILE_MORE_VR_B: 'Toque para ver el espacio en realidad virtual.',
  13529. HELP_MORE_360_A: '360° Views',
  13530. HELP_DESKTOP_MORE_360_B: 'Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.',
  13531. HELP_MOBILE_MORE_360_B: 'Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.',
  13532. HELP_MORE_FULLSCREEN_A: 'Pantalla completa',
  13533. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Expanda el escenario 3D para verlo en pantalla completa.',
  13534. WEBVR_FOR_CARDBOARD: 'Para Google Cardboard',
  13535. WEBVR_FOR_DAYDREAM: 'Para Daydream View',
  13536. WEBVR_ENTER_WEBVR: 'ENTRAR VR',
  13537. WEBVR_DIFFERENT_HEADSET: '¿Tiene un auricular diferente?',
  13538. WEBVR_LEARN_MORE: 'Más información',
  13539. WEBVR_VIEW_SPACE: 'Ver Espacio en VR',
  13540. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  13541. WEBVR_DAYDREAM_PHONE: 'Daydream Teléfono listos',
  13542. WEBVR_VIEW_CARDBOARD: 'O Ver en Google Cardboard',
  13543. VR_NEED_DAYDREAM: 'Necesidades antes de acoplarse con Daydream View',
  13544. VR_NEED_DAYDREAM_PHONE: 'Teléfono listo para Daydream',
  13545. VR_GOOGLE_DAYDREAM: 'Daydream de Google',
  13546. VR_APP: 'port VR App',
  13547. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13548. VR_APP_FOR_ANDROID: 'Aplicación port VR para Teléfonos Android',
  13549. VR_APP_OPEN: 'Abrir con la aplicación port VR en su lugar',
  13550. VR_VIEW_SPACE: 'Ver Espacio en realidad virtual',
  13551. VR_LEARN_MORE_CAPS: 'SABER MÁS',
  13552. VR_PREVIOUS_CAPS: 'ANTERIOR',
  13553. VR_NEXT_CAPS: 'SIGUIENTE',
  13554. VR_GOT_IT_CAPS: 'COMPRENDIDO',
  13555. VR_SHOW_SUPPORTED: 'Pulse para ver el Espacio en realidad virtual con',
  13556. VR_SHOW_UNSUPPORTED: 'Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.',
  13557. VR_SHOW_IOS_1: 'Pulse para ver el Espacio en realidad virtual',
  13558. VR_SHOW_IOS_2: 'Necesita la aplicación port VR y un iPhone compatible para ver',
  13559. VR_WHAT_YOU_NEED: 'Lo que necesitaras...',
  13560. VR_NEED_CARDBOARD: 'Lo que necesitaras con Google Cardboard',
  13561. VR_NEED_SAMSUNG: 'Lo que necesitaras con el Samsung Gear VR',
  13562. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  13563. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  13564. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  13565. VR_COMPATIBLE_IPHONES_2: 'Compatible con iPhone 6S o superior y con iOS 9.1 en adelante',
  13566. VR_COMPATIBLE_IPHONES_3: 'iPhones compatibles',
  13567. VR_COMPATIBLE_ANDROID: 'Dispositivos Android compatibles',
  13568. VR_ANDROID_DETAIL: 'Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante',
  13569. VR_ANDROID_DVICES: 'Dispositivos Android',
  13570. VR_COMPATIBLE_SAMSUNG: 'Dispositivos compatibles del Samsung',
  13571. VR_SAMSUNG_DETAIL: 'Galaxy S5 en adelante',
  13572. VR_APP_FOR_CARDBOARD: 'Aplicación port VR para Google Cardboard',
  13573. VR_APP_FOR_SAMSUNG: 'Aplicación port VR para Gear VR',
  13574. VR_DOWNLOAD_HERE: 'Descargar aquí',
  13575. VR_REQUIRE_HEADSET: 'Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android',
  13576. VR_REDIRECT_TO_STORE: 'Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.',
  13577. VR_IMPROPER_EMBED: 'El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.',
  13578. VR_OPEN_ANDROID_LINK: 'Abre el enlace en tu teléfono móvil',
  13579. VR_ANDROID_OPTIONS: 'Opciones de auriculares en RV disponibles',
  13580. SHARE_TO: 'Compartir en',
  13581. SHARE_LINK: 'Enlace directo',
  13582. SHARE_EXPLORE: 'Explorar ',
  13583. SHARE_AT: 'en',
  13584. SHARE_WITH: 'con',
  13585. SHARE_3D: ' en 3D',
  13586. SHARE_COPIED: '¡Copiado!',
  13587. ERROR_BROWSER_SOLUTION: 'Instale un nuevo navegador para explorar en 3D.',
  13588. ERROR_BROWSER_EXPLANATION: 'WebGL requiere un navegador moderno.',
  13589. ERROR_GENERIC_PROBLEM: 'Vaya, algo ha ido mal.',
  13590. ERROR_GENERIC_SOLUTION: 'Reinicie su navegador.',
  13591. ERROR_GENERIC_ACTIONS_1: 'Si el problema persiste, ',
  13592. ERROR_GENERIC_ACTIONS_2: 'instale un navegador compatible',
  13593. ERROR_GENERIC_ACTIONS_3: ' o ',
  13594. ERROR_GENERIC_ACTIONS_4: 'consulte nuestra guía de solución de problemas',
  13595. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Navegador no compatible.',
  13596. ERROR_WEBGL_IOS_PROBLEM: 'Versión de iOS no compatible.',
  13597. ERROR_WEBGL_IOS_SOLUTION: 'Actualice a iOS 8 o superior para explorar en 3D.',
  13598. ERROR_WEBGL_IOS_ACTIONS_1: 'Pulse ',
  13599. ERROR_WEBGL_IOS_ACTIONS_2: 'Ajustes > General > Actualización de software',
  13600. ERROR_WEBGL_SAFARI_PROBLEM: 'Habilite WebGL para explorar en 3D.',
  13601. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Haga clic en ',
  13602. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Preferencias > Avanzado > Mostrar el menú Desarrollar',
  13603. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Después, haga clic en ',
  13604. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Desarrollar > Habilitar WebGL',
  13605. ERROR_MISSING_URLS_PROBLEM: 'Vaya, no hay panoramas para este modelo.',
  13606. ERROR_MISSING_URLS_EXPLANATION: 'Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.',
  13607. ERROR_LOADING_FAILED_PROBLEM: 'Vaya, modelo no disponible.',
  13608. ERROR_LOADING_FAILED_ACTIONS_1: 'Si el problema persiste, ',
  13609. ERROR_LOADING_FAILED_ACTIONS_2: 'consulte nuestra guía de solución de problemas',
  13610. ERROR_MAINTENANCE_PROBLEM: 'Mantenimiento en progreso.',
  13611. ERROR_MAINTENANCE_SOLUTION: 'Regrese en unos minutos.',
  13612. LINK_TO_LOCATION: 'Enlace a la ubicación',
  13613. MENU_COPY: 'Copiar',
  13614. LINK_ALERT_COPY: 'Utilice CTRL/CMD + C para copiar.',
  13615. ROTATE: 'Girar',
  13616. INSIDE: 'Interior',
  13617. MOVE: 'Moverse',
  13618. ZOOM: 'Acercar o alejar'
  13619. }
  13620. },
  13621. {}
  13622. ],
  13623. 113: [
  13624. function (e, t, i) {
  13625. 'use strict'
  13626. t.exports = {
  13627. PAGE_TITLE: '',
  13628. LOADING: 'Chargement',
  13629. PRESENTED_BY_CAPS: 'PRÉSENTÉ PAR',
  13630. POWERED_BY: 'alimenté par ',
  13631. POWERED_BY_CAPS: 'ALIMENTÉ PAR',
  13632. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13633. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13634. PRESENTED_BY: 'Présenté par ',
  13635. MORE: 'Plus ',
  13636. LESS: 'Moins ',
  13637. TAG_CONTENT: 'Contenu tag™',
  13638. SHOW: 'Montrer',
  13639. HIDE: 'Cacher',
  13640. DOLLHOUSE: 'Dollhouse',
  13641. FLOOR_PLAN: 'Plan de sol',
  13642. OPEN_HIGHLIGHTS: 'Ouvrir les faits saillants',
  13643. CLOSE_HIGHLIGHTS: 'Fermer',
  13644. PREVIOUS: 'Précédent',
  13645. PLAY: 'Lecture',
  13646. PAUSE: 'Pause',
  13647. NEXT: 'Suivant',
  13648. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13649. VIEW_DOLLHOUSE: 'Voir dollhouse',
  13650. SOCIAL_SHARING: 'Partager cet espace',
  13651. VIEW_IN_VR: 'Voir en VR',
  13652. VIEW_FULLSCREEN: 'Plein écran',
  13653. EXIT_FULLSCREEN: 'Fermer plein écran',
  13654. ZOOM_IN: 'Zoom avant',
  13655. ZOOM_OUT: 'Zoom arrière',
  13656. FLOOR_NAME: 'Étage ',
  13657. FLOOR_ALL: 'Tous',
  13658. TERMS: 'Mentions légales',
  13659. PORT_TERMS: 'port mentions légales',
  13660. TERMS_OF_USE: "Conditions d'utilisation",
  13661. TERMS_TEXT_FILE: 'terms-fr-FR.html',
  13662. CLOSE_TERMS: 'Fermer',
  13663. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13664. HELP: 'Aide',
  13665. HELP_NAVIGATION_TAB: 'Navigation',
  13666. HELP_MORE_HELP_TAB: 'Aide',
  13667. CLOSE: 'Fermer',
  13668. HELP_DESKTOP_PANORAMA_1A: 'Cliquez et faites glisser pour regarder autour de l’espace.',
  13669. HELP_DESKTOP_PANORAMA_2A: 'Cliquez sur les anneaux pour vous déplacer.',
  13670. HELP_DESKTOP_PANORAMA_3A: 'Utilisez la molette de votre souris pour zoomer.',
  13671. HELP_DESKTOP_PANORAMA_1B: 'Ou utilisez les touches pour tourner.',
  13672. HELP_DESKTOP_PANORAMA_2B: 'Ou utilisez les touches pour avancer et reculer.',
  13673. HELP_DESKTOP_PANORAMA_3B: 'Ou utilisez les touches plus et moins pour zoomer.',
  13674. HELP_DESKTOP_360_2A: 'Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.',
  13675. HELP_DESKTOP_360_2B: 'Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.',
  13676. HELP_DESKTOP_DOLLHOUSE_1A: 'Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.',
  13677. HELP_DESKTOP_DOLLHOUSE_2A: 'Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.',
  13678. HELP_DESKTOP_DOLLHOUSE_3A: 'Utilisez la molette de votre souris pour zoomer.',
  13679. HELP_DESKTOP_DOLLHOUSE_1B: 'Ou utilisez les touches pour faire pivoter la vue Dollhouse.',
  13680. HELP_DESKTOP_FLOORPLAN_1A: 'Faites un clic droit pour changer la position du plan sur l’écran.',
  13681. HELP_DESKTOP_FLOORPLAN_2A: 'Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.',
  13682. HELP_DESKTOP_FLOORPLAN_3A: 'Utilisez la molette de votre souris pour zoomer.',
  13683. HELP_DESKTOP_FLOORPLAN_2B: 'Ou utilisez les touches pour faire pivoter à gauche ou à droite.',
  13684. HELP_DESKTOP_FLOORPLAN_3B: 'Ou utilisez les touches pour effectuer un zoom avant ou arrière.',
  13685. HELP_MOBILE_PANORAMA_1: 'Touchez et faites glisser pour regarder autour de l’espace.',
  13686. HELP_MOBILE_PANORAMA_2: 'Tapez sur les anneaux dans tout l’espace pour vous déplacer.',
  13687. HELP_MOBILE_3: 'Utilisez un geste de pincement pour zoomer avant/arrière.',
  13688. HELP_MOBILE_360_2: 'Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.',
  13689. HELP_MOBILE_DOLLHOUSE_1: 'Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.',
  13690. HELP_MOBILE_DOLLHOUSE_2: 'Touchez et faites glisser avec deux doigts pour positionner vue en coupe.',
  13691. HELP_MOBILE_FLOORPLAN_1: 'Touchez et faites glisser pour positionner le plan.',
  13692. HELP_MOBILE_FLOORPLAN_2: 'Touchez et faites glisser avec deux doigts pour faire pivoter le plan.',
  13693. HELP_MORE_HLR_A: 'Carrousel',
  13694. HELP_DESKTOP_MORE_HLR_B: 'Ouvrez pour naviguer dans l’espace en utilisant les vignettes.',
  13695. HELP_MORE_DOLLHOUSE_A: 'Vue en coupe',
  13696. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'Cliquez pour afficher et faire pivoter l’espace entier en 3D.',
  13697. HELP_MOBILE_MORE_DOLLHOUSE_B: 'Tapez pour afficher et faire pivoter l’espace entier en 3D.',
  13698. HELP_MORE_FLOORS_A: 'Sélecteur d’étage',
  13699. HELP_DESKTOP_MORE_FLOORS_B: 'Basculer entre les étages dans l’espace.',
  13700. HELP_MORE_TAG_A: 'tag™ Posts',
  13701. HELP_DESKTOP_MORE_TAG_B: 'Cliquez ou survolez pour obtenir des informations sur l’espace.',
  13702. HELP_MOBILE_MORE_TAG_B: 'Tapez pour obtenir des informations sur l’espace.',
  13703. HELP_MORE_ZOOM_A: 'Commandes de zoom',
  13704. HELP_DESKTOP_MORE_ZOOM_B: 'Utilisez votre clavier ou la molette de votre souris pour zoomer.',
  13705. HELP_MORE_TOUR_A: 'Commandes de la visite',
  13706. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13707. HELP_MORE_INSIDE_A: 'Vue intérieure',
  13708. HELP_DESKTOP_MORE_INSIDE_B: 'Cliquez pour explorer l’intérieur de l’espace.',
  13709. HELP_MOBILE_MORE_INSIDE_B: 'Tapez pour explorer l’intérieur de l’espace.',
  13710. HELP_MORE_VR_A: 'Mode RV',
  13711. HELP_DESKTOP_MORE_VR_B: 'Cliquez pour lancer l’espace en réalité virtuelle.',
  13712. HELP_MOBILE_MORE_VR_B: 'Tapez pour lancer l’espace en réalité virtuelle.',
  13713. HELP_MORE_360_A: 'Vues 360°',
  13714. HELP_DESKTOP_MORE_360_B: 'Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.',
  13715. HELP_MOBILE_MORE_360_B: 'Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.',
  13716. HELP_MORE_FULLSCREEN_A: 'Plein écran',
  13717. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Voir 3D Showcase en plein écran.',
  13718. WEBVR_FOR_CARDBOARD: 'Pour Google Cardboard',
  13719. WEBVR_FOR_DAYDREAM: 'Pour Daydream View',
  13720. WEBVR_ENTER_WEBVR: 'ENTRER VR',
  13721. WEBVR_DIFFERENT_HEADSET: 'Avez-vous un casque différent?',
  13722. WEBVR_LEARN_MORE: 'En savoir plus',
  13723. WEBVR_VIEW_SPACE: 'Voir Espace en VR',
  13724. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  13725. WEBVR_DAYDREAM_PHONE: 'Téléphone compatibles Daydream',
  13726. WEBVR_VIEW_CARDBOARD: 'Ou Afficher sur Google Cardboard',
  13727. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13728. VR_LEARN_MORE_CAPS: 'EN SAVOIR PLUS',
  13729. VR_PREVIOUS_CAPS: 'PRÉCÉDENT',
  13730. VR_NEXT_CAPS: 'SUIVANT',
  13731. VR_GOT_IT_CAPS: 'BIEN COMPRIS',
  13732. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13733. VR_SHOW_UNSUPPORTED: 'Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.',
  13734. VR_SHOW_IOS_1: 'Taper pour voir l’Espace en Realité Virtuelle',
  13735. VR_SHOW_IOS_2: 'Nécessite l’application port VR et un iPhone compatible pour voir',
  13736. VR_WHAT_YOU_NEED: 'Ce dont vous aurez besoin pour...',
  13737. VR_NEED_CARDBOARD: 'Ce dont vous aurez besoin avec Google Cardboard',
  13738. VR_NEED_SAMSUNG: 'Ce dont vous aurez besoin avec Samsung Gear VR',
  13739. VR_NEED_DAYDREAM: 'BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW',
  13740. VR_NEED_DAYDREAM_PHONE: 'Téléphone compatible avec Daydream',
  13741. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  13742. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  13743. VR_APP: 'port VR App',
  13744. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  13745. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  13746. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s et plus récent, avec iOS 9.1 et plus récent',
  13747. VR_COMPATIBLE_IPHONES_3: 'iPhones compatibles',
  13748. VR_COMPATIBLE_ANDROID: 'Appareils Android compatibles',
  13749. 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',
  13750. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13751. VR_ANDROID_DVICES: 'Appareils Android',
  13752. VR_COMPATIBLE_SAMSUNG: 'Appareils Samsung Compatibles',
  13753. VR_SAMSUNG_DETAIL: 'Galaxy S6 et plus récents',
  13754. VR_APP_FOR_CARDBOARD: 'Application port VR pour Google Cardboard',
  13755. VR_APP_FOR_SAMSUNG: 'Application port VR pour Gear VR',
  13756. VR_APP_FOR_ANDROID: 'Application port VR pour téléphones Android',
  13757. VR_APP_OPEN: 'Ouvrir plutôt avec l’application port VR',
  13758. VR_DOWNLOAD_HERE: 'Télécharger ici',
  13759. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13760. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13761. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13762. VR_OPEN_ANDROID_LINK: 'Ouvrez ce lien avec votre appareil mobile',
  13763. VR_ANDROID_OPTIONS: 'Options disponibles pour casque VR sous',
  13764. SHARE_TO: 'Partager sur',
  13765. SHARE_LINK: 'Lien direct',
  13766. SHARE_EXPLORE: 'Explorer ',
  13767. SHARE_AT: 'à',
  13768. SHARE_WITH: 'avec',
  13769. SHARE_3D: ' en 3D',
  13770. SHARE_COPIED: 'Copié!',
  13771. ERROR_BROWSER_SOLUTION: 'Installer un nouveau navigateur pour explorer en 3D.',
  13772. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13773. ERROR_GENERIC_PROBLEM: 'Il y eu un problème.',
  13774. ERROR_GENERIC_SOLUTION: 'Redémarrer votre navigateur.',
  13775. ERROR_GENERIC_ACTIONS_1: 'Si le problème persiste, ',
  13776. ERROR_GENERIC_ACTIONS_2: 'installez un navigateur plus récent',
  13777. ERROR_GENERIC_ACTIONS_3: ' ou ',
  13778. ERROR_GENERIC_ACTIONS_4: 'voir notre guide de dépannage',
  13779. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Navigateur non-supporté.',
  13780. ERROR_WEBGL_IOS_PROBLEM: 'Version iOS non-supportée.',
  13781. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13782. ERROR_WEBGL_IOS_ACTIONS_1: 'Tapez ',
  13783. ERROR_WEBGL_IOS_ACTIONS_2: 'Paramètres > Général > Mise à jour Software',
  13784. ERROR_WEBGL_SAFARI_PROBLEM: 'Activez WegGL pour explorer en 3D.',
  13785. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Cliquez ',
  13786. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Préferences > Avancés > Voir menu développeur',
  13787. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Puis cliquez ',
  13788. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Développe > Activé WebGL',
  13789. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13790. ERROR_MISSING_URLS_EXPLANATION: 'Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.',
  13791. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13792. ERROR_LOADING_FAILED_ACTIONS_1: 'Si le problème persiste, ',
  13793. ERROR_LOADING_FAILED_ACTIONS_2: 'voir notre guide de dépannage',
  13794. ERROR_MAINTENANCE_PROBLEM: 'Maintenance en cours.',
  13795. ERROR_MAINTENANCE_SOLUTION: 'Revenez dans quelques instants.',
  13796. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13797. MENU_COPY: 'Copie',
  13798. LINK_ALERT_COPY: 'Utiliser CTRL+CMD C pour copier.',
  13799. ROTATE: 'Faire pivoter',
  13800. INSIDE: 'Intérieure',
  13801. MOVE: 'Se déplacer',
  13802. ZOOM: 'Zoom'
  13803. }
  13804. },
  13805. {}
  13806. ],
  13807. 114: [
  13808. function (e, t, i) {
  13809. 'use strict'
  13810. t.exports = {
  13811. PAGE_TITLE: '',
  13812. LOADING: '読み込み中',
  13813. PRESENTED_BY_CAPS: 'PRESENTED BY',
  13814. POWERED_BY: 'powered by',
  13815. POWERED_BY_CAPS: 'POWERED BY',
  13816. DESKTOP_SHORT_CTA: 'クリックしてこの3D Spaceを探索',
  13817. MOBILE_SHORT_CTA: 'タップしてこの3D Spaceを探索',
  13818. PRESENTED_BY: 'Presented by ',
  13819. MORE: '全て表示 ',
  13820. LESS: '閉じる ',
  13821. TAG_CONTENT: 'tag™コンテンツ ',
  13822. SHOW: '表示',
  13823. HIDE: '非表示',
  13824. DOLLHOUSE: 'ドールハウス',
  13825. FLOOR_PLAN: 'フロアプラン',
  13826. OPEN_HIGHLIGHTS: 'ハイライトを開く',
  13827. CLOSE_HIGHLIGHTS: '閉じる',
  13828. PREVIOUS: '前へ',
  13829. PLAY: '再生',
  13830. PAUSE: '一時停止',
  13831. NEXT: '次へ',
  13832. EXPLORE_3D_SPACE: '3DSpaceの探索',
  13833. VIEW_DOLLHOUSE: 'ドールハウスの表示',
  13834. SOCIAL_SHARING: 'このSpaceを共有する',
  13835. VIEW_IN_VR: 'VRで表示',
  13836. VIEW_FULLSCREEN: 'フルスクリーン表示',
  13837. EXIT_FULLSCREEN: 'フルスクリーン表示を終了',
  13838. ZOOM_IN: 'ズームイン',
  13839. ZOOM_OUT: 'ズームアウト',
  13840. FLOOR_NAME: 'フロア ',
  13841. FLOOR_ALL: 'すべて',
  13842. TERMS: '規約',
  13843. PORT_TERMS: 'port規約',
  13844. TERMS_OF_USE: '利用規約',
  13845. CLOSE_TERMS: '閉じる',
  13846. TERMS_TEXT_FILE: 'terms-jp-JP.html',
  13847. TERMS_FAIL: '規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。',
  13848. WEBVR_FOR_DAYDREAM: 'Daydream View用',
  13849. WEBVR_ENTER_WEBVR: 'VRに入る',
  13850. WEBVR_DIFFERENT_HEADSET: '別のヘッドセットをお持ちですか?',
  13851. WEBVR_LEARN_MORE: 'もっと詳しく',
  13852. WEBVR_VIEW_SPACE: 'VRでSpaceを表示',
  13853. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  13854. WEBVR_DAYDREAM_PHONE: 'Daydream対応スマホ',
  13855. WEBVR_FOR_CARDBOARD: 'Google Cardboard用',
  13856. WEBVR_VIEW_CARDBOARD: 'またはGoogle Cardboardで表示',
  13857. VR_VIEW_SPACE: 'バーチャルリアリティでSpaceを表示',
  13858. VR_LEARN_MORE_CAPS: 'もっと詳しく',
  13859. VR_PREVIOUS_CAPS: '前へ',
  13860. VR_NEXT_CAPS: '次へ',
  13861. VR_GOT_IT_CAPS: '了解',
  13862. VR_SHOW_SUPPORTED: 'タップして次を使用してVRでSpaceを表示: ',
  13863. VR_SHOW_UNSUPPORTED: 'お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません',
  13864. VR_SHOW_IOS_1: 'タップしてVRでSpaceを表示',
  13865. VR_SHOW_IOS_2: '表示するにはport VRアプリと互換性のあるiPhoneが必要です',
  13866. VR_WHAT_YOU_NEED: '必要なもの',
  13867. VR_NEED_CARDBOARD: 'Google Cardboardに必要なもの',
  13868. VR_NEED_SAMSUNG: 'Samsung Gear VRに必要なもの',
  13869. VR_NEED_DAYDREAM: '事前にDaydream Viewとのペアリングが必要です',
  13870. VR_NEED_DAYDREAM_PHONE: 'Daydream対応スマホ',
  13871. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  13872. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  13873. VR_APP: 'port VRアプリ',
  13874. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  13875. VR_COMPATIBLE_IPHONES_1: 'iPhone',
  13876. VR_COMPATIBLE_IPHONES_2: 'iOS 9.1以降で動作するiPhone 5s以降のモデル',
  13877. VR_COMPATIBLE_IPHONES_3: '互換性のあるiPhone',
  13878. VR_COMPATIBLE_ANDROID: '互換性のあるAndroidデバイス',
  13879. VR_COMPATIBLE_ANDROID_LONG: 'Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ',
  13880. VR_ANDROID_DETAIL: 'Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ',
  13881. VR_ANDROID_DVICES: 'Androidデバイス',
  13882. VR_COMPATIBLE_SAMSUNG: '互換性のあるSamsungデバイス',
  13883. VR_SAMSUNG_DETAIL: 'Galaxy S5以降のモデル',
  13884. VR_APP_FOR_CARDBOARD: 'Google Cardboard用のport VRアプリ',
  13885. VR_APP_FOR_SAMSUNG: 'Gear VR 用のport VRアプリ',
  13886. VR_APP_FOR_ANDROID: 'Androidフォン用のport VRアプリ',
  13887. VR_APP_OPEN: 'port VRアプリで開く',
  13888. VR_DOWNLOAD_HERE: 'ここからダウンロード',
  13889. VR_REQUIRE_HEADSET: 'Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります',
  13890. VR_REDIRECT_TO_STORE: 'アプリがインストールされていない場合、App Storeにリダイレクトされます',
  13891. VR_IMPROPER_EMBED: 'お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。',
  13892. VR_OPEN_ANDROID_LINK: 'お使いの携帯電話でリンクを開いてください',
  13893. VR_ANDROID_OPTIONS: '利用可能なVRヘッドセットオプション',
  13894. SHARE_TO: '共有先',
  13895. SHARE_LINK: 'ダイレクトリンク',
  13896. SHARE_EXPLORE: '探索',
  13897. SHARE_AT: '場所',
  13898. SHARE_WITH: '使用アプリ',
  13899. SHARE_3D: '3Dで',
  13900. SHARE_COPIED: 'コピーされました!',
  13901. ERROR_BROWSER_SOLUTION: '3D探索するには、新しいバージョンのブラウザをインストールしてください',
  13902. ERROR_BROWSER_EXPLANATION: 'WebGLにはモダンブラウザが必要です。',
  13903. ERROR_GENERIC_PROBLEM: '問題が発生しました。',
  13904. ERROR_GENERIC_SOLUTION: 'ブラウザを再起動してください。',
  13905. ERROR_GENERIC_ACTIONS_1: '問題が解決しない場合は、',
  13906. ERROR_GENERIC_ACTIONS_2: 'サポートされているブラウザをインストールしてください',
  13907. ERROR_GENERIC_ACTIONS_3: 'または',
  13908. ERROR_GENERIC_ACTIONS_4: 'トラブルシューティングガイドを参照してください',
  13909. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'ブラウザがサポートされていません。',
  13910. ERROR_WEBGL_IOS_PROBLEM: 'サポートされていないiOSバージョンです。',
  13911. ERROR_WEBGL_IOS_SOLUTION: '3D探索するには、iOS 8以降にアップグレードしてください。',
  13912. ERROR_WEBGL_IOS_ACTIONS_1: '以下の順にタップします:',
  13913. ERROR_WEBGL_IOS_ACTIONS_2: '設定 > 全般 > ソフトウェアの更新',
  13914. ERROR_WEBGL_SAFARI_PROBLEM: 'WebGLを有効にして3Dで探索します。',
  13915. ERROR_WEBGL_SAFARI_ACTIONS_1: '以下の順にクリックします:',
  13916. ERROR_WEBGL_SAFARI_ACTIONS_2: '環境設定 > 詳細 > メニューバーに開発メニューを表示',
  13917. ERROR_WEBGL_SAFARI_ACTIONS_3: 'その後、以下の順にクリックします:',
  13918. ERROR_WEBGL_SAFARI_ACTIONS_4: '開発 > WebGLを有効にする',
  13919. ERROR_MISSING_URLS_PROBLEM: 'このモデルではパノラマを使用できません。',
  13920. ERROR_MISSING_URLS_EXPLANATION: 'これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。',
  13921. ERROR_LOADING_FAILED_PROBLEM: 'モデルは利用できません。',
  13922. ERROR_LOADING_FAILED_ACTIONS_1: '問題が解決しない場合は、',
  13923. ERROR_LOADING_FAILED_ACTIONS_2: 'トラブルシューティングガイドを参照してください',
  13924. ERROR_MAINTENANCE_PROBLEM: 'メンテナンスは進行中です。',
  13925. ERROR_MAINTENANCE_SOLUTION: 'しばらくしてからやり直し てください。',
  13926. LINK_TO_LOCATION: 'ロケーションへのリンク',
  13927. MENU_COPY: 'コピー',
  13928. LINK_ALERT_COPY: 'コピーするにはCTRL/CMD + Cを使用してください。',
  13929. ROTATE: '回転',
  13930. MOVE: '移動',
  13931. INSIDE: '内側',
  13932. ZOOM: 'ズーム',
  13933. HELP: 'ヘルプ',
  13934. HELP_NAVIGATION_TAB: 'ナビゲーション',
  13935. HELP_MORE_HELP_TAB: 'その他のヘルプ',
  13936. HELP_DESKTOP_PANORAMA_1A: 'Spaceを見回すには、クリックしてドラッグします。',
  13937. HELP_DESKTOP_PANORAMA_2A: '移動するには、Space全体にあるリングをクリックします。',
  13938. HELP_DESKTOP_PANORAMA_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  13939. HELP_DESKTOP_PANORAMA_1B: 'または、矢印キーを使用して左右に向きを変えます。',
  13940. HELP_DESKTOP_PANORAMA_2B: 'または、矢印キーを使用して前後に向きを変えます。',
  13941. HELP_DESKTOP_PANORAMA_3B: 'あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。',
  13942. HELP_DESKTOP_360_2A: '内側ビューアイコンをクリックしてSpaceに入ります。',
  13943. HELP_DESKTOP_360_2B: 'または、数字キー1を押して内側ビューに入ります。',
  13944. HELP_DESKTOP_DOLLHOUSE_1A: '左クリックと左右、上下のドラッグでドールハウスを回転します。',
  13945. HELP_DESKTOP_DOLLHOUSE_2A: '右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。',
  13946. HELP_DESKTOP_DOLLHOUSE_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  13947. HELP_DESKTOP_DOLLHOUSE_1B: 'または、矢印キーを使用してドールハウスを回転します。',
  13948. HELP_DESKTOP_FLOORPLAN_1A: '左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。',
  13949. HELP_DESKTOP_FLOORPLAN_2A: '右ボタンを押しながら左右にドラッグして、フロアプランを回転します。',
  13950. HELP_DESKTOP_FLOORPLAN_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  13951. HELP_DESKTOP_FLOORPLAN_2B: 'または、矢印キーを使用して左右に回転します。',
  13952. HELP_DESKTOP_FLOORPLAN_3B: 'または、矢印キーを使用して、ズームイン、ズームアウトします。',
  13953. HELP_MOBILE_PANORAMA_1: 'Spaceを見回すには、タッチしてドラッグします。',
  13954. HELP_MOBILE_PANORAMA_2: '移動するには、Space全体にあるリングをタップします。',
  13955. HELP_MOBILE_3: 'ピンチジェスチャーを使用してズームイン、ズームアウトします。',
  13956. HELP_MOBILE_360_2: '内側ビューアイコンをタップしてSpaceに入ります。',
  13957. HELP_MOBILE_DOLLHOUSE_1: 'タッチして上下左右にドラッグしてドールハウスを回転します。',
  13958. HELP_MOBILE_DOLLHOUSE_2: 'タッチして、2本指でドラッグしてドールハウスを配置します。',
  13959. HELP_MOBILE_FLOORPLAN_1: 'タッチ&ドラッグしてフロアプランを配置します。',
  13960. HELP_MOBILE_FLOORPLAN_2: 'タッチして、2本指でドラッグしてフロアプランを回転します。',
  13961. HELP_MORE_HLR_A: 'ハイライト',
  13962. HELP_DESKTOP_MORE_HLR_B: 'サムネイル画像を使用してSpaceを移動するために開きます。',
  13963. HELP_MORE_DOLLHOUSE_A: 'ドールハウス',
  13964. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'クリックして3DでSpace全体のトップダウンビューを表示して回転します。',
  13965. HELP_MOBILE_MORE_DOLLHOUSE_B: 'タップして3DでSpace全体のトップダウンビューを表示して回転します。',
  13966. HELP_MORE_FLOORS_A: 'フロアセレクター',
  13967. HELP_DESKTOP_MORE_FLOORS_B: 'Space内のフロアを切り替えます。',
  13968. HELP_MORE_TAG_A: 'tag™ Posts',
  13969. HELP_DESKTOP_MORE_TAG_B: 'クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。',
  13970. HELP_MOBILE_MORE_TAG_B: 'タップするとSpace内の機能についての説明が表示されます。',
  13971. HELP_MORE_ZOOM_A: 'ズームコントロール',
  13972. HELP_DESKTOP_MORE_ZOOM_B: 'これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。',
  13973. HELP_MORE_TOUR_A: 'ツアーコントロール',
  13974. HELP_DESKTOP_MORE_TOUR_B: 'ガイド付きツアー中に再生、一時停止、前方・後方に移動します。',
  13975. HELP_MORE_INSIDE_A: '内側ビュー',
  13976. HELP_DESKTOP_MORE_INSIDE_B: 'クリックしてSpace内を探索します。',
  13977. HELP_MOBILE_MORE_INSIDE_B: 'タップしてSpace内を探索します。',
  13978. HELP_MORE_VR_A: 'VRモード',
  13979. HELP_DESKTOP_MORE_VR_B: 'クリックしてバーチャルリアリティでSpaceを起動します。',
  13980. HELP_MOBILE_MORE_VR_B: 'タップしてバーチャルリアリティでSpaceを起動します。',
  13981. HELP_MORE_360_A: '360° Views',
  13982. HELP_DESKTOP_MORE_360_B: 'Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。',
  13983. HELP_MOBILE_MORE_360_B: 'Highlight Reelの360° Viewsをタップして屋外シーンを表示します。',
  13984. HELP_MORE_FULLSCREEN_A: 'フルスクリーン',
  13985. HELP_DESKTOP_MORE_FULLSCREEN_B: '3D Showcaseをフルスクリーン表示にします。',
  13986. CLOSE: '閉じる'
  13987. }
  13988. },
  13989. {}
  13990. ],
  13991. 115: [
  13992. function (e, t, i) {
  13993. 'use strict'
  13994. t.exports = {
  13995. PAGE_TITLE: '',
  13996. LOADING: 'Загрузка',
  13997. PRESENTED_BY_CAPS: 'ПРЕДСТАВЛЕНО',
  13998. POWERED_BY: 'разработано на платформе ',
  13999. POWERED_BY_CAPS: 'РАЗРАБОТАНО НА ПЛАТФОРМЕ',
  14000. DESKTOP_SHORT_CTA: 'Нажмите для просмотра.',
  14001. MOBILE_SHORT_CTA: 'Нажмите для просмотра.',
  14002. PRESENTED_BY: 'Представлено ',
  14003. MORE: 'Больше ',
  14004. LESS: 'Меньше ',
  14005. TAG_CONTENT: 'tag™ Контент',
  14006. SHOW: 'Показать',
  14007. HIDE: 'Скрыть',
  14008. DOLLHOUSE: 'Dollhouse',
  14009. FLOOR_PLAN: 'Планировка',
  14010. OPEN_HIGHLIGHTS: 'Открыть Фотоколлаж',
  14011. CLOSE_HIGHLIGHTS: 'Закрыть',
  14012. PREVIOUS: 'Предыдущий',
  14013. PLAY: 'Воспроизвести',
  14014. PAUSE: 'Пауза',
  14015. NEXT: 'Следующий',
  14016. EXPLORE_3D_SPACE: 'Просмотреть 3D модель',
  14017. VIEW_DOLLHOUSE: 'Посмотреть Dollhouse',
  14018. SOCIAL_SHARING: 'Поделиться этой моделью',
  14019. VIEW_IN_VR: 'Посмотреть в VR',
  14020. VIEW_FULLSCREEN: 'Полный экран',
  14021. EXIT_FULLSCREEN: 'Выйти из полноэкранного режима',
  14022. ZOOM_IN: 'Увеличить',
  14023. ZOOM_OUT: 'Уменьшить',
  14024. FLOOR_NAME: 'Этаж ',
  14025. FLOOR_ALL: 'Все',
  14026. TERMS: 'Условия',
  14027. PORT_TERMS: 'Правила пользования',
  14028. TERMS_OF_USE: 'Условия использования',
  14029. TERMS_TEXT_FILE: 'terms-ru-RU.html',
  14030. CLOSE_TERMS: 'Закрыть',
  14031. TERMS_FAIL: 'Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.',
  14032. HELP: 'Помощь',
  14033. HELP_NAVIGATION_TAB: 'Навигация',
  14034. HELP_MORE_HELP_TAB: 'Доп. Помощь',
  14035. CLOSE: 'Закрыть',
  14036. HELP_DESKTOP_PANORAMA_1A: 'Нажмите и перетащите, чтобы осмотреть пространство вокруг.',
  14037. HELP_DESKTOP_PANORAMA_2A: 'Для передвижения по модели нажимайте на круги .',
  14038. HELP_DESKTOP_PANORAMA_3A: 'Используйте колесо прокрутки для увеличения и уменьшения.',
  14039. HELP_DESKTOP_PANORAMA_1B: 'Или используйте клавиши со стрелками для поворота влево и вправо.',
  14040. HELP_DESKTOP_PANORAMA_2B: 'Или используйте стрелки для перемещения вперед и назад.',
  14041. HELP_DESKTOP_PANORAMA_3B: 'Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.',
  14042. HELP_DESKTOP_360_2A: 'Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.',
  14043. HELP_DESKTOP_360_2B: 'или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.',
  14044. HELP_DESKTOP_DOLLHOUSE_1A: 'Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.',
  14045. HELP_DESKTOP_DOLLHOUSE_2A: 'Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.',
  14046. HELP_DESKTOP_DOLLHOUSE_3A: 'Используйте колесо прокрутки чтобы увеличить и уменьшить.',
  14047. HELP_DESKTOP_DOLLHOUSE_1B: 'Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.',
  14048. HELP_DESKTOP_FLOORPLAN_1A: 'Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.',
  14049. HELP_DESKTOP_FLOORPLAN_2A: 'Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.',
  14050. HELP_DESKTOP_FLOORPLAN_3A: 'Используйте колесо прокрутки чтобы увеличить и уменьшить.',
  14051. HELP_DESKTOP_FLOORPLAN_2B: 'Или используйте клавиши со стрелками для поворота влево или вправо.',
  14052. HELP_DESKTOP_FLOORPLAN_3B: 'Или используйте стрелки для увеличения и уменьшения.',
  14053. HELP_MOBILE_PANORAMA_1: 'Нажмите и перетащите, чтобы осмотреть модель.',
  14054. HELP_MOBILE_PANORAMA_2: 'Для передвижения по модели нажимайте на круги.',
  14055. HELP_MOBILE_3: 'Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.',
  14056. HELP_MOBILE_360_2: 'Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.',
  14057. HELP_MOBILE_DOLLHOUSE_1: 'Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.',
  14058. HELP_MOBILE_DOLLHOUSE_2: 'Нажмите и перетащите, чтобы расположить Dollhouse.',
  14059. HELP_MOBILE_FLOORPLAN_1: 'Нажмите и перетащите, чтобы расположить план здания.',
  14060. HELP_MOBILE_FLOORPLAN_2: 'Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.',
  14061. HELP_MORE_HLR_A: 'Фотоколлаж',
  14062. HELP_DESKTOP_MORE_HLR_B: 'Откройте для перемещения по модели, используя иконки изображений.',
  14063. HELP_MORE_DOLLHOUSE_A: 'Dollhouse',
  14064. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.',
  14065. HELP_MOBILE_MORE_DOLLHOUSE_B: 'Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.',
  14066. HELP_MORE_FLOORS_A: 'Выбор Этажа',
  14067. HELP_DESKTOP_MORE_FLOORS_B: 'Переключение между этажами.',
  14068. HELP_MORE_TAG_A: 'tag™ Posts',
  14069. HELP_DESKTOP_MORE_TAG_B: 'Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.',
  14070. HELP_MOBILE_MORE_TAG_B: 'Нажмите для получения информации о функциях.',
  14071. HELP_MORE_ZOOM_A: 'Масштаб',
  14072. HELP_DESKTOP_MORE_ZOOM_B: 'Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.',
  14073. HELP_MORE_TOUR_A: 'Управление Туром',
  14074. HELP_DESKTOP_MORE_TOUR_B: 'Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.',
  14075. HELP_MORE_INSIDE_A: 'Вид Изнутри',
  14076. HELP_DESKTOP_MORE_INSIDE_B: 'Нажмите, чтобы просмотреть модель изнутри.',
  14077. HELP_MOBILE_MORE_INSIDE_B: 'Нажмите, чтобы просмотреть модель изнутри.',
  14078. HELP_MORE_VR_A: 'Режим VR',
  14079. HELP_DESKTOP_MORE_VR_B: 'Нажмите, чтобы запустить модель в виртуальной реальности.',
  14080. HELP_MOBILE_MORE_VR_B: 'Нажмите, чтобы запустить модель в виртуальной реальности.',
  14081. HELP_MORE_360_A: '360° Views',
  14082. HELP_DESKTOP_MORE_360_B: 'Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.',
  14083. HELP_MOBILE_MORE_360_B: 'Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.',
  14084. HELP_MORE_FULLSCREEN_A: 'Полный экран',
  14085. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Развернуть 3D Showcase во весь экран.',
  14086. WEBVR_FOR_CARDBOARD: 'Для Google Cardboard',
  14087. WEBVR_FOR_DAYDREAM: 'Для просмотра в Daydream',
  14088. WEBVR_ENTER_WEBVR: 'ВОЙТИ В VR ',
  14089. WEBVR_DIFFERENT_HEADSET: 'Есть другой VR-шлем?',
  14090. WEBVR_LEARN_MORE: 'Узнать больше',
  14091. WEBVR_VIEW_SPACE: 'Запустить модель в VR',
  14092. WEBVR_DAYDREAM_VIEW: 'Посмотреть в Daydream',
  14093. WEBVR_DAYDREAM_PHONE: 'Daydream-готовый телефон',
  14094. WEBVR_VIEW_CARDBOARD: 'Или просмотреть в Google Cardboard',
  14095. VR_WHAT_YOU_NEED: 'Что Вам потребуется...',
  14096. VR_NEED_DAYDREAM_PHONE: 'Daydream-готовый телефон',
  14097. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  14098. VR_APP: 'port VR App',
  14099. VR_APP_OPEN: 'Или открыть через приложение port VR',
  14100. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  14101. VR_SAMSUNG_DETAIL: 'Galaxy S6 и выше',
  14102. VR_APP_FOR_ANDROID: 'Приложение port VR для Android',
  14103. VR_NEED_DAYDREAM: 'Необходимо для соединением с Daydream',
  14104. VR_VIEW_SPACE: 'Запустить модель в VR',
  14105. VR_LEARN_MORE_CAPS: 'УЗНАТЬ БОЛЬШЕ',
  14106. VR_PREVIOUS_CAPS: 'ПРЕДЫДУЩИЙ',
  14107. VR_NEXT_CAPS: 'СЛЕДУЮЩИЙ',
  14108. VR_GOT_IT_CAPS: 'ЯСНО',
  14109. VR_SHOW_SUPPORTED: 'Нажмите, чтобы просмотреть модель в VR с помощью',
  14110. VR_SHOW_UNSUPPORTED: 'Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.',
  14111. VR_SHOW_IOS_1: 'Нажмите, чтобы просмотреть модель в VR',
  14112. VR_SHOW_IOS_2: 'Для просмотра требуется приложение port VR и совместимый iPhone',
  14113. VR_NEED_CARDBOARD: 'Что Вам потребуется для Google Cardboard',
  14114. VR_NEED_SAMSUNG: 'Что Вам потребуется для Samsung Gear VR',
  14115. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  14116. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  14117. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  14118. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s или новее с iOS 9.1 и выше',
  14119. VR_COMPATIBLE_IPHONES_3: 'Совместимые модели iPhone',
  14120. VR_COMPATIBLE_ANDROID: 'Совместимые Android устройства',
  14121. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  14122. VR_ANDROID_DVICES: 'Android устройства',
  14123. VR_COMPATIBLE_SAMSUNG: 'Совместимые Samsung устройства',
  14124. VR_APP_FOR_CARDBOARD: 'Приложение port VR для Google Cardboard',
  14125. VR_APP_FOR_SAMSUNG: 'Приложение port VR для Gear VR',
  14126. VR_DOWNLOAD_HERE: 'Скачать здесь',
  14127. VR_REQUIRE_HEADSET: 'Требуется VR-шлем и установленное приложение port VR для Android',
  14128. VR_REDIRECT_TO_STORE: 'Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.',
  14129. VR_IMPROPER_EMBED: 'port модель не встроена должным образом для поддержки VR в вашем веб-браузере.',
  14130. VR_OPEN_ANDROID_LINK: 'Откройте ссылку на Вашем мобильном телефоне',
  14131. VR_ANDROID_OPTIONS: 'Доступные опции VR-шлемов',
  14132. SHARE_TO: 'Поделиться',
  14133. SHARE_LINK: 'Прямая ссылка',
  14134. SHARE_EXPLORE: 'просмотреть',
  14135. SHARE_AT: 'на',
  14136. SHARE_WITH: 'с',
  14137. SHARE_3D: 'в 3D',
  14138. SHARE_COPIED: 'Скопировано!',
  14139. ERROR_BROWSER_SOLUTION: 'установите новый браузер, чтобы просмотреть 3D пространство.',
  14140. ERROR_BROWSER_EXPLANATION: 'WebGL требует современный браузер.',
  14141. ERROR_GENERIC_PROBLEM: 'Ой, что-то пошло не так.',
  14142. ERROR_GENERIC_SOLUTION: 'Перезапустите браузер.',
  14143. ERROR_GENERIC_ACTIONS_1: 'Если проблема не устранена, ',
  14144. ERROR_GENERIC_ACTIONS_2: 'установите поддерживаемый браузер',
  14145. ERROR_GENERIC_ACTIONS_3: ' или ',
  14146. ERROR_GENERIC_ACTIONS_4: 'смотрите наше руководство по устранению неполадок',
  14147. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Браузер не поддерживается.',
  14148. ERROR_WEBGL_IOS_PROBLEM: 'iOS-версия не поддерживается.',
  14149. ERROR_WEBGL_IOS_SOLUTION: 'Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.',
  14150. ERROR_WEBGL_IOS_ACTIONS_1: 'Нажмите ',
  14151. ERROR_WEBGL_IOS_ACTIONS_2: 'Настройки > Общие > Обновление ПО',
  14152. ERROR_WEBGL_SAFARI_PROBLEM: 'Включите WebGL для 3D-просмотра.',
  14153. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Нажмите ',
  14154. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Настойки > Дополнения > Показывать меню “Разработка” в строке меню',
  14155. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Затем нажмите ',
  14156. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Разработка > Разрешить WebGL',
  14157. ERROR_MISSING_URLS_PROBLEM: 'Ой, для этой модели нет панорамы.',
  14158. ERROR_MISSING_URLS_EXPLANATION: 'Эта модель устарела. У владельца веб-сайта может быть новая модель.',
  14159. ERROR_LOADING_FAILED_PROBLEM: 'Ой, модель недоступна.',
  14160. ERROR_LOADING_FAILED_ACTIONS_1: 'Если проблема не устранена, ',
  14161. ERROR_LOADING_FAILED_ACTIONS_2: 'посмотрите наше руководство по устранению неполадок',
  14162. ERROR_MAINTENANCE_PROBLEM: 'Выполняется техническое обслуживание.',
  14163. ERROR_MAINTENANCE_SOLUTION: 'Пожалуйста, попробуйте снова через несколько минут.',
  14164. LINK_TO_LOCATION: 'Ссылка на местоположение',
  14165. MENU_COPY: 'Копировать',
  14166. LINK_ALERT_COPY: 'Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.',
  14167. ROTATE: 'Вращать',
  14168. MOVE: 'Передвигаться',
  14169. INSIDE: 'Вид изнутри',
  14170. ZOOM: 'Масштаб'
  14171. }
  14172. },
  14173. {}
  14174. ],
  14175. 116: [
  14176. function (r, e, t) {
  14177. ;(function (i) {
  14178. 'use strict'
  14179. function re(e) {
  14180. console.log('e1:' + e), (e = Math.round(0.4 * e * 100)), console.log('e2:' + e)
  14181. var t = $('.progressbar')
  14182. t.find('.bar').css('width', e + '%'), t.find('.label').css('left', (t.width() * e) / 100 - 15 + 'px'), t.find('.perc').text(e + '%')
  14183. }
  14184. $('#gui-loading').fadeIn(200), re(0.1)
  14185. var e = g_version ? 'modeldata.js' : 'someData.json'
  14186. $.ajax(g_Prefix + 'data/' + window.number + '/' + e + '?' + randomTime().getTime(), {
  14187. dataType: 'json'
  14188. })
  14189. .done(function (e) {
  14190. var t = matcher(e)
  14191. ;(t.files.templates[0] = g_Prefix + e.files.templates[0].replace('{{number}}', window.number)),
  14192. (t.user = {
  14193. is_authenticated: !1,
  14194. flags: [
  14195. 'payment_show_past_due',
  14196. 'sc_imgopt_100',
  14197. 'mattertags',
  14198. 'labels',
  14199. 'fastly_v2_urls',
  14200. 'vr',
  14201. 'uhql',
  14202. 'sc_segment_100',
  14203. 'show_segment_metrics',
  14204. 'content_distribution',
  14205. 'workshop_webgl',
  14206. 'show360views',
  14207. 'showcase_vr',
  14208. 'ws_zooming',
  14209. 'model_settings',
  14210. 'ws_360snapshots',
  14211. 'img_multi_dl',
  14212. 'vrworkshop',
  14213. 'tag_links',
  14214. 'ws_img_multi_dl',
  14215. 'mattertag_links',
  14216. 'billing_tab_hidden',
  14217. 'static_cloud_ui',
  14218. 'metrics',
  14219. 'mattertag_media',
  14220. 'img_size_download',
  14221. 'show_360snapshots',
  14222. 'floorplan',
  14223. 'sc_tilegen_0',
  14224. 'showcase_webvr',
  14225. 'sc_mixpanel_0',
  14226. 'show_clickbait',
  14227. 'zooming',
  14228. 'showcase_tiling',
  14229. 'list_signed_urls_default_3',
  14230. 'fastly_image_opto'
  14231. ]
  14232. })
  14233. try {
  14234. //处理一下导览数据
  14235. t.model.images = t.model.images.filter(e => {
  14236. if (!e.locations && !e.thumbnail_signed_src) return //旧的曾有导览数据是错误的,将它删除
  14237. if (e.locations) e.locations = e.locations.filter(e => e)
  14238. if (e.locations && e.locations.length == 0) return
  14239. return e
  14240. })
  14241. } catch (e) {
  14242. console.log(e)
  14243. }
  14244. window.editTool = new EditTools()
  14245. t.hotIconScale = parseFloat(t.hotIconScale || 1)
  14246. window.DATA = t
  14247. settings.playTourNearBy = !DATA.tourFromStart
  14248. t.model.summary = t.summary
  14249. t.model.name = t.name
  14250. for (let i in t) {
  14251. t[i] == 'false' && (t[i] = false)
  14252. }
  14253. re(0.7),
  14254. (function () {
  14255. function y(e) {
  14256. t.update(e)
  14257. }
  14258. function A(e, t) {
  14259. ne.error(t), n.error(t), N.report(e, 'error-' + t)
  14260. }
  14261. function C(e, t, i) {
  14262. try {
  14263. e.start(t)
  14264. } catch (e) {
  14265. throw (
  14266. (ne.warn(e.message),
  14267. (function (e) {
  14268. var t = O.details()
  14269. t && 'Safari' === t.name && 500 < t.version && t.version < 600
  14270. ? (n.error('webgl-safari'), N.report(e, 'error-webgl-safari'))
  14271. : (n.error('webgl-generic'), N.report(e, 'error-webgl-generic'))
  14272. })(i.sid),
  14273. e)
  14274. )
  14275. }
  14276. }
  14277. function I(e) {
  14278. e.stopPropagation(), e.preventDefault()
  14279. }
  14280. window.DATA.hoticon &&
  14281. (g_HotImage = {
  14282. point: window.DATA.hoticon.default || 'https://super.4dage.com/images/4dagePoint2.png',
  14283. point2: window.DATA.hoticon.higt || 'https://super.4dage.com/images/4dagePoint.png'
  14284. })
  14285. if (window.DATA.backgroundMusic && window.isLocal) {
  14286. window.DATA.backgroundMusic = manage.dealURL(window.DATA.backgroundMusic)
  14287. } else if (g_version === 'one') {
  14288. window.DATA.backgroundMusic = manage.dealURL(g_Prefix + '/audio/' + 'audio' + window.number + '/background.mp3')
  14289. }
  14290. if (window.DATA.backgroundMusic) {
  14291. SoundManager.setSrc('bgm', window.DATA.backgroundMusic)
  14292. $('#volume').show()
  14293. }
  14294. //隐藏公司logo
  14295. window.DATA.loadlogo && showLogo()
  14296. // 隐藏顶部介绍
  14297. window.DATA.topText && topTextHide()
  14298. r('./lib/three75-shim'),
  14299. r('./lib/array-polyfill'),
  14300. r('./lib/performance-polyfill'),
  14301. r('./lib/shaders/CopyShader.js'),
  14302. r('./lib/shaders/HorizontalBlurShader.js'),
  14303. r('./lib/shaders/VerticalBlurShader.js'),
  14304. r('./lib/postprocessing/EffectComposer.js'),
  14305. r('./lib/postprocessing/RenderPass.js'),
  14306. r('./lib/postprocessing/MaskPass.js'),
  14307. r('./lib/postprocessing/ShaderPass.js'),
  14308. window.Promise || (window.Promise = r('promise-polyfill'))
  14309. var E = r('three'),
  14310. _ = r('three'),
  14311. b = (r('./util/sentry'), r('./player')),
  14312. w = r('./director'),
  14313. T = r('./controls/CameraControls'),
  14314. x = r('./model/ModelManager'),
  14315. S = r('./DisplayController'),
  14316. M = r('./label/LabelDisplayController'),
  14317. R = r('./enum/Viewmode'),
  14318. e = r('./util/logger'),
  14319. P = r('./showcase'),
  14320. O = r('./util/browser'),
  14321. L = r('./settings'),
  14322. D = r('./gui/gui'),
  14323. n = r('./gui/error'),
  14324. N = r('./analytics'),
  14325. F = r('./util/transitions'),
  14326. B = r('./effects'),
  14327. V = r('./objects/Skybox'),
  14328. k = (r('./util/common'), r('./util/PanoramaCollection'), r('./util/math'), r('./util/showcase')),
  14329. U = r('./util/camera'),
  14330. H = (r('./objects/Panorama'), r('./cameras/PanoramaCamera'), r('./preloaders')),
  14331. z = r('events').EventEmitter,
  14332. G = r('./featureflags'),
  14333. W = (r('./util/lerp'), r('./util/ajax'), r('./ab')),
  14334. j = r('./sdk/automation.js'),
  14335. Y = r('./scene/SceneRenderer'),
  14336. q = r('./scene/QuickstartManager'),
  14337. X = r('./tile/QualityManager.js'),
  14338. Z = r('./localization/localize'),
  14339. K = r('./tag/tagManager'),
  14340. Q = r('./tile/TileDownloader'),
  14341. J = r('./tile/PanoRenderer'),
  14342. ee = (r('./enum/PanoSizeClass'), r('./enum/PanoramaEvents'), r('./enum/SceneRendererEvents')),
  14343. t = r('./gui/memoryUsage'),
  14344. te = r('./enum/RenderLayers'),
  14345. ie = r('./TimingData'),
  14346. ne = new e(i)
  14347. ;(e.level = L.logLevel),
  14348. (e.consoleEnabled = L.console),
  14349. (function () {
  14350. var e = window.number //k.getModelIDFromQueryString();
  14351. if (!e) return A(null, 'loading-failed')
  14352. var t = k.parseSidUrl(e),
  14353. i = O.valueFromHash('play', !1) ? 'autoplay' : O.inIframe() ? 'click' : 'fullpage',
  14354. n = {
  14355. panoElementsToLoad: 6,
  14356. modelElementsToLoad: 0,
  14357. totalElementsLoaded: 0,
  14358. totalElementsToLoad: 0,
  14359. totalPercentageLoaded: 0,
  14360. progressCallback: null
  14361. },
  14362. r = document.getElementById('player'),
  14363. o = L.quickstart.enabled,
  14364. a = null,
  14365. s = null,
  14366. l = null,
  14367. c = null,
  14368. h = null,
  14369. u = null,
  14370. d = null,
  14371. p = null,
  14372. f = null,
  14373. g = null,
  14374. m = null,
  14375. v = new ie()
  14376. !(function (e) {
  14377. ne.info('Version', '2.25.6-0-gd87e5b1'),
  14378. (z.defaultMaxListeners = 1e3),
  14379. (function (e) {
  14380. e.addEventListener('dragenter', I, !1), e.addEventListener('dragover', I, !1)
  14381. })(e),
  14382. O.valueFromHash('title', !0) ||
  14383. $(document).ready(function () {
  14384. $('.model-title').hide()
  14385. })
  14386. })(r),
  14387. (function (e) {
  14388. return G.loadFeatureFlags(e).done(function (e) {
  14389. G.updateDependentSettings(e, L)
  14390. })
  14391. })({
  14392. urlBase: t.urlBase
  14393. })
  14394. .then(function () {
  14395. return (
  14396. Z.init(),
  14397. (function (e, t) {
  14398. var i = P.getModel({
  14399. url: t,
  14400. floors: O.valueFromHash('f', !0),
  14401. autoload: !1
  14402. })
  14403. return $.when(i, y).then(null, function (e) {
  14404. return this
  14405. })
  14406. })(0, e)
  14407. )
  14408. })
  14409. .then(function (e) {
  14410. return (
  14411. re(0.9),
  14412. (function (e, t, i, n, r) {
  14413. ne.info('Model data loaded'),
  14414. ne.debug('UUID: ' + e.data.job.uuid),
  14415. W.init(G.getFlags()),
  14416. i &&
  14417. N.initKeen({
  14418. token: i,
  14419. appId: n
  14420. }),
  14421. N.initSegment({
  14422. model: e.sid,
  14423. version: '2.25.6-0-gd87e5b1',
  14424. startSource: r.startSource,
  14425. token: t,
  14426. autoplay: r.autoplay,
  14427. quickstart: r.quickstart
  14428. })
  14429. })((g = e), L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  14430. startSource: i,
  14431. autoplay: L.autoplay,
  14432. quickstart: o
  14433. }),
  14434. g.urls.init()
  14435. )
  14436. })
  14437. .then(function () {
  14438. return g.loadPanos()
  14439. })
  14440. .then(function () {
  14441. s = U.getStartCameraOptions(g, g.panos)
  14442. //初始画面
  14443. window.DATA.camera_start &&
  14444. window.DATA.camera_start.thumbImg &&
  14445. (function (e) {
  14446. $('<img/>')
  14447. .attr('src', e)
  14448. .on('load', function () {
  14449. $('#gui-thumb')
  14450. .css('backgroundImage', 'url(' + e + ')')
  14451. .fadeIn(500),
  14452. $(this).remove()
  14453. $('.screen .shotImg.innerBtn')
  14454. .removeClass('blank')
  14455. .css('background-image', 'url(' + e + ')')
  14456. })
  14457. })(window.DATA.camera_start.thumbImg)
  14458. {
  14459. //初始化导览时间
  14460. if (DATA.tourBlackSpeed == void 0) DATA.tourBlackSpeed = 100
  14461. window._settings.warp.teleportTime = (settings.teleportTime / DATA.tourBlackSpeed) * 100
  14462. if (DATA.tourWalkSpeed == void 0) DATA.tourWalkSpeed = 100
  14463. /* if(DATA.tourWalkSpeed!=void 0){
  14464. let r = 100 / DATA.tourWalkSpeed;
  14465. window._settings.warp.flytimeDistanceMultiplier = settings.flytimeDistanceMultiplier * r
  14466. window._settings.warp.flyTime = settings.flyTime * r
  14467. }else{
  14468. window._settings.warp.flyTime = settings.flyTime
  14469. } */
  14470. if (DATA.tourRotTime == '' || DATA.tourRotTime == void 0) {
  14471. DATA.tourRotTime = settings.tourRotTime //默认停留2秒
  14472. }
  14473. }
  14474. {
  14475. //其他
  14476. _settings.floorPlanAngle = DATA.floorPlanAngle || 0
  14477. _settings.angleShift2d = DATA.angleShift2d || 0
  14478. if (DATA.insideLookLimit) {
  14479. _settings.insideLookLimitDown = DATA.insideLookLimit[0]
  14480. _settings.insideLookLimitUp = DATA.insideLookLimit[1]
  14481. }
  14482. }
  14483. ;(d = (function (e) {
  14484. var t = new E.PerspectiveCamera()
  14485. t.layers.enable(te.PANOMARKERS), t.layers.enable(te.RETICULE), t.layers.enable(te.TAG)
  14486. var o = new E.Scene(),
  14487. i = new E.AmbientLight(16777215)
  14488. return (
  14489. o.add(i),
  14490. (o.skybox = new V()),
  14491. o.add(o.skybox),
  14492. (o.plane = new E.Mesh(
  14493. new E.PlaneBufferGeometry(1e5, 1e5),
  14494. new E.RawShaderMaterial({
  14495. side: E.DoubleSide
  14496. })
  14497. )),
  14498. (o.plane.position.y = 0),
  14499. o.plane.rotateX(-Math.PI / 2),
  14500. (o.plane.material.visible = !1),
  14501. o.add(o.plane),
  14502. o.updateMatrixWorld(),
  14503. L.showScreenshotLocations &&
  14504. e.data.images.forEach(function (e) {
  14505. if (e.metadata && e.metadata.camera_position) {
  14506. var t = e.metadata.camera_position,
  14507. i = new E.Mesh(new E.BoxGeometry(0.3, 0.3, 0.3))
  14508. ;(i.position = t.clone()), o.add(i)
  14509. var n = e.metadata.camera_quaternion,
  14510. r = new E.Vector3(0, 0, -1).applyQuaternion(n)
  14511. o.add(new E.ArrowHelper(r, t.clone(), 1, 16711680))
  14512. }
  14513. }),
  14514. L.showAxis &&
  14515. (o.add(new E.ArrowHelper(new E.Vector3(0, 1, 0), new E.Vector3(0, 0, 0), 1, 255)),
  14516. o.add(new E.ArrowHelper(new E.Vector3(0, 0, 1), new E.Vector3(0, 0, 0), 1, 16711680)),
  14517. o.add(new E.ArrowHelper(new E.Vector3(1, 0, 0), new E.Vector3(0, 0, 0), 1, 65280))),
  14518. new Y(o, t, B)
  14519. )
  14520. })(g)),
  14521. (m = (function (e, t) {
  14522. var i = e ? 1 : 1e3,
  14523. n = W.tilegen || W.imgopt ? 6 : 2
  14524. n = O.valueFromHash('tileconc', n)
  14525. var r = new X(),
  14526. o = new Q({
  14527. concurrentDownloads: n
  14528. }),
  14529. a = new J(),
  14530. s = new x(),
  14531. l = new w(),
  14532. c = new b(t),
  14533. h = new T(),
  14534. u = new S(i),
  14535. d = new M(),
  14536. p = new K()
  14537. return {
  14538. qualityManager: r,
  14539. panoRenderer: a,
  14540. tileDownloader: o,
  14541. player: c,
  14542. director: l,
  14543. modelManager: s,
  14544. tagManager: p,
  14545. displayController: u,
  14546. labelDisplayController: d,
  14547. controls: h
  14548. }
  14549. })(o, s.mode)),
  14550. (l = m.controls),
  14551. (c = m.player),
  14552. (h = m.director),
  14553. (u = m.tagManager),
  14554. (p = m.tileDownloader),
  14555. (f = m.qualityManager),
  14556. m.panoRenderer,
  14557. (function (e, t, i, n) {
  14558. var r = i.controls,
  14559. o = i.qualityManager,
  14560. a = i.panoRenderer,
  14561. s = i.tileDownloader,
  14562. l = i.modelManager
  14563. 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)
  14564. })(g, d, m, r),
  14565. (c.director = h),
  14566. g.supportsTiles && p.start(),
  14567. !o || (s.mode === R.PANORAMA && s.pano) || (ne.warn('Tried to quickstart, but failed as we are not starting in inside mode.'), (o = !1))
  14568. var e = null
  14569. if (o) {
  14570. ne.warn('Quickstart engaged. Hold on to your knickers.')
  14571. var t = l.controls[R.PANORAMA]
  14572. ;(a = new q(f, d.scene, d.camera, t, r)),
  14573. C(d, r, g),
  14574. (e = a.load(s).then(function () {
  14575. d.addComponent(a),
  14576. d.once(ee.AfterRender, function () {
  14577. ne.warn('First render after quickstart load finished.')
  14578. })
  14579. }))
  14580. }
  14581. return (
  14582. (window.flyToFirst = function () {
  14583. var e = c.model.panos.get('8d778e19657f433fb9cf8947d823bb70'),
  14584. t = new _.Quaternion(0.7099827027821568, -0.07708150183830938, 0.6958985789714591, 0.07555241737970636),
  14585. i = new _.Vector3(0, 0, -1).applyQuaternion(t).add(e.position)
  14586. c.flyToPano({
  14587. pano: e,
  14588. lookAtPoint: i
  14589. })
  14590. }),
  14591. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14592. )
  14593. })
  14594. .then(function () {
  14595. return (function (e, t, i, n, r) {
  14596. return (
  14597. (r.progressCallback = t),
  14598. N.sessionStart(),
  14599. e.load(n).progress(
  14600. function (e, t) {
  14601. ;(e.modelElementsToLoad = t[1]),
  14602. (function (e) {
  14603. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14604. })(e),
  14605. (function (e) {
  14606. e.totalElementsLoaded++,
  14607. (e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad),
  14608. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14609. (e.totalPercentageLoaded = 0.4 + 0.6 * e.totalPercentageLoaded),
  14610. console.log('pro:' + e.totalPercentageLoaded),
  14611. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14612. })(e)
  14613. }.bind(this, r)
  14614. )
  14615. )
  14616. })(g, D.onProgress, 0, !o, n)
  14617. })
  14618. .then(function () {
  14619. ;(s.quickstart = o),
  14620. (function (e, t, i, n) {
  14621. var r = i.qualityManager,
  14622. o = i.panoRenderer,
  14623. a = i.tileDownloader,
  14624. s = i.modelManager,
  14625. l = i.player,
  14626. c = i.director,
  14627. h = i.tagManager,
  14628. u = i.displayController,
  14629. d = i.labelDisplayController,
  14630. p = i.controls
  14631. t.scene.add(e), (t.qualityManager = r)
  14632. var f = {
  14633. camera: t.camera,
  14634. director: c,
  14635. modelManager: s,
  14636. tileDownloader: a,
  14637. panoRenderer: o,
  14638. qualityManager: r,
  14639. tagManager: h,
  14640. container: n,
  14641. controls: p
  14642. }
  14643. l.init(f),
  14644. l.setScene(t.scene),
  14645. h.init(s, l),
  14646. c.init(l, s),
  14647. u.init(c, l, s, h, n),
  14648. d.init(l, s, n),
  14649. B.bindEvents(l),
  14650. t.addComponent(h),
  14651. t.addComponent(l),
  14652. t.addComponent(o),
  14653. (l.sceneRenderer = t)
  14654. })(g, d, m, r),
  14655. d.started || C(d, r, g),
  14656. N.modelLoaded(g, c, l, L.autoplay),
  14657. (function (e, t, i, n) {
  14658. return ne.info('Starting player in ' + i.mode), N.report(t.sid, 'started-playing', n, i.quickstart), e.start(i)
  14659. })(c, g, s, L.autoplay).done(function () {
  14660. h.autoTour()
  14661. }),
  14662. g.supportsTiles || new H(g, c).start()
  14663. o && (d.removeComponent(a), a.destroy(), s.pano.enter()),
  14664. D.init(g, h, c, l, d, s, N.getSessionId()),
  14665. D.endLoading(g, h, u),
  14666. d.once(ee.AfterRender, function () {
  14667. v.setAppReadyTime()
  14668. var e = v.calcFullLoadingTime()
  14669. ne.warn('Total load time: ' + e / 1e3), N.loadComplete(e), ne.warn('First render after model load finished.')
  14670. editTool.loadDone('data', window.DATA)
  14671. }),
  14672. d.on(ee.MemoryUsageUpdated, y)
  14673. })
  14674. .fail(A.bind(this, e))
  14675. })()
  14676. })()
  14677. })
  14678. .fail(e => {
  14679. alert('缺少someData文件,请检查场景码是否正确。')
  14680. })
  14681. }).call(this, '/js/main.js')
  14682. },
  14683. {
  14684. './DisplayController': 1,
  14685. './TimingData': 2,
  14686. './ab': 3,
  14687. './analytics': 4,
  14688. './cameras/PanoramaCamera': 7,
  14689. './controls/CameraControls': 9,
  14690. './director': 15,
  14691. './effects': 16,
  14692. './enum/PanoSizeClass': 36,
  14693. './enum/PanoramaEvents': 37,
  14694. './enum/RenderLayers': 41,
  14695. './enum/SceneRendererEvents': 43,
  14696. './enum/Viewmode': 51,
  14697. './featureflags': 59,
  14698. './gui/error': 64,
  14699. './gui/gui': 65,
  14700. './gui/memoryUsage': 73,
  14701. './label/LabelDisplayController': 91,
  14702. './lib/array-polyfill': 92,
  14703. './lib/performance-polyfill': 95,
  14704. './lib/postprocessing/EffectComposer.js': 96,
  14705. './lib/postprocessing/MaskPass.js': 97,
  14706. './lib/postprocessing/RenderPass.js': 98,
  14707. './lib/postprocessing/ShaderPass.js': 99,
  14708. './lib/shaders/CopyShader.js': 100,
  14709. './lib/shaders/HorizontalBlurShader.js': 101,
  14710. './lib/shaders/VerticalBlurShader.js': 102,
  14711. './lib/three75-shim': 103,
  14712. './localization/localize': 108,
  14713. './tag/tagManager': 124,
  14714. './model/ModelManager': 140,
  14715. './objects/Panorama': 148,
  14716. './objects/Skybox': 152,
  14717. './player': 155,
  14718. './preloaders': 156,
  14719. './scene/QuickstartManager': 157,
  14720. './scene/SceneRenderer': 158,
  14721. './sdk/automation.js': 164,
  14722. './settings': 166,
  14723. './showcase': 168,
  14724. './tile/PanoRenderer': 169,
  14725. './tile/QualityManager.js': 170,
  14726. './tile/TileDownloader': 171,
  14727. './util/PanoramaCollection': 178,
  14728. './util/ajax': 181,
  14729. './util/browser': 182,
  14730. './util/camera': 183,
  14731. './util/common': 185,
  14732. './util/lerp': 188,
  14733. './util/logger': 189,
  14734. './util/math': 190,
  14735. './util/sentry': 192,
  14736. './util/showcase': 193,
  14737. './util/transitions': 195,
  14738. events: 202,
  14739. 'promise-polyfill': 213,
  14740. three: 217
  14741. }
  14742. ],
  14743. 117: [
  14744. function (e, t, i) {
  14745. 'use strict'
  14746. function n(e) {
  14747. ;(e = e || {}),
  14748. r.RawShaderMaterial.call(
  14749. this,
  14750. a.extendObject(
  14751. {
  14752. fragmentShader: o.cube.fragmentShader,
  14753. vertexShader: o.cube.vertexShader,
  14754. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14755. name: 'CubemapMaterial'
  14756. },
  14757. e
  14758. )
  14759. )
  14760. }
  14761. var r = e('three'),
  14762. o = e('../shaders'),
  14763. a = e('../util/common')
  14764. ;((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n), (t.exports = n)
  14765. },
  14766. {
  14767. '../shaders': 167,
  14768. '../util/common': 185,
  14769. three: 217
  14770. }
  14771. ],
  14772. 118: [
  14773. function (e, t, i) {
  14774. 'use strict'
  14775. function n(e) {
  14776. ;(e = e || {}),
  14777. r.RawShaderMaterial.call(
  14778. this,
  14779. a.extendObject(
  14780. {
  14781. fragmentShader: o.model.fragmentShader,
  14782. vertexShader: o.model.vertexShader,
  14783. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14784. name: 'ModelTextureMaterial'
  14785. },
  14786. e
  14787. )
  14788. )
  14789. }
  14790. var r = e('three'),
  14791. o = e('../shaders'),
  14792. a = e('../util/common')
  14793. ;(((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function (e, t, i) {
  14794. i && (this.uniforms.progress.value = 0),
  14795. e.ensureSkyboxReadyForRender(),
  14796. (this.uniforms.pano0Map.value = e.getSkyboxTexture()),
  14797. this.uniforms.pano0Position.value.copy(e.position),
  14798. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14799. t.ensureSkyboxReadyForRender(),
  14800. (this.uniforms.pano1Map.value = t.getSkyboxTexture()),
  14801. this.uniforms.pano1Position.value.copy(t.position),
  14802. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14803. }),
  14804. (t.exports = n)
  14805. },
  14806. {
  14807. '../shaders': 167,
  14808. '../util/common': 185,
  14809. three: 217
  14810. }
  14811. ],
  14812. 119: [
  14813. function (m, v, e) {
  14814. ;(function (e) {
  14815. 'use strict'
  14816. function t(e, t, i, n) {
  14817. ;(this.div = null),
  14818. (this.body = null),
  14819. (this.label = e),
  14820. (this.description = t),
  14821. (this.parsedDescription = []),
  14822. (this.media = i || {
  14823. type: null
  14824. }),
  14825. (this.loadingSpinner = null),
  14826. (this.parser = new r({
  14827. supportLinks: !c.valueFromHash('mls'),
  14828. keepLinkLabels: !0
  14829. })),
  14830. (this.state = g.CLOSED),
  14831. (this.orientation = ''),
  14832. (this.initialTransform = ''),
  14833. (this.hovering = !1),
  14834. (this.openTransition = null),
  14835. (this.closeTransition = null),
  14836. (this.openPromise = null),
  14837. (this.closePromise = null),
  14838. (this.animationTransition = null),
  14839. (this.animationScale = 0)
  14840. }
  14841. var r = m('../Parser/DescriptionParser'),
  14842. i = m('../Media/Link'),
  14843. n = m('../Media/Image'),
  14844. o = m('../Media/EmbedlyPlayer'),
  14845. a = m('../Media/EmbedlyEmbed'),
  14846. s = m('../../util/transitions'),
  14847. l = m('../../util/lerp'),
  14848. c = m('../../util/browser'),
  14849. b = m('./BillboardEvent'),
  14850. w = m('../Media/MediaEvent'),
  14851. h = m('../Parser/DescriptionChunkType'),
  14852. u = m('events').EventEmitter,
  14853. d = m('./billboardSettings'),
  14854. T = m('./overlaySettings'),
  14855. p = new (m('../../util/logger'))(e),
  14856. f = document.getElementById('tag-billboards')
  14857. f.addEventListener('touchend', function (e) {
  14858. f.style.pointerEvents = 'none'
  14859. }),
  14860. f.addEventListener('touchcancel', function (e) {
  14861. f.style.pointerEvents = 'none'
  14862. })
  14863. var g = {
  14864. CLOSED: 'closed',
  14865. OPENING: 'opening',
  14866. OPEN: 'open',
  14867. CLOSING: 'closing',
  14868. ACTIVE: 'active'
  14869. }
  14870. ;((t.prototype = Object.create(u.prototype)).build = function (e) {
  14871. this.parsedDescription = this.parser.parse(this.description)
  14872. var t = document.createElement('div')
  14873. ;(t.className = 'tag-container has-hotzone'), (this.div = t), (this.body = document.createElement('div')), (this.body.className = 'tag-body')
  14874. var i = document.createElement('div')
  14875. i.classList.add('tag-content')
  14876. var n = document.createElement('div')
  14877. n.classList.add('tag-text-content')
  14878. var r = document.createElement('div')
  14879. ;(r.className = 'tag-label'), (r.textContent = this.label), n.appendChild(r)
  14880. var o = document.createElement('div')
  14881. ;(o.className = 'tag-desc'),
  14882. n.appendChild(o),
  14883. i.appendChild(n),
  14884. this.body.appendChild(i),
  14885. this.appendDescriptionElements(this.parsedDescription, o),
  14886. this.appendMedia(),
  14887. t.appendChild(this.body),
  14888. f.appendChild(t),
  14889. this.bindEvents(t, this.body)
  14890. }),
  14891. (t.prototype.bindEvents = function (i, e) {
  14892. function t(n) {
  14893. return function (e) {
  14894. if (!this.div.classList.contains('overlay')) {
  14895. var t,
  14896. i = document.getElementById('player')
  14897. try {
  14898. t = new MouseEvent(n, e)
  14899. } catch (i) {
  14900. ;(t = document.createEvent('MouseEvents')).initMouseEvent(
  14901. n,
  14902. e.bubbles,
  14903. e.cancelable,
  14904. e.view,
  14905. e.detail,
  14906. e.screenX,
  14907. e.screenY,
  14908. e.clientX,
  14909. e.clientY,
  14910. e.ctrlKey,
  14911. e.altKey,
  14912. e.shiftKey,
  14913. e.metaKey,
  14914. e.button,
  14915. e.relatedTarget
  14916. )
  14917. }
  14918. i.dispatchEvent(t)
  14919. }
  14920. }
  14921. }
  14922. e.addEventListener('mousedown', function (e) {
  14923. e.stopPropagation()
  14924. }),
  14925. e.addEventListener('mouseup', function (e) {
  14926. e.stopPropagation()
  14927. }),
  14928. i.addEventListener('touchstart', function (e) {
  14929. f.style.pointerEvents = 'auto'
  14930. }),
  14931. i.addEventListener('mousedown', t('mousedown').bind(this)),
  14932. i.addEventListener('mouseup', t('mouseup').bind(this)),
  14933. e.addEventListener(
  14934. 'mouseover',
  14935. function (e) {
  14936. this.state === g.OPEN && i.classList.remove('has-hotzone')
  14937. }.bind(this)
  14938. ),
  14939. i.addEventListener(
  14940. 'mouseenter',
  14941. function (e) {
  14942. this.state !== g.CLOSING && ((this.hovering = !0), this.emit(b.ENTER))
  14943. }.bind(this)
  14944. ),
  14945. i.addEventListener(
  14946. 'mouseleave',
  14947. function (e) {
  14948. ;(this.hovering = !1), this.emit(b.LEAVE)
  14949. }.bind(this)
  14950. ),
  14951. i.addEventListener('gesturestart', function (e) {
  14952. e.preventDefault()
  14953. })
  14954. var n = i.querySelector('.tag-text-content'),
  14955. r = 0
  14956. n.addEventListener('touchstart', function (e) {
  14957. r = e.changedTouches[0].clientY
  14958. }),
  14959. n.addEventListener('touchmove', function (t) {
  14960. function e(e) {
  14961. e && ((0 === e.scrollTop && t.changedTouches[0].clientY > r) || (e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r)) && t.preventDefault()
  14962. }
  14963. return i.classList.contains('overlay') ? e(this.querySelector('.tag-desc')) : void e(this)
  14964. }),
  14965. i.addEventListener('touchmove', function (e) {
  14966. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14967. })
  14968. }),
  14969. (t.prototype.appendDescriptionElements = function (e, i) {
  14970. 0 < e.length && this.div.classList.add('has-text'),
  14971. e.forEach(
  14972. function (e, t) {
  14973. switch (e.type) {
  14974. case h.TEXT:
  14975. i.appendChild(this.createTextElement(e.text))
  14976. break
  14977. case h.LINK:
  14978. i.appendChild(this.createLinkElement(e.link))
  14979. }
  14980. }.bind(this)
  14981. )
  14982. }),
  14983. (t.prototype.appendLoadingSpinner = function () {
  14984. ;(this.loadingSpinner = document.createElement('div')), this.loadingSpinner.classList.add('loading-spinner')
  14985. var e = document.createElement('div')
  14986. e.classList.add('gui-spinner-icon'), this.loadingSpinner.appendChild(e), this.body.appendChild(this.loadingSpinner)
  14987. }),
  14988. (t.prototype.onMediaLoadFinished = function () {
  14989. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner), this.applyOrientation(this.orientation), (this.loadingSpinner = null))
  14990. }),
  14991. (t.prototype.appendMedia = function () {
  14992. if (this.media && this.media.type && 'error' !== this.media.type && (!c.valueFromHash('mls', 0) || this.media.type === h.IMAGE)) {
  14993. this.appendLoadingSpinner()
  14994. var e = document.createElement('div')
  14995. e.classList.add('tag-media-content')
  14996. var t = document.createElement('i')
  14997. switch (
  14998. (['icon', 'icon-close-thin', 'close'].forEach(function (e) {
  14999. t.classList.add(e)
  15000. }),
  15001. this.body.appendChild(t),
  15002. this.body.appendChild(e),
  15003. this.media.type)
  15004. ) {
  15005. case h.IMAGE:
  15006. e.appendChild(this.createImageElement(this.media, this.body))
  15007. break
  15008. case h.VIDEO:
  15009. e.appendChild(this.createVideoElement(this.media, this.body))
  15010. break
  15011. case h.RICH:
  15012. e.appendChild(this.createEmbedElement(this.media, this.body))
  15013. }
  15014. }
  15015. }),
  15016. (t.prototype.createTextElement = function (e) {
  15017. var t = document.createElement('span')
  15018. return (t.textContent = e), t
  15019. }),
  15020. (t.prototype.createLinkElement = function (e) {
  15021. var t = new i(e)
  15022. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)), t.createDomElement()
  15023. }),
  15024. (t.prototype.createImageElement = function (t, C) {
  15025. function e() {
  15026. function e() {
  15027. p ||
  15028. (E.classList.remove('view-image'),
  15029. a.classList.add('overlay'),
  15030. t(),
  15031. window.addEventListener('resize', A),
  15032. a.addEventListener('click', i),
  15033. c.addEventListener('click', r),
  15034. o.addEventListener('click', n),
  15035. (p = !0),
  15036. _.emit(w.IMAGE_OPENED))
  15037. }
  15038. function t() {
  15039. C.classList.add('show-info'), s.classList.remove('collapsible'), (s.style.height = '')
  15040. var e = parseFloat(getComputedStyle(v).lineHeight),
  15041. t = g + e,
  15042. i = a.clientWidth - 2 * T.boundaryWidth - m,
  15043. n = a.clientHeight - 2 * T.boundaryHeight - m - t,
  15044. r = n,
  15045. o = r * I.aspect
  15046. i < o && (r = (o = i) / I.aspect),
  15047. n < r && (o = (r = n) * I.aspect),
  15048. (o += m),
  15049. (r += m + t),
  15050. (C.style.width = o + 'px'),
  15051. (C.style.height = r + 'px'),
  15052. (l.style.paddingTop = e + m + 'px'),
  15053. 0 < _.description.length && (s.classList.add('collapsible'), (s.style.height = s.clientHeight + 12 + 'px'), (y.style.height = 'calc(100% - ' + v.clientHeight + 'px)'))
  15054. }
  15055. function i(e) {
  15056. e.target === a && n()
  15057. }
  15058. function n() {
  15059. p &&
  15060. ((p = !1),
  15061. E.classList.add('view-image'),
  15062. a.classList.remove('overlay'),
  15063. (s.style.height = ''),
  15064. (l.style.paddingTop = ''),
  15065. (C.style.width = ''),
  15066. (C.style.height = ''),
  15067. window.removeEventListener('resize', A),
  15068. a.removeEventListener('click', i),
  15069. c.removeEventListener('click', r),
  15070. o.removeEventListener('click', n),
  15071. _.emit(w.IMAGE_CLOSED),
  15072. _.close(!0))
  15073. }
  15074. function r(e) {
  15075. C.classList.toggle('show-info')
  15076. }
  15077. var a = _.div,
  15078. s = a.getElementsByClassName('tag-content')[0],
  15079. l = a.getElementsByClassName('tag-media-content')[0],
  15080. o = C.getElementsByClassName('close')[0],
  15081. c = s.getElementsByClassName('tag-label')[0]
  15082. a.classList.add('has-image'), E.classList.add('view-image'), a.classList.add(1 <= I.aspect ? 'image-landscape' : 'image-portrait'), _.applyOrientation(_.orientation)
  15083. var h,
  15084. u,
  15085. d,
  15086. p = !1,
  15087. f = getComputedStyle(s),
  15088. g = parseFloat(f.paddingTop) + parseFloat(f.paddingBottom),
  15089. m = 2 * parseFloat(getComputedStyle(l).paddingLeft),
  15090. v = s.querySelector('.tag-label'),
  15091. y = s.querySelector('.tag-desc'),
  15092. A =
  15093. ((d = 0),
  15094. function () {
  15095. clearInterval(h),
  15096. clearTimeout(u),
  15097. (h = setInterval(function () {
  15098. var e = a.clientHeight
  15099. d !== e && (t(), (d = e))
  15100. }, 100)),
  15101. (u = setTimeout(clearInterval.bind(this, h), 1e3))
  15102. })
  15103. I.on(w.IMAGE_OPENING, e), _.on(b.ACTIVATE, e), _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)), _.on(b.CLOSING, n)
  15104. }
  15105. var I = new n(),
  15106. E = I.createDomElement()
  15107. this.once(b.OPENED, function () {
  15108. I.load(t.src)
  15109. .then(e)
  15110. .catch(function (e) {
  15111. p.warn('Failed to load image:', t.src), p.warn('with error:', e)
  15112. })
  15113. .then(this.onMediaLoadFinished.bind(this))
  15114. })
  15115. var _ = this
  15116. return E
  15117. }),
  15118. (t.prototype.createVideoElement = function (t, e) {
  15119. var i = new o({
  15120. autoPlay: !0,
  15121. autoResume: !0,
  15122. startMuted: !1,
  15123. loop: !1
  15124. }),
  15125. n = i.createDomElement()
  15126. return (
  15127. this.once(
  15128. b.OPENED,
  15129. function () {
  15130. i.load(t.src)
  15131. .then(
  15132. function () {
  15133. this.div.classList.add('has-video'),
  15134. (this.state !== g.OPEN && this.state !== g.ACTIVE) || (i.show(), i.play()),
  15135. this.on(b.OPENING, i.show.bind(i)),
  15136. this.on(b.OPENED, i.play.bind(i)),
  15137. this.on(b.CLOSING, i.pause.bind(i)),
  15138. this.on(b.CLOSED, i.hide.bind(i))
  15139. }.bind(this)
  15140. )
  15141. .catch(function (e) {
  15142. p.warn('Failed to embed video:', t.src), p.warn('with error:', e)
  15143. })
  15144. .then(this.onMediaLoadFinished.bind(this))
  15145. }.bind(this)
  15146. ),
  15147. n
  15148. )
  15149. }),
  15150. (t.prototype.createEmbedElement = function (t, e) {
  15151. var i = new a(),
  15152. n = i.createDomElement()
  15153. return (
  15154. this.once(
  15155. b.OPENED,
  15156. function () {
  15157. i.load(t.src)
  15158. .then(
  15159. function () {
  15160. this.div.classList.add('has-embed'),
  15161. (this.state !== g.OPEN && this.state !== g.ACTIVE) || i.show(),
  15162. this.applyOrientation(this.orientation),
  15163. this.on(b.OPENING, i.show.bind(i)),
  15164. this.on(b.CLOSED, i.hide.bind(i))
  15165. }.bind(this)
  15166. )
  15167. .catch(function (e) {
  15168. p.warn('Failed to embed:', t.src), p.warn('with error:', e)
  15169. })
  15170. .then(this.onMediaLoadFinished.bind(this))
  15171. }.bind(this)
  15172. ),
  15173. n
  15174. )
  15175. }),
  15176. (t.prototype.open = function (e) {
  15177. return (
  15178. (this.openPromise = $.Deferred()),
  15179. this.state === g.ACTIVE
  15180. ? this.openPromise.resolve().promise()
  15181. : (this.hovering || this.div.classList.add('has-hotzone'),
  15182. this.openTransition
  15183. ? e && this.setActiveState()
  15184. : (this.openTransition = s.setTimeout(
  15185. function () {
  15186. this.state !== g.OPEN &&
  15187. (this.emit(b.OPENING),
  15188. e && this.emit(b.ACTIVATING),
  15189. (this.state = g.OPENING),
  15190. this.animateOpen(
  15191. function () {
  15192. e && this.setActiveState(), this.openPromise.resolve()
  15193. }.bind(this)
  15194. ))
  15195. }.bind(this),
  15196. d.animation.openDelay
  15197. )),
  15198. s.cancel(this.closeTransition),
  15199. this.closePromise && this.closePromise.reject(),
  15200. (this.closeTransition = void 0),
  15201. this.openPromise.promise())
  15202. )
  15203. }),
  15204. (t.prototype.close = function (e) {
  15205. return (
  15206. (this.closePromise = $.Deferred()),
  15207. !e && this.hovering
  15208. ? this.closePromise.reject().promise()
  15209. : (this.closeTransition ||
  15210. (this.closeTransition = s.setTimeout(
  15211. function () {
  15212. this.state !== g.CLOSED && (this.emit(b.CLOSING), (this.state = g.CLOSING), this.animateClose())
  15213. }.bind(this),
  15214. d.animation.closeDelay
  15215. )),
  15216. s.cancel(this.openTransition),
  15217. this.openPromise && this.openPromise.reject(),
  15218. (this.openTransition = void 0),
  15219. this.closePromise.resolve(),
  15220. this.closePromise.promise())
  15221. )
  15222. }),
  15223. (t.prototype.setActiveState = function () {
  15224. this.state !== g.CLOSED && ((this.state = g.ACTIVE), this.emit(b.ACTIVATE), this.div.classList.remove('has-hotzone'))
  15225. }),
  15226. (t.prototype.animateOpen = function (e) {
  15227. if (this.state === g.OPENING) {
  15228. if ((s.cancel(this.animationTransition), c.detectSamsungNative()))
  15229. return (this.boardOrientation = null), (this.div.style.visibility = 'visible'), this.emit(b.OPENED), (this.state = g.OPEN), void (e && e())
  15230. ;(this.div.style.webkitTransform = 'scale(0)'),
  15231. (this.div.style.transform = 'scale(0)'),
  15232. (this.div.style.visibility = 'visible'),
  15233. (this.animationTransition = s.start(
  15234. l.property(this, 'animationScale', 1),
  15235. d.animation.openDuration,
  15236. function () {
  15237. this.emit(b.OPENED), (this.state = g.OPEN), e && e()
  15238. }.bind(this)
  15239. ))
  15240. }
  15241. }),
  15242. (t.prototype.animateClose = function (e) {
  15243. this.state === g.CLOSING &&
  15244. (s.cancel(this.animationTransition),
  15245. (this.animationTransition = s.start(
  15246. l.property(this, 'animationScale', 0),
  15247. d.animation.closeDuration,
  15248. function () {
  15249. this.emit(b.CLOSED),
  15250. (this.state = g.CLOSED),
  15251. (this.div.style.visibility = 'hidden'),
  15252. this.div.classList.contains('has-hotzone') || this.div.classList.add('has-hotzone'),
  15253. e && e()
  15254. }.bind(this)
  15255. )))
  15256. }),
  15257. (t.prototype.needsUpdate = function () {
  15258. return this.state !== g.CLOSED
  15259. }),
  15260. (t.prototype.update = function (e, t) {
  15261. if (this.needsUpdate()) {
  15262. var i = (this.updateOrientation(e), this.calcScale(t)),
  15263. n = {
  15264. x: ((e.x + 1) * $('#player').width()) / 2,
  15265. y: ((e.y + 1) * $('#player').height()) / 2
  15266. }
  15267. ;(this.div.screenTransform = this.initialTransform + ' translate(' + n.x + 'px, ' + n.y + 'px) scale(' + i * this.animationScale + ')'),
  15268. (this.div.style.webkitTransform = this.div.screenTransform),
  15269. (this.div.style.transform = this.div.screenTransform)
  15270. }
  15271. }),
  15272. (t.prototype.getDimensions = function () {
  15273. return this.div.getBoundingClientRect()
  15274. }),
  15275. (t.prototype.calcScale = function (e) {
  15276. return Math.sqrt(e / 40) * d.boardToDiscRatio
  15277. }),
  15278. (t.prototype.updateOrientation = function (e) {
  15279. if (this.state !== g.ACTIVE) {
  15280. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2,
  15281. i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2,
  15282. n = ''
  15283. ;(n += 0 == i ? 'right' : 2 == i ? 'left' : ''),
  15284. (n += 0 == t ? '-down' : 2 == t ? '-up' : ''),
  15285. 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')),
  15286. (1 == i && 1 == t && n === this.orientation) || this.applyOrientation(n)
  15287. }
  15288. }),
  15289. (t.prototype.applyOrientation = function (e) {
  15290. ;(this.div.style.transform = this.div.style.webkitTransform = ''), this.div.classList.remove('tag-container-' + this.orientation), this.div.classList.add('tag-container-' + e)
  15291. var t = window.getComputedStyle(this.div)
  15292. ;(this.initialTransform = t.transform || t.webkitTransform), 'none' === this.initialTransform && (this.initialTransform = '')
  15293. var i = t.transform.slice(7, -1).split(','),
  15294. n = -i[4],
  15295. r = -i[5]
  15296. ;(this.div.style.webkitTransformOrigin = n + 'px ' + r + 'px'), (this.div.style.transformOrigin = n + 'px ' + r + 'px'), (this.orientation = e)
  15297. }),
  15298. (v.exports = t)
  15299. }).call(this, '/js/tag/Billboard/Billboard.js')
  15300. },
  15301. {
  15302. '../../util/browser': 182,
  15303. '../../util/lerp': 188,
  15304. '../../util/logger': 189,
  15305. '../../util/transitions': 195,
  15306. '../Media/EmbedlyEmbed': 125,
  15307. '../Media/EmbedlyPlayer': 126,
  15308. '../Media/Image': 128,
  15309. '../Media/Link': 129,
  15310. '../Media/MediaEvent': 131,
  15311. '../Parser/DescriptionChunkType': 133,
  15312. '../Parser/DescriptionParser': 134,
  15313. './BillboardEvent': 120,
  15314. './billboardSettings': 121,
  15315. './overlaySettings': 122,
  15316. events: 202
  15317. }
  15318. ],
  15319. 120: [
  15320. function (e, t, i) {
  15321. 'use strict'
  15322. t.exports = Object.freeze({
  15323. ENTER: 'billboard.enter',
  15324. LEAVE: 'billboard.leave',
  15325. OPENING: 'billboard.opening',
  15326. OPENED: 'billboard.open',
  15327. CLOSING: 'billboard.closing',
  15328. CLOSED: 'billboard.closed',
  15329. ACTIVATING: 'billboard.activating',
  15330. ACTIVATE: 'billboard.activate'
  15331. })
  15332. },
  15333. {}
  15334. ],
  15335. 121: [
  15336. function (e, t, i) {
  15337. 'use strict'
  15338. t.exports = Object.freeze({
  15339. animation: Object.freeze({
  15340. hoverOnClosing: !1,
  15341. openDelay: 100,
  15342. closeDelay: 50,
  15343. openDuration: 200,
  15344. closeDuration: 100
  15345. }),
  15346. boardToDiscRatio: 1.2
  15347. })
  15348. },
  15349. {}
  15350. ],
  15351. 122: [
  15352. function (e, t, i) {
  15353. 'use strict'
  15354. t.exports = Object.freeze({
  15355. boundaryWidth: 30,
  15356. boundaryHeight: 0
  15357. })
  15358. },
  15359. {}
  15360. ],
  15361. 123: [
  15362. function (M, R, e) {
  15363. ;(function (e) {
  15364. 'use strict'
  15365. function d(e, t, i) {
  15366. var n = i.version || '0'
  15367. '0' !== n && w.info('tag defined using version ' + n),
  15368. (this.model = e),
  15369. (this.sid = t),
  15370. (this.color = new f.Color().set(i.color || o.tagDefault)),
  15371. (this.hoverColor = o._darken(this.color, 0.2)),
  15372. (this.floor = null),
  15373. (this.floorIndex = i.floor),
  15374. (this.mode = m.PANORAMA),
  15375. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15376. (this.obj3d = null),
  15377. (this.disc = null),
  15378. (this.materials = {
  15379. disc: null,
  15380. pole: null
  15381. }),
  15382. (this.position = new f.Vector3().copy(i.position)),
  15383. (this.discPosition = new f.Vector3().copy(i.stem.direction)),
  15384. (this.discWorldPosition = null),
  15385. (this.discScale = 0.05),
  15386. (this.poleEnabled = i.stem.enabled),
  15387. (this.billboard = new r(i.label, i.description, i.media, this)),
  15388. (this.visibleTransition = null),
  15389. (this.hoveringDisc = !1)
  15390. }
  15391. var i,
  15392. l,
  15393. c,
  15394. h,
  15395. u,
  15396. p,
  15397. n,
  15398. f = M('three'),
  15399. r = M('./Billboard/Billboard'),
  15400. g = M('../settings'),
  15401. m = M('../enum/Viewmode'),
  15402. o = M('../enum/Colors'),
  15403. a = M('../enum/RenderLayers'),
  15404. s = M('../enum/RenderOrder'),
  15405. v = (M('../util/common'), M('../util/math')),
  15406. t = M('../util/texture'),
  15407. y = M('../objects/Panorama'),
  15408. A = M('../shaders'),
  15409. C = M('../util/transitions'),
  15410. I = M('../util/lerp'),
  15411. E = M('../util/easing'),
  15412. _ = M('./Billboard/BillboardEvent'),
  15413. b = M('events').EventEmitter,
  15414. w = new (M('../util/logger'))(e),
  15415. T = t.loadBase64(
  15416. '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=='
  15417. ),
  15418. x = t.loadBase64(
  15419. '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'
  15420. ),
  15421. S = new f.PlaneBufferGeometry(1, 1)
  15422. ;(d.prototype = Object.create(b.prototype)),
  15423. (d.raycaster = new f.Raycaster()),
  15424. (d.prototype.bindEvents = function () {
  15425. this.billboard.on(_.ENTER, this.setHoverState.bind(this)), this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  15426. }),
  15427. (d.prototype.build = function () {
  15428. return (
  15429. (this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first()),
  15430. this.floor && (this.billboard.build(this.model.sid), (this.obj3d = this.buildObject3D()), this.floor.add(this.obj3d)),
  15431. this
  15432. )
  15433. }),
  15434. (d.prototype.buildObject3D = function () {
  15435. var e = new f.Object3D()
  15436. e.position.copy(this.position)
  15437. var t = f.UniformsUtils.clone(A.tagDisc.uniforms)
  15438. ;(t.bg.value = x),
  15439. (t.mask.value = T),
  15440. t.color.value.copy(this.color),
  15441. (this.materials.disc = new f.RawShaderMaterial({
  15442. transparent: !0,
  15443. vertexShader: A.tagDisc.vertexShader,
  15444. fragmentShader: A.tagDisc.fragmentShader,
  15445. uniforms: t
  15446. })),
  15447. (this.disc = new f.Mesh(S, this.materials.disc)),
  15448. this.disc.layers.set(a.TAG),
  15449. this.disc.position.copy(this.discPosition),
  15450. (this.disc.renderOrder = s.tagDisc)
  15451. var i = (this.disc.tag = this).buildPole()
  15452. return i.layers.set(a.TAG), (i.renderOrder = s.tagStem), e.add(i), e.layers.set(a.TAG), e.add(this.disc)
  15453. }),
  15454. (d.prototype.buildPole = function () {
  15455. var e = new f.BufferGeometry(),
  15456. t = new Float32Array(6)
  15457. return (
  15458. (t[0] = t[1] = t[2] = 0),
  15459. (t[3] = this.discPosition.x),
  15460. (t[4] = this.discPosition.y),
  15461. (t[5] = this.discPosition.z),
  15462. e.addAttribute('position', new f.BufferAttribute(t, 3)),
  15463. (this.materials.pole = new f.LineBasicMaterial({
  15464. linewidth: g.tags.pole.width,
  15465. color: g.tags.pole.color,
  15466. opacity: 0,
  15467. visible: this.poleEnabled,
  15468. transparent: !0,
  15469. depthWrite: !1
  15470. })),
  15471. new f.Line(e, this.materials.pole)
  15472. )
  15473. }),
  15474. (d.prototype.setFreeState = function (e) {
  15475. ;(!e && this.hoveringDisc) ||
  15476. this.billboard.close(e).then(
  15477. function () {
  15478. this.materials.disc.uniforms.color.value = this.color
  15479. }.bind(this)
  15480. )
  15481. }),
  15482. (d.prototype.setHoverState = function (e) {
  15483. this.billboard.open(e), (this.materials.disc.uniforms.color.value = this.hoverColor)
  15484. }),
  15485. (d.prototype.hide = function (e, t) {
  15486. var i = $.Deferred()
  15487. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition)) return i.resolve().promise()
  15488. ;(e = e || 0), (t = t || 0), C.cancel(this.visibleTransition)
  15489. var n,
  15490. r,
  15491. o,
  15492. a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity,
  15493. s = t + e,
  15494. l = t / s
  15495. return (
  15496. (this.visibleTransition = C.start(
  15497. ((n = this),
  15498. (r = I.property(n.materials.disc.uniforms.opacity, 'value', 0)),
  15499. (o = I.property(n.materials.pole, 'opacity', 0)),
  15500. function (e) {
  15501. r(e), n.materials.pole && o(e)
  15502. }),
  15503. s * a,
  15504. function () {
  15505. i.resolve()
  15506. },
  15507. l,
  15508. E[g.warp.blendEasing]
  15509. )),
  15510. i.promise()
  15511. )
  15512. }),
  15513. (d.prototype.show = function (e, t) {
  15514. var i = $.Deferred()
  15515. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition)) return i.resolve().promise()
  15516. ;(e = e || 0), (t = t || 0), C.cancel(this.visibleTransition)
  15517. var n,
  15518. r,
  15519. o,
  15520. a = (g.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / g.tags.disc.opacity,
  15521. s = t + e,
  15522. l = t / s
  15523. return (
  15524. (this.visibleTransition = C.start(
  15525. ((n = this),
  15526. (r = I.property(n.materials.disc.uniforms.opacity, 'value', g.tags.disc.opacity)),
  15527. (o = I.property(n.materials.pole, 'opacity', g.tags.pole.opacity)),
  15528. function (e) {
  15529. r(e), n.materials.pole && o(e)
  15530. }),
  15531. s * a,
  15532. function () {
  15533. i.resolve()
  15534. },
  15535. l,
  15536. E[g.warp.blendEasing]
  15537. )),
  15538. i.promise()
  15539. )
  15540. }),
  15541. (d.prototype.closestPanoTowardTag = function (e, t) {
  15542. var i = [],
  15543. n = [],
  15544. r = this.disc.getWorldPosition()
  15545. if (e === m.PANORAMA) {
  15546. var o = t.position.clone().sub(r).normalize()
  15547. 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))
  15548. }
  15549. var a = new f.Vector3()
  15550. i.push(
  15551. function (e) {
  15552. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15553. },
  15554. function (e) {
  15555. a.copy(r).sub(e.position)
  15556. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z))),
  15557. i = g.tags.navigate.tiltTolerance
  15558. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15559. }
  15560. ),
  15561. n.push(y.scoreFunctions.distanceSquared(this, -2))
  15562. var s = this.model.panos.sortByScore(i, n)
  15563. if (g.tags.navigate.lineOfSight) {
  15564. for (var l = 0; l < s.length; l++) {
  15565. var c = s[l].item,
  15566. h = c.position.distanceTo(r)
  15567. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance) return null
  15568. d.raycaster.set(c.position, r.clone().sub(c.position).normalize())
  15569. var u = d.raycaster.intersectObjects(this.model.colliders)
  15570. if (0 === u.length || u[0].distance > h) return c
  15571. }
  15572. return null
  15573. }
  15574. return 0 < s.length && s[0].pano
  15575. }),
  15576. (d.prototype.examine = function (i) {
  15577. if (!player.currentPano) return
  15578. var e = i.mode,
  15579. n = (g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano)) || i.currentPano,
  15580. t = this.disc.getWorldPosition()
  15581. this.billboard.setActiveState()
  15582. var r = function () {
  15583. var e = this.billboard.getDimensions(),
  15584. t = new f.Vector3()
  15585. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15586. t.unproject(i.camera),
  15587. i.flyToPano({
  15588. pano: n,
  15589. lookAtPoint: t
  15590. })
  15591. }.bind(this)
  15592. if (e === m.PANORAMA)
  15593. if (n !== i.currentPano) {
  15594. var o = {
  15595. pano: n,
  15596. lookAtPoint: t,
  15597. duration: null,
  15598. maxDistanceOverride: null,
  15599. skipWarpingCheck: !1
  15600. }
  15601. i.flyToPano(o, r)
  15602. } else
  15603. setTimeout(
  15604. function () {
  15605. this.billboard.open().then(function () {
  15606. r()
  15607. })
  15608. }.bind(this),
  15609. 0
  15610. )
  15611. else {
  15612. var a = {
  15613. pano: n
  15614. }
  15615. if (t) {
  15616. var s = new f.Matrix4().lookAt(n.position, t, new f.Vector3(0, 1, 0))
  15617. a.quaternion = new f.Quaternion().setFromRotationMatrix(s)
  15618. }
  15619. ;(a.callback = r), (a.duration = 1500), (a.mode = m.PANORAMA), i.flyToNewMode(a)
  15620. }
  15621. }),
  15622. (d.prototype.update =
  15623. ((n = new f.Vector3()),
  15624. function (e, t) {
  15625. ;(this.discWorldPosition = this.disc.getWorldPosition()),
  15626. this.updateDisc(e, t),
  15627. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t), n.z < 1 && ((n.y *= -1), this.billboard.update(n, this.getDiscRadius(n, t))))
  15628. })),
  15629. (d.prototype.updateDisc =
  15630. ((l = new f.Vector3()),
  15631. (c = new f.Vector3()),
  15632. (h = new f.Vector3()),
  15633. (u = new f.Vector3()),
  15634. (p = new f.Vector3()),
  15635. function (e, t) {
  15636. var i = g.tags.visibility,
  15637. n = g.tags.disc.scale,
  15638. r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition)
  15639. if (
  15640. ((this.obj3d.visible =
  15641. 0 !== this.disc.material.opacity &&
  15642. (i.anyDistance || r <= i.visibleDistance || e === m.TRANSITIONING) &&
  15643. (!i.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) &&
  15644. (!i.hideOffScreenDisc || !this.offScreen(this.disc, t)) &&
  15645. (!i.hideOffScreenObject || !this.offScreen(this.obj3d, t))),
  15646. this.obj3d.visible)
  15647. ) {
  15648. this.disc.quaternion.copy(t.quaternion)
  15649. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound)
  15650. l.copy(this.discWorldPosition).project(t),
  15651. c.set($('#player').width() / 2, $('#player').height() / 2, 1).multiply(l),
  15652. h.set(o / 2, 0, 0).add(c),
  15653. u.set(2 / $('#player').width(), 2 / $('#player').height(), 1).multiply(h),
  15654. p.copy(u).unproject(t)
  15655. var a = p.distanceTo(this.discWorldPosition),
  15656. s = 1 + (g.tags.disc.scale.responsiveness / 100) * (d.viewportScale() - 1)
  15657. ;(this.discScale = a * s), this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15658. }
  15659. })),
  15660. (d.prototype.getDiscRadius =
  15661. ((i = new f.Vector3()),
  15662. function (e, t) {
  15663. return (
  15664. i
  15665. .set(-this.discScale / 2, 0, 0)
  15666. .applyQuaternion(t.quaternion)
  15667. .add(this.discWorldPosition)
  15668. .project(t),
  15669. Math.abs(e.x - i.x) * $('#player').width()
  15670. )
  15671. })),
  15672. (d.prototype.tagVisibleOnCurrentFloor = function (e) {
  15673. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15674. }),
  15675. (d.prototype.offScreen = function (e, t) {
  15676. var i = e.getWorldPosition().project(t)
  15677. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15678. }),
  15679. (d.viewportScale = function () {
  15680. return (
  15681. (d.viewportWidth === $('#player').width() && d.viewportHeight === $('#player').height()) ||
  15682. ((d.viewportWidth = $('#player').width()),
  15683. (d.viewportHeight = $('#player').height()),
  15684. (d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize))),
  15685. d.currentViewportScale
  15686. )
  15687. }),
  15688. (R.exports = d)
  15689. }).call(this, '/js/tag/tag.js')
  15690. },
  15691. {
  15692. '../enum/Colors': 19,
  15693. '../enum/RenderLayers': 41,
  15694. '../enum/RenderOrder': 42,
  15695. '../enum/Viewmode': 51,
  15696. '../objects/Panorama': 148,
  15697. '../settings': 166,
  15698. '../shaders': 167,
  15699. '../util/common': 185,
  15700. '../util/easing': 186,
  15701. '../util/lerp': 188,
  15702. '../util/logger': 189,
  15703. '../util/math': 190,
  15704. '../util/texture': 194,
  15705. '../util/transitions': 195,
  15706. './Billboard/Billboard': 119,
  15707. './Billboard/BillboardEvent': 120,
  15708. events: 202,
  15709. three: 217
  15710. }
  15711. ],
  15712. 124: [
  15713. function (M, R, e) {
  15714. ;(function (e) {
  15715. 'use strict'
  15716. function t() {
  15717. ;(this.tagState = T.IDLE),
  15718. (this.intersectTag = null),
  15719. (this.hoveredTag = null),
  15720. (this.activeTag = null),
  15721. (this.tagDiscs = []),
  15722. (this.raycaster = new i.Raycaster()),
  15723. (this.modelManager = null),
  15724. (this.player = null),
  15725. (this.totaltags = 0),
  15726. (this.navigatingViaTag = !1),
  15727. (this.enabled = !1)
  15728. }
  15729. var o,
  15730. h,
  15731. u,
  15732. d,
  15733. p,
  15734. f,
  15735. s,
  15736. l,
  15737. c,
  15738. i = M('three'),
  15739. n = M('../util/logger'),
  15740. r = M('../util/common'),
  15741. a = M('../controls/serializer'),
  15742. g = M('../objects/Snapshot'),
  15743. m = M('../settings'),
  15744. v = M('./Billboard/BillboardEvent'),
  15745. y = M('./Media/MediaEvent'),
  15746. A = M('./Media/LinkType'),
  15747. C = M('../enum/Viewmode'),
  15748. I = M('../enum/WarpStyle'),
  15749. E = M('../enum/BlackoutStyle'),
  15750. _ = M('../enum/ModelManagerEvents'),
  15751. b = M('../enum/tagEvents'),
  15752. w = M('../enum/PlayerEvents'),
  15753. T = (M('../util/lerp'), M('../enum/TagStates')),
  15754. x = M('events').EventEmitter,
  15755. S = new n(e)
  15756. r.extend(t, x),
  15757. (t.prototype.init = function (e, t) {
  15758. ;(this.modelManager = e), (this.player = t), this.updateModel(), this.bindEvents()
  15759. }),
  15760. (t.prototype.update = function (e) {
  15761. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15762. }),
  15763. (t.prototype.updateTags = function (e, t, i, n) {
  15764. for (var r in this.model.tags) this.model.tags[r].update(e, t, i, n)
  15765. }),
  15766. (t.prototype.updateModel = function () {
  15767. ;(this.model = this.modelManager.getActiveModel()), this.gettagsFromModel(), (this.totaltags = Object.keys(this.model.tags).length)
  15768. }),
  15769. (t.prototype.gettagsFromModel = function () {
  15770. for (var e in ((this.tagDiscs = []), this.model.tags)) {
  15771. var t = this.model.tags[e].disc
  15772. t && this.tagDiscs.push(t)
  15773. }
  15774. }),
  15775. (t.prototype.bindEvents = function () {
  15776. function e() {
  15777. Object.keys(this.model.tags).forEach(
  15778. function (e) {
  15779. var t = this.model.tags[e]
  15780. t.bindEvents(),
  15781. t.billboard.on(
  15782. y.LINK_CLICK,
  15783. function (e) {
  15784. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15785. }.bind(this)
  15786. ),
  15787. t.billboard.on(
  15788. y.IMAGE_OPENED,
  15789. function () {
  15790. ;(this.tagState = T.EXAMINE), this.emit(y.IMAGE_OPENED)
  15791. }.bind(this)
  15792. ),
  15793. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15794. }.bind(this)
  15795. )
  15796. }
  15797. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15798. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15799. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15800. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15801. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15802. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15803. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15804. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15805. e.call(this)
  15806. }),
  15807. (t.prototype.navigateViaLink = function (e) {
  15808. var t = a.deserialize(e)
  15809. if (t)
  15810. if (t.mode === C.PANORAMA) {
  15811. try {
  15812. this.player.model.panos.get(t.panoId)
  15813. } catch (e) {
  15814. return void S.warn('Unable to find panorama location', t.panoId)
  15815. }
  15816. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15817. } else {
  15818. var i = {
  15819. cameraMode: t.mode,
  15820. position: t.position,
  15821. quaternion: t.quaternion,
  15822. scanId: t.panoId,
  15823. orthoZoom: t.zoom,
  15824. floorVisibility: t.floorVisibility,
  15825. thumbUrl: null,
  15826. name: null
  15827. }
  15828. this.player.flyToNewMode({
  15829. mode: t.mode,
  15830. duration: m.warp.outsideTime,
  15831. warpDest: new g(i),
  15832. force: !0
  15833. })
  15834. }
  15835. }),
  15836. (t.prototype.handleWarpStart = function (e, t, i, n) {
  15837. this.dismissExaminedTag(), t === I.BLACK && (null != n || (n = m.warp.teleportTime), e && (i = E.END), this.hideShowTagsForBlackoutStyle(i, n))
  15838. }),
  15839. (t.prototype.handleWarpInterruption = function (e, t, i) {
  15840. null != i || (i = m.warp.teleportTime), this.hideShowTagsForBlackoutStyle(t, i)
  15841. }),
  15842. (t.prototype.hideShowTagsForBlackoutStyle = function (e, t) {
  15843. var i = 0,
  15844. n = 0,
  15845. r = t / 2
  15846. switch ((null != e || (e = E.MIDDLE), e)) {
  15847. case E.END:
  15848. this.hideAlltags(r)
  15849. break
  15850. case E.BEGINNING:
  15851. this.hideAlltags().done(this.showAlltags.bind(this, r))
  15852. break
  15853. case E.NONE:
  15854. break
  15855. case E.MIDDLE:
  15856. ;(n = i = r),
  15857. this.hideAlltags(n),
  15858. setTimeout(
  15859. function () {
  15860. this.showAlltags(i)
  15861. }.bind(this),
  15862. n
  15863. )
  15864. break
  15865. case E.FADEIN:
  15866. setTimeout(
  15867. function () {
  15868. this.showAlltags(r)
  15869. }.bind(this),
  15870. r
  15871. )
  15872. }
  15873. }),
  15874. (t.prototype.onPlayerModeChanging = function (e, t) {
  15875. t !== C.PANORAMA && this.dismissExaminedTag(), t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR)
  15876. var i = t !== C.OUTDOOR
  15877. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15878. }),
  15879. (t.prototype.onPanoChange = function (e, t) {
  15880. var i = this.navigatingViaTag
  15881. if (((this.navigatingViaTag = !1), !i)) {
  15882. this.dismissExaminedTag()
  15883. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA,
  15884. r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA
  15885. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15886. }
  15887. }),
  15888. (t.prototype.onPlayerReady = function (e, t, i) {
  15889. this.startAlltags(e, t ? i : null)
  15890. }),
  15891. (t.prototype.onPlayerFlyingEnded = function (e, t) {
  15892. this.updateClosestTags(e)
  15893. }),
  15894. (t.prototype.dismissExaminedTag = function () {
  15895. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(), this.hoveredTag && (this.hoveredTag.setFreeState(!0), (this.hoveredTag = null))
  15896. }),
  15897. (t.prototype.startAlltags = function (e, t) {
  15898. ;(this.model.shouldShowtags = m.tags.enabled),
  15899. (this.enabled = !0),
  15900. e ||
  15901. (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  15902. t &&
  15903. setTimeout(
  15904. function () {
  15905. this.activateTag(this.model.getTagBySid(t))
  15906. }.bind(this),
  15907. m.tags.startup.fadeInDuration / 2
  15908. ))
  15909. }),
  15910. (t.prototype.showAlltags = function (e, t, i) {
  15911. function n() {
  15912. ++o === this.totaltags && ((this.model.tagsShown = !0), r.resolve())
  15913. }
  15914. var r = $.Deferred()
  15915. if ((!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned()) || !this.model.shouldShowtags) return r.resolve().promise()
  15916. var o = 0
  15917. for (var a in this.model.tags) {
  15918. this.model.tags[a].show(e, t).done(n.bind(this))
  15919. }
  15920. return r.promise()
  15921. }),
  15922. (t.prototype.hideAlltags = function (e, t) {
  15923. function i() {
  15924. ++r === this.totaltags && ((this.model.tagsShown = !1), n.resolve())
  15925. }
  15926. var n = $.Deferred(),
  15927. r = 0
  15928. for (var o in this.model.tags) {
  15929. var a = this.model.tags[o]
  15930. a.hide(e, t).done(i.bind(this)), a === this.activeTag && this.dismissActiveTag()
  15931. }
  15932. return n.promise()
  15933. }),
  15934. (t.prototype.enableHovering = function () {
  15935. this.enabled = !0
  15936. }),
  15937. (t.prototype.disableHovering = function () {
  15938. this.enabled = !1
  15939. }),
  15940. (t.prototype.activateTag = function (e, t) {
  15941. ;(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)
  15942. }),
  15943. (t.prototype.dismissActiveTag = function () {
  15944. ;(this.activeTag.hoveringDisc = !1), this.activeTag.setFreeState(!0)
  15945. var e = this.activeTag
  15946. ;(this.activeTag = null), (this.tagState = T.IDLE), this.emit(b.TagDismissed, e)
  15947. }),
  15948. (t.prototype.clickedOnTag = function (e) {
  15949. var t = function () {
  15950. ;(this.navigatingViaTag = !0), this.activeTag.examine(this.player), this.emit(b.TagNavigation, this.activeTag)
  15951. }.bind(this)
  15952. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE), (this.activeTag = this.intersectTag), t(), !0) : (this.dismissActiveTag(), !1)
  15953. }),
  15954. (t.prototype.intersecttag =
  15955. ((s = new i.Vector3()),
  15956. (l = new i.Vector3()),
  15957. (c = new i.Vector3()),
  15958. function (e, t, i) {
  15959. if (!this.enabled) return null
  15960. var n = null,
  15961. r = this.tagDiscs.filter(function (e) {
  15962. return e.parent.visible
  15963. })
  15964. if (0 < r.length) {
  15965. var o = this.model.floors.reduce(function (e, t) {
  15966. return t.hidden ? e : e.concat(t.collider.children)
  15967. }, r)
  15968. 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)
  15969. var a = this.raycaster.intersectObjects(o)
  15970. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  15971. }
  15972. return (
  15973. (this.intersectTag = n),
  15974. t &&
  15975. (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || (this.tagState === T.EXAMINE && n)) && this.dismissActiveTag(),
  15976. n &&
  15977. n !== this.activeTag &&
  15978. (n.listeners(v.ENTER).length < 1 &&
  15979. (n.billboard.on(
  15980. v.ENTER,
  15981. function () {
  15982. this.hoveredTag = n
  15983. }.bind(this)
  15984. ),
  15985. n.billboard.on(
  15986. v.LEAVE,
  15987. function () {
  15988. this.hoveredTag = null
  15989. }.bind(this)
  15990. )),
  15991. this.activateTag(n, T.BROWSE))),
  15992. n
  15993. )
  15994. })),
  15995. (t.prototype.rankedtagInDirection =
  15996. ((h = []),
  15997. (u = []),
  15998. (d = new i.Vector3()),
  15999. (p = new i.Vector3()),
  16000. (f = new i.Vector3()),
  16001. function (e, t, i, n) {
  16002. for (var r = 0, o = (u.length = 0); o < this.closesttags.length; o++) {
  16003. var a = this.closesttags[o]
  16004. p.copy(a.position), p.add(a.discPosition), d.copy(t), d.sub(p).negate(), d.normalize()
  16005. var s = d.dot(n)
  16006. if (0 <= s && (f.copy(p), f.project(i), this.intersecttag(f, !1, i))) {
  16007. if (r >= h.length)
  16008. for (var l = 0; l < 64; l++)
  16009. h.push({
  16010. tag: a,
  16011. dot: s
  16012. })
  16013. var c = h[r]
  16014. ;(c.tag = a), (c.dot = s), (c.position = math.projectPositionToCanvas(p, i)), u.push(c), r++
  16015. }
  16016. }
  16017. return (
  16018. u.sort(function (e, t) {
  16019. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16020. }),
  16021. e < u.length ? u[e].tag : null
  16022. )
  16023. })),
  16024. (t.prototype.updateClosestTags =
  16025. ((o = new i.Vector3()),
  16026. function (e) {
  16027. this.closesttags || (this.closesttags = []), (this.closesttags.length = 0)
  16028. var t = this.model.tags
  16029. if (t)
  16030. for (var i in t)
  16031. if (t.hasOwnProperty(i)) {
  16032. var n = t[i],
  16033. r = n.position
  16034. o.copy(e), o.sub(r).negate(), o.lengthSq() < 30 && this.closesttags.push(n)
  16035. }
  16036. })),
  16037. (R.exports = t)
  16038. }).call(this, '/js/tag/tagManager.js')
  16039. },
  16040. {
  16041. '../controls/serializer': 14,
  16042. '../enum/BlackoutStyle': 18,
  16043. '../enum/tagEvents': 32,
  16044. '../enum/ModelManagerEvents': 33,
  16045. '../enum/PlayerEvents': 40,
  16046. '../enum/TagStates': 44,
  16047. '../enum/Viewmode': 51,
  16048. '../enum/WarpStyle': 52,
  16049. '../objects/Snapshot': 153,
  16050. '../settings': 166,
  16051. '../util/common': 185,
  16052. '../util/lerp': 188,
  16053. '../util/logger': 189,
  16054. './Billboard/BillboardEvent': 120,
  16055. './Media/LinkType': 130,
  16056. './Media/MediaEvent': 131,
  16057. events: 202,
  16058. three: 217
  16059. }
  16060. ],
  16061. 125: [
  16062. function (r, o, e) {
  16063. ;(function (e) {
  16064. 'use strict'
  16065. function t() {
  16066. ;(this.embedWrapper = null), (this.embedElement = null)
  16067. }
  16068. var i = r('../../util/ajax'),
  16069. a = r('./mediaSettings'),
  16070. n = r('../../settings'),
  16071. s = new (r('../../util/logger'))(e)
  16072. ;(t.prototype.createDomElement = function () {
  16073. return (this.embedWrapper = document.createElement('div')), this.embedWrapper.classList.add('tag-embed'), this.embedWrapper.classList.add('hidden'), this.embedWrapper
  16074. }),
  16075. (t.prototype.load = function (e) {
  16076. var t = 'https://api.embedly.com/1/oembed?key=' + n.appConfig.embedly_key + '&url=' + encodeURIComponent(e) + '&maxwidth=' + a.maxEmbedWidth
  16077. return new Promise(
  16078. function (r, o) {
  16079. i.get(t).then(
  16080. function (e) {
  16081. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf('<script')) {
  16082. this.embedWrapper.innerHTML = e.html
  16083. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth
  16084. if (((this.embedWrapper.style.width = t + 'px'), e.height)) {
  16085. var i = e.height / e.width
  16086. this.embedWrapper.style.height = t * i + 'px'
  16087. }
  16088. this.embedElement = this.embedWrapper.firstChild
  16089. var n = []
  16090. try {
  16091. n = [].slice.call(this.embedElement.querySelectorAll('a'))
  16092. } catch (e) {
  16093. s.debug('Error getting `a` elements for embed; was it an iframe?')
  16094. }
  16095. n.forEach(function (e) {
  16096. e.setAttribute('target', '_blank')
  16097. }),
  16098. this.embedElement.classList.add('hidden'),
  16099. this.embedWrapper.classList.remove('hidden'),
  16100. r()
  16101. } else o('Not a valid embed')
  16102. }.bind(this),
  16103. function (e) {
  16104. o(e.response)
  16105. }
  16106. )
  16107. }.bind(this)
  16108. )
  16109. }),
  16110. (t.prototype.show = function () {
  16111. this.embedElement && this.embedElement.classList.remove('hidden')
  16112. }),
  16113. (t.prototype.hide = function () {
  16114. this.embedElement && this.embedElement.classList.add('hidden')
  16115. }),
  16116. (o.exports = t)
  16117. }).call(this, '/js/tag/Media/EmbedlyEmbed.js')
  16118. },
  16119. {
  16120. '../../settings': 166,
  16121. '../../util/ajax': 181,
  16122. '../../util/logger': 189,
  16123. './mediaSettings': 132
  16124. }
  16125. ],
  16126. 126: [
  16127. function (a, s, e) {
  16128. ;(function (e) {
  16129. 'use strict'
  16130. function t(e) {
  16131. r.call(this), (this.options = e), (this.playerControls = null), (this.state = o.NOT_READY)
  16132. }
  16133. var i,
  16134. n = a('../../util/browser'),
  16135. r = a('./EmbedlyEmbed'),
  16136. o =
  16137. (new (a('../../util/logger'))(e),
  16138. Object.freeze({
  16139. NOT_READY: 'player.not.ready',
  16140. CUED: 'player.cued',
  16141. PLAYING: 'player.playing',
  16142. PAUSED: 'player.paused'
  16143. }))
  16144. ;((t.prototype = Object.create(r.prototype)).createDomElement = function () {
  16145. return (this.embedWrapper = document.createElement('div')), this.embedWrapper.classList.add('tag-video'), this.embedWrapper.classList.add('hidden'), this.embedWrapper
  16146. }),
  16147. (t.prototype.load = function (e) {
  16148. var t = function () {
  16149. function e(e) {
  16150. this.playerState = e
  16151. }
  16152. ;(this.playerControls = new playerjs.Player(this.embedElement)),
  16153. this.playerControls.on(
  16154. 'ready',
  16155. function (e) {
  16156. ;(this.playerState = o.CUED), this.options.startMuted && this.playerControls.mute()
  16157. }.bind(this)
  16158. ),
  16159. this.playerControls.on('play', e.bind(this, o.PLAYING)),
  16160. this.playerControls.on('pause', e.bind(this, o.PAUSED)),
  16161. this.playerControls.on(
  16162. 'ended',
  16163. function (e) {
  16164. this.playerControls.setCurrentTime(0), this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16165. }.bind(this)
  16166. )
  16167. }.bind(this)
  16168. return r.prototype.load.call(this, e).then(t.bind(this))
  16169. }),
  16170. (t.prototype.play =
  16171. ((i = n.isMobile()),
  16172. function () {
  16173. this.playerState !== o.NOT_READY && this.playerControls && !i && ((this.state === o.CUED && this.options.autoPlay) || this.options.autoResume) && this.playerControls.play()
  16174. })),
  16175. (t.prototype.pause = function () {
  16176. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  16177. }),
  16178. (s.exports = t)
  16179. }).call(this, '/js/tag/Media/EmbedlyPlayer.js')
  16180. },
  16181. {
  16182. '../../util/browser': 182,
  16183. '../../util/logger': 189,
  16184. './EmbedlyEmbed': 125
  16185. }
  16186. ],
  16187. 127: [
  16188. function (t, i, e) {
  16189. ;(function (e) {
  16190. 'use strict'
  16191. var r = t('../../util/ajax'),
  16192. o = new (t('./mediaSettings'), t('../../util/logger'))(e),
  16193. a = Promise.resolve()
  16194. i.exports.enqueue = function (i) {
  16195. function n() {}
  16196. return (a = new Promise(function (e, t) {
  16197. a.catch(n).then(function () {
  16198. ;(o.debug('requesting file from embedly:', i.href),
  16199. r
  16200. .get(i.href, {
  16201. responseType: i.responseType
  16202. })
  16203. .then(function (e) {
  16204. return o.debug('requesting file finished:', i.href), e
  16205. })).then(e, t)
  16206. })
  16207. }))
  16208. }
  16209. }).call(this, '/js/tag/Media/EmbedlyQueue.js')
  16210. },
  16211. {
  16212. '../../util/ajax': 181,
  16213. '../../util/logger': 189,
  16214. './mediaSettings': 132
  16215. }
  16216. ],
  16217. 128: [
  16218. function (s, l, e) {
  16219. ;(function (e) {
  16220. 'use strict'
  16221. function t() {
  16222. ;(this.imageWrapper = null), (this.width = 0), (this.height = 0), (this.aspect = 1)
  16223. }
  16224. var i = s('./MediaEvent'),
  16225. n = s('./EmbedlyQueue'),
  16226. r = s('events').EventEmitter,
  16227. o = s('../../util/logger'),
  16228. a = s('../../settings')
  16229. new o(e),
  16230. ((t.prototype = Object.create(r.prototype)).createDomElement = function () {
  16231. return (
  16232. (this.imageWrapper = document.createElement('div')),
  16233. this.imageWrapper.classList.add('tag-image'),
  16234. this.imageWrapper.classList.add('hidden'),
  16235. this.imageWrapper.addEventListener(
  16236. 'click',
  16237. function (e) {
  16238. e.stopPropagation(), this.emit(i.IMAGE_OPENING), (this.imageWrapper.style.pointerEvents = 'none')
  16239. }.bind(this)
  16240. ),
  16241. this.imageWrapper
  16242. )
  16243. }),
  16244. (t.prototype.onClosed = function () {
  16245. this.imageWrapper.style.pointerEvents = 'auto'
  16246. }),
  16247. (t.prototype.load = function (e) {
  16248. var t = Math.max(window.screen.height, window.screen.width),
  16249. i = 'https://i.embed.ly/1/display/resize?key=' + a.appConfig.embedly_key + '&url=' + encodeURIComponent(e) + '&width=' + t + '&height=' + t
  16250. return new Promise(
  16251. function (o, e) {
  16252. n.enqueue({
  16253. href: i,
  16254. responseType: 'arraybuffer'
  16255. }).then(
  16256. function (e) {
  16257. var t = new Uint8Array(e),
  16258. i = new Blob([t]),
  16259. n = new window.Image()
  16260. n.addEventListener(
  16261. 'load',
  16262. function (e) {
  16263. var t = e.target
  16264. ;(this.width = t.naturalWidth), (this.height = t.naturalHeight), (this.aspect = this.width / this.height)
  16265. var i = e.target.src
  16266. ;(this.imageWrapper.style.backgroundImage = 'url("' + i + '")'),
  16267. (this.imageWrapper.style.width = this.width + 'px'),
  16268. (this.imageWrapper.style.height = this.height + 'px'),
  16269. this.imageWrapper.classList.remove('hidden'),
  16270. o()
  16271. }.bind(this)
  16272. )
  16273. var r = URL.createObjectURL(i)
  16274. n.src = r
  16275. }.bind(this),
  16276. e
  16277. )
  16278. }.bind(this)
  16279. )
  16280. }),
  16281. (l.exports = t)
  16282. }).call(this, '/js/tag/Media/Image.js')
  16283. },
  16284. {
  16285. '../../settings': 166,
  16286. '../../util/logger': 189,
  16287. './EmbedlyQueue': 127,
  16288. './MediaEvent': 131,
  16289. events: 202
  16290. }
  16291. ],
  16292. 129: [
  16293. function (e, t, i) {
  16294. 'use strict'
  16295. function n(e) {
  16296. ;(this.label = e.label), (this.href = e.url), (this.type = this.updateLinkForType()), (this.domElement = null), (this.id = c++)
  16297. }
  16298. var r = e('./LinkType'),
  16299. o = e('./MediaEvent'),
  16300. a = e('../../util/browser'),
  16301. s = e('../../analytics'),
  16302. l = e('events').EventEmitter,
  16303. c = 0
  16304. ;(n.prototype = Object.create(l.prototype)).updateLinkForType = function () {
  16305. var e,
  16306. t = a.valueFromHash('m') || a.valueFromHash('model')
  16307. return -1 !== this.href.indexOf('port.com/show') || -1 !== this.href.indexOf(window.location.host + '/show')
  16308. ? -1 !== this.href.indexOf(t) && -1 !== this.href.indexOf('start=')
  16309. ? ((this.href = ((e = this.href), new RegExp('[#&?]start=([^#&?]*)').exec(e)[1])), r.NAVIGATION)
  16310. : ((this.href = this.href + '&play=1'), r.MODEL)
  16311. : r.EXT_LINK
  16312. }
  16313. var h = {}
  16314. ;(n.prototype.createDomElement = function () {
  16315. if (((this.domElement = document.createElement('a')), this.domElement.classList.add('tag-link'), (this.domElement.textContent = this.label), this.type === r.EXT_LINK)) {
  16316. this.domElement.textContent += ' '
  16317. var e = document.createElement('i')
  16318. e.classList.add('icon-ext-link'), (e.title = 'Link to external web site'), this.domElement.appendChild(e)
  16319. }
  16320. return (
  16321. this.domElement.addEventListener(
  16322. 'click',
  16323. function (e) {
  16324. switch (
  16325. (e.stopPropagation(),
  16326. (h[this.id] = !0),
  16327. s.trackAlways('click_tag_link', {
  16328. link_type: this.type,
  16329. link_count: c,
  16330. links_clicked: Object.keys(h).length
  16331. }),
  16332. this.type)
  16333. ) {
  16334. case r.MODEL:
  16335. window.location.replace(this.href)
  16336. break
  16337. case r.EXT_LINK:
  16338. window.open(this.href, '_blank')
  16339. }
  16340. this.emit(o.LINK_CLICK, {
  16341. type: this.type,
  16342. url: this.href
  16343. })
  16344. }.bind(this)
  16345. ),
  16346. this.domElement
  16347. )
  16348. }),
  16349. (t.exports = n)
  16350. },
  16351. {
  16352. '../../analytics': 4,
  16353. '../../util/browser': 182,
  16354. './LinkType': 130,
  16355. './MediaEvent': 131,
  16356. events: 202
  16357. }
  16358. ],
  16359. 130: [
  16360. function (e, t, i) {
  16361. 'use strict'
  16362. t.exports = {
  16363. NAVIGATION: 'navigation',
  16364. MODEL: 'model',
  16365. EXT_LINK: 'ext-link'
  16366. }
  16367. },
  16368. {}
  16369. ],
  16370. 131: [
  16371. function (e, t, i) {
  16372. 'use strict'
  16373. t.exports = Object.freeze({
  16374. LINK_CLICK: 'mtmedia.link',
  16375. IMAGE_LOADED: 'mtmedia.image.loaded',
  16376. IMAGE_OPENING: 'mtmedia.image.opening',
  16377. IMAGE_OPENED: 'mtmedia.image.opened',
  16378. IMAGE_CLOSING: 'mtmedia.image.closing',
  16379. IMAGE_CLOSED: 'mtmedia.image.closed',
  16380. VIDEO_START: 'mtmedia.video.start',
  16381. VIDEO_PAUSE: 'mtmedia.video.pause',
  16382. VIDEO_ENDED: 'mtmedia.video.end'
  16383. })
  16384. },
  16385. {}
  16386. ],
  16387. 132: [
  16388. function (e, t, i) {
  16389. 'use strict'
  16390. t.exports = Object.freeze({
  16391. maxEmbedWidth: 350,
  16392. defaultAspectRatio: 0.75
  16393. })
  16394. },
  16395. {}
  16396. ],
  16397. 133: [
  16398. function (e, t, i) {
  16399. 'use strict'
  16400. t.exports = Object.freeze({
  16401. TEXT: 'text',
  16402. LINK: 'link',
  16403. IMAGE: 'photo',
  16404. VIDEO: 'video',
  16405. RICH: 'rich'
  16406. })
  16407. },
  16408. {}
  16409. ],
  16410. 134: [
  16411. function (e, t, i) {
  16412. 'use strict'
  16413. function n(e) {
  16414. this.capabilities = {
  16415. links: {
  16416. enable: e.supportLinks,
  16417. keepLabels: e.keepLinkLabels
  16418. }
  16419. }
  16420. }
  16421. var r = e('./DescriptionChunkType')
  16422. ;(n.prototype.parse = function (e, i) {
  16423. var n = []
  16424. return (
  16425. e
  16426. .split('[')
  16427. .map(function (e, t) {
  16428. return 0 === t ? e : '[' + e
  16429. })
  16430. .forEach(
  16431. function (e) {
  16432. var t = this.findMarkdown(e)
  16433. if (t) {
  16434. if (-1 !== t.url.indexOf('javascript:')) return
  16435. this.addLinkChunk(n, t, i), this.addTextChunk(n, e.slice(t.markdown.length))
  16436. } else this.addTextChunk(n, e)
  16437. }.bind(this)
  16438. ),
  16439. n
  16440. )
  16441. }),
  16442. (n.prototype.findMarkdown = function (e) {
  16443. var t = e.match(/\[([^\]]*)\]\((.*)\)/)
  16444. if (t) {
  16445. for (var i = t[2], n = 1, r = 0; r < i.length && ('(' === i[r] ? n++ : ')' === i[r] && n--, 0 !== n); ) r++
  16446. var o = i.length - r
  16447. return {
  16448. markdown: t[0].substring(0, t[0].length - o),
  16449. label: t[1],
  16450. url: t[2].substring(0, r)
  16451. }
  16452. }
  16453. }),
  16454. (n.prototype.addTextChunk = function (e, t) {
  16455. 0 !== t.length &&
  16456. e.push({
  16457. type: r.TEXT,
  16458. text: t
  16459. })
  16460. }),
  16461. (n.prototype.addLinkChunk = function (e, t) {
  16462. if (this.capabilities.links.enable) {
  16463. var i = {
  16464. label: t.label,
  16465. url: t.url
  16466. }
  16467. ;-1 === i.url.indexOf('://') && (i.url = 'http://' + i.url),
  16468. e.push({
  16469. type: r.LINK,
  16470. link: i
  16471. })
  16472. } else this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16473. }),
  16474. (t.exports = n)
  16475. },
  16476. {
  16477. './DescriptionChunkType': 133
  16478. }
  16479. ],
  16480. 135: [
  16481. function (t, r, e) {
  16482. ;(function (e) {
  16483. 'use strict'
  16484. var i = new (t('../util/logger'))(e),
  16485. n = {
  16486. parseIdsFromChunkName: function (e, t) {
  16487. ;(t.floorId = n.parseFloor(e)), (t.roomId = n.parseRoom(e))
  16488. },
  16489. parseFloor: function (e) {
  16490. var t = e.match(/_group([0-9]+)/)
  16491. if (!t) return 0
  16492. try {
  16493. return parseInt(t[1], 10)
  16494. } catch (e) {
  16495. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'), 0
  16496. }
  16497. },
  16498. parseRoom: function (e) {
  16499. var t = e.match(/_sub([0-9]+)/)
  16500. if (!t) return -1
  16501. try {
  16502. return parseInt(t[1], 10)
  16503. } catch (e) {
  16504. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'), 0
  16505. }
  16506. }
  16507. }
  16508. r.exports = n
  16509. }).call(this, '/js/model/Chunks.js')
  16510. },
  16511. {
  16512. '../util/logger': 189
  16513. }
  16514. ],
  16515. 136: [
  16516. function (a, c, e) {
  16517. ;(function (e) {
  16518. 'use strict'
  16519. function t(e) {
  16520. r.call(this), (this.model = e), (this.exploded = !1)
  16521. }
  16522. var i = a('../objects/Floor'),
  16523. n = (a('../settings'), a('../util/logger')),
  16524. s = a('../util/transitions'),
  16525. r = a('../util/IndexedCollection'),
  16526. o = a('../util/common'),
  16527. l = a('../util/easing')
  16528. new n(e),
  16529. o.inherit(t, r),
  16530. (t.prototype.add = function (e) {
  16531. r.prototype.add.call(this, e), this.model.add(e)
  16532. }),
  16533. (t.prototype.getIndex = function (e) {
  16534. return e.floorIndex
  16535. }),
  16536. (t.prototype.build = function () {
  16537. this.list.forEach(function (e) {
  16538. e.build()
  16539. })
  16540. }),
  16541. (t.prototype.size = function () {
  16542. return this.length
  16543. }),
  16544. (t.prototype.sort = function () {
  16545. r.prototype.sort.call(this, function (e, t) {
  16546. return e.floorIndex - t.floorIndex
  16547. })
  16548. }),
  16549. (t.prototype.nextFloor = function (e, t) {
  16550. return this.index[e.floorIndex + t] || null
  16551. }),
  16552. (t.prototype.getFloorAtPoint = function (e) {
  16553. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16554. var r = this.list[n],
  16555. o = r.distanceToPoint(e)
  16556. ;(!t || o < i) && ((i = o), (t = r))
  16557. }
  16558. return t
  16559. }),
  16560. (t.prototype.getOrMakeFloor = function (e) {
  16561. var t = this.index[e]
  16562. return t || ((t = new i(this.model, e)), this.add(t)), t
  16563. }),
  16564. (t.prototype.hide = function () {
  16565. this.list.forEach(function (e) {
  16566. e.hide()
  16567. })
  16568. }),
  16569. (t.prototype.show = function () {
  16570. this.list.forEach(function (e) {
  16571. e.show()
  16572. })
  16573. }),
  16574. (t.prototype.names = function () {
  16575. return this.list.reduce(function (e, t) {
  16576. return e.concat(t.name)
  16577. }, [])
  16578. }),
  16579. (t.prototype.toggleExplodeHorizontal = function () {
  16580. function i(e, t) {
  16581. a.copy(e.position),
  16582. (e.position.x = r[e.floorIndex] * t),
  16583. (e.position.y = 1 * e.floorIndex * t),
  16584. a.sub(e.position).multiplyScalar(-1),
  16585. e.panos.forEach(function (e) {
  16586. e.translate(a)
  16587. })
  16588. }
  16589. var n,
  16590. r = [],
  16591. o = 0
  16592. this.list.forEach(function (e, t, i) {
  16593. ;(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)
  16594. }),
  16595. (r = r.map(function (e) {
  16596. return e - o / 2
  16597. }))
  16598. var a = this.list[0].position.clone()
  16599. this.exploded
  16600. ? this.list.forEach(function (t) {
  16601. s.start(
  16602. function (e) {
  16603. i(t, 1 - e)
  16604. },
  16605. 1500,
  16606. null,
  16607. 0,
  16608. l.easeOutExpo
  16609. )
  16610. })
  16611. : this.list.forEach(function (t) {
  16612. s.start(
  16613. function (e) {
  16614. i(t, e)
  16615. },
  16616. 1500,
  16617. null,
  16618. 0,
  16619. l.easeOutExpo
  16620. )
  16621. }),
  16622. (this.exploded = !this.exploded)
  16623. }),
  16624. (t.prototype.toggleExplodeVertical = function () {
  16625. function i(e, t) {
  16626. var i = i.copy(e.position)
  16627. ;(e.position.y = (5 * e.floorIndex - n.y / 2) * t),
  16628. i.sub(e.position).multiplyScalar(-1),
  16629. e.panos.forEach(function (e) {
  16630. e.translate(i)
  16631. })
  16632. }
  16633. var n = this.model.size
  16634. this.list[0].position.clone(),
  16635. this.exploded
  16636. ? this.list.forEach(function (t) {
  16637. s.start(
  16638. function (e) {
  16639. i(t, 1 - e)
  16640. },
  16641. 1500,
  16642. null,
  16643. 0,
  16644. l.easeOutExpo
  16645. )
  16646. })
  16647. : this.list.forEach(function (t) {
  16648. s.start(
  16649. function (e) {
  16650. i(t, e)
  16651. },
  16652. 1500,
  16653. null,
  16654. 0,
  16655. l.easeOutExpo
  16656. )
  16657. }),
  16658. (this.exploded = !this.exploded)
  16659. }),
  16660. (c.exports = t)
  16661. }).call(this, '/js/model/FloorCollection.js')
  16662. },
  16663. {
  16664. '../objects/Floor': 146,
  16665. '../settings': 166,
  16666. '../util/IndexedCollection': 175,
  16667. '../util/common': 185,
  16668. '../util/easing': 186,
  16669. '../util/logger': 189,
  16670. '../util/transitions': 195
  16671. }
  16672. ],
  16673. 137: [
  16674. function (r, o, e) {
  16675. ;(function (e) {
  16676. 'use strict'
  16677. function h() {
  16678. n.call(this)
  16679. }
  16680. var u = r('../settings'),
  16681. t = r('../util/logger'),
  16682. d = r('../enum/Viewmode'),
  16683. p = r('../objects/Snapshot'),
  16684. i = (r('../util/math'), r('../util/common')),
  16685. n = r('../util/IndexedCollection'),
  16686. l = new t(e)
  16687. i.inherit(h, n),
  16688. (h.prototype.getImage = function (e) {
  16689. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16690. }),
  16691. (h.prototype.filterByModesAndReel = function (e, t) {
  16692. for (var i = [], n = 0; n < t.length; n += 1) {
  16693. var r = t[n],
  16694. o = this.index[r.sid]
  16695. o && i.push(o)
  16696. }
  16697. var a = e[d.DOLLHOUSE],
  16698. s = e[d.FLOORPLAN]
  16699. ;(i = i.filter(function (e) {
  16700. if (!e.metadata || void 0 === e.metadata.camera_mode) return !0
  16701. var t
  16702. try {
  16703. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16704. } catch (e) {
  16705. return l.debug(e.message), !1
  16706. }
  16707. return t === d.PANORAMA || (t === d.FLOORPLAN && s) || (t === d.DOLLHOUSE && a)
  16708. })).length !== this.list.length && l.info('Disallowed ' + (this.list.length - i.length) + ' highlight images'),
  16709. (this.list = i),
  16710. this.reIndex()
  16711. }),
  16712. (h.prototype.getHeroLocations = function (panos) {
  16713. //改 增加二级location
  16714. if (0 === this.list.length) return []
  16715. var locations = []
  16716. var deal = (n, container) => {
  16717. var r = n.thumbnail_signed_src,
  16718. o = n.name || ''
  16719. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16720. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16721. var a = panos.get(n.metadata.scan_id)
  16722. if (a && !a.isAligned()) return
  16723. }
  16724. var s = d.convertWorkshopModeInt(n.metadata.camera_mode)
  16725. if (s === d.MESH) return
  16726. if (window.isLocal) var src = manage.dealURL(r)
  16727. else var src = 'one' === g_version ? g_Prefix + r + '?' + randomTime().getTime() : r + '?' + randomTime().getTime()
  16728. var l = {
  16729. cameraMode: s,
  16730. position: n.metadata.camera_position,
  16731. quaternion: n.metadata.camera_quaternion,
  16732. zoom: n.metadata.zoom,
  16733. panoId: n.metadata.scan_id,
  16734. orthoZoom: n.metadata.ortho_zoom,
  16735. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16736. thumbUrl: src,
  16737. name: h.filterImageName(o),
  16738. sid: n.sid
  16739. }
  16740. var item = new p(l)
  16741. item.momentTour = n.momentTour
  16742. item.dontRot = n.dontRot
  16743. item.rotTime = n.rotTime
  16744. container.push(item)
  16745. return item
  16746. }
  16747. }
  16748. this.list.forEach(image => {
  16749. if (image.images) {
  16750. var folder = $.extend({}, image)
  16751. folder.heroLocations = []
  16752. image.images.list.forEach(child => {
  16753. deal(child, folder.heroLocations)
  16754. })
  16755. folder.musicInfo = folder.musicInfo || {}
  16756. locations.push(folder)
  16757. delete folder.images
  16758. delete folder.locations
  16759. } else {
  16760. var item = deal(image, locations)
  16761. item.musicInfo = image.musicInfo || g_data2.tourAudio[item.sid] || {} //新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  16762. }
  16763. })
  16764. return locations
  16765. }),
  16766. (h.prototype.getIndex = function (e) {
  16767. return e.sid
  16768. }),
  16769. (h.filterImageName = function (e) {
  16770. return '' === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16771. }),
  16772. (o.exports = h)
  16773. }).call(this, '/js/model/ImageCollection.js')
  16774. },
  16775. {
  16776. '../enum/Viewmode': 51,
  16777. '../objects/Snapshot': 153,
  16778. '../settings': 166,
  16779. '../util/IndexedCollection': 175,
  16780. '../util/common': 185,
  16781. '../util/logger': 189,
  16782. '../util/math': 190
  16783. }
  16784. ],
  16785. 138: [
  16786. function (h, u, e) {
  16787. ;(function (e) {
  16788. 'use strict'
  16789. function n() {
  16790. c.call(this)
  16791. }
  16792. var r = h('../label/Label'),
  16793. i = h('../settings'),
  16794. t = h('../util/logger'),
  16795. o = h('../util/math'),
  16796. a = h('../util/ajax'),
  16797. s = h('./RoomCollection'),
  16798. l = h('../util/common'),
  16799. c = h('../util/IndexedCollection')
  16800. new t(e),
  16801. l.inherit(n, c),
  16802. (n.prototype.getIndex = function (e) {
  16803. return e.labelId
  16804. }),
  16805. (n.prototype.associateWithRooms = function (e) {
  16806. this.forEach(function (t) {
  16807. e.forEach(function (e) {
  16808. e.roomId === t.roomId && (t.room = e)
  16809. })
  16810. })
  16811. }),
  16812. (n.prototype.createFromLabelData = function (e) {
  16813. e.forEach(
  16814. function (e) {
  16815. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId)
  16816. t = s.generateRoomId(e.floorId, t)
  16817. var i = new r(e.sid, e.position || e.positions[0], e.text, e.floorId, t)
  16818. ;(i.position = o.convertWorkshopVector(i.position)), this.add(i), i.build()
  16819. }.bind(this)
  16820. )
  16821. }),
  16822. (n.prototype.load = function (e, t) {
  16823. return a
  16824. .get(e, {
  16825. responseType: 'json',
  16826. auth: t ? i.authorizationHeader : null
  16827. })
  16828. .done(
  16829. function (e) {
  16830. var t = []
  16831. for (var i in e) {
  16832. var n = e[i]
  16833. t.push(n)
  16834. }
  16835. this.createFromLabelData(t)
  16836. }.bind(this)
  16837. )
  16838. }),
  16839. (n.parseRoomIndexFromWorkshopRoomId = function (e) {
  16840. var t = -1
  16841. if (e) {
  16842. if (typeof e == 'number') {
  16843. t = parseInt(e)
  16844. } else {
  16845. var i = e.split('_')
  16846. t = parseInt(i[0])
  16847. }
  16848. }
  16849. return t
  16850. }),
  16851. (u.exports = n)
  16852. }).call(this, '/js/model/LabelCollection.js')
  16853. },
  16854. {
  16855. '../label/Label': 90,
  16856. '../settings': 166,
  16857. '../util/IndexedCollection': 175,
  16858. '../util/ajax': 181,
  16859. '../util/common': 185,
  16860. '../util/logger': 189,
  16861. '../util/math': 190,
  16862. './RoomCollection': 141
  16863. }
  16864. ],
  16865. 139: [
  16866. function (P, O, e) {
  16867. ;(function (e) {
  16868. 'use strict'
  16869. function t(e, t) {
  16870. o.Object3D.call(this), (this.sid = window.number) //t.sid,
  16871. ;(this.data = t),
  16872. (this.options = e),
  16873. (this.urls = new i(e.urlFiles)),
  16874. (this.isPublic = void 0 !== t.is_public && t.is_public),
  16875. //创建heroLocations
  16876. (this.images = new E(this)),
  16877. this.images.extend(t.images),
  16878. this.images.forEach(info => {
  16879. if (info.locations) {
  16880. info.images = new E(this)
  16881. info.images.extend(info.locations)
  16882. }
  16883. })
  16884. this.heroLocations = []
  16885. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  16886. ;(this.outdoorPanoLocations = []),
  16887. (this.floors = new c(this)),
  16888. (this.floorsEnabled = void 0 === e.floors || e.floors),
  16889. (this.changingFloor = !1),
  16890. (this.chunks = []),
  16891. (this.panos = new g()),
  16892. (this.colliders = []),
  16893. (this.loadPanosPromise = null),
  16894. (this.loadMeshTexturesPromise = null),
  16895. (this.auxDataPromise = null),
  16896. (this.meshTexturesLoaded = !1),
  16897. (this.meshTextures = []),
  16898. (this.tags = {}),
  16899. (this.tagsShown = !1),
  16900. (this.shouldShowtags = !1),
  16901. (this.has360Views = !1),
  16902. (this.showingLabels = u.labels.enabled && t.player_options.labels),
  16903. (this.supportedModes = {}),
  16904. (this.supportedModes[s.PANORAMA] = !0),
  16905. (this.supportedModes[s.DOLLHOUSE] = !t.player_options || (t.player_options.dollhouse && I.valueFromHash('dh', 1))),
  16906. (this.supportedModes[s.FLOORPLAN] = !t.player_options || (t.player_options.floor_plan && I.valueFromHash('dh', 1))),
  16907. (this.supportedModes[s.TRANSITIONING] = !0),
  16908. (this.supportsTiles = this.configureTiling()),
  16909. (this.supportsVR = window.DATA.supportsVR || false) //!0,
  16910. ;(this.mode = s.DOLLHOUSE),
  16911. (this.size = null),
  16912. (this.center = null),
  16913. (this.boundingBox = new o.Box3()),
  16914. (this.currentFloor = null),
  16915. (this.allFloorsVisible = !0),
  16916. (this.projectedPano0 = null),
  16917. (this.projectedPano1 = null),
  16918. this.floorsEnabled &&
  16919. t.floors &&
  16920. -1 !== t.floors.indexOf(',') &&
  16921. t.floors.split(',').forEach(
  16922. function (e, t) {
  16923. this.addFloor(new r(this, t, e.trim()))
  16924. }.bind(this)
  16925. ),
  16926. (this.waitQueue = []),
  16927. this.on(
  16928. 'load',
  16929. function (e) {
  16930. 0 !== this.waitQueue.length &&
  16931. ((this.waitQueue = this.waitQueue.filter(function (e) {
  16932. return !e.isLoadedCallback()
  16933. })),
  16934. 0 === this.waitQueue.length && this.emit('waiting-done'))
  16935. }.bind(this)
  16936. ),
  16937. this.setupCustomProperties(),
  16938. (this.hots = {})
  16939. }
  16940. var o = P('three'),
  16941. a = P('../util/ajax'),
  16942. i = P('../util/ModelUrls'),
  16943. n = P('../objects/BoundingTextureSkybox'),
  16944. s = P('../enum/Viewmode'),
  16945. l = P('../enum/RenderOrder'),
  16946. r = (P('../enum/AlignmentType'), P('../objects/Floor')),
  16947. c = P('./FloorCollection'),
  16948. h = P('../objects/Chunk'),
  16949. u = (P('../objects/Room'), P('../objects/Snapshot'), P('../label/Label'), P('../util/math'), P('../settings')),
  16950. d = P('../shaders'),
  16951. p = P('../util/logger'),
  16952. f = (P('../tag/tag'), P('../tag/tagManager'), P('../objects/Panorama')),
  16953. g = P('../util/PanoramaCollection'),
  16954. m = P('../loaders/ModelLoader'),
  16955. v = P('../loaders/ModelTextureLoader'),
  16956. y = P('../loaders/SweepDataLoader'),
  16957. A = P('../util/transitions'),
  16958. C = (P('../util/easing'), P('../util/lerp'), P('../util/common')),
  16959. I = (P('../util/texture'), P('./../util/browser')),
  16960. E = P('./ImageCollection'),
  16961. _ = P('./RoomCollection'),
  16962. b = P('./LabelCollection'),
  16963. w = P('./Chunks'),
  16964. T = P('./../util/showcase'),
  16965. x = P('../exception/BasicException'),
  16966. S = (P('../constants'), P('events').EventEmitter),
  16967. // , M = P("hot")
  16968. R = new p(e)
  16969. ;(t.prototype = Object.create(o.Object3D.prototype)),
  16970. C.extend(t, S),
  16971. (t.prototype.setupCustomProperties = function () {
  16972. var t = u.modelAlpha
  16973. Object.defineProperty(this, 'alpha', {
  16974. get: function () {
  16975. return t
  16976. },
  16977. set: function (e) {
  16978. ;(t = e),
  16979. this.chunks.forEach(function (e) {
  16980. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  16981. })
  16982. }
  16983. })
  16984. }),
  16985. (t.prototype.configureTiling = function () {
  16986. var e = (function () {
  16987. try {
  16988. var e = document.createElement('canvas'),
  16989. t = e.getContext('webgl')
  16990. return (t = t || e.getContext('experimental-webgl')).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  16991. } catch (e) {
  16992. return 0
  16993. }
  16994. })()
  16995. if (e < 2048) return !1
  16996. R.warn('Max cube texture size: ' + e)
  16997. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  16998. var i = u.tiling.tilingFlagNames[t]
  16999. if ('1' === I.valueFromHash(i, null)) return !0
  17000. if ('0' === I.valueFromHash(i, null)) return !1
  17001. }
  17002. return !!T.modelDataPromisesTiles(this.data)
  17003. }),
  17004. (t.prototype.toggleAlpha = function () {
  17005. this.alpha < 1 ? (this.alpha = 1) : (this.alpha = 0)
  17006. }),
  17007. (t.prototype.load = function (e) {
  17008. var t = this.urls.init().then(
  17009. function () {
  17010. return $.when(this.loadPanos(), this.loadMesh())
  17011. }.bind(this)
  17012. )
  17013. return (
  17014. e ? (t = t.then(this.loadMeshTextures.bind(this))) : t.then(this.loadMeshTextures.bind(this)),
  17015. (this.auxDataPromise = $.when(this.loadhots(), this.loadLabels())),
  17016. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  17017. )
  17018. }),
  17019. (t.prototype.loadMesh = function () {
  17020. var n = $.Deferred(),
  17021. r = this
  17022. return (
  17023. m.load(
  17024. r.data.job.uuid,
  17025. r.urls,
  17026. function (e, t) {
  17027. if (0 === e.length) {
  17028. R.warn('No geometry found for model, loading faux geometry, disabling outside mode'), (r.supportedModes[s.DOLLHOUSE] = !1), (r.supportedModes[s.FLOORPLAN] = !1)
  17029. var i = new h({
  17030. geometry: new o.PlaneBufferGeometry(5, 5, 1, 1)
  17031. })
  17032. ;(i.material.visible = !1), i.rotateX(-Math.PI / 2), i.geometry.computeBoundingBox(), (e = [i])
  17033. }
  17034. e.forEach(function (e) {
  17035. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0
  17036. r.addChunk(t, e)
  17037. }),
  17038. r.floors.sort(),
  17039. n.resolve(r)
  17040. },
  17041. function (e, t) {
  17042. n.notify(e, t)
  17043. },
  17044. function (e) {
  17045. R.error(e), n.reject('loading-failed')
  17046. }
  17047. ),
  17048. n.promise()
  17049. )
  17050. }),
  17051. (t.prototype.loadMeshTextures = function () {
  17052. return (
  17053. this.loadTexturesPromise ||
  17054. (this.loadTexturesPromise = v.load(this, this.meshTextures).then(
  17055. function () {
  17056. this.meshTexturesLoaded = !0
  17057. }.bind(this)
  17058. )),
  17059. this.loadTexturesPromise
  17060. )
  17061. }),
  17062. (t.prototype.loadhots = function () {
  17063. initHot(this)
  17064. var r = $.Deferred(),
  17065. e = g_Prefix + 'data/' + this.sid + '/data2.js?' + randomTime().getTime()
  17066. return (
  17067. a
  17068. .get(e, {
  17069. responseType: 'json',
  17070. auth: this.isPublic ? null : u.authorizationHeader
  17071. })
  17072. .done(
  17073. function (e) {
  17074. window.data2 = e
  17075. this.roomLabels = []
  17076. if (!e) {
  17077. console.error('data2 is null')
  17078. } else {
  17079. g_data2 = hotMatcher(e)
  17080. this.hotsCount = 0
  17081. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  17082. let create = () => {
  17083. //alertInfo('开始计算',{dontAutoClose:true, hideCloseBtn:true, name:'getPanoVisibles'}); //暂时没找到很多热点要计算的场景
  17084. if (e.hots) {
  17085. var sids = Object.keys(e.hots).sort((a, b) => {
  17086. return e.hots[a].order - e.hots[b].order
  17087. })
  17088. sids.forEach(sid => {
  17089. e.hots[sid].sid = sid
  17090. if (e.hots[sid].texType == 'photo' && !e.hots[sid].texSrc) return console.error('有photo热点无texSrc', e.hots[sid])
  17091. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && 'byHot')
  17092. })
  17093. }
  17094. if (e.overlays) {
  17095. e.overlays.forEach(info => {
  17096. new Hot(info, 'byOverlay')
  17097. })
  17098. }
  17099. Hot.createHotList()
  17100. if (DATA.roomLabels) {
  17101. DATA.roomLabels.forEach(data => {
  17102. this.roomLabels.push(new RoomLabel(data))
  17103. })
  17104. }
  17105. //alertClose('getPanoVisibles');
  17106. Hot.startLoad()
  17107. editTool.loadDone('data2', e)
  17108. }
  17109. if (player.currentPano) {
  17110. create()
  17111. } else {
  17112. let f = () => {
  17113. window.bus.removeEventListener('playerAndModelReady', f)
  17114. create()
  17115. }
  17116. window.bus.addEventListener('playerAndModelReady', f)
  17117. }
  17118. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc)
  17119. }
  17120. r.resolve()
  17121. }.bind(this)
  17122. )
  17123. .fail(function () {
  17124. console.log('没有热点'), editTool.loadDone('data2', null)
  17125. r.resolve()
  17126. }),
  17127. r
  17128. )
  17129. }),
  17130. (t.prototype.loadPanos = function () {
  17131. if (this.loadPanosPromise) return this.loadPanosPromise
  17132. var e = new y(this)
  17133. return (
  17134. (this.loadPanosPromise = e.load().then(
  17135. function (e) {
  17136. window.panoListOriData = e.map(a => a.uuid) //包括!enabled的点
  17137. return (
  17138. this.data.sweeps &&
  17139. 0 < Object.keys(this.data.sweeps).length &&
  17140. (e = e.filter(
  17141. function (e) {
  17142. if (this.data.sweeps[e.uuid]) return this.data.sweeps[e.uuid].enabled
  17143. else console.log(e.uuid)
  17144. //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
  17145. }.bind(this)
  17146. )),
  17147. this.panos.extend(
  17148. e.map(
  17149. function (e) {
  17150. return new f(this, e.uuid, e, this.supportsTiles)
  17151. }.bind(this)
  17152. )
  17153. ),
  17154. this.panos.forEach(
  17155. function (i) {
  17156. i.neighbourUUIDs &&
  17157. (i.neighbourUUIDs.forEach(
  17158. function (e) {
  17159. var t = this.panos.get(e)
  17160. t && this.panos.setNeighbour(i, t, !0)
  17161. }.bind(this)
  17162. ),
  17163. (i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0)))
  17164. }.bind(this)
  17165. ),
  17166. 0 === this.panos.length && (R.warn('Model has no panos, turning off inside mode'), (this.supportedModes[s.PANORAMA] = !1)),
  17167. $.when(this)
  17168. )
  17169. }.bind(this)
  17170. )),
  17171. this.loadPanosPromise
  17172. )
  17173. }),
  17174. (t.prototype.loadHighlightReel = function () {
  17175. var t = $.Deferred(),
  17176. e = this.options.urlBase + 'data/' + this.sid + '/active_reel.json'
  17177. return (
  17178. a
  17179. .get(e, {
  17180. responseType: 'json',
  17181. auth: this.isPublic ? null : u.authorizationHeader
  17182. })
  17183. .done(
  17184. function (e) {
  17185. 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'),
  17186. t.resolve()
  17187. }.bind(this)
  17188. )
  17189. .fail(function () {
  17190. R.warn('Getting highlight reel failed, no highlights available'), t.resolve()
  17191. }),
  17192. t
  17193. )
  17194. }),
  17195. (t.prototype.waitForLoad = function (e, t) {
  17196. t() ||
  17197. (this.waitQueue.push({
  17198. object: e,
  17199. isLoadedCallback: t
  17200. }),
  17201. 1 === this.waitQueue.length && this.emit('waiting'))
  17202. }),
  17203. (t.prototype.hide = function () {
  17204. this.floors.hide()
  17205. }),
  17206. (t.prototype.show = function () {
  17207. this.floors.show()
  17208. }),
  17209. (t.prototype.floorNames = function () {
  17210. return this.floors.names()
  17211. }),
  17212. (t.prototype.warpDestFloors = function (e, t) {
  17213. if (e && this.floors.length === e.length) {
  17214. var i = e.findIndex(
  17215. function (e) {
  17216. return e
  17217. }.bind(this)
  17218. )
  17219. ;-1 !== i && this.setFloor(this.floors.list[i], null, t)
  17220. } else this.toggleAllFloors(!0)
  17221. }),
  17222. (t.prototype.setFloor = function (e, t, i) {
  17223. this.allFloorsVisible && this.emit('allfloors.toggled', !1, this.currentFloor), (this.allFloorsVisible = !1), this._setFloor(e, t, i)
  17224. }),
  17225. (t.prototype.toggleAllFloors = function (e) {
  17226. ;(this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible), this.emit('allfloors.toggled', this.allFloorsVisible, this.currentFloor), this._setFloor(this.currentFloor)
  17227. }),
  17228. (t.prototype._setFloor = function (e, t, i) {
  17229. var n
  17230. if (((t = t || this.mode), this.emit('floor.changed', e, t, this.currentFloor), (this.currentFloor = e), t === s.PANORAMA)) {
  17231. if ((this.show(), this.shouldShowtags && this.tagsShown)) for (n in this.tags) this.tags[n].show(u.showFloorDuration)
  17232. } else if (
  17233. (t === s.FLOORPLAN || t === s.DOLLHOUSE) &&
  17234. (this.floors.list.forEach(
  17235. function (e, t) {
  17236. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17237. }.bind(this)
  17238. ),
  17239. this.shouldShowtags && this.tagsShown)
  17240. )
  17241. for (n in this.tags) {
  17242. var r = this.tags[n]
  17243. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  17244. }
  17245. var o = this,
  17246. a = e
  17247. A.start(
  17248. function () {},
  17249. u.showFloorDelay,
  17250. function () {
  17251. o.floors.forEach(function (t) {
  17252. t.chunks.forEach(function (e) {
  17253. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  17254. })
  17255. })
  17256. }.bind(this)
  17257. )
  17258. }),
  17259. (t.prototype.toggleExplode = function () {
  17260. this.floors.toggleExplodeHorizontal()
  17261. }),
  17262. (t.prototype.toggleExplodeUp = function () {
  17263. this.floors.toggleExplodeVertical()
  17264. }),
  17265. (t.prototype.nextFloor = function (e) {
  17266. return this.floors.nextFloor(this.currentFloor, e)
  17267. }),
  17268. (t.prototype.addFloor = function (e) {
  17269. this.floors.add(e)
  17270. }),
  17271. (t.prototype.getFloorAtPoint = function (e) {
  17272. return this.floors.getFloorAtPoint(e)
  17273. }),
  17274. (t.prototype.getTagBySid = function (e) {
  17275. return this.tags[e]
  17276. }),
  17277. (t.prototype.addChunk = function (e, t) {
  17278. this.floors.getOrMakeFloor(e).addChunk(t), this.chunks.push(t)
  17279. }),
  17280. (t.prototype.setMode = function (t) {
  17281. if (!this.supportedModes[t]) throw new x('Mode not supported for this model: ' + t)
  17282. this.mode = t
  17283. this.skybox.material.transparent = t == 'panorama' ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17284. this.chunks.forEach(function (e) {
  17285. e.setMode(t)
  17286. })
  17287. }),
  17288. (t.prototype.build = function () {
  17289. this.heroLocations = this.images.getHeroLocations(this.panos)
  17290. var e = function () {
  17291. return (
  17292. !!(this.heroImage && this.heroImage.metadata && this.heroImage.metadata.scan_id && this.panos.get(this.heroImage.metadata.scan_id)) &&
  17293. !this.panos.get(this.heroImage.metadata.scan_id).isAligned()
  17294. )
  17295. }.bind(this)()
  17296. ;(this.has360Views =
  17297. (u.show360Views.enabled &&
  17298. this.heroLocations.some(
  17299. function (e) {
  17300. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17301. }.bind(this)
  17302. )) ||
  17303. e),
  17304. null === this.heroImage && R.warn('No hero image defined.'),
  17305. (this.currentFloor = this.floors.last()),
  17306. this.floors.build(),
  17307. (this.colliders = this.floors.reduce(function (e, t) {
  17308. return e.concat(t.collider.children)
  17309. }, [])),
  17310. this.panos.forEach(
  17311. function (e) {
  17312. e.build1(),
  17313. e.on(
  17314. 'enter',
  17315. function () {
  17316. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17317. }.bind(this)
  17318. )
  17319. }.bind(this)
  17320. )
  17321. let downVec = new THREE.Vector3(0, -1, 0)
  17322. this.panos.forEach(pano => {
  17323. player.raycaster.set(pano.position, downVec)
  17324. let collider = pano.floor.collider.children
  17325. let n = player.raycaster.intersectObjects(collider, true) //add true
  17326. if (n && n[0]) {
  17327. if (n[0].point.y - pano.floorPosition.y > 0.03) {
  17328. //console.error(`${pano.id}, 探测高度${n[0].point.y.toPrecision(5)} 原高度 ${pano.floorPosition.y.toPrecision(5)}, 相差 ${(n[0].point.y - pano.floorPosition.y).toPrecision(5)}`)
  17329. pano.originFloorY = pano.floorPosition.y
  17330. pano.floorPosition.y = n[0].point.y
  17331. }
  17332. }
  17333. //是否需要排除一下相差过高的?因为可能探测到的是长椅这样的
  17334. })
  17335. this.panos.forEach(function (e) {
  17336. e.build2()
  17337. }),
  17338. this.floors.forEach(
  17339. function (e) {
  17340. this.boundingBox.union(e.boundingBox)
  17341. }.bind(this)
  17342. ),
  17343. (this.size = this.boundingBox.size()),
  17344. (this.center = this.boundingBox.center()),
  17345. this.floors.forEach(
  17346. function (e) {
  17347. R.info('Floor ' + e + ': ' + e.children.length + ' chunks, ' + e.panos.length + ' panos.')
  17348. }.bind(this)
  17349. ),
  17350. this.panos.populate_path_graph(),
  17351. (this.skybox = new n(this.boundingBox)),
  17352. (this.skybox.matrixWorldNeedsUpdate = !0),
  17353. this.add(this.skybox)
  17354. //因为一部分漫游点在模型外
  17355. {
  17356. let bounding = new THREE.Box3() //不包含pano的bound
  17357. this.floors.list.forEach(floor => {
  17358. bounding.union(floor.conservativeBoundingBox)
  17359. })
  17360. this.boundWithoutPanos = bounding
  17361. this.sizeWithoutPanos = bounding.size()
  17362. this.centerWithoutPanos = bounding.center()
  17363. /* 如果想居中模型, bound不加pano:
  17364. this.boundingBox = bounding
  17365. this.size = bounding.size()
  17366. this.center = bounding.center() */
  17367. }
  17368. return (
  17369. R.debug('Done building model'),
  17370. 0 < f.raycastsDone && (R.warn('raycasts: ' + f.raycastsDone), R.warn('raycasts skipped: ' + f.raycastsSkipped)),
  17371. this.buildRooms(),
  17372. this.labels.associateWithRooms(this.rooms),
  17373. $.when(this)
  17374. )
  17375. }),
  17376. (t.prototype.loadLabels = function () {
  17377. this.labels = new b(this)
  17378. var e = $.Deferred()
  17379. window.DATA.showingLabels ? (this.showingLabels = true) : ''
  17380. if (!this.showingLabels) return e.resolve()
  17381. var t = g_Prefix + 'data/' + this.sid + '/labels.json'
  17382. return (
  17383. this.labels
  17384. .load(t, !this.isPublic)
  17385. .done(e.resolve.bind(e))
  17386. .fail(function () {
  17387. R.warn('Getting labels failed, not displaying labels.'), e.resolve()
  17388. }),
  17389. e
  17390. )
  17391. }),
  17392. (t.prototype.buildRooms = function () {
  17393. ;(this.rooms = new _(this)), this.rooms.createFromChunks(this.chunks), this.rooms.calcRoomBoundaries()
  17394. }),
  17395. (t.prototype.updateProjectedPanos = function () {
  17396. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17397. }),
  17398. (t.prototype.setProjectedPanos = function (t, i, n) {
  17399. null != n || (n = !0),
  17400. (n = !!n),
  17401. (this.projectedPano0 = t),
  17402. (this.projectedPano1 = i),
  17403. this.skybox.material.setProjectedPanos(t, i, n),
  17404. this.chunks.forEach(function (e) {
  17405. e.materialInside.setProjectedPanos(t, i, n)
  17406. })
  17407. }),
  17408. (t.prototype.setSide = function (t) {
  17409. this.floors.forEach(function (e) {
  17410. e.collider.material.side = t
  17411. })
  17412. }),
  17413. (t.prototype.heroCount = function () {
  17414. return this.heroLocations ? this.heroLocations.length : 0
  17415. }),
  17416. (t.prototype.getHeroDescriptorByIndex = function (e = []) {
  17417. //改 因增加了二级目录
  17418. if (e[0] < 0) return R.warn('Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0.'), null
  17419. if (this.heroCount() < 1) return R.warn('Model.getHeroDescriptorByIndex() -> No hero locations in this model'), null
  17420. var t = this.heroLocations[e[0]]
  17421. if (t.heroLocations && e[1] != void 0) {
  17422. t = t.heroLocations[e[1]]
  17423. }
  17424. return void 0 === t ? (R.warn('Model.getHeroDescriptorByIndex() -> Index ' + e + ' is not a validindex'), null) : t
  17425. }),
  17426. (t.prototype.findPanoramicHero = function () {
  17427. for (var e in this.heroLocations) if (this.heroLocations[e].cameraMode === s.PANORAMA) return this.heroLocations[e]
  17428. return null
  17429. }),
  17430. (t.prototype.listImagePanos = function () {
  17431. var i = [],
  17432. n = this
  17433. return (
  17434. this.images.forEach(function (e) {
  17435. if (e.metadata && e.metadata.scan_id) {
  17436. var t = n.panos.get(e.metadata.scan_id)
  17437. t && (n.supportsTiles || t.isLoaded('high') || i.push(t))
  17438. }
  17439. }),
  17440. i
  17441. )
  17442. }),
  17443. (t.prototype.fadePanoMarkers = function (/* e, t */ opacity, dur, o = {}) {
  17444. //改
  17445. if (window.DATA.hideFloorMarker) return
  17446. var currentPano = player.currentPano
  17447. opacity = void 0 == opacity ? _settings.panorama.markerOpacity : opacity //不传opacity代表显示
  17448. var hideWhenFlyOut = () => {
  17449. var shows = [],
  17450. hides = []
  17451. player.model.panos.forEach(pano => {
  17452. hides.push(pano)
  17453. })
  17454. this.panos.fadeMarkerOpacity(0, dur, [{ toOp: 0, member: hides }])
  17455. }
  17456. if (opacity == 0) {
  17457. hideWhenFlyOut()
  17458. } else {
  17459. if (player.mode == 'panorama' && currentPano) {
  17460. var shows = [],
  17461. hides = []
  17462. player.model.panos.forEach(pano => {
  17463. //是邻近点就显示否则隐藏
  17464. if (currentPano.neighbourPanos[pano.id]) {
  17465. shows.push(pano)
  17466. } else {
  17467. hides.push(pano)
  17468. }
  17469. })
  17470. this.panos.fadeMarkerOpacity(opacity, dur, [
  17471. { toOp: opacity, member: shows },
  17472. { toOp: 0, member: hides }
  17473. ])
  17474. } else if (player.modeTran.split('-')[1] != 'panorama') {
  17475. //飞出后marker隐藏
  17476. hideWhenFlyOut()
  17477. }
  17478. }
  17479. }),
  17480. (t.prototype.setSweepVisibility = function (t) {
  17481. this.panos.forEach(function (e) {
  17482. e.marker && (e.marker.visible = t)
  17483. })
  17484. }),
  17485. (t.prototype.outsideAllowed = function () {
  17486. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  17487. }),
  17488. (O.exports = t)
  17489. }).call(this, '/js/model/Model.js')
  17490. },
  17491. {
  17492. '../constants': 8,
  17493. '../enum/AlignmentType': 17,
  17494. '../enum/RenderOrder': 42,
  17495. '../enum/Viewmode': 51,
  17496. '../exception/BasicException': 55,
  17497. '../label/Label': 90,
  17498. '../loaders/ModelLoader': 105,
  17499. '../loaders/ModelTextureLoader': 106,
  17500. '../loaders/SweepDataLoader': 107,
  17501. '../tag/tag': 123,
  17502. '../tag/tagManager': 124,
  17503. '../objects/BoundingTextureSkybox': 143,
  17504. '../objects/Chunk': 144,
  17505. '../objects/Floor': 146,
  17506. '../objects/Panorama': 148,
  17507. '../objects/Room': 150,
  17508. '../objects/Snapshot': 153,
  17509. '../settings': 166,
  17510. '../shaders': 167,
  17511. '../util/ModelUrls': 177,
  17512. '../util/PanoramaCollection': 178,
  17513. '../util/ajax': 181,
  17514. '../util/common': 185,
  17515. '../util/easing': 186,
  17516. '../util/lerp': 188,
  17517. '../util/logger': 189,
  17518. '../util/math': 190,
  17519. '../util/texture': 194,
  17520. '../util/transitions': 195,
  17521. './../util/browser': 182,
  17522. './../util/showcase': 193,
  17523. './Chunks': 135,
  17524. './FloorCollection': 136,
  17525. './ImageCollection': 137,
  17526. './LabelCollection': 138,
  17527. './RoomCollection': 141,
  17528. events: 202,
  17529. three: 217
  17530. //hot: "hot"
  17531. }
  17532. ],
  17533. 140: [
  17534. function (e, t, i) {
  17535. 'use strict'
  17536. function n() {
  17537. ;(this.modelMap = {}), (this.activeModel = null), (this.modelCount = 0), (this.tileDownloader = null), (this.panoRenderer = null)
  17538. }
  17539. var r = (e('three'), e('../util/common')),
  17540. o = e('../exception/BasicException'),
  17541. a = e('../enum/ModelManagerEvents'),
  17542. s = e('../enum/PanoRendererEvents'),
  17543. l = e('events').EventEmitter
  17544. ;(n.prototype.init = function (e, t, i) {
  17545. ;(this.tileDownloader = e), (this.panoRenderer = t), (this.qualityManager = i), this.bindEvents()
  17546. }),
  17547. (n.prototype.bindEvents = function () {
  17548. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17549. }),
  17550. (n.prototype.onTileRendered = function (e, t, i, n) {}),
  17551. (n.prototype.addModel = function (e) {
  17552. ;(this.modelMap[e.sid] = e), 0 === this.modelCount && this.activateModel(e.sid), this.modelCount++, this.emit(a.ModelAdded)
  17553. }),
  17554. (n.prototype.getModel = function (e) {
  17555. return this.modelMap[e]
  17556. }),
  17557. (n.prototype.activateModel = function (e) {
  17558. var t = this.modelMap[e]
  17559. if (!t) throw new o('Tried to activate invalid model!')
  17560. var i = this.activeModel
  17561. ;(this.activeModel = t),
  17562. this.tileDownloader.setpanoData(t.panos, t.listImagePanos(), t.sid),
  17563. this.tileDownloader.setUrls(t.urls),
  17564. t.panos.forEach(
  17565. function (e) {
  17566. e.attachToPanoRenderer(this.panoRenderer), (e.tileDownloader = this.tileDownloader), (e.qualityManager = this.qualityManager)
  17567. }.bind(this)
  17568. ),
  17569. this.emit(a.ActiveModelChanged, {
  17570. oldModel: i,
  17571. model: t
  17572. })
  17573. }),
  17574. (n.prototype.getActiveModel = function () {
  17575. return this.activeModel
  17576. }),
  17577. r.extend(n, l),
  17578. (t.exports = n)
  17579. },
  17580. {
  17581. '../enum/ModelManagerEvents': 33,
  17582. '../enum/PanoRendererEvents': 35,
  17583. '../exception/BasicException': 55,
  17584. '../util/common': 185,
  17585. events: 202,
  17586. three: 217
  17587. }
  17588. ],
  17589. 141: [
  17590. function (r, l, e) {
  17591. ;(function (e) {
  17592. 'use strict'
  17593. function o() {
  17594. n.call(this)
  17595. }
  17596. var a = r('../objects/Room'),
  17597. t = (r('../settings'), r('../util/logger')),
  17598. i = (r('../util/transitions'), r('../util/easing'), r('../util/common')),
  17599. n = r('../util/IndexedCollection'),
  17600. s = r('./Chunks')
  17601. new t(e),
  17602. i.inherit(o, n),
  17603. (o.prototype.getIndex = function (e) {
  17604. return e.roomId
  17605. }),
  17606. (o.prototype.calcRoomBoundaries = function () {
  17607. this.forEach(function (e) {
  17608. e.calcBoundaries()
  17609. })
  17610. }),
  17611. (o.prototype.createFromChunks = function (e) {
  17612. var n = {
  17613. floorId: -1,
  17614. roomId: -1
  17615. },
  17616. r = {}
  17617. e.forEach(
  17618. function (e) {
  17619. s.parseIdsFromChunkName(e.name, n)
  17620. var t = r[n.roomId]
  17621. if (!t) {
  17622. var i = o.generateRoomId(n.floorId, n.roomId)
  17623. ;(t = new a(n.floorId, i)), this.add(t), (r[n.roomId] = t)
  17624. }
  17625. t.addChunk(e)
  17626. }.bind(this)
  17627. ),
  17628. this.calcRoomBoundaries()
  17629. }),
  17630. (o.generateRoomId = function (e, t) {
  17631. return e + '_' + t
  17632. }),
  17633. (l.exports = o)
  17634. }).call(this, '/js/model/RoomCollection.js')
  17635. },
  17636. {
  17637. '../objects/Room': 150,
  17638. '../settings': 166,
  17639. '../util/IndexedCollection': 175,
  17640. '../util/common': 185,
  17641. '../util/easing': 186,
  17642. '../util/logger': 189,
  17643. '../util/transitions': 195,
  17644. './Chunks': 135
  17645. }
  17646. ],
  17647. 142: [
  17648. function (e, t, i) {
  17649. 'use strict'
  17650. function n(e, t, i) {
  17651. var n = (e = e.clone().expandByScalar(0.01)).size(),
  17652. r = new o.BoxGeometry(n.x, n.y, n.z)
  17653. ;(r.boundingBox = e), o.Mesh.call(this, r, t), this.position.copy(e.center()), (this.frustumCulled = !1), i && this.add(new o.WireframeHelper(this))
  17654. }
  17655. var o = e('three')
  17656. ;((n.prototype = Object.create(o.Mesh.prototype)).constructor = n), (t.exports = n)
  17657. },
  17658. {
  17659. three: 217
  17660. }
  17661. ],
  17662. 143: [
  17663. function (l, c, e) {
  17664. ;(function (e) {
  17665. 'use strict'
  17666. function t(e) {
  17667. s.time('Computing a nice bounding cubemap')
  17668. var t = new r({
  17669. side: i.BackSide,
  17670. transparent: !0
  17671. })
  17672. ;(t.uniforms.modelAlpha.value = 0),
  17673. (t.uniforms.opacity.value = 1 - o.modelAlpha),
  17674. (this.renderOrder = a.boundingSkybox),
  17675. n.call(this, e, t),
  17676. s.timeEnd('Computing a nice bounding cubemap')
  17677. }
  17678. var i = l('three'),
  17679. n = (l('../enum/Viewmode'), l('../shaders'), l('./BoundingMesh')),
  17680. r = l('../materials/ModelTextureMaterial'),
  17681. o = l('../settings'),
  17682. a = l('../enum/RenderOrder'),
  17683. s = new (l('../util/logger'))(e)
  17684. ;((t.prototype = Object.create(n.prototype)).constructor = t), (c.exports = t)
  17685. }).call(this, '/js/objects/BoundingTextureSkybox.js')
  17686. },
  17687. {
  17688. '../enum/RenderOrder': 42,
  17689. '../enum/Viewmode': 51,
  17690. '../materials/ModelTextureMaterial': 118,
  17691. '../settings': 166,
  17692. '../shaders': 167,
  17693. '../util/logger': 189,
  17694. './BoundingMesh': 142,
  17695. three: 217
  17696. }
  17697. ],
  17698. 144: [
  17699. function (e, t, i) {
  17700. 'use strict'
  17701. function n(e) {
  17702. this.materialInside = new s({
  17703. side: r.DoubleSide
  17704. })
  17705. var t = r.UniformsUtils.clone(o.modelOutside.uniforms)
  17706. ;(this.materialOutside = new r.RawShaderMaterial({
  17707. fragmentShader: o.modelOutside.fragmentShader,
  17708. vertexShader: o.modelOutside.vertexShader,
  17709. uniforms: t,
  17710. side: r.FrontSide,
  17711. name: 'chunkOut'
  17712. })),
  17713. r.Mesh.call(this, e.geometry, this.materialInside),
  17714. (this.name = e.name || ''),
  17715. (this.textureName = e.textureName),
  17716. (this.meshUrl = e.meshUrl)
  17717. }
  17718. var r = e('three'),
  17719. o = e('../shaders'),
  17720. a = e('../enum/Viewmode'),
  17721. s = e('../materials/ModelTextureMaterial')
  17722. ;((n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function (e) {
  17723. ;(this.materialInside.uniforms.map.value = e), (this.materialOutside.uniforms.map.value = e)
  17724. }),
  17725. (n.prototype.setMode = function (e) {
  17726. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside
  17727. ;(t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide), (t.transparent = this.material.transparent), (t.uniforms.opacity.value = this.material.uniforms.opacity.value)
  17728. this.material = t
  17729. }),
  17730. (t.exports = n)
  17731. },
  17732. {
  17733. '../enum/Viewmode': 51,
  17734. '../materials/ModelTextureMaterial': 118,
  17735. '../shaders': 167,
  17736. three: 217
  17737. }
  17738. ],
  17739. 145: [
  17740. function (e, t, i) {
  17741. 'use strict'
  17742. function n(e) {
  17743. ;(this.chunksize = e || 10),
  17744. (this.chunks = {}),
  17745. (this.boundingBoxes = {}),
  17746. (this.children = []),
  17747. (this.offset = new m.Vector3(0, 0.5, 0)),
  17748. (this.material = new m.MeshBasicMaterial({
  17749. color: 16777215 * Math.random(),
  17750. side: m.DoubleSide
  17751. }))
  17752. }
  17753. var m = e('three')
  17754. e('../enum/Viewmode'),
  17755. (n.prototype.add = function (e) {
  17756. var t,
  17757. i,
  17758. n,
  17759. r,
  17760. o,
  17761. a,
  17762. s,
  17763. l,
  17764. c,
  17765. h,
  17766. u = e.attributes
  17767. u ? ((t = u.position.array), (i = void 0 !== e.index ? e.index.array : void 0)) : ((t = e.vertices), e.faces)
  17768. var d = new m.Vector3()
  17769. if (i)
  17770. for (n = 0, r = i.length; n < r; n += 3) {
  17771. var p = 3 * i[n],
  17772. f = 3 * i[n + 1],
  17773. g = 3 * i[n + 2]
  17774. ;(o = (t[p] + t[f] + t[g]) / 3),
  17775. (a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3),
  17776. (s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3),
  17777. (c =
  17778. (l = Math.floor(o / this.chunksize) + '.' + Math.floor(a / this.chunksize) + '.' + Math.floor(s / this.chunksize)) in this.chunks
  17779. ? ((h = this.chunks[l]), this.boundingBoxes[l])
  17780. : ((h = this.chunks[l] = []), (this.boundingBoxes[l] = new m.Box3()))),
  17781. 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]),
  17782. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17783. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17784. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17785. }
  17786. else
  17787. for (n = 0, r = t.length; n < r; n += 9)
  17788. (o = (t[n] + t[n + 3] + t[n + 6]) / 3),
  17789. (a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3),
  17790. (s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3),
  17791. (c =
  17792. (l = Math.floor(o / this.chunksize) + '.' + Math.floor(a / this.chunksize) + '.' + Math.floor(s / this.chunksize)) in this.chunks
  17793. ? ((h = this.chunks[l]), this.boundingBoxes[l])
  17794. : ((h = this.chunks[l] = []), (this.boundingBoxes[l] = new m.Box3()))),
  17795. 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]),
  17796. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17797. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17798. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17799. }),
  17800. (n.prototype.build = function () {
  17801. var e = new m.Object3D()
  17802. for (var t in ((e.material = this.material), this.chunks)) {
  17803. var i = this.chunks[t],
  17804. n = new m.BufferGeometry()
  17805. n.addAttribute('position', new m.BufferAttribute(new Float32Array(i), 3)), (n.boundingBox = this.boundingBoxes[t])
  17806. var r = new m.Mesh(n, this.material)
  17807. ;(r.material.visible = !1), e.add(r), (this.chunks[t] = [])
  17808. }
  17809. return e
  17810. }),
  17811. (t.exports = n)
  17812. },
  17813. {
  17814. '../enum/Viewmode': 51,
  17815. three: 217
  17816. }
  17817. ],
  17818. 146: [
  17819. function (e, t, i) {
  17820. 'use strict'
  17821. var n = e('three'),
  17822. r = e('../settings'),
  17823. o = e('../util/common'),
  17824. a = e('../util/lerp'),
  17825. s = e('./ChunkedCollider'),
  17826. l = e('../util/transitions'),
  17827. c = e('../util/easing'),
  17828. h = (e('../objects/Panorama'), e('../enum/RenderOrder'))
  17829. e('../localization/localize')
  17830. function u(e, t, i) {
  17831. n.Object3D.call(this),
  17832. (this.model = e),
  17833. (this.floorIndex = t),
  17834. (this.lang = r.languageTag),
  17835. (this.name = i || 'cn' === r.languageTag ? 'Floor ' + (t + 1) : '第' + (t + 1) + '层'),
  17836. (this.panos = []),
  17837. (this.chunks = []),
  17838. (this.colliderBuilder = new s(3)),
  17839. (this.collider = null),
  17840. (this.center = null),
  17841. (this.boundingBox = new n.Box3()),
  17842. (this.size = null),
  17843. (this.hidden = !1),
  17844. (this.conservativeBoundingBox = new n.Box3()),
  17845. (this.debugColor = 16777215 * Math.random()),
  17846. (this.transition = null)
  17847. }
  17848. ;((u.prototype = Object.create(n.Object3D.prototype)).enter = function (e) {
  17849. this.model.setFloor(this, e)
  17850. }),
  17851. (u.prototype.hide = function (e) {
  17852. if (!this.hidden || this.transition) {
  17853. this.chunks.forEach(function (e) {
  17854. e.material.transparent = !0
  17855. }),
  17856. l.cancel(this.transition)
  17857. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay,
  17858. i = e ? 0 : r.hideFloorDelay / t
  17859. this.transition = l.start(
  17860. a.allUniforms(this.chunks, 'opacity', 0.08),
  17861. t,
  17862. function () {
  17863. this.hidden = !0
  17864. }.bind(this),
  17865. i,
  17866. c.easeInOutQuad
  17867. )
  17868. }
  17869. }),
  17870. (u.prototype.show = function (e) {
  17871. if (this.hidden || this.transition) {
  17872. ;(this.hidden = !1), l.cancel(this.transition)
  17873. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay,
  17874. i = e ? 0 : r.showFloorDelay / t
  17875. this.transition = l.start(
  17876. a.allUniforms(this.chunks, 'opacity', 1),
  17877. t,
  17878. function () {
  17879. this.hidden ||
  17880. this.chunks.forEach(function (e) {
  17881. e.material.transparent = !1
  17882. })
  17883. }.bind(this),
  17884. i,
  17885. c.easeInOutQuad
  17886. )
  17887. }
  17888. }),
  17889. (u.prototype.toggle = function (e, t) {
  17890. ;(e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  17891. }),
  17892. (u.prototype.containsPoint = function (t) {
  17893. return this.collider.children.some(function (e) {
  17894. return e.geometry.boundingBox || e.geometry.computeBoundingBox(), e.geometry.boundingBox.containsPoint(t)
  17895. })
  17896. }),
  17897. (u.prototype.distanceToPoint = function (i) {
  17898. var n = null,
  17899. r = 1 / 0
  17900. return (
  17901. this.collider.children.forEach(function (e) {
  17902. e.geometry.boundingBox || e.geometry.computeBoundingBox()
  17903. var t = e.geometry.boundingBox.distanceToPoint(i)
  17904. ;(!n || t < r) && ((r = t), (n = e))
  17905. }),
  17906. r
  17907. )
  17908. }),
  17909. (u.prototype.addChunk = function (e) {
  17910. ;(e.renderOrder = h.ghostFloor),
  17911. this.add(e),
  17912. this.chunks.push(e),
  17913. this.boundingBox.union(e.geometry.boundingBox),
  17914. (this.size = this.boundingBox.size()),
  17915. this.colliderBuilder.add(e.geometry)
  17916. }),
  17917. (u.prototype.addPano = function (e) {
  17918. this.panos.push(e), this.add(e.skyboxMesh), e.marker && this.add(e.marker)
  17919. if (e.neighbourUUIDs && e.neighbourUUIDs.length) {
  17920. //add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  17921. var t = new n.Vector3(1, 1, 1),
  17922. i = new n.Box3().setFromCenterAndSize(e.position, t)
  17923. this.boundingBox.union(i)
  17924. }
  17925. }),
  17926. (u.prototype.build = function () {
  17927. ;(this.collider = this.colliderBuilder.build(!0)),
  17928. this.add(this.collider),
  17929. (this.center = this.boundingBox.center()),
  17930. this.conservativeBoundingBox.copy(this.boundingBox),
  17931. (this.conservativeBoundingBox.min.y = o.lowerMedian(
  17932. this.collider.children.map(function (e) {
  17933. return e.geometry.boundingBox.min.y
  17934. }),
  17935. 5
  17936. )),
  17937. (this.conservativeBoundingBox.max.y = o.lowerMedian(
  17938. this.collider.children.map(function (e) {
  17939. return e.geometry.boundingBox.max.y
  17940. }),
  17941. 5
  17942. )),
  17943. (this.colliderBuilder = null)
  17944. }),
  17945. (u.prototype.toShortString = function () {
  17946. return o.nth(this.floorIndex + 1)
  17947. }),
  17948. (u.prototype.toString = function () {
  17949. return this.name
  17950. }),
  17951. (t.exports = u)
  17952. },
  17953. {
  17954. '../enum/RenderOrder': 42,
  17955. '../localization/localize': 108,
  17956. './strings-cn-CN': 109,
  17957. '../objects/Panorama': 148,
  17958. '../settings': 166,
  17959. '../util/common': 185,
  17960. '../util/easing': 186,
  17961. '../util/lerp': 188,
  17962. '../util/transitions': 195,
  17963. './ChunkedCollider': 145,
  17964. three: 217
  17965. }
  17966. ],
  17967. 147: [
  17968. function (e, t, i) {
  17969. 'use strict'
  17970. function n(e) {
  17971. ;(this.player = e), (this.obj3d = null), (this.UP = new u.Vector3(0, 1, 0))
  17972. }
  17973. var u = e('three'),
  17974. d = e('../settings')
  17975. ;(n.prototype.prefs = {
  17976. linewidth: 3,
  17977. height: 0.07,
  17978. opacity: 0.45,
  17979. endScale: 0.05
  17980. }),
  17981. (n.prototype.discard = function () {
  17982. if (this.obj3d) {
  17983. var e = this.obj3d.parent
  17984. e && e.remove(this.obj3d)
  17985. }
  17986. this.obj3d = null
  17987. }),
  17988. (n.prototype.draw = function () {
  17989. if ((this.discard(), d.showNeighbors)) {
  17990. var e = this.player.currentPano.floor
  17991. this.obj3d = new u.Object3D()
  17992. var t = this.player.model.panos.getNeighbours(this.player.currentPano),
  17993. i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position)
  17994. i.y += this.prefs.height
  17995. var n = 0.1525,
  17996. r = new u.Matrix4()
  17997. for (var o in t)
  17998. if (t[o]) {
  17999. var a = this.player.model.panos.get(o),
  18000. s = (a.position.clone().sub(this.player.model.position), a.position.clone().sub(a.floorPosition)),
  18001. l = a.floorPosition.clone().sub(this.player.model.position)
  18002. l.y += this.prefs.height
  18003. var c = new u.Geometry()
  18004. 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)),
  18005. c.vertices.push(
  18006. new u.Vector3(0, -0.255, 0),
  18007. new u.Vector3(0.255, -0.255, 0),
  18008. new u.Vector3(0.255, n, 0),
  18009. new u.Vector3(-n, n, 0),
  18010. new u.Vector3(-n, 0.127, 0),
  18011. new u.Vector3(-0.19, 0.1, 0),
  18012. new u.Vector3(-0.19, -0.2032, 0),
  18013. new u.Vector3(-n, -0.2286, 0),
  18014. new u.Vector3(-n, -0.255, 0),
  18015. new u.Vector3(0, -0.255, 0)
  18016. ),
  18017. r.identity().setPosition(s),
  18018. c.applyMatrix(r),
  18019. c.vertices.push(new u.Vector3(0, -this.prefs.endScale, 0)),
  18020. c.vertices.push(
  18021. new u.Vector3(-this.prefs.endScale, -this.prefs.endScale, 0),
  18022. new u.Vector3(-this.prefs.endScale, this.prefs.endScale, 0),
  18023. new u.Vector3(this.prefs.endScale, this.prefs.endScale, 0),
  18024. new u.Vector3(this.prefs.endScale, -this.prefs.endScale, 0)
  18025. ),
  18026. r.lookAt(l, i, this.UP).setPosition(l),
  18027. c.applyMatrix(r),
  18028. c.vertices.push(l, i)
  18029. var h = new u.Line(
  18030. c,
  18031. new u.LineBasicMaterial({
  18032. color: a.debugColor.getHex(),
  18033. transparent: !0,
  18034. opacity: this.prefs.opacity,
  18035. depthWrite: !1,
  18036. name: 'sLine' + o,
  18037. linewidth: this.prefs.linewidth
  18038. })
  18039. )
  18040. this.obj3d.add(h)
  18041. }
  18042. e.add(this.obj3d)
  18043. }
  18044. }),
  18045. (n.prototype.update = function () {
  18046. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  18047. }),
  18048. (t.exports = n)
  18049. },
  18050. {
  18051. '../settings': 166,
  18052. three: 217
  18053. }
  18054. ],
  18055. 148: [
  18056. function (S, M, e) {
  18057. ;(function (e) {
  18058. 'use strict'
  18059. function r(e, t, i, n) {
  18060. ;(this.model = e),
  18061. (this.id = t),
  18062. (this.alignmentType = i.alignmentType || c.ALIGNED),
  18063. (this.neighbourUUIDs = i.neighbours),
  18064. (this.neighbourPanos = null),
  18065. (this.floor = null),
  18066. (this.floorIndex = i.floor),
  18067. (this.failedLoadingAt = 0),
  18068. (this.maxLoadRetries = 4),
  18069. (this.origin = i.position.clone()),
  18070. (this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0, -5, 0) : i.position.clone()),
  18071. (this.quaternion = i.quaternion.clone()),
  18072. (this.skyboxMesh = new s.Mesh(E)),
  18073. this.skyboxMesh.position.copy(this.position),
  18074. this.skyboxMesh.quaternion.copy(this.quaternion),
  18075. (this.skyboxMesh.name = 'skybox'),
  18076. (this.skyboxMesh.visible = !1),
  18077. this.skyboxMesh.updateMatrix(),
  18078. this.skyboxMesh.updateMatrixWorld(),
  18079. (this.marker = null),
  18080. (this.showFloorMarker = this.showFloorMarker = !window.DATA.hideFloorMarker)
  18081. if (this.isAligned()) {
  18082. ;(this.marker = new s.Mesh(
  18083. _,
  18084. new s.MeshBasicMaterial({
  18085. map: b,
  18086. side: s.DoubleSide,
  18087. opacity: 0,
  18088. transparent: !0,
  18089. depthWrite: !1
  18090. })
  18091. )),
  18092. (this.marker.visible = false) //改:先不显示,之后根据opacity显示
  18093. ;(this.marker.renderOrder = l.panoMarker), (this.marker.name = 'marker'), (this.marker.pano = this).marker.layers.set(v.PANOMARKERS), this.marker.updateMatrixWorld()
  18094. if (!window.DATA.hideFloorMarker) {
  18095. //xzw
  18096. let opa = this.marker.material.opacity
  18097. Object.defineProperty(this.marker.material, 'opacity', {
  18098. get: function () {
  18099. return opa
  18100. },
  18101. set: o => {
  18102. opa = o
  18103. //if(o>0)console.log('o>0',this.pano.id)
  18104. convertTool.updateVisible(this.marker, 'hideWhenZeroOpa', o != 0)
  18105. }
  18106. })
  18107. }
  18108. a.colorMarkerOnLoad &&
  18109. this.on('load', function () {
  18110. this.marker.material.color.set(65280)
  18111. })
  18112. }
  18113. ;(this.debugColor = new s.Color().setHSL(0.06 + 0.53 * Math.random(), 0.8 + 0.2 * Math.random(), 0.5 + 0.2 * Math.random())),
  18114. (this.floorPosition = i.puck ? i.puck.clone() : null),
  18115. (this.tiled = n),
  18116. this.tiled
  18117. ? (this.solidSkybox = null)
  18118. : ((this.solidSkybox = new s.Texture([null, null, null, null, null, null])),
  18119. (this.solidSkybox.flipY = !1),
  18120. a.minimalMemoryMode && ((this.solidSkybox.minFilter = s.LinearFilter), (this.solidSkybox.magFilter = s.LinearFilter), (this.solidSkybox.generateMipmaps = !1))),
  18121. (this.zoomed = !1),
  18122. (this.panoRenderer = null),
  18123. (this.qualityManager = null),
  18124. (this.tileDownloader = null),
  18125. (this.tiledPanoRenderTarget = null),
  18126. (this.minimumTiledPanoLoaded = !1),
  18127. (this.highestPartialTileRenderOpCompleted = 0),
  18128. (this.highestFullTileRenderOpCompleted = 0),
  18129. (this.shouldRedrawOnBaseLoaded = !1),
  18130. (this.lockUntilRenderingComplete = !1),
  18131. a.colorMarkerOnLoad &&
  18132. this.on('load', function () {
  18133. this.marker.material.color.set(65280)
  18134. }),
  18135. (e = new s.TextureLoader()).setCrossOrigin(!0)
  18136. var r = e.load('images/texture.jpg')
  18137. if (
  18138. ((this.vrMarker = new s.Mesh(
  18139. new s.OctahedronGeometry(0.1, 0),
  18140. new s.MeshLambertMaterial({
  18141. color: 16777215,
  18142. transparent: !0,
  18143. opacity: 0.75,
  18144. map: r
  18145. })
  18146. )),
  18147. (this.vrMarker.boluoType = 'vr'),
  18148. (this.vrMarker.position.z = 1),
  18149. (this.vrMarker.enabled = !0),
  18150. (this.vrMarker.visible = !1),
  18151. (window.vrMarkers = window.vrMarkers || []),
  18152. window.vrMarkers.push(this.vrMarker),
  18153. this.marker && this.marker.add(this.vrMarker),
  18154. a.showAxis &&
  18155. (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0, 1, 0), new s.Vector3(0, 0, 0), 1, 255)),
  18156. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0, 0, 1), new s.Vector3(0, 0, 0), 1, 16711680)),
  18157. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1, 0, 0), new s.Vector3(0, 0, 0), 1, 65280))),
  18158. this.adjustAngleEnable)
  18159. ) {
  18160. ;(i = new s.Quaternion()).setFromAxisAngle(new s.Vector3(1, 0, 0), this.adjustAngleX), this.skyboxMesh.quaternion.multiply(i)
  18161. var o = new s.Quaternion()
  18162. o.setFromAxisAngle(new s.Vector3(0, 1, 0), this.adjustAngleY),
  18163. this.skyboxMesh.quaternion.multiply(o),
  18164. (n = new s.Quaternion()).setFromAxisAngle(new s.Vector3(0, 0, 1), this.adjustAngleZ),
  18165. this.skyboxMesh.quaternion.multiply(n),
  18166. this.skyboxMesh.updateMatrix(),
  18167. this.skyboxMesh.updateMatrixWorld(),
  18168. this.model.updateProjectedPanos()
  18169. }
  18170. }
  18171. var i,
  18172. t,
  18173. s = S('three'),
  18174. n = S('../util/logger'),
  18175. a = S('../settings'),
  18176. l = (S('../enum/Viewmode'), S('../enum/RenderOrder')),
  18177. c = S('../enum/AlignmentType'),
  18178. o = (S('../util/common'), S('../util/transitions')),
  18179. h = S('../util/lerp'),
  18180. u = S('../util/ajax'),
  18181. d = S('../util/texture'),
  18182. p = S('../util/panorama'),
  18183. f = (S('../enum/TileDownloaderEvents'), S('../enum/PanoramaEvents')),
  18184. g = S('../enum/PanoRendererEvents'),
  18185. m = S('../enum/PanoSizeClass'),
  18186. v = S('../enum/RenderLayers'),
  18187. y = (S('../scene/SceneRenderer'), S('../enum/GLCubeFaces'), S('../exception/BasicException')),
  18188. A = S('../tile/TileUtils'),
  18189. C = S('events').EventEmitter,
  18190. I = new n(e),
  18191. E = new s.SphereBufferGeometry(0.1),
  18192. _ = new s.PlaneBufferGeometry(0.35, 0.35, 1, 1),
  18193. b = d.load('images/marker.png')
  18194. b.anisotropy = 4 //add
  18195. ;((r.prototype = Object.create(C.prototype)).enter =
  18196. ((t = null),
  18197. function () {
  18198. this.setZoomed(!1),
  18199. this.emit('enter', {
  18200. oldPano: t,
  18201. newPano: this
  18202. }),
  18203. (t = this)
  18204. })),
  18205. (r.prototype.exit = function () {
  18206. this.tiled
  18207. ? (this.clearWaitDeferreds(),
  18208. (this.minimumTiledPanoLoaded = !1),
  18209. (this.tiledPanoRenderTarget = null),
  18210. this.setZoomed(!1),
  18211. this.panoRenderer.deactivateTiledPano(this),
  18212. (this.highestPartialTileRenderOpCompleted = 0),
  18213. (this.highestFullTileRenderOpCompleted = 0))
  18214. : (this.solidSkybox.dispose(), (this.solidSkybox.loaded = !1), (this.solidSkybox.version = 0)),
  18215. this.emit('exit')
  18216. }),
  18217. (r.prototype.hoverOn = function (e) {
  18218. this.marker &&
  18219. (o.start(h.property(this.marker.material, 'opacity', a[e].markerOpacityOnHover), 250), a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite('HIT', 12525854))
  18220. }),
  18221. (r.prototype.hoverOff = function (e) {
  18222. this.marker && o.start(h.property(this.marker.material, 'opacity', a[e].markerOpacity), 250)
  18223. }),
  18224. (r.prototype.build1 = function () {
  18225. ;(this.floor =
  18226. this.floor ||
  18227. this.model.floors.get(this.floorIndex) ||
  18228. (this.model.floors.list.length == 1 ? this.model.floors.list[0] : this.raycastToFindFloor()) ||
  18229. this.model.getFloorAtPoint(this.position)), //改
  18230. this.floor.addPano(this)
  18231. ;(this.floorPosition = this.floorPosition || this.raycastFloorPosition()),
  18232. (this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos()),
  18233. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  18234. this.neighbourUUIDs = this.neighbourUUIDs || [] //add
  18235. }),
  18236. (r.prototype.build2 = function () {
  18237. ;(this.floorPosition = this.floorPosition || this.interpolateFloorPosition()), (this.height = this.position.distanceTo(this.floorPosition)), this.placeMarker()
  18238. }),
  18239. (r.prototype.interpolateFloorPosition = function () {
  18240. var e = this.model.panos
  18241. .filter(r.filters.isNeighbourPanoTo(this))
  18242. .filter(function (e) {
  18243. return !!e.floorPosition
  18244. })
  18245. .sort(
  18246. function (e, t) {
  18247. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  18248. }.bind(this)
  18249. ),
  18250. t = this.position.clone()
  18251. return 2 <= e.length ? (t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2) : t.add(a.noMeshFloorPositionOffset), t
  18252. }),
  18253. (r.prototype.raycastFloorPosition = function () {
  18254. I.warn('Performance warning: Raycasting to find floor position')
  18255. var e = new s.Raycaster(this.position, new s.Vector3(0, -1, 0)).intersectObjects(this.model.colliders)
  18256. return e.length ? e[0].point : null
  18257. }),
  18258. (r.prototype.raycastToFindFloor =
  18259. ((i = [
  18260. new s.Vector3(0, -1, 0),
  18261. new s.Vector3(1, -1, 0),
  18262. new s.Vector3(0, -1, 1),
  18263. new s.Vector3(-1, -1, 0),
  18264. new s.Vector3(0, -1, -1),
  18265. new s.Vector3(1, 0, 0),
  18266. new s.Vector3(0, 0, 1),
  18267. new s.Vector3(-1, 0, 0),
  18268. new s.Vector3(0, 0, -1)
  18269. ]),
  18270. function () {
  18271. I.warn('Performance warning: Raycasting to find floor index')
  18272. for (var e = 0; e < i.length; e++) {
  18273. var t = new s.Raycaster(this.position.clone(), i[e].clone()).intersectObjects(this.model.colliders)
  18274. if (t.length) return t[0].object.parent.parent
  18275. }
  18276. return null
  18277. })),
  18278. (r.prototype.placeMarker = function () {
  18279. this.marker &&
  18280. (this.marker.position.copy(this.floorPosition),
  18281. (this.marker.position.y += 0.1), //经常有marker比地面低,所以多往上调5cm
  18282. this.marker.lookAt(new s.Vector3(0, 1, 0).add(this.marker.position)))
  18283. }),
  18284. (r.prototype.translate = function (e) {
  18285. this.position.add(e), this.floorPosition.add(e)
  18286. }),
  18287. (r.prototype.findClosestMidtpointPanoTo = function (e) {
  18288. return new s.Vector3().addVectors(this.position, e.position).divideScalar(2), this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  18289. }),
  18290. (r.prototype.attachToPanoRenderer = function (e) {
  18291. ;(this.panoRenderer = e),
  18292. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  18293. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  18294. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  18295. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  18296. })
  18297. var w,
  18298. T,
  18299. x = {}
  18300. ;(r.prototype.getWaitDeferred = function (e) {
  18301. var t = x[this.id]
  18302. t || ((t = {}), (x[this.id] = t))
  18303. var i = t[e]
  18304. return (
  18305. i ||
  18306. ((i = {
  18307. deferred: $.Deferred(),
  18308. active: !1
  18309. }),
  18310. (t[e] = i)),
  18311. i
  18312. )
  18313. }),
  18314. (r.prototype.resetWaitDeferred = function (e) {
  18315. var t = this.getWaitDeferred(e)
  18316. ;(t.active = !1), (t.deferred = $.Deferred())
  18317. }),
  18318. (r.prototype.clearWaitDeferreds = function () {
  18319. var e = x[this.id]
  18320. for (var t in (e || ((e = {}), (x[this.id] = e)), e))
  18321. if (e.hasOwnProperty(t)) {
  18322. var i = e[t]
  18323. ;(i.active = !1), (i.deferred = $.Deferred())
  18324. }
  18325. }),
  18326. (r.prototype.loadTiledPano =
  18327. (new s.Vector3(),
  18328. (w = []),
  18329. (T = []),
  18330. function (e, t, i, n, r, o) {
  18331. null != n || (n = !0), null != r || (r = !0)
  18332. var a = this.getWaitDeferred(e),
  18333. s = a.deferred,
  18334. l = null,
  18335. c = null
  18336. if ((i && ('number' == typeof i ? (l = i) : ((l = i.hFov), (c = i.vFov))), !this.isLoaded(e))) {
  18337. if (!a.active) {
  18338. if (((a.active = !0), i)) {
  18339. var h = A.matchingTilesInDirection(this, e, t, l, c)
  18340. ;(w[this.id + ':' + e] = {
  18341. tileCount: 0,
  18342. targetTileCount: h
  18343. }),
  18344. I.info('Loading partial pano: ' + this.id + ' with ' + h + ' tiles')
  18345. }
  18346. T[this.id] ||
  18347. ((T[this.id] = !0),
  18348. this.on(
  18349. f.LoadComplete,
  18350. function (e, t) {
  18351. var i = this.getWaitDeferred(e).deferred
  18352. i && 'pending' === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t), this.resetWaitDeferred(e))
  18353. }.bind(this)
  18354. ),
  18355. this.on(
  18356. f.LoadFailed,
  18357. function (e) {
  18358. var t = this.getWaitDeferred(e).deferred
  18359. t && 'pending' === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e), this.resetWaitDeferred(e))
  18360. }.bind(this)
  18361. ),
  18362. this.on(
  18363. f.TileLoaded,
  18364. function (e, t, i) {
  18365. var n = this.getWaitDeferred(e).deferred
  18366. if (n && 'pending' === n.state()) {
  18367. n.notify(e, t, i)
  18368. var r = w[this.id + ':' + e]
  18369. r && (r.tileCount++, r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0), n.resolve(e, i), this.resetWaitDeferred(e)))
  18370. }
  18371. }.bind(this)
  18372. ))
  18373. }
  18374. this.tileDownloader.clearForceQueue(),
  18375. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  18376. (this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n)),
  18377. this.panoRenderer.renderPanoTiles(this.id, t, r)
  18378. }
  18379. return s.promise()
  18380. })),
  18381. (r.prototype.onUploadAttemptedForAllTiles = function (e, t, i) {
  18382. e === this.id &&
  18383. t === this.qualityManager.getPanoSize(m.BASE) &&
  18384. this.shouldRedrawOnBaseLoaded &&
  18385. ((this.shouldRedrawOnBaseLoaded = !1), this.panoRenderer.resetRenderStatus(this.id, !0, !1), this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18386. }),
  18387. (r.prototype.onTileRendered = function (e, t, i, n) {
  18388. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18389. }),
  18390. (r.prototype.onPanoRendered = function (e, t, i, n) {
  18391. e === this.id &&
  18392. ((this.minimumTiledPanoLoaded = !0),
  18393. this.updateSkyboxForZoomLevel(),
  18394. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18395. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18396. this.emit('load', t),
  18397. this.model.emit('load', this),
  18398. this.emit(f.LoadComplete, t, i))
  18399. }),
  18400. (r.prototype.setZoomed = function (e) {
  18401. ;(this.zoomed = e), this.updateSkyboxForZoomLevel()
  18402. }),
  18403. (r.prototype.ensureSkyboxReadyForRender = function () {
  18404. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0), (this.solidSkybox.loaded = !0))
  18405. }),
  18406. (r.prototype.updateSkyboxForZoomLevel = function () {
  18407. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18408. }),
  18409. (r.prototype.getSkyboxTexture = function () {
  18410. return this.tiled ? (this.minimumTiledPanoLoaded ? (this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture) : null) : this.solidSkybox
  18411. }),
  18412. (r.prototype.onTileRenderFail = function (e, t, i) {
  18413. e === this.id && this.emit(f.LoadFailed, t)
  18414. }),
  18415. (r.prototype.isLoaded = function (e) {
  18416. if (this.tiled) {
  18417. if (e && 'string' == typeof e) throw new y('Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass')
  18418. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18419. }
  18420. if (e && 'number' == typeof e) throw new y('Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.')
  18421. return !!this.solidSkybox.high || e in this.solidSkybox
  18422. }),
  18423. (r.prototype.loadCube = function (a) {
  18424. if (this.isLoaded(a)) return I.info('Skipping load of pano, already loaded'), $.when()
  18425. this.emit('loading', a), this.model.emit('loading', this)
  18426. var n = p.getCubemapUrls(this.model.urls, this.id, a),
  18427. e = n.filter(function (e) {
  18428. return !e
  18429. })
  18430. '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)))
  18431. var t = 0,
  18432. i = [0, 1, 2, 3, 4, 5].map(
  18433. function (e, t, i) {
  18434. return u.getImage(n[t])
  18435. }.bind(this)
  18436. )
  18437. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(
  18438. function (e, t, i, n, r, o) {
  18439. return (
  18440. (this.solidSkybox[a] = [e, t, i, n, r, o]),
  18441. ('high' !== a && this.solidSkybox.high) || ((this.solidSkybox.image = this.solidSkybox[a]), (this.solidSkybox.low = null)),
  18442. (this.solidSkybox.needsUpdate = !0),
  18443. this.emit('load', a),
  18444. this.model.emit('load', this),
  18445. this
  18446. )
  18447. }.bind(this),
  18448. function () {
  18449. I.error('Downloading cubemap for pano', this.id, 'failed'), (this.failedLoadingAt = Date.now())
  18450. }.bind(this),
  18451. function () {
  18452. return $.when(++t, 6)
  18453. }
  18454. )
  18455. }),
  18456. (r.raycastsSkipped = 0),
  18457. (r.raycastsDone = 0),
  18458. (r.prototype.findNeighourPanos = function () {
  18459. return (
  18460. this.model.panos.setNeighbour(this.id, this.id, !1),
  18461. this.model.panos.forEach(
  18462. function (e) {
  18463. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18464. var t = this.position.distanceTo(e.position)
  18465. if (t > a.panoramaNeighbourMaxDistance) return this.model.panos.setNeighbour(this, e, !1), void r.raycastsSkipped++
  18466. var i = e.position.clone().sub(this.position).normalize(),
  18467. n = new s.Raycaster(this.position, i.clone(), 0, t).intersectObjects(this.model.colliders)
  18468. r.raycastsDone++,
  18469. this.model.panos.setNeighbour(this, e, 0 === n.length),
  18470. a.showNeighbourRaycasts &&
  18471. (n.length
  18472. ? this.floor.model.add(new s.ArrowHelper(i, this.position, n[0].distance, 16711680))
  18473. : this.floor.model.add(new s.ArrowHelper(i, this.position, t, 16777215, 0, 0)))
  18474. }
  18475. }.bind(this)
  18476. ),
  18477. this.model.panos.neighbourMap[this.id]
  18478. )
  18479. }),
  18480. (r.prototype.worldPosition = function () {
  18481. return this.position
  18482. }),
  18483. /*r.prototype.addTextSprite = function(text, color, parent, scale=1) {
  18484. this.removeTextSprite();
  18485. var ratio = 16;
  18486. var i = document.createElement("canvas")
  18487. , n = i.getContext("2d");
  18488. i.width = 1024,
  18489. i.height = i.width / ratio;
  18490. n.font = " 30px Arial",
  18491. n.fillStyle = "white";
  18492. var r = n.measureText(e).width;
  18493. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  18494. var o = new s.Texture(i);
  18495. o.needsUpdate = !0;
  18496. var a = new s.SpriteMaterial({
  18497. map: o,
  18498. color: color || 16428055,
  18499. depthTest:false
  18500. });
  18501. this.text3d = new s.Sprite(a)
  18502. if(parent){
  18503. parent.add(this.text3d)
  18504. }else{
  18505. this.text3d.position.copy(this.skyboxMesh.position)
  18506. this.floor.add(this.text3d)
  18507. }
  18508. this.text3d.scale.y = scale/ratio
  18509. this.text3d.scale.x = scale
  18510. }
  18511. r.prototype.removeTextSprite = function() {
  18512. this.text3d && (this.text3d.parent.remove(this.text3d),
  18513. this.text3d.material.map.dispose(),
  18514. this.text3d = null)
  18515. } */
  18516. (r.prototype.addTextSprite = function (text = this.id, color, parent, scale = 1) {
  18517. this.removeTextSprite()
  18518. this.label = new TextSprite({
  18519. /* sizeInfo: {
  18520. minSize: 50,
  18521. maxSize: 300,
  18522. nearBound: 0.2,
  18523. farBound: Math.max(20, this.model.size.length() / 3),
  18524. farBoundPlan: 250,
  18525. }, */
  18526. renderOrder: 8,
  18527. backgroundColor: { r: 255, g: 255, b: 255, a: 0 },
  18528. textColor: { r: 255, g: 255, b: 255, a: 1 },
  18529. textshadowColor: '#888',
  18530. text,
  18531. fontsize: 20 * scale
  18532. })
  18533. if (color) {
  18534. this.label.children[0].material.color.set(color)
  18535. }
  18536. if (parent) {
  18537. parent.add(this.label)
  18538. this.label.position.z = 0.1
  18539. } else {
  18540. let position = this.floorPosition.clone()
  18541. position.y += 0.4
  18542. this.label.position.copy(position)
  18543. this.floor.add(this.label2)
  18544. }
  18545. }),
  18546. (r.prototype.removeTextSprite = function () {
  18547. this.label && this.label.dispose()
  18548. }),
  18549. (r.prototype.isAligned = function () {
  18550. return this.alignmentType === c.ALIGNED
  18551. }),
  18552. (r.filters = {
  18553. inDirection: function (t, i, n) {
  18554. return function (e) {
  18555. return e.position.clone().sub(t).normalize().dot(i) > n
  18556. }
  18557. },
  18558. inFloorDirection: function (t, i, n) {
  18559. return function (e) {
  18560. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18561. }
  18562. },
  18563. inPanoDirection: function (n, r, o) {
  18564. return (
  18565. (o = a.navigation.panoScores ? a.navigation.filterStrictness : o),
  18566. function (e) {
  18567. var t = e.floorPosition.clone().sub(n).normalize(),
  18568. i = e.position.clone().sub(n).normalize()
  18569. return t.dot(r) > o || i.dot(r) > o
  18570. }
  18571. )
  18572. },
  18573. atFloor: function (t) {
  18574. return function (e) {
  18575. return !t || e.floor === t
  18576. }
  18577. },
  18578. not: function (t) {
  18579. return function (e) {
  18580. return e !== t
  18581. }
  18582. },
  18583. notIn: function (t) {
  18584. return function (e) {
  18585. return -1 === t.indexOf(e)
  18586. }
  18587. },
  18588. isLoaded: function () {
  18589. return function (e) {
  18590. return e.isLoaded()
  18591. }
  18592. },
  18593. isNotLoaded: function () {
  18594. return function (e) {
  18595. return !e.isLoaded()
  18596. }
  18597. },
  18598. isCloseEnoughTo: function (t, i) {
  18599. return function (e) {
  18600. return t.distanceTo(e.floorPosition) < i
  18601. }
  18602. },
  18603. hasMinimumHeightDifferenceTo: function (t, i) {
  18604. return function (e) {
  18605. return Math.abs(e.position.y - t.y) > i
  18606. }
  18607. },
  18608. isNotBehindNormal: function (t, i) {
  18609. var n = new s.Vector3()
  18610. return (
  18611. (i = i.clone()),
  18612. function (e) {
  18613. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18614. }
  18615. )
  18616. },
  18617. isNeighbourPanoTo: function (t) {
  18618. return function (e) {
  18619. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18620. }
  18621. },
  18622. isNeighbourOfNeighbourTo: function (n) {
  18623. return function (i) {
  18624. return (
  18625. !!n.neighbourPanos[i.id] ||
  18626. n.neighbourUUIDs.some(function (e) {
  18627. var t = n.model.panos.get(e)
  18628. return !!t && t.neighbourPanos[i.id]
  18629. })
  18630. )
  18631. }
  18632. },
  18633. isNotRecentlyFailed: function (t) {
  18634. return function (e) {
  18635. return Date.now() - e.failedLoadingAt > t
  18636. }
  18637. },
  18638. isOnVisibleFloor: function () {
  18639. return function (e) {
  18640. return !e.floor.hidden
  18641. }
  18642. },
  18643. isPanoAligned: function () {
  18644. return function (e) {
  18645. return e.isAligned()
  18646. }
  18647. }
  18648. }),
  18649. (r.sortFunctions = {
  18650. distanceToPoint: function (i) {
  18651. return function (e, t) {
  18652. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18653. }
  18654. },
  18655. floorDistanceToPoint: function (i) {
  18656. return function (e, t) {
  18657. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18658. }
  18659. },
  18660. choose: function (i) {
  18661. return function (e, t) {
  18662. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18663. }
  18664. }
  18665. }),
  18666. (r.scoreFunctions = {
  18667. distance: function (t, i) {
  18668. return (
  18669. (i = i || a.navigation.distanceFactor),
  18670. function (e) {
  18671. return t ? t.position.distanceTo(e.position) * i : 0
  18672. }
  18673. )
  18674. },
  18675. distanceSquared: function (t, i) {
  18676. return (
  18677. (i = i || a.navigation.distanceFactor),
  18678. function (e) {
  18679. return t ? t.position.distanceToSquared(e.position) * i : 0
  18680. }
  18681. )
  18682. },
  18683. direction: function (t, i) {
  18684. return function (e) {
  18685. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18686. }
  18687. },
  18688. angle: function (t, i) {
  18689. return function (e) {
  18690. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18691. }
  18692. },
  18693. inFieldOfView: function (t, i) {
  18694. return function (e) {
  18695. return 0.75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18696. }
  18697. },
  18698. optionality: function (t) {
  18699. return function (e) {
  18700. return (
  18701. e.neighbourUUIDs.filter(function (e) {
  18702. return !(e in t.neighbourUUIDs) && e !== t.id
  18703. }).length * a.navigation.optionalityFactor
  18704. )
  18705. }
  18706. },
  18707. penalizeHeightDifferenceUnder: function (t, i) {
  18708. return function (e) {
  18709. return t.y - e.position.y < i ? -20 : 0
  18710. }
  18711. }
  18712. }),
  18713. (M.exports = r)
  18714. }).call(this, '/js/objects/Panorama.js')
  18715. },
  18716. {
  18717. '../enum/AlignmentType': 17,
  18718. '../enum/GLCubeFaces': 25,
  18719. '../enum/PanoRendererEvents': 35,
  18720. '../enum/PanoSizeClass': 36,
  18721. '../enum/PanoramaEvents': 37,
  18722. '../enum/RenderLayers': 41,
  18723. '../enum/RenderOrder': 42,
  18724. '../enum/TileDownloaderEvents': 45,
  18725. '../enum/Viewmode': 51,
  18726. '../exception/BasicException': 55,
  18727. '../scene/SceneRenderer': 158,
  18728. '../settings': 166,
  18729. '../tile/TileUtils': 174,
  18730. '../util/ajax': 181,
  18731. '../util/common': 185,
  18732. '../util/lerp': 188,
  18733. '../util/logger': 189,
  18734. '../util/panorama': 191,
  18735. '../util/texture': 194,
  18736. '../util/transitions': 195,
  18737. events: 202,
  18738. three: 217
  18739. }
  18740. ],
  18741. 149: [
  18742. function (e, t, i) {
  18743. 'use strict'
  18744. function n(e) {
  18745. var t = r.UniformsUtils.clone(c.waypoint.uniforms)
  18746. ;(t.map.value = d), (t.opacity.value = 0), t.color.value.set(o.reticuleColor), (t.showMouseMarker = !window.DATA.hideMouseMarker)
  18747. r.Mesh.call(
  18748. this,
  18749. new r.PlaneBufferGeometry(0.4, 0.4, 1, 1),
  18750. new r.RawShaderMaterial({
  18751. side: r.DoubleSide,
  18752. depthWrite: !1,
  18753. depthTest: !1,
  18754. transparent: !0,
  18755. vertexShader: c.waypoint.vertexShader,
  18756. fragmentShader: c.waypoint.fragmentShader,
  18757. uniforms: t,
  18758. name: 'waypoint',
  18759. opacity: 0,
  18760. visible: t.showMouseMarker
  18761. })
  18762. ),
  18763. this.layers.set(h.RETICULE),
  18764. (this.renderOrder = u.reticule),
  18765. (this.player = e),
  18766. (this.direction = new r.Vector3()),
  18767. (this.hidden = !0),
  18768. (this.mouseLastMoveTime = Date.now())
  18769. }
  18770. var r = e('three'),
  18771. o = e('../settings'),
  18772. a = e('../util/transitions'),
  18773. s = e('../util/texture'),
  18774. l = e('../util/lerp'),
  18775. c = e('../shaders'),
  18776. h = e('../enum/RenderLayers'),
  18777. u = e('../enum/RenderOrder'),
  18778. d = s.load('images/reticule.png')
  18779. d.anisotropy = 4 //各向异性
  18780. ;((n.prototype = Object.create(r.Mesh.prototype)).move = function (e, t, i) {
  18781. ;(this.hidden = i), (this.mouseLastMoveTime = Date.now())
  18782. }),
  18783. (n.prototype.hide = function () {
  18784. this.hidden || ((this.hidden = !0), a.start(l.property(this.material.uniforms.opacity, 'value', 0), o.reticuleOpacityTransitionTime))
  18785. }),
  18786. (n.prototype.show = function () {
  18787. ;(this.hidden = !1), this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, 'value', o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18788. }),
  18789. (n.prototype.update = function () {
  18790. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18791. }),
  18792. (n.prototype.updatePosition = function (e, t) {
  18793. if (!this.hidden) {
  18794. if (!t) return this.hide()
  18795. var i = t.point,
  18796. n = e.distanceTo(i),
  18797. r = 1 + 0.01 * n
  18798. n < 1 && (r -= 1 - n),
  18799. this.show(),
  18800. this.scale.set(r, r, r),
  18801. (this.direction = this.direction.multiplyScalar(0.8)),
  18802. this.direction.add(t.face.normal.clone().multiplyScalar(0.2)),
  18803. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(0.01)),
  18804. this.lookAt(this.position.clone().add(this.direction))
  18805. }
  18806. }),
  18807. (n.prototype.writeAstag = function () {
  18808. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16),
  18809. t = new Date()
  18810. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1
  18811. var i = {
  18812. enabled: !0,
  18813. version: '0',
  18814. created: t.toISOString(),
  18815. created_by: 'APITest',
  18816. position: this.position.clone(),
  18817. stem: {
  18818. enabled: o.tags.pole.enabled,
  18819. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18820. },
  18821. label: 'tag ' + this.tagCount,
  18822. description: 'Description ' + e,
  18823. floor: (function (e) {
  18824. if (e.currentFloor) {
  18825. var t = e.floors.indexOf(e.currentFloor)
  18826. return -1 < t ? t : void 0
  18827. }
  18828. })(this.player.model),
  18829. type: 'info',
  18830. metadata: {
  18831. preferred_camera: {
  18832. mode: this.player.mode
  18833. }
  18834. }
  18835. }
  18836. console.log('--------------------------'), console.log(JSON.stringify(i))
  18837. var n = this.player.model.addtag(e, i).build()
  18838. n && (n.disc && this.player.tagDiscs.push(n.disc), n.visible || n.show(o.tags.startup.fadeInDuration))
  18839. }),
  18840. (t.exports = n)
  18841. },
  18842. {
  18843. '../enum/RenderLayers': 41,
  18844. '../enum/RenderOrder': 42,
  18845. '../settings': 166,
  18846. '../shaders': 167,
  18847. '../util/lerp': 188,
  18848. '../util/texture': 194,
  18849. '../util/transitions': 195,
  18850. three: 217
  18851. }
  18852. ],
  18853. 150: [
  18854. function (e, t, i) {
  18855. 'use strict'
  18856. function n(e, t) {
  18857. ;(this.chunks = []), (this.floorId = e), (this.roomId = t), (this.position = new l.Vector3())
  18858. }
  18859. var l = e('three')
  18860. ;(n.prototype.addChunk = function (e) {
  18861. this.chunks.push(e)
  18862. }),
  18863. (n.prototype.calcBoundaries = function () {
  18864. 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++) {
  18865. var a = this.chunks[o].geometry.attributes.position
  18866. 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++
  18867. }
  18868. 0 < r ? (t.multiplyScalar(1 / r), (this.average = t)) : (this.average = null),
  18869. (this.boundsMax = i),
  18870. (this.boundsMin = n),
  18871. (this.center = new l.Vector3()),
  18872. this.center.copy(i).sub(n).multiplyScalar(0.5).add(n)
  18873. }),
  18874. (t.exports = n)
  18875. },
  18876. {
  18877. three: 217
  18878. }
  18879. ],
  18880. 151: [
  18881. function (o, v, e) {
  18882. ;(function (e) {
  18883. 'use strict'
  18884. function t(e, t, i) {
  18885. ;(this.obj3d = null),
  18886. (this.nodes = []),
  18887. (this.colorHull = []),
  18888. (this.shortPaths = {}),
  18889. (this.floorHull = null),
  18890. (this.cameraHull = null),
  18891. (this.floorPathDistance = 0),
  18892. (this.floorCurvePoints = null),
  18893. (this.floorCurveColors = null),
  18894. (this.camCurvePoints = null),
  18895. (this.warpDestHeroLoc = null),
  18896. (this.warpDestPano = null),
  18897. (this.warpPathPoints = null),
  18898. (this.warpPathLengths = [0]),
  18899. (this.warpLength = 0),
  18900. (this.closeWarpDistance = 4),
  18901. (this.UP = U.UP.clone()),
  18902. (this.longestStep = 0),
  18903. (this.upcomingTransType = null),
  18904. (this.burnsDir = 1),
  18905. (this.prevNextDist = 0),
  18906. (this.nextI = 0),
  18907. (this.activeTransType = null),
  18908. (this.lastTransType = null),
  18909. (this.bunnyObj = null),
  18910. (this.director = e),
  18911. (this.player = t),
  18912. (this.playerControls = i),
  18913. (this.modelManager = t.modelManager),
  18914. this.updateModel(),
  18915. this.updateDefaultsFromModelData(),
  18916. this.bindEvents(),
  18917. (this.warping = !1),
  18918. (this.waitingToWarp = !1),
  18919. (this.warpInterrupted = !1),
  18920. (this.warpInterruptionBlackoutStyle = null),
  18921. (this.warpInterruptionTravelTime = null)
  18922. }
  18923. var c,
  18924. h,
  18925. u,
  18926. d,
  18927. p,
  18928. f,
  18929. a,
  18930. s,
  18931. P = o('three'),
  18932. i = o('../util/logger'),
  18933. O = o('../enum/Viewmode'),
  18934. A = o('../enum/RenderOrder'),
  18935. L = o('../enum/WarpStyle'),
  18936. D = o('../settings'),
  18937. N = o('../util/math'),
  18938. F = o('../util/lerp'),
  18939. B = o('../util/easing'),
  18940. V = o('../util/transitions'),
  18941. l = o('../objects/Snapshot'),
  18942. k = o('../effects'),
  18943. C = o('../shaders'),
  18944. n = (o('../gui/gui'), o('../util/texture')),
  18945. U = o('../enum/Vectors'),
  18946. H = (o('../model/ModelManager'), new i(e)),
  18947. g = o('../enum/PlayerEvents'),
  18948. z = o('../enum/BlackoutStyle'),
  18949. r = o('../enum/ModelManagerEvents'),
  18950. m = o('../constants'),
  18951. I = {
  18952. path: n.loadBase64(
  18953. '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'
  18954. ),
  18955. pathEnd: n.load('images/End.png'),
  18956. pathStart: n.loadBase64(
  18957. '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=='
  18958. )
  18959. }
  18960. ;(t.prototype.setScene = function (e) {
  18961. this.createCpm(e), this.createBunnyObj(e)
  18962. }),
  18963. (t.prototype.updateModel = function () {
  18964. this.model = this.modelManager.getActiveModel()
  18965. }),
  18966. (t.prototype.bindEvents = function () {
  18967. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  18968. }),
  18969. (t.prototype.updateDefaultsFromModelData = function () {
  18970. this.model.data
  18971. }),
  18972. (t.prototype.pointPathDistance = function (e) {
  18973. for (var t = 0, i = 1; i < e.length; i += 1) t += e[i - 1].distanceTo(e[i])
  18974. return t
  18975. }),
  18976. (t.prototype.pointPathLengths = function (e) {
  18977. for (var t = [0], i = 1; i < e.length; i += 1) t.push(t[i - 1] + e[i - 1].distanceTo(e[i]))
  18978. return t
  18979. }),
  18980. (t.prototype.interpAlongPath = function (e, t, i) {
  18981. var n,
  18982. r = new P.Vector3(),
  18983. o = t[t.length - 1]
  18984. if (i < 1) {
  18985. n = i * o
  18986. for (var a = 1; a < t.length; a += 1)
  18987. if (t[a] > n) {
  18988. var s = (n - t[a - 1]) / (t[a] - t[a - 1])
  18989. return r.copy(e[a]), r.sub(e[a - 1]), r.multiplyScalar(s), r.add(e[a - 1]), r
  18990. }
  18991. } else r.copy(e[e.length - 1])
  18992. return r
  18993. }),
  18994. (t.prototype.pathHeight = function () {
  18995. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  18996. }),
  18997. (t.prototype.createBunnyObj = function (e) {
  18998. this.bunnyObj || ((this.bunnyObj = new P.AxisHelper(0.1)), (this.bunnyObj.visible = D.warp.showBunny)),
  18999. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  19000. e.add(this.bunnyObj)
  19001. }),
  19002. (t.prototype.createCpm = function (e) {
  19003. if (!this.currentPanoMarker) {
  19004. var t = this.makeWaypointObj(I.pathEnd, 'Current')
  19005. ;(t.material.uniforms.opacity.value = 0),
  19006. (this.currentPanoMarker = {
  19007. mesh: t,
  19008. placed: !1
  19009. })
  19010. }
  19011. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19012. this.placeCpm(),
  19013. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  19014. }),
  19015. (t.prototype.placeCpm = function () {
  19016. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  19017. var e = this.player.currentPano.floor
  19018. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor &&
  19019. (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh), e.add(this.currentPanoMarker.mesh)),
  19020. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  19021. (this.currentPanoMarker.mesh.position.y += this.pathHeight()),
  19022. (this.currentPanoMarker.placed = !0)
  19023. } else this.popOutCpm()
  19024. }),
  19025. (t.prototype.fadeInCpm = function (e) {
  19026. ;(this.player.mode === O.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned()) ||
  19027. (D.path.mapGuides && this.currentPanoMarker.placed && V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, 'value', 1), e))
  19028. }),
  19029. (t.prototype.fadeOutCpm = function (e) {
  19030. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, 'value', 0), e)
  19031. }),
  19032. (t.prototype.popInCpm = function () {
  19033. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  19034. }),
  19035. (t.prototype.popOutCpm = function () {
  19036. this.fadeOutCpm(2)
  19037. }),
  19038. (t.prototype.brushPrefs = {
  19039. linewidth: 7,
  19040. strokeWidth: 15,
  19041. cvSegments: 48,
  19042. paveStep: 0.1,
  19043. paveWidth: 0.2,
  19044. lookBlendDist: 3,
  19045. maxTurn: P.Math.degToRad(2)
  19046. }),
  19047. (t.prototype.panoPathDistance = function (e) {
  19048. var t = this.model.panos
  19049. if (!e || e.length < 2) return 0
  19050. for (var i = [], n = 0; n < e.length; n += 1) i.push(t.get(e[n]).floorPosition)
  19051. return this.pointPathDistance(i)
  19052. }),
  19053. (t.prototype.loadTileTexture = function (t) {
  19054. var e = n.load(
  19055. t,
  19056. function (e) {
  19057. ;(e.wrapS = P.RepeatWrapping), (e.wrapT = P.RepeatWrapping), (e.needsUpdate = !0), H.debug('path texture "' + t + '" is ready')
  19058. },
  19059. function () {
  19060. H.error('path texture "' + t + '" failed')
  19061. }
  19062. )
  19063. return (e.mapping = P.UVMapping), e
  19064. }),
  19065. (t.prototype.buildWarpDestinationDescriptor = function (e, t, i, n, r, o) {
  19066. return new l({
  19067. cameraMode: n,
  19068. position: e,
  19069. quaternion: t,
  19070. panoId: i,
  19071. orthoZoom: o,
  19072. floorVisibility: r,
  19073. thumbUrl: null,
  19074. name: null
  19075. })
  19076. }),
  19077. (t.prototype.buildWarpDestinationDescriptorFromHero = function (e) {
  19078. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  19079. }),
  19080. (t.prototype.setWarpDestination = function (e) {
  19081. this.warpDestHeroLoc = e
  19082. }),
  19083. (t.prototype.setWarpDestinationByHeroIndex = function (e) {
  19084. var t = this.getHeroDescriptorByHeroIndex(e)
  19085. return null !== t && (this.setWarpDestination(t), !0)
  19086. }),
  19087. (t.prototype.setWarpDestinationByPano = function (e, t) {
  19088. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  19089. }),
  19090. (t.prototype.setWarpDestinationByPanoId = function (e, t) {
  19091. var i = this.model.panos.get(e)
  19092. if (i) {
  19093. t = t || new P.Quaternion()
  19094. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, 'panorama', [], -1)
  19095. return this.setWarpDestination(n), !0
  19096. }
  19097. return !1
  19098. }),
  19099. (t.prototype.getHeroDescriptorByHeroIndex = function (e) {
  19100. var t = this.model.heroCount()
  19101. if (null !== this.warpDestHeroLoc && t < 1) return H.info('ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available.'), this.model.getHeroDescriptorByIndex(0)
  19102. var i = this.model.getHeroDescriptorByIndex(e)
  19103. if (i) {
  19104. var n = i.isPano() ? i.panoId : i.cameraMode
  19105. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + ' choices.')
  19106. }
  19107. return i
  19108. }),
  19109. (t.prototype.getHeroDescriptorByPano = function (e) {
  19110. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  19111. }),
  19112. (t.prototype.getHeroDescriptorByPanoId = function (e) {
  19113. var t = this.getHeroIndexFromPanoId(e)
  19114. return this.getHeroDescriptorByHeroIndex(t)
  19115. }),
  19116. (t.prototype.getHeroIndexFromPanoId = function (e) {
  19117. for (var t = 0; t < this.model.heroLocations.length; t++) {
  19118. var i = this.model.heroLocations[t],
  19119. n = this.getHeroId(i)
  19120. if (n && n === e) return t
  19121. }
  19122. return -1
  19123. }),
  19124. (t.prototype.getHeroPano = function (e) {
  19125. if (null === e) return H.warn('getHeroPano(): no destination'), null
  19126. var t = this.getHeroId(e),
  19127. i = this.model.panos.get(t)
  19128. return void 0 === i && ((i = null), '' !== t && H.debug('unable to find pano "' + t + '"')), i
  19129. }),
  19130. (t.prototype.getHeroId = function (e) {
  19131. return e.panoId
  19132. }),
  19133. (t.prototype.setWarpDestPano = function () {
  19134. return (this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc)), this.warpDestPano
  19135. }),
  19136. (t.prototype.brushToWarpPano = function (e, t) {
  19137. if ((this.discardPathObject(), !this.setWarpDestPano())) return !1
  19138. if ((this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn('Can only brush from pano to pano'), !this.warpDestPano)) return H.info('No brush'), !1
  19139. if (!this.player.currentPano) return H.debug('No current pano, visibility undefined'), !1
  19140. if (!this.warpDestPano) return H.info('No wPano, visibility undefined'), !1
  19141. if (!this.warpDestPano.isAligned()) return H.debug('Cannot brush to unaligned pano'), !1
  19142. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides,
  19143. n = !0
  19144. if (this.player.currentPano.id === this.warpDestPano.id) H.debug('Already at destination pano')
  19145. else {
  19146. ;(this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano)),
  19147. (n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1),
  19148. (this.obj3d = new P.Object3D()),
  19149. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ')'),
  19150. n
  19151. ? (H.info('No "walkable" route, using fall-back warp style transition'), (e = t))
  19152. : (this.setPathHulls(this.nodes),
  19153. this.setFloorCurves(),
  19154. i &&
  19155. ('chevron' === D.path.style
  19156. ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints))
  19157. : 'ribbon' === D.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))),
  19158. this.player.currentPano.floor.add(this.obj3d)
  19159. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN,
  19160. o = e === L.STD
  19161. if (!n && (i || o)) {
  19162. if (r) {
  19163. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints)
  19164. this.obj3d.add(a)
  19165. }
  19166. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1])
  19167. this.obj3d.add(s)
  19168. }
  19169. this.appearSlow()
  19170. }
  19171. return (this.upcomingTransType = e), !n
  19172. }),
  19173. (t.prototype.findShortestPath = function (e, t) {
  19174. if (!e || !t) return null
  19175. var i = D.warp.walkExtraPanosDistance,
  19176. n = e.id + ':' + t.id + ':' + i
  19177. if (this.shortPaths.hasOwnProperty(n)) return this.shortPaths[n] ? this.shortPaths[n].slice() : null
  19178. var r = t.id + ':' + e.id + ':' + i
  19179. if (this.shortPaths.hasOwnProperty(r)) return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null
  19180. var o = this.model.panos.aStarSearch(e, t)
  19181. return this.model.panos.includeNodesNearPath(o, i), (this.shortPaths[n] = o ? o.slice() : null), o
  19182. }),
  19183. (t.prototype.makePathHulls = function (e) {
  19184. var t,
  19185. i,
  19186. n,
  19187. r,
  19188. o,
  19189. a = 0,
  19190. s = [],
  19191. l = [],
  19192. c = [],
  19193. h = this.model.panos
  19194. r = (t = h.get(e[0])).floor.floorIndex
  19195. for (var u = 0; u < e.length; u += 1)
  19196. ((i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight()),
  19197. s.push(i),
  19198. l.push(t.position.clone()),
  19199. (n = t.floor.floorIndex),
  19200. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  19201. 0 < u && a < (o = l[u].distanceTo(l[u - 1])) && (a = o)
  19202. return (
  19203. a > this.longestStep && ((this.longestStep = a), H.debug('path contains ' + a + ' meter segment')),
  19204. {
  19205. floor: s,
  19206. camera: l,
  19207. color: c
  19208. }
  19209. )
  19210. }),
  19211. (t.prototype.makeFloorCurves = function (e, t, i) {
  19212. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius,
  19213. r = this.pointPathDistance(e) - 2 * n,
  19214. o = e.slice(0),
  19215. a = o[1].clone().sub(o[0])
  19216. ;(a.y = 0),
  19217. a.normalize().multiplyScalar(n),
  19218. (o[0] = new P.Vector3().copy(o[0]).add(a)),
  19219. ((a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0),
  19220. a.normalize().multiplyScalar(n),
  19221. (o[o.length - 1] = new P.Vector3().copy(o[o.length - 1]).add(a))
  19222. var s = new P.CatmullRomCurve3(o),
  19223. l = Math.floor(r / i)
  19224. ;(l = 4 * Math.floor(l / 4)), (l = Math.max(4, l))
  19225. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3(), f = 0; f < u.length; f += 1) {
  19226. ;(h = 0), (c = u[f].distanceTo(e[0]))
  19227. for (var g = 1; g < e.length; g += 1) p.copy(u[f]).sub(e[g]), (p.y *= 4), p.length() < c && (h = g)
  19228. d.push(t[h])
  19229. }
  19230. return {
  19231. distance: r,
  19232. points: u,
  19233. colors: d
  19234. }
  19235. }),
  19236. (t.prototype.makeCameraCurvePoints = function (e, t) {
  19237. var i = this.pointPathDistance(e)
  19238. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  19239. }),
  19240. (t.prototype.makeCameraCurveTangents = function (e, t) {
  19241. var i = this.pointPathDistance(e),
  19242. n = new P.CatmullRomCurve3(e),
  19243. r = Math.max(2, Math.floor(i / t))
  19244. r = r || 5
  19245. for (var o = [], a = 0; a <= r; a++) o.push(n.getTangentAt(a / r))
  19246. return o
  19247. }),
  19248. (t.prototype.setPathHulls = function (e) {
  19249. var t = this.makePathHulls(e)
  19250. ;(this.floorHull = t.floor), (this.cameraHull = t.camera), (this.colorHull = t.color)
  19251. }),
  19252. (t.prototype.setFloorCurves = function () {
  19253. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep)
  19254. ;(this.floorPathDistance = e.distance), (this.floorCurvePoints = e.points), (this.floorCurveColors = e.colors)
  19255. }),
  19256. (t.prototype.setCameraCurvePoints = function () {
  19257. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  19258. }),
  19259. (t.prototype.chooseWarpPath = function (e) {
  19260. var t,
  19261. i,
  19262. n,
  19263. r = this.playerControls.cameras[O.PANORAMA]
  19264. if (this.player.currentPano === this.warpDestPano || !e) return (this.warpPathPoints = null), (this.warpLength = 0), !1
  19265. ;(this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano)),
  19266. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1
  19267. ? (H.debug('warp path to unreachable node'),
  19268. (i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate()),
  19269. t.multiplyScalar(0.15).add(r.position),
  19270. i.multiplyScalar(0.15).add(this.warpDestPano.position),
  19271. (t.y = r.position.y),
  19272. (i.y = this.warpDestPano.position.y),
  19273. (n = new P.CubicBezierCurve3(r.position.clone(), t, i, this.warpDestPano.position.clone())),
  19274. (this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)))
  19275. : (H.debug('follow warp path (path distance was ' + this.nodes.length + ' nodes, ' + this.floorPathDistance + ')'),
  19276. this.setCameraCurvePoints(),
  19277. (this.warpPathPoints = this.camCurvePoints.slice(0))),
  19278. (this.warpLength = 0),
  19279. (this.warpPathLengths = [0])
  19280. for (
  19281. 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;
  19282. c < this.warpPathPoints.length;
  19283. c += 1
  19284. ) {
  19285. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c])
  19286. var h = o.length()
  19287. o.y *= D.warp.climbEffort
  19288. var u = o.length() / h
  19289. if (1 < c) {
  19290. o.setY(0).normalize(),
  19291. a
  19292. .copy(this.warpPathPoints[c - 2])
  19293. .sub(this.warpPathPoints[c - 1])
  19294. .setY(0)
  19295. .normalize()
  19296. var d = Math.min(1, o.dot(a)),
  19297. p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s))
  19298. u = Math.max(p, u)
  19299. }
  19300. ;(this.warpLength += h * u), (this.warpPathLengths[c] = this.warpLength)
  19301. }
  19302. return !0
  19303. }),
  19304. (t.prototype.drawPathRibbon = function (e, t) {
  19305. /* let map = Texture.load('images/arrow.png')
  19306. map.anisotropy = 4
  19307. map.repeat.set(1, 6)
  19308. map.wrapS = THREE.RepeatWrapping
  19309. map.wrapT = THREE.RepeatWrapping
  19310. map.needsUpdate = true
  19311. */
  19312. this.bunnyObj.visible = D.warp.showBunny
  19313. 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) {
  19314. 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)
  19315. var l = new P.Vector3().copy(e[s]).add(r)
  19316. l.sub(n), o.vertices.push(l), (l = new P.Vector3().copy(e[s]).add(r)).add(n), o.vertices.push(l)
  19317. }
  19318. var c,
  19319. h,
  19320. u,
  19321. d = 0
  19322. for (s = 0; s < e.length - 1; s += 1) {
  19323. var p = 2 * s,
  19324. f = d,
  19325. g = (d += e[s + 1].distanceTo(e[s])),
  19326. m = t[s],
  19327. v = t[s + 1]
  19328. ;((c = new P.Face3(p, 1 + p, 2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)]),
  19329. o.faces.push(c),
  19330. o.faceVertexUvs[0].push([new P.Vector2(0, f), new P.Vector2(1, f), new P.Vector2(0, g)]),
  19331. ((c = new P.Face3(2 + p, 1 + p, 3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)]),
  19332. o.faces.push(c),
  19333. o.faceVertexUvs[0].push([new P.Vector2(0, g), new P.Vector2(1, f), new P.Vector2(1, g)])
  19334. }
  19335. o.computeFaceNormals(),
  19336. o.computeVertexNormals(),
  19337. (h =
  19338. this.player.mode === O.PANORAMA
  19339. ? (((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path),
  19340. (u.opacity.value = 0),
  19341. u.color.value.set(D.path.color),
  19342. new P.RawShaderMaterial({
  19343. side: P.DoubleSide,
  19344. depthWrite: !1,
  19345. transparent: !0,
  19346. vertexShader: C.ribbon.vertexShader,
  19347. fragmentShader: C.ribbon.fragmentShader,
  19348. uniforms: u,
  19349. name: 'ribbonT',
  19350. opacity: 0
  19351. }))
  19352. : new P.MeshBasicMaterial({
  19353. color: 16777215,
  19354. side: P.DoubleSide,
  19355. name: 'ribbonOut',
  19356. vertexColors: P.VertexColors
  19357. /* transparent:true,
  19358. map */
  19359. }))
  19360. var y = new P.Mesh(o, h)
  19361. return (y.name = 'ribbon'), this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon), y
  19362. }),
  19363. (t.prototype.drawPathPavement = function (e) {
  19364. for (var t, i = new P.Vector3(), n = new P.Geometry(), r = new P.Vector3(), o = 0; o < e.length; o += 1)
  19365. r.copy(e[o]),
  19366. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  19367. r.normalize(),
  19368. i.crossVectors(r, U.UP),
  19369. i.multiplyScalar(this.brushPrefs.paveWidth),
  19370. (t = new P.Vector3().copy(e[o])).sub(i),
  19371. n.vertices.push(t),
  19372. n.vertices.push(new P.Vector3().copy(e[o])),
  19373. (t = new P.Vector3().copy(e[o])).add(i),
  19374. n.vertices.push(t)
  19375. var a, s, l
  19376. for (o = 0; o < e.length - 1; o += 1)
  19377. (a = 3 * o + 1),
  19378. (l = 0.25 + (s = 0.25 * o)),
  19379. n.faces.push(new P.Face3(a - 1, a, 3 + a)),
  19380. n.faceVertexUvs[0].push([new P.Vector2(0, s), new P.Vector2(0.5, s), new P.Vector2(0.5, l)]),
  19381. n.faces.push(new P.Face3(3 + a, 2 + a, a - 1)),
  19382. n.faceVertexUvs[0].push([new P.Vector2(0.5, l), new P.Vector2(0, l), new P.Vector2(0, s)]),
  19383. n.faces.push(new P.Face3(3 + a, a, 1 + a)),
  19384. n.faceVertexUvs[0].push([new P.Vector2(0.5, l), new P.Vector2(0.5, s), new P.Vector2(1, s)]),
  19385. n.faces.push(new P.Face3(3 + a, 1 + a, 4 + a)),
  19386. n.faceVertexUvs[0].push([new P.Vector2(0.5, l), new P.Vector2(1, s), new P.Vector2(1, l)])
  19387. var c =
  19388. this.player.mode === O.PANORAMA
  19389. ? new P.MeshBasicMaterial({
  19390. color: D.path.color,
  19391. side: P.DoubleSide,
  19392. transparent: !0,
  19393. depthWrite: !1,
  19394. opacity: 0,
  19395. name: 'paveT',
  19396. map: I.path
  19397. })
  19398. : new P.MeshBasicMaterial({
  19399. color: D.path.color,
  19400. side: P.DoubleSide,
  19401. transparent: !0,
  19402. depthWrite: !1,
  19403. opacity: 1,
  19404. name: 'paveO',
  19405. map: I.path
  19406. })
  19407. return new P.Mesh(n, c)
  19408. }),
  19409. (t.prototype.hintPrefs = {
  19410. rad: 0.18,
  19411. width: 0.0125,
  19412. depth: 0.0625,
  19413. setBack: -0.04,
  19414. markRad: 0.25,
  19415. markInnerRad: 0.16
  19416. }),
  19417. (t.prototype.makeWaypointObj = function (e, t) {
  19418. var i = new P.Geometry(),
  19419. n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius,
  19420. r = this.pathHeight()
  19421. 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)),
  19422. i.faces.push(new P.Face3(0, 1, 2), new P.Face3(2, 3, 0)),
  19423. i.faceVertexUvs[0].push([new P.Vector2(0, 0), new P.Vector2(1, 0), new P.Vector2(1, 1)]),
  19424. i.faceVertexUvs[0].push([new P.Vector2(1, 1), new P.Vector2(0, 1), new P.Vector2(0, 0)])
  19425. var o = P.UniformsUtils.clone(C.waypoint.uniforms)
  19426. ;(o.map.value = e), (o.opacity.value = 0), o.color.value.set(D.path.color)
  19427. var a = {
  19428. side: P.DoubleSide,
  19429. depthWrite: !1,
  19430. transparent: !0,
  19431. vertexShader: C.waypoint.vertexShader,
  19432. fragmentShader: C.waypoint.fragmentShader,
  19433. uniforms: o,
  19434. name: 'waypoint',
  19435. opacity: 0
  19436. }
  19437. this.player.mode !== O.PANORAMA && ((a.depthTest = !1), (a.name = 'wayPtOut'))
  19438. var s = new P.RawShaderMaterial(a),
  19439. l = new P.Mesh(i, s)
  19440. return (l.name = t), l
  19441. }),
  19442. (t.prototype.makeStartMarker = function (e, t) {
  19443. var i = new P.Vector3().copy(t[1]).sub(t[0])
  19444. ;(i.y = 0), i.normalize()
  19445. var n = Math.acos(i.x),
  19446. r = this.makeWaypointObj(I.pathStart, 'Start')
  19447. return r.rotateOnAxis(new P.Vector3(0, 1, 0), n), r.position.copy(e), r
  19448. }),
  19449. (t.prototype.makeEndMarker = function (e) {
  19450. var t = this.makeWaypointObj(I.pathEnd, 'End'),
  19451. i = this.model.panos.get(this.nodes[0]).floor.floorIndex,
  19452. n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex
  19453. 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
  19454. }),
  19455. (t.prototype.pathClean = function (e) {
  19456. if (e) {
  19457. for (var t in e.children) this.pathClean(e.children[t])
  19458. e.geometry && e.geometry.dispose(), e.material && e.material.dispose()
  19459. }
  19460. }),
  19461. (t.prototype.discardPathObject = function () {
  19462. if (this.obj3d) {
  19463. var e = this.obj3d.parent
  19464. e && e.remove(this.obj3d), this.pathClean(this.obj3d)
  19465. }
  19466. ;(this.obj3d = null), this.popInCpm()
  19467. }),
  19468. (t.prototype.discardSlow = function () {
  19469. if (this.obj3d) {
  19470. if (this.player.mode !== O.PANORAMA) return void this.discardPathObject()
  19471. for (
  19472. var e,
  19473. t = 0,
  19474. i = function () {
  19475. this.discardPathObject()
  19476. }.bind(this),
  19477. n = 0;
  19478. n < this.obj3d.children.length;
  19479. n += 1
  19480. )
  19481. void 0 !== (e = this.obj3d.children[n]).material &&
  19482. !0 === e.material.transparent &&
  19483. (void 0 !== e.material.uniforms
  19484. ? V.start(F.property(e.material.uniforms.opacity, 'value', 0), D.path.fadeOutTime, i, 0, B[D.warp.blendEasing])
  19485. : V.start(F.property(e.material, 'opacity', 0), D.path.fadeOutTime, i, 0, B[D.warp.blendEasing]),
  19486. (t += 1),
  19487. (i = null))
  19488. 0 === t && this.discardPathObject(), this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  19489. }
  19490. }),
  19491. (t.prototype.appearSlow = function () {
  19492. var e
  19493. this.fadeOutCpm(D.path.fadeInTime)
  19494. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  19495. void 0 !== (e = this.obj3d.children[i]).material &&
  19496. !0 === e.material.transparent &&
  19497. (void 0 !== e.material.uniforms
  19498. ? V.start(F.property(e.material.uniforms.opacity, 'value', t), D.path.fadeInTime, null, 0, B[D.warp.blendEasing])
  19499. : V.start(F.property(e.material, 'opacity', t), D.path.fadeInTime, null, 0, B[D.warp.blendEasing]))
  19500. }),
  19501. (t.prototype.update = function () {
  19502. this.obj3d && this.obj3d.updateMatrixWorld()
  19503. }),
  19504. (t.prototype.calcBurnsAmount = function (e) {
  19505. var n = P.Math.degToRad(D.warp.burnsAngle)
  19506. if (this.player.mode !== O.PANORAMA) return this.player.mode === O.DOLLHOUSE ? 0.02 * this.burnsDir : this.burnsDir
  19507. var t = this.burnsDir * n
  19508. if (this.upcomingTransType === L.BLACK) return t
  19509. var i = e
  19510. if (null === i) return H.warn('Transition request for non-highlight'), t
  19511. var r = this.getHeroDescriptorByHeroIndex(i)
  19512. if (null === r) return t
  19513. if (!r.isPano()) return t
  19514. function o(e) {
  19515. var t = Math.acos(Math.min(1, e.dot(l))),
  19516. i = new P.Vector3().crossVectors(l, e)
  19517. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19518. }
  19519. var a = this.getHeroPano(r),
  19520. s = this.playerControls.cameras[O.PANORAMA],
  19521. l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize(),
  19522. c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n)
  19523. if (a === this.player.currentPano) return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize())
  19524. var h = this.findShortestPath(this.player.currentPano, a)
  19525. if (null == h || h.length < 1) return H.debug('Empty path ahead...'), t
  19526. var u = this.makePathHulls(h),
  19527. d = new P.CatmullRomCurve3(u.camera),
  19528. p = Math.min(0.1, D.warp.lookAheadDist / d.getLength())
  19529. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19530. }),
  19531. (t.prototype.waitNextStep = function (e, t, i) {
  19532. var o = null == i ? D.warp.tourStepDelay : i
  19533. o = o != void 0 ? o : this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault
  19534. var a = new P.Euler(),
  19535. s = new P.Vector3()
  19536. H.debug('Starting wait: ' + (void 0 !== t))
  19537. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem) //this.model.heroLocations[this.director.currentItem[0]]
  19538. var l = currentLocation.dontRot || this.calcBurnsAmount(e),
  19539. c = function () {
  19540. this.endWarpState(), this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0), t && t()
  19541. }.bind(this),
  19542. n = function (e, t) {
  19543. if (this.warpInterrupted) return c(), !0
  19544. var i = t || 1e3 / 60
  19545. if (D.warp.doBurns && !currentLocation.dontRot)
  19546. if (this.player.mode === O.PANORAMA) {
  19547. var n = this.playerControls.cameras[O.PANORAMA]
  19548. a.setFromQuaternion(n.quaternion, D.warp.eOrder)
  19549. var r = o == 0 ? l : (i * l) / o
  19550. r = Math.sign(r) * Math.max(r, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  19551. ;(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)
  19552. } else
  19553. this.player.mode === O.DOLLHOUSE ? (this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l) : (this.playerControls.controls[O.FLOORPLAN].absoluteScale *= 0.9996)
  19554. }.bind(this)
  19555. this.startWarpState(), V.start(n, o, c, 0, B.easeInOutQuad, 'wait')
  19556. }),
  19557. (t.prototype.warpToNonPano = function (e) {
  19558. if ((this.discardPathObject(), this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN)) {
  19559. var t = function () {
  19560. e && e()
  19561. }.bind(this)
  19562. this.player.flyToNewMode({
  19563. mode: this.warpDestHeroLoc.cameraMode,
  19564. duration: D.warp.outsideTime,
  19565. warpDest: this.warpDestHeroLoc,
  19566. callback: t,
  19567. force: !0
  19568. })
  19569. } else H.warn('no warp destination!!!'), e && e()
  19570. }),
  19571. (t.prototype._resetWarpShaderParams = function (e) {
  19572. this.player.mode === O.PANORAMA &&
  19573. (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0), void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19574. }),
  19575. (t.prototype._clearWarpShading = function () {
  19576. for (var e = this.model.chunks, t = 0; t < e.length; t += 1) this._resetWarpShaderParams(e[t]), (e[t].visible = !0)
  19577. this._resetWarpShaderParams(this.model.skybox)
  19578. }),
  19579. (t.prototype._warpStopFlying = function () {
  19580. ;(this.activeTransType = null), this.placeCpm()
  19581. }),
  19582. (t.prototype._wrapupTravelOnlyBits = function () {
  19583. this._warpStopFlying(),
  19584. this.warpPathPoints && (this.player.currentPano.exit(), this.warpDestPano.enter(), (this.player.currentPano = this.warpDestPano)),
  19585. this.player.spider.draw(),
  19586. this.placeCpm()
  19587. }),
  19588. (t.prototype._wrapupTravel = function (e) {
  19589. this._wrapupTravelOnlyBits(), this.warpCameraAim(e)
  19590. }),
  19591. (t.prototype._wrapupWarpShading = function (e) {
  19592. this._clearWarpShading(), this._wrapupTravel(e)
  19593. }),
  19594. (t.prototype.wrapupWarpShadingOnly = function (e, t) {
  19595. t !== z.END && this._clearWarpShading(), this._wrapupTravelOnlyBits(), (this.upcomingTransType = null), e && e()
  19596. }),
  19597. (t.prototype._warpCameraAim = function (e, t) {
  19598. var i = this.warpDestHeroLoc.quaternion,
  19599. n = this.playerControls.cameras[O.PANORAMA],
  19600. r = new P.Vector3(0, 0, 1).applyQuaternion(i).normalize(),
  19601. o = new P.Vector3(0, 0, 1).applyQuaternion(n.quaternion).normalize().dot(r),
  19602. a = P.Math.radToDeg(Math.acos(o)),
  19603. s = new P.Euler(0, 0, 0, D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder),
  19604. l = new P.Euler().setFromQuaternion(n.quaternion, D.warp.eOrder),
  19605. c = new P.Euler(s.x - l.x, s.y - l.y, s.z - l.z, D.warp.eOrder)
  19606. ;(c.y = N.constrainedTurn(c.y)), (this.burnsDir = Math.sign(c.y))
  19607. var h = new P.Euler(0, 0, 0, D.warp.eOrder),
  19608. u = new P.Vector3(),
  19609. d = function (e, t) {
  19610. return (
  19611. !!this.warpInterrupted ||
  19612. ((h.x = l.x + e * c.x),
  19613. (h.y = l.y + e * c.y),
  19614. (h.z = l.z + e * c.z),
  19615. u.set(0, 0, -1),
  19616. u.applyEuler(h),
  19617. u.add(n.position),
  19618. n.controls.lookAt(u),
  19619. n.controls.lookVector.copy(u),
  19620. void n.lookAt(u))
  19621. )
  19622. }.bind(this)
  19623. /* return a > D.warp.minRotation ? (V.start(d, e, t, 0, B[D.warp.movementEasing])
  19624. , (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19625. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19626. )
  19627. : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19628. void (t && t())) */
  19629. this.warpDestHeroLoc.zoom != this.player.zoomLevel && //add 原地转向最终方位时
  19630. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom, e)
  19631. return a > D.warp.minRotation
  19632. ? V.start(d, e, t, 0, B[D.warp.movementEasing])
  19633. : /* H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim") ,*/
  19634. void (t && t())
  19635. }),
  19636. (t.prototype._warpBendAim = function (e, t, i, n) {
  19637. var r = n || 0,
  19638. o = this.playerControls.cameras[O.PANORAMA],
  19639. a = new P.Euler(0, 0, 0, D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder),
  19640. s = new P.Euler().setFromQuaternion(o.quaternion, D.warp.eOrder),
  19641. l = new P.Euler(a.x - s.x, a.y - s.y, a.z - s.z, D.warp.eOrder)
  19642. l.y = N.constrainedTurn(l.y)
  19643. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x))
  19644. ;(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)
  19645. var h = new P.Euler(0, 0, 0, D.warp.eOrder),
  19646. u = new P.Vector3(),
  19647. d = function (e, t) {
  19648. 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)
  19649. else {
  19650. var i = (1 - e) * D.warp.softBendEnd
  19651. ;(h.x = a.x - i * l.x), (h.y = a.y - i * l.y), (h.z = a.z - i * l.z)
  19652. }
  19653. u.set(0, 0, -1), u.applyEuler(h), u.add(o.position), o.controls.lookAt(u), o.controls.lookVector.copy(u), o.lookAt(u)
  19654. }.bind(this)
  19655. if (window.DATA.momentTourBlackNewType) {
  19656. d(1)
  19657. } else return V.start(d, t, i, r, B[D.warp.movementEasing])
  19658. }),
  19659. (t.prototype._warpStepCameraAim = function (e, t, i) {
  19660. var n = this.playerControls.cameras[O.PANORAMA],
  19661. r = new P.Euler(0, 0, 0, D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder),
  19662. o = new P.Euler().setFromQuaternion(n.quaternion, D.warp.eOrder),
  19663. a = new P.Euler(r.x - o.x, r.y - o.y, r.z - o.z, D.warp.eOrder)
  19664. ;(a.y = N.constrainedTurn(a.y)), (this.burnsDir = Math.sign(a.y))
  19665. var s = new P.Euler(0, 0, 0, D.warp.eOrder),
  19666. l = new P.Vector3(),
  19667. c = function (e, t) {
  19668. 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)
  19669. }.bind(this)
  19670. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19671. }),
  19672. (t.prototype.setBurnsDir = function () {
  19673. var e = this.playerControls.cameras[O.PANORAMA],
  19674. t = new P.Euler(0, 0, 0, D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder),
  19675. i = new P.Euler().setFromQuaternion(e.quaternion, D.warp.eOrder),
  19676. n = new P.Euler(t.x - i.x, t.y - i.y, t.z - i.z, D.warp.eOrder)
  19677. ;(n.y = N.constrainedTurn(n.y)), (this.burnsDir = Math.sign(n.y))
  19678. }),
  19679. (t.prototype.stepWarpPath = function (firstPos, e) {
  19680. var i = this.playerControls.cameras[O.PANORAMA]
  19681. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  19682. if (!n) {
  19683. return i.position.copy(this.warpDestPano.position), !0
  19684. }
  19685. /* if (!this.warpPathPoints)
  19686. return i.position.copy(this.warpDestPano.position),
  19687. !0;
  19688. var n = this.warpPathPoints[0] */
  19689. var r = this.warpDestPano.position
  19690. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  19691. var o = new P.Vector3()
  19692. e < 0.5
  19693. ? o
  19694. .copy(this.cameraHull[1])
  19695. .sub(n)
  19696. .normalize()
  19697. .multiplyScalar(D.warp.softPushDist * e)
  19698. .add(n)
  19699. : o
  19700. .copy(this.cameraHull[this.cameraHull.length - 2])
  19701. .sub(r)
  19702. .normalize()
  19703. .multiplyScalar(D.warp.softPushDist * D.warp.softPushEnd * (1 - e))
  19704. .add(r),
  19705. i.position.copy(o)
  19706. } else e < 0.5 ? i.position.copy(n) : i.position.copy(r)
  19707. }),
  19708. (t.prototype.interruptAndFastForward = function (e, t) {
  19709. this.warping &&
  19710. ((this.warpInterrupted = !0),
  19711. (this.warpInterruptionBlackoutStyle = e),
  19712. (this.warpInterruptionTravelTime = t),
  19713. (null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle) || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19714. (null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime) || (this.warpInterruptionTravelTime = D.minWarpTime))
  19715. }),
  19716. (t.prototype.warpCameraAim = function (e) {
  19717. var t = D.warp.minWarpTime
  19718. if (this.upcomingTransType === L.BLACK) t = D.warp.teleportTime
  19719. else {
  19720. var i = this.playerControls.cameras[O.PANORAMA],
  19721. n = new P.Euler(0, 0, 0, D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder),
  19722. r = new P.Euler().setFromQuaternion(i.quaternion, D.warp.eOrder),
  19723. o = new P.Euler(n.x - r.x, n.y - r.y, n.z - r.z, D.warp.eOrder)
  19724. o.y = N.constrainedTurn(o.y)
  19725. var a = (1e3 * Math.abs(o.y)) / P.Math.degToRad(D.warp.maxAimPerSec)
  19726. t = Math.max(t, a)
  19727. }
  19728. var s = function () {
  19729. this._warpStopFlying(), this.discardSlow(), e && e()
  19730. }.bind(this)
  19731. this._warpCameraAim(t, s)
  19732. }),
  19733. (t.prototype.warpCommonParameters = function (e, t, i, n) {
  19734. this.model.skybox.material.uniforms.blackout.value = n
  19735. var r = F.uniform(this.model.skybox, 'progress', 1),
  19736. o = F.allUniforms(this.model.chunks, 'progress', 1),
  19737. a = !1,
  19738. s = function () {
  19739. if (this.warpInterrupted) return (a = !0)
  19740. }.bind(this),
  19741. l = function (e, t) {
  19742. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19743. }.bind(this),
  19744. c = function (e, t) {
  19745. return i && a ? (o(0), !0) : void o(e, t)
  19746. }.bind(this)
  19747. 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')
  19748. }),
  19749. (t.prototype.warpTravel_STD = function (e) {
  19750. var l,
  19751. c = Math.min(D.warp.lookAheadMax, D.warp.lookAheadDist / this.warpLength),
  19752. h = this.playerControls.cameras[O.PANORAMA],
  19753. i = (Math.min(0.25, 3 / this.warpLength), Math.min(0.35, 7 / this.warpLength)),
  19754. u = new P.Euler(0, 0, 0, D.warp.eOrder),
  19755. d = new P.Vector3(),
  19756. p = new P.Euler().setFromQuaternion(h.quaternion, D.warp.eOrder),
  19757. f = new P.Euler().copy(p),
  19758. g = h.position.clone(),
  19759. m = new P.Matrix4(),
  19760. v = new P.Euler(),
  19761. t = D.warp.minWarpTime
  19762. ;(t += this.warpLength * D.warp.timePerMeter), 0.01 < D.warp.flySpeed && (t = (1e3 * this.warpLength) / D.warp.flySpeed)
  19763. function n(e) {
  19764. var t = i
  19765. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19766. }
  19767. var y = !1,
  19768. r = this.warpDestHeroLoc.quaternion,
  19769. o = new P.Vector3(0, 0, -1).applyQuaternion(r).normalize(),
  19770. A = this.warpPathPoints[this.warpPathPoints.length - 1]
  19771. .clone()
  19772. .sub(this.warpPathPoints[this.warpPathPoints.length - 2])
  19773. .normalize(),
  19774. a = A.dot(o),
  19775. C = P.Math.radToDeg(Math.acos(a)),
  19776. s = function () {
  19777. return (
  19778. m.lookAt(g, l, U.UP),
  19779. u.setFromRotationMatrix(m, D.warp.eOrder),
  19780. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19781. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19782. N.constrainedTurn(v.y)
  19783. )
  19784. }.bind(this),
  19785. I = function (e, t) {
  19786. if (this.warpInterrupted) return (y = !0)
  19787. }.bind(this),
  19788. E = function (e, t) {
  19789. return y || !this.warpPathPoints ? (k.blur(0), !0) : void k.blur(e)
  19790. }.bind(this),
  19791. _ = F.allUniforms(this.model.chunks, 'modelAlpha', 1),
  19792. b = function (e, t) {
  19793. return y || !this.warpPathPoints ? (_(0), !0) : void _(e, t)
  19794. }.bind(this),
  19795. w = function (e, t) {
  19796. if (!this.warpPathPoints) return h.position.copy(this.warpDestPano.position), !0
  19797. if (y) return !0
  19798. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e)
  19799. h.position.copy(i), (g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, 0.99 * e))
  19800. }.bind(this),
  19801. T = function (e, t) {
  19802. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug('Lost bunny.'), !0)
  19803. }.bind(this),
  19804. x = function (e, t) {
  19805. if (y) return H.debug('>>>> Walkthrough interupted at t=' + e), !0
  19806. if (!this.warpPathPoints) return !0
  19807. var i = this.warpLength * e,
  19808. n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist),
  19809. r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength)
  19810. D.warp.matchCam && (n *= 1 - r),
  19811. m.lookAt(g, l, U.UP),
  19812. u.setFromRotationMatrix(m, D.warp.eOrder),
  19813. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19814. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19815. (v.y = N.constrainedTurn(v.y)),
  19816. (u.x = p.x + n * v.x),
  19817. (u.y = p.y + n * v.y),
  19818. (u.z = p.z + n * v.z),
  19819. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  19820. (v.y = N.constrainedTurn(v.y))
  19821. var o = (P.Math.degToRad(D.warp.maxTurnPerSec) * t) / 1e3
  19822. ;(v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y))),
  19823. (f.x = f.x + v.x * D.warp.turnFriction),
  19824. (f.y = f.y + v.y * D.warp.turnFriction),
  19825. (f.z = f.z + v.z * D.warp.turnFriction),
  19826. (f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x))
  19827. var a = l.clone().sub(g).normalize()
  19828. if (C < D.warp.maxAimRotation && 0 < r) {
  19829. var s = 1 - r
  19830. ;(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()
  19831. }
  19832. this.bunnyObj.position.copy(h.position).add(a),
  19833. d.set(0, 0, -1).applyEuler(f).normalize(),
  19834. d.multiplyScalar(8),
  19835. d.add(h.position),
  19836. (1 - c < e && D.warp.matchCam) || (h.controls.lookAt(d), h.controls.lookVector.copy(d), h.lookAt(d))
  19837. }.bind(this),
  19838. S = function () {
  19839. y ? (this.discardSlow(), (this.upcomingTransType = L.BLACK), this.warpTravel_BLACK(-0.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  19840. }.bind(this)
  19841. T(0)
  19842. var M = D.warp.motionLeadTime + (1e3 * Math.abs(s())) / P.Math.degToRad(D.warp.maxTurnPerSec),
  19843. R = M / (t += M)
  19844. this.warpCommonParameters(t, R, !0, z.NONE),
  19845. V.start(I, t, null, 0, null, '_haltWatcher'),
  19846. 0 < D.warp.blur && ((k.blurStrength = D.warp.blur), V.start(E, t, null, R, n, 'blurring')),
  19847. V.start(b, t, null, R, n, 'modelAlpha'),
  19848. V.start(w, t, null, R, B[D.warp.blendEasing], 'followPath'),
  19849. V.start(T, t, null, R, B[D.warp.blendEasing], 'goBunny'),
  19850. V.start(x, t, S, 0, B[D.warp.blendEasing], 'lookAtBunny')
  19851. }),
  19852. (t.prototype.warpTravel_BLACK = function (e, t, i, n) {
  19853. var r = e || 0
  19854. null != t || (t = D.warp.teleportTime)
  19855. //add
  19856. player.model.hotGroup.visible = false
  19857. let oldPano = this.player.currentPano
  19858. let toPano = this.player.model.panos.get(this.warpDestHeroLoc.panoId)
  19859. this.player.emit('pano.chosen', oldPano, toPano)
  19860. var done = () => {
  19861. this.player.transitionPos({
  19862. type: 'beforeFlytopano',
  19863. pano: this.player.currentPano,
  19864. dur: 0,
  19865. callback: () => {
  19866. player.model.hotGroup.visible = true
  19867. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  19868. }
  19869. })
  19870. this.player.emit('flying.ended', toPano.position, oldPano.position, toPano, oldPano)
  19871. }
  19872. if (window.DATA.momentTourBlackNewType) {
  19873. player.sceneRenderer.effects.fastTranMaskPass.start(player.sceneRenderer)
  19874. var camera = this.playerControls.cameras['panorama']
  19875. var end = this.warpDestHeroLoc.position
  19876. camera.position.copy(end)
  19877. setTimeout(() => {
  19878. player.sceneRenderer.effects.fastTranMaskPass.stop()
  19879. this.wrapupWarpShadingOnly(n, i)
  19880. done()
  19881. }, t)
  19882. } else {
  19883. var o = function () {
  19884. this.wrapupWarpShadingOnly(n, i)
  19885. done()
  19886. }.bind(this)
  19887. var firstPos = this.player.position.clone() //add
  19888. V.start(this.stepWarpPath.bind(this, firstPos), t, o, r, B[D.warp.blendEasing], 'stepMotion')
  19889. }
  19890. this.warpCommonParameters(t, r, !1, i)
  19891. this.model.chunks.concat(this.model.skybox).forEach(function (e) {
  19892. // 改
  19893. if (window.DATA.momentTourBlackNewType) {
  19894. e.material.uniforms.blackout.value = 5 //i 改
  19895. //e.material.defines.newBlack = ''
  19896. //e.material.needsUpdate = true
  19897. } else {
  19898. e.material.uniforms.blackout.value = i
  19899. }
  19900. }),
  19901. this._warpBendAim(null, t, null, r)
  19902. /* this.warpCommonParameters(t, r, !1, i)
  19903. this.model.chunks.forEach(function(e) {
  19904. e.material.uniforms.blackout.value = i
  19905. }),
  19906. this._warpBendAim(null, t, null, r);
  19907. //add
  19908. var done = ()=>{
  19909. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  19910. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:100})//add
  19911. }
  19912. var o = function() {
  19913. this.wrapupWarpShadingOnly(n, i)
  19914. done()
  19915. }
  19916. .bind(this);
  19917. var firstPos = this.player.position.clone()//add
  19918. V.start(this.stepWarpPath.bind(this, firstPos), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19919. */
  19920. }),
  19921. (t.prototype.flightStepWalk =
  19922. ((a = new P.Vector3()),
  19923. (s = new P.Vector3()),
  19924. function (e, t, i) {
  19925. if (this.warpInterrupted) i && i()
  19926. else if (this.activeTransType !== L.WALK) this._clearWarpShading(), this._warpStopFlying(), this.player.spider.draw(), this.placeCpm(), i && i()
  19927. else if (this.player.currentPano !== e) {
  19928. var n = {
  19929. pano: e,
  19930. lookAtPoint: t,
  19931. duration: null,
  19932. maxDistanceOverride: D.warp.walkMaxDist,
  19933. skipWarpingCheck: !1,
  19934. constantMoveSpeed: !0
  19935. }
  19936. if (e == this.warpDestPano) {
  19937. //到达终点前,放大到终点的zoom
  19938. n.zoomLevel = this.warpDestHeroLoc.zoom
  19939. }
  19940. ;(n.duration = function (e, t) {
  19941. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime
  19942. s.copy(U.FORWARD), this.player.getDirection(s), a.copy(t).sub(e.position).normalize()
  19943. var n = a.dot(s),
  19944. r = Math.acos(n),
  19945. o = r / i
  19946. 0.001 < o &&
  19947. ((i *= o / 0.001), //-----这是什么????
  19948. r < 1 && (i *= 1.2))
  19949. return (i / DATA.tourWalkSpeed) * 100
  19950. }.call(this, e, t)),
  19951. this.player.nonInterruptingFlyToPano(n, i)
  19952. } else i && i()
  19953. })),
  19954. (t.prototype.makeWalkFlightFunc = function (e, t, i) {
  19955. return this.flightStepWalk.bind(this, e, t, i)
  19956. }),
  19957. (t.prototype.warpTravel_WALK =
  19958. ((f = []),
  19959. function (e) {
  19960. for (var t = this.player.model.panos, i = null, n = !1, r = (f.length = 0); r < this.nodes.length; r++) {
  19961. var o = this.nodes[r],
  19962. a = t.get(o)
  19963. this.nodes.length, (n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist), (i && n) || (f.push(o), (i = a))
  19964. }
  19965. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1])
  19966. var s = f.length,
  19967. l = t.get(f[s - 1]),
  19968. c = new Array(s + 1)
  19969. c[c.length - 1] = function () {
  19970. e && e()
  19971. }.bind(this)
  19972. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  19973. var d = f[h]
  19974. l = t.get(d)
  19975. var p = new P.Vector3()
  19976. this.getLookAtForWalkingTourNode(f, h, p), (c[u - 1] = this.makeWalkFlightFunc(l, p, c[u])), h--
  19977. }
  19978. c[0]()
  19979. })),
  19980. (t.prototype.getLookAtForWalkingTourNode =
  19981. ((c = new P.Vector3()),
  19982. (h = new P.Vector3()),
  19983. (u = new P.Vector3()),
  19984. (d = new P.Vector3()),
  19985. (p = new P.Vector3()),
  19986. function (e, t, i) {
  19987. var n = e.length
  19988. if (n <= t) return !1
  19989. var r = 1,
  19990. o = 1
  19991. h.set(0, 0, 0), p.set(0, 0, 0)
  19992. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  19993. if (((a = this.player.model.panos.get(e[s])), this.getOrientationForWalkingTourNode(e, s, u), s === t && c.copy(u), d.copy(u), t < s)) {
  19994. var l = d.dot(c) < 0.65
  19995. ;(r *= l ? 0.2 : 0.75), (o *= l ? 0.2 : 0.4)
  19996. }
  19997. u.multiplyScalar(r), h.add(u), p.lerp(a.position, o)
  19998. }
  19999. return h.normalize(), i.copy(p), i.add(h), !0
  20000. })),
  20001. (t.prototype.getOrientationForWalkingTourNode = function (e, t, i) {
  20002. var n = e.length
  20003. if (n <= t) return !1
  20004. if (t === n - 1) i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion)
  20005. else {
  20006. var r = this.player.model.panos.get(e[t]),
  20007. o = this.player.model.panos.get(e[t + 1])
  20008. i.copy(o.position).sub(r.position)
  20009. }
  20010. return i.normalize(), !0
  20011. }),
  20012. (t.prototype.warpCameraTravel = function (e, t, i, n) {
  20013. if (((this.activeTransType = this.upcomingTransType), (this.lastTransType = this.activeTransType), (this.upcomingTransType = null), e))
  20014. this.activeTransType === L.BLACK
  20015. ? this.warpTravel_BLACK(null, i, t, n)
  20016. : this.activeTransType === L.WALK
  20017. ? this.warpTravel_WALK(
  20018. function () {
  20019. this._clearWarpShading(), this._warpStopFlying(), this.player.spider.draw(), this.placeCpm(), n && n()
  20020. }.bind(this)
  20021. )
  20022. : this.warpTravel_STD(n)
  20023. else {
  20024. var r = function () {
  20025. this._wrapupTravel(n)
  20026. }.bind(this),
  20027. o = {
  20028. pano: this.warpDestPano,
  20029. lookAtPoint: null,
  20030. duration: null,
  20031. maxDistanceOverride: null,
  20032. skipWarpingCheck: !1
  20033. }
  20034. this.player.flyToPano(o, r)
  20035. }
  20036. }),
  20037. (t.prototype.startWarpState = function () {
  20038. ;(this.warping = !0), (this.warpInterrupted = !1), (this.warpInterruptionBlackoutStyle = null), (this.warpInterruptionTravelTime = null)
  20039. }),
  20040. (t.prototype.endWarpState = function () {
  20041. this.warping = !1
  20042. }),
  20043. (t.prototype.warpToPano = function (e, t, i, n) {
  20044. if (this.warping) H.warn('Cannot warp when already warping')
  20045. else {
  20046. if (((this.upcomingTransType = e), (this.activeTransType = null), !this.setWarpDestPano())) return (this.upcomingTransType = null), void this.warpToNonPano(n)
  20047. if (this.player.mode !== O.PANORAMA)
  20048. return (
  20049. (this.upcomingTransType = null),
  20050. this.discardSlow(),
  20051. void this.player.flyToNewMode({
  20052. mode: O.PANORAMA,
  20053. pano: this.warpDestPano,
  20054. duration: D.warp.outsideTime,
  20055. warpDest: this.warpDestHeroLoc,
  20056. callback: n,
  20057. force: !0
  20058. })
  20059. )
  20060. if (!this.warpDestPano) return H.warn('no warp destination, callback dropped'), void (this.upcomingTransType = null)
  20061. var r = !(
  20062. this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) &&
  20063. this.warpDestPano !== this.player.currentPano &&
  20064. this.warpDestPano.position.distanceTo(this.player.currentPano.position) < D.warp.nearPanoDist
  20065. ),
  20066. o = this.chooseWarpPath(r)
  20067. if (o && this.upcomingTransType !== L.WALK) {
  20068. var a = function () {
  20069. ;(this.waitingToWarp = !1), this.warpToPano(e, t, i, n)
  20070. }.bind(this)
  20071. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, 'high', 'low', this.player.basePanoSize, a)) return void (this.waitingToWarp = !0)
  20072. }
  20073. this.player.currentPano ||
  20074. (H.warn('Arrived at a very strange spot!'), (this.player.currentPano = this.warpDestPano), this.placeCpm(), this.fadeOutCpm(D.path.fadeOutTime), this.player.spider.draw()),
  20075. H.debug('Warping to pano ', this.warpDestPano.position),
  20076. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  20077. this.startWarpState()
  20078. var s = function () {
  20079. this.endWarpState(), n && n()
  20080. }.bind(this)
  20081. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  20082. }
  20083. }),
  20084. (v.exports = t)
  20085. }).call(this, '/js/objects/ShowPath.js')
  20086. },
  20087. {
  20088. '../constants': 8,
  20089. '../effects': 16,
  20090. '../enum/BlackoutStyle': 18,
  20091. '../enum/ModelManagerEvents': 33,
  20092. '../enum/PlayerEvents': 40,
  20093. '../enum/RenderOrder': 42,
  20094. '../enum/Vectors': 50,
  20095. '../enum/Viewmode': 51,
  20096. '../enum/WarpStyle': 52,
  20097. '../gui/gui': 65,
  20098. '../model/ModelManager': 140,
  20099. '../objects/Snapshot': 153,
  20100. '../settings': 166,
  20101. '../shaders': 167,
  20102. '../util/easing': 186,
  20103. '../util/lerp': 188,
  20104. '../util/logger': 189,
  20105. '../util/math': 190,
  20106. '../util/texture': 194,
  20107. '../util/transitions': 195,
  20108. three: 217
  20109. }
  20110. ],
  20111. 152: [
  20112. function (e, t, i) {
  20113. 'use strict'
  20114. function n() {
  20115. var e = new r.SphereBufferGeometry(a.skyboxRadius, 20, 5),
  20116. t = new r.RawShaderMaterial({
  20117. fragmentShader: o.skysphere.fragmentShader,
  20118. vertexShader: o.skysphere.vertexShader,
  20119. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  20120. side: r.BackSide,
  20121. name: 'skysphere'
  20122. })
  20123. ;(t.uniforms.radius.value = e.parameters.radius), r.Mesh.call(this, e, t)
  20124. }
  20125. var r = e('three'),
  20126. o = e('../shaders'),
  20127. a = e('../settings')
  20128. ;((n.prototype = Object.create(r.Mesh.prototype)).constructor = n), (t.exports = n)
  20129. },
  20130. {
  20131. '../settings': 166,
  20132. '../shaders': 167,
  20133. three: 217
  20134. }
  20135. ],
  20136. 153: [
  20137. function (r, o, e) {
  20138. ;(function (e) {
  20139. 'use strict'
  20140. function t(e) {
  20141. n.call(this, e),
  20142. (this.sid = e.sid),
  20143. (this.panoId = e.panoId),
  20144. (this.orthoZoom = e.orthoZoom),
  20145. (this.floorVisibility = e.floorVisibility),
  20146. (this.thumbUrl = e.thumbUrl),
  20147. (this.name = e.name),
  20148. (this.zoom = e.zoom)
  20149. }
  20150. var i = (r('three'), r('../util/logger')),
  20151. n = (r('../settings'), r('../enum/Viewmode'), r('../util/common'), r('../util/transitions'), r('../util/lerp'), r('../util/ajax'), r('../util/texture'), r('./View'))
  20152. r('events').EventEmitter,
  20153. new i(e),
  20154. ((t.prototype = Object.create(n.prototype)).isPano = function () {
  20155. return this.panoId && '' !== this.panoId && this.panoId != 'outside'
  20156. }),
  20157. (o.exports = t)
  20158. }).call(this, '/js/objects/Snapshot.js')
  20159. },
  20160. {
  20161. '../enum/Viewmode': 51,
  20162. '../settings': 166,
  20163. '../util/ajax': 181,
  20164. '../util/common': 185,
  20165. '../util/lerp': 188,
  20166. '../util/logger': 189,
  20167. '../util/texture': 194,
  20168. '../util/transitions': 195,
  20169. './View': 154,
  20170. events: 202,
  20171. three: 217
  20172. }
  20173. ],
  20174. 154: [
  20175. function (o, a, e) {
  20176. ;(function (e) {
  20177. 'use strict'
  20178. function t(e) {
  20179. ;(e = e || {}), (this.position = new i.Vector3()), (this.quaternion = new i.Quaternion()), this.update(e)
  20180. }
  20181. var i = o('three'),
  20182. n = o('../util/logger'),
  20183. r = (o('../settings'), o('../enum/Viewmode'), o('../util/common'), o('../util/transitions'), o('../util/lerp'), o('../util/ajax'), o('../util/texture'), o('events').EventEmitter)
  20184. new n(e),
  20185. ((t.prototype = Object.create(r.prototype)).isValid = function () {
  20186. return !!this.cameraMode
  20187. }),
  20188. (t.prototype.update = function (e) {
  20189. return (
  20190. (this.cameraMode = e.cameraMode || this.cameraMode),
  20191. (this.pano = e.pano || this.pano),
  20192. e.position && this.position.copy(e.position),
  20193. e.quaternion && this.quaternion.copy(e.quaternion),
  20194. this
  20195. )
  20196. }),
  20197. (a.exports = t)
  20198. }).call(this, '/js/objects/View.js')
  20199. },
  20200. {
  20201. '../enum/Viewmode': 51,
  20202. '../settings': 166,
  20203. '../util/ajax': 181,
  20204. '../util/common': 185,
  20205. '../util/lerp': 188,
  20206. '../util/logger': 189,
  20207. '../util/texture': 194,
  20208. '../util/transitions': 195,
  20209. events: 202,
  20210. three: 217
  20211. }
  20212. ],
  20213. 155: [
  20214. function (J, ee, e) {
  20215. ;(function (e) {
  20216. 'use strict'
  20217. function t(e) {
  20218. ;(this.currentPano = null),
  20219. (this.nextPano = null),
  20220. (this.camera = null),
  20221. (this.paused = !1),
  20222. (this.flying = !1),
  20223. (this.sceneIntersectionPlane = null),
  20224. (this.target = new B.Vector3()),
  20225. (this.mouse = new B.Vector3(1.1, 1.1, 0.5)),
  20226. (this.mouseAtMouseDown = new B.Vector2()),
  20227. (this.mouseCouldBeClickToMove = !1),
  20228. (this.mouseLastMoveTime = Date.now()),
  20229. (this.mouseDown = !1),
  20230. (this.mouseDownTimer = null),
  20231. (this.couldBeLongTap = !1),
  20232. (this.containsMouse = !0),
  20233. (this.isTouchEvent = !1),
  20234. (this.isPanoHover = !1),
  20235. (this.reticule = new n(this)),
  20236. (this.panoMarkers = []),
  20237. (this.spider = new s(this)),
  20238. (this.quaternion = new B.Quaternion()),
  20239. (this.position = new B.Vector3(15, 10, 15)),
  20240. (this.previousState = null),
  20241. (this.lastInsideView = new o()),
  20242. (this.last360View = new o()),
  20243. (this.raycaster = new B.Raycaster()),
  20244. (this.intersect = null),
  20245. (this.lastChangeTime = Date.now()),
  20246. (this.history = new h()),
  20247. (this.cameraControls = null),
  20248. (this.path = null),
  20249. (this.model = null),
  20250. (this.domElement = null),
  20251. (this.cachedPanoCandidates = null),
  20252. (this.basePanoSize = 0),
  20253. (this.standardPanoSize = 0),
  20254. (this.highPanoSize = 0),
  20255. (this.ultraHighPanoSize = 0),
  20256. (this.zoomLevel = 1),
  20257. (this.zooming = 0),
  20258. (this.zoomSpeed = 0.5),
  20259. (this.scrollZoomSpeed = 0.06),
  20260. (this.zoomSpeedAdjust = 0.05),
  20261. (this.defaultZoomIncrement = 0.2),
  20262. (this.baseFov = k.insideFOV),
  20263. (this.zoomFov = this.baseFov),
  20264. (this.zoomEnabled = !0),
  20265. (this.preRenderingEnabled = !1),
  20266. this.setupCustomProperties(e),
  20267. (this.zoomStats = new v()),
  20268. (this.modeTran = '') //'dollhouse-panorama'
  20269. this.currentCursor = ''
  20270. window.player = this
  20271. }
  20272. var B = J('three'),
  20273. i = J('./util/logger'),
  20274. n = J('./objects/Reticule'),
  20275. a = J('./objects/Panorama'),
  20276. r = J('./objects/ShowPath'),
  20277. o = J('./objects/View'),
  20278. s = (J('./objects/Snapshot'), J('./objects/NSpider')),
  20279. V = J('./enum/Viewmode'),
  20280. T = (J('./enum/TagStates'), J('./enum/Vectors')),
  20281. l = J('./enum/Keys'),
  20282. k = (J('./enum/AlignmentType'), J('./settings')),
  20283. x = J('./util/common'),
  20284. U = (J('./util/browser'), J('./util/math')),
  20285. H = J('./util/lerp'),
  20286. z = J('./util/easing'),
  20287. G = J('./util/transitions'),
  20288. c = J('events').EventEmitter,
  20289. h = (J('./shaders'), J('./util/history')),
  20290. S = (J('./util/camera'), J('./model/ModelManager'), J('./enum/PathDiscardMode')),
  20291. M = J('./enum/PathDisplayMode'),
  20292. W = J('./enum/PlayerEvents'),
  20293. u = J('./enum/ControlEvents'),
  20294. d = J('./enum/ModelManagerEvents'),
  20295. R = J('./enum/WarpStyle'),
  20296. P = J('./enum/BlackoutStyle'),
  20297. p = J('./exception/BasicException'),
  20298. f = J('./enum/PanoSizeClass'),
  20299. g = (J('./tile/TileDownloader'), J('./tile/TilePrioritizer')),
  20300. m = (J('./enum/PanoramaEvents'), J('./enum/ZoomEvents')),
  20301. v = J('./util/ZoomStats'),
  20302. y = J('./constants'),
  20303. j = J('./util/common'),
  20304. A = J('./util/cameraLight'),
  20305. //, C = J("hot")
  20306. Y = new i(e),
  20307. q = Object.freeze({
  20308. FlyToPano: G.getUniqueId(),
  20309. FlyToNewMode: G.getUniqueId(),
  20310. FlyToSameMode: G.getUniqueId(),
  20311. FlyToViewFloor: G.getUniqueId(),
  20312. LookTransition: G.getUniqueId(),
  20313. ZoomTransition: G.getUniqueId()
  20314. })
  20315. function I(e) {
  20316. 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)
  20317. return new Blob([o], {
  20318. type: i
  20319. })
  20320. }
  20321. ;((t.prototype = Object.create(c.prototype)).init = function (e) {
  20322. ;(this.modelManager = e.modelManager),
  20323. (this.tileDownloader = e.tileDownloader),
  20324. (this.panoRenderer = e.panoRenderer),
  20325. (this.qualityManager = e.qualityManager),
  20326. (this.domElement = e.container),
  20327. (this.camera = e.camera),
  20328. (this.tagManager = e.tagManager),
  20329. (this.cameraControls = e.controls),
  20330. (this.path = new r(e.director, this, e.controls)),
  20331. (this.basePanoSize = this.qualityManager.getPanoSize(f.BASE)),
  20332. (this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD)),
  20333. (this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH)),
  20334. (this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH)),
  20335. (this.tileDownloader.processPriorityQueue = !1),
  20336. (this.tileDownloader.tilePrioritizer = new g(this.qualityManager, this.basePanoSize, this.standardPanoSize, this.highPanoSize, this.ultraHighPanoSize)),
  20337. this.bindEvents(e.container),
  20338. this.updateModel()
  20339. //add
  20340. this.raycaster.linePrecision = 0.1
  20341. }),
  20342. (t.prototype.screenShot = function (i) {
  20343. if (!this.flying && !this.flyingToTag) {
  20344. var n = this.sceneRenderer
  20345. n.updateScreenSize(i)
  20346. this.model.panos.forEach(e => {
  20347. if (e.marker) {
  20348. e.marker.forceHide = e.marker.visible
  20349. e.marker.visible = !1
  20350. }
  20351. })
  20352. /* for (var e in this.model.hots)
  20353. this.model.hots[e].mesh.visible = !1; */
  20354. player.model.hotGroup.visible = false
  20355. ;(this.reticule.visible = !1),
  20356. (this.reticule.forceUnvisible = !0),
  20357. (this.path.currentPanoMarker.mesh.visible = !1),
  20358. setTimeout(
  20359. function () {
  20360. n.renderer.clear(!0, !0, !0), n.renderer.render(n.scene, n.camera)
  20361. var e = n.renderer.domElement.toDataURL(i.type, 0.9)
  20362. i.f && i.f(e)
  20363. n.updateScreenSize({
  20364. resize: !0
  20365. })
  20366. this.reticule.visible = !0
  20367. player.model.hotGroup.visible = true
  20368. this.model.panos.forEach(e => {
  20369. e.marker && (e.marker.visible = e.marker.forceHide)
  20370. })
  20371. ;(this.path.currentPanoMarker.mesh.visible = !0), n.renderer.render(n.scene, n.camera)
  20372. }.bind(this),
  20373. 30
  20374. )
  20375. }
  20376. })
  20377. var E,
  20378. _,
  20379. b,
  20380. w,
  20381. O,
  20382. L,
  20383. D,
  20384. N,
  20385. F,
  20386. X,
  20387. Z,
  20388. K,
  20389. Q = J('scaleImg')
  20390. t.prototype.getWrapShot = function () {
  20391. var i = this.getSnapAngleInfo(),
  20392. n = ',{\r\t' + i,
  20393. r = arguments[0]
  20394. this.screenShot({
  20395. width: g_snapShotWidth,
  20396. height: g_snapShotHeight,
  20397. type: 'image/jpeg',
  20398. f: function (e) {
  20399. if (r && r.__callback) return r.__callback(e, i)
  20400. var t = new Image()
  20401. ;(t.src = e),
  20402. (t.onload = function () {
  20403. var e = (function (r, i) {
  20404. function n(e, t) {
  20405. var i = o || r,
  20406. n = document.createElement('canvas')
  20407. ;(n.width = i.width), (n.height = i.height), n.getContext('2d').drawImage(i, 0, 0, i.width, i.height), (o = Q(e, n, t))
  20408. }
  20409. function e() {
  20410. var e = o || r,
  20411. t = I(e.src)
  20412. 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))
  20413. }
  20414. var o,
  20415. t = Math.max(r.width, r.height)
  20416. return (
  20417. 'png' != i.toType &&
  20418. ('jpeg' == i.oldType
  20419. ? (t > i.maxSize && n(i.maxSize / t, 'jpeg'), e())
  20420. : 'png' == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, 'jpeg'), e())),
  20421. o || r
  20422. )
  20423. })(this, {
  20424. maxSize: g_snapShotWidth,
  20425. oldType: 'jpeg'
  20426. })
  20427. e.src.replace(
  20428. (function (e) {
  20429. return 'image/' + (e = e.toLowerCase().replace(/jpg/i, 'jpeg')).match(/png|jpeg|bmp|gif/)[0]
  20430. })('image/jpeg'),
  20431. 'image/octet-stream'
  20432. )
  20433. var t = 'snap' + new Date().getTime()
  20434. !(function (e, t) {
  20435. var i = document.createElementNS('http://www.w3.org/1999/xhtml', 'a')
  20436. ;(i.href = e), (i.download = t)
  20437. var n = document.createEvent('MouseEvents')
  20438. n.initMouseEvent('click', !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), i.dispatchEvent(n)
  20439. })(e.src, t + '.jpg'),
  20440. (n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",'),
  20441. (n += '\r\t"sid":"' + t + '",'),
  20442. (n += '\r\t"name":"' + t + '"\r}'),
  20443. logData(n)
  20444. })
  20445. }
  20446. })
  20447. }
  20448. /* ,
  20449. t.prototype.getSnapAngleInfo = function() {
  20450. var e = {}
  20451. , t = '"metadata":{'
  20452. , i = this.camera.quaternion.clone();
  20453. switch (this.mode) {
  20454. case "panorama":
  20455. e.scan_id = this.currentPano.id,
  20456. t += '"scan_id":"' + this.currentPano.id + '",';
  20457. break;
  20458. case "floorplan":
  20459. e.camera_mode = 1,
  20460. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20461. t += '"camera_mode":1,',
  20462. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20463. break;
  20464. case "dollhouse":
  20465. e.camera_mode = 2,
  20466. t += '"camera_mode":2,'
  20467. }
  20468. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20469. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20470. n.x *= -1,
  20471. n.w *= -1,
  20472. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20473. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20474. e.zoom = this.zoomLevel,
  20475. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20476. }
  20477. , */
  20478. ;(t.prototype.getSnapAngleInfo = function () {
  20479. var info = {}
  20480. var str = '"metadata":{'
  20481. var q = this.camera.quaternion.clone()
  20482. switch (this.mode) {
  20483. case 'panorama':
  20484. info.scan_id = this.currentPano.id
  20485. str += '"scan_id":"' + this.currentPano.id + '",'
  20486. break
  20487. case 'floorplan':
  20488. info.camera_mode = 1
  20489. q = new B.Quaternion().setFromAxisAngle(new B.Vector3(0, 1, 0), B.Math.degToRad(90))
  20490. q.multiply(this.camera.quaternion)
  20491. str += '"camera_mode":1,'
  20492. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20493. str += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ','
  20494. break
  20495. case 'dollhouse':
  20496. info.camera_mode = 2
  20497. str += '"camera_mode":2,'
  20498. break
  20499. }
  20500. info.camera_position = U.toPrecision(this.camera.position.toArray(), 4)
  20501. //console.log(info.camera_position)
  20502. info.camera_quaternion = U.toPrecision(q.toArray(), 4)
  20503. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20504. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20505. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20506. out.x *= -1;
  20507. out.w *= -1;
  20508. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20509. }else{
  20510. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20511. } */
  20512. info.zoom = this.zoomLevel
  20513. //console.log(info.camera_quaternion)
  20514. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20515. // fyz 扩展编辑页面, 加上导览点缩放值
  20516. str += '"camera_position":[' + info.camera_position + '],"camera_quaternion":[' + info.camera_quaternion + '], "zoom":' + info.zoom + '}'
  20517. console.log(str)
  20518. return str
  20519. }),
  20520. //------end
  20521. (t.prototype.setupCustomProperties = function (e) {
  20522. var i = e || V.PANORAMA
  20523. Object.defineProperty(this, 'mode', {
  20524. get: function () {
  20525. return i
  20526. },
  20527. set: function (e) {
  20528. var t = i
  20529. ;(i = e), this.onModeUpdated(t, i)
  20530. }
  20531. })
  20532. }),
  20533. (t.prototype.isInMode = function () {
  20534. for (var e = 0; e < arguments.length; e++) if (this.mode === arguments[e]) return !0
  20535. return !1
  20536. }),
  20537. (t.prototype.isOutsideMode = function (e) {
  20538. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20539. }),
  20540. (t.prototype.is360View = function (e, t) {
  20541. return e === V.PANORAMA && t && !t.isAligned()
  20542. }),
  20543. (t.prototype.setScene = function (e) {
  20544. ;(this.sceneIntersectionPlane = e.plane), this.path.setScene(e), this.moveReticuleToScene(e)
  20545. }),
  20546. (t.prototype.moveReticuleToScene = function (e) {
  20547. this.reticule.parent && this.reticule.parent.remove(this.reticule), e.add(this.reticule)
  20548. }),
  20549. (t.prototype.updateModel = function () {
  20550. function n(e) {
  20551. var t = this.cameraControls.cameras[V.DOLLHOUSE],
  20552. i = this.cameraControls.controls[V.DOLLHOUSE],
  20553. n = t.position.y + (e - i.target.y),
  20554. r = k.showFloorDuration + k.showFloorDelay
  20555. G.start(H.property(i.target, 'y', e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20556. G.start(H.property(t.position, 'y', n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20557. }
  20558. ;(this.model = this.modelManager.getActiveModel()),
  20559. this.model.on(
  20560. 'floor.changed',
  20561. function (e, t, i) {
  20562. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20563. }.bind(this)
  20564. ),
  20565. this.model.on(
  20566. 'allfloors.toggled',
  20567. function (e, t) {
  20568. if (this.mode === V.DOLLHOUSE) {
  20569. var i = e ? this.model.center.y : (i = t.center.y)
  20570. n.call(this, i)
  20571. }
  20572. }.bind(this)
  20573. ),
  20574. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model))
  20575. var t = this
  20576. this.model.panos.list.forEach(function (e) {
  20577. e.vrMarker.addEventListener('click', function () {
  20578. t.flyToPano({
  20579. pano: e
  20580. })
  20581. })
  20582. })
  20583. }),
  20584. (t.prototype.updateModelDependentData = function () {
  20585. this.cameraControls.setModelForControls(this.model), this.getPanoMarkersFromModel(this.model)
  20586. }),
  20587. (t.prototype.onModelChanged = function () {
  20588. this.updateModel(), this.updateModelDependentData()
  20589. }),
  20590. (t.prototype.getPanoMarkersFromModel = function (e) {
  20591. this.panoMarkers = e.panos.list.reduce(function (e, t) {
  20592. return t.marker ? e.concat(t.marker) : e
  20593. }, [])
  20594. }),
  20595. (t.prototype.handleControlMove = function (e) {
  20596. this.emit(W.Move, e)
  20597. }),
  20598. (t.prototype.handleControlInputStart = function (e) {
  20599. this.emit(W.InputStart, e)
  20600. }),
  20601. (t.prototype.onModeUpdated = function (e, t) {
  20602. this.cameraControls.activateControls(t), this.emit(W.ModeChanged, e, t)
  20603. }),
  20604. (t.prototype.isWarping = function () {
  20605. return this.path.warping
  20606. }),
  20607. (t.prototype.isWaitingToWarp = function () {
  20608. return this.path.waitingToWarp
  20609. }),
  20610. (t.prototype.getLabelScaleFactor = function () {
  20611. if (this.isOutsideMode()) {
  20612. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20613. }
  20614. return 0.5
  20615. }),
  20616. (t.prototype.bindEvents = function (e) {
  20617. e !== document && e.setAttribute('tabindex', -1),
  20618. e.addEventListener('mousedown', this.onMouseDown.bind(this)),
  20619. e.addEventListener('mousemove', this.onMouseMove.bind(this)),
  20620. e.addEventListener('mouseover', this.onMouseOver.bind(this)),
  20621. e.addEventListener('mouseout', this.onMouseOut.bind(this)),
  20622. e.addEventListener('mouseup', this.onMouseUp.bind(this)),
  20623. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20624. e.addEventListener('touchstart', this.onTouchStart.bind(this)),
  20625. e.addEventListener('touchmove', this.onTouchMove.bind(this)),
  20626. e.addEventListener('touchend', this.onTouchEnd.bind(this)),
  20627. e.addEventListener('pointerdown', this.onPointerDown.bind(this)),
  20628. e.addEventListener('pointermove', this.onPointerMove.bind(this)),
  20629. e.addEventListener('pointerup', this.onPointerUp.bind(this)),
  20630. document.addEventListener('pointerup', () => {
  20631. //add
  20632. window.transformControls && transformControls.onPointerUp()
  20633. }),
  20634. e.addEventListener('pointerout', this.onPointerOut.bind(this)),
  20635. e.addEventListener('pointercancel', this.onPointerCancel.bind(this)),
  20636. document.addEventListener('keydown', this.onKeyDown.bind(this)),
  20637. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20638. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20639. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20640. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20641. window.addEventListener('snapshotBegin', this.getWrapShot.bind(this)),
  20642. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20643. window.getSeft && getSeft(this)
  20644. }),
  20645. (t.prototype.onMouseDown = function (e) {
  20646. e.currentTarget !== document && e.currentTarget.focus(), 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1), this.updateIntersect())
  20647. }),
  20648. (t.prototype.onMouseMove = function (e) {
  20649. ;(this.isTouchEvent = !1), this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20650. }),
  20651. (t.prototype.onMouseOver = function (e) {
  20652. ;(this.containsMouse = !0), !this.mouseDown || (0 !== e.which && 0 !== e.buttons) || (this.mouseDown = !1)
  20653. }),
  20654. (t.prototype.onMouseOut = function (e) {
  20655. this.containsMouse = !1
  20656. }),
  20657. (t.prototype.onMouseUp = function (e) {
  20658. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20659. }),
  20660. (t.prototype.onTouchStart = function (e) {
  20661. if ((e.currentTarget !== document && e.currentTarget.focus(), !this.mouseDown)) {
  20662. this.couldBeLongTap = !0
  20663. var t = x.average(e.changedTouches, 'clientX'),
  20664. i = x.average(e.changedTouches, 'clientY')
  20665. this.handleInputStart.call(this, t, i, !0),
  20666. (this.mouseDownTimer = setTimeout(
  20667. function () {
  20668. this.updateIntersect(), this.handleInputEnd.call(this, t, i, !0)
  20669. }.bind(this),
  20670. k.input.longTapThreshold
  20671. ))
  20672. }
  20673. }),
  20674. (t.prototype.onTouchMove = function (e) {
  20675. var t = x.average(e.changedTouches, 'clientX'),
  20676. i = x.average(e.changedTouches, 'clientY')
  20677. this.handleInputMove.call(this, t, i, !0)
  20678. }),
  20679. (t.prototype.onTouchEnd = function (e) {
  20680. if ((clearTimeout(this.mouseDownTimer), this.mouseDown)) {
  20681. ;(this.couldBeLongTap = !1), this.updateIntersect()
  20682. var t = x.average(e.changedTouches, 'clientX'),
  20683. i = x.average(e.changedTouches, 'clientY')
  20684. this.handleInputEnd.call(this, t, i, !0)
  20685. }
  20686. }),
  20687. (t.prototype.onPointerDown = function (e) {
  20688. return (
  20689. e.currentTarget !== document && e.currentTarget.focus(),
  20690. this.mouseDown || 'mouse' === e.pointerType
  20691. ? this.onMouseDown(e)
  20692. : ((this.couldBeLongTap = !0),
  20693. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20694. void (this.mouseDownTimer = setTimeout(
  20695. function () {
  20696. this.updateIntersect(), this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20697. }.bind(this),
  20698. k.input.longTapThreshold
  20699. )))
  20700. )
  20701. }),
  20702. (t.prototype.onPointerMove = function (e) {
  20703. 'mouse' !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20704. }),
  20705. (t.prototype.onPointerUp = function (e) {
  20706. return this.mouseDown && 'mouse' !== e.pointerType
  20707. ? (clearTimeout(this.mouseDownTimer), (this.couldBeLongTap = !1), this.updateIntersect(), void this.handleInputEnd.call(this, e.clientX, e.clientY, !0))
  20708. : this.onMouseUp(e)
  20709. }),
  20710. (t.prototype.onPointerOut = function (e) {
  20711. this.mouseDown = !1
  20712. }),
  20713. (t.prototype.onPointerCancel = function (e) {
  20714. this.mouseDown = !1
  20715. }),
  20716. (t.prototype.onKeyDown = function (e) {
  20717. var t = function () {
  20718. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, 'key')
  20719. }.bind(this),
  20720. i = e.which
  20721. switch (i) {
  20722. case l.F:
  20723. t(), this.changeFloor(-1)
  20724. break
  20725. case l.R:
  20726. t(), this.changeFloor(1)
  20727. }
  20728. if (this.mode === V.PANORAMA)
  20729. switch (i) {
  20730. case l.UPARROW:
  20731. case l.W:
  20732. this.flyLocalDirection(T.FORWARD.clone())
  20733. break
  20734. case l.DOWNARROW:
  20735. case l.S:
  20736. this.flyLocalDirection(T.BACK.clone())
  20737. break
  20738. case l.A:
  20739. this.flyLocalDirection(T.LEFT.clone())
  20740. break
  20741. case l.D:
  20742. this.flyLocalDirection(T.RIGHT.clone())
  20743. }
  20744. }),
  20745. (t.prototype.handleScrollPinchZoom = function (e) {
  20746. var t = e,
  20747. i = this.zoomLevel
  20748. this.zoomBy(t), this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20749. }),
  20750. (t.prototype.handleControlPinch = function (e) {
  20751. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0, 0, e).normalize())
  20752. }),
  20753. (t.prototype.handleControlScroll = function (e) {
  20754. k.zoom.enabled
  20755. ? (0 < e ? (e = 1 + this.scrollZoomSpeed) : e < 0 && (e = 1 - this.scrollZoomSpeed), 0 !== e && this.handleScrollPinchZoom(e))
  20756. : this.flyLocalDirection(new B.Vector3(0, 0, -e).normalize())
  20757. }),
  20758. (t.prototype.handleInputStart = function (e, t, i) {
  20759. var n = this.handelPadding(e, t)
  20760. ;(e = n.x),
  20761. (t = n.y),
  20762. (this.isTouchEvent = i),
  20763. U.convertScreenPositionToNDC(e, t, this.mouse),
  20764. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20765. (this.mouseCouldBeClickToMove = !0),
  20766. (this.mouseDown = !0)
  20767. //this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  20768. this.mouseCouldBeClickToMove && editTool.hotpoint.addHot()
  20769. window.transformControls && transformControls.onPointerDown()
  20770. }),
  20771. (t.prototype.handelPadding = function (e, t) {
  20772. return (
  20773. this.pad ||
  20774. (this.pad = {
  20775. x: dom.getOffset('left', $('#player')[0]),
  20776. y: dom.getOffset('top', $('#player')[0])
  20777. }),
  20778. {
  20779. x: e - this.pad.x,
  20780. y: t - this.pad.y
  20781. }
  20782. )
  20783. }),
  20784. (t.prototype.handleInputMove = function (e, t, i) {
  20785. var n = this.handelPadding(e, t)
  20786. ;(e = n.x), (t = n.y), (this.isTouchEvent = i), U.convertScreenPositionToNDC(e, t, this.mouse)
  20787. var moveToleranceNDC = window.transformControls && transformControls.visible ? 0.0000001 : k.input.moveToleranceNDC
  20788. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && ((this.mouseCouldBeClickToMove = !1), (this.couldBeLongTap = !1), clearTimeout(this.mouseDownTimer)),
  20789. (this.mouseLastMoveTime = Date.now()),
  20790. this.reticule.move(e, t, i)
  20791. window.transformControls && transformControls.onPointerMove()
  20792. }),
  20793. (t.prototype.handleInputEnd = function (e, t, i) {
  20794. if (((this.isTouchEvent = i), (this.mouseDown = !1), this.cameraControls.controls[V.PANORAMA].emit('interaction.direct'), !i && this.couldBeLongTap)) return !0
  20795. if (this.handleLongTap()) return !0
  20796. window.transformControls && transformControls.onPointerUp()
  20797. if (this.mouseCouldBeClickToMove) {
  20798. if (this.flying) return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType), !0
  20799. //add----
  20800. if (this.checkHotClick()) return !0
  20801. if (window.VisiSet && VisiSet.setPanoVisible) {
  20802. //正在设置漫游可行
  20803. this.intersect && this.intersect.object.visible && VisiSet.dealPanoVisible(this.intersect.object.name)
  20804. return
  20805. }
  20806. if (window.VisiSet && VisiSet.setTagVisible) {
  20807. VisiSet.tagVsetting && this.intersect && this.intersect.object.visible && VisiSet.dealTagVisible(this.intersect.object.name)
  20808. return
  20809. }
  20810. if (window.VisiSet && VisiSet.setPanoLog) {
  20811. this.intersect && this.intersect.object.visible && VisiSet.dealPanoLogClick(this.intersect.object)
  20812. return
  20813. }
  20814. if (window.VisiSet && VisiSet.setRoute) {
  20815. this.intersect && this.intersect.object.visible && VisiSet.dealRouteClick(this.intersect.object)
  20816. return
  20817. }
  20818. if (window.VisiSet && VisiSet.setPanoArea) {
  20819. this.intersect && this.intersect.object.visible && VisiSet.dealPanoAreaClick(this.intersect.object)
  20820. return
  20821. }
  20822. if (this.hoveringPlane) {
  20823. this.clickOverlay(this.hoveringPlane)
  20824. return
  20825. }
  20826. if (window.EditOverlay && EditOverlay.objCursorType == 'overlay') {
  20827. return EditOverlay.addPlane({ intersect: this.intersect })
  20828. }
  20829. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  20830. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  20831. else if(objects.mainDesign.editType == "addOverlay")return !0;
  20832. } */
  20833. //----------
  20834. if (this.intersect) {
  20835. // for cad add door etc.
  20836. let result = {}
  20837. this.emit('getIntersect', this.intersect, state => {
  20838. //consume
  20839. result.consume = true
  20840. })
  20841. if (result.consume) return //有效使用了,就return
  20842. }
  20843. if ((this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? 'touch' : 'mouse'), this.history.invalidate(), this.intersect))
  20844. return this.flyToPanoClosestToMouse()
  20845. if (this.mode === V.PANORAMA) {
  20846. var n = this.closestPanoInDirection(this.getMouseDirection())
  20847. return n
  20848. ? this.flyToPano({
  20849. pano: n
  20850. })
  20851. : this.bump(this.getMouseDirection())
  20852. }
  20853. }
  20854. //this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20855. }),
  20856. (t.prototype.handleLongTap = function () {
  20857. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA)) return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, 'touch'), !0
  20858. }),
  20859. (t.prototype.checktagClick = function () {
  20860. if (this.tagManager.intersectTag) {
  20861. var e = this.isTouchEvent,
  20862. t = this.tagManager.clickedOnTag(e, this)
  20863. return e || t || G.cancelById(q.LookTransition), !0
  20864. }
  20865. if (this.tagManager.activeTag) return this.tagManager.dismissActiveTag(), !1
  20866. }),
  20867. (t.prototype.rankedtagInDirection = function (e, t) {
  20868. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20869. }),
  20870. (t.prototype.start = function (e) {
  20871. $('.toolLeft').removeClass('unable')
  20872. $('.toolTop').removeClass('unable')
  20873. //-------------------
  20874. window.initTransformCtl(B)
  20875. //this.model.loadOverlays()
  20876. //window.EditOverlay && window.EditOverlay.init(B);
  20877. window.VisiSet && VisiSet.init()
  20878. //-------------------
  20879. var t = e.mode,
  20880. i = e.pano,
  20881. n = e.position,
  20882. r = e.quaternion,
  20883. o = e.tag,
  20884. a = e.quickstart,
  20885. s = $.Deferred()
  20886. this.updateModelDependentData(), this.updateFromControls(), this.findDefaultViews()
  20887. var l = this.is360View(t, i)
  20888. return (
  20889. !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20890. s.done(
  20891. function (e) {
  20892. this.emit(W.Ready, l, e, o)
  20893. }.bind(this)
  20894. ),
  20895. s.promise()
  20896. )
  20897. }),
  20898. (t.prototype.startOutside = function (e, t) {
  20899. var i = e.mode,
  20900. n = e.pano,
  20901. r = e.position,
  20902. o = e.quaternion,
  20903. a = e.zoom,
  20904. s = e.floorVisibility,
  20905. l = e.tag
  20906. this.emit(W.StartOutside, k[i].transitionTime),
  20907. this.isOutsideMode(i)
  20908. ? (this.model.warpDestFloors(s, !0), G.cancelById(q.FlyToViewFloor), i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o), t.resolve(!1))
  20909. : this.startInsideWithFlyin(n, r, o, l, t)
  20910. }),
  20911. (t.prototype.startInside = function (e, t, i, n, r) {
  20912. r = r || $.Deferred()
  20913. var o = (this.currentPano = e) && !e.isAligned()
  20914. window.bus.dispatchEvent({ type: 'playerAndModelReady' })
  20915. this.ready = true
  20916. if (((t = o ? e.position : t || e.position), (i = i || e.quaternion), e)) {
  20917. var a = this.startInside.bind(this, e, t, i, n, r)
  20918. if (this.checkAndWaitForPanoLoad(e, 'high', 'low', this.basePanoSize, a)) return
  20919. }
  20920. //add
  20921. this.transitionPos({ type: 'beforeFlytopano', pano: this.currentPano, dur: 0 })
  20922. //this.updateHotVisible()
  20923. //EditOverlay.updatePano()
  20924. editTool.hotpoint.updatePano()
  20925. Hot.updateVisibles([this.currentPano])
  20926. return (
  20927. (this.mode = V.PANORAMA),
  20928. e.floor.enter(this.mode),
  20929. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  20930. this.switchCameraMode(this.mode, i),
  20931. this.emit(W.StartInside, o),
  20932. r.resolve(!0),
  20933. r
  20934. )
  20935. }),
  20936. (t.prototype.startInsideWithFlyin = function (i, e, n, t, r) {
  20937. if (((r = r || $.Deferred()), this.dollhouseMode(), !i)) return Y.warn('Player.startInsideWithFlyin() -> targetPano is invalid.'), r.resolve(!1), r
  20938. e = e || i.position
  20939. var o = n || this.cameraControls.activeControl.camera.quaternion,
  20940. a = i.position
  20941. return (
  20942. this.fitDollhouse(a, e, o),
  20943. setTimeout(
  20944. function (e) {
  20945. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e)
  20946. var t = {
  20947. mode: V.PANORAMA,
  20948. pano: i,
  20949. quaternion: n,
  20950. callback: function () {
  20951. this.emit(W.FlyinFinished), r.resolve(!0)
  20952. }.bind(this)
  20953. }
  20954. this.flyToNewMode(t)
  20955. }.bind(this, this.cameraControls.activeControl.maxDistance),
  20956. k.startupFlyinDelay
  20957. ),
  20958. r
  20959. )
  20960. }),
  20961. (t.prototype.checkAndWaitForPanoLoad =
  20962. ((Z = {}),
  20963. (K = {}),
  20964. function (t, e, i, n, r, o, a, s, l, c) {
  20965. if (
  20966. (function () {
  20967. for (var e in Z) if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3) return !0
  20968. return !1
  20969. })()
  20970. )
  20971. return !0
  20972. var h = function (e, t, i) {
  20973. j.delayOneFrame(
  20974. function () {
  20975. ;(Z[e] = !1), r && r(t, i)
  20976. }.bind(this)
  20977. )
  20978. }.bind(this, t.id),
  20979. u = function (e, t) {
  20980. j.delayOneFrame(
  20981. function () {
  20982. ;(Z[e] = !1), o && o(t)
  20983. }.bind(this)
  20984. )
  20985. }.bind(this, t.id)
  20986. try {
  20987. return (
  20988. null != s || (s = !0),
  20989. 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)),
  20990. Z[t.id] && (K[t.id] = performance.now()),
  20991. Z[t.id]
  20992. )
  20993. } catch (e) {
  20994. throw ((Z[t.id] = !1), (K[t.id] = performance.now() - 5e3), e)
  20995. }
  20996. })),
  20997. (t.prototype.checkAndWaitForWholePanoLoad = function (e, t, i, n, r) {
  20998. if (!e) throw new p('Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.')
  20999. return (
  21000. r &&
  21001. this.model.waitForLoad(e, function () {
  21002. return e.isLoaded(i)
  21003. }),
  21004. !e.isLoaded(t) && (e.loadCube(t).done(n), !0)
  21005. )
  21006. }),
  21007. (t.prototype.checkAndWaitForTiledPanoLoad =
  21008. ((X = new B.Vector3()),
  21009. function (e, t, i, n, r, o, a, s) {
  21010. if (!e) throw new p('Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.')
  21011. return (
  21012. X.copy(T.FORWARD),
  21013. this.getDirection(X),
  21014. !e.isLoaded(t) &&
  21015. (o &&
  21016. this.model.waitForLoad(e, function () {
  21017. return e.isLoaded(t)
  21018. }),
  21019. e
  21020. .loadTiledPano(t, X, null, a, s)
  21021. .done(
  21022. function (e, t) {
  21023. i && i(e, t)
  21024. }.bind(this)
  21025. )
  21026. .fail(
  21027. function (e) {
  21028. n && n(e)
  21029. }.bind(this)
  21030. )
  21031. .progress(
  21032. function (e, t, i) {
  21033. r && r(e, t, i)
  21034. }.bind(this)
  21035. ),
  21036. !0)
  21037. )
  21038. })),
  21039. (t.prototype.switchCameraMode = function (mode, quaternion, target, position, { currentScale, fitBoundSize } = {}) {
  21040. var control = this.cameraControls.controls[mode],
  21041. camera = control.camera
  21042. if (mode == V.PANORAMA) {
  21043. camera.position.copy(this.currentPano.position)
  21044. var r = quaternion ? T.FORWARD.clone().applyQuaternion(quaternion) : this.getDirection().setY(0).normalize()
  21045. control.lookAt(r.add(camera.position))
  21046. } else {
  21047. if (target) {
  21048. control.target.copy(target)
  21049. }
  21050. if (position) {
  21051. camera.position.copy(position)
  21052. }
  21053. if (mode == V.DOLLHOUSE) {
  21054. var pos = this.position.clone()
  21055. if (this.mode === V.PANORAMA) {
  21056. let vec = new B.Vector3(0, 6, 0).add(this.getDirection().multiplyScalar(-10))
  21057. if (target) vec.multiplyScalar(0.15) //编辑热点时飞出不要飞太远,只是飞出来就近观察一下热点
  21058. pos.add(vec)
  21059. } else {
  21060. pos.add(T.DOWN.clone().applyQuaternion(this.quaternion).multiplyScalar(6)).setY(6)
  21061. }
  21062. camera.position.copy(pos)
  21063. if (!target) target = this.target.clone().setY(this.model.center.y)
  21064. control.target.copy(target)
  21065. //for多楼层 且 让模型刚好适应屏幕
  21066. /* var box = this.model.boundingBox.clone();
  21067. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  21068. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  21069. var fov = A.getHFOVFromVFOV(k.insideFOV, camera.aspect, 1); //获得在当前窗口的横向的fov
  21070. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  21071. console.log(boxSize.x,distance, boxSize.length() / 2)
  21072. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  21073. if(this.mode === V.PANORAMA){
  21074. control.target.copy(this.model.center);
  21075. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  21076. }else{
  21077. control.target.copy(this.target.clone().setY(this.model.center.y))
  21078. var vec = T.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  21079. }
  21080. vec.multiplyScalar(distance )
  21081. camera.position.copy(control.target.clone().add(vec)) */
  21082. }
  21083. if (mode == V.FLOORPLAN) {
  21084. if (!target) {
  21085. control.target.copy(this.model.center).setY(0)
  21086. }
  21087. if (!position) {
  21088. camera.position.copy(control.target).setY(k.floorplan.cameraHeight), control.rotateToView(this.model.size, this.getDirection())
  21089. }
  21090. if (currentScale) {
  21091. control.currentScale = control.absoluteScale = currentScale
  21092. } else if (fitBoundSize) {
  21093. control.zoomToContain(fitBoundSize)
  21094. } else {
  21095. control.zoomToContain(this.model.size)
  21096. }
  21097. }
  21098. }
  21099. control.update(0)
  21100. }),
  21101. (t.prototype.update =
  21102. (new B.Vector3(),
  21103. (N = {}),
  21104. (F = []),
  21105. function (e) {
  21106. this.updatePersistentZooming(e), this.updateFromControls(e), this.getCurrentNodePanos(F)
  21107. if (this.hasChanged(N)) {
  21108. ;(this.lastChangeTime = Date.now()), !this.mouseDown && this.containsMouse && this.updateIntersect()
  21109. this.emit(W.ViewChanged, N)
  21110. //add:
  21111. if (N.cameraChanged) {
  21112. Hot.updateHots()
  21113. this.mode == 'panorama' && window.cad && cad.setSign({ x: this.position.x, y: this.position.z }, this.cameraControls.controls.panorama.lon)
  21114. }
  21115. }
  21116. this.model.supportsTiles && (this.updateTileDownloader(F), this.updatePanoRenderer(F)),
  21117. this.updatePreRendering(F),
  21118. this.reticule.update(),
  21119. this.path.update(),
  21120. this.spider.update(),
  21121. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  21122. this.updateControlLocks(),
  21123. this.model.supportsTiles && this.updateZoomPano()
  21124. })),
  21125. (t.prototype.updatePersistentZooming = function (e) {
  21126. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  21127. }),
  21128. (t.prototype.updateControlLocks = function () {
  21129. this.currentPano &&
  21130. this.model.supportsTiles &&
  21131. (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  21132. }),
  21133. (t.prototype.updatePanoRenderer =
  21134. ((D = new B.Vector3()),
  21135. function (e) {
  21136. var t = this.nextPano || this.currentPano
  21137. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD), this.getDirection(D), this.panoRenderer.updateDirection(D))
  21138. })),
  21139. (t.prototype.cleanupInactivePanos =
  21140. ((O = []),
  21141. (L = []),
  21142. function () {
  21143. ;(O.length = 0), O.push(this.currentPano), this.nextPano && O.push(this.nextPano)
  21144. for (var e = (L.length = 0); e < this.panoRenderer.activePanos.length; e++) L.push(this.panoRenderer.activePanos[e])
  21145. for (var t = 0; t < L.length; t++) {
  21146. for (var i = L[t], n = !0, r = 0; r < O.length; r++) i.id === O[r].id && (n = !1)
  21147. n && i.exit()
  21148. }
  21149. })),
  21150. (t.prototype.updatePreRendering =
  21151. ((w = {}),
  21152. function (e) {
  21153. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  21154. var t = this.nextPano || this.currentPano
  21155. if (t && e && 1 < e.length) {
  21156. var i = e.findIndex(function (e) {
  21157. if (e.id === t.id) return !0
  21158. })
  21159. if (0 <= i && i + 1 < e.length) {
  21160. var n = e[i + 1]
  21161. n.isLoaded(this.basePanoSize) ||
  21162. w[n.id] ||
  21163. (window.setTimeout(
  21164. function (e) {
  21165. this.checkAndWaitForPanoLoad(e, 'high', 'low', this.basePanoSize, null, null, null, !1, !1, !1),
  21166. window.setTimeout(
  21167. function (e) {
  21168. w[e.id] = !1
  21169. }.bind(this, e),
  21170. k.tiling.panoPreRenderRepeatDelay
  21171. )
  21172. }.bind(this, n),
  21173. k.tiling.panoPreRenderDelay
  21174. ),
  21175. (w[n.id] = !0))
  21176. }
  21177. }
  21178. }
  21179. })),
  21180. (t.prototype.enablePreRendering = function () {
  21181. this.preRenderingEnabled = !0
  21182. }),
  21183. (t.prototype.disablePreRendering = function () {
  21184. ;(this.preRenderingEnabled = !1), this.cleanupInactivePanos()
  21185. }),
  21186. (t.prototype.updateTileDownloader =
  21187. ((b = new B.Vector3()),
  21188. function (e) {
  21189. var t = this.nextPano || this.currentPano
  21190. t &&
  21191. (b.copy(T.FORWARD),
  21192. this.getDirection(b),
  21193. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  21194. (this.tileDownloader.processPriorityQueue = !0))
  21195. })),
  21196. (t.prototype.updateFromControls = function (e) {
  21197. null != e || (e = 0),
  21198. this.cameraControls.activeControl &&
  21199. (this.cameraControls.activeControl.update(e),
  21200. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21201. this.position.copy(this.cameraControls.activeControl.camera.position),
  21202. this.target.copy(this.cameraControls.activeControl.target),
  21203. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21204. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21205. this.camera.position.copy(this.position),
  21206. this.camera.quaternion.copy(this.quaternion),
  21207. this.camera.updateMatrix(),
  21208. this.camera.updateMatrixWorld()
  21209. }),
  21210. (t.prototype.hasChanged = function (e) {
  21211. if (!this.previousState) {
  21212. e.cameraChanged = true
  21213. return (
  21214. (this.previousState = {
  21215. allFloorsVisible: this.model.allFloorsVisible,
  21216. position: this.position.clone(),
  21217. quaternion: this.quaternion.clone(),
  21218. mouse: this.mouse.clone(),
  21219. labelScaleFactor: this.getLabelScaleFactor(),
  21220. currentFloor: this.model.currentFloor,
  21221. projectionMatrix: this.camera.projectionMatrix.clone(),
  21222. worldMatrix: this.camera.matrixWorld.clone(),
  21223. mode: this.mode,
  21224. modelPosition: this.model.position.clone(),
  21225. modelCenter: this.model.center.clone(),
  21226. zoomLevel: this.zoomLevel
  21227. }),
  21228. !0
  21229. )
  21230. }
  21231. //许钟文改 分成相机是否改变cameraChanged 和其他
  21232. var a =
  21233. this.position.equals(this.previousState.position) &&
  21234. this.quaternion.equals(this.previousState.quaternion) &&
  21235. this.camera.matrixWorld.equals(this.previousState.worldMatrix) &&
  21236. this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) &&
  21237. this.mode === this.previousState.mode &&
  21238. this.zoomLevel === this.previousState.zoomLevel &&
  21239. this.model.center.equals(this.previousState.modelCenter) &&
  21240. this.model.position.equals(this.previousState.modelPosition)
  21241. var t =
  21242. a &&
  21243. this.mouse.equals(this.previousState.mouse) &&
  21244. this.model.allFloorsVisible === this.previousState.allFloorsVisible /* && this.getLabelScaleFactor() === this.previousState.labelScaleFactor */ &&
  21245. this.model.currentFloor === this.previousState.currentFloor &&
  21246. null === this.nextPano
  21247. e.cameraChanged = !a
  21248. //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;
  21249. return (
  21250. (e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible),
  21251. (e.moved = !this.position.equals(this.previousState.position)),
  21252. (e.rotated = !this.quaternion.equals(this.previousState.quaternion)),
  21253. (e.mouseMoved = !this.mouse.equals(this.previousState.mouse)),
  21254. (e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor),
  21255. (e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor),
  21256. (e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix)),
  21257. (e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix)),
  21258. (e.modeChanged = this.mode !== this.previousState.mode),
  21259. (e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition)),
  21260. (e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter)),
  21261. (e.nextPanoActive = null !== this.nextPano),
  21262. (e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel),
  21263. (this.previousState.allFloorsVisible = this.model.allFloorsVisible),
  21264. this.previousState.position.copy(this.position),
  21265. this.previousState.quaternion.copy(this.quaternion),
  21266. this.previousState.mouse.copy(this.mouse),
  21267. (this.previousState.labelScaleFactor = this.getLabelScaleFactor()),
  21268. (this.previousState.currentFloor = this.model.currentFloor),
  21269. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21270. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21271. (this.previousState.mode = this.mode),
  21272. this.previousState.modelPosition.copy(this.model.position),
  21273. this.previousState.modelCenter.copy(this.model.center),
  21274. (this.previousState.zoomLevel = this.zoomLevel),
  21275. !t
  21276. )
  21277. }),
  21278. (t.prototype.updateIntersect = function () {
  21279. var e = this.flying || this.isWarping(),
  21280. t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged(),
  21281. i = G.getById(q.LookTransition)
  21282. e || t || this.isTouchEvent || (i.length && i[0].running)
  21283. {
  21284. //clear:
  21285. //if(this.intersectHot) this.intersectHot.hideTitle()
  21286. if (this.intersectHot) this.intersectHot.setHoverState(false)
  21287. this.intersectHot = null
  21288. //$("#player").css("cursor", "")
  21289. CursorDeal.remove('hoverFootIcon')
  21290. CursorDeal.remove('hoverRouteLine')
  21291. CursorDeal.remove('hoverHot')
  21292. $('.toolRight .spotList ul li').removeClass('active')
  21293. }
  21294. var deal = () => {
  21295. if (this.intersect && this.intersect.object.visible) {
  21296. if ('hotSprite' == this.intersect.object.type) {
  21297. this.intersectHot = this.intersect.object
  21298. while (!(this.intersectHot instanceof Hot)) {
  21299. this.intersectHot = this.intersectHot.parent
  21300. }
  21301. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass('active')
  21302. this.intersectHot.setHoverState(true)
  21303. }
  21304. }
  21305. }
  21306. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog || (VisiSet.setPanoArea && VisiSet.editPanoArea) || VisiSet.setRoute)) {
  21307. let meshes = this.model.hotGroup.children.slice()
  21308. if (VisiSet.routeInfo?.operation == 'removeLink') {
  21309. meshes.push(...VisiSet.meshGroup.children.filter(e => e.name.includes('routeLine:')))
  21310. } else {
  21311. VisiSet.footIcons && meshes.push(...VisiSet.footIcons)
  21312. }
  21313. this.intersect = this.getMouseIntersect(null, meshes)
  21314. deal()
  21315. if (this.intersect) {
  21316. if (VisiSet.routeInfo?.operation == 'removeLink') {
  21317. CursorDeal.add('hoverRouteLine')
  21318. } else {
  21319. CursorDeal.add('hoverFootIcon') //$("#player").css("cursor", "pointer");
  21320. }
  21321. }
  21322. if (this.intersectHot) {
  21323. this.intersect = null
  21324. }
  21325. return
  21326. } else if (g_HotStatus) {
  21327. //加热点
  21328. this.intersect = this.getMouseIntersect(null, this.model.colliders.concat(this.model.skybox))
  21329. if (this.intersect) {
  21330. //$("#player").css("cursor", "cell")
  21331. CursorDeal.remove('noIntersect')
  21332. } else {
  21333. //$("#player").css("cursor", "not-allowed")
  21334. CursorDeal.add('noIntersect')
  21335. }
  21336. return
  21337. } else {
  21338. if (this.model.hotGroup) {
  21339. if (editTool.atPanel == 'hotpoint') {
  21340. var hots = this.model.hotGroup.children
  21341. } else {
  21342. var hots = this.model.hotGroup.children.filter(e => e.info.actionType.examine || e.info.actionType.fastTran || e.info.actionType.openHot || e.info.actionType.playAndPause)
  21343. }
  21344. let colliders = this.model.floors.reduce(
  21345. function (e, t) {
  21346. return t.hidden ? e : e.concat(t.collider.children)
  21347. },
  21348. this.mode === 'panorama' ? this.panoMarkers : []
  21349. )
  21350. this.intersect = this.getMouseIntersect(null, hots.concat(colliders))
  21351. if (this.intersect) {
  21352. deal()
  21353. this.intersectHot && CursorDeal.add('hoverHot') //$("#player").css("cursor", "pointer");
  21354. if (this.intersect) {
  21355. deal()
  21356. let intersect = this.intersect
  21357. if (this.intersectHot) {
  21358. this.intersect = null
  21359. $('#player').css('cursor', 'pointer')
  21360. } else {
  21361. if (intersect.object.parent.parent.hidden) {
  21362. //楼层已隐藏
  21363. this.intersect = null
  21364. }
  21365. }
  21366. }
  21367. }
  21368. } else {
  21369. this.intersect = this.getMouseIntersect()
  21370. }
  21371. }
  21372. this.intersect && this.updateClosestPano(this.intersect),
  21373. this.closestPano || this.closestPanoInDirection(this.getMouseDirection())
  21374. ? (this.reticule.updatePosition(this.position, this.intersect), k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection()))
  21375. : this.reticule.hide()
  21376. }),
  21377. (t.prototype.checkHotClick = function () {
  21378. if (this.intersectHot) {
  21379. if (window.VisiSet && VisiSet.setTagVisible) {
  21380. VisiSet.SetOneTagVisible(this.intersectHot) //设置这个热点的可见性
  21381. return
  21382. } else if (editTool.atPanel == 'hotpoint') {
  21383. let f = () => {
  21384. editTool.hotpoint.editHot(this.intersectHot)
  21385. }
  21386. if (editTool.hotpoint.editSpot && this.intersectHot != editTool.hotpoint.editSpot) {
  21387. editTool.hotpoint.unsaveWarn(f)
  21388. } else {
  21389. f()
  21390. }
  21391. } else {
  21392. if (this.intersectHot.texType == 'video' && this.intersectHot.info.actionType.playAndPause) {
  21393. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  21394. }
  21395. this.intersectHot.examine()
  21396. }
  21397. return !0
  21398. }
  21399. }),
  21400. (t.prototype.getMouseDirection = function (e) {
  21401. e = e || this.mouse
  21402. var t = new B.Vector3(e.x, e.y, -1).unproject(this.camera)
  21403. return new B.Vector3(e.x, e.y, 1).unproject(this.camera).sub(t).normalize()
  21404. }),
  21405. /* t.prototype.hoverOverlay = function(mesh){
  21406. if(!mesh){
  21407. this.hoveringPlane = null;
  21408. $("#player").css("cursor",this.currentCursor || "" );
  21409. }else{
  21410. var overlay = mesh.parent;
  21411. $("#player").css("cursor","pointer");
  21412. this.hoveringPlane = overlay;
  21413. return true;
  21414. }
  21415. }, */
  21416. (t.prototype.clickOverlay = function (overlay) {
  21417. if (this.openOverlay && !overlay) return
  21418. var plane = overlay.plane
  21419. if (overlay.texType == 'video') {
  21420. overlay.switchPlay(!!overlay.pausedByUser)
  21421. }
  21422. if (window.EditOverlay && EditOverlay.editing) {
  21423. if (EditOverlay.editPlane && overlay != EditOverlay.editPlane) {
  21424. var sure = confirm('是否保存当前展览?')
  21425. if (sure) {
  21426. $('#overlayProp button.submit').click()
  21427. } else {
  21428. EditOverlay.closeOverlayPanel('cancel')
  21429. }
  21430. }
  21431. EditOverlay.beginEdit(overlay)
  21432. return
  21433. }
  21434. }),
  21435. (t.prototype.getMouseIntersect = function (e, t1) {
  21436. e = e || this.mouse.clone()
  21437. var t =
  21438. t1 ||
  21439. this.model.floors.reduce(
  21440. function (e, t) {
  21441. return t.hidden ? e : e.concat(t.collider.children)
  21442. },
  21443. this.mode === V.PANORAMA ? this.panoMarkers : []
  21444. ),
  21445. t = t.slice(0)
  21446. i = new B.Vector3(e.x, e.y, -1).unproject(this.camera)
  21447. this.raycaster.set(i, this.getMouseDirection(e))
  21448. var n = this.raycaster.intersectObjects(t, true) //add true
  21449. var o = n[0]
  21450. if (o) {
  21451. o.face &&
  21452. ((o.normal = o.face.normal.applyQuaternion(o.object.quaternion)),
  21453. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  21454. 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),
  21455. (o.horizontal = 0.8 < o.normal.y))
  21456. return o
  21457. }
  21458. }),
  21459. (t.prototype.updateClosestPano = function (e) {
  21460. var t = [a.filters.isPanoAligned()]
  21461. if (this.mode === V.PANORAMA) {
  21462. if (!this.currentPano) return
  21463. t.push(a.filters.not(this.currentPano)),
  21464. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  21465. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), 0.25)),
  21466. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  21467. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  21468. } else {
  21469. t.push(a.filters.isOnVisibleFloor()), t.push(this.checkHasNeighbor) //add
  21470. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), 0.25))
  21471. }
  21472. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)])
  21473. i !== this.closestPano
  21474. ? (i && (this.isPanoHover = !0),
  21475. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  21476. (this.closestPano = i),
  21477. this.closestPano && this.mode == 'panorama'
  21478. ? CursorDeal.add('hoverPano') /*, this.reticule.visible = false */
  21479. : CursorDeal.remove('hoverPano') /*, this.reticule.visible = true */)
  21480. : (this.isPanoHover = !1)
  21481. }),
  21482. (t.prototype.dollhouseMode = function (e, t) {
  21483. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE), (this.mode = V.DOLLHOUSE), this.cameraControls.controls[V.DOLLHOUSE].reset()
  21484. var i = new B.Vector3(this.model.center.x, 0, this.model.center.z),
  21485. n = new B.Vector3(15, 10, 15)
  21486. if (e && t) {
  21487. var r = T.FORWARD.clone().applyQuaternion(t),
  21488. o = this.model.center.clone().sub(e).dot(r)
  21489. 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)
  21490. }
  21491. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  21492. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21493. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21494. this.updateFromControls(),
  21495. (this.model.alpha = 1),
  21496. (this.model.skybox.material.uniforms.opacity.value = 0)
  21497. }),
  21498. (t.prototype.insideMode = function (e, t) {
  21499. var i = $.Deferred(),
  21500. n = t || null
  21501. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21502. var r = [a.filters.isPanoAligned()]
  21503. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21504. (e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)])),
  21505. this.flyToNewMode({
  21506. mode: V.PANORAMA,
  21507. pano: e,
  21508. callback: n
  21509. })
  21510. .done(i.resolve.bind(i))
  21511. .fail(i.reject.bind(i))
  21512. } else {
  21513. var o = this.mode === V.PANORAMA ? 'Already in panorama mode' : 'Cannot change mode during mode transition'
  21514. i.reject(o)
  21515. }
  21516. return i.promise()
  21517. }),
  21518. (t.prototype.fitDollhouse = function (e, t, i) {
  21519. var maxY = this.model.boundingBox.max.y //add
  21520. var n = T.FORWARD.clone().applyQuaternion(i)
  21521. i = n.clone().add(e)
  21522. this.cameraControls.activeControl.target.copy(i),
  21523. this.cameraControls.activeControl.camera.position
  21524. .set(0, maxY * 2.4, 0)
  21525. .add(e)
  21526. .add(n.multiplyScalar(-10))
  21527. }),
  21528. (t.prototype.floorplanMode = function (e, t, i) {
  21529. this.mode = V.FLOORPLAN
  21530. var n = this.cameraControls.controls[V.FLOORPLAN]
  21531. n.reset()
  21532. var r = e || this.model.center
  21533. if (
  21534. (n.target.copy(r).setY(0),
  21535. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21536. i ? ((n.currentScale = i / ($('#player').width() / $('#player').height())), (n.absoluteScale = n.currentScale)) : n.zoomToContain(this.model.size),
  21537. t)
  21538. ) {
  21539. var o = T.LEFT.clone().applyQuaternion(t)
  21540. n.rotateLeft(-Math.atan2(o.x, o.z))
  21541. } else n.rotateToView(this.model.size, this.getDirection())
  21542. n.update(0)
  21543. }),
  21544. (t.prototype.nonInterruptingFlyToPano = function (e, t) {
  21545. return (e.skipWarpingCheck = !0), this.flyToPano(e, t)
  21546. }),
  21547. (t.prototype.updateMarkerVisi = function () {
  21548. //加
  21549. if (this.mode != 'panorama') return
  21550. this.model.panos.list.forEach(pano => {
  21551. if (!pano.marker) return
  21552. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id]
  21553. })
  21554. }),
  21555. /* t.prototype.updateHotVisible = function(pano){
  21556. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setPanoLog))return
  21557. var hots = this.model.hots;
  21558. pano = pano || this.currentPano;
  21559. for (var index in hots){
  21560. var visible;
  21561. if(this.mode != "panorama"){
  21562. visible = true;
  21563. }else{
  21564. //hots[index].mesh.material.depthTest = false;
  21565. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  21566. }
  21567. hots[index].mesh.visible = visible;
  21568. }
  21569. }
  21570. */
  21571. (t.prototype.flyToPano = function (e, t) {
  21572. var i,
  21573. n = e.pano,
  21574. aim = e.lookAtPoint,
  21575. aimQua = e.quaternion, //ADD
  21576. o = e.duration,
  21577. a = e.aimDuration,
  21578. s = e.maxDistanceOverride,
  21579. l = e.skipWarpingCheck,
  21580. c = e.constantMoveSpeed,
  21581. h = null,
  21582. u = null
  21583. if (aim) {
  21584. var m = new B.Matrix4().lookAt(n.position, aim, T.UP)
  21585. aimQua = new B.Quaternion().setFromRotationMatrix(m)
  21586. } else aimQua = aimQua
  21587. var zoomLevel = e.zoomLevel || 1 //add
  21588. if (this.flying) return t && t(e)
  21589. if (
  21590. (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21591. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21592. )
  21593. return Y.warn('Player.flyToPano() -> Cannot fly when warping'), t && t(), !1
  21594. this.updateLastView()
  21595. if (this.mode !== V.PANORAMA)
  21596. return void this.flyToNewMode({
  21597. mode: V.PANORAMA,
  21598. pano: n,
  21599. duration: o,
  21600. quaternion: aimQua,
  21601. callback: t
  21602. })
  21603. if (
  21604. !n ||
  21605. ((h = x.deepExtend(e)),
  21606. (u = function () {
  21607. j.delayOneFrame(
  21608. function () {
  21609. this.flyToPano(h, t)
  21610. }.bind(this)
  21611. )
  21612. }.bind(this)),
  21613. !this.checkAndWaitForPanoLoad(n, 'high', 'low', this.basePanoSize, u))
  21614. ) {
  21615. var d = function (e) {
  21616. t && t(e)
  21617. }.bind(this)
  21618. this.currentPano || ((this.currentPano = n), this.path.placeCpm(), this.path.fadeOutCpm(k.path.fadeOutTime), this.spider.draw())
  21619. var p = o
  21620. if ('number' != typeof o) {
  21621. var f = s || k.transition.flytimeMaxDistanceThreshold
  21622. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21623. }
  21624. if ((0.01 < k.transition.flySpeed && (p = (1e3 * this.currentPano.position.distanceTo(n.position)) / k.transition.flySpeed), zoomLevel !== this.zoomLevel))
  21625. switch (k.zoom.transitionStyle) {
  21626. case 1:
  21627. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? p / 2 : p) //改
  21628. break
  21629. case 2:
  21630. return (h = x.deepExtend(e)), (u = this.flyToPano.bind(this, h, t)), void this.smoothZoomFovTo(null, zoomLevel, k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21631. }
  21632. if (aimQua) {
  21633. G.cancelById(q.LookTransition), (p *= k.transition.aimSlowFactor)
  21634. var g = this.cameraControls.activeControl.camera.quaternion.clone(),
  21635. y = g.clone(),
  21636. A = new B.Vector3()
  21637. if (n === this.currentPano) {
  21638. var C = T.FORWARD.clone().applyQuaternion(g),
  21639. I = T.FORWARD.clone().applyQuaternion(aimQua),
  21640. E = C.angleTo(I)
  21641. return (
  21642. null != a || (a = ((1 * Math.sqrt(E)) / k.tags.navigate.rotateSpeedFactor) * 1e3),
  21643. void G.start(
  21644. function (e) {
  21645. y.copy(g),
  21646. H.quaternion(y, aimQua)(e),
  21647. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21648. this.cameraControls.activeControl.lookAt(A)
  21649. }.bind(this),
  21650. a,
  21651. d,
  21652. 0,
  21653. z[k.transition.movementEasing],
  21654. null,
  21655. q.LookTransition
  21656. )
  21657. )
  21658. }
  21659. }
  21660. if (n === this.currentPano) return void d()
  21661. this.flying = !0
  21662. var _ = this.position.clone(),
  21663. b = this.currentPano
  21664. Y.debug('Flying to pano ', n.position)
  21665. this.emit(W.PanoChosen, this.currentPano, n)
  21666. this.emit(W.FlyingStarted, n.position, _, n, b)
  21667. this.transitionPos({ type: 'beforeFlytopano', pano: n, dur: p }) //add
  21668. Hot.updateVisibles([this.currentPano, n], 'every')
  21669. aimQua &&
  21670. G.start(
  21671. function (e) {
  21672. 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)
  21673. }.bind(this),
  21674. p,
  21675. null,
  21676. 0,
  21677. z[k.transition.movementEasing],
  21678. null,
  21679. q.LookTransition
  21680. )
  21681. var w = c ? null : z[k.transition.movementEasing]
  21682. this.nextPano = n
  21683. G.start(H.uniform(this.model.skybox, 'progress', 1), p, null, 0, z[k.transition.blendEasing], 'skyFly', q.FlyToPano),
  21684. G.start(H.allUniforms(this.model.chunks, 'progress', 1), p, null, 0, z[k.transition.blendEasing], 'chunkFly', q.FlyToPano),
  21685. G.start(
  21686. H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position),
  21687. p,
  21688. function (e) {
  21689. ;(this.flying = !1),
  21690. this.currentPano !== n && this.currentPano.exit(),
  21691. n.enter(),
  21692. (this.currentPano = n),
  21693. (this.nextPano = null),
  21694. this.path.placeCpm(),
  21695. this.path.fadeOutCpm(k.path.fadeOutTime),
  21696. this.spider.draw(),
  21697. this.emit(W.FlyingEnded, n.position, _, n, b),
  21698. this.updateMarkerVisi() //add
  21699. d(e)
  21700. if (this.mode == 'panorama') {
  21701. //EditOverlay.updatePano()
  21702. editTool.hotpoint.updatePano()
  21703. Hot.updateVisibles([this.currentPano])
  21704. this.model.fadePanoMarkers() //add
  21705. }
  21706. }.bind(this),
  21707. 0,
  21708. w,
  21709. 'camFly',
  21710. q.FlyToPano
  21711. )
  21712. }
  21713. }),
  21714. (t.prototype.blackToPano = function (o = {}) {
  21715. //add 瞬间过渡
  21716. if (this.flying || this.isWarping()) return
  21717. let pano = o.pano || this.model.panos.index[o.panoId]
  21718. if (this.mode != 'panorama') {
  21719. return this.flyToNewMode({
  21720. mode: 'panorama',
  21721. pano,
  21722. quaternion: o.quaternion
  21723. })
  21724. }
  21725. let oldPos = this.position.clone()
  21726. let oldPano = this.currentPano
  21727. this.path.warpDestPano = pano
  21728. var retry = () => {
  21729. ;(this.waitingToWarp = !1), this.blackToPano(o)
  21730. }
  21731. if (this.checkAndWaitForPanoLoad(pano, 'high', 'low', this.basePanoSize, retry)) return void (this.waitingToWarp = !0)
  21732. console.log('blackToPano')
  21733. this.flying = true
  21734. this.nextPano = pano //提前加载高清图片
  21735. this.path.warpDestHeroLoc = {
  21736. panoId: pano.id,
  21737. position: pano.position,
  21738. quaternion: o.quaternion || this.quaternion.clone()
  21739. }
  21740. this.path.warpTravel_BLACK(null, 1500, 1, () => {
  21741. pano != this.currentPano && this.currentPano.exit()
  21742. pano.enter()
  21743. this.currentPano = pano
  21744. this.flying = false
  21745. this.nextPano = null
  21746. this.updateMarkerVisi() //add
  21747. console.log('blackToPano end')
  21748. })
  21749. })
  21750. window._transitionPosId = 9999
  21751. t.prototype.transitionPos = function (o = {}) {
  21752. //渐变overlay和热点的位置
  21753. G.cancelById(_transitionPosId)
  21754. var begin = function (object, pos, qua, scale) {
  21755. if (pos) {
  21756. if (!same(object.position, pos, 0.01)) {
  21757. G.start(
  21758. H.vector(object.position, pos),
  21759. o.dur,
  21760. e => {
  21761. object.updateScale()
  21762. },
  21763. 0,
  21764. z[k.transition.movementEasing],
  21765. 'transitionPos',
  21766. _transitionPosId
  21767. )
  21768. }
  21769. if (qua && !same(object.quaternion, qua, 1e-6)) {
  21770. G.start(H.quaternion(object.quaternion, qua), o.dur, e => {}, 0, z[k.transition.movementEasing], 'transitionPos', _transitionPosId)
  21771. }
  21772. if (scale && !same(object.scale, scale, 0.001)) {
  21773. G.start(H.vector(object.scale, scale), o.dur, e => {}, 0, z[k.transition.movementEasing], 'transitionPos', _transitionPosId)
  21774. }
  21775. }
  21776. }
  21777. var same = function (vec1, vec2, diff) {
  21778. var s = Math.abs(vec1.x - vec2.x) < diff && Math.abs(vec1.y - vec2.y) < diff && Math.abs(vec1.z - vec2.z) < diff
  21779. if (s && vec1.w) s = Math.abs(vec1.w - vec2.w) < diff
  21780. return s
  21781. }
  21782. var sid = o.pano != void 0 ? o.pano.id : 'outside'
  21783. for (let i in this.model.hots) {
  21784. //是否判断visible?
  21785. var hot = this.model.hots[i]
  21786. var panoData = hot.info.transformAtPanos[sid]
  21787. var useCustom = !panoData
  21788. //if(hot.usingTransformData || !useCustom){
  21789. var pos = useCustom ? hot.info.position : panoData.pos
  21790. var qua = hot.isSprite ? null : useCustom ? hot.info.quaternion : panoData.qua
  21791. var scale = useCustom ? hot.info.scale : panoData.scale
  21792. begin(hot, pos, qua, scale)
  21793. //}
  21794. //hot.usingTransformData = !useCustom;
  21795. }
  21796. if (o.callback) {
  21797. setTimeout(() => {
  21798. o.callback()
  21799. }, o.dur + 16) //姑且这么写
  21800. }
  21801. }
  21802. window._tranOutsideFocus = 4399
  21803. t.prototype.focusPoint = function (o = {}) {
  21804. //当在外时,聚焦相机到这一点
  21805. //console.log("focusPoint")
  21806. if (this.mode == 'floorplan') {
  21807. var control = player.cameraControls.controls.floorplan
  21808. var currentTarget = control.target.clone()
  21809. if (!o.dontChangeScale) {
  21810. var modelSize = o.modelSize || new THREE.Vector3(8, 8, 8) //可视范围
  21811. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  21812. var currentScale = control.absoluteScale
  21813. }
  21814. G.cancelById(window._tranOutsideFocus, true)
  21815. G.start(
  21816. function (progress) {
  21817. o.dontChangeScale || (control.absoluteScale = absoluteScale * progress + currentScale * (1 - progress))
  21818. control.target = o.aim
  21819. .clone()
  21820. .multiplyScalar(progress)
  21821. .add(currentTarget.clone().multiplyScalar(1 - progress))
  21822. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  21823. }.bind(this),
  21824. o.dur || 600,
  21825. null /* cancelFuc */,
  21826. 0,
  21827. z[k.transition.movementEasing],
  21828. 'outsideFocus',
  21829. window._tranOutsideFocus,
  21830. null /* cancelFuc */
  21831. )
  21832. } else if (player.mode == 'dollhouse') {
  21833. var control = player.cameraControls.controls.dollhouse
  21834. var radius = o.radius || 8
  21835. var currentTarget = control.target.clone()
  21836. var dir = control.offset.clone().normalize()
  21837. var currentRadius = control.offset.length()
  21838. G.cancelById(window._tranOutsideFocus, true)
  21839. G.start(
  21840. function (progress) {
  21841. control.target = o.aim
  21842. .clone()
  21843. .multiplyScalar(progress)
  21844. .add(currentTarget.clone().multiplyScalar(1 - progress))
  21845. let radius_ = radius * progress + currentRadius * (1 - progress)
  21846. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  21847. }.bind(this),
  21848. o.dur || 600,
  21849. null /* cancelFuc */,
  21850. 0,
  21851. z[k.transition.movementEasing],
  21852. 'outsideFocus',
  21853. window._tranOutsideFocus,
  21854. null /* cancelFuc */
  21855. )
  21856. } else if (this.mode == 'panorama') {
  21857. this.flyToPano({
  21858. lookAtPoint: o.aim.clone(),
  21859. pano: this.currentPano,
  21860. aimDuration: o.dur || 600
  21861. })
  21862. }
  21863. }
  21864. ;(t.prototype.fastForwardActivePanoFlight = function (e) {
  21865. ;(e = e || (k.transition.fastForwardFactor / 10) * 4 + 1), G.adjustSpeed(q.FlyToPano, e), G.adjustSpeed(q.LookTransition, e)
  21866. }),
  21867. (t.prototype.flyToPanoClosestToMouse = function () {
  21868. if ((50 < Date.now() - this.mouseLastMoveTime && ((this.intersect = this.getMouseIntersect()), this.intersect && this.updateClosestPano(this.intersect)), this.closestPano))
  21869. return this.flyToPano({
  21870. pano: this.closestPano
  21871. })
  21872. var e = this.getMouseDirection()
  21873. this.flyDirection(e) ||
  21874. this.flyToPano({
  21875. pano: this.currentPano
  21876. })
  21877. }),
  21878. (t.prototype.flyLocalDirection = function (e) {
  21879. var t = this.getDirection(e),
  21880. i = 1 === e.z ? 0.4 : 0.75,
  21881. n = 1 === Math.abs(e.x)
  21882. return this.flyDirection(t, i, n)
  21883. }),
  21884. (t.prototype.flyDirection = function (e, t, i) {
  21885. Hot.closePopup() //xzw add
  21886. var n = $.Deferred()
  21887. this.history.invalidate()
  21888. var r = this.closestPanoInDirection(e, t, i)
  21889. return (
  21890. r
  21891. ? this.flyToPano(
  21892. {
  21893. pano: r
  21894. },
  21895. n.resolve.bind(n, !0)
  21896. )
  21897. : (this.bump(e), n.resolve(!1)),
  21898. n.promise()
  21899. )
  21900. }),
  21901. (t.prototype.closestPanoInDirection = function (e, t, i) {
  21902. return this.rankedPanoInDirection(0, e, t, i)
  21903. }),
  21904. (t.prototype.rankedPanoInDirection =
  21905. ((_ = {
  21906. pano: null,
  21907. candidates: []
  21908. }),
  21909. function (e, t, i, n) {
  21910. ;(e = e || 0), (i = void 0 !== i ? i : 0.75)
  21911. var r = n ? 'angle' : 'direction'
  21912. return (
  21913. this.model.panos.findRankedByScore(
  21914. e,
  21915. [a.filters.isPanoAligned(), a.filters.not(this.currentPano), a.filters.isNeighbourPanoTo(this.currentPano), a.filters.inPanoDirection(this.position, t, i)],
  21916. [a.scoreFunctions.distanceSquared(this.currentPano), a.scoreFunctions[r](this.position, t)],
  21917. _
  21918. ),
  21919. (this.cachedPanoCandidates = _.candidates),
  21920. _.pano
  21921. )
  21922. })),
  21923. (t.prototype.bump = function (e) {
  21924. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  21925. var t,
  21926. i,
  21927. n,
  21928. r = k.transition,
  21929. o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8,
  21930. a = this.camera.getWorldDirection().dot(e)
  21931. if (0.5 < Math.abs(a))
  21932. (t = function () {
  21933. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], 'zoom', 0 < a ? 1.04 : 0.96), o, i, 0, z.easeInOutSine, 'bumpZStart')
  21934. }.bind(this)),
  21935. (i = function () {
  21936. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], 'zoom', 1), 5 * o, n, 0, z.easeInOutSine, 'bumpZRelax')
  21937. }.bind(this))
  21938. else {
  21939. var s = this.camera.position.clone(),
  21940. l = e.clone()
  21941. this.raycaster.set(s, l)
  21942. var c = this.model.floors.reduce(function (e, t) {
  21943. return e.concat(t.collider.children)
  21944. }, []),
  21945. h = this.raycaster.intersectObjects(c),
  21946. u = 0 < h.length ? h[0].distance / 25 : 0.04,
  21947. d = s.clone().add(l.multiplyScalar(u))
  21948. ;(t = function () {
  21949. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, 'bumpTStart')
  21950. }.bind(this)),
  21951. (i = function () {
  21952. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, 'bumpTRelax')
  21953. }.bind(this))
  21954. }
  21955. ;(n = function () {
  21956. this.flying = !1
  21957. }.bind(this)),
  21958. (this.flying = !0),
  21959. t()
  21960. }
  21961. }),
  21962. (t.prototype.changeFloor = function (e) {
  21963. if (!this.is360View(this.mode, this.currentPano))
  21964. if (this.mode === V.PANORAMA) {
  21965. var t = this.history.reversePano(e)
  21966. t && t.isAligned()
  21967. ? this.flyToPano({
  21968. pano: t
  21969. })
  21970. : this.changeFloorByScore(e)
  21971. } else this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21972. }),
  21973. (t.prototype.changeFloorByScore =
  21974. ((E = {
  21975. pano: null,
  21976. candidates: []
  21977. }),
  21978. function (e) {
  21979. var t = this.model.nextFloor(e)
  21980. return t
  21981. ? (this.model.panos.lowestByScore(
  21982. [a.filters.atFloor(t), a.filters.isPanoAligned()],
  21983. [
  21984. a.scoreFunctions.distance(this.currentPano),
  21985. a.scoreFunctions.direction(this.position, new B.Vector3(0, e, 0)),
  21986. a.scoreFunctions.penalizeHeightDifferenceUnder(this.position, 0.5)
  21987. ],
  21988. E
  21989. ),
  21990. void (E.pano
  21991. ? ((this.cachedPanoCandidates = E.candidates),
  21992. this.history.push(e, this.currentPano),
  21993. this.flyToPano({
  21994. pano: E.pano
  21995. }))
  21996. : Y.warn('No pano found on selected floor, not moving there.')))
  21997. : void Y.debug('player.changeFloor(' + e + '): no such floor')
  21998. })),
  21999. (t.prototype.gotoFloor = function (e) {
  22000. var t = e - this.model.currentFloor.floorIndex
  22001. this.changeFloor(t)
  22002. }),
  22003. (t.prototype.getDirection = function (e) {
  22004. return (e = e || new B.Vector3().copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  22005. }),
  22006. (t.prototype.flyToSameMode = function (e, t, i, n, r) {
  22007. if (((r = r || $.Deferred()), this.mode === V.TRANSITIONING)) return Y.warn('should not be transitioning here'), n && n(!1), r.reject().promise()
  22008. var o = i || !1,
  22009. a = i ? i.position : this.position,
  22010. s = this.position.clone(),
  22011. l = this.currentPano
  22012. if (
  22013. (Y.debug('New pose in mode ' + this.mode),
  22014. !e ||
  22015. ((retryCallback = function () {
  22016. j.delayOneFrame(
  22017. function () {
  22018. this.flyToSameMode(e, t, i, n, r)
  22019. }.bind(this)
  22020. )
  22021. }.bind(this)),
  22022. !this.checkAndWaitForPanoLoad(e, 'high', 'low', this.basePanoSize, retryCallback)))
  22023. ) {
  22024. var c = function () {
  22025. this.emit(W.FlyingEnded, a, s, e, l), n && n(!0)
  22026. }.bind(this),
  22027. h = k[this.mode],
  22028. u = void 0 !== t ? t : h.transitionTime,
  22029. d = new B.Vector3(),
  22030. p = new B.Vector3()
  22031. if ((this.emit(W.FlyingStarted, a, s, e, l), this.mode === V.PANORAMA)) Y.warn('we should not be here for panorama views')
  22032. else if (this.mode === V.DOLLHOUSE)
  22033. if (o) {
  22034. var f = new B.Vector3(0, 1, 0)
  22035. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0), this.model.warpDestFloors(i.floorVisibility), p.copy(i.position)
  22036. var g = new B.Vector3(0, 0, -1).applyQuaternion(i.quaternion),
  22037. m = new B.Raycaster(p.clone(), g.clone(), 0, 1 / 0).intersectObjects(this.model.colliders),
  22038. v = 3
  22039. m.length
  22040. ? (d.copy(m[0].point), (v = 0.75 * p.distanceTo(d)))
  22041. : (d.copy(g).multiplyScalar(3).add(p), Y.debug('Tried to restore dollhouse mode that did not intersect...', i.position, i.quaternion))
  22042. var y = new B.Matrix4().lookAt(p, d, f),
  22043. A = new B.Euler().setFromRotationMatrix(y, k.warp.eOrder),
  22044. C = d.distanceTo(p),
  22045. I = new B.Matrix4().lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f),
  22046. E = new B.Euler().setFromRotationMatrix(I, k.warp.eOrder),
  22047. _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target)
  22048. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0)
  22049. var b = new B.Euler(A.x - E.x, A.y - E.y, A.z - E.z, k.warp.eOrder)
  22050. ;(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))
  22051. var w = new B.Euler(0, 0, 0, k.warp.eOrder),
  22052. T = new B.Vector3()
  22053. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  22054. G.start(
  22055. function (e, t) {
  22056. ;(w.x = E.x + e * b.x), (w.y = E.y + e * b.y), (w.z = E.z + e * b.z)
  22057. var i = _ + e * (C - _)
  22058. 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)
  22059. }.bind(this),
  22060. u,
  22061. null,
  22062. k.flydown.movementDelay,
  22063. z[k.flydown.movementEasing],
  22064. null,
  22065. q.FlyToSameMode
  22066. ),
  22067. G.start(
  22068. function (e, t) {
  22069. this.cameraControls.controls[V.DOLLHOUSE].update(),
  22070. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  22071. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  22072. }.bind(this),
  22073. u,
  22074. null,
  22075. k.flydown.movementDelay,
  22076. z[k.flydown.movementEasing],
  22077. null,
  22078. q.FlyToSameMode
  22079. )
  22080. } else Y.warn('invalid warp destination in flyToSameMode()? ignore it then')
  22081. else if ((this.path.placeCpm(), this.path.fadeInCpm(k.path.fadeInTime), i)) {
  22082. this.model.warpDestFloors(i.floorVisibility)
  22083. var x = this.cameraControls.cameras[V.FLOORPLAN],
  22084. S = this.cameraControls.controls[V.FLOORPLAN],
  22085. M = S.target.clone(),
  22086. R = i.position.clone().sub(M),
  22087. P = x.position.clone().sub(S.target).length(),
  22088. O = new B.Vector3(-1, 0, 0).applyQuaternion(i.quaternion).normalize(),
  22089. L = Math.atan2(S.offset.x, S.offset.z),
  22090. D = Math.atan2(O.x, O.z),
  22091. N = S.absoluteScale,
  22092. F = U.convertWorkshopOrthoZoom(i.orthoZoom)
  22093. G.start(
  22094. function (e, t) {
  22095. S.target.copy(R).multiplyScalar(e).add(M)
  22096. var i = L + (D - L) * e
  22097. ;(S.offset.x = P * Math.sin(i)),
  22098. (S.offset.z = P * Math.cos(i)),
  22099. x.position.copy(S.target).add(S.offset),
  22100. (S.absoluteScale = N + e * (F - N)),
  22101. S.update(),
  22102. this.quaternion.copy(x.quaternion),
  22103. this.position.copy(x.position),
  22104. this.target.copy(S.target),
  22105. this.camera.projectionMatrix.copy(x.projectionMatrix)
  22106. }.bind(this),
  22107. u,
  22108. null,
  22109. 0,
  22110. z[k.flydown.movementEasing],
  22111. null,
  22112. q.FlyToSameMode
  22113. )
  22114. } else Y.info('flyToSameMode() funny floorplan view? skipping')
  22115. return (
  22116. G.setTimeout(
  22117. function (e) {
  22118. ;(this.mode = e), c(), r.resolve(!0)
  22119. }.bind(this, this.mode),
  22120. u,
  22121. q.FlyToSameMode
  22122. ),
  22123. (this.mode = V.TRANSITIONING),
  22124. r.promise()
  22125. )
  22126. }
  22127. }),
  22128. (t.prototype.flyToNewMode = function (e, t) {
  22129. Hot.closePopup() //xzw add
  22130. var i = (e = e || {}).mode,
  22131. n = e.pano,
  22132. r = e.duration,
  22133. o = e.warpDest,
  22134. a = e.callback,
  22135. s = e.force,
  22136. l = e.quaternion
  22137. if (((t = t || $.Deferred()), this.isWarping()))
  22138. return Y.warn('Player.flyToNewMode() -> Cannot fly when warping'), a && a(!1), t.reject('Cannot change mode during tour transition').promise()
  22139. if (this.mode === V.TRANSITIONING) return a && a(!1), t.reject('Cannot change mode during mode transition').promise()
  22140. if (i === this.mode)
  22141. 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())
  22142. var c = o || !1
  22143. Y.debug('Switching mode to ' + i)
  22144. var h = function () {
  22145. j.delayOneFrame(
  22146. function () {
  22147. this.flyToNewMode(e, t)
  22148. }.bind(this)
  22149. )
  22150. }.bind(this)
  22151. if (n && this.checkAndWaitForPanoLoad(n, 'low', 'low', this.basePanoSize, h)) return t.promise()
  22152. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i)) {
  22153. return (
  22154. Y.info('Waiting for model textures to be loaded before going out to dollhouse'),
  22155. this.model.waitForLoad(
  22156. this.model,
  22157. function () {
  22158. return this.model.meshTexturesLoaded
  22159. }.bind(this)
  22160. ),
  22161. this.model.loadMeshTextures().done(h),
  22162. t.promise()
  22163. )
  22164. }
  22165. this.history.invalidate()
  22166. this.updateLastView()
  22167. var u = this.mode,
  22168. d = this.cameraControls.cameras[i]
  22169. e = x.deepExtend({}, k[i], k[u + '-' + i])
  22170. var p = void 0 !== r ? r : e.transitionTime
  22171. this.emit(W.ModeChanging, u, i, n, p)
  22172. n && (this.currentPano = n)
  22173. //----------改----------
  22174. let target, position, currentScale, fitBoundSize
  22175. if (editTool.hotpoint.editSpot) {
  22176. //focus
  22177. target = editTool.hotpoint.editSpot.position.clone()
  22178. let bound = editTool.hotpoint.editSpot.info.modelBound?.bound
  22179. if (bound) {
  22180. bound = new THREE.Box3().copy(bound).applyMatrix4(editTool.hotpoint.editSpot.children[0].matrixWorld)
  22181. fitBoundSize = bound.size()
  22182. } else {
  22183. fitBoundSize = new THREE.Vector3(5, 5, 5)
  22184. }
  22185. }
  22186. this.switchCameraMode(i, l, target, position, { currentScale, fitBoundSize })
  22187. //----------------------
  22188. G.cancelById(q.LookTransition)
  22189. var f = new B.Vector3().copy(this.position)
  22190. this.modeTran = this.mode + '-' + i
  22191. /* if(editTool.atPanel == "screen"){
  22192. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  22193. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  22194. } */
  22195. if (i == 'panorama') {
  22196. this.transitionPos({ type: 'beforeFlyIn', pano: n, dur: p }) //add
  22197. } else {
  22198. this.transitionPos({ type: 'beforeFlyOut', dur: p / 2 }) //add
  22199. }
  22200. window.bus.dispatchEvent({ type: 'playerAndModelReady' })
  22201. this.ready = true
  22202. if (i === V.PANORAMA)
  22203. this.emit(W.PanoChosen, n, n),
  22204. setTimeout(
  22205. function () {
  22206. n.floor.enter(i)
  22207. }.bind(this),
  22208. p / 2
  22209. ),
  22210. this.path.fadeOutCpm(k.path.fadeOutTime)
  22211. else if (i === V.DOLLHOUSE) {
  22212. if (
  22213. (c && (this.model.stayPut = !0),
  22214. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0), this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  22215. this.path.placeCpm(),
  22216. this.path.fadeInCpm(k.path.fadeInTime),
  22217. c)
  22218. ) {
  22219. var g = new B.Vector3(this.model.center.x, 0, this.model.center.z)
  22220. f.set(15, 10, 15)
  22221. var m = new B.Vector3(0, 0, -1).applyQuaternion(o.quaternion),
  22222. v = new B.Raycaster(o.position.clone(), m.clone(), 0, 1 / 0).intersectObjects([this.sceneIntersectionPlane])
  22223. v.length
  22224. ? (g.copy(v[0].point), f.copy(o.position), this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0.75 * f.distanceTo(g), !0))
  22225. : (Y.warn('Tried to restore dollhouse mode that did not intersect...', o.position, o.quaternion), this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  22226. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  22227. f.add(this.model.position),
  22228. d.position.copy(f),
  22229. this.cameraControls.controls[V.DOLLHOUSE].update()
  22230. }
  22231. } else if ((this.path.placeCpm(), this.path.fadeInCpm(k.path.fadeInTime), o)) {
  22232. this.model.warpDestFloors(o.floorVisibility)
  22233. var y = this.cameraControls.cameras[V.FLOORPLAN],
  22234. A = this.cameraControls.controls[V.FLOORPLAN],
  22235. C = y.position.clone().sub(A.target),
  22236. I = new B.Vector3(-1, 0, 0).applyQuaternion(o.quaternion).normalize(),
  22237. E = Math.atan2(I.x, I.z)
  22238. A.target.copy(o.position)
  22239. var _ = C.length()
  22240. ;(A.offset.x = _ * Math.sin(E)),
  22241. (A.offset.y = 0),
  22242. (A.offset.z = _ * Math.cos(E)),
  22243. y.position.copy(A.target).add(A.offset),
  22244. A.target.clone().sub(d.position),
  22245. d.quaternion.copy(o.quaternion),
  22246. (A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom)),
  22247. (A.absoluteScale = A.currentScale),
  22248. A.update()
  22249. } else this.model.currentFloor.enter(i)
  22250. var b = this.currentPano,
  22251. w = this.position.clone()
  22252. return (
  22253. this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  22254. (this.flying = !0),
  22255. this.isOutsideMode(i) && this.is360View(u, b)
  22256. ? (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()),
  22257. (e.blackoutStyle = P.FADEIN),
  22258. (p = k.show360Views.transitionTime),
  22259. this.fade360View(p, d, e))
  22260. : this.isOutsideMode(u) && this.is360View(i, n)
  22261. ? (c && this.switchCameraMode(i, c.quaternion),
  22262. (this.mode = i),
  22263. this.path && this.path.popOutCpm(),
  22264. (e.blackoutStyle = P.END),
  22265. (p = k.show360Views.transitionTime),
  22266. this.fade360View(p, d, e))
  22267. : (G.start(H.property(this.model, 'alpha', e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  22268. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  22269. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  22270. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  22271. G.start(H.uniform(this.model.skybox, 'opacity', e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  22272. G.start(H.property(this.reticule.material.uniforms.opacity, 'value', 0), p, null, q.FlyToNewMode)),
  22273. G.setTimeout(
  22274. function () {
  22275. ;(this.flying = !1),
  22276. u === V.PANORAMA && i !== V.PANORAMA
  22277. ? this.currentPano.exit()
  22278. : u !== V.PANORAMA &&
  22279. i === V.PANORAMA &&
  22280. (this.currentPano !== b && b.exit(), this.currentPano.enter(), this.path.placeCpm(), this.path.fadeOutCpm(k.path.fadeOutTime), this.spider.draw()),
  22281. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  22282. (this.mode = i),
  22283. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  22284. if (this.afterCModeFuc) {
  22285. //手动加的函数
  22286. var cf = this.afterCModeFuc
  22287. this.afterCModeFuc = null //因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  22288. cf()
  22289. }
  22290. this.updateMarkerVisi() //add
  22291. //(this.mode == u.PANORAMA) && this.updateHotVisible()//add
  22292. if (this.mode == V.PANORAMA) {
  22293. //EditOverlay.updatePano()
  22294. editTool.hotpoint.updatePano()
  22295. this.model.fadePanoMarkers()
  22296. Hot.updateVisibles([this.currentPano])
  22297. } else {
  22298. Hot.updateVisibles(true)
  22299. this.model.hotGroup.children.forEach(overlay => {
  22300. if (overlay.animateInfo) {
  22301. GifTexDeal.start(overlay.animation)
  22302. }
  22303. })
  22304. }
  22305. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(), t.resolve())
  22306. }.bind(this),
  22307. p,
  22308. q.FlyToNewMode
  22309. ),
  22310. (this.mode = V.TRANSITIONING),
  22311. //EditOverlay.updatePano(),//add
  22312. editTool.hotpoint.updatePano(), //add
  22313. //u == "panorama" && this.updateHotVisible(),
  22314. t.promise()
  22315. )
  22316. }),
  22317. (t.prototype.fade360View = function (e, t, i) {
  22318. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  22319. $(this.domElement).fadeOut(
  22320. 0.5 * e,
  22321. function () {
  22322. ;(this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity),
  22323. (this.model.alpha = i.modelAlpha),
  22324. this.position.copy(t.position),
  22325. this.quaternion.copy(t.quaternion),
  22326. this.camera.projectionMatrix.copy(t.projectionMatrix),
  22327. $(this.domElement).fadeIn(0.5 * e)
  22328. }.bind(this)
  22329. )
  22330. }),
  22331. (t.prototype.findDefaultViews = function () {
  22332. this.findDefaultView(this.lastInsideView, !0), this.findDefaultView(this.last360View, !1)
  22333. }),
  22334. (t.prototype.findDefaultView = function (e, i) {
  22335. var t,
  22336. n = this.model.heroLocations,
  22337. r = this.model.panos,
  22338. o = n.findIndex(function (e) {
  22339. if (e.cameraMode !== V.PANORAMA) return !1
  22340. var t = r.get(e.panoId)
  22341. return t && t.isAligned() === i
  22342. })
  22343. 0 <= o
  22344. ? ((t = r.get(n[o].panoId)),
  22345. e.update({
  22346. cameraMode: V.PANORAMA,
  22347. pano: t,
  22348. position: n[o].position,
  22349. quaternion: n[o].quaternion
  22350. }))
  22351. : 0 <=
  22352. (o = r.list.findIndex(function (e) {
  22353. return e.isAligned() === i
  22354. }))
  22355. ? ((t = r.list[o]),
  22356. e.update({
  22357. cameraMode: V.PANORAMA,
  22358. pano: t,
  22359. position: t.position
  22360. }))
  22361. : Y.warn('There are no', i ? 'inside' : '360º', 'views in this model')
  22362. }),
  22363. (t.prototype.updateLastView = function () {
  22364. this.mode === V.PANORAMA &&
  22365. (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  22366. pano: this.currentPano,
  22367. position: this.position,
  22368. quaternion: this.quaternion
  22369. })
  22370. }),
  22371. (t.prototype.goToLastView = function (e, t) {
  22372. var i = $.Deferred(),
  22373. n = i.resolve.bind(i),
  22374. r = i.reject.bind(i),
  22375. o = e ? this.lastInsideView : this.last360View
  22376. return (
  22377. this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  22378. this.isInMode(V.PANORAMA)
  22379. ? (this.path && this.path.popOutCpm(), this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r))
  22380. : this.isOutsideMode() &&
  22381. this.flyToNewMode({
  22382. mode: o.cameraMode,
  22383. pano: o.pano,
  22384. quaternion: o.quaternion,
  22385. callback: t
  22386. })
  22387. .done(n)
  22388. .fail(r),
  22389. i.promise()
  22390. )
  22391. }),
  22392. (t.prototype.fadeToView = function (e, t, i, n) {
  22393. var r = $.Deferred(),
  22394. o = r.resolve.bind(r),
  22395. a = r.reject.bind(r)
  22396. 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()
  22397. var s =
  22398. (k[t.cameraMode],
  22399. function () {
  22400. $(this.domElement).fadeIn(0.5 * i), n && n(), o()
  22401. }.bind(this)),
  22402. l = e ? P.FADEIN : P.END
  22403. return (
  22404. this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  22405. $(this.domElement).fadeOut(
  22406. 0.5 * i,
  22407. function () {
  22408. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  22409. t.cameraMode === V.PANORAMA
  22410. ? this.flyToPano(
  22411. {
  22412. pano: t.pano,
  22413. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  22414. duration: 0
  22415. },
  22416. s
  22417. )
  22418. : this.flyToNewMode({
  22419. mode: t.cameraMode,
  22420. quaternion: t.quaternion,
  22421. duration: 0,
  22422. callback: s
  22423. })
  22424. }.bind(this)
  22425. ),
  22426. r.promise()
  22427. )
  22428. }),
  22429. (t.prototype.startWarp = function (e, t, i, n, r, o) {
  22430. if ((this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1), this.flying)) return Y.warn('Player.startWarp() -> Cannot warp when flying'), o && o(), !1
  22431. null != e || (e = M.Show), this.history.invalidate(), e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : (i = this.path.upcomingTransType)
  22432. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned()
  22433. return (
  22434. this.emit(W.WarpStarted, a, i, n, r),
  22435. (n = n || P.MIDDLE),
  22436. this.path.warpToPano(
  22437. i,
  22438. n,
  22439. r,
  22440. function () {
  22441. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  22442. this.emit(W.WarpEnded, i),
  22443. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  22444. o && o()
  22445. }.bind(this)
  22446. ),
  22447. e === M.Hide && this.path.discardPathObject(),
  22448. !0
  22449. )
  22450. }),
  22451. (t.prototype.warpToPanoById = function (e, t, i, n, r, o, a, s) {
  22452. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn('Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()'), s && s(), !1)
  22453. }),
  22454. (t.prototype.warpToPanoByHeroIndex = function (e, t, i, n, r, o, a) {
  22455. return this.path.setWarpDestinationByHeroIndex(e)
  22456. ? this.startWarp(t, i, n, r, o, a)
  22457. : (Y.warn('Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()'), a && a(), !1)
  22458. }),
  22459. (t.prototype.warpToPano = function (e, t, i, n, r, o, a, s) {
  22460. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22461. }),
  22462. (t.prototype.warpToNonPanoByHeroIndex = function (e, t) {
  22463. return this.path.setWarpDestinationByHeroIndex(e)
  22464. ? (this.path.warpToNonPano(t), !0)
  22465. : (Y.warn('Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()'), t && t(), !1)
  22466. }),
  22467. (t.prototype.aimTourCamera = function (e, t, i, n) {
  22468. return Y.debug('player.aimTourCamera(' + e + ') calling warpToPanoByHeroIndex(' + e + ')'), this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22469. }),
  22470. (t.prototype.showPathToHeroLocation = function (e) {
  22471. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  22472. }),
  22473. (t.prototype.tourInterlude = function (e, t) {
  22474. this.history.invalidate(), this.path.discardSlow()
  22475. var defaultRotTime = DATA.tourRotTime * 1000
  22476. var timeEachItem = (2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed)) * 200 //预估时间假设每个item飞的时间(如果距离远就少了)
  22477. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)
  22478. var currentLocation0 = this.model.heroLocations[this.director.currentItem[0]]
  22479. var rotTime
  22480. if (currentLocation.rotTime == void 0 || currentLocation.rotTime == '') {
  22481. var restChildCount = currentLocation0.heroLocations ? currentLocation0.heroLocations.length - this.director.currentItem[1] - 1 : 0
  22482. var hasMusic = currentLocation0.musicInfo && currentLocation0.musicInfo.music
  22483. if (hasMusic) {
  22484. var audioObj = SoundManager.list.find(e => e.name == 'tour')
  22485. var current = audioObj.audio.currentTime * 1e3 // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  22486. rotTime = currentLocation0.musicInfo.time - current
  22487. if (restChildCount) {
  22488. //如果当前folder中还有剩下的item,平分一下时间
  22489. rotTime = (rotTime - timeEachItem * restChildCount) / (restChildCount + 1)
  22490. }
  22491. } else {
  22492. rotTime = defaultRotTime
  22493. }
  22494. rotTime = Math.max(0, rotTime)
  22495. //console.log("rotTime "+rotTime +" at item "+this.director.currentItem + (hasMusic ? (",musicCurrentTime:"+current+'音乐总长:'+currentLocation0.musicInfo.time) : ''))
  22496. } else {
  22497. rotTime = currentLocation.rotTime * 1000
  22498. //console.log("rotTime "+rotTime +" at item "+this.director.currentItem)
  22499. }
  22500. this.path.waitNextStep(
  22501. e,
  22502. function () {
  22503. //等待音乐播放一段时间再下一步,此时镜头会缓慢旋转
  22504. t && t()
  22505. }.bind(this),
  22506. rotTime
  22507. )
  22508. }),
  22509. (t.prototype.stopInterlude = function () {
  22510. this.interruptAndFastForward(null, 0)
  22511. }),
  22512. (t.prototype.interruptAndFastForward = function (e, t) {
  22513. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t), this.flying && this.emit(W.FlyingInterrupted), this.path.interruptAndFastForward(e, t)
  22514. }),
  22515. (t.prototype.setSize = function (e, t) {
  22516. var i = e / t
  22517. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t)
  22518. var n = A.getHFOVFromVFOV(k.insideFOV, e, t)
  22519. for (var r in (n > k.insideFOVMax ? (this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t)) : (this.baseFov = k.insideFOV), this.cameraControls.cameras)) {
  22520. var o = this.cameraControls.cameras[r]
  22521. ;(o.fov = this.baseFov * (1 / this.zoomLevel)), o.updateAspect(i)
  22522. }
  22523. }),
  22524. (t.prototype.toJSON = function () {
  22525. var e = {}
  22526. return (
  22527. this.cameraControls.activeControl &&
  22528. (((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode)),
  22529. this.isOutsideMode()
  22530. ? this.model.allFloorsVisible
  22531. ? (e.floor_visibility = [])
  22532. : (e.floor_visibility = this.model.floors.list.map(function (e) {
  22533. return e.hidden ? 0 : 1
  22534. }))
  22535. : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  22536. e
  22537. )
  22538. }),
  22539. (t.prototype.getCurrentNodePanos = function (e) {
  22540. if ((this.model.panos.map, (e.length = 0), this.path.nodes))
  22541. for (var t = 0; t < this.path.nodes.length; t++) {
  22542. var i = this.path.nodes[t]
  22543. e.push(this.model.panos.get(i))
  22544. }
  22545. }),
  22546. (t.prototype.zoomIncrementally = function (e) {
  22547. var t = this.zoomLevel
  22548. this.zoomTo(this.zoomLevel + e), t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22549. }),
  22550. (t.prototype.zoomInIncrementally = function (e) {
  22551. ;(e = e || this.defaultZoomIncrement), this.zoomIncrementally(e)
  22552. }),
  22553. (t.prototype.zoomOutIncrementally = function (e) {
  22554. ;(e = e || -this.defaultZoomIncrement), this.zoomIncrementally(e)
  22555. }),
  22556. (t.prototype.zoomBy = function (e) {
  22557. this.zoomTo(this.zoomLevel * e)
  22558. }),
  22559. (t.prototype.zoomIn = function () {
  22560. this.zoomBy(1 + this.zoomSpeed)
  22561. }),
  22562. (t.prototype.zoomOut = function () {
  22563. this.zoomBy(1 - this.zoomSpeed)
  22564. }),
  22565. (t.prototype.zoomTo = function (e, t) {
  22566. if (
  22567. (t || (k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled)) &&
  22568. (e < k.zoom.min && (e = k.zoom.min),
  22569. e > k.zoom.max && (e = k.zoom.max),
  22570. 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)),
  22571. this.cameraControls.activeControl)
  22572. ) {
  22573. var i = this.cameraControls.activeControl.camera
  22574. ;(this.zoomLevel = e), (i.fov = this.baseFov * (1 / this.zoomLevel)), i.updateProjectionMatrix(), (this.zoomFov = i.fov)
  22575. }
  22576. }),
  22577. (t.prototype.increaseZoomSpeed = function () {
  22578. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22579. }),
  22580. (t.prototype.decreaseZoomSpeed = function () {
  22581. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22582. }),
  22583. (t.prototype.clampZoomSpeed = function (e) {
  22584. return e < 0 ? 0 : e
  22585. }),
  22586. (t.prototype.activatePersistentZooming = function (e) {
  22587. this.zooming = e ? 1 : -1
  22588. }),
  22589. (t.prototype.deactivatePersistentZooming = function () {
  22590. this.zooming = 0
  22591. }),
  22592. (t.prototype.zoomDefault = function () {
  22593. this.zoomTo(1, !0)
  22594. })
  22595. window.fovTranId = 333 //add
  22596. ;(t.prototype.smoothZoomToDefault = function (e, t) {
  22597. G.cancelById(window.fovTranId)
  22598. var i,
  22599. n = this.zoomLevel,
  22600. r = function (e) {
  22601. 1 < e && (e = 1), (i = n * (1 - e) + e), this.zoomTo(i, !0)
  22602. }.bind(this),
  22603. o = function () {
  22604. this.zoomDefault(), t && window.setTimeout(t, 50)
  22605. }.bind(this)
  22606. G.start(r, e, o, null, 0, z[k.transition.blendEasing], null, window.fovTranId)
  22607. }),
  22608. (t.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {
  22609. //add
  22610. G.cancelById(window.fovTranId)
  22611. var i,
  22612. n = this.zoomLevel,
  22613. aimLevel = zoomLevel || this.baseFov / fov
  22614. if (n == aimLevel) return
  22615. var fun = function (e) {
  22616. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel), this.zoomTo(i, !0)
  22617. }.bind(this)
  22618. G.start(fun, dur, callback, null, 0, z[k.transition.easeInCubic], null, window.fovTranId)
  22619. }),
  22620. (t.prototype.updateZoomPano = function () {
  22621. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  22622. var e = this.currentPano
  22623. if (e) {
  22624. var t = this.zoomLevel > k.zoom.activationThreshold,
  22625. i = ((this.flying && this.nextPano && this.nextPano !== this.currentPano) || this.isWarping(), t)
  22626. this.tileDownloader.tilePrioritizer.setZoomingActive(i), this.panoRenderer.setZoomingActive(i, e, !0)
  22627. var n = function (e, t) {
  22628. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22629. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22630. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22631. e.setZoomed(t)
  22632. }.bind(this)
  22633. i && !e.zoomed
  22634. ? (n(e, !0),
  22635. this.panoRenderer.enableUltraHighQualityMode(
  22636. function () {
  22637. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom), i && n(e, !0)
  22638. }.bind(this)
  22639. ))
  22640. : !t && e.zoomed && n(e, !1)
  22641. }
  22642. }
  22643. }),
  22644. //--------
  22645. (t.prototype.flyToMode = function (mode, f1) {
  22646. //飞到某个模式后再执行f1函数
  22647. var f2
  22648. if (this.mode == mode) {
  22649. f1 && f1()
  22650. } else {
  22651. f2 = f1
  22652. if (this.mode == 'transitioning' && this.modeTran.split('-')[1] != mode) {
  22653. //正飞向其他模式,就要先飞完再飞进来然后执行
  22654. this.afterCModeFuc = function () {
  22655. this.afterCModeFuc = f2
  22656. this.flyToNewMode({ mode: mode, pano: mode == 'panorama' && this.currentPano })
  22657. }.bind(this)
  22658. } else {
  22659. this.afterCModeFuc = f2 //飞入后执行
  22660. try {
  22661. //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22662. this.flyToNewMode({ mode: mode, pano: mode == 'panorama' && this.currentPano })
  22663. } catch (e) {}
  22664. }
  22665. }
  22666. }),
  22667. (t.prototype.checkHasNeighbor = function (pano) {
  22668. //add
  22669. for (var i in pano.neighbourPanos) {
  22670. if (i == pano.id) continue
  22671. if (pano.neighbourPanos[i]) {
  22672. return true
  22673. }
  22674. }
  22675. }),
  22676. (ee.exports = t)
  22677. }).call(this, '/js/player.js')
  22678. },
  22679. {
  22680. './constants': 8,
  22681. './enum/AlignmentType': 17,
  22682. './enum/BlackoutStyle': 18,
  22683. './enum/ControlEvents': 21,
  22684. './enum/Keys': 30,
  22685. './enum/ModelManagerEvents': 33,
  22686. './enum/PanoSizeClass': 36,
  22687. './enum/PanoramaEvents': 37,
  22688. './enum/PathDiscardMode': 38,
  22689. './enum/PathDisplayMode': 39,
  22690. './enum/PlayerEvents': 40,
  22691. './enum/TagStates': 44,
  22692. './enum/Vectors': 50,
  22693. './enum/Viewmode': 51,
  22694. './enum/WarpStyle': 52,
  22695. './enum/ZoomEvents': 53,
  22696. './exception/BasicException': 55,
  22697. './model/ModelManager': 140,
  22698. './objects/NSpider': 147,
  22699. './objects/Panorama': 148,
  22700. './objects/Reticule': 149,
  22701. './objects/ShowPath': 151,
  22702. './objects/Snapshot': 153,
  22703. './objects/View': 154,
  22704. './settings': 166,
  22705. './shaders': 167,
  22706. './tile/TileDownloader': 171,
  22707. './tile/TilePrioritizer': 172,
  22708. './util/ZoomStats': 179,
  22709. './util/browser': 182,
  22710. './util/camera': 183,
  22711. './util/cameraLight': 184,
  22712. './util/common': 185,
  22713. './util/easing': 186,
  22714. './util/history': 187,
  22715. './util/lerp': 188,
  22716. './util/logger': 189,
  22717. './util/math': 190,
  22718. './util/transitions': 195,
  22719. // hot: "hot",
  22720. scaleImg: 'scaleImg',
  22721. events: 202,
  22722. three: 217
  22723. }
  22724. ],
  22725. scaleImg: [
  22726. function (e, t) {
  22727. var i = t
  22728. ;(function () {
  22729. function e(e, t, i, n) {
  22730. function r() {
  22731. ;((U = 'object' == typeof i ? i : t.src || n ? s : document.createElement('canvas')).width = d), (U.height = p), (H = U.getContext('2d'))
  22732. }
  22733. function o(e) {
  22734. if (e) {
  22735. var t,
  22736. i = H.getImageData(0, 0, d, p),
  22737. n = i.data
  22738. 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)
  22739. return delete e, i
  22740. }
  22741. return H.getImageData(0, 0, d, p)
  22742. }
  22743. function a(e, t, i, n, r) {
  22744. return 0.5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  22745. }
  22746. var s, l
  22747. if ((t || ((t = e.input), (i = e.output), (n = e.inputRemovable), e.scale && (e = e.scale)), t.src))
  22748. if (((s = document.createElement('canvas')), null != t.naturalWidth)) (s.width = t.naturalWidth), (s.height = t.naturalHeight)
  22749. else if (null != t.runtimeStyle) {
  22750. var c = t.runtimeStyle,
  22751. h = c.width,
  22752. u = c.height
  22753. ;(c.width = 'auto'), (c.height = 'auto'), (s.width = t.width), (s.height = t.height), (c.width = h), (c.height = u)
  22754. } else {
  22755. ;(h = t.width), (u = t.height)
  22756. t.removeAttribute && (t.removeAttribute('width'), t.removeAttribute('height')), (s.width = t.width), (s.height = t.height), (t.width = h), (t.height = u)
  22757. }
  22758. else s = t
  22759. ;(l = s.getContext('2d')), t.src && l.drawImage(t, 0, 0)
  22760. var d,
  22761. p,
  22762. f = s.width,
  22763. g = s.height,
  22764. m = l.getImageData(0, 0, f, g).data
  22765. if (!f || !g) return !1
  22766. ;(t.src || n) && s.clearRect(0, 0, f, g),
  22767. (p =
  22768. 'object' == typeof e
  22769. ? e.width
  22770. ? ((d = (e.width + 0.5) | 0), (e.height + 0.5) | 0)
  22771. : ((d = (f * e.scaleX + 0.5) | 0), (g * e.scaleY + 0.5) | 0)
  22772. : ((d = (e * f + 0.5) | 0), (e * g + 0.5) | 0))
  22773. var v,
  22774. y,
  22775. A,
  22776. C,
  22777. I,
  22778. E,
  22779. _,
  22780. b,
  22781. w,
  22782. T,
  22783. x,
  22784. S,
  22785. M,
  22786. R,
  22787. P,
  22788. O,
  22789. L,
  22790. D,
  22791. N,
  22792. F,
  22793. B,
  22794. V,
  22795. k,
  22796. U,
  22797. H,
  22798. z,
  22799. G,
  22800. W,
  22801. j,
  22802. Y,
  22803. q,
  22804. X,
  22805. Z,
  22806. K,
  22807. Q,
  22808. J = d << 2,
  22809. $ = f << 2,
  22810. ee = 0,
  22811. te = 0,
  22812. ie = J * p,
  22813. ne = 255.99 / 255,
  22814. re = d / f,
  22815. oe = p / g,
  22816. ae = re * oe
  22817. if (1 < re || 1 < oe)
  22818. for (r(), G = (z = o()).data, C = 0; C < p; C++)
  22819. 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)
  22820. (Z = (b = 0 | (v = A / re)) << 2),
  22821. b < f - 2 ? ((K = Z + 4), (Q = Z + 8)) : (K = Q = f - 2 < b ? Z : Z + 4),
  22822. (D =
  22823. (a(
  22824. V,
  22825. a((k = v - b), m[W + (X = b < 1 ? Z : Z - 4)], m[W + Z], m[W + K], m[W + Q]),
  22826. a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]),
  22827. a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]),
  22828. a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])
  22829. ) *
  22830. ne) |
  22831. 0),
  22832. ++Z,
  22833. ++K,
  22834. ++Q,
  22835. (F =
  22836. (a(
  22837. V,
  22838. a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]),
  22839. a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]),
  22840. a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]),
  22841. a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])
  22842. ) *
  22843. ne) |
  22844. 0),
  22845. ++Z,
  22846. ++K,
  22847. ++Q,
  22848. (B =
  22849. (a(
  22850. V,
  22851. a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]),
  22852. a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]),
  22853. a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]),
  22854. a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])
  22855. ) *
  22856. ne) |
  22857. 0),
  22858. ++Z,
  22859. ++K,
  22860. ++Q,
  22861. (N =
  22862. (a(
  22863. V,
  22864. a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]),
  22865. a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]),
  22866. a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]),
  22867. a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])
  22868. ) *
  22869. ne) |
  22870. 0),
  22871. (G[te] = 0 <= D ? (D < 256 ? D : 255) : 0),
  22872. (G[te + 1] = 0 <= F ? (F < 256 ? F : 255) : 0),
  22873. (G[te + 2] = 0 <= B ? (B < 256 ? B : 255) : 0),
  22874. (G[te + 3] = 0 <= N ? (N < 256 ? N : 255) : 0)
  22875. else {
  22876. if (le.Float32Array) L = new Float32Array(ie)
  22877. else for (L = [], te = 0; te < ie; ++te) L[te] = 0
  22878. for (y = 0; y < g; y++)
  22879. 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)
  22880. switch (
  22881. ((A = v * re),
  22882. (E = 0 | A),
  22883. (te = I + (E << 2)),
  22884. (P = !!((E - ((A + re) | 0)) * (f - 1 - v))),
  22885. P && ((x = 1 + E - A), (S = A + re - E - 1)),
  22886. (D = m[ee]),
  22887. (F = m[ee + 1]),
  22888. (B = m[ee + 2]),
  22889. (N = m[ee + 3]),
  22890. P + O)
  22891. ) {
  22892. case 0:
  22893. ;(L[te] += D * ae), (L[te + 1] += F * ae), (L[te + 2] += B * ae), (L[te + 3] += N * ae)
  22894. break
  22895. case 1:
  22896. ;(T = x * oe),
  22897. (L[te] += D * T),
  22898. (L[te + 1] += F * T),
  22899. (L[te + 2] += B * T),
  22900. (L[te + 3] += N * T),
  22901. (T = S * oe),
  22902. (L[te + 4] += D * T),
  22903. (L[te + 5] += F * T),
  22904. (L[te + 6] += B * T),
  22905. (L[te + 7] += N * T)
  22906. break
  22907. case 2:
  22908. ;(T = re * M),
  22909. (L[te] += D * T),
  22910. (L[te + 1] += F * T),
  22911. (L[te + 2] += B * T),
  22912. (L[te + 3] += N * T),
  22913. (T = re * R),
  22914. (L[(te += J)] += D * T),
  22915. (L[te + 1] += F * T),
  22916. (L[te + 2] += B * T),
  22917. (L[te + 3] += N * T)
  22918. break
  22919. default:
  22920. ;(T = x * M),
  22921. (L[te] += D * T),
  22922. (L[te + 1] += F * T),
  22923. (L[te + 2] += B * T),
  22924. (L[te + 3] += N * T),
  22925. (T = S * M),
  22926. (L[te + 4] += D * T),
  22927. (L[te + 5] += F * T),
  22928. (L[te + 6] += B * T),
  22929. (L[te + 7] += N * T),
  22930. (T = x * R),
  22931. (L[(te += J)] += D * T),
  22932. (L[te + 1] += F * T),
  22933. (L[te + 2] += B * T),
  22934. (L[te + 3] += N * T),
  22935. (T = S * R),
  22936. (L[te + 4] += D * T),
  22937. (L[te + 5] += F * T),
  22938. (L[te + 6] += B * T),
  22939. (L[te + 7] += N * T)
  22940. }
  22941. delete m, r(), (z = o(L))
  22942. }
  22943. if ((H.putImageData(z, 0, 0), 'string' == typeof i)) {
  22944. var se
  22945. 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
  22946. if ('png-src' === i || 'jpeg-src' === i) return U.toDataURL('image/' + i.split('-')[0], 0.85)
  22947. }
  22948. return U
  22949. }
  22950. var le = this
  22951. 'undefined' != typeof exports ? ('undefined' != typeof module && module.exports && (exports = module.exports = e), (exports.scale = e)) : (c = e)
  22952. }).call(this),
  22953. (i.exports = c)
  22954. },
  22955. {}
  22956. ],
  22957. 156: [
  22958. function (i, n, e) {
  22959. ;(function (e) {
  22960. 'use strict'
  22961. function t(e, t) {
  22962. ;(this.model = e), (this.panos = e.panos), (this.player = t), (this.imagePanos = this.listImagePanos()), (this.retryMinimumTime = 1e4)
  22963. }
  22964. var r = (i('three'), i('./enum/Viewmode')),
  22965. o = (i('./settings'), i('./objects/Panorama')),
  22966. a = new (i('./util/logger'))(e)
  22967. ;(t.prototype.start = function () {
  22968. this.loadNextPano(
  22969. function (e) {
  22970. e
  22971. ? this.start()
  22972. : (a.debug('No suitable pano loaded, waiting a little while before looking again'),
  22973. setTimeout(
  22974. function () {
  22975. this.start()
  22976. }.bind(this),
  22977. 1e3
  22978. ))
  22979. }.bind(this)
  22980. )
  22981. }),
  22982. (t.prototype.validLoadTarget = function (e) {
  22983. return e && !e.isLoaded('high') && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22984. }),
  22985. (t.prototype.listImagePanos = function () {
  22986. var i = [],
  22987. n = this
  22988. return (
  22989. this.model.images.forEach(function (e) {
  22990. if (e.metadata && e.metadata.scan_id) {
  22991. var t = n.model.panos.get(e.metadata.scan_id)
  22992. t && !t.isLoaded('high') && i.push(t)
  22993. }
  22994. }),
  22995. i
  22996. )
  22997. }),
  22998. (t.prototype.nextNotLoadedImage = function () {
  22999. for (; 0 < this.imagePanos.length; ) {
  23000. var e = this.imagePanos[0]
  23001. if (!e.isLoaded('high')) return e
  23002. this.imagePanos.shift()
  23003. }
  23004. return null
  23005. }),
  23006. (t.prototype.loadNextPano = function (e) {
  23007. var t,
  23008. i,
  23009. n = this.model.waitQueue.filter(function (e) {
  23010. return e.object instanceof o
  23011. })
  23012. 0 < n.length
  23013. ? ((t = n[0].object), a.debug('Overrode pano selection: Flying to an unloaded pano ' + t.id))
  23014. : this.validLoadTarget(this.player.currentPano)
  23015. ? ((t = this.player.currentPano), a.debug('Overrode pano selection: Currently at an unloaded pano ' + t.id))
  23016. : this.validLoadTarget(this.player.closestPano)
  23017. ? ((t = this.player.closestPano), a.debug('Overrode pano selection: Hovering over an unloaded pano ' + t.id))
  23018. : this.validLoadTarget(this.nextNotLoadedImage())
  23019. ? ((i = 'high'), (t = this.imagePanos[0]), a.debug('Overrode pano selection: Highlight image ' + t.id))
  23020. : this.player.mode !== r.PANORAMA ||
  23021. ((t = this.panos.lowestByScore(
  23022. [this.validLoadTarget.bind(this), o.filters.isNeighbourPanoTo(this.player.currentPano)],
  23023. [
  23024. o.scoreFunctions.distance(this.player.currentPano),
  23025. o.scoreFunctions.direction(this.player.position, this.player.getDirection()),
  23026. o.scoreFunctions.inFieldOfView(this.player.position, this.player.getDirection())
  23027. ]
  23028. )) &&
  23029. a.debug('Normal pano selection: neighbor ' + t.id)),
  23030. t
  23031. ? ((i = i || t.isLoaded('low') ? 'high' : 'low'),
  23032. a.debug('Preloading ' + i + '-res pano ' + t.id),
  23033. t
  23034. .loadCube(i)
  23035. .done(e)
  23036. .fail(function () {
  23037. a.warn('Failed preloading pano', t.id, ', marking it as failed and forgetting it for a while'), e()
  23038. }))
  23039. : e && e(null)
  23040. }),
  23041. (n.exports = t)
  23042. }).call(this, '/js/preloaders.js')
  23043. },
  23044. {
  23045. './enum/Viewmode': 51,
  23046. './objects/Panorama': 148,
  23047. './settings': 166,
  23048. './util/logger': 189,
  23049. three: 217
  23050. }
  23051. ],
  23052. 157: [
  23053. function (a, s, e) {
  23054. ;(function (e) {
  23055. 'use strict'
  23056. function t(e, t, i, n, r) {
  23057. ;(this.qualityManager = e),
  23058. (this.scene = t),
  23059. (this.camera = i),
  23060. (this.container = r),
  23061. (this.controls = n),
  23062. (this.controls.enabled = !0),
  23063. (this.controls.locked = !0),
  23064. (this.quickstartCamera = n.camera),
  23065. (this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $('#player').width(), $('#player').height())),
  23066. (this.skybox = null)
  23067. }
  23068. var i = a('three'),
  23069. n = a('../util/logger'),
  23070. o = a('../constants'),
  23071. h = (a('../util/transitions'), a('../util/lerp'), a('../util/easing'), a('../enum/Vectors')),
  23072. u = a('../enum/PanoSizeClass'),
  23073. r = (a('../materials/ModelTextureMaterial'), a('../materials/CubemapMaterial')),
  23074. d = (a('../cameras/PanoramaCamera'), a('../controls/PanoramaControls'), a('../tile/TileUtils'), a('../util/camera'), a('../util/cameraLight')),
  23075. p = (a('../util/browser'), a('../settings'), a('../gui/helpManager'), new n(e))
  23076. ;(t.prototype.load = function (e) {
  23077. e.pano.shouldRedrawOnBaseLoaded = !0
  23078. var t,
  23079. i,
  23080. n = this,
  23081. r = h.FORWARD.clone().applyQuaternion(e.quaternion),
  23082. o = r.clone().negate()
  23083. this.controls.lookAt(r.add(this.quickstartCamera.position))
  23084. var a = this.qualityManager.getPanoSize(u.BASE),
  23085. s = this.qualityManager.getPanoSize(u.STANDARD)
  23086. if (e.pano.tiled) {
  23087. p.warn('Loading startPano, TILED', e.pano.id)
  23088. var l = d.getHFOVForCamera(this.quickstartCamera, $('#player').width(), $('#player').height()),
  23089. c = this.quickstartCamera.fov
  23090. p.warn('Quickstart loading tiles in frustum: [horizontal FOV: ' + l + ', vertical FOV: ' + c + ']'),
  23091. (t = e.pano.loadTiledPano(
  23092. s,
  23093. r,
  23094. {
  23095. hFov: l,
  23096. vFov: c
  23097. },
  23098. !1,
  23099. !1,
  23100. !0
  23101. )),
  23102. (i = e.pano.loadTiledPano(a, o, null, !1, !1, !0))
  23103. } else p.warn('Loading startPano', e.pano.id), (t = e.pano.loadCube('high'))
  23104. return $.when(t).then(
  23105. function () {
  23106. n.init(e.pano, e.quaternion),
  23107. e.pano.tiled
  23108. ? i.done(
  23109. function () {
  23110. ;(e.pano.lockUntilRenderingComplete = !1), (this.controls.locked = !1)
  23111. }.bind(this)
  23112. )
  23113. : (this.controls.locked = !1)
  23114. }.bind(this)
  23115. )
  23116. }),
  23117. (t.prototype.init = function (e, t) {
  23118. p.info('Quickstart done loading, adding scene objects'),
  23119. (e.lockUntilRenderingComplete = !0),
  23120. (this.skybox = new i.Mesh(
  23121. new i.CubeGeometry(1, 1, 1),
  23122. new r({
  23123. side: i.BackSide
  23124. })
  23125. )),
  23126. (this.skybox.material.uniforms.map.value = e.getSkyboxTexture()),
  23127. this.skybox.quaternion.copy(e.quaternion),
  23128. this.scene.add(this.skybox),
  23129. $(this.container).show()
  23130. }),
  23131. (t.prototype.update = function (e) {
  23132. this.controls.update(e), this.camera.copy(this.quickstartCamera)
  23133. }),
  23134. (t.prototype.setSize = function (e, t) {
  23135. this.quickstartCamera.updateAspect(e / t)
  23136. }),
  23137. (t.prototype.destroy = function () {
  23138. this.scene.remove(this.skybox)
  23139. }),
  23140. (s.exports = t)
  23141. }).call(this, '/js/scene/QuickstartManager.js')
  23142. },
  23143. {
  23144. '../cameras/PanoramaCamera': 7,
  23145. '../constants': 8,
  23146. '../controls/PanoramaControls': 13,
  23147. '../enum/PanoSizeClass': 36,
  23148. '../enum/Vectors': 50,
  23149. '../gui/helpManager': 68,
  23150. '../materials/CubemapMaterial': 117,
  23151. '../materials/ModelTextureMaterial': 118,
  23152. '../settings': 166,
  23153. '../tile/TileUtils': 174,
  23154. '../util/browser': 182,
  23155. '../util/camera': 183,
  23156. '../util/cameraLight': 184,
  23157. '../util/easing': 186,
  23158. '../util/lerp': 188,
  23159. '../util/logger': 189,
  23160. '../util/transitions': 195,
  23161. three: 217
  23162. }
  23163. ],
  23164. 158: [
  23165. function (e, t, i) {
  23166. 'use strict'
  23167. function h(e, t, i) {
  23168. ;(this.scene = e),
  23169. (this.camera = t),
  23170. (this.renderer = null),
  23171. (this.effects = i),
  23172. (this.animateCallback = null),
  23173. (this.composer = null),
  23174. (this.qualityManager = null),
  23175. (e.renderWidth = 0),
  23176. (e.renderHeight = 0),
  23177. (this.updateClock = new M.Clock()),
  23178. (this.components = []),
  23179. (this.updateListeners = []),
  23180. (this.resizeListeners = []),
  23181. (this.forceUpdateSize = !1),
  23182. (this.started = !1),
  23183. (this.textures = {}),
  23184. (this.suspendedObjects = [])
  23185. }
  23186. var o,
  23187. a,
  23188. n,
  23189. M = e('three'),
  23190. R = e('../shaders'),
  23191. r = e('../enum/SceneRendererEvents'),
  23192. f = e('../enum/GLTextureType'),
  23193. s = e('../enum/GLCubeFaces'),
  23194. l = e('../exception/BasicException'),
  23195. c = e('../exception/RendererCreationException'),
  23196. u = e('../util/browser'),
  23197. d = e('../settings'),
  23198. p = e('events').EventEmitter
  23199. ;(window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame),
  23200. ((h.prototype = Object.create(p.prototype)).addComponent = function (e) {
  23201. this.components.push(e), e.update && this.updateListeners.push(e), e.setSize && (this.resizeListeners.push(e), (this.forceUpdateSize = !0))
  23202. }),
  23203. (h.prototype.removeComponent = function (t) {
  23204. function e(e) {
  23205. return e !== t
  23206. }
  23207. ;(this.components = this.components.filter(e)), (this.updateListeners = this.updateListeners.filter(e)), (this.resizeListeners = this.resizeListeners.filter(e))
  23208. }),
  23209. (h.prototype.start = function (e) {
  23210. if (this.started) throw new l("Can't start SceneRenderer, already started")
  23211. this.createContext(e),
  23212. //u.isMobile() && this.boluoVrInit(),
  23213. this.initComposer(),
  23214. (this.started = !0),
  23215. (b = b.bind(this))()
  23216. }),
  23217. (h.prototype.createContext = function (e) {
  23218. try {
  23219. ;(this.renderer = new M.WebGLRenderer({ antialias: !u.isMobile() })),
  23220. (this.renderer.autoClear = !0),
  23221. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  23222. this.renderer.setSize($('#player').width(), $('#player').height(), !1),
  23223. this.emit(r.ContextCreated)
  23224. } catch (e) {
  23225. throw new c('Unable to create a WebGL rendering context')
  23226. }
  23227. d.profiling.enabled && this.overrideTextures(), e.appendChild(this.renderer.domElement)
  23228. }),
  23229. (h.prototype.overrideTextures = function () {
  23230. var d = this.renderer.context,
  23231. t = 0,
  23232. i = d.createTexture
  23233. d.createTexture = function () {
  23234. var e = i.call(d)
  23235. return (e.id = t++), (this.textures[e.id] = e)
  23236. }.bind(this)
  23237. var p = d.texImage2D
  23238. d.texImage2D = function (e, t, i, n, r, o, a, s, l) {
  23239. var c,
  23240. h = this.getTextureTypeFromTarget(d, e)
  23241. ;(c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D)),
  23242. 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))
  23243. var u = this.textures[c.id]
  23244. ;(u.width = h === f.TextureCube ? 6 * n : n), (u.height = r)
  23245. }.bind(this)
  23246. var n = d.deleteTexture
  23247. d.deleteTexture = function (e) {
  23248. delete this.textures[e.id], n.call(d, e)
  23249. }.bind(this)
  23250. }),
  23251. (h.prototype.updateTextureMemory =
  23252. ((n = null),
  23253. function () {
  23254. var e = 0
  23255. for (var t in this.textures) {
  23256. var i = this.textures[t]
  23257. i.width && i.height && (e += i.width * i.height * 4)
  23258. }
  23259. e !== n && this.emit(r.MemoryUsageUpdated, e), (n = e)
  23260. })),
  23261. (h.prototype.getTextureTypeFromTarget = function (e, t) {
  23262. switch (t) {
  23263. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  23264. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  23265. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  23266. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23267. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  23268. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23269. return f.TextureCube
  23270. case e.TEXTURE_2D:
  23271. return f.Texture2D
  23272. default:
  23273. return null
  23274. }
  23275. }),
  23276. (h.prototype.initComposer = function () {
  23277. ;(this.composer = new M.EffectComposer(this.renderer)),
  23278. this.composer.addPass(new M.RenderPass(this.scene, this.camera)),
  23279. /* this.composer.addPass(this.effects.hblurPass),
  23280. this.composer.addPass(this.effects.vblurPass) */
  23281. this.composer.addPass(this.effects.fastTranMaskPass) //add
  23282. }),
  23283. (h.prototype.setSize = function (e, t, i) {
  23284. ;(this.renderWidth = e), (this.renderHeight = t), (this.effects.aspect = e / t), this.renderer.setSize(e, t, !1, i), this.composer.setSize(e, t)
  23285. for (var n = 0; n < this.resizeListeners.length; n++) this.resizeListeners[n].setSize(e, t)
  23286. }),
  23287. (h.prototype.render = function () {
  23288. this.effects.fastTranMaskPass.enabled ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  23289. }),
  23290. (h.prototype.boluoVrInit = function () {
  23291. console.log('boluoVrInit'),
  23292. (this.isHuawei5X = u.detectHUAWEI5X()),
  23293. (this.oldRenderer = this.renderer),
  23294. (this.newRenderer = new this.vrRenderer(this.renderer, this, this.camera)),
  23295. (window.panoCamera = this.camera)
  23296. var i = this
  23297. ;(window._vrEnabled = !1),
  23298. Object.defineProperty(window, 'vrEnabled', {
  23299. get: function () {
  23300. return window._vrEnabled
  23301. },
  23302. set: function (e) {
  23303. ;(e = !!e)
  23304. ? ((i.renderer = i.newRenderer),
  23305. window.vrMarkers.forEach(function (e) {
  23306. e.visible = !0
  23307. }))
  23308. : ((i.renderer = i.oldRenderer),
  23309. window.vrMarkers.forEach(function (e) {
  23310. e.visible = !1
  23311. })),
  23312. (i.cursor.visible = e),
  23313. i.setSize($('#player').width(), $('#player').height()),
  23314. (window._vrEnabled = e),
  23315. setTimeout(function () {
  23316. console.log(player.cameraControls.activeControl.camera.fov)
  23317. }, 500)
  23318. }
  23319. }),
  23320. this.createCursor(0.5, !1, 1, 16777215, 0)
  23321. var e = {
  23322. setSize: function (e, t) {
  23323. i.camera.aspect = e / t
  23324. }
  23325. }
  23326. this.resizeListeners.push(e), this.vrLoadingInit()
  23327. }),
  23328. (h.prototype.vrLoadingInit = function () {
  23329. var e = new (e = function (camera) {
  23330. var t = this,
  23331. e = new M.RingGeometry(1.3, 1.5, 32, 32, 0, 1.2 * Math.PI),
  23332. i = new M.MeshBasicMaterial({
  23333. color: 4967932,
  23334. side: M.DoubleSide
  23335. }),
  23336. n = new M.Mesh(e, i)
  23337. ;((this.mesh = n).position.z = -2),
  23338. n.scale.set(0.08, 0.08, 0.08),
  23339. (n.visible = !1),
  23340. //window.player.camera.add(n),
  23341. camera.add(n),
  23342. (t.enabled = !1),
  23343. (this.update = function (e) {
  23344. 1 == t.enabled && (n.rotation.z += 15 * e)
  23345. })
  23346. })(this.camera)
  23347. ;(window.Loading = e), this.updateListeners.push(e)
  23348. }),
  23349. (h.prototype.createCursor = function (e, t, i, n, r) {
  23350. var o,
  23351. a = new M.SpriteMaterial({
  23352. opacity: i,
  23353. color: n,
  23354. transparent: t,
  23355. map: this.boluoGetTexture('images/cursor.png'),
  23356. needsUpdate: !0,
  23357. side: M.DoubleSide
  23358. })
  23359. ;(a.map.offset = new M.Vector2((1 / 17) * r, 0)),
  23360. (a.map.repeat = new M.Vector2(1 / 17, 1)),
  23361. (a.depthTest = !1),
  23362. (a.blending = M.AdditiveBlending),
  23363. (o = new M.Sprite(a)).scale.set(0.3, 0.3, 0.3),
  23364. (o.position.z = -2),
  23365. (o.visible = !1),
  23366. (o.name = 'cursor'),
  23367. this.camera.add(o),
  23368. this.scene.add(this.camera),
  23369. (this.cursor = o)
  23370. var s = new this.CursorAnimation(this.scene, o, this.camera)
  23371. ;(this.cursor.triggerTargetEvent = s.triggerTargetEvent), this.updateListeners.push(s)
  23372. }),
  23373. (h.prototype.CursorAnimation = function (e, t, o) {
  23374. ;(this.cursor = t), (this.raycaster = new M.Raycaster()), (this.targetEventObj = {}), (this.type = 1), (this.tweenFlag = !0)
  23375. var s = this
  23376. ;(this.target = o),
  23377. console.log(o.uuid),
  23378. (this.euler = new M.Euler()),
  23379. (this.q0 = new M.Quaternion()),
  23380. (this.q1 = new M.Quaternion(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5))),
  23381. (this.zee = new M.Vector3(0, 0, 1)),
  23382. (this.alpha = -1e3),
  23383. (this.beta = -1e3),
  23384. (this.gamma = -1e3),
  23385. (this.orient = M.Math.degToRad(window.orientation || 0)),
  23386. window.addEventListener('orientationchange', function () {
  23387. s.orient = M.Math.degToRad(window.orientation || 0)
  23388. }),
  23389. window.addEventListener('deviceorientation', function (e) {
  23390. var t = M.Math.degToRad(e.alpha),
  23391. i = M.Math.degToRad(e.beta),
  23392. n = M.Math.degToRad(e.gamma)
  23393. if (
  23394. (this.isHuawei5X
  23395. ? (-1e3 === s.alpha && (s.alpha = t),
  23396. -1e3 === s.beta && (s.beta = i),
  23397. -1e3 === s.gamma && (s.gamma = n),
  23398. 0.06 < Math.abs(t - s.alpha) && (s.alpha = t),
  23399. 0.006 < Math.abs(i - s.beta) && (s.beta = i),
  23400. 0.006 < Math.abs(n - s.gamma) && (s.gamma = n))
  23401. : ((s.alpha = t), (s.beta = i), (s.gamma = n)),
  23402. h.vrDebug)
  23403. ) {
  23404. $('#info-device-orientation').css('display', 'block')
  23405. var r = ''
  23406. ;(r += 'alpha=(' + s.alpha + ')<BR/>'), (r += 'beta=(' + s.beta + ')<BR/>'), (r += 'gamma=' + s.gamma + '<BR/>'), (document.getElementById('info-device-orientation').innerHTML = r)
  23407. }
  23408. }),
  23409. (this.setObjectQuaternion = function (e, t, i, n, r) {
  23410. 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()
  23411. }),
  23412. parent !== window &&
  23413. window.addEventListener('message', function (e) {
  23414. var t,
  23415. i,
  23416. n,
  23417. r,
  23418. o = JSON.parse(e.data),
  23419. a = -1 !== window.navigator.userAgent.indexOf('KIW-TL00H')
  23420. o &&
  23421. o.alpha &&
  23422. o.beta &&
  23423. o.gamma &&
  23424. ((t = a),
  23425. (i = M.Math.degToRad(o.alpha)),
  23426. (n = M.Math.degToRad(o.beta)),
  23427. (r = M.Math.degToRad(o.gamma)),
  23428. t
  23429. ? (-1e3 === s.alpha && (s.alpha = i),
  23430. -1e3 === s.beta && (s.beta = n),
  23431. -1e3 === s.gamma && (s.gamma = r),
  23432. 0.06 < Math.abs(i - s.alpha) && (s.alpha = i),
  23433. 0.006 < Math.abs(n - s.beta) && (s.beta = n),
  23434. 0.006 < Math.abs(r - s.gamma) && (s.gamma = r))
  23435. : ((s.alpha = i), (s.beta = n), (s.gamma = r)))
  23436. }),
  23437. (this.update = function (e) {
  23438. TWEEN.update(), window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient), this.triggerTargetEvent())
  23439. }),
  23440. (this.triggerTargetEvent = function () {
  23441. var e = this.choseObj(),
  23442. t = e ? e.object : void 0
  23443. ;(this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj &&
  23444. (t && this.autoCursorPosition(e),
  23445. 1 === this.type
  23446. ? (this.cursorAnimate && this.cursorAnimate.stop(),
  23447. t &&
  23448. t.enabled &&
  23449. this.startAnimate(
  23450. function () {
  23451. this.clickCallback(t)
  23452. }.bind(this)
  23453. ))
  23454. : this.type,
  23455. (this.targetEventObj.lastObj = t))
  23456. }),
  23457. (this.choseObj = function () {
  23458. this.raycaster.setFromCamera(
  23459. {
  23460. x: 0,
  23461. y: 0
  23462. },
  23463. o
  23464. )
  23465. var e = (this.raycaster.ray, window.vrMarkers),
  23466. t = this.raycaster.intersectObjects(e)
  23467. if (0 < t.length) return t[0]
  23468. }),
  23469. (this.clickCallback = function (e) {
  23470. this.runTHREEAction(e, 'onclick')
  23471. }),
  23472. (this.runTHREEAction = function (e, t) {
  23473. switch (t) {
  23474. case 'onclick':
  23475. e._listeners &&
  23476. e._listeners.click &&
  23477. e._listeners.click.forEach(function (e) {
  23478. e()
  23479. })
  23480. break
  23481. case 'onhover':
  23482. e._listeners &&
  23483. e._listeners.hover &&
  23484. e._listeners.hover.forEach(function (e) {
  23485. e()
  23486. })
  23487. break
  23488. case 'onout':
  23489. e._listeners &&
  23490. e._listeners.out &&
  23491. e._listeners.out.forEach(function (e) {
  23492. e()
  23493. })
  23494. }
  23495. }),
  23496. (this.startAnimate = function (e) {
  23497. this.tweenFlag && this.initAnimation(e)
  23498. }),
  23499. (this.initAnimation = function (e) {
  23500. var t = this,
  23501. i = this.cursor.material.map.offset
  23502. ;(t.tweenFlag = !1),
  23503. (this.cursorAnimate = new TWEEN.Tween(i)
  23504. .to(
  23505. {
  23506. x: 1
  23507. },
  23508. 1e3
  23509. )
  23510. .onStart(function () {
  23511. t.tweenFlag = !1
  23512. })
  23513. .onStop(function () {
  23514. ;(t.tweenFlag = !0), (this.x = 0), (i.x = 0)
  23515. })
  23516. .onUpdate(function () {})
  23517. .onComplete(function () {
  23518. e(),
  23519. (i.x = 0),
  23520. setTimeout(function () {
  23521. t.tweenFlag = !0
  23522. }, 1500)
  23523. })),
  23524. this.cursorAnimate.easing(function (e) {
  23525. return Math.floor(17 * e) / 17
  23526. }),
  23527. this.cursorAnimate.start()
  23528. }),
  23529. (this.autoCursorPosition = function (e) {
  23530. this.cursor.scale.set(0.3, 0.3, 0.3)
  23531. })
  23532. }),
  23533. (h.prototype.vrRenderer = function (a, i, e) {
  23534. var s = new i.vrCamera(e)
  23535. ;(s.bananaAspect = 0.8), this.width, this.height
  23536. i = this
  23537. ;(this.setSize = function (e, t) {
  23538. a.setSize.call(this, e, t), (i.width = e), (i.height = t)
  23539. }),
  23540. (this.render = function (e, t, i, n) {
  23541. var r, o
  23542. if (((window.cameraQua = t.quaternion.clone()), t.__RESS__SKIP__STEREO__)) return a.render(e, t, i, n)
  23543. if ('PerspectiveCamera' === t.type) (r = s.cameraL), (o = s.cameraR), e.updateMatrixWorld(), null === t.parent && t.updateMatrixWorld(), s.vrCameraUpdate(t)
  23544. else {
  23545. if ('OrthographicCamera' !== t.type) return DEBUG && console.error('Unsupported renderer: ', t.type)
  23546. r = o = t
  23547. }
  23548. a.setScissorTest(!0),
  23549. a.setScissor(0, 0, this.width / 2, this.height),
  23550. a.setViewport(0, 0, this.width / 2, this.height),
  23551. a.render.call(this, e, r, i, n),
  23552. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  23553. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  23554. a.render.call(this, e, o, i, n),
  23555. a.setScissorTest(!1)
  23556. }),
  23557. (this.__proto__ = {
  23558. __proto__: a
  23559. })
  23560. }),
  23561. (h.prototype.vrCamera = function (e) {
  23562. ;(this.type = 'StereoCamera'),
  23563. (this._aspect = 1),
  23564. (this._overlap = 0.064),
  23565. (this.cameraL = new M.PerspectiveCamera()),
  23566. this.cameraL.layers.enable(1),
  23567. (this.cameraL.matrixAutoUpdate = !1),
  23568. (this.cameraR = new M.PerspectiveCamera()),
  23569. this.cameraR.layers.enable(2),
  23570. (this.cameraR.matrixAutoUpdate = !1),
  23571. (this.eyeRight = new M.Matrix4()),
  23572. (this.eyeLeft = new M.Matrix4()),
  23573. (this.vrCameraNeedsUpdate = !0),
  23574. (window.vrCameraL = this.cameraL),
  23575. Object.defineProperty(this, 'bananaAspect', {
  23576. get: function () {
  23577. return this._aspect
  23578. },
  23579. set: function (e) {
  23580. this._aspect !== e && (this.vrCameraNeedsUpdate = !0), (this._aspect = e)
  23581. }
  23582. }),
  23583. Object.defineProperty(this, 'overlap', {
  23584. get: function () {
  23585. return this._overlap
  23586. },
  23587. set: function (e) {
  23588. this._overlap !== e && (this.vrCameraNeedsUpdate = !0), (this._overlap = e)
  23589. }
  23590. }),
  23591. (this.vrCameraUpdate = function (e) {
  23592. if (
  23593. ((this.vrCameraNeedsUpdate = !0),
  23594. (this.vrCameraNeedsUpdate =
  23595. this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far),
  23596. this.vrCameraNeedsUpdate)
  23597. ) {
  23598. ;(this.vrCameraNeedsUpdate = !1),
  23599. console.debug('vrCameraUpdate'),
  23600. (this.bananaFocus = e.focus),
  23601. (this.bananaFov = e.fov),
  23602. (this.bananaReal_aspect = e.aspect * this.bananaAspect),
  23603. (this.bananaNear = e.near),
  23604. (this.bananaFar = e.far),
  23605. console.debug(e.aspect),
  23606. (this.bananaFocus = 10)
  23607. var t,
  23608. i,
  23609. n = e.projectionMatrix.clone(),
  23610. r = this.overlap / 2,
  23611. o = (r * this.bananaNear) / this.bananaFocus,
  23612. a = this.bananaNear * Math.tan((Math.PI / 180) * this.bananaFov * 0.5)
  23613. ;(this.eyeLeft.elements[12] = -r),
  23614. (this.eyeRight.elements[12] = r),
  23615. (t = -a * this.bananaReal_aspect + o),
  23616. (i = a * this.bananaReal_aspect + o),
  23617. (n.elements[0] = (2 * this.bananaNear) / (i - t)),
  23618. (n.elements[8] = (i + t) / (i - t)),
  23619. this.cameraL.projectionMatrix.copy(n),
  23620. (t = -a * this.bananaReal_aspect - o),
  23621. (i = a * this.bananaReal_aspect - o),
  23622. (n.elements[0] = (2 * this.bananaNear) / (i - t)),
  23623. (n.elements[8] = (i + t) / (i - t)),
  23624. this.cameraR.projectionMatrix.copy(n)
  23625. }
  23626. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft), this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  23627. })
  23628. }),
  23629. (h.prototype.boluoGetTexture = function (e) {
  23630. var t = new M.TextureLoader()
  23631. return (t.crossOrigin = 'anonymous'), t.load(e)
  23632. }),
  23633. (h.prototype.updateScreenSize = function (e) {
  23634. var t,
  23635. i,
  23636. n,
  23637. r = !1
  23638. e && !e.resize && null != e.width && null != e.height
  23639. ? ((i = e.width), (n = e.height), (r = !0), (t = 1))
  23640. : ((i = $('#player').width()),
  23641. (n = $('#player').height()),
  23642. e && e.resize && ((o = this.renderWidth), (a = this.renderHeight)),
  23643. (i === o && n === a && !this.forceUpdateSize) || ((o = i), (a = n), (r = !0), (t = window.devicePixelRatio))),
  23644. r && (this.setSize(i, n, t), (this.forceUpdateSize = !1))
  23645. }),
  23646. (h.prototype.updateComponents = function () {
  23647. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++) this.updateListeners[t].update(e)
  23648. }),
  23649. (h.prototype.suspend = function () {
  23650. ;(this.started = !1),
  23651. (this.suspendedObjects = this.scene.children.map(
  23652. function (e) {
  23653. return this.scene.remove(e), e
  23654. }.bind(this)
  23655. )),
  23656. this.render()
  23657. }),
  23658. (h.prototype.resume = function () {
  23659. this.suspendedObjects.forEach(
  23660. function (e) {
  23661. this.scene.add(e)
  23662. }.bind(this)
  23663. ),
  23664. (this.suspendedObjects = []),
  23665. (this.started = !0),
  23666. b()
  23667. })
  23668. var g,
  23669. m,
  23670. v,
  23671. y,
  23672. A,
  23673. C,
  23674. I,
  23675. P,
  23676. O,
  23677. L,
  23678. D,
  23679. N,
  23680. F,
  23681. E,
  23682. _,
  23683. b = function () {
  23684. this.started && (window.requestAnimationFrame(b), this.updateScreenSize(), this.updateComponents(), this.updateTextureMemory(), this.render(), this.emit(r.AfterRender))
  23685. }
  23686. ;(h.prototype.getImageData =
  23687. ((E = document.createElement('canvas')),
  23688. (_ = E.getContext('2d')),
  23689. function (e, t, i) {
  23690. return (E.width === t && E.height === i) || ((E.width = t), (E.height = i)), _.drawImage(e, 0, 0, t, i), _.getImageData(0, 0, t, i)
  23691. })),
  23692. (h.prototype.initSizedTexture2D = function (e, t, i) {
  23693. var n = this.renderer,
  23694. r = n.context,
  23695. o = n.state,
  23696. a = new M.Texture(null)
  23697. !(a.flipY = !1) !== i && (i = !1), (a.generateMipmaps = i)
  23698. var s = n.paramThreeToGL(a.format),
  23699. l = n.paramThreeToGL(a.type),
  23700. c = n.properties.get(a),
  23701. h = r.createTexture()
  23702. 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)
  23703. var u = n.paramThreeToGL(t)
  23704. return (
  23705. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  23706. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  23707. i
  23708. ? ((a.magFilter = M.LinearFilter),
  23709. (a.minFilter = M.LinearMipMapLinearFilter),
  23710. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23711. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  23712. r.generateMipmap(r.TEXTURE_2D))
  23713. : ((a.magFilter = M.LinearFilter),
  23714. (a.minFilter = M.LinearFilter),
  23715. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23716. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  23717. o.bindTexture(r.TEXTURE_2D, null),
  23718. (c.__webglTexture = h),
  23719. a
  23720. )
  23721. }),
  23722. (h.prototype.initSizedCubeMap = function (e, t) {
  23723. var i = this.renderer,
  23724. n = i.context,
  23725. r = i.state,
  23726. o = new M.CubeTexture([null, null, null, null, null, null])
  23727. ;(o.flipY = !1), (o.generateMipmaps = t)
  23728. var a = i.paramThreeToGL(o.format),
  23729. s = i.paramThreeToGL(o.type),
  23730. l = i.properties.get(o),
  23731. c = n.createTexture()
  23732. r.bindTexture(n.TEXTURE_CUBE_MAP, c), n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY)
  23733. for (var h = 0; h < 6; h++) n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null)
  23734. return (
  23735. t
  23736. ? ((o.magFilter = M.LinearFilter),
  23737. (o.minFilter = M.LinearMipMapLinearFilter),
  23738. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23739. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  23740. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  23741. n.generateMipmap(n.TEXTURE_CUBE_MAP))
  23742. : ((o.magFilter = M.LinearFilter),
  23743. (o.minFilter = M.LinearFilter),
  23744. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23745. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  23746. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  23747. (l.__image__webglTextureCube = c),
  23748. o
  23749. )
  23750. }),
  23751. (h.prototype.deallocateCubeTexture = function (e) {
  23752. var t = this.renderer,
  23753. i = t.context,
  23754. n = t.properties.get(e)
  23755. i.deleteTexture(n.__image__webglTextureCube)
  23756. }),
  23757. (h.prototype.uploadTexture2D = function (e, t, i, n, r, o) {
  23758. var a = this.renderer,
  23759. s = a.context,
  23760. l = a.state,
  23761. c = a.properties.get(t)
  23762. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23763. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23764. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23765. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23766. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23767. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23768. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23769. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23770. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23771. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23772. l.bindTexture(s.TEXTURE_2D, null)
  23773. }),
  23774. (h.prototype.uploadTexture3D = function (e, t, i, n, r, o, a) {
  23775. var s = this.renderer,
  23776. l = s.context,
  23777. c = s.state,
  23778. h = s.properties.get(t)
  23779. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23780. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23781. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23782. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23783. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23784. }),
  23785. (h.prototype.rebuildMipMaps2D = function (e) {
  23786. var t = this.renderer,
  23787. i = t.context,
  23788. n = t.state
  23789. t.properties.get(e), i.generateMipmap(i.TEXTURE_2D), n.bindTexture(i.TEXTURE_2D, null)
  23790. }),
  23791. (h.prototype.rebuildMipMaps3D = function (e) {
  23792. var t = this.renderer,
  23793. i = t.context,
  23794. n = t.state,
  23795. r = t.properties.get(e)
  23796. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube), i.generateMipmap(i.TEXTURE_CUBE_MAP), n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23797. }),
  23798. (h.prototype.renderToCubeMap =
  23799. ((P = !1),
  23800. (F = N = D = L = O = null),
  23801. function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23802. this.renderer.context,
  23803. P ||
  23804. (((L = new M.OrthographicCamera(-0.5, 0.5, 0.5, -0.5, -200, 200)).position.z = 150),
  23805. (O = new M.Scene()).add(L),
  23806. (D = new M.ShaderMaterial({
  23807. uniforms: {
  23808. tDiffuse: {
  23809. type: 't',
  23810. value: null
  23811. },
  23812. alpha: {
  23813. type: 'f',
  23814. value: 1
  23815. }
  23816. },
  23817. vertexShader: R.basicTextured.vertexShader,
  23818. fragmentShader: R.basicTextured.fragmentShader,
  23819. depthWrite: !1,
  23820. depthTest: !1,
  23821. side: M.DoubleSide
  23822. })),
  23823. (N = new M.PlaneBufferGeometry(1, 1)),
  23824. ((F = new M.Mesh(N, D)).position.z = 0),
  23825. O.add(F),
  23826. (P = !0))
  23827. var m = N.getAttribute('uv')
  23828. m.setDynamic(!0), (m.needsUpdate = !0)
  23829. var v = m.array,
  23830. y = r / i,
  23831. A = o / n,
  23832. C = a / i,
  23833. I = s / n
  23834. ;(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)
  23835. var E = N.getAttribute('position')
  23836. E.setDynamic(!0), (E.needsUpdate = !0)
  23837. var _ = E.array,
  23838. b = l / t.width - 0.5,
  23839. w = c / t.height - 0.5,
  23840. T = h / t.width,
  23841. x = u / t.height
  23842. ;(_[0] = b),
  23843. (_[1] = w + x),
  23844. (_[3] = b + T),
  23845. (_[4] = w + x),
  23846. (_[6] = b),
  23847. (_[7] = w),
  23848. (_[9] = b + T),
  23849. (_[10] = w),
  23850. this.renderer.properties.get(e),
  23851. (D.uniforms.tDiffuse.value = e),
  23852. (D.blending = p || M.NoBlending),
  23853. (D.transparent = !!f),
  23854. null != g || (g = 1),
  23855. (D.uniforms.alpha.value = g),
  23856. (D.needUpdate = !0),
  23857. (t.activeCubeFace = d),
  23858. t.viewport.set(0, 0, t.width, t.height)
  23859. var S = this.renderer.autoClear
  23860. ;(this.renderer.autoClear = !1), this.renderer.render(O, L, t, !1), (this.renderer.autoClear = S)
  23861. })),
  23862. (h.prototype.copyCubeMap =
  23863. ((g = !1),
  23864. (C = A = y = v = m = null),
  23865. (I = new M.Euler()),
  23866. new M.Vector3(),
  23867. function (e, t, i, n, r, o, a, s, l) {
  23868. this.renderer,
  23869. g ||
  23870. ((v = new M.OrthographicCamera(-1, 1, 1, -1, 0, 200)).position.set(0, 0, 0),
  23871. (m = new M.Scene()).add(v),
  23872. (y = new M.ShaderMaterial({
  23873. uniforms: {
  23874. tDiffuse: {
  23875. type: 't',
  23876. value: null
  23877. },
  23878. alpha: {
  23879. type: 'f',
  23880. value: 1
  23881. }
  23882. },
  23883. vertexShader: R.copyCubeMap.vertexShader,
  23884. fragmentShader: R.copyCubeMap.fragmentShader,
  23885. depthWrite: !1,
  23886. depthTest: !1,
  23887. side: M.DoubleSide
  23888. })),
  23889. (A = new M.BoxGeometry(2, 2, 2)),
  23890. (C = new M.Mesh(A, y)),
  23891. m.add(C),
  23892. (g = !0))
  23893. for (var c = 0; c < 6; c++)
  23894. h.getCubeOrientationForCubeFace(c, I),
  23895. C.rotation.copy(I),
  23896. (C.matrixWorldNeedsUpdate = !0),
  23897. C.updateMatrixWorld(),
  23898. (y.uniforms.tDiffuse.value = e),
  23899. (y.blending = a || M.NoBlending),
  23900. (y.transparent = !!s),
  23901. null != l || (l = 1),
  23902. (y.uniforms.alpha.value = l),
  23903. (y.needUpdate = !0),
  23904. (t.activeCubeFace = c),
  23905. t.viewport.set(0, 0, r, o),
  23906. this.renderer.render(m, v, t, !1)
  23907. })),
  23908. (h.getLookAtForCubeFace = function (e, t) {
  23909. switch (e) {
  23910. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23911. t.set(1, 0, 0)
  23912. break
  23913. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23914. t.set(-1, 0, 0)
  23915. break
  23916. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23917. t.set(0, 1, 0)
  23918. break
  23919. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23920. t.set(0, -1, 0)
  23921. break
  23922. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23923. t.set(0, 0, 1)
  23924. break
  23925. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23926. t.set(0, 0, -1)
  23927. }
  23928. }),
  23929. (h.getCubeOrientationForCubeFace = function (e, t) {
  23930. switch (e) {
  23931. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23932. t.set(0, -Math.PI / 2, 0)
  23933. break
  23934. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23935. t.set(0, Math.PI / 2, 0)
  23936. break
  23937. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23938. t.set(Math.PI / 2, Math.PI, 0)
  23939. break
  23940. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23941. t.set(-Math.PI / 2, Math.PI, 0)
  23942. break
  23943. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23944. t.set(0, -Math.PI, 0)
  23945. break
  23946. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23947. t.set(0, 0, 0)
  23948. }
  23949. }),
  23950. (t.exports = h)
  23951. },
  23952. {
  23953. '../enum/GLCubeFaces': 25,
  23954. '../enum/GLTextureType': 26,
  23955. '../enum/SceneRendererEvents': 43,
  23956. '../exception/BasicException': 55,
  23957. '../exception/RendererCreationException': 57,
  23958. '../settings': 166,
  23959. '../shaders': 167,
  23960. '../util/browser': 182,
  23961. events: 202,
  23962. three: 217
  23963. }
  23964. ],
  23965. 159: [
  23966. function (e, t, i) {
  23967. 'use strict'
  23968. function n(e) {
  23969. ;(this.messenger = new a(e)), (this.clientKey = null)
  23970. }
  23971. var o = e('../util/ajax'),
  23972. r = e('./PostMessageType'),
  23973. a = e('./postmessage'),
  23974. s = e('./VersionInfo'),
  23975. l = e('events').EventEmitter,
  23976. c = window.location.origin + '/api/v1/user/'
  23977. ;((n.prototype = Object.create(l.prototype)).bindEvents = function () {
  23978. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  23979. }),
  23980. (n.prototype.waitForConnection = function () {
  23981. return new Promise(
  23982. function (t, i) {
  23983. this.messenger.on(
  23984. r.CONNECT,
  23985. function (e) {
  23986. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  23987. }.bind(this)
  23988. )
  23989. }.bind(this)
  23990. )
  23991. }),
  23992. (n.prototype.onConnectionReceived = function (i) {
  23993. return (
  23994. this.messenger.setTarget(i.source, i.origin),
  23995. this.verifyConnection(i).then(
  23996. function (e, t) {
  23997. this.messenger.send({
  23998. type: r.ACCEPT,
  23999. toId: i.fromId,
  24000. warning: t
  24001. }),
  24002. (this.clientKey = e),
  24003. this.messenger.removeAllListeners(r.CONNECT),
  24004. this.bindEvents()
  24005. }.bind(this),
  24006. function (e) {
  24007. this.messenger.send({
  24008. type: r.REJECT,
  24009. toId: i.fromId,
  24010. reason: e
  24011. }),
  24012. this.messenger.setTarget()
  24013. }.bind(this)
  24014. )
  24015. )
  24016. }),
  24017. (n.prototype.verifyConnection = function (r) {
  24018. return new Promise(function (e, t) {
  24019. var i
  24020. if (s.isDeprecated(r.sdkVersion)) i = '这个版本正在被弃用'
  24021. else if (!s.isSupported(r.sdkVersion)) return t('不支持此版本的SDK')
  24022. var n = {
  24023. cache: !1,
  24024. headers: {
  24025. 'X-port-Application-Key': r.applicationKey,
  24026. 'X-port-Referrer': r.origin
  24027. }
  24028. }
  24029. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, 'key/referrer mismatch'))
  24030. })
  24031. }),
  24032. (n.prototype.onMessageReceived = function (t) {
  24033. if (this.validateClientApplicationKey(t.applicationKey)) {
  24034. var i = this
  24035. ;(t.onDone = function (e) {
  24036. ;(e.toId = t.fromId), (e.uid = t.uid), (e.type = r.RESPONSE), i.messenger.send(e)
  24037. }),
  24038. this.emit(r.ACTION, t)
  24039. }
  24040. }),
  24041. (n.prototype.validateClientApplicationKey = function (e) {
  24042. return this.clientKey === e
  24043. }),
  24044. (n.prototype.sendEvent = function (e, t) {
  24045. this.messenger.send({
  24046. type: r.EVENT,
  24047. eventType: e,
  24048. eventData: t
  24049. })
  24050. }),
  24051. (t.exports = n)
  24052. },
  24053. {
  24054. '../util/ajax': 181,
  24055. './PostMessageType': 160,
  24056. './VersionInfo': 163,
  24057. './postmessage': 165,
  24058. events: 202
  24059. }
  24060. ],
  24061. 160: [
  24062. function (e, t, i) {
  24063. 'use strict'
  24064. t.exports = Object.freeze({
  24065. CONNECT: 'postmessage.connect',
  24066. ACCEPT: 'postmessage.accept',
  24067. REJECT: 'postmessage.reject',
  24068. ACTION: 'postmessage.action',
  24069. RESPONSE: 'postmessage.response',
  24070. EVENT: 'postmessage.event'
  24071. })
  24072. },
  24073. {}
  24074. ],
  24075. 161: [
  24076. function (e, t, i) {
  24077. 'use strict'
  24078. t.exports = Object.freeze({
  24079. MOVE: 'sdk.move',
  24080. ENTER_PANO: 'sdk.enterpano',
  24081. MODEL_LOADED: 'sdk.modelloaded'
  24082. })
  24083. },
  24084. {}
  24085. ],
  24086. 162: [
  24087. function (e, t, i) {
  24088. 'use strict'
  24089. t.exports = Object.freeze({
  24090. FLY: 'transition.fly',
  24091. FADEOUT: 'transition.fade',
  24092. INSTANT: 'transition.instant'
  24093. })
  24094. },
  24095. {}
  24096. ],
  24097. 163: [
  24098. function (e, t, i) {
  24099. 'use strict'
  24100. t.exports = {
  24101. current: '1.0',
  24102. supported: ['1.0'],
  24103. deprecated: [],
  24104. isSupported: function (e) {
  24105. return -1 !== this.supported.indexOf(e)
  24106. },
  24107. isDeprecated: function (e) {
  24108. return -1 !== this.deprecated.indexOf(e)
  24109. },
  24110. isValid: function (e) {
  24111. return this.isSupported(e) || this.isDeprecated(e)
  24112. }
  24113. }
  24114. },
  24115. {}
  24116. ],
  24117. 164: [
  24118. function (q, X, e) {
  24119. ;(function (e) {
  24120. 'use strict'
  24121. function r(e, t, i) {
  24122. e = e && e.toLowerCase().trim()
  24123. var n = new C.UP.clone(),
  24124. r = Math.PI / 3,
  24125. o = Math.PI / 2
  24126. switch (e) {
  24127. case 'left':
  24128. i.copy(t), i.applyAxisAngle(n, o)
  24129. break
  24130. case 'right':
  24131. i.copy(t), i.applyAxisAngle(n, -o)
  24132. break
  24133. case 'forwardleft':
  24134. i.copy(t), i.applyAxisAngle(n, r)
  24135. break
  24136. case 'forwardright':
  24137. i.copy(t), i.applyAxisAngle(n, -r)
  24138. break
  24139. case 'forward':
  24140. default:
  24141. i.copy(t)
  24142. }
  24143. return i
  24144. }
  24145. function o(e, t) {
  24146. if (e) {
  24147. var i = {
  24148. pano: e,
  24149. lookAtPoint: null,
  24150. duration: null,
  24151. maxDistanceOverride: null,
  24152. skipWarpingCheck: !1
  24153. }
  24154. this.player.flyToPano(i, function () {
  24155. t &&
  24156. t({
  24157. success: !0,
  24158. message: 'Transition complete.'
  24159. })
  24160. })
  24161. } else
  24162. M.warn('Showcase -> clickPanoObject: Unable to find pano.'),
  24163. t &&
  24164. t({
  24165. success: !1,
  24166. error: 'Unable to find pano.'
  24167. })
  24168. }
  24169. function a(e, t) {
  24170. t.copy(C.FORWARD), e.getDirection(t)
  24171. }
  24172. function c(i) {
  24173. return {
  24174. panos: i.panos.list.map(function (e) {
  24175. var t = y.getCubemapUrls(i.urls, e.id, 'high')[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z]
  24176. return {
  24177. uuid: e.id,
  24178. aligned: e.alignmentType === g.ALIGNED,
  24179. neighbourUUIDs: e.neighbourUUIDs.slice(),
  24180. position: (function (e) {
  24181. return e.alignmentType !== g.ALIGNED
  24182. ? null
  24183. : {
  24184. x: e.position.x,
  24185. y: e.position.y,
  24186. z: e.position.z
  24187. }
  24188. })(e),
  24189. rotation: (function (e) {
  24190. var t = new h.Euler().setFromQuaternion(e.quaternion, 'YXZ')
  24191. return {
  24192. x: h.Math.radToDeg(t._x),
  24193. y: h.Math.radToDeg(t._y),
  24194. z: h.Math.radToDeg(t._z)
  24195. }
  24196. })(e),
  24197. thumbnail: t
  24198. }
  24199. })
  24200. }
  24201. }
  24202. var t,
  24203. l,
  24204. i,
  24205. h = q('three'),
  24206. u = q('./ApiHost'),
  24207. n = q('../util/logger'),
  24208. d = q('../util/common'),
  24209. s = q('../util/math'),
  24210. p = q('../enum/ModelManagerEvents'),
  24211. f = q('./PostMessageType'),
  24212. g = q('../enum/AlignmentType'),
  24213. m = q('../enum/Direction'),
  24214. v = q('./TransitionStyles'),
  24215. y = q('../util/panorama'),
  24216. A = q('../enum/GLCubeFaces'),
  24217. C = q('../enum/Vectors'),
  24218. I = q('../enum/Viewmode'),
  24219. E = q('../enum/WarpStyle'),
  24220. _ = (q('../enum/Keys'), q('../enum/PlayerEvents')),
  24221. b = q('../sdk/SdkEvents'),
  24222. w = ((C = q('../enum/Vectors')), q('../enum/ControlEvents')),
  24223. T = q('../enum/RenderLayers'),
  24224. x = (q('../constants'), q('../settings')),
  24225. S = q('../lib/jpeg_encoder'),
  24226. M = new n(e),
  24227. R =
  24228. ((N.active = !1),
  24229. (N.angle = 0),
  24230. (N.angleTravelled = 0),
  24231. (N.playerDirection = new h.Vector3()),
  24232. (N.lastFacingDirection = new h.Vector3()),
  24233. (N.onDone = null),
  24234. (N.player = null),
  24235. (N.start = function (e, t, i, n) {
  24236. ;(N.active = !0),
  24237. e && t && (t = 0),
  24238. (N.angle = e || t),
  24239. (N.xAngle = e),
  24240. (N.yAngle = t),
  24241. (N.angleTravelled = 0),
  24242. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24243. i.getDirection(N.playerDirection),
  24244. N.lastFacingDirection.copy(N.playerDirection),
  24245. N.projectVectors(),
  24246. (N.onDone = n),
  24247. (N.player = i),
  24248. N()
  24249. }),
  24250. (N.projectVectors = function () {
  24251. N.xAngle && (N.playerDirection.projectOnPlane(C.UP), N.lastFacingDirection.projectOnPlane(C.UP))
  24252. }),
  24253. N),
  24254. P =
  24255. ((i = new h.Vector3()),
  24256. function (e) {
  24257. 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.')
  24258. }),
  24259. O =
  24260. ((l = new h.Vector3()),
  24261. function (e) {
  24262. var t = this.player.getDirection()
  24263. l.copy(t)
  24264. var i = l.y
  24265. ;(l.y = 0), l.normalize()
  24266. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1)
  24267. 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
  24268. this.player.mode === I.DOLLHOUSE && (n = -n)
  24269. var r =
  24270. function () {
  24271. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  24272. }.call(this) - 0.1,
  24273. o =
  24274. function () {
  24275. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  24276. }.call(this) + 0.1,
  24277. a = n + e
  24278. r < a ? (a = r) : a < o && (a = o)
  24279. var s = a - n
  24280. return 0 < e && s < 0.01 && (s = 0), e < 0 && -0.01 < s && (s = 0), s
  24281. }),
  24282. L =
  24283. ((t = new h.Euler()),
  24284. function (e) {
  24285. return (
  24286. t.setFromQuaternion(e.quaternion, 'YXZ'),
  24287. {
  24288. position: {
  24289. x: e.position.x,
  24290. y: e.position.y,
  24291. z: e.position.z
  24292. },
  24293. rotation: {
  24294. x: h.Math.radToDeg(t.x),
  24295. y: h.Math.radToDeg(t.y),
  24296. z: 0
  24297. },
  24298. pano: e.currentPano ? e.currentPano.id : null,
  24299. mode: e.mode
  24300. }
  24301. )
  24302. }),
  24303. D = null
  24304. function N() {
  24305. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD), N.player.getDirection(N.playerDirection), N.projectVectors()
  24306. var e = N.playerDirection.angleTo(N.lastFacingDirection)
  24307. ;(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))
  24308. }
  24309. X.exports = {
  24310. init: function (e, t, i, n, r) {
  24311. Y.init(e, t, i, r),
  24312. (D = new Promise(
  24313. function (e, t) {
  24314. i.on(_.Ready, function () {
  24315. e()
  24316. })
  24317. }.bind(this)
  24318. ))
  24319. var o = new u(window),
  24320. a = o.waitForConnection()
  24321. a.then(function (e) {
  24322. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  24323. })
  24324. var s,
  24325. l =
  24326. ((s = Date.now()),
  24327. function () {
  24328. if (!(Date.now() - s < 100)) {
  24329. var e = L(i)
  24330. o.sendEvent(b.MOVE, {
  24331. state: e
  24332. }),
  24333. (s = Date.now())
  24334. }
  24335. })
  24336. i.on(_.Move, l),
  24337. i.on(_.ViewChanged, l),
  24338. n.on(p.ActiveModelChanged, function (e) {
  24339. function t(e) {
  24340. var t,
  24341. i = e.newPano.id
  24342. e.oldPano && (t = e.oldPano.id),
  24343. i !== t &&
  24344. o.sendEvent(b.ENTER_PANO, {
  24345. oldPano: t,
  24346. newPano: i
  24347. })
  24348. }
  24349. var i = e.model,
  24350. n = e.oldModel
  24351. ;(Y.model = i),
  24352. a.then(function () {
  24353. o.sendEvent(b.MODEL_LOADED, {
  24354. metadata: c(i)
  24355. })
  24356. }),
  24357. n &&
  24358. n.panos.forEach(function (e) {
  24359. e.removeEventListener('enter', t)
  24360. }),
  24361. i.panos.forEach(function (e) {
  24362. e.on('enter', t)
  24363. })
  24364. })
  24365. }
  24366. }
  24367. var F,
  24368. B,
  24369. V,
  24370. k,
  24371. U,
  24372. H,
  24373. z,
  24374. G,
  24375. W,
  24376. j,
  24377. Y = {
  24378. director: null,
  24379. player: null,
  24380. controls: null,
  24381. sceneRenderer: null,
  24382. model: null,
  24383. init: function (e, t, i, n) {
  24384. ;(this.director = e), (this.player = i), (this.controls = t), (this.sceneRenderer = n)
  24385. },
  24386. handleToObject: {},
  24387. objectToHandle: {},
  24388. handleCount: 0,
  24389. onMessageReceive: function (e) {
  24390. if (e) {
  24391. var t = e.targetFunction,
  24392. i = e.params,
  24393. n = e.onDone
  24394. t && this[t] && this[t](i, n)
  24395. }
  24396. },
  24397. waitForInit: function (e, t) {
  24398. D.then(
  24399. t.bind({
  24400. success: !0,
  24401. message: 'Init complete.'
  24402. })
  24403. )
  24404. },
  24405. moveToPano:
  24406. ((W = new h.Euler(0, 0, 0, 'YXZ')),
  24407. (j = new h.Quaternion()),
  24408. function (e, t) {
  24409. var i = e.pano,
  24410. n = e.rotation,
  24411. r = e.transition
  24412. if (!this.model)
  24413. return t({
  24414. success: !1,
  24415. error: 'The model has not been loaded yet'
  24416. })
  24417. var o = this.model.panos.get(i)
  24418. if (!o)
  24419. return t({
  24420. success: !1,
  24421. error: i + ' does not exist in this model'
  24422. })
  24423. if (!n)
  24424. return t({
  24425. sucess: !1,
  24426. erorr: n + ' is not a valid rotation'
  24427. })
  24428. 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)
  24429. var a = {
  24430. success: !0,
  24431. message: i
  24432. }
  24433. if (r === v.FADEOUT) j.setFromEuler(W), this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a))
  24434. else {
  24435. var s, l
  24436. r === v.INSTANT && (l = s = 0)
  24437. var c = C.FORWARD.clone().applyEuler(W).add(o.position)
  24438. this.player.flyToPano(
  24439. {
  24440. pano: o,
  24441. lookAtPoint: c,
  24442. duration: s,
  24443. aimDuration: l
  24444. },
  24445. t.bind(this, a)
  24446. )
  24447. }
  24448. }),
  24449. moveInDirection: function (e, t) {
  24450. var i = e.direction
  24451. return void 0 === m[i]
  24452. ? (M.warn('Showcase -> moveInDirection: Cannot move in invalid direction.'),
  24453. void (
  24454. t &&
  24455. t({
  24456. success: !1,
  24457. error: 'Invalid direction.'
  24458. })
  24459. ))
  24460. : void this.player.flyLocalDirection(C[i].clone()).then(function (e) {
  24461. t(
  24462. e
  24463. ? {
  24464. success: !0,
  24465. message: 'moved ' + i
  24466. }
  24467. : {
  24468. success: !1,
  24469. error: 'Cannot move in direction: ' + i
  24470. }
  24471. )
  24472. })
  24473. },
  24474. getPose: function (e, t) {
  24475. return (
  24476. this.player.camera.position,
  24477. new h.Euler().setFromQuaternion(this.player.camera.quaternion, 'YXZ'),
  24478. t({
  24479. success: !0,
  24480. message: L(this.player)
  24481. })
  24482. )
  24483. },
  24484. takeScreenShot:
  24485. ((z = new h.PerspectiveCamera()),
  24486. (G = new h.WebGLRenderTarget()),
  24487. function (e, t) {
  24488. if (!e.resolution)
  24489. return t({
  24490. success: !1,
  24491. error: 'An invalid resolution was specified'
  24492. })
  24493. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  24494. var i = this.sceneRenderer.renderer.getSize()
  24495. ;(e.resolution.width = i.width), (e.resolution.height = i.height)
  24496. }
  24497. z.layers.set(T.DEFAULT),
  24498. e.visibleObjects &&
  24499. (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  24500. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  24501. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE))
  24502. var n = e.resolution.width,
  24503. r = e.resolution.height,
  24504. o = n / r
  24505. z.position.copy(this.sceneRenderer.camera.position),
  24506. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  24507. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  24508. (z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o),
  24509. G.setSize(n, r),
  24510. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G)
  24511. var a = new Uint8Array(n * r * 4)
  24512. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a)
  24513. var s = S.encode(
  24514. {
  24515. data: a,
  24516. width: n,
  24517. height: r,
  24518. heading: 180,
  24519. pitch: 0
  24520. },
  24521. {
  24522. quality: 75,
  24523. flipY: !0
  24524. }
  24525. )
  24526. t({
  24527. success: !0,
  24528. message: 'data:image/jpg;base64,' + d.uint8ToBase64(s.data)
  24529. })
  24530. }),
  24531. findRankedPano:
  24532. ((U = new h.Vector3()),
  24533. (H = new h.Vector3()),
  24534. function (e, t) {
  24535. a(this.player, H), r(t, H, U)
  24536. var i = this.player.rankedPanoInDirection(e, U)
  24537. if (i) {
  24538. var n = this.objectToHandle[i.id]
  24539. return n || ((this.objectToHandle[i.id] = n = this.handleCount++), (this.handleToObject[n] = i)), n
  24540. }
  24541. return M.warn('Showcase -> findRankedPano: Unable to find nearby pano.'), -1
  24542. }),
  24543. findRankedtag:
  24544. ((V = new h.Vector3()),
  24545. (k = new h.Vector3()),
  24546. function (e, t) {
  24547. a(this.player, k), r(t, k, V)
  24548. var i = this.player.rankedtagInDirection(e, V)
  24549. if (i) {
  24550. var n = this.objectToHandle[i.sid]
  24551. return n || ((this.objectToHandle[i.sid] = n = this.handleCount++), (this.handleToObject[n] = i)), n
  24552. }
  24553. return M.warn('Showcase -> findRankedtag: Unable to find nearby tag.'), -1
  24554. }),
  24555. clickNearesttag: function (e) {
  24556. this.clickRankedtag(0, e)
  24557. },
  24558. clickRankedtag: function (e, t) {
  24559. var i = function (e, t) {
  24560. var i = this.findRankedtag(e, t)
  24561. return 0 <= i ? this.handleToObject[i] : (M.warn('Showcase -> findRankedtagObject: Unable to find nearby tag.'), null)
  24562. }.call(this, e, t)
  24563. i && P.call(this, i)
  24564. },
  24565. clickNearestPano: function (e, t) {
  24566. this.clickRankedPano(0, e, t)
  24567. },
  24568. clickRankedPano: function (e, t, i) {
  24569. var n = function (e, t) {
  24570. var i = this.findRankedPano(e, t)
  24571. return 0 <= i ? this.handleToObject[i] : (M.warn('Showcase -> findRankedPanoObject: Unable to find nearby pano.'), null)
  24572. }.call(this, e, t)
  24573. n ? o.call(this, n, i) : i(null)
  24574. },
  24575. clickPano: function (e, t) {
  24576. var i = this.handleTable[e]
  24577. i ? o.call(this, i, t) : t(null)
  24578. },
  24579. rotateDirection: function (e, t) {
  24580. var i = e.direction,
  24581. n = e.angle
  24582. if (!R.active) {
  24583. var r = 0,
  24584. o = 0,
  24585. a = 0,
  24586. s = 0
  24587. if (!n || isNaN(n))
  24588. return (
  24589. M.warn('Showcase -> rotateDirection: Invalid rotation angle.'),
  24590. void (
  24591. t &&
  24592. t({
  24593. success: !1,
  24594. error: 'Invalid rotation angle.'
  24595. })
  24596. )
  24597. )
  24598. if (this.player.mode === I.TRANSITIONING)
  24599. return (
  24600. M.warn('Automation -> rotateDirection: Cannot rotate while transitioning'),
  24601. void (
  24602. t &&
  24603. t({
  24604. success: !1,
  24605. error: 'Cannot rotate while transitioning'
  24606. })
  24607. )
  24608. )
  24609. if (i === m.RIGHT || i === m.LEFT) i === m.RIGHT && (n = -n), (r = 0 < n ? -1 : 1), (a = n)
  24610. else {
  24611. if (i !== m.UP && i !== m.DOWN)
  24612. return (
  24613. M.warn('Showcase -> rotateDirection: Invalid direction for rotation: ' + i),
  24614. void (
  24615. t &&
  24616. t({
  24617. success: !1,
  24618. error: 'Invalid direction for rotation.'
  24619. })
  24620. )
  24621. )
  24622. if (this.player.mode === I.FLOORPLAN)
  24623. return (
  24624. M.warn('Showcase -> rotateDirection: Cannot rotate ' + i + ' in floorplan mode'),
  24625. void (
  24626. t &&
  24627. t({
  24628. success: !1,
  24629. error: 'Cannot rotate ' + i + ' in floorplan mode'
  24630. })
  24631. )
  24632. )
  24633. if ((i === m.DOWN && (n = -n), 0 === (n = O.call(this, n))))
  24634. return (
  24635. M.warn('Showcase -> rotateDirection: Already at maximum rotation in direction: ' + i),
  24636. void (
  24637. t &&
  24638. t({
  24639. success: !1,
  24640. error: 'Already at maximum rotation in direction: ' + i
  24641. })
  24642. )
  24643. )
  24644. ;(o = 0 < n ? 1 : -1), (s = n)
  24645. }
  24646. var l = n
  24647. ;(n = h.Math.degToRad(n)), (a = h.Math.degToRad(a)), (s = h.Math.degToRad(s))
  24648. var c = this.controls.activeControl
  24649. c.startRotating(r, o),
  24650. R.start(a, s, this.player, function () {
  24651. c.stopRotating(!0),
  24652. t &&
  24653. t({
  24654. success: !0,
  24655. message: 'Rotated ' + l.toFixed(2) + '° in direction: ' + e.direction
  24656. })
  24657. })
  24658. }
  24659. },
  24660. rotate:
  24661. ((F = new h.Vector3()),
  24662. (B = new h.Vector3()),
  24663. function (e, t) {
  24664. var i = e.xAngle,
  24665. n = e.yAngle
  24666. if (!R.active) {
  24667. if (((i = i || 0), (n = n || 0), isNaN(i) || isNaN(n)))
  24668. return (
  24669. M.warn('Showcase -> rotate: Invalid rotation angle.'),
  24670. void (
  24671. t &&
  24672. t({
  24673. success: !1,
  24674. error: 'Invalid rotation angle.'
  24675. })
  24676. )
  24677. )
  24678. if (this.player.mode === I.TRANSITIONING)
  24679. return (
  24680. M.warn('Automation -> rotate: Cannot rotate while transitioning'),
  24681. void (
  24682. t &&
  24683. t({
  24684. success: !1,
  24685. error: 'Cannot rotate while transitioning'
  24686. })
  24687. )
  24688. )
  24689. Math.abs(i) < 0.01 && (i = 0), Math.abs(n) < 0.01 && (n = 0)
  24690. var r = n
  24691. n = O.call(this, n)
  24692. var o = 0 < r ? 'UP' : 'DOWN'
  24693. if (!(i = -i) && r && !n)
  24694. return (
  24695. M.warn('Showcase -> rotate: Already at maximum rotation in direction: ' + o),
  24696. void (
  24697. t &&
  24698. t({
  24699. success: !1,
  24700. error: 'Already at maximum rotation in direction: ' + o
  24701. })
  24702. )
  24703. )
  24704. n < r && M.warn('Showcase -> rotate: Reached maximum rotation in direction: ' + o)
  24705. var a = n
  24706. ;(n = h.Math.degToRad(n)),
  24707. (i = h.Math.degToRad(i)),
  24708. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24709. this.player.getDirection(F),
  24710. B.copy(F).applyAxisAngle(C.UP, i),
  24711. B.applyAxisAngle(C.RIGHT, n)
  24712. var s = (F.angleTo(B), 0 < i ? -1 : i < 0 ? 1 : 0),
  24713. l = 0 < n ? 1 : n < 0 ? -1 : 0
  24714. Math.abs(i) > Math.abs(n) ? (l *= Math.abs(n / i)) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n))
  24715. var c = this.controls.activeControl
  24716. c.startRotating(s, l),
  24717. R.start(i, n, this.player, function () {
  24718. c.stopRotating(!0),
  24719. t &&
  24720. t({
  24721. success: !0,
  24722. message: 'Rotated ' + e.xAngle.toFixed(2) + '° horizontally, ' + a.toFixed(2) + '° vertically'
  24723. })
  24724. })
  24725. }
  24726. }),
  24727. panCamera: function (e, i) {
  24728. function t(e) {
  24729. switch ((r.removeAllListeners(w.AutoPanComplete), r.removeAllListeners(w.AutoPanInterrupt), r.removeAllListeners(w.AutoPanClamped), e)) {
  24730. case w.AutoPanInterrupt:
  24731. i({
  24732. success: !0,
  24733. message: 'Camera panning interrupted.'
  24734. })
  24735. break
  24736. case w.AutoPanClamped:
  24737. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24738. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < 0.01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < 0.01)
  24739. return void i({
  24740. success: !1,
  24741. error: 'Already at edge of current model bounds.'
  24742. })
  24743. var t = 'The view point is outside the bounds for the current model. '
  24744. ;(t += 'The view point was clamped to ' + o(r.target.x, r.target.z)), console.warn(t)
  24745. }
  24746. case w.AutoPanComplete:
  24747. i({
  24748. success: !0,
  24749. message: 'Panned camera to position ' + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24750. })
  24751. }
  24752. }
  24753. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  24754. return i({
  24755. success: !1,
  24756. error: 'Camera panning is not available in the current mode: ' + this.player.mode
  24757. })
  24758. var n = e.position,
  24759. r = this.player.control
  24760. r.setAutoPanPosition(n.x, n.z), (r.autoPan = !0)
  24761. var o = function (e, t) {
  24762. return '(' + e.toFixed(2) + ', ' + t.toFixed(2) + ')'
  24763. }
  24764. 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))
  24765. },
  24766. click: function (e, t) {
  24767. var i = e.x,
  24768. n = e.y
  24769. !0 === e.percentage && ((i = (i / 100) * $('#player').width()), (n = (n / 100) * $('#player').height())),
  24770. this.player.handleInputStart(i, n),
  24771. this.player.updateIntersect(),
  24772. this.player.handleInputEnd(i, n)
  24773. },
  24774. mouseOver: function (e, t) {
  24775. var i = e.x,
  24776. n = e.y
  24777. !0 === e.percentage && ((i = (i / 100) * $('#player').width()), (n = (n / 100) * $('#player').height())), this.player.handleInputMove(i, n), this.player.updateIntersect()
  24778. },
  24779. moveToMode: function (e, t) {
  24780. function i(e) {
  24781. t(
  24782. e
  24783. ? {
  24784. success: !1,
  24785. error: 'Failed to load new mode: ' + e
  24786. }
  24787. : {
  24788. success: !0,
  24789. message: 'Moved to new mode: ' + n
  24790. }
  24791. )
  24792. }
  24793. var n = e.mode
  24794. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN
  24795. ? this.director.changeMode(n).then(
  24796. function () {
  24797. i()
  24798. },
  24799. function (e) {
  24800. i(e)
  24801. }
  24802. )
  24803. : t({
  24804. success: !1,
  24805. error: 'Invalid mode selection'
  24806. })
  24807. }
  24808. }
  24809. }).call(this, '/js/sdk/automation.js')
  24810. },
  24811. {
  24812. '../constants': 8,
  24813. '../enum/AlignmentType': 17,
  24814. '../enum/ControlEvents': 21,
  24815. '../enum/Direction': 22,
  24816. '../enum/GLCubeFaces': 25,
  24817. '../enum/Keys': 30,
  24818. '../enum/ModelManagerEvents': 33,
  24819. '../enum/PlayerEvents': 40,
  24820. '../enum/RenderLayers': 41,
  24821. '../enum/Vectors': 50,
  24822. '../enum/Viewmode': 51,
  24823. '../enum/WarpStyle': 52,
  24824. '../lib/jpeg_encoder': 94,
  24825. '../sdk/SdkEvents': 161,
  24826. '../settings': 166,
  24827. '../util/common': 185,
  24828. '../util/logger': 189,
  24829. '../util/math': 190,
  24830. '../util/panorama': 191,
  24831. './ApiHost': 159,
  24832. './PostMessageType': 160,
  24833. './TransitionStyles': 162,
  24834. three: 217
  24835. }
  24836. ],
  24837. 165: [
  24838. function (e, t, i) {
  24839. 'use strict'
  24840. function n(e) {
  24841. ;(this.sourceWindow = e), (this.targetWindow = null), (this.targetOrigin = null), (this.id = Math.floor(1e5 * Math.random())), this.bindEvents()
  24842. }
  24843. var r = e('./PostMessageType'),
  24844. o = e('events').EventEmitter
  24845. ;((n.prototype = Object.create(o.prototype)).bindEvents = function () {
  24846. this.sourceWindow.addEventListener('message', this.onPostmessageReceived.bind(this))
  24847. }),
  24848. (n.prototype.setTarget = function (e, t) {
  24849. ;(this.targetWindow = e), (this.targetOrigin = t)
  24850. }),
  24851. (n.prototype.onPostmessageReceived = function (e) {
  24852. var t = e.origin || e.originalEvent.origin,
  24853. i = e.source
  24854. switch (e.data.type) {
  24855. case r.CONNECT:
  24856. break
  24857. case r.RESPONSE:
  24858. if (this.id !== e.data.toId) return
  24859. default:
  24860. if (!this.validateMessageOrigin(t)) return
  24861. }
  24862. var n = e.data
  24863. ;(n.source = i), (n.origin = t), (n.timestamp = Date.now()), this.emit(e.data.type, n)
  24864. }),
  24865. (n.prototype.validateMessageOrigin = function (e) {
  24866. return '*' === this.targetOrigin || e === this.targetOrigin
  24867. }),
  24868. (n.prototype.send = function (e) {
  24869. this.targetWindow && this.targetOrigin && ((e.fromId = this.id), this.targetWindow.postMessage(e, this.targetOrigin))
  24870. }),
  24871. (t.exports = n)
  24872. },
  24873. {
  24874. './PostMessageType': 160,
  24875. events: 202
  24876. }
  24877. ],
  24878. 166: [
  24879. function (e, t, i) {
  24880. 'use strict'
  24881. var n = e('three'),
  24882. r = e('./util/browser'),
  24883. o = e('./enum/Viewmode'),
  24884. a = e('./enum/VROption'),
  24885. s = e('./enum/Colors'),
  24886. l = e('./enum/WarpStyle'),
  24887. c = e('./util/easing'),
  24888. h = e('./util/common'),
  24889. u = e('./util/showcase'),
  24890. d = e('./constants'),
  24891. p = {
  24892. debug: !1,
  24893. version: '2.25.6-0-gd87e5b1',
  24894. languageTag: r.valueFromHash('lang', null),
  24895. pageTitle: '四维虚拟漫游',
  24896. authorizationHeader: u.getAuthorizationHeader(),
  24897. autoplay: r.valueFromHash('play', !1) || !r.inIframe(),
  24898. logLevel: r.valueFromHash('log', 2),
  24899. skyboxRadius: 2500,
  24900. modelBoundsPadding: 5,
  24901. showNeighbors: !1,
  24902. brand: r.valueFromHash('brand', !0),
  24903. showHighlights: r.valueFromHash('hhl', !0) && r.valueFromHash('hr', 1),
  24904. startHighlights: r.valueFromHash('hl', -1),
  24905. specialEdition: r.valueFromHash('bn', 0),
  24906. useWheel: r.valueFromHash('wh', !0),
  24907. crossOrigin: 'anonymous',
  24908. fancierTransition: !1,
  24909. wireframe: !1,
  24910. skyboxWireframe: !1,
  24911. modelAlpha: 1,
  24912. highlightPanoSelection: !1,
  24913. showSweeps: !0,
  24914. showSkyboxes: !1,
  24915. showMesh: !0,
  24916. showFloors: !1,
  24917. showFloorDuration: 300,
  24918. showFloorDelay: 300,
  24919. hideFloorDuration: 300,
  24920. hideFloorDelay: 0,
  24921. reticuleOpacityTransitionTime: 250,
  24922. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue,
  24923. markerOpacityTransitionTime: 500,
  24924. guiAnimationSpeed: 250,
  24925. highlightAnimationDuration: 500,
  24926. modelComponentLoadSpinnerDelay: 150,
  24927. captureErrors: !1,
  24928. maxMobileTextures: 6,
  24929. minimalMemoryMode: r.valueFromHash('m3', r.isMobile()),
  24930. startupFlyinDelay: 3e3,
  24931. dollhouseDefault: {
  24932. minDistance: 1, //15, //编辑页面给近一些
  24933. maxDistance: 50,
  24934. minPolarAngle: n.Math.degToRad(10),
  24935. maxPolarAngle: n.Math.degToRad(90)
  24936. },
  24937. hideReticuleTimeout: 1e3,
  24938. analytics: {
  24939. inactivityThreshold: 30,
  24940. sessionTrackingRate: 0.15,
  24941. maxTrackedErrors: 20,
  24942. sessionDurationPingFrequency: 10,
  24943. sessionDurationTimeout: 15
  24944. },
  24945. flydown: {
  24946. movementEasing: 'easeInOutQuad',
  24947. movementDelay: 0.001,
  24948. rotationEasing: 'easeInOutQuad',
  24949. rotationDelay: 0.5,
  24950. modelTextureDelay: 0.75,
  24951. skyboxDelay: 0.75
  24952. },
  24953. transition: {
  24954. flySpeed: 0.001,
  24955. flyTime: 750,
  24956. flytimeMaxDistanceThreshold: 5,
  24957. flytimeDistanceMultiplier: 150,
  24958. aimTime: 1500,
  24959. aimSlowFactor: 1.5,
  24960. blur: 0.8,
  24961. movementEasing: 'easeInOutQuad',
  24962. blendEasing: 'easeInOutQuad',
  24963. fastForwardFactor: 4
  24964. },
  24965. show360Views: {
  24966. enabled: !0,
  24967. transitionTime: 1e3
  24968. },
  24969. quickstart: {
  24970. enabled: 1 === r.valueFromHash('qust', 0) || 1 === r.valueFromHash('qs', 0),
  24971. animation: 1400,
  24972. showTextDelay: 500,
  24973. fadeOutDelay: 3e3,
  24974. fovChange: 10
  24975. },
  24976. appConfig: {
  24977. webvr_version: null,
  24978. segment_key: null,
  24979. embedly_key: null,
  24980. branch_key: null,
  24981. keen_write_key: null,
  24982. keen_project_id: null
  24983. },
  24984. vr: {
  24985. enabled: !0,
  24986. allowWebVR: !1,
  24987. option: r.valueFromHash('vr', a.CONTEXTUAL)
  24988. },
  24989. share: {
  24990. enabled: !r.valueFromHash('mls', 0) && r.valueFromHash('brand', !0)
  24991. },
  24992. input: {
  24993. longTapThreshold: 200,
  24994. moveToleranceNDC: 0.01, //.08,
  24995. touchMoveThreshold: 25
  24996. },
  24997. help: {
  24998. modalStayDuration: 600
  24999. },
  25000. immersive: {
  25001. timeToShowAgain: 1250,
  25002. uiStayDuration: 600
  25003. },
  25004. tourInteraction: {
  25005. disabled: '0' === r.valueFromHash('tourcta', null),
  25006. showPauseButton: 1e3,
  25007. showModal: 1500,
  25008. allowNextClick: 200,
  25009. largeModal: '1' === r.valueFromHash('tourcta', null),
  25010. smallModal: '2' === r.valueFromHash('tourcta', null)
  25011. },
  25012. labels: {
  25013. enabled: !1,
  25014. hideUntilStart: !0,
  25015. fadeInDuration: 250,
  25016. fadeInDelay: 250,
  25017. fadeOutDuration: 250,
  25018. fadeOutDelay: 0,
  25019. zoomHideThreshhold: {
  25020. mobile: r.isSmallScreen() ? 0.45 : 0.6,
  25021. desktop: 2
  25022. },
  25023. zoomTruncateThreshhold: {
  25024. mobile: r.isSmallScreen() ? 0.35 : 0.45,
  25025. desktop: 0.85
  25026. },
  25027. minLengthForTruncate: 16,
  25028. truncateLength: 12,
  25029. truncateSuffix: '...'
  25030. },
  25031. tags: {
  25032. enabled: r.valueFromHash('mt', 1),
  25033. startup: {
  25034. hideUntilStart: !0,
  25035. fadeInDuration: 500,
  25036. fadeInDelay: 100
  25037. },
  25038. visibility: {
  25039. anyDistance: !0,
  25040. visibleDistance: 8,
  25041. cameraClearance: 0.1,
  25042. alphaTestLevel: 0.05,
  25043. hideViaFloor: !0,
  25044. hideOffScreenDisc: !1,
  25045. hideOffScreenObject: !1
  25046. },
  25047. disc: {
  25048. opacity: 1,
  25049. disabledOpacity: 0.5,
  25050. scale: {
  25051. nearBound: 1.5,
  25052. farBound: 4.8,
  25053. linkFarBound: !1,
  25054. linkPercent: 40,
  25055. maxSize: 80,
  25056. minSize: 40,
  25057. baseViewportSize: 800,
  25058. responsiveness: 100
  25059. }
  25060. },
  25061. pole: {
  25062. enabled: !0,
  25063. height: 0.5,
  25064. width: 2,
  25065. opacity: 0.5,
  25066. color: 'white'
  25067. },
  25068. navigate: {
  25069. nearestPano: !0,
  25070. lineOfSight: !0,
  25071. reactivate: !0,
  25072. aimAt: 'disc',
  25073. tiltTolerance: 25,
  25074. rotateSpeedFactor: 0.6
  25075. }
  25076. },
  25077. path: {
  25078. color: window.DATA.floorMarkerColor || s.newBlue,
  25079. colorUp: s._desat(s.newBlue, 0.5),
  25080. colorDown: s._darken(s.newBlue, 0.35),
  25081. opacity: 0.5,
  25082. style: 'ribbon',
  25083. height: 0.025,
  25084. ribbonWidth: 0.24,
  25085. outsideHeight: 0.5,
  25086. waypointRadius: 0.5,
  25087. waypointIndoorRadius: 0.24,
  25088. waypointPulse: 1e3,
  25089. typ: l.BLACK,
  25090. meshFree: r.valueFromHash('mf', 1),
  25091. mapGuides: r.valueFromHash('guides', !0),
  25092. fadeInTime: 400,
  25093. fadeOutTime: 300
  25094. },
  25095. warp: {
  25096. nearPanoDist: 0.1,
  25097. matchCam: !1,
  25098. blur: 0.33,
  25099. fastTime: 1500,
  25100. teleportTime: 1500, //瞬间过渡的时间
  25101. flytimeDistanceMultiplier: 150, //add
  25102. flyTime: 750, //add
  25103. outsideTime: 2e3,
  25104. lookAheadMax: 0.3,
  25105. lookAheadDist: 2.5,
  25106. softPushDist: 0.37,
  25107. softPushEnd: 0.3,
  25108. softBendAngle: 8,
  25109. softBendTilt: 4,
  25110. softBendEnd: 0.3,
  25111. doBurns: !0,
  25112. burnsAngle: 8,
  25113. minBurnsAngle: 35,
  25114. minDownAngle: -35,
  25115. maxTurnPerSec: 280,
  25116. maxAimPerSec: 35,
  25117. minRotation: 12,
  25118. maxAimRotation: 33.2,
  25119. turnFriction: 0.2,
  25120. flySpeed: 0.01,
  25121. minWarpTime: 1200,
  25122. warpInterruptionRedirectTime: 500,
  25123. tourStepDelay: r.valueFromHash('st', 0),
  25124. walkDelay: 0,
  25125. walkMaxDist: 50,
  25126. walkMinDist: 0.8,
  25127. walkSlideShowThreshhold: 3e3,
  25128. walkExtraPanosDistance: 0.4,
  25129. timePerMeter: 1200,
  25130. motionLeadTime: 5e3,
  25131. movementEasing: 'easeInOutQuad',
  25132. blendEasing: 'easeInOutQuad',
  25133. showBunny: !1,
  25134. loop: r.valueFromHash('lp', !1),
  25135. auto: r.valueFromHash('ts', -1),
  25136. eOrder: 'YXZ',
  25137. stepFactor: 0.25,
  25138. brakeStrength: 2,
  25139. minBrakeAngle: 0.1,
  25140. maxBrakeAngle: 1.8,
  25141. climbEffort: 4
  25142. },
  25143. rotationFriction: 0.05,
  25144. rotationAccelerationInside: 4.5,
  25145. rotationAccelerationOutside: 0.15,
  25146. rotationAfterMoveMultiplier: 40,
  25147. rotationAfterMoveHistoryCount: 5,
  25148. panFriction: 0.09,
  25149. panAccelerationOutside: 60,
  25150. onload: r.valueFromHash('onload', o.PANORAMA),
  25151. zoomNearLimit: 0.1,
  25152. zoomFarLimit: 50,
  25153. navigation: {
  25154. panoScores: !1,
  25155. mouseDirection: !0,
  25156. filterStrictness: 0.75,
  25157. angleFactor: -30,
  25158. directionFactor: 10,
  25159. distanceFactor: -1,
  25160. optionalityFactor: 3
  25161. },
  25162. sdkInit: !1,
  25163. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  25164. console: r.valueFromHash('console', !1),
  25165. noMeshFloorPositionOffset: new n.Vector3(0, -1.2, 0),
  25166. panoramaNeighbourMaxDistance: 5,
  25167. panoFloorClickRadius: 0.35,
  25168. showScreenshotLocations: !1,
  25169. showAxis: !1,
  25170. showNeighbourRaycasts: !1,
  25171. colorMarkerOnLoad: !1,
  25172. colorMarkerByFloor: !1,
  25173. tiling: {
  25174. panoPreRenderRepeatDelay: 2500,
  25175. panoPreRenderDelay: 500,
  25176. preRenderTourPanos: r.valueFromHash('tileprerender', 0),
  25177. tilingFlagNames: ['usetiles', 'tiles'],
  25178. maxNavPanoQuality: r.valueFromHash('maxtileq', null),
  25179. maxZoomPanoQuality: r.valueFromHash('maxztileq', null),
  25180. overlayStyle: r.valueFromHash('tileoverlay', 0),
  25181. uploadIntervalDelay: r.valueFromHash('tileupdelay', 10),
  25182. initialIntervalDelay: r.valueFromHash('itiledelay', 0),
  25183. maxNonBaseUploadsPerFrame: r.valueFromHash('maxnbtpf', 2),
  25184. maxBaseUploadsPerFrame: r.valueFromHash('maxbtpf', 6),
  25185. customCompression: r.valueFromHash('tilecustcomp', 0),
  25186. mobileHighQualityOverride: 1,
  25187. allowUltraHighResolution: !0
  25188. },
  25189. zoom: {
  25190. enabled: !0,
  25191. forceOff: r.valueFromHash('nozoom', 0),
  25192. overridemax: r.valueFromHash('maxzoom', null),
  25193. overridemin: r.valueFromHash('minzoom', null),
  25194. max: d.highQualityMaxZoom,
  25195. min: 1,
  25196. transitionStyle: r.valueFromHash('zoomtrans', 1),
  25197. activationThreshold: 1.1,
  25198. restoreTime: 500
  25199. },
  25200. profiling: {
  25201. enabled: r.valueFromHash('mem', !1)
  25202. }
  25203. }
  25204. ;(p = h.deepExtend(p, d, {
  25205. insideFOV: r.valueFromHash('fov', d.insideFOV),
  25206. insideFOVMax: r.valueFromHash('fovmax', d.insideFOVMax),
  25207. panorama: {
  25208. transitionTime: 1e3,
  25209. modelAlpha: 0,
  25210. modelAlphaDelay: p.flydown.modelTextureDelay,
  25211. modelAlphaLength: 1,
  25212. skyboxOpacity: 1,
  25213. skyboxOpacityDelay: p.flydown.skyboxDelay,
  25214. skyboxOpacityLength: 0.9,
  25215. fovLength: 1,
  25216. fovDelay: 0,
  25217. cameraMatrixDuration: 0.8,
  25218. cameraMatrixDelay: 0,
  25219. cameraMatrixEase: c.easeInCubic,
  25220. reticuleOpacity: 1,
  25221. markerOpacity: 0.3,
  25222. markerOpacityOnHover: 1
  25223. },
  25224. dollhouse: {
  25225. transitionTime: 1e3,
  25226. modelAlpha: 1,
  25227. modelAlphaDelay: 0,
  25228. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25229. skyboxOpacity: 0,
  25230. skyboxOpacityDelay: 0,
  25231. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25232. fovLength: 1,
  25233. fovDelay: 0,
  25234. cameraMatrixDuration: 0.8,
  25235. cameraMatrixDelay: 0.3,
  25236. cameraMatrixEase: c.easeInCubic,
  25237. reticuleOpacity: 1,
  25238. markerOpacity: 0,
  25239. markerOpacityOnHover: 0
  25240. },
  25241. floorplan: {
  25242. transitionTime: 1e3,
  25243. modelAlpha: 1,
  25244. modelAlphaDelay: 0,
  25245. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25246. skyboxOpacity: 0,
  25247. skyboxOpacityDelay: 0,
  25248. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25249. fovLength: 1,
  25250. fovDelay: 0,
  25251. cameraMatrixDuration: 0.5,
  25252. cameraMatrixDelay: 0,
  25253. cameraMatrixEase: c.easeOutCubic,
  25254. reticuleOpacity: 1,
  25255. markerOpacity: 0,
  25256. markerOpacityOnHover: 0,
  25257. cameraHeight: 50
  25258. },
  25259. transitioning: {
  25260. reticuleOpacity: 0,
  25261. markerOpacity: 0.3,
  25262. markerOpacityOnHover: 1
  25263. },
  25264. 'floorplan-dollhouse': {
  25265. rotationDelay: 0,
  25266. rotationDuration: 1
  25267. },
  25268. 'floorplan-panorama': {
  25269. rotationDelay: 0.5,
  25270. rotationDuration: 1
  25271. },
  25272. 'dollhouse-panorama': {
  25273. rotationDelay: 0.5,
  25274. rotationDuration: 1
  25275. },
  25276. 'dollhouse-floorplan': {
  25277. rotationDelay: 0,
  25278. rotationDuration: 1,
  25279. cameraMatrixDuration: 1.05,
  25280. cameraMatrixDelay: 0.5
  25281. },
  25282. 'panorama-dollhouse': {
  25283. rotationDelay: 0,
  25284. rotationDuration: 0.5
  25285. },
  25286. 'panorama-floorplan': {
  25287. transitionTime: 1500,
  25288. rotationDelay: 0,
  25289. rotationDuration: 0.5
  25290. }
  25291. })).path.meshFree && (p.path.typ = l.WALK),
  25292. (p.zoom.max = p.zoom.overridemax || p.zoom.max),
  25293. (p.zoom.min = p.zoom.overridemin || p.zoom.min),
  25294. (window._settings = t.exports = p)
  25295. },
  25296. {
  25297. './constants': 8,
  25298. './enum/Colors': 19,
  25299. './enum/VROption': 47,
  25300. './enum/Viewmode': 51,
  25301. './enum/WarpStyle': 52,
  25302. './util/browser': 182,
  25303. './util/common': 185,
  25304. './util/easing': 186,
  25305. './util/showcase': 193,
  25306. three: 217
  25307. }
  25308. ],
  25309. 167: [
  25310. function (e, t, i) {
  25311. 'use strict'
  25312. var n = e('three'),
  25313. r = e('./settings'),
  25314. o =
  25315. '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',
  25316. a = 'precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n'
  25317. t.exports = {
  25318. basicTextured: {
  25319. uniforms: {
  25320. tDiffuse: {
  25321. type: 't',
  25322. value: null
  25323. },
  25324. alpha: {
  25325. type: 'f',
  25326. value: 1
  25327. }
  25328. },
  25329. vertexShader: 'varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  25330. fragmentShader:
  25331. '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}'
  25332. },
  25333. copyCubeMap: {
  25334. uniforms: {
  25335. tDiffuse: {
  25336. type: 't',
  25337. value: null
  25338. },
  25339. alpha: {
  25340. type: 'f',
  25341. value: 1
  25342. }
  25343. },
  25344. vertexShader:
  25345. 'varying vec3 vWorldPos;\nvoid main() {\n vWorldPos = vec3(-position.x, -position.y, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  25346. fragmentShader:
  25347. '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}'
  25348. },
  25349. cube: {
  25350. uniforms: {
  25351. map: {
  25352. type: 't',
  25353. value: null
  25354. },
  25355. opacity: {
  25356. type: 'f',
  25357. value: 1
  25358. }
  25359. },
  25360. vertexShader: o + 'varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n',
  25361. fragmentShader:
  25362. a +
  25363. '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'
  25364. },
  25365. model: {
  25366. uniforms: {
  25367. map: {
  25368. type: 't',
  25369. value: null
  25370. },
  25371. modelAlpha: {
  25372. type: 'f',
  25373. value: r.modelAlpha
  25374. },
  25375. opacity: {
  25376. type: 'f',
  25377. value: 1
  25378. },
  25379. progress: {
  25380. type: 'f',
  25381. value: 0
  25382. },
  25383. blackout: {
  25384. type: 'i',
  25385. value: 0
  25386. },
  25387. pano0Map: {
  25388. type: 't',
  25389. value: null
  25390. },
  25391. pano0Position: {
  25392. type: 'v3',
  25393. value: new n.Vector3()
  25394. },
  25395. pano0Matrix: {
  25396. type: 'm4',
  25397. value: new n.Matrix4()
  25398. },
  25399. pano1Map: {
  25400. type: 't',
  25401. value: null
  25402. },
  25403. pano1Position: {
  25404. type: 'v3',
  25405. value: new n.Vector3()
  25406. },
  25407. pano1Matrix: {
  25408. type: 'm4',
  25409. value: new n.Matrix4()
  25410. }
  25411. },
  25412. /* 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",
  25413. 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"
  25414. */
  25415. vertexShader:
  25416. o +
  25417. `uniform vec3 pano0Position;
  25418. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  25419. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  25420. varying vec3 vWorldPosition0;
  25421. varying vec3 vWorldPosition1;
  25422. uniform int blackout;
  25423. void main() {
  25424. vUv = uv;
  25425. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  25426. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  25427. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  25428. vWorldPosition0.x *= -1.0;
  25429. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  25430. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  25431. vWorldPosition1.x *= -1.0;
  25432. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  25433. }`,
  25434. fragmentShader:
  25435. a +
  25436. `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  25437. 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
  25438. void main() {
  25439. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  25440. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  25441. vec4 colorFromPanos;
  25442. if (blackout == 5){//add for TransitionPass
  25443. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  25444. }else{
  25445. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  25446. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  25447. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  25448. else if (blackout == 1) {
  25449. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  25450. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  25451. }
  25452. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  25453. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  25454. }
  25455. vec4 colorFromTexture = texture2D( map, vUv );
  25456. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  25457. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  25458. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  25459. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  25460. }`
  25461. },
  25462. hot: {
  25463. uniforms: {
  25464. color: {
  25465. type: 'c',
  25466. value: new n.Color(16720384)
  25467. },
  25468. opac: {
  25469. type: 'f',
  25470. value: 0
  25471. },
  25472. texture1: {
  25473. type: 't',
  25474. value: null
  25475. },
  25476. texture2: {
  25477. type: 't',
  25478. value: null
  25479. }
  25480. },
  25481. vertexShader: 'varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n',
  25482. fragmentShader:
  25483. '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'
  25484. },
  25485. modelOutside: {
  25486. uniforms: {
  25487. map: {
  25488. type: 't',
  25489. value: null
  25490. },
  25491. opacity: {
  25492. type: 'f',
  25493. value: 1
  25494. }
  25495. },
  25496. vertexShader: o + 'varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n',
  25497. fragmentShader:
  25498. a +
  25499. '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'
  25500. },
  25501. ribbon: {
  25502. uniforms: {
  25503. map: {
  25504. type: 't',
  25505. value: null
  25506. },
  25507. opacity: {
  25508. type: 'f',
  25509. value: 1
  25510. },
  25511. color: {
  25512. type: 'c',
  25513. value: new n.Color(r.path.color)
  25514. }
  25515. },
  25516. vertexShader:
  25517. o +
  25518. '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',
  25519. fragmentShader:
  25520. a +
  25521. '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'
  25522. },
  25523. waypoint: {
  25524. uniforms: {
  25525. map: {
  25526. type: 't',
  25527. value: null
  25528. },
  25529. opacity: {
  25530. type: 'f',
  25531. value: 1
  25532. },
  25533. pulse: {
  25534. type: 'f',
  25535. value: 1
  25536. },
  25537. nearFade: {
  25538. type: 'v2',
  25539. value: new n.Vector2(2 * r.insideNear, 2 * r.path.waypointIndoorRadius)
  25540. },
  25541. color: {
  25542. type: 'c',
  25543. value: new n.Color(r.reticuleColor)
  25544. }
  25545. },
  25546. vertexShader:
  25547. o +
  25548. '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',
  25549. fragmentShader:
  25550. a +
  25551. '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'
  25552. },
  25553. modelDebug: {
  25554. uniforms: {
  25555. map: {
  25556. type: 't',
  25557. value: null
  25558. },
  25559. modelAlpha: {
  25560. type: 'f',
  25561. value: r.modelAlpha
  25562. },
  25563. depthmapRatio: {
  25564. type: 'f',
  25565. value: 0
  25566. },
  25567. opacity: {
  25568. type: 'f',
  25569. value: 1
  25570. },
  25571. progress: {
  25572. type: 'f',
  25573. value: 0
  25574. },
  25575. considerOcclusion: {
  25576. type: 'i',
  25577. value: r.fancierTransition
  25578. },
  25579. highlightPanoSelection: {
  25580. type: 'i',
  25581. value: 0
  25582. },
  25583. useThirdPano: {
  25584. type: 'i',
  25585. value: r.useThirdPano
  25586. },
  25587. pano0Map: {
  25588. type: 't',
  25589. value: null
  25590. },
  25591. pano0Depth: {
  25592. type: 't',
  25593. value: null
  25594. },
  25595. pano0Position: {
  25596. type: 'v3',
  25597. value: new n.Vector3()
  25598. },
  25599. pano0Matrix: {
  25600. type: 'm4',
  25601. value: new n.Matrix4()
  25602. },
  25603. pano0Weight: {
  25604. type: 'f',
  25605. value: r.transition.pano0Weight
  25606. },
  25607. pano1Map: {
  25608. type: 't',
  25609. value: null
  25610. },
  25611. pano1Depth: {
  25612. type: 't',
  25613. value: null
  25614. },
  25615. pano1Position: {
  25616. type: 'v3',
  25617. value: new n.Vector3()
  25618. },
  25619. pano1Matrix: {
  25620. type: 'm4',
  25621. value: new n.Matrix4()
  25622. },
  25623. pano1Weight: {
  25624. type: 'f',
  25625. value: r.transition.pano1Weight
  25626. },
  25627. pano2Map: {
  25628. type: 't',
  25629. value: null
  25630. },
  25631. pano2Depth: {
  25632. type: 't',
  25633. value: null
  25634. },
  25635. pano2Position: {
  25636. type: 'v3',
  25637. value: new n.Vector3()
  25638. },
  25639. pano2Matrix: {
  25640. type: 'm4',
  25641. value: new n.Matrix4()
  25642. },
  25643. pano2Weight: {
  25644. type: 'f',
  25645. value: r.transition.pano2Weight
  25646. }
  25647. },
  25648. vertexShader:
  25649. o +
  25650. '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',
  25651. fragmentShader:
  25652. a +
  25653. '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'
  25654. },
  25655. customDepth: {
  25656. uniforms: {
  25657. panoPosition: {
  25658. type: 'v3',
  25659. value: new n.Vector3()
  25660. }
  25661. },
  25662. vertexShader:
  25663. o +
  25664. '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',
  25665. fragmentShader:
  25666. a +
  25667. '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'
  25668. },
  25669. skysphere: {
  25670. uniforms: {
  25671. radius: {
  25672. type: 'f',
  25673. value: 0
  25674. }
  25675. },
  25676. vertexShader:
  25677. o +
  25678. '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',
  25679. fragmentShader:
  25680. a +
  25681. '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'
  25682. },
  25683. tagDisc: {
  25684. uniforms: {
  25685. opacity: {
  25686. type: 'f',
  25687. value: 0
  25688. },
  25689. color: {
  25690. type: 'c',
  25691. value: new n.Color()
  25692. },
  25693. bg: {
  25694. type: 't',
  25695. value: null
  25696. },
  25697. mask: {
  25698. type: 't',
  25699. value: null
  25700. }
  25701. },
  25702. vertexShader: o + 'varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  25703. fragmentShader:
  25704. a +
  25705. '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'
  25706. }
  25707. }
  25708. window.shaders = t.exports
  25709. },
  25710. {
  25711. './settings': 166,
  25712. three: 217
  25713. }
  25714. ],
  25715. 168: [
  25716. function (E, _, e) {
  25717. ;(function (e) {
  25718. 'use strict'
  25719. var t = E('three'),
  25720. i = (E('url'), E('./util/ajax')),
  25721. n = E('./settings'),
  25722. r = E('./util/logger'),
  25723. o = E('./util/math'),
  25724. a = E('./util/showcase'),
  25725. s = E('./objects/Panorama'),
  25726. l = new r(e),
  25727. c = E('./model/Model'),
  25728. h = E('./shaders'),
  25729. u = E('./util/transitions'),
  25730. d = E('./objects/Chunk'),
  25731. p = E('./objects/Reticule'),
  25732. f = E('./objects/Skybox'),
  25733. g = E('./objects/Floor'),
  25734. m = E('./cameras/DollhouseCamera'),
  25735. v = E('./cameras/FloorplanCamera'),
  25736. y = E('./cameras/PanoramaCamera'),
  25737. A = E('./controls/DollhouseControls'),
  25738. C = E('./controls/FloorplanControls'),
  25739. I = E('./controls/PanoramaControls')
  25740. ;(t.ImageUtils.crossOrigin = n.crossOrigin),
  25741. (_.exports = {
  25742. shaders: h,
  25743. transitions: u,
  25744. Model: c,
  25745. Chunk: d,
  25746. Floor: g,
  25747. Skybox: f,
  25748. Reticule: p,
  25749. Panorama: s,
  25750. DollhouseCamera: m,
  25751. FloorplanCamera: v,
  25752. PanoramaCamera: y,
  25753. DollhouseControls: A,
  25754. FloorplanControls: C,
  25755. PanoramaControls: I,
  25756. getModel: function (e) {
  25757. if (!e.url) throw 'getModel(): missing parameter "url"'
  25758. e.autoload = void 0 === e.autoload || e.autoload
  25759. var t = a.parseSidUrl(e.url)
  25760. ;(e.urlBase = t.urlBase), (e.urlModel = /* 'data/1081/', */ t.urlModel), (e.urlFiles = t.urlFiles)
  25761. var i = this._getPlatformError()
  25762. return i ? $.Deferred().reject(i).promise() : ((this.options = e), this._loadModel().then(this._buildModel.bind(this)))
  25763. },
  25764. _getPlatformError: function () {
  25765. return 'IE' === $.ua.browser.name && parseInt($.ua.browser.major) < 11
  25766. ? 'webgl-unsupported'
  25767. : 'iOS' === $.ua.os.name && /^[0-7][$\.]/.test($.ua.os.version)
  25768. ? 'webgl-ios'
  25769. : Modernizr.webgl
  25770. ? null
  25771. : 'webgl-unsupported'
  25772. },
  25773. _loadModel: function () {
  25774. return i
  25775. .get(this.options.urlModel, {
  25776. responseType: 'json',
  25777. prefetchFrom: 'model',
  25778. auth: a.getAuthorizationHeader()
  25779. })
  25780. .then(null, function () {
  25781. return l.warn('Model loading failed at initial metadata load'), 'loading-failed'
  25782. })
  25783. },
  25784. _buildModel: function (e) {
  25785. e = a.normalizeModeldata(e, o)
  25786. var t = new c(this.options, e)
  25787. return this.options.autoload ? t.load(!0) : $.when(t)
  25788. }
  25789. })
  25790. }).call(this, '/js/showcase.js')
  25791. },
  25792. {
  25793. './cameras/DollhouseCamera': 5,
  25794. './cameras/FloorplanCamera': 6,
  25795. './cameras/PanoramaCamera': 7,
  25796. './controls/DollhouseControls': 10,
  25797. './controls/FloorplanControls': 11,
  25798. './controls/PanoramaControls': 13,
  25799. './model/Model': 139,
  25800. './objects/Chunk': 144,
  25801. './objects/Floor': 146,
  25802. './objects/Panorama': 148,
  25803. './objects/Reticule': 149,
  25804. './objects/Skybox': 152,
  25805. './settings': 166,
  25806. './shaders': 167,
  25807. './util/ajax': 181,
  25808. './util/logger': 189,
  25809. './util/math': 190,
  25810. './util/showcase': 193,
  25811. './util/transitions': 195,
  25812. three: 217,
  25813. url: 208
  25814. }
  25815. ],
  25816. 169: [
  25817. function (e, t, i) {
  25818. 'use strict'
  25819. function l(e) {
  25820. var t = {
  25821. renderTarget: null,
  25822. inUse: !1,
  25823. size: -1,
  25824. pano: null
  25825. }
  25826. return (
  25827. (t.inUse = !0),
  25828. (t.size = e),
  25829. (function (e) {
  25830. O.push(e)
  25831. })(t),
  25832. t
  25833. )
  25834. }
  25835. function c(e) {
  25836. for (var t = 0; t < O.length; t++) {
  25837. var i = O[t]
  25838. if (i.renderTarget === e) return !(i.inUse = !1)
  25839. }
  25840. return !1
  25841. }
  25842. function n() {
  25843. ;(this.tileDirectory = {}),
  25844. (this.activeRenderTargetDescriptors = {}),
  25845. (this.activePanos = []),
  25846. (this.panoLODDescriptors = {}),
  25847. (this.panoDescriptors = {}),
  25848. (this.tileTrees = {}),
  25849. (this.sceneRenderer = null),
  25850. (this.tileDownloader = null),
  25851. (this.forceQueue = []),
  25852. (this.uploadQueues = {}),
  25853. (this.uploadInterval = null),
  25854. (this.uploadIntervalCancelled = !1),
  25855. (this.usingTileOverlay = !1),
  25856. (this.overlayTilesLoaded = !1),
  25857. (this.overlayTileBase = null),
  25858. (this.overlayTilesBasic = {}),
  25859. (this.overlayTilesEnhanced = {}),
  25860. (this.zoomRenderTarget = null),
  25861. (this.zoomPano = null),
  25862. (this.zoomingActive = !1),
  25863. (this.zoomPanoId = null),
  25864. (this.zoomPanoRenderingDisabled = !1),
  25865. (this.direction = new _.Vector3()),
  25866. (this.initTime = -1),
  25867. (this.maxBaseUploadsPerFrame = R),
  25868. (this.maxNonBaseUploadsPerFrame = M)
  25869. }
  25870. var I,
  25871. E,
  25872. r,
  25873. o,
  25874. a,
  25875. h,
  25876. s,
  25877. _ = e('three'),
  25878. u = e('../exception/BasicException'),
  25879. d = e('../settings'),
  25880. p = e('../enum/PanoSizeClass'),
  25881. b = (e('../objects/Panorama'), e('../enum/PanoRendererEvents')),
  25882. f = e('../enum/SceneRendererEvents'),
  25883. g = e('../enum/TileDownloaderEvents'),
  25884. m = e('../enum/Vectors'),
  25885. v = (e('../enum/GLCubeFaces'), e('../objects/Panorama'), e('./TileTree')),
  25886. y = (e('./TileDownloader'), e('./TilePrioritizer')),
  25887. A = e('./TileUtils'),
  25888. C = ((p = e('../enum/PanoSizeClass')), e('../util/browser'), e('../util/panorama')),
  25889. w = e('events').EventEmitter,
  25890. T = !1,
  25891. x = d.tiling.uploadIntervalDelay,
  25892. S = d.tiling.initialIntervalDelay,
  25893. M = d.tiling.maxNonBaseUploadsPerFrame,
  25894. R = d.tiling.maxBaseUploadsPerFrame,
  25895. P = {
  25896. Base: 0,
  25897. Remaining: 1
  25898. },
  25899. O = []
  25900. function L(e) {
  25901. var t = e.shift()
  25902. return (t.uploadQueued = !1), t
  25903. }
  25904. ;((n.prototype = Object.create(w.prototype)).init = function (e, t, i) {
  25905. ;(this.sceneRenderer = e),
  25906. (this.tileDownloader = t),
  25907. (this.qualityManager = i),
  25908. this.bindEvents(),
  25909. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  25910. (this.initTime = performance.now())
  25911. }),
  25912. (n.prototype.getActivePanoTextures = function (e) {
  25913. e = e || []
  25914. for (var t = 0; t < O.length; t++) {
  25915. var i = O[t]
  25916. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25917. }
  25918. }),
  25919. (n.prototype.hasQueuedTiles = function () {
  25920. var e = this.peekNextFromUploadQueue()
  25921. return null != e
  25922. }),
  25923. (n.prototype.getActiveRenderTargetDescriptor = function (e) {
  25924. return this.activeRenderTargetDescriptors[e]
  25925. }),
  25926. (n.prototype.setActiveRenderTargetDescriptor = function (e, t) {
  25927. this.activeRenderTargetDescriptors[e] = t
  25928. }),
  25929. (n.prototype.loadOverlayTiles = function () {
  25930. if (0 !== d.tiling.overlayStyle) {
  25931. var n = 0,
  25932. e = function (e, t, i) {
  25933. ;(e = t
  25934. ? (e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping))
  25935. : (this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping))),
  25936. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25937. ++n === r.length && (this.overlayTilesLoaded = !0)
  25938. }.bind(this),
  25939. r = [
  25940. ['images/outlineBase.png', e.bind(this, this.overlayTileBase, null)],
  25941. ['images/outlineBasic512.png', e.bind(this, this.overlayTilesBasic, 256)],
  25942. ['images/outlineBasic512.png', e.bind(this, this.overlayTilesBasic, 512)],
  25943. ['images/outlineBasic1024.png', e.bind(this, this.overlayTilesBasic, 1024)],
  25944. ['images/outlineBasic2048.png', e.bind(this, this.overlayTilesBasic, 2048)],
  25945. ['images/outlineBasic4096.png', e.bind(this, this.overlayTilesBasic, 4096)],
  25946. ['images/outlineEnhanced512.png', e.bind(this, this.overlayTilesEnhanced, 256)],
  25947. ['images/outlineEnhanced512.png', e.bind(this, this.overlayTilesEnhanced, 512)],
  25948. ['images/outlineEnhanced1024.png', e.bind(this, this.overlayTilesEnhanced, 1024)],
  25949. ['images/outlineEnhanced2048.png', e.bind(this, this.overlayTilesEnhanced, 2048)],
  25950. ['images/outlineEnhanced4096.png', e.bind(this, this.overlayTilesEnhanced, 4096)]
  25951. ]
  25952. r.forEach(
  25953. function (e) {
  25954. this.tileDownloader.loadImage(e[0], 0, e[1])
  25955. }.bind(this)
  25956. ),
  25957. (this.usingTileOverlay = !0)
  25958. } else this.usingTileOverlay = !1
  25959. }),
  25960. (n.prototype.bindEvents = function () {
  25961. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25962. }),
  25963. (n.prototype.setupZoomRenderTarget = function () {
  25964. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25965. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize()) return
  25966. var e = this.zoomRenderTarget
  25967. if (((this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1)), e)) {
  25968. var t = e.width,
  25969. i = this.zoomRenderTarget.width
  25970. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25971. e.texture.dispose(),
  25972. (e.texture.loaded = !1),
  25973. (e.texture.version = 0),
  25974. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25975. (e.texture = null)
  25976. }
  25977. this.zoomPanoRenderingDisabled = !1
  25978. } else this.zoomPanoRenderingDisabled = !0
  25979. }),
  25980. (n.prototype.enableUltraHighQualityMode = function (t) {
  25981. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25982. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH)
  25983. this.tileDownloader.testDownload(
  25984. e,
  25985. A.TILE_SIZE,
  25986. function (e) {
  25987. e && (this.qualityManager.enableUltraHighQualityMode(), this.setupZoomRenderTarget(), t())
  25988. }.bind(this)
  25989. )
  25990. }
  25991. }),
  25992. (n.prototype.activateTiledPano = function (e, t, i) {
  25993. i && this.clearAllQueuedUploads()
  25994. for (var n = 0; n < A.FACES_PER_PANO; n++) this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize())
  25995. this.linkAllTilesAndNodes(e)
  25996. var r = this.getActiveRenderTargetDescriptor(e.id),
  25997. o = t
  25998. if ((o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()), !r || o !== r.size)) {
  25999. if (
  26000. (r && c(r.renderTarget),
  26001. !(r = (function (e) {
  26002. for (var t = 0; t < O.length; t++) {
  26003. var i = O[t]
  26004. if (!i.inUse && i.size === e) return (i.inUse = !0), i
  26005. }
  26006. return null
  26007. })(o)))
  26008. ) {
  26009. var a = this.initTiledPano(o, !1)
  26010. ;(r = l(a.width)).renderTarget = a
  26011. }
  26012. ;(r.pano = e), this.resetPanoDescriptor(e.id), this.resetPanoLODDescriptors(e.id), this.resetRenderStatus(e.id, !0, !0)
  26013. }
  26014. this.setActiveRenderTargetDescriptor(e.id, r)
  26015. var s = i ? 0 : 1
  26016. return this.updateActivePanos(e, s), r.renderTarget
  26017. }),
  26018. (n.prototype.deactivateTiledPano = function (e) {
  26019. var t = this.getActiveRenderTargetDescriptor(e.id)
  26020. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget), this.setActiveRenderTargetDescriptor(e.id, null)
  26021. var i = this.getUploadQueueForPano(e.id)
  26022. this.clearUploadQueue(i), this.updateActivePanos()
  26023. }),
  26024. (n.prototype.updateActivePanos =
  26025. ((s = []),
  26026. function (e, t) {
  26027. for (var i = (s.length = 0); i < this.activePanos.length; i++) {
  26028. e && s.length === t && s.push(e)
  26029. var n = this.activePanos[i],
  26030. r = this.getActiveRenderTargetDescriptor(n.id)
  26031. ;(e && n.id === e.id) || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  26032. }
  26033. e && t >= s.length && s.push(e), (this.activePanos.length = 0), this.activePanos.push.apply(this.activePanos, s)
  26034. })),
  26035. (n.prototype.getActivePanoCount = function () {
  26036. return this.activePanos.length
  26037. }),
  26038. (n.prototype.resetRenderStatus = function (e, r, o, t) {
  26039. var i = null
  26040. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1)
  26041. for (
  26042. var n = function (e, t, i, n) {
  26043. o && (t.tile.zoomUploaded = !1), r && (t.tile.uploaded = !1)
  26044. },
  26045. a = 0;
  26046. a < A.FACES_PER_PANO;
  26047. a++
  26048. ) {
  26049. this.getTileTree(e, a).breadthFirst({
  26050. callback: n.bind(this, a),
  26051. minLevel: i
  26052. })
  26053. }
  26054. }),
  26055. (n.prototype.copyBaseRenderStatusToZoomed = function (e) {
  26056. for (
  26057. var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()),
  26058. i = function (e, t, i, n) {
  26059. ;(t.tile.zoomUploaded = t.tile.uploaded), (t.zoomCovered = t.covered)
  26060. },
  26061. n = 0;
  26062. n < A.FACES_PER_PANO;
  26063. n++
  26064. ) {
  26065. this.getTileTree(e, n).breadthFirst({
  26066. callback: i.bind(this, n),
  26067. maxLevel: t
  26068. })
  26069. }
  26070. }),
  26071. (n.prototype.renderPanoTiles =
  26072. ((h = []),
  26073. function (e, t, i, n) {
  26074. ;(this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize()) || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  26075. (t = t || this.direction || m.FORWARD)
  26076. var r = this.getActiveRenderTargetDescriptor(e)
  26077. if (!this.isRenderTargetDescriptorValid(r)) throw new u('PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.')
  26078. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  26079. var a = this.getTileTree(e, o)
  26080. ;(h.length = 0),
  26081. a.breadthFirst({
  26082. saveVisited: h
  26083. })
  26084. for (var s = 0; s < h.length; s++) {
  26085. var l = h[s]
  26086. this.queueTileUpload(l.tile, !1, n || (0 === s && i))
  26087. }
  26088. }
  26089. this.updateDirection(t)
  26090. })),
  26091. (n.prototype.isRenderTargetDescriptorValid = function (e) {
  26092. return e && e.renderTarget
  26093. }),
  26094. (n.prototype.isPanoActive = function (e) {
  26095. var t = this.getActiveRenderTargetDescriptor(e)
  26096. return this.isRenderTargetDescriptorValid(t)
  26097. }),
  26098. (n.prototype.isPanoZoomed = function (e) {
  26099. return this.zoomingActive && this.zoomPanoId === e
  26100. }),
  26101. (n.prototype.initTileTree = function (e, t, i) {
  26102. var n = this.tileTrees[e]
  26103. n || ((n = []), (this.tileTrees[e] = n))
  26104. var r = n[t]
  26105. if (!r) {
  26106. var o = v.getLevelCountForSize(A.TILE_SIZE, i)
  26107. ;(r = new v(A.TILE_SIZE, o)), (n[t] = r)
  26108. }
  26109. }),
  26110. (n.prototype.getTileTree = function (e, t) {
  26111. var i = this.tileTrees[e]
  26112. if (!i) throw new u('PanoRenderer.getTileTree() -> Tree array not yet initialized!')
  26113. var n = i[t]
  26114. if (!n) throw new u('PanoRenderer.getTileTree() -> Tree not yet initialized!')
  26115. return n
  26116. }),
  26117. (n.prototype.initTiledPano = function (e, t) {
  26118. var i = this.sceneRenderer.renderer,
  26119. n =
  26120. (i.context,
  26121. new _.WebGLRenderTargetCube(e, e, {
  26122. stencilBuffer: !1
  26123. })),
  26124. r = new _.CubeTexture([])
  26125. ;((n.texture = r).image = [null, null, null, null, null, null]),
  26126. (r.flipY = !0),
  26127. t
  26128. ? ((r.generateMipmaps = !0), (r.magFilter = _.LinearFilter), (r.minFilter = _.LinearMipMapLinearFilter))
  26129. : ((r.generateMipmaps = !1), (r.magFilter = _.LinearFilter), (r.minFilter = _.LinearFilter)),
  26130. (r.format = _.RGBAFormat),
  26131. i.setRenderTarget(n),
  26132. i.setRenderTarget(null)
  26133. var o = i.properties.get(r)
  26134. return (o.__image__webglTextureCube = o.__webglTexture), n
  26135. }),
  26136. (n.prototype.getUploadQueueForPano = function (e) {
  26137. var t = this.uploadQueues[e]
  26138. return t || ((t = []), (this.uploadQueues[e] = t)), t
  26139. }),
  26140. (n.prototype.isTileUploaded = function (e) {
  26141. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  26142. }),
  26143. (n.prototype.setUploaded = function (e, t) {
  26144. this.isPanoZoomed(e.panoId) ? (e.zoomUploaded = t) : (e.uploaded = t)
  26145. }),
  26146. (n.prototype.queueTileUpload = function (e, t, i) {
  26147. var n = this.getActiveRenderTargetDescriptor(e.panoId)
  26148. if (
  26149. this.isRenderTargetDescriptorValid(n) &&
  26150. e.downloaded &&
  26151. !this.isTileUploaded(e) &&
  26152. (!e.uploadQueued || i) &&
  26153. (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)
  26154. ) {
  26155. var r = this.getUploadQueueForPano(e.panoId)
  26156. i
  26157. ? this.uploadTile(e, !1)
  26158. : (this.shoulPushToFrontOfQueue(e) ? this.forceQueue.push(e) : t && this.direction ? y.insertSortedPanoTile(r, e, n.pano, this.direction) : r.push(e),
  26159. (e.uploadQueued = !0),
  26160. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  26161. }
  26162. }),
  26163. (n.prototype.shoulPushToFrontOfQueue = function (e) {
  26164. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  26165. }),
  26166. (n.prototype.getTopUploadQueue = function () {
  26167. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  26168. for (var n = 0; n < this.activePanos.length; n++)
  26169. if (((e = this.activePanos[n]), 0 < (t = this.getUploadQueueForPano(e.id)).length))
  26170. switch (i) {
  26171. case P.Base:
  26172. if (0 === t[0].level) return t
  26173. break
  26174. case P.Remaining:
  26175. return t
  26176. }
  26177. return null
  26178. }),
  26179. (n.prototype.getNextFromUploadQueue = function () {
  26180. if (0 < this.forceQueue.length) return L(this.forceQueue)
  26181. var e = this.getTopUploadQueue()
  26182. return e && 0 < e.length ? L(e) : null
  26183. }),
  26184. (n.prototype.peekNextFromUploadQueue = function () {
  26185. if (0 < this.forceQueue.length) return this.forceQueue[0]
  26186. var e = this.getTopUploadQueue()
  26187. return e && 0 < e.length ? e[0] : null
  26188. }),
  26189. (n.prototype.clearAllQueuedUploads = function () {
  26190. this.clearAllUploadQueues(null, 0)
  26191. }),
  26192. (n.prototype.clearAllQueuedUploadsForPano = function (e) {
  26193. this.clearAllUploadQueues(e, 0)
  26194. }),
  26195. (n.prototype.clearAllUploadQueues = function (e, t) {
  26196. if (e) this.clearUploadQueue(this.getUploadQueueForPano(e), t), this.clearUploadQueue(this.forceQueue, t, e)
  26197. else {
  26198. for (var i = 0; i < this.activePanos.length; i++) {
  26199. var n = this.activePanos[i]
  26200. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  26201. }
  26202. this.clearUploadQueue(this.forceQueue, t)
  26203. }
  26204. }),
  26205. (n.prototype.clearUploadQueue = function (e, t, i) {
  26206. null != t || (t = 0)
  26207. for (var n = 0; n < e.length; ) {
  26208. var r = e[n]
  26209. ;(!i || (i && i === r.tile.panoId)) && r.level >= t ? ((r.uploadQueued = !1), e.splice(n, 1)) : n++
  26210. }
  26211. }),
  26212. (n.prototype.refreshUploadInterval =
  26213. ((a = null),
  26214. function (e) {
  26215. this.uploadIntervalCancelled ||
  26216. ((a =
  26217. a ||
  26218. function () {
  26219. this.uploadIntervalCancelled ||
  26220. (this.overlayTilesLoaded || !this.usingTileOverlay
  26221. ? ((T = !0),
  26222. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26223. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : (this.uploadInterval = null))
  26224. : this.refreshUploadInterval(this.uploadIntervalDelay))
  26225. }.bind(this)),
  26226. null != e || (e = x),
  26227. T || (e = S),
  26228. (this.uploadInterval = window.setTimeout(a, e)),
  26229. (this.uploadIntervalDelay = e))
  26230. })),
  26231. (n.prototype.update =
  26232. ((r = performance.now()),
  26233. (o = 0),
  26234. function () {
  26235. ;(this.uploadIntervalCancelled = !0), window.clearTimeout(this.uploadInterval), (this.uploadInterval = null)
  26236. var e = performance.now() - r
  26237. !(x < e || 0 === o) ||
  26238. (!this.overlayTilesLoaded && this.usingTileOverlay) ||
  26239. (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame), (r = performance.now())),
  26240. o++
  26241. })),
  26242. (n.prototype.updateUploadQueue = function (e, t) {
  26243. e = e || 1
  26244. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  26245. var r = this.getNextFromUploadQueue()
  26246. if (!r) break
  26247. if ((0 !== r.level ? i++ : n++, !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  26248. var o = this.getActiveRenderTargetDescriptor(r.panoId)
  26249. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  26250. }
  26251. }
  26252. }),
  26253. (n.prototype.updateDirection = function (e) {
  26254. if ((e = e || this.direction)) {
  26255. this.direction = e
  26256. for (var t = 0; t < this.activePanos.length; t++) {
  26257. var i = this.activePanos[t],
  26258. n = this.getUploadQueueForPano(i.id)
  26259. y.sortPanoTiles(n, i, this.direction)
  26260. }
  26261. }
  26262. }),
  26263. (n.prototype.uploadTile =
  26264. ((I = {}),
  26265. new _.Vector4(),
  26266. (E = d.tiling.overlayStyle),
  26267. function (e, t) {
  26268. var i = e.panoId,
  26269. n = e.image,
  26270. r = e.tileSize,
  26271. o = e.panoSize,
  26272. a = e.tileIndex,
  26273. s = (e.faceTileIndex, e.totalTiles),
  26274. l = (e.face, e.tileX),
  26275. c = e.tileY,
  26276. h = !0,
  26277. u = !1,
  26278. d = (this.getPanoDescriptor(i), this.getPanoLODDescriptor(i, o)),
  26279. p = this.getActiveRenderTargetDescriptor(i),
  26280. f = p.renderTarget,
  26281. g = p.size
  26282. if (
  26283. (this.isPanoZoomed(i) && ((f = this.zoomRenderTarget), (g = this.qualityManager.getMaxZoomPanoSize())),
  26284. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  26285. t || (this.anyUploaded(e.node) && (u = !(h = !1)), this.isTileUploaded(e) && (u = h = !1)),
  26286. h)
  26287. ) {
  26288. var m = (r / o) * g,
  26289. v = ((l * r) / o) * g,
  26290. y = ((c * r) / o) * g
  26291. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping))
  26292. var A = I[r]
  26293. if ((this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r), 1 === E || 2 === E)) {
  26294. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced
  26295. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  26296. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, 0.5)
  26297. } else this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace)
  26298. 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)
  26299. } else this.setUploaded(e, !1)
  26300. return (
  26301. e.uploadAttempted || (d.uploadAttempts++, this.emit(b.TileUploadAttempted, i, o, a, s)),
  26302. (e.uploadAttempted = !0),
  26303. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  26304. u
  26305. )
  26306. })),
  26307. (n.prototype.linkTileAndNode = function (e, t) {
  26308. ;(t.tile = e).node = t
  26309. }),
  26310. (n.prototype.linkAllTilesAndNodes = function (a) {
  26311. for (
  26312. var e = function (e, t, i, n, r) {
  26313. var o = this.getTileDirectoryEntry(a.id, t, n, r)
  26314. this.linkTileAndNode(o, i)
  26315. },
  26316. t = 0;
  26317. t < A.FACES_PER_PANO;
  26318. t++
  26319. ) {
  26320. var i = this.getTileTree(a.id, t)
  26321. i.breadthFirst({
  26322. callback: e.bind(this, i, t)
  26323. })
  26324. }
  26325. }),
  26326. (n.prototype.anyUploaded = function (e) {
  26327. if (!e) return !1
  26328. if (e.tile && this.isTileUploaded(e.tile)) return !0
  26329. if (e.children)
  26330. for (var t = 0; t < e.children.length; t++) {
  26331. var i = e.children[t]
  26332. if (this.anyUploaded(i)) return !0
  26333. }
  26334. return !1
  26335. }),
  26336. (n.prototype.setNodeCovered = function (e, t) {
  26337. this.isPanoZoomed(e.tile.panoId) ? (e.zoomCovered = t) : (e.covered = t)
  26338. }),
  26339. (n.prototype.isNodeCovered = function (e) {
  26340. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  26341. }),
  26342. (n.prototype.addCoverageForNode = function (e) {
  26343. if ((this.setNodeCovered(e, !0), e.parent && e.covered)) {
  26344. var t = e.parent
  26345. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  26346. }
  26347. }),
  26348. (n.prototype.calcFullCoverage = function (e) {
  26349. var t = !1
  26350. if (e.children)
  26351. for (var i = 0; i < e.children.length; i++) {
  26352. var n = e.children[i]
  26353. t = t || this.calcFullCoverage(n)
  26354. }
  26355. e.covered = e.tile.uploaded || t
  26356. }),
  26357. (n.prototype.nodeSubcovered = function (e) {
  26358. if (!e.children) return !1
  26359. for (var t = 0; t < e.children.length; t++) if (!e.children[t] || !this.isNodeCovered(e.children[t])) return !1
  26360. return !0
  26361. }),
  26362. (n.prototype.resetPanoDescriptor = function (e) {
  26363. this.getPanoDescriptor(e)
  26364. }),
  26365. (n.prototype.getPanoDescriptor = function (e) {
  26366. var t = this.panoDescriptors[e]
  26367. return t || ((t = {}), (this.panoDescriptors[e] = t)), t
  26368. }),
  26369. (n.prototype.resetPanoLODDescriptors = function (e) {
  26370. var t = this.getPanoLODDescriptors(e)
  26371. for (var i in t)
  26372. if (t.hasOwnProperty(i)) {
  26373. var n = t[i]
  26374. ;(n.uploadCount = 0), (n.uploadAttempts = 0)
  26375. }
  26376. }),
  26377. (n.prototype.getPanoLODDescriptor = function (e, t) {
  26378. var i = this.getPanoLODDescriptors(e),
  26379. n = i[t]
  26380. return (
  26381. n ||
  26382. ((n = {
  26383. uploadCount: 0,
  26384. uploadAttempts: 0
  26385. }),
  26386. (i[t] = n)),
  26387. n
  26388. )
  26389. }),
  26390. (n.prototype.getPanoLODDescriptors = function (e) {
  26391. var t = this.panoLODDescriptors[e]
  26392. return t || ((t = {}), (this.panoLODDescriptors[e] = t)), t
  26393. }),
  26394. (n.prototype.onTileDownloaded = function (e) {
  26395. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize),
  26396. i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex)
  26397. if (
  26398. ((i.downloaded = !0),
  26399. (i.image = e.image),
  26400. (i.panoSize = e.panoSize),
  26401. (i.tileX = e.tileX),
  26402. (i.tileY = e.tileY),
  26403. (i.totalTiles = e.totalTiles),
  26404. (i.tileIndex = e.tileIndex),
  26405. (i.faceTileIndex = e.faceTileIndex),
  26406. (i.face = e.face),
  26407. (i.cubeFace = C.mapFaceToCubemapFace(e.face)),
  26408. (i.panoId = e.panoId),
  26409. (i.tileSize = e.tileSize),
  26410. (i.direction = new _.Vector3().copy(e.direction)),
  26411. (i.node = null),
  26412. (i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize)),
  26413. this.isPanoActive(i.panoId))
  26414. ) {
  26415. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY)
  26416. this.linkTileAndNode(i, n), this.queueTileUpload(i, !0)
  26417. }
  26418. }),
  26419. (n.prototype.getTileDirectoryEntry = function (e, t, i, n) {
  26420. var r = this.tileDirectory[e]
  26421. r || ((r = {}), (this.tileDirectory[e] = r))
  26422. var o = 16384 * t + 1024 * i + n,
  26423. a = r[o]
  26424. return (
  26425. a ||
  26426. ((a = {
  26427. downloaded: !1,
  26428. uploaded: !1,
  26429. zoomUploaded: !1
  26430. }),
  26431. (r[o] = a)),
  26432. (a._key = e + ':' + t + ':' + i + ':' + n),
  26433. (a._tileKey = o),
  26434. a
  26435. )
  26436. }),
  26437. (n.prototype.setZoomingActive = function (e, t, i) {
  26438. this.zoomPanoRenderingDisabled ||
  26439. (e === this.zoomingActive && this.zoomPanoId === t.id) ||
  26440. ((this.zoomingActive = e), (this.zoomPanoId = t.id), this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  26441. }),
  26442. (n.prototype.updateZoomedPanoFromBase = function (e) {
  26443. if (!this.zoomPanoRenderingDisabled) {
  26444. var t = this.getActiveRenderTargetDescriptor(e.id)
  26445. if (t && t.renderTarget) {
  26446. var i = this.qualityManager.getMaxZoomPanoSize(),
  26447. n = t.renderTarget,
  26448. r = t.size
  26449. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i), this.copyBaseRenderStatusToZoomed(e.id)
  26450. }
  26451. }
  26452. }),
  26453. (t.exports = n)
  26454. },
  26455. {
  26456. '../enum/GLCubeFaces': 25,
  26457. '../enum/PanoRendererEvents': 35,
  26458. '../enum/PanoSizeClass': 36,
  26459. '../enum/SceneRendererEvents': 43,
  26460. '../enum/TileDownloaderEvents': 45,
  26461. '../enum/Vectors': 50,
  26462. '../exception/BasicException': 55,
  26463. '../objects/Panorama': 148,
  26464. '../settings': 166,
  26465. '../util/browser': 182,
  26466. '../util/panorama': 191,
  26467. './TileDownloader': 171,
  26468. './TilePrioritizer': 172,
  26469. './TileTree': 173,
  26470. './TileUtils': 174,
  26471. events: 202,
  26472. three: 217
  26473. }
  26474. ],
  26475. 170: [
  26476. function (e, t, i) {
  26477. 'use strict'
  26478. function n(e, t, i) {
  26479. ;(this.maxNavPanoSize = -1),
  26480. (this.maxZoomPanoSize = -1),
  26481. (this.devicePixelDensity = e),
  26482. (this.deviceScreenSize = t),
  26483. (this.clientBandwidth = i),
  26484. (this.panoSizeClassMap = {}),
  26485. (this.useHighResolutionPanos = !0),
  26486. (this.useUltraHighResolutionPanos = !1),
  26487. (this.modelHasUltraHighPanos = !1)
  26488. this.maxRenderTargetSize = Math.min(common.getMaxCubemapSize(), this.maxRenderTargetSize) //add
  26489. }
  26490. var r = e('../enum/PanoSizeClass'),
  26491. o = e('../settings'),
  26492. a = e('../util/browser'),
  26493. s = e('../constants'),
  26494. l = e('../util/showcase'),
  26495. c = e('../enum/ModelManagerEvents')
  26496. ;(n.prototype.init = function (e) {
  26497. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  26498. (this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH)),
  26499. (this.highSize = this.getPanoSize(r.HIGH)),
  26500. (this.standardSize = this.getPanoSize(r.STANDARD)),
  26501. (this.baseSize = this.getPanoSize(r.BASE)),
  26502. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  26503. (this.highQualityThreshold = a.valueFromHash('threshold2k', s.windowHeightHighQualityThreshold)),
  26504. this.updateMaximums(),
  26505. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  26506. }),
  26507. (n.prototype.updateFromModel = function (e) {
  26508. this.updateHighResolutionSettings(e), this.updateUltraHighResolutionSettings(e)
  26509. }),
  26510. (n.prototype.updateHighResolutionSettings = function (e) {
  26511. l.modelDataPromisesTiles(e.data) ? (this.useHighResolutionPanos = !0) : (this.useHighResolutionPanos = !1), this.updateMaximums()
  26512. }),
  26513. (n.prototype.updateUltraHighResolutionSettings = function (e) {
  26514. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? (this.useUltraHighResolutionPanos = !0) : (this.useUltraHighResolutionPanos = !1), this.updateMaximums()
  26515. }),
  26516. (n.prototype.enableUltraHighQualityMode = function () {
  26517. ;(this.modelHasUltraHighPanos = !0), this.updateUltraHighResolutionSettings(null)
  26518. }),
  26519. (n.prototype.ultraHighQualityModeEnabled = function () {
  26520. return this.modelHasUltraHighPanos
  26521. }),
  26522. (n.prototype.onModelChanged = function (e) {
  26523. this.updateFromModel(e.model), this.updateMaximums()
  26524. }),
  26525. (n.prototype.updateMaximums = function () {
  26526. ;(this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize()),
  26527. (this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize()),
  26528. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  26529. }),
  26530. (n.prototype.buildPanoSizeClassMap = function () {
  26531. ;(this.panoSizeClassMap[r.BASE] = 512), (this.panoSizeClassMap[r.STANDARD] = 1024), (this.panoSizeClassMap[r.HIGH] = 2048), (this.panoSizeClassMap[r.ULTRAHIGH] = 4096)
  26532. }),
  26533. (n.prototype.getPanoSize = function (e) {
  26534. return this.panoSizeClassMap[e]
  26535. }),
  26536. (n.prototype.getMaxPossiblePanoSize = function () {
  26537. return this.getPanoSize(r.ULTRAHIGH)
  26538. }),
  26539. (n.prototype.getMaxPanoSize = function () {
  26540. return this.maxZoomPanoSize
  26541. }),
  26542. (n.prototype.getMaxNavPanoSize = function () {
  26543. return this.maxNavPanoSize
  26544. }),
  26545. (n.prototype.getMaxZoomPanoSize = function () {
  26546. return this.maxZoomPanoSize
  26547. }),
  26548. (n.prototype.detectMaxNavPanoSizeClass = function () {
  26549. return this.useHighResolutionPanos ? (a.isMobile() ? r.STANDARD : $('#player').height() < this.highQualityThreshold ? r.STANDARD : r.HIGH) : r.STANDARD
  26550. }),
  26551. (n.prototype.detectMaxNavPanoSize = function () {
  26552. var e = this.detectMaxNavPanoSizeClass()
  26553. return this.getPanoSize(e)
  26554. }),
  26555. (n.prototype.detectMaxZoomPanoSize = function () {
  26556. return this.useHighResolutionPanos
  26557. ? a.isMobile()
  26558. ? o.tiling.mobileHighQualityOverride
  26559. ? this.getPanoSize(r.HIGH)
  26560. : this.getPanoSize(r.STANDARD)
  26561. : this.useUltraHighResolutionPanos
  26562. ? this.getPanoSize(r.ULTRAHIGH)
  26563. : this.getPanoSize(r.HIGH)
  26564. : this.getPanoSize(r.STANDARD)
  26565. }),
  26566. (t.exports = n)
  26567. },
  26568. {
  26569. '../constants': 8,
  26570. '../enum/ModelManagerEvents': 33,
  26571. '../enum/PanoSizeClass': 36,
  26572. '../settings': 166,
  26573. '../util/browser': 182,
  26574. '../util/showcase': 193
  26575. }
  26576. ],
  26577. 171: [
  26578. function (A, C, e) {
  26579. ;(function (e) {
  26580. 'use strict'
  26581. function i(e) {
  26582. ;(this.panos = null),
  26583. (this.retryMinimumTime = 1e4),
  26584. (this.urls = null),
  26585. (this.panoLoadCallbacks = {}),
  26586. (this.downloadDescriptors = {}),
  26587. (this.priorityQueue = []),
  26588. (this.forceQueue = []),
  26589. (this.activeDownloads = []),
  26590. (this.qualityManager = null),
  26591. (this.tilePrioritizer = null),
  26592. (this.refreshInterval = null),
  26593. (this.processPriorityQueue = !1),
  26594. (this.concurrentDownloads = e.concurrentDownloads || 1),
  26595. (this.downloadTestResults = {})
  26596. }
  26597. var c,
  26598. h,
  26599. n,
  26600. p,
  26601. f,
  26602. t = A('three'),
  26603. u = (A('../enum/Viewmode'), A('../settings')),
  26604. r = (A('../objects/Panorama'), A('../util/logger')),
  26605. o = (A('../enum/Vectors'), A('../enum/PanoSizeClass'), A('../enum/TileDownloaderEvents')),
  26606. g = A('./TilePrioritizer'),
  26607. m = A('./TileUtils'),
  26608. v = (A('../enum/GLCubeFaces'), A('../enum/DownloadStatus')),
  26609. a = A('../util/panorama'),
  26610. s = A('../util/ajax'),
  26611. d = A('../ab'),
  26612. l = A('events').EventEmitter,
  26613. y =
  26614. (new r(e),
  26615. Object.freeze({
  26616. Testing: 1,
  26617. Success: 2,
  26618. Fail: 3
  26619. }))
  26620. ;(i.prototype = Object.create(l.prototype)),
  26621. (i.IDLE_REFRESH_DELAY = 500),
  26622. (i.ACTIVE_REFRESH_DELAY = 16),
  26623. (i.DOWNLOAD_RETRIES = 4),
  26624. (i.prototype.init = function (e) {
  26625. this.qualityManager = e
  26626. }),
  26627. (i.prototype.setUrls = function (e) {
  26628. this.urls = e
  26629. }),
  26630. (i.prototype.setpanoData = function (e, t, i) {
  26631. ;(this.panos = e), (this.imagePanos = t), (this.panoGroupId = i)
  26632. }),
  26633. (i.prototype.start = function () {
  26634. this.refreshUpdateInterval(0)
  26635. }),
  26636. (i.prototype.stop = function () {
  26637. window.cancel(this.refreshInterval)
  26638. }),
  26639. (i.prototype.refreshUpdateInterval = function (e) {
  26640. ;(e = e || 0),
  26641. (this.refreshInterval = window.setTimeout(
  26642. function () {
  26643. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  26644. }.bind(this),
  26645. e
  26646. ))
  26647. }),
  26648. (i.prototype.update = function () {
  26649. var e = 0 < this.forceQueue.length
  26650. return (
  26651. this.processQueueForDownloading(this.forceQueue),
  26652. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos), 0 < this.priorityQueue.length && (e = !0), this.processQueueForDownloading(this.priorityQueue)),
  26653. e
  26654. )
  26655. }),
  26656. (i.prototype.forceQueueTilesForPano =
  26657. ((p = []),
  26658. (f = []),
  26659. function (e, t, i, n, r, o) {
  26660. p.length = 0
  26661. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  26662. var l = a[s]
  26663. ;(l.status !== v.None && l.status !== v.Queued) || p.push(l)
  26664. }
  26665. if (i && 0 < p.length) {
  26666. g.sortPanoTiles(p, e, i), (f.length = 0), m.matchingTilesInDirection(e, t, i, n, r, f)
  26667. for (
  26668. var c = 0,
  26669. h = function (e) {
  26670. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  26671. };
  26672. c < p.length;
  26673. ) {
  26674. var u = p[c]
  26675. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  26676. }
  26677. }
  26678. for (var d = 0; d < p.length; d++) this.forceQueue.push(p[d])
  26679. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued), this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1), o && this.processQueueForDownloading(this.forceQueue, !0)
  26680. })),
  26681. (i.prototype.clearForceQueue = function () {
  26682. this.clearQueue(this.forceQueue)
  26683. }),
  26684. (i.prototype.queuePrioritizedTilesForPanos = function (e) {
  26685. this.tilePrioritizer &&
  26686. (this.clearQueue(this.priorityQueue),
  26687. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  26688. this.clearFromQueue(this.priorityQueue, v.None, !0),
  26689. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  26690. }),
  26691. (i.prototype.clearQueue = function (e) {
  26692. this.setStatusForAllDescriptors(e, v.None), (e.length = 0)
  26693. }),
  26694. (i.prototype.clearFromQueue = function (e, t, i) {
  26695. for (var n = 0; n < e.length; n++) {
  26696. var r = e[n]
  26697. r && ((t === r.status && !i) || (t !== r.status && i)) && (e[n] = null)
  26698. }
  26699. }),
  26700. (i.prototype.setStatusForAllDescriptors = function (e, t) {
  26701. for (var i = 0; i < e.length; i++) {
  26702. var n = e[i]
  26703. n && (n.status = t)
  26704. }
  26705. }),
  26706. (i.prototype.setStatusOrRemoveForAllDescriptors = function (e, t) {
  26707. for (var i = 0; i < e.length; i++) {
  26708. var n = e[i]
  26709. n && (n.status !== t ? (n.status = t) : (e[i] = null))
  26710. }
  26711. }),
  26712. (i.prototype.getTileDownloadDescriptors = function (e, t) {
  26713. var i = this.getAllTileDownloadDescriptorsForPano(e),
  26714. n = i[t]
  26715. return n || ((n = this.buildDownloadDescriptorArray(t)), (i[t] = n), this.initTileDownloadDescriptors(n, e, t)), n
  26716. }),
  26717. (i.prototype.getAllTileDownloadDescriptorsForPano = function (e) {
  26718. var t = this.downloadDescriptors[e.id]
  26719. return t || ((t = {}), (this.downloadDescriptors[e.id] = t)), t
  26720. }),
  26721. (i.prototype.processQueueForDownloading = function (e, t) {
  26722. if ((this.cleanupActiveDownloads(), this.activeDownloads.length < this.concurrentDownloads || t))
  26723. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  26724. var r = e.shift()
  26725. r && (this.startDownload(r), n++)
  26726. }
  26727. }),
  26728. (i.prototype.testDownload = function (t, e, i) {
  26729. var n = this.downloadTestResults[t]
  26730. if (n) n === y.Success ? i(!0) : n === y.Fail && i(!1)
  26731. else {
  26732. this.downloadTestResults[t] = y.Testing
  26733. var r = this.panos.list[0],
  26734. o = this.getTileUrl(r.id, t, e, 0),
  26735. a = function (e) {
  26736. ;(this.downloadTestResults[t] = y.Success), i(!0)
  26737. }.bind(this),
  26738. s = function () {
  26739. ;(this.downloadTestResults[t] = y.Fail), i(!1)
  26740. }.bind(this)
  26741. this.loadImage(o, 0, a, s)
  26742. }
  26743. }),
  26744. (i.prototype.startDownload = function (e) {
  26745. e.status = v.Downloading
  26746. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex)
  26747. this.activeDownloads.push(e), this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26748. }),
  26749. (i.prototype.downloadFailed = function (e, t) {}),
  26750. (i.prototype.downloadComplete = function (e, t) {
  26751. if (e.panoGroupId === this.panoGroupId) {
  26752. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize)
  26753. ;(e.status = v.Downloaded), i && i.onProgress && i.onProgress(e.pano, e.panoSize)
  26754. var n = {
  26755. panoId: e.pano.id,
  26756. image: t,
  26757. tileSize: e.tileSize,
  26758. panoSize: e.panoSize,
  26759. tileIndex: e.tileIndex,
  26760. faceTileIndex: e.faceTileIndex,
  26761. totalTiles: e.totalTiles,
  26762. face: e.face,
  26763. tileX: e.tileX,
  26764. tileY: e.tileY,
  26765. direction: e.direction
  26766. }
  26767. ;(e.image = t),
  26768. this.emit(o.TileDownloadSuccess, n),
  26769. this.isPanoDownloaded(e.pano, e.panoSize) &&
  26770. ((n = {
  26771. panoId: e.pano.id,
  26772. tileSize: e.tileSize,
  26773. panoSize: e.panoSize
  26774. }),
  26775. this.emit(o.PanoDownloadComplete, n),
  26776. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26777. }
  26778. }),
  26779. (i.prototype.cleanupActiveDownloads =
  26780. ((n = []),
  26781. function () {
  26782. for (var e = (n.length = 0); e < this.activeDownloads.length; e++) {
  26783. var t = this.activeDownloads[e]
  26784. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  26785. }
  26786. ;(this.activeDownloads.length = 0), this.activeDownloads.push.apply(this.activeDownloads, n)
  26787. })),
  26788. (i.prototype.isPanoDownloaded = function (e, t) {
  26789. var i = this.getTileDownloadDescriptors(e, t)
  26790. if (i.length <= 0) return !1
  26791. for (var n = 0; n < i.length; n++) {
  26792. if (i[n].status !== v.Downloaded) return !1
  26793. }
  26794. return !0
  26795. }),
  26796. (i.prototype.setPanoLoadCallbacks = function (e, t, i, n, r) {
  26797. var o = e.id + ':' + this.qualityManager.getPanoSize(t)
  26798. this.panoLoadCallbacks[o] = {
  26799. onLoad: i,
  26800. onFail: n,
  26801. onProgress: r
  26802. }
  26803. }),
  26804. (i.prototype.getPanoLoadCallbacks = function (e, t) {
  26805. var i = e.id + ':' + t
  26806. return this.panoLoadCallbacks[i]
  26807. }),
  26808. (i.prototype.buildDownloadDescriptorArray = function (e) {
  26809. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26810. var r = this.buildDownloadDescriptor()
  26811. i.push(r)
  26812. }
  26813. return i
  26814. }),
  26815. (i.prototype.buildDownloadDescriptor = function () {
  26816. return {
  26817. panoGroupId: null,
  26818. pano: null,
  26819. panoSize: -1,
  26820. tileSize: -1,
  26821. tileIndex: -1,
  26822. totalTiles: -1,
  26823. faceTileIndex: -1,
  26824. status: v.None,
  26825. url: null,
  26826. image: null,
  26827. direction: new t.Vector3(),
  26828. face: -1,
  26829. cubeFace: -1,
  26830. tileX: -1,
  26831. tileY: -1
  26832. }
  26833. }),
  26834. (i.prototype.initTileDownloadDescriptors = function (e, t, i) {
  26835. for (var n = 0; n < e.length; n++) {
  26836. var r = e[n]
  26837. this.initTileDownloadDescriptor(r, t, i, n)
  26838. }
  26839. }),
  26840. (i.prototype.initTileDownloadDescriptor = function (e, t, i, n) {
  26841. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i
  26842. ;(e.face = m.getFaceForTile(i, n)),
  26843. (e.cubeFace = a.mapFaceToCubemapFace(e.face)),
  26844. (e.panoGroupId = this.panoGroupId),
  26845. (e.pano = t),
  26846. (e.panoSize = i),
  26847. (e.tileSize = r),
  26848. (e.tileIndex = n),
  26849. (e.totalTiles = m.getTileCountForSize(i)),
  26850. (e.status = v.None),
  26851. (e.image = null),
  26852. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26853. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26854. }),
  26855. (i.prototype.getTileUrl =
  26856. ((c = {
  26857. 256: '256',
  26858. 512: '512',
  26859. 1024: '1k',
  26860. 2048: '2k',
  26861. 4096: '4k'
  26862. }),
  26863. (h = {
  26864. face: -1,
  26865. faceTileIndex: -1,
  26866. tileX: -1,
  26867. tileY: -1
  26868. }),
  26869. function (e, t, i, n) {
  26870. m.getTileLocation(t, n, h)
  26871. var r = Math.floor(t / i),
  26872. o = r * r,
  26873. a = Math.floor(n / o),
  26874. s = ''
  26875. 1 === u.tiling.customCompression && (s = '_' + u.tiling['q' + c[t]])
  26876. var l = this.urls.get('tiles/' + e + '/' + c[t] + s + '_face' + a + '_' + h.tileX + '_' + h.tileY + '.jpg')
  26877. return d.changeIfTileGenerating(l)
  26878. })),
  26879. (i.prototype.loadImage = function (e, t, i, n) {
  26880. s.getImage(e, t)
  26881. .then(function (e) {
  26882. i(e)
  26883. })
  26884. .fail(n)
  26885. }),
  26886. (C.exports = i)
  26887. }).call(this, '/js/tile/TileDownloader.js')
  26888. },
  26889. {
  26890. '../ab': 3,
  26891. '../enum/DownloadStatus': 24,
  26892. '../enum/GLCubeFaces': 25,
  26893. '../enum/PanoSizeClass': 36,
  26894. '../enum/TileDownloaderEvents': 45,
  26895. '../enum/Vectors': 50,
  26896. '../enum/Viewmode': 51,
  26897. '../objects/Panorama': 148,
  26898. '../settings': 166,
  26899. '../util/ajax': 181,
  26900. '../util/logger': 189,
  26901. '../util/panorama': 191,
  26902. './TilePrioritizer': 172,
  26903. './TileUtils': 174,
  26904. events: 202,
  26905. three: 217
  26906. }
  26907. ],
  26908. 172: [
  26909. function (n, C, e) {
  26910. ;(function (e) {
  26911. 'use strict'
  26912. function h(e, t, i, n, r) {
  26913. ;(this.qualityManager = e),
  26914. (this.maxNavQuality = this.qualityManager.getMaxNavPanoSize()),
  26915. (this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()),
  26916. (this.baseSize = t),
  26917. (this.standardSize = i),
  26918. (this.highSize = n),
  26919. (this.ultraHighSize = r),
  26920. (this.priorityCriteria = new h.PriorityCriteria(null, new o.Vector3(0, 0, 0), new o.Vector3(0, 0, -1), new o.Vector3(0, 0, -1)))
  26921. }
  26922. var c,
  26923. s,
  26924. l,
  26925. d,
  26926. r,
  26927. u,
  26928. p,
  26929. f,
  26930. o = n('three'),
  26931. g = (n('../enum/Viewmode'), n('../settings'), n('../settings'), n('../objects/Panorama')),
  26932. t = n('../util/logger'),
  26933. i = (n('../enum/Vectors'), n('../enum/PanoSizeClass'), n('../enum/ModelManagerEvents'), n('../enum/GLCubeFaces'), n('../enum/DownloadStatus')),
  26934. m = (n('../util/browser'), n('./TileUtils')),
  26935. v = n('../util/math'),
  26936. a =
  26937. (n('events').EventEmitter,
  26938. new t(e),
  26939. Object.freeze({
  26940. None: 0,
  26941. DirectionalFOV: 1
  26942. }))
  26943. ;(h.PriorityCriteria = function (e, t, i, n, r) {
  26944. ;(this.pano = e),
  26945. (this.cameraPosition = new o.Vector3().copy(t)),
  26946. (this.cameraDir = new o.Vector3().copy(i)),
  26947. (this.panoSpaceDir = new o.Vector3().copy(n)),
  26948. (this.upcomingPanos = r),
  26949. (this.copy = function (e) {
  26950. ;(this.pano = e.pano), this.cameraPosition.copy(e.cameraPosition), this.cameraDir.copy(e.cameraDir), this.panoSpaceDir.copy(e.panoSpaceDir), (this.upcomingPanos = r)
  26951. }),
  26952. (this.zoomingActive = !1)
  26953. }),
  26954. (h.DIRECTIONAL_FOV = 180),
  26955. (h.DIRECTIONAL_FOV_NARROW = 120),
  26956. (h.MAX_SCORED_PANOS_TOCONSIDER = 6),
  26957. (h.MAX_SCORED_PANOS_TOADD = 2),
  26958. (h.MAX_UPCOMING_PANOS_TOADD = 3),
  26959. (h.DIRECTION_SCORE_STRICTNESS = 0.75),
  26960. (h.appendQueue = function (e, t) {
  26961. if (e && t) for (var i = 0; i < t.length; i++) e.push(t[i])
  26962. }),
  26963. (h.prototype.updateCriteria = function (e, t, i, n) {
  26964. ;(this.priorityCriteria.pano = e),
  26965. this.priorityCriteria.cameraPosition.copy(t),
  26966. this.priorityCriteria.cameraDir.copy(i),
  26967. (this.priorityCriteria.upcomingPanos = n),
  26968. (this.maxNavQuality = this.qualityManager.getMaxNavPanoSize()),
  26969. (this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize())
  26970. }),
  26971. (h.prototype.filterAndPrioritize =
  26972. ((u = []),
  26973. (p = []),
  26974. (f = []),
  26975. function (e, t, i) {
  26976. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  26977. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER)
  26978. var n = this.baseSize,
  26979. r = this.standardSize,
  26980. o = this.highSize,
  26981. a = this.ultraHighSize
  26982. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  26983. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  26984. (f.length = 0),
  26985. this.canDownloadSize(r) &&
  26986. this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26987. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26988. h.appendQueue(e, f),
  26989. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  26990. (f.length = 0),
  26991. this.canDownloadSize(o) &&
  26992. this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26993. this.canDownloadSize(a) &&
  26994. this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26995. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26996. h.appendQueue(e, f),
  26997. (f.length = 0),
  26998. this.canDownloadSize(r) &&
  26999. this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  27000. this.canDownloadSize(o) &&
  27001. this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  27002. this.canDownloadSize(a) &&
  27003. this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  27004. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27005. h.appendQueue(e, f),
  27006. this.queueTilesForPanos(e, u, i, n)
  27007. })),
  27008. (h.prototype.canDownloadSize = function (e) {
  27009. return this.maxNavQuality >= e || (this.maxZoomQuality >= e && this.zoomingActive)
  27010. }),
  27011. (h.prototype.populateNeighborPanos = function (e, t, i) {
  27012. ;(i = i || []).length = 0
  27013. var n = t.getNeighbours(e)
  27014. for (var r in n)
  27015. if (n.hasOwnProperty(r)) {
  27016. var o = t.get(r)
  27017. i.push(o)
  27018. }
  27019. return i
  27020. }),
  27021. (h.prototype.populateScoredPanos = function (e, t, i, n, r) {
  27022. ;(i = i || []).length = 0
  27023. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)],
  27024. a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)],
  27025. s = t.sortByScore(o, a)
  27026. if (s)
  27027. for (var l = 0; l < s.length && l < r; l++) {
  27028. var c = s[l].item
  27029. i.push(c)
  27030. }
  27031. return i
  27032. }),
  27033. (h.prototype.queueTilesForPanos = function (e, t, i, n, r) {
  27034. for (var o = 0, a = 0; a < t.length; a++) {
  27035. var s = t[a]
  27036. if (((o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0), r && r <= o)) break
  27037. }
  27038. return o
  27039. }),
  27040. (h.prototype.queueTilesForPano =
  27041. ((r = {
  27042. filter: a.None
  27043. }),
  27044. function (e, t, i, n) {
  27045. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  27046. })),
  27047. (h.prototype.queueTilesForPanosInDirection =
  27048. ((d = new o.Vector3()),
  27049. function (e, t, i, n, r, o, a, s) {
  27050. for (var l = 0, c = 0; c < i.length; c++) {
  27051. var h = i[c]
  27052. d.copy(h.position), d.sub(r), d.normalize()
  27053. var u = Math.max(Math.min(o.dot(d), 1), -1)
  27054. if (v.getFOVDotThreshold(a) <= u && ((l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0), s && s <= l)) break
  27055. }
  27056. return l
  27057. })),
  27058. (h.prototype.queueTilesInDirectionForPanos = function (e, t, i, n, r, o, a, s) {
  27059. for (var l = 0, c = 0; c < i.length; c++) {
  27060. var h = i[c]
  27061. if (((l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0), s && s <= l)) break
  27062. }
  27063. return l
  27064. }),
  27065. (h.prototype.queueTilesInDirectionForPano =
  27066. ((s = {
  27067. filter: a.DirectionalFOV,
  27068. direction: new o.Vector3(),
  27069. fov: 60
  27070. }),
  27071. (l = new o.Vector3()),
  27072. function (e, t, i, n, r, o, a) {
  27073. return l.copy(o), m.getRelativeDirection(i.quaternion, l), s.direction.copy(l), (s.fov = a), this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  27074. })),
  27075. (h.prototype.filterAndQueueTileDownloadDescriptors =
  27076. ((c = []),
  27077. function (e, t, i, n, r) {
  27078. var o = t.getTileDownloadDescriptors(i, n)
  27079. ;(c.length = 0), this.filterTileDownloadDescriptors(i, o, c, r)
  27080. for (var a = 0, s = 0; s < c.length; s++) {
  27081. var l = c[s]
  27082. l && (e.push(l), a++)
  27083. }
  27084. return a
  27085. })),
  27086. (h.prototype.filterTileDownloadDescriptors =
  27087. (new o.Vector3(),
  27088. function (e, t, i, n) {
  27089. var r, o
  27090. switch (n.filter) {
  27091. case a.DirectionalFOV:
  27092. 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)
  27093. break
  27094. default:
  27095. for (r = 0; r < t.length; r++) (o = t[r]), i.push(o)
  27096. }
  27097. for (r = 0; r < i.length; r++) (o = i[r]), this.canIncludeDescriptor(o) || (i[r] = null)
  27098. })),
  27099. (h.prototype.canIncludeDescriptor = function (e) {
  27100. return e.status !== i.Downloading && e.status !== i.Downloaded
  27101. }),
  27102. (h.prototype.canIncludePano = function (e, t) {
  27103. return !e.isLoaded(t)
  27104. }),
  27105. (h.getFOVDotThreshold = function (e) {
  27106. return Math.cos(o.Math.degToRad(e / 2))
  27107. })
  27108. var y = ((A._panoSpaceDir = new o.Vector3()), (A._fovThreshold = -1), (A._fovThresholdNarrow = -1), A)
  27109. function A(e, t) {
  27110. var i = A._panoSpaceDir,
  27111. n = A._fovThreshold,
  27112. r = A._fovThresholdNarrow,
  27113. o = Math.max(Math.min(i.dot(e.direction), 1), -1),
  27114. a = Math.max(Math.min(i.dot(t.direction), 1), -1)
  27115. return (
  27116. (e._dot = o),
  27117. (t._dot = a),
  27118. 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)
  27119. )
  27120. }
  27121. ;(h.sortPanoTiles = function (e, t, i) {
  27122. y._panoSpaceDir.copy(i),
  27123. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  27124. (y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW)),
  27125. (y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV)),
  27126. e.sort(y)
  27127. }),
  27128. (h.insertSortedPanoTile = function (e, t, i, n) {
  27129. y._panoSpaceDir.copy(n),
  27130. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  27131. (y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW)),
  27132. (y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV))
  27133. for (var r = -1, o = 0; o < e.length; o++) {
  27134. if (y(t, e[o]) <= 0) {
  27135. r = o
  27136. break
  27137. }
  27138. }
  27139. if (-1 === r) e[e.length] = t
  27140. else {
  27141. for (var a = e.length; r < a; a--) e[a] = e[a - 1]
  27142. e[r] = t
  27143. }
  27144. }),
  27145. (h.prototype.setZoomingActive = function (e) {
  27146. e !== this.zoomingActive && (this.zoomingActive = e)
  27147. }),
  27148. (C.exports = h)
  27149. }).call(this, '/js/tile/TilePrioritizer.js')
  27150. },
  27151. {
  27152. '../enum/DownloadStatus': 24,
  27153. '../enum/GLCubeFaces': 25,
  27154. '../enum/ModelManagerEvents': 33,
  27155. '../enum/PanoSizeClass': 36,
  27156. '../enum/Vectors': 50,
  27157. '../enum/Viewmode': 51,
  27158. '../objects/Panorama': 148,
  27159. '../settings': 166,
  27160. '../util/browser': 182,
  27161. '../util/logger': 189,
  27162. '../util/math': 190,
  27163. './TileUtils': 174,
  27164. events: 202,
  27165. three: 217
  27166. }
  27167. ],
  27168. 173: [
  27169. function (e, t, i) {
  27170. 'use strict'
  27171. function f(e, t) {
  27172. ;(this.levels = t),
  27173. (this.tileSize = e),
  27174. (this.root = null),
  27175. (this.allNodes = []),
  27176. (function (e) {
  27177. e.root = (function e(t, i, n) {
  27178. if (n > t.levels) return null
  27179. var r = new a(t, i)
  27180. t.allNodes.push(r)
  27181. for (var o = 0; o < s; o++) r.children[o] = e(t, r, n + 1)
  27182. return r
  27183. })(e, null, 0)
  27184. })(this)
  27185. }
  27186. function a(e, t) {
  27187. ;(this.tree = e), (this.parent = t), (this.children = []), (this.id = ++n)
  27188. }
  27189. var g = (e('three'), e('./TileUtils'), e('../objects/Panorama'), e('../util/panorama'), e('events').EventEmitter, 2),
  27190. s = g * g
  27191. f.TraversalType = Object.freeze({
  27192. PreOrder: 0,
  27193. PostOrder: 1
  27194. })
  27195. var n = 0
  27196. ;(f.getLevelCountForSize = function (e, t) {
  27197. var i = 0
  27198. for (t < e && (t = e); !((t /= g) < e); ) i++
  27199. return i
  27200. }),
  27201. (f.getSizeForLevel = function (e, t) {
  27202. return Math.pow(g, t) * e
  27203. }),
  27204. (f.prototype.getSubNode = function (e, t, i) {
  27205. ;(!t || e < this.tileSize) && (t = 0), (!i || e < this.tileSize) && (i = 0), e < this.tileSize && (e = this.tileSize)
  27206. var n = f.getLevelCountForSize(this.tileSize, e)
  27207. return (function e(t, i, n, r, o) {
  27208. if (!t) return null
  27209. if (0 === n) return t
  27210. if (!t.children || 0 === t.children.length) return null
  27211. var a = Math.pow(g, n) / g,
  27212. s = r % a,
  27213. l = o % a,
  27214. c = Math.floor(o / a),
  27215. h = Math.floor(r / a),
  27216. u = c * g + h
  27217. return e(t.children[u], i + 1, n - 1, s, l)
  27218. })(this.root, 0, n, t, i)
  27219. }),
  27220. (f.prototype.breadthFirst = function (e) {
  27221. var t = !!(e = e || {}).nullLevelEnd,
  27222. i = e.maxLevel,
  27223. n = e.minLevel,
  27224. r = e.callback,
  27225. o = e.saveVisited,
  27226. a = [],
  27227. s = {},
  27228. l = 0
  27229. for (a.push(this.root), a.push(s); 0 < a.length && !(i && i < l); ) {
  27230. var c = a.shift()
  27231. if (c === s) (!n || n <= l) && (r && t && r(null), o && t && o.push(null)), 0 < a.length && a.push(s), l++, 0
  27232. else {
  27233. if (c.children)
  27234. for (var h = 0; h < c.children.length; h++) {
  27235. c.children[h] && a.push(c.children[h])
  27236. }
  27237. var u = this.getFaceIndexFromNode(c)
  27238. ;(!n || n <= l) && (r && r(c, l, u), o && o.push(c)), 0
  27239. }
  27240. }
  27241. }),
  27242. (f.prototype.getFaceIndexFromNode = function (e) {
  27243. if (!e) return -1
  27244. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  27245. var o = i.parent
  27246. if (!o) break
  27247. for (var a = -1, s = 0; s < o.children.length; s++) o.children[s] === i && (a = s)
  27248. ;(n = (a % g) * t + n), (r = Math.floor(a / g) * t + r), (t *= g), (i = o)
  27249. }
  27250. return r * t + n
  27251. }),
  27252. (f.prototype.depthFirst = function (e, t, i) {
  27253. !(function e(t, i, n, r, o, a, s, l) {
  27254. if (t) {
  27255. s = s || f.TraversalType.PreOrder
  27256. var c = r * g + n
  27257. if ((s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r), a && a.push(t)), t.children && 0 !== t.children.length)) {
  27258. 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)
  27259. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r), a && a.push(t))
  27260. }
  27261. }
  27262. })(this.root, 0, 0, 0, e, t, i, this.tileSize)
  27263. }),
  27264. (t.exports = f)
  27265. },
  27266. {
  27267. '../objects/Panorama': 148,
  27268. '../util/panorama': 191,
  27269. './TileUtils': 174,
  27270. events: 202,
  27271. three: 217
  27272. }
  27273. ],
  27274. 174: [
  27275. function (e, t, i) {
  27276. 'use strict'
  27277. var n,
  27278. a,
  27279. s,
  27280. p,
  27281. f,
  27282. g,
  27283. E,
  27284. l,
  27285. c,
  27286. h,
  27287. u,
  27288. d,
  27289. r,
  27290. o,
  27291. m = e('../enum/GLCubeFaces'),
  27292. _ = e('../util/MathLight'),
  27293. b = {}
  27294. ;(b.TILE_SIZE = 512),
  27295. (b.FACES_PER_PANO = 6),
  27296. (b.LocationOnTile = {
  27297. Center: 0,
  27298. UpperLeft: 1,
  27299. UpperRight: 2,
  27300. LowerRight: 3,
  27301. LowerLeft: 4
  27302. }),
  27303. (b.getTileVector = function (e, t, i, n, r, o, a, s) {
  27304. var l = e / t,
  27305. c = (t / e) * 2,
  27306. h = c / 2,
  27307. u = (n / l) * 2 - 1 + h,
  27308. d = ((r = l - 1 - r) / l) * 2 - 1 + h
  27309. switch ((o = o || b.LocationOnTile.Center)) {
  27310. case b.LocationOnTile.UpperLeft:
  27311. ;(u -= h), (d += h), (u += a * c)
  27312. break
  27313. case b.LocationOnTile.UpperRight:
  27314. ;(u += h), (d += h), (d -= a * c)
  27315. break
  27316. case b.LocationOnTile.LowerRight:
  27317. ;(u += h), (d -= h), (u -= a * c)
  27318. break
  27319. case b.LocationOnTile.LowerLeft:
  27320. ;(u -= h), (d -= h), (d += a * c)
  27321. break
  27322. case b.LocationOnTile.Center:
  27323. }
  27324. switch (i) {
  27325. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  27326. _.setVector(s, -1, d, -u)
  27327. break
  27328. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  27329. _.setVector(s, 1, d, u)
  27330. break
  27331. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  27332. _.setVector(s, -u, 1, -d)
  27333. break
  27334. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  27335. _.setVector(s, -u, -1, d)
  27336. break
  27337. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  27338. _.setVector(s, -u, d, 1)
  27339. break
  27340. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  27341. _.setVector(s, u, d, -1)
  27342. }
  27343. _.normalize(s)
  27344. }),
  27345. (b.getFaceForTile = function (e, t) {
  27346. var i = b.TILE_SIZE
  27347. e < b.TILE_SIZE && (i = e)
  27348. var n = Math.floor(e / i),
  27349. r = n * n
  27350. return Math.floor(t / r)
  27351. }),
  27352. (b.getTileLocation = function (e, t, i) {
  27353. var n = b.TILE_SIZE
  27354. e < b.TILE_SIZE && (n = e)
  27355. var r = b.getFaceForTile(e, t),
  27356. o = Math.floor(e / n),
  27357. a = t - r * (o * o)
  27358. ;(i.tileX = a % o), (i.tileY = Math.floor(a / o)), (i.face = r), (i.faceTileIndex = a)
  27359. }),
  27360. (b.getTileCountForSize = function (e) {
  27361. if (e <= b.TILE_SIZE) return b.FACES_PER_PANO
  27362. var t = Math.floor(e / b.TILE_SIZE)
  27363. return t * t * b.FACES_PER_PANO
  27364. }),
  27365. (b.getRelativeDirection =
  27366. ((r = new _.Matrix4()),
  27367. (o = new _.Quaternion()),
  27368. function (e, t) {
  27369. o.copy(e), o.inverse(), r.makeRotationFromQuaternion(o), r.applyToVector3(t), _.normalize(t)
  27370. })),
  27371. (b.matchingTilesInDirection =
  27372. ((c = new _.Vector3()),
  27373. (h = new _.Vector3(0, 0, -1)),
  27374. (u = new _.Quaternion()),
  27375. (l = {
  27376. face: -1,
  27377. faceTileIndex: -1,
  27378. tileX: -1,
  27379. tileY: -1
  27380. }),
  27381. (d = function (e, t, i) {
  27382. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  27383. b.getTileLocation(e, o, l),
  27384. (t && !t(l)) ||
  27385. (r++,
  27386. i &&
  27387. ((a = l),
  27388. i.push({
  27389. face: a.face,
  27390. faceTileIndex: a.faceTileIndex,
  27391. tileX: a.tileX,
  27392. tileY: a.tileY
  27393. })))
  27394. var a
  27395. return r
  27396. }),
  27397. function (e, t, i, n, r, o) {
  27398. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE
  27399. if ((b.getTileCountForSize(t), !n && !r)) return d(t, null, o)
  27400. var s = !!r
  27401. return (
  27402. (r = r || n),
  27403. (r = Math.max(0, Math.min(r, 360))),
  27404. (n = Math.max(0, Math.min(n, 360))),
  27405. _.copyVector(i, c),
  27406. b.getRelativeDirection(e.quaternion, c),
  27407. s
  27408. ? (u.setFromUnitVectors(c, h),
  27409. d(
  27410. t,
  27411. function (e) {
  27412. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  27413. },
  27414. o
  27415. ))
  27416. : d(
  27417. t,
  27418. function (e) {
  27419. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  27420. },
  27421. o
  27422. )
  27423. )
  27424. })),
  27425. (b.isTileWithinFrustum =
  27426. ((E = new _.Vector3()),
  27427. function (e, t, i, n, r, o, a, s) {
  27428. for (
  27429. var l = Math.tan(0.5 * s * _.RADIANS_PER_DEGREE),
  27430. c = -l,
  27431. h = Math.tan(0.5 * a * _.RADIANS_PER_DEGREE),
  27432. u = -h,
  27433. d = b.mapFaceToCubemapFace(i),
  27434. p = 0,
  27435. f = 0,
  27436. g = 0,
  27437. m = 0,
  27438. v = 0,
  27439. y = b.LocationOnTile.Center;
  27440. y <= b.LocationOnTile.LowerLeft;
  27441. y++
  27442. )
  27443. if ((b.getTileVector(e, t, d, n, r, y, 0, E), _.applyQuaternionToVector(o, E), -1e-5 <= E.z));
  27444. else {
  27445. var A = -1 / E.z,
  27446. C = E.x * A,
  27447. I = E.y * A
  27448. l < I ? p++ : I < c && f++, h < C ? g++ : C < u && m++, v++
  27449. }
  27450. return f !== v && p !== v && g !== v && m !== v
  27451. })),
  27452. (b.isTileWithinFOV =
  27453. ((p = new _.Vector3()),
  27454. (f = new _.Vector3(0, 1, 0)),
  27455. (g = new _.Vector3(1, 0, 0)),
  27456. function (e, t, i, n, r, o, a) {
  27457. var s = b.mapFaceToCubemapFace(i)
  27458. 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
  27459. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  27460. 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
  27461. h += l
  27462. }
  27463. return !1
  27464. })),
  27465. (b.isWithinFOV =
  27466. ((a = new _.Vector3()),
  27467. (s = new _.Vector3()),
  27468. function (e, t, i, n) {
  27469. if ((_.copyVector(e, s), n)) {
  27470. _.copyVector(n, a), _.normalize(a)
  27471. var r = _.dot(a, e)
  27472. ;(a.x *= r), (a.y *= r), (a.z *= r), _.subVector(s, a)
  27473. }
  27474. var o = (i / 2) * _.RADIANS_PER_DEGREE
  27475. return Math.cos(o) <= _.dot(s, t)
  27476. })),
  27477. (b.mapFaceToCubemapFace =
  27478. ((n = {
  27479. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  27480. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  27481. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  27482. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  27483. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  27484. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  27485. }),
  27486. function (e) {
  27487. return n[e]
  27488. })),
  27489. (t.exports = b)
  27490. },
  27491. {
  27492. '../enum/GLCubeFaces': 25,
  27493. '../util/MathLight': 176
  27494. }
  27495. ],
  27496. 175: [
  27497. function (i, n, e) {
  27498. ;(function (e) {
  27499. 'use strict'
  27500. function t() {
  27501. ;(this.list = []),
  27502. (this.index = {}),
  27503. Object.defineProperty(this, 'length', {
  27504. get: function () {
  27505. return this.list.length
  27506. }
  27507. })
  27508. }
  27509. new (i('./common'), i('./logger'))(e),
  27510. (t.prototype.forEach = function (e) {
  27511. this.list.forEach(e)
  27512. }),
  27513. (t.prototype.add = function (e) {
  27514. this.list.push(e), (this.index[this.getIndex(e)] = e)
  27515. }),
  27516. (t.prototype.getIndex = function (e) {
  27517. throw new Error('IndexedCollection.getIndex not implemented in subclass.')
  27518. }),
  27519. (t.prototype.extend = function (e) {
  27520. for (var t = 0; t < e.length; t++) this.add(e[t])
  27521. }),
  27522. (t.prototype.get = function (e) {
  27523. return this.index[e]
  27524. }),
  27525. (t.prototype.first = function () {
  27526. return this.list[0]
  27527. }),
  27528. (t.prototype.last = function () {
  27529. return this.list[this.list.length - 1]
  27530. }),
  27531. (t.prototype.reIndex = function () {
  27532. this.index = {}
  27533. var t = this
  27534. this.forEach(function (e) {
  27535. t.index[t.getIndex(e)] = e
  27536. })
  27537. }),
  27538. (t.prototype.filter = function (e) {
  27539. var t = this.list.filter(e)
  27540. return this.reIndex(), t
  27541. }),
  27542. (t.prototype.reduce = function (e, t) {
  27543. return this.list.reduce(e, t)
  27544. }),
  27545. (t.prototype.sort = function (e) {
  27546. return this.list.sort(e)
  27547. }),
  27548. (t.prototype.indexOf = function (e) {
  27549. for (var t = 0; t < this.list.length; ++t) if (this.list[t] === e) return t
  27550. return -1
  27551. }),
  27552. (n.exports = t)
  27553. }).call(this, '/js/util/IndexedCollection.js')
  27554. },
  27555. {
  27556. './common': 185,
  27557. './logger': 189
  27558. }
  27559. ],
  27560. 176: [
  27561. function (e, t, i) {
  27562. 'use strict'
  27563. e('../constants')
  27564. var n,
  27565. r,
  27566. o = {}
  27567. ;(o.RADIANS_PER_DEGREE = Math.PI / 180),
  27568. (o.DEGREES_PER_RADIAN = 180 / Math.PI),
  27569. (o.Vector3 = function (e, t, i) {
  27570. ;(this.x = e || 0), (this.y = t || 0), (this.z = i || 0)
  27571. }),
  27572. (o.Matrix4 = function () {
  27573. ;(this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])),
  27574. 0 < arguments.length && console.error('MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.')
  27575. }),
  27576. (o.Matrix4.prototype = {
  27577. identity: function () {
  27578. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  27579. },
  27580. copy: function (e) {
  27581. return this.elements.set(e.elements), this
  27582. },
  27583. applyToVector3: function (e) {
  27584. var t = e.x,
  27585. i = e.y,
  27586. n = e.z,
  27587. r = this.elements
  27588. 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
  27589. },
  27590. getInverse: function (e, t) {
  27591. var i = this.elements,
  27592. n = e.elements,
  27593. r = n[0],
  27594. o = n[1],
  27595. a = n[2],
  27596. s = n[3],
  27597. l = n[4],
  27598. c = n[5],
  27599. h = n[6],
  27600. u = n[7],
  27601. d = n[8],
  27602. p = n[9],
  27603. f = n[10],
  27604. g = n[11],
  27605. m = n[12],
  27606. v = n[13],
  27607. y = n[14],
  27608. A = n[15],
  27609. C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A,
  27610. I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A,
  27611. E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A,
  27612. _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y,
  27613. b = r * C + o * I + a * E + s * _
  27614. if (0 == b) {
  27615. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0"
  27616. if (t) throw new Error(w)
  27617. return console.warn(w), this.identity()
  27618. }
  27619. var T = 1 / b
  27620. return (
  27621. (i[0] = C * T),
  27622. (i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T),
  27623. (i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T),
  27624. (i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T),
  27625. (i[4] = I * T),
  27626. (i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T),
  27627. (i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T),
  27628. (i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T),
  27629. (i[8] = E * T),
  27630. (i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T),
  27631. (i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T),
  27632. (i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T),
  27633. (i[12] = _ * T),
  27634. (i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T),
  27635. (i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T),
  27636. (i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T),
  27637. this
  27638. )
  27639. },
  27640. makeRotationFromQuaternion: function (e) {
  27641. var t = this.elements,
  27642. i = e.x,
  27643. n = e.y,
  27644. r = e.z,
  27645. o = e.w,
  27646. a = i + i,
  27647. s = n + n,
  27648. l = r + r,
  27649. c = i * a,
  27650. h = i * s,
  27651. u = i * l,
  27652. d = n * s,
  27653. p = n * l,
  27654. f = r * l,
  27655. g = o * a,
  27656. m = o * s,
  27657. v = o * l
  27658. return (
  27659. (t[0] = 1 - (d + f)),
  27660. (t[4] = h - v),
  27661. (t[8] = u + m),
  27662. (t[1] = h + v),
  27663. (t[5] = 1 - (c + f)),
  27664. (t[9] = p - g),
  27665. (t[2] = u - m),
  27666. (t[6] = p + g),
  27667. (t[10] = 1 - (c + d)),
  27668. (t[3] = 0),
  27669. (t[7] = 0),
  27670. (t[11] = 0),
  27671. (t[12] = 0),
  27672. (t[13] = 0),
  27673. (t[14] = 0),
  27674. (t[15] = 1),
  27675. this
  27676. )
  27677. }
  27678. }),
  27679. (o.Quaternion = function (e, t, i, n) {
  27680. ;(this._x = e || 0), (this._y = t || 0), (this._z = i || 0), (this._w = void 0 !== n ? n : 1)
  27681. }),
  27682. (o.Quaternion.prototype = {
  27683. get x() {
  27684. return this._x
  27685. },
  27686. set x(e) {
  27687. this._x = e
  27688. },
  27689. get y() {
  27690. return this._y
  27691. },
  27692. set y(e) {
  27693. this._y = e
  27694. },
  27695. get z() {
  27696. return this._z
  27697. },
  27698. set z(e) {
  27699. this._z = e
  27700. },
  27701. get w() {
  27702. return this._w
  27703. },
  27704. set w(e) {
  27705. this._w = e
  27706. },
  27707. copy: function (e) {
  27708. ;(this._x = e.x), (this._y = e.y), (this._z = e.z), (this._w = e.w)
  27709. },
  27710. inverse: function () {
  27711. return this.conjugate().normalize()
  27712. },
  27713. conjugate: function () {
  27714. return (this._x *= -1), (this._y *= -1), (this._z *= -1), this
  27715. },
  27716. length: function () {
  27717. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27718. },
  27719. normalize: function () {
  27720. var e = this.length()
  27721. return (
  27722. 0 === e
  27723. ? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1))
  27724. : ((e = 1 / e), (this._x = this._x * e), (this._y = this._y * e), (this._z = this._z * e), (this._w = this._w * e)),
  27725. this
  27726. )
  27727. },
  27728. setFromAxisAngle: function (e, t) {
  27729. var i = t / 2,
  27730. n = Math.sin(i)
  27731. return (this._x = e.x * n), (this._y = e.y * n), (this._z = e.z * n), (this._w = Math.cos(i)), this
  27732. },
  27733. setFromUnitVectors: function (e, t) {
  27734. return (
  27735. void 0 === n && (n = new o.Vector3()),
  27736. (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),
  27737. (this._x = n.x),
  27738. (this._y = n.y),
  27739. (this._z = n.z),
  27740. (this._w = r),
  27741. this.normalize()
  27742. )
  27743. },
  27744. multiply: function (e) {
  27745. return this.multiplyQuaternions(this, e)
  27746. },
  27747. premultiply: function (e) {
  27748. return this.multiplyQuaternions(e, this)
  27749. },
  27750. multiplyQuaternions: function (e, t) {
  27751. var i = e._x,
  27752. n = e._y,
  27753. r = e._z,
  27754. o = e._w,
  27755. a = t._x,
  27756. s = t._y,
  27757. l = t._z,
  27758. c = t._w
  27759. 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
  27760. }
  27761. }),
  27762. (o.convertWorkshopVector = function (e) {
  27763. return new o.Vector3(-e.x, e.y, e.z)
  27764. }),
  27765. (o.convertWorkshopQuaternion = function (e) {
  27766. 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))
  27767. }),
  27768. (o.convertWorkshopOrthoZoom = function (e) {
  27769. return -1 === e ? -1 : ((e * ($('#player').width() / $('#player').height())) / g_snapShotWidth) * g_snapShotHeight
  27770. }),
  27771. (o.convertWorkshopPanoramaQuaternion = function (e) {
  27772. 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))
  27773. }),
  27774. (o.normalize = function (e) {
  27775. var t = e.x * e.x + e.y * e.y + e.z * e.z,
  27776. i = Math.sqrt(t)
  27777. ;(e.x /= i), (e.y /= i), (e.z /= i)
  27778. }),
  27779. (o.dot = function (e, t) {
  27780. return e.x * t.x + e.y * t.y + e.z * t.z
  27781. }),
  27782. (o.cross = function (e, t, i) {
  27783. var n = e.x,
  27784. r = e.y,
  27785. o = e.z
  27786. ;(i.x = r * t.z - o * t.y), (i.y = o * t.x - n * t.z), (i.z = n * t.y - r * t.x)
  27787. }),
  27788. (o.setVector = function (e, t, i, n) {
  27789. ;(e.x = t), (e.y = i), (e.z = n)
  27790. }),
  27791. (o.copyVector = function (e, t) {
  27792. ;(t.x = e.x), (t.y = e.y), (t.z = e.z)
  27793. }),
  27794. (o.addVector = function (e, t) {
  27795. ;(e.x += t.x), (e.y += t.y), (e.z += t.z)
  27796. }),
  27797. (o.subVector = function (e, t) {
  27798. ;(e.x -= t.x), (e.y -= t.y), (e.z -= t.z)
  27799. }),
  27800. (o.applyQuaternionToVector = function (e, t) {
  27801. var i = t.x,
  27802. n = t.y,
  27803. r = t.z,
  27804. o = e.x,
  27805. a = e.y,
  27806. s = e.z,
  27807. l = e.w,
  27808. c = l * i + a * r - s * n,
  27809. h = l * n + s * i - o * r,
  27810. u = l * r + o * n - a * i,
  27811. d = -o * i - a * n - s * r
  27812. ;(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)
  27813. }),
  27814. (o.angleBetweenVectors = function (e, t) {
  27815. return Math.acos(o.dot(e, t))
  27816. }),
  27817. (t.exports = o)
  27818. },
  27819. {
  27820. '../constants': 8
  27821. }
  27822. ],
  27823. 177: [
  27824. function (c, h, e) {
  27825. ;(function (e) {
  27826. 'use strict'
  27827. function t(e) {
  27828. ;(this.cache = null), (this.expires = 0)
  27829. }
  27830. function i() {
  27831. ;(this.baseUrl = null), (this.cache = null), (this.expires = 0)
  27832. }
  27833. function n() {
  27834. ;(this.baseUrl = null), (this.expires = 0)
  27835. }
  27836. function r(e) {
  27837. ;(this.initialLoadingPromise = null),
  27838. (this.endpoint = e + '?type=3'),
  27839. (this.urlContainer = null),
  27840. (this.authorizationHeader = s.getAuthorizationHeader()),
  27841. (this.containerClasses = [n, i, t])
  27842. }
  27843. c('./ajax')
  27844. var o = c('./logger'),
  27845. a = c('../constants'),
  27846. s = c('./showcase'),
  27847. l = (c('../ab'), new o(e))
  27848. ;(t.prototype = {
  27849. version: 1,
  27850. validate: function (e) {
  27851. return 'catalog.json' in e && 0 < Object.keys(e).length
  27852. },
  27853. update: function (e) {
  27854. return (this.cache = e), (this.expires = Date.now() + a.signedUrlDefaultExpireTime), $.when()
  27855. },
  27856. get: function (e) {
  27857. return this.cache[e]
  27858. }
  27859. }),
  27860. (i.prototype = {
  27861. version: 2,
  27862. validate: function (e) {
  27863. return 'catalog.json' in e && 'base.url' in e && 1 < Object.keys(e).length
  27864. },
  27865. update: function (e) {
  27866. return (this.baseUrl = e['base.url']), (this.cache = e), (this.expires = Date.now() + a.signedUrlDefaultExpireTime), $.when()
  27867. },
  27868. get: function (e) {
  27869. var t = this.cache[e]
  27870. return t ? this.baseUrl.replace('{{filename}}', e) + t : null
  27871. }
  27872. }),
  27873. (n.prototype = {
  27874. version: 3,
  27875. validate: function (e) {
  27876. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27877. },
  27878. update: function (e) {
  27879. return (this.baseUrl = e.templates[0]), e.expires ? (this.expires = 1e3 * e.expires) : (this.expires = Date.now() + a.signedUrlDefaultExpireTime), $.when()
  27880. },
  27881. get: function (e) {
  27882. return this.baseUrl.replace('{{filename}}', e)
  27883. }
  27884. }),
  27885. (r.prototype = {
  27886. init: function () {
  27887. return (
  27888. this.initialLoadingPromise ||
  27889. (setInterval(
  27890. function () {
  27891. var e = this.urlContainer ? this.urlContainer.expires : Date.now()
  27892. Date.now() + a.signedUrlRefreshBuffer > e &&
  27893. (l.debug('Refreshing urls...'),
  27894. this.refresh()
  27895. .done(function () {
  27896. l.debug('Refreshed')
  27897. })
  27898. .fail(function () {
  27899. l.error('Failed url refresh, urls might go stale soon')
  27900. }))
  27901. }.bind(this),
  27902. a.signedUrlCheckInterval
  27903. ),
  27904. (this.initialLoadingPromise = this.refresh())),
  27905. this.initialLoadingPromise
  27906. )
  27907. },
  27908. refresh: function (e) {
  27909. return {}, $.Deferred().resolve()
  27910. },
  27911. get: function (e) {
  27912. return window.DATA.files.templates[0].replace('{{filename}}', e)
  27913. }
  27914. }),
  27915. (h.exports = r)
  27916. }).call(this, '/js/util/ModelUrls.js')
  27917. },
  27918. {
  27919. '../ab': 3,
  27920. '../constants': 8,
  27921. './ajax': 181,
  27922. './logger': 189,
  27923. './showcase': 193
  27924. }
  27925. ],
  27926. 178: [
  27927. function (l, c, e) {
  27928. ;(function (e) {
  27929. 'use strict'
  27930. function t() {
  27931. i.call(this), (this.neighbourMap = {}), (this.map = null)
  27932. }
  27933. var f,
  27934. g,
  27935. m,
  27936. v,
  27937. y,
  27938. A,
  27939. C,
  27940. I,
  27941. E,
  27942. _,
  27943. b,
  27944. w = l('three'),
  27945. n = l('./common'),
  27946. a = l('../settings'),
  27947. r = l('../objects/Panorama'),
  27948. o = ((a = l('../settings')), l('./aStar')),
  27949. T = new (l('./logger'))(e),
  27950. i = l('./IndexedCollection'),
  27951. s = l('./transitions')
  27952. n.inherit(t, i),
  27953. (t.prototype.getIndex = function (e) {
  27954. return e.id
  27955. }),
  27956. (t.prototype.find = function (e, t) {
  27957. var i = n.filterAll(this.list, e)
  27958. return 0 === i.length
  27959. ? null
  27960. : (t &&
  27961. t.forEach(function (e) {
  27962. i = n.stableSort(i, e)
  27963. }),
  27964. i[0])
  27965. }),
  27966. /* t.prototype.sortByScore = function(e, t) {
  27967. var i = n.filterAll(this.list, e);
  27968. return 0 === i.length ? null : i = i.map(function(i) {
  27969. return {
  27970. pano: i,
  27971. score: t.reduce(function(e, t) {
  27972. return e + t(i)
  27973. }, 0)
  27974. }
  27975. }).sort(function(e, t) {
  27976. return t.score - e.score
  27977. })
  27978. } */
  27979. (t.prototype.sortByScore = function (request, rank) {
  27980. return common.sortByScore(this.list, request, rank)
  27981. }),
  27982. (t.prototype.lowestByScore = function (e, t, i) {
  27983. return this.findRankedByScore(0, e, t, i)
  27984. }),
  27985. (t.prototype.findRankedByScore = function (e, t, i, n) {
  27986. n && ((n.candidates = null), (n.pano = null)), (e = e || 0)
  27987. var r = this.sortByScore(t, i)
  27988. return !r || 0 === r.length || e >= r.length ? null : (n && ((n.candidates = r), (n.pano = r[e].item)), r[e].item)
  27989. }),
  27990. (t.prototype.showPanoScores = function (e) {
  27991. this.list.forEach(function (e) {
  27992. e.removeTextSprite()
  27993. })
  27994. var t = 6344768
  27995. e.forEach(function (e) {
  27996. e.pano.addTextSprite(e.score.toFixed(2), t), (t = 16428055)
  27997. })
  27998. }),
  27999. (t.prototype.isNeighbour = function (e, t) {
  28000. return this.neighbourMap[e.id][t.id]
  28001. }),
  28002. (t.prototype.getNeighbours = function (e) {
  28003. return this.neighbourMap[e.id]
  28004. }),
  28005. (t.prototype.setNeighbour = function (e, t, i) {
  28006. return (
  28007. this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  28008. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  28009. (this.neighbourMap[e.id][e.id] = !0),
  28010. (this.neighbourMap[t.id][t.id] = !0),
  28011. (this.neighbourMap[e.id][t.id] = i),
  28012. (this.neighbourMap[t.id][e.id] = i),
  28013. this.neighbourMap[e.id]
  28014. )
  28015. }),
  28016. (t.prototype.findClosest = function (e, t) {
  28017. var i = [r.filters.isPanoAligned()]
  28018. return t && i.push(r.filters.inDirection(e, t, 0.75)), this.find(i, [r.sortFunctions.distanceToPoint(e)])
  28019. }),
  28020. (t.prototype.dualNeighbors = function (e, t) {
  28021. var i,
  28022. n = []
  28023. for (i in this.neighbourMap[e.id]) this.neighbourMap[t.id][i] && n.push(i)
  28024. return n
  28025. }),
  28026. (t.prototype.populate_path_graph = function () {
  28027. var e,
  28028. t,
  28029. i,
  28030. n,
  28031. r,
  28032. o,
  28033. a,
  28034. s,
  28035. l = Date.now(),
  28036. c = {},
  28037. h = 0,
  28038. u = new w.Vector3(0, 0, 0)
  28039. for (e = 0; e < this.list.length; e += 1) {
  28040. for (t in ((s = !(a = {})), (i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())))
  28041. if (i[t]) {
  28042. ;(o = this.index[t]), u.copy(r.floorPosition), u.sub(o.floorPosition)
  28043. var d = Math.sqrt(u.x * u.x + u.z * u.z),
  28044. p = (Math.abs(u.y), Math.max(d, 0.01), Math.max(0, Math.abs(u.y) - 0.2))
  28045. ;(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)
  28046. }
  28047. s ? (c[r.id] = a) : (h += 1)
  28048. }
  28049. ;(this.map = c), T.info('graph ready in ' + (Date.now() - l) + 'ms, ' + h + ' had no neighbors')
  28050. }),
  28051. (t.prototype.aStarSearch = function (e, t) {
  28052. var i = Date.now(),
  28053. n = new o({
  28054. start: e,
  28055. isEnd: function (e) {
  28056. return e === t
  28057. },
  28058. neighbor: function (e) {
  28059. var t = e.neighbourPanos || e.findNeighourPanos(),
  28060. i = []
  28061. for (var n in t) t[n] && i.push(this.index[n]) //add: t[n] &&
  28062. return i
  28063. }.bind(this),
  28064. distance: function (e, t) {
  28065. return this.map[e.id][t.id]
  28066. }.bind(this),
  28067. heuristic: function (e, t) {
  28068. return 1
  28069. }.bind(this),
  28070. hash: function (e) {
  28071. return e.id
  28072. },
  28073. timeout: 5e3
  28074. })
  28075. 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
  28076. T.debug('Total cost ' + n.cost.toPrecision(3) + ', ' + n.path.length + ' steps')
  28077. var r = []
  28078. return (
  28079. n.path.forEach(function (e) {
  28080. r.push(e.id)
  28081. }),
  28082. r
  28083. )
  28084. }),
  28085. (t.prototype.includeNodesNearPath =
  28086. ((f = new w.Vector3()),
  28087. (g = new w.Vector3()),
  28088. (m = new w.Vector3()),
  28089. (v = new w.Vector3()),
  28090. (y = new w.Vector3()),
  28091. (A = new w.Vector3()),
  28092. (C = new w.Vector3()),
  28093. (I = new w.Vector3()),
  28094. (E = []),
  28095. (_ = new w.Vector3()),
  28096. (b = new w.Vector3()),
  28097. function (e, t) {
  28098. if (e)
  28099. for (
  28100. var i = function (e, t, i) {
  28101. return y.copy(t).sub(e), y.dot(i)
  28102. },
  28103. n = function (e, t) {
  28104. return i(_, e.position, m) - i(_, t.position, m)
  28105. },
  28106. r = 0;
  28107. r < e.length - 1;
  28108. ) {
  28109. var o = e[r],
  28110. a = e[r + 1],
  28111. s = this.index[o],
  28112. l = this.index[a]
  28113. _.copy(s.position), b.copy(l.position), (E.length = 0), f.copy(b).sub(_), m.copy(f).normalize()
  28114. for (var c = 0; c < this.list.length; c++) {
  28115. var h = this.list[c]
  28116. y.copy(h.position).sub(_)
  28117. var u = y.dot(m)
  28118. 0 < u &&
  28119. (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)))
  28120. }
  28121. if (0 < E.length) {
  28122. E.sort(n)
  28123. for (var d = e.length + E.length - 1; d >= r + E.length; d--) e[d] = e[d - E.length]
  28124. for (var p = 0; p < E.length; p++) e[p + r + 1] = E[p].id
  28125. }
  28126. r += E.length + 1
  28127. }
  28128. })),
  28129. /* t.prototype.fadeMarkerOpacity = function(e, t) {
  28130. var i = void 0 === e ? a.panorama.markerOpacity : e
  28131. , n = this.list.findIndex(function(e) {
  28132. return e.marker
  28133. });
  28134. if (!(n < 0)) {
  28135. var r = this.list[n].marker.material.opacity;
  28136. if (r !== e) {
  28137. var o = i - r;
  28138. s.trigger({
  28139. func: function(e, t) {
  28140. var i = r + e * o;
  28141. this.forEach(function(e) {
  28142. e.marker && (e.marker.material.opacity = i)
  28143. })
  28144. }
  28145. .bind(this),
  28146. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  28147. name: "_fpm"
  28148. })
  28149. }
  28150. }
  28151. } */
  28152. (t.prototype.fadeMarkerOpacity = function (e, t, gr) {
  28153. s.cancelById('fadeMarkerOpacity')
  28154. var n = this.list.findIndex(function (e) {
  28155. //why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  28156. return e.marker
  28157. })
  28158. if (n < 0) {
  28159. //logger.info('marker findIndex<0')
  28160. return
  28161. }
  28162. var group
  28163. var tran = function (list, index) {
  28164. list.member = list.member.filter(function (m) {
  28165. return m.marker && m.marker.material.opacity != list.toOp
  28166. })
  28167. s.trigger({
  28168. func: function (e, t) {
  28169. //e:0-1
  28170. list.member.forEach(function (m) {
  28171. var o = m.marker.oldOpacity
  28172. var i = o + e * (list.toOp - o)
  28173. m.marker && (m.marker.material.opacity = i)
  28174. })
  28175. }.bind(this),
  28176. duration: void 0 == t ? a.markerOpacityTransitionTime : t,
  28177. name: '_fpm_' + index,
  28178. id: 'fadeMarkerOpacity'
  28179. })
  28180. }
  28181. this.forEach(function (e) {
  28182. //先记录旧的opacity
  28183. e.marker && (e.marker.oldOpacity = e.marker.material.opacity)
  28184. })
  28185. group = gr
  28186. /* if (e > 0 && gr) {
  28187. group = gr
  28188. } else {
  28189. group = [
  28190. {
  28191. member: this.list,
  28192. toOp: 0,
  28193. },
  28194. ]
  28195. } */
  28196. for (var i = 0; i < group.length; i++) {
  28197. tran(group[i], i)
  28198. }
  28199. }),
  28200. (c.exports = t)
  28201. }).call(this, '/js/util/PanoramaCollection.js')
  28202. },
  28203. {
  28204. '../objects/Panorama': 148,
  28205. '../settings': 166,
  28206. './IndexedCollection': 175,
  28207. './aStar': 180,
  28208. './common': 185,
  28209. './logger': 189,
  28210. './transitions': 195,
  28211. three: 217
  28212. }
  28213. ],
  28214. 179: [
  28215. function (e, t, i) {
  28216. 'use strict'
  28217. function n() {
  28218. ;(this.actionSequence = []), (this.actionSequenceInProgress = !1)
  28219. }
  28220. function r(e, t, i, n) {
  28221. c.trackAlways('zoom_' + e, {
  28222. from: t,
  28223. to: i,
  28224. pano: n
  28225. })
  28226. }
  28227. var o,
  28228. a,
  28229. s,
  28230. l,
  28231. c = e('../analytics')
  28232. ;(n.prototype.reset = function (e) {
  28233. ;(this.actionSequenceInProgress = !1), (this.actionSequence.length = 0)
  28234. }),
  28235. (n.prototype.addZoomAction =
  28236. ((a = o = null),
  28237. (s = !1),
  28238. (l = function () {
  28239. if (((o = null), 0 < this.actionSequence.length)) {
  28240. var e = this.actionSequence[0].start,
  28241. t = this.actionSequence[this.actionSequence.length - 1].end
  28242. 1 === e
  28243. ? (function (e, t) {
  28244. r('initial', 1, e, t)
  28245. })(t, a)
  28246. : (function (e, t, i) {
  28247. r('followup', e, t, i)
  28248. })(e, t, a)
  28249. }
  28250. this.reset()
  28251. }),
  28252. function (e, t, i) {
  28253. if (e !== t) {
  28254. s || ((l = l.bind(this)), (s = !0)),
  28255. o && (window.clearTimeout(o), (o = null)),
  28256. (i === a && this.actionSequenceInProgress) || (this.reset(), (a = i)),
  28257. (this.actionSequenceInProgress = !0)
  28258. var n = {
  28259. start: e,
  28260. end: t
  28261. }
  28262. this.actionSequence.push(n), (o = window.setTimeout(l, 150))
  28263. }
  28264. })),
  28265. (t.exports = n)
  28266. },
  28267. {
  28268. '../analytics': 4
  28269. }
  28270. ],
  28271. 180: [
  28272. function (e, t, i) {
  28273. 'use strict'
  28274. function g(e) {
  28275. if (void 0 === e.parent) return [e.data]
  28276. var t = g(e.parent)
  28277. return t.push(e.data), t
  28278. }
  28279. function m(e) {
  28280. return e.toString()
  28281. }
  28282. function v(e, t) {
  28283. return e.f - t.f
  28284. }
  28285. var y = e('Set'),
  28286. A = e('heap'),
  28287. C = e('dict')
  28288. t.exports = function (e) {
  28289. void 0 === e.timeout && (e.timeout = 1 / 0)
  28290. var t = e.hash || m,
  28291. i = {
  28292. data: e.start,
  28293. g: 0,
  28294. h: e.heuristic(e.start)
  28295. },
  28296. n = i
  28297. i.f = i.h
  28298. var r = new y(),
  28299. o = new A(v),
  28300. a = C()
  28301. o.push(i), a.set(t(i.data), i)
  28302. for (var s = new Date(); o.size(); ) {
  28303. if (new Date() - s > e.timeout)
  28304. return {
  28305. status: 'timeout',
  28306. cost: n.g,
  28307. path: g(n)
  28308. }
  28309. var l = o.pop()
  28310. if ((a.delete(t(l.data)), e.isEnd(l.data)))
  28311. return {
  28312. status: 'success',
  28313. cost: l.g,
  28314. path: g(l)
  28315. }
  28316. r.add(t(l.data))
  28317. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  28318. var u = c[h]
  28319. if (!r.contains(t(u))) {
  28320. var d = l.g + e.distance(l.data, u),
  28321. p = a.get(t(u)),
  28322. f = !1
  28323. if (void 0 === p)
  28324. (p = {
  28325. data: u
  28326. }),
  28327. a.set(t(u), p)
  28328. else {
  28329. if (p.g < d) continue
  28330. f = !0
  28331. }
  28332. ;(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)
  28333. }
  28334. }
  28335. }
  28336. return {
  28337. status: 'noPath',
  28338. cost: n.g,
  28339. path: g(n)
  28340. }
  28341. }
  28342. },
  28343. {
  28344. Set: 196,
  28345. dict: 210,
  28346. heap: 211
  28347. }
  28348. ],
  28349. 181: [
  28350. function (i, n, e) {
  28351. ;(function (e) {
  28352. 'use strict'
  28353. function s(e, t, i) {
  28354. function n() {
  28355. l.warn('Retrying ', t), s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  28356. }
  28357. var r = (function (e, t, i) {
  28358. var n = new XMLHttpRequest()
  28359. if (i && 'withCredentials' in n) n.open(e, t, i)
  28360. else if ('undefined' != typeof XDomainRequest) (n = new XDomainRequest()).open(e, t)
  28361. else {
  28362. if (i) throw 'Browser does not support CORS!'
  28363. n.open(e, t)
  28364. }
  28365. return n
  28366. })(e, t, !1)
  28367. if ((((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0), (i.retry = void 0 !== i.retry ? i.retry : 'get' === e.toLowerCase()), i.responseType))
  28368. if (-1 < ['arraybuffer', 'text', 'json'].indexOf(i.responseType)) r.responseType = i.responseType
  28369. else {
  28370. if ('image/jpeg' !== i.responseType) throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"')
  28371. r.responseType = 'arraybuffer'
  28372. }
  28373. if (
  28374. ('json' === i.responseType && r.setRequestHeader('Accept', 'application/json'),
  28375. i.auth && r.setRequestHeader('Authorization', i.auth),
  28376. 'object' == typeof i.data && ((i.data = JSON.stringify(i.data)), r.setRequestHeader('Content-Type', 'application/json')),
  28377. 'object' == typeof i.headers)
  28378. )
  28379. for (var o in i.headers) r.setRequestHeader(o, i.headers[o])
  28380. var a = $.Deferred()
  28381. return (
  28382. (r.onreadystatechange = function (e) {
  28383. if (4 === this.readyState)
  28384. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3) i.retries++, setTimeout(n, 1e3)
  28385. else if (200 === this.status) {
  28386. var t = (function (e, t) {
  28387. var i = e.response
  28388. if ('json' === t && 'object' != typeof i)
  28389. try {
  28390. i = JSON.parse(e.responseText)
  28391. } catch (e) {
  28392. return void a.reject({
  28393. error: 'Failed parsing JSON'
  28394. })
  28395. }
  28396. else if ('image/jpeg' === t) {
  28397. var n = new Uint8Array(e.response),
  28398. r = new Blob([n], {
  28399. type: 'image/jpeg'
  28400. }),
  28401. o = URL.createObjectURL(r)
  28402. ;((i = new Image()).src = o),
  28403. (i.crossOrigin = 'Anonymous'),
  28404. (i.onload = function () {
  28405. URL.revokeObjectURL(o)
  28406. })
  28407. }
  28408. return i
  28409. })(this, i.responseType)
  28410. a.resolve(t)
  28411. } else a.reject(this)
  28412. }),
  28413. (r.onprogress = function (e) {
  28414. a.notify(e)
  28415. }),
  28416. r.send(i.data),
  28417. a.promise()
  28418. )
  28419. }
  28420. function o(e, t) {
  28421. var i = e + '__' + (t.responseType || null) + '__' + (t.auth || null) + '__' + (t.prefetchFrom || null)
  28422. return (
  28423. t.headers &&
  28424. (function (t) {
  28425. return Object.keys(t)
  28426. .sort()
  28427. .map(function (e) {
  28428. return {
  28429. key: e,
  28430. value: t[e]
  28431. }
  28432. })
  28433. })(t.headers).forEach(function (e) {
  28434. i += '__' + e.key + ':' + e.value
  28435. }),
  28436. i
  28437. )
  28438. }
  28439. var t = i('./logger'),
  28440. a = i('../ab'),
  28441. l = new t(e)
  28442. ;(window.URL = window.URL || window.webkitURL),
  28443. (window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {}),
  28444. (window.DATA = window.DATA || {}),
  28445. (n.exports = {
  28446. get: function (e, t) {
  28447. var i,
  28448. n = void 0 === (t = t || {}).cache || t.cache
  28449. if (n) {
  28450. var r = (function (e, t) {
  28451. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  28452. })(e, t)
  28453. if (r) return r
  28454. }
  28455. return (
  28456. (i = t.prefetchFrom && window.DATA[t.prefetchFrom] ? $.when(window.DATA[t.prefetchFrom]) : s('GET', e, t)),
  28457. n &&
  28458. (function (e, t, i) {
  28459. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  28460. })(e, t, i),
  28461. i
  28462. )
  28463. },
  28464. post: function (e, t) {
  28465. return s('POST', e, t)
  28466. },
  28467. patch: function (e, t) {
  28468. return s('PATCH', e, t)
  28469. },
  28470. getImage: function (e, t) {
  28471. function i() {
  28472. l.warn('Retrying ', e),
  28473. o
  28474. .getImage(e, t - 1)
  28475. .done(n.resolve.bind(n))
  28476. .progress(n.notify.bind(n))
  28477. .fail(n.reject.bind(n))
  28478. }
  28479. var n = $.Deferred(),
  28480. r = new Image(),
  28481. o = this
  28482. return (
  28483. (e = a.changeIfImageOptimzing(e)),
  28484. null != t || (t = 3),
  28485. (r.onerror = function () {
  28486. 0 < t ? setTimeout(i, 1e3) : n.reject()
  28487. }),
  28488. (r.onload = function () {
  28489. n.resolve(r)
  28490. }),
  28491. (r.crossOrigin = 'anonymous'),
  28492. (r.src = e),
  28493. n
  28494. )
  28495. }
  28496. })
  28497. }).call(this, '/js/util/ajax.js')
  28498. },
  28499. {
  28500. '../ab': 3,
  28501. './logger': 189
  28502. }
  28503. ],
  28504. 182: [
  28505. function (e, t, i) {
  28506. 'use strict'
  28507. function n(e, t) {
  28508. var i = window.navigator.userAgent.match(e)
  28509. return (
  28510. (i = i ? i[1].split(t) : []),
  28511. {
  28512. major: parseInt(i[0]) || 0,
  28513. minor: parseInt(i[1]) || 0,
  28514. patch: parseInt(i[2]) || 0
  28515. }
  28516. )
  28517. }
  28518. var r = e('../exception/DeviceMismatchException')
  28519. t.exports = {
  28520. supportsFullscreen: function () {
  28521. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28522. },
  28523. isPointerLocked: function () {
  28524. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28525. },
  28526. requestFullscreen: function (e, t) {
  28527. e.requestFullscreen
  28528. ? e.requestFullscreen()
  28529. : e.mozRequestFullScreen
  28530. ? e.mozRequestFullScreen()
  28531. : e.webkitRequestFullscreen
  28532. ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)
  28533. : e.msRequestFullscreen && e.msRequestFullscreen(),
  28534. t && $(document).on('fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange', browser.requestPointerLock)
  28535. },
  28536. requestPointerLock: function () {
  28537. var e
  28538. if (document.fullscreenElement) e = document.fullscreenElement()
  28539. else if (document.mozFullscreenElement) e = document.mozFullscreenElement()
  28540. else if (document.mozFullScreenElement) e = document.mozFullScreenElement()
  28541. else {
  28542. if (!document.webkitFullscreenElement) return
  28543. e = document.webkitFullscreenElement()
  28544. }
  28545. ;(e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock),
  28546. e.requestPointerLock(),
  28547. $(document).off('fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange', this)
  28548. },
  28549. exitPointerLock: function () {
  28550. ;(document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock), document.exitPointerLock()
  28551. },
  28552. exitFullscreen: function () {
  28553. document.exitFullscreen
  28554. ? document.exitFullscreen()
  28555. : document.msExitFullscreen
  28556. ? document.msExitFullscreen()
  28557. : document.mozCancelFullScreen
  28558. ? document.mozCancelFullScreen()
  28559. : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28560. },
  28561. details: function () {
  28562. var e = navigator.userAgent.match('(Firefox|Chrome|Safari)/([\\d]+)')
  28563. return e
  28564. ? {
  28565. name: e[1],
  28566. version: parseInt(e[2]),
  28567. platform: navigator.platform
  28568. }
  28569. : {}
  28570. },
  28571. is: function (e) {
  28572. return this.details() && this.details().name === e
  28573. },
  28574. inIframe: function () {
  28575. return window.parent !== window
  28576. },
  28577. aspectRatio: function () {
  28578. var e = $('#player').width() / $('#player').height()
  28579. return isFinite(e) ? e : 0
  28580. },
  28581. userAgent: function () {
  28582. return window.navigator.userAgent
  28583. },
  28584. isLandscape: function () {
  28585. return this.isMobile && 1 < this.aspectRatio()
  28586. },
  28587. isSmallScreen: function () {
  28588. return screen.width / window.devicePixelRatio < 240
  28589. },
  28590. detectIE: function () {
  28591. return -1 !== window.navigator.userAgent.indexOf('MSIE ') || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28592. },
  28593. detectSafari: function () {
  28594. return -1 !== window.navigator.userAgent.indexOf('Safari') && !this.detectChrome()
  28595. },
  28596. detectFirefox: function () {
  28597. return -1 !== window.navigator.userAgent.indexOf('Firefox')
  28598. },
  28599. detectChrome: function () {
  28600. return -1 !== window.navigator.userAgent.indexOf('Chrome') && !this.detectOpera()
  28601. },
  28602. detectOpera: function () {
  28603. return -1 !== window.navigator.userAgent.indexOf('OPR')
  28604. },
  28605. detectIOS: function () {
  28606. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28607. },
  28608. detectIPad: function () {
  28609. var e = window.navigator.userAgent
  28610. return /iPad/.test(e)
  28611. },
  28612. detectIPod: function () {
  28613. var e = window.navigator.userAgent
  28614. return /iPod/.test(e)
  28615. },
  28616. detectIPhone: function () {
  28617. var e = window.navigator.userAgent
  28618. return /iPhone/.test(e)
  28619. },
  28620. detectAndroid: function () {
  28621. return -1 !== window.navigator.userAgent.indexOf('Android')
  28622. },
  28623. detectAndroidMobile: function () {
  28624. var e = window.navigator.userAgent
  28625. return this.detectAndroid() && -1 !== e.indexOf('Mobile')
  28626. },
  28627. detectSamsungNative: function () {
  28628. var e = window.navigator.userAgent
  28629. return -1 !== e.indexOf('SM-G900H') || -1 !== e.indexOf('GT-I9500') || -1 !== e.indexOf('SM-N900')
  28630. },
  28631. detectSamsungS6: function () {
  28632. return -1 !== window.navigator.userAgent.indexOf('SM-G92')
  28633. },
  28634. detectHUAWEI5X: function () {
  28635. return -1 !== window.navigator.userAgent.indexOf('KIW-TL00H')
  28636. },
  28637. detectWebVR: function () {
  28638. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28639. },
  28640. getVRDisplay: function () {
  28641. var t = $.Deferred()
  28642. return this.detectWebVR()
  28643. ? (navigator.getVRDisplays().then(function (e) {
  28644. 1 <= e.length && t.resolve(e[0]), t.reject(null)
  28645. }),
  28646. t)
  28647. : t.reject(null)
  28648. },
  28649. iosVersion: function () {
  28650. if (!this.detectIOS()) throw new r('Did not detect an iDevice')
  28651. return n(/((?:\d+\_?){1,3}) like Mac OS/, '_')
  28652. },
  28653. androidVersion: function () {
  28654. if (!this.detectAndroid()) throw new r('Did not detect an Android based device')
  28655. return n(/Android ((?:\d+\.?){1,3})/, '.')
  28656. },
  28657. valueFromCookie: function (e, t) {
  28658. var i = new RegExp(e + '=([0-9a-f]+)(; ?|$)').exec(document.cookie)
  28659. if (!i) return t
  28660. var n = i[1]
  28661. return 'boolean' == typeof t ? 'true' === n || '1' === n : 'number' == typeof t ? parseFloat(n) : n
  28662. }
  28663. }
  28664. Object.assign(window.browser, t.exports)
  28665. t.exports = window.browser
  28666. },
  28667. {
  28668. '../exception/DeviceMismatchException': 56
  28669. }
  28670. ],
  28671. 183: [
  28672. function (i, n, e) {
  28673. ;(function (e) {
  28674. 'use strict'
  28675. var o = i('../controls/serializer'),
  28676. a = i('../util/math'),
  28677. s = i('./browser'),
  28678. l = i('../enum/Viewmode'),
  28679. t = i('../util/logger'),
  28680. c = i('three'),
  28681. h = new t(e)
  28682. n.exports = {
  28683. getStartCameraOptions: function (e, t) {
  28684. var i = (function (e) {
  28685. var t = s.valueFromHash('start', ''),
  28686. i = {}
  28687. if ('' !== t) {
  28688. h.debug('Start override found in parameters, trying to parse...'),
  28689. (i =
  28690. (function (e) {
  28691. return o.deserialize(e)
  28692. })(t) || {})
  28693. var n = s.valueFromHash('tag', null)
  28694. n && (i.tag = n), i.panoId && (i.pano = e.get(i.panoId))
  28695. }
  28696. return i
  28697. })(t)
  28698. if (0 < Object.keys(i).length) return i
  28699. if (e.heroImage)
  28700. i = (function (e, t) {
  28701. if (!e.heroImage || !e.heroImage.metadata.camera_position) return {}
  28702. var i = {},
  28703. n = e.heroImage.metadata
  28704. h.debug('Using start position from thumbnail image'), (i.position = n.camera_position), (i.quaternion = n.camera_quaternion)
  28705. try {
  28706. ;(i.mode = l.convertWorkshopModeInt(n.camera_mode)), i.mode === l.PANORAMA ? (i.pano = t.get(n.scan_id)) : (i.floorVisibility = n.floor_visibility)
  28707. } catch (e) {
  28708. h.debug(e.message)
  28709. }
  28710. return i
  28711. })(e, t)
  28712. else if (window.DATA.camera_start) {
  28713. var n = window.DATA.camera_start
  28714. try {
  28715. 0 < Object.keys(n).length &&
  28716. !a.isEmptyQuaternion(n.camera.quaternion) &&
  28717. ((i.mode = l.convertWorkshopModeInt(n.mode)),
  28718. (i.position = new c.Vector3().fromArray(n.camera.position)),
  28719. (i.quaternion = new c.Quaternion().fromArray(n.camera.quaternion)),
  28720. (i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom)),
  28721. n.pano &&
  28722. ((i.pano = t.get(n.pano.uuid) || t.findClosest(i.position)),
  28723. h.debug('Using camera_start'),
  28724. h.debug('Modeldata pano: ', i.pano.quaternion),
  28725. h.debug('Camera start pano: ', n.pano.quaternion)),
  28726. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  28727. } catch (e) {
  28728. h.warn(e.message)
  28729. if (i.mode == 'panorama' && !i.pano) {
  28730. i.pano = t.list[0]
  28731. }
  28732. }
  28733. }
  28734. if (
  28735. (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28736. i.mode === l.MESH && i.position && ((i.mode = l.PANORAMA), (i.pano = t.findClosest(i.position)), (i.quaternion = i.pano.quaternion)),
  28737. 0 === Object.keys(i).length)
  28738. ) {
  28739. var r = t.list[0]
  28740. r && ((i.mode = l.PANORAMA), (i.pano = r), (i.position = r.position), (i.quaternion = r.quaternion), h.info('Starting at 1st pano ' + r.id))
  28741. }
  28742. return (i.mode = i.mode || l.DOLLHOUSE), i
  28743. }
  28744. }
  28745. }).call(this, '/js/util/camera.js')
  28746. },
  28747. {
  28748. '../controls/serializer': 14,
  28749. '../enum/Viewmode': 51,
  28750. '../util/logger': 189,
  28751. '../util/math': 190,
  28752. './browser': 182,
  28753. three: 217
  28754. }
  28755. ],
  28756. 184: [
  28757. function (e, t, i) {
  28758. 'use strict'
  28759. function r(e, t, i) {
  28760. var n = t,
  28761. r = i
  28762. return 2 * Math.atan(Math.tan((e * a.RADIANS_PER_DEGREE) / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28763. }
  28764. function o(e, t, i) {
  28765. var n = t,
  28766. r = i
  28767. return 2 * Math.atan(Math.tan((e * a.RADIANS_PER_DEGREE) / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28768. }
  28769. var a = e('./MathLight')
  28770. t.exports = {
  28771. clampVFOV: function (e, t, i, n) {
  28772. return t < r(e, i, n) ? o(t, i, n) : e
  28773. },
  28774. getHFOVForCamera: function (e, t, i) {
  28775. return r(e.fov, t, i)
  28776. },
  28777. getHFOVFromVFOV: r,
  28778. getVFOVFromHFOV: o
  28779. }
  28780. window.MathLight = t.exports
  28781. MathLight.closeTo = function (e1, e2, precision) {
  28782. //xzw add 判断e1,e2是否接近
  28783. var prec = Math.pow(10, -(precision || 4))
  28784. var s1 = Math.abs(e1.x - e2.x) < prec && Math.abs(e1.y - e2.y) < prec && Math.abs(e1.z - e2.z) < prec
  28785. if (e1.w) {
  28786. return s1 && Math.abs(e1.w - e2.w) < prec
  28787. } else return s1
  28788. }
  28789. },
  28790. {
  28791. './MathLight': 176
  28792. }
  28793. ],
  28794. 185: [
  28795. function (e, t, i) {
  28796. 'use strict'
  28797. var a = e('three')
  28798. ;(t.exports = {
  28799. delayOneFrame: function (e) {
  28800. window.setTimeout(e, 1)
  28801. },
  28802. normalizeUrl: function (e) {
  28803. return e.replace('https://', 'http://')
  28804. },
  28805. domainFromUrl: function (e) {
  28806. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e)
  28807. return t ? t[3] : e
  28808. },
  28809. average: function (e, t) {
  28810. if (0 === e.length) return null
  28811. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28812. ;(i += t ? e[r][t] : e[r]), n++
  28813. }
  28814. return i / n
  28815. },
  28816. countUnique: function (e) {
  28817. for (var t = {}, i = 0; i < e.length; i++) t[e[i]] = 1 + (t[e[i]] || 0)
  28818. return Object.keys(t).length
  28819. },
  28820. averageVectors: function (e, t) {
  28821. var i = new a.Vector3()
  28822. if (0 === e.length) return i
  28823. for (var n = 0, r = 0; r < e.length; r++) {
  28824. var o = t ? e[r][t] : e[r]
  28825. i.add(o), n++
  28826. }
  28827. return i.divideScalar(n)
  28828. },
  28829. equalLists: function (e, t) {
  28830. if (e.length !== t.length) return !1
  28831. for (var i = 0; i < e.length; i++) if (e[i] !== t[i]) return !1
  28832. return !0
  28833. },
  28834. lowerMedian: function (e, t) {
  28835. return 0 === e.length
  28836. ? null
  28837. : ((t = t || 2),
  28838. e.sort(function (e, t) {
  28839. return e - t
  28840. }),
  28841. e[Math.floor(e.length / t)])
  28842. },
  28843. stableSort: function (e, n) {
  28844. return e
  28845. .map(function (e, t) {
  28846. return {
  28847. value: e,
  28848. index: t
  28849. }
  28850. })
  28851. .sort(function (e, t) {
  28852. var i = n(e.value, t.value)
  28853. return 0 !== i ? i : e.index - t.index
  28854. })
  28855. .map(function (e) {
  28856. return e.value
  28857. })
  28858. },
  28859. filterAll: function (e, i) {
  28860. return e.filter(function (t) {
  28861. return i.every(function (e) {
  28862. return e(t)
  28863. })
  28864. })
  28865. },
  28866. formatDate: function (e) {
  28867. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join('-')
  28868. },
  28869. formatDatetime: function (e) {
  28870. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join('-')
  28871. },
  28872. randomString: function (e) {
  28873. for (var t = '', i = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', n = 0; n < e; n++) t += i.charAt(Math.floor(Math.random() * i.length))
  28874. return t
  28875. },
  28876. uint8ToBase64: function (e, t) {
  28877. ;(t && 'number' == typeof t) || (t = 8192)
  28878. for (var i = [], n = 0; n < e.length; n += t) i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)))
  28879. return btoa(i.join(''))
  28880. },
  28881. uuid4: function e(t) {
  28882. return t ? (t ^ ((16 * Math.random()) >> (t / 4))).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28883. },
  28884. nth: function (e) {
  28885. return 1 === (e %= 10) ? e + 'st' : 2 === e ? e + 'nd' : 3 === e ? e + 'rd' : e + 'th'
  28886. },
  28887. extendObject: function (t, i) {
  28888. return (
  28889. Object.keys(i).forEach(function (e) {
  28890. t[e] = i[e]
  28891. }),
  28892. t
  28893. )
  28894. },
  28895. deepExtend: function e(t) {
  28896. t = t || {}
  28897. for (var i = 1; i < arguments.length; i++) {
  28898. var n = arguments[i]
  28899. 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]))
  28900. }
  28901. return t
  28902. },
  28903. inherit: function (e, t) {
  28904. ;(e.prototype = Object.create(t.prototype)), (e.prototype.constructor = e)
  28905. },
  28906. extend: function (e, t) {
  28907. for (var i in t.prototype) e.prototype[i] = t.prototype[i]
  28908. },
  28909. getFileNameFromUrl: function (url) {
  28910. return url.split('/').pop()
  28911. }
  28912. }),
  28913. (Math.sign = function (e) {
  28914. return e < 0 ? -1 : 1
  28915. })
  28916. window.common = t.exports
  28917. expandCommon(common)
  28918. },
  28919. {
  28920. three: 217
  28921. }
  28922. ],
  28923. 186: [
  28924. function (e, t, i) {
  28925. 'use strict'
  28926. var r = {
  28927. linearTween: function (e, t, i, n) {
  28928. return (i * e) / n + t
  28929. },
  28930. easeInQuad: function (e, t, i, n) {
  28931. return i * (e /= n) * e + t
  28932. },
  28933. easeOutQuad: function (e, t, i, n) {
  28934. return -i * (e /= n) * (e - 2) + t
  28935. },
  28936. easeInOutQuad: function (e, t, i, n) {
  28937. return (e /= n / 2) < 1 ? (i / 2) * e * e + t : (-i / 2) * (--e * (e - 2) - 1) + t
  28938. },
  28939. easeInCubic: function (e, t, i, n) {
  28940. return i * (e /= n) * e * e + t
  28941. },
  28942. easeOutCubic: function (e, t, i, n) {
  28943. return (e /= n), i * (--e * e * e + 1) + t
  28944. },
  28945. easeInOutCubic: function (e, t, i, n) {
  28946. return (e /= n / 2) < 1 ? (i / 2) * e * e * e + t : (i / 2) * ((e -= 2) * e * e + 2) + t
  28947. },
  28948. easeInQuart: function (e, t, i, n) {
  28949. return i * (e /= n) * e * e * e + t
  28950. },
  28951. easeOutQuart: function (e, t, i, n) {
  28952. return (e /= n), -i * (--e * e * e * e - 1) + t
  28953. },
  28954. easeInOutQuart: function (e, t, i, n) {
  28955. return (e /= n / 2) < 1 ? (i / 2) * e * e * e * e + t : (-i / 2) * ((e -= 2) * e * e * e - 2) + t
  28956. },
  28957. easeInQuint: function (e, t, i, n) {
  28958. return i * (e /= n) * e * e * e * e + t
  28959. },
  28960. easeOutQuint: function (e, t, i, n) {
  28961. return (e /= n), i * (--e * e * e * e * e + 1) + t
  28962. },
  28963. easeInOutQuint: function (e, t, i, n) {
  28964. return (e /= n / 2) < 1 ? (i / 2) * e * e * e * e * e + t : (i / 2) * ((e -= 2) * e * e * e * e + 2) + t
  28965. },
  28966. easeInSine: function (e, t, i, n) {
  28967. return -i * Math.cos((e / n) * (Math.PI / 2)) + i + t
  28968. },
  28969. easeOutSine: function (e, t, i, n) {
  28970. return i * Math.sin((e / n) * (Math.PI / 2)) + t
  28971. },
  28972. easeInOutSine: function (e, t, i, n) {
  28973. return (-i / 2) * (Math.cos((Math.PI * e) / n) - 1) + t
  28974. },
  28975. easeInExpo: function (e, t, i, n) {
  28976. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28977. },
  28978. easeOutExpo: function (e, t, i, n) {
  28979. return i * (1 - Math.pow(2, (-10 * e) / n)) + t
  28980. },
  28981. easeInOutExpo: function (e, t, i, n) {
  28982. return (e /= n / 2) < 1 ? (i / 2) * Math.pow(2, 10 * (e - 1)) + t : (e--, (i / 2) * (2 - Math.pow(2, -10 * e)) + t)
  28983. },
  28984. easeInCirc: function (e, t, i, n) {
  28985. return (e /= n), -i * (Math.sqrt(1 - e * e) - 1) + t
  28986. },
  28987. easeOutCirc: function (e, t, i, n) {
  28988. return (e /= n), e--, i * Math.sqrt(1 - e * e) + t
  28989. },
  28990. easeInOutCirc: function (e, t, i, n) {
  28991. 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)
  28992. },
  28993. easeInElastic: function (e, t, i, n) {
  28994. var r = 1.70158,
  28995. o = 0,
  28996. a = i
  28997. return 0 === e
  28998. ? t
  28999. : 1 == (e /= n)
  29000. ? t + i
  29001. : ((o = o || 0.3 * n),
  29002. (r = a < Math.abs(i) ? ((a = i), o / 4) : (o / (2 * Math.PI)) * Math.asin(i / a)),
  29003. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin(((e * n - r) * (2 * Math.PI)) / o) + t)
  29004. },
  29005. easeOutElastic: function (e, t, i, n) {
  29006. var r = 1.70158,
  29007. o = 0,
  29008. a = i
  29009. return 0 === e
  29010. ? t
  29011. : 1 == (e /= n)
  29012. ? t + i
  29013. : ((o = o || 0.3 * n),
  29014. (r = a < Math.abs(i) ? ((a = i), o / 4) : (o / (2 * Math.PI)) * Math.asin(i / a)),
  29015. a * Math.pow(2, -10 * e) * Math.sin(((e * n - r) * (2 * Math.PI)) / o) + i + t)
  29016. },
  29017. easeInOutElastic: function (e, t, i, n) {
  29018. var r = 1.70158,
  29019. o = 0,
  29020. a = i
  29021. return 0 === e
  29022. ? t
  29023. : 2 == (e /= n / 2)
  29024. ? t + i
  29025. : ((o = o || n * (0.3 * 1.5)),
  29026. (r = a < Math.abs(i) ? ((a = i), o / 4) : (o / (2 * Math.PI)) * Math.asin(i / a)),
  29027. e < 1
  29028. ? a * Math.pow(2, 10 * (e -= 1)) * Math.sin(((e * n - r) * (2 * Math.PI)) / o) * -0.5 + t
  29029. : a * Math.pow(2, -10 * (e -= 1)) * Math.sin(((e * n - r) * (2 * Math.PI)) / o) * 0.5 + i + t)
  29030. },
  29031. easeInBack: function (e, t, i, n, r) {
  29032. return void 0 === r && (r = 1.70158), i * (e /= n) * e * ((r + 1) * e - r) + t
  29033. },
  29034. easeOutBack: function (e, t, i, n, r) {
  29035. return void 0 === r && (r = 1.70158), i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  29036. },
  29037. easeInOutBack: function (e, t, i, n, r) {
  29038. 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
  29039. },
  29040. easeOutBounce: function (e, t, i, n) {
  29041. return (e /= n) < 1 / 2.75
  29042. ? i * (7.5625 * e * e) + t
  29043. : e < 2 / 2.75
  29044. ? i * (7.5625 * (e -= 1.5 / 2.75) * e + 0.75) + t
  29045. : e < 2.5 / 2.75
  29046. ? i * (7.5625 * (e -= 2.25 / 2.75) * e + 0.9375) + t
  29047. : i * (7.5625 * (e -= 2.625 / 2.75) * e + 0.984375) + t
  29048. },
  29049. easeInBounce: function (e, t, i, n) {
  29050. return i - r.easeOutBounce(n - e, 0, i, n) + t
  29051. },
  29052. easeInOutBounce: function (e, t, i, n) {
  29053. 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
  29054. }
  29055. }
  29056. window.easing = t.exports = r
  29057. },
  29058. {}
  29059. ],
  29060. 187: [
  29061. function (e, t, i) {
  29062. 'use strict'
  29063. function n() {
  29064. ;(this.events = []), (this.valid = !1)
  29065. }
  29066. var r = e('../enum/Joystick')
  29067. ;(n.prototype.push = function (e, t) {
  29068. this.events.push({
  29069. direction: e,
  29070. pano: t
  29071. }),
  29072. (this.valid = !0)
  29073. }),
  29074. (n.prototype.pop = function (e) {
  29075. var t = this.events.pop()
  29076. return this.events.length < 1 && (this.valid = !1), t
  29077. }),
  29078. (n.prototype.peek = function () {
  29079. return this.events.length
  29080. ? this.events[this.events.length - 1]
  29081. : {
  29082. direction: null,
  29083. pano: null
  29084. }
  29085. }),
  29086. (n.prototype.invalidate = function () {
  29087. ;(this.events = []), (this.valid = !1)
  29088. }),
  29089. (n.prototype.reversePano = function (e) {
  29090. if (!this.valid) return null
  29091. var t = this.peek()
  29092. return r.opposite(e) === t.direction ? (this.pop(), t.pano) : null
  29093. }),
  29094. (t.exports = n)
  29095. },
  29096. {
  29097. '../enum/Joystick': 29
  29098. }
  29099. ],
  29100. 188: [
  29101. function (e, t, i) {
  29102. 'use strict'
  29103. window.lerp = t.exports = {
  29104. vector: function (t, i) {
  29105. var n = t.clone()
  29106. return (
  29107. (i = i.clone()),
  29108. function (e) {
  29109. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  29110. }
  29111. )
  29112. },
  29113. quaternion: function (t, i) {
  29114. var n = t.clone()
  29115. return function (e) {
  29116. t.copy(n).slerp(i, e)
  29117. }
  29118. },
  29119. property: function (t, i, n, r) {
  29120. var o = t[i]
  29121. return function (e) {
  29122. ;(t[i] = o * (1 - e) + n * e), r && r(t[i])
  29123. }
  29124. },
  29125. uniform: function (t, i, n) {
  29126. var r = t.material.uniforms[i].value
  29127. return function (e) {
  29128. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  29129. }
  29130. },
  29131. matrix4: function (o, a) {
  29132. var s = o.clone()
  29133. return function (e) {
  29134. 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
  29135. }
  29136. },
  29137. allUniforms: function (e, t, i) {
  29138. var n = e.map(
  29139. function (e) {
  29140. return this.uniform(e, t, i)
  29141. }.bind(this)
  29142. )
  29143. return function (t) {
  29144. n.forEach(function (e) {
  29145. e(t)
  29146. })
  29147. }
  29148. }
  29149. }
  29150. },
  29151. {}
  29152. ],
  29153. 189: [
  29154. function (e, t, i) {
  29155. 'use strict'
  29156. function h(n) {
  29157. var e,
  29158. t,
  29159. i,
  29160. r,
  29161. o = n.split('/'),
  29162. a = '[' + o[o.length - 1].replace('.js', '') + ']',
  29163. s = {}
  29164. if (h.consoleEnabled) {
  29165. var l = function (e) {
  29166. $('#debug-console').append('<p>' + e + '</p>'), ($('#debug-console')[0].scrollTop = $('#debug-console')[0].scrollHeight)
  29167. }
  29168. ;(e = function (e) {
  29169. l(Array.prototype.slice.call(arguments).join(' '))
  29170. }),
  29171. (t = function (e) {
  29172. l(Array.prototype.slice.call(arguments).join(' '))
  29173. }),
  29174. (i = function (e) {
  29175. l('WARN: ' + Array.prototype.slice.call(arguments).join(' '))
  29176. }),
  29177. (r = function (e) {
  29178. l('ERROR: ' + Array.prototype.slice.call(arguments).join(' '))
  29179. })
  29180. } else
  29181. console.log
  29182. ? ((e = console.log), (t = console.info ? console.info : console.log), (i = console.warn ? console.warn : console.log), (r = console.error ? console.error : console.log))
  29183. : (e = t = i = r = function () {})
  29184. function c(e) {
  29185. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  29186. }
  29187. return {
  29188. debug: function () {
  29189. h.level >= h.levels.debug && e.apply(console, c(arguments))
  29190. },
  29191. info: function () {
  29192. h.level >= h.levels.info && t.apply(console, c(arguments))
  29193. },
  29194. warn: function () {
  29195. ;(function (e, t) {
  29196. if (u) {
  29197. var i = Array.prototype.slice.call(e).join(' ')
  29198. u.captureMessage(i, {
  29199. level: t,
  29200. path: n,
  29201. timestamp: h.timestamp()
  29202. })
  29203. }
  29204. })(arguments, 'warn'),
  29205. h.level >= h.levels.warn && i.apply(console, c(arguments))
  29206. },
  29207. error: function () {
  29208. ;(function (e, t) {
  29209. if (u) {
  29210. var i = Array.prototype.slice.call(e).join(' ')
  29211. u.captureException(new Error(i), {
  29212. level: t,
  29213. path: n,
  29214. timestamp: h.timestamp()
  29215. })
  29216. }
  29217. })(arguments, 'error'),
  29218. h.level >= h.levels.error && r.apply(console, c(arguments))
  29219. },
  29220. v3str: function (e, t) {
  29221. var i = void 0 === t ? 2 : t
  29222. return '(' + e.x.toPrecision(i) + ', ' + e.y.toPrecision(i) + ', ' + e.z.toPrecision(i) + ')'
  29223. },
  29224. eulstr: function (e, t) {
  29225. var i = void 0 === t ? 2 : t
  29226. return '(' + THREE.Math.radToDeg(e.x).toPrecision(i) + ', ' + THREE.Math.radToDeg(e.y).toPrecision(i) + ', ' + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  29227. },
  29228. time: function (e) {
  29229. h.level >= h.levels.debug && (s[e] = Date.now())
  29230. },
  29231. timeEnd: function (e) {
  29232. if (h.level >= h.levels.debug) {
  29233. var t = s[e]
  29234. if (!t) return
  29235. var i = (Date.now() - t) / 1e3
  29236. this.debug(e, i + 's')
  29237. }
  29238. }
  29239. }
  29240. }
  29241. var u = window.Raven
  29242. ;(h.timestamp = function () {
  29243. return (Date.now() - window.navigationStart) / 1e3 + 's'
  29244. }),
  29245. (h.level = (h.levels = {
  29246. debug: 3,
  29247. info: 2,
  29248. warn: 1,
  29249. error: 0
  29250. }).info),
  29251. (t.exports = h)
  29252. },
  29253. {}
  29254. ],
  29255. 190: [
  29256. function (e, t, i) {
  29257. 'use strict'
  29258. var o = e('three'),
  29259. r = e('../enum/GLCubeFaces')
  29260. e('../constants')
  29261. t.exports = {
  29262. convertVisionVector: function (e) {
  29263. return new o.Vector3(e.x, e.z, -e.y)
  29264. },
  29265. convertVisionQuaternion: function (e) {
  29266. 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)))
  29267. },
  29268. convertWorkshopVector: function (e) {
  29269. return new o.Vector3(-e.x, e.y, e.z)
  29270. },
  29271. convertWorkshopQuaternion: function (e) {
  29272. 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))
  29273. },
  29274. convertWorkshopPanoramaQuaternion: function (e) {
  29275. 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)))
  29276. },
  29277. convertWorkshopOrthoZoom: function (e) {
  29278. return -1 === e ? -1 : ((e * ($('#player').width() / $('#player').height())) / g_snapShotWidth) * g_snapShotHeight
  29279. },
  29280. toPrecision: function (e, t) {
  29281. function i(e, t) {
  29282. var i = Math.pow(10, t)
  29283. return Math.round(e * i) / i
  29284. }
  29285. if (e instanceof Array) {
  29286. for (var n = 0; n < e.length; n++) e[n] = i(e[n], t)
  29287. return e
  29288. }
  29289. return i(e, t)
  29290. },
  29291. isEmptyQuaternion: function (e) {
  29292. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  29293. },
  29294. projectPositionToCanvas: function (e, t, i) {
  29295. ;(i = i || new o.Vector3()).copy(e)
  29296. var n = 0.5 * $('#player').width(),
  29297. r = 0.5 * $('#player').height()
  29298. return i.project(t), (i.x = i.x * n + n), (i.y = -i.y * r + r), i
  29299. },
  29300. convertScreenPositionToNDC: function (e, t, i) {
  29301. return ((i = i || new o.Vector2()).x = (e / $('#player').width()) * 2 - 1), (i.y = (-t / $('#player').height()) * 2 + 1), i
  29302. },
  29303. constrainedTurn: function (e) {
  29304. var t = e % (2 * Math.PI)
  29305. return t > Math.PI ? (t -= 2 * Math.PI) : t < -Math.PI ? (t += 2 * Math.PI) : t
  29306. },
  29307. getFOVDotThreshold: function (e) {
  29308. return Math.cos(o.Math.degToRad(e / 2))
  29309. },
  29310. transform2DForwardVectorByCubeFace: function (e, t, i, n) {
  29311. switch (e) {
  29312. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29313. i.set(1, t.y, t.x)
  29314. break
  29315. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29316. i.set(-1, t.y, -t.x)
  29317. break
  29318. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29319. i.set(-t.x, 1, -t.y)
  29320. break
  29321. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29322. i.set(-t.x, -1, t.y)
  29323. break
  29324. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29325. i.set(-t.x, t.y, 1)
  29326. break
  29327. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29328. i.set(t.x, t.y, -1)
  29329. }
  29330. n && i.normalize()
  29331. },
  29332. //add:
  29333. getPos2d: function (point, camera, dom) {
  29334. var camera = camera
  29335. var dom = dom
  29336. 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);
  29337. var x, y
  29338. x = ((pos.x + 1) / 2) * dom.clientWidth
  29339. y = (1 - (pos.y + 1) / 2) * dom.clientHeight
  29340. var inSight = x <= dom.clientWidth && x >= 0 && y <= dom.clientHeight && y >= 0
  29341. return {
  29342. pos: new THREE.Vector2(x, y),
  29343. vector: pos,
  29344. trueSide: pos.z < 1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  29345. inSight: inSight //在屏幕范围内可见
  29346. }
  29347. },
  29348. getDirByLonLat: function (lon, lat) {
  29349. var dir = new THREE.Vector3()
  29350. var phi = THREE.Math.degToRad(90 - lat)
  29351. var theta = THREE.Math.degToRad(lon)
  29352. dir.x = Math.sin(phi) * Math.cos(theta)
  29353. dir.y = Math.cos(phi)
  29354. dir.z = Math.sin(phi) * Math.sin(theta)
  29355. return dir.negate()
  29356. }
  29357. }
  29358. window.math = t.exports
  29359. expandMath(math)
  29360. },
  29361. {
  29362. '../constants': 8,
  29363. '../enum/GLCubeFaces': 25,
  29364. three: 217
  29365. }
  29366. ],
  29367. 191: [
  29368. function (e, t, i) {
  29369. 'use strict'
  29370. function o(e) {
  29371. return r[e]
  29372. }
  29373. var n = e('../enum/GLCubeFaces'),
  29374. a = [0, 1, 2, 3, 4, 5],
  29375. r = {
  29376. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29377. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29378. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29379. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29380. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29381. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29382. }
  29383. t.exports = {
  29384. mapFaceToCubemapFace: o,
  29385. getCubemapUrls: function (i, n, r) {
  29386. return a.map(
  29387. function (e, t) {
  29388. return i.get('pan/' + r + '/' + n + '_skybox' + o(e) + '.jpg')
  29389. }.bind(this)
  29390. )
  29391. }
  29392. }
  29393. },
  29394. {
  29395. '../enum/GLCubeFaces': 25
  29396. }
  29397. ],
  29398. 192: [
  29399. function (e, t, i) {
  29400. 'use strict'
  29401. t.exports = {
  29402. captureErrors: function (e, t, i) {
  29403. if ('Raven' in window) {
  29404. Raven.config(e, t).install(), i && Raven.setTagsContext(i)
  29405. var n = console.warn,
  29406. r = console.error
  29407. ;(console.warn = function () {
  29408. var e = Array.prototype.slice.call(arguments)
  29409. Raven.captureMessage(e.join(' '), {
  29410. level: 'warning'
  29411. }),
  29412. n.apply(console, e)
  29413. }),
  29414. (console.error = function () {
  29415. var e = Array.prototype.slice.call(arguments)
  29416. Raven.captureException(new Error(e.join(' ')), {
  29417. level: 'error'
  29418. }),
  29419. r.apply(console, e)
  29420. })
  29421. } else console.error('Raven not found, not capturing errors.')
  29422. }
  29423. }
  29424. },
  29425. {}
  29426. ],
  29427. 193: [
  29428. function (c, h, e) {
  29429. ;(function (e) {
  29430. 'use strict'
  29431. var i,
  29432. n = c('./browser'),
  29433. r = c('../constants'),
  29434. o = c('url'),
  29435. t = c('./logger'),
  29436. a = c('three'),
  29437. s = new t(e),
  29438. l = {
  29439. getAuthorizationHeader: function () {
  29440. var e = n.valueFromHash('auth')
  29441. if (e) return e.replace(',', ' ')
  29442. var t = n.valueFromCookie('token')
  29443. return t ? 'Token ' + t : null
  29444. },
  29445. parseSidUrl: function (e) {
  29446. var t, i
  29447. if (((t = g_Prefix), (e = e || '').match(/^https?/))) {
  29448. o.parse(e)
  29449. ;(t = g_Prefix), (i = e)
  29450. } else i = (t = g_Prefix) + 'data/' + e
  29451. return {
  29452. urlBase: t,
  29453. urlModel: i,
  29454. urlFiles: i + (i.match(/\/$/) ? 'files' : '/files'),
  29455. urlThumb: i + (i.match(/\/$/) ? 'thumb' : '/thumb')
  29456. }
  29457. },
  29458. getModelIDFromQueryString: function () {
  29459. return n.valueFromHash('model') || n.valueFromHash('m')
  29460. },
  29461. /* normalizeModeldata: function(e, i) {
  29462. e = JSON.parse(JSON.stringify(e));
  29463. var n = null;
  29464. if (e.images.forEach(function(t) {
  29465. if (t.metadata) {
  29466. if ("string" == typeof t.metadata)
  29467. try {
  29468. t.metadata = JSON.parse(t.metadata)
  29469. } catch (e) {
  29470. s.warn("Unable to parse image metadata"),
  29471. t.metadata = null
  29472. }
  29473. else
  29474. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  29475. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  29476. 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)),
  29477. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  29478. t.metadata.zoom = t.metadata.zoom || 1),
  29479. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  29480. }
  29481. }),
  29482. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  29483. var t = {};
  29484. t.pano = {
  29485. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  29486. position: i.convertWorkshopVector(n.scan_position),
  29487. uuid: n.scan_id
  29488. },
  29489. t.camera = {
  29490. quaternion: n.camera_quaternion,
  29491. position: n.camera_position
  29492. },
  29493. e.startPano = t
  29494. }
  29495. return e
  29496. }, */
  29497. normalizeModeldata: function (e, t) {
  29498. //xzw 修改导览images数据
  29499. e = JSON.parse(JSON.stringify(e))
  29500. var i = null
  29501. var deal = function (n) {
  29502. if (!n.metadata) return
  29503. if ('string' == typeof n.metadata)
  29504. try {
  29505. n.metadata = JSON.parse(n.metadata)
  29506. } catch (e) {
  29507. s.warn('Unable to parse image metadata'), (n.metadata = null)
  29508. }
  29509. else {
  29510. 'object' == typeof n.metadata && s.debug('image.metadata already a JSON object')
  29511. }
  29512. if (n.metadata.camera_position instanceof Array) {
  29513. //xzw 改的格式
  29514. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position)
  29515. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion)
  29516. } else {
  29517. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  29518. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  29519. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29520. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  29521. }
  29522. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29523. }
  29524. //改
  29525. e.images.forEach(info => {
  29526. if (info.locations) {
  29527. info.locations.forEach(a => deal(a))
  29528. } else {
  29529. deal(info)
  29530. }
  29531. })
  29532. //icon初始视角的:
  29533. if (i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29534. var n = {}
  29535. ;(n.pano = {
  29536. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29537. position: t.convertWorkshopVector(i.scan_position),
  29538. uuid: i.scan_id
  29539. }),
  29540. (n.camera = {
  29541. quaternion: i.camera_quaternion,
  29542. position: i.camera_position
  29543. }),
  29544. (e.startPano = n)
  29545. }
  29546. return e
  29547. },
  29548. visionVersionToInt:
  29549. ((i = new RegExp(['(?:[0-9.]+\\.){1,4}', '([0-9]+)', '[^\\.]*$'].join(''))),
  29550. function (e) {
  29551. if (!e) throw new Error('Vision version is required')
  29552. var t = i.exec(e)
  29553. if (null === t) throw new Error('String is not a vision version: ' + e)
  29554. return parseInt(t[1])
  29555. }),
  29556. modelDataPromisesTiles: function (e) {
  29557. var t = e.vision_version || window.DATA.vision_version
  29558. if (t)
  29559. try {
  29560. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29561. } catch (e) {
  29562. s.warn('Invalid vision version: ' + t)
  29563. }
  29564. return !1
  29565. }
  29566. }
  29567. h.exports = l
  29568. }).call(this, '/js/util/showcase.js')
  29569. },
  29570. {
  29571. '../constants': 8,
  29572. './browser': 182,
  29573. './logger': 189,
  29574. three: 217,
  29575. url: 208
  29576. }
  29577. ],
  29578. 194: [
  29579. function (e, t, i) {
  29580. 'use strict'
  29581. var r = e('../util/ajax'),
  29582. o = e('three'),
  29583. a = e('../settings'),
  29584. s = {}
  29585. t.exports = {
  29586. load: function (e, t, i) {
  29587. var n = s[e]
  29588. return (
  29589. n
  29590. ? t &&
  29591. setTimeout(function () {
  29592. t(n)
  29593. }, 1)
  29594. : ((n = new o.Texture()),
  29595. a.minimalMemoryMode && ((n.minFilter = o.LinearFilter), (n.magFilter = o.LinearFilter), (n.generateMipmaps = !1)),
  29596. (n.sourceFile = e),
  29597. (s[e] = n),
  29598. r
  29599. .getImage(e)
  29600. .then(function (e) {
  29601. ;(n.image = e), (n.needsUpdate = !0), t && t(n)
  29602. })
  29603. .fail(i)),
  29604. n
  29605. )
  29606. },
  29607. loadBase64: function (e, t) {
  29608. t = t || 'png'
  29609. var i = new o.Texture()
  29610. return (
  29611. (i.image = document.createElement('img')),
  29612. i.image.setAttribute('src', 'data:image/' + t + ';base64,' + e),
  29613. a.minimalMemoryMode && ((i.minFilter = o.LinearFilter), (i.magFilter = o.LinearFilter), (i.generateMipmaps = !1)),
  29614. (i.needsUpdate = !0),
  29615. i
  29616. )
  29617. },
  29618. isLoaded: function (e) {
  29619. return !!s[e]
  29620. }
  29621. }
  29622. window.Texture = t.exports
  29623. },
  29624. {
  29625. '../settings': 166,
  29626. '../util/ajax': 181,
  29627. three: 217
  29628. }
  29629. ],
  29630. 195: [
  29631. function (e, t, i) {
  29632. 'use strict'
  29633. var l = e('./easing')
  29634. window.transitions = t.exports = {
  29635. globalDone: null,
  29636. funcs: [],
  29637. counter: 0,
  29638. uniqueID: 0,
  29639. start: function (e, t, i, n, r, o, a) {
  29640. return (
  29641. (n = n || 0),
  29642. this.funcs.push({
  29643. func: e,
  29644. current: -n * Math.abs(t),
  29645. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  29646. done: i,
  29647. easing: r || l.linearTween,
  29648. cycling: t < 0,
  29649. running: !0,
  29650. debug: n < 0,
  29651. name: o || 'T' + this.counter,
  29652. id: void 0 === a ? this.counter : a,
  29653. paused: !1
  29654. }),
  29655. e(0, 16),
  29656. (this.counter += 1),
  29657. e
  29658. )
  29659. },
  29660. trigger: function (e) {
  29661. var t = void 0 === e.delayRatio ? 0 : e.delayRatio,
  29662. i = e.func || function () {},
  29663. n = void 0 === e.duration ? 0 : e.duration
  29664. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n))
  29665. var r = e.done || null,
  29666. o = e.easing || l.linearTween,
  29667. a = e.name || 'R' + this.counter,
  29668. s = void 0 === e.id ? this.counter : e.id
  29669. return this.start(i, n, r, t, o, a, s)
  29670. },
  29671. setTimeout: function (e, t, i) {
  29672. var n = void 0 === i ? this.counter : i
  29673. return this.trigger({
  29674. done: e,
  29675. duration: void 0 === t ? 0 : t,
  29676. name: 'O' + this.counter,
  29677. id: n
  29678. })
  29679. },
  29680. pause: function () {
  29681. this.paused = !0
  29682. },
  29683. resume: function () {
  29684. this.paused = !1
  29685. },
  29686. update: function (n) {
  29687. this.funcs.forEach(function (e) {
  29688. if (!(e.paused || ((e.current += 1e3 * n), e.current < 0)))
  29689. if (e.current >= e.duration && !e.cycling) {
  29690. var t = e.easing(1, 0, 1, 1)
  29691. e.func(t, 1e3 * n), e.done && e.done(), (e.running = !1)
  29692. } else {
  29693. var i = e.easing((e.current % e.duration) / e.duration, 0, 1, 1)
  29694. ;(e.func(i, 1e3 * n) || !1) && (e.done && e.done(), (e.running = !1))
  29695. }
  29696. })
  29697. var e = this.funcs.length
  29698. this.funcs = this.funcs.filter(function (e) {
  29699. return e.running
  29700. })
  29701. var t = this.funcs.length
  29702. if (0 < e && 0 === t && this.globalDone) {
  29703. var i = this.globalDone
  29704. ;(this.globalDone = null), i()
  29705. }
  29706. },
  29707. adjustSpeed: function (e, t) {
  29708. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29709. var r = i[n]
  29710. ;(r.duration /= t), (r.current /= t)
  29711. }
  29712. },
  29713. getById: function (t) {
  29714. return this.funcs.filter(function (e) {
  29715. return t === e.id
  29716. })
  29717. },
  29718. get: function (e) {
  29719. for (var t = 0; t < this.funcs.length; t += 1) if (this.funcs[t].func === e) return this.funcs[t]
  29720. return null
  29721. },
  29722. isRunning: function (e) {
  29723. var t = this.get(e)
  29724. return null !== t && t.running
  29725. },
  29726. countActive: function () {
  29727. for (var e = 0, t = 0; t < this.funcs.length; t += 1) e += this.funcs[t].running
  29728. return e
  29729. },
  29730. listActive: function () {
  29731. for (var e = [], t = 0; t < this.funcs.length; t += 1) this.funcs[t].running && e.push(this.funcs[t].name)
  29732. return e
  29733. },
  29734. done: function (e) {
  29735. this.globalDone = e
  29736. },
  29737. cancelById: function (e) {
  29738. var t = void 0 === e ? 0 : e
  29739. this.funcs = this.funcs.filter(function (e) {
  29740. return e.id !== t
  29741. })
  29742. },
  29743. cancel: function (t) {
  29744. this.funcs = this.funcs.filter(function (e) {
  29745. return e.func !== t
  29746. })
  29747. },
  29748. getUniqueId: function () {
  29749. return (this.uniqueID -= 1), this.uniqueID
  29750. }
  29751. }
  29752. },
  29753. {
  29754. './easing': 186
  29755. }
  29756. ],
  29757. 196: [
  29758. function (e, t, i) {
  29759. function n(e) {
  29760. if (
  29761. ((this.set = {}),
  29762. (this.infContains = function () {
  29763. return !0
  29764. }),
  29765. 'object' == typeof e)
  29766. )
  29767. if (e instanceof Array) for (var t = 0; t < e.length; t++) this.set[e[t]] = !0
  29768. else this.set = e
  29769. else if ('function' == typeof e) this.infContains = e
  29770. else if (void 0 !== e) throw new Error('set must be either an array or an object.')
  29771. }
  29772. ;((t.exports = n).prototype.has = n.prototype.contains =
  29773. function (e) {
  29774. return !!this.set[e]
  29775. }),
  29776. (n.prototype.add = function (e) {
  29777. if (1 == arguments.length) this.set[e] = !0
  29778. else for (var t = 0; t < arguments.length; t++) this.set[arguments[t]] = !0
  29779. }),
  29780. (n.prototype.addAll = function (e) {
  29781. if ('object' != typeof e && !(e instanceof Array)) throw new Error('arr must be an array.')
  29782. for (var t = 0; t < e.length; t++) this.add(e[t])
  29783. }),
  29784. (n.prototype.delete = n.prototype.remove =
  29785. function (e) {
  29786. if (1 == arguments.length) delete this.set[e]
  29787. else for (var t = 0; t < arguments.length; t++) delete this.set[arguments[t]]
  29788. }),
  29789. (n.prototype.clear = function () {
  29790. this.set = {}
  29791. }),
  29792. (n.prototype.size = function () {
  29793. return Object.keys(this.set).length
  29794. }),
  29795. (n.prototype.toString = function () {
  29796. return '{' + Object.keys(this.set).toString() + '}'
  29797. }),
  29798. (n.prototype['*values'] = n.prototype.toArray =
  29799. function () {
  29800. return void 0 === this.set ? [] : Object.keys(this.set)
  29801. })
  29802. },
  29803. {}
  29804. ],
  29805. 197: [function (e, t, i) {}, {}],
  29806. 198: [
  29807. function (N, e, F) {
  29808. ;(function (e) {
  29809. 'use strict'
  29810. function i() {
  29811. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29812. }
  29813. function o(e, t) {
  29814. if (i() < t) throw new RangeError('Invalid typed array length')
  29815. return u.TYPED_ARRAY_SUPPORT ? ((e = new Uint8Array(t)).__proto__ = u.prototype) : (null === e && (e = new u(t)), (e.length = t)), e
  29816. }
  29817. function u(e, t, i) {
  29818. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u)) return new u(e, t, i)
  29819. if ('number' != typeof e) return n(this, e, t, i)
  29820. if ('string' == typeof t) throw new Error('If encoding is specified then the first argument must be a string')
  29821. return a(this, e)
  29822. }
  29823. function n(e, t, i, n) {
  29824. if ('number' == typeof t) throw new TypeError('"value" argument must not be a number')
  29825. return 'undefined' != typeof ArrayBuffer && t instanceof ArrayBuffer
  29826. ? (function (e, t, i, n) {
  29827. if ((t.byteLength, i < 0 || t.byteLength < i)) throw new RangeError("'offset' is out of bounds")
  29828. if (t.byteLength < i + (n || 0)) throw new RangeError("'length' is out of bounds")
  29829. return (
  29830. (t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t, i) : new Uint8Array(t, i, n)),
  29831. u.TYPED_ARRAY_SUPPORT ? ((e = t).__proto__ = u.prototype) : (e = s(e, t)),
  29832. e
  29833. )
  29834. })(e, t, i, n)
  29835. : 'string' == typeof t
  29836. ? (function (e, t, i) {
  29837. if ((('string' == typeof i && '' !== i) || (i = 'utf8'), !u.isEncoding(i))) throw new TypeError('"encoding" must be a valid string encoding')
  29838. var n = 0 | c(t, i),
  29839. r = (e = o(e, n)).write(t, i)
  29840. return r !== n && (e = e.slice(0, r)), e
  29841. })(e, t, i)
  29842. : (function (e, t) {
  29843. if (u.isBuffer(t)) {
  29844. var i = 0 | l(t.length)
  29845. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i), e
  29846. }
  29847. if (t) {
  29848. if (('undefined' != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer) || 'length' in t)
  29849. return 'number' != typeof t.length ||
  29850. (function (e) {
  29851. return e != e
  29852. })(t.length)
  29853. ? o(e, 0)
  29854. : s(e, t)
  29855. if ('Buffer' === t.type && L(t.data)) return s(e, t.data)
  29856. }
  29857. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  29858. })(e, t)
  29859. }
  29860. function r(e) {
  29861. if ('number' != typeof e) throw new TypeError('"size" argument must be a number')
  29862. if (e < 0) throw new RangeError('"size" argument must not be negative')
  29863. }
  29864. function a(e, t) {
  29865. 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
  29866. return e
  29867. }
  29868. function s(e, t) {
  29869. var i = t.length < 0 ? 0 : 0 | l(t.length)
  29870. e = o(e, i)
  29871. for (var n = 0; n < i; n += 1) e[n] = 255 & t[n]
  29872. return e
  29873. }
  29874. function l(e) {
  29875. if (e >= i()) throw new RangeError('Attempt to allocate Buffer larger than maximum size: 0x' + i().toString(16) + ' bytes')
  29876. return 0 | e
  29877. }
  29878. function c(e, t) {
  29879. if (u.isBuffer(e)) return e.length
  29880. if ('undefined' != typeof ArrayBuffer && 'function' == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer)) return e.byteLength
  29881. 'string' != typeof e && (e = '' + e)
  29882. var i = e.length
  29883. if (0 === i) return 0
  29884. for (var n = !1; ; )
  29885. switch (t) {
  29886. case 'ascii':
  29887. case 'latin1':
  29888. case 'binary':
  29889. return i
  29890. case 'utf8':
  29891. case 'utf-8':
  29892. case void 0:
  29893. return S(e).length
  29894. case 'ucs2':
  29895. case 'ucs-2':
  29896. case 'utf16le':
  29897. case 'utf-16le':
  29898. return 2 * i
  29899. case 'hex':
  29900. return i >>> 1
  29901. case 'base64':
  29902. return M(e).length
  29903. default:
  29904. if (n) return S(e).length
  29905. ;(t = ('' + t).toLowerCase()), (n = !0)
  29906. }
  29907. }
  29908. function h(e, t, i) {
  29909. var n = e[t]
  29910. ;(e[t] = e[i]), (e[i] = n)
  29911. }
  29912. function d(e, t, i, n, r) {
  29913. if (0 === e.length) return -1
  29914. if (
  29915. ('string' == typeof i ? ((n = i), (i = 0)) : 2147483647 < i ? (i = 2147483647) : i < -2147483648 && (i = -2147483648),
  29916. (i = +i),
  29917. isNaN(i) && (i = r ? 0 : e.length - 1),
  29918. i < 0 && (i = e.length + i),
  29919. i >= e.length)
  29920. ) {
  29921. if (r) return -1
  29922. i = e.length - 1
  29923. } else if (i < 0) {
  29924. if (!r) return -1
  29925. i = 0
  29926. }
  29927. if (('string' == typeof t && (t = u.from(t, n)), u.isBuffer(t))) return 0 === t.length ? -1 : p(e, t, i, n, r)
  29928. if ('number' == typeof t)
  29929. return (
  29930. (t &= 255),
  29931. u.TYPED_ARRAY_SUPPORT && 'function' == typeof Uint8Array.prototype.indexOf
  29932. ? r
  29933. ? Uint8Array.prototype.indexOf.call(e, t, i)
  29934. : Uint8Array.prototype.lastIndexOf.call(e, t, i)
  29935. : p(e, [t], i, n, r)
  29936. )
  29937. throw new TypeError('val must be string, number or Buffer')
  29938. }
  29939. function p(e, t, i, n, r) {
  29940. function o(e, t) {
  29941. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  29942. }
  29943. var a,
  29944. s = 1,
  29945. l = e.length,
  29946. c = t.length
  29947. if (void 0 !== n && ('ucs2' === (n = String(n).toLowerCase()) || 'ucs-2' === n || 'utf16le' === n || 'utf-16le' === n)) {
  29948. if (e.length < 2 || t.length < 2) return -1
  29949. ;(l /= s = 2), (c /= 2), (i /= 2)
  29950. }
  29951. if (r) {
  29952. var h = -1
  29953. for (a = i; a < l; a++)
  29954. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  29955. if ((-1 === h && (h = a), a - h + 1 === c)) return h * s
  29956. } else -1 !== h && (a -= a - h), (h = -1)
  29957. } else
  29958. for (l < i + c && (i = l - c), a = i; 0 <= a; a--) {
  29959. for (var u = !0, d = 0; d < c; d++)
  29960. if (o(e, a + d) !== o(t, d)) {
  29961. u = !1
  29962. break
  29963. }
  29964. if (u) return a
  29965. }
  29966. return -1
  29967. }
  29968. function g(e, t, i, n) {
  29969. i = Number(i) || 0
  29970. var r = e.length - i
  29971. n ? r < (n = Number(n)) && (n = r) : (n = r)
  29972. var o = t.length
  29973. if (o % 2 != 0) throw new TypeError('Invalid hex string')
  29974. o / 2 < n && (n = o / 2)
  29975. for (var a = 0; a < n; ++a) {
  29976. var s = parseInt(t.substr(2 * a, 2), 16)
  29977. if (isNaN(s)) return a
  29978. e[i + a] = s
  29979. }
  29980. return a
  29981. }
  29982. function m(e, t, i, n) {
  29983. return R(
  29984. (function (e) {
  29985. for (var t = [], i = 0; i < e.length; ++i) t.push(255 & e.charCodeAt(i))
  29986. return t
  29987. })(t),
  29988. e,
  29989. i,
  29990. n
  29991. )
  29992. }
  29993. function f(e, t, i) {
  29994. i = Math.min(e.length, i)
  29995. for (var n = [], r = t; r < i; ) {
  29996. var o,
  29997. a,
  29998. s,
  29999. l,
  30000. c = e[r],
  30001. h = null,
  30002. u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1
  30003. if (r + u <= i)
  30004. switch (u) {
  30005. case 1:
  30006. c < 128 && (h = c)
  30007. break
  30008. case 2:
  30009. 128 == (192 & (o = e[r + 1])) && 127 < (l = ((31 & c) << 6) | (63 & o)) && (h = l)
  30010. break
  30011. case 3:
  30012. ;(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)
  30013. break
  30014. case 4:
  30015. ;(o = e[r + 1]),
  30016. (a = e[r + 2]),
  30017. (s = e[r + 3]),
  30018. 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)
  30019. }
  30020. 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)
  30021. }
  30022. return (function (e) {
  30023. var t = e.length
  30024. if (t <= D) return String.fromCharCode.apply(String, e)
  30025. for (var i = '', n = 0; n < t; ) i += String.fromCharCode.apply(String, e.slice(n, (n += D)))
  30026. return i
  30027. })(n)
  30028. }
  30029. function v(e, t, i) {
  30030. var n = ''
  30031. i = Math.min(e.length, i)
  30032. for (var r = t; r < i; ++r) n += String.fromCharCode(127 & e[r])
  30033. return n
  30034. }
  30035. function y(e, t, i) {
  30036. var n = ''
  30037. i = Math.min(e.length, i)
  30038. for (var r = t; r < i; ++r) n += String.fromCharCode(e[r])
  30039. return n
  30040. }
  30041. function A(e, t, i) {
  30042. var n,
  30043. r = e.length
  30044. ;(!t || t < 0) && (t = 0), (!i || i < 0 || r < i) && (i = r)
  30045. for (var o = '', a = t; a < i; ++a) o += (n = e[a]) < 16 ? '0' + n.toString(16) : n.toString(16)
  30046. return o
  30047. }
  30048. function C(e, t, i) {
  30049. for (var n = e.slice(t, i), r = '', o = 0; o < n.length; o += 2) r += String.fromCharCode(n[o] + 256 * n[o + 1])
  30050. return r
  30051. }
  30052. function I(e, t, i) {
  30053. if (e % 1 != 0 || e < 0) throw new RangeError('offset is not uint')
  30054. if (i < e + t) throw new RangeError('Trying to access beyond buffer length')
  30055. }
  30056. function E(e, t, i, n, r, o) {
  30057. if (!u.isBuffer(e)) throw new TypeError('"buffer" argument must be a Buffer instance')
  30058. if (r < t || t < o) throw new RangeError('"value" argument is out of bounds')
  30059. if (i + n > e.length) throw new RangeError('Index out of range')
  30060. }
  30061. function _(e, t, i, n) {
  30062. t < 0 && (t = 65535 + t + 1)
  30063. 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))
  30064. }
  30065. function b(e, t, i, n) {
  30066. t < 0 && (t = 4294967295 + t + 1)
  30067. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r) e[i + r] = (t >>> (8 * (n ? r : 3 - r))) & 255
  30068. }
  30069. function w(e, t, i, n) {
  30070. if (i + n > e.length) throw new RangeError('Index out of range')
  30071. if (i < 0) throw new RangeError('Index out of range')
  30072. }
  30073. function T(e, t, i, n, r) {
  30074. return r || w(e, 0, i, 4), O.write(e, t, i, n, 23, 4), i + 4
  30075. }
  30076. function x(e, t, i, n, r) {
  30077. return r || w(e, 0, i, 8), O.write(e, t, i, n, 52, 8), i + 8
  30078. }
  30079. function S(e, t) {
  30080. t = t || 1 / 0
  30081. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  30082. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  30083. if (!r) {
  30084. if (56319 < i) {
  30085. ;-1 < (t -= 3) && o.push(239, 191, 189)
  30086. continue
  30087. }
  30088. if (a + 1 === n) {
  30089. ;-1 < (t -= 3) && o.push(239, 191, 189)
  30090. continue
  30091. }
  30092. r = i
  30093. continue
  30094. }
  30095. if (i < 56320) {
  30096. ;-1 < (t -= 3) && o.push(239, 191, 189), (r = i)
  30097. continue
  30098. }
  30099. i = 65536 + (((r - 55296) << 10) | (i - 56320))
  30100. } else r && -1 < (t -= 3) && o.push(239, 191, 189)
  30101. if (((r = null), i < 128)) {
  30102. if ((t -= 1) < 0) break
  30103. o.push(i)
  30104. } else if (i < 2048) {
  30105. if ((t -= 2) < 0) break
  30106. o.push((i >> 6) | 192, (63 & i) | 128)
  30107. } else if (i < 65536) {
  30108. if ((t -= 3) < 0) break
  30109. o.push((i >> 12) | 224, ((i >> 6) & 63) | 128, (63 & i) | 128)
  30110. } else {
  30111. if (!(i < 1114112)) throw new Error('Invalid code point')
  30112. if ((t -= 4) < 0) break
  30113. o.push((i >> 18) | 240, ((i >> 12) & 63) | 128, ((i >> 6) & 63) | 128, (63 & i) | 128)
  30114. }
  30115. }
  30116. return o
  30117. }
  30118. function M(e) {
  30119. return P.toByteArray(
  30120. (function (e) {
  30121. if (
  30122. (e = (function (e) {
  30123. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, '')
  30124. })(e).replace(t, '')).length < 2
  30125. )
  30126. return ''
  30127. for (; e.length % 4 != 0; ) e += '='
  30128. return e
  30129. })(e)
  30130. )
  30131. }
  30132. function R(e, t, i, n) {
  30133. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r) t[r + i] = e[r]
  30134. return r
  30135. }
  30136. var P = N('base64-js'),
  30137. O = N('ieee754'),
  30138. L = N('isarray')
  30139. ;(F.Buffer = u),
  30140. (F.SlowBuffer = function (e) {
  30141. return +e != e && (e = 0), u.alloc(+e)
  30142. }),
  30143. (F.INSPECT_MAX_BYTES = 50),
  30144. (u.TYPED_ARRAY_SUPPORT =
  30145. void 0 !== e.TYPED_ARRAY_SUPPORT
  30146. ? e.TYPED_ARRAY_SUPPORT
  30147. : (function () {
  30148. try {
  30149. var e = new Uint8Array(1)
  30150. return (
  30151. (e.__proto__ = {
  30152. __proto__: Uint8Array.prototype,
  30153. foo: function () {
  30154. return 42
  30155. }
  30156. }),
  30157. 42 === e.foo() && 'function' == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  30158. )
  30159. } catch (e) {
  30160. return !1
  30161. }
  30162. })()),
  30163. (F.kMaxLength = i()),
  30164. (u.poolSize = 8192),
  30165. (u._augment = function (e) {
  30166. return (e.__proto__ = u.prototype), e
  30167. }),
  30168. (u.from = function (e, t, i) {
  30169. return n(null, e, t, i)
  30170. }),
  30171. u.TYPED_ARRAY_SUPPORT &&
  30172. ((u.prototype.__proto__ = Uint8Array.prototype),
  30173. (u.__proto__ = Uint8Array),
  30174. 'undefined' != typeof Symbol &&
  30175. Symbol.species &&
  30176. u[Symbol.species] === u &&
  30177. Object.defineProperty(u, Symbol.species, {
  30178. value: null,
  30179. configurable: !0
  30180. })),
  30181. (u.alloc = function (e, t, i) {
  30182. return (function (e, t, i, n) {
  30183. 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)
  30184. })(null, e, t, i)
  30185. }),
  30186. (u.allocUnsafe = function (e) {
  30187. return a(null, e)
  30188. }),
  30189. (u.allocUnsafeSlow = function (e) {
  30190. return a(null, e)
  30191. }),
  30192. (u.isBuffer = function (e) {
  30193. return !(null == e || !e._isBuffer)
  30194. }),
  30195. (u.compare = function (e, t) {
  30196. if (!u.isBuffer(e) || !u.isBuffer(t)) throw new TypeError('Arguments must be Buffers')
  30197. if (e === t) return 0
  30198. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  30199. if (e[r] !== t[r]) {
  30200. ;(i = e[r]), (n = t[r])
  30201. break
  30202. }
  30203. return i < n ? -1 : n < i ? 1 : 0
  30204. }),
  30205. (u.isEncoding = function (e) {
  30206. switch (String(e).toLowerCase()) {
  30207. case 'hex':
  30208. case 'utf8':
  30209. case 'utf-8':
  30210. case 'ascii':
  30211. case 'latin1':
  30212. case 'binary':
  30213. case 'base64':
  30214. case 'ucs2':
  30215. case 'ucs-2':
  30216. case 'utf16le':
  30217. case 'utf-16le':
  30218. return !0
  30219. default:
  30220. return !1
  30221. }
  30222. }),
  30223. (u.concat = function (e, t) {
  30224. if (!L(e)) throw new TypeError('"list" argument must be an Array of Buffers')
  30225. if (0 === e.length) return u.alloc(0)
  30226. var i
  30227. if (void 0 === t) for (i = t = 0; i < e.length; ++i) t += e[i].length
  30228. var n = u.allocUnsafe(t),
  30229. r = 0
  30230. for (i = 0; i < e.length; ++i) {
  30231. var o = e[i]
  30232. if (!u.isBuffer(o)) throw new TypeError('"list" argument must be an Array of Buffers')
  30233. o.copy(n, r), (r += o.length)
  30234. }
  30235. return n
  30236. }),
  30237. (u.byteLength = c),
  30238. (u.prototype._isBuffer = !0),
  30239. (u.prototype.swap16 = function () {
  30240. var e = this.length
  30241. if (e % 2 != 0) throw new RangeError('Buffer size must be a multiple of 16-bits')
  30242. for (var t = 0; t < e; t += 2) h(this, t, t + 1)
  30243. return this
  30244. }),
  30245. (u.prototype.swap32 = function () {
  30246. var e = this.length
  30247. if (e % 4 != 0) throw new RangeError('Buffer size must be a multiple of 32-bits')
  30248. for (var t = 0; t < e; t += 4) h(this, t, t + 3), h(this, t + 1, t + 2)
  30249. return this
  30250. }),
  30251. (u.prototype.swap64 = function () {
  30252. var e = this.length
  30253. if (e % 8 != 0) throw new RangeError('Buffer size must be a multiple of 64-bits')
  30254. 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)
  30255. return this
  30256. }),
  30257. (u.prototype.toString = function () {
  30258. var e = 0 | this.length
  30259. return 0 == e
  30260. ? ''
  30261. : 0 === arguments.length
  30262. ? f(this, 0, e)
  30263. : function (e, t, i) {
  30264. var n,
  30265. r,
  30266. o,
  30267. a = !1
  30268. if (((void 0 === t || t < 0) && (t = 0), t > this.length)) return ''
  30269. if (((void 0 === i || i > this.length) && (i = this.length), i <= 0)) return ''
  30270. if ((i >>>= 0) <= (t >>>= 0)) return ''
  30271. for (e = e || 'utf8'; ; )
  30272. switch (e) {
  30273. case 'hex':
  30274. return A(this, t, i)
  30275. case 'utf8':
  30276. case 'utf-8':
  30277. return f(this, t, i)
  30278. case 'ascii':
  30279. return v(this, t, i)
  30280. case 'latin1':
  30281. case 'binary':
  30282. return y(this, t, i)
  30283. case 'base64':
  30284. return (n = this), (o = i), 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o))
  30285. case 'ucs2':
  30286. case 'ucs-2':
  30287. case 'utf16le':
  30288. case 'utf-16le':
  30289. return C(this, t, i)
  30290. default:
  30291. if (a) throw new TypeError('Unknown encoding: ' + e)
  30292. ;(e = (e + '').toLowerCase()), (a = !0)
  30293. }
  30294. }.apply(this, arguments)
  30295. }),
  30296. (u.prototype.equals = function (e) {
  30297. if (!u.isBuffer(e)) throw new TypeError('Argument must be a Buffer')
  30298. return this === e || 0 === u.compare(this, e)
  30299. }),
  30300. (u.prototype.inspect = function () {
  30301. var e = '',
  30302. t = F.INSPECT_MAX_BYTES
  30303. return 0 < this.length && ((e = this.toString('hex', 0, t).match(/.{2}/g).join(' ')), this.length > t && (e += ' ... ')), '<Buffer ' + e + '>'
  30304. }),
  30305. (u.prototype.compare = function (e, t, i, n, r) {
  30306. if (!u.isBuffer(e)) throw new TypeError('Argument must be a Buffer')
  30307. 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))
  30308. throw new RangeError('out of range index')
  30309. if (r <= n && i <= t) return 0
  30310. if (r <= n) return -1
  30311. if (i <= t) return 1
  30312. if (this === e) return 0
  30313. 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)
  30314. if (l[h] !== c[h]) {
  30315. ;(o = l[h]), (a = c[h])
  30316. break
  30317. }
  30318. return o < a ? -1 : a < o ? 1 : 0
  30319. }),
  30320. (u.prototype.includes = function (e, t, i) {
  30321. return -1 !== this.indexOf(e, t, i)
  30322. }),
  30323. (u.prototype.indexOf = function (e, t, i) {
  30324. return d(this, e, t, i, !0)
  30325. }),
  30326. (u.prototype.lastIndexOf = function (e, t, i) {
  30327. return d(this, e, t, i, !1)
  30328. }),
  30329. (u.prototype.write = function (e, t, i, n) {
  30330. if (void 0 === t) (n = 'utf8'), (i = this.length), (t = 0)
  30331. else if (void 0 === i && 'string' == typeof t) (n = t), (i = this.length), (t = 0)
  30332. else {
  30333. if (!isFinite(t)) throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported')
  30334. ;(t |= 0), isFinite(i) ? ((i |= 0), void 0 === n && (n = 'utf8')) : ((n = i), (i = void 0))
  30335. }
  30336. var r,
  30337. o,
  30338. a,
  30339. s,
  30340. l,
  30341. c,
  30342. h,
  30343. u,
  30344. d,
  30345. p = this.length - t
  30346. 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')
  30347. n = n || 'utf8'
  30348. for (var f = !1; ; )
  30349. switch (n) {
  30350. case 'hex':
  30351. return g(this, e, t, i)
  30352. case 'utf8':
  30353. case 'utf-8':
  30354. return (u = t), (d = i), R(S(e, (h = this).length - u), h, u, d)
  30355. case 'ascii':
  30356. return m(this, e, t, i)
  30357. case 'latin1':
  30358. case 'binary':
  30359. return m(this, e, t, i)
  30360. case 'base64':
  30361. return (s = this), (l = t), (c = i), R(M(e), s, l, c)
  30362. case 'ucs2':
  30363. case 'ucs-2':
  30364. case 'utf16le':
  30365. case 'utf-16le':
  30366. return (
  30367. (o = t),
  30368. (a = i),
  30369. R(
  30370. (function (e, t) {
  30371. 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)
  30372. return o
  30373. })(e, (r = this).length - o),
  30374. r,
  30375. o,
  30376. a
  30377. )
  30378. )
  30379. default:
  30380. if (f) throw new TypeError('Unknown encoding: ' + n)
  30381. ;(n = ('' + n).toLowerCase()), (f = !0)
  30382. }
  30383. }),
  30384. (u.prototype.toJSON = function () {
  30385. return {
  30386. type: 'Buffer',
  30387. data: Array.prototype.slice.call(this._arr || this, 0)
  30388. }
  30389. })
  30390. var D = 4096
  30391. ;(u.prototype.slice = function (e, t) {
  30392. var i,
  30393. n = this.length
  30394. 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))
  30395. (i = this.subarray(e, t)).__proto__ = u.prototype
  30396. else {
  30397. var r = t - e
  30398. i = new u(r, void 0)
  30399. for (var o = 0; o < r; ++o) i[o] = this[o + e]
  30400. }
  30401. return i
  30402. }),
  30403. (u.prototype.readUIntLE = function (e, t, i) {
  30404. ;(e |= 0), (t |= 0), i || I(e, t, this.length)
  30405. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); ) n += this[e + o] * r
  30406. return n
  30407. }),
  30408. (u.prototype.readUIntBE = function (e, t, i) {
  30409. ;(e |= 0), (t |= 0), i || I(e, t, this.length)
  30410. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); ) n += this[e + --t] * r
  30411. return n
  30412. }),
  30413. (u.prototype.readUInt8 = function (e, t) {
  30414. return t || I(e, 1, this.length), this[e]
  30415. }),
  30416. (u.prototype.readUInt16LE = function (e, t) {
  30417. return t || I(e, 2, this.length), this[e] | (this[e + 1] << 8)
  30418. }),
  30419. (u.prototype.readUInt16BE = function (e, t) {
  30420. return t || I(e, 2, this.length), (this[e] << 8) | this[e + 1]
  30421. }),
  30422. (u.prototype.readUInt32LE = function (e, t) {
  30423. return t || I(e, 4, this.length), (this[e] | (this[e + 1] << 8) | (this[e + 2] << 16)) + 16777216 * this[e + 3]
  30424. }),
  30425. (u.prototype.readUInt32BE = function (e, t) {
  30426. return t || I(e, 4, this.length), 16777216 * this[e] + ((this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3])
  30427. }),
  30428. (u.prototype.readIntLE = function (e, t, i) {
  30429. ;(e |= 0), (t |= 0), i || I(e, t, this.length)
  30430. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); ) n += this[e + o] * r
  30431. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)), n
  30432. }),
  30433. (u.prototype.readIntBE = function (e, t, i) {
  30434. ;(e |= 0), (t |= 0), i || I(e, t, this.length)
  30435. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); ) o += this[e + --n] * r
  30436. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)), o
  30437. }),
  30438. (u.prototype.readInt8 = function (e, t) {
  30439. return t || I(e, 1, this.length), 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  30440. }),
  30441. (u.prototype.readInt16LE = function (e, t) {
  30442. t || I(e, 2, this.length)
  30443. var i = this[e] | (this[e + 1] << 8)
  30444. return 32768 & i ? 4294901760 | i : i
  30445. }),
  30446. (u.prototype.readInt16BE = function (e, t) {
  30447. t || I(e, 2, this.length)
  30448. var i = this[e + 1] | (this[e] << 8)
  30449. return 32768 & i ? 4294901760 | i : i
  30450. }),
  30451. (u.prototype.readInt32LE = function (e, t) {
  30452. return t || I(e, 4, this.length), this[e] | (this[e + 1] << 8) | (this[e + 2] << 16) | (this[e + 3] << 24)
  30453. }),
  30454. (u.prototype.readInt32BE = function (e, t) {
  30455. return t || I(e, 4, this.length), (this[e] << 24) | (this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3]
  30456. }),
  30457. (u.prototype.readFloatLE = function (e, t) {
  30458. return t || I(e, 4, this.length), O.read(this, e, !0, 23, 4)
  30459. }),
  30460. (u.prototype.readFloatBE = function (e, t) {
  30461. return t || I(e, 4, this.length), O.read(this, e, !1, 23, 4)
  30462. }),
  30463. (u.prototype.readDoubleLE = function (e, t) {
  30464. return t || I(e, 8, this.length), O.read(this, e, !0, 52, 8)
  30465. }),
  30466. (u.prototype.readDoubleBE = function (e, t) {
  30467. return t || I(e, 8, this.length), O.read(this, e, !1, 52, 8)
  30468. }),
  30469. (u.prototype.writeUIntLE = function (e, t, i, n) {
  30470. ;(e = +e), (t |= 0), (i |= 0), n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0)
  30471. var r = 1,
  30472. o = 0
  30473. for (this[t] = 255 & e; ++o < i && (r *= 256); ) this[t + o] = (e / r) & 255
  30474. return t + i
  30475. }),
  30476. (u.prototype.writeUIntBE = function (e, t, i, n) {
  30477. ;(e = +e), (t |= 0), (i |= 0), n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0)
  30478. var r = i - 1,
  30479. o = 1
  30480. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); ) this[t + r] = (e / o) & 255
  30481. return t + i
  30482. }),
  30483. (u.prototype.writeUInt8 = function (e, t, i) {
  30484. 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
  30485. }),
  30486. (u.prototype.writeUInt16LE = function (e, t, i) {
  30487. 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
  30488. }),
  30489. (u.prototype.writeUInt16BE = function (e, t, i) {
  30490. 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
  30491. }),
  30492. (u.prototype.writeUInt32LE = function (e, t, i) {
  30493. return (
  30494. (e = +e),
  30495. (t |= 0),
  30496. i || E(this, e, t, 4, 4294967295, 0),
  30497. 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),
  30498. t + 4
  30499. )
  30500. }),
  30501. (u.prototype.writeUInt32BE = function (e, t, i) {
  30502. return (
  30503. (e = +e),
  30504. (t |= 0),
  30505. i || E(this, e, t, 4, 4294967295, 0),
  30506. 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),
  30507. t + 4
  30508. )
  30509. }),
  30510. (u.prototype.writeIntLE = function (e, t, i, n) {
  30511. if (((e = +e), (t |= 0), !n)) {
  30512. var r = Math.pow(2, 8 * i - 1)
  30513. E(this, e, t, i, r - 1, -r)
  30514. }
  30515. var o = 0,
  30516. a = 1,
  30517. s = 0
  30518. 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)
  30519. return t + i
  30520. }),
  30521. (u.prototype.writeIntBE = function (e, t, i, n) {
  30522. if (((e = +e), (t |= 0), !n)) {
  30523. var r = Math.pow(2, 8 * i - 1)
  30524. E(this, e, t, i, r - 1, -r)
  30525. }
  30526. var o = i - 1,
  30527. a = 1,
  30528. s = 0
  30529. 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)
  30530. return t + i
  30531. }),
  30532. (u.prototype.writeInt8 = function (e, t, i) {
  30533. 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
  30534. }),
  30535. (u.prototype.writeInt16LE = function (e, t, i) {
  30536. 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
  30537. }),
  30538. (u.prototype.writeInt16BE = function (e, t, i) {
  30539. 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
  30540. }),
  30541. (u.prototype.writeInt32LE = function (e, t, i) {
  30542. return (
  30543. (e = +e),
  30544. (t |= 0),
  30545. i || E(this, e, t, 4, 2147483647, -2147483648),
  30546. 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),
  30547. t + 4
  30548. )
  30549. }),
  30550. (u.prototype.writeInt32BE = function (e, t, i) {
  30551. return (
  30552. (e = +e),
  30553. (t |= 0),
  30554. i || E(this, e, t, 4, 2147483647, -2147483648),
  30555. e < 0 && (e = 4294967295 + e + 1),
  30556. 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),
  30557. t + 4
  30558. )
  30559. }),
  30560. (u.prototype.writeFloatLE = function (e, t, i) {
  30561. return T(this, e, t, !0, i)
  30562. }),
  30563. (u.prototype.writeFloatBE = function (e, t, i) {
  30564. return T(this, e, t, !1, i)
  30565. }),
  30566. (u.prototype.writeDoubleLE = function (e, t, i) {
  30567. return x(this, e, t, !0, i)
  30568. }),
  30569. (u.prototype.writeDoubleBE = function (e, t, i) {
  30570. return x(this, e, t, !1, i)
  30571. }),
  30572. (u.prototype.copy = function (e, t, i, n) {
  30573. 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
  30574. if (0 === e.length || 0 === this.length) return 0
  30575. if (t < 0) throw new RangeError('targetStart out of bounds')
  30576. if (i < 0 || i >= this.length) throw new RangeError('sourceStart out of bounds')
  30577. if (n < 0) throw new RangeError('sourceEnd out of bounds')
  30578. n > this.length && (n = this.length), e.length - t < n - i && (n = e.length - t + i)
  30579. var r,
  30580. o = n - i
  30581. if (this === e && i < t && t < n) for (r = o - 1; 0 <= r; --r) e[r + t] = this[r + i]
  30582. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT) for (r = 0; r < o; ++r) e[r + t] = this[r + i]
  30583. else Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t)
  30584. return o
  30585. }),
  30586. (u.prototype.fill = function (e, t, i, n) {
  30587. if ('string' == typeof e) {
  30588. if (('string' == typeof t ? ((n = t), (t = 0), (i = this.length)) : 'string' == typeof i && ((n = i), (i = this.length)), 1 === e.length)) {
  30589. var r = e.charCodeAt(0)
  30590. r < 256 && (e = r)
  30591. }
  30592. if (void 0 !== n && 'string' != typeof n) throw new TypeError('encoding must be a string')
  30593. if ('string' == typeof n && !u.isEncoding(n)) throw new TypeError('Unknown encoding: ' + n)
  30594. } else 'number' == typeof e && (e &= 255)
  30595. if (t < 0 || this.length < t || this.length < i) throw new RangeError('Out of range index')
  30596. if (i <= t) return this
  30597. var o
  30598. 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
  30599. else {
  30600. var a = u.isBuffer(e) ? e : S(new u(e, n).toString()),
  30601. s = a.length
  30602. for (o = 0; o < i - t; ++o) this[o + t] = a[o % s]
  30603. }
  30604. return this
  30605. })
  30606. var t = /[^+\/0-9A-Za-z-_]/g
  30607. }).call(this, 'undefined' != typeof global ? global : 'undefined' != typeof self ? self : 'undefined' != typeof window ? window : {})
  30608. },
  30609. {
  30610. 'base64-js': 199,
  30611. ieee754: 200,
  30612. isarray: 201
  30613. }
  30614. ],
  30615. 199: [
  30616. function (e, t, i) {
  30617. 'use strict'
  30618. function l(e) {
  30619. var t = e.length
  30620. if (0 < t % 4) throw new Error('Invalid string. Length must be a multiple of 4')
  30621. return '=' === e[t - 2] ? 2 : '=' === e[t - 1] ? 1 : 0
  30622. }
  30623. function c(e, t, i) {
  30624. 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])
  30625. var a
  30626. return r.join('')
  30627. }
  30628. ;(i.byteLength = function (e) {
  30629. return (3 * e.length) / 4 - l(e)
  30630. }),
  30631. (i.toByteArray = function (e) {
  30632. var t,
  30633. i,
  30634. n,
  30635. r,
  30636. o,
  30637. a = e.length
  30638. ;(r = l(e)), (o = new d((3 * a) / 4 - r)), (i = 0 < r ? a - 4 : a)
  30639. var s = 0
  30640. for (t = 0; t < i; t += 4, 3)
  30641. (n = (u[e.charCodeAt(t)] << 18) | (u[e.charCodeAt(t + 1)] << 12) | (u[e.charCodeAt(t + 2)] << 6) | u[e.charCodeAt(t + 3)]),
  30642. (o[s++] = (n >> 16) & 255),
  30643. (o[s++] = (n >> 8) & 255),
  30644. (o[s++] = 255 & n)
  30645. return (
  30646. 2 === r
  30647. ? ((n = (u[e.charCodeAt(t)] << 2) | (u[e.charCodeAt(t + 1)] >> 4)), (o[s++] = 255 & n))
  30648. : 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)),
  30649. o
  30650. )
  30651. }),
  30652. (i.fromByteArray = function (e) {
  30653. 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))
  30654. return (
  30655. 1 == n
  30656. ? ((t = e[i - 1]), (r += h[t >> 2]), (r += h[(t << 4) & 63]), (r += '=='))
  30657. : 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 += '=')),
  30658. o.push(r),
  30659. o.join('')
  30660. )
  30661. })
  30662. for (var h = [], u = [], d = 'undefined' != typeof Uint8Array ? Uint8Array : Array, n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', r = 0, o = n.length; r < o; ++r)
  30663. (h[r] = n[r]), (u[n.charCodeAt(r)] = r)
  30664. ;(u['-'.charCodeAt(0)] = 62), (u['_'.charCodeAt(0)] = 63)
  30665. },
  30666. {}
  30667. ],
  30668. 200: [
  30669. function (e, t, i) {
  30670. ;(i.read = function (e, t, i, n, r) {
  30671. var o,
  30672. a,
  30673. s = 8 * r - n - 1,
  30674. l = (1 << s) - 1,
  30675. c = l >> 1,
  30676. h = -7,
  30677. u = i ? r - 1 : 0,
  30678. d = i ? -1 : 1,
  30679. p = e[t + u]
  30680. for (u += d, o = p & ((1 << -h) - 1), p >>= -h, h += s; 0 < h; o = 256 * o + e[t + u], u += d, h -= 8);
  30681. for (a = o & ((1 << -h) - 1), o >>= -h, h += n; 0 < h; a = 256 * a + e[t + u], u += d, h -= 8);
  30682. if (0 === o) o = 1 - c
  30683. else {
  30684. if (o === l) return a ? NaN : (1 / 0) * (p ? -1 : 1)
  30685. ;(a += Math.pow(2, n)), (o -= c)
  30686. }
  30687. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30688. }),
  30689. (i.write = function (e, t, i, n, r, o) {
  30690. var a,
  30691. s,
  30692. l,
  30693. c = 8 * o - r - 1,
  30694. h = (1 << c) - 1,
  30695. u = h >> 1,
  30696. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  30697. p = n ? 0 : o - 1,
  30698. f = n ? 1 : -1,
  30699. g = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0
  30700. for (
  30701. t = Math.abs(t),
  30702. isNaN(t) || t === 1 / 0
  30703. ? ((s = isNaN(t) ? 1 : 0), (a = h))
  30704. : ((a = Math.floor(Math.log(t) / Math.LN2)),
  30705. t * (l = Math.pow(2, -a)) < 1 && (a--, (l *= 2)),
  30706. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++, (l /= 2)),
  30707. 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)));
  30708. 8 <= r;
  30709. e[i + p] = 255 & s, p += f, s /= 256, r -= 8
  30710. );
  30711. for (a = (a << r) | s, c += r; 0 < c; e[i + p] = 255 & a, p += f, a /= 256, c -= 8);
  30712. e[i + p - f] |= 128 * g
  30713. })
  30714. },
  30715. {}
  30716. ],
  30717. 201: [
  30718. function (e, t, i) {
  30719. var n = {}.toString
  30720. t.exports =
  30721. Array.isArray ||
  30722. function (e) {
  30723. return '[object Array]' == n.call(e)
  30724. }
  30725. },
  30726. {}
  30727. ],
  30728. 202: [
  30729. function (e, t, i) {
  30730. function n() {
  30731. ;(this._events = this._events || {}), (this._maxListeners = this._maxListeners || void 0)
  30732. }
  30733. function l(e) {
  30734. return 'function' == typeof e
  30735. }
  30736. function c(e) {
  30737. return 'object' == typeof e && null !== e
  30738. }
  30739. function h(e) {
  30740. return void 0 === e
  30741. }
  30742. ;(((t.exports = n).EventEmitter = n).prototype._events = void 0),
  30743. (n.prototype._maxListeners = void 0),
  30744. (n.defaultMaxListeners = 10),
  30745. (n.prototype.setMaxListeners = function (e) {
  30746. if (
  30747. !(function (e) {
  30748. return 'number' == typeof e
  30749. })(e) ||
  30750. e < 0 ||
  30751. isNaN(e)
  30752. )
  30753. throw TypeError('n must be a positive number')
  30754. return (this._maxListeners = e), this
  30755. }),
  30756. (n.prototype.emit = function (e) {
  30757. var t, i, n, r, o, a
  30758. if ((this._events || (this._events = {}), 'error' === e && (!this._events.error || (c(this._events.error) && !this._events.error.length)))) {
  30759. if ((t = arguments[1]) instanceof Error) throw t
  30760. var s = new Error('Uncaught, unspecified "error" event. (' + t + ')')
  30761. throw ((s.context = t), s)
  30762. }
  30763. if (h((i = this._events[e]))) return !1
  30764. if (l(i))
  30765. switch (arguments.length) {
  30766. case 1:
  30767. i.call(this)
  30768. break
  30769. case 2:
  30770. i.call(this, arguments[1])
  30771. break
  30772. case 3:
  30773. i.call(this, arguments[1], arguments[2])
  30774. break
  30775. default:
  30776. ;(r = Array.prototype.slice.call(arguments, 1)), i.apply(this, r)
  30777. }
  30778. 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)
  30779. return !0
  30780. }),
  30781. (n.prototype.on = n.prototype.addListener =
  30782. function (e, t) {
  30783. var i
  30784. if (!l(t)) throw TypeError('listener must be a function')
  30785. return (
  30786. this._events || (this._events = {}),
  30787. this._events.newListener && this.emit('newListener', e, l(t.listener) ? t.listener : t),
  30788. this._events[e] ? (c(this._events[e]) ? this._events[e].push(t) : (this._events[e] = [this._events[e], t])) : (this._events[e] = t),
  30789. c(this._events[e]) &&
  30790. !this._events[e].warned &&
  30791. (i = h(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners) &&
  30792. 0 < i &&
  30793. this._events[e].length > i &&
  30794. ((this._events[e].warned = !0),
  30795. console.error('(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.', this._events[e].length),
  30796. 'function' == typeof console.trace && console.trace()),
  30797. this
  30798. )
  30799. }),
  30800. (n.prototype.once = function (e, t) {
  30801. function i() {
  30802. this.removeListener(e, i), n || ((n = !0), t.apply(this, arguments))
  30803. }
  30804. if (!l(t)) throw TypeError('listener must be a function')
  30805. var n = !1
  30806. return (i.listener = t), this.on(e, i), this
  30807. }),
  30808. (n.prototype.removeListener = function (e, t) {
  30809. var i, n, r, o
  30810. if (!l(t)) throw TypeError('listener must be a function')
  30811. if (!this._events || !this._events[e]) return this
  30812. if (((r = (i = this._events[e]).length), (n = -1), i === t || (l(i.listener) && i.listener === t)))
  30813. delete this._events[e], this._events.removeListener && this.emit('removeListener', e, t)
  30814. else if (c(i)) {
  30815. for (o = r; 0 < o--; )
  30816. if (i[o] === t || (i[o].listener && i[o].listener === t)) {
  30817. n = o
  30818. break
  30819. }
  30820. if (n < 0) return this
  30821. 1 === i.length ? ((i.length = 0), delete this._events[e]) : i.splice(n, 1), this._events.removeListener && this.emit('removeListener', e, t)
  30822. }
  30823. return this
  30824. }),
  30825. (n.prototype.removeAllListeners = function (e) {
  30826. var t, i
  30827. if (!this._events) return this
  30828. if (!this._events.removeListener) return 0 === arguments.length ? (this._events = {}) : this._events[e] && delete this._events[e], this
  30829. if (0 === arguments.length) {
  30830. for (t in this._events) 'removeListener' !== t && this.removeAllListeners(t)
  30831. return this.removeAllListeners('removeListener'), (this._events = {}), this
  30832. }
  30833. if (l((i = this._events[e]))) this.removeListener(e, i)
  30834. else if (i) for (; i.length; ) this.removeListener(e, i[i.length - 1])
  30835. return delete this._events[e], this
  30836. }),
  30837. (n.prototype.listeners = function (e) {
  30838. return this._events && this._events[e] ? (l(this._events[e]) ? [this._events[e]] : this._events[e].slice()) : []
  30839. }),
  30840. (n.prototype.listenerCount = function (e) {
  30841. if (this._events) {
  30842. var t = this._events[e]
  30843. if (l(t)) return 1
  30844. if (t) return t.length
  30845. }
  30846. return 0
  30847. }),
  30848. (n.listenerCount = function (e, t) {
  30849. return e.listenerCount(t)
  30850. })
  30851. },
  30852. {}
  30853. ],
  30854. 203: [
  30855. function (e, t, i) {
  30856. function n() {
  30857. throw new Error('setTimeout has not been defined')
  30858. }
  30859. function r() {
  30860. throw new Error('clearTimeout has not been defined')
  30861. }
  30862. function o(t) {
  30863. if (h === setTimeout) return setTimeout(t, 0)
  30864. if ((h === n || !h) && setTimeout) return (h = setTimeout), setTimeout(t, 0)
  30865. try {
  30866. return h(t, 0)
  30867. } catch (e) {
  30868. try {
  30869. return h.call(null, t, 0)
  30870. } catch (e) {
  30871. return h.call(this, t, 0)
  30872. }
  30873. }
  30874. }
  30875. function a() {
  30876. g && p && ((g = !1), p.length ? (f = p.concat(f)) : (m = -1), f.length && s())
  30877. }
  30878. function s() {
  30879. if (!g) {
  30880. var e = o(a)
  30881. g = !0
  30882. for (var t = f.length; t; ) {
  30883. for (p = f, f = []; ++m < t; ) p && p[m].run()
  30884. ;(m = -1), (t = f.length)
  30885. }
  30886. ;(p = null),
  30887. (g = !1),
  30888. (function (t) {
  30889. if (u === clearTimeout) return clearTimeout(t)
  30890. if ((u === r || !u) && clearTimeout) return (u = clearTimeout), clearTimeout(t)
  30891. try {
  30892. u(t)
  30893. } catch (e) {
  30894. try {
  30895. return u.call(null, t)
  30896. } catch (e) {
  30897. return u.call(this, t)
  30898. }
  30899. }
  30900. })(e)
  30901. }
  30902. }
  30903. function l(e, t) {
  30904. ;(this.fun = e), (this.array = t)
  30905. }
  30906. function c() {}
  30907. var h,
  30908. u,
  30909. d = (t.exports = {})
  30910. !(function () {
  30911. try {
  30912. h = 'function' == typeof setTimeout ? setTimeout : n
  30913. } catch (e) {
  30914. h = n
  30915. }
  30916. try {
  30917. u = 'function' == typeof clearTimeout ? clearTimeout : r
  30918. } catch (e) {
  30919. u = r
  30920. }
  30921. })()
  30922. var p,
  30923. f = [],
  30924. g = !1,
  30925. m = -1
  30926. ;(d.nextTick = function (e) {
  30927. var t = new Array(arguments.length - 1)
  30928. if (1 < arguments.length) for (var i = 1; i < arguments.length; i++) t[i - 1] = arguments[i]
  30929. f.push(new l(e, t)), 1 !== f.length || g || o(s)
  30930. }),
  30931. (l.prototype.run = function () {
  30932. this.fun.apply(null, this.array)
  30933. }),
  30934. (d.title = 'browser'),
  30935. (d.browser = !0),
  30936. (d.env = {}),
  30937. (d.argv = []),
  30938. (d.version = ''),
  30939. (d.versions = {}),
  30940. (d.on = c),
  30941. (d.addListener = c),
  30942. (d.once = c),
  30943. (d.off = c),
  30944. (d.removeListener = c),
  30945. (d.removeAllListeners = c),
  30946. (d.emit = c),
  30947. (d.binding = function (e) {
  30948. throw new Error('process.binding is not supported')
  30949. }),
  30950. (d.cwd = function () {
  30951. return '/'
  30952. }),
  30953. (d.chdir = function (e) {
  30954. throw new Error('process.chdir is not supported')
  30955. }),
  30956. (d.umask = function () {
  30957. return 0
  30958. })
  30959. },
  30960. {}
  30961. ],
  30962. 204: [
  30963. function (e, O, L) {
  30964. ;(function (P) {
  30965. !(function (e) {
  30966. function v(e) {
  30967. throw new RangeError(g[e])
  30968. }
  30969. function r(e, t) {
  30970. for (var i = e.length, n = []; i--; ) n[i] = t(e[i])
  30971. return n
  30972. }
  30973. function t(e, t) {
  30974. var i = e.split('@'),
  30975. n = ''
  30976. return 1 < i.length && ((n = i[0] + '@'), (e = i[1])), n + r((e = e.replace(f, '.')).split('.'), t).join('.')
  30977. }
  30978. function y(e) {
  30979. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  30980. 55296 <= (t = e.charCodeAt(r++)) && t <= 56319 && r < o
  30981. ? 56320 == (64512 & (i = e.charCodeAt(r++)))
  30982. ? n.push(((1023 & t) << 10) + (1023 & i) + 65536)
  30983. : (n.push(t), r--)
  30984. : n.push(t)
  30985. return n
  30986. }
  30987. function A(e) {
  30988. return r(e, function (e) {
  30989. var t = ''
  30990. return 65535 < e && ((t += R((((e -= 65536) >>> 10) & 1023) | 55296)), (e = 56320 | (1023 & e))), t + R(e)
  30991. }).join('')
  30992. }
  30993. function C(e, t) {
  30994. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  30995. }
  30996. function I(e, t, i) {
  30997. var n = 0
  30998. for (e = i ? M(e / u) : e >> 1, e += M(e / t); (m * w) >> 1 < e; n += _) e = M(e / m)
  30999. return M(n + ((m + 1) * e) / (e + h))
  31000. }
  31001. function i(e) {
  31002. var t,
  31003. i,
  31004. n,
  31005. r,
  31006. o,
  31007. a,
  31008. s,
  31009. l,
  31010. c,
  31011. h,
  31012. u,
  31013. d = [],
  31014. p = e.length,
  31015. f = 0,
  31016. g = x,
  31017. m = T
  31018. 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))
  31019. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  31020. for (
  31021. o = f, a = 1, s = _;
  31022. p <= r && v('invalid-input'),
  31023. (u = e.charCodeAt(r++)),
  31024. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v('overflow'),
  31025. (f += l * a),
  31026. !(l < (c = s <= m ? b : m + w <= s ? w : s - m));
  31027. s += _
  31028. )
  31029. a > M(E / (h = _ - c)) && v('overflow'), (a *= h)
  31030. ;(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)
  31031. }
  31032. return A(d)
  31033. }
  31034. function n(e) {
  31035. var t,
  31036. i,
  31037. n,
  31038. r,
  31039. o,
  31040. a,
  31041. s,
  31042. l,
  31043. c,
  31044. h,
  31045. u,
  31046. d,
  31047. p,
  31048. f,
  31049. g,
  31050. m = []
  31051. for (d = (e = y(e)).length, t = x, o = T, a = i = 0; a < d; ++a) (u = e[a]) < 128 && m.push(R(u))
  31052. for (n = r = m.length, r && m.push(S); n < d; ) {
  31053. for (s = E, a = 0; a < d; ++a) t <= (u = e[a]) && u < s && (s = u)
  31054. for (s - t > M((E - i) / (p = n + 1)) && v('overflow'), i += (s - t) * p, t = s, a = 0; a < d; ++a)
  31055. if (((u = e[a]) < t && ++i > E && v('overflow'), u == t)) {
  31056. 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))
  31057. m.push(R(C(l, 0))), (o = I(i, p, n == r)), (i = 0), ++n
  31058. }
  31059. ++i, ++t
  31060. }
  31061. return m.join('')
  31062. }
  31063. var o = 'object' == typeof L && L && !L.nodeType && L,
  31064. a = 'object' == typeof O && O && !O.nodeType && O,
  31065. s = 'object' == typeof P && P
  31066. ;(s.global !== s && s.window !== s && s.self !== s) || (e = s)
  31067. var l,
  31068. c,
  31069. E = 2147483647,
  31070. _ = 36,
  31071. b = 1,
  31072. w = 26,
  31073. h = 38,
  31074. u = 700,
  31075. T = 72,
  31076. x = 128,
  31077. S = '-',
  31078. d = /^xn--/,
  31079. p = /[^\x20-\x7E]/,
  31080. f = /[\x2E\u3002\uFF0E\uFF61]/g,
  31081. g = {
  31082. overflow: 'Overflow: input needs wider integers to process',
  31083. 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
  31084. 'invalid-input': 'Invalid input'
  31085. },
  31086. m = _ - b,
  31087. M = Math.floor,
  31088. R = String.fromCharCode
  31089. if (
  31090. ((l = {
  31091. version: '1.4.1',
  31092. ucs2: {
  31093. decode: y,
  31094. encode: A
  31095. },
  31096. decode: i,
  31097. encode: n,
  31098. toASCII: function (e) {
  31099. return t(e, function (e) {
  31100. return p.test(e) ? 'xn--' + n(e) : e
  31101. })
  31102. },
  31103. toUnicode: function (e) {
  31104. return t(e, function (e) {
  31105. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  31106. })
  31107. }
  31108. }),
  31109. 'function' == typeof define && 'object' == typeof define.amd && define.amd)
  31110. )
  31111. define('punycode', function () {
  31112. return l
  31113. })
  31114. else if (o && a)
  31115. if (O.exports == o) a.exports = l
  31116. else for (c in l) l.hasOwnProperty(c) && (o[c] = l[c])
  31117. else e.punycode = l
  31118. })(this)
  31119. }).call(this, 'undefined' != typeof global ? global : 'undefined' != typeof self ? self : 'undefined' != typeof window ? window : {})
  31120. },
  31121. {}
  31122. ],
  31123. 205: [
  31124. function (e, t, i) {
  31125. 'use strict'
  31126. t.exports = function (e, t, i, n) {
  31127. ;(t = t || '&'), (i = i || '=')
  31128. var r = {}
  31129. if ('string' != typeof e || 0 === e.length) return r
  31130. var o = /\+/g
  31131. e = e.split(t)
  31132. var a = 1e3
  31133. n && 'number' == typeof n.maxKeys && (a = n.maxKeys)
  31134. var s,
  31135. l,
  31136. c = e.length
  31137. 0 < a && a < c && (c = a)
  31138. for (var h = 0; h < c; ++h) {
  31139. var u,
  31140. d,
  31141. p,
  31142. f,
  31143. g = e[h].replace(o, '%20'),
  31144. m = g.indexOf(i)
  31145. ;(d = 0 <= m ? ((u = g.substr(0, m)), g.substr(m + 1)) : ((u = g), '')),
  31146. (p = decodeURIComponent(u)),
  31147. (f = decodeURIComponent(d)),
  31148. (s = r),
  31149. (l = p),
  31150. Object.prototype.hasOwnProperty.call(s, l) ? (v(r[p]) ? r[p].push(f) : (r[p] = [r[p], f])) : (r[p] = f)
  31151. }
  31152. return r
  31153. }
  31154. var v =
  31155. Array.isArray ||
  31156. function (e) {
  31157. return '[object Array]' === Object.prototype.toString.call(e)
  31158. }
  31159. },
  31160. {}
  31161. ],
  31162. 206: [
  31163. function (e, t, i) {
  31164. 'use strict'
  31165. function o(e, t) {
  31166. if (e.map) return e.map(t)
  31167. for (var i = [], n = 0; n < e.length; n++) i.push(t(e[n], n))
  31168. return i
  31169. }
  31170. function a(e) {
  31171. switch (typeof e) {
  31172. case 'string':
  31173. return e
  31174. case 'boolean':
  31175. return e ? 'true' : 'false'
  31176. case 'number':
  31177. return isFinite(e) ? e : ''
  31178. default:
  31179. return ''
  31180. }
  31181. }
  31182. t.exports = function (i, n, r, e) {
  31183. return (
  31184. (n = n || '&'),
  31185. (r = r || '='),
  31186. null === i && (i = void 0),
  31187. 'object' == typeof i
  31188. ? o(l(i), function (e) {
  31189. var t = encodeURIComponent(a(e)) + r
  31190. return s(i[e])
  31191. ? o(i[e], function (e) {
  31192. return t + encodeURIComponent(a(e))
  31193. }).join(n)
  31194. : t + encodeURIComponent(a(i[e]))
  31195. }).join(n)
  31196. : e
  31197. ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i))
  31198. : ''
  31199. )
  31200. }
  31201. var s =
  31202. Array.isArray ||
  31203. function (e) {
  31204. return '[object Array]' === Object.prototype.toString.call(e)
  31205. },
  31206. l =
  31207. Object.keys ||
  31208. function (e) {
  31209. var t = []
  31210. for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && t.push(i)
  31211. return t
  31212. }
  31213. },
  31214. {}
  31215. ],
  31216. 207: [
  31217. function (e, t, i) {
  31218. 'use strict'
  31219. ;(i.decode = i.parse = e('./decode')), (i.encode = i.stringify = e('./encode'))
  31220. },
  31221. {
  31222. './decode': 205,
  31223. './encode': 206
  31224. }
  31225. ],
  31226. 208: [
  31227. function (e, t, i) {
  31228. 'use strict'
  31229. function x() {
  31230. ;(this.protocol = null),
  31231. (this.slashes = null),
  31232. (this.auth = null),
  31233. (this.host = null),
  31234. (this.port = null),
  31235. (this.hostname = null),
  31236. (this.hash = null),
  31237. (this.search = null),
  31238. (this.query = null),
  31239. (this.pathname = null),
  31240. (this.path = null),
  31241. (this.href = null)
  31242. }
  31243. function n(e, t, i) {
  31244. if (e && D.isObject(e) && e instanceof x) return e
  31245. var n = new x()
  31246. return n.parse(e, t, i), n
  31247. }
  31248. var L = e('punycode'),
  31249. D = e('./util')
  31250. ;(i.parse = n),
  31251. (i.resolve = function (e, t) {
  31252. return n(e, !1, !0).resolve(t)
  31253. }),
  31254. (i.resolveObject = function (e, t) {
  31255. return e ? n(e, !1, !0).resolveObject(t) : t
  31256. }),
  31257. (i.format = function (e) {
  31258. return D.isString(e) && (e = n(e)), e instanceof x ? e.format() : x.prototype.format.call(e)
  31259. }),
  31260. (i.Url = x)
  31261. var N = /^([a-z0-9.+-]+:)/i,
  31262. r = /:[0-9]*$/,
  31263. F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
  31264. o = ['{', '}', '|', '\\', '^', '`'].concat(['<', '>', '"', '`', ' ', '\r', '\n', '\t']),
  31265. B = ["'"].concat(o),
  31266. V = ['%', '/', '?', ';', '#'].concat(B),
  31267. k = ['/', '?', '#'],
  31268. U = /^[+a-z0-9A-Z_-]{0,63}$/,
  31269. H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
  31270. z = {
  31271. javascript: !0,
  31272. 'javascript:': !0
  31273. },
  31274. G = {
  31275. javascript: !0,
  31276. 'javascript:': !0
  31277. },
  31278. W = {
  31279. http: !0,
  31280. https: !0,
  31281. ftp: !0,
  31282. gopher: !0,
  31283. file: !0,
  31284. 'http:': !0,
  31285. 'https:': !0,
  31286. 'ftp:': !0,
  31287. 'gopher:': !0,
  31288. 'file:': !0
  31289. },
  31290. j = e('querystring')
  31291. ;(x.prototype.parse = function (e, t, i) {
  31292. if (!D.isString(e)) throw new TypeError("Parameter 'url' must be a string, not " + typeof e)
  31293. var n = e.indexOf('?'),
  31294. r = -1 !== n && n < e.indexOf('#') ? '?' : '#',
  31295. o = e.split(r)
  31296. o[0] = o[0].replace(/\\/g, '/')
  31297. var a = (e = o.join(r))
  31298. if (((a = a.trim()), !i && 1 === e.split('#').length)) {
  31299. var s = F.exec(a)
  31300. if (s)
  31301. return (
  31302. (this.path = a),
  31303. (this.href = a),
  31304. (this.pathname = s[1]),
  31305. s[2] ? ((this.search = s[2]), (this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1))) : t && ((this.search = ''), (this.query = {})),
  31306. this
  31307. )
  31308. }
  31309. var l = N.exec(a)
  31310. if (l) {
  31311. var c = (l = l[0]).toLowerCase()
  31312. ;(this.protocol = c), (a = a.substr(l.length))
  31313. }
  31314. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31315. var h = '//' === a.substr(0, 2)
  31316. !h || (l && G[l]) || ((a = a.substr(2)), (this.slashes = !0))
  31317. }
  31318. if (!G[l] && (h || (l && !W[l]))) {
  31319. for (var u = -1, d = 0; d < k.length; d++) {
  31320. ;-1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  31321. }
  31322. var p, f
  31323. ;-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)
  31324. for (d = 0; d < V.length; d++) {
  31325. var g
  31326. ;-1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  31327. }
  31328. ;-1 === u && (u = a.length), (this.host = a.slice(0, u)), (a = a.slice(u)), this.parseHost(), (this.hostname = this.hostname || '')
  31329. var m = '[' === this.hostname[0] && ']' === this.hostname[this.hostname.length - 1]
  31330. if (!m)
  31331. for (var v = this.hostname.split(/\./), y = ((d = 0), v.length); d < y; d++) {
  31332. var A = v[d]
  31333. if (A && !A.match(U)) {
  31334. for (var C = '', I = 0, E = A.length; I < E; I++) C += 127 < A.charCodeAt(I) ? 'x' : A[I]
  31335. if (!C.match(U)) {
  31336. var _ = v.slice(0, d),
  31337. b = v.slice(d + 1),
  31338. w = A.match(H)
  31339. w && (_.push(w[1]), b.unshift(w[2])), b.length && (a = '/' + b.join('.') + a), (this.hostname = _.join('.'))
  31340. break
  31341. }
  31342. }
  31343. }
  31344. 255 < this.hostname.length ? (this.hostname = '') : (this.hostname = this.hostname.toLowerCase()), m || (this.hostname = L.toASCII(this.hostname))
  31345. var T = this.port ? ':' + this.port : '',
  31346. x = this.hostname || ''
  31347. ;(this.host = x + T), (this.href += this.host), m && ((this.hostname = this.hostname.substr(1, this.hostname.length - 2)), '/' !== a[0] && (a = '/' + a))
  31348. }
  31349. if (!z[c])
  31350. for (d = 0, y = B.length; d < y; d++) {
  31351. var S = B[d]
  31352. if (-1 !== a.indexOf(S)) {
  31353. var M = encodeURIComponent(S)
  31354. M === S && (M = escape(S)), (a = a.split(S).join(M))
  31355. }
  31356. }
  31357. var R = a.indexOf('#')
  31358. ;-1 !== R && ((this.hash = a.substr(R)), (a = a.slice(0, R)))
  31359. var P = a.indexOf('?')
  31360. if (
  31361. (-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 = {})),
  31362. a && (this.pathname = a),
  31363. W[c] && this.hostname && !this.pathname && (this.pathname = '/'),
  31364. this.pathname || this.search)
  31365. ) {
  31366. T = this.pathname || ''
  31367. var O = this.search || ''
  31368. this.path = T + O
  31369. }
  31370. return (this.href = this.format()), this
  31371. }),
  31372. (x.prototype.format = function () {
  31373. var e = this.auth || ''
  31374. e && ((e = (e = encodeURIComponent(e)).replace(/%3A/i, ':')), (e += '@'))
  31375. var t = this.protocol || '',
  31376. i = this.pathname || '',
  31377. n = this.hash || '',
  31378. r = !1,
  31379. o = ''
  31380. this.host ? (r = e + this.host) : this.hostname && ((r = e + (-1 === this.hostname.indexOf(':') ? this.hostname : '[' + this.hostname + ']')), this.port && (r += ':' + this.port)),
  31381. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query))
  31382. var a = this.search || (o && '?' + o) || ''
  31383. return (
  31384. t && ':' !== t.substr(-1) && (t += ':'),
  31385. this.slashes || ((!t || W[t]) && !1 !== r) ? ((r = '//' + (r || '')), i && '/' !== i.charAt(0) && (i = '/' + i)) : (r = r || ''),
  31386. n && '#' !== n.charAt(0) && (n = '#' + n),
  31387. a && '?' !== a.charAt(0) && (a = '?' + a),
  31388. t +
  31389. r +
  31390. (i = i.replace(/[?#]/g, function (e) {
  31391. return encodeURIComponent(e)
  31392. })) +
  31393. (a = a.replace('#', '%23')) +
  31394. n
  31395. )
  31396. }),
  31397. (x.prototype.resolve = function (e) {
  31398. return this.resolveObject(n(e, !1, !0)).format()
  31399. }),
  31400. (x.prototype.resolveObject = function (e) {
  31401. if (D.isString(e)) {
  31402. var t = new x()
  31403. t.parse(e, !1, !0), (e = t)
  31404. }
  31405. for (var i = new x(), n = Object.keys(this), r = 0; r < n.length; r++) {
  31406. var o = n[r]
  31407. i[o] = this[o]
  31408. }
  31409. if (((i.hash = e.hash), '' === e.href)) return (i.href = i.format()), i
  31410. if (e.slashes && !e.protocol) {
  31411. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  31412. var l = a[s]
  31413. 'protocol' !== l && (i[l] = e[l])
  31414. }
  31415. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = '/'), (i.href = i.format()), i
  31416. }
  31417. if (e.protocol && e.protocol !== i.protocol) {
  31418. if (!W[e.protocol]) {
  31419. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  31420. var u = c[h]
  31421. i[u] = e[u]
  31422. }
  31423. return (i.href = i.format()), i
  31424. }
  31425. if (((i.protocol = e.protocol), e.host || G[e.protocol])) i.pathname = e.pathname
  31426. else {
  31427. for (var d = (e.pathname || '').split('/'); d.length && !(e.host = d.shift()); );
  31428. e.host || (e.host = ''), e.hostname || (e.hostname = ''), '' !== d[0] && d.unshift(''), d.length < 2 && d.unshift(''), (i.pathname = d.join('/'))
  31429. }
  31430. 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)) {
  31431. var p = i.pathname || '',
  31432. f = i.search || ''
  31433. i.path = p + f
  31434. }
  31435. return (i.slashes = i.slashes || e.slashes), (i.href = i.format()), i
  31436. }
  31437. var g = i.pathname && '/' === i.pathname.charAt(0),
  31438. m = e.host || (e.pathname && '/' === e.pathname.charAt(0)),
  31439. v = m || g || (i.host && e.pathname),
  31440. y = v,
  31441. A = (i.pathname && i.pathname.split('/')) || [],
  31442. C = ((d = (e.pathname && e.pathname.split('/')) || []), i.protocol && !W[i.protocol])
  31443. if (
  31444. (C &&
  31445. ((i.hostname = ''),
  31446. (i.port = null),
  31447. i.host && ('' === A[0] ? (A[0] = i.host) : A.unshift(i.host)),
  31448. (i.host = ''),
  31449. e.protocol && ((e.hostname = null), (e.port = null), e.host && ('' === d[0] ? (d[0] = e.host) : d.unshift(e.host)), (e.host = null)),
  31450. (v = v && ('' === d[0] || '' === A[0]))),
  31451. m)
  31452. )
  31453. (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)
  31454. else if (d.length) (A = A || []).pop(), (A = A.concat(d)), (i.search = e.search), (i.query = e.query)
  31455. else if (!D.isNullOrUndefined(e.search)) {
  31456. 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()))
  31457. return (
  31458. (i.search = e.search),
  31459. (i.query = e.query),
  31460. (D.isNull(i.pathname) && D.isNull(i.search)) || (i.path = (i.pathname ? i.pathname : '') + (i.search ? i.search : '')),
  31461. (i.href = i.format()),
  31462. i
  31463. )
  31464. }
  31465. if (!A.length) return (i.pathname = null), i.search ? (i.path = '/' + i.search) : (i.path = null), (i.href = i.format()), i
  31466. 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--)
  31467. '.' === (I = A[b]) ? A.splice(b, 1) : '..' === I ? (A.splice(b, 1), _++) : _ && (A.splice(b, 1), _--)
  31468. if (!v && !y) for (; _--; ) A.unshift('..')
  31469. !v || '' === A[0] || (A[0] && '/' === A[0].charAt(0)) || A.unshift(''), E && '/' !== A.join('/').substr(-1) && A.push('')
  31470. var w,
  31471. T = '' === A[0] || (A[0] && '/' === A[0].charAt(0))
  31472. C &&
  31473. ((i.hostname = i.host = T ? '' : A.length ? A.shift() : ''),
  31474. (w = !!(i.host && 0 < i.host.indexOf('@')) && i.host.split('@')) && ((i.auth = w.shift()), (i.host = i.hostname = w.shift())))
  31475. return (
  31476. (v = v || (i.host && A.length)) && !T && A.unshift(''),
  31477. A.length ? (i.pathname = A.join('/')) : ((i.pathname = null), (i.path = null)),
  31478. (D.isNull(i.pathname) && D.isNull(i.search)) || (i.path = (i.pathname ? i.pathname : '') + (i.search ? i.search : '')),
  31479. (i.auth = e.auth || i.auth),
  31480. (i.slashes = i.slashes || e.slashes),
  31481. (i.href = i.format()),
  31482. i
  31483. )
  31484. }),
  31485. (x.prototype.parseHost = function () {
  31486. var e = this.host,
  31487. t = r.exec(e)
  31488. t && (':' !== (t = t[0]) && (this.port = t.substr(1)), (e = e.substr(0, e.length - t.length))), e && (this.hostname = e)
  31489. })
  31490. },
  31491. {
  31492. './util': 209,
  31493. punycode: 204,
  31494. querystring: 207
  31495. }
  31496. ],
  31497. 209: [
  31498. function (e, t, i) {
  31499. 'use strict'
  31500. t.exports = {
  31501. isString: function (e) {
  31502. return 'string' == typeof e
  31503. },
  31504. isObject: function (e) {
  31505. return 'object' == typeof e && null !== e
  31506. },
  31507. isNull: function (e) {
  31508. return null === e
  31509. },
  31510. isNullOrUndefined: function (e) {
  31511. return null == e
  31512. }
  31513. }
  31514. },
  31515. {}
  31516. ],
  31517. 210: [
  31518. function (e, t, i) {
  31519. 'use strict'
  31520. function r(e) {
  31521. return c + e
  31522. }
  31523. function s(e) {
  31524. if ('string' != typeof e) throw new TypeError('key must be a string.')
  31525. }
  31526. var l = Object.prototype.hasOwnProperty,
  31527. c = '~'
  31528. t.exports = function (t) {
  31529. var o = Object.create(null),
  31530. n = 0,
  31531. a = {}
  31532. return (
  31533. (function (e, t) {
  31534. for (var i in t)
  31535. Object.defineProperty(e, i, {
  31536. value: t[i],
  31537. configurable: !0,
  31538. writable: !0
  31539. })
  31540. })(a, {
  31541. get: function (e, t) {
  31542. s(e)
  31543. var i = r(e)
  31544. return i in o ? o[i] : t
  31545. },
  31546. set: function (e, t) {
  31547. s(e)
  31548. var i = r(e)
  31549. return i in o || ++n, (o[i] = t)
  31550. },
  31551. has: function (e) {
  31552. return s(e), r(e) in o
  31553. },
  31554. delete: function (e) {
  31555. s(e)
  31556. var t = r(e)
  31557. return t in o && (--n, delete o[t], !0)
  31558. },
  31559. clear: function () {
  31560. ;(o = Object.create(null)), (n = 0)
  31561. },
  31562. forEach: function (e, t) {
  31563. if ('function' != typeof e) throw new TypeError('`callback` must be a function')
  31564. for (var i in o)
  31565. if (l.call(o, i)) {
  31566. var n = i.substring(c.length),
  31567. r = o[i]
  31568. e.call(t, r, n, a)
  31569. }
  31570. }
  31571. }),
  31572. Object.defineProperty(a, 'size', {
  31573. get: function () {
  31574. return n
  31575. },
  31576. configurable: !0
  31577. }),
  31578. 'object' == typeof t &&
  31579. null !== t &&
  31580. Object.keys(t).forEach(function (e) {
  31581. a.set(e, t[e])
  31582. }),
  31583. a
  31584. )
  31585. }
  31586. },
  31587. {}
  31588. ],
  31589. 211: [
  31590. function (e, t, i) {
  31591. t.exports = e('./lib/heap')
  31592. },
  31593. {
  31594. './lib/heap': 212
  31595. }
  31596. ],
  31597. 212: [
  31598. function (e, y, A) {
  31599. ;(function () {
  31600. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s
  31601. function v(e) {
  31602. ;(this.cmp = null != e ? e : d), (this.nodes = [])
  31603. }
  31604. ;(l = Math.floor),
  31605. (m = Math.min),
  31606. (d = function (e, t) {
  31607. return e < t ? -1 : t < e ? 1 : 0
  31608. }),
  31609. (g = function (e, t, i, n, r) {
  31610. var o
  31611. if ((null == i && (i = 0), null == r && (r = d), i < 0)) throw new Error('lo must be non-negative')
  31612. for (null == n && (n = e.length); i < n; ) r(t, e[(o = l((i + n) / 2))]) < 0 ? (n = o) : (i = o + 1)
  31613. return [].splice.apply(e, [i, i - i].concat(t)), t
  31614. }),
  31615. (t = function (e, t, i) {
  31616. return null == i && (i = d), e.push(t), h(e, 0, e.length - 1, i)
  31617. }),
  31618. (f = function (e, t) {
  31619. var i, n
  31620. return null == t && (t = d), (i = e.pop()), e.length ? ((n = e[0]), (e[0] = i), u(e, 0, t)) : (n = i), n
  31621. }),
  31622. (i = function (e, t, i) {
  31623. var n
  31624. return null == i && (i = d), (n = e[0]), (e[0] = t), u(e, 0, i), n
  31625. }),
  31626. (c = function (e, t, i) {
  31627. var n
  31628. 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
  31629. }),
  31630. (p = function (i, e) {
  31631. var t, n, r, o, a, s
  31632. for (
  31633. null == e && (e = d),
  31634. a = [],
  31635. n = 0,
  31636. r = (o = function () {
  31637. s = []
  31638. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--) s.push(e)
  31639. return s
  31640. }
  31641. .apply(this)
  31642. .reverse()).length;
  31643. n < r;
  31644. n++
  31645. )
  31646. (t = o[n]), a.push(u(i, t, e))
  31647. return a
  31648. }),
  31649. (o = function (e, t, i) {
  31650. var n
  31651. if ((null == i && (i = d), -1 !== (n = e.indexOf(t)))) return h(e, 0, n, i), u(e, n, i)
  31652. }),
  31653. (n = function (e, t, i) {
  31654. var n, r, o, a, s
  31655. if ((null == i && (i = d), !(r = e.slice(0, t)).length)) return r
  31656. for (p(r, i), o = 0, a = (s = e.slice(t)).length; o < a; o++) (n = s[o]), c(r, n, i)
  31657. return r.sort(i).reverse()
  31658. }),
  31659. (r = function (e, t, i) {
  31660. var n, r, o, a, s, l, c, h, u
  31661. if ((null == i && (i = d), 10 * t <= e.length)) {
  31662. if (!(o = e.slice(0, t).sort(i)).length) return o
  31663. 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]))
  31664. return o
  31665. }
  31666. 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))
  31667. return u
  31668. }),
  31669. (h = function (e, t, i, n) {
  31670. var r, o, a
  31671. for (null == n && (n = d), r = e[i]; t < i && n(r, (o = e[(a = (i - 1) >> 1)])) < 0; ) (e[i] = o), (i = a)
  31672. return (e[i] = r)
  31673. }),
  31674. (u = function (e, t, i) {
  31675. var n, r, o, a, s
  31676. 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)
  31677. return (e[t] = o), h(e, s, t, i)
  31678. }),
  31679. (v.push = t),
  31680. (v.pop = f),
  31681. (v.replace = i),
  31682. (v.pushpop = c),
  31683. (v.heapify = p),
  31684. (v.updateItem = o),
  31685. (v.nlargest = n),
  31686. (v.nsmallest = r),
  31687. (v.prototype.push = function (e) {
  31688. return t(this.nodes, e, this.cmp)
  31689. }),
  31690. (v.prototype.pop = function () {
  31691. return f(this.nodes, this.cmp)
  31692. }),
  31693. (v.prototype.peek = function () {
  31694. return this.nodes[0]
  31695. }),
  31696. (v.prototype.contains = function (e) {
  31697. return -1 !== this.nodes.indexOf(e)
  31698. }),
  31699. (v.prototype.replace = function (e) {
  31700. return i(this.nodes, e, this.cmp)
  31701. }),
  31702. (v.prototype.pushpop = function (e) {
  31703. return c(this.nodes, e, this.cmp)
  31704. }),
  31705. (v.prototype.heapify = function () {
  31706. return p(this.nodes, this.cmp)
  31707. }),
  31708. (v.prototype.updateItem = function (e) {
  31709. return o(this.nodes, e, this.cmp)
  31710. }),
  31711. (v.prototype.clear = function () {
  31712. return (this.nodes = [])
  31713. }),
  31714. (v.prototype.empty = function () {
  31715. return 0 === this.nodes.length
  31716. }),
  31717. (v.prototype.size = function () {
  31718. return this.nodes.length
  31719. }),
  31720. (v.prototype.clone = function () {
  31721. var e
  31722. return ((e = new v()).nodes = this.nodes.slice(0)), e
  31723. }),
  31724. (v.prototype.toArray = function () {
  31725. return this.nodes.slice(0)
  31726. }),
  31727. (v.prototype.insert = v.prototype.push),
  31728. (v.prototype.top = v.prototype.peek),
  31729. (v.prototype.front = v.prototype.peek),
  31730. (v.prototype.has = v.prototype.contains),
  31731. (v.prototype.copy = v.prototype.clone),
  31732. (e = v),
  31733. (a = this),
  31734. (s = function () {
  31735. return e
  31736. }),
  31737. 'function' == typeof define && define.amd ? define([], s) : 'object' == typeof A ? (y.exports = s()) : (a.Heap = s())
  31738. }).call(this)
  31739. },
  31740. {}
  31741. ],
  31742. 213: [
  31743. function (e, t, i) {
  31744. function n() {}
  31745. function o(e) {
  31746. if ('object' != typeof this) throw new TypeError('Promises must be constructed via new')
  31747. if ('function' != typeof e) throw new TypeError('not a function')
  31748. ;(this._state = 0), (this._handled = !1), (this._value = void 0), (this._deferreds = []), h(e, this)
  31749. }
  31750. function r(i, n) {
  31751. for (; 3 === i._state; ) i = i._value
  31752. return 0 === i._state
  31753. ? void i._deferreds.push(n)
  31754. : ((i._handled = !0),
  31755. void o._immediateFn(function () {
  31756. var e = 1 === i._state ? n.onFulfilled : n.onRejected
  31757. if (null !== e) {
  31758. var t
  31759. try {
  31760. t = e(i._value)
  31761. } catch (e) {
  31762. return void s(n.promise, e)
  31763. }
  31764. a(n.promise, t)
  31765. } else (1 === i._state ? a : s)(n.promise, i._value)
  31766. }))
  31767. }
  31768. function a(e, t) {
  31769. try {
  31770. if (t === e) throw new TypeError('A promise cannot be resolved with itself.')
  31771. if (t && ('object' == typeof t || 'function' == typeof t)) {
  31772. var i = t.then
  31773. if (t instanceof o) return (e._state = 3), (e._value = t), void l(e)
  31774. if ('function' == typeof i)
  31775. return void h(
  31776. (function (e, t) {
  31777. return function () {
  31778. e.apply(t, arguments)
  31779. }
  31780. })(i, t),
  31781. e
  31782. )
  31783. }
  31784. ;(e._state = 1), (e._value = t), l(e)
  31785. } catch (t) {
  31786. s(e, t)
  31787. }
  31788. }
  31789. function s(e, t) {
  31790. ;(e._state = 2), (e._value = t), l(e)
  31791. }
  31792. function l(e) {
  31793. 2 === e._state &&
  31794. 0 === e._deferreds.length &&
  31795. o._immediateFn(function () {
  31796. e._handled || o._unhandledRejectionFn(e._value)
  31797. })
  31798. for (var t = 0, i = e._deferreds.length; t < i; t++) r(e, e._deferreds[t])
  31799. e._deferreds = null
  31800. }
  31801. function c(e, t, i) {
  31802. ;(this.onFulfilled = 'function' == typeof e ? e : null), (this.onRejected = 'function' == typeof t ? t : null), (this.promise = i)
  31803. }
  31804. function h(e, t) {
  31805. var i = !1
  31806. try {
  31807. e(
  31808. function (e) {
  31809. i || ((i = !0), a(t, e))
  31810. },
  31811. function (e) {
  31812. i || ((i = !0), s(t, e))
  31813. }
  31814. )
  31815. } catch (e) {
  31816. if (i) return
  31817. ;(i = !0), s(t, e)
  31818. }
  31819. }
  31820. var u, d
  31821. ;(u = this),
  31822. (d = setTimeout),
  31823. (o.prototype.catch = function (e) {
  31824. return this.then(null, e)
  31825. }),
  31826. (o.prototype.then = function (e, t) {
  31827. var i = new this.constructor(n)
  31828. return r(this, new c(e, t, i)), i
  31829. }),
  31830. (o.all = function (e) {
  31831. var s = Array.prototype.slice.call(e)
  31832. return new o(function (n, r) {
  31833. function o(t, e) {
  31834. try {
  31835. if (e && ('object' == typeof e || 'function' == typeof e)) {
  31836. var i = e.then
  31837. if ('function' == typeof i)
  31838. return void i.call(
  31839. e,
  31840. function (e) {
  31841. o(t, e)
  31842. },
  31843. r
  31844. )
  31845. }
  31846. ;(s[t] = e), 0 == --a && n(s)
  31847. } catch (e) {
  31848. r(e)
  31849. }
  31850. }
  31851. if (0 === s.length) return n([])
  31852. for (var a = s.length, e = 0; e < s.length; e++) o(e, s[e])
  31853. })
  31854. }),
  31855. (o.resolve = function (t) {
  31856. return t && 'object' == typeof t && t.constructor === o
  31857. ? t
  31858. : new o(function (e) {
  31859. e(t)
  31860. })
  31861. }),
  31862. (o.reject = function (i) {
  31863. return new o(function (e, t) {
  31864. t(i)
  31865. })
  31866. }),
  31867. (o.race = function (r) {
  31868. return new o(function (e, t) {
  31869. for (var i = 0, n = r.length; i < n; i++) r[i].then(e, t)
  31870. })
  31871. }),
  31872. (o._immediateFn =
  31873. ('function' == typeof setImmediate &&
  31874. function (e) {
  31875. setImmediate(e)
  31876. }) ||
  31877. function (e) {
  31878. d(e, 0)
  31879. }),
  31880. (o._unhandledRejectionFn = function (e) {
  31881. 'undefined' != typeof console && console && console.warn('Possible Unhandled Promise Rejection:', e)
  31882. }),
  31883. (o._setImmediateFn = function (e) {
  31884. o._immediateFn = e
  31885. }),
  31886. (o._setUnhandledRejectionFn = function (e) {
  31887. o._unhandledRejectionFn = e
  31888. }),
  31889. void 0 !== t && t.exports ? (t.exports = o) : u.Promise || (u.Promise = o)
  31890. },
  31891. {}
  31892. ],
  31893. 214: [
  31894. function (p, i, e) {
  31895. ;(function (d) {
  31896. var e, t
  31897. ;(e = this),
  31898. (t = function (I, e) {
  31899. 'use strict'
  31900. var a,
  31901. t,
  31902. u,
  31903. i,
  31904. s,
  31905. n,
  31906. r,
  31907. o = {}
  31908. return (
  31909. (o.ByteBuffer = I),
  31910. (o.Long = I.Long || null),
  31911. (o.VERSION = '5.0.1'),
  31912. (o.WIRE_TYPES = {}),
  31913. (o.WIRE_TYPES.VARINT = 0),
  31914. (o.WIRE_TYPES.BITS64 = 1),
  31915. (o.WIRE_TYPES.LDELIM = 2),
  31916. (o.WIRE_TYPES.STARTGROUP = 3),
  31917. (o.WIRE_TYPES.ENDGROUP = 4),
  31918. (o.WIRE_TYPES.BITS32 = 5),
  31919. (o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32]),
  31920. (o.TYPES = {
  31921. int32: {
  31922. name: 'int32',
  31923. wireType: o.WIRE_TYPES.VARINT,
  31924. defaultValue: 0
  31925. },
  31926. uint32: {
  31927. name: 'uint32',
  31928. wireType: o.WIRE_TYPES.VARINT,
  31929. defaultValue: 0
  31930. },
  31931. sint32: {
  31932. name: 'sint32',
  31933. wireType: o.WIRE_TYPES.VARINT,
  31934. defaultValue: 0
  31935. },
  31936. int64: {
  31937. name: 'int64',
  31938. wireType: o.WIRE_TYPES.VARINT,
  31939. defaultValue: o.Long ? o.Long.ZERO : void 0
  31940. },
  31941. uint64: {
  31942. name: 'uint64',
  31943. wireType: o.WIRE_TYPES.VARINT,
  31944. defaultValue: o.Long ? o.Long.UZERO : void 0
  31945. },
  31946. sint64: {
  31947. name: 'sint64',
  31948. wireType: o.WIRE_TYPES.VARINT,
  31949. defaultValue: o.Long ? o.Long.ZERO : void 0
  31950. },
  31951. bool: {
  31952. name: 'bool',
  31953. wireType: o.WIRE_TYPES.VARINT,
  31954. defaultValue: !1
  31955. },
  31956. double: {
  31957. name: 'double',
  31958. wireType: o.WIRE_TYPES.BITS64,
  31959. defaultValue: 0
  31960. },
  31961. string: {
  31962. name: 'string',
  31963. wireType: o.WIRE_TYPES.LDELIM,
  31964. defaultValue: ''
  31965. },
  31966. bytes: {
  31967. name: 'bytes',
  31968. wireType: o.WIRE_TYPES.LDELIM,
  31969. defaultValue: null
  31970. },
  31971. fixed32: {
  31972. name: 'fixed32',
  31973. wireType: o.WIRE_TYPES.BITS32,
  31974. defaultValue: 0
  31975. },
  31976. sfixed32: {
  31977. name: 'sfixed32',
  31978. wireType: o.WIRE_TYPES.BITS32,
  31979. defaultValue: 0
  31980. },
  31981. fixed64: {
  31982. name: 'fixed64',
  31983. wireType: o.WIRE_TYPES.BITS64,
  31984. defaultValue: o.Long ? o.Long.UZERO : void 0
  31985. },
  31986. sfixed64: {
  31987. name: 'sfixed64',
  31988. wireType: o.WIRE_TYPES.BITS64,
  31989. defaultValue: o.Long ? o.Long.ZERO : void 0
  31990. },
  31991. float: {
  31992. name: 'float',
  31993. wireType: o.WIRE_TYPES.BITS32,
  31994. defaultValue: 0
  31995. },
  31996. enum: {
  31997. name: 'enum',
  31998. wireType: o.WIRE_TYPES.VARINT,
  31999. defaultValue: 0
  32000. },
  32001. message: {
  32002. name: 'message',
  32003. wireType: o.WIRE_TYPES.LDELIM,
  32004. defaultValue: null
  32005. },
  32006. group: {
  32007. name: 'group',
  32008. wireType: o.WIRE_TYPES.STARTGROUP,
  32009. defaultValue: null
  32010. }
  32011. }),
  32012. (o.MAP_KEY_TYPES = [
  32013. o.TYPES.int32,
  32014. o.TYPES.sint32,
  32015. o.TYPES.sfixed32,
  32016. o.TYPES.uint32,
  32017. o.TYPES.fixed32,
  32018. o.TYPES.int64,
  32019. o.TYPES.sint64,
  32020. o.TYPES.sfixed64,
  32021. o.TYPES.uint64,
  32022. o.TYPES.fixed64,
  32023. o.TYPES.bool,
  32024. o.TYPES.string,
  32025. o.TYPES.bytes
  32026. ]),
  32027. (o.ID_MIN = 1),
  32028. (o.ID_MAX = 536870911),
  32029. (o.convertFieldsToCamelCase = !1),
  32030. (o.populateAccessors = !0),
  32031. (o.populateDefaults = !0),
  32032. (o.Util =
  32033. (((r = {}).IS_NODE = !('object' != typeof d || d + '' != '[object process]' || d.browser)),
  32034. (r.XHR = function () {
  32035. for (
  32036. var e = [
  32037. function () {
  32038. return new XMLHttpRequest()
  32039. },
  32040. function () {
  32041. return new ActiveXObject('Msxml2.XMLHTTP')
  32042. },
  32043. function () {
  32044. return new ActiveXObject('Msxml3.XMLHTTP')
  32045. },
  32046. function () {
  32047. return new ActiveXObject('Microsoft.XMLHTTP')
  32048. }
  32049. ],
  32050. t = null,
  32051. i = 0;
  32052. i < e.length;
  32053. i++
  32054. ) {
  32055. try {
  32056. t = e[i]()
  32057. } catch (e) {
  32058. continue
  32059. }
  32060. break
  32061. }
  32062. if (!t) throw Error('XMLHttpRequest is not supported')
  32063. return t
  32064. }),
  32065. (r.fetch = function (e, i) {
  32066. if ((i && 'function' != typeof i && (i = null), r.IS_NODE)) {
  32067. var t = p('fs')
  32068. if (i)
  32069. t.readFile(e, function (e, t) {
  32070. i(e ? null : '' + t)
  32071. })
  32072. else
  32073. try {
  32074. return t.readFileSync(e)
  32075. } catch (e) {
  32076. return null
  32077. }
  32078. } else {
  32079. var n = r.XHR()
  32080. if ((n.open('GET', e, !!i), n.setRequestHeader('Accept', 'text/plain'), 'function' == typeof n.overrideMimeType && n.overrideMimeType('text/plain'), !i))
  32081. return n.send(null), 200 == n.status || (0 == n.status && 'string' == typeof n.responseText) ? n.responseText : null
  32082. if (
  32083. ((n.onreadystatechange = function () {
  32084. 4 == n.readyState && i(200 == n.status || (0 == n.status && 'string' == typeof n.responseText) ? n.responseText : null)
  32085. }),
  32086. 4 == n.readyState)
  32087. )
  32088. return
  32089. n.send(null)
  32090. }
  32091. }),
  32092. (r.toCamelCase = function (e) {
  32093. return e.replace(/_([a-zA-Z])/g, function (e, t) {
  32094. return t.toUpperCase()
  32095. })
  32096. }),
  32097. r)),
  32098. (o.Lang = {
  32099. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32100. RULE: /^(?:required|optional|repeated|map)$/,
  32101. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32102. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32103. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32104. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32105. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32106. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32107. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32108. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32109. NUMBER_OCT: /^0[0-7]+$/,
  32110. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32111. BOOL: /^(?:true|false)$/i,
  32112. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32113. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32114. WHITESPACE: /\s/,
  32115. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32116. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32117. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32118. }),
  32119. (o.DotProto = (function (r, a) {
  32120. function s(e, t) {
  32121. var i = -1,
  32122. n = 1
  32123. if (('-' == e.charAt(0) && ((n = -1), (e = e.substring(1))), a.NUMBER_DEC.test(e))) i = parseInt(e)
  32124. else if (a.NUMBER_HEX.test(e)) i = parseInt(e.substring(2), 16)
  32125. else {
  32126. if (!a.NUMBER_OCT.test(e)) throw Error('illegal id value: ' + (n < 0 ? '-' : '') + e)
  32127. i = parseInt(e.substring(1), 8)
  32128. }
  32129. if (((i = (n * i) | 0), !t && i < 0)) throw Error('illegal id value: ' + (n < 0 ? '-' : '') + e)
  32130. return i
  32131. }
  32132. function o(e) {
  32133. var t = 1
  32134. if (('-' == e.charAt(0) && ((t = -1), (e = e.substring(1))), a.NUMBER_DEC.test(e))) return t * parseInt(e, 10)
  32135. if (a.NUMBER_HEX.test(e)) return t * parseInt(e.substring(2), 16)
  32136. if (a.NUMBER_OCT.test(e)) return t * parseInt(e.substring(1), 8)
  32137. if ('inf' === e) return t * (1 / 0)
  32138. if ('nan' === e) return NaN
  32139. if (a.NUMBER_FLT.test(e)) return t * parseFloat(e)
  32140. throw Error('illegal number value: ' + (t < 0 ? '-' : '') + e)
  32141. }
  32142. function n(e, t, i) {
  32143. void 0 === e[t] ? (e[t] = i) : (Array.isArray(e[t]) || (e[t] = [e[t]]), e[t].push(i))
  32144. }
  32145. function t(e) {
  32146. ;(this.source = e + ''), (this.index = 0), (this.line = 1), (this.stack = []), (this._stringOpen = null)
  32147. }
  32148. var e = {},
  32149. i = t.prototype
  32150. ;(i._readString = function () {
  32151. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ
  32152. e.lastIndex = this.index - 1
  32153. var t = e.exec(this.source)
  32154. if (!t) throw Error('unterminated string')
  32155. return (this.index = e.lastIndex), this.stack.push(this._stringOpen), (this._stringOpen = null), t[1]
  32156. }),
  32157. (i.next = function () {
  32158. if (0 < this.stack.length) return this.stack.shift()
  32159. if (this.index >= this.source.length) return null
  32160. if (null !== this._stringOpen) return this._readString()
  32161. var e, t, i
  32162. do {
  32163. for (e = !1; a.WHITESPACE.test((i = this.source.charAt(this.index))); ) if (('\n' === i && ++this.line, ++this.index === this.source.length)) return null
  32164. if ('/' === this.source.charAt(this.index))
  32165. if ((++this.index, '/' === this.source.charAt(this.index))) {
  32166. for (; '\n' !== this.source.charAt(++this.index); ) if (this.index == this.source.length) return null
  32167. ++this.index, ++this.line, (e = !0)
  32168. } else {
  32169. if ('*' !== (i = this.source.charAt(this.index))) return '/'
  32170. do {
  32171. if (('\n' === i && ++this.line, ++this.index === this.source.length)) return null
  32172. ;(t = i), (i = this.source.charAt(this.index))
  32173. } while ('*' !== t || '/' !== i)
  32174. ++this.index, (e = !0)
  32175. }
  32176. } while (e)
  32177. if (this.index === this.source.length) return null
  32178. var n = this.index
  32179. 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
  32180. var r = this.source.substring(this.index, (this.index = n))
  32181. return ('"' !== r && "'" !== r) || (this._stringOpen = r), r
  32182. }),
  32183. (i.peek = function () {
  32184. if (0 === this.stack.length) {
  32185. var e = this.next()
  32186. if (null === e) return null
  32187. this.stack.push(e)
  32188. }
  32189. return this.stack[0]
  32190. }),
  32191. (i.skip = function (e) {
  32192. var t = this.next()
  32193. if (t !== e) throw Error("illegal '" + t + "', '" + e + "' expected")
  32194. }),
  32195. (i.omit = function (e) {
  32196. return this.peek() === e && (this.next(), !0)
  32197. }),
  32198. (i.toString = function () {
  32199. return 'Tokenizer (' + this.index + '/' + this.source.length + ' at line ' + this.line + ')'
  32200. }),
  32201. (e.Tokenizer = t)
  32202. function l(e) {
  32203. ;(this.tn = new t(e)), (this.proto3 = !1)
  32204. }
  32205. var c = l.prototype
  32206. return (
  32207. (c.parse = function () {
  32208. var e,
  32209. t,
  32210. i = {
  32211. name: '[ROOT]',
  32212. package: null,
  32213. messages: [],
  32214. enums: [],
  32215. imports: [],
  32216. options: {},
  32217. services: []
  32218. },
  32219. n = !0
  32220. try {
  32221. for (; (e = this.tn.next()); )
  32222. switch (e) {
  32223. case 'package':
  32224. if (!n || null !== i.package) throw Error("unexpected 'package'")
  32225. if (((e = this.tn.next()), !a.TYPEREF.test(e))) throw Error('illegal package name: ' + e)
  32226. this.tn.skip(';'), (i.package = e)
  32227. break
  32228. case 'import':
  32229. if (!n) throw Error("unexpected 'import'")
  32230. ;('public' !== (e = this.tn.peek()) && !(t = 'weak' === e)) || this.tn.next(), (e = this._readString()), this.tn.skip(';'), t || i.imports.push(e)
  32231. break
  32232. case 'syntax':
  32233. if (!n) throw Error("unexpected 'syntax'")
  32234. this.tn.skip('='), 'proto3' === (i.syntax = this._readString()) && (this.proto3 = !0), this.tn.skip(';')
  32235. break
  32236. case 'message':
  32237. this._parseMessage(i, null), (n = !1)
  32238. break
  32239. case 'enum':
  32240. this._parseEnum(i), (n = !1)
  32241. break
  32242. case 'option':
  32243. this._parseOption(i)
  32244. break
  32245. case 'service':
  32246. this._parseService(i)
  32247. break
  32248. case 'extend':
  32249. this._parseExtend(i)
  32250. break
  32251. default:
  32252. throw Error("unexpected '" + e + "'")
  32253. }
  32254. } catch (e) {
  32255. throw ((e.message = 'Parse error at line ' + this.tn.line + ': ' + e.message), e)
  32256. }
  32257. return delete i.name, i
  32258. }),
  32259. (l.parse = function (e) {
  32260. return new l(e).parse()
  32261. }),
  32262. (c._readString = function () {
  32263. var e,
  32264. t,
  32265. i = ''
  32266. do {
  32267. if ("'" !== (t = this.tn.next()) && '"' !== t) throw Error('illegal string delimiter: ' + t)
  32268. ;(i += this.tn.next()), this.tn.skip(t), (e = this.tn.peek())
  32269. } while ('"' === e || '"' === e)
  32270. return i
  32271. }),
  32272. (c._readValue = function (e) {
  32273. var t = this.tn.peek()
  32274. if ('"' === t || "'" === t) return this._readString()
  32275. if ((this.tn.next(), a.NUMBER.test(t))) return o(t)
  32276. if (a.BOOL.test(t)) return 'true' === t.toLowerCase()
  32277. if (e && a.TYPEREF.test(t)) return t
  32278. throw Error('illegal value: ' + t)
  32279. }),
  32280. (c._parseOption = function (e, t) {
  32281. var i = this.tn.next(),
  32282. n = !1
  32283. if (('(' === i && ((n = !0), (i = this.tn.next())), !a.TYPEREF.test(i))) throw Error('illegal option name: ' + i)
  32284. var r = i
  32285. n && (this.tn.skip(')'), (r = '(' + r + ')'), (i = this.tn.peek()), a.FQTYPEREF.test(i) && ((r += i), this.tn.next())),
  32286. this.tn.skip('='),
  32287. this._parseOptionValue(e, r),
  32288. t || this.tn.skip(';')
  32289. }),
  32290. (c._parseOptionValue = function (e, t) {
  32291. var i = this.tn.peek()
  32292. if ('{' !== i) n(e.options, t, this._readValue(!0))
  32293. else
  32294. for (this.tn.skip('{'); '}' !== (i = this.tn.next()); ) {
  32295. if (!a.NAME.test(i)) throw Error('illegal option name: ' + t + '.' + i)
  32296. this.tn.omit(':') ? n(e.options, t + '.' + i, this._readValue(!0)) : this._parseOptionValue(e, t + '.' + i)
  32297. }
  32298. }),
  32299. (c._parseService = function (e) {
  32300. var t = this.tn.next()
  32301. if (!a.NAME.test(t)) throw Error('illegal service name at line ' + this.tn.line + ': ' + t)
  32302. var i = {
  32303. name: t,
  32304. rpc: {},
  32305. options: {}
  32306. }
  32307. for (this.tn.skip('{'); '}' !== (t = this.tn.next()); )
  32308. if ('option' === t) this._parseOption(i)
  32309. else {
  32310. if ('rpc' !== t) throw Error('illegal service token: ' + t)
  32311. this._parseServiceRPC(i)
  32312. }
  32313. this.tn.omit(';'), e.services.push(i)
  32314. }),
  32315. (c._parseServiceRPC = function (e) {
  32316. var t = this.tn.next()
  32317. if (!a.NAME.test(t)) throw Error('illegal rpc service method name: ' + t)
  32318. var i = t,
  32319. n = {
  32320. request: null,
  32321. response: null,
  32322. request_stream: !1,
  32323. response_stream: !1,
  32324. options: {}
  32325. }
  32326. if ((this.tn.skip('('), 'stream' === (t = this.tn.next()).toLowerCase() && ((n.request_stream = !0), (t = this.tn.next())), !a.TYPEREF.test(t)))
  32327. throw Error('illegal rpc service request type: ' + t)
  32328. if (((n.request = t), this.tn.skip(')'), 'returns' !== (t = this.tn.next()).toLowerCase())) throw Error('illegal rpc service request type delimiter: ' + t)
  32329. if (
  32330. (this.tn.skip('('),
  32331. 'stream' === (t = this.tn.next()).toLowerCase() && ((n.response_stream = !0), (t = this.tn.next())),
  32332. (n.response = t),
  32333. this.tn.skip(')'),
  32334. '{' === (t = this.tn.peek()))
  32335. ) {
  32336. for (this.tn.next(); '}' !== (t = this.tn.next()); ) {
  32337. if ('option' !== t) throw Error('illegal rpc service token: ' + t)
  32338. this._parseOption(n)
  32339. }
  32340. this.tn.omit(';')
  32341. } else this.tn.skip(';')
  32342. void 0 === e.rpc && (e.rpc = {}), (e.rpc[i] = n)
  32343. }),
  32344. (c._parseMessage = function (e, t) {
  32345. var i = !!t,
  32346. n = this.tn.next(),
  32347. r = {
  32348. name: '',
  32349. fields: [],
  32350. enums: [],
  32351. messages: [],
  32352. options: {},
  32353. services: [],
  32354. oneofs: {}
  32355. }
  32356. if (!a.NAME.test(n)) throw Error('illegal ' + (i ? 'group' : 'message') + ' name: ' + n)
  32357. for (
  32358. 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('{');
  32359. '}' !== (n = this.tn.next());
  32360. )
  32361. if (a.RULE.test(n)) this._parseMessageField(r, n)
  32362. else if ('oneof' === n) this._parseMessageOneOf(r)
  32363. else if ('enum' === n) this._parseEnum(r)
  32364. else if ('message' === n) this._parseMessage(r)
  32365. else if ('option' === n) this._parseOption(r)
  32366. else if ('service' === n) this._parseService(r)
  32367. else if ('extensions' === n) r.extensions = this._parseExtensionRanges()
  32368. else if ('reserved' === n) this._parseIgnored()
  32369. else if ('extend' === n) this._parseExtend(r)
  32370. else {
  32371. if (!a.TYPEREF.test(n)) throw Error('illegal message token: ' + n)
  32372. if (!this.proto3) throw Error('illegal field rule: ' + n)
  32373. this._parseMessageField(r, 'optional', n)
  32374. }
  32375. return this.tn.omit(';'), e.messages.push(r), r
  32376. }),
  32377. (c._parseIgnored = function () {
  32378. for (; ';' !== this.tn.peek(); ) this.tn.next()
  32379. this.tn.skip(';')
  32380. }),
  32381. (c._parseMessageField = function (e, t, i) {
  32382. if (!a.RULE.test(t)) throw Error('illegal message field rule: ' + t)
  32383. var n,
  32384. r = {
  32385. rule: t,
  32386. type: '',
  32387. name: '',
  32388. options: {},
  32389. id: 0
  32390. }
  32391. if ('map' === t) {
  32392. if (i) throw Error('illegal type: ' + i)
  32393. if ((this.tn.skip('<'), (n = this.tn.next()), !a.TYPE.test(n) && !a.TYPEREF.test(n))) throw Error('illegal message field type: ' + n)
  32394. 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)
  32395. if (((r.type = n), this.tn.skip('>'), (n = this.tn.next()), !a.NAME.test(n))) throw Error('illegal message field name: ' + n)
  32396. ;(r.name = n), this.tn.skip('='), (r.id = s(this.tn.next())), '[' === (n = this.tn.peek()) && this._parseFieldOptions(r), this.tn.skip(';')
  32397. } else if ('group' === (i = void 0 !== i ? i : this.tn.next())) {
  32398. var o = this._parseMessage(e, r)
  32399. if (!/^[A-Z]/.test(o.name)) throw Error('illegal group name: ' + o.name)
  32400. ;(r.type = o.name), (r.name = o.name.toLowerCase()), this.tn.omit(';')
  32401. } else {
  32402. if (!a.TYPE.test(i) && !a.TYPEREF.test(i)) throw Error('illegal message field type: ' + i)
  32403. if (((r.type = i), (n = this.tn.next()), !a.NAME.test(n))) throw Error('illegal message field name: ' + n)
  32404. ;(r.name = n), this.tn.skip('='), (r.id = s(this.tn.next())), '[' === (n = this.tn.peek()) && this._parseFieldOptions(r), this.tn.skip(';')
  32405. }
  32406. return e.fields.push(r), r
  32407. }),
  32408. (c._parseMessageOneOf = function (e) {
  32409. var t = this.tn.next()
  32410. if (!a.NAME.test(t)) throw Error('illegal oneof name: ' + t)
  32411. var i,
  32412. n = t,
  32413. r = []
  32414. for (this.tn.skip('{'); '}' !== (t = this.tn.next()); ) ((i = this._parseMessageField(e, 'optional', t)).oneof = n), r.push(i.id)
  32415. this.tn.omit(';'), (e.oneofs[n] = r)
  32416. }),
  32417. (c._parseFieldOptions = function (e) {
  32418. this.tn.skip('[')
  32419. for (var t = !0; ']' !== this.tn.peek(); ) t || this.tn.skip(','), this._parseOption(e, !0), (t = !1)
  32420. this.tn.next()
  32421. }),
  32422. (c._parseEnum = function (e) {
  32423. var t = {
  32424. name: '',
  32425. values: [],
  32426. options: {}
  32427. },
  32428. i = this.tn.next()
  32429. if (!a.NAME.test(i)) throw Error('illegal name: ' + i)
  32430. for (t.name = i, this.tn.skip('{'); '}' !== (i = this.tn.next()); )
  32431. if ('option' === i) this._parseOption(t)
  32432. else {
  32433. if (!a.NAME.test(i)) throw Error('illegal name: ' + i)
  32434. this.tn.skip('=')
  32435. var n = {
  32436. name: i,
  32437. id: s(this.tn.next(), !0)
  32438. }
  32439. '[' === (i = this.tn.peek()) &&
  32440. this._parseFieldOptions({
  32441. options: {}
  32442. }),
  32443. this.tn.skip(';'),
  32444. t.values.push(n)
  32445. }
  32446. this.tn.omit(';'), e.enums.push(t)
  32447. }),
  32448. (c._parseExtensionRanges = function () {
  32449. var e,
  32450. t,
  32451. i,
  32452. n = []
  32453. do {
  32454. for (t = []; ; ) {
  32455. switch ((e = this.tn.next())) {
  32456. case 'min':
  32457. i = r.ID_MIN
  32458. break
  32459. case 'max':
  32460. i = r.ID_MAX
  32461. break
  32462. default:
  32463. i = o(e)
  32464. }
  32465. if ((t.push(i), 2 === t.length)) break
  32466. if ('to' !== this.tn.peek()) {
  32467. t.push(i)
  32468. break
  32469. }
  32470. this.tn.next()
  32471. }
  32472. n.push(t)
  32473. } while (this.tn.omit(','))
  32474. return this.tn.skip(';'), n
  32475. }),
  32476. (c._parseExtend = function (e) {
  32477. var t = this.tn.next()
  32478. if (!a.TYPEREF.test(t)) throw Error('illegal extend reference: ' + t)
  32479. var i = {
  32480. ref: t,
  32481. fields: []
  32482. }
  32483. for (this.tn.skip('{'); '}' !== (t = this.tn.next()); )
  32484. if (a.RULE.test(t)) this._parseMessageField(i, t)
  32485. else {
  32486. if (!a.TYPEREF.test(t)) throw Error('illegal extend token: ' + t)
  32487. if (!this.proto3) throw Error('illegal field rule: ' + t)
  32488. this._parseMessageField(i, 'optional', t)
  32489. }
  32490. return this.tn.omit(';'), e.messages.push(i), i
  32491. }),
  32492. (c.toString = function () {
  32493. return 'Parser at line ' + this.tn.line
  32494. }),
  32495. (e.Parser = l),
  32496. e
  32497. )
  32498. })(o, o.Lang)),
  32499. (o.Reflect = (function (g) {
  32500. function a(e, t) {
  32501. if (e && 'number' == typeof e.low && 'number' == typeof e.high && 'boolean' == typeof e.unsigned && e.low == e.low && e.high == e.high)
  32502. return new g.Long(e.low, e.high, void 0 === t ? e.unsigned : t)
  32503. if ('string' == typeof e) return g.Long.fromString(e, t || !1, 10)
  32504. if ('number' == typeof e) return g.Long.fromNumber(e, t || !1)
  32505. throw Error('not convertible to Long')
  32506. }
  32507. function m(e, t) {
  32508. var i = t.readVarint32(),
  32509. n = 7 & i,
  32510. r = i >>> 3
  32511. switch (n) {
  32512. case g.WIRE_TYPES.VARINT:
  32513. for (; 128 == (128 & (i = t.readUint8())); );
  32514. break
  32515. case g.WIRE_TYPES.BITS64:
  32516. t.offset += 8
  32517. break
  32518. case g.WIRE_TYPES.LDELIM:
  32519. ;(i = t.readVarint32()), (t.offset += i)
  32520. break
  32521. case g.WIRE_TYPES.STARTGROUP:
  32522. m(r, t)
  32523. break
  32524. case g.WIRE_TYPES.ENDGROUP:
  32525. if (r === e) return !1
  32526. throw Error('Illegal GROUPEND after unknown group: ' + r + ' (' + e + ' expected)')
  32527. case g.WIRE_TYPES.BITS32:
  32528. t.offset += 4
  32529. break
  32530. default:
  32531. throw Error('Illegal wire type in unknown group ' + e + ': ' + n)
  32532. }
  32533. return !0
  32534. }
  32535. function h(e, t, i) {
  32536. ;(this.builder = e), (this.parent = t), (this.name = i), this.className
  32537. }
  32538. var s = {},
  32539. e = h.prototype
  32540. ;(e.fqn = function () {
  32541. for (var e = this.name, t = this; null != (t = t.parent); ) e = t.name + '.' + e
  32542. return e
  32543. }),
  32544. (e.toString = function (e) {
  32545. return (e ? this.className + ' ' : '') + this.fqn()
  32546. }),
  32547. (e.build = function () {
  32548. throw Error(this.toString(!0) + ' cannot be built directly')
  32549. }),
  32550. (s.T = h)
  32551. function l(e, t, i, n, r) {
  32552. h.call(this, e, t, i), (this.className = 'Namespace'), (this.children = []), (this.options = n || {}), (this.syntax = r || 'proto2')
  32553. }
  32554. var t = (l.prototype = Object.create(h.prototype))
  32555. ;(t.getChildren = function (e) {
  32556. if (null == (e = e || null)) return this.children.slice()
  32557. for (var t = [], i = 0, n = this.children.length; i < n; ++i) this.children[i] instanceof e && t.push(this.children[i])
  32558. return t
  32559. }),
  32560. (t.addChild = function (e) {
  32561. var t
  32562. if ((t = this.getChild(e.name)))
  32563. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName)) t.name = t.originalName
  32564. else {
  32565. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  32566. throw Error('Duplicate name in namespace ' + this.toString(!0) + ': ' + e.name)
  32567. e.name = e.originalName
  32568. }
  32569. this.children.push(e)
  32570. }),
  32571. (t.getChild = function (e) {
  32572. 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]
  32573. return null
  32574. }),
  32575. (t.resolve = function (e, t) {
  32576. var i,
  32577. n = 'string' == typeof e ? e.split('.') : e,
  32578. r = this,
  32579. o = 0
  32580. if ('' === n[o]) {
  32581. for (; null !== r.parent; ) r = r.parent
  32582. o++
  32583. }
  32584. do {
  32585. do {
  32586. if (!(r instanceof s.Namespace)) {
  32587. r = null
  32588. break
  32589. }
  32590. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || (t && !(i instanceof s.Namespace))) {
  32591. r = null
  32592. break
  32593. }
  32594. ;(r = i), o++
  32595. } while (o < n.length)
  32596. if (null != r) break
  32597. if (null !== this.parent) return this.parent.resolve(e, t)
  32598. } while (null != r)
  32599. return r
  32600. }),
  32601. (t.qn = function (e) {
  32602. for (var t = [], i = e; t.unshift(i.name), null !== (i = i.parent); );
  32603. for (var n = 1; n <= t.length; n++) {
  32604. var r = t.slice(t.length - n)
  32605. if (e === this.resolve(r, e instanceof s.Namespace)) return r.join('.')
  32606. }
  32607. return e.fqn()
  32608. }),
  32609. (t.build = function () {
  32610. 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())
  32611. return (
  32612. Object.defineProperty &&
  32613. Object.defineProperty(t, '$options', {
  32614. value: this.buildOpt()
  32615. }),
  32616. t
  32617. )
  32618. }),
  32619. (t.buildOpt = function () {
  32620. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  32621. var r = t[i],
  32622. o = this.options[t[i]]
  32623. e[r] = o
  32624. }
  32625. return e
  32626. }),
  32627. (t.getOption = function (e) {
  32628. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  32629. }),
  32630. (s.Namespace = l)
  32631. function u(e, t, i, n) {
  32632. 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)
  32633. }
  32634. var i = u.prototype
  32635. ;(u.defaultFieldValue = function (e) {
  32636. if (('string' == typeof e && (e = g.TYPES[e]), void 0 === e.defaultValue)) throw Error('default value for type ' + e.name + ' is not supported')
  32637. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  32638. }),
  32639. (i.verifyValue = function (t) {
  32640. function i(e, t) {
  32641. throw Error('Illegal value for ' + n.toString(!0) + ' of type ' + n.type.name + ': ' + e + ' (' + t + ')')
  32642. }
  32643. var n = this
  32644. switch (this.type) {
  32645. case g.TYPES.int32:
  32646. case g.TYPES.sint32:
  32647. case g.TYPES.sfixed32:
  32648. return ('number' != typeof t || (t == t && t % 1 != 0)) && i(typeof t, 'not an integer'), 4294967295 < t ? 0 | t : t
  32649. case g.TYPES.uint32:
  32650. case g.TYPES.fixed32:
  32651. return ('number' != typeof t || (t == t && t % 1 != 0)) && i(typeof t, 'not an integer'), t < 0 ? t >>> 0 : t
  32652. case g.TYPES.int64:
  32653. case g.TYPES.sint64:
  32654. case g.TYPES.sfixed64:
  32655. if (g.Long)
  32656. try {
  32657. return a(t, !1)
  32658. } catch (e) {
  32659. i(typeof t, e.message)
  32660. }
  32661. else i(typeof t, 'requires Long.js')
  32662. case g.TYPES.uint64:
  32663. case g.TYPES.fixed64:
  32664. if (g.Long)
  32665. try {
  32666. return a(t, !0)
  32667. } catch (e) {
  32668. i(typeof t, e.message)
  32669. }
  32670. else i(typeof t, 'requires Long.js')
  32671. case g.TYPES.bool:
  32672. return 'boolean' != typeof t && i(typeof t, 'not a boolean'), t
  32673. case g.TYPES.float:
  32674. case g.TYPES.double:
  32675. return 'number' != typeof t && i(typeof t, 'not a number'), t
  32676. case g.TYPES.string:
  32677. return 'string' == typeof t || (t && t instanceof String) || i(typeof t, 'not a string'), '' + t
  32678. case g.TYPES.bytes:
  32679. return I.isByteBuffer(t) ? t : I.wrap(t, 'base64')
  32680. case g.TYPES.enum:
  32681. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value)
  32682. for (o = 0; o < e.length; o++) {
  32683. if (e[o].name == t) return e[o].id
  32684. if (e[o].id == t) return e[o].id
  32685. }
  32686. if ('proto3' === this.syntax)
  32687. 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
  32688. i(t, 'not a valid enum value')
  32689. case g.TYPES.group:
  32690. case g.TYPES.message:
  32691. if (((t && 'object' == typeof t) || i(typeof t, 'object expected'), t instanceof this.resolvedType.clazz)) return t
  32692. if (t instanceof g.Builder.Message) {
  32693. var r = {}
  32694. for (var o in t) t.hasOwnProperty(o) && (r[o] = t[o])
  32695. t = r
  32696. }
  32697. return new this.resolvedType.clazz(t)
  32698. }
  32699. throw Error('[INTERNAL] Illegal value for ' + this.toString(!0) + ': ' + t + ' (undefined type ' + this.type + ')')
  32700. }),
  32701. (i.calculateLength = function (e, t) {
  32702. if (null === t) return 0
  32703. var i
  32704. switch (this.type) {
  32705. case g.TYPES.int32:
  32706. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t)
  32707. case g.TYPES.uint32:
  32708. return I.calculateVarint32(t)
  32709. case g.TYPES.sint32:
  32710. return I.calculateVarint32(I.zigZagEncode32(t))
  32711. case g.TYPES.fixed32:
  32712. case g.TYPES.sfixed32:
  32713. case g.TYPES.float:
  32714. return 4
  32715. case g.TYPES.int64:
  32716. case g.TYPES.uint64:
  32717. return I.calculateVarint64(t)
  32718. case g.TYPES.sint64:
  32719. return I.calculateVarint64(I.zigZagEncode64(t))
  32720. case g.TYPES.fixed64:
  32721. case g.TYPES.sfixed64:
  32722. return 8
  32723. case g.TYPES.bool:
  32724. return 1
  32725. case g.TYPES.enum:
  32726. return I.calculateVarint32(t)
  32727. case g.TYPES.double:
  32728. return 8
  32729. case g.TYPES.string:
  32730. return (i = I.calculateUTF8Bytes(t)), I.calculateVarint32(i) + i
  32731. case g.TYPES.bytes:
  32732. if (t.remaining() < 0) throw Error('Illegal value for ' + this.toString(!0) + ': ' + t.remaining() + ' bytes remaining')
  32733. return I.calculateVarint32(t.remaining()) + t.remaining()
  32734. case g.TYPES.message:
  32735. return (i = this.resolvedType.calculate(t)), I.calculateVarint32(i) + i
  32736. case g.TYPES.group:
  32737. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32((e << 3) | g.WIRE_TYPES.ENDGROUP)
  32738. }
  32739. throw Error('[INTERNAL] Illegal value to encode in ' + this.toString(!0) + ': ' + t + ' (unknown type)')
  32740. }),
  32741. (i.encodeValue = function (e, t, i) {
  32742. if (null === t) return i
  32743. switch (this.type) {
  32744. case g.TYPES.int32:
  32745. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t)
  32746. break
  32747. case g.TYPES.uint32:
  32748. i.writeVarint32(t)
  32749. break
  32750. case g.TYPES.sint32:
  32751. i.writeVarint32ZigZag(t)
  32752. break
  32753. case g.TYPES.fixed32:
  32754. i.writeUint32(t)
  32755. break
  32756. case g.TYPES.sfixed32:
  32757. i.writeInt32(t)
  32758. break
  32759. case g.TYPES.int64:
  32760. case g.TYPES.uint64:
  32761. i.writeVarint64(t)
  32762. break
  32763. case g.TYPES.sint64:
  32764. i.writeVarint64ZigZag(t)
  32765. break
  32766. case g.TYPES.fixed64:
  32767. i.writeUint64(t)
  32768. break
  32769. case g.TYPES.sfixed64:
  32770. i.writeInt64(t)
  32771. break
  32772. case g.TYPES.bool:
  32773. 'string' == typeof t ? i.writeVarint32('false' === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0)
  32774. break
  32775. case g.TYPES.enum:
  32776. i.writeVarint32(t)
  32777. break
  32778. case g.TYPES.float:
  32779. i.writeFloat32(t)
  32780. break
  32781. case g.TYPES.double:
  32782. i.writeFloat64(t)
  32783. break
  32784. case g.TYPES.string:
  32785. i.writeVString(t)
  32786. break
  32787. case g.TYPES.bytes:
  32788. if (t.remaining() < 0) throw Error('Illegal value for ' + this.toString(!0) + ': ' + t.remaining() + ' bytes remaining')
  32789. var n = t.offset
  32790. i.writeVarint32(t.remaining()), i.append(t), (t.offset = n)
  32791. break
  32792. case g.TYPES.message:
  32793. var r = new I().LE()
  32794. this.resolvedType.encode(t, r), i.writeVarint32(r.offset), i.append(r.flip())
  32795. break
  32796. case g.TYPES.group:
  32797. this.resolvedType.encode(t, i), i.writeVarint32((e << 3) | g.WIRE_TYPES.ENDGROUP)
  32798. break
  32799. default:
  32800. throw Error('[INTERNAL] Illegal value to encode in ' + this.toString(!0) + ': ' + t + ' (unknown type)')
  32801. }
  32802. return i
  32803. }),
  32804. (i.decode = function (e, t, i) {
  32805. if (t != this.type.wireType) throw Error('Unexpected wire type for element')
  32806. var n, r
  32807. switch (this.type) {
  32808. case g.TYPES.int32:
  32809. return 0 | e.readVarint32()
  32810. case g.TYPES.uint32:
  32811. return e.readVarint32() >>> 0
  32812. case g.TYPES.sint32:
  32813. return 0 | e.readVarint32ZigZag()
  32814. case g.TYPES.fixed32:
  32815. return e.readUint32() >>> 0
  32816. case g.TYPES.sfixed32:
  32817. return 0 | e.readInt32()
  32818. case g.TYPES.int64:
  32819. return e.readVarint64()
  32820. case g.TYPES.uint64:
  32821. return e.readVarint64().toUnsigned()
  32822. case g.TYPES.sint64:
  32823. return e.readVarint64ZigZag()
  32824. case g.TYPES.fixed64:
  32825. return e.readUint64()
  32826. case g.TYPES.sfixed64:
  32827. return e.readInt64()
  32828. case g.TYPES.bool:
  32829. return !!e.readVarint32()
  32830. case g.TYPES.enum:
  32831. return e.readVarint32()
  32832. case g.TYPES.float:
  32833. return e.readFloat()
  32834. case g.TYPES.double:
  32835. return e.readDouble()
  32836. case g.TYPES.string:
  32837. return e.readVString()
  32838. case g.TYPES.bytes:
  32839. if (((r = e.readVarint32()), e.remaining() < r)) throw Error('Illegal number of bytes for ' + this.toString(!0) + ': ' + r + ' required but got only ' + e.remaining())
  32840. return ((n = e.clone()).limit = n.offset + r), (e.offset += r), n
  32841. case g.TYPES.message:
  32842. return (r = e.readVarint32()), this.resolvedType.decode(e, r)
  32843. case g.TYPES.group:
  32844. return this.resolvedType.decode(e, -1, i)
  32845. }
  32846. throw Error('[INTERNAL] Illegal decode type')
  32847. }),
  32848. (i.valueFromString = function (e) {
  32849. if (!this.isMapKey) throw Error('valueFromString() called on non-map-key element')
  32850. switch (this.type) {
  32851. case g.TYPES.int32:
  32852. case g.TYPES.sint32:
  32853. case g.TYPES.sfixed32:
  32854. case g.TYPES.uint32:
  32855. case g.TYPES.fixed32:
  32856. return this.verifyValue(parseInt(e))
  32857. case g.TYPES.int64:
  32858. case g.TYPES.sint64:
  32859. case g.TYPES.sfixed64:
  32860. case g.TYPES.uint64:
  32861. case g.TYPES.fixed64:
  32862. return this.verifyValue(e)
  32863. case g.TYPES.bool:
  32864. return 'true' === e
  32865. case g.TYPES.string:
  32866. return this.verifyValue(e)
  32867. case g.TYPES.bytes:
  32868. return I.fromBinary(e)
  32869. }
  32870. }),
  32871. (i.valueToString = function (e) {
  32872. if (!this.isMapKey) throw Error('valueToString() called on non-map-key element')
  32873. return this.type === g.TYPES.bytes ? e.toString('binary') : e.toString()
  32874. }),
  32875. (s.Element = u)
  32876. var d = function (e, t, i, n, r, o) {
  32877. l.call(this, e, t, i, n, o),
  32878. (this.className = 'Message'),
  32879. (this.extensions = void 0),
  32880. (this.clazz = null),
  32881. (this.isGroup = !!r),
  32882. (this._fields = null),
  32883. (this._fieldsById = null),
  32884. (this._fieldsByName = null)
  32885. },
  32886. n = (d.prototype = Object.create(l.prototype))
  32887. ;(n.build = function (e) {
  32888. if (this.clazz && !e) return this.clazz
  32889. var t = (function (u, a) {
  32890. function d(e, i, n, r) {
  32891. if (null === e || 'object' != typeof e) {
  32892. if (r && r instanceof u.Reflect.Enum) {
  32893. var t = u.Reflect.Enum.getName(r.object, e)
  32894. if (null !== t) return t
  32895. }
  32896. return e
  32897. }
  32898. if (I.isByteBuffer(e)) return i ? e.toBase64() : e.toBuffer()
  32899. if (u.Long.isLong(e)) return n ? e.toString() : u.Long.fromValue(e)
  32900. var o
  32901. if (Array.isArray(e))
  32902. return (
  32903. (o = []),
  32904. e.forEach(function (e, t) {
  32905. o[t] = d(e, i, n, r)
  32906. }),
  32907. o
  32908. )
  32909. if (((o = {}), e instanceof u.Map)) {
  32910. 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)
  32911. return o
  32912. }
  32913. var l = e.$type,
  32914. c = void 0
  32915. 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)))
  32916. return o
  32917. }
  32918. var s = a.getChildren(u.Reflect.Message.Field),
  32919. l = a.getChildren(u.Reflect.Message.OneOf),
  32920. c = function (e, t) {
  32921. u.Builder.Message.call(this)
  32922. for (var i = 0, n = l.length; i < n; ++i) this[l[i].name] = null
  32923. for (i = 0, n = s.length; i < n; ++i) {
  32924. var r = s[i]
  32925. ;(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)
  32926. }
  32927. var o
  32928. if (0 < arguments.length)
  32929. if (
  32930. 1 !== arguments.length ||
  32931. null === e ||
  32932. 'object' != typeof e ||
  32933. !('function' != typeof e.encode || e instanceof c) ||
  32934. Array.isArray(e) ||
  32935. e instanceof u.Map ||
  32936. I.isByteBuffer(e) ||
  32937. e instanceof ArrayBuffer ||
  32938. (u.Long && e instanceof u.Long)
  32939. )
  32940. for (i = 0, n = arguments.length; i < n; ++i) void 0 !== (o = arguments[i]) && this.$set(s[i].name, o)
  32941. else this.$set(e)
  32942. },
  32943. o = (c.prototype = Object.create(u.Builder.Message.prototype))
  32944. ;(o.add = function (e, t, i) {
  32945. var n = a._fieldsByName[e]
  32946. if (!i) {
  32947. if (!n) throw Error(this + '#' + e + ' is undefined')
  32948. if (!(n instanceof u.Reflect.Message.Field)) throw Error(this + '#' + e + ' is not a field: ' + n.toString(!0))
  32949. if (!n.repeated) throw Error(this + '#' + e + ' is not a repeated field')
  32950. t = n.verifyValue(t, !0)
  32951. }
  32952. return null === this[e] && (this[e] = []), this[e].push(t), this
  32953. }),
  32954. (o.$add = o.add),
  32955. (o.set = function (e, t, i) {
  32956. if (e && 'object' == typeof e) {
  32957. for (var n in ((i = t), e)) e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i)
  32958. return this
  32959. }
  32960. var r = a._fieldsByName[e]
  32961. if (i) this[e] = t
  32962. else {
  32963. if (!r) throw Error(this + '#' + e + ' is not a field: undefined')
  32964. if (!(r instanceof u.Reflect.Message.Field)) throw Error(this + '#' + e + ' is not a field: ' + r.toString(!0))
  32965. this[r.name] = t = r.verifyValue(t)
  32966. }
  32967. if (r && r.oneof) {
  32968. var o = this[r.oneof.name]
  32969. null !== t ? (null !== o && o !== r.name && (this[o] = null), (this[r.oneof.name] = r.name)) : o === e && (this[r.oneof.name] = null)
  32970. }
  32971. return this
  32972. }),
  32973. (o.$set = o.set),
  32974. (o.get = function (e, t) {
  32975. if (t) return this[e]
  32976. var i = a._fieldsByName[e]
  32977. if (!(i && i instanceof u.Reflect.Message.Field)) throw Error(this + '#' + e + ' is not a field: undefined')
  32978. if (!(i instanceof u.Reflect.Message.Field)) throw Error(this + '#' + e + ' is not a field: ' + i.toString(!0))
  32979. return this[i.name]
  32980. }),
  32981. (o.$get = o.get)
  32982. for (var e = 0; e < s.length; e++) {
  32983. var t = s[e]
  32984. t instanceof u.Reflect.Message.ExtensionField ||
  32985. (a.builder.options.populateAccessors &&
  32986. (function (i) {
  32987. var e = i.originalName.replace(/(_[a-zA-Z])/g, function (e) {
  32988. return e.toUpperCase().replace('_', '')
  32989. })
  32990. e = e.substring(0, 1).toUpperCase() + e.substring(1)
  32991. function t(e, t) {
  32992. return (this[i.name] = t ? e : i.verifyValue(e)), this
  32993. }
  32994. function n() {
  32995. return this[i.name]
  32996. }
  32997. var r = i.originalName.replace(/([A-Z])/g, function (e) {
  32998. return '_' + e
  32999. })
  33000. null === a.getChild('set' + e) && (o['set' + e] = t),
  33001. null === a.getChild('set_' + r) && (o['set_' + r] = t),
  33002. null === a.getChild('get' + e) && (o['get' + e] = n),
  33003. null === a.getChild('get_' + r) && (o['get_' + r] = n)
  33004. })(t))
  33005. }
  33006. return (
  33007. (o.encode = function (t, e) {
  33008. 'boolean' == typeof t && ((e = t), (t = void 0))
  33009. var i = !1
  33010. t || ((t = new I()), (i = !0))
  33011. var n = t.littleEndian
  33012. try {
  33013. return a.encode(this, t.LE(), e), (i ? t.flip() : t).LE(n)
  33014. } catch (e) {
  33015. throw (t.LE(n), e)
  33016. }
  33017. }),
  33018. (c.encode = function (e, t, i) {
  33019. return new c(e).encode(t, i)
  33020. }),
  33021. (o.calculate = function () {
  33022. return a.calculate(this)
  33023. }),
  33024. (o.encodeDelimited = function (e, t) {
  33025. var i = !1
  33026. e || ((e = new I()), (i = !0))
  33027. var n = new I().LE()
  33028. return a.encode(this, n, t).flip(), e.writeVarint32(n.remaining()), e.append(n), i ? e.flip() : e
  33029. }),
  33030. (o.encodeAB = function () {
  33031. try {
  33032. return this.encode().toArrayBuffer()
  33033. } catch (e) {
  33034. throw (e.encoded && (e.encoded = e.encoded.toArrayBuffer()), e)
  33035. }
  33036. }),
  33037. (o.toArrayBuffer = o.encodeAB),
  33038. (o.encodeNB = function () {
  33039. try {
  33040. return this.encode().toBuffer()
  33041. } catch (e) {
  33042. throw (e.encoded && (e.encoded = e.encoded.toBuffer()), e)
  33043. }
  33044. }),
  33045. (o.toBuffer = o.encodeNB),
  33046. (o.encode64 = function () {
  33047. try {
  33048. return this.encode().toBase64()
  33049. } catch (e) {
  33050. throw (e.encoded && (e.encoded = e.encoded.toBase64()), e)
  33051. }
  33052. }),
  33053. (o.toBase64 = o.encode64),
  33054. (o.encodeHex = function () {
  33055. try {
  33056. return this.encode().toHex()
  33057. } catch (e) {
  33058. throw (e.encoded && (e.encoded = e.encoded.toHex()), e)
  33059. }
  33060. }),
  33061. (o.toHex = o.encodeHex),
  33062. (o.toRaw = function (e, t) {
  33063. return d(this, !!e, !!t, this.$type)
  33064. }),
  33065. (o.encodeJSON = function () {
  33066. return JSON.stringify(d(this, !0, !0, this.$type))
  33067. }),
  33068. (c.decode = function (t, e, i) {
  33069. 'string' == typeof e && ((i = e), (e = -1)), 'string' == typeof t && (t = I.wrap(t, i || 'base64'))
  33070. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian
  33071. try {
  33072. var r = a.decode(t.LE())
  33073. return t.LE(n), r
  33074. } catch (e) {
  33075. throw (t.LE(n), e)
  33076. }
  33077. }),
  33078. (c.decodeDelimited = function (t, e) {
  33079. if (('string' == typeof t && (t = I.wrap(t, e || 'base64')), (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)) return null
  33080. var i = t.offset,
  33081. n = t.readVarint32()
  33082. if (t.remaining() < n) return (t.offset = i), null
  33083. try {
  33084. var r = a.decode(t.slice(t.offset, t.offset + n).LE())
  33085. return (t.offset += n), r
  33086. } catch (e) {
  33087. throw ((t.offset += n), e)
  33088. }
  33089. }),
  33090. (c.decode64 = function (e) {
  33091. return c.decode(e, 'base64')
  33092. }),
  33093. (c.decodeHex = function (e) {
  33094. return c.decode(e, 'hex')
  33095. }),
  33096. (c.decodeJSON = function (e) {
  33097. return new c(JSON.parse(e))
  33098. }),
  33099. (o.toString = function () {
  33100. return a.toString()
  33101. }),
  33102. Object.defineProperty &&
  33103. (Object.defineProperty(c, '$options', {
  33104. value: a.buildOpt()
  33105. }),
  33106. Object.defineProperty(o, '$options', {
  33107. value: c.$options
  33108. }),
  33109. Object.defineProperty(c, '$type', {
  33110. value: a
  33111. }),
  33112. Object.defineProperty(o, '$type', {
  33113. value: a
  33114. })),
  33115. c
  33116. )
  33117. })(g, this)
  33118. ;(this._fields = []), (this._fieldsById = {}), (this._fieldsByName = {})
  33119. for (var i, n = 0, r = this.children.length; n < r; n++)
  33120. if ((i = this.children[n]) instanceof p || i instanceof d || i instanceof y) {
  33121. if (t.hasOwnProperty(i.name)) throw Error('Illegal reflect child of ' + this.toString(!0) + ': ' + i.toString(!0) + " cannot override static property '" + i.name + "'")
  33122. t[i.name] = i.build()
  33123. } else if (i instanceof d.Field) i.build(), this._fields.push(i), (this._fieldsById[i.id] = i), (this._fieldsByName[i.name] = i)
  33124. else if (!(i instanceof d.OneOf || i instanceof v)) throw Error('Illegal reflect child of ' + this.toString(!0) + ': ' + this.children[n].toString(!0))
  33125. return (this.clazz = t)
  33126. }),
  33127. (n.encode = function (e, t, i) {
  33128. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33129. (r = e[(n = this._fields[a]).name]), n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e)
  33130. if (null === o) return t
  33131. var l = Error('Missing at least one required field for ' + this.toString(!0) + ': ' + o)
  33132. throw ((l.encoded = t), l)
  33133. }),
  33134. (n.calculate = function (e) {
  33135. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33136. 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)
  33137. n += t.calculate(i, e)
  33138. }
  33139. return n
  33140. }),
  33141. (n.decode = function (e, t, i) {
  33142. t = 'number' == typeof t ? t : -1
  33143. for (var n, r, o, a, s = e.offset, l = new this.clazz(); e.offset < s + t || (-1 === t && 0 < e.remaining()); ) {
  33144. if (((o = (n = e.readVarint32()) >>> 3), (r = 7 & n) === g.WIRE_TYPES.ENDGROUP)) {
  33145. if (o !== i) throw Error('Illegal group end indicator for ' + this.toString(!0) + ': ' + o + ' (' + (i ? i + ' expected' : 'not a group') + ')')
  33146. break
  33147. }
  33148. if ((a = this._fieldsById[o])) {
  33149. if (a.repeated && !a.options.packed) l[a.name].push(a.decode(r, e))
  33150. else if (a.map) {
  33151. var c = a.decode(r, e)
  33152. l[a.name].set(c[0], c[1])
  33153. } else if (((l[a.name] = a.decode(r, e)), a.oneof)) {
  33154. var h = l[a.oneof.name]
  33155. null !== h && h !== a.name && (l[h] = null), (l[a.oneof.name] = a.name)
  33156. }
  33157. } else
  33158. switch (r) {
  33159. case g.WIRE_TYPES.VARINT:
  33160. e.readVarint32()
  33161. break
  33162. case g.WIRE_TYPES.BITS32:
  33163. e.offset += 4
  33164. break
  33165. case g.WIRE_TYPES.BITS64:
  33166. e.offset += 8
  33167. break
  33168. case g.WIRE_TYPES.LDELIM:
  33169. var u = e.readVarint32()
  33170. e.offset += u
  33171. break
  33172. case g.WIRE_TYPES.STARTGROUP:
  33173. for (; m(o, e); );
  33174. break
  33175. default:
  33176. throw Error('Illegal wire type for unknown field ' + o + ' in ' + this.toString(!0) + '#decode: ' + r)
  33177. }
  33178. }
  33179. for (var d = 0, p = this._fields.length; d < p; ++d)
  33180. if (null === l[(a = this._fields[d]).name])
  33181. if ('proto3' === this.syntax) l[a.name] = a.defaultValue
  33182. else {
  33183. if (a.required) {
  33184. var f = Error('Missing at least one required field for ' + this.toString(!0) + ': ' + a.name)
  33185. throw ((f.decoded = l), f)
  33186. }
  33187. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  33188. }
  33189. return l
  33190. }),
  33191. (s.Message = d)
  33192. function c(e, t, i, n, r, o, a, s, l, c) {
  33193. h.call(this, e, t, o),
  33194. (this.className = 'Message.Field'),
  33195. (this.required = 'required' === i),
  33196. (this.repeated = 'repeated' === i),
  33197. (this.map = 'map' === i),
  33198. (this.keyType = n || null),
  33199. (this.type = r),
  33200. (this.resolvedType = null),
  33201. (this.id = a),
  33202. (this.options = s || {}),
  33203. (this.defaultValue = null),
  33204. (this.oneof = l || null),
  33205. (this.syntax = c || 'proto2'),
  33206. (this.originalName = this.name),
  33207. (this.element = null),
  33208. (this.keyElement = null),
  33209. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  33210. }
  33211. var r = (c.prototype = Object.create(h.prototype))
  33212. ;(r.build = function () {
  33213. ;(this.element = new u(this.type, this.resolvedType, !1, this.syntax)),
  33214. this.map && (this.keyElement = new u(this.keyType, void 0, !0, this.syntax)),
  33215. 'proto3' !== this.syntax || this.repeated || this.map
  33216. ? void 0 !== this.options.default && (this.defaultValue = this.verifyValue(this.options.default))
  33217. : (this.defaultValue = u.defaultFieldValue(this.type))
  33218. }),
  33219. (r.verifyValue = function (e, t) {
  33220. function i(e, t) {
  33221. throw Error('Illegal value for ' + r.toString(!0) + ' of type ' + r.type.name + ': ' + e + ' (' + t + ')')
  33222. }
  33223. t = t || !1
  33224. var n,
  33225. r = this
  33226. if (null === e)
  33227. return (
  33228. this.required && i(typeof e, 'required'),
  33229. 'proto3' === this.syntax && this.type !== g.TYPES.message && i(typeof e, 'proto3 field without field presence cannot be null'),
  33230. null
  33231. )
  33232. if (!this.repeated || t)
  33233. return this.map && !t
  33234. ? e instanceof g.Map
  33235. ? e
  33236. : (e instanceof Object || i(typeof e, 'expected ProtoBuf.Map or raw object for map field'), new g.Map(this, e))
  33237. : (!this.repeated && Array.isArray(e) && i(typeof e, 'no array expected'), this.element.verifyValue(e))
  33238. Array.isArray(e) || (e = [e])
  33239. var o = []
  33240. for (n = 0; n < e.length; n++) o.push(this.element.verifyValue(e[n]))
  33241. return o
  33242. }),
  33243. (r.hasWirePresence = function (e, t) {
  33244. if ('proto3' !== this.syntax) return null !== e
  33245. if (this.oneof && t[this.oneof.name] === this.name) return !0
  33246. switch (this.type) {
  33247. case g.TYPES.int32:
  33248. case g.TYPES.sint32:
  33249. case g.TYPES.sfixed32:
  33250. case g.TYPES.uint32:
  33251. case g.TYPES.fixed32:
  33252. return 0 !== e
  33253. case g.TYPES.int64:
  33254. case g.TYPES.sint64:
  33255. case g.TYPES.sfixed64:
  33256. case g.TYPES.uint64:
  33257. case g.TYPES.fixed64:
  33258. return 0 !== e.low || 0 !== e.high
  33259. case g.TYPES.bool:
  33260. return e
  33261. case g.TYPES.float:
  33262. case g.TYPES.double:
  33263. return 0 !== e
  33264. case g.TYPES.string:
  33265. return 0 < e.length
  33266. case g.TYPES.bytes:
  33267. return 0 < e.remaining()
  33268. case g.TYPES.enum:
  33269. return 0 !== e
  33270. case g.TYPES.message:
  33271. return null !== e
  33272. default:
  33273. return !0
  33274. }
  33275. }),
  33276. (r.encode = function (t, r, e) {
  33277. if (null === this.type || 'object' != typeof this.type) throw Error('[INTERNAL] Unresolved type in ' + this.toString(!0) + ': ' + this.type)
  33278. if (null === t || (this.repeated && 0 == t.length)) return r
  33279. try {
  33280. var i
  33281. if (this.repeated)
  33282. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33283. r.writeVarint32((this.id << 3) | g.WIRE_TYPES.LDELIM), r.ensureCapacity((r.offset += 1))
  33284. var n = r.offset
  33285. for (i = 0; i < t.length; i++) this.element.encodeValue(this.id, t[i], r)
  33286. var o = r.offset - n,
  33287. a = I.calculateVarint32(o)
  33288. if (1 < a) {
  33289. var s = r.slice(n, r.offset)
  33290. ;(n += a - 1), (r.offset = n), r.append(s)
  33291. }
  33292. r.writeVarint32(o, n - a)
  33293. } else for (i = 0; i < t.length; i++) r.writeVarint32((this.id << 3) | this.type.wireType), this.element.encodeValue(this.id, t[i], r)
  33294. else
  33295. this.map
  33296. ? t.forEach(function (e, t, i) {
  33297. var n =
  33298. I.calculateVarint32(8 | this.keyType.wireType) +
  33299. this.keyElement.calculateLength(1, t) +
  33300. I.calculateVarint32(16 | this.type.wireType) +
  33301. this.element.calculateLength(2, e)
  33302. r.writeVarint32((this.id << 3) | g.WIRE_TYPES.LDELIM),
  33303. r.writeVarint32(n),
  33304. r.writeVarint32(8 | this.keyType.wireType),
  33305. this.keyElement.encodeValue(1, t, r),
  33306. r.writeVarint32(16 | this.type.wireType),
  33307. this.element.encodeValue(2, e, r)
  33308. }, this)
  33309. : this.hasWirePresence(t, e) && (r.writeVarint32((this.id << 3) | this.type.wireType), this.element.encodeValue(this.id, t, r))
  33310. } catch (e) {
  33311. throw Error('Illegal value for ' + this.toString(!0) + ': ' + t + ' (' + e + ')')
  33312. }
  33313. return r
  33314. }),
  33315. (r.calculate = function (t, e) {
  33316. if (((t = this.verifyValue(t)), null === this.type || 'object' != typeof this.type)) throw Error('[INTERNAL] Unresolved type in ' + this.toString(!0) + ': ' + this.type)
  33317. if (null === t || (this.repeated && 0 == t.length)) return 0
  33318. var r = 0
  33319. try {
  33320. var i, n
  33321. if (this.repeated)
  33322. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33323. 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])
  33324. ;(r += I.calculateVarint32(n)), (r += n)
  33325. } 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]))
  33326. else
  33327. this.map
  33328. ? t.forEach(function (e, t, i) {
  33329. var n =
  33330. I.calculateVarint32(8 | this.keyType.wireType) +
  33331. this.keyElement.calculateLength(1, t) +
  33332. I.calculateVarint32(16 | this.type.wireType) +
  33333. this.element.calculateLength(2, e)
  33334. ;(r += I.calculateVarint32((this.id << 3) | g.WIRE_TYPES.LDELIM)), (r += I.calculateVarint32(n)), (r += n)
  33335. }, this)
  33336. : this.hasWirePresence(t, e) && ((r += I.calculateVarint32((this.id << 3) | this.type.wireType)), (r += this.element.calculateLength(this.id, t)))
  33337. } catch (e) {
  33338. throw Error('Illegal value for ' + this.toString(!0) + ': ' + t + ' (' + e + ')')
  33339. }
  33340. return r
  33341. }),
  33342. (r.decode = function (e, t, i) {
  33343. var n, r
  33344. 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)))
  33345. throw Error('Illegal wire type for field ' + this.toString(!0) + ': ' + e + ' (' + this.type.wireType + ' expected)')
  33346. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  33347. ;(r = t.readVarint32()), (r = t.offset + r)
  33348. for (var o = []; t.offset < r; ) o.push(this.decode(this.type.wireType, t, !0))
  33349. return o
  33350. }
  33351. if (this.map) {
  33352. var a = u.defaultFieldValue(this.keyType)
  33353. if (((n = u.defaultFieldValue(this.type)), (r = t.readVarint32()), t.remaining() < r))
  33354. throw Error('Illegal number of bytes for ' + this.toString(!0) + ': ' + r + ' required but got only ' + t.remaining())
  33355. var s = t.clone()
  33356. for (s.limit = s.offset + r, t.offset += r; 0 < s.remaining(); ) {
  33357. var l = s.readVarint32()
  33358. e = 7 & l
  33359. var c = l >>> 3
  33360. if (1 == c) a = this.keyElement.decode(s, e, c)
  33361. else {
  33362. if (2 != c) throw Error('Unexpected tag in map field key/value submessage')
  33363. n = this.element.decode(s, e, c)
  33364. }
  33365. }
  33366. return [a, n]
  33367. }
  33368. return this.element.decode(t, e, this.id)
  33369. }),
  33370. (s.Message.Field = c)
  33371. function o(e, t, i, n, r, o, a) {
  33372. c.call(this, e, t, i, null, n, r, o, a), this.extension
  33373. }
  33374. ;(o.prototype = Object.create(c.prototype)), (s.Message.ExtensionField = o)
  33375. s.Message.OneOf = function (e, t, i) {
  33376. h.call(this, e, t, i), (this.fields = [])
  33377. }
  33378. var p = function (e, t, i, n, r) {
  33379. l.call(this, e, t, i, n, r), (this.className = 'Enum'), (this.object = null)
  33380. }
  33381. ;(p.getName = function (e, t) {
  33382. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r) if (e[(i = n[r])] === t) return i
  33383. return null
  33384. }),
  33385. ((p.prototype = Object.create(l.prototype)).build = function (e) {
  33386. if (this.object && !e) return this.object
  33387. 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
  33388. return (
  33389. Object.defineProperty &&
  33390. Object.defineProperty(t, '$options', {
  33391. value: this.buildOpt(),
  33392. enumerable: !1
  33393. }),
  33394. (this.object = t)
  33395. )
  33396. }),
  33397. (s.Enum = p)
  33398. function f(e, t, i, n) {
  33399. h.call(this, e, t, i), (this.className = 'Enum.Value'), (this.id = n)
  33400. }
  33401. ;(f.prototype = Object.create(h.prototype)), (s.Enum.Value = f)
  33402. var v = function (e, t, i, n) {
  33403. h.call(this, e, t, i), (this.field = n)
  33404. }
  33405. ;(v.prototype = Object.create(h.prototype)), (s.Extension = v)
  33406. var y = function (e, t, i, n) {
  33407. l.call(this, e, t, i, n), (this.className = 'Service'), (this.clazz = null)
  33408. }
  33409. ;((y.prototype = Object.create(l.prototype)).build = function (e) {
  33410. return this.clazz && !e
  33411. ? this.clazz
  33412. : (this.clazz = (function (t, r) {
  33413. for (
  33414. var o = function (e) {
  33415. t.Builder.Service.call(this),
  33416. (this.rpcImpl =
  33417. e ||
  33418. function (e, t, i) {
  33419. setTimeout(i.bind(this, Error('Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services')), 0)
  33420. })
  33421. },
  33422. e = (o.prototype = Object.create(t.Builder.Service.prototype)),
  33423. i = r.getChildren(t.Reflect.Service.RPCMethod),
  33424. n = 0;
  33425. n < i.length;
  33426. n++
  33427. )
  33428. !(function (n) {
  33429. ;(e[n.name] = function (e, i) {
  33430. try {
  33431. try {
  33432. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  33433. } catch (e) {
  33434. if (!(e instanceof TypeError)) throw e
  33435. }
  33436. if (null === e || 'object' != typeof e) throw Error('Illegal arguments')
  33437. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  33438. this.rpcImpl(n.fqn(), e, function (e, t) {
  33439. if (!e) {
  33440. null === t && (t = '')
  33441. try {
  33442. t = n.resolvedResponseType.clazz.decode(t)
  33443. } catch (e) {}
  33444. return t && t instanceof n.resolvedResponseType.clazz
  33445. ? void i(null, t)
  33446. : void i(Error('Illegal response type received in service method ' + r.name + '#' + n.name))
  33447. }
  33448. i(e)
  33449. })
  33450. } catch (e) {
  33451. setTimeout(i.bind(this, e), 0)
  33452. }
  33453. }),
  33454. (o[n.name] = function (e, t, i) {
  33455. new o(e)[n.name](t, i)
  33456. }),
  33457. Object.defineProperty &&
  33458. (Object.defineProperty(o[n.name], '$options', {
  33459. value: n.buildOpt()
  33460. }),
  33461. Object.defineProperty(e[n.name], '$options', {
  33462. value: o[n.name].$options
  33463. }))
  33464. })(i[n])
  33465. return (
  33466. Object.defineProperty &&
  33467. (Object.defineProperty(o, '$options', {
  33468. value: r.buildOpt()
  33469. }),
  33470. Object.defineProperty(e, '$options', {
  33471. value: o.$options
  33472. }),
  33473. Object.defineProperty(o, '$type', {
  33474. value: r
  33475. }),
  33476. Object.defineProperty(e, '$type', {
  33477. value: r
  33478. })),
  33479. o
  33480. )
  33481. })(g, this))
  33482. }),
  33483. (s.Service = y)
  33484. function A(e, t, i, n) {
  33485. h.call(this, e, t, i), (this.className = 'Service.Method'), (this.options = n || {})
  33486. }
  33487. ;((A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt), (s.Service.Method = A)
  33488. function C(e, t, i, n, r, o, a, s) {
  33489. A.call(this, e, t, i, s),
  33490. (this.className = 'Service.RPCMethod'),
  33491. (this.requestName = n),
  33492. (this.responseName = r),
  33493. (this.requestStream = o),
  33494. (this.responseStream = a),
  33495. (this.resolvedRequestType = null),
  33496. (this.resolvedResponseType = null)
  33497. }
  33498. return (C.prototype = Object.create(A.prototype)), (s.Service.RPCMethod = C), s
  33499. })(o)),
  33500. (o.Builder =
  33501. ((i = (u = o).Lang),
  33502. (s = o.Reflect),
  33503. (n = h.prototype),
  33504. (h.isMessage = function (e) {
  33505. return 'string' == typeof e.name && void 0 === e.values && void 0 === e.rpc
  33506. }),
  33507. (h.isMessageField = function (e) {
  33508. return 'string' == typeof e.rule && 'string' == typeof e.name && 'string' == typeof e.type && void 0 !== e.id
  33509. }),
  33510. (h.isEnum = function (e) {
  33511. return 'string' == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  33512. }),
  33513. (h.isService = function (e) {
  33514. return !('string' != typeof e.name || 'object' != typeof e.rpc || !e.rpc)
  33515. }),
  33516. (h.isExtend = function (e) {
  33517. return 'string' == typeof e.ref
  33518. }),
  33519. (n.reset = function () {
  33520. return (this.ptr = this.ns), this
  33521. }),
  33522. (n.define = function (e) {
  33523. if ('string' != typeof e || !i.TYPEREF.test(e)) throw Error('illegal namespace: ' + e)
  33524. return (
  33525. e.split('.').forEach(function (e) {
  33526. var t = this.ptr.getChild(e)
  33527. null === t && this.ptr.addChild((t = new s.Namespace(this, this.ptr, e))), (this.ptr = t)
  33528. }, this),
  33529. this
  33530. )
  33531. }),
  33532. (n.create = function (e) {
  33533. if (!e) return this
  33534. if (Array.isArray(e)) {
  33535. if (0 === e.length) return this
  33536. e = e.slice()
  33537. } else e = [e]
  33538. for (var t = [e]; 0 < t.length; ) {
  33539. if (((e = t.pop()), !Array.isArray(e))) throw Error('not a valid namespace: ' + JSON.stringify(e))
  33540. for (; 0 < e.length; ) {
  33541. var i = e.shift()
  33542. if (h.isMessage(i)) {
  33543. var o = new s.Message(this, this.ptr, i.name, i.options, i.isGroup, i.syntax),
  33544. n = {}
  33545. i.oneofs &&
  33546. Object.keys(i.oneofs).forEach(function (e) {
  33547. o.addChild((n[e] = new s.Message.OneOf(this, o, e)))
  33548. }, this),
  33549. i.fields &&
  33550. i.fields.forEach(function (e) {
  33551. if (null !== o.getChild(0 | e.id)) throw Error('duplicate or invalid field id in ' + o.name + ': ' + e.id)
  33552. if (e.options && 'object' != typeof e.options) throw Error('illegal field options in ' + o.name + '#' + e.name)
  33553. var t = null
  33554. if ('string' == typeof e.oneof && !(t = n[e.oneof])) throw Error('illegal oneof in ' + o.name + '#' + e.name + ': ' + e.oneof)
  33555. ;(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)
  33556. }, this)
  33557. var r = []
  33558. if (
  33559. (i.enums &&
  33560. i.enums.forEach(function (e) {
  33561. r.push(e)
  33562. }),
  33563. i.messages &&
  33564. i.messages.forEach(function (e) {
  33565. r.push(e)
  33566. }),
  33567. i.services &&
  33568. i.services.forEach(function (e) {
  33569. r.push(e)
  33570. }),
  33571. i.extensions && ('number' == typeof i.extensions[0] ? (o.extensions = [i.extensions]) : (o.extensions = i.extensions)),
  33572. this.ptr.addChild(o),
  33573. 0 < r.length)
  33574. ) {
  33575. t.push(e), (e = r), (r = null), (this.ptr = o), (o = null)
  33576. continue
  33577. }
  33578. r = null
  33579. } else if (h.isEnum(i))
  33580. (o = new s.Enum(this, this.ptr, i.name, i.options, i.syntax)),
  33581. i.values.forEach(function (e) {
  33582. o.addChild(new s.Enum.Value(this, o, e.name, e.id))
  33583. }, this),
  33584. this.ptr.addChild(o)
  33585. else if (h.isService(i))
  33586. (o = new s.Service(this, this.ptr, i.name, i.options)),
  33587. Object.keys(i.rpc).forEach(function (e) {
  33588. var t = i.rpc[e]
  33589. o.addChild(new s.Service.RPCMethod(this, o, e, t.request, t.response, !!t.request_stream, !!t.response_stream, t.options))
  33590. }, this),
  33591. this.ptr.addChild(o)
  33592. else {
  33593. if (!h.isExtend(i)) throw Error('not a valid definition: ' + JSON.stringify(i))
  33594. if ((o = this.ptr.resolve(i.ref, !0)))
  33595. i.fields.forEach(function (t) {
  33596. if (null !== o.getChild(0 | t.id)) throw Error('duplicate extended field id in ' + o.name + ': ' + t.id)
  33597. if (o.extensions) {
  33598. var i = !1
  33599. if (
  33600. (o.extensions.forEach(function (e) {
  33601. t.id >= e[0] && t.id <= e[1] && (i = !0)
  33602. }),
  33603. !i)
  33604. )
  33605. throw Error('illegal extended field id in ' + o.name + ': ' + t.id + ' (not within valid ranges)')
  33606. }
  33607. var e = t.name
  33608. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e))
  33609. var n = new s.Message.ExtensionField(this, o, t.rule, t.type, this.ptr.fqn() + '.' + e, t.id, t.options),
  33610. r = new s.Extension(this, this.ptr, t.name, n)
  33611. ;(n.extension = r), this.ptr.addChild(r), o.addChild(n)
  33612. }, this)
  33613. else if (!/\.?google\.protobuf\./.test(i.ref)) throw Error('extended message ' + i.ref + ' is not defined')
  33614. }
  33615. o = i = null
  33616. }
  33617. ;(e = null), (this.ptr = this.ptr.parent)
  33618. }
  33619. return (this.resolved = !1), (this.result = null), this
  33620. }),
  33621. (n.import = function (t, e) {
  33622. var i = '/'
  33623. if ('string' == typeof e) {
  33624. if ((u.Util.IS_NODE && (e = p('path').resolve(e)), !0 === this.files[e])) return this.reset()
  33625. this.files[e] = !0
  33626. } else if ('object' == typeof e) {
  33627. var n = e.root
  33628. u.Util.IS_NODE && (n = p('path').resolve(n)), (0 <= n.indexOf('\\') || 0 <= e.file.indexOf('\\')) && (i = '\\')
  33629. var r = n + i + e.file
  33630. if (!0 === this.files[r]) return this.reset()
  33631. this.files[r] = !0
  33632. }
  33633. if (t.imports && 0 < t.imports.length) {
  33634. var o,
  33635. a = !1
  33636. 'object' == typeof e
  33637. ? ((this.importRoot = e.root), (a = !0), (o = this.importRoot), (e = e.file), (0 <= o.indexOf('\\') || 0 <= e.indexOf('\\')) && (i = '\\'))
  33638. : 'string' == typeof e
  33639. ? this.importRoot
  33640. ? (o = this.importRoot)
  33641. : 0 <= e.indexOf('/')
  33642. ? '' === (o = e.replace(/\/[^\/]*$/, '')) && (o = '/')
  33643. : 0 <= e.indexOf('\\')
  33644. ? ((o = e.replace(/\\[^\\]*$/, '')), (i = '\\'))
  33645. : (o = '.')
  33646. : (o = null)
  33647. for (var s = 0; s < t.imports.length; s++)
  33648. if ('string' == typeof t.imports[s]) {
  33649. if (!o) throw Error('cannot determine import root')
  33650. var l = t.imports[s]
  33651. if ('google/protobuf/descriptor.proto' === l) continue
  33652. if (((l = o + i + l), !0 === this.files[l])) continue
  33653. ;/\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, '.json'))
  33654. var c = u.Util.fetch(l)
  33655. if (null === c) throw Error("failed to import '" + l + "' in '" + e + "': file not found")
  33656. ;/\.json$/i.test(l) ? this.import(JSON.parse(c + ''), l) : this.import(u.DotProto.Parser.parse(c), l)
  33657. } else
  33658. e
  33659. ? /\.(\w+)$/.test(e)
  33660. ? this.import(
  33661. t.imports[s],
  33662. e.replace(/^(.+)\.(\w+)$/, function (e, t, i) {
  33663. return t + '_import' + s + '.' + i
  33664. })
  33665. )
  33666. : this.import(t.imports[s], e + '_import' + s)
  33667. : this.import(t.imports[s])
  33668. a && (this.importRoot = null)
  33669. }
  33670. t.package && this.define(t.package),
  33671. t.syntax &&
  33672. (function t(i) {
  33673. i.messages &&
  33674. i.messages.forEach(function (e) {
  33675. ;(e.syntax = i.syntax), t(e)
  33676. }),
  33677. i.enums &&
  33678. i.enums.forEach(function (e) {
  33679. e.syntax = i.syntax
  33680. })
  33681. })(t)
  33682. var h = this.ptr
  33683. return (
  33684. t.options &&
  33685. Object.keys(t.options).forEach(function (e) {
  33686. h.options[e] = t.options[e]
  33687. }),
  33688. t.messages && (this.create(t.messages), (this.ptr = h)),
  33689. t.enums && (this.create(t.enums), (this.ptr = h)),
  33690. t.services && (this.create(t.services), (this.ptr = h)),
  33691. t.extends && this.create(t.extends),
  33692. this.reset()
  33693. )
  33694. }),
  33695. (n.resolveAll = function () {
  33696. var e
  33697. if (null == this.ptr || 'object' == typeof this.ptr.type) return this
  33698. if (this.ptr instanceof s.Namespace)
  33699. this.ptr.children.forEach(function (e) {
  33700. ;(this.ptr = e), this.resolveAll()
  33701. }, this)
  33702. else if (this.ptr instanceof s.Message.Field) {
  33703. if (i.TYPE.test(this.ptr.type)) this.ptr.type = u.TYPES[this.ptr.type]
  33704. else {
  33705. if (!i.TYPEREF.test(this.ptr.type)) throw Error('illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.type)
  33706. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  33707. throw Error('unresolvable type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.type)
  33708. if ((this.ptr.resolvedType = e) instanceof s.Enum) {
  33709. if (((this.ptr.type = u.TYPES.enum), 'proto3' === this.ptr.syntax && 'proto3' !== e.syntax)) throw Error('proto3 message cannot reference proto2 enum')
  33710. } else {
  33711. if (!(e instanceof s.Message)) throw Error('illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.type)
  33712. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  33713. }
  33714. }
  33715. if (this.ptr.map) {
  33716. if (!i.TYPE.test(this.ptr.keyType)) throw Error('illegal key type for map field in ' + this.ptr.toString(!0) + ': ' + this.ptr.keyType)
  33717. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  33718. }
  33719. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  33720. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod)) throw Error('illegal service type in ' + this.ptr.toString(!0))
  33721. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  33722. throw Error('Illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.requestName)
  33723. if (((this.ptr.resolvedRequestType = e), !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message)))
  33724. throw Error('Illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.responseName)
  33725. this.ptr.resolvedResponseType = e
  33726. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  33727. throw Error('illegal object in namespace: ' + typeof this.ptr + ': ' + this.ptr)
  33728. return this.reset()
  33729. }),
  33730. (n.build = function (e) {
  33731. if ((this.reset(), this.resolved || (this.resolveAll(), (this.resolved = !0), (this.result = null)), null === this.result && (this.result = this.ns.build()), !e))
  33732. return this.result
  33733. for (var t = 'string' == typeof e ? e.split('.') : e, i = this.result, n = 0; n < t.length; n++) {
  33734. if (!i[t[n]]) {
  33735. i = null
  33736. break
  33737. }
  33738. i = i[t[n]]
  33739. }
  33740. return i
  33741. }),
  33742. (n.lookup = function (e, t) {
  33743. return e ? this.ns.resolve(e, t) : this.ns
  33744. }),
  33745. (n.toString = function () {
  33746. return 'Builder'
  33747. }),
  33748. (h.Message = function () {}),
  33749. (h.Enum = function () {}),
  33750. (h.Service = function () {}),
  33751. h)),
  33752. (o.Map =
  33753. ((a = o.Reflect),
  33754. ((t = c.prototype).clear = function () {
  33755. this.map = {}
  33756. }),
  33757. (t.delete = function (e) {
  33758. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e)),
  33759. i = t in this.map
  33760. return delete this.map[t], i
  33761. }),
  33762. (t.entries = function () {
  33763. 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])
  33764. return l(t)
  33765. }),
  33766. (t.keys = function () {
  33767. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++) e.push(this.map[t[i]].key)
  33768. return l(e)
  33769. }),
  33770. (t.values = function () {
  33771. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++) e.push(this.map[t[i]].value)
  33772. return l(e)
  33773. }),
  33774. (t.forEach = function (e, t) {
  33775. 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)
  33776. }),
  33777. (t.set = function (e, t) {
  33778. var i = this.keyElem.verifyValue(e),
  33779. n = this.valueElem.verifyValue(t)
  33780. return (
  33781. (this.map[this.keyElem.valueToString(i)] = {
  33782. key: i,
  33783. value: n
  33784. }),
  33785. this
  33786. )
  33787. }),
  33788. (t.get = function (e) {
  33789. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  33790. if (t in this.map) return this.map[t].value
  33791. }),
  33792. (t.has = function (e) {
  33793. return this.keyElem.valueToString(this.keyElem.verifyValue(e)) in this.map
  33794. }),
  33795. c)),
  33796. (o.loadProto = function (e, t, i) {
  33797. 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)
  33798. }),
  33799. (o.protoFromString = o.loadProto),
  33800. (o.loadProtoFile = function (t, i, n) {
  33801. if ((i && 'object' == typeof i ? ((n = i), (i = null)) : (i && 'function' == typeof i) || (i = null), i))
  33802. return o.Util.fetch('string' == typeof t ? t : t.root + '/' + t.file, function (e) {
  33803. if (null !== e)
  33804. try {
  33805. i(null, o.loadProto(e, n, t))
  33806. } catch (e) {
  33807. i(e)
  33808. }
  33809. else i(Error('Failed to fetch file'))
  33810. })
  33811. var e = o.Util.fetch('object' == typeof t ? t.root + '/' + t.file : t)
  33812. return null === e ? null : o.loadProto(e, n, t)
  33813. }),
  33814. (o.protoFromFile = o.loadProtoFile),
  33815. (o.newBuilder = function (e) {
  33816. return (
  33817. void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  33818. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  33819. new o.Builder(e)
  33820. )
  33821. }),
  33822. (o.loadJson = function (e, t, i) {
  33823. return (
  33824. ('string' == typeof t || (t && 'string' == typeof t.file && 'string' == typeof t.root)) && ((i = t), (t = null)),
  33825. (t && 'object' == typeof t) || (t = o.newBuilder()),
  33826. 'string' == typeof e && (e = JSON.parse(e)),
  33827. t.import(e, i),
  33828. t.resolveAll(),
  33829. t
  33830. )
  33831. }),
  33832. (o.loadJsonFile = function (t, i, n) {
  33833. if ((i && 'object' == typeof i ? ((n = i), (i = null)) : (i && 'function' == typeof i) || (i = null), i))
  33834. return o.Util.fetch('string' == typeof t ? t : t.root + '/' + t.file, function (e) {
  33835. if (null !== e)
  33836. try {
  33837. i(null, o.loadJson(JSON.parse(e), n, t))
  33838. } catch (e) {
  33839. i(e)
  33840. }
  33841. else i(Error('Failed to fetch file'))
  33842. })
  33843. var e = o.Util.fetch('object' == typeof t ? t.root + '/' + t.file : t)
  33844. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  33845. }),
  33846. o
  33847. )
  33848. function l(e) {
  33849. var t = 0
  33850. return {
  33851. next: function () {
  33852. return t < e.length
  33853. ? {
  33854. done: !1,
  33855. value: e[t++]
  33856. }
  33857. : {
  33858. done: !0
  33859. }
  33860. }
  33861. }
  33862. }
  33863. function c(e, t) {
  33864. if (!e.map) throw Error('field is not a map')
  33865. if (
  33866. ((this.field = e),
  33867. (this.keyElem = new a.Element(e.keyType, null, !0, e.syntax)),
  33868. (this.valueElem = new a.Element(e.type, e.resolvedType, !1, e.syntax)),
  33869. (this.map = {}),
  33870. Object.defineProperty(this, 'size', {
  33871. get: function () {
  33872. return Object.keys(this.map).length
  33873. }
  33874. }),
  33875. t)
  33876. )
  33877. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  33878. var r = this.keyElem.valueFromString(i[n]),
  33879. o = this.valueElem.verifyValue(t[i[n]])
  33880. this.map[this.keyElem.valueToString(r)] = {
  33881. key: r,
  33882. value: o
  33883. }
  33884. }
  33885. }
  33886. function h(e) {
  33887. ;(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 || {})
  33888. }
  33889. }),
  33890. 'function' == typeof define && define.amd
  33891. ? define(['bytebuffer'], t)
  33892. : 'function' == typeof p && 'object' == typeof i && i && i.exports
  33893. ? (i.exports = t(p('bytebuffer')))
  33894. : ((e.dcodeIO = e.dcodeIO || {}).ProtoBuf = t(e.dcodeIO.ByteBuffer))
  33895. }).call(this, p('_process'))
  33896. },
  33897. {
  33898. _process: 203,
  33899. bytebuffer: 215,
  33900. fs: 197,
  33901. path: 197
  33902. }
  33903. ],
  33904. 215: [
  33905. function (t, e, i) {
  33906. var n, r
  33907. ;(n = this),
  33908. (r = function (l) {
  33909. 'use strict'
  33910. function s(e) {
  33911. var t = 0
  33912. return function () {
  33913. return t < e.length ? e.charCodeAt(t++) : null
  33914. }
  33915. }
  33916. function c() {
  33917. var e = [],
  33918. t = []
  33919. return function () {
  33920. return 0 === arguments.length
  33921. ? t.join('') + i.apply(String, e)
  33922. : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)), (e.length = 0)), void Array.prototype.push.apply(e, arguments))
  33923. }
  33924. }
  33925. function n(e, t, i, n, r) {
  33926. var o,
  33927. a,
  33928. s = 8 * r - n - 1,
  33929. l = (1 << s) - 1,
  33930. c = l >> 1,
  33931. h = -7,
  33932. u = i ? r - 1 : 0,
  33933. d = i ? -1 : 1,
  33934. p = e[t + u]
  33935. for (u += d, o = p & ((1 << -h) - 1), p >>= -h, h += s; 0 < h; o = 256 * o + e[t + u], u += d, h -= 8);
  33936. for (a = o & ((1 << -h) - 1), o >>= -h, h += n; 0 < h; a = 256 * a + e[t + u], u += d, h -= 8);
  33937. if (0 === o) o = 1 - c
  33938. else {
  33939. if (o === l) return a ? NaN : (1 / 0) * (p ? -1 : 1)
  33940. ;(a += Math.pow(2, n)), (o -= c)
  33941. }
  33942. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  33943. }
  33944. function r(e, t, i, n, r, o) {
  33945. var a,
  33946. s,
  33947. l,
  33948. c = 8 * o - r - 1,
  33949. h = (1 << c) - 1,
  33950. u = h >> 1,
  33951. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  33952. p = n ? 0 : o - 1,
  33953. f = n ? 1 : -1,
  33954. g = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0
  33955. for (
  33956. t = Math.abs(t),
  33957. isNaN(t) || t === 1 / 0
  33958. ? ((s = isNaN(t) ? 1 : 0), (a = h))
  33959. : ((a = Math.floor(Math.log(t) / Math.LN2)),
  33960. t * (l = Math.pow(2, -a)) < 1 && (a--, (l *= 2)),
  33961. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++, (l /= 2)),
  33962. 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)));
  33963. 8 <= r;
  33964. e[i + p] = 255 & s, p += f, s /= 256, r -= 8
  33965. );
  33966. for (a = (a << r) | s, c += r; 0 < c; e[i + p] = 255 & a, p += f, a /= 256, c -= 8);
  33967. e[i + p - f] |= 128 * g
  33968. }
  33969. var f = function (e, t, i) {
  33970. if ((void 0 === e && (e = f.DEFAULT_CAPACITY), void 0 === t && (t = f.DEFAULT_ENDIAN), void 0 === i && (i = f.DEFAULT_NOASSERT), !i)) {
  33971. if ((e |= 0) < 0) throw RangeError('Illegal capacity')
  33972. ;(t = !!t), (i = !!i)
  33973. }
  33974. ;(this.buffer = 0 === e ? o : new ArrayBuffer(e)),
  33975. (this.view = 0 === e ? null : new Uint8Array(this.buffer)),
  33976. (this.offset = 0),
  33977. (this.markedOffset = -1),
  33978. (this.limit = e),
  33979. (this.littleEndian = t),
  33980. (this.noAssert = i)
  33981. }
  33982. ;(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)
  33983. var a = f.prototype
  33984. a.__isByteBuffer__,
  33985. Object.defineProperty(a, '__isByteBuffer__', {
  33986. value: !0,
  33987. enumerable: !1,
  33988. configurable: !1
  33989. })
  33990. var o = new ArrayBuffer(0),
  33991. i = String.fromCharCode
  33992. ;(f.accessor = function () {
  33993. return Uint8Array
  33994. }),
  33995. (f.allocate = function (e, t, i) {
  33996. return new f(e, t, i)
  33997. }),
  33998. (f.concat = function (e, t, i, n) {
  33999. ;('boolean' != typeof t && 'string' == typeof t) || ((n = i), (i = t), (t = void 0))
  34000. 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)
  34001. if (0 === o) return new f(0, i, n)
  34002. var l,
  34003. c = new f(o, i, n)
  34004. 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))
  34005. return (c.limit = c.offset), (c.offset = 0), c
  34006. }),
  34007. (f.isByteBuffer = function (e) {
  34008. return !0 === (e && e.__isByteBuffer__)
  34009. }),
  34010. (f.type = function () {
  34011. return ArrayBuffer
  34012. }),
  34013. (f.wrap = function (e, t, i, n) {
  34014. if (('string' != typeof t && ((n = i), (i = t), (t = void 0)), 'string' == typeof e))
  34015. switch ((void 0 === t && (t = 'utf8'), t)) {
  34016. case 'base64':
  34017. return f.fromBase64(e, i)
  34018. case 'hex':
  34019. return f.fromHex(e, i)
  34020. case 'binary':
  34021. return f.fromBinary(e, i)
  34022. case 'utf8':
  34023. return f.fromUTF8(e, i)
  34024. case 'debug':
  34025. return f.fromDebug(e, i)
  34026. default:
  34027. throw Error('Unsupported encoding: ' + t)
  34028. }
  34029. if (null === e || 'object' != typeof e) throw TypeError('Illegal buffer')
  34030. var r
  34031. if (f.isByteBuffer(e)) return ((r = a.clone.call(e)).markedOffset = -1), r
  34032. if (e instanceof Uint8Array)
  34033. (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)))
  34034. else if (e instanceof ArrayBuffer)
  34035. (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))
  34036. else {
  34037. if ('[object Array]' !== Object.prototype.toString.call(e)) throw TypeError('Illegal buffer')
  34038. ;(r = new f(e.length, i, n)).limit = e.length
  34039. for (var o = 0; o < e.length; ++o) r.view[o] = e[o]
  34040. }
  34041. return r
  34042. }),
  34043. (a.writeBitSet = function (e, t) {
  34044. var i = void 0 === t
  34045. if ((i && (t = this.offset), !this.noAssert)) {
  34046. if (!(e instanceof Array)) throw TypeError('Illegal BitSet: Not an array')
  34047. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34048. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34049. }
  34050. var n,
  34051. r = t,
  34052. o = e.length,
  34053. a = o >> 3,
  34054. s = 0
  34055. for (t += this.writeVarint32(o, t); a--; )
  34056. (n =
  34057. (1 & !!e[s++]) |
  34058. ((1 & !!e[s++]) << 1) |
  34059. ((1 & !!e[s++]) << 2) |
  34060. ((1 & !!e[s++]) << 3) |
  34061. ((1 & !!e[s++]) << 4) |
  34062. ((1 & !!e[s++]) << 5) |
  34063. ((1 & !!e[s++]) << 6) |
  34064. ((1 & !!e[s++]) << 7)),
  34065. this.writeByte(n, t++)
  34066. if (s < o) {
  34067. var l = 0
  34068. for (n = 0; s < o; ) n |= (1 & !!e[s++]) << l++
  34069. this.writeByte(n, t++)
  34070. }
  34071. return i ? ((this.offset = t), this) : t - r
  34072. }),
  34073. (a.readBitSet = function (e) {
  34074. var t = void 0 === e
  34075. t && (e = this.offset)
  34076. var i,
  34077. n = this.readVarint32(e),
  34078. r = n.value,
  34079. o = r >> 3,
  34080. a = 0,
  34081. s = []
  34082. for (e += n.length; o--; )
  34083. (i = this.readByte(e++)),
  34084. (s[a++] = !!(1 & i)),
  34085. (s[a++] = !!(2 & i)),
  34086. (s[a++] = !!(4 & i)),
  34087. (s[a++] = !!(8 & i)),
  34088. (s[a++] = !!(16 & i)),
  34089. (s[a++] = !!(32 & i)),
  34090. (s[a++] = !!(64 & i)),
  34091. (s[a++] = !!(128 & i))
  34092. if (a < r) {
  34093. var l = 0
  34094. for (i = this.readByte(e++); a < r; ) s[a++] = !!((i >> l++) & 1)
  34095. }
  34096. return t && (this.offset = e), s
  34097. }),
  34098. (a.readBytes = function (e, t) {
  34099. var i = void 0 === t
  34100. if ((i && (t = this.offset), !this.noAssert)) {
  34101. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34102. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+' + e + ') <= ' + this.buffer.byteLength)
  34103. }
  34104. var n = this.slice(t, t + e)
  34105. return i && (this.offset += e), n
  34106. }),
  34107. (a.writeBytes = a.append),
  34108. (a.writeInt8 = function (e, t) {
  34109. var i = void 0 === t
  34110. if ((i && (t = this.offset), !this.noAssert)) {
  34111. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  34112. if (((e |= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34113. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34114. }
  34115. t += 1
  34116. var n = this.buffer.byteLength
  34117. return n < t && this.resize((n *= 2) > t ? n : t), (t -= 1), (this.view[t] = e), i && (this.offset += 1), this
  34118. }),
  34119. (a.writeByte = a.writeInt8),
  34120. (a.readInt8 = function (e) {
  34121. var t = void 0 === e
  34122. if ((t && (e = this.offset), !this.noAssert)) {
  34123. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34124. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength)
  34125. }
  34126. var i = this.view[e]
  34127. return 128 == (128 & i) && (i = -(255 - i + 1)), t && (this.offset += 1), i
  34128. }),
  34129. (a.readByte = a.readInt8),
  34130. (a.writeUint8 = function (e, t) {
  34131. var i = void 0 === t
  34132. if ((i && (t = this.offset), !this.noAssert)) {
  34133. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  34134. if (((e >>>= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34135. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34136. }
  34137. t += 1
  34138. var n = this.buffer.byteLength
  34139. return n < t && this.resize((n *= 2) > t ? n : t), (t -= 1), (this.view[t] = e), i && (this.offset += 1), this
  34140. }),
  34141. (a.writeUInt8 = a.writeUint8),
  34142. (a.readUint8 = function (e) {
  34143. var t = void 0 === e
  34144. if ((t && (e = this.offset), !this.noAssert)) {
  34145. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34146. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength)
  34147. }
  34148. var i = this.view[e]
  34149. return t && (this.offset += 1), i
  34150. }),
  34151. (a.readUInt8 = a.readUint8),
  34152. (a.writeInt16 = function (e, t) {
  34153. var i = void 0 === t
  34154. if ((i && (t = this.offset), !this.noAssert)) {
  34155. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  34156. if (((e |= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34157. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34158. }
  34159. t += 2
  34160. var n = this.buffer.byteLength
  34161. return (
  34162. n < t && this.resize((n *= 2) > t ? n : t),
  34163. (t -= 2),
  34164. 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)),
  34165. i && (this.offset += 2),
  34166. this
  34167. )
  34168. }),
  34169. (a.writeShort = a.writeInt16),
  34170. (a.readInt16 = function (e) {
  34171. var t = void 0 === e
  34172. if ((t && (e = this.offset), !this.noAssert)) {
  34173. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34174. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+2) <= ' + this.buffer.byteLength)
  34175. }
  34176. var i = 0
  34177. return (
  34178. this.littleEndian ? ((i = this.view[e]), (i |= this.view[e + 1] << 8)) : ((i = this.view[e] << 8), (i |= this.view[e + 1])),
  34179. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  34180. t && (this.offset += 2),
  34181. i
  34182. )
  34183. }),
  34184. (a.readShort = a.readInt16),
  34185. (a.writeUint16 = function (e, t) {
  34186. var i = void 0 === t
  34187. if ((i && (t = this.offset), !this.noAssert)) {
  34188. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  34189. if (((e >>>= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34190. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34191. }
  34192. t += 2
  34193. var n = this.buffer.byteLength
  34194. return (
  34195. n < t && this.resize((n *= 2) > t ? n : t),
  34196. (t -= 2),
  34197. 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)),
  34198. i && (this.offset += 2),
  34199. this
  34200. )
  34201. }),
  34202. (a.writeUInt16 = a.writeUint16),
  34203. (a.readUint16 = function (e) {
  34204. var t = void 0 === e
  34205. if ((t && (e = this.offset), !this.noAssert)) {
  34206. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34207. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+2) <= ' + this.buffer.byteLength)
  34208. }
  34209. var i = 0
  34210. 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
  34211. }),
  34212. (a.readUInt16 = a.readUint16),
  34213. (a.writeInt32 = function (e, t) {
  34214. var i = void 0 === t
  34215. if ((i && (t = this.offset), !this.noAssert)) {
  34216. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  34217. if (((e |= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34218. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34219. }
  34220. t += 4
  34221. var n = this.buffer.byteLength
  34222. return (
  34223. n < t && this.resize((n *= 2) > t ? n : t),
  34224. (t -= 4),
  34225. this.littleEndian
  34226. ? ((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))
  34227. : ((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)),
  34228. i && (this.offset += 4),
  34229. this
  34230. )
  34231. }),
  34232. (a.writeInt = a.writeInt32),
  34233. (a.readInt32 = function (e) {
  34234. var t = void 0 === e
  34235. if ((t && (e = this.offset), !this.noAssert)) {
  34236. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34237. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength)
  34238. }
  34239. var i = 0
  34240. return (
  34241. this.littleEndian
  34242. ? ((i = this.view[e + 2] << 16), (i |= this.view[e + 1] << 8), (i |= this.view[e]), (i += (this.view[e + 3] << 24) >>> 0))
  34243. : ((i = this.view[e + 1] << 16), (i |= this.view[e + 2] << 8), (i |= this.view[e + 3]), (i += (this.view[e] << 24) >>> 0)),
  34244. (i |= 0),
  34245. t && (this.offset += 4),
  34246. i
  34247. )
  34248. }),
  34249. (a.readInt = a.readInt32),
  34250. (a.writeUint32 = function (e, t) {
  34251. var i = void 0 === t
  34252. if ((i && (t = this.offset), !this.noAssert)) {
  34253. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  34254. if (((e >>>= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34255. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34256. }
  34257. t += 4
  34258. var n = this.buffer.byteLength
  34259. return (
  34260. n < t && this.resize((n *= 2) > t ? n : t),
  34261. (t -= 4),
  34262. this.littleEndian
  34263. ? ((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))
  34264. : ((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)),
  34265. i && (this.offset += 4),
  34266. this
  34267. )
  34268. }),
  34269. (a.writeUInt32 = a.writeUint32),
  34270. (a.readUint32 = function (e) {
  34271. var t = void 0 === e
  34272. if ((t && (e = this.offset), !this.noAssert)) {
  34273. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34274. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength)
  34275. }
  34276. var i = 0
  34277. return (
  34278. this.littleEndian
  34279. ? ((i = this.view[e + 2] << 16), (i |= this.view[e + 1] << 8), (i |= this.view[e]), (i += (this.view[e + 3] << 24) >>> 0))
  34280. : ((i = this.view[e + 1] << 16), (i |= this.view[e + 2] << 8), (i |= this.view[e + 3]), (i += (this.view[e] << 24) >>> 0)),
  34281. t && (this.offset += 4),
  34282. i
  34283. )
  34284. }),
  34285. (a.readUInt32 = a.readUint32),
  34286. l &&
  34287. ((a.writeInt64 = function (e, t) {
  34288. var i = void 0 === t
  34289. if ((i && (t = this.offset), !this.noAssert)) {
  34290. if ('number' == typeof e) e = l.fromNumber(e)
  34291. else if ('string' == typeof e) e = l.fromString(e)
  34292. else if (!(e && e instanceof l)) throw TypeError('Illegal value: ' + e + ' (not an integer or Long)')
  34293. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34294. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34295. }
  34296. 'number' == typeof e ? (e = l.fromNumber(e)) : 'string' == typeof e && (e = l.fromString(e)), (t += 8)
  34297. var n = this.buffer.byteLength
  34298. n < t && this.resize((n *= 2) > t ? n : t), (t -= 8)
  34299. var r = e.low,
  34300. o = e.high
  34301. return (
  34302. this.littleEndian
  34303. ? ((this.view[t + 3] = (r >>> 24) & 255),
  34304. (this.view[t + 2] = (r >>> 16) & 255),
  34305. (this.view[t + 1] = (r >>> 8) & 255),
  34306. (this.view[t] = 255 & r),
  34307. (t += 4),
  34308. (this.view[t + 3] = (o >>> 24) & 255),
  34309. (this.view[t + 2] = (o >>> 16) & 255),
  34310. (this.view[t + 1] = (o >>> 8) & 255),
  34311. (this.view[t] = 255 & o))
  34312. : ((this.view[t] = (o >>> 24) & 255),
  34313. (this.view[t + 1] = (o >>> 16) & 255),
  34314. (this.view[t + 2] = (o >>> 8) & 255),
  34315. (this.view[t + 3] = 255 & o),
  34316. (t += 4),
  34317. (this.view[t] = (r >>> 24) & 255),
  34318. (this.view[t + 1] = (r >>> 16) & 255),
  34319. (this.view[t + 2] = (r >>> 8) & 255),
  34320. (this.view[t + 3] = 255 & r)),
  34321. i && (this.offset += 8),
  34322. this
  34323. )
  34324. }),
  34325. (a.writeLong = a.writeInt64),
  34326. (a.readInt64 = function (e) {
  34327. var t = void 0 === e
  34328. if ((t && (e = this.offset), !this.noAssert)) {
  34329. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34330. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+8) <= ' + this.buffer.byteLength)
  34331. }
  34332. var i = 0,
  34333. n = 0
  34334. this.littleEndian
  34335. ? ((i = this.view[e + 2] << 16),
  34336. (i |= this.view[e + 1] << 8),
  34337. (i |= this.view[e]),
  34338. (i += (this.view[e + 3] << 24) >>> 0),
  34339. (e += 4),
  34340. (n = this.view[e + 2] << 16),
  34341. (n |= this.view[e + 1] << 8),
  34342. (n |= this.view[e]),
  34343. (n += (this.view[e + 3] << 24) >>> 0))
  34344. : ((n = this.view[e + 1] << 16),
  34345. (n |= this.view[e + 2] << 8),
  34346. (n |= this.view[e + 3]),
  34347. (n += (this.view[e] << 24) >>> 0),
  34348. (e += 4),
  34349. (i = this.view[e + 1] << 16),
  34350. (i |= this.view[e + 2] << 8),
  34351. (i |= this.view[e + 3]),
  34352. (i += (this.view[e] << 24) >>> 0))
  34353. var r = new l(i, n, !1)
  34354. return t && (this.offset += 8), r
  34355. }),
  34356. (a.readLong = a.readInt64),
  34357. (a.writeUint64 = function (e, t) {
  34358. var i = void 0 === t
  34359. if ((i && (t = this.offset), !this.noAssert)) {
  34360. if ('number' == typeof e) e = l.fromNumber(e)
  34361. else if ('string' == typeof e) e = l.fromString(e)
  34362. else if (!(e && e instanceof l)) throw TypeError('Illegal value: ' + e + ' (not an integer or Long)')
  34363. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34364. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34365. }
  34366. 'number' == typeof e ? (e = l.fromNumber(e)) : 'string' == typeof e && (e = l.fromString(e)), (t += 8)
  34367. var n = this.buffer.byteLength
  34368. n < t && this.resize((n *= 2) > t ? n : t), (t -= 8)
  34369. var r = e.low,
  34370. o = e.high
  34371. return (
  34372. this.littleEndian
  34373. ? ((this.view[t + 3] = (r >>> 24) & 255),
  34374. (this.view[t + 2] = (r >>> 16) & 255),
  34375. (this.view[t + 1] = (r >>> 8) & 255),
  34376. (this.view[t] = 255 & r),
  34377. (t += 4),
  34378. (this.view[t + 3] = (o >>> 24) & 255),
  34379. (this.view[t + 2] = (o >>> 16) & 255),
  34380. (this.view[t + 1] = (o >>> 8) & 255),
  34381. (this.view[t] = 255 & o))
  34382. : ((this.view[t] = (o >>> 24) & 255),
  34383. (this.view[t + 1] = (o >>> 16) & 255),
  34384. (this.view[t + 2] = (o >>> 8) & 255),
  34385. (this.view[t + 3] = 255 & o),
  34386. (t += 4),
  34387. (this.view[t] = (r >>> 24) & 255),
  34388. (this.view[t + 1] = (r >>> 16) & 255),
  34389. (this.view[t + 2] = (r >>> 8) & 255),
  34390. (this.view[t + 3] = 255 & r)),
  34391. i && (this.offset += 8),
  34392. this
  34393. )
  34394. }),
  34395. (a.writeUInt64 = a.writeUint64),
  34396. (a.readUint64 = function (e) {
  34397. var t = void 0 === e
  34398. if ((t && (e = this.offset), !this.noAssert)) {
  34399. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34400. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+8) <= ' + this.buffer.byteLength)
  34401. }
  34402. var i = 0,
  34403. n = 0
  34404. this.littleEndian
  34405. ? ((i = this.view[e + 2] << 16),
  34406. (i |= this.view[e + 1] << 8),
  34407. (i |= this.view[e]),
  34408. (i += (this.view[e + 3] << 24) >>> 0),
  34409. (e += 4),
  34410. (n = this.view[e + 2] << 16),
  34411. (n |= this.view[e + 1] << 8),
  34412. (n |= this.view[e]),
  34413. (n += (this.view[e + 3] << 24) >>> 0))
  34414. : ((n = this.view[e + 1] << 16),
  34415. (n |= this.view[e + 2] << 8),
  34416. (n |= this.view[e + 3]),
  34417. (n += (this.view[e] << 24) >>> 0),
  34418. (e += 4),
  34419. (i = this.view[e + 1] << 16),
  34420. (i |= this.view[e + 2] << 8),
  34421. (i |= this.view[e + 3]),
  34422. (i += (this.view[e] << 24) >>> 0))
  34423. var r = new l(i, n, !0)
  34424. return t && (this.offset += 8), r
  34425. }),
  34426. (a.readUInt64 = a.readUint64)),
  34427. (a.writeFloat32 = function (e, t) {
  34428. var i = void 0 === t
  34429. if ((i && (t = this.offset), !this.noAssert)) {
  34430. if ('number' != typeof e) throw TypeError('Illegal value: ' + e + ' (not a number)')
  34431. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34432. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34433. }
  34434. t += 4
  34435. var n = this.buffer.byteLength
  34436. 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
  34437. }),
  34438. (a.writeFloat = a.writeFloat32),
  34439. (a.readFloat32 = 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 + 4 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength)
  34444. }
  34445. var i = n(this.view, e, this.littleEndian, 23, 4)
  34446. return t && (this.offset += 4), i
  34447. }),
  34448. (a.readFloat = a.readFloat32),
  34449. (a.writeFloat64 = function (e, t) {
  34450. var i = void 0 === t
  34451. if ((i && (t = this.offset), !this.noAssert)) {
  34452. if ('number' != typeof e) throw TypeError('Illegal value: ' + e + ' (not a number)')
  34453. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34454. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34455. }
  34456. t += 8
  34457. var n = this.buffer.byteLength
  34458. 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
  34459. }),
  34460. (a.writeDouble = a.writeFloat64),
  34461. (a.readFloat64 = function (e) {
  34462. var t = void 0 === e
  34463. if ((t && (e = this.offset), !this.noAssert)) {
  34464. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34465. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+8) <= ' + this.buffer.byteLength)
  34466. }
  34467. var i = n(this.view, e, this.littleEndian, 52, 8)
  34468. return t && (this.offset += 8), i
  34469. }),
  34470. (a.readDouble = a.readFloat64),
  34471. (f.MAX_VARINT32_BYTES = 5),
  34472. (f.calculateVarint32 = function (e) {
  34473. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  34474. }),
  34475. (f.zigZagEncode32 = function (e) {
  34476. return (((e |= 0) << 1) ^ (e >> 31)) >>> 0
  34477. }),
  34478. (f.zigZagDecode32 = function (e) {
  34479. return ((e >>> 1) ^ -(1 & e)) | 0
  34480. }),
  34481. (a.writeVarint32 = function (e, t) {
  34482. var i = void 0 === t
  34483. if ((i && (t = this.offset), !this.noAssert)) {
  34484. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  34485. if (((e |= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34486. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34487. }
  34488. var n,
  34489. r = f.calculateVarint32(e)
  34490. t += r
  34491. var o = this.buffer.byteLength
  34492. 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)
  34493. return (this.view[t++] = e), i ? ((this.offset = t), this) : r
  34494. }),
  34495. (a.writeVarint32ZigZag = function (e, t) {
  34496. return this.writeVarint32(f.zigZagEncode32(e), t)
  34497. }),
  34498. (a.readVarint32 = function (e) {
  34499. var t = void 0 === e
  34500. if ((t && (e = this.offset), !this.noAssert)) {
  34501. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34502. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength)
  34503. }
  34504. var i,
  34505. n = 0,
  34506. r = 0
  34507. do {
  34508. if (!this.noAssert && e > this.limit) {
  34509. var o = Error('Truncated')
  34510. throw ((o.truncated = !0), o)
  34511. }
  34512. ;(i = this.view[e++]), n < 5 && (r |= (127 & i) << (7 * n)), ++n
  34513. } while (0 != (128 & i))
  34514. return (
  34515. (r |= 0),
  34516. t
  34517. ? ((this.offset = e), r)
  34518. : {
  34519. value: r,
  34520. length: n
  34521. }
  34522. )
  34523. }),
  34524. (a.readVarint32ZigZag = function (e) {
  34525. var t = this.readVarint32(e)
  34526. return 'object' == typeof t ? (t.value = f.zigZagDecode32(t.value)) : (t = f.zigZagDecode32(t)), t
  34527. }),
  34528. l &&
  34529. ((f.MAX_VARINT64_BYTES = 10),
  34530. (f.calculateVarint64 = function (e) {
  34531. 'number' == typeof e ? (e = l.fromNumber(e)) : 'string' == typeof e && (e = l.fromString(e))
  34532. var t = e.toInt() >>> 0,
  34533. i = e.shiftRightUnsigned(28).toInt() >>> 0,
  34534. n = e.shiftRightUnsigned(56).toInt() >>> 0
  34535. 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
  34536. }),
  34537. (f.zigZagEncode64 = function (e) {
  34538. return (
  34539. 'number' == typeof e ? (e = l.fromNumber(e, !1)) : 'string' == typeof e ? (e = l.fromString(e, !1)) : !1 !== e.unsigned && (e = e.toSigned()),
  34540. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  34541. )
  34542. }),
  34543. (f.zigZagDecode64 = function (e) {
  34544. return (
  34545. 'number' == typeof e ? (e = l.fromNumber(e, !1)) : 'string' == typeof e ? (e = l.fromString(e, !1)) : !1 !== e.unsigned && (e = e.toSigned()),
  34546. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  34547. )
  34548. }),
  34549. (a.writeVarint64 = function (e, t) {
  34550. var i = void 0 === t
  34551. if ((i && (t = this.offset), !this.noAssert)) {
  34552. if ('number' == typeof e) e = l.fromNumber(e)
  34553. else if ('string' == typeof e) e = l.fromString(e)
  34554. else if (!(e && e instanceof l)) throw TypeError('Illegal value: ' + e + ' (not an integer or Long)')
  34555. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34556. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34557. }
  34558. 'number' == typeof e ? (e = l.fromNumber(e, !1)) : 'string' == typeof e ? (e = l.fromString(e, !1)) : !1 !== e.unsigned && (e = e.toSigned())
  34559. var n = f.calculateVarint64(e),
  34560. r = e.toInt() >>> 0,
  34561. o = e.shiftRightUnsigned(28).toInt() >>> 0,
  34562. a = e.shiftRightUnsigned(56).toInt() >>> 0
  34563. t += n
  34564. var s = this.buffer.byteLength
  34565. switch ((s < t && this.resize((s *= 2) > t ? s : t), (t -= n), n)) {
  34566. case 10:
  34567. this.view[t + 9] = (a >>> 7) & 1
  34568. case 9:
  34569. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a
  34570. case 8:
  34571. this.view[t + 7] = 8 !== n ? (o >>> 21) | 128 : (o >>> 21) & 127
  34572. case 7:
  34573. this.view[t + 6] = 7 !== n ? (o >>> 14) | 128 : (o >>> 14) & 127
  34574. case 6:
  34575. this.view[t + 5] = 6 !== n ? (o >>> 7) | 128 : (o >>> 7) & 127
  34576. case 5:
  34577. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o
  34578. case 4:
  34579. this.view[t + 3] = 4 !== n ? (r >>> 21) | 128 : (r >>> 21) & 127
  34580. case 3:
  34581. this.view[t + 2] = 3 !== n ? (r >>> 14) | 128 : (r >>> 14) & 127
  34582. case 2:
  34583. this.view[t + 1] = 2 !== n ? (r >>> 7) | 128 : (r >>> 7) & 127
  34584. case 1:
  34585. this.view[t] = 1 !== n ? 128 | r : 127 & r
  34586. }
  34587. return i ? ((this.offset += n), this) : n
  34588. }),
  34589. (a.writeVarint64ZigZag = function (e, t) {
  34590. return this.writeVarint64(f.zigZagEncode64(e), t)
  34591. }),
  34592. (a.readVarint64 = function (e) {
  34593. var t = void 0 === e
  34594. if ((t && (e = this.offset), !this.noAssert)) {
  34595. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34596. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength)
  34597. }
  34598. var i = e,
  34599. n = 0,
  34600. r = 0,
  34601. o = 0,
  34602. a = 0
  34603. if (
  34604. ((n = 127 & (a = this.view[e++])),
  34605. 128 & a &&
  34606. ((n |= (127 & (a = this.view[e++])) << 7),
  34607. (128 & a || (this.noAssert && void 0 === a)) &&
  34608. ((n |= (127 & (a = this.view[e++])) << 14),
  34609. (128 & a || (this.noAssert && void 0 === a)) &&
  34610. ((n |= (127 & (a = this.view[e++])) << 21),
  34611. (128 & a || (this.noAssert && void 0 === a)) &&
  34612. ((r = 127 & (a = this.view[e++])),
  34613. (128 & a || (this.noAssert && void 0 === a)) &&
  34614. ((r |= (127 & (a = this.view[e++])) << 7),
  34615. (128 & a || (this.noAssert && void 0 === a)) &&
  34616. ((r |= (127 & (a = this.view[e++])) << 14),
  34617. (128 & a || (this.noAssert && void 0 === a)) &&
  34618. ((r |= (127 & (a = this.view[e++])) << 21),
  34619. (128 & a || (this.noAssert && void 0 === a)) &&
  34620. ((o = 127 & (a = this.view[e++])),
  34621. (128 & a || (this.noAssert && void 0 === a)) && ((o |= (127 & (a = this.view[e++])) << 7), 128 & a || (this.noAssert && void 0 === a)))))))))))
  34622. )
  34623. throw Error('Buffer overrun')
  34624. var s = l.fromBits(n | (r << 28), (r >>> 4) | (o << 24), !1)
  34625. return t
  34626. ? ((this.offset = e), s)
  34627. : {
  34628. value: s,
  34629. length: e - i
  34630. }
  34631. }),
  34632. (a.readVarint64ZigZag = function (e) {
  34633. var t = this.readVarint64(e)
  34634. return t && t.value instanceof l ? (t.value = f.zigZagDecode64(t.value)) : (t = f.zigZagDecode64(t)), t
  34635. })),
  34636. (a.writeCString = function (e, t) {
  34637. var i = void 0 === t
  34638. i && (t = this.offset)
  34639. var n,
  34640. r = e.length
  34641. if (!this.noAssert) {
  34642. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  34643. for (n = 0; n < r; ++n) if (0 === e.charCodeAt(n)) throw RangeError('Illegal str: Contains NULL-characters')
  34644. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34645. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34646. }
  34647. ;(r = d.calculateUTF16asUTF8(s(e))[1]), (t += r + 1)
  34648. var o = this.buffer.byteLength
  34649. return (
  34650. o < t && this.resize((o *= 2) > t ? o : t),
  34651. (t -= r + 1),
  34652. d.encodeUTF16toUTF8(
  34653. s(e),
  34654. function (e) {
  34655. this.view[t++] = e
  34656. }.bind(this)
  34657. ),
  34658. (this.view[t++] = 0),
  34659. i ? ((this.offset = t), this) : r
  34660. )
  34661. }),
  34662. (a.readCString = function (e) {
  34663. var t = void 0 === e
  34664. if ((t && (e = this.offset), !this.noAssert)) {
  34665. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34666. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength)
  34667. }
  34668. var i,
  34669. n = e,
  34670. r = -1
  34671. return (
  34672. d.decodeUTF8toUTF16(
  34673. function () {
  34674. if (0 === r) return null
  34675. if (e >= this.limit) throw RangeError('Illegal range: Truncated data, ' + e + ' < ' + this.limit)
  34676. return 0 === (r = this.view[e++]) ? null : r
  34677. }.bind(this),
  34678. (i = c()),
  34679. !0
  34680. ),
  34681. t
  34682. ? ((this.offset = e), i())
  34683. : {
  34684. string: i(),
  34685. length: e - n
  34686. }
  34687. )
  34688. }),
  34689. (a.writeIString = function (e, t) {
  34690. var i = void 0 === t
  34691. if ((i && (t = this.offset), !this.noAssert)) {
  34692. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  34693. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34694. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34695. }
  34696. var n,
  34697. r = t
  34698. ;(n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1]), (t += 4 + n)
  34699. var o = this.buffer.byteLength
  34700. if (
  34701. (o < t && this.resize((o *= 2) > t ? o : t),
  34702. (t -= 4 + n),
  34703. this.littleEndian
  34704. ? ((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))
  34705. : ((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)),
  34706. (t += 4),
  34707. d.encodeUTF16toUTF8(
  34708. s(e),
  34709. function (e) {
  34710. this.view[t++] = e
  34711. }.bind(this)
  34712. ),
  34713. t !== r + 4 + n)
  34714. )
  34715. throw RangeError('Illegal range: Truncated data, ' + t + ' == ' + (t + 4 + n))
  34716. return i ? ((this.offset = t), this) : t - r
  34717. }),
  34718. (a.readIString = function (e) {
  34719. var t = void 0 === e
  34720. if ((t && (e = this.offset), !this.noAssert)) {
  34721. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34722. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength)
  34723. }
  34724. var i = e,
  34725. n = this.readUint32(e),
  34726. r = this.readUTF8String(n, f.METRICS_BYTES, (e += 4))
  34727. return (
  34728. (e += r.length),
  34729. t
  34730. ? ((this.offset = e), r.string)
  34731. : {
  34732. string: r.string,
  34733. length: e - i
  34734. }
  34735. )
  34736. }),
  34737. (f.METRICS_CHARS = 'c'),
  34738. (f.METRICS_BYTES = 'b'),
  34739. (a.writeUTF8String = function (e, t) {
  34740. var i = void 0 === t
  34741. if ((i && (t = this.offset), !this.noAssert)) {
  34742. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34743. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34744. }
  34745. var n,
  34746. r = t
  34747. ;(n = d.calculateUTF16asUTF8(s(e))[1]), (t += n)
  34748. var o = this.buffer.byteLength
  34749. return (
  34750. o < t && this.resize((o *= 2) > t ? o : t),
  34751. (t -= n),
  34752. d.encodeUTF16toUTF8(
  34753. s(e),
  34754. function (e) {
  34755. this.view[t++] = e
  34756. }.bind(this)
  34757. ),
  34758. i ? ((this.offset = t), this) : t - r
  34759. )
  34760. }),
  34761. (a.writeString = a.writeUTF8String),
  34762. (f.calculateUTF8Chars = function (e) {
  34763. return d.calculateUTF16asUTF8(s(e))[0]
  34764. }),
  34765. (f.calculateUTF8Bytes = function (e) {
  34766. return d.calculateUTF16asUTF8(s(e))[1]
  34767. }),
  34768. (f.calculateString = f.calculateUTF8Bytes),
  34769. (a.readUTF8String = function (e, t, i) {
  34770. 'number' == typeof t && ((i = t), (t = void 0))
  34771. var n = void 0 === i
  34772. if ((n && (i = this.offset), void 0 === t && (t = f.METRICS_CHARS), !this.noAssert)) {
  34773. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal length: ' + e + ' (not an integer)')
  34774. if (((e |= 0), 'number' != typeof i || i % 1 != 0)) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  34775. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  34776. }
  34777. var r,
  34778. o = 0,
  34779. a = i
  34780. if (t === f.METRICS_CHARS) {
  34781. if (
  34782. ((r = c()),
  34783. d.decodeUTF8(
  34784. function () {
  34785. return o < e && i < this.limit ? this.view[i++] : null
  34786. }.bind(this),
  34787. function (e) {
  34788. ++o, d.UTF8toUTF16(e, r)
  34789. }
  34790. ),
  34791. o !== e)
  34792. )
  34793. throw RangeError('Illegal range: Truncated data, ' + o + ' == ' + e)
  34794. return n
  34795. ? ((this.offset = i), r())
  34796. : {
  34797. string: r(),
  34798. length: i - a
  34799. }
  34800. }
  34801. if (t !== f.METRICS_BYTES) throw TypeError('Unsupported metrics: ' + t)
  34802. if (!this.noAssert) {
  34803. if ('number' != typeof i || i % 1 != 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  34804. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + i + ' (+' + e + ') <= ' + this.buffer.byteLength)
  34805. }
  34806. var s = i + e
  34807. if (
  34808. (d.decodeUTF8toUTF16(
  34809. function () {
  34810. return i < s ? this.view[i++] : null
  34811. }.bind(this),
  34812. (r = c()),
  34813. this.noAssert
  34814. ),
  34815. i !== s)
  34816. )
  34817. throw RangeError('Illegal range: Truncated data, ' + i + ' == ' + s)
  34818. return n
  34819. ? ((this.offset = i), r())
  34820. : {
  34821. string: r(),
  34822. length: i - a
  34823. }
  34824. }),
  34825. (a.readString = a.readUTF8String),
  34826. (a.writeVString = function (e, t) {
  34827. var i = void 0 === t
  34828. if ((i && (t = this.offset), !this.noAssert)) {
  34829. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  34830. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  34831. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  34832. }
  34833. var n,
  34834. r,
  34835. o = t
  34836. ;(n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1]), (r = f.calculateVarint32(n)), (t += r + n)
  34837. var a = this.buffer.byteLength
  34838. if (
  34839. (a < t && this.resize((a *= 2) > t ? a : t),
  34840. (t -= r + n),
  34841. (t += this.writeVarint32(n, t)),
  34842. d.encodeUTF16toUTF8(
  34843. s(e),
  34844. function (e) {
  34845. this.view[t++] = e
  34846. }.bind(this)
  34847. ),
  34848. t !== o + n + r)
  34849. )
  34850. throw RangeError('Illegal range: Truncated data, ' + t + ' == ' + (t + n + r))
  34851. return i ? ((this.offset = t), this) : t - o
  34852. }),
  34853. (a.readVString = function (e) {
  34854. var t = void 0 === e
  34855. if ((t && (e = this.offset), !this.noAssert)) {
  34856. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34857. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength)
  34858. }
  34859. var i = e,
  34860. n = this.readVarint32(e),
  34861. r = this.readUTF8String(n.value, f.METRICS_BYTES, (e += n.length))
  34862. return (
  34863. (e += r.length),
  34864. t
  34865. ? ((this.offset = e), r.string)
  34866. : {
  34867. string: r.string,
  34868. length: e - i
  34869. }
  34870. )
  34871. }),
  34872. (a.append = function (e, t, i) {
  34873. ;('number' != typeof t && 'string' == typeof t) || ((i = t), (t = void 0))
  34874. var n = void 0 === i
  34875. if ((n && (i = this.offset), !this.noAssert)) {
  34876. if ('number' != typeof i || i % 1 != 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  34877. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  34878. }
  34879. e instanceof f || (e = f.wrap(e, t))
  34880. var r = e.limit - e.offset
  34881. if (r <= 0) return this
  34882. i += r
  34883. var o = this.buffer.byteLength
  34884. 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
  34885. }),
  34886. (a.appendTo = function (e, t) {
  34887. return e.append(this, t), this
  34888. }),
  34889. (a.assert = function (e) {
  34890. return (this.noAssert = !e), this
  34891. }),
  34892. (a.capacity = function () {
  34893. return this.buffer.byteLength
  34894. }),
  34895. (a.clear = function () {
  34896. return (this.offset = 0), (this.limit = this.buffer.byteLength), (this.markedOffset = -1), this
  34897. }),
  34898. (a.clone = function (e) {
  34899. var t = new f(0, this.littleEndian, this.noAssert)
  34900. return (
  34901. e ? ((t.buffer = new ArrayBuffer(this.buffer.byteLength)), (t.view = new Uint8Array(t.buffer))) : ((t.buffer = this.buffer), (t.view = this.view)),
  34902. (t.offset = this.offset),
  34903. (t.markedOffset = this.markedOffset),
  34904. (t.limit = this.limit),
  34905. t
  34906. )
  34907. }),
  34908. (a.compact = function (e, t) {
  34909. if ((void 0 === e && (e = this.offset), void 0 === t && (t = this.limit), !this.noAssert)) {
  34910. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal begin: Not an integer')
  34911. if (((e >>>= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal end: Not an integer')
  34912. if (((t >>>= 0), e < 0 || t < e || t > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength)
  34913. }
  34914. if (0 === e && t === this.buffer.byteLength) return this
  34915. var i = t - e
  34916. if (0 == i) return (this.buffer = o), (this.view = null), 0 <= this.markedOffset && (this.markedOffset -= e), (this.offset = 0), (this.limit = 0), this
  34917. var n = new ArrayBuffer(i),
  34918. r = new Uint8Array(n)
  34919. 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
  34920. }),
  34921. (a.copy = function (e, t) {
  34922. if ((void 0 === e && (e = this.offset), void 0 === t && (t = this.limit), !this.noAssert)) {
  34923. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal begin: Not an integer')
  34924. if (((e >>>= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal end: Not an integer')
  34925. if (((t >>>= 0), e < 0 || t < e || t > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength)
  34926. }
  34927. if (e === t) return new f(0, this.littleEndian, this.noAssert)
  34928. var i = t - e,
  34929. n = new f(i, this.littleEndian, this.noAssert)
  34930. return (n.offset = 0), (n.limit = i), 0 <= n.markedOffset && (n.markedOffset -= e), this.copyTo(n, 0, e, t), n
  34931. }),
  34932. (a.copyTo = function (e, t, i, n) {
  34933. var r, o
  34934. if (!this.noAssert && !f.isByteBuffer(e)) throw TypeError('Illegal target: Not a ByteBuffer')
  34935. 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))
  34936. throw RangeError('Illegal target range: 0 <= ' + t + ' <= ' + e.buffer.byteLength)
  34937. if (i < 0 || n > this.buffer.byteLength) throw RangeError('Illegal source range: 0 <= ' + i + ' <= ' + this.buffer.byteLength)
  34938. var a = n - i
  34939. 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)
  34940. }),
  34941. (a.ensureCapacity = function (e) {
  34942. var t = this.buffer.byteLength
  34943. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  34944. }),
  34945. (a.fill = function (e, t, i) {
  34946. var n = void 0 === t
  34947. 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)) {
  34948. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  34949. if (((e |= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal begin: Not an integer')
  34950. if (((t >>>= 0), 'number' != typeof i || i % 1 != 0)) throw TypeError('Illegal end: Not an integer')
  34951. if (((i >>>= 0), t < 0 || i < t || i > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + t + ' <= ' + i + ' <= ' + this.buffer.byteLength)
  34952. }
  34953. if (i <= t) return this
  34954. for (; t < i; ) this.view[t++] = e
  34955. return n && (this.offset = t), this
  34956. }),
  34957. (a.flip = function () {
  34958. return (this.limit = this.offset), (this.offset = 0), this
  34959. }),
  34960. (a.mark = function (e) {
  34961. if (((e = void 0 === e ? this.offset : e), !this.noAssert)) {
  34962. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  34963. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + e + ' (+0) <= ' + this.buffer.byteLength)
  34964. }
  34965. return (this.markedOffset = e), this
  34966. }),
  34967. (a.order = function (e) {
  34968. if (!this.noAssert && 'boolean' != typeof e) throw TypeError('Illegal littleEndian: Not a boolean')
  34969. return (this.littleEndian = !!e), this
  34970. }),
  34971. (a.LE = function (e) {
  34972. return (this.littleEndian = void 0 === e || !!e), this
  34973. }),
  34974. (a.BE = function (e) {
  34975. return (this.littleEndian = void 0 !== e && !e), this
  34976. }),
  34977. (a.prepend = function (e, t, i) {
  34978. ;('number' != typeof t && 'string' == typeof t) || ((i = t), (t = void 0))
  34979. var n = void 0 === i
  34980. if ((n && (i = this.offset), !this.noAssert)) {
  34981. if ('number' != typeof i || i % 1 != 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  34982. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  34983. }
  34984. e instanceof f || (e = f.wrap(e, t))
  34985. var r = e.limit - e.offset
  34986. if (r <= 0) return this
  34987. var o = r - i
  34988. if (0 < o) {
  34989. var a = new ArrayBuffer(this.buffer.byteLength + o),
  34990. s = new Uint8Array(a)
  34991. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  34992. (this.buffer = a),
  34993. (this.view = s),
  34994. (this.offset += o),
  34995. 0 <= this.markedOffset && (this.markedOffset += o),
  34996. (this.limit += o),
  34997. (i += o)
  34998. } else new Uint8Array(this.buffer)
  34999. return this.view.set(e.view.subarray(e.offset, e.limit), i - r), (e.offset = e.limit), n && (this.offset -= r), this
  35000. }),
  35001. (a.prependTo = function (e, t) {
  35002. return e.prepend(this, t), this
  35003. }),
  35004. (a.printDebug = function (e) {
  35005. 'function' != typeof e && (e = console.log.bind(console)), e(this.toString() + '\n-------------------------------------------------------------------\n' + this.toDebug(!0))
  35006. }),
  35007. (a.remaining = function () {
  35008. return this.limit - this.offset
  35009. }),
  35010. (a.reset = function () {
  35011. return 0 <= this.markedOffset ? ((this.offset = this.markedOffset), (this.markedOffset = -1)) : (this.offset = 0), this
  35012. }),
  35013. (a.resize = function (e) {
  35014. if (!this.noAssert) {
  35015. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal capacity: ' + e + ' (not an integer)')
  35016. if ((e |= 0) < 0) throw RangeError('Illegal capacity: 0 <= ' + e)
  35017. }
  35018. if (this.buffer.byteLength < e) {
  35019. var t = new ArrayBuffer(e),
  35020. i = new Uint8Array(t)
  35021. i.set(this.view), (this.buffer = t), (this.view = i)
  35022. }
  35023. return this
  35024. }),
  35025. (a.reverse = function (e, t) {
  35026. if ((void 0 === e && (e = this.offset), void 0 === t && (t = this.limit), !this.noAssert)) {
  35027. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal begin: Not an integer')
  35028. if (((e >>>= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal end: Not an integer')
  35029. if (((t >>>= 0), e < 0 || t < e || t > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength)
  35030. }
  35031. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)), this
  35032. }),
  35033. (a.skip = function (e) {
  35034. if (!this.noAssert) {
  35035. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal length: ' + e + ' (not an integer)')
  35036. e |= 0
  35037. }
  35038. var t = this.offset + e
  35039. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength)) throw RangeError('Illegal length: 0 <= ' + this.offset + ' + ' + e + ' <= ' + this.buffer.byteLength)
  35040. return (this.offset = t), this
  35041. }),
  35042. (a.slice = function (e, t) {
  35043. if ((void 0 === e && (e = this.offset), void 0 === t && (t = this.limit), !this.noAssert)) {
  35044. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal begin: Not an integer')
  35045. if (((e >>>= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal end: Not an integer')
  35046. if (((t >>>= 0), e < 0 || t < e || t > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength)
  35047. }
  35048. var i = this.clone()
  35049. return (i.offset = e), (i.limit = t), i
  35050. }),
  35051. (a.toBuffer = function (e) {
  35052. var t = this.offset,
  35053. i = this.limit
  35054. if (!this.noAssert) {
  35055. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal offset: Not an integer')
  35056. if (((t >>>= 0), 'number' != typeof i || i % 1 != 0)) throw TypeError('Illegal limit: Not an integer')
  35057. if (((i >>>= 0), t < 0 || i < t || i > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + t + ' <= ' + i + ' <= ' + this.buffer.byteLength)
  35058. }
  35059. if (!e && 0 === t && i === this.buffer.byteLength) return this.buffer
  35060. if (t === i) return o
  35061. var n = new ArrayBuffer(i - t)
  35062. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0), n
  35063. }),
  35064. (a.toArrayBuffer = a.toBuffer),
  35065. (a.toString = function (e, t, i) {
  35066. if (void 0 === e) return 'ByteBufferAB(offset=' + this.offset + ',markedOffset=' + this.markedOffset + ',limit=' + this.limit + ',capacity=' + this.capacity() + ')'
  35067. switch (('number' == typeof e && (i = t = e = 'utf8'), e)) {
  35068. case 'utf8':
  35069. return this.toUTF8(t, i)
  35070. case 'base64':
  35071. return this.toBase64(t, i)
  35072. case 'hex':
  35073. return this.toHex(t, i)
  35074. case 'binary':
  35075. return this.toBinary(t, i)
  35076. case 'debug':
  35077. return this.toDebug()
  35078. case 'columns':
  35079. return this.toColumns()
  35080. default:
  35081. throw Error('Unsupported encoding: ' + e)
  35082. }
  35083. })
  35084. var h = (function () {
  35085. for (
  35086. var e = {},
  35087. r = [
  35088. 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,
  35089. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47
  35090. ],
  35091. a = [],
  35092. t = 0,
  35093. i = r.length;
  35094. t < i;
  35095. ++t
  35096. )
  35097. a[r[t]] = t
  35098. return (
  35099. (e.encode = function (e, t) {
  35100. for (var i, n; null !== (i = e()); )
  35101. t(r[(i >> 2) & 63]),
  35102. (n = (3 & i) << 4),
  35103. null !== (i = e())
  35104. ? (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)))
  35105. : (t(r[63 & n]), t(61), t(61))
  35106. }),
  35107. (e.decode = function (e, t) {
  35108. function i(e) {
  35109. throw Error('Illegal character code: ' + e)
  35110. }
  35111. for (var n, r, o; null !== (n = e()); )
  35112. 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())))) {
  35113. if (void 0 === (r = a[n])) {
  35114. if (61 === n) break
  35115. i(n)
  35116. }
  35117. if ((t((((15 & o) << 4) >>> 0) | ((60 & r) >> 2)), null !== (n = e()))) {
  35118. if (void 0 === (o = a[n])) {
  35119. if (61 === n) break
  35120. i(n)
  35121. }
  35122. t((((3 & r) << 6) >>> 0) | o)
  35123. }
  35124. }
  35125. }),
  35126. (e.test = function (e) {
  35127. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  35128. }),
  35129. e
  35130. )
  35131. })()
  35132. ;(a.toBase64 = function (e, t) {
  35133. 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')
  35134. var i
  35135. return (
  35136. h.encode(
  35137. function () {
  35138. return e < t ? this.view[e++] : null
  35139. }.bind(this),
  35140. (i = c())
  35141. ),
  35142. i()
  35143. )
  35144. }),
  35145. (f.fromBase64 = function (e, t) {
  35146. if ('string' != typeof e) throw TypeError('str')
  35147. var i = new f((e.length / 4) * 3, t),
  35148. n = 0
  35149. return (
  35150. h.decode(s(e), function (e) {
  35151. i.view[n++] = e
  35152. }),
  35153. (i.limit = n),
  35154. i
  35155. )
  35156. }),
  35157. (f.btoa = function (e) {
  35158. return f.fromBinary(e).toBase64()
  35159. }),
  35160. (f.atob = function (e) {
  35161. return f.fromBase64(e).toBinary()
  35162. }),
  35163. (a.toBinary = function (e, t) {
  35164. 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')
  35165. if (e === t) return ''
  35166. for (var i = [], n = []; e < t; ) i.push(this.view[e++]), 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)), (i = []))
  35167. return n.join('') + String.fromCharCode.apply(String, i)
  35168. }),
  35169. (f.fromBinary = function (e, t) {
  35170. if ('string' != typeof e) throw TypeError('str')
  35171. for (var i, n = 0, r = e.length, o = new f(r, t); n < r; ) {
  35172. if (255 < (i = e.charCodeAt(n))) throw RangeError('illegal char code: ' + i)
  35173. o.view[n++] = i
  35174. }
  35175. return (o.limit = r), o
  35176. }),
  35177. (a.toDebug = function (e) {
  35178. for (var t, i = -1, n = this.buffer.byteLength, r = '', o = '', a = ''; i < n; ) {
  35179. if (
  35180. (-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) : '.')),
  35181. ++i,
  35182. e && 0 < i && i % 16 == 0 && i !== n)
  35183. ) {
  35184. for (; r.length < 51; ) r += ' '
  35185. ;(a += r + o + '\n'), (r = o = '')
  35186. }
  35187. r +=
  35188. i === this.offset && i === this.limit
  35189. ? i === this.markedOffset
  35190. ? '!'
  35191. : '|'
  35192. : i === this.offset
  35193. ? i === this.markedOffset
  35194. ? '['
  35195. : '<'
  35196. : i === this.limit
  35197. ? i === this.markedOffset
  35198. ? ']'
  35199. : '>'
  35200. : i === this.markedOffset
  35201. ? "'"
  35202. : e || (0 !== i && i !== n)
  35203. ? ' '
  35204. : ''
  35205. }
  35206. if (e && ' ' !== r) {
  35207. for (; r.length < 51; ) r += ' '
  35208. a += r + o + '\n'
  35209. }
  35210. return e ? a : r
  35211. }),
  35212. (f.fromDebug = function (e, t, i) {
  35213. 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; ) {
  35214. switch ((n = e.charAt(s++))) {
  35215. case '!':
  35216. if (!i) {
  35217. if (h || u || d) {
  35218. p = !0
  35219. break
  35220. }
  35221. h = u = d = !0
  35222. }
  35223. ;(a.offset = a.markedOffset = a.limit = l), (c = !1)
  35224. break
  35225. case '|':
  35226. if (!i) {
  35227. if (h || d) {
  35228. p = !0
  35229. break
  35230. }
  35231. h = d = !0
  35232. }
  35233. ;(a.offset = a.limit = l), (c = !1)
  35234. break
  35235. case '[':
  35236. if (!i) {
  35237. if (h || u) {
  35238. p = !0
  35239. break
  35240. }
  35241. h = u = !0
  35242. }
  35243. ;(a.offset = a.markedOffset = l), (c = !1)
  35244. break
  35245. case '<':
  35246. if (!i) {
  35247. if (h) {
  35248. p = !0
  35249. break
  35250. }
  35251. h = !0
  35252. }
  35253. ;(a.offset = l), (c = !1)
  35254. break
  35255. case ']':
  35256. if (!i) {
  35257. if (d || u) {
  35258. p = !0
  35259. break
  35260. }
  35261. d = u = !0
  35262. }
  35263. ;(a.limit = a.markedOffset = l), (c = !1)
  35264. break
  35265. case '>':
  35266. if (!i) {
  35267. if (d) {
  35268. p = !0
  35269. break
  35270. }
  35271. d = !0
  35272. }
  35273. ;(a.limit = l), (c = !1)
  35274. break
  35275. case "'":
  35276. if (!i) {
  35277. if (u) {
  35278. p = !0
  35279. break
  35280. }
  35281. u = !0
  35282. }
  35283. ;(a.markedOffset = l), (c = !1)
  35284. break
  35285. case ' ':
  35286. c = !1
  35287. break
  35288. default:
  35289. if (!i && c) {
  35290. p = !0
  35291. break
  35292. }
  35293. if (((r = parseInt(n + e.charAt(s++), 16)), !i && (isNaN(r) || r < 0 || 255 < r))) throw TypeError('Illegal str: Not a debug encoded string')
  35294. ;(a.view[l++] = r), (c = !0)
  35295. }
  35296. if (p) throw TypeError('Illegal str: Invalid symbol at ' + s)
  35297. }
  35298. if (!i) {
  35299. if (!h || !d) throw TypeError('Illegal str: Missing offset or limit')
  35300. if (l < a.buffer.byteLength) throw TypeError('Illegal str: Not a debug encoded string (is it hex?) ' + l + ' < ' + o)
  35301. }
  35302. return a
  35303. }),
  35304. (a.toHex = function (e, t) {
  35305. if (((e = void 0 === e ? this.offset : e), (t = void 0 === t ? this.limit : t), !this.noAssert)) {
  35306. if ('number' != typeof e || e % 1 != 0) throw TypeError('Illegal begin: Not an integer')
  35307. if (((e >>>= 0), 'number' != typeof t || t % 1 != 0)) throw TypeError('Illegal end: Not an integer')
  35308. if (((t >>>= 0), e < 0 || t < e || t > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength)
  35309. }
  35310. 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))
  35311. return n.join('')
  35312. }),
  35313. (f.fromHex = function (e, t, i) {
  35314. if (!i) {
  35315. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  35316. if (e.length % 2 != 0) throw TypeError('Illegal str: Length not a multiple of 2')
  35317. }
  35318. for (var n, r = e.length, o = new f((r / 2) | 0, t), a = 0, s = 0; a < r; a += 2) {
  35319. if (((n = parseInt(e.substring(a, a + 2), 16)), !i && (!isFinite(n) || n < 0 || 255 < n))) throw TypeError('Illegal str: Contains non-hex characters')
  35320. o.view[s++] = n
  35321. }
  35322. return (o.limit = s), o
  35323. })
  35324. var u,
  35325. d = (u = {
  35326. MAX_CODEPOINT: 1114111,
  35327. encodeUTF8: function (e, t) {
  35328. var i = null
  35329. for (
  35330. 'number' == typeof e &&
  35331. ((i = e),
  35332. (e = function () {
  35333. return null
  35334. }));
  35335. null !== i || null !== (i = e());
  35336. )
  35337. i < 128
  35338. ? t(127 & i)
  35339. : (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)),
  35340. t((63 & i) | 128)),
  35341. (i = null)
  35342. },
  35343. decodeUTF8: function (e, t) {
  35344. for (
  35345. var i,
  35346. n,
  35347. r,
  35348. o,
  35349. a = function (e) {
  35350. e = e.slice(0, e.indexOf(null))
  35351. var t = Error(e.toString())
  35352. throw ((t.name = 'TruncatedError'), (t.bytes = e), t)
  35353. };
  35354. null !== (i = e());
  35355. )
  35356. if (0 == (128 & i)) t(i)
  35357. else if (192 == (224 & i)) null === (n = e()) && a([i, n]), t(((31 & i) << 6) | (63 & n))
  35358. else if (224 == (240 & i)) (null !== (n = e()) && null !== (r = e())) || a([i, n, r]), t(((15 & i) << 12) | ((63 & n) << 6) | (63 & r))
  35359. else {
  35360. if (240 != (248 & i)) throw RangeError('Illegal starting byte: ' + i)
  35361. ;(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))
  35362. }
  35363. },
  35364. UTF16toUTF8: function (e, t) {
  35365. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  35366. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536), (n = null)) : t(i)
  35367. null !== n && t(n)
  35368. },
  35369. UTF8toUTF16: function (e, t) {
  35370. var i = null
  35371. for (
  35372. 'number' == typeof e &&
  35373. ((i = e),
  35374. (e = function () {
  35375. return null
  35376. }));
  35377. null !== i || null !== (i = e());
  35378. )
  35379. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)), t((i % 1024) + 56320)), (i = null)
  35380. },
  35381. encodeUTF16toUTF8: function (e, t) {
  35382. u.UTF16toUTF8(e, function (e) {
  35383. u.encodeUTF8(e, t)
  35384. })
  35385. },
  35386. decodeUTF8toUTF16: function (e, t) {
  35387. u.decodeUTF8(e, function (e) {
  35388. u.UTF8toUTF16(e, t)
  35389. })
  35390. },
  35391. calculateCodePoint: function (e) {
  35392. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  35393. },
  35394. calculateUTF8: function (e) {
  35395. for (var t, i = 0; null !== (t = e()); ) i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4
  35396. return i
  35397. },
  35398. calculateUTF16asUTF8: function (e) {
  35399. var t = 0,
  35400. i = 0
  35401. return (
  35402. u.UTF16toUTF8(e, function (e) {
  35403. ++t, (i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4)
  35404. }),
  35405. [t, i]
  35406. )
  35407. }
  35408. })
  35409. return (
  35410. (a.toUTF8 = function (t, i) {
  35411. if ((void 0 === t && (t = this.offset), void 0 === i && (i = this.limit), !this.noAssert)) {
  35412. if ('number' != typeof t || t % 1 != 0) throw TypeError('Illegal begin: Not an integer')
  35413. if (((t >>>= 0), 'number' != typeof i || i % 1 != 0)) throw TypeError('Illegal end: Not an integer')
  35414. if (((i >>>= 0), t < 0 || i < t || i > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + t + ' <= ' + i + ' <= ' + this.buffer.byteLength)
  35415. }
  35416. var e
  35417. try {
  35418. d.decodeUTF8toUTF16(
  35419. function () {
  35420. return t < i ? this.view[t++] : null
  35421. }.bind(this),
  35422. (e = c())
  35423. )
  35424. } catch (e) {
  35425. if (t !== i) throw RangeError('Illegal range: Truncated data, ' + t + ' != ' + i)
  35426. }
  35427. return e()
  35428. }),
  35429. (f.fromUTF8 = function (e, t, i) {
  35430. if (!i && 'string' != typeof e) throw TypeError('Illegal str: Not a string')
  35431. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1], t, i),
  35432. r = 0
  35433. return (
  35434. d.encodeUTF16toUTF8(s(e), function (e) {
  35435. n.view[r++] = e
  35436. }),
  35437. (n.limit = r),
  35438. n
  35439. )
  35440. }),
  35441. f
  35442. )
  35443. }),
  35444. 'function' == typeof define && define.amd
  35445. ? define(['long'], r)
  35446. : 'function' == typeof t && 'object' == typeof e && e && e.exports
  35447. ? (e.exports = (function () {
  35448. var e
  35449. try {
  35450. e = t('long')
  35451. } catch (e) {}
  35452. return r(e)
  35453. })())
  35454. : ((n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long))
  35455. },
  35456. {
  35457. long: 216
  35458. }
  35459. ],
  35460. 216: [
  35461. function (e, t, i) {
  35462. var n, r
  35463. ;(n = this),
  35464. (r = function () {
  35465. 'use strict'
  35466. function n(e, t, i) {
  35467. ;(this.low = 0 | e), (this.high = 0 | t), (this.unsigned = !!i)
  35468. }
  35469. function p(e) {
  35470. return !0 === (e && e.__isLong__)
  35471. }
  35472. function e(e, t) {
  35473. var i, n, r
  35474. return t
  35475. ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e])
  35476. ? n
  35477. : ((i = g(e, (0 | e) < 0 ? -1 : 0, !0)), r && (a[e] = i), i)
  35478. : (r = -128 <= (e |= 0) && e < 128) && (n = o[e])
  35479. ? n
  35480. : ((i = g(e, e < 0 ? -1 : 0, !1)), r && (o[e] = i), i)
  35481. }
  35482. function f(e, t) {
  35483. if (isNaN(e) || !isFinite(e)) return t ? l : y
  35484. if (t) {
  35485. if (e < 0) return l
  35486. if (r <= e) return I
  35487. } else {
  35488. if (e <= -s) return E
  35489. if (s <= e + 1) return C
  35490. }
  35491. return e < 0 ? f(-e, t).neg() : g(e % i | 0, (e / i) | 0, t)
  35492. }
  35493. function g(e, t, i) {
  35494. return new n(e, t, i)
  35495. }
  35496. function h(e, t, i) {
  35497. if (0 === e.length) throw Error('empty string')
  35498. if ('NaN' === e || 'Infinity' === e || '+Infinity' === e || '-Infinity' === e) return y
  35499. if (((t = 'number' == typeof t ? ((i = t), !1) : !!t), (i = i || 10) < 2 || 36 < i)) throw RangeError('radix')
  35500. var n
  35501. if (0 < (n = e.indexOf('-'))) throw Error('interior hyphen')
  35502. if (0 === n) return h(e.substring(1), t, i).neg()
  35503. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  35504. var s = Math.min(8, e.length - a),
  35505. l = parseInt(e.substring(a, a + s), i)
  35506. if (s < 8) {
  35507. var c = f(u(i, s))
  35508. o = o.mul(c).add(f(l))
  35509. } else o = (o = o.mul(r)).add(f(l))
  35510. }
  35511. return (o.unsigned = t), o
  35512. }
  35513. function m(e) {
  35514. return e instanceof n ? e : 'number' == typeof e ? f(e) : 'string' == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  35515. }
  35516. Object.defineProperty(n.prototype, '__isLong__', {
  35517. value: !0,
  35518. enumerable: !1,
  35519. configurable: !1
  35520. }),
  35521. (n.isLong = p)
  35522. var o = {},
  35523. a = {}
  35524. ;(n.fromInt = e), (n.fromNumber = f), (n.fromBits = g)
  35525. var u = Math.pow
  35526. ;(n.fromString = h), (n.fromValue = m)
  35527. var i = 4294967296,
  35528. r = 0x10000000000000000,
  35529. s = r / 2,
  35530. v = e(1 << 24),
  35531. y = e(0)
  35532. n.ZERO = y
  35533. var l = e(0, !0)
  35534. n.UZERO = l
  35535. var c = e(1)
  35536. n.ONE = c
  35537. var d = e(1, !0)
  35538. n.UONE = d
  35539. var A = e(-1)
  35540. n.NEG_ONE = A
  35541. var C = g(-1, 2147483647, !1)
  35542. n.MAX_VALUE = C
  35543. var I = g(-1, -1, !0)
  35544. n.MAX_UNSIGNED_VALUE = I
  35545. var E = g(0, -2147483648, !1)
  35546. n.MIN_VALUE = E
  35547. var t = n.prototype
  35548. return (
  35549. (t.toInt = function () {
  35550. return this.unsigned ? this.low >>> 0 : this.low
  35551. }),
  35552. (t.toNumber = function () {
  35553. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  35554. }),
  35555. (t.toString = function (e) {
  35556. if ((e = e || 10) < 2 || 36 < e) throw RangeError('radix')
  35557. if (this.isZero()) return '0'
  35558. if (this.isNegative()) {
  35559. if (this.eq(E)) {
  35560. var t = f(e),
  35561. i = this.div(t),
  35562. n = i.mul(t).sub(this)
  35563. return i.toString(e) + n.toInt().toString(e)
  35564. }
  35565. return '-' + this.neg().toString(e)
  35566. }
  35567. for (var r = f(u(e, 6), this.unsigned), o = this, a = ''; ; ) {
  35568. var s = o.div(r),
  35569. l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e)
  35570. if ((o = s).isZero()) return l + a
  35571. for (; l.length < 6; ) l = '0' + l
  35572. a = '' + l + a
  35573. }
  35574. }),
  35575. (t.getHighBits = function () {
  35576. return this.high
  35577. }),
  35578. (t.getHighBitsUnsigned = function () {
  35579. return this.high >>> 0
  35580. }),
  35581. (t.getLowBits = function () {
  35582. return this.low
  35583. }),
  35584. (t.getLowBitsUnsigned = function () {
  35585. return this.low >>> 0
  35586. }),
  35587. (t.getNumBitsAbs = function () {
  35588. if (this.isNegative()) return this.eq(E) ? 64 : this.neg().getNumBitsAbs()
  35589. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & (1 << t)); t--);
  35590. return 0 != this.high ? t + 33 : t + 1
  35591. }),
  35592. (t.isZero = function () {
  35593. return 0 === this.high && 0 === this.low
  35594. }),
  35595. (t.isNegative = function () {
  35596. return !this.unsigned && this.high < 0
  35597. }),
  35598. (t.isPositive = function () {
  35599. return this.unsigned || 0 <= this.high
  35600. }),
  35601. (t.isOdd = function () {
  35602. return 1 == (1 & this.low)
  35603. }),
  35604. (t.isEven = function () {
  35605. return 0 == (1 & this.low)
  35606. }),
  35607. (t.equals = function (e) {
  35608. 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
  35609. }),
  35610. (t.eq = t.equals),
  35611. (t.notEquals = function (e) {
  35612. return !this.eq(e)
  35613. }),
  35614. (t.neq = t.notEquals),
  35615. (t.lessThan = function (e) {
  35616. return this.comp(e) < 0
  35617. }),
  35618. (t.lt = t.lessThan),
  35619. (t.lessThanOrEqual = function (e) {
  35620. return this.comp(e) <= 0
  35621. }),
  35622. (t.lte = t.lessThanOrEqual),
  35623. (t.greaterThan = function (e) {
  35624. return 0 < this.comp(e)
  35625. }),
  35626. (t.gt = t.greaterThan),
  35627. (t.greaterThanOrEqual = function (e) {
  35628. return 0 <= this.comp(e)
  35629. }),
  35630. (t.gte = t.greaterThanOrEqual),
  35631. (t.compare = function (e) {
  35632. if ((p(e) || (e = m(e)), this.eq(e))) return 0
  35633. var t = this.isNegative(),
  35634. i = e.isNegative()
  35635. return t && !i
  35636. ? -1
  35637. : !t && i
  35638. ? 1
  35639. : this.unsigned
  35640. ? e.high >>> 0 > this.high >>> 0 || (e.high === this.high && e.low >>> 0 > this.low >>> 0)
  35641. ? -1
  35642. : 1
  35643. : this.sub(e).isNegative()
  35644. ? -1
  35645. : 1
  35646. }),
  35647. (t.comp = t.compare),
  35648. (t.negate = function () {
  35649. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  35650. }),
  35651. (t.neg = t.negate),
  35652. (t.add = function (e) {
  35653. p(e) || (e = m(e))
  35654. var t = this.high >>> 16,
  35655. i = 65535 & this.high,
  35656. n = this.low >>> 16,
  35657. r = 65535 & this.low,
  35658. o = e.high >>> 16,
  35659. a = 65535 & e.high,
  35660. s = e.low >>> 16,
  35661. l = 0,
  35662. c = 0,
  35663. h = 0,
  35664. u = 0
  35665. return (
  35666. (h += (u += r + (65535 & e.low)) >>> 16),
  35667. (c += (h += n + s) >>> 16),
  35668. (l += (c += i + a) >>> 16),
  35669. (l += t + o),
  35670. g(((h &= 65535) << 16) | (u &= 65535), ((l &= 65535) << 16) | (c &= 65535), this.unsigned)
  35671. )
  35672. }),
  35673. (t.subtract = function (e) {
  35674. return p(e) || (e = m(e)), this.add(e.neg())
  35675. }),
  35676. (t.sub = t.subtract),
  35677. (t.multiply = function (e) {
  35678. if (this.isZero()) return y
  35679. if ((p(e) || (e = m(e)), e.isZero())) return y
  35680. if (this.eq(E)) return e.isOdd() ? E : y
  35681. if (e.eq(E)) return this.isOdd() ? E : y
  35682. if (this.isNegative()) return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg()
  35683. if (e.isNegative()) return this.mul(e.neg()).neg()
  35684. if (this.lt(v) && e.lt(v)) return f(this.toNumber() * e.toNumber(), this.unsigned)
  35685. var t = this.high >>> 16,
  35686. i = 65535 & this.high,
  35687. n = this.low >>> 16,
  35688. r = 65535 & this.low,
  35689. o = e.high >>> 16,
  35690. a = 65535 & e.high,
  35691. s = e.low >>> 16,
  35692. l = 65535 & e.low,
  35693. c = 0,
  35694. h = 0,
  35695. u = 0,
  35696. d = 0
  35697. return (
  35698. (u += (d += r * l) >>> 16),
  35699. (h += (u += n * l) >>> 16),
  35700. (u &= 65535),
  35701. (h += (u += r * s) >>> 16),
  35702. (c += (h += i * l) >>> 16),
  35703. (h &= 65535),
  35704. (c += (h += n * s) >>> 16),
  35705. (h &= 65535),
  35706. (c += (h += r * a) >>> 16),
  35707. (c += t * l + i * s + n * a + r * o),
  35708. g(((u &= 65535) << 16) | (d &= 65535), ((c &= 65535) << 16) | (h &= 65535), this.unsigned)
  35709. )
  35710. }),
  35711. (t.mul = t.multiply),
  35712. (t.divide = function (e) {
  35713. if ((p(e) || (e = m(e)), e.isZero())) throw Error('division by zero')
  35714. if (this.isZero()) return this.unsigned ? l : y
  35715. var t, i, n
  35716. if (this.unsigned) {
  35717. if ((e.unsigned || (e = e.toUnsigned()), e.gt(this))) return l
  35718. if (e.gt(this.shru(1))) return d
  35719. n = l
  35720. } else {
  35721. 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))))
  35722. if (e.eq(E)) return this.unsigned ? l : y
  35723. if (this.isNegative()) return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg()
  35724. if (e.isNegative()) return this.div(e.neg()).neg()
  35725. n = y
  35726. }
  35727. for (i = this; i.gte(e); ) {
  35728. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()))
  35729. 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)
  35730. a.isZero() && (a = c), (n = n.add(a)), (i = i.sub(s))
  35731. }
  35732. return n
  35733. }),
  35734. (t.div = t.divide),
  35735. (t.modulo = function (e) {
  35736. return p(e) || (e = m(e)), this.sub(this.div(e).mul(e))
  35737. }),
  35738. (t.mod = t.modulo),
  35739. (t.not = function () {
  35740. return g(~this.low, ~this.high, this.unsigned)
  35741. }),
  35742. (t.and = function (e) {
  35743. return p(e) || (e = m(e)), g(this.low & e.low, this.high & e.high, this.unsigned)
  35744. }),
  35745. (t.or = function (e) {
  35746. return p(e) || (e = m(e)), g(this.low | e.low, this.high | e.high, this.unsigned)
  35747. }),
  35748. (t.xor = function (e) {
  35749. return p(e) || (e = m(e)), g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  35750. }),
  35751. (t.shiftLeft = function (e) {
  35752. return (
  35753. 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)
  35754. )
  35755. }),
  35756. (t.shl = t.shiftLeft),
  35757. (t.shiftRight = function (e) {
  35758. return (
  35759. p(e) && (e = e.toInt()),
  35760. 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)
  35761. )
  35762. }),
  35763. (t.shr = t.shiftRight),
  35764. (t.shiftRightUnsigned = function (e) {
  35765. if ((p(e) && (e = e.toInt()), 0 === (e &= 63))) return this
  35766. var t = this.high
  35767. return e < 32 ? g((this.low >>> e) | (t << (32 - e)), t >>> e, this.unsigned) : g(32 === e ? t : t >>> (e - 32), 0, this.unsigned)
  35768. }),
  35769. (t.shru = t.shiftRightUnsigned),
  35770. (t.toSigned = function () {
  35771. return this.unsigned ? g(this.low, this.high, !1) : this
  35772. }),
  35773. (t.toUnsigned = function () {
  35774. return this.unsigned ? this : g(this.low, this.high, !0)
  35775. }),
  35776. (t.toBytes = function (e) {
  35777. return e ? this.toBytesLE() : this.toBytesBE()
  35778. }),
  35779. (t.toBytesLE = function () {
  35780. var e = this.high,
  35781. t = this.low
  35782. return [255 & t, (t >>> 8) & 255, (t >>> 16) & 255, (t >>> 24) & 255, 255 & e, (e >>> 8) & 255, (e >>> 16) & 255, (e >>> 24) & 255]
  35783. }),
  35784. (t.toBytesBE = function () {
  35785. var e = this.high,
  35786. t = this.low
  35787. return [(e >>> 24) & 255, (e >>> 16) & 255, (e >>> 8) & 255, 255 & e, (t >>> 24) & 255, (t >>> 16) & 255, (t >>> 8) & 255, 255 & t]
  35788. }),
  35789. n
  35790. )
  35791. }),
  35792. 'function' == typeof define && define.amd
  35793. ? define([], r)
  35794. : 'function' == typeof e && 'object' == typeof t && t && t.exports
  35795. ? (t.exports = r())
  35796. : ((n.dcodeIO = n.dcodeIO || {}).Long = r())
  35797. },
  35798. {}
  35799. ],
  35800. 217: [
  35801. function (e, t, i) {
  35802. var n,
  35803. r,
  35804. o,
  35805. a,
  35806. s,
  35807. l,
  35808. c,
  35809. h,
  35810. u,
  35811. d,
  35812. p,
  35813. f,
  35814. g,
  35815. m,
  35816. v,
  35817. y,
  35818. A,
  35819. C,
  35820. I,
  35821. E,
  35822. _,
  35823. b,
  35824. w,
  35825. T,
  35826. x,
  35827. S,
  35828. M,
  35829. R,
  35830. P,
  35831. O,
  35832. L,
  35833. D,
  35834. N,
  35835. F,
  35836. B,
  35837. V,
  35838. k,
  35839. U,
  35840. H,
  35841. z,
  35842. G,
  35843. W,
  35844. j,
  35845. Y,
  35846. q,
  35847. X,
  35848. Z,
  35849. K,
  35850. Q,
  35851. J,
  35852. $,
  35853. ee,
  35854. te,
  35855. ie,
  35856. ne,
  35857. re,
  35858. oe,
  35859. ae,
  35860. se,
  35861. le,
  35862. ce,
  35863. he,
  35864. ue,
  35865. de,
  35866. pe,
  35867. fe,
  35868. ge,
  35869. me,
  35870. ve,
  35871. ye,
  35872. Ae,
  35873. Ce,
  35874. Ie,
  35875. Ee,
  35876. _e,
  35877. be,
  35878. we,
  35879. Te,
  35880. xe,
  35881. Se,
  35882. Me,
  35883. Re,
  35884. Pe,
  35885. Oe,
  35886. Le,
  35887. De,
  35888. Ne,
  35889. Fe,
  35890. Be,
  35891. Ve,
  35892. ke,
  35893. Ue,
  35894. He,
  35895. ze,
  35896. Ge,
  35897. We,
  35898. je,
  35899. Ye,
  35900. qe,
  35901. Xe,
  35902. Ze,
  35903. Ke,
  35904. Qe,
  35905. Je,
  35906. $e,
  35907. et,
  35908. tt,
  35909. it,
  35910. nt,
  35911. rt,
  35912. ot,
  35913. at,
  35914. st,
  35915. lt,
  35916. ct,
  35917. ht,
  35918. ut,
  35919. dt,
  35920. pt,
  35921. ft,
  35922. gt,
  35923. mt,
  35924. vt,
  35925. yt,
  35926. At,
  35927. Ct,
  35928. It,
  35929. Et,
  35930. _t,
  35931. bt,
  35932. wt,
  35933. Tt,
  35934. xt,
  35935. St,
  35936. Mt,
  35937. Rt,
  35938. Pt,
  35939. Ot,
  35940. Lt,
  35941. Dt,
  35942. Nt,
  35943. Ft,
  35944. Bt,
  35945. Vt,
  35946. kt,
  35947. Ut,
  35948. Ht,
  35949. zt,
  35950. Gt,
  35951. Wt,
  35952. jt,
  35953. Yt,
  35954. qt,
  35955. Xt,
  35956. Zt,
  35957. Kt,
  35958. Qt,
  35959. Jt,
  35960. $t,
  35961. ei,
  35962. ti,
  35963. ii,
  35964. ni,
  35965. ri,
  35966. oi,
  35967. ai,
  35968. si,
  35969. li,
  35970. ci,
  35971. hi,
  35972. ui,
  35973. di,
  35974. pi,
  35975. fi,
  35976. gi,
  35977. mi,
  35978. vi,
  35979. yi,
  35980. Ai,
  35981. Ci = {
  35982. REVISION: '75'
  35983. }
  35984. function Ii(e, t) {
  35985. return e.distance - t.distance
  35986. }
  35987. function Ei(e, t, i, n) {
  35988. 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)
  35989. }
  35990. function _i(e, t, i) {
  35991. 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
  35992. }
  35993. function bi(e, t, i, n, r, o, a) {
  35994. 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()
  35995. }
  35996. function wi(e, t, i, n, r, o, a) {
  35997. var s = e.material
  35998. 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
  35999. Ut.copy(a), Ut.applyMatrix4(e.matrixWorld)
  36000. var l = t.ray.origin.distanceTo(Ut)
  36001. return l < t.near || l > t.far
  36002. ? null
  36003. : {
  36004. distance: l,
  36005. point: Ut.clone(),
  36006. object: e
  36007. }
  36008. }
  36009. function Ti(e, t, i, n, r, o, a, s) {
  36010. Mt.fromArray(n, 3 * o), Rt.fromArray(n, 3 * a), Pt.fromArray(n, 3 * s)
  36011. var l = wi(e, t, i, Mt, Rt, Pt, kt)
  36012. return (
  36013. l &&
  36014. (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))),
  36015. (l.face = new Ci.Face3(o, a, s, Ci.Triangle.normal(Mt, Rt, Pt))),
  36016. (l.faceIndex = o)),
  36017. l
  36018. )
  36019. }
  36020. function xi() {}
  36021. function Si(e, t, i, n, r, o) {
  36022. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E
  36023. 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
  36024. for (g = u - c, m = d - h, v = s - u, y = l - d, A = c - s, C = h - l, a = 0; a < r; a++)
  36025. if (
  36026. ((p = e[o[a]].x),
  36027. (f = e[o[a]].y),
  36028. !((p === s && f === l) || (p === c && f === h) || (p === u && f === d)) &&
  36029. ((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))
  36030. )
  36031. return !1
  36032. return !0
  36033. }
  36034. function Mi(e) {
  36035. switch (e) {
  36036. case Ci.LinearEncoding:
  36037. return ['Linear', '( value )']
  36038. case Ci.sRGBEncoding:
  36039. return ['sRGB', '( value )']
  36040. case Ci.RGBEEncoding:
  36041. return ['RGBE', '( value )']
  36042. case Ci.RGBM7Encoding:
  36043. return ['RGBM', '( value, 7.0 )']
  36044. case Ci.RGBM16Encoding:
  36045. return ['RGBM', '( value, 16.0 )']
  36046. case Ci.RGBDEncoding:
  36047. return ['RGBD', '( value, 256.0 )']
  36048. case Ci.GammaEncoding:
  36049. return ['Gamma', '( value, float( GAMMA_FACTOR ) )']
  36050. default:
  36051. throw new Error('unsupported encoding: ' + e)
  36052. }
  36053. }
  36054. function Ri(e, t) {
  36055. var i = Mi(t)
  36056. return 'vec4 ' + e + '( vec4 value ) { return ' + i[0] + 'ToLinear' + i[1] + '; }'
  36057. }
  36058. function Pi(e) {
  36059. return '' !== e
  36060. }
  36061. function Oi(e, t) {
  36062. return e
  36063. .replace(/NUM_DIR_LIGHTS/g, t.numDirLights)
  36064. .replace(/NUM_SPOT_LIGHTS/g, t.numSpotLights)
  36065. .replace(/NUM_POINT_LIGHTS/g, t.numPointLights)
  36066. .replace(/NUM_HEMI_LIGHTS/g, t.numHemiLights)
  36067. }
  36068. function Li(e) {
  36069. return e.replace(/#include +<([\w\d.]+)>/g, function (e, t) {
  36070. var i = Ci.ShaderChunk[t]
  36071. if (void 0 === i) throw new Error('Can not resolve #include <' + t + '>')
  36072. return Li(i)
  36073. })
  36074. }
  36075. function Di(e) {
  36076. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function (e, t, i, n) {
  36077. for (var r = '', o = parseInt(t); o < parseInt(i); o++) r += n.replace(/\[ i \]/g, '[ ' + o + ' ]')
  36078. return r
  36079. })
  36080. }
  36081. function Ni(e, t, i, n) {
  36082. gi.set(t, i, n).unproject(mi)
  36083. var r = fi[e]
  36084. if (void 0 !== r) for (var o = 0, a = r.length; o < a; o++) pi.vertices[r[o]].copy(gi)
  36085. }
  36086. 'function' == typeof define && define.amd ? define('three', Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  36087. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  36088. void 0 === Math.sign &&
  36089. (Math.sign = function (e) {
  36090. return e < 0 ? -1 : 0 < e ? 1 : +e
  36091. }),
  36092. void 0 === Function.prototype.name &&
  36093. void 0 !== Object.defineProperty &&
  36094. Object.defineProperty(Function.prototype, 'name', {
  36095. get: function () {
  36096. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  36097. }
  36098. }),
  36099. void 0 === Object.assign &&
  36100. Object.defineProperty(Object, 'assign', {
  36101. writable: !0,
  36102. configurable: !0,
  36103. value: function (e) {
  36104. 'use strict'
  36105. if (null == e) throw new TypeError('Cannot convert first argument to object')
  36106. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  36107. var r = arguments[i]
  36108. if (null != r) {
  36109. r = Object(r)
  36110. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  36111. var l = o[a],
  36112. c = Object.getOwnPropertyDescriptor(r, l)
  36113. void 0 !== c && c.enumerable && (t[l] = r[l])
  36114. }
  36115. }
  36116. }
  36117. return t
  36118. }
  36119. }),
  36120. (Ci.MOUSE = {
  36121. LEFT: 0,
  36122. MIDDLE: 1,
  36123. RIGHT: 2
  36124. }),
  36125. (Ci.CullFaceNone = 0),
  36126. (Ci.CullFaceBack = 1),
  36127. (Ci.CullFaceFront = 2),
  36128. (Ci.CullFaceFrontBack = 3),
  36129. (Ci.FrontFaceDirectionCW = 0),
  36130. (Ci.FrontFaceDirectionCCW = 1),
  36131. (Ci.BasicShadowMap = 0),
  36132. (Ci.PCFShadowMap = 1),
  36133. (Ci.PCFSoftShadowMap = 2),
  36134. (Ci.FrontSide = 0),
  36135. (Ci.BackSide = 1),
  36136. (Ci.DoubleSide = 2),
  36137. (Ci.FlatShading = 1),
  36138. (Ci.SmoothShading = 2),
  36139. (Ci.NoColors = 0),
  36140. (Ci.FaceColors = 1),
  36141. (Ci.VertexColors = 2),
  36142. (Ci.NoBlending = 0),
  36143. (Ci.NormalBlending = 1),
  36144. (Ci.AdditiveBlending = 2),
  36145. (Ci.SubtractiveBlending = 3),
  36146. (Ci.MultiplyBlending = 4),
  36147. (Ci.CustomBlending = 5),
  36148. (Ci.AddEquation = 100),
  36149. (Ci.SubtractEquation = 101),
  36150. (Ci.ReverseSubtractEquation = 102),
  36151. (Ci.MinEquation = 103),
  36152. (Ci.MaxEquation = 104),
  36153. (Ci.ZeroFactor = 200),
  36154. (Ci.OneFactor = 201),
  36155. (Ci.SrcColorFactor = 202),
  36156. (Ci.OneMinusSrcColorFactor = 203),
  36157. (Ci.SrcAlphaFactor = 204),
  36158. (Ci.OneMinusSrcAlphaFactor = 205),
  36159. (Ci.DstAlphaFactor = 206),
  36160. (Ci.OneMinusDstAlphaFactor = 207),
  36161. (Ci.DstColorFactor = 208),
  36162. (Ci.OneMinusDstColorFactor = 209),
  36163. (Ci.SrcAlphaSaturateFactor = 210),
  36164. (Ci.NeverDepth = 0),
  36165. (Ci.AlwaysDepth = 1),
  36166. (Ci.LessDepth = 2),
  36167. (Ci.LessEqualDepth = 3),
  36168. (Ci.EqualDepth = 4),
  36169. (Ci.GreaterEqualDepth = 5),
  36170. (Ci.GreaterDepth = 6),
  36171. (Ci.NotEqualDepth = 7),
  36172. (Ci.MultiplyOperation = 0),
  36173. (Ci.MixOperation = 1),
  36174. (Ci.AddOperation = 2),
  36175. (Ci.NoToneMapping = 0),
  36176. (Ci.LinearToneMapping = 1),
  36177. (Ci.ReinhardToneMapping = 2),
  36178. (Ci.Uncharted2ToneMapping = 3),
  36179. (Ci.CineonToneMapping = 4),
  36180. (Ci.UVMapping = 300),
  36181. (Ci.CubeReflectionMapping = 301),
  36182. (Ci.CubeRefractionMapping = 302),
  36183. (Ci.EquirectangularReflectionMapping = 303),
  36184. (Ci.EquirectangularRefractionMapping = 304),
  36185. (Ci.SphericalReflectionMapping = 305),
  36186. (Ci.CubeUVReflectionMapping = 306),
  36187. (Ci.CubeUVRefractionMapping = 307),
  36188. (Ci.RepeatWrapping = 1e3),
  36189. (Ci.ClampToEdgeWrapping = 1001),
  36190. (Ci.MirroredRepeatWrapping = 1002),
  36191. (Ci.NearestFilter = 1003),
  36192. (Ci.NearestMipMapNearestFilter = 1004),
  36193. (Ci.NearestMipMapLinearFilter = 1005),
  36194. (Ci.LinearFilter = 1006),
  36195. (Ci.LinearMipMapNearestFilter = 1007),
  36196. (Ci.LinearMipMapLinearFilter = 1008),
  36197. (Ci.UnsignedByteType = 1009),
  36198. (Ci.ByteType = 1010),
  36199. (Ci.ShortType = 1011),
  36200. (Ci.UnsignedShortType = 1012),
  36201. (Ci.IntType = 1013),
  36202. (Ci.UnsignedIntType = 1014),
  36203. (Ci.FloatType = 1015),
  36204. (Ci.HalfFloatType = 1025),
  36205. (Ci.UnsignedShort4444Type = 1016),
  36206. (Ci.UnsignedShort5551Type = 1017),
  36207. (Ci.UnsignedShort565Type = 1018),
  36208. (Ci.AlphaFormat = 1019),
  36209. (Ci.RGBFormat = 1020),
  36210. (Ci.RGBAFormat = 1021),
  36211. (Ci.LuminanceFormat = 1022),
  36212. (Ci.LuminanceAlphaFormat = 1023),
  36213. (Ci.RGBEFormat = Ci.RGBAFormat),
  36214. (Ci.RGB_S3TC_DXT1_Format = 2001),
  36215. (Ci.RGBA_S3TC_DXT1_Format = 2002),
  36216. (Ci.RGBA_S3TC_DXT3_Format = 2003),
  36217. (Ci.RGBA_S3TC_DXT5_Format = 2004),
  36218. (Ci.RGB_PVRTC_4BPPV1_Format = 2100),
  36219. (Ci.RGB_PVRTC_2BPPV1_Format = 2101),
  36220. (Ci.RGBA_PVRTC_4BPPV1_Format = 2102),
  36221. (Ci.RGBA_PVRTC_2BPPV1_Format = 2103),
  36222. (Ci.RGB_ETC1_Format = 2151),
  36223. (Ci.LoopOnce = 2200),
  36224. (Ci.LoopRepeat = 2201),
  36225. (Ci.LoopPingPong = 2202),
  36226. (Ci.InterpolateDiscrete = 2300),
  36227. (Ci.InterpolateLinear = 2301),
  36228. (Ci.InterpolateSmooth = 2302),
  36229. (Ci.ZeroCurvatureEnding = 2400),
  36230. (Ci.ZeroSlopeEnding = 2401),
  36231. (Ci.WrapAroundEnding = 2402),
  36232. (Ci.TrianglesDrawMode = 0),
  36233. (Ci.TriangleStripDrawMode = 1),
  36234. (Ci.TriangleFanDrawMode = 2),
  36235. (Ci.LinearEncoding = 3e3),
  36236. (Ci.sRGBEncoding = 3001),
  36237. (Ci.GammaEncoding = 3007),
  36238. (Ci.RGBEEncoding = 3002),
  36239. (Ci.LogLuvEncoding = 3003),
  36240. (Ci.RGBM7Encoding = 3004),
  36241. (Ci.RGBM16Encoding = 3005),
  36242. (Ci.RGBDEncoding = 3006),
  36243. (Ci.Color = function (e) {
  36244. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  36245. }),
  36246. (Ci.Color.prototype = {
  36247. constructor: Ci.Color,
  36248. r: 1,
  36249. g: 1,
  36250. b: 1,
  36251. set: function (e) {
  36252. return e instanceof Ci.Color ? this.copy(e) : 'number' == typeof e ? this.setHex(e) : 'string' == typeof e && this.setStyle(e), this
  36253. },
  36254. setScalar: function (e) {
  36255. ;(this.r = e), (this.g = e), (this.b = e)
  36256. },
  36257. setHex: function (e) {
  36258. return (e = Math.floor(e)), (this.r = ((e >> 16) & 255) / 255), (this.g = ((e >> 8) & 255) / 255), (this.b = (255 & e) / 255), this
  36259. },
  36260. setRGB: function (e, t, i) {
  36261. return (this.r = e), (this.g = t), (this.b = i), this
  36262. },
  36263. setHSL: function (e, t, i) {
  36264. 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
  36265. else {
  36266. var n = i <= 0.5 ? i * (1 + t) : i + t - i * t,
  36267. r = 2 * i - n
  36268. ;(this.r = _i(r, n, e + 1 / 3)), (this.g = _i(r, n, e)), (this.b = _i(r, n, e - 1 / 3))
  36269. }
  36270. return this
  36271. },
  36272. setStyle: function (t) {
  36273. function e(e) {
  36274. void 0 !== e && parseFloat(e) < 1 && console.warn('THREE.Color: Alpha component of ' + t + ' will be ignored.')
  36275. }
  36276. var i
  36277. if ((i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t))) {
  36278. var n,
  36279. r = i[1],
  36280. o = i[2]
  36281. switch (r) {
  36282. case 'rgb':
  36283. case 'rgba':
  36284. if ((n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)))
  36285. 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
  36286. if ((n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)))
  36287. 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
  36288. break
  36289. case 'hsl':
  36290. case 'hsla':
  36291. if ((n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))) {
  36292. var a = parseFloat(n[1]) / 360,
  36293. s = parseInt(n[2], 10) / 100,
  36294. l = parseInt(n[3], 10) / 100
  36295. return e(n[5]), this.setHSL(a, s, l)
  36296. }
  36297. }
  36298. } else if ((i = /^\#([A-Fa-f0-9]+)$/.exec(t))) {
  36299. var c,
  36300. h = (c = i[1]).length
  36301. if (3 === h)
  36302. return (
  36303. (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
  36304. )
  36305. if (6 === h)
  36306. return (
  36307. (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
  36308. )
  36309. }
  36310. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn('THREE.Color: Unknown color ' + t))
  36311. return this
  36312. },
  36313. clone: function () {
  36314. return new this.constructor(this.r, this.g, this.b)
  36315. },
  36316. copy: function (e) {
  36317. return (this.r = e.r), (this.g = e.g), (this.b = e.b), this
  36318. },
  36319. copyGammaToLinear: function (e, t) {
  36320. 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
  36321. },
  36322. copyLinearToGamma: function (e, t) {
  36323. void 0 === t && (t = 2)
  36324. var i = 0 < t ? 1 / t : 1
  36325. return (this.r = Math.pow(e.r, i)), (this.g = Math.pow(e.g, i)), (this.b = Math.pow(e.b, i)), this
  36326. },
  36327. convertGammaToLinear: function () {
  36328. var e = this.r,
  36329. t = this.g,
  36330. i = this.b
  36331. return (this.r = e * e), (this.g = t * t), (this.b = i * i), this
  36332. },
  36333. convertLinearToGamma: function () {
  36334. return (this.r = Math.sqrt(this.r)), (this.g = Math.sqrt(this.g)), (this.b = Math.sqrt(this.b)), this
  36335. },
  36336. getHex: function () {
  36337. return ((255 * this.r) << 16) ^ ((255 * this.g) << 8) ^ ((255 * this.b) << 0)
  36338. },
  36339. getHexString: function () {
  36340. return ('000000' + this.getHex().toString(16)).slice(-6)
  36341. },
  36342. getHSL: function (e) {
  36343. var t,
  36344. i,
  36345. n = e || {
  36346. h: 0,
  36347. s: 0,
  36348. l: 0
  36349. },
  36350. r = this.r,
  36351. o = this.g,
  36352. a = this.b,
  36353. s = Math.max(r, o, a),
  36354. l = Math.min(r, o, a),
  36355. c = (l + s) / 2
  36356. if (l === s) i = t = 0
  36357. else {
  36358. var h = s - l
  36359. switch (((i = c <= 0.5 ? h / (s + l) : h / (2 - s - l)), s)) {
  36360. case r:
  36361. t = (o - a) / h + (o < a ? 6 : 0)
  36362. break
  36363. case o:
  36364. t = (a - r) / h + 2
  36365. break
  36366. case a:
  36367. t = (r - o) / h + 4
  36368. }
  36369. t /= 6
  36370. }
  36371. return (n.h = t), (n.s = i), (n.l = c), n
  36372. },
  36373. getStyle: function () {
  36374. return 'rgb(' + ((255 * this.r) | 0) + ',' + ((255 * this.g) | 0) + ',' + ((255 * this.b) | 0) + ')'
  36375. },
  36376. offsetHSL: function (e, t, i) {
  36377. var n = this.getHSL()
  36378. return (n.h += e), (n.s += t), (n.l += i), this.setHSL(n.h, n.s, n.l), this
  36379. },
  36380. add: function (e) {
  36381. return (this.r += e.r), (this.g += e.g), (this.b += e.b), this
  36382. },
  36383. addColors: function (e, t) {
  36384. return (this.r = e.r + t.r), (this.g = e.g + t.g), (this.b = e.b + t.b), this
  36385. },
  36386. addScalar: function (e) {
  36387. return (this.r += e), (this.g += e), (this.b += e), this
  36388. },
  36389. multiply: function (e) {
  36390. return (this.r *= e.r), (this.g *= e.g), (this.b *= e.b), this
  36391. },
  36392. multiplyScalar: function (e) {
  36393. return (this.r *= e), (this.g *= e), (this.b *= e), this
  36394. },
  36395. lerp: function (e, t) {
  36396. return (this.r += (e.r - this.r) * t), (this.g += (e.g - this.g) * t), (this.b += (e.b - this.b) * t), this
  36397. },
  36398. equals: function (e) {
  36399. return e.r === this.r && e.g === this.g && e.b === this.b
  36400. },
  36401. fromArray: function (e, t) {
  36402. return void 0 === t && (t = 0), (this.r = e[t]), (this.g = e[t + 1]), (this.b = e[t + 2]), this
  36403. },
  36404. toArray: function (e, t) {
  36405. 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
  36406. }
  36407. }),
  36408. (Ci.ColorKeywords = {
  36409. aliceblue: 15792383,
  36410. antiquewhite: 16444375,
  36411. aqua: 65535,
  36412. aquamarine: 8388564,
  36413. azure: 15794175,
  36414. beige: 16119260,
  36415. bisque: 16770244,
  36416. black: 0,
  36417. blanchedalmond: 16772045,
  36418. blue: 255,
  36419. blueviolet: 9055202,
  36420. brown: 10824234,
  36421. burlywood: 14596231,
  36422. cadetblue: 6266528,
  36423. chartreuse: 8388352,
  36424. chocolate: 13789470,
  36425. coral: 16744272,
  36426. cornflowerblue: 6591981,
  36427. cornsilk: 16775388,
  36428. crimson: 14423100,
  36429. cyan: 65535,
  36430. darkblue: 139,
  36431. darkcyan: 35723,
  36432. darkgoldenrod: 12092939,
  36433. darkgray: 11119017,
  36434. darkgreen: 25600,
  36435. darkgrey: 11119017,
  36436. darkkhaki: 12433259,
  36437. darkmagenta: 9109643,
  36438. darkolivegreen: 5597999,
  36439. darkorange: 16747520,
  36440. darkorchid: 10040012,
  36441. darkred: 9109504,
  36442. darksalmon: 15308410,
  36443. darkseagreen: 9419919,
  36444. darkslateblue: 4734347,
  36445. darkslategray: 3100495,
  36446. darkslategrey: 3100495,
  36447. darkturquoise: 52945,
  36448. darkviolet: 9699539,
  36449. deeppink: 16716947,
  36450. deepskyblue: 49151,
  36451. dimgray: 6908265,
  36452. dimgrey: 6908265,
  36453. dodgerblue: 2003199,
  36454. firebrick: 11674146,
  36455. floralwhite: 16775920,
  36456. forestgreen: 2263842,
  36457. fuchsia: 16711935,
  36458. gainsboro: 14474460,
  36459. ghostwhite: 16316671,
  36460. gold: 16766720,
  36461. goldenrod: 14329120,
  36462. gray: 8421504,
  36463. green: 32768,
  36464. greenyellow: 11403055,
  36465. grey: 8421504,
  36466. honeydew: 15794160,
  36467. hotpink: 16738740,
  36468. indianred: 13458524,
  36469. indigo: 4915330,
  36470. ivory: 16777200,
  36471. khaki: 15787660,
  36472. lavender: 15132410,
  36473. lavenderblush: 16773365,
  36474. lawngreen: 8190976,
  36475. lemonchiffon: 16775885,
  36476. lightblue: 11393254,
  36477. lightcoral: 15761536,
  36478. lightcyan: 14745599,
  36479. lightgoldenrodyellow: 16448210,
  36480. lightgray: 13882323,
  36481. lightgreen: 9498256,
  36482. lightgrey: 13882323,
  36483. lightpink: 16758465,
  36484. lightsalmon: 16752762,
  36485. lightseagreen: 2142890,
  36486. lightskyblue: 8900346,
  36487. lightslategray: 7833753,
  36488. lightslategrey: 7833753,
  36489. lightsteelblue: 11584734,
  36490. lightyellow: 16777184,
  36491. lime: 65280,
  36492. limegreen: 3329330,
  36493. linen: 16445670,
  36494. magenta: 16711935,
  36495. maroon: 8388608,
  36496. mediumaquamarine: 6737322,
  36497. mediumblue: 205,
  36498. mediumorchid: 12211667,
  36499. mediumpurple: 9662683,
  36500. mediumseagreen: 3978097,
  36501. mediumslateblue: 8087790,
  36502. mediumspringgreen: 64154,
  36503. mediumturquoise: 4772300,
  36504. mediumvioletred: 13047173,
  36505. midnightblue: 1644912,
  36506. mintcream: 16121850,
  36507. mistyrose: 16770273,
  36508. moccasin: 16770229,
  36509. navajowhite: 16768685,
  36510. navy: 128,
  36511. oldlace: 16643558,
  36512. olive: 8421376,
  36513. olivedrab: 7048739,
  36514. orange: 16753920,
  36515. orangered: 16729344,
  36516. orchid: 14315734,
  36517. palegoldenrod: 15657130,
  36518. palegreen: 10025880,
  36519. paleturquoise: 11529966,
  36520. palevioletred: 14381203,
  36521. papayawhip: 16773077,
  36522. peachpuff: 16767673,
  36523. peru: 13468991,
  36524. pink: 16761035,
  36525. plum: 14524637,
  36526. powderblue: 11591910,
  36527. purple: 8388736,
  36528. red: 16711680,
  36529. rosybrown: 12357519,
  36530. royalblue: 4286945,
  36531. saddlebrown: 9127187,
  36532. salmon: 16416882,
  36533. sandybrown: 16032864,
  36534. seagreen: 3050327,
  36535. seashell: 16774638,
  36536. sienna: 10506797,
  36537. silver: 12632256,
  36538. skyblue: 8900331,
  36539. slateblue: 6970061,
  36540. slategray: 7372944,
  36541. slategrey: 7372944,
  36542. snow: 16775930,
  36543. springgreen: 65407,
  36544. steelblue: 4620980,
  36545. tan: 13808780,
  36546. teal: 32896,
  36547. thistle: 14204888,
  36548. tomato: 16737095,
  36549. turquoise: 4251856,
  36550. violet: 15631086,
  36551. wheat: 16113331,
  36552. white: 16777215,
  36553. whitesmoke: 16119285,
  36554. yellow: 16776960,
  36555. yellowgreen: 10145074
  36556. }),
  36557. (Ci.Quaternion = function (e, t, i, n) {
  36558. ;(this._x = e || 0), (this._y = t || 0), (this._z = i || 0), (this._w = void 0 !== n ? n : 1)
  36559. }),
  36560. (Ci.Quaternion.prototype = {
  36561. constructor: Ci.Quaternion,
  36562. get x() {
  36563. return this._x
  36564. },
  36565. set x(e) {
  36566. ;(this._x = e), this.onChangeCallback()
  36567. },
  36568. get y() {
  36569. return this._y
  36570. },
  36571. set y(e) {
  36572. ;(this._y = e), this.onChangeCallback()
  36573. },
  36574. get z() {
  36575. return this._z
  36576. },
  36577. set z(e) {
  36578. ;(this._z = e), this.onChangeCallback()
  36579. },
  36580. get w() {
  36581. return this._w
  36582. },
  36583. set w(e) {
  36584. ;(this._w = e), this.onChangeCallback()
  36585. },
  36586. set: function (e, t, i, n) {
  36587. return (this._x = e), (this._y = t), (this._z = i), (this._w = n), this.onChangeCallback(), this
  36588. },
  36589. clone: function () {
  36590. return new this.constructor(this._x, this._y, this._z, this._w)
  36591. },
  36592. toObject: function () {
  36593. //add
  36594. return { x: this.x, y: this.y, z: this.z, w: this.w }
  36595. },
  36596. copy: function (e) {
  36597. return (this._x = e.x), (this._y = e.y), (this._z = e.z), (this._w = e.w), this.onChangeCallback(), this
  36598. },
  36599. setFromEuler: function (e, t) {
  36600. if (e instanceof Ci.Euler == 0) throw new Error('THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.')
  36601. var i = Math.cos(e._x / 2),
  36602. n = Math.cos(e._y / 2),
  36603. r = Math.cos(e._z / 2),
  36604. o = Math.sin(e._x / 2),
  36605. a = Math.sin(e._y / 2),
  36606. s = Math.sin(e._z / 2),
  36607. l = e.order
  36608. return (
  36609. 'XYZ' === l
  36610. ? ((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))
  36611. : 'YXZ' === l
  36612. ? ((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))
  36613. : 'ZXY' === l
  36614. ? ((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))
  36615. : 'ZYX' === l
  36616. ? ((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))
  36617. : 'YZX' === l
  36618. ? ((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))
  36619. : '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)),
  36620. !1 !== t && this.onChangeCallback(),
  36621. this
  36622. )
  36623. },
  36624. setFromAxisAngle: function (e, t) {
  36625. var i = t / 2,
  36626. n = Math.sin(i)
  36627. return (this._x = e.x * n), (this._y = e.y * n), (this._z = e.z * n), (this._w = Math.cos(i)), this.onChangeCallback(), this
  36628. },
  36629. setFromRotationMatrix: function (e) {
  36630. var t,
  36631. i = e.elements,
  36632. n = i[0],
  36633. r = i[4],
  36634. o = i[8],
  36635. a = i[1],
  36636. s = i[5],
  36637. l = i[9],
  36638. c = i[2],
  36639. h = i[6],
  36640. u = i[10],
  36641. d = n + s + u
  36642. return (
  36643. 0 < d
  36644. ? ((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))
  36645. : s < n && u < n
  36646. ? ((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))
  36647. : u < s
  36648. ? ((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))
  36649. : ((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)),
  36650. this.onChangeCallback(),
  36651. this
  36652. )
  36653. },
  36654. setFromUnitVectors: function (e, t) {
  36655. return (
  36656. void 0 === Be && (Be = new Ci.Vector3()),
  36657. (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),
  36658. (this._x = Be.x),
  36659. (this._y = Be.y),
  36660. (this._z = Be.z),
  36661. (this._w = Ve),
  36662. this.normalize(),
  36663. this
  36664. )
  36665. },
  36666. inverse: function () {
  36667. return this.conjugate().normalize(), this
  36668. },
  36669. conjugate: function () {
  36670. return (this._x *= -1), (this._y *= -1), (this._z *= -1), this.onChangeCallback(), this
  36671. },
  36672. dot: function (e) {
  36673. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  36674. },
  36675. lengthSq: function () {
  36676. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  36677. },
  36678. length: function () {
  36679. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  36680. },
  36681. normalize: function () {
  36682. var e = this.length()
  36683. return (
  36684. 0 === e
  36685. ? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1))
  36686. : ((e = 1 / e), (this._x = this._x * e), (this._y = this._y * e), (this._z = this._z * e), (this._w = this._w * e)),
  36687. this.onChangeCallback(),
  36688. this
  36689. )
  36690. },
  36691. multiply: function (e, t) {
  36692. return void 0 !== t
  36693. ? (console.warn('THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.'), this.multiplyQuaternions(e, t))
  36694. : this.multiplyQuaternions(this, e)
  36695. },
  36696. multiplyQuaternions: function (e, t) {
  36697. var i = e._x,
  36698. n = e._y,
  36699. r = e._z,
  36700. o = e._w,
  36701. a = t._x,
  36702. s = t._y,
  36703. l = t._z,
  36704. c = t._w
  36705. return (
  36706. (this._x = i * c + o * a + n * l - r * s),
  36707. (this._y = n * c + o * s + r * a - i * l),
  36708. (this._z = r * c + o * l + i * s - n * a),
  36709. (this._w = o * c - i * a - n * s - r * l),
  36710. this.onChangeCallback(),
  36711. this
  36712. )
  36713. },
  36714. slerp: function (e, t) {
  36715. if (0 === t) return this
  36716. if (1 === t) return this.copy(e)
  36717. var i = this._x,
  36718. n = this._y,
  36719. r = this._z,
  36720. o = this._w,
  36721. a = o * e._w + i * e._x + n * e._y + r * e._z
  36722. 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))
  36723. return (this._w = o), (this._x = i), (this._y = n), (this._z = r), this
  36724. var s = Math.sqrt(1 - a * a)
  36725. 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
  36726. var l = Math.atan2(s, a),
  36727. c = Math.sin((1 - t) * l) / s,
  36728. h = Math.sin(t * l) / s
  36729. 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
  36730. },
  36731. equals: function (e) {
  36732. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  36733. },
  36734. fromArray: function (e, t) {
  36735. 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
  36736. },
  36737. toArray: function (e, t) {
  36738. 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
  36739. },
  36740. onChange: function (e) {
  36741. return (this.onChangeCallback = e), this
  36742. },
  36743. onChangeCallback: function () {}
  36744. }),
  36745. Object.assign(Ci.Quaternion, {
  36746. slerp: function (e, t, i, n) {
  36747. return i.copy(e).slerp(t, n)
  36748. },
  36749. slerpFlat: function (e, t, i, n, r, o, a) {
  36750. var s = i[n + 0],
  36751. l = i[n + 1],
  36752. c = i[n + 2],
  36753. h = i[n + 3],
  36754. u = r[o + 0],
  36755. d = r[o + 1],
  36756. p = r[o + 2],
  36757. f = r[o + 3]
  36758. if (h !== f || s !== u || l !== d || c !== p) {
  36759. var g = 1 - a,
  36760. m = s * u + l * d + c * p + h * f,
  36761. v = 0 <= m ? 1 : -1,
  36762. y = 1 - m * m
  36763. if (y > Number.EPSILON) {
  36764. var A = Math.sqrt(y),
  36765. C = Math.atan2(A, m * v)
  36766. ;(g = Math.sin(g * C) / A), (a = Math.sin(a * C) / A)
  36767. }
  36768. var I = a * v
  36769. if (((s = s * g + u * I), (l = l * g + d * I), (c = c * g + p * I), (h = h * g + f * I), g === 1 - a)) {
  36770. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h)
  36771. ;(s *= E), (l *= E), (c *= E), (h *= E)
  36772. }
  36773. }
  36774. ;(e[t] = s), (e[t + 1] = l), (e[t + 2] = c), (e[t + 3] = h)
  36775. }
  36776. }),
  36777. (Ci.Vector2 = function (e, t) {
  36778. ;(this.x = e || 0), (this.y = t || 0)
  36779. }),
  36780. (Ci.Vector2.prototype = {
  36781. constructor: Ci.Vector2,
  36782. get width() {
  36783. return this.x
  36784. },
  36785. set width(e) {
  36786. this.x = e
  36787. },
  36788. get height() {
  36789. return this.y
  36790. },
  36791. set height(e) {
  36792. this.y = e
  36793. },
  36794. set: function (e, t) {
  36795. return (this.x = e), (this.y = t), this
  36796. },
  36797. setScalar: function (e) {
  36798. return (this.x = e), (this.y = e), this
  36799. },
  36800. setX: function (e) {
  36801. return (this.x = e), this
  36802. },
  36803. setY: function (e) {
  36804. return (this.y = e), this
  36805. },
  36806. setComponent: function (e, t) {
  36807. switch (e) {
  36808. case 0:
  36809. this.x = t
  36810. break
  36811. case 1:
  36812. this.y = t
  36813. break
  36814. default:
  36815. throw new Error('index is out of range: ' + e)
  36816. }
  36817. },
  36818. getComponent: function (e) {
  36819. switch (e) {
  36820. case 0:
  36821. return this.x
  36822. case 1:
  36823. return this.y
  36824. default:
  36825. throw new Error('index is out of range: ' + e)
  36826. }
  36827. },
  36828. clone: function () {
  36829. return new this.constructor(this.x, this.y)
  36830. },
  36831. copy: function (e) {
  36832. return (this.x = e.x), (this.y = e.y), this
  36833. },
  36834. add: function (e, t) {
  36835. return void 0 !== t
  36836. ? (console.warn('THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'), this.addVectors(e, t))
  36837. : ((this.x += e.x), (this.y += e.y), this)
  36838. },
  36839. addScalar: function (e) {
  36840. return (this.x += e), (this.y += e), this
  36841. },
  36842. addVectors: function (e, t) {
  36843. return (this.x = e.x + t.x), (this.y = e.y + t.y), this
  36844. },
  36845. addScaledVector: function (e, t) {
  36846. return (this.x += e.x * t), (this.y += e.y * t), this
  36847. },
  36848. sub: function (e, t) {
  36849. return void 0 !== t
  36850. ? (console.warn('THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'), this.subVectors(e, t))
  36851. : ((this.x -= e.x), (this.y -= e.y), this)
  36852. },
  36853. subScalar: function (e) {
  36854. return (this.x -= e), (this.y -= e), this
  36855. },
  36856. subVectors: function (e, t) {
  36857. return (this.x = e.x - t.x), (this.y = e.y - t.y), this
  36858. },
  36859. multiply: function (e) {
  36860. return (this.x *= e.x), (this.y *= e.y), this
  36861. },
  36862. multiplyScalar: function (e) {
  36863. return isFinite(e) ? ((this.x *= e), (this.y *= e)) : ((this.x = 0), (this.y = 0)), this
  36864. },
  36865. divide: function (e) {
  36866. return (this.x /= e.x), (this.y /= e.y), this
  36867. },
  36868. divideScalar: function (e) {
  36869. return this.multiplyScalar(1 / e)
  36870. },
  36871. min: function (e) {
  36872. return (this.x = Math.min(this.x, e.x)), (this.y = Math.min(this.y, e.y)), this
  36873. },
  36874. max: function (e) {
  36875. return (this.x = Math.max(this.x, e.x)), (this.y = Math.max(this.y, e.y)), this
  36876. },
  36877. clamp: function (e, t) {
  36878. 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
  36879. },
  36880. clampScalar: function (e, t) {
  36881. return void 0 === Ne && ((Ne = new Ci.Vector2()), (Fe = new Ci.Vector2())), Ne.set(e, e), Fe.set(t, t), this.clamp(Ne, Fe)
  36882. },
  36883. clampLength: function (e, t) {
  36884. var i = this.length()
  36885. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i), this
  36886. },
  36887. floor: function () {
  36888. return (this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), this
  36889. },
  36890. ceil: function () {
  36891. return (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), this
  36892. },
  36893. round: function () {
  36894. return (this.x = Math.round(this.x)), (this.y = Math.round(this.y)), this
  36895. },
  36896. roundToZero: function () {
  36897. 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
  36898. },
  36899. negate: function () {
  36900. return (this.x = -this.x), (this.y = -this.y), this
  36901. },
  36902. dot: function (e) {
  36903. return this.x * e.x + this.y * e.y
  36904. },
  36905. lengthSq: function () {
  36906. return this.x * this.x + this.y * this.y
  36907. },
  36908. length: function () {
  36909. return Math.sqrt(this.x * this.x + this.y * this.y)
  36910. },
  36911. lengthManhattan: function () {
  36912. return Math.abs(this.x) + Math.abs(this.y)
  36913. },
  36914. normalize: function () {
  36915. return this.divideScalar(this.length())
  36916. },
  36917. angle: function () {
  36918. var e = Math.atan2(this.y, this.x)
  36919. return e < 0 && (e += 2 * Math.PI), e
  36920. },
  36921. distanceTo: function (e) {
  36922. return Math.sqrt(this.distanceToSquared(e))
  36923. },
  36924. distanceToSquared: function (e) {
  36925. var t = this.x - e.x,
  36926. i = this.y - e.y
  36927. return t * t + i * i
  36928. },
  36929. setLength: function (e) {
  36930. return this.multiplyScalar(e / this.length())
  36931. },
  36932. lerp: function (e, t) {
  36933. return (this.x += (e.x - this.x) * t), (this.y += (e.y - this.y) * t), this
  36934. },
  36935. lerpVectors: function (e, t, i) {
  36936. return this.subVectors(t, e).multiplyScalar(i).add(e), this
  36937. },
  36938. equals: function (e) {
  36939. return e.x === this.x && e.y === this.y
  36940. },
  36941. fromArray: function (e, t) {
  36942. return void 0 === t && (t = 0), (this.x = e[t]), (this.y = e[t + 1]), this
  36943. },
  36944. toArray: function (e, t) {
  36945. return void 0 === e && (e = []), void 0 === t && (t = 0), (e[t] = this.x), (e[t + 1] = this.y), e
  36946. },
  36947. fromAttribute: function (e, t, i) {
  36948. return void 0 === i && (i = 0), (t = t * e.itemSize + i), (this.x = e.array[t]), (this.y = e.array[t + 1]), this
  36949. },
  36950. rotateAround: function (e, t) {
  36951. var i = Math.cos(t),
  36952. n = Math.sin(t),
  36953. r = this.x - e.x,
  36954. o = this.y - e.y
  36955. return (this.x = r * i - o * n + e.x), (this.y = r * n + o * i + e.y), this
  36956. }
  36957. }),
  36958. (Ci.Vector3 = function (e, t, i) {
  36959. ;(this.x = e || 0), (this.y = t || 0), (this.z = i || 0)
  36960. }),
  36961. (Ci.Vector3.prototype = {
  36962. constructor: Ci.Vector3,
  36963. set: function (e, t, i) {
  36964. return (this.x = e), (this.y = t), (this.z = i), this
  36965. },
  36966. setScalar: function (e) {
  36967. return (this.x = e), (this.y = e), (this.z = e), this
  36968. },
  36969. setX: function (e) {
  36970. return (this.x = e), this
  36971. },
  36972. setY: function (e) {
  36973. return (this.y = e), this
  36974. },
  36975. setZ: function (e) {
  36976. return (this.z = e), this
  36977. },
  36978. setComponent: function (e, t) {
  36979. switch (e) {
  36980. case 0:
  36981. this.x = t
  36982. break
  36983. case 1:
  36984. this.y = t
  36985. break
  36986. case 2:
  36987. this.z = t
  36988. break
  36989. default:
  36990. throw new Error('index is out of range: ' + e)
  36991. }
  36992. },
  36993. getComponent: function (e) {
  36994. switch (e) {
  36995. case 0:
  36996. return this.x
  36997. case 1:
  36998. return this.y
  36999. case 2:
  37000. return this.z
  37001. default:
  37002. throw new Error('index is out of range: ' + e)
  37003. }
  37004. },
  37005. clone: function () {
  37006. return new this.constructor(this.x, this.y, this.z)
  37007. },
  37008. copy: function (e) {
  37009. return (this.x = e.x), (this.y = e.y), (this.z = e.z), this
  37010. },
  37011. add: function (e, t) {
  37012. return void 0 !== t
  37013. ? (console.warn('THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'), this.addVectors(e, t))
  37014. : ((this.x += e.x), (this.y += e.y), (this.z += e.z), this)
  37015. },
  37016. addScalar: function (e) {
  37017. return (this.x += e), (this.y += e), (this.z += e), this
  37018. },
  37019. addVectors: function (e, t) {
  37020. return (this.x = e.x + t.x), (this.y = e.y + t.y), (this.z = e.z + t.z), this
  37021. },
  37022. addScaledVector: function (e, t) {
  37023. return (this.x += e.x * t), (this.y += e.y * t), (this.z += e.z * t), this
  37024. },
  37025. sub: function (e, t) {
  37026. return void 0 !== t
  37027. ? (console.warn('THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'), this.subVectors(e, t))
  37028. : ((this.x -= e.x), (this.y -= e.y), (this.z -= e.z), this)
  37029. },
  37030. subScalar: function (e) {
  37031. return (this.x -= e), (this.y -= e), (this.z -= e), this
  37032. },
  37033. subVectors: function (e, t) {
  37034. return (this.x = e.x - t.x), (this.y = e.y - t.y), (this.z = e.z - t.z), this
  37035. },
  37036. multiply: function (e, t) {
  37037. return void 0 !== t
  37038. ? (console.warn('THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.'), this.multiplyVectors(e, t))
  37039. : ((this.x *= e.x), (this.y *= e.y), (this.z *= e.z), this)
  37040. },
  37041. multiplyScalar: function (e) {
  37042. return isFinite(e) ? ((this.x *= e), (this.y *= e), (this.z *= e)) : ((this.x = 0), (this.y = 0), (this.z = 0)), this
  37043. },
  37044. multiplyVectors: function (e, t) {
  37045. return (this.x = e.x * t.x), (this.y = e.y * t.y), (this.z = e.z * t.z), this
  37046. },
  37047. applyEuler: function (e) {
  37048. return (
  37049. e instanceof Ci.Euler == 0 && console.error('THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.'),
  37050. void 0 === De && (De = new Ci.Quaternion()),
  37051. this.applyQuaternion(De.setFromEuler(e)),
  37052. this
  37053. )
  37054. },
  37055. applyAxisAngle: function (e, t) {
  37056. return void 0 === Le && (Le = new Ci.Quaternion()), this.applyQuaternion(Le.setFromAxisAngle(e, t)), this
  37057. },
  37058. applyMatrix3: function (e) {
  37059. var t = this.x,
  37060. i = this.y,
  37061. n = this.z,
  37062. r = e.elements
  37063. 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
  37064. },
  37065. applyMatrix4: function (e) {
  37066. var t = this.x,
  37067. i = this.y,
  37068. n = this.z,
  37069. r = e.elements
  37070. 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
  37071. },
  37072. applyProjection: function (e) {
  37073. var t = this.x,
  37074. i = this.y,
  37075. n = this.z,
  37076. r = e.elements,
  37077. o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15])
  37078. 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
  37079. },
  37080. applyQuaternion: function (e) {
  37081. var t = this.x,
  37082. i = this.y,
  37083. n = this.z,
  37084. r = e.x,
  37085. o = e.y,
  37086. a = e.z,
  37087. s = e.w,
  37088. l = s * t + o * n - a * i,
  37089. c = s * i + a * t - r * n,
  37090. h = s * n + r * i - o * t,
  37091. u = -r * t - o * i - a * n
  37092. 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
  37093. },
  37094. project: function (e) {
  37095. return void 0 === Oe && (Oe = new Ci.Matrix4()), Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)), this.applyProjection(Oe)
  37096. },
  37097. unproject: function (e) {
  37098. return void 0 === Pe && (Pe = new Ci.Matrix4()), Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)), this.applyProjection(Pe)
  37099. },
  37100. transformDirection: function (e) {
  37101. var t = this.x,
  37102. i = this.y,
  37103. n = this.z,
  37104. r = e.elements
  37105. 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
  37106. },
  37107. divide: function (e) {
  37108. return (this.x /= e.x), (this.y /= e.y), (this.z /= e.z), this
  37109. },
  37110. divideScalar: function (e) {
  37111. return this.multiplyScalar(1 / e)
  37112. },
  37113. min: function (e) {
  37114. 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
  37115. },
  37116. max: function (e) {
  37117. 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
  37118. },
  37119. clamp: function (e, t) {
  37120. 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
  37121. },
  37122. clampScalar: function (e, t) {
  37123. 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)
  37124. },
  37125. clampLength: function (e, t) {
  37126. var i = this.length()
  37127. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i), this
  37128. },
  37129. floor: function () {
  37130. return (this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), (this.z = Math.floor(this.z)), this
  37131. },
  37132. ceil: function () {
  37133. return (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), (this.z = Math.ceil(this.z)), this
  37134. },
  37135. round: function () {
  37136. return (this.x = Math.round(this.x)), (this.y = Math.round(this.y)), (this.z = Math.round(this.z)), this
  37137. },
  37138. roundToZero: function () {
  37139. return (
  37140. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  37141. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  37142. (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
  37143. this
  37144. )
  37145. },
  37146. negate: function () {
  37147. return (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), this
  37148. },
  37149. dot: function (e) {
  37150. return this.x * e.x + this.y * e.y + this.z * e.z
  37151. },
  37152. lengthSq: function () {
  37153. return this.x * this.x + this.y * this.y + this.z * this.z
  37154. },
  37155. length: function () {
  37156. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  37157. },
  37158. lengthManhattan: function () {
  37159. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  37160. },
  37161. normalize: function () {
  37162. return this.divideScalar(this.length())
  37163. },
  37164. setLength: function (e) {
  37165. return this.multiplyScalar(e / this.length())
  37166. },
  37167. lerp: function (e, t) {
  37168. return (this.x += (e.x - this.x) * t), (this.y += (e.y - this.y) * t), (this.z += (e.z - this.z) * t), this
  37169. },
  37170. lerpVectors: function (e, t, i) {
  37171. return this.subVectors(t, e).multiplyScalar(i).add(e), this
  37172. },
  37173. cross: function (e, t) {
  37174. if (void 0 !== t) return console.warn('THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.'), this.crossVectors(e, t)
  37175. var i = this.x,
  37176. n = this.y,
  37177. r = this.z
  37178. 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
  37179. },
  37180. crossVectors: function (e, t) {
  37181. var i = e.x,
  37182. n = e.y,
  37183. r = e.z,
  37184. o = t.x,
  37185. a = t.y,
  37186. s = t.z
  37187. return (this.x = n * s - r * a), (this.y = r * o - i * s), (this.z = i * a - n * o), this
  37188. },
  37189. projectOnVector: function (e) {
  37190. return void 0 === xe && (xe = new Ci.Vector3()), xe.copy(e).normalize(), (Se = this.dot(xe)), this.copy(xe).multiplyScalar(Se)
  37191. },
  37192. projectOnPlane: function (e) {
  37193. return void 0 === Te && (Te = new Ci.Vector3()), Te.copy(this).projectOnVector(e), this.sub(Te)
  37194. },
  37195. reflect: function (e) {
  37196. return void 0 === we && (we = new Ci.Vector3()), this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  37197. },
  37198. angleTo: function (e) {
  37199. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq())
  37200. return Math.acos(Ci.Math.clamp(t, -1, 1))
  37201. },
  37202. distanceTo: function (e) {
  37203. return Math.sqrt(this.distanceToSquared(e))
  37204. },
  37205. distanceToSquared: function (e) {
  37206. var t = this.x - e.x,
  37207. i = this.y - e.y,
  37208. n = this.z - e.z
  37209. return t * t + i * i + n * n
  37210. },
  37211. setFromSpherical: function (e) {
  37212. var t = Math.sin(e.phi) * e.radius
  37213. return (this.x = t * Math.sin(e.theta)), (this.y = Math.cos(e.phi) * e.radius), (this.z = t * Math.cos(e.theta)), this
  37214. },
  37215. setFromMatrixPosition: function (e) {
  37216. return this.setFromMatrixColumn(e, 3)
  37217. },
  37218. setFromMatrixScale: function (e) {
  37219. var t = this.setFromMatrixColumn(e, 0).length(),
  37220. i = this.setFromMatrixColumn(e, 1).length(),
  37221. n = this.setFromMatrixColumn(e, 2).length()
  37222. return (this.x = t), (this.y = i), (this.z = n), this
  37223. },
  37224. setFromMatrixColumn: function (e, t) {
  37225. return 'number' == typeof e && (console.warn('THREE.Vector3: setFromMatrixColumn now expects ( matrix, index ).'), (t = e = t)), this.fromArray(e.elements, 4 * t)
  37226. },
  37227. equals: function (e) {
  37228. return e.x === this.x && e.y === this.y && e.z === this.z
  37229. },
  37230. fromArray: function (e, t) {
  37231. return void 0 === t && (t = 0), (this.x = e[t]), (this.y = e[t + 1]), (this.z = e[t + 2]), this
  37232. },
  37233. toArray: function (e, t) {
  37234. 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
  37235. },
  37236. fromAttribute: function (e, t, i) {
  37237. 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
  37238. }
  37239. }),
  37240. (Ci.Vector4 = function (e, t, i, n) {
  37241. ;(this.x = e || 0), (this.y = t || 0), (this.z = i || 0), (this.w = void 0 !== n ? n : 1)
  37242. }),
  37243. (Ci.Vector4.prototype = {
  37244. constructor: Ci.Vector4,
  37245. set: function (e, t, i, n) {
  37246. return (this.x = e), (this.y = t), (this.z = i), (this.w = n), this
  37247. },
  37248. setScalar: function (e) {
  37249. return (this.x = e), (this.y = e), (this.z = e), (this.w = e), this
  37250. },
  37251. setX: function (e) {
  37252. return (this.x = e), this
  37253. },
  37254. setY: function (e) {
  37255. return (this.y = e), this
  37256. },
  37257. setZ: function (e) {
  37258. return (this.z = e), this
  37259. },
  37260. setW: function (e) {
  37261. return (this.w = e), this
  37262. },
  37263. setComponent: function (e, t) {
  37264. switch (e) {
  37265. case 0:
  37266. this.x = t
  37267. break
  37268. case 1:
  37269. this.y = t
  37270. break
  37271. case 2:
  37272. this.z = t
  37273. break
  37274. case 3:
  37275. this.w = t
  37276. break
  37277. default:
  37278. throw new Error('index is out of range: ' + e)
  37279. }
  37280. },
  37281. getComponent: function (e) {
  37282. switch (e) {
  37283. case 0:
  37284. return this.x
  37285. case 1:
  37286. return this.y
  37287. case 2:
  37288. return this.z
  37289. case 3:
  37290. return this.w
  37291. default:
  37292. throw new Error('index is out of range: ' + e)
  37293. }
  37294. },
  37295. clone: function () {
  37296. return new this.constructor(this.x, this.y, this.z, this.w)
  37297. },
  37298. copy: function (e) {
  37299. return (this.x = e.x), (this.y = e.y), (this.z = e.z), (this.w = void 0 !== e.w ? e.w : 1), this
  37300. },
  37301. add: function (e, t) {
  37302. return void 0 !== t
  37303. ? (console.warn('THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'), this.addVectors(e, t))
  37304. : ((this.x += e.x), (this.y += e.y), (this.z += e.z), (this.w += e.w), this)
  37305. },
  37306. addScalar: function (e) {
  37307. return (this.x += e), (this.y += e), (this.z += e), (this.w += e), this
  37308. },
  37309. addVectors: function (e, t) {
  37310. 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
  37311. },
  37312. addScaledVector: function (e, t) {
  37313. return (this.x += e.x * t), (this.y += e.y * t), (this.z += e.z * t), (this.w += e.w * t), this
  37314. },
  37315. sub: function (e, t) {
  37316. return void 0 !== t
  37317. ? (console.warn('THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'), this.subVectors(e, t))
  37318. : ((this.x -= e.x), (this.y -= e.y), (this.z -= e.z), (this.w -= e.w), this)
  37319. },
  37320. subScalar: function (e) {
  37321. return (this.x -= e), (this.y -= e), (this.z -= e), (this.w -= e), this
  37322. },
  37323. subVectors: function (e, t) {
  37324. 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
  37325. },
  37326. multiplyScalar: function (e) {
  37327. 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
  37328. },
  37329. applyMatrix4: function (e) {
  37330. var t = this.x,
  37331. i = this.y,
  37332. n = this.z,
  37333. r = this.w,
  37334. o = e.elements
  37335. return (
  37336. (this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r),
  37337. (this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r),
  37338. (this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r),
  37339. (this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r),
  37340. this
  37341. )
  37342. },
  37343. divideScalar: function (e) {
  37344. return this.multiplyScalar(1 / e)
  37345. },
  37346. setAxisAngleFromQuaternion: function (e) {
  37347. this.w = 2 * Math.acos(e.w)
  37348. var t = Math.sqrt(1 - e.w * e.w)
  37349. 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
  37350. },
  37351. setAxisAngleFromRotationMatrix: function (e) {
  37352. var t,
  37353. i,
  37354. n,
  37355. r,
  37356. o = e.elements,
  37357. a = o[0],
  37358. s = o[4],
  37359. l = o[8],
  37360. c = o[1],
  37361. h = o[5],
  37362. u = o[9],
  37363. d = o[2],
  37364. p = o[6],
  37365. f = o[10]
  37366. if (Math.abs(s - c) < 0.01 && Math.abs(l - d) < 0.01 && Math.abs(u - p) < 0.01) {
  37367. 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
  37368. t = Math.PI
  37369. var g = (a + 1) / 2,
  37370. m = (h + 1) / 2,
  37371. v = (f + 1) / 2,
  37372. y = (s + c) / 4,
  37373. A = (l + d) / 4,
  37374. C = (u + p) / 4
  37375. return (
  37376. m < g && v < g
  37377. ? (r = g < 0.01 ? ((i = 0), (n = 0.707106781)) : ((n = y / (i = Math.sqrt(g))), A / i))
  37378. : v < m
  37379. ? (r = m < 0.01 ? ((n = 0), (i = 0.707106781)) : ((i = y / (n = Math.sqrt(m))), C / n))
  37380. : v < 0.01
  37381. ? ((n = i = 0.707106781), (r = 0))
  37382. : ((i = A / (r = Math.sqrt(v))), (n = C / r)),
  37383. this.set(i, n, r, t),
  37384. this
  37385. )
  37386. }
  37387. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s))
  37388. 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
  37389. },
  37390. min: function (e) {
  37391. 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
  37392. },
  37393. max: function (e) {
  37394. 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
  37395. },
  37396. clamp: function (e, t) {
  37397. return (
  37398. (this.x = Math.max(e.x, Math.min(t.x, this.x))),
  37399. (this.y = Math.max(e.y, Math.min(t.y, this.y))),
  37400. (this.z = Math.max(e.z, Math.min(t.z, this.z))),
  37401. (this.w = Math.max(e.w, Math.min(t.w, this.w))),
  37402. this
  37403. )
  37404. },
  37405. clampScalar: function (e, t) {
  37406. 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)
  37407. },
  37408. floor: function () {
  37409. 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
  37410. },
  37411. ceil: function () {
  37412. 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
  37413. },
  37414. round: function () {
  37415. 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
  37416. },
  37417. roundToZero: function () {
  37418. return (
  37419. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  37420. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  37421. (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
  37422. (this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w)),
  37423. this
  37424. )
  37425. },
  37426. negate: function () {
  37427. return (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), (this.w = -this.w), this
  37428. },
  37429. dot: function (e) {
  37430. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  37431. },
  37432. lengthSq: function () {
  37433. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  37434. },
  37435. length: function () {
  37436. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  37437. },
  37438. lengthManhattan: function () {
  37439. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  37440. },
  37441. normalize: function () {
  37442. return this.divideScalar(this.length())
  37443. },
  37444. setLength: function (e) {
  37445. return this.multiplyScalar(e / this.length())
  37446. },
  37447. lerp: function (e, t) {
  37448. 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
  37449. },
  37450. lerpVectors: function (e, t, i) {
  37451. return this.subVectors(t, e).multiplyScalar(i).add(e), this
  37452. },
  37453. equals: function (e) {
  37454. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  37455. },
  37456. fromArray: function (e, t) {
  37457. 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
  37458. },
  37459. toArray: function (e, t) {
  37460. 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
  37461. },
  37462. fromAttribute: function (e, t, i) {
  37463. 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
  37464. }
  37465. }),
  37466. (Ci.Euler = function (e, t, i, n) {
  37467. ;(this._x = e || 0), (this._y = t || 0), (this._z = i || 0), (this._order = n || Ci.Euler.DefaultOrder)
  37468. }),
  37469. (Ci.Euler.RotationOrders = ['XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX']),
  37470. (Ci.Euler.DefaultOrder = 'XYZ'),
  37471. (Ci.Euler.prototype = {
  37472. constructor: Ci.Euler,
  37473. get x() {
  37474. return this._x
  37475. },
  37476. set x(e) {
  37477. ;(this._x = e), this.onChangeCallback()
  37478. },
  37479. get y() {
  37480. return this._y
  37481. },
  37482. set y(e) {
  37483. ;(this._y = e), this.onChangeCallback()
  37484. },
  37485. get z() {
  37486. return this._z
  37487. },
  37488. set z(e) {
  37489. ;(this._z = e), this.onChangeCallback()
  37490. },
  37491. get order() {
  37492. return this._order
  37493. },
  37494. set order(e) {
  37495. ;(this._order = e), this.onChangeCallback()
  37496. },
  37497. set: function (e, t, i, n) {
  37498. return (this._x = e), (this._y = t), (this._z = i), (this._order = n || this._order), this.onChangeCallback(), this
  37499. },
  37500. clone: function () {
  37501. return new this.constructor(this._x, this._y, this._z, this._order)
  37502. },
  37503. copy: function (e) {
  37504. return (this._x = e._x), (this._y = e._y), (this._z = e._z), (this._order = e._order), this.onChangeCallback(), this
  37505. },
  37506. toObject: function () {
  37507. //xzw
  37508. return { x: this.x, y: this.y, z: this.z }
  37509. },
  37510. setFromRotationMatrix: function (e, t, i) {
  37511. var n = Ci.Math.clamp,
  37512. r = e.elements,
  37513. o = r[0],
  37514. a = r[4],
  37515. s = r[8],
  37516. l = r[1],
  37517. c = r[5],
  37518. h = r[9],
  37519. u = r[2],
  37520. d = r[6],
  37521. p = r[10]
  37522. return (
  37523. 'XYZ' === (t = t || this._order)
  37524. ? ((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)))
  37525. : 'YXZ' === t
  37526. ? ((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)))
  37527. : 'ZXY' === t
  37528. ? ((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))))
  37529. : 'ZYX' === t
  37530. ? ((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))))
  37531. : 'YZX' === t
  37532. ? ((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))))
  37533. : 'XZY' === t
  37534. ? ((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)))
  37535. : console.warn('THREE.Euler: .setFromRotationMatrix() given unsupported order: ' + t),
  37536. (this._order = t),
  37537. !1 !== i && this.onChangeCallback(),
  37538. this
  37539. )
  37540. },
  37541. setFromQuaternion: function (e, t, i) {
  37542. return void 0 === Ee && (Ee = new Ci.Matrix4()), Ee.makeRotationFromQuaternion(e), this.setFromRotationMatrix(Ee, t, i), this
  37543. },
  37544. setFromVector3: function (e, t) {
  37545. return this.set(e.x, e.y, e.z, t || this._order)
  37546. },
  37547. reorder:
  37548. ((Ie = new Ci.Quaternion()),
  37549. function (e) {
  37550. Ie.setFromEuler(this), this.setFromQuaternion(Ie, e)
  37551. }),
  37552. equals: function (e) {
  37553. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  37554. },
  37555. fromArray: function (e) {
  37556. return (this._x = e[0]), (this._y = e[1]), (this._z = e[2]), void 0 !== e[3] && (this._order = e[3]), this.onChangeCallback(), this
  37557. },
  37558. toArray: function (e, t) {
  37559. 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
  37560. },
  37561. toVector3: function (e) {
  37562. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x, this._y, this._z)
  37563. },
  37564. onChange: function (e) {
  37565. return (this.onChangeCallback = e), this
  37566. },
  37567. onChangeCallback: function () {}
  37568. }),
  37569. (Ci.Line3 = function (e, t) {
  37570. ;(this.start = void 0 !== e ? e : new Ci.Vector3()), (this.end = void 0 !== t ? t : new Ci.Vector3())
  37571. }),
  37572. (Ci.Line3.prototype = {
  37573. constructor: Ci.Line3,
  37574. set: function (e, t) {
  37575. return this.start.copy(e), this.end.copy(t), this
  37576. },
  37577. clone: function () {
  37578. return new this.constructor().copy(this)
  37579. },
  37580. copy: function (e) {
  37581. return this.start.copy(e.start), this.end.copy(e.end), this
  37582. },
  37583. center: function (e) {
  37584. return (e || new Ci.Vector3()).addVectors(this.start, this.end).multiplyScalar(0.5)
  37585. },
  37586. delta: function (e) {
  37587. return (e || new Ci.Vector3()).subVectors(this.end, this.start)
  37588. },
  37589. distanceSq: function () {
  37590. return this.start.distanceToSquared(this.end)
  37591. },
  37592. distance: function () {
  37593. return this.start.distanceTo(this.end)
  37594. },
  37595. at: function (e, t) {
  37596. var i = t || new Ci.Vector3()
  37597. return this.delta(i).multiplyScalar(e).add(this.start)
  37598. },
  37599. closestPointToPointParameter:
  37600. ((Ae = new Ci.Vector3()),
  37601. (Ce = new Ci.Vector3()),
  37602. function (e, t) {
  37603. Ae.subVectors(e, this.start), Ce.subVectors(this.end, this.start)
  37604. var i = Ce.dot(Ce),
  37605. n = Ce.dot(Ae) / i
  37606. return t && (n = Ci.Math.clamp(n, 0, 1)), n
  37607. }),
  37608. closestPointToPoint: function (e, t, i) {
  37609. var n = this.closestPointToPointParameter(e, t),
  37610. r = i || new Ci.Vector3()
  37611. return this.delta(r).multiplyScalar(n).add(this.start)
  37612. },
  37613. applyMatrix4: function (e) {
  37614. return this.start.applyMatrix4(e), this.end.applyMatrix4(e), this
  37615. },
  37616. equals: function (e) {
  37617. return e.start.equals(this.start) && e.end.equals(this.end)
  37618. }
  37619. }),
  37620. (Ci.Box2 = function (e, t) {
  37621. ;(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))
  37622. }),
  37623. (Ci.Box2.prototype = {
  37624. constructor: Ci.Box2,
  37625. set: function (e, t) {
  37626. return this.min.copy(e), this.max.copy(t), this
  37627. },
  37628. setFromPoints: function (e) {
  37629. this.makeEmpty()
  37630. for (var t = 0, i = e.length; t < i; t++) this.expandByPoint(e[t])
  37631. return this
  37632. },
  37633. setFromCenterAndSize:
  37634. ((ye = new Ci.Vector2()),
  37635. function (e, t) {
  37636. var i = ye.copy(t).multiplyScalar(0.5)
  37637. return this.min.copy(e).sub(i), this.max.copy(e).add(i), this
  37638. }),
  37639. clone: function () {
  37640. return new this.constructor().copy(this)
  37641. },
  37642. copy: function (e) {
  37643. return this.min.copy(e.min), this.max.copy(e.max), this
  37644. },
  37645. makeEmpty: function () {
  37646. return (this.min.x = this.min.y = 1 / 0), (this.max.x = this.max.y = -1 / 0), this
  37647. },
  37648. isEmpty: function () {
  37649. return this.max.x < this.min.x || this.max.y < this.min.y
  37650. },
  37651. center: function (e) {
  37652. return (e || new Ci.Vector2()).addVectors(this.min, this.max).multiplyScalar(0.5)
  37653. },
  37654. size: function (e) {
  37655. return (e || new Ci.Vector2()).subVectors(this.max, this.min)
  37656. },
  37657. expandByPoint: function (e) {
  37658. return this.min.min(e), this.max.max(e), this
  37659. },
  37660. expandByVector: function (e) {
  37661. return this.min.sub(e), this.max.add(e), this
  37662. },
  37663. expandByScalar: function (e) {
  37664. return this.min.addScalar(-e), this.max.addScalar(e), this
  37665. },
  37666. containsPoint: function (e) {
  37667. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  37668. },
  37669. containsBox: function (e) {
  37670. 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
  37671. },
  37672. getParameter: function (e, t) {
  37673. 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))
  37674. },
  37675. intersectsBox: function (e) {
  37676. 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)
  37677. },
  37678. clampPoint: function (e, t) {
  37679. return (t || new Ci.Vector2()).copy(e).clamp(this.min, this.max)
  37680. },
  37681. distanceToPoint:
  37682. ((ve = new Ci.Vector2()),
  37683. function (e) {
  37684. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  37685. }),
  37686. intersect: function (e) {
  37687. return this.min.max(e.min), this.max.min(e.max), this
  37688. },
  37689. union: function (e) {
  37690. return this.min.min(e.min), this.max.max(e.max), this
  37691. },
  37692. translate: function (e) {
  37693. return this.min.add(e), this.max.add(e), this
  37694. },
  37695. equals: function (e) {
  37696. return e.min.equals(this.min) && e.max.equals(this.max)
  37697. }
  37698. }),
  37699. (Ci.Box3 = function (e, t) {
  37700. ;(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))
  37701. }),
  37702. (Ci.Box3.prototype = {
  37703. constructor: Ci.Box3,
  37704. set: function (e, t) {
  37705. return this.min.copy(e), this.max.copy(t), this
  37706. },
  37707. setFromArray: function (e) {
  37708. this.makeEmpty()
  37709. 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) {
  37710. var c = e[s],
  37711. h = e[s + 1],
  37712. u = e[s + 2]
  37713. c < t && (t = c), h < i && (i = h), u < n && (n = u), r < c && (r = c), o < h && (o = h), a < u && (a = u)
  37714. }
  37715. this.min.set(t, i, n), this.max.set(r, o, a)
  37716. },
  37717. setFromPoints: function (e) {
  37718. this.makeEmpty()
  37719. for (var t = 0, i = e.length; t < i; t++) this.expandByPoint(e[t])
  37720. return this
  37721. },
  37722. setFromCenterAndSize:
  37723. ((me = new Ci.Vector3()),
  37724. function (e, t) {
  37725. var i = me.copy(t).multiplyScalar(0.5)
  37726. return this.min.copy(e).sub(i), this.max.copy(e).add(i), this
  37727. }),
  37728. setFromObject: function (e) {
  37729. void 0 === ge && (ge = new Ci.Box3())
  37730. var i = this
  37731. return (
  37732. this.makeEmpty(),
  37733. e.updateMatrixWorld(!0),
  37734. e.traverse(function (e) {
  37735. var t = e.geometry
  37736. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(), !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox), ge.applyMatrix4(e.matrixWorld), i.union(ge)))
  37737. }),
  37738. this
  37739. )
  37740. },
  37741. clone: function () {
  37742. return new this.constructor().copy(this)
  37743. },
  37744. copy: function (e) {
  37745. return this.min.copy(e.min), this.max.copy(e.max), this
  37746. },
  37747. makeEmpty: function () {
  37748. return (this.min.x = this.min.y = this.min.z = 1 / 0), (this.max.x = this.max.y = this.max.z = -1 / 0), this
  37749. },
  37750. isEmpty: function () {
  37751. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  37752. },
  37753. center: function (e) {
  37754. return (e || new Ci.Vector3()).addVectors(this.min, this.max).multiplyScalar(0.5)
  37755. },
  37756. size: function (e) {
  37757. return (e || new Ci.Vector3()).subVectors(this.max, this.min)
  37758. },
  37759. expandByPoint: function (e) {
  37760. return this.min.min(e), this.max.max(e), this
  37761. },
  37762. expandByVector: function (e) {
  37763. return this.min.sub(e), this.max.add(e), this
  37764. },
  37765. expandByScalar: function (e) {
  37766. return this.min.addScalar(-e), this.max.addScalar(e), this
  37767. },
  37768. containsPoint: function (e) {
  37769. 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)
  37770. },
  37771. containsBox: function (e) {
  37772. 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
  37773. },
  37774. getParameter: function (e, t) {
  37775. 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))
  37776. },
  37777. intersectsBox: function (e) {
  37778. 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)
  37779. },
  37780. intersectsSphere: function (e) {
  37781. return void 0 === fe && (fe = new Ci.Vector3()), this.clampPoint(e.center, fe), fe.distanceToSquared(e.center) <= e.radius * e.radius
  37782. },
  37783. intersectsPlane: function (e) {
  37784. var t, i
  37785. return (
  37786. (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)),
  37787. 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)),
  37788. 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)),
  37789. t <= e.constant && i >= e.constant
  37790. )
  37791. },
  37792. clampPoint: function (e, t) {
  37793. return (t || new Ci.Vector3()).copy(e).clamp(this.min, this.max)
  37794. },
  37795. distanceToPoint:
  37796. ((pe = new Ci.Vector3()),
  37797. function (e) {
  37798. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  37799. }),
  37800. getBoundingSphere:
  37801. ((de = new Ci.Vector3()),
  37802. function (e) {
  37803. var t = e || new Ci.Sphere()
  37804. return (t.center = this.center()), (t.radius = 0.5 * this.size(de).length()), t
  37805. }),
  37806. intersect: function (e) {
  37807. return this.min.max(e.min), this.max.min(e.max), this
  37808. },
  37809. union: function (e) {
  37810. return this.min.min(e.min), this.max.max(e.max), this
  37811. },
  37812. applyMatrix4:
  37813. ((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()]),
  37814. function (e) {
  37815. return (
  37816. ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  37817. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  37818. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  37819. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  37820. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  37821. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  37822. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  37823. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  37824. this.makeEmpty(),
  37825. this.setFromPoints(ue),
  37826. this
  37827. )
  37828. }),
  37829. translate: function (e) {
  37830. return this.min.add(e), this.max.add(e), this
  37831. },
  37832. equals: function (e) {
  37833. return e.min.equals(this.min) && e.max.equals(this.max)
  37834. }
  37835. }),
  37836. (Ci.Matrix3 = function () {
  37837. ;(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.')
  37838. }),
  37839. (Ci.Matrix3.prototype = {
  37840. constructor: Ci.Matrix3,
  37841. set: function (e, t, i, n, r, o, a, s, l) {
  37842. var c = this.elements
  37843. 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
  37844. },
  37845. identity: function () {
  37846. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this
  37847. },
  37848. clone: function () {
  37849. return new this.constructor().fromArray(this.elements)
  37850. },
  37851. copy: function (e) {
  37852. var t = e.elements
  37853. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]), this
  37854. },
  37855. setFromMatrix4: function (e) {
  37856. var t = e.elements
  37857. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]), this
  37858. },
  37859. applyToVector3Array: function (e, t, i) {
  37860. void 0 === he && (he = new Ci.Vector3()), void 0 === t && (t = 0), void 0 === i && (i = e.length)
  37861. for (var n = 0, r = t; n < i; n += 3, r += 3) he.fromArray(e, r), he.applyMatrix3(this), he.toArray(e, r)
  37862. return e
  37863. },
  37864. applyToBuffer: function (e, t, i) {
  37865. void 0 === ce && (ce = new Ci.Vector3()), void 0 === t && (t = 0), void 0 === i && (i = e.length / e.itemSize)
  37866. 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)
  37867. return e
  37868. },
  37869. multiplyScalar: function (e) {
  37870. var t = this.elements
  37871. 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
  37872. },
  37873. determinant: function () {
  37874. var e = this.elements,
  37875. t = e[0],
  37876. i = e[1],
  37877. n = e[2],
  37878. r = e[3],
  37879. o = e[4],
  37880. a = e[5],
  37881. s = e[6],
  37882. l = e[7],
  37883. c = e[8]
  37884. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  37885. },
  37886. getInverse: function (e, t) {
  37887. e instanceof Ci.Matrix4 && console.warn('THREE.Matrix3.getInverse no longer takes a Matrix4 argument.')
  37888. var i = e.elements,
  37889. n = this.elements,
  37890. r = i[0],
  37891. o = i[1],
  37892. a = i[2],
  37893. s = i[3],
  37894. l = i[4],
  37895. c = i[5],
  37896. h = i[6],
  37897. u = i[7],
  37898. d = i[8],
  37899. p = d * l - c * u,
  37900. f = c * h - d * s,
  37901. g = u * s - l * h,
  37902. m = r * p + o * f + a * g
  37903. if (0 != m)
  37904. return (
  37905. (n[0] = p),
  37906. (n[1] = a * u - d * o),
  37907. (n[2] = c * o - a * l),
  37908. (n[3] = f),
  37909. (n[4] = d * r - a * h),
  37910. (n[5] = a * s - c * r),
  37911. (n[6] = g),
  37912. (n[7] = o * h - u * r),
  37913. (n[8] = l * r - o * s),
  37914. this.multiplyScalar(1 / m)
  37915. )
  37916. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0"
  37917. if (t) throw new Error(v)
  37918. return this.identity() /* console.warn(v), */ //许钟文删 boxHelper报的
  37919. },
  37920. transpose: function () {
  37921. var e,
  37922. t = this.elements
  37923. 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
  37924. },
  37925. flattenToArrayOffset: function (e, t) {
  37926. var i = this.elements
  37927. 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
  37928. },
  37929. getNormalMatrix: function (e) {
  37930. return this.setFromMatrix4(e).getInverse(this).transpose()
  37931. },
  37932. transposeIntoArray: function (e) {
  37933. var t = this.elements
  37934. 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
  37935. },
  37936. fromArray: function (e) {
  37937. return this.elements.set(e), this
  37938. },
  37939. toArray: function () {
  37940. var e = this.elements
  37941. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  37942. }
  37943. }),
  37944. (Ci.Matrix4 = function () {
  37945. ;(this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])),
  37946. 0 < arguments.length && console.error('THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.')
  37947. }),
  37948. (Ci.Matrix4.prototype = {
  37949. constructor: Ci.Matrix4,
  37950. set: function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  37951. var m = this.elements
  37952. return (
  37953. (m[0] = e),
  37954. (m[4] = t),
  37955. (m[8] = i),
  37956. (m[12] = n),
  37957. (m[1] = r),
  37958. (m[5] = o),
  37959. (m[9] = a),
  37960. (m[13] = s),
  37961. (m[2] = l),
  37962. (m[6] = c),
  37963. (m[10] = h),
  37964. (m[14] = u),
  37965. (m[3] = d),
  37966. (m[7] = p),
  37967. (m[11] = f),
  37968. (m[15] = g),
  37969. this
  37970. )
  37971. },
  37972. identity: function () {
  37973. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  37974. },
  37975. clone: function () {
  37976. return new Ci.Matrix4().fromArray(this.elements)
  37977. },
  37978. copy: function (e) {
  37979. return this.elements.set(e.elements), this
  37980. },
  37981. copyPosition: function (e) {
  37982. var t = this.elements,
  37983. i = e.elements
  37984. return (t[12] = i[12]), (t[13] = i[13]), (t[14] = i[14]), this
  37985. },
  37986. extractBasis: function (e, t, i) {
  37987. return e.setFromMatrixColumn(this, 0), t.setFromMatrixColumn(this, 1), i.setFromMatrixColumn(this, 2), this
  37988. },
  37989. makeBasis: function (e, t, i) {
  37990. 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
  37991. },
  37992. extractRotation: function (e) {
  37993. void 0 === le && (le = new Ci.Vector3())
  37994. var t = this.elements,
  37995. i = e.elements,
  37996. n = 1 / le.setFromMatrixColumn(e, 0).length(),
  37997. r = 1 / le.setFromMatrixColumn(e, 1).length(),
  37998. o = 1 / le.setFromMatrixColumn(e, 2).length()
  37999. 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
  38000. },
  38001. makeRotationFromEuler: function (e) {
  38002. e instanceof Ci.Euler == 0 && console.error('THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.')
  38003. var t = this.elements,
  38004. i = e.x,
  38005. n = e.y,
  38006. r = e.z,
  38007. o = Math.cos(i),
  38008. a = Math.sin(i),
  38009. s = Math.cos(n),
  38010. l = Math.sin(n),
  38011. c = Math.cos(r),
  38012. h = Math.sin(r)
  38013. if ('XYZ' === e.order) {
  38014. var u = o * c,
  38015. d = o * h,
  38016. p = a * c,
  38017. f = a * h
  38018. ;(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)
  38019. } else if ('YXZ' === e.order) {
  38020. var g = s * c,
  38021. m = s * h,
  38022. v = l * c,
  38023. y = l * h
  38024. ;(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)
  38025. } else if ('ZXY' === e.order) {
  38026. ;(g = s * c), (m = s * h), (v = l * c), (y = l * h)
  38027. ;(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)
  38028. } else if ('ZYX' === e.order) {
  38029. ;(u = o * c), (d = o * h), (p = a * c), (f = a * h)
  38030. ;(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)
  38031. } else if ('YZX' === e.order) {
  38032. var A = o * s,
  38033. C = o * l,
  38034. I = a * s,
  38035. E = a * l
  38036. ;(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)
  38037. } else if ('XZY' === e.order) {
  38038. ;(A = o * s), (C = o * l), (I = a * s), (E = a * l)
  38039. ;(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)
  38040. }
  38041. return (t[3] = 0), (t[7] = 0), (t[11] = 0), (t[12] = 0), (t[13] = 0), (t[14] = 0), (t[15] = 1), this
  38042. },
  38043. makeRotationFromQuaternion: function (e) {
  38044. var t = this.elements,
  38045. i = e.x,
  38046. n = e.y,
  38047. r = e.z,
  38048. o = e.w,
  38049. a = i + i,
  38050. s = n + n,
  38051. l = r + r,
  38052. c = i * a,
  38053. h = i * s,
  38054. u = i * l,
  38055. d = n * s,
  38056. p = n * l,
  38057. f = r * l,
  38058. g = o * a,
  38059. m = o * s,
  38060. v = o * l
  38061. return (
  38062. (t[0] = 1 - (d + f)),
  38063. (t[4] = h - v),
  38064. (t[8] = u + m),
  38065. (t[1] = h + v),
  38066. (t[5] = 1 - (c + f)),
  38067. (t[9] = p - g),
  38068. (t[2] = u - m),
  38069. (t[6] = p + g),
  38070. (t[10] = 1 - (c + d)),
  38071. (t[3] = 0),
  38072. (t[7] = 0),
  38073. (t[11] = 0),
  38074. (t[12] = 0),
  38075. (t[13] = 0),
  38076. (t[14] = 0),
  38077. (t[15] = 1),
  38078. this
  38079. )
  38080. },
  38081. lookAt: function (e, t, i) {
  38082. void 0 === oe && (oe = new Ci.Vector3()), void 0 === ae && (ae = new Ci.Vector3()), void 0 === se && (se = new Ci.Vector3())
  38083. var n = this.elements
  38084. return (
  38085. se.subVectors(e, t).normalize(),
  38086. 0 === se.lengthSq() && (se.z = 1),
  38087. oe.crossVectors(i, se).normalize(),
  38088. 0 === oe.lengthSq() && ((se.x += 1e-4), oe.crossVectors(i, se).normalize()),
  38089. ae.crossVectors(se, oe),
  38090. (n[0] = oe.x),
  38091. (n[4] = ae.x),
  38092. (n[8] = se.x),
  38093. (n[1] = oe.y),
  38094. (n[5] = ae.y),
  38095. (n[9] = se.y),
  38096. (n[2] = oe.z),
  38097. (n[6] = ae.z),
  38098. (n[10] = se.z),
  38099. this
  38100. )
  38101. },
  38102. multiply: function (e, t) {
  38103. return void 0 !== t
  38104. ? (console.warn('THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.'), this.multiplyMatrices(e, t))
  38105. : this.multiplyMatrices(this, e)
  38106. },
  38107. multiplyMatrices: function (e, t) {
  38108. var i = e.elements,
  38109. n = t.elements,
  38110. r = this.elements,
  38111. o = i[0],
  38112. a = i[4],
  38113. s = i[8],
  38114. l = i[12],
  38115. c = i[1],
  38116. h = i[5],
  38117. u = i[9],
  38118. d = i[13],
  38119. p = i[2],
  38120. f = i[6],
  38121. g = i[10],
  38122. m = i[14],
  38123. v = i[3],
  38124. y = i[7],
  38125. A = i[11],
  38126. C = i[15],
  38127. I = n[0],
  38128. E = n[4],
  38129. _ = n[8],
  38130. b = n[12],
  38131. w = n[1],
  38132. T = n[5],
  38133. x = n[9],
  38134. S = n[13],
  38135. M = n[2],
  38136. R = n[6],
  38137. P = n[10],
  38138. O = n[14],
  38139. L = n[3],
  38140. D = n[7],
  38141. N = n[11],
  38142. F = n[15]
  38143. return (
  38144. (r[0] = o * I + a * w + s * M + l * L),
  38145. (r[4] = o * E + a * T + s * R + l * D),
  38146. (r[8] = o * _ + a * x + s * P + l * N),
  38147. (r[12] = o * b + a * S + s * O + l * F),
  38148. (r[1] = c * I + h * w + u * M + d * L),
  38149. (r[5] = c * E + h * T + u * R + d * D),
  38150. (r[9] = c * _ + h * x + u * P + d * N),
  38151. (r[13] = c * b + h * S + u * O + d * F),
  38152. (r[2] = p * I + f * w + g * M + m * L),
  38153. (r[6] = p * E + f * T + g * R + m * D),
  38154. (r[10] = p * _ + f * x + g * P + m * N),
  38155. (r[14] = p * b + f * S + g * O + m * F),
  38156. (r[3] = v * I + y * w + A * M + C * L),
  38157. (r[7] = v * E + y * T + A * R + C * D),
  38158. (r[11] = v * _ + y * x + A * P + C * N),
  38159. (r[15] = v * b + y * S + A * O + C * F),
  38160. this
  38161. )
  38162. },
  38163. multiplyToArray: function (e, t, i) {
  38164. var n = this.elements
  38165. return (
  38166. this.multiplyMatrices(e, t),
  38167. (i[0] = n[0]),
  38168. (i[1] = n[1]),
  38169. (i[2] = n[2]),
  38170. (i[3] = n[3]),
  38171. (i[4] = n[4]),
  38172. (i[5] = n[5]),
  38173. (i[6] = n[6]),
  38174. (i[7] = n[7]),
  38175. (i[8] = n[8]),
  38176. (i[9] = n[9]),
  38177. (i[10] = n[10]),
  38178. (i[11] = n[11]),
  38179. (i[12] = n[12]),
  38180. (i[13] = n[13]),
  38181. (i[14] = n[14]),
  38182. (i[15] = n[15]),
  38183. this
  38184. )
  38185. },
  38186. multiplyScalar: function (e) {
  38187. var t = this.elements
  38188. return (
  38189. (t[0] *= e),
  38190. (t[4] *= e),
  38191. (t[8] *= e),
  38192. (t[12] *= e),
  38193. (t[1] *= e),
  38194. (t[5] *= e),
  38195. (t[9] *= e),
  38196. (t[13] *= e),
  38197. (t[2] *= e),
  38198. (t[6] *= e),
  38199. (t[10] *= e),
  38200. (t[14] *= e),
  38201. (t[3] *= e),
  38202. (t[7] *= e),
  38203. (t[11] *= e),
  38204. (t[15] *= e),
  38205. this
  38206. )
  38207. },
  38208. applyToVector3Array: function (e, t, i) {
  38209. void 0 === re && (re = new Ci.Vector3()), void 0 === t && (t = 0), void 0 === i && (i = e.length)
  38210. for (var n = 0, r = t; n < i; n += 3, r += 3) re.fromArray(e, r), re.applyMatrix4(this), re.toArray(e, r)
  38211. return e
  38212. },
  38213. applyToBuffer: function (e, t, i) {
  38214. void 0 === ne && (ne = new Ci.Vector3()), void 0 === t && (t = 0), void 0 === i && (i = e.length / e.itemSize)
  38215. 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)
  38216. return e
  38217. },
  38218. determinant: function () {
  38219. var e = this.elements,
  38220. t = e[0],
  38221. i = e[4],
  38222. n = e[8],
  38223. r = e[12],
  38224. o = e[1],
  38225. a = e[5],
  38226. s = e[9],
  38227. l = e[13],
  38228. c = e[2],
  38229. h = e[6],
  38230. u = e[10],
  38231. d = e[14]
  38232. return (
  38233. e[3] * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) +
  38234. e[7] * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) +
  38235. e[11] * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) +
  38236. e[15] * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  38237. )
  38238. },
  38239. transpose: function () {
  38240. var e,
  38241. t = this.elements
  38242. return (
  38243. (e = t[1]),
  38244. (t[1] = t[4]),
  38245. (t[4] = e),
  38246. (e = t[2]),
  38247. (t[2] = t[8]),
  38248. (t[8] = e),
  38249. (e = t[6]),
  38250. (t[6] = t[9]),
  38251. (t[9] = e),
  38252. (e = t[3]),
  38253. (t[3] = t[12]),
  38254. (t[12] = e),
  38255. (e = t[7]),
  38256. (t[7] = t[13]),
  38257. (t[13] = e),
  38258. (e = t[11]),
  38259. (t[11] = t[14]),
  38260. (t[14] = e),
  38261. this
  38262. )
  38263. },
  38264. flattenToArrayOffset: function (e, t) {
  38265. var i = this.elements
  38266. return (
  38267. (e[t] = i[0]),
  38268. (e[t + 1] = i[1]),
  38269. (e[t + 2] = i[2]),
  38270. (e[t + 3] = i[3]),
  38271. (e[t + 4] = i[4]),
  38272. (e[t + 5] = i[5]),
  38273. (e[t + 6] = i[6]),
  38274. (e[t + 7] = i[7]),
  38275. (e[t + 8] = i[8]),
  38276. (e[t + 9] = i[9]),
  38277. (e[t + 10] = i[10]),
  38278. (e[t + 11] = i[11]),
  38279. (e[t + 12] = i[12]),
  38280. (e[t + 13] = i[13]),
  38281. (e[t + 14] = i[14]),
  38282. (e[t + 15] = i[15]),
  38283. e
  38284. )
  38285. },
  38286. getPosition: function () {
  38287. return (
  38288. void 0 === ie && (ie = new Ci.Vector3()),
  38289. console.warn('THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.'),
  38290. ie.setFromMatrixColumn(this, 3)
  38291. )
  38292. },
  38293. setPosition: function (e) {
  38294. var t = this.elements
  38295. return (t[12] = e.x), (t[13] = e.y), (t[14] = e.z), this
  38296. },
  38297. getInverse: function (e, t) {
  38298. var i = this.elements,
  38299. n = e.elements,
  38300. r = n[0],
  38301. o = n[1],
  38302. a = n[2],
  38303. s = n[3],
  38304. l = n[4],
  38305. c = n[5],
  38306. h = n[6],
  38307. u = n[7],
  38308. d = n[8],
  38309. p = n[9],
  38310. f = n[10],
  38311. g = n[11],
  38312. m = n[12],
  38313. v = n[13],
  38314. y = n[14],
  38315. A = n[15],
  38316. C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A,
  38317. I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A,
  38318. E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A,
  38319. _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y,
  38320. b = r * C + o * I + a * E + s * _
  38321. if (0 != b)
  38322. return (
  38323. (i[0] = C),
  38324. (i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A),
  38325. (i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A),
  38326. (i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g),
  38327. (i[4] = I),
  38328. (i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A),
  38329. (i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A),
  38330. (i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g),
  38331. (i[8] = E),
  38332. (i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A),
  38333. (i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A),
  38334. (i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g),
  38335. (i[12] = _),
  38336. (i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y),
  38337. (i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y),
  38338. (i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f),
  38339. this.multiplyScalar(1 / b)
  38340. )
  38341. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0"
  38342. if (t) throw new Error(w)
  38343. return console.warn(w), this.identity()
  38344. },
  38345. scale: function (e) {
  38346. var t = this.elements,
  38347. i = e.x,
  38348. n = e.y,
  38349. r = e.z
  38350. 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
  38351. },
  38352. getMaxScaleOnAxis: function () {
  38353. var e = this.elements,
  38354. t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2],
  38355. i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6],
  38356. n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10]
  38357. return Math.sqrt(Math.max(t, i, n))
  38358. },
  38359. makeTranslation: function (e, t, i) {
  38360. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1), this
  38361. },
  38362. makeRotationX: function (e) {
  38363. var t = Math.cos(e),
  38364. i = Math.sin(e)
  38365. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1), this
  38366. },
  38367. makeRotationY: function (e) {
  38368. var t = Math.cos(e),
  38369. i = Math.sin(e)
  38370. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1), this
  38371. },
  38372. makeRotationZ: function (e) {
  38373. var t = Math.cos(e),
  38374. i = Math.sin(e)
  38375. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  38376. },
  38377. makeRotationAxis: function (e, t) {
  38378. var i = Math.cos(t),
  38379. n = Math.sin(t),
  38380. r = 1 - i,
  38381. o = e.x,
  38382. a = e.y,
  38383. s = e.z,
  38384. l = r * o,
  38385. c = r * a
  38386. 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
  38387. },
  38388. makeScale: function (e, t, i) {
  38389. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1), this
  38390. },
  38391. compose: function (e, t, i) {
  38392. return this.makeRotationFromQuaternion(t), this.scale(i), this.setPosition(e), this
  38393. },
  38394. decompose: function (e, t, i) {
  38395. void 0 === ee && (ee = new Ci.Vector3()), void 0 === te && (te = new Ci.Matrix4())
  38396. var n = this.elements,
  38397. r = ee.set(n[0], n[1], n[2]).length(),
  38398. o = ee.set(n[4], n[5], n[6]).length(),
  38399. a = ee.set(n[8], n[9], n[10]).length()
  38400. this.determinant() < 0 && (r = -r), (e.x = n[12]), (e.y = n[13]), (e.z = n[14]), te.elements.set(this.elements)
  38401. var s = 1 / r,
  38402. l = 1 / o,
  38403. c = 1 / a
  38404. return (
  38405. (te.elements[0] *= s),
  38406. (te.elements[1] *= s),
  38407. (te.elements[2] *= s),
  38408. (te.elements[4] *= l),
  38409. (te.elements[5] *= l),
  38410. (te.elements[6] *= l),
  38411. (te.elements[8] *= c),
  38412. (te.elements[9] *= c),
  38413. (te.elements[10] *= c),
  38414. t.setFromRotationMatrix(te),
  38415. (i.x = r),
  38416. (i.y = o),
  38417. (i.z = a),
  38418. this
  38419. )
  38420. },
  38421. makeFrustum: function (e, t, i, n, r, o) {
  38422. var a = this.elements,
  38423. s = (2 * r) / (t - e),
  38424. l = (2 * r) / (n - i),
  38425. c = (t + e) / (t - e),
  38426. h = (n + i) / (n - i),
  38427. u = -(o + r) / (o - r),
  38428. d = (-2 * o * r) / (o - r)
  38429. return (
  38430. (a[0] = s),
  38431. (a[4] = 0),
  38432. (a[8] = c),
  38433. (a[12] = 0),
  38434. (a[1] = 0),
  38435. (a[5] = l),
  38436. (a[9] = h),
  38437. (a[13] = 0),
  38438. (a[2] = 0),
  38439. (a[6] = 0),
  38440. (a[10] = u),
  38441. (a[14] = d),
  38442. (a[3] = 0),
  38443. (a[7] = 0),
  38444. (a[11] = -1),
  38445. (a[15] = 0),
  38446. this
  38447. )
  38448. },
  38449. makePerspective: function (e, t, i, n) {
  38450. var r = i * Math.tan(Ci.Math.degToRad(0.5 * e)),
  38451. o = -r,
  38452. a = o * t,
  38453. s = r * t
  38454. return this.makeFrustum(a, s, o, r, i, n)
  38455. },
  38456. makeOrthographic: function (e, t, i, n, r, o) {
  38457. var a = this.elements,
  38458. s = 1 / (t - e),
  38459. l = 1 / (i - n),
  38460. c = 1 / (o - r),
  38461. h = (t + e) * s,
  38462. u = (i + n) * l,
  38463. d = (o + r) * c
  38464. return (
  38465. (a[0] = 2 * s),
  38466. (a[4] = 0),
  38467. (a[8] = 0),
  38468. (a[12] = -h),
  38469. (a[1] = 0),
  38470. (a[5] = 2 * l),
  38471. (a[9] = 0),
  38472. (a[13] = -u),
  38473. (a[2] = 0),
  38474. (a[6] = 0),
  38475. (a[10] = -2 * c),
  38476. (a[14] = -d),
  38477. (a[3] = 0),
  38478. (a[7] = 0),
  38479. (a[11] = 0),
  38480. (a[15] = 1),
  38481. this
  38482. )
  38483. },
  38484. equals: function (e) {
  38485. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++) if (t[n] !== i[n]) return !1
  38486. return !0
  38487. },
  38488. fromArray: function (e) {
  38489. return this.elements.set(e), this
  38490. },
  38491. toArray: function () {
  38492. var e = this.elements
  38493. 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]]
  38494. }
  38495. }),
  38496. (Ci.Ray = function (e, t) {
  38497. ;(this.origin = void 0 !== e ? e : new Ci.Vector3()), (this.direction = void 0 !== t ? t : new Ci.Vector3())
  38498. }),
  38499. (Ci.Ray.prototype = {
  38500. constructor: Ci.Ray,
  38501. set: function (e, t) {
  38502. return this.origin.copy(e), this.direction.copy(t), this
  38503. },
  38504. clone: function () {
  38505. return new this.constructor().copy(this)
  38506. },
  38507. copy: function (e) {
  38508. return this.origin.copy(e.origin), this.direction.copy(e.direction), this
  38509. },
  38510. at: function (e, t) {
  38511. return (t || new Ci.Vector3()).copy(this.direction).multiplyScalar(e).add(this.origin)
  38512. },
  38513. lookAt: function (e) {
  38514. this.direction.copy(e).sub(this.origin).normalize()
  38515. },
  38516. recast:
  38517. (($ = new Ci.Vector3()),
  38518. function (e) {
  38519. return this.origin.copy(this.at(e, $)), this
  38520. }),
  38521. closestPointToPoint: function (e, t) {
  38522. var i = t || new Ci.Vector3()
  38523. i.subVectors(e, this.origin)
  38524. var n = i.dot(this.direction)
  38525. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  38526. },
  38527. distanceToPoint: function (e) {
  38528. return Math.sqrt(this.distanceSqToPoint(e))
  38529. },
  38530. distanceSqToPoint:
  38531. ((J = new Ci.Vector3()),
  38532. function (e) {
  38533. var t = J.subVectors(e, this.origin).dot(this.direction)
  38534. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin), J.distanceToSquared(e))
  38535. }),
  38536. distanceSqToSegment:
  38537. ((Z = new Ci.Vector3()),
  38538. (K = new Ci.Vector3()),
  38539. (Q = new Ci.Vector3()),
  38540. function (e, t, i, n) {
  38541. Z.copy(e).add(t).multiplyScalar(0.5), K.copy(t).sub(e).normalize(), Q.copy(this.origin).sub(Z)
  38542. var r,
  38543. o,
  38544. a,
  38545. s,
  38546. l = 0.5 * e.distanceTo(t),
  38547. c = -this.direction.dot(K),
  38548. h = Q.dot(this.direction),
  38549. u = -Q.dot(K),
  38550. d = Q.lengthSq(),
  38551. p = Math.abs(1 - c * c)
  38552. if (0 < p)
  38553. if (((o = c * h - u), (s = l * p), 0 <= (r = c * u - h)))
  38554. if (-s <= o)
  38555. if (o <= s) {
  38556. var f = 1 / p
  38557. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  38558. } else (o = l), (a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d)
  38559. else (o = -l), (a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d)
  38560. else
  38561. a =
  38562. o <= -s
  38563. ? -(r = Math.max(0, -(-c * l + h))) * r + (o = 0 < r ? -l : Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d
  38564. : o <= s
  38565. ? ((r = 0), (o = Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d)
  38566. : -(r = Math.max(0, -(c * l + h))) * r + (o = 0 < r ? l : Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d
  38567. else (o = 0 < c ? -l : l), (a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d)
  38568. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin), n && n.copy(K).multiplyScalar(o).add(Z), a
  38569. }),
  38570. intersectSphere:
  38571. ((X = new Ci.Vector3()),
  38572. function (e, t) {
  38573. X.subVectors(e.center, this.origin)
  38574. var i = X.dot(this.direction),
  38575. n = X.dot(X) - i * i,
  38576. r = e.radius * e.radius
  38577. if (r < n) return null
  38578. var o = Math.sqrt(r - n),
  38579. a = i - o,
  38580. s = i + o
  38581. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  38582. }),
  38583. intersectsSphere: function (e) {
  38584. return this.distanceToPoint(e.center) <= e.radius
  38585. },
  38586. distanceToPlane: function (e) {
  38587. var t = e.normal.dot(this.direction)
  38588. if (0 === t) return 0 === e.distanceToPoint(this.origin) ? 0 : null
  38589. var i = -(this.origin.dot(e.normal) + e.constant) / t
  38590. return 0 <= i ? i : null
  38591. },
  38592. intersectPlane: function (e, t) {
  38593. var i = this.distanceToPlane(e)
  38594. return null === i ? null : this.at(i, t)
  38595. },
  38596. intersectsPlane: function (e) {
  38597. var t = e.distanceToPoint(this.origin)
  38598. return 0 === t || e.normal.dot(this.direction) * t < 0
  38599. },
  38600. intersectBox: function (e, t) {
  38601. var i,
  38602. n,
  38603. r,
  38604. o,
  38605. a,
  38606. s,
  38607. l = 1 / this.direction.x,
  38608. c = 1 / this.direction.y,
  38609. h = 1 / this.direction.z,
  38610. u = this.origin
  38611. return (
  38612. (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)),
  38613. (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
  38614. ? null
  38615. : ((i < r || i != i) && (i = r),
  38616. (o < n || n != n) && (n = o),
  38617. (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
  38618. ? null
  38619. : ((i < a || i != i) && (i = a), (s < n || n != n) && (n = s), n < 0 ? null : this.at(0 <= i ? i : n, t)))
  38620. )
  38621. },
  38622. intersectsBox:
  38623. ((q = new Ci.Vector3()),
  38624. function (e) {
  38625. return null !== this.intersectBox(e, q)
  38626. }),
  38627. intersectTriangle:
  38628. ((G = new Ci.Vector3()),
  38629. (W = new Ci.Vector3()),
  38630. (j = new Ci.Vector3()),
  38631. (Y = new Ci.Vector3()),
  38632. function (e, t, i, n, r) {
  38633. W.subVectors(t, e), j.subVectors(i, e), Y.crossVectors(W, j)
  38634. var o,
  38635. a = this.direction.dot(Y)
  38636. if (0 < a) {
  38637. if (n) return null
  38638. o = 1
  38639. } else {
  38640. if (!(a < 0)) return null
  38641. ;(o = -1), (a = -a)
  38642. }
  38643. G.subVectors(this.origin, e)
  38644. var s = o * this.direction.dot(j.crossVectors(G, j))
  38645. if (s < 0) return null
  38646. var l = o * this.direction.dot(W.cross(G))
  38647. if (l < 0) return null
  38648. if (a < s + l) return null
  38649. var c = -o * G.dot(Y)
  38650. return c < 0 ? null : this.at(c / a, r)
  38651. }),
  38652. applyMatrix4: function (e) {
  38653. return this.direction.add(this.origin).applyMatrix4(e), this.origin.applyMatrix4(e), this.direction.sub(this.origin), this.direction.normalize(), this
  38654. },
  38655. equals: function (e) {
  38656. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  38657. }
  38658. }),
  38659. (Ci.Sphere = function (e, t) {
  38660. ;(this.center = void 0 !== e ? e : new Ci.Vector3()), (this.radius = void 0 !== t ? t : 0)
  38661. }),
  38662. (Ci.Sphere.prototype = {
  38663. constructor: Ci.Sphere,
  38664. set: function (e, t) {
  38665. return this.center.copy(e), (this.radius = t), this
  38666. },
  38667. setFromPoints:
  38668. ((z = new Ci.Box3()),
  38669. function (e, t) {
  38670. var i = this.center
  38671. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i)
  38672. for (var n = 0, r = 0, o = e.length; r < o; r++) n = Math.max(n, i.distanceToSquared(e[r]))
  38673. return (this.radius = Math.sqrt(n)), this
  38674. }),
  38675. clone: function () {
  38676. return new this.constructor().copy(this)
  38677. },
  38678. copy: function (e) {
  38679. return this.center.copy(e.center), (this.radius = e.radius), this
  38680. },
  38681. empty: function () {
  38682. return this.radius <= 0
  38683. },
  38684. containsPoint: function (e) {
  38685. return e.distanceToSquared(this.center) <= this.radius * this.radius
  38686. },
  38687. distanceToPoint: function (e) {
  38688. return e.distanceTo(this.center) - this.radius
  38689. },
  38690. intersectsSphere: function (e) {
  38691. var t = this.radius + e.radius
  38692. return e.center.distanceToSquared(this.center) <= t * t
  38693. },
  38694. intersectsBox: function (e) {
  38695. return e.intersectsSphere(this)
  38696. },
  38697. intersectsPlane: function (e) {
  38698. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  38699. },
  38700. clampPoint: function (e, t) {
  38701. var i = this.center.distanceToSquared(e),
  38702. n = t || new Ci.Vector3()
  38703. return n.copy(e), i > this.radius * this.radius && (n.sub(this.center).normalize(), n.multiplyScalar(this.radius).add(this.center)), n
  38704. },
  38705. getBoundingBox: function (e) {
  38706. var t = e || new Ci.Box3()
  38707. return t.set(this.center, this.center), t.expandByScalar(this.radius), t
  38708. },
  38709. applyMatrix4: function (e) {
  38710. return this.center.applyMatrix4(e), (this.radius = this.radius * e.getMaxScaleOnAxis()), this
  38711. },
  38712. translate: function (e) {
  38713. return this.center.add(e), this
  38714. },
  38715. equals: function (e) {
  38716. return e.center.equals(this.center) && e.radius === this.radius
  38717. }
  38718. }),
  38719. (Ci.Frustum = function (e, t, i, n, r, o) {
  38720. this.planes = [
  38721. void 0 !== e ? e : new Ci.Plane(),
  38722. void 0 !== t ? t : new Ci.Plane(),
  38723. void 0 !== i ? i : new Ci.Plane(),
  38724. void 0 !== n ? n : new Ci.Plane(),
  38725. void 0 !== r ? r : new Ci.Plane(),
  38726. void 0 !== o ? o : new Ci.Plane()
  38727. ]
  38728. }),
  38729. (Ci.Frustum.prototype = {
  38730. constructor: Ci.Frustum,
  38731. set: function (e, t, i, n, r, o) {
  38732. var a = this.planes
  38733. 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
  38734. },
  38735. clone: function () {
  38736. return new this.constructor().copy(this)
  38737. },
  38738. copy: function (e) {
  38739. for (var t = this.planes, i = 0; i < 6; i++) t[i].copy(e.planes[i])
  38740. return this
  38741. },
  38742. setFromMatrix: function (e) {
  38743. var t = this.planes,
  38744. i = e.elements,
  38745. n = i[0],
  38746. r = i[1],
  38747. o = i[2],
  38748. a = i[3],
  38749. s = i[4],
  38750. l = i[5],
  38751. c = i[6],
  38752. h = i[7],
  38753. u = i[8],
  38754. d = i[9],
  38755. p = i[10],
  38756. f = i[11],
  38757. g = i[12],
  38758. m = i[13],
  38759. v = i[14],
  38760. y = i[15]
  38761. return (
  38762. t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  38763. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  38764. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  38765. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  38766. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  38767. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  38768. this
  38769. )
  38770. },
  38771. intersectsObject:
  38772. ((H = new Ci.Sphere()),
  38773. function (e) {
  38774. var t = e.geometry
  38775. return null === t.boundingSphere && t.computeBoundingSphere(), H.copy(t.boundingSphere), H.applyMatrix4(e.matrixWorld), this.intersectsSphere(H)
  38776. }),
  38777. intersectsSphere: function (e) {
  38778. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  38779. if (t[r].distanceToPoint(i) < n) return !1
  38780. }
  38781. return !0
  38782. },
  38783. intersectsBox:
  38784. ((k = new Ci.Vector3()),
  38785. (U = new Ci.Vector3()),
  38786. function (e) {
  38787. for (var t = this.planes, i = 0; i < 6; i++) {
  38788. var n = t[i]
  38789. ;(k.x = 0 < n.normal.x ? e.min.x : e.max.x),
  38790. (U.x = 0 < n.normal.x ? e.max.x : e.min.x),
  38791. (k.y = 0 < n.normal.y ? e.min.y : e.max.y),
  38792. (U.y = 0 < n.normal.y ? e.max.y : e.min.y),
  38793. (k.z = 0 < n.normal.z ? e.min.z : e.max.z),
  38794. (U.z = 0 < n.normal.z ? e.max.z : e.min.z)
  38795. var r = n.distanceToPoint(k),
  38796. o = n.distanceToPoint(U)
  38797. if (r < 0 && o < 0) return !1
  38798. }
  38799. return !0
  38800. }),
  38801. containsPoint: function (e) {
  38802. for (var t = this.planes, i = 0; i < 6; i++) if (t[i].distanceToPoint(e) < 0) return !1
  38803. return !0
  38804. }
  38805. }),
  38806. (Ci.Plane = function (e, t) {
  38807. ;(this.normal = void 0 !== e ? e : new Ci.Vector3(1, 0, 0)), (this.constant = void 0 !== t ? t : 0)
  38808. }),
  38809. (Ci.Plane.prototype = {
  38810. constructor: Ci.Plane,
  38811. set: function (e, t) {
  38812. return this.normal.copy(e), (this.constant = t), this
  38813. },
  38814. setComponents: function (e, t, i, n) {
  38815. return this.normal.set(e, t, i), (this.constant = n), this
  38816. },
  38817. setFromNormalAndCoplanarPoint: function (e, t) {
  38818. return this.normal.copy(e), (this.constant = -t.dot(this.normal)), this
  38819. },
  38820. setFromCoplanarPoints:
  38821. ((B = new Ci.Vector3()),
  38822. (V = new Ci.Vector3()),
  38823. function (e, t, i) {
  38824. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize()
  38825. return this.setFromNormalAndCoplanarPoint(n, e), this
  38826. }),
  38827. clone: function () {
  38828. return new this.constructor().copy(this)
  38829. },
  38830. copy: function (e) {
  38831. return this.normal.copy(e.normal), (this.constant = e.constant), this
  38832. },
  38833. normalize: function () {
  38834. var e = 1 / this.normal.length()
  38835. return this.normal.multiplyScalar(e), (this.constant *= e), this
  38836. },
  38837. negate: function () {
  38838. return (this.constant *= -1), this.normal.negate(), this
  38839. },
  38840. distanceToPoint: function (e) {
  38841. return this.normal.dot(e) + this.constant
  38842. },
  38843. distanceToSphere: function (e) {
  38844. return this.distanceToPoint(e.center) - e.radius
  38845. },
  38846. projectPoint: function (e, t) {
  38847. return this.orthoPoint(e, t).sub(e).negate()
  38848. },
  38849. orthoPoint: function (e, t) {
  38850. var i = this.distanceToPoint(e)
  38851. return (t || new Ci.Vector3()).copy(this.normal).multiplyScalar(i)
  38852. },
  38853. intersectLine:
  38854. ((F = new Ci.Vector3()),
  38855. function (e, t) {
  38856. var i = t || new Ci.Vector3(),
  38857. n = e.delta(F),
  38858. r = this.normal.dot(n)
  38859. if (0 !== r) {
  38860. var o = -(e.start.dot(this.normal) + this.constant) / r
  38861. if (!(o < 0 || 1 < o)) return i.copy(n).multiplyScalar(o).add(e.start)
  38862. } else if (0 === this.distanceToPoint(e.start)) return i.copy(e.start)
  38863. }),
  38864. intersectsLine: function (e) {
  38865. var t = this.distanceToPoint(e.start),
  38866. i = this.distanceToPoint(e.end)
  38867. return (t < 0 && 0 < i) || (i < 0 && 0 < t)
  38868. },
  38869. intersectsBox: function (e) {
  38870. return e.intersectsPlane(this)
  38871. },
  38872. intersectsSphere: function (e) {
  38873. return e.intersectsPlane(this)
  38874. },
  38875. coplanarPoint: function (e) {
  38876. return (e || new Ci.Vector3()).copy(this.normal).multiplyScalar(-this.constant)
  38877. },
  38878. applyMatrix4:
  38879. ((L = new Ci.Vector3()),
  38880. (D = new Ci.Vector3()),
  38881. (N = new Ci.Matrix3()),
  38882. function (e, t) {
  38883. var i = t || N.getNormalMatrix(e),
  38884. n = L.copy(this.normal).applyMatrix3(i),
  38885. r = this.coplanarPoint(D)
  38886. return r.applyMatrix4(e), this.setFromNormalAndCoplanarPoint(n, r), this
  38887. }),
  38888. translate: function (e) {
  38889. return (this.constant = this.constant - e.dot(this.normal)), this
  38890. },
  38891. equals: function (e) {
  38892. return e.normal.equals(this.normal) && e.constant === this.constant
  38893. }
  38894. }),
  38895. (Ci.Spherical = function (e, t, i) {
  38896. return (this.radius = void 0 !== e ? e : 1), (this.phi = void 0 !== t ? t : 0), (this.theta = void 0 !== i ? i : 0), this
  38897. }),
  38898. (Ci.Spherical.prototype = {
  38899. constructor: Ci.Spherical,
  38900. set: function (e, t, i) {
  38901. ;(this.radius = e), (this.phi = t), (this.theta = i)
  38902. },
  38903. clone: function () {
  38904. return new this.constructor().copy(this)
  38905. },
  38906. copy: function (e) {
  38907. return this.radius.copy(e.radius), this.phi.copy(e.phi), this.theta.copy(e.theta), this
  38908. },
  38909. makeSafe: function () {
  38910. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  38911. },
  38912. setFromVector3: function (e) {
  38913. return (
  38914. (this.radius = e.length()),
  38915. 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)))),
  38916. this
  38917. )
  38918. }
  38919. }),
  38920. (Ci.Math = {
  38921. generateUUID:
  38922. ((R = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('')),
  38923. (P = new Array(36)),
  38924. (O = 0),
  38925. function () {
  38926. for (var e = 0; e < 36; e++)
  38927. 8 === e || 13 === e || 18 === e || 23 === e
  38928. ? (P[e] = '-')
  38929. : 14 === e
  38930. ? (P[e] = '4')
  38931. : (O <= 2 && (O = (33554432 + 16777216 * Math.random()) | 0), (M = 15 & O), (O >>= 4), (P[e] = R[19 === e ? (3 & M) | 8 : M]))
  38932. return P.join('')
  38933. }),
  38934. clamp: function (e, t, i) {
  38935. return Math.max(t, Math.min(i, e))
  38936. },
  38937. euclideanModulo: function (e, t) {
  38938. return ((e % t) + t) % t
  38939. },
  38940. mapLinear: function (e, t, i, n, r) {
  38941. return n + ((e - t) * (r - n)) / (i - t)
  38942. },
  38943. smoothstep: function (e, t, i) {
  38944. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  38945. },
  38946. smootherstep: function (e, t, i) {
  38947. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  38948. },
  38949. random16: function () {
  38950. return console.warn('THREE.Math.random16() has been deprecated. Use Math.random() instead.'), Math.random()
  38951. },
  38952. randInt: function (e, t) {
  38953. return e + Math.floor(Math.random() * (t - e + 1))
  38954. },
  38955. randFloat: function (e, t) {
  38956. return e + Math.random() * (t - e)
  38957. },
  38958. randFloatSpread: function (e) {
  38959. return e * (0.5 - Math.random())
  38960. },
  38961. degToRad:
  38962. ((S = Math.PI / 180),
  38963. function (e) {
  38964. return e * S
  38965. }),
  38966. radToDeg:
  38967. ((x = 180 / Math.PI),
  38968. function (e) {
  38969. return e * x
  38970. }),
  38971. isPowerOfTwo: function (e) {
  38972. return 0 == (e & (e - 1)) && 0 !== e
  38973. },
  38974. nearestPowerOfTwo: function (e) {
  38975. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  38976. },
  38977. nextPowerOfTwo: function (e) {
  38978. return e--, (e |= e >> 1), (e |= e >> 2), (e |= e >> 4), (e |= e >> 8), (e |= e >> 16), ++e
  38979. }
  38980. }),
  38981. (Ci.Spline = function (e) {
  38982. function t(e, t, i, n, r, o, a) {
  38983. var s = 0.5 * (i - e),
  38984. l = 0.5 * (n - t)
  38985. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  38986. }
  38987. this.points = e
  38988. var i,
  38989. n,
  38990. r,
  38991. o,
  38992. a,
  38993. s,
  38994. l,
  38995. c,
  38996. h,
  38997. u = [],
  38998. d = {
  38999. x: 0,
  39000. y: 0,
  39001. z: 0
  39002. }
  39003. ;(this.initFromArray = function (e) {
  39004. this.points = []
  39005. for (var t = 0; t < e.length; t++)
  39006. this.points[t] = {
  39007. x: e[t][0],
  39008. y: e[t][1],
  39009. z: e[t][2]
  39010. }
  39011. }),
  39012. (this.getPoint = function (e) {
  39013. return (
  39014. (i = (this.points.length - 1) * e),
  39015. (n = Math.floor(i)),
  39016. (r = i - n),
  39017. (u[0] = 0 === n ? n : n - 1),
  39018. (u[1] = n),
  39019. (u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1),
  39020. (u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2),
  39021. (s = this.points[u[0]]),
  39022. (l = this.points[u[1]]),
  39023. (c = this.points[u[2]]),
  39024. (h = this.points[u[3]]),
  39025. (a = r * (o = r * r)),
  39026. (d.x = t(s.x, l.x, c.x, h.x, r, o, a)),
  39027. (d.y = t(s.y, l.y, c.y, h.y, r, o, a)),
  39028. (d.z = t(s.z, l.z, c.z, h.z, r, o, a)),
  39029. d
  39030. )
  39031. }),
  39032. (this.getControlPointsArray = function () {
  39033. var e,
  39034. t,
  39035. i = this.points.length,
  39036. n = []
  39037. for (e = 0; e < i; e++) (t = this.points[e]), (n[e] = [t.x, t.y, t.z])
  39038. return n
  39039. }),
  39040. (this.getLength = function (e) {
  39041. var t,
  39042. i,
  39043. n,
  39044. r,
  39045. o = 0,
  39046. a = 0,
  39047. s = 0,
  39048. l = new Ci.Vector3(),
  39049. c = new Ci.Vector3(),
  39050. h = [],
  39051. u = 0
  39052. for (h[0] = 0, e = e || 100, n = this.points.length * e, l.copy(this.points[0]), t = 1; t < n; t++)
  39053. (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))
  39054. return (
  39055. (h[h.length] = u),
  39056. {
  39057. chunks: h,
  39058. total: u
  39059. }
  39060. )
  39061. }),
  39062. (this.reparametrizeByArcLength = function (e) {
  39063. var t,
  39064. i,
  39065. n,
  39066. r,
  39067. o,
  39068. a,
  39069. s,
  39070. l,
  39071. c = [],
  39072. h = new Ci.Vector3(),
  39073. u = this.getLength()
  39074. for (c.push(h.copy(this.points[0]).clone()), t = 1; t < this.points.length; t++) {
  39075. 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++)
  39076. (n = r + i * (1 / s) * (o - r)), (l = this.getPoint(n)), c.push(h.copy(l).clone())
  39077. c.push(h.copy(this.points[t]).clone())
  39078. }
  39079. this.points = c
  39080. })
  39081. }),
  39082. (Ci.Triangle = function (e, t, i) {
  39083. ;(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())
  39084. }),
  39085. (Ci.Triangle.normal =
  39086. ((T = new Ci.Vector3()),
  39087. function (e, t, i, n) {
  39088. var r = n || new Ci.Vector3()
  39089. r.subVectors(i, t), T.subVectors(e, t), r.cross(T)
  39090. var o = r.lengthSq()
  39091. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  39092. })),
  39093. (Ci.Triangle.barycoordFromPoint =
  39094. ((_ = new Ci.Vector3()),
  39095. (b = new Ci.Vector3()),
  39096. (w = new Ci.Vector3()),
  39097. function (e, t, i, n, r) {
  39098. _.subVectors(n, t), b.subVectors(i, t), w.subVectors(e, t)
  39099. var o = _.dot(_),
  39100. a = _.dot(b),
  39101. s = _.dot(w),
  39102. l = b.dot(b),
  39103. c = b.dot(w),
  39104. h = o * l - a * a,
  39105. u = r || new Ci.Vector3()
  39106. if (0 == h) return u.set(-2, -1, -1)
  39107. var d = 1 / h,
  39108. p = (l * s - a * c) * d,
  39109. f = (o * c - a * s) * d
  39110. return u.set(1 - p - f, f, p)
  39111. })),
  39112. (Ci.Triangle.containsPoint =
  39113. ((E = new Ci.Vector3()),
  39114. function (e, t, i, n) {
  39115. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E)
  39116. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  39117. })),
  39118. (Ci.Triangle.prototype = {
  39119. constructor: Ci.Triangle,
  39120. set: function (e, t, i) {
  39121. return this.a.copy(e), this.b.copy(t), this.c.copy(i), this
  39122. },
  39123. setFromPointsAndIndices: function (e, t, i, n) {
  39124. return this.a.copy(e[t]), this.b.copy(e[i]), this.c.copy(e[n]), this
  39125. },
  39126. clone: function () {
  39127. return new this.constructor().copy(this)
  39128. },
  39129. copy: function (e) {
  39130. return this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this
  39131. },
  39132. area:
  39133. ((C = new Ci.Vector3()),
  39134. (I = new Ci.Vector3()),
  39135. function () {
  39136. return C.subVectors(this.c, this.b), I.subVectors(this.a, this.b), 0.5 * C.cross(I).length()
  39137. }),
  39138. midpoint: function (e) {
  39139. return (e || new Ci.Vector3())
  39140. .addVectors(this.a, this.b)
  39141. .add(this.c)
  39142. .multiplyScalar(1 / 3)
  39143. },
  39144. normal: function (e) {
  39145. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  39146. },
  39147. plane: function (e) {
  39148. return (e || new Ci.Plane()).setFromCoplanarPoints(this.a, this.b, this.c)
  39149. },
  39150. barycoordFromPoint: function (e, t) {
  39151. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  39152. },
  39153. containsPoint: function (e) {
  39154. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  39155. },
  39156. equals: function (e) {
  39157. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  39158. }
  39159. }),
  39160. (Ci.Interpolant = function (e, t, i, n) {
  39161. ;(this.parameterPositions = e), (this._cachedIndex = 0), (this.resultBuffer = void 0 !== n ? n : new t.constructor(i)), (this.sampleValues = t), (this.valueSize = i)
  39162. }),
  39163. (Ci.Interpolant.prototype = {
  39164. constructor: Ci.Interpolant,
  39165. evaluate: function (e) {
  39166. var t = this.parameterPositions,
  39167. i = this._cachedIndex,
  39168. n = t[i],
  39169. r = t[i - 1]
  39170. e: {
  39171. t: {
  39172. var o
  39173. i: {
  39174. n: if (!(e < n)) {
  39175. for (var a = i + 2; ; ) {
  39176. if (void 0 === n) {
  39177. if (e < r) break n
  39178. return (i = t.length), (this._cachedIndex = i), this.afterEnd_(i - 1, e, r)
  39179. }
  39180. if (i === a) break
  39181. if (((r = n), e < (n = t[++i]))) break t
  39182. }
  39183. o = t.length
  39184. break i
  39185. }
  39186. if (r <= e) break e
  39187. var s = t[1]
  39188. e < s && ((i = 2), (r = s))
  39189. for (a = i - 2; ; ) {
  39190. if (void 0 === r) return (this._cachedIndex = 0), this.beforeStart_(0, e, n)
  39191. if (i === a) break
  39192. if (((n = r), (r = t[--i - 1]) <= e)) break t
  39193. }
  39194. ;(o = i), (i = 0)
  39195. }
  39196. for (; i < o; ) {
  39197. var l = (i + o) >>> 1
  39198. e < t[l] ? (o = l) : (i = 1 + l)
  39199. }
  39200. if (((n = t[i]), void 0 === (r = t[i - 1]))) return (this._cachedIndex = 0), this.beforeStart_(0, e, n)
  39201. if (void 0 === n) return (i = t.length), (this._cachedIndex = i), this.afterEnd_(i - 1, r, e)
  39202. }
  39203. ;(this._cachedIndex = i), this.intervalChanged_(i, r, n)
  39204. }
  39205. return this.interpolate_(i, r, e, n)
  39206. },
  39207. settings: null,
  39208. DefaultSettings_: {},
  39209. getSettings_: function () {
  39210. return this.settings || this.DefaultSettings_
  39211. },
  39212. copySampleValue_: function (e) {
  39213. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o) t[o] = i[r + o]
  39214. return t
  39215. },
  39216. interpolate_: function (e, t, i, n) {
  39217. throw new Error('call to abstract method')
  39218. },
  39219. intervalChanged_: function (e, t, i) {}
  39220. }),
  39221. Object.assign(Ci.Interpolant.prototype, {
  39222. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  39223. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  39224. }),
  39225. (Ci.CubicInterpolant = function (e, t, i, n) {
  39226. Ci.Interpolant.call(this, e, t, i, n), (this._weightPrev = -0), (this._offsetPrev = -0), (this._weightNext = -0), (this._offsetNext = -0)
  39227. }),
  39228. (Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  39229. constructor: Ci.CubicInterpolant,
  39230. DefaultSettings_: {
  39231. endingStart: Ci.ZeroCurvatureEnding,
  39232. endingEnd: Ci.ZeroCurvatureEnding
  39233. },
  39234. intervalChanged_: function (e, t, i) {
  39235. var n = this.parameterPositions,
  39236. r = e - 2,
  39237. o = e + 1,
  39238. a = n[r],
  39239. s = n[o]
  39240. if (void 0 === a)
  39241. switch (this.getSettings_().endingStart) {
  39242. case Ci.ZeroSlopeEnding:
  39243. ;(r = e), (a = 2 * t - i)
  39244. break
  39245. case Ci.WrapAroundEnding:
  39246. a = t + n[(r = n.length - 2)] - n[r + 1]
  39247. break
  39248. default:
  39249. ;(r = e), (a = i)
  39250. }
  39251. if (void 0 === s)
  39252. switch (this.getSettings_().endingEnd) {
  39253. case Ci.ZeroSlopeEnding:
  39254. ;(o = e), (s = 2 * i - t)
  39255. break
  39256. case Ci.WrapAroundEnding:
  39257. s = i + n[(o = 1)] - n[0]
  39258. break
  39259. default:
  39260. ;(o = e - 1), (s = t)
  39261. }
  39262. var l = 0.5 * (i - t),
  39263. c = this.valueSize
  39264. ;(this._weightPrev = l / (t - a)), (this._weightNext = l / (s - i)), (this._offsetPrev = r * c), (this._offsetNext = o * c)
  39265. },
  39266. interpolate_: function (e, t, i, n) {
  39267. for (
  39268. var r = this.resultBuffer,
  39269. o = this.sampleValues,
  39270. a = this.valueSize,
  39271. s = e * a,
  39272. l = s - a,
  39273. c = this._offsetPrev,
  39274. h = this._offsetNext,
  39275. u = this._weightPrev,
  39276. d = this._weightNext,
  39277. p = (i - t) / (n - t),
  39278. f = p * p,
  39279. g = f * p,
  39280. m = -u * g + 2 * u * f - u * p,
  39281. v = (1 + u) * g + (-1.5 - 2 * u) * f + (-0.5 + u) * p + 1,
  39282. y = (-1 - d) * g + (1.5 + d) * f + 0.5 * p,
  39283. A = d * g - d * f,
  39284. C = 0;
  39285. C !== a;
  39286. ++C
  39287. )
  39288. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C]
  39289. return r
  39290. }
  39291. })),
  39292. (Ci.DiscreteInterpolant = function (e, t, i, n) {
  39293. Ci.Interpolant.call(this, e, t, i, n)
  39294. }),
  39295. (Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  39296. constructor: Ci.DiscreteInterpolant,
  39297. interpolate_: function (e, t, i, n) {
  39298. return this.copySampleValue_(e - 1)
  39299. }
  39300. })),
  39301. (Ci.LinearInterpolant = function (e, t, i, n) {
  39302. Ci.Interpolant.call(this, e, t, i, n)
  39303. }),
  39304. (Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  39305. constructor: Ci.LinearInterpolant,
  39306. interpolate_: function (e, t, i, n) {
  39307. 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)
  39308. r[u] = o[l + u] * h + o[s + u] * c
  39309. return r
  39310. }
  39311. })),
  39312. (Ci.QuaternionLinearInterpolant = function (e, t, i, n) {
  39313. Ci.Interpolant.call(this, e, t, i, n)
  39314. }),
  39315. (Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  39316. constructor: Ci.QuaternionLinearInterpolant,
  39317. interpolate_: function (e, t, i, n) {
  39318. 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)
  39319. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l)
  39320. return r
  39321. }
  39322. })),
  39323. (Ci.Clock = function (e) {
  39324. ;(this.autoStart = void 0 === e || e), (this.startTime = 0), (this.oldTime = 0), (this.elapsedTime = 0), (this.running = !1)
  39325. }),
  39326. (Ci.Clock.prototype = {
  39327. constructor: Ci.Clock,
  39328. start: function () {
  39329. ;(this.startTime = performance.now()), (this.oldTime = this.startTime), (this.running = !0)
  39330. },
  39331. stop: function () {
  39332. this.getElapsedTime(), (this.running = !1)
  39333. },
  39334. getElapsedTime: function () {
  39335. return this.getDelta(), this.elapsedTime
  39336. },
  39337. getDelta: function () {
  39338. var e = 0
  39339. if ((this.autoStart && !this.running && this.start(), this.running)) {
  39340. var t = performance.now()
  39341. ;(e = 0.001 * (t - this.oldTime)), (this.oldTime = t), (this.elapsedTime += e)
  39342. }
  39343. return e
  39344. }
  39345. }),
  39346. (Ci.EventDispatcher = function () {}),
  39347. (Ci.EventDispatcher.prototype = {
  39348. constructor: Ci.EventDispatcher,
  39349. apply: function (e) {
  39350. ;(e.addEventListener = Ci.EventDispatcher.prototype.addEventListener),
  39351. (e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener),
  39352. (e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener),
  39353. (e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent)
  39354. },
  39355. addEventListener: function (e, t) {
  39356. void 0 === this._listeners && (this._listeners = {})
  39357. var i = this._listeners
  39358. void 0 === i[e] && (i[e] = []), -1 === i[e].indexOf(t) && i[e].push(t)
  39359. },
  39360. hasEventListener: function (e, t) {
  39361. if (void 0 === this._listeners) return !1
  39362. var i = this._listeners
  39363. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  39364. },
  39365. removeEventListener: function (e, t) {
  39366. if (void 0 !== this._listeners) {
  39367. var i = this._listeners[e]
  39368. if (void 0 !== i) {
  39369. var n = i.indexOf(t)
  39370. ;-1 !== n && i.splice(n, 1)
  39371. }
  39372. }
  39373. },
  39374. dispatchEvent: function (e) {
  39375. if (void 0 !== this._listeners) {
  39376. var t = this._listeners[e.type]
  39377. if (void 0 !== t) {
  39378. e.target = this
  39379. for (var i = [], n = t.length, r = 0; r < n; r++) i[r] = t[r]
  39380. for (r = 0; r < n; r++) i[r].call(this, e)
  39381. }
  39382. }
  39383. }
  39384. }),
  39385. (Ci.Layers = function () {
  39386. this.mask = 1
  39387. }),
  39388. (Ci.Layers.prototype = {
  39389. constructor: Ci.Layers,
  39390. set: function (e) {
  39391. this.mask = 1 << e
  39392. },
  39393. enable: function (e) {
  39394. this.mask |= 1 << e
  39395. },
  39396. toggle: function (e) {
  39397. this.mask ^= 1 << e
  39398. },
  39399. disable: function (e) {
  39400. this.mask &= ~(1 << e)
  39401. },
  39402. test: function (e) {
  39403. return 0 != (this.mask & e.mask)
  39404. }
  39405. }),
  39406. ((A = Ci).Raycaster = function (e, t, i, n) {
  39407. ;(this.ray = new A.Ray(e, t)),
  39408. (this.near = i || 0),
  39409. (this.far = n || 1 / 0),
  39410. (this.params = {
  39411. Mesh: {},
  39412. Line: {},
  39413. LOD: {},
  39414. Points: {
  39415. threshold: 1
  39416. },
  39417. Sprite: {}
  39418. }),
  39419. Object.defineProperties(this.params, {
  39420. PointCloud: {
  39421. get: function () {
  39422. return console.warn('THREE.Raycaster: params.PointCloud has been renamed to params.Points.'), this.Points
  39423. }
  39424. }
  39425. })
  39426. }),
  39427. (A.Raycaster.prototype = {
  39428. constructor: A.Raycaster,
  39429. linePrecision: 1,
  39430. set: function (e, t) {
  39431. this.ray.set(e, t)
  39432. },
  39433. setFromCamera: function (e, t) {
  39434. t instanceof A.PerspectiveCamera
  39435. ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld), this.ray.direction.set(e.x, e.y, 0.5).unproject(t).sub(this.ray.origin).normalize())
  39436. : t instanceof A.OrthographicCamera
  39437. ? (this.ray.origin.set(e.x, e.y, -1).unproject(t), this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld))
  39438. : console.error('THREE.Raycaster: Unsupported camera type.')
  39439. },
  39440. intersectObject: function (e, t) {
  39441. var i = []
  39442. return Ei(e, this, i, t), i.sort(Ii), i
  39443. },
  39444. intersectObjects: function (e, t) {
  39445. var i = []
  39446. if (!1 === Array.isArray(e)) return console.warn('THREE.Raycaster.intersectObjects: objects is not an Array.'), i
  39447. for (var n = 0, r = e.length; n < r; n++) Ei(e[n], this, i, t)
  39448. return i.sort(Ii), i
  39449. }
  39450. }),
  39451. (Ci.Object3D = function () {
  39452. Object.defineProperty(this, 'id', {
  39453. value: Ci.Object3DIdCount++
  39454. }),
  39455. (this.uuid = Ci.Math.generateUUID()),
  39456. (this.name = ''),
  39457. (this.type = 'Object3D'),
  39458. (this.parent = null),
  39459. (this.children = []),
  39460. (this.up = Ci.Object3D.DefaultUp.clone())
  39461. var e = new Ci.Vector3(),
  39462. t = new Ci.Euler(),
  39463. i = new Ci.Quaternion(),
  39464. n = new Ci.Vector3(1, 1, 1)
  39465. t.onChange(function () {
  39466. i.setFromEuler(t, !1)
  39467. }),
  39468. i.onChange(function () {
  39469. t.setFromQuaternion(i, void 0, !1)
  39470. }),
  39471. Object.defineProperties(this, {
  39472. position: {
  39473. enumerable: !0,
  39474. value: e
  39475. },
  39476. rotation: {
  39477. enumerable: !0,
  39478. value: t
  39479. },
  39480. quaternion: {
  39481. enumerable: !0,
  39482. value: i
  39483. },
  39484. scale: {
  39485. enumerable: !0,
  39486. value: n
  39487. },
  39488. modelViewMatrix: {
  39489. value: new Ci.Matrix4()
  39490. },
  39491. normalMatrix: {
  39492. value: new Ci.Matrix3()
  39493. }
  39494. }),
  39495. (this.rotationAutoUpdate = !0),
  39496. (this.matrix = new Ci.Matrix4()),
  39497. (this.matrixWorld = new Ci.Matrix4()),
  39498. (this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate),
  39499. (this.matrixWorldNeedsUpdate = !1),
  39500. (this.layers = new Ci.Layers()),
  39501. (this.visible = !0),
  39502. (this.castShadow = !1),
  39503. (this.receiveShadow = !1),
  39504. (this.frustumCulled = !0),
  39505. (this.renderOrder = 0),
  39506. (this.userData = {})
  39507. }),
  39508. (Ci.Object3D.DefaultUp = new Ci.Vector3(0, 1, 0)),
  39509. (Ci.Object3D.DefaultMatrixAutoUpdate = !0),
  39510. (Ci.Object3D.prototype = {
  39511. constructor: Ci.Object3D,
  39512. applyMatrix: function (e) {
  39513. this.matrix.multiplyMatrices(e, this.matrix), this.matrix.decompose(this.position, this.quaternion, this.scale)
  39514. },
  39515. setRotationFromAxisAngle: function (e, t) {
  39516. this.quaternion.setFromAxisAngle(e, t)
  39517. },
  39518. setRotationFromEuler: function (e) {
  39519. this.quaternion.setFromEuler(e, !0)
  39520. },
  39521. setRotationFromMatrix: function (e) {
  39522. this.quaternion.setFromRotationMatrix(e)
  39523. },
  39524. setRotationFromQuaternion: function (e) {
  39525. this.quaternion.copy(e)
  39526. },
  39527. rotateOnAxis:
  39528. ((y = new Ci.Quaternion()),
  39529. function (e, t) {
  39530. return y.setFromAxisAngle(e, t), this.quaternion.multiply(y), this
  39531. }),
  39532. rotateX:
  39533. ((v = new Ci.Vector3(1, 0, 0)),
  39534. function (e) {
  39535. return this.rotateOnAxis(v, e)
  39536. }),
  39537. rotateY:
  39538. ((m = new Ci.Vector3(0, 1, 0)),
  39539. function (e) {
  39540. return this.rotateOnAxis(m, e)
  39541. }),
  39542. rotateZ:
  39543. ((g = new Ci.Vector3(0, 0, 1)),
  39544. function (e) {
  39545. return this.rotateOnAxis(g, e)
  39546. }),
  39547. translateOnAxis:
  39548. ((f = new Ci.Vector3()),
  39549. function (e, t) {
  39550. return f.copy(e).applyQuaternion(this.quaternion), this.position.add(f.multiplyScalar(t)), this
  39551. }),
  39552. translateX:
  39553. ((p = new Ci.Vector3(1, 0, 0)),
  39554. function (e) {
  39555. return this.translateOnAxis(p, e)
  39556. }),
  39557. translateY:
  39558. ((d = new Ci.Vector3(0, 1, 0)),
  39559. function (e) {
  39560. return this.translateOnAxis(d, e)
  39561. }),
  39562. translateZ:
  39563. ((u = new Ci.Vector3(0, 0, 1)),
  39564. function (e) {
  39565. return this.translateOnAxis(u, e)
  39566. }),
  39567. localToWorld: function (e) {
  39568. return e.applyMatrix4(this.matrixWorld)
  39569. },
  39570. worldToLocal:
  39571. ((h = new Ci.Matrix4()),
  39572. function (e) {
  39573. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  39574. }),
  39575. lookAt:
  39576. ((c = new Ci.Matrix4()),
  39577. function (e) {
  39578. c.lookAt(e, this.position, this.up), this.quaternion.setFromRotationMatrix(c)
  39579. }),
  39580. add: function (e) {
  39581. if (1 < arguments.length) {
  39582. for (var t = 0; t < arguments.length; t++) this.add(arguments[t])
  39583. return this
  39584. }
  39585. return (
  39586. e === this
  39587. ? console.error("THREE.Object3D.add: object can't be added as a child of itself.", e)
  39588. : e instanceof Ci.Object3D
  39589. ? (null !== e.parent && e.parent.remove(e),
  39590. (e.parent = this),
  39591. e.dispatchEvent({
  39592. type: 'added'
  39593. }),
  39594. this.children.push(e))
  39595. : console.error('THREE.Object3D.add: object not an instance of THREE.Object3D.', e),
  39596. this
  39597. )
  39598. },
  39599. remove: function (e) {
  39600. if (1 < arguments.length) for (var t = 0; t < arguments.length; t++) this.remove(arguments[t])
  39601. var i = this.children.indexOf(e)
  39602. ;-1 !== i &&
  39603. ((e.parent = null),
  39604. e.dispatchEvent({
  39605. type: 'removed'
  39606. }),
  39607. this.children.splice(i, 1))
  39608. },
  39609. getObjectById: function (e) {
  39610. return this.getObjectByProperty('id', e)
  39611. },
  39612. getObjectByName: function (e) {
  39613. return this.getObjectByProperty('name', e)
  39614. },
  39615. getObjectByProperty: function (e, t) {
  39616. if (this[e] === t) return this
  39617. for (var i = 0, n = this.children.length; i < n; i++) {
  39618. var r = this.children[i].getObjectByProperty(e, t)
  39619. if (void 0 !== r) return r
  39620. }
  39621. },
  39622. getWorldPosition: function (e) {
  39623. var t = e || new Ci.Vector3()
  39624. return this.updateMatrixWorld(!0), t.setFromMatrixPosition(this.matrixWorld)
  39625. },
  39626. getWorldQuaternion:
  39627. ((s = new Ci.Vector3()),
  39628. (l = new Ci.Vector3()),
  39629. function (e) {
  39630. var t = e || new Ci.Quaternion()
  39631. return this.updateMatrixWorld(!0), this.matrixWorld.decompose(s, t, l), t
  39632. }),
  39633. getWorldRotation:
  39634. ((a = new Ci.Quaternion()),
  39635. function (e) {
  39636. var t = e || new Ci.Euler()
  39637. return this.getWorldQuaternion(a), t.setFromQuaternion(a, this.rotation.order, !1)
  39638. }),
  39639. getWorldScale:
  39640. ((r = new Ci.Vector3()),
  39641. (o = new Ci.Quaternion()),
  39642. function (e) {
  39643. var t = e || new Ci.Vector3()
  39644. return this.updateMatrixWorld(!0), this.matrixWorld.decompose(r, o, t), t
  39645. }),
  39646. getWorldDirection:
  39647. ((n = new Ci.Quaternion()),
  39648. function (e) {
  39649. var t = e || new Ci.Vector3()
  39650. return this.getWorldQuaternion(n), t.set(0, 0, 1).applyQuaternion(n)
  39651. }),
  39652. raycast: function () {},
  39653. traverse: function (e) {
  39654. e(this)
  39655. for (var t = this.children, i = 0, n = t.length; i < n; i++) t[i].traverse(e)
  39656. },
  39657. traverseVisible: function (e) {
  39658. if (!1 !== this.visible) {
  39659. e(this)
  39660. for (var t = this.children, i = 0, n = t.length; i < n; i++) t[i].traverseVisible(e)
  39661. }
  39662. },
  39663. traverseAncestors: function (e) {
  39664. var t = this.parent
  39665. null !== t && (e(t), t.traverseAncestors(e))
  39666. },
  39667. updateMatrix: function () {
  39668. this.matrix.compose(this.position, this.quaternion, this.scale), (this.matrixWorldNeedsUpdate = !0)
  39669. },
  39670. updateMatrixWorld: function (e) {
  39671. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  39672. (!0 !== this.matrixWorldNeedsUpdate && !0 !== e) ||
  39673. (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix), (e = !(this.matrixWorldNeedsUpdate = !1)))
  39674. for (var t = 0, i = this.children.length; t < i; t++) this.children[t].updateMatrixWorld(e)
  39675. },
  39676. toJSON: function (e) {
  39677. function t(e) {
  39678. var t = []
  39679. for (var i in e) {
  39680. var n = e[i]
  39681. delete n.metadata, t.push(n)
  39682. }
  39683. return t
  39684. }
  39685. var i = void 0 === e,
  39686. n = {}
  39687. i &&
  39688. ((e = {
  39689. geometries: {},
  39690. materials: {},
  39691. textures: {},
  39692. images: {}
  39693. }),
  39694. (n.metadata = {
  39695. version: 4.4,
  39696. type: 'Object',
  39697. generator: 'Object3D.toJSON'
  39698. }))
  39699. var r = {}
  39700. if (
  39701. ((r.uuid = this.uuid),
  39702. (r.type = this.type),
  39703. '' !== this.name && (r.name = this.name),
  39704. '{}' !== JSON.stringify(this.userData) && (r.userData = this.userData),
  39705. !0 === this.castShadow && (r.castShadow = !0),
  39706. !0 === this.receiveShadow && (r.receiveShadow = !0),
  39707. !1 === this.visible && (r.visible = !1),
  39708. (r.matrix = this.matrix.toArray()),
  39709. 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)),
  39710. 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)),
  39711. 0 < this.children.length)
  39712. ) {
  39713. r.children = []
  39714. for (var o = 0; o < this.children.length; o++) r.children.push(this.children[o].toJSON(e).object)
  39715. }
  39716. if (i) {
  39717. var a = t(e.geometries),
  39718. s = t(e.materials),
  39719. l = t(e.textures),
  39720. c = t(e.images)
  39721. 0 < a.length && (n.geometries = a), 0 < s.length && (n.materials = s), 0 < l.length && (n.textures = l), 0 < c.length && (n.images = c)
  39722. }
  39723. return (n.object = r), n
  39724. },
  39725. clone: function (e) {
  39726. return new this.constructor().copy(this, e)
  39727. },
  39728. copy: function (e, t) {
  39729. if (
  39730. (void 0 === t && (t = !0),
  39731. (this.name = e.name),
  39732. this.up.copy(e.up),
  39733. this.position.copy(e.position),
  39734. this.quaternion.copy(e.quaternion),
  39735. this.scale.copy(e.scale),
  39736. (this.rotationAutoUpdate = e.rotationAutoUpdate),
  39737. this.matrix.copy(e.matrix),
  39738. this.matrixWorld.copy(e.matrixWorld),
  39739. (this.matrixAutoUpdate = e.matrixAutoUpdate),
  39740. (this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate),
  39741. (this.visible = e.visible),
  39742. (this.castShadow = e.castShadow),
  39743. (this.receiveShadow = e.receiveShadow),
  39744. (this.frustumCulled = e.frustumCulled),
  39745. (this.renderOrder = e.renderOrder),
  39746. (this.userData = JSON.parse(JSON.stringify(e.userData))),
  39747. !0 === t)
  39748. )
  39749. for (var i = 0; i < e.children.length; i++) {
  39750. var n = e.children[i]
  39751. this.add(n.clone())
  39752. }
  39753. return this
  39754. }
  39755. }),
  39756. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  39757. (Ci.Object3DIdCount = 0),
  39758. (Ci.Face3 = function (e, t, i, n, r, o) {
  39759. ;(this.a = e),
  39760. (this.b = t),
  39761. (this.c = i),
  39762. (this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3()),
  39763. (this.vertexNormals = Array.isArray(n) ? n : []),
  39764. (this.color = r instanceof Ci.Color ? r : new Ci.Color()),
  39765. (this.vertexColors = Array.isArray(r) ? r : []),
  39766. (this.materialIndex = void 0 !== o ? o : 0)
  39767. }),
  39768. (Ci.Face3.prototype = {
  39769. constructor: Ci.Face3,
  39770. clone: function () {
  39771. return new this.constructor().copy(this)
  39772. },
  39773. copy: function (e) {
  39774. ;(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)
  39775. for (var t = 0, i = e.vertexNormals.length; t < i; t++) this.vertexNormals[t] = e.vertexNormals[t].clone()
  39776. for (t = 0, i = e.vertexColors.length; t < i; t++) this.vertexColors[t] = e.vertexColors[t].clone()
  39777. return this
  39778. }
  39779. }),
  39780. (Ci.BufferAttribute = function (e, t) {
  39781. ;(this.uuid = Ci.Math.generateUUID()),
  39782. (this.array = e),
  39783. (this.itemSize = t),
  39784. (this.dynamic = !1),
  39785. (this.updateRange = {
  39786. offset: 0,
  39787. count: -1
  39788. }),
  39789. (this.version = 0)
  39790. }),
  39791. (Ci.BufferAttribute.prototype = {
  39792. constructor: Ci.BufferAttribute,
  39793. get count() {
  39794. return this.array.length / this.itemSize
  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.itemSize = e.itemSize), (this.dynamic = e.dynamic), this
  39804. },
  39805. copyAt: function (e, t, i) {
  39806. ;(e *= this.itemSize), (i *= t.itemSize)
  39807. for (var n = 0, r = this.itemSize; n < r; n++) this.array[e + n] = t.array[i + n]
  39808. return this
  39809. },
  39810. copyArray: function (e) {
  39811. return this.array.set(e), this
  39812. },
  39813. copyColorsArray: function (e) {
  39814. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  39815. var o = e[n]
  39816. 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)
  39817. }
  39818. return this
  39819. },
  39820. copyIndicesArray: function (e) {
  39821. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  39822. var o = e[n]
  39823. ;(t[i++] = o.a), (t[i++] = o.b), (t[i++] = o.c)
  39824. }
  39825. return this
  39826. },
  39827. copyVector2sArray: function (e) {
  39828. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  39829. var o = e[n]
  39830. void 0 === o && (console.warn('THREE.BufferAttribute.copyVector2sArray(): vector is undefined', n), (o = new Ci.Vector2())), (t[i++] = o.x), (t[i++] = o.y)
  39831. }
  39832. return this
  39833. },
  39834. copyVector3sArray: function (e) {
  39835. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  39836. var o = e[n]
  39837. 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)
  39838. }
  39839. return this
  39840. },
  39841. copyVector4sArray: function (e) {
  39842. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  39843. var o = e[n]
  39844. void 0 === o && (console.warn('THREE.BufferAttribute.copyVector4sArray(): vector is undefined', n), (o = new Ci.Vector4())),
  39845. (t[i++] = o.x),
  39846. (t[i++] = o.y),
  39847. (t[i++] = o.z),
  39848. (t[i++] = o.w)
  39849. }
  39850. return this
  39851. },
  39852. set: function (e, t) {
  39853. return void 0 === t && (t = 0), this.array.set(e, t), this
  39854. },
  39855. getX: function (e) {
  39856. return this.array[e * this.itemSize]
  39857. },
  39858. setX: function (e, t) {
  39859. return (this.array[e * this.itemSize] = t), this
  39860. },
  39861. getY: function (e) {
  39862. return this.array[e * this.itemSize + 1]
  39863. },
  39864. setY: function (e, t) {
  39865. return (this.array[e * this.itemSize + 1] = t), this
  39866. },
  39867. getZ: function (e) {
  39868. return this.array[e * this.itemSize + 2]
  39869. },
  39870. setZ: function (e, t) {
  39871. return (this.array[e * this.itemSize + 2] = t), this
  39872. },
  39873. getW: function (e) {
  39874. return this.array[e * this.itemSize + 3]
  39875. },
  39876. setW: function (e, t) {
  39877. return (this.array[e * this.itemSize + 3] = t), this
  39878. },
  39879. setXY: function (e, t, i) {
  39880. return (e *= this.itemSize), (this.array[e + 0] = t), (this.array[e + 1] = i), this
  39881. },
  39882. setXYZ: function (e, t, i, n) {
  39883. return (e *= this.itemSize), (this.array[e + 0] = t), (this.array[e + 1] = i), (this.array[e + 2] = n), this
  39884. },
  39885. setXYZW: function (e, t, i, n, r) {
  39886. 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
  39887. },
  39888. clone: function () {
  39889. return new this.constructor().copy(this)
  39890. }
  39891. }),
  39892. (Ci.Int8Attribute = function (e, t) {
  39893. return new Ci.BufferAttribute(new Int8Array(e), t)
  39894. }),
  39895. (Ci.Uint8Attribute = function (e, t) {
  39896. return new Ci.BufferAttribute(new Uint8Array(e), t)
  39897. }),
  39898. (Ci.Uint8ClampedAttribute = function (e, t) {
  39899. return new Ci.BufferAttribute(new Uint8ClampedArray(e), t)
  39900. }),
  39901. (Ci.Int16Attribute = function (e, t) {
  39902. return new Ci.BufferAttribute(new Int16Array(e), t)
  39903. }),
  39904. (Ci.Uint16Attribute = function (e, t) {
  39905. return new Ci.BufferAttribute(new Uint16Array(e), t)
  39906. }),
  39907. (Ci.Int32Attribute = function (e, t) {
  39908. return new Ci.BufferAttribute(new Int32Array(e), t)
  39909. }),
  39910. (Ci.Uint32Attribute = function (e, t) {
  39911. return new Ci.BufferAttribute(new Uint32Array(e), t)
  39912. }),
  39913. (Ci.Float32Attribute = function (e, t) {
  39914. return new Ci.BufferAttribute(new Float32Array(e), t)
  39915. }),
  39916. (Ci.Float64Attribute = function (e, t) {
  39917. return new Ci.BufferAttribute(new Float64Array(e), t)
  39918. }),
  39919. (Ci.DynamicBufferAttribute = function (e, t) {
  39920. return console.warn('THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.'), new Ci.BufferAttribute(e, t).setDynamic(!0)
  39921. }),
  39922. (Ci.InstancedBufferAttribute = function (e, t, i) {
  39923. Ci.BufferAttribute.call(this, e, t), (this.meshPerAttribute = i || 1)
  39924. }),
  39925. (Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype)),
  39926. (Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute),
  39927. (Ci.InstancedBufferAttribute.prototype.copy = function (e) {
  39928. return Ci.BufferAttribute.prototype.copy.call(this, e), (this.meshPerAttribute = e.meshPerAttribute), this
  39929. }),
  39930. (Ci.InterleavedBuffer = function (e, t) {
  39931. ;(this.uuid = Ci.Math.generateUUID()),
  39932. (this.array = e),
  39933. (this.stride = t),
  39934. (this.dynamic = !1),
  39935. (this.updateRange = {
  39936. offset: 0,
  39937. count: -1
  39938. }),
  39939. (this.version = 0)
  39940. }),
  39941. (Ci.InterleavedBuffer.prototype = {
  39942. constructor: Ci.InterleavedBuffer,
  39943. get length() {
  39944. return this.array.length
  39945. },
  39946. get count() {
  39947. return this.array.length / this.stride
  39948. },
  39949. set needsUpdate(e) {
  39950. !0 === e && this.version++
  39951. },
  39952. setDynamic: function (e) {
  39953. return (this.dynamic = e), this
  39954. },
  39955. copy: function (e) {
  39956. return (this.array = new e.array.constructor(e.array)), (this.stride = e.stride), (this.dynamic = e.dynamic), this
  39957. },
  39958. copyAt: function (e, t, i) {
  39959. ;(e *= this.stride), (i *= t.stride)
  39960. for (var n = 0, r = this.stride; n < r; n++) this.array[e + n] = t.array[i + n]
  39961. return this
  39962. },
  39963. set: function (e, t) {
  39964. return void 0 === t && (t = 0), this.array.set(e, t), this
  39965. },
  39966. clone: function () {
  39967. return new this.constructor().copy(this)
  39968. }
  39969. }),
  39970. (Ci.InstancedInterleavedBuffer = function (e, t, i) {
  39971. Ci.InterleavedBuffer.call(this, e, t), (this.meshPerAttribute = i || 1)
  39972. }),
  39973. (Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype)),
  39974. (Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer),
  39975. (Ci.InstancedInterleavedBuffer.prototype.copy = function (e) {
  39976. return Ci.InterleavedBuffer.prototype.copy.call(this, e), (this.meshPerAttribute = e.meshPerAttribute), this
  39977. }),
  39978. (Ci.InterleavedBufferAttribute = function (e, t, i) {
  39979. ;(this.uuid = Ci.Math.generateUUID()), (this.data = e), (this.itemSize = t), (this.offset = i)
  39980. }),
  39981. (Ci.InterleavedBufferAttribute.prototype = {
  39982. constructor: Ci.InterleavedBufferAttribute,
  39983. get length() {
  39984. return console.warn('THREE.BufferAttribute: .length has been deprecated. Please use .count.'), this.array.length
  39985. },
  39986. get count() {
  39987. return this.data.count
  39988. },
  39989. setX: function (e, t) {
  39990. return (this.data.array[e * this.data.stride + this.offset] = t), this
  39991. },
  39992. setY: function (e, t) {
  39993. return (this.data.array[e * this.data.stride + this.offset + 1] = t), this
  39994. },
  39995. setZ: function (e, t) {
  39996. return (this.data.array[e * this.data.stride + this.offset + 2] = t), this
  39997. },
  39998. setW: function (e, t) {
  39999. return (this.data.array[e * this.data.stride + this.offset + 3] = t), this
  40000. },
  40001. getX: function (e) {
  40002. return this.data.array[e * this.data.stride + this.offset]
  40003. },
  40004. getY: function (e) {
  40005. return this.data.array[e * this.data.stride + this.offset + 1]
  40006. },
  40007. getZ: function (e) {
  40008. return this.data.array[e * this.data.stride + this.offset + 2]
  40009. },
  40010. getW: function (e) {
  40011. return this.data.array[e * this.data.stride + this.offset + 3]
  40012. },
  40013. setXY: function (e, t, i) {
  40014. return (e = e * this.data.stride + this.offset), (this.data.array[e + 0] = t), (this.data.array[e + 1] = i), this
  40015. },
  40016. setXYZ: function (e, t, i, n) {
  40017. 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
  40018. },
  40019. setXYZW: function (e, t, i, n, r) {
  40020. 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
  40021. }
  40022. }),
  40023. (Ci.Geometry = function () {
  40024. Object.defineProperty(this, 'id', {
  40025. value: Ci.GeometryIdCount++
  40026. }),
  40027. (this.uuid = Ci.Math.generateUUID()),
  40028. (this.name = ''),
  40029. (this.type = 'Geometry'),
  40030. (this.vertices = []),
  40031. (this.colors = []),
  40032. (this.faces = []),
  40033. (this.faceVertexUvs = [[]]),
  40034. (this.morphTargets = []),
  40035. (this.morphNormals = []),
  40036. (this.skinWeights = []),
  40037. (this.skinIndices = []),
  40038. (this.lineDistances = []),
  40039. (this.boundingBox = null),
  40040. (this.boundingSphere = null),
  40041. (this.verticesNeedUpdate = !1),
  40042. (this.elementsNeedUpdate = !1),
  40043. (this.uvsNeedUpdate = !1),
  40044. (this.normalsNeedUpdate = !1),
  40045. (this.colorsNeedUpdate = !1),
  40046. (this.lineDistancesNeedUpdate = !1),
  40047. (this.groupsNeedUpdate = !1)
  40048. }),
  40049. (Ci.Geometry.prototype = {
  40050. constructor: Ci.Geometry,
  40051. applyMatrix: function (e) {
  40052. for (var t = new Ci.Matrix3().getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  40053. this.vertices[i].applyMatrix4(e)
  40054. }
  40055. for (i = 0, n = this.faces.length; i < n; i++) {
  40056. var r = this.faces[i]
  40057. r.normal.applyMatrix3(t).normalize()
  40058. for (var o = 0, a = r.vertexNormals.length; o < a; o++) r.vertexNormals[o].applyMatrix3(t).normalize()
  40059. }
  40060. return (
  40061. null !== this.boundingBox && this.computeBoundingBox(),
  40062. null !== this.boundingSphere && this.computeBoundingSphere(),
  40063. (this.verticesNeedUpdate = !0),
  40064. (this.normalsNeedUpdate = !0),
  40065. this
  40066. )
  40067. },
  40068. rotateX: function (e) {
  40069. return void 0 === mt && (mt = new Ci.Matrix4()), mt.makeRotationX(e), this.applyMatrix(mt), this
  40070. },
  40071. rotateY: function (e) {
  40072. return void 0 === gt && (gt = new Ci.Matrix4()), gt.makeRotationY(e), this.applyMatrix(gt), this
  40073. },
  40074. rotateZ: function (e) {
  40075. return void 0 === ft && (ft = new Ci.Matrix4()), ft.makeRotationZ(e), this.applyMatrix(ft), this
  40076. },
  40077. translate: function (e, t, i) {
  40078. return void 0 === pt && (pt = new Ci.Matrix4()), pt.makeTranslation(e, t, i), this.applyMatrix(pt), this
  40079. },
  40080. scale: function (e, t, i) {
  40081. return void 0 === dt && (dt = new Ci.Matrix4()), dt.makeScale(e, t, i), this.applyMatrix(dt), this
  40082. },
  40083. lookAt: function (e) {
  40084. void 0 === ut && (ut = new Ci.Object3D()), ut.lookAt(e), ut.updateMatrix(), this.applyMatrix(ut.matrix)
  40085. },
  40086. fromBufferGeometry: function (e) {
  40087. function t(e, t, i, n) {
  40088. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : [],
  40089. o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : [],
  40090. a = new Ci.Face3(e, t, i, r, o, n)
  40091. s.faces.push(a),
  40092. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  40093. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  40094. }
  40095. var s = this,
  40096. i = null !== e.index ? e.index.array : void 0,
  40097. n = e.attributes,
  40098. r = n.position.array,
  40099. l = void 0 !== n.normal ? n.normal.array : void 0,
  40100. c = void 0 !== n.color ? n.color.array : void 0,
  40101. h = void 0 !== n.uv ? n.uv.array : void 0,
  40102. u = void 0 !== n.uv2 ? n.uv2.array : void 0
  40103. void 0 !== u && (this.faceVertexUvs[1] = [])
  40104. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3, a += 2)
  40105. s.vertices.push(new Ci.Vector3(r[o], r[o + 1], r[o + 2])),
  40106. void 0 !== l && d.push(new Ci.Vector3(l[o], l[o + 1], l[o + 2])),
  40107. void 0 !== c && s.colors.push(new Ci.Color(c[o], c[o + 1], c[o + 2])),
  40108. void 0 !== h && p.push(new Ci.Vector2(h[a], h[a + 1])),
  40109. void 0 !== u && f.push(new Ci.Vector2(u[a], u[a + 1]))
  40110. if (void 0 !== i) {
  40111. var g = e.groups
  40112. 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)
  40113. else for (o = 0; o < i.length; o += 3) t(i[o], i[o + 1], i[o + 2])
  40114. } else for (o = 0; o < r.length / 3; o += 3) t(o, o + 1, o + 2)
  40115. return (
  40116. this.computeFaceNormals(), null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()), null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()), this
  40117. )
  40118. },
  40119. center: function () {
  40120. this.computeBoundingBox()
  40121. var e = this.boundingBox.center().negate()
  40122. return this.translate(e.x, e.y, e.z), e
  40123. },
  40124. normalize: function () {
  40125. this.computeBoundingSphere()
  40126. var e = this.boundingSphere.center,
  40127. t = this.boundingSphere.radius,
  40128. i = 0 === t ? 1 : 1 / t,
  40129. n = new Ci.Matrix4()
  40130. 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
  40131. },
  40132. computeFaceNormals: function () {
  40133. for (var e = new Ci.Vector3(), t = new Ci.Vector3(), i = 0, n = this.faces.length; i < n; i++) {
  40134. var r = this.faces[i],
  40135. o = this.vertices[r.a],
  40136. a = this.vertices[r.b],
  40137. s = this.vertices[r.c]
  40138. e.subVectors(s, a), t.subVectors(o, a), e.cross(t), e.normalize(), r.normal.copy(e)
  40139. }
  40140. },
  40141. computeVertexNormals: function (e) {
  40142. var t, i, n, r, o, a
  40143. 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()
  40144. if (e) {
  40145. var s,
  40146. l,
  40147. c,
  40148. h = new Ci.Vector3(),
  40149. u = new Ci.Vector3()
  40150. for (n = 0, r = this.faces.length; n < r; n++)
  40151. (o = this.faces[n]),
  40152. (s = this.vertices[o.a]),
  40153. (l = this.vertices[o.b]),
  40154. (c = this.vertices[o.c]),
  40155. h.subVectors(c, l),
  40156. u.subVectors(s, l),
  40157. h.cross(u),
  40158. a[o.a].add(h),
  40159. a[o.b].add(h),
  40160. a[o.c].add(h)
  40161. } 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)
  40162. for (t = 0, i = this.vertices.length; t < i; t++) a[t].normalize()
  40163. for (n = 0, r = this.faces.length; n < r; n++) {
  40164. var d = (o = this.faces[n]).vertexNormals
  40165. 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()))
  40166. }
  40167. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  40168. },
  40169. computeMorphNormals: function () {
  40170. var e, t, i, n, r
  40171. for (i = 0, n = this.faces.length; i < n; i++)
  40172. for (
  40173. (r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : (r.__originalFaceNormal = r.normal.clone()),
  40174. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  40175. e = 0,
  40176. t = r.vertexNormals.length;
  40177. e < t;
  40178. e++
  40179. )
  40180. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : (r.__originalVertexNormals[e] = r.vertexNormals[e].clone())
  40181. var o = new Ci.Geometry()
  40182. for (o.faces = this.faces, e = 0, t = this.morphTargets.length; e < t; e++) {
  40183. if (!this.morphNormals[e]) {
  40184. ;(this.morphNormals[e] = {}), (this.morphNormals[e].faceNormals = []), (this.morphNormals[e].vertexNormals = [])
  40185. var a = this.morphNormals[e].faceNormals,
  40186. s = this.morphNormals[e].vertexNormals
  40187. for (i = 0, n = this.faces.length; i < n; i++)
  40188. (l = new Ci.Vector3()),
  40189. (c = {
  40190. a: new Ci.Vector3(),
  40191. b: new Ci.Vector3(),
  40192. c: new Ci.Vector3()
  40193. }),
  40194. a.push(l),
  40195. s.push(c)
  40196. }
  40197. var l,
  40198. c,
  40199. h = this.morphNormals[e]
  40200. for (o.vertices = this.morphTargets[e].vertices, o.computeFaceNormals(), o.computeVertexNormals(), i = 0, n = this.faces.length; i < n; i++)
  40201. (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])
  40202. }
  40203. for (i = 0, n = this.faces.length; i < n; i++) ((r = this.faces[i]).normal = r.__originalFaceNormal), (r.vertexNormals = r.__originalVertexNormals)
  40204. },
  40205. computeTangents: function () {
  40206. console.warn('THREE.Geometry: .computeTangents() has been removed.')
  40207. },
  40208. computeLineDistances: function () {
  40209. 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)
  40210. },
  40211. computeBoundingBox: function () {
  40212. null === this.boundingBox && (this.boundingBox = new Ci.Box3()), this.boundingBox.setFromPoints(this.vertices)
  40213. },
  40214. computeBoundingSphere: function () {
  40215. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere()), this.boundingSphere.setFromPoints(this.vertices)
  40216. },
  40217. merge: function (e, t, i) {
  40218. if (e instanceof Ci.Geometry != 0) {
  40219. var n,
  40220. r = this.vertices.length,
  40221. o = this.vertices,
  40222. a = e.vertices,
  40223. s = this.faces,
  40224. l = e.faces,
  40225. c = this.faceVertexUvs[0],
  40226. h = e.faceVertexUvs[0]
  40227. void 0 === i && (i = 0), void 0 !== t && (n = new Ci.Matrix3().getNormalMatrix(t))
  40228. for (var u = 0, d = a.length; u < d; u++) {
  40229. var p = a[u].clone()
  40230. void 0 !== t && p.applyMatrix4(t), o.push(p)
  40231. }
  40232. for (u = 0, d = l.length; u < d; u++) {
  40233. var f,
  40234. g,
  40235. m,
  40236. v = l[u],
  40237. y = v.vertexNormals,
  40238. A = v.vertexColors
  40239. ;(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()
  40240. 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)
  40241. f.color.copy(v.color)
  40242. for (C = 0, I = A.length; C < I; C++) (m = A[C]), f.vertexColors.push(m.clone())
  40243. ;(f.materialIndex = v.materialIndex + i), s.push(f)
  40244. }
  40245. for (u = 0, d = h.length; u < d; u++) {
  40246. var E = h[u],
  40247. _ = []
  40248. if (void 0 !== E) {
  40249. for (C = 0, I = E.length; C < I; C++) _.push(E[C].clone())
  40250. c.push(_)
  40251. }
  40252. }
  40253. } else console.error('THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.', e)
  40254. },
  40255. mergeMesh: function (e) {
  40256. return e instanceof Ci.Mesh == 0
  40257. ? void console.error('THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.', e)
  40258. : (e.matrixAutoUpdate && e.updateMatrix(), void this.merge(e.geometry, e.matrix))
  40259. },
  40260. mergeVertices: function () {
  40261. var e,
  40262. t,
  40263. i,
  40264. n,
  40265. r,
  40266. o,
  40267. a,
  40268. s,
  40269. l = {},
  40270. c = [],
  40271. h = [],
  40272. u = Math.pow(10, 4)
  40273. for (i = 0, n = this.vertices.length; i < n; i++)
  40274. (e = this.vertices[i]),
  40275. 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]])
  40276. var d = []
  40277. for (i = 0, n = this.faces.length; i < n; i++) {
  40278. ;((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])
  40279. for (var p = 0; p < 3; p++)
  40280. if (o[p] === o[(p + 1) % 3]) {
  40281. p, d.push(i)
  40282. break
  40283. }
  40284. }
  40285. for (i = d.length - 1; 0 <= i; i--) {
  40286. var f = d[i]
  40287. for (this.faces.splice(f, 1), a = 0, s = this.faceVertexUvs.length; a < s; a++) this.faceVertexUvs[a].splice(f, 1)
  40288. }
  40289. var g = this.vertices.length - c.length
  40290. return (this.vertices = c), g
  40291. },
  40292. sortFacesByMaterialIndex: function () {
  40293. for (var e = this.faces, t = e.length, i = 0; i < t; i++) e[i]._id = i
  40294. e.sort(function (e, t) {
  40295. return e.materialIndex - t.materialIndex
  40296. })
  40297. var n,
  40298. r,
  40299. o = this.faceVertexUvs[0],
  40300. a = this.faceVertexUvs[1]
  40301. o && o.length === t && (n = []), a && a.length === t && (r = [])
  40302. for (i = 0; i < t; i++) {
  40303. var s = e[i]._id
  40304. n && n.push(o[s]), r && r.push(a[s])
  40305. }
  40306. n && (this.faceVertexUvs[0] = n), r && (this.faceVertexUvs[1] = r)
  40307. },
  40308. toJSON: function () {
  40309. function e(e, t, i) {
  40310. return i ? e | (1 << t) : e & ~(1 << t)
  40311. }
  40312. function t(e) {
  40313. var t = e.x.toString() + e.y.toString() + e.z.toString()
  40314. return void 0 !== d[t] || ((d[t] = u.length / 3), u.push(e.x, e.y, e.z)), d[t]
  40315. }
  40316. function i(e) {
  40317. var t = e.r.toString() + e.g.toString() + e.b.toString()
  40318. return void 0 !== f[t] || ((f[t] = p.length), p.push(e.getHex())), f[t]
  40319. }
  40320. function n(e) {
  40321. var t = e.x.toString() + e.y.toString()
  40322. return void 0 !== m[t] || ((m[t] = g.length / 2), g.push(e.x, e.y)), m[t]
  40323. }
  40324. var r = {
  40325. metadata: {
  40326. version: 4.4,
  40327. type: 'Geometry',
  40328. generator: 'Geometry.toJSON'
  40329. }
  40330. }
  40331. if (((r.uuid = this.uuid), (r.type = this.type), '' !== this.name && (r.name = this.name), void 0 !== this.parameters)) {
  40332. var o = this.parameters
  40333. for (var a in o) void 0 !== o[a] && (r[a] = o[a])
  40334. return r
  40335. }
  40336. for (var s = [], l = 0; l < this.vertices.length; l++) {
  40337. var c = this.vertices[l]
  40338. s.push(c.x, c.y, c.z)
  40339. }
  40340. var h = [],
  40341. u = [],
  40342. d = {},
  40343. p = [],
  40344. f = {},
  40345. g = [],
  40346. m = {}
  40347. for (l = 0; l < this.faces.length; l++) {
  40348. var v = this.faces[l],
  40349. y = void 0 !== this.faceVertexUvs[0][l],
  40350. A = 0 < v.normal.length(),
  40351. C = 0 < v.vertexNormals.length,
  40352. I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b,
  40353. E = 0 < v.vertexColors.length,
  40354. _ = 0
  40355. if (
  40356. ((_ = e((_ = e((_ = e((_ = e((_ = e((_ = e((_ = e((_ = e(_, 0, 0)), 1, !0)), 2, !1)), 3, y)), 4, A)), 5, C)), 6, I)), 7, E)),
  40357. h.push(_),
  40358. h.push(v.a, v.b, v.c),
  40359. h.push(v.materialIndex),
  40360. y)
  40361. ) {
  40362. var b = this.faceVertexUvs[0][l]
  40363. h.push(n(b[0]), n(b[1]), n(b[2]))
  40364. }
  40365. if ((A && h.push(t(v.normal)), C)) {
  40366. var w = v.vertexNormals
  40367. h.push(t(w[0]), t(w[1]), t(w[2]))
  40368. }
  40369. if ((I && h.push(i(v.color)), E)) {
  40370. var T = v.vertexColors
  40371. h.push(i(T[0]), i(T[1]), i(T[2]))
  40372. }
  40373. }
  40374. 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
  40375. },
  40376. clone: function () {
  40377. return new Ci.Geometry().copy(this)
  40378. },
  40379. copy: function (e) {
  40380. ;(this.vertices = []), (this.faces = []), (this.faceVertexUvs = [[]])
  40381. for (var t = e.vertices, i = 0, n = t.length; i < n; i++) this.vertices.push(t[i].clone())
  40382. var r = e.faces
  40383. for (i = 0, n = r.length; i < n; i++) this.faces.push(r[i].clone())
  40384. for (i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  40385. var o = e.faceVertexUvs[i]
  40386. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = [])
  40387. for (var a = 0, s = o.length; a < s; a++) {
  40388. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  40389. var d = l[h]
  40390. c.push(d.clone())
  40391. }
  40392. this.faceVertexUvs[i].push(c)
  40393. }
  40394. }
  40395. return this
  40396. },
  40397. dispose: function () {
  40398. this.dispatchEvent({
  40399. type: 'dispose'
  40400. })
  40401. }
  40402. }),
  40403. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  40404. (Ci.GeometryIdCount = 0),
  40405. (Ci.DirectGeometry = function () {
  40406. Object.defineProperty(this, 'id', {
  40407. value: Ci.GeometryIdCount++
  40408. }),
  40409. (this.uuid = Ci.Math.generateUUID()),
  40410. (this.name = ''),
  40411. (this.type = 'DirectGeometry'),
  40412. (this.indices = []),
  40413. (this.vertices = []),
  40414. (this.normals = []),
  40415. (this.colors = []),
  40416. (this.uvs = []),
  40417. (this.uvs2 = []),
  40418. (this.groups = []),
  40419. (this.morphTargets = {}),
  40420. (this.skinWeights = []),
  40421. (this.skinIndices = []),
  40422. (this.boundingBox = null),
  40423. (this.boundingSphere = null),
  40424. (this.verticesNeedUpdate = !1),
  40425. (this.normalsNeedUpdate = !1),
  40426. (this.colorsNeedUpdate = !1),
  40427. (this.uvsNeedUpdate = !1),
  40428. (this.groupsNeedUpdate = !1)
  40429. }),
  40430. (Ci.DirectGeometry.prototype = {
  40431. constructor: Ci.DirectGeometry,
  40432. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  40433. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  40434. computeFaceNormals: function () {
  40435. console.warn('THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.')
  40436. },
  40437. computeVertexNormals: function () {
  40438. console.warn('THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.')
  40439. },
  40440. computeGroups: function (e) {
  40441. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  40442. var a = r[o]
  40443. a.materialIndex !== i &&
  40444. ((i = a.materialIndex),
  40445. void 0 !== t && ((t.count = 3 * o - t.start), n.push(t)),
  40446. (t = {
  40447. start: 3 * o,
  40448. materialIndex: i
  40449. }))
  40450. }
  40451. void 0 !== t && ((t.count = 3 * o - t.start), n.push(t)), (this.groups = n)
  40452. },
  40453. fromGeometry: function (e) {
  40454. var t,
  40455. i = e.faces,
  40456. n = e.vertices,
  40457. r = e.faceVertexUvs,
  40458. o = r[0] && 0 < r[0].length,
  40459. a = r[1] && 0 < r[1].length,
  40460. s = e.morphTargets,
  40461. l = s.length
  40462. if (0 < l) {
  40463. t = []
  40464. for (var c = 0; c < l; c++) t[c] = []
  40465. this.morphTargets.position = t
  40466. }
  40467. var h,
  40468. u = e.morphNormals,
  40469. d = u.length
  40470. if (0 < d) {
  40471. h = []
  40472. for (c = 0; c < d; c++) h[c] = []
  40473. this.morphTargets.normal = h
  40474. }
  40475. var p = e.skinIndices,
  40476. f = e.skinWeights,
  40477. g = p.length === n.length,
  40478. m = f.length === n.length
  40479. for (c = 0; c < i.length; c++) {
  40480. var v = i[c]
  40481. this.vertices.push(n[v.a], n[v.b], n[v.c])
  40482. var y = v.vertexNormals
  40483. if (3 === y.length) this.normals.push(y[0], y[1], y[2])
  40484. else {
  40485. var A = v.normal
  40486. this.normals.push(A, A, A)
  40487. }
  40488. var C,
  40489. I = v.vertexColors
  40490. if (3 === I.length) this.colors.push(I[0], I[1], I[2])
  40491. else {
  40492. var E = v.color
  40493. this.colors.push(E, E, E)
  40494. }
  40495. if (!0 === o)
  40496. void 0 !== (C = r[0][c])
  40497. ? this.uvs.push(C[0], C[1], C[2])
  40498. : (console.warn('THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ', c), this.uvs.push(new Ci.Vector2(), new Ci.Vector2(), new Ci.Vector2()))
  40499. if (!0 === a)
  40500. void 0 !== (C = r[1][c])
  40501. ? this.uvs2.push(C[0], C[1], C[2])
  40502. : (console.warn('THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ', c), this.uvs2.push(new Ci.Vector2(), new Ci.Vector2(), new Ci.Vector2()))
  40503. for (var _ = 0; _ < l; _++) {
  40504. var b = s[_].vertices
  40505. t[_].push(b[v.a], b[v.b], b[v.c])
  40506. }
  40507. for (_ = 0; _ < d; _++) {
  40508. var w = u[_].vertexNormals[c]
  40509. h[_].push(w.a, w.b, w.c)
  40510. }
  40511. 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])
  40512. }
  40513. return (
  40514. this.computeGroups(e),
  40515. (this.verticesNeedUpdate = e.verticesNeedUpdate),
  40516. (this.normalsNeedUpdate = e.normalsNeedUpdate),
  40517. (this.colorsNeedUpdate = e.colorsNeedUpdate),
  40518. (this.uvsNeedUpdate = e.uvsNeedUpdate),
  40519. (this.groupsNeedUpdate = e.groupsNeedUpdate),
  40520. this
  40521. )
  40522. },
  40523. dispose: function () {
  40524. this.dispatchEvent({
  40525. type: 'dispose'
  40526. })
  40527. }
  40528. }),
  40529. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  40530. (Ci.BufferGeometry = function () {
  40531. Object.defineProperty(this, 'id', {
  40532. value: Ci.GeometryIdCount++
  40533. }),
  40534. (this.uuid = Ci.Math.generateUUID()),
  40535. (this.name = ''),
  40536. (this.type = 'BufferGeometry'),
  40537. (this.index = null),
  40538. (this.attributes = {}),
  40539. (this.morphAttributes = {}),
  40540. (this.groups = []),
  40541. (this.boundingBox = null),
  40542. (this.boundingSphere = null),
  40543. (this.drawRange = {
  40544. start: 0,
  40545. count: 1 / 0
  40546. })
  40547. }),
  40548. (Ci.BufferGeometry.prototype = {
  40549. constructor: Ci.BufferGeometry,
  40550. getIndex: function () {
  40551. return this.index
  40552. },
  40553. setIndex: function (e) {
  40554. this.index = e
  40555. },
  40556. addAttribute: function (e, t) {
  40557. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0
  40558. ? (console.warn('THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).'), void this.addAttribute(e, new Ci.BufferAttribute(t, arguments[2])))
  40559. : 'index' === e
  40560. ? (console.warn('THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.'), void this.setIndex(t))
  40561. : ((this.attributes[e] = t), this)
  40562. },
  40563. getAttribute: function (e) {
  40564. return this.attributes[e]
  40565. },
  40566. removeAttribute: function (e) {
  40567. return delete this.attributes[e], this
  40568. },
  40569. addGroup: function (e, t, i) {
  40570. this.groups.push({
  40571. start: e,
  40572. count: t,
  40573. materialIndex: void 0 !== i ? i : 0
  40574. })
  40575. },
  40576. clearGroups: function () {
  40577. this.groups = []
  40578. },
  40579. setDrawRange: function (e, t) {
  40580. ;(this.drawRange.start = e), (this.drawRange.count = t)
  40581. },
  40582. applyMatrix: function (e) {
  40583. var t = this.attributes.position
  40584. void 0 !== t && (e.applyToVector3Array(t.array), (t.needsUpdate = !0))
  40585. var i = this.attributes.normal
  40586. void 0 !== i && (new Ci.Matrix3().getNormalMatrix(e).applyToVector3Array(i.array), (i.needsUpdate = !0))
  40587. return null !== this.boundingBox && this.computeBoundingBox(), null !== this.boundingSphere && this.computeBoundingSphere(), this
  40588. },
  40589. rotateX: function (e) {
  40590. return void 0 === ht && (ht = new Ci.Matrix4()), ht.makeRotationX(e), this.applyMatrix(ht), this
  40591. },
  40592. rotateY: function (e) {
  40593. return void 0 === ct && (ct = new Ci.Matrix4()), ct.makeRotationY(e), this.applyMatrix(ct), this
  40594. },
  40595. rotateZ: function (e) {
  40596. return void 0 === lt && (lt = new Ci.Matrix4()), lt.makeRotationZ(e), this.applyMatrix(lt), this
  40597. },
  40598. translate: function (e, t, i) {
  40599. return void 0 === st && (st = new Ci.Matrix4()), st.makeTranslation(e, t, i), this.applyMatrix(st), this
  40600. },
  40601. scale: function (e, t, i) {
  40602. return void 0 === at && (at = new Ci.Matrix4()), at.makeScale(e, t, i), this.applyMatrix(at), this
  40603. },
  40604. lookAt: function (e) {
  40605. void 0 === ot && (ot = new Ci.Object3D()), ot.lookAt(e), ot.updateMatrix(), this.applyMatrix(ot.matrix)
  40606. },
  40607. center: function () {
  40608. this.computeBoundingBox()
  40609. var e = this.boundingBox.center().negate()
  40610. return this.translate(e.x, e.y, e.z), e
  40611. },
  40612. setFromObject: function (e) {
  40613. var t = e.geometry
  40614. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  40615. var i = new Ci.Float32Attribute(3 * t.vertices.length, 3),
  40616. n = new Ci.Float32Attribute(3 * t.colors.length, 3)
  40617. if (
  40618. (this.addAttribute('position', i.copyVector3sArray(t.vertices)),
  40619. this.addAttribute('color', n.copyColorsArray(t.colors)),
  40620. t.lineDistances && t.lineDistances.length === t.vertices.length)
  40621. ) {
  40622. var r = new Ci.Float32Attribute(t.lineDistances.length, 1)
  40623. this.addAttribute('lineDistance', r.copyArray(t.lineDistances))
  40624. }
  40625. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()), null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  40626. } else e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t)
  40627. return this
  40628. },
  40629. updateFromObject: function (e) {
  40630. var t,
  40631. i = e.geometry
  40632. if (e instanceof Ci.Mesh) {
  40633. var n = i.__directGeometry
  40634. if (void 0 === n) return this.fromGeometry(i)
  40635. ;(n.verticesNeedUpdate = i.verticesNeedUpdate),
  40636. (n.normalsNeedUpdate = i.normalsNeedUpdate),
  40637. (n.colorsNeedUpdate = i.colorsNeedUpdate),
  40638. (n.uvsNeedUpdate = i.uvsNeedUpdate),
  40639. (n.groupsNeedUpdate = i.groupsNeedUpdate),
  40640. (i.verticesNeedUpdate = !1),
  40641. (i.normalsNeedUpdate = !1),
  40642. (i.colorsNeedUpdate = !1),
  40643. (i.uvsNeedUpdate = !1),
  40644. (i.groupsNeedUpdate = !1),
  40645. (i = n)
  40646. }
  40647. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices), (t.needsUpdate = !0)), (i.verticesNeedUpdate = !1))
  40648. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals), (t.needsUpdate = !0)), (i.normalsNeedUpdate = !1))
  40649. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors), (t.needsUpdate = !0)), (i.colorsNeedUpdate = !1))
  40650. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs), (t.needsUpdate = !0)), (i.uvsNeedUpdate = !1))
  40651. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances), (t.needsUpdate = !0)), (i.lineDistancesNeedUpdate = !1))
  40652. return i.groupsNeedUpdate && (i.computeGroups(e.geometry), (this.groups = i.groups), (i.groupsNeedUpdate = !1)), this
  40653. },
  40654. fromGeometry: function (e) {
  40655. return (e.__directGeometry = new Ci.DirectGeometry().fromGeometry(e)), this.fromDirectGeometry(e.__directGeometry)
  40656. },
  40657. fromDirectGeometry: function (e) {
  40658. var t = new Float32Array(3 * e.vertices.length)
  40659. if ((this.addAttribute('position', new Ci.BufferAttribute(t, 3).copyVector3sArray(e.vertices)), 0 < e.normals.length)) {
  40660. var i = new Float32Array(3 * e.normals.length)
  40661. this.addAttribute('normal', new Ci.BufferAttribute(i, 3).copyVector3sArray(e.normals))
  40662. }
  40663. if (0 < e.colors.length) {
  40664. var n = new Float32Array(3 * e.colors.length)
  40665. this.addAttribute('color', new Ci.BufferAttribute(n, 3).copyColorsArray(e.colors))
  40666. }
  40667. if (0 < e.uvs.length) {
  40668. var r = new Float32Array(2 * e.uvs.length)
  40669. this.addAttribute('uv', new Ci.BufferAttribute(r, 2).copyVector2sArray(e.uvs))
  40670. }
  40671. if (0 < e.uvs2.length) {
  40672. var o = new Float32Array(2 * e.uvs2.length)
  40673. this.addAttribute('uv2', new Ci.BufferAttribute(o, 2).copyVector2sArray(e.uvs2))
  40674. }
  40675. if (0 < e.indices.length) {
  40676. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length)
  40677. this.setIndex(new Ci.BufferAttribute(a, 1).copyIndicesArray(e.indices))
  40678. }
  40679. for (var s in ((this.groups = e.groups), e.morphTargets)) {
  40680. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  40681. var d = c[h],
  40682. p = new Ci.Float32Attribute(3 * d.length, 3)
  40683. l.push(p.copyVector3sArray(d))
  40684. }
  40685. this.morphAttributes[s] = l
  40686. }
  40687. if (0 < e.skinIndices.length) {
  40688. var f = new Ci.Float32Attribute(4 * e.skinIndices.length, 4)
  40689. this.addAttribute('skinIndex', f.copyVector4sArray(e.skinIndices))
  40690. }
  40691. if (0 < e.skinWeights.length) {
  40692. var g = new Ci.Float32Attribute(4 * e.skinWeights.length, 4)
  40693. this.addAttribute('skinWeight', g.copyVector4sArray(e.skinWeights))
  40694. }
  40695. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()), null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()), this
  40696. },
  40697. computeBoundingBox:
  40698. (new Ci.Vector3(),
  40699. function () {
  40700. null === this.boundingBox && (this.boundingBox = new Ci.Box3())
  40701. var e = this.attributes.position.array
  40702. e && this.boundingBox.setFromArray(e),
  40703. (void 0 !== e && 0 !== e.length) || (this.boundingBox.min.set(0, 0, 0), this.boundingBox.max.set(0, 0, 0)),
  40704. (isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) &&
  40705. console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this)
  40706. }),
  40707. computeBoundingSphere:
  40708. ((nt = new Ci.Box3()),
  40709. (rt = new Ci.Vector3()),
  40710. function () {
  40711. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere())
  40712. var e = this.attributes.position.array
  40713. if (e) {
  40714. var t = this.boundingSphere.center
  40715. nt.setFromArray(e), nt.center(t)
  40716. for (var i = 0, n = 0, r = e.length; n < r; n += 3) rt.fromArray(e, n), (i = Math.max(i, t.distanceToSquared(rt)))
  40717. ;(this.boundingSphere.radius = Math.sqrt(i)),
  40718. isNaN(this.boundingSphere.radius) &&
  40719. console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  40720. }
  40721. }),
  40722. computeFaceNormals: function () {},
  40723. computeVertexNormals: function () {
  40724. var e = this.index,
  40725. t = this.attributes,
  40726. i = this.groups
  40727. if (t.position) {
  40728. var n = t.position.array
  40729. if (void 0 === t.normal) this.addAttribute('normal', new Ci.BufferAttribute(new Float32Array(n.length), 3))
  40730. else for (var r = t.normal.array, o = 0, a = r.length; o < a; o++) r[o] = 0
  40731. var s,
  40732. l,
  40733. c,
  40734. h = t.normal.array,
  40735. u = new Ci.Vector3(),
  40736. d = new Ci.Vector3(),
  40737. p = new Ci.Vector3(),
  40738. f = new Ci.Vector3(),
  40739. g = new Ci.Vector3()
  40740. if (e) {
  40741. var m = e.array
  40742. 0 === i.length && this.addGroup(0, m.length)
  40743. for (var v = 0, y = i.length; v < y; ++v) {
  40744. var A = i[v],
  40745. C = A.start
  40746. for (o = C, a = C + A.count; o < a; o += 3)
  40747. (s = 3 * m[o + 0]),
  40748. (l = 3 * m[o + 1]),
  40749. (c = 3 * m[o + 2]),
  40750. u.fromArray(n, s),
  40751. d.fromArray(n, l),
  40752. p.fromArray(n, c),
  40753. f.subVectors(p, d),
  40754. g.subVectors(u, d),
  40755. f.cross(g),
  40756. (h[s] += f.x),
  40757. (h[1 + s] += f.y),
  40758. (h[2 + s] += f.z),
  40759. (h[l] += f.x),
  40760. (h[1 + l] += f.y),
  40761. (h[2 + l] += f.z),
  40762. (h[c] += f.x),
  40763. (h[1 + c] += f.y),
  40764. (h[2 + c] += f.z)
  40765. }
  40766. } else
  40767. for (o = 0, a = n.length; o < a; o += 9)
  40768. u.fromArray(n, o),
  40769. d.fromArray(n, o + 3),
  40770. p.fromArray(n, o + 6),
  40771. f.subVectors(p, d),
  40772. g.subVectors(u, d),
  40773. f.cross(g),
  40774. (h[o] = f.x),
  40775. (h[o + 1] = f.y),
  40776. (h[o + 2] = f.z),
  40777. (h[o + 3] = f.x),
  40778. (h[o + 4] = f.y),
  40779. (h[o + 5] = f.z),
  40780. (h[o + 6] = f.x),
  40781. (h[o + 7] = f.y),
  40782. (h[o + 8] = f.z)
  40783. this.normalizeNormals(), (t.normal.needsUpdate = !0)
  40784. }
  40785. },
  40786. merge: function (e, t) {
  40787. if (e instanceof Ci.BufferGeometry != 0) {
  40788. void 0 === t && (t = 0)
  40789. var i = this.attributes
  40790. 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]
  40791. return this
  40792. }
  40793. console.error('THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.', e)
  40794. },
  40795. normalizeNormals: function () {
  40796. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  40797. (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)
  40798. },
  40799. toNonIndexed: function () {
  40800. if (null === this.index) return console.warn('THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed.'), this
  40801. var e = new Ci.BufferGeometry(),
  40802. t = this.index.array,
  40803. i = this.attributes
  40804. for (var n in i) {
  40805. 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++) {
  40806. l = t[h] * a
  40807. for (var d = 0; d < a; d++) s[c++] = o[l++]
  40808. }
  40809. e.addAttribute(n, new Ci.BufferAttribute(s, a))
  40810. }
  40811. return e
  40812. },
  40813. toJSON: function () {
  40814. var e = {
  40815. metadata: {
  40816. version: 4.4,
  40817. type: 'BufferGeometry',
  40818. generator: 'BufferGeometry.toJSON'
  40819. }
  40820. }
  40821. if (((e.uuid = this.uuid), (e.type = this.type), '' !== this.name && (e.name = this.name), void 0 !== this.parameters)) {
  40822. var t = this.parameters
  40823. for (var i in t) void 0 !== t[i] && (e[i] = t[i])
  40824. return e
  40825. }
  40826. e.data = {
  40827. attributes: {}
  40828. }
  40829. var n = this.index
  40830. if (null !== n) {
  40831. var r = Array.prototype.slice.call(n.array)
  40832. e.data.index = {
  40833. type: n.array.constructor.name,
  40834. array: r
  40835. }
  40836. }
  40837. var o = this.attributes
  40838. for (var i in o) {
  40839. var a = o[i]
  40840. r = Array.prototype.slice.call(a.array)
  40841. e.data.attributes[i] = {
  40842. itemSize: a.itemSize,
  40843. type: a.array.constructor.name,
  40844. array: r
  40845. }
  40846. }
  40847. var s = this.groups
  40848. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)))
  40849. var l = this.boundingSphere
  40850. return (
  40851. null !== l &&
  40852. (e.data.boundingSphere = {
  40853. center: l.center.toArray(),
  40854. radius: l.radius
  40855. }),
  40856. e
  40857. )
  40858. },
  40859. clone: function () {
  40860. return new Ci.BufferGeometry().copy(this)
  40861. },
  40862. copy: function (e) {
  40863. var t = e.index
  40864. null !== t && this.setIndex(t.clone())
  40865. var i = e.attributes
  40866. for (var n in i) {
  40867. var r = i[n]
  40868. this.addAttribute(n, r.clone())
  40869. }
  40870. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  40871. var l = o[a]
  40872. this.addGroup(l.start, l.count)
  40873. }
  40874. return this
  40875. },
  40876. dispose: function () {
  40877. this.dispatchEvent({
  40878. type: 'dispose'
  40879. })
  40880. }
  40881. }),
  40882. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  40883. (Ci.BufferGeometry.MaxIndex = 65535),
  40884. (Ci.InstancedBufferGeometry = function () {
  40885. Ci.BufferGeometry.call(this), (this.type = 'InstancedBufferGeometry'), (this.maxInstancedCount = void 0)
  40886. }),
  40887. (Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  40888. (Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry),
  40889. (Ci.InstancedBufferGeometry.prototype.addGroup = function (e, t, i) {
  40890. this.groups.push({
  40891. start: e,
  40892. count: t,
  40893. instances: i
  40894. })
  40895. }),
  40896. (Ci.InstancedBufferGeometry.prototype.copy = function (e) {
  40897. var t = e.index
  40898. null !== t && this.setIndex(t.clone())
  40899. var i = e.attributes
  40900. for (var n in i) {
  40901. var r = i[n]
  40902. this.addAttribute(n, r.clone())
  40903. }
  40904. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  40905. var l = o[a]
  40906. this.addGroup(l.start, l.count, l.instances)
  40907. }
  40908. return this
  40909. }),
  40910. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  40911. (Ci.Uniform = function (e, t) {
  40912. ;(this.type = e), (this.value = t), (this.dynamic = !1)
  40913. }),
  40914. (Ci.Uniform.prototype = {
  40915. constructor: Ci.Uniform,
  40916. onUpdate: function (e) {
  40917. return (this.dynamic = !0), (this.onUpdateCallback = e), this
  40918. }
  40919. }),
  40920. (Ci.AnimationClip = function (e, t, i) {
  40921. ;(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()
  40922. }),
  40923. (Ci.AnimationClip.prototype = {
  40924. constructor: Ci.AnimationClip,
  40925. resetDuration: function () {
  40926. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  40927. var n = this.tracks[t]
  40928. e = Math.max(e, n.times[n.times.length - 1])
  40929. }
  40930. this.duration = e
  40931. },
  40932. trim: function () {
  40933. for (var e = 0; e < this.tracks.length; e++) this.tracks[e].trim(0, this.duration)
  40934. return this
  40935. },
  40936. optimize: function () {
  40937. for (var e = 0; e < this.tracks.length; e++) this.tracks[e].optimize()
  40938. return this
  40939. }
  40940. }),
  40941. Object.assign(Ci.AnimationClip, {
  40942. parse: function (e) {
  40943. 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))
  40944. return new Ci.AnimationClip(e.name, e.duration, t)
  40945. },
  40946. toJSON: function (e) {
  40947. for (
  40948. var t = [],
  40949. i = e.tracks,
  40950. n = {
  40951. name: e.name,
  40952. duration: e.duration,
  40953. tracks: t
  40954. },
  40955. r = 0,
  40956. o = i.length;
  40957. r !== o;
  40958. ++r
  40959. )
  40960. t.push(Ci.KeyframeTrack.toJSON(i[r]))
  40961. return n
  40962. },
  40963. CreateFromMorphTargetSequence: function (e, t, i) {
  40964. for (var n = t.length, r = [], o = 0; o < n; o++) {
  40965. var a = [],
  40966. s = []
  40967. a.push((o + n - 1) % n, o, (o + 1) % n), s.push(0, 1, 0)
  40968. var l = Ci.AnimationUtils.getKeyframeOrder(a)
  40969. ;(a = Ci.AnimationUtils.sortedArray(a, 1, l)),
  40970. (s = Ci.AnimationUtils.sortedArray(s, 1, l)),
  40971. 0 === a[0] && (a.push(n), s.push(s[0])),
  40972. r.push(new Ci.NumberKeyframeTrack('.morphTargetInfluences[' + t[o].name + ']', a, s).scale(1 / i))
  40973. }
  40974. return new Ci.AnimationClip(e, -1, r)
  40975. },
  40976. findByName: function (e, t) {
  40977. for (var i = 0; i < e.length; i++) if (e[i].name === t) return e[i]
  40978. return null
  40979. },
  40980. CreateClipsFromMorphTargetSequences: function (e, t) {
  40981. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  40982. var a = e[r],
  40983. s = a.name.match(n)
  40984. if (s && 1 < s.length) {
  40985. var l = i[(h = s[1])]
  40986. l || (i[h] = l = []), l.push(a)
  40987. }
  40988. }
  40989. var c = []
  40990. for (var h in i) c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t))
  40991. return c
  40992. },
  40993. parseAnimation: function (e, t, i) {
  40994. if (!e) return console.error(' no animation in JSONLoader data'), null
  40995. function n(e, t, i, n, r) {
  40996. if (0 !== i.length) {
  40997. var o = [],
  40998. a = []
  40999. Ci.AnimationUtils.flattenJSON(i, o, a, n), 0 !== o.length && r.push(new e(t, o, a))
  41000. }
  41001. }
  41002. for (var r = [], o = e.name || 'default', a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  41003. var h = l[c].keys
  41004. if (h && 0 != h.length)
  41005. if (h[0].morphTargets) {
  41006. 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
  41007. for (var f in u) {
  41008. var g = [],
  41009. m = []
  41010. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  41011. var v = h[d]
  41012. g.push(v.time), m.push(v.morphTarget === f ? 1 : 0)
  41013. }
  41014. r.push(new Ci.NumberKeyframeTrack('.morphTargetInfluence[' + f + ']', g, m))
  41015. }
  41016. a = u.length * (s || 1)
  41017. } else {
  41018. var y = '.bones[' + t[c].name + ']'
  41019. n(Ci.VectorKeyframeTrack, y + '.position', h, 'pos', r), n(Ci.QuaternionKeyframeTrack, y + '.quaternion', h, 'rot', r), n(Ci.VectorKeyframeTrack, y + '.scale', h, 'scl', r)
  41020. }
  41021. }
  41022. return 0 === r.length ? null : new Ci.AnimationClip(o, a, r)
  41023. }
  41024. }),
  41025. (Ci.AnimationMixer = function (e) {
  41026. ;(this._root = e), this._initMemoryManager(), (this._accuIndex = 0), (this.time = 0), (this.timeScale = 1)
  41027. }),
  41028. (Ci.AnimationMixer.prototype = {
  41029. constructor: Ci.AnimationMixer,
  41030. clipAction: function (e, t) {
  41031. var i,
  41032. n = (t || this._root).uuid,
  41033. r = 'string' == typeof e ? e : e.name,
  41034. o = e !== r ? e : null,
  41035. a = this._actionsByClip[r]
  41036. if (void 0 !== a) {
  41037. var s = a.actionByRoot[n]
  41038. if (void 0 !== s) return s
  41039. if (((o = (i = a.knownActions[0])._clip), e !== r && e !== o)) throw new Error('Different clips with the same name detected!')
  41040. }
  41041. if (null === o) return null
  41042. var l = new Ci.AnimationMixer._Action(this, o, t)
  41043. return this._bindAction(l, i), this._addInactiveAction(l, r, n), l
  41044. },
  41045. existingAction: function (e, t) {
  41046. var i = (t || this._root).uuid,
  41047. n = 'string' == typeof e ? e : e.name,
  41048. r = this._actionsByClip[n]
  41049. return (void 0 !== r && r.actionByRoot[i]) || null
  41050. },
  41051. stopAllAction: function () {
  41052. var e = this._actions,
  41053. t = this._nActiveActions,
  41054. i = this._bindings,
  41055. n = this._nActiveBindings
  41056. this._nActiveActions = 0
  41057. for (var r = (this._nActiveBindings = 0); r !== t; ++r) e[r].reset()
  41058. for (r = 0; r !== n; ++r) i[r].useCount = 0
  41059. return this
  41060. },
  41061. update: function (e) {
  41062. e *= this.timeScale
  41063. 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) {
  41064. var s = t[a]
  41065. s.enabled && s._update(n, e, r, o)
  41066. }
  41067. var l = this._bindings,
  41068. c = this._nActiveBindings
  41069. for (a = 0; a !== c; ++a) l[a].apply(o)
  41070. return this
  41071. },
  41072. getRoot: function () {
  41073. return this._root
  41074. },
  41075. uncacheClip: function (e) {
  41076. var t = this._actions,
  41077. i = e.name,
  41078. n = this._actionsByClip,
  41079. r = n[i]
  41080. if (void 0 !== r) {
  41081. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  41082. var l = o[a]
  41083. this._deactivateAction(l)
  41084. var c = l._cacheIndex,
  41085. h = t[t.length - 1]
  41086. ;(l._cacheIndex = null), (l._byClipCacheIndex = null), (t[(h._cacheIndex = c)] = h), t.pop(), this._removeInactiveBindingsForAction(l)
  41087. }
  41088. delete n[i]
  41089. }
  41090. },
  41091. uncacheRoot: function (e) {
  41092. var t = e.uuid,
  41093. i = this._actionsByClip
  41094. for (var n in i) {
  41095. var r = i[n].actionByRoot[t]
  41096. void 0 !== r && (this._deactivateAction(r), this._removeInactiveAction(r))
  41097. }
  41098. var o = this._bindingsByRootAndName[t]
  41099. if (void 0 !== o)
  41100. for (var a in o) {
  41101. var s = o[a]
  41102. s.restoreOriginalState(), this._removeInactiveBinding(s)
  41103. }
  41104. },
  41105. uncacheAction: function (e, t) {
  41106. var i = this.existingAction(e, t)
  41107. null !== i && (this._deactivateAction(i), this._removeInactiveAction(i))
  41108. }
  41109. }),
  41110. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  41111. (Ci.AnimationMixer._Action = function (e, t, i) {
  41112. ;(this._mixer = e), (this._clip = t), (this._localRoot = i || null)
  41113. for (
  41114. var n = t.tracks,
  41115. r = n.length,
  41116. o = new Array(r),
  41117. a = {
  41118. endingStart: Ci.ZeroCurvatureEnding,
  41119. endingEnd: Ci.ZeroCurvatureEnding
  41120. },
  41121. s = 0;
  41122. s !== r;
  41123. ++s
  41124. ) {
  41125. var l = n[s].createInterpolant(null)
  41126. ;(o[s] = l).settings = a
  41127. }
  41128. ;(this._interpolantSettings = a),
  41129. (this._interpolants = o),
  41130. (this._propertyBindings = new Array(r)),
  41131. (this._cacheIndex = null),
  41132. (this._byClipCacheIndex = null),
  41133. (this._timeScaleInterpolant = null),
  41134. (this._weightInterpolant = null),
  41135. (this.loop = Ci.LoopRepeat),
  41136. (this._loopCount = -1),
  41137. (this._startTime = null),
  41138. (this.time = 0),
  41139. (this.timeScale = 1),
  41140. (this._effectiveTimeScale = 1),
  41141. (this.weight = 1),
  41142. (this._effectiveWeight = 1),
  41143. (this.repetitions = 1 / 0),
  41144. (this.paused = !1),
  41145. (this.enabled = !0),
  41146. (this.clampWhenFinished = !1),
  41147. (this.zeroSlopeAtStart = !0),
  41148. (this.zeroSlopeAtEnd = !0)
  41149. }),
  41150. (Ci.AnimationMixer._Action.prototype = {
  41151. constructor: Ci.AnimationMixer._Action,
  41152. play: function () {
  41153. return this._mixer._activateAction(this), this
  41154. },
  41155. stop: function () {
  41156. return this._mixer._deactivateAction(this), this.reset()
  41157. },
  41158. reset: function () {
  41159. return (this.paused = !1), (this.enabled = !0), (this.time = 0), (this._loopCount = -1), (this._startTime = null), this.stopFading().stopWarping()
  41160. },
  41161. isRunning: function () {
  41162. return this._startTime, this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  41163. },
  41164. isScheduled: function () {
  41165. return this._mixer._isActiveAction(this)
  41166. },
  41167. startAt: function (e) {
  41168. return (this._startTime = e), this
  41169. },
  41170. setLoop: function (e, t) {
  41171. return (this.loop = e), (this.repetitions = t), this
  41172. },
  41173. setEffectiveWeight: function (e) {
  41174. return (this.weight = e), (this._effectiveWeight = this.enabled ? e : 0), this.stopFading()
  41175. },
  41176. getEffectiveWeight: function () {
  41177. return this._effectiveWeight
  41178. },
  41179. fadeIn: function (e) {
  41180. return this._scheduleFading(e, 0, 1)
  41181. },
  41182. fadeOut: function (e) {
  41183. return this._scheduleFading(e, 1, 0)
  41184. },
  41185. crossFadeFrom: function (e, t, i) {
  41186. if ((this._mixer, e.fadeOut(t), this.fadeIn(t), i)) {
  41187. var n = this._clip.duration,
  41188. r = e._clip.duration,
  41189. o = r / n,
  41190. a = n / r
  41191. e.warp(1, o, t), this.warp(a, 1, t)
  41192. }
  41193. return this
  41194. },
  41195. crossFadeTo: function (e, t, i) {
  41196. return e.crossFadeFrom(this, t, i)
  41197. },
  41198. stopFading: function () {
  41199. var e = this._weightInterpolant
  41200. return null !== e && ((this._weightInterpolant = null), this._mixer._takeBackControlInterpolant(e)), this
  41201. },
  41202. setEffectiveTimeScale: function (e) {
  41203. return (this.timeScale = e), (this._effectiveTimeScale = this.paused ? 0 : e), this.stopWarping()
  41204. },
  41205. getEffectiveTimeScale: function () {
  41206. return this._effectiveTimeScale
  41207. },
  41208. setDuration: function (e) {
  41209. return (this.timeScale = this._clip.duration / e), this.stopWarping()
  41210. },
  41211. syncWith: function (e) {
  41212. return (this.time = e.time), (this.timeScale = e.timeScale), this.stopWarping()
  41213. },
  41214. halt: function (e) {
  41215. return this.warp(this._currentTimeScale, 0, e)
  41216. },
  41217. warp: function (e, t, i) {
  41218. var n = this._mixer,
  41219. r = n.time,
  41220. o = this._timeScaleInterpolant,
  41221. a = this.timeScale
  41222. null === o && ((o = n._lendControlInterpolant()), (this._timeScaleInterpolant = o))
  41223. var s = o.parameterPositions,
  41224. l = o.sampleValues
  41225. return (s[0] = r), (s[1] = r + i), (l[0] = e / a), (l[1] = t / a), this
  41226. },
  41227. stopWarping: function () {
  41228. var e = this._timeScaleInterpolant
  41229. return null !== e && ((this._timeScaleInterpolant = null), this._mixer._takeBackControlInterpolant(e)), this
  41230. },
  41231. getMixer: function () {
  41232. return this._mixer
  41233. },
  41234. getClip: function () {
  41235. return this._clip
  41236. },
  41237. getRoot: function () {
  41238. return this._localRoot || this._mixer._root
  41239. },
  41240. _update: function (e, t, i, n) {
  41241. var r = this._startTime
  41242. if (null !== r) {
  41243. var o = (e - r) * i
  41244. if (o < 0 || 0 === i) return
  41245. ;(this._startTime = null), (t = i * o)
  41246. }
  41247. t *= this._updateTimeScale(e)
  41248. var a = this._updateTime(t),
  41249. s = this._updateWeight(e)
  41250. 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)
  41251. },
  41252. _updateWeight: function (e) {
  41253. var t = 0
  41254. if (this.enabled) {
  41255. t = this.weight
  41256. var i = this._weightInterpolant
  41257. if (null !== i) {
  41258. var n = i.evaluate(e)[0]
  41259. ;(t *= n), e > i.parameterPositions[1] && (this.stopFading(), 0 === n && (this.enabled = !1))
  41260. }
  41261. }
  41262. return (this._effectiveWeight = t)
  41263. },
  41264. _updateTimeScale: function (e) {
  41265. var t = 0
  41266. if (!this.paused) {
  41267. t = this.timeScale
  41268. var i = this._timeScaleInterpolant
  41269. if (null !== i) (t *= i.evaluate(e)[0]), e > i.parameterPositions[1] && (this.stopWarping(), 0 === t ? (this.pause = !0) : (this.timeScale = t))
  41270. }
  41271. return (this._effectiveTimeScale = t)
  41272. },
  41273. _updateTime: function (e) {
  41274. var t = this.time + e
  41275. if (0 === e) return t
  41276. var i = this._clip.duration,
  41277. n = this.loop,
  41278. r = this._loopCount,
  41279. o = !1
  41280. switch (n) {
  41281. case Ci.LoopOnce:
  41282. if ((-1 === r && ((this.loopCount = 0), this._setEndings(!0, !0, !1)), i <= t)) t = i
  41283. else {
  41284. if (!(t < 0)) break
  41285. t = 0
  41286. }
  41287. this.clampWhenFinished ? (this.pause = !0) : (this.enabled = !1),
  41288. this._mixer.dispatchEvent({
  41289. type: 'finished',
  41290. action: this,
  41291. direction: e < 0 ? -1 : 1
  41292. })
  41293. break
  41294. case Ci.LoopPingPong:
  41295. o = !0
  41296. case Ci.LoopRepeat:
  41297. 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)) {
  41298. var a = Math.floor(t / i)
  41299. ;(t -= i * a), (r += Math.abs(a))
  41300. var s = this.repetitions - r
  41301. if (s < 0) {
  41302. this.clampWhenFinished ? (this.paused = !0) : (this.enabled = !1),
  41303. (t = 0 < e ? i : 0),
  41304. this._mixer.dispatchEvent({
  41305. type: 'finished',
  41306. action: this,
  41307. direction: 0 < e ? 1 : -1
  41308. })
  41309. break
  41310. }
  41311. if (0 == s) {
  41312. var l = e < 0
  41313. this._setEndings(l, !l, o)
  41314. } else this._setEndings(!1, !1, o)
  41315. ;(this._loopCount = r),
  41316. this._mixer.dispatchEvent({
  41317. type: 'loop',
  41318. action: this,
  41319. loopDelta: a
  41320. })
  41321. }
  41322. if (n === Ci.LoopPingPong && 1 == (1 & r)) return i - (this.time = t)
  41323. }
  41324. return (this.time = t)
  41325. },
  41326. _setEndings: function (e, t, i) {
  41327. var n = this._interpolantSettings
  41328. i
  41329. ? ((n.endingStart = Ci.ZeroSlopeEnding), (n.endingEnd = Ci.ZeroSlopeEnding))
  41330. : ((n.endingStart = e ? (this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding) : Ci.WrapAroundEnding),
  41331. (n.endingEnd = t ? (this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding) : Ci.WrapAroundEnding))
  41332. },
  41333. _scheduleFading: function (e, t, i) {
  41334. var n = this._mixer,
  41335. r = n.time,
  41336. o = this._weightInterpolant
  41337. null === o && ((o = n._lendControlInterpolant()), (this._weightInterpolant = o))
  41338. var a = o.parameterPositions,
  41339. s = o.sampleValues
  41340. return (a[0] = r), (s[0] = t), (a[1] = r + e), (s[1] = i), this
  41341. }
  41342. }),
  41343. Object.assign(Ci.AnimationMixer.prototype, {
  41344. _bindAction: function (e, t) {
  41345. var i = e._localRoot || this._root,
  41346. n = e._clip.tracks,
  41347. r = n.length,
  41348. o = e._propertyBindings,
  41349. a = e._interpolants,
  41350. s = i.uuid,
  41351. l = this._bindingsByRootAndName,
  41352. c = l[s]
  41353. void 0 === c && ((c = {}), (l[s] = c))
  41354. for (var h = 0; h !== r; ++h) {
  41355. var u = n[h],
  41356. d = u.name,
  41357. p = c[d]
  41358. if (void 0 !== p) o[h] = p
  41359. else {
  41360. if (void 0 !== (p = o[h])) {
  41361. null === p._cacheIndex && (++p.referenceCount, this._addInactiveBinding(p, s, d))
  41362. continue
  41363. }
  41364. var f = t && t._propertyBindings[h].binding.parsedPath
  41365. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f), u.ValueTypeName, u.getValueSize())).referenceCount, this._addInactiveBinding(p, s, d), (o[h] = p)
  41366. }
  41367. a[h].resultBuffer = p.buffer
  41368. }
  41369. },
  41370. _activateAction: function (e) {
  41371. if (!this._isActiveAction(e)) {
  41372. if (null === e._cacheIndex) {
  41373. var t = (e._localRoot || this._root).uuid,
  41374. i = e._clip.name,
  41375. n = this._actionsByClip[i]
  41376. this._bindAction(e, n && n.knownActions[0]), this._addInactiveAction(e, i, t)
  41377. }
  41378. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  41379. var s = r[o]
  41380. 0 == s.useCount++ && (this._lendBinding(s), s.saveOriginalState())
  41381. }
  41382. this._lendAction(e)
  41383. }
  41384. },
  41385. _deactivateAction: function (e) {
  41386. if (this._isActiveAction(e)) {
  41387. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  41388. var r = t[i]
  41389. 0 == --r.useCount && (r.restoreOriginalState(), this._takeBackBinding(r))
  41390. }
  41391. this._takeBackAction(e)
  41392. }
  41393. },
  41394. _initMemoryManager: function () {
  41395. ;(this._actions = []),
  41396. (this._nActiveActions = 0),
  41397. (this._actionsByClip = {}),
  41398. (this._bindings = []),
  41399. (this._nActiveBindings = 0),
  41400. (this._bindingsByRootAndName = {}),
  41401. (this._controlInterpolants = []),
  41402. (this._nActiveControlInterpolants = 0)
  41403. var e = this
  41404. this.stats = {
  41405. actions: {
  41406. get total() {
  41407. return e._actions.length
  41408. },
  41409. get inUse() {
  41410. return e._nActiveActions
  41411. }
  41412. },
  41413. bindings: {
  41414. get total() {
  41415. return e._bindings.length
  41416. },
  41417. get inUse() {
  41418. return e._nActiveBindings
  41419. }
  41420. },
  41421. controlInterpolants: {
  41422. get total() {
  41423. return e._controlInterpolants.length
  41424. },
  41425. get inUse() {
  41426. return e._nActiveControlInterpolants
  41427. }
  41428. }
  41429. }
  41430. },
  41431. _isActiveAction: function (e) {
  41432. var t = e._cacheIndex
  41433. return null !== t && t < this._nActiveActions
  41434. },
  41435. _addInactiveAction: function (e, t, i) {
  41436. var n = this._actions,
  41437. r = this._actionsByClip,
  41438. o = r[t]
  41439. if (void 0 === o)
  41440. (o = {
  41441. knownActions: [e],
  41442. actionByRoot: {}
  41443. }),
  41444. (e._byClipCacheIndex = 0),
  41445. (r[t] = o)
  41446. else {
  41447. var a = o.knownActions
  41448. ;(e._byClipCacheIndex = a.length), a.push(e)
  41449. }
  41450. ;(e._cacheIndex = n.length), n.push(e), (o.actionByRoot[i] = e)
  41451. },
  41452. _removeInactiveAction: function (e) {
  41453. var t = this._actions,
  41454. i = t[t.length - 1],
  41455. n = e._cacheIndex
  41456. ;(t[(i._cacheIndex = n)] = i), t.pop(), (e._cacheIndex = null)
  41457. var r = e._clip.name,
  41458. o = this._actionsByClip,
  41459. a = o[r],
  41460. s = a.knownActions,
  41461. l = s[s.length - 1],
  41462. c = e._byClipCacheIndex
  41463. ;(s[(l._byClipCacheIndex = c)] = l),
  41464. s.pop(),
  41465. (e._byClipCacheIndex = null),
  41466. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  41467. 0 === s.length && delete o[r],
  41468. this._removeInactiveBindingsForAction(e)
  41469. },
  41470. _removeInactiveBindingsForAction: function (e) {
  41471. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  41472. var r = t[i]
  41473. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  41474. }
  41475. },
  41476. _lendAction: function (e) {
  41477. var t = this._actions,
  41478. i = e._cacheIndex,
  41479. n = this._nActiveActions++,
  41480. r = t[n]
  41481. ;(t[(e._cacheIndex = n)] = e), (t[(r._cacheIndex = i)] = r)
  41482. },
  41483. _takeBackAction: function (e) {
  41484. var t = this._actions,
  41485. i = e._cacheIndex,
  41486. n = --this._nActiveActions,
  41487. r = t[n]
  41488. ;(t[(e._cacheIndex = n)] = e), (t[(r._cacheIndex = i)] = r)
  41489. },
  41490. _addInactiveBinding: function (e, t, i) {
  41491. var n = this._bindingsByRootAndName,
  41492. r = n[t],
  41493. o = this._bindings
  41494. void 0 === r && ((r = {}), (n[t] = r)), ((r[i] = e)._cacheIndex = o.length), o.push(e)
  41495. },
  41496. _removeInactiveBinding: function (e) {
  41497. var t = this._bindings,
  41498. i = e.binding,
  41499. n = i.rootNode.uuid,
  41500. r = i.path,
  41501. o = this._bindingsByRootAndName,
  41502. a = o[n],
  41503. s = t[t.length - 1],
  41504. l = e._cacheIndex
  41505. ;(t[(s._cacheIndex = l)] = s), t.pop(), delete a[r]
  41506. e: {
  41507. for (var c in a) break e
  41508. delete o[n]
  41509. }
  41510. },
  41511. _lendBinding: function (e) {
  41512. var t = this._bindings,
  41513. i = e._cacheIndex,
  41514. n = this._nActiveBindings++,
  41515. r = t[n]
  41516. ;(t[(e._cacheIndex = n)] = e), (t[(r._cacheIndex = i)] = r)
  41517. },
  41518. _takeBackBinding: function (e) {
  41519. var t = this._bindings,
  41520. i = e._cacheIndex,
  41521. n = --this._nActiveBindings,
  41522. r = t[n]
  41523. ;(t[(e._cacheIndex = n)] = e), (t[(r._cacheIndex = i)] = r)
  41524. },
  41525. _lendControlInterpolant: function () {
  41526. var e = this._controlInterpolants,
  41527. t = this._nActiveControlInterpolants++,
  41528. i = e[t]
  41529. return void 0 === i && (e[((i = new Ci.LinearInterpolant(new Float32Array(2), new Float32Array(2), 1, this._controlInterpolantsResultBuffer)).__cacheIndex = t)] = i), i
  41530. },
  41531. _takeBackControlInterpolant: function (e) {
  41532. var t = this._controlInterpolants,
  41533. i = e.__cacheIndex,
  41534. n = --this._nActiveControlInterpolants,
  41535. r = t[n]
  41536. ;(t[(e.__cacheIndex = n)] = e), (t[(r.__cacheIndex = i)] = r)
  41537. },
  41538. _controlInterpolantsResultBuffer: new Float32Array(1)
  41539. }),
  41540. (Ci.AnimationObjectGroup = function (e) {
  41541. ;(this.uuid = Ci.Math.generateUUID()), (this._objects = Array.prototype.slice.call(arguments)), (this.nCachedObjects_ = 0)
  41542. var t = {}
  41543. this._indicesByUUID = t
  41544. for (var i = 0, n = arguments.length; i !== n; ++i) t[arguments[i].uuid] = i
  41545. ;(this._paths = []), (this._parsedPaths = []), (this._bindings = []), (this._bindingsIndicesByPath = {})
  41546. var r = this
  41547. this.stats = {
  41548. objects: {
  41549. get total() {
  41550. return r._objects.length
  41551. },
  41552. get inUse() {
  41553. return this.total - r.nCachedObjects_
  41554. }
  41555. },
  41556. get bindingsPerObject() {
  41557. return r._bindings.length
  41558. }
  41559. }
  41560. }),
  41561. (Ci.AnimationObjectGroup.prototype = {
  41562. constructor: Ci.AnimationObjectGroup,
  41563. add: function (e) {
  41564. for (
  41565. var t = this._objects,
  41566. i = t.length,
  41567. n = this.nCachedObjects_,
  41568. r = this._indicesByUUID,
  41569. o = this._paths,
  41570. a = this._parsedPaths,
  41571. s = this._bindings,
  41572. l = s.length,
  41573. c = 0,
  41574. h = arguments.length;
  41575. c !== h;
  41576. ++c
  41577. ) {
  41578. var u = arguments[c],
  41579. d = u.uuid,
  41580. p = r[d]
  41581. if (void 0 === p) {
  41582. ;(p = i++), (r[d] = p), t.push(u)
  41583. for (var f = 0, g = l; f !== g; ++f) s[f].push(new Ci.PropertyBinding(u, o[f], a[f]))
  41584. } else if (p < n) {
  41585. var m = t[p],
  41586. v = --n,
  41587. y = t[v]
  41588. ;(t[(r[y.uuid] = p)] = y), (t[(r[d] = v)] = u)
  41589. for (f = 0, g = l; f !== g; ++f) {
  41590. var A = s[f],
  41591. C = A[v],
  41592. I = A[p]
  41593. ;(A[p] = C), void 0 === I && (I = new Ci.PropertyBinding(u, o[f], a[f])), (A[v] = I)
  41594. }
  41595. } else t[p] !== m && console.error('Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...')
  41596. }
  41597. this.nCachedObjects_ = n
  41598. },
  41599. remove: function (e) {
  41600. 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) {
  41601. var l = arguments[a],
  41602. c = l.uuid,
  41603. h = n[c]
  41604. if (void 0 !== h && i <= h) {
  41605. var u = i++,
  41606. d = t[u]
  41607. ;(t[(n[d.uuid] = h)] = d), (t[(n[c] = u)] = l)
  41608. for (var p = 0, f = o; p !== f; ++p) {
  41609. var g = r[p],
  41610. m = g[u],
  41611. v = g[h]
  41612. ;(g[h] = m), (g[u] = v)
  41613. }
  41614. }
  41615. }
  41616. this.nCachedObjects_ = i
  41617. },
  41618. uncache: function (e) {
  41619. 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) {
  41620. var c = arguments[s].uuid,
  41621. h = r[c]
  41622. if (void 0 !== h)
  41623. if ((delete r[c], h < n)) {
  41624. var u = --n,
  41625. d = t[u],
  41626. p = t[(y = --i)]
  41627. ;(t[(r[d.uuid] = h)] = d), (t[(r[p.uuid] = u)] = p), t.pop()
  41628. for (var f = 0, g = a; f !== g; ++f) {
  41629. var m = (A = o[f])[u],
  41630. v = A[y]
  41631. ;(A[h] = m), (A[u] = v), A.pop()
  41632. }
  41633. } else {
  41634. var y
  41635. ;(t[(r[(p = t[(y = --i)]).uuid] = h)] = p), t.pop()
  41636. for (f = 0, g = a; f !== g; ++f) {
  41637. var A
  41638. ;((A = o[f])[h] = A[y]), A.pop()
  41639. }
  41640. }
  41641. }
  41642. this.nCachedObjects_ = n
  41643. },
  41644. subscribe_: function (e, t) {
  41645. var i = this._bindingsIndicesByPath,
  41646. n = i[e],
  41647. r = this._bindings
  41648. if (void 0 !== n) return r[n]
  41649. var o = this._paths,
  41650. a = this._parsedPaths,
  41651. s = this._objects,
  41652. l = s.length,
  41653. c = this.nCachedObjects_,
  41654. h = new Array(l)
  41655. ;(n = r.length), (i[e] = n), o.push(e), a.push(t), r.push(h)
  41656. for (var u = c, d = s.length; u !== d; ++u) {
  41657. var p = s[u]
  41658. h[u] = new Ci.PropertyBinding(p, e, t)
  41659. }
  41660. return h
  41661. },
  41662. unsubscribe_: function (e) {
  41663. var t = this._bindingsIndicesByPath,
  41664. i = t[e]
  41665. if (void 0 !== i) {
  41666. var n = this._paths,
  41667. r = this._parsedPaths,
  41668. o = this._bindings,
  41669. a = o.length - 1,
  41670. s = o[a]
  41671. ;(o[(t[e[a]] = i)] = s), o.pop(), (r[i] = r[a]), r.pop(), (n[i] = n[a]), n.pop()
  41672. }
  41673. }
  41674. }),
  41675. (Ci.AnimationUtils = {
  41676. arraySlice: function (e, t, i) {
  41677. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  41678. },
  41679. convertArray: function (e, t, i) {
  41680. return !e || (!i && e.constructor === t) ? e : 'number' == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  41681. },
  41682. isTypedArray: function (e) {
  41683. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  41684. },
  41685. getKeyframeOrder: function (i) {
  41686. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n) t[n] = n
  41687. return (
  41688. t.sort(function (e, t) {
  41689. return i[e] - i[t]
  41690. }),
  41691. t
  41692. )
  41693. },
  41694. sortedArray: function (e, t, i) {
  41695. 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]
  41696. return r
  41697. },
  41698. flattenJSON: function (e, t, i, n) {
  41699. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; ) o = e[r++]
  41700. if (void 0 !== o) {
  41701. var a = o[n]
  41702. if (void 0 !== a)
  41703. if (Array.isArray(a)) for (; void 0 !== (a = o[n]) && (t.push(o.time), i.push.apply(i, a)), void 0 !== (o = e[r++]); );
  41704. 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++]); );
  41705. else for (; void 0 !== (a = o[n]) && (t.push(o.time), i.push(a)), void 0 !== (o = e[r++]); );
  41706. }
  41707. }
  41708. }),
  41709. (Ci.KeyframeTrack = function (e, t, i, n) {
  41710. if (void 0 === e) throw new Error('track name is undefined')
  41711. if (void 0 === t || 0 === t.length) throw new Error('no keyframes in track named ' + e)
  41712. ;(this.name = e),
  41713. (this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType)),
  41714. (this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType)),
  41715. this.setInterpolation(n || this.DefaultInterpolation),
  41716. this.validate(),
  41717. this.optimize()
  41718. }),
  41719. (Ci.KeyframeTrack.prototype = {
  41720. constructor: Ci.KeyframeTrack,
  41721. TimeBufferType: Float32Array,
  41722. ValueBufferType: Float32Array,
  41723. DefaultInterpolation: Ci.InterpolateLinear,
  41724. InterpolantFactoryMethodDiscrete: function (e) {
  41725. return new Ci.DiscreteInterpolant(this.times, this.values, this.getValueSize(), e)
  41726. },
  41727. InterpolantFactoryMethodLinear: function (e) {
  41728. return new Ci.LinearInterpolant(this.times, this.values, this.getValueSize(), e)
  41729. },
  41730. InterpolantFactoryMethodSmooth: function (e) {
  41731. return new Ci.CubicInterpolant(this.times, this.values, this.getValueSize(), e)
  41732. },
  41733. setInterpolation: function (e) {
  41734. var t = void 0
  41735. switch (e) {
  41736. case Ci.InterpolateDiscrete:
  41737. t = this.InterpolantFactoryMethodDiscrete
  41738. break
  41739. case Ci.InterpolateLinear:
  41740. t = this.InterpolantFactoryMethodLinear
  41741. break
  41742. case Ci.InterpolateSmooth:
  41743. t = this.InterpolantFactoryMethodSmooth
  41744. }
  41745. if (void 0 !== t) this.createInterpolant = t
  41746. else {
  41747. var i = 'unsupported interpolation for ' + this.ValueTypeName + ' keyframe track named ' + this.name
  41748. if (void 0 === this.createInterpolant) {
  41749. if (e === this.DefaultInterpolation) throw new Error(i)
  41750. this.setInterpolation(this.DefaultInterpolation)
  41751. }
  41752. console.warn(i)
  41753. }
  41754. },
  41755. getInterpolation: function () {
  41756. switch (this.createInterpolant) {
  41757. case this.InterpolantFactoryMethodDiscrete:
  41758. return Ci.InterpolateDiscrete
  41759. case this.InterpolantFactoryMethodLinear:
  41760. return Ci.InterpolateLinear
  41761. case this.InterpolantFactoryMethodSmooth:
  41762. return Ci.InterpolateSmooth
  41763. }
  41764. },
  41765. getValueSize: function () {
  41766. return this.values.length / this.times.length
  41767. },
  41768. shift: function (e) {
  41769. if (0 !== e) for (var t = this.times, i = 0, n = t.length; i !== n; ++i) t[i] += e
  41770. return this
  41771. },
  41772. scale: function (e) {
  41773. if (1 !== e) for (var t = this.times, i = 0, n = t.length; i !== n; ++i) t[i] *= e
  41774. return this
  41775. },
  41776. trim: function (e, t) {
  41777. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; ) ++r
  41778. for (; -1 !== o && i[o] > t; ) --o
  41779. if ((++o, 0 !== r || o !== n)) {
  41780. o <= r && (r = (o = Math.max(o, 1)) - 1)
  41781. var a = this.getValueSize()
  41782. ;(this.times = Ci.AnimationUtils.arraySlice(i, r, o)), (this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a))
  41783. }
  41784. return this
  41785. },
  41786. validate: function () {
  41787. var e = !0,
  41788. t = this.getValueSize()
  41789. t - Math.floor(t) != 0 && (console.error('invalid value size in track', this), (e = !1))
  41790. var i = this.times,
  41791. n = this.values,
  41792. r = i.length
  41793. 0 === r && (console.error('track is empty', this), (e = !1))
  41794. for (var o = null, a = 0; a !== r; a++) {
  41795. var s = i[a]
  41796. if ('number' == typeof s && isNaN(s)) {
  41797. console.error('time is not a valid number', this, a, s), (e = !1)
  41798. break
  41799. }
  41800. if (null !== o && s < o) {
  41801. console.error('out of order keys', this, a, s, o), (e = !1)
  41802. break
  41803. }
  41804. o = s
  41805. }
  41806. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  41807. a = 0
  41808. for (var l = n.length; a !== l; ++a) {
  41809. var c = n[a]
  41810. if (isNaN(c)) {
  41811. console.error('value is not a valid number', this, a, c), (e = !1)
  41812. break
  41813. }
  41814. }
  41815. }
  41816. return e
  41817. },
  41818. optimize: function () {
  41819. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  41820. var a = !1,
  41821. s = e[r]
  41822. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  41823. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  41824. var d = t[l + u]
  41825. if (d !== t[c + u] || d !== t[h + u]) {
  41826. a = !0
  41827. break
  41828. }
  41829. }
  41830. if (a) {
  41831. if (r !== n) {
  41832. e[n] = e[r]
  41833. var p = r * i,
  41834. f = n * i
  41835. for (u = 0; u !== i; ++u) t[f + u] = t[p + u]
  41836. }
  41837. ++n
  41838. }
  41839. }
  41840. return n !== e.length && ((this.times = Ci.AnimationUtils.arraySlice(e, 0, n)), (this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i))), this
  41841. }
  41842. }),
  41843. Object.assign(Ci.KeyframeTrack, {
  41844. parse: function (e) {
  41845. if (void 0 === e.type) throw new Error('track type undefined, can not parse')
  41846. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type)
  41847. if (void 0 === e.times) {
  41848. console.warn('legacy JSON format detected, converting')
  41849. var i = [],
  41850. n = []
  41851. Ci.AnimationUtils.flattenJSON(e.keys, i, n, 'value'), (e.times = i), (e.values = n)
  41852. }
  41853. return void 0 !== t.parse ? t.parse(e) : new t(e.name, e.times, e.values, e.interpolation)
  41854. },
  41855. toJSON: function (e) {
  41856. var t,
  41857. i = e.constructor
  41858. if (void 0 !== i.toJSON) t = i.toJSON(e)
  41859. else {
  41860. t = {
  41861. name: e.name,
  41862. times: Ci.AnimationUtils.convertArray(e.times, Array),
  41863. values: Ci.AnimationUtils.convertArray(e.values, Array)
  41864. }
  41865. var n = e.getInterpolation()
  41866. n !== e.DefaultInterpolation && (t.interpolation = n)
  41867. }
  41868. return (t.type = e.ValueTypeName), t
  41869. },
  41870. _getTrackTypeForValueTypeName: function (e) {
  41871. switch (e.toLowerCase()) {
  41872. case 'scalar':
  41873. case 'double':
  41874. case 'float':
  41875. case 'number':
  41876. case 'integer':
  41877. return Ci.NumberKeyframeTrack
  41878. case 'vector':
  41879. case 'vector2':
  41880. case 'vector3':
  41881. case 'vector4':
  41882. return Ci.VectorKeyframeTrack
  41883. case 'color':
  41884. return Ci.ColorKeyframeTrack
  41885. case 'quaternion':
  41886. return Ci.QuaternionKeyframeTrack
  41887. case 'bool':
  41888. case 'boolean':
  41889. return Ci.BooleanKeyframeTrack
  41890. case 'string':
  41891. return Ci.StringKeyframeTrack
  41892. }
  41893. throw new Error('Unsupported typeName: ' + e)
  41894. }
  41895. }),
  41896. (Ci.PropertyBinding = function (e, t, i) {
  41897. ;(this.path = t), (this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t)), (this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e), (this.rootNode = e)
  41898. }),
  41899. (Ci.PropertyBinding.prototype = {
  41900. constructor: Ci.PropertyBinding,
  41901. getValue: function (e, t) {
  41902. this.bind(), this.getValue(e, t)
  41903. },
  41904. setValue: function (e, t) {
  41905. this.bind(), this.setValue(e, t)
  41906. },
  41907. bind: function () {
  41908. var e = this.node,
  41909. t = this.parsedPath,
  41910. i = t.objectName,
  41911. n = t.propertyName,
  41912. r = t.propertyIndex
  41913. if (
  41914. (e || ((e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode), (this.node = e)),
  41915. (this.getValue = this._getValue_unavailable),
  41916. (this.setValue = this._setValue_unavailable),
  41917. e)
  41918. ) {
  41919. if (i) {
  41920. var o = t.objectIndex
  41921. switch (i) {
  41922. case 'materials':
  41923. if (!e.material) return void console.error(' can not bind to material as node does not have a material', this)
  41924. if (!e.material.materials) return void console.error(' can not bind to material.materials as node.material does not have a materials array', this)
  41925. e = e.material.materials
  41926. break
  41927. case 'bones':
  41928. if (!e.skeleton) return void console.error(' can not bind to bones as node does not have a skeleton', this)
  41929. e = e.skeleton.bones
  41930. for (var a = 0; a < e.length; a++)
  41931. if (e[a].name === o) {
  41932. o = a
  41933. break
  41934. }
  41935. break
  41936. default:
  41937. if (void 0 === e[i]) return void console.error(' can not bind to objectName of node, undefined', this)
  41938. e = e[i]
  41939. }
  41940. if (void 0 !== o) {
  41941. if (void 0 === e[o]) return void console.error(' trying to bind to objectIndex of objectName, but is undefined:', this, e)
  41942. e = e[o]
  41943. }
  41944. }
  41945. var s = e[n]
  41946. if (s) {
  41947. var l = this.Versioning.None
  41948. void 0 !== e.needsUpdate
  41949. ? ((l = this.Versioning.NeedsUpdate), (this.targetObject = e))
  41950. : void 0 !== e.matrixWorldNeedsUpdate && ((l = this.Versioning.MatrixWorldNeedsUpdate), (this.targetObject = e))
  41951. var c = this.BindingType.Direct
  41952. if (void 0 !== r) {
  41953. if ('morphTargetInfluences' === n) {
  41954. if (!e.geometry) return void console.error(' can not bind to morphTargetInfluences becasuse node does not have a geometry', this)
  41955. if (!e.geometry.morphTargets) return void console.error(' can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets', this)
  41956. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  41957. if (e.geometry.morphTargets[a].name === r) {
  41958. r = a
  41959. break
  41960. }
  41961. }
  41962. ;(c = this.BindingType.ArrayElement), (this.resolvedProperty = s), (this.propertyIndex = r)
  41963. } else
  41964. void 0 !== s.fromArray && void 0 !== s.toArray
  41965. ? ((c = this.BindingType.HasFromToArray), (this.resolvedProperty = s))
  41966. : void 0 !== s.length
  41967. ? ((c = this.BindingType.EntireArray), (this.resolvedProperty = s))
  41968. : (this.propertyName = n)
  41969. ;(this.getValue = this.GetterByBindingType[c]), (this.setValue = this.SetterByBindingTypeAndVersioning[c][l])
  41970. } else {
  41971. var h = t.nodeName
  41972. console.error(' trying to update property for track: ' + h + '.' + n + " but it wasn't found.", e)
  41973. }
  41974. } else console.error(' trying to update node for track: ' + this.path + " but it wasn't found.")
  41975. },
  41976. unbind: function () {
  41977. ;(this.node = null), (this.getValue = this._getValue_unbound), (this.setValue = this._setValue_unbound)
  41978. }
  41979. }),
  41980. Object.assign(Ci.PropertyBinding.prototype, {
  41981. _getValue_unavailable: function () {},
  41982. _setValue_unavailable: function () {},
  41983. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  41984. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  41985. BindingType: {
  41986. Direct: 0,
  41987. EntireArray: 1,
  41988. ArrayElement: 2,
  41989. HasFromToArray: 3
  41990. },
  41991. Versioning: {
  41992. None: 0,
  41993. NeedsUpdate: 1,
  41994. MatrixWorldNeedsUpdate: 2
  41995. },
  41996. GetterByBindingType: [
  41997. function (e, t) {
  41998. e[t] = this.node[this.propertyName]
  41999. },
  42000. function (e, t) {
  42001. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n) e[t++] = i[n]
  42002. },
  42003. function (e, t) {
  42004. e[t] = this.resolvedProperty[this.propertyIndex]
  42005. },
  42006. function (e, t) {
  42007. this.resolvedProperty.toArray(e, t)
  42008. }
  42009. ],
  42010. SetterByBindingTypeAndVersioning: [
  42011. [
  42012. function (e, t) {
  42013. this.node[this.propertyName] = e[t]
  42014. },
  42015. function (e, t) {
  42016. ;(this.node[this.propertyName] = e[t]), (this.targetObject.needsUpdate = !0)
  42017. },
  42018. function (e, t) {
  42019. ;(this.node[this.propertyName] = e[t]), (this.targetObject.matrixWorldNeedsUpdate = !0)
  42020. }
  42021. ],
  42022. [
  42023. function (e, t) {
  42024. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n) i[n] = e[t++]
  42025. },
  42026. function (e, t) {
  42027. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n) i[n] = e[t++]
  42028. this.targetObject.needsUpdate = !0
  42029. },
  42030. function (e, t) {
  42031. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n) i[n] = e[t++]
  42032. this.targetObject.matrixWorldNeedsUpdate = !0
  42033. }
  42034. ],
  42035. [
  42036. function (e, t) {
  42037. this.resolvedProperty[this.propertyIndex] = e[t]
  42038. },
  42039. function (e, t) {
  42040. ;(this.resolvedProperty[this.propertyIndex] = e[t]), (this.targetObject.needsUpdate = !0)
  42041. },
  42042. function (e, t) {
  42043. ;(this.resolvedProperty[this.propertyIndex] = e[t]), (this.targetObject.matrixWorldNeedsUpdate = !0)
  42044. }
  42045. ],
  42046. [
  42047. function (e, t) {
  42048. this.resolvedProperty.fromArray(e, t)
  42049. },
  42050. function (e, t) {
  42051. this.resolvedProperty.fromArray(e, t), (this.targetObject.needsUpdate = !0)
  42052. },
  42053. function (e, t) {
  42054. this.resolvedProperty.fromArray(e, t), (this.targetObject.matrixWorldNeedsUpdate = !0)
  42055. }
  42056. ]
  42057. ]
  42058. }),
  42059. (Ci.PropertyBinding.Composite = function (e, t, i) {
  42060. var n = i || Ci.PropertyBinding.parseTrackName(t)
  42061. ;(this._targetGroup = e), (this._bindings = e.subscribe_(t, n))
  42062. }),
  42063. (Ci.PropertyBinding.Composite.prototype = {
  42064. constructor: Ci.PropertyBinding.Composite,
  42065. getValue: function (e, t) {
  42066. this.bind()
  42067. var i = this._targetGroup.nCachedObjects_,
  42068. n = this._bindings[i]
  42069. void 0 !== n && n.getValue(e, t)
  42070. },
  42071. setValue: function (e, t) {
  42072. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n) i[n].setValue(e, t)
  42073. },
  42074. bind: function () {
  42075. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t) e[t].bind()
  42076. },
  42077. unbind: function () {
  42078. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t) e[t].unbind()
  42079. }
  42080. }),
  42081. (Ci.PropertyBinding.create = function (e, t, i) {
  42082. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e, t, i) : new Ci.PropertyBinding(e, t, i)
  42083. }),
  42084. (Ci.PropertyBinding.parseTrackName = function (e) {
  42085. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/,
  42086. i = t.exec(e)
  42087. if (!i) throw new Error('cannot parse trackName at all: ' + e)
  42088. i.index === t.lastIndex && t.lastIndex++
  42089. var n = {
  42090. nodeName: i[3],
  42091. objectName: i[5],
  42092. objectIndex: i[7],
  42093. propertyName: i[9],
  42094. propertyIndex: i[11]
  42095. }
  42096. if (null === n.propertyName || 0 === n.propertyName.length) throw new Error('can not parse propertyName from trackName: ' + e)
  42097. return n
  42098. }),
  42099. (Ci.PropertyBinding.findNode = function (e, r) {
  42100. if (!r || '' === r || 'root' === r || '.' === r || -1 === r || r === e.name || r === e.uuid) return e
  42101. if (e.skeleton) {
  42102. var t = (function (e) {
  42103. for (var t = 0; t < e.bones.length; t++) {
  42104. var i = e.bones[t]
  42105. if (i.name === r) return i
  42106. }
  42107. return null
  42108. })(e.skeleton)
  42109. if (t) return t
  42110. }
  42111. if (e.children) {
  42112. var o = function (e) {
  42113. for (var t = 0; t < e.length; t++) {
  42114. var i = e[t]
  42115. if (i.name === r || i.uuid === r) return i
  42116. var n = o(i.children)
  42117. if (n) return n
  42118. }
  42119. return null
  42120. },
  42121. i = o(e.children)
  42122. if (i) return i
  42123. }
  42124. return null
  42125. }),
  42126. (Ci.PropertyMixer = function (e, t, i) {
  42127. ;(this.binding = e), (this.valueSize = i)
  42128. var n,
  42129. r = Float64Array
  42130. switch (t) {
  42131. case 'quaternion':
  42132. n = this._slerp
  42133. break
  42134. case 'string':
  42135. case 'bool':
  42136. ;(r = Array), (n = this._select)
  42137. break
  42138. default:
  42139. n = this._lerp
  42140. }
  42141. ;(this.buffer = new r(4 * i)), (this._mixBufferRegion = n), (this.cumulativeWeight = 0), (this.useCount = 0), (this.referenceCount = 0)
  42142. }),
  42143. (Ci.PropertyMixer.prototype = {
  42144. constructor: Ci.PropertyMixer,
  42145. accumulate: function (e, t) {
  42146. var i = this.buffer,
  42147. n = this.valueSize,
  42148. r = e * n + n,
  42149. o = this.cumulativeWeight
  42150. if (0 === o) {
  42151. for (var a = 0; a !== n; ++a) i[r + a] = i[a]
  42152. o = t
  42153. } else {
  42154. var s = t / (o += t)
  42155. this._mixBufferRegion(i, r, 0, s, n)
  42156. }
  42157. this.cumulativeWeight = o
  42158. },
  42159. apply: function (e) {
  42160. var t = this.valueSize,
  42161. i = this.buffer,
  42162. n = e * t + t,
  42163. r = this.cumulativeWeight,
  42164. o = this.binding
  42165. if (((this.cumulativeWeight = 0), r < 1)) {
  42166. var a = 3 * t
  42167. this._mixBufferRegion(i, n, a, 1 - r, t)
  42168. }
  42169. for (var s = t, l = t + t; s !== l; ++s)
  42170. if (i[s] !== i[s + t]) {
  42171. o.setValue(i, n)
  42172. break
  42173. }
  42174. },
  42175. saveOriginalState: function () {
  42176. var e = this.binding,
  42177. t = this.buffer,
  42178. i = this.valueSize,
  42179. n = 3 * i
  42180. e.getValue(t, n)
  42181. for (var r = i, o = n; r !== o; ++r) t[r] = t[n + (r % i)]
  42182. this.cumulativeWeight = 0
  42183. },
  42184. restoreOriginalState: function () {
  42185. var e = 3 * this.valueSize
  42186. this.binding.setValue(this.buffer, e)
  42187. },
  42188. _select: function (e, t, i, n, r) {
  42189. if (0.5 <= n) for (var o = 0; o !== r; ++o) e[t + o] = e[i + o]
  42190. },
  42191. _slerp: function (e, t, i, n, r) {
  42192. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  42193. },
  42194. _lerp: function (e, t, i, n, r) {
  42195. for (var o = 1 - n, a = 0; a !== r; ++a) {
  42196. var s = t + a
  42197. e[s] = e[s] * o + e[i + a] * n
  42198. }
  42199. }
  42200. }),
  42201. (Ci.BooleanKeyframeTrack = function (e, t, i) {
  42202. Ci.KeyframeTrack.call(this, e, t, i)
  42203. }),
  42204. (Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  42205. constructor: Ci.BooleanKeyframeTrack,
  42206. ValueTypeName: 'bool',
  42207. ValueBufferType: Array,
  42208. DefaultInterpolation: Ci.IntepolateDiscrete,
  42209. InterpolantFactoryMethodLinear: void 0,
  42210. InterpolantFactoryMethodSmooth: void 0
  42211. })),
  42212. (Ci.NumberKeyframeTrack = function (e, t, i, n) {
  42213. Ci.KeyframeTrack.call(this, e, t, i, n)
  42214. }),
  42215. (Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  42216. constructor: Ci.NumberKeyframeTrack,
  42217. ValueTypeName: 'number'
  42218. })),
  42219. (Ci.QuaternionKeyframeTrack = function (e, t, i, n) {
  42220. Ci.KeyframeTrack.call(this, e, t, i, n)
  42221. }),
  42222. (Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  42223. constructor: Ci.QuaternionKeyframeTrack,
  42224. ValueTypeName: 'quaternion',
  42225. DefaultInterpolation: Ci.InterpolateLinear,
  42226. InterpolantFactoryMethodLinear: function (e) {
  42227. return new Ci.QuaternionLinearInterpolant(this.times, this.values, this.getValueSize(), e)
  42228. },
  42229. InterpolantFactoryMethodSmooth: void 0
  42230. })),
  42231. (Ci.StringKeyframeTrack = function (e, t, i, n) {
  42232. Ci.KeyframeTrack.call(this, e, t, i, n)
  42233. }),
  42234. (Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  42235. constructor: Ci.StringKeyframeTrack,
  42236. ValueTypeName: 'string',
  42237. ValueBufferType: Array,
  42238. DefaultInterpolation: Ci.IntepolateDiscrete,
  42239. InterpolantFactoryMethodLinear: void 0,
  42240. InterpolantFactoryMethodSmooth: void 0
  42241. })),
  42242. (Ci.VectorKeyframeTrack = function (e, t, i, n) {
  42243. Ci.KeyframeTrack.call(this, e, t, i, n)
  42244. }),
  42245. (Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  42246. constructor: Ci.VectorKeyframeTrack,
  42247. ValueTypeName: 'vector'
  42248. })),
  42249. (Ci.Audio = function (e) {
  42250. Ci.Object3D.call(this),
  42251. (this.type = 'Audio'),
  42252. (this.context = e.context),
  42253. (this.source = this.context.createBufferSource()),
  42254. (this.source.onended = this.onEnded.bind(this)),
  42255. (this.gain = this.context.createGain()),
  42256. this.gain.connect(e.getInput()),
  42257. (this.autoplay = !1),
  42258. (this.startTime = 0),
  42259. (this.playbackRate = 1),
  42260. (this.isPlaying = !1),
  42261. (this.hasPlaybackControl = !0),
  42262. (this.sourceType = 'empty'),
  42263. (this.filter = null)
  42264. }),
  42265. (Ci.Audio.prototype = Object.create(Ci.Object3D.prototype)),
  42266. (Ci.Audio.prototype.constructor = Ci.Audio),
  42267. (Ci.Audio.prototype.getOutput = function () {
  42268. return this.gain
  42269. }),
  42270. (Ci.Audio.prototype.load = function (e) {
  42271. var t = new Ci.AudioBuffer(this.context)
  42272. return t.load(e), this.setBuffer(t), this
  42273. }),
  42274. (Ci.Audio.prototype.setNodeSource = function (e) {
  42275. return (this.hasPlaybackControl = !1), (this.sourceType = 'audioNode'), (this.source = e), this.connect(), this
  42276. }),
  42277. (Ci.Audio.prototype.setBuffer = function (e) {
  42278. var t = this
  42279. return (
  42280. e.onReady(function (e) {
  42281. ;(t.source.buffer = e), (t.sourceType = 'buffer'), t.autoplay && t.play()
  42282. }),
  42283. this
  42284. )
  42285. }),
  42286. (Ci.Audio.prototype.play = function () {
  42287. if (!0 !== this.isPlaying)
  42288. if (!1 !== this.hasPlaybackControl) {
  42289. var e = this.context.createBufferSource()
  42290. ;(e.buffer = this.source.buffer),
  42291. (e.loop = this.source.loop),
  42292. (e.onended = this.source.onended),
  42293. e.start(0, this.startTime),
  42294. (e.playbackRate.value = this.playbackRate),
  42295. (this.isPlaying = !0),
  42296. (this.source = e),
  42297. this.connect()
  42298. } else console.warn('THREE.Audio: this Audio has no playback control.')
  42299. else console.warn('THREE.Audio: Audio is already playing.')
  42300. }),
  42301. (Ci.Audio.prototype.pause = function () {
  42302. return !1 === this.hasPlaybackControl ? void console.warn('THREE.Audio: this Audio has no playback control.') : (this.source.stop(), void (this.startTime = this.context.currentTime))
  42303. }),
  42304. (Ci.Audio.prototype.stop = function () {
  42305. return !1 === this.hasPlaybackControl ? void console.warn('THREE.Audio: this Audio has no playback control.') : (this.source.stop(), void (this.startTime = 0))
  42306. }),
  42307. (Ci.Audio.prototype.connect = function () {
  42308. null !== this.filter ? (this.source.connect(this.filter), this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  42309. }),
  42310. (Ci.Audio.prototype.disconnect = function () {
  42311. null !== this.filter ? (this.source.disconnect(this.filter), this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  42312. }),
  42313. (Ci.Audio.prototype.getFilter = function () {
  42314. return this.filter
  42315. }),
  42316. (Ci.Audio.prototype.setFilter = function (e) {
  42317. void 0 === e && (e = null), !0 === this.isPlaying ? (this.disconnect(), (this.filter = e), this.connect()) : (this.filter = e)
  42318. }),
  42319. (Ci.Audio.prototype.setPlaybackRate = function (e) {
  42320. return !1 === this.hasPlaybackControl
  42321. ? void console.warn('THREE.Audio: this Audio has no playback control.')
  42322. : ((this.playbackRate = e), void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  42323. }),
  42324. (Ci.Audio.prototype.getPlaybackRate = function () {
  42325. return this.playbackRate
  42326. }),
  42327. (Ci.Audio.prototype.onEnded = function () {
  42328. this.isPlaying = !1
  42329. }),
  42330. (Ci.Audio.prototype.setLoop = function (e) {
  42331. return !1 === this.hasPlaybackControl ? void console.warn('THREE.Audio: this Audio has no playback control.') : void (this.source.loop = e)
  42332. }),
  42333. (Ci.Audio.prototype.getLoop = function () {
  42334. return !1 === this.hasPlaybackControl ? (console.warn('THREE.Audio: this Audio has no playback control.'), !1) : this.source.loop
  42335. }),
  42336. (Ci.Audio.prototype.setVolume = function (e) {
  42337. this.gain.gain.value = e
  42338. }),
  42339. (Ci.Audio.prototype.getVolume = function () {
  42340. return this.gain.gain.value
  42341. }),
  42342. (Ci.AudioAnalyser = function (e, t) {
  42343. ;(this.analyser = e.context.createAnalyser()),
  42344. (this.analyser.fftSize = void 0 !== t ? t : 2048),
  42345. (this.data = new Uint8Array(this.analyser.frequencyBinCount)),
  42346. e.getOutput().connect(this.analyser)
  42347. }),
  42348. (Ci.AudioAnalyser.prototype = {
  42349. constructor: Ci.AudioAnalyser,
  42350. getData: function () {
  42351. return this.analyser.getByteFrequencyData(this.data), this.data
  42352. }
  42353. }),
  42354. (Ci.AudioBuffer = function (e) {
  42355. ;(this.context = e), (this.ready = !1), (this.readyCallbacks = [])
  42356. }),
  42357. (Ci.AudioBuffer.prototype.load = function (e) {
  42358. var i = this,
  42359. t = new XMLHttpRequest()
  42360. return (
  42361. t.open('GET', e, !0),
  42362. (t.responseType = 'arraybuffer'),
  42363. (t.onload = function (e) {
  42364. i.context.decodeAudioData(this.response, function (e) {
  42365. ;(i.buffer = e), (i.ready = !0)
  42366. for (var t = 0; t < i.readyCallbacks.length; t++) i.readyCallbacks[t](i.buffer)
  42367. i.readyCallbacks = []
  42368. })
  42369. }),
  42370. t.send(),
  42371. this
  42372. )
  42373. }),
  42374. (Ci.AudioBuffer.prototype.onReady = function (e) {
  42375. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  42376. }),
  42377. (Ci.PositionalAudio = function (e) {
  42378. Ci.Audio.call(this, e), (this.panner = this.context.createPanner()), this.panner.connect(this.gain)
  42379. }),
  42380. (Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype)),
  42381. (Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio),
  42382. (Ci.PositionalAudio.prototype.getOutput = function () {
  42383. return this.panner
  42384. }),
  42385. (Ci.PositionalAudio.prototype.setRefDistance = function (e) {
  42386. this.panner.refDistance = e
  42387. }),
  42388. (Ci.PositionalAudio.prototype.getRefDistance = function () {
  42389. return this.panner.refDistance
  42390. }),
  42391. (Ci.PositionalAudio.prototype.setRolloffFactor = function (e) {
  42392. this.panner.rolloffFactor = e
  42393. }),
  42394. (Ci.PositionalAudio.prototype.getRolloffFactor = function () {
  42395. return this.panner.rolloffFactor
  42396. }),
  42397. (Ci.PositionalAudio.prototype.setDistanceModel = function (e) {
  42398. this.panner.distanceModel = e
  42399. }),
  42400. (Ci.PositionalAudio.prototype.getDistanceModel = function () {
  42401. return this.panner.distanceModel
  42402. }),
  42403. (Ci.PositionalAudio.prototype.setMaxDistance = function (e) {
  42404. this.panner.maxDistance = e
  42405. }),
  42406. (Ci.PositionalAudio.prototype.getMaxDistance = function () {
  42407. return this.panner.maxDistance
  42408. }),
  42409. (Ci.PositionalAudio.prototype.updateMatrixWorld =
  42410. ((it = new Ci.Vector3()),
  42411. function (e) {
  42412. Ci.Object3D.prototype.updateMatrixWorld.call(this, e), it.setFromMatrixPosition(this.matrixWorld), this.panner.setPosition(it.x, it.y, it.z)
  42413. })),
  42414. (Ci.AudioListener = function () {
  42415. Ci.Object3D.call(this),
  42416. (this.type = 'AudioListener'),
  42417. (this.context = new (window.AudioContext || window.webkitAudioContext)()),
  42418. (this.gain = this.context.createGain()),
  42419. this.gain.connect(this.context.destination),
  42420. (this.filter = null)
  42421. }),
  42422. (Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype)),
  42423. (Ci.AudioListener.prototype.constructor = Ci.AudioListener),
  42424. (Ci.AudioListener.prototype.getInput = function () {
  42425. return this.gain
  42426. }),
  42427. (Ci.AudioListener.prototype.removeFilter = function () {
  42428. null !== this.filter && (this.gain.disconnect(this.filter), this.filter.disconnect(this.context.destination), this.gain.connect(this.context.destination), (this.filter = null))
  42429. }),
  42430. (Ci.AudioListener.prototype.setFilter = function (e) {
  42431. null !== this.filter ? (this.gain.disconnect(this.filter), this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  42432. (this.filter = e),
  42433. this.gain.connect(this.filter),
  42434. this.filter.connect(this.context.destination)
  42435. }),
  42436. (Ci.AudioListener.prototype.getFilter = function () {
  42437. return this.filter
  42438. }),
  42439. (Ci.AudioListener.prototype.setMasterVolume = function (e) {
  42440. this.gain.gain.value = e
  42441. }),
  42442. (Ci.AudioListener.prototype.getMasterVolume = function () {
  42443. return this.gain.gain.value
  42444. }),
  42445. (Ci.AudioListener.prototype.updateMatrixWorld =
  42446. ((Je = new Ci.Vector3()),
  42447. ($e = new Ci.Quaternion()),
  42448. (et = new Ci.Vector3()),
  42449. (tt = new Ci.Vector3()),
  42450. function (e) {
  42451. Ci.Object3D.prototype.updateMatrixWorld.call(this, e)
  42452. var t = this.context.listener,
  42453. i = this.up
  42454. 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)
  42455. })),
  42456. (Ci.Camera = function () {
  42457. Ci.Object3D.call(this), (this.type = 'Camera'), (this.matrixWorldInverse = new Ci.Matrix4()), (this.projectionMatrix = new Ci.Matrix4())
  42458. }),
  42459. (Ci.Camera.prototype = Object.create(Ci.Object3D.prototype)),
  42460. (Ci.Camera.prototype.constructor = Ci.Camera),
  42461. (Ci.Camera.prototype.getWorldDirection =
  42462. ((Qe = new Ci.Quaternion()),
  42463. function (e) {
  42464. var t = e || new Ci.Vector3()
  42465. return this.getWorldQuaternion(Qe), t.set(0, 0, -1).applyQuaternion(Qe)
  42466. })),
  42467. (Ci.Camera.prototype.lookAt =
  42468. ((Ke = new Ci.Matrix4()),
  42469. function (e) {
  42470. Ke.lookAt(this.position, e, this.up), this.quaternion.setFromRotationMatrix(Ke)
  42471. })),
  42472. (Ci.Camera.prototype.clone = function () {
  42473. return new this.constructor().copy(this)
  42474. }),
  42475. (Ci.Camera.prototype.copy = function (e) {
  42476. return Ci.Object3D.prototype.copy.call(this, e), this.matrixWorldInverse.copy(e.matrixWorldInverse), this.projectionMatrix.copy(e.projectionMatrix), this
  42477. }),
  42478. (Ci.CubeCamera = function (e, t, i) {
  42479. Ci.Object3D.call(this), (this.type = 'CubeCamera')
  42480. var r = new Ci.PerspectiveCamera(90, 1, e, t)
  42481. r.up.set(0, -1, 0), r.lookAt(new Ci.Vector3(1, 0, 0)), this.add(r)
  42482. var o = new Ci.PerspectiveCamera(90, 1, e, t)
  42483. o.up.set(0, -1, 0), o.lookAt(new Ci.Vector3(-1, 0, 0)), this.add(o)
  42484. var a = new Ci.PerspectiveCamera(90, 1, e, t)
  42485. a.up.set(0, 0, 1), a.lookAt(new Ci.Vector3(0, 1, 0)), this.add(a)
  42486. var s = new Ci.PerspectiveCamera(90, 1, e, t)
  42487. s.up.set(0, 0, -1), s.lookAt(new Ci.Vector3(0, -1, 0)), this.add(s)
  42488. var l = new Ci.PerspectiveCamera(90, 1, e, t)
  42489. l.up.set(0, -1, 0), l.lookAt(new Ci.Vector3(0, 0, 1)), this.add(l)
  42490. var c = new Ci.PerspectiveCamera(90, 1, e, t)
  42491. c.up.set(0, -1, 0), c.lookAt(new Ci.Vector3(0, 0, -1)), this.add(c)
  42492. var n = {
  42493. format: Ci.RGBFormat,
  42494. magFilter: Ci.LinearFilter,
  42495. minFilter: Ci.LinearFilter
  42496. }
  42497. ;(this.renderTarget = new Ci.WebGLRenderTargetCube(i, i, n)),
  42498. (this.updateCubeMap = function (e, t) {
  42499. null === this.parent && this.updateMatrixWorld()
  42500. var i = this.renderTarget,
  42501. n = i.texture.generateMipmaps
  42502. ;(i.texture.generateMipmaps = !1),
  42503. (i.activeCubeFace = 0),
  42504. e.render(t, r, i),
  42505. (i.activeCubeFace = 1),
  42506. e.render(t, o, i),
  42507. (i.activeCubeFace = 2),
  42508. e.render(t, a, i),
  42509. (i.activeCubeFace = 3),
  42510. e.render(t, s, i),
  42511. (i.activeCubeFace = 4),
  42512. e.render(t, l, i),
  42513. (i.texture.generateMipmaps = n),
  42514. (i.activeCubeFace = 5),
  42515. e.render(t, c, i),
  42516. e.setRenderTarget(null)
  42517. })
  42518. }),
  42519. (Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype)),
  42520. (Ci.CubeCamera.prototype.constructor = Ci.CubeCamera),
  42521. (Ci.OrthographicCamera = function (e, t, i, n, r, o) {
  42522. Ci.Camera.call(this),
  42523. (this.type = 'OrthographicCamera'),
  42524. (this.zoom = 1),
  42525. (this.left = e),
  42526. (this.right = t),
  42527. (this.top = i),
  42528. (this.bottom = n),
  42529. (this.near = void 0 !== r ? r : 0.1),
  42530. (this.far = void 0 !== o ? o : 2e3),
  42531. this.updateProjectionMatrix()
  42532. }),
  42533. (Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype)),
  42534. (Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera),
  42535. (Ci.OrthographicCamera.prototype.updateProjectionMatrix = function () {
  42536. var e = (this.right - this.left) / (2 * this.zoom),
  42537. t = (this.top - this.bottom) / (2 * this.zoom),
  42538. i = (this.right + this.left) / 2,
  42539. n = (this.top + this.bottom) / 2
  42540. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  42541. }),
  42542. (Ci.OrthographicCamera.prototype.copy = function (e) {
  42543. return (
  42544. Ci.Camera.prototype.copy.call(this, e),
  42545. (this.left = e.left),
  42546. (this.right = e.right),
  42547. (this.top = e.top),
  42548. (this.bottom = e.bottom),
  42549. (this.near = e.near),
  42550. (this.far = e.far),
  42551. (this.zoom = e.zoom),
  42552. this
  42553. )
  42554. }),
  42555. (Ci.OrthographicCamera.prototype.toJSON = function (e) {
  42556. var t = Ci.Object3D.prototype.toJSON.call(this, e)
  42557. return (
  42558. (t.object.zoom = this.zoom),
  42559. (t.object.left = this.left),
  42560. (t.object.right = this.right),
  42561. (t.object.top = this.top),
  42562. (t.object.bottom = this.bottom),
  42563. (t.object.near = this.near),
  42564. (t.object.far = this.far),
  42565. t
  42566. )
  42567. }),
  42568. (Ci.PerspectiveCamera = function (e, t, i, n) {
  42569. Ci.Camera.call(this),
  42570. (this.type = 'PerspectiveCamera'),
  42571. (this.focalLength = 10),
  42572. (this.zoom = 1),
  42573. (this.fov = void 0 !== e ? e : 50),
  42574. (this.aspect = void 0 !== t ? t : 1),
  42575. (this.near = void 0 !== i ? i : 0.1),
  42576. (this.far = void 0 !== n ? n : 2e3),
  42577. this.updateProjectionMatrix()
  42578. }),
  42579. (Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype)),
  42580. (Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera),
  42581. (Ci.PerspectiveCamera.prototype.setLens = function (e, t) {
  42582. void 0 === t && (t = 24), (this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e)))), this.updateProjectionMatrix()
  42583. }),
  42584. (Ci.PerspectiveCamera.prototype.setViewOffset = function (e, t, i, n, r, o) {
  42585. ;(this.fullWidth = e), (this.fullHeight = t), (this.x = i), (this.y = n), (this.width = r), (this.height = o), this.updateProjectionMatrix()
  42586. }),
  42587. (Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function () {
  42588. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(0.5 * Ci.Math.degToRad(this.fov)) / this.zoom))
  42589. if (this.fullWidth) {
  42590. var t = this.fullWidth / this.fullHeight,
  42591. i = Math.tan(Ci.Math.degToRad(0.5 * e)) * this.near,
  42592. n = -i,
  42593. r = t * n,
  42594. o = t * i,
  42595. a = Math.abs(o - r),
  42596. s = Math.abs(i - n)
  42597. this.projectionMatrix.makeFrustum(
  42598. r + (this.x * a) / this.fullWidth,
  42599. r + ((this.x + this.width) * a) / this.fullWidth,
  42600. i - ((this.y + this.height) * s) / this.fullHeight,
  42601. i - (this.y * s) / this.fullHeight,
  42602. this.near,
  42603. this.far
  42604. )
  42605. } else this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  42606. }),
  42607. (Ci.PerspectiveCamera.prototype.copy = function (e) {
  42608. return (
  42609. Ci.Camera.prototype.copy.call(this, e),
  42610. (this.focalLength = e.focalLength),
  42611. (this.zoom = e.zoom),
  42612. (this.fov = e.fov),
  42613. (this.aspect = e.aspect),
  42614. (this.near = e.near),
  42615. (this.far = e.far),
  42616. this
  42617. )
  42618. }),
  42619. (Ci.PerspectiveCamera.prototype.toJSON = function (e) {
  42620. var t = Ci.Object3D.prototype.toJSON.call(this, e)
  42621. return (
  42622. (t.object.focalLength = this.focalLength),
  42623. (t.object.zoom = this.zoom),
  42624. (t.object.fov = this.fov),
  42625. (t.object.aspect = this.aspect),
  42626. (t.object.near = this.near),
  42627. (t.object.far = this.far),
  42628. t
  42629. )
  42630. }),
  42631. (Ci.StereoCamera = function () {
  42632. ;(this.type = 'StereoCamera'),
  42633. (this.aspect = 1),
  42634. (this.cameraL = new Ci.PerspectiveCamera()),
  42635. this.cameraL.layers.enable(1),
  42636. (this.cameraL.matrixAutoUpdate = !1),
  42637. (this.cameraR = new Ci.PerspectiveCamera()),
  42638. this.cameraR.layers.enable(2),
  42639. (this.cameraR.matrixAutoUpdate = !1)
  42640. }),
  42641. (Ci.StereoCamera.prototype = {
  42642. constructor: Ci.StereoCamera,
  42643. update:
  42644. ((Xe = new Ci.Matrix4()),
  42645. (Ze = new Ci.Matrix4()),
  42646. function (e) {
  42647. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  42648. ;(Ge = e.focalLength), (We = e.fov), (je = e.aspect * this.aspect), (Ye = e.near), (qe = e.far)
  42649. var t,
  42650. i,
  42651. n = e.projectionMatrix.clone(),
  42652. r = (0.032 * Ye) / Ge,
  42653. o = Ye * Math.tan(Ci.Math.degToRad(0.5 * We))
  42654. ;(Ze.elements[12] = -0.032),
  42655. (Xe.elements[12] = 0.032),
  42656. (t = -o * je + r),
  42657. (i = o * je + r),
  42658. (n.elements[0] = (2 * Ye) / (i - t)),
  42659. (n.elements[8] = (i + t) / (i - t)),
  42660. this.cameraL.projectionMatrix.copy(n),
  42661. (t = -o * je - r),
  42662. (i = o * je - r),
  42663. (n.elements[0] = (2 * Ye) / (i - t)),
  42664. (n.elements[8] = (i + t) / (i - t)),
  42665. this.cameraR.projectionMatrix.copy(n)
  42666. }
  42667. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze), this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  42668. })
  42669. }),
  42670. (Ci.Light = function (e, t) {
  42671. Ci.Object3D.call(this), (this.type = 'Light'), (this.color = new Ci.Color(e)), (this.intensity = void 0 !== t ? t : 1), (this.receiveShadow = void 0)
  42672. }),
  42673. (Ci.Light.prototype = Object.create(Ci.Object3D.prototype)),
  42674. (Ci.Light.prototype.constructor = Ci.Light),
  42675. (Ci.Light.prototype.copy = function (e) {
  42676. return Ci.Object3D.prototype.copy.call(this, e), this.color.copy(e.color), (this.intensity = e.intensity), this
  42677. }),
  42678. (Ci.Light.prototype.toJSON = function (e) {
  42679. var t = Ci.Object3D.prototype.toJSON.call(this, e)
  42680. return (
  42681. (t.object.color = this.color.getHex()),
  42682. (t.object.intensity = this.intensity),
  42683. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  42684. void 0 !== this.distance && (t.object.distance = this.distance),
  42685. void 0 !== this.angle && (t.object.angle = this.angle),
  42686. void 0 !== this.decay && (t.object.decay = this.decay),
  42687. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  42688. t
  42689. )
  42690. }),
  42691. (Ci.LightShadow = function (e) {
  42692. ;(this.camera = e), (this.bias = 0), (this.radius = 1), (this.mapSize = new Ci.Vector2(512, 512)), (this.map = null), (this.matrix = new Ci.Matrix4())
  42693. }),
  42694. (Ci.LightShadow.prototype = {
  42695. constructor: Ci.LightShadow,
  42696. copy: function (e) {
  42697. return (this.camera = e.camera.clone()), (this.bias = e.bias), (this.radius = e.radius), this.mapSize.copy(e.mapSize), this
  42698. },
  42699. clone: function () {
  42700. return new this.constructor().copy(this)
  42701. }
  42702. }),
  42703. (Ci.AmbientLight = function (e, t) {
  42704. Ci.Light.call(this, e, t), (this.type = 'AmbientLight'), (this.castShadow = void 0)
  42705. }),
  42706. (Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype)),
  42707. (Ci.AmbientLight.prototype.constructor = Ci.AmbientLight),
  42708. (Ci.DirectionalLight = function (e, t) {
  42709. Ci.Light.call(this, e, t),
  42710. (this.type = 'DirectionalLight'),
  42711. this.position.set(0, 1, 0),
  42712. this.updateMatrix(),
  42713. (this.target = new Ci.Object3D()),
  42714. (this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5, 5, 5, -5, 0.5, 500)))
  42715. }),
  42716. (Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype)),
  42717. (Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight),
  42718. (Ci.DirectionalLight.prototype.copy = function (e) {
  42719. return Ci.Light.prototype.copy.call(this, e), (this.target = e.target.clone()), (this.shadow = e.shadow.clone()), this
  42720. }),
  42721. (Ci.HemisphereLight = function (e, t, i) {
  42722. 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))
  42723. }),
  42724. (Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype)),
  42725. (Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight),
  42726. (Ci.HemisphereLight.prototype.copy = function (e) {
  42727. return Ci.Light.prototype.copy.call(this, e), this.groundColor.copy(e.groundColor), this
  42728. }),
  42729. (Ci.PointLight = function (e, t, i, n) {
  42730. Ci.Light.call(this, e, t),
  42731. (this.type = 'PointLight'),
  42732. (this.distance = void 0 !== i ? i : 0),
  42733. (this.decay = void 0 !== n ? n : 1),
  42734. (this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90, 1, 0.5, 500)))
  42735. }),
  42736. (Ci.PointLight.prototype = Object.create(Ci.Light.prototype)),
  42737. (Ci.PointLight.prototype.constructor = Ci.PointLight),
  42738. Object.defineProperty(Ci.PointLight.prototype, 'power', {
  42739. get: function () {
  42740. return 4 * this.intensity * Math.PI
  42741. },
  42742. set: function (e) {
  42743. this.intensity = e / (4 * Math.PI)
  42744. }
  42745. }),
  42746. (Ci.PointLight.prototype.copy = function (e) {
  42747. return Ci.Light.prototype.copy.call(this, e), (this.distance = e.distance), (this.decay = e.decay), (this.shadow = e.shadow.clone()), this
  42748. }),
  42749. (Ci.SpotLight = function (e, t, i, n, r, o) {
  42750. Ci.Light.call(this, e, t),
  42751. (this.type = 'SpotLight'),
  42752. this.position.set(0, 1, 0),
  42753. this.updateMatrix(),
  42754. (this.target = new Ci.Object3D()),
  42755. (this.distance = void 0 !== i ? i : 0),
  42756. (this.angle = void 0 !== n ? n : Math.PI / 3),
  42757. (this.penumbra = void 0 !== r ? r : 0),
  42758. (this.decay = void 0 !== o ? o : 1),
  42759. (this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50, 1, 0.5, 500)))
  42760. }),
  42761. (Ci.SpotLight.prototype = Object.create(Ci.Light.prototype)),
  42762. (Ci.SpotLight.prototype.constructor = Ci.SpotLight),
  42763. Object.defineProperty(Ci.SpotLight.prototype, 'power', {
  42764. get: function () {
  42765. return this.intensity * Math.PI
  42766. },
  42767. set: function (e) {
  42768. this.intensity = e / Math.PI
  42769. }
  42770. }),
  42771. (Ci.SpotLight.prototype.copy = function (e) {
  42772. return (
  42773. Ci.Light.prototype.copy.call(this, e),
  42774. (this.distance = e.distance),
  42775. (this.angle = e.angle),
  42776. (this.penumbra = e.penumbra),
  42777. (this.decay = e.decay),
  42778. (this.target = e.target.clone()),
  42779. (this.shadow = e.shadow.clone()),
  42780. this
  42781. )
  42782. }),
  42783. (Ci.Cache = {
  42784. enabled: !1,
  42785. files: {},
  42786. add: function (e, t) {
  42787. !1 !== this.enabled && (this.files[e] = t)
  42788. },
  42789. get: function (e) {
  42790. if (!1 !== this.enabled) return this.files[e]
  42791. },
  42792. remove: function (e) {
  42793. delete this.files[e]
  42794. },
  42795. clear: function () {
  42796. this.files = {}
  42797. }
  42798. }),
  42799. (Ci.Loader = function () {
  42800. ;(this.onLoadStart = function () {}), (this.onLoadProgress = function () {}), (this.onLoadComplete = function () {})
  42801. }),
  42802. (Ci.Loader.prototype = {
  42803. constructor: Ci.Loader,
  42804. crossOrigin: void 0,
  42805. extractUrlBase: function (e) {
  42806. var t = e.split('/')
  42807. return 1 === t.length ? './' : (t.pop(), t.join('/') + '/')
  42808. },
  42809. initMaterials: function (e, t, i) {
  42810. for (var n = [], r = 0; r < e.length; ++r) n[r] = this.createMaterial(e[r], t, i)
  42811. return n
  42812. },
  42813. createMaterial: function (e, c, h) {
  42814. function t(e, t, i, n, r) {
  42815. var o,
  42816. a = c + e,
  42817. s = Ci.Loader.Handlers.get(a)
  42818. ;(o = null !== s ? s.load(a) : (He.setCrossOrigin(h), He.load(a))),
  42819. void 0 !== t && (o.repeat.fromArray(t), 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping), 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  42820. void 0 !== i && o.offset.fromArray(i),
  42821. void 0 !== n &&
  42822. ('repeat' === n[0] && (o.wrapS = Ci.RepeatWrapping),
  42823. 'mirror' === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  42824. 'repeat' === n[1] && (o.wrapT = Ci.RepeatWrapping),
  42825. 'mirror' === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  42826. void 0 !== r && (o.anisotropy = r)
  42827. var l = Ci.Math.generateUUID()
  42828. return (u[l] = o), l
  42829. }
  42830. void 0 === Ue && (Ue = new Ci.Color()), void 0 === He && (He = new Ci.TextureLoader()), void 0 === ze && (ze = new Ci.MaterialLoader())
  42831. var u = {},
  42832. i = {
  42833. uuid: Ci.Math.generateUUID(),
  42834. type: 'MeshLambertMaterial'
  42835. }
  42836. for (var n in e) {
  42837. var r = e[n]
  42838. switch (n) {
  42839. case 'DbgColor':
  42840. case 'DbgIndex':
  42841. case 'opticalDensity':
  42842. case 'illumination':
  42843. break
  42844. case 'DbgName':
  42845. i.name = r
  42846. break
  42847. case 'blending':
  42848. i.blending = Ci[r]
  42849. break
  42850. case 'colorAmbient':
  42851. case 'mapAmbient':
  42852. console.warn('THREE.Loader.createMaterial:', n, 'is no longer supported.')
  42853. break
  42854. case 'colorDiffuse':
  42855. i.color = Ue.fromArray(r).getHex()
  42856. break
  42857. case 'colorSpecular':
  42858. i.specular = Ue.fromArray(r).getHex()
  42859. break
  42860. case 'colorEmissive':
  42861. i.emissive = Ue.fromArray(r).getHex()
  42862. break
  42863. case 'specularCoef':
  42864. i.shininess = r
  42865. break
  42866. case 'shading':
  42867. 'basic' === r.toLowerCase() && (i.type = 'MeshBasicMaterial'), 'phong' === r.toLowerCase() && (i.type = 'MeshPhongMaterial')
  42868. break
  42869. case 'mapDiffuse':
  42870. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy)
  42871. break
  42872. case 'mapDiffuseRepeat':
  42873. case 'mapDiffuseOffset':
  42874. case 'mapDiffuseWrap':
  42875. case 'mapDiffuseAnisotropy':
  42876. break
  42877. case 'mapLight':
  42878. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy)
  42879. break
  42880. case 'mapLightRepeat':
  42881. case 'mapLightOffset':
  42882. case 'mapLightWrap':
  42883. case 'mapLightAnisotropy':
  42884. break
  42885. case 'mapAO':
  42886. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy)
  42887. break
  42888. case 'mapAORepeat':
  42889. case 'mapAOOffset':
  42890. case 'mapAOWrap':
  42891. case 'mapAOAnisotropy':
  42892. break
  42893. case 'mapBump':
  42894. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy)
  42895. break
  42896. case 'mapBumpScale':
  42897. i.bumpScale = r
  42898. break
  42899. case 'mapBumpRepeat':
  42900. case 'mapBumpOffset':
  42901. case 'mapBumpWrap':
  42902. case 'mapBumpAnisotropy':
  42903. break
  42904. case 'mapNormal':
  42905. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy)
  42906. break
  42907. case 'mapNormalFactor':
  42908. i.normalScale = [r, r]
  42909. break
  42910. case 'mapNormalRepeat':
  42911. case 'mapNormalOffset':
  42912. case 'mapNormalWrap':
  42913. case 'mapNormalAnisotropy':
  42914. break
  42915. case 'mapSpecular':
  42916. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy)
  42917. break
  42918. case 'mapSpecularRepeat':
  42919. case 'mapSpecularOffset':
  42920. case 'mapSpecularWrap':
  42921. case 'mapSpecularAnisotropy':
  42922. break
  42923. case 'mapAlpha':
  42924. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy)
  42925. break
  42926. case 'mapAlphaRepeat':
  42927. case 'mapAlphaOffset':
  42928. case 'mapAlphaWrap':
  42929. case 'mapAlphaAnisotropy':
  42930. break
  42931. case 'flipSided':
  42932. i.side = Ci.BackSide
  42933. break
  42934. case 'doubleSided':
  42935. i.side = Ci.DoubleSide
  42936. break
  42937. case 'transparency':
  42938. console.warn('THREE.Loader.createMaterial: transparency has been renamed to opacity'), (i.opacity = r)
  42939. break
  42940. case 'depthTest':
  42941. case 'depthWrite':
  42942. case 'colorWrite':
  42943. case 'opacity':
  42944. case 'reflectivity':
  42945. case 'transparent':
  42946. case 'visible':
  42947. case 'wireframe':
  42948. i[n] = r
  42949. break
  42950. case 'vertexColors':
  42951. !0 === r && (i.vertexColors = Ci.VertexColors), 'face' === r && (i.vertexColors = Ci.FaceColors)
  42952. break
  42953. default:
  42954. console.error('THREE.Loader.createMaterial: Unsupported', n, r)
  42955. }
  42956. }
  42957. 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)
  42958. }
  42959. }),
  42960. (Ci.Loader.Handlers = {
  42961. handlers: [],
  42962. add: function (e, t) {
  42963. this.handlers.push(e, t)
  42964. },
  42965. get: function (e) {
  42966. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  42967. var r = t[i],
  42968. o = t[i + 1]
  42969. if (r.test(e)) return o
  42970. }
  42971. return null
  42972. }
  42973. }),
  42974. (Ci.XHRLoader = function (e) {
  42975. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  42976. }),
  42977. (Ci.XHRLoader.prototype = {
  42978. constructor: Ci.XHRLoader,
  42979. load: function (i, n, t, r) {
  42980. void 0 !== this.path && (i = this.path + i)
  42981. var o = this,
  42982. e = Ci.Cache.get(i)
  42983. if (void 0 !== e)
  42984. return (
  42985. n &&
  42986. setTimeout(function () {
  42987. n(e)
  42988. }, 0),
  42989. e
  42990. )
  42991. var a = new XMLHttpRequest()
  42992. return (
  42993. a.overrideMimeType('text/plain'),
  42994. a.open('GET', i, !0),
  42995. a.addEventListener(
  42996. 'load',
  42997. function (e) {
  42998. var t = e.target.response
  42999. Ci.Cache.add(i, t),
  43000. 200 === this.status
  43001. ? (n && n(t), o.manager.itemEnd(i))
  43002. : 0 === this.status
  43003. ? (console.warn('THREE.XHRLoader: HTTP Status 0 received.'), n && n(t), o.manager.itemEnd(i))
  43004. : (r && r(e), o.manager.itemError(i))
  43005. },
  43006. !1
  43007. ),
  43008. void 0 !== t &&
  43009. a.addEventListener(
  43010. 'progress',
  43011. function (e) {
  43012. t(e)
  43013. },
  43014. !1
  43015. ),
  43016. a.addEventListener(
  43017. 'error',
  43018. function (e) {
  43019. r && r(e), o.manager.itemError(i)
  43020. },
  43021. !1
  43022. ),
  43023. void 0 !== this.responseType && (a.responseType = this.responseType),
  43024. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  43025. a.send(null),
  43026. o.manager.itemStart(i),
  43027. a
  43028. )
  43029. },
  43030. setPath: function (e) {
  43031. this.path = e
  43032. },
  43033. setResponseType: function (e) {
  43034. this.responseType = e
  43035. },
  43036. setWithCredentials: function (e) {
  43037. this.withCredentials = e
  43038. }
  43039. }),
  43040. (Ci.FontLoader = function (e) {
  43041. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  43042. }),
  43043. (Ci.FontLoader.prototype = {
  43044. constructor: Ci.FontLoader,
  43045. load: function (e, t, i, n) {
  43046. new Ci.XHRLoader(this.manager).load(
  43047. e,
  43048. function (e) {
  43049. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  43050. },
  43051. i,
  43052. n
  43053. )
  43054. }
  43055. }),
  43056. (Ci.ImageLoader = function (e) {
  43057. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  43058. }),
  43059. (Ci.ImageLoader.prototype = {
  43060. constructor: Ci.ImageLoader,
  43061. load: function (t, i, n, r) {
  43062. void 0 !== this.path && (t = this.path + t)
  43063. var o = this,
  43064. e = Ci.Cache.get(t)
  43065. if (void 0 !== e)
  43066. return (
  43067. o.manager.itemStart(t),
  43068. i
  43069. ? setTimeout(function () {
  43070. i(e), o.manager.itemEnd(t)
  43071. }, 0)
  43072. : o.manager.itemEnd(t),
  43073. e
  43074. )
  43075. var a = document.createElement('img')
  43076. return (
  43077. a.addEventListener(
  43078. 'load',
  43079. function (e) {
  43080. Ci.Cache.add(t, this), i && i(this), o.manager.itemEnd(t)
  43081. },
  43082. !1
  43083. ),
  43084. void 0 !== n &&
  43085. a.addEventListener(
  43086. 'progress',
  43087. function (e) {
  43088. n(e)
  43089. },
  43090. !1
  43091. ),
  43092. a.addEventListener(
  43093. 'error',
  43094. function (e) {
  43095. r && r(e), o.manager.itemError(t)
  43096. },
  43097. !1
  43098. ),
  43099. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  43100. o.manager.itemStart(t),
  43101. (a.src = t),
  43102. a
  43103. )
  43104. },
  43105. setCrossOrigin: function (e) {
  43106. this.crossOrigin = e
  43107. },
  43108. setPath: function (e) {
  43109. this.path = e
  43110. }
  43111. }),
  43112. (Ci.JSONLoader = function (e) {
  43113. 'boolean' == typeof e && (console.warn('THREE.JSONLoader: showStatus parameter has been removed from constructor.'), (e = void 0)),
  43114. (this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager),
  43115. (this.withCredentials = !1)
  43116. }),
  43117. (Ci.JSONLoader.prototype = {
  43118. constructor: Ci.JSONLoader,
  43119. get statusDomElement() {
  43120. return (
  43121. void 0 === this._statusDomElement && (this._statusDomElement = document.createElement('div')),
  43122. console.warn('THREE.JSONLoader: .statusDomElement has been removed.'),
  43123. this._statusDomElement
  43124. )
  43125. },
  43126. load: function (o, a, e, t) {
  43127. var s = this,
  43128. l = this.texturePath && 'string' == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o),
  43129. i = new Ci.XHRLoader(this.manager)
  43130. i.setWithCredentials(this.withCredentials),
  43131. i.load(
  43132. o,
  43133. function (e) {
  43134. var t = JSON.parse(e),
  43135. i = t.metadata
  43136. if (void 0 !== i) {
  43137. var n = i.type
  43138. if (void 0 !== n) {
  43139. if ('object' === n.toLowerCase()) return void console.error('THREE.JSONLoader: ' + o + ' should be loaded with THREE.ObjectLoader instead.')
  43140. if ('scene' === n.toLowerCase()) return void console.error('THREE.JSONLoader: ' + o + ' should be loaded with THREE.SceneLoader instead.')
  43141. }
  43142. }
  43143. var r = s.parse(t, l)
  43144. a(r.geometry, r.materials)
  43145. },
  43146. e,
  43147. t
  43148. )
  43149. },
  43150. setTexturePath: function (e) {
  43151. this.texturePath = e
  43152. },
  43153. parse: function (D, e) {
  43154. var N = new Ci.Geometry(),
  43155. t = void 0 !== D.scale ? 1 / D.scale : 1
  43156. if (
  43157. ((function (e) {
  43158. function t(e, t) {
  43159. return e & (1 << t)
  43160. }
  43161. var i,
  43162. n,
  43163. r,
  43164. o,
  43165. a,
  43166. s,
  43167. l,
  43168. c,
  43169. h,
  43170. u,
  43171. d,
  43172. p,
  43173. f,
  43174. g,
  43175. m,
  43176. v,
  43177. y,
  43178. A,
  43179. C,
  43180. I,
  43181. E,
  43182. _,
  43183. b,
  43184. w,
  43185. T,
  43186. x,
  43187. S,
  43188. M = D.faces,
  43189. R = D.vertices,
  43190. P = D.normals,
  43191. O = D.colors,
  43192. L = 0
  43193. if (void 0 !== D.uvs) {
  43194. for (i = 0; i < D.uvs.length; i++) D.uvs[i].length && L++
  43195. for (i = 0; i < L; i++) N.faceVertexUvs[i] = []
  43196. }
  43197. 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)
  43198. for (o = 0, a = M.length; o < a; )
  43199. 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)) {
  43200. if (
  43201. (((I = new Ci.Face3()).a = M[o]),
  43202. (I.b = M[o + 1]),
  43203. (I.c = M[o + 3]),
  43204. ((E = new Ci.Face3()).a = M[o + 1]),
  43205. (E.b = M[o + 2]),
  43206. (E.c = M[o + 3]),
  43207. (o += 4),
  43208. p && ((h = M[o++]), (I.materialIndex = h), (E.materialIndex = h)),
  43209. (r = N.faces.length),
  43210. f)
  43211. )
  43212. for (i = 0; i < L; i++)
  43213. for (w = D.uvs[i], N.faceVertexUvs[i][r] = [], N.faceVertexUvs[i][r + 1] = [], n = 0; n < 4; n++)
  43214. (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)
  43215. if ((g && ((l = 3 * M[o++]), I.normal.set(P[l++], P[l++], P[l]), E.normal.copy(I.normal)), m))
  43216. 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)
  43217. if ((v && ((_ = O[(s = M[o++])]), I.color.setHex(_), E.color.setHex(_)), y))
  43218. 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(_))
  43219. N.faces.push(I), N.faces.push(E)
  43220. } else {
  43221. 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))
  43222. for (i = 0; i < L; i++)
  43223. 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)
  43224. if ((g && ((l = 3 * M[o++]), C.normal.set(P[l++], P[l++], P[l])), m))
  43225. for (i = 0; i < 3; i++) (l = 3 * M[o++]), (b = new Ci.Vector3(P[l++], P[l++], P[l])), C.vertexNormals.push(b)
  43226. 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]))
  43227. N.faces.push(C)
  43228. }
  43229. })(t),
  43230. (function () {
  43231. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2
  43232. if (D.skinWeights)
  43233. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  43234. var n = D.skinWeights[t],
  43235. r = 1 < e ? D.skinWeights[t + 1] : 0,
  43236. o = 2 < e ? D.skinWeights[t + 2] : 0,
  43237. a = 3 < e ? D.skinWeights[t + 3] : 0
  43238. N.skinWeights.push(new Ci.Vector4(n, r, o, a))
  43239. }
  43240. if (D.skinIndices)
  43241. for (t = 0, i = D.skinIndices.length; t < i; t += e) {
  43242. var s = D.skinIndices[t],
  43243. l = 1 < e ? D.skinIndices[t + 1] : 0,
  43244. c = 2 < e ? D.skinIndices[t + 2] : 0,
  43245. h = 3 < e ? D.skinIndices[t + 3] : 0
  43246. N.skinIndices.push(new Ci.Vector4(s, l, c, h))
  43247. }
  43248. ;(N.bones = D.bones),
  43249. N.bones &&
  43250. 0 < N.bones.length &&
  43251. (N.skinWeights.length !== N.skinIndices.length || N.skinIndices.length !== N.vertices.length) &&
  43252. console.warn(
  43253. 'When skinning, number of vertices (' + N.vertices.length + '), skinIndices (' + N.skinIndices.length + '), and skinWeights (' + N.skinWeights.length + ') should match.'
  43254. )
  43255. })(),
  43256. (function (e) {
  43257. if (void 0 !== D.morphTargets)
  43258. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  43259. ;(N.morphTargets[t] = {}), (N.morphTargets[t].name = D.morphTargets[t].name), (N.morphTargets[t].vertices = [])
  43260. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  43261. var s = new Ci.Vector3()
  43262. ;(s.x = r[o] * e), (s.y = r[o + 1] * e), (s.z = r[o + 2] * e), n.push(s)
  43263. }
  43264. }
  43265. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  43266. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.')
  43267. var l = N.faces,
  43268. c = D.morphColors[0].colors
  43269. for (t = 0, i = l.length; t < i; t++) l[t].color.fromArray(c, 3 * t)
  43270. }
  43271. })(t),
  43272. (function () {
  43273. var e = [],
  43274. t = []
  43275. void 0 !== D.animation && t.push(D.animation), void 0 !== D.animations && (D.animations.length ? (t = t.concat(D.animations)) : t.push(D.animations))
  43276. for (var i = 0; i < t.length; i++) {
  43277. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones)
  43278. n && e.push(n)
  43279. }
  43280. if (N.morphTargets) {
  43281. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10)
  43282. e = e.concat(r)
  43283. }
  43284. 0 < e.length && (N.animations = e)
  43285. })(),
  43286. N.computeFaceNormals(),
  43287. N.computeBoundingSphere(),
  43288. void 0 === D.materials || 0 === D.materials.length)
  43289. )
  43290. return {
  43291. geometry: N
  43292. }
  43293. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin)
  43294. return {
  43295. geometry: N,
  43296. materials: i
  43297. }
  43298. }
  43299. }),
  43300. (Ci.LoadingManager = function (e, t, i) {
  43301. var n = this,
  43302. r = !1,
  43303. o = 0,
  43304. a = 0
  43305. ;(this.onStart = void 0),
  43306. (this.onLoad = e),
  43307. (this.onProgress = t),
  43308. (this.onError = i),
  43309. (this.itemStart = function (e) {
  43310. a++, !1 === r && void 0 !== n.onStart && n.onStart(e, o, a), (r = !0)
  43311. }),
  43312. (this.itemEnd = function (e) {
  43313. o++, void 0 !== n.onProgress && n.onProgress(e, o, a), o === a && ((r = !1), void 0 !== n.onLoad && n.onLoad())
  43314. }),
  43315. (this.itemError = function (e) {
  43316. void 0 !== n.onError && n.onError(e)
  43317. })
  43318. }),
  43319. (Ci.DefaultLoadingManager = new Ci.LoadingManager()),
  43320. (Ci.BufferGeometryLoader = function (e) {
  43321. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  43322. }),
  43323. (Ci.BufferGeometryLoader.prototype = {
  43324. constructor: Ci.BufferGeometryLoader,
  43325. load: function (e, t, i, n) {
  43326. var r = this
  43327. new Ci.XHRLoader(r.manager).load(
  43328. e,
  43329. function (e) {
  43330. t(r.parse(JSON.parse(e)))
  43331. },
  43332. i,
  43333. n
  43334. )
  43335. },
  43336. parse: function (e) {
  43337. var t = new Ci.BufferGeometry(),
  43338. i = e.data.index,
  43339. n = {
  43340. Int8Array: Int8Array,
  43341. Uint8Array: Uint8Array,
  43342. Uint8ClampedArray: Uint8ClampedArray,
  43343. Int16Array: Int16Array,
  43344. Uint16Array: Uint16Array,
  43345. Int32Array: Int32Array,
  43346. Uint32Array: Uint32Array,
  43347. Float32Array: Float32Array,
  43348. Float64Array: Float64Array
  43349. }
  43350. if (void 0 !== i) {
  43351. var r = new n[i.type](i.array)
  43352. t.setIndex(new Ci.BufferAttribute(r, 1))
  43353. }
  43354. var o = e.data.attributes
  43355. for (var a in o) {
  43356. var s = o[a]
  43357. r = new n[s.type](s.array)
  43358. t.addAttribute(a, new Ci.BufferAttribute(r, s.itemSize))
  43359. }
  43360. var l = e.data.groups || e.data.drawcalls || e.data.offsets
  43361. if (void 0 !== l)
  43362. for (var c = 0, h = l.length; c !== h; ++c) {
  43363. var u = l[c]
  43364. t.addGroup(u.start, u.count, u.materialIndex)
  43365. }
  43366. var d = e.data.boundingSphere
  43367. if (void 0 !== d) {
  43368. var p = new Ci.Vector3()
  43369. void 0 !== d.center && p.fromArray(d.center), (t.boundingSphere = new Ci.Sphere(p, d.radius))
  43370. }
  43371. return t
  43372. }
  43373. }),
  43374. (Ci.MaterialLoader = function (e) {
  43375. ;(this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager), (this.textures = {})
  43376. }),
  43377. (Ci.MaterialLoader.prototype = {
  43378. constructor: Ci.MaterialLoader,
  43379. load: function (e, t, i, n) {
  43380. var r = this
  43381. new Ci.XHRLoader(r.manager).load(
  43382. e,
  43383. function (e) {
  43384. t(r.parse(JSON.parse(e)))
  43385. },
  43386. i,
  43387. n
  43388. )
  43389. },
  43390. setTextures: function (e) {
  43391. this.textures = e
  43392. },
  43393. getTexture: function (e) {
  43394. var t = this.textures
  43395. return void 0 === t[e] && console.warn('THREE.MaterialLoader: Undefined texture', e), t[e]
  43396. },
  43397. parse: function (e) {
  43398. var t = new Ci[e.type]()
  43399. if (
  43400. (void 0 !== e.uuid && (t.uuid = e.uuid),
  43401. void 0 !== e.name && (t.name = e.name),
  43402. void 0 !== e.color && t.color.setHex(e.color),
  43403. void 0 !== e.roughness && (t.roughness = e.roughness),
  43404. void 0 !== e.metalness && (t.metalness = e.metalness),
  43405. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  43406. void 0 !== e.specular && t.specular.setHex(e.specular),
  43407. void 0 !== e.shininess && (t.shininess = e.shininess),
  43408. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  43409. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  43410. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  43411. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  43412. void 0 !== e.shading && (t.shading = e.shading),
  43413. void 0 !== e.blending && (t.blending = e.blending),
  43414. void 0 !== e.side && (t.side = e.side),
  43415. void 0 !== e.opacity && (t.opacity = e.opacity),
  43416. void 0 !== e.transparent && (t.transparent = e.transparent),
  43417. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  43418. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  43419. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  43420. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  43421. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  43422. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  43423. void 0 !== e.size && (t.size = e.size),
  43424. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  43425. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  43426. void 0 !== e.alphaMap && ((t.alphaMap = this.getTexture(e.alphaMap)), (t.transparent = !0)),
  43427. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  43428. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  43429. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  43430. void 0 !== e.normalScale)
  43431. ) {
  43432. var i = e.normalScale
  43433. !1 === Array.isArray(i) && (i = [i, i]), (t.normalScale = new Ci.Vector2().fromArray(i))
  43434. }
  43435. if (
  43436. (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  43437. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  43438. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  43439. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  43440. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  43441. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  43442. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  43443. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  43444. void 0 !== e.envMap && ((t.envMap = this.getTexture(e.envMap)), (t.combine = Ci.MultiplyOperation)),
  43445. e.reflectivity && (t.reflectivity = e.reflectivity),
  43446. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  43447. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  43448. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  43449. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  43450. void 0 !== e.materials)
  43451. )
  43452. for (var n = 0, r = e.materials.length; n < r; n++) t.materials.push(this.parse(e.materials[n]))
  43453. return t
  43454. }
  43455. }),
  43456. (Ci.ObjectLoader = function (e) {
  43457. ;(this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager), (this.texturePath = '')
  43458. }),
  43459. (Ci.ObjectLoader.prototype = {
  43460. constructor: Ci.ObjectLoader,
  43461. load: function (e, t, i, n) {
  43462. '' === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf('/') + 1))
  43463. var r = this
  43464. new Ci.XHRLoader(r.manager).load(
  43465. e,
  43466. function (e) {
  43467. r.parse(JSON.parse(e), t)
  43468. },
  43469. i,
  43470. n
  43471. )
  43472. },
  43473. setTexturePath: function (e) {
  43474. this.texturePath = e
  43475. },
  43476. setCrossOrigin: function (e) {
  43477. this.crossOrigin = e
  43478. },
  43479. parse: function (e, t) {
  43480. var i = this.parseGeometries(e.geometries),
  43481. n = this.parseImages(e.images, function () {
  43482. void 0 !== t && t(a)
  43483. }),
  43484. r = this.parseTextures(e.textures, n),
  43485. o = this.parseMaterials(e.materials, r),
  43486. a = this.parseObject(e.object, i, o)
  43487. return e.animations && (a.animations = this.parseAnimations(e.animations)), (void 0 !== e.images && 0 !== e.images.length) || (void 0 !== t && t(a)), a
  43488. },
  43489. parseGeometries: function (e) {
  43490. var t = {}
  43491. if (void 0 !== e)
  43492. for (var i = new Ci.JSONLoader(), n = new Ci.BufferGeometryLoader(), r = 0, o = e.length; r < o; r++) {
  43493. var a,
  43494. s = e[r]
  43495. switch (s.type) {
  43496. case 'PlaneGeometry':
  43497. case 'PlaneBufferGeometry':
  43498. a = new Ci[s.type](s.width, s.height, s.widthSegments, s.heightSegments)
  43499. break
  43500. case 'BoxGeometry':
  43501. case 'BoxBufferGeometry':
  43502. case 'CubeGeometry':
  43503. a = new Ci[s.type](s.width, s.height, s.depth, s.widthSegments, s.heightSegments, s.depthSegments)
  43504. break
  43505. case 'CircleGeometry':
  43506. case 'CircleBufferGeometry':
  43507. a = new Ci[s.type](s.radius, s.segments, s.thetaStart, s.thetaLength)
  43508. break
  43509. case 'CylinderGeometry':
  43510. case 'CylinderBufferGeometry':
  43511. a = new Ci[s.type](s.radiusTop, s.radiusBottom, s.height, s.radialSegments, s.heightSegments, s.openEnded, s.thetaStart, s.thetaLength)
  43512. break
  43513. case 'SphereGeometry':
  43514. case 'SphereBufferGeometry':
  43515. a = new Ci[s.type](s.radius, s.widthSegments, s.heightSegments, s.phiStart, s.phiLength, s.thetaStart, s.thetaLength)
  43516. break
  43517. case 'DodecahedronGeometry':
  43518. a = new Ci.DodecahedronGeometry(s.radius, s.detail)
  43519. break
  43520. case 'IcosahedronGeometry':
  43521. a = new Ci.IcosahedronGeometry(s.radius, s.detail)
  43522. break
  43523. case 'OctahedronGeometry':
  43524. a = new Ci.OctahedronGeometry(s.radius, s.detail)
  43525. break
  43526. case 'TetrahedronGeometry':
  43527. a = new Ci.TetrahedronGeometry(s.radius, s.detail)
  43528. break
  43529. case 'RingGeometry':
  43530. case 'RingBufferGeometry':
  43531. a = new Ci[s.type](s.innerRadius, s.outerRadius, s.thetaSegments, s.phiSegments, s.thetaStart, s.thetaLength)
  43532. break
  43533. case 'TorusGeometry':
  43534. case 'TorusBufferGeometry':
  43535. a = new Ci[s.type](s.radius, s.tube, s.radialSegments, s.tubularSegments, s.arc)
  43536. break
  43537. case 'TorusKnotGeometry':
  43538. case 'TorusKnotBufferGeometry':
  43539. a = new Ci[s.type](s.radius, s.tube, s.tubularSegments, s.radialSegments, s.p, s.q)
  43540. break
  43541. case 'LatheGeometry':
  43542. a = new Ci.LatheGeometry(s.points, s.segments, s.phiStart, s.phiLength)
  43543. break
  43544. case 'BufferGeometry':
  43545. a = n.parse(s)
  43546. break
  43547. case 'Geometry':
  43548. a = i.parse(s.data, this.texturePath).geometry
  43549. break
  43550. default:
  43551. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"')
  43552. continue
  43553. }
  43554. ;(a.uuid = s.uuid), void 0 !== s.name && (a.name = s.name), (t[s.uuid] = a)
  43555. }
  43556. return t
  43557. },
  43558. parseMaterials: function (e, t) {
  43559. var i = {}
  43560. if (void 0 !== e) {
  43561. var n = new Ci.MaterialLoader()
  43562. n.setTextures(t)
  43563. for (var r = 0, o = e.length; r < o; r++) {
  43564. var a = n.parse(e[r])
  43565. i[a.uuid] = a
  43566. }
  43567. }
  43568. return i
  43569. },
  43570. parseAnimations: function (e) {
  43571. for (var t = [], i = 0; i < e.length; i++) {
  43572. var n = Ci.AnimationClip.parse(e[i])
  43573. t.push(n)
  43574. }
  43575. return t
  43576. },
  43577. parseImages: function (e, t) {
  43578. function i(e) {
  43579. return (
  43580. n.manager.itemStart(e),
  43581. a.load(e, function () {
  43582. n.manager.itemEnd(e)
  43583. })
  43584. )
  43585. }
  43586. var n = this,
  43587. r = {}
  43588. if (void 0 !== e && 0 < e.length) {
  43589. var o = new Ci.LoadingManager(t),
  43590. a = new Ci.ImageLoader(o)
  43591. a.setCrossOrigin(this.crossOrigin)
  43592. for (var s = 0, l = e.length; s < l; s++) {
  43593. var c = e[s],
  43594. h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url
  43595. r[c.uuid] = i(h)
  43596. }
  43597. }
  43598. return r
  43599. },
  43600. parseTextures: function (e, t) {
  43601. function i(e) {
  43602. return 'number' == typeof e ? e : (console.warn('THREE.ObjectLoader.parseTexture: Constant should be in numeric form.', e), Ci[e])
  43603. }
  43604. var n = {}
  43605. if (void 0 !== e)
  43606. for (var r = 0, o = e.length; r < o; r++) {
  43607. var a = e[r]
  43608. 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)
  43609. var s = new Ci.Texture(t[a.image])
  43610. ;(s.needsUpdate = !0),
  43611. (s.uuid = a.uuid),
  43612. void 0 !== a.name && (s.name = a.name),
  43613. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  43614. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0], a.offset[1])),
  43615. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0], a.repeat[1])),
  43616. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  43617. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  43618. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  43619. Array.isArray(a.wrap) && ((s.wrapS = i(a.wrap[0])), (s.wrapT = i(a.wrap[1]))),
  43620. (n[a.uuid] = s)
  43621. }
  43622. return n
  43623. },
  43624. parseObject:
  43625. ((ke = new Ci.Matrix4()),
  43626. function (e, t, i) {
  43627. function n(e) {
  43628. return void 0 === t[e] && console.warn('THREE.ObjectLoader: Undefined geometry', e), t[e]
  43629. }
  43630. function r(e) {
  43631. if (void 0 !== e) return void 0 === i[e] && console.warn('THREE.ObjectLoader: Undefined material', e), i[e]
  43632. }
  43633. var o
  43634. switch (e.type) {
  43635. case 'Scene':
  43636. o = new Ci.Scene()
  43637. break
  43638. case 'PerspectiveCamera':
  43639. o = new Ci.PerspectiveCamera(e.fov, e.aspect, e.near, e.far)
  43640. break
  43641. case 'OrthographicCamera':
  43642. o = new Ci.OrthographicCamera(e.left, e.right, e.top, e.bottom, e.near, e.far)
  43643. break
  43644. case 'AmbientLight':
  43645. o = new Ci.AmbientLight(e.color, e.intensity)
  43646. break
  43647. case 'DirectionalLight':
  43648. o = new Ci.DirectionalLight(e.color, e.intensity)
  43649. break
  43650. case 'PointLight':
  43651. o = new Ci.PointLight(e.color, e.intensity, e.distance, e.decay)
  43652. break
  43653. case 'SpotLight':
  43654. o = new Ci.SpotLight(e.color, e.intensity, e.distance, e.angle, e.penumbra, e.decay)
  43655. break
  43656. case 'HemisphereLight':
  43657. o = new Ci.HemisphereLight(e.color, e.groundColor, e.intensity)
  43658. break
  43659. case 'Mesh':
  43660. var a = n(e.geometry),
  43661. s = r(e.material)
  43662. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a, s) : new Ci.Mesh(a, s)
  43663. break
  43664. case 'LOD':
  43665. o = new Ci.LOD()
  43666. break
  43667. case 'Line':
  43668. o = new Ci.Line(n(e.geometry), r(e.material), e.mode)
  43669. break
  43670. case 'PointCloud':
  43671. case 'Points':
  43672. o = new Ci.Points(n(e.geometry), r(e.material))
  43673. break
  43674. case 'Sprite':
  43675. o = new Ci.Sprite(r(e.material))
  43676. break
  43677. case 'Group':
  43678. o = new Ci.Group()
  43679. break
  43680. default:
  43681. o = new Ci.Object3D()
  43682. }
  43683. if (
  43684. ((o.uuid = e.uuid),
  43685. void 0 !== e.name && (o.name = e.name),
  43686. void 0 !== e.matrix
  43687. ? (ke.fromArray(e.matrix), ke.decompose(o.position, o.quaternion, o.scale))
  43688. : (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)),
  43689. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  43690. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  43691. void 0 !== e.visible && (o.visible = e.visible),
  43692. void 0 !== e.userData && (o.userData = e.userData),
  43693. void 0 !== e.children)
  43694. )
  43695. for (var l in e.children) o.add(this.parseObject(e.children[l], t, i))
  43696. if ('LOD' === e.type)
  43697. for (var c = e.levels, h = 0; h < c.length; h++) {
  43698. var u = c[h]
  43699. void 0 !== (l = o.getObjectByProperty('uuid', u.object)) && o.addLevel(l, u.distance)
  43700. }
  43701. return o
  43702. })
  43703. }),
  43704. (Ci.TextureLoader = function (e) {
  43705. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  43706. }),
  43707. (Ci.TextureLoader.prototype = {
  43708. constructor: Ci.TextureLoader,
  43709. load: function (e, t, i, n) {
  43710. var r = new Ci.Texture(),
  43711. o = new Ci.ImageLoader(this.manager)
  43712. return (
  43713. o.setCrossOrigin(this.crossOrigin),
  43714. o.setPath(this.path),
  43715. o.load(
  43716. e,
  43717. function (e) {
  43718. ;(r.image = e), (r.needsUpdate = !0), void 0 !== t && t(r)
  43719. },
  43720. i,
  43721. n
  43722. ),
  43723. r
  43724. )
  43725. },
  43726. setCrossOrigin: function (e) {
  43727. this.crossOrigin = e
  43728. },
  43729. setPath: function (e) {
  43730. this.path = e
  43731. }
  43732. }),
  43733. (Ci.CubeTextureLoader = function (e) {
  43734. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  43735. }),
  43736. (Ci.CubeTextureLoader.prototype = {
  43737. constructor: Ci.CubeTextureLoader,
  43738. load: function (e, i, t, n) {
  43739. function r(t) {
  43740. a.load(
  43741. e[t],
  43742. function (e) {
  43743. ;(o.images[t] = e), 6 === ++s && ((o.needsUpdate = !0), i && i(o))
  43744. },
  43745. void 0,
  43746. n
  43747. )
  43748. }
  43749. var o = new Ci.CubeTexture(),
  43750. a = new Ci.ImageLoader(this.manager)
  43751. a.setCrossOrigin(this.crossOrigin), a.setPath(this.path)
  43752. for (var s = 0, l = 0; l < e.length; ++l) r(l)
  43753. return o
  43754. },
  43755. setCrossOrigin: function (e) {
  43756. this.crossOrigin = e
  43757. },
  43758. setPath: function (e) {
  43759. this.path = e
  43760. }
  43761. }),
  43762. (Ci.DataTextureLoader = Ci.BinaryTextureLoader =
  43763. function (e) {
  43764. ;(this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager), (this._parser = null)
  43765. }),
  43766. (Ci.BinaryTextureLoader.prototype = {
  43767. constructor: Ci.BinaryTextureLoader,
  43768. load: function (e, i, t, n) {
  43769. var r = this,
  43770. o = new Ci.DataTexture(),
  43771. a = new Ci.XHRLoader(this.manager)
  43772. return (
  43773. a.setResponseType('arraybuffer'),
  43774. a.load(
  43775. e,
  43776. function (e) {
  43777. var t = r._parser(e)
  43778. t &&
  43779. (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)),
  43780. (o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping),
  43781. (o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping),
  43782. (o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter),
  43783. (o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter),
  43784. (o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1),
  43785. void 0 !== t.format && (o.format = t.format),
  43786. void 0 !== t.type && (o.type = t.type),
  43787. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  43788. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  43789. (o.needsUpdate = !0),
  43790. i && i(o, t))
  43791. },
  43792. t,
  43793. n
  43794. ),
  43795. o
  43796. )
  43797. }
  43798. }),
  43799. (Ci.CompressedTextureLoader = function (e) {
  43800. ;(this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager), (this._parser = null)
  43801. }),
  43802. (Ci.CompressedTextureLoader.prototype = {
  43803. constructor: Ci.CompressedTextureLoader,
  43804. load: function (e, o, t, n) {
  43805. function i(i) {
  43806. r.load(
  43807. e[i],
  43808. function (e) {
  43809. var t = a._parser(e, !0)
  43810. ;(s[i] = {
  43811. width: t.width,
  43812. height: t.height,
  43813. format: t.format,
  43814. mipmaps: t.mipmaps
  43815. }),
  43816. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter), (l.format = t.format), (l.needsUpdate = !0), o && o(l))
  43817. },
  43818. t,
  43819. n
  43820. )
  43821. }
  43822. var a = this,
  43823. s = [],
  43824. l = new Ci.CompressedTexture()
  43825. l.image = s
  43826. var r = new Ci.XHRLoader(this.manager)
  43827. 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)
  43828. else
  43829. r.load(
  43830. e,
  43831. function (e) {
  43832. var t = a._parser(e, !0)
  43833. if (t.isCubemap)
  43834. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  43835. s[n] = {
  43836. mipmaps: []
  43837. }
  43838. 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)
  43839. }
  43840. else (l.image.width = t.width), (l.image.height = t.height), (l.mipmaps = t.mipmaps)
  43841. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter), (l.format = t.format), (l.needsUpdate = !0), o && o(l)
  43842. },
  43843. t,
  43844. n
  43845. )
  43846. return l
  43847. },
  43848. setPath: function (e) {
  43849. this.path = e
  43850. }
  43851. }),
  43852. (Ci.Material = function () {
  43853. Object.defineProperty(this, 'id', {
  43854. value: Ci.MaterialIdCount++
  43855. }),
  43856. (this.uuid = Ci.Math.generateUUID()),
  43857. (this.name = ''),
  43858. (this.type = 'Material'),
  43859. (this.side = Ci.FrontSide),
  43860. (this.opacity = 1),
  43861. (this.transparent = !1),
  43862. (this.blending = Ci.NormalBlending),
  43863. (this.blendSrc = Ci.SrcAlphaFactor),
  43864. (this.blendDst = Ci.OneMinusSrcAlphaFactor),
  43865. (this.blendEquation = Ci.AddEquation),
  43866. (this.blendSrcAlpha = null),
  43867. (this.blendDstAlpha = null),
  43868. (this.blendEquationAlpha = null),
  43869. (this.depthFunc = Ci.LessEqualDepth),
  43870. (this.depthTest = !0),
  43871. (this.depthWrite = !0),
  43872. (this.colorWrite = !0),
  43873. (this.precision = null),
  43874. (this.polygonOffset = !1),
  43875. (this.polygonOffsetFactor = 0),
  43876. (this.polygonOffsetUnits = 0),
  43877. (this.alphaTest = 0),
  43878. (this.premultipliedAlpha = !1),
  43879. (this.overdraw = 0),
  43880. (this.visible = !0),
  43881. (this._needsUpdate = !0)
  43882. }),
  43883. (Ci.Material.prototype = {
  43884. constructor: Ci.Material,
  43885. get needsUpdate() {
  43886. return this._needsUpdate
  43887. },
  43888. set needsUpdate(e) {
  43889. !0 === e && this.update(), (this._needsUpdate = e)
  43890. },
  43891. setValues: function (e) {
  43892. if (void 0 !== e)
  43893. for (var t in e) {
  43894. var i = e[t]
  43895. if (void 0 !== i) {
  43896. var n = this[t]
  43897. void 0 !== n
  43898. ? n instanceof Ci.Color
  43899. ? n.set(i)
  43900. : n instanceof Ci.Vector3 && i instanceof Ci.Vector3
  43901. ? n.copy(i)
  43902. : (this[t] = 'overdraw' === t ? Number(i) : i)
  43903. : console.warn('THREE.' + this.type + ": '" + t + "' is not a property of this material.")
  43904. } else console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  43905. }
  43906. },
  43907. toJSON: function (e) {
  43908. function t(e) {
  43909. var t = []
  43910. for (var i in e) {
  43911. var n = e[i]
  43912. delete n.metadata, t.push(n)
  43913. }
  43914. return t
  43915. }
  43916. var i = void 0 === e
  43917. i &&
  43918. (e = {
  43919. textures: {},
  43920. images: {}
  43921. })
  43922. var n = {
  43923. metadata: {
  43924. version: 4.4,
  43925. type: 'Material',
  43926. generator: 'Material.toJSON'
  43927. }
  43928. }
  43929. if (
  43930. ((n.uuid = this.uuid),
  43931. (n.type = this.type),
  43932. '' !== this.name && (n.name = this.name),
  43933. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  43934. 0.5 !== this.roughness && (n.roughness = this.roughness),
  43935. 0.5 !== this.metalness && (n.metalness = this.metalness),
  43936. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  43937. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  43938. void 0 !== this.shininess && (n.shininess = this.shininess),
  43939. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  43940. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  43941. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  43942. this.bumpMap instanceof Ci.Texture && ((n.bumpMap = this.bumpMap.toJSON(e).uuid), (n.bumpScale = this.bumpScale)),
  43943. this.normalMap instanceof Ci.Texture && ((n.normalMap = this.normalMap.toJSON(e).uuid), (n.normalScale = this.normalScale.toArray())),
  43944. this.displacementMap instanceof Ci.Texture &&
  43945. ((n.displacementMap = this.displacementMap.toJSON(e).uuid), (n.displacementScale = this.displacementScale), (n.displacementBias = this.displacementBias)),
  43946. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  43947. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  43948. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  43949. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  43950. this.envMap instanceof Ci.Texture && ((n.envMap = this.envMap.toJSON(e).uuid), (n.reflectivity = this.reflectivity)),
  43951. void 0 !== this.size && (n.size = this.size),
  43952. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  43953. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  43954. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  43955. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  43956. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  43957. this.opacity < 1 && (n.opacity = this.opacity),
  43958. !0 === this.transparent && (n.transparent = this.transparent),
  43959. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  43960. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  43961. !0 === this.wireframe && (n.wireframe = this.wireframe),
  43962. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  43963. i)
  43964. ) {
  43965. var r = t(e.textures),
  43966. o = t(e.images)
  43967. 0 < r.length && (n.textures = r), 0 < o.length && (n.images = o)
  43968. }
  43969. return n
  43970. },
  43971. clone: function () {
  43972. return new this.constructor().copy(this)
  43973. },
  43974. copy: function (e) {
  43975. return (
  43976. (this.name = e.name),
  43977. (this.side = e.side),
  43978. (this.opacity = e.opacity),
  43979. (this.transparent = e.transparent),
  43980. (this.blending = e.blending),
  43981. (this.blendSrc = e.blendSrc),
  43982. (this.blendDst = e.blendDst),
  43983. (this.blendEquation = e.blendEquation),
  43984. (this.blendSrcAlpha = e.blendSrcAlpha),
  43985. (this.blendDstAlpha = e.blendDstAlpha),
  43986. (this.blendEquationAlpha = e.blendEquationAlpha),
  43987. (this.depthFunc = e.depthFunc),
  43988. (this.depthTest = e.depthTest),
  43989. (this.depthWrite = e.depthWrite),
  43990. (this.colorWrite = e.colorWrite),
  43991. (this.precision = e.precision),
  43992. (this.polygonOffset = e.polygonOffset),
  43993. (this.polygonOffsetFactor = e.polygonOffsetFactor),
  43994. (this.polygonOffsetUnits = e.polygonOffsetUnits),
  43995. (this.alphaTest = e.alphaTest),
  43996. (this.premultipliedAlpha = e.premultipliedAlpha),
  43997. (this.overdraw = e.overdraw),
  43998. (this.visible = e.visible),
  43999. this
  44000. )
  44001. },
  44002. update: function () {
  44003. this.dispatchEvent({
  44004. type: 'update'
  44005. })
  44006. },
  44007. dispose: function () {
  44008. this.dispatchEvent({
  44009. type: 'dispose'
  44010. })
  44011. }
  44012. }),
  44013. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  44014. (Ci.MaterialIdCount = 0),
  44015. (Ci.LineBasicMaterial = function (e) {
  44016. Ci.Material.call(this),
  44017. (this.type = 'LineBasicMaterial'),
  44018. (this.color = new Ci.Color(16777215)),
  44019. (this.linewidth = 1),
  44020. (this.linecap = 'round'),
  44021. (this.linejoin = 'round'),
  44022. (this.blending = Ci.NormalBlending),
  44023. (this.vertexColors = Ci.NoColors),
  44024. (this.fog = !0),
  44025. this.setValues(e)
  44026. }),
  44027. (Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype)),
  44028. (Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial),
  44029. (Ci.LineBasicMaterial.prototype.copy = function (e) {
  44030. return (
  44031. Ci.Material.prototype.copy.call(this, e),
  44032. this.color.copy(e.color),
  44033. (this.linewidth = e.linewidth),
  44034. (this.linecap = e.linecap),
  44035. (this.linejoin = e.linejoin),
  44036. (this.vertexColors = e.vertexColors),
  44037. (this.fog = e.fog),
  44038. this
  44039. )
  44040. }),
  44041. (Ci.LineDashedMaterial = function (e) {
  44042. Ci.Material.call(this),
  44043. (this.type = 'LineDashedMaterial'),
  44044. (this.color = new Ci.Color(16777215)),
  44045. (this.linewidth = 1),
  44046. (this.scale = 1),
  44047. (this.dashSize = 3),
  44048. (this.gapSize = 1),
  44049. (this.blending = Ci.NormalBlending),
  44050. (this.vertexColors = Ci.NoColors),
  44051. (this.fog = !0),
  44052. this.setValues(e)
  44053. }),
  44054. (Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype)),
  44055. (Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial),
  44056. (Ci.LineDashedMaterial.prototype.copy = function (e) {
  44057. return (
  44058. Ci.Material.prototype.copy.call(this, e),
  44059. this.color.copy(e.color),
  44060. (this.linewidth = e.linewidth),
  44061. (this.scale = e.scale),
  44062. (this.dashSize = e.dashSize),
  44063. (this.gapSize = e.gapSize),
  44064. (this.vertexColors = e.vertexColors),
  44065. (this.fog = e.fog),
  44066. this
  44067. )
  44068. }),
  44069. (Ci.MeshBasicMaterial = function (e) {
  44070. Ci.Material.call(this),
  44071. (this.type = 'MeshBasicMaterial'),
  44072. (this.color = new Ci.Color(16777215)),
  44073. (this.map = null),
  44074. (this.aoMap = null),
  44075. (this.aoMapIntensity = 1),
  44076. (this.specularMap = null),
  44077. (this.alphaMap = null),
  44078. (this.envMap = null),
  44079. (this.combine = Ci.MultiplyOperation),
  44080. (this.reflectivity = 1),
  44081. (this.refractionRatio = 0.98),
  44082. (this.fog = !0),
  44083. (this.shading = Ci.SmoothShading),
  44084. (this.blending = Ci.NormalBlending),
  44085. (this.wireframe = !1),
  44086. (this.wireframeLinewidth = 1),
  44087. (this.wireframeLinecap = 'round'),
  44088. (this.wireframeLinejoin = 'round'),
  44089. (this.vertexColors = Ci.NoColors),
  44090. (this.skinning = !1),
  44091. (this.morphTargets = !1),
  44092. this.setValues(e)
  44093. }),
  44094. (Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype)),
  44095. (Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial),
  44096. (Ci.MeshBasicMaterial.prototype.copy = function (e) {
  44097. return (
  44098. Ci.Material.prototype.copy.call(this, e),
  44099. this.color.copy(e.color),
  44100. (this.map = e.map),
  44101. (this.aoMap = e.aoMap),
  44102. (this.aoMapIntensity = e.aoMapIntensity),
  44103. (this.specularMap = e.specularMap),
  44104. (this.alphaMap = e.alphaMap),
  44105. (this.envMap = e.envMap),
  44106. (this.combine = e.combine),
  44107. (this.reflectivity = e.reflectivity),
  44108. (this.refractionRatio = e.refractionRatio),
  44109. (this.fog = e.fog),
  44110. (this.shading = e.shading),
  44111. (this.wireframe = e.wireframe),
  44112. (this.wireframeLinewidth = e.wireframeLinewidth),
  44113. (this.wireframeLinecap = e.wireframeLinecap),
  44114. (this.wireframeLinejoin = e.wireframeLinejoin),
  44115. (this.vertexColors = e.vertexColors),
  44116. (this.skinning = e.skinning),
  44117. (this.morphTargets = e.morphTargets),
  44118. this
  44119. )
  44120. }),
  44121. (Ci.MeshLambertMaterial = function (e) {
  44122. Ci.Material.call(this),
  44123. (this.type = 'MeshLambertMaterial'),
  44124. (this.color = new Ci.Color(16777215)),
  44125. (this.map = null),
  44126. (this.lightMap = null),
  44127. (this.lightMapIntensity = 1),
  44128. (this.aoMap = null),
  44129. (this.aoMapIntensity = 1),
  44130. (this.emissive = new Ci.Color(0)),
  44131. (this.emissiveIntensity = 1),
  44132. (this.emissiveMap = null),
  44133. (this.specularMap = null),
  44134. (this.alphaMap = null),
  44135. (this.envMap = null),
  44136. (this.combine = Ci.MultiplyOperation),
  44137. (this.reflectivity = 1),
  44138. (this.refractionRatio = 0.98),
  44139. (this.fog = !0),
  44140. (this.blending = Ci.NormalBlending),
  44141. (this.wireframe = !1),
  44142. (this.wireframeLinewidth = 1),
  44143. (this.wireframeLinecap = 'round'),
  44144. (this.wireframeLinejoin = 'round'),
  44145. (this.vertexColors = Ci.NoColors),
  44146. (this.skinning = !1),
  44147. (this.morphTargets = !1),
  44148. (this.morphNormals = !1),
  44149. this.setValues(e)
  44150. }),
  44151. (Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype)),
  44152. (Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial),
  44153. (Ci.MeshLambertMaterial.prototype.copy = function (e) {
  44154. return (
  44155. Ci.Material.prototype.copy.call(this, e),
  44156. this.color.copy(e.color),
  44157. (this.map = e.map),
  44158. (this.lightMap = e.lightMap),
  44159. (this.lightMapIntensity = e.lightMapIntensity),
  44160. (this.aoMap = e.aoMap),
  44161. (this.aoMapIntensity = e.aoMapIntensity),
  44162. this.emissive.copy(e.emissive),
  44163. (this.emissiveMap = e.emissiveMap),
  44164. (this.emissiveIntensity = e.emissiveIntensity),
  44165. (this.specularMap = e.specularMap),
  44166. (this.alphaMap = e.alphaMap),
  44167. (this.envMap = e.envMap),
  44168. (this.combine = e.combine),
  44169. (this.reflectivity = e.reflectivity),
  44170. (this.refractionRatio = e.refractionRatio),
  44171. (this.fog = e.fog),
  44172. (this.wireframe = e.wireframe),
  44173. (this.wireframeLinewidth = e.wireframeLinewidth),
  44174. (this.wireframeLinecap = e.wireframeLinecap),
  44175. (this.wireframeLinejoin = e.wireframeLinejoin),
  44176. (this.vertexColors = e.vertexColors),
  44177. (this.skinning = e.skinning),
  44178. (this.morphTargets = e.morphTargets),
  44179. (this.morphNormals = e.morphNormals),
  44180. this
  44181. )
  44182. }),
  44183. (Ci.MeshPhongMaterial = function (e) {
  44184. Ci.Material.call(this),
  44185. (this.type = 'MeshPhongMaterial'),
  44186. (this.color = new Ci.Color(16777215)),
  44187. (this.specular = new Ci.Color(1118481)),
  44188. (this.shininess = 30),
  44189. (this.map = null),
  44190. (this.lightMap = null),
  44191. (this.lightMapIntensity = 1),
  44192. (this.aoMap = null),
  44193. (this.aoMapIntensity = 1),
  44194. (this.emissive = new Ci.Color(0)),
  44195. (this.emissiveIntensity = 1),
  44196. (this.emissiveMap = null),
  44197. (this.bumpMap = null),
  44198. (this.bumpScale = 1),
  44199. (this.normalMap = null),
  44200. (this.normalScale = new Ci.Vector2(1, 1)),
  44201. (this.displacementMap = null),
  44202. (this.displacementScale = 1),
  44203. (this.displacementBias = 0),
  44204. (this.specularMap = null),
  44205. (this.alphaMap = null),
  44206. (this.envMap = null),
  44207. (this.combine = Ci.MultiplyOperation),
  44208. (this.reflectivity = 1),
  44209. (this.refractionRatio = 0.98),
  44210. (this.fog = !0),
  44211. (this.shading = Ci.SmoothShading),
  44212. (this.blending = Ci.NormalBlending),
  44213. (this.wireframe = !1),
  44214. (this.wireframeLinewidth = 1),
  44215. (this.wireframeLinecap = 'round'),
  44216. (this.wireframeLinejoin = 'round'),
  44217. (this.vertexColors = Ci.NoColors),
  44218. (this.skinning = !1),
  44219. (this.morphTargets = !1),
  44220. (this.morphNormals = !1),
  44221. this.setValues(e)
  44222. }),
  44223. (Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype)),
  44224. (Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial),
  44225. (Ci.MeshPhongMaterial.prototype.copy = function (e) {
  44226. return (
  44227. Ci.Material.prototype.copy.call(this, e),
  44228. this.color.copy(e.color),
  44229. this.specular.copy(e.specular),
  44230. (this.shininess = e.shininess),
  44231. (this.map = e.map),
  44232. (this.lightMap = e.lightMap),
  44233. (this.lightMapIntensity = e.lightMapIntensity),
  44234. (this.aoMap = e.aoMap),
  44235. (this.aoMapIntensity = e.aoMapIntensity),
  44236. this.emissive.copy(e.emissive),
  44237. (this.emissiveMap = e.emissiveMap),
  44238. (this.emissiveIntensity = e.emissiveIntensity),
  44239. (this.bumpMap = e.bumpMap),
  44240. (this.bumpScale = e.bumpScale),
  44241. (this.normalMap = e.normalMap),
  44242. this.normalScale.copy(e.normalScale),
  44243. (this.displacementMap = e.displacementMap),
  44244. (this.displacementScale = e.displacementScale),
  44245. (this.displacementBias = e.displacementBias),
  44246. (this.specularMap = e.specularMap),
  44247. (this.alphaMap = e.alphaMap),
  44248. (this.envMap = e.envMap),
  44249. (this.combine = e.combine),
  44250. (this.reflectivity = e.reflectivity),
  44251. (this.refractionRatio = e.refractionRatio),
  44252. (this.fog = e.fog),
  44253. (this.shading = e.shading),
  44254. (this.wireframe = e.wireframe),
  44255. (this.wireframeLinewidth = e.wireframeLinewidth),
  44256. (this.wireframeLinecap = e.wireframeLinecap),
  44257. (this.wireframeLinejoin = e.wireframeLinejoin),
  44258. (this.vertexColors = e.vertexColors),
  44259. (this.skinning = e.skinning),
  44260. (this.morphTargets = e.morphTargets),
  44261. (this.morphNormals = e.morphNormals),
  44262. this
  44263. )
  44264. }),
  44265. (Ci.MeshStandardMaterial = function (e) {
  44266. Ci.Material.call(this),
  44267. (this.type = 'MeshStandardMaterial'),
  44268. (this.color = new Ci.Color(16777215)),
  44269. (this.roughness = 0.5),
  44270. (this.metalness = 0.5),
  44271. (this.map = null),
  44272. (this.lightMap = null),
  44273. (this.lightMapIntensity = 1),
  44274. (this.aoMap = null),
  44275. (this.aoMapIntensity = 1),
  44276. (this.emissive = new Ci.Color(0)),
  44277. (this.emissiveIntensity = 1),
  44278. (this.emissiveMap = null),
  44279. (this.bumpMap = null),
  44280. (this.bumpScale = 1),
  44281. (this.normalMap = null),
  44282. (this.normalScale = new Ci.Vector2(1, 1)),
  44283. (this.displacementMap = null),
  44284. (this.displacementScale = 1),
  44285. (this.displacementBias = 0),
  44286. (this.roughnessMap = null),
  44287. (this.metalnessMap = null),
  44288. (this.alphaMap = null),
  44289. (this.envMap = null),
  44290. (this.envMapIntensity = 1),
  44291. (this.refractionRatio = 0.98),
  44292. (this.fog = !0),
  44293. (this.shading = Ci.SmoothShading),
  44294. (this.blending = Ci.NormalBlending),
  44295. (this.wireframe = !1),
  44296. (this.wireframeLinewidth = 1),
  44297. (this.wireframeLinecap = 'round'),
  44298. (this.wireframeLinejoin = 'round'),
  44299. (this.vertexColors = Ci.NoColors),
  44300. (this.skinning = !1),
  44301. (this.morphTargets = !1),
  44302. (this.morphNormals = !1),
  44303. this.setValues(e)
  44304. }),
  44305. (Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype)),
  44306. (Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial),
  44307. (Ci.MeshStandardMaterial.prototype.copy = function (e) {
  44308. return (
  44309. Ci.Material.prototype.copy.call(this, e),
  44310. this.color.copy(e.color),
  44311. (this.roughness = e.roughness),
  44312. (this.metalness = e.metalness),
  44313. (this.map = e.map),
  44314. (this.lightMap = e.lightMap),
  44315. (this.lightMapIntensity = e.lightMapIntensity),
  44316. (this.aoMap = e.aoMap),
  44317. (this.aoMapIntensity = e.aoMapIntensity),
  44318. this.emissive.copy(e.emissive),
  44319. (this.emissiveMap = e.emissiveMap),
  44320. (this.emissiveIntensity = e.emissiveIntensity),
  44321. (this.bumpMap = e.bumpMap),
  44322. (this.bumpScale = e.bumpScale),
  44323. (this.normalMap = e.normalMap),
  44324. this.normalScale.copy(e.normalScale),
  44325. (this.displacementMap = e.displacementMap),
  44326. (this.displacementScale = e.displacementScale),
  44327. (this.displacementBias = e.displacementBias),
  44328. (this.roughnessMap = e.roughnessMap),
  44329. (this.metalnessMap = e.metalnessMap),
  44330. (this.alphaMap = e.alphaMap),
  44331. (this.envMap = e.envMap),
  44332. (this.envMapIntensity = e.envMapIntensity),
  44333. (this.refractionRatio = e.refractionRatio),
  44334. (this.fog = e.fog),
  44335. (this.shading = e.shading),
  44336. (this.wireframe = e.wireframe),
  44337. (this.wireframeLinewidth = e.wireframeLinewidth),
  44338. (this.wireframeLinecap = e.wireframeLinecap),
  44339. (this.wireframeLinejoin = e.wireframeLinejoin),
  44340. (this.vertexColors = e.vertexColors),
  44341. (this.skinning = e.skinning),
  44342. (this.morphTargets = e.morphTargets),
  44343. (this.morphNormals = e.morphNormals),
  44344. this
  44345. )
  44346. }),
  44347. (Ci.MeshDepthMaterial = function (e) {
  44348. Ci.Material.call(this), (this.type = 'MeshDepthMaterial'), (this.morphTargets = !1), (this.wireframe = !1), (this.wireframeLinewidth = 1), this.setValues(e)
  44349. }),
  44350. (Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype)),
  44351. (Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial),
  44352. (Ci.MeshDepthMaterial.prototype.copy = function (e) {
  44353. return Ci.Material.prototype.copy.call(this, e), (this.wireframe = e.wireframe), (this.wireframeLinewidth = e.wireframeLinewidth), this
  44354. }),
  44355. (Ci.MeshNormalMaterial = function (e) {
  44356. Ci.Material.call(this, e), (this.type = 'MeshNormalMaterial'), (this.wireframe = !1), (this.wireframeLinewidth = 1), (this.morphTargets = !1), this.setValues(e)
  44357. }),
  44358. (Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype)),
  44359. (Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial),
  44360. (Ci.MeshNormalMaterial.prototype.copy = function (e) {
  44361. return Ci.Material.prototype.copy.call(this, e), (this.wireframe = e.wireframe), (this.wireframeLinewidth = e.wireframeLinewidth), this
  44362. }),
  44363. (Ci.MultiMaterial = function (e) {
  44364. ;(this.uuid = Ci.Math.generateUUID()), (this.type = 'MultiMaterial'), (this.materials = e instanceof Array ? e : []), (this.visible = !0)
  44365. }),
  44366. (Ci.MultiMaterial.prototype = {
  44367. constructor: Ci.MultiMaterial,
  44368. toJSON: function (e) {
  44369. for (
  44370. var t = {
  44371. metadata: {
  44372. version: 4.2,
  44373. type: 'material',
  44374. generator: 'MaterialExporter'
  44375. },
  44376. uuid: this.uuid,
  44377. type: this.type,
  44378. materials: []
  44379. },
  44380. i = this.materials,
  44381. n = 0,
  44382. r = i.length;
  44383. n < r;
  44384. n++
  44385. ) {
  44386. var o = i[n].toJSON(e)
  44387. delete o.metadata, t.materials.push(o)
  44388. }
  44389. return (t.visible = this.visible), t
  44390. },
  44391. clone: function () {
  44392. for (var e = new this.constructor(), t = 0; t < this.materials.length; t++) e.materials.push(this.materials[t].clone())
  44393. return (e.visible = this.visible), e
  44394. }
  44395. }),
  44396. (Ci.PointsMaterial = function (e) {
  44397. Ci.Material.call(this),
  44398. (this.type = 'PointsMaterial'),
  44399. (this.color = new Ci.Color(16777215)),
  44400. (this.map = null),
  44401. (this.size = 1),
  44402. (this.sizeAttenuation = !0),
  44403. (this.blending = Ci.NormalBlending),
  44404. (this.vertexColors = Ci.NoColors),
  44405. (this.fog = !0),
  44406. this.setValues(e)
  44407. }),
  44408. (Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype)),
  44409. (Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial),
  44410. (Ci.PointsMaterial.prototype.copy = function (e) {
  44411. return (
  44412. Ci.Material.prototype.copy.call(this, e),
  44413. this.color.copy(e.color),
  44414. (this.map = e.map),
  44415. (this.size = e.size),
  44416. (this.sizeAttenuation = e.sizeAttenuation),
  44417. (this.vertexColors = e.vertexColors),
  44418. (this.fog = e.fog),
  44419. this
  44420. )
  44421. }),
  44422. (Ci.ShaderMaterial = function (e) {
  44423. Ci.Material.call(this),
  44424. (this.type = 'ShaderMaterial'),
  44425. (this.defines = {}),
  44426. (this.uniforms = {}),
  44427. (this.vertexShader = 'void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}'),
  44428. (this.fragmentShader = 'void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}'),
  44429. (this.shading = Ci.SmoothShading),
  44430. (this.linewidth = 1),
  44431. (this.wireframe = !1),
  44432. (this.wireframeLinewidth = 1),
  44433. (this.fog = !1),
  44434. (this.lights = !1),
  44435. (this.vertexColors = Ci.NoColors),
  44436. (this.skinning = !1),
  44437. (this.morphTargets = !1),
  44438. (this.morphNormals = !1),
  44439. (this.extensions = {
  44440. derivatives: !1,
  44441. fragDepth: !1,
  44442. drawBuffers: !1,
  44443. shaderTextureLOD: !1
  44444. }),
  44445. (this.defaultAttributeValues = {
  44446. color: [1, 1, 1],
  44447. uv: [0, 0],
  44448. uv2: [0, 0]
  44449. }),
  44450. (this.index0AttributeName = void 0) !== e &&
  44451. (void 0 !== e.attributes && console.error('THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.'), this.setValues(e))
  44452. }),
  44453. (Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype)),
  44454. (Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial),
  44455. (Ci.ShaderMaterial.prototype.copy = function (e) {
  44456. return (
  44457. Ci.Material.prototype.copy.call(this, e),
  44458. (this.fragmentShader = e.fragmentShader),
  44459. (this.vertexShader = e.vertexShader),
  44460. (this.uniforms = Ci.UniformsUtils.clone(e.uniforms)),
  44461. (this.defines = e.defines),
  44462. (this.shading = e.shading),
  44463. (this.wireframe = e.wireframe),
  44464. (this.wireframeLinewidth = e.wireframeLinewidth),
  44465. (this.fog = e.fog),
  44466. (this.lights = e.lights),
  44467. (this.vertexColors = e.vertexColors),
  44468. (this.skinning = e.skinning),
  44469. (this.morphTargets = e.morphTargets),
  44470. (this.morphNormals = e.morphNormals),
  44471. (this.extensions = e.extensions),
  44472. this
  44473. )
  44474. }),
  44475. (Ci.ShaderMaterial.prototype.toJSON = function (e) {
  44476. var t = Ci.Material.prototype.toJSON.call(this, e)
  44477. return (t.uniforms = this.uniforms), (t.vertexShader = this.vertexShader), (t.fragmentShader = this.fragmentShader), t
  44478. }),
  44479. (Ci.RawShaderMaterial = function (e) {
  44480. Ci.ShaderMaterial.call(this, e), (this.type = 'RawShaderMaterial')
  44481. }),
  44482. (Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype)),
  44483. (Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial),
  44484. (Ci.SpriteMaterial = function (e) {
  44485. 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)
  44486. }),
  44487. (Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype)),
  44488. (Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial),
  44489. (Ci.SpriteMaterial.prototype.copy = function (e) {
  44490. 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
  44491. }),
  44492. (Ci.Texture = function (e, t, i, n, r, o, a, s, l) {
  44493. Object.defineProperty(this, 'id', {
  44494. value: Ci.TextureIdCount++
  44495. }),
  44496. (this.uuid = Ci.Math.generateUUID()),
  44497. (this.name = ''),
  44498. (this.sourceFile = ''),
  44499. (this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE),
  44500. (this.mipmaps = []),
  44501. (this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING),
  44502. (this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping),
  44503. (this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping),
  44504. (this.magFilter = void 0 !== r ? r : Ci.LinearFilter),
  44505. (this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter),
  44506. (this.anisotropy = void 0 !== l ? l : 1),
  44507. (this.format = void 0 !== a ? a : Ci.RGBAFormat),
  44508. (this.type = void 0 !== s ? s : Ci.UnsignedByteType),
  44509. (this.offset = new Ci.Vector2(0, 0)),
  44510. (this.repeat = new Ci.Vector2(1, 1)),
  44511. (this.generateMipmaps = !0),
  44512. (this.premultiplyAlpha = !1),
  44513. (this.flipY = !0),
  44514. (this.unpackAlignment = 4),
  44515. (this.encoding = Ci.LinearEncoding),
  44516. (this.version = 0),
  44517. (this.onUpdate = null)
  44518. }),
  44519. (Ci.Texture.DEFAULT_IMAGE = void 0),
  44520. (Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping),
  44521. (Ci.Texture.prototype = {
  44522. constructor: Ci.Texture,
  44523. set needsUpdate(e) {
  44524. !0 === e && this.version++
  44525. },
  44526. clone: function () {
  44527. return new this.constructor().copy(this)
  44528. },
  44529. copy: function (e) {
  44530. return (
  44531. (this.image = e.image),
  44532. (this.mipmaps = e.mipmaps.slice(0)),
  44533. (this.mapping = e.mapping),
  44534. (this.wrapS = e.wrapS),
  44535. (this.wrapT = e.wrapT),
  44536. (this.magFilter = e.magFilter),
  44537. (this.minFilter = e.minFilter),
  44538. (this.anisotropy = e.anisotropy),
  44539. (this.format = e.format),
  44540. (this.type = e.type),
  44541. this.offset.copy(e.offset),
  44542. this.repeat.copy(e.repeat),
  44543. (this.generateMipmaps = e.generateMipmaps),
  44544. (this.premultiplyAlpha = e.premultiplyAlpha),
  44545. (this.flipY = e.flipY),
  44546. (this.unpackAlignment = e.unpackAlignment),
  44547. (this.encoding = e.encoding),
  44548. this
  44549. )
  44550. },
  44551. toJSON: function (e) {
  44552. if (void 0 !== e.textures[this.uuid]) return e.textures[this.uuid]
  44553. var t,
  44554. i,
  44555. n = {
  44556. metadata: {
  44557. version: 4.4,
  44558. type: 'Texture',
  44559. generator: 'Texture.toJSON'
  44560. },
  44561. uuid: this.uuid,
  44562. name: this.name,
  44563. mapping: this.mapping,
  44564. repeat: [this.repeat.x, this.repeat.y],
  44565. offset: [this.offset.x, this.offset.y],
  44566. wrap: [this.wrapS, this.wrapT],
  44567. minFilter: this.minFilter,
  44568. magFilter: this.magFilter,
  44569. anisotropy: this.anisotropy
  44570. }
  44571. if (void 0 !== this.image) {
  44572. var r = this.image
  44573. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  44574. void 0 === e.images[r.uuid] &&
  44575. (e.images[r.uuid] = {
  44576. uuid: r.uuid,
  44577. url:
  44578. ((t = r),
  44579. void 0 !== t.toDataURL
  44580. ? (i = t)
  44581. : (((i = document.createElement('canvas')).width = t.width), (i.height = t.height), i.getContext('2d').drawImage(t, 0, 0, t.width, t.height)),
  44582. 2048 < i.width || 2048 < i.height ? i.toDataURL('image/jpeg', 0.6) : i.toDataURL('image/png'))
  44583. }),
  44584. (n.image = r.uuid)
  44585. }
  44586. return (e.textures[this.uuid] = n)
  44587. },
  44588. dispose: function () {
  44589. this.dispatchEvent({
  44590. type: 'dispose'
  44591. })
  44592. },
  44593. transformUv: function (e) {
  44594. if (this.mapping === Ci.UVMapping) {
  44595. if ((e.multiply(this.repeat), e.add(this.offset), e.x < 0 || 1 < e.x))
  44596. switch (this.wrapS) {
  44597. case Ci.RepeatWrapping:
  44598. e.x = e.x - Math.floor(e.x)
  44599. break
  44600. case Ci.ClampToEdgeWrapping:
  44601. e.x = e.x < 0 ? 0 : 1
  44602. break
  44603. case Ci.MirroredRepeatWrapping:
  44604. 1 === Math.abs(Math.floor(e.x) % 2) ? (e.x = Math.ceil(e.x) - e.x) : (e.x = e.x - Math.floor(e.x))
  44605. }
  44606. if (e.y < 0 || 1 < e.y)
  44607. switch (this.wrapT) {
  44608. case Ci.RepeatWrapping:
  44609. e.y = e.y - Math.floor(e.y)
  44610. break
  44611. case Ci.ClampToEdgeWrapping:
  44612. e.y = e.y < 0 ? 0 : 1
  44613. break
  44614. case Ci.MirroredRepeatWrapping:
  44615. 1 === Math.abs(Math.floor(e.y) % 2) ? (e.y = Math.ceil(e.y) - e.y) : (e.y = e.y - Math.floor(e.y))
  44616. }
  44617. this.flipY && (e.y = 1 - e.y)
  44618. }
  44619. }
  44620. }),
  44621. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  44622. (Ci.TextureIdCount = 0),
  44623. (Ci.CanvasTexture = function (e, t, i, n, r, o, a, s, l) {
  44624. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l), (this.needsUpdate = !0)
  44625. }),
  44626. (Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype)),
  44627. (Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture),
  44628. (Ci.CubeTexture = function (e, t, i, n, r, o, a, s, l) {
  44629. ;(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)
  44630. }),
  44631. (Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype)),
  44632. (Ci.CubeTexture.prototype.constructor = Ci.CubeTexture),
  44633. Object.defineProperty(Ci.CubeTexture.prototype, 'images', {
  44634. get: function () {
  44635. return this.image
  44636. },
  44637. set: function (e) {
  44638. this.image = e
  44639. }
  44640. }),
  44641. (Ci.CompressedTexture = function (e, t, i, n, r, o, a, s, l, c, h) {
  44642. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  44643. (this.image = {
  44644. width: t,
  44645. height: i
  44646. }),
  44647. (this.mipmaps = e),
  44648. (this.flipY = !1),
  44649. (this.generateMipmaps = !1)
  44650. }),
  44651. (Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype)),
  44652. (Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture),
  44653. (Ci.DataTexture = function (e, t, i, n, r, o, a, s, l, c, h) {
  44654. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  44655. (this.image = {
  44656. data: e,
  44657. width: t,
  44658. height: i
  44659. }),
  44660. (this.magFilter = void 0 !== l ? l : Ci.NearestFilter),
  44661. (this.minFilter = void 0 !== c ? c : Ci.NearestFilter),
  44662. (this.flipY = !1),
  44663. (this.generateMipmaps = !1)
  44664. }),
  44665. (Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype)),
  44666. (Ci.DataTexture.prototype.constructor = Ci.DataTexture),
  44667. (Ci.VideoTexture = function (t, e, i, n, r, o, a, s, l) {
  44668. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l), (this.generateMipmaps = !1)
  44669. var c = this
  44670. !(function e() {
  44671. requestAnimationFrame(e), !t.paused && t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  44672. })()
  44673. }),
  44674. (Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype)),
  44675. (Ci.VideoTexture.prototype.constructor = Ci.VideoTexture),
  44676. (Ci.Group = function () {
  44677. Ci.Object3D.call(this), (this.type = 'Group')
  44678. }),
  44679. (Ci.Group.prototype = Object.create(Ci.Object3D.prototype)),
  44680. (Ci.Group.prototype.constructor = Ci.Group),
  44681. (Ci.Points = function (e, t) {
  44682. Ci.Object3D.call(this),
  44683. (this.type = 'Points'),
  44684. (this.geometry = void 0 !== e ? e : new Ci.Geometry()),
  44685. (this.material =
  44686. void 0 !== t
  44687. ? t
  44688. : new Ci.PointsMaterial({
  44689. color: 16777215 * Math.random()
  44690. }))
  44691. }),
  44692. (Ci.Points.prototype = Object.create(Ci.Object3D.prototype)),
  44693. (Ci.Points.prototype.constructor = Ci.Points),
  44694. (Ci.Points.prototype.raycast =
  44695. ((Wt = new Ci.Matrix4()),
  44696. (jt = new Ci.Ray()),
  44697. (Yt = new Ci.Sphere()),
  44698. function (o, a) {
  44699. function e(e, t) {
  44700. var i = jt.distanceSqToPoint(e)
  44701. if (i < c) {
  44702. var n = jt.closestPointToPoint(e)
  44703. n.applyMatrix4(l)
  44704. var r = o.ray.origin.distanceTo(n)
  44705. if (r < o.near || r > o.far) return
  44706. a.push({
  44707. distance: r,
  44708. distanceToRay: Math.sqrt(i),
  44709. point: n.clone(),
  44710. index: t,
  44711. face: null,
  44712. object: s
  44713. })
  44714. }
  44715. }
  44716. var s = this,
  44717. t = this.geometry,
  44718. l = this.matrixWorld,
  44719. i = o.params.Points.threshold
  44720. if ((null === t.boundingSphere && t.computeBoundingSphere(), Yt.copy(t.boundingSphere), Yt.applyMatrix4(l), !1 !== o.ray.intersectsSphere(Yt))) {
  44721. Wt.getInverse(l), jt.copy(o.ray).applyMatrix4(Wt)
  44722. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3),
  44723. c = n * n,
  44724. r = new Ci.Vector3()
  44725. if (t instanceof Ci.BufferGeometry) {
  44726. var h = t.index,
  44727. u = t.attributes.position.array
  44728. if (null !== h)
  44729. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  44730. var g = d[p]
  44731. r.fromArray(u, 3 * g), e(r, g)
  44732. }
  44733. else {
  44734. p = 0
  44735. for (var m = u.length / 3; p < m; p++) r.fromArray(u, 3 * p), e(r, p)
  44736. }
  44737. } else {
  44738. var v = t.vertices
  44739. for (p = 0, m = v.length; p < m; p++) e(v[p], p)
  44740. }
  44741. }
  44742. })),
  44743. (Ci.Points.prototype.clone = function () {
  44744. return new this.constructor(this.geometry, this.material).copy(this)
  44745. }),
  44746. (Ci.Line = function (e, t, i) {
  44747. return 1 === i
  44748. ? (console.warn('THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead.'), new Ci.LineSegments(e, t))
  44749. : (Ci.Object3D.call(this),
  44750. (this.type = 'Line'),
  44751. (this.geometry = void 0 !== e ? e : new Ci.Geometry()),
  44752. void (this.material =
  44753. void 0 !== t
  44754. ? t
  44755. : new Ci.LineBasicMaterial({
  44756. color: 16777215 * Math.random()
  44757. })))
  44758. }),
  44759. (Ci.Line.prototype = Object.create(Ci.Object3D.prototype)),
  44760. (Ci.Line.prototype.constructor = Ci.Line),
  44761. (Ci.Line.prototype.raycast =
  44762. ((Ht = new Ci.Matrix4()),
  44763. (zt = new Ci.Ray()),
  44764. (Gt = new Ci.Sphere()),
  44765. function (e, t) {
  44766. var i = e.linePrecision,
  44767. n = i * i,
  44768. r = this.geometry,
  44769. o = this.matrixWorld
  44770. if ((null === r.boundingSphere && r.computeBoundingSphere(), Gt.copy(r.boundingSphere), Gt.applyMatrix4(o), !1 !== e.ray.intersectsSphere(Gt))) {
  44771. Ht.getInverse(o), zt.copy(e.ray).applyMatrix4(Ht)
  44772. var a = new Ci.Vector3(),
  44773. s = new Ci.Vector3(),
  44774. l = new Ci.Vector3(),
  44775. c = new Ci.Vector3(),
  44776. h = this instanceof Ci.LineSegments ? 2 : 1
  44777. if (r instanceof Ci.BufferGeometry) {
  44778. var u = r.index,
  44779. d = r.attributes.position.array
  44780. if (null !== u)
  44781. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  44782. var m = p[f],
  44783. v = p[f + 1]
  44784. a.fromArray(d, 3 * m),
  44785. s.fromArray(d, 3 * v),
  44786. n < zt.distanceSqToSegment(a, s, c, l) ||
  44787. (c.applyMatrix4(this.matrixWorld),
  44788. (C = e.ray.origin.distanceTo(c)) < e.near ||
  44789. C > e.far ||
  44790. t.push({
  44791. distance: C,
  44792. point: l.clone().applyMatrix4(this.matrixWorld),
  44793. index: f,
  44794. face: null,
  44795. faceIndex: null,
  44796. object: this
  44797. }))
  44798. }
  44799. else
  44800. for (f = 0, g = d.length / 3 - 1; f < g; f += h)
  44801. a.fromArray(d, 3 * f),
  44802. s.fromArray(d, 3 * f + 3),
  44803. n < zt.distanceSqToSegment(a, s, c, l) ||
  44804. (c.applyMatrix4(this.matrixWorld),
  44805. (C = e.ray.origin.distanceTo(c)) < e.near ||
  44806. C > e.far ||
  44807. t.push({
  44808. distance: C,
  44809. point: l.clone().applyMatrix4(this.matrixWorld),
  44810. index: f,
  44811. face: null,
  44812. faceIndex: null,
  44813. object: this
  44814. }))
  44815. } else if (r instanceof Ci.Geometry) {
  44816. var y = r.vertices,
  44817. A = y.length
  44818. for (f = 0; f < A - 1; f += h) {
  44819. var C
  44820. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) ||
  44821. (c.applyMatrix4(this.matrixWorld),
  44822. (C = e.ray.origin.distanceTo(c)) < e.near ||
  44823. C > e.far ||
  44824. t.push({
  44825. distance: C,
  44826. point: l.clone().applyMatrix4(this.matrixWorld),
  44827. index: f,
  44828. face: null,
  44829. faceIndex: null,
  44830. object: this
  44831. }))
  44832. }
  44833. }
  44834. }
  44835. })),
  44836. (Ci.Line.prototype.clone = function () {
  44837. return new this.constructor(this.geometry, this.material).copy(this)
  44838. }),
  44839. (Ci.LineStrip = 0),
  44840. (Ci.LinePieces = 1),
  44841. (Ci.LineSegments = function (e, t) {
  44842. Ci.Line.call(this, e, t), (this.type = 'LineSegments')
  44843. }),
  44844. (Ci.LineSegments.prototype = Object.create(Ci.Line.prototype)),
  44845. (Ci.LineSegments.prototype.constructor = Ci.LineSegments),
  44846. (Ci.Mesh = function (e, t) {
  44847. Ci.Object3D.call(this),
  44848. (this.type = 'Mesh'),
  44849. (this.geometry = void 0 !== e ? e : new Ci.Geometry()),
  44850. (this.material =
  44851. void 0 !== t
  44852. ? t
  44853. : new Ci.MeshBasicMaterial({
  44854. color: 16777215 * Math.random()
  44855. })),
  44856. (this.drawMode = Ci.TrianglesDrawMode),
  44857. this.updateMorphTargets()
  44858. }),
  44859. (Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype)),
  44860. (Ci.Mesh.prototype.constructor = Ci.Mesh),
  44861. (Ci.Mesh.prototype.setDrawMode = function (e) {
  44862. this.drawMode = e
  44863. }),
  44864. (Ci.Mesh.prototype.updateMorphTargets = function () {
  44865. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  44866. ;(this.morphTargetBase = -1), (this.morphTargetInfluences = []), (this.morphTargetDictionary = {})
  44867. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++) this.morphTargetInfluences.push(0), (this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e)
  44868. }
  44869. }),
  44870. (Ci.Mesh.prototype.getMorphTargetIndexByName = function (e) {
  44871. return void 0 !== this.morphTargetDictionary[e]
  44872. ? this.morphTargetDictionary[e]
  44873. : (console.warn('THREE.Mesh.getMorphTargetIndexByName: morph target ' + e + ' does not exist. Returning 0.'), 0)
  44874. }),
  44875. (Ci.Mesh.prototype.raycast =
  44876. ((Tt = new Ci.Matrix4()),
  44877. (xt = new Ci.Ray()),
  44878. (St = new Ci.Sphere()),
  44879. (Mt = new Ci.Vector3()),
  44880. (Rt = new Ci.Vector3()),
  44881. (Pt = new Ci.Vector3()),
  44882. (Ot = new Ci.Vector3()),
  44883. (Lt = new Ci.Vector3()),
  44884. (Dt = new Ci.Vector3()),
  44885. (Nt = new Ci.Vector2()),
  44886. (Ft = new Ci.Vector2()),
  44887. (Bt = new Ci.Vector2()),
  44888. (Vt = new Ci.Vector3()),
  44889. (kt = new Ci.Vector3()),
  44890. (Ut = new Ci.Vector3()),
  44891. function (e, t) {
  44892. var i,
  44893. n,
  44894. r = this.geometry,
  44895. o = this.material,
  44896. a = this.matrixWorld
  44897. if (
  44898. void 0 !== o &&
  44899. (null === r.boundingSphere && r.computeBoundingSphere(),
  44900. St.copy(r.boundingSphere),
  44901. St.applyMatrix4(a),
  44902. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a), xt.copy(e.ray).applyMatrix4(Tt), null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox)))
  44903. )
  44904. if (r instanceof Ci.BufferGeometry) {
  44905. var s,
  44906. l,
  44907. c,
  44908. h = r.index,
  44909. u = r.attributes,
  44910. d = u.position.array
  44911. if ((void 0 !== u.uv && (i = u.uv.array), null !== h))
  44912. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  44913. (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))
  44914. 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))
  44915. } else if (r instanceof Ci.Geometry) {
  44916. var m,
  44917. v,
  44918. y,
  44919. A = o instanceof Ci.MultiMaterial,
  44920. C = 1 == A ? o.materials : null,
  44921. I = r.vertices,
  44922. E = r.faces,
  44923. _ = r.faceVertexUvs[0]
  44924. 0 < _.length && (i = _)
  44925. for (var b = 0, w = E.length; b < w; b++) {
  44926. var T = E[b],
  44927. x = 1 == A ? C[T.materialIndex] : o
  44928. if (void 0 !== x) {
  44929. if (((m = I[T.a]), (v = I[T.b]), (y = I[T.c]), !0 === x.morphTargets)) {
  44930. var S = r.morphTargets,
  44931. M = this.morphTargetInfluences
  44932. Mt.set(0, 0, 0), Rt.set(0, 0, 0), Pt.set(0, 0, 0)
  44933. for (var R = 0, P = S.length; R < P; R++) {
  44934. var O = M[R]
  44935. if (0 !== O) {
  44936. var L = S[R].vertices
  44937. 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)
  44938. }
  44939. }
  44940. Mt.add(m), Rt.add(v), Pt.add(y), (m = Mt), (v = Rt), (y = Pt)
  44941. }
  44942. if ((n = wi(this, e, xt, m, v, y, kt))) {
  44943. if (i) {
  44944. var D = i[b]
  44945. Nt.copy(D[0]), Ft.copy(D[1]), Bt.copy(D[2]), (n.uv = bi(kt, m, v, y, Nt, Ft, Bt))
  44946. }
  44947. ;(n.face = T), (n.faceIndex = b), t.push(n)
  44948. }
  44949. }
  44950. }
  44951. }
  44952. })),
  44953. (Ci.Mesh.prototype.clone = function () {
  44954. return new this.constructor(this.geometry, this.material).copy(this)
  44955. }),
  44956. (Ci.Bone = function (e) {
  44957. Ci.Object3D.call(this), (this.type = 'Bone'), (this.skin = e)
  44958. }),
  44959. (Ci.Bone.prototype = Object.create(Ci.Object3D.prototype)),
  44960. (Ci.Bone.prototype.constructor = Ci.Bone),
  44961. (Ci.Bone.prototype.copy = function (e) {
  44962. return Ci.Object3D.prototype.copy.call(this, e), (this.skin = e.skin), this
  44963. }),
  44964. (Ci.Skeleton = function (e, t, i) {
  44965. if (((this.useVertexTexture = void 0 === i || i), (this.identityMatrix = new Ci.Matrix4()), (e = e || []), (this.bones = e.slice(0)), this.useVertexTexture)) {
  44966. var n = Math.sqrt(4 * this.bones.length)
  44967. ;(n = Ci.Math.nextPowerOfTwo(Math.ceil(n))),
  44968. (n = Math.max(n, 4)),
  44969. (this.boneTextureWidth = n),
  44970. (this.boneTextureHeight = n),
  44971. (this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4)),
  44972. (this.boneTexture = new Ci.DataTexture(this.boneMatrices, this.boneTextureWidth, this.boneTextureHeight, Ci.RGBAFormat, Ci.FloatType))
  44973. } else this.boneMatrices = new Float32Array(16 * this.bones.length)
  44974. if (void 0 === t) this.calculateInverses()
  44975. else if (this.bones.length === t.length) this.boneInverses = t.slice(0)
  44976. else {
  44977. console.warn('THREE.Skeleton bonInverses is the wrong length.'), (this.boneInverses = [])
  44978. for (var r = 0, o = this.bones.length; r < o; r++) this.boneInverses.push(new Ci.Matrix4())
  44979. }
  44980. }),
  44981. (Ci.Skeleton.prototype.calculateInverses = function () {
  44982. this.boneInverses = []
  44983. for (var e = 0, t = this.bones.length; e < t; e++) {
  44984. var i = new Ci.Matrix4()
  44985. this.bones[e] && i.getInverse(this.bones[e].matrixWorld), this.boneInverses.push(i)
  44986. }
  44987. }),
  44988. (Ci.Skeleton.prototype.pose = function () {
  44989. for (var e, t = 0, i = this.bones.length; t < i; t++) (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t])
  44990. for (t = 0, i = this.bones.length; t < i; t++)
  44991. (e = this.bones[t]) &&
  44992. (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))
  44993. }),
  44994. (Ci.Skeleton.prototype.update =
  44995. ((wt = new Ci.Matrix4()),
  44996. function () {
  44997. for (var e = 0, t = this.bones.length; e < t; e++) {
  44998. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix
  44999. wt.multiplyMatrices(i, this.boneInverses[e]), wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  45000. }
  45001. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  45002. })),
  45003. (Ci.Skeleton.prototype.clone = function () {
  45004. return new Ci.Skeleton(this.bones, this.boneInverses, this.useVertexTexture)
  45005. }),
  45006. (Ci.SkinnedMesh = function (e, t, i) {
  45007. Ci.Mesh.call(this, e, t), (this.type = 'SkinnedMesh'), (this.bindMode = 'attached'), (this.bindMatrix = new Ci.Matrix4()), (this.bindMatrixInverse = new Ci.Matrix4())
  45008. var n = []
  45009. if (this.geometry && void 0 !== this.geometry.bones) {
  45010. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  45011. (o = this.geometry.bones[a]),
  45012. (r = new Ci.Bone(this)),
  45013. n.push(r),
  45014. (r.name = o.name),
  45015. r.position.fromArray(o.pos),
  45016. r.quaternion.fromArray(o.rotq),
  45017. void 0 !== o.scl && r.scale.fromArray(o.scl)
  45018. 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])
  45019. }
  45020. this.normalizeSkinWeights(), this.updateMatrixWorld(!0), this.bind(new Ci.Skeleton(n, void 0, i), this.matrixWorld)
  45021. }),
  45022. (Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype)),
  45023. (Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh),
  45024. (Ci.SkinnedMesh.prototype.bind = function (e, t) {
  45025. ;(this.skeleton = e),
  45026. void 0 === t && (this.updateMatrixWorld(!0), this.skeleton.calculateInverses(), (t = this.matrixWorld)),
  45027. this.bindMatrix.copy(t),
  45028. this.bindMatrixInverse.getInverse(t)
  45029. }),
  45030. (Ci.SkinnedMesh.prototype.pose = function () {
  45031. this.skeleton.pose()
  45032. }),
  45033. (Ci.SkinnedMesh.prototype.normalizeSkinWeights = function () {
  45034. if (this.geometry instanceof Ci.Geometry)
  45035. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  45036. var t = this.geometry.skinWeights[e]
  45037. ;(r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  45038. }
  45039. else if (this.geometry instanceof Ci.BufferGeometry) {
  45040. var i = new Ci.Vector4(),
  45041. n = this.geometry.attributes.skinWeight
  45042. for (e = 0; e < n.count; e++) {
  45043. var r
  45044. ;(i.x = n.getX(e)),
  45045. (i.y = n.getY(e)),
  45046. (i.z = n.getZ(e)),
  45047. (i.w = n.getW(e)),
  45048. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  45049. n.setXYZW(e, i.x, i.y, i.z, i.w)
  45050. }
  45051. }
  45052. }),
  45053. (Ci.SkinnedMesh.prototype.updateMatrixWorld = function (e) {
  45054. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  45055. 'attached' === this.bindMode
  45056. ? this.bindMatrixInverse.getInverse(this.matrixWorld)
  45057. : 'detached' === this.bindMode
  45058. ? this.bindMatrixInverse.getInverse(this.bindMatrix)
  45059. : console.warn('THREE.SkinnedMesh unrecognized bindMode: ' + this.bindMode)
  45060. }),
  45061. (Ci.SkinnedMesh.prototype.clone = function () {
  45062. return new this.constructor(this.geometry, this.material, this.useVertexTexture).copy(this)
  45063. }),
  45064. (Ci.LOD = function () {
  45065. Ci.Object3D.call(this),
  45066. (this.type = 'LOD'),
  45067. Object.defineProperties(this, {
  45068. levels: {
  45069. enumerable: !0,
  45070. value: []
  45071. },
  45072. objects: {
  45073. get: function () {
  45074. return console.warn('THREE.LOD: .objects has been renamed to .levels.'), this.levels
  45075. }
  45076. }
  45077. })
  45078. }),
  45079. (Ci.LOD.prototype = Object.create(Ci.Object3D.prototype)),
  45080. (Ci.LOD.prototype.constructor = Ci.LOD),
  45081. (Ci.LOD.prototype.addLevel = function (e, t) {
  45082. void 0 === t && (t = 0), (t = Math.abs(t))
  45083. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++);
  45084. i.splice(n, 0, {
  45085. distance: t,
  45086. object: e
  45087. }),
  45088. this.add(e)
  45089. }),
  45090. (Ci.LOD.prototype.getObjectForDistance = function (e) {
  45091. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++);
  45092. return t[i - 1].object
  45093. }),
  45094. (Ci.LOD.prototype.raycast =
  45095. ((bt = new Ci.Vector3()),
  45096. function (e, t) {
  45097. bt.setFromMatrixPosition(this.matrixWorld)
  45098. var i = e.ray.origin.distanceTo(bt)
  45099. this.getObjectForDistance(i).raycast(e, t)
  45100. })),
  45101. (Ci.LOD.prototype.update =
  45102. ((Et = new Ci.Vector3()),
  45103. (_t = new Ci.Vector3()),
  45104. function (e) {
  45105. var t = this.levels
  45106. if (1 < t.length) {
  45107. Et.setFromMatrixPosition(e.matrixWorld), _t.setFromMatrixPosition(this.matrixWorld)
  45108. var i = Et.distanceTo(_t)
  45109. t[0].object.visible = !0
  45110. 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)
  45111. for (; n < r; n++) t[n].object.visible = !1
  45112. }
  45113. })),
  45114. (Ci.LOD.prototype.copy = function (e) {
  45115. Ci.Object3D.prototype.copy.call(this, e, !1)
  45116. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  45117. var r = t[i]
  45118. this.addLevel(r.object.clone(), r.distance)
  45119. }
  45120. return this
  45121. }),
  45122. (Ci.LOD.prototype.toJSON = function (e) {
  45123. var t = Ci.Object3D.prototype.toJSON.call(this, e)
  45124. t.object.levels = []
  45125. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  45126. var o = i[n]
  45127. t.object.levels.push({
  45128. object: o.object.uuid,
  45129. distance: o.distance
  45130. })
  45131. }
  45132. return t
  45133. }),
  45134. (Ci.Sprite =
  45135. ((yt = new Uint16Array([0, 1, 2, 0, 2, 3])),
  45136. (At = new Float32Array([-0.5, -0.5, 0, 0.5, -0.5, 0, 0.5, 0.5, 0, -0.5, 0.5, 0])),
  45137. (Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])),
  45138. (It = new Ci.BufferGeometry()).setIndex(new Ci.BufferAttribute(yt, 1)),
  45139. It.addAttribute('position', new Ci.BufferAttribute(At, 3)),
  45140. It.addAttribute('uv', new Ci.BufferAttribute(Ct, 2)),
  45141. function (e) {
  45142. Ci.Object3D.call(this), (this.type = 'Sprite'), (this.geometry = It), (this.material = void 0 !== e ? e : new Ci.SpriteMaterial())
  45143. })),
  45144. (Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype)),
  45145. (Ci.Sprite.prototype.constructor = Ci.Sprite),
  45146. (Ci.Sprite.prototype.raycast =
  45147. ((vt = new Ci.Vector3()),
  45148. function (e, t) {
  45149. vt.setFromMatrixPosition(this.matrixWorld)
  45150. var i = e.ray.distanceSqToPoint(vt)
  45151. this.scale.x * this.scale.y < i ||
  45152. t.push({
  45153. distance: Math.sqrt(i),
  45154. point: this.position,
  45155. face: null,
  45156. object: this
  45157. })
  45158. })),
  45159. (Ci.Sprite.prototype.clone = function () {
  45160. return new this.constructor(this.material).copy(this)
  45161. }),
  45162. (Ci.Particle = Ci.Sprite),
  45163. (Ci.LensFlare = function (e, t, i, n, r) {
  45164. Ci.Object3D.call(this), (this.lensFlares = []), (this.positionScreen = new Ci.Vector3()), (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  45165. }),
  45166. (Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype)),
  45167. (Ci.LensFlare.prototype.constructor = Ci.LensFlare),
  45168. (Ci.LensFlare.prototype.add = function (e, t, i, n, r, o) {
  45169. void 0 === t && (t = -1),
  45170. void 0 === i && (i = 0),
  45171. void 0 === o && (o = 1),
  45172. void 0 === r && (r = new Ci.Color(16777215)),
  45173. void 0 === n && (n = Ci.NormalBlending),
  45174. (i = Math.min(i, Math.max(0, i))),
  45175. this.lensFlares.push({
  45176. texture: e,
  45177. size: t,
  45178. distance: i,
  45179. x: 0,
  45180. y: 0,
  45181. z: 0,
  45182. scale: 1,
  45183. rotation: 0,
  45184. opacity: o,
  45185. color: r,
  45186. blending: n
  45187. })
  45188. }),
  45189. (Ci.LensFlare.prototype.updateLensFlares = function () {
  45190. var e,
  45191. t,
  45192. i = this.lensFlares.length,
  45193. n = 2 * -this.positionScreen.x,
  45194. r = 2 * -this.positionScreen.y
  45195. for (e = 0; e < i; e++)
  45196. ((t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance),
  45197. (t.y = this.positionScreen.y + r * t.distance),
  45198. (t.wantedRotation = t.x * Math.PI * 0.25),
  45199. (t.rotation += 0.25 * (t.wantedRotation - t.rotation))
  45200. }),
  45201. (Ci.LensFlare.prototype.copy = function (e) {
  45202. Ci.Object3D.prototype.copy.call(this, e), this.positionScreen.copy(e.positionScreen), (this.customUpdateCallback = e.customUpdateCallback)
  45203. for (var t = 0, i = e.lensFlares.length; t < i; t++) this.lensFlares.push(e.lensFlares[t])
  45204. return this
  45205. }),
  45206. (Ci.Scene = function () {
  45207. Ci.Object3D.call(this), (this.type = 'Scene'), (this.fog = null), (this.overrideMaterial = null), (this.autoUpdate = !0)
  45208. }),
  45209. (Ci.Scene.prototype = Object.create(Ci.Object3D.prototype)),
  45210. (Ci.Scene.prototype.constructor = Ci.Scene),
  45211. (Ci.Scene.prototype.copy = function (e, t) {
  45212. return (
  45213. Ci.Object3D.prototype.copy.call(this, e, t),
  45214. null !== e.fog && (this.fog = e.fog.clone()),
  45215. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  45216. (this.autoUpdate = e.autoUpdate),
  45217. (this.matrixAutoUpdate = e.matrixAutoUpdate),
  45218. this
  45219. )
  45220. }),
  45221. (Ci.Fog = function (e, t, i) {
  45222. ;(this.name = ''), (this.color = new Ci.Color(e)), (this.near = void 0 !== t ? t : 1), (this.far = void 0 !== i ? i : 1e3)
  45223. }),
  45224. (Ci.Fog.prototype.clone = function () {
  45225. return new Ci.Fog(this.color.getHex(), this.near, this.far)
  45226. }),
  45227. (Ci.FogExp2 = function (e, t) {
  45228. ;(this.name = ''), (this.color = new Ci.Color(e)), (this.density = void 0 !== t ? t : 25e-5)
  45229. }),
  45230. (Ci.FogExp2.prototype.clone = function () {
  45231. return new Ci.FogExp2(this.color.getHex(), this.density)
  45232. }),
  45233. (Ci.ShaderChunk = {}),
  45234. (Ci.ShaderChunk.alphamap_fragment = '#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n'),
  45235. (Ci.ShaderChunk.alphamap_pars_fragment = '#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n'),
  45236. (Ci.ShaderChunk.alphatest_fragment = '#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n'),
  45237. (Ci.ShaderChunk.aomap_fragment =
  45238. '#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'),
  45239. (Ci.ShaderChunk.aomap_pars_fragment = '#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif'),
  45240. (Ci.ShaderChunk.begin_vertex = '\nvec3 transformed = vec3( position );\n'),
  45241. (Ci.ShaderChunk.beginnormal_vertex = '\nvec3 objectNormal = vec3( normal );\n'),
  45242. (Ci.ShaderChunk.bsdfs =
  45243. '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'),
  45244. (Ci.ShaderChunk.bumpmap_pars_fragment =
  45245. '#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'),
  45246. (Ci.ShaderChunk.color_fragment = '#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif'),
  45247. (Ci.ShaderChunk.color_pars_fragment = '#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n'),
  45248. (Ci.ShaderChunk.color_pars_vertex = '#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif'),
  45249. (Ci.ShaderChunk.color_vertex = '#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif'),
  45250. (Ci.ShaderChunk.common =
  45251. '#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'),
  45252. (Ci.ShaderChunk.cube_uv_reflection_fragment =
  45253. '#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'),
  45254. (Ci.ShaderChunk.defaultnormal_vertex = '#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n'),
  45255. (Ci.ShaderChunk.displacementmap_vertex = '#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n'),
  45256. (Ci.ShaderChunk.displacementmap_pars_vertex =
  45257. '#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n'),
  45258. (Ci.ShaderChunk.emissivemap_fragment =
  45259. '#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n'),
  45260. (Ci.ShaderChunk.emissivemap_pars_fragment = '#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n'),
  45261. (Ci.ShaderChunk.encodings_pars_fragment =
  45262. '\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'),
  45263. (Ci.ShaderChunk.encodings_fragment = ' gl_FragColor = linearToOutputTexel( gl_FragColor );\n'),
  45264. (Ci.ShaderChunk.envmap_fragment =
  45265. '#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'),
  45266. (Ci.ShaderChunk.envmap_pars_fragment =
  45267. '#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'),
  45268. (Ci.ShaderChunk.envmap_pars_vertex =
  45269. '#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'),
  45270. (Ci.ShaderChunk.envmap_vertex =
  45271. '#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'),
  45272. (Ci.ShaderChunk.fog_fragment =
  45273. '#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'),
  45274. (Ci.ShaderChunk.fog_pars_fragment =
  45275. '#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'),
  45276. (Ci.ShaderChunk.lightmap_fragment = '#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n'),
  45277. (Ci.ShaderChunk.lightmap_pars_fragment = '#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif'),
  45278. (Ci.ShaderChunk.lights_lambert_vertex =
  45279. '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'),
  45280. (Ci.ShaderChunk.lights_pars =
  45281. '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'),
  45282. (Ci.ShaderChunk.lights_phong_fragment =
  45283. 'BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n'),
  45284. (Ci.ShaderChunk.lights_phong_pars_fragment =
  45285. '#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'),
  45286. (Ci.ShaderChunk.lights_phong_pars_vertex = '#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n'),
  45287. (Ci.ShaderChunk.lights_phong_vertex = '#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n'),
  45288. (Ci.ShaderChunk.lights_standard_fragment =
  45289. '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'),
  45290. (Ci.ShaderChunk.lights_standard_pars_fragment =
  45291. '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'),
  45292. (Ci.ShaderChunk.lights_template =
  45293. '\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'),
  45294. (Ci.ShaderChunk.logdepthbuf_fragment = '#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif'),
  45295. (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'),
  45296. (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'),
  45297. (Ci.ShaderChunk.logdepthbuf_vertex =
  45298. '#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'),
  45299. (Ci.ShaderChunk.map_fragment = '#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n'),
  45300. (Ci.ShaderChunk.map_pars_fragment = '#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n'),
  45301. (Ci.ShaderChunk.map_particle_fragment =
  45302. '#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'),
  45303. (Ci.ShaderChunk.map_particle_pars_fragment = '#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n'),
  45304. (Ci.ShaderChunk.metalnessmap_fragment =
  45305. 'float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n'),
  45306. (Ci.ShaderChunk.metalnessmap_pars_fragment = '#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif'),
  45307. (Ci.ShaderChunk.morphnormal_vertex =
  45308. '#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'),
  45309. (Ci.ShaderChunk.morphtarget_pars_vertex =
  45310. '#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'),
  45311. (Ci.ShaderChunk.morphtarget_vertex =
  45312. '#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'),
  45313. (Ci.ShaderChunk.normal_fragment =
  45314. '#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'),
  45315. (Ci.ShaderChunk.normalmap_pars_fragment =
  45316. '#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'),
  45317. (Ci.ShaderChunk.premultiplied_alpha_fragment = '#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n'),
  45318. (Ci.ShaderChunk.project_vertex =
  45319. '#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'),
  45320. (Ci.ShaderChunk.roughnessmap_fragment =
  45321. 'float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n'),
  45322. (Ci.ShaderChunk.roughnessmap_pars_fragment = '#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif'),
  45323. (Ci.ShaderChunk.shadowmap_pars_fragment =
  45324. '#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'),
  45325. (Ci.ShaderChunk.shadowmap_pars_vertex =
  45326. '#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'),
  45327. (Ci.ShaderChunk.shadowmap_vertex =
  45328. '#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'),
  45329. (Ci.ShaderChunk.shadowmask_pars_fragment =
  45330. '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'),
  45331. (Ci.ShaderChunk.skinbase_vertex =
  45332. '#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'),
  45333. (Ci.ShaderChunk.skinning_pars_vertex =
  45334. '#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'),
  45335. (Ci.ShaderChunk.skinning_vertex =
  45336. '#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'),
  45337. (Ci.ShaderChunk.skinnormal_vertex =
  45338. '#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'),
  45339. (Ci.ShaderChunk.specularmap_fragment =
  45340. 'float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif'),
  45341. (Ci.ShaderChunk.specularmap_pars_fragment = '#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif'),
  45342. (Ci.ShaderChunk.tonemapping_fragment = '#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n'),
  45343. (Ci.ShaderChunk.tonemapping_pars_fragment =
  45344. '#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'),
  45345. (Ci.ShaderChunk.uv2_pars_fragment = '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif'),
  45346. (Ci.ShaderChunk.uv2_pars_vertex = '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif'),
  45347. (Ci.ShaderChunk.uv2_vertex = '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif'),
  45348. (Ci.ShaderChunk.uv_pars_fragment =
  45349. '#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'),
  45350. (Ci.ShaderChunk.uv_pars_vertex =
  45351. '#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'),
  45352. (Ci.ShaderChunk.uv_vertex =
  45353. '#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'),
  45354. (Ci.ShaderChunk.worldpos_vertex =
  45355. '#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'),
  45356. (Ci.UniformsUtils = {
  45357. merge: function (e) {
  45358. for (var t = {}, i = 0; i < e.length; i++) {
  45359. var n = this.clone(e[i])
  45360. for (var r in n) t[r] = n[r]
  45361. }
  45362. return t
  45363. },
  45364. clone: function (e) {
  45365. var t = {}
  45366. for (var i in e)
  45367. for (var n in ((t[i] = {}), e[i])) {
  45368. var r = e[i][n]
  45369. r instanceof Ci.Color ||
  45370. r instanceof Ci.Vector2 ||
  45371. r instanceof Ci.Vector3 ||
  45372. r instanceof Ci.Vector4 ||
  45373. r instanceof Ci.Matrix3 ||
  45374. r instanceof Ci.Matrix4 ||
  45375. r instanceof Ci.Texture
  45376. ? (t[i][n] = r.clone())
  45377. : Array.isArray(r)
  45378. ? (t[i][n] = r.slice())
  45379. : (t[i][n] = r)
  45380. }
  45381. return t
  45382. }
  45383. }),
  45384. (Ci.UniformsLib = {
  45385. common: {
  45386. diffuse: {
  45387. type: 'c',
  45388. value: new Ci.Color(15658734)
  45389. },
  45390. opacity: {
  45391. type: 'f',
  45392. value: 1
  45393. },
  45394. map: {
  45395. type: 't',
  45396. value: null
  45397. },
  45398. offsetRepeat: {
  45399. type: 'v4',
  45400. value: new Ci.Vector4(0, 0, 1, 1)
  45401. },
  45402. specularMap: {
  45403. type: 't',
  45404. value: null
  45405. },
  45406. alphaMap: {
  45407. type: 't',
  45408. value: null
  45409. },
  45410. envMap: {
  45411. type: 't',
  45412. value: null
  45413. },
  45414. flipEnvMap: {
  45415. type: 'f',
  45416. value: -1
  45417. },
  45418. reflectivity: {
  45419. type: 'f',
  45420. value: 1
  45421. },
  45422. refractionRatio: {
  45423. type: 'f',
  45424. value: 0.98
  45425. }
  45426. },
  45427. aomap: {
  45428. aoMap: {
  45429. type: 't',
  45430. value: null
  45431. },
  45432. aoMapIntensity: {
  45433. type: 'f',
  45434. value: 1
  45435. }
  45436. },
  45437. lightmap: {
  45438. lightMap: {
  45439. type: 't',
  45440. value: null
  45441. },
  45442. lightMapIntensity: {
  45443. type: 'f',
  45444. value: 1
  45445. }
  45446. },
  45447. emissivemap: {
  45448. emissiveMap: {
  45449. type: 't',
  45450. value: null
  45451. }
  45452. },
  45453. bumpmap: {
  45454. bumpMap: {
  45455. type: 't',
  45456. value: null
  45457. },
  45458. bumpScale: {
  45459. type: 'f',
  45460. value: 1
  45461. }
  45462. },
  45463. normalmap: {
  45464. normalMap: {
  45465. type: 't',
  45466. value: null
  45467. },
  45468. normalScale: {
  45469. type: 'v2',
  45470. value: new Ci.Vector2(1, 1)
  45471. }
  45472. },
  45473. displacementmap: {
  45474. displacementMap: {
  45475. type: 't',
  45476. value: null
  45477. },
  45478. displacementScale: {
  45479. type: 'f',
  45480. value: 1
  45481. },
  45482. displacementBias: {
  45483. type: 'f',
  45484. value: 0
  45485. }
  45486. },
  45487. roughnessmap: {
  45488. roughnessMap: {
  45489. type: 't',
  45490. value: null
  45491. }
  45492. },
  45493. metalnessmap: {
  45494. metalnessMap: {
  45495. type: 't',
  45496. value: null
  45497. }
  45498. },
  45499. fog: {
  45500. fogDensity: {
  45501. type: 'f',
  45502. value: 25e-5
  45503. },
  45504. fogNear: {
  45505. type: 'f',
  45506. value: 1
  45507. },
  45508. fogFar: {
  45509. type: 'f',
  45510. value: 2e3
  45511. },
  45512. fogColor: {
  45513. type: 'c',
  45514. value: new Ci.Color(16777215)
  45515. }
  45516. },
  45517. lights: {
  45518. ambientLightColor: {
  45519. type: 'fv',
  45520. value: []
  45521. },
  45522. directionalLights: {
  45523. type: 'sa',
  45524. value: [],
  45525. properties: {
  45526. direction: {
  45527. type: 'v3'
  45528. },
  45529. color: {
  45530. type: 'c'
  45531. },
  45532. shadow: {
  45533. type: 'i'
  45534. },
  45535. shadowBias: {
  45536. type: 'f'
  45537. },
  45538. shadowRadius: {
  45539. type: 'f'
  45540. },
  45541. shadowMapSize: {
  45542. type: 'v2'
  45543. }
  45544. }
  45545. },
  45546. directionalShadowMap: {
  45547. type: 'tv',
  45548. value: []
  45549. },
  45550. directionalShadowMatrix: {
  45551. type: 'm4v',
  45552. value: []
  45553. },
  45554. spotLights: {
  45555. type: 'sa',
  45556. value: [],
  45557. properties: {
  45558. color: {
  45559. type: 'c'
  45560. },
  45561. position: {
  45562. type: 'v3'
  45563. },
  45564. direction: {
  45565. type: 'v3'
  45566. },
  45567. distance: {
  45568. type: 'f'
  45569. },
  45570. coneCos: {
  45571. type: 'f'
  45572. },
  45573. penumbraCos: {
  45574. type: 'f'
  45575. },
  45576. decay: {
  45577. type: 'f'
  45578. },
  45579. shadow: {
  45580. type: 'i'
  45581. },
  45582. shadowBias: {
  45583. type: 'f'
  45584. },
  45585. shadowRadius: {
  45586. type: 'f'
  45587. },
  45588. shadowMapSize: {
  45589. type: 'v2'
  45590. }
  45591. }
  45592. },
  45593. spotShadowMap: {
  45594. type: 'tv',
  45595. value: []
  45596. },
  45597. spotShadowMatrix: {
  45598. type: 'm4v',
  45599. value: []
  45600. },
  45601. pointLights: {
  45602. type: 'sa',
  45603. value: [],
  45604. properties: {
  45605. color: {
  45606. type: 'c'
  45607. },
  45608. position: {
  45609. type: 'v3'
  45610. },
  45611. decay: {
  45612. type: 'f'
  45613. },
  45614. distance: {
  45615. type: 'f'
  45616. },
  45617. shadow: {
  45618. type: 'i'
  45619. },
  45620. shadowBias: {
  45621. type: 'f'
  45622. },
  45623. shadowRadius: {
  45624. type: 'f'
  45625. },
  45626. shadowMapSize: {
  45627. type: 'v2'
  45628. }
  45629. }
  45630. },
  45631. pointShadowMap: {
  45632. type: 'tv',
  45633. value: []
  45634. },
  45635. pointShadowMatrix: {
  45636. type: 'm4v',
  45637. value: []
  45638. },
  45639. hemisphereLights: {
  45640. type: 'sa',
  45641. value: [],
  45642. properties: {
  45643. direction: {
  45644. type: 'v3'
  45645. },
  45646. skyColor: {
  45647. type: 'c'
  45648. },
  45649. groundColor: {
  45650. type: 'c'
  45651. }
  45652. }
  45653. }
  45654. },
  45655. points: {
  45656. diffuse: {
  45657. type: 'c',
  45658. value: new Ci.Color(15658734)
  45659. },
  45660. opacity: {
  45661. type: 'f',
  45662. value: 1
  45663. },
  45664. size: {
  45665. type: 'f',
  45666. value: 1
  45667. },
  45668. scale: {
  45669. type: 'f',
  45670. value: 1
  45671. },
  45672. map: {
  45673. type: 't',
  45674. value: null
  45675. },
  45676. offsetRepeat: {
  45677. type: 'v4',
  45678. value: new Ci.Vector4(0, 0, 1, 1)
  45679. }
  45680. }
  45681. }),
  45682. (Ci.ShaderChunk.cube_frag =
  45683. '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'),
  45684. (Ci.ShaderChunk.cube_vert =
  45685. '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'),
  45686. (Ci.ShaderChunk.depth_frag =
  45687. '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'),
  45688. (Ci.ShaderChunk.depth_vert =
  45689. '#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'),
  45690. (Ci.ShaderChunk.depthRGBA_frag =
  45691. '#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'),
  45692. (Ci.ShaderChunk.depthRGBA_vert =
  45693. '#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'),
  45694. (Ci.ShaderChunk.distanceRGBA_frag =
  45695. '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'),
  45696. (Ci.ShaderChunk.distanceRGBA_vert =
  45697. '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'),
  45698. (Ci.ShaderChunk.equirect_frag =
  45699. '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'),
  45700. (Ci.ShaderChunk.equirect_vert =
  45701. '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'),
  45702. (Ci.ShaderChunk.linedashed_frag =
  45703. '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'),
  45704. (Ci.ShaderChunk.linedashed_vert =
  45705. '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'),
  45706. (Ci.ShaderChunk.meshbasic_frag =
  45707. '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'),
  45708. (Ci.ShaderChunk.meshbasic_vert =
  45709. '#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'),
  45710. (Ci.ShaderChunk.meshlambert_frag =
  45711. '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'),
  45712. (Ci.ShaderChunk.meshlambert_vert =
  45713. '#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'),
  45714. (Ci.ShaderChunk.meshphong_frag =
  45715. '#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'),
  45716. (Ci.ShaderChunk.meshphong_vert =
  45717. '#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'),
  45718. (Ci.ShaderChunk.meshstandard_frag =
  45719. '#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'),
  45720. (Ci.ShaderChunk.meshstandard_vert =
  45721. '#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'),
  45722. (Ci.ShaderChunk.normal_frag =
  45723. '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'),
  45724. (Ci.ShaderChunk.normal_vert =
  45725. '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'),
  45726. (Ci.ShaderChunk.points_frag =
  45727. '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'),
  45728. (Ci.ShaderChunk.points_vert =
  45729. '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'),
  45730. (Ci.ShaderLib = {
  45731. basic: {
  45732. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  45733. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  45734. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  45735. },
  45736. lambert: {
  45737. uniforms: Ci.UniformsUtils.merge([
  45738. Ci.UniformsLib.common,
  45739. Ci.UniformsLib.aomap,
  45740. Ci.UniformsLib.lightmap,
  45741. Ci.UniformsLib.emissivemap,
  45742. Ci.UniformsLib.fog,
  45743. Ci.UniformsLib.lights,
  45744. {
  45745. emissive: {
  45746. type: 'c',
  45747. value: new Ci.Color(0)
  45748. }
  45749. }
  45750. ]),
  45751. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  45752. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  45753. },
  45754. phong: {
  45755. uniforms: Ci.UniformsUtils.merge([
  45756. Ci.UniformsLib.common,
  45757. Ci.UniformsLib.aomap,
  45758. Ci.UniformsLib.lightmap,
  45759. Ci.UniformsLib.emissivemap,
  45760. Ci.UniformsLib.bumpmap,
  45761. Ci.UniformsLib.normalmap,
  45762. Ci.UniformsLib.displacementmap,
  45763. Ci.UniformsLib.fog,
  45764. Ci.UniformsLib.lights,
  45765. {
  45766. emissive: {
  45767. type: 'c',
  45768. value: new Ci.Color(0)
  45769. },
  45770. specular: {
  45771. type: 'c',
  45772. value: new Ci.Color(1118481)
  45773. },
  45774. shininess: {
  45775. type: 'f',
  45776. value: 30
  45777. }
  45778. }
  45779. ]),
  45780. vertexShader: Ci.ShaderChunk.meshphong_vert,
  45781. fragmentShader: Ci.ShaderChunk.meshphong_frag
  45782. },
  45783. standard: {
  45784. uniforms: Ci.UniformsUtils.merge([
  45785. Ci.UniformsLib.common,
  45786. Ci.UniformsLib.aomap,
  45787. Ci.UniformsLib.lightmap,
  45788. Ci.UniformsLib.emissivemap,
  45789. Ci.UniformsLib.bumpmap,
  45790. Ci.UniformsLib.normalmap,
  45791. Ci.UniformsLib.displacementmap,
  45792. Ci.UniformsLib.roughnessmap,
  45793. Ci.UniformsLib.metalnessmap,
  45794. Ci.UniformsLib.fog,
  45795. Ci.UniformsLib.lights,
  45796. {
  45797. emissive: {
  45798. type: 'c',
  45799. value: new Ci.Color(0)
  45800. },
  45801. roughness: {
  45802. type: 'f',
  45803. value: 0.5
  45804. },
  45805. metalness: {
  45806. type: 'f',
  45807. value: 0
  45808. },
  45809. envMapIntensity: {
  45810. type: 'f',
  45811. value: 1
  45812. }
  45813. }
  45814. ]),
  45815. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  45816. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  45817. },
  45818. points: {
  45819. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  45820. vertexShader: Ci.ShaderChunk.points_vert,
  45821. fragmentShader: Ci.ShaderChunk.points_frag
  45822. },
  45823. dashed: {
  45824. uniforms: Ci.UniformsUtils.merge([
  45825. Ci.UniformsLib.common,
  45826. Ci.UniformsLib.fog,
  45827. {
  45828. scale: {
  45829. type: 'f',
  45830. value: 1
  45831. },
  45832. dashSize: {
  45833. type: 'f',
  45834. value: 1
  45835. },
  45836. totalSize: {
  45837. type: 'f',
  45838. value: 2
  45839. }
  45840. }
  45841. ]),
  45842. vertexShader: Ci.ShaderChunk.linedashed_vert,
  45843. fragmentShader: Ci.ShaderChunk.linedashed_frag
  45844. },
  45845. depth: {
  45846. uniforms: {
  45847. mNear: {
  45848. type: 'f',
  45849. value: 1
  45850. },
  45851. mFar: {
  45852. type: 'f',
  45853. value: 2e3
  45854. },
  45855. opacity: {
  45856. type: 'f',
  45857. value: 1
  45858. }
  45859. },
  45860. vertexShader: Ci.ShaderChunk.depth_vert,
  45861. fragmentShader: Ci.ShaderChunk.depth_frag
  45862. },
  45863. normal: {
  45864. uniforms: {
  45865. opacity: {
  45866. type: 'f',
  45867. value: 1
  45868. }
  45869. },
  45870. vertexShader: Ci.ShaderChunk.normal_vert,
  45871. fragmentShader: Ci.ShaderChunk.normal_frag
  45872. },
  45873. cube: {
  45874. uniforms: {
  45875. tCube: {
  45876. type: 't',
  45877. value: null
  45878. },
  45879. tFlip: {
  45880. type: 'f',
  45881. value: -1
  45882. }
  45883. },
  45884. vertexShader: Ci.ShaderChunk.cube_vert,
  45885. fragmentShader: Ci.ShaderChunk.cube_frag
  45886. },
  45887. equirect: {
  45888. uniforms: {
  45889. tEquirect: {
  45890. type: 't',
  45891. value: null
  45892. },
  45893. tFlip: {
  45894. type: 'f',
  45895. value: -1
  45896. }
  45897. },
  45898. vertexShader: Ci.ShaderChunk.equirect_vert,
  45899. fragmentShader: Ci.ShaderChunk.equirect_frag
  45900. },
  45901. depthRGBA: {
  45902. uniforms: {},
  45903. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  45904. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  45905. },
  45906. distanceRGBA: {
  45907. uniforms: {
  45908. lightPos: {
  45909. type: 'v3',
  45910. value: new Ci.Vector3(0, 0, 0)
  45911. }
  45912. },
  45913. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  45914. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  45915. }
  45916. }),
  45917. (Ci.WebGLRenderer = function (e) {
  45918. function S() {
  45919. return null === Q ? he : 1
  45920. }
  45921. function i(e, t, i, n) {
  45922. !0 === V && ((e *= n), (t *= n), (i *= n)), _e.clearColor(e, t, i, n)
  45923. }
  45924. function t() {
  45925. _e.init(), _e.scissor(ie.copy(ue).multiplyScalar(he)), _e.viewport(re.copy(pe).multiplyScalar(he)), i(ae.r, ae.g, ae.b, se)
  45926. }
  45927. function n() {
  45928. ;(te = K = null), (ee = ''), ($ = -1), _e.reset()
  45929. }
  45930. function r(e) {
  45931. e.preventDefault(), n(), t(), be.clear()
  45932. }
  45933. function f(e) {
  45934. var t = e.target
  45935. t.removeEventListener('dispose', f),
  45936. (function (e) {
  45937. var t = be.get(e)
  45938. if (e.image && t.__image__webglTextureCube) X.deleteTexture(t.__image__webglTextureCube)
  45939. else {
  45940. if (void 0 === t.__webglInit) return
  45941. X.deleteTexture(t.__webglTexture)
  45942. }
  45943. be.delete(e)
  45944. })(t),
  45945. ye.textures--
  45946. }
  45947. function a(e) {
  45948. var t = e.target
  45949. t.removeEventListener('dispose', a),
  45950. (function (e) {
  45951. var t = be.get(e),
  45952. i = be.get(e.texture)
  45953. if (e && void 0 !== i.__webglTexture) {
  45954. if ((X.deleteTexture(i.__webglTexture), e instanceof Ci.WebGLRenderTargetCube))
  45955. for (var n = 0; n < 6; n++) X.deleteFramebuffer(t.__webglFramebuffer[n]), X.deleteRenderbuffer(t.__webglDepthbuffer[n])
  45956. else X.deleteFramebuffer(t.__webglFramebuffer), X.deleteRenderbuffer(t.__webglDepthbuffer)
  45957. be.delete(e.texture), be.delete(e)
  45958. }
  45959. })(t),
  45960. ye.textures--
  45961. }
  45962. function v(e) {
  45963. var t = e.target
  45964. t.removeEventListener('dispose', v),
  45965. (function (e) {
  45966. y(e), be.delete(e)
  45967. })(t)
  45968. }
  45969. function y(e) {
  45970. var t = be.get(e).program
  45971. ;(e.program = void 0) !== t && Te.releaseProgram(t)
  45972. }
  45973. function M(e, t) {
  45974. return Math.abs(t[0]) - Math.abs(e[0])
  45975. }
  45976. function s(e, t) {
  45977. return e.object.renderOrder !== t.object.renderOrder
  45978. ? e.object.renderOrder - t.object.renderOrder
  45979. : e.material.id !== t.material.id
  45980. ? e.material.id - t.material.id
  45981. : e.z !== t.z
  45982. ? e.z - t.z
  45983. : e.id - t.id
  45984. }
  45985. function l(e, t) {
  45986. 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
  45987. }
  45988. function d(e, t, i, n, r) {
  45989. var o, a
  45990. a = i.transparent ? ((o = G), ++W) : ((o = H), ++z)
  45991. var s = o[a]
  45992. void 0 !== s
  45993. ? ((s.id = e.id), (s.object = e), (s.geometry = t), (s.material = i), (s.z = me.z), (s.group = r))
  45994. : ((s = {
  45995. id: e.id,
  45996. object: e,
  45997. geometry: t,
  45998. material: i,
  45999. z: me.z,
  46000. group: r
  46001. }),
  46002. o.push(s))
  46003. }
  46004. function c(e, t, i, n) {
  46005. for (var r = 0, o = e.length; r < o; r++) {
  46006. var a = e[r],
  46007. s = a.object,
  46008. l = a.geometry,
  46009. c = void 0 === n ? a.material : n,
  46010. h = a.group
  46011. if ((s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld), s.normalMatrix.getNormalMatrix(s.modelViewMatrix), s instanceof Ci.ImmediateRenderObject)) {
  46012. R(c)
  46013. var u = P(t, i, c, s)
  46014. ;(ee = ''),
  46015. s.render(function (e) {
  46016. Z.renderBufferImmediate(e, u, c)
  46017. })
  46018. } else Z.renderBufferDirect(t, i, l, c, s, h)
  46019. }
  46020. }
  46021. function R(e) {
  46022. ;(function (e) {
  46023. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE), _e.setFlipSided(e.side === Ci.BackSide)
  46024. })(e),
  46025. !0 === e.transparent
  46026. ? _e.setBlending(e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha, e.premultipliedAlpha)
  46027. : _e.setBlending(Ci.NoBlending),
  46028. _e.setDepthFunc(e.depthFunc),
  46029. _e.setDepthTest(e.depthTest),
  46030. _e.setDepthWrite(e.depthWrite),
  46031. _e.setColorWrite(e.colorWrite),
  46032. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  46033. }
  46034. function P(e, t, i, n) {
  46035. oe = 0
  46036. var r = be.get(i)
  46037. void 0 === r.program && (i.needsUpdate = !0),
  46038. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  46039. i.needsUpdate &&
  46040. ((function (e, t, i) {
  46041. var n = be.get(e),
  46042. r = Te.getParameters(e, ve, t, i),
  46043. o = Te.getProgramCode(e, r),
  46044. a = n.program,
  46045. s = !0
  46046. if (void 0 === a) e.addEventListener('dispose', v)
  46047. else if (a.code !== o) y(e)
  46048. else {
  46049. if (void 0 !== r.shaderID) return
  46050. s = !1
  46051. }
  46052. if (s) {
  46053. if (r.shaderID) {
  46054. var l = Ci.ShaderLib[r.shaderID]
  46055. n.__webglShader = {
  46056. name: e.type,
  46057. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  46058. vertexShader: l.vertexShader,
  46059. fragmentShader: l.fragmentShader
  46060. }
  46061. } else
  46062. n.__webglShader = {
  46063. name: e.type,
  46064. uniforms: e.uniforms,
  46065. vertexShader: e.vertexShader,
  46066. fragmentShader: e.fragmentShader
  46067. }
  46068. ;(e.__webglShader = n.__webglShader), (a = Te.acquireProgram(e, r, o)), (n.program = a), (e.program = a)
  46069. }
  46070. var c = a.getAttributes()
  46071. if (e.morphTargets) for (var h = (e.numSupportedMorphTargets = 0); h < Z.maxMorphTargets; h++) 0 <= c['morphTarget' + h] && e.numSupportedMorphTargets++
  46072. if (e.morphNormals) for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++) 0 <= c['morphNormal' + h] && e.numSupportedMorphNormals++
  46073. n.uniformsList = []
  46074. var u = n.__webglShader.uniforms,
  46075. d = n.program.getUniforms()
  46076. for (var p in u) {
  46077. var f = d[p]
  46078. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  46079. }
  46080. ;(e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) &&
  46081. ((n.lightsHash = ve.hash),
  46082. (u.ambientLightColor.value = ve.ambient),
  46083. (u.directionalLights.value = ve.directional),
  46084. (u.spotLights.value = ve.spot),
  46085. (u.pointLights.value = ve.point),
  46086. (u.hemisphereLights.value = ve.hemi),
  46087. (u.directionalShadowMap.value = ve.directionalShadowMap),
  46088. (u.directionalShadowMatrix.value = ve.directionalShadowMatrix),
  46089. (u.spotShadowMap.value = ve.spotShadowMap),
  46090. (u.spotShadowMatrix.value = ve.spotShadowMatrix),
  46091. (u.pointShadowMap.value = ve.pointShadowMap),
  46092. (u.pointShadowMatrix.value = ve.pointShadowMatrix)),
  46093. (n.hasDynamicUniforms = !1)
  46094. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  46095. if (!0 === n.uniformsList[g][0].dynamic) {
  46096. n.hasDynamicUniforms = !0
  46097. break
  46098. }
  46099. }
  46100. })(i, t, n),
  46101. (i.needsUpdate = !1))
  46102. var o = !1,
  46103. a = !1,
  46104. s = !1,
  46105. l = r.program,
  46106. c = l.getUniforms(),
  46107. h = r.__webglShader.uniforms
  46108. if (
  46109. (l.id !== K && (X.useProgram(l.program), (K = l.id), (s = a = o = !0)),
  46110. i.id !== $ && (($ = i.id), (a = !0)),
  46111. (!o && e === te) ||
  46112. (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  46113. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  46114. e !== te && ((te = e), (s = a = !0)),
  46115. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) &&
  46116. void 0 !== c.cameraPosition &&
  46117. (me.setFromMatrixPosition(e.matrixWorld), X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  46118. (i instanceof Ci.MeshPhongMaterial ||
  46119. i instanceof Ci.MeshLambertMaterial ||
  46120. i instanceof Ci.MeshBasicMaterial ||
  46121. i instanceof Ci.MeshStandardMaterial ||
  46122. i instanceof Ci.ShaderMaterial ||
  46123. i.skinning) &&
  46124. void 0 !== c.viewMatrix &&
  46125. X.uniformMatrix4fv(c.viewMatrix, !1, e.matrixWorldInverse.elements),
  46126. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  46127. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  46128. i.skinning)
  46129. )
  46130. if (
  46131. (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  46132. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  46133. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture)
  46134. ) {
  46135. if (void 0 !== c.boneTexture) {
  46136. var u = A()
  46137. X.uniform1i(c.boneTexture, u), Z.setTexture(n.skeleton.boneTexture, u)
  46138. }
  46139. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  46140. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  46141. } else n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices)
  46142. return (
  46143. a &&
  46144. ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) &&
  46145. (function (e, t) {
  46146. ;(e.ambientLightColor.needsUpdate = t),
  46147. (e.directionalLights.needsUpdate = t),
  46148. (e.pointLights.needsUpdate = t),
  46149. (e.spotLights.needsUpdate = t),
  46150. (e.hemisphereLights.needsUpdate = t)
  46151. })(h, s),
  46152. t &&
  46153. i.fog &&
  46154. (function (e, t) {
  46155. ;(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)
  46156. })(h, t),
  46157. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) &&
  46158. (function (e, t) {
  46159. var i
  46160. if (
  46161. ((e.opacity.value = t.opacity),
  46162. (e.diffuse.value = t.color),
  46163. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  46164. (e.map.value = t.map),
  46165. (e.specularMap.value = t.specularMap),
  46166. (e.alphaMap.value = t.alphaMap),
  46167. t.aoMap && ((e.aoMap.value = t.aoMap), (e.aoMapIntensity.value = t.aoMapIntensity)),
  46168. t.map
  46169. ? (i = t.map)
  46170. : t.specularMap
  46171. ? (i = t.specularMap)
  46172. : t.displacementMap
  46173. ? (i = t.displacementMap)
  46174. : t.normalMap
  46175. ? (i = t.normalMap)
  46176. : t.bumpMap
  46177. ? (i = t.bumpMap)
  46178. : t.roughnessMap
  46179. ? (i = t.roughnessMap)
  46180. : t.metalnessMap
  46181. ? (i = t.metalnessMap)
  46182. : t.alphaMap
  46183. ? (i = t.alphaMap)
  46184. : t.emissiveMap && (i = t.emissiveMap),
  46185. void 0 !== i)
  46186. ) {
  46187. i instanceof Ci.WebGLRenderTarget && (i = i.texture)
  46188. var n = i.offset,
  46189. r = i.repeat
  46190. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  46191. }
  46192. ;(e.envMap.value = t.envMap),
  46193. (e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1),
  46194. (e.reflectivity.value = t.reflectivity),
  46195. (e.refractionRatio.value = t.refractionRatio)
  46196. })(h, i),
  46197. i instanceof Ci.LineBasicMaterial
  46198. ? p(h, i)
  46199. : i instanceof Ci.LineDashedMaterial
  46200. ? (p(h, i),
  46201. (function (e, t) {
  46202. ;(e.dashSize.value = t.dashSize), (e.totalSize.value = t.dashSize + t.gapSize), (e.scale.value = t.scale)
  46203. })(h, i))
  46204. : i instanceof Ci.PointsMaterial
  46205. ? (function (e, t) {
  46206. 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)) {
  46207. var i = t.map.offset,
  46208. n = t.map.repeat
  46209. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  46210. }
  46211. })(h, i)
  46212. : i instanceof Ci.MeshLambertMaterial
  46213. ? (function (e, t) {
  46214. t.lightMap && ((e.lightMap.value = t.lightMap), (e.lightMapIntensity.value = t.lightMapIntensity)), t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  46215. })(h, i)
  46216. : i instanceof Ci.MeshPhongMaterial
  46217. ? (function (e, t) {
  46218. ;(e.specular.value = t.specular),
  46219. (e.shininess.value = Math.max(t.shininess, 1e-4)),
  46220. t.lightMap && ((e.lightMap.value = t.lightMap), (e.lightMapIntensity.value = t.lightMapIntensity)),
  46221. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  46222. t.bumpMap && ((e.bumpMap.value = t.bumpMap), (e.bumpScale.value = t.bumpScale)),
  46223. t.normalMap && ((e.normalMap.value = t.normalMap), e.normalScale.value.copy(t.normalScale)),
  46224. t.displacementMap && ((e.displacementMap.value = t.displacementMap), (e.displacementScale.value = t.displacementScale), (e.displacementBias.value = t.displacementBias))
  46225. })(h, i)
  46226. : i instanceof Ci.MeshStandardMaterial
  46227. ? (function (e, t) {
  46228. ;(e.roughness.value = t.roughness),
  46229. (e.metalness.value = t.metalness),
  46230. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  46231. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  46232. t.lightMap && ((e.lightMap.value = t.lightMap), (e.lightMapIntensity.value = t.lightMapIntensity)),
  46233. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  46234. t.bumpMap && ((e.bumpMap.value = t.bumpMap), (e.bumpScale.value = t.bumpScale)),
  46235. t.normalMap && ((e.normalMap.value = t.normalMap), e.normalScale.value.copy(t.normalScale)),
  46236. t.displacementMap && ((e.displacementMap.value = t.displacementMap), (e.displacementScale.value = t.displacementScale), (e.displacementBias.value = t.displacementBias)),
  46237. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  46238. })(h, i)
  46239. : i instanceof Ci.MeshDepthMaterial
  46240. ? ((h.mNear.value = e.near), (h.mFar.value = e.far), (h.opacity.value = i.opacity))
  46241. : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  46242. g(r.uniformsList)),
  46243. (function (e, t) {
  46244. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements), e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  46245. })(c, n),
  46246. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  46247. !0 === r.hasDynamicUniforms &&
  46248. (function (e, t, i) {
  46249. for (var n = [], r = 0, o = e.length; r < o; r++) {
  46250. var a = e[r][0],
  46251. s = a.onUpdateCallback
  46252. void 0 !== s && (s.bind(a)(t, i), n.push(e[r]))
  46253. }
  46254. g(n)
  46255. })(r.uniformsList, n, e),
  46256. l
  46257. )
  46258. }
  46259. function p(e, t) {
  46260. ;(e.diffuse.value = t.color), (e.opacity.value = t.opacity)
  46261. }
  46262. function A() {
  46263. var e = oe
  46264. return e >= Ee.maxTextures && console.warn('WebGLRenderer: trying to use ' + e + ' texture units while this GPU supports only ' + Ee.maxTextures), (oe += 1), e
  46265. }
  46266. function C(e, t, i, n) {
  46267. var r, o
  46268. if ('1i' === t) X.uniform1i(i, n)
  46269. else if ('1f' === t) X.uniform1f(i, n)
  46270. else if ('2f' === t) X.uniform2f(i, n[0], n[1])
  46271. else if ('3f' === t) X.uniform3f(i, n[0], n[1], n[2])
  46272. else if ('4f' === t) X.uniform4f(i, n[0], n[1], n[2], n[3])
  46273. else if ('1iv' === t) X.uniform1iv(i, n)
  46274. else if ('3iv' === t) X.uniform3iv(i, n)
  46275. else if ('1fv' === t) X.uniform1fv(i, n)
  46276. else if ('2fv' === t) X.uniform2fv(i, n)
  46277. else if ('3fv' === t) X.uniform3fv(i, n)
  46278. else if ('4fv' === t) X.uniform4fv(i, n)
  46279. else if ('Matrix2fv' === t) X.uniformMatrix2fv(i, !1, n)
  46280. else if ('Matrix3fv' === t) X.uniformMatrix3fv(i, !1, n)
  46281. else if ('Matrix4fv' === t) X.uniformMatrix4fv(i, !1, n)
  46282. else if ('i' === t) X.uniform1i(i, n)
  46283. else if ('f' === t) X.uniform1f(i, n)
  46284. else if ('v2' === t) X.uniform2f(i, n.x, n.y)
  46285. else if ('v3' === t) X.uniform3f(i, n.x, n.y, n.z)
  46286. else if ('v4' === t) X.uniform4f(i, n.x, n.y, n.z, n.w)
  46287. else if ('c' === t) X.uniform3f(i, n.r, n.g, n.b)
  46288. else if ('s' === t) {
  46289. var a = e.properties
  46290. for (var s in a) {
  46291. var l = a[s],
  46292. c = i[s],
  46293. h = n[s]
  46294. C(l, l.type, c, h)
  46295. }
  46296. } else if ('sa' === t) {
  46297. a = e.properties
  46298. for (var u = 0, d = n.length; u < d; u++)
  46299. for (var s in a) {
  46300. ;(l = a[s]), (c = i[u][s]), (h = n[u][s])
  46301. C(l, l.type, c, h)
  46302. }
  46303. } else if ('iv1' === t) X.uniform1iv(i, n)
  46304. else if ('iv' === t) X.uniform3iv(i, n)
  46305. else if ('fv1' === t) X.uniform1fv(i, n)
  46306. else if ('fv' === t) X.uniform3fv(i, n)
  46307. else if ('v2v' === t) {
  46308. void 0 === e._array && (e._array = new Float32Array(2 * n.length))
  46309. u = 0
  46310. 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)
  46311. X.uniform2fv(i, e._array)
  46312. } else if ('v3v' === t) {
  46313. void 0 === e._array && (e._array = new Float32Array(3 * n.length))
  46314. u = 0
  46315. var g = 0
  46316. 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)
  46317. X.uniform3fv(i, e._array)
  46318. } else if ('v4v' === t) {
  46319. void 0 === e._array && (e._array = new Float32Array(4 * n.length))
  46320. u = 0
  46321. var m = 0
  46322. 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)
  46323. X.uniform4fv(i, e._array)
  46324. } else if ('m2' === t) X.uniformMatrix2fv(i, !1, n.elements)
  46325. else if ('m3' === t) X.uniformMatrix3fv(i, !1, n.elements)
  46326. else if ('m3v' === t) {
  46327. void 0 === e._array && (e._array = new Float32Array(9 * n.length))
  46328. for (u = 0, f = n.length; u < f; u++) n[u].flattenToArrayOffset(e._array, 9 * u)
  46329. X.uniformMatrix3fv(i, !1, e._array)
  46330. } else if ('m4' === t) X.uniformMatrix4fv(i, !1, n.elements)
  46331. else if ('m4v' === t) {
  46332. void 0 === e._array && (e._array = new Float32Array(16 * n.length))
  46333. for (u = 0, f = n.length; u < f; u++) n[u].flattenToArrayOffset(e._array, 16 * u)
  46334. X.uniformMatrix4fv(i, !1, e._array)
  46335. } else if ('t' === t) {
  46336. if (((r = n), (o = A()), X.uniform1i(i, o), !r)) return
  46337. r instanceof Ci.CubeTexture || (Array.isArray(r.image) && 6 === r.image.length)
  46338. ? _(r, o)
  46339. : r instanceof Ci.WebGLRenderTargetCube
  46340. ? b(r.texture, o)
  46341. : r instanceof Ci.WebGLRenderTarget
  46342. ? Z.setTexture(r.texture, o)
  46343. : Z.setTexture(r, o)
  46344. } else if ('tv' === t) {
  46345. void 0 === e._array && (e._array = [])
  46346. for (u = 0, f = e.value.length; u < f; u++) e._array[u] = A()
  46347. X.uniform1iv(i, e._array)
  46348. for (u = 0, f = e.value.length; u < f; u++)
  46349. (r = e.value[u]),
  46350. (o = e._array[u]),
  46351. r &&
  46352. (r instanceof Ci.CubeTexture || (r.image instanceof Array && 6 === r.image.length)
  46353. ? _(r, o)
  46354. : r instanceof Ci.WebGLRenderTarget
  46355. ? Z.setTexture(r.texture, o)
  46356. : r instanceof Ci.WebGLRenderTargetCube
  46357. ? b(r.texture, o)
  46358. : Z.setTexture(r, o))
  46359. } else console.warn('THREE.WebGLRenderer: Unknown uniform type: ' + t)
  46360. }
  46361. function g(e) {
  46362. for (var t = 0, i = e.length; t < i; t++) {
  46363. var n = e[t][0]
  46364. if (!1 !== n.needsUpdate) C(n, n.type, e[t][1], n.value)
  46365. }
  46366. }
  46367. function m(e, t, i) {
  46368. var n
  46369. if (
  46370. (i
  46371. ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  46372. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  46373. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  46374. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter)))
  46375. : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  46376. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  46377. (t.wrapS === Ci.ClampToEdgeWrapping && t.wrapT === Ci.ClampToEdgeWrapping) ||
  46378. console.warn('THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.', t),
  46379. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  46380. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  46381. t.minFilter !== Ci.NearestFilter &&
  46382. t.minFilter !== Ci.LinearFilter &&
  46383. console.warn('THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.', t)),
  46384. (n = Ie.get('EXT_texture_filter_anisotropic')))
  46385. ) {
  46386. if (t.type === Ci.FloatType && null === Ie.get('OES_texture_float_linear')) return
  46387. if (t.type === Ci.HalfFloatType && null === Ie.get('OES_texture_half_float_linear')) return
  46388. ;(1 < t.anisotropy || be.get(t).__currentAnisotropy) &&
  46389. (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())), (be.get(t).__currentAnisotropy = t.anisotropy))
  46390. }
  46391. }
  46392. function o(e, t, i) {
  46393. void 0 === e.__webglInit && ((e.__webglInit = !0), t.addEventListener('dispose', f), (e.__webglTexture = X.createTexture()), ye.textures++),
  46394. _e.activeTexture(X.TEXTURE0 + i),
  46395. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  46396. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  46397. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  46398. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment)
  46399. var n = I(t.image, Ee.maxTextureSize)
  46400. !(function (e) {
  46401. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || (e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter)
  46402. })(t) ||
  46403. !1 !== E(n) ||
  46404. (n = (function (e) {
  46405. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  46406. var t = document.createElement('canvas')
  46407. return (
  46408. (t.width = Ci.Math.nearestPowerOfTwo(e.width)),
  46409. (t.height = Ci.Math.nearestPowerOfTwo(e.height)),
  46410. t.getContext('2d').drawImage(e, 0, 0, t.width, t.height),
  46411. console.warn('THREE.WebGLRenderer: image is not power of two (' + e.width + 'x' + e.height + '). Resized to ' + t.width + 'x' + t.height, e),
  46412. t
  46413. )
  46414. }
  46415. return e
  46416. })(n))
  46417. var r = E(n),
  46418. o = x(t.format),
  46419. a = x(t.type)
  46420. m(X.TEXTURE_2D, t, r)
  46421. var s,
  46422. l = t.mipmaps
  46423. if (t instanceof Ci.DataTexture)
  46424. if (0 < l.length && r) {
  46425. 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)
  46426. t.generateMipmaps = !1
  46427. } else _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data)
  46428. else if (t instanceof Ci.CompressedTexture)
  46429. for (c = 0, h = l.length; c < h; c++)
  46430. (s = l[c]),
  46431. t.format !== Ci.RGBAFormat && t.format !== Ci.RGBFormat
  46432. ? -1 < _e.getCompressedTextureFormats().indexOf(o)
  46433. ? _e.compressedTexImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, s.data)
  46434. : console.warn('THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()')
  46435. : _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data)
  46436. else if (0 < l.length && r) {
  46437. for (c = 0, h = l.length; c < h; c++) (s = l[c]), _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s)
  46438. t.generateMipmaps = !1
  46439. } else _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n)
  46440. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D), (e.__version = t.version), t.onUpdate && t.onUpdate(t)
  46441. }
  46442. function I(e, t) {
  46443. if (e.width > t || e.height > t) {
  46444. var i = t / Math.max(e.width, e.height),
  46445. n = document.createElement('canvas')
  46446. return (
  46447. (n.width = Math.floor(e.width * i)),
  46448. (n.height = Math.floor(e.height * i)),
  46449. n.getContext('2d').drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  46450. console.warn('THREE.WebGLRenderer: image is too big (' + e.width + 'x' + e.height + '). Resized to ' + n.width + 'x' + n.height, e),
  46451. n
  46452. )
  46453. }
  46454. return e
  46455. }
  46456. function E(e) {
  46457. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  46458. }
  46459. function _(e, t) {
  46460. var i = be.get(e)
  46461. if (6 === e.image.length)
  46462. if (0 < e.version && i.__version !== e.version) {
  46463. i.__image__webglTextureCube || (e.addEventListener('dispose', f), (i.__image__webglTextureCube = X.createTexture()), ye.textures++),
  46464. _e.activeTexture(X.TEXTURE0 + t),
  46465. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  46466. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY)
  46467. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0] instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  46468. !Z.autoScaleCubemaps || n || r ? (o[a] = r ? e.image[a].image : e.image[a]) : (o[a] = I(e.image[a], Ee.maxCubemapSize))
  46469. var s = E(o[0]),
  46470. l = x(e.format),
  46471. c = x(e.type)
  46472. m(X.TEXTURE_CUBE_MAP, e, s)
  46473. for (a = 0; a < 6; a++)
  46474. if (n)
  46475. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  46476. (h = u[d]),
  46477. e.format !== Ci.RGBAFormat && e.format !== Ci.RGBFormat
  46478. ? -1 < _e.getCompressedTextureFormats().indexOf(l)
  46479. ? _e.compressedTexImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, d, l, h.width, h.height, 0, h.data)
  46480. : console.warn('THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()')
  46481. : _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, d, l, h.width, h.height, 0, l, c, h.data)
  46482. 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])
  46483. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP), (i.__version = e.version), e.onUpdate && e.onUpdate(e)
  46484. } else _e.activeTexture(X.TEXTURE0 + t), _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  46485. }
  46486. function b(e, t) {
  46487. _e.activeTexture(X.TEXTURE0 + t), _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  46488. }
  46489. function h(e, t, i, n) {
  46490. var r = x(t.texture.format),
  46491. o = x(t.texture.type)
  46492. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  46493. X.bindFramebuffer(X.FRAMEBUFFER, e),
  46494. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  46495. X.bindFramebuffer(X.FRAMEBUFFER, null)
  46496. }
  46497. function u(e, t) {
  46498. X.bindRenderbuffer(X.RENDERBUFFER, e),
  46499. t.depthBuffer && !t.stencilBuffer
  46500. ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height), X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_ATTACHMENT, X.RENDERBUFFER, e))
  46501. : t.depthBuffer && t.stencilBuffer
  46502. ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_STENCIL, t.width, t.height), X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e))
  46503. : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  46504. X.bindRenderbuffer(X.RENDERBUFFER, null)
  46505. }
  46506. function w(e) {
  46507. var t = be.get(e),
  46508. i = be.get(e.texture)
  46509. e.addEventListener('dispose', a), (i.__webglTexture = X.createTexture()), ye.textures++
  46510. var n = e instanceof Ci.WebGLRenderTargetCube,
  46511. r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  46512. if (n) {
  46513. t.__webglFramebuffer = []
  46514. for (var o = 0; o < 6; o++) t.__webglFramebuffer[o] = X.createFramebuffer()
  46515. } else t.__webglFramebuffer = X.createFramebuffer()
  46516. if (n) {
  46517. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture), m(X.TEXTURE_CUBE_MAP, e.texture, r)
  46518. for (o = 0; o < 6; o++) h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o)
  46519. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP), _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  46520. } else
  46521. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  46522. m(X.TEXTURE_2D, e.texture, r),
  46523. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  46524. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  46525. _e.bindTexture(X.TEXTURE_2D, null)
  46526. e.depthBuffer &&
  46527. (function (e) {
  46528. var t = be.get(e)
  46529. if (e instanceof Ci.WebGLRenderTargetCube) {
  46530. t.__webglDepthbuffer = []
  46531. for (var i = 0; i < 6; i++) X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]), (t.__webglDepthbuffer[i] = X.createRenderbuffer()), u(t.__webglDepthbuffer[i], e)
  46532. } else X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer), (t.__webglDepthbuffer = X.createRenderbuffer()), u(t.__webglDepthbuffer, e)
  46533. X.bindFramebuffer(X.FRAMEBUFFER, null)
  46534. })(e)
  46535. }
  46536. function T(e) {
  46537. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  46538. }
  46539. function x(e) {
  46540. var t
  46541. if (e === Ci.RepeatWrapping) return X.REPEAT
  46542. if (e === Ci.ClampToEdgeWrapping) return X.CLAMP_TO_EDGE
  46543. if (e === Ci.MirroredRepeatWrapping) return X.MIRRORED_REPEAT
  46544. if (e === Ci.NearestFilter) return X.NEAREST
  46545. if (e === Ci.NearestMipMapNearestFilter) return X.NEAREST_MIPMAP_NEAREST
  46546. if (e === Ci.NearestMipMapLinearFilter) return X.NEAREST_MIPMAP_LINEAR
  46547. if (e === Ci.LinearFilter) return X.LINEAR
  46548. if (e === Ci.LinearMipMapNearestFilter) return X.LINEAR_MIPMAP_NEAREST
  46549. if (e === Ci.LinearMipMapLinearFilter) return X.LINEAR_MIPMAP_LINEAR
  46550. if (e === Ci.UnsignedByteType) return X.UNSIGNED_BYTE
  46551. if (e === Ci.UnsignedShort4444Type) return X.UNSIGNED_SHORT_4_4_4_4
  46552. if (e === Ci.UnsignedShort5551Type) return X.UNSIGNED_SHORT_5_5_5_1
  46553. if (e === Ci.UnsignedShort565Type) return X.UNSIGNED_SHORT_5_6_5
  46554. if (e === Ci.ByteType) return X.BYTE
  46555. if (e === Ci.ShortType) return X.SHORT
  46556. if (e === Ci.UnsignedShortType) return X.UNSIGNED_SHORT
  46557. if (e === Ci.IntType) return X.INT
  46558. if (e === Ci.UnsignedIntType) return X.UNSIGNED_INT
  46559. if (e === Ci.FloatType) return X.FLOAT
  46560. if (null !== (t = Ie.get('OES_texture_half_float')) && e === Ci.HalfFloatType) return t.HALF_FLOAT_OES
  46561. if (e === Ci.AlphaFormat) return X.ALPHA
  46562. if (e === Ci.RGBFormat) return X.RGB
  46563. if (e === Ci.RGBAFormat) return X.RGBA
  46564. if (e === Ci.LuminanceFormat) return X.LUMINANCE
  46565. if (e === Ci.LuminanceAlphaFormat) return X.LUMINANCE_ALPHA
  46566. if (e === Ci.AddEquation) return X.FUNC_ADD
  46567. if (e === Ci.SubtractEquation) return X.FUNC_SUBTRACT
  46568. if (e === Ci.ReverseSubtractEquation) return X.FUNC_REVERSE_SUBTRACT
  46569. if (e === Ci.ZeroFactor) return X.ZERO
  46570. if (e === Ci.OneFactor) return X.ONE
  46571. if (e === Ci.SrcColorFactor) return X.SRC_COLOR
  46572. if (e === Ci.OneMinusSrcColorFactor) return X.ONE_MINUS_SRC_COLOR
  46573. if (e === Ci.SrcAlphaFactor) return X.SRC_ALPHA
  46574. if (e === Ci.OneMinusSrcAlphaFactor) return X.ONE_MINUS_SRC_ALPHA
  46575. if (e === Ci.DstAlphaFactor) return X.DST_ALPHA
  46576. if (e === Ci.OneMinusDstAlphaFactor) return X.ONE_MINUS_DST_ALPHA
  46577. if (e === Ci.DstColorFactor) return X.DST_COLOR
  46578. if (e === Ci.OneMinusDstColorFactor) return X.ONE_MINUS_DST_COLOR
  46579. if (e === Ci.SrcAlphaSaturateFactor) return X.SRC_ALPHA_SATURATE
  46580. if (null !== (t = Ie.get('WEBGL_compressed_texture_s3tc'))) {
  46581. if (e === Ci.RGB_S3TC_DXT1_Format) return t.COMPRESSED_RGB_S3TC_DXT1_EXT
  46582. if (e === Ci.RGBA_S3TC_DXT1_Format) return t.COMPRESSED_RGBA_S3TC_DXT1_EXT
  46583. if (e === Ci.RGBA_S3TC_DXT3_Format) return t.COMPRESSED_RGBA_S3TC_DXT3_EXT
  46584. if (e === Ci.RGBA_S3TC_DXT5_Format) return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  46585. }
  46586. if (null !== (t = Ie.get('WEBGL_compressed_texture_pvrtc'))) {
  46587. if (e === Ci.RGB_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG
  46588. if (e === Ci.RGB_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG
  46589. if (e === Ci.RGBA_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
  46590. if (e === Ci.RGBA_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  46591. }
  46592. if (null !== (t = Ie.get('WEBGL_compressed_texture_etc1')) && e === Ci.RGB_ETC1_Format) return t.COMPRESSED_RGB_ETC1_WEBGL
  46593. if (null !== (t = Ie.get('EXT_blend_minmax'))) {
  46594. if (e === Ci.MinEquation) return t.MIN_EXT
  46595. if (e === Ci.MaxEquation) return t.MAX_EXT
  46596. }
  46597. return 0
  46598. }
  46599. console.log('THREE.WebGLRenderer', Ci.REVISION)
  46600. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement('canvas'),
  46601. L = void 0 !== e.context ? e.context : null,
  46602. D = void 0 !== e.alpha && e.alpha,
  46603. N = void 0 === e.depth || e.depth,
  46604. F = void 0 === e.stencil || e.stencil,
  46605. B = void 0 !== e.antialias && e.antialias,
  46606. V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha,
  46607. k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer,
  46608. U = [],
  46609. H = [],
  46610. z = -1,
  46611. G = [],
  46612. W = -1,
  46613. j = new Float32Array(8),
  46614. Y = [],
  46615. q = []
  46616. ;(this.domElement = O),
  46617. (this.context = null),
  46618. (this.autoClear = !0),
  46619. (this.autoClearColor = !0),
  46620. (this.autoClearDepth = !0),
  46621. (this.autoClearStencil = !0),
  46622. (this.sortObjects = !0),
  46623. (this.gammaFactor = 2),
  46624. (this.gammaInput = !1),
  46625. (this.gammaOutput = !1),
  46626. (this.physicallyCorrectLights = !1),
  46627. (this.toneMapping = Ci.LinearToneMapping),
  46628. (this.toneMappingExposure = 1),
  46629. (this.toneMappingWhitePoint = 1),
  46630. (this.maxMorphTargets = 8),
  46631. (this.maxMorphNormals = 4),
  46632. (this.autoScaleCubemaps = !0)
  46633. var X,
  46634. Z = this,
  46635. K = null,
  46636. Q = null,
  46637. J = null,
  46638. $ = -1,
  46639. ee = '',
  46640. te = null,
  46641. ie = new Ci.Vector4(),
  46642. ne = null,
  46643. re = new Ci.Vector4(),
  46644. oe = 0,
  46645. ae = new Ci.Color(0),
  46646. se = 0,
  46647. le = O.width,
  46648. ce = O.height,
  46649. he = 1,
  46650. ue = new Ci.Vector4(0, 0, le, ce),
  46651. de = !1,
  46652. pe = new Ci.Vector4(0, 0, le, ce),
  46653. fe = new Ci.Frustum(),
  46654. ge = new Ci.Matrix4(),
  46655. me = new Ci.Vector3(),
  46656. ve = {
  46657. hash: '',
  46658. ambient: [0, 0, 0],
  46659. directional: [],
  46660. directionalShadowMap: [],
  46661. directionalShadowMatrix: [],
  46662. spot: [],
  46663. spotShadowMap: [],
  46664. spotShadowMatrix: [],
  46665. point: [],
  46666. pointShadowMap: [],
  46667. pointShadowMatrix: [],
  46668. hemi: [],
  46669. shadows: [],
  46670. shadowsPointLight: 0
  46671. },
  46672. ye = {
  46673. geometries: 0,
  46674. textures: 0
  46675. },
  46676. Ae = {
  46677. calls: 0,
  46678. vertices: 0,
  46679. faces: 0,
  46680. points: 0
  46681. }
  46682. this.info = {
  46683. render: Ae,
  46684. memory: ye,
  46685. programs: null
  46686. }
  46687. try {
  46688. var Ce = {
  46689. alpha: D,
  46690. depth: N,
  46691. stencil: F,
  46692. antialias: B,
  46693. premultipliedAlpha: V,
  46694. preserveDrawingBuffer: k
  46695. }
  46696. if (null === (X = L || O.getContext('webgl', Ce) || O.getContext('experimental-webgl', Ce)))
  46697. throw null !== O.getContext('webgl') ? 'Error creating WebGL context with your selected attributes.' : 'Error creating WebGL context.'
  46698. void 0 === X.getShaderPrecisionFormat &&
  46699. (X.getShaderPrecisionFormat = function () {
  46700. return {
  46701. rangeMin: 1,
  46702. rangeMax: 1,
  46703. precision: 1
  46704. }
  46705. }),
  46706. O.addEventListener('webglcontextlost', r, !1)
  46707. } catch (e) {
  46708. console.error('THREE.WebGLRenderer: ' + e)
  46709. }
  46710. var Ie = new Ci.WebGLExtensions(X)
  46711. Ie.get('OES_texture_float'),
  46712. Ie.get('OES_texture_float_linear'),
  46713. Ie.get('OES_texture_half_float'),
  46714. Ie.get('OES_texture_half_float_linear'),
  46715. Ie.get('OES_standard_derivatives'),
  46716. Ie.get('ANGLE_instanced_arrays'),
  46717. Ie.get('OES_element_index_uint') && (Ci.BufferGeometry.MaxIndex = 4294967296)
  46718. var Ee = new Ci.WebGLCapabilities(X, Ie, e),
  46719. _e = new Ci.WebGLState(X, Ie, x),
  46720. be = new Ci.WebGLProperties(),
  46721. we = new Ci.WebGLObjects(X, be, this.info),
  46722. Te = new Ci.WebGLPrograms(this, Ee),
  46723. xe = new Ci.WebGLLights()
  46724. this.info.programs = Te.programs
  46725. var Se = new Ci.WebGLBufferRenderer(X, Ie, Ae),
  46726. Me = new Ci.WebGLIndexedBufferRenderer(X, Ie, Ae)
  46727. t(), (this.context = X), (this.capabilities = Ee), (this.extensions = Ie), (this.properties = be), (this.state = _e)
  46728. var Re = new Ci.WebGLShadowMap(this, ve, we)
  46729. this.shadowMap = Re
  46730. var Pe,
  46731. Oe = new Ci.SpritePlugin(this, Y),
  46732. Le = new Ci.LensFlarePlugin(this, q)
  46733. ;(this.getContext = function () {
  46734. return X
  46735. }),
  46736. (this.getContextAttributes = function () {
  46737. return X.getContextAttributes()
  46738. }),
  46739. (this.forceContextLoss = function () {
  46740. Ie.get('WEBGL_lose_context').loseContext()
  46741. }),
  46742. (this.getMaxAnisotropy = function () {
  46743. if (void 0 !== Pe) return Pe
  46744. var e = Ie.get('EXT_texture_filter_anisotropic')
  46745. return (Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0)
  46746. }),
  46747. (this.getPrecision = function () {
  46748. return Ee.precision
  46749. }),
  46750. (this.getPixelRatio = function () {
  46751. return he
  46752. }),
  46753. (this.setPixelRatio = function (e) {
  46754. void 0 !== e && ((he = e), this.setSize(pe.z, pe.w, !1))
  46755. }),
  46756. (this.getSize = function () {
  46757. return {
  46758. width: le,
  46759. height: ce
  46760. }
  46761. }),
  46762. (this.setSize = function (e, t, i, n) {
  46763. null != n && (he = n),
  46764. (le = e),
  46765. (ce = t),
  46766. (O.width = e * he),
  46767. (O.height = t * he),
  46768. !1 !== i && ((O.style.width = e + 'px'), (O.style.height = t + 'px')),
  46769. this.setViewport(0, 0, e, t)
  46770. }),
  46771. (this.setViewport = function (e, t, i, n) {
  46772. _e.viewport(pe.set(e, t, i, n))
  46773. }),
  46774. (this.setScissor = function (e, t, i, n) {
  46775. _e.scissor(ue.set(e, t, i, n))
  46776. }),
  46777. (this.setScissorTest = function (e) {
  46778. _e.setScissorTest((de = e))
  46779. }),
  46780. (this.getClearColor = function () {
  46781. return ae
  46782. }),
  46783. (this.setClearColor = function (e, t) {
  46784. ae.set(e), (se = void 0 !== t ? t : 1), i(ae.r, ae.g, ae.b, se)
  46785. }),
  46786. (this.getClearAlpha = function () {
  46787. return se
  46788. }),
  46789. (this.setClearAlpha = function (e) {
  46790. ;(se = e), i(ae.r, ae.g, ae.b, se)
  46791. }),
  46792. (this.clear = function (e, t, i) {
  46793. var n = 0
  46794. ;(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)
  46795. }),
  46796. (this.clearColor = function () {
  46797. this.clear(!0, !1, !1)
  46798. }),
  46799. (this.clearDepth = function () {
  46800. this.clear(!1, !0, !1)
  46801. }),
  46802. (this.clearStencil = function () {
  46803. this.clear(!1, !1, !0)
  46804. }),
  46805. (this.clearTarget = function (e, t, i, n) {
  46806. this.setRenderTarget(e), this.clear(t, i, n)
  46807. }),
  46808. (this.resetGLState = n),
  46809. (this.dispose = function () {
  46810. O.removeEventListener('webglcontextlost', r, !1)
  46811. }),
  46812. (this.renderBufferImmediate = function (e, t, i) {
  46813. _e.initAttributes()
  46814. var n = be.get(e)
  46815. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  46816. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  46817. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  46818. e.hasColors && !n.color && (n.color = X.createBuffer())
  46819. var r = t.getAttributes()
  46820. if (
  46821. (e.hasPositions &&
  46822. (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  46823. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  46824. _e.enableAttribute(r.position),
  46825. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  46826. e.hasNormals)
  46827. ) {
  46828. if ((X.bindBuffer(X.ARRAY_BUFFER, n.normal), 'MeshPhongMaterial' !== i.type && 'MeshStandardMaterial' !== i.type && i.shading === Ci.FlatShading))
  46829. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  46830. var s = e.normalArray,
  46831. l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3,
  46832. c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3,
  46833. h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3
  46834. ;(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)
  46835. }
  46836. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW), _e.enableAttribute(r.normal), X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  46837. }
  46838. e.hasUvs &&
  46839. i.map &&
  46840. (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)),
  46841. e.hasColors &&
  46842. i.vertexColors !== Ci.NoColors &&
  46843. (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  46844. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  46845. _e.enableAttribute(r.color),
  46846. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  46847. _e.disableUnusedAttributes(),
  46848. X.drawArrays(X.TRIANGLES, 0, e.count),
  46849. (e.count = 0)
  46850. }),
  46851. (this.renderBufferDirect = function (e, t, i, n, r, o) {
  46852. R(n)
  46853. var a = P(e, t, n, r),
  46854. s = !1,
  46855. l = i.id + '_' + a.id + '_' + n.wireframe
  46856. l !== ee && ((ee = l), (s = !0))
  46857. var c = r.morphTargetInfluences
  46858. if (void 0 !== c) {
  46859. for (var h = [], u = 0, d = c.length; u < d; u++) {
  46860. var p = c[u]
  46861. h.push([p, u])
  46862. }
  46863. h.sort(M), 8 < h.length && (h.length = 8)
  46864. var f = i.morphAttributes
  46865. for (u = 0, d = h.length; u < d; u++) {
  46866. p = h[u]
  46867. if (((j[u] = p[0]), 0 !== p[0])) {
  46868. var g = p[1]
  46869. !0 === n.morphTargets && f.position && i.addAttribute('morphTarget' + u, f.position[g]), !0 === n.morphNormals && f.normal && i.addAttribute('morphNormal' + u, f.normal[g])
  46870. } else !0 === n.morphTargets && i.removeAttribute('morphTarget' + u), !0 === n.morphNormals && i.removeAttribute('morphNormal' + u)
  46871. }
  46872. var m = a.getUniforms()
  46873. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j), (s = !0)
  46874. }
  46875. g = i.index
  46876. var v,
  46877. y = i.attributes.position
  46878. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  46879. null !== g ? (v = Me).setIndex(g) : (v = Se),
  46880. s &&
  46881. ((function (e, t, i, n) {
  46882. var r
  46883. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get('ANGLE_instanced_arrays')))
  46884. console.error('THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.')
  46885. else {
  46886. void 0 === n && (n = 0), _e.initAttributes()
  46887. var o = i.attributes,
  46888. a = t.getAttributes(),
  46889. s = e.defaultAttributeValues
  46890. for (var l in a) {
  46891. var c = a[l]
  46892. if (0 <= c) {
  46893. var h = o[l]
  46894. if (void 0 !== h) {
  46895. var u = h.itemSize,
  46896. d = we.getAttributeBuffer(h)
  46897. if (h instanceof Ci.InterleavedBufferAttribute) {
  46898. var p = h.data,
  46899. f = p.stride,
  46900. g = h.offset
  46901. p instanceof Ci.InstancedInterleavedBuffer
  46902. ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r), void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count))
  46903. : _e.enableAttribute(c),
  46904. X.bindBuffer(X.ARRAY_BUFFER, d),
  46905. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  46906. } else
  46907. h instanceof Ci.InstancedBufferAttribute
  46908. ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r), void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count))
  46909. : _e.enableAttribute(c),
  46910. X.bindBuffer(X.ARRAY_BUFFER, d),
  46911. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  46912. } else if (void 0 !== s) {
  46913. var m = s[l]
  46914. if (void 0 !== m)
  46915. switch (m.length) {
  46916. case 2:
  46917. X.vertexAttrib2fv(c, m)
  46918. break
  46919. case 3:
  46920. X.vertexAttrib3fv(c, m)
  46921. break
  46922. case 4:
  46923. X.vertexAttrib4fv(c, m)
  46924. break
  46925. default:
  46926. X.vertexAttrib1fv(c, m)
  46927. }
  46928. }
  46929. }
  46930. }
  46931. _e.disableUnusedAttributes()
  46932. }
  46933. })(n, a, i),
  46934. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)))
  46935. var A = 1 / 0
  46936. null !== g ? (A = g.count) : void 0 !== y && (A = y.count)
  46937. var C = i.drawRange.start,
  46938. I = i.drawRange.count,
  46939. E = null !== o ? o.start : 0,
  46940. _ = null !== o ? o.count : 1 / 0,
  46941. b = Math.max(0, C, E),
  46942. w = Math.min(0 + A, C + I, E + _) - 1,
  46943. T = Math.max(0, w - b + 1)
  46944. if (r instanceof Ci.Mesh)
  46945. if (!0 === n.wireframe) _e.setLineWidth(n.wireframeLinewidth * S()), v.setMode(X.LINES)
  46946. else
  46947. switch (r.drawMode) {
  46948. case Ci.TrianglesDrawMode:
  46949. v.setMode(X.TRIANGLES)
  46950. break
  46951. case Ci.TriangleStripDrawMode:
  46952. v.setMode(X.TRIANGLE_STRIP)
  46953. break
  46954. case Ci.TriangleFanDrawMode:
  46955. v.setMode(X.TRIANGLE_FAN)
  46956. }
  46957. else if (r instanceof Ci.Line) {
  46958. var x = n.linewidth
  46959. void 0 === x && (x = 1), _e.setLineWidth(x * S()), r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  46960. } else r instanceof Ci.Points && v.setMode(X.POINTS)
  46961. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  46962. }),
  46963. (this.render = function (e, t, i, n) {
  46964. if (t instanceof Ci.Camera != 0) {
  46965. var r = e.fog
  46966. if (
  46967. ((ee = ''),
  46968. ($ = -1),
  46969. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  46970. null === t.parent && t.updateMatrixWorld(),
  46971. t.matrixWorldInverse.getInverse(t.matrixWorld),
  46972. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  46973. fe.setFromMatrix(ge),
  46974. (U.length = 0),
  46975. (W = z = -1),
  46976. (Y.length = 0),
  46977. (q.length = 0),
  46978. (function e(t, i) {
  46979. if (!1 !== t.visible) {
  46980. if (t.layers.test(i.layers))
  46981. if (t instanceof Ci.Light) U.push(t)
  46982. else if (t instanceof Ci.Sprite) (!1 !== t.frustumCulled && !0 !== fe.intersectsObject(t)) || Y.push(t)
  46983. else if (t instanceof Ci.LensFlare) q.push(t)
  46984. else if (t instanceof Ci.ImmediateRenderObject)
  46985. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld), me.applyProjection(ge)), d(t, null, t.material, me.z, null)
  46986. else if (
  46987. (t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) &&
  46988. (t instanceof Ci.SkinnedMesh && t.skeleton.update(), !1 === t.frustumCulled || !0 === fe.intersectsObject(t))
  46989. ) {
  46990. var n = t.material
  46991. if (!0 === n.visible) {
  46992. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld), me.applyProjection(ge))
  46993. var r = we.update(t)
  46994. if (n instanceof Ci.MultiMaterial)
  46995. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  46996. var c = o[s],
  46997. h = a[c.materialIndex]
  46998. !0 === h.visible && d(t, r, h, me.z, c)
  46999. }
  47000. else d(t, r, n, me.z, null)
  47001. }
  47002. }
  47003. var u = t.children
  47004. for (s = 0, l = u.length; s < l; s++) e(u[s], i)
  47005. }
  47006. })(e, t),
  47007. (H.length = z + 1),
  47008. (G.length = W + 1),
  47009. !0 === Z.sortObjects && (H.sort(s), G.sort(l)),
  47010. (function (e, t) {
  47011. var i,
  47012. n,
  47013. r,
  47014. o,
  47015. a,
  47016. s,
  47017. l = 0,
  47018. c = 0,
  47019. h = 0,
  47020. u = t.matrixWorldInverse,
  47021. d = 0,
  47022. p = 0,
  47023. f = 0,
  47024. g = 0,
  47025. m = 0
  47026. for (i = ve.shadowsPointLight = 0, n = e.length; i < n; i++)
  47027. 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)
  47028. else if (r instanceof Ci.DirectionalLight) {
  47029. ;(v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  47030. v.direction.setFromMatrixPosition(r.matrixWorld),
  47031. me.setFromMatrixPosition(r.target.matrixWorld),
  47032. v.direction.sub(me),
  47033. v.direction.transformDirection(u),
  47034. (v.shadow = r.castShadow),
  47035. r.castShadow && ((v.shadowBias = r.shadow.bias), (v.shadowRadius = r.shadow.radius), (v.shadowMapSize = r.shadow.mapSize), (ve.shadows[m++] = r)),
  47036. (ve.directionalShadowMap[d] = r.shadow.map),
  47037. (ve.directionalShadowMatrix[d] = r.shadow.matrix),
  47038. (ve.directional[d++] = v)
  47039. } else if (r instanceof Ci.SpotLight) {
  47040. ;(v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  47041. v.position.applyMatrix4(u),
  47042. v.color.copy(o).multiplyScalar(a),
  47043. (v.distance = s),
  47044. v.direction.setFromMatrixPosition(r.matrixWorld),
  47045. me.setFromMatrixPosition(r.target.matrixWorld),
  47046. v.direction.sub(me),
  47047. v.direction.transformDirection(u),
  47048. (v.coneCos = Math.cos(r.angle)),
  47049. (v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra))),
  47050. (v.decay = 0 === r.distance ? 0 : r.decay),
  47051. (v.shadow = r.castShadow),
  47052. r.castShadow && ((v.shadowBias = r.shadow.bias), (v.shadowRadius = r.shadow.radius), (v.shadowMapSize = r.shadow.mapSize), (ve.shadows[m++] = r)),
  47053. (ve.spotShadowMap[f] = r.shadow.map),
  47054. (ve.spotShadowMatrix[f] = r.shadow.matrix),
  47055. (ve.spot[f++] = v)
  47056. } else if (r instanceof Ci.PointLight) {
  47057. ;(v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  47058. v.position.applyMatrix4(u),
  47059. v.color.copy(r.color).multiplyScalar(r.intensity),
  47060. (v.distance = r.distance),
  47061. (v.decay = 0 === r.distance ? 0 : r.decay),
  47062. (v.shadow = r.castShadow),
  47063. r.castShadow && ((v.shadowBias = r.shadow.bias), (v.shadowRadius = r.shadow.radius), (v.shadowMapSize = r.shadow.mapSize), (ve.shadows[m++] = r)),
  47064. (ve.pointShadowMap[p] = r.shadow.map),
  47065. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4()),
  47066. me.setFromMatrixPosition(r.matrixWorld).negate(),
  47067. ve.pointShadowMatrix[p].identity().setPosition(me),
  47068. (ve.point[p++] = v)
  47069. } else if (r instanceof Ci.HemisphereLight) {
  47070. var v
  47071. ;(v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  47072. v.direction.transformDirection(u),
  47073. v.direction.normalize(),
  47074. v.skyColor.copy(r.color).multiplyScalar(a),
  47075. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  47076. (ve.hemi[g++] = v)
  47077. }
  47078. ;(ve.ambient[0] = l),
  47079. (ve.ambient[1] = c),
  47080. (ve.ambient[2] = h),
  47081. (ve.directional.length = d),
  47082. (ve.spot.length = f),
  47083. (ve.point.length = p),
  47084. (ve.hemi.length = g),
  47085. (ve.shadows.length = m),
  47086. (ve.hash = d + ',' + p + ',' + f + ',' + g + ',' + m)
  47087. })(U, t),
  47088. Re.render(e, t),
  47089. (Ae.calls = 0),
  47090. (Ae.vertices = 0),
  47091. (Ae.faces = 0),
  47092. void (Ae.points = 0) === i && (i = null),
  47093. this.setRenderTarget(i),
  47094. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  47095. e.overrideMaterial)
  47096. ) {
  47097. var o = e.overrideMaterial
  47098. c(H, t, r, o), c(G, t, r, o)
  47099. } else _e.setBlending(Ci.NoBlending), c(H, t, r), c(G, t, r)
  47100. if ((Oe.render(e, t), Le.render(e, t, re), i)) {
  47101. var a = i.texture
  47102. a.generateMipmaps &&
  47103. E(i) &&
  47104. a.minFilter !== Ci.NearestFilter &&
  47105. a.minFilter !== Ci.LinearFilter &&
  47106. (function (e) {
  47107. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D,
  47108. i = be.get(e.texture).__webglTexture
  47109. _e.bindTexture(t, i), X.generateMipmap(t), _e.bindTexture(t, null)
  47110. })(i)
  47111. }
  47112. _e.setDepthTest(!0), _e.setDepthWrite(!0), _e.setColorWrite(!0)
  47113. } else console.error('THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.')
  47114. }),
  47115. (this.setFaceCulling = function (e, t) {
  47116. e === Ci.CullFaceNone
  47117. ? _e.disable(X.CULL_FACE)
  47118. : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  47119. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  47120. _e.enable(X.CULL_FACE))
  47121. }),
  47122. (this.setTexture = function (e, t) {
  47123. var i = be.get(e)
  47124. if (0 < e.version && i.__version !== e.version) {
  47125. var n = e.image
  47126. return void 0 === n
  47127. ? void console.warn('THREE.WebGLRenderer: Texture marked for update but image is undefined', e)
  47128. : !1 === n.complete
  47129. ? void console.warn('THREE.WebGLRenderer: Texture marked for update but image is incomplete', e)
  47130. : void o(i, e, t)
  47131. }
  47132. _e.activeTexture(X.TEXTURE0 + t), _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  47133. }),
  47134. (this.getCurrentRenderTarget = function () {
  47135. return Q
  47136. }),
  47137. (this.setRenderTarget = function (e) {
  47138. ;(Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e)
  47139. var t,
  47140. i = e instanceof Ci.WebGLRenderTargetCube
  47141. if (e) {
  47142. var n = be.get(e)
  47143. ;(t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer), ie.copy(e.scissor), (ne = e.scissorTest), re.copy(e.viewport)
  47144. } else (t = null), ie.copy(ue).multiplyScalar(he), (ne = de), re.copy(pe).multiplyScalar(he)
  47145. if ((J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t), (J = t)), _e.scissor(ie), _e.setScissorTest(ne), _e.viewport(re), i)) {
  47146. var r = be.get(e.texture)
  47147. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  47148. }
  47149. }),
  47150. (this.readRenderTargetPixels = function (e, t, i, n, r, o) {
  47151. if (e instanceof Ci.WebGLRenderTarget != 0) {
  47152. var a = be.get(e).__webglFramebuffer
  47153. if (a) {
  47154. var s = !1
  47155. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a), (s = !0))
  47156. try {
  47157. var l = e.texture
  47158. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  47159. return void console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.')
  47160. if (
  47161. !(
  47162. l.type === Ci.UnsignedByteType ||
  47163. x(l.type) === X.getParameter(X.IMPLEMENTATION_COLOR_READ_TYPE) ||
  47164. (l.type === Ci.FloatType && Ie.get('WEBGL_color_buffer_float')) ||
  47165. (l.type === Ci.HalfFloatType && Ie.get('EXT_color_buffer_half_float'))
  47166. )
  47167. )
  47168. return void console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.')
  47169. X.checkFramebufferStatus(X.FRAMEBUFFER) === X.FRAMEBUFFER_COMPLETE
  47170. ? X.readPixels(t, i, n, r, x(l.format), x(l.type), o)
  47171. : console.error('THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.')
  47172. } finally {
  47173. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  47174. }
  47175. }
  47176. } else console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.')
  47177. })
  47178. }),
  47179. (Ci.WebGLRenderTarget = function (e, t, i) {
  47180. ;(this.uuid = Ci.Math.generateUUID()),
  47181. (this.width = e),
  47182. (this.height = t),
  47183. (this.scissor = new Ci.Vector4(0, 0, e, t)),
  47184. (this.scissorTest = !1),
  47185. (this.viewport = new Ci.Vector4(0, 0, e, t)),
  47186. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  47187. (this.texture = new Ci.Texture(void 0, void 0, i.wrapS, i.wrapT, i.magFilter, i.minFilter, i.format, i.type, i.anisotropy)),
  47188. (this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer),
  47189. (this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer)
  47190. }),
  47191. (Ci.WebGLRenderTarget.prototype = {
  47192. constructor: Ci.WebGLRenderTarget,
  47193. setSize: function (e, t) {
  47194. ;(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)
  47195. },
  47196. clone: function () {
  47197. return new this.constructor().copy(this)
  47198. },
  47199. copy: function (e) {
  47200. return (
  47201. (this.width = e.width),
  47202. (this.height = e.height),
  47203. this.viewport.copy(e.viewport),
  47204. (this.texture = e.texture.clone()),
  47205. (this.depthBuffer = e.depthBuffer),
  47206. (this.stencilBuffer = e.stencilBuffer),
  47207. this
  47208. )
  47209. },
  47210. dispose: function () {
  47211. this.dispatchEvent({
  47212. type: 'dispose'
  47213. })
  47214. }
  47215. }),
  47216. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  47217. (Ci.WebGLRenderTargetCube = function (e, t, i) {
  47218. Ci.WebGLRenderTarget.call(this, e, t, i), (this.activeCubeFace = 0), (this.activeMipMapLevel = 0)
  47219. }),
  47220. (Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype)),
  47221. (Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube),
  47222. (Ci.WebGLBufferRenderer = function (r, o, a) {
  47223. var s
  47224. ;(this.setMode = function (e) {
  47225. s = e
  47226. }),
  47227. (this.render = function (e, t) {
  47228. r.drawArrays(s, e, t), a.calls++, (a.vertices += t), s === r.TRIANGLES && (a.faces += t / 3)
  47229. }),
  47230. (this.renderInstances = function (e) {
  47231. var t = o.get('ANGLE_instanced_arrays')
  47232. if (null !== t) {
  47233. var i = e.attributes.position,
  47234. n = 0
  47235. ;(n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count),
  47236. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  47237. a.calls++,
  47238. (a.vertices += n * e.maxInstancedCount),
  47239. s === r.TRIANGLES && (a.faces += (e.maxInstancedCount * n) / 3)
  47240. } else console.error('THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.')
  47241. })
  47242. }),
  47243. (Ci.WebGLIndexedBufferRenderer = function (r, o, a) {
  47244. var s, l, c
  47245. ;(this.setMode = function (e) {
  47246. s = e
  47247. }),
  47248. (this.setIndex = function (e) {
  47249. c = e.array instanceof Uint32Array && o.get('OES_element_index_uint') ? ((l = r.UNSIGNED_INT), 4) : ((l = r.UNSIGNED_SHORT), 2)
  47250. }),
  47251. (this.render = function (e, t) {
  47252. r.drawElements(s, t, l, e * c), a.calls++, (a.vertices += t), s === r.TRIANGLES && (a.faces += t / 3)
  47253. }),
  47254. (this.renderInstances = function (e, t, i) {
  47255. var n = o.get('ANGLE_instanced_arrays')
  47256. return null === n
  47257. ? void console.error('THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.')
  47258. : (n.drawElementsInstancedANGLE(s, i, l, t * c, e.maxInstancedCount),
  47259. a.calls++,
  47260. (a.vertices += i * e.maxInstancedCount),
  47261. void (s === r.TRIANGLES && (a.faces += (e.maxInstancedCount * i) / 3)))
  47262. })
  47263. }),
  47264. (Ci.WebGLExtensions = function (i) {
  47265. var n = {}
  47266. this.get = function (e) {
  47267. if (void 0 !== n[e]) return n[e]
  47268. var t
  47269. switch (e) {
  47270. case 'EXT_texture_filter_anisotropic':
  47271. t = i.getExtension('EXT_texture_filter_anisotropic') || i.getExtension('MOZ_EXT_texture_filter_anisotropic') || i.getExtension('WEBKIT_EXT_texture_filter_anisotropic')
  47272. break
  47273. case 'WEBGL_compressed_texture_s3tc':
  47274. t = i.getExtension('WEBGL_compressed_texture_s3tc') || i.getExtension('MOZ_WEBGL_compressed_texture_s3tc') || i.getExtension('WEBKIT_WEBGL_compressed_texture_s3tc')
  47275. break
  47276. case 'WEBGL_compressed_texture_pvrtc':
  47277. t = i.getExtension('WEBGL_compressed_texture_pvrtc') || i.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc')
  47278. break
  47279. case 'WEBGL_compressed_texture_etc1':
  47280. t = i.getExtension('WEBGL_compressed_texture_etc1')
  47281. break
  47282. default:
  47283. t = i.getExtension(e)
  47284. }
  47285. return null === t && console.warn('THREE.WebGLRenderer: ' + e + ' extension not supported.'), (n[e] = t)
  47286. }
  47287. }),
  47288. (Ci.WebGLCapabilities = function (t, e, i) {
  47289. function n(e) {
  47290. if ('highp' === e) {
  47291. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision) return 'highp'
  47292. e = 'mediump'
  47293. }
  47294. return 'mediump' === e && 0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.MEDIUM_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.MEDIUM_FLOAT).precision
  47295. ? 'mediump'
  47296. : 'lowp'
  47297. }
  47298. ;(this.getMaxPrecision = n),
  47299. (this.precision = void 0 !== i.precision ? i.precision : 'highp'),
  47300. (this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer),
  47301. (this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)),
  47302. (this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS)),
  47303. (this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE)),
  47304. (this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)),
  47305. (this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS)),
  47306. (this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS)),
  47307. (this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS)),
  47308. (this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS)),
  47309. (this.vertexTextures = 0 < this.maxVertexTextures),
  47310. (this.floatFragmentTextures = !!e.get('OES_texture_float')),
  47311. (this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures)
  47312. var r = n(this.precision)
  47313. r !== this.precision && (console.warn('THREE.WebGLRenderer:', this.precision, 'not supported, using', r, 'instead.'), (this.precision = r)),
  47314. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get('EXT_frag_depth'))
  47315. }),
  47316. (Ci.WebGLGeometries = function (i, o, a) {
  47317. function s(e) {
  47318. var t = e.target,
  47319. i = c[t.id]
  47320. null !== i.index && l(i.index),
  47321. (function (e) {
  47322. for (var t in e) l(e[t])
  47323. })(i.attributes),
  47324. t.removeEventListener('dispose', s),
  47325. delete c[t.id]
  47326. var n = o.get(t)
  47327. n.wireframe && l(n.wireframe), o.delete(t)
  47328. var r = o.get(i)
  47329. r.wireframe && l(r.wireframe), o.delete(i), a.memory.geometries--
  47330. }
  47331. function l(e) {
  47332. var t = (function (e) {
  47333. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  47334. })(e)
  47335. void 0 !== t &&
  47336. (i.deleteBuffer(t),
  47337. (function (e) {
  47338. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  47339. })(e))
  47340. }
  47341. var c = {}
  47342. this.get = function (e) {
  47343. var t,
  47344. i = e.geometry
  47345. return void 0 !== c[i.id]
  47346. ? c[i.id]
  47347. : (i.addEventListener('dispose', s),
  47348. i instanceof Ci.BufferGeometry
  47349. ? (t = i)
  47350. : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = new Ci.BufferGeometry().setFromObject(e)), (t = i._bufferGeometry)),
  47351. (c[i.id] = t),
  47352. a.memory.geometries++,
  47353. t)
  47354. }
  47355. }),
  47356. (Ci.WebGLLights = function () {
  47357. var i = {}
  47358. this.get = function (e) {
  47359. if (void 0 !== i[e.id]) return i[e.id]
  47360. var t
  47361. switch (e.type) {
  47362. case 'DirectionalLight':
  47363. t = {
  47364. direction: new Ci.Vector3(),
  47365. color: new Ci.Color(),
  47366. shadow: !1,
  47367. shadowBias: 0,
  47368. shadowRadius: 1,
  47369. shadowMapSize: new Ci.Vector2()
  47370. }
  47371. break
  47372. case 'SpotLight':
  47373. t = {
  47374. position: new Ci.Vector3(),
  47375. direction: new Ci.Vector3(),
  47376. color: new Ci.Color(),
  47377. distance: 0,
  47378. coneCos: 0,
  47379. penumbraCos: 0,
  47380. decay: 0,
  47381. shadow: !1,
  47382. shadowBias: 0,
  47383. shadowRadius: 1,
  47384. shadowMapSize: new Ci.Vector2()
  47385. }
  47386. break
  47387. case 'PointLight':
  47388. t = {
  47389. position: new Ci.Vector3(),
  47390. color: new Ci.Color(),
  47391. distance: 0,
  47392. decay: 0,
  47393. shadow: !1,
  47394. shadowBias: 0,
  47395. shadowRadius: 1,
  47396. shadowMapSize: new Ci.Vector2()
  47397. }
  47398. break
  47399. case 'HemisphereLight':
  47400. t = {
  47401. direction: new Ci.Vector3(),
  47402. skyColor: new Ci.Color(),
  47403. groundColor: new Ci.Color()
  47404. }
  47405. }
  47406. return (i[e.id] = t)
  47407. }
  47408. }),
  47409. (Ci.WebGLObjects = function (g, m, e) {
  47410. function v(e, t) {
  47411. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e,
  47412. n = m.get(i)
  47413. void 0 === n.__webglBuffer
  47414. ? (function (e, t, i) {
  47415. ;(e.__webglBuffer = g.createBuffer()), g.bindBuffer(i, e.__webglBuffer)
  47416. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW
  47417. g.bufferData(i, t.array, n), (e.version = t.version)
  47418. })(n, i, t)
  47419. : n.version !== i.version &&
  47420. (function (e, t, i) {
  47421. g.bindBuffer(i, e.__webglBuffer),
  47422. !1 === t.dynamic || -1 === t.updateRange.count
  47423. ? g.bufferSubData(i, 0, t.array)
  47424. : 0 === t.updateRange.count
  47425. ? console.error(
  47426. 'THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.'
  47427. )
  47428. : (g.bufferSubData(i, t.updateRange.offset * t.array.BYTES_PER_ELEMENT, t.array.subarray(t.updateRange.offset, t.updateRange.offset + t.updateRange.count)),
  47429. (t.updateRange.count = 0)),
  47430. (e.version = t.version)
  47431. })(n, i, t)
  47432. }
  47433. function y(e, t, i) {
  47434. if (i < t) {
  47435. var n = t
  47436. ;(t = i), (i = n)
  47437. }
  47438. var r = e[t]
  47439. return void 0 === r ? ((e[t] = [i]), !0) : -1 === r.indexOf(i) && (r.push(i), !0)
  47440. }
  47441. var c = new Ci.WebGLGeometries(g, m, e)
  47442. ;(this.getAttributeBuffer = function (e) {
  47443. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  47444. }),
  47445. (this.getWireframeAttribute = function (e) {
  47446. var t = m.get(e)
  47447. if (void 0 !== t.wireframe) return t.wireframe
  47448. var i,
  47449. n = [],
  47450. r = e.index,
  47451. o = e.attributes,
  47452. a = o.position
  47453. if (null !== r)
  47454. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  47455. var h = i[l + 0],
  47456. u = i[l + 1],
  47457. d = i[l + 2]
  47458. y(s, h, u) && n.push(h, u), y(s, u, d) && n.push(u, d), y(s, d, h) && n.push(d, h)
  47459. }
  47460. else
  47461. for (l = 0, c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  47462. ;(h = l + 0), (u = l + 1), (d = l + 2)
  47463. n.push(h, u, u, d, d, h)
  47464. }
  47465. var p = 65535 < a.count ? Uint32Array : Uint16Array,
  47466. f = new Ci.BufferAttribute(new p(n), 1)
  47467. return v(f, g.ELEMENT_ARRAY_BUFFER), (t.wireframe = f)
  47468. }),
  47469. (this.update = function (e) {
  47470. var t = c.get(e)
  47471. e.geometry instanceof Ci.Geometry && t.updateFromObject(e)
  47472. var i = t.index,
  47473. n = t.attributes
  47474. for (var r in (null !== i && v(i, g.ELEMENT_ARRAY_BUFFER), n)) v(n[r], g.ARRAY_BUFFER)
  47475. var o = t.morphAttributes
  47476. for (var r in o) for (var a = o[r], s = 0, l = a.length; s < l; s++) v(a[s], g.ARRAY_BUFFER)
  47477. return t
  47478. })
  47479. }),
  47480. (Ci.WebGLProgram =
  47481. ((Qt = 0),
  47482. (Jt = /^([\w\d_]+)\.([\w\d_]+)$/),
  47483. ($t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/),
  47484. (ei = /^([\w\d_]+)\[0\]$/),
  47485. function (e, t, i, n) {
  47486. var r = e.context,
  47487. o = i.extensions,
  47488. a = i.defines,
  47489. s = i.__webglShader.vertexShader,
  47490. l = i.__webglShader.fragmentShader,
  47491. c = 'SHADOWMAP_TYPE_BASIC'
  47492. n.shadowMapType === Ci.PCFShadowMap ? (c = 'SHADOWMAP_TYPE_PCF') : n.shadowMapType === Ci.PCFSoftShadowMap && (c = 'SHADOWMAP_TYPE_PCF_SOFT')
  47493. var h = 'ENVMAP_TYPE_CUBE',
  47494. u = 'ENVMAP_MODE_REFLECTION',
  47495. d = 'ENVMAP_BLENDING_MULTIPLY'
  47496. if (n.envMap) {
  47497. switch (i.envMap.mapping) {
  47498. case Ci.CubeReflectionMapping:
  47499. case Ci.CubeRefractionMapping:
  47500. h = 'ENVMAP_TYPE_CUBE'
  47501. break
  47502. case Ci.CubeUVReflectionMapping:
  47503. case Ci.CubeUVRefractionMapping:
  47504. h = 'ENVMAP_TYPE_CUBE_UV'
  47505. break
  47506. case Ci.EquirectangularReflectionMapping:
  47507. case Ci.EquirectangularRefractionMapping:
  47508. h = 'ENVMAP_TYPE_EQUIREC'
  47509. break
  47510. case Ci.SphericalReflectionMapping:
  47511. h = 'ENVMAP_TYPE_SPHERE'
  47512. }
  47513. switch (i.envMap.mapping) {
  47514. case Ci.CubeRefractionMapping:
  47515. case Ci.EquirectangularRefractionMapping:
  47516. u = 'ENVMAP_MODE_REFRACTION'
  47517. }
  47518. switch (i.combine) {
  47519. case Ci.MultiplyOperation:
  47520. d = 'ENVMAP_BLENDING_MULTIPLY'
  47521. break
  47522. case Ci.MixOperation:
  47523. d = 'ENVMAP_BLENDING_MIX'
  47524. break
  47525. case Ci.AddOperation:
  47526. d = 'ENVMAP_BLENDING_ADD'
  47527. }
  47528. }
  47529. var p,
  47530. f,
  47531. g = 0 < e.gammaFactor ? e.gammaFactor : 1,
  47532. m = (function (e, t, i) {
  47533. return [
  47534. (e = e || {}).derivatives || t.envMapCubeUV || t.bumpMap || t.normalMap || t.flatShading ? '#extension GL_OES_standard_derivatives : enable' : '',
  47535. (e.fragDepth || t.logarithmicDepthBuffer) && i.get('EXT_frag_depth') ? '#extension GL_EXT_frag_depth : enable' : '',
  47536. e.drawBuffers && i.get('WEBGL_draw_buffers') ? '#extension GL_EXT_draw_buffers : require' : '',
  47537. (e.shaderTextureLOD || t.envMap) && i.get('EXT_shader_texture_lod') ? '#extension GL_EXT_shader_texture_lod : enable' : ''
  47538. ]
  47539. .filter(Pi)
  47540. .join('\n')
  47541. })(o, n, e.extensions),
  47542. v = (function (e) {
  47543. var t = []
  47544. for (var i in e) {
  47545. var n = e[i]
  47546. !1 !== n && t.push('#define ' + i + ' ' + n)
  47547. }
  47548. return t.join('\n')
  47549. })(a),
  47550. y = r.createProgram()
  47551. ;(f =
  47552. i instanceof Ci.RawShaderMaterial
  47553. ? (p = '')
  47554. : ((p = [
  47555. 'precision ' + n.precision + ' float;',
  47556. 'precision ' + n.precision + ' int;',
  47557. '#define SHADER_NAME ' + i.__webglShader.name,
  47558. v,
  47559. n.supportsVertexTextures ? '#define VERTEX_TEXTURES' : '',
  47560. '#define GAMMA_FACTOR ' + g,
  47561. '#define MAX_BONES ' + n.maxBones,
  47562. n.map ? '#define USE_MAP' : '',
  47563. n.envMap ? '#define USE_ENVMAP' : '',
  47564. n.envMap ? '#define ' + u : '',
  47565. n.lightMap ? '#define USE_LIGHTMAP' : '',
  47566. n.aoMap ? '#define USE_AOMAP' : '',
  47567. n.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
  47568. n.bumpMap ? '#define USE_BUMPMAP' : '',
  47569. n.normalMap ? '#define USE_NORMALMAP' : '',
  47570. n.displacementMap && n.supportsVertexTextures ? '#define USE_DISPLACEMENTMAP' : '',
  47571. n.specularMap ? '#define USE_SPECULARMAP' : '',
  47572. n.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
  47573. n.metalnessMap ? '#define USE_METALNESSMAP' : '',
  47574. n.alphaMap ? '#define USE_ALPHAMAP' : '',
  47575. n.vertexColors ? '#define USE_COLOR' : '',
  47576. n.flatShading ? '#define FLAT_SHADED' : '',
  47577. n.skinning ? '#define USE_SKINNING' : '',
  47578. n.useVertexTexture ? '#define BONE_TEXTURE' : '',
  47579. n.morphTargets ? '#define USE_MORPHTARGETS' : '',
  47580. n.morphNormals && !1 === n.flatShading ? '#define USE_MORPHNORMALS' : '',
  47581. n.doubleSided ? '#define DOUBLE_SIDED' : '',
  47582. n.flipSided ? '#define FLIP_SIDED' : '',
  47583. n.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',
  47584. n.shadowMapEnabled ? '#define ' + c : '',
  47585. 0 < n.pointLightShadows ? '#define POINT_LIGHT_SHADOWS' : '',
  47586. n.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '',
  47587. n.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
  47588. n.logarithmicDepthBuffer && e.extensions.get('EXT_frag_depth') ? '#define USE_LOGDEPTHBUF_EXT' : '',
  47589. 'uniform mat4 modelMatrix;',
  47590. 'uniform mat4 modelViewMatrix;',
  47591. 'uniform mat4 projectionMatrix;',
  47592. 'uniform mat4 viewMatrix;',
  47593. 'uniform mat3 normalMatrix;',
  47594. 'uniform vec3 cameraPosition;',
  47595. 'attribute vec3 position;',
  47596. 'attribute vec3 normal;',
  47597. 'attribute vec2 uv;',
  47598. '#ifdef USE_COLOR',
  47599. '\tattribute vec3 color;',
  47600. '#endif',
  47601. '#ifdef USE_MORPHTARGETS',
  47602. '\tattribute vec3 morphTarget0;',
  47603. '\tattribute vec3 morphTarget1;',
  47604. '\tattribute vec3 morphTarget2;',
  47605. '\tattribute vec3 morphTarget3;',
  47606. '\t#ifdef USE_MORPHNORMALS',
  47607. '\t\tattribute vec3 morphNormal0;',
  47608. '\t\tattribute vec3 morphNormal1;',
  47609. '\t\tattribute vec3 morphNormal2;',
  47610. '\t\tattribute vec3 morphNormal3;',
  47611. '\t#else',
  47612. '\t\tattribute vec3 morphTarget4;',
  47613. '\t\tattribute vec3 morphTarget5;',
  47614. '\t\tattribute vec3 morphTarget6;',
  47615. '\t\tattribute vec3 morphTarget7;',
  47616. '\t#endif',
  47617. '#endif',
  47618. '#ifdef USE_SKINNING',
  47619. '\tattribute vec4 skinIndex;',
  47620. '\tattribute vec4 skinWeight;',
  47621. '#endif',
  47622. '\n'
  47623. ]
  47624. .filter(Pi)
  47625. .join('\n')),
  47626. [
  47627. m,
  47628. 'precision ' + n.precision + ' float;',
  47629. 'precision ' + n.precision + ' int;',
  47630. '#define SHADER_NAME ' + i.__webglShader.name,
  47631. v,
  47632. n.alphaTest ? '#define ALPHATEST ' + n.alphaTest : '',
  47633. '#define GAMMA_FACTOR ' + g,
  47634. n.useFog && n.fog ? '#define USE_FOG' : '',
  47635. n.useFog && n.fogExp ? '#define FOG_EXP2' : '',
  47636. n.map ? '#define USE_MAP' : '',
  47637. n.envMap ? '#define USE_ENVMAP' : '',
  47638. n.envMap ? '#define ' + h : '',
  47639. n.envMap ? '#define ' + u : '',
  47640. n.envMap ? '#define ' + d : '',
  47641. n.lightMap ? '#define USE_LIGHTMAP' : '',
  47642. n.aoMap ? '#define USE_AOMAP' : '',
  47643. n.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
  47644. n.bumpMap ? '#define USE_BUMPMAP' : '',
  47645. n.normalMap ? '#define USE_NORMALMAP' : '',
  47646. n.specularMap ? '#define USE_SPECULARMAP' : '',
  47647. n.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
  47648. n.metalnessMap ? '#define USE_METALNESSMAP' : '',
  47649. n.alphaMap ? '#define USE_ALPHAMAP' : '',
  47650. n.vertexColors ? '#define USE_COLOR' : '',
  47651. n.flatShading ? '#define FLAT_SHADED' : '',
  47652. n.doubleSided ? '#define DOUBLE_SIDED' : '',
  47653. n.flipSided ? '#define FLIP_SIDED' : '',
  47654. n.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',
  47655. n.shadowMapEnabled ? '#define ' + c : '',
  47656. 0 < n.pointLightShadows ? '#define POINT_LIGHT_SHADOWS' : '',
  47657. n.premultipliedAlpha ? '#define PREMULTIPLIED_ALPHA' : '',
  47658. n.physicallyCorrectLights ? '#define PHYSICALLY_CORRECT_LIGHTS' : '',
  47659. n.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
  47660. n.logarithmicDepthBuffer && e.extensions.get('EXT_frag_depth') ? '#define USE_LOGDEPTHBUF_EXT' : '',
  47661. n.envMap && e.extensions.get('EXT_shader_texture_lod') ? '#define TEXTURE_LOD_EXT' : '',
  47662. 'uniform mat4 viewMatrix;',
  47663. 'uniform vec3 cameraPosition;',
  47664. n.toneMapping !== Ci.NoToneMapping ? '#define TONE_MAPPING' : '',
  47665. n.toneMapping !== Ci.NoToneMapping ? Ci.ShaderChunk.tonemapping_pars_fragment : '',
  47666. n.toneMapping !== Ci.NoToneMapping
  47667. ? (function (e, t) {
  47668. var i
  47669. switch (t) {
  47670. case Ci.LinearToneMapping:
  47671. i = 'Linear'
  47672. break
  47673. case Ci.ReinhardToneMapping:
  47674. i = 'Reinhard'
  47675. break
  47676. case Ci.Uncharted2ToneMapping:
  47677. i = 'Uncharted2'
  47678. break
  47679. case Ci.CineonToneMapping:
  47680. i = 'OptimizedCineon'
  47681. break
  47682. default:
  47683. throw new Error('unsupported toneMapping: ' + t)
  47684. }
  47685. return 'vec3 ' + e + '( vec3 color ) { return ' + i + 'ToneMapping( color ); }'
  47686. })('toneMapping', n.toneMapping)
  47687. : '',
  47688. n.outputEncoding || n.mapEncoding || n.envMapEncoding || n.emissiveMapEncoding ? Ci.ShaderChunk.encodings_pars_fragment : '',
  47689. n.mapEncoding ? Ri('mapTexelToLinear', n.mapEncoding) : '',
  47690. n.envMapEncoding ? Ri('envMapTexelToLinear', n.envMapEncoding) : '',
  47691. n.emissiveMapEncoding ? Ri('emissiveMapTexelToLinear', n.emissiveMapEncoding) : '',
  47692. n.outputEncoding
  47693. ? (function (e, t) {
  47694. var i = Mi(t)
  47695. return 'vec4 ' + e + '( vec4 value ) { return LinearTo' + i[0] + i[1] + '; }'
  47696. })('linearToOutputTexel', n.outputEncoding)
  47697. : '',
  47698. '\n'
  47699. ]
  47700. .filter(Pi)
  47701. .join('\n'))),
  47702. (s = Oi((s = Li(s)), n)),
  47703. (l = Oi((l = Li(l)), n)),
  47704. i instanceof Ci.ShaderMaterial == 0 && ((s = Di(s)), (l = Di(l)))
  47705. var A = p + s,
  47706. C = f + l,
  47707. I = Ci.WebGLShader(r, r.VERTEX_SHADER, A),
  47708. E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C)
  47709. r.attachShader(y, I),
  47710. r.attachShader(y, E),
  47711. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, 'position'),
  47712. r.linkProgram(y)
  47713. var _,
  47714. b,
  47715. w = r.getProgramInfoLog(y),
  47716. T = r.getShaderInfoLog(I),
  47717. x = r.getShaderInfoLog(E),
  47718. S = !0,
  47719. M = !0
  47720. return (
  47721. !1 === r.getProgramParameter(y, r.LINK_STATUS)
  47722. ? ((S = !1), console.error('THREE.WebGLProgram: shader error: ', r.getError(), 'gl.VALIDATE_STATUS', r.getProgramParameter(y, r.VALIDATE_STATUS), 'gl.getProgramInfoLog', w, T, x))
  47723. : '' !== w
  47724. ? console.warn('THREE.WebGLProgram: gl.getProgramInfoLog()', w)
  47725. : ('' !== T && '' !== x) || (M = !1),
  47726. M &&
  47727. (this.diagnostics = {
  47728. runnable: S,
  47729. material: i,
  47730. programLog: w,
  47731. vertexShader: {
  47732. log: T,
  47733. prefix: p
  47734. },
  47735. fragmentShader: {
  47736. log: x,
  47737. prefix: f
  47738. }
  47739. }),
  47740. r.deleteShader(I),
  47741. r.deleteShader(E),
  47742. (this.getUniforms = function () {
  47743. return (
  47744. void 0 === _ &&
  47745. (_ = (function (e, t) {
  47746. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  47747. var o = e.getActiveUniform(t, r).name,
  47748. a = e.getUniformLocation(t, o),
  47749. s = Jt.exec(o)
  47750. if (s) {
  47751. var l = s[1],
  47752. c = s[2],
  47753. h = i[l]
  47754. ;(h = h || (i[l] = {}))[c] = a
  47755. } else if ((s = $t.exec(o))) {
  47756. var u = s[1],
  47757. d = s[2],
  47758. p = s[3],
  47759. f = i[u],
  47760. g = (f = f || (i[u] = []))[d]
  47761. ;(g = g || (f[d] = {}))[p] = a
  47762. } else (s = ei.exec(o)) ? (i[(u = s[1])] = a) : (i[o] = a)
  47763. }
  47764. return i
  47765. })(r, y)),
  47766. _
  47767. )
  47768. }),
  47769. (this.getAttributes = function () {
  47770. return (
  47771. void 0 === b &&
  47772. (b = (function (e, t) {
  47773. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  47774. var o = e.getActiveAttrib(t, r).name
  47775. i[o] = e.getAttribLocation(t, o)
  47776. }
  47777. return i
  47778. })(r, y)),
  47779. b
  47780. )
  47781. }),
  47782. (this.destroy = function () {
  47783. r.deleteProgram(y), (this.program = void 0)
  47784. }),
  47785. Object.defineProperties(this, {
  47786. uniforms: {
  47787. get: function () {
  47788. return console.warn('THREE.WebGLProgram: .uniforms is now .getUniforms().'), this.getUniforms()
  47789. }
  47790. },
  47791. attributes: {
  47792. get: function () {
  47793. return console.warn('THREE.WebGLProgram: .attributes is now .getAttributes().'), this.getAttributes()
  47794. }
  47795. }
  47796. }),
  47797. (this.id = Qt++),
  47798. (this.code = t),
  47799. (this.usedTimes = 1),
  47800. (this.program = y),
  47801. (this.vertexShader = I),
  47802. (this.fragmentShader = E),
  47803. this
  47804. )
  47805. })),
  47806. (Ci.WebGLPrograms = function (s, l) {
  47807. function c(e, t) {
  47808. var i
  47809. return (
  47810. e ? (e instanceof Ci.Texture ? (i = e.encoding) : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding)) : (i = Ci.LinearEncoding),
  47811. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  47812. i
  47813. )
  47814. }
  47815. var h = [],
  47816. u = {
  47817. MeshDepthMaterial: 'depth',
  47818. MeshNormalMaterial: 'normal',
  47819. MeshBasicMaterial: 'basic',
  47820. MeshLambertMaterial: 'lambert',
  47821. MeshPhongMaterial: 'phong',
  47822. MeshStandardMaterial: 'standard',
  47823. LineBasicMaterial: 'basic',
  47824. LineDashedMaterial: 'dashed',
  47825. PointsMaterial: 'points'
  47826. },
  47827. a = [
  47828. 'precision',
  47829. 'supportsVertexTextures',
  47830. 'map',
  47831. 'mapEncoding',
  47832. 'envMap',
  47833. 'envMapMode',
  47834. 'envMapEncoding',
  47835. 'lightMap',
  47836. 'aoMap',
  47837. 'emissiveMap',
  47838. 'emissiveMapEncoding',
  47839. 'bumpMap',
  47840. 'normalMap',
  47841. 'displacementMap',
  47842. 'specularMap',
  47843. 'roughnessMap',
  47844. 'metalnessMap',
  47845. 'alphaMap',
  47846. 'combine',
  47847. 'vertexColors',
  47848. 'fog',
  47849. 'useFog',
  47850. 'fogExp',
  47851. 'flatShading',
  47852. 'sizeAttenuation',
  47853. 'logarithmicDepthBuffer',
  47854. 'skinning',
  47855. 'maxBones',
  47856. 'useVertexTexture',
  47857. 'morphTargets',
  47858. 'morphNormals',
  47859. 'maxMorphTargets',
  47860. 'maxMorphNormals',
  47861. 'premultipliedAlpha',
  47862. 'numDirLights',
  47863. 'numPointLights',
  47864. 'numSpotLights',
  47865. 'numHemiLights',
  47866. 'shadowMapEnabled',
  47867. 'pointLightShadows',
  47868. 'toneMapping',
  47869. 'physicallyCorrectLights',
  47870. 'shadowMapType',
  47871. 'alphaTest',
  47872. 'doubleSided',
  47873. 'flipSided'
  47874. ]
  47875. ;(this.getParameters = function (e, t, i, n) {
  47876. var r = u[e.type],
  47877. o = (function (e) {
  47878. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture) return 1024
  47879. var t = l.maxVertexUniforms,
  47880. i = Math.floor((t - 20) / 4)
  47881. return (
  47882. void 0 !== e &&
  47883. e instanceof Ci.SkinnedMesh &&
  47884. (i = Math.min(e.skeleton.bones.length, i)) < e.skeleton.bones.length &&
  47885. console.warn('WebGLRenderer: too many bones - ' + e.skeleton.bones.length + ', this GPU supports just ' + i + ' (try OpenGL instead of ANGLE)'),
  47886. i
  47887. )
  47888. })(n),
  47889. a = s.getPrecision()
  47890. return (
  47891. null === e.precision ||
  47892. ((a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn('THREE.WebGLProgram.getParameters:', e.precision, 'not supported, using', a, 'instead.')),
  47893. {
  47894. shaderID: r,
  47895. precision: a,
  47896. supportsVertexTextures: l.vertexTextures,
  47897. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  47898. map: !!e.map,
  47899. mapEncoding: c(e.map, s.gammaInput),
  47900. envMap: !!e.envMap,
  47901. envMapMode: e.envMap && e.envMap.mapping,
  47902. envMapEncoding: c(e.envMap, s.gammaInput),
  47903. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  47904. lightMap: !!e.lightMap,
  47905. aoMap: !!e.aoMap,
  47906. emissiveMap: !!e.emissiveMap,
  47907. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  47908. bumpMap: !!e.bumpMap,
  47909. normalMap: !!e.normalMap,
  47910. displacementMap: !!e.displacementMap,
  47911. roughnessMap: !!e.roughnessMap,
  47912. metalnessMap: !!e.metalnessMap,
  47913. specularMap: !!e.specularMap,
  47914. alphaMap: !!e.alphaMap,
  47915. combine: e.combine,
  47916. vertexColors: e.vertexColors,
  47917. fog: i,
  47918. useFog: e.fog,
  47919. fogExp: i instanceof Ci.FogExp2,
  47920. flatShading: e.shading === Ci.FlatShading,
  47921. sizeAttenuation: e.sizeAttenuation,
  47922. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  47923. skinning: e.skinning,
  47924. maxBones: o,
  47925. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  47926. morphTargets: e.morphTargets,
  47927. morphNormals: e.morphNormals,
  47928. maxMorphTargets: s.maxMorphTargets,
  47929. maxMorphNormals: s.maxMorphNormals,
  47930. numDirLights: t.directional.length,
  47931. numPointLights: t.point.length,
  47932. numSpotLights: t.spot.length,
  47933. numHemiLights: t.hemi.length,
  47934. pointLightShadows: t.shadowsPointLight,
  47935. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  47936. shadowMapType: s.shadowMap.type,
  47937. toneMapping: s.toneMapping,
  47938. physicallyCorrectLights: s.physicallyCorrectLights,
  47939. premultipliedAlpha: e.premultipliedAlpha,
  47940. alphaTest: e.alphaTest,
  47941. doubleSided: e.side === Ci.DoubleSide,
  47942. flipSided: e.side === Ci.BackSide
  47943. }
  47944. )
  47945. }),
  47946. (this.getProgramCode = function (e, t) {
  47947. var i = []
  47948. 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])
  47949. for (var r = 0; r < a.length; r++) {
  47950. var o = a[r]
  47951. i.push(o), i.push(t[o])
  47952. }
  47953. return i.join()
  47954. }),
  47955. (this.acquireProgram = function (e, t, i) {
  47956. for (var n, r = 0, o = h.length; r < o; r++) {
  47957. var a = h[r]
  47958. if (a.code === i) {
  47959. ++(n = a).usedTimes
  47960. break
  47961. }
  47962. }
  47963. return void 0 === n && ((n = new Ci.WebGLProgram(s, i, e, t)), h.push(n)), n
  47964. }),
  47965. (this.releaseProgram = function (e) {
  47966. if (0 == --e.usedTimes) {
  47967. var t = h.indexOf(e)
  47968. ;(h[t] = h[h.length - 1]), h.pop(), e.destroy()
  47969. }
  47970. }),
  47971. (this.programs = h)
  47972. }),
  47973. (Ci.WebGLProperties = function () {
  47974. var n = {}
  47975. ;(this.get = function (e) {
  47976. var t = e.uuid,
  47977. i = n[t]
  47978. return void 0 === i && ((i = {}), (n[t] = i)), i
  47979. }),
  47980. (this.delete = function (e) {
  47981. delete n[e.uuid]
  47982. }),
  47983. (this.clear = function () {
  47984. n = {}
  47985. })
  47986. }),
  47987. (Ci.WebGLShader = function (e, t, i) {
  47988. var n = e.createShader(t)
  47989. return (
  47990. e.shaderSource(n, i),
  47991. e.compileShader(n),
  47992. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  47993. '' !== e.getShaderInfoLog(n) &&
  47994. console.warn(
  47995. 'THREE.WebGLShader: gl.getShaderInfoLog()',
  47996. t === e.VERTEX_SHADER ? 'vertex' : 'fragment',
  47997. e.getShaderInfoLog(n),
  47998. (function (e) {
  47999. for (var t = e.split('\n'), i = 0; i < t.length; i++) t[i] = i + 1 + ': ' + t[i]
  48000. return t.join('\n')
  48001. })(i)
  48002. ),
  48003. n
  48004. )
  48005. }),
  48006. (Ci.WebGLShadowMap = function (P, O, L) {
  48007. function D(e, t, i, n) {
  48008. var r = e.geometry,
  48009. o = null,
  48010. a = p,
  48011. s = e.customDepthMaterial
  48012. if ((i && ((a = f), (s = e.customDistanceMaterial)), s)) o = s
  48013. else {
  48014. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets,
  48015. c = e instanceof Ci.SkinnedMesh && t.skinning,
  48016. h = 0
  48017. l && (h |= u), c && (h |= d), (o = a[h])
  48018. }
  48019. 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
  48020. }
  48021. function N(e, t, i) {
  48022. if (!1 !== e.visible) {
  48023. 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)))
  48024. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld), G.push(e))
  48025. for (var n = e.children, r = 0, o = n.length; r < o; r++) N(n[r], t, i)
  48026. }
  48027. }
  48028. for (
  48029. var F = P.context,
  48030. B = P.state,
  48031. V = new Ci.Frustum(),
  48032. k = new Ci.Matrix4(),
  48033. U = new Ci.Vector2(),
  48034. H = new Ci.Vector3(),
  48035. z = new Ci.Vector3(),
  48036. G = [],
  48037. u = 1,
  48038. d = 2,
  48039. e = 1 + (u | d),
  48040. p = new Array(e),
  48041. f = new Array(e),
  48042. 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)],
  48043. 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)],
  48044. Y = [new Ci.Vector4(), new Ci.Vector4(), new Ci.Vector4(), new Ci.Vector4(), new Ci.Vector4(), new Ci.Vector4()],
  48045. t = Ci.ShaderLib.depthRGBA,
  48046. i = Ci.UniformsUtils.clone(t.uniforms),
  48047. n = Ci.ShaderLib.distanceRGBA,
  48048. r = Ci.UniformsUtils.clone(n.uniforms),
  48049. o = 0;
  48050. o !== e;
  48051. ++o
  48052. ) {
  48053. var a = 0 != (o & u),
  48054. s = 0 != (o & d),
  48055. l = new Ci.ShaderMaterial({
  48056. uniforms: i,
  48057. vertexShader: t.vertexShader,
  48058. fragmentShader: t.fragmentShader,
  48059. morphTargets: a,
  48060. skinning: s
  48061. })
  48062. p[o] = l
  48063. var c = new Ci.ShaderMaterial({
  48064. defines: {
  48065. USE_SHADOWMAP: ''
  48066. },
  48067. uniforms: r,
  48068. vertexShader: n.vertexShader,
  48069. fragmentShader: n.fragmentShader,
  48070. morphTargets: a,
  48071. skinning: s
  48072. })
  48073. f[o] = c
  48074. }
  48075. var q = this
  48076. ;(this.enabled = !1),
  48077. (this.autoUpdate = !0),
  48078. (this.needsUpdate = !1),
  48079. (this.type = Ci.PCFShadowMap),
  48080. (this.cullFace = Ci.CullFaceFront),
  48081. (this.render = function (e, t) {
  48082. var i,
  48083. n,
  48084. r = O.shadows
  48085. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  48086. B.clearColor(1, 1, 1, 1),
  48087. B.disable(F.BLEND),
  48088. B.enable(F.CULL_FACE),
  48089. F.frontFace(F.CCW),
  48090. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  48091. B.setDepthTest(!0),
  48092. B.setScissorTest(!1)
  48093. for (var o = 0, a = r.length; o < a; o++) {
  48094. var s = r[o],
  48095. l = s.shadow,
  48096. c = l.camera
  48097. if ((U.copy(l.mapSize), s instanceof Ci.PointLight)) {
  48098. ;(i = 6), (n = !0)
  48099. var h = U.x,
  48100. u = U.y
  48101. 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)
  48102. } else n = !(i = 1)
  48103. if (null === l.map) {
  48104. var d = {
  48105. minFilter: Ci.NearestFilter,
  48106. magFilter: Ci.NearestFilter,
  48107. format: Ci.RGBAFormat
  48108. }
  48109. ;(l.map = new Ci.WebGLRenderTarget(U.x, U.y, d)), s instanceof Ci.SpotLight && (c.aspect = U.x / U.y), c.updateProjectionMatrix()
  48110. }
  48111. var p = l.map,
  48112. f = l.matrix
  48113. z.setFromMatrixPosition(s.matrixWorld), c.position.copy(z), P.setRenderTarget(p), P.clear()
  48114. for (var g = 0; g < i; g++) {
  48115. if (n) {
  48116. H.copy(c.position), H.add(W[g]), c.up.copy(j[g]), c.lookAt(H)
  48117. var m = Y[g]
  48118. B.viewport(m)
  48119. } else H.setFromMatrixPosition(s.target.matrixWorld), c.lookAt(H)
  48120. c.updateMatrixWorld(),
  48121. c.matrixWorldInverse.getInverse(c.matrixWorld),
  48122. f.set(0.5, 0, 0, 0.5, 0, 0.5, 0, 0.5, 0, 0, 0.5, 0.5, 0, 0, 0, 1),
  48123. f.multiply(c.projectionMatrix),
  48124. f.multiply(c.matrixWorldInverse),
  48125. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  48126. V.setFromMatrix(k),
  48127. (G.length = 0),
  48128. N(e, t, c)
  48129. for (var v = 0, y = G.length; v < y; v++) {
  48130. var A = G[v],
  48131. C = L.update(A),
  48132. I = A.material
  48133. if (I instanceof Ci.MultiMaterial)
  48134. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  48135. var T = E[b],
  48136. x = _[T.materialIndex]
  48137. if (!0 === x.visible) {
  48138. var S = D(A, x, n, z)
  48139. P.renderBufferDirect(c, null, C, S, A, T)
  48140. }
  48141. }
  48142. else {
  48143. S = D(A, I, n, z)
  48144. P.renderBufferDirect(c, null, C, S, A, null)
  48145. }
  48146. }
  48147. }
  48148. }
  48149. var M = P.getClearColor(),
  48150. R = P.getClearAlpha()
  48151. P.setClearColor(M, R), B.enable(F.BLEND), q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK), (q.needsUpdate = !1)
  48152. }
  48153. })
  48154. }),
  48155. (Ci.WebGLState = function (l, i, c) {
  48156. var n = this,
  48157. r = new Ci.Vector4(),
  48158. o = new Uint8Array(16),
  48159. a = new Uint8Array(16),
  48160. s = new Uint8Array(16),
  48161. t = {},
  48162. h = null,
  48163. u = null,
  48164. d = null,
  48165. p = null,
  48166. f = null,
  48167. g = null,
  48168. m = null,
  48169. v = null,
  48170. y = !1,
  48171. A = null,
  48172. C = null,
  48173. I = null,
  48174. E = null,
  48175. _ = null,
  48176. b = null,
  48177. w = null,
  48178. T = null,
  48179. x = null,
  48180. S = null,
  48181. M = null,
  48182. R = null,
  48183. P = null,
  48184. O = null,
  48185. L = null,
  48186. D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),
  48187. N = void 0,
  48188. F = {},
  48189. B = new Ci.Vector4(),
  48190. V = null,
  48191. k = null,
  48192. U = new Ci.Vector4(),
  48193. H = new Ci.Vector4(),
  48194. z = l.createTexture()
  48195. l.bindTexture(l.TEXTURE_2D, z),
  48196. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  48197. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  48198. (this.init = function () {
  48199. this.clearColor(0, 0, 0, 1),
  48200. this.clearDepth(1),
  48201. this.clearStencil(0),
  48202. this.enable(l.DEPTH_TEST),
  48203. l.depthFunc(l.LEQUAL),
  48204. l.frontFace(l.CCW),
  48205. l.cullFace(l.BACK),
  48206. this.enable(l.CULL_FACE),
  48207. this.enable(l.BLEND),
  48208. l.blendEquation(l.FUNC_ADD),
  48209. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  48210. }),
  48211. (this.initAttributes = function () {
  48212. for (var e = 0, t = o.length; e < t; e++) o[e] = 0
  48213. }),
  48214. (this.enableAttribute = function (e) {
  48215. ;(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))
  48216. }),
  48217. (this.enableAttributeAndDivisor = function (e, t, i) {
  48218. ;(o[e] = 1), 0 === a[e] && (l.enableVertexAttribArray(e), (a[e] = 1)), s[e] !== t && (i.vertexAttribDivisorANGLE(e, t), (s[e] = t))
  48219. }),
  48220. (this.disableUnusedAttributes = function () {
  48221. for (var e = 0, t = a.length; e < t; e++) a[e] !== o[e] && (l.disableVertexAttribArray(e), (a[e] = 0))
  48222. }),
  48223. (this.enable = function (e) {
  48224. !0 !== t[e] && (l.enable(e), (t[e] = !0))
  48225. }),
  48226. (this.disable = function (e) {
  48227. !1 !== t[e] && (l.disable(e), (t[e] = !1))
  48228. }),
  48229. (this.getCompressedTextureFormats = function () {
  48230. if (null === h && ((h = []), i.get('WEBGL_compressed_texture_pvrtc') || i.get('WEBGL_compressed_texture_s3tc') || i.get('WEBGL_compressed_texture_etc1')))
  48231. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++) h.push(e[t])
  48232. return h
  48233. }),
  48234. (this.setBlending = function (e, t, i, n, r, o, a, s) {
  48235. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  48236. (e === u && s === y) ||
  48237. (e === Ci.AdditiveBlending
  48238. ? s
  48239. ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE))
  48240. : (l.blendEquation(l.FUNC_ADD), l.blendFunc(l.SRC_ALPHA, l.ONE))
  48241. : e === Ci.SubtractiveBlending
  48242. ? s
  48243. ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA))
  48244. : (l.blendEquation(l.FUNC_ADD), l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR))
  48245. : e === Ci.MultiplyBlending
  48246. ? s
  48247. ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA))
  48248. : (l.blendEquation(l.FUNC_ADD), l.blendFunc(l.ZERO, l.SRC_COLOR))
  48249. : s
  48250. ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA))
  48251. : (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)),
  48252. (u = e),
  48253. (y = s)),
  48254. e === Ci.CustomBlending
  48255. ? ((r = r || t),
  48256. (o = o || i),
  48257. (a = a || n),
  48258. (t === d && r === g) || (l.blendEquationSeparate(c(t), c(r)), (d = t), (g = r)),
  48259. (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)))
  48260. : (v = m = g = f = p = d = null)
  48261. }),
  48262. (this.setDepthFunc = function (e) {
  48263. if (A !== e) {
  48264. if (e)
  48265. switch (e) {
  48266. case Ci.NeverDepth:
  48267. l.depthFunc(l.NEVER)
  48268. break
  48269. case Ci.AlwaysDepth:
  48270. l.depthFunc(l.ALWAYS)
  48271. break
  48272. case Ci.LessDepth:
  48273. l.depthFunc(l.LESS)
  48274. break
  48275. case Ci.LessEqualDepth:
  48276. l.depthFunc(l.LEQUAL)
  48277. break
  48278. case Ci.EqualDepth:
  48279. l.depthFunc(l.EQUAL)
  48280. break
  48281. case Ci.GreaterEqualDepth:
  48282. l.depthFunc(l.GEQUAL)
  48283. break
  48284. case Ci.GreaterDepth:
  48285. l.depthFunc(l.GREATER)
  48286. break
  48287. case Ci.NotEqualDepth:
  48288. l.depthFunc(l.NOTEQUAL)
  48289. break
  48290. default:
  48291. l.depthFunc(l.LEQUAL)
  48292. }
  48293. else l.depthFunc(l.LEQUAL)
  48294. A = e
  48295. }
  48296. }),
  48297. (this.setDepthTest = function (e) {
  48298. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  48299. }),
  48300. (this.setDepthWrite = function (e) {
  48301. C !== e && (l.depthMask(e), (C = e))
  48302. }),
  48303. (this.setColorWrite = function (e) {
  48304. I !== e && (l.colorMask(e, e, e, e), (I = e))
  48305. }),
  48306. (this.setStencilFunc = function (e, t, i) {
  48307. ;(_ === e && b === t && w === i) || (l.stencilFunc(e, t, i), (_ = e), (b = t), (w = i))
  48308. }),
  48309. (this.setStencilOp = function (e, t, i) {
  48310. ;(T === e && x === t && S === i) || (l.stencilOp(e, t, i), (T = e), (x = t), (S = i))
  48311. }),
  48312. (this.setStencilTest = function (e) {
  48313. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  48314. }),
  48315. (this.setStencilWrite = function (e) {
  48316. E !== e && (l.stencilMask(e), (E = e))
  48317. }),
  48318. (this.setFlipSided = function (e) {
  48319. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW), (M = e))
  48320. }),
  48321. (this.setLineWidth = function (e) {
  48322. e !== R && (l.lineWidth(e), (R = e))
  48323. }),
  48324. (this.setPolygonOffset = function (e, t, i) {
  48325. 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))
  48326. }),
  48327. (this.getScissorTest = function () {
  48328. return L
  48329. }),
  48330. (this.setScissorTest = function (e) {
  48331. ;(L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  48332. }),
  48333. (this.activeTexture = function (e) {
  48334. void 0 === e && (e = l.TEXTURE0 + D - 1), N !== e && (l.activeTexture(e), (N = e))
  48335. }),
  48336. (this.bindTexture = function (e, t) {
  48337. void 0 === N && n.activeTexture()
  48338. var i = F[N]
  48339. void 0 === i &&
  48340. ((i = {
  48341. type: void 0,
  48342. texture: void 0
  48343. }),
  48344. (F[N] = i)),
  48345. (i.type === e && i.texture === t) || (l.bindTexture(e, t || z), (i.type = e), (i.texture = t))
  48346. }),
  48347. (this.compressedTexImage2D = function () {
  48348. try {
  48349. l.compressedTexImage2D.apply(l, arguments)
  48350. } catch (e) {
  48351. console.error(e)
  48352. }
  48353. }),
  48354. (this.texImage2D = function () {
  48355. try {
  48356. l.texImage2D.apply(l, arguments)
  48357. } catch (e) {
  48358. console.error(e)
  48359. }
  48360. }),
  48361. (this.clearColor = function (e, t, i, n) {
  48362. r.set(e, t, i, n), !1 === B.equals(r) && (l.clearColor(e, t, i, n), B.copy(r))
  48363. }),
  48364. (this.clearDepth = function (e) {
  48365. V !== e && (l.clearDepth(e), (V = e))
  48366. }),
  48367. (this.clearStencil = function (e) {
  48368. k !== e && (l.clearStencil(e), (k = e))
  48369. }),
  48370. (this.scissor = function (e) {
  48371. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w), U.copy(e))
  48372. }),
  48373. (this.viewport = function (e) {
  48374. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w), H.copy(e))
  48375. }),
  48376. (this.reset = function () {
  48377. for (var e = 0; e < a.length; e++) 1 === a[e] && (l.disableVertexAttribArray(e), (a[e] = 0))
  48378. ;(t = {}), (N = void 0), (F = {}), (M = E = C = I = u = h = null)
  48379. })
  48380. }),
  48381. (Ci.LensFlarePlugin = function (v, y) {
  48382. function A() {
  48383. var e,
  48384. t = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1]),
  48385. i = new Uint16Array([0, 1, 2, 0, 2, 3])
  48386. ;(C = S.createBuffer()),
  48387. (I = S.createBuffer()),
  48388. S.bindBuffer(S.ARRAY_BUFFER, C),
  48389. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  48390. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  48391. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  48392. (T = S.createTexture()),
  48393. (x = S.createTexture()),
  48394. M.bindTexture(S.TEXTURE_2D, T),
  48395. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  48396. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  48397. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  48398. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  48399. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  48400. M.bindTexture(S.TEXTURE_2D, x),
  48401. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  48402. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  48403. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  48404. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  48405. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  48406. (e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS))
  48407. ? {
  48408. vertexShader: [
  48409. 'uniform lowp int renderType;',
  48410. 'uniform vec3 screenPosition;',
  48411. 'uniform vec2 scale;',
  48412. 'uniform float rotation;',
  48413. 'uniform sampler2D occlusionMap;',
  48414. 'attribute vec2 position;',
  48415. 'attribute vec2 uv;',
  48416. 'varying vec2 vUV;',
  48417. 'varying float vVisibility;',
  48418. 'void main() {',
  48419. 'vUV = uv;',
  48420. 'vec2 pos = position;',
  48421. 'if ( renderType == 2 ) {',
  48422. 'vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );',
  48423. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );',
  48424. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );',
  48425. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );',
  48426. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );',
  48427. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );',
  48428. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );',
  48429. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );',
  48430. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );',
  48431. 'vVisibility = visibility.r / 9.0;',
  48432. 'vVisibility *= 1.0 - visibility.g / 9.0;',
  48433. 'vVisibility *= visibility.b / 9.0;',
  48434. 'vVisibility *= 1.0 - visibility.a / 9.0;',
  48435. 'pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;',
  48436. 'pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;',
  48437. '}',
  48438. 'gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );',
  48439. '}'
  48440. ].join('\n'),
  48441. fragmentShader: [
  48442. 'uniform lowp int renderType;',
  48443. 'uniform sampler2D map;',
  48444. 'uniform float opacity;',
  48445. 'uniform vec3 color;',
  48446. 'varying vec2 vUV;',
  48447. 'varying float vVisibility;',
  48448. 'void main() {',
  48449. 'if ( renderType == 0 ) {',
  48450. 'gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );',
  48451. '} else if ( renderType == 1 ) {',
  48452. 'gl_FragColor = texture2D( map, vUV );',
  48453. '} else {',
  48454. 'vec4 texture = texture2D( map, vUV );',
  48455. 'texture.a *= opacity * vVisibility;',
  48456. 'gl_FragColor = texture;',
  48457. 'gl_FragColor.rgb *= color;',
  48458. '}',
  48459. '}'
  48460. ].join('\n')
  48461. }
  48462. : {
  48463. vertexShader: [
  48464. 'uniform lowp int renderType;',
  48465. 'uniform vec3 screenPosition;',
  48466. 'uniform vec2 scale;',
  48467. 'uniform float rotation;',
  48468. 'attribute vec2 position;',
  48469. 'attribute vec2 uv;',
  48470. 'varying vec2 vUV;',
  48471. 'void main() {',
  48472. 'vUV = uv;',
  48473. 'vec2 pos = position;',
  48474. 'if ( renderType == 2 ) {',
  48475. 'pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;',
  48476. 'pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;',
  48477. '}',
  48478. 'gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );',
  48479. '}'
  48480. ].join('\n'),
  48481. fragmentShader: [
  48482. 'precision mediump float;',
  48483. 'uniform lowp int renderType;',
  48484. 'uniform sampler2D map;',
  48485. 'uniform sampler2D occlusionMap;',
  48486. 'uniform float opacity;',
  48487. 'uniform vec3 color;',
  48488. 'varying vec2 vUV;',
  48489. 'void main() {',
  48490. 'if ( renderType == 0 ) {',
  48491. 'gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );',
  48492. '} else if ( renderType == 1 ) {',
  48493. 'gl_FragColor = texture2D( map, vUV );',
  48494. '} else {',
  48495. 'float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;',
  48496. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;',
  48497. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;',
  48498. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;',
  48499. 'visibility = ( 1.0 - visibility / 4.0 );',
  48500. 'vec4 texture = texture2D( map, vUV );',
  48501. 'texture.a *= opacity * visibility;',
  48502. 'gl_FragColor = texture;',
  48503. 'gl_FragColor.rgb *= color;',
  48504. '}',
  48505. '}'
  48506. ].join('\n')
  48507. }),
  48508. (E = (function (e) {
  48509. var t = S.createProgram(),
  48510. i = S.createShader(S.FRAGMENT_SHADER),
  48511. n = S.createShader(S.VERTEX_SHADER),
  48512. r = 'precision ' + v.getPrecision() + ' float;\n'
  48513. return (
  48514. S.shaderSource(i, r + e.fragmentShader),
  48515. S.shaderSource(n, r + e.vertexShader),
  48516. S.compileShader(i),
  48517. S.compileShader(n),
  48518. S.attachShader(t, i),
  48519. S.attachShader(t, n),
  48520. S.linkProgram(t),
  48521. t
  48522. )
  48523. })(e)),
  48524. (_ = {
  48525. vertex: S.getAttribLocation(E, 'position'),
  48526. uv: S.getAttribLocation(E, 'uv')
  48527. }),
  48528. (b = {
  48529. renderType: S.getUniformLocation(E, 'renderType'),
  48530. map: S.getUniformLocation(E, 'map'),
  48531. occlusionMap: S.getUniformLocation(E, 'occlusionMap'),
  48532. opacity: S.getUniformLocation(E, 'opacity'),
  48533. color: S.getUniformLocation(E, 'color'),
  48534. scale: S.getUniformLocation(E, 'scale'),
  48535. rotation: S.getUniformLocation(E, 'rotation'),
  48536. screenPosition: S.getUniformLocation(E, 'screenPosition')
  48537. })
  48538. }
  48539. var C,
  48540. I,
  48541. E,
  48542. _,
  48543. b,
  48544. w,
  48545. T,
  48546. x,
  48547. S = v.context,
  48548. M = v.state
  48549. this.render = function (e, t, i) {
  48550. if (0 !== y.length) {
  48551. var n = new Ci.Vector3(),
  48552. r = i.w / i.z,
  48553. o = 0.5 * i.z,
  48554. a = 0.5 * i.w,
  48555. s = 16 / i.w,
  48556. l = new Ci.Vector2(s * r, s),
  48557. c = new Ci.Vector3(1, 1, 0),
  48558. h = new Ci.Vector2(1, 1)
  48559. void 0 === E && A(),
  48560. S.useProgram(E),
  48561. M.initAttributes(),
  48562. M.enableAttribute(_.vertex),
  48563. M.enableAttribute(_.uv),
  48564. M.disableUnusedAttributes(),
  48565. S.uniform1i(b.occlusionMap, 0),
  48566. S.uniform1i(b.map, 1),
  48567. S.bindBuffer(S.ARRAY_BUFFER, C),
  48568. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  48569. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  48570. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  48571. M.disable(S.CULL_FACE),
  48572. M.setDepthWrite(!1)
  48573. for (var u = 0, d = y.length; u < d; u++) {
  48574. ;(s = 16 / i.w), l.set(s * r, s)
  48575. var p = y[u]
  48576. if (
  48577. (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  48578. n.applyMatrix4(t.matrixWorldInverse),
  48579. n.applyProjection(t.projectionMatrix),
  48580. c.copy(n),
  48581. (h.x = c.x * o + o),
  48582. (h.y = c.y * a + a),
  48583. w || (0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w))
  48584. ) {
  48585. M.activeTexture(S.TEXTURE0),
  48586. M.bindTexture(S.TEXTURE_2D, null),
  48587. M.activeTexture(S.TEXTURE1),
  48588. M.bindTexture(S.TEXTURE_2D, T),
  48589. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  48590. S.uniform1i(b.renderType, 0),
  48591. S.uniform2f(b.scale, l.x, l.y),
  48592. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  48593. M.disable(S.BLEND),
  48594. M.enable(S.DEPTH_TEST),
  48595. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  48596. M.activeTexture(S.TEXTURE0),
  48597. M.bindTexture(S.TEXTURE_2D, x),
  48598. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  48599. S.uniform1i(b.renderType, 1),
  48600. M.disable(S.DEPTH_TEST),
  48601. M.activeTexture(S.TEXTURE1),
  48602. M.bindTexture(S.TEXTURE_2D, T),
  48603. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  48604. p.positionScreen.copy(c),
  48605. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  48606. S.uniform1i(b.renderType, 2),
  48607. M.enable(S.BLEND)
  48608. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  48609. var m = p.lensFlares[f]
  48610. 0.001 < m.opacity &&
  48611. 0.001 < m.scale &&
  48612. ((c.x = m.x),
  48613. (c.y = m.y),
  48614. (c.z = m.z),
  48615. (s = (m.size * m.scale) / i.w),
  48616. (l.x = s * r),
  48617. (l.y = s),
  48618. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  48619. S.uniform2f(b.scale, l.x, l.y),
  48620. S.uniform1f(b.rotation, m.rotation),
  48621. S.uniform1f(b.opacity, m.opacity),
  48622. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  48623. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  48624. v.setTexture(m.texture, 1),
  48625. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  48626. }
  48627. }
  48628. }
  48629. M.enable(S.CULL_FACE), M.enable(S.DEPTH_TEST), M.setDepthWrite(!0), v.resetGLState()
  48630. }
  48631. }
  48632. }),
  48633. (Ci.SpritePlugin = function (u, d) {
  48634. function p() {
  48635. 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]),
  48636. t = new Uint16Array([0, 1, 2, 0, 2, 3])
  48637. ;(g = I.createBuffer()),
  48638. (m = I.createBuffer()),
  48639. I.bindBuffer(I.ARRAY_BUFFER, g),
  48640. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  48641. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  48642. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  48643. (v = (function () {
  48644. var e = I.createProgram(),
  48645. t = I.createShader(I.VERTEX_SHADER),
  48646. i = I.createShader(I.FRAGMENT_SHADER)
  48647. return (
  48648. I.shaderSource(
  48649. t,
  48650. [
  48651. 'precision ' + u.getPrecision() + ' float;',
  48652. 'uniform mat4 modelViewMatrix;',
  48653. 'uniform mat4 projectionMatrix;',
  48654. 'uniform float rotation;',
  48655. 'uniform vec2 scale;',
  48656. 'uniform vec2 uvOffset;',
  48657. 'uniform vec2 uvScale;',
  48658. 'attribute vec2 position;',
  48659. 'attribute vec2 uv;',
  48660. 'varying vec2 vUV;',
  48661. 'void main() {',
  48662. 'vUV = uvOffset + uv * uvScale;',
  48663. 'vec2 alignedPosition = position * scale;',
  48664. 'vec2 rotatedPosition;',
  48665. 'rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;',
  48666. 'rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;',
  48667. 'vec4 finalPosition;',
  48668. 'finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );',
  48669. 'finalPosition.xy += rotatedPosition;',
  48670. 'finalPosition = projectionMatrix * finalPosition;',
  48671. 'gl_Position = finalPosition;',
  48672. '}'
  48673. ].join('\n')
  48674. ),
  48675. I.shaderSource(
  48676. i,
  48677. [
  48678. 'precision ' + u.getPrecision() + ' float;',
  48679. 'uniform vec3 color;',
  48680. 'uniform sampler2D map;',
  48681. 'uniform float opacity;',
  48682. 'uniform int fogType;',
  48683. 'uniform vec3 fogColor;',
  48684. 'uniform float fogDensity;',
  48685. 'uniform float fogNear;',
  48686. 'uniform float fogFar;',
  48687. 'uniform float alphaTest;',
  48688. 'varying vec2 vUV;',
  48689. 'void main() {',
  48690. 'vec4 texture = texture2D( map, vUV );',
  48691. 'if ( texture.a < alphaTest ) discard;',
  48692. 'gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );',
  48693. 'if ( fogType > 0 ) {',
  48694. 'float depth = gl_FragCoord.z / gl_FragCoord.w;',
  48695. 'float fogFactor = 0.0;',
  48696. 'if ( fogType == 1 ) {',
  48697. 'fogFactor = smoothstep( fogNear, fogFar, depth );',
  48698. '} else {',
  48699. 'const float LOG2 = 1.442695;',
  48700. 'fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );',
  48701. 'fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );',
  48702. '}',
  48703. 'gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );',
  48704. '}',
  48705. '}'
  48706. ].join('\n')
  48707. ),
  48708. I.compileShader(t),
  48709. I.compileShader(i),
  48710. I.attachShader(e, t),
  48711. I.attachShader(e, i),
  48712. I.linkProgram(e),
  48713. e
  48714. )
  48715. })()),
  48716. (y = {
  48717. position: I.getAttribLocation(v, 'position'),
  48718. uv: I.getAttribLocation(v, 'uv')
  48719. }),
  48720. (A = {
  48721. uvOffset: I.getUniformLocation(v, 'uvOffset'),
  48722. uvScale: I.getUniformLocation(v, 'uvScale'),
  48723. rotation: I.getUniformLocation(v, 'rotation'),
  48724. scale: I.getUniformLocation(v, 'scale'),
  48725. color: I.getUniformLocation(v, 'color'),
  48726. map: I.getUniformLocation(v, 'map'),
  48727. opacity: I.getUniformLocation(v, 'opacity'),
  48728. modelViewMatrix: I.getUniformLocation(v, 'modelViewMatrix'),
  48729. projectionMatrix: I.getUniformLocation(v, 'projectionMatrix'),
  48730. fogType: I.getUniformLocation(v, 'fogType'),
  48731. fogDensity: I.getUniformLocation(v, 'fogDensity'),
  48732. fogNear: I.getUniformLocation(v, 'fogNear'),
  48733. fogFar: I.getUniformLocation(v, 'fogFar'),
  48734. fogColor: I.getUniformLocation(v, 'fogColor'),
  48735. alphaTest: I.getUniformLocation(v, 'alphaTest')
  48736. })
  48737. var i = document.createElement('canvas')
  48738. ;(i.width = 8), (i.height = 8)
  48739. var n = i.getContext('2d')
  48740. ;(n.fillStyle = 'white'), n.fillRect(0, 0, 8, 8), ((C = new Ci.Texture(i)).needsUpdate = !0)
  48741. }
  48742. function f(e, t) {
  48743. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  48744. }
  48745. var g,
  48746. m,
  48747. v,
  48748. y,
  48749. A,
  48750. C,
  48751. I = u.context,
  48752. E = u.state,
  48753. _ = new Ci.Vector3(),
  48754. b = new Ci.Quaternion(),
  48755. w = new Ci.Vector3()
  48756. this.render = function (e, t) {
  48757. if (0 !== d.length) {
  48758. void 0 === v && p(),
  48759. I.useProgram(v),
  48760. E.initAttributes(),
  48761. E.enableAttribute(y.position),
  48762. E.enableAttribute(y.uv),
  48763. E.disableUnusedAttributes(),
  48764. E.disable(I.CULL_FACE),
  48765. E.enable(I.BLEND),
  48766. I.bindBuffer(I.ARRAY_BUFFER, g),
  48767. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  48768. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  48769. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  48770. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  48771. E.activeTexture(I.TEXTURE0),
  48772. I.uniform1i(A.map, 0)
  48773. var i = 0,
  48774. n = 0,
  48775. r = e.fog
  48776. r
  48777. ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  48778. r instanceof Ci.Fog
  48779. ? (I.uniform1f(A.fogNear, r.near), I.uniform1f(A.fogFar, r.far), I.uniform1i(A.fogType, 1), (n = i = 1))
  48780. : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density), I.uniform1i(A.fogType, 2), (n = i = 2)))
  48781. : (I.uniform1i(A.fogType, 0), (n = i = 0))
  48782. for (var o = 0, a = d.length; o < a; o++) {
  48783. ;(l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld), (l.z = -l.modelViewMatrix.elements[14])
  48784. }
  48785. d.sort(f)
  48786. var s = []
  48787. for (o = 0, a = d.length; o < a; o++) {
  48788. var l,
  48789. c = (l = d[o]).material
  48790. 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)
  48791. var h = 0
  48792. e.fog && c.fog && (h = n),
  48793. i !== h && (I.uniform1i(A.fogType, h), (i = h)),
  48794. null !== c.map
  48795. ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y), I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y))
  48796. : (I.uniform2f(A.uvOffset, 0, 0), I.uniform2f(A.uvScale, 1, 1)),
  48797. I.uniform1f(A.opacity, c.opacity),
  48798. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  48799. I.uniform1f(A.rotation, c.rotation),
  48800. I.uniform2fv(A.scale, s),
  48801. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  48802. E.setDepthTest(c.depthTest),
  48803. E.setDepthWrite(c.depthWrite),
  48804. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  48805. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  48806. }
  48807. E.enable(I.CULL_FACE), u.resetGLState()
  48808. }
  48809. }
  48810. }),
  48811. Object.defineProperties(Ci.Box2.prototype, {
  48812. empty: {
  48813. value: function () {
  48814. return console.warn('THREE.Box2: .empty() has been renamed to .isEmpty().'), this.isEmpty()
  48815. }
  48816. },
  48817. isIntersectionBox: {
  48818. value: function (e) {
  48819. return console.warn('THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().'), this.intersectsBox(e)
  48820. }
  48821. }
  48822. }),
  48823. Object.defineProperties(Ci.Box3.prototype, {
  48824. empty: {
  48825. value: function () {
  48826. return console.warn('THREE.Box3: .empty() has been renamed to .isEmpty().'), this.isEmpty()
  48827. }
  48828. },
  48829. isIntersectionBox: {
  48830. value: function (e) {
  48831. return console.warn('THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().'), this.intersectsBox(e)
  48832. }
  48833. },
  48834. isIntersectionSphere: {
  48835. value: function (e) {
  48836. return console.warn('THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().'), this.intersectsSphere(e)
  48837. }
  48838. }
  48839. }),
  48840. Object.defineProperties(Ci.Matrix3.prototype, {
  48841. multiplyVector3: {
  48842. value: function (e) {
  48843. return console.warn('THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.'), e.applyMatrix3(this)
  48844. }
  48845. },
  48846. multiplyVector3Array: {
  48847. value: function (e) {
  48848. return console.warn('THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.'), this.applyToVector3Array(e)
  48849. }
  48850. }
  48851. }),
  48852. Object.defineProperties(Ci.Matrix4.prototype, {
  48853. extractPosition: {
  48854. value: function (e) {
  48855. return console.warn('THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().'), this.copyPosition(e)
  48856. }
  48857. },
  48858. setRotationFromQuaternion: {
  48859. value: function (e) {
  48860. return console.warn('THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().'), this.makeRotationFromQuaternion(e)
  48861. }
  48862. },
  48863. multiplyVector3: {
  48864. value: function (e) {
  48865. return console.warn('THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.'), e.applyProjection(this)
  48866. }
  48867. },
  48868. multiplyVector4: {
  48869. value: function (e) {
  48870. return console.warn('THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.'), e.applyMatrix4(this)
  48871. }
  48872. },
  48873. multiplyVector3Array: {
  48874. value: function (e) {
  48875. return console.warn('THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.'), this.applyToVector3Array(e)
  48876. }
  48877. },
  48878. rotateAxis: {
  48879. value: function (e) {
  48880. console.warn('THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.'), e.transformDirection(this)
  48881. }
  48882. },
  48883. crossVector: {
  48884. value: function (e) {
  48885. return console.warn('THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.'), e.applyMatrix4(this)
  48886. }
  48887. },
  48888. translate: {
  48889. value: function (e) {
  48890. console.error('THREE.Matrix4: .translate() has been removed.')
  48891. }
  48892. },
  48893. rotateX: {
  48894. value: function (e) {
  48895. console.error('THREE.Matrix4: .rotateX() has been removed.')
  48896. }
  48897. },
  48898. rotateY: {
  48899. value: function (e) {
  48900. console.error('THREE.Matrix4: .rotateY() has been removed.')
  48901. }
  48902. },
  48903. rotateZ: {
  48904. value: function (e) {
  48905. console.error('THREE.Matrix4: .rotateZ() has been removed.')
  48906. }
  48907. },
  48908. rotateByAxis: {
  48909. value: function (e, t) {
  48910. console.error('THREE.Matrix4: .rotateByAxis() has been removed.')
  48911. }
  48912. }
  48913. }),
  48914. Object.defineProperties(Ci.Plane.prototype, {
  48915. isIntersectionLine: {
  48916. value: function (e) {
  48917. return console.warn('THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().'), this.intersectsLine(e)
  48918. }
  48919. }
  48920. }),
  48921. Object.defineProperties(Ci.Quaternion.prototype, {
  48922. multiplyVector3: {
  48923. value: function (e) {
  48924. return console.warn('THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.'), e.applyQuaternion(this)
  48925. }
  48926. }
  48927. }),
  48928. Object.defineProperties(Ci.Ray.prototype, {
  48929. isIntersectionBox: {
  48930. value: function (e) {
  48931. return console.warn('THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().'), this.intersectsBox(e)
  48932. }
  48933. },
  48934. isIntersectionPlane: {
  48935. value: function (e) {
  48936. return console.warn('THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().'), this.intersectsPlane(e)
  48937. }
  48938. },
  48939. isIntersectionSphere: {
  48940. value: function (e) {
  48941. return console.warn('THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().'), this.intersectsSphere(e)
  48942. }
  48943. }
  48944. }),
  48945. Object.defineProperties(Ci.Vector3.prototype, {
  48946. setEulerFromRotationMatrix: {
  48947. value: function () {
  48948. console.error('THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.')
  48949. }
  48950. },
  48951. setEulerFromQuaternion: {
  48952. value: function () {
  48953. console.error('THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.')
  48954. }
  48955. },
  48956. getPositionFromMatrix: {
  48957. value: function (e) {
  48958. return console.warn('THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().'), this.setFromMatrixPosition(e)
  48959. }
  48960. },
  48961. getScaleFromMatrix: {
  48962. value: function (e) {
  48963. return console.warn('THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().'), this.setFromMatrixScale(e)
  48964. }
  48965. },
  48966. getColumnFromMatrix: {
  48967. value: function (e, t) {
  48968. return console.warn('THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().'), this.setFromMatrixColumn(e, t)
  48969. }
  48970. }
  48971. }),
  48972. (Ci.Face4 = function (e, t, i, n, r, o, a) {
  48973. return console.warn('THREE.Face4 has been removed. A THREE.Face3 will be created instead.'), new Ci.Face3(e, t, i, r, o, a)
  48974. }),
  48975. (Ci.Vertex = function (e, t, i) {
  48976. return console.warn('THREE.Vertex has been removed. Use THREE.Vector3 instead.'), new Ci.Vector3(e, t, i)
  48977. }),
  48978. Object.defineProperties(Ci.Object3D.prototype, {
  48979. eulerOrder: {
  48980. get: function () {
  48981. return console.warn('THREE.Object3D: .eulerOrder is now .rotation.order.'), this.rotation.order
  48982. },
  48983. set: function (e) {
  48984. console.warn('THREE.Object3D: .eulerOrder is now .rotation.order.'), (this.rotation.order = e)
  48985. }
  48986. },
  48987. getChildByName: {
  48988. value: function (e) {
  48989. return console.warn('THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().'), this.getObjectByName(e)
  48990. }
  48991. },
  48992. renderDepth: {
  48993. set: function (e) {
  48994. console.warn('THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.')
  48995. }
  48996. },
  48997. translate: {
  48998. value: function (e, t) {
  48999. return console.warn('THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.'), this.translateOnAxis(t, e)
  49000. }
  49001. },
  49002. useQuaternion: {
  49003. get: function () {
  49004. console.warn('THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.')
  49005. },
  49006. set: function (e) {
  49007. console.warn('THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.')
  49008. }
  49009. }
  49010. }),
  49011. Object.defineProperties(Ci, {
  49012. PointCloud: {
  49013. value: function (e, t) {
  49014. return console.warn('THREE.PointCloud has been renamed to THREE.Points.'), new Ci.Points(e, t)
  49015. }
  49016. },
  49017. ParticleSystem: {
  49018. value: function (e, t) {
  49019. return console.warn('THREE.ParticleSystem has been renamed to THREE.Points.'), new Ci.Points(e, t)
  49020. }
  49021. }
  49022. }),
  49023. Object.defineProperties(Ci.Light.prototype, {
  49024. onlyShadow: {
  49025. set: function (e) {
  49026. console.warn('THREE.Light: .onlyShadow has been removed.')
  49027. }
  49028. },
  49029. shadowCameraFov: {
  49030. set: function (e) {
  49031. console.warn('THREE.Light: .shadowCameraFov is now .shadow.camera.fov.'), (this.shadow.camera.fov = e)
  49032. }
  49033. },
  49034. shadowCameraLeft: {
  49035. set: function (e) {
  49036. console.warn('THREE.Light: .shadowCameraLeft is now .shadow.camera.left.'), (this.shadow.camera.left = e)
  49037. }
  49038. },
  49039. shadowCameraRight: {
  49040. set: function (e) {
  49041. console.warn('THREE.Light: .shadowCameraRight is now .shadow.camera.right.'), (this.shadow.camera.right = e)
  49042. }
  49043. },
  49044. shadowCameraTop: {
  49045. set: function (e) {
  49046. console.warn('THREE.Light: .shadowCameraTop is now .shadow.camera.top.'), (this.shadow.camera.top = e)
  49047. }
  49048. },
  49049. shadowCameraBottom: {
  49050. set: function (e) {
  49051. console.warn('THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.'), (this.shadow.camera.bottom = e)
  49052. }
  49053. },
  49054. shadowCameraNear: {
  49055. set: function (e) {
  49056. console.warn('THREE.Light: .shadowCameraNear is now .shadow.camera.near.'), (this.shadow.camera.near = e)
  49057. }
  49058. },
  49059. shadowCameraFar: {
  49060. set: function (e) {
  49061. console.warn('THREE.Light: .shadowCameraFar is now .shadow.camera.far.'), (this.shadow.camera.far = e)
  49062. }
  49063. },
  49064. shadowCameraVisible: {
  49065. set: function (e) {
  49066. console.warn('THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.')
  49067. }
  49068. },
  49069. shadowBias: {
  49070. set: function (e) {
  49071. console.warn('THREE.Light: .shadowBias is now .shadow.bias.'), (this.shadow.bias = e)
  49072. }
  49073. },
  49074. shadowDarkness: {
  49075. set: function (e) {
  49076. console.warn('THREE.Light: .shadowDarkness has been removed.')
  49077. }
  49078. },
  49079. shadowMapWidth: {
  49080. set: function (e) {
  49081. console.warn('THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.'), (this.shadow.mapSize.width = e)
  49082. }
  49083. },
  49084. shadowMapHeight: {
  49085. set: function (e) {
  49086. console.warn('THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.'), (this.shadow.mapSize.height = e)
  49087. }
  49088. }
  49089. }),
  49090. Object.defineProperties(Ci.BufferAttribute.prototype, {
  49091. length: {
  49092. get: function () {
  49093. return console.warn('THREE.BufferAttribute: .length has been deprecated. Please use .count.'), this.array.length
  49094. }
  49095. }
  49096. }),
  49097. Object.defineProperties(Ci.BufferGeometry.prototype, {
  49098. drawcalls: {
  49099. get: function () {
  49100. return console.error('THREE.BufferGeometry: .drawcalls has been renamed to .groups.'), this.groups
  49101. }
  49102. },
  49103. offsets: {
  49104. get: function () {
  49105. return console.warn('THREE.BufferGeometry: .offsets has been renamed to .groups.'), this.groups
  49106. }
  49107. },
  49108. addIndex: {
  49109. value: function (e) {
  49110. console.warn('THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().'), this.setIndex(e)
  49111. }
  49112. },
  49113. addDrawCall: {
  49114. value: function (e, t, i) {
  49115. void 0 !== i && console.warn('THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.'),
  49116. console.warn('THREE.BufferGeometry: .addDrawCall() is now .addGroup().'),
  49117. this.addGroup(e, t)
  49118. }
  49119. },
  49120. clearDrawCalls: {
  49121. value: function () {
  49122. console.warn('THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().'), this.clearGroups()
  49123. }
  49124. },
  49125. computeTangents: {
  49126. value: function () {
  49127. console.warn('THREE.BufferGeometry: .computeTangents() has been removed.')
  49128. }
  49129. },
  49130. computeOffsets: {
  49131. value: function () {
  49132. console.warn('THREE.BufferGeometry: .computeOffsets() has been removed.')
  49133. }
  49134. }
  49135. }),
  49136. Object.defineProperties(Ci.Material.prototype, {
  49137. wrapAround: {
  49138. get: function () {
  49139. console.warn('THREE.' + this.type + ': .wrapAround has been removed.')
  49140. },
  49141. set: function (e) {
  49142. console.warn('THREE.' + this.type + ': .wrapAround has been removed.')
  49143. }
  49144. },
  49145. wrapRGB: {
  49146. get: function () {
  49147. return console.warn('THREE.' + this.type + ': .wrapRGB has been removed.'), new Ci.Color()
  49148. }
  49149. }
  49150. }),
  49151. Object.defineProperties(Ci, {
  49152. PointCloudMaterial: {
  49153. value: function (e) {
  49154. return console.warn('THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.'), new Ci.PointsMaterial(e)
  49155. }
  49156. },
  49157. ParticleBasicMaterial: {
  49158. value: function (e) {
  49159. return console.warn('THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.'), new Ci.PointsMaterial(e)
  49160. }
  49161. },
  49162. ParticleSystemMaterial: {
  49163. value: function (e) {
  49164. return console.warn('THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.'), new Ci.PointsMaterial(e)
  49165. }
  49166. }
  49167. }),
  49168. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  49169. metal: {
  49170. get: function () {
  49171. return console.warn('THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.'), !1
  49172. },
  49173. set: function (e) {
  49174. console.warn('THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead')
  49175. }
  49176. }
  49177. }),
  49178. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  49179. derivatives: {
  49180. get: function () {
  49181. return console.warn('THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.'), this.extensions.derivatives
  49182. },
  49183. set: function (e) {
  49184. console.warn('THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.'), (this.extensions.derivatives = e)
  49185. }
  49186. }
  49187. }),
  49188. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  49189. supportsFloatTextures: {
  49190. value: function () {
  49191. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."), this.extensions.get('OES_texture_float')
  49192. }
  49193. },
  49194. supportsHalfFloatTextures: {
  49195. value: function () {
  49196. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."), this.extensions.get('OES_texture_half_float')
  49197. }
  49198. },
  49199. supportsStandardDerivatives: {
  49200. value: function () {
  49201. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."), this.extensions.get('OES_standard_derivatives')
  49202. }
  49203. },
  49204. supportsCompressedTextureS3TC: {
  49205. value: function () {
  49206. return (
  49207. console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  49208. this.extensions.get('WEBGL_compressed_texture_s3tc')
  49209. )
  49210. }
  49211. },
  49212. supportsCompressedTexturePVRTC: {
  49213. value: function () {
  49214. return (
  49215. console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  49216. this.extensions.get('WEBGL_compressed_texture_pvrtc')
  49217. )
  49218. }
  49219. },
  49220. supportsBlendMinMax: {
  49221. value: function () {
  49222. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."), this.extensions.get('EXT_blend_minmax')
  49223. }
  49224. },
  49225. supportsVertexTextures: {
  49226. value: function () {
  49227. return this.capabilities.vertexTextures
  49228. }
  49229. },
  49230. supportsInstancedArrays: {
  49231. value: function () {
  49232. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."), this.extensions.get('ANGLE_instanced_arrays')
  49233. }
  49234. },
  49235. enableScissorTest: {
  49236. value: function (e) {
  49237. console.warn('THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().'), this.setScissorTest(e)
  49238. }
  49239. },
  49240. initMaterial: {
  49241. value: function () {
  49242. console.warn('THREE.WebGLRenderer: .initMaterial() has been removed.')
  49243. }
  49244. },
  49245. addPrePlugin: {
  49246. value: function () {
  49247. console.warn('THREE.WebGLRenderer: .addPrePlugin() has been removed.')
  49248. }
  49249. },
  49250. addPostPlugin: {
  49251. value: function () {
  49252. console.warn('THREE.WebGLRenderer: .addPostPlugin() has been removed.')
  49253. }
  49254. },
  49255. updateShadowMap: {
  49256. value: function () {
  49257. console.warn('THREE.WebGLRenderer: .updateShadowMap() has been removed.')
  49258. }
  49259. },
  49260. shadowMapEnabled: {
  49261. get: function () {
  49262. return this.shadowMap.enabled
  49263. },
  49264. set: function (e) {
  49265. console.warn('THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.'), (this.shadowMap.enabled = e)
  49266. }
  49267. },
  49268. shadowMapType: {
  49269. get: function () {
  49270. return this.shadowMap.type
  49271. },
  49272. set: function (e) {
  49273. console.warn('THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.'), (this.shadowMap.type = e)
  49274. }
  49275. },
  49276. shadowMapCullFace: {
  49277. get: function () {
  49278. return this.shadowMap.cullFace
  49279. },
  49280. set: function (e) {
  49281. console.warn('THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.'), (this.shadowMap.cullFace = e)
  49282. }
  49283. }
  49284. }),
  49285. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  49286. wrapS: {
  49287. get: function () {
  49288. return console.warn('THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.'), this.texture.wrapS
  49289. },
  49290. set: function (e) {
  49291. console.warn('THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.'), (this.texture.wrapS = e)
  49292. }
  49293. },
  49294. wrapT: {
  49295. get: function () {
  49296. return console.warn('THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.'), this.texture.wrapT
  49297. },
  49298. set: function (e) {
  49299. console.warn('THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.'), (this.texture.wrapT = e)
  49300. }
  49301. },
  49302. magFilter: {
  49303. get: function () {
  49304. return console.warn('THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.'), this.texture.magFilter
  49305. },
  49306. set: function (e) {
  49307. console.warn('THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.'), (this.texture.magFilter = e)
  49308. }
  49309. },
  49310. minFilter: {
  49311. get: function () {
  49312. return console.warn('THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.'), this.texture.minFilter
  49313. },
  49314. set: function (e) {
  49315. console.warn('THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.'), (this.texture.minFilter = e)
  49316. }
  49317. },
  49318. anisotropy: {
  49319. get: function () {
  49320. return console.warn('THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.'), this.texture.anisotropy
  49321. },
  49322. set: function (e) {
  49323. console.warn('THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.'), (this.texture.anisotropy = e)
  49324. }
  49325. },
  49326. offset: {
  49327. get: function () {
  49328. return console.warn('THREE.WebGLRenderTarget: .offset is now .texture.offset.'), this.texture.offset
  49329. },
  49330. set: function (e) {
  49331. console.warn('THREE.WebGLRenderTarget: .offset is now .texture.offset.'), (this.texture.offset = e)
  49332. }
  49333. },
  49334. repeat: {
  49335. get: function () {
  49336. return console.warn('THREE.WebGLRenderTarget: .repeat is now .texture.repeat.'), this.texture.repeat
  49337. },
  49338. set: function (e) {
  49339. console.warn('THREE.WebGLRenderTarget: .repeat is now .texture.repeat.'), (this.texture.repeat = e)
  49340. }
  49341. },
  49342. format: {
  49343. get: function () {
  49344. return console.warn('THREE.WebGLRenderTarget: .format is now .texture.format.'), this.texture.format
  49345. },
  49346. set: function (e) {
  49347. console.warn('THREE.WebGLRenderTarget: .format is now .texture.format.'), (this.texture.format = e)
  49348. }
  49349. },
  49350. type: {
  49351. get: function () {
  49352. return console.warn('THREE.WebGLRenderTarget: .type is now .texture.type.'), this.texture.type
  49353. },
  49354. set: function (e) {
  49355. console.warn('THREE.WebGLRenderTarget: .type is now .texture.type.'), (this.texture.type = e)
  49356. }
  49357. },
  49358. generateMipmaps: {
  49359. get: function () {
  49360. return console.warn('THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.'), this.texture.generateMipmaps
  49361. },
  49362. set: function (e) {
  49363. console.warn('THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.'), (this.texture.generateMipmaps = e)
  49364. }
  49365. }
  49366. }),
  49367. (Ci.GeometryUtils = {
  49368. merge: function (e, t, i) {
  49369. var n
  49370. console.warn('THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.'),
  49371. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(), (n = t.matrix), (t = t.geometry)),
  49372. e.merge(t, n, i)
  49373. },
  49374. center: function (e) {
  49375. return console.warn('THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.'), e.center()
  49376. }
  49377. }),
  49378. (Ci.ImageUtils = {
  49379. crossOrigin: void 0,
  49380. loadTexture: function (e, t, i, n) {
  49381. console.warn('THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.')
  49382. var r = new Ci.TextureLoader()
  49383. r.setCrossOrigin(this.crossOrigin)
  49384. var o = r.load(e, i, void 0, n)
  49385. return t && (o.mapping = t), o
  49386. },
  49387. loadTextureCube: function (e, t, i, n) {
  49388. console.warn('THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.')
  49389. var r = new Ci.CubeTextureLoader()
  49390. r.setCrossOrigin(this.crossOrigin)
  49391. var o = r.load(e, i, void 0, n)
  49392. return t && (o.mapping = t), o
  49393. },
  49394. loadCompressedTexture: function () {
  49395. console.error('THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.')
  49396. },
  49397. loadCompressedTextureCube: function () {
  49398. console.error('THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.')
  49399. }
  49400. }),
  49401. (Ci.Projector = function () {
  49402. console.error('THREE.Projector has been moved to /examples/js/renderers/Projector.js.'),
  49403. (this.projectVector = function (e, t) {
  49404. console.warn('THREE.Projector: .projectVector() is now vector.project().'), e.project(t)
  49405. }),
  49406. (this.unprojectVector = function (e, t) {
  49407. console.warn('THREE.Projector: .unprojectVector() is now vector.unproject().'), e.unproject(t)
  49408. }),
  49409. (this.pickingRay = function (e, t) {
  49410. console.error('THREE.Projector: .pickingRay() is now raycaster.setFromCamera().')
  49411. })
  49412. }),
  49413. (Ci.CanvasRenderer = function () {
  49414. console.error('THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js'),
  49415. (this.domElement = document.createElement('canvas')),
  49416. (this.clear = function () {}),
  49417. (this.render = function () {}),
  49418. (this.setClearColor = function () {}),
  49419. (this.setSize = function () {})
  49420. }),
  49421. (Ci.MeshFaceMaterial = Ci.MultiMaterial),
  49422. (Ci.CurveUtils = {
  49423. tangentQuadraticBezier: function (e, t, i, n) {
  49424. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  49425. },
  49426. tangentCubicBezier: function (e, t, i, n, r) {
  49427. 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
  49428. },
  49429. tangentSpline: function (e, t, i, n, r) {
  49430. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  49431. },
  49432. interpolate: function (e, t, i, n, r) {
  49433. var o = 0.5 * (i - e),
  49434. a = 0.5 * (n - t),
  49435. s = r * r
  49436. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  49437. }
  49438. }),
  49439. (Ci.SceneUtils = {
  49440. createMultiMaterialObject: function (e, t) {
  49441. for (var i = new Ci.Group(), n = 0, r = t.length; n < r; n++) i.add(new Ci.Mesh(e, t[n]))
  49442. return i
  49443. },
  49444. detach: function (e, t, i) {
  49445. e.applyMatrix(t.matrixWorld), t.remove(e), i.add(e)
  49446. },
  49447. attach: function (e, t, i) {
  49448. var n = new Ci.Matrix4()
  49449. n.getInverse(i.matrixWorld), e.applyMatrix(n), t.remove(e), i.add(e)
  49450. }
  49451. }),
  49452. (Ci.ShapeUtils = {
  49453. area: function (e) {
  49454. 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
  49455. return 0.5 * i
  49456. },
  49457. triangulate: function (e, t) {
  49458. var i = e.length
  49459. if (i < 3) return null
  49460. var n,
  49461. r,
  49462. o,
  49463. a = [],
  49464. s = [],
  49465. l = []
  49466. if (0 < Ci.ShapeUtils.area(e)) for (r = 0; r < i; r++) s[r] = r
  49467. else for (r = 0; r < i; r++) s[r] = i - 1 - r
  49468. var c = i,
  49469. h = 2 * c
  49470. for (r = c - 1; 2 < c; ) {
  49471. if (h-- <= 0) return console.warn('THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()'), t ? l : a
  49472. 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))) {
  49473. var u, d, p, f, g
  49474. 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]
  49475. h = 2 * --c
  49476. }
  49477. }
  49478. return t ? l : a
  49479. },
  49480. triangulateShape: function (e, t) {
  49481. function w(e, t, i) {
  49482. 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
  49483. }
  49484. function b(e, t, i, n, r) {
  49485. var o = t.x - e.x,
  49486. a = t.y - e.y,
  49487. s = n.x - i.x,
  49488. l = n.y - i.y,
  49489. c = e.x - i.x,
  49490. h = e.y - i.y,
  49491. u = a * s - o * l,
  49492. d = a * c - o * h
  49493. if (Math.abs(u) > Number.EPSILON) {
  49494. var p
  49495. if (0 < u) {
  49496. if (d < 0 || u < d) return []
  49497. if ((p = l * c - s * h) < 0 || u < p) return []
  49498. } else {
  49499. if (0 < d || d < u) return []
  49500. if (0 < (p = l * c - s * h) || p < u) return []
  49501. }
  49502. if (0 === p) return !r || (0 != d && d != u) ? [e] : []
  49503. if (p === u) return !r || (0 != d && d != u) ? [t] : []
  49504. if (0 == d) return [i]
  49505. if (d == u) return [n]
  49506. var f = p / u
  49507. return [
  49508. {
  49509. x: e.x + f * o,
  49510. y: e.y + f * a
  49511. }
  49512. ]
  49513. }
  49514. if (0 != d || l * c != s * h) return []
  49515. var g,
  49516. m,
  49517. v,
  49518. y,
  49519. A,
  49520. C,
  49521. I,
  49522. E,
  49523. _ = 0 == o && 0 == a,
  49524. b = 0 == s && 0 == l
  49525. return _ && b
  49526. ? e.x !== i.x || e.y !== i.y
  49527. ? []
  49528. : [e]
  49529. : _
  49530. ? w(i, n, e)
  49531. ? [e]
  49532. : []
  49533. : b
  49534. ? w(e, t, i)
  49535. ? [i]
  49536. : []
  49537. : ((E =
  49538. 0 != o
  49539. ? ((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))
  49540. : ((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))),
  49541. 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])
  49542. }
  49543. function T(e, t, i, n) {
  49544. var r = t.x - e.x,
  49545. o = t.y - e.y,
  49546. a = i.x - e.x,
  49547. s = i.y - e.y,
  49548. l = n.x - e.x,
  49549. c = n.y - e.y,
  49550. h = r * s - o * a,
  49551. u = r * c - o * l
  49552. if (Math.abs(h) > Number.EPSILON) {
  49553. var d = l * s - c * a
  49554. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  49555. }
  49556. return 0 < u
  49557. }
  49558. 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])
  49559. 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)
  49560. var d = (function (e, a) {
  49561. function t(e, t) {
  49562. var i = m.length - 1,
  49563. n = e - 1
  49564. n < 0 && (n = i)
  49565. var r = e + 1
  49566. i < r && (r = 0)
  49567. var o = T(m[e], m[n], m[r], c[t])
  49568. if (!o) return !1
  49569. var a = c.length - 1,
  49570. s = t - 1
  49571. s < 0 && (s = a)
  49572. var l = t + 1
  49573. return a < l && (l = 0), !!(o = T(c[t], c[s], c[l], m[e]))
  49574. }
  49575. function i(e, t) {
  49576. var i, n
  49577. 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
  49578. return !1
  49579. }
  49580. function n(e, t) {
  49581. var i, n, r, o
  49582. 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
  49583. return !1
  49584. }
  49585. 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)
  49586. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  49587. if (--E < 0) {
  49588. console.log('Infinite Loop! Holes left:' + v.length + ', Probably Hole outside Shape!')
  49589. break
  49590. }
  49591. for (o = I; o < m.length; o++) {
  49592. ;(s = m[o]), (r = -1)
  49593. for (A = 0; A < v.length; A++)
  49594. if (((h = v[A]), void 0 === y[(u = s.x + ':' + s.y + ':' + h)])) {
  49595. c = a[h]
  49596. for (var _ = 0; _ < c.length; _++)
  49597. if (((l = c[_]), t(o, _) && !i(s, l) && !n(s, l))) {
  49598. ;(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)
  49599. break
  49600. }
  49601. if (0 <= r) break
  49602. y[u] = !0
  49603. }
  49604. if (0 <= r) break
  49605. }
  49606. }
  49607. return m
  49608. })(e, t),
  49609. p = Ci.ShapeUtils.triangulate(d, !1)
  49610. 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)
  49611. return p.concat()
  49612. },
  49613. isClockWise: function (e) {
  49614. return Ci.ShapeUtils.area(e) < 0
  49615. },
  49616. b2: function (e, t, i, n) {
  49617. return (
  49618. (function (e, t) {
  49619. var i = 1 - e
  49620. return i * i * t
  49621. })(e, t) +
  49622. (function (e, t) {
  49623. return 2 * (1 - e) * e * t
  49624. })(e, i) +
  49625. (function (e, t) {
  49626. return e * e * t
  49627. })(e, n)
  49628. )
  49629. },
  49630. b3: function (e, t, i, n, r) {
  49631. return (
  49632. (function (e, t) {
  49633. var i = 1 - e
  49634. return i * i * i * t
  49635. })(e, t) +
  49636. (function (e, t) {
  49637. var i = 1 - e
  49638. return 3 * i * i * e * t
  49639. })(e, i) +
  49640. (function (e, t) {
  49641. return 3 * (1 - e) * e * e * t
  49642. })(e, n) +
  49643. (function (e, t) {
  49644. return e * e * e * t
  49645. })(e, r)
  49646. )
  49647. }
  49648. }),
  49649. (Ci.Curve = function () {}),
  49650. (Ci.Curve.prototype = {
  49651. constructor: Ci.Curve,
  49652. getPoint: function (e) {
  49653. return console.warn('THREE.Curve: Warning, getPoint() not implemented!'), null
  49654. },
  49655. getPointAt: function (e) {
  49656. var t = this.getUtoTmapping(e)
  49657. return this.getPoint(t)
  49658. },
  49659. getPoints: function (e) {
  49660. e = e || 5
  49661. var t,
  49662. i = []
  49663. for (t = 0; t <= e; t++) i.push(this.getPoint(t / e))
  49664. return i
  49665. },
  49666. getSpacedPoints: function (e) {
  49667. e = e || 5
  49668. var t,
  49669. i = []
  49670. for (t = 0; t <= e; t++) i.push(this.getPointAt(t / e))
  49671. return i
  49672. },
  49673. getLength: function () {
  49674. var e = this.getLengths()
  49675. return e[e.length - 1]
  49676. },
  49677. getLengths: function (e) {
  49678. if (((e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200)), this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate))
  49679. return this.cacheArcLengths
  49680. this.needsUpdate = !1
  49681. var t,
  49682. i,
  49683. n = [],
  49684. r = this.getPoint(0),
  49685. o = 0
  49686. for (n.push(0), i = 1; i <= e; i++) (o += (t = this.getPoint(i / e)).distanceTo(r)), n.push(o), (r = t)
  49687. return (this.cacheArcLengths = n)
  49688. },
  49689. updateArcLengths: function () {
  49690. ;(this.needsUpdate = !0), this.getLengths()
  49691. },
  49692. getUtoTmapping: function (e, t) {
  49693. var i,
  49694. n = this.getLengths(),
  49695. r = 0,
  49696. o = n.length
  49697. i = t || e * n[o - 1]
  49698. for (var a, s = 0, l = o - 1; s <= l; )
  49699. if ((a = n[(r = Math.floor(s + (l - s) / 2))] - i) < 0) s = r + 1
  49700. else {
  49701. if (!(0 < a)) {
  49702. l = r
  49703. break
  49704. }
  49705. l = r - 1
  49706. }
  49707. if (n[(r = l)] === i) return r / (o - 1)
  49708. var c = n[r]
  49709. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  49710. },
  49711. getTangent: function (e) {
  49712. var t = e - 1e-4,
  49713. i = e + 1e-4
  49714. t < 0 && (t = 0), 1 < i && (i = 1)
  49715. var n = this.getPoint(t)
  49716. return this.getPoint(i).clone().sub(n).normalize()
  49717. },
  49718. getTangentAt: function (e) {
  49719. var t = this.getUtoTmapping(e)
  49720. return this.getTangent(t)
  49721. }
  49722. }),
  49723. (Ci.Curve.create = function (e, t) {
  49724. return (e.prototype = Object.create(Ci.Curve.prototype)), ((e.prototype.constructor = e).prototype.getPoint = t), e
  49725. }),
  49726. (Ci.CurvePath = function () {
  49727. ;(this.curves = []), (this.autoClose = !1)
  49728. }),
  49729. (Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype)),
  49730. (Ci.CurvePath.prototype.constructor = Ci.CurvePath),
  49731. (Ci.CurvePath.prototype.add = function (e) {
  49732. this.curves.push(e)
  49733. }),
  49734. (Ci.CurvePath.prototype.closePath = function () {
  49735. var e = this.curves[0].getPoint(0),
  49736. t = this.curves[this.curves.length - 1].getPoint(1)
  49737. e.equals(t) || this.curves.push(new Ci.LineCurve(t, e))
  49738. }),
  49739. (Ci.CurvePath.prototype.getPoint = function (e) {
  49740. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  49741. if (i[n] >= t) {
  49742. var r = i[n] - t,
  49743. o = this.curves[n],
  49744. a = 1 - r / o.getLength()
  49745. return o.getPointAt(a)
  49746. }
  49747. n++
  49748. }
  49749. return null
  49750. }),
  49751. (Ci.CurvePath.prototype.getLength = function () {
  49752. var e = this.getCurveLengths()
  49753. return e[e.length - 1]
  49754. }),
  49755. (Ci.CurvePath.prototype.getCurveLengths = function () {
  49756. if (this.cacheLengths && this.cacheLengths.length === this.curves.length) return this.cacheLengths
  49757. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++) (t += this.curves[i].getLength()), e.push(t)
  49758. return (this.cacheLengths = e)
  49759. }),
  49760. (Ci.CurvePath.prototype.createPointsGeometry = function (e) {
  49761. var t = this.getPoints(e)
  49762. return this.createGeometry(t)
  49763. }),
  49764. (Ci.CurvePath.prototype.createSpacedPointsGeometry = function (e) {
  49765. var t = this.getSpacedPoints(e)
  49766. return this.createGeometry(t)
  49767. }),
  49768. (Ci.CurvePath.prototype.createGeometry = function (e) {
  49769. for (var t = new Ci.Geometry(), i = 0, n = e.length; i < n; i++) {
  49770. var r = e[i]
  49771. t.vertices.push(new Ci.Vector3(r.x, r.y, r.z || 0))
  49772. }
  49773. return t
  49774. }),
  49775. (Ci.Font = function (e) {
  49776. this.data = e
  49777. }),
  49778. (Ci.Font.prototype = {
  49779. constructor: Ci.Font,
  49780. generateShapes: function (e, s, b) {
  49781. function l(e, t, i) {
  49782. var n = w.glyphs[e] || w.glyphs['?']
  49783. if (n) {
  49784. var r,
  49785. o,
  49786. a,
  49787. s,
  49788. l,
  49789. c,
  49790. h,
  49791. u,
  49792. d,
  49793. p,
  49794. f,
  49795. g = new Ci.Path(),
  49796. m = [],
  49797. v = Ci.ShapeUtils.b2,
  49798. y = Ci.ShapeUtils.b3
  49799. if (n.o)
  49800. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(' ')), C = 0, I = A.length; C < I; ) {
  49801. switch (A[C++]) {
  49802. case 'm':
  49803. ;(r = A[C++] * t + i), (o = A[C++] * t), g.moveTo(r, o)
  49804. break
  49805. case 'l':
  49806. ;(r = A[C++] * t + i), (o = A[C++] * t), g.lineTo(r, o)
  49807. break
  49808. case 'q':
  49809. 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]))) {
  49810. ;(l = f.x), (c = f.y)
  49811. for (var E = 1; E <= b; E++) {
  49812. v((_ = E / b), l, h, a), v(_, c, u, s)
  49813. }
  49814. }
  49815. break
  49816. case 'b':
  49817. if (
  49818. ((a = A[C++] * t + i),
  49819. (s = A[C++] * t),
  49820. (h = A[C++] * t + i),
  49821. (u = A[C++] * t),
  49822. (d = A[C++] * t + i),
  49823. (p = A[C++] * t),
  49824. g.bezierCurveTo(h, u, d, p, a, s),
  49825. (f = m[m.length - 1]))
  49826. ) {
  49827. ;(l = f.x), (c = f.y)
  49828. for (E = 1; E <= b; E++) {
  49829. var _
  49830. y((_ = E / b), l, h, d, a), y(_, c, u, p, s)
  49831. }
  49832. }
  49833. }
  49834. }
  49835. return {
  49836. offset: n.ha * t,
  49837. path: g
  49838. }
  49839. }
  49840. }
  49841. void 0 === s && (s = 100), void 0 === b && (b = 4)
  49842. for (
  49843. var w = this.data,
  49844. t = (function (e) {
  49845. for (var t = String(e).split(''), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  49846. var a = l(t[o], i, n)
  49847. ;(n += a.offset), r.push(a.path)
  49848. }
  49849. return r
  49850. })(e),
  49851. i = [],
  49852. n = 0,
  49853. r = t.length;
  49854. n < r;
  49855. n++
  49856. )
  49857. Array.prototype.push.apply(i, t[n].toShapes())
  49858. return i
  49859. }
  49860. }),
  49861. (Ci.Path = function (e) {
  49862. Ci.CurvePath.call(this), (this.actions = []), e && this.fromPoints(e)
  49863. }),
  49864. (Ci.Path.prototype = Object.create(Ci.CurvePath.prototype)),
  49865. (Ci.Path.prototype.constructor = Ci.Path),
  49866. (Ci.Path.prototype.fromPoints = function (e) {
  49867. this.moveTo(e[0].x, e[0].y)
  49868. for (var t = 1, i = e.length; t < i; t++) this.lineTo(e[t].x, e[t].y)
  49869. }),
  49870. (Ci.Path.prototype.moveTo = function (e, t) {
  49871. this.actions.push({
  49872. action: 'moveTo',
  49873. args: [e, t]
  49874. })
  49875. }),
  49876. (Ci.Path.prototype.lineTo = function (e, t) {
  49877. var i = this.actions[this.actions.length - 1].args,
  49878. n = i[i.length - 2],
  49879. r = i[i.length - 1],
  49880. o = new Ci.LineCurve(new Ci.Vector2(n, r), new Ci.Vector2(e, t))
  49881. this.curves.push(o),
  49882. this.actions.push({
  49883. action: 'lineTo',
  49884. args: [e, t]
  49885. })
  49886. }),
  49887. (Ci.Path.prototype.quadraticCurveTo = function (e, t, i, n) {
  49888. var r = this.actions[this.actions.length - 1].args,
  49889. o = r[r.length - 2],
  49890. a = r[r.length - 1],
  49891. s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o, a), new Ci.Vector2(e, t), new Ci.Vector2(i, n))
  49892. this.curves.push(s),
  49893. this.actions.push({
  49894. action: 'quadraticCurveTo',
  49895. args: [e, t, i, n]
  49896. })
  49897. }),
  49898. (Ci.Path.prototype.bezierCurveTo = function (e, t, i, n, r, o) {
  49899. var a = this.actions[this.actions.length - 1].args,
  49900. s = a[a.length - 2],
  49901. l = a[a.length - 1],
  49902. c = new Ci.CubicBezierCurve(new Ci.Vector2(s, l), new Ci.Vector2(e, t), new Ci.Vector2(i, n), new Ci.Vector2(r, o))
  49903. this.curves.push(c),
  49904. this.actions.push({
  49905. action: 'bezierCurveTo',
  49906. args: [e, t, i, n, r, o]
  49907. })
  49908. }),
  49909. (Ci.Path.prototype.splineThru = function (e) {
  49910. var t = Array.prototype.slice.call(arguments),
  49911. i = this.actions[this.actions.length - 1].args,
  49912. n = i[i.length - 2],
  49913. r = i[i.length - 1],
  49914. o = [new Ci.Vector2(n, r)]
  49915. Array.prototype.push.apply(o, e)
  49916. var a = new Ci.SplineCurve(o)
  49917. this.curves.push(a),
  49918. this.actions.push({
  49919. action: 'splineThru',
  49920. args: t
  49921. })
  49922. }),
  49923. (Ci.Path.prototype.arc = function (e, t, i, n, r, o) {
  49924. var a = this.actions[this.actions.length - 1].args,
  49925. s = a[a.length - 2],
  49926. l = a[a.length - 1]
  49927. this.absarc(e + s, t + l, i, n, r, o)
  49928. }),
  49929. (Ci.Path.prototype.absarc = function (e, t, i, n, r, o) {
  49930. this.absellipse(e, t, i, i, n, r, o)
  49931. }),
  49932. (Ci.Path.prototype.ellipse = function (e, t, i, n, r, o, a, s) {
  49933. var l = this.actions[this.actions.length - 1].args,
  49934. c = l[l.length - 2],
  49935. h = l[l.length - 1]
  49936. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  49937. }),
  49938. (Ci.Path.prototype.absellipse = function (e, t, i, n, r, o, a, s) {
  49939. var l = [e, t, i, n, r, o, a, s || 0],
  49940. c = new Ci.EllipseCurve(e, t, i, n, r, o, a, s)
  49941. this.curves.push(c)
  49942. var h = c.getPoint(1)
  49943. l.push(h.x),
  49944. l.push(h.y),
  49945. this.actions.push({
  49946. action: 'ellipse',
  49947. args: l
  49948. })
  49949. }),
  49950. (Ci.Path.prototype.getSpacedPoints = function (e) {
  49951. e = e || 40
  49952. for (var t = [], i = 0; i < e; i++) t.push(this.getPoint(i / e))
  49953. return this.autoClose && t.push(t[0]), t
  49954. }),
  49955. (Ci.Path.prototype.getPoints = function (e) {
  49956. e = e || 12
  49957. 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++) {
  49958. var v = this.actions[g],
  49959. y = v.action,
  49960. A = v.args
  49961. switch (y) {
  49962. case 'moveTo':
  49963. case 'lineTo':
  49964. f.push(new Ci.Vector2(A[0], A[1]))
  49965. break
  49966. case 'quadraticCurveTo':
  49967. ;(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]))
  49968. for (var C = 1; C <= e; C++) {
  49969. ;(h = d((O = C / e), s, o, t)), (u = d(O, l, a, i)), f.push(new Ci.Vector2(h, u))
  49970. }
  49971. break
  49972. case 'bezierCurveTo':
  49973. ;(t = A[4]),
  49974. (i = A[5]),
  49975. (o = A[0]),
  49976. (a = A[1]),
  49977. (n = A[2]),
  49978. (r = A[3]),
  49979. (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]))
  49980. for (C = 1; C <= e; C++) {
  49981. ;(h = p((O = C / e), s, o, n, t)), (u = p(O, l, a, r, i)), f.push(new Ci.Vector2(h, u))
  49982. }
  49983. break
  49984. case 'splineThru':
  49985. c = this.actions[g - 1].args
  49986. var I = [new Ci.Vector2(c[c.length - 2], c[c.length - 1])],
  49987. E = e * A[0].length
  49988. I = I.concat(A[0])
  49989. var _ = new Ci.SplineCurve(I)
  49990. for (C = 1; C <= E; C++) f.push(_.getPointAt(C / E))
  49991. break
  49992. case 'arc':
  49993. var b = A[0],
  49994. w = A[1],
  49995. T = A[2],
  49996. x = A[3],
  49997. S = A[4],
  49998. M = !!A[5],
  49999. R = S - x,
  50000. P = 2 * e
  50001. for (C = 1; C <= P; C++) {
  50002. var O = C / P
  50003. 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))
  50004. }
  50005. break
  50006. case 'ellipse':
  50007. ;(b = A[0]), (w = A[1])
  50008. var L,
  50009. D,
  50010. N,
  50011. F = A[2],
  50012. B = A[3],
  50013. V = ((x = A[4]), (S = A[5]), (M = !!A[6]), A[7])
  50014. ;(R = S - x), (P = 2 * e)
  50015. 0 !== V && ((D = Math.cos(V)), (N = Math.sin(V)))
  50016. for (C = 1; C <= P; C++) {
  50017. O = C / P
  50018. if ((M || (O = 1 - O), (L = x + O * R), (h = b + F * Math.cos(L)), (u = w + B * Math.sin(L)), 0 !== V)) {
  50019. var k = h
  50020. ;(h = (k - b) * D - (u - w) * N + b), (u = (k - b) * N + (u - w) * D + w)
  50021. }
  50022. f.push(new Ci.Vector2(h, u))
  50023. }
  50024. }
  50025. }
  50026. var U = f[f.length - 1]
  50027. 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
  50028. }),
  50029. (Ci.Path.prototype.toShapes = function (e, t) {
  50030. function i(e) {
  50031. for (var t = [], i = 0, n = e.length; i < n; i++) {
  50032. var r = e[i],
  50033. o = new Ci.Shape()
  50034. ;(o.actions = r.actions), (o.curves = r.curves), t.push(o)
  50035. }
  50036. return t
  50037. }
  50038. function n(e, t) {
  50039. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  50040. var a = t[r],
  50041. s = t[o],
  50042. l = s.x - a.x,
  50043. c = s.y - a.y
  50044. if (Math.abs(c) > Number.EPSILON) {
  50045. if ((c < 0 && ((a = t[o]), (l = -l), (s = t[r]), (c = -c)), e.y < a.y || e.y > s.y)) continue
  50046. if (e.y === a.y) {
  50047. if (e.x === a.x) return !0
  50048. } else {
  50049. var h = c * (e.x - a.x) - l * (e.y - a.y)
  50050. if (0 == h) return !0
  50051. if (h < 0) continue
  50052. n = !n
  50053. }
  50054. } else {
  50055. if (e.y !== a.y) continue
  50056. if ((s.x <= e.x && e.x <= a.x) || (a.x <= e.x && e.x <= s.x)) return !0
  50057. }
  50058. }
  50059. return n
  50060. }
  50061. var r = Ci.ShapeUtils.isClockWise,
  50062. o = (function (e) {
  50063. for (var t = [], i = new Ci.Path(), n = 0, r = e.length; n < r; n++) {
  50064. var o = e[n],
  50065. a = o.args,
  50066. s = o.action
  50067. 'moveTo' === s && 0 !== i.actions.length && (t.push(i), (i = new Ci.Path())), i[s].apply(i, a)
  50068. }
  50069. return 0 !== i.actions.length && t.push(i), t
  50070. })(this.actions)
  50071. if (0 === o.length) return []
  50072. if (!0 === t) return i(o)
  50073. var a,
  50074. s,
  50075. l,
  50076. c = []
  50077. if (1 === o.length) return (s = o[0]), ((l = new Ci.Shape()).actions = s.actions), (l.curves = s.curves), c.push(l), c
  50078. var h = !r(o[0].getPoints())
  50079. h = e ? !h : h
  50080. var u,
  50081. d = [],
  50082. p = [],
  50083. f = [],
  50084. g = 0
  50085. ;(p[g] = void 0), (f[g] = [])
  50086. for (var m = 0, v = o.length; m < v; m++)
  50087. (a = r((u = (s = o[m]).getPoints()))),
  50088. (a = e ? !a : a)
  50089. ? (!h && p[g] && g++,
  50090. (p[g] = {
  50091. s: new Ci.Shape(),
  50092. p: u
  50093. }),
  50094. (p[g].s.actions = s.actions),
  50095. (p[g].s.curves = s.curves),
  50096. h && g++,
  50097. (f[g] = []))
  50098. : f[g].push({
  50099. h: s,
  50100. p: u[0]
  50101. })
  50102. if (!p[0]) return i(o)
  50103. if (1 < p.length) {
  50104. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++) d[C] = []
  50105. for (C = 0, I = p.length; C < I; C++)
  50106. for (var E = f[C], _ = 0; _ < E.length; _++) {
  50107. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  50108. n(b.p, p[T].p) &&
  50109. (C !== T &&
  50110. A.push({
  50111. froms: C,
  50112. tos: T,
  50113. hole: _
  50114. }),
  50115. w ? ((w = !1), d[T].push(b)) : (y = !0))
  50116. w && d[C].push(b)
  50117. }
  50118. 0 < A.length && (y || (f = d))
  50119. }
  50120. m = 0
  50121. for (var x, S = p.length; m < S; m++) {
  50122. ;(l = p[m].s), c.push(l)
  50123. for (var M = 0, R = (x = f[m]).length; M < R; M++) l.holes.push(x[M].h)
  50124. }
  50125. return c
  50126. }),
  50127. (Ci.Shape = function () {
  50128. Ci.Path.apply(this, arguments), (this.holes = [])
  50129. }),
  50130. (Ci.Shape.prototype = Object.create(Ci.Path.prototype)),
  50131. (Ci.Shape.prototype.constructor = Ci.Shape),
  50132. (Ci.Shape.prototype.extrude = function (e) {
  50133. return new Ci.ExtrudeGeometry(this, e)
  50134. }),
  50135. (Ci.Shape.prototype.makeGeometry = function (e) {
  50136. return new Ci.ShapeGeometry(this, e)
  50137. }),
  50138. (Ci.Shape.prototype.getPointsHoles = function (e) {
  50139. for (var t = [], i = 0, n = this.holes.length; i < n; i++) t[i] = this.holes[i].getPoints(e)
  50140. return t
  50141. }),
  50142. (Ci.Shape.prototype.extractAllPoints = function (e) {
  50143. return {
  50144. shape: this.getPoints(e),
  50145. holes: this.getPointsHoles(e)
  50146. }
  50147. }),
  50148. (Ci.Shape.prototype.extractPoints = function (e) {
  50149. return this.extractAllPoints(e)
  50150. }),
  50151. (Ci.LineCurve = function (e, t) {
  50152. ;(this.v1 = e), (this.v2 = t)
  50153. }),
  50154. (Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype)),
  50155. (Ci.LineCurve.prototype.constructor = Ci.LineCurve),
  50156. (Ci.LineCurve.prototype.getPoint = function (e) {
  50157. var t = this.v2.clone().sub(this.v1)
  50158. return t.multiplyScalar(e).add(this.v1), t
  50159. }),
  50160. (Ci.LineCurve.prototype.getPointAt = function (e) {
  50161. return this.getPoint(e)
  50162. }),
  50163. (Ci.LineCurve.prototype.getTangent = function (e) {
  50164. return this.v2.clone().sub(this.v1).normalize()
  50165. }),
  50166. (Ci.QuadraticBezierCurve = function (e, t, i) {
  50167. ;(this.v0 = e), (this.v1 = t), (this.v2 = i)
  50168. }),
  50169. (Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype)),
  50170. (Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve),
  50171. (Ci.QuadraticBezierCurve.prototype.getPoint = function (e) {
  50172. var t = Ci.ShapeUtils.b2
  50173. 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))
  50174. }),
  50175. (Ci.QuadraticBezierCurve.prototype.getTangent = function (e) {
  50176. var t = Ci.CurveUtils.tangentQuadraticBezier
  50177. 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()
  50178. }),
  50179. (Ci.CubicBezierCurve = function (e, t, i, n) {
  50180. ;(this.v0 = e), (this.v1 = t), (this.v2 = i), (this.v3 = n)
  50181. }),
  50182. (Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype)),
  50183. (Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve),
  50184. (Ci.CubicBezierCurve.prototype.getPoint = function (e) {
  50185. var t = Ci.ShapeUtils.b3
  50186. 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))
  50187. }),
  50188. (Ci.CubicBezierCurve.prototype.getTangent = function (e) {
  50189. var t = Ci.CurveUtils.tangentCubicBezier
  50190. 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()
  50191. }),
  50192. (Ci.SplineCurve = function (e) {
  50193. this.points = null == e ? [] : e
  50194. }),
  50195. (Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype)),
  50196. (Ci.SplineCurve.prototype.constructor = Ci.SplineCurve),
  50197. (Ci.SplineCurve.prototype.getPoint = function (e) {
  50198. var t = this.points,
  50199. i = (t.length - 1) * e,
  50200. n = Math.floor(i),
  50201. r = i - n,
  50202. o = t[0 === n ? n : n - 1],
  50203. a = t[n],
  50204. s = t[n > t.length - 2 ? t.length - 1 : n + 1],
  50205. l = t[n > t.length - 3 ? t.length - 1 : n + 2],
  50206. c = Ci.CurveUtils.interpolate
  50207. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r), c(o.y, a.y, s.y, l.y, r))
  50208. }),
  50209. (Ci.EllipseCurve = function (e, t, i, n, r, o, a, s) {
  50210. ;(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)
  50211. }),
  50212. (Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype)),
  50213. (Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve),
  50214. (Ci.EllipseCurve.prototype.getPoint = function (e) {
  50215. var t,
  50216. i = this.aEndAngle - this.aStartAngle
  50217. 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)
  50218. var n = this.aX + this.xRadius * Math.cos(t),
  50219. r = this.aY + this.yRadius * Math.sin(t)
  50220. if (0 !== this.aRotation) {
  50221. var o = Math.cos(this.aRotation),
  50222. a = Math.sin(this.aRotation),
  50223. s = n,
  50224. l = r
  50225. ;(n = (s - this.aX) * o - (l - this.aY) * a + this.aX), (r = (s - this.aX) * a + (l - this.aY) * o + this.aY)
  50226. }
  50227. return new Ci.Vector2(n, r)
  50228. }),
  50229. (Ci.ArcCurve = function (e, t, i, n, r, o) {
  50230. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  50231. }),
  50232. (Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype)),
  50233. (Ci.ArcCurve.prototype.constructor = Ci.ArcCurve),
  50234. (Ci.LineCurve3 = Ci.Curve.create(
  50235. function (e, t) {
  50236. ;(this.v1 = e), (this.v2 = t)
  50237. },
  50238. function (e) {
  50239. var t = new Ci.Vector3()
  50240. return t.subVectors(this.v2, this.v1), t.multiplyScalar(e), t.add(this.v1), t
  50241. }
  50242. )),
  50243. (Ci.QuadraticBezierCurve3 = Ci.Curve.create(
  50244. function (e, t, i) {
  50245. ;(this.v0 = e), (this.v1 = t), (this.v2 = i)
  50246. },
  50247. function (e) {
  50248. var t = Ci.ShapeUtils.b2
  50249. 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))
  50250. }
  50251. )),
  50252. (Ci.CubicBezierCurve3 = Ci.Curve.create(
  50253. function (e, t, i, n) {
  50254. ;(this.v0 = e), (this.v1 = t), (this.v2 = i), (this.v3 = n)
  50255. },
  50256. function (e) {
  50257. var t = Ci.ShapeUtils.b3
  50258. 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))
  50259. }
  50260. )),
  50261. (Ci.SplineCurve3 = Ci.Curve.create(
  50262. function (e) {
  50263. console.warn('THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3'), (this.points = null == e ? [] : e)
  50264. },
  50265. function (e) {
  50266. var t = this.points,
  50267. i = (t.length - 1) * e,
  50268. n = Math.floor(i),
  50269. r = i - n,
  50270. o = t[0 == n ? n : n - 1],
  50271. a = t[n],
  50272. s = t[n > t.length - 2 ? t.length - 1 : n + 1],
  50273. l = t[n > t.length - 3 ? t.length - 1 : n + 2],
  50274. c = Ci.CurveUtils.interpolate
  50275. 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))
  50276. }
  50277. )),
  50278. (Ci.CatmullRomCurve3 =
  50279. ((qt = new Ci.Vector3()),
  50280. (Xt = new xi()),
  50281. (Zt = new xi()),
  50282. (Kt = new xi()),
  50283. (xi.prototype.init = function (e, t, i, n) {
  50284. ;(this.c0 = e), (this.c1 = i), (this.c2 = -3 * e + 3 * t - 2 * i - n), (this.c3 = 2 * e - 2 * t + i + n)
  50285. }),
  50286. (xi.prototype.initNonuniformCatmullRom = function (e, t, i, n, r, o, a) {
  50287. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o,
  50288. l = (i - t) / o - (n - t) / (o + a) + (n - i) / a
  50289. ;(s *= o), (l *= o), this.init(t, i, s, l)
  50290. }),
  50291. (xi.prototype.initCatmullRom = function (e, t, i, n, r) {
  50292. this.init(t, i, r * (i - e), r * (n - t))
  50293. }),
  50294. (xi.prototype.calc = function (e) {
  50295. var t = e * e,
  50296. i = t * e
  50297. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  50298. }),
  50299. Ci.Curve.create(
  50300. function (e) {
  50301. ;(this.points = e || []), (this.closed = !1)
  50302. },
  50303. function (e) {
  50304. var t,
  50305. i,
  50306. n,
  50307. r,
  50308. o,
  50309. a,
  50310. s,
  50311. l,
  50312. c = this.points
  50313. if (
  50314. ((r = c.length) < 2 && console.log('duh, you need at least 2 points'),
  50315. (n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t))),
  50316. 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)),
  50317. (o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]), qt)),
  50318. (a = c[i % r]),
  50319. (s = c[(i + 1) % r]),
  50320. (l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]), qt)),
  50321. void 0 === this.type || 'centripetal' === this.type || 'chordal' === this.type)
  50322. ) {
  50323. var h = 'chordal' === this.type ? 0.5 : 0.25,
  50324. u = Math.pow(o.distanceToSquared(a), h),
  50325. d = Math.pow(a.distanceToSquared(s), h),
  50326. p = Math.pow(s.distanceToSquared(l), h)
  50327. d < 1e-4 && (d = 1),
  50328. u < 1e-4 && (u = d),
  50329. p < 1e-4 && (p = d),
  50330. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  50331. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  50332. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  50333. } else if ('catmullrom' === this.type) {
  50334. var f = void 0 !== this.tension ? this.tension : 0.5
  50335. 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)
  50336. }
  50337. return new Ci.Vector3(Xt.calc(n), Zt.calc(n), Kt.calc(n))
  50338. }
  50339. ))),
  50340. (Ci.ClosedSplineCurve3 = function (e) {
  50341. console.warn('THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3.'), Ci.CatmullRomCurve3.call(this, e), (this.type = 'catmullrom'), (this.closed = !0)
  50342. }),
  50343. (Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype)),
  50344. (Ci.BoxGeometry = function (e, t, i, n, r, o) {
  50345. Ci.Geometry.call(this),
  50346. (this.type = 'BoxGeometry'),
  50347. (this.parameters = {
  50348. width: e,
  50349. height: t,
  50350. depth: i,
  50351. widthSegments: n,
  50352. heightSegments: r,
  50353. depthSegments: o
  50354. }),
  50355. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e, t, i, n, r, o)),
  50356. this.mergeVertices()
  50357. }),
  50358. (Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  50359. (Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry),
  50360. (Ci.CubeGeometry = Ci.BoxGeometry),
  50361. (Ci.BoxBufferGeometry = function (e, t, i, n, r, o) {
  50362. function a(e, t, i, n, r, o, a, s, l, c, h) {
  50363. 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++)
  50364. for (var E = I * d - f, _ = 0; _ < m; _++) {
  50365. var b = _ * u - p
  50366. ;(C[e] = b * n),
  50367. (C[t] = E * r),
  50368. (C[i] = g),
  50369. (P[D] = C.x),
  50370. (P[D + 1] = C.y),
  50371. (P[D + 2] = C.z),
  50372. (C[e] = 0),
  50373. (C[t] = 0),
  50374. (C[i] = 0 < s ? 1 : -1),
  50375. (O[D] = C.x),
  50376. (O[D + 1] = C.y),
  50377. (O[D + 2] = C.z),
  50378. (L[N] = _ / l),
  50379. (L[N + 1] = 1 - I / c),
  50380. (D += 3),
  50381. (N += 2),
  50382. (y += 1)
  50383. }
  50384. for (I = 0; I < c; I++)
  50385. for (_ = 0; _ < l; _++) {
  50386. var w = B + _ + m * I,
  50387. T = B + _ + m * (I + 1),
  50388. x = B + (_ + 1) + m * (I + 1),
  50389. S = B + (_ + 1) + m * I
  50390. ;(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)
  50391. }
  50392. M.addGroup(V, A, h), (V += A), (B += y)
  50393. }
  50394. Ci.BufferGeometry.call(this),
  50395. (this.type = 'BoxBufferGeometry'),
  50396. (this.parameters = {
  50397. width: e,
  50398. height: t,
  50399. depth: i,
  50400. widthSegments: n,
  50401. heightSegments: r,
  50402. depthSegments: o
  50403. })
  50404. var M = this
  50405. ;(n = Math.floor(n) || 1), (r = Math.floor(r) || 1), (o = Math.floor(o) || 1)
  50406. var s,
  50407. l,
  50408. c,
  50409. h,
  50410. u = ((h = 0), (h += (s = n) * (l = r) * 2), (h += s * (c = o) * 2), 4 * (h += c * l * 2)),
  50411. d = (u / 4) * 6,
  50412. R = new (65535 < d ? Uint32Array : Uint16Array)(d),
  50413. P = new Float32Array(3 * u),
  50414. O = new Float32Array(3 * u),
  50415. L = new Float32Array(2 * u),
  50416. D = 0,
  50417. N = 0,
  50418. F = 0,
  50419. B = 0,
  50420. V = 0
  50421. a('z', 'y', 'x', -1, -1, i, t, e, o, r, 0),
  50422. a('z', 'y', 'x', 1, -1, i, t, -e, o, r, 1),
  50423. a('x', 'z', 'y', 1, 1, e, i, t, n, o, 2),
  50424. a('x', 'z', 'y', 1, -1, e, i, -t, n, o, 3),
  50425. a('x', 'y', 'z', 1, -1, e, t, i, n, r, 4),
  50426. a('x', 'y', 'z', -1, -1, e, t, -i, n, r, 5),
  50427. this.setIndex(new Ci.BufferAttribute(R, 1)),
  50428. this.addAttribute('position', new Ci.BufferAttribute(P, 3)),
  50429. this.addAttribute('normal', new Ci.BufferAttribute(O, 3)),
  50430. this.addAttribute('uv', new Ci.BufferAttribute(L, 2))
  50431. }),
  50432. (Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  50433. (Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry),
  50434. (Ci.CircleGeometry = function (e, t, i, n) {
  50435. Ci.Geometry.call(this),
  50436. (this.type = 'CircleGeometry'),
  50437. (this.parameters = {
  50438. radius: e,
  50439. segments: t,
  50440. thetaStart: i,
  50441. thetaLength: n
  50442. }),
  50443. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e, t, i, n))
  50444. }),
  50445. (Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  50446. (Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry),
  50447. (Ci.CircleBufferGeometry = function (e, t, i, n) {
  50448. Ci.BufferGeometry.call(this),
  50449. (this.type = 'CircleBufferGeometry'),
  50450. (this.parameters = {
  50451. radius: e,
  50452. segments: t,
  50453. thetaStart: i,
  50454. thetaLength: n
  50455. }),
  50456. (e = e || 50),
  50457. (t = void 0 !== t ? Math.max(3, t) : 8),
  50458. (i = void 0 !== i ? i : 0),
  50459. (n = void 0 !== n ? n : 2 * Math.PI)
  50460. var r = t + 2,
  50461. o = new Float32Array(3 * r),
  50462. a = new Float32Array(3 * r),
  50463. s = new Float32Array(2 * r)
  50464. ;(a[2] = 1), (s[0] = 0.5), (s[1] = 0.5)
  50465. for (var l = 0, c = 3, h = 2; l <= t; l++, c += 3, h += 2) {
  50466. var u = i + (l / t) * n
  50467. ;(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)
  50468. }
  50469. var d = []
  50470. for (c = 1; c <= t; c++) d.push(c, c + 1, 0)
  50471. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d), 1)),
  50472. this.addAttribute('position', new Ci.BufferAttribute(o, 3)),
  50473. this.addAttribute('normal', new Ci.BufferAttribute(a, 3)),
  50474. this.addAttribute('uv', new Ci.BufferAttribute(s, 2)),
  50475. (this.boundingSphere = new Ci.Sphere(new Ci.Vector3(), e))
  50476. }),
  50477. (Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  50478. (Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry),
  50479. (Ci.CylinderBufferGeometry = function (p, f, g, m, v, e, y, A) {
  50480. function t(e) {
  50481. var t,
  50482. i,
  50483. n,
  50484. r = new Ci.Vector2(),
  50485. o = new Ci.Vector3(),
  50486. a = !0 === e ? p : f,
  50487. s = !0 === e ? 1 : -1
  50488. 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++
  50489. for (n = b, t = 0; t <= m; t++) {
  50490. var l = t / m
  50491. ;(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++
  50492. }
  50493. for (t = 0; t < m; t++) {
  50494. var c = i + t,
  50495. h = n + t
  50496. !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++
  50497. }
  50498. }
  50499. Ci.BufferGeometry.call(this),
  50500. (this.type = 'CylinderBufferGeometry'),
  50501. (this.parameters = {
  50502. radiusTop: p,
  50503. radiusBottom: f,
  50504. height: g,
  50505. radialSegments: m,
  50506. heightSegments: v,
  50507. openEnded: e,
  50508. thetaStart: y,
  50509. thetaLength: A
  50510. }),
  50511. (p = void 0 !== p ? p : 20),
  50512. (f = void 0 !== f ? f : 20),
  50513. (g = void 0 !== g ? g : 100),
  50514. (m = Math.floor(m) || 8),
  50515. (v = Math.floor(v) || 1),
  50516. (e = void 0 !== e && e),
  50517. (y = void 0 !== y ? y : 0),
  50518. (A = void 0 !== A ? A : 2 * Math.PI)
  50519. var i,
  50520. n,
  50521. r = ((n = (m + 1) * (v + 1)), !1 === e && (n += 2 * (m + 1) + 2 * m), n),
  50522. o = ((i = m * v * 2 * 3), !1 === e && (i += 2 * m * 3), i),
  50523. C = new Ci.BufferAttribute(new (65535 < o ? Uint32Array : Uint16Array)(o), 1),
  50524. I = new Ci.BufferAttribute(new Float32Array(3 * r), 3),
  50525. E = new Ci.BufferAttribute(new Float32Array(3 * r), 3),
  50526. _ = new Ci.BufferAttribute(new Float32Array(2 * r), 2),
  50527. b = 0,
  50528. w = 0,
  50529. T = [],
  50530. x = g / 2
  50531. ;(function () {
  50532. var e,
  50533. t,
  50534. i = new Ci.Vector3(),
  50535. n = new Ci.Vector3(),
  50536. r = (f - p) / g
  50537. for (t = 0; t <= v; t++) {
  50538. var o = [],
  50539. a = t / v,
  50540. s = a * (f - p) + p
  50541. for (e = 0; e <= m; e++) {
  50542. var l = e / m
  50543. ;(n.x = s * Math.sin(l * A + y)),
  50544. (n.y = -a * g + x),
  50545. (n.z = s * Math.cos(l * A + y)),
  50546. I.setXYZ(b, n.x, n.y, n.z),
  50547. i.copy(n),
  50548. ((0 === p && 0 === t) || (0 === f && t === v)) && ((i.x = Math.sin(l * A + y)), (i.z = Math.cos(l * A + y))),
  50549. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  50550. E.setXYZ(b, i.x, i.y, i.z),
  50551. _.setXY(b, l, 1 - a),
  50552. o.push(b),
  50553. b++
  50554. }
  50555. T.push(o)
  50556. }
  50557. for (e = 0; e < m; e++)
  50558. for (t = 0; t < v; t++) {
  50559. var c = T[t][e],
  50560. h = T[t + 1][e],
  50561. u = T[t + 1][e + 1],
  50562. d = T[t][e + 1]
  50563. 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++
  50564. }
  50565. })(),
  50566. !1 === e && (0 < p && t(!0), 0 < f && t(!1)),
  50567. this.setIndex(C),
  50568. this.addAttribute('position', I),
  50569. this.addAttribute('normal', E),
  50570. this.addAttribute('uv', _)
  50571. }),
  50572. (Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  50573. (Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry),
  50574. (Ci.CylinderGeometry = function (e, t, i, n, r, o, a, s) {
  50575. Ci.Geometry.call(this),
  50576. (this.type = 'CylinderGeometry'),
  50577. (this.parameters = {
  50578. radiusTop: e,
  50579. radiusBottom: t,
  50580. height: i,
  50581. radialSegments: n,
  50582. heightSegments: r,
  50583. openEnded: o,
  50584. thetaStart: a,
  50585. thetaLength: s
  50586. }),
  50587. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e, t, i, n, r, o, a, s)),
  50588. this.mergeVertices()
  50589. }),
  50590. (Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  50591. (Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry),
  50592. (Ci.EdgesGeometry = function (e, t) {
  50593. function i(e, t) {
  50594. return e - t
  50595. }
  50596. Ci.BufferGeometry.call(this), (t = void 0 !== t ? t : 1)
  50597. var n,
  50598. r = Math.cos(Ci.Math.degToRad(t)),
  50599. o = [0, 0],
  50600. a = {},
  50601. s = ['a', 'b', 'c']
  50602. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry()).fromBufferGeometry(e) : (n = e.clone()), n.mergeVertices(), n.computeFaceNormals()
  50603. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  50604. for (var d = c[h], p = 0; p < 3; p++) {
  50605. ;(o[0] = d[s[p]]),
  50606. (o[1] = d[s[(p + 1) % 3]]),
  50607. o.sort(i),
  50608. void 0 === a[(g = o.toString())]
  50609. ? (a[g] = {
  50610. vert1: o[0],
  50611. vert2: o[1],
  50612. face1: h,
  50613. face2: void 0
  50614. })
  50615. : (a[g].face2 = h)
  50616. }
  50617. var f = []
  50618. for (var g in a) {
  50619. var m = a[g]
  50620. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  50621. var v = l[m.vert1]
  50622. 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)
  50623. }
  50624. }
  50625. this.addAttribute('position', new Ci.BufferAttribute(new Float32Array(f), 3))
  50626. }),
  50627. (Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  50628. (Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry),
  50629. (Ci.ExtrudeGeometry = function (e, t) {
  50630. 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())
  50631. })
  50632. ;(Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  50633. (Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry),
  50634. (Ci.ExtrudeGeometry.prototype.addShapeList = function (e, t) {
  50635. for (var i = e.length, n = 0; n < i; n++) {
  50636. var r = e[n]
  50637. this.addShape(r, t)
  50638. }
  50639. }),
  50640. (Ci.ExtrudeGeometry.prototype.addShape = function (e, t) {
  50641. function i(e, t, i) {
  50642. return t || console.error('THREE.ExtrudeGeometry: vec does not exist'), t.clone().multiplyScalar(i).add(e)
  50643. }
  50644. function n(e, t, i) {
  50645. var n,
  50646. r,
  50647. o = 1,
  50648. a = e.x - t.x,
  50649. s = e.y - t.y,
  50650. l = i.x - e.x,
  50651. c = i.y - e.y,
  50652. h = a * a + s * s,
  50653. u = a * c - s * l
  50654. if (Math.abs(u) > Number.EPSILON) {
  50655. var d = Math.sqrt(h),
  50656. p = Math.sqrt(l * l + c * c),
  50657. f = t.x - s / d,
  50658. g = t.y + a / d,
  50659. m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l),
  50660. v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r
  50661. if (v <= 2) return new Ci.Vector2(n, r)
  50662. o = Math.sqrt(v / 2)
  50663. } else {
  50664. var y = !1
  50665. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  50666. (o = y ? ((n = -s), (r = a), Math.sqrt(h)) : ((n = a), (r = s), Math.sqrt(h / 2)))
  50667. }
  50668. return new Ci.Vector2(n / o, r / o)
  50669. }
  50670. function r(e, t) {
  50671. var i, n
  50672. for (G = e.length; 0 <= --G; ) {
  50673. ;(n = (i = G) - 1) < 0 && (n = e.length - 1)
  50674. var r = 0,
  50675. o = A + 2 * m
  50676. for (r = 0; r < o; r++) {
  50677. var a = U * r,
  50678. s = U * (r + 1)
  50679. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  50680. }
  50681. }
  50682. }
  50683. function o(e, t, i) {
  50684. T.vertices.push(new Ci.Vector3(e, t, i))
  50685. }
  50686. function a(e, t, i) {
  50687. ;(e += x), (t += x), (i += x), T.faces.push(new Ci.Face3(e, t, i, null, null, 0))
  50688. var n = E.generateTopUV(T, e, t, i)
  50689. T.faceVertexUvs[0].push(n)
  50690. }
  50691. function l(e, t, i, n) {
  50692. ;(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))
  50693. var r = E.generateSideWallUV(T, e, t, i, n)
  50694. T.faceVertexUvs[0].push([r[0], r[1], r[3]]), T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  50695. }
  50696. var s,
  50697. c,
  50698. h,
  50699. u,
  50700. d,
  50701. p = void 0 !== t.amount ? t.amount : 100,
  50702. f = void 0 !== t.bevelThickness ? t.bevelThickness : 6,
  50703. g = void 0 !== t.bevelSize ? t.bevelSize : f - 2,
  50704. m = void 0 !== t.bevelSegments ? t.bevelSegments : 3,
  50705. v = void 0 === t.bevelEnabled || t.bevelEnabled,
  50706. y = void 0 !== t.curveSegments ? t.curveSegments : 12,
  50707. A = void 0 !== t.steps ? t.steps : 1,
  50708. C = t.extrudePath,
  50709. I = !1,
  50710. E = void 0 !== t.UVGenerator ? t.UVGenerator : Ci.ExtrudeGeometry.WorldUVGenerator
  50711. C &&
  50712. ((s = C.getSpacedPoints(A)),
  50713. (v = !(I = !0)),
  50714. (c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C, A, !1)),
  50715. (h = new Ci.Vector3()),
  50716. (u = new Ci.Vector3()),
  50717. (d = new Ci.Vector3())),
  50718. v || (g = f = m = 0)
  50719. var _,
  50720. b,
  50721. w,
  50722. T = this,
  50723. x = this.vertices.length,
  50724. S = e.extractPoints(y),
  50725. M = S.shape,
  50726. R = S.holes,
  50727. P = !Ci.ShapeUtils.isClockWise(M)
  50728. if (P) {
  50729. for (M = M.reverse(), b = 0, w = R.length; b < w; b++) (_ = R[b]), Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse())
  50730. P = !1
  50731. }
  50732. var O = Ci.ShapeUtils.triangulateShape(M, R),
  50733. L = M
  50734. for (b = 0, w = R.length; b < w; b++) (_ = R[b]), (M = M.concat(_))
  50735. 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++)
  50736. j === W && (j = 0), Y === W && (Y = 0), (z[G] = n(L[G], L[j], L[Y]))
  50737. var q,
  50738. X,
  50739. Z = [],
  50740. K = z.concat()
  50741. for (b = 0, w = R.length; b < w; b++) {
  50742. 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]))
  50743. Z.push(q), (K = K.concat(q))
  50744. }
  50745. for (D = 0; D < m; D++) {
  50746. 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)
  50747. 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)
  50748. }
  50749. for (N = g, G = 0; G < U; G++)
  50750. (V = v ? i(M[G], K[G], N) : M[G]),
  50751. 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)
  50752. for (X = 1; X <= A; X++)
  50753. for (G = 0; G < U; G++)
  50754. (V = v ? i(M[G], K[G], N) : M[G]),
  50755. 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)
  50756. for (D = m - 1; 0 <= D; D--) {
  50757. 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)
  50758. for (b = 0, w = R.length; b < w; b++)
  50759. 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)
  50760. }
  50761. ;(function () {
  50762. if (v) {
  50763. var e = 0,
  50764. t = U * e
  50765. for (G = 0; G < H; G++) a((k = O[G])[2] + t, k[1] + t, k[0] + t)
  50766. for (t = U * (e = A + 2 * m), G = 0; G < H; G++) a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  50767. } else {
  50768. for (G = 0; G < H; G++) a((k = O[G])[2], k[1], k[0])
  50769. for (G = 0; G < H; G++) a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  50770. }
  50771. })(),
  50772. (function () {
  50773. var e = 0
  50774. for (r(L, e), e += L.length, b = 0, w = R.length; b < w; b++) r((_ = R[b]), e), (e += _.length)
  50775. })()
  50776. }),
  50777. (Ci.ExtrudeGeometry.WorldUVGenerator = {
  50778. generateTopUV: function (e, t, i, n) {
  50779. var r = e.vertices,
  50780. o = r[t],
  50781. a = r[i],
  50782. s = r[n]
  50783. return [new Ci.Vector2(o.x, o.y), new Ci.Vector2(a.x, a.y), new Ci.Vector2(s.x, s.y)]
  50784. },
  50785. generateSideWallUV: function (e, t, i, n, r) {
  50786. var o = e.vertices,
  50787. a = o[t],
  50788. s = o[i],
  50789. l = o[n],
  50790. c = o[r]
  50791. return Math.abs(a.y - s.y) < 0.01
  50792. ? [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)]
  50793. : [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)]
  50794. }
  50795. }),
  50796. (Ci.ShapeGeometry = function (e, t) {
  50797. Ci.Geometry.call(this), !(this.type = 'ShapeGeometry') === Array.isArray(e) && (e = [e]), this.addShapeList(e, t), this.computeFaceNormals()
  50798. }),
  50799. (Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  50800. (Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry),
  50801. (Ci.ShapeGeometry.prototype.addShapeList = function (e, t) {
  50802. for (var i = 0, n = e.length; i < n; i++) this.addShape(e[i], t)
  50803. return this
  50804. }),
  50805. (Ci.ShapeGeometry.prototype.addShape = function (e, t) {
  50806. void 0 === t && (t = {})
  50807. var i,
  50808. n,
  50809. r,
  50810. o = void 0 !== t.curveSegments ? t.curveSegments : 12,
  50811. a = t.material,
  50812. s = void 0 === t.UVGenerator ? Ci.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator,
  50813. l = this.vertices.length,
  50814. c = e.extractPoints(o),
  50815. h = c.shape,
  50816. u = c.holes,
  50817. d = !Ci.ShapeUtils.isClockWise(h)
  50818. if (d) {
  50819. for (h = h.reverse(), i = 0, n = u.length; i < n; i++) (r = u[i]), Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse())
  50820. d = !1
  50821. }
  50822. var p = Ci.ShapeUtils.triangulateShape(h, u)
  50823. for (i = 0, n = u.length; i < n; i++) (r = u[i]), (h = h.concat(r))
  50824. var f,
  50825. g,
  50826. m = h.length,
  50827. v = p.length
  50828. for (i = 0; i < m; i++) (f = h[i]), this.vertices.push(new Ci.Vector3(f.x, f.y, 0))
  50829. for (i = 0; i < v; i++) {
  50830. var y = (g = p[i])[0] + l,
  50831. A = g[1] + l,
  50832. C = g[2] + l
  50833. this.faces.push(new Ci.Face3(y, A, C, null, null, a)), this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  50834. }
  50835. }),
  50836. (Ci.LatheBufferGeometry = function (e, t, i, n) {
  50837. Ci.BufferGeometry.call(this),
  50838. (this.type = 'LatheBufferGeometry'),
  50839. (this.parameters = {
  50840. points: e,
  50841. segments: t,
  50842. phiStart: i,
  50843. phiLength: n
  50844. }),
  50845. (t = Math.floor(t) || 12),
  50846. (i = i || 0),
  50847. (n = n || 2 * Math.PI),
  50848. (n = Ci.Math.clamp(n, 0, 2 * Math.PI))
  50849. var r,
  50850. o,
  50851. a,
  50852. s = (t + 1) * e.length,
  50853. l = t * e.length * 2 * 3,
  50854. c = new Ci.BufferAttribute(new (65535 < l ? Uint32Array : Uint16Array)(l), 1),
  50855. h = new Ci.BufferAttribute(new Float32Array(3 * s), 3),
  50856. u = new Ci.BufferAttribute(new Float32Array(2 * s), 2),
  50857. d = 0,
  50858. p = 0,
  50859. f = (e.length, 1 / t),
  50860. g = new Ci.Vector3(),
  50861. m = new Ci.Vector2()
  50862. for (o = 0; o <= t; o++) {
  50863. var v = i + o * f * n,
  50864. y = Math.sin(v),
  50865. A = Math.cos(v)
  50866. for (a = 0; a <= e.length - 1; a++)
  50867. (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++
  50868. }
  50869. for (o = 0; o < t; o++)
  50870. for (a = 0; a < e.length - 1; a++) {
  50871. var C = (r = a + o * e.length),
  50872. I = r + e.length,
  50873. E = r + e.length + 1,
  50874. _ = r + 1
  50875. 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++
  50876. }
  50877. if ((this.setIndex(c), this.addAttribute('position', h), this.addAttribute('uv', u), this.computeVertexNormals(), n === 2 * Math.PI)) {
  50878. var b = this.attributes.normal.array,
  50879. w = new Ci.Vector3(),
  50880. T = new Ci.Vector3(),
  50881. x = new Ci.Vector3()
  50882. for (r = t * e.length * 3, a = o = 0; o < e.length; o++, a += 3)
  50883. (w.x = b[a + 0]),
  50884. (w.y = b[a + 1]),
  50885. (w.z = b[a + 2]),
  50886. (T.x = b[r + a + 0]),
  50887. (T.y = b[r + a + 1]),
  50888. (T.z = b[r + a + 2]),
  50889. x.addVectors(w, T).normalize(),
  50890. (b[a + 0] = b[r + a + 0] = x.x),
  50891. (b[a + 1] = b[r + a + 1] = x.y),
  50892. (b[a + 2] = b[r + a + 2] = x.z)
  50893. }
  50894. }),
  50895. (Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  50896. (Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry),
  50897. (Ci.LatheGeometry = function (e, t, i, n) {
  50898. Ci.Geometry.call(this),
  50899. (this.type = 'LatheGeometry'),
  50900. (this.parameters = {
  50901. points: e,
  50902. segments: t,
  50903. phiStart: i,
  50904. phiLength: n
  50905. }),
  50906. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e, t, i, n)),
  50907. this.mergeVertices()
  50908. }),
  50909. (Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  50910. (Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry),
  50911. (Ci.PlaneGeometry = function (e, t, i, n) {
  50912. Ci.Geometry.call(this),
  50913. (this.type = 'PlaneGeometry'),
  50914. (this.parameters = {
  50915. width: e,
  50916. height: t,
  50917. widthSegments: i,
  50918. heightSegments: n
  50919. }),
  50920. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e, t, i, n))
  50921. }),
  50922. (Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  50923. (Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry),
  50924. (Ci.PlaneBufferGeometry = function (e, t, i, n) {
  50925. Ci.BufferGeometry.call(this),
  50926. (this.type = 'PlaneBufferGeometry'),
  50927. (this.parameters = {
  50928. width: e,
  50929. height: t,
  50930. widthSegments: i,
  50931. heightSegments: n
  50932. })
  50933. for (
  50934. var r = e / 2,
  50935. o = t / 2,
  50936. a = Math.floor(i) || 1,
  50937. s = Math.floor(n) || 1,
  50938. l = a + 1,
  50939. c = s + 1,
  50940. h = e / a,
  50941. u = t / s,
  50942. d = new Float32Array(l * c * 3),
  50943. p = new Float32Array(l * c * 3),
  50944. f = new Float32Array(l * c * 2),
  50945. g = 0,
  50946. m = 0,
  50947. v = 0;
  50948. v < c;
  50949. v++
  50950. )
  50951. for (var y = v * u - o, A = 0; A < l; A++) {
  50952. var C = A * h - r
  50953. ;(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)
  50954. }
  50955. g = 0
  50956. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6)
  50957. for (v = 0; v < s; v++)
  50958. for (A = 0; A < a; A++) {
  50959. var E = A + l * v,
  50960. _ = A + l * (v + 1),
  50961. b = A + 1 + l * (v + 1),
  50962. w = A + 1 + l * v
  50963. ;(I[g] = E), (I[g + 1] = _), (I[g + 2] = w), (I[g + 3] = _), (I[g + 4] = b), (I[g + 5] = w), (g += 6)
  50964. }
  50965. this.setIndex(new Ci.BufferAttribute(I, 1)),
  50966. this.addAttribute('position', new Ci.BufferAttribute(d, 3)),
  50967. this.addAttribute('normal', new Ci.BufferAttribute(p, 3)),
  50968. this.addAttribute('uv', new Ci.BufferAttribute(f, 2))
  50969. }),
  50970. (Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  50971. (Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry),
  50972. (Ci.RingBufferGeometry = function (e, t, i, n, r, o) {
  50973. Ci.BufferGeometry.call(this),
  50974. (this.type = 'RingBufferGeometry'),
  50975. (this.parameters = {
  50976. innerRadius: e,
  50977. outerRadius: t,
  50978. thetaSegments: i,
  50979. phiSegments: n,
  50980. thetaStart: r,
  50981. thetaLength: o
  50982. }),
  50983. (e = e || 20),
  50984. (t = t || 50),
  50985. (r = void 0 !== r ? r : 0),
  50986. (o = void 0 !== o ? o : 2 * Math.PI)
  50987. var a,
  50988. s,
  50989. l,
  50990. c = ((i = void 0 !== i ? Math.max(3, i) : 8) + 1) * ((n = void 0 !== n ? Math.max(1, n) : 1) + 1),
  50991. h = i * n * 2 * 3,
  50992. u = new Ci.BufferAttribute(new (65535 < h ? Uint32Array : Uint16Array)(h), 1),
  50993. d = new Ci.BufferAttribute(new Float32Array(3 * c), 3),
  50994. p = new Ci.BufferAttribute(new Float32Array(3 * c), 3),
  50995. f = new Ci.BufferAttribute(new Float32Array(2 * c), 2),
  50996. g = 0,
  50997. m = 0,
  50998. v = e,
  50999. y = (t - e) / n,
  51000. A = new Ci.Vector3(),
  51001. C = new Ci.Vector2()
  51002. for (s = 0; s <= n; s++) {
  51003. for (l = 0; l <= i; l++)
  51004. (a = r + (l / i) * o),
  51005. (A.x = v * Math.cos(a)),
  51006. (A.y = v * Math.sin(a)),
  51007. d.setXYZ(g, A.x, A.y, A.z),
  51008. p.setXYZ(g, 0, 0, 1),
  51009. (C.x = (A.x / t + 1) / 2),
  51010. (C.y = (A.y / t + 1) / 2),
  51011. f.setXY(g, C.x, C.y),
  51012. g++
  51013. v += y
  51014. }
  51015. for (s = 0; s < n; s++) {
  51016. var I = s * (i + 1)
  51017. for (l = 0; l < i; l++) {
  51018. var E = (a = l + I),
  51019. _ = a + i + 1,
  51020. b = a + i + 2,
  51021. w = a + 1
  51022. 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++
  51023. }
  51024. }
  51025. this.setIndex(u), this.addAttribute('position', d), this.addAttribute('normal', p), this.addAttribute('uv', f)
  51026. }),
  51027. (Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  51028. (Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry),
  51029. (Ci.RingGeometry = function (e, t, i, n, r, o) {
  51030. Ci.Geometry.call(this),
  51031. (this.type = 'RingGeometry'),
  51032. (this.parameters = {
  51033. innerRadius: e,
  51034. outerRadius: t,
  51035. thetaSegments: i,
  51036. phiSegments: n,
  51037. thetaStart: r,
  51038. thetaLength: o
  51039. }),
  51040. this.fromBufferGeometry(new Ci.RingBufferGeometry(e, t, i, n, r, o))
  51041. }),
  51042. (Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  51043. (Ci.RingGeometry.prototype.constructor = Ci.RingGeometry),
  51044. (Ci.SphereGeometry = function (e, t, i, n, r, o, a) {
  51045. Ci.Geometry.call(this),
  51046. (this.type = 'SphereGeometry'),
  51047. (this.parameters = {
  51048. radius: e,
  51049. widthSegments: t,
  51050. heightSegments: i,
  51051. phiStart: n,
  51052. phiLength: r,
  51053. thetaStart: o,
  51054. thetaLength: a
  51055. }),
  51056. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e, t, i, n, r, o, a))
  51057. }),
  51058. (Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  51059. (Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry),
  51060. (Ci.SphereBufferGeometry = function (e, t, i, n, r, o, a) {
  51061. Ci.BufferGeometry.call(this),
  51062. (this.type = 'SphereBufferGeometry'),
  51063. (this.parameters = {
  51064. radius: e,
  51065. widthSegments: t,
  51066. heightSegments: i,
  51067. phiStart: n,
  51068. phiLength: r,
  51069. thetaStart: o,
  51070. thetaLength: a
  51071. }),
  51072. (e = e || 50),
  51073. (t = Math.max(3, Math.floor(t) || 8)),
  51074. (i = Math.max(2, Math.floor(i) || 6)),
  51075. (n = void 0 !== n ? n : 0),
  51076. (r = void 0 !== r ? r : 2 * Math.PI)
  51077. for (
  51078. var s = (o = void 0 !== o ? o : 0) + (a = void 0 !== a ? a : Math.PI),
  51079. l = (t + 1) * (i + 1),
  51080. c = new Ci.BufferAttribute(new Float32Array(3 * l), 3),
  51081. h = new Ci.BufferAttribute(new Float32Array(3 * l), 3),
  51082. u = new Ci.BufferAttribute(new Float32Array(2 * l), 2),
  51083. d = 0,
  51084. p = [],
  51085. f = new Ci.Vector3(),
  51086. g = 0;
  51087. g <= i;
  51088. g++
  51089. ) {
  51090. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  51091. var A = y / t,
  51092. C = -e * Math.cos(n + A * r) * Math.sin(o + v * a),
  51093. I = e * Math.cos(o + v * a),
  51094. E = e * Math.sin(n + A * r) * Math.sin(o + v * a)
  51095. 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++
  51096. }
  51097. p.push(m)
  51098. }
  51099. var _ = []
  51100. for (g = 0; g < i; g++)
  51101. for (y = 0; y < t; y++) {
  51102. var b = p[g][y + 1],
  51103. w = p[g][y],
  51104. T = p[g + 1][y],
  51105. x = p[g + 1][y + 1]
  51106. ;(0 !== g || 0 < o) && _.push(b, w, x), (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  51107. }
  51108. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_, 1)),
  51109. this.addAttribute('position', c),
  51110. this.addAttribute('normal', h),
  51111. this.addAttribute('uv', u),
  51112. (this.boundingSphere = new Ci.Sphere(new Ci.Vector3(), e))
  51113. }),
  51114. (Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  51115. (Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry),
  51116. (Ci.TextGeometry = function (e, t) {
  51117. var i = (t = t || {}).font
  51118. if (i instanceof Ci.Font == 0) return console.error('THREE.TextGeometry: font parameter is not an instance of THREE.Font.'), new Ci.Geometry()
  51119. var n = i.generateShapes(e, t.size, t.curveSegments)
  51120. ;(t.amount = void 0 !== t.height ? t.height : 50),
  51121. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  51122. void 0 === t.bevelSize && (t.bevelSize = 8),
  51123. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  51124. Ci.ExtrudeGeometry.call(this, n, t),
  51125. (this.type = 'TextGeometry')
  51126. }),
  51127. (Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype)),
  51128. (Ci.TextGeometry.prototype.constructor = Ci.TextGeometry),
  51129. (Ci.TorusBufferGeometry = function (e, t, i, n, r) {
  51130. Ci.BufferGeometry.call(this),
  51131. (this.type = 'TorusBufferGeometry'),
  51132. (this.parameters = {
  51133. radius: e,
  51134. tube: t,
  51135. radialSegments: i,
  51136. tubularSegments: n,
  51137. arc: r
  51138. }),
  51139. (e = e || 100),
  51140. (t = t || 40),
  51141. (i = Math.floor(i) || 8),
  51142. (n = Math.floor(n) || 6),
  51143. (r = r || 2 * Math.PI)
  51144. var o,
  51145. a,
  51146. s = (i + 1) * (n + 1),
  51147. l = i * n * 2 * 3,
  51148. c = new (65535 < l ? Uint32Array : Uint16Array)(l),
  51149. h = new Float32Array(3 * s),
  51150. u = new Float32Array(3 * s),
  51151. d = new Float32Array(2 * s),
  51152. p = 0,
  51153. f = 0,
  51154. g = 0,
  51155. m = new Ci.Vector3(),
  51156. v = new Ci.Vector3(),
  51157. y = new Ci.Vector3()
  51158. for (o = 0; o <= i; o++)
  51159. for (a = 0; a <= n; a++) {
  51160. var A = (a / n) * r,
  51161. C = (o / i) * Math.PI * 2
  51162. ;(v.x = (e + t * Math.cos(C)) * Math.cos(A)),
  51163. (v.y = (e + t * Math.cos(C)) * Math.sin(A)),
  51164. (v.z = t * Math.sin(C)),
  51165. (h[p] = v.x),
  51166. (h[p + 1] = v.y),
  51167. (h[p + 2] = v.z),
  51168. (m.x = e * Math.cos(A)),
  51169. (m.y = e * Math.sin(A)),
  51170. y.subVectors(v, m).normalize(),
  51171. (u[p] = y.x),
  51172. (u[p + 1] = y.y),
  51173. (u[p + 2] = y.z),
  51174. (d[f] = a / n),
  51175. (d[f + 1] = o / i),
  51176. (p += 3),
  51177. (f += 2)
  51178. }
  51179. for (o = 1; o <= i; o++)
  51180. for (a = 1; a <= n; a++) {
  51181. var I = (n + 1) * o + a - 1,
  51182. E = (n + 1) * (o - 1) + a - 1,
  51183. _ = (n + 1) * (o - 1) + a,
  51184. b = (n + 1) * o + a
  51185. ;(c[g] = I), (c[g + 1] = E), (c[g + 2] = b), (c[g + 3] = E), (c[g + 4] = _), (c[g + 5] = b), (g += 6)
  51186. }
  51187. this.setIndex(new Ci.BufferAttribute(c, 1)),
  51188. this.addAttribute('position', new Ci.BufferAttribute(h, 3)),
  51189. this.addAttribute('normal', new Ci.BufferAttribute(u, 3)),
  51190. this.addAttribute('uv', new Ci.BufferAttribute(d, 2))
  51191. }),
  51192. (Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  51193. (Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry),
  51194. (Ci.TorusGeometry = function (e, t, i, n, r) {
  51195. Ci.Geometry.call(this),
  51196. (this.type = 'TorusGeometry'),
  51197. (this.parameters = {
  51198. radius: e,
  51199. tube: t,
  51200. radialSegments: i,
  51201. tubularSegments: n,
  51202. arc: r
  51203. }),
  51204. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e, t, i, n, r))
  51205. }),
  51206. (Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  51207. (Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry),
  51208. (Ci.TorusKnotBufferGeometry = function (e, t, i, n, r, o) {
  51209. function a(e, t, i, n, r) {
  51210. var o = Math.cos(e),
  51211. a = Math.sin(e),
  51212. s = (i / t) * e,
  51213. l = Math.cos(s)
  51214. ;(r.x = n * (2 + l) * 0.5 * o), (r.y = n * (2 + l) * a * 0.5), (r.z = n * Math.sin(s) * 0.5)
  51215. }
  51216. Ci.BufferGeometry.call(this),
  51217. (this.type = 'TorusKnotBufferGeometry'),
  51218. (this.parameters = {
  51219. radius: e,
  51220. tube: t,
  51221. tubularSegments: i,
  51222. radialSegments: n,
  51223. p: r,
  51224. q: o
  51225. }),
  51226. (e = e || 100),
  51227. (t = t || 40),
  51228. (i = Math.floor(i) || 64),
  51229. (r = r || 2),
  51230. (o = o || 3)
  51231. var s,
  51232. l,
  51233. c = ((n = Math.floor(n) || 8) + 1) * (i + 1),
  51234. h = n * i * 2 * 3,
  51235. u = new Ci.BufferAttribute(new (65535 < h ? Uint32Array : Uint16Array)(h), 1),
  51236. d = new Ci.BufferAttribute(new Float32Array(3 * c), 3),
  51237. p = new Ci.BufferAttribute(new Float32Array(3 * c), 3),
  51238. f = new Ci.BufferAttribute(new Float32Array(2 * c), 2),
  51239. g = 0,
  51240. m = 0,
  51241. v = new Ci.Vector3(),
  51242. y = new Ci.Vector3(),
  51243. A = new Ci.Vector2(),
  51244. C = new Ci.Vector3(),
  51245. I = new Ci.Vector3(),
  51246. E = new Ci.Vector3(),
  51247. _ = new Ci.Vector3(),
  51248. b = new Ci.Vector3()
  51249. for (s = 0; s <= i; ++s) {
  51250. var w = (s / i) * r * Math.PI * 2
  51251. 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) {
  51252. var T = (l / n) * Math.PI * 2,
  51253. x = -t * Math.cos(T),
  51254. S = t * Math.sin(T)
  51255. ;(v.x = C.x + (x * b.x + S * E.x)),
  51256. (v.y = C.y + (x * b.y + S * E.y)),
  51257. (v.z = C.z + (x * b.z + S * E.z)),
  51258. d.setXYZ(g, v.x, v.y, v.z),
  51259. y.subVectors(v, C).normalize(),
  51260. p.setXYZ(g, y.x, y.y, y.z),
  51261. (A.x = s / i),
  51262. (A.y = l / n),
  51263. f.setXY(g, A.x, A.y),
  51264. g++
  51265. }
  51266. }
  51267. for (l = 1; l <= i; l++)
  51268. for (s = 1; s <= n; s++) {
  51269. var M = (n + 1) * (l - 1) + (s - 1),
  51270. R = (n + 1) * l + (s - 1),
  51271. P = (n + 1) * l + s,
  51272. O = (n + 1) * (l - 1) + s
  51273. 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++
  51274. }
  51275. this.setIndex(u), this.addAttribute('position', d), this.addAttribute('normal', p), this.addAttribute('uv', f)
  51276. }),
  51277. (Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  51278. (Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry),
  51279. (Ci.TorusKnotGeometry = function (e, t, i, n, r, o, a) {
  51280. Ci.Geometry.call(this),
  51281. (this.type = 'TorusKnotGeometry'),
  51282. (this.parameters = {
  51283. radius: e,
  51284. tube: t,
  51285. tubularSegments: i,
  51286. radialSegments: n,
  51287. p: r,
  51288. q: o
  51289. }),
  51290. void 0 !== a && console.warn('THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead.'),
  51291. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e, t, i, n, r, o)),
  51292. this.mergeVertices()
  51293. }),
  51294. (Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  51295. (Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry),
  51296. (Ci.TubeGeometry = function (e, t, i, n, r, o) {
  51297. Ci.Geometry.call(this),
  51298. (this.type = 'TubeGeometry'),
  51299. (this.parameters = {
  51300. path: e,
  51301. segments: t,
  51302. radius: i,
  51303. radialSegments: n,
  51304. closed: r,
  51305. taper: o
  51306. }),
  51307. (t = t || 64),
  51308. (i = i || 1),
  51309. (n = n || 8),
  51310. (r = r || !1),
  51311. (o = o || Ci.TubeGeometry.NoTaper)
  51312. var a,
  51313. s,
  51314. l,
  51315. c,
  51316. h,
  51317. u,
  51318. d,
  51319. p,
  51320. f,
  51321. g,
  51322. m,
  51323. v,
  51324. y,
  51325. A,
  51326. C,
  51327. I,
  51328. E,
  51329. _,
  51330. b,
  51331. w,
  51332. T,
  51333. x,
  51334. S,
  51335. M = [],
  51336. R = this,
  51337. P = t + 1,
  51338. O = new Ci.Vector3(),
  51339. L = new Ci.TubeGeometry.FrenetFrames(e, t, r),
  51340. D = L.tangents,
  51341. N = L.normals,
  51342. F = L.binormals
  51343. for (this.tangents = D, this.normals = N, this.binormals = F, f = 0; f < P; f++)
  51344. 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++)
  51345. (c = (g / n) * 2 * Math.PI),
  51346. (u = -h * Math.cos(c)),
  51347. (d = h * Math.sin(c)),
  51348. O.copy(p),
  51349. (O.x += u * a.x + d * s.x),
  51350. (O.y += u * a.y + d * s.y),
  51351. (O.z += u * a.z + d * s.z),
  51352. (M[f][g] = ((T = O.x), (x = O.y), (S = O.z), R.vertices.push(new Ci.Vector3(T, x, S)) - 1))
  51353. for (f = 0; f < t; f++)
  51354. for (g = 0; g < n; g++)
  51355. (m = r ? (f + 1) % t : f + 1),
  51356. (v = (g + 1) % n),
  51357. (y = M[f][g]),
  51358. (A = M[m][g]),
  51359. (C = M[m][v]),
  51360. (I = M[f][v]),
  51361. (E = new Ci.Vector2(f / t, g / n)),
  51362. (_ = new Ci.Vector2((f + 1) / t, g / n)),
  51363. (b = new Ci.Vector2((f + 1) / t, (g + 1) / n)),
  51364. (w = new Ci.Vector2(f / t, (g + 1) / n)),
  51365. this.faces.push(new Ci.Face3(y, A, I)),
  51366. this.faceVertexUvs[0].push([E, _, w]),
  51367. this.faces.push(new Ci.Face3(A, C, I)),
  51368. this.faceVertexUvs[0].push([_.clone(), b, w.clone()])
  51369. this.computeFaceNormals(), this.computeVertexNormals()
  51370. }),
  51371. (Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  51372. (Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry),
  51373. (Ci.TubeGeometry.NoTaper = function (e) {
  51374. return 1
  51375. }),
  51376. (Ci.TubeGeometry.SinusoidalTaper = function (e) {
  51377. return Math.sin(Math.PI * e)
  51378. }),
  51379. (Ci.TubeGeometry.FrenetFrames = function (e, t, i) {
  51380. var n,
  51381. r,
  51382. o,
  51383. a,
  51384. s,
  51385. l,
  51386. c,
  51387. h = new Ci.Vector3(),
  51388. u = [],
  51389. d = [],
  51390. p = [],
  51391. f = new Ci.Vector3(),
  51392. g = new Ci.Matrix4(),
  51393. m = t + 1
  51394. 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()
  51395. for (
  51396. d[0] = new Ci.Vector3(),
  51397. p[0] = new Ci.Vector3(),
  51398. r = Number.MAX_VALUE,
  51399. o = Math.abs(u[0].x),
  51400. a = Math.abs(u[0].y),
  51401. s = Math.abs(u[0].z),
  51402. o <= r && ((r = o), h.set(1, 0, 0)),
  51403. a <= r && ((r = a), h.set(0, 1, 0)),
  51404. s <= r && h.set(0, 0, 1),
  51405. f.crossVectors(u[0], h).normalize(),
  51406. d[0].crossVectors(u[0], f),
  51407. p[0].crossVectors(u[0], d[0]),
  51408. l = 1;
  51409. l < m;
  51410. l++
  51411. )
  51412. (d[l] = d[l - 1].clone()),
  51413. (p[l] = p[l - 1].clone()),
  51414. f.crossVectors(u[l - 1], u[l]),
  51415. 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))),
  51416. p[l].crossVectors(u[l], d[l])
  51417. if (i)
  51418. 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++)
  51419. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)), p[l].crossVectors(u[l], d[l])
  51420. }),
  51421. (Ci.PolyhedronGeometry = function (e, t, i, n) {
  51422. function f(e) {
  51423. var t = e.normalize().clone()
  51424. t.index = m.vertices.push(t) - 1
  51425. var i = a(e) / 2 / Math.PI + 0.5,
  51426. n =
  51427. (function (e) {
  51428. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  51429. })(e) /
  51430. Math.PI +
  51431. 0.5
  51432. return (t.uv = new Ci.Vector2(i, 1 - n)), t
  51433. }
  51434. function g(e, t, i, n) {
  51435. var r = new Ci.Face3(e.index, t.index, i.index, [e.clone(), t.clone(), i.clone()], void 0, n)
  51436. m.faces.push(r), y.copy(e).add(t).add(i).divideScalar(3)
  51437. var o = a(y)
  51438. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  51439. }
  51440. function r(e, t) {
  51441. 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++) {
  51442. a[l] = []
  51443. 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))
  51444. }
  51445. for (l = 0; l < i; l++)
  51446. for (d = 0; d < 2 * (i - l) - 1; d++) {
  51447. var p = Math.floor(d / 2)
  51448. 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)
  51449. }
  51450. }
  51451. function a(e) {
  51452. return Math.atan2(e.z, -e.x)
  51453. }
  51454. function s(e, t, i) {
  51455. 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()
  51456. }
  51457. Ci.Geometry.call(this),
  51458. (this.type = 'PolyhedronGeometry'),
  51459. (this.parameters = {
  51460. vertices: e,
  51461. indices: t,
  51462. radius: i,
  51463. detail: n
  51464. }),
  51465. (i = i || 1),
  51466. (n = n || 0)
  51467. 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]))
  51468. var c = this.vertices,
  51469. h = [],
  51470. u = ((o = 0), 0)
  51471. for (l = t.length; o < l; o += 3, u++) {
  51472. var d = c[t[o]],
  51473. p = c[t[o + 1]],
  51474. v = c[t[o + 2]]
  51475. h[u] = new Ci.Face3(d.index, p.index, v.index, [d.clone(), p.clone(), v.clone()], void 0, u)
  51476. }
  51477. var y = new Ci.Vector3()
  51478. for (o = 0, l = h.length; o < l; o++) r(h[o], n)
  51479. for (o = 0, l = this.faceVertexUvs[0].length; o < l; o++) {
  51480. var A = this.faceVertexUvs[0][o],
  51481. C = A[0].x,
  51482. I = A[1].x,
  51483. E = A[2].x,
  51484. _ = Math.max(C, I, E),
  51485. b = Math.min(C, I, E)
  51486. 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))
  51487. }
  51488. for (o = 0, l = this.vertices.length; o < l; o++) this.vertices[o].multiplyScalar(i)
  51489. this.mergeVertices(), this.computeFaceNormals(), (this.boundingSphere = new Ci.Sphere(new Ci.Vector3(), i))
  51490. }),
  51491. (Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  51492. (Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry),
  51493. (Ci.DodecahedronGeometry = function (e, t) {
  51494. var i = (1 + Math.sqrt(5)) / 2,
  51495. n = 1 / i,
  51496. r = [
  51497. -1,
  51498. -1,
  51499. -1,
  51500. -1,
  51501. -1,
  51502. 1,
  51503. -1,
  51504. 1,
  51505. -1,
  51506. -1,
  51507. 1,
  51508. 1,
  51509. 1,
  51510. -1,
  51511. -1,
  51512. 1,
  51513. -1,
  51514. 1,
  51515. 1,
  51516. 1,
  51517. -1,
  51518. 1,
  51519. 1,
  51520. 1,
  51521. 0,
  51522. -n,
  51523. -i,
  51524. 0,
  51525. -n,
  51526. i,
  51527. 0,
  51528. n,
  51529. -i,
  51530. 0,
  51531. n,
  51532. i,
  51533. -n,
  51534. -i,
  51535. 0,
  51536. -n,
  51537. i,
  51538. 0,
  51539. n,
  51540. -i,
  51541. 0,
  51542. n,
  51543. i,
  51544. 0,
  51545. -i,
  51546. 0,
  51547. -n,
  51548. i,
  51549. 0,
  51550. -n,
  51551. -i,
  51552. 0,
  51553. n,
  51554. i,
  51555. 0,
  51556. n
  51557. ]
  51558. Ci.PolyhedronGeometry.call(
  51559. this,
  51560. r,
  51561. [
  51562. 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,
  51563. 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,
  51564. 1, 5, 9
  51565. ],
  51566. e,
  51567. t
  51568. ),
  51569. (this.type = 'DodecahedronGeometry'),
  51570. (this.parameters = {
  51571. radius: e,
  51572. detail: t
  51573. })
  51574. }),
  51575. (Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype)),
  51576. (Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry),
  51577. (Ci.IcosahedronGeometry = function (e, t) {
  51578. var i = (1 + Math.sqrt(5)) / 2,
  51579. 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]
  51580. Ci.PolyhedronGeometry.call(
  51581. this,
  51582. n,
  51583. [
  51584. 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,
  51585. 9, 8, 1
  51586. ],
  51587. e,
  51588. t
  51589. ),
  51590. (this.type = 'IcosahedronGeometry'),
  51591. (this.parameters = {
  51592. radius: e,
  51593. detail: t
  51594. })
  51595. }),
  51596. (Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype)),
  51597. (Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry),
  51598. (Ci.OctahedronGeometry = function (e, t) {
  51599. 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),
  51600. (this.type = 'OctahedronGeometry'),
  51601. (this.parameters = {
  51602. radius: e,
  51603. detail: t
  51604. })
  51605. }),
  51606. (Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype)),
  51607. (Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry),
  51608. (Ci.TetrahedronGeometry = function (e, t) {
  51609. 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),
  51610. (this.type = 'TetrahedronGeometry'),
  51611. (this.parameters = {
  51612. radius: e,
  51613. detail: t
  51614. })
  51615. }),
  51616. (Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype)),
  51617. (Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry),
  51618. (Ci.ParametricGeometry = function (e, t, i) {
  51619. Ci.Geometry.call(this),
  51620. (this.type = 'ParametricGeometry'),
  51621. (this.parameters = {
  51622. func: e,
  51623. slices: t,
  51624. stacks: i
  51625. })
  51626. var n,
  51627. r,
  51628. o,
  51629. a,
  51630. s,
  51631. l,
  51632. c,
  51633. h,
  51634. u,
  51635. d,
  51636. p,
  51637. f,
  51638. g = this.vertices,
  51639. m = this.faces,
  51640. v = this.faceVertexUvs[0],
  51641. y = t + 1
  51642. for (n = 0; n <= i; n++) for (a = n / i, r = 0; r <= t; r++) (o = e(r / t, a)), g.push(o)
  51643. for (n = 0; n < i; n++)
  51644. for (r = 0; r < t; r++)
  51645. (l = (s = n * y + r) + 1),
  51646. (c = (n + 1) * y + r + 1),
  51647. (h = (n + 1) * y + r),
  51648. (u = new Ci.Vector2(r / t, n / i)),
  51649. (d = new Ci.Vector2((r + 1) / t, n / i)),
  51650. (p = new Ci.Vector2((r + 1) / t, (n + 1) / i)),
  51651. (f = new Ci.Vector2(r / t, (n + 1) / i)),
  51652. m.push(new Ci.Face3(s, l, h)),
  51653. v.push([u, d, f]),
  51654. m.push(new Ci.Face3(l, c, h)),
  51655. v.push([d.clone(), p, f.clone()])
  51656. this.computeFaceNormals(), this.computeVertexNormals()
  51657. }),
  51658. (Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype)),
  51659. (Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry),
  51660. (Ci.WireframeGeometry = function (e) {
  51661. function t(e, t) {
  51662. return e - t
  51663. }
  51664. Ci.BufferGeometry.call(this)
  51665. var i = [0, 0],
  51666. n = {},
  51667. r = ['a', 'b', 'c']
  51668. if (e instanceof Ci.Geometry) {
  51669. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  51670. for (var u = a[c], d = 0; d < 3; d++) {
  51671. ;(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++)
  51672. }
  51673. var p = new Float32Array(2 * s * 3)
  51674. for (c = 0, h = s; c < h; c++)
  51675. for (d = 0; d < 2; d++) {
  51676. var f = o[l[2 * c + d]]
  51677. ;(p[(_ = 6 * c + 3 * d) + 0] = f.x), (p[_ + 1] = f.y), (p[_ + 2] = f.z)
  51678. }
  51679. this.addAttribute('position', new Ci.BufferAttribute(p, 3))
  51680. } else if (e instanceof Ci.BufferGeometry)
  51681. if (null !== e.index) {
  51682. var g = e.index.array,
  51683. m = ((o = e.attributes.position), e.groups)
  51684. s = 0
  51685. 0 === m.length && e.addGroup(0, g.length)
  51686. l = new Uint32Array(2 * g.length)
  51687. for (var v = 0, y = m.length; v < y; ++v)
  51688. for (var A = m[v], C = A.start, I = ((c = C), C + A.count); c < I; c += 3)
  51689. for (d = 0; d < 3; d++) {
  51690. var E
  51691. ;(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++)
  51692. }
  51693. for (p = new Float32Array(2 * s * 3), c = 0, h = s; c < h; c++)
  51694. for (d = 0; d < 2; d++) {
  51695. var _ = 6 * c + 3 * d,
  51696. b = l[2 * c + d]
  51697. ;(p[_ + 0] = o.getX(b)), (p[_ + 1] = o.getY(b)), (p[_ + 2] = o.getZ(b))
  51698. }
  51699. this.addAttribute('position', new Ci.BufferAttribute(p, 3))
  51700. } else {
  51701. var w = (s = (o = e.attributes.position.array).length / 3) / 3
  51702. for (p = new Float32Array(2 * s * 3), c = 0, h = w; c < h; c++)
  51703. for (d = 0; d < 3; d++) {
  51704. var T = 9 * c + 3 * d
  51705. ;(p[(_ = 18 * c + 6 * d) + 0] = o[T]), (p[_ + 1] = o[1 + T]), (p[_ + 2] = o[2 + T])
  51706. b = 9 * c + ((d + 1) % 3) * 3
  51707. ;(p[_ + 3] = o[b]), (p[_ + 4] = o[b + 1]), (p[_ + 5] = o[b + 2])
  51708. }
  51709. this.addAttribute('position', new Ci.BufferAttribute(p, 3))
  51710. }
  51711. }),
  51712. (Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype)),
  51713. (Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry),
  51714. (Ci.AxisHelper = function (e) {
  51715. e = e || 1
  51716. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e]),
  51717. i = new Float32Array([1, 0, 0, 1, 0.6, 0, 0, 1, 0, 0.6, 1, 0, 0, 0, 1, 0, 0.6, 1]),
  51718. n = new Ci.BufferGeometry()
  51719. n.addAttribute('position', new Ci.BufferAttribute(t, 3)), n.addAttribute('color', new Ci.BufferAttribute(i, 3))
  51720. var r = new Ci.LineBasicMaterial({
  51721. vertexColors: Ci.VertexColors
  51722. })
  51723. Ci.LineSegments.call(this, n, r)
  51724. }),
  51725. (Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype)),
  51726. (Ci.AxisHelper.prototype.constructor = Ci.AxisHelper),
  51727. (Ci.ArrowHelper = (function () {
  51728. var a = new Ci.Geometry()
  51729. a.vertices.push(new Ci.Vector3(0, 0, 0), new Ci.Vector3(0, 1, 0))
  51730. var s = new Ci.CylinderGeometry(0, 0.5, 1, 5, 1)
  51731. return (
  51732. s.translate(0, -0.5, 0),
  51733. function (e, t, i, n, r, o) {
  51734. Ci.Object3D.call(this),
  51735. void 0 === n && (n = 16776960),
  51736. void 0 === i && (i = 1),
  51737. void 0 === r && (r = 0.2 * i),
  51738. void 0 === o && (o = 0.2 * r),
  51739. this.position.copy(t),
  51740. (this.line = new Ci.Line(
  51741. a,
  51742. new Ci.LineBasicMaterial({
  51743. color: n
  51744. })
  51745. )),
  51746. (this.line.matrixAutoUpdate = !1),
  51747. this.add(this.line),
  51748. (this.cone = new Ci.Mesh(
  51749. s,
  51750. new Ci.MeshBasicMaterial({
  51751. color: n
  51752. })
  51753. )),
  51754. (this.cone.matrixAutoUpdate = !1),
  51755. this.add(this.cone),
  51756. this.setDirection(e),
  51757. this.setLength(i, r, o)
  51758. }
  51759. )
  51760. })()),
  51761. (Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype)),
  51762. (Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper),
  51763. (Ci.ArrowHelper.prototype.setDirection =
  51764. ((Ai = new Ci.Vector3()),
  51765. function (e) {
  51766. 0.99999 < e.y
  51767. ? this.quaternion.set(0, 0, 0, 1)
  51768. : e.y < -0.99999
  51769. ? this.quaternion.set(1, 0, 0, 0)
  51770. : (Ai.set(e.z, 0, -e.x).normalize(), (yi = Math.acos(e.y)), this.quaternion.setFromAxisAngle(Ai, yi))
  51771. })),
  51772. (Ci.ArrowHelper.prototype.setLength = function (e, t, i) {
  51773. void 0 === t && (t = 0.2 * e),
  51774. void 0 === i && (i = 0.2 * t),
  51775. this.line.scale.set(1, Math.max(0, e - t), 1),
  51776. this.line.updateMatrix(),
  51777. this.cone.scale.set(i, t, i),
  51778. (this.cone.position.y = e),
  51779. this.cone.updateMatrix()
  51780. }),
  51781. (Ci.ArrowHelper.prototype.setColor = function (e) {
  51782. this.line.material.color.set(e), this.cone.material.color.set(e)
  51783. }),
  51784. (Ci.BoxHelper = function (e) {
  51785. 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]),
  51786. i = new Float32Array(24),
  51787. n = new Ci.BufferGeometry()
  51788. n.setIndex(new Ci.BufferAttribute(t, 1)),
  51789. n.addAttribute('position', new Ci.BufferAttribute(i, 3)),
  51790. Ci.LineSegments.call(
  51791. this,
  51792. n,
  51793. new Ci.LineBasicMaterial({
  51794. color: 16776960
  51795. })
  51796. ),
  51797. void 0 !== e && this.update(e)
  51798. }),
  51799. (Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype)),
  51800. (Ci.BoxHelper.prototype.constructor = Ci.BoxHelper),
  51801. (Ci.BoxHelper.prototype.update =
  51802. ((vi = new Ci.Box3()),
  51803. function (e) {
  51804. if ((vi.setFromObject(e), !vi.isEmpty())) {
  51805. var t = vi.min,
  51806. i = vi.max,
  51807. n = this.geometry.attributes.position,
  51808. r = n.array
  51809. ;(r[0] = i.x),
  51810. (r[1] = i.y),
  51811. (r[2] = i.z),
  51812. (r[3] = t.x),
  51813. (r[4] = i.y),
  51814. (r[5] = i.z),
  51815. (r[6] = t.x),
  51816. (r[7] = t.y),
  51817. (r[8] = i.z),
  51818. (r[9] = i.x),
  51819. (r[10] = t.y),
  51820. (r[11] = i.z),
  51821. (r[12] = i.x),
  51822. (r[13] = i.y),
  51823. (r[14] = t.z),
  51824. (r[15] = t.x),
  51825. (r[16] = i.y),
  51826. (r[17] = t.z),
  51827. (r[18] = t.x),
  51828. (r[19] = t.y),
  51829. (r[20] = t.z),
  51830. (r[21] = i.x),
  51831. (r[22] = t.y),
  51832. (r[23] = t.z),
  51833. (n.needsUpdate = !0),
  51834. this.geometry.computeBoundingSphere()
  51835. }
  51836. })),
  51837. (Ci.BoundingBoxHelper = function (e, t) {
  51838. var i = void 0 !== t ? t : 8947848
  51839. ;(this.object = e),
  51840. (this.box = new Ci.Box3()),
  51841. Ci.Mesh.call(
  51842. this,
  51843. new Ci.BoxGeometry(1, 1, 1),
  51844. new Ci.MeshBasicMaterial({
  51845. color: i,
  51846. wireframe: !0
  51847. })
  51848. )
  51849. }),
  51850. (Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype)),
  51851. (Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper),
  51852. (Ci.BoundingBoxHelper.prototype.update = function () {
  51853. this.box.setFromObject(this.object), this.box.size(this.scale), this.box.center(this.position)
  51854. }),
  51855. (Ci.CameraHelper = function (e) {
  51856. function t(e, t, i) {
  51857. n(e, i), n(t, i)
  51858. }
  51859. function n(e, t) {
  51860. 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)
  51861. }
  51862. var i = new Ci.Geometry(),
  51863. r = new Ci.LineBasicMaterial({
  51864. color: 16777215,
  51865. vertexColors: Ci.FaceColors
  51866. }),
  51867. o = {},
  51868. a = 16755200,
  51869. s = 16711680,
  51870. l = 3355443
  51871. t('n1', 'n2', a),
  51872. t('n2', 'n4', a),
  51873. t('n4', 'n3', a),
  51874. t('n3', 'n1', a),
  51875. t('f1', 'f2', a),
  51876. t('f2', 'f4', a),
  51877. t('f4', 'f3', a),
  51878. t('f3', 'f1', a),
  51879. t('n1', 'f1', a),
  51880. t('n2', 'f2', a),
  51881. t('n3', 'f3', a),
  51882. t('n4', 'f4', a),
  51883. t('p', 'n1', s),
  51884. t('p', 'n2', s),
  51885. t('p', 'n3', s),
  51886. t('p', 'n4', s),
  51887. t('u1', 'u2', 43775),
  51888. t('u2', 'u3', 43775),
  51889. t('u3', 'u1', 43775),
  51890. t('c', 't', 16777215),
  51891. t('p', 'c', l),
  51892. t('cn1', 'cn2', l),
  51893. t('cn3', 'cn4', l),
  51894. t('cf1', 'cf2', l),
  51895. t('cf3', 'cf4', l),
  51896. Ci.LineSegments.call(this, i, r),
  51897. (this.camera = e),
  51898. this.camera.updateProjectionMatrix(),
  51899. (this.matrix = e.matrixWorld),
  51900. (this.matrixAutoUpdate = !1),
  51901. (this.pointMap = o),
  51902. this.update()
  51903. }),
  51904. (Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype)),
  51905. (Ci.CameraHelper.prototype.constructor = Ci.CameraHelper),
  51906. (Ci.CameraHelper.prototype.update =
  51907. ((gi = new Ci.Vector3()),
  51908. (mi = new Ci.Camera()),
  51909. function () {
  51910. ;(pi = this.geometry),
  51911. (fi = this.pointMap),
  51912. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  51913. Ni('c', 0, 0, -1),
  51914. Ni('t', 0, 0, 1),
  51915. Ni('n1', -1, -1, -1),
  51916. Ni('n2', 1, -1, -1),
  51917. Ni('n3', -1, 1, -1),
  51918. Ni('n4', 1, 1, -1),
  51919. Ni('f1', -1, -1, 1),
  51920. Ni('f2', 1, -1, 1),
  51921. Ni('f3', -1, 1, 1),
  51922. Ni('f4', 1, 1, 1),
  51923. Ni('u1', 0.7, 1.1, -1),
  51924. Ni('u2', -0.7, 1.1, -1),
  51925. Ni('u3', 0, 2, -1),
  51926. Ni('cf1', -1, 0, 1),
  51927. Ni('cf2', 1, 0, 1),
  51928. Ni('cf3', 0, -1, 1),
  51929. Ni('cf4', 0, 1, 1),
  51930. Ni('cn1', -1, 0, -1),
  51931. Ni('cn2', 1, 0, -1),
  51932. Ni('cn3', 0, -1, -1),
  51933. Ni('cn4', 0, 1, -1),
  51934. (pi.verticesNeedUpdate = !0)
  51935. })),
  51936. (Ci.DirectionalLightHelper = function (e, t) {
  51937. Ci.Object3D.call(this), (this.light = e), this.light.updateMatrixWorld(), (this.matrix = e.matrixWorld), (this.matrixAutoUpdate = !1), (t = t || 1)
  51938. var i = new Ci.Geometry()
  51939. 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))
  51940. var n = new Ci.LineBasicMaterial({
  51941. fog: !1
  51942. })
  51943. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  51944. (this.lightPlane = new Ci.Line(i, n)),
  51945. this.add(this.lightPlane),
  51946. (i = new Ci.Geometry()).vertices.push(new Ci.Vector3(), new Ci.Vector3()),
  51947. (n = new Ci.LineBasicMaterial({
  51948. fog: !1
  51949. })).color
  51950. .copy(this.light.color)
  51951. .multiplyScalar(this.light.intensity),
  51952. (this.targetLine = new Ci.Line(i, n)),
  51953. this.add(this.targetLine),
  51954. this.update()
  51955. }),
  51956. (Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype)),
  51957. (Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper),
  51958. (Ci.DirectionalLightHelper.prototype.dispose = function () {
  51959. this.lightPlane.geometry.dispose(), this.lightPlane.material.dispose(), this.targetLine.geometry.dispose(), this.targetLine.material.dispose()
  51960. }),
  51961. (Ci.DirectionalLightHelper.prototype.update =
  51962. ((hi = new Ci.Vector3()),
  51963. (ui = new Ci.Vector3()),
  51964. (di = new Ci.Vector3()),
  51965. function () {
  51966. hi.setFromMatrixPosition(this.light.matrixWorld),
  51967. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  51968. di.subVectors(ui, hi),
  51969. this.lightPlane.lookAt(di),
  51970. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  51971. this.targetLine.geometry.vertices[1].copy(di),
  51972. (this.targetLine.geometry.verticesNeedUpdate = !0),
  51973. this.targetLine.material.color.copy(this.lightPlane.material.color)
  51974. })),
  51975. (Ci.EdgesHelper = function (e, t, i) {
  51976. var n = void 0 !== t ? t : 16777215
  51977. Ci.LineSegments.call(
  51978. this,
  51979. new Ci.EdgesGeometry(e.geometry, i),
  51980. new Ci.LineBasicMaterial({
  51981. color: n
  51982. })
  51983. ),
  51984. (this.matrix = e.matrixWorld),
  51985. (this.matrixAutoUpdate = !1)
  51986. }),
  51987. (Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype)),
  51988. (Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper),
  51989. (Ci.FaceNormalsHelper = function (e, t, i, n) {
  51990. ;(this.object = e), (this.size = void 0 !== t ? t : 1)
  51991. var r = void 0 !== i ? i : 16776960,
  51992. o = void 0 !== n ? n : 1,
  51993. a = 0,
  51994. s = this.object.geometry
  51995. s instanceof Ci.Geometry ? (a = s.faces.length) : console.warn('THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.')
  51996. var l = new Ci.BufferGeometry(),
  51997. c = new Ci.Float32Attribute(2 * a * 3, 3)
  51998. l.addAttribute('position', c),
  51999. Ci.LineSegments.call(
  52000. this,
  52001. l,
  52002. new Ci.LineBasicMaterial({
  52003. color: r,
  52004. linewidth: o
  52005. })
  52006. ),
  52007. (this.matrixAutoUpdate = !1),
  52008. this.update()
  52009. }),
  52010. (Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype)),
  52011. (Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper),
  52012. (Ci.FaceNormalsHelper.prototype.update =
  52013. ((si = new Ci.Vector3()),
  52014. (li = new Ci.Vector3()),
  52015. (ci = new Ci.Matrix3()),
  52016. function () {
  52017. this.object.updateMatrixWorld(!0), ci.getNormalMatrix(this.object.matrixWorld)
  52018. 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++) {
  52019. var l = r[a],
  52020. c = l.normal
  52021. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  52022. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  52023. t.setXYZ(o, si.x, si.y, si.z),
  52024. (o += 1),
  52025. t.setXYZ(o, li.x, li.y, li.z),
  52026. (o += 1)
  52027. }
  52028. return (t.needsUpdate = !0), this
  52029. })),
  52030. (Ci.GridHelper = function (e, t) {
  52031. var i = new Ci.Geometry(),
  52032. n = new Ci.LineBasicMaterial({
  52033. vertexColors: Ci.VertexColors
  52034. })
  52035. ;(this.color1 = new Ci.Color(4473924)), (this.color2 = new Ci.Color(8947848))
  52036. for (var r = -e; r <= e; r += t) {
  52037. 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))
  52038. var o = 0 === r ? this.color1 : this.color2
  52039. i.colors.push(o, o, o, o)
  52040. }
  52041. Ci.LineSegments.call(this, i, n)
  52042. }),
  52043. (Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype)),
  52044. (Ci.GridHelper.prototype.constructor = Ci.GridHelper),
  52045. (Ci.GridHelper.prototype.setColors = function (e, t) {
  52046. this.color1.set(e), this.color2.set(t), (this.geometry.colorsNeedUpdate = !0)
  52047. }),
  52048. (Ci.HemisphereLightHelper = function (e, t) {
  52049. 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()])
  52050. var i = new Ci.SphereGeometry(t, 4, 2)
  52051. i.rotateX(-Math.PI / 2)
  52052. for (var n = 0; n < 8; n++) i.faces[n].color = this.colors[n < 4 ? 0 : 1]
  52053. var r = new Ci.MeshBasicMaterial({
  52054. vertexColors: Ci.FaceColors,
  52055. wireframe: !0
  52056. })
  52057. ;(this.lightSphere = new Ci.Mesh(i, r)), this.add(this.lightSphere), this.update()
  52058. }),
  52059. (Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype)),
  52060. (Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper),
  52061. (Ci.HemisphereLightHelper.prototype.dispose = function () {
  52062. this.lightSphere.geometry.dispose(), this.lightSphere.material.dispose()
  52063. }),
  52064. (Ci.HemisphereLightHelper.prototype.update =
  52065. ((ai = new Ci.Vector3()),
  52066. function () {
  52067. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  52068. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  52069. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  52070. (this.lightSphere.geometry.colorsNeedUpdate = !0)
  52071. })),
  52072. (Ci.PointLightHelper = function (e, t) {
  52073. ;(this.light = e), this.light.updateMatrixWorld()
  52074. var i = new Ci.SphereGeometry(t, 4, 2),
  52075. n = new Ci.MeshBasicMaterial({
  52076. wireframe: !0,
  52077. fog: !1
  52078. })
  52079. n.color.copy(this.light.color).multiplyScalar(this.light.intensity), Ci.Mesh.call(this, i, n), (this.matrix = this.light.matrixWorld), (this.matrixAutoUpdate = !1)
  52080. }),
  52081. (Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype)),
  52082. (Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper),
  52083. (Ci.PointLightHelper.prototype.dispose = function () {
  52084. this.geometry.dispose(), this.material.dispose()
  52085. }),
  52086. (Ci.PointLightHelper.prototype.update = function () {
  52087. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  52088. }),
  52089. (Ci.SkeletonHelper = function (e) {
  52090. this.bones = this.getBoneList(e)
  52091. for (var t = new Ci.Geometry(), i = 0; i < this.bones.length; i++) {
  52092. this.bones[i].parent instanceof Ci.Bone &&
  52093. (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)))
  52094. }
  52095. t.dynamic = !0
  52096. var n = new Ci.LineBasicMaterial({
  52097. vertexColors: Ci.VertexColors,
  52098. depthTest: !1,
  52099. depthWrite: !1,
  52100. transparent: !0
  52101. })
  52102. Ci.LineSegments.call(this, t, n), (this.root = e), (this.matrix = e.matrixWorld), (this.matrixAutoUpdate = !1), this.update()
  52103. }),
  52104. (Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype)),
  52105. (Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper),
  52106. (Ci.SkeletonHelper.prototype.getBoneList = function (e) {
  52107. var t = []
  52108. e instanceof Ci.Bone && t.push(e)
  52109. for (var i = 0; i < e.children.length; i++) t.push.apply(t, this.getBoneList(e.children[i]))
  52110. return t
  52111. }),
  52112. (Ci.SkeletonHelper.prototype.update = function () {
  52113. 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++) {
  52114. var o = this.bones[r]
  52115. o.parent instanceof Ci.Bone &&
  52116. (i.multiplyMatrices(t, o.matrixWorld), e.vertices[n].setFromMatrixPosition(i), i.multiplyMatrices(t, o.parent.matrixWorld), e.vertices[n + 1].setFromMatrixPosition(i), (n += 2))
  52117. }
  52118. ;(e.verticesNeedUpdate = !0), e.computeBoundingSphere()
  52119. }),
  52120. (Ci.SpotLightHelper = function (e) {
  52121. Ci.Object3D.call(this), (this.light = e), this.light.updateMatrixWorld(), (this.matrix = e.matrixWorld), (this.matrixAutoUpdate = !1)
  52122. var t = new Ci.CylinderGeometry(0, 1, 1, 8, 1, !0)
  52123. t.translate(0, -0.5, 0), t.rotateX(-Math.PI / 2)
  52124. var i = new Ci.MeshBasicMaterial({
  52125. wireframe: !0,
  52126. fog: !1
  52127. })
  52128. ;(this.cone = new Ci.Mesh(t, i)), this.add(this.cone), this.update()
  52129. }),
  52130. (Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype)),
  52131. (Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper),
  52132. (Ci.SpotLightHelper.prototype.dispose = function () {
  52133. this.cone.geometry.dispose(), this.cone.material.dispose()
  52134. }),
  52135. (Ci.SpotLightHelper.prototype.update =
  52136. ((ri = new Ci.Vector3()),
  52137. (oi = new Ci.Vector3()),
  52138. function () {
  52139. var e = this.light.distance ? this.light.distance : 1e4,
  52140. t = e * Math.tan(this.light.angle)
  52141. this.cone.scale.set(t, t, e),
  52142. ri.setFromMatrixPosition(this.light.matrixWorld),
  52143. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  52144. this.cone.lookAt(oi.sub(ri)),
  52145. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  52146. })),
  52147. (Ci.VertexNormalsHelper = function (e, t, i, n) {
  52148. ;(this.object = e), (this.size = void 0 !== t ? t : 1)
  52149. var r = void 0 !== i ? i : 16711680,
  52150. o = void 0 !== n ? n : 1,
  52151. a = 0,
  52152. s = this.object.geometry
  52153. s instanceof Ci.Geometry ? (a = 3 * s.faces.length) : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count)
  52154. var l = new Ci.BufferGeometry(),
  52155. c = new Ci.Float32Attribute(2 * a * 3, 3)
  52156. l.addAttribute('position', c),
  52157. Ci.LineSegments.call(
  52158. this,
  52159. l,
  52160. new Ci.LineBasicMaterial({
  52161. color: r,
  52162. linewidth: o
  52163. })
  52164. ),
  52165. (this.matrixAutoUpdate = !1),
  52166. this.update()
  52167. }),
  52168. (Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype)),
  52169. (Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper),
  52170. (Ci.VertexNormalsHelper.prototype.update =
  52171. ((ti = new Ci.Vector3()),
  52172. (ii = new Ci.Vector3()),
  52173. (ni = new Ci.Matrix3()),
  52174. function () {
  52175. var e = ['a', 'b', 'c']
  52176. this.object.updateMatrixWorld(!0), ni.getNormalMatrix(this.object.matrixWorld)
  52177. var t = this.object.matrixWorld,
  52178. i = this.geometry.attributes.position,
  52179. n = this.object.geometry
  52180. if (n instanceof Ci.Geometry)
  52181. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  52182. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  52183. var d = r[c[e[h]]],
  52184. p = c.vertexNormals[h]
  52185. ti.copy(d).applyMatrix4(t),
  52186. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  52187. i.setXYZ(a, ti.x, ti.y, ti.z),
  52188. (a += 1),
  52189. i.setXYZ(a, ii.x, ii.y, ii.z),
  52190. (a += 1)
  52191. }
  52192. else if (n instanceof Ci.BufferGeometry) {
  52193. var f = n.attributes.position,
  52194. g = n.attributes.normal
  52195. for (h = a = 0, u = f.count; h < u; h++)
  52196. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  52197. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  52198. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  52199. i.setXYZ(a, ti.x, ti.y, ti.z),
  52200. (a += 1),
  52201. i.setXYZ(a, ii.x, ii.y, ii.z),
  52202. (a += 1)
  52203. }
  52204. return (i.needsUpdate = !0), this
  52205. })),
  52206. (Ci.WireframeHelper = function (e, t) {
  52207. var i = void 0 !== t ? t : 16777215
  52208. Ci.LineSegments.call(
  52209. this,
  52210. new Ci.WireframeGeometry(e.geometry),
  52211. new Ci.LineBasicMaterial({
  52212. color: i
  52213. })
  52214. ),
  52215. (this.matrix = e.matrixWorld),
  52216. (this.matrixAutoUpdate = !1)
  52217. }),
  52218. (Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype)),
  52219. (Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper),
  52220. (Ci.ImmediateRenderObject = function (e) {
  52221. Ci.Object3D.call(this), (this.material = e), (this.render = function (e) {})
  52222. }),
  52223. (Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype)),
  52224. (Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject),
  52225. (Ci.MorphBlendMesh = function (e, t) {
  52226. Ci.Mesh.call(this, e, t), (this.animationsMap = {}), (this.animationsList = [])
  52227. var i = this.geometry.morphTargets.length,
  52228. n = i - 1,
  52229. r = i / 1
  52230. this.createAnimation('__default', 0, n, r), this.setAnimationWeight('__default', 1)
  52231. }),
  52232. (Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype)),
  52233. (Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh),
  52234. (Ci.MorphBlendMesh.prototype.createAnimation = function (e, t, i, n) {
  52235. var r = {
  52236. start: t,
  52237. end: i,
  52238. length: i - t + 1,
  52239. fps: n,
  52240. duration: (i - t) / n,
  52241. lastFrame: 0,
  52242. currentFrame: 0,
  52243. active: !1,
  52244. time: 0,
  52245. direction: 1,
  52246. weight: 1,
  52247. directionBackwards: !1,
  52248. mirroredLoop: !1
  52249. }
  52250. ;(this.animationsMap[e] = r), this.animationsList.push(r)
  52251. }),
  52252. (Ci.MorphBlendMesh.prototype.autoCreateAnimations = function (e) {
  52253. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  52254. var s = r.morphTargets[o].name.match(i)
  52255. if (s && 1 < s.length)
  52256. n[(l = s[1])] ||
  52257. (n[l] = {
  52258. start: 1 / 0,
  52259. end: -1 / 0
  52260. }),
  52261. o < (c = n[l]).start && (c.start = o),
  52262. o > c.end && (c.end = o),
  52263. (t = t || l)
  52264. }
  52265. for (var l in n) {
  52266. var c = n[l]
  52267. this.createAnimation(l, c.start, c.end, e)
  52268. }
  52269. this.firstAnimation = t
  52270. }),
  52271. (Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function (e) {
  52272. var t = this.animationsMap[e]
  52273. t && ((t.direction = 1), (t.directionBackwards = !1))
  52274. }),
  52275. (Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function (e) {
  52276. var t = this.animationsMap[e]
  52277. t && ((t.direction = -1), (t.directionBackwards = !0))
  52278. }),
  52279. (Ci.MorphBlendMesh.prototype.setAnimationFPS = function (e, t) {
  52280. var i = this.animationsMap[e]
  52281. i && ((i.fps = t), (i.duration = (i.end - i.start) / i.fps))
  52282. }),
  52283. (Ci.MorphBlendMesh.prototype.setAnimationDuration = function (e, t) {
  52284. var i = this.animationsMap[e]
  52285. i && ((i.duration = t), (i.fps = (i.end - i.start) / i.duration))
  52286. }),
  52287. (Ci.MorphBlendMesh.prototype.setAnimationWeight = function (e, t) {
  52288. var i = this.animationsMap[e]
  52289. i && (i.weight = t)
  52290. }),
  52291. (Ci.MorphBlendMesh.prototype.setAnimationTime = function (e, t) {
  52292. var i = this.animationsMap[e]
  52293. i && (i.time = t)
  52294. }),
  52295. (Ci.MorphBlendMesh.prototype.getAnimationTime = function (e) {
  52296. var t = 0,
  52297. i = this.animationsMap[e]
  52298. return i && (t = i.time), t
  52299. }),
  52300. (Ci.MorphBlendMesh.prototype.getAnimationDuration = function (e) {
  52301. var t = -1,
  52302. i = this.animationsMap[e]
  52303. return i && (t = i.duration), t
  52304. }),
  52305. (Ci.MorphBlendMesh.prototype.playAnimation = function (e) {
  52306. var t = this.animationsMap[e]
  52307. t ? ((t.time = 0), (t.active = !0)) : console.warn('THREE.MorphBlendMesh: animation[' + e + '] undefined in .playAnimation()')
  52308. }),
  52309. (Ci.MorphBlendMesh.prototype.stopAnimation = function (e) {
  52310. var t = this.animationsMap[e]
  52311. t && (t.active = !1)
  52312. }),
  52313. (Ci.MorphBlendMesh.prototype.update = function (e) {
  52314. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  52315. var n = this.animationsList[t]
  52316. if (n.active) {
  52317. var r = n.duration / n.length
  52318. ;(n.time += n.direction * e),
  52319. n.mirroredLoop
  52320. ? (n.time > n.duration || n.time < 0) &&
  52321. ((n.direction *= -1), n.time > n.duration && ((n.time = n.duration), (n.directionBackwards = !0)), n.time < 0 && ((n.time = 0), (n.directionBackwards = !1)))
  52322. : ((n.time = n.time % n.duration), n.time < 0 && (n.time += n.duration))
  52323. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1),
  52324. a = n.weight
  52325. o !== n.currentFrame &&
  52326. ((this.morphTargetInfluences[n.lastFrame] = 0),
  52327. (this.morphTargetInfluences[n.currentFrame] = 1 * a),
  52328. (this.morphTargetInfluences[o] = 0),
  52329. (n.lastFrame = n.currentFrame),
  52330. (n.currentFrame = o))
  52331. var s = (n.time % r) / r
  52332. n.directionBackwards && (s = 1 - s),
  52333. n.currentFrame !== n.lastFrame
  52334. ? ((this.morphTargetInfluences[n.currentFrame] = s * a), (this.morphTargetInfluences[n.lastFrame] = (1 - s) * a))
  52335. : (this.morphTargetInfluences[n.currentFrame] = a)
  52336. }
  52337. }
  52338. }),
  52339. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci), (i.THREE = Ci)) : (this.THREE = Ci)
  52340. window.THREE = Ci
  52341. getObjLoader()
  52342. initByTHREE(THREE)
  52343. },
  52344. {}
  52345. ]
  52346. },
  52347. {},
  52348. [116]
  52349. )